@factorialco/f0-react 11.0.0 → 11.1.0
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/{ChatPostComposerDialog-BtPiTMRu.js → ChatPostComposerDialog-BRPhPg0V.js} +3 -3
- package/dist/{CoachmarkProvider-rDkLQ01u.js → CoachmarkProvider-Cv-8HfUP.js} +12978 -12978
- package/dist/{DocumentToolbar-KX3rz4K4.js → DocumentToolbar-Dibdy0XD.js} +5 -5
- package/dist/{DocxViewer-BSGDgnM3.js → DocxViewer-D4R37ej-.js} +2 -2
- package/dist/{F0AiProcessingOverlay-B3Spv9Lg.js → F0AiProcessingOverlay-DMiGnFsb.js} +926 -935
- package/dist/{F0CanvasPanel-BUFxHyKh.js → F0CanvasPanel-BwTjB_ef.js} +156 -127
- package/dist/{F0DocumentViewer-B5vLS5aP.js → F0DocumentViewer-CBDtqTP1.js} +8 -8
- package/dist/F0DocumentViewer-vZ5QrV_0.js +3 -0
- package/dist/{F0Map-FN0N9L8R.js → F0Map-xxT7h77R.js} +6 -6
- package/dist/{F0Select-Bzp4aOU7.js → F0Select-DSKdq9ZK.js} +2 -2
- package/dist/{F0Text-eOwHoc51.js → F0Text-CxMxdCn2.js} +2 -2
- package/dist/F0VideoPlayer-B96rE7Un.js +1 -0
- package/dist/{F0VideoPlayer-DRn2ln3H.js → F0VideoPlayer-BXkn2HYD.js} +276 -276
- package/dist/{Map-2DiynZpl.js → Map-DHXAVOwj.js} +9 -9
- package/dist/{PdfThumbnail-CST7SEFz.js → PdfThumbnail-CcphMSG_.js} +1 -1
- package/dist/{SheetViewer-DGsjtuo_.js → SheetViewer-Dfb0hEj5.js} +4 -4
- package/dist/{TextViewer-BjE8AxXq.js → TextViewer-D0aQleNb.js} +2 -2
- package/dist/ai.d.ts +3 -3
- package/dist/ai.js +5 -5
- package/dist/component-status.js +29 -7
- package/dist/{dist-Ck_UA8Lz.js → dist-B7gjXV8f.js} +1 -1
- package/dist/experimental.d.ts +4 -10
- package/dist/experimental.js +3724 -3740
- package/dist/{exports-BaPJp_sC.d.ts → exports-CYHNvlyA.d.ts} +1 -1
- package/dist/f0.d.ts +4 -4
- package/dist/f0.js +175 -175
- package/dist/{i18n-provider-defaults-Ch0JDGbK.js → i18n-provider-defaults-0FwmF5YL.js} +1 -0
- package/dist/{i18n-provider-defaults-D1lWzbYx.d.ts → i18n-provider-defaults-Yf7knX-_.d.ts} +3 -0
- package/dist/i18n-provider-defaults.d.ts +1 -1
- package/dist/i18n-provider-defaults.js +1 -1
- package/dist/{index-2J8R9Uml.d.ts → index-CvmeBmNt.d.ts} +68 -33
- package/dist/{index-Cw2Dwul8.d.ts → index-D7hTWma8.d.ts} +2 -2
- package/dist/{maplibre-Dj1I8pzk.js → maplibre-Be6fCegj.js} +1 -1
- package/dist/{pdfWorker-BYbuhKsY.js → pdfWorker-BrM0bRsr.js} +1 -1
- package/dist/{popover-DNcAIP25.js → popover-CL68oVjH.js} +1 -1
- package/dist/{useData-zygrn6e-.js → useData-B6HLHEev.js} +1 -1
- package/package.json +1 -1
- package/dist/F0DocumentViewer-bKmfYHcz.js +0 -3
- package/dist/F0VideoPlayer-wBssbLIF.js +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Ht as e, Mt as t, Zn as n, _t as r, a as i, ar as a, b as o, gn as s, hn as c, i as l, in as u, ln as d, n as f, rn as p, rr as m, t as h, un as g, vt as _, yt as v } from "./popover-
|
|
1
|
+
import { Ht as e, Mt as t, Zn as n, _t as r, a as i, ar as a, b as o, gn as s, hn as c, i as l, in as u, ln as d, n as f, rn as p, rr as m, t as h, un as g, vt as _, yt as v } from "./popover-CL68oVjH.js";
|
|
2
2
|
import { L as y, R as b } from "./tooltip-BX4dSfeL.js";
|
|
3
|
-
import { n as x, r as S } from "./F0Text-
|
|
4
|
-
import { $
|
|
5
|
-
import { t as
|
|
6
|
-
import { C as
|
|
7
|
-
import { Dn as
|
|
8
|
-
import { n as
|
|
9
|
-
import { createContext as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { createPortal as
|
|
12
|
-
import { useTrackVolume as
|
|
3
|
+
import { n as x, r as S } from "./F0Text-CxMxdCn2.js";
|
|
4
|
+
import { $ as C, At as w, B as T, C as E, Co as D, Ct as O, Ds as ee, Et as k, F as A, Gr as j, H as M, I as N, Ir as P, Jn as F, Kr as te, N as ne, Ns as re, Nt as I, Ot as ie, P as L, Q as ae, Qr as R, Ro as z, Rt as oe, S as se, So as ce, St as le, T as ue, Ua as de, Uo as fe, Ur as pe, V as me, Vo as he, Wr as ge, Xa as _e, Xo as ve, Xr as ye, a as be, bo as xe, bt as Se, d as Ce, dt as we, ei as Te, eo as Ee, er as De, g as Oe, h as ke, i as Ae, ir as je, jo as Me, ka as Ne, ks as B, l as Pe, lc as Fe, lt as Ie, m as Le, ma as Re, mo as ze, mr as Be, mt as Ve, no as He, nt as Ue, o as We, ot as Ge, pa as Ke, pr as qe, r as Je, ro as Ye, rt as Xe, st as Ze, to as Qe, ts as $e, tt as et, u as tt, uc as nt, ut as rt, va as it, vo as at, w as ot, x as st, xt as ct, yt as lt, z as V, za as ut, zi as dt } from "./F0CanvasPanel-BwTjB_ef.js";
|
|
5
|
+
import { t as ft } from "./i18n-provider-defaults-0FwmF5YL.js";
|
|
6
|
+
import { C as pt, D as mt, F as ht, J as gt, S as _t, V as vt, k as yt, l as bt, q as xt, x as St } from "./useData-B6HLHEev.js";
|
|
7
|
+
import { Dn as Ct, Dr as wt, Er as Tt, Ft as Et, Nr as Dt, On as Ot, Or as kt, Ot as At, _t as jt, cn as Mt, ct as Nt, gt as Pt, ht as Ft, jr as It, nn as Lt, sn as Rt, un as zt } from "./F0Select-DSKdq9ZK.js";
|
|
8
|
+
import { n as Bt } from "./dist-B7gjXV8f.js";
|
|
9
|
+
import { createContext as Vt, createElement as Ht, forwardRef as H, memo as Ut, useCallback as U, useContext as Wt, useEffect as W, useId as Gt, useInsertionEffect as Kt, useLayoutEffect as qt, useMemo as G, useRef as K, useState as q } from "react";
|
|
10
|
+
import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
|
|
11
|
+
import { createPortal as Jt } from "react-dom";
|
|
12
|
+
import { useTrackVolume as Yt } from "@livekit/components-react";
|
|
13
13
|
//#region ../../node_modules/.pnpm/motion@12.17.0_@emotion+is-prop-valid@1.3.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/motion/dist/es/framer-motion/dist/es/utils/use-motion-value-event.mjs
|
|
14
|
-
function
|
|
15
|
-
|
|
14
|
+
function Xt(e, t, n) {
|
|
15
|
+
Kt(() => e.on(t, n), [
|
|
16
16
|
e,
|
|
17
17
|
t,
|
|
18
18
|
n
|
|
@@ -20,28 +20,28 @@ function Yt(e, t, n) {
|
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/elements/ai/F0ActionItem/types.ts
|
|
23
|
-
var
|
|
23
|
+
var Zt = [
|
|
24
24
|
"inProgress",
|
|
25
25
|
"executing",
|
|
26
26
|
"writing",
|
|
27
27
|
"completed"
|
|
28
|
-
],
|
|
28
|
+
], Qt = [
|
|
29
29
|
"xs",
|
|
30
30
|
"sm",
|
|
31
31
|
"md",
|
|
32
32
|
"lg"
|
|
33
|
-
],
|
|
34
|
-
function
|
|
35
|
-
let n = e.length - e.trimStart().length, r = e.trimEnd().length, i = t.filter((t) => t.start >= n &&
|
|
36
|
-
for (let t of i) t.start < o ||
|
|
37
|
-
return a +
|
|
33
|
+
], $t = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), en = /[\\`*_{}[\]()#+\-.!|~>]/g, tn = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(en, "\\$&"), nn = (e) => `<entity-ref type="${$t(e.type)}" id="${$t(e.id)}">${$t(e.label)}</entity-ref>`, rn = (e, t) => e.slice(t.start, M(t)).normalize("NFC") === `@${t.label}`.normalize("NFC");
|
|
34
|
+
function an(e, t) {
|
|
35
|
+
let n = e.length - e.trimStart().length, r = e.trimEnd().length, i = t.filter((t) => t.start >= n && rn(e, t)).sort((e, t) => e.start - t.start), a = "", o = n;
|
|
36
|
+
for (let t of i) t.start < o || M(t) > r || (a += tn(e.slice(o, t.start)) + nn(t), o = M(t));
|
|
37
|
+
return a + tn(e.slice(o, r));
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/addons/ai/ai/F0AiChatUsageLimits/components/UsageRing.tsx
|
|
41
|
-
var
|
|
42
|
-
let n =
|
|
41
|
+
var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
42
|
+
let n = on / 2, r = n - sn / 2, i = 2 * Math.PI * r, a = (100 - (t === "unlimited" ? 100 : e)) / 100 * i;
|
|
43
43
|
return /* @__PURE__ */ X("svg", {
|
|
44
|
-
viewBox: `0 0 ${
|
|
44
|
+
viewBox: `0 0 ${on} ${on}`,
|
|
45
45
|
className: "h-3.5 w-3.5 -rotate-90",
|
|
46
46
|
"aria-hidden": "true",
|
|
47
47
|
focusable: "false",
|
|
@@ -50,21 +50,21 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
50
50
|
cy: n,
|
|
51
51
|
r,
|
|
52
52
|
fill: "none",
|
|
53
|
-
strokeWidth:
|
|
53
|
+
strokeWidth: sn,
|
|
54
54
|
className: "stroke-f1-border-secondary"
|
|
55
55
|
}), /* @__PURE__ */ Y("circle", {
|
|
56
56
|
cx: n,
|
|
57
57
|
cy: n,
|
|
58
58
|
r,
|
|
59
59
|
fill: "none",
|
|
60
|
-
strokeWidth:
|
|
60
|
+
strokeWidth: sn,
|
|
61
61
|
strokeDasharray: i,
|
|
62
62
|
strokeDashoffset: a,
|
|
63
63
|
strokeLinecap: "round",
|
|
64
64
|
className: y("transition-[stroke-dashoffset] duration-300 ease-out motion-reduce:transition-none", t === "exhausted" && "stroke-f1-background-critical-bold", t === "unlimited" && "stroke-f1-border", t === "default" && "stroke-f1-background-info-bold")
|
|
65
65
|
})]
|
|
66
66
|
});
|
|
67
|
-
},
|
|
67
|
+
}, ln = ({ label: e, description: t, percentage: n, unlimited: r = !1 }) => {
|
|
68
68
|
let i = p(), a = !r && n >= 100;
|
|
69
69
|
return /* @__PURE__ */ X("div", {
|
|
70
70
|
className: "flex flex-col gap-3",
|
|
@@ -101,7 +101,7 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
101
101
|
}) : null
|
|
102
102
|
]
|
|
103
103
|
});
|
|
104
|
-
},
|
|
104
|
+
}, un = (e) => Math.min(100, Math.max(0, Math.round(e))), dn = () => /* @__PURE__ */ X("div", {
|
|
105
105
|
className: "flex flex-col gap-2",
|
|
106
106
|
"aria-busy": "true",
|
|
107
107
|
"aria-live": "polite",
|
|
@@ -109,10 +109,10 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
109
109
|
className: "flex justify-between",
|
|
110
110
|
children: [/* @__PURE__ */ Y("div", { className: "h-5 w-28 animate-pulse rounded bg-f1-background-secondary" }), /* @__PURE__ */ Y("div", { className: "h-5 w-16 animate-pulse rounded bg-f1-background-secondary" })]
|
|
111
111
|
}), /* @__PURE__ */ Y("div", { className: "h-2 w-full animate-pulse rounded-full bg-f1-background-secondary" })]
|
|
112
|
-
}),
|
|
113
|
-
let o = p(), [s, c] =
|
|
112
|
+
}), fn = ({ usage: e, error: t = !1, onOpenChange: n, trigger: r, side: a = "top" }) => {
|
|
113
|
+
let o = p(), [s, c] = q(!1), d = K(null), f = U((e) => {
|
|
114
114
|
c(e), n?.(e);
|
|
115
|
-
}, [n]), m = e ?
|
|
115
|
+
}, [n]), m = e ? un(e.usedPercentage) : 0, g = e?.unlimited ?? !1, _ = g ? "unlimited" : m >= 100 ? "exhausted" : "default", v = e?.sections ?? [], x = !!e?.onSeeCompany || v.length > 0, S = o.t("ai.usageLimits.title"), C = g ? o.t("ai.usageLimits.unlimited") : o.t("ai.usageLimits.used", { percentage: m }), w = e ? `${S}: ${C}` : S;
|
|
116
116
|
return /* @__PURE__ */ X(h, {
|
|
117
117
|
open: s,
|
|
118
118
|
onOpenChange: f,
|
|
@@ -123,7 +123,7 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
123
123
|
"aria-expanded": s,
|
|
124
124
|
"aria-haspopup": "dialog",
|
|
125
125
|
className: y("flex h-6 w-6 shrink-0 items-center justify-center rounded-sm bg-transparent p-0", "hover:bg-f1-background-secondary-hover", s && "bg-f1-background-secondary-hover", b()),
|
|
126
|
-
children: [/* @__PURE__ */ Y(
|
|
126
|
+
children: [/* @__PURE__ */ Y(cn, {
|
|
127
127
|
percentage: m,
|
|
128
128
|
tone: _
|
|
129
129
|
}), /* @__PURE__ */ Y("span", {
|
|
@@ -147,12 +147,12 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
147
147
|
children: t ? /* @__PURE__ */ Y("span", {
|
|
148
148
|
className: "text-sm text-f1-foreground-secondary",
|
|
149
149
|
children: o.t("ai.usageLimits.error")
|
|
150
|
-
}) : e ? /* @__PURE__ */ Y(
|
|
150
|
+
}) : e ? /* @__PURE__ */ Y(ln, {
|
|
151
151
|
label: S,
|
|
152
152
|
description: e.description,
|
|
153
153
|
percentage: m,
|
|
154
154
|
unlimited: g
|
|
155
|
-
}) : /* @__PURE__ */ Y(
|
|
155
|
+
}) : /* @__PURE__ */ Y(dn, {})
|
|
156
156
|
}), e && x ? /* @__PURE__ */ X("div", {
|
|
157
157
|
className: "flex flex-col border-0 border-t border-solid border-f1-border-secondary p-2",
|
|
158
158
|
children: [e.onSeeCompany ? /* @__PURE__ */ X("button", {
|
|
@@ -163,33 +163,33 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
163
163
|
className: "min-w-0 flex-1 truncate",
|
|
164
164
|
children: o.t("ai.usageLimits.yourCompany")
|
|
165
165
|
}), /* @__PURE__ */ Y(u, {
|
|
166
|
-
icon:
|
|
166
|
+
icon: wt,
|
|
167
167
|
size: "md",
|
|
168
168
|
color: "default"
|
|
169
169
|
})]
|
|
170
170
|
}) : null, v.map((e) => /* @__PURE__ */ Y("div", {
|
|
171
171
|
className: "p-2",
|
|
172
|
-
children: /* @__PURE__ */ Y(
|
|
172
|
+
children: /* @__PURE__ */ Y(ln, {
|
|
173
173
|
label: e.label,
|
|
174
174
|
description: e.description,
|
|
175
|
-
percentage:
|
|
175
|
+
percentage: un(e.usedPercentage),
|
|
176
176
|
unlimited: e.unlimited
|
|
177
177
|
})
|
|
178
178
|
}, e.id))]
|
|
179
179
|
}) : null]
|
|
180
180
|
})]
|
|
181
181
|
});
|
|
182
|
-
},
|
|
183
|
-
let { provided: t } =
|
|
184
|
-
return t ? /* @__PURE__ */ Y(
|
|
185
|
-
},
|
|
186
|
-
let a = p(), o =
|
|
182
|
+
}, pn = (e) => {
|
|
183
|
+
let { provided: t } = Ue();
|
|
184
|
+
return t ? /* @__PURE__ */ Y(mn, { ...e }) : /* @__PURE__ */ Y(et, { children: /* @__PURE__ */ Y(mn, { ...e }) });
|
|
185
|
+
}, mn = ({ attachedFiles: e, isUploading: t, onRemove: n, removeLabel: r, reducedMotion: i }) => {
|
|
186
|
+
let a = p(), o = hn(e), s = e.flatMap((e) => {
|
|
187
187
|
let t = o.get(e.id);
|
|
188
188
|
if (!t) return [];
|
|
189
|
-
let i = e.file.name, a = e.file.type ||
|
|
189
|
+
let i = e.file.name, a = e.file.type || Ge({
|
|
190
190
|
name: i,
|
|
191
191
|
url: t
|
|
192
|
-
}), s =
|
|
192
|
+
}), s = Ze({
|
|
193
193
|
name: i,
|
|
194
194
|
url: t,
|
|
195
195
|
mimeType: a
|
|
@@ -207,7 +207,7 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
207
207
|
};
|
|
208
208
|
return [{
|
|
209
209
|
id: e.id,
|
|
210
|
-
content: /* @__PURE__ */ Y(
|
|
210
|
+
content: /* @__PURE__ */ Y(A, {
|
|
211
211
|
attachment: s,
|
|
212
212
|
status: e.status === "uploaded" ? "ready" : e.status === "error" ? "error" : "uploading",
|
|
213
213
|
errorMessage: e.errorMessage,
|
|
@@ -217,18 +217,18 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
217
217
|
})
|
|
218
218
|
}];
|
|
219
219
|
});
|
|
220
|
-
return /* @__PURE__ */ Y(
|
|
220
|
+
return /* @__PURE__ */ Y(L, {
|
|
221
221
|
items: s,
|
|
222
222
|
label: a.t(e.length === 1 ? "chat.attachmentCount.one" : "chat.attachmentCount.other", { count: e.length }),
|
|
223
223
|
busy: t,
|
|
224
224
|
reducedMotion: i,
|
|
225
225
|
testIdPrefix: "ai-chat"
|
|
226
226
|
});
|
|
227
|
-
},
|
|
228
|
-
let [t, n] =
|
|
229
|
-
return
|
|
227
|
+
}, hn = (e) => {
|
|
228
|
+
let [t, n] = q(() => /* @__PURE__ */ new Map()), r = K(t);
|
|
229
|
+
return qt(() => {
|
|
230
230
|
r.current = t;
|
|
231
|
-
}, [t]),
|
|
231
|
+
}, [t]), W(() => {
|
|
232
232
|
let t = r.current, i = new Set(e.map((e) => e.id)), a = e.filter((e) => !t.has(e.id)), o = [...t.keys()].filter((e) => !i.has(e));
|
|
233
233
|
if (a.length === 0 && o.length === 0) return;
|
|
234
234
|
let s = new Map(t);
|
|
@@ -238,18 +238,18 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
238
238
|
}
|
|
239
239
|
for (let e of a) s.set(e.id, URL.createObjectURL(e.file));
|
|
240
240
|
n(s);
|
|
241
|
-
}, [e]),
|
|
241
|
+
}, [e]), W(() => () => {
|
|
242
242
|
for (let e of r.current.values()) URL.revokeObjectURL(e);
|
|
243
243
|
r.current = /* @__PURE__ */ new Map();
|
|
244
244
|
}, []), t;
|
|
245
|
-
},
|
|
245
|
+
}, gn = (e) => e.map((e) => {
|
|
246
246
|
if (e.type === "separator") return { type: "separator" };
|
|
247
247
|
if (e.type === "submenu") {
|
|
248
248
|
let { id: t, type: n, actions: r, ...i } = e;
|
|
249
249
|
return {
|
|
250
250
|
...i,
|
|
251
251
|
type: "submenu",
|
|
252
|
-
items:
|
|
252
|
+
items: gn(r)
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
255
|
if (e.type === "toggle") {
|
|
@@ -261,19 +261,19 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
261
261
|
}
|
|
262
262
|
let { id: t, type: n, ...r } = e;
|
|
263
263
|
return r;
|
|
264
|
-
}),
|
|
265
|
-
let s = p(), [c, l] =
|
|
264
|
+
}), _n = ({ actions: e, showAttachEntry: t, onAttachClick: n, attachDisabled: r, attachDisabledTooltip: i, disabled: a, onOpenChange: o }) => {
|
|
265
|
+
let s = p(), [c, l] = q(!1), u = (e) => {
|
|
266
266
|
l(e), o?.(e);
|
|
267
267
|
}, d = [...t ? [{
|
|
268
268
|
label: s.ai.addFilesOrPhotos,
|
|
269
|
-
icon:
|
|
269
|
+
icon: Me,
|
|
270
270
|
onClick: n,
|
|
271
271
|
disabled: r,
|
|
272
272
|
disabledTooltip: i
|
|
273
|
-
}, ...e.length > 0 ? [{ type: "separator" }] : []] : [], ...
|
|
273
|
+
}, ...e.length > 0 ? [{ type: "separator" }] : []] : [], ...gn(e)];
|
|
274
274
|
return /* @__PURE__ */ Y("div", {
|
|
275
275
|
onClick: (e) => e.stopPropagation(),
|
|
276
|
-
children: /* @__PURE__ */ Y(
|
|
276
|
+
children: /* @__PURE__ */ Y(it, {
|
|
277
277
|
items: d,
|
|
278
278
|
align: "start",
|
|
279
279
|
disabled: a,
|
|
@@ -284,7 +284,7 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
284
284
|
label: s.ai.addToConversation,
|
|
285
285
|
hideLabel: !0,
|
|
286
286
|
type: "button",
|
|
287
|
-
icon:
|
|
287
|
+
icon: gt,
|
|
288
288
|
variant: "outline",
|
|
289
289
|
size: "md",
|
|
290
290
|
pressed: c,
|
|
@@ -292,9 +292,9 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
292
292
|
})
|
|
293
293
|
})
|
|
294
294
|
});
|
|
295
|
-
},
|
|
295
|
+
}, vn = ({ onUploadFiles: e, composerActions: t, isAtMaxFiles: n, maxFiles: r, acceptValue: i, fileInputRef: a, handleFileSelect: o, recordingStatus: s, onComposerActionsOpenChange: c }) => {
|
|
296
296
|
let l = p(), u = s === "transcribing", d = () => a.current?.click(), f = t?.length ? t : null;
|
|
297
|
-
return !e && !f ? null : /* @__PURE__ */ X(
|
|
297
|
+
return !e && !f ? null : /* @__PURE__ */ X(J, { children: [f ? /* @__PURE__ */ Y(_n, {
|
|
298
298
|
actions: f,
|
|
299
299
|
showAttachEntry: !!e,
|
|
300
300
|
onAttachClick: d,
|
|
@@ -306,7 +306,7 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
306
306
|
label: l.ai.attachFile,
|
|
307
307
|
hideLabel: !0,
|
|
308
308
|
type: "button",
|
|
309
|
-
icon:
|
|
309
|
+
icon: Me,
|
|
310
310
|
variant: "outline",
|
|
311
311
|
size: "md",
|
|
312
312
|
disabled: n || u,
|
|
@@ -322,16 +322,16 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
322
322
|
className: "hidden",
|
|
323
323
|
onChange: o
|
|
324
324
|
}) : null] });
|
|
325
|
-
},
|
|
325
|
+
}, yn = { soft: {
|
|
326
326
|
text: "",
|
|
327
327
|
bg: "bg-f1-background-secondary",
|
|
328
328
|
fontColor: "text-f1-foreground-secondary",
|
|
329
329
|
formBorder: "[&_form]:border-f1-border"
|
|
330
|
-
} },
|
|
330
|
+
} }, bn = ({ creditWarning: e, children: t }) => {
|
|
331
331
|
let n = p();
|
|
332
332
|
if (!e) return t;
|
|
333
333
|
let r = {
|
|
334
|
-
...
|
|
334
|
+
...yn[e.level],
|
|
335
335
|
text: e.text ?? n.ai.creditWarning.soft
|
|
336
336
|
}, i = e.actionLabel ?? n.ai.creditWarning.getCredits ?? "";
|
|
337
337
|
return /* @__PURE__ */ X("div", {
|
|
@@ -361,7 +361,7 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
361
361
|
})]
|
|
362
362
|
}), t]
|
|
363
363
|
});
|
|
364
|
-
},
|
|
364
|
+
}, xn = ({ quote: e, onRemove: t }) => {
|
|
365
365
|
let n = p();
|
|
366
366
|
return /* @__PURE__ */ Y("div", {
|
|
367
367
|
"aria-atomic": "true",
|
|
@@ -374,7 +374,7 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
374
374
|
/* @__PURE__ */ Y("div", {
|
|
375
375
|
className: "flex items-center py-0.5",
|
|
376
376
|
children: /* @__PURE__ */ Y(u, {
|
|
377
|
-
icon:
|
|
377
|
+
icon: at,
|
|
378
378
|
size: "md",
|
|
379
379
|
color: "default"
|
|
380
380
|
})
|
|
@@ -396,9 +396,9 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
396
396
|
]
|
|
397
397
|
})
|
|
398
398
|
});
|
|
399
|
-
},
|
|
399
|
+
}, Sn = ({ cards: e }) => e.length === 0 ? null : /* @__PURE__ */ Y("div", {
|
|
400
400
|
className: "grid w-full grid-cols-2 gap-3",
|
|
401
|
-
children: e.slice(0, 4).map((e) => /* @__PURE__ */ Y(
|
|
401
|
+
children: e.slice(0, 4).map((e) => /* @__PURE__ */ Y(ne, {
|
|
402
402
|
avatar: {
|
|
403
403
|
type: "icon",
|
|
404
404
|
icon: e.icon
|
|
@@ -408,12 +408,12 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
408
408
|
onClick: e.onClick
|
|
409
409
|
}, e.id))
|
|
410
410
|
});
|
|
411
|
-
function
|
|
412
|
-
let [t, n] =
|
|
411
|
+
function Cn(e = 24) {
|
|
412
|
+
let [t, n] = q(null), [r, i] = q({
|
|
413
413
|
start: !1,
|
|
414
414
|
end: !1
|
|
415
415
|
});
|
|
416
|
-
return
|
|
416
|
+
return W(() => {
|
|
417
417
|
if (!t) return;
|
|
418
418
|
let e = () => {
|
|
419
419
|
let e = t.scrollWidth > t.clientWidth + 1;
|
|
@@ -431,7 +431,7 @@ function Sn(e = 24) {
|
|
|
431
431
|
};
|
|
432
432
|
}, [t]), {
|
|
433
433
|
ref: n,
|
|
434
|
-
style:
|
|
434
|
+
style: G(() => {
|
|
435
435
|
if (!r.start && !r.end) return {};
|
|
436
436
|
let t = `linear-gradient(to right, ${r.start ? `transparent 0, black ${e}px` : "black 0"}, ${r.end ? `black calc(100% - ${e}px), transparent 100%` : "black 100%"})`;
|
|
437
437
|
return {
|
|
@@ -443,12 +443,12 @@ function Sn(e = 24) {
|
|
|
443
443
|
}
|
|
444
444
|
//#endregion
|
|
445
445
|
//#region src/addons/ai/ai/F0AiChatTextArea/components/WelcomeScreenSuggestionsRow.tsx
|
|
446
|
-
var
|
|
447
|
-
function
|
|
446
|
+
var wn = 5, Tn = 46, En = 400, Dn = 16, On = 16;
|
|
447
|
+
function kn(e, t = wn) {
|
|
448
448
|
return e.length <= t ? e : [...e].sort(() => .5 - Math.random()).slice(0, t);
|
|
449
449
|
}
|
|
450
|
-
var
|
|
451
|
-
let [o, s] =
|
|
450
|
+
var An = ({ suggestions: e, onItemClick: t, onItemHover: n, side: r = "top", reserveTwoRows: i = !0, overflow: a = "wrap" }) => {
|
|
451
|
+
let [o, s] = q(null), c = K(null), d = a === "scroll", p = Cn(), m = K(null), g = K(!1), v = Gt(), b = Gt(), x = o === null ? null : e[o];
|
|
452
452
|
return e.length === 0 ? null : /* @__PURE__ */ X(h, {
|
|
453
453
|
open: x !== null,
|
|
454
454
|
onOpenChange: (e) => {
|
|
@@ -508,7 +508,7 @@ var kn = ({ suggestions: e, onItemClick: t, onItemHover: n, side: r = "top", res
|
|
|
508
508
|
}), /* @__PURE__ */ Y("span", { children: x.label })]
|
|
509
509
|
}), /* @__PURE__ */ Y("div", {
|
|
510
510
|
className: "flex flex-col",
|
|
511
|
-
children:
|
|
511
|
+
children: kn(x.items).map((e, r) => /* @__PURE__ */ Y(jn, {
|
|
512
512
|
item: e,
|
|
513
513
|
onHover: n,
|
|
514
514
|
onSelect: (r) => {
|
|
@@ -519,32 +519,32 @@ var kn = ({ suggestions: e, onItemClick: t, onItemHover: n, side: r = "top", res
|
|
|
519
519
|
}) : null]
|
|
520
520
|
});
|
|
521
521
|
};
|
|
522
|
-
function
|
|
523
|
-
let i =
|
|
522
|
+
function jn({ item: e, onSelect: n, onHover: r }) {
|
|
523
|
+
let i = K(null), a = K(null), o = K(null), s = t(), c = U(() => {
|
|
524
524
|
o.current != null && (clearTimeout(o.current), o.current = null);
|
|
525
525
|
let e = a.current, t = i.current;
|
|
526
526
|
e && (e.style.transition = "none", e.style.transform = "translateX(0)", e.style.overflow = ""), t && (t.style.removeProperty("mask-image"), t.style.removeProperty("-webkit-mask-image"));
|
|
527
|
-
}, []), l =
|
|
527
|
+
}, []), l = U(() => {
|
|
528
528
|
s || (o.current = window.setTimeout(() => {
|
|
529
529
|
let e = a.current, t = i.current;
|
|
530
530
|
if (!e || !t) return;
|
|
531
531
|
let n = e.scrollWidth - e.clientWidth;
|
|
532
532
|
if (n <= 0) return;
|
|
533
|
-
let r = n +
|
|
533
|
+
let r = n + Dn, o = r / Tn * 1e3;
|
|
534
534
|
e.style.overflow = "visible";
|
|
535
|
-
let s = `linear-gradient(90deg, transparent 0, #000 ${
|
|
535
|
+
let s = `linear-gradient(90deg, transparent 0, #000 ${On}px)`;
|
|
536
536
|
t.style.setProperty("mask-image", s), t.style.setProperty("-webkit-mask-image", s), e.style.transition = `transform ${o}ms linear`, e.style.transform = `translateX(-${r}px)`;
|
|
537
|
-
},
|
|
538
|
-
}, [s]), d =
|
|
537
|
+
}, En));
|
|
538
|
+
}, [s]), d = U(() => {
|
|
539
539
|
r?.(e), l();
|
|
540
540
|
}, [
|
|
541
541
|
e,
|
|
542
542
|
r,
|
|
543
543
|
l
|
|
544
|
-
]), f =
|
|
544
|
+
]), f = U(() => {
|
|
545
545
|
r?.(null), c();
|
|
546
546
|
}, [r, c]);
|
|
547
|
-
return
|
|
547
|
+
return W(() => () => {
|
|
548
548
|
o.current != null && clearTimeout(o.current);
|
|
549
549
|
}, []), /* @__PURE__ */ X("button", {
|
|
550
550
|
type: "button",
|
|
@@ -566,7 +566,7 @@ function An({ item: e, onSelect: n, onHover: r }) {
|
|
|
566
566
|
"aria-hidden": !0,
|
|
567
567
|
className: "flex flex-shrink-0 items-center text-f1-foreground-secondary opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
568
568
|
children: /* @__PURE__ */ Y(u, {
|
|
569
|
-
icon:
|
|
569
|
+
icon: It,
|
|
570
570
|
size: "sm"
|
|
571
571
|
})
|
|
572
572
|
})]
|
|
@@ -574,7 +574,7 @@ function An({ item: e, onSelect: n, onHover: r }) {
|
|
|
574
574
|
}
|
|
575
575
|
//#endregion
|
|
576
576
|
//#region src/addons/ai/ai/F0AiChatTextArea/mentions/useMentionSources.ts
|
|
577
|
-
function
|
|
577
|
+
function Mn(e, t) {
|
|
578
578
|
return {
|
|
579
579
|
type: "person",
|
|
580
580
|
label: t.label,
|
|
@@ -592,11 +592,11 @@ function jn(e, t) {
|
|
|
592
592
|
}))
|
|
593
593
|
};
|
|
594
594
|
}
|
|
595
|
-
function
|
|
595
|
+
function Nn({ searchPersons: e, mentionSources: t }) {
|
|
596
596
|
let { ai: n } = p(), r = n.mentions.people;
|
|
597
|
-
return
|
|
597
|
+
return G(() => {
|
|
598
598
|
let n = t ?? [];
|
|
599
|
-
return !e || n.some((e) => e.type === "person") ? n : [
|
|
599
|
+
return !e || n.some((e) => e.type === "person") ? n : [Mn(e, { label: r }), ...n];
|
|
600
600
|
}, [
|
|
601
601
|
e,
|
|
602
602
|
t,
|
|
@@ -605,7 +605,7 @@ function Mn({ searchPersons: e, mentionSources: t }) {
|
|
|
605
605
|
}
|
|
606
606
|
//#endregion
|
|
607
607
|
//#region src/addons/ai/ai/F0AiChatTextArea/file-utils.ts
|
|
608
|
-
function
|
|
608
|
+
function Pn(e, t) {
|
|
609
609
|
if (t === "*/*") return !0;
|
|
610
610
|
if (t.endsWith("/*")) {
|
|
611
611
|
let n = t.slice(0, t.indexOf("/"));
|
|
@@ -613,32 +613,32 @@ function Nn(e, t) {
|
|
|
613
613
|
}
|
|
614
614
|
return e === t;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function Fn(e, t) {
|
|
617
617
|
if (!t) return e;
|
|
618
618
|
let n = Array.isArray(t) ? t : [t];
|
|
619
|
-
return n.length === 0 ? e : e.filter((e) => n.some((t) =>
|
|
619
|
+
return n.length === 0 ? e : e.filter((e) => n.some((t) => Pn(e.type, t)));
|
|
620
620
|
}
|
|
621
621
|
//#endregion
|
|
622
622
|
//#region src/addons/ai/ai/F0AiChatTextArea/useFileAttachments.ts
|
|
623
|
-
var
|
|
624
|
-
function
|
|
625
|
-
let [t, n] =
|
|
623
|
+
var In = 4e3;
|
|
624
|
+
function Ln(e) {
|
|
625
|
+
let [t, n] = q([]), [r, i] = q(null), a = K(null), o = K(null), s = p(), c = e?.onUploadFiles, l = e?.allowedMimeTypes, u = e?.maxFiles, d = G(() => {
|
|
626
626
|
if (l) return Array.isArray(l) ? l.join(",") : l;
|
|
627
|
-
}, [l]), f = u !== void 0 && t.length >= u, m =
|
|
628
|
-
|
|
627
|
+
}, [l]), f = u !== void 0 && t.length >= u, m = K(0);
|
|
628
|
+
W(() => {
|
|
629
629
|
m.current = t.length;
|
|
630
630
|
}, [t]);
|
|
631
|
-
let h =
|
|
631
|
+
let h = U((e) => {
|
|
632
632
|
a.current && clearTimeout(a.current), i(e), a.current = setTimeout(() => {
|
|
633
633
|
i(null), a.current = null;
|
|
634
|
-
},
|
|
634
|
+
}, In);
|
|
635
635
|
}, []);
|
|
636
|
-
|
|
636
|
+
W(() => () => {
|
|
637
637
|
a.current && clearTimeout(a.current);
|
|
638
638
|
}, []);
|
|
639
|
-
let g =
|
|
639
|
+
let g = U(async (e) => {
|
|
640
640
|
if (e.length === 0 || !c) return;
|
|
641
|
-
let t =
|
|
641
|
+
let t = Fn(e, l);
|
|
642
642
|
if (t.length === 0) return;
|
|
643
643
|
if (u !== void 0 && m.current + t.length > u) {
|
|
644
644
|
h(s.ai.tooManyFilesError.replace("{{maxFiles}}", String(u)));
|
|
@@ -692,10 +692,10 @@ function In(e) {
|
|
|
692
692
|
isAtMaxFiles: f,
|
|
693
693
|
maxFiles: u,
|
|
694
694
|
processFiles: g,
|
|
695
|
-
handleFileSelect:
|
|
695
|
+
handleFileSelect: U(async (e) => {
|
|
696
696
|
await g(Array.from(e.target.files ?? [])), e.target.value = "";
|
|
697
697
|
}, [g]),
|
|
698
|
-
handleRemoveFile:
|
|
698
|
+
handleRemoveFile: U((e) => {
|
|
699
699
|
n((t) => t.filter((t) => t.id !== e));
|
|
700
700
|
}, []),
|
|
701
701
|
transientError: r,
|
|
@@ -704,93 +704,93 @@ function In(e) {
|
|
|
704
704
|
}
|
|
705
705
|
//#endregion
|
|
706
706
|
//#region src/addons/ai/ai/F0AiChatTextArea/AiChatComposer.tsx
|
|
707
|
-
var
|
|
708
|
-
let
|
|
707
|
+
var Rn = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholders: o, creditWarning: c, clarifyingUI: l, pendingContext: u = null, onPendingContextChange: d, pendingQuote: f = null, onPendingQuoteChange: m, fileAttachments: h, toolbarStart: _, composerActions: b, onComposerActionsOpenChange: x, onTranscribe: S, searchPersons: C, mentionSources: w, onProcessFilesRef: E, disclaimer: D, usageLimits: O, footer: ee, isWelcomeScreen: k = !1, fullscreen: A = !1, welcomeScreenSuggestions: j, onSuggestionClick: M, welcomeScreenSuggestionsPlacement: N = "above", welcomeScreenSuggestionsCollapsedByDefault: P = !1, welcomeScreenCards: F, padding: te = "default", name: ne, ref: re }) => {
|
|
708
|
+
let I = p(), L = t(), ae = !!L, R = K(null), [z, oe] = q(null), [se, ce] = q(!1), [le, ue] = q({
|
|
709
709
|
isEmpty: !0,
|
|
710
710
|
recorder: "idle"
|
|
711
|
-
}),
|
|
712
|
-
|
|
713
|
-
|
|
711
|
+
}), de = K(null), fe = K(null);
|
|
712
|
+
W(() => () => {
|
|
713
|
+
fe.current && clearTimeout(fe.current);
|
|
714
714
|
}, []);
|
|
715
|
-
let
|
|
716
|
-
|
|
717
|
-
|
|
715
|
+
let pe = l != null, he = K(u), ge = K(f);
|
|
716
|
+
qt(() => {
|
|
717
|
+
he.current = u, ge.current = f;
|
|
718
718
|
});
|
|
719
|
-
let { tracking:
|
|
720
|
-
|
|
719
|
+
let { tracking: _e, setFocusChatInputFunction: ve } = V(), ye = U((e, t) => {
|
|
720
|
+
_e?.onWelcomeSuggestionClick?.({
|
|
721
721
|
item: e,
|
|
722
722
|
group: t,
|
|
723
723
|
prompt: e.prompt || e.title
|
|
724
|
-
}),
|
|
725
|
-
}, [
|
|
724
|
+
}), M?.(e, t);
|
|
725
|
+
}, [_e, M]), { attachedFiles: be, fileInputRef: xe, onUploadFiles: Se, acceptValue: Ce, isAtMaxFiles: we, maxFiles: Te, processFiles: Ee, handleFileSelect: De, handleRemoveFile: Oe, transientError: ke, showTransientError: Ae } = Ln(h), je = Nn({
|
|
726
726
|
searchPersons: C,
|
|
727
727
|
mentionSources: w
|
|
728
728
|
});
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
}, []),
|
|
732
|
-
if (
|
|
733
|
-
else return
|
|
734
|
-
|
|
735
|
-
}), () =>
|
|
736
|
-
}, [
|
|
737
|
-
if (
|
|
738
|
-
|
|
729
|
+
W(() => {
|
|
730
|
+
P || typeof window < "u" && window.location.hash.length === 0 && R.current?.focus();
|
|
731
|
+
}, []), W(() => {
|
|
732
|
+
if (pe) ve(null);
|
|
733
|
+
else return ve(() => {
|
|
734
|
+
R.current?.focus();
|
|
735
|
+
}), () => ve(null);
|
|
736
|
+
}, [pe, ve]), W(() => {
|
|
737
|
+
if (E) return E((e) => {
|
|
738
|
+
Ee(e);
|
|
739
739
|
}), () => {
|
|
740
|
-
|
|
740
|
+
E(null);
|
|
741
741
|
};
|
|
742
|
-
}, [
|
|
743
|
-
let
|
|
744
|
-
if (
|
|
742
|
+
}, [E, Ee]);
|
|
743
|
+
let Me = U((e) => void Ee(e), [Ee]), Ne = be.filter((e) => e.status === "uploaded"), B = be.some((e) => e.status === "uploading"), Pe = be.some((e) => e.status === "error"), Fe = !le.isEmpty || Ne.length > 0, Ie = async ({ text: t, mentions: n }) => {
|
|
744
|
+
if (Pe) return Ae(I.ai.fileUploadBlockedSubmit), !1;
|
|
745
745
|
if (a && await a() === !1) return !1;
|
|
746
|
-
let r =
|
|
746
|
+
let r = Ne, i = r.flatMap((e) => e.uploadedFile ? [e.uploadedFile] : []), o = u, s = f;
|
|
747
747
|
o && d?.(null), s && m?.(null);
|
|
748
748
|
try {
|
|
749
749
|
await e({
|
|
750
|
-
text:
|
|
750
|
+
text: an(t, n),
|
|
751
751
|
files: i,
|
|
752
752
|
context: o,
|
|
753
753
|
quote: s
|
|
754
754
|
});
|
|
755
755
|
} catch {
|
|
756
|
-
return o && (
|
|
756
|
+
return o && (he.current == null || he.current === o) && d?.(o), s && (ge.current == null || ge.current === s) && m?.(s), !1;
|
|
757
757
|
}
|
|
758
|
-
for (let e of r)
|
|
758
|
+
for (let e of r) Oe(e.id);
|
|
759
759
|
return !0;
|
|
760
|
-
},
|
|
761
|
-
suggestions:
|
|
762
|
-
onItemClick:
|
|
763
|
-
onItemHover:
|
|
764
|
-
side:
|
|
765
|
-
reserveTwoRows: !
|
|
766
|
-
overflow:
|
|
767
|
-
}) : null,
|
|
768
|
-
|
|
769
|
-
|
|
760
|
+
}, Le = z ? z.prompt ?? z.title : null, Re = Le ? [Le] : o ?? [], ze = N === "inside", Be = k && j && j.length > 0 && M ? /* @__PURE__ */ Y(An, {
|
|
761
|
+
suggestions: j,
|
|
762
|
+
onItemClick: ye,
|
|
763
|
+
onItemHover: oe,
|
|
764
|
+
side: ze ? "bottom" : "top",
|
|
765
|
+
reserveTwoRows: !ze,
|
|
766
|
+
overflow: ze ? "scroll" : "wrap"
|
|
767
|
+
}) : null, Ve = !P || se || Fe || le.recorder !== "idle", He = (e) => e instanceof Node ? de.current?.contains(e) ? !0 : e instanceof Element && e.closest("[data-radix-popper-content-wrapper]") !== null : !1, Ue = () => {
|
|
768
|
+
fe.current && clearTimeout(fe.current), fe.current = setTimeout(() => {
|
|
769
|
+
He(document.activeElement) || ce(!1);
|
|
770
770
|
}, 0);
|
|
771
|
-
},
|
|
771
|
+
}, We = ze, Ge = We && P, Ke = Ge && !Ve, qe = We && Be ? /* @__PURE__ */ Y("div", {
|
|
772
772
|
onClick: (e) => e.stopPropagation(),
|
|
773
|
-
children:
|
|
774
|
-
}) : void 0,
|
|
775
|
-
duration:
|
|
773
|
+
children: Be
|
|
774
|
+
}) : void 0, Je = {
|
|
775
|
+
duration: ae ? 0 : .32,
|
|
776
776
|
ease: [
|
|
777
777
|
.4,
|
|
778
778
|
0,
|
|
779
779
|
.2,
|
|
780
780
|
1
|
|
781
781
|
]
|
|
782
|
-
},
|
|
782
|
+
}, Ye = k && A && !!F && F.length > 0, Xe = A && k, { motionProps: Ze } = T(k, 160, .5);
|
|
783
783
|
return /* @__PURE__ */ X(s.div, {
|
|
784
784
|
ref: re,
|
|
785
|
-
"data-composer-layout":
|
|
786
|
-
className: y("flex flex-col items-center gap-2", te === "default" && "px-4 pb-3 pt-2",
|
|
787
|
-
...
|
|
785
|
+
"data-composer-layout": Xe ? "welcome" : "docked",
|
|
786
|
+
className: y("flex flex-col items-center gap-2", te === "default" && "px-4 pb-3 pt-2", Xe && "min-h-0 flex-1 justify-start -mt-20"),
|
|
787
|
+
...A ? Ze : {},
|
|
788
788
|
children: [
|
|
789
789
|
/* @__PURE__ */ X("div", {
|
|
790
790
|
className: "flex w-full max-w-content flex-col gap-2",
|
|
791
|
-
children: [
|
|
791
|
+
children: [Be && !ze ? /* @__PURE__ */ Y("div", { children: P ? /* @__PURE__ */ Y(n, {
|
|
792
792
|
initial: !1,
|
|
793
|
-
children:
|
|
793
|
+
children: Ve ? /* @__PURE__ */ Y(s.div, {
|
|
794
794
|
className: "overflow-hidden",
|
|
795
795
|
initial: {
|
|
796
796
|
opacity: 0,
|
|
@@ -804,107 +804,107 @@ var Ln = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
804
804
|
opacity: 0,
|
|
805
805
|
height: 0
|
|
806
806
|
},
|
|
807
|
-
transition:
|
|
808
|
-
children:
|
|
807
|
+
transition: Je,
|
|
808
|
+
children: Be
|
|
809
809
|
}, "welcome-suggestions") : null
|
|
810
|
-
}) :
|
|
810
|
+
}) : Be }) : null, /* @__PURE__ */ Y(bn, {
|
|
811
811
|
creditWarning: c,
|
|
812
|
-
children: /* @__PURE__ */ Y(
|
|
812
|
+
children: /* @__PURE__ */ Y(me, {
|
|
813
813
|
asForm: !0,
|
|
814
|
-
surfaceRef:
|
|
815
|
-
handleRef:
|
|
814
|
+
surfaceRef: de,
|
|
815
|
+
handleRef: R,
|
|
816
816
|
className: "isolate z-20 items-stretch p-0 hover:cursor-text",
|
|
817
|
-
accent:
|
|
818
|
-
replacement:
|
|
819
|
-
onSurfaceFocus: () =>
|
|
820
|
-
onSurfaceBlur:
|
|
821
|
-
onStateChange:
|
|
822
|
-
onSend:
|
|
817
|
+
accent: pe,
|
|
818
|
+
replacement: pe ? l : null,
|
|
819
|
+
onSurfaceFocus: () => ce(!0),
|
|
820
|
+
onSurfaceBlur: Ue,
|
|
821
|
+
onStateChange: ue,
|
|
822
|
+
onSend: Ie,
|
|
823
823
|
inProgress: i,
|
|
824
824
|
onStop: r,
|
|
825
|
-
hasAttachments:
|
|
826
|
-
sendBlocked:
|
|
827
|
-
error:
|
|
825
|
+
hasAttachments: Ne.length > 0,
|
|
826
|
+
sendBlocked: B,
|
|
827
|
+
error: ke,
|
|
828
828
|
role: "textbox",
|
|
829
829
|
name: ne,
|
|
830
|
-
placeholders:
|
|
830
|
+
placeholders: Re,
|
|
831
831
|
placeholdersPaused: i,
|
|
832
832
|
labels: {
|
|
833
|
-
placeholder:
|
|
834
|
-
listening:
|
|
835
|
-
send:
|
|
836
|
-
stop:
|
|
837
|
-
recordAudio:
|
|
838
|
-
cancelRecording:
|
|
839
|
-
confirmRecording:
|
|
840
|
-
micPermissionDenied:
|
|
841
|
-
micError:
|
|
842
|
-
transcriptionError:
|
|
843
|
-
mentionSuggestions:
|
|
833
|
+
placeholder: I.ai.inputPlaceholder,
|
|
834
|
+
listening: I.ai.listening,
|
|
835
|
+
send: I.ai.sendMessage,
|
|
836
|
+
stop: I.ai.stopAnswerGeneration,
|
|
837
|
+
recordAudio: I.ai.recordAudio,
|
|
838
|
+
cancelRecording: I.ai.cancelRecording,
|
|
839
|
+
confirmRecording: I.ai.stopRecording,
|
|
840
|
+
micPermissionDenied: I.ai.micPermissionDenied,
|
|
841
|
+
micError: I.ai.micError,
|
|
842
|
+
transcriptionError: I.ai.transcriptionError,
|
|
843
|
+
mentionSuggestions: I.ai.mentions.suggestions
|
|
844
844
|
},
|
|
845
845
|
mentions: {
|
|
846
|
-
sources:
|
|
847
|
-
showGroupLabels:
|
|
846
|
+
sources: je,
|
|
847
|
+
showGroupLabels: je.length > 1
|
|
848
848
|
},
|
|
849
849
|
voice: S ? {
|
|
850
850
|
onTranscribe: S,
|
|
851
|
-
onPress:
|
|
852
|
-
onCancelled:
|
|
851
|
+
onPress: _e?.onDictationStart,
|
|
852
|
+
onCancelled: _e?.onDictationCancel
|
|
853
853
|
} : void 0,
|
|
854
|
-
onPasteFiles: h?.onUploadFiles ?
|
|
854
|
+
onPasteFiles: h?.onUploadFiles ? Me : void 0,
|
|
855
855
|
pastePreferText: !0,
|
|
856
|
-
header: f ? /* @__PURE__ */ Y(
|
|
856
|
+
header: f ? /* @__PURE__ */ Y(xn, {
|
|
857
857
|
quote: f,
|
|
858
858
|
onRemove: () => m?.(null)
|
|
859
859
|
}) : null,
|
|
860
|
-
tray: /* @__PURE__ */ Y(
|
|
861
|
-
attachedFiles:
|
|
862
|
-
isUploading:
|
|
863
|
-
onRemove:
|
|
864
|
-
removeLabel:
|
|
865
|
-
reducedMotion:
|
|
860
|
+
tray: /* @__PURE__ */ Y(pn, {
|
|
861
|
+
attachedFiles: be,
|
|
862
|
+
isUploading: B,
|
|
863
|
+
onRemove: Oe,
|
|
864
|
+
removeLabel: I.ai.removeFile,
|
|
865
|
+
reducedMotion: ae
|
|
866
866
|
}),
|
|
867
|
-
leading:
|
|
867
|
+
leading: We ? /* @__PURE__ */ Y("div", {
|
|
868
868
|
className: "flex shrink-0 self-center pl-3",
|
|
869
|
-
children: /* @__PURE__ */ Y(
|
|
869
|
+
children: /* @__PURE__ */ Y(ie, {
|
|
870
870
|
size: "sm",
|
|
871
871
|
spin: i
|
|
872
872
|
})
|
|
873
873
|
}) : void 0,
|
|
874
|
-
toolbarStart:
|
|
875
|
-
onUploadFiles:
|
|
874
|
+
toolbarStart: Se || _ || b?.length ? (e) => /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(vn, {
|
|
875
|
+
onUploadFiles: Se,
|
|
876
876
|
composerActions: b,
|
|
877
877
|
onComposerActionsOpenChange: x,
|
|
878
|
-
isAtMaxFiles:
|
|
879
|
-
maxFiles:
|
|
880
|
-
acceptValue:
|
|
881
|
-
fileInputRef:
|
|
882
|
-
handleFileSelect:
|
|
878
|
+
isAtMaxFiles: we,
|
|
879
|
+
maxFiles: Te,
|
|
880
|
+
acceptValue: Ce,
|
|
881
|
+
fileInputRef: xe,
|
|
882
|
+
handleFileSelect: De,
|
|
883
883
|
recordingStatus: e
|
|
884
884
|
}), _ ? /* @__PURE__ */ Y("div", {
|
|
885
885
|
className: "min-w-0 cursor-default",
|
|
886
886
|
onClick: (e) => e.stopPropagation(),
|
|
887
887
|
children: _
|
|
888
888
|
}) : null] }) : void 0,
|
|
889
|
-
toolbarCenter:
|
|
890
|
-
collapsible:
|
|
891
|
-
collapsed:
|
|
892
|
-
reducedMotion:
|
|
889
|
+
toolbarCenter: qe,
|
|
890
|
+
collapsible: Ge,
|
|
891
|
+
collapsed: Ke,
|
|
892
|
+
reducedMotion: ae
|
|
893
893
|
})
|
|
894
894
|
})]
|
|
895
895
|
}),
|
|
896
|
-
|
|
896
|
+
Ye ? /* @__PURE__ */ Y("div", {
|
|
897
897
|
className: "w-full max-w-content pt-2",
|
|
898
|
-
children: /* @__PURE__ */ Y(
|
|
898
|
+
children: /* @__PURE__ */ Y(Sn, { cards: F })
|
|
899
899
|
}) : null,
|
|
900
|
-
ee &&
|
|
900
|
+
ee && k && A ? /* @__PURE__ */ Y("div", {
|
|
901
901
|
className: "w-full py-4 mx-auto flex max-w-content justify-center",
|
|
902
902
|
children: ee
|
|
903
903
|
}) : null,
|
|
904
904
|
/* @__PURE__ */ Y(n, {
|
|
905
905
|
mode: "wait",
|
|
906
906
|
initial: !1,
|
|
907
|
-
children:
|
|
907
|
+
children: pe ? /* @__PURE__ */ X(s.div, {
|
|
908
908
|
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",
|
|
909
909
|
initial: { opacity: 0 },
|
|
910
910
|
animate: { opacity: 1 },
|
|
@@ -920,7 +920,7 @@ var Ln = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
920
920
|
children: "↑↓"
|
|
921
921
|
}),
|
|
922
922
|
" ",
|
|
923
|
-
|
|
923
|
+
I.ai.clarifyingQuestion.navHint.navigate
|
|
924
924
|
] }),
|
|
925
925
|
/* @__PURE__ */ X("span", { children: [
|
|
926
926
|
/* @__PURE__ */ Y("kbd", {
|
|
@@ -928,7 +928,7 @@ var Ln = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
928
928
|
children: "Enter"
|
|
929
929
|
}),
|
|
930
930
|
" ",
|
|
931
|
-
|
|
931
|
+
I.ai.clarifyingQuestion.navHint.select
|
|
932
932
|
] }),
|
|
933
933
|
/* @__PURE__ */ X("span", { children: [
|
|
934
934
|
/* @__PURE__ */ Y("kbd", {
|
|
@@ -936,74 +936,74 @@ var Ln = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
936
936
|
children: "Esc"
|
|
937
937
|
}),
|
|
938
938
|
" ",
|
|
939
|
-
|
|
939
|
+
I.ai.clarifyingQuestion.navHint.cancel
|
|
940
940
|
] })
|
|
941
941
|
]
|
|
942
|
-
}, "clarifying-nav-hint") : (
|
|
942
|
+
}, "clarifying-nav-hint") : (D?.text || O) && !Xe && /* @__PURE__ */ X(s.div, {
|
|
943
943
|
className: y("flex w-full max-w-content flex-row items-center gap-1", O ? "justify-between" : "justify-center"),
|
|
944
944
|
initial: { opacity: 0 },
|
|
945
945
|
animate: { opacity: 1 },
|
|
946
946
|
exit: { opacity: 0 },
|
|
947
947
|
transition: {
|
|
948
|
-
duration:
|
|
948
|
+
duration: L ? 0 : .3,
|
|
949
949
|
ease: "easeOut"
|
|
950
950
|
},
|
|
951
951
|
children: [/* @__PURE__ */ X("div", {
|
|
952
952
|
className: "flex min-w-0 flex-row items-center gap-1",
|
|
953
|
-
children: [
|
|
953
|
+
children: [D?.text && D.onClick ? /* @__PURE__ */ Y("button", {
|
|
954
954
|
type: "button",
|
|
955
|
-
onClick:
|
|
955
|
+
onClick: D.onClick,
|
|
956
956
|
className: y("group min-w-0 cursor-pointer bg-transparent p-0 text-inherit", "transition-transform duration-700 ease-out", "hover:scale-[1.02] focus-visible:scale-[1.02]", "motion-reduce:transition-none motion-reduce:hover:scale-100 motion-reduce:focus-visible:scale-100"),
|
|
957
957
|
children: /* @__PURE__ */ Y(v, {
|
|
958
958
|
className: y("text-sm font-medium text-f1-foreground-tertiary transition-colors duration-700 ease-out", "group-hover:bg-gradient-to-r group-hover:from-[#E55619] group-hover:to-[#A1ADE5] group-hover:bg-clip-text group-hover:text-transparent", "group-focus-visible:bg-gradient-to-r group-focus-visible:from-[#E55619] group-focus-visible:to-[#A1ADE5] group-focus-visible:bg-clip-text group-focus-visible:text-transparent"),
|
|
959
|
-
children:
|
|
959
|
+
children: D.text
|
|
960
960
|
})
|
|
961
|
-
}) :
|
|
961
|
+
}) : D?.text ? /* @__PURE__ */ Y(v, {
|
|
962
962
|
className: "text-sm font-medium text-f1-foreground-tertiary",
|
|
963
|
-
children:
|
|
964
|
-
}) : null,
|
|
965
|
-
href:
|
|
963
|
+
children: D.text
|
|
964
|
+
}) : null, D?.link && D.linkText ? /* @__PURE__ */ Y(g, {
|
|
965
|
+
href: D.link,
|
|
966
966
|
target: "_blank",
|
|
967
967
|
rel: "noopener noreferrer",
|
|
968
968
|
className: "flex-shrink-0 text-sm font-medium text-f1-foreground-tertiary",
|
|
969
|
-
children:
|
|
969
|
+
children: D.linkText
|
|
970
970
|
}) : null]
|
|
971
971
|
}), O ? /* @__PURE__ */ Y("div", {
|
|
972
972
|
className: "flex shrink-0 items-center",
|
|
973
|
-
children: /* @__PURE__ */ Y(
|
|
973
|
+
children: /* @__PURE__ */ Y(fn, { ...O })
|
|
974
974
|
}) : null]
|
|
975
975
|
}, "chat-disclaimer")
|
|
976
976
|
})
|
|
977
977
|
]
|
|
978
978
|
});
|
|
979
|
-
},
|
|
979
|
+
}, zn = (e) => /* @__PURE__ */ Y(Rn, {
|
|
980
980
|
...e,
|
|
981
981
|
name: "one-ai-input"
|
|
982
982
|
});
|
|
983
983
|
//#endregion
|
|
984
984
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Block.tsx
|
|
985
|
-
function
|
|
985
|
+
function Bn({ children: e, ...t }) {
|
|
986
986
|
return /* @__PURE__ */ Y("pre", {
|
|
987
987
|
...t,
|
|
988
988
|
className: y("relative mx-0 overflow-x-auto whitespace-pre-wrap rounded-md bg-f1-background-secondary p-2", t.className),
|
|
989
989
|
children: e
|
|
990
990
|
});
|
|
991
991
|
}
|
|
992
|
-
function
|
|
992
|
+
function Vn({ children: e, ...t }) {
|
|
993
993
|
return /* @__PURE__ */ Y("code", {
|
|
994
994
|
...t,
|
|
995
995
|
className: y("rounded bg-f1-background-secondary px-1 py-0.5 font-mono text-base text-f1-foreground", "[pre_&]:rounded-none [pre_&]:bg-transparent [pre_&]:p-0 [pre_&]:text-base", t.className),
|
|
996
996
|
children: e
|
|
997
997
|
});
|
|
998
998
|
}
|
|
999
|
-
function
|
|
999
|
+
function Hn({ children: e, ...t }) {
|
|
1000
1000
|
return /* @__PURE__ */ Y("blockquote", {
|
|
1001
1001
|
...t,
|
|
1002
1002
|
className: y("mr-1 my-2 mb-2.5 border-0 border-l-4 border-solid border-f1-border pl-3 text-base", t.className),
|
|
1003
1003
|
children: e
|
|
1004
1004
|
});
|
|
1005
1005
|
}
|
|
1006
|
-
function
|
|
1006
|
+
function Un({ ...e }) {
|
|
1007
1007
|
return /* @__PURE__ */ Y("hr", {
|
|
1008
1008
|
...e,
|
|
1009
1009
|
className: y("my-3 border-0 border-t border-f1-border", e.className)
|
|
@@ -1011,13 +1011,13 @@ function Hn({ ...e }) {
|
|
|
1011
1011
|
}
|
|
1012
1012
|
//#endregion
|
|
1013
1013
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Image.tsx
|
|
1014
|
-
function
|
|
1015
|
-
let r = p(), i =
|
|
1014
|
+
function Wn({ src: e, alt: t, ...n }) {
|
|
1015
|
+
let r = p(), i = Se(), a = ct(), s = O(e || void 0), [c, l] = q(!1), [u, d] = q(!1), f = t || (e ? Xe(e) : "") || "image";
|
|
1016
1016
|
if (!e || c || s.status === "error") return t ? /* @__PURE__ */ Y("span", {
|
|
1017
1017
|
className: "text-f1-foreground-secondary",
|
|
1018
1018
|
children: t
|
|
1019
1019
|
}) : null;
|
|
1020
|
-
let m = s.status === "ready" ? /* @__PURE__ */ Y(
|
|
1020
|
+
let m = s.status === "ready" ? /* @__PURE__ */ Y(Ve, {
|
|
1021
1021
|
...n,
|
|
1022
1022
|
src: s.url,
|
|
1023
1023
|
alt: t,
|
|
@@ -1053,8 +1053,8 @@ function Un({ src: e, alt: t, ...n }) {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
//#endregion
|
|
1055
1055
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Link.tsx
|
|
1056
|
-
function
|
|
1057
|
-
return /* @__PURE__ */ Y(
|
|
1056
|
+
function Gn({ children: e, ...t }) {
|
|
1057
|
+
return /* @__PURE__ */ Y(te, {
|
|
1058
1058
|
...t,
|
|
1059
1059
|
variant: "link",
|
|
1060
1060
|
href: t.href,
|
|
@@ -1063,21 +1063,21 @@ function Wn({ children: e, ...t }) {
|
|
|
1063
1063
|
}
|
|
1064
1064
|
//#endregion
|
|
1065
1065
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Lists.tsx
|
|
1066
|
-
function
|
|
1066
|
+
function Kn({ children: e, ...t }) {
|
|
1067
1067
|
return /* @__PURE__ */ Y("ul", {
|
|
1068
1068
|
...t,
|
|
1069
1069
|
className: y("list-disc pl-5 [&>li>ol]:mt-2 [&>li>ul]:mt-2", t.className),
|
|
1070
1070
|
children: e
|
|
1071
1071
|
});
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function qn({ children: e, ...t }) {
|
|
1074
1074
|
return /* @__PURE__ */ Y("ol", {
|
|
1075
1075
|
...t,
|
|
1076
1076
|
className: y("list-decimal pl-5 [&>li>ol]:mt-2 [&>li>ul]:mt-2", t.className),
|
|
1077
1077
|
children: e
|
|
1078
1078
|
});
|
|
1079
1079
|
}
|
|
1080
|
-
function
|
|
1080
|
+
function Jn({ children: e, ...t }) {
|
|
1081
1081
|
return /* @__PURE__ */ Y("li", {
|
|
1082
1082
|
...t,
|
|
1083
1083
|
className: y("mb-2", t.className),
|
|
@@ -1086,12 +1086,12 @@ function qn({ children: e, ...t }) {
|
|
|
1086
1086
|
}
|
|
1087
1087
|
//#endregion
|
|
1088
1088
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/components/EntityRefHoverCard.tsx
|
|
1089
|
-
function
|
|
1090
|
-
let a =
|
|
1091
|
-
|
|
1089
|
+
function Yn({ id: e, trigger: t, resolver: n, contentClassName: r = "w-64", ...i }) {
|
|
1090
|
+
let a = K(/* @__PURE__ */ new Map()), [o, s] = q(() => a.current.get(e) ?? null), [c, l] = q(!1), [u, d] = q(!1), f = K(!0);
|
|
1091
|
+
W(() => () => {
|
|
1092
1092
|
f.current = !1;
|
|
1093
1093
|
}, []);
|
|
1094
|
-
let p =
|
|
1094
|
+
let p = U(() => {
|
|
1095
1095
|
if (o || c) return;
|
|
1096
1096
|
let t = a.current.get(e);
|
|
1097
1097
|
t ? s(t) : (l(!0), d(!1), n(e).then((t) => {
|
|
@@ -1106,38 +1106,38 @@ function Jn({ id: e, trigger: t, resolver: n, mapToCard: r, fallbackCard: i }) {
|
|
|
1106
1106
|
e,
|
|
1107
1107
|
o,
|
|
1108
1108
|
c
|
|
1109
|
-
]), m = u
|
|
1110
|
-
return /* @__PURE__ */ X(
|
|
1109
|
+
]), m = u ? null : o;
|
|
1110
|
+
return /* @__PURE__ */ X(Ft, {
|
|
1111
1111
|
openDelay: 300,
|
|
1112
1112
|
closeDelay: 100,
|
|
1113
1113
|
onOpenChange: (e) => {
|
|
1114
1114
|
e && p();
|
|
1115
1115
|
},
|
|
1116
|
-
children: [/* @__PURE__ */ Y(
|
|
1116
|
+
children: [/* @__PURE__ */ Y(jt, {
|
|
1117
1117
|
asChild: !0,
|
|
1118
1118
|
children: t
|
|
1119
|
-
}), /* @__PURE__ */ Y(
|
|
1119
|
+
}), /* @__PURE__ */ Y(Pt, {
|
|
1120
1120
|
side: "top",
|
|
1121
1121
|
align: "start",
|
|
1122
|
-
className: "
|
|
1123
|
-
children: c ? /* @__PURE__ */ Y(
|
|
1122
|
+
className: y(r, "rounded-2xl border-none p-0 shadow-md"),
|
|
1123
|
+
children: c ? /* @__PURE__ */ Y(P.Skeleton, {}) : i.renderCard ? i.renderCard(m) : /* @__PURE__ */ Y(P, { ...m ? i.mapToCard(m) : i.fallbackCard })
|
|
1124
1124
|
})]
|
|
1125
1125
|
});
|
|
1126
1126
|
}
|
|
1127
1127
|
//#endregion
|
|
1128
1128
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/components/MentionTrigger.tsx
|
|
1129
|
-
var
|
|
1129
|
+
var Xn = H(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
1130
1130
|
ref: n,
|
|
1131
1131
|
type: "button",
|
|
1132
1132
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
1133
1133
|
...t,
|
|
1134
1134
|
children: ["@", e]
|
|
1135
1135
|
}));
|
|
1136
|
-
|
|
1136
|
+
Xn.displayName = "MentionTrigger";
|
|
1137
1137
|
//#endregion
|
|
1138
1138
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/custom/CustomEntityRef.tsx
|
|
1139
|
-
function
|
|
1140
|
-
let r = p(), { resolve: i, avatar: a, url: o } = n, s = o?.(e), c =
|
|
1139
|
+
function Zn({ id: e, label: t, config: n }) {
|
|
1140
|
+
let r = p(), { resolve: i, avatar: a, url: o } = n, s = o?.(e), c = U((e) => ({
|
|
1141
1141
|
...e,
|
|
1142
1142
|
avatar: e.avatar ?? a,
|
|
1143
1143
|
...s && { secondaryActions: {
|
|
@@ -1148,10 +1148,10 @@ function Xn({ id: e, label: t, config: n }) {
|
|
|
1148
1148
|
a,
|
|
1149
1149
|
s,
|
|
1150
1150
|
r
|
|
1151
|
-
]), l =
|
|
1152
|
-
return /* @__PURE__ */ Y(
|
|
1151
|
+
]), l = G(() => c({ title: t }), [c, t]), u = U((e) => i ? i(e) : Promise.resolve({ title: t }), [i, t]);
|
|
1152
|
+
return /* @__PURE__ */ Y(Yn, {
|
|
1153
1153
|
id: e,
|
|
1154
|
-
trigger: /* @__PURE__ */ Y(
|
|
1154
|
+
trigger: /* @__PURE__ */ Y(Xn, { label: t }),
|
|
1155
1155
|
resolver: u,
|
|
1156
1156
|
mapToCard: c,
|
|
1157
1157
|
fallbackCard: l
|
|
@@ -1159,16 +1159,16 @@ function Xn({ id: e, label: t, config: n }) {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
//#endregion
|
|
1161
1161
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/candidate/CandidateEntityRef.tsx
|
|
1162
|
-
var
|
|
1162
|
+
var Qn = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1163
1163
|
ref: n,
|
|
1164
1164
|
type: "button",
|
|
1165
1165
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
1166
1166
|
...t,
|
|
1167
1167
|
children: e
|
|
1168
1168
|
}));
|
|
1169
|
-
|
|
1170
|
-
function
|
|
1171
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.candidate, i = p(), a = n?.urls?.candidate?.(e), o =
|
|
1169
|
+
Qn.displayName = "CandidateTrigger";
|
|
1170
|
+
function $n({ id: e, label: t }) {
|
|
1171
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.candidate, i = p(), a = n?.urls?.candidate?.(e), o = G(() => (e) => {
|
|
1172
1172
|
let t = [];
|
|
1173
1173
|
return e.source && t.push({
|
|
1174
1174
|
title: i.t("ai.entityRef.candidate.source"),
|
|
@@ -1202,7 +1202,7 @@ function Qn({ id: e, label: t }) {
|
|
|
1202
1202
|
href: a
|
|
1203
1203
|
} }
|
|
1204
1204
|
};
|
|
1205
|
-
}, [i, a]), s =
|
|
1205
|
+
}, [i, a]), s = G(() => ({
|
|
1206
1206
|
title: t,
|
|
1207
1207
|
...a && { secondaryActions: {
|
|
1208
1208
|
label: i.t("ai.view"),
|
|
@@ -1213,9 +1213,9 @@ function Qn({ id: e, label: t }) {
|
|
|
1213
1213
|
i,
|
|
1214
1214
|
a
|
|
1215
1215
|
]);
|
|
1216
|
-
return r ? /* @__PURE__ */ Y(
|
|
1216
|
+
return r ? /* @__PURE__ */ Y(Yn, {
|
|
1217
1217
|
id: e,
|
|
1218
|
-
trigger: /* @__PURE__ */ Y(
|
|
1218
|
+
trigger: /* @__PURE__ */ Y(Qn, { label: t }),
|
|
1219
1219
|
resolver: r,
|
|
1220
1220
|
mapToCard: o,
|
|
1221
1221
|
fallbackCard: s
|
|
@@ -1223,19 +1223,19 @@ function Qn({ id: e, label: t }) {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
//#endregion
|
|
1225
1225
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/expense/ExpenseEntityRef.tsx
|
|
1226
|
-
var
|
|
1226
|
+
var er = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1227
1227
|
ref: n,
|
|
1228
1228
|
type: "button",
|
|
1229
1229
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
1230
1230
|
...t,
|
|
1231
1231
|
children: e
|
|
1232
1232
|
}));
|
|
1233
|
-
|
|
1234
|
-
function
|
|
1235
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.expense, i = p(), a = n?.urls?.expense?.(e), o =
|
|
1233
|
+
er.displayName = "ExpenseTrigger";
|
|
1234
|
+
function tr({ id: e, label: t }) {
|
|
1235
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.expense, i = p(), a = n?.urls?.expense?.(e), o = G(() => (e) => ({
|
|
1236
1236
|
avatar: {
|
|
1237
1237
|
type: "icon",
|
|
1238
|
-
icon:
|
|
1238
|
+
icon: he
|
|
1239
1239
|
},
|
|
1240
1240
|
title: e.description || `Expense #${e.id}`,
|
|
1241
1241
|
description: [e.amount, e.status].filter(Boolean).join(" · "),
|
|
@@ -1243,7 +1243,7 @@ function er({ id: e, label: t }) {
|
|
|
1243
1243
|
label: i.t("ai.view"),
|
|
1244
1244
|
href: a
|
|
1245
1245
|
} }
|
|
1246
|
-
}), [i, a]), s =
|
|
1246
|
+
}), [i, a]), s = G(() => ({
|
|
1247
1247
|
title: t,
|
|
1248
1248
|
...a && { secondaryActions: {
|
|
1249
1249
|
label: i.t("ai.view"),
|
|
@@ -1254,9 +1254,9 @@ function er({ id: e, label: t }) {
|
|
|
1254
1254
|
i,
|
|
1255
1255
|
a
|
|
1256
1256
|
]);
|
|
1257
|
-
return r ? /* @__PURE__ */ Y(
|
|
1257
|
+
return r ? /* @__PURE__ */ Y(Yn, {
|
|
1258
1258
|
id: e,
|
|
1259
|
-
trigger: /* @__PURE__ */ Y(
|
|
1259
|
+
trigger: /* @__PURE__ */ Y(er, { label: t }),
|
|
1260
1260
|
resolver: r,
|
|
1261
1261
|
mapToCard: o,
|
|
1262
1262
|
fallbackCard: s
|
|
@@ -1264,23 +1264,23 @@ function er({ id: e, label: t }) {
|
|
|
1264
1264
|
}
|
|
1265
1265
|
//#endregion
|
|
1266
1266
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/jobPosting/JobPostingEntityRef.tsx
|
|
1267
|
-
var
|
|
1267
|
+
var nr = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1268
1268
|
ref: n,
|
|
1269
1269
|
type: "button",
|
|
1270
1270
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
1271
1271
|
...t,
|
|
1272
1272
|
children: e
|
|
1273
1273
|
}));
|
|
1274
|
-
|
|
1275
|
-
function
|
|
1276
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.jobPosting, i = p(), a = n?.urls?.jobPosting?.(e), o =
|
|
1274
|
+
nr.displayName = "JobPostingTrigger";
|
|
1275
|
+
function rr({ id: e, label: t }) {
|
|
1276
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.jobPosting, i = p(), a = n?.urls?.jobPosting?.(e), o = G(() => (e) => ({
|
|
1277
1277
|
title: e.title,
|
|
1278
1278
|
description: [e.status, e.location].filter(Boolean).join(" · "),
|
|
1279
1279
|
...a && { secondaryActions: {
|
|
1280
1280
|
label: i.t("ai.view"),
|
|
1281
1281
|
href: a
|
|
1282
1282
|
} }
|
|
1283
|
-
}), [i, a]), s =
|
|
1283
|
+
}), [i, a]), s = G(() => ({
|
|
1284
1284
|
title: t,
|
|
1285
1285
|
...a && { secondaryActions: {
|
|
1286
1286
|
label: i.t("ai.view"),
|
|
@@ -1291,9 +1291,9 @@ function nr({ id: e, label: t }) {
|
|
|
1291
1291
|
i,
|
|
1292
1292
|
a
|
|
1293
1293
|
]);
|
|
1294
|
-
return r ? /* @__PURE__ */ Y(
|
|
1294
|
+
return r ? /* @__PURE__ */ Y(Yn, {
|
|
1295
1295
|
id: e,
|
|
1296
|
-
trigger: /* @__PURE__ */ Y(
|
|
1296
|
+
trigger: /* @__PURE__ */ Y(nr, { label: t }),
|
|
1297
1297
|
resolver: r,
|
|
1298
1298
|
mapToCard: o,
|
|
1299
1299
|
fallbackCard: s
|
|
@@ -1301,42 +1301,33 @@ function nr({ id: e, label: t }) {
|
|
|
1301
1301
|
}
|
|
1302
1302
|
//#endregion
|
|
1303
1303
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/person/PersonEntityRef.tsx
|
|
1304
|
-
function
|
|
1305
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.person, i =
|
|
1306
|
-
|
|
1307
|
-
type: "person",
|
|
1308
|
-
firstName: e.firstName,
|
|
1309
|
-
lastName: e.lastName,
|
|
1310
|
-
src: e.avatarUrl
|
|
1311
|
-
},
|
|
1312
|
-
title: `${e.firstName} ${e.lastName}`,
|
|
1313
|
-
description: e.jobTitle,
|
|
1314
|
-
...a && { secondaryActions: {
|
|
1315
|
-
label: i.t("ai.view"),
|
|
1316
|
-
href: a
|
|
1317
|
-
} }
|
|
1318
|
-
}), [i, a]), s = K(() => ({
|
|
1319
|
-
title: t,
|
|
1320
|
-
...a && { secondaryActions: {
|
|
1321
|
-
label: i.t("ai.view"),
|
|
1322
|
-
href: a
|
|
1323
|
-
} }
|
|
1324
|
-
}), [
|
|
1325
|
-
t,
|
|
1326
|
-
i,
|
|
1327
|
-
a
|
|
1328
|
-
]);
|
|
1329
|
-
return r ? /* @__PURE__ */ Y(Jn, {
|
|
1304
|
+
function ir({ id: e, label: t }) {
|
|
1305
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.person, i = n?.urls?.person?.(e);
|
|
1306
|
+
return r ? /* @__PURE__ */ Y(Yn, {
|
|
1330
1307
|
id: e,
|
|
1331
|
-
trigger: /* @__PURE__ */ Y(
|
|
1308
|
+
trigger: /* @__PURE__ */ Y(Xn, { label: t }),
|
|
1332
1309
|
resolver: r,
|
|
1333
|
-
|
|
1334
|
-
|
|
1310
|
+
contentClassName: "w-72",
|
|
1311
|
+
renderCard: (e) => e ? /* @__PURE__ */ Y(st, {
|
|
1312
|
+
name: `${e.firstName} ${e.lastName}`,
|
|
1313
|
+
avatar: {
|
|
1314
|
+
type: "person",
|
|
1315
|
+
firstName: e.firstName,
|
|
1316
|
+
lastName: e.lastName,
|
|
1317
|
+
src: e.avatarUrl
|
|
1318
|
+
},
|
|
1319
|
+
subtitle: e.jobTitle,
|
|
1320
|
+
profileHref: i,
|
|
1321
|
+
actions: e.actions
|
|
1322
|
+
}) : /* @__PURE__ */ Y(st, {
|
|
1323
|
+
name: t,
|
|
1324
|
+
profileHref: i
|
|
1325
|
+
})
|
|
1335
1326
|
}) : /* @__PURE__ */ Y("span", { children: t });
|
|
1336
1327
|
}
|
|
1337
1328
|
//#endregion
|
|
1338
1329
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/components/EntityRefDetails.tsx
|
|
1339
|
-
function
|
|
1330
|
+
function ar({ rows: e }) {
|
|
1340
1331
|
return e.length === 0 ? null : /* @__PURE__ */ Y("div", {
|
|
1341
1332
|
className: "flex flex-col gap-2",
|
|
1342
1333
|
children: e.map((e, t) => /* @__PURE__ */ X("div", {
|
|
@@ -1353,22 +1344,22 @@ function ir({ rows: e }) {
|
|
|
1353
1344
|
}
|
|
1354
1345
|
//#endregion
|
|
1355
1346
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/requisition/RequisitionEntityRef.tsx
|
|
1356
|
-
var
|
|
1347
|
+
var or = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1357
1348
|
ref: n,
|
|
1358
1349
|
type: "button",
|
|
1359
1350
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
1360
1351
|
...t,
|
|
1361
1352
|
children: e
|
|
1362
1353
|
}));
|
|
1363
|
-
|
|
1364
|
-
function
|
|
1365
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.requisition, i = p(), a = n?.urls?.requisition?.(e), o =
|
|
1354
|
+
or.displayName = "RequisitionTrigger";
|
|
1355
|
+
function sr({ id: e, label: t }) {
|
|
1356
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.requisition, i = p(), a = n?.urls?.requisition?.(e), o = G(() => (e) => {
|
|
1366
1357
|
let t = e.lineManager ? `${e.lineManager.firstName} ${e.lineManager.lastName}` : void 0, n = [
|
|
1367
1358
|
e.status ? {
|
|
1368
1359
|
label: i.t("ai.entityRef.requisition.status"),
|
|
1369
1360
|
value: /* @__PURE__ */ Y("div", {
|
|
1370
1361
|
className: "flex items-center pt-1",
|
|
1371
|
-
children: /* @__PURE__ */ Y(
|
|
1362
|
+
children: /* @__PURE__ */ Y(Ct, {
|
|
1372
1363
|
text: e.status,
|
|
1373
1364
|
variant: e.statusVariant ?? "neutral"
|
|
1374
1365
|
})
|
|
@@ -1378,7 +1369,7 @@ function or({ id: e, label: t }) {
|
|
|
1378
1369
|
label: i.t("ai.entityRef.requisition.lineManager"),
|
|
1379
1370
|
value: /* @__PURE__ */ X("div", {
|
|
1380
1371
|
className: "flex items-center gap-1.5 pt-1",
|
|
1381
|
-
children: [/* @__PURE__ */ Y(
|
|
1372
|
+
children: [/* @__PURE__ */ Y(_t, {
|
|
1382
1373
|
firstName: e.lineManager.firstName,
|
|
1383
1374
|
lastName: e.lineManager.lastName,
|
|
1384
1375
|
src: e.lineManager.avatarUrl,
|
|
@@ -1394,13 +1385,13 @@ function or({ id: e, label: t }) {
|
|
|
1394
1385
|
return {
|
|
1395
1386
|
title: e.title,
|
|
1396
1387
|
...e.location && { description: e.location },
|
|
1397
|
-
...n.length > 0 && { children: /* @__PURE__ */ Y(
|
|
1388
|
+
...n.length > 0 && { children: /* @__PURE__ */ Y(ar, { rows: n }) },
|
|
1398
1389
|
...a && { secondaryActions: {
|
|
1399
1390
|
label: i.t("ai.view"),
|
|
1400
1391
|
href: a
|
|
1401
1392
|
} }
|
|
1402
1393
|
};
|
|
1403
|
-
}, [i, a]), s =
|
|
1394
|
+
}, [i, a]), s = G(() => ({
|
|
1404
1395
|
title: t,
|
|
1405
1396
|
...a && { secondaryActions: {
|
|
1406
1397
|
label: i.t("ai.view"),
|
|
@@ -1411,9 +1402,9 @@ function or({ id: e, label: t }) {
|
|
|
1411
1402
|
i,
|
|
1412
1403
|
a
|
|
1413
1404
|
]);
|
|
1414
|
-
return r ? /* @__PURE__ */ Y(
|
|
1405
|
+
return r ? /* @__PURE__ */ Y(Yn, {
|
|
1415
1406
|
id: e,
|
|
1416
|
-
trigger: /* @__PURE__ */ Y(
|
|
1407
|
+
trigger: /* @__PURE__ */ Y(or, { label: t }),
|
|
1417
1408
|
resolver: r,
|
|
1418
1409
|
mapToCard: o,
|
|
1419
1410
|
fallbackCard: s
|
|
@@ -1421,23 +1412,23 @@ function or({ id: e, label: t }) {
|
|
|
1421
1412
|
}
|
|
1422
1413
|
//#endregion
|
|
1423
1414
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/vacancy/VacancyEntityRef.tsx
|
|
1424
|
-
var
|
|
1415
|
+
var cr = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1425
1416
|
ref: n,
|
|
1426
1417
|
type: "button",
|
|
1427
1418
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
1428
1419
|
...t,
|
|
1429
1420
|
children: e
|
|
1430
1421
|
}));
|
|
1431
|
-
|
|
1432
|
-
function
|
|
1433
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.vacancy, i = p(), a = n?.urls?.vacancy?.(e), o =
|
|
1422
|
+
cr.displayName = "VacancyTrigger";
|
|
1423
|
+
function lr({ id: e, label: t }) {
|
|
1424
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.vacancy, i = p(), a = n?.urls?.vacancy?.(e), o = G(() => (e) => ({
|
|
1434
1425
|
title: e.name,
|
|
1435
1426
|
description: [e.status, e.vacancyType].filter(Boolean).join(" · "),
|
|
1436
1427
|
...a && { secondaryActions: {
|
|
1437
1428
|
label: i.t("ai.view"),
|
|
1438
1429
|
href: a
|
|
1439
1430
|
} }
|
|
1440
|
-
}), [i, a]), s =
|
|
1431
|
+
}), [i, a]), s = G(() => ({
|
|
1441
1432
|
title: t,
|
|
1442
1433
|
...a && { secondaryActions: {
|
|
1443
1434
|
label: i.t("ai.view"),
|
|
@@ -1448,9 +1439,9 @@ function cr({ id: e, label: t }) {
|
|
|
1448
1439
|
i,
|
|
1449
1440
|
a
|
|
1450
1441
|
]);
|
|
1451
|
-
return r ? /* @__PURE__ */ Y(
|
|
1442
|
+
return r ? /* @__PURE__ */ Y(Yn, {
|
|
1452
1443
|
id: e,
|
|
1453
|
-
trigger: /* @__PURE__ */ Y(
|
|
1444
|
+
trigger: /* @__PURE__ */ Y(cr, { label: t }),
|
|
1454
1445
|
resolver: r,
|
|
1455
1446
|
mapToCard: o,
|
|
1456
1447
|
fallbackCard: s
|
|
@@ -1458,35 +1449,35 @@ function cr({ id: e, label: t }) {
|
|
|
1458
1449
|
}
|
|
1459
1450
|
//#endregion
|
|
1460
1451
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/components/entityRefRegistry.ts
|
|
1461
|
-
var
|
|
1462
|
-
["person",
|
|
1463
|
-
["candidate",
|
|
1464
|
-
["expense",
|
|
1465
|
-
["job-posting",
|
|
1466
|
-
["requisition",
|
|
1467
|
-
["vacancy",
|
|
1452
|
+
var ur = /* @__PURE__ */ new Map([
|
|
1453
|
+
["person", ir],
|
|
1454
|
+
["candidate", $n],
|
|
1455
|
+
["expense", tr],
|
|
1456
|
+
["job-posting", rr],
|
|
1457
|
+
["requisition", sr],
|
|
1458
|
+
["vacancy", lr]
|
|
1468
1459
|
]);
|
|
1469
|
-
function
|
|
1470
|
-
return
|
|
1460
|
+
function dr(e) {
|
|
1461
|
+
return ur.get(e);
|
|
1471
1462
|
}
|
|
1472
|
-
function
|
|
1463
|
+
function fr(e, t) {
|
|
1473
1464
|
return e && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
|
|
1474
1465
|
}
|
|
1475
1466
|
//#endregion
|
|
1476
1467
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/components/EntityRef.tsx
|
|
1477
|
-
function
|
|
1478
|
-
return typeof e == "string" ? e : typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(
|
|
1468
|
+
function pr(e) {
|
|
1469
|
+
return typeof e == "string" ? e : typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(pr).join("") : e && typeof e == "object" && "props" in e ? pr(e.props.children) : "";
|
|
1479
1470
|
}
|
|
1480
|
-
function
|
|
1471
|
+
function mr({ type: e, id: t, children: n }) {
|
|
1481
1472
|
let { entityRefs: r } = V();
|
|
1482
1473
|
if (!t || !e) return /* @__PURE__ */ Y("span", { children: n });
|
|
1483
|
-
let i =
|
|
1474
|
+
let i = pr(n), a = dr(e);
|
|
1484
1475
|
if (a) return /* @__PURE__ */ Y(a, {
|
|
1485
1476
|
id: t,
|
|
1486
1477
|
label: i
|
|
1487
1478
|
});
|
|
1488
|
-
let o =
|
|
1489
|
-
return o ? /* @__PURE__ */ Y(
|
|
1479
|
+
let o = fr(r?.custom, e);
|
|
1480
|
+
return o ? /* @__PURE__ */ Y(Zn, {
|
|
1490
1481
|
id: t,
|
|
1491
1482
|
label: i,
|
|
1492
1483
|
config: o
|
|
@@ -1494,18 +1485,18 @@ function pr({ type: e, id: t, children: n }) {
|
|
|
1494
1485
|
}
|
|
1495
1486
|
//#endregion
|
|
1496
1487
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Table.tsx
|
|
1497
|
-
async function
|
|
1498
|
-
let r =
|
|
1488
|
+
async function hr(e, t, n) {
|
|
1489
|
+
let r = ot(e), i = t === "xlsx" ? await ue([{
|
|
1499
1490
|
name: "Data",
|
|
1500
1491
|
rows: r
|
|
1501
|
-
}]) : await
|
|
1502
|
-
|
|
1492
|
+
}]) : await se(r);
|
|
1493
|
+
E(i, `${n}.${t}`);
|
|
1503
1494
|
}
|
|
1504
|
-
function
|
|
1505
|
-
let r = p(), i =
|
|
1495
|
+
function gr({ children: e, title: t, ...n }) {
|
|
1496
|
+
let r = p(), i = K(null), a = U((e) => {
|
|
1506
1497
|
if (!i.current) return;
|
|
1507
1498
|
let n = t?.replace(/\s+/g, "_").toLowerCase() || "table";
|
|
1508
|
-
|
|
1499
|
+
hr(i.current, e, n);
|
|
1509
1500
|
}, [t]);
|
|
1510
1501
|
return /* @__PURE__ */ X("div", {
|
|
1511
1502
|
className: "group/table relative my-2 flex flex-col gap-2 rounded-md border border-solid border-f1-border-secondary first:mt-0 last:mb-0",
|
|
@@ -1515,7 +1506,7 @@ function hr({ children: e, title: t, ...n }) {
|
|
|
1515
1506
|
tag: "h2",
|
|
1516
1507
|
className: "text-base font-medium capitalize text-f1-foreground",
|
|
1517
1508
|
children: t ?? r.ai.reportCard.tableLabel
|
|
1518
|
-
}), /* @__PURE__ */ Y(
|
|
1509
|
+
}), /* @__PURE__ */ Y(it, {
|
|
1519
1510
|
icon: B,
|
|
1520
1511
|
size: "md",
|
|
1521
1512
|
items: [{
|
|
@@ -1539,15 +1530,15 @@ function hr({ children: e, title: t, ...n }) {
|
|
|
1539
1530
|
})]
|
|
1540
1531
|
});
|
|
1541
1532
|
}
|
|
1542
|
-
function
|
|
1533
|
+
function _r({ children: e, ...t }) {
|
|
1543
1534
|
return /* @__PURE__ */ Y("th", {
|
|
1544
1535
|
...t,
|
|
1545
1536
|
className: y("sticky top-0 z-10 whitespace-nowrap border-0 border-b border-solid border-f1-border-secondary bg-f1-background px-3 py-2 text-left font-medium text-f1-foreground-secondary", t.className),
|
|
1546
1537
|
children: e
|
|
1547
1538
|
});
|
|
1548
1539
|
}
|
|
1549
|
-
function
|
|
1550
|
-
let r = t ?
|
|
1540
|
+
function vr({ children: e, ellipsis: t = !1, ...n }) {
|
|
1541
|
+
let r = t ? pr(e) : void 0;
|
|
1551
1542
|
return /* @__PURE__ */ Y("td", {
|
|
1552
1543
|
title: r || void 0,
|
|
1553
1544
|
...n,
|
|
@@ -1557,42 +1548,42 @@ function _r({ children: e, ellipsis: t = !1, ...n }) {
|
|
|
1557
1548
|
}
|
|
1558
1549
|
//#endregion
|
|
1559
1550
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Typography.tsx
|
|
1560
|
-
function
|
|
1551
|
+
function yr({ children: e, ...t }) {
|
|
1561
1552
|
return /* @__PURE__ */ Y("p", {
|
|
1562
1553
|
...t,
|
|
1563
1554
|
className: y("text-base font-normal", t.className),
|
|
1564
1555
|
children: e
|
|
1565
1556
|
});
|
|
1566
1557
|
}
|
|
1567
|
-
function
|
|
1558
|
+
function br({ children: e, ...t }) {
|
|
1568
1559
|
return /* @__PURE__ */ Y("h1", {
|
|
1569
1560
|
...t,
|
|
1570
1561
|
className: y("mb-2.5 mt-4 text-2xl font-medium first:mt-0 last:mb-0", t.className),
|
|
1571
1562
|
children: e
|
|
1572
1563
|
});
|
|
1573
1564
|
}
|
|
1574
|
-
function
|
|
1565
|
+
function xr({ children: e, ...t }) {
|
|
1575
1566
|
return /* @__PURE__ */ Y("h2", {
|
|
1576
1567
|
...t,
|
|
1577
1568
|
className: y("mb-2.5 mt-4 text-lg font-medium leading-6 first:mt-0 last:mb-0", t.className),
|
|
1578
1569
|
children: e
|
|
1579
1570
|
});
|
|
1580
1571
|
}
|
|
1581
|
-
function
|
|
1572
|
+
function Sr({ children: e, ...t }) {
|
|
1582
1573
|
return /* @__PURE__ */ Y("h3", {
|
|
1583
1574
|
...t,
|
|
1584
1575
|
className: y("mb-2 mt-3.5 text-base font-semibold first:mt-0 last:mb-0", t.className),
|
|
1585
1576
|
children: e
|
|
1586
1577
|
});
|
|
1587
1578
|
}
|
|
1588
|
-
function
|
|
1579
|
+
function Cr({ children: e, ...t }) {
|
|
1589
1580
|
return /* @__PURE__ */ Y("strong", {
|
|
1590
1581
|
...t,
|
|
1591
1582
|
className: y("font-semibold", t.className),
|
|
1592
1583
|
children: e
|
|
1593
1584
|
});
|
|
1594
1585
|
}
|
|
1595
|
-
function
|
|
1586
|
+
function wr({ children: e, ...t }) {
|
|
1596
1587
|
return /* @__PURE__ */ Y("em", {
|
|
1597
1588
|
...t,
|
|
1598
1589
|
className: y("italic", t.className),
|
|
@@ -1601,85 +1592,85 @@ function Cr({ children: e, ...t }) {
|
|
|
1601
1592
|
}
|
|
1602
1593
|
//#endregion
|
|
1603
1594
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/MarkdownRenderers.tsx
|
|
1604
|
-
var
|
|
1605
|
-
p:
|
|
1606
|
-
h1:
|
|
1607
|
-
h2:
|
|
1608
|
-
h3:
|
|
1609
|
-
a:
|
|
1610
|
-
strong:
|
|
1611
|
-
em:
|
|
1612
|
-
li:
|
|
1613
|
-
pre:
|
|
1614
|
-
code:
|
|
1615
|
-
blockquote:
|
|
1616
|
-
hr:
|
|
1617
|
-
ul:
|
|
1618
|
-
ol:
|
|
1619
|
-
table:
|
|
1620
|
-
th:
|
|
1621
|
-
td:
|
|
1622
|
-
img:
|
|
1623
|
-
"entity-ref":
|
|
1624
|
-
},
|
|
1595
|
+
var Tr = {
|
|
1596
|
+
p: yr,
|
|
1597
|
+
h1: br,
|
|
1598
|
+
h2: xr,
|
|
1599
|
+
h3: Sr,
|
|
1600
|
+
a: Gn,
|
|
1601
|
+
strong: Cr,
|
|
1602
|
+
em: wr,
|
|
1603
|
+
li: Jn,
|
|
1604
|
+
pre: Bn,
|
|
1605
|
+
code: Vn,
|
|
1606
|
+
blockquote: Hn,
|
|
1607
|
+
hr: Un,
|
|
1608
|
+
ul: Kn,
|
|
1609
|
+
ol: qn,
|
|
1610
|
+
table: gr,
|
|
1611
|
+
th: _r,
|
|
1612
|
+
td: vr,
|
|
1613
|
+
img: Wn,
|
|
1614
|
+
"entity-ref": mr
|
|
1615
|
+
}, Er = (e) => typeof e == "object" && !!e, Z = (e) => typeof e == "string" && e.length > 0 ? e : void 0, Dr = (e, t) => {
|
|
1625
1616
|
if (e && e.trim() && e !== "file") return e;
|
|
1626
1617
|
if (t.startsWith("data:")) {
|
|
1627
1618
|
let [e, n] = (t.slice(5).split(/[;,]/, 1)[0] ?? "").split("/"), r = e === "image" ? "image" : "file", i = n?.split("+")[0];
|
|
1628
1619
|
return i ? `${r}.${i}` : r;
|
|
1629
1620
|
}
|
|
1630
1621
|
let n = t.split("?")[1], r = n ? new URLSearchParams(n.split("#")[0]).get("path") : null;
|
|
1631
|
-
return
|
|
1632
|
-
},
|
|
1633
|
-
let n = Z(e.data), r = Z(e.url) ?? (n ?
|
|
1622
|
+
return Xe(r ?? t) || e || "file";
|
|
1623
|
+
}, Or = (e, t) => e.startsWith("data:") ? e : `data:${t ?? "application/octet-stream"};base64,${e}`, kr = (e, t) => {
|
|
1624
|
+
let n = Z(e.data), r = Z(e.url) ?? (n ? Or(n, t) : void 0);
|
|
1634
1625
|
return r ? {
|
|
1635
1626
|
url: r,
|
|
1636
|
-
name:
|
|
1627
|
+
name: Dr(Z(e.filename), r),
|
|
1637
1628
|
mimeType: t
|
|
1638
1629
|
} : null;
|
|
1639
|
-
},
|
|
1640
|
-
if (!
|
|
1641
|
-
if (e.type === "binary") return
|
|
1630
|
+
}, Ar = (e) => {
|
|
1631
|
+
if (!Er(e)) return null;
|
|
1632
|
+
if (e.type === "binary") return kr(e, Z(e.mimeType));
|
|
1642
1633
|
if (e.type !== "file") return null;
|
|
1643
|
-
if (!
|
|
1634
|
+
if (!Er(e.file)) return kr(e, Z(e.mediaType) ?? Z(e.mimeType));
|
|
1644
1635
|
let t = Z(e.file.url);
|
|
1645
1636
|
return t ? {
|
|
1646
1637
|
url: t,
|
|
1647
|
-
name:
|
|
1638
|
+
name: Dr(Z(e.file.filename), t),
|
|
1648
1639
|
mimeType: Z(e.file.mimetype) ?? Z(e.file.mimeType)
|
|
1649
1640
|
} : null;
|
|
1650
|
-
},
|
|
1641
|
+
}, jr = (e) => ({
|
|
1651
1642
|
url: e.url,
|
|
1652
|
-
name:
|
|
1643
|
+
name: Dr(e.filename, e.url),
|
|
1653
1644
|
mimeType: e.mimetype
|
|
1654
|
-
}),
|
|
1645
|
+
}), Mr = (e) => {
|
|
1655
1646
|
let t = /* @__PURE__ */ new Set();
|
|
1656
1647
|
return e.filter((e) => !t.has(e.url) && (t.add(e.url), !0));
|
|
1657
|
-
},
|
|
1658
|
-
let t = Array.isArray(e.content) ? e.content.map(
|
|
1659
|
-
if (t.length > 0) return
|
|
1660
|
-
let n =
|
|
1661
|
-
return Array.isArray(n) ?
|
|
1662
|
-
},
|
|
1648
|
+
}, Nr = (e) => {
|
|
1649
|
+
let t = Array.isArray(e.content) ? e.content.map(Ar).filter((e) => e !== null) : [];
|
|
1650
|
+
if (t.length > 0) return Mr(t);
|
|
1651
|
+
let n = Er(e.rawData) ? e.rawData.uploadedFiles : void 0;
|
|
1652
|
+
return Array.isArray(n) ? Mr(n.filter((e) => Er(e) && typeof e.url == "string").map(jr)) : [];
|
|
1653
|
+
}, Pr = (e, t = "assistant") => {
|
|
1663
1654
|
if (typeof e == "string") return e;
|
|
1664
1655
|
if (!Array.isArray(e)) return;
|
|
1665
|
-
let n = e.filter((e) =>
|
|
1656
|
+
let n = e.filter((e) => Er(e) && e.type === "text" && typeof e.text == "string").map((e) => e.text);
|
|
1666
1657
|
if (n.length !== 0) return t === "user" ? n[n.length - 1] : n.join("\n\n");
|
|
1667
|
-
},
|
|
1658
|
+
}, Fr = (e, { urlFor: t } = {}) => ({
|
|
1668
1659
|
url: e.url ?? t?.(e.path) ?? e.path,
|
|
1669
|
-
name: e.displayName ||
|
|
1660
|
+
name: e.displayName || Xe(e.path),
|
|
1670
1661
|
mimeType: e.mimeType,
|
|
1671
1662
|
size: e.bytes,
|
|
1672
1663
|
previewUrl: e.preview && t ? t(e.preview.path) : void 0
|
|
1673
|
-
}),
|
|
1664
|
+
}), Ir = (e) => Ge(e) ?? "", Lr = ({ avatar: e }) => e?.type === "module" ? /* @__PURE__ */ Y(ht, {
|
|
1674
1665
|
module: e.module,
|
|
1675
1666
|
size: "md"
|
|
1676
|
-
}) : e?.type === "file" ? /* @__PURE__ */ Y(
|
|
1667
|
+
}) : e?.type === "file" ? /* @__PURE__ */ Y(mt, {
|
|
1677
1668
|
file: e.file,
|
|
1678
1669
|
size: "lg"
|
|
1679
|
-
}) : e?.type === "icon" ? /* @__PURE__ */ Y(
|
|
1670
|
+
}) : e?.type === "icon" ? /* @__PURE__ */ Y(pt, {
|
|
1680
1671
|
icon: e.icon,
|
|
1681
1672
|
size: "md"
|
|
1682
|
-
}) : null,
|
|
1673
|
+
}) : null, Rr = ({ action: e, isActive: t }) => {
|
|
1683
1674
|
let n = p();
|
|
1684
1675
|
return e.type === "open" && e.showButton !== !1 ? /* @__PURE__ */ Y(o, {
|
|
1685
1676
|
variant: "outline",
|
|
@@ -1695,7 +1686,7 @@ var wr = {
|
|
|
1695
1686
|
onClick: e.onClick
|
|
1696
1687
|
}) : null;
|
|
1697
1688
|
};
|
|
1698
|
-
function
|
|
1689
|
+
function zr({ avatar: e, title: t, description: n, isActive: r = !1, action: i, children: a }) {
|
|
1699
1690
|
let o = i.type === "open", s = o ? r ? i.onClose : i.onOpen : void 0;
|
|
1700
1691
|
return /* @__PURE__ */ X("div", {
|
|
1701
1692
|
className: y("flex flex-col items-center justify-between gap-3 rounded-lg border border-solid px-3 py-2", o && "cursor-pointer", r ? "border-f1-border-hover" : "border-f1-border-secondary"),
|
|
@@ -1703,7 +1694,7 @@ function Rr({ avatar: e, title: t, description: n, isActive: r = !1, action: i,
|
|
|
1703
1694
|
children: [/* @__PURE__ */ X("div", {
|
|
1704
1695
|
className: "flex w-full min-w-0 flex-row items-center gap-3",
|
|
1705
1696
|
children: [
|
|
1706
|
-
/* @__PURE__ */ Y(
|
|
1697
|
+
/* @__PURE__ */ Y(Lr, { avatar: e }),
|
|
1707
1698
|
/* @__PURE__ */ X("div", {
|
|
1708
1699
|
className: "flex min-w-0 flex-1 flex-col",
|
|
1709
1700
|
children: [/* @__PURE__ */ Y(v, {
|
|
@@ -1714,7 +1705,7 @@ function Rr({ avatar: e, title: t, description: n, isActive: r = !1, action: i,
|
|
|
1714
1705
|
children: n
|
|
1715
1706
|
}) : null]
|
|
1716
1707
|
}),
|
|
1717
|
-
/* @__PURE__ */ Y(
|
|
1708
|
+
/* @__PURE__ */ Y(Rr, {
|
|
1718
1709
|
action: i,
|
|
1719
1710
|
isActive: r
|
|
1720
1711
|
})
|
|
@@ -1722,26 +1713,26 @@ function Rr({ avatar: e, title: t, description: n, isActive: r = !1, action: i,
|
|
|
1722
1713
|
}), a]
|
|
1723
1714
|
});
|
|
1724
1715
|
}
|
|
1725
|
-
|
|
1716
|
+
zr.displayName = "F0CanvasCard";
|
|
1726
1717
|
//#endregion
|
|
1727
1718
|
//#region src/addons/ai/ai/F0AiChat/providers/FormCardValueFormatterProvider.tsx
|
|
1728
|
-
var
|
|
1729
|
-
function
|
|
1730
|
-
let [t, n] =
|
|
1719
|
+
var Br = Vt(null);
|
|
1720
|
+
function Vr({ children: e }) {
|
|
1721
|
+
let [t, n] = q(0), r = K([]), i = U((e) => {
|
|
1731
1722
|
let t = r.current, i = t.findIndex((t) => t.formName === e.formName && t.customFieldName === e.customFieldName), a = e;
|
|
1732
1723
|
i >= 0 ? t[i] = a : t.push(a), n((e) => e + 1);
|
|
1733
|
-
}, []), a =
|
|
1724
|
+
}, []), a = G(() => ({
|
|
1734
1725
|
formatters: [...r.current],
|
|
1735
1726
|
setFormCardValueFormatter: i
|
|
1736
1727
|
}), [i, t]);
|
|
1737
|
-
return /* @__PURE__ */ Y(
|
|
1728
|
+
return /* @__PURE__ */ Y(Br.Provider, {
|
|
1738
1729
|
value: a,
|
|
1739
1730
|
children: e
|
|
1740
1731
|
});
|
|
1741
1732
|
}
|
|
1742
|
-
function
|
|
1743
|
-
let t =
|
|
1744
|
-
return
|
|
1733
|
+
function Hr(e) {
|
|
1734
|
+
let t = Wt(Br)?.formatters;
|
|
1735
|
+
return G(() => !t || t.length === 0 ? null : (n, r, i) => {
|
|
1745
1736
|
let a, o = -1;
|
|
1746
1737
|
for (let n of t) {
|
|
1747
1738
|
let t = n.formName === void 0 || n.formName === e, r = n.customFieldName === void 0 || n.customFieldName === i.customFieldName;
|
|
@@ -1755,57 +1746,57 @@ function Vr(e) {
|
|
|
1755
1746
|
});
|
|
1756
1747
|
}, [t, e]);
|
|
1757
1748
|
}
|
|
1758
|
-
function
|
|
1759
|
-
let e =
|
|
1749
|
+
function Ur() {
|
|
1750
|
+
let e = Wt(Br);
|
|
1760
1751
|
if (!e) throw Error("useSetFormCardValueFormatter must be used within a FormCardValueFormatterProvider");
|
|
1761
1752
|
return e.setFormCardValueFormatter;
|
|
1762
1753
|
}
|
|
1763
1754
|
//#endregion
|
|
1764
1755
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/FormCard.tsx
|
|
1765
|
-
var
|
|
1766
|
-
function
|
|
1756
|
+
var Wr = 7, Gr = 625, Kr = /* @__PURE__ */ new Set();
|
|
1757
|
+
function qr(e) {
|
|
1767
1758
|
return typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "text/html").body.textContent?.replace(/\s+/g, " ").trim() ?? "" : e.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
|
1768
1759
|
}
|
|
1769
|
-
function
|
|
1760
|
+
function Jr(e) {
|
|
1770
1761
|
return e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
1771
1762
|
}
|
|
1772
|
-
function
|
|
1773
|
-
let { days: t, hours: n, minutes: r, seconds: i } =
|
|
1763
|
+
function Yr(e) {
|
|
1764
|
+
let { days: t, hours: n, minutes: r, seconds: i } = De(e), a = [];
|
|
1774
1765
|
return t > 0 && a.push(`${t}d`), n > 0 && a.push(`${n}h`), r > 0 && a.push(`${r}m`), (i > 0 || a.length === 0) && a.push(`${i}s`), a.join(" ");
|
|
1775
1766
|
}
|
|
1776
|
-
function
|
|
1767
|
+
function Xr(e) {
|
|
1777
1768
|
if (e instanceof Date) return !0;
|
|
1778
1769
|
if (typeof e != "string") return !1;
|
|
1779
1770
|
let t = new Date(e);
|
|
1780
1771
|
return !Number.isNaN(t.getTime());
|
|
1781
1772
|
}
|
|
1782
|
-
function
|
|
1773
|
+
function Zr(e) {
|
|
1783
1774
|
return (e instanceof Date ? e : new Date(e)).toLocaleDateString();
|
|
1784
1775
|
}
|
|
1785
|
-
function
|
|
1776
|
+
function Qr(e) {
|
|
1786
1777
|
return e.type === "item" ? e.text : "";
|
|
1787
1778
|
}
|
|
1788
|
-
function
|
|
1779
|
+
function $r(e, t) {
|
|
1789
1780
|
if (e == null || e === "") return {
|
|
1790
1781
|
type: "item",
|
|
1791
1782
|
text: "—"
|
|
1792
1783
|
};
|
|
1793
1784
|
if (t === "duration" && typeof e == "number") return {
|
|
1794
1785
|
type: "item",
|
|
1795
|
-
text:
|
|
1786
|
+
text: Yr(e)
|
|
1796
1787
|
};
|
|
1797
1788
|
if (t === "richtext" && typeof e == "object" && e && "value" in e) {
|
|
1798
1789
|
let t = e.value;
|
|
1799
1790
|
return {
|
|
1800
1791
|
type: "item",
|
|
1801
|
-
text: (t ?
|
|
1792
|
+
text: (t ? qr(t) : "") || "—"
|
|
1802
1793
|
};
|
|
1803
1794
|
}
|
|
1804
1795
|
if (t === "daterange" && typeof e == "object" && e && "from" in e && "to" in e) {
|
|
1805
1796
|
let { from: t, to: n } = e;
|
|
1806
1797
|
return {
|
|
1807
1798
|
type: "item",
|
|
1808
|
-
text: `${
|
|
1799
|
+
text: `${Xr(t) ? Zr(t) : String(t)} – ${Xr(n) ? Zr(n) : String(n)}`
|
|
1809
1800
|
};
|
|
1810
1801
|
}
|
|
1811
1802
|
if (e instanceof Date) return {
|
|
@@ -1819,8 +1810,8 @@ function Qr(e, t) {
|
|
|
1819
1810
|
if (Array.isArray(e)) return {
|
|
1820
1811
|
type: "item",
|
|
1821
1812
|
text: e.map((e) => {
|
|
1822
|
-
let t =
|
|
1823
|
-
return Array.isArray(t) ? t.map(
|
|
1813
|
+
let t = $r(e);
|
|
1814
|
+
return Array.isArray(t) ? t.map(Qr).join(", ") : Qr(t);
|
|
1824
1815
|
}).filter(Boolean).join(", ") || "—"
|
|
1825
1816
|
};
|
|
1826
1817
|
if (typeof e == "object" && e) {
|
|
@@ -1841,11 +1832,11 @@ function Qr(e, t) {
|
|
|
1841
1832
|
}
|
|
1842
1833
|
return {
|
|
1843
1834
|
type: "item",
|
|
1844
|
-
text:
|
|
1835
|
+
text: Jr(String(e))
|
|
1845
1836
|
};
|
|
1846
1837
|
}
|
|
1847
|
-
function
|
|
1848
|
-
let { canvasContent: c, openCanvas: l, closeCanvas: u } = V(), d =
|
|
1838
|
+
function ei({ formName: e, formDescription: t, module: n, cardTitle: r, cardDescription: i, fieldDescriptions: a, formValues: o, valueFormatter: s }) {
|
|
1839
|
+
let { canvasContent: c, openCanvas: l, closeCanvas: u } = V(), d = Hr(e), f = s ?? d, p = K(() => {}), m = r ?? e, h = i ?? t ?? "", g = c?.type === "form" && c.formName === e, _ = () => l({
|
|
1849
1840
|
type: "form",
|
|
1850
1841
|
title: m,
|
|
1851
1842
|
description: h,
|
|
@@ -1853,8 +1844,8 @@ function $r({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
|
|
|
1853
1844
|
formDescription: t,
|
|
1854
1845
|
formModule: n
|
|
1855
1846
|
});
|
|
1856
|
-
p.current = _,
|
|
1857
|
-
typeof window < "u" && (window.innerWidth <
|
|
1847
|
+
p.current = _, W(() => {
|
|
1848
|
+
typeof window < "u" && (window.innerWidth < Gr || Kr.has(e) || (Kr.add(e), p.current()));
|
|
1858
1849
|
}, [e]);
|
|
1859
1850
|
let v = a && o ? Object.entries(a).map(([e, t]) => {
|
|
1860
1851
|
let n = o[e], r = f?.(e, n, {
|
|
@@ -1862,7 +1853,7 @@ function $r({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
|
|
|
1862
1853
|
customFieldName: t.customFieldName
|
|
1863
1854
|
});
|
|
1864
1855
|
if (!r && t.fieldType === "custom" && typeof n == "object" && n) return null;
|
|
1865
|
-
let i = r ??
|
|
1856
|
+
let i = r ?? $r(n, t.fieldType);
|
|
1866
1857
|
return {
|
|
1867
1858
|
label: t.label,
|
|
1868
1859
|
content: i,
|
|
@@ -1872,8 +1863,8 @@ function $r({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
|
|
|
1872
1863
|
if (!e) return !1;
|
|
1873
1864
|
let t = Array.isArray(e.content) ? e.content[0] : e.content;
|
|
1874
1865
|
return t?.type !== "item" || t.text !== "—";
|
|
1875
|
-
}) : [], y = v.slice(0,
|
|
1876
|
-
return /* @__PURE__ */ Y(
|
|
1866
|
+
}) : [], y = v.slice(0, Wr), b = v.length > Wr;
|
|
1867
|
+
return /* @__PURE__ */ Y(zr, {
|
|
1877
1868
|
avatar: n ? {
|
|
1878
1869
|
type: "module",
|
|
1879
1870
|
module: n
|
|
@@ -1889,7 +1880,7 @@ function $r({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
|
|
|
1889
1880
|
},
|
|
1890
1881
|
children: y.length > 0 && !g ? /* @__PURE__ */ Y("div", {
|
|
1891
1882
|
className: "-mx-3 flex w-full flex-col overflow-hidden pb-1",
|
|
1892
|
-
children: /* @__PURE__ */ Y(
|
|
1883
|
+
children: /* @__PURE__ */ Y(Oe, {
|
|
1893
1884
|
details: y.map((e) => ({
|
|
1894
1885
|
title: e.label,
|
|
1895
1886
|
content: e.content,
|
|
@@ -1902,16 +1893,16 @@ function $r({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
|
|
|
1902
1893
|
}) : null
|
|
1903
1894
|
});
|
|
1904
1895
|
}
|
|
1905
|
-
|
|
1896
|
+
ei.displayName = "FormCard";
|
|
1906
1897
|
//#endregion
|
|
1907
1898
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/ActiveFormCard.tsx
|
|
1908
|
-
function
|
|
1909
|
-
let e =
|
|
1899
|
+
function ti() {
|
|
1900
|
+
let e = oe(), t = e?.activeForm;
|
|
1910
1901
|
if (!t) return null;
|
|
1911
1902
|
let n = t.cardTitle, r = t.cardDescription, i = (e?.getFillVersion(t.formName) ?? 0) > 0;
|
|
1912
1903
|
return !n || !r || !i ? null : /* @__PURE__ */ Y("div", {
|
|
1913
1904
|
className: "mt-2 w-full",
|
|
1914
|
-
children: /* @__PURE__ */ Y(
|
|
1905
|
+
children: /* @__PURE__ */ Y(ei, {
|
|
1915
1906
|
formName: t.formName,
|
|
1916
1907
|
formDescription: t.description,
|
|
1917
1908
|
module: t.module,
|
|
@@ -1924,11 +1915,11 @@ function ei() {
|
|
|
1924
1915
|
}
|
|
1925
1916
|
//#endregion
|
|
1926
1917
|
//#region src/addons/ai/ai/F0AiFileAttachments/F0AiFileAttachments.tsx
|
|
1927
|
-
var
|
|
1928
|
-
let { provided: t } =
|
|
1929
|
-
return t ? /* @__PURE__ */ Y(
|
|
1930
|
-
},
|
|
1931
|
-
let { remotePreviews: a } =
|
|
1918
|
+
var ni = "rounded-xl", ri = "ai-chat", ii = (e) => {
|
|
1919
|
+
let { provided: t } = Ue();
|
|
1920
|
+
return t ? /* @__PURE__ */ Y(ai, { ...e }) : /* @__PURE__ */ Y(et, { children: /* @__PURE__ */ Y(ai, { ...e }) });
|
|
1921
|
+
}, ai = ({ files: e, align: t = "start", onOpenFile: n, onFileDownloaded: r, size: i = "default" }) => {
|
|
1922
|
+
let { remotePreviews: a } = Ue(), { openImagePreview: o } = lt(), [s, c] = q(() => /* @__PURE__ */ new Set()), l = G(() => oi(e, a, s), [
|
|
1932
1923
|
e,
|
|
1933
1924
|
a,
|
|
1934
1925
|
s
|
|
@@ -1941,13 +1932,13 @@ var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
|
1941
1932
|
onOpenFile: n,
|
|
1942
1933
|
onFileDownloaded: r,
|
|
1943
1934
|
openImage: (e, t) => {
|
|
1944
|
-
n?.(e, "image") !== !1 && o(l.images.map(
|
|
1935
|
+
n?.(e, "image") !== !1 && o(l.images.map(rt), t);
|
|
1945
1936
|
},
|
|
1946
1937
|
onImageError: (e) => c((t) => new Set(t).add(e.url))
|
|
1947
1938
|
};
|
|
1948
|
-
return Y(i === "compact" ?
|
|
1949
|
-
},
|
|
1950
|
-
let r = (e) => t ||
|
|
1939
|
+
return Y(i === "compact" ? li : ci, { ...u });
|
|
1940
|
+
}, oi = (e, t, n) => {
|
|
1941
|
+
let r = (e) => t || k(e.url), i = Ie(e.filter(r)), a = /* @__PURE__ */ new Set([
|
|
1951
1942
|
...e.filter((e) => !r(e)),
|
|
1952
1943
|
...i.images.filter((e) => n.has(e.url)),
|
|
1953
1944
|
...i.files
|
|
@@ -1958,15 +1949,15 @@ var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
|
1958
1949
|
documents: i.documents,
|
|
1959
1950
|
chips: e.filter((e) => a.has(e))
|
|
1960
1951
|
};
|
|
1961
|
-
},
|
|
1952
|
+
}, si = ({ align: e, compact: t = !1, children: n }) => /* @__PURE__ */ Y("div", {
|
|
1962
1953
|
className: y("flex w-full min-w-0 flex-col gap-1.5", e === "end" ? "items-end" : "items-start"),
|
|
1963
1954
|
"data-testid": "ai-chat-file-attachments",
|
|
1964
1955
|
"data-size": t ? "compact" : void 0,
|
|
1965
1956
|
children: n
|
|
1966
|
-
}),
|
|
1957
|
+
}), ci = ({ images: e, videos: t, documents: n, chips: r, align: i, openImage: a, onImageError: o, onOpenFile: s, onFileDownloaded: c }) => /* @__PURE__ */ X(si, {
|
|
1967
1958
|
align: i,
|
|
1968
1959
|
children: [
|
|
1969
|
-
e.length > 0 ? /* @__PURE__ */ Y(
|
|
1960
|
+
e.length > 0 ? /* @__PURE__ */ Y(pi, {
|
|
1970
1961
|
images: e,
|
|
1971
1962
|
onOpen: (t) => {
|
|
1972
1963
|
let n = e[t];
|
|
@@ -1974,80 +1965,80 @@ var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
|
1974
1965
|
},
|
|
1975
1966
|
onImageError: o
|
|
1976
1967
|
}) : null,
|
|
1977
|
-
t.map((e, t) => /* @__PURE__ */ Y(
|
|
1978
|
-
file:
|
|
1968
|
+
t.map((e, t) => /* @__PURE__ */ Y(Pe, {
|
|
1969
|
+
file: we(e),
|
|
1979
1970
|
cornerClass: "rounded-xl",
|
|
1980
|
-
testIdPrefix:
|
|
1971
|
+
testIdPrefix: ri,
|
|
1981
1972
|
onDownloaded: () => c?.(e)
|
|
1982
1973
|
}, `${e.name}-${t}`)),
|
|
1983
|
-
n.map(({ file: e, kind: t }, n) => /* @__PURE__ */ Y(
|
|
1984
|
-
file:
|
|
1974
|
+
n.map(({ file: e, kind: t }, n) => /* @__PURE__ */ Y(N, {
|
|
1975
|
+
file: we(e),
|
|
1985
1976
|
kind: t,
|
|
1986
1977
|
cornerClass: "rounded-xl",
|
|
1987
|
-
testIdPrefix:
|
|
1978
|
+
testIdPrefix: ri,
|
|
1988
1979
|
lazyMount: !0,
|
|
1989
1980
|
fitWidth: !0,
|
|
1990
1981
|
decorativeSnapshot: !0,
|
|
1991
1982
|
onBeforeOpen: () => s?.(e, "document"),
|
|
1992
1983
|
onDownloaded: () => c?.(e)
|
|
1993
1984
|
}, `${e.name}-${n}`)),
|
|
1994
|
-
/* @__PURE__ */ Y(
|
|
1985
|
+
/* @__PURE__ */ Y(ui, {
|
|
1995
1986
|
files: r,
|
|
1996
1987
|
align: i,
|
|
1997
1988
|
onFileDownloaded: c
|
|
1998
1989
|
})
|
|
1999
1990
|
]
|
|
2000
|
-
}),
|
|
1991
|
+
}), li = ({ files: e, images: t, videos: n, documents: r, chips: i, align: a, openImage: o, onImageError: s, onOpenFile: c, onFileDownloaded: l }) => {
|
|
2001
1992
|
let u = new Map(r.map((e) => [e.file, e.kind])), d = e.filter((e) => t.includes(e) || u.has(e));
|
|
2002
|
-
return /* @__PURE__ */ X(
|
|
1993
|
+
return /* @__PURE__ */ X(si, {
|
|
2003
1994
|
align: a,
|
|
2004
1995
|
compact: !0,
|
|
2005
1996
|
children: [d.length > 0 ? /* @__PURE__ */ Y("div", {
|
|
2006
1997
|
className: y("flex max-w-full flex-wrap gap-1", a === "end" ? "justify-end" : "justify-start"),
|
|
2007
1998
|
children: d.map((e, n) => {
|
|
2008
1999
|
let r = u.get(e);
|
|
2009
|
-
return r ? /* @__PURE__ */ Y(
|
|
2010
|
-
file:
|
|
2000
|
+
return r ? /* @__PURE__ */ Y(N, {
|
|
2001
|
+
file: we(e),
|
|
2011
2002
|
kind: r,
|
|
2012
2003
|
cornerClass: "rounded-lg",
|
|
2013
2004
|
compact: !0,
|
|
2014
|
-
testIdPrefix:
|
|
2005
|
+
testIdPrefix: ri,
|
|
2015
2006
|
lazyMount: !0,
|
|
2016
2007
|
decorativeSnapshot: !0,
|
|
2017
2008
|
onBeforeOpen: () => c?.(e, "document")
|
|
2018
|
-
}, `${e.name}-${n}`) : /* @__PURE__ */ Y(
|
|
2009
|
+
}, `${e.name}-${n}`) : /* @__PURE__ */ Y(di, {
|
|
2019
2010
|
file: e,
|
|
2020
2011
|
onOpen: () => o(e, t.indexOf(e)),
|
|
2021
2012
|
onError: () => s(e)
|
|
2022
2013
|
}, `${e.name}-${n}`);
|
|
2023
2014
|
})
|
|
2024
|
-
}) : null, /* @__PURE__ */ Y(
|
|
2015
|
+
}) : null, /* @__PURE__ */ Y(ui, {
|
|
2025
2016
|
files: [...n, ...i],
|
|
2026
2017
|
align: a,
|
|
2027
2018
|
onFileDownloaded: l
|
|
2028
2019
|
})]
|
|
2029
2020
|
});
|
|
2030
|
-
},
|
|
2031
|
-
let r =
|
|
2021
|
+
}, ui = ({ files: e, align: t, onFileDownloaded: n }) => {
|
|
2022
|
+
let r = ct();
|
|
2032
2023
|
return e.length === 0 ? null : /* @__PURE__ */ Y("div", {
|
|
2033
2024
|
className: y("flex max-w-full flex-wrap gap-1.5", t === "end" ? "justify-end" : "justify-start"),
|
|
2034
|
-
children: e.map((e, t) => /* @__PURE__ */ Y(
|
|
2025
|
+
children: e.map((e, t) => /* @__PURE__ */ Y(fi, {
|
|
2035
2026
|
file: e,
|
|
2036
2027
|
onDownload: () => {
|
|
2037
2028
|
r(e.url, e.name), n?.(e);
|
|
2038
2029
|
}
|
|
2039
2030
|
}, `${e.name}-${t}`))
|
|
2040
2031
|
});
|
|
2041
|
-
},
|
|
2042
|
-
let r = p(), i =
|
|
2043
|
-
return
|
|
2032
|
+
}, di = ({ file: e, onOpen: t, onError: n }) => {
|
|
2033
|
+
let r = p(), i = O(e.thumbnailUrl ?? e.url);
|
|
2034
|
+
return le(i.status, n), /* @__PURE__ */ Y("button", {
|
|
2044
2035
|
type: "button",
|
|
2045
2036
|
onClick: t,
|
|
2046
2037
|
draggable: !1,
|
|
2047
2038
|
"aria-label": r.t("chat.openNamedDocument", { name: e.name }),
|
|
2048
2039
|
className: y("relative box-border h-16 w-16 shrink-0 overflow-hidden rounded-lg border border-solid border-f1-border-secondary bg-f1-background-secondary p-0 transition-opacity hover:opacity-90", b()),
|
|
2049
2040
|
"data-testid": "ai-chat-image-attachment",
|
|
2050
|
-
children: i.status === "ready" ? /* @__PURE__ */ Y(
|
|
2041
|
+
children: i.status === "ready" ? /* @__PURE__ */ Y(Ve, {
|
|
2051
2042
|
src: i.url,
|
|
2052
2043
|
alt: e.name,
|
|
2053
2044
|
draggable: !1,
|
|
@@ -2055,12 +2046,12 @@ var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
|
2055
2046
|
className: "h-full w-full object-cover"
|
|
2056
2047
|
}) : null
|
|
2057
2048
|
});
|
|
2058
|
-
},
|
|
2049
|
+
}, fi = ({ file: e, onDownload: t }) => {
|
|
2059
2050
|
let n = p();
|
|
2060
|
-
return /* @__PURE__ */ Y(
|
|
2051
|
+
return /* @__PURE__ */ Y(w, {
|
|
2061
2052
|
file: {
|
|
2062
2053
|
name: e.name,
|
|
2063
|
-
type:
|
|
2054
|
+
type: Ir(e)
|
|
2064
2055
|
},
|
|
2065
2056
|
size: "lg",
|
|
2066
2057
|
actions: [{
|
|
@@ -2069,18 +2060,18 @@ var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
|
2069
2060
|
onClick: t
|
|
2070
2061
|
}]
|
|
2071
2062
|
});
|
|
2072
|
-
},
|
|
2073
|
-
let r = p(), i = e.length === 1 ? e[0] : void 0, a =
|
|
2063
|
+
}, pi = ({ images: e, onOpen: t, onImageError: n }) => {
|
|
2064
|
+
let r = p(), i = e.length === 1 ? e[0] : void 0, a = O(i ? i.thumbnailUrl ?? i.url : void 0), o = We(i && a.status === "ready" ? a.url : void 0, i) ?? void 0, s = i ? be(o?.width, o?.height) : null;
|
|
2074
2065
|
return /* @__PURE__ */ Y("div", {
|
|
2075
2066
|
style: s ? { width: s.width } : void 0,
|
|
2076
|
-
className: y("grid grid-cols-2 overflow-hidden border border-solid border-f1-border-secondary", s ? "max-w-full" :
|
|
2067
|
+
className: y("grid grid-cols-2 overflow-hidden border border-solid border-f1-border-secondary", s ? "max-w-full" : Le, tt, ni),
|
|
2077
2068
|
"data-testid": "ai-chat-image-album",
|
|
2078
|
-
children:
|
|
2069
|
+
children: Ae(o ? [o] : e).map((i, a, o) => {
|
|
2079
2070
|
let s = e[i.index];
|
|
2080
2071
|
if (!s) return null;
|
|
2081
2072
|
let c = a === o.length - 1;
|
|
2082
|
-
return /* @__PURE__ */ Y(
|
|
2083
|
-
image:
|
|
2073
|
+
return /* @__PURE__ */ Y(ke, {
|
|
2074
|
+
image: rt(s),
|
|
2084
2075
|
aspectRatio: i.aspectRatio,
|
|
2085
2076
|
spanFull: i.span === 2,
|
|
2086
2077
|
inset: i.inset,
|
|
@@ -2093,40 +2084,40 @@ var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
|
2093
2084
|
eager: !1,
|
|
2094
2085
|
preventDrag: !0,
|
|
2095
2086
|
onImageError: () => n(s),
|
|
2096
|
-
testIdPrefix:
|
|
2087
|
+
testIdPrefix: ri,
|
|
2097
2088
|
overlay: i.hiddenCount > 0 ? /* @__PURE__ */ Y("span", {
|
|
2098
2089
|
"aria-hidden": !0,
|
|
2099
|
-
className: y("absolute inset-0 flex items-center justify-center text-2xl font-semibold text-f1-foreground-inverse",
|
|
2090
|
+
className: y("absolute inset-0 flex items-center justify-center text-2xl font-semibold text-f1-foreground-inverse", Ce),
|
|
2100
2091
|
"data-testid": "ai-chat-image-album-more",
|
|
2101
2092
|
children: `+${i.hiddenCount}`
|
|
2102
2093
|
}) : void 0
|
|
2103
2094
|
}, `${s.name}-${i.index}`);
|
|
2104
2095
|
})
|
|
2105
2096
|
});
|
|
2106
|
-
},
|
|
2107
|
-
function
|
|
2097
|
+
}, mi = m("F0AiFileAttachments", ii), hi = 2;
|
|
2098
|
+
function gi(e, t) {
|
|
2108
2099
|
if (!e.intersectsNode(t)) return null;
|
|
2109
2100
|
let n = document.createRange();
|
|
2110
2101
|
n.selectNodeContents(t);
|
|
2111
2102
|
let r = e.cloneRange();
|
|
2112
2103
|
r.compareBoundaryPoints(Range.START_TO_START, n) < 0 && r.setStart(n.startContainer, n.startOffset), r.compareBoundaryPoints(Range.END_TO_END, n) > 0 && r.setEnd(n.endContainer, n.endOffset);
|
|
2113
2104
|
let i = r.toString().trim();
|
|
2114
|
-
if (i.length <
|
|
2105
|
+
if (i.length < hi) return null;
|
|
2115
2106
|
let a = r.getBoundingClientRect();
|
|
2116
2107
|
return {
|
|
2117
2108
|
rect: a.width > 0 || a.height > 0 ? a : t.getBoundingClientRect(),
|
|
2118
2109
|
text: i
|
|
2119
2110
|
};
|
|
2120
2111
|
}
|
|
2121
|
-
function
|
|
2122
|
-
let [n, r] =
|
|
2123
|
-
return
|
|
2112
|
+
function _i({ containerRef: e, enabled: t = !0 }) {
|
|
2113
|
+
let [n, r] = q(null), i = U(() => r(null), []);
|
|
2114
|
+
return W(() => {
|
|
2124
2115
|
if (!t || typeof window > "u") return;
|
|
2125
2116
|
let n = e.current;
|
|
2126
2117
|
if (!n) return;
|
|
2127
2118
|
let i = () => {
|
|
2128
2119
|
let e = window.getSelection();
|
|
2129
|
-
!e || e.isCollapsed || e.rangeCount === 0 ? r(null) : r(
|
|
2120
|
+
!e || e.isCollapsed || e.rangeCount === 0 ? r(null) : r(gi(e.getRangeAt(0), n));
|
|
2130
2121
|
}, a = () => {
|
|
2131
2122
|
window.setTimeout(i, 0);
|
|
2132
2123
|
}, o = () => {
|
|
@@ -2143,26 +2134,26 @@ function gi({ containerRef: e, enabled: t = !0 }) {
|
|
|
2143
2134
|
}
|
|
2144
2135
|
//#endregion
|
|
2145
2136
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/ReplyPopover.tsx
|
|
2146
|
-
var
|
|
2147
|
-
function
|
|
2148
|
-
let n = p(), r =
|
|
2149
|
-
if (
|
|
2137
|
+
var vi = 8, yi = 8;
|
|
2138
|
+
function bi({ anchor: e, onReply: t }) {
|
|
2139
|
+
let n = p(), r = K(null), [i, a] = q(null);
|
|
2140
|
+
if (qt(() => {
|
|
2150
2141
|
if (!e) {
|
|
2151
2142
|
a(null);
|
|
2152
2143
|
return;
|
|
2153
2144
|
}
|
|
2154
2145
|
let t = r.current;
|
|
2155
2146
|
if (!t) return;
|
|
2156
|
-
let n = t.offsetWidth, i = t.offsetHeight, o = window.innerWidth, s = window.innerHeight, c = e.rect.top - i -
|
|
2157
|
-
c <
|
|
2158
|
-
let l = e.rect.left + e.rect.width / 2 - n / 2, u = Math.min(Math.max(l,
|
|
2147
|
+
let n = t.offsetWidth, i = t.offsetHeight, o = window.innerWidth, s = window.innerHeight, c = e.rect.top - i - vi;
|
|
2148
|
+
c < yi && (c = e.rect.bottom + vi), c = Math.min(Math.max(c, yi), s - i - yi);
|
|
2149
|
+
let l = e.rect.left + e.rect.width / 2 - n / 2, u = Math.min(Math.max(l, yi), o - n - yi);
|
|
2159
2150
|
a({
|
|
2160
2151
|
top: c,
|
|
2161
2152
|
left: u
|
|
2162
2153
|
});
|
|
2163
2154
|
}, [e]), typeof document > "u" || !e) return null;
|
|
2164
2155
|
let o = n.ai.reply;
|
|
2165
|
-
return
|
|
2156
|
+
return Jt(/* @__PURE__ */ Y("div", {
|
|
2166
2157
|
style: {
|
|
2167
2158
|
position: "fixed",
|
|
2168
2159
|
top: i?.top ?? -9999,
|
|
@@ -2175,7 +2166,7 @@ function yi({ anchor: e, onReply: t }) {
|
|
|
2175
2166
|
type: "button",
|
|
2176
2167
|
variant: "ghost",
|
|
2177
2168
|
label: o,
|
|
2178
|
-
icon:
|
|
2169
|
+
icon: xe,
|
|
2179
2170
|
onClick: () => {
|
|
2180
2171
|
t(e.text);
|
|
2181
2172
|
}
|
|
@@ -2184,22 +2175,22 @@ function yi({ anchor: e, onReply: t }) {
|
|
|
2184
2175
|
}
|
|
2185
2176
|
//#endregion
|
|
2186
2177
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/AssistantMessage.tsx
|
|
2187
|
-
var
|
|
2178
|
+
var xi = Vt(void 0), Si = () => Wt(xi), Ci = (e) => /* @__PURE__ */ Y(Be, {
|
|
2188
2179
|
content: e,
|
|
2189
2180
|
format: "markdown"
|
|
2190
|
-
}),
|
|
2191
|
-
let s = n?.content, c =
|
|
2181
|
+
}), wi = ({ isGenerating: e, isLoading: t, message: n, renderToolCall: r, onReplyQuote: i, onRendered: a, renderMarkdown: o }) => {
|
|
2182
|
+
let s = n?.content, c = Pr(s, "assistant") ?? "", l = G(() => Nr({ content: s }), [s]), u = (n && r?.(n)) ?? n?.generativeUI?.() ?? null, d = n?.toolCalls?.[0]?.id, f = !c && !u && l.length === 0, p = K(null), { anchor: m, clear: h } = _i({
|
|
2192
2183
|
containerRef: p,
|
|
2193
2184
|
enabled: !!(n?.id && c)
|
|
2194
2185
|
});
|
|
2195
|
-
return
|
|
2186
|
+
return W(() => {
|
|
2196
2187
|
n?.id && !t && !e && a?.(n);
|
|
2197
2188
|
}, [
|
|
2198
2189
|
n,
|
|
2199
2190
|
t,
|
|
2200
2191
|
e,
|
|
2201
2192
|
a
|
|
2202
|
-
]), !t && !e && f ? null : /* @__PURE__ */ Y(
|
|
2193
|
+
]), !t && !e && f ? null : /* @__PURE__ */ Y(xi.Provider, {
|
|
2203
2194
|
value: d,
|
|
2204
2195
|
children: /* @__PURE__ */ X("div", {
|
|
2205
2196
|
className: "relative isolate flex w-full flex-col items-start justify-center",
|
|
@@ -2207,11 +2198,11 @@ var bi = zt(void 0), xi = () => Ht(bi), Si = (e) => /* @__PURE__ */ Y(qe, {
|
|
|
2207
2198
|
n && c ? /* @__PURE__ */ Y("div", {
|
|
2208
2199
|
ref: p,
|
|
2209
2200
|
className: "w-full max-w-full [&>div]:flex [&>div]:flex-col [&>div]:gap-1",
|
|
2210
|
-
children: (o ??
|
|
2201
|
+
children: (o ?? Ci)(c)
|
|
2211
2202
|
}) : null,
|
|
2212
2203
|
l.length > 0 ? /* @__PURE__ */ Y("div", {
|
|
2213
2204
|
className: "mt-2 w-full max-w-[90%]",
|
|
2214
|
-
children: /* @__PURE__ */ Y(
|
|
2205
|
+
children: /* @__PURE__ */ Y(mi, {
|
|
2215
2206
|
files: l,
|
|
2216
2207
|
align: "start"
|
|
2217
2208
|
})
|
|
@@ -2220,7 +2211,7 @@ var bi = zt(void 0), xi = () => Ht(bi), Si = (e) => /* @__PURE__ */ Y(qe, {
|
|
|
2220
2211
|
className: "w-full",
|
|
2221
2212
|
children: u
|
|
2222
2213
|
}) : null,
|
|
2223
|
-
/* @__PURE__ */ Y(
|
|
2214
|
+
/* @__PURE__ */ Y(bi, {
|
|
2224
2215
|
anchor: m,
|
|
2225
2216
|
onReply: (e) => {
|
|
2226
2217
|
i?.(e), h(), window.getSelection()?.removeAllRanges();
|
|
@@ -2229,8 +2220,8 @@ var bi = zt(void 0), xi = () => Ht(bi), Si = (e) => /* @__PURE__ */ Y(qe, {
|
|
|
2229
2220
|
]
|
|
2230
2221
|
})
|
|
2231
2222
|
});
|
|
2232
|
-
},
|
|
2233
|
-
let [i, a] =
|
|
2223
|
+
}, Ti = ({ onClose: e, onSubmit: t, reactionType: n, message: r }) => {
|
|
2224
|
+
let [i, a] = q(""), o = p(), { title: s, label: c, placeholder: l } = n === "like" ? o.ai.feedbackModal.positive : o.ai.feedbackModal.negative, u = U(() => {
|
|
2234
2225
|
t(r, i);
|
|
2235
2226
|
}, [
|
|
2236
2227
|
i,
|
|
@@ -2239,14 +2230,14 @@ var bi = zt(void 0), xi = () => Ht(bi), Si = (e) => /* @__PURE__ */ Y(qe, {
|
|
|
2239
2230
|
]), d = () => {
|
|
2240
2231
|
e(r);
|
|
2241
2232
|
};
|
|
2242
|
-
return
|
|
2233
|
+
return W(() => {
|
|
2243
2234
|
let e = (e) => {
|
|
2244
2235
|
e.key === "Enter" && (e.preventDefault(), u());
|
|
2245
2236
|
};
|
|
2246
2237
|
return document.addEventListener("keydown", e), () => {
|
|
2247
2238
|
document.removeEventListener("keydown", e);
|
|
2248
2239
|
};
|
|
2249
|
-
}, [u]), /* @__PURE__ */ Y(
|
|
2240
|
+
}, [u]), /* @__PURE__ */ Y(je, {
|
|
2250
2241
|
position: "center",
|
|
2251
2242
|
isOpen: !0,
|
|
2252
2243
|
onClose: d,
|
|
@@ -2263,7 +2254,7 @@ var bi = zt(void 0), xi = () => Ht(bi), Si = (e) => /* @__PURE__ */ Y(qe, {
|
|
|
2263
2254
|
},
|
|
2264
2255
|
children: /* @__PURE__ */ Y("div", {
|
|
2265
2256
|
className: "flex flex-col gap-6",
|
|
2266
|
-
children: /* @__PURE__ */ Y(
|
|
2257
|
+
children: /* @__PURE__ */ Y(F, {
|
|
2267
2258
|
autoFocus: !0,
|
|
2268
2259
|
label: c,
|
|
2269
2260
|
placeholder: l,
|
|
@@ -2274,8 +2265,8 @@ var bi = zt(void 0), xi = () => Ht(bi), Si = (e) => /* @__PURE__ */ Y(qe, {
|
|
|
2274
2265
|
})
|
|
2275
2266
|
})
|
|
2276
2267
|
});
|
|
2277
|
-
},
|
|
2278
|
-
let [t, n] =
|
|
2268
|
+
}, Ei = Vt(null), Di = ({ children: e }) => {
|
|
2269
|
+
let [t, n] = q(null), r = t ? {
|
|
2279
2270
|
isOpen: !0,
|
|
2280
2271
|
currentReaction: t.action,
|
|
2281
2272
|
currentMessage: t.message,
|
|
@@ -2294,17 +2285,17 @@ var bi = zt(void 0), xi = () => Ht(bi), Si = (e) => /* @__PURE__ */ Y(qe, {
|
|
|
2294
2285
|
}),
|
|
2295
2286
|
close: () => n(null)
|
|
2296
2287
|
};
|
|
2297
|
-
return /* @__PURE__ */ Y(
|
|
2288
|
+
return /* @__PURE__ */ Y(Ei.Provider, {
|
|
2298
2289
|
value: r,
|
|
2299
2290
|
children: e
|
|
2300
2291
|
});
|
|
2301
|
-
},
|
|
2302
|
-
let e =
|
|
2292
|
+
}, Oi = () => {
|
|
2293
|
+
let e = Wt(Ei);
|
|
2303
2294
|
if (e === null) throw Error("useFeedbackModal must be used within a FeedbackModalProvider");
|
|
2304
2295
|
return e;
|
|
2305
2296
|
};
|
|
2306
|
-
function
|
|
2307
|
-
let t =
|
|
2297
|
+
function ki(e) {
|
|
2298
|
+
let t = Oi();
|
|
2308
2299
|
return {
|
|
2309
2300
|
modal: t,
|
|
2310
2301
|
handleSubmit: (n, r) => {
|
|
@@ -2323,12 +2314,12 @@ function Oi(e) {
|
|
|
2323
2314
|
}
|
|
2324
2315
|
//#endregion
|
|
2325
2316
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/feedback/TurnFeedback.tsx
|
|
2326
|
-
var
|
|
2327
|
-
let i = p(), { open: a } =
|
|
2317
|
+
var Ai = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
2318
|
+
let i = p(), { open: a } = Oi(), [o, s] = q(null);
|
|
2328
2319
|
return /* @__PURE__ */ X("div", {
|
|
2329
2320
|
className: "flex",
|
|
2330
2321
|
children: [
|
|
2331
|
-
/* @__PURE__ */ Y(
|
|
2322
|
+
/* @__PURE__ */ Y(qe, {
|
|
2332
2323
|
size: "md",
|
|
2333
2324
|
variant: "ghost",
|
|
2334
2325
|
valueToCopy: t,
|
|
@@ -2349,7 +2340,7 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2349
2340
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
2350
2341
|
children: /* @__PURE__ */ Y(u, {
|
|
2351
2342
|
size: "md",
|
|
2352
|
-
icon: o === "like" ?
|
|
2343
|
+
icon: o === "like" ? Ee : Qe,
|
|
2353
2344
|
color: "default"
|
|
2354
2345
|
})
|
|
2355
2346
|
})
|
|
@@ -2367,22 +2358,22 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2367
2358
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
2368
2359
|
children: /* @__PURE__ */ Y(u, {
|
|
2369
2360
|
size: "md",
|
|
2370
|
-
icon: o === "dislike" ?
|
|
2361
|
+
icon: o === "dislike" ? He : Ye,
|
|
2371
2362
|
color: "default"
|
|
2372
2363
|
})
|
|
2373
2364
|
})
|
|
2374
2365
|
})
|
|
2375
2366
|
]
|
|
2376
2367
|
});
|
|
2377
|
-
},
|
|
2378
|
-
let [l, d] =
|
|
2379
|
-
return /* @__PURE__ */ X(
|
|
2368
|
+
}, ji = ({ icon: e, title: n, children: r, open: i, defaultOpen: a = !1, onOpenChange: o, lockOpen: c = !1 }) => {
|
|
2369
|
+
let [l, d] = q(a), f = t(), p = i !== void 0, m = p ? i : l;
|
|
2370
|
+
return /* @__PURE__ */ X(pe, {
|
|
2380
2371
|
className: "mb-1 w-full",
|
|
2381
2372
|
open: m,
|
|
2382
2373
|
onOpenChange: (e) => {
|
|
2383
2374
|
c || (p || d(e), o?.(e));
|
|
2384
2375
|
},
|
|
2385
|
-
children: [/* @__PURE__ */ X(
|
|
2376
|
+
children: [/* @__PURE__ */ X(j, {
|
|
2386
2377
|
disabled: c,
|
|
2387
2378
|
className: y("gap-1", 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"),
|
|
2388
2379
|
children: [
|
|
@@ -2397,9 +2388,9 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2397
2388
|
className: "min-h-6 flex items-center",
|
|
2398
2389
|
children: /* @__PURE__ */ Y("span", { children: n })
|
|
2399
2390
|
}),
|
|
2400
|
-
c ? null : /* @__PURE__ */ Y(u, { icon:
|
|
2391
|
+
c ? null : /* @__PURE__ */ Y(u, { icon: wt })
|
|
2401
2392
|
]
|
|
2402
|
-
}), /* @__PURE__ */ Y(
|
|
2393
|
+
}), /* @__PURE__ */ Y(ge, {
|
|
2403
2394
|
forceMount: !0,
|
|
2404
2395
|
className: "data-[state=open]:mt-3",
|
|
2405
2396
|
children: /* @__PURE__ */ Y(s.div, {
|
|
@@ -2423,9 +2414,9 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2423
2414
|
})
|
|
2424
2415
|
})]
|
|
2425
2416
|
});
|
|
2426
|
-
},
|
|
2427
|
-
let t = p(), [n, r] =
|
|
2428
|
-
if (
|
|
2417
|
+
}, Mi = 1e3, Ni = 1e3, Pi = ({ startedAt: e }) => {
|
|
2418
|
+
let t = p(), [n, r] = q(() => e === null ? 0 : Date.now() - e);
|
|
2419
|
+
if (W(() => {
|
|
2429
2420
|
if (e === null) {
|
|
2430
2421
|
r(0);
|
|
2431
2422
|
return;
|
|
@@ -2433,9 +2424,9 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2433
2424
|
r(Date.now() - e);
|
|
2434
2425
|
let t = setInterval(() => {
|
|
2435
2426
|
r(Date.now() - e);
|
|
2436
|
-
},
|
|
2427
|
+
}, Ni);
|
|
2437
2428
|
return () => clearInterval(t);
|
|
2438
|
-
}, [e]), e === null || n <
|
|
2429
|
+
}, [e]), e === null || n < Mi) return null;
|
|
2439
2430
|
let i = Math.floor(n / 1e3), a = Math.floor(i / 60), o = i % 60, s = a > 0 ? t.t("ai.thinkingElapsedMinutes", {
|
|
2440
2431
|
minutes: a,
|
|
2441
2432
|
seconds: o
|
|
@@ -2448,14 +2439,14 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2448
2439
|
children: "·"
|
|
2449
2440
|
}), s]
|
|
2450
2441
|
});
|
|
2451
|
-
},
|
|
2452
|
-
let a = p(), [o, s] =
|
|
2453
|
-
|
|
2442
|
+
}, Fi = ({ titles: e, title: t, inProgress: n, isWriting: r, startedAt: i = null }) => {
|
|
2443
|
+
let a = p(), [o, s] = q(!!n), c = K(n);
|
|
2444
|
+
W(() => {
|
|
2454
2445
|
c.current && !n ? s(!1) : n && !o && s(!0), c.current = n;
|
|
2455
2446
|
}, [n, o]);
|
|
2456
2447
|
let l = n ? a.ai.thoughtsGroupTitle : t ?? a.ai.thoughtsGroupTitle, u = e.length - 1, d = (e) => !n || r ? "completed" : e === u ? "executing" : "completed";
|
|
2457
|
-
return /* @__PURE__ */ Y(
|
|
2458
|
-
icon:
|
|
2448
|
+
return /* @__PURE__ */ Y(ji, {
|
|
2449
|
+
icon: $e,
|
|
2459
2450
|
title: l,
|
|
2460
2451
|
open: o,
|
|
2461
2452
|
onOpenChange: s,
|
|
@@ -2464,10 +2455,10 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2464
2455
|
className: "flex flex-col gap-3 pb-4",
|
|
2465
2456
|
children: e.map((t, n) => /* @__PURE__ */ X("div", {
|
|
2466
2457
|
className: "relative",
|
|
2467
|
-
children: [/* @__PURE__ */ Y(
|
|
2458
|
+
children: [/* @__PURE__ */ Y(I, {
|
|
2468
2459
|
title: t,
|
|
2469
2460
|
status: d(n),
|
|
2470
|
-
suffix: d(n) === "executing" ? /* @__PURE__ */ Y(
|
|
2461
|
+
suffix: d(n) === "executing" ? /* @__PURE__ */ Y(Pi, { startedAt: i }) : void 0,
|
|
2471
2462
|
inGroup: !0
|
|
2472
2463
|
}), n < e.length - 1 ? /* @__PURE__ */ Y("div", {
|
|
2473
2464
|
"aria-hidden": !0,
|
|
@@ -2476,27 +2467,27 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2476
2467
|
}, n))
|
|
2477
2468
|
})
|
|
2478
2469
|
});
|
|
2479
|
-
},
|
|
2470
|
+
}, Ii = (e) => /* @__PURE__ */ Y(Be, {
|
|
2480
2471
|
content: e,
|
|
2481
2472
|
format: "markdown"
|
|
2482
|
-
}),
|
|
2473
|
+
}), Li = ({ text: e, renderMarkdown: t }) => /* @__PURE__ */ X("div", {
|
|
2483
2474
|
className: "flex max-w-[90%] items-start gap-2 self-end pb-1 pr-2 text-f1-foreground-tertiary",
|
|
2484
2475
|
children: [/* @__PURE__ */ Y("div", {
|
|
2485
2476
|
className: "flex h-5 items-center",
|
|
2486
|
-
children: /* @__PURE__ */ Y(u, { icon:
|
|
2477
|
+
children: /* @__PURE__ */ Y(u, { icon: at })
|
|
2487
2478
|
}), /* @__PURE__ */ Y("div", {
|
|
2488
2479
|
className: "min-w-0 whitespace-pre-wrap text-base leading-5 [&>div]:flex [&>div]:flex-col [&>div]:gap-1 [&_p]:m-0",
|
|
2489
|
-
children: (t ??
|
|
2480
|
+
children: (t ?? Ii)(e)
|
|
2490
2481
|
})]
|
|
2491
|
-
}),
|
|
2492
|
-
let i =
|
|
2493
|
-
|
|
2482
|
+
}), Ri = ({ message: e, onReplyQuote: t, autoScrollIntoView: n = !0, renderMarkdown: r }) => {
|
|
2483
|
+
let i = K(null), a = K(null);
|
|
2484
|
+
W(() => {
|
|
2494
2485
|
i.current && n && i.current.scrollIntoView({ behavior: "smooth" });
|
|
2495
2486
|
}, [n]);
|
|
2496
|
-
let o = e?.content, s = e?.rawData, c =
|
|
2487
|
+
let o = e?.content, s = e?.rawData, c = G(() => Nr({
|
|
2497
2488
|
content: o,
|
|
2498
2489
|
rawData: s
|
|
2499
|
-
}), [o, s]), l = (
|
|
2490
|
+
}), [o, s]), l = (Pr(o, "user") ?? "").trim(), u = e?.replyQuote ?? null, d = l.length > 0, { anchor: f, clear: p } = _i({
|
|
2500
2491
|
containerRef: a,
|
|
2501
2492
|
enabled: d
|
|
2502
2493
|
});
|
|
@@ -2504,13 +2495,13 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2504
2495
|
ref: i,
|
|
2505
2496
|
className: "my-4 flex w-full flex-col items-end gap-2 first:mt-0 last:mb-0",
|
|
2506
2497
|
children: [
|
|
2507
|
-
u ? /* @__PURE__ */ Y(
|
|
2498
|
+
u ? /* @__PURE__ */ Y(Li, {
|
|
2508
2499
|
text: u,
|
|
2509
2500
|
renderMarkdown: r
|
|
2510
2501
|
}) : null,
|
|
2511
2502
|
c.length > 0 ? /* @__PURE__ */ Y("div", {
|
|
2512
2503
|
className: "flex w-full max-w-[90%] justify-end",
|
|
2513
|
-
children: /* @__PURE__ */ Y(
|
|
2504
|
+
children: /* @__PURE__ */ Y(mi, {
|
|
2514
2505
|
files: c,
|
|
2515
2506
|
align: "end",
|
|
2516
2507
|
size: "compact"
|
|
@@ -2519,9 +2510,9 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2519
2510
|
d ? /* @__PURE__ */ Y("div", {
|
|
2520
2511
|
ref: a,
|
|
2521
2512
|
className: "w-fit max-w-[90%] self-end whitespace-pre-wrap rounded-xl bg-f1-background-tertiary px-4 py-3 [&>div]:flex [&>div]:flex-col [&>div]:gap-1",
|
|
2522
|
-
children: (r ??
|
|
2513
|
+
children: (r ?? Ii)(l)
|
|
2523
2514
|
}) : null,
|
|
2524
|
-
/* @__PURE__ */ Y(
|
|
2515
|
+
/* @__PURE__ */ Y(bi, {
|
|
2525
2516
|
anchor: f,
|
|
2526
2517
|
onReply: (e) => {
|
|
2527
2518
|
t?.(e), p(), window.getSelection()?.removeAllRanges();
|
|
@@ -2529,7 +2520,7 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2529
2520
|
})
|
|
2530
2521
|
]
|
|
2531
2522
|
});
|
|
2532
|
-
},
|
|
2523
|
+
}, zi = 35, Bi = 22, Vi = 400, Hi = 2500, Ui = 220, Wi = ({ phrase: e, typed: n, phraseIndex: r, onClick: i }) => {
|
|
2533
2524
|
let a = t(), o = !!i;
|
|
2534
2525
|
return /* @__PURE__ */ X("p", {
|
|
2535
2526
|
role: o ? "button" : void 0,
|
|
@@ -2549,21 +2540,21 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2549
2540
|
children: a ? e : e.slice(0, n)
|
|
2550
2541
|
})]
|
|
2551
2542
|
}, r);
|
|
2552
|
-
},
|
|
2553
|
-
let [s, c] =
|
|
2554
|
-
return
|
|
2543
|
+
}, Gi = ({ messages: e, caption: n, subtitle: r, cta: i, onClick: a, fullscreen: o = !1 }) => {
|
|
2544
|
+
let [s, c] = q(0), [l, u] = q(0), [d, f] = q("starting"), p = t(), m = e[s] ?? "", h = e.join("\0"), g = K(!0);
|
|
2545
|
+
return W(() => {
|
|
2555
2546
|
g.current ? g.current = !1 : (c(0), u(0), f("writing"));
|
|
2556
|
-
}, [h]),
|
|
2547
|
+
}, [h]), W(() => {
|
|
2557
2548
|
if (p) return;
|
|
2558
2549
|
let t;
|
|
2559
|
-
if (d === "starting") t = setTimeout(() => f("writing"),
|
|
2560
|
-
else if (d === "writing") l < m.length ? t = setTimeout(() => u((e) => e + 1),
|
|
2550
|
+
if (d === "starting") t = setTimeout(() => f("writing"), Vi);
|
|
2551
|
+
else if (d === "writing") l < m.length ? t = setTimeout(() => u((e) => e + 1), zi) : f("holding");
|
|
2561
2552
|
else if (d === "holding") {
|
|
2562
2553
|
if (e.length <= 1) return;
|
|
2563
|
-
t = setTimeout(() => f("erasing"),
|
|
2564
|
-
} else d === "erasing" && (t = l > 0 ? setTimeout(() => u((e) => e - 1),
|
|
2554
|
+
t = setTimeout(() => f("erasing"), Hi);
|
|
2555
|
+
} else d === "erasing" && (t = l > 0 ? setTimeout(() => u((e) => e - 1), Bi) : setTimeout(() => {
|
|
2565
2556
|
c((t) => (t + 1) % e.length), f("starting");
|
|
2566
|
-
},
|
|
2557
|
+
}, Ui));
|
|
2567
2558
|
return () => {
|
|
2568
2559
|
t && clearTimeout(t);
|
|
2569
2560
|
};
|
|
@@ -2590,7 +2581,7 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2590
2581
|
className: "animate-in fade-in-0 text-center text-2xl font-semibold leading-[28px] text-f1-foreground-secondary duration-500",
|
|
2591
2582
|
children: n
|
|
2592
2583
|
}) : null,
|
|
2593
|
-
/* @__PURE__ */ Y(
|
|
2584
|
+
/* @__PURE__ */ Y(Wi, {
|
|
2594
2585
|
phrase: m,
|
|
2595
2586
|
typed: l,
|
|
2596
2587
|
phraseIndex: s,
|
|
@@ -2603,21 +2594,21 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2603
2594
|
]
|
|
2604
2595
|
})
|
|
2605
2596
|
});
|
|
2606
|
-
},
|
|
2607
|
-
let [n, r] =
|
|
2608
|
-
return
|
|
2597
|
+
}, Ki = (e, t) => {
|
|
2598
|
+
let [n, r] = q(null);
|
|
2599
|
+
return W(() => {
|
|
2609
2600
|
r(e ? (e) => e ?? t ?? Date.now() : null);
|
|
2610
2601
|
}, [e, t]), n;
|
|
2611
2602
|
};
|
|
2612
2603
|
//#endregion
|
|
2613
2604
|
//#region src/addons/ai/ai/F0AiMessagesContainer/useMessageScroll.ts
|
|
2614
|
-
function
|
|
2615
|
-
let [o, s] =
|
|
2605
|
+
function qi({ viewportRef: e, contentRef: t, endRef: n, lastTurnRef: r, turnsCount: i, freezeTurnMinHeight: a = !1 }) {
|
|
2606
|
+
let [o, s] = q(0), [c, l] = q(!1), u = K(i), d = K(a);
|
|
2616
2607
|
d.current = a;
|
|
2617
|
-
let f =
|
|
2608
|
+
let f = U((e = "smooth") => {
|
|
2618
2609
|
n.current?.scrollIntoView({ behavior: e });
|
|
2619
2610
|
}, [n]);
|
|
2620
|
-
|
|
2611
|
+
W(() => {
|
|
2621
2612
|
let n = e.current, r = t.current;
|
|
2622
2613
|
if (!n || !r) return;
|
|
2623
2614
|
let i = new ResizeObserver(() => {
|
|
@@ -2627,16 +2618,16 @@ function Ki({ viewportRef: e, contentRef: t, endRef: n, lastTurnRef: r, turnsCou
|
|
|
2627
2618
|
});
|
|
2628
2619
|
return i.observe(n), i.observe(r), () => i.disconnect();
|
|
2629
2620
|
}, [e, t]);
|
|
2630
|
-
let p =
|
|
2621
|
+
let p = U(() => {
|
|
2631
2622
|
let t = e.current;
|
|
2632
2623
|
if (!t) return;
|
|
2633
2624
|
let { scrollTop: n, scrollHeight: r, clientHeight: i } = t, a = r - n - i;
|
|
2634
2625
|
l(a > i);
|
|
2635
2626
|
}, [e]);
|
|
2636
|
-
return
|
|
2627
|
+
return W(() => {
|
|
2637
2628
|
let t = e.current;
|
|
2638
2629
|
if (t) return t.addEventListener("scroll", p, { passive: !0 }), () => t.removeEventListener("scroll", p);
|
|
2639
|
-
}, [p, e]),
|
|
2630
|
+
}, [p, e]), W(() => {
|
|
2640
2631
|
i > u.current && requestAnimationFrame(() => {
|
|
2641
2632
|
requestAnimationFrame(() => {
|
|
2642
2633
|
let t = e.current, n = r.current;
|
|
@@ -2660,28 +2651,28 @@ function Ki({ viewportRef: e, contentRef: t, endRef: n, lastTurnRef: r, turnsCou
|
|
|
2660
2651
|
}
|
|
2661
2652
|
//#endregion
|
|
2662
2653
|
//#region src/addons/ai/ai/F0AiMessagesContainer/F0AiMessagesContainer.tsx
|
|
2663
|
-
var
|
|
2654
|
+
var Ji = {
|
|
2664
2655
|
threadId: "",
|
|
2665
2656
|
onThumbsUp: () => {},
|
|
2666
2657
|
onThumbsDown: () => {}
|
|
2667
|
-
},
|
|
2668
|
-
let t =
|
|
2669
|
-
return e.filePreviews || !t.provided ? /* @__PURE__ */ Y(
|
|
2658
|
+
}, Yi = (e) => {
|
|
2659
|
+
let t = Ue(), n = /* @__PURE__ */ Y(Di, { children: /* @__PURE__ */ Y(Xi, { ...e }) });
|
|
2660
|
+
return e.filePreviews || !t.provided ? /* @__PURE__ */ Y(et, {
|
|
2670
2661
|
filePreviews: e.filePreviews,
|
|
2671
2662
|
children: n
|
|
2672
2663
|
}) : n;
|
|
2673
|
-
},
|
|
2674
|
-
let { modal: D, handleSubmit: O, handleClose: ee } =
|
|
2664
|
+
}, Xi = ({ turns: e, isLoadingThread: t = !1, interrupt: r, initialMessage: i, initialMessageCaption: a, initialMessageSubtitle: o, initialMessageCta: c, onWelcomeClick: l, renderToolCall: u, onReplyQuote: d, onAssistantMessageRendered: f, autoScrollUserIntoView: m = !0, renderMarkdown: h, feedback: g, freezeLayout: v = !1, noShadows: b = !1, fullscreen: x = !1, children: S, AssistantMessage: C, UserMessage: w, onRegenerate: T, onCopy: E }) => {
|
|
2665
|
+
let { modal: D, handleSubmit: O, handleClose: ee } = ki(g ?? Ji), k = p(), A = C ?? wi, j = w ?? Ri, M = G(() => {
|
|
2675
2666
|
let e = i ?? k.ai.defaultInitialMessage;
|
|
2676
2667
|
return (Array.isArray(e) ? e : [e]).filter((e) => typeof e == "string" && e.length > 0);
|
|
2677
|
-
}, [i, k.ai.defaultInitialMessage]), N = !t && e.length === 0 && M.length > 0, P =
|
|
2668
|
+
}, [i, k.ai.defaultInitialMessage]), N = !t && e.length === 0 && M.length > 0, P = K(null), F = K(null), te = K(null), ne = K(null), re = K(null), { showScrollBtn: ie, turnMinHeight: L, scrollToBottom: ae } = qi({
|
|
2678
2669
|
viewportRef: P,
|
|
2679
2670
|
contentRef: F,
|
|
2680
|
-
endRef:
|
|
2681
|
-
lastTurnRef:
|
|
2671
|
+
endRef: te,
|
|
2672
|
+
lastTurnRef: re,
|
|
2682
2673
|
turnsCount: e.length,
|
|
2683
2674
|
freezeTurnMinHeight: v
|
|
2684
|
-
}),
|
|
2675
|
+
}), R = e[e.length - 1], z = Ki(!(!R || R.endIndicator !== "thinking" && !R.thinking?.inProgress), R?.thinking?.startedAt), oe = (t, n) => {
|
|
2685
2676
|
let r = n === e.length - 1, i = {
|
|
2686
2677
|
renderToolCall: u,
|
|
2687
2678
|
onReplyQuote: d,
|
|
@@ -2718,39 +2709,39 @@ var qi = {
|
|
|
2718
2709
|
return /* @__PURE__ */ Y(A, {
|
|
2719
2710
|
...c,
|
|
2720
2711
|
isGenerating: t.isInProgress && o,
|
|
2721
|
-
isLoading: t.isInProgress && o && !
|
|
2712
|
+
isLoading: t.isInProgress && o && !Zi(e)
|
|
2722
2713
|
}, `${n}-a-${a}`);
|
|
2723
2714
|
};
|
|
2724
2715
|
return /* @__PURE__ */ X("div", {
|
|
2725
|
-
ref: r ?
|
|
2716
|
+
ref: r ? re : void 0,
|
|
2726
2717
|
className: y("flex flex-col items-start justify-start gap-2 px-1", r && "pb-5"),
|
|
2727
2718
|
style: { minHeight: r && L || void 0 },
|
|
2728
2719
|
children: [
|
|
2729
2720
|
t.userMessages.map((e, t) => a(e, t)),
|
|
2730
|
-
t.thinking && t.thinking.titles.length > 0 ? /* @__PURE__ */ Y(
|
|
2721
|
+
t.thinking && t.thinking.titles.length > 0 ? /* @__PURE__ */ Y(Fi, {
|
|
2731
2722
|
titles: t.thinking.titles,
|
|
2732
2723
|
title: k.ai.thoughtsGroupTitle,
|
|
2733
2724
|
inProgress: t.thinking.inProgress,
|
|
2734
2725
|
isWriting: t.thinking.isWriting,
|
|
2735
|
-
startedAt: r ?
|
|
2726
|
+
startedAt: r ? z : null
|
|
2736
2727
|
}) : null,
|
|
2737
2728
|
t.assistantMessages.map((e, t) => o(e, t)),
|
|
2738
|
-
t.endIndicator === "thinking" ? /* @__PURE__ */ Y(
|
|
2729
|
+
t.endIndicator === "thinking" ? /* @__PURE__ */ Y(I, {
|
|
2739
2730
|
title: k.ai.thinking,
|
|
2740
2731
|
status: "executing",
|
|
2741
|
-
suffix: /* @__PURE__ */ Y(
|
|
2732
|
+
suffix: /* @__PURE__ */ Y(Pi, { startedAt: z })
|
|
2742
2733
|
}) : null,
|
|
2743
|
-
t.endIndicator === "activity" ? /* @__PURE__ */ Y(
|
|
2744
|
-
t.feedback ? /* @__PURE__ */ Y(
|
|
2734
|
+
t.endIndicator === "activity" ? /* @__PURE__ */ Y(I, { status: "writing" }) : null,
|
|
2735
|
+
t.feedback ? /* @__PURE__ */ Y(Ai, {
|
|
2745
2736
|
content: t.feedback.content,
|
|
2746
2737
|
targetMessage: t.feedback.targetMessage,
|
|
2747
2738
|
onCopy: E
|
|
2748
2739
|
}) : null,
|
|
2749
|
-
r ? /* @__PURE__ */ Y(
|
|
2740
|
+
r ? /* @__PURE__ */ Y(ti, {}) : null
|
|
2750
2741
|
]
|
|
2751
2742
|
}, `turn-${n}`);
|
|
2752
2743
|
};
|
|
2753
|
-
return /* @__PURE__ */ X(
|
|
2744
|
+
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X("div", {
|
|
2754
2745
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
2755
2746
|
children: [/* @__PURE__ */ Y("div", {
|
|
2756
2747
|
ref: P,
|
|
@@ -2762,8 +2753,8 @@ var qi = {
|
|
|
2762
2753
|
/* @__PURE__ */ X("div", {
|
|
2763
2754
|
className: y(N ? "flex flex-1" : "flex flex-col gap-6", "w-full max-w-content"),
|
|
2764
2755
|
children: [
|
|
2765
|
-
t ? /* @__PURE__ */ Y(
|
|
2766
|
-
N ? /* @__PURE__ */ Y(
|
|
2756
|
+
t ? /* @__PURE__ */ Y(Qi, {}) : null,
|
|
2757
|
+
N ? /* @__PURE__ */ Y(Gi, {
|
|
2767
2758
|
messages: M,
|
|
2768
2759
|
caption: a,
|
|
2769
2760
|
subtitle: o,
|
|
@@ -2771,21 +2762,21 @@ var qi = {
|
|
|
2771
2762
|
onClick: l,
|
|
2772
2763
|
fullscreen: x
|
|
2773
2764
|
}) : null,
|
|
2774
|
-
t ? null : e.map((e, t) =>
|
|
2765
|
+
t ? null : e.map((e, t) => oe(e, t)),
|
|
2775
2766
|
r
|
|
2776
2767
|
]
|
|
2777
2768
|
}),
|
|
2778
2769
|
/* @__PURE__ */ Y("div", {
|
|
2779
|
-
ref:
|
|
2770
|
+
ref: ne,
|
|
2780
2771
|
className: "h-px shrink-0",
|
|
2781
2772
|
"aria-hidden": !0
|
|
2782
2773
|
}),
|
|
2783
2774
|
/* @__PURE__ */ Y("footer", {
|
|
2784
2775
|
className: "copilotKitMessagesFooter",
|
|
2785
|
-
ref:
|
|
2776
|
+
ref: te,
|
|
2786
2777
|
children: S
|
|
2787
2778
|
}),
|
|
2788
|
-
/* @__PURE__ */ Y(n, { children:
|
|
2779
|
+
/* @__PURE__ */ Y(n, { children: ie ? /* @__PURE__ */ Y(s.div, {
|
|
2789
2780
|
className: "sticky bottom-[calc(0.5rem+var(--f0-ai-composer-overlap,0px))] z-10 flex justify-center",
|
|
2790
2781
|
initial: {
|
|
2791
2782
|
opacity: 0,
|
|
@@ -2801,23 +2792,23 @@ var qi = {
|
|
|
2801
2792
|
},
|
|
2802
2793
|
transition: { duration: .2 },
|
|
2803
2794
|
children: /* @__PURE__ */ Y(_, {
|
|
2804
|
-
onClick: () =>
|
|
2795
|
+
onClick: () => ae(),
|
|
2805
2796
|
label: k.ai.scrollToBottom,
|
|
2806
2797
|
variant: "neutral",
|
|
2807
|
-
icon:
|
|
2798
|
+
icon: Dt,
|
|
2808
2799
|
hideLabel: !0
|
|
2809
2800
|
})
|
|
2810
2801
|
}) : null })
|
|
2811
2802
|
]
|
|
2812
2803
|
})
|
|
2813
|
-
}), !b && !N ? /* @__PURE__ */ Y(
|
|
2814
|
-
}), D.isOpen ? /* @__PURE__ */ Y(
|
|
2804
|
+
}), !b && !N ? /* @__PURE__ */ Y(Je, { position: "top" }, "shadow-top") : null]
|
|
2805
|
+
}), D.isOpen ? /* @__PURE__ */ Y(Ti, {
|
|
2815
2806
|
onSubmit: O,
|
|
2816
2807
|
onClose: ee,
|
|
2817
2808
|
reactionType: D.currentReaction,
|
|
2818
2809
|
message: D.currentMessage
|
|
2819
2810
|
}) : null] });
|
|
2820
|
-
},
|
|
2811
|
+
}, Zi = (e) => !!Pr(e.content) || Nr(e).length > 0, Qi = () => /* @__PURE__ */ Y("div", {
|
|
2821
2812
|
className: "flex h-full w-full max-w-content flex-col gap-6",
|
|
2822
2813
|
children: /* @__PURE__ */ X("div", {
|
|
2823
2814
|
className: "flex flex-col gap-2",
|
|
@@ -2831,33 +2822,33 @@ var qi = {
|
|
|
2831
2822
|
/* @__PURE__ */ Y(d, { className: "h-5 w-4/5 rounded-md" })
|
|
2832
2823
|
]
|
|
2833
2824
|
})
|
|
2834
|
-
}),
|
|
2835
|
-
function
|
|
2836
|
-
return /* @__PURE__ */ Y(
|
|
2825
|
+
}), $i = { ai: ft.ai }, ea = Vt(null);
|
|
2826
|
+
function ta({ children: e, translations: t }) {
|
|
2827
|
+
return /* @__PURE__ */ Y(ea.Provider, {
|
|
2837
2828
|
value: t,
|
|
2838
2829
|
children: e
|
|
2839
2830
|
});
|
|
2840
2831
|
}
|
|
2841
|
-
function
|
|
2842
|
-
let e =
|
|
2832
|
+
function na() {
|
|
2833
|
+
let e = Wt(ea);
|
|
2843
2834
|
if (e === null) throw Error("useAiChatTranslations must be used within an AiChatTranslationsProvider");
|
|
2844
2835
|
return e;
|
|
2845
2836
|
}
|
|
2846
2837
|
//#endregion
|
|
2847
2838
|
//#region src/addons/ai/ai/F0AiChat/providers/useCanvasEntities.ts
|
|
2848
|
-
function
|
|
2839
|
+
function ra() {
|
|
2849
2840
|
let { canvasEntities: e } = V();
|
|
2850
2841
|
return e;
|
|
2851
2842
|
}
|
|
2852
2843
|
//#endregion
|
|
2853
2844
|
//#region src/addons/ai/ai/canvas/registry.ts
|
|
2854
|
-
function
|
|
2855
|
-
let t =
|
|
2845
|
+
function ia(e) {
|
|
2846
|
+
let t = ra();
|
|
2856
2847
|
if (e && t) return t[e];
|
|
2857
2848
|
}
|
|
2858
2849
|
//#endregion
|
|
2859
2850
|
//#region src/blocks/ai/F0ClarifyingPanel/components/ConfirmFooter.tsx
|
|
2860
|
-
var
|
|
2851
|
+
var aa = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: i, showSkip: a }) => {
|
|
2861
2852
|
let s = p();
|
|
2862
2853
|
return /* @__PURE__ */ X("div", {
|
|
2863
2854
|
className: "flex items-center justify-end gap-3 p-3",
|
|
@@ -2878,19 +2869,19 @@ var ia = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: i,
|
|
|
2878
2869
|
onClick: r
|
|
2879
2870
|
})]
|
|
2880
2871
|
});
|
|
2881
|
-
},
|
|
2872
|
+
}, oa = ({ isSelected: e }) => /* @__PURE__ */ Y("div", {
|
|
2882
2873
|
className: y("flex h-5 w-5 shrink-0 items-center justify-center rounded-full transition-colors", e ? "bg-f1-background-selected-bold" : "border-2 border-solid border-f1-border bg-f1-background"),
|
|
2883
2874
|
children: e ? /* @__PURE__ */ Y("div", { className: "h-2 w-2 rounded-full bg-f1-background" }) : null
|
|
2884
|
-
}),
|
|
2885
|
-
let f = p().ai.clarifyingQuestion.typeYourAnswer, m =
|
|
2886
|
-
|
|
2875
|
+
}), sa = 132, ca = ({ mode: e, hasSelection: t, hasCustomText: n, customAnswerText: i, isCustomAnswerActive: a, canProceed: o, inputRef: s, onActivate: c, onChangeText: l, onToggleActive: u, onConfirm: d }) => {
|
|
2876
|
+
let f = p().ai.clarifyingQuestion.typeYourAnswer, m = K(null), h = r(m, s);
|
|
2877
|
+
qt(() => {
|
|
2887
2878
|
let e = m.current;
|
|
2888
2879
|
if (!e) return;
|
|
2889
2880
|
e.style.height = "auto";
|
|
2890
|
-
let t = Math.min(e.scrollHeight,
|
|
2891
|
-
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight >
|
|
2881
|
+
let t = Math.min(e.scrollHeight, sa);
|
|
2882
|
+
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > sa ? "auto" : "hidden";
|
|
2892
2883
|
}, [i]);
|
|
2893
|
-
let g = e === "single" ? /* @__PURE__ */ Y(
|
|
2884
|
+
let g = e === "single" ? /* @__PURE__ */ Y(oa, { isSelected: n && !t }) : /* @__PURE__ */ Y(Nt, {
|
|
2894
2885
|
checked: a,
|
|
2895
2886
|
onCheckedChange: () => u(!a),
|
|
2896
2887
|
title: f,
|
|
@@ -2912,7 +2903,7 @@ var ia = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: i,
|
|
|
2912
2903
|
className: "min-w-0 flex-1 resize-none bg-transparent text-base text-f1-foreground outline-none placeholder:text-f1-foreground-tertiary"
|
|
2913
2904
|
})]
|
|
2914
2905
|
});
|
|
2915
|
-
},
|
|
2906
|
+
}, la = H(({ option: e, isSelected: t, mode: n, isTabStop: r, onToggle: i, onKeyNavigate: a }, o) => n === "single" ? /* @__PURE__ */ X("div", {
|
|
2916
2907
|
ref: o,
|
|
2917
2908
|
role: "radio",
|
|
2918
2909
|
"aria-checked": t,
|
|
@@ -2922,14 +2913,14 @@ var ia = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: i,
|
|
|
2922
2913
|
onKeyDown: (t) => {
|
|
2923
2914
|
t.key === " " || t.key === "Enter" ? (t.preventDefault(), i(e.id)) : a?.(t);
|
|
2924
2915
|
},
|
|
2925
|
-
children: [/* @__PURE__ */ Y(
|
|
2916
|
+
children: [/* @__PURE__ */ Y(oa, { isSelected: t }), /* @__PURE__ */ Y("span", {
|
|
2926
2917
|
className: "text-base font-normal text-f1-foreground",
|
|
2927
2918
|
children: e.label
|
|
2928
2919
|
})]
|
|
2929
2920
|
}) : /* @__PURE__ */ X("div", {
|
|
2930
2921
|
ref: o,
|
|
2931
2922
|
className: y("flex cursor-pointer items-center rounded-md pl-2 transition-[background-color,transform] hover:bg-f1-background-secondary active:scale-[0.99]"),
|
|
2932
|
-
children: [/* @__PURE__ */ Y(
|
|
2923
|
+
children: [/* @__PURE__ */ Y(Nt, {
|
|
2933
2924
|
checked: t,
|
|
2934
2925
|
onCheckedChange: () => i(e.id),
|
|
2935
2926
|
title: e.label,
|
|
@@ -2940,21 +2931,21 @@ var ia = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: i,
|
|
|
2940
2931
|
children: e.label
|
|
2941
2932
|
})]
|
|
2942
2933
|
}));
|
|
2943
|
-
|
|
2934
|
+
la.displayName = "OptionRow";
|
|
2944
2935
|
//#endregion
|
|
2945
2936
|
//#region src/blocks/ai/F0ClarifyingPanel/components/OptionsList.tsx
|
|
2946
|
-
var
|
|
2937
|
+
var ua = [
|
|
2947
2938
|
.23,
|
|
2948
2939
|
1,
|
|
2949
2940
|
.32,
|
|
2950
2941
|
1
|
|
2951
|
-
],
|
|
2942
|
+
], da = .2, fa = .03, pa = 4, ma = ({ mode: e, question: n, options: r, selectedOptionIds: i, allowCustomAnswer: a, hasSelection: o, hasCustomText: c, customAnswerText: l, isCustomAnswerActive: u, canProceed: d, customInputRef: f, autoFocus: p, onToggleOption: m, onActivateCustom: h, onChangeCustomText: g, onToggleCustomActive: _, onConfirm: v }) => {
|
|
2952
2943
|
let y = t(), b = (() => {
|
|
2953
2944
|
if (e !== "single") return 0;
|
|
2954
2945
|
let t = r.findIndex((e) => i.includes(e.id));
|
|
2955
2946
|
return t >= 0 ? t : 0;
|
|
2956
|
-
})(), [x, S] =
|
|
2957
|
-
|
|
2947
|
+
})(), [x, S] = q(b), C = K([]);
|
|
2948
|
+
W(() => {
|
|
2958
2949
|
p && e === "single" && C.current[x]?.focus();
|
|
2959
2950
|
}, []);
|
|
2960
2951
|
let w = (t) => {
|
|
@@ -2983,16 +2974,16 @@ var la = [
|
|
|
2983
2974
|
}, T = (e) => ({
|
|
2984
2975
|
initial: !y && {
|
|
2985
2976
|
opacity: 0,
|
|
2986
|
-
y:
|
|
2977
|
+
y: pa
|
|
2987
2978
|
},
|
|
2988
2979
|
animate: {
|
|
2989
2980
|
opacity: 1,
|
|
2990
2981
|
y: 0
|
|
2991
2982
|
},
|
|
2992
2983
|
transition: {
|
|
2993
|
-
duration: y ? 0 :
|
|
2994
|
-
ease:
|
|
2995
|
-
delay: y ? 0 : e *
|
|
2984
|
+
duration: y ? 0 : da,
|
|
2985
|
+
ease: ua,
|
|
2986
|
+
delay: y ? 0 : e * fa
|
|
2996
2987
|
}
|
|
2997
2988
|
});
|
|
2998
2989
|
return /* @__PURE__ */ X("div", {
|
|
@@ -3001,7 +2992,7 @@ var la = [
|
|
|
3001
2992
|
"aria-label": n,
|
|
3002
2993
|
children: [r.map((t, n) => /* @__PURE__ */ Y(s.div, {
|
|
3003
2994
|
...T(n),
|
|
3004
|
-
children: /* @__PURE__ */ Y(
|
|
2995
|
+
children: /* @__PURE__ */ Y(la, {
|
|
3005
2996
|
ref: (e) => {
|
|
3006
2997
|
C.current[n] = e;
|
|
3007
2998
|
},
|
|
@@ -3014,7 +3005,7 @@ var la = [
|
|
|
3014
3005
|
})
|
|
3015
3006
|
}, t.id)), a ? /* @__PURE__ */ Y(s.div, {
|
|
3016
3007
|
...T(r.length),
|
|
3017
|
-
children: /* @__PURE__ */ Y(
|
|
3008
|
+
children: /* @__PURE__ */ Y(ca, {
|
|
3018
3009
|
mode: e,
|
|
3019
3010
|
hasSelection: o,
|
|
3020
3011
|
hasCustomText: c,
|
|
@@ -3029,7 +3020,7 @@ var la = [
|
|
|
3029
3020
|
})
|
|
3030
3021
|
}) : null]
|
|
3031
3022
|
});
|
|
3032
|
-
},
|
|
3023
|
+
}, ha = ({ question: e, stepLabel: t, isFirstStep: n, isFinalStep: r, canProceed: i, onBack: a, onNext: s, onCancel: c }) => {
|
|
3033
3024
|
let l = p();
|
|
3034
3025
|
return /* @__PURE__ */ X("div", {
|
|
3035
3026
|
className: "flex items-start gap-0.5 pl-4 pr-3",
|
|
@@ -3050,7 +3041,7 @@ var la = [
|
|
|
3050
3041
|
disabled: n,
|
|
3051
3042
|
label: l.ai.clarifyingQuestion.back,
|
|
3052
3043
|
hideLabel: !0,
|
|
3053
|
-
icon:
|
|
3044
|
+
icon: kt
|
|
3054
3045
|
}),
|
|
3055
3046
|
/* @__PURE__ */ Y("span", {
|
|
3056
3047
|
className: "translate-y-px text-sm font-semibold text-f1-foreground-tertiary",
|
|
@@ -3064,7 +3055,7 @@ var la = [
|
|
|
3064
3055
|
disabled: r || !i,
|
|
3065
3056
|
label: l.ai.clarifyingQuestion.next,
|
|
3066
3057
|
hideLabel: !0,
|
|
3067
|
-
icon:
|
|
3058
|
+
icon: wt
|
|
3068
3059
|
})
|
|
3069
3060
|
]
|
|
3070
3061
|
}) : null,
|
|
@@ -3079,30 +3070,30 @@ var la = [
|
|
|
3079
3070
|
})
|
|
3080
3071
|
]
|
|
3081
3072
|
});
|
|
3082
|
-
},
|
|
3073
|
+
}, ga = "easeOut", _a = .15, va = .1, ya = ({ clarifyingQuestion: e, isSubmitDisabled: t }) => /* @__PURE__ */ Y(ba, {
|
|
3083
3074
|
clarifyingQuestion: e,
|
|
3084
3075
|
isSubmitDisabled: t
|
|
3085
|
-
}),
|
|
3086
|
-
let i = p(), a = t(), { currentStep: o, currentStepIndex: c, totalSteps: l, toggleOption: u, confirm: d, skip: f, cancel: m, back: h, setCustomAnswerText: g, setCustomAnswerActive: _, activateCustomAnswer: v } = e, { question: y, options: b, selectedOptionIds: x, selectionMode: S, optional: C, allowCustomAnswer: w, customAnswerText: T, isCustomAnswerActive: E } = o, D =
|
|
3076
|
+
}), ba = ({ clarifyingQuestion: e, isSubmitDisabled: r }) => {
|
|
3077
|
+
let i = p(), a = t(), { currentStep: o, currentStepIndex: c, totalSteps: l, toggleOption: u, confirm: d, skip: f, cancel: m, back: h, setCustomAnswerText: g, setCustomAnswerActive: _, activateCustomAnswer: v } = e, { question: y, options: b, selectedOptionIds: x, selectionMode: S, optional: C, allowCustomAnswer: w, customAnswerText: T, isCustomAnswerActive: E } = o, D = K(null), O = S ?? "single", ee = l > 1, k = c === 0, A = c === l - 1, j = ee ? i.t("ai.clarifyingQuestion.stepOf", {
|
|
3087
3078
|
current: String(c + 1),
|
|
3088
3079
|
total: String(l)
|
|
3089
|
-
}) : void 0, M = x.length > 0, N = (T ?? "").trim().length > 0, P = M || E && N || C === !0, F = r === !0 && A,
|
|
3080
|
+
}) : void 0, M = x.length > 0, N = (T ?? "").trim().length > 0, P = M || E && N || C === !0, F = r === !0 && A, te = () => {
|
|
3090
3081
|
F || d();
|
|
3091
|
-
},
|
|
3082
|
+
}, ne = () => {
|
|
3092
3083
|
F || f();
|
|
3093
|
-
},
|
|
3084
|
+
}, re = (e) => {
|
|
3094
3085
|
let t = O === "single" && x.includes(e);
|
|
3095
3086
|
u(e), O === "single" && !A && !t && Promise.resolve().then(d);
|
|
3096
|
-
},
|
|
3087
|
+
}, I = A ? i.ai.clarifyingQuestion.submit : i.ai.clarifyingQuestion.next, ie = C === !0 && !M && !(E && N), L = () => {
|
|
3097
3088
|
v(), requestAnimationFrame(() => {
|
|
3098
3089
|
D.current?.focus();
|
|
3099
3090
|
});
|
|
3100
|
-
},
|
|
3091
|
+
}, ae = (e) => {
|
|
3101
3092
|
e.key === "Escape" && (e.preventDefault(), m());
|
|
3102
|
-
},
|
|
3093
|
+
}, R = a ? 0 : _a, z = a ? 0 : va;
|
|
3103
3094
|
return /* @__PURE__ */ X("div", {
|
|
3104
3095
|
className: "flex flex-col",
|
|
3105
|
-
onKeyDown:
|
|
3096
|
+
onKeyDown: ae,
|
|
3106
3097
|
children: [/* @__PURE__ */ Y("div", {
|
|
3107
3098
|
className: "flex flex-col gap-3 pt-3",
|
|
3108
3099
|
children: /* @__PURE__ */ Y(n, {
|
|
@@ -3114,18 +3105,18 @@ var la = [
|
|
|
3114
3105
|
animate: {
|
|
3115
3106
|
opacity: 1,
|
|
3116
3107
|
transition: {
|
|
3117
|
-
duration:
|
|
3118
|
-
ease:
|
|
3108
|
+
duration: R,
|
|
3109
|
+
ease: ga
|
|
3119
3110
|
}
|
|
3120
3111
|
},
|
|
3121
3112
|
exit: {
|
|
3122
3113
|
opacity: 0,
|
|
3123
3114
|
transition: {
|
|
3124
|
-
duration:
|
|
3125
|
-
ease:
|
|
3115
|
+
duration: z,
|
|
3116
|
+
ease: ga
|
|
3126
3117
|
}
|
|
3127
3118
|
},
|
|
3128
|
-
children: [/* @__PURE__ */ Y(
|
|
3119
|
+
children: [/* @__PURE__ */ Y(ha, {
|
|
3129
3120
|
question: y,
|
|
3130
3121
|
stepLabel: j,
|
|
3131
3122
|
isFirstStep: k,
|
|
@@ -3134,7 +3125,7 @@ var la = [
|
|
|
3134
3125
|
onBack: h,
|
|
3135
3126
|
onNext: d,
|
|
3136
3127
|
onCancel: m
|
|
3137
|
-
}), /* @__PURE__ */ Y(
|
|
3128
|
+
}), /* @__PURE__ */ Y(ma, {
|
|
3138
3129
|
mode: O,
|
|
3139
3130
|
question: y,
|
|
3140
3131
|
options: b,
|
|
@@ -3146,27 +3137,27 @@ var la = [
|
|
|
3146
3137
|
isCustomAnswerActive: E,
|
|
3147
3138
|
canProceed: P,
|
|
3148
3139
|
customInputRef: D,
|
|
3149
|
-
onToggleOption:
|
|
3150
|
-
onActivateCustom:
|
|
3140
|
+
onToggleOption: re,
|
|
3141
|
+
onActivateCustom: L,
|
|
3151
3142
|
onChangeCustomText: g,
|
|
3152
3143
|
onToggleCustomActive: _,
|
|
3153
|
-
onConfirm:
|
|
3144
|
+
onConfirm: te
|
|
3154
3145
|
})]
|
|
3155
3146
|
}, c)
|
|
3156
3147
|
})
|
|
3157
|
-
}), /* @__PURE__ */ Y(
|
|
3148
|
+
}), /* @__PURE__ */ Y(aa, {
|
|
3158
3149
|
canProceed: P,
|
|
3159
3150
|
submitDisabled: F,
|
|
3160
|
-
label:
|
|
3161
|
-
onConfirm:
|
|
3162
|
-
onSkip:
|
|
3163
|
-
showSkip:
|
|
3151
|
+
label: I,
|
|
3152
|
+
onConfirm: te,
|
|
3153
|
+
onSkip: ne,
|
|
3154
|
+
showSkip: ie
|
|
3164
3155
|
})]
|
|
3165
3156
|
});
|
|
3166
3157
|
};
|
|
3167
3158
|
//#endregion
|
|
3168
3159
|
//#region src/elements/ai/F0AiMask/gl/geometry.ts
|
|
3169
|
-
function
|
|
3160
|
+
function xa(e, t, n, r) {
|
|
3170
3161
|
let i = Math.max(1, Math.min(e, t)), a = Math.min(Math.min(n, 20) + r, i), o = Math.min(a, Math.floor(e / 2)), s = Math.min(a, Math.floor(t / 2)), c = (t) => t / e * 2 - 1, l = (e) => e / t * 2 - 1, u = e, d = t, f = o, p = e - o, m = s, h = t - s, g = c(0), _ = c(u), v = l(0), y = l(d), b = c(f), x = c(p), S = l(m), C = l(h), w = o / e, T = 1 - o / e, E = s / t, D = 1 - s / t;
|
|
3171
3162
|
return {
|
|
3172
3163
|
positions: new Float32Array([
|
|
@@ -3273,7 +3264,7 @@ function ba(e, t, n, r) {
|
|
|
3273
3264
|
}
|
|
3274
3265
|
//#endregion
|
|
3275
3266
|
//#region src/elements/ai/F0AiMask/gl/program.ts
|
|
3276
|
-
function
|
|
3267
|
+
function Sa(e, t, n) {
|
|
3277
3268
|
let r = e.createShader(t);
|
|
3278
3269
|
if (!r) throw Error("Failed to create shader");
|
|
3279
3270
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
@@ -3282,8 +3273,8 @@ function xa(e, t, n) {
|
|
|
3282
3273
|
}
|
|
3283
3274
|
return r;
|
|
3284
3275
|
}
|
|
3285
|
-
function
|
|
3286
|
-
let r =
|
|
3276
|
+
function Ca(e, t, n) {
|
|
3277
|
+
let r = Sa(e, e.VERTEX_SHADER, t), i = Sa(e, e.FRAGMENT_SHADER, n), a = e.createProgram();
|
|
3287
3278
|
if (!a) throw Error("Failed to create program");
|
|
3288
3279
|
if (e.attachShader(a, r), e.attachShader(a, i), e.linkProgram(a), !e.getProgramParameter(a, e.LINK_STATUS)) {
|
|
3289
3280
|
let t = e.getProgramInfoLog(a) || "Unknown link error";
|
|
@@ -3293,13 +3284,13 @@ function Sa(e, t, n) {
|
|
|
3293
3284
|
}
|
|
3294
3285
|
//#endregion
|
|
3295
3286
|
//#region src/elements/ai/F0AiMask/gl/shaders/fragment.ts
|
|
3296
|
-
var
|
|
3287
|
+
var wa = "#version 300 es\nprecision lowp float;\n\nin vec2 vUV;\nout vec4 outColor;\n\nuniform vec2 uResolution;\nuniform float uTime;\nuniform float uBorderWidth;\nuniform float uGlowWidth;\nuniform float uBorderRadius;\nuniform vec3 uColors[4];\n\n// dark/light mode\nuniform float uGlowExponent;\nuniform float uGlowFactor;\n\nconst float PI = 3.14159265359;\nconst float TWO_PI = 2.0 * PI;\nconst float HALF_PI = 0.5 * PI;\n\n// Light source parameters (constants)\nconst vec4 startPositions = vec4(0.0, PI, HALF_PI, 1.5 * PI);\nconst vec4 speeds = vec4(-1.9, -1.9, -1.5, 2.1);\nconst vec4 innerRadius = vec4(PI * 0.8, PI * 0.7, PI * 0.3, PI * 0.1);\nconst vec4 outerRadius = vec4(PI * 1.2, PI * 0.9, PI * 0.6, PI * 0.4);\n\n/**\n * @brief Generates a random float value based on the input 2D coordinates.\n * @param st The input 2D coordinates.\n * @return float A random float value.\n */\nfloat random(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453123);\n}\n\nvec2 random2(vec2 st) {\n return vec2(random(st), random(st + 1.0));\n}\n\n/**\n * Derivative-based Anti-aliasing\n */\nfloat aaStep(float edge, float d) {\n // Calculate the width of the anti-aliasing transition\n // This is the distance the value changes over one pixel.\n float width = fwidth(d);\n return smoothstep(edge - width * 0.5, edge + width * 0.5, d);\n}\n\n/**\n * @brief Provides an anti-aliased version of fract().\n * @param x The input value.\n * @return float The anti-aliased fractional part of x.\n */\nfloat aaFract(float x) {\n float f = fract(x);\n float w = fwidth(x); // Get the width of the transition band for one pixel.\n\n // Use smoothstep to fade the line out as it approaches the 1.0 boundary.\n // The fade happens over a distance equal to the pixel width 'w'.\n float smooth_f = f * (1.0 - smoothstep(1.0 - w, 1.0, f));\n\n return smooth_f;\n}\n\n/**\n * @name sdRoundedBox\n * @description Calculates the signed distance from a point to a rounded rectangle.\n * @param {vec2} p - The point coordinates.\n * @param {vec2} b - Half the size of the rectangle (half width and half height).\n * @param {float} r - The corner radius.\n * @returns {float} - Signed distance to the surface of the rounded rectangle.\n */\nfloat sdRoundedBox(in vec2 p, in vec2 b, in float r) {\n vec2 q = abs(p) - b + r;\n return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - r;\n}\n\n/**\n * @brief Calculates the smooth inner glow intensity for a rectangle.\n * @param p The current pixel coordinate, centered at (0,0).\n * @param b The half-dimensions of the rectangle.\n * @param radius The radius of the glow/blur.\n * @return float The glow intensity, from 0.0 to 1.0.\n */\nfloat getInnerGlow(vec2 p, vec2 b, float radius) {\n // Check if the pixel is outside the rectangle.\n // vec2 d_out = abs(p) - b;\n // if (max(d_out.x, d_out.y) > 0.0) {\n // return 0.0;\n // }\n\n // Calculate the distance to the nearest vertical and horizontal edges (positive inwards).\n float dist_x = b.x - abs(p.x);\n float dist_y = b.y - abs(p.y);\n\n // Calculate the horizontal and vertical glow intensities independently.\n float glow_x = smoothstep(radius, 0.0, dist_x);\n float glow_y = smoothstep(radius, 0.0, dist_y);\n\n // Combine the two directional glows using a screen blend mode: 1.0 - (1.0 - a) * (1.0 - b).\n return 1.0 - (1.0 - glow_x) * (1.0 - glow_y);\n}\n\nfloat getVignette(vec2 uv) {\n vec2 vignetteUv = uv;\n vignetteUv = vignetteUv * (1.0 - vignetteUv);\n float vignette = vignetteUv.x * vignetteUv.y * 25.0; // multiply with sth for intensity\n vignette = pow(vignette, 0.16); // change pow for modifying the extend of the vignette\n // vignette = smoothstep(0.0, 0.7, vignette); // smoothstep to avoid hard edges\n vignette = 1.0 - vignette;\n\n return vignette;\n}\n\n/**\n * Convert UV coordinates to angle (0 to 2π) around the border\n */\nfloat uvToAngle(vec2 uv) {\n vec2 center = vec2(0.5);\n vec2 dir = uv - center;\n return atan(dir.y, dir.x) + PI;\n}\n\n/**\n * Get current light center position (angle) based on start position, speed and time\n */\n// float getLightCenter(float startPos, float speed, float time) {\n// return mod(startPos + speed * time, TWO_PI);\n// }\n\nvoid main() {\n vec2 uv = vUV;\n vec2 pos = uv * uResolution;\n vec2 centeredPos = pos - uResolution * 0.5;\n vec2 size = uResolution - uBorderWidth;\n vec2 halfSize = size * 0.5;\n\n // Calculate the signed distance from the rounded rectangle\n float dBorderBox = sdRoundedBox(centeredPos, halfSize, uBorderRadius);\n float border = aaStep(0.0, dBorderBox);\n\n // This will create a gradient mask to safely fade out from borders to inner edges.\n float glow = getInnerGlow(centeredPos, halfSize, uGlowWidth);\n // glow = smoothstep(0.0, 0.5, glow);\n // glow = aaFract(glow * 10.0);\n\n float vignette = getVignette(uv);\n glow *= vignette;\n\n float posAngle = uvToAngle(uv);\n\n // vec4 lightCenter = vec4(\n // getLightCenter(startPositions.x, speeds.x, uTime),\n // getLightCenter(startPositions.y, speeds.y, uTime),\n // getLightCenter(startPositions.z, speeds.z, uTime),\n // getLightCenter(startPositions.w, speeds.w, uTime)\n // );\n vec4 lightCenter = mod(startPositions + speeds * uTime, TWO_PI);\n\n vec4 angleDist = abs(posAngle - lightCenter);\n\n // Calculate shortest angular distance (considering wrap-around)\n vec4 disToLight = min(angleDist, TWO_PI - angleDist) / TWO_PI;\n\n float intensityBorder[4];\n intensityBorder[0] = 1.0;\n intensityBorder[1] = smoothstep(0.4, 0.0, disToLight.y);\n intensityBorder[2] = smoothstep(0.4, 0.0, disToLight.z);\n intensityBorder[3] = smoothstep(0.2, 0.0, disToLight.w) * 0.5;\n\n // mix these 4 colors with distance\n vec3 borderColor = vec3(0.0);\n for(int i = 0; i < 4; i++) {\n borderColor = mix(borderColor, uColors[i], intensityBorder[i]);\n }\n borderColor *= 1.1;\n\n borderColor = clamp(borderColor, 0.0, 1.0);\n\n float intensityGlow[4];\n intensityGlow[0] = smoothstep(0.9, 0.0, disToLight.x);\n intensityGlow[1] = smoothstep(0.7, 0.0, disToLight.y);\n intensityGlow[2] = smoothstep(0.4, 0.0, disToLight.z);\n intensityGlow[3] = smoothstep(0.1, 0.0, disToLight.w) * 0.7;\n\n // timely breathing effect\n vec4 breath = smoothstep(0.0, 1.0, sin(uTime * 1.0 + startPositions * PI) * 0.2 + 0.8);\n\n vec3 glowColor = vec3(0.0);\n glowColor += uColors[0] * intensityGlow[0] * breath.x;\n glowColor += uColors[1] * intensityGlow[1] * breath.y;\n glowColor += uColors[2] * intensityGlow[2] * breath.z;\n glowColor += uColors[3] * intensityGlow[3] * breath.w * glow; // fade it a little bit\n\n glow = pow(glow, uGlowExponent);\n glow *= random(pos + uTime) * 0.1 + 1.0;\n glowColor *= glow * uGlowFactor;\n glowColor = clamp(glowColor, 0.0, 1.0);\n\n vec3 color = mix(glowColor, borderColor + glowColor * 0.2, border);\n\n float alpha = mix(glow, 1.0, border);\n\n outColor = vec4(color, alpha);\n}\n", Ta = "#version 300 es\n\nin vec2 aPosition;\nin vec2 aUV;\nout vec2 vUV;\nvoid main() {\n vUV = aUV;\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}\n", Ea = [
|
|
3297
3288
|
"rgb(229, 25, 67)",
|
|
3298
3289
|
"rgb(229, 86, 25)",
|
|
3299
3290
|
"rgb(229, 25, 67)",
|
|
3300
3291
|
"rgb(161, 173, 229)"
|
|
3301
3292
|
];
|
|
3302
|
-
function
|
|
3293
|
+
function Da(e) {
|
|
3303
3294
|
let t = e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
|
|
3304
3295
|
if (!t) throw Error(`Invalid color format: ${e}`);
|
|
3305
3296
|
let [, n, r, i] = t;
|
|
@@ -3309,7 +3300,7 @@ function Ea(e) {
|
|
|
3309
3300
|
parseInt(i, 10) / 255
|
|
3310
3301
|
];
|
|
3311
3302
|
}
|
|
3312
|
-
var
|
|
3303
|
+
var Oa = class {
|
|
3313
3304
|
element;
|
|
3314
3305
|
canvas;
|
|
3315
3306
|
options;
|
|
@@ -3366,7 +3357,7 @@ var Da = class {
|
|
|
3366
3357
|
if (this.options.width = e, this.options.height = t, n && (this.options.ratio = n), !this.running) return;
|
|
3367
3358
|
let { gl: r, program: i, vao: a, positionBuffer: o, uvBuffer: s, uResolution: c } = this.glr, l = n ?? this.options.ratio ?? window.devicePixelRatio ?? 1, u = Math.max(1, Math.floor(e * l)), d = Math.max(1, Math.floor(t * l));
|
|
3368
3359
|
this.canvas.style.width = `${e}px`, this.canvas.style.height = `${t}px`, (this.canvas.width !== u || this.canvas.height !== d) && (this.canvas.width = u, this.canvas.height = d), r.viewport(0, 0, this.canvas.width, this.canvas.height), this.checkGLError(r, "resize: after viewport setup");
|
|
3369
|
-
let { positions: f, uvs: p } =
|
|
3360
|
+
let { positions: f, uvs: p } = xa(this.canvas.width, this.canvas.height, this.options.borderWidth * l, this.options.glowWidth * l);
|
|
3370
3361
|
r.bindVertexArray(a), r.bindBuffer(r.ARRAY_BUFFER, o), r.bufferData(r.ARRAY_BUFFER, f, r.STATIC_DRAW);
|
|
3371
3362
|
let m = r.getAttribLocation(i, "aPosition");
|
|
3372
3363
|
r.enableVertexAttribArray(m), r.vertexAttribPointer(m, 2, r.FLOAT, !1, 0, 0), this.checkGLError(r, "resize: after position buffer update"), r.bindBuffer(r.ARRAY_BUFFER, s), r.bufferData(r.ARRAY_BUFFER, p, r.STATIC_DRAW);
|
|
@@ -3441,11 +3432,11 @@ var Da = class {
|
|
|
3441
3432
|
alpha: !0
|
|
3442
3433
|
});
|
|
3443
3434
|
if (!e) throw Error("WebGL2 is required but not available.");
|
|
3444
|
-
let t =
|
|
3435
|
+
let t = Ca(e, Ta, wa);
|
|
3445
3436
|
this.checkGLError(e, "setupGL: after createProgram");
|
|
3446
3437
|
let n = e.createVertexArray();
|
|
3447
3438
|
e.bindVertexArray(n), this.checkGLError(e, "setupGL: after VAO creation");
|
|
3448
|
-
let { positions: r, uvs: i } =
|
|
3439
|
+
let { positions: r, uvs: i } = xa(this.canvas.width || 2, this.canvas.height || 2, this.options.borderWidth, this.options.glowWidth), a = e.createBuffer();
|
|
3449
3440
|
e.bindBuffer(e.ARRAY_BUFFER, a), e.bufferData(e.ARRAY_BUFFER, r, e.STATIC_DRAW);
|
|
3450
3441
|
let o = e.getAttribLocation(t, "aPosition");
|
|
3451
3442
|
e.enableVertexAttribArray(o), e.vertexAttribPointer(o, 2, e.FLOAT, !1, 0, 0), this.checkGLError(e, "setupGL: after position buffer setup");
|
|
@@ -3455,7 +3446,7 @@ var Da = class {
|
|
|
3455
3446
|
e.enableVertexAttribArray(c), e.vertexAttribPointer(c, 2, e.FLOAT, !1, 0, 0), this.checkGLError(e, "setupGL: after UV buffer setup");
|
|
3456
3447
|
let l = e.getUniformLocation(t, "uResolution"), u = e.getUniformLocation(t, "uTime"), d = e.getUniformLocation(t, "uBorderWidth"), f = e.getUniformLocation(t, "uGlowWidth"), p = e.getUniformLocation(t, "uBorderRadius"), m = e.getUniformLocation(t, "uColors"), h = e.getUniformLocation(t, "uGlowExponent"), g = e.getUniformLocation(t, "uGlowFactor");
|
|
3457
3448
|
e.useProgram(t), e.uniform1f(d, this.options.borderWidth), e.uniform1f(f, this.options.glowWidth), e.uniform1f(p, this.options.borderRadius), this.options.mode === "dark" ? (e.uniform1f(h, 2), e.uniform1f(g, 1.8)) : (e.uniform1f(h, 1), e.uniform1f(g, 1));
|
|
3458
|
-
let _ = (this.options.colors ||
|
|
3449
|
+
let _ = (this.options.colors || Ea).map(Da);
|
|
3459
3450
|
for (let n = 0; n < _.length; n++) e.uniform3f(e.getUniformLocation(t, `uColors[${n}]`), ..._[n]);
|
|
3460
3451
|
this.checkGLError(e, "setupGL: after uniform setup"), e.bindVertexArray(null), e.bindBuffer(e.ARRAY_BUFFER, null), this.glr = {
|
|
3461
3452
|
gl: e,
|
|
@@ -3476,32 +3467,32 @@ var Da = class {
|
|
|
3476
3467
|
let { gl: t, program: n, vao: r, uTime: i } = this.glr;
|
|
3477
3468
|
t.useProgram(n), t.bindVertexArray(r), t.uniform1f(i, e), t.disable(t.DEPTH_TEST), t.disable(t.CULL_FACE), t.disable(t.BLEND), t.clearColor(0, 0, 0, 0), t.clear(t.COLOR_BUFFER_BIT), t.drawArrays(t.TRIANGLES, 0, 24), this.checkGLError(t, "render: after draw call"), t.bindVertexArray(null);
|
|
3478
3469
|
}
|
|
3479
|
-
},
|
|
3470
|
+
}, ka = 10, Aa = 2, ja = .5, Ma = .2, Na = 1.5, Q = {
|
|
3480
3471
|
duration: .5,
|
|
3481
3472
|
ease: "easeOut"
|
|
3482
|
-
},
|
|
3473
|
+
}, Pa = {
|
|
3483
3474
|
duration: .35,
|
|
3484
3475
|
ease: "easeOut",
|
|
3485
3476
|
repeat: Infinity,
|
|
3486
3477
|
repeatType: "mirror"
|
|
3487
3478
|
};
|
|
3488
|
-
function
|
|
3489
|
-
let [t, n] =
|
|
3490
|
-
return
|
|
3479
|
+
function Fa(e) {
|
|
3480
|
+
let [t, n] = q(e), r = nt(e), i = K(null);
|
|
3481
|
+
return Xt(r, "change", (e) => n(e)), {
|
|
3491
3482
|
value: t,
|
|
3492
3483
|
motionValue: r,
|
|
3493
3484
|
controls: i,
|
|
3494
|
-
animate:
|
|
3495
|
-
i.current =
|
|
3485
|
+
animate: U((e, t) => {
|
|
3486
|
+
i.current = Fe(r, e, t);
|
|
3496
3487
|
}, [r])
|
|
3497
3488
|
};
|
|
3498
3489
|
}
|
|
3499
|
-
function
|
|
3500
|
-
let [n, r] =
|
|
3490
|
+
function Ia(e, t) {
|
|
3491
|
+
let [n, r] = q(ka), { value: i, animate: a, motionValue: o } = Fa(Ma), { value: s, animate: c } = Fa(Aa), { value: l, animate: u } = Fa(ja), { value: d, animate: f } = Fa(Na), p = Yt(t, {
|
|
3501
3492
|
fftSize: 512,
|
|
3502
3493
|
smoothingTimeConstant: .55
|
|
3503
3494
|
});
|
|
3504
|
-
return
|
|
3495
|
+
return W(() => {
|
|
3505
3496
|
switch (e) {
|
|
3506
3497
|
case "idle":
|
|
3507
3498
|
case "failed":
|
|
@@ -3514,12 +3505,12 @@ function Fa(e, t) {
|
|
|
3514
3505
|
type: "spring",
|
|
3515
3506
|
duration: 1,
|
|
3516
3507
|
bounce: .35
|
|
3517
|
-
}), c(1, Q), u(.7, Q), f([1.5, 2],
|
|
3508
|
+
}), c(1, Q), u(.7, Q), f([1.5, 2], Pa);
|
|
3518
3509
|
return;
|
|
3519
3510
|
case "thinking":
|
|
3520
3511
|
case "connecting":
|
|
3521
3512
|
case "initializing":
|
|
3522
|
-
r(30), a(.3, Q), c(.5, Q), u(1, Q), f([.5, 2.5],
|
|
3513
|
+
r(30), a(.3, Q), c(.5, Q), u(1, Q), f([.5, 2.5], Pa);
|
|
3523
3514
|
return;
|
|
3524
3515
|
case "speaking":
|
|
3525
3516
|
r(70), a(.3, Q), c(.75, Q), u(1.25, Q), f(1.5, Q);
|
|
@@ -3531,7 +3522,7 @@ function Fa(e, t) {
|
|
|
3531
3522
|
c,
|
|
3532
3523
|
u,
|
|
3533
3524
|
f
|
|
3534
|
-
]),
|
|
3525
|
+
]), W(() => {
|
|
3535
3526
|
e === "speaking" && p > 0 && !o.isAnimating() && a(.2 + .2 * p, { duration: 0 });
|
|
3536
3527
|
}, [
|
|
3537
3528
|
e,
|
|
@@ -3551,32 +3542,32 @@ function Fa(e, t) {
|
|
|
3551
3542
|
}
|
|
3552
3543
|
//#endregion
|
|
3553
3544
|
//#region src/addons/ai/ai/F0AuraVoiceAnimation/components/ReactShaderToy.tsx
|
|
3554
|
-
var
|
|
3545
|
+
var La = [
|
|
3555
3546
|
"lowp",
|
|
3556
3547
|
"mediump",
|
|
3557
3548
|
"highp"
|
|
3558
|
-
],
|
|
3559
|
-
function
|
|
3549
|
+
], Ra = "\nvoid main(void){\n vec4 color = vec4(0.0,0.0,0.0,1.0);\n mainImage( color, gl_FragCoord.xy );\n gl_FragColor = color;\n}", za = "void mainImage( out vec4 fragColor, in vec2 fragCoord ) {\n vec2 uv = fragCoord/iResolution.xy;\n vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4));\n fragColor = vec4(col,1.0);\n}", Ba = "attribute vec3 aVertexPosition;\nvoid main(void) {\n gl_Position = vec4(aVertexPosition, 1.0);\n}", Va = "iTime", Ha = "iTimeDelta", Ua = "iDate", Wa = "iFrame", Ga = "iMouse", Ka = "iResolution", qa = "iChannel", Ja = "iChannelResolution", Ya = "iDeviceOrientation";
|
|
3550
|
+
function Xa(e, t) {
|
|
3560
3551
|
return e.includes("Matrix") && Array.isArray(t);
|
|
3561
3552
|
}
|
|
3562
|
-
function
|
|
3553
|
+
function Za(e, t) {
|
|
3563
3554
|
return e.includes("v") && Array.isArray(t) && t.length > Number.parseInt(e.charAt(0), 10);
|
|
3564
3555
|
}
|
|
3565
|
-
function
|
|
3566
|
-
if (
|
|
3556
|
+
function Qa(e, t) {
|
|
3557
|
+
if (Xa(e, t)) {
|
|
3567
3558
|
let n = Number.parseInt(e.charAt(e.length - 3), 10);
|
|
3568
3559
|
return t.length > n * n ? `[${Math.floor(t.length / (n * n))}]` : void 0;
|
|
3569
3560
|
}
|
|
3570
|
-
if (
|
|
3561
|
+
if (Za(e, t)) {
|
|
3571
3562
|
let n = Number.parseInt(e.charAt(0), 10);
|
|
3572
3563
|
return `[${Math.floor(t.length / n)}]`;
|
|
3573
3564
|
}
|
|
3574
3565
|
}
|
|
3575
|
-
function
|
|
3566
|
+
function $a(e, t) {
|
|
3576
3567
|
return !e.includes("v") && Array.isArray(t) && t.length > Number.parseInt(e.charAt(0), 10);
|
|
3577
3568
|
}
|
|
3578
|
-
var
|
|
3579
|
-
if (
|
|
3569
|
+
var eo = (e, t, n, r) => {
|
|
3570
|
+
if ($a(n, r)) switch (n) {
|
|
3580
3571
|
case "2f": return e.uniform2f(t, r[0], r[1]);
|
|
3581
3572
|
case "3f": return e.uniform3f(t, r[0], r[1], r[2]);
|
|
3582
3573
|
case "4f": return e.uniform4f(t, r[0], r[1], r[2], r[3]);
|
|
@@ -3598,7 +3589,7 @@ var $a = (e, t, n, r) => {
|
|
|
3598
3589
|
case "Matrix3fv": return e.uniformMatrix3fv(t, !1, r);
|
|
3599
3590
|
case "Matrix4fv": return e.uniformMatrix4fv(t, !1, r);
|
|
3600
3591
|
}
|
|
3601
|
-
},
|
|
3592
|
+
}, to = (e) => {
|
|
3602
3593
|
switch (e) {
|
|
3603
3594
|
case "1f": return "float";
|
|
3604
3595
|
case "2f": return "vec2";
|
|
@@ -3621,7 +3612,7 @@ var $a = (e, t, n, r) => {
|
|
|
3621
3612
|
case "Matrix4fv": return "mat4";
|
|
3622
3613
|
default: console.error($(`The uniform type "${e}" is not valid, please make sure your uniform type is valid`));
|
|
3623
3614
|
}
|
|
3624
|
-
},
|
|
3615
|
+
}, no = 9729, ro = 9728, io = 9987, ao = 33071, oo = 10497, so = class {
|
|
3625
3616
|
gl;
|
|
3626
3617
|
url;
|
|
3627
3618
|
wrapS;
|
|
@@ -3690,33 +3681,33 @@ var $a = (e, t, n, r) => {
|
|
|
3690
3681
|
});
|
|
3691
3682
|
}
|
|
3692
3683
|
let g = await h(), _ = !(g.width & g.width - 1) && !(g.height & g.height - 1);
|
|
3693
|
-
return (e.wrapS !==
|
|
3684
|
+
return (e.wrapS !== ao || e.wrapT !== ao || e.minFilter !== ro && e.minFilter !== no) && !_ && (g = this.makePowerOf2(g), _ = !0), t.bindTexture(t.TEXTURE_2D, m), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, s), t.texImage2D(t.TEXTURE_2D, 0, u, d, f, g), _ && e.minFilter !== ro && e.minFilter !== no && t.generateMipmap(t.TEXTURE_2D), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, this.wrapS || oo), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, this.wrapT || oo), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, this.minFilter || io), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, this.magFilter || no), this._webglTexture = m, this.source = g, this.isVideo = !1, this.isLoaded = !0, this.width = g.width || 0, this.height = g.height || 0, this;
|
|
3694
3685
|
};
|
|
3695
|
-
}, $ = (e) => `react-shaders: ${e}`,
|
|
3686
|
+
}, $ = (e) => `react-shaders: ${e}`, co = (e) => {
|
|
3696
3687
|
if ("changedTouches" in e) {
|
|
3697
3688
|
let t = e.changedTouches[0];
|
|
3698
3689
|
return [t?.clientX ?? 0, t?.clientY ?? 0];
|
|
3699
3690
|
}
|
|
3700
3691
|
return [e.clientX, e.clientY];
|
|
3701
|
-
},
|
|
3702
|
-
function
|
|
3692
|
+
}, lo = (e, t, n) => e * (1 - n) + t * n, uo = (e, t, n) => n > 0 ? e.substring(0, n) + t + e.substring(n, e.length) : t + e;
|
|
3693
|
+
function fo({ fs: e, vs: t = Ba, textures: n = [], uniforms: r, clearColor: i = [
|
|
3703
3694
|
0,
|
|
3704
3695
|
0,
|
|
3705
3696
|
0,
|
|
3706
3697
|
1
|
|
3707
3698
|
], precision: a = "highp", style: o, contextAttributes: s = {}, lerp: c = 1, devicePixelRatio: l = 1, onDoneLoadingTextures: u, onError: d = console.error, onWarning: f = console.warn }) {
|
|
3708
|
-
let p =
|
|
3709
|
-
[
|
|
3699
|
+
let p = K(null), m = K(null), h = K(null), g = K(null), _ = K(void 0), v = K(void 0), y = K(!1), b = K(void 0), x = K(0), S = K([0, 0]), C = K([]), w = K(0), T = K(void 0), E = K({
|
|
3700
|
+
[Va]: {
|
|
3710
3701
|
type: "float",
|
|
3711
3702
|
isNeeded: !1,
|
|
3712
3703
|
value: 0
|
|
3713
3704
|
},
|
|
3714
|
-
[
|
|
3705
|
+
[Ha]: {
|
|
3715
3706
|
type: "float",
|
|
3716
3707
|
isNeeded: !1,
|
|
3717
3708
|
value: 0
|
|
3718
3709
|
},
|
|
3719
|
-
[
|
|
3710
|
+
[Ua]: {
|
|
3720
3711
|
type: "vec4",
|
|
3721
3712
|
isNeeded: !1,
|
|
3722
3713
|
value: [
|
|
@@ -3726,7 +3717,7 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3726
3717
|
0
|
|
3727
3718
|
]
|
|
3728
3719
|
},
|
|
3729
|
-
[
|
|
3720
|
+
[Ga]: {
|
|
3730
3721
|
type: "vec4",
|
|
3731
3722
|
isNeeded: !1,
|
|
3732
3723
|
value: [
|
|
@@ -3736,17 +3727,17 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3736
3727
|
0
|
|
3737
3728
|
]
|
|
3738
3729
|
},
|
|
3739
|
-
[
|
|
3730
|
+
[Ka]: {
|
|
3740
3731
|
type: "vec2",
|
|
3741
3732
|
isNeeded: !1,
|
|
3742
3733
|
value: [0, 0]
|
|
3743
3734
|
},
|
|
3744
|
-
[
|
|
3735
|
+
[Wa]: {
|
|
3745
3736
|
type: "int",
|
|
3746
3737
|
isNeeded: !1,
|
|
3747
3738
|
value: 0
|
|
3748
3739
|
},
|
|
3749
|
-
[
|
|
3740
|
+
[Ya]: {
|
|
3750
3741
|
type: "vec4",
|
|
3751
3742
|
isNeeded: !1,
|
|
3752
3743
|
value: [
|
|
@@ -3756,7 +3747,7 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3756
3747
|
0
|
|
3757
3748
|
]
|
|
3758
3749
|
}
|
|
3759
|
-
}), D =
|
|
3750
|
+
}), D = K(r), O = (e, t) => {
|
|
3760
3751
|
let n = "width" in e ? e.width ?? 0 : 0, r = "height" in e ? e.height ?? 0 : 0, i = E.current.iChannelResolution;
|
|
3761
3752
|
if (!i) return;
|
|
3762
3753
|
Array.isArray(i.value) || (i.value = []);
|
|
@@ -3788,13 +3779,13 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3788
3779
|
window.orientation ?? 0
|
|
3789
3780
|
];
|
|
3790
3781
|
}, j = (e) => {
|
|
3791
|
-
let [t = 0, n = 0] =
|
|
3782
|
+
let [t = 0, n = 0] = co(e), r = t - (b.current?.left ?? 0) - window.pageXOffset, i = (b.current?.height ?? 0) - n - (b.current?.top ?? 0) - window.pageYOffset;
|
|
3792
3783
|
y.current = !0;
|
|
3793
3784
|
let a = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
3794
3785
|
a && (a[2] = r, a[3] = i), S.current[0] = r, S.current[1] = i;
|
|
3795
3786
|
}, M = (e) => {
|
|
3796
3787
|
b.current = p.current?.getBoundingClientRect();
|
|
3797
|
-
let [t = 0, n = 0] =
|
|
3788
|
+
let [t = 0, n = 0] = co(e), r = t - (b.current?.left ?? 0), i = (b.current?.height ?? 0) - n - (b.current?.top ?? 0);
|
|
3798
3789
|
if (c !== 1) S.current[0] = r, S.current[1] = i;
|
|
3799
3790
|
else {
|
|
3800
3791
|
let e = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
@@ -3809,7 +3800,7 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3809
3800
|
b.current = p.current?.getBoundingClientRect();
|
|
3810
3801
|
let t = l, n = Math.floor((b.current?.width ?? 1) * t), r = Math.floor((b.current?.height ?? 1) * t);
|
|
3811
3802
|
if (e.canvas.width = n, e.canvas.height = r, E.current.iResolution?.isNeeded && g.current) {
|
|
3812
|
-
let t = e.getUniformLocation(g.current,
|
|
3803
|
+
let t = e.getUniformLocation(g.current, Ka);
|
|
3813
3804
|
e.uniform2fv(t, [e.canvas.width, e.canvas.height]);
|
|
3814
3805
|
}
|
|
3815
3806
|
}, F = (e, t) => {
|
|
@@ -3823,18 +3814,18 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3823
3814
|
n.deleteShader(r), d?.($(`Shader compiler log: ${e}`));
|
|
3824
3815
|
}
|
|
3825
3816
|
return r;
|
|
3826
|
-
},
|
|
3817
|
+
}, te = (e, t) => {
|
|
3827
3818
|
let n = m.current;
|
|
3828
3819
|
if (!n) return;
|
|
3829
3820
|
let r = F(n.FRAGMENT_SHADER, e), i = F(n.VERTEX_SHADER, t);
|
|
3830
3821
|
g.current = n.createProgram(), g.current && i && r && (n.attachShader(g.current, i), n.attachShader(g.current, r), n.linkProgram(g.current), n.getProgramParameter(g.current, n.LINK_STATUS) ? (n.useProgram(g.current), _.current = n.getAttribLocation(g.current, "aVertexPosition"), n.enableVertexAttribArray(_.current)) : d?.($(`Unable to initialize the shader program: ${n.getProgramInfoLog(g.current)}`)));
|
|
3831
|
-
},
|
|
3822
|
+
}, ne = () => {
|
|
3832
3823
|
if (r) for (let e of Object.keys(r)) {
|
|
3833
3824
|
let t = r[e];
|
|
3834
3825
|
if (!t) continue;
|
|
3835
|
-
let { value: n, type: i } = t, a =
|
|
3826
|
+
let { value: n, type: i } = t, a = to(i);
|
|
3836
3827
|
if (!a) continue;
|
|
3837
|
-
let o =
|
|
3828
|
+
let o = Qa(i, n);
|
|
3838
3829
|
E.current[e] = {
|
|
3839
3830
|
type: a,
|
|
3840
3831
|
isNeeded: !1,
|
|
@@ -3842,20 +3833,20 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3842
3833
|
...o ? { arraySize: o } : {}
|
|
3843
3834
|
};
|
|
3844
3835
|
}
|
|
3845
|
-
},
|
|
3836
|
+
}, re = () => {
|
|
3846
3837
|
let e = m.current;
|
|
3847
3838
|
if (e) {
|
|
3848
3839
|
if (n && n.length > 0) {
|
|
3849
|
-
E.current[
|
|
3840
|
+
E.current[Ja] = {
|
|
3850
3841
|
type: "vec3",
|
|
3851
3842
|
isNeeded: !1,
|
|
3852
3843
|
arraySize: `[${n.length}]`,
|
|
3853
3844
|
value: []
|
|
3854
3845
|
};
|
|
3855
|
-
let t = n.map((t, n) => (E.current[`${
|
|
3846
|
+
let t = n.map((t, n) => (E.current[`${qa}${n}`] = {
|
|
3856
3847
|
type: "sampler2D",
|
|
3857
3848
|
isNeeded: !1
|
|
3858
|
-
}, O(t, n), C.current[n] = new
|
|
3849
|
+
}, O(t, n), C.current[n] = new so(e), C.current[n]?.load(t).then((e) => O(e, n))));
|
|
3859
3850
|
Promise.all(t).then(() => {
|
|
3860
3851
|
u && u();
|
|
3861
3852
|
}).catch((e) => {
|
|
@@ -3863,17 +3854,17 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3863
3854
|
});
|
|
3864
3855
|
} else u && u();
|
|
3865
3856
|
}
|
|
3866
|
-
},
|
|
3867
|
-
let t =
|
|
3857
|
+
}, I = (e) => {
|
|
3858
|
+
let t = La.includes(a ?? "highp"), n = `precision ${t ? a : La[1]} float;\n`;
|
|
3868
3859
|
t || f?.($(`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.`));
|
|
3869
3860
|
let r = n.concat(`#define DPR ${l.toFixed(1)}\n`).concat(e.replace(/texture\(/g, "texture2D("));
|
|
3870
3861
|
for (let t of Object.keys(E.current)) if (e.includes(t)) {
|
|
3871
3862
|
let e = E.current[t];
|
|
3872
3863
|
if (!e) continue;
|
|
3873
|
-
r =
|
|
3864
|
+
r = uo(r, `uniform ${e.type} ${t}${e.arraySize || ""}; \n`, r.lastIndexOf(n) + n.length), e.isNeeded = !0;
|
|
3874
3865
|
}
|
|
3875
|
-
return e.includes("mainImage") && (r = r.concat(
|
|
3876
|
-
},
|
|
3866
|
+
return e.includes("mainImage") && (r = r.concat(Ra)), r;
|
|
3867
|
+
}, ie = (e) => {
|
|
3877
3868
|
let t = m.current;
|
|
3878
3869
|
if (!t || !g.current) return;
|
|
3879
3870
|
let n = w.current ? (e - w.current) / 1e3 : 0;
|
|
@@ -3885,31 +3876,31 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3885
3876
|
if (!g.current) return;
|
|
3886
3877
|
let r = t.getUniformLocation(g.current, e);
|
|
3887
3878
|
if (!r) return;
|
|
3888
|
-
|
|
3879
|
+
eo(t, r, n.type, n.value);
|
|
3889
3880
|
}
|
|
3890
3881
|
}
|
|
3891
3882
|
if (E.current.iMouse?.isNeeded) {
|
|
3892
|
-
let e = t.getUniformLocation(g.current,
|
|
3883
|
+
let e = t.getUniformLocation(g.current, Ga);
|
|
3893
3884
|
t.uniform4fv(e, E.current.iMouse.value);
|
|
3894
3885
|
}
|
|
3895
3886
|
if (E.current.iChannelResolution?.isNeeded) {
|
|
3896
|
-
let e = t.getUniformLocation(g.current,
|
|
3887
|
+
let e = t.getUniformLocation(g.current, Ja);
|
|
3897
3888
|
t.uniform3fv(e, E.current.iChannelResolution.value);
|
|
3898
3889
|
}
|
|
3899
3890
|
if (E.current.iDeviceOrientation?.isNeeded) {
|
|
3900
|
-
let e = t.getUniformLocation(g.current,
|
|
3891
|
+
let e = t.getUniformLocation(g.current, Ya);
|
|
3901
3892
|
t.uniform4fv(e, E.current.iDeviceOrientation.value);
|
|
3902
3893
|
}
|
|
3903
3894
|
if (E.current.iTime?.isNeeded) {
|
|
3904
|
-
let e = t.getUniformLocation(g.current,
|
|
3895
|
+
let e = t.getUniformLocation(g.current, Va);
|
|
3905
3896
|
x.current += n, t.uniform1f(e, x.current);
|
|
3906
3897
|
}
|
|
3907
3898
|
if (E.current.iTimeDelta?.isNeeded) {
|
|
3908
|
-
let e = t.getUniformLocation(g.current,
|
|
3899
|
+
let e = t.getUniformLocation(g.current, Ha);
|
|
3909
3900
|
t.uniform1f(e, n);
|
|
3910
3901
|
}
|
|
3911
3902
|
if (E.current.iDate?.isNeeded) {
|
|
3912
|
-
let e = /* @__PURE__ */ new Date(), n = e.getMonth() + 1, r = e.getDate(), i = e.getFullYear(), a = e.getHours() * 60 * 60 + e.getMinutes() * 60 + e.getSeconds() + e.getMilliseconds() * .001, o = t.getUniformLocation(g.current,
|
|
3903
|
+
let e = /* @__PURE__ */ new Date(), n = e.getMonth() + 1, r = e.getDate(), i = e.getFullYear(), a = e.getHours() * 60 * 60 + e.getMinutes() * 60 + e.getSeconds() + e.getMilliseconds() * .001, o = t.getUniformLocation(g.current, Ua);
|
|
3913
3904
|
t.uniform4fv(o, [
|
|
3914
3905
|
i,
|
|
3915
3906
|
n,
|
|
@@ -3918,7 +3909,7 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3918
3909
|
]);
|
|
3919
3910
|
}
|
|
3920
3911
|
if (E.current.iFrame?.isNeeded) {
|
|
3921
|
-
let e = t.getUniformLocation(g.current,
|
|
3912
|
+
let e = t.getUniformLocation(g.current, Wa), n = E.current.iFrame.value;
|
|
3922
3913
|
t.uniform1i(e, n), E.current.iFrame.value = n + 1;
|
|
3923
3914
|
}
|
|
3924
3915
|
if (C.current.length > 0) for (let e = 0; e < C.current.length; e++) {
|
|
@@ -3932,31 +3923,31 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3932
3923
|
t.activeTexture(t.TEXTURE0 + e), t.bindTexture(t.TEXTURE_2D, i), t.uniform1i(s, e), r && n.updateTexture(i, a, o);
|
|
3933
3924
|
}
|
|
3934
3925
|
}
|
|
3935
|
-
},
|
|
3926
|
+
}, L = (e) => {
|
|
3936
3927
|
let t = m.current;
|
|
3937
3928
|
if (!t) return;
|
|
3938
|
-
t.viewport(0, 0, t.drawingBufferWidth, t.drawingBufferHeight), t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), t.bindBuffer(t.ARRAY_BUFFER, h.current), t.vertexAttribPointer(_.current ?? 0, 3, t.FLOAT, !1, 0, 0),
|
|
3929
|
+
t.viewport(0, 0, t.drawingBufferWidth, t.drawingBufferHeight), t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), t.bindBuffer(t.ARRAY_BUFFER, h.current), t.vertexAttribPointer(_.current ?? 0, 3, t.FLOAT, !1, 0, 0), ie(e), t.drawArrays(t.TRIANGLE_STRIP, 0, 4);
|
|
3939
3930
|
let n = E.current.iMouse?.value;
|
|
3940
3931
|
if (E.current.iMouse?.isNeeded && c !== 1 && Array.isArray(n)) {
|
|
3941
3932
|
let e = n[0] ?? 0, t = n[1] ?? 0;
|
|
3942
|
-
n[0] =
|
|
3933
|
+
n[0] = lo(e, S.current[0] ?? 0, c), n[1] = lo(t, S.current[1] ?? 0, c);
|
|
3943
3934
|
}
|
|
3944
|
-
v.current = requestAnimationFrame(
|
|
3945
|
-
},
|
|
3935
|
+
v.current = requestAnimationFrame(L);
|
|
3936
|
+
}, ae = () => {
|
|
3946
3937
|
let e = { passive: !0 };
|
|
3947
3938
|
E.current.iMouse?.isNeeded && p.current && (p.current.addEventListener("mousemove", M, e), p.current.addEventListener("mouseout", N, e), p.current.addEventListener("mouseup", N, e), p.current.addEventListener("mousedown", j, e), p.current.addEventListener("touchmove", M, e), p.current.addEventListener("touchend", N, e), p.current.addEventListener("touchstart", j, e)), E.current.iDeviceOrientation?.isNeeded && window.addEventListener("deviceorientation", A, e), p.current && (T.current = new ResizeObserver(P), T.current.observe(p.current), window.addEventListener("resize", P, e));
|
|
3948
|
-
},
|
|
3939
|
+
}, R = () => {
|
|
3949
3940
|
let e = { passive: !0 };
|
|
3950
3941
|
E.current.iMouse?.isNeeded && p.current && (p.current.removeEventListener("mousemove", M, e), p.current.removeEventListener("mouseout", N, e), p.current.removeEventListener("mouseup", N, e), p.current.removeEventListener("mousedown", j, e), p.current.removeEventListener("touchmove", M, e), p.current.removeEventListener("touchend", N, e), p.current.removeEventListener("touchstart", j, e)), E.current.iDeviceOrientation?.isNeeded && window.removeEventListener("deviceorientation", A, e), T.current && (T.current.disconnect(), window.removeEventListener("resize", P, e));
|
|
3951
3942
|
};
|
|
3952
|
-
return
|
|
3943
|
+
return W(() => {
|
|
3953
3944
|
D.current = r;
|
|
3954
|
-
}, [r]),
|
|
3945
|
+
}, [r]), W(() => {
|
|
3955
3946
|
let n = C.current;
|
|
3956
3947
|
function r() {
|
|
3957
3948
|
ee();
|
|
3958
3949
|
let n = m.current;
|
|
3959
|
-
n && p.current && (n.clearColor(...i), n.clearDepth(1), n.enable(n.DEPTH_TEST), n.depthFunc(n.LEQUAL), n.viewport(0, 0, p.current.width, p.current.height), p.current.height = p.current.clientHeight, p.current.width = p.current.clientWidth,
|
|
3950
|
+
n && p.current && (n.clearColor(...i), n.clearDepth(1), n.enable(n.DEPTH_TEST), n.depthFunc(n.LEQUAL), n.viewport(0, 0, p.current.width, p.current.height), p.current.height = p.current.clientHeight, p.current.width = p.current.clientWidth, ne(), re(), te(I(e || za), t || Ba), k(), requestAnimationFrame(L), ae(), P());
|
|
3960
3951
|
}
|
|
3961
3952
|
return requestAnimationFrame(r), () => {
|
|
3962
3953
|
let e = m.current;
|
|
@@ -3964,7 +3955,7 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3964
3955
|
if (e.getExtension("WEBGL_lose_context")?.loseContext(), e.useProgram(null), e.deleteProgram(g.current ?? null), n.length > 0) for (let t of n) e.deleteTexture(t._webglTexture);
|
|
3965
3956
|
g.current = null;
|
|
3966
3957
|
}
|
|
3967
|
-
|
|
3958
|
+
R(), cancelAnimationFrame(v.current ?? 0);
|
|
3968
3959
|
};
|
|
3969
3960
|
}, []), /* @__PURE__ */ Y("canvas", {
|
|
3970
3961
|
ref: p,
|
|
@@ -3977,7 +3968,7 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3977
3968
|
}
|
|
3978
3969
|
//#endregion
|
|
3979
3970
|
//#region src/addons/ai/ai/F0AuraVoiceAnimation/components/shaderSource.ts
|
|
3980
|
-
var
|
|
3971
|
+
var po = "\nconst float TAU = 6.283185;\n\n// Noise for dithering\nvec2 randFibo(vec2 p) {\n p = fract(p * vec2(443.897, 441.423));\n p += dot(p, p.yx + 19.19);\n return fract((p.xx + p.yx) * p.xy);\n}\n\n// Tonemap\nvec3 Tonemap(vec3 x) {\n x *= 4.0;\n return x / (1.0 + x);\n}\n\n// Luma for alpha\nfloat luma(vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\n// RGB to HSV\nvec3 rgb2hsv(vec3 c) {\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n}\n\n// HSV to RGB\nvec3 hsv2rgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n// SDF shapes\nfloat sdCircle(vec2 st, float r) {\n return length(st) - r;\n}\n\nfloat sdLine(vec2 p, float r) {\n float halfLen = r * 2.0;\n vec2 a = vec2(-halfLen, 0.0);\n vec2 b = vec2(halfLen, 0.0);\n vec2 pa = p - a;\n vec2 ba = b - a;\n float h = clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0);\n return length(pa - ba * h);\n}\n\nfloat getSdf(vec2 st) {\n if(uShape == 1.0) return sdCircle(st, uScale);\n else if(uShape == 2.0) return sdLine(st, uScale);\n return sdCircle(st, uScale); // Default\n}\n\nvec2 turb(vec2 pos, float t, float it) {\n // Initial rotation matrix for swirl direction\n mat2 rotation = mat2(0.6, -0.25, 0.25, 0.9);\n // Secondary rotation applied each iteration (approx 53 degree rotation)\n mat2 layerRotation = mat2(0.6, -0.8, 0.8, 0.6);\n\n float frequency = mix(2.0, 15.0, uFrequency);\n float amplitude = uAmplitude;\n float frequencyGrowth = 1.4;\n float animTime = t * 0.1 * uSpeed;\n\n const int LAYERS = 4;\n for(int i = 0; i < LAYERS; i++) {\n // Calculate wave displacement for this layer\n vec2 rotatedPos = pos * rotation;\n vec2 wave = sin(frequency * rotatedPos + float(i) * animTime + it);\n\n // Apply displacement along rotation direction\n pos += (amplitude / frequency) * rotation[0] * wave;\n\n // Evolve parameters for next layer\n rotation *= layerRotation;\n amplitude *= mix(1.0, max(wave.x, wave.y), uVariance);\n frequency *= frequencyGrowth;\n }\n\n return pos;\n}\n\nconst float ITERATIONS = 36.0;\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n vec2 uv = fragCoord / iResolution.xy;\n\n vec3 pp = vec3(0.0);\n vec3 bloom = vec3(0.0);\n float t = iTime * 0.5;\n vec2 pos = uv - 0.5;\n\n vec2 prevPos = turb(pos, t, 0.0 - 1.0 / ITERATIONS);\n float spacing = mix(1.0, TAU, uSpacing);\n\n for(float i = 1.0; i < ITERATIONS + 1.0; i++) {\n float iter = i / ITERATIONS;\n vec2 st = turb(pos, t, iter * spacing);\n float d = abs(getSdf(st));\n float pd = distance(st, prevPos);\n prevPos = st;\n float dynamicBlur = exp2(pd * 2.0 * 1.4426950408889634) - 1.0;\n float ds = smoothstep(0.0, uBlur * 0.05 + max(dynamicBlur * uSmoothing, 0.001), d);\n\n // Shift color based on iteration using uColorScale\n vec3 color = uColor;\n if(uColorShift > 0.01) {\n vec3 hsv = rgb2hsv(color);\n // Shift hue by iteration\n hsv.x = fract(hsv.x + (1.0 - iter) * uColorShift * 0.3);\n color = hsv2rgb(hsv);\n }\n\n float invd = 1.0 / max(d + dynamicBlur, 0.001);\n pp += (ds - 1.0) * color;\n bloom += clamp(invd, 0.0, 250.0) * color;\n }\n\n pp *= 1.0 / ITERATIONS;\n\n vec3 color;\n\n // Dark mode (default)\n if(uMode < 0.5) {\n // use bloom effect\n bloom = bloom / (bloom + 2e4);\n color = (-pp + bloom * 3.0 * uBloom) * 1.2;\n color += (randFibo(fragCoord).x - 0.5) / 255.0;\n color = Tonemap(color);\n float alpha = luma(color) * uMix;\n fragColor = vec4(color * uMix, alpha);\n }\n\n // Light mode\n else {\n // no bloom effect\n color = -pp;\n color += (randFibo(fragCoord).x - 0.5) / 255.0;\n\n // Preserve hue by tone mapping brightness only\n float brightness = length(color);\n vec3 direction = brightness > 0.0 ? color / brightness : color;\n\n // Reinhard on brightness\n float factor = 2.0;\n float mappedBrightness = (brightness * factor) / (1.0 + brightness * factor);\n color = direction * mappedBrightness;\n\n // Boost saturation to compensate for white background bleed-through\n // When alpha < 1.0, white bleeds through making colors look desaturated\n // So we increase saturation to maintain vibrant appearance\n float gray = dot(color, vec3(0.2, 0.5, 0.1));\n float saturationBoost = 3.0;\n color = mix(vec3(gray), color, saturationBoost);\n\n // Clamp between 0-1\n color = clamp(color, 0.0, 1.0);\n\n float alpha = mappedBrightness * clamp(uMix, 1.0, 2.0);\n fragColor = vec4(color, alpha);\n }\n}", mo = c({
|
|
3981
3972
|
base: "aspect-square",
|
|
3982
3973
|
variants: { size: {
|
|
3983
3974
|
icon: "h-[24px]",
|
|
@@ -3988,7 +3979,7 @@ var fo = "\nconst float TAU = 6.283185;\n\n// Noise for dithering\nvec2 randFibo
|
|
|
3988
3979
|
} },
|
|
3989
3980
|
defaultVariants: { size: "lg" }
|
|
3990
3981
|
});
|
|
3991
|
-
function
|
|
3982
|
+
function ho(e) {
|
|
3992
3983
|
let t = e.match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/);
|
|
3993
3984
|
if (t) {
|
|
3994
3985
|
let [, e, n, r] = t;
|
|
@@ -3999,14 +3990,14 @@ function mo(e) {
|
|
|
3999
3990
|
].map((e = "00") => parseInt(e, 16) / 255);
|
|
4000
3991
|
}
|
|
4001
3992
|
}
|
|
4002
|
-
function
|
|
4003
|
-
let p =
|
|
3993
|
+
function go({ shape: e = 1, speed: t = 1, amplitude: n = .5, frequency: r = .5, scale: i = .2, blur: a = 1, color: o = "#FF355E", colorShift: s = 1, brightness: c = 1, themeMode: l = typeof window < "u" && document.documentElement.classList.contains("dark") ? "dark" : "light", ref: u, className: d, ...f }) {
|
|
3994
|
+
let p = G(() => ho(o), [o]);
|
|
4004
3995
|
return /* @__PURE__ */ Y("div", {
|
|
4005
3996
|
ref: u,
|
|
4006
3997
|
className: d,
|
|
4007
3998
|
...f,
|
|
4008
|
-
children: /* @__PURE__ */ Y(
|
|
4009
|
-
fs:
|
|
3999
|
+
children: /* @__PURE__ */ Y(fo, {
|
|
4000
|
+
fs: po,
|
|
4010
4001
|
devicePixelRatio: globalThis.devicePixelRatio ?? 1,
|
|
4011
4002
|
uniforms: {
|
|
4012
4003
|
uSpeed: {
|
|
@@ -4083,10 +4074,10 @@ function ho({ shape: e = 1, speed: t = 1, amplitude: n = .5, frequency: r = .5,
|
|
|
4083
4074
|
})
|
|
4084
4075
|
});
|
|
4085
4076
|
}
|
|
4086
|
-
|
|
4087
|
-
function
|
|
4088
|
-
let { speed: l, scale: u, amplitude: d, frequency: f, brightness: p } =
|
|
4089
|
-
return /* @__PURE__ */ Y(
|
|
4077
|
+
go.displayName = "AuraShader";
|
|
4078
|
+
function _o({ size: e = "lg", state: t, color: n, colorShift: r = .05, audioTrack: i, themeMode: a, className: o, ref: s, ...c }) {
|
|
4079
|
+
let { speed: l, scale: u, amplitude: d, frequency: f, brightness: p } = Ia(t, i);
|
|
4080
|
+
return /* @__PURE__ */ Y(go, {
|
|
4090
4081
|
ref: s,
|
|
4091
4082
|
blur: .2,
|
|
4092
4083
|
color: n,
|
|
@@ -4097,13 +4088,13 @@ function go({ size: e = "lg", state: t, color: n, colorShift: r = .05, audioTrac
|
|
|
4097
4088
|
amplitude: d,
|
|
4098
4089
|
frequency: f,
|
|
4099
4090
|
brightness: p,
|
|
4100
|
-
className: y(
|
|
4091
|
+
className: y(mo({ size: e }), "overflow-hidden rounded-full", o),
|
|
4101
4092
|
...c
|
|
4102
4093
|
});
|
|
4103
4094
|
}
|
|
4104
4095
|
//#endregion
|
|
4105
4096
|
//#region src/blocks/ai/F0HILActionConfirmation/F0HILActionConfirmation.tsx
|
|
4106
|
-
var
|
|
4097
|
+
var vo = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm: i, cancelText: a, onCancel: o, stackAt: s = "sm" }) => /* @__PURE__ */ Y(ne, {
|
|
4107
4098
|
title: e,
|
|
4108
4099
|
description: t,
|
|
4109
4100
|
avatar: n,
|
|
@@ -4116,7 +4107,7 @@ var _o = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4116
4107
|
label: a,
|
|
4117
4108
|
onClick: o
|
|
4118
4109
|
}
|
|
4119
|
-
}),
|
|
4110
|
+
}), yo = c({
|
|
4120
4111
|
base: [
|
|
4121
4112
|
"relative flex flex-col rounded-2xl bg-f1-background",
|
|
4122
4113
|
"border border-solid border-f1-border-secondary",
|
|
@@ -4128,10 +4119,10 @@ var _o = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4128
4119
|
false: "hover:shadow-md"
|
|
4129
4120
|
} },
|
|
4130
4121
|
defaultVariants: { selected: !1 }
|
|
4131
|
-
}),
|
|
4122
|
+
}), bo = c({ base: "text-lg font-semibold text-f1-foreground line-clamp-3" }), xo = c({ base: "text-sm text-f1-foreground-secondary leading-normal" }), So = c({ base: "text-sm font-medium text-f1-foreground leading-normal" }), Co = ({ description: e, isRevealed: r, onAskOne: i }) => {
|
|
4132
4123
|
let a = p(), o = t();
|
|
4133
|
-
return /* @__PURE__ */ X(
|
|
4134
|
-
className: y(
|
|
4124
|
+
return /* @__PURE__ */ X(J, { children: [e ? /* @__PURE__ */ Y("span", {
|
|
4125
|
+
className: y(xo(), "truncate"),
|
|
4135
4126
|
children: e
|
|
4136
4127
|
}) : null, /* @__PURE__ */ Y(n, { children: i && r ? /* @__PURE__ */ Y(s.div, {
|
|
4137
4128
|
className: "absolute bottom-4 left-4 z-10",
|
|
@@ -4147,7 +4138,7 @@ var _o = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4147
4138
|
1
|
|
4148
4139
|
]
|
|
4149
4140
|
},
|
|
4150
|
-
children: /* @__PURE__ */ Y(
|
|
4141
|
+
children: /* @__PURE__ */ Y(ut, {
|
|
4151
4142
|
size: "md",
|
|
4152
4143
|
label: a.ai.ask,
|
|
4153
4144
|
onClick: (e) => {
|
|
@@ -4155,81 +4146,81 @@ var _o = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4155
4146
|
}
|
|
4156
4147
|
})
|
|
4157
4148
|
}) : null })] });
|
|
4158
|
-
},
|
|
4149
|
+
}, wo = /* @__PURE__ */ new Set([
|
|
4159
4150
|
"person",
|
|
4160
4151
|
"people",
|
|
4161
4152
|
"team",
|
|
4162
4153
|
"company",
|
|
4163
4154
|
"alert",
|
|
4164
4155
|
"balance"
|
|
4165
|
-
]),
|
|
4156
|
+
]), To = ({ label: e, children: t }) => /* @__PURE__ */ X("div", {
|
|
4166
4157
|
className: "flex items-center gap-1",
|
|
4167
4158
|
children: [t, e ? /* @__PURE__ */ Y("span", {
|
|
4168
|
-
className: y(
|
|
4159
|
+
className: y(So()),
|
|
4169
4160
|
children: e
|
|
4170
4161
|
}) : null]
|
|
4171
|
-
}),
|
|
4162
|
+
}), Eo = ({ balance: e }) => /* @__PURE__ */ Y(Et, {
|
|
4172
4163
|
amount: e.amount,
|
|
4173
4164
|
percentage: e.percentage ?? void 0,
|
|
4174
4165
|
invertStatus: e.invertStatus,
|
|
4175
4166
|
hint: e.hint
|
|
4176
|
-
}),
|
|
4167
|
+
}), Do = (e) => {
|
|
4177
4168
|
let { label: t } = e;
|
|
4178
|
-
return e.content === "person" ? /* @__PURE__ */ Y(
|
|
4169
|
+
return e.content === "person" ? /* @__PURE__ */ Y(To, {
|
|
4179
4170
|
label: t,
|
|
4180
|
-
children: /* @__PURE__ */ Y(
|
|
4171
|
+
children: /* @__PURE__ */ Y(_t, {
|
|
4181
4172
|
firstName: e.avatar.firstName,
|
|
4182
4173
|
lastName: e.avatar.lastName,
|
|
4183
4174
|
src: e.avatar.src,
|
|
4184
4175
|
size: "xs"
|
|
4185
4176
|
})
|
|
4186
|
-
}) : e.content === "people" ? /* @__PURE__ */ Y(
|
|
4177
|
+
}) : e.content === "people" ? /* @__PURE__ */ Y(bt, {
|
|
4187
4178
|
type: "person",
|
|
4188
4179
|
avatars: e.avatars,
|
|
4189
4180
|
size: "md",
|
|
4190
4181
|
max: 3
|
|
4191
|
-
}) : e.content === "team" ? /* @__PURE__ */ Y(
|
|
4182
|
+
}) : e.content === "team" ? /* @__PURE__ */ Y(To, {
|
|
4192
4183
|
label: t,
|
|
4193
|
-
children: /* @__PURE__ */ Y(
|
|
4184
|
+
children: /* @__PURE__ */ Y(St, {
|
|
4194
4185
|
name: e.avatar.name,
|
|
4195
4186
|
src: e.avatar.src,
|
|
4196
4187
|
size: "xs"
|
|
4197
4188
|
})
|
|
4198
|
-
}) : e.content === "company" ? /* @__PURE__ */ Y(
|
|
4189
|
+
}) : e.content === "company" ? /* @__PURE__ */ Y(To, {
|
|
4199
4190
|
label: t,
|
|
4200
|
-
children: /* @__PURE__ */ Y(
|
|
4191
|
+
children: /* @__PURE__ */ Y(yt, {
|
|
4201
4192
|
name: e.avatar.name,
|
|
4202
4193
|
src: e.avatar.src,
|
|
4203
4194
|
size: "xs"
|
|
4204
4195
|
})
|
|
4205
|
-
}) : e.content === "alert" ? /* @__PURE__ */ Y(
|
|
4196
|
+
}) : e.content === "alert" ? /* @__PURE__ */ Y(Ot, {
|
|
4206
4197
|
text: e.alertLabel,
|
|
4207
4198
|
level: e.level
|
|
4208
|
-
}) : e.content === "balance" ? /* @__PURE__ */ Y(
|
|
4209
|
-
},
|
|
4199
|
+
}) : e.content === "balance" ? /* @__PURE__ */ Y(Eo, { balance: e.balance }) : null;
|
|
4200
|
+
}, Oo = (e) => {
|
|
4210
4201
|
let { heading: t, label: n, content: r, shouldFadeContent: i = !1, fadeTransition: a } = e;
|
|
4211
4202
|
return /* @__PURE__ */ X("div", {
|
|
4212
4203
|
className: "flex flex-1 flex-col gap-2",
|
|
4213
4204
|
children: [
|
|
4214
4205
|
/* @__PURE__ */ Y("span", {
|
|
4215
|
-
className: y(
|
|
4206
|
+
className: y(bo()),
|
|
4216
4207
|
children: t
|
|
4217
4208
|
}),
|
|
4218
4209
|
/* @__PURE__ */ Y(s.div, {
|
|
4219
4210
|
className: "flex flex-1 flex-col justify-end gap-2",
|
|
4220
4211
|
animate: { opacity: +!i },
|
|
4221
4212
|
transition: a,
|
|
4222
|
-
children: /* @__PURE__ */ Y(
|
|
4213
|
+
children: /* @__PURE__ */ Y(Do, { ...e })
|
|
4223
4214
|
}),
|
|
4224
|
-
n && !
|
|
4225
|
-
className: y(
|
|
4215
|
+
n && !wo.has(r) ? /* @__PURE__ */ Y(s.span, {
|
|
4216
|
+
className: y(So()),
|
|
4226
4217
|
animate: { opacity: +!i },
|
|
4227
4218
|
transition: a,
|
|
4228
4219
|
children: n
|
|
4229
4220
|
}) : null
|
|
4230
4221
|
]
|
|
4231
4222
|
});
|
|
4232
|
-
},
|
|
4223
|
+
}, ko = {
|
|
4233
4224
|
positive: {
|
|
4234
4225
|
stroke: "hsl(var(--positive-50))",
|
|
4235
4226
|
fill: "hsl(var(--positive-50))",
|
|
@@ -4246,18 +4237,18 @@ var _o = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4246
4237
|
border: "border-f1-border"
|
|
4247
4238
|
}
|
|
4248
4239
|
};
|
|
4249
|
-
function
|
|
4240
|
+
function Ao(e, t) {
|
|
4250
4241
|
let n = e[0]?.value ?? 0, r = e[e.length - 1]?.value ?? 0, i = Math.sign(r - n), a = t ? i * -1 : i;
|
|
4251
4242
|
return a > 0 ? "positive" : a < 0 ? "negative" : "neutral";
|
|
4252
4243
|
}
|
|
4253
|
-
var
|
|
4244
|
+
var jo = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 || e == null || t == null ? null : /* @__PURE__ */ Y("circle", {
|
|
4254
4245
|
cx: e,
|
|
4255
4246
|
cy: t,
|
|
4256
4247
|
r: 2,
|
|
4257
4248
|
fill: i,
|
|
4258
4249
|
stroke: "none"
|
|
4259
|
-
}),
|
|
4260
|
-
let n =
|
|
4250
|
+
}), Mo = ({ label: e, direction: t }) => {
|
|
4251
|
+
let n = ko[t];
|
|
4261
4252
|
return /* @__PURE__ */ Y("span", {
|
|
4262
4253
|
className: y("absolute right-0 inline-flex items-center rounded-full border border-solid bg-f1-background px-1.5 py-px text-xs font-medium shadow", t === "negative" ? "bottom-0 translate-y-full" : "top-0 -translate-y-full", n.border, {
|
|
4263
4254
|
positive: "text-f1-foreground-positive",
|
|
@@ -4267,18 +4258,18 @@ var Ao = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4267
4258
|
"data-testid": "sparkline-balance",
|
|
4268
4259
|
children: e
|
|
4269
4260
|
});
|
|
4270
|
-
},
|
|
4271
|
-
let r = `sparkline-gradient-${
|
|
4261
|
+
}, No = ({ data: e, label: t, invertStatus: n }) => {
|
|
4262
|
+
let r = `sparkline-gradient-${Gt().replace(/:/g, "")}`, i = Ao(e, n), a = ko[i];
|
|
4272
4263
|
return /* @__PURE__ */ Y("div", {
|
|
4273
4264
|
className: "flex flex-1 flex-col",
|
|
4274
4265
|
children: /* @__PURE__ */ X("div", {
|
|
4275
4266
|
className: "relative w-full flex-1",
|
|
4276
4267
|
role: "img",
|
|
4277
4268
|
"aria-label": `Sparkline chart showing ${i} trend`,
|
|
4278
|
-
children: [/* @__PURE__ */ Y(
|
|
4269
|
+
children: [/* @__PURE__ */ Y(dt, {
|
|
4279
4270
|
width: "100%",
|
|
4280
4271
|
height: "100%",
|
|
4281
|
-
children: /* @__PURE__ */ X(
|
|
4272
|
+
children: /* @__PURE__ */ X(ye, {
|
|
4282
4273
|
data: e,
|
|
4283
4274
|
margin: {
|
|
4284
4275
|
top: 4,
|
|
@@ -4303,11 +4294,11 @@ var Ao = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4303
4294
|
stopOpacity: .02
|
|
4304
4295
|
})]
|
|
4305
4296
|
}) }),
|
|
4306
|
-
/* @__PURE__ */ Y(
|
|
4297
|
+
/* @__PURE__ */ Y(R, {
|
|
4307
4298
|
hide: !0,
|
|
4308
4299
|
domain: ["dataMin - 1", "dataMax + 1"]
|
|
4309
4300
|
}),
|
|
4310
|
-
/* @__PURE__ */ Y(
|
|
4301
|
+
/* @__PURE__ */ Y(Te, {
|
|
4311
4302
|
type: "linear",
|
|
4312
4303
|
dataKey: "value",
|
|
4313
4304
|
stroke: a.stroke,
|
|
@@ -4315,7 +4306,7 @@ var Ao = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4315
4306
|
fill: `url(#${r})`,
|
|
4316
4307
|
fillOpacity: 1,
|
|
4317
4308
|
isAnimationActive: !1,
|
|
4318
|
-
dot: (t) => /* @__PURE__ */
|
|
4309
|
+
dot: (t) => /* @__PURE__ */ Ht(jo, {
|
|
4319
4310
|
...t,
|
|
4320
4311
|
key: t.index,
|
|
4321
4312
|
dataLength: e.length,
|
|
@@ -4325,14 +4316,14 @@ var Ao = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4325
4316
|
})
|
|
4326
4317
|
]
|
|
4327
4318
|
})
|
|
4328
|
-
}), /* @__PURE__ */ Y(
|
|
4319
|
+
}), /* @__PURE__ */ Y(Mo, {
|
|
4329
4320
|
label: t,
|
|
4330
4321
|
direction: i
|
|
4331
4322
|
})]
|
|
4332
4323
|
})
|
|
4333
4324
|
});
|
|
4334
|
-
},
|
|
4335
|
-
let { description: r, heading: i, label: a, selected: o = !1, onClick: c, onAskOne: l, className: u, ...d } = e, [f, p] =
|
|
4325
|
+
}, Po = H((e, n) => {
|
|
4326
|
+
let { description: r, heading: i, label: a, selected: o = !1, onClick: c, onAskOne: l, className: u, ...d } = e, [f, p] = q(!1), [m, h] = q(!1), g = f || m, _ = t(), v = g && !!l, x = {
|
|
4336
4327
|
duration: _ ? 0 : .2,
|
|
4337
4328
|
ease: [
|
|
4338
4329
|
.33,
|
|
@@ -4343,7 +4334,7 @@ var Ao = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4343
4334
|
};
|
|
4344
4335
|
return /* @__PURE__ */ X("div", {
|
|
4345
4336
|
className: "relative",
|
|
4346
|
-
children: [o ? /* @__PURE__ */ X(
|
|
4337
|
+
children: [o ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", {
|
|
4347
4338
|
"data-testid": "selected-border",
|
|
4348
4339
|
className: y("absolute -inset-px rounded-2xl", "[--gradient-angle:0deg]", "bg-[conic-gradient(from_var(--gradient-angle),hsla(229,57%,76%,0.7),hsla(348,80%,50%,0.7),hsla(348,80%,50%,0.7),hsla(18,80%,50%,0.7),hsla(229,57%,76%,0.7),hsla(229,57%,76%,0.7))]", "animate-rotate-gradient")
|
|
4349
4340
|
}), /* @__PURE__ */ Y("div", {
|
|
@@ -4353,7 +4344,7 @@ var Ao = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4353
4344
|
ref: n,
|
|
4354
4345
|
role: c ? "button" : void 0,
|
|
4355
4346
|
tabIndex: c ? 0 : void 0,
|
|
4356
|
-
className: y(
|
|
4347
|
+
className: y(yo({ selected: o }), o && "relative border-transparent", c && "cursor-pointer select-none", c && b(), u),
|
|
4357
4348
|
onClick: c ? () => {
|
|
4358
4349
|
c?.();
|
|
4359
4350
|
} : void 0,
|
|
@@ -4364,26 +4355,26 @@ var Ao = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4364
4355
|
onMouseLeave: () => p(!1),
|
|
4365
4356
|
onFocus: () => h(!0),
|
|
4366
4357
|
onBlur: () => h(!1),
|
|
4367
|
-
children: [/* @__PURE__ */ Y(
|
|
4358
|
+
children: [/* @__PURE__ */ Y(Co, {
|
|
4368
4359
|
description: r,
|
|
4369
4360
|
isRevealed: g,
|
|
4370
4361
|
onAskOne: l
|
|
4371
4362
|
}), d.content === "sparkline" ? /* @__PURE__ */ X("div", {
|
|
4372
4363
|
className: "flex flex-1 flex-col gap-2",
|
|
4373
4364
|
children: [/* @__PURE__ */ Y("span", {
|
|
4374
|
-
className: y(
|
|
4365
|
+
className: y(bo()),
|
|
4375
4366
|
children: i
|
|
4376
4367
|
}), /* @__PURE__ */ Y(s.div, {
|
|
4377
4368
|
className: "-ml-4 flex flex-1 flex-col",
|
|
4378
4369
|
animate: { opacity: +!v },
|
|
4379
4370
|
transition: x,
|
|
4380
|
-
children: /* @__PURE__ */ Y(
|
|
4371
|
+
children: /* @__PURE__ */ Y(No, {
|
|
4381
4372
|
data: d.data,
|
|
4382
4373
|
label: a ?? "",
|
|
4383
4374
|
invertStatus: d.invertStatus
|
|
4384
4375
|
})
|
|
4385
4376
|
})]
|
|
4386
|
-
}) : /* @__PURE__ */ Y(
|
|
4377
|
+
}) : /* @__PURE__ */ Y(Oo, {
|
|
4387
4378
|
heading: i,
|
|
4388
4379
|
label: a,
|
|
4389
4380
|
shouldFadeContent: v,
|
|
@@ -4393,21 +4384,21 @@ var Ao = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4393
4384
|
})]
|
|
4394
4385
|
});
|
|
4395
4386
|
});
|
|
4396
|
-
|
|
4387
|
+
Po.displayName = "F0AiInsightCardInternal";
|
|
4397
4388
|
//#endregion
|
|
4398
4389
|
//#region src/addons/ai/ai/F0AiInsightCard/F0AiInsightCard.tsx
|
|
4399
|
-
var
|
|
4400
|
-
let n =
|
|
4390
|
+
var Fo = ["className"], Io = H((e, t) => {
|
|
4391
|
+
let n = Fo.reduce((e, t) => {
|
|
4401
4392
|
let { [t]: n, ...r } = e;
|
|
4402
4393
|
return r;
|
|
4403
4394
|
}, e);
|
|
4404
|
-
return /* @__PURE__ */ Y(
|
|
4395
|
+
return /* @__PURE__ */ Y(Po, {
|
|
4405
4396
|
ref: t,
|
|
4406
4397
|
...n
|
|
4407
4398
|
});
|
|
4408
4399
|
});
|
|
4409
|
-
|
|
4410
|
-
var
|
|
4400
|
+
Io.displayName = "F0AiInsightCard";
|
|
4401
|
+
var Lo = a(Ne(Io, () => /* @__PURE__ */ X("div", {
|
|
4411
4402
|
className: "flex w-[217px] h-[200px] flex-col gap-2 rounded-2xl border border-solid border-f1-border-secondary bg-f1-background p-4",
|
|
4412
4403
|
"aria-busy": "true",
|
|
4413
4404
|
"aria-live": "polite",
|
|
@@ -4421,7 +4412,7 @@ var Io = a(z(Fo, () => /* @__PURE__ */ X("div", {
|
|
|
4421
4412
|
children: [/* @__PURE__ */ Y(d, { className: "h-5 w-5 rounded-full" }), /* @__PURE__ */ Y(d, { className: "h-3 w-20 rounded" })]
|
|
4422
4413
|
})]
|
|
4423
4414
|
})]
|
|
4424
|
-
}))),
|
|
4415
|
+
}))), Ro = [
|
|
4425
4416
|
"text",
|
|
4426
4417
|
"person",
|
|
4427
4418
|
"people",
|
|
@@ -4430,10 +4421,10 @@ var Io = a(z(Fo, () => /* @__PURE__ */ X("div", {
|
|
|
4430
4421
|
"alert",
|
|
4431
4422
|
"balance",
|
|
4432
4423
|
"sparkline"
|
|
4433
|
-
],
|
|
4434
|
-
function
|
|
4435
|
-
let { module: t, heading: n, title: r, subtitle: i, description: a, seeMoreLabel: s, maxCollapsedDescriptionLength: c =
|
|
4436
|
-
return
|
|
4424
|
+
], zo = 180, Bo = (e) => Number.isFinite(e) ? Math.max(0, Math.floor(e)) : zo, Vo = (e, t) => e.length <= t ? e : `${e.slice(0, t).trimEnd()}...`, Ho = (e) => e.showActions !== !1, Uo = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWith("data-")));
|
|
4425
|
+
function Wo(e) {
|
|
4426
|
+
let { module: t, heading: n, title: r, subtitle: i, description: a, seeMoreLabel: s, maxCollapsedDescriptionLength: c = zo } = e, [l, u] = q(!1), d = Gt(), f = K(null), p = Bo(c), m = a.length > p, h = l ? a : Vo(a, p), g = Ho(e) ? e : null, _ = Uo(e);
|
|
4427
|
+
return W(() => {
|
|
4437
4428
|
l && f.current?.focus();
|
|
4438
4429
|
}, [l]), /* @__PURE__ */ X("section", {
|
|
4439
4430
|
className: "overflow-hidden rounded-xl border border-solid border-f1-border-secondary bg-f1-background",
|
|
@@ -4441,7 +4432,7 @@ function Uo(e) {
|
|
|
4441
4432
|
children: [
|
|
4442
4433
|
/* @__PURE__ */ X("div", {
|
|
4443
4434
|
className: "flex items-center gap-3 px-4 py-3",
|
|
4444
|
-
children: [t ? /* @__PURE__ */ Y(
|
|
4435
|
+
children: [t ? /* @__PURE__ */ Y(ht, {
|
|
4445
4436
|
module: t,
|
|
4446
4437
|
size: "md"
|
|
4447
4438
|
}) : null, /* @__PURE__ */ X("div", {
|
|
@@ -4465,7 +4456,7 @@ function Uo(e) {
|
|
|
4465
4456
|
ref: f,
|
|
4466
4457
|
tabIndex: l ? -1 : void 0,
|
|
4467
4458
|
className: y("text-base text-f1-foreground whitespace-pre-wrap break-words", l && b(), !l && "inline"),
|
|
4468
|
-
children: [h, m && !l ? /* @__PURE__ */ X(
|
|
4459
|
+
children: [h, m && !l ? /* @__PURE__ */ X(J, { children: [" ", /* @__PURE__ */ Y("button", {
|
|
4469
4460
|
type: "button",
|
|
4470
4461
|
className: y("inline cursor-pointer rounded-none border-0 bg-transparent p-0 text-base text-f1-foreground underline underline-offset-2 hover:text-f1-foreground-secondary", b()),
|
|
4471
4462
|
"aria-controls": d,
|
|
@@ -4487,16 +4478,16 @@ function Uo(e) {
|
|
|
4487
4478
|
]
|
|
4488
4479
|
});
|
|
4489
4480
|
}
|
|
4490
|
-
|
|
4481
|
+
Wo.displayName = "F0AiProposalCard";
|
|
4491
4482
|
//#endregion
|
|
4492
4483
|
//#region src/blocks/ai/F0AiMessageSources/components/CollapsibleMessage.tsx
|
|
4493
|
-
var
|
|
4494
|
-
let [i, a] =
|
|
4495
|
-
return /* @__PURE__ */ X(
|
|
4484
|
+
var Go = ({ icon: e, title: n, children: r }) => {
|
|
4485
|
+
let [i, a] = q(!1), o = t();
|
|
4486
|
+
return /* @__PURE__ */ X(pe, {
|
|
4496
4487
|
className: "mb-1 w-full",
|
|
4497
4488
|
open: i,
|
|
4498
4489
|
onOpenChange: a,
|
|
4499
|
-
children: [/* @__PURE__ */ X(
|
|
4490
|
+
children: [/* @__PURE__ */ X(j, {
|
|
4500
4491
|
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",
|
|
4501
4492
|
children: [
|
|
4502
4493
|
/* @__PURE__ */ Y("span", {
|
|
@@ -4511,11 +4502,11 @@ var Wo = ({ icon: e, title: n, children: r }) => {
|
|
|
4511
4502
|
children: n
|
|
4512
4503
|
}),
|
|
4513
4504
|
/* @__PURE__ */ Y(u, {
|
|
4514
|
-
icon:
|
|
4505
|
+
icon: wt,
|
|
4515
4506
|
className: "h-4 w-4 transition-transform duration-200"
|
|
4516
4507
|
})
|
|
4517
4508
|
]
|
|
4518
|
-
}), /* @__PURE__ */ Y(
|
|
4509
|
+
}), /* @__PURE__ */ Y(ge, {
|
|
4519
4510
|
forceMount: !0,
|
|
4520
4511
|
className: "data-[state=open]:mt-3",
|
|
4521
4512
|
children: /* @__PURE__ */ Y(s.div, {
|
|
@@ -4539,25 +4530,25 @@ var Wo = ({ icon: e, title: n, children: r }) => {
|
|
|
4539
4530
|
})
|
|
4540
4531
|
})]
|
|
4541
4532
|
});
|
|
4542
|
-
},
|
|
4533
|
+
}, Ko = (e) => de[e] ?? Bt, qo = ({ iconName: e }) => e ? /* @__PURE__ */ Y("div", {
|
|
4543
4534
|
className: "mr-1 flex items-center justify-center",
|
|
4544
4535
|
children: /* @__PURE__ */ Y(u, {
|
|
4545
|
-
icon:
|
|
4536
|
+
icon: Ko(e),
|
|
4546
4537
|
size: "md",
|
|
4547
4538
|
color: "default"
|
|
4548
4539
|
})
|
|
4549
4540
|
}) : null;
|
|
4550
|
-
function
|
|
4541
|
+
function Jo({ sources: t, title: n }) {
|
|
4551
4542
|
let r = p();
|
|
4552
4543
|
if (!t || t.length === 0 || !Array.isArray(t)) return null;
|
|
4553
4544
|
let i = n ?? r.ai.resourcesGroupTitle;
|
|
4554
|
-
return /* @__PURE__ */ Y(
|
|
4555
|
-
icon:
|
|
4545
|
+
return /* @__PURE__ */ Y(Go, {
|
|
4546
|
+
icon: vt,
|
|
4556
4547
|
title: i,
|
|
4557
4548
|
children: /* @__PURE__ */ Y("div", {
|
|
4558
4549
|
className: "flex flex-col gap-1 rounded-lg border border-solid border-f1-border-secondary p-2",
|
|
4559
4550
|
children: t.map((t, n) => {
|
|
4560
|
-
let r = /* @__PURE__ */ Y(
|
|
4551
|
+
let r = /* @__PURE__ */ Y(qo, { iconName: t.icon });
|
|
4561
4552
|
return t.link ? /* @__PURE__ */ Y(e, {
|
|
4562
4553
|
"aria-label": t.title,
|
|
4563
4554
|
href: t.link,
|
|
@@ -4579,21 +4570,21 @@ function qo({ sources: t, title: n }) {
|
|
|
4579
4570
|
})
|
|
4580
4571
|
});
|
|
4581
4572
|
}
|
|
4582
|
-
|
|
4573
|
+
Jo.displayName = "F0AiMessageSources";
|
|
4583
4574
|
//#endregion
|
|
4584
4575
|
//#region src/addons/ai/ai/F0AiTableCard/F0AiTableCard.tsx
|
|
4585
|
-
async function
|
|
4586
|
-
let r =
|
|
4576
|
+
async function Yo(e, t, n) {
|
|
4577
|
+
let r = ot(e), i = t === "xlsx" ? await ue([{
|
|
4587
4578
|
name: "Data",
|
|
4588
4579
|
rows: r
|
|
4589
|
-
}]) : await
|
|
4590
|
-
|
|
4580
|
+
}]) : await se(r);
|
|
4581
|
+
E(i, `${n}.${t}`);
|
|
4591
4582
|
}
|
|
4592
|
-
function
|
|
4593
|
-
let r = p(), i =
|
|
4583
|
+
function Xo({ dataset: e, title: t, filename: n }) {
|
|
4584
|
+
let r = p(), i = K(null), a = t ?? r.ai.aiTable.title, o = U((e) => {
|
|
4594
4585
|
if (!i.current) return;
|
|
4595
4586
|
let t = n ?? (a.replace(/\s+/g, "_").toLowerCase() || "table");
|
|
4596
|
-
|
|
4587
|
+
Yo(i.current, e, t);
|
|
4597
4588
|
}, [a, n]);
|
|
4598
4589
|
return e.columns?.length ? /* @__PURE__ */ X(x, {
|
|
4599
4590
|
display: "flex",
|
|
@@ -4616,7 +4607,7 @@ function Yo({ dataset: e, title: t, filename: n }) {
|
|
|
4616
4607
|
tag: "h2",
|
|
4617
4608
|
className: "text-base font-medium capitalize text-f1-foreground",
|
|
4618
4609
|
children: a
|
|
4619
|
-
}), /* @__PURE__ */ Y(
|
|
4610
|
+
}), /* @__PURE__ */ Y(it, {
|
|
4620
4611
|
icon: B,
|
|
4621
4612
|
size: "md",
|
|
4622
4613
|
items: [{
|
|
@@ -4648,11 +4639,11 @@ function Yo({ dataset: e, title: t, filename: n }) {
|
|
|
4648
4639
|
})]
|
|
4649
4640
|
}) : null;
|
|
4650
4641
|
}
|
|
4651
|
-
|
|
4642
|
+
Xo.displayName = "F0AiTableCard";
|
|
4652
4643
|
//#endregion
|
|
4653
4644
|
//#region src/addons/ai/ai/F0AiChatHeader/components/CreditsPopover.tsx
|
|
4654
|
-
function
|
|
4655
|
-
let n = p(), [r, a] =
|
|
4645
|
+
function Zo({ credits: e, trigger: t }) {
|
|
4646
|
+
let n = p(), [r, a] = q(!1), [c, u] = q(!1), [d, f] = q(!1), [m, g] = q(null), y = U((t) => {
|
|
4656
4647
|
a(t), t && e?.fetchUsage && (u(!0), f(!1), e.fetchUsage().then((e) => {
|
|
4657
4648
|
g(e), f(!1);
|
|
4658
4649
|
}).catch(() => {
|
|
@@ -4672,7 +4663,7 @@ function Xo({ credits: e, trigger: t }) {
|
|
|
4672
4663
|
variant: "ghost",
|
|
4673
4664
|
hideLabel: !0,
|
|
4674
4665
|
label: n.t("ai.credits.title"),
|
|
4675
|
-
icon:
|
|
4666
|
+
icon: ze,
|
|
4676
4667
|
pressed: r
|
|
4677
4668
|
})
|
|
4678
4669
|
}), /* @__PURE__ */ X(l, {
|
|
@@ -4684,7 +4675,7 @@ function Xo({ credits: e, trigger: t }) {
|
|
|
4684
4675
|
className: "flex w-[324px] flex-col gap-3 rounded-md border border-solid border-f1-border-secondary p-3",
|
|
4685
4676
|
children: [x ? /* @__PURE__ */ X("div", {
|
|
4686
4677
|
className: "flex min-w-0 max-w-full flex-1 items-center gap-2 overflow-hidden text-left text-lg text-f1-foreground",
|
|
4687
|
-
children: [/* @__PURE__ */ Y(
|
|
4678
|
+
children: [/* @__PURE__ */ Y(yt, {
|
|
4688
4679
|
name: e.companyName ?? "",
|
|
4689
4680
|
src: e.companyLogoUrl,
|
|
4690
4681
|
size: "lg"
|
|
@@ -4723,7 +4714,7 @@ function Xo({ credits: e, trigger: t }) {
|
|
|
4723
4714
|
className: "text-sm text-f1-foreground-secondary",
|
|
4724
4715
|
children: n.t("ai.credits.creditsError")
|
|
4725
4716
|
}) : null,
|
|
4726
|
-
!c && !d && m ? /* @__PURE__ */ X(
|
|
4717
|
+
!c && !d && m ? /* @__PURE__ */ X(J, { children: [
|
|
4727
4718
|
/* @__PURE__ */ X("div", {
|
|
4728
4719
|
className: "flex justify-between",
|
|
4729
4720
|
children: [/* @__PURE__ */ Y("span", {
|
|
@@ -4770,7 +4761,7 @@ function Xo({ credits: e, trigger: t }) {
|
|
|
4770
4761
|
variant: "outlinePromote",
|
|
4771
4762
|
href: e.upgradePlanUrl,
|
|
4772
4763
|
label: n.t("ai.credits.upgradePlan"),
|
|
4773
|
-
icon:
|
|
4764
|
+
icon: _e
|
|
4774
4765
|
})]
|
|
4775
4766
|
}) : null]
|
|
4776
4767
|
})]
|
|
@@ -4779,7 +4770,7 @@ function Xo({ credits: e, trigger: t }) {
|
|
|
4779
4770
|
}
|
|
4780
4771
|
//#endregion
|
|
4781
4772
|
//#region src/addons/ai/ai/F0AiChatHeader/components/EmployeeCreditsPopover.tsx
|
|
4782
|
-
var
|
|
4773
|
+
var Qo = "linear-gradient(90deg, #E55619, #A1ADE5, #E51943, #E55619)", $o = ({ loading: e, error: n, data: r }) => {
|
|
4783
4774
|
let i = p(), a = t(), o = r && r.total > 0 ? Math.min(100, Math.round(r.used / r.total * 100)) : 0, c = r ? Math.max(0, r.total - r.used) : 0;
|
|
4784
4775
|
return /* @__PURE__ */ Y("div", {
|
|
4785
4776
|
className: "flex flex-col rounded border border-solid border-f1-border-secondary",
|
|
@@ -4827,7 +4818,7 @@ var Zo = "linear-gradient(90deg, #E55619, #A1ADE5, #E51943, #E55619)", Qo = ({ l
|
|
|
4827
4818
|
className: "h-full rounded-full",
|
|
4828
4819
|
style: {
|
|
4829
4820
|
width: `${o}%`,
|
|
4830
|
-
backgroundImage:
|
|
4821
|
+
backgroundImage: Qo,
|
|
4831
4822
|
backgroundSize: "300% 100%"
|
|
4832
4823
|
},
|
|
4833
4824
|
animate: a ? void 0 : { backgroundPosition: ["0% 0%", "100% 0%"] },
|
|
@@ -4853,8 +4844,8 @@ var Zo = "linear-gradient(90deg, #E55619, #A1ADE5, #E51943, #E55619)", Qo = ({ l
|
|
|
4853
4844
|
})
|
|
4854
4845
|
});
|
|
4855
4846
|
};
|
|
4856
|
-
function
|
|
4857
|
-
let n = p(), [r, a] =
|
|
4847
|
+
function es({ employeeCredits: e, trigger: t }) {
|
|
4848
|
+
let n = p(), [r, a] = q(!1), [o, s] = q(!1), [c, u] = q(!1), [d, f] = q(null), m = U((t) => {
|
|
4858
4849
|
a(t), t && e?.fetchUsage && (s(!0), u(!1), e.fetchUsage().then((e) => {
|
|
4859
4850
|
f(e), u(!1);
|
|
4860
4851
|
}).catch(() => {
|
|
@@ -4874,7 +4865,7 @@ function $o({ employeeCredits: e, trigger: t }) {
|
|
|
4874
4865
|
variant: "ghost",
|
|
4875
4866
|
hideLabel: !0,
|
|
4876
4867
|
label: n.t("ai.credits.title"),
|
|
4877
|
-
icon:
|
|
4868
|
+
icon: ze,
|
|
4878
4869
|
pressed: r
|
|
4879
4870
|
})
|
|
4880
4871
|
}), /* @__PURE__ */ X(l, {
|
|
@@ -4886,7 +4877,7 @@ function $o({ employeeCredits: e, trigger: t }) {
|
|
|
4886
4877
|
className: "flex w-[324px] flex-col gap-3 rounded-md border border-solid border-f1-border-secondary p-3",
|
|
4887
4878
|
children: [g ? /* @__PURE__ */ X("div", {
|
|
4888
4879
|
className: "flex min-w-0 max-w-full flex-1 items-center gap-2 overflow-hidden text-left text-lg text-f1-foreground",
|
|
4889
|
-
children: [/* @__PURE__ */ Y(
|
|
4880
|
+
children: [/* @__PURE__ */ Y(yt, {
|
|
4890
4881
|
name: e.companyName ?? "",
|
|
4891
4882
|
src: e.companyLogoUrl,
|
|
4892
4883
|
size: "lg"
|
|
@@ -4902,7 +4893,7 @@ function $o({ employeeCredits: e, trigger: t }) {
|
|
|
4902
4893
|
children: e.planName
|
|
4903
4894
|
}) : null]
|
|
4904
4895
|
})]
|
|
4905
|
-
}) : null, /* @__PURE__ */ Y(
|
|
4896
|
+
}) : null, /* @__PURE__ */ Y($o, {
|
|
4906
4897
|
loading: o,
|
|
4907
4898
|
error: c,
|
|
4908
4899
|
data: d
|
|
@@ -4912,18 +4903,18 @@ function $o({ employeeCredits: e, trigger: t }) {
|
|
|
4912
4903
|
}
|
|
4913
4904
|
//#endregion
|
|
4914
4905
|
//#region src/addons/ai/ai/F0AiChatHeader/F0AiChatHeader.tsx
|
|
4915
|
-
var
|
|
4906
|
+
var ts = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */ Y(es, {
|
|
4916
4907
|
employeeCredits: t,
|
|
4917
4908
|
trigger: n
|
|
4918
|
-
}) : e ? /* @__PURE__ */ Y(
|
|
4909
|
+
}) : e ? /* @__PURE__ */ Y(Zo, {
|
|
4919
4910
|
credits: e,
|
|
4920
4911
|
trigger: n
|
|
4921
|
-
}) : null,
|
|
4912
|
+
}) : null, ns = ts, rs = ({ historyEnabled: n = !1, title: r, currentThreadTitle: i, fullscreen: a = !1, lockVisualizationMode: o = !1, onToggleVisualizationMode: c, onClose: l, onNewChat: d, onOpenHistory: f, hasMessages: m = !1, credits: h, employeeCredits: g, compact: b = !1, actions: x }) => {
|
|
4922
4913
|
let C = p(), w = t(), { panelOverlays: T } = V(), E = !o && !T && /* @__PURE__ */ Y(_, {
|
|
4923
4914
|
variant: "ghost",
|
|
4924
4915
|
hideLabel: !0,
|
|
4925
4916
|
label: a ? C.ai.collapseChat : C.ai.expandChat,
|
|
4926
|
-
icon: a ?
|
|
4917
|
+
icon: a ? fe : ve,
|
|
4927
4918
|
onClick: c
|
|
4928
4919
|
}), D = /* @__PURE__ */ Y(_, {
|
|
4929
4920
|
variant: "ghost",
|
|
@@ -4975,7 +4966,7 @@ var es = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
4975
4966
|
className: "min-w-0 text-left",
|
|
4976
4967
|
children: i ?? C.ai.newConversation
|
|
4977
4968
|
}), /* @__PURE__ */ Y(u, {
|
|
4978
|
-
icon:
|
|
4969
|
+
icon: xt,
|
|
4979
4970
|
color: "default",
|
|
4980
4971
|
size: "md"
|
|
4981
4972
|
})]
|
|
@@ -4990,7 +4981,7 @@ var es = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
4990
4981
|
ease: "easeOut"
|
|
4991
4982
|
},
|
|
4992
4983
|
children: [
|
|
4993
|
-
/* @__PURE__ */ Y(
|
|
4984
|
+
/* @__PURE__ */ Y(ts, {
|
|
4994
4985
|
credits: h,
|
|
4995
4986
|
employeeCredits: g
|
|
4996
4987
|
}),
|
|
@@ -5020,10 +5011,10 @@ var es = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
5020
5011
|
variant: "ghost",
|
|
5021
5012
|
hideLabel: !0,
|
|
5022
5013
|
label: C.ai.startNewChat,
|
|
5023
|
-
icon:
|
|
5014
|
+
icon: z,
|
|
5024
5015
|
onClick: d
|
|
5025
5016
|
}) : null,
|
|
5026
|
-
/* @__PURE__ */ Y(
|
|
5017
|
+
/* @__PURE__ */ Y(ts, {
|
|
5027
5018
|
credits: h,
|
|
5028
5019
|
employeeCredits: g
|
|
5029
5020
|
}),
|
|
@@ -5036,25 +5027,25 @@ var es = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
5036
5027
|
};
|
|
5037
5028
|
//#endregion
|
|
5038
5029
|
//#region src/addons/ai/ai/F0AiChatHistory/utils.ts
|
|
5039
|
-
function
|
|
5030
|
+
function is(e) {
|
|
5040
5031
|
let t = new Date(e), n = /* @__PURE__ */ new Date();
|
|
5041
|
-
return
|
|
5032
|
+
return Re(t) ? "today" : Ke(t) ? "yesterday" : Mt(t, n) ? "thisMonth" : "older";
|
|
5042
5033
|
}
|
|
5043
|
-
function
|
|
5044
|
-
let r = new Date(e), i =
|
|
5045
|
-
if (
|
|
5046
|
-
if (
|
|
5047
|
-
let a = !
|
|
5048
|
-
return `${
|
|
5034
|
+
function as(e, t, n) {
|
|
5035
|
+
let r = new Date(e), i = zt(r, "p", { locale: n });
|
|
5036
|
+
if (Re(r)) return `${t.today}, ${i}`;
|
|
5037
|
+
if (Ke(r)) return `${t.yesterday}, ${i}`;
|
|
5038
|
+
let a = !Rt(r, /* @__PURE__ */ new Date());
|
|
5039
|
+
return `${zt(r, a ? "MMM d yyyy" : "MMM d", { locale: n })}, ${i}`;
|
|
5049
5040
|
}
|
|
5050
|
-
function
|
|
5041
|
+
function os(e) {
|
|
5051
5042
|
let t = {
|
|
5052
5043
|
today: [],
|
|
5053
5044
|
yesterday: [],
|
|
5054
5045
|
thisMonth: [],
|
|
5055
5046
|
older: []
|
|
5056
5047
|
};
|
|
5057
|
-
for (let n of e) t[
|
|
5048
|
+
for (let n of e) t[is(n.updatedAt)].push(n);
|
|
5058
5049
|
return [
|
|
5059
5050
|
"today",
|
|
5060
5051
|
"yesterday",
|
|
@@ -5067,14 +5058,14 @@ function as(e) {
|
|
|
5067
5058
|
}
|
|
5068
5059
|
//#endregion
|
|
5069
5060
|
//#region src/addons/ai/ai/F0AiChatHistory/components/ThreadItem.tsx
|
|
5070
|
-
function
|
|
5071
|
-
let l = p(), d =
|
|
5061
|
+
function ss({ thread: e, isPinned: t, isActive: n = !1, isPending: r = !1, onSelect: i, onPin: a, onUnpin: o, onDelete: s, className: c }) {
|
|
5062
|
+
let l = p(), d = Lt(), f = G(() => [{
|
|
5072
5063
|
label: t ? l.ai.unpinChat : l.ai.pinChat,
|
|
5073
|
-
icon: t ?
|
|
5064
|
+
icon: t ? ce : D,
|
|
5074
5065
|
onClick: () => t ? o(e.id) : a(e.id)
|
|
5075
5066
|
}, {
|
|
5076
5067
|
label: l.ai.deleteChat,
|
|
5077
|
-
icon:
|
|
5068
|
+
icon: re,
|
|
5078
5069
|
critical: !0,
|
|
5079
5070
|
onClick: () => s(e.id)
|
|
5080
5071
|
}], [
|
|
@@ -5083,7 +5074,7 @@ function os({ thread: e, isPinned: t, isActive: n = !1, isPending: r = !1, onSel
|
|
|
5083
5074
|
a,
|
|
5084
5075
|
o,
|
|
5085
5076
|
s
|
|
5086
|
-
]), m =
|
|
5077
|
+
]), m = G(() => as(e.updatedAt, {
|
|
5087
5078
|
today: l.ai.today,
|
|
5088
5079
|
yesterday: l.ai.yesterday
|
|
5089
5080
|
}, d), [
|
|
@@ -5129,13 +5120,13 @@ function os({ thread: e, isPinned: t, isActive: n = !1, isPending: r = !1, onSel
|
|
|
5129
5120
|
r ? /* @__PURE__ */ Y("div", {
|
|
5130
5121
|
className: "flex h-7 w-7 shrink-0 items-center justify-center",
|
|
5131
5122
|
"aria-label": l.ai.threadOptions,
|
|
5132
|
-
children: /* @__PURE__ */ Y(
|
|
5123
|
+
children: /* @__PURE__ */ Y(At, { size: "small" })
|
|
5133
5124
|
}) : /* @__PURE__ */ Y("div", {
|
|
5134
5125
|
className: y("hidden items-center", "group-hover:flex group-focus-within:flex", "has-[[aria-expanded=true]]:flex"),
|
|
5135
|
-
children: /* @__PURE__ */ Y(
|
|
5126
|
+
children: /* @__PURE__ */ Y(it, {
|
|
5136
5127
|
items: f,
|
|
5137
5128
|
children: /* @__PURE__ */ Y(_, {
|
|
5138
|
-
icon:
|
|
5129
|
+
icon: ee,
|
|
5139
5130
|
variant: "ghost",
|
|
5140
5131
|
size: "sm",
|
|
5141
5132
|
label: l.ai.threadOptions,
|
|
@@ -5148,10 +5139,10 @@ function os({ thread: e, isPinned: t, isActive: n = !1, isPending: r = !1, onSel
|
|
|
5148
5139
|
}
|
|
5149
5140
|
//#endregion
|
|
5150
5141
|
//#region src/addons/ai/ai/F0AiChatHistory/components/CollapsibleGroup.tsx
|
|
5151
|
-
function
|
|
5152
|
-
let [s, c] =
|
|
5142
|
+
function cs({ label: e, threads: t, pinnedIds: n, onSelect: r, onPin: i, onUnpin: a, onDelete: o }) {
|
|
5143
|
+
let [s, c] = q(!0), l = U(() => {
|
|
5153
5144
|
c((e) => !e);
|
|
5154
|
-
}, []), d =
|
|
5145
|
+
}, []), d = U((e) => {
|
|
5155
5146
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), l());
|
|
5156
5147
|
}, [l]);
|
|
5157
5148
|
return /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ X("div", {
|
|
@@ -5164,13 +5155,13 @@ function ss({ label: e, threads: t, pinnedIds: n, onSelect: r, onPin: i, onUnpin
|
|
|
5164
5155
|
className: "text-sm font-medium capitalize tracking-wide text-f1-foreground-secondary",
|
|
5165
5156
|
children: e
|
|
5166
5157
|
}), /* @__PURE__ */ Y(u, {
|
|
5167
|
-
icon: s ?
|
|
5158
|
+
icon: s ? xt : Tt,
|
|
5168
5159
|
color: "secondary",
|
|
5169
5160
|
size: "xs"
|
|
5170
5161
|
})]
|
|
5171
5162
|
}), s ? /* @__PURE__ */ Y("div", {
|
|
5172
5163
|
className: "flex flex-col",
|
|
5173
|
-
children: t.map((e) => /* @__PURE__ */ Y(
|
|
5164
|
+
children: t.map((e) => /* @__PURE__ */ Y(ss, {
|
|
5174
5165
|
thread: e,
|
|
5175
5166
|
isPinned: n.has(e.id),
|
|
5176
5167
|
onSelect: r,
|
|
@@ -5182,47 +5173,47 @@ function ss({ label: e, threads: t, pinnedIds: n, onSelect: r, onPin: i, onUnpin
|
|
|
5182
5173
|
}
|
|
5183
5174
|
//#endregion
|
|
5184
5175
|
//#region src/addons/ai/ai/F0AiChatHistory/components/ThreadListSkeleton.tsx
|
|
5185
|
-
var
|
|
5176
|
+
var ls = [
|
|
5186
5177
|
"w-3/5",
|
|
5187
5178
|
"w-4/5",
|
|
5188
5179
|
"w-2/5",
|
|
5189
5180
|
"w-3/4",
|
|
5190
5181
|
"w-1/2",
|
|
5191
5182
|
"w-2/3"
|
|
5192
|
-
],
|
|
5183
|
+
], us = ({ width: e }) => /* @__PURE__ */ Y("div", {
|
|
5193
5184
|
className: "flex items-center py-1.5 pl-1.5 pr-2",
|
|
5194
5185
|
children: /* @__PURE__ */ Y(d, { className: y("h-4 rounded", e) })
|
|
5195
|
-
}),
|
|
5186
|
+
}), ds = ({ titleWidth: e, rows: t }) => /* @__PURE__ */ X("div", {
|
|
5196
5187
|
className: "flex flex-col gap-0.5",
|
|
5197
5188
|
children: [/* @__PURE__ */ Y("div", {
|
|
5198
5189
|
className: "flex items-center p-1.5",
|
|
5199
5190
|
children: /* @__PURE__ */ Y(d, { className: y("h-3 rounded", e) })
|
|
5200
|
-
}), t.map((e, t) => /* @__PURE__ */ Y(
|
|
5191
|
+
}), t.map((e, t) => /* @__PURE__ */ Y(us, { width: e }, t))]
|
|
5201
5192
|
});
|
|
5202
|
-
function
|
|
5193
|
+
function fs() {
|
|
5203
5194
|
return /* @__PURE__ */ X("div", {
|
|
5204
5195
|
"aria-hidden": "true",
|
|
5205
5196
|
className: "flex flex-col gap-4",
|
|
5206
|
-
children: [/* @__PURE__ */ Y(
|
|
5197
|
+
children: [/* @__PURE__ */ Y(ds, {
|
|
5207
5198
|
titleWidth: "w-12",
|
|
5208
|
-
rows:
|
|
5209
|
-
}), /* @__PURE__ */ Y(
|
|
5199
|
+
rows: ls.slice(0, 2)
|
|
5200
|
+
}), /* @__PURE__ */ Y(ds, {
|
|
5210
5201
|
titleWidth: "w-24",
|
|
5211
|
-
rows:
|
|
5202
|
+
rows: ls
|
|
5212
5203
|
})]
|
|
5213
5204
|
});
|
|
5214
5205
|
}
|
|
5215
5206
|
//#endregion
|
|
5216
5207
|
//#region src/addons/ai/ai/F0AiChatHistory/F0AiChatHistory.tsx
|
|
5217
|
-
var
|
|
5218
|
-
let f = p(), [m, h] =
|
|
5219
|
-
|
|
5208
|
+
var ps = ({ onClose: t, onSelectThread: n, onNewChat: r, threads: i, isLoading: a, error: o, pinnedIds: s, onPinThread: c, onUnpinThread: l, onDeleteThread: d }) => {
|
|
5209
|
+
let f = p(), [m, h] = q("");
|
|
5210
|
+
W(() => {
|
|
5220
5211
|
let e = (e) => {
|
|
5221
5212
|
e.key === "Escape" && t();
|
|
5222
5213
|
};
|
|
5223
5214
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
5224
5215
|
}, [t]);
|
|
5225
|
-
let g =
|
|
5216
|
+
let g = G(() => ({
|
|
5226
5217
|
today: f.ai.today,
|
|
5227
5218
|
yesterday: f.ai.yesterday,
|
|
5228
5219
|
thisMonth: f.ai.thisMonth,
|
|
@@ -5232,18 +5223,18 @@ var fs = ({ onClose: t, onSelectThread: n, onNewChat: r, threads: i, isLoading:
|
|
|
5232
5223
|
f.ai.yesterday,
|
|
5233
5224
|
f.ai.thisMonth,
|
|
5234
5225
|
f.ai.older
|
|
5235
|
-
]), _ =
|
|
5226
|
+
]), _ = G(() => {
|
|
5236
5227
|
if (!m.trim()) return i;
|
|
5237
5228
|
let e = m.toLowerCase();
|
|
5238
5229
|
return i.filter((t) => t.title.toLowerCase().includes(e));
|
|
5239
|
-
}, [i, m]), b =
|
|
5230
|
+
}, [i, m]), b = G(() => _.filter((e) => s.has(e.id)), [_, s]), x = G(() => _.filter((e) => !s.has(e.id)), [_, s]), S = G(() => os(x), [x]), C = U((e, r) => {
|
|
5240
5231
|
n(e, r), t();
|
|
5241
|
-
}, [n, t]), w =
|
|
5232
|
+
}, [n, t]), w = U(() => {
|
|
5242
5233
|
r(), t();
|
|
5243
|
-
}, [r, t]), T =
|
|
5234
|
+
}, [r, t]), T = U((e) => {
|
|
5244
5235
|
d(e);
|
|
5245
5236
|
}, [d]), E = b.length > 0 || S.length > 0;
|
|
5246
|
-
return
|
|
5237
|
+
return Jt(/* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", {
|
|
5247
5238
|
className: "fixed inset-0 z-50 bg-f1-background-overlay animate-in fade-in-0",
|
|
5248
5239
|
onClick: t,
|
|
5249
5240
|
"aria-hidden": "true"
|
|
@@ -5257,7 +5248,7 @@ var fs = ({ onClose: t, onSelectThread: n, onNewChat: r, threads: i, isLoading:
|
|
|
5257
5248
|
children: [/* @__PURE__ */ X("div", {
|
|
5258
5249
|
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",
|
|
5259
5250
|
children: [/* @__PURE__ */ Y(u, {
|
|
5260
|
-
icon:
|
|
5251
|
+
icon: vt,
|
|
5261
5252
|
color: "secondary",
|
|
5262
5253
|
size: "md"
|
|
5263
5254
|
}), /* @__PURE__ */ Y("input", {
|
|
@@ -5278,7 +5269,7 @@ var fs = ({ onClose: t, onSelectThread: n, onNewChat: r, threads: i, isLoading:
|
|
|
5278
5269
|
children: /* @__PURE__ */ X("div", {
|
|
5279
5270
|
className: "flex w-full items-center gap-2",
|
|
5280
5271
|
children: [/* @__PURE__ */ Y(u, {
|
|
5281
|
-
icon:
|
|
5272
|
+
icon: z,
|
|
5282
5273
|
color: "default",
|
|
5283
5274
|
size: "md"
|
|
5284
5275
|
}), /* @__PURE__ */ Y(v, {
|
|
@@ -5288,7 +5279,7 @@ var fs = ({ onClose: t, onSelectThread: n, onNewChat: r, threads: i, isLoading:
|
|
|
5288
5279
|
})]
|
|
5289
5280
|
})
|
|
5290
5281
|
}),
|
|
5291
|
-
a ? /* @__PURE__ */ Y(
|
|
5282
|
+
a ? /* @__PURE__ */ Y(fs, {}) : null,
|
|
5292
5283
|
!a && o ? /* @__PURE__ */ Y("p", {
|
|
5293
5284
|
className: "py-8 text-center text-base text-f1-foreground-tertiary",
|
|
5294
5285
|
children: o
|
|
@@ -5297,7 +5288,7 @@ var fs = ({ onClose: t, onSelectThread: n, onNewChat: r, threads: i, isLoading:
|
|
|
5297
5288
|
className: "py-8 text-center text-base text-f1-foreground-tertiary",
|
|
5298
5289
|
children: f.ai.noPreviousChats
|
|
5299
5290
|
}) : null,
|
|
5300
|
-
!a && !o && b.length > 0 ? /* @__PURE__ */ Y(
|
|
5291
|
+
!a && !o && b.length > 0 ? /* @__PURE__ */ Y(cs, {
|
|
5301
5292
|
label: f.ai.pinnedChats,
|
|
5302
5293
|
threads: b,
|
|
5303
5294
|
pinnedIds: s,
|
|
@@ -5306,7 +5297,7 @@ var fs = ({ onClose: t, onSelectThread: n, onNewChat: r, threads: i, isLoading:
|
|
|
5306
5297
|
onUnpin: l,
|
|
5307
5298
|
onDelete: T
|
|
5308
5299
|
}) : null,
|
|
5309
|
-
!a && !o ? S.map((e) => /* @__PURE__ */ Y(
|
|
5300
|
+
!a && !o ? S.map((e) => /* @__PURE__ */ Y(cs, {
|
|
5310
5301
|
label: g[e.key],
|
|
5311
5302
|
threads: e.threads,
|
|
5312
5303
|
pinnedIds: s,
|
|
@@ -5319,16 +5310,16 @@ var fs = ({ onClose: t, onSelectThread: n, onNewChat: r, threads: i, isLoading:
|
|
|
5319
5310
|
})]
|
|
5320
5311
|
})
|
|
5321
5312
|
})] }), document.body);
|
|
5322
|
-
},
|
|
5323
|
-
function
|
|
5324
|
-
let e =
|
|
5313
|
+
}, ms = "f0-ai-pinned-threads";
|
|
5314
|
+
function hs() {
|
|
5315
|
+
let e = ae(ms, []);
|
|
5325
5316
|
return new Set(Array.isArray(e) ? e : []);
|
|
5326
5317
|
}
|
|
5327
|
-
function
|
|
5328
|
-
|
|
5318
|
+
function gs(e) {
|
|
5319
|
+
C(ms, [...e]);
|
|
5329
5320
|
}
|
|
5330
|
-
function
|
|
5331
|
-
let [a, o] =
|
|
5321
|
+
function _s({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, unpinThread: i }) {
|
|
5322
|
+
let [a, o] = q([]), [s, c] = q(!1), [l, u] = q(null), [d, f] = q(hs), [p, m] = q(() => /* @__PURE__ */ new Set()), h = U(async () => {
|
|
5332
5323
|
c(!0), u(null);
|
|
5333
5324
|
try {
|
|
5334
5325
|
let e = await t();
|
|
@@ -5340,22 +5331,22 @@ function gs({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, u
|
|
|
5340
5331
|
c(!1);
|
|
5341
5332
|
}
|
|
5342
5333
|
}, [t]);
|
|
5343
|
-
|
|
5334
|
+
W(() => {
|
|
5344
5335
|
e && h();
|
|
5345
5336
|
}, [e, h]);
|
|
5346
|
-
let g =
|
|
5337
|
+
let g = U((e, t) => {
|
|
5347
5338
|
f((n) => {
|
|
5348
5339
|
if (t === n.has(e)) return n;
|
|
5349
5340
|
let r = new Set(n);
|
|
5350
|
-
return t ? r.add(e) : r.delete(e),
|
|
5341
|
+
return t ? r.add(e) : r.delete(e), gs(r), r;
|
|
5351
5342
|
});
|
|
5352
|
-
}, []), _ =
|
|
5343
|
+
}, []), _ = U((e, t) => {
|
|
5353
5344
|
m((n) => {
|
|
5354
5345
|
if (t === n.has(e)) return n;
|
|
5355
5346
|
let r = new Set(n);
|
|
5356
5347
|
return t ? r.add(e) : r.delete(e), r;
|
|
5357
5348
|
});
|
|
5358
|
-
}, []), v =
|
|
5349
|
+
}, []), v = U((e, t) => {
|
|
5359
5350
|
let n = t ? r : i;
|
|
5360
5351
|
g(e, t), n && (_(e, !0), n(e).catch(() => g(e, !t)).finally(() => _(e, !1)));
|
|
5361
5352
|
}, [
|
|
@@ -5371,15 +5362,15 @@ function gs({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, u
|
|
|
5371
5362
|
refetch: h,
|
|
5372
5363
|
pinnedIds: d,
|
|
5373
5364
|
pendingIds: p,
|
|
5374
|
-
pinThread:
|
|
5375
|
-
unpinThread:
|
|
5376
|
-
deleteThread:
|
|
5365
|
+
pinThread: U((e) => v(e, !0), [v]),
|
|
5366
|
+
unpinThread: U((e) => v(e, !1), [v]),
|
|
5367
|
+
deleteThread: U(async (e) => {
|
|
5377
5368
|
_(e, !0);
|
|
5378
5369
|
try {
|
|
5379
5370
|
await n(e), o((t) => t.filter((t) => t.id !== e)), f((t) => {
|
|
5380
5371
|
if (!t.has(e)) return t;
|
|
5381
5372
|
let n = new Set(t);
|
|
5382
|
-
return n.delete(e),
|
|
5373
|
+
return n.delete(e), gs(n), n;
|
|
5383
5374
|
});
|
|
5384
5375
|
} catch {
|
|
5385
5376
|
h();
|
|
@@ -5395,11 +5386,11 @@ function gs({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, u
|
|
|
5395
5386
|
}
|
|
5396
5387
|
//#endregion
|
|
5397
5388
|
//#region src/addons/ai/ai/F0AiChatUsageLimits/types.ts
|
|
5398
|
-
var
|
|
5389
|
+
var vs = ["top", "bottom"], ys = s.create(ie), bs = ({ label: e, reduceMotion: t }) => /* @__PURE__ */ X("div", {
|
|
5399
5390
|
role: "status",
|
|
5400
5391
|
"aria-live": "polite",
|
|
5401
5392
|
className: "flex flex-row items-center gap-1 rounded-full border border-solid border-f1-border-secondary bg-f1-background px-2 py-1.5 pr-2.5 shadow-md",
|
|
5402
|
-
children: [/* @__PURE__ */ Y(
|
|
5393
|
+
children: [/* @__PURE__ */ Y(ys, {
|
|
5403
5394
|
size: "xs",
|
|
5404
5395
|
animate: t ? void 0 : {
|
|
5405
5396
|
rotate: [0, 360],
|
|
@@ -5448,9 +5439,9 @@ var _s = ["top", "bottom"], vs = s.create(k), ys = ({ label: e, reduceMotion: t
|
|
|
5448
5439
|
className: "font-medium",
|
|
5449
5440
|
children: e
|
|
5450
5441
|
})]
|
|
5451
|
-
}),
|
|
5442
|
+
}), xs = Ut(function({ active: e, label: r, className: i, children: a }) {
|
|
5452
5443
|
let { t: o } = p(), c = t(), l = r ?? o("ai.applyingChanges");
|
|
5453
|
-
return
|
|
5444
|
+
return W(() => {
|
|
5454
5445
|
if (!e) return;
|
|
5455
5446
|
let t = document.activeElement;
|
|
5456
5447
|
t && t.getAttribute("name") !== "one-ai-input" && t.blur();
|
|
@@ -5472,7 +5463,7 @@ var _s = ["top", "bottom"], vs = s.create(k), ys = ({ label: e, reduceMotion: t
|
|
|
5472
5463
|
},
|
|
5473
5464
|
children: /* @__PURE__ */ Y("div", {
|
|
5474
5465
|
className: "mt-[40vh]",
|
|
5475
|
-
children: /* @__PURE__ */ Y(
|
|
5466
|
+
children: /* @__PURE__ */ Y(bs, {
|
|
5476
5467
|
label: l,
|
|
5477
5468
|
reduceMotion: c
|
|
5478
5469
|
})
|
|
@@ -5487,4 +5478,4 @@ var _s = ["top", "bottom"], vs = s.create(k), ys = ({ label: e, reduceMotion: t
|
|
|
5487
5478
|
});
|
|
5488
5479
|
});
|
|
5489
5480
|
//#endregion
|
|
5490
|
-
export {
|
|
5481
|
+
export { Fr as A, Yi as C, Hr as D, Vr as E, zn as F, Mn as I, fn as L, Nr as M, Pr as N, Ur as O, Tr as P, Qt as R, $i as S, mi as T, Oa as _, fs as a, ta as b, ns as c, Jo as d, Wo as f, _o as g, vo as h, ps as i, jr as j, zr as k, rs as l, Lo as m, vs as n, cs as o, Ro as p, _s as r, ss as s, xs as t, Xo as u, ya as v, Si as w, na as x, ia as y, Zt as z };
|