@factorialco/f0-react 12.1.0 → 12.2.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-NEIFDJib.js → ChatPostComposerDialog-DxjgJvww.js} +3 -3
- package/dist/{CoachmarkProvider-BR6fdrrh.js → CoachmarkProvider-DxxTrrK0.js} +27397 -27397
- package/dist/{DocumentToolbar-Cb3E9RnA.js → DocumentToolbar-MbpAP2xa.js} +5 -5
- package/dist/{DocxViewer-pfu-5v_l.js → DocxViewer-DLnunbBn.js} +2 -2
- package/dist/{F0AiProcessingOverlay-O9SpiZk4.js → F0AiProcessingOverlay-cNJdJNme.js} +1058 -1042
- package/dist/{F0CanvasPanel-Dn-Gkmsz.js → F0CanvasPanel-d0ARNvCs.js} +7890 -7886
- package/dist/F0DocumentViewer-CMTc9-v6.js +3 -0
- package/dist/{F0DocumentViewer-CRPMDWGj.js → F0DocumentViewer-DU0u8sE9.js} +37 -37
- package/dist/{F0Map-toEYLWLQ.js → F0Map-Ytutlfjd.js} +100 -100
- package/dist/{F0Select-BMzj1oyt.js → F0Select-DKCy1C1n.js} +1030 -1030
- package/dist/{F0Text-CjR98zwA.js → F0Text-BtzfLrwP.js} +10 -10
- package/dist/F0VideoPlayer-BZmP3fGi.js +1 -0
- package/dist/{F0VideoPlayer-BmbFZEII.js → F0VideoPlayer-DWE0J3NR.js} +290 -290
- package/dist/{Map-Cakv1wM4.js → Map-DyNfwVdY.js} +20 -20
- package/dist/{PdfThumbnail-Bxzk7G0u.js → PdfThumbnail-C-F-aujX.js} +1 -1
- package/dist/{SheetViewer-zNoFISP0.js → SheetViewer-BRTqhc5o.js} +6 -6
- package/dist/{TextViewer-BTRJxwwJ.js → TextViewer-_rXZwM4E.js} +2 -2
- package/dist/ai.js +4 -4
- package/dist/component-status.js +1 -1
- package/dist/{dist-UTTWm0CV.js → dist-DvxtFKDL.js} +1 -1
- package/dist/experimental.d.ts +1 -1
- package/dist/experimental.js +4522 -4700
- package/dist/f0.d.ts +1 -1
- package/dist/f0.js +477 -477
- package/dist/{maplibre-C5htrHET.js → maplibre-BMdn9aMc.js} +1 -1
- package/dist/{pdfWorker-B4yvX0G-.js → pdfWorker-YDigL1gB.js} +1 -1
- package/dist/{popover-B-ET_Kay.js → popover-BjrPOMeQ.js} +1 -1
- package/dist/styles.css +1 -1
- package/dist/{types-CUKMWWRC.d.ts → types-DiDeZRzi.d.ts} +4 -0
- package/dist/{useData-DWwEymV5.js → useData-BPTvQHGp.js} +291 -291
- package/package.json +1 -1
- package/dist/F0DocumentViewer-DzZu9sCO.js +0 -3
- package/dist/F0VideoPlayer-DsHl-sBd.js +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ht as e, Mt as t, Zn as n, _t as r, a as i, ar as a, b as o, gn as s, hn as c, i as l, in as u, ln as d, n as f, rn as p, rr as m, t as h, un as g, vt as _, yt as v } from "./popover-BjrPOMeQ.js";
|
|
2
2
|
import { L as y, R as b } from "./tooltip-BX4dSfeL.js";
|
|
3
|
-
import { n as x } from "./F0Text-
|
|
4
|
-
import { $ as S,
|
|
5
|
-
import { t as
|
|
6
|
-
import { C as
|
|
7
|
-
import { Dn as
|
|
8
|
-
import { n as
|
|
9
|
-
import { createContext as
|
|
3
|
+
import { n as x } from "./F0Text-BtzfLrwP.js";
|
|
4
|
+
import { $a as S, $n as C, $r as w, Ao as T, B as E, Bo as D, C as O, Dt as ee, Es as k, F as A, Fr as j, Gr as M, Ha as N, Ho as P, Hr as F, Lo as I, Lt as te, M as L, Ms as ne, Mt as R, N as z, Oa as re, Os as B, P as ie, Q as ae, R as V, Ra as oe, Ri as se, S as ce, So as le, St as ue, Tt as de, Ur as fe, V as pe, Wr as me, Ya as he, Yo as ge, Yr as _e, Z as ve, Zr as ye, _a as be, _o as xe, a as Se, at as Ce, b as we, bt as Te, c as Ee, cc as De, ct as Oe, eo as ke, es as Ae, et as je, fa as Me, fr as Ne, h as Pe, i as Fe, kt as Ie, l as Le, lc as Re, lt as ze, m as Be, no as Ve, nt as He, ot as Ue, p as We, pa as Ge, po as Ke, pr as qe, pt as Je, qn as Ye, r as Xe, rr as Ze, to as Qe, tt as $e, u as et, ut as tt, vt as nt, w as rt, x as it, xo as at, xt as ot, yo as st, yt as ct, z as lt } from "./F0CanvasPanel-d0ARNvCs.js";
|
|
5
|
+
import { t as ut } from "./i18n-provider-defaults-p0UGTA_k.js";
|
|
6
|
+
import { C as dt, D as ft, F as pt, S as mt, V as ht, W as gt, X as _t, Z as vt, k as yt, l as bt, x as xt } from "./useData-BPTvQHGp.js";
|
|
7
|
+
import { Dn as St, Dr as Ct, Er as wt, Ft as Tt, Nr as Et, On as Dt, Or as Ot, Ot as kt, _t as At, cn as jt, ct as Mt, gt as Nt, ht as Pt, jr as Ft, nn as It, sn as Lt, un as Rt } from "./F0Select-DKCy1C1n.js";
|
|
8
|
+
import { n as zt } from "./dist-DvxtFKDL.js";
|
|
9
|
+
import { createContext as Bt, createElement as Vt, forwardRef as H, memo as Ht, useCallback as U, useContext as Ut, useEffect as W, useId as Wt, useInsertionEffect as Gt, useLayoutEffect as Kt, 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
|
-
import { createPortal as
|
|
12
|
-
import { useTrackVolume as
|
|
11
|
+
import { createPortal as qt } from "react-dom";
|
|
12
|
+
import { useTrackVolume as Jt } from "@livekit/components-react";
|
|
13
13
|
//#region ../../node_modules/.pnpm/motion@12.17.0_@emotion+is-prop-valid@1.3.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/motion/dist/es/framer-motion/dist/es/utils/use-motion-value-event.mjs
|
|
14
|
-
function
|
|
15
|
-
|
|
14
|
+
function Yt(e, t, n) {
|
|
15
|
+
Gt(() => e.on(t, n), [
|
|
16
16
|
e,
|
|
17
17
|
t,
|
|
18
18
|
n
|
|
@@ -20,29 +20,29 @@ function Xt(e, t, n) {
|
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/elements/ai/F0ActionItem/types.ts
|
|
23
|
-
var
|
|
23
|
+
var Xt = [
|
|
24
24
|
"inProgress",
|
|
25
25
|
"executing",
|
|
26
26
|
"writing",
|
|
27
27
|
"asking",
|
|
28
28
|
"completed"
|
|
29
|
-
],
|
|
29
|
+
], Zt = [
|
|
30
30
|
"xs",
|
|
31
31
|
"sm",
|
|
32
32
|
"md",
|
|
33
33
|
"lg"
|
|
34
|
-
],
|
|
35
|
-
function
|
|
36
|
-
let n = e.length - e.trimStart().length, r = e.trimEnd().length, i = t.filter((t) => t.start >= n &&
|
|
37
|
-
for (let t of i) t.start < o ||
|
|
38
|
-
return a +
|
|
34
|
+
], Qt = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), $t = /[\\`*_{}[\]()#+\-.!|~>]/g, en = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace($t, "\\$&"), tn = (e) => `<entity-ref type="${Qt(e.type)}" id="${Qt(e.id)}">${Qt(e.label)}</entity-ref>`, nn = (e, t) => e.slice(t.start, pe(t)).normalize("NFC") === `@${t.label}`.normalize("NFC");
|
|
35
|
+
function rn(e, t) {
|
|
36
|
+
let n = e.length - e.trimStart().length, r = e.trimEnd().length, i = t.filter((t) => t.start >= n && nn(e, t)).sort((e, t) => e.start - t.start), a = "", o = n;
|
|
37
|
+
for (let t of i) t.start < o || pe(t) > r || (a += en(e.slice(o, t.start)) + tn(t), o = pe(t));
|
|
38
|
+
return a + en(e.slice(o, r));
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/addons/ai/ai/F0AiChatUsageLimits/components/UsageRing.tsx
|
|
42
|
-
var
|
|
43
|
-
let n =
|
|
42
|
+
var an = 14, on = 2.31, sn = ({ percentage: e, tone: t }) => {
|
|
43
|
+
let n = an / 2, r = n - on / 2, i = 2 * Math.PI * r, a = (100 - (t === "unlimited" ? 100 : e)) / 100 * i;
|
|
44
44
|
return /* @__PURE__ */ X("svg", {
|
|
45
|
-
viewBox: `0 0 ${
|
|
45
|
+
viewBox: `0 0 ${an} ${an}`,
|
|
46
46
|
className: "h-3.5 w-3.5 -rotate-90",
|
|
47
47
|
"aria-hidden": "true",
|
|
48
48
|
focusable: "false",
|
|
@@ -51,22 +51,22 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
51
51
|
cy: n,
|
|
52
52
|
r,
|
|
53
53
|
fill: "none",
|
|
54
|
-
strokeWidth:
|
|
54
|
+
strokeWidth: on,
|
|
55
55
|
className: "stroke-f1-border-secondary"
|
|
56
56
|
}), /* @__PURE__ */ Y("circle", {
|
|
57
57
|
cx: n,
|
|
58
58
|
cy: n,
|
|
59
59
|
r,
|
|
60
60
|
fill: "none",
|
|
61
|
-
strokeWidth:
|
|
61
|
+
strokeWidth: on,
|
|
62
62
|
strokeDasharray: i,
|
|
63
63
|
strokeDashoffset: a,
|
|
64
64
|
strokeLinecap: "round",
|
|
65
65
|
className: y("transition-[stroke-dashoffset] duration-300 ease-out motion-reduce:transition-none", t === "exhausted" && "stroke-f1-background-critical-bold", t === "unlimited" && "stroke-f1-border", t === "default" && "stroke-f1-background-info-bold")
|
|
66
66
|
})]
|
|
67
67
|
});
|
|
68
|
-
},
|
|
69
|
-
let i =
|
|
68
|
+
}, cn = ({ label: e, description: t, percentage: n, unlimited: r = !1 }) => {
|
|
69
|
+
let i = p(), a = !r && n >= 100;
|
|
70
70
|
return /* @__PURE__ */ X("div", {
|
|
71
71
|
className: "flex flex-col gap-3",
|
|
72
72
|
children: [
|
|
@@ -102,7 +102,7 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
102
102
|
}) : null
|
|
103
103
|
]
|
|
104
104
|
});
|
|
105
|
-
},
|
|
105
|
+
}, ln = (e) => Math.min(100, Math.max(0, Math.round(e))), un = () => /* @__PURE__ */ X("div", {
|
|
106
106
|
className: "flex flex-col gap-2",
|
|
107
107
|
"aria-busy": "true",
|
|
108
108
|
"aria-live": "polite",
|
|
@@ -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
|
-
}),
|
|
114
|
-
let o =
|
|
113
|
+
}), dn = ({ usage: e, error: t = !1, onOpenChange: n, trigger: r, side: a = "top" }) => {
|
|
114
|
+
let o = p(), [s, c] = q(!1), d = K(null), f = U((e) => {
|
|
115
115
|
c(e), n?.(e);
|
|
116
|
-
}, [n]),
|
|
116
|
+
}, [n]), m = e ? ln(e.usedPercentage) : 0, g = e?.unlimited ?? !1, _ = g ? "unlimited" : m >= 100 ? "exhausted" : "default", v = e?.sections ?? [], x = !!e?.onSeeCompany || v.length > 0, S = o.t("ai.usageLimits.title"), C = g ? o.t("ai.usageLimits.unlimited") : o.t("ai.usageLimits.used", { percentage: m }), w = e ? `${S}: ${C}` : S;
|
|
117
117
|
return /* @__PURE__ */ X(h, {
|
|
118
118
|
open: s,
|
|
119
119
|
onOpenChange: f,
|
|
120
|
-
children: [/* @__PURE__ */ Y(
|
|
120
|
+
children: [/* @__PURE__ */ Y(i, {
|
|
121
121
|
asChild: !0,
|
|
122
|
-
children:
|
|
122
|
+
children: r ?? /* @__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
|
-
children: [/* @__PURE__ */ Y(
|
|
128
|
-
percentage:
|
|
127
|
+
children: [/* @__PURE__ */ Y(sn, {
|
|
128
|
+
percentage: m,
|
|
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: d,
|
|
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(), d.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", {
|
|
@@ -148,12 +148,12 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
148
148
|
children: t ? /* @__PURE__ */ Y("span", {
|
|
149
149
|
className: "text-sm text-f1-foreground-secondary",
|
|
150
150
|
children: o.t("ai.usageLimits.error")
|
|
151
|
-
}) : e ? /* @__PURE__ */ Y(
|
|
151
|
+
}) : e ? /* @__PURE__ */ Y(cn, {
|
|
152
152
|
label: S,
|
|
153
153
|
description: e.description,
|
|
154
|
-
percentage:
|
|
154
|
+
percentage: m,
|
|
155
155
|
unlimited: g
|
|
156
|
-
}) : /* @__PURE__ */ Y(
|
|
156
|
+
}) : /* @__PURE__ */ Y(un, {})
|
|
157
157
|
}), e && x ? /* @__PURE__ */ X("div", {
|
|
158
158
|
className: "flex flex-col border-0 border-t border-solid border-f1-border-secondary p-2",
|
|
159
159
|
children: [e.onSeeCompany ? /* @__PURE__ */ X("button", {
|
|
@@ -163,34 +163,34 @@ 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(
|
|
167
|
-
icon:
|
|
166
|
+
}), /* @__PURE__ */ Y(u, {
|
|
167
|
+
icon: Ct,
|
|
168
168
|
size: "md",
|
|
169
169
|
color: "default"
|
|
170
170
|
})]
|
|
171
171
|
}) : null, v.map((e) => /* @__PURE__ */ Y("div", {
|
|
172
172
|
className: "p-2",
|
|
173
|
-
children: /* @__PURE__ */ Y(
|
|
173
|
+
children: /* @__PURE__ */ Y(cn, {
|
|
174
174
|
label: e.label,
|
|
175
175
|
description: e.description,
|
|
176
|
-
percentage:
|
|
176
|
+
percentage: ln(e.usedPercentage),
|
|
177
177
|
unlimited: e.unlimited
|
|
178
178
|
})
|
|
179
179
|
}, e.id))]
|
|
180
180
|
}) : null]
|
|
181
181
|
})]
|
|
182
182
|
});
|
|
183
|
-
},
|
|
184
|
-
let { provided: t } =
|
|
185
|
-
return t ? /* @__PURE__ */ Y(
|
|
186
|
-
},
|
|
187
|
-
let a =
|
|
183
|
+
}, fn = (e) => {
|
|
184
|
+
let { provided: t } = $e();
|
|
185
|
+
return t ? /* @__PURE__ */ Y(pn, { ...e }) : /* @__PURE__ */ Y(je, { children: /* @__PURE__ */ Y(pn, { ...e }) });
|
|
186
|
+
}, pn = ({ attachedFiles: e, isUploading: t, onRemove: n, removeLabel: r, reducedMotion: i }) => {
|
|
187
|
+
let a = p(), o = mn(e), s = e.flatMap((e) => {
|
|
188
188
|
let t = o.get(e.id);
|
|
189
189
|
if (!t) return [];
|
|
190
|
-
let i = e.file.name, a = e.file.type ||
|
|
190
|
+
let i = e.file.name, a = e.file.type || Ce({
|
|
191
191
|
name: i,
|
|
192
192
|
url: t
|
|
193
|
-
}), s =
|
|
193
|
+
}), s = Ue({
|
|
194
194
|
name: i,
|
|
195
195
|
url: t,
|
|
196
196
|
mimeType: a
|
|
@@ -208,7 +208,7 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
208
208
|
};
|
|
209
209
|
return [{
|
|
210
210
|
id: e.id,
|
|
211
|
-
content: /* @__PURE__ */ Y(
|
|
211
|
+
content: /* @__PURE__ */ Y(ie, {
|
|
212
212
|
attachment: s,
|
|
213
213
|
status: e.status === "uploaded" ? "ready" : e.status === "error" ? "error" : "uploading",
|
|
214
214
|
errorMessage: e.errorMessage,
|
|
@@ -218,16 +218,16 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
218
218
|
})
|
|
219
219
|
}];
|
|
220
220
|
});
|
|
221
|
-
return /* @__PURE__ */ Y(
|
|
221
|
+
return /* @__PURE__ */ Y(z, {
|
|
222
222
|
items: s,
|
|
223
223
|
label: a.t(e.length === 1 ? "chat.attachmentCount.one" : "chat.attachmentCount.other", { count: e.length }),
|
|
224
224
|
busy: t,
|
|
225
225
|
reducedMotion: i,
|
|
226
226
|
testIdPrefix: "ai-chat"
|
|
227
227
|
});
|
|
228
|
-
},
|
|
228
|
+
}, mn = (e) => {
|
|
229
229
|
let [t, n] = q(() => /* @__PURE__ */ new Map()), r = K(t);
|
|
230
|
-
return
|
|
230
|
+
return Kt(() => {
|
|
231
231
|
r.current = t;
|
|
232
232
|
}, [t]), W(() => {
|
|
233
233
|
let t = r.current, i = new Set(e.map((e) => e.id)), a = e.filter((e) => !t.has(e.id)), o = [...t.keys()].filter((e) => !i.has(e));
|
|
@@ -243,14 +243,14 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
243
243
|
for (let e of r.current.values()) URL.revokeObjectURL(e);
|
|
244
244
|
r.current = /* @__PURE__ */ new Map();
|
|
245
245
|
}, []), t;
|
|
246
|
-
},
|
|
246
|
+
}, hn = (e) => e.map((e) => {
|
|
247
247
|
if (e.type === "separator") return { type: "separator" };
|
|
248
248
|
if (e.type === "submenu") {
|
|
249
249
|
let { id: t, type: n, actions: r, ...i } = e;
|
|
250
250
|
return {
|
|
251
251
|
...i,
|
|
252
252
|
type: "submenu",
|
|
253
|
-
items:
|
|
253
|
+
items: hn(r)
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
256
|
if (e.type === "toggle") {
|
|
@@ -262,20 +262,20 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
262
262
|
}
|
|
263
263
|
let { id: t, type: n, ...r } = e;
|
|
264
264
|
return r;
|
|
265
|
-
}),
|
|
266
|
-
let s =
|
|
265
|
+
}), gn = ({ actions: e, showAttachEntry: t, onAttachClick: n, attachDisabled: r, attachDisabledTooltip: i, disabled: a, onOpenChange: o }) => {
|
|
266
|
+
let s = p(), [c, l] = q(!1), u = (e) => {
|
|
267
267
|
l(e), o?.(e);
|
|
268
|
-
},
|
|
268
|
+
}, d = [...t ? [{
|
|
269
269
|
label: s.ai.addFilesOrPhotos,
|
|
270
|
-
icon:
|
|
270
|
+
icon: T,
|
|
271
271
|
onClick: n,
|
|
272
272
|
disabled: r,
|
|
273
273
|
disabledTooltip: i
|
|
274
|
-
}, ...e.length > 0 ? [{ type: "separator" }] : []] : [], ...
|
|
274
|
+
}, ...e.length > 0 ? [{ type: "separator" }] : []] : [], ...hn(e)];
|
|
275
275
|
return /* @__PURE__ */ Y("div", {
|
|
276
276
|
onClick: (e) => e.stopPropagation(),
|
|
277
|
-
children: /* @__PURE__ */ Y(
|
|
278
|
-
items:
|
|
277
|
+
children: /* @__PURE__ */ Y(be, {
|
|
278
|
+
items: d,
|
|
279
279
|
align: "start",
|
|
280
280
|
disabled: a,
|
|
281
281
|
open: c,
|
|
@@ -285,7 +285,7 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
285
285
|
label: s.ai.addToConversation,
|
|
286
286
|
hideLabel: !0,
|
|
287
287
|
type: "button",
|
|
288
|
-
icon:
|
|
288
|
+
icon: vt,
|
|
289
289
|
variant: "outline",
|
|
290
290
|
size: "md",
|
|
291
291
|
pressed: c,
|
|
@@ -293,12 +293,12 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
293
293
|
})
|
|
294
294
|
})
|
|
295
295
|
});
|
|
296
|
-
},
|
|
297
|
-
let l =
|
|
298
|
-
return !e && !
|
|
299
|
-
actions:
|
|
296
|
+
}, _n = ({ onUploadFiles: e, composerActions: t, isAtMaxFiles: n, maxFiles: r, acceptValue: i, fileInputRef: a, handleFileSelect: o, recordingStatus: s, onComposerActionsOpenChange: c }) => {
|
|
297
|
+
let l = p(), u = s === "transcribing", d = () => a.current?.click(), f = t?.length ? t : null;
|
|
298
|
+
return !e && !f ? null : /* @__PURE__ */ X(J, { children: [f ? /* @__PURE__ */ Y(gn, {
|
|
299
|
+
actions: f,
|
|
300
300
|
showAttachEntry: !!e,
|
|
301
|
-
onAttachClick:
|
|
301
|
+
onAttachClick: d,
|
|
302
302
|
attachDisabled: n,
|
|
303
303
|
attachDisabledTooltip: r === void 0 ? void 0 : l.ai.tooManyFilesError.replace("{{maxFiles}}", String(r)),
|
|
304
304
|
disabled: u,
|
|
@@ -307,12 +307,12 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
307
307
|
label: l.ai.attachFile,
|
|
308
308
|
hideLabel: !0,
|
|
309
309
|
type: "button",
|
|
310
|
-
icon:
|
|
310
|
+
icon: T,
|
|
311
311
|
variant: "outline",
|
|
312
312
|
size: "md",
|
|
313
313
|
disabled: n || u,
|
|
314
314
|
onClick: (e) => {
|
|
315
|
-
e.preventDefault(),
|
|
315
|
+
e.preventDefault(), d();
|
|
316
316
|
}
|
|
317
317
|
}), e ? /* @__PURE__ */ Y("input", {
|
|
318
318
|
ref: a,
|
|
@@ -323,18 +323,18 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
323
323
|
className: "hidden",
|
|
324
324
|
onChange: o
|
|
325
325
|
}) : null] });
|
|
326
|
-
},
|
|
326
|
+
}, vn = { soft: {
|
|
327
327
|
text: "",
|
|
328
328
|
bg: "bg-f1-background-secondary",
|
|
329
329
|
fontColor: "text-f1-foreground-secondary",
|
|
330
330
|
formBorder: "[&_form]:border-f1-border"
|
|
331
|
-
} },
|
|
332
|
-
let n =
|
|
331
|
+
} }, yn = ({ creditWarning: e, children: t }) => {
|
|
332
|
+
let n = p();
|
|
333
333
|
if (!e) return t;
|
|
334
334
|
let r = {
|
|
335
|
-
...
|
|
335
|
+
...vn[e.level],
|
|
336
336
|
text: e.text ?? n.ai.creditWarning.soft
|
|
337
|
-
},
|
|
337
|
+
}, i = 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(o, {
|
|
348
|
+
label: i,
|
|
349
349
|
size: "sm",
|
|
350
350
|
variant: "outline",
|
|
351
351
|
icon: e.getCreditsIcon,
|
|
352
|
-
tooltip:
|
|
352
|
+
tooltip: i,
|
|
353
353
|
onClick: e.onGetCredits
|
|
354
|
-
}) : null, e.onDismiss ? /* @__PURE__ */ Y(
|
|
354
|
+
}) : null, e.onDismiss ? /* @__PURE__ */ Y(o, {
|
|
355
355
|
label: n.ai.creditWarning.dismiss ?? "",
|
|
356
356
|
size: "sm",
|
|
357
357
|
variant: "ghost",
|
|
@@ -362,8 +362,8 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
362
362
|
})]
|
|
363
363
|
}), t]
|
|
364
364
|
});
|
|
365
|
-
},
|
|
366
|
-
let
|
|
365
|
+
}, bn = ({ quote: e, onRemove: t }) => {
|
|
366
|
+
let n = p();
|
|
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(
|
|
378
|
-
icon:
|
|
377
|
+
children: /* @__PURE__ */ Y(u, {
|
|
378
|
+
icon: xe,
|
|
379
379
|
size: "md",
|
|
380
380
|
color: "default"
|
|
381
381
|
})
|
|
382
382
|
}),
|
|
383
|
-
/* @__PURE__ */ Y(
|
|
383
|
+
/* @__PURE__ */ Y(v, {
|
|
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: n.ai.removeQuote,
|
|
392
392
|
onClick: t,
|
|
393
393
|
icon: x,
|
|
394
394
|
hideLabel: !0,
|
|
@@ -397,9 +397,9 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
397
397
|
]
|
|
398
398
|
})
|
|
399
399
|
});
|
|
400
|
-
},
|
|
400
|
+
}, xn = ({ cards: e }) => e.length === 0 ? null : /* @__PURE__ */ Y("div", {
|
|
401
401
|
className: "grid w-full grid-cols-2 gap-3",
|
|
402
|
-
children: e.slice(0, 4).map((e) => /* @__PURE__ */ Y(
|
|
402
|
+
children: e.slice(0, 4).map((e) => /* @__PURE__ */ Y(L, {
|
|
403
403
|
avatar: {
|
|
404
404
|
type: "icon",
|
|
405
405
|
icon: e.icon
|
|
@@ -409,7 +409,7 @@ var on = 14, sn = 2.31, cn = ({ percentage: e, tone: t }) => {
|
|
|
409
409
|
onClick: e.onClick
|
|
410
410
|
}, e.id))
|
|
411
411
|
});
|
|
412
|
-
function
|
|
412
|
+
function Sn(e = 24) {
|
|
413
413
|
let [t, n] = q(null), [r, i] = q({
|
|
414
414
|
start: !1,
|
|
415
415
|
end: !1
|
|
@@ -444,12 +444,12 @@ function Cn(e = 24) {
|
|
|
444
444
|
}
|
|
445
445
|
//#endregion
|
|
446
446
|
//#region src/addons/ai/ai/F0AiChatTextArea/components/WelcomeScreenSuggestionsRow.tsx
|
|
447
|
-
var
|
|
448
|
-
function
|
|
447
|
+
var Cn = 5, wn = 46, Tn = 400, En = 16, Dn = 16;
|
|
448
|
+
function On(e, t = Cn) {
|
|
449
449
|
return e.length <= t ? e : [...e].sort(() => .5 - Math.random()).slice(0, t);
|
|
450
450
|
}
|
|
451
|
-
var
|
|
452
|
-
let [o, s] = q(null), c = K(null), d = a === "scroll",
|
|
451
|
+
var kn = ({ 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", p = Sn(), m = K(null), g = K(!1), v = Wt(), b = Wt(), 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(f, {
|
|
461
461
|
asChild: !0,
|
|
462
462
|
children: /* @__PURE__ */ Y("div", {
|
|
463
463
|
ref: (e) => {
|
|
464
|
-
c.current = e, d &&
|
|
464
|
+
c.current = e, d && p.ref(e);
|
|
465
465
|
},
|
|
466
|
-
style: d ?
|
|
466
|
+
style: d ? p.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
|
+
m.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 && m.current?.focus(), g.current = !1;
|
|
493
493
|
},
|
|
494
494
|
onEscapeKeyDown: () => {
|
|
495
495
|
g.current = !0;
|
|
@@ -502,14 +502,14 @@ 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(u, {
|
|
506
506
|
"aria-hidden": !0,
|
|
507
507
|
icon: x.icon,
|
|
508
508
|
size: "sm"
|
|
509
509
|
}), /* @__PURE__ */ Y("span", { children: x.label })]
|
|
510
510
|
}), /* @__PURE__ */ Y("div", {
|
|
511
511
|
className: "flex flex-col",
|
|
512
|
-
children:
|
|
512
|
+
children: On(x.items).map((e, r) => /* @__PURE__ */ Y(An, {
|
|
513
513
|
item: e,
|
|
514
514
|
onHover: n,
|
|
515
515
|
onSelect: (r) => {
|
|
@@ -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
|
|
524
|
-
let i = K(null), a = K(null), o = K(null), s =
|
|
523
|
+
function An({ item: e, onSelect: n, onHover: r }) {
|
|
524
|
+
let i = K(null), a = K(null), o = K(null), s = t(), 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"));
|
|
@@ -531,18 +531,18 @@ function jn({ item: t, onSelect: n, onHover: r }) {
|
|
|
531
531
|
if (!e || !t) return;
|
|
532
532
|
let n = e.scrollWidth - e.clientWidth;
|
|
533
533
|
if (n <= 0) return;
|
|
534
|
-
let r = n +
|
|
534
|
+
let r = n + En, o = r / wn * 1e3;
|
|
535
535
|
e.style.overflow = "visible";
|
|
536
|
-
let s = `linear-gradient(90deg, transparent 0, #000 ${
|
|
536
|
+
let s = `linear-gradient(90deg, transparent 0, #000 ${Dn}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
|
-
},
|
|
539
|
-
}, [s]),
|
|
540
|
-
r?.(
|
|
538
|
+
}, Tn));
|
|
539
|
+
}, [s]), d = U(() => {
|
|
540
|
+
r?.(e), l();
|
|
541
541
|
}, [
|
|
542
|
-
|
|
542
|
+
e,
|
|
543
543
|
r,
|
|
544
544
|
l
|
|
545
|
-
]),
|
|
545
|
+
]), f = U(() => {
|
|
546
546
|
r?.(null), c();
|
|
547
547
|
}, [r, c]);
|
|
548
548
|
return W(() => () => {
|
|
@@ -550,10 +550,10 @@ function jn({ item: t, 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: d,
|
|
554
|
+
onMouseLeave: f,
|
|
555
|
+
onFocus: d,
|
|
556
|
+
onBlur: f,
|
|
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,13 +561,13 @@ function jn({ item: t, 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: e.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(
|
|
570
|
-
icon:
|
|
569
|
+
children: /* @__PURE__ */ Y(u, {
|
|
570
|
+
icon: Ft,
|
|
571
571
|
size: "sm"
|
|
572
572
|
})
|
|
573
573
|
})]
|
|
@@ -575,7 +575,7 @@ function jn({ item: t, onSelect: n, onHover: r }) {
|
|
|
575
575
|
}
|
|
576
576
|
//#endregion
|
|
577
577
|
//#region src/addons/ai/ai/F0AiChatTextArea/mentions/useMentionSources.ts
|
|
578
|
-
function
|
|
578
|
+
function jn(e, t) {
|
|
579
579
|
return {
|
|
580
580
|
type: "person",
|
|
581
581
|
label: t.label,
|
|
@@ -593,11 +593,11 @@ function Mn(e, t) {
|
|
|
593
593
|
}))
|
|
594
594
|
};
|
|
595
595
|
}
|
|
596
|
-
function
|
|
597
|
-
let { ai: n } =
|
|
596
|
+
function Mn({ searchPersons: e, mentionSources: t }) {
|
|
597
|
+
let { ai: n } = p(), r = n.mentions.people;
|
|
598
598
|
return G(() => {
|
|
599
599
|
let n = t ?? [];
|
|
600
|
-
return !e || n.some((e) => e.type === "person") ? n : [
|
|
600
|
+
return !e || n.some((e) => e.type === "person") ? n : [jn(e, { label: r }), ...n];
|
|
601
601
|
}, [
|
|
602
602
|
e,
|
|
603
603
|
t,
|
|
@@ -606,7 +606,7 @@ function Nn({ searchPersons: e, mentionSources: t }) {
|
|
|
606
606
|
}
|
|
607
607
|
//#endregion
|
|
608
608
|
//#region src/addons/ai/ai/F0AiChatTextArea/file-utils.ts
|
|
609
|
-
function
|
|
609
|
+
function Nn(e, t) {
|
|
610
610
|
if (t === "*/*") return !0;
|
|
611
611
|
if (t.endsWith("/*")) {
|
|
612
612
|
let n = t.slice(0, t.indexOf("/"));
|
|
@@ -614,32 +614,32 @@ function Pn(e, t) {
|
|
|
614
614
|
}
|
|
615
615
|
return e === t;
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function Pn(e, t) {
|
|
618
618
|
if (!t) return e;
|
|
619
619
|
let n = Array.isArray(t) ? t : [t];
|
|
620
|
-
return n.length === 0 ? e : e.filter((e) => n.some((t) =>
|
|
620
|
+
return n.length === 0 ? e : e.filter((e) => n.some((t) => Nn(e.type, t)));
|
|
621
621
|
}
|
|
622
622
|
//#endregion
|
|
623
623
|
//#region src/addons/ai/ai/F0AiChatTextArea/useFileAttachments.ts
|
|
624
|
-
var
|
|
625
|
-
function
|
|
626
|
-
let [t, n] = q([]), [r, i] = q(null), a = K(null), o = K(null), s =
|
|
624
|
+
var Fn = 4e3;
|
|
625
|
+
function In(e) {
|
|
626
|
+
let [t, n] = q([]), [r, i] = q(null), a = K(null), o = K(null), s = p(), c = e?.onUploadFiles, l = e?.allowedMimeTypes, u = e?.maxFiles, d = G(() => {
|
|
627
627
|
if (l) return Array.isArray(l) ? l.join(",") : l;
|
|
628
|
-
}, [l]),
|
|
628
|
+
}, [l]), f = u !== void 0 && t.length >= u, m = K(0);
|
|
629
629
|
W(() => {
|
|
630
630
|
m.current = t.length;
|
|
631
631
|
}, [t]);
|
|
632
632
|
let h = U((e) => {
|
|
633
633
|
a.current && clearTimeout(a.current), i(e), a.current = setTimeout(() => {
|
|
634
634
|
i(null), a.current = null;
|
|
635
|
-
},
|
|
635
|
+
}, Fn);
|
|
636
636
|
}, []);
|
|
637
637
|
W(() => () => {
|
|
638
638
|
a.current && clearTimeout(a.current);
|
|
639
639
|
}, []);
|
|
640
640
|
let g = U(async (e) => {
|
|
641
641
|
if (e.length === 0 || !c) return;
|
|
642
|
-
let t =
|
|
642
|
+
let t = Pn(e, l);
|
|
643
643
|
if (t.length === 0) return;
|
|
644
644
|
if (u !== void 0 && m.current + t.length > u) {
|
|
645
645
|
h(s.ai.tooManyFilesError.replace("{{maxFiles}}", String(u)));
|
|
@@ -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: d,
|
|
693
|
+
isAtMaxFiles: f,
|
|
694
694
|
maxFiles: u,
|
|
695
695
|
processFiles: g,
|
|
696
696
|
handleFileSelect: U(async (e) => {
|
|
@@ -705,93 +705,93 @@ function Ln(e) {
|
|
|
705
705
|
}
|
|
706
706
|
//#endregion
|
|
707
707
|
//#region src/addons/ai/ai/F0AiChatTextArea/AiChatComposer.tsx
|
|
708
|
-
var
|
|
709
|
-
let
|
|
708
|
+
var Ln = ({ onSubmit: e, onStop: r, inProgress: i, onBeforeSubmit: a, placeholders: o, creditWarning: c, clarifyingUI: l, pendingContext: u = null, onPendingContextChange: d, pendingQuote: f = null, onPendingQuoteChange: m, fileAttachments: h, toolbarStart: _, composerActions: b, onComposerActionsOpenChange: x, onTranscribe: S, searchPersons: C, mentionSources: w, onProcessFilesRef: T, disclaimer: D, usageLimits: O, footer: k, isWelcomeScreen: A = !1, fullscreen: j = !1, welcomeScreenSuggestions: M, onSuggestionClick: N, welcomeScreenSuggestionsPlacement: P = "above", welcomeScreenSuggestionsCollapsedByDefault: F = !1, welcomeScreenCards: I, padding: te = "default", name: L, ref: ne }) => {
|
|
709
|
+
let R = p(), z = t(), re = !!z, B = K(null), [ie, ae] = q(null), [oe, se] = q(!1), [ce, le] = q({
|
|
710
710
|
isEmpty: !0,
|
|
711
711
|
recorder: "idle"
|
|
712
|
-
}),
|
|
712
|
+
}), ue = K(null), de = K(null);
|
|
713
713
|
W(() => () => {
|
|
714
|
-
|
|
714
|
+
de.current && clearTimeout(de.current);
|
|
715
715
|
}, []);
|
|
716
|
-
let
|
|
717
|
-
|
|
718
|
-
|
|
716
|
+
let fe = l != null, pe = K(u), me = K(f);
|
|
717
|
+
Kt(() => {
|
|
718
|
+
pe.current = u, me.current = f;
|
|
719
719
|
});
|
|
720
|
-
let { tracking:
|
|
721
|
-
|
|
720
|
+
let { tracking: he, setFocusChatInputFunction: ge } = V(), _e = U((e, t) => {
|
|
721
|
+
he?.onWelcomeSuggestionClick?.({
|
|
722
722
|
item: e,
|
|
723
723
|
group: t,
|
|
724
724
|
prompt: e.prompt || e.title
|
|
725
|
-
}),
|
|
726
|
-
}, [
|
|
725
|
+
}), N?.(e, t);
|
|
726
|
+
}, [he, N]), { attachedFiles: ve, fileInputRef: ye, onUploadFiles: be, acceptValue: xe, isAtMaxFiles: Se, maxFiles: Ce, processFiles: we, handleFileSelect: Te, handleRemoveFile: Ee, transientError: De, showTransientError: Oe } = In(h), ke = Mn({
|
|
727
727
|
searchPersons: C,
|
|
728
|
-
mentionSources:
|
|
728
|
+
mentionSources: w
|
|
729
729
|
});
|
|
730
730
|
W(() => {
|
|
731
|
-
|
|
731
|
+
F || typeof window < "u" && window.location.hash.length === 0 && B.current?.focus();
|
|
732
732
|
}, []), W(() => {
|
|
733
|
-
if (
|
|
734
|
-
else return
|
|
735
|
-
|
|
736
|
-
}), () =>
|
|
737
|
-
}, [
|
|
738
|
-
if (
|
|
739
|
-
|
|
733
|
+
if (fe) ge(null);
|
|
734
|
+
else return ge(() => {
|
|
735
|
+
B.current?.focus();
|
|
736
|
+
}), () => ge(null);
|
|
737
|
+
}, [fe, ge]), W(() => {
|
|
738
|
+
if (T) return T((e) => {
|
|
739
|
+
we(e);
|
|
740
740
|
}), () => {
|
|
741
|
-
|
|
741
|
+
T(null);
|
|
742
742
|
};
|
|
743
|
-
}, [
|
|
744
|
-
let
|
|
745
|
-
if (
|
|
743
|
+
}, [T, we]);
|
|
744
|
+
let Ae = U((e) => void we(e), [we]), je = ve.filter((e) => e.status === "uploaded"), Me = ve.some((e) => e.status === "uploading"), Ne = ve.some((e) => e.status === "error"), Pe = !ce.isEmpty || je.length > 0, Fe = async ({ text: t, mentions: n }) => {
|
|
745
|
+
if (Ne) return Oe(R.ai.fileUploadBlockedSubmit), !1;
|
|
746
746
|
if (a && await a() === !1) return !1;
|
|
747
|
-
let r =
|
|
748
|
-
o &&
|
|
747
|
+
let r = je, i = r.flatMap((e) => e.uploadedFile ? [e.uploadedFile] : []), o = u, s = f;
|
|
748
|
+
o && d?.(null), s && m?.(null);
|
|
749
749
|
try {
|
|
750
|
-
await
|
|
751
|
-
text:
|
|
750
|
+
await e({
|
|
751
|
+
text: rn(t, n),
|
|
752
752
|
files: i,
|
|
753
753
|
context: o,
|
|
754
754
|
quote: s
|
|
755
755
|
});
|
|
756
756
|
} catch {
|
|
757
|
-
return o && (
|
|
757
|
+
return o && (pe.current == null || pe.current === o) && d?.(o), s && (me.current == null || me.current === s) && m?.(s), !1;
|
|
758
758
|
}
|
|
759
|
-
for (let e of r)
|
|
759
|
+
for (let e of r) Ee(e.id);
|
|
760
760
|
return !0;
|
|
761
|
-
},
|
|
762
|
-
suggestions:
|
|
763
|
-
onItemClick:
|
|
764
|
-
onItemHover:
|
|
765
|
-
side:
|
|
766
|
-
reserveTwoRows: !
|
|
767
|
-
overflow:
|
|
768
|
-
}) : null,
|
|
769
|
-
|
|
770
|
-
|
|
761
|
+
}, Ie = ie ? ie.prompt ?? ie.title : null, Le = Ie ? [Ie] : o ?? [], Re = P === "inside", ze = A && M && M.length > 0 && N ? /* @__PURE__ */ Y(kn, {
|
|
762
|
+
suggestions: M,
|
|
763
|
+
onItemClick: _e,
|
|
764
|
+
onItemHover: ae,
|
|
765
|
+
side: Re ? "bottom" : "top",
|
|
766
|
+
reserveTwoRows: !Re,
|
|
767
|
+
overflow: Re ? "scroll" : "wrap"
|
|
768
|
+
}) : null, Be = !F || oe || Pe || ce.recorder !== "idle", Ve = (e) => e instanceof Node ? ue.current?.contains(e) ? !0 : e instanceof Element && e.closest("[data-radix-popper-content-wrapper]") !== null : !1, He = () => {
|
|
769
|
+
de.current && clearTimeout(de.current), de.current = setTimeout(() => {
|
|
770
|
+
Ve(document.activeElement) || se(!1);
|
|
771
771
|
}, 0);
|
|
772
|
-
},
|
|
772
|
+
}, Ue = Re, We = Ue && F, Ge = We && !Be, Ke = Ue && ze ? /* @__PURE__ */ Y("div", {
|
|
773
773
|
onClick: (e) => e.stopPropagation(),
|
|
774
|
-
children:
|
|
775
|
-
}) : void 0,
|
|
776
|
-
duration:
|
|
774
|
+
children: ze
|
|
775
|
+
}) : void 0, qe = {
|
|
776
|
+
duration: re ? 0 : .32,
|
|
777
777
|
ease: [
|
|
778
778
|
.4,
|
|
779
779
|
0,
|
|
780
780
|
.2,
|
|
781
781
|
1
|
|
782
782
|
]
|
|
783
|
-
},
|
|
784
|
-
return /* @__PURE__ */ X(
|
|
783
|
+
}, Je = A && j && !!I && I.length > 0, Ye = j && A, { motionProps: Xe } = lt(A, 160, .5);
|
|
784
|
+
return /* @__PURE__ */ X(s.div, {
|
|
785
785
|
ref: ne,
|
|
786
|
-
"data-composer-layout":
|
|
787
|
-
className: y("flex flex-col items-center gap-2",
|
|
788
|
-
...
|
|
786
|
+
"data-composer-layout": Ye ? "welcome" : "docked",
|
|
787
|
+
className: y("flex flex-col items-center gap-2", te === "default" && "px-4 pb-3 pt-2", Ye && "min-h-0 flex-1 justify-start -mt-20"),
|
|
788
|
+
...j ? Xe : {},
|
|
789
789
|
children: [
|
|
790
790
|
/* @__PURE__ */ X("div", {
|
|
791
791
|
className: "flex w-full max-w-content flex-col gap-2",
|
|
792
|
-
children: [
|
|
792
|
+
children: [ze && !Re ? /* @__PURE__ */ Y("div", { children: F ? /* @__PURE__ */ Y(n, {
|
|
793
793
|
initial: !1,
|
|
794
|
-
children:
|
|
794
|
+
children: Be ? /* @__PURE__ */ Y(s.div, {
|
|
795
795
|
className: "overflow-hidden",
|
|
796
796
|
initial: {
|
|
797
797
|
opacity: 0,
|
|
@@ -805,107 +805,107 @@ var Rn = ({ onSubmit: t, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
805
805
|
opacity: 0,
|
|
806
806
|
height: 0
|
|
807
807
|
},
|
|
808
|
-
transition:
|
|
809
|
-
children:
|
|
808
|
+
transition: qe,
|
|
809
|
+
children: ze
|
|
810
810
|
}, "welcome-suggestions") : null
|
|
811
|
-
}) :
|
|
811
|
+
}) : ze }) : null, /* @__PURE__ */ Y(yn, {
|
|
812
812
|
creditWarning: c,
|
|
813
|
-
children: /* @__PURE__ */ Y(
|
|
813
|
+
children: /* @__PURE__ */ Y(E, {
|
|
814
814
|
asForm: !0,
|
|
815
|
-
surfaceRef:
|
|
816
|
-
handleRef:
|
|
815
|
+
surfaceRef: ue,
|
|
816
|
+
handleRef: B,
|
|
817
817
|
className: "isolate z-20 items-stretch p-0 hover:cursor-text",
|
|
818
|
-
accent:
|
|
819
|
-
replacement:
|
|
820
|
-
onSurfaceFocus: () =>
|
|
821
|
-
onSurfaceBlur:
|
|
822
|
-
onStateChange:
|
|
823
|
-
onSend:
|
|
818
|
+
accent: fe,
|
|
819
|
+
replacement: fe ? l : null,
|
|
820
|
+
onSurfaceFocus: () => se(!0),
|
|
821
|
+
onSurfaceBlur: He,
|
|
822
|
+
onStateChange: le,
|
|
823
|
+
onSend: Fe,
|
|
824
824
|
inProgress: i,
|
|
825
825
|
onStop: r,
|
|
826
|
-
hasAttachments:
|
|
827
|
-
sendBlocked:
|
|
828
|
-
error:
|
|
826
|
+
hasAttachments: je.length > 0,
|
|
827
|
+
sendBlocked: Me,
|
|
828
|
+
error: De,
|
|
829
829
|
role: "textbox",
|
|
830
|
-
name:
|
|
831
|
-
placeholders:
|
|
830
|
+
name: L,
|
|
831
|
+
placeholders: Le,
|
|
832
832
|
placeholdersPaused: i,
|
|
833
833
|
labels: {
|
|
834
|
-
placeholder:
|
|
835
|
-
listening:
|
|
836
|
-
send:
|
|
837
|
-
stop:
|
|
838
|
-
recordAudio:
|
|
839
|
-
cancelRecording:
|
|
840
|
-
confirmRecording:
|
|
841
|
-
micPermissionDenied:
|
|
842
|
-
micError:
|
|
843
|
-
transcriptionError:
|
|
844
|
-
mentionSuggestions:
|
|
834
|
+
placeholder: R.ai.inputPlaceholder,
|
|
835
|
+
listening: R.ai.listening,
|
|
836
|
+
send: R.ai.sendMessage,
|
|
837
|
+
stop: R.ai.stopAnswerGeneration,
|
|
838
|
+
recordAudio: R.ai.recordAudio,
|
|
839
|
+
cancelRecording: R.ai.cancelRecording,
|
|
840
|
+
confirmRecording: R.ai.stopRecording,
|
|
841
|
+
micPermissionDenied: R.ai.micPermissionDenied,
|
|
842
|
+
micError: R.ai.micError,
|
|
843
|
+
transcriptionError: R.ai.transcriptionError,
|
|
844
|
+
mentionSuggestions: R.ai.mentions.suggestions
|
|
845
845
|
},
|
|
846
846
|
mentions: {
|
|
847
|
-
sources:
|
|
848
|
-
showGroupLabels:
|
|
847
|
+
sources: ke,
|
|
848
|
+
showGroupLabels: ke.length > 1
|
|
849
849
|
},
|
|
850
850
|
voice: S ? {
|
|
851
851
|
onTranscribe: S,
|
|
852
|
-
onPress:
|
|
853
|
-
onCancelled:
|
|
852
|
+
onPress: he?.onDictationStart,
|
|
853
|
+
onCancelled: he?.onDictationCancel
|
|
854
854
|
} : void 0,
|
|
855
|
-
onPasteFiles:
|
|
855
|
+
onPasteFiles: h?.onUploadFiles ? Ae : void 0,
|
|
856
856
|
pastePreferText: !0,
|
|
857
|
-
header:
|
|
858
|
-
quote:
|
|
859
|
-
onRemove: () =>
|
|
857
|
+
header: f ? /* @__PURE__ */ Y(bn, {
|
|
858
|
+
quote: f,
|
|
859
|
+
onRemove: () => m?.(null)
|
|
860
860
|
}) : null,
|
|
861
|
-
tray: /* @__PURE__ */ Y(
|
|
862
|
-
attachedFiles:
|
|
863
|
-
isUploading:
|
|
864
|
-
onRemove:
|
|
865
|
-
removeLabel:
|
|
866
|
-
reducedMotion:
|
|
861
|
+
tray: /* @__PURE__ */ Y(fn, {
|
|
862
|
+
attachedFiles: ve,
|
|
863
|
+
isUploading: Me,
|
|
864
|
+
onRemove: Ee,
|
|
865
|
+
removeLabel: R.ai.removeFile,
|
|
866
|
+
reducedMotion: re
|
|
867
867
|
}),
|
|
868
|
-
leading:
|
|
868
|
+
leading: Ue ? /* @__PURE__ */ Y("div", {
|
|
869
869
|
className: "flex shrink-0 self-center pl-3",
|
|
870
|
-
children: /* @__PURE__ */ Y(
|
|
870
|
+
children: /* @__PURE__ */ Y(ee, {
|
|
871
871
|
size: "sm",
|
|
872
872
|
spin: i
|
|
873
873
|
})
|
|
874
874
|
}) : void 0,
|
|
875
|
-
toolbarStart:
|
|
876
|
-
onUploadFiles:
|
|
875
|
+
toolbarStart: be || _ || b?.length ? (e) => /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(_n, {
|
|
876
|
+
onUploadFiles: be,
|
|
877
877
|
composerActions: b,
|
|
878
878
|
onComposerActionsOpenChange: x,
|
|
879
|
-
isAtMaxFiles:
|
|
880
|
-
maxFiles:
|
|
881
|
-
acceptValue:
|
|
882
|
-
fileInputRef:
|
|
883
|
-
handleFileSelect:
|
|
879
|
+
isAtMaxFiles: Se,
|
|
880
|
+
maxFiles: Ce,
|
|
881
|
+
acceptValue: xe,
|
|
882
|
+
fileInputRef: ye,
|
|
883
|
+
handleFileSelect: Te,
|
|
884
884
|
recordingStatus: e
|
|
885
885
|
}), _ ? /* @__PURE__ */ Y("div", {
|
|
886
886
|
className: "min-w-0 cursor-default",
|
|
887
887
|
onClick: (e) => e.stopPropagation(),
|
|
888
888
|
children: _
|
|
889
889
|
}) : null] }) : void 0,
|
|
890
|
-
toolbarCenter:
|
|
891
|
-
collapsible:
|
|
892
|
-
collapsed:
|
|
893
|
-
reducedMotion:
|
|
890
|
+
toolbarCenter: Ke,
|
|
891
|
+
collapsible: We,
|
|
892
|
+
collapsed: Ge,
|
|
893
|
+
reducedMotion: re
|
|
894
894
|
})
|
|
895
895
|
})]
|
|
896
896
|
}),
|
|
897
|
-
|
|
897
|
+
Je ? /* @__PURE__ */ Y("div", {
|
|
898
898
|
className: "w-full max-w-content pt-2",
|
|
899
|
-
children: /* @__PURE__ */ Y(
|
|
899
|
+
children: /* @__PURE__ */ Y(xn, { cards: I })
|
|
900
900
|
}) : null,
|
|
901
|
-
|
|
901
|
+
k && A && j ? /* @__PURE__ */ Y("div", {
|
|
902
902
|
className: "w-full py-4 mx-auto flex max-w-content justify-center",
|
|
903
|
-
children:
|
|
903
|
+
children: k
|
|
904
904
|
}) : null,
|
|
905
|
-
/* @__PURE__ */ Y(
|
|
905
|
+
/* @__PURE__ */ Y(n, {
|
|
906
906
|
mode: "wait",
|
|
907
907
|
initial: !1,
|
|
908
|
-
children:
|
|
908
|
+
children: fe ? /* @__PURE__ */ X(s.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 },
|
|
@@ -921,7 +921,7 @@ var Rn = ({ onSubmit: t, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
921
921
|
children: "↑↓"
|
|
922
922
|
}),
|
|
923
923
|
" ",
|
|
924
|
-
|
|
924
|
+
R.ai.clarifyingQuestion.navHint.navigate
|
|
925
925
|
] }),
|
|
926
926
|
/* @__PURE__ */ X("span", { children: [
|
|
927
927
|
/* @__PURE__ */ Y("kbd", {
|
|
@@ -929,7 +929,7 @@ var Rn = ({ onSubmit: t, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
929
929
|
children: "Enter"
|
|
930
930
|
}),
|
|
931
931
|
" ",
|
|
932
|
-
|
|
932
|
+
R.ai.clarifyingQuestion.navHint.select
|
|
933
933
|
] }),
|
|
934
934
|
/* @__PURE__ */ X("span", { children: [
|
|
935
935
|
/* @__PURE__ */ Y("kbd", {
|
|
@@ -937,16 +937,16 @@ var Rn = ({ onSubmit: t, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
937
937
|
children: "Esc"
|
|
938
938
|
}),
|
|
939
939
|
" ",
|
|
940
|
-
|
|
940
|
+
R.ai.clarifyingQuestion.navHint.cancel
|
|
941
941
|
] })
|
|
942
942
|
]
|
|
943
|
-
}, "clarifying-nav-hint") : (D?.text || O) && !
|
|
943
|
+
}, "clarifying-nav-hint") : (D?.text || O) && !Ye && /* @__PURE__ */ X(s.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 },
|
|
947
947
|
exit: { opacity: 0 },
|
|
948
948
|
transition: {
|
|
949
|
-
duration:
|
|
949
|
+
duration: z ? 0 : .3,
|
|
950
950
|
ease: "easeOut"
|
|
951
951
|
},
|
|
952
952
|
children: [/* @__PURE__ */ X("div", {
|
|
@@ -955,14 +955,14 @@ var Rn = ({ onSubmit: t, 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(v, {
|
|
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(v, {
|
|
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(g, {
|
|
966
966
|
href: D.link,
|
|
967
967
|
target: "_blank",
|
|
968
968
|
rel: "noopener noreferrer",
|
|
@@ -971,40 +971,40 @@ var Rn = ({ onSubmit: t, onStop: r, inProgress: i, onBeforeSubmit: a, placeholde
|
|
|
971
971
|
}) : null]
|
|
972
972
|
}), O ? /* @__PURE__ */ Y("div", {
|
|
973
973
|
className: "flex shrink-0 items-center",
|
|
974
|
-
children: /* @__PURE__ */ Y(
|
|
974
|
+
children: /* @__PURE__ */ Y(dn, { ...O })
|
|
975
975
|
}) : null]
|
|
976
976
|
}, "chat-disclaimer")
|
|
977
977
|
})
|
|
978
978
|
]
|
|
979
979
|
});
|
|
980
|
-
},
|
|
980
|
+
}, Rn = (e) => /* @__PURE__ */ Y(Ln, {
|
|
981
981
|
...e,
|
|
982
982
|
name: "one-ai-input"
|
|
983
983
|
});
|
|
984
984
|
//#endregion
|
|
985
985
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Block.tsx
|
|
986
|
-
function
|
|
986
|
+
function zn({ children: e, ...t }) {
|
|
987
987
|
return /* @__PURE__ */ Y("pre", {
|
|
988
988
|
...t,
|
|
989
989
|
className: y("relative mx-0 overflow-x-auto whitespace-pre-wrap rounded-md bg-f1-background-secondary p-2", t.className),
|
|
990
990
|
children: e
|
|
991
991
|
});
|
|
992
992
|
}
|
|
993
|
-
function
|
|
993
|
+
function Bn({ children: e, ...t }) {
|
|
994
994
|
return /* @__PURE__ */ Y("code", {
|
|
995
995
|
...t,
|
|
996
996
|
className: y("rounded bg-f1-background-secondary px-1 py-0.5 font-mono text-base text-f1-foreground", "[pre_&]:rounded-none [pre_&]:bg-transparent [pre_&]:p-0 [pre_&]:text-base", t.className),
|
|
997
997
|
children: e
|
|
998
998
|
});
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1000
|
+
function Vn({ children: e, ...t }) {
|
|
1001
1001
|
return /* @__PURE__ */ Y("blockquote", {
|
|
1002
1002
|
...t,
|
|
1003
1003
|
className: y("mr-1 my-2 mb-2.5 border-0 border-l-4 border-solid border-f1-border pl-3 text-base", t.className),
|
|
1004
1004
|
children: e
|
|
1005
1005
|
});
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1007
|
+
function Hn({ ...e }) {
|
|
1008
1008
|
return /* @__PURE__ */ Y("hr", {
|
|
1009
1009
|
...e,
|
|
1010
1010
|
className: y("my-3 border-0 border-t border-f1-border", e.className)
|
|
@@ -1012,13 +1012,13 @@ function Un({ ...e }) {
|
|
|
1012
1012
|
}
|
|
1013
1013
|
//#endregion
|
|
1014
1014
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Image.tsx
|
|
1015
|
-
function
|
|
1016
|
-
let r =
|
|
1015
|
+
function Un({ src: e, alt: t, ...n }) {
|
|
1016
|
+
let r = p(), i = ct(), a = Te(), s = ue(e || void 0), [c, l] = q(!1), [u, d] = q(!1), f = t || (e ? He(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
|
|
1020
1020
|
}) : null;
|
|
1021
|
-
let m = s.status === "ready" ? /* @__PURE__ */ Y(
|
|
1021
|
+
let m = s.status === "ready" ? /* @__PURE__ */ Y(Je, {
|
|
1022
1022
|
...n,
|
|
1023
1023
|
src: s.url,
|
|
1024
1024
|
alt: t,
|
|
@@ -1029,33 +1029,33 @@ 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 && d(t);
|
|
1033
1033
|
},
|
|
1034
|
-
children: [
|
|
1034
|
+
children: [i !== 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: f }),
|
|
1038
|
+
onClick: () => i.openImagePreview([{
|
|
1039
1039
|
url: e,
|
|
1040
|
-
name: t ||
|
|
1040
|
+
name: t || f
|
|
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(o, {
|
|
1046
1046
|
variant: "neutral",
|
|
1047
1047
|
label: r.chat.download,
|
|
1048
1048
|
hideLabel: !0,
|
|
1049
|
-
icon:
|
|
1050
|
-
onClick: () =>
|
|
1049
|
+
icon: B,
|
|
1050
|
+
onClick: () => a(e, f)
|
|
1051
1051
|
})
|
|
1052
1052
|
})]
|
|
1053
1053
|
});
|
|
1054
1054
|
}
|
|
1055
1055
|
//#endregion
|
|
1056
1056
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Link.tsx
|
|
1057
|
-
function
|
|
1058
|
-
return /* @__PURE__ */ Y(
|
|
1057
|
+
function Wn({ children: e, ...t }) {
|
|
1058
|
+
return /* @__PURE__ */ Y(M, {
|
|
1059
1059
|
...t,
|
|
1060
1060
|
variant: "link",
|
|
1061
1061
|
href: t.href,
|
|
@@ -1064,21 +1064,21 @@ function Gn({ children: e, ...t }) {
|
|
|
1064
1064
|
}
|
|
1065
1065
|
//#endregion
|
|
1066
1066
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Lists.tsx
|
|
1067
|
-
function
|
|
1067
|
+
function Gn({ children: e, ...t }) {
|
|
1068
1068
|
return /* @__PURE__ */ Y("ul", {
|
|
1069
1069
|
...t,
|
|
1070
1070
|
className: y("list-disc pl-5 [&>li>ol]:mt-2 [&>li>ul]:mt-2", t.className),
|
|
1071
1071
|
children: e
|
|
1072
1072
|
});
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1074
|
+
function Kn({ children: e, ...t }) {
|
|
1075
1075
|
return /* @__PURE__ */ Y("ol", {
|
|
1076
1076
|
...t,
|
|
1077
1077
|
className: y("list-decimal pl-5 [&>li>ol]:mt-2 [&>li>ul]:mt-2", t.className),
|
|
1078
1078
|
children: e
|
|
1079
1079
|
});
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1081
|
+
function qn({ children: e, ...t }) {
|
|
1082
1082
|
return /* @__PURE__ */ Y("li", {
|
|
1083
1083
|
...t,
|
|
1084
1084
|
className: y("mb-2", t.className),
|
|
@@ -1087,7 +1087,7 @@ function Jn({ children: e, ...t }) {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
//#endregion
|
|
1089
1089
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/components/EntityRefHoverCard.tsx
|
|
1090
|
-
function
|
|
1090
|
+
function Jn({ id: e, trigger: t, resolver: n, contentClassName: r = "w-64", ...i }) {
|
|
1091
1091
|
let a = K(/* @__PURE__ */ new Map()), [o, s] = q(() => a.current.get(e) ?? null), [c, l] = q(!1), [u, d] = q(!1), f = K(!0);
|
|
1092
1092
|
W(() => () => {
|
|
1093
1093
|
f.current = !1;
|
|
@@ -1108,37 +1108,37 @@ function Yn({ id: e, trigger: t, resolver: n, contentClassName: r = "w-64", ...i
|
|
|
1108
1108
|
o,
|
|
1109
1109
|
c
|
|
1110
1110
|
]), m = u ? null : o;
|
|
1111
|
-
return /* @__PURE__ */ X(
|
|
1111
|
+
return /* @__PURE__ */ X(Pt, {
|
|
1112
1112
|
openDelay: 300,
|
|
1113
1113
|
closeDelay: 100,
|
|
1114
1114
|
onOpenChange: (e) => {
|
|
1115
1115
|
e && p();
|
|
1116
1116
|
},
|
|
1117
|
-
children: [/* @__PURE__ */ Y(
|
|
1117
|
+
children: [/* @__PURE__ */ Y(At, {
|
|
1118
1118
|
asChild: !0,
|
|
1119
1119
|
children: t
|
|
1120
|
-
}), /* @__PURE__ */ Y(
|
|
1120
|
+
}), /* @__PURE__ */ Y(Nt, {
|
|
1121
1121
|
side: "top",
|
|
1122
1122
|
align: "start",
|
|
1123
1123
|
className: y(r, "rounded-2xl border-none p-0 shadow-md"),
|
|
1124
|
-
children: c ? /* @__PURE__ */ Y(
|
|
1124
|
+
children: c ? /* @__PURE__ */ Y(j.Skeleton, {}) : i.renderCard ? i.renderCard(m) : /* @__PURE__ */ Y(j, { ...m ? i.mapToCard(m) : i.fallbackCard })
|
|
1125
1125
|
})]
|
|
1126
1126
|
});
|
|
1127
1127
|
}
|
|
1128
1128
|
//#endregion
|
|
1129
1129
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/components/MentionTrigger.tsx
|
|
1130
|
-
var
|
|
1130
|
+
var Yn = H(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
1131
1131
|
ref: n,
|
|
1132
1132
|
type: "button",
|
|
1133
1133
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
1134
1134
|
...t,
|
|
1135
1135
|
children: ["@", e]
|
|
1136
1136
|
}));
|
|
1137
|
-
|
|
1137
|
+
Yn.displayName = "MentionTrigger";
|
|
1138
1138
|
//#endregion
|
|
1139
1139
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/custom/CustomEntityRef.tsx
|
|
1140
|
-
function
|
|
1141
|
-
let r =
|
|
1140
|
+
function Xn({ id: e, label: t, config: n }) {
|
|
1141
|
+
let r = p(), { 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: {
|
|
@@ -1150,9 +1150,9 @@ function Zn({ id: e, label: t, config: n }) {
|
|
|
1150
1150
|
s,
|
|
1151
1151
|
r
|
|
1152
1152
|
]), l = G(() => c({ title: t }), [c, t]), u = U((e) => i ? i(e) : Promise.resolve({ title: t }), [i, t]);
|
|
1153
|
-
return /* @__PURE__ */ Y(
|
|
1153
|
+
return /* @__PURE__ */ Y(Jn, {
|
|
1154
1154
|
id: e,
|
|
1155
|
-
trigger: /* @__PURE__ */ Y(
|
|
1155
|
+
trigger: /* @__PURE__ */ Y(Yn, { label: t }),
|
|
1156
1156
|
resolver: u,
|
|
1157
1157
|
mapToCard: c,
|
|
1158
1158
|
fallbackCard: l
|
|
@@ -1160,16 +1160,16 @@ function Zn({ id: e, label: t, config: n }) {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
//#endregion
|
|
1162
1162
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/candidate/CandidateEntityRef.tsx
|
|
1163
|
-
var
|
|
1163
|
+
var Zn = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1164
1164
|
ref: n,
|
|
1165
1165
|
type: "button",
|
|
1166
1166
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
1167
1167
|
...t,
|
|
1168
1168
|
children: e
|
|
1169
1169
|
}));
|
|
1170
|
-
|
|
1171
|
-
function
|
|
1172
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.candidate, i =
|
|
1170
|
+
Zn.displayName = "CandidateTrigger";
|
|
1171
|
+
function Qn({ id: e, label: t }) {
|
|
1172
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.candidate, i = p(), 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"),
|
|
@@ -1214,9 +1214,9 @@ function $n({ id: e, label: t }) {
|
|
|
1214
1214
|
i,
|
|
1215
1215
|
a
|
|
1216
1216
|
]);
|
|
1217
|
-
return r ? /* @__PURE__ */ Y(
|
|
1217
|
+
return r ? /* @__PURE__ */ Y(Jn, {
|
|
1218
1218
|
id: e,
|
|
1219
|
-
trigger: /* @__PURE__ */ Y(
|
|
1219
|
+
trigger: /* @__PURE__ */ Y(Zn, { label: t }),
|
|
1220
1220
|
resolver: r,
|
|
1221
1221
|
mapToCard: o,
|
|
1222
1222
|
fallbackCard: s
|
|
@@ -1224,19 +1224,19 @@ function $n({ id: e, label: t }) {
|
|
|
1224
1224
|
}
|
|
1225
1225
|
//#endregion
|
|
1226
1226
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/expense/ExpenseEntityRef.tsx
|
|
1227
|
-
var
|
|
1227
|
+
var $n = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1228
1228
|
ref: n,
|
|
1229
1229
|
type: "button",
|
|
1230
1230
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
1231
1231
|
...t,
|
|
1232
1232
|
children: e
|
|
1233
1233
|
}));
|
|
1234
|
-
|
|
1235
|
-
function
|
|
1236
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.expense, i =
|
|
1234
|
+
$n.displayName = "ExpenseTrigger";
|
|
1235
|
+
function er({ id: e, label: t }) {
|
|
1236
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.expense, i = p(), a = n?.urls?.expense?.(e), o = G(() => (e) => ({
|
|
1237
1237
|
avatar: {
|
|
1238
1238
|
type: "icon",
|
|
1239
|
-
icon:
|
|
1239
|
+
icon: D
|
|
1240
1240
|
},
|
|
1241
1241
|
title: e.description || `Expense #${e.id}`,
|
|
1242
1242
|
description: [e.amount, e.status].filter(Boolean).join(" · "),
|
|
@@ -1255,9 +1255,9 @@ function tr({ id: e, label: t }) {
|
|
|
1255
1255
|
i,
|
|
1256
1256
|
a
|
|
1257
1257
|
]);
|
|
1258
|
-
return r ? /* @__PURE__ */ Y(
|
|
1258
|
+
return r ? /* @__PURE__ */ Y(Jn, {
|
|
1259
1259
|
id: e,
|
|
1260
|
-
trigger: /* @__PURE__ */ Y(
|
|
1260
|
+
trigger: /* @__PURE__ */ Y($n, { label: t }),
|
|
1261
1261
|
resolver: r,
|
|
1262
1262
|
mapToCard: o,
|
|
1263
1263
|
fallbackCard: s
|
|
@@ -1265,16 +1265,16 @@ function tr({ id: e, label: t }) {
|
|
|
1265
1265
|
}
|
|
1266
1266
|
//#endregion
|
|
1267
1267
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/jobPosting/JobPostingEntityRef.tsx
|
|
1268
|
-
var
|
|
1268
|
+
var tr = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1269
1269
|
ref: n,
|
|
1270
1270
|
type: "button",
|
|
1271
1271
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
1272
1272
|
...t,
|
|
1273
1273
|
children: e
|
|
1274
1274
|
}));
|
|
1275
|
-
|
|
1276
|
-
function
|
|
1277
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.jobPosting, i =
|
|
1275
|
+
tr.displayName = "JobPostingTrigger";
|
|
1276
|
+
function nr({ id: e, label: t }) {
|
|
1277
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.jobPosting, i = p(), 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: {
|
|
@@ -1292,9 +1292,9 @@ function rr({ id: e, label: t }) {
|
|
|
1292
1292
|
i,
|
|
1293
1293
|
a
|
|
1294
1294
|
]);
|
|
1295
|
-
return r ? /* @__PURE__ */ Y(
|
|
1295
|
+
return r ? /* @__PURE__ */ Y(Jn, {
|
|
1296
1296
|
id: e,
|
|
1297
|
-
trigger: /* @__PURE__ */ Y(
|
|
1297
|
+
trigger: /* @__PURE__ */ Y(tr, { label: t }),
|
|
1298
1298
|
resolver: r,
|
|
1299
1299
|
mapToCard: o,
|
|
1300
1300
|
fallbackCard: s
|
|
@@ -1302,14 +1302,14 @@ function rr({ id: e, label: t }) {
|
|
|
1302
1302
|
}
|
|
1303
1303
|
//#endregion
|
|
1304
1304
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/person/PersonEntityRef.tsx
|
|
1305
|
-
function
|
|
1305
|
+
function rr({ id: e, label: t }) {
|
|
1306
1306
|
let { entityRefs: n } = V(), r = n?.resolvers?.person, i = n?.urls?.person?.(e);
|
|
1307
|
-
return r ? /* @__PURE__ */ Y(
|
|
1307
|
+
return r ? /* @__PURE__ */ Y(Jn, {
|
|
1308
1308
|
id: e,
|
|
1309
|
-
trigger: /* @__PURE__ */ Y(
|
|
1309
|
+
trigger: /* @__PURE__ */ Y(Yn, { label: t }),
|
|
1310
1310
|
resolver: r,
|
|
1311
1311
|
contentClassName: "w-72",
|
|
1312
|
-
renderCard: (e) => e ? /* @__PURE__ */ Y(
|
|
1312
|
+
renderCard: (e) => e ? /* @__PURE__ */ Y(we, {
|
|
1313
1313
|
name: `${e.firstName} ${e.lastName}`,
|
|
1314
1314
|
avatar: {
|
|
1315
1315
|
type: "person",
|
|
@@ -1320,7 +1320,7 @@ function ir({ id: e, label: t }) {
|
|
|
1320
1320
|
subtitle: e.jobTitle,
|
|
1321
1321
|
profileHref: i,
|
|
1322
1322
|
actions: e.actions
|
|
1323
|
-
}) : /* @__PURE__ */ Y(
|
|
1323
|
+
}) : /* @__PURE__ */ Y(we, {
|
|
1324
1324
|
name: t,
|
|
1325
1325
|
profileHref: i
|
|
1326
1326
|
})
|
|
@@ -1328,7 +1328,7 @@ function ir({ id: e, label: t }) {
|
|
|
1328
1328
|
}
|
|
1329
1329
|
//#endregion
|
|
1330
1330
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/components/EntityRefDetails.tsx
|
|
1331
|
-
function
|
|
1331
|
+
function ir({ rows: e }) {
|
|
1332
1332
|
return e.length === 0 ? null : /* @__PURE__ */ Y("div", {
|
|
1333
1333
|
className: "flex flex-col gap-2",
|
|
1334
1334
|
children: e.map((e, t) => /* @__PURE__ */ X("div", {
|
|
@@ -1345,22 +1345,22 @@ function ar({ rows: e }) {
|
|
|
1345
1345
|
}
|
|
1346
1346
|
//#endregion
|
|
1347
1347
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/requisition/RequisitionEntityRef.tsx
|
|
1348
|
-
var
|
|
1348
|
+
var ar = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1349
1349
|
ref: n,
|
|
1350
1350
|
type: "button",
|
|
1351
1351
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
1352
1352
|
...t,
|
|
1353
1353
|
children: e
|
|
1354
1354
|
}));
|
|
1355
|
-
|
|
1356
|
-
function
|
|
1357
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.requisition, i =
|
|
1355
|
+
ar.displayName = "RequisitionTrigger";
|
|
1356
|
+
function or({ id: e, label: t }) {
|
|
1357
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.requisition, i = p(), 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"),
|
|
1361
1361
|
value: /* @__PURE__ */ Y("div", {
|
|
1362
1362
|
className: "flex items-center pt-1",
|
|
1363
|
-
children: /* @__PURE__ */ Y(
|
|
1363
|
+
children: /* @__PURE__ */ Y(St, {
|
|
1364
1364
|
text: e.status,
|
|
1365
1365
|
variant: e.statusVariant ?? "neutral"
|
|
1366
1366
|
})
|
|
@@ -1370,7 +1370,7 @@ function sr({ id: e, label: t }) {
|
|
|
1370
1370
|
label: i.t("ai.entityRef.requisition.lineManager"),
|
|
1371
1371
|
value: /* @__PURE__ */ X("div", {
|
|
1372
1372
|
className: "flex items-center gap-1.5 pt-1",
|
|
1373
|
-
children: [/* @__PURE__ */ Y(
|
|
1373
|
+
children: [/* @__PURE__ */ Y(mt, {
|
|
1374
1374
|
firstName: e.lineManager.firstName,
|
|
1375
1375
|
lastName: e.lineManager.lastName,
|
|
1376
1376
|
src: e.lineManager.avatarUrl,
|
|
@@ -1386,7 +1386,7 @@ function sr({ id: e, label: t }) {
|
|
|
1386
1386
|
return {
|
|
1387
1387
|
title: e.title,
|
|
1388
1388
|
...e.location && { description: e.location },
|
|
1389
|
-
...n.length > 0 && { children: /* @__PURE__ */ Y(
|
|
1389
|
+
...n.length > 0 && { children: /* @__PURE__ */ Y(ir, { rows: n }) },
|
|
1390
1390
|
...a && { secondaryActions: {
|
|
1391
1391
|
label: i.t("ai.view"),
|
|
1392
1392
|
href: a
|
|
@@ -1403,9 +1403,9 @@ function sr({ id: e, label: t }) {
|
|
|
1403
1403
|
i,
|
|
1404
1404
|
a
|
|
1405
1405
|
]);
|
|
1406
|
-
return r ? /* @__PURE__ */ Y(
|
|
1406
|
+
return r ? /* @__PURE__ */ Y(Jn, {
|
|
1407
1407
|
id: e,
|
|
1408
|
-
trigger: /* @__PURE__ */ Y(
|
|
1408
|
+
trigger: /* @__PURE__ */ Y(ar, { label: t }),
|
|
1409
1409
|
resolver: r,
|
|
1410
1410
|
mapToCard: o,
|
|
1411
1411
|
fallbackCard: s
|
|
@@ -1413,16 +1413,16 @@ function sr({ id: e, label: t }) {
|
|
|
1413
1413
|
}
|
|
1414
1414
|
//#endregion
|
|
1415
1415
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/entities/vacancy/VacancyEntityRef.tsx
|
|
1416
|
-
var
|
|
1416
|
+
var sr = H(({ label: e, ...t }, n) => /* @__PURE__ */ Y("button", {
|
|
1417
1417
|
ref: n,
|
|
1418
1418
|
type: "button",
|
|
1419
1419
|
className: y("cursor-pointer font-medium text-f1-foreground-secondary hover:text-f1-foreground", b()),
|
|
1420
1420
|
...t,
|
|
1421
1421
|
children: e
|
|
1422
1422
|
}));
|
|
1423
|
-
|
|
1424
|
-
function
|
|
1425
|
-
let { entityRefs: n } = V(), r = n?.resolvers?.vacancy, i =
|
|
1423
|
+
sr.displayName = "VacancyTrigger";
|
|
1424
|
+
function cr({ id: e, label: t }) {
|
|
1425
|
+
let { entityRefs: n } = V(), r = n?.resolvers?.vacancy, i = p(), 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: {
|
|
@@ -1440,9 +1440,9 @@ function lr({ id: e, label: t }) {
|
|
|
1440
1440
|
i,
|
|
1441
1441
|
a
|
|
1442
1442
|
]);
|
|
1443
|
-
return r ? /* @__PURE__ */ Y(
|
|
1443
|
+
return r ? /* @__PURE__ */ Y(Jn, {
|
|
1444
1444
|
id: e,
|
|
1445
|
-
trigger: /* @__PURE__ */ Y(
|
|
1445
|
+
trigger: /* @__PURE__ */ Y(sr, { label: t }),
|
|
1446
1446
|
resolver: r,
|
|
1447
1447
|
mapToCard: o,
|
|
1448
1448
|
fallbackCard: s
|
|
@@ -1450,35 +1450,35 @@ function lr({ id: e, label: t }) {
|
|
|
1450
1450
|
}
|
|
1451
1451
|
//#endregion
|
|
1452
1452
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/components/entityRefRegistry.ts
|
|
1453
|
-
var
|
|
1454
|
-
["person",
|
|
1455
|
-
["candidate",
|
|
1456
|
-
["expense",
|
|
1457
|
-
["job-posting",
|
|
1458
|
-
["requisition",
|
|
1459
|
-
["vacancy",
|
|
1453
|
+
var lr = /* @__PURE__ */ new Map([
|
|
1454
|
+
["person", rr],
|
|
1455
|
+
["candidate", Qn],
|
|
1456
|
+
["expense", er],
|
|
1457
|
+
["job-posting", nr],
|
|
1458
|
+
["requisition", or],
|
|
1459
|
+
["vacancy", cr]
|
|
1460
1460
|
]);
|
|
1461
|
-
function
|
|
1462
|
-
return
|
|
1461
|
+
function ur(e) {
|
|
1462
|
+
return lr.get(e);
|
|
1463
1463
|
}
|
|
1464
|
-
function
|
|
1464
|
+
function dr(e, t) {
|
|
1465
1465
|
return e && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
|
|
1466
1466
|
}
|
|
1467
1467
|
//#endregion
|
|
1468
1468
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/entityRef/components/EntityRef.tsx
|
|
1469
|
-
function
|
|
1470
|
-
return typeof e == "string" ? e : typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(
|
|
1469
|
+
function fr(e) {
|
|
1470
|
+
return typeof e == "string" ? e : typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(fr).join("") : e && typeof e == "object" && "props" in e ? fr(e.props.children) : "";
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1472
|
+
function pr({ type: e, id: t, children: n }) {
|
|
1473
1473
|
let { entityRefs: r } = V();
|
|
1474
1474
|
if (!t || !e) return /* @__PURE__ */ Y("span", { children: n });
|
|
1475
|
-
let i =
|
|
1475
|
+
let i = fr(n), a = ur(e);
|
|
1476
1476
|
if (a) return /* @__PURE__ */ Y(a, {
|
|
1477
1477
|
id: t,
|
|
1478
1478
|
label: i
|
|
1479
1479
|
});
|
|
1480
|
-
let o =
|
|
1481
|
-
return o ? /* @__PURE__ */ Y(
|
|
1480
|
+
let o = dr(r?.custom, e);
|
|
1481
|
+
return o ? /* @__PURE__ */ Y(Xn, {
|
|
1482
1482
|
id: t,
|
|
1483
1483
|
label: i,
|
|
1484
1484
|
config: o
|
|
@@ -1486,60 +1486,60 @@ function mr({ type: e, id: t, children: n }) {
|
|
|
1486
1486
|
}
|
|
1487
1487
|
//#endregion
|
|
1488
1488
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Table.tsx
|
|
1489
|
-
async function
|
|
1490
|
-
let r =
|
|
1489
|
+
async function mr(e, t, n) {
|
|
1490
|
+
let r = O(e), i = t === "xlsx" ? await rt([{
|
|
1491
1491
|
name: "Data",
|
|
1492
1492
|
rows: r
|
|
1493
|
-
}]) : await
|
|
1494
|
-
|
|
1493
|
+
}]) : await it(r);
|
|
1494
|
+
ce(i, `${n}.${t}`);
|
|
1495
1495
|
}
|
|
1496
|
-
function
|
|
1497
|
-
let
|
|
1498
|
-
if (!
|
|
1496
|
+
function hr({ children: e, title: t, ...n }) {
|
|
1497
|
+
let r = p(), i = K(null), a = U((e) => {
|
|
1498
|
+
if (!i.current) return;
|
|
1499
1499
|
let n = t?.replace(/\s+/g, "_").toLowerCase() || "table";
|
|
1500
|
-
|
|
1500
|
+
mr(i.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(v, {
|
|
1507
1507
|
tag: "h2",
|
|
1508
1508
|
className: "text-base font-medium capitalize text-f1-foreground",
|
|
1509
|
-
children: t ??
|
|
1510
|
-
}), /* @__PURE__ */ Y(
|
|
1511
|
-
icon:
|
|
1509
|
+
children: t ?? r.ai.reportCard.tableLabel
|
|
1510
|
+
}), /* @__PURE__ */ Y(be, {
|
|
1511
|
+
icon: B,
|
|
1512
1512
|
size: "md",
|
|
1513
1513
|
items: [{
|
|
1514
|
-
label:
|
|
1515
|
-
icon:
|
|
1516
|
-
onClick: () =>
|
|
1514
|
+
label: r.t("ai.dataDownload.download", { format: "Excel" }),
|
|
1515
|
+
icon: B,
|
|
1516
|
+
onClick: () => a("xlsx")
|
|
1517
1517
|
}, {
|
|
1518
|
-
label:
|
|
1519
|
-
icon:
|
|
1520
|
-
onClick: () =>
|
|
1518
|
+
label: r.t("ai.dataDownload.download", { format: "CSV" }),
|
|
1519
|
+
icon: B,
|
|
1520
|
+
onClick: () => a("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: i,
|
|
1527
|
+
...n,
|
|
1528
|
+
className: y("w-full border-separate border-spacing-0 [&_tbody_tr:last-child_td]:border-b-0", n.className),
|
|
1529
1529
|
children: e
|
|
1530
1530
|
})
|
|
1531
1531
|
})]
|
|
1532
1532
|
});
|
|
1533
1533
|
}
|
|
1534
|
-
function
|
|
1534
|
+
function gr({ children: e, ...t }) {
|
|
1535
1535
|
return /* @__PURE__ */ Y("th", {
|
|
1536
1536
|
...t,
|
|
1537
1537
|
className: y("sticky top-0 z-10 whitespace-nowrap border-0 border-b border-solid border-f1-border-secondary bg-f1-background px-3 py-2 text-left font-medium text-f1-foreground-secondary", t.className),
|
|
1538
1538
|
children: e
|
|
1539
1539
|
});
|
|
1540
1540
|
}
|
|
1541
|
-
function
|
|
1542
|
-
let r = t ?
|
|
1541
|
+
function _r({ children: e, ellipsis: t = !1, ...n }) {
|
|
1542
|
+
let r = t ? fr(e) : void 0;
|
|
1543
1543
|
return /* @__PURE__ */ Y("td", {
|
|
1544
1544
|
title: r || void 0,
|
|
1545
1545
|
...n,
|
|
@@ -1549,42 +1549,42 @@ function vr({ children: e, ellipsis: t = !1, ...n }) {
|
|
|
1549
1549
|
}
|
|
1550
1550
|
//#endregion
|
|
1551
1551
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/components/Typography.tsx
|
|
1552
|
-
function
|
|
1552
|
+
function vr({ children: e, ...t }) {
|
|
1553
1553
|
return /* @__PURE__ */ Y("p", {
|
|
1554
1554
|
...t,
|
|
1555
1555
|
className: y("text-base font-normal", t.className),
|
|
1556
1556
|
children: e
|
|
1557
1557
|
});
|
|
1558
1558
|
}
|
|
1559
|
-
function
|
|
1559
|
+
function yr({ children: e, ...t }) {
|
|
1560
1560
|
return /* @__PURE__ */ Y("h1", {
|
|
1561
1561
|
...t,
|
|
1562
1562
|
className: y("mb-2.5 mt-4 text-2xl font-medium first:mt-0 last:mb-0", t.className),
|
|
1563
1563
|
children: e
|
|
1564
1564
|
});
|
|
1565
1565
|
}
|
|
1566
|
-
function
|
|
1566
|
+
function br({ children: e, ...t }) {
|
|
1567
1567
|
return /* @__PURE__ */ Y("h2", {
|
|
1568
1568
|
...t,
|
|
1569
1569
|
className: y("mb-2.5 mt-4 text-lg font-medium leading-6 first:mt-0 last:mb-0", t.className),
|
|
1570
1570
|
children: e
|
|
1571
1571
|
});
|
|
1572
1572
|
}
|
|
1573
|
-
function
|
|
1573
|
+
function xr({ children: e, ...t }) {
|
|
1574
1574
|
return /* @__PURE__ */ Y("h3", {
|
|
1575
1575
|
...t,
|
|
1576
1576
|
className: y("mb-2 mt-3.5 text-base font-semibold first:mt-0 last:mb-0", t.className),
|
|
1577
1577
|
children: e
|
|
1578
1578
|
});
|
|
1579
1579
|
}
|
|
1580
|
-
function
|
|
1580
|
+
function Sr({ children: e, ...t }) {
|
|
1581
1581
|
return /* @__PURE__ */ Y("strong", {
|
|
1582
1582
|
...t,
|
|
1583
1583
|
className: y("font-semibold", t.className),
|
|
1584
1584
|
children: e
|
|
1585
1585
|
});
|
|
1586
1586
|
}
|
|
1587
|
-
function
|
|
1587
|
+
function Cr({ children: e, ...t }) {
|
|
1588
1588
|
return /* @__PURE__ */ Y("em", {
|
|
1589
1589
|
...t,
|
|
1590
1590
|
className: y("italic", t.className),
|
|
@@ -1593,92 +1593,92 @@ function wr({ children: e, ...t }) {
|
|
|
1593
1593
|
}
|
|
1594
1594
|
//#endregion
|
|
1595
1595
|
//#region src/addons/ai/ai/F0AiChat/components/markdownRenderers/MarkdownRenderers.tsx
|
|
1596
|
-
var
|
|
1597
|
-
p:
|
|
1598
|
-
h1:
|
|
1599
|
-
h2:
|
|
1600
|
-
h3:
|
|
1601
|
-
a:
|
|
1602
|
-
strong:
|
|
1603
|
-
em:
|
|
1604
|
-
li:
|
|
1605
|
-
pre:
|
|
1606
|
-
code:
|
|
1607
|
-
blockquote:
|
|
1608
|
-
hr:
|
|
1609
|
-
ul:
|
|
1610
|
-
ol:
|
|
1611
|
-
table:
|
|
1612
|
-
th:
|
|
1613
|
-
td:
|
|
1614
|
-
img:
|
|
1615
|
-
"entity-ref":
|
|
1616
|
-
},
|
|
1596
|
+
var wr = {
|
|
1597
|
+
p: vr,
|
|
1598
|
+
h1: yr,
|
|
1599
|
+
h2: br,
|
|
1600
|
+
h3: xr,
|
|
1601
|
+
a: Wn,
|
|
1602
|
+
strong: Sr,
|
|
1603
|
+
em: Cr,
|
|
1604
|
+
li: qn,
|
|
1605
|
+
pre: zn,
|
|
1606
|
+
code: Bn,
|
|
1607
|
+
blockquote: Vn,
|
|
1608
|
+
hr: Hn,
|
|
1609
|
+
ul: Gn,
|
|
1610
|
+
ol: Kn,
|
|
1611
|
+
table: hr,
|
|
1612
|
+
th: gr,
|
|
1613
|
+
td: _r,
|
|
1614
|
+
img: Un,
|
|
1615
|
+
"entity-ref": pr
|
|
1616
|
+
}, Tr = (e) => typeof e == "object" && !!e, Z = (e) => typeof e == "string" && e.length > 0 ? e : void 0, Er = (e, t) => {
|
|
1617
1617
|
if (e && e.trim() && e !== "file") return e;
|
|
1618
1618
|
if (t.startsWith("data:")) {
|
|
1619
1619
|
let [e, n] = (t.slice(5).split(/[;,]/, 1)[0] ?? "").split("/"), r = e === "image" ? "image" : "file", i = n?.split("+")[0];
|
|
1620
1620
|
return i ? `${r}.${i}` : r;
|
|
1621
1621
|
}
|
|
1622
1622
|
let n = t.split("?")[1], r = n ? new URLSearchParams(n.split("#")[0]).get("path") : null;
|
|
1623
|
-
return
|
|
1624
|
-
},
|
|
1625
|
-
let n = Z(e.data), r = Z(e.url) ?? (n ?
|
|
1623
|
+
return He(r ?? t) || e || "file";
|
|
1624
|
+
}, Dr = (e, t) => e.startsWith("data:") ? e : `data:${t ?? "application/octet-stream"};base64,${e}`, Or = (e, t) => {
|
|
1625
|
+
let n = Z(e.data), r = Z(e.url) ?? (n ? Dr(n, t) : void 0);
|
|
1626
1626
|
return r ? {
|
|
1627
1627
|
url: r,
|
|
1628
|
-
name:
|
|
1628
|
+
name: Er(Z(e.filename), r),
|
|
1629
1629
|
mimeType: t
|
|
1630
1630
|
} : null;
|
|
1631
|
-
},
|
|
1632
|
-
if (!
|
|
1633
|
-
if (e.type === "binary") return
|
|
1631
|
+
}, kr = (e) => {
|
|
1632
|
+
if (!Tr(e)) return null;
|
|
1633
|
+
if (e.type === "binary") return Or(e, Z(e.mimeType));
|
|
1634
1634
|
if (e.type !== "file") return null;
|
|
1635
|
-
if (!
|
|
1635
|
+
if (!Tr(e.file)) return Or(e, Z(e.mediaType) ?? Z(e.mimeType));
|
|
1636
1636
|
let t = Z(e.file.url);
|
|
1637
1637
|
return t ? {
|
|
1638
1638
|
url: t,
|
|
1639
|
-
name:
|
|
1639
|
+
name: Er(Z(e.file.filename), t),
|
|
1640
1640
|
mimeType: Z(e.file.mimetype) ?? Z(e.file.mimeType)
|
|
1641
1641
|
} : null;
|
|
1642
|
-
},
|
|
1642
|
+
}, Ar = (e) => ({
|
|
1643
1643
|
url: e.url,
|
|
1644
|
-
name:
|
|
1644
|
+
name: Er(e.filename, e.url),
|
|
1645
1645
|
mimeType: e.mimetype
|
|
1646
|
-
}),
|
|
1646
|
+
}), jr = (e) => {
|
|
1647
1647
|
let t = /* @__PURE__ */ new Set();
|
|
1648
1648
|
return e.filter((e) => !t.has(e.url) && (t.add(e.url), !0));
|
|
1649
|
-
},
|
|
1650
|
-
let t = Array.isArray(e.content) ? e.content.map(
|
|
1651
|
-
if (t.length > 0) return
|
|
1652
|
-
let n =
|
|
1653
|
-
return Array.isArray(n) ?
|
|
1654
|
-
},
|
|
1649
|
+
}, Mr = (e) => {
|
|
1650
|
+
let t = Array.isArray(e.content) ? e.content.map(kr).filter((e) => e !== null) : [];
|
|
1651
|
+
if (t.length > 0) return jr(t);
|
|
1652
|
+
let n = Tr(e.rawData) ? e.rawData.uploadedFiles : void 0;
|
|
1653
|
+
return Array.isArray(n) ? jr(n.filter((e) => Tr(e) && typeof e.url == "string").map(Ar)) : [];
|
|
1654
|
+
}, Nr = (e, t = "assistant") => {
|
|
1655
1655
|
if (typeof e == "string") return e;
|
|
1656
1656
|
if (!Array.isArray(e)) return;
|
|
1657
|
-
let n = e.filter((e) =>
|
|
1657
|
+
let n = e.filter((e) => Tr(e) && e.type === "text" && typeof e.text == "string").map((e) => e.text);
|
|
1658
1658
|
if (n.length !== 0) return t === "user" ? n[n.length - 1] : n.join("\n\n");
|
|
1659
|
-
},
|
|
1659
|
+
}, Pr = (e, { urlFor: t } = {}) => ({
|
|
1660
1660
|
url: e.url ?? t?.(e.path) ?? e.path,
|
|
1661
|
-
name: e.displayName ||
|
|
1661
|
+
name: e.displayName || He(e.path),
|
|
1662
1662
|
mimeType: e.mimeType,
|
|
1663
1663
|
size: e.bytes,
|
|
1664
1664
|
previewUrl: e.preview && t ? t(e.preview.path) : void 0
|
|
1665
|
-
}),
|
|
1665
|
+
}), Fr = (e) => Ce(e) ?? "", Ir = ({ avatar: e }) => e?.type === "module" ? /* @__PURE__ */ Y(pt, {
|
|
1666
1666
|
module: e.module,
|
|
1667
1667
|
size: "md"
|
|
1668
|
-
}) : e?.type === "file" ? /* @__PURE__ */ Y(
|
|
1668
|
+
}) : e?.type === "file" ? /* @__PURE__ */ Y(ft, {
|
|
1669
1669
|
file: e.file,
|
|
1670
1670
|
size: "lg"
|
|
1671
|
-
}) : e?.type === "icon" ? /* @__PURE__ */ Y(
|
|
1671
|
+
}) : e?.type === "icon" ? /* @__PURE__ */ Y(dt, {
|
|
1672
1672
|
icon: e.icon,
|
|
1673
1673
|
size: "md"
|
|
1674
|
-
}) : null,
|
|
1675
|
-
let n =
|
|
1676
|
-
return e.type === "open" && e.showButton !== !1 ? /* @__PURE__ */ Y(
|
|
1674
|
+
}) : null, Lr = ({ action: e, isActive: t }) => {
|
|
1675
|
+
let n = p();
|
|
1676
|
+
return e.type === "open" && e.showButton !== !1 ? /* @__PURE__ */ Y(o, {
|
|
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(o, {
|
|
1682
1682
|
variant: "outline",
|
|
1683
1683
|
size: "md",
|
|
1684
1684
|
icon: e.icon,
|
|
@@ -1687,38 +1687,38 @@ var Tr = {
|
|
|
1687
1687
|
onClick: e.onClick
|
|
1688
1688
|
}) : null;
|
|
1689
1689
|
};
|
|
1690
|
-
function
|
|
1691
|
-
let
|
|
1690
|
+
function Rr({ avatar: e, title: t, description: n, isActive: r = !1, action: i, children: a }) {
|
|
1691
|
+
let o = i.type === "open", s = o ? r ? i.onClose : i.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", o && "cursor-pointer", r ? "border-f1-border-hover" : "border-f1-border-secondary"),
|
|
1694
|
+
onClick: s,
|
|
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
|
-
/* @__PURE__ */ Y(
|
|
1698
|
+
/* @__PURE__ */ Y(Ir, { 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(v, {
|
|
1702
1702
|
className: "text-lg font-semibold text-f1-foreground",
|
|
1703
1703
|
children: t
|
|
1704
|
-
}),
|
|
1704
|
+
}), n ? /* @__PURE__ */ Y(v, {
|
|
1705
1705
|
className: "text-base text-f1-foreground-secondary",
|
|
1706
|
-
children:
|
|
1706
|
+
children: n
|
|
1707
1707
|
}) : null]
|
|
1708
1708
|
}),
|
|
1709
|
-
/* @__PURE__ */ Y(
|
|
1710
|
-
action:
|
|
1711
|
-
isActive:
|
|
1709
|
+
/* @__PURE__ */ Y(Lr, {
|
|
1710
|
+
action: i,
|
|
1711
|
+
isActive: r
|
|
1712
1712
|
})
|
|
1713
1713
|
]
|
|
1714
|
-
}),
|
|
1714
|
+
}), a]
|
|
1715
1715
|
});
|
|
1716
1716
|
}
|
|
1717
|
-
|
|
1717
|
+
Rr.displayName = "F0CanvasCard";
|
|
1718
1718
|
//#endregion
|
|
1719
1719
|
//#region src/addons/ai/ai/F0AiChat/providers/FormCardValueFormatterProvider.tsx
|
|
1720
|
-
var
|
|
1721
|
-
function
|
|
1720
|
+
var zr = Bt(null);
|
|
1721
|
+
function Br({ children: e }) {
|
|
1722
1722
|
let [t, n] = q(0), r = K([]), i = U((e) => {
|
|
1723
1723
|
let t = r.current, i = t.findIndex((t) => t.formName === e.formName && t.customFieldName === e.customFieldName), a = e;
|
|
1724
1724
|
i >= 0 ? t[i] = a : t.push(a), n((e) => e + 1);
|
|
@@ -1726,13 +1726,13 @@ function Vr({ children: e }) {
|
|
|
1726
1726
|
formatters: [...r.current],
|
|
1727
1727
|
setFormCardValueFormatter: i
|
|
1728
1728
|
}), [i, t]);
|
|
1729
|
-
return /* @__PURE__ */ Y(
|
|
1729
|
+
return /* @__PURE__ */ Y(zr.Provider, {
|
|
1730
1730
|
value: a,
|
|
1731
1731
|
children: e
|
|
1732
1732
|
});
|
|
1733
1733
|
}
|
|
1734
|
-
function
|
|
1735
|
-
let t =
|
|
1734
|
+
function Vr(e) {
|
|
1735
|
+
let t = Ut(zr)?.formatters;
|
|
1736
1736
|
return G(() => !t || t.length === 0 ? null : (n, r, i) => {
|
|
1737
1737
|
let a, o = -1;
|
|
1738
1738
|
for (let n of t) {
|
|
@@ -1747,57 +1747,57 @@ function Hr(e) {
|
|
|
1747
1747
|
});
|
|
1748
1748
|
}, [t, e]);
|
|
1749
1749
|
}
|
|
1750
|
-
function
|
|
1751
|
-
let e =
|
|
1750
|
+
function Hr() {
|
|
1751
|
+
let e = Ut(zr);
|
|
1752
1752
|
if (!e) throw Error("useSetFormCardValueFormatter must be used within a FormCardValueFormatterProvider");
|
|
1753
1753
|
return e.setFormCardValueFormatter;
|
|
1754
1754
|
}
|
|
1755
1755
|
//#endregion
|
|
1756
1756
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/FormCard.tsx
|
|
1757
|
-
var
|
|
1758
|
-
function
|
|
1757
|
+
var Ur = 7, Wr = 625, Gr = /* @__PURE__ */ new Set();
|
|
1758
|
+
function Kr(e) {
|
|
1759
1759
|
return typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "text/html").body.textContent?.replace(/\s+/g, " ").trim() ?? "" : e.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
|
1760
1760
|
}
|
|
1761
|
-
function
|
|
1761
|
+
function qr(e) {
|
|
1762
1762
|
return e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
1763
1763
|
}
|
|
1764
|
-
function
|
|
1765
|
-
let { days: t, hours: n, minutes: r, seconds: i } =
|
|
1764
|
+
function Jr(e) {
|
|
1765
|
+
let { days: t, hours: n, minutes: r, seconds: i } = C(e), a = [];
|
|
1766
1766
|
return t > 0 && a.push(`${t}d`), n > 0 && a.push(`${n}h`), r > 0 && a.push(`${r}m`), (i > 0 || a.length === 0) && a.push(`${i}s`), a.join(" ");
|
|
1767
1767
|
}
|
|
1768
|
-
function
|
|
1768
|
+
function Yr(e) {
|
|
1769
1769
|
if (e instanceof Date) return !0;
|
|
1770
1770
|
if (typeof e != "string") return !1;
|
|
1771
1771
|
let t = new Date(e);
|
|
1772
1772
|
return !Number.isNaN(t.getTime());
|
|
1773
1773
|
}
|
|
1774
|
-
function
|
|
1774
|
+
function Xr(e) {
|
|
1775
1775
|
return (e instanceof Date ? e : new Date(e)).toLocaleDateString();
|
|
1776
1776
|
}
|
|
1777
|
-
function
|
|
1777
|
+
function Zr(e) {
|
|
1778
1778
|
return e.type === "item" ? e.text : "";
|
|
1779
1779
|
}
|
|
1780
|
-
function
|
|
1780
|
+
function Qr(e, t) {
|
|
1781
1781
|
if (e == null || e === "") return {
|
|
1782
1782
|
type: "item",
|
|
1783
1783
|
text: "—"
|
|
1784
1784
|
};
|
|
1785
1785
|
if (t === "duration" && typeof e == "number") return {
|
|
1786
1786
|
type: "item",
|
|
1787
|
-
text:
|
|
1787
|
+
text: Jr(e)
|
|
1788
1788
|
};
|
|
1789
1789
|
if (t === "richtext" && typeof e == "object" && e && "value" in e) {
|
|
1790
1790
|
let t = e.value;
|
|
1791
1791
|
return {
|
|
1792
1792
|
type: "item",
|
|
1793
|
-
text: (t ?
|
|
1793
|
+
text: (t ? Kr(t) : "") || "—"
|
|
1794
1794
|
};
|
|
1795
1795
|
}
|
|
1796
1796
|
if (t === "daterange" && typeof e == "object" && e && "from" in e && "to" in e) {
|
|
1797
1797
|
let { from: t, to: n } = e;
|
|
1798
1798
|
return {
|
|
1799
1799
|
type: "item",
|
|
1800
|
-
text: `${
|
|
1800
|
+
text: `${Yr(t) ? Xr(t) : String(t)} – ${Yr(n) ? Xr(n) : String(n)}`
|
|
1801
1801
|
};
|
|
1802
1802
|
}
|
|
1803
1803
|
if (e instanceof Date) return {
|
|
@@ -1811,8 +1811,8 @@ function $r(e, t) {
|
|
|
1811
1811
|
if (Array.isArray(e)) return {
|
|
1812
1812
|
type: "item",
|
|
1813
1813
|
text: e.map((e) => {
|
|
1814
|
-
let t =
|
|
1815
|
-
return Array.isArray(t) ? t.map(
|
|
1814
|
+
let t = Qr(e);
|
|
1815
|
+
return Array.isArray(t) ? t.map(Zr).join(", ") : Zr(t);
|
|
1816
1816
|
}).filter(Boolean).join(", ") || "—"
|
|
1817
1817
|
};
|
|
1818
1818
|
if (typeof e == "object" && e) {
|
|
@@ -1833,11 +1833,11 @@ function $r(e, t) {
|
|
|
1833
1833
|
}
|
|
1834
1834
|
return {
|
|
1835
1835
|
type: "item",
|
|
1836
|
-
text:
|
|
1836
|
+
text: qr(String(e))
|
|
1837
1837
|
};
|
|
1838
1838
|
}
|
|
1839
|
-
function
|
|
1840
|
-
let { canvasContent: c, openCanvas: l, closeCanvas: u } = V(), d =
|
|
1839
|
+
function $r({ formName: e, formDescription: t, module: n, cardTitle: r, cardDescription: i, fieldDescriptions: a, formValues: o, valueFormatter: s }) {
|
|
1840
|
+
let { canvasContent: c, openCanvas: l, closeCanvas: u } = V(), d = Vr(e), f = s ?? d, p = K(() => {}), m = r ?? e, h = i ?? t ?? "", g = c?.type === "form" && c.formName === e, _ = () => l({
|
|
1841
1841
|
type: "form",
|
|
1842
1842
|
title: m,
|
|
1843
1843
|
description: h,
|
|
@@ -1846,7 +1846,7 @@ function ei({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
|
|
|
1846
1846
|
formModule: n
|
|
1847
1847
|
});
|
|
1848
1848
|
p.current = _, W(() => {
|
|
1849
|
-
typeof window < "u" && (window.innerWidth <
|
|
1849
|
+
typeof window < "u" && (window.innerWidth < Wr || Gr.has(e) || (Gr.add(e), p.current()));
|
|
1850
1850
|
}, [e]);
|
|
1851
1851
|
let v = a && o ? Object.entries(a).map(([e, t]) => {
|
|
1852
1852
|
let n = o[e], r = f?.(e, n, {
|
|
@@ -1854,7 +1854,7 @@ function ei({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
|
|
|
1854
1854
|
customFieldName: t.customFieldName
|
|
1855
1855
|
});
|
|
1856
1856
|
if (!r && t.fieldType === "custom" && typeof n == "object" && n) return null;
|
|
1857
|
-
let i = r ??
|
|
1857
|
+
let i = r ?? Qr(n, t.fieldType);
|
|
1858
1858
|
return {
|
|
1859
1859
|
label: t.label,
|
|
1860
1860
|
content: i,
|
|
@@ -1864,8 +1864,8 @@ function ei({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
|
|
|
1864
1864
|
if (!e) return !1;
|
|
1865
1865
|
let t = Array.isArray(e.content) ? e.content[0] : e.content;
|
|
1866
1866
|
return t?.type !== "item" || t.text !== "—";
|
|
1867
|
-
}) : [], y = v.slice(0,
|
|
1868
|
-
return /* @__PURE__ */ Y(
|
|
1867
|
+
}) : [], y = v.slice(0, Ur), b = v.length > Ur;
|
|
1868
|
+
return /* @__PURE__ */ Y(Rr, {
|
|
1869
1869
|
avatar: n ? {
|
|
1870
1870
|
type: "module",
|
|
1871
1871
|
module: n
|
|
@@ -1881,7 +1881,7 @@ function ei({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
|
|
|
1881
1881
|
},
|
|
1882
1882
|
children: y.length > 0 && !g ? /* @__PURE__ */ Y("div", {
|
|
1883
1883
|
className: "-mx-3 flex w-full flex-col overflow-hidden pb-1",
|
|
1884
|
-
children: /* @__PURE__ */ Y(
|
|
1884
|
+
children: /* @__PURE__ */ Y(Pe, {
|
|
1885
1885
|
details: y.map((e) => ({
|
|
1886
1886
|
title: e.label,
|
|
1887
1887
|
content: e.content,
|
|
@@ -1894,16 +1894,16 @@ function ei({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
|
|
|
1894
1894
|
}) : null
|
|
1895
1895
|
});
|
|
1896
1896
|
}
|
|
1897
|
-
|
|
1897
|
+
$r.displayName = "FormCard";
|
|
1898
1898
|
//#endregion
|
|
1899
1899
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/ActiveFormCard.tsx
|
|
1900
|
-
function
|
|
1901
|
-
let e =
|
|
1900
|
+
function ei() {
|
|
1901
|
+
let e = te(), t = e?.activeForm;
|
|
1902
1902
|
if (!t) return null;
|
|
1903
1903
|
let n = t.cardTitle, r = t.cardDescription, i = (e?.getFillVersion(t.formName) ?? 0) > 0;
|
|
1904
1904
|
return !n || !r || !i ? null : /* @__PURE__ */ Y("div", {
|
|
1905
1905
|
className: "mt-2 w-full",
|
|
1906
|
-
children: /* @__PURE__ */ Y(
|
|
1906
|
+
children: /* @__PURE__ */ Y($r, {
|
|
1907
1907
|
formName: t.formName,
|
|
1908
1908
|
formDescription: t.description,
|
|
1909
1909
|
module: t.module,
|
|
@@ -1916,11 +1916,11 @@ function ti() {
|
|
|
1916
1916
|
}
|
|
1917
1917
|
//#endregion
|
|
1918
1918
|
//#region src/addons/ai/ai/F0AiFileAttachments/F0AiFileAttachments.tsx
|
|
1919
|
-
var
|
|
1920
|
-
let { provided: t } =
|
|
1921
|
-
return t ? /* @__PURE__ */ Y(
|
|
1922
|
-
},
|
|
1923
|
-
let { remotePreviews: a } =
|
|
1919
|
+
var ti = "rounded-xl", ni = "ai-chat", ri = (e) => {
|
|
1920
|
+
let { provided: t } = $e();
|
|
1921
|
+
return t ? /* @__PURE__ */ Y(ii, { ...e }) : /* @__PURE__ */ Y(je, { children: /* @__PURE__ */ Y(ii, { ...e }) });
|
|
1922
|
+
}, ii = ({ files: e, align: t = "start", onOpenFile: n, onFileDownloaded: r, size: i = "default" }) => {
|
|
1923
|
+
let { remotePreviews: a } = $e(), { openImagePreview: o } = nt(), [s, c] = q(() => /* @__PURE__ */ new Set()), l = G(() => ai(e, a, s), [
|
|
1924
1924
|
e,
|
|
1925
1925
|
a,
|
|
1926
1926
|
s
|
|
@@ -1933,13 +1933,13 @@ var ni = "rounded-xl", ri = "ai-chat", ii = (e) => {
|
|
|
1933
1933
|
onOpenFile: n,
|
|
1934
1934
|
onFileDownloaded: r,
|
|
1935
1935
|
openImage: (e, t) => {
|
|
1936
|
-
n?.(e, "image") !== !1 && o(l.images.map(
|
|
1936
|
+
n?.(e, "image") !== !1 && o(l.images.map(ze), t);
|
|
1937
1937
|
},
|
|
1938
1938
|
onImageError: (e) => c((t) => new Set(t).add(e.url))
|
|
1939
1939
|
};
|
|
1940
|
-
return Y(i === "compact" ?
|
|
1941
|
-
},
|
|
1942
|
-
let r = (e) => t ||
|
|
1940
|
+
return Y(i === "compact" ? ci : si, { ...u });
|
|
1941
|
+
}, ai = (e, t, n) => {
|
|
1942
|
+
let r = (e) => t || de(e.url), i = Oe(e.filter(r)), a = /* @__PURE__ */ new Set([
|
|
1943
1943
|
...e.filter((e) => !r(e)),
|
|
1944
1944
|
...i.images.filter((e) => n.has(e.url)),
|
|
1945
1945
|
...i.files
|
|
@@ -1950,15 +1950,15 @@ var ni = "rounded-xl", ri = "ai-chat", ii = (e) => {
|
|
|
1950
1950
|
documents: i.documents,
|
|
1951
1951
|
chips: e.filter((e) => a.has(e))
|
|
1952
1952
|
};
|
|
1953
|
-
},
|
|
1953
|
+
}, oi = ({ align: e, compact: t = !1, children: n }) => /* @__PURE__ */ Y("div", {
|
|
1954
1954
|
className: y("flex w-full min-w-0 flex-col gap-1.5", e === "end" ? "items-end" : "items-start"),
|
|
1955
1955
|
"data-testid": "ai-chat-file-attachments",
|
|
1956
1956
|
"data-size": t ? "compact" : void 0,
|
|
1957
1957
|
children: n
|
|
1958
|
-
}),
|
|
1958
|
+
}), si = ({ images: e, videos: t, documents: n, chips: r, align: i, openImage: a, onImageError: o, onOpenFile: s, onFileDownloaded: c }) => /* @__PURE__ */ X(oi, {
|
|
1959
1959
|
align: i,
|
|
1960
1960
|
children: [
|
|
1961
|
-
e.length > 0 ? /* @__PURE__ */ Y(
|
|
1961
|
+
e.length > 0 ? /* @__PURE__ */ Y(fi, {
|
|
1962
1962
|
images: e,
|
|
1963
1963
|
onOpen: (t) => {
|
|
1964
1964
|
let n = e[t];
|
|
@@ -1966,80 +1966,80 @@ var ni = "rounded-xl", ri = "ai-chat", ii = (e) => {
|
|
|
1966
1966
|
},
|
|
1967
1967
|
onImageError: o
|
|
1968
1968
|
}) : null,
|
|
1969
|
-
t.map((e, t) => /* @__PURE__ */ Y(
|
|
1970
|
-
file:
|
|
1969
|
+
t.map((e, t) => /* @__PURE__ */ Y(Ee, {
|
|
1970
|
+
file: tt(e),
|
|
1971
1971
|
cornerClass: "rounded-xl",
|
|
1972
|
-
testIdPrefix:
|
|
1972
|
+
testIdPrefix: ni,
|
|
1973
1973
|
onDownloaded: () => c?.(e)
|
|
1974
1974
|
}, `${e.name}-${t}`)),
|
|
1975
|
-
n.map(({ file: e, kind: t }, n) => /* @__PURE__ */ Y(
|
|
1976
|
-
file:
|
|
1975
|
+
n.map(({ file: e, kind: t }, n) => /* @__PURE__ */ Y(A, {
|
|
1976
|
+
file: tt(e),
|
|
1977
1977
|
kind: t,
|
|
1978
1978
|
cornerClass: "rounded-xl",
|
|
1979
|
-
testIdPrefix:
|
|
1979
|
+
testIdPrefix: ni,
|
|
1980
1980
|
lazyMount: !0,
|
|
1981
1981
|
fitWidth: !0,
|
|
1982
1982
|
decorativeSnapshot: !0,
|
|
1983
1983
|
onBeforeOpen: () => s?.(e, "document"),
|
|
1984
1984
|
onDownloaded: () => c?.(e)
|
|
1985
1985
|
}, `${e.name}-${n}`)),
|
|
1986
|
-
/* @__PURE__ */ Y(
|
|
1986
|
+
/* @__PURE__ */ Y(li, {
|
|
1987
1987
|
files: r,
|
|
1988
1988
|
align: i,
|
|
1989
1989
|
onFileDownloaded: c
|
|
1990
1990
|
})
|
|
1991
1991
|
]
|
|
1992
|
-
}),
|
|
1992
|
+
}), ci = ({ files: e, images: t, videos: n, documents: r, chips: i, align: a, openImage: o, onImageError: s, onOpenFile: c, onFileDownloaded: l }) => {
|
|
1993
1993
|
let u = new Map(r.map((e) => [e.file, e.kind])), d = e.filter((e) => t.includes(e) || u.has(e));
|
|
1994
|
-
return /* @__PURE__ */ X(
|
|
1994
|
+
return /* @__PURE__ */ X(oi, {
|
|
1995
1995
|
align: a,
|
|
1996
1996
|
compact: !0,
|
|
1997
1997
|
children: [d.length > 0 ? /* @__PURE__ */ Y("div", {
|
|
1998
1998
|
className: y("flex max-w-full flex-wrap gap-1", a === "end" ? "justify-end" : "justify-start"),
|
|
1999
1999
|
children: d.map((e, n) => {
|
|
2000
2000
|
let r = u.get(e);
|
|
2001
|
-
return r ? /* @__PURE__ */ Y(
|
|
2002
|
-
file:
|
|
2001
|
+
return r ? /* @__PURE__ */ Y(A, {
|
|
2002
|
+
file: tt(e),
|
|
2003
2003
|
kind: r,
|
|
2004
2004
|
cornerClass: "rounded-lg",
|
|
2005
2005
|
compact: !0,
|
|
2006
|
-
testIdPrefix:
|
|
2006
|
+
testIdPrefix: ni,
|
|
2007
2007
|
lazyMount: !0,
|
|
2008
2008
|
decorativeSnapshot: !0,
|
|
2009
2009
|
onBeforeOpen: () => c?.(e, "document")
|
|
2010
|
-
}, `${e.name}-${n}`) : /* @__PURE__ */ Y(
|
|
2010
|
+
}, `${e.name}-${n}`) : /* @__PURE__ */ Y(ui, {
|
|
2011
2011
|
file: e,
|
|
2012
2012
|
onOpen: () => o(e, t.indexOf(e)),
|
|
2013
2013
|
onError: () => s(e)
|
|
2014
2014
|
}, `${e.name}-${n}`);
|
|
2015
2015
|
})
|
|
2016
|
-
}) : null, /* @__PURE__ */ Y(
|
|
2016
|
+
}) : null, /* @__PURE__ */ Y(li, {
|
|
2017
2017
|
files: [...n, ...i],
|
|
2018
2018
|
align: a,
|
|
2019
2019
|
onFileDownloaded: l
|
|
2020
2020
|
})]
|
|
2021
2021
|
});
|
|
2022
|
-
},
|
|
2023
|
-
let r =
|
|
2022
|
+
}, li = ({ files: e, align: t, onFileDownloaded: n }) => {
|
|
2023
|
+
let r = Te();
|
|
2024
2024
|
return e.length === 0 ? null : /* @__PURE__ */ Y("div", {
|
|
2025
2025
|
className: y("flex max-w-full flex-wrap gap-1.5", t === "end" ? "justify-end" : "justify-start"),
|
|
2026
|
-
children: e.map((e, t) => /* @__PURE__ */ Y(
|
|
2026
|
+
children: e.map((e, t) => /* @__PURE__ */ Y(di, {
|
|
2027
2027
|
file: e,
|
|
2028
2028
|
onDownload: () => {
|
|
2029
2029
|
r(e.url, e.name), n?.(e);
|
|
2030
2030
|
}
|
|
2031
2031
|
}, `${e.name}-${t}`))
|
|
2032
2032
|
});
|
|
2033
|
-
},
|
|
2034
|
-
let r =
|
|
2035
|
-
return
|
|
2033
|
+
}, ui = ({ file: e, onOpen: t, onError: n }) => {
|
|
2034
|
+
let r = p(), i = ue(e.thumbnailUrl ?? e.url);
|
|
2035
|
+
return ot(i.status, n), /* @__PURE__ */ Y("button", {
|
|
2036
2036
|
type: "button",
|
|
2037
2037
|
onClick: t,
|
|
2038
2038
|
draggable: !1,
|
|
2039
2039
|
"aria-label": r.t("chat.openNamedDocument", { name: e.name }),
|
|
2040
2040
|
className: y("relative box-border h-16 w-16 shrink-0 overflow-hidden rounded-lg border border-solid border-f1-border-secondary bg-f1-background-secondary p-0 transition-opacity hover:opacity-90", b()),
|
|
2041
2041
|
"data-testid": "ai-chat-image-attachment",
|
|
2042
|
-
children: i.status === "ready" ? /* @__PURE__ */ Y(
|
|
2042
|
+
children: i.status === "ready" ? /* @__PURE__ */ Y(Je, {
|
|
2043
2043
|
src: i.url,
|
|
2044
2044
|
alt: e.name,
|
|
2045
2045
|
draggable: !1,
|
|
@@ -2047,32 +2047,32 @@ var ni = "rounded-xl", ri = "ai-chat", ii = (e) => {
|
|
|
2047
2047
|
className: "h-full w-full object-cover"
|
|
2048
2048
|
}) : null
|
|
2049
2049
|
});
|
|
2050
|
-
},
|
|
2051
|
-
let n =
|
|
2052
|
-
return /* @__PURE__ */ Y(
|
|
2050
|
+
}, di = ({ file: e, onDownload: t }) => {
|
|
2051
|
+
let n = p();
|
|
2052
|
+
return /* @__PURE__ */ Y(Ie, {
|
|
2053
2053
|
file: {
|
|
2054
2054
|
name: e.name,
|
|
2055
|
-
type:
|
|
2055
|
+
type: Fr(e)
|
|
2056
2056
|
},
|
|
2057
2057
|
size: "lg",
|
|
2058
2058
|
actions: [{
|
|
2059
2059
|
label: n.t("chat.downloadNamedFile", { name: e.name }),
|
|
2060
|
-
icon:
|
|
2060
|
+
icon: B,
|
|
2061
2061
|
onClick: t
|
|
2062
2062
|
}]
|
|
2063
2063
|
});
|
|
2064
|
-
},
|
|
2065
|
-
let r =
|
|
2064
|
+
}, fi = ({ images: e, onOpen: t, onImageError: n }) => {
|
|
2065
|
+
let r = p(), i = e.length === 1 ? e[0] : void 0, a = ue(i ? i.thumbnailUrl ?? i.url : void 0), o = Se(i && a.status === "ready" ? a.url : void 0, i) ?? void 0, s = i ? Fe(o?.width, o?.height) : null;
|
|
2066
2066
|
return /* @__PURE__ */ Y("div", {
|
|
2067
2067
|
style: s ? { width: s.width } : void 0,
|
|
2068
|
-
className: y("grid grid-cols-2 overflow-hidden border border-solid border-f1-border-secondary", s ? "max-w-full" :
|
|
2068
|
+
className: y("grid grid-cols-2 overflow-hidden border border-solid border-f1-border-secondary", s ? "max-w-full" : We, Le, ti),
|
|
2069
2069
|
"data-testid": "ai-chat-image-album",
|
|
2070
|
-
children:
|
|
2070
|
+
children: Xe(o ? [o] : e).map((i, a, o) => {
|
|
2071
2071
|
let s = e[i.index];
|
|
2072
2072
|
if (!s) return null;
|
|
2073
2073
|
let c = a === o.length - 1;
|
|
2074
|
-
return /* @__PURE__ */ Y(
|
|
2075
|
-
image:
|
|
2074
|
+
return /* @__PURE__ */ Y(Be, {
|
|
2075
|
+
image: ze(s),
|
|
2076
2076
|
aspectRatio: i.aspectRatio,
|
|
2077
2077
|
spanFull: i.span === 2,
|
|
2078
2078
|
inset: i.inset,
|
|
@@ -2085,32 +2085,32 @@ var ni = "rounded-xl", ri = "ai-chat", ii = (e) => {
|
|
|
2085
2085
|
eager: !1,
|
|
2086
2086
|
preventDrag: !0,
|
|
2087
2087
|
onImageError: () => n(s),
|
|
2088
|
-
testIdPrefix:
|
|
2088
|
+
testIdPrefix: ni,
|
|
2089
2089
|
overlay: i.hiddenCount > 0 ? /* @__PURE__ */ Y("span", {
|
|
2090
2090
|
"aria-hidden": !0,
|
|
2091
|
-
className: y("absolute inset-0 flex items-center justify-center text-2xl font-semibold text-f1-foreground-inverse",
|
|
2091
|
+
className: y("absolute inset-0 flex items-center justify-center text-2xl font-semibold text-f1-foreground-inverse", et),
|
|
2092
2092
|
"data-testid": "ai-chat-image-album-more",
|
|
2093
2093
|
children: `+${i.hiddenCount}`
|
|
2094
2094
|
}) : void 0
|
|
2095
2095
|
}, `${s.name}-${i.index}`);
|
|
2096
2096
|
})
|
|
2097
2097
|
});
|
|
2098
|
-
},
|
|
2099
|
-
function
|
|
2098
|
+
}, pi = m("F0AiFileAttachments", ri), mi = 2;
|
|
2099
|
+
function hi(e, t) {
|
|
2100
2100
|
if (!e.intersectsNode(t)) return null;
|
|
2101
2101
|
let n = document.createRange();
|
|
2102
2102
|
n.selectNodeContents(t);
|
|
2103
2103
|
let r = e.cloneRange();
|
|
2104
2104
|
r.compareBoundaryPoints(Range.START_TO_START, n) < 0 && r.setStart(n.startContainer, n.startOffset), r.compareBoundaryPoints(Range.END_TO_END, n) > 0 && r.setEnd(n.endContainer, n.endOffset);
|
|
2105
2105
|
let i = r.toString().trim();
|
|
2106
|
-
if (i.length <
|
|
2106
|
+
if (i.length < mi) return null;
|
|
2107
2107
|
let a = r.getBoundingClientRect();
|
|
2108
2108
|
return {
|
|
2109
2109
|
rect: a.width > 0 || a.height > 0 ? a : t.getBoundingClientRect(),
|
|
2110
2110
|
text: i
|
|
2111
2111
|
};
|
|
2112
2112
|
}
|
|
2113
|
-
function
|
|
2113
|
+
function gi({ containerRef: e, enabled: t = !0 }) {
|
|
2114
2114
|
let [n, r] = q(null), i = U(() => r(null), []);
|
|
2115
2115
|
return W(() => {
|
|
2116
2116
|
if (!t || typeof window > "u") return;
|
|
@@ -2118,7 +2118,7 @@ function _i({ containerRef: e, enabled: t = !0 }) {
|
|
|
2118
2118
|
if (!n) return;
|
|
2119
2119
|
let i = () => {
|
|
2120
2120
|
let e = window.getSelection();
|
|
2121
|
-
!e || e.isCollapsed || e.rangeCount === 0 ? r(null) : r(
|
|
2121
|
+
!e || e.isCollapsed || e.rangeCount === 0 ? r(null) : r(hi(e.getRangeAt(0), n));
|
|
2122
2122
|
}, a = () => {
|
|
2123
2123
|
window.setTimeout(i, 0);
|
|
2124
2124
|
}, o = () => {
|
|
@@ -2135,26 +2135,26 @@ function _i({ containerRef: e, enabled: t = !0 }) {
|
|
|
2135
2135
|
}
|
|
2136
2136
|
//#endregion
|
|
2137
2137
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/ReplyPopover.tsx
|
|
2138
|
-
var
|
|
2139
|
-
function
|
|
2140
|
-
let n =
|
|
2141
|
-
if (
|
|
2138
|
+
var _i = 8, vi = 8;
|
|
2139
|
+
function yi({ anchor: e, onReply: t }) {
|
|
2140
|
+
let n = p(), r = K(null), [i, a] = q(null);
|
|
2141
|
+
if (Kt(() => {
|
|
2142
2142
|
if (!e) {
|
|
2143
2143
|
a(null);
|
|
2144
2144
|
return;
|
|
2145
2145
|
}
|
|
2146
2146
|
let t = r.current;
|
|
2147
2147
|
if (!t) return;
|
|
2148
|
-
let n = t.offsetWidth, i = t.offsetHeight, o = window.innerWidth, s = window.innerHeight, c = e.rect.top - i -
|
|
2149
|
-
c <
|
|
2150
|
-
let l = e.rect.left + e.rect.width / 2 - n / 2, u = Math.min(Math.max(l,
|
|
2148
|
+
let n = t.offsetWidth, i = t.offsetHeight, o = window.innerWidth, s = window.innerHeight, c = e.rect.top - i - _i;
|
|
2149
|
+
c < vi && (c = e.rect.bottom + _i), c = Math.min(Math.max(c, vi), s - i - vi);
|
|
2150
|
+
let l = e.rect.left + e.rect.width / 2 - n / 2, u = Math.min(Math.max(l, vi), o - n - vi);
|
|
2151
2151
|
a({
|
|
2152
2152
|
top: c,
|
|
2153
2153
|
left: u
|
|
2154
2154
|
});
|
|
2155
2155
|
}, [e]), typeof document > "u" || !e) return null;
|
|
2156
2156
|
let o = n.ai.reply;
|
|
2157
|
-
return
|
|
2157
|
+
return qt(/* @__PURE__ */ Y("div", {
|
|
2158
2158
|
style: {
|
|
2159
2159
|
position: "fixed",
|
|
2160
2160
|
top: i?.top ?? -9999,
|
|
@@ -2167,7 +2167,7 @@ function bi({ anchor: e, onReply: t }) {
|
|
|
2167
2167
|
type: "button",
|
|
2168
2168
|
variant: "ghost",
|
|
2169
2169
|
label: o,
|
|
2170
|
-
icon:
|
|
2170
|
+
icon: st,
|
|
2171
2171
|
onClick: () => {
|
|
2172
2172
|
t(e.text);
|
|
2173
2173
|
}
|
|
@@ -2176,11 +2176,11 @@ function bi({ anchor: e, onReply: t }) {
|
|
|
2176
2176
|
}
|
|
2177
2177
|
//#endregion
|
|
2178
2178
|
//#region src/addons/ai/ai/F0AiMessagesContainer/components/AssistantMessage.tsx
|
|
2179
|
-
var
|
|
2179
|
+
var bi = Bt(void 0), xi = () => Ut(bi), Si = (e) => /* @__PURE__ */ Y(qe, {
|
|
2180
2180
|
content: e,
|
|
2181
2181
|
format: "markdown"
|
|
2182
|
-
}),
|
|
2183
|
-
let s = n?.content, c =
|
|
2182
|
+
}), Ci = ({ isGenerating: e, isLoading: t, message: n, renderToolCall: r, onReplyQuote: i, onRendered: a, renderMarkdown: o }) => {
|
|
2183
|
+
let s = n?.content, c = Nr(s, "assistant") ?? "", l = G(() => Mr({ content: s }), [s]), u = (n && r?.(n)) ?? n?.generativeUI?.() ?? null, d = n?.toolCalls?.[0]?.id, f = !c && !u && l.length === 0, p = K(null), { anchor: m, clear: h } = gi({
|
|
2184
2184
|
containerRef: p,
|
|
2185
2185
|
enabled: !!(n?.id && c)
|
|
2186
2186
|
});
|
|
@@ -2191,7 +2191,7 @@ var xi = Vt(void 0), Si = () => Wt(xi), Ci = (e) => /* @__PURE__ */ Y(B, {
|
|
|
2191
2191
|
t,
|
|
2192
2192
|
e,
|
|
2193
2193
|
a
|
|
2194
|
-
]), !t && !e && f ? null : /* @__PURE__ */ Y(
|
|
2194
|
+
]), !t && !e && f ? null : /* @__PURE__ */ Y(bi.Provider, {
|
|
2195
2195
|
value: d,
|
|
2196
2196
|
children: /* @__PURE__ */ X("div", {
|
|
2197
2197
|
className: "relative isolate flex w-full flex-col items-start justify-center",
|
|
@@ -2199,11 +2199,11 @@ var xi = Vt(void 0), Si = () => Wt(xi), Ci = (e) => /* @__PURE__ */ Y(B, {
|
|
|
2199
2199
|
n && c ? /* @__PURE__ */ Y("div", {
|
|
2200
2200
|
ref: p,
|
|
2201
2201
|
className: "w-full max-w-full [&>div]:flex [&>div]:flex-col [&>div]:gap-1",
|
|
2202
|
-
children: (o ??
|
|
2202
|
+
children: (o ?? Si)(c)
|
|
2203
2203
|
}) : null,
|
|
2204
2204
|
l.length > 0 ? /* @__PURE__ */ Y("div", {
|
|
2205
2205
|
className: "mt-2 w-full max-w-[90%]",
|
|
2206
|
-
children: /* @__PURE__ */ Y(
|
|
2206
|
+
children: /* @__PURE__ */ Y(pi, {
|
|
2207
2207
|
files: l,
|
|
2208
2208
|
align: "start"
|
|
2209
2209
|
})
|
|
@@ -2212,7 +2212,7 @@ var xi = Vt(void 0), Si = () => Wt(xi), Ci = (e) => /* @__PURE__ */ Y(B, {
|
|
|
2212
2212
|
className: "w-full",
|
|
2213
2213
|
children: u
|
|
2214
2214
|
}) : null,
|
|
2215
|
-
/* @__PURE__ */ Y(
|
|
2215
|
+
/* @__PURE__ */ Y(yi, {
|
|
2216
2216
|
anchor: m,
|
|
2217
2217
|
onReply: (e) => {
|
|
2218
2218
|
i?.(e), h(), window.getSelection()?.removeAllRanges();
|
|
@@ -2221,14 +2221,14 @@ var xi = Vt(void 0), Si = () => Wt(xi), Ci = (e) => /* @__PURE__ */ Y(B, {
|
|
|
2221
2221
|
]
|
|
2222
2222
|
})
|
|
2223
2223
|
});
|
|
2224
|
-
},
|
|
2225
|
-
let [i, a] = q(""), o =
|
|
2224
|
+
}, wi = ({ onClose: e, onSubmit: t, reactionType: n, message: r }) => {
|
|
2225
|
+
let [i, a] = q(""), o = p(), { 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
|
+
]), d = () => {
|
|
2232
2232
|
e(r);
|
|
2233
2233
|
};
|
|
2234
2234
|
return W(() => {
|
|
@@ -2238,10 +2238,10 @@ var xi = Vt(void 0), Si = () => Wt(xi), Ci = (e) => /* @__PURE__ */ Y(B, {
|
|
|
2238
2238
|
return document.addEventListener("keydown", e), () => {
|
|
2239
2239
|
document.removeEventListener("keydown", e);
|
|
2240
2240
|
};
|
|
2241
|
-
}, [u]), /* @__PURE__ */ Y(
|
|
2241
|
+
}, [u]), /* @__PURE__ */ Y(Ze, {
|
|
2242
2242
|
position: "center",
|
|
2243
2243
|
isOpen: !0,
|
|
2244
|
-
onClose:
|
|
2244
|
+
onClose: d,
|
|
2245
2245
|
width: "md",
|
|
2246
2246
|
title: s,
|
|
2247
2247
|
container: null,
|
|
@@ -2251,11 +2251,11 @@ var xi = Vt(void 0), Si = () => Wt(xi), Ci = (e) => /* @__PURE__ */ Y(B, {
|
|
|
2251
2251
|
},
|
|
2252
2252
|
secondaryAction: {
|
|
2253
2253
|
label: o.actions.cancel,
|
|
2254
|
-
onClick:
|
|
2254
|
+
onClick: d
|
|
2255
2255
|
},
|
|
2256
2256
|
children: /* @__PURE__ */ Y("div", {
|
|
2257
2257
|
className: "flex flex-col gap-6",
|
|
2258
|
-
children: /* @__PURE__ */ Y(
|
|
2258
|
+
children: /* @__PURE__ */ Y(Ye, {
|
|
2259
2259
|
autoFocus: !0,
|
|
2260
2260
|
label: c,
|
|
2261
2261
|
placeholder: l,
|
|
@@ -2266,7 +2266,7 @@ var xi = Vt(void 0), Si = () => Wt(xi), Ci = (e) => /* @__PURE__ */ Y(B, {
|
|
|
2266
2266
|
})
|
|
2267
2267
|
})
|
|
2268
2268
|
});
|
|
2269
|
-
},
|
|
2269
|
+
}, Ti = Bt(null), Ei = ({ children: e }) => {
|
|
2270
2270
|
let [t, n] = q(null), r = t ? {
|
|
2271
2271
|
isOpen: !0,
|
|
2272
2272
|
currentReaction: t.action,
|
|
@@ -2286,17 +2286,17 @@ var xi = Vt(void 0), Si = () => Wt(xi), Ci = (e) => /* @__PURE__ */ Y(B, {
|
|
|
2286
2286
|
}),
|
|
2287
2287
|
close: () => n(null)
|
|
2288
2288
|
};
|
|
2289
|
-
return /* @__PURE__ */ Y(
|
|
2289
|
+
return /* @__PURE__ */ Y(Ti.Provider, {
|
|
2290
2290
|
value: r,
|
|
2291
2291
|
children: e
|
|
2292
2292
|
});
|
|
2293
|
-
},
|
|
2294
|
-
let e =
|
|
2293
|
+
}, Di = () => {
|
|
2294
|
+
let e = Ut(Ti);
|
|
2295
2295
|
if (e === null) throw Error("useFeedbackModal must be used within a FeedbackModalProvider");
|
|
2296
2296
|
return e;
|
|
2297
2297
|
};
|
|
2298
|
-
function
|
|
2299
|
-
let t =
|
|
2298
|
+
function Oi(e) {
|
|
2299
|
+
let t = Di();
|
|
2300
2300
|
return {
|
|
2301
2301
|
modal: t,
|
|
2302
2302
|
handleSubmit: (n, r) => {
|
|
@@ -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
|
|
2319
|
-
let i =
|
|
2318
|
+
var ki = ({ content: t, targetMessage: n, onCopy: r }) => {
|
|
2319
|
+
let i = p(), { open: a } = Di(), [o, s] = q(null);
|
|
2320
2320
|
return /* @__PURE__ */ X("div", {
|
|
2321
2321
|
className: "flex",
|
|
2322
2322
|
children: [
|
|
2323
|
-
/* @__PURE__ */ Y(
|
|
2323
|
+
/* @__PURE__ */ Y(Ne, {
|
|
2324
2324
|
size: "md",
|
|
2325
2325
|
variant: "ghost",
|
|
2326
|
-
valueToCopy:
|
|
2327
|
-
onCopy: (
|
|
2328
|
-
|
|
2326
|
+
valueToCopy: t,
|
|
2327
|
+
onCopy: (e) => {
|
|
2328
|
+
e.currentTarget.blur(), r?.(t);
|
|
2329
2329
|
}
|
|
2330
2330
|
}),
|
|
2331
|
-
/* @__PURE__ */ Y(
|
|
2331
|
+
/* @__PURE__ */ Y(e, {
|
|
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: e, 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(u, {
|
|
2343
2343
|
size: "md",
|
|
2344
|
-
icon: o === "like" ?
|
|
2344
|
+
icon: o === "like" ? S : ke,
|
|
2345
2345
|
color: "default"
|
|
2346
2346
|
})
|
|
2347
2347
|
})
|
|
2348
2348
|
}),
|
|
2349
|
-
/* @__PURE__ */ Y(
|
|
2349
|
+
/* @__PURE__ */ Y(e, {
|
|
2350
2350
|
onClick: (e) => {
|
|
2351
2351
|
let t = o === "dislike" ? null : "dislike";
|
|
2352
2352
|
t && a(t, n), s(t), e.currentTarget.blur();
|
|
@@ -2357,31 +2357,47 @@ var Ai = ({ content: e, 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(u, {
|
|
2361
2361
|
size: "md",
|
|
2362
|
-
icon: o === "dislike" ?
|
|
2362
|
+
icon: o === "dislike" ? Qe : Ve,
|
|
2363
2363
|
color: "default"
|
|
2364
2364
|
})
|
|
2365
2365
|
})
|
|
2366
2366
|
})
|
|
2367
2367
|
]
|
|
2368
2368
|
});
|
|
2369
|
-
},
|
|
2370
|
-
|
|
2371
|
-
|
|
2369
|
+
}, Ai = ({ position: e }) => /* @__PURE__ */ Y(s.div, {
|
|
2370
|
+
transition: {
|
|
2371
|
+
duration: .2,
|
|
2372
|
+
ease: "easeOut"
|
|
2373
|
+
},
|
|
2374
|
+
className: y("pointer-events-none absolute inset-x-px z-[5] after:absolute after:inset-x-0 after:top-0 after:h-px after:bg-f1-background-inverse-secondary after:opacity-[0.04] after:content-['']", e === "top" ? [
|
|
2375
|
+
"top-0",
|
|
2376
|
+
"h-6",
|
|
2377
|
+
"bg-gradient-to-b from-f1-background dark:from-f1-background-secondary to-transparent",
|
|
2378
|
+
"after:top-0"
|
|
2379
|
+
] : [
|
|
2380
|
+
"bottom-0",
|
|
2381
|
+
"h-6",
|
|
2382
|
+
"bg-gradient-to-t from-f1-background dark:from-f1-background-secondary to-transparent",
|
|
2383
|
+
"after:bottom-0"
|
|
2384
|
+
])
|
|
2385
|
+
}), ji = ({ icon: e, title: n, children: r, open: i, defaultOpen: a = !1, onOpenChange: o, lockOpen: c = !1 }) => {
|
|
2386
|
+
let [l, d] = q(a), f = t(), p = i !== void 0, m = p ? i : l;
|
|
2387
|
+
return /* @__PURE__ */ X(F, {
|
|
2372
2388
|
className: "mb-1 w-full",
|
|
2373
|
-
open:
|
|
2389
|
+
open: m,
|
|
2374
2390
|
onOpenChange: (e) => {
|
|
2375
|
-
|
|
2391
|
+
c || (p || d(e), o?.(e));
|
|
2376
2392
|
},
|
|
2377
|
-
children: [/* @__PURE__ */ X(
|
|
2378
|
-
disabled:
|
|
2379
|
-
className: y("gap-1",
|
|
2393
|
+
children: [/* @__PURE__ */ X(me, {
|
|
2394
|
+
disabled: c,
|
|
2395
|
+
className: y("gap-1", c ? "flex w-full items-center text-base text-f1-foreground-secondary" : "flex w-full items-center text-base text-f1-foreground-secondary transition-colors duration-150 hover:text-f1-foreground [&[data-state=open]>svg]:rotate-90"),
|
|
2380
2396
|
children: [
|
|
2381
2397
|
/* @__PURE__ */ Y("span", {
|
|
2382
2398
|
className: "flex items-center justify-start h-6 w-6",
|
|
2383
|
-
children: /* @__PURE__ */ Y(
|
|
2384
|
-
icon:
|
|
2399
|
+
children: /* @__PURE__ */ Y(u, {
|
|
2400
|
+
icon: e,
|
|
2385
2401
|
className: "block"
|
|
2386
2402
|
})
|
|
2387
2403
|
}),
|
|
@@ -2389,20 +2405,20 @@ var Ai = ({ content: e, targetMessage: n, onCopy: r }) => {
|
|
|
2389
2405
|
className: "min-h-6 flex items-center",
|
|
2390
2406
|
children: /* @__PURE__ */ Y("span", { children: n })
|
|
2391
2407
|
}),
|
|
2392
|
-
|
|
2408
|
+
c ? null : /* @__PURE__ */ Y(u, { icon: Ct })
|
|
2393
2409
|
]
|
|
2394
|
-
}), /* @__PURE__ */ Y(
|
|
2410
|
+
}), /* @__PURE__ */ Y(fe, {
|
|
2395
2411
|
forceMount: !0,
|
|
2396
2412
|
className: "data-[state=open]:mt-3",
|
|
2397
|
-
children: /* @__PURE__ */ Y(
|
|
2413
|
+
children: /* @__PURE__ */ Y(s.div, {
|
|
2398
2414
|
initial: !1,
|
|
2399
2415
|
animate: {
|
|
2400
|
-
height:
|
|
2401
|
-
opacity: +!!
|
|
2402
|
-
visibility:
|
|
2416
|
+
height: m ? "auto" : 0,
|
|
2417
|
+
opacity: +!!m,
|
|
2418
|
+
visibility: m ? "visible" : "hidden"
|
|
2403
2419
|
},
|
|
2404
2420
|
transition: {
|
|
2405
|
-
duration:
|
|
2421
|
+
duration: f ? 0 : .15,
|
|
2406
2422
|
ease: [
|
|
2407
2423
|
.165,
|
|
2408
2424
|
.84,
|
|
@@ -2416,7 +2432,7 @@ var Ai = ({ content: e, targetMessage: n, onCopy: r }) => {
|
|
|
2416
2432
|
})]
|
|
2417
2433
|
});
|
|
2418
2434
|
}, Mi = 1e3, Ni = 1e3, Pi = ({ startedAt: e }) => {
|
|
2419
|
-
let t =
|
|
2435
|
+
let t = p(), [n, r] = q(() => e === null ? 0 : Date.now() - e);
|
|
2420
2436
|
if (W(() => {
|
|
2421
2437
|
if (e === null) {
|
|
2422
2438
|
r(0);
|
|
@@ -2441,13 +2457,13 @@ var Ai = ({ content: e, targetMessage: n, onCopy: r }) => {
|
|
|
2441
2457
|
}), s]
|
|
2442
2458
|
});
|
|
2443
2459
|
}, Fi = ({ titles: e, title: t, inProgress: n, isWriting: r, startedAt: i = null }) => {
|
|
2444
|
-
let a =
|
|
2460
|
+
let a = p(), [o, s] = q(!!n), c = K(n);
|
|
2445
2461
|
W(() => {
|
|
2446
2462
|
c.current && !n ? s(!1) : n && !o && s(!0), c.current = n;
|
|
2447
2463
|
}, [n, o]);
|
|
2448
|
-
let l = n ? a.ai.thoughtsGroupTitle : t ?? a.ai.thoughtsGroupTitle, u = e.length - 1,
|
|
2464
|
+
let l = n ? a.ai.thoughtsGroupTitle : t ?? a.ai.thoughtsGroupTitle, u = e.length - 1, d = (e) => !n || r ? "completed" : e === u ? "executing" : "completed";
|
|
2449
2465
|
return /* @__PURE__ */ Y(ji, {
|
|
2450
|
-
icon:
|
|
2466
|
+
icon: Ae,
|
|
2451
2467
|
title: l,
|
|
2452
2468
|
open: o,
|
|
2453
2469
|
onOpenChange: s,
|
|
@@ -2456,10 +2472,10 @@ var Ai = ({ content: e, targetMessage: n, onCopy: r }) => {
|
|
|
2456
2472
|
className: "flex flex-col gap-3 pb-4",
|
|
2457
2473
|
children: e.map((t, n) => /* @__PURE__ */ X("div", {
|
|
2458
2474
|
className: "relative",
|
|
2459
|
-
children: [/* @__PURE__ */ Y(
|
|
2475
|
+
children: [/* @__PURE__ */ Y(R, {
|
|
2460
2476
|
title: t,
|
|
2461
|
-
status:
|
|
2462
|
-
suffix:
|
|
2477
|
+
status: d(n),
|
|
2478
|
+
suffix: d(n) === "executing" ? /* @__PURE__ */ Y(Pi, { startedAt: i }) : void 0,
|
|
2463
2479
|
inGroup: !0
|
|
2464
2480
|
}), n < e.length - 1 ? /* @__PURE__ */ Y("div", {
|
|
2465
2481
|
"aria-hidden": !0,
|
|
@@ -2468,14 +2484,14 @@ var Ai = ({ content: e, targetMessage: n, onCopy: r }) => {
|
|
|
2468
2484
|
}, n))
|
|
2469
2485
|
})
|
|
2470
2486
|
});
|
|
2471
|
-
}, Ii = (e) => /* @__PURE__ */ Y(
|
|
2487
|
+
}, Ii = (e) => /* @__PURE__ */ Y(qe, {
|
|
2472
2488
|
content: e,
|
|
2473
2489
|
format: "markdown"
|
|
2474
2490
|
}), Li = ({ text: e, renderMarkdown: t }) => /* @__PURE__ */ X("div", {
|
|
2475
2491
|
className: "flex max-w-[90%] items-start gap-2 self-end pb-1 pr-2 text-f1-foreground-tertiary",
|
|
2476
2492
|
children: [/* @__PURE__ */ Y("div", {
|
|
2477
2493
|
className: "flex h-5 items-center",
|
|
2478
|
-
children: /* @__PURE__ */ Y(
|
|
2494
|
+
children: /* @__PURE__ */ Y(u, { icon: xe })
|
|
2479
2495
|
}), /* @__PURE__ */ Y("div", {
|
|
2480
2496
|
className: "min-w-0 whitespace-pre-wrap text-base leading-5 [&>div]:flex [&>div]:flex-col [&>div]:gap-1 [&_p]:m-0",
|
|
2481
2497
|
children: (t ?? Ii)(e)
|
|
@@ -2485,10 +2501,10 @@ var Ai = ({ content: e, targetMessage: n, onCopy: r }) => {
|
|
|
2485
2501
|
W(() => {
|
|
2486
2502
|
i.current && n && i.current.scrollIntoView({ behavior: "smooth" });
|
|
2487
2503
|
}, [n]);
|
|
2488
|
-
let o = e?.content, s = e?.rawData, c = G(() =>
|
|
2504
|
+
let o = e?.content, s = e?.rawData, c = G(() => Mr({
|
|
2489
2505
|
content: o,
|
|
2490
2506
|
rawData: s
|
|
2491
|
-
}), [o, s]), l = (
|
|
2507
|
+
}), [o, s]), l = (Nr(o, "user") ?? "").trim(), u = e?.replyQuote ?? null, d = l.length > 0, { anchor: f, clear: p } = gi({
|
|
2492
2508
|
containerRef: a,
|
|
2493
2509
|
enabled: d
|
|
2494
2510
|
});
|
|
@@ -2502,7 +2518,7 @@ var Ai = ({ content: e, targetMessage: n, onCopy: r }) => {
|
|
|
2502
2518
|
}) : null,
|
|
2503
2519
|
c.length > 0 ? /* @__PURE__ */ Y("div", {
|
|
2504
2520
|
className: "flex w-full max-w-[90%] justify-end",
|
|
2505
|
-
children: /* @__PURE__ */ Y(
|
|
2521
|
+
children: /* @__PURE__ */ Y(pi, {
|
|
2506
2522
|
files: c,
|
|
2507
2523
|
align: "end",
|
|
2508
2524
|
size: "compact"
|
|
@@ -2513,7 +2529,7 @@ var Ai = ({ content: e, targetMessage: n, onCopy: r }) => {
|
|
|
2513
2529
|
className: "w-fit max-w-[90%] self-end whitespace-pre-wrap rounded-xl bg-f1-background-tertiary px-4 py-3 [&>div]:flex [&>div]:flex-col [&>div]:gap-1",
|
|
2514
2530
|
children: (r ?? Ii)(l)
|
|
2515
2531
|
}) : null,
|
|
2516
|
-
/* @__PURE__ */ Y(
|
|
2532
|
+
/* @__PURE__ */ Y(yi, {
|
|
2517
2533
|
anchor: f,
|
|
2518
2534
|
onReply: (e) => {
|
|
2519
2535
|
t?.(e), p(), window.getSelection()?.removeAllRanges();
|
|
@@ -2521,8 +2537,8 @@ var Ai = ({ content: e, targetMessage: n, onCopy: r }) => {
|
|
|
2521
2537
|
})
|
|
2522
2538
|
]
|
|
2523
2539
|
});
|
|
2524
|
-
}, zi = 35, Bi = 22, Vi = 400, Hi = 2500, Ui = 220, Wi = ({ phrase:
|
|
2525
|
-
let a =
|
|
2540
|
+
}, zi = 35, Bi = 22, Vi = 400, Hi = 2500, Ui = 220, Wi = ({ phrase: e, typed: n, phraseIndex: r, onClick: i }) => {
|
|
2541
|
+
let a = t(), o = !!i;
|
|
2526
2542
|
return /* @__PURE__ */ X("p", {
|
|
2527
2543
|
role: o ? "button" : void 0,
|
|
2528
2544
|
tabIndex: o ? 0 : void 0,
|
|
@@ -2531,39 +2547,39 @@ var Ai = ({ content: e, targetMessage: n, onCopy: r }) => {
|
|
|
2531
2547
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), i?.());
|
|
2532
2548
|
} : void 0,
|
|
2533
2549
|
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 ?
|
|
2550
|
+
"aria-label": o ? e : void 0,
|
|
2535
2551
|
children: [/* @__PURE__ */ Y("span", {
|
|
2536
2552
|
className: "opacity-0",
|
|
2537
|
-
children:
|
|
2553
|
+
children: e
|
|
2538
2554
|
}), /* @__PURE__ */ Y("span", {
|
|
2539
2555
|
"aria-hidden": "true",
|
|
2540
2556
|
className: "absolute inset-0",
|
|
2541
|
-
children: a ?
|
|
2557
|
+
children: a ? e : e.slice(0, n)
|
|
2542
2558
|
})]
|
|
2543
2559
|
}, r);
|
|
2544
|
-
}, Gi = ({ messages:
|
|
2545
|
-
let [s, c] = q(0), [l, u] = q(0), [d, f] = q("starting"), p =
|
|
2560
|
+
}, Gi = ({ messages: e, caption: n, subtitle: r, cta: i, onClick: a, fullscreen: o = !1 }) => {
|
|
2561
|
+
let [s, c] = q(0), [l, u] = q(0), [d, f] = q("starting"), p = t(), m = e[s] ?? "", h = e.join("\0"), g = K(!0);
|
|
2546
2562
|
return W(() => {
|
|
2547
2563
|
g.current ? g.current = !1 : (c(0), u(0), f("writing"));
|
|
2548
2564
|
}, [h]), W(() => {
|
|
2549
2565
|
if (p) return;
|
|
2550
|
-
let
|
|
2551
|
-
if (d === "starting")
|
|
2552
|
-
else if (d === "writing") l < m.length ?
|
|
2566
|
+
let t;
|
|
2567
|
+
if (d === "starting") t = setTimeout(() => f("writing"), Vi);
|
|
2568
|
+
else if (d === "writing") l < m.length ? t = setTimeout(() => u((e) => e + 1), zi) : f("holding");
|
|
2553
2569
|
else if (d === "holding") {
|
|
2554
|
-
if (
|
|
2555
|
-
|
|
2556
|
-
} else d === "erasing" && (
|
|
2557
|
-
c((
|
|
2570
|
+
if (e.length <= 1) return;
|
|
2571
|
+
t = setTimeout(() => f("erasing"), Hi);
|
|
2572
|
+
} else d === "erasing" && (t = l > 0 ? setTimeout(() => u((e) => e - 1), Bi) : setTimeout(() => {
|
|
2573
|
+
c((t) => (t + 1) % e.length), f("starting");
|
|
2558
2574
|
}, Ui));
|
|
2559
2575
|
return () => {
|
|
2560
|
-
|
|
2576
|
+
t && clearTimeout(t);
|
|
2561
2577
|
};
|
|
2562
2578
|
}, [
|
|
2563
2579
|
d,
|
|
2564
2580
|
l,
|
|
2565
2581
|
m.length,
|
|
2566
|
-
|
|
2582
|
+
e.length,
|
|
2567
2583
|
p
|
|
2568
2584
|
]), /* @__PURE__ */ Y("div", {
|
|
2569
2585
|
className: y("flex w-full flex-1 justify-center px-4", o ? "items-end pb-24" : "items-center"),
|
|
@@ -2657,29 +2673,29 @@ var Ji = {
|
|
|
2657
2673
|
onThumbsUp: () => {},
|
|
2658
2674
|
onThumbsDown: () => {}
|
|
2659
2675
|
}, Yi = (e) => {
|
|
2660
|
-
let t =
|
|
2661
|
-
return e.filePreviews || !t.provided ? /* @__PURE__ */ Y(
|
|
2676
|
+
let t = $e(), n = /* @__PURE__ */ Y(Ei, { children: /* @__PURE__ */ Y(Xi, { ...e }) });
|
|
2677
|
+
return e.filePreviews || !t.provided ? /* @__PURE__ */ Y(je, {
|
|
2662
2678
|
filePreviews: e.filePreviews,
|
|
2663
2679
|
children: n
|
|
2664
2680
|
}) : n;
|
|
2665
|
-
}, Xi = ({ turns: e, isLoadingThread: t = !1, interrupt:
|
|
2666
|
-
let { modal: D, handleSubmit: O, handleClose: ee } =
|
|
2667
|
-
let e =
|
|
2681
|
+
}, Xi = ({ turns: e, isLoadingThread: t = !1, interrupt: r, initialMessage: i, initialMessageCaption: a, initialMessageSubtitle: o, initialMessageCta: c, onWelcomeClick: l, renderToolCall: u, onReplyQuote: d, onAssistantMessageRendered: f, autoScrollUserIntoView: m = !0, renderMarkdown: h, feedback: g, freezeLayout: v = !1, noShadows: b = !1, fullscreen: x = !1, children: S, AssistantMessage: C, UserMessage: w, onRegenerate: T, onCopy: E }) => {
|
|
2682
|
+
let { modal: D, handleSubmit: O, handleClose: ee } = Oi(g ?? Ji), k = p(), A = C ?? Ci, j = w ?? Ri, M = G(() => {
|
|
2683
|
+
let e = i ?? k.ai.defaultInitialMessage;
|
|
2668
2684
|
return (Array.isArray(e) ? e : [e]).filter((e) => typeof e == "string" && e.length > 0);
|
|
2669
|
-
}, [
|
|
2685
|
+
}, [i, k.ai.defaultInitialMessage]), N = !t && e.length === 0 && M.length > 0, P = K(null), F = K(null), I = K(null), te = K(null), L = K(null), { showScrollBtn: ne, turnMinHeight: z, scrollToBottom: re } = qi({
|
|
2670
2686
|
viewportRef: P,
|
|
2671
2687
|
contentRef: F,
|
|
2672
2688
|
endRef: I,
|
|
2673
|
-
lastTurnRef:
|
|
2689
|
+
lastTurnRef: L,
|
|
2674
2690
|
turnsCount: e.length,
|
|
2675
|
-
freezeTurnMinHeight:
|
|
2676
|
-
}),
|
|
2691
|
+
freezeTurnMinHeight: v
|
|
2692
|
+
}), B = e[e.length - 1], ie = Ki(!(!B || B.endIndicator !== "thinking" && !B.thinking?.inProgress), B?.thinking?.startedAt), ae = B?.endIndicator === "asking", V = (t, n) => {
|
|
2677
2693
|
let r = n === e.length - 1, i = {
|
|
2678
|
-
renderToolCall:
|
|
2679
|
-
onReplyQuote:
|
|
2694
|
+
renderToolCall: u,
|
|
2695
|
+
onReplyQuote: d,
|
|
2680
2696
|
onRendered: f,
|
|
2681
|
-
autoScrollIntoView:
|
|
2682
|
-
renderMarkdown:
|
|
2697
|
+
autoScrollIntoView: m,
|
|
2698
|
+
renderMarkdown: h
|
|
2683
2699
|
}, a = (e, r) => {
|
|
2684
2700
|
let a = {
|
|
2685
2701
|
message: e,
|
|
@@ -2714,9 +2730,9 @@ var Ji = {
|
|
|
2714
2730
|
}, `${n}-a-${a}`);
|
|
2715
2731
|
};
|
|
2716
2732
|
return /* @__PURE__ */ X("div", {
|
|
2717
|
-
ref: r ?
|
|
2733
|
+
ref: r ? L : void 0,
|
|
2718
2734
|
className: y("flex flex-col items-start justify-start gap-2 px-1", r && "pb-5"),
|
|
2719
|
-
style: { minHeight: r &&
|
|
2735
|
+
style: { minHeight: r && z || void 0 },
|
|
2720
2736
|
children: [
|
|
2721
2737
|
t.userMessages.map((e, t) => a(e, t)),
|
|
2722
2738
|
t.thinking && t.thinking.titles.length > 0 ? /* @__PURE__ */ Y(Fi, {
|
|
@@ -2724,25 +2740,25 @@ var Ji = {
|
|
|
2724
2740
|
title: k.ai.thoughtsGroupTitle,
|
|
2725
2741
|
inProgress: t.thinking.inProgress,
|
|
2726
2742
|
isWriting: t.thinking.isWriting,
|
|
2727
|
-
startedAt: r ?
|
|
2743
|
+
startedAt: r ? ie : null
|
|
2728
2744
|
}) : null,
|
|
2729
2745
|
t.assistantMessages.map((e, t) => o(e, t)),
|
|
2730
|
-
t.endIndicator === "thinking" ? /* @__PURE__ */ Y(
|
|
2746
|
+
t.endIndicator === "thinking" ? /* @__PURE__ */ Y(R, {
|
|
2731
2747
|
title: k.ai.thinking,
|
|
2732
2748
|
status: "executing",
|
|
2733
|
-
suffix: /* @__PURE__ */ Y(Pi, { startedAt:
|
|
2749
|
+
suffix: /* @__PURE__ */ Y(Pi, { startedAt: ie })
|
|
2734
2750
|
}) : null,
|
|
2735
|
-
t.endIndicator === "activity" ? /* @__PURE__ */ Y(
|
|
2736
|
-
t.endIndicator === "asking" ? /* @__PURE__ */ Y(
|
|
2751
|
+
t.endIndicator === "activity" ? /* @__PURE__ */ Y(R, { status: "writing" }) : null,
|
|
2752
|
+
t.endIndicator === "asking" ? /* @__PURE__ */ Y(R, {
|
|
2737
2753
|
title: k.ai.askingQuestions,
|
|
2738
2754
|
status: "asking"
|
|
2739
2755
|
}) : null,
|
|
2740
|
-
t.feedback && t.endIndicator !== "asking" ? /* @__PURE__ */ Y(
|
|
2756
|
+
t.feedback && t.endIndicator !== "asking" ? /* @__PURE__ */ Y(ki, {
|
|
2741
2757
|
content: t.feedback.content,
|
|
2742
2758
|
targetMessage: t.feedback.targetMessage,
|
|
2743
2759
|
onCopy: E
|
|
2744
2760
|
}) : null,
|
|
2745
|
-
r ? /* @__PURE__ */ Y(
|
|
2761
|
+
r ? /* @__PURE__ */ Y(ei, {}) : null
|
|
2746
2762
|
]
|
|
2747
2763
|
}, `turn-${n}`);
|
|
2748
2764
|
};
|
|
@@ -2752,7 +2768,7 @@ var Ji = {
|
|
|
2752
2768
|
/* @__PURE__ */ Y("div", {
|
|
2753
2769
|
role: "status",
|
|
2754
2770
|
className: "sr-only",
|
|
2755
|
-
children:
|
|
2771
|
+
children: ae ? k.ai.askingQuestions : ""
|
|
2756
2772
|
}),
|
|
2757
2773
|
/* @__PURE__ */ Y("div", {
|
|
2758
2774
|
ref: P,
|
|
@@ -2767,14 +2783,14 @@ var Ji = {
|
|
|
2767
2783
|
t ? /* @__PURE__ */ Y(Qi, {}) : null,
|
|
2768
2784
|
N ? /* @__PURE__ */ Y(Gi, {
|
|
2769
2785
|
messages: M,
|
|
2770
|
-
caption:
|
|
2771
|
-
subtitle:
|
|
2772
|
-
cta:
|
|
2773
|
-
onClick:
|
|
2786
|
+
caption: a,
|
|
2787
|
+
subtitle: o,
|
|
2788
|
+
cta: c,
|
|
2789
|
+
onClick: l,
|
|
2774
2790
|
fullscreen: x
|
|
2775
2791
|
}) : null,
|
|
2776
|
-
t ? null : e.map((e, t) =>
|
|
2777
|
-
|
|
2792
|
+
t ? null : e.map((e, t) => V(e, t)),
|
|
2793
|
+
r
|
|
2778
2794
|
]
|
|
2779
2795
|
}),
|
|
2780
2796
|
/* @__PURE__ */ Y("div", {
|
|
@@ -2787,7 +2803,7 @@ var Ji = {
|
|
|
2787
2803
|
ref: I,
|
|
2788
2804
|
children: S
|
|
2789
2805
|
}),
|
|
2790
|
-
/* @__PURE__ */ Y(
|
|
2806
|
+
/* @__PURE__ */ Y(n, { children: ne ? /* @__PURE__ */ Y(s.div, {
|
|
2791
2807
|
className: "sticky bottom-[calc(0.5rem+var(--f0-ai-composer-overlap,0px))] z-10 flex justify-center",
|
|
2792
2808
|
initial: {
|
|
2793
2809
|
opacity: 0,
|
|
@@ -2803,39 +2819,39 @@ var Ji = {
|
|
|
2803
2819
|
},
|
|
2804
2820
|
transition: { duration: .2 },
|
|
2805
2821
|
children: /* @__PURE__ */ Y(_, {
|
|
2806
|
-
onClick: () =>
|
|
2822
|
+
onClick: () => re(),
|
|
2807
2823
|
label: k.ai.scrollToBottom,
|
|
2808
2824
|
variant: "neutral",
|
|
2809
|
-
icon:
|
|
2825
|
+
icon: Et,
|
|
2810
2826
|
hideLabel: !0
|
|
2811
2827
|
})
|
|
2812
2828
|
}) : null })
|
|
2813
2829
|
]
|
|
2814
2830
|
})
|
|
2815
2831
|
}),
|
|
2816
|
-
!b && !N ? /* @__PURE__ */ Y(
|
|
2832
|
+
!b && !N ? /* @__PURE__ */ Y(Ai, { position: "top" }, "shadow-top") : null
|
|
2817
2833
|
]
|
|
2818
|
-
}), D.isOpen ? /* @__PURE__ */ Y(
|
|
2834
|
+
}), D.isOpen ? /* @__PURE__ */ Y(wi, {
|
|
2819
2835
|
onSubmit: O,
|
|
2820
2836
|
onClose: ee,
|
|
2821
2837
|
reactionType: D.currentReaction,
|
|
2822
2838
|
message: D.currentMessage
|
|
2823
2839
|
}) : null] });
|
|
2824
|
-
}, Zi = (e) => !!
|
|
2840
|
+
}, Zi = (e) => !!Nr(e.content) || Mr(e).length > 0, Qi = () => /* @__PURE__ */ Y("div", {
|
|
2825
2841
|
className: "flex h-full w-full max-w-content flex-col gap-6",
|
|
2826
2842
|
children: /* @__PURE__ */ X("div", {
|
|
2827
2843
|
className: "flex flex-col gap-2",
|
|
2828
2844
|
children: [
|
|
2829
2845
|
/* @__PURE__ */ Y("div", {
|
|
2830
2846
|
className: "flex justify-end",
|
|
2831
|
-
children: /* @__PURE__ */ Y(
|
|
2847
|
+
children: /* @__PURE__ */ Y(d, { className: "h-12 w-2/5 rounded-full" })
|
|
2832
2848
|
}),
|
|
2833
|
-
/* @__PURE__ */ Y(
|
|
2834
|
-
/* @__PURE__ */ Y(
|
|
2835
|
-
/* @__PURE__ */ Y(
|
|
2849
|
+
/* @__PURE__ */ Y(d, { className: "mt-6 h-5 w-full rounded-md" }),
|
|
2850
|
+
/* @__PURE__ */ Y(d, { className: "h-5 w-2/5 rounded-md" }),
|
|
2851
|
+
/* @__PURE__ */ Y(d, { className: "h-5 w-4/5 rounded-md" })
|
|
2836
2852
|
]
|
|
2837
2853
|
})
|
|
2838
|
-
}), $i = { ai:
|
|
2854
|
+
}), $i = { ai: ut.ai }, ea = Bt(null);
|
|
2839
2855
|
function ta({ children: e, translations: t }) {
|
|
2840
2856
|
return /* @__PURE__ */ Y(ea.Provider, {
|
|
2841
2857
|
value: t,
|
|
@@ -2843,7 +2859,7 @@ function ta({ children: e, translations: t }) {
|
|
|
2843
2859
|
});
|
|
2844
2860
|
}
|
|
2845
2861
|
function na() {
|
|
2846
|
-
let e =
|
|
2862
|
+
let e = Ut(ea);
|
|
2847
2863
|
if (e === null) throw Error("useAiChatTranslations must be used within an AiChatTranslationsProvider");
|
|
2848
2864
|
return e;
|
|
2849
2865
|
}
|
|
@@ -2861,20 +2877,20 @@ function ia(e) {
|
|
|
2861
2877
|
}
|
|
2862
2878
|
//#endregion
|
|
2863
2879
|
//#region src/blocks/ai/F0ClarifyingPanel/components/ConfirmFooter.tsx
|
|
2864
|
-
var aa = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip:
|
|
2865
|
-
let s =
|
|
2880
|
+
var aa = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: i, showSkip: a }) => {
|
|
2881
|
+
let s = p();
|
|
2866
2882
|
return /* @__PURE__ */ X("div", {
|
|
2867
2883
|
className: "flex items-center justify-end gap-3 p-3",
|
|
2868
2884
|
children: [/* @__PURE__ */ Y("div", {
|
|
2869
2885
|
className: "flex items-center",
|
|
2870
|
-
children:
|
|
2886
|
+
children: a && i ? /* @__PURE__ */ Y(o, {
|
|
2871
2887
|
variant: "outline",
|
|
2872
2888
|
type: "button",
|
|
2873
2889
|
label: s.ai.clarifyingQuestion.skip,
|
|
2874
|
-
onClick:
|
|
2890
|
+
onClick: i,
|
|
2875
2891
|
disabled: t
|
|
2876
2892
|
}) : null
|
|
2877
|
-
}), /* @__PURE__ */ Y(
|
|
2893
|
+
}), /* @__PURE__ */ Y(o, {
|
|
2878
2894
|
disabled: !e || t,
|
|
2879
2895
|
variant: "default",
|
|
2880
2896
|
type: "button",
|
|
@@ -2885,19 +2901,19 @@ var aa = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: a,
|
|
|
2885
2901
|
}, oa = ({ isSelected: e }) => /* @__PURE__ */ Y("div", {
|
|
2886
2902
|
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
2903
|
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
|
|
2890
|
-
|
|
2904
|
+
}), sa = 132, ca = ({ mode: e, hasSelection: t, hasCustomText: n, customAnswerText: i, isCustomAnswerActive: a, canProceed: o, inputRef: s, onActivate: c, onChangeText: l, onToggleActive: u, onConfirm: d }) => {
|
|
2905
|
+
let f = p().ai.clarifyingQuestion.typeYourAnswer, m = K(null), h = r(m, s);
|
|
2906
|
+
Kt(() => {
|
|
2891
2907
|
let e = m.current;
|
|
2892
2908
|
if (!e) return;
|
|
2893
2909
|
e.style.height = "auto";
|
|
2894
2910
|
let t = Math.min(e.scrollHeight, sa);
|
|
2895
2911
|
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > sa ? "auto" : "hidden";
|
|
2896
|
-
}, [
|
|
2897
|
-
let g = e === "single" ? /* @__PURE__ */ Y(oa, { isSelected: n && !t }) : /* @__PURE__ */ Y(
|
|
2898
|
-
checked:
|
|
2899
|
-
onCheckedChange: () => u(!
|
|
2900
|
-
title:
|
|
2912
|
+
}, [i]);
|
|
2913
|
+
let g = e === "single" ? /* @__PURE__ */ Y(oa, { isSelected: n && !t }) : /* @__PURE__ */ Y(Mt, {
|
|
2914
|
+
checked: a,
|
|
2915
|
+
onCheckedChange: () => u(!a),
|
|
2916
|
+
title: f,
|
|
2901
2917
|
hideLabel: !0
|
|
2902
2918
|
});
|
|
2903
2919
|
return /* @__PURE__ */ X("div", {
|
|
@@ -2905,14 +2921,14 @@ var aa = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: a,
|
|
|
2905
2921
|
children: [g, /* @__PURE__ */ Y("textarea", {
|
|
2906
2922
|
ref: h,
|
|
2907
2923
|
rows: 1,
|
|
2908
|
-
value:
|
|
2924
|
+
value: i ?? "",
|
|
2909
2925
|
onChange: (e) => l(e.target.value),
|
|
2910
2926
|
onFocus: c,
|
|
2911
2927
|
onKeyDown: (e) => {
|
|
2912
|
-
e.key === "Enter" && !e.shiftKey && o && (e.preventDefault(),
|
|
2928
|
+
e.key === "Enter" && !e.shiftKey && o && (e.preventDefault(), d());
|
|
2913
2929
|
},
|
|
2914
|
-
placeholder:
|
|
2915
|
-
"aria-label":
|
|
2930
|
+
placeholder: f,
|
|
2931
|
+
"aria-label": f,
|
|
2916
2932
|
className: "min-w-0 flex-1 resize-none bg-transparent text-base text-f1-foreground outline-none placeholder:text-f1-foreground-tertiary"
|
|
2917
2933
|
})]
|
|
2918
2934
|
});
|
|
@@ -2933,7 +2949,7 @@ var aa = ({ canProceed: e, submitDisabled: t, label: n, onConfirm: r, onSkip: a,
|
|
|
2933
2949
|
}) : /* @__PURE__ */ X("div", {
|
|
2934
2950
|
ref: o,
|
|
2935
2951
|
className: y("flex cursor-pointer items-center rounded-md pl-2 transition-[background-color,transform] hover:bg-f1-background-secondary active:scale-[0.99]"),
|
|
2936
|
-
children: [/* @__PURE__ */ Y(
|
|
2952
|
+
children: [/* @__PURE__ */ Y(Mt, {
|
|
2937
2953
|
checked: t,
|
|
2938
2954
|
onCheckedChange: () => i(e.id),
|
|
2939
2955
|
title: e.label,
|
|
@@ -2952,21 +2968,21 @@ var ua = [
|
|
|
2952
2968
|
1,
|
|
2953
2969
|
.32,
|
|
2954
2970
|
1
|
|
2955
|
-
], da = .2, fa = .03, pa = 4, ma = ({ mode:
|
|
2956
|
-
let y =
|
|
2957
|
-
if (
|
|
2958
|
-
let
|
|
2959
|
-
return
|
|
2971
|
+
], da = .2, fa = .03, pa = 4, ma = ({ mode: e, question: n, options: r, selectedOptionIds: i, allowCustomAnswer: a, hasSelection: o, hasCustomText: c, customAnswerText: l, isCustomAnswerActive: u, canProceed: d, customInputRef: f, autoFocus: p, onToggleOption: m, onActivateCustom: h, onChangeCustomText: g, onToggleCustomActive: _, onConfirm: v }) => {
|
|
2972
|
+
let y = t(), b = (() => {
|
|
2973
|
+
if (e !== "single") return 0;
|
|
2974
|
+
let t = r.findIndex((e) => i.includes(e.id));
|
|
2975
|
+
return t >= 0 ? t : 0;
|
|
2960
2976
|
})(), [x, S] = q(b), C = K([]);
|
|
2961
2977
|
W(() => {
|
|
2962
|
-
|
|
2978
|
+
p && e === "single" && C.current[x]?.focus();
|
|
2963
2979
|
}, []);
|
|
2964
|
-
let w = (
|
|
2965
|
-
if (
|
|
2980
|
+
let w = (t) => {
|
|
2981
|
+
if (e !== "single") return;
|
|
2966
2982
|
let n = r.length - 1;
|
|
2967
2983
|
if (n < 0) return;
|
|
2968
2984
|
let i;
|
|
2969
|
-
switch (
|
|
2985
|
+
switch (t.key) {
|
|
2970
2986
|
case "ArrowDown":
|
|
2971
2987
|
case "ArrowRight":
|
|
2972
2988
|
i = x >= n ? 0 : x + 1;
|
|
@@ -2983,7 +2999,7 @@ var ua = [
|
|
|
2983
2999
|
break;
|
|
2984
3000
|
default: return;
|
|
2985
3001
|
}
|
|
2986
|
-
|
|
3002
|
+
t.preventDefault(), S(i), C.current[i]?.focus();
|
|
2987
3003
|
}, T = (e) => ({
|
|
2988
3004
|
initial: !y && {
|
|
2989
3005
|
opacity: 0,
|
|
@@ -3001,44 +3017,44 @@ var ua = [
|
|
|
3001
3017
|
});
|
|
3002
3018
|
return /* @__PURE__ */ X("div", {
|
|
3003
3019
|
className: "flex flex-col gap-0 overflow-y-auto px-1.5 pb-1 pt-0.5",
|
|
3004
|
-
role:
|
|
3020
|
+
role: e === "single" ? "radiogroup" : "group",
|
|
3005
3021
|
"aria-label": n,
|
|
3006
|
-
children: [r.map((
|
|
3022
|
+
children: [r.map((t, n) => /* @__PURE__ */ Y(s.div, {
|
|
3007
3023
|
...T(n),
|
|
3008
3024
|
children: /* @__PURE__ */ Y(la, {
|
|
3009
3025
|
ref: (e) => {
|
|
3010
3026
|
C.current[n] = e;
|
|
3011
3027
|
},
|
|
3012
|
-
option:
|
|
3013
|
-
isSelected: i.includes(
|
|
3014
|
-
mode:
|
|
3015
|
-
isTabStop:
|
|
3016
|
-
onToggle:
|
|
3028
|
+
option: t,
|
|
3029
|
+
isSelected: i.includes(t.id),
|
|
3030
|
+
mode: e,
|
|
3031
|
+
isTabStop: e === "single" ? n === x : void 0,
|
|
3032
|
+
onToggle: m,
|
|
3017
3033
|
onKeyNavigate: w
|
|
3018
3034
|
})
|
|
3019
|
-
},
|
|
3035
|
+
}, t.id)), a ? /* @__PURE__ */ Y(s.div, {
|
|
3020
3036
|
...T(r.length),
|
|
3021
3037
|
children: /* @__PURE__ */ Y(ca, {
|
|
3022
|
-
mode:
|
|
3038
|
+
mode: e,
|
|
3023
3039
|
hasSelection: o,
|
|
3024
|
-
hasCustomText:
|
|
3025
|
-
customAnswerText:
|
|
3026
|
-
isCustomAnswerActive:
|
|
3027
|
-
canProceed:
|
|
3028
|
-
inputRef:
|
|
3029
|
-
onActivate:
|
|
3030
|
-
onChangeText:
|
|
3031
|
-
onToggleActive:
|
|
3032
|
-
onConfirm:
|
|
3040
|
+
hasCustomText: c,
|
|
3041
|
+
customAnswerText: l,
|
|
3042
|
+
isCustomAnswerActive: u,
|
|
3043
|
+
canProceed: d,
|
|
3044
|
+
inputRef: f,
|
|
3045
|
+
onActivate: h,
|
|
3046
|
+
onChangeText: g,
|
|
3047
|
+
onToggleActive: _,
|
|
3048
|
+
onConfirm: v
|
|
3033
3049
|
})
|
|
3034
3050
|
}) : null]
|
|
3035
3051
|
});
|
|
3036
|
-
}, ha = ({ question: e, stepLabel: t, isFirstStep:
|
|
3037
|
-
let
|
|
3052
|
+
}, ha = ({ question: e, stepLabel: t, isFirstStep: n, isFinalStep: r, canProceed: i, onBack: a, onNext: s, onCancel: c }) => {
|
|
3053
|
+
let l = p();
|
|
3038
3054
|
return /* @__PURE__ */ X("div", {
|
|
3039
3055
|
className: "flex items-start gap-0.5 pl-4 pr-3",
|
|
3040
3056
|
children: [
|
|
3041
|
-
/* @__PURE__ */ Y(
|
|
3057
|
+
/* @__PURE__ */ Y(v, {
|
|
3042
3058
|
className: "mt-0.5 min-w-0 flex-1 pr-3 text-base font-medium text-f1-foreground",
|
|
3043
3059
|
lines: 3,
|
|
3044
3060
|
children: e
|
|
@@ -3046,38 +3062,38 @@ var ua = [
|
|
|
3046
3062
|
t ? /* @__PURE__ */ X("div", {
|
|
3047
3063
|
className: "flex shrink-0 items-center gap-0.5",
|
|
3048
3064
|
children: [
|
|
3049
|
-
/* @__PURE__ */ Y(
|
|
3065
|
+
/* @__PURE__ */ Y(o, {
|
|
3050
3066
|
variant: "ghost",
|
|
3051
3067
|
size: "sm",
|
|
3052
3068
|
type: "button",
|
|
3053
|
-
onClick:
|
|
3054
|
-
disabled:
|
|
3055
|
-
label:
|
|
3069
|
+
onClick: a,
|
|
3070
|
+
disabled: n,
|
|
3071
|
+
label: l.ai.clarifyingQuestion.back,
|
|
3056
3072
|
hideLabel: !0,
|
|
3057
|
-
icon:
|
|
3073
|
+
icon: Ot
|
|
3058
3074
|
}),
|
|
3059
3075
|
/* @__PURE__ */ Y("span", {
|
|
3060
3076
|
className: "translate-y-px text-sm font-semibold text-f1-foreground-tertiary",
|
|
3061
3077
|
children: t
|
|
3062
3078
|
}),
|
|
3063
|
-
/* @__PURE__ */ Y(
|
|
3079
|
+
/* @__PURE__ */ Y(o, {
|
|
3064
3080
|
variant: "ghost",
|
|
3065
3081
|
size: "sm",
|
|
3066
3082
|
type: "button",
|
|
3067
|
-
onClick:
|
|
3068
|
-
disabled:
|
|
3069
|
-
label:
|
|
3083
|
+
onClick: s,
|
|
3084
|
+
disabled: r || !i,
|
|
3085
|
+
label: l.ai.clarifyingQuestion.next,
|
|
3070
3086
|
hideLabel: !0,
|
|
3071
|
-
icon:
|
|
3087
|
+
icon: Ct
|
|
3072
3088
|
})
|
|
3073
3089
|
]
|
|
3074
3090
|
}) : null,
|
|
3075
|
-
/* @__PURE__ */ Y(
|
|
3091
|
+
/* @__PURE__ */ Y(o, {
|
|
3076
3092
|
variant: "ghost",
|
|
3077
3093
|
size: "sm",
|
|
3078
3094
|
type: "button",
|
|
3079
|
-
onClick:
|
|
3080
|
-
label:
|
|
3095
|
+
onClick: c,
|
|
3096
|
+
label: l.actions.cancel,
|
|
3081
3097
|
hideLabel: !0,
|
|
3082
3098
|
icon: x
|
|
3083
3099
|
})
|
|
@@ -3086,46 +3102,46 @@ var ua = [
|
|
|
3086
3102
|
}, ga = "easeOut", _a = .15, va = .1, ya = ({ clarifyingQuestion: e, isSubmitDisabled: t }) => /* @__PURE__ */ Y(ba, {
|
|
3087
3103
|
clarifyingQuestion: e,
|
|
3088
3104
|
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 ||
|
|
3105
|
+
}), ba = ({ clarifyingQuestion: e, isSubmitDisabled: r }) => {
|
|
3106
|
+
let i = p(), a = t(), { currentStep: o, currentStepIndex: c, totalSteps: l, toggleOption: u, confirm: d, skip: f, cancel: m, back: h, setCustomAnswerText: g, setCustomAnswerActive: _, activateCustomAnswer: v } = e, { question: y, options: b, selectedOptionIds: x, selectionMode: S, optional: C, allowCustomAnswer: w, customAnswerText: T, isCustomAnswerActive: E } = o, D = K(null), O = S ?? "single", ee = l > 1, k = c === 0, A = c === l - 1, j = ee ? i.t("ai.clarifyingQuestion.stepOf", {
|
|
3107
|
+
current: String(c + 1),
|
|
3108
|
+
total: String(l)
|
|
3109
|
+
}) : void 0, M = x.length > 0, N = (T ?? "").trim().length > 0, P = M || E && N || C === !0, F = r === !0 && A, I = () => {
|
|
3110
|
+
F || d();
|
|
3095
3111
|
}, te = () => {
|
|
3096
3112
|
F || f();
|
|
3097
|
-
},
|
|
3113
|
+
}, L = (e) => {
|
|
3098
3114
|
let t = O === "single" && x.includes(e);
|
|
3099
|
-
|
|
3100
|
-
},
|
|
3101
|
-
|
|
3115
|
+
u(e), O === "single" && !A && !t && Promise.resolve().then(d);
|
|
3116
|
+
}, ne = A ? i.ai.clarifyingQuestion.submit : i.ai.clarifyingQuestion.next, R = C === !0 && !M && !(E && N), z = () => {
|
|
3117
|
+
v(), requestAnimationFrame(() => {
|
|
3102
3118
|
D.current?.focus();
|
|
3103
3119
|
});
|
|
3104
|
-
},
|
|
3105
|
-
e.key === "Escape" && (e.preventDefault(),
|
|
3106
|
-
},
|
|
3120
|
+
}, re = (e) => {
|
|
3121
|
+
e.key === "Escape" && (e.preventDefault(), m());
|
|
3122
|
+
}, B = a ? 0 : _a, ie = a ? 0 : va;
|
|
3107
3123
|
return /* @__PURE__ */ X("div", {
|
|
3108
3124
|
className: "flex flex-col",
|
|
3109
|
-
onKeyDown:
|
|
3125
|
+
onKeyDown: re,
|
|
3110
3126
|
children: [/* @__PURE__ */ Y("div", {
|
|
3111
3127
|
className: "flex flex-col gap-3 pt-3",
|
|
3112
|
-
children: /* @__PURE__ */ Y(
|
|
3128
|
+
children: /* @__PURE__ */ Y(n, {
|
|
3113
3129
|
mode: "wait",
|
|
3114
3130
|
initial: !1,
|
|
3115
|
-
children: /* @__PURE__ */ X(
|
|
3131
|
+
children: /* @__PURE__ */ X(s.div, {
|
|
3116
3132
|
className: "flex flex-col gap-2",
|
|
3117
3133
|
initial: { opacity: 0 },
|
|
3118
3134
|
animate: {
|
|
3119
3135
|
opacity: 1,
|
|
3120
3136
|
transition: {
|
|
3121
|
-
duration:
|
|
3137
|
+
duration: B,
|
|
3122
3138
|
ease: ga
|
|
3123
3139
|
}
|
|
3124
3140
|
},
|
|
3125
3141
|
exit: {
|
|
3126
3142
|
opacity: 0,
|
|
3127
3143
|
transition: {
|
|
3128
|
-
duration:
|
|
3144
|
+
duration: ie,
|
|
3129
3145
|
ease: ga
|
|
3130
3146
|
}
|
|
3131
3147
|
},
|
|
@@ -3135,9 +3151,9 @@ var ua = [
|
|
|
3135
3151
|
isFirstStep: k,
|
|
3136
3152
|
isFinalStep: A,
|
|
3137
3153
|
canProceed: P,
|
|
3138
|
-
onBack:
|
|
3139
|
-
onNext:
|
|
3140
|
-
onCancel:
|
|
3154
|
+
onBack: h,
|
|
3155
|
+
onNext: d,
|
|
3156
|
+
onCancel: m
|
|
3141
3157
|
}), /* @__PURE__ */ Y(ma, {
|
|
3142
3158
|
mode: O,
|
|
3143
3159
|
question: y,
|
|
@@ -3150,21 +3166,21 @@ var ua = [
|
|
|
3150
3166
|
isCustomAnswerActive: E,
|
|
3151
3167
|
canProceed: P,
|
|
3152
3168
|
customInputRef: D,
|
|
3153
|
-
onToggleOption:
|
|
3154
|
-
onActivateCustom:
|
|
3155
|
-
onChangeCustomText:
|
|
3156
|
-
onToggleCustomActive:
|
|
3169
|
+
onToggleOption: L,
|
|
3170
|
+
onActivateCustom: z,
|
|
3171
|
+
onChangeCustomText: g,
|
|
3172
|
+
onToggleCustomActive: _,
|
|
3157
3173
|
onConfirm: I
|
|
3158
3174
|
})]
|
|
3159
|
-
},
|
|
3175
|
+
}, c)
|
|
3160
3176
|
})
|
|
3161
3177
|
}), /* @__PURE__ */ Y(aa, {
|
|
3162
3178
|
canProceed: P,
|
|
3163
3179
|
submitDisabled: F,
|
|
3164
|
-
label:
|
|
3180
|
+
label: ne,
|
|
3165
3181
|
onConfirm: I,
|
|
3166
3182
|
onSkip: te,
|
|
3167
|
-
showSkip:
|
|
3183
|
+
showSkip: R
|
|
3168
3184
|
})]
|
|
3169
3185
|
});
|
|
3170
3186
|
};
|
|
@@ -3490,18 +3506,18 @@ var Oa = class {
|
|
|
3490
3506
|
repeatType: "mirror"
|
|
3491
3507
|
};
|
|
3492
3508
|
function Fa(e) {
|
|
3493
|
-
let [t, n] = q(e), r =
|
|
3494
|
-
return
|
|
3509
|
+
let [t, n] = q(e), r = Re(e), i = K(null);
|
|
3510
|
+
return Yt(r, "change", (e) => n(e)), {
|
|
3495
3511
|
value: t,
|
|
3496
3512
|
motionValue: r,
|
|
3497
3513
|
controls: i,
|
|
3498
3514
|
animate: U((e, t) => {
|
|
3499
|
-
i.current =
|
|
3515
|
+
i.current = De(r, e, t);
|
|
3500
3516
|
}, [r])
|
|
3501
3517
|
};
|
|
3502
3518
|
}
|
|
3503
3519
|
function Ia(e, t) {
|
|
3504
|
-
let [n, r] = q(ka), { value: i, animate: a, motionValue: o } = Fa(Ma), { value: s, animate: c } = Fa(Aa), { value: l, animate: u } = Fa(ja), { value: d, animate: f } = Fa(Na), p =
|
|
3520
|
+
let [n, r] = q(ka), { value: i, animate: a, motionValue: o } = Fa(Ma), { value: s, animate: c } = Fa(Aa), { value: l, animate: u } = Fa(ja), { value: d, animate: f } = Fa(Na), p = Jt(t, {
|
|
3505
3521
|
fftSize: 512,
|
|
3506
3522
|
smoothingTimeConstant: .55
|
|
3507
3523
|
});
|
|
@@ -3846,7 +3862,7 @@ function fo({ fs: e, vs: t = Ba, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3846
3862
|
...o ? { arraySize: o } : {}
|
|
3847
3863
|
};
|
|
3848
3864
|
}
|
|
3849
|
-
},
|
|
3865
|
+
}, L = () => {
|
|
3850
3866
|
let e = m.current;
|
|
3851
3867
|
if (e) {
|
|
3852
3868
|
if (n && n.length > 0) {
|
|
@@ -3867,7 +3883,7 @@ function fo({ fs: e, vs: t = Ba, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3867
3883
|
});
|
|
3868
3884
|
} else u && u();
|
|
3869
3885
|
}
|
|
3870
|
-
},
|
|
3886
|
+
}, ne = (e) => {
|
|
3871
3887
|
let t = La.includes(a ?? "highp"), n = `precision ${t ? a : La[1]} float;\n`;
|
|
3872
3888
|
t || f?.($(`wrong precision type ${a}, please make sure to pass one of a valid precision lowp, mediump, highp, by default you shader precision will be set to highp.`));
|
|
3873
3889
|
let r = n.concat(`#define DPR ${l.toFixed(1)}\n`).concat(e.replace(/texture\(/g, "texture2D("));
|
|
@@ -3877,7 +3893,7 @@ function fo({ fs: e, vs: t = Ba, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3877
3893
|
r = uo(r, `uniform ${e.type} ${t}${e.arraySize || ""}; \n`, r.lastIndexOf(n) + n.length), e.isNeeded = !0;
|
|
3878
3894
|
}
|
|
3879
3895
|
return e.includes("mainImage") && (r = r.concat(Ra)), r;
|
|
3880
|
-
},
|
|
3896
|
+
}, R = (e) => {
|
|
3881
3897
|
let t = m.current;
|
|
3882
3898
|
if (!t || !g.current) return;
|
|
3883
3899
|
let n = w.current ? (e - w.current) / 1e3 : 0;
|
|
@@ -3936,20 +3952,20 @@ function fo({ fs: e, vs: t = Ba, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3936
3952
|
t.activeTexture(t.TEXTURE0 + e), t.bindTexture(t.TEXTURE_2D, i), t.uniform1i(s, e), r && n.updateTexture(i, a, o);
|
|
3937
3953
|
}
|
|
3938
3954
|
}
|
|
3939
|
-
},
|
|
3955
|
+
}, z = (e) => {
|
|
3940
3956
|
let t = m.current;
|
|
3941
3957
|
if (!t) return;
|
|
3942
|
-
t.viewport(0, 0, t.drawingBufferWidth, t.drawingBufferHeight), t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), t.bindBuffer(t.ARRAY_BUFFER, h.current), t.vertexAttribPointer(_.current ?? 0, 3, t.FLOAT, !1, 0, 0),
|
|
3958
|
+
t.viewport(0, 0, t.drawingBufferWidth, t.drawingBufferHeight), t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), t.bindBuffer(t.ARRAY_BUFFER, h.current), t.vertexAttribPointer(_.current ?? 0, 3, t.FLOAT, !1, 0, 0), R(e), t.drawArrays(t.TRIANGLE_STRIP, 0, 4);
|
|
3943
3959
|
let n = E.current.iMouse?.value;
|
|
3944
3960
|
if (E.current.iMouse?.isNeeded && c !== 1 && Array.isArray(n)) {
|
|
3945
3961
|
let e = n[0] ?? 0, t = n[1] ?? 0;
|
|
3946
3962
|
n[0] = lo(e, S.current[0] ?? 0, c), n[1] = lo(t, S.current[1] ?? 0, c);
|
|
3947
3963
|
}
|
|
3948
|
-
v.current = requestAnimationFrame(
|
|
3949
|
-
},
|
|
3964
|
+
v.current = requestAnimationFrame(z);
|
|
3965
|
+
}, re = () => {
|
|
3950
3966
|
let e = { passive: !0 };
|
|
3951
3967
|
E.current.iMouse?.isNeeded && p.current && (p.current.addEventListener("mousemove", M, e), p.current.addEventListener("mouseout", N, e), p.current.addEventListener("mouseup", N, e), p.current.addEventListener("mousedown", j, e), p.current.addEventListener("touchmove", M, e), p.current.addEventListener("touchend", N, e), p.current.addEventListener("touchstart", j, e)), E.current.iDeviceOrientation?.isNeeded && window.addEventListener("deviceorientation", A, e), p.current && (T.current = new ResizeObserver(P), T.current.observe(p.current), window.addEventListener("resize", P, e));
|
|
3952
|
-
},
|
|
3968
|
+
}, B = () => {
|
|
3953
3969
|
let e = { passive: !0 };
|
|
3954
3970
|
E.current.iMouse?.isNeeded && p.current && (p.current.removeEventListener("mousemove", M, e), p.current.removeEventListener("mouseout", N, e), p.current.removeEventListener("mouseup", N, e), p.current.removeEventListener("mousedown", j, e), p.current.removeEventListener("touchmove", M, e), p.current.removeEventListener("touchend", N, e), p.current.removeEventListener("touchstart", j, e)), E.current.iDeviceOrientation?.isNeeded && window.removeEventListener("deviceorientation", A, e), T.current && (T.current.disconnect(), window.removeEventListener("resize", P, e));
|
|
3955
3971
|
};
|
|
@@ -3960,7 +3976,7 @@ function fo({ fs: e, vs: t = Ba, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3960
3976
|
function r() {
|
|
3961
3977
|
ee();
|
|
3962
3978
|
let n = m.current;
|
|
3963
|
-
n && p.current && (n.clearColor(...i), n.clearDepth(1), n.enable(n.DEPTH_TEST), n.depthFunc(n.LEQUAL), n.viewport(0, 0, p.current.width, p.current.height), p.current.height = p.current.clientHeight, p.current.width = p.current.clientWidth, te(),
|
|
3979
|
+
n && p.current && (n.clearColor(...i), n.clearDepth(1), n.enable(n.DEPTH_TEST), n.depthFunc(n.LEQUAL), n.viewport(0, 0, p.current.width, p.current.height), p.current.height = p.current.clientHeight, p.current.width = p.current.clientWidth, te(), L(), I(ne(e || za), t || Ba), k(), requestAnimationFrame(z), re(), P());
|
|
3964
3980
|
}
|
|
3965
3981
|
return requestAnimationFrame(r), () => {
|
|
3966
3982
|
let e = m.current;
|
|
@@ -3968,7 +3984,7 @@ function fo({ fs: e, vs: t = Ba, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3968
3984
|
if (e.getExtension("WEBGL_lose_context")?.loseContext(), e.useProgram(null), e.deleteProgram(g.current ?? null), n.length > 0) for (let t of n) e.deleteTexture(t._webglTexture);
|
|
3969
3985
|
g.current = null;
|
|
3970
3986
|
}
|
|
3971
|
-
|
|
3987
|
+
B(), cancelAnimationFrame(v.current ?? 0);
|
|
3972
3988
|
};
|
|
3973
3989
|
}, []), /* @__PURE__ */ Y("canvas", {
|
|
3974
3990
|
ref: p,
|
|
@@ -3981,7 +3997,7 @@ function fo({ fs: e, vs: t = Ba, textures: n = [], uniforms: r, clearColor: i =
|
|
|
3981
3997
|
}
|
|
3982
3998
|
//#endregion
|
|
3983
3999
|
//#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 =
|
|
4000
|
+
var po = "\nconst float TAU = 6.283185;\n\n// Noise for dithering\nvec2 randFibo(vec2 p) {\n p = fract(p * vec2(443.897, 441.423));\n p += dot(p, p.yx + 19.19);\n return fract((p.xx + p.yx) * p.xy);\n}\n\n// Tonemap\nvec3 Tonemap(vec3 x) {\n x *= 4.0;\n return x / (1.0 + x);\n}\n\n// Luma for alpha\nfloat luma(vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\n// RGB to HSV\nvec3 rgb2hsv(vec3 c) {\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n}\n\n// HSV to RGB\nvec3 hsv2rgb(vec3 c) {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n// SDF shapes\nfloat sdCircle(vec2 st, float r) {\n return length(st) - r;\n}\n\nfloat sdLine(vec2 p, float r) {\n float halfLen = r * 2.0;\n vec2 a = vec2(-halfLen, 0.0);\n vec2 b = vec2(halfLen, 0.0);\n vec2 pa = p - a;\n vec2 ba = b - a;\n float h = clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0);\n return length(pa - ba * h);\n}\n\nfloat getSdf(vec2 st) {\n if(uShape == 1.0) return sdCircle(st, uScale);\n else if(uShape == 2.0) return sdLine(st, uScale);\n return sdCircle(st, uScale); // Default\n}\n\nvec2 turb(vec2 pos, float t, float it) {\n // Initial rotation matrix for swirl direction\n mat2 rotation = mat2(0.6, -0.25, 0.25, 0.9);\n // Secondary rotation applied each iteration (approx 53 degree rotation)\n mat2 layerRotation = mat2(0.6, -0.8, 0.8, 0.6);\n\n float frequency = mix(2.0, 15.0, uFrequency);\n float amplitude = uAmplitude;\n float frequencyGrowth = 1.4;\n float animTime = t * 0.1 * uSpeed;\n\n const int LAYERS = 4;\n for(int i = 0; i < LAYERS; i++) {\n // Calculate wave displacement for this layer\n vec2 rotatedPos = pos * rotation;\n vec2 wave = sin(frequency * rotatedPos + float(i) * animTime + it);\n\n // Apply displacement along rotation direction\n pos += (amplitude / frequency) * rotation[0] * wave;\n\n // Evolve parameters for next layer\n rotation *= layerRotation;\n amplitude *= mix(1.0, max(wave.x, wave.y), uVariance);\n frequency *= frequencyGrowth;\n }\n\n return pos;\n}\n\nconst float ITERATIONS = 36.0;\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n vec2 uv = fragCoord / iResolution.xy;\n\n vec3 pp = vec3(0.0);\n vec3 bloom = vec3(0.0);\n float t = iTime * 0.5;\n vec2 pos = uv - 0.5;\n\n vec2 prevPos = turb(pos, t, 0.0 - 1.0 / ITERATIONS);\n float spacing = mix(1.0, TAU, uSpacing);\n\n for(float i = 1.0; i < ITERATIONS + 1.0; i++) {\n float iter = i / ITERATIONS;\n vec2 st = turb(pos, t, iter * spacing);\n float d = abs(getSdf(st));\n float pd = distance(st, prevPos);\n prevPos = st;\n float dynamicBlur = exp2(pd * 2.0 * 1.4426950408889634) - 1.0;\n float ds = smoothstep(0.0, uBlur * 0.05 + max(dynamicBlur * uSmoothing, 0.001), d);\n\n // Shift color based on iteration using uColorScale\n vec3 color = uColor;\n if(uColorShift > 0.01) {\n vec3 hsv = rgb2hsv(color);\n // Shift hue by iteration\n hsv.x = fract(hsv.x + (1.0 - iter) * uColorShift * 0.3);\n color = hsv2rgb(hsv);\n }\n\n float invd = 1.0 / max(d + dynamicBlur, 0.001);\n pp += (ds - 1.0) * color;\n bloom += clamp(invd, 0.0, 250.0) * color;\n }\n\n pp *= 1.0 / ITERATIONS;\n\n vec3 color;\n\n // Dark mode (default)\n if(uMode < 0.5) {\n // use bloom effect\n bloom = bloom / (bloom + 2e4);\n color = (-pp + bloom * 3.0 * uBloom) * 1.2;\n color += (randFibo(fragCoord).x - 0.5) / 255.0;\n color = Tonemap(color);\n float alpha = luma(color) * uMix;\n fragColor = vec4(color * uMix, alpha);\n }\n\n // Light mode\n else {\n // no bloom effect\n color = -pp;\n color += (randFibo(fragCoord).x - 0.5) / 255.0;\n\n // Preserve hue by tone mapping brightness only\n float brightness = length(color);\n vec3 direction = brightness > 0.0 ? color / brightness : color;\n\n // Reinhard on brightness\n float factor = 2.0;\n float mappedBrightness = (brightness * factor) / (1.0 + brightness * factor);\n color = direction * mappedBrightness;\n\n // Boost saturation to compensate for white background bleed-through\n // When alpha < 1.0, white bleeds through making colors look desaturated\n // So we increase saturation to maintain vibrant appearance\n float gray = dot(color, vec3(0.2, 0.5, 0.1));\n float saturationBoost = 3.0;\n color = mix(vec3(gray), color, saturationBoost);\n\n // Clamp between 0-1\n color = clamp(color, 0.0, 1.0);\n\n float alpha = mappedBrightness * clamp(uMix, 1.0, 2.0);\n fragColor = vec4(color, alpha);\n }\n}", mo = c({
|
|
3985
4001
|
base: "aspect-square",
|
|
3986
4002
|
variants: { size: {
|
|
3987
4003
|
icon: "h-[24px]",
|
|
@@ -4107,7 +4123,7 @@ function _o({ size: e = "lg", state: t, color: n, colorShift: r = .05, audioTrac
|
|
|
4107
4123
|
}
|
|
4108
4124
|
//#endregion
|
|
4109
4125
|
//#region src/blocks/ai/F0HILActionConfirmation/F0HILActionConfirmation.tsx
|
|
4110
|
-
var vo = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm: i, cancelText: a, onCancel: o, stackAt: s = "sm" }) => /* @__PURE__ */ Y(
|
|
4126
|
+
var vo = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm: i, cancelText: a, onCancel: o, stackAt: s = "sm" }) => /* @__PURE__ */ Y(L, {
|
|
4111
4127
|
title: e,
|
|
4112
4128
|
description: t,
|
|
4113
4129
|
avatar: n,
|
|
@@ -4120,7 +4136,7 @@ var vo = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4120
4136
|
label: a,
|
|
4121
4137
|
onClick: o
|
|
4122
4138
|
}
|
|
4123
|
-
}), yo =
|
|
4139
|
+
}), yo = c({
|
|
4124
4140
|
base: [
|
|
4125
4141
|
"relative flex flex-col rounded-2xl bg-f1-background",
|
|
4126
4142
|
"border border-solid border-f1-border-secondary",
|
|
@@ -4132,18 +4148,18 @@ var vo = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4132
4148
|
false: "hover:shadow-md"
|
|
4133
4149
|
} },
|
|
4134
4150
|
defaultVariants: { selected: !1 }
|
|
4135
|
-
}), bo =
|
|
4136
|
-
let
|
|
4137
|
-
return /* @__PURE__ */ X(J, { children: [
|
|
4151
|
+
}), bo = c({ base: "text-lg font-semibold text-f1-foreground line-clamp-3" }), xo = c({ base: "text-sm text-f1-foreground-secondary leading-normal" }), So = c({ base: "text-sm font-medium text-f1-foreground leading-normal" }), Co = ({ description: e, isRevealed: r, onAskOne: i }) => {
|
|
4152
|
+
let a = p(), o = t();
|
|
4153
|
+
return /* @__PURE__ */ X(J, { children: [e ? /* @__PURE__ */ Y("span", {
|
|
4138
4154
|
className: y(xo(), "truncate"),
|
|
4139
|
-
children:
|
|
4140
|
-
}) : null, /* @__PURE__ */ Y(
|
|
4155
|
+
children: e
|
|
4156
|
+
}) : null, /* @__PURE__ */ Y(n, { children: i && r ? /* @__PURE__ */ Y(s.div, {
|
|
4141
4157
|
className: "absolute bottom-4 left-4 z-10",
|
|
4142
4158
|
initial: { opacity: 0 },
|
|
4143
4159
|
animate: { opacity: 1 },
|
|
4144
4160
|
exit: { opacity: 0 },
|
|
4145
4161
|
transition: {
|
|
4146
|
-
duration:
|
|
4162
|
+
duration: o ? 0 : .2,
|
|
4147
4163
|
ease: [
|
|
4148
4164
|
.33,
|
|
4149
4165
|
1,
|
|
@@ -4151,11 +4167,11 @@ var vo = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4151
4167
|
1
|
|
4152
4168
|
]
|
|
4153
4169
|
},
|
|
4154
|
-
children: /* @__PURE__ */ Y(
|
|
4170
|
+
children: /* @__PURE__ */ Y(oe, {
|
|
4155
4171
|
size: "md",
|
|
4156
|
-
label:
|
|
4172
|
+
label: a.ai.ask,
|
|
4157
4173
|
onClick: (e) => {
|
|
4158
|
-
e.stopPropagation(),
|
|
4174
|
+
e.stopPropagation(), i();
|
|
4159
4175
|
}
|
|
4160
4176
|
})
|
|
4161
4177
|
}) : null })] });
|
|
@@ -4172,7 +4188,7 @@ var vo = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4172
4188
|
className: y(So()),
|
|
4173
4189
|
children: e
|
|
4174
4190
|
}) : null]
|
|
4175
|
-
}), Eo = ({ balance: e }) => /* @__PURE__ */ Y(
|
|
4191
|
+
}), Eo = ({ balance: e }) => /* @__PURE__ */ Y(Tt, {
|
|
4176
4192
|
amount: e.amount,
|
|
4177
4193
|
percentage: e.percentage ?? void 0,
|
|
4178
4194
|
invertStatus: e.invertStatus,
|
|
@@ -4181,32 +4197,32 @@ var vo = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4181
4197
|
let { label: t } = e;
|
|
4182
4198
|
return e.content === "person" ? /* @__PURE__ */ Y(To, {
|
|
4183
4199
|
label: t,
|
|
4184
|
-
children: /* @__PURE__ */ Y(
|
|
4200
|
+
children: /* @__PURE__ */ Y(mt, {
|
|
4185
4201
|
firstName: e.avatar.firstName,
|
|
4186
4202
|
lastName: e.avatar.lastName,
|
|
4187
4203
|
src: e.avatar.src,
|
|
4188
4204
|
size: "xs"
|
|
4189
4205
|
})
|
|
4190
|
-
}) : e.content === "people" ? /* @__PURE__ */ Y(
|
|
4206
|
+
}) : e.content === "people" ? /* @__PURE__ */ Y(bt, {
|
|
4191
4207
|
type: "person",
|
|
4192
4208
|
avatars: e.avatars,
|
|
4193
4209
|
size: "md",
|
|
4194
4210
|
max: 3
|
|
4195
4211
|
}) : e.content === "team" ? /* @__PURE__ */ Y(To, {
|
|
4196
4212
|
label: t,
|
|
4197
|
-
children: /* @__PURE__ */ Y(
|
|
4213
|
+
children: /* @__PURE__ */ Y(xt, {
|
|
4198
4214
|
name: e.avatar.name,
|
|
4199
4215
|
src: e.avatar.src,
|
|
4200
4216
|
size: "xs"
|
|
4201
4217
|
})
|
|
4202
4218
|
}) : e.content === "company" ? /* @__PURE__ */ Y(To, {
|
|
4203
4219
|
label: t,
|
|
4204
|
-
children: /* @__PURE__ */ Y(
|
|
4220
|
+
children: /* @__PURE__ */ Y(yt, {
|
|
4205
4221
|
name: e.avatar.name,
|
|
4206
4222
|
src: e.avatar.src,
|
|
4207
4223
|
size: "xs"
|
|
4208
4224
|
})
|
|
4209
|
-
}) : e.content === "alert" ? /* @__PURE__ */ Y(
|
|
4225
|
+
}) : e.content === "alert" ? /* @__PURE__ */ Y(Dt, {
|
|
4210
4226
|
text: e.alertLabel,
|
|
4211
4227
|
level: e.level
|
|
4212
4228
|
}) : e.content === "balance" ? /* @__PURE__ */ Y(Eo, { balance: e.balance }) : null;
|
|
@@ -4219,13 +4235,13 @@ var vo = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
4219
4235
|
className: y(bo()),
|
|
4220
4236
|
children: t
|
|
4221
4237
|
}),
|
|
4222
|
-
/* @__PURE__ */ Y(
|
|
4238
|
+
/* @__PURE__ */ Y(s.div, {
|
|
4223
4239
|
className: "flex flex-1 flex-col justify-end gap-2",
|
|
4224
4240
|
animate: { opacity: +!i },
|
|
4225
4241
|
transition: a,
|
|
4226
4242
|
children: /* @__PURE__ */ Y(Do, { ...e })
|
|
4227
4243
|
}),
|
|
4228
|
-
n && !wo.has(r) ? /* @__PURE__ */ Y(
|
|
4244
|
+
n && !wo.has(r) ? /* @__PURE__ */ Y(s.span, {
|
|
4229
4245
|
className: y(So()),
|
|
4230
4246
|
animate: { opacity: +!i },
|
|
4231
4247
|
transition: a,
|
|
@@ -4272,17 +4288,17 @@ var jo = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4272
4288
|
children: e
|
|
4273
4289
|
});
|
|
4274
4290
|
}, No = ({ data: e, label: t, invertStatus: n }) => {
|
|
4275
|
-
let r = `sparkline-gradient-${
|
|
4291
|
+
let r = `sparkline-gradient-${Wt().replace(/:/g, "")}`, i = Ao(e, n), a = ko[i];
|
|
4276
4292
|
return /* @__PURE__ */ Y("div", {
|
|
4277
4293
|
className: "flex flex-1 flex-col",
|
|
4278
4294
|
children: /* @__PURE__ */ X("div", {
|
|
4279
4295
|
className: "relative w-full flex-1",
|
|
4280
4296
|
role: "img",
|
|
4281
4297
|
"aria-label": `Sparkline chart showing ${i} trend`,
|
|
4282
|
-
children: [/* @__PURE__ */ Y(
|
|
4298
|
+
children: [/* @__PURE__ */ Y(se, {
|
|
4283
4299
|
width: "100%",
|
|
4284
4300
|
height: "100%",
|
|
4285
|
-
children: /* @__PURE__ */ X(
|
|
4301
|
+
children: /* @__PURE__ */ X(_e, {
|
|
4286
4302
|
data: e,
|
|
4287
4303
|
margin: {
|
|
4288
4304
|
top: 4,
|
|
@@ -4307,11 +4323,11 @@ var jo = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4307
4323
|
stopOpacity: .02
|
|
4308
4324
|
})]
|
|
4309
4325
|
}) }),
|
|
4310
|
-
/* @__PURE__ */ Y(
|
|
4326
|
+
/* @__PURE__ */ Y(ye, {
|
|
4311
4327
|
hide: !0,
|
|
4312
4328
|
domain: ["dataMin - 1", "dataMax + 1"]
|
|
4313
4329
|
}),
|
|
4314
|
-
/* @__PURE__ */ Y(
|
|
4330
|
+
/* @__PURE__ */ Y(w, {
|
|
4315
4331
|
type: "linear",
|
|
4316
4332
|
dataKey: "value",
|
|
4317
4333
|
stroke: a.stroke,
|
|
@@ -4319,7 +4335,7 @@ var jo = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4319
4335
|
fill: `url(#${r})`,
|
|
4320
4336
|
fillOpacity: 1,
|
|
4321
4337
|
isAnimationActive: !1,
|
|
4322
|
-
dot: (t) => /* @__PURE__ */
|
|
4338
|
+
dot: (t) => /* @__PURE__ */ Vt(jo, {
|
|
4323
4339
|
...t,
|
|
4324
4340
|
key: t.index,
|
|
4325
4341
|
dataLength: e.length,
|
|
@@ -4335,9 +4351,9 @@ var jo = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4335
4351
|
})]
|
|
4336
4352
|
})
|
|
4337
4353
|
});
|
|
4338
|
-
}, Po = H((
|
|
4339
|
-
let { description: r, heading: i, label: a, selected: o = !1, onClick:
|
|
4340
|
-
duration:
|
|
4354
|
+
}, Po = H((e, n) => {
|
|
4355
|
+
let { description: r, heading: i, label: a, selected: o = !1, onClick: c, onAskOne: l, className: u, ...d } = e, [f, p] = q(!1), [m, h] = q(!1), g = f || m, _ = t(), v = g && !!l, x = {
|
|
4356
|
+
duration: _ ? 0 : .2,
|
|
4341
4357
|
ease: [
|
|
4342
4358
|
.33,
|
|
4343
4359
|
1,
|
|
@@ -4345,10 +4361,10 @@ var jo = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4345
4361
|
1
|
|
4346
4362
|
]
|
|
4347
4363
|
}, S = () => {
|
|
4348
|
-
|
|
4364
|
+
c?.();
|
|
4349
4365
|
}, C = (e) => {
|
|
4350
|
-
e.currentTarget === e.target && (e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
4351
|
-
}, w =
|
|
4366
|
+
e.currentTarget === e.target && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), c?.());
|
|
4367
|
+
}, w = f ? "[animation:rotate-gradient_2s_linear_infinite_running]" : "[animation:rotate-gradient_2s_linear_infinite_paused]";
|
|
4352
4368
|
return /* @__PURE__ */ X("div", {
|
|
4353
4369
|
className: "relative",
|
|
4354
4370
|
children: [o ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", {
|
|
@@ -4359,40 +4375,40 @@ var jo = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
4359
4375
|
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))]", w, "opacity-80 blur-sm")
|
|
4360
4376
|
})] }) : null, /* @__PURE__ */ X("div", {
|
|
4361
4377
|
ref: n,
|
|
4362
|
-
role:
|
|
4363
|
-
tabIndex:
|
|
4364
|
-
className: y(yo({ selected: o }), o && "relative border-transparent",
|
|
4365
|
-
onClick:
|
|
4366
|
-
onKeyDown:
|
|
4367
|
-
onMouseEnter: () =>
|
|
4368
|
-
onMouseLeave: () =>
|
|
4369
|
-
onFocus: () =>
|
|
4370
|
-
onBlur: () =>
|
|
4378
|
+
role: c ? "button" : void 0,
|
|
4379
|
+
tabIndex: c ? 0 : void 0,
|
|
4380
|
+
className: y(yo({ selected: o }), o && "relative border-transparent", c && "cursor-pointer select-none", c && b(), u),
|
|
4381
|
+
onClick: c ? S : void 0,
|
|
4382
|
+
onKeyDown: c ? C : void 0,
|
|
4383
|
+
onMouseEnter: () => p(!0),
|
|
4384
|
+
onMouseLeave: () => p(!1),
|
|
4385
|
+
onFocus: () => h(!0),
|
|
4386
|
+
onBlur: () => h(!1),
|
|
4371
4387
|
children: [/* @__PURE__ */ Y(Co, {
|
|
4372
4388
|
description: r,
|
|
4373
|
-
isRevealed:
|
|
4374
|
-
onAskOne:
|
|
4375
|
-
}),
|
|
4389
|
+
isRevealed: g,
|
|
4390
|
+
onAskOne: l
|
|
4391
|
+
}), d.content === "sparkline" ? /* @__PURE__ */ X("div", {
|
|
4376
4392
|
className: "flex flex-1 flex-col gap-2",
|
|
4377
4393
|
children: [/* @__PURE__ */ Y("span", {
|
|
4378
4394
|
className: y(bo()),
|
|
4379
4395
|
children: i
|
|
4380
|
-
}), /* @__PURE__ */ Y(
|
|
4396
|
+
}), /* @__PURE__ */ Y(s.div, {
|
|
4381
4397
|
className: "-ml-4 flex flex-1 flex-col",
|
|
4382
|
-
animate: { opacity: +!
|
|
4398
|
+
animate: { opacity: +!v },
|
|
4383
4399
|
transition: x,
|
|
4384
4400
|
children: /* @__PURE__ */ Y(No, {
|
|
4385
|
-
data:
|
|
4401
|
+
data: d.data,
|
|
4386
4402
|
label: a ?? "",
|
|
4387
|
-
invertStatus:
|
|
4403
|
+
invertStatus: d.invertStatus
|
|
4388
4404
|
})
|
|
4389
4405
|
})]
|
|
4390
4406
|
}) : /* @__PURE__ */ Y(Oo, {
|
|
4391
4407
|
heading: i,
|
|
4392
4408
|
label: a,
|
|
4393
|
-
shouldFadeContent:
|
|
4409
|
+
shouldFadeContent: v,
|
|
4394
4410
|
fadeTransition: x,
|
|
4395
|
-
...
|
|
4411
|
+
...d
|
|
4396
4412
|
})]
|
|
4397
4413
|
})]
|
|
4398
4414
|
});
|
|
@@ -4411,18 +4427,18 @@ var Fo = ["className"], Io = H((e, t) => {
|
|
|
4411
4427
|
});
|
|
4412
4428
|
});
|
|
4413
4429
|
Io.displayName = "F0AiInsightCard";
|
|
4414
|
-
var Lo =
|
|
4430
|
+
var Lo = a(re(Io, () => /* @__PURE__ */ X("div", {
|
|
4415
4431
|
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
4432
|
"aria-busy": "true",
|
|
4417
4433
|
"aria-live": "polite",
|
|
4418
|
-
children: [/* @__PURE__ */ Y(
|
|
4434
|
+
children: [/* @__PURE__ */ Y(d, { className: "h-3 w-3/4 rounded" }), /* @__PURE__ */ X("div", {
|
|
4419
4435
|
className: "flex flex-1 flex-col justify-end gap-2",
|
|
4420
4436
|
children: [/* @__PURE__ */ X("div", {
|
|
4421
4437
|
className: "flex flex-col gap-1.5",
|
|
4422
|
-
children: [/* @__PURE__ */ Y(
|
|
4438
|
+
children: [/* @__PURE__ */ Y(d, { className: "h-5 w-full rounded" }), /* @__PURE__ */ Y(d, { className: "h-5 w-2/3 rounded" })]
|
|
4423
4439
|
}), /* @__PURE__ */ X("div", {
|
|
4424
4440
|
className: "flex items-center gap-1.5",
|
|
4425
|
-
children: [/* @__PURE__ */ Y(
|
|
4441
|
+
children: [/* @__PURE__ */ Y(d, { className: "h-5 w-5 rounded-full" }), /* @__PURE__ */ Y(d, { className: "h-3 w-20 rounded" })]
|
|
4426
4442
|
})]
|
|
4427
4443
|
})]
|
|
4428
4444
|
}))), Ro = [
|
|
@@ -4436,7 +4452,7 @@ var Lo = o(Ne(Io, () => /* @__PURE__ */ X("div", {
|
|
|
4436
4452
|
"sparkline"
|
|
4437
4453
|
], 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
4454
|
function Wo(e) {
|
|
4439
|
-
let { module: t, heading: n, title: r, subtitle:
|
|
4455
|
+
let { module: t, heading: n, title: r, subtitle: i, description: a, seeMoreLabel: s, maxCollapsedDescriptionLength: c = zo } = e, [l, u] = q(!1), d = Wt(), f = K(null), p = Bo(c), m = a.length > p, h = l ? a : Vo(a, p), g = Ho(e) ? e : null, _ = Uo(e);
|
|
4440
4456
|
return W(() => {
|
|
4441
4457
|
l && f.current?.focus();
|
|
4442
4458
|
}, [l]), /* @__PURE__ */ X("section", {
|
|
@@ -4445,7 +4461,7 @@ function Wo(e) {
|
|
|
4445
4461
|
children: [
|
|
4446
4462
|
/* @__PURE__ */ X("div", {
|
|
4447
4463
|
className: "flex items-center gap-3 px-4 py-3",
|
|
4448
|
-
children: [t ? /* @__PURE__ */ Y(
|
|
4464
|
+
children: [t ? /* @__PURE__ */ Y(pt, {
|
|
4449
4465
|
module: t,
|
|
4450
4466
|
size: "md"
|
|
4451
4467
|
}) : null, /* @__PURE__ */ X("div", {
|
|
@@ -4453,9 +4469,9 @@ function Wo(e) {
|
|
|
4453
4469
|
children: [/* @__PURE__ */ Y("h2", {
|
|
4454
4470
|
className: "truncate text-lg font-semibold text-f1-foreground",
|
|
4455
4471
|
children: n
|
|
4456
|
-
}),
|
|
4472
|
+
}), i ? /* @__PURE__ */ Y("p", {
|
|
4457
4473
|
className: "truncate text-base text-f1-foreground-secondary",
|
|
4458
|
-
children:
|
|
4474
|
+
children: i
|
|
4459
4475
|
}) : null]
|
|
4460
4476
|
})]
|
|
4461
4477
|
}),
|
|
@@ -4481,7 +4497,7 @@ function Wo(e) {
|
|
|
4481
4497
|
}),
|
|
4482
4498
|
g ? /* @__PURE__ */ Y("div", {
|
|
4483
4499
|
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(
|
|
4500
|
+
children: /* @__PURE__ */ Y(o, {
|
|
4485
4501
|
type: "button",
|
|
4486
4502
|
label: g.primaryActionLabel,
|
|
4487
4503
|
icon: g.primaryActionIcon,
|
|
@@ -4494,19 +4510,19 @@ function Wo(e) {
|
|
|
4494
4510
|
Wo.displayName = "F0AiProposalCard";
|
|
4495
4511
|
//#endregion
|
|
4496
4512
|
//#region src/blocks/ai/F0AiMessageSources/components/CollapsibleMessage.tsx
|
|
4497
|
-
var Go = ({ icon:
|
|
4498
|
-
let [i, a] = q(!1), o =
|
|
4499
|
-
return /* @__PURE__ */ X(
|
|
4513
|
+
var Go = ({ icon: e, title: n, children: r }) => {
|
|
4514
|
+
let [i, a] = q(!1), o = t();
|
|
4515
|
+
return /* @__PURE__ */ X(F, {
|
|
4500
4516
|
className: "mb-1 w-full",
|
|
4501
4517
|
open: i,
|
|
4502
4518
|
onOpenChange: a,
|
|
4503
|
-
children: [/* @__PURE__ */ X(
|
|
4519
|
+
children: [/* @__PURE__ */ X(me, {
|
|
4504
4520
|
className: "flex w-full items-center text-base text-f1-foreground-secondary transition-colors duration-150 hover:text-f1-foreground [&[data-state=open]>svg]:rotate-90",
|
|
4505
4521
|
children: [
|
|
4506
4522
|
/* @__PURE__ */ Y("span", {
|
|
4507
4523
|
className: "mr-2 *:block",
|
|
4508
|
-
children: /* @__PURE__ */ Y(
|
|
4509
|
-
icon:
|
|
4524
|
+
children: /* @__PURE__ */ Y(u, {
|
|
4525
|
+
icon: e,
|
|
4510
4526
|
className: "block"
|
|
4511
4527
|
})
|
|
4512
4528
|
}),
|
|
@@ -4514,15 +4530,15 @@ var Go = ({ icon: t, title: n, children: r }) => {
|
|
|
4514
4530
|
className: "mr-[2px]",
|
|
4515
4531
|
children: n
|
|
4516
4532
|
}),
|
|
4517
|
-
/* @__PURE__ */ Y(
|
|
4518
|
-
icon:
|
|
4533
|
+
/* @__PURE__ */ Y(u, {
|
|
4534
|
+
icon: Ct,
|
|
4519
4535
|
className: "h-4 w-4 transition-transform duration-200"
|
|
4520
4536
|
})
|
|
4521
4537
|
]
|
|
4522
|
-
}), /* @__PURE__ */ Y(
|
|
4538
|
+
}), /* @__PURE__ */ Y(fe, {
|
|
4523
4539
|
forceMount: !0,
|
|
4524
4540
|
className: "data-[state=open]:mt-3",
|
|
4525
|
-
children: /* @__PURE__ */ Y(
|
|
4541
|
+
children: /* @__PURE__ */ Y(s.div, {
|
|
4526
4542
|
initial: !1,
|
|
4527
4543
|
animate: {
|
|
4528
4544
|
height: i ? "auto" : 0,
|
|
@@ -4543,41 +4559,41 @@ var Go = ({ icon: t, title: n, children: r }) => {
|
|
|
4543
4559
|
})
|
|
4544
4560
|
})]
|
|
4545
4561
|
});
|
|
4546
|
-
}, Ko = (e) =>
|
|
4562
|
+
}, Ko = (e) => N[e] ?? zt, qo = ({ iconName: e }) => e ? /* @__PURE__ */ Y("div", {
|
|
4547
4563
|
className: "mr-1 flex items-center justify-center",
|
|
4548
|
-
children: /* @__PURE__ */ Y(
|
|
4564
|
+
children: /* @__PURE__ */ Y(u, {
|
|
4549
4565
|
icon: Ko(e),
|
|
4550
4566
|
size: "md",
|
|
4551
4567
|
color: "default"
|
|
4552
4568
|
})
|
|
4553
4569
|
}) : null;
|
|
4554
|
-
function Jo({ sources:
|
|
4555
|
-
let r =
|
|
4556
|
-
if (!
|
|
4570
|
+
function Jo({ sources: t, title: n }) {
|
|
4571
|
+
let r = p();
|
|
4572
|
+
if (!t || t.length === 0 || !Array.isArray(t)) return null;
|
|
4557
4573
|
let i = n ?? r.ai.resourcesGroupTitle;
|
|
4558
4574
|
return /* @__PURE__ */ Y(Go, {
|
|
4559
|
-
icon:
|
|
4575
|
+
icon: gt,
|
|
4560
4576
|
title: i,
|
|
4561
4577
|
children: /* @__PURE__ */ Y("div", {
|
|
4562
4578
|
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:
|
|
4579
|
+
children: t.map((t, n) => {
|
|
4580
|
+
let r = /* @__PURE__ */ Y(qo, { iconName: t.icon });
|
|
4581
|
+
return t.link ? /* @__PURE__ */ Y(e, {
|
|
4582
|
+
"aria-label": t.title,
|
|
4583
|
+
href: t.link,
|
|
4568
4584
|
size: "md",
|
|
4569
|
-
target:
|
|
4585
|
+
target: t.targetBlank ? "_blank" : "_self",
|
|
4570
4586
|
variant: "ghost",
|
|
4571
4587
|
className: "justify-start truncate hover:bg-f1-background-hover",
|
|
4572
4588
|
compact: !0,
|
|
4573
4589
|
prepend: r,
|
|
4574
4590
|
children: /* @__PURE__ */ Y("div", {
|
|
4575
4591
|
className: "flex w-full items-start",
|
|
4576
|
-
children:
|
|
4592
|
+
children: t.title
|
|
4577
4593
|
})
|
|
4578
4594
|
}, n) : /* @__PURE__ */ X("div", {
|
|
4579
4595
|
className: "flex min-w-0 flex-1 items-center gap-1 px-[6px] py-1.5 font-medium text-f1-foreground",
|
|
4580
|
-
children: [r,
|
|
4596
|
+
children: [r, t.title]
|
|
4581
4597
|
}, n);
|
|
4582
4598
|
})
|
|
4583
4599
|
})
|
|
@@ -4587,26 +4603,26 @@ Jo.displayName = "F0AiMessageSources";
|
|
|
4587
4603
|
//#endregion
|
|
4588
4604
|
//#region src/addons/ai/ai/F0AiTableCard/F0AiTableCard.tsx
|
|
4589
4605
|
async function Yo(e, t, n) {
|
|
4590
|
-
let r =
|
|
4606
|
+
let r = O(e), i = t === "xlsx" ? await rt([{
|
|
4591
4607
|
name: "Data",
|
|
4592
4608
|
rows: r
|
|
4593
|
-
}]) : await
|
|
4594
|
-
|
|
4609
|
+
}]) : await it(r);
|
|
4610
|
+
ce(i, `${n}.${t}`);
|
|
4595
4611
|
}
|
|
4596
|
-
function Xo({ dataset: e, title: t, filename:
|
|
4597
|
-
let
|
|
4598
|
-
if (!
|
|
4599
|
-
let t =
|
|
4600
|
-
Yo(
|
|
4601
|
-
}, [
|
|
4602
|
-
return e.columns?.length ? /* @__PURE__ */ X(
|
|
4612
|
+
function Xo({ dataset: e, title: t, filename: n }) {
|
|
4613
|
+
let r = p(), i = K(null), a = t ?? r.ai.aiTable.title, o = U((e) => {
|
|
4614
|
+
if (!i.current) return;
|
|
4615
|
+
let t = n ?? (a.replace(/\s+/g, "_").toLowerCase() || "table");
|
|
4616
|
+
Yo(i.current, e, t);
|
|
4617
|
+
}, [a, n]);
|
|
4618
|
+
return e.columns?.length ? /* @__PURE__ */ X(ht, {
|
|
4603
4619
|
display: "flex",
|
|
4604
4620
|
flexDirection: "column",
|
|
4605
4621
|
gap: "md",
|
|
4606
4622
|
borderRadius: "md",
|
|
4607
4623
|
border: "default",
|
|
4608
4624
|
borderColor: "secondary",
|
|
4609
|
-
children: [/* @__PURE__ */ X(
|
|
4625
|
+
children: [/* @__PURE__ */ X(ht, {
|
|
4610
4626
|
display: "flex",
|
|
4611
4627
|
alignItems: "center",
|
|
4612
4628
|
justifyContent: "between",
|
|
@@ -4616,38 +4632,38 @@ function Xo({ dataset: e, title: t, filename: r }) {
|
|
|
4616
4632
|
borderColor: "secondary",
|
|
4617
4633
|
paddingX: "md",
|
|
4618
4634
|
paddingY: "sm",
|
|
4619
|
-
children: [/* @__PURE__ */ Y(
|
|
4635
|
+
children: [/* @__PURE__ */ Y(v, {
|
|
4620
4636
|
tag: "h2",
|
|
4621
4637
|
className: "text-base font-medium capitalize text-f1-foreground",
|
|
4622
|
-
children:
|
|
4623
|
-
}), /* @__PURE__ */ Y(
|
|
4624
|
-
icon:
|
|
4638
|
+
children: a
|
|
4639
|
+
}), /* @__PURE__ */ Y(be, {
|
|
4640
|
+
icon: B,
|
|
4625
4641
|
size: "md",
|
|
4626
4642
|
items: [{
|
|
4627
|
-
label:
|
|
4628
|
-
icon:
|
|
4629
|
-
onClick: () =>
|
|
4643
|
+
label: r.ai.aiTable.downloadExcel,
|
|
4644
|
+
icon: B,
|
|
4645
|
+
onClick: () => o("xlsx")
|
|
4630
4646
|
}, {
|
|
4631
|
-
label:
|
|
4632
|
-
icon:
|
|
4633
|
-
onClick: () =>
|
|
4647
|
+
label: r.ai.aiTable.downloadCsv,
|
|
4648
|
+
icon: B,
|
|
4649
|
+
onClick: () => o("csv")
|
|
4634
4650
|
}]
|
|
4635
4651
|
})]
|
|
4636
|
-
}), /* @__PURE__ */ Y(
|
|
4652
|
+
}), /* @__PURE__ */ Y(ht, {
|
|
4637
4653
|
overflowX: "auto",
|
|
4638
4654
|
children: /* @__PURE__ */ X("table", {
|
|
4639
|
-
ref:
|
|
4655
|
+
ref: i,
|
|
4640
4656
|
className: y("w-full border-separate border-spacing-0 text-md", "[&_tbody_tr:last-child_td]:border-b-0"),
|
|
4641
4657
|
children: [/* @__PURE__ */ Y("thead", { children: /* @__PURE__ */ Y("tr", { children: e.columns.map((t) => /* @__PURE__ */ Y("th", {
|
|
4642
4658
|
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
4659
|
children: e.columnLabels?.[t] ?? t
|
|
4644
|
-
}, t)) }) }), /* @__PURE__ */ Y("tbody", { children: e.rows.map((t,
|
|
4645
|
-
let
|
|
4660
|
+
}, t)) }) }), /* @__PURE__ */ Y("tbody", { children: e.rows.map((t, n) => /* @__PURE__ */ Y("tr", { children: e.columns.map((e) => {
|
|
4661
|
+
let n = t[e];
|
|
4646
4662
|
return /* @__PURE__ */ Y("td", {
|
|
4647
4663
|
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(
|
|
4664
|
+
children: /* @__PURE__ */ Y(v, { children: n == null ? "" : String(n) })
|
|
4649
4665
|
}, e);
|
|
4650
|
-
}) },
|
|
4666
|
+
}) }, n)) })]
|
|
4651
4667
|
})
|
|
4652
4668
|
})]
|
|
4653
4669
|
}) : null;
|
|
@@ -4656,11 +4672,11 @@ Xo.displayName = "F0AiTableCard";
|
|
|
4656
4672
|
//#endregion
|
|
4657
4673
|
//#region src/addons/ai/ai/F0AiChatHeader/components/CreditsPopover.tsx
|
|
4658
4674
|
function Zo({ credits: e, trigger: t }) {
|
|
4659
|
-
let
|
|
4660
|
-
|
|
4661
|
-
g(e),
|
|
4675
|
+
let n = p(), [r, a] = q(!1), [c, u] = q(!1), [d, f] = q(!1), [m, g] = q(null), y = U((t) => {
|
|
4676
|
+
a(t), t && e?.fetchUsage && (u(!0), f(!1), e.fetchUsage().then((e) => {
|
|
4677
|
+
g(e), f(!1);
|
|
4662
4678
|
}).catch(() => {
|
|
4663
|
-
|
|
4679
|
+
f(!0);
|
|
4664
4680
|
}).finally(() => {
|
|
4665
4681
|
u(!1);
|
|
4666
4682
|
}));
|
|
@@ -4668,16 +4684,16 @@ function Zo({ credits: e, trigger: t }) {
|
|
|
4668
4684
|
if (!e) return null;
|
|
4669
4685
|
let b = m ? Math.min(100, Math.round(m.used / m.total * 100)) : 0, x = e.companyName;
|
|
4670
4686
|
return /* @__PURE__ */ X(h, {
|
|
4671
|
-
open:
|
|
4687
|
+
open: r,
|
|
4672
4688
|
onOpenChange: y,
|
|
4673
|
-
children: [/* @__PURE__ */ Y(
|
|
4689
|
+
children: [/* @__PURE__ */ Y(i, {
|
|
4674
4690
|
asChild: !0,
|
|
4675
4691
|
children: t ?? /* @__PURE__ */ Y(_, {
|
|
4676
4692
|
variant: "ghost",
|
|
4677
4693
|
hideLabel: !0,
|
|
4678
|
-
label:
|
|
4679
|
-
icon:
|
|
4680
|
-
pressed:
|
|
4694
|
+
label: n.t("ai.credits.title"),
|
|
4695
|
+
icon: Ke,
|
|
4696
|
+
pressed: r
|
|
4681
4697
|
})
|
|
4682
4698
|
}), /* @__PURE__ */ X(l, {
|
|
4683
4699
|
side: "bottom",
|
|
@@ -4688,17 +4704,17 @@ function Zo({ credits: e, trigger: t }) {
|
|
|
4688
4704
|
className: "flex w-[324px] flex-col gap-3 rounded-md border border-solid border-f1-border-secondary p-3",
|
|
4689
4705
|
children: [x ? /* @__PURE__ */ X("div", {
|
|
4690
4706
|
className: "flex min-w-0 max-w-full flex-1 items-center gap-2 overflow-hidden text-left text-lg text-f1-foreground",
|
|
4691
|
-
children: [/* @__PURE__ */ Y(
|
|
4707
|
+
children: [/* @__PURE__ */ Y(yt, {
|
|
4692
4708
|
name: e.companyName ?? "",
|
|
4693
4709
|
src: e.companyLogoUrl,
|
|
4694
4710
|
size: "lg"
|
|
4695
4711
|
}), /* @__PURE__ */ X("div", {
|
|
4696
4712
|
className: "flex min-w-0 flex-col",
|
|
4697
|
-
children: [/* @__PURE__ */ Y(
|
|
4713
|
+
children: [/* @__PURE__ */ Y(v, {
|
|
4698
4714
|
tag: "span",
|
|
4699
4715
|
className: "font-medium",
|
|
4700
4716
|
children: e.companyName ?? ""
|
|
4701
|
-
}), e.planName ? /* @__PURE__ */ Y(
|
|
4717
|
+
}), e.planName ? /* @__PURE__ */ Y(v, {
|
|
4702
4718
|
tag: "span",
|
|
4703
4719
|
className: "text-sm font-medium text-f1-foreground-secondary",
|
|
4704
4720
|
children: e.planName
|
|
@@ -4723,26 +4739,26 @@ function Zo({ credits: e, trigger: t }) {
|
|
|
4723
4739
|
})
|
|
4724
4740
|
]
|
|
4725
4741
|
}) : null,
|
|
4726
|
-
|
|
4742
|
+
d ? /* @__PURE__ */ Y("span", {
|
|
4727
4743
|
className: "text-sm text-f1-foreground-secondary",
|
|
4728
|
-
children:
|
|
4744
|
+
children: n.t("ai.credits.creditsError")
|
|
4729
4745
|
}) : null,
|
|
4730
|
-
!c && !
|
|
4746
|
+
!c && !d && m ? /* @__PURE__ */ X(J, { children: [
|
|
4731
4747
|
/* @__PURE__ */ X("div", {
|
|
4732
4748
|
className: "flex justify-between",
|
|
4733
4749
|
children: [/* @__PURE__ */ Y("span", {
|
|
4734
4750
|
className: "text-base font-medium text-f1-foreground",
|
|
4735
|
-
children:
|
|
4751
|
+
children: n.t("ai.credits.title")
|
|
4736
4752
|
}), /* @__PURE__ */ Y("span", {
|
|
4737
4753
|
className: "font-medium text-f1-foreground-secondary",
|
|
4738
|
-
children:
|
|
4754
|
+
children: n.t("ai.credits.creditsLeft", { total: Math.max(0, m.total - m.used).toLocaleString() })
|
|
4739
4755
|
})]
|
|
4740
4756
|
}),
|
|
4741
4757
|
/* @__PURE__ */ Y("div", {
|
|
4742
4758
|
className: "flex items-center gap-2",
|
|
4743
4759
|
children: /* @__PURE__ */ Y("div", {
|
|
4744
4760
|
className: "relative h-2 w-full overflow-hidden rounded-full bg-f1-background-secondary",
|
|
4745
|
-
children: /* @__PURE__ */ Y(
|
|
4761
|
+
children: /* @__PURE__ */ Y(s.div, {
|
|
4746
4762
|
className: "h-full rounded-full",
|
|
4747
4763
|
style: {
|
|
4748
4764
|
width: `${b}%`,
|
|
@@ -4763,18 +4779,18 @@ function Zo({ credits: e, trigger: t }) {
|
|
|
4763
4779
|
className: "flex items-center gap-1.5",
|
|
4764
4780
|
children: [/* @__PURE__ */ Y("div", { className: "h-2 w-2 rounded-full bg-f1-border" }), /* @__PURE__ */ Y("span", {
|
|
4765
4781
|
className: "text-sm tabular-nums text-f1-foreground-secondary",
|
|
4766
|
-
children:
|
|
4782
|
+
children: n.t("ai.credits.monthlyCredits")
|
|
4767
4783
|
})]
|
|
4768
4784
|
})
|
|
4769
4785
|
] }) : null
|
|
4770
4786
|
]
|
|
4771
4787
|
}), e.upgradePlanUrl ? /* @__PURE__ */ X("div", {
|
|
4772
4788
|
className: "flex items-center justify-between border-0 border-t border-solid border-f1-border-secondary p-3",
|
|
4773
|
-
children: [/* @__PURE__ */ Y("span", { children:
|
|
4789
|
+
children: [/* @__PURE__ */ Y("span", { children: n.t("ai.credits.needMoreCredits") }), /* @__PURE__ */ Y(o, {
|
|
4774
4790
|
variant: "outlinePromote",
|
|
4775
4791
|
href: e.upgradePlanUrl,
|
|
4776
|
-
label:
|
|
4777
|
-
icon:
|
|
4792
|
+
label: n.t("ai.credits.upgradePlan"),
|
|
4793
|
+
icon: he
|
|
4778
4794
|
})]
|
|
4779
4795
|
}) : null]
|
|
4780
4796
|
})]
|
|
@@ -4783,14 +4799,14 @@ function Zo({ credits: e, trigger: t }) {
|
|
|
4783
4799
|
}
|
|
4784
4800
|
//#endregion
|
|
4785
4801
|
//#region src/addons/ai/ai/F0AiChatHeader/components/EmployeeCreditsPopover.tsx
|
|
4786
|
-
var Qo = "linear-gradient(90deg, #E55619, #A1ADE5, #E51943, #E55619)", $o = ({ loading:
|
|
4787
|
-
let i =
|
|
4802
|
+
var Qo = "linear-gradient(90deg, #E55619, #A1ADE5, #E51943, #E55619)", $o = ({ loading: e, error: n, data: r }) => {
|
|
4803
|
+
let i = p(), a = t(), o = r && r.total > 0 ? Math.min(100, Math.round(r.used / r.total * 100)) : 0, c = r ? Math.max(0, r.total - r.used) : 0;
|
|
4788
4804
|
return /* @__PURE__ */ Y("div", {
|
|
4789
4805
|
className: "flex flex-col rounded border border-solid border-f1-border-secondary",
|
|
4790
4806
|
children: /* @__PURE__ */ X("div", {
|
|
4791
4807
|
className: "flex flex-col gap-2 p-3",
|
|
4792
4808
|
children: [
|
|
4793
|
-
|
|
4809
|
+
e ? /* @__PURE__ */ X("div", {
|
|
4794
4810
|
className: "flex flex-col gap-2",
|
|
4795
4811
|
"aria-busy": "true",
|
|
4796
4812
|
"aria-live": "polite",
|
|
@@ -4810,7 +4826,7 @@ var Qo = "linear-gradient(90deg, #E55619, #A1ADE5, #E51943, #E55619)", $o = ({ l
|
|
|
4810
4826
|
className: "text-sm text-f1-foreground-secondary",
|
|
4811
4827
|
children: i.t("ai.credits.creditsError")
|
|
4812
4828
|
}) : null,
|
|
4813
|
-
!
|
|
4829
|
+
!e && !n && r ? /* @__PURE__ */ X("div", {
|
|
4814
4830
|
className: "flex flex-col gap-2",
|
|
4815
4831
|
children: [
|
|
4816
4832
|
/* @__PURE__ */ X("div", {
|
|
@@ -4820,14 +4836,14 @@ var Qo = "linear-gradient(90deg, #E55619, #A1ADE5, #E51943, #E55619)", $o = ({ l
|
|
|
4820
4836
|
children: i.t("ai.credits.employeeCredits")
|
|
4821
4837
|
}), /* @__PURE__ */ Y("span", {
|
|
4822
4838
|
className: "font-medium text-f1-foreground-secondary",
|
|
4823
|
-
children: i.t("ai.credits.creditsLeft", { total:
|
|
4839
|
+
children: i.t("ai.credits.creditsLeft", { total: c.toLocaleString() })
|
|
4824
4840
|
})]
|
|
4825
4841
|
}),
|
|
4826
4842
|
/* @__PURE__ */ Y("div", {
|
|
4827
4843
|
className: "flex items-center gap-2",
|
|
4828
4844
|
children: /* @__PURE__ */ Y("div", {
|
|
4829
4845
|
className: "relative h-2 w-full overflow-hidden rounded-full bg-f1-background-secondary",
|
|
4830
|
-
children: /* @__PURE__ */ Y(
|
|
4846
|
+
children: /* @__PURE__ */ Y(s.div, {
|
|
4831
4847
|
className: "h-full rounded-full",
|
|
4832
4848
|
style: {
|
|
4833
4849
|
width: `${o}%`,
|
|
@@ -4858,28 +4874,28 @@ var Qo = "linear-gradient(90deg, #E55619, #A1ADE5, #E51943, #E55619)", $o = ({ l
|
|
|
4858
4874
|
});
|
|
4859
4875
|
};
|
|
4860
4876
|
function es({ employeeCredits: e, trigger: t }) {
|
|
4861
|
-
let
|
|
4862
|
-
|
|
4863
|
-
|
|
4877
|
+
let n = p(), [r, a] = q(!1), [o, s] = q(!1), [c, u] = q(!1), [d, f] = q(null), m = U((t) => {
|
|
4878
|
+
a(t), t && e?.fetchUsage && (s(!0), u(!1), e.fetchUsage().then((e) => {
|
|
4879
|
+
f(e), u(!1);
|
|
4864
4880
|
}).catch(() => {
|
|
4865
|
-
|
|
4881
|
+
u(!0);
|
|
4866
4882
|
}).finally(() => {
|
|
4867
|
-
|
|
4883
|
+
s(!1);
|
|
4868
4884
|
}));
|
|
4869
4885
|
}, [e]);
|
|
4870
4886
|
if (!e) return null;
|
|
4871
|
-
let
|
|
4887
|
+
let g = !!e.companyName;
|
|
4872
4888
|
return /* @__PURE__ */ X(h, {
|
|
4873
|
-
open:
|
|
4874
|
-
onOpenChange:
|
|
4875
|
-
children: [/* @__PURE__ */ Y(
|
|
4889
|
+
open: r,
|
|
4890
|
+
onOpenChange: m,
|
|
4891
|
+
children: [/* @__PURE__ */ Y(i, {
|
|
4876
4892
|
asChild: !0,
|
|
4877
4893
|
children: t ?? /* @__PURE__ */ Y(_, {
|
|
4878
4894
|
variant: "ghost",
|
|
4879
4895
|
hideLabel: !0,
|
|
4880
|
-
label:
|
|
4881
|
-
icon:
|
|
4882
|
-
pressed:
|
|
4896
|
+
label: n.t("ai.credits.title"),
|
|
4897
|
+
icon: Ke,
|
|
4898
|
+
pressed: r
|
|
4883
4899
|
})
|
|
4884
4900
|
}), /* @__PURE__ */ X(l, {
|
|
4885
4901
|
side: "bottom",
|
|
@@ -4888,28 +4904,28 @@ function es({ employeeCredits: e, trigger: t }) {
|
|
|
4888
4904
|
sideOffset: 4,
|
|
4889
4905
|
collisionPadding: 12,
|
|
4890
4906
|
className: "flex w-[324px] flex-col gap-3 rounded-md border border-solid border-f1-border-secondary p-3",
|
|
4891
|
-
children: [
|
|
4907
|
+
children: [g ? /* @__PURE__ */ X("div", {
|
|
4892
4908
|
className: "flex min-w-0 max-w-full flex-1 items-center gap-2 overflow-hidden text-left text-lg text-f1-foreground",
|
|
4893
|
-
children: [/* @__PURE__ */ Y(
|
|
4909
|
+
children: [/* @__PURE__ */ Y(yt, {
|
|
4894
4910
|
name: e.companyName ?? "",
|
|
4895
4911
|
src: e.companyLogoUrl,
|
|
4896
4912
|
size: "lg"
|
|
4897
4913
|
}), /* @__PURE__ */ X("div", {
|
|
4898
4914
|
className: "flex min-w-0 flex-col",
|
|
4899
|
-
children: [/* @__PURE__ */ Y(
|
|
4915
|
+
children: [/* @__PURE__ */ Y(v, {
|
|
4900
4916
|
tag: "span",
|
|
4901
4917
|
className: "font-medium",
|
|
4902
4918
|
children: e.companyName ?? ""
|
|
4903
|
-
}), e.planName ? /* @__PURE__ */ Y(
|
|
4919
|
+
}), e.planName ? /* @__PURE__ */ Y(v, {
|
|
4904
4920
|
tag: "span",
|
|
4905
4921
|
className: "text-sm font-medium text-f1-foreground-secondary",
|
|
4906
4922
|
children: e.planName
|
|
4907
4923
|
}) : null]
|
|
4908
4924
|
})]
|
|
4909
4925
|
}) : null, /* @__PURE__ */ Y($o, {
|
|
4910
|
-
loading:
|
|
4911
|
-
error:
|
|
4912
|
-
data:
|
|
4926
|
+
loading: o,
|
|
4927
|
+
error: c,
|
|
4928
|
+
data: d
|
|
4913
4929
|
})]
|
|
4914
4930
|
})]
|
|
4915
4931
|
});
|
|
@@ -4922,12 +4938,12 @@ var ts = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
4922
4938
|
}) : e ? /* @__PURE__ */ Y(Zo, {
|
|
4923
4939
|
credits: e,
|
|
4924
4940
|
trigger: n
|
|
4925
|
-
}) : null, ns = ts, rs = ({ historyEnabled:
|
|
4926
|
-
let C =
|
|
4941
|
+
}) : null, ns = ts, rs = ({ historyEnabled: n = !1, title: r, currentThreadTitle: i, fullscreen: a = !1, lockVisualizationMode: o = !1, onToggleVisualizationMode: c, onClose: l, onNewChat: d, onOpenHistory: f, hasMessages: m = !1, credits: h, employeeCredits: g, compact: b = !1, actions: S }) => {
|
|
4942
|
+
let C = p(), w = t(), { panelOverlays: T } = V(), E = !o && !T && /* @__PURE__ */ Y(_, {
|
|
4927
4943
|
variant: "ghost",
|
|
4928
4944
|
hideLabel: !0,
|
|
4929
|
-
label:
|
|
4930
|
-
icon:
|
|
4945
|
+
label: a ? C.ai.collapseChat : C.ai.expandChat,
|
|
4946
|
+
icon: a ? P : ge,
|
|
4931
4947
|
onClick: c
|
|
4932
4948
|
}), D = /* @__PURE__ */ Y(_, {
|
|
4933
4949
|
variant: "ghost",
|
|
@@ -4945,11 +4961,11 @@ var ts = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
4945
4961
|
}, e.id));
|
|
4946
4962
|
return b ? /* @__PURE__ */ X("header", {
|
|
4947
4963
|
className: y("flex items-center justify-between gap-3 pr-4 pl-5 py-3"),
|
|
4948
|
-
children: [/* @__PURE__ */ Y(
|
|
4964
|
+
children: [/* @__PURE__ */ Y(v, {
|
|
4949
4965
|
lines: 1,
|
|
4950
4966
|
className: "min-w-0 flex-1 text-left font-semibold text-f1-foreground",
|
|
4951
|
-
children:
|
|
4952
|
-
}), /* @__PURE__ */ X(
|
|
4967
|
+
children: i ?? C.ai.newConversation
|
|
4968
|
+
}), /* @__PURE__ */ X(s.div, {
|
|
4953
4969
|
className: "flex shrink-0 items-center",
|
|
4954
4970
|
initial: { opacity: 0 },
|
|
4955
4971
|
animate: { opacity: 1 },
|
|
@@ -4963,29 +4979,29 @@ var ts = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
4963
4979
|
D
|
|
4964
4980
|
]
|
|
4965
4981
|
})]
|
|
4966
|
-
}) :
|
|
4982
|
+
}) : n ? /* @__PURE__ */ X("header", {
|
|
4967
4983
|
className: y("flex justify-between pl-2.5 pr-3 py-3 w-full overflow-hidden gap-3"),
|
|
4968
4984
|
children: [/* @__PURE__ */ Y("div", {
|
|
4969
4985
|
className: "flex min-w-0 flex-1 items-center",
|
|
4970
|
-
children:
|
|
4986
|
+
children: o ? null : /* @__PURE__ */ Y(e, {
|
|
4971
4987
|
variant: "ghost",
|
|
4972
4988
|
size: "md",
|
|
4973
4989
|
className: "min-w-0 max-w-full [&>div>span>span]:w-full",
|
|
4974
4990
|
onClick: f,
|
|
4975
4991
|
children: /* @__PURE__ */ X("div", {
|
|
4976
4992
|
className: "flex min-w-0 items-center gap-1",
|
|
4977
|
-
children: [/* @__PURE__ */ Y(
|
|
4993
|
+
children: [/* @__PURE__ */ Y(v, {
|
|
4978
4994
|
lines: 1,
|
|
4979
4995
|
className: "min-w-0 text-left",
|
|
4980
|
-
children:
|
|
4981
|
-
}), /* @__PURE__ */ Y(
|
|
4982
|
-
icon:
|
|
4996
|
+
children: i ?? C.ai.newConversation
|
|
4997
|
+
}), /* @__PURE__ */ Y(u, {
|
|
4998
|
+
icon: _t,
|
|
4983
4999
|
color: "default",
|
|
4984
5000
|
size: "md"
|
|
4985
5001
|
})]
|
|
4986
5002
|
})
|
|
4987
5003
|
})
|
|
4988
|
-
}), /* @__PURE__ */ X(
|
|
5004
|
+
}), /* @__PURE__ */ X(s.div, {
|
|
4989
5005
|
className: "flex shrink-0 items-center",
|
|
4990
5006
|
initial: { opacity: 0 },
|
|
4991
5007
|
animate: { opacity: 1 },
|
|
@@ -5009,9 +5025,9 @@ var ts = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
5009
5025
|
className: "flex items-center",
|
|
5010
5026
|
children: /* @__PURE__ */ Y("h2", {
|
|
5011
5027
|
className: "text-f1-foreground",
|
|
5012
|
-
children:
|
|
5028
|
+
children: r ?? ""
|
|
5013
5029
|
})
|
|
5014
|
-
}), /* @__PURE__ */ X(
|
|
5030
|
+
}), /* @__PURE__ */ X(s.div, {
|
|
5015
5031
|
className: "flex items-center",
|
|
5016
5032
|
initial: { opacity: 0 },
|
|
5017
5033
|
animate: { opacity: 1 },
|
|
@@ -5020,12 +5036,12 @@ var ts = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
5020
5036
|
ease: "easeOut"
|
|
5021
5037
|
},
|
|
5022
5038
|
children: [
|
|
5023
|
-
|
|
5039
|
+
m && !o ? /* @__PURE__ */ Y(_, {
|
|
5024
5040
|
variant: "ghost",
|
|
5025
5041
|
hideLabel: !0,
|
|
5026
5042
|
label: C.ai.startNewChat,
|
|
5027
|
-
icon:
|
|
5028
|
-
onClick:
|
|
5043
|
+
icon: I,
|
|
5044
|
+
onClick: d
|
|
5029
5045
|
}) : null,
|
|
5030
5046
|
/* @__PURE__ */ Y(ts, {
|
|
5031
5047
|
credits: h,
|
|
@@ -5042,14 +5058,14 @@ var ts = ({ credits: e, employeeCredits: t, trigger: n }) => t ? /* @__PURE__ */
|
|
|
5042
5058
|
//#region src/addons/ai/ai/F0AiChatHistory/utils.ts
|
|
5043
5059
|
function is(e) {
|
|
5044
5060
|
let t = new Date(e), n = /* @__PURE__ */ new Date();
|
|
5045
|
-
return
|
|
5061
|
+
return Ge(t) ? "today" : Me(t) ? "yesterday" : jt(t, n) ? "thisMonth" : "older";
|
|
5046
5062
|
}
|
|
5047
5063
|
function as(e, t, n) {
|
|
5048
|
-
let r = new Date(e), i =
|
|
5049
|
-
if (
|
|
5050
|
-
if (
|
|
5051
|
-
let a = !
|
|
5052
|
-
return `${
|
|
5064
|
+
let r = new Date(e), i = Rt(r, "p", { locale: n });
|
|
5065
|
+
if (Ge(r)) return `${t.today}, ${i}`;
|
|
5066
|
+
if (Me(r)) return `${t.yesterday}, ${i}`;
|
|
5067
|
+
let a = !Lt(r, /* @__PURE__ */ new Date());
|
|
5068
|
+
return `${Rt(r, a ? "MMM d yyyy" : "MMM d", { locale: n })}, ${i}`;
|
|
5053
5069
|
}
|
|
5054
5070
|
function os(e) {
|
|
5055
5071
|
let t = {
|
|
@@ -5071,58 +5087,58 @@ function os(e) {
|
|
|
5071
5087
|
}
|
|
5072
5088
|
//#endregion
|
|
5073
5089
|
//#region src/addons/ai/ai/F0AiChatHistory/components/ThreadItem.tsx
|
|
5074
|
-
function ss({ thread: e, isPinned: t, isActive:
|
|
5075
|
-
let
|
|
5076
|
-
label: t ?
|
|
5077
|
-
icon: t ?
|
|
5078
|
-
onClick: () => t ?
|
|
5090
|
+
function ss({ thread: e, isPinned: t, isActive: n = !1, isPending: r = !1, onSelect: i, onPin: a, onUnpin: o, onDelete: s, className: c }) {
|
|
5091
|
+
let l = p(), d = It(), f = G(() => [{
|
|
5092
|
+
label: t ? l.ai.unpinChat : l.ai.pinChat,
|
|
5093
|
+
icon: t ? at : le,
|
|
5094
|
+
onClick: () => t ? o(e.id) : a(e.id)
|
|
5079
5095
|
}, {
|
|
5080
|
-
label:
|
|
5081
|
-
icon:
|
|
5096
|
+
label: l.ai.deleteChat,
|
|
5097
|
+
icon: ne,
|
|
5082
5098
|
critical: !0,
|
|
5083
|
-
onClick: () =>
|
|
5099
|
+
onClick: () => s(e.id)
|
|
5084
5100
|
}], [
|
|
5085
5101
|
t,
|
|
5086
5102
|
e.id,
|
|
5103
|
+
a,
|
|
5087
5104
|
o,
|
|
5088
|
-
s
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
}, f), [
|
|
5105
|
+
s
|
|
5106
|
+
]), m = G(() => as(e.updatedAt, {
|
|
5107
|
+
today: l.ai.today,
|
|
5108
|
+
yesterday: l.ai.yesterday
|
|
5109
|
+
}, d), [
|
|
5094
5110
|
e.updatedAt,
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5111
|
+
l.ai.today,
|
|
5112
|
+
l.ai.yesterday,
|
|
5113
|
+
d
|
|
5098
5114
|
]);
|
|
5099
5115
|
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"),
|
|
5116
|
+
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"), c, n && "bg-f1-background-secondary"),
|
|
5101
5117
|
role: "button",
|
|
5102
5118
|
tabIndex: 0,
|
|
5103
|
-
"aria-current":
|
|
5119
|
+
"aria-current": n ? "true" : void 0,
|
|
5104
5120
|
onKeyDown: (t) => {
|
|
5105
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
5121
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), i(e.id, e.title));
|
|
5106
5122
|
},
|
|
5107
5123
|
children: [
|
|
5108
5124
|
/* @__PURE__ */ X("div", {
|
|
5109
5125
|
className: "flex w-full min-w-0 items-center gap-1",
|
|
5110
|
-
onClick: () =>
|
|
5126
|
+
onClick: () => i(e.id, e.title),
|
|
5111
5127
|
children: [
|
|
5112
|
-
e.icon ? /* @__PURE__ */ Y(
|
|
5128
|
+
e.icon ? /* @__PURE__ */ Y(u, {
|
|
5113
5129
|
icon: e.icon,
|
|
5114
5130
|
size: "sm",
|
|
5115
5131
|
className: "mr-1 shrink-0 text-f1-icon",
|
|
5116
5132
|
"aria-hidden": !0
|
|
5117
5133
|
}) : null,
|
|
5118
|
-
/* @__PURE__ */ Y(
|
|
5134
|
+
/* @__PURE__ */ Y(v, {
|
|
5119
5135
|
lines: 1,
|
|
5120
5136
|
className: "py-0.5 text-left font-medium",
|
|
5121
5137
|
children: e.title
|
|
5122
5138
|
}),
|
|
5123
5139
|
/* @__PURE__ */ Y("span", {
|
|
5124
5140
|
className: "hidden shrink-0 text-sm font-medium text-f1-foreground-tertiary group-focus-within:inline group-hover:inline",
|
|
5125
|
-
children:
|
|
5141
|
+
children: m
|
|
5126
5142
|
})
|
|
5127
5143
|
]
|
|
5128
5144
|
}),
|
|
@@ -5130,19 +5146,19 @@ function ss({ thread: e, isPinned: t, isActive: r = !1, isPending: i = !1, onSel
|
|
|
5130
5146
|
className: "hidden shrink-0 pr-1 text-sm font-medium text-f1-foreground-tertiary group-focus-within:inline group-hover:inline",
|
|
5131
5147
|
children: e.trailingLabel
|
|
5132
5148
|
}) : null,
|
|
5133
|
-
|
|
5149
|
+
r ? /* @__PURE__ */ Y("div", {
|
|
5134
5150
|
className: "flex h-7 w-7 shrink-0 items-center justify-center",
|
|
5135
|
-
"aria-label":
|
|
5136
|
-
children: /* @__PURE__ */ Y(
|
|
5151
|
+
"aria-label": l.ai.threadOptions,
|
|
5152
|
+
children: /* @__PURE__ */ Y(kt, { size: "small" })
|
|
5137
5153
|
}) : /* @__PURE__ */ Y("div", {
|
|
5138
5154
|
className: y("hidden items-center", "group-hover:flex group-focus-within:flex", "has-[[aria-expanded=true]]:flex"),
|
|
5139
|
-
children: /* @__PURE__ */ Y(
|
|
5140
|
-
items:
|
|
5155
|
+
children: /* @__PURE__ */ Y(be, {
|
|
5156
|
+
items: f,
|
|
5141
5157
|
children: /* @__PURE__ */ Y(_, {
|
|
5142
|
-
icon:
|
|
5158
|
+
icon: k,
|
|
5143
5159
|
variant: "ghost",
|
|
5144
5160
|
size: "sm",
|
|
5145
|
-
label:
|
|
5161
|
+
label: l.ai.threadOptions,
|
|
5146
5162
|
hideLabel: !0
|
|
5147
5163
|
})
|
|
5148
5164
|
})
|
|
@@ -5155,20 +5171,20 @@ function ss({ thread: e, isPinned: t, isActive: r = !1, isPending: i = !1, onSel
|
|
|
5155
5171
|
function cs({ label: e, threads: t, pinnedIds: n, onSelect: r, onPin: i, onUnpin: a, onDelete: o }) {
|
|
5156
5172
|
let [s, c] = q(!0), l = U(() => {
|
|
5157
5173
|
c((e) => !e);
|
|
5158
|
-
}, []),
|
|
5174
|
+
}, []), d = U((e) => {
|
|
5159
5175
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), l());
|
|
5160
5176
|
}, [l]);
|
|
5161
5177
|
return /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ X("div", {
|
|
5162
5178
|
role: "button",
|
|
5163
5179
|
tabIndex: 0,
|
|
5164
5180
|
onClick: l,
|
|
5165
|
-
onKeyDown:
|
|
5181
|
+
onKeyDown: d,
|
|
5166
5182
|
className: y("flex cursor-pointer items-center p-3 gap-1 hover:bg-f1-background-hover", b("rounded")),
|
|
5167
5183
|
children: [/* @__PURE__ */ Y("span", {
|
|
5168
5184
|
className: "text-sm font-medium capitalize tracking-wide text-f1-foreground-secondary",
|
|
5169
5185
|
children: e
|
|
5170
|
-
}), /* @__PURE__ */ Y(
|
|
5171
|
-
icon: s ?
|
|
5186
|
+
}), /* @__PURE__ */ Y(u, {
|
|
5187
|
+
icon: s ? _t : wt,
|
|
5172
5188
|
color: "secondary",
|
|
5173
5189
|
size: "xs"
|
|
5174
5190
|
})]
|
|
@@ -5195,12 +5211,12 @@ var ls = [
|
|
|
5195
5211
|
"w-2/3"
|
|
5196
5212
|
], us = ({ width: e }) => /* @__PURE__ */ Y("div", {
|
|
5197
5213
|
className: "flex items-center py-1.5 pl-1.5 pr-2",
|
|
5198
|
-
children: /* @__PURE__ */ Y(
|
|
5214
|
+
children: /* @__PURE__ */ Y(d, { className: y("h-4 rounded", e) })
|
|
5199
5215
|
}), ds = ({ titleWidth: e, rows: t }) => /* @__PURE__ */ X("div", {
|
|
5200
5216
|
className: "flex flex-col gap-0.5",
|
|
5201
5217
|
children: [/* @__PURE__ */ Y("div", {
|
|
5202
5218
|
className: "flex items-center p-1.5",
|
|
5203
|
-
children: /* @__PURE__ */ Y(
|
|
5219
|
+
children: /* @__PURE__ */ Y(d, { className: y("h-3 rounded", e) })
|
|
5204
5220
|
}), t.map((e, t) => /* @__PURE__ */ Y(us, { width: e }, t))]
|
|
5205
5221
|
});
|
|
5206
5222
|
function fs() {
|
|
@@ -5218,105 +5234,105 @@ function fs() {
|
|
|
5218
5234
|
}
|
|
5219
5235
|
//#endregion
|
|
5220
5236
|
//#region src/addons/ai/ai/F0AiChatHistory/F0AiChatHistory.tsx
|
|
5221
|
-
var ps = ({ onClose:
|
|
5222
|
-
let
|
|
5237
|
+
var ps = ({ onClose: t, onSelectThread: n, onNewChat: r, threads: i, isLoading: a, error: o, pinnedIds: s, onPinThread: c, onUnpinThread: l, onDeleteThread: d }) => {
|
|
5238
|
+
let f = p(), [m, h] = q("");
|
|
5223
5239
|
W(() => {
|
|
5224
|
-
let
|
|
5225
|
-
|
|
5240
|
+
let e = (e) => {
|
|
5241
|
+
e.key === "Escape" && t();
|
|
5226
5242
|
};
|
|
5227
|
-
return document.addEventListener("keydown",
|
|
5228
|
-
}, [
|
|
5229
|
-
let
|
|
5230
|
-
today:
|
|
5231
|
-
yesterday:
|
|
5232
|
-
thisMonth:
|
|
5233
|
-
older:
|
|
5243
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
5244
|
+
}, [t]);
|
|
5245
|
+
let g = G(() => ({
|
|
5246
|
+
today: f.ai.today,
|
|
5247
|
+
yesterday: f.ai.yesterday,
|
|
5248
|
+
thisMonth: f.ai.thisMonth,
|
|
5249
|
+
older: f.ai.older
|
|
5234
5250
|
}), [
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
]),
|
|
5240
|
-
if (!
|
|
5241
|
-
let e =
|
|
5242
|
-
return
|
|
5243
|
-
}, [
|
|
5244
|
-
|
|
5245
|
-
}, [
|
|
5246
|
-
|
|
5247
|
-
}, [
|
|
5248
|
-
|
|
5249
|
-
}, [
|
|
5250
|
-
return
|
|
5251
|
+
f.ai.today,
|
|
5252
|
+
f.ai.yesterday,
|
|
5253
|
+
f.ai.thisMonth,
|
|
5254
|
+
f.ai.older
|
|
5255
|
+
]), _ = G(() => {
|
|
5256
|
+
if (!m.trim()) return i;
|
|
5257
|
+
let e = m.toLowerCase();
|
|
5258
|
+
return i.filter((t) => t.title.toLowerCase().includes(e));
|
|
5259
|
+
}, [i, m]), b = G(() => _.filter((e) => s.has(e.id)), [_, s]), x = G(() => _.filter((e) => !s.has(e.id)), [_, s]), S = G(() => os(x), [x]), C = U((e, r) => {
|
|
5260
|
+
n(e, r), t();
|
|
5261
|
+
}, [n, t]), w = U(() => {
|
|
5262
|
+
r(), t();
|
|
5263
|
+
}, [r, t]), T = U((e) => {
|
|
5264
|
+
d(e);
|
|
5265
|
+
}, [d]), E = b.length > 0 || S.length > 0;
|
|
5266
|
+
return qt(/* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", {
|
|
5251
5267
|
className: "fixed inset-0 z-50 bg-f1-background-overlay animate-in fade-in-0",
|
|
5252
|
-
onClick:
|
|
5268
|
+
onClick: t,
|
|
5253
5269
|
"aria-hidden": "true"
|
|
5254
5270
|
}), /* @__PURE__ */ Y("div", {
|
|
5255
5271
|
role: "dialog",
|
|
5256
5272
|
"aria-modal": "true",
|
|
5257
|
-
"aria-label":
|
|
5273
|
+
"aria-label": f.ai.chatHistory,
|
|
5258
5274
|
className: y("fixed inset-0 z-50 flex items-center justify-center", "pointer-events-none", "animate-in fade-in-0 zoom-in-95"),
|
|
5259
5275
|
children: /* @__PURE__ */ X("div", {
|
|
5260
5276
|
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
5277
|
children: [/* @__PURE__ */ X("div", {
|
|
5262
5278
|
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(
|
|
5264
|
-
icon:
|
|
5279
|
+
children: [/* @__PURE__ */ Y(u, {
|
|
5280
|
+
icon: gt,
|
|
5265
5281
|
color: "secondary",
|
|
5266
5282
|
size: "md"
|
|
5267
5283
|
}), /* @__PURE__ */ Y("input", {
|
|
5268
5284
|
type: "text",
|
|
5269
|
-
value:
|
|
5270
|
-
onChange: (e) =>
|
|
5271
|
-
placeholder:
|
|
5285
|
+
value: m,
|
|
5286
|
+
onChange: (e) => h(e.target.value),
|
|
5287
|
+
placeholder: f.ai.searchChats,
|
|
5272
5288
|
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
5289
|
})]
|
|
5274
5290
|
}), /* @__PURE__ */ X("div", {
|
|
5275
5291
|
className: "flex flex-1 flex-col gap-1 overflow-y-auto p-2",
|
|
5276
5292
|
children: [
|
|
5277
|
-
/* @__PURE__ */ Y(
|
|
5293
|
+
/* @__PURE__ */ Y(e, {
|
|
5278
5294
|
variant: "ghost",
|
|
5279
5295
|
size: "md",
|
|
5280
5296
|
className: "py-1 [&>div>span>span]:w-full",
|
|
5281
5297
|
onClick: w,
|
|
5282
5298
|
children: /* @__PURE__ */ X("div", {
|
|
5283
5299
|
className: "flex w-full items-center gap-2",
|
|
5284
|
-
children: [/* @__PURE__ */ Y(
|
|
5285
|
-
icon:
|
|
5300
|
+
children: [/* @__PURE__ */ Y(u, {
|
|
5301
|
+
icon: I,
|
|
5286
5302
|
color: "default",
|
|
5287
5303
|
size: "md"
|
|
5288
|
-
}), /* @__PURE__ */ Y(
|
|
5304
|
+
}), /* @__PURE__ */ Y(v, {
|
|
5289
5305
|
lines: 1,
|
|
5290
5306
|
className: "text-left",
|
|
5291
|
-
children:
|
|
5307
|
+
children: f.ai.startNewChat
|
|
5292
5308
|
})]
|
|
5293
5309
|
})
|
|
5294
5310
|
}),
|
|
5295
|
-
|
|
5296
|
-
!
|
|
5311
|
+
a ? /* @__PURE__ */ Y(fs, {}) : null,
|
|
5312
|
+
!a && o ? /* @__PURE__ */ Y("p", {
|
|
5297
5313
|
className: "py-8 text-center text-base text-f1-foreground-tertiary",
|
|
5298
|
-
children:
|
|
5314
|
+
children: o
|
|
5299
5315
|
}) : null,
|
|
5300
|
-
!
|
|
5316
|
+
!a && !o && !E ? /* @__PURE__ */ Y("p", {
|
|
5301
5317
|
className: "py-8 text-center text-base text-f1-foreground-tertiary",
|
|
5302
|
-
children:
|
|
5318
|
+
children: f.ai.noPreviousChats
|
|
5303
5319
|
}) : null,
|
|
5304
|
-
!
|
|
5305
|
-
label:
|
|
5320
|
+
!a && !o && b.length > 0 ? /* @__PURE__ */ Y(cs, {
|
|
5321
|
+
label: f.ai.pinnedChats,
|
|
5306
5322
|
threads: b,
|
|
5307
|
-
pinnedIds:
|
|
5323
|
+
pinnedIds: s,
|
|
5308
5324
|
onSelect: C,
|
|
5309
|
-
onPin:
|
|
5310
|
-
onUnpin:
|
|
5325
|
+
onPin: c,
|
|
5326
|
+
onUnpin: l,
|
|
5311
5327
|
onDelete: T
|
|
5312
5328
|
}) : null,
|
|
5313
|
-
!
|
|
5314
|
-
label:
|
|
5329
|
+
!a && !o ? S.map((e) => /* @__PURE__ */ Y(cs, {
|
|
5330
|
+
label: g[e.key],
|
|
5315
5331
|
threads: e.threads,
|
|
5316
|
-
pinnedIds:
|
|
5332
|
+
pinnedIds: s,
|
|
5317
5333
|
onSelect: C,
|
|
5318
|
-
onPin:
|
|
5319
|
-
onUnpin:
|
|
5334
|
+
onPin: c,
|
|
5335
|
+
onUnpin: l,
|
|
5320
5336
|
onDelete: T
|
|
5321
5337
|
}, e.key)) : null
|
|
5322
5338
|
]
|
|
@@ -5325,11 +5341,11 @@ var ps = ({ onClose: e, onSelectThread: r, onNewChat: i, threads: a, isLoading:
|
|
|
5325
5341
|
})] }), document.body);
|
|
5326
5342
|
}, ms = "f0-ai-pinned-threads";
|
|
5327
5343
|
function hs() {
|
|
5328
|
-
let e =
|
|
5344
|
+
let e = ve(ms, []);
|
|
5329
5345
|
return new Set(Array.isArray(e) ? e : []);
|
|
5330
5346
|
}
|
|
5331
5347
|
function gs(e) {
|
|
5332
|
-
|
|
5348
|
+
ae(ms, [...e]);
|
|
5333
5349
|
}
|
|
5334
5350
|
function _s({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, unpinThread: i }) {
|
|
5335
5351
|
let [a, o] = q([]), [s, c] = q(!1), [l, u] = q(null), [d, f] = q(hs), [p, m] = q(() => /* @__PURE__ */ new Set()), h = U(async () => {
|
|
@@ -5399,7 +5415,7 @@ function _s({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, u
|
|
|
5399
5415
|
}
|
|
5400
5416
|
//#endregion
|
|
5401
5417
|
//#region src/addons/ai/ai/F0AiChatUsageLimits/types.ts
|
|
5402
|
-
var vs = ["top", "bottom"], ys =
|
|
5418
|
+
var vs = ["top", "bottom"], ys = s.create(ee), bs = ({ label: e, reduceMotion: t }) => /* @__PURE__ */ X("div", {
|
|
5403
5419
|
role: "status",
|
|
5404
5420
|
"aria-live": "polite",
|
|
5405
5421
|
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 +5468,19 @@ var vs = ["top", "bottom"], ys = v.create(re), bs = ({ label: e, reduceMotion: t
|
|
|
5452
5468
|
className: "font-medium",
|
|
5453
5469
|
children: e
|
|
5454
5470
|
})]
|
|
5455
|
-
}), xs =
|
|
5456
|
-
let { t:
|
|
5471
|
+
}), xs = Ht(function({ active: e, label: r, className: i, children: a }) {
|
|
5472
|
+
let { t: o } = p(), c = t(), l = r ?? o("ai.applyingChanges");
|
|
5457
5473
|
return W(() => {
|
|
5458
|
-
if (!
|
|
5459
|
-
let
|
|
5460
|
-
|
|
5461
|
-
}, [
|
|
5462
|
-
className: y("relative flex flex-1 flex-col",
|
|
5463
|
-
children: [/* @__PURE__ */ Y(
|
|
5474
|
+
if (!e) return;
|
|
5475
|
+
let t = document.activeElement;
|
|
5476
|
+
t && t.getAttribute("name") !== "one-ai-input" && t.blur();
|
|
5477
|
+
}, [e]), /* @__PURE__ */ X("div", {
|
|
5478
|
+
className: y("relative flex flex-1 flex-col", i),
|
|
5479
|
+
children: [/* @__PURE__ */ Y(n, { children: e ? /* @__PURE__ */ Y(s.div, {
|
|
5464
5480
|
className: "pointer-events-none sticky top-0 z-50 flex h-0 w-full items-start justify-center overflow-visible",
|
|
5465
5481
|
initial: {
|
|
5466
5482
|
opacity: 0,
|
|
5467
|
-
scale:
|
|
5483
|
+
scale: c ? 1 : .95
|
|
5468
5484
|
},
|
|
5469
5485
|
animate: {
|
|
5470
5486
|
opacity: 1,
|
|
@@ -5472,23 +5488,23 @@ var vs = ["top", "bottom"], ys = v.create(re), bs = ({ label: e, reduceMotion: t
|
|
|
5472
5488
|
},
|
|
5473
5489
|
exit: {
|
|
5474
5490
|
opacity: 0,
|
|
5475
|
-
scale:
|
|
5491
|
+
scale: c ? 1 : .95
|
|
5476
5492
|
},
|
|
5477
5493
|
children: /* @__PURE__ */ Y("div", {
|
|
5478
5494
|
className: "mt-[40vh]",
|
|
5479
5495
|
children: /* @__PURE__ */ Y(bs, {
|
|
5480
|
-
label:
|
|
5481
|
-
reduceMotion:
|
|
5496
|
+
label: l,
|
|
5497
|
+
reduceMotion: c
|
|
5482
5498
|
})
|
|
5483
5499
|
})
|
|
5484
|
-
}) : null }), /* @__PURE__ */ Y(
|
|
5485
|
-
className: y("flex flex-1 flex-col",
|
|
5500
|
+
}) : null }), /* @__PURE__ */ Y(s.div, {
|
|
5501
|
+
className: y("flex flex-1 flex-col", e && "pointer-events-none"),
|
|
5486
5502
|
initial: { filter: "blur(0px)" },
|
|
5487
|
-
animate: { filter:
|
|
5488
|
-
transition: { duration:
|
|
5489
|
-
children:
|
|
5503
|
+
animate: { filter: e ? "blur(2px)" : "blur(0px)" },
|
|
5504
|
+
transition: { duration: c ? 0 : .2 },
|
|
5505
|
+
children: a
|
|
5490
5506
|
})]
|
|
5491
5507
|
});
|
|
5492
5508
|
});
|
|
5493
5509
|
//#endregion
|
|
5494
|
-
export {
|
|
5510
|
+
export { Pr as A, Yi as C, Vr as D, Br as E, Rn as F, jn as I, dn as L, Mr as M, Nr as N, Hr as O, wr as P, Zt as R, $i as S, pi as T, Oa as _, fs as a, ta as b, ns as c, Jo as d, Wo as f, _o as g, vo as h, ps as i, Ar as j, Rr as k, rs as l, Lo as m, vs as n, cs as o, Ro as p, _s as r, ss as s, xs as t, Xo as u, ya as v, xi as w, na as x, ia as y, Xt as z };
|