@factorialco/f0-react 11.10.0 → 11.11.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-s4prfEkC.js → ChatPostComposerDialog-BqAJZqD9.js} +4 -4
- package/dist/{CoachmarkProvider-DxDuinVA.js → CoachmarkProvider-DCHKWnIq.js} +2044 -2044
- package/dist/{DocumentToolbar-BuctnVHN.js → DocumentToolbar-BU9PTMlI.js} +5 -5
- package/dist/{DocxViewer-CAGBzliC.js → DocxViewer-8FiXi45s.js} +2 -2
- package/dist/{F0AiProcessingOverlay-Dl_56dL9.js → F0AiProcessingOverlay-L6LooNzN.js} +511 -511
- package/dist/{F0CanvasPanel-C8MuYy_8.js → F0CanvasPanel-D--qira6.js} +2641 -2623
- package/dist/{F0DocumentViewer-C9gCxjxk.js → F0DocumentViewer-C7Wv7NTY.js} +35 -35
- package/dist/F0DocumentViewer-DACK-OvI.js +3 -0
- package/dist/{F0Map-D4esyFFE.js → F0Map-DbbjpLjI.js} +100 -100
- package/dist/{F0Select-dBwkgMBc.js → F0Select-CY_CcXQ2.js} +1030 -1030
- package/dist/{F0Text-D0_mpu2P.js → F0Text-MLpPbWjh.js} +12 -12
- package/dist/{F0VideoPlayer-CUUQmvVm.js → F0VideoPlayer-BFo3wQQU.js} +38 -38
- package/dist/F0VideoPlayer-D7RCk_24.js +1 -0
- package/dist/{Map-DFCc5qR0.js → Map-BfheF0i_.js} +17 -17
- package/dist/{PdfThumbnail-D09QDkNP.js → PdfThumbnail-B8kgKi-5.js} +1 -1
- package/dist/{SheetViewer-Cvd2xwE5.js → SheetViewer-Dy1cNTbd.js} +4 -4
- package/dist/{TextViewer-Bk0Xz1nv.js → TextViewer-DSec8GUk.js} +2 -2
- package/dist/ai.d.ts +3 -3
- package/dist/ai.js +5 -5
- package/dist/component-status.js +1 -1
- package/dist/{dist-r1yM6TIs.js → dist-BB2MlAD_.js} +1 -1
- package/dist/experimental.d.ts +85 -4
- package/dist/experimental.js +5370 -5027
- package/dist/{exports-DsGJH4CD.d.ts → exports-CJtG_boZ.d.ts} +1 -1
- package/dist/f0.d.ts +4 -4
- package/dist/f0.js +326 -326
- package/dist/{i18n-provider-defaults-D7TVD4xk.js → i18n-provider-defaults-DD76Cjbd.js} +5 -0
- package/dist/{i18n-provider-defaults-14y_lreJ.d.ts → i18n-provider-defaults-iAsTLZ8q.d.ts} +6 -0
- package/dist/i18n-provider-defaults.d.ts +1 -1
- package/dist/i18n-provider-defaults.js +1 -1
- package/dist/{index-CL4pclEl.d.ts → index-DGmIutN2.d.ts} +1 -1
- package/dist/{maplibre-B5inXAW8.js → maplibre-Dg0SWOg-.js} +1 -1
- package/dist/{pdfWorker-5t9rytw2.js → pdfWorker-CK_VPj2f.js} +1 -1
- package/dist/{popover-DquDnBKd.js → popover-C8rmkngm.js} +2 -2
- package/dist/{posts-DgzHTT_B.js → posts-DGtDUrKT.js} +2 -0
- package/dist/styles.css +1 -1
- package/dist/{types-Di2cYBLz.d.ts → types-BkW50Whp.d.ts} +2 -2
- package/dist/{useData-BEZesy_8.js → useData-DqN-h3iG.js} +287 -287
- package/package.json +1 -1
- package/dist/F0DocumentViewer-CUkiuREP.js +0 -3
- package/dist/F0VideoPlayer-rLZ5qvuq.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ft as e, Gt as t, St as n, a as r, b as i, bt as a, cr as o, er as s, fn as c, i as l, n as u, on as d, or as f, pn as p, sn as m, t as h, vn as g, xt as _, yn as v } from "./popover-C8rmkngm.js";
|
|
2
2
|
import { L as y, R as b } from "./tooltip-BX4dSfeL.js";
|
|
3
|
-
import { n as x, r as S } from "./F0Text-
|
|
4
|
-
import { $ as C, At as w, B as T, C as E, Co as D, Ct as O, Ds as ee, Et as k, F as A, Gr as j, H as M, I as N, Ir as P, Jn as F, Kr as te, N as ne, Ns as re, Nt as I, Ot as ie, P as L, Q as ae, Qr as R, Ro as z, Rt as oe, S as se, So as ce, St as le, T as ue, Ua as de, Uo as fe, Ur as pe, V as me, Vo as he, Wr as ge, Xa as _e, Xo as ve, Xr as ye, a as be, bo as xe, bt as Se, d as Ce, dt as we, ei as Te, eo as Ee, er as De, g as Oe, h as ke, i as Ae, ir as je, jo as Me, ka as Ne, ks as B, l as Pe, lc as Fe, lt as Ie, m as Le, ma as Re, mo as ze, mr as Be, mt as Ve, no as He, nt as Ue, o as We, ot as Ge, pa as Ke, pr as qe, r as Je, ro as Ye, rt as Xe, st as Ze, to as Qe, ts as $e, tt as et, u as tt, uc as nt, ut as rt, va as it, vo as at, w as ot, x as st, xt as ct, yt as lt, z as V, za as ut, zi as dt } from "./F0CanvasPanel-
|
|
5
|
-
import { t as ft } from "./i18n-provider-defaults-
|
|
6
|
-
import { C as pt, D as mt, F as ht, S as gt, U as _t, X as vt, Y as yt, k as bt, l as xt, x as St } from "./useData-
|
|
7
|
-
import { Dn as Ct, Dr as wt, Er as Tt, Ft as Et, Nr as Dt, On as Ot, Or as kt, Ot as At, _t as jt, cn as Mt, ct as Nt, gt as Pt, ht as Ft, jr as It, nn as Lt, sn as Rt, un as zt } from "./F0Select-
|
|
8
|
-
import { n as Bt } from "./dist-
|
|
3
|
+
import { n as x, r as S } from "./F0Text-MLpPbWjh.js";
|
|
4
|
+
import { $ as C, At as w, B as T, C as E, Co as D, Ct as O, Ds as ee, Et as k, F as A, Gr as j, H as M, I as N, Ir as P, Jn as F, Kr as te, N as ne, Ns as re, Nt as I, Ot as ie, P as L, Q as ae, Qr as R, Ro as z, Rt as oe, S as se, So as ce, St as le, T as ue, Ua as de, Uo as fe, Ur as pe, V as me, Vo as he, Wr as ge, Xa as _e, Xo as ve, Xr as ye, a as be, bo as xe, bt as Se, d as Ce, dt as we, ei as Te, eo as Ee, er as De, g as Oe, h as ke, i as Ae, ir as je, jo as Me, ka as Ne, ks as B, l as Pe, lc as Fe, lt as Ie, m as Le, ma as Re, mo as ze, mr as Be, mt as Ve, no as He, nt as Ue, o as We, ot as Ge, pa as Ke, pr as qe, r as Je, ro as Ye, rt as Xe, st as Ze, to as Qe, ts as $e, tt as et, u as tt, uc as nt, ut as rt, va as it, vo as at, w as ot, x as st, xt as ct, yt as lt, z as V, za as ut, zi as dt } from "./F0CanvasPanel-D--qira6.js";
|
|
5
|
+
import { t as ft } from "./i18n-provider-defaults-DD76Cjbd.js";
|
|
6
|
+
import { C as pt, D as mt, F as ht, S as gt, U as _t, X as vt, Y as yt, k as bt, l as xt, x as St } from "./useData-DqN-h3iG.js";
|
|
7
|
+
import { Dn as Ct, Dr as wt, Er as Tt, Ft as Et, Nr as Dt, On as Ot, Or as kt, Ot as At, _t as jt, cn as Mt, ct as Nt, gt as Pt, ht as Ft, jr as It, nn as Lt, sn as Rt, un as zt } from "./F0Select-CY_CcXQ2.js";
|
|
8
|
+
import { n as Bt } from "./dist-BB2MlAD_.js";
|
|
9
9
|
import { createContext as Vt, createElement as Ht, forwardRef as H, memo as Ut, useCallback as U, useContext as Wt, useEffect as W, useId as Gt, useInsertionEffect as Kt, useLayoutEffect as qt, useMemo as G, useRef as K, useState as q } from "react";
|
|
10
10
|
import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
|
|
11
11
|
import { createPortal as Jt } from "react-dom";
|
|
@@ -66,7 +66,7 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
66
66
|
})]
|
|
67
67
|
});
|
|
68
68
|
}, ln = ({ label: e, description: t, percentage: n, unlimited: r = !1 }) => {
|
|
69
|
-
let i =
|
|
69
|
+
let i = d(), a = !r && n >= 100;
|
|
70
70
|
return /* @__PURE__ */ X("div", {
|
|
71
71
|
className: "flex flex-col gap-3",
|
|
72
72
|
children: [
|
|
@@ -110,22 +110,22 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
110
110
|
className: "flex justify-between",
|
|
111
111
|
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" })]
|
|
112
112
|
}), /* @__PURE__ */ Y("div", { className: "h-2 w-full animate-pulse rounded-full bg-f1-background-secondary" })]
|
|
113
|
-
}), fn = ({ usage: e, error: t = !1, onOpenChange: n, trigger:
|
|
114
|
-
let o =
|
|
113
|
+
}), fn = ({ usage: e, error: t = !1, onOpenChange: n, trigger: i, side: a = "top" }) => {
|
|
114
|
+
let o = d(), [s, c] = q(!1), u = K(null), f = U((e) => {
|
|
115
115
|
c(e), n?.(e);
|
|
116
|
-
}, [n]),
|
|
116
|
+
}, [n]), p = e ? un(e.usedPercentage) : 0, g = e?.unlimited ?? !1, _ = g ? "unlimited" : p >= 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: p }), w = e ? `${S}: ${C}` : S;
|
|
117
117
|
return /* @__PURE__ */ X(h, {
|
|
118
118
|
open: s,
|
|
119
119
|
onOpenChange: f,
|
|
120
|
-
children: [/* @__PURE__ */ Y(
|
|
120
|
+
children: [/* @__PURE__ */ Y(r, {
|
|
121
121
|
asChild: !0,
|
|
122
|
-
children:
|
|
122
|
+
children: i ?? /* @__PURE__ */ X("button", {
|
|
123
123
|
type: "button",
|
|
124
124
|
"aria-expanded": s,
|
|
125
125
|
"aria-haspopup": "dialog",
|
|
126
126
|
className: y("flex h-6 w-6 shrink-0 items-center justify-center rounded-sm bg-transparent p-0", "hover:bg-f1-background-secondary-hover", s && "bg-f1-background-secondary-hover", b()),
|
|
127
127
|
children: [/* @__PURE__ */ Y(cn, {
|
|
128
|
-
percentage:
|
|
128
|
+
percentage: p,
|
|
129
129
|
tone: _
|
|
130
130
|
}), /* @__PURE__ */ Y("span", {
|
|
131
131
|
className: "sr-only",
|
|
@@ -133,14 +133,14 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
133
133
|
})]
|
|
134
134
|
})
|
|
135
135
|
}), /* @__PURE__ */ X(l, {
|
|
136
|
-
ref:
|
|
136
|
+
ref: u,
|
|
137
137
|
side: a,
|
|
138
138
|
align: "end",
|
|
139
139
|
sideOffset: 8,
|
|
140
140
|
collisionPadding: 12,
|
|
141
141
|
tabIndex: -1,
|
|
142
142
|
onOpenAutoFocus: (e) => {
|
|
143
|
-
e.preventDefault(),
|
|
143
|
+
e.preventDefault(), u.current?.focus();
|
|
144
144
|
},
|
|
145
145
|
className: "flex w-[328px] flex-col overflow-hidden rounded-md border border-solid border-f1-border-secondary p-0 shadow-md",
|
|
146
146
|
children: [/* @__PURE__ */ Y("div", {
|
|
@@ -151,7 +151,7 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
151
151
|
}) : e ? /* @__PURE__ */ Y(ln, {
|
|
152
152
|
label: S,
|
|
153
153
|
description: e.description,
|
|
154
|
-
percentage:
|
|
154
|
+
percentage: p,
|
|
155
155
|
unlimited: g
|
|
156
156
|
}) : /* @__PURE__ */ Y(dn, {})
|
|
157
157
|
}), e && x ? /* @__PURE__ */ X("div", {
|
|
@@ -163,7 +163,7 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
163
163
|
children: [/* @__PURE__ */ Y("span", {
|
|
164
164
|
className: "min-w-0 flex-1 truncate",
|
|
165
165
|
children: o.t("ai.usageLimits.yourCompany")
|
|
166
|
-
}), /* @__PURE__ */ Y(
|
|
166
|
+
}), /* @__PURE__ */ Y(m, {
|
|
167
167
|
icon: wt,
|
|
168
168
|
size: "md",
|
|
169
169
|
color: "default"
|
|
@@ -184,7 +184,7 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
184
184
|
let { provided: t } = Ue();
|
|
185
185
|
return t ? /* @__PURE__ */ Y(mn, { ...e }) : /* @__PURE__ */ Y(et, { children: /* @__PURE__ */ Y(mn, { ...e }) });
|
|
186
186
|
}, mn = ({ attachedFiles: e, isUploading: t, onRemove: n, removeLabel: r, reducedMotion: i }) => {
|
|
187
|
-
let a =
|
|
187
|
+
let a = d(), o = hn(e), s = e.flatMap((e) => {
|
|
188
188
|
let t = o.get(e.id);
|
|
189
189
|
if (!t) return [];
|
|
190
190
|
let i = e.file.name, a = e.file.type || Ge({
|
|
@@ -263,9 +263,9 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
263
263
|
let { id: t, type: n, ...r } = e;
|
|
264
264
|
return r;
|
|
265
265
|
}), _n = ({ actions: e, showAttachEntry: t, onAttachClick: n, attachDisabled: r, attachDisabledTooltip: i, disabled: a, onOpenChange: o }) => {
|
|
266
|
-
let s =
|
|
266
|
+
let s = d(), [c, l] = q(!1), u = (e) => {
|
|
267
267
|
l(e), o?.(e);
|
|
268
|
-
},
|
|
268
|
+
}, f = [...t ? [{
|
|
269
269
|
label: s.ai.addFilesOrPhotos,
|
|
270
270
|
icon: Me,
|
|
271
271
|
onClick: n,
|
|
@@ -275,7 +275,7 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
275
275
|
return /* @__PURE__ */ Y("div", {
|
|
276
276
|
onClick: (e) => e.stopPropagation(),
|
|
277
277
|
children: /* @__PURE__ */ Y(it, {
|
|
278
|
-
items:
|
|
278
|
+
items: f,
|
|
279
279
|
align: "start",
|
|
280
280
|
disabled: a,
|
|
281
281
|
open: c,
|
|
@@ -294,11 +294,11 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
294
294
|
})
|
|
295
295
|
});
|
|
296
296
|
}, vn = ({ onUploadFiles: e, composerActions: t, isAtMaxFiles: n, maxFiles: r, acceptValue: i, fileInputRef: a, handleFileSelect: o, recordingStatus: s, onComposerActionsOpenChange: c }) => {
|
|
297
|
-
let l =
|
|
298
|
-
return !e && !
|
|
299
|
-
actions:
|
|
297
|
+
let l = d(), u = s === "transcribing", f = () => a.current?.click(), p = t?.length ? t : null;
|
|
298
|
+
return !e && !p ? null : /* @__PURE__ */ X(J, { children: [p ? /* @__PURE__ */ Y(_n, {
|
|
299
|
+
actions: p,
|
|
300
300
|
showAttachEntry: !!e,
|
|
301
|
-
onAttachClick:
|
|
301
|
+
onAttachClick: f,
|
|
302
302
|
attachDisabled: n,
|
|
303
303
|
attachDisabledTooltip: r === void 0 ? void 0 : l.ai.tooManyFilesError.replace("{{maxFiles}}", String(r)),
|
|
304
304
|
disabled: u,
|
|
@@ -312,7 +312,7 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
312
312
|
size: "md",
|
|
313
313
|
disabled: n || u,
|
|
314
314
|
onClick: (e) => {
|
|
315
|
-
e.preventDefault(),
|
|
315
|
+
e.preventDefault(), f();
|
|
316
316
|
}
|
|
317
317
|
}), e ? /* @__PURE__ */ Y("input", {
|
|
318
318
|
ref: a,
|
|
@@ -329,12 +329,12 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
329
329
|
fontColor: "text-f1-foreground-secondary",
|
|
330
330
|
formBorder: "[&_form]:border-f1-border"
|
|
331
331
|
} }, bn = ({ creditWarning: e, children: t }) => {
|
|
332
|
-
let n =
|
|
332
|
+
let n = d();
|
|
333
333
|
if (!e) return t;
|
|
334
334
|
let r = {
|
|
335
335
|
...yn[e.level],
|
|
336
336
|
text: e.text ?? n.ai.creditWarning.soft
|
|
337
|
-
},
|
|
337
|
+
}, a = e.actionLabel ?? n.ai.creditWarning.getCredits ?? "";
|
|
338
338
|
return /* @__PURE__ */ X("div", {
|
|
339
339
|
className: y("flex flex-col rounded-xl", r.bg, r.formBorder),
|
|
340
340
|
children: [/* @__PURE__ */ X("div", {
|
|
@@ -344,14 +344,14 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
344
344
|
children: r.text
|
|
345
345
|
}), /* @__PURE__ */ X("div", {
|
|
346
346
|
className: "flex shrink-0 items-center gap-1",
|
|
347
|
-
children: [e.onGetCredits ? /* @__PURE__ */ Y(
|
|
348
|
-
label:
|
|
347
|
+
children: [e.onGetCredits ? /* @__PURE__ */ Y(i, {
|
|
348
|
+
label: a,
|
|
349
349
|
size: "sm",
|
|
350
350
|
variant: "outline",
|
|
351
351
|
icon: e.getCreditsIcon,
|
|
352
|
-
tooltip:
|
|
352
|
+
tooltip: a,
|
|
353
353
|
onClick: e.onGetCredits
|
|
354
|
-
}) : null, e.onDismiss ? /* @__PURE__ */ Y(
|
|
354
|
+
}) : null, e.onDismiss ? /* @__PURE__ */ Y(i, {
|
|
355
355
|
label: n.ai.creditWarning.dismiss ?? "",
|
|
356
356
|
size: "sm",
|
|
357
357
|
variant: "ghost",
|
|
@@ -363,7 +363,7 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
363
363
|
}), t]
|
|
364
364
|
});
|
|
365
365
|
}, xn = ({ quote: e, onRemove: t }) => {
|
|
366
|
-
let
|
|
366
|
+
let r = d();
|
|
367
367
|
return /* @__PURE__ */ Y("div", {
|
|
368
368
|
"aria-atomic": "true",
|
|
369
369
|
"aria-live": "polite",
|
|
@@ -374,13 +374,13 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
374
374
|
children: [
|
|
375
375
|
/* @__PURE__ */ Y("div", {
|
|
376
376
|
className: "flex items-center py-0.5",
|
|
377
|
-
children: /* @__PURE__ */ Y(
|
|
377
|
+
children: /* @__PURE__ */ Y(m, {
|
|
378
378
|
icon: at,
|
|
379
379
|
size: "md",
|
|
380
380
|
color: "default"
|
|
381
381
|
})
|
|
382
382
|
}),
|
|
383
|
-
/* @__PURE__ */ Y(
|
|
383
|
+
/* @__PURE__ */ Y(n, {
|
|
384
384
|
className: "h-full flex-1 py-0.5 text-[12px] font-medium text-f1-foreground-secondary",
|
|
385
385
|
lines: 1,
|
|
386
386
|
children: e.text
|
|
@@ -388,7 +388,7 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
388
388
|
/* @__PURE__ */ Y(_, {
|
|
389
389
|
type: "button",
|
|
390
390
|
variant: "ghost",
|
|
391
|
-
label:
|
|
391
|
+
label: r.ai.removeQuote,
|
|
392
392
|
onClick: t,
|
|
393
393
|
icon: S,
|
|
394
394
|
hideLabel: !0,
|
|
@@ -449,7 +449,7 @@ function kn(e, t = wn) {
|
|
|
449
449
|
return e.length <= t ? e : [...e].sort(() => .5 - Math.random()).slice(0, t);
|
|
450
450
|
}
|
|
451
451
|
var An = ({ suggestions: e, onItemClick: t, onItemHover: n, side: r = "top", reserveTwoRows: i = !0, overflow: a = "wrap" }) => {
|
|
452
|
-
let [o, s] = q(null), c = K(null), d = a === "scroll",
|
|
452
|
+
let [o, s] = q(null), c = K(null), d = a === "scroll", f = Cn(), p = K(null), g = K(!1), v = Gt(), b = Gt(), x = o === null ? null : e[o];
|
|
453
453
|
return e.length === 0 ? null : /* @__PURE__ */ X(h, {
|
|
454
454
|
open: x !== null,
|
|
455
455
|
onOpenChange: (e) => {
|
|
@@ -457,13 +457,13 @@ var An = ({ suggestions: e, onItemClick: t, onItemHover: n, side: r = "top", res
|
|
|
457
457
|
},
|
|
458
458
|
children: [/* @__PURE__ */ Y("div", {
|
|
459
459
|
className: y("flex w-full items-end", i && "min-h-[72px]"),
|
|
460
|
-
children: /* @__PURE__ */ Y(
|
|
460
|
+
children: /* @__PURE__ */ Y(u, {
|
|
461
461
|
asChild: !0,
|
|
462
462
|
children: /* @__PURE__ */ Y("div", {
|
|
463
463
|
ref: (e) => {
|
|
464
|
-
c.current = e, d &&
|
|
464
|
+
c.current = e, d && f.ref(e);
|
|
465
465
|
},
|
|
466
|
-
style: d ?
|
|
466
|
+
style: d ? f.style : void 0,
|
|
467
467
|
className: y("flex w-full items-center gap-2", d ? y("flex-nowrap overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", "p-1 -m-1") : "flex-wrap"),
|
|
468
468
|
children: e.map((e, t) => /* @__PURE__ */ Y(_, {
|
|
469
469
|
type: "button",
|
|
@@ -476,7 +476,7 @@ var An = ({ suggestions: e, onItemClick: t, onItemHover: n, side: r = "top", res
|
|
|
476
476
|
"aria-expanded": o === t,
|
|
477
477
|
"aria-controls": o === t ? v : void 0,
|
|
478
478
|
onClick: (e) => {
|
|
479
|
-
|
|
479
|
+
p.current = e.currentTarget, g.current = !1, s((e) => e === t ? null : t), n?.(null);
|
|
480
480
|
}
|
|
481
481
|
}, `${e.label}-${t}`))
|
|
482
482
|
})
|
|
@@ -489,7 +489,7 @@ var An = ({ suggestions: e, onItemClick: t, onItemHover: n, side: r = "top", res
|
|
|
489
489
|
"aria-labelledby": b,
|
|
490
490
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
491
491
|
onCloseAutoFocus: (e) => {
|
|
492
|
-
e.preventDefault(), g.current &&
|
|
492
|
+
e.preventDefault(), g.current && p.current?.focus(), g.current = !1;
|
|
493
493
|
},
|
|
494
494
|
onEscapeKeyDown: () => {
|
|
495
495
|
g.current = !0;
|
|
@@ -502,7 +502,7 @@ var An = ({ suggestions: e, onItemClick: t, onItemHover: n, side: r = "top", res
|
|
|
502
502
|
children: [/* @__PURE__ */ X("div", {
|
|
503
503
|
id: b,
|
|
504
504
|
className: "flex items-center gap-1.5 p-2 pb-1 text-sm font-medium text-f1-foreground-secondary",
|
|
505
|
-
children: [/* @__PURE__ */ Y(
|
|
505
|
+
children: [/* @__PURE__ */ Y(m, {
|
|
506
506
|
"aria-hidden": !0,
|
|
507
507
|
icon: x.icon,
|
|
508
508
|
size: "sm"
|
|
@@ -520,8 +520,8 @@ var An = ({ suggestions: e, onItemClick: t, onItemHover: n, side: r = "top", res
|
|
|
520
520
|
}) : null]
|
|
521
521
|
});
|
|
522
522
|
};
|
|
523
|
-
function jn({ item:
|
|
524
|
-
let i = K(null), a = K(null), o = K(null), s =
|
|
523
|
+
function jn({ item: t, onSelect: n, onHover: r }) {
|
|
524
|
+
let i = K(null), a = K(null), o = K(null), s = e(), c = U(() => {
|
|
525
525
|
o.current != null && (clearTimeout(o.current), o.current = null);
|
|
526
526
|
let e = a.current, t = i.current;
|
|
527
527
|
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"));
|
|
@@ -536,13 +536,13 @@ function jn({ item: e, onSelect: n, onHover: r }) {
|
|
|
536
536
|
let s = `linear-gradient(90deg, transparent 0, #000 ${On}px)`;
|
|
537
537
|
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)`;
|
|
538
538
|
}, En));
|
|
539
|
-
}, [s]),
|
|
540
|
-
r?.(
|
|
539
|
+
}, [s]), u = U(() => {
|
|
540
|
+
r?.(t), l();
|
|
541
541
|
}, [
|
|
542
|
-
|
|
542
|
+
t,
|
|
543
543
|
r,
|
|
544
544
|
l
|
|
545
|
-
]),
|
|
545
|
+
]), d = U(() => {
|
|
546
546
|
r?.(null), c();
|
|
547
547
|
}, [r, c]);
|
|
548
548
|
return W(() => () => {
|
|
@@ -550,10 +550,10 @@ function jn({ item: e, onSelect: n, onHover: r }) {
|
|
|
550
550
|
}, []), /* @__PURE__ */ X("button", {
|
|
551
551
|
type: "button",
|
|
552
552
|
onClick: n,
|
|
553
|
-
onMouseEnter:
|
|
554
|
-
onMouseLeave:
|
|
555
|
-
onFocus:
|
|
556
|
-
onBlur:
|
|
553
|
+
onMouseEnter: u,
|
|
554
|
+
onMouseLeave: d,
|
|
555
|
+
onFocus: u,
|
|
556
|
+
onBlur: d,
|
|
557
557
|
className: y("group flex items-center justify-between gap-2 rounded-sm px-2 py-2 text-left text-base font-medium text-f1-foreground transition-colors hover:bg-f1-background-hover focus-visible:bg-f1-background-hover", b()),
|
|
558
558
|
children: [/* @__PURE__ */ Y("span", {
|
|
559
559
|
ref: i,
|
|
@@ -561,12 +561,12 @@ function jn({ item: e, onSelect: n, onHover: r }) {
|
|
|
561
561
|
children: /* @__PURE__ */ Y("span", {
|
|
562
562
|
ref: a,
|
|
563
563
|
className: "block w-full truncate",
|
|
564
|
-
children:
|
|
564
|
+
children: t.title
|
|
565
565
|
})
|
|
566
566
|
}), /* @__PURE__ */ Y("span", {
|
|
567
567
|
"aria-hidden": !0,
|
|
568
568
|
className: "flex flex-shrink-0 items-center text-f1-foreground-secondary opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",
|
|
569
|
-
children: /* @__PURE__ */ Y(
|
|
569
|
+
children: /* @__PURE__ */ Y(m, {
|
|
570
570
|
icon: It,
|
|
571
571
|
size: "sm"
|
|
572
572
|
})
|
|
@@ -594,7 +594,7 @@ function Mn(e, t) {
|
|
|
594
594
|
};
|
|
595
595
|
}
|
|
596
596
|
function Nn({ searchPersons: e, mentionSources: t }) {
|
|
597
|
-
let { ai: n } =
|
|
597
|
+
let { ai: n } = d(), r = n.mentions.people;
|
|
598
598
|
return G(() => {
|
|
599
599
|
let n = t ?? [];
|
|
600
600
|
return !e || n.some((e) => e.type === "person") ? n : [Mn(e, { label: r }), ...n];
|
|
@@ -623,9 +623,9 @@ function Fn(e, t) {
|
|
|
623
623
|
//#region src/addons/ai/ai/F0AiChatTextArea/useFileAttachments.ts
|
|
624
624
|
var In = 4e3;
|
|
625
625
|
function Ln(e) {
|
|
626
|
-
let [t, n] = q([]), [r, i] = q(null), a = K(null), o = K(null), s =
|
|
626
|
+
let [t, n] = q([]), [r, i] = q(null), a = K(null), o = K(null), s = d(), c = e?.onUploadFiles, l = e?.allowedMimeTypes, u = e?.maxFiles, f = G(() => {
|
|
627
627
|
if (l) return Array.isArray(l) ? l.join(",") : l;
|
|
628
|
-
}, [l]),
|
|
628
|
+
}, [l]), p = u !== void 0 && t.length >= u, m = K(0);
|
|
629
629
|
W(() => {
|
|
630
630
|
m.current = t.length;
|
|
631
631
|
}, [t]);
|
|
@@ -689,8 +689,8 @@ function Ln(e) {
|
|
|
689
689
|
attachedFiles: t,
|
|
690
690
|
fileInputRef: o,
|
|
691
691
|
onUploadFiles: c,
|
|
692
|
-
acceptValue:
|
|
693
|
-
isAtMaxFiles:
|
|
692
|
+
acceptValue: f,
|
|
693
|
+
isAtMaxFiles: p,
|
|
694
694
|
maxFiles: u,
|
|
695
695
|
processFiles: g,
|
|
696
696
|
handleFileSelect: U(async (e) => {
|
|
@@ -705,17 +705,17 @@ function Ln(e) {
|
|
|
705
705
|
}
|
|
706
706
|
//#endregion
|
|
707
707
|
//#region src/addons/ai/ai/F0AiChatTextArea/AiChatComposer.tsx
|
|
708
|
-
var Rn = ({ onSubmit:
|
|
709
|
-
let I =
|
|
708
|
+
var Rn = ({ onSubmit: t, onStop: r, inProgress: i, onBeforeSubmit: a, placeholders: o, creditWarning: c, clarifyingUI: l, pendingContext: u = null, onPendingContextChange: f, pendingQuote: m = null, onPendingQuoteChange: h, fileAttachments: g, toolbarStart: _, composerActions: b, onComposerActionsOpenChange: x, onTranscribe: S, searchPersons: C, mentionSources: w, onProcessFilesRef: E, disclaimer: D, usageLimits: O, footer: ee, isWelcomeScreen: k = !1, fullscreen: A = !1, welcomeScreenSuggestions: j, onSuggestionClick: M, welcomeScreenSuggestionsPlacement: N = "above", welcomeScreenSuggestionsCollapsedByDefault: P = !1, welcomeScreenCards: F, padding: te = "default", name: ne, ref: re }) => {
|
|
709
|
+
let I = d(), L = e(), ae = !!L, R = K(null), [z, oe] = q(null), [se, ce] = q(!1), [le, ue] = q({
|
|
710
710
|
isEmpty: !0,
|
|
711
711
|
recorder: "idle"
|
|
712
712
|
}), de = K(null), fe = K(null);
|
|
713
713
|
W(() => () => {
|
|
714
714
|
fe.current && clearTimeout(fe.current);
|
|
715
715
|
}, []);
|
|
716
|
-
let pe = l != null, he = K(u), ge = K(
|
|
716
|
+
let pe = l != null, he = K(u), ge = K(m);
|
|
717
717
|
qt(() => {
|
|
718
|
-
he.current = u, ge.current =
|
|
718
|
+
he.current = u, ge.current = m;
|
|
719
719
|
});
|
|
720
720
|
let { tracking: _e, setFocusChatInputFunction: ve } = V(), ye = U((e, t) => {
|
|
721
721
|
_e?.onWelcomeSuggestionClick?.({
|
|
@@ -723,7 +723,7 @@ var Rn = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
723
723
|
group: t,
|
|
724
724
|
prompt: e.prompt || e.title
|
|
725
725
|
}), M?.(e, t);
|
|
726
|
-
}, [_e, M]), { attachedFiles: be, fileInputRef: xe, onUploadFiles: Se, acceptValue: Ce, isAtMaxFiles: we, maxFiles: Te, processFiles: Ee, handleFileSelect: De, handleRemoveFile: Oe, transientError: ke, showTransientError: Ae } = Ln(
|
|
726
|
+
}, [_e, M]), { attachedFiles: be, fileInputRef: xe, onUploadFiles: Se, acceptValue: Ce, isAtMaxFiles: we, maxFiles: Te, processFiles: Ee, handleFileSelect: De, handleRemoveFile: Oe, transientError: ke, showTransientError: Ae } = Ln(g), je = Nn({
|
|
727
727
|
searchPersons: C,
|
|
728
728
|
mentionSources: w
|
|
729
729
|
});
|
|
@@ -741,20 +741,20 @@ var Rn = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
741
741
|
E(null);
|
|
742
742
|
};
|
|
743
743
|
}, [E, Ee]);
|
|
744
|
-
let Me = U((e) => void Ee(e), [Ee]), Ne = be.filter((e) => e.status === "uploaded"), B = be.some((e) => e.status === "uploading"), Pe = be.some((e) => e.status === "error"), Fe = !le.isEmpty || Ne.length > 0, Ie = async ({ text:
|
|
744
|
+
let Me = U((e) => void Ee(e), [Ee]), Ne = be.filter((e) => e.status === "uploaded"), B = be.some((e) => e.status === "uploading"), Pe = be.some((e) => e.status === "error"), Fe = !le.isEmpty || Ne.length > 0, Ie = async ({ text: e, mentions: n }) => {
|
|
745
745
|
if (Pe) return Ae(I.ai.fileUploadBlockedSubmit), !1;
|
|
746
746
|
if (a && await a() === !1) return !1;
|
|
747
|
-
let r = Ne, i = r.flatMap((e) => e.uploadedFile ? [e.uploadedFile] : []), o = u, s =
|
|
748
|
-
o &&
|
|
747
|
+
let r = Ne, i = r.flatMap((e) => e.uploadedFile ? [e.uploadedFile] : []), o = u, s = m;
|
|
748
|
+
o && f?.(null), s && h?.(null);
|
|
749
749
|
try {
|
|
750
|
-
await
|
|
751
|
-
text: an(
|
|
750
|
+
await t({
|
|
751
|
+
text: an(e, n),
|
|
752
752
|
files: i,
|
|
753
753
|
context: o,
|
|
754
754
|
quote: s
|
|
755
755
|
});
|
|
756
756
|
} catch {
|
|
757
|
-
return o && (he.current == null || he.current === o) &&
|
|
757
|
+
return o && (he.current == null || he.current === o) && f?.(o), s && (ge.current == null || ge.current === s) && h?.(s), !1;
|
|
758
758
|
}
|
|
759
759
|
for (let e of r) Oe(e.id);
|
|
760
760
|
return !0;
|
|
@@ -781,7 +781,7 @@ var Rn = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
781
781
|
1
|
|
782
782
|
]
|
|
783
783
|
}, Ye = k && A && !!F && F.length > 0, Xe = A && k, { motionProps: Ze } = T(k, 160, .5);
|
|
784
|
-
return /* @__PURE__ */ X(
|
|
784
|
+
return /* @__PURE__ */ X(v.div, {
|
|
785
785
|
ref: re,
|
|
786
786
|
"data-composer-layout": Xe ? "welcome" : "docked",
|
|
787
787
|
className: y("flex flex-col items-center gap-2", te === "default" && "px-4 pb-3 pt-2", Xe && "min-h-0 flex-1 justify-start -mt-20"),
|
|
@@ -789,9 +789,9 @@ var Rn = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
789
789
|
children: [
|
|
790
790
|
/* @__PURE__ */ X("div", {
|
|
791
791
|
className: "flex w-full max-w-content flex-col gap-2",
|
|
792
|
-
children: [Be && !ze ? /* @__PURE__ */ Y("div", { children: P ? /* @__PURE__ */ Y(
|
|
792
|
+
children: [Be && !ze ? /* @__PURE__ */ Y("div", { children: P ? /* @__PURE__ */ Y(s, {
|
|
793
793
|
initial: !1,
|
|
794
|
-
children: Ve ? /* @__PURE__ */ Y(
|
|
794
|
+
children: Ve ? /* @__PURE__ */ Y(v.div, {
|
|
795
795
|
className: "overflow-hidden",
|
|
796
796
|
initial: {
|
|
797
797
|
opacity: 0,
|
|
@@ -852,11 +852,11 @@ var Rn = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
852
852
|
onPress: _e?.onDictationStart,
|
|
853
853
|
onCancelled: _e?.onDictationCancel
|
|
854
854
|
} : void 0,
|
|
855
|
-
onPasteFiles:
|
|
855
|
+
onPasteFiles: g?.onUploadFiles ? Me : void 0,
|
|
856
856
|
pastePreferText: !0,
|
|
857
|
-
header:
|
|
858
|
-
quote:
|
|
859
|
-
onRemove: () =>
|
|
857
|
+
header: m ? /* @__PURE__ */ Y(xn, {
|
|
858
|
+
quote: m,
|
|
859
|
+
onRemove: () => h?.(null)
|
|
860
860
|
}) : null,
|
|
861
861
|
tray: /* @__PURE__ */ Y(pn, {
|
|
862
862
|
attachedFiles: be,
|
|
@@ -902,10 +902,10 @@ var Rn = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
902
902
|
className: "w-full py-4 mx-auto flex max-w-content justify-center",
|
|
903
903
|
children: ee
|
|
904
904
|
}) : null,
|
|
905
|
-
/* @__PURE__ */ Y(
|
|
905
|
+
/* @__PURE__ */ Y(s, {
|
|
906
906
|
mode: "wait",
|
|
907
907
|
initial: !1,
|
|
908
|
-
children: pe ? /* @__PURE__ */ X(
|
|
908
|
+
children: pe ? /* @__PURE__ */ X(v.div, {
|
|
909
909
|
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",
|
|
910
910
|
initial: { opacity: 0 },
|
|
911
911
|
animate: { opacity: 1 },
|
|
@@ -940,7 +940,7 @@ var Rn = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
940
940
|
I.ai.clarifyingQuestion.navHint.cancel
|
|
941
941
|
] })
|
|
942
942
|
]
|
|
943
|
-
}, "clarifying-nav-hint") : (D?.text || O) && !Xe && /* @__PURE__ */ X(
|
|
943
|
+
}, "clarifying-nav-hint") : (D?.text || O) && !Xe && /* @__PURE__ */ X(v.div, {
|
|
944
944
|
className: y("flex w-full max-w-content flex-row items-center gap-1", O ? "justify-between" : "justify-center"),
|
|
945
945
|
initial: { opacity: 0 },
|
|
946
946
|
animate: { opacity: 1 },
|
|
@@ -955,14 +955,14 @@ var Rn = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
955
955
|
type: "button",
|
|
956
956
|
onClick: D.onClick,
|
|
957
957
|
className: y("group min-w-0 cursor-pointer bg-transparent p-0 text-inherit", "transition-transform duration-700 ease-out", "hover:scale-[1.02] focus-visible:scale-[1.02]", "motion-reduce:transition-none motion-reduce:hover:scale-100 motion-reduce:focus-visible:scale-100"),
|
|
958
|
-
children: /* @__PURE__ */ Y(
|
|
958
|
+
children: /* @__PURE__ */ Y(n, {
|
|
959
959
|
className: y("text-sm font-medium text-f1-foreground-tertiary transition-colors duration-700 ease-out", "group-hover:bg-gradient-to-r group-hover:from-[#E55619] group-hover:to-[#A1ADE5] group-hover:bg-clip-text group-hover:text-transparent", "group-focus-visible:bg-gradient-to-r group-focus-visible:from-[#E55619] group-focus-visible:to-[#A1ADE5] group-focus-visible:bg-clip-text group-focus-visible:text-transparent"),
|
|
960
960
|
children: D.text
|
|
961
961
|
})
|
|
962
|
-
}) : D?.text ? /* @__PURE__ */ Y(
|
|
962
|
+
}) : D?.text ? /* @__PURE__ */ Y(n, {
|
|
963
963
|
className: "text-sm font-medium text-f1-foreground-tertiary",
|
|
964
964
|
children: D.text
|
|
965
|
-
}) : null, D?.link && D.linkText ? /* @__PURE__ */ Y(
|
|
965
|
+
}) : null, D?.link && D.linkText ? /* @__PURE__ */ Y(p, {
|
|
966
966
|
href: D.link,
|
|
967
967
|
target: "_blank",
|
|
968
968
|
rel: "noopener noreferrer",
|
|
@@ -1013,7 +1013,7 @@ function Un({ ...e }) {
|
|
|
1013
1013
|
//#endregion
|
|
1014
1014
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Image.tsx
|
|
1015
1015
|
function Wn({ src: e, alt: t, ...n }) {
|
|
1016
|
-
let r =
|
|
1016
|
+
let r = d(), a = Se(), o = ct(), s = O(e || void 0), [c, l] = q(!1), [u, f] = q(!1), p = t || (e ? Xe(e) : "") || "image";
|
|
1017
1017
|
if (!e || c || s.status === "error") return t ? /* @__PURE__ */ Y("span", {
|
|
1018
1018
|
className: "text-f1-foreground-secondary",
|
|
1019
1019
|
children: t
|
|
@@ -1029,25 +1029,25 @@ function Wn({ src: e, alt: t, ...n }) {
|
|
|
1029
1029
|
className: "group/image relative inline-block w-fit max-w-full align-top",
|
|
1030
1030
|
ref: (e) => {
|
|
1031
1031
|
let t = !!e?.closest("a");
|
|
1032
|
-
t !== u &&
|
|
1032
|
+
t !== u && f(t);
|
|
1033
1033
|
},
|
|
1034
|
-
children: [
|
|
1034
|
+
children: [a !== null && !u ? /* @__PURE__ */ Y("button", {
|
|
1035
1035
|
type: "button",
|
|
1036
1036
|
className: y("block max-w-full cursor-zoom-in rounded-md border-0 bg-transparent p-0", b()),
|
|
1037
|
-
"aria-label": r.t("chat.openNamedDocument", { name:
|
|
1038
|
-
onClick: () =>
|
|
1037
|
+
"aria-label": r.t("chat.openNamedDocument", { name: p }),
|
|
1038
|
+
onClick: () => a.openImagePreview([{
|
|
1039
1039
|
url: e,
|
|
1040
|
-
name: t ||
|
|
1040
|
+
name: t || p
|
|
1041
1041
|
}], 0),
|
|
1042
1042
|
children: m
|
|
1043
1043
|
}) : m, /* @__PURE__ */ Y("span", {
|
|
1044
1044
|
className: "absolute right-2 top-2 rounded",
|
|
1045
|
-
children: /* @__PURE__ */ Y(
|
|
1045
|
+
children: /* @__PURE__ */ Y(i, {
|
|
1046
1046
|
variant: "neutral",
|
|
1047
1047
|
label: r.chat.download,
|
|
1048
1048
|
hideLabel: !0,
|
|
1049
1049
|
icon: B,
|
|
1050
|
-
onClick: () =>
|
|
1050
|
+
onClick: () => o(e, p)
|
|
1051
1051
|
})
|
|
1052
1052
|
})]
|
|
1053
1053
|
});
|
|
@@ -1138,7 +1138,7 @@ Xn.displayName = "MentionTrigger";
|
|
|
1138
1138
|
//#endregion
|
|
1139
1139
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/custom/CustomEntityRef.tsx
|
|
1140
1140
|
function Zn({ id: e, label: t, config: n }) {
|
|
1141
|
-
let r =
|
|
1141
|
+
let r = d(), { resolve: i, avatar: a, url: o } = n, s = o?.(e), c = U((e) => ({
|
|
1142
1142
|
...e,
|
|
1143
1143
|
avatar: e.avatar ?? a,
|
|
1144
1144
|
...s && { secondaryActions: {
|
|
@@ -1169,7 +1169,7 @@ var Qn = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
|
1169
1169
|
}));
|
|
1170
1170
|
Qn.displayName = "CandidateTrigger";
|
|
1171
1171
|
function $n({ id: e, label: t }) {
|
|
1172
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.candidate, i =
|
|
1172
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.candidate, i = d(), a = n?.urls?.candidate?.(e), o = G(() => (e) => {
|
|
1173
1173
|
let t = [];
|
|
1174
1174
|
return e.source && t.push({
|
|
1175
1175
|
title: i.t("ai.entityRef.candidate.source"),
|
|
@@ -1233,7 +1233,7 @@ var er = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
|
1233
1233
|
}));
|
|
1234
1234
|
er.displayName = "ExpenseTrigger";
|
|
1235
1235
|
function tr({ id: e, label: t }) {
|
|
1236
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.expense, i =
|
|
1236
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.expense, i = d(), a = n?.urls?.expense?.(e), o = G(() => (e) => ({
|
|
1237
1237
|
avatar: {
|
|
1238
1238
|
type: "icon",
|
|
1239
1239
|
icon: he
|
|
@@ -1274,7 +1274,7 @@ var nr = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
|
1274
1274
|
}));
|
|
1275
1275
|
nr.displayName = "JobPostingTrigger";
|
|
1276
1276
|
function rr({ id: e, label: t }) {
|
|
1277
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.jobPosting, i =
|
|
1277
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.jobPosting, i = d(), a = n?.urls?.jobPosting?.(e), o = G(() => (e) => ({
|
|
1278
1278
|
title: e.title,
|
|
1279
1279
|
description: [e.status, e.location].filter(Boolean).join(" · "),
|
|
1280
1280
|
...a && { secondaryActions: {
|
|
@@ -1354,7 +1354,7 @@ var or = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
|
1354
1354
|
}));
|
|
1355
1355
|
or.displayName = "RequisitionTrigger";
|
|
1356
1356
|
function sr({ id: e, label: t }) {
|
|
1357
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.requisition, i =
|
|
1357
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.requisition, i = d(), a = n?.urls?.requisition?.(e), o = G(() => (e) => {
|
|
1358
1358
|
let t = e.lineManager ? `${e.lineManager.firstName} ${e.lineManager.lastName}` : void 0, n = [
|
|
1359
1359
|
e.status ? {
|
|
1360
1360
|
label: i.t("ai.entityRef.requisition.status"),
|
|
@@ -1422,7 +1422,7 @@ var cr = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
|
1422
1422
|
}));
|
|
1423
1423
|
cr.displayName = "VacancyTrigger";
|
|
1424
1424
|
function lr({ id: e, label: t }) {
|
|
1425
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.vacancy, i =
|
|
1425
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.vacancy, i = d(), a = n?.urls?.vacancy?.(e), o = G(() => (e) => ({
|
|
1426
1426
|
title: e.name,
|
|
1427
1427
|
description: [e.status, e.vacancyType].filter(Boolean).join(" · "),
|
|
1428
1428
|
...a && { secondaryActions: {
|
|
@@ -1493,39 +1493,39 @@ async function hr(e, t, n) {
|
|
|
1493
1493
|
}]) : await se(r);
|
|
1494
1494
|
E(i, `${n}.${t}`);
|
|
1495
1495
|
}
|
|
1496
|
-
function gr({ children: e, title: t, ...
|
|
1497
|
-
let
|
|
1498
|
-
if (!
|
|
1496
|
+
function gr({ children: e, title: t, ...r }) {
|
|
1497
|
+
let i = d(), a = K(null), o = U((e) => {
|
|
1498
|
+
if (!a.current) return;
|
|
1499
1499
|
let n = t?.replace(/\s+/g, "_").toLowerCase() || "table";
|
|
1500
|
-
hr(
|
|
1500
|
+
hr(a.current, e, n);
|
|
1501
1501
|
}, [t]);
|
|
1502
1502
|
return /* @__PURE__ */ X("div", {
|
|
1503
1503
|
className: "group/table relative my-2 flex flex-col gap-2 rounded-md border border-solid border-f1-border-secondary first:mt-0 last:mb-0",
|
|
1504
1504
|
children: [/* @__PURE__ */ X("div", {
|
|
1505
1505
|
className: "flex items-center justify-between gap-3 border-0 border-b border-solid border-f1-border-secondary px-3 py-2",
|
|
1506
|
-
children: [/* @__PURE__ */ Y(
|
|
1506
|
+
children: [/* @__PURE__ */ Y(n, {
|
|
1507
1507
|
tag: "h2",
|
|
1508
1508
|
className: "text-base font-medium capitalize text-f1-foreground",
|
|
1509
|
-
children: t ??
|
|
1509
|
+
children: t ?? i.ai.reportCard.tableLabel
|
|
1510
1510
|
}), /* @__PURE__ */ Y(it, {
|
|
1511
1511
|
icon: B,
|
|
1512
1512
|
size: "md",
|
|
1513
1513
|
items: [{
|
|
1514
|
-
label:
|
|
1514
|
+
label: i.t("ai.dataDownload.download", { format: "Excel" }),
|
|
1515
1515
|
icon: B,
|
|
1516
|
-
onClick: () =>
|
|
1516
|
+
onClick: () => o("xlsx")
|
|
1517
1517
|
}, {
|
|
1518
|
-
label:
|
|
1518
|
+
label: i.t("ai.dataDownload.download", { format: "CSV" }),
|
|
1519
1519
|
icon: B,
|
|
1520
|
-
onClick: () =>
|
|
1520
|
+
onClick: () => o("csv")
|
|
1521
1521
|
}]
|
|
1522
1522
|
})]
|
|
1523
1523
|
}), /* @__PURE__ */ Y("div", {
|
|
1524
1524
|
className: "scrollbar-macos overflow-x-auto",
|
|
1525
1525
|
children: /* @__PURE__ */ Y("table", {
|
|
1526
|
-
ref:
|
|
1527
|
-
...
|
|
1528
|
-
className: y("w-full border-separate border-spacing-0 [&_tbody_tr:last-child_td]:border-b-0",
|
|
1526
|
+
ref: a,
|
|
1527
|
+
...r,
|
|
1528
|
+
className: y("w-full border-separate border-spacing-0 [&_tbody_tr:last-child_td]:border-b-0", r.className),
|
|
1529
1529
|
children: e
|
|
1530
1530
|
})
|
|
1531
1531
|
})]
|
|
@@ -1672,13 +1672,13 @@ var Tr = {
|
|
|
1672
1672
|
icon: e.icon,
|
|
1673
1673
|
size: "md"
|
|
1674
1674
|
}) : null, Rr = ({ action: e, isActive: t }) => {
|
|
1675
|
-
let n =
|
|
1676
|
-
return e.type === "open" && e.showButton !== !1 ? /* @__PURE__ */ Y(
|
|
1675
|
+
let n = d();
|
|
1676
|
+
return e.type === "open" && e.showButton !== !1 ? /* @__PURE__ */ Y(i, {
|
|
1677
1677
|
variant: "outline",
|
|
1678
1678
|
size: "md",
|
|
1679
1679
|
label: t ? n.actions.close : n.ai.reportCard.openButton,
|
|
1680
1680
|
onClick: t ? e.onClose : e.onOpen
|
|
1681
|
-
}) : e.type === "custom" ? /* @__PURE__ */ Y(
|
|
1681
|
+
}) : e.type === "custom" ? /* @__PURE__ */ Y(i, {
|
|
1682
1682
|
variant: "outline",
|
|
1683
1683
|
size: "md",
|
|
1684
1684
|
icon: e.icon,
|
|
@@ -1687,31 +1687,31 @@ var Tr = {
|
|
|
1687
1687
|
onClick: e.onClick
|
|
1688
1688
|
}) : null;
|
|
1689
1689
|
};
|
|
1690
|
-
function zr({ avatar: e, title: t, description:
|
|
1691
|
-
let
|
|
1690
|
+
function zr({ avatar: e, title: t, description: r, isActive: i = !1, action: a, children: o }) {
|
|
1691
|
+
let s = a.type === "open", c = s ? i ? a.onClose : a.onOpen : void 0;
|
|
1692
1692
|
return /* @__PURE__ */ X("div", {
|
|
1693
|
-
className: y("flex flex-col items-center justify-between gap-3 rounded-lg border border-solid px-3 py-2",
|
|
1694
|
-
onClick:
|
|
1693
|
+
className: y("flex flex-col items-center justify-between gap-3 rounded-lg border border-solid px-3 py-2", s && "cursor-pointer", i ? "border-f1-border-hover" : "border-f1-border-secondary"),
|
|
1694
|
+
onClick: c,
|
|
1695
1695
|
children: [/* @__PURE__ */ X("div", {
|
|
1696
1696
|
className: "flex w-full min-w-0 flex-row items-center gap-3",
|
|
1697
1697
|
children: [
|
|
1698
1698
|
/* @__PURE__ */ Y(Lr, { avatar: e }),
|
|
1699
1699
|
/* @__PURE__ */ X("div", {
|
|
1700
1700
|
className: "flex min-w-0 flex-1 flex-col",
|
|
1701
|
-
children: [/* @__PURE__ */ Y(
|
|
1701
|
+
children: [/* @__PURE__ */ Y(n, {
|
|
1702
1702
|
className: "text-lg font-semibold text-f1-foreground",
|
|
1703
1703
|
children: t
|
|
1704
|
-
}),
|
|
1704
|
+
}), r ? /* @__PURE__ */ Y(n, {
|
|
1705
1705
|
className: "text-base text-f1-foreground-secondary",
|
|
1706
|
-
children:
|
|
1706
|
+
children: r
|
|
1707
1707
|
}) : null]
|
|
1708
1708
|
}),
|
|
1709
1709
|
/* @__PURE__ */ Y(Rr, {
|
|
1710
|
-
action:
|
|
1711
|
-
isActive:
|
|
1710
|
+
action: a,
|
|
1711
|
+
isActive: i
|
|
1712
1712
|
})
|
|
1713
1713
|
]
|
|
1714
|
-
}),
|
|
1714
|
+
}), o]
|
|
1715
1715
|
});
|
|
1716
1716
|
}
|
|
1717
1717
|
zr.displayName = "F0CanvasCard";
|
|
@@ -2031,7 +2031,7 @@ var ni = "rounded-xl", ri = "ai-chat", ii = (e) => {
|
|
|
2031
2031
|
}, `${e.name}-${t}`))
|
|
2032
2032
|
});
|
|
2033
2033
|
}, di = ({ file: e, onOpen: t, onError: n }) => {
|
|
2034
|
-
let r =
|
|
2034
|
+
let r = d(), i = O(e.thumbnailUrl ?? e.url);
|
|
2035
2035
|
return le(i.status, n), /* @__PURE__ */ Y("button", {
|
|
2036
2036
|
type: "button",
|
|
2037
2037
|
onClick: t,
|
|
@@ -2048,7 +2048,7 @@ var ni = "rounded-xl", ri = "ai-chat", ii = (e) => {
|
|
|
2048
2048
|
}) : null
|
|
2049
2049
|
});
|
|
2050
2050
|
}, fi = ({ file: e, onDownload: t }) => {
|
|
2051
|
-
let n =
|
|
2051
|
+
let n = d();
|
|
2052
2052
|
return /* @__PURE__ */ Y(w, {
|
|
2053
2053
|
file: {
|
|
2054
2054
|
name: e.name,
|
|
@@ -2062,7 +2062,7 @@ var ni = "rounded-xl", ri = "ai-chat", ii = (e) => {
|
|
|
2062
2062
|
}]
|
|
2063
2063
|
});
|
|
2064
2064
|
}, pi = ({ images: e, onOpen: t, onImageError: n }) => {
|
|
2065
|
-
let r =
|
|
2065
|
+
let r = d(), i = e.length === 1 ? e[0] : void 0, a = O(i ? i.thumbnailUrl ?? i.url : void 0), o = We(i && a.status === "ready" ? a.url : void 0, i) ?? void 0, s = i ? be(o?.width, o?.height) : null;
|
|
2066
2066
|
return /* @__PURE__ */ Y("div", {
|
|
2067
2067
|
style: s ? { width: s.width } : void 0,
|
|
2068
2068
|
className: y("grid grid-cols-2 overflow-hidden border border-solid border-f1-border-secondary", s ? "max-w-full" : Le, tt, ni),
|
|
@@ -2095,7 +2095,7 @@ var ni = "rounded-xl", ri = "ai-chat", ii = (e) => {
|
|
|
2095
2095
|
}, `${s.name}-${i.index}`);
|
|
2096
2096
|
})
|
|
2097
2097
|
});
|
|
2098
|
-
}, mi =
|
|
2098
|
+
}, mi = f("F0AiFileAttachments", ii), hi = 2;
|
|
2099
2099
|
function gi(e, t) {
|
|
2100
2100
|
if (!e.intersectsNode(t)) return null;
|
|
2101
2101
|
let n = document.createRange();
|
|
@@ -2137,7 +2137,7 @@ function _i({ containerRef: e, enabled: t = !0 }) {
|
|
|
2137
2137
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/ReplyPopover.tsx
|
|
2138
2138
|
var vi = 8, yi = 8;
|
|
2139
2139
|
function bi({ anchor: e, onReply: t }) {
|
|
2140
|
-
let n =
|
|
2140
|
+
let n = d(), r = K(null), [i, a] = q(null);
|
|
2141
2141
|
if (qt(() => {
|
|
2142
2142
|
if (!e) {
|
|
2143
2143
|
a(null);
|
|
@@ -2222,13 +2222,13 @@ var xi = Vt(void 0), Si = () => Wt(xi), Ci = (e) => /* @__PURE__ */ Y(Be, {
|
|
|
2222
2222
|
})
|
|
2223
2223
|
});
|
|
2224
2224
|
}, Ti = ({ onClose: e, onSubmit: t, reactionType: n, message: r }) => {
|
|
2225
|
-
let [i, a] = q(""), o =
|
|
2225
|
+
let [i, a] = q(""), o = d(), { title: s, label: c, placeholder: l } = n === "like" ? o.ai.feedbackModal.positive : o.ai.feedbackModal.negative, u = U(() => {
|
|
2226
2226
|
t(r, i);
|
|
2227
2227
|
}, [
|
|
2228
2228
|
i,
|
|
2229
2229
|
r,
|
|
2230
2230
|
t
|
|
2231
|
-
]),
|
|
2231
|
+
]), f = () => {
|
|
2232
2232
|
e(r);
|
|
2233
2233
|
};
|
|
2234
2234
|
return W(() => {
|
|
@@ -2241,7 +2241,7 @@ var xi = Vt(void 0), Si = () => Wt(xi), Ci = (e) => /* @__PURE__ */ Y(Be, {
|
|
|
2241
2241
|
}, [u]), /* @__PURE__ */ Y(je, {
|
|
2242
2242
|
position: "center",
|
|
2243
2243
|
isOpen: !0,
|
|
2244
|
-
onClose:
|
|
2244
|
+
onClose: f,
|
|
2245
2245
|
width: "md",
|
|
2246
2246
|
title: s,
|
|
2247
2247
|
container: null,
|
|
@@ -2251,7 +2251,7 @@ var xi = Vt(void 0), Si = () => Wt(xi), Ci = (e) => /* @__PURE__ */ Y(Be, {
|
|
|
2251
2251
|
},
|
|
2252
2252
|
secondaryAction: {
|
|
2253
2253
|
label: o.actions.cancel,
|
|
2254
|
-
onClick:
|
|
2254
|
+
onClick: f
|
|
2255
2255
|
},
|
|
2256
2256
|
children: /* @__PURE__ */ Y("div", {
|
|
2257
2257
|
className: "flex flex-col gap-6",
|
|
@@ -2315,20 +2315,20 @@ function ki(e) {
|
|
|
2315
2315
|
}
|
|
2316
2316
|
//#endregion
|
|
2317
2317
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/feedback/TurnFeedback.tsx
|
|
2318
|
-
var Ai = ({ content:
|
|
2319
|
-
let i =
|
|
2318
|
+
var Ai = ({ content: e, targetMessage: n, onCopy: r }) => {
|
|
2319
|
+
let i = d(), { open: a } = Oi(), [o, s] = q(null);
|
|
2320
2320
|
return /* @__PURE__ */ X("div", {
|
|
2321
2321
|
className: "flex",
|
|
2322
2322
|
children: [
|
|
2323
2323
|
/* @__PURE__ */ Y(qe, {
|
|
2324
2324
|
size: "md",
|
|
2325
2325
|
variant: "ghost",
|
|
2326
|
-
valueToCopy:
|
|
2327
|
-
onCopy: (
|
|
2328
|
-
|
|
2326
|
+
valueToCopy: e,
|
|
2327
|
+
onCopy: (t) => {
|
|
2328
|
+
t.currentTarget.blur(), r?.(e);
|
|
2329
2329
|
}
|
|
2330
2330
|
}),
|
|
2331
|
-
/* @__PURE__ */ Y(
|
|
2331
|
+
/* @__PURE__ */ Y(t, {
|
|
2332
2332
|
onClick: (e) => {
|
|
2333
2333
|
let t = o === "like" ? null : "like";
|
|
2334
2334
|
t && a(t, n), s(t), e.currentTarget.blur();
|
|
@@ -2339,14 +2339,14 @@ var Ai = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2339
2339
|
"aria-label": i.actions.thumbsUp,
|
|
2340
2340
|
children: /* @__PURE__ */ Y("div", {
|
|
2341
2341
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
2342
|
-
children: /* @__PURE__ */ Y(
|
|
2342
|
+
children: /* @__PURE__ */ Y(m, {
|
|
2343
2343
|
size: "md",
|
|
2344
2344
|
icon: o === "like" ? Ee : Qe,
|
|
2345
2345
|
color: "default"
|
|
2346
2346
|
})
|
|
2347
2347
|
})
|
|
2348
2348
|
}),
|
|
2349
|
-
/* @__PURE__ */ Y(
|
|
2349
|
+
/* @__PURE__ */ Y(t, {
|
|
2350
2350
|
onClick: (e) => {
|
|
2351
2351
|
let t = o === "dislike" ? null : "dislike";
|
|
2352
2352
|
t && a(t, n), s(t), e.currentTarget.blur();
|
|
@@ -2357,7 +2357,7 @@ var Ai = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2357
2357
|
"aria-label": i.actions.thumbsDown,
|
|
2358
2358
|
children: /* @__PURE__ */ Y("div", {
|
|
2359
2359
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
2360
|
-
children: /* @__PURE__ */ Y(
|
|
2360
|
+
children: /* @__PURE__ */ Y(m, {
|
|
2361
2361
|
size: "md",
|
|
2362
2362
|
icon: o === "dislike" ? He : Ye,
|
|
2363
2363
|
color: "default"
|
|
@@ -2366,22 +2366,22 @@ var Ai = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2366
2366
|
})
|
|
2367
2367
|
]
|
|
2368
2368
|
});
|
|
2369
|
-
}, ji = ({ icon:
|
|
2370
|
-
let [
|
|
2369
|
+
}, ji = ({ icon: t, title: n, children: r, open: i, defaultOpen: a = !1, onOpenChange: o, lockOpen: s = !1 }) => {
|
|
2370
|
+
let [c, l] = q(a), u = e(), d = i !== void 0, f = d ? i : c;
|
|
2371
2371
|
return /* @__PURE__ */ X(pe, {
|
|
2372
2372
|
className: "mb-1 w-full",
|
|
2373
|
-
open:
|
|
2373
|
+
open: f,
|
|
2374
2374
|
onOpenChange: (e) => {
|
|
2375
|
-
|
|
2375
|
+
s || (d || l(e), o?.(e));
|
|
2376
2376
|
},
|
|
2377
2377
|
children: [/* @__PURE__ */ X(j, {
|
|
2378
|
-
disabled:
|
|
2379
|
-
className: y("gap-1",
|
|
2378
|
+
disabled: s,
|
|
2379
|
+
className: y("gap-1", s ? "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"),
|
|
2380
2380
|
children: [
|
|
2381
2381
|
/* @__PURE__ */ Y("span", {
|
|
2382
2382
|
className: "flex items-center justify-start h-6 w-6",
|
|
2383
|
-
children: /* @__PURE__ */ Y(
|
|
2384
|
-
icon:
|
|
2383
|
+
children: /* @__PURE__ */ Y(m, {
|
|
2384
|
+
icon: t,
|
|
2385
2385
|
className: "block"
|
|
2386
2386
|
})
|
|
2387
2387
|
}),
|
|
@@ -2389,20 +2389,20 @@ var Ai = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2389
2389
|
className: "min-h-6 flex items-center",
|
|
2390
2390
|
children: /* @__PURE__ */ Y("span", { children: n })
|
|
2391
2391
|
}),
|
|
2392
|
-
|
|
2392
|
+
s ? null : /* @__PURE__ */ Y(m, { icon: wt })
|
|
2393
2393
|
]
|
|
2394
2394
|
}), /* @__PURE__ */ Y(ge, {
|
|
2395
2395
|
forceMount: !0,
|
|
2396
2396
|
className: "data-[state=open]:mt-3",
|
|
2397
|
-
children: /* @__PURE__ */ Y(
|
|
2397
|
+
children: /* @__PURE__ */ Y(v.div, {
|
|
2398
2398
|
initial: !1,
|
|
2399
2399
|
animate: {
|
|
2400
|
-
height:
|
|
2401
|
-
opacity: +!!
|
|
2402
|
-
visibility:
|
|
2400
|
+
height: f ? "auto" : 0,
|
|
2401
|
+
opacity: +!!f,
|
|
2402
|
+
visibility: f ? "visible" : "hidden"
|
|
2403
2403
|
},
|
|
2404
2404
|
transition: {
|
|
2405
|
-
duration:
|
|
2405
|
+
duration: u ? 0 : .15,
|
|
2406
2406
|
ease: [
|
|
2407
2407
|
.165,
|
|
2408
2408
|
.84,
|
|
@@ -2416,7 +2416,7 @@ var Ai = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2416
2416
|
})]
|
|
2417
2417
|
});
|
|
2418
2418
|
}, Mi = 1e3, Ni = 1e3, Pi = ({ startedAt: e }) => {
|
|
2419
|
-
let t =
|
|
2419
|
+
let t = d(), [n, r] = q(() => e === null ? 0 : Date.now() - e);
|
|
2420
2420
|
if (W(() => {
|
|
2421
2421
|
if (e === null) {
|
|
2422
2422
|
r(0);
|
|
@@ -2441,11 +2441,11 @@ var Ai = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2441
2441
|
}), s]
|
|
2442
2442
|
});
|
|
2443
2443
|
}, Fi = ({ titles: e, title: t, inProgress: n, isWriting: r, startedAt: i = null }) => {
|
|
2444
|
-
let a =
|
|
2444
|
+
let a = d(), [o, s] = q(!!n), c = K(n);
|
|
2445
2445
|
W(() => {
|
|
2446
2446
|
c.current && !n ? s(!1) : n && !o && s(!0), c.current = n;
|
|
2447
2447
|
}, [n, o]);
|
|
2448
|
-
let l = n ? a.ai.thoughtsGroupTitle : t ?? a.ai.thoughtsGroupTitle, u = e.length - 1,
|
|
2448
|
+
let l = n ? a.ai.thoughtsGroupTitle : t ?? a.ai.thoughtsGroupTitle, u = e.length - 1, f = (e) => !n || r ? "completed" : e === u ? "executing" : "completed";
|
|
2449
2449
|
return /* @__PURE__ */ Y(ji, {
|
|
2450
2450
|
icon: $e,
|
|
2451
2451
|
title: l,
|
|
@@ -2458,8 +2458,8 @@ var Ai = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2458
2458
|
className: "relative",
|
|
2459
2459
|
children: [/* @__PURE__ */ Y(I, {
|
|
2460
2460
|
title: t,
|
|
2461
|
-
status:
|
|
2462
|
-
suffix:
|
|
2461
|
+
status: f(n),
|
|
2462
|
+
suffix: f(n) === "executing" ? /* @__PURE__ */ Y(Pi, { startedAt: i }) : void 0,
|
|
2463
2463
|
inGroup: !0
|
|
2464
2464
|
}), n < e.length - 1 ? /* @__PURE__ */ Y("div", {
|
|
2465
2465
|
"aria-hidden": !0,
|
|
@@ -2475,7 +2475,7 @@ var Ai = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2475
2475
|
className: "flex max-w-[90%] items-start gap-2 self-end pb-1 pr-2 text-f1-foreground-tertiary",
|
|
2476
2476
|
children: [/* @__PURE__ */ Y("div", {
|
|
2477
2477
|
className: "flex h-5 items-center",
|
|
2478
|
-
children: /* @__PURE__ */ Y(
|
|
2478
|
+
children: /* @__PURE__ */ Y(m, { icon: at })
|
|
2479
2479
|
}), /* @__PURE__ */ Y("div", {
|
|
2480
2480
|
className: "min-w-0 whitespace-pre-wrap text-base leading-5 [&>div]:flex [&>div]:flex-col [&>div]:gap-1 [&_p]:m-0",
|
|
2481
2481
|
children: (t ?? Ii)(e)
|
|
@@ -2521,8 +2521,8 @@ var Ai = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2521
2521
|
})
|
|
2522
2522
|
]
|
|
2523
2523
|
});
|
|
2524
|
-
}, zi = 35, Bi = 22, Vi = 400, Hi = 2500, Ui = 220, Wi = ({ phrase:
|
|
2525
|
-
let a =
|
|
2524
|
+
}, zi = 35, Bi = 22, Vi = 400, Hi = 2500, Ui = 220, Wi = ({ phrase: t, typed: n, phraseIndex: r, onClick: i }) => {
|
|
2525
|
+
let a = e(), o = !!i;
|
|
2526
2526
|
return /* @__PURE__ */ X("p", {
|
|
2527
2527
|
role: o ? "button" : void 0,
|
|
2528
2528
|
tabIndex: o ? 0 : void 0,
|
|
@@ -2531,39 +2531,39 @@ var Ai = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
|
2531
2531
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), i?.());
|
|
2532
2532
|
} : void 0,
|
|
2533
2533
|
className: y("relative min-h-[28px] bg-gradient-to-r from-[#E55619] via-[#E51943] to-[#A1ADE5] bg-clip-text text-center text-2xl font-semibold leading-[28px] text-transparent", o && y("cursor-pointer transition-transform duration-200", "hover:scale-[1.02] focus-visible:scale-[1.02]", "motion-reduce:transition-none motion-reduce:hover:scale-100 motion-reduce:focus-visible:scale-100")),
|
|
2534
|
-
"aria-label": o ?
|
|
2534
|
+
"aria-label": o ? t : void 0,
|
|
2535
2535
|
children: [/* @__PURE__ */ Y("span", {
|
|
2536
2536
|
className: "opacity-0",
|
|
2537
|
-
children:
|
|
2537
|
+
children: t
|
|
2538
2538
|
}), /* @__PURE__ */ Y("span", {
|
|
2539
2539
|
"aria-hidden": "true",
|
|
2540
2540
|
className: "absolute inset-0",
|
|
2541
|
-
children: a ?
|
|
2541
|
+
children: a ? t : t.slice(0, n)
|
|
2542
2542
|
})]
|
|
2543
2543
|
}, r);
|
|
2544
|
-
}, Gi = ({ messages:
|
|
2545
|
-
let [s, c] = q(0), [l, u] = q(0), [d, f] = q("starting"), p =
|
|
2544
|
+
}, Gi = ({ messages: t, caption: n, subtitle: r, cta: i, onClick: a, fullscreen: o = !1 }) => {
|
|
2545
|
+
let [s, c] = q(0), [l, u] = q(0), [d, f] = q("starting"), p = e(), m = t[s] ?? "", h = t.join("\0"), g = K(!0);
|
|
2546
2546
|
return W(() => {
|
|
2547
2547
|
g.current ? g.current = !1 : (c(0), u(0), f("writing"));
|
|
2548
2548
|
}, [h]), W(() => {
|
|
2549
2549
|
if (p) return;
|
|
2550
|
-
let
|
|
2551
|
-
if (d === "starting")
|
|
2552
|
-
else if (d === "writing") l < m.length ?
|
|
2550
|
+
let e;
|
|
2551
|
+
if (d === "starting") e = setTimeout(() => f("writing"), Vi);
|
|
2552
|
+
else if (d === "writing") l < m.length ? e = setTimeout(() => u((e) => e + 1), zi) : f("holding");
|
|
2553
2553
|
else if (d === "holding") {
|
|
2554
|
-
if (
|
|
2555
|
-
|
|
2556
|
-
} else d === "erasing" && (
|
|
2557
|
-
c((
|
|
2554
|
+
if (t.length <= 1) return;
|
|
2555
|
+
e = setTimeout(() => f("erasing"), Hi);
|
|
2556
|
+
} else d === "erasing" && (e = l > 0 ? setTimeout(() => u((e) => e - 1), Bi) : setTimeout(() => {
|
|
2557
|
+
c((e) => (e + 1) % t.length), f("starting");
|
|
2558
2558
|
}, Ui));
|
|
2559
2559
|
return () => {
|
|
2560
|
-
|
|
2560
|
+
e && clearTimeout(e);
|
|
2561
2561
|
};
|
|
2562
2562
|
}, [
|
|
2563
2563
|
d,
|
|
2564
2564
|
l,
|
|
2565
2565
|
m.length,
|
|
2566
|
-
|
|
2566
|
+
t.length,
|
|
2567
2567
|
p
|
|
2568
2568
|
]), /* @__PURE__ */ Y("div", {
|
|
2569
2569
|
className: y("flex w-full flex-1 justify-center px-4", o ? "items-end pb-24" : "items-center"),
|
|
@@ -2662,24 +2662,24 @@ var Ji = {
|
|
|
2662
2662
|
filePreviews: e.filePreviews,
|
|
2663
2663
|
children: n
|
|
2664
2664
|
}) : n;
|
|
2665
|
-
}, Xi = ({ turns: e, isLoadingThread: t = !1, interrupt:
|
|
2666
|
-
let { modal: D, handleSubmit: O, handleClose: ee } = ki(
|
|
2667
|
-
let e =
|
|
2665
|
+
}, Xi = ({ turns: e, isLoadingThread: t = !1, interrupt: n, initialMessage: r, initialMessageCaption: i, initialMessageSubtitle: a, initialMessageCta: o, onWelcomeClick: c, renderToolCall: l, onReplyQuote: u, onAssistantMessageRendered: f, autoScrollUserIntoView: p = !0, renderMarkdown: m, feedback: h, freezeLayout: g = !1, noShadows: b = !1, fullscreen: x = !1, children: S, AssistantMessage: C, UserMessage: w, onRegenerate: T, onCopy: E }) => {
|
|
2666
|
+
let { modal: D, handleSubmit: O, handleClose: ee } = ki(h ?? Ji), k = d(), A = C ?? wi, j = w ?? Ri, M = G(() => {
|
|
2667
|
+
let e = r ?? k.ai.defaultInitialMessage;
|
|
2668
2668
|
return (Array.isArray(e) ? e : [e]).filter((e) => typeof e == "string" && e.length > 0);
|
|
2669
|
-
}, [
|
|
2669
|
+
}, [r, k.ai.defaultInitialMessage]), N = !t && e.length === 0 && M.length > 0, P = K(null), F = K(null), te = K(null), ne = K(null), re = K(null), { showScrollBtn: ie, turnMinHeight: L, scrollToBottom: ae } = qi({
|
|
2670
2670
|
viewportRef: P,
|
|
2671
2671
|
contentRef: F,
|
|
2672
2672
|
endRef: te,
|
|
2673
2673
|
lastTurnRef: re,
|
|
2674
2674
|
turnsCount: e.length,
|
|
2675
|
-
freezeTurnMinHeight:
|
|
2675
|
+
freezeTurnMinHeight: g
|
|
2676
2676
|
}), R = e[e.length - 1], z = Ki(!(!R || R.endIndicator !== "thinking" && !R.thinking?.inProgress), R?.thinking?.startedAt), oe = R?.endIndicator === "asking", se = (t, n) => {
|
|
2677
2677
|
let r = n === e.length - 1, i = {
|
|
2678
|
-
renderToolCall:
|
|
2679
|
-
onReplyQuote:
|
|
2678
|
+
renderToolCall: l,
|
|
2679
|
+
onReplyQuote: u,
|
|
2680
2680
|
onRendered: f,
|
|
2681
|
-
autoScrollIntoView:
|
|
2682
|
-
renderMarkdown:
|
|
2681
|
+
autoScrollIntoView: p,
|
|
2682
|
+
renderMarkdown: m
|
|
2683
2683
|
}, a = (e, r) => {
|
|
2684
2684
|
let a = {
|
|
2685
2685
|
message: e,
|
|
@@ -2767,14 +2767,14 @@ var Ji = {
|
|
|
2767
2767
|
t ? /* @__PURE__ */ Y(Qi, {}) : null,
|
|
2768
2768
|
N ? /* @__PURE__ */ Y(Gi, {
|
|
2769
2769
|
messages: M,
|
|
2770
|
-
caption:
|
|
2771
|
-
subtitle:
|
|
2772
|
-
cta:
|
|
2773
|
-
onClick:
|
|
2770
|
+
caption: i,
|
|
2771
|
+
subtitle: a,
|
|
2772
|
+
cta: o,
|
|
2773
|
+
onClick: c,
|
|
2774
2774
|
fullscreen: x
|
|
2775
2775
|
}) : null,
|
|
2776
2776
|
t ? null : e.map((e, t) => se(e, t)),
|
|
2777
|
-
|
|
2777
|
+
n
|
|
2778
2778
|
]
|
|
2779
2779
|
}),
|
|
2780
2780
|
/* @__PURE__ */ Y("div", {
|
|
@@ -2787,7 +2787,7 @@ var Ji = {
|
|
|
2787
2787
|
ref: te,
|
|
2788
2788
|
children: S
|
|
2789
2789
|
}),
|
|
2790
|
-
/* @__PURE__ */ Y(
|
|
2790
|
+
/* @__PURE__ */ Y(s, { children: ie ? /* @__PURE__ */ Y(v.div, {
|
|
2791
2791
|
className: "sticky bottom-[calc(0.5rem+var(--f0-ai-composer-overlap,0px))] z-10 flex justify-center",
|
|
2792
2792
|
initial: {
|
|
2793
2793
|
opacity: 0,
|
|
@@ -2828,11 +2828,11 @@ var Ji = {
|
|
|
2828
2828
|
children: [
|
|
2829
2829
|
/* @__PURE__ */ Y("div", {
|
|
2830
2830
|
className: "flex justify-end",
|
|
2831
|
-
children: /* @__PURE__ */ Y(
|
|
2831
|
+
children: /* @__PURE__ */ Y(c, { className: "h-12 w-2/5 rounded-full" })
|
|
2832
2832
|
}),
|
|
2833
|
-
/* @__PURE__ */ Y(
|
|
2834
|
-
/* @__PURE__ */ Y(
|
|
2835
|
-
/* @__PURE__ */ Y(
|
|
2833
|
+
/* @__PURE__ */ Y(c, { className: "mt-6 h-5 w-full rounded-md" }),
|
|
2834
|
+
/* @__PURE__ */ Y(c, { className: "h-5 w-2/5 rounded-md" }),
|
|
2835
|
+
/* @__PURE__ */ Y(c, { className: "h-5 w-4/5 rounded-md" })
|
|
2836
2836
|
]
|
|
2837
2837
|
})
|
|
2838
2838
|
}), $i = { ai: ft.ai }, ea = Vt(null);
|
|
@@ -2861,20 +2861,20 @@ function ia(e) {
|
|
|
2861
2861
|
}
|
|
2862
2862
|
//#endregion
|
|
2863
2863
|
//#region src/blocks/ai/F0ClarifyingPanel/components/ConfirmFooter.tsx
|
|
2864
|
-
var aa = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip:
|
|
2865
|
-
let s =
|
|
2864
|
+
var aa = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: a, showSkip: o }) => {
|
|
2865
|
+
let s = d();
|
|
2866
2866
|
return /* @__PURE__ */ X("div", {
|
|
2867
2867
|
className: "flex items-center justify-end gap-3 p-3",
|
|
2868
2868
|
children: [/* @__PURE__ */ Y("div", {
|
|
2869
2869
|
className: "flex items-center",
|
|
2870
|
-
children:
|
|
2870
|
+
children: o && a ? /* @__PURE__ */ Y(i, {
|
|
2871
2871
|
variant: "outline",
|
|
2872
2872
|
type: "button",
|
|
2873
2873
|
label: s.ai.clarifyingQuestion.skip,
|
|
2874
|
-
onClick:
|
|
2874
|
+
onClick: a,
|
|
2875
2875
|
disabled: t
|
|
2876
2876
|
}) : null
|
|
2877
|
-
}), /* @__PURE__ */ Y(
|
|
2877
|
+
}), /* @__PURE__ */ Y(i, {
|
|
2878
2878
|
disabled: !e || t,
|
|
2879
2879
|
variant: "default",
|
|
2880
2880
|
type: "button",
|
|
@@ -2885,19 +2885,19 @@ var aa = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: i,
|
|
|
2885
2885
|
}, oa = ({ isSelected: e }) => /* @__PURE__ */ Y("div", {
|
|
2886
2886
|
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"),
|
|
2887
2887
|
children: e ? /* @__PURE__ */ Y("div", { className: "h-2 w-2 rounded-full bg-f1-background" }) : null
|
|
2888
|
-
}), sa = 132, ca = ({ mode: e, hasSelection: t, hasCustomText: n, customAnswerText:
|
|
2889
|
-
let
|
|
2888
|
+
}), sa = 132, ca = ({ mode: e, hasSelection: t, hasCustomText: n, customAnswerText: r, isCustomAnswerActive: i, canProceed: o, inputRef: s, onActivate: c, onChangeText: l, onToggleActive: u, onConfirm: f }) => {
|
|
2889
|
+
let p = d().ai.clarifyingQuestion.typeYourAnswer, m = K(null), h = a(m, s);
|
|
2890
2890
|
qt(() => {
|
|
2891
2891
|
let e = m.current;
|
|
2892
2892
|
if (!e) return;
|
|
2893
2893
|
e.style.height = "auto";
|
|
2894
2894
|
let t = Math.min(e.scrollHeight, sa);
|
|
2895
2895
|
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > sa ? "auto" : "hidden";
|
|
2896
|
-
}, [
|
|
2896
|
+
}, [r]);
|
|
2897
2897
|
let g = e === "single" ? /* @__PURE__ */ Y(oa, { isSelected: n && !t }) : /* @__PURE__ */ Y(Nt, {
|
|
2898
|
-
checked:
|
|
2899
|
-
onCheckedChange: () => u(!
|
|
2900
|
-
title:
|
|
2898
|
+
checked: i,
|
|
2899
|
+
onCheckedChange: () => u(!i),
|
|
2900
|
+
title: p,
|
|
2901
2901
|
hideLabel: !0
|
|
2902
2902
|
});
|
|
2903
2903
|
return /* @__PURE__ */ X("div", {
|
|
@@ -2905,14 +2905,14 @@ var aa = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: i,
|
|
|
2905
2905
|
children: [g, /* @__PURE__ */ Y("textarea", {
|
|
2906
2906
|
ref: h,
|
|
2907
2907
|
rows: 1,
|
|
2908
|
-
value:
|
|
2908
|
+
value: r ?? "",
|
|
2909
2909
|
onChange: (e) => l(e.target.value),
|
|
2910
2910
|
onFocus: c,
|
|
2911
2911
|
onKeyDown: (e) => {
|
|
2912
|
-
e.key === "Enter" && !e.shiftKey && o && (e.preventDefault(),
|
|
2912
|
+
e.key === "Enter" && !e.shiftKey && o && (e.preventDefault(), f());
|
|
2913
2913
|
},
|
|
2914
|
-
placeholder:
|
|
2915
|
-
"aria-label":
|
|
2914
|
+
placeholder: p,
|
|
2915
|
+
"aria-label": p,
|
|
2916
2916
|
className: "min-w-0 flex-1 resize-none bg-transparent text-base text-f1-foreground outline-none placeholder:text-f1-foreground-tertiary"
|
|
2917
2917
|
})]
|
|
2918
2918
|
});
|
|
@@ -2952,21 +2952,21 @@ var ua = [
|
|
|
2952
2952
|
1,
|
|
2953
2953
|
.32,
|
|
2954
2954
|
1
|
|
2955
|
-
], da = .2, fa = .03, pa = 4, ma = ({ mode:
|
|
2956
|
-
let y =
|
|
2957
|
-
if (
|
|
2958
|
-
let
|
|
2959
|
-
return
|
|
2955
|
+
], da = .2, fa = .03, pa = 4, ma = ({ mode: t, question: n, options: r, selectedOptionIds: i, allowCustomAnswer: a, hasSelection: o, hasCustomText: s, customAnswerText: c, isCustomAnswerActive: l, canProceed: u, customInputRef: d, autoFocus: f, onToggleOption: p, onActivateCustom: m, onChangeCustomText: h, onToggleCustomActive: g, onConfirm: _ }) => {
|
|
2956
|
+
let y = e(), b = (() => {
|
|
2957
|
+
if (t !== "single") return 0;
|
|
2958
|
+
let e = r.findIndex((e) => i.includes(e.id));
|
|
2959
|
+
return e >= 0 ? e : 0;
|
|
2960
2960
|
})(), [x, S] = q(b), C = K([]);
|
|
2961
2961
|
W(() => {
|
|
2962
|
-
|
|
2962
|
+
f && t === "single" && C.current[x]?.focus();
|
|
2963
2963
|
}, []);
|
|
2964
|
-
let w = (
|
|
2965
|
-
if (
|
|
2964
|
+
let w = (e) => {
|
|
2965
|
+
if (t !== "single") return;
|
|
2966
2966
|
let n = r.length - 1;
|
|
2967
2967
|
if (n < 0) return;
|
|
2968
2968
|
let i;
|
|
2969
|
-
switch (
|
|
2969
|
+
switch (e.key) {
|
|
2970
2970
|
case "ArrowDown":
|
|
2971
2971
|
case "ArrowRight":
|
|
2972
2972
|
i = x >= n ? 0 : x + 1;
|
|
@@ -2983,7 +2983,7 @@ var ua = [
|
|
|
2983
2983
|
break;
|
|
2984
2984
|
default: return;
|
|
2985
2985
|
}
|
|
2986
|
-
|
|
2986
|
+
e.preventDefault(), S(i), C.current[i]?.focus();
|
|
2987
2987
|
}, T = (e) => ({
|
|
2988
2988
|
initial: !y && {
|
|
2989
2989
|
opacity: 0,
|
|
@@ -3001,44 +3001,44 @@ var ua = [
|
|
|
3001
3001
|
});
|
|
3002
3002
|
return /* @__PURE__ */ X("div", {
|
|
3003
3003
|
className: "flex flex-col gap-0 overflow-y-auto px-1.5 pb-1 pt-0.5",
|
|
3004
|
-
role:
|
|
3004
|
+
role: t === "single" ? "radiogroup" : "group",
|
|
3005
3005
|
"aria-label": n,
|
|
3006
|
-
children: [r.map((
|
|
3006
|
+
children: [r.map((e, n) => /* @__PURE__ */ Y(v.div, {
|
|
3007
3007
|
...T(n),
|
|
3008
3008
|
children: /* @__PURE__ */ Y(la, {
|
|
3009
3009
|
ref: (e) => {
|
|
3010
3010
|
C.current[n] = e;
|
|
3011
3011
|
},
|
|
3012
|
-
option:
|
|
3013
|
-
isSelected: i.includes(
|
|
3014
|
-
mode:
|
|
3015
|
-
isTabStop:
|
|
3016
|
-
onToggle:
|
|
3012
|
+
option: e,
|
|
3013
|
+
isSelected: i.includes(e.id),
|
|
3014
|
+
mode: t,
|
|
3015
|
+
isTabStop: t === "single" ? n === x : void 0,
|
|
3016
|
+
onToggle: p,
|
|
3017
3017
|
onKeyNavigate: w
|
|
3018
3018
|
})
|
|
3019
|
-
},
|
|
3019
|
+
}, e.id)), a ? /* @__PURE__ */ Y(v.div, {
|
|
3020
3020
|
...T(r.length),
|
|
3021
3021
|
children: /* @__PURE__ */ Y(ca, {
|
|
3022
|
-
mode:
|
|
3022
|
+
mode: t,
|
|
3023
3023
|
hasSelection: o,
|
|
3024
|
-
hasCustomText:
|
|
3025
|
-
customAnswerText:
|
|
3026
|
-
isCustomAnswerActive:
|
|
3027
|
-
canProceed:
|
|
3028
|
-
inputRef:
|
|
3029
|
-
onActivate:
|
|
3030
|
-
onChangeText:
|
|
3031
|
-
onToggleActive:
|
|
3032
|
-
onConfirm:
|
|
3024
|
+
hasCustomText: s,
|
|
3025
|
+
customAnswerText: c,
|
|
3026
|
+
isCustomAnswerActive: l,
|
|
3027
|
+
canProceed: u,
|
|
3028
|
+
inputRef: d,
|
|
3029
|
+
onActivate: m,
|
|
3030
|
+
onChangeText: h,
|
|
3031
|
+
onToggleActive: g,
|
|
3032
|
+
onConfirm: _
|
|
3033
3033
|
})
|
|
3034
3034
|
}) : null]
|
|
3035
3035
|
});
|
|
3036
|
-
}, ha = ({ question: e, stepLabel: t, isFirstStep:
|
|
3037
|
-
let
|
|
3036
|
+
}, ha = ({ question: e, stepLabel: t, isFirstStep: r, isFinalStep: a, canProceed: o, onBack: s, onNext: c, onCancel: l }) => {
|
|
3037
|
+
let u = d();
|
|
3038
3038
|
return /* @__PURE__ */ X("div", {
|
|
3039
3039
|
className: "flex items-start gap-0.5 pl-4 pr-3",
|
|
3040
3040
|
children: [
|
|
3041
|
-
/* @__PURE__ */ Y(
|
|
3041
|
+
/* @__PURE__ */ Y(n, {
|
|
3042
3042
|
className: "mt-0.5 min-w-0 flex-1 pr-3 text-base font-medium text-f1-foreground",
|
|
3043
3043
|
lines: 3,
|
|
3044
3044
|
children: e
|
|
@@ -3046,13 +3046,13 @@ var ua = [
|
|
|
3046
3046
|
t ? /* @__PURE__ */ X("div", {
|
|
3047
3047
|
className: "flex shrink-0 items-center gap-0.5",
|
|
3048
3048
|
children: [
|
|
3049
|
-
/* @__PURE__ */ Y(
|
|
3049
|
+
/* @__PURE__ */ Y(i, {
|
|
3050
3050
|
variant: "ghost",
|
|
3051
3051
|
size: "sm",
|
|
3052
3052
|
type: "button",
|
|
3053
|
-
onClick:
|
|
3054
|
-
disabled:
|
|
3055
|
-
label:
|
|
3053
|
+
onClick: s,
|
|
3054
|
+
disabled: r,
|
|
3055
|
+
label: u.ai.clarifyingQuestion.back,
|
|
3056
3056
|
hideLabel: !0,
|
|
3057
3057
|
icon: kt
|
|
3058
3058
|
}),
|
|
@@ -3060,24 +3060,24 @@ var ua = [
|
|
|
3060
3060
|
className: "translate-y-px text-sm font-semibold text-f1-foreground-tertiary",
|
|
3061
3061
|
children: t
|
|
3062
3062
|
}),
|
|
3063
|
-
/* @__PURE__ */ Y(
|
|
3063
|
+
/* @__PURE__ */ Y(i, {
|
|
3064
3064
|
variant: "ghost",
|
|
3065
3065
|
size: "sm",
|
|
3066
3066
|
type: "button",
|
|
3067
|
-
onClick:
|
|
3068
|
-
disabled:
|
|
3069
|
-
label:
|
|
3067
|
+
onClick: c,
|
|
3068
|
+
disabled: a || !o,
|
|
3069
|
+
label: u.ai.clarifyingQuestion.next,
|
|
3070
3070
|
hideLabel: !0,
|
|
3071
3071
|
icon: wt
|
|
3072
3072
|
})
|
|
3073
3073
|
]
|
|
3074
3074
|
}) : null,
|
|
3075
|
-
/* @__PURE__ */ Y(
|
|
3075
|
+
/* @__PURE__ */ Y(i, {
|
|
3076
3076
|
variant: "ghost",
|
|
3077
3077
|
size: "sm",
|
|
3078
3078
|
type: "button",
|
|
3079
|
-
onClick:
|
|
3080
|
-
label:
|
|
3079
|
+
onClick: l,
|
|
3080
|
+
label: u.actions.cancel,
|
|
3081
3081
|
hideLabel: !0,
|
|
3082
3082
|
icon: S
|
|
3083
3083
|
})
|
|
@@ -3086,33 +3086,33 @@ var ua = [
|
|
|
3086
3086
|
}, ga = "easeOut", _a = .15, va = .1, ya = ({ clarifyingQuestion: e, isSubmitDisabled: t }) => /* @__PURE__ */ Y(ba, {
|
|
3087
3087
|
clarifyingQuestion: e,
|
|
3088
3088
|
isSubmitDisabled: t
|
|
3089
|
-
}), ba = ({ clarifyingQuestion:
|
|
3090
|
-
let
|
|
3091
|
-
current: String(
|
|
3092
|
-
total: String(
|
|
3093
|
-
}) : void 0, M = x.length > 0, N = (T ?? "").trim().length > 0, P = M || E && N || C === !0, F =
|
|
3094
|
-
F ||
|
|
3089
|
+
}), ba = ({ clarifyingQuestion: t, isSubmitDisabled: n }) => {
|
|
3090
|
+
let r = d(), i = e(), { currentStep: a, currentStepIndex: o, totalSteps: c, toggleOption: l, confirm: u, skip: f, cancel: p, back: m, setCustomAnswerText: h, setCustomAnswerActive: g, activateCustomAnswer: _ } = t, { question: y, options: b, selectedOptionIds: x, selectionMode: S, optional: C, allowCustomAnswer: w, customAnswerText: T, isCustomAnswerActive: E } = a, D = K(null), O = S ?? "single", ee = c > 1, k = o === 0, A = o === c - 1, j = ee ? r.t("ai.clarifyingQuestion.stepOf", {
|
|
3091
|
+
current: String(o + 1),
|
|
3092
|
+
total: String(c)
|
|
3093
|
+
}) : void 0, M = x.length > 0, N = (T ?? "").trim().length > 0, P = M || E && N || C === !0, F = n === !0 && A, te = () => {
|
|
3094
|
+
F || u();
|
|
3095
3095
|
}, ne = () => {
|
|
3096
3096
|
F || f();
|
|
3097
3097
|
}, re = (e) => {
|
|
3098
3098
|
let t = O === "single" && x.includes(e);
|
|
3099
|
-
|
|
3100
|
-
}, I = A ?
|
|
3101
|
-
|
|
3099
|
+
l(e), O === "single" && !A && !t && Promise.resolve().then(u);
|
|
3100
|
+
}, I = A ? r.ai.clarifyingQuestion.submit : r.ai.clarifyingQuestion.next, ie = C === !0 && !M && !(E && N), L = () => {
|
|
3101
|
+
_(), requestAnimationFrame(() => {
|
|
3102
3102
|
D.current?.focus();
|
|
3103
3103
|
});
|
|
3104
3104
|
}, ae = (e) => {
|
|
3105
|
-
e.key === "Escape" && (e.preventDefault(),
|
|
3106
|
-
}, R =
|
|
3105
|
+
e.key === "Escape" && (e.preventDefault(), p());
|
|
3106
|
+
}, R = i ? 0 : _a, z = i ? 0 : va;
|
|
3107
3107
|
return /* @__PURE__ */ X("div", {
|
|
3108
3108
|
className: "flex flex-col",
|
|
3109
3109
|
onKeyDown: ae,
|
|
3110
3110
|
children: [/* @__PURE__ */ Y("div", {
|
|
3111
3111
|
className: "flex flex-col gap-3 pt-3",
|
|
3112
|
-
children: /* @__PURE__ */ Y(
|
|
3112
|
+
children: /* @__PURE__ */ Y(s, {
|
|
3113
3113
|
mode: "wait",
|
|
3114
3114
|
initial: !1,
|
|
3115
|
-
children: /* @__PURE__ */ X(
|
|
3115
|
+
children: /* @__PURE__ */ X(v.div, {
|
|
3116
3116
|
className: "flex flex-col gap-2",
|
|
3117
3117
|
initial: { opacity: 0 },
|
|
3118
3118
|
animate: {
|
|
@@ -3135,9 +3135,9 @@ var ua = [
|
|
|
3135
3135
|
isFirstStep: k,
|
|
3136
3136
|
isFinalStep: A,
|
|
3137
3137
|
canProceed: P,
|
|
3138
|
-
onBack:
|
|
3139
|
-
onNext:
|
|
3140
|
-
onCancel:
|
|
3138
|
+
onBack: m,
|
|
3139
|
+
onNext: u,
|
|
3140
|
+
onCancel: p
|
|
3141
3141
|
}), /* @__PURE__ */ Y(ma, {
|
|
3142
3142
|
mode: O,
|
|
3143
3143
|
question: y,
|
|
@@ -3152,11 +3152,11 @@ var ua = [
|
|
|
3152
3152
|
customInputRef: D,
|
|
3153
3153
|
onToggleOption: re,
|
|
3154
3154
|
onActivateCustom: L,
|
|
3155
|
-
onChangeCustomText:
|
|
3156
|
-
onToggleCustomActive:
|
|
3155
|
+
onChangeCustomText: h,
|
|
3156
|
+
onToggleCustomActive: g,
|
|
3157
3157
|
onConfirm: te
|
|
3158
3158
|
})]
|
|
3159
|
-
},
|
|
3159
|
+
}, o)
|
|
3160
3160
|
})
|
|
3161
3161
|
}), /* @__PURE__ */ Y(aa, {
|
|
3162
3162
|
canProceed: P,
|
|
@@ -3981,7 +3981,7 @@ function fo({ fs: e, vs: t = Ba, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3981
3981
|
}
|
|
3982
3982
|
//#endregion
|
|
3983
3983
|
//#region src/addons/ai/ai/F0AuraVoiceAnimation/components/shaderSource.ts
|
|
3984
|
-
var po = "\nconst float TAU = 6.283185;\n\n// Noise for dithering\nvec2 randFibo(vec2 p) {\n p = fract(p * vec2(443.897, 441.423));\n p += dot(p, p.yx + 19.19);\n return fract((p.xx + p.yx) * p.xy);\n}\n\n// Tonemap\nvec3 Tonemap(vec3 x) {\n x *= 4.0;\n return x / (1.0 + x);\n}\n\n// Luma for alpha\nfloat luma(vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\n// RGB to HSV\nvec3 rgb2hsv(vec3 c) {\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n}\n\n// HSV to RGB\nvec3 hsv2rgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n// SDF shapes\nfloat sdCircle(vec2 st, float r) {\n return length(st) - r;\n}\n\nfloat sdLine(vec2 p, float r) {\n float halfLen = r * 2.0;\n vec2 a = vec2(-halfLen, 0.0);\n vec2 b = vec2(halfLen, 0.0);\n vec2 pa = p - a;\n vec2 ba = b - a;\n float h = clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0);\n return length(pa - ba * h);\n}\n\nfloat getSdf(vec2 st) {\n if(uShape == 1.0) return sdCircle(st, uScale);\n else if(uShape == 2.0) return sdLine(st, uScale);\n return sdCircle(st, uScale); // Default\n}\n\nvec2 turb(vec2 pos, float t, float it) {\n // Initial rotation matrix for swirl direction\n mat2 rotation = mat2(0.6, -0.25, 0.25, 0.9);\n // Secondary rotation applied each iteration (approx 53 degree rotation)\n mat2 layerRotation = mat2(0.6, -0.8, 0.8, 0.6);\n\n float frequency = mix(2.0, 15.0, uFrequency);\n float amplitude = uAmplitude;\n float frequencyGrowth = 1.4;\n float animTime = t * 0.1 * uSpeed;\n\n const int LAYERS = 4;\n for(int i = 0; i < LAYERS; i++) {\n // Calculate wave displacement for this layer\n vec2 rotatedPos = pos * rotation;\n vec2 wave = sin(frequency * rotatedPos + float(i) * animTime + it);\n\n // Apply displacement along rotation direction\n pos += (amplitude / frequency) * rotation[0] * wave;\n\n // Evolve parameters for next layer\n rotation *= layerRotation;\n amplitude *= mix(1.0, max(wave.x, wave.y), uVariance);\n frequency *= frequencyGrowth;\n }\n\n return pos;\n}\n\nconst float ITERATIONS = 36.0;\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n vec2 uv = fragCoord / iResolution.xy;\n\n vec3 pp = vec3(0.0);\n vec3 bloom = vec3(0.0);\n float t = iTime * 0.5;\n vec2 pos = uv - 0.5;\n\n vec2 prevPos = turb(pos, t, 0.0 - 1.0 / ITERATIONS);\n float spacing = mix(1.0, TAU, uSpacing);\n\n for(float i = 1.0; i < ITERATIONS + 1.0; i++) {\n float iter = i / ITERATIONS;\n vec2 st = turb(pos, t, iter * spacing);\n float d = abs(getSdf(st));\n float pd = distance(st, prevPos);\n prevPos = st;\n float dynamicBlur = exp2(pd * 2.0 * 1.4426950408889634) - 1.0;\n float ds = smoothstep(0.0, uBlur * 0.05 + max(dynamicBlur * uSmoothing, 0.001), d);\n\n // Shift color based on iteration using uColorScale\n vec3 color = uColor;\n if(uColorShift > 0.01) {\n vec3 hsv = rgb2hsv(color);\n // Shift hue by iteration\n hsv.x = fract(hsv.x + (1.0 - iter) * uColorShift * 0.3);\n color = hsv2rgb(hsv);\n }\n\n float invd = 1.0 / max(d + dynamicBlur, 0.001);\n pp += (ds - 1.0) * color;\n bloom += clamp(invd, 0.0, 250.0) * color;\n }\n\n pp *= 1.0 / ITERATIONS;\n\n vec3 color;\n\n // Dark mode (default)\n if(uMode < 0.5) {\n // use bloom effect\n bloom = bloom / (bloom + 2e4);\n color = (-pp + bloom * 3.0 * uBloom) * 1.2;\n color += (randFibo(fragCoord).x - 0.5) / 255.0;\n color = Tonemap(color);\n float alpha = luma(color) * uMix;\n fragColor = vec4(color * uMix, alpha);\n }\n\n // Light mode\n else {\n // no bloom effect\n color = -pp;\n color += (randFibo(fragCoord).x - 0.5) / 255.0;\n\n // Preserve hue by tone mapping brightness only\n float brightness = length(color);\n vec3 direction = brightness > 0.0 ? color / brightness : color;\n\n // Reinhard on brightness\n float factor = 2.0;\n float mappedBrightness = (brightness * factor) / (1.0 + brightness * factor);\n color = direction * mappedBrightness;\n\n // Boost saturation to compensate for white background bleed-through\n // When alpha < 1.0, white bleeds through making colors look desaturated\n // So we increase saturation to maintain vibrant appearance\n float gray = dot(color, vec3(0.2, 0.5, 0.1));\n float saturationBoost = 3.0;\n color = mix(vec3(gray), color, saturationBoost);\n\n // Clamp between 0-1\n color = clamp(color, 0.0, 1.0);\n\n float alpha = mappedBrightness * clamp(uMix, 1.0, 2.0);\n fragColor = vec4(color, alpha);\n }\n}", mo =
|
|
3984
|
+
var po = "\nconst float TAU = 6.283185;\n\n// Noise for dithering\nvec2 randFibo(vec2 p) {\n p = fract(p * vec2(443.897, 441.423));\n p += dot(p, p.yx + 19.19);\n return fract((p.xx + p.yx) * p.xy);\n}\n\n// Tonemap\nvec3 Tonemap(vec3 x) {\n x *= 4.0;\n return x / (1.0 + x);\n}\n\n// Luma for alpha\nfloat luma(vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\n// RGB to HSV\nvec3 rgb2hsv(vec3 c) {\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n}\n\n// HSV to RGB\nvec3 hsv2rgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n// SDF shapes\nfloat sdCircle(vec2 st, float r) {\n return length(st) - r;\n}\n\nfloat sdLine(vec2 p, float r) {\n float halfLen = r * 2.0;\n vec2 a = vec2(-halfLen, 0.0);\n vec2 b = vec2(halfLen, 0.0);\n vec2 pa = p - a;\n vec2 ba = b - a;\n float h = clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0);\n return length(pa - ba * h);\n}\n\nfloat getSdf(vec2 st) {\n if(uShape == 1.0) return sdCircle(st, uScale);\n else if(uShape == 2.0) return sdLine(st, uScale);\n return sdCircle(st, uScale); // Default\n}\n\nvec2 turb(vec2 pos, float t, float it) {\n // Initial rotation matrix for swirl direction\n mat2 rotation = mat2(0.6, -0.25, 0.25, 0.9);\n // Secondary rotation applied each iteration (approx 53 degree rotation)\n mat2 layerRotation = mat2(0.6, -0.8, 0.8, 0.6);\n\n float frequency = mix(2.0, 15.0, uFrequency);\n float amplitude = uAmplitude;\n float frequencyGrowth = 1.4;\n float animTime = t * 0.1 * uSpeed;\n\n const int LAYERS = 4;\n for(int i = 0; i < LAYERS; i++) {\n // Calculate wave displacement for this layer\n vec2 rotatedPos = pos * rotation;\n vec2 wave = sin(frequency * rotatedPos + float(i) * animTime + it);\n\n // Apply displacement along rotation direction\n pos += (amplitude / frequency) * rotation[0] * wave;\n\n // Evolve parameters for next layer\n rotation *= layerRotation;\n amplitude *= mix(1.0, max(wave.x, wave.y), uVariance);\n frequency *= frequencyGrowth;\n }\n\n return pos;\n}\n\nconst float ITERATIONS = 36.0;\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n vec2 uv = fragCoord / iResolution.xy;\n\n vec3 pp = vec3(0.0);\n vec3 bloom = vec3(0.0);\n float t = iTime * 0.5;\n vec2 pos = uv - 0.5;\n\n vec2 prevPos = turb(pos, t, 0.0 - 1.0 / ITERATIONS);\n float spacing = mix(1.0, TAU, uSpacing);\n\n for(float i = 1.0; i < ITERATIONS + 1.0; i++) {\n float iter = i / ITERATIONS;\n vec2 st = turb(pos, t, iter * spacing);\n float d = abs(getSdf(st));\n float pd = distance(st, prevPos);\n prevPos = st;\n float dynamicBlur = exp2(pd * 2.0 * 1.4426950408889634) - 1.0;\n float ds = smoothstep(0.0, uBlur * 0.05 + max(dynamicBlur * uSmoothing, 0.001), d);\n\n // Shift color based on iteration using uColorScale\n vec3 color = uColor;\n if(uColorShift > 0.01) {\n vec3 hsv = rgb2hsv(color);\n // Shift hue by iteration\n hsv.x = fract(hsv.x + (1.0 - iter) * uColorShift * 0.3);\n color = hsv2rgb(hsv);\n }\n\n float invd = 1.0 / max(d + dynamicBlur, 0.001);\n pp += (ds - 1.0) * color;\n bloom += clamp(invd, 0.0, 250.0) * color;\n }\n\n pp *= 1.0 / ITERATIONS;\n\n vec3 color;\n\n // Dark mode (default)\n if(uMode < 0.5) {\n // use bloom effect\n bloom = bloom / (bloom + 2e4);\n color = (-pp + bloom * 3.0 * uBloom) * 1.2;\n color += (randFibo(fragCoord).x - 0.5) / 255.0;\n color = Tonemap(color);\n float alpha = luma(color) * uMix;\n fragColor = vec4(color * uMix, alpha);\n }\n\n // Light mode\n else {\n // no bloom effect\n color = -pp;\n color += (randFibo(fragCoord).x - 0.5) / 255.0;\n\n // Preserve hue by tone mapping brightness only\n float brightness = length(color);\n vec3 direction = brightness > 0.0 ? color / brightness : color;\n\n // Reinhard on brightness\n float factor = 2.0;\n float mappedBrightness = (brightness * factor) / (1.0 + brightness * factor);\n color = direction * mappedBrightness;\n\n // Boost saturation to compensate for white background bleed-through\n // When alpha < 1.0, white bleeds through making colors look desaturated\n // So we increase saturation to maintain vibrant appearance\n float gray = dot(color, vec3(0.2, 0.5, 0.1));\n float saturationBoost = 3.0;\n color = mix(vec3(gray), color, saturationBoost);\n\n // Clamp between 0-1\n color = clamp(color, 0.0, 1.0);\n\n float alpha = mappedBrightness * clamp(uMix, 1.0, 2.0);\n fragColor = vec4(color, alpha);\n }\n}", mo = g({
|
|
3985
3985
|
base: "aspect-square",
|
|
3986
3986
|
variants: { size: {
|
|
3987
3987
|
icon: "h-[24px]",
|
|
@@ -4120,7 +4120,7 @@ var vo = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4120
4120
|
label: a,
|
|
4121
4121
|
onClick: o
|
|
4122
4122
|
}
|
|
4123
|
-
}), yo =
|
|
4123
|
+
}), yo = g({
|
|
4124
4124
|
base: [
|
|
4125
4125
|
"relative flex flex-col rounded-2xl bg-f1-background",
|
|
4126
4126
|
"border border-solid border-f1-border-secondary",
|
|
@@ -4132,18 +4132,18 @@ var vo = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4132
4132
|
false: "hover:shadow-md"
|
|
4133
4133
|
} },
|
|
4134
4134
|
defaultVariants: { selected: !1 }
|
|
4135
|
-
}), bo =
|
|
4136
|
-
let
|
|
4137
|
-
return /* @__PURE__ */ X(J, { children: [
|
|
4135
|
+
}), bo = g({ base: "text-lg font-semibold text-f1-foreground line-clamp-3" }), xo = g({ base: "text-sm text-f1-foreground-secondary leading-normal" }), So = g({ base: "text-sm font-medium text-f1-foreground leading-normal" }), Co = ({ description: t, isRevealed: n, onAskOne: r }) => {
|
|
4136
|
+
let i = d(), a = e();
|
|
4137
|
+
return /* @__PURE__ */ X(J, { children: [t ? /* @__PURE__ */ Y("span", {
|
|
4138
4138
|
className: y(xo(), "truncate"),
|
|
4139
|
-
children:
|
|
4140
|
-
}) : null, /* @__PURE__ */ Y(
|
|
4139
|
+
children: t
|
|
4140
|
+
}) : null, /* @__PURE__ */ Y(s, { children: r && n ? /* @__PURE__ */ Y(v.div, {
|
|
4141
4141
|
className: "absolute bottom-4 left-4 z-10",
|
|
4142
4142
|
initial: { opacity: 0 },
|
|
4143
4143
|
animate: { opacity: 1 },
|
|
4144
4144
|
exit: { opacity: 0 },
|
|
4145
4145
|
transition: {
|
|
4146
|
-
duration:
|
|
4146
|
+
duration: a ? 0 : .2,
|
|
4147
4147
|
ease: [
|
|
4148
4148
|
.33,
|
|
4149
4149
|
1,
|
|
@@ -4153,9 +4153,9 @@ var vo = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4153
4153
|
},
|
|
4154
4154
|
children: /* @__PURE__ */ Y(ut, {
|
|
4155
4155
|
size: "md",
|
|
4156
|
-
label:
|
|
4156
|
+
label: i.ai.ask,
|
|
4157
4157
|
onClick: (e) => {
|
|
4158
|
-
e.stopPropagation(),
|
|
4158
|
+
e.stopPropagation(), r();
|
|
4159
4159
|
}
|
|
4160
4160
|
})
|
|
4161
4161
|
}) : null })] });
|
|
@@ -4219,13 +4219,13 @@ var vo = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4219
4219
|
className: y(bo()),
|
|
4220
4220
|
children: t
|
|
4221
4221
|
}),
|
|
4222
|
-
/* @__PURE__ */ Y(
|
|
4222
|
+
/* @__PURE__ */ Y(v.div, {
|
|
4223
4223
|
className: "flex flex-1 flex-col justify-end gap-2",
|
|
4224
4224
|
animate: { opacity: +!i },
|
|
4225
4225
|
transition: a,
|
|
4226
4226
|
children: /* @__PURE__ */ Y(Do, { ...e })
|
|
4227
4227
|
}),
|
|
4228
|
-
n && !wo.has(r) ? /* @__PURE__ */ Y(
|
|
4228
|
+
n && !wo.has(r) ? /* @__PURE__ */ Y(v.span, {
|
|
4229
4229
|
className: y(So()),
|
|
4230
4230
|
animate: { opacity: +!i },
|
|
4231
4231
|
transition: a,
|
|
@@ -4335,9 +4335,9 @@ var jo = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4335
4335
|
})]
|
|
4336
4336
|
})
|
|
4337
4337
|
});
|
|
4338
|
-
}, Po = H((
|
|
4339
|
-
let { description: r, heading: i, label: a, selected: o = !1, onClick:
|
|
4340
|
-
duration:
|
|
4338
|
+
}, Po = H((t, n) => {
|
|
4339
|
+
let { description: r, heading: i, label: a, selected: o = !1, onClick: s, onAskOne: c, className: l, ...u } = t, [d, f] = q(!1), [p, m] = q(!1), h = d || p, g = e(), _ = h && !!c, x = {
|
|
4340
|
+
duration: g ? 0 : .2,
|
|
4341
4341
|
ease: [
|
|
4342
4342
|
.33,
|
|
4343
4343
|
1,
|
|
@@ -4355,44 +4355,44 @@ var jo = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4355
4355
|
className: y("pointer-events-none 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 opacity-80 blur-sm")
|
|
4356
4356
|
})] }) : null, /* @__PURE__ */ X("div", {
|
|
4357
4357
|
ref: n,
|
|
4358
|
-
role:
|
|
4359
|
-
tabIndex:
|
|
4360
|
-
className: y(yo({ selected: o }), o && "relative border-transparent",
|
|
4361
|
-
onClick:
|
|
4362
|
-
|
|
4358
|
+
role: s ? "button" : void 0,
|
|
4359
|
+
tabIndex: s ? 0 : void 0,
|
|
4360
|
+
className: y(yo({ selected: o }), o && "relative border-transparent", s && "cursor-pointer select-none", s && b(), l),
|
|
4361
|
+
onClick: s ? () => {
|
|
4362
|
+
s?.();
|
|
4363
4363
|
} : void 0,
|
|
4364
|
-
onKeyDown:
|
|
4365
|
-
e.currentTarget === e.target && (e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
4364
|
+
onKeyDown: s ? (e) => {
|
|
4365
|
+
e.currentTarget === e.target && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), s?.());
|
|
4366
4366
|
} : void 0,
|
|
4367
|
-
onMouseEnter: () =>
|
|
4368
|
-
onMouseLeave: () =>
|
|
4369
|
-
onFocus: () =>
|
|
4370
|
-
onBlur: () =>
|
|
4367
|
+
onMouseEnter: () => f(!0),
|
|
4368
|
+
onMouseLeave: () => f(!1),
|
|
4369
|
+
onFocus: () => m(!0),
|
|
4370
|
+
onBlur: () => m(!1),
|
|
4371
4371
|
children: [/* @__PURE__ */ Y(Co, {
|
|
4372
4372
|
description: r,
|
|
4373
|
-
isRevealed:
|
|
4374
|
-
onAskOne:
|
|
4375
|
-
}),
|
|
4373
|
+
isRevealed: h,
|
|
4374
|
+
onAskOne: c
|
|
4375
|
+
}), u.content === "sparkline" ? /* @__PURE__ */ X("div", {
|
|
4376
4376
|
className: "flex flex-1 flex-col gap-2",
|
|
4377
4377
|
children: [/* @__PURE__ */ Y("span", {
|
|
4378
4378
|
className: y(bo()),
|
|
4379
4379
|
children: i
|
|
4380
|
-
}), /* @__PURE__ */ Y(
|
|
4380
|
+
}), /* @__PURE__ */ Y(v.div, {
|
|
4381
4381
|
className: "-ml-4 flex flex-1 flex-col",
|
|
4382
|
-
animate: { opacity: +!
|
|
4382
|
+
animate: { opacity: +!_ },
|
|
4383
4383
|
transition: x,
|
|
4384
4384
|
children: /* @__PURE__ */ Y(No, {
|
|
4385
|
-
data:
|
|
4385
|
+
data: u.data,
|
|
4386
4386
|
label: a ?? "",
|
|
4387
|
-
invertStatus:
|
|
4387
|
+
invertStatus: u.invertStatus
|
|
4388
4388
|
})
|
|
4389
4389
|
})]
|
|
4390
4390
|
}) : /* @__PURE__ */ Y(Oo, {
|
|
4391
4391
|
heading: i,
|
|
4392
4392
|
label: a,
|
|
4393
|
-
shouldFadeContent:
|
|
4393
|
+
shouldFadeContent: _,
|
|
4394
4394
|
fadeTransition: x,
|
|
4395
|
-
...
|
|
4395
|
+
...u
|
|
4396
4396
|
})]
|
|
4397
4397
|
})]
|
|
4398
4398
|
});
|
|
@@ -4411,18 +4411,18 @@ var Fo = ["className"], Io = H((e, t) => {
|
|
|
4411
4411
|
});
|
|
4412
4412
|
});
|
|
4413
4413
|
Io.displayName = "F0AiInsightCard";
|
|
4414
|
-
var Lo =
|
|
4414
|
+
var Lo = o(Ne(Io, () => /* @__PURE__ */ X("div", {
|
|
4415
4415
|
className: "flex w-[217px] h-[200px] flex-col gap-2 rounded-2xl border border-solid border-f1-border-secondary bg-f1-background p-4",
|
|
4416
4416
|
"aria-busy": "true",
|
|
4417
4417
|
"aria-live": "polite",
|
|
4418
|
-
children: [/* @__PURE__ */ Y(
|
|
4418
|
+
children: [/* @__PURE__ */ Y(c, { className: "h-3 w-3/4 rounded" }), /* @__PURE__ */ X("div", {
|
|
4419
4419
|
className: "flex flex-1 flex-col justify-end gap-2",
|
|
4420
4420
|
children: [/* @__PURE__ */ X("div", {
|
|
4421
4421
|
className: "flex flex-col gap-1.5",
|
|
4422
|
-
children: [/* @__PURE__ */ Y(
|
|
4422
|
+
children: [/* @__PURE__ */ Y(c, { className: "h-5 w-full rounded" }), /* @__PURE__ */ Y(c, { className: "h-5 w-2/3 rounded" })]
|
|
4423
4423
|
}), /* @__PURE__ */ X("div", {
|
|
4424
4424
|
className: "flex items-center gap-1.5",
|
|
4425
|
-
children: [/* @__PURE__ */ Y(
|
|
4425
|
+
children: [/* @__PURE__ */ Y(c, { className: "h-5 w-5 rounded-full" }), /* @__PURE__ */ Y(c, { className: "h-3 w-20 rounded" })]
|
|
4426
4426
|
})]
|
|
4427
4427
|
})]
|
|
4428
4428
|
}))), Ro = [
|
|
@@ -4436,7 +4436,7 @@ var Lo = a(Ne(Io, () => /* @__PURE__ */ X("div", {
|
|
|
4436
4436
|
"sparkline"
|
|
4437
4437
|
], zo = 180, Bo = (e) => Number.isFinite(e) ? Math.max(0, Math.floor(e)) : zo, Vo = (e, t) => e.length <= t ? e : `${e.slice(0, t).trimEnd()}...`, Ho = (e) => e.showActions !== !1, Uo = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => e.startsWith("data-")));
|
|
4438
4438
|
function Wo(e) {
|
|
4439
|
-
let { module: t, heading: n, title: r, subtitle:
|
|
4439
|
+
let { module: t, heading: n, title: r, subtitle: a, description: o, seeMoreLabel: s, maxCollapsedDescriptionLength: c = zo } = e, [l, u] = q(!1), d = Gt(), f = K(null), p = Bo(c), m = o.length > p, h = l ? o : Vo(o, p), g = Ho(e) ? e : null, _ = Uo(e);
|
|
4440
4440
|
return W(() => {
|
|
4441
4441
|
l && f.current?.focus();
|
|
4442
4442
|
}, [l]), /* @__PURE__ */ X("section", {
|
|
@@ -4453,9 +4453,9 @@ function Wo(e) {
|
|
|
4453
4453
|
children: [/* @__PURE__ */ Y("h2", {
|
|
4454
4454
|
className: "truncate text-lg font-semibold text-f1-foreground",
|
|
4455
4455
|
children: n
|
|
4456
|
-
}),
|
|
4456
|
+
}), a ? /* @__PURE__ */ Y("p", {
|
|
4457
4457
|
className: "truncate text-base text-f1-foreground-secondary",
|
|
4458
|
-
children:
|
|
4458
|
+
children: a
|
|
4459
4459
|
}) : null]
|
|
4460
4460
|
})]
|
|
4461
4461
|
}),
|
|
@@ -4481,7 +4481,7 @@ function Wo(e) {
|
|
|
4481
4481
|
}),
|
|
4482
4482
|
g ? /* @__PURE__ */ Y("div", {
|
|
4483
4483
|
className: "flex items-center justify-end gap-3 border-0 border-t border-solid border-f1-border-secondary px-4 py-3",
|
|
4484
|
-
children: /* @__PURE__ */ Y(
|
|
4484
|
+
children: /* @__PURE__ */ Y(i, {
|
|
4485
4485
|
type: "button",
|
|
4486
4486
|
label: g.primaryActionLabel,
|
|
4487
4487
|
icon: g.primaryActionIcon,
|
|
@@ -4494,8 +4494,8 @@ function Wo(e) {
|
|
|
4494
4494
|
Wo.displayName = "F0AiProposalCard";
|
|
4495
4495
|
//#endregion
|
|
4496
4496
|
//#region src/blocks/ai/F0AiMessageSources/components/CollapsibleMessage.tsx
|
|
4497
|
-
var Go = ({ icon:
|
|
4498
|
-
let [i, a] = q(!1), o =
|
|
4497
|
+
var Go = ({ icon: t, title: n, children: r }) => {
|
|
4498
|
+
let [i, a] = q(!1), o = e();
|
|
4499
4499
|
return /* @__PURE__ */ X(pe, {
|
|
4500
4500
|
className: "mb-1 w-full",
|
|
4501
4501
|
open: i,
|
|
@@ -4505,8 +4505,8 @@ var Go = ({ icon: e, title: n, children: r }) => {
|
|
|
4505
4505
|
children: [
|
|
4506
4506
|
/* @__PURE__ */ Y("span", {
|
|
4507
4507
|
className: "mr-2 *:block",
|
|
4508
|
-
children: /* @__PURE__ */ Y(
|
|
4509
|
-
icon:
|
|
4508
|
+
children: /* @__PURE__ */ Y(m, {
|
|
4509
|
+
icon: t,
|
|
4510
4510
|
className: "block"
|
|
4511
4511
|
})
|
|
4512
4512
|
}),
|
|
@@ -4514,7 +4514,7 @@ var Go = ({ icon: e, title: n, children: r }) => {
|
|
|
4514
4514
|
className: "mr-[2px]",
|
|
4515
4515
|
children: n
|
|
4516
4516
|
}),
|
|
4517
|
-
/* @__PURE__ */ Y(
|
|
4517
|
+
/* @__PURE__ */ Y(m, {
|
|
4518
4518
|
icon: wt,
|
|
4519
4519
|
className: "h-4 w-4 transition-transform duration-200"
|
|
4520
4520
|
})
|
|
@@ -4522,7 +4522,7 @@ var Go = ({ icon: e, title: n, children: r }) => {
|
|
|
4522
4522
|
}), /* @__PURE__ */ Y(ge, {
|
|
4523
4523
|
forceMount: !0,
|
|
4524
4524
|
className: "data-[state=open]:mt-3",
|
|
4525
|
-
children: /* @__PURE__ */ Y(
|
|
4525
|
+
children: /* @__PURE__ */ Y(v.div, {
|
|
4526
4526
|
initial: !1,
|
|
4527
4527
|
animate: {
|
|
4528
4528
|
height: i ? "auto" : 0,
|
|
@@ -4545,39 +4545,39 @@ var Go = ({ icon: e, title: n, children: r }) => {
|
|
|
4545
4545
|
});
|
|
4546
4546
|
}, Ko = (e) => de[e] ?? Bt, qo = ({ iconName: e }) => e ? /* @__PURE__ */ Y("div", {
|
|
4547
4547
|
className: "mr-1 flex items-center justify-center",
|
|
4548
|
-
children: /* @__PURE__ */ Y(
|
|
4548
|
+
children: /* @__PURE__ */ Y(m, {
|
|
4549
4549
|
icon: Ko(e),
|
|
4550
4550
|
size: "md",
|
|
4551
4551
|
color: "default"
|
|
4552
4552
|
})
|
|
4553
4553
|
}) : null;
|
|
4554
|
-
function Jo({ sources:
|
|
4555
|
-
let r =
|
|
4556
|
-
if (!
|
|
4554
|
+
function Jo({ sources: e, title: n }) {
|
|
4555
|
+
let r = d();
|
|
4556
|
+
if (!e || e.length === 0 || !Array.isArray(e)) return null;
|
|
4557
4557
|
let i = n ?? r.ai.resourcesGroupTitle;
|
|
4558
4558
|
return /* @__PURE__ */ Y(Go, {
|
|
4559
4559
|
icon: _t,
|
|
4560
4560
|
title: i,
|
|
4561
4561
|
children: /* @__PURE__ */ Y("div", {
|
|
4562
4562
|
className: "flex flex-col gap-1 rounded-lg border border-solid border-f1-border-secondary p-2",
|
|
4563
|
-
children:
|
|
4564
|
-
let r = /* @__PURE__ */ Y(qo, { iconName:
|
|
4565
|
-
return
|
|
4566
|
-
"aria-label":
|
|
4567
|
-
href:
|
|
4563
|
+
children: e.map((e, n) => {
|
|
4564
|
+
let r = /* @__PURE__ */ Y(qo, { iconName: e.icon });
|
|
4565
|
+
return e.link ? /* @__PURE__ */ Y(t, {
|
|
4566
|
+
"aria-label": e.title,
|
|
4567
|
+
href: e.link,
|
|
4568
4568
|
size: "md",
|
|
4569
|
-
target:
|
|
4569
|
+
target: e.targetBlank ? "_blank" : "_self",
|
|
4570
4570
|
variant: "ghost",
|
|
4571
4571
|
className: "justify-start truncate hover:bg-f1-background-hover",
|
|
4572
4572
|
compact: !0,
|
|
4573
4573
|
prepend: r,
|
|
4574
4574
|
children: /* @__PURE__ */ Y("div", {
|
|
4575
4575
|
className: "flex w-full items-start",
|
|
4576
|
-
children:
|
|
4576
|
+
children: e.title
|
|
4577
4577
|
})
|
|
4578
4578
|
}, n) : /* @__PURE__ */ X("div", {
|
|
4579
4579
|
className: "flex min-w-0 flex-1 items-center gap-1 px-[6px] py-1.5 font-medium text-f1-foreground",
|
|
4580
|
-
children: [r,
|
|
4580
|
+
children: [r, e.title]
|
|
4581
4581
|
}, n);
|
|
4582
4582
|
})
|
|
4583
4583
|
})
|
|
@@ -4593,12 +4593,12 @@ async function Yo(e, t, n) {
|
|
|
4593
4593
|
}]) : await se(r);
|
|
4594
4594
|
E(i, `${n}.${t}`);
|
|
4595
4595
|
}
|
|
4596
|
-
function Xo({ dataset: e, title: t, filename:
|
|
4597
|
-
let
|
|
4598
|
-
if (!
|
|
4599
|
-
let t =
|
|
4600
|
-
Yo(
|
|
4601
|
-
}, [
|
|
4596
|
+
function Xo({ dataset: e, title: t, filename: r }) {
|
|
4597
|
+
let i = d(), a = K(null), o = t ?? i.ai.aiTable.title, s = U((e) => {
|
|
4598
|
+
if (!a.current) return;
|
|
4599
|
+
let t = r ?? (o.replace(/\s+/g, "_").toLowerCase() || "table");
|
|
4600
|
+
Yo(a.current, e, t);
|
|
4601
|
+
}, [o, r]);
|
|
4602
4602
|
return e.columns?.length ? /* @__PURE__ */ X(x, {
|
|
4603
4603
|
display: "flex",
|
|
4604
4604
|
flexDirection: "column",
|
|
@@ -4616,38 +4616,38 @@ function Xo({ dataset: e, title: t, filename: n }) {
|
|
|
4616
4616
|
borderColor: "secondary",
|
|
4617
4617
|
paddingX: "md",
|
|
4618
4618
|
paddingY: "sm",
|
|
4619
|
-
children: [/* @__PURE__ */ Y(
|
|
4619
|
+
children: [/* @__PURE__ */ Y(n, {
|
|
4620
4620
|
tag: "h2",
|
|
4621
4621
|
className: "text-base font-medium capitalize text-f1-foreground",
|
|
4622
|
-
children:
|
|
4622
|
+
children: o
|
|
4623
4623
|
}), /* @__PURE__ */ Y(it, {
|
|
4624
4624
|
icon: B,
|
|
4625
4625
|
size: "md",
|
|
4626
4626
|
items: [{
|
|
4627
|
-
label:
|
|
4627
|
+
label: i.ai.aiTable.downloadExcel,
|
|
4628
4628
|
icon: B,
|
|
4629
|
-
onClick: () =>
|
|
4629
|
+
onClick: () => s("xlsx")
|
|
4630
4630
|
}, {
|
|
4631
|
-
label:
|
|
4631
|
+
label: i.ai.aiTable.downloadCsv,
|
|
4632
4632
|
icon: B,
|
|
4633
|
-
onClick: () =>
|
|
4633
|
+
onClick: () => s("csv")
|
|
4634
4634
|
}]
|
|
4635
4635
|
})]
|
|
4636
4636
|
}), /* @__PURE__ */ Y(x, {
|
|
4637
4637
|
overflowX: "auto",
|
|
4638
4638
|
children: /* @__PURE__ */ X("table", {
|
|
4639
|
-
ref:
|
|
4639
|
+
ref: a,
|
|
4640
4640
|
className: y("w-full border-separate border-spacing-0 text-md", "[&_tbody_tr:last-child_td]:border-b-0"),
|
|
4641
4641
|
children: [/* @__PURE__ */ Y("thead", { children: /* @__PURE__ */ Y("tr", { children: e.columns.map((t) => /* @__PURE__ */ Y("th", {
|
|
4642
4642
|
className: "sticky top-0 z-10 whitespace-nowrap border-0 border-b border-solid border-f1-border-secondary bg-f1-background px-3 py-2 text-left font-medium text-f1-foreground-secondary",
|
|
4643
4643
|
children: e.columnLabels?.[t] ?? t
|
|
4644
|
-
}, t)) }) }), /* @__PURE__ */ Y("tbody", { children: e.rows.map((t,
|
|
4645
|
-
let
|
|
4644
|
+
}, t)) }) }), /* @__PURE__ */ Y("tbody", { children: e.rows.map((t, r) => /* @__PURE__ */ Y("tr", { children: e.columns.map((e) => {
|
|
4645
|
+
let r = t[e];
|
|
4646
4646
|
return /* @__PURE__ */ Y("td", {
|
|
4647
4647
|
className: "max-w-72 border-0 border-b border-solid border-f1-border-secondary px-3 py-2 text-f1-foreground",
|
|
4648
|
-
children: /* @__PURE__ */ Y(
|
|
4648
|
+
children: /* @__PURE__ */ Y(n, { children: r == null ? "" : String(r) })
|
|
4649
4649
|
}, e);
|
|
4650
|
-
}) },
|
|
4650
|
+
}) }, r)) })]
|
|
4651
4651
|
})
|
|
4652
4652
|
})]
|
|
4653
4653
|
}) : null;
|
|
@@ -4656,11 +4656,11 @@ Xo.displayName = "F0AiTableCard";
|
|
|
4656
4656
|
//#endregion
|
|
4657
4657
|
//#region src/addons/ai/ai/F0AiChatHeader/components/CreditsPopover.tsx
|
|
4658
4658
|
function Zo({ credits: e, trigger: t }) {
|
|
4659
|
-
let
|
|
4660
|
-
|
|
4661
|
-
g(e),
|
|
4659
|
+
let a = d(), [o, s] = q(!1), [c, u] = q(!1), [f, p] = q(!1), [m, g] = q(null), y = U((t) => {
|
|
4660
|
+
s(t), t && e?.fetchUsage && (u(!0), p(!1), e.fetchUsage().then((e) => {
|
|
4661
|
+
g(e), p(!1);
|
|
4662
4662
|
}).catch(() => {
|
|
4663
|
-
|
|
4663
|
+
p(!0);
|
|
4664
4664
|
}).finally(() => {
|
|
4665
4665
|
u(!1);
|
|
4666
4666
|
}));
|
|
@@ -4668,16 +4668,16 @@ function Zo({ credits: e, trigger: t }) {
|
|
|
4668
4668
|
if (!e) return null;
|
|
4669
4669
|
let b = m ? Math.min(100, Math.round(m.used / m.total * 100)) : 0, x = e.companyName;
|
|
4670
4670
|
return /* @__PURE__ */ X(h, {
|
|
4671
|
-
open:
|
|
4671
|
+
open: o,
|
|
4672
4672
|
onOpenChange: y,
|
|
4673
|
-
children: [/* @__PURE__ */ Y(
|
|
4673
|
+
children: [/* @__PURE__ */ Y(r, {
|
|
4674
4674
|
asChild: !0,
|
|
4675
4675
|
children: t ?? /* @__PURE__ */ Y(_, {
|
|
4676
4676
|
variant: "ghost",
|
|
4677
4677
|
hideLabel: !0,
|
|
4678
|
-
label:
|
|
4678
|
+
label: a.t("ai.credits.title"),
|
|
4679
4679
|
icon: ze,
|
|
4680
|
-
pressed:
|
|
4680
|
+
pressed: o
|
|
4681
4681
|
})
|
|
4682
4682
|
}), /* @__PURE__ */ X(l, {
|
|
4683
4683
|
side: "bottom",
|
|
@@ -4694,11 +4694,11 @@ function Zo({ credits: e, trigger: t }) {
|
|
|
4694
4694
|
size: "lg"
|
|
4695
4695
|
}), /* @__PURE__ */ X("div", {
|
|
4696
4696
|
className: "flex min-w-0 flex-col",
|
|
4697
|
-
children: [/* @__PURE__ */ Y(
|
|
4697
|
+
children: [/* @__PURE__ */ Y(n, {
|
|
4698
4698
|
tag: "span",
|
|
4699
4699
|
className: "font-medium",
|
|
4700
4700
|
children: e.companyName ?? ""
|
|
4701
|
-
}), e.planName ? /* @__PURE__ */ Y(
|
|
4701
|
+
}), e.planName ? /* @__PURE__ */ Y(n, {
|
|
4702
4702
|
tag: "span",
|
|
4703
4703
|
className: "text-sm font-medium text-f1-foreground-secondary",
|
|
4704
4704
|
children: e.planName
|
|
@@ -4723,26 +4723,26 @@ function Zo({ credits: e, trigger: t }) {
|
|
|
4723
4723
|
})
|
|
4724
4724
|
]
|
|
4725
4725
|
}) : null,
|
|
4726
|
-
|
|
4726
|
+
f ? /* @__PURE__ */ Y("span", {
|
|
4727
4727
|
className: "text-sm text-f1-foreground-secondary",
|
|
4728
|
-
children:
|
|
4728
|
+
children: a.t("ai.credits.creditsError")
|
|
4729
4729
|
}) : null,
|
|
4730
|
-
!c && !
|
|
4730
|
+
!c && !f && m ? /* @__PURE__ */ X(J, { children: [
|
|
4731
4731
|
/* @__PURE__ */ X("div", {
|
|
4732
4732
|
className: "flex justify-between",
|
|
4733
4733
|
children: [/* @__PURE__ */ Y("span", {
|
|
4734
4734
|
className: "text-base font-medium text-f1-foreground",
|
|
4735
|
-
children:
|
|
4735
|
+
children: a.t("ai.credits.title")
|
|
4736
4736
|
}), /* @__PURE__ */ Y("span", {
|
|
4737
4737
|
className: "font-medium text-f1-foreground-secondary",
|
|
4738
|
-
children:
|
|
4738
|
+
children: a.t("ai.credits.creditsLeft", { total: Math.max(0, m.total - m.used).toLocaleString() })
|
|
4739
4739
|
})]
|
|
4740
4740
|
}),
|
|
4741
4741
|
/* @__PURE__ */ Y("div", {
|
|
4742
4742
|
className: "flex items-center gap-2",
|
|
4743
4743
|
children: /* @__PURE__ */ Y("div", {
|
|
4744
4744
|
className: "relative h-2 w-full overflow-hidden rounded-full bg-f1-background-secondary",
|
|
4745
|
-
children: /* @__PURE__ */ Y(
|
|
4745
|
+
children: /* @__PURE__ */ Y(v.div, {
|
|
4746
4746
|
className: "h-full rounded-full",
|
|
4747
4747
|
style: {
|
|
4748
4748
|
width: `${b}%`,
|
|
@@ -4763,17 +4763,17 @@ function Zo({ credits: e, trigger: t }) {
|
|
|
4763
4763
|
className: "flex items-center gap-1.5",
|
|
4764
4764
|
children: [/* @__PURE__ */ Y("div", { className: "h-2 w-2 rounded-full bg-f1-border" }), /* @__PURE__ */ Y("span", {
|
|
4765
4765
|
className: "text-sm tabular-nums text-f1-foreground-secondary",
|
|
4766
|
-
children:
|
|
4766
|
+
children: a.t("ai.credits.monthlyCredits")
|
|
4767
4767
|
})]
|
|
4768
4768
|
})
|
|
4769
4769
|
] }) : null
|
|
4770
4770
|
]
|
|
4771
4771
|
}), e.upgradePlanUrl ? /* @__PURE__ */ X("div", {
|
|
4772
4772
|
className: "flex items-center justify-between border-0 border-t border-solid border-f1-border-secondary p-3",
|
|
4773
|
-
children: [/* @__PURE__ */ Y("span", { children:
|
|
4773
|
+
children: [/* @__PURE__ */ Y("span", { children: a.t("ai.credits.needMoreCredits") }), /* @__PURE__ */ Y(i, {
|
|
4774
4774
|
variant: "outlinePromote",
|
|
4775
4775
|
href: e.upgradePlanUrl,
|
|
4776
|
-
label:
|
|
4776
|
+
label: a.t("ai.credits.upgradePlan"),
|
|
4777
4777
|
icon: _e
|
|
4778
4778
|
})]
|
|
4779
4779
|
}) : null]
|
|
@@ -4783,14 +4783,14 @@ function Zo({ credits: e, trigger: t }) {
|
|
|
4783
4783
|
}
|
|
4784
4784
|
//#endregion
|
|
4785
4785
|
//#region src/addons/ai/ai/F0AiChatHeader/components/EmployeeCreditsPopover.tsx
|
|
4786
|
-
var Qo = "linear-gradient(90deg, #E55619, #A1ADE5, #E51943, #E55619)", $o = ({ loading:
|
|
4787
|
-
let i =
|
|
4786
|
+
var Qo = "linear-gradient(90deg, #E55619, #A1ADE5, #E51943, #E55619)", $o = ({ loading: t, error: n, data: r }) => {
|
|
4787
|
+
let i = d(), a = e(), o = r && r.total > 0 ? Math.min(100, Math.round(r.used / r.total * 100)) : 0, s = r ? Math.max(0, r.total - r.used) : 0;
|
|
4788
4788
|
return /* @__PURE__ */ Y("div", {
|
|
4789
4789
|
className: "flex flex-col rounded border border-solid border-f1-border-secondary",
|
|
4790
4790
|
children: /* @__PURE__ */ X("div", {
|
|
4791
4791
|
className: "flex flex-col gap-2 p-3",
|
|
4792
4792
|
children: [
|
|
4793
|
-
|
|
4793
|
+
t ? /* @__PURE__ */ X("div", {
|
|
4794
4794
|
className: "flex flex-col gap-2",
|
|
4795
4795
|
"aria-busy": "true",
|
|
4796
4796
|
"aria-live": "polite",
|
|
@@ -4810,7 +4810,7 @@ var Qo = "linear-gradient(90deg, #E55619, #A1ADE5, #E51943, #E55619)", $o = ({ l
|
|
|
4810
4810
|
className: "text-sm text-f1-foreground-secondary",
|
|
4811
4811
|
children: i.t("ai.credits.creditsError")
|
|
4812
4812
|
}) : null,
|
|
4813
|
-
!
|
|
4813
|
+
!t && !n && r ? /* @__PURE__ */ X("div", {
|
|
4814
4814
|
className: "flex flex-col gap-2",
|
|
4815
4815
|
children: [
|
|
4816
4816
|
/* @__PURE__ */ X("div", {
|
|
@@ -4820,14 +4820,14 @@ var Qo = "linear-gradient(90deg, #E55619, #A1ADE5, #E51943, #E55619)", $o = ({ l
|
|
|
4820
4820
|
children: i.t("ai.credits.employeeCredits")
|
|
4821
4821
|
}), /* @__PURE__ */ Y("span", {
|
|
4822
4822
|
className: "font-medium text-f1-foreground-secondary",
|
|
4823
|
-
children: i.t("ai.credits.creditsLeft", { total:
|
|
4823
|
+
children: i.t("ai.credits.creditsLeft", { total: s.toLocaleString() })
|
|
4824
4824
|
})]
|
|
4825
4825
|
}),
|
|
4826
4826
|
/* @__PURE__ */ Y("div", {
|
|
4827
4827
|
className: "flex items-center gap-2",
|
|
4828
4828
|
children: /* @__PURE__ */ Y("div", {
|
|
4829
4829
|
className: "relative h-2 w-full overflow-hidden rounded-full bg-f1-background-secondary",
|
|
4830
|
-
children: /* @__PURE__ */ Y(
|
|
4830
|
+
children: /* @__PURE__ */ Y(v.div, {
|
|
4831
4831
|
className: "h-full rounded-full",
|
|
4832
4832
|
style: {
|
|
4833
4833
|
width: `${o}%`,
|
|
@@ -4858,28 +4858,28 @@ var Qo = "linear-gradient(90deg, #E55619, #A1ADE5, #E51943, #E55619)", $o = ({ l
|
|
|
4858
4858
|
});
|
|
4859
4859
|
};
|
|
4860
4860
|
function es({ employeeCredits: e, trigger: t }) {
|
|
4861
|
-
let
|
|
4862
|
-
|
|
4863
|
-
|
|
4861
|
+
let i = d(), [a, o] = q(!1), [s, c] = q(!1), [u, f] = q(!1), [p, m] = q(null), g = U((t) => {
|
|
4862
|
+
o(t), t && e?.fetchUsage && (c(!0), f(!1), e.fetchUsage().then((e) => {
|
|
4863
|
+
m(e), f(!1);
|
|
4864
4864
|
}).catch(() => {
|
|
4865
|
-
|
|
4865
|
+
f(!0);
|
|
4866
4866
|
}).finally(() => {
|
|
4867
|
-
|
|
4867
|
+
c(!1);
|
|
4868
4868
|
}));
|
|
4869
4869
|
}, [e]);
|
|
4870
4870
|
if (!e) return null;
|
|
4871
|
-
let
|
|
4871
|
+
let v = !!e.companyName;
|
|
4872
4872
|
return /* @__PURE__ */ X(h, {
|
|
4873
|
-
open:
|
|
4874
|
-
onOpenChange:
|
|
4875
|
-
children: [/* @__PURE__ */ Y(
|
|
4873
|
+
open: a,
|
|
4874
|
+
onOpenChange: g,
|
|
4875
|
+
children: [/* @__PURE__ */ Y(r, {
|
|
4876
4876
|
asChild: !0,
|
|
4877
4877
|
children: t ?? /* @__PURE__ */ Y(_, {
|
|
4878
4878
|
variant: "ghost",
|
|
4879
4879
|
hideLabel: !0,
|
|
4880
|
-
label:
|
|
4880
|
+
label: i.t("ai.credits.title"),
|
|
4881
4881
|
icon: ze,
|
|
4882
|
-
pressed:
|
|
4882
|
+
pressed: a
|
|
4883
4883
|
})
|
|
4884
4884
|
}), /* @__PURE__ */ X(l, {
|
|
4885
4885
|
side: "bottom",
|
|
@@ -4888,7 +4888,7 @@ function es({ employeeCredits: e, trigger: t }) {
|
|
|
4888
4888
|
sideOffset: 4,
|
|
4889
4889
|
collisionPadding: 12,
|
|
4890
4890
|
className: "flex w-[324px] flex-col gap-3 rounded-md border border-solid border-f1-border-secondary p-3",
|
|
4891
|
-
children: [
|
|
4891
|
+
children: [v ? /* @__PURE__ */ X("div", {
|
|
4892
4892
|
className: "flex min-w-0 max-w-full flex-1 items-center gap-2 overflow-hidden text-left text-lg text-f1-foreground",
|
|
4893
4893
|
children: [/* @__PURE__ */ Y(bt, {
|
|
4894
4894
|
name: e.companyName ?? "",
|
|
@@ -4896,20 +4896,20 @@ function es({ employeeCredits: e, trigger: t }) {
|
|
|
4896
4896
|
size: "lg"
|
|
4897
4897
|
}), /* @__PURE__ */ X("div", {
|
|
4898
4898
|
className: "flex min-w-0 flex-col",
|
|
4899
|
-
children: [/* @__PURE__ */ Y(
|
|
4899
|
+
children: [/* @__PURE__ */ Y(n, {
|
|
4900
4900
|
tag: "span",
|
|
4901
4901
|
className: "font-medium",
|
|
4902
4902
|
children: e.companyName ?? ""
|
|
4903
|
-
}), e.planName ? /* @__PURE__ */ Y(
|
|
4903
|
+
}), e.planName ? /* @__PURE__ */ Y(n, {
|
|
4904
4904
|
tag: "span",
|
|
4905
4905
|
className: "text-sm font-medium text-f1-foreground-secondary",
|
|
4906
4906
|
children: e.planName
|
|
4907
4907
|
}) : null]
|
|
4908
4908
|
})]
|
|
4909
4909
|
}) : null, /* @__PURE__ */ Y($o, {
|
|
4910
|
-
loading:
|
|
4911
|
-
error:
|
|
4912
|
-
data:
|
|
4910
|
+
loading: s,
|
|
4911
|
+
error: u,
|
|
4912
|
+
data: p
|
|
4913
4913
|
})]
|
|
4914
4914
|
})]
|
|
4915
4915
|
});
|
|
@@ -4922,12 +4922,12 @@ var ts = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
4922
4922
|
}) : e ? /* @__PURE__ */ Y(Zo, {
|
|
4923
4923
|
credits: e,
|
|
4924
4924
|
trigger: n
|
|
4925
|
-
}) : null, ns = ts, rs = ({ historyEnabled:
|
|
4926
|
-
let C =
|
|
4925
|
+
}) : null, ns = ts, rs = ({ historyEnabled: r = !1, title: i, currentThreadTitle: a, fullscreen: o = !1, lockVisualizationMode: s = !1, onToggleVisualizationMode: c, onClose: l, onNewChat: u, onOpenHistory: f, hasMessages: p = !1, credits: h, employeeCredits: g, compact: b = !1, actions: x }) => {
|
|
4926
|
+
let C = d(), w = e(), { panelOverlays: T } = V(), E = !s && !T && /* @__PURE__ */ Y(_, {
|
|
4927
4927
|
variant: "ghost",
|
|
4928
4928
|
hideLabel: !0,
|
|
4929
|
-
label:
|
|
4930
|
-
icon:
|
|
4929
|
+
label: o ? C.ai.collapseChat : C.ai.expandChat,
|
|
4930
|
+
icon: o ? fe : ve,
|
|
4931
4931
|
onClick: c
|
|
4932
4932
|
}), D = /* @__PURE__ */ Y(_, {
|
|
4933
4933
|
variant: "ghost",
|
|
@@ -4945,11 +4945,11 @@ var ts = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
4945
4945
|
}, e.id));
|
|
4946
4946
|
return b ? /* @__PURE__ */ X("header", {
|
|
4947
4947
|
className: y("flex items-center justify-between gap-3 pr-4 pl-5 py-3"),
|
|
4948
|
-
children: [/* @__PURE__ */ Y(
|
|
4948
|
+
children: [/* @__PURE__ */ Y(n, {
|
|
4949
4949
|
lines: 1,
|
|
4950
4950
|
className: "min-w-0 flex-1 text-left font-semibold text-f1-foreground",
|
|
4951
|
-
children:
|
|
4952
|
-
}), /* @__PURE__ */ X(
|
|
4951
|
+
children: a ?? C.ai.newConversation
|
|
4952
|
+
}), /* @__PURE__ */ X(v.div, {
|
|
4953
4953
|
className: "flex shrink-0 items-center",
|
|
4954
4954
|
initial: { opacity: 0 },
|
|
4955
4955
|
animate: { opacity: 1 },
|
|
@@ -4963,29 +4963,29 @@ var ts = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
4963
4963
|
D
|
|
4964
4964
|
]
|
|
4965
4965
|
})]
|
|
4966
|
-
}) :
|
|
4966
|
+
}) : r ? /* @__PURE__ */ X("header", {
|
|
4967
4967
|
className: y("flex justify-between pl-2.5 pr-3 py-3 w-full overflow-hidden gap-3"),
|
|
4968
4968
|
children: [/* @__PURE__ */ Y("div", {
|
|
4969
4969
|
className: "flex min-w-0 flex-1 items-center",
|
|
4970
|
-
children:
|
|
4970
|
+
children: s ? null : /* @__PURE__ */ Y(t, {
|
|
4971
4971
|
variant: "ghost",
|
|
4972
4972
|
size: "md",
|
|
4973
4973
|
className: "min-w-0 max-w-full [&>div>span>span]:w-full",
|
|
4974
4974
|
onClick: f,
|
|
4975
4975
|
children: /* @__PURE__ */ X("div", {
|
|
4976
4976
|
className: "flex min-w-0 items-center gap-1",
|
|
4977
|
-
children: [/* @__PURE__ */ Y(
|
|
4977
|
+
children: [/* @__PURE__ */ Y(n, {
|
|
4978
4978
|
lines: 1,
|
|
4979
4979
|
className: "min-w-0 text-left",
|
|
4980
|
-
children:
|
|
4981
|
-
}), /* @__PURE__ */ Y(
|
|
4980
|
+
children: a ?? C.ai.newConversation
|
|
4981
|
+
}), /* @__PURE__ */ Y(m, {
|
|
4982
4982
|
icon: yt,
|
|
4983
4983
|
color: "default",
|
|
4984
4984
|
size: "md"
|
|
4985
4985
|
})]
|
|
4986
4986
|
})
|
|
4987
4987
|
})
|
|
4988
|
-
}), /* @__PURE__ */ X(
|
|
4988
|
+
}), /* @__PURE__ */ X(v.div, {
|
|
4989
4989
|
className: "flex shrink-0 items-center",
|
|
4990
4990
|
initial: { opacity: 0 },
|
|
4991
4991
|
animate: { opacity: 1 },
|
|
@@ -5009,9 +5009,9 @@ var ts = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
5009
5009
|
className: "flex items-center",
|
|
5010
5010
|
children: /* @__PURE__ */ Y("h2", {
|
|
5011
5011
|
className: "text-f1-foreground",
|
|
5012
|
-
children:
|
|
5012
|
+
children: i ?? ""
|
|
5013
5013
|
})
|
|
5014
|
-
}), /* @__PURE__ */ X(
|
|
5014
|
+
}), /* @__PURE__ */ X(v.div, {
|
|
5015
5015
|
className: "flex items-center",
|
|
5016
5016
|
initial: { opacity: 0 },
|
|
5017
5017
|
animate: { opacity: 1 },
|
|
@@ -5020,12 +5020,12 @@ var ts = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
5020
5020
|
ease: "easeOut"
|
|
5021
5021
|
},
|
|
5022
5022
|
children: [
|
|
5023
|
-
|
|
5023
|
+
p && !s ? /* @__PURE__ */ Y(_, {
|
|
5024
5024
|
variant: "ghost",
|
|
5025
5025
|
hideLabel: !0,
|
|
5026
5026
|
label: C.ai.startNewChat,
|
|
5027
5027
|
icon: z,
|
|
5028
|
-
onClick:
|
|
5028
|
+
onClick: u
|
|
5029
5029
|
}) : null,
|
|
5030
5030
|
/* @__PURE__ */ Y(ts, {
|
|
5031
5031
|
credits: h,
|
|
@@ -5071,58 +5071,58 @@ function os(e) {
|
|
|
5071
5071
|
}
|
|
5072
5072
|
//#endregion
|
|
5073
5073
|
//#region src/addons/ai/ai/F0AiChatHistory/components/ThreadItem.tsx
|
|
5074
|
-
function ss({ thread: e, isPinned: t, isActive:
|
|
5075
|
-
let
|
|
5076
|
-
label: t ?
|
|
5074
|
+
function ss({ thread: e, isPinned: t, isActive: r = !1, isPending: i = !1, onSelect: a, onPin: o, onUnpin: s, onDelete: c, className: l }) {
|
|
5075
|
+
let u = d(), f = Lt(), p = G(() => [{
|
|
5076
|
+
label: t ? u.ai.unpinChat : u.ai.pinChat,
|
|
5077
5077
|
icon: t ? ce : D,
|
|
5078
|
-
onClick: () => t ?
|
|
5078
|
+
onClick: () => t ? s(e.id) : o(e.id)
|
|
5079
5079
|
}, {
|
|
5080
|
-
label:
|
|
5080
|
+
label: u.ai.deleteChat,
|
|
5081
5081
|
icon: re,
|
|
5082
5082
|
critical: !0,
|
|
5083
|
-
onClick: () =>
|
|
5083
|
+
onClick: () => c(e.id)
|
|
5084
5084
|
}], [
|
|
5085
5085
|
t,
|
|
5086
5086
|
e.id,
|
|
5087
|
-
a,
|
|
5088
5087
|
o,
|
|
5089
|
-
s
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5088
|
+
s,
|
|
5089
|
+
c
|
|
5090
|
+
]), h = G(() => as(e.updatedAt, {
|
|
5091
|
+
today: u.ai.today,
|
|
5092
|
+
yesterday: u.ai.yesterday
|
|
5093
|
+
}, f), [
|
|
5094
5094
|
e.updatedAt,
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5095
|
+
u.ai.today,
|
|
5096
|
+
u.ai.yesterday,
|
|
5097
|
+
f
|
|
5098
5098
|
]);
|
|
5099
5099
|
return /* @__PURE__ */ X("div", {
|
|
5100
|
-
className: y("group flex gap-1 cursor-pointer items-center justify-between rounded-md py-1.5 pl-3 pr-1.5 hover:bg-f1-background-hover", b("rounded"),
|
|
5100
|
+
className: y("group flex gap-1 cursor-pointer items-center justify-between rounded-md py-1.5 pl-3 pr-1.5 hover:bg-f1-background-hover", b("rounded"), l, r && "bg-f1-background-secondary"),
|
|
5101
5101
|
role: "button",
|
|
5102
5102
|
tabIndex: 0,
|
|
5103
|
-
"aria-current":
|
|
5103
|
+
"aria-current": r ? "true" : void 0,
|
|
5104
5104
|
onKeyDown: (t) => {
|
|
5105
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
5105
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), a(e.id, e.title));
|
|
5106
5106
|
},
|
|
5107
5107
|
children: [
|
|
5108
5108
|
/* @__PURE__ */ X("div", {
|
|
5109
5109
|
className: "flex w-full min-w-0 items-center gap-1",
|
|
5110
|
-
onClick: () =>
|
|
5110
|
+
onClick: () => a(e.id, e.title),
|
|
5111
5111
|
children: [
|
|
5112
|
-
e.icon ? /* @__PURE__ */ Y(
|
|
5112
|
+
e.icon ? /* @__PURE__ */ Y(m, {
|
|
5113
5113
|
icon: e.icon,
|
|
5114
5114
|
size: "sm",
|
|
5115
5115
|
className: "mr-1 shrink-0 text-f1-icon",
|
|
5116
5116
|
"aria-hidden": !0
|
|
5117
5117
|
}) : null,
|
|
5118
|
-
/* @__PURE__ */ Y(
|
|
5118
|
+
/* @__PURE__ */ Y(n, {
|
|
5119
5119
|
lines: 1,
|
|
5120
5120
|
className: "py-0.5 text-left font-medium",
|
|
5121
5121
|
children: e.title
|
|
5122
5122
|
}),
|
|
5123
5123
|
/* @__PURE__ */ Y("span", {
|
|
5124
5124
|
className: "hidden shrink-0 text-sm font-medium text-f1-foreground-tertiary group-focus-within:inline group-hover:inline",
|
|
5125
|
-
children:
|
|
5125
|
+
children: h
|
|
5126
5126
|
})
|
|
5127
5127
|
]
|
|
5128
5128
|
}),
|
|
@@ -5130,19 +5130,19 @@ function ss({ thread: e, isPinned: t, isActive: n = !1, isPending: r = !1, onSel
|
|
|
5130
5130
|
className: "hidden shrink-0 pr-1 text-sm font-medium text-f1-foreground-tertiary group-focus-within:inline group-hover:inline",
|
|
5131
5131
|
children: e.trailingLabel
|
|
5132
5132
|
}) : null,
|
|
5133
|
-
|
|
5133
|
+
i ? /* @__PURE__ */ Y("div", {
|
|
5134
5134
|
className: "flex h-7 w-7 shrink-0 items-center justify-center",
|
|
5135
|
-
"aria-label":
|
|
5135
|
+
"aria-label": u.ai.threadOptions,
|
|
5136
5136
|
children: /* @__PURE__ */ Y(At, { size: "small" })
|
|
5137
5137
|
}) : /* @__PURE__ */ Y("div", {
|
|
5138
5138
|
className: y("hidden items-center", "group-hover:flex group-focus-within:flex", "has-[[aria-expanded=true]]:flex"),
|
|
5139
5139
|
children: /* @__PURE__ */ Y(it, {
|
|
5140
|
-
items:
|
|
5140
|
+
items: p,
|
|
5141
5141
|
children: /* @__PURE__ */ Y(_, {
|
|
5142
5142
|
icon: ee,
|
|
5143
5143
|
variant: "ghost",
|
|
5144
5144
|
size: "sm",
|
|
5145
|
-
label:
|
|
5145
|
+
label: u.ai.threadOptions,
|
|
5146
5146
|
hideLabel: !0
|
|
5147
5147
|
})
|
|
5148
5148
|
})
|
|
@@ -5155,19 +5155,19 @@ function ss({ thread: e, isPinned: t, isActive: n = !1, isPending: r = !1, onSel
|
|
|
5155
5155
|
function cs({ label: e, threads: t, pinnedIds: n, onSelect: r, onPin: i, onUnpin: a, onDelete: o }) {
|
|
5156
5156
|
let [s, c] = q(!0), l = U(() => {
|
|
5157
5157
|
c((e) => !e);
|
|
5158
|
-
}, []),
|
|
5158
|
+
}, []), u = U((e) => {
|
|
5159
5159
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), l());
|
|
5160
5160
|
}, [l]);
|
|
5161
5161
|
return /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ X("div", {
|
|
5162
5162
|
role: "button",
|
|
5163
5163
|
tabIndex: 0,
|
|
5164
5164
|
onClick: l,
|
|
5165
|
-
onKeyDown:
|
|
5165
|
+
onKeyDown: u,
|
|
5166
5166
|
className: y("flex cursor-pointer items-center p-3 gap-1 hover:bg-f1-background-hover", b("rounded")),
|
|
5167
5167
|
children: [/* @__PURE__ */ Y("span", {
|
|
5168
5168
|
className: "text-sm font-medium capitalize tracking-wide text-f1-foreground-secondary",
|
|
5169
5169
|
children: e
|
|
5170
|
-
}), /* @__PURE__ */ Y(
|
|
5170
|
+
}), /* @__PURE__ */ Y(m, {
|
|
5171
5171
|
icon: s ? yt : Tt,
|
|
5172
5172
|
color: "secondary",
|
|
5173
5173
|
size: "xs"
|
|
@@ -5195,12 +5195,12 @@ var ls = [
|
|
|
5195
5195
|
"w-2/3"
|
|
5196
5196
|
], us = ({ width: e }) => /* @__PURE__ */ Y("div", {
|
|
5197
5197
|
className: "flex items-center py-1.5 pl-1.5 pr-2",
|
|
5198
|
-
children: /* @__PURE__ */ Y(
|
|
5198
|
+
children: /* @__PURE__ */ Y(c, { className: y("h-4 rounded", e) })
|
|
5199
5199
|
}), ds = ({ titleWidth: e, rows: t }) => /* @__PURE__ */ X("div", {
|
|
5200
5200
|
className: "flex flex-col gap-0.5",
|
|
5201
5201
|
children: [/* @__PURE__ */ Y("div", {
|
|
5202
5202
|
className: "flex items-center p-1.5",
|
|
5203
|
-
children: /* @__PURE__ */ Y(
|
|
5203
|
+
children: /* @__PURE__ */ Y(c, { className: y("h-3 rounded", e) })
|
|
5204
5204
|
}), t.map((e, t) => /* @__PURE__ */ Y(us, { width: e }, t))]
|
|
5205
5205
|
});
|
|
5206
5206
|
function fs() {
|
|
@@ -5218,105 +5218,105 @@ function fs() {
|
|
|
5218
5218
|
}
|
|
5219
5219
|
//#endregion
|
|
5220
5220
|
//#region src/addons/ai/ai/F0AiChatHistory/F0AiChatHistory.tsx
|
|
5221
|
-
var ps = ({ onClose:
|
|
5222
|
-
let
|
|
5221
|
+
var ps = ({ onClose: e, onSelectThread: r, onNewChat: i, threads: a, isLoading: o, error: s, pinnedIds: c, onPinThread: l, onUnpinThread: u, onDeleteThread: f }) => {
|
|
5222
|
+
let p = d(), [h, g] = q("");
|
|
5223
5223
|
W(() => {
|
|
5224
|
-
let
|
|
5225
|
-
|
|
5224
|
+
let t = (t) => {
|
|
5225
|
+
t.key === "Escape" && e();
|
|
5226
5226
|
};
|
|
5227
|
-
return document.addEventListener("keydown",
|
|
5228
|
-
}, [
|
|
5229
|
-
let
|
|
5230
|
-
today:
|
|
5231
|
-
yesterday:
|
|
5232
|
-
thisMonth:
|
|
5233
|
-
older:
|
|
5227
|
+
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
5228
|
+
}, [e]);
|
|
5229
|
+
let _ = G(() => ({
|
|
5230
|
+
today: p.ai.today,
|
|
5231
|
+
yesterday: p.ai.yesterday,
|
|
5232
|
+
thisMonth: p.ai.thisMonth,
|
|
5233
|
+
older: p.ai.older
|
|
5234
5234
|
}), [
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
]),
|
|
5240
|
-
if (!
|
|
5241
|
-
let e =
|
|
5242
|
-
return
|
|
5243
|
-
}, [
|
|
5244
|
-
|
|
5245
|
-
}, [
|
|
5246
|
-
|
|
5247
|
-
}, [
|
|
5248
|
-
|
|
5249
|
-
}, [
|
|
5235
|
+
p.ai.today,
|
|
5236
|
+
p.ai.yesterday,
|
|
5237
|
+
p.ai.thisMonth,
|
|
5238
|
+
p.ai.older
|
|
5239
|
+
]), v = G(() => {
|
|
5240
|
+
if (!h.trim()) return a;
|
|
5241
|
+
let e = h.toLowerCase();
|
|
5242
|
+
return a.filter((t) => t.title.toLowerCase().includes(e));
|
|
5243
|
+
}, [a, h]), b = G(() => v.filter((e) => c.has(e.id)), [v, c]), x = G(() => v.filter((e) => !c.has(e.id)), [v, c]), S = G(() => os(x), [x]), C = U((t, n) => {
|
|
5244
|
+
r(t, n), e();
|
|
5245
|
+
}, [r, e]), w = U(() => {
|
|
5246
|
+
i(), e();
|
|
5247
|
+
}, [i, e]), T = U((e) => {
|
|
5248
|
+
f(e);
|
|
5249
|
+
}, [f]), E = b.length > 0 || S.length > 0;
|
|
5250
5250
|
return Jt(/* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", {
|
|
5251
5251
|
className: "fixed inset-0 z-50 bg-f1-background-overlay animate-in fade-in-0",
|
|
5252
|
-
onClick:
|
|
5252
|
+
onClick: e,
|
|
5253
5253
|
"aria-hidden": "true"
|
|
5254
5254
|
}), /* @__PURE__ */ Y("div", {
|
|
5255
5255
|
role: "dialog",
|
|
5256
5256
|
"aria-modal": "true",
|
|
5257
|
-
"aria-label":
|
|
5257
|
+
"aria-label": p.ai.chatHistory,
|
|
5258
5258
|
className: y("fixed inset-0 z-50 flex items-center justify-center", "pointer-events-none", "animate-in fade-in-0 zoom-in-95"),
|
|
5259
5259
|
children: /* @__PURE__ */ X("div", {
|
|
5260
5260
|
className: y("pointer-events-auto relative flex w-full max-w-[600px] flex-col", "rounded-xl bg-f1-background shadow-lg", "max-h-[min(600px,80vh)]"),
|
|
5261
5261
|
children: [/* @__PURE__ */ X("div", {
|
|
5262
5262
|
className: "flex flex-shrink-0 items-center gap-2 border-0 border-b border-solid border-f1-border-secondary py-2 pl-5 pr-3",
|
|
5263
|
-
children: [/* @__PURE__ */ Y(
|
|
5263
|
+
children: [/* @__PURE__ */ Y(m, {
|
|
5264
5264
|
icon: _t,
|
|
5265
5265
|
color: "secondary",
|
|
5266
5266
|
size: "md"
|
|
5267
5267
|
}), /* @__PURE__ */ Y("input", {
|
|
5268
5268
|
type: "text",
|
|
5269
|
-
value:
|
|
5270
|
-
onChange: (e) =>
|
|
5271
|
-
placeholder:
|
|
5269
|
+
value: h,
|
|
5270
|
+
onChange: (e) => g(e.target.value),
|
|
5271
|
+
placeholder: p.ai.searchChats,
|
|
5272
5272
|
className: y("w-full", "py-2.5 pr-3", "text-base text-f1-foreground-secondary placeholder:text-f1-foreground-tertiary focus:outline-none", "outline-none")
|
|
5273
5273
|
})]
|
|
5274
5274
|
}), /* @__PURE__ */ X("div", {
|
|
5275
5275
|
className: "flex flex-1 flex-col gap-1 overflow-y-auto p-2",
|
|
5276
5276
|
children: [
|
|
5277
|
-
/* @__PURE__ */ Y(
|
|
5277
|
+
/* @__PURE__ */ Y(t, {
|
|
5278
5278
|
variant: "ghost",
|
|
5279
5279
|
size: "md",
|
|
5280
5280
|
className: "py-1 [&>div>span>span]:w-full",
|
|
5281
5281
|
onClick: w,
|
|
5282
5282
|
children: /* @__PURE__ */ X("div", {
|
|
5283
5283
|
className: "flex w-full items-center gap-2",
|
|
5284
|
-
children: [/* @__PURE__ */ Y(
|
|
5284
|
+
children: [/* @__PURE__ */ Y(m, {
|
|
5285
5285
|
icon: z,
|
|
5286
5286
|
color: "default",
|
|
5287
5287
|
size: "md"
|
|
5288
|
-
}), /* @__PURE__ */ Y(
|
|
5288
|
+
}), /* @__PURE__ */ Y(n, {
|
|
5289
5289
|
lines: 1,
|
|
5290
5290
|
className: "text-left",
|
|
5291
|
-
children:
|
|
5291
|
+
children: p.ai.startNewChat
|
|
5292
5292
|
})]
|
|
5293
5293
|
})
|
|
5294
5294
|
}),
|
|
5295
|
-
|
|
5296
|
-
!
|
|
5295
|
+
o ? /* @__PURE__ */ Y(fs, {}) : null,
|
|
5296
|
+
!o && s ? /* @__PURE__ */ Y("p", {
|
|
5297
5297
|
className: "py-8 text-center text-base text-f1-foreground-tertiary",
|
|
5298
|
-
children:
|
|
5298
|
+
children: s
|
|
5299
5299
|
}) : null,
|
|
5300
|
-
!
|
|
5300
|
+
!o && !s && !E ? /* @__PURE__ */ Y("p", {
|
|
5301
5301
|
className: "py-8 text-center text-base text-f1-foreground-tertiary",
|
|
5302
|
-
children:
|
|
5302
|
+
children: p.ai.noPreviousChats
|
|
5303
5303
|
}) : null,
|
|
5304
|
-
!
|
|
5305
|
-
label:
|
|
5304
|
+
!o && !s && b.length > 0 ? /* @__PURE__ */ Y(cs, {
|
|
5305
|
+
label: p.ai.pinnedChats,
|
|
5306
5306
|
threads: b,
|
|
5307
|
-
pinnedIds:
|
|
5307
|
+
pinnedIds: c,
|
|
5308
5308
|
onSelect: C,
|
|
5309
|
-
onPin:
|
|
5310
|
-
onUnpin:
|
|
5309
|
+
onPin: l,
|
|
5310
|
+
onUnpin: u,
|
|
5311
5311
|
onDelete: T
|
|
5312
5312
|
}) : null,
|
|
5313
|
-
!
|
|
5314
|
-
label:
|
|
5313
|
+
!o && !s ? S.map((e) => /* @__PURE__ */ Y(cs, {
|
|
5314
|
+
label: _[e.key],
|
|
5315
5315
|
threads: e.threads,
|
|
5316
|
-
pinnedIds:
|
|
5316
|
+
pinnedIds: c,
|
|
5317
5317
|
onSelect: C,
|
|
5318
|
-
onPin:
|
|
5319
|
-
onUnpin:
|
|
5318
|
+
onPin: l,
|
|
5319
|
+
onUnpin: u,
|
|
5320
5320
|
onDelete: T
|
|
5321
5321
|
}, e.key)) : null
|
|
5322
5322
|
]
|
|
@@ -5399,7 +5399,7 @@ function _s({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, u
|
|
|
5399
5399
|
}
|
|
5400
5400
|
//#endregion
|
|
5401
5401
|
//#region src/addons/ai/ai/F0AiChatUsageLimits/types.ts
|
|
5402
|
-
var vs = ["top", "bottom"], ys =
|
|
5402
|
+
var vs = ["top", "bottom"], ys = v.create(ie), bs = ({ label: e, reduceMotion: t }) => /* @__PURE__ */ X("div", {
|
|
5403
5403
|
role: "status",
|
|
5404
5404
|
"aria-live": "polite",
|
|
5405
5405
|
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",
|
|
@@ -5452,19 +5452,19 @@ var vs = ["top", "bottom"], ys = s.create(ie), bs = ({ label: e, reduceMotion: t
|
|
|
5452
5452
|
className: "font-medium",
|
|
5453
5453
|
children: e
|
|
5454
5454
|
})]
|
|
5455
|
-
}), xs = Ut(function({ active:
|
|
5456
|
-
let { t:
|
|
5455
|
+
}), xs = Ut(function({ active: t, label: n, className: r, children: i }) {
|
|
5456
|
+
let { t: a } = d(), o = e(), c = n ?? a("ai.applyingChanges");
|
|
5457
5457
|
return W(() => {
|
|
5458
|
-
if (!
|
|
5459
|
-
let
|
|
5460
|
-
|
|
5461
|
-
}, [
|
|
5462
|
-
className: y("relative flex flex-1 flex-col",
|
|
5463
|
-
children: [/* @__PURE__ */ Y(
|
|
5458
|
+
if (!t) return;
|
|
5459
|
+
let e = document.activeElement;
|
|
5460
|
+
e && e.getAttribute("name") !== "one-ai-input" && e.blur();
|
|
5461
|
+
}, [t]), /* @__PURE__ */ X("div", {
|
|
5462
|
+
className: y("relative flex flex-1 flex-col", r),
|
|
5463
|
+
children: [/* @__PURE__ */ Y(s, { children: t ? /* @__PURE__ */ Y(v.div, {
|
|
5464
5464
|
className: "pointer-events-none sticky top-0 z-50 flex h-0 w-full items-start justify-center overflow-visible",
|
|
5465
5465
|
initial: {
|
|
5466
5466
|
opacity: 0,
|
|
5467
|
-
scale:
|
|
5467
|
+
scale: o ? 1 : .95
|
|
5468
5468
|
},
|
|
5469
5469
|
animate: {
|
|
5470
5470
|
opacity: 1,
|
|
@@ -5472,21 +5472,21 @@ var vs = ["top", "bottom"], ys = s.create(ie), bs = ({ label: e, reduceMotion: t
|
|
|
5472
5472
|
},
|
|
5473
5473
|
exit: {
|
|
5474
5474
|
opacity: 0,
|
|
5475
|
-
scale:
|
|
5475
|
+
scale: o ? 1 : .95
|
|
5476
5476
|
},
|
|
5477
5477
|
children: /* @__PURE__ */ Y("div", {
|
|
5478
5478
|
className: "mt-[40vh]",
|
|
5479
5479
|
children: /* @__PURE__ */ Y(bs, {
|
|
5480
|
-
label:
|
|
5481
|
-
reduceMotion:
|
|
5480
|
+
label: c,
|
|
5481
|
+
reduceMotion: o
|
|
5482
5482
|
})
|
|
5483
5483
|
})
|
|
5484
|
-
}) : null }), /* @__PURE__ */ Y(
|
|
5485
|
-
className: y("flex flex-1 flex-col",
|
|
5484
|
+
}) : null }), /* @__PURE__ */ Y(v.div, {
|
|
5485
|
+
className: y("flex flex-1 flex-col", t && "pointer-events-none"),
|
|
5486
5486
|
initial: { filter: "blur(0px)" },
|
|
5487
|
-
animate: { filter:
|
|
5488
|
-
transition: { duration:
|
|
5489
|
-
children:
|
|
5487
|
+
animate: { filter: t ? "blur(2px)" : "blur(0px)" },
|
|
5488
|
+
transition: { duration: o ? 0 : .2 },
|
|
5489
|
+
children: i
|
|
5490
5490
|
})]
|
|
5491
5491
|
});
|
|
5492
5492
|
});
|