@factorialco/f0-react 10.13.0 → 10.14.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-Dxf_Nbbb.js → ChatPostComposerDialog-BxrYZgeD.js} +3 -3
- package/dist/{CoachmarkProvider-ByfCE0-j.js → CoachmarkProvider-B7vf6Rf8.js} +16122 -16128
- package/dist/{DocumentToolbar-UFkOiw8e.js → DocumentToolbar-i88m83fN.js} +5 -5
- package/dist/{DocxViewer-BjmzL4sn.js → DocxViewer-0VrDUDdP.js} +2 -2
- package/dist/{F0AiProcessingOverlay-B2kWuLdK.js → F0AiProcessingOverlay-E542wxCh.js} +466 -466
- package/dist/{F0CanvasPanel-9PijExob.js → F0CanvasPanel-Bcfvnx7a.js} +7368 -7340
- package/dist/{F0DocumentViewer-hMDS3Kpg.js → F0DocumentViewer-7wJ_GR18.js} +9 -9
- package/dist/F0DocumentViewer-CaYCivnb.js +3 -0
- package/dist/{F0Map-CznQg3YF.js → F0Map-D962E1Hx.js} +845 -607
- package/dist/{F0Select-By_QpX1S.js → F0Select-CFbVOJB3.js} +73 -73
- package/dist/{F0Box-CYL5_Zhb.js → F0Text-Bh96xM7I.js} +103 -96
- package/dist/{F0VideoPlayer-BByW1cIV.js → F0VideoPlayer-CFnv7V_M.js} +279 -279
- package/dist/F0VideoPlayer-Cog2q9vj.js +1 -0
- package/dist/{Map-DZ1yBUGL.js → Map-Ceow_6Vn.js} +53 -52
- package/dist/{PdfThumbnail-Dkwm6GDn.js → PdfThumbnail-D3CBg0nq.js} +1 -1
- package/dist/{SheetViewer-DT6WypD8.js → SheetViewer-CaBKc6ul.js} +4 -4
- package/dist/{TextViewer-D8MLMNev.js → TextViewer-C25UYWuA.js} +2 -2
- package/dist/ai.d.ts +3 -3
- package/dist/ai.js +4 -4
- package/dist/component-status.js +26 -26
- package/dist/{dist-CUsub1Mu.js → dist-Ck_UA8Lz.js} +1 -1
- package/dist/{dist-CSP_0yKt.js → dist-Cuwaibqg.js} +2 -1
- package/dist/experimental.d.ts +216 -115
- package/dist/experimental.js +5917 -4716
- package/dist/{exports-0B2luDkl.d.ts → exports-CUQ_f1Aq.d.ts} +1 -1
- package/dist/f0.d.ts +4 -4
- package/dist/f0.js +704 -704
- package/dist/{google-B7uAYsxU.js → google-D1V0swd7.js} +1 -1
- package/dist/{i18n-provider-defaults-BA2_-hRH.js → i18n-provider-defaults-Ch0JDGbK.js} +12 -3
- package/dist/{i18n-provider-defaults-m88KkXdP.d.ts → i18n-provider-defaults-D1lWzbYx.d.ts} +14 -1
- package/dist/i18n-provider-defaults.d.ts +1 -1
- package/dist/i18n-provider-defaults.js +1 -1
- package/dist/{index-Bdpf44A3.d.ts → index--CBjax6U.d.ts} +2 -2
- package/dist/{index-s5SdT3uE.d.ts → index-2J8R9Uml.d.ts} +3 -1
- package/dist/{maplibre-GffVTD0r.js → maplibre-BUEHHCOT.js} +2 -2
- package/dist/{pdfWorker-C3UVNtZV.js → pdfWorker-BbJO4zuj.js} +2 -2
- package/dist/{popover-B7fqB9lu.js → popover-DNcAIP25.js} +20 -20
- package/dist/styles.css +1 -1
- package/dist/{tooltip-TOvfXq9F.js → tooltip-BX4dSfeL.js} +338 -247
- package/dist/{useData-CAl9SKtE.js → useData-zygrn6e-.js} +950 -949
- package/package.json +2 -2
- package/dist/F0DocumentViewer-DDaXV0U3.js +0 -3
- package/dist/F0VideoPlayer-DerqL5g5.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-
|
|
2
|
-
import {
|
|
3
|
-
import { n as x,
|
|
4
|
-
import { $a as C, $n as w, $
|
|
5
|
-
import { t as
|
|
6
|
-
import { C as ft,
|
|
7
|
-
import { Dn as
|
|
8
|
-
import { n as
|
|
9
|
-
import { createContext as
|
|
10
|
-
import { Fragment as
|
|
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-DNcAIP25.js";
|
|
2
|
+
import { L as y, R as b } from "./tooltip-BX4dSfeL.js";
|
|
3
|
+
import { n as x, r as S } from "./F0Text-Bh96xM7I.js";
|
|
4
|
+
import { $a as C, $n as w, $r as T, Ao as E, B as D, Bo as O, C as ee, Dt as k, Es as A, F as j, Fr as M, Gr as N, Ha as P, Ho as F, Hr as I, Lo as te, Lt as ne, M as re, Ms as L, Mt as R, N as ie, Oa as z, Os as B, P as ae, Q as oe, R as V, Ra as se, Ri as ce, S as le, So as ue, St as H, Tt as de, Ur as fe, V as pe, Wr as me, Ya as he, Yo as ge, Yr as _e, Z as ve, Zr as ye, _a as be, _o as xe, a as Se, at as Ce, bt as we, cc as Te, ct as Ee, d as De, eo as Oe, es as ke, et as Ae, fa as je, fr as Me, g as Ne, h as Pe, i as Fe, kt as Ie, l as Le, lc as Re, lt as ze, m as Be, no as Ve, nt as He, o as Ue, ot as We, pa as Ge, po as Ke, pr as qe, pt as Je, qn as Ye, r as Xe, rr as Ze, to as Qe, tt as $e, u as et, ut as tt, vt as nt, w as rt, x as it, xo as at, xt as ot, yo as st, yt as ct, z as lt } from "./F0CanvasPanel-Bcfvnx7a.js";
|
|
5
|
+
import { t as ut } from "./i18n-provider-defaults-Ch0JDGbK.js";
|
|
6
|
+
import { C as dt, D as ft, F as pt, J as mt, S as ht, V as gt, k as _t, l as vt, q as yt, x as bt } from "./useData-zygrn6e-.js";
|
|
7
|
+
import { Dn as xt, Dr as St, Er as Ct, Ft as wt, Nr as Tt, On as Et, Or as Dt, Ot, _t as kt, cn as At, ct as jt, gt as Mt, ht as Nt, jr as Pt, nn as Ft, sn as It, un as Lt } from "./F0Select-CFbVOJB3.js";
|
|
8
|
+
import { n as Rt } from "./dist-Ck_UA8Lz.js";
|
|
9
|
+
import { createContext as zt, createElement as Bt, forwardRef as U, memo as Vt, useCallback as W, useContext as Ht, useEffect as G, useId as Ut, useInsertionEffect as Wt, useLayoutEffect as Gt, useMemo as K, useRef as q, useState as J } from "react";
|
|
10
|
+
import { Fragment as Kt, jsx as Y, jsxs as X } from "react/jsx-runtime";
|
|
11
11
|
import { createPortal as qt } from "react-dom";
|
|
12
12
|
import { useTrackVolume as Jt } 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
14
|
function Yt(e, t, n) {
|
|
15
|
-
|
|
15
|
+
Wt(() => e.on(t, n), [
|
|
16
16
|
e,
|
|
17
17
|
t,
|
|
18
18
|
n
|
|
@@ -30,10 +30,10 @@ var Xt = [
|
|
|
30
30
|
"sm",
|
|
31
31
|
"md",
|
|
32
32
|
"lg"
|
|
33
|
-
], Qt = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), $t = /[\\`*_{}[\]()#+\-.!|~>]/g, en = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace($t, "\\$&"), tn = (e) => `<entity-ref type="${Qt(e.type)}" id="${Qt(e.id)}">${Qt(e.label)}</entity-ref>`, nn = (e, t) => e.slice(t.start,
|
|
33
|
+
], Qt = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), $t = /[\\`*_{}[\]()#+\-.!|~>]/g, en = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace($t, "\\$&"), tn = (e) => `<entity-ref type="${Qt(e.type)}" id="${Qt(e.id)}">${Qt(e.label)}</entity-ref>`, nn = (e, t) => e.slice(t.start, pe(t)).normalize("NFC") === `@${t.label}`.normalize("NFC");
|
|
34
34
|
function rn(e, t) {
|
|
35
35
|
let n = e.length - e.trimStart().length, r = e.trimEnd().length, i = t.filter((t) => t.start >= n && nn(e, t)).sort((e, t) => e.start - t.start), a = "", o = n;
|
|
36
|
-
for (let t of i) t.start < o ||
|
|
36
|
+
for (let t of i) t.start < o || pe(t) > r || (a += en(e.slice(o, t.start)) + tn(t), o = pe(t));
|
|
37
37
|
return a + en(e.slice(o, r));
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
@@ -110,7 +110,7 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
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
112
|
}), dn = ({ usage: e, error: t = !1, onOpenChange: n, trigger: r, side: a = "top" }) => {
|
|
113
|
-
let o = p(), [s, c] =
|
|
113
|
+
let o = p(), [s, c] = J(!1), d = q(null), f = W((e) => {
|
|
114
114
|
c(e), n?.(e);
|
|
115
115
|
}, [n]), m = e ? ln(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, {
|
|
@@ -163,7 +163,7 @@ 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: St,
|
|
167
167
|
size: "md",
|
|
168
168
|
color: "default"
|
|
169
169
|
})]
|
|
@@ -181,12 +181,12 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
181
181
|
});
|
|
182
182
|
}, fn = (e) => {
|
|
183
183
|
let { provided: t } = $e();
|
|
184
|
-
return t ? /* @__PURE__ */ Y(pn, { ...e }) : /* @__PURE__ */ Y(
|
|
184
|
+
return t ? /* @__PURE__ */ Y(pn, { ...e }) : /* @__PURE__ */ Y(Ae, { children: /* @__PURE__ */ Y(pn, { ...e }) });
|
|
185
185
|
}, pn = ({ attachedFiles: e, isUploading: t, onRemove: n, removeLabel: r, reducedMotion: i }) => {
|
|
186
186
|
let a = p(), o = mn(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 || Ce({
|
|
190
190
|
name: i,
|
|
191
191
|
url: t
|
|
192
192
|
}), s = We({
|
|
@@ -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(ae, {
|
|
211
211
|
attachment: s,
|
|
212
212
|
status: e.status === "uploaded" ? "ready" : e.status === "error" ? "error" : "uploading",
|
|
213
213
|
errorMessage: e.errorMessage,
|
|
@@ -217,7 +217,7 @@ 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(ie, {
|
|
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,
|
|
@@ -225,10 +225,10 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
225
225
|
testIdPrefix: "ai-chat"
|
|
226
226
|
});
|
|
227
227
|
}, mn = (e) => {
|
|
228
|
-
let [t, n] =
|
|
229
|
-
return
|
|
228
|
+
let [t, n] = J(() => /* @__PURE__ */ new Map()), r = q(t);
|
|
229
|
+
return Gt(() => {
|
|
230
230
|
r.current = t;
|
|
231
|
-
}, [t]),
|
|
231
|
+
}, [t]), G(() => {
|
|
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,7 +238,7 @@ 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]), G(() => () => {
|
|
242
242
|
for (let e of r.current.values()) URL.revokeObjectURL(e);
|
|
243
243
|
r.current = /* @__PURE__ */ new Map();
|
|
244
244
|
}, []), t;
|
|
@@ -262,18 +262,18 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
262
262
|
let { id: t, type: n, ...r } = e;
|
|
263
263
|
return r;
|
|
264
264
|
}), gn = ({ actions: e, showAttachEntry: t, onAttachClick: n, attachDisabled: r, attachDisabledTooltip: i, disabled: a, onOpenChange: o }) => {
|
|
265
|
-
let s = p(), [c, l] =
|
|
265
|
+
let s = p(), [c, l] = J(!1), u = (e) => {
|
|
266
266
|
l(e), o?.(e);
|
|
267
267
|
}, d = [...t ? [{
|
|
268
268
|
label: s.ai.addFilesOrPhotos,
|
|
269
|
-
icon:
|
|
269
|
+
icon: E,
|
|
270
270
|
onClick: n,
|
|
271
271
|
disabled: r,
|
|
272
272
|
disabledTooltip: i
|
|
273
273
|
}, ...e.length > 0 ? [{ type: "separator" }] : []] : [], ...hn(e)];
|
|
274
274
|
return /* @__PURE__ */ Y("div", {
|
|
275
275
|
onClick: (e) => e.stopPropagation(),
|
|
276
|
-
children: /* @__PURE__ */ Y(
|
|
276
|
+
children: /* @__PURE__ */ Y(be, {
|
|
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: mt,
|
|
288
288
|
variant: "outline",
|
|
289
289
|
size: "md",
|
|
290
290
|
pressed: c,
|
|
@@ -294,7 +294,7 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
294
294
|
});
|
|
295
295
|
}, _n = ({ 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(Kt, { children: [f ? /* @__PURE__ */ Y(gn, {
|
|
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: E,
|
|
310
310
|
variant: "outline",
|
|
311
311
|
size: "md",
|
|
312
312
|
disabled: n || u,
|
|
@@ -354,7 +354,7 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
354
354
|
label: n.ai.creditWarning.dismiss ?? "",
|
|
355
355
|
size: "sm",
|
|
356
356
|
variant: "ghost",
|
|
357
|
-
icon:
|
|
357
|
+
icon: S,
|
|
358
358
|
hideLabel: !0,
|
|
359
359
|
onClick: e.onDismiss
|
|
360
360
|
}) : null]
|
|
@@ -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: xe,
|
|
378
378
|
size: "md",
|
|
379
379
|
color: "default"
|
|
380
380
|
})
|
|
@@ -388,7 +388,7 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
388
388
|
variant: "ghost",
|
|
389
389
|
label: n.ai.removeQuote,
|
|
390
390
|
onClick: t,
|
|
391
|
-
icon:
|
|
391
|
+
icon: S,
|
|
392
392
|
hideLabel: !0,
|
|
393
393
|
size: "sm"
|
|
394
394
|
})
|
|
@@ -397,7 +397,7 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
397
397
|
});
|
|
398
398
|
}, xn = ({ cards: e }) => e.length === 0 ? null : /* @__PURE__ */ Y("div", {
|
|
399
399
|
className: "grid w-full grid-cols-2 gap-3",
|
|
400
|
-
children: e.slice(0, 4).map((e) => /* @__PURE__ */ Y(
|
|
400
|
+
children: e.slice(0, 4).map((e) => /* @__PURE__ */ Y(re, {
|
|
401
401
|
avatar: {
|
|
402
402
|
type: "icon",
|
|
403
403
|
icon: e.icon
|
|
@@ -408,11 +408,11 @@ var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
|
408
408
|
}, e.id))
|
|
409
409
|
});
|
|
410
410
|
function Sn(e = 24) {
|
|
411
|
-
let [t, n] =
|
|
411
|
+
let [t, n] = J(null), [r, i] = J({
|
|
412
412
|
start: !1,
|
|
413
413
|
end: !1
|
|
414
414
|
});
|
|
415
|
-
return
|
|
415
|
+
return G(() => {
|
|
416
416
|
if (!t) return;
|
|
417
417
|
let e = () => {
|
|
418
418
|
let e = t.scrollWidth > t.clientWidth + 1;
|
|
@@ -430,7 +430,7 @@ function Sn(e = 24) {
|
|
|
430
430
|
};
|
|
431
431
|
}, [t]), {
|
|
432
432
|
ref: n,
|
|
433
|
-
style:
|
|
433
|
+
style: K(() => {
|
|
434
434
|
if (!r.start && !r.end) return {};
|
|
435
435
|
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%"})`;
|
|
436
436
|
return {
|
|
@@ -447,7 +447,7 @@ function On(e, t = Cn) {
|
|
|
447
447
|
return e.length <= t ? e : [...e].sort(() => .5 - Math.random()).slice(0, t);
|
|
448
448
|
}
|
|
449
449
|
var kn = ({ suggestions: e, onItemClick: t, onItemHover: n, side: r = "top", reserveTwoRows: i = !0, overflow: a = "wrap" }) => {
|
|
450
|
-
let [o, s] =
|
|
450
|
+
let [o, s] = J(null), c = q(null), d = a === "scroll", p = Sn(), m = q(null), g = q(!1), v = Ut(), b = Ut(), x = o === null ? null : e[o];
|
|
451
451
|
return e.length === 0 ? null : /* @__PURE__ */ X(h, {
|
|
452
452
|
open: x !== null,
|
|
453
453
|
onOpenChange: (e) => {
|
|
@@ -519,11 +519,11 @@ var kn = ({ suggestions: e, onItemClick: t, onItemHover: n, side: r = "top", res
|
|
|
519
519
|
});
|
|
520
520
|
};
|
|
521
521
|
function An({ item: e, onSelect: n, onHover: r }) {
|
|
522
|
-
let i =
|
|
522
|
+
let i = q(null), a = q(null), o = q(null), s = t(), c = W(() => {
|
|
523
523
|
o.current != null && (clearTimeout(o.current), o.current = null);
|
|
524
524
|
let e = a.current, t = i.current;
|
|
525
525
|
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"));
|
|
526
|
-
}, []), l =
|
|
526
|
+
}, []), l = W(() => {
|
|
527
527
|
s || (o.current = window.setTimeout(() => {
|
|
528
528
|
let e = a.current, t = i.current;
|
|
529
529
|
if (!e || !t) return;
|
|
@@ -534,16 +534,16 @@ function An({ item: e, onSelect: n, onHover: r }) {
|
|
|
534
534
|
let s = `linear-gradient(90deg, transparent 0, #000 ${Dn}px)`;
|
|
535
535
|
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)`;
|
|
536
536
|
}, Tn));
|
|
537
|
-
}, [s]), d =
|
|
537
|
+
}, [s]), d = W(() => {
|
|
538
538
|
r?.(e), l();
|
|
539
539
|
}, [
|
|
540
540
|
e,
|
|
541
541
|
r,
|
|
542
542
|
l
|
|
543
|
-
]), f =
|
|
543
|
+
]), f = W(() => {
|
|
544
544
|
r?.(null), c();
|
|
545
545
|
}, [r, c]);
|
|
546
|
-
return
|
|
546
|
+
return G(() => () => {
|
|
547
547
|
o.current != null && clearTimeout(o.current);
|
|
548
548
|
}, []), /* @__PURE__ */ X("button", {
|
|
549
549
|
type: "button",
|
|
@@ -565,7 +565,7 @@ function An({ item: e, onSelect: n, onHover: r }) {
|
|
|
565
565
|
"aria-hidden": !0,
|
|
566
566
|
className: "flex flex-shrink-0 items-center text-f1-foreground-secondary opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
567
567
|
children: /* @__PURE__ */ Y(u, {
|
|
568
|
-
icon:
|
|
568
|
+
icon: Pt,
|
|
569
569
|
size: "sm"
|
|
570
570
|
})
|
|
571
571
|
})]
|
|
@@ -593,7 +593,7 @@ function jn(e, t) {
|
|
|
593
593
|
}
|
|
594
594
|
function Mn({ searchPersons: e, mentionSources: t }) {
|
|
595
595
|
let { ai: n } = p(), r = n.mentions.people;
|
|
596
|
-
return
|
|
596
|
+
return K(() => {
|
|
597
597
|
let n = t ?? [];
|
|
598
598
|
return !e || n.some((e) => e.type === "person") ? n : [jn(e, { label: r }), ...n];
|
|
599
599
|
}, [
|
|
@@ -621,21 +621,21 @@ function Pn(e, t) {
|
|
|
621
621
|
//#region src/addons/ai/ai/F0AiChatTextArea/useFileAttachments.ts
|
|
622
622
|
var Fn = 4e3;
|
|
623
623
|
function In(e) {
|
|
624
|
-
let [t, n] =
|
|
624
|
+
let [t, n] = J([]), [r, i] = J(null), a = q(null), o = q(null), s = p(), c = e?.onUploadFiles, l = e?.allowedMimeTypes, u = e?.maxFiles, d = K(() => {
|
|
625
625
|
if (l) return Array.isArray(l) ? l.join(",") : l;
|
|
626
|
-
}, [l]), f = u !== void 0 && t.length >= u, m =
|
|
627
|
-
|
|
626
|
+
}, [l]), f = u !== void 0 && t.length >= u, m = q(0);
|
|
627
|
+
G(() => {
|
|
628
628
|
m.current = t.length;
|
|
629
629
|
}, [t]);
|
|
630
|
-
let h =
|
|
630
|
+
let h = W((e) => {
|
|
631
631
|
a.current && clearTimeout(a.current), i(e), a.current = setTimeout(() => {
|
|
632
632
|
i(null), a.current = null;
|
|
633
633
|
}, Fn);
|
|
634
634
|
}, []);
|
|
635
|
-
|
|
635
|
+
G(() => () => {
|
|
636
636
|
a.current && clearTimeout(a.current);
|
|
637
637
|
}, []);
|
|
638
|
-
let g =
|
|
638
|
+
let g = W(async (e) => {
|
|
639
639
|
if (e.length === 0 || !c) return;
|
|
640
640
|
let t = Pn(e, l);
|
|
641
641
|
if (t.length === 0) return;
|
|
@@ -691,10 +691,10 @@ function In(e) {
|
|
|
691
691
|
isAtMaxFiles: f,
|
|
692
692
|
maxFiles: u,
|
|
693
693
|
processFiles: g,
|
|
694
|
-
handleFileSelect:
|
|
694
|
+
handleFileSelect: W(async (e) => {
|
|
695
695
|
await g(Array.from(e.target.files ?? [])), e.target.value = "";
|
|
696
696
|
}, [g]),
|
|
697
|
-
handleRemoveFile:
|
|
697
|
+
handleRemoveFile: W((e) => {
|
|
698
698
|
n((t) => t.filter((t) => t.id !== e));
|
|
699
699
|
}, []),
|
|
700
700
|
transientError: r,
|
|
@@ -703,46 +703,46 @@ function In(e) {
|
|
|
703
703
|
}
|
|
704
704
|
//#endregion
|
|
705
705
|
//#region src/addons/ai/ai/F0AiChatTextArea/AiChatComposer.tsx
|
|
706
|
-
var Ln = ({ 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: T, disclaimer: E, usageLimits: O, footer:
|
|
707
|
-
let
|
|
706
|
+
var Ln = ({ 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: T, disclaimer: E, usageLimits: O, footer: ee, isWelcomeScreen: A = !1, fullscreen: j = !1, welcomeScreenSuggestions: M, onSuggestionClick: N, welcomeScreenSuggestionsPlacement: P = "above", welcomeScreenSuggestionsCollapsedByDefault: F = !1, welcomeScreenCards: I, padding: te = "default", name: ne, ref: re }) => {
|
|
707
|
+
let L = p(), R = t(), ie = !!R, z = q(null), [B, ae] = J(null), [oe, se] = J(!1), [ce, le] = J({
|
|
708
708
|
isEmpty: !0,
|
|
709
709
|
recorder: "idle"
|
|
710
|
-
}),
|
|
711
|
-
|
|
712
|
-
|
|
710
|
+
}), ue = q(null), H = q(null);
|
|
711
|
+
G(() => () => {
|
|
712
|
+
H.current && clearTimeout(H.current);
|
|
713
713
|
}, []);
|
|
714
|
-
let
|
|
715
|
-
|
|
716
|
-
|
|
714
|
+
let de = l != null, fe = q(u), pe = q(f);
|
|
715
|
+
Gt(() => {
|
|
716
|
+
fe.current = u, pe.current = f;
|
|
717
717
|
});
|
|
718
|
-
let { tracking:
|
|
719
|
-
|
|
718
|
+
let { tracking: me, setFocusChatInputFunction: he } = V(), ge = W((e, t) => {
|
|
719
|
+
me?.onWelcomeSuggestionClick?.({
|
|
720
720
|
item: e,
|
|
721
721
|
group: t,
|
|
722
722
|
prompt: e.prompt || e.title
|
|
723
|
-
}),
|
|
724
|
-
}, [
|
|
723
|
+
}), N?.(e, t);
|
|
724
|
+
}, [me, N]), { attachedFiles: _e, fileInputRef: ve, onUploadFiles: ye, acceptValue: be, isAtMaxFiles: xe, maxFiles: Se, processFiles: Ce, handleFileSelect: we, handleRemoveFile: Te, transientError: Ee, showTransientError: De } = In(h), Oe = Mn({
|
|
725
725
|
searchPersons: C,
|
|
726
726
|
mentionSources: w
|
|
727
727
|
});
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
}, []),
|
|
731
|
-
if (
|
|
732
|
-
else return
|
|
728
|
+
G(() => {
|
|
729
|
+
F || typeof window < "u" && window.location.hash.length === 0 && z.current?.focus();
|
|
730
|
+
}, []), G(() => {
|
|
731
|
+
if (de) he(null);
|
|
732
|
+
else return he(() => {
|
|
733
733
|
z.current?.focus();
|
|
734
|
-
}), () =>
|
|
735
|
-
}, [
|
|
734
|
+
}), () => he(null);
|
|
735
|
+
}, [de, he]), G(() => {
|
|
736
736
|
if (T) return T((e) => {
|
|
737
|
-
|
|
737
|
+
Ce(e);
|
|
738
738
|
}), () => {
|
|
739
739
|
T(null);
|
|
740
740
|
};
|
|
741
|
-
}, [T,
|
|
742
|
-
let
|
|
743
|
-
if (
|
|
741
|
+
}, [T, Ce]);
|
|
742
|
+
let ke = W((e) => void Ce(e), [Ce]), Ae = _e.filter((e) => e.status === "uploaded"), je = _e.some((e) => e.status === "uploading"), Me = _e.some((e) => e.status === "error"), Ne = !ce.isEmpty || Ae.length > 0, Pe = async ({ text: t, mentions: n }) => {
|
|
743
|
+
if (Me) return De(L.ai.fileUploadBlockedSubmit), !1;
|
|
744
744
|
if (a && await a() === !1) return !1;
|
|
745
|
-
let r =
|
|
745
|
+
let r = Ae, i = r.flatMap((e) => e.uploadedFile ? [e.uploadedFile] : []), o = u, s = f;
|
|
746
746
|
o && d?.(null), s && m?.(null);
|
|
747
747
|
try {
|
|
748
748
|
await e({
|
|
@@ -752,25 +752,25 @@ var Ln = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
752
752
|
quote: s
|
|
753
753
|
});
|
|
754
754
|
} catch {
|
|
755
|
-
return o && (
|
|
755
|
+
return o && (fe.current == null || fe.current === o) && d?.(o), s && (pe.current == null || pe.current === s) && m?.(s), !1;
|
|
756
756
|
}
|
|
757
|
-
for (let e of r)
|
|
757
|
+
for (let e of r) Te(e.id);
|
|
758
758
|
return !0;
|
|
759
|
-
},
|
|
760
|
-
suggestions:
|
|
761
|
-
onItemClick:
|
|
762
|
-
onItemHover:
|
|
763
|
-
side:
|
|
764
|
-
reserveTwoRows: !
|
|
765
|
-
overflow:
|
|
766
|
-
}) : null,
|
|
767
|
-
|
|
768
|
-
|
|
759
|
+
}, Fe = B ? B.prompt ?? B.title : null, Ie = Fe ? [Fe] : o ?? [], Le = P === "inside", Re = A && M && M.length > 0 && N ? /* @__PURE__ */ Y(kn, {
|
|
760
|
+
suggestions: M,
|
|
761
|
+
onItemClick: ge,
|
|
762
|
+
onItemHover: ae,
|
|
763
|
+
side: Le ? "bottom" : "top",
|
|
764
|
+
reserveTwoRows: !Le,
|
|
765
|
+
overflow: Le ? "scroll" : "wrap"
|
|
766
|
+
}) : null, ze = !F || oe || Ne || ce.recorder !== "idle", Be = (e) => e instanceof Node ? ue.current?.contains(e) ? !0 : e instanceof Element && e.closest("[data-radix-popper-content-wrapper]") !== null : !1, Ve = () => {
|
|
767
|
+
H.current && clearTimeout(H.current), H.current = setTimeout(() => {
|
|
768
|
+
Be(document.activeElement) || se(!1);
|
|
769
769
|
}, 0);
|
|
770
|
-
},
|
|
770
|
+
}, He = Le, Ue = He && F, We = Ue && !ze, Ge = He && Re ? /* @__PURE__ */ Y("div", {
|
|
771
771
|
onClick: (e) => e.stopPropagation(),
|
|
772
|
-
children:
|
|
773
|
-
}) : void 0,
|
|
772
|
+
children: Re
|
|
773
|
+
}) : void 0, Ke = {
|
|
774
774
|
duration: ie ? 0 : .32,
|
|
775
775
|
ease: [
|
|
776
776
|
.4,
|
|
@@ -778,18 +778,18 @@ var Ln = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
778
778
|
.2,
|
|
779
779
|
1
|
|
780
780
|
]
|
|
781
|
-
},
|
|
781
|
+
}, qe = A && j && !!I && I.length > 0, Je = j && A, { motionProps: Ye } = lt(A, 160, .5);
|
|
782
782
|
return /* @__PURE__ */ X(s.div, {
|
|
783
|
-
ref:
|
|
784
|
-
"data-composer-layout":
|
|
785
|
-
className: y("flex flex-col items-center gap-2",
|
|
786
|
-
...
|
|
783
|
+
ref: re,
|
|
784
|
+
"data-composer-layout": Je ? "welcome" : "docked",
|
|
785
|
+
className: y("flex flex-col items-center gap-2", te === "default" && "px-4 pb-3 pt-2", Je && "min-h-0 flex-1 justify-start -mt-20"),
|
|
786
|
+
...j ? Ye : {},
|
|
787
787
|
children: [
|
|
788
788
|
/* @__PURE__ */ X("div", {
|
|
789
789
|
className: "flex w-full max-w-content flex-col gap-2",
|
|
790
|
-
children: [
|
|
790
|
+
children: [Re && !Le ? /* @__PURE__ */ Y("div", { children: F ? /* @__PURE__ */ Y(n, {
|
|
791
791
|
initial: !1,
|
|
792
|
-
children:
|
|
792
|
+
children: ze ? /* @__PURE__ */ Y(s.div, {
|
|
793
793
|
className: "overflow-hidden",
|
|
794
794
|
initial: {
|
|
795
795
|
opacity: 0,
|
|
@@ -803,107 +803,107 @@ var Ln = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
803
803
|
opacity: 0,
|
|
804
804
|
height: 0
|
|
805
805
|
},
|
|
806
|
-
transition:
|
|
807
|
-
children:
|
|
806
|
+
transition: Ke,
|
|
807
|
+
children: Re
|
|
808
808
|
}, "welcome-suggestions") : null
|
|
809
|
-
}) :
|
|
809
|
+
}) : Re }) : null, /* @__PURE__ */ Y(yn, {
|
|
810
810
|
creditWarning: c,
|
|
811
811
|
children: /* @__PURE__ */ Y(D, {
|
|
812
812
|
asForm: !0,
|
|
813
|
-
surfaceRef:
|
|
813
|
+
surfaceRef: ue,
|
|
814
814
|
handleRef: z,
|
|
815
815
|
className: "isolate z-20 items-stretch p-0 hover:cursor-text",
|
|
816
|
-
accent:
|
|
817
|
-
replacement:
|
|
818
|
-
onSurfaceFocus: () =>
|
|
819
|
-
onSurfaceBlur:
|
|
820
|
-
onStateChange:
|
|
821
|
-
onSend:
|
|
816
|
+
accent: de,
|
|
817
|
+
replacement: de ? l : null,
|
|
818
|
+
onSurfaceFocus: () => se(!0),
|
|
819
|
+
onSurfaceBlur: Ve,
|
|
820
|
+
onStateChange: le,
|
|
821
|
+
onSend: Pe,
|
|
822
822
|
inProgress: i,
|
|
823
823
|
onStop: r,
|
|
824
|
-
hasAttachments:
|
|
825
|
-
sendBlocked:
|
|
826
|
-
error:
|
|
824
|
+
hasAttachments: Ae.length > 0,
|
|
825
|
+
sendBlocked: je,
|
|
826
|
+
error: Ee,
|
|
827
827
|
role: "textbox",
|
|
828
|
-
name:
|
|
829
|
-
placeholders:
|
|
828
|
+
name: ne,
|
|
829
|
+
placeholders: Ie,
|
|
830
830
|
placeholdersPaused: i,
|
|
831
831
|
labels: {
|
|
832
|
-
placeholder:
|
|
833
|
-
listening:
|
|
834
|
-
send:
|
|
835
|
-
stop:
|
|
836
|
-
recordAudio:
|
|
837
|
-
cancelRecording:
|
|
838
|
-
confirmRecording:
|
|
839
|
-
micPermissionDenied:
|
|
840
|
-
micError:
|
|
841
|
-
transcriptionError:
|
|
842
|
-
mentionSuggestions:
|
|
832
|
+
placeholder: L.ai.inputPlaceholder,
|
|
833
|
+
listening: L.ai.listening,
|
|
834
|
+
send: L.ai.sendMessage,
|
|
835
|
+
stop: L.ai.stopAnswerGeneration,
|
|
836
|
+
recordAudio: L.ai.recordAudio,
|
|
837
|
+
cancelRecording: L.ai.cancelRecording,
|
|
838
|
+
confirmRecording: L.ai.stopRecording,
|
|
839
|
+
micPermissionDenied: L.ai.micPermissionDenied,
|
|
840
|
+
micError: L.ai.micError,
|
|
841
|
+
transcriptionError: L.ai.transcriptionError,
|
|
842
|
+
mentionSuggestions: L.ai.mentions.suggestions
|
|
843
843
|
},
|
|
844
844
|
mentions: {
|
|
845
|
-
sources:
|
|
846
|
-
showGroupLabels:
|
|
845
|
+
sources: Oe,
|
|
846
|
+
showGroupLabels: Oe.length > 1
|
|
847
847
|
},
|
|
848
848
|
voice: S ? {
|
|
849
849
|
onTranscribe: S,
|
|
850
|
-
onPress:
|
|
851
|
-
onCancelled:
|
|
850
|
+
onPress: me?.onDictationStart,
|
|
851
|
+
onCancelled: me?.onDictationCancel
|
|
852
852
|
} : void 0,
|
|
853
|
-
onPasteFiles: h?.onUploadFiles ?
|
|
853
|
+
onPasteFiles: h?.onUploadFiles ? ke : void 0,
|
|
854
854
|
pastePreferText: !0,
|
|
855
855
|
header: f ? /* @__PURE__ */ Y(bn, {
|
|
856
856
|
quote: f,
|
|
857
857
|
onRemove: () => m?.(null)
|
|
858
858
|
}) : null,
|
|
859
859
|
tray: /* @__PURE__ */ Y(fn, {
|
|
860
|
-
attachedFiles:
|
|
861
|
-
isUploading:
|
|
862
|
-
onRemove:
|
|
863
|
-
removeLabel:
|
|
860
|
+
attachedFiles: _e,
|
|
861
|
+
isUploading: je,
|
|
862
|
+
onRemove: Te,
|
|
863
|
+
removeLabel: L.ai.removeFile,
|
|
864
864
|
reducedMotion: ie
|
|
865
865
|
}),
|
|
866
|
-
leading:
|
|
866
|
+
leading: He ? /* @__PURE__ */ Y("div", {
|
|
867
867
|
className: "flex shrink-0 self-center pl-3",
|
|
868
|
-
children: /* @__PURE__ */ Y(
|
|
868
|
+
children: /* @__PURE__ */ Y(k, {
|
|
869
869
|
size: "sm",
|
|
870
870
|
spin: i
|
|
871
871
|
})
|
|
872
872
|
}) : void 0,
|
|
873
|
-
toolbarStart:
|
|
874
|
-
onUploadFiles:
|
|
873
|
+
toolbarStart: ye || _ || b?.length ? (e) => /* @__PURE__ */ X(Kt, { children: [/* @__PURE__ */ Y(_n, {
|
|
874
|
+
onUploadFiles: ye,
|
|
875
875
|
composerActions: b,
|
|
876
876
|
onComposerActionsOpenChange: x,
|
|
877
|
-
isAtMaxFiles:
|
|
878
|
-
maxFiles:
|
|
879
|
-
acceptValue:
|
|
880
|
-
fileInputRef:
|
|
881
|
-
handleFileSelect:
|
|
877
|
+
isAtMaxFiles: xe,
|
|
878
|
+
maxFiles: Se,
|
|
879
|
+
acceptValue: be,
|
|
880
|
+
fileInputRef: ve,
|
|
881
|
+
handleFileSelect: we,
|
|
882
882
|
recordingStatus: e
|
|
883
883
|
}), _ ? /* @__PURE__ */ Y("div", {
|
|
884
884
|
className: "min-w-0 cursor-default",
|
|
885
885
|
onClick: (e) => e.stopPropagation(),
|
|
886
886
|
children: _
|
|
887
887
|
}) : null] }) : void 0,
|
|
888
|
-
toolbarCenter:
|
|
889
|
-
collapsible:
|
|
890
|
-
collapsed:
|
|
888
|
+
toolbarCenter: Ge,
|
|
889
|
+
collapsible: Ue,
|
|
890
|
+
collapsed: We,
|
|
891
891
|
reducedMotion: ie
|
|
892
892
|
})
|
|
893
893
|
})]
|
|
894
894
|
}),
|
|
895
|
-
|
|
895
|
+
qe ? /* @__PURE__ */ Y("div", {
|
|
896
896
|
className: "w-full max-w-content pt-2",
|
|
897
|
-
children: /* @__PURE__ */ Y(xn, { cards:
|
|
897
|
+
children: /* @__PURE__ */ Y(xn, { cards: I })
|
|
898
898
|
}) : null,
|
|
899
|
-
|
|
899
|
+
ee && A && j ? /* @__PURE__ */ Y("div", {
|
|
900
900
|
className: "w-full py-4 mx-auto flex max-w-content justify-center",
|
|
901
|
-
children:
|
|
901
|
+
children: ee
|
|
902
902
|
}) : null,
|
|
903
903
|
/* @__PURE__ */ Y(n, {
|
|
904
904
|
mode: "wait",
|
|
905
905
|
initial: !1,
|
|
906
|
-
children:
|
|
906
|
+
children: de ? /* @__PURE__ */ X(s.div, {
|
|
907
907
|
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",
|
|
908
908
|
initial: { opacity: 0 },
|
|
909
909
|
animate: { opacity: 1 },
|
|
@@ -919,7 +919,7 @@ var Ln = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
919
919
|
children: "↑↓"
|
|
920
920
|
}),
|
|
921
921
|
" ",
|
|
922
|
-
|
|
922
|
+
L.ai.clarifyingQuestion.navHint.navigate
|
|
923
923
|
] }),
|
|
924
924
|
/* @__PURE__ */ X("span", { children: [
|
|
925
925
|
/* @__PURE__ */ Y("kbd", {
|
|
@@ -927,7 +927,7 @@ var Ln = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
927
927
|
children: "Enter"
|
|
928
928
|
}),
|
|
929
929
|
" ",
|
|
930
|
-
|
|
930
|
+
L.ai.clarifyingQuestion.navHint.select
|
|
931
931
|
] }),
|
|
932
932
|
/* @__PURE__ */ X("span", { children: [
|
|
933
933
|
/* @__PURE__ */ Y("kbd", {
|
|
@@ -935,16 +935,16 @@ var Ln = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
935
935
|
children: "Esc"
|
|
936
936
|
}),
|
|
937
937
|
" ",
|
|
938
|
-
|
|
938
|
+
L.ai.clarifyingQuestion.navHint.cancel
|
|
939
939
|
] })
|
|
940
940
|
]
|
|
941
|
-
}, "clarifying-nav-hint") : (E?.text || O) && !
|
|
941
|
+
}, "clarifying-nav-hint") : (E?.text || O) && !Je && /* @__PURE__ */ X(s.div, {
|
|
942
942
|
className: y("flex w-full max-w-content flex-row items-center gap-1", O ? "justify-between" : "justify-center"),
|
|
943
943
|
initial: { opacity: 0 },
|
|
944
944
|
animate: { opacity: 1 },
|
|
945
945
|
exit: { opacity: 0 },
|
|
946
946
|
transition: {
|
|
947
|
-
duration:
|
|
947
|
+
duration: R ? 0 : .3,
|
|
948
948
|
ease: "easeOut"
|
|
949
949
|
},
|
|
950
950
|
children: [/* @__PURE__ */ X("div", {
|
|
@@ -1011,12 +1011,12 @@ function Hn({ ...e }) {
|
|
|
1011
1011
|
//#endregion
|
|
1012
1012
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Image.tsx
|
|
1013
1013
|
function Un({ src: e, alt: t, ...n }) {
|
|
1014
|
-
let r = p(), i = ct(), a =
|
|
1014
|
+
let r = p(), i = ct(), a = we(), s = H(e || void 0), [c, l] = J(!1), [u, d] = J(!1), f = t || (e ? He(e) : "") || "image";
|
|
1015
1015
|
if (!e || c || s.status === "error") return t ? /* @__PURE__ */ Y("span", {
|
|
1016
1016
|
className: "text-f1-foreground-secondary",
|
|
1017
1017
|
children: t
|
|
1018
1018
|
}) : null;
|
|
1019
|
-
let m = s.status === "ready" ? /* @__PURE__ */ Y(
|
|
1019
|
+
let m = s.status === "ready" ? /* @__PURE__ */ Y(Je, {
|
|
1020
1020
|
...n,
|
|
1021
1021
|
src: s.url,
|
|
1022
1022
|
alt: t,
|
|
@@ -1044,7 +1044,7 @@ function Un({ src: e, alt: t, ...n }) {
|
|
|
1044
1044
|
variant: "neutral",
|
|
1045
1045
|
label: r.chat.download,
|
|
1046
1046
|
hideLabel: !0,
|
|
1047
|
-
icon:
|
|
1047
|
+
icon: B,
|
|
1048
1048
|
onClick: () => a(e, f)
|
|
1049
1049
|
})
|
|
1050
1050
|
})]
|
|
@@ -1086,11 +1086,11 @@ function qn({ children: e, ...t }) {
|
|
|
1086
1086
|
//#endregion
|
|
1087
1087
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/components/EntityRefHoverCard.tsx
|
|
1088
1088
|
function Jn({ id: e, trigger: t, resolver: n, mapToCard: r, fallbackCard: i }) {
|
|
1089
|
-
let a =
|
|
1090
|
-
|
|
1089
|
+
let a = q(/* @__PURE__ */ new Map()), [o, s] = J(() => a.current.get(e) ?? null), [c, l] = J(!1), [u, d] = J(!1), f = q(!0);
|
|
1090
|
+
G(() => () => {
|
|
1091
1091
|
f.current = !1;
|
|
1092
1092
|
}, []);
|
|
1093
|
-
let p =
|
|
1093
|
+
let p = W(() => {
|
|
1094
1094
|
if (o || c) return;
|
|
1095
1095
|
let t = a.current.get(e);
|
|
1096
1096
|
t ? s(t) : (l(!0), d(!1), n(e).then((t) => {
|
|
@@ -1106,16 +1106,16 @@ function Jn({ id: e, trigger: t, resolver: n, mapToCard: r, fallbackCard: i }) {
|
|
|
1106
1106
|
o,
|
|
1107
1107
|
c
|
|
1108
1108
|
]), m = u || !o ? i : r(o);
|
|
1109
|
-
return /* @__PURE__ */ X(
|
|
1109
|
+
return /* @__PURE__ */ X(Nt, {
|
|
1110
1110
|
openDelay: 300,
|
|
1111
1111
|
closeDelay: 100,
|
|
1112
1112
|
onOpenChange: (e) => {
|
|
1113
1113
|
e && p();
|
|
1114
1114
|
},
|
|
1115
|
-
children: [/* @__PURE__ */ Y(
|
|
1115
|
+
children: [/* @__PURE__ */ Y(kt, {
|
|
1116
1116
|
asChild: !0,
|
|
1117
1117
|
children: t
|
|
1118
|
-
}), /* @__PURE__ */ Y(
|
|
1118
|
+
}), /* @__PURE__ */ Y(Mt, {
|
|
1119
1119
|
side: "top",
|
|
1120
1120
|
align: "start",
|
|
1121
1121
|
className: "w-64 rounded-2xl border-none p-0 shadow-md",
|
|
@@ -1125,7 +1125,7 @@ function Jn({ id: e, trigger: t, resolver: n, mapToCard: r, fallbackCard: i }) {
|
|
|
1125
1125
|
}
|
|
1126
1126
|
//#endregion
|
|
1127
1127
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/components/MentionTrigger.tsx
|
|
1128
|
-
var Yn =
|
|
1128
|
+
var Yn = U(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
1129
1129
|
ref: n,
|
|
1130
1130
|
type: "button",
|
|
1131
1131
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
@@ -1136,7 +1136,7 @@ Yn.displayName = "MentionTrigger";
|
|
|
1136
1136
|
//#endregion
|
|
1137
1137
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/custom/CustomEntityRef.tsx
|
|
1138
1138
|
function Xn({ id: e, label: t, config: n }) {
|
|
1139
|
-
let r = p(), { resolve: i, avatar: a, url: o } = n, s = o?.(e), c =
|
|
1139
|
+
let r = p(), { resolve: i, avatar: a, url: o } = n, s = o?.(e), c = W((e) => ({
|
|
1140
1140
|
...e,
|
|
1141
1141
|
avatar: e.avatar ?? a,
|
|
1142
1142
|
...s && { secondaryActions: {
|
|
@@ -1147,7 +1147,7 @@ function Xn({ id: e, label: t, config: n }) {
|
|
|
1147
1147
|
a,
|
|
1148
1148
|
s,
|
|
1149
1149
|
r
|
|
1150
|
-
]), l =
|
|
1150
|
+
]), l = K(() => c({ title: t }), [c, t]), u = W((e) => i ? i(e) : Promise.resolve({ title: t }), [i, t]);
|
|
1151
1151
|
return /* @__PURE__ */ Y(Jn, {
|
|
1152
1152
|
id: e,
|
|
1153
1153
|
trigger: /* @__PURE__ */ Y(Yn, { label: t }),
|
|
@@ -1158,7 +1158,7 @@ function Xn({ id: e, label: t, config: n }) {
|
|
|
1158
1158
|
}
|
|
1159
1159
|
//#endregion
|
|
1160
1160
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/candidate/CandidateEntityRef.tsx
|
|
1161
|
-
var Zn =
|
|
1161
|
+
var Zn = U(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1162
1162
|
ref: n,
|
|
1163
1163
|
type: "button",
|
|
1164
1164
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
@@ -1167,7 +1167,7 @@ var Zn = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
|
1167
1167
|
}));
|
|
1168
1168
|
Zn.displayName = "CandidateTrigger";
|
|
1169
1169
|
function Qn({ id: e, label: t }) {
|
|
1170
|
-
let { entityRefs: n } =
|
|
1170
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.candidate, i = p(), a = n?.urls?.candidate?.(e), o = K(() => (e) => {
|
|
1171
1171
|
let t = [];
|
|
1172
1172
|
return e.source && t.push({
|
|
1173
1173
|
title: i.t("ai.entityRef.candidate.source"),
|
|
@@ -1201,7 +1201,7 @@ function Qn({ id: e, label: t }) {
|
|
|
1201
1201
|
href: a
|
|
1202
1202
|
} }
|
|
1203
1203
|
};
|
|
1204
|
-
}, [i, a]), s =
|
|
1204
|
+
}, [i, a]), s = K(() => ({
|
|
1205
1205
|
title: t,
|
|
1206
1206
|
...a && { secondaryActions: {
|
|
1207
1207
|
label: i.t("ai.view"),
|
|
@@ -1222,7 +1222,7 @@ function Qn({ id: e, label: t }) {
|
|
|
1222
1222
|
}
|
|
1223
1223
|
//#endregion
|
|
1224
1224
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/expense/ExpenseEntityRef.tsx
|
|
1225
|
-
var $n =
|
|
1225
|
+
var $n = U(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1226
1226
|
ref: n,
|
|
1227
1227
|
type: "button",
|
|
1228
1228
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
@@ -1231,10 +1231,10 @@ var $n = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
|
1231
1231
|
}));
|
|
1232
1232
|
$n.displayName = "ExpenseTrigger";
|
|
1233
1233
|
function er({ id: e, label: t }) {
|
|
1234
|
-
let { entityRefs: n } =
|
|
1234
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.expense, i = p(), a = n?.urls?.expense?.(e), o = K(() => (e) => ({
|
|
1235
1235
|
avatar: {
|
|
1236
1236
|
type: "icon",
|
|
1237
|
-
icon:
|
|
1237
|
+
icon: O
|
|
1238
1238
|
},
|
|
1239
1239
|
title: e.description || `Expense #${e.id}`,
|
|
1240
1240
|
description: [e.amount, e.status].filter(Boolean).join(" · "),
|
|
@@ -1242,7 +1242,7 @@ function er({ id: e, label: t }) {
|
|
|
1242
1242
|
label: i.t("ai.view"),
|
|
1243
1243
|
href: a
|
|
1244
1244
|
} }
|
|
1245
|
-
}), [i, a]), s =
|
|
1245
|
+
}), [i, a]), s = K(() => ({
|
|
1246
1246
|
title: t,
|
|
1247
1247
|
...a && { secondaryActions: {
|
|
1248
1248
|
label: i.t("ai.view"),
|
|
@@ -1263,7 +1263,7 @@ function er({ id: e, label: t }) {
|
|
|
1263
1263
|
}
|
|
1264
1264
|
//#endregion
|
|
1265
1265
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/jobPosting/JobPostingEntityRef.tsx
|
|
1266
|
-
var tr =
|
|
1266
|
+
var tr = U(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1267
1267
|
ref: n,
|
|
1268
1268
|
type: "button",
|
|
1269
1269
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
@@ -1272,14 +1272,14 @@ var tr = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
|
1272
1272
|
}));
|
|
1273
1273
|
tr.displayName = "JobPostingTrigger";
|
|
1274
1274
|
function nr({ id: e, label: t }) {
|
|
1275
|
-
let { entityRefs: n } =
|
|
1275
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.jobPosting, i = p(), a = n?.urls?.jobPosting?.(e), o = K(() => (e) => ({
|
|
1276
1276
|
title: e.title,
|
|
1277
1277
|
description: [e.status, e.location].filter(Boolean).join(" · "),
|
|
1278
1278
|
...a && { secondaryActions: {
|
|
1279
1279
|
label: i.t("ai.view"),
|
|
1280
1280
|
href: a
|
|
1281
1281
|
} }
|
|
1282
|
-
}), [i, a]), s =
|
|
1282
|
+
}), [i, a]), s = K(() => ({
|
|
1283
1283
|
title: t,
|
|
1284
1284
|
...a && { secondaryActions: {
|
|
1285
1285
|
label: i.t("ai.view"),
|
|
@@ -1301,7 +1301,7 @@ function nr({ id: e, label: t }) {
|
|
|
1301
1301
|
//#endregion
|
|
1302
1302
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/person/PersonEntityRef.tsx
|
|
1303
1303
|
function rr({ id: e, label: t }) {
|
|
1304
|
-
let { entityRefs: n } =
|
|
1304
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.person, i = p(), a = n?.urls?.person?.(e), o = K(() => (e) => ({
|
|
1305
1305
|
avatar: {
|
|
1306
1306
|
type: "person",
|
|
1307
1307
|
firstName: e.firstName,
|
|
@@ -1314,7 +1314,7 @@ function rr({ id: e, label: t }) {
|
|
|
1314
1314
|
label: i.t("ai.view"),
|
|
1315
1315
|
href: a
|
|
1316
1316
|
} }
|
|
1317
|
-
}), [i, a]), s =
|
|
1317
|
+
}), [i, a]), s = K(() => ({
|
|
1318
1318
|
title: t,
|
|
1319
1319
|
...a && { secondaryActions: {
|
|
1320
1320
|
label: i.t("ai.view"),
|
|
@@ -1352,7 +1352,7 @@ function ir({ rows: e }) {
|
|
|
1352
1352
|
}
|
|
1353
1353
|
//#endregion
|
|
1354
1354
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/requisition/RequisitionEntityRef.tsx
|
|
1355
|
-
var ar =
|
|
1355
|
+
var ar = U(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1356
1356
|
ref: n,
|
|
1357
1357
|
type: "button",
|
|
1358
1358
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
@@ -1361,13 +1361,13 @@ var ar = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
|
1361
1361
|
}));
|
|
1362
1362
|
ar.displayName = "RequisitionTrigger";
|
|
1363
1363
|
function or({ id: e, label: t }) {
|
|
1364
|
-
let { entityRefs: n } =
|
|
1364
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.requisition, i = p(), a = n?.urls?.requisition?.(e), o = K(() => (e) => {
|
|
1365
1365
|
let t = e.lineManager ? `${e.lineManager.firstName} ${e.lineManager.lastName}` : void 0, n = [
|
|
1366
1366
|
e.status ? {
|
|
1367
1367
|
label: i.t("ai.entityRef.requisition.status"),
|
|
1368
1368
|
value: /* @__PURE__ */ Y("div", {
|
|
1369
1369
|
className: "flex items-center pt-1",
|
|
1370
|
-
children: /* @__PURE__ */ Y(
|
|
1370
|
+
children: /* @__PURE__ */ Y(xt, {
|
|
1371
1371
|
text: e.status,
|
|
1372
1372
|
variant: e.statusVariant ?? "neutral"
|
|
1373
1373
|
})
|
|
@@ -1377,7 +1377,7 @@ function or({ id: e, label: t }) {
|
|
|
1377
1377
|
label: i.t("ai.entityRef.requisition.lineManager"),
|
|
1378
1378
|
value: /* @__PURE__ */ X("div", {
|
|
1379
1379
|
className: "flex items-center gap-1.5 pt-1",
|
|
1380
|
-
children: [/* @__PURE__ */ Y(
|
|
1380
|
+
children: [/* @__PURE__ */ Y(ht, {
|
|
1381
1381
|
firstName: e.lineManager.firstName,
|
|
1382
1382
|
lastName: e.lineManager.lastName,
|
|
1383
1383
|
src: e.lineManager.avatarUrl,
|
|
@@ -1399,7 +1399,7 @@ function or({ id: e, label: t }) {
|
|
|
1399
1399
|
href: a
|
|
1400
1400
|
} }
|
|
1401
1401
|
};
|
|
1402
|
-
}, [i, a]), s =
|
|
1402
|
+
}, [i, a]), s = K(() => ({
|
|
1403
1403
|
title: t,
|
|
1404
1404
|
...a && { secondaryActions: {
|
|
1405
1405
|
label: i.t("ai.view"),
|
|
@@ -1420,7 +1420,7 @@ function or({ id: e, label: t }) {
|
|
|
1420
1420
|
}
|
|
1421
1421
|
//#endregion
|
|
1422
1422
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/vacancy/VacancyEntityRef.tsx
|
|
1423
|
-
var sr =
|
|
1423
|
+
var sr = U(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1424
1424
|
ref: n,
|
|
1425
1425
|
type: "button",
|
|
1426
1426
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
@@ -1429,14 +1429,14 @@ var sr = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
|
1429
1429
|
}));
|
|
1430
1430
|
sr.displayName = "VacancyTrigger";
|
|
1431
1431
|
function cr({ id: e, label: t }) {
|
|
1432
|
-
let { entityRefs: n } =
|
|
1432
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.vacancy, i = p(), a = n?.urls?.vacancy?.(e), o = K(() => (e) => ({
|
|
1433
1433
|
title: e.name,
|
|
1434
1434
|
description: [e.status, e.vacancyType].filter(Boolean).join(" · "),
|
|
1435
1435
|
...a && { secondaryActions: {
|
|
1436
1436
|
label: i.t("ai.view"),
|
|
1437
1437
|
href: a
|
|
1438
1438
|
} }
|
|
1439
|
-
}), [i, a]), s =
|
|
1439
|
+
}), [i, a]), s = K(() => ({
|
|
1440
1440
|
title: t,
|
|
1441
1441
|
...a && { secondaryActions: {
|
|
1442
1442
|
label: i.t("ai.view"),
|
|
@@ -1477,7 +1477,7 @@ function fr(e) {
|
|
|
1477
1477
|
return typeof e == "string" ? e : typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(fr).join("") : e && typeof e == "object" && "props" in e ? fr(e.props.children) : "";
|
|
1478
1478
|
}
|
|
1479
1479
|
function pr({ type: e, id: t, children: n }) {
|
|
1480
|
-
let { entityRefs: r } =
|
|
1480
|
+
let { entityRefs: r } = V();
|
|
1481
1481
|
if (!t || !e) return /* @__PURE__ */ Y("span", { children: n });
|
|
1482
1482
|
let i = fr(n), a = ur(e);
|
|
1483
1483
|
if (a) return /* @__PURE__ */ Y(a, {
|
|
@@ -1494,14 +1494,14 @@ function pr({ type: e, id: t, children: n }) {
|
|
|
1494
1494
|
//#endregion
|
|
1495
1495
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Table.tsx
|
|
1496
1496
|
async function mr(e, t, n) {
|
|
1497
|
-
let r =
|
|
1497
|
+
let r = ee(e), i = t === "xlsx" ? await rt([{
|
|
1498
1498
|
name: "Data",
|
|
1499
1499
|
rows: r
|
|
1500
|
-
}]) : await
|
|
1501
|
-
|
|
1500
|
+
}]) : await it(r);
|
|
1501
|
+
le(i, `${n}.${t}`);
|
|
1502
1502
|
}
|
|
1503
1503
|
function hr({ children: e, title: t, ...n }) {
|
|
1504
|
-
let r = p(), i =
|
|
1504
|
+
let r = p(), i = q(null), a = W((e) => {
|
|
1505
1505
|
if (!i.current) return;
|
|
1506
1506
|
let n = t?.replace(/\s+/g, "_").toLowerCase() || "table";
|
|
1507
1507
|
mr(i.current, e, n);
|
|
@@ -1514,16 +1514,16 @@ function hr({ children: e, title: t, ...n }) {
|
|
|
1514
1514
|
tag: "h2",
|
|
1515
1515
|
className: "text-base font-medium capitalize text-f1-foreground",
|
|
1516
1516
|
children: t ?? r.ai.reportCard.tableLabel
|
|
1517
|
-
}), /* @__PURE__ */ Y(
|
|
1518
|
-
icon:
|
|
1517
|
+
}), /* @__PURE__ */ Y(be, {
|
|
1518
|
+
icon: B,
|
|
1519
1519
|
size: "md",
|
|
1520
1520
|
items: [{
|
|
1521
1521
|
label: r.t("ai.dataDownload.download", { format: "Excel" }),
|
|
1522
|
-
icon:
|
|
1522
|
+
icon: B,
|
|
1523
1523
|
onClick: () => a("xlsx")
|
|
1524
1524
|
}, {
|
|
1525
1525
|
label: r.t("ai.dataDownload.download", { format: "CSV" }),
|
|
1526
|
-
icon:
|
|
1526
|
+
icon: B,
|
|
1527
1527
|
onClick: () => a("csv")
|
|
1528
1528
|
}]
|
|
1529
1529
|
})]
|
|
@@ -1669,13 +1669,13 @@ var wr = {
|
|
|
1669
1669
|
mimeType: e.mimeType,
|
|
1670
1670
|
size: e.bytes,
|
|
1671
1671
|
previewUrl: e.preview && t ? t(e.preview.path) : void 0
|
|
1672
|
-
}), Fr = (e) =>
|
|
1672
|
+
}), Fr = (e) => Ce(e) ?? "", Ir = ({ avatar: e }) => e?.type === "module" ? /* @__PURE__ */ Y(pt, {
|
|
1673
1673
|
module: e.module,
|
|
1674
1674
|
size: "md"
|
|
1675
|
-
}) : e?.type === "file" ? /* @__PURE__ */ Y(
|
|
1675
|
+
}) : e?.type === "file" ? /* @__PURE__ */ Y(ft, {
|
|
1676
1676
|
file: e.file,
|
|
1677
1677
|
size: "lg"
|
|
1678
|
-
}) : e?.type === "icon" ? /* @__PURE__ */ Y(
|
|
1678
|
+
}) : e?.type === "icon" ? /* @__PURE__ */ Y(dt, {
|
|
1679
1679
|
icon: e.icon,
|
|
1680
1680
|
size: "md"
|
|
1681
1681
|
}) : null, Lr = ({ action: e, isActive: t }) => {
|
|
@@ -1724,12 +1724,12 @@ function Rr({ avatar: e, title: t, description: n, isActive: r = !1, action: i,
|
|
|
1724
1724
|
Rr.displayName = "F0CanvasCard";
|
|
1725
1725
|
//#endregion
|
|
1726
1726
|
//#region src/addons/ai/ai/F0AiChat/providers/FormCardValueFormatterProvider.tsx
|
|
1727
|
-
var zr =
|
|
1727
|
+
var zr = zt(null);
|
|
1728
1728
|
function Br({ children: e }) {
|
|
1729
|
-
let [t, n] =
|
|
1729
|
+
let [t, n] = J(0), r = q([]), i = W((e) => {
|
|
1730
1730
|
let t = r.current, i = t.findIndex((t) => t.formName === e.formName && t.customFieldName === e.customFieldName), a = e;
|
|
1731
1731
|
i >= 0 ? t[i] = a : t.push(a), n((e) => e + 1);
|
|
1732
|
-
}, []), a =
|
|
1732
|
+
}, []), a = K(() => ({
|
|
1733
1733
|
formatters: [...r.current],
|
|
1734
1734
|
setFormCardValueFormatter: i
|
|
1735
1735
|
}), [i, t]);
|
|
@@ -1739,8 +1739,8 @@ function Br({ children: e }) {
|
|
|
1739
1739
|
});
|
|
1740
1740
|
}
|
|
1741
1741
|
function Vr(e) {
|
|
1742
|
-
let t =
|
|
1743
|
-
return
|
|
1742
|
+
let t = Ht(zr)?.formatters;
|
|
1743
|
+
return K(() => !t || t.length === 0 ? null : (n, r, i) => {
|
|
1744
1744
|
let a, o = -1;
|
|
1745
1745
|
for (let n of t) {
|
|
1746
1746
|
let t = n.formName === void 0 || n.formName === e, r = n.customFieldName === void 0 || n.customFieldName === i.customFieldName;
|
|
@@ -1755,7 +1755,7 @@ function Vr(e) {
|
|
|
1755
1755
|
}, [t, e]);
|
|
1756
1756
|
}
|
|
1757
1757
|
function Hr() {
|
|
1758
|
-
let e =
|
|
1758
|
+
let e = Ht(zr);
|
|
1759
1759
|
if (!e) throw Error("useSetFormCardValueFormatter must be used within a FormCardValueFormatterProvider");
|
|
1760
1760
|
return e.setFormCardValueFormatter;
|
|
1761
1761
|
}
|
|
@@ -1844,7 +1844,7 @@ function Qr(e, t) {
|
|
|
1844
1844
|
};
|
|
1845
1845
|
}
|
|
1846
1846
|
function $r({ formName: e, formDescription: t, module: n, cardTitle: r, cardDescription: i, fieldDescriptions: a, formValues: o, valueFormatter: s }) {
|
|
1847
|
-
let { canvasContent: c, openCanvas: l, closeCanvas: u } =
|
|
1847
|
+
let { canvasContent: c, openCanvas: l, closeCanvas: u } = V(), d = Vr(e), f = s ?? d, p = q(() => {}), m = r ?? e, h = i ?? t ?? "", g = c?.type === "form" && c.formName === e, _ = () => l({
|
|
1848
1848
|
type: "form",
|
|
1849
1849
|
title: m,
|
|
1850
1850
|
description: h,
|
|
@@ -1852,7 +1852,7 @@ function $r({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
|
|
|
1852
1852
|
formDescription: t,
|
|
1853
1853
|
formModule: n
|
|
1854
1854
|
});
|
|
1855
|
-
p.current = _,
|
|
1855
|
+
p.current = _, G(() => {
|
|
1856
1856
|
typeof window < "u" && (window.innerWidth < Wr || Gr.has(e) || (Gr.add(e), p.current()));
|
|
1857
1857
|
}, [e]);
|
|
1858
1858
|
let v = a && o ? Object.entries(a).map(([e, t]) => {
|
|
@@ -1888,7 +1888,7 @@ function $r({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
|
|
|
1888
1888
|
},
|
|
1889
1889
|
children: y.length > 0 && !g ? /* @__PURE__ */ Y("div", {
|
|
1890
1890
|
className: "-mx-3 flex w-full flex-col overflow-hidden pb-1",
|
|
1891
|
-
children: /* @__PURE__ */ Y(
|
|
1891
|
+
children: /* @__PURE__ */ Y(Ne, {
|
|
1892
1892
|
details: y.map((e) => ({
|
|
1893
1893
|
title: e.label,
|
|
1894
1894
|
content: e.content,
|
|
@@ -1905,7 +1905,7 @@ $r.displayName = "FormCard";
|
|
|
1905
1905
|
//#endregion
|
|
1906
1906
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/ActiveFormCard.tsx
|
|
1907
1907
|
function ei() {
|
|
1908
|
-
let e =
|
|
1908
|
+
let e = ne(), t = e?.activeForm;
|
|
1909
1909
|
if (!t) return null;
|
|
1910
1910
|
let n = t.cardTitle, r = t.cardDescription, i = (e?.getFillVersion(t.formName) ?? 0) > 0;
|
|
1911
1911
|
return !n || !r || !i ? null : /* @__PURE__ */ Y("div", {
|
|
@@ -1925,9 +1925,9 @@ function ei() {
|
|
|
1925
1925
|
//#region src/addons/ai/ai/F0AiFileAttachments/F0AiFileAttachments.tsx
|
|
1926
1926
|
var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
1927
1927
|
let { provided: t } = $e();
|
|
1928
|
-
return t ? /* @__PURE__ */ Y(ii, { ...e }) : /* @__PURE__ */ Y(
|
|
1928
|
+
return t ? /* @__PURE__ */ Y(ii, { ...e }) : /* @__PURE__ */ Y(Ae, { children: /* @__PURE__ */ Y(ii, { ...e }) });
|
|
1929
1929
|
}, ii = ({ files: e, align: t = "start", onOpenFile: n, onFileDownloaded: r, size: i = "default" }) => {
|
|
1930
|
-
let { remotePreviews: a } = $e(), { openImagePreview: o } =
|
|
1930
|
+
let { remotePreviews: a } = $e(), { openImagePreview: o } = nt(), [s, c] = J(() => /* @__PURE__ */ new Set()), l = K(() => ai(e, a, s), [
|
|
1931
1931
|
e,
|
|
1932
1932
|
a,
|
|
1933
1933
|
s
|
|
@@ -1940,13 +1940,13 @@ var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
|
1940
1940
|
onOpenFile: n,
|
|
1941
1941
|
onFileDownloaded: r,
|
|
1942
1942
|
openImage: (e, t) => {
|
|
1943
|
-
n?.(e, "image") !== !1 && o(l.images.map(
|
|
1943
|
+
n?.(e, "image") !== !1 && o(l.images.map(ze), t);
|
|
1944
1944
|
},
|
|
1945
1945
|
onImageError: (e) => c((t) => new Set(t).add(e.url))
|
|
1946
1946
|
};
|
|
1947
1947
|
return Y(i === "compact" ? ci : si, { ...u });
|
|
1948
1948
|
}, ai = (e, t, n) => {
|
|
1949
|
-
let r = (e) => t || de(e.url), i =
|
|
1949
|
+
let r = (e) => t || de(e.url), i = Ee(e.filter(r)), a = /* @__PURE__ */ new Set([
|
|
1950
1950
|
...e.filter((e) => !r(e)),
|
|
1951
1951
|
...i.images.filter((e) => n.has(e.url)),
|
|
1952
1952
|
...i.files
|
|
@@ -1973,7 +1973,7 @@ var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
|
1973
1973
|
},
|
|
1974
1974
|
onImageError: o
|
|
1975
1975
|
}) : null,
|
|
1976
|
-
t.map((e, t) => /* @__PURE__ */ Y(
|
|
1976
|
+
t.map((e, t) => /* @__PURE__ */ Y(Le, {
|
|
1977
1977
|
file: tt(e),
|
|
1978
1978
|
cornerClass: "rounded-xl",
|
|
1979
1979
|
testIdPrefix: ni,
|
|
@@ -2027,7 +2027,7 @@ var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
|
2027
2027
|
})]
|
|
2028
2028
|
});
|
|
2029
2029
|
}, li = ({ files: e, align: t, onFileDownloaded: n }) => {
|
|
2030
|
-
let r =
|
|
2030
|
+
let r = we();
|
|
2031
2031
|
return e.length === 0 ? null : /* @__PURE__ */ Y("div", {
|
|
2032
2032
|
className: y("flex max-w-full flex-wrap gap-1.5", t === "end" ? "justify-end" : "justify-start"),
|
|
2033
2033
|
children: e.map((e, t) => /* @__PURE__ */ Y(di, {
|
|
@@ -2038,15 +2038,15 @@ var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
|
2038
2038
|
}, `${e.name}-${t}`))
|
|
2039
2039
|
});
|
|
2040
2040
|
}, ui = ({ file: e, onOpen: t, onError: n }) => {
|
|
2041
|
-
let r = p(), i =
|
|
2042
|
-
return
|
|
2041
|
+
let r = p(), i = H(e.thumbnailUrl ?? e.url);
|
|
2042
|
+
return ot(i.status, n), /* @__PURE__ */ Y("button", {
|
|
2043
2043
|
type: "button",
|
|
2044
2044
|
onClick: t,
|
|
2045
2045
|
draggable: !1,
|
|
2046
2046
|
"aria-label": r.t("chat.openNamedDocument", { name: e.name }),
|
|
2047
2047
|
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()),
|
|
2048
2048
|
"data-testid": "ai-chat-image-attachment",
|
|
2049
|
-
children: i.status === "ready" ? /* @__PURE__ */ Y(
|
|
2049
|
+
children: i.status === "ready" ? /* @__PURE__ */ Y(Je, {
|
|
2050
2050
|
src: i.url,
|
|
2051
2051
|
alt: e.name,
|
|
2052
2052
|
draggable: !1,
|
|
@@ -2056,7 +2056,7 @@ var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
|
2056
2056
|
});
|
|
2057
2057
|
}, di = ({ file: e, onDownload: t }) => {
|
|
2058
2058
|
let n = p();
|
|
2059
|
-
return /* @__PURE__ */ Y(
|
|
2059
|
+
return /* @__PURE__ */ Y(Ie, {
|
|
2060
2060
|
file: {
|
|
2061
2061
|
name: e.name,
|
|
2062
2062
|
type: Fr(e)
|
|
@@ -2064,22 +2064,22 @@ var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
|
2064
2064
|
size: "lg",
|
|
2065
2065
|
actions: [{
|
|
2066
2066
|
label: n.t("chat.downloadNamedFile", { name: e.name }),
|
|
2067
|
-
icon:
|
|
2067
|
+
icon: B,
|
|
2068
2068
|
onClick: t
|
|
2069
2069
|
}]
|
|
2070
2070
|
});
|
|
2071
2071
|
}, fi = ({ images: e, onOpen: t, onImageError: n }) => {
|
|
2072
|
-
let r = p(), i = e.length === 1 ? e[0] : void 0, a =
|
|
2072
|
+
let r = p(), i = e.length === 1 ? e[0] : void 0, a = H(i ? i.thumbnailUrl ?? i.url : void 0), o = Ue(i && a.status === "ready" ? a.url : void 0, i) ?? void 0, s = i ? Se(o?.width, o?.height) : null;
|
|
2073
2073
|
return /* @__PURE__ */ Y("div", {
|
|
2074
2074
|
style: s ? { width: s.width } : void 0,
|
|
2075
|
-
className: y("grid grid-cols-2 overflow-hidden border border-solid border-f1-border-secondary", s ? "max-w-full" :
|
|
2075
|
+
className: y("grid grid-cols-2 overflow-hidden border border-solid border-f1-border-secondary", s ? "max-w-full" : Be, et, ti),
|
|
2076
2076
|
"data-testid": "ai-chat-image-album",
|
|
2077
2077
|
children: Fe(o ? [o] : e).map((i, a, o) => {
|
|
2078
2078
|
let s = e[i.index];
|
|
2079
2079
|
if (!s) return null;
|
|
2080
2080
|
let c = a === o.length - 1;
|
|
2081
2081
|
return /* @__PURE__ */ Y(Pe, {
|
|
2082
|
-
image:
|
|
2082
|
+
image: ze(s),
|
|
2083
2083
|
aspectRatio: i.aspectRatio,
|
|
2084
2084
|
spanFull: i.span === 2,
|
|
2085
2085
|
inset: i.inset,
|
|
@@ -2095,7 +2095,7 @@ var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
|
2095
2095
|
testIdPrefix: ni,
|
|
2096
2096
|
overlay: i.hiddenCount > 0 ? /* @__PURE__ */ Y("span", {
|
|
2097
2097
|
"aria-hidden": !0,
|
|
2098
|
-
className: y("absolute inset-0 flex items-center justify-center text-2xl font-semibold text-f1-foreground-inverse",
|
|
2098
|
+
className: y("absolute inset-0 flex items-center justify-center text-2xl font-semibold text-f1-foreground-inverse", De),
|
|
2099
2099
|
"data-testid": "ai-chat-image-album-more",
|
|
2100
2100
|
children: `+${i.hiddenCount}`
|
|
2101
2101
|
}) : void 0
|
|
@@ -2118,8 +2118,8 @@ function hi(e, t) {
|
|
|
2118
2118
|
};
|
|
2119
2119
|
}
|
|
2120
2120
|
function gi({ containerRef: e, enabled: t = !0 }) {
|
|
2121
|
-
let [n, r] =
|
|
2122
|
-
return
|
|
2121
|
+
let [n, r] = J(null), i = W(() => r(null), []);
|
|
2122
|
+
return G(() => {
|
|
2123
2123
|
if (!t || typeof window > "u") return;
|
|
2124
2124
|
let n = e.current;
|
|
2125
2125
|
if (!n) return;
|
|
@@ -2144,8 +2144,8 @@ function gi({ containerRef: e, enabled: t = !0 }) {
|
|
|
2144
2144
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/ReplyPopover.tsx
|
|
2145
2145
|
var _i = 8, vi = 8;
|
|
2146
2146
|
function yi({ anchor: e, onReply: t }) {
|
|
2147
|
-
let n = p(), r =
|
|
2148
|
-
if (
|
|
2147
|
+
let n = p(), r = q(null), [i, a] = J(null);
|
|
2148
|
+
if (Gt(() => {
|
|
2149
2149
|
if (!e) {
|
|
2150
2150
|
a(null);
|
|
2151
2151
|
return;
|
|
@@ -2174,7 +2174,7 @@ function yi({ anchor: e, onReply: t }) {
|
|
|
2174
2174
|
type: "button",
|
|
2175
2175
|
variant: "ghost",
|
|
2176
2176
|
label: o,
|
|
2177
|
-
icon:
|
|
2177
|
+
icon: st,
|
|
2178
2178
|
onClick: () => {
|
|
2179
2179
|
t(e.text);
|
|
2180
2180
|
}
|
|
@@ -2183,15 +2183,15 @@ function yi({ anchor: e, onReply: t }) {
|
|
|
2183
2183
|
}
|
|
2184
2184
|
//#endregion
|
|
2185
2185
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/AssistantMessage.tsx
|
|
2186
|
-
var bi =
|
|
2186
|
+
var bi = zt(void 0), xi = () => Ht(bi), Si = (e) => /* @__PURE__ */ Y(qe, {
|
|
2187
2187
|
content: e,
|
|
2188
2188
|
format: "markdown"
|
|
2189
2189
|
}), Ci = ({ isGenerating: e, isLoading: t, message: n, renderToolCall: r, onReplyQuote: i, onRendered: a, renderMarkdown: o }) => {
|
|
2190
|
-
let s = n?.content, c = Nr(s, "assistant") ?? "", l =
|
|
2190
|
+
let s = n?.content, c = Nr(s, "assistant") ?? "", l = K(() => Mr({ content: s }), [s]), u = (n && r?.(n)) ?? n?.generativeUI?.() ?? null, d = n?.toolCalls?.[0]?.id, f = !c && !u && l.length === 0, p = q(null), { anchor: m, clear: h } = gi({
|
|
2191
2191
|
containerRef: p,
|
|
2192
2192
|
enabled: !!(n?.id && c)
|
|
2193
2193
|
});
|
|
2194
|
-
return
|
|
2194
|
+
return G(() => {
|
|
2195
2195
|
n?.id && !t && !e && a?.(n);
|
|
2196
2196
|
}, [
|
|
2197
2197
|
n,
|
|
@@ -2229,7 +2229,7 @@ var bi = Bt(void 0), xi = () => Ut(bi), Si = (e) => /* @__PURE__ */ Y(Ke, {
|
|
|
2229
2229
|
})
|
|
2230
2230
|
});
|
|
2231
2231
|
}, wi = ({ onClose: e, onSubmit: t, reactionType: n, message: r }) => {
|
|
2232
|
-
let [i, a] =
|
|
2232
|
+
let [i, a] = J(""), o = p(), { title: s, label: c, placeholder: l } = n === "like" ? o.ai.feedbackModal.positive : o.ai.feedbackModal.negative, u = W(() => {
|
|
2233
2233
|
t(r, i);
|
|
2234
2234
|
}, [
|
|
2235
2235
|
i,
|
|
@@ -2238,14 +2238,14 @@ var bi = Bt(void 0), xi = () => Ut(bi), Si = (e) => /* @__PURE__ */ Y(Ke, {
|
|
|
2238
2238
|
]), d = () => {
|
|
2239
2239
|
e(r);
|
|
2240
2240
|
};
|
|
2241
|
-
return
|
|
2241
|
+
return G(() => {
|
|
2242
2242
|
let e = (e) => {
|
|
2243
2243
|
e.key === "Enter" && (e.preventDefault(), u());
|
|
2244
2244
|
};
|
|
2245
2245
|
return document.addEventListener("keydown", e), () => {
|
|
2246
2246
|
document.removeEventListener("keydown", e);
|
|
2247
2247
|
};
|
|
2248
|
-
}, [u]), /* @__PURE__ */ Y(
|
|
2248
|
+
}, [u]), /* @__PURE__ */ Y(Ze, {
|
|
2249
2249
|
position: "center",
|
|
2250
2250
|
isOpen: !0,
|
|
2251
2251
|
onClose: d,
|
|
@@ -2262,7 +2262,7 @@ var bi = Bt(void 0), xi = () => Ut(bi), Si = (e) => /* @__PURE__ */ Y(Ke, {
|
|
|
2262
2262
|
},
|
|
2263
2263
|
children: /* @__PURE__ */ Y("div", {
|
|
2264
2264
|
className: "flex flex-col gap-6",
|
|
2265
|
-
children: /* @__PURE__ */ Y(
|
|
2265
|
+
children: /* @__PURE__ */ Y(Ye, {
|
|
2266
2266
|
autoFocus: !0,
|
|
2267
2267
|
label: c,
|
|
2268
2268
|
placeholder: l,
|
|
@@ -2273,8 +2273,8 @@ var bi = Bt(void 0), xi = () => Ut(bi), Si = (e) => /* @__PURE__ */ Y(Ke, {
|
|
|
2273
2273
|
})
|
|
2274
2274
|
})
|
|
2275
2275
|
});
|
|
2276
|
-
}, Ti =
|
|
2277
|
-
let [t, n] =
|
|
2276
|
+
}, Ti = zt(null), Ei = ({ children: e }) => {
|
|
2277
|
+
let [t, n] = J(null), r = t ? {
|
|
2278
2278
|
isOpen: !0,
|
|
2279
2279
|
currentReaction: t.action,
|
|
2280
2280
|
currentMessage: t.message,
|
|
@@ -2298,7 +2298,7 @@ var bi = Bt(void 0), xi = () => Ut(bi), Si = (e) => /* @__PURE__ */ Y(Ke, {
|
|
|
2298
2298
|
children: e
|
|
2299
2299
|
});
|
|
2300
2300
|
}, Di = () => {
|
|
2301
|
-
let e =
|
|
2301
|
+
let e = Ht(Ti);
|
|
2302
2302
|
if (e === null) throw Error("useFeedbackModal must be used within a FeedbackModalProvider");
|
|
2303
2303
|
return e;
|
|
2304
2304
|
};
|
|
@@ -2323,11 +2323,11 @@ function Oi(e) {
|
|
|
2323
2323
|
//#endregion
|
|
2324
2324
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/feedback/TurnFeedback.tsx
|
|
2325
2325
|
var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
2326
|
-
let i = p(), { open: a } = Di(), [o, s] =
|
|
2326
|
+
let i = p(), { open: a } = Di(), [o, s] = J(null);
|
|
2327
2327
|
return /* @__PURE__ */ X("div", {
|
|
2328
2328
|
className: "flex",
|
|
2329
2329
|
children: [
|
|
2330
|
-
/* @__PURE__ */ Y(
|
|
2330
|
+
/* @__PURE__ */ Y(Me, {
|
|
2331
2331
|
size: "md",
|
|
2332
2332
|
variant: "ghost",
|
|
2333
2333
|
valueToCopy: t,
|
|
@@ -2348,7 +2348,7 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2348
2348
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
2349
2349
|
children: /* @__PURE__ */ Y(u, {
|
|
2350
2350
|
size: "md",
|
|
2351
|
-
icon: o === "like" ?
|
|
2351
|
+
icon: o === "like" ? C : Oe,
|
|
2352
2352
|
color: "default"
|
|
2353
2353
|
})
|
|
2354
2354
|
})
|
|
@@ -2366,7 +2366,7 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2366
2366
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
2367
2367
|
children: /* @__PURE__ */ Y(u, {
|
|
2368
2368
|
size: "md",
|
|
2369
|
-
icon: o === "dislike" ?
|
|
2369
|
+
icon: o === "dislike" ? Qe : Ve,
|
|
2370
2370
|
color: "default"
|
|
2371
2371
|
})
|
|
2372
2372
|
})
|
|
@@ -2374,14 +2374,14 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2374
2374
|
]
|
|
2375
2375
|
});
|
|
2376
2376
|
}, Ai = ({ icon: e, title: n, children: r, open: i, defaultOpen: a = !1, onOpenChange: o, lockOpen: c = !1 }) => {
|
|
2377
|
-
let [l, d] =
|
|
2378
|
-
return /* @__PURE__ */ X(
|
|
2377
|
+
let [l, d] = J(a), f = t(), p = i !== void 0, m = p ? i : l;
|
|
2378
|
+
return /* @__PURE__ */ X(I, {
|
|
2379
2379
|
className: "mb-1 w-full",
|
|
2380
2380
|
open: m,
|
|
2381
2381
|
onOpenChange: (e) => {
|
|
2382
2382
|
c || (p || d(e), o?.(e));
|
|
2383
2383
|
},
|
|
2384
|
-
children: [/* @__PURE__ */ X(
|
|
2384
|
+
children: [/* @__PURE__ */ X(me, {
|
|
2385
2385
|
disabled: c,
|
|
2386
2386
|
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"),
|
|
2387
2387
|
children: [
|
|
@@ -2396,7 +2396,7 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2396
2396
|
className: "min-h-6 flex items-center",
|
|
2397
2397
|
children: /* @__PURE__ */ Y("span", { children: n })
|
|
2398
2398
|
}),
|
|
2399
|
-
c ? null : /* @__PURE__ */ Y(u, { icon:
|
|
2399
|
+
c ? null : /* @__PURE__ */ Y(u, { icon: St })
|
|
2400
2400
|
]
|
|
2401
2401
|
}), /* @__PURE__ */ Y(fe, {
|
|
2402
2402
|
forceMount: !0,
|
|
@@ -2423,8 +2423,8 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2423
2423
|
})]
|
|
2424
2424
|
});
|
|
2425
2425
|
}, ji = 1e3, Mi = 1e3, Ni = ({ startedAt: e }) => {
|
|
2426
|
-
let t = p(), [n, r] =
|
|
2427
|
-
if (
|
|
2426
|
+
let t = p(), [n, r] = J(() => e === null ? 0 : Date.now() - e);
|
|
2427
|
+
if (G(() => {
|
|
2428
2428
|
if (e === null) {
|
|
2429
2429
|
r(0);
|
|
2430
2430
|
return;
|
|
@@ -2448,13 +2448,13 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2448
2448
|
}), s]
|
|
2449
2449
|
});
|
|
2450
2450
|
}, Pi = ({ titles: e, title: t, inProgress: n, isWriting: r, startedAt: i = null }) => {
|
|
2451
|
-
let a = p(), [o, s] =
|
|
2452
|
-
|
|
2451
|
+
let a = p(), [o, s] = J(!!n), c = q(n);
|
|
2452
|
+
G(() => {
|
|
2453
2453
|
c.current && !n ? s(!1) : n && !o && s(!0), c.current = n;
|
|
2454
2454
|
}, [n, o]);
|
|
2455
2455
|
let l = n ? a.ai.thoughtsGroupTitle : t ?? a.ai.thoughtsGroupTitle, u = e.length - 1, d = (e) => !n || r ? "completed" : e === u ? "executing" : "completed";
|
|
2456
2456
|
return /* @__PURE__ */ Y(Ai, {
|
|
2457
|
-
icon:
|
|
2457
|
+
icon: ke,
|
|
2458
2458
|
title: l,
|
|
2459
2459
|
open: o,
|
|
2460
2460
|
onOpenChange: s,
|
|
@@ -2475,24 +2475,24 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2475
2475
|
}, n))
|
|
2476
2476
|
})
|
|
2477
2477
|
});
|
|
2478
|
-
}, Fi = (e) => /* @__PURE__ */ Y(
|
|
2478
|
+
}, Fi = (e) => /* @__PURE__ */ Y(qe, {
|
|
2479
2479
|
content: e,
|
|
2480
2480
|
format: "markdown"
|
|
2481
2481
|
}), Ii = ({ text: e, renderMarkdown: t }) => /* @__PURE__ */ X("div", {
|
|
2482
2482
|
className: "flex max-w-[90%] items-start gap-2 self-end pb-1 pr-2 text-f1-foreground-tertiary",
|
|
2483
2483
|
children: [/* @__PURE__ */ Y("div", {
|
|
2484
2484
|
className: "flex h-5 items-center",
|
|
2485
|
-
children: /* @__PURE__ */ Y(u, { icon:
|
|
2485
|
+
children: /* @__PURE__ */ Y(u, { icon: xe })
|
|
2486
2486
|
}), /* @__PURE__ */ Y("div", {
|
|
2487
2487
|
className: "min-w-0 whitespace-pre-wrap text-base leading-5 [&>div]:flex [&>div]:flex-col [&>div]:gap-1 [&_p]:m-0",
|
|
2488
2488
|
children: (t ?? Fi)(e)
|
|
2489
2489
|
})]
|
|
2490
2490
|
}), Li = ({ message: e, onReplyQuote: t, autoScrollIntoView: n = !0, renderMarkdown: r }) => {
|
|
2491
|
-
let i =
|
|
2492
|
-
|
|
2491
|
+
let i = q(null), a = q(null);
|
|
2492
|
+
G(() => {
|
|
2493
2493
|
i.current && n && i.current.scrollIntoView({ behavior: "smooth" });
|
|
2494
2494
|
}, [n]);
|
|
2495
|
-
let o = e?.content, s = e?.rawData, c =
|
|
2495
|
+
let o = e?.content, s = e?.rawData, c = K(() => Mr({
|
|
2496
2496
|
content: o,
|
|
2497
2497
|
rawData: s
|
|
2498
2498
|
}), [o, s]), l = (Nr(o, "user") ?? "").trim(), u = e?.replyQuote ?? null, d = l.length > 0, { anchor: f, clear: p } = gi({
|
|
@@ -2549,10 +2549,10 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2549
2549
|
})]
|
|
2550
2550
|
}, r);
|
|
2551
2551
|
}, Wi = ({ messages: e, caption: n, subtitle: r, cta: i, onClick: a, fullscreen: o = !1 }) => {
|
|
2552
|
-
let [s, c] =
|
|
2553
|
-
return
|
|
2552
|
+
let [s, c] = J(0), [l, u] = J(0), [d, f] = J("starting"), p = t(), m = e[s] ?? "", h = e.join("\0"), g = q(!0);
|
|
2553
|
+
return G(() => {
|
|
2554
2554
|
g.current ? g.current = !1 : (c(0), u(0), f("writing"));
|
|
2555
|
-
}, [h]),
|
|
2555
|
+
}, [h]), G(() => {
|
|
2556
2556
|
if (p) return;
|
|
2557
2557
|
let t;
|
|
2558
2558
|
if (d === "starting") t = setTimeout(() => f("writing"), Bi);
|
|
@@ -2603,20 +2603,20 @@ var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2603
2603
|
})
|
|
2604
2604
|
});
|
|
2605
2605
|
}, Gi = (e, t) => {
|
|
2606
|
-
let [n, r] =
|
|
2607
|
-
return
|
|
2606
|
+
let [n, r] = J(null);
|
|
2607
|
+
return G(() => {
|
|
2608
2608
|
r(e ? (e) => e ?? t ?? Date.now() : null);
|
|
2609
2609
|
}, [e, t]), n;
|
|
2610
2610
|
};
|
|
2611
2611
|
//#endregion
|
|
2612
2612
|
//#region src/addons/ai/ai/F0AiMessagesContainer/useMessageScroll.ts
|
|
2613
2613
|
function Ki({ viewportRef: e, contentRef: t, endRef: n, lastTurnRef: r, turnsCount: i, freezeTurnMinHeight: a = !1 }) {
|
|
2614
|
-
let [o, s] =
|
|
2614
|
+
let [o, s] = J(0), [c, l] = J(!1), u = q(i), d = q(a);
|
|
2615
2615
|
d.current = a;
|
|
2616
|
-
let f =
|
|
2616
|
+
let f = W((e = "smooth") => {
|
|
2617
2617
|
n.current?.scrollIntoView({ behavior: e });
|
|
2618
2618
|
}, [n]);
|
|
2619
|
-
|
|
2619
|
+
G(() => {
|
|
2620
2620
|
let n = e.current, r = t.current;
|
|
2621
2621
|
if (!n || !r) return;
|
|
2622
2622
|
let i = new ResizeObserver(() => {
|
|
@@ -2626,16 +2626,16 @@ function Ki({ viewportRef: e, contentRef: t, endRef: n, lastTurnRef: r, turnsCou
|
|
|
2626
2626
|
});
|
|
2627
2627
|
return i.observe(n), i.observe(r), () => i.disconnect();
|
|
2628
2628
|
}, [e, t]);
|
|
2629
|
-
let p =
|
|
2629
|
+
let p = W(() => {
|
|
2630
2630
|
let t = e.current;
|
|
2631
2631
|
if (!t) return;
|
|
2632
2632
|
let { scrollTop: n, scrollHeight: r, clientHeight: i } = t, a = r - n - i;
|
|
2633
2633
|
l(a > i);
|
|
2634
2634
|
}, [e]);
|
|
2635
|
-
return
|
|
2635
|
+
return G(() => {
|
|
2636
2636
|
let t = e.current;
|
|
2637
2637
|
if (t) return t.addEventListener("scroll", p, { passive: !0 }), () => t.removeEventListener("scroll", p);
|
|
2638
|
-
}, [p, e]),
|
|
2638
|
+
}, [p, e]), G(() => {
|
|
2639
2639
|
i > u.current && requestAnimationFrame(() => {
|
|
2640
2640
|
requestAnimationFrame(() => {
|
|
2641
2641
|
let t = e.current, n = r.current;
|
|
@@ -2665,22 +2665,22 @@ var qi = {
|
|
|
2665
2665
|
onThumbsDown: () => {}
|
|
2666
2666
|
}, Ji = (e) => {
|
|
2667
2667
|
let t = $e(), n = /* @__PURE__ */ Y(Ei, { children: /* @__PURE__ */ Y(Yi, { ...e }) });
|
|
2668
|
-
return e.filePreviews || !t.provided ? /* @__PURE__ */ Y(
|
|
2668
|
+
return e.filePreviews || !t.provided ? /* @__PURE__ */ Y(Ae, {
|
|
2669
2669
|
filePreviews: e.filePreviews,
|
|
2670
2670
|
children: n
|
|
2671
2671
|
}) : n;
|
|
2672
2672
|
}, Yi = ({ 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 }) => {
|
|
2673
|
-
let { modal: D, handleSubmit: O, handleClose:
|
|
2674
|
-
let e = i ??
|
|
2673
|
+
let { modal: D, handleSubmit: O, handleClose: ee } = Oi(g ?? qi), k = p(), A = C ?? Ci, j = w ?? Li, M = K(() => {
|
|
2674
|
+
let e = i ?? k.ai.defaultInitialMessage;
|
|
2675
2675
|
return (Array.isArray(e) ? e : [e]).filter((e) => typeof e == "string" && e.length > 0);
|
|
2676
|
-
}, [i,
|
|
2677
|
-
viewportRef:
|
|
2678
|
-
contentRef:
|
|
2679
|
-
endRef:
|
|
2680
|
-
lastTurnRef:
|
|
2676
|
+
}, [i, k.ai.defaultInitialMessage]), N = !t && e.length === 0 && M.length > 0, P = q(null), F = q(null), I = q(null), te = q(null), ne = q(null), { showScrollBtn: re, turnMinHeight: L, scrollToBottom: ie } = Ki({
|
|
2677
|
+
viewportRef: P,
|
|
2678
|
+
contentRef: F,
|
|
2679
|
+
endRef: I,
|
|
2680
|
+
lastTurnRef: ne,
|
|
2681
2681
|
turnsCount: e.length,
|
|
2682
2682
|
freezeTurnMinHeight: v
|
|
2683
|
-
}), z = e[e.length - 1],
|
|
2683
|
+
}), z = e[e.length - 1], B = Gi(!(!z || z.endIndicator !== "thinking" && !z.thinking?.inProgress), z?.thinking?.startedAt), ae = (t, n) => {
|
|
2684
2684
|
let r = n === e.length - 1, i = {
|
|
2685
2685
|
renderToolCall: u,
|
|
2686
2686
|
onReplyQuote: d,
|
|
@@ -2693,51 +2693,51 @@ var qi = {
|
|
|
2693
2693
|
inProgress: t.isInProgress,
|
|
2694
2694
|
index: r,
|
|
2695
2695
|
isCurrentMessage: !1,
|
|
2696
|
-
AssistantMessage:
|
|
2697
|
-
UserMessage:
|
|
2696
|
+
AssistantMessage: A,
|
|
2697
|
+
UserMessage: j,
|
|
2698
2698
|
onRegenerate: T,
|
|
2699
2699
|
onCopy: E,
|
|
2700
2700
|
rawData: e.rawData || {},
|
|
2701
2701
|
...i
|
|
2702
2702
|
};
|
|
2703
|
-
return /* @__PURE__ */ Y(
|
|
2703
|
+
return /* @__PURE__ */ Y(j, { ...a }, `${n}-u-${r}`);
|
|
2704
2704
|
}, o = (e, a) => {
|
|
2705
2705
|
let o = r && a === t.assistantMessages.length - 1, s = t.userMessages.length + a, c = {
|
|
2706
2706
|
message: e,
|
|
2707
2707
|
inProgress: t.isInProgress,
|
|
2708
2708
|
index: s,
|
|
2709
2709
|
isCurrentMessage: o,
|
|
2710
|
-
AssistantMessage:
|
|
2711
|
-
UserMessage:
|
|
2710
|
+
AssistantMessage: A,
|
|
2711
|
+
UserMessage: j,
|
|
2712
2712
|
onRegenerate: T,
|
|
2713
2713
|
onCopy: E,
|
|
2714
2714
|
rawData: e.rawData || {},
|
|
2715
2715
|
...i
|
|
2716
2716
|
};
|
|
2717
|
-
return /* @__PURE__ */ Y(
|
|
2717
|
+
return /* @__PURE__ */ Y(A, {
|
|
2718
2718
|
...c,
|
|
2719
2719
|
isGenerating: t.isInProgress && o,
|
|
2720
2720
|
isLoading: t.isInProgress && o && !Xi(e)
|
|
2721
2721
|
}, `${n}-a-${a}`);
|
|
2722
2722
|
};
|
|
2723
2723
|
return /* @__PURE__ */ X("div", {
|
|
2724
|
-
ref: r ?
|
|
2724
|
+
ref: r ? ne : void 0,
|
|
2725
2725
|
className: y("flex flex-col items-start justify-start gap-2 px-1", r && "pb-5"),
|
|
2726
|
-
style: { minHeight: r &&
|
|
2726
|
+
style: { minHeight: r && L || void 0 },
|
|
2727
2727
|
children: [
|
|
2728
2728
|
t.userMessages.map((e, t) => a(e, t)),
|
|
2729
2729
|
t.thinking && t.thinking.titles.length > 0 ? /* @__PURE__ */ Y(Pi, {
|
|
2730
2730
|
titles: t.thinking.titles,
|
|
2731
|
-
title:
|
|
2731
|
+
title: k.ai.thoughtsGroupTitle,
|
|
2732
2732
|
inProgress: t.thinking.inProgress,
|
|
2733
2733
|
isWriting: t.thinking.isWriting,
|
|
2734
|
-
startedAt: r ?
|
|
2734
|
+
startedAt: r ? B : null
|
|
2735
2735
|
}) : null,
|
|
2736
2736
|
t.assistantMessages.map((e, t) => o(e, t)),
|
|
2737
2737
|
t.endIndicator === "thinking" ? /* @__PURE__ */ Y(R, {
|
|
2738
|
-
title:
|
|
2738
|
+
title: k.ai.thinking,
|
|
2739
2739
|
status: "executing",
|
|
2740
|
-
suffix: /* @__PURE__ */ Y(Ni, { startedAt:
|
|
2740
|
+
suffix: /* @__PURE__ */ Y(Ni, { startedAt: B })
|
|
2741
2741
|
}) : null,
|
|
2742
2742
|
t.endIndicator === "activity" ? /* @__PURE__ */ Y(R, { status: "writing" }) : null,
|
|
2743
2743
|
t.feedback ? /* @__PURE__ */ Y(ki, {
|
|
@@ -2749,42 +2749,42 @@ var qi = {
|
|
|
2749
2749
|
]
|
|
2750
2750
|
}, `turn-${n}`);
|
|
2751
2751
|
};
|
|
2752
|
-
return /* @__PURE__ */ X(
|
|
2752
|
+
return /* @__PURE__ */ X(Kt, { children: [/* @__PURE__ */ X("div", {
|
|
2753
2753
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
2754
2754
|
children: [/* @__PURE__ */ Y("div", {
|
|
2755
|
-
ref:
|
|
2755
|
+
ref: P,
|
|
2756
2756
|
className: y("flex-1 overflow-y-scroll", "[scrollbar-width:thin] [scrollbar-color:transparent_transparent]", "hover:[scrollbar-color:var(--scrollbar-thumb)_transparent]", "[&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent", "[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-transparent", "hover:[&::-webkit-scrollbar-thumb]:bg-f1-background-inverse/30"),
|
|
2757
2757
|
children: /* @__PURE__ */ X("div", {
|
|
2758
|
-
ref:
|
|
2758
|
+
ref: F,
|
|
2759
2759
|
className: "flex min-h-full flex-col items-center px-4 pt-4 pb-[calc(1rem+var(--f0-ai-composer-overlap,0px))]",
|
|
2760
2760
|
children: [
|
|
2761
2761
|
/* @__PURE__ */ X("div", {
|
|
2762
|
-
className: y(
|
|
2762
|
+
className: y(N ? "flex flex-1" : "flex flex-col gap-6", "w-full max-w-content"),
|
|
2763
2763
|
children: [
|
|
2764
2764
|
t ? /* @__PURE__ */ Y(Zi, {}) : null,
|
|
2765
|
-
|
|
2766
|
-
messages:
|
|
2765
|
+
N ? /* @__PURE__ */ Y(Wi, {
|
|
2766
|
+
messages: M,
|
|
2767
2767
|
caption: a,
|
|
2768
2768
|
subtitle: o,
|
|
2769
2769
|
cta: c,
|
|
2770
2770
|
onClick: l,
|
|
2771
2771
|
fullscreen: x
|
|
2772
2772
|
}) : null,
|
|
2773
|
-
t ? null : e.map((e, t) =>
|
|
2773
|
+
t ? null : e.map((e, t) => ae(e, t)),
|
|
2774
2774
|
r
|
|
2775
2775
|
]
|
|
2776
2776
|
}),
|
|
2777
2777
|
/* @__PURE__ */ Y("div", {
|
|
2778
|
-
ref:
|
|
2778
|
+
ref: te,
|
|
2779
2779
|
className: "h-px shrink-0",
|
|
2780
2780
|
"aria-hidden": !0
|
|
2781
2781
|
}),
|
|
2782
2782
|
/* @__PURE__ */ Y("footer", {
|
|
2783
2783
|
className: "copilotKitMessagesFooter",
|
|
2784
|
-
ref:
|
|
2784
|
+
ref: I,
|
|
2785
2785
|
children: S
|
|
2786
2786
|
}),
|
|
2787
|
-
/* @__PURE__ */ Y(n, { children:
|
|
2787
|
+
/* @__PURE__ */ Y(n, { children: re ? /* @__PURE__ */ Y(s.div, {
|
|
2788
2788
|
className: "sticky bottom-[calc(0.5rem+var(--f0-ai-composer-overlap,0px))] z-10 flex justify-center",
|
|
2789
2789
|
initial: {
|
|
2790
2790
|
opacity: 0,
|
|
@@ -2801,18 +2801,18 @@ var qi = {
|
|
|
2801
2801
|
transition: { duration: .2 },
|
|
2802
2802
|
children: /* @__PURE__ */ Y(_, {
|
|
2803
2803
|
onClick: () => ie(),
|
|
2804
|
-
label:
|
|
2804
|
+
label: k.ai.scrollToBottom,
|
|
2805
2805
|
variant: "neutral",
|
|
2806
|
-
icon:
|
|
2806
|
+
icon: Tt,
|
|
2807
2807
|
hideLabel: !0
|
|
2808
2808
|
})
|
|
2809
2809
|
}) : null })
|
|
2810
2810
|
]
|
|
2811
2811
|
})
|
|
2812
|
-
}), !b && !
|
|
2812
|
+
}), !b && !N ? /* @__PURE__ */ Y(Xe, { position: "top" }, "shadow-top") : null]
|
|
2813
2813
|
}), D.isOpen ? /* @__PURE__ */ Y(wi, {
|
|
2814
2814
|
onSubmit: O,
|
|
2815
|
-
onClose:
|
|
2815
|
+
onClose: ee,
|
|
2816
2816
|
reactionType: D.currentReaction,
|
|
2817
2817
|
message: D.currentMessage
|
|
2818
2818
|
}) : null] });
|
|
@@ -2830,7 +2830,7 @@ var qi = {
|
|
|
2830
2830
|
/* @__PURE__ */ Y(d, { className: "h-5 w-4/5 rounded-md" })
|
|
2831
2831
|
]
|
|
2832
2832
|
})
|
|
2833
|
-
}), Qi = { ai:
|
|
2833
|
+
}), Qi = { ai: ut.ai }, $i = zt(null);
|
|
2834
2834
|
function ea({ children: e, translations: t }) {
|
|
2835
2835
|
return /* @__PURE__ */ Y($i.Provider, {
|
|
2836
2836
|
value: t,
|
|
@@ -2838,14 +2838,14 @@ function ea({ children: e, translations: t }) {
|
|
|
2838
2838
|
});
|
|
2839
2839
|
}
|
|
2840
2840
|
function ta() {
|
|
2841
|
-
let e =
|
|
2841
|
+
let e = Ht($i);
|
|
2842
2842
|
if (e === null) throw Error("useAiChatTranslations must be used within an AiChatTranslationsProvider");
|
|
2843
2843
|
return e;
|
|
2844
2844
|
}
|
|
2845
2845
|
//#endregion
|
|
2846
2846
|
//#region src/addons/ai/ai/F0AiChat/providers/useCanvasEntities.ts
|
|
2847
2847
|
function na() {
|
|
2848
|
-
let { canvasEntities: e } =
|
|
2848
|
+
let { canvasEntities: e } = V();
|
|
2849
2849
|
return e;
|
|
2850
2850
|
}
|
|
2851
2851
|
//#endregion
|
|
@@ -2881,15 +2881,15 @@ var ia = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: i,
|
|
|
2881
2881
|
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"),
|
|
2882
2882
|
children: e ? /* @__PURE__ */ Y("div", { className: "h-2 w-2 rounded-full bg-f1-background" }) : null
|
|
2883
2883
|
}), oa = 132, sa = ({ mode: e, hasSelection: t, hasCustomText: n, customAnswerText: i, isCustomAnswerActive: a, canProceed: o, inputRef: s, onActivate: c, onChangeText: l, onToggleActive: u, onConfirm: d }) => {
|
|
2884
|
-
let f = p().ai.clarifyingQuestion.typeYourAnswer, m =
|
|
2885
|
-
|
|
2884
|
+
let f = p().ai.clarifyingQuestion.typeYourAnswer, m = q(null), h = r(m, s);
|
|
2885
|
+
Gt(() => {
|
|
2886
2886
|
let e = m.current;
|
|
2887
2887
|
if (!e) return;
|
|
2888
2888
|
e.style.height = "auto";
|
|
2889
2889
|
let t = Math.min(e.scrollHeight, oa);
|
|
2890
2890
|
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > oa ? "auto" : "hidden";
|
|
2891
2891
|
}, [i]);
|
|
2892
|
-
let g = e === "single" ? /* @__PURE__ */ Y(aa, { isSelected: n && !t }) : /* @__PURE__ */ Y(
|
|
2892
|
+
let g = e === "single" ? /* @__PURE__ */ Y(aa, { isSelected: n && !t }) : /* @__PURE__ */ Y(jt, {
|
|
2893
2893
|
checked: a,
|
|
2894
2894
|
onCheckedChange: () => u(!a),
|
|
2895
2895
|
title: f,
|
|
@@ -2911,7 +2911,7 @@ var ia = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: i,
|
|
|
2911
2911
|
className: "min-w-0 flex-1 resize-none bg-transparent text-base text-f1-foreground outline-none placeholder:text-f1-foreground-tertiary"
|
|
2912
2912
|
})]
|
|
2913
2913
|
});
|
|
2914
|
-
}, ca =
|
|
2914
|
+
}, ca = U(({ option: e, isSelected: t, mode: n, isTabStop: r, onToggle: i, onKeyNavigate: a }, o) => n === "single" ? /* @__PURE__ */ X("div", {
|
|
2915
2915
|
ref: o,
|
|
2916
2916
|
role: "radio",
|
|
2917
2917
|
"aria-checked": t,
|
|
@@ -2928,7 +2928,7 @@ var ia = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: i,
|
|
|
2928
2928
|
}) : /* @__PURE__ */ X("div", {
|
|
2929
2929
|
ref: o,
|
|
2930
2930
|
className: y("flex cursor-pointer items-center rounded-md pl-2 transition-[background-color,transform] hover:bg-f1-background-secondary active:scale-[0.99]"),
|
|
2931
|
-
children: [/* @__PURE__ */ Y(
|
|
2931
|
+
children: [/* @__PURE__ */ Y(jt, {
|
|
2932
2932
|
checked: t,
|
|
2933
2933
|
onCheckedChange: () => i(e.id),
|
|
2934
2934
|
title: e.label,
|
|
@@ -2952,8 +2952,8 @@ var la = [
|
|
|
2952
2952
|
if (e !== "single") return 0;
|
|
2953
2953
|
let t = r.findIndex((e) => i.includes(e.id));
|
|
2954
2954
|
return t >= 0 ? t : 0;
|
|
2955
|
-
})(), [x, S] =
|
|
2956
|
-
|
|
2955
|
+
})(), [x, S] = J(b), C = q([]);
|
|
2956
|
+
G(() => {
|
|
2957
2957
|
p && e === "single" && C.current[x]?.focus();
|
|
2958
2958
|
}, []);
|
|
2959
2959
|
let w = (t) => {
|
|
@@ -3049,7 +3049,7 @@ var la = [
|
|
|
3049
3049
|
disabled: n,
|
|
3050
3050
|
label: l.ai.clarifyingQuestion.back,
|
|
3051
3051
|
hideLabel: !0,
|
|
3052
|
-
icon:
|
|
3052
|
+
icon: Dt
|
|
3053
3053
|
}),
|
|
3054
3054
|
/* @__PURE__ */ Y("span", {
|
|
3055
3055
|
className: "translate-y-px text-sm font-semibold text-f1-foreground-tertiary",
|
|
@@ -3063,7 +3063,7 @@ var la = [
|
|
|
3063
3063
|
disabled: r || !i,
|
|
3064
3064
|
label: l.ai.clarifyingQuestion.next,
|
|
3065
3065
|
hideLabel: !0,
|
|
3066
|
-
icon:
|
|
3066
|
+
icon: St
|
|
3067
3067
|
})
|
|
3068
3068
|
]
|
|
3069
3069
|
}) : null,
|
|
@@ -3074,7 +3074,7 @@ var la = [
|
|
|
3074
3074
|
onClick: c,
|
|
3075
3075
|
label: l.actions.cancel,
|
|
3076
3076
|
hideLabel: !0,
|
|
3077
|
-
icon:
|
|
3077
|
+
icon: S
|
|
3078
3078
|
})
|
|
3079
3079
|
]
|
|
3080
3080
|
});
|
|
@@ -3082,23 +3082,23 @@ var la = [
|
|
|
3082
3082
|
clarifyingQuestion: e,
|
|
3083
3083
|
isSubmitDisabled: t
|
|
3084
3084
|
}), ya = ({ clarifyingQuestion: e, isSubmitDisabled: r }) => {
|
|
3085
|
-
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 =
|
|
3085
|
+
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 = q(null), O = S ?? "single", ee = l > 1, k = c === 0, A = c === l - 1, j = ee ? i.t("ai.clarifyingQuestion.stepOf", {
|
|
3086
3086
|
current: String(c + 1),
|
|
3087
3087
|
total: String(l)
|
|
3088
|
-
}) : void 0,
|
|
3089
|
-
|
|
3090
|
-
},
|
|
3091
|
-
|
|
3092
|
-
},
|
|
3088
|
+
}) : void 0, M = x.length > 0, N = (T ?? "").trim().length > 0, P = M || E && N || C === !0, F = r === !0 && A, I = () => {
|
|
3089
|
+
F || d();
|
|
3090
|
+
}, te = () => {
|
|
3091
|
+
F || f();
|
|
3092
|
+
}, ne = (e) => {
|
|
3093
3093
|
let t = O === "single" && x.includes(e);
|
|
3094
|
-
u(e), O === "single" && !
|
|
3095
|
-
},
|
|
3094
|
+
u(e), O === "single" && !A && !t && Promise.resolve().then(d);
|
|
3095
|
+
}, re = A ? i.ai.clarifyingQuestion.submit : i.ai.clarifyingQuestion.next, L = C === !0 && !M && !(E && N), R = () => {
|
|
3096
3096
|
v(), requestAnimationFrame(() => {
|
|
3097
3097
|
D.current?.focus();
|
|
3098
3098
|
});
|
|
3099
3099
|
}, ie = (e) => {
|
|
3100
3100
|
e.key === "Escape" && (e.preventDefault(), m());
|
|
3101
|
-
}, z = a ? 0 : ga,
|
|
3101
|
+
}, z = a ? 0 : ga, B = a ? 0 : _a;
|
|
3102
3102
|
return /* @__PURE__ */ X("div", {
|
|
3103
3103
|
className: "flex flex-col",
|
|
3104
3104
|
onKeyDown: ie,
|
|
@@ -3120,16 +3120,16 @@ var la = [
|
|
|
3120
3120
|
exit: {
|
|
3121
3121
|
opacity: 0,
|
|
3122
3122
|
transition: {
|
|
3123
|
-
duration:
|
|
3123
|
+
duration: B,
|
|
3124
3124
|
ease: ha
|
|
3125
3125
|
}
|
|
3126
3126
|
},
|
|
3127
3127
|
children: [/* @__PURE__ */ Y(ma, {
|
|
3128
3128
|
question: y,
|
|
3129
|
-
stepLabel:
|
|
3130
|
-
isFirstStep:
|
|
3131
|
-
isFinalStep:
|
|
3132
|
-
canProceed:
|
|
3129
|
+
stepLabel: j,
|
|
3130
|
+
isFirstStep: k,
|
|
3131
|
+
isFinalStep: A,
|
|
3132
|
+
canProceed: P,
|
|
3133
3133
|
onBack: h,
|
|
3134
3134
|
onNext: d,
|
|
3135
3135
|
onCancel: m
|
|
@@ -3139,27 +3139,27 @@ var la = [
|
|
|
3139
3139
|
options: b,
|
|
3140
3140
|
selectedOptionIds: x,
|
|
3141
3141
|
allowCustomAnswer: w,
|
|
3142
|
-
hasSelection:
|
|
3143
|
-
hasCustomText:
|
|
3142
|
+
hasSelection: M,
|
|
3143
|
+
hasCustomText: N,
|
|
3144
3144
|
customAnswerText: T,
|
|
3145
3145
|
isCustomAnswerActive: E,
|
|
3146
|
-
canProceed:
|
|
3146
|
+
canProceed: P,
|
|
3147
3147
|
customInputRef: D,
|
|
3148
|
-
onToggleOption:
|
|
3149
|
-
onActivateCustom:
|
|
3148
|
+
onToggleOption: ne,
|
|
3149
|
+
onActivateCustom: R,
|
|
3150
3150
|
onChangeCustomText: g,
|
|
3151
3151
|
onToggleCustomActive: _,
|
|
3152
|
-
onConfirm:
|
|
3152
|
+
onConfirm: I
|
|
3153
3153
|
})]
|
|
3154
3154
|
}, c)
|
|
3155
3155
|
})
|
|
3156
3156
|
}), /* @__PURE__ */ Y(ia, {
|
|
3157
|
-
canProceed:
|
|
3158
|
-
submitDisabled:
|
|
3159
|
-
label:
|
|
3160
|
-
onConfirm:
|
|
3161
|
-
onSkip:
|
|
3162
|
-
showSkip:
|
|
3157
|
+
canProceed: P,
|
|
3158
|
+
submitDisabled: F,
|
|
3159
|
+
label: re,
|
|
3160
|
+
onConfirm: I,
|
|
3161
|
+
onSkip: te,
|
|
3162
|
+
showSkip: L
|
|
3163
3163
|
})]
|
|
3164
3164
|
});
|
|
3165
3165
|
};
|
|
@@ -3485,22 +3485,22 @@ var Da = class {
|
|
|
3485
3485
|
repeatType: "mirror"
|
|
3486
3486
|
};
|
|
3487
3487
|
function Pa(e) {
|
|
3488
|
-
let [t, n] =
|
|
3488
|
+
let [t, n] = J(e), r = Re(e), i = q(null);
|
|
3489
3489
|
return Yt(r, "change", (e) => n(e)), {
|
|
3490
3490
|
value: t,
|
|
3491
3491
|
motionValue: r,
|
|
3492
3492
|
controls: i,
|
|
3493
|
-
animate:
|
|
3494
|
-
i.current =
|
|
3493
|
+
animate: W((e, t) => {
|
|
3494
|
+
i.current = Te(r, e, t);
|
|
3495
3495
|
}, [r])
|
|
3496
3496
|
};
|
|
3497
3497
|
}
|
|
3498
3498
|
function Fa(e, t) {
|
|
3499
|
-
let [n, r] =
|
|
3499
|
+
let [n, r] = J(Oa), { value: i, animate: a, motionValue: o } = Pa(ja), { value: s, animate: c } = Pa(ka), { value: l, animate: u } = Pa(Aa), { value: d, animate: f } = Pa(Ma), p = Jt(t, {
|
|
3500
3500
|
fftSize: 512,
|
|
3501
3501
|
smoothingTimeConstant: .55
|
|
3502
3502
|
});
|
|
3503
|
-
return
|
|
3503
|
+
return G(() => {
|
|
3504
3504
|
switch (e) {
|
|
3505
3505
|
case "idle":
|
|
3506
3506
|
case "failed":
|
|
@@ -3530,7 +3530,7 @@ function Fa(e, t) {
|
|
|
3530
3530
|
c,
|
|
3531
3531
|
u,
|
|
3532
3532
|
f
|
|
3533
|
-
]),
|
|
3533
|
+
]), G(() => {
|
|
3534
3534
|
e === "speaking" && p > 0 && !o.isAnimating() && a(.2 + .2 * p, { duration: 0 });
|
|
3535
3535
|
}, [
|
|
3536
3536
|
e,
|
|
@@ -3704,7 +3704,7 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3704
3704
|
0,
|
|
3705
3705
|
1
|
|
3706
3706
|
], precision: a = "highp", style: o, contextAttributes: s = {}, lerp: c = 1, devicePixelRatio: l = 1, onDoneLoadingTextures: u, onError: d = console.error, onWarning: f = console.warn }) {
|
|
3707
|
-
let p =
|
|
3707
|
+
let p = q(null), m = q(null), h = q(null), g = q(null), _ = q(void 0), v = q(void 0), y = q(!1), b = q(void 0), x = q(0), S = q([0, 0]), C = q([]), w = q(0), T = q(void 0), E = q({
|
|
3708
3708
|
[Ba]: {
|
|
3709
3709
|
type: "float",
|
|
3710
3710
|
isNeeded: !1,
|
|
@@ -3755,15 +3755,15 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3755
3755
|
0
|
|
3756
3756
|
]
|
|
3757
3757
|
}
|
|
3758
|
-
}), D =
|
|
3758
|
+
}), D = q(r), O = (e, t) => {
|
|
3759
3759
|
let n = "width" in e ? e.width ?? 0 : 0, r = "height" in e ? e.height ?? 0 : 0, i = E.current.iChannelResolution;
|
|
3760
3760
|
if (!i) return;
|
|
3761
3761
|
Array.isArray(i.value) || (i.value = []);
|
|
3762
3762
|
let a = i.value;
|
|
3763
3763
|
a[t * 3] = n * l, a[t * 3 + 1] = r * l, a[t * 3 + 2] = 0;
|
|
3764
|
-
},
|
|
3764
|
+
}, ee = () => {
|
|
3765
3765
|
p.current && (m.current = p.current.getContext("webgl", s) || p.current.getContext("experimental-webgl", s), m.current?.getExtension("OES_standard_derivatives"), m.current?.getExtension("EXT_shader_texture_lod"));
|
|
3766
|
-
},
|
|
3766
|
+
}, k = () => {
|
|
3767
3767
|
let e = m.current;
|
|
3768
3768
|
h.current = e?.createBuffer() ?? null, e?.bindBuffer(e.ARRAY_BUFFER, h.current), e?.bufferData(e.ARRAY_BUFFER, new Float32Array([
|
|
3769
3769
|
1,
|
|
@@ -3779,19 +3779,19 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3779
3779
|
-1,
|
|
3780
3780
|
0
|
|
3781
3781
|
]), e.STATIC_DRAW);
|
|
3782
|
-
},
|
|
3782
|
+
}, A = ({ alpha: e, beta: t, gamma: n }) => {
|
|
3783
3783
|
E.current.iDeviceOrientation.value = [
|
|
3784
3784
|
e ?? 0,
|
|
3785
3785
|
t ?? 0,
|
|
3786
3786
|
n ?? 0,
|
|
3787
3787
|
window.orientation ?? 0
|
|
3788
3788
|
];
|
|
3789
|
-
},
|
|
3789
|
+
}, j = (e) => {
|
|
3790
3790
|
let [t = 0, n = 0] = so(e), r = t - (b.current?.left ?? 0) - window.pageXOffset, i = (b.current?.height ?? 0) - n - (b.current?.top ?? 0) - window.pageYOffset;
|
|
3791
3791
|
y.current = !0;
|
|
3792
3792
|
let a = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
3793
3793
|
a && (a[2] = r, a[3] = i), S.current[0] = r, S.current[1] = i;
|
|
3794
|
-
},
|
|
3794
|
+
}, M = (e) => {
|
|
3795
3795
|
b.current = p.current?.getBoundingClientRect();
|
|
3796
3796
|
let [t = 0, n = 0] = so(e), r = t - (b.current?.left ?? 0), i = (b.current?.height ?? 0) - n - (b.current?.top ?? 0);
|
|
3797
3797
|
if (c !== 1) S.current[0] = r, S.current[1] = i;
|
|
@@ -3799,10 +3799,10 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3799
3799
|
let e = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
3800
3800
|
e && (e[0] = r, e[1] = i);
|
|
3801
3801
|
}
|
|
3802
|
-
},
|
|
3802
|
+
}, N = () => {
|
|
3803
3803
|
let e = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
3804
3804
|
e && (e[2] = 0, e[3] = 0);
|
|
3805
|
-
},
|
|
3805
|
+
}, P = () => {
|
|
3806
3806
|
let e = m.current;
|
|
3807
3807
|
if (!e) return;
|
|
3808
3808
|
b.current = p.current?.getBoundingClientRect();
|
|
@@ -3811,7 +3811,7 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3811
3811
|
let t = e.getUniformLocation(g.current, Ga);
|
|
3812
3812
|
e.uniform2fv(t, [e.canvas.width, e.canvas.height]);
|
|
3813
3813
|
}
|
|
3814
|
-
},
|
|
3814
|
+
}, F = (e, t) => {
|
|
3815
3815
|
let n = m.current;
|
|
3816
3816
|
if (!n) return null;
|
|
3817
3817
|
let r = n.createShader(e);
|
|
@@ -3822,12 +3822,12 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3822
3822
|
n.deleteShader(r), d?.($(`Shader compiler log: ${e}`));
|
|
3823
3823
|
}
|
|
3824
3824
|
return r;
|
|
3825
|
-
},
|
|
3825
|
+
}, I = (e, t) => {
|
|
3826
3826
|
let n = m.current;
|
|
3827
3827
|
if (!n) return;
|
|
3828
|
-
let r =
|
|
3828
|
+
let r = F(n.FRAGMENT_SHADER, e), i = F(n.VERTEX_SHADER, t);
|
|
3829
3829
|
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)}`)));
|
|
3830
|
-
},
|
|
3830
|
+
}, te = () => {
|
|
3831
3831
|
if (r) for (let e of Object.keys(r)) {
|
|
3832
3832
|
let t = r[e];
|
|
3833
3833
|
if (!t) continue;
|
|
@@ -3841,7 +3841,7 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3841
3841
|
...o ? { arraySize: o } : {}
|
|
3842
3842
|
};
|
|
3843
3843
|
}
|
|
3844
|
-
},
|
|
3844
|
+
}, ne = () => {
|
|
3845
3845
|
let e = m.current;
|
|
3846
3846
|
if (e) {
|
|
3847
3847
|
if (n && n.length > 0) {
|
|
@@ -3862,7 +3862,7 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3862
3862
|
});
|
|
3863
3863
|
} else u && u();
|
|
3864
3864
|
}
|
|
3865
|
-
},
|
|
3865
|
+
}, re = (e) => {
|
|
3866
3866
|
let t = Ia.includes(a ?? "highp"), n = `precision ${t ? a : Ia[1]} float;\n`;
|
|
3867
3867
|
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.`));
|
|
3868
3868
|
let r = n.concat(`#define DPR ${l.toFixed(1)}\n`).concat(e.replace(/texture\(/g, "texture2D("));
|
|
@@ -3872,7 +3872,7 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3872
3872
|
r = lo(r, `uniform ${e.type} ${t}${e.arraySize || ""}; \n`, r.lastIndexOf(n) + n.length), e.isNeeded = !0;
|
|
3873
3873
|
}
|
|
3874
3874
|
return e.includes("mainImage") && (r = r.concat(La)), r;
|
|
3875
|
-
},
|
|
3875
|
+
}, L = (e) => {
|
|
3876
3876
|
let t = m.current;
|
|
3877
3877
|
if (!t || !g.current) return;
|
|
3878
3878
|
let n = w.current ? (e - w.current) / 1e3 : 0;
|
|
@@ -3931,31 +3931,31 @@ function uo({ fs: e, vs: t = za, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3931
3931
|
t.activeTexture(t.TEXTURE0 + e), t.bindTexture(t.TEXTURE_2D, i), t.uniform1i(s, e), r && n.updateTexture(i, a, o);
|
|
3932
3932
|
}
|
|
3933
3933
|
}
|
|
3934
|
-
},
|
|
3934
|
+
}, R = (e) => {
|
|
3935
3935
|
let t = m.current;
|
|
3936
3936
|
if (!t) return;
|
|
3937
|
-
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),
|
|
3937
|
+
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), L(e), t.drawArrays(t.TRIANGLE_STRIP, 0, 4);
|
|
3938
3938
|
let n = E.current.iMouse?.value;
|
|
3939
3939
|
if (E.current.iMouse?.isNeeded && c !== 1 && Array.isArray(n)) {
|
|
3940
3940
|
let e = n[0] ?? 0, t = n[1] ?? 0;
|
|
3941
3941
|
n[0] = co(e, S.current[0] ?? 0, c), n[1] = co(t, S.current[1] ?? 0, c);
|
|
3942
3942
|
}
|
|
3943
|
-
v.current = requestAnimationFrame(
|
|
3943
|
+
v.current = requestAnimationFrame(R);
|
|
3944
3944
|
}, ie = () => {
|
|
3945
3945
|
let e = { passive: !0 };
|
|
3946
|
-
E.current.iMouse?.isNeeded && p.current && (p.current.addEventListener("mousemove",
|
|
3946
|
+
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));
|
|
3947
3947
|
}, z = () => {
|
|
3948
3948
|
let e = { passive: !0 };
|
|
3949
|
-
E.current.iMouse?.isNeeded && p.current && (p.current.removeEventListener("mousemove",
|
|
3949
|
+
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));
|
|
3950
3950
|
};
|
|
3951
|
-
return
|
|
3951
|
+
return G(() => {
|
|
3952
3952
|
D.current = r;
|
|
3953
|
-
}, [r]),
|
|
3953
|
+
}, [r]), G(() => {
|
|
3954
3954
|
let n = C.current;
|
|
3955
3955
|
function r() {
|
|
3956
|
-
|
|
3956
|
+
ee();
|
|
3957
3957
|
let n = m.current;
|
|
3958
|
-
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,
|
|
3958
|
+
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, te(), ne(), I(re(e || Ra), t || za), k(), requestAnimationFrame(R), ie(), P());
|
|
3959
3959
|
}
|
|
3960
3960
|
return requestAnimationFrame(r), () => {
|
|
3961
3961
|
let e = m.current;
|
|
@@ -3999,7 +3999,7 @@ function mo(e) {
|
|
|
3999
3999
|
}
|
|
4000
4000
|
}
|
|
4001
4001
|
function ho({ 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 }) {
|
|
4002
|
-
let p =
|
|
4002
|
+
let p = K(() => mo(o), [o]);
|
|
4003
4003
|
return /* @__PURE__ */ Y("div", {
|
|
4004
4004
|
ref: u,
|
|
4005
4005
|
className: d,
|
|
@@ -4102,7 +4102,7 @@ function go({ size: e = "lg", state: t, color: n, colorShift: r = .05, audioTrac
|
|
|
4102
4102
|
}
|
|
4103
4103
|
//#endregion
|
|
4104
4104
|
//#region src/blocks/ai/F0HILActionConfirmation/F0HILActionConfirmation.tsx
|
|
4105
|
-
var _o = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm: i, cancelText: a, onCancel: o, stackAt: s = "sm" }) => /* @__PURE__ */ Y(
|
|
4105
|
+
var _o = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm: i, cancelText: a, onCancel: o, stackAt: s = "sm" }) => /* @__PURE__ */ Y(re, {
|
|
4106
4106
|
title: e,
|
|
4107
4107
|
description: t,
|
|
4108
4108
|
avatar: n,
|
|
@@ -4129,7 +4129,7 @@ var _o = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4129
4129
|
defaultVariants: { selected: !1 }
|
|
4130
4130
|
}), yo = c({ base: "text-lg font-semibold text-f1-foreground line-clamp-3" }), bo = c({ base: "text-sm text-f1-foreground-secondary leading-normal" }), xo = c({ base: "text-sm font-medium text-f1-foreground leading-normal" }), So = ({ description: e, isRevealed: r, onAskOne: i }) => {
|
|
4131
4131
|
let a = p(), o = t();
|
|
4132
|
-
return /* @__PURE__ */ X(
|
|
4132
|
+
return /* @__PURE__ */ X(Kt, { children: [e ? /* @__PURE__ */ Y("span", {
|
|
4133
4133
|
className: y(bo(), "truncate"),
|
|
4134
4134
|
children: e
|
|
4135
4135
|
}) : null, /* @__PURE__ */ Y(n, { children: i && r ? /* @__PURE__ */ Y(s.div, {
|
|
@@ -4146,7 +4146,7 @@ var _o = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4146
4146
|
1
|
|
4147
4147
|
]
|
|
4148
4148
|
},
|
|
4149
|
-
children: /* @__PURE__ */ Y(
|
|
4149
|
+
children: /* @__PURE__ */ Y(se, {
|
|
4150
4150
|
size: "md",
|
|
4151
4151
|
label: a.ai.ask,
|
|
4152
4152
|
onClick: (e) => {
|
|
@@ -4167,7 +4167,7 @@ var _o = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4167
4167
|
className: y(xo()),
|
|
4168
4168
|
children: e
|
|
4169
4169
|
}) : null]
|
|
4170
|
-
}), To = ({ balance: e }) => /* @__PURE__ */ Y(
|
|
4170
|
+
}), To = ({ balance: e }) => /* @__PURE__ */ Y(wt, {
|
|
4171
4171
|
amount: e.amount,
|
|
4172
4172
|
percentage: e.percentage ?? void 0,
|
|
4173
4173
|
invertStatus: e.invertStatus,
|
|
@@ -4176,32 +4176,32 @@ var _o = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4176
4176
|
let { label: t } = e;
|
|
4177
4177
|
return e.content === "person" ? /* @__PURE__ */ Y(wo, {
|
|
4178
4178
|
label: t,
|
|
4179
|
-
children: /* @__PURE__ */ Y(
|
|
4179
|
+
children: /* @__PURE__ */ Y(ht, {
|
|
4180
4180
|
firstName: e.avatar.firstName,
|
|
4181
4181
|
lastName: e.avatar.lastName,
|
|
4182
4182
|
src: e.avatar.src,
|
|
4183
4183
|
size: "xs"
|
|
4184
4184
|
})
|
|
4185
|
-
}) : e.content === "people" ? /* @__PURE__ */ Y(
|
|
4185
|
+
}) : e.content === "people" ? /* @__PURE__ */ Y(vt, {
|
|
4186
4186
|
type: "person",
|
|
4187
4187
|
avatars: e.avatars,
|
|
4188
4188
|
size: "md",
|
|
4189
4189
|
max: 3
|
|
4190
4190
|
}) : e.content === "team" ? /* @__PURE__ */ Y(wo, {
|
|
4191
4191
|
label: t,
|
|
4192
|
-
children: /* @__PURE__ */ Y(
|
|
4192
|
+
children: /* @__PURE__ */ Y(bt, {
|
|
4193
4193
|
name: e.avatar.name,
|
|
4194
4194
|
src: e.avatar.src,
|
|
4195
4195
|
size: "xs"
|
|
4196
4196
|
})
|
|
4197
4197
|
}) : e.content === "company" ? /* @__PURE__ */ Y(wo, {
|
|
4198
4198
|
label: t,
|
|
4199
|
-
children: /* @__PURE__ */ Y(
|
|
4199
|
+
children: /* @__PURE__ */ Y(_t, {
|
|
4200
4200
|
name: e.avatar.name,
|
|
4201
4201
|
src: e.avatar.src,
|
|
4202
4202
|
size: "xs"
|
|
4203
4203
|
})
|
|
4204
|
-
}) : e.content === "alert" ? /* @__PURE__ */ Y(
|
|
4204
|
+
}) : e.content === "alert" ? /* @__PURE__ */ Y(Et, {
|
|
4205
4205
|
text: e.alertLabel,
|
|
4206
4206
|
level: e.level
|
|
4207
4207
|
}) : e.content === "balance" ? /* @__PURE__ */ Y(To, { balance: e.balance }) : null;
|
|
@@ -4267,17 +4267,17 @@ var Ao = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4267
4267
|
children: e
|
|
4268
4268
|
});
|
|
4269
4269
|
}, Mo = ({ data: e, label: t, invertStatus: n }) => {
|
|
4270
|
-
let r = `sparkline-gradient-${
|
|
4270
|
+
let r = `sparkline-gradient-${Ut().replace(/:/g, "")}`, i = ko(e, n), a = Oo[i];
|
|
4271
4271
|
return /* @__PURE__ */ Y("div", {
|
|
4272
4272
|
className: "flex flex-1 flex-col",
|
|
4273
4273
|
children: /* @__PURE__ */ X("div", {
|
|
4274
4274
|
className: "relative w-full flex-1",
|
|
4275
4275
|
role: "img",
|
|
4276
4276
|
"aria-label": `Sparkline chart showing ${i} trend`,
|
|
4277
|
-
children: [/* @__PURE__ */ Y(
|
|
4277
|
+
children: [/* @__PURE__ */ Y(ce, {
|
|
4278
4278
|
width: "100%",
|
|
4279
4279
|
height: "100%",
|
|
4280
|
-
children: /* @__PURE__ */ X(
|
|
4280
|
+
children: /* @__PURE__ */ X(_e, {
|
|
4281
4281
|
data: e,
|
|
4282
4282
|
margin: {
|
|
4283
4283
|
top: 4,
|
|
@@ -4302,11 +4302,11 @@ var Ao = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4302
4302
|
stopOpacity: .02
|
|
4303
4303
|
})]
|
|
4304
4304
|
}) }),
|
|
4305
|
-
/* @__PURE__ */ Y(
|
|
4305
|
+
/* @__PURE__ */ Y(ye, {
|
|
4306
4306
|
hide: !0,
|
|
4307
4307
|
domain: ["dataMin - 1", "dataMax + 1"]
|
|
4308
4308
|
}),
|
|
4309
|
-
/* @__PURE__ */ Y(
|
|
4309
|
+
/* @__PURE__ */ Y(T, {
|
|
4310
4310
|
type: "linear",
|
|
4311
4311
|
dataKey: "value",
|
|
4312
4312
|
stroke: a.stroke,
|
|
@@ -4314,7 +4314,7 @@ var Ao = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4314
4314
|
fill: `url(#${r})`,
|
|
4315
4315
|
fillOpacity: 1,
|
|
4316
4316
|
isAnimationActive: !1,
|
|
4317
|
-
dot: (t) => /* @__PURE__ */
|
|
4317
|
+
dot: (t) => /* @__PURE__ */ Bt(Ao, {
|
|
4318
4318
|
...t,
|
|
4319
4319
|
key: t.index,
|
|
4320
4320
|
dataLength: e.length,
|
|
@@ -4330,8 +4330,8 @@ var Ao = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4330
4330
|
})]
|
|
4331
4331
|
})
|
|
4332
4332
|
});
|
|
4333
|
-
}, No =
|
|
4334
|
-
let { description: r, heading: i, label: a, selected: o = !1, onClick: c, onAskOne: l, className: u, ...d } = e, [f, p] =
|
|
4333
|
+
}, No = U((e, n) => {
|
|
4334
|
+
let { description: r, heading: i, label: a, selected: o = !1, onClick: c, onAskOne: l, className: u, ...d } = e, [f, p] = J(!1), [m, h] = J(!1), g = f || m, _ = t(), v = g && !!l, x = {
|
|
4335
4335
|
duration: _ ? 0 : .2,
|
|
4336
4336
|
ease: [
|
|
4337
4337
|
.33,
|
|
@@ -4342,7 +4342,7 @@ var Ao = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4342
4342
|
};
|
|
4343
4343
|
return /* @__PURE__ */ X("div", {
|
|
4344
4344
|
className: "relative",
|
|
4345
|
-
children: [o ? /* @__PURE__ */ X(
|
|
4345
|
+
children: [o ? /* @__PURE__ */ X(Kt, { children: [/* @__PURE__ */ Y("div", {
|
|
4346
4346
|
"data-testid": "selected-border",
|
|
4347
4347
|
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")
|
|
4348
4348
|
}), /* @__PURE__ */ Y("div", {
|
|
@@ -4395,7 +4395,7 @@ var Ao = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4395
4395
|
No.displayName = "F0AiInsightCardInternal";
|
|
4396
4396
|
//#endregion
|
|
4397
4397
|
//#region src/addons/ai/ai/F0AiInsightCard/F0AiInsightCard.tsx
|
|
4398
|
-
var Po = ["className"], Fo =
|
|
4398
|
+
var Po = ["className"], Fo = U((e, t) => {
|
|
4399
4399
|
let n = Po.reduce((e, t) => {
|
|
4400
4400
|
let { [t]: n, ...r } = e;
|
|
4401
4401
|
return r;
|
|
@@ -4406,7 +4406,7 @@ var Po = ["className"], Fo = H((e, t) => {
|
|
|
4406
4406
|
});
|
|
4407
4407
|
});
|
|
4408
4408
|
Fo.displayName = "F0AiInsightCard";
|
|
4409
|
-
var Io = a(
|
|
4409
|
+
var Io = a(z(Fo, () => /* @__PURE__ */ X("div", {
|
|
4410
4410
|
className: "flex w-[217px] h-[200px] flex-col gap-2 rounded-2xl border border-solid border-f1-border-secondary bg-f1-background p-4",
|
|
4411
4411
|
"aria-busy": "true",
|
|
4412
4412
|
"aria-live": "polite",
|
|
@@ -4431,8 +4431,8 @@ var Io = a(ie(Fo, () => /* @__PURE__ */ X("div", {
|
|
|
4431
4431
|
"sparkline"
|
|
4432
4432
|
], Ro = 180, zo = (e) => Number.isFinite(e) ? Math.max(0, Math.floor(e)) : Ro, Bo = (e, t) => e.length <= t ? e : `${e.slice(0, t).trimEnd()}...`, Vo = (e) => e.showActions !== !1, Ho = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWith("data-")));
|
|
4433
4433
|
function Uo(e) {
|
|
4434
|
-
let { module: t, heading: n, title: r, subtitle: i, description: a, seeMoreLabel: s, maxCollapsedDescriptionLength: c = Ro } = e, [l, u] =
|
|
4435
|
-
return
|
|
4434
|
+
let { module: t, heading: n, title: r, subtitle: i, description: a, seeMoreLabel: s, maxCollapsedDescriptionLength: c = Ro } = e, [l, u] = J(!1), d = Ut(), f = q(null), p = zo(c), m = a.length > p, h = l ? a : Bo(a, p), g = Vo(e) ? e : null, _ = Ho(e);
|
|
4435
|
+
return G(() => {
|
|
4436
4436
|
l && f.current?.focus();
|
|
4437
4437
|
}, [l]), /* @__PURE__ */ X("section", {
|
|
4438
4438
|
className: "overflow-hidden rounded-xl border border-solid border-f1-border-secondary bg-f1-background",
|
|
@@ -4440,7 +4440,7 @@ function Uo(e) {
|
|
|
4440
4440
|
children: [
|
|
4441
4441
|
/* @__PURE__ */ X("div", {
|
|
4442
4442
|
className: "flex items-center gap-3 px-4 py-3",
|
|
4443
|
-
children: [t ? /* @__PURE__ */ Y(
|
|
4443
|
+
children: [t ? /* @__PURE__ */ Y(pt, {
|
|
4444
4444
|
module: t,
|
|
4445
4445
|
size: "md"
|
|
4446
4446
|
}) : null, /* @__PURE__ */ X("div", {
|
|
@@ -4464,7 +4464,7 @@ function Uo(e) {
|
|
|
4464
4464
|
ref: f,
|
|
4465
4465
|
tabIndex: l ? -1 : void 0,
|
|
4466
4466
|
className: y("text-base text-f1-foreground whitespace-pre-wrap break-words", l && b(), !l && "inline"),
|
|
4467
|
-
children: [h, m && !l ? /* @__PURE__ */ X(
|
|
4467
|
+
children: [h, m && !l ? /* @__PURE__ */ X(Kt, { children: [" ", /* @__PURE__ */ Y("button", {
|
|
4468
4468
|
type: "button",
|
|
4469
4469
|
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()),
|
|
4470
4470
|
"aria-controls": d,
|
|
@@ -4490,12 +4490,12 @@ Uo.displayName = "F0AiProposalCard";
|
|
|
4490
4490
|
//#endregion
|
|
4491
4491
|
//#region src/blocks/ai/F0AiMessageSources/components/CollapsibleMessage.tsx
|
|
4492
4492
|
var Wo = ({ icon: e, title: n, children: r }) => {
|
|
4493
|
-
let [i, a] =
|
|
4494
|
-
return /* @__PURE__ */ X(
|
|
4493
|
+
let [i, a] = J(!1), o = t();
|
|
4494
|
+
return /* @__PURE__ */ X(I, {
|
|
4495
4495
|
className: "mb-1 w-full",
|
|
4496
4496
|
open: i,
|
|
4497
4497
|
onOpenChange: a,
|
|
4498
|
-
children: [/* @__PURE__ */ X(
|
|
4498
|
+
children: [/* @__PURE__ */ X(me, {
|
|
4499
4499
|
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",
|
|
4500
4500
|
children: [
|
|
4501
4501
|
/* @__PURE__ */ Y("span", {
|
|
@@ -4510,7 +4510,7 @@ var Wo = ({ icon: e, title: n, children: r }) => {
|
|
|
4510
4510
|
children: n
|
|
4511
4511
|
}),
|
|
4512
4512
|
/* @__PURE__ */ Y(u, {
|
|
4513
|
-
icon:
|
|
4513
|
+
icon: St,
|
|
4514
4514
|
className: "h-4 w-4 transition-transform duration-200"
|
|
4515
4515
|
})
|
|
4516
4516
|
]
|
|
@@ -4538,7 +4538,7 @@ var Wo = ({ icon: e, title: n, children: r }) => {
|
|
|
4538
4538
|
})
|
|
4539
4539
|
})]
|
|
4540
4540
|
});
|
|
4541
|
-
}, Go = (e) =>
|
|
4541
|
+
}, Go = (e) => P[e] ?? Rt, Ko = ({ iconName: e }) => e ? /* @__PURE__ */ Y("div", {
|
|
4542
4542
|
className: "mr-1 flex items-center justify-center",
|
|
4543
4543
|
children: /* @__PURE__ */ Y(u, {
|
|
4544
4544
|
icon: Go(e),
|
|
@@ -4582,26 +4582,26 @@ qo.displayName = "F0AiMessageSources";
|
|
|
4582
4582
|
//#endregion
|
|
4583
4583
|
//#region src/addons/ai/ai/F0AiTableCard/F0AiTableCard.tsx
|
|
4584
4584
|
async function Jo(e, t, n) {
|
|
4585
|
-
let r =
|
|
4585
|
+
let r = ee(e), i = t === "xlsx" ? await rt([{
|
|
4586
4586
|
name: "Data",
|
|
4587
4587
|
rows: r
|
|
4588
|
-
}]) : await
|
|
4589
|
-
|
|
4588
|
+
}]) : await it(r);
|
|
4589
|
+
le(i, `${n}.${t}`);
|
|
4590
4590
|
}
|
|
4591
4591
|
function Yo({ dataset: e, title: t, filename: n }) {
|
|
4592
|
-
let r = p(), i =
|
|
4592
|
+
let r = p(), i = q(null), a = t ?? r.ai.aiTable.title, o = W((e) => {
|
|
4593
4593
|
if (!i.current) return;
|
|
4594
4594
|
let t = n ?? (a.replace(/\s+/g, "_").toLowerCase() || "table");
|
|
4595
4595
|
Jo(i.current, e, t);
|
|
4596
4596
|
}, [a, n]);
|
|
4597
|
-
return e.columns?.length ? /* @__PURE__ */ X(
|
|
4597
|
+
return e.columns?.length ? /* @__PURE__ */ X(x, {
|
|
4598
4598
|
display: "flex",
|
|
4599
4599
|
flexDirection: "column",
|
|
4600
4600
|
gap: "md",
|
|
4601
4601
|
borderRadius: "md",
|
|
4602
4602
|
border: "default",
|
|
4603
4603
|
borderColor: "secondary",
|
|
4604
|
-
children: [/* @__PURE__ */ X(
|
|
4604
|
+
children: [/* @__PURE__ */ X(x, {
|
|
4605
4605
|
display: "flex",
|
|
4606
4606
|
alignItems: "center",
|
|
4607
4607
|
justifyContent: "between",
|
|
@@ -4615,20 +4615,20 @@ function Yo({ dataset: e, title: t, filename: n }) {
|
|
|
4615
4615
|
tag: "h2",
|
|
4616
4616
|
className: "text-base font-medium capitalize text-f1-foreground",
|
|
4617
4617
|
children: a
|
|
4618
|
-
}), /* @__PURE__ */ Y(
|
|
4619
|
-
icon:
|
|
4618
|
+
}), /* @__PURE__ */ Y(be, {
|
|
4619
|
+
icon: B,
|
|
4620
4620
|
size: "md",
|
|
4621
4621
|
items: [{
|
|
4622
4622
|
label: r.ai.aiTable.downloadExcel,
|
|
4623
|
-
icon:
|
|
4623
|
+
icon: B,
|
|
4624
4624
|
onClick: () => o("xlsx")
|
|
4625
4625
|
}, {
|
|
4626
4626
|
label: r.ai.aiTable.downloadCsv,
|
|
4627
|
-
icon:
|
|
4627
|
+
icon: B,
|
|
4628
4628
|
onClick: () => o("csv")
|
|
4629
4629
|
}]
|
|
4630
4630
|
})]
|
|
4631
|
-
}), /* @__PURE__ */ Y(
|
|
4631
|
+
}), /* @__PURE__ */ Y(x, {
|
|
4632
4632
|
overflowX: "auto",
|
|
4633
4633
|
children: /* @__PURE__ */ X("table", {
|
|
4634
4634
|
ref: i,
|
|
@@ -4651,7 +4651,7 @@ Yo.displayName = "F0AiTableCard";
|
|
|
4651
4651
|
//#endregion
|
|
4652
4652
|
//#region src/addons/ai/ai/F0AiChatHeader/components/CreditsPopover.tsx
|
|
4653
4653
|
function Xo({ credits: e, trigger: t }) {
|
|
4654
|
-
let n = p(), [r, a] =
|
|
4654
|
+
let n = p(), [r, a] = J(!1), [c, u] = J(!1), [d, f] = J(!1), [m, g] = J(null), y = W((t) => {
|
|
4655
4655
|
a(t), t && e?.fetchUsage && (u(!0), f(!1), e.fetchUsage().then((e) => {
|
|
4656
4656
|
g(e), f(!1);
|
|
4657
4657
|
}).catch(() => {
|
|
@@ -4671,7 +4671,7 @@ function Xo({ credits: e, trigger: t }) {
|
|
|
4671
4671
|
variant: "ghost",
|
|
4672
4672
|
hideLabel: !0,
|
|
4673
4673
|
label: n.t("ai.credits.title"),
|
|
4674
|
-
icon:
|
|
4674
|
+
icon: Ke,
|
|
4675
4675
|
pressed: r
|
|
4676
4676
|
})
|
|
4677
4677
|
}), /* @__PURE__ */ X(l, {
|
|
@@ -4683,7 +4683,7 @@ function Xo({ credits: e, trigger: t }) {
|
|
|
4683
4683
|
className: "flex w-[324px] flex-col gap-3 rounded-md border border-solid border-f1-border-secondary p-3",
|
|
4684
4684
|
children: [x ? /* @__PURE__ */ X("div", {
|
|
4685
4685
|
className: "flex min-w-0 max-w-full flex-1 items-center gap-2 overflow-hidden text-left text-lg text-f1-foreground",
|
|
4686
|
-
children: [/* @__PURE__ */ Y(
|
|
4686
|
+
children: [/* @__PURE__ */ Y(_t, {
|
|
4687
4687
|
name: e.companyName ?? "",
|
|
4688
4688
|
src: e.companyLogoUrl,
|
|
4689
4689
|
size: "lg"
|
|
@@ -4722,7 +4722,7 @@ function Xo({ credits: e, trigger: t }) {
|
|
|
4722
4722
|
className: "text-sm text-f1-foreground-secondary",
|
|
4723
4723
|
children: n.t("ai.credits.creditsError")
|
|
4724
4724
|
}) : null,
|
|
4725
|
-
!c && !d && m ? /* @__PURE__ */ X(
|
|
4725
|
+
!c && !d && m ? /* @__PURE__ */ X(Kt, { children: [
|
|
4726
4726
|
/* @__PURE__ */ X("div", {
|
|
4727
4727
|
className: "flex justify-between",
|
|
4728
4728
|
children: [/* @__PURE__ */ Y("span", {
|
|
@@ -4769,7 +4769,7 @@ function Xo({ credits: e, trigger: t }) {
|
|
|
4769
4769
|
variant: "outlinePromote",
|
|
4770
4770
|
href: e.upgradePlanUrl,
|
|
4771
4771
|
label: n.t("ai.credits.upgradePlan"),
|
|
4772
|
-
icon:
|
|
4772
|
+
icon: he
|
|
4773
4773
|
})]
|
|
4774
4774
|
}) : null]
|
|
4775
4775
|
})]
|
|
@@ -4853,7 +4853,7 @@ var Zo = "linear-gradient(90deg, #E55619, #A1ADE5, #E51943, #E55619)", Qo = ({ l
|
|
|
4853
4853
|
});
|
|
4854
4854
|
};
|
|
4855
4855
|
function $o({ employeeCredits: e, trigger: t }) {
|
|
4856
|
-
let n = p(), [r, a] =
|
|
4856
|
+
let n = p(), [r, a] = J(!1), [o, s] = J(!1), [c, u] = J(!1), [d, f] = J(null), m = W((t) => {
|
|
4857
4857
|
a(t), t && e?.fetchUsage && (s(!0), u(!1), e.fetchUsage().then((e) => {
|
|
4858
4858
|
f(e), u(!1);
|
|
4859
4859
|
}).catch(() => {
|
|
@@ -4873,7 +4873,7 @@ function $o({ employeeCredits: e, trigger: t }) {
|
|
|
4873
4873
|
variant: "ghost",
|
|
4874
4874
|
hideLabel: !0,
|
|
4875
4875
|
label: n.t("ai.credits.title"),
|
|
4876
|
-
icon:
|
|
4876
|
+
icon: Ke,
|
|
4877
4877
|
pressed: r
|
|
4878
4878
|
})
|
|
4879
4879
|
}), /* @__PURE__ */ X(l, {
|
|
@@ -4885,7 +4885,7 @@ function $o({ employeeCredits: e, trigger: t }) {
|
|
|
4885
4885
|
className: "flex w-[324px] flex-col gap-3 rounded-md border border-solid border-f1-border-secondary p-3",
|
|
4886
4886
|
children: [g ? /* @__PURE__ */ X("div", {
|
|
4887
4887
|
className: "flex min-w-0 max-w-full flex-1 items-center gap-2 overflow-hidden text-left text-lg text-f1-foreground",
|
|
4888
|
-
children: [/* @__PURE__ */ Y(
|
|
4888
|
+
children: [/* @__PURE__ */ Y(_t, {
|
|
4889
4889
|
name: e.companyName ?? "",
|
|
4890
4890
|
src: e.companyLogoUrl,
|
|
4891
4891
|
size: "lg"
|
|
@@ -4917,20 +4917,20 @@ var es = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
4917
4917
|
}) : e ? /* @__PURE__ */ Y(Xo, {
|
|
4918
4918
|
credits: e,
|
|
4919
4919
|
trigger: n
|
|
4920
|
-
}) : null, ts = es, ns = ({ 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:
|
|
4921
|
-
let C = p(), w = t(), { panelOverlays: T } =
|
|
4920
|
+
}) : null, ts = es, ns = ({ 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 }) => {
|
|
4921
|
+
let C = p(), w = t(), { panelOverlays: T } = V(), E = !o && !T && /* @__PURE__ */ Y(_, {
|
|
4922
4922
|
variant: "ghost",
|
|
4923
4923
|
hideLabel: !0,
|
|
4924
4924
|
label: a ? C.ai.collapseChat : C.ai.expandChat,
|
|
4925
|
-
icon: a ?
|
|
4925
|
+
icon: a ? F : ge,
|
|
4926
4926
|
onClick: c
|
|
4927
4927
|
}), D = /* @__PURE__ */ Y(_, {
|
|
4928
4928
|
variant: "ghost",
|
|
4929
4929
|
hideLabel: !0,
|
|
4930
4930
|
label: C.ai.closeChat,
|
|
4931
|
-
icon:
|
|
4931
|
+
icon: S,
|
|
4932
4932
|
onClick: l
|
|
4933
|
-
}), O =
|
|
4933
|
+
}), O = x?.map((e) => /* @__PURE__ */ Y(_, {
|
|
4934
4934
|
variant: "ghost",
|
|
4935
4935
|
hideLabel: !0,
|
|
4936
4936
|
label: e.label,
|
|
@@ -4974,7 +4974,7 @@ var es = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
4974
4974
|
className: "min-w-0 text-left",
|
|
4975
4975
|
children: i ?? C.ai.newConversation
|
|
4976
4976
|
}), /* @__PURE__ */ Y(u, {
|
|
4977
|
-
icon:
|
|
4977
|
+
icon: yt,
|
|
4978
4978
|
color: "default",
|
|
4979
4979
|
size: "md"
|
|
4980
4980
|
})]
|
|
@@ -5019,7 +5019,7 @@ var es = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
5019
5019
|
variant: "ghost",
|
|
5020
5020
|
hideLabel: !0,
|
|
5021
5021
|
label: C.ai.startNewChat,
|
|
5022
|
-
icon:
|
|
5022
|
+
icon: te,
|
|
5023
5023
|
onClick: d
|
|
5024
5024
|
}) : null,
|
|
5025
5025
|
/* @__PURE__ */ Y(es, {
|
|
@@ -5037,14 +5037,14 @@ var es = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
5037
5037
|
//#region src/addons/ai/ai/F0AiChatHistory/utils.ts
|
|
5038
5038
|
function rs(e) {
|
|
5039
5039
|
let t = new Date(e), n = /* @__PURE__ */ new Date();
|
|
5040
|
-
return Ge(t) ? "today" :
|
|
5040
|
+
return Ge(t) ? "today" : je(t) ? "yesterday" : At(t, n) ? "thisMonth" : "older";
|
|
5041
5041
|
}
|
|
5042
5042
|
function is(e, t, n) {
|
|
5043
|
-
let r = new Date(e), i =
|
|
5043
|
+
let r = new Date(e), i = Lt(r, "p", { locale: n });
|
|
5044
5044
|
if (Ge(r)) return `${t.today}, ${i}`;
|
|
5045
|
-
if (
|
|
5046
|
-
let a = !
|
|
5047
|
-
return `${
|
|
5045
|
+
if (je(r)) return `${t.yesterday}, ${i}`;
|
|
5046
|
+
let a = !It(r, /* @__PURE__ */ new Date());
|
|
5047
|
+
return `${Lt(r, a ? "MMM d yyyy" : "MMM d", { locale: n })}, ${i}`;
|
|
5048
5048
|
}
|
|
5049
5049
|
function as(e) {
|
|
5050
5050
|
let t = {
|
|
@@ -5067,13 +5067,13 @@ function as(e) {
|
|
|
5067
5067
|
//#endregion
|
|
5068
5068
|
//#region src/addons/ai/ai/F0AiChatHistory/components/ThreadItem.tsx
|
|
5069
5069
|
function os({ thread: e, isPinned: t, isActive: n = !1, isPending: r = !1, onSelect: i, onPin: a, onUnpin: o, onDelete: s, className: c }) {
|
|
5070
|
-
let l = p(), d =
|
|
5070
|
+
let l = p(), d = Ft(), f = K(() => [{
|
|
5071
5071
|
label: t ? l.ai.unpinChat : l.ai.pinChat,
|
|
5072
|
-
icon: t ?
|
|
5072
|
+
icon: t ? at : ue,
|
|
5073
5073
|
onClick: () => t ? o(e.id) : a(e.id)
|
|
5074
5074
|
}, {
|
|
5075
5075
|
label: l.ai.deleteChat,
|
|
5076
|
-
icon:
|
|
5076
|
+
icon: L,
|
|
5077
5077
|
critical: !0,
|
|
5078
5078
|
onClick: () => s(e.id)
|
|
5079
5079
|
}], [
|
|
@@ -5082,7 +5082,7 @@ function os({ thread: e, isPinned: t, isActive: n = !1, isPending: r = !1, onSel
|
|
|
5082
5082
|
a,
|
|
5083
5083
|
o,
|
|
5084
5084
|
s
|
|
5085
|
-
]), m =
|
|
5085
|
+
]), m = K(() => is(e.updatedAt, {
|
|
5086
5086
|
today: l.ai.today,
|
|
5087
5087
|
yesterday: l.ai.yesterday
|
|
5088
5088
|
}, d), [
|
|
@@ -5128,13 +5128,13 @@ function os({ thread: e, isPinned: t, isActive: n = !1, isPending: r = !1, onSel
|
|
|
5128
5128
|
r ? /* @__PURE__ */ Y("div", {
|
|
5129
5129
|
className: "flex h-7 w-7 shrink-0 items-center justify-center",
|
|
5130
5130
|
"aria-label": l.ai.threadOptions,
|
|
5131
|
-
children: /* @__PURE__ */ Y(
|
|
5131
|
+
children: /* @__PURE__ */ Y(Ot, { size: "small" })
|
|
5132
5132
|
}) : /* @__PURE__ */ Y("div", {
|
|
5133
5133
|
className: y("hidden items-center", "group-hover:flex group-focus-within:flex", "has-[[aria-expanded=true]]:flex"),
|
|
5134
|
-
children: /* @__PURE__ */ Y(
|
|
5134
|
+
children: /* @__PURE__ */ Y(be, {
|
|
5135
5135
|
items: f,
|
|
5136
5136
|
children: /* @__PURE__ */ Y(_, {
|
|
5137
|
-
icon:
|
|
5137
|
+
icon: A,
|
|
5138
5138
|
variant: "ghost",
|
|
5139
5139
|
size: "sm",
|
|
5140
5140
|
label: l.ai.threadOptions,
|
|
@@ -5148,9 +5148,9 @@ function os({ thread: e, isPinned: t, isActive: n = !1, isPending: r = !1, onSel
|
|
|
5148
5148
|
//#endregion
|
|
5149
5149
|
//#region src/addons/ai/ai/F0AiChatHistory/components/CollapsibleGroup.tsx
|
|
5150
5150
|
function ss({ label: e, threads: t, pinnedIds: n, onSelect: r, onPin: i, onUnpin: a, onDelete: o }) {
|
|
5151
|
-
let [s, c] =
|
|
5151
|
+
let [s, c] = J(!0), l = W(() => {
|
|
5152
5152
|
c((e) => !e);
|
|
5153
|
-
}, []), d =
|
|
5153
|
+
}, []), d = W((e) => {
|
|
5154
5154
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), l());
|
|
5155
5155
|
}, [l]);
|
|
5156
5156
|
return /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ X("div", {
|
|
@@ -5163,7 +5163,7 @@ function ss({ label: e, threads: t, pinnedIds: n, onSelect: r, onPin: i, onUnpin
|
|
|
5163
5163
|
className: "text-sm font-medium capitalize tracking-wide text-f1-foreground-secondary",
|
|
5164
5164
|
children: e
|
|
5165
5165
|
}), /* @__PURE__ */ Y(u, {
|
|
5166
|
-
icon: s ?
|
|
5166
|
+
icon: s ? yt : Ct,
|
|
5167
5167
|
color: "secondary",
|
|
5168
5168
|
size: "xs"
|
|
5169
5169
|
})]
|
|
@@ -5214,14 +5214,14 @@ function ds() {
|
|
|
5214
5214
|
//#endregion
|
|
5215
5215
|
//#region src/addons/ai/ai/F0AiChatHistory/F0AiChatHistory.tsx
|
|
5216
5216
|
var fs = ({ onClose: t, onSelectThread: n, onNewChat: r, threads: i, isLoading: a, error: o, pinnedIds: s, onPinThread: c, onUnpinThread: l, onDeleteThread: d }) => {
|
|
5217
|
-
let f = p(), [m, h] =
|
|
5218
|
-
|
|
5217
|
+
let f = p(), [m, h] = J("");
|
|
5218
|
+
G(() => {
|
|
5219
5219
|
let e = (e) => {
|
|
5220
5220
|
e.key === "Escape" && t();
|
|
5221
5221
|
};
|
|
5222
5222
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
5223
5223
|
}, [t]);
|
|
5224
|
-
let g =
|
|
5224
|
+
let g = K(() => ({
|
|
5225
5225
|
today: f.ai.today,
|
|
5226
5226
|
yesterday: f.ai.yesterday,
|
|
5227
5227
|
thisMonth: f.ai.thisMonth,
|
|
@@ -5231,18 +5231,18 @@ var fs = ({ onClose: t, onSelectThread: n, onNewChat: r, threads: i, isLoading:
|
|
|
5231
5231
|
f.ai.yesterday,
|
|
5232
5232
|
f.ai.thisMonth,
|
|
5233
5233
|
f.ai.older
|
|
5234
|
-
]), _ =
|
|
5234
|
+
]), _ = K(() => {
|
|
5235
5235
|
if (!m.trim()) return i;
|
|
5236
5236
|
let e = m.toLowerCase();
|
|
5237
5237
|
return i.filter((t) => t.title.toLowerCase().includes(e));
|
|
5238
|
-
}, [i, m]), b =
|
|
5238
|
+
}, [i, m]), b = K(() => _.filter((e) => s.has(e.id)), [_, s]), x = K(() => _.filter((e) => !s.has(e.id)), [_, s]), S = K(() => as(x), [x]), C = W((e, r) => {
|
|
5239
5239
|
n(e, r), t();
|
|
5240
|
-
}, [n, t]), w =
|
|
5240
|
+
}, [n, t]), w = W(() => {
|
|
5241
5241
|
r(), t();
|
|
5242
|
-
}, [r, t]), T =
|
|
5242
|
+
}, [r, t]), T = W((e) => {
|
|
5243
5243
|
d(e);
|
|
5244
5244
|
}, [d]), E = b.length > 0 || S.length > 0;
|
|
5245
|
-
return qt(/* @__PURE__ */ X(
|
|
5245
|
+
return qt(/* @__PURE__ */ X(Kt, { children: [/* @__PURE__ */ Y("div", {
|
|
5246
5246
|
className: "fixed inset-0 z-50 bg-f1-background-overlay animate-in fade-in-0",
|
|
5247
5247
|
onClick: t,
|
|
5248
5248
|
"aria-hidden": "true"
|
|
@@ -5277,7 +5277,7 @@ var fs = ({ onClose: t, onSelectThread: n, onNewChat: r, threads: i, isLoading:
|
|
|
5277
5277
|
children: /* @__PURE__ */ X("div", {
|
|
5278
5278
|
className: "flex w-full items-center gap-2",
|
|
5279
5279
|
children: [/* @__PURE__ */ Y(u, {
|
|
5280
|
-
icon:
|
|
5280
|
+
icon: te,
|
|
5281
5281
|
color: "default",
|
|
5282
5282
|
size: "md"
|
|
5283
5283
|
}), /* @__PURE__ */ Y(v, {
|
|
@@ -5320,14 +5320,14 @@ var fs = ({ onClose: t, onSelectThread: n, onNewChat: r, threads: i, isLoading:
|
|
|
5320
5320
|
})] }), document.body);
|
|
5321
5321
|
}, ps = "f0-ai-pinned-threads";
|
|
5322
5322
|
function ms() {
|
|
5323
|
-
let e =
|
|
5323
|
+
let e = ve(ps, []);
|
|
5324
5324
|
return new Set(Array.isArray(e) ? e : []);
|
|
5325
5325
|
}
|
|
5326
5326
|
function hs(e) {
|
|
5327
|
-
|
|
5327
|
+
oe(ps, [...e]);
|
|
5328
5328
|
}
|
|
5329
5329
|
function gs({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, unpinThread: i }) {
|
|
5330
|
-
let [a, o] =
|
|
5330
|
+
let [a, o] = J([]), [s, c] = J(!1), [l, u] = J(null), [d, f] = J(ms), [p, m] = J(() => /* @__PURE__ */ new Set()), h = W(async () => {
|
|
5331
5331
|
c(!0), u(null);
|
|
5332
5332
|
try {
|
|
5333
5333
|
let e = await t();
|
|
@@ -5339,22 +5339,22 @@ function gs({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, u
|
|
|
5339
5339
|
c(!1);
|
|
5340
5340
|
}
|
|
5341
5341
|
}, [t]);
|
|
5342
|
-
|
|
5342
|
+
G(() => {
|
|
5343
5343
|
e && h();
|
|
5344
5344
|
}, [e, h]);
|
|
5345
|
-
let g =
|
|
5345
|
+
let g = W((e, t) => {
|
|
5346
5346
|
f((n) => {
|
|
5347
5347
|
if (t === n.has(e)) return n;
|
|
5348
5348
|
let r = new Set(n);
|
|
5349
5349
|
return t ? r.add(e) : r.delete(e), hs(r), r;
|
|
5350
5350
|
});
|
|
5351
|
-
}, []), _ =
|
|
5351
|
+
}, []), _ = W((e, t) => {
|
|
5352
5352
|
m((n) => {
|
|
5353
5353
|
if (t === n.has(e)) return n;
|
|
5354
5354
|
let r = new Set(n);
|
|
5355
5355
|
return t ? r.add(e) : r.delete(e), r;
|
|
5356
5356
|
});
|
|
5357
|
-
}, []), v =
|
|
5357
|
+
}, []), v = W((e, t) => {
|
|
5358
5358
|
let n = t ? r : i;
|
|
5359
5359
|
g(e, t), n && (_(e, !0), n(e).catch(() => g(e, !t)).finally(() => _(e, !1)));
|
|
5360
5360
|
}, [
|
|
@@ -5370,9 +5370,9 @@ function gs({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, u
|
|
|
5370
5370
|
refetch: h,
|
|
5371
5371
|
pinnedIds: d,
|
|
5372
5372
|
pendingIds: p,
|
|
5373
|
-
pinThread:
|
|
5374
|
-
unpinThread:
|
|
5375
|
-
deleteThread:
|
|
5373
|
+
pinThread: W((e) => v(e, !0), [v]),
|
|
5374
|
+
unpinThread: W((e) => v(e, !1), [v]),
|
|
5375
|
+
deleteThread: W(async (e) => {
|
|
5376
5376
|
_(e, !0);
|
|
5377
5377
|
try {
|
|
5378
5378
|
await n(e), o((t) => t.filter((t) => t.id !== e)), f((t) => {
|
|
@@ -5394,7 +5394,7 @@ function gs({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, u
|
|
|
5394
5394
|
}
|
|
5395
5395
|
//#endregion
|
|
5396
5396
|
//#region src/addons/ai/ai/F0AiChatUsageLimits/types.ts
|
|
5397
|
-
var _s = ["top", "bottom"], vs = s.create(
|
|
5397
|
+
var _s = ["top", "bottom"], vs = s.create(k), ys = ({ label: e, reduceMotion: t }) => /* @__PURE__ */ X("div", {
|
|
5398
5398
|
role: "status",
|
|
5399
5399
|
"aria-live": "polite",
|
|
5400
5400
|
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",
|
|
@@ -5447,9 +5447,9 @@ var _s = ["top", "bottom"], vs = s.create(A), ys = ({ label: e, reduceMotion: t
|
|
|
5447
5447
|
className: "font-medium",
|
|
5448
5448
|
children: e
|
|
5449
5449
|
})]
|
|
5450
|
-
}), bs =
|
|
5450
|
+
}), bs = Vt(function({ active: e, label: r, className: i, children: a }) {
|
|
5451
5451
|
let { t: o } = p(), c = t(), l = r ?? o("ai.applyingChanges");
|
|
5452
|
-
return
|
|
5452
|
+
return G(() => {
|
|
5453
5453
|
if (!e) return;
|
|
5454
5454
|
let t = document.activeElement;
|
|
5455
5455
|
t && t.getAttribute("name") !== "one-ai-input" && t.blur();
|