@oneclick.dev/cms-core-modules 0.0.122 → 0.0.124
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/{ContentEditor-CoJjsV-m.js → ContentEditor-BcIUumah.js} +63 -59
- package/dist/{ContentEditor-DIwqplfB.mjs → ContentEditor-DX1bTQKs.mjs} +27894 -26319
- package/dist/{Detail-Dk8E6_uF.mjs → Detail-B7pe808q.mjs} +15 -14
- package/dist/Detail-BESGmY7z.js +1 -0
- package/dist/{Detail-Cn9Bk0u0.mjs → Detail-B_Q7Qkuz.mjs} +26 -25
- package/dist/Detail-CNiLIEh9.js +1 -0
- package/dist/{Detail-B_scnidb.mjs → Detail-DNxAzeCs.mjs} +35 -34
- package/dist/Detail-t3tOcy3X.js +1 -0
- package/dist/Editor-D4evcdhv.mjs +768 -0
- package/dist/Editor-gLLtuJbY.js +1 -0
- package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-BjKpsqT9.js +1 -0
- package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-D5v5AhLe.mjs +76 -0
- package/dist/Knowledge-B66vxz--.js +1 -0
- package/dist/Knowledge-BnMTTuJ7.mjs +742 -0
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-bZidw6RT.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-8I_Z9cD_.mjs} +530 -530
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BVE_uURZ.js +1 -0
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-BdFa-xNf.mjs +3566 -0
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-DzPOadcU.js +925 -0
- package/dist/Overview-BE4uYPx0.mjs +745 -0
- package/dist/Overview-CQRpFhbJ.mjs +286 -0
- package/dist/Overview-CTs7sX4d.js +1 -0
- package/dist/Overview-Cj89XXKN.js +1 -0
- package/dist/Overview-D_c18mbR.mjs +248 -0
- package/dist/Overview-g4Rcj245.js +1 -0
- package/dist/TableCalculationWidget-CkQPrVUd.js +59 -0
- package/dist/TableCalculationWidget-CrqcLGfU.mjs +254 -0
- package/dist/TableDataWidget-7qvC3Egd.js +1 -0
- package/dist/TableDataWidget-DMTSoGRO.mjs +121 -0
- package/dist/TableOverviewCard-AFq-puJs.js +1 -0
- package/dist/TableOverviewCard-Ci0d4o4w.mjs +391 -0
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs +534 -0
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js +1 -0
- package/dist/TableRowActionCard-BhdnnPaq.mjs +266 -0
- package/dist/TableRowActionCard-IzB6tNN-.js +1 -0
- package/dist/TableView-6mdrL3zx.js +4 -0
- package/dist/TableView-Du5nOE6R.mjs +8228 -0
- package/dist/Test-CzmOmi53.mjs +447 -0
- package/dist/Test-USDtNFY1.js +1 -0
- package/dist/UserDetail-DpUL3mhk.mjs +1483 -0
- package/dist/UserDetail-KRIfxaYd.js +1 -0
- package/dist/{agenda-BCKDYOeF.mjs → agenda-DWdbWUbb.mjs} +10 -9
- package/dist/agenda-r9Gl85GL.js +1 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/dateRangePresets-B-l5b_wR.mjs +48 -0
- package/dist/dateRangePresets-CPWqst_x.js +1 -0
- package/dist/fuse-Deb-Iq39.mjs +1473 -0
- package/dist/fuse-_CGUd5Zq.js +1 -0
- package/dist/{index-DU3Ib10Z.mjs → index-B_qaX29C.mjs} +7 -6
- package/dist/index-CQuN5rKx.js +1 -0
- package/dist/index-CnDGeInm.js +1 -0
- package/dist/index-CqDTc5Ig.mjs +20 -0
- package/dist/index-CyvvAdt4.js +1 -0
- package/dist/index-DIRD7t5_.mjs +20 -0
- package/dist/index-OJuBYR60.mjs +57 -0
- package/dist/{index-Bk3yLv_G.js → index-yHLT6gaZ.js} +3 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +671 -118
- package/dist/{orders-CElKNc1v.mjs → orders-BfTLIm7U.mjs} +10 -9
- package/dist/orders-DUa2PVoa.js +1 -0
- package/dist/reports-ChCsd1Gk.mjs +1107 -0
- package/dist/reports-DmJPm8uP.js +158 -0
- package/dist/row-item-C1dUyimV.mjs +204 -0
- package/dist/row-item-Cyo3m3MZ.js +1 -0
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +1764 -605
- package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +9 -3
- package/dist/src/appointments/components/edit/EventDialog/OrderDetailDialog.vue.d.ts +2 -0
- package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +4 -2
- package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +9 -3
- package/dist/src/appointments/pages/edit/orders.vue.d.ts +9 -3
- package/dist/src/appointments/pages/edit/reports.vue.d.ts +229 -1
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Container.d.ts +1 -1
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Row.d.ts +7 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Stack.d.ts +7 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/resizeHistory.d.ts +9 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/ElementEditorMenu.vue.d.ts +3 -1
- package/dist/src/firebaseAuthManager/components/DeleteUserDialog.vue.d.ts +25 -0
- package/dist/src/firebaseAuthManager/components/ReasonActionDialog.vue.d.ts +23 -0
- package/dist/src/firebaseAuthManager/components/UserStatusBadge.vue.d.ts +5 -0
- package/dist/src/firebaseAuthManager/config.d.ts +151 -0
- package/dist/src/firebaseAuthManager/index.d.ts +163 -0
- package/dist/src/firebaseAuthManager/index.vue.d.ts +14 -0
- package/dist/src/firebaseAuthManager/metadata.d.ts +2 -0
- package/dist/src/firebaseAuthManager/pages/Overview.vue.d.ts +2 -0
- package/dist/src/firebaseAuthManager/pages/UserDetail.vue.d.ts +2 -0
- package/dist/src/firebaseAuthManager/permissions.d.ts +5 -0
- package/dist/src/firebaseAuthManager/routes.d.ts +5 -0
- package/dist/src/firebaseAuthManager/server.d.ts +162 -0
- package/dist/src/firebaseAuthManager/types.d.ts +84 -0
- package/dist/src/formBuilder/components/FormPreviewDialog.vue.d.ts +12 -0
- package/dist/src/formBuilder/components/FormStatusBadge.vue.d.ts +9 -0
- package/dist/src/formBuilder/config.d.ts +31 -0
- package/dist/src/formBuilder/index.d.ts +44 -0
- package/dist/src/formBuilder/index.vue.d.ts +14 -0
- package/dist/src/formBuilder/lib/forms.d.ts +11 -0
- package/dist/src/formBuilder/metadata.d.ts +2 -0
- package/dist/src/formBuilder/pages/Editor.vue.d.ts +2 -0
- package/dist/src/formBuilder/pages/Overview.vue.d.ts +2 -0
- package/dist/src/formBuilder/permissions.d.ts +5 -0
- package/dist/src/formBuilder/routes.d.ts +5 -0
- package/dist/src/formBuilder/server.d.ts +87 -0
- package/dist/src/formBuilder/tools.d.ts +1 -0
- package/dist/src/formBuilder/types.d.ts +46 -0
- package/dist/src/helpbot/composables/useHelpbotApi.d.ts +18 -0
- package/dist/src/helpbot/config.d.ts +17 -0
- package/dist/src/helpbot/index.d.ts +29 -0
- package/dist/src/helpbot/index.vue.d.ts +2 -0
- package/dist/src/helpbot/metadata.d.ts +2 -0
- package/dist/src/helpbot/pages/Knowledge.vue.d.ts +4 -0
- package/dist/src/helpbot/pages/Overview.vue.d.ts +2 -0
- package/dist/src/helpbot/pages/Test.vue.d.ts +4 -0
- package/dist/src/helpbot/permissions.d.ts +5 -0
- package/dist/src/helpbot/routes.d.ts +5 -0
- package/dist/src/helpbot/types.d.ts +42 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/server-handlers.d.ts +2 -0
- package/dist/src/table/chat-components/TableCalculationWidget.vue.d.ts +15 -0
- package/dist/src/table/chat-components/TableDataWidget.vue.d.ts +15 -0
- package/dist/src/table/chat-components/TableOverviewCard.vue.d.ts +61 -0
- package/dist/src/table/chat-components/TableResultView.vue.d.ts +48 -0
- package/dist/src/table/chat-components/TableRowActionCard.vue.d.ts +15 -0
- package/dist/src/table/components/filters/DialogTableFilterOptionItem.vue.d.ts +16 -0
- package/dist/src/table/components/filters/NumberComparisonFilter.vue.d.ts +12 -0
- package/dist/src/table/components/filters/NumberComparisonFilterSettings.vue.d.ts +12 -0
- package/dist/src/table/components/filters/NumberRangeFilter.vue.d.ts +12 -0
- package/dist/src/table/components/filters/NumberRangeFilterSettings.vue.d.ts +12 -0
- package/dist/src/table/components/filters/filter-utils.d.ts +14 -0
- package/dist/src/table/composables/useTableAgentTools.d.ts +33 -0
- package/dist/src/table/index.d.ts +339 -0
- package/dist/src/table/tool-sandbox.d.ts +13 -0
- package/dist/src/table/tool-utils.d.ts +11 -0
- package/dist/src/table/tools.d.ts +333 -1
- package/dist/src/table/types.d.ts +79 -0
- package/dist/tool-sandbox-DdkMLkDK.mjs +182 -0
- package/dist/tool-sandbox-DoF1PsyS.js +115 -0
- package/dist/types-9N-DKxNj.mjs +250 -0
- package/dist/types-BMraG1kN.js +1 -0
- package/dist/types-Cem0vPo_.js +1 -0
- package/dist/types-ibC3-e1N.mjs +2630 -0
- package/dist/useHelpbotApi-BIIungOh.js +1 -0
- package/dist/useHelpbotApi-HC9JSiSn.mjs +229 -0
- package/dist/useTableAgentTools-D5mzGf3A.js +1 -0
- package/dist/useTableAgentTools-DcN3kYRL.mjs +131 -0
- package/dist/vee-validate-zod-BQElPD0m.js +1 -0
- package/dist/vee-validate-zod-CN16K2x9.mjs +1780 -0
- package/package.json +17 -17
- package/src/formBuilder/tools.ts +1 -0
- package/src/table/tools.ts +304 -1
- package/dist/Detail-BCUUNWvp.js +0 -1
- package/dist/Detail-DGg_xXZc.js +0 -1
- package/dist/Detail-Sc2qZdxj.js +0 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BdZbcubW.js +0 -1
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-BYSeUW_V.js +0 -925
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-DwAUYR8p.mjs +0 -5021
- package/dist/TableView-Ctnep-Qu.mjs +0 -6247
- package/dist/TableView-DJqyJL9L.js +0 -4
- package/dist/agenda-B54F8cEr.js +0 -1
- package/dist/orders-BMosTk6r.js +0 -1
- package/dist/reports-BQT_GZzU.js +0 -158
- package/dist/reports-DksZCTOw.mjs +0 -837
- package/dist/vee-validate-zod-SjDT8X35.mjs +0 -4404
- package/dist/vee-validate-zod-VCmLnrtQ.js +0 -1
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
import { defineComponent as de, ref as d, computed as R, onMounted as ue, resolveComponent as x, openBlock as l, createElementBlock as n, createElementVNode as t, createVNode as s, unref as r, createTextVNode as m, createBlock as v, withCtx as a, toDisplayString as u, Fragment as T, createCommentVNode as p, renderList as M, normalizeClass as Z, withKeys as ee, withModifiers as te, resolveDynamicComponent as ce, nextTick as pe } from "vue";
|
|
2
|
+
import { MessageCircleQuestion as me, AlertCircle as L, RefreshCw as xe, Bot as H, Trash2 as ve, ChevronUp as fe, ChevronDown as ge, UserRound as he, Loader2 as U, Send as ye, Search as se, CheckCircle2 as be, BookOpen as le, ArrowRight as ke, FileText as _e } from "lucide-vue-next";
|
|
3
|
+
import { useModuleBreadcrumbs as we, useModuleRoute as Ce } from "@oneclick.dev/cms-kit";
|
|
4
|
+
import { u as ze, g as j } from "./useHelpbotApi-HC9JSiSn.mjs";
|
|
5
|
+
const Te = { class: "mx-auto flex w-full max-w-7xl flex-col gap-6 py-6 @3xl:py-8" }, Se = { class: "max-w-2xl" }, qe = { class: "mb-2 flex items-center gap-2 text-sm font-medium text-primary" }, Ve = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "grid gap-4 @4xl:grid-cols-[minmax(0,1.45fr)_minmax(320px,0.75fr)]"
|
|
8
|
+
}, Ae = { class: "grid size-12 place-items-center rounded-xl bg-destructive/10 text-destructive" }, Be = { class: "mt-1 max-w-md text-sm leading-6 text-muted-foreground" }, Ee = { class: "grid size-12 place-items-center rounded-xl bg-muted text-muted-foreground" }, Me = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "flex items-start gap-3 rounded-xl border border-amber-500/30 bg-amber-500/5 px-4 py-3 text-sm",
|
|
11
|
+
role: "alert"
|
|
12
|
+
}, Le = { class: "grid min-w-0 gap-4 @4xl:grid-cols-[minmax(0,1.45fr)_minmax(320px,0.75fr)]" }, He = { class: "min-w-0" }, Ke = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "m-auto flex max-w-md flex-col items-center px-4 py-12 text-center"
|
|
15
|
+
}, Ne = { class: "grid size-12 place-items-center rounded-2xl bg-primary/10 text-primary" }, $e = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "grid size-7 shrink-0 place-items-center rounded-full bg-primary/10 text-primary"
|
|
18
|
+
}, De = { class: "whitespace-pre-wrap" }, Pe = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "mt-3 border-t border-border/60 pt-2"
|
|
21
|
+
}, Re = ["onClick"], Ue = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "mt-2 space-y-2"
|
|
24
|
+
}, je = { class: "text-xs font-medium" }, Fe = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "mt-1 line-clamp-3 text-xs leading-5 text-muted-foreground"
|
|
27
|
+
}, Ie = {
|
|
28
|
+
key: 1,
|
|
29
|
+
class: "grid size-7 shrink-0 place-items-center rounded-full bg-muted text-muted-foreground"
|
|
30
|
+
}, Qe = {
|
|
31
|
+
key: 1,
|
|
32
|
+
class: "flex items-end gap-2"
|
|
33
|
+
}, Oe = { class: "grid size-7 shrink-0 place-items-center rounded-full bg-primary/10 text-primary" }, We = { class: "flex items-center gap-2 rounded-2xl rounded-bl-md bg-muted px-4 py-3 text-sm text-muted-foreground" }, Ye = {
|
|
34
|
+
key: 2,
|
|
35
|
+
class: "flex items-start gap-2 rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive",
|
|
36
|
+
role: "alert"
|
|
37
|
+
}, Ge = { class: "border-t p-3 @md:p-4" }, Je = { class: "flex items-end gap-2 rounded-xl border bg-background p-2 focus-within:ring-2 focus-within:ring-ring" }, Xe = { class: "flex items-start gap-3" }, Ze = { class: "grid size-9 shrink-0 place-items-center rounded-lg bg-primary/10 text-primary" }, et = { class: "space-y-1.5" }, tt = {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: "flex items-start gap-2 rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive",
|
|
40
|
+
role: "alert"
|
|
41
|
+
}, st = {
|
|
42
|
+
key: 1,
|
|
43
|
+
class: "space-y-2 pt-1"
|
|
44
|
+
}, lt = {
|
|
45
|
+
key: 2,
|
|
46
|
+
class: "space-y-2 pt-1"
|
|
47
|
+
}, ot = { class: "flex items-center gap-2 text-xs font-medium text-emerald-700 dark:text-emerald-300" }, nt = { class: "flex items-center gap-2" }, rt = { class: "min-w-0 truncate text-sm font-medium" }, at = {
|
|
48
|
+
key: 0,
|
|
49
|
+
class: "mt-2 line-clamp-3 text-xs leading-5 text-muted-foreground"
|
|
50
|
+
}, it = {
|
|
51
|
+
key: 3,
|
|
52
|
+
class: "rounded-lg border-2 border-dashed px-4 py-6 text-center"
|
|
53
|
+
}, xt = /* @__PURE__ */ de({
|
|
54
|
+
__name: "Test",
|
|
55
|
+
setup(dt) {
|
|
56
|
+
we(() => [{ text: "Test helpbot" }]);
|
|
57
|
+
const { resolvePath: oe } = Ce(), K = ze(), w = d(null), N = d(!0), S = d(""), h = d([]), b = d(""), y = d(!1), C = d(""), q = d(null), V = d(""), f = d(!1), A = d(!1), B = d(""), k = d([]), $ = R(
|
|
58
|
+
() => w.value?.permissions.canTestHelpbot === !0
|
|
59
|
+
), _ = R(
|
|
60
|
+
() => w.value?.configured !== !1 && w.value?.connected !== !1
|
|
61
|
+
), F = R(
|
|
62
|
+
() => $.value && _.value && !y.value && !!b.value.trim()
|
|
63
|
+
);
|
|
64
|
+
async function I() {
|
|
65
|
+
N.value = !0, S.value = "";
|
|
66
|
+
try {
|
|
67
|
+
w.value = await K.getStatus();
|
|
68
|
+
} catch (c) {
|
|
69
|
+
w.value = null, S.value = j(
|
|
70
|
+
c,
|
|
71
|
+
"The helpbot connection could not be checked."
|
|
72
|
+
);
|
|
73
|
+
} finally {
|
|
74
|
+
N.value = !1;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function Q() {
|
|
78
|
+
pe(() => {
|
|
79
|
+
q.value && (q.value.scrollTop = q.value.scrollHeight);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
async function O() {
|
|
83
|
+
const c = b.value.trim();
|
|
84
|
+
if (!c || !F.value) return;
|
|
85
|
+
const e = h.value.map(({ role: i, content: g }) => ({ role: i, content: g.slice(0, 1e4) })).slice(-20);
|
|
86
|
+
for (; e.length && c.length + e.reduce((i, g) => i + g.content.length, 0) > 6e4; )
|
|
87
|
+
e.shift();
|
|
88
|
+
h.value.push({ role: "user", content: c }), b.value = "", C.value = "", y.value = !0, Q();
|
|
89
|
+
try {
|
|
90
|
+
const i = await K.chat(c, e);
|
|
91
|
+
if (!i.answer) throw new Error("The helpbot returned an empty answer.");
|
|
92
|
+
h.value.push({
|
|
93
|
+
role: "assistant",
|
|
94
|
+
content: i.answer,
|
|
95
|
+
sources: i.sources,
|
|
96
|
+
showSources: !1
|
|
97
|
+
});
|
|
98
|
+
} catch (i) {
|
|
99
|
+
C.value = j(
|
|
100
|
+
i,
|
|
101
|
+
"The helpbot could not answer this question."
|
|
102
|
+
);
|
|
103
|
+
} finally {
|
|
104
|
+
y.value = !1, Q();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function ne() {
|
|
108
|
+
h.value = [], C.value = "", b.value = "";
|
|
109
|
+
}
|
|
110
|
+
async function W() {
|
|
111
|
+
const c = V.value.trim();
|
|
112
|
+
if (!(!c || f.value || !$.value || !_.value)) {
|
|
113
|
+
f.value = !0, A.value = !1, B.value = "", k.value = [];
|
|
114
|
+
try {
|
|
115
|
+
k.value = await K.query(c), A.value = !0;
|
|
116
|
+
} catch (e) {
|
|
117
|
+
B.value = j(
|
|
118
|
+
e,
|
|
119
|
+
"The saved knowledge could not be checked."
|
|
120
|
+
);
|
|
121
|
+
} finally {
|
|
122
|
+
f.value = !1;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function re(c) {
|
|
127
|
+
return c.kind === "pdf" ? _e : le;
|
|
128
|
+
}
|
|
129
|
+
return ue(I), (c, e) => {
|
|
130
|
+
const i = x("Skeleton"), g = x("Button"), D = x("CardContent"), E = x("Card"), Y = x("CardTitle"), G = x("CardDescription"), J = x("CardHeader"), X = x("Textarea"), ae = x("NuxtLink");
|
|
131
|
+
return l(), n("main", Te, [
|
|
132
|
+
t("header", Se, [
|
|
133
|
+
t("div", qe, [
|
|
134
|
+
s(r(me), { class: "size-4" }),
|
|
135
|
+
e[2] || (e[2] = m(" Private workspace ", -1))
|
|
136
|
+
]),
|
|
137
|
+
e[3] || (e[3] = t("h1", { class: "text-2xl font-semibold tracking-tight @2xl:text-3xl" }, "Test your helpbot", -1)),
|
|
138
|
+
e[4] || (e[4] = t("p", { class: "mt-2 text-sm leading-6 text-muted-foreground" }, " Ask questions as a visitor and verify that the reply is supported by your saved knowledge. These tests are not visible on your website. ", -1))
|
|
139
|
+
]),
|
|
140
|
+
N.value ? (l(), n("div", Ve, [
|
|
141
|
+
s(i, { class: "h-[640px] rounded-xl" }),
|
|
142
|
+
s(i, { class: "h-[520px] rounded-xl" })
|
|
143
|
+
])) : S.value ? (l(), v(E, { key: 1 }, {
|
|
144
|
+
default: a(() => [
|
|
145
|
+
s(D, { class: "flex flex-col items-center px-6 py-14 text-center" }, {
|
|
146
|
+
default: a(() => [
|
|
147
|
+
t("div", Ae, [
|
|
148
|
+
s(r(L), { class: "size-6" })
|
|
149
|
+
]),
|
|
150
|
+
e[6] || (e[6] = t("h2", { class: "mt-4 font-semibold" }, "Private test is unavailable", -1)),
|
|
151
|
+
t("p", Be, u(S.value), 1),
|
|
152
|
+
s(g, {
|
|
153
|
+
variant: "outline",
|
|
154
|
+
class: "mt-4",
|
|
155
|
+
onClick: I
|
|
156
|
+
}, {
|
|
157
|
+
default: a(() => [
|
|
158
|
+
s(r(xe), { class: "mr-2 size-4" }),
|
|
159
|
+
e[5] || (e[5] = m(" Try again ", -1))
|
|
160
|
+
]),
|
|
161
|
+
_: 1
|
|
162
|
+
})
|
|
163
|
+
]),
|
|
164
|
+
_: 1
|
|
165
|
+
})
|
|
166
|
+
]),
|
|
167
|
+
_: 1
|
|
168
|
+
})) : $.value ? (l(), n(T, { key: 3 }, [
|
|
169
|
+
_.value ? p("", !0) : (l(), n("div", Me, [
|
|
170
|
+
s(r(L), { class: "mt-0.5 size-4 shrink-0 text-amber-600 dark:text-amber-400" }),
|
|
171
|
+
e[9] || (e[9] = t("div", null, [
|
|
172
|
+
t("p", { class: "font-medium" }, "The helpbot connection needs attention"),
|
|
173
|
+
t("p", { class: "mt-0.5 text-muted-foreground" }, " Private testing will be available after your agency restores the website helpbot connection. ")
|
|
174
|
+
], -1))
|
|
175
|
+
])),
|
|
176
|
+
t("div", Le, [
|
|
177
|
+
s(E, { class: "flex min-h-[620px] min-w-0 flex-col overflow-hidden" }, {
|
|
178
|
+
default: a(() => [
|
|
179
|
+
s(J, { class: "flex-row items-center justify-between gap-4 space-y-0 border-b p-4 @md:p-5" }, {
|
|
180
|
+
default: a(() => [
|
|
181
|
+
t("div", He, [
|
|
182
|
+
s(Y, { class: "text-base" }, {
|
|
183
|
+
default: a(() => [...e[10] || (e[10] = [
|
|
184
|
+
m("Helpbot preview", -1)
|
|
185
|
+
])]),
|
|
186
|
+
_: 1
|
|
187
|
+
}),
|
|
188
|
+
s(G, { class: "mt-1" }, {
|
|
189
|
+
default: a(() => [...e[11] || (e[11] = [
|
|
190
|
+
m(" Uses the knowledge currently available to the connected helpbot. ", -1)
|
|
191
|
+
])]),
|
|
192
|
+
_: 1
|
|
193
|
+
})
|
|
194
|
+
]),
|
|
195
|
+
s(g, {
|
|
196
|
+
variant: "ghost",
|
|
197
|
+
size: "icon",
|
|
198
|
+
class: "shrink-0",
|
|
199
|
+
disabled: h.value.length === 0 || y.value,
|
|
200
|
+
"aria-label": "Clear test conversation",
|
|
201
|
+
onClick: ne
|
|
202
|
+
}, {
|
|
203
|
+
default: a(() => [
|
|
204
|
+
s(r(ve), { class: "size-4" })
|
|
205
|
+
]),
|
|
206
|
+
_: 1
|
|
207
|
+
}, 8, ["disabled"])
|
|
208
|
+
]),
|
|
209
|
+
_: 1
|
|
210
|
+
}),
|
|
211
|
+
t("div", {
|
|
212
|
+
ref_key: "chatContainer",
|
|
213
|
+
ref: q,
|
|
214
|
+
class: "flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-4 @md:p-5",
|
|
215
|
+
"aria-live": "polite"
|
|
216
|
+
}, [
|
|
217
|
+
h.value.length === 0 ? (l(), n("div", Ke, [
|
|
218
|
+
t("div", Ne, [
|
|
219
|
+
s(r(H), { class: "size-6" })
|
|
220
|
+
]),
|
|
221
|
+
e[12] || (e[12] = t("h2", { class: "mt-4 font-semibold" }, "Ask a real visitor question", -1)),
|
|
222
|
+
e[13] || (e[13] = t("p", { class: "mt-1 text-sm leading-6 text-muted-foreground" }, " Try an important question about your services, policies, opening hours, or products. ", -1))
|
|
223
|
+
])) : p("", !0),
|
|
224
|
+
(l(!0), n(T, null, M(h.value, (o, P) => (l(), n("div", {
|
|
225
|
+
key: `${o.role}-${P}`,
|
|
226
|
+
class: Z(["flex items-end gap-2", o.role === "user" ? "justify-end" : "justify-start"])
|
|
227
|
+
}, [
|
|
228
|
+
o.role === "assistant" ? (l(), n("div", $e, [
|
|
229
|
+
s(r(H), { class: "size-3.5" })
|
|
230
|
+
])) : p("", !0),
|
|
231
|
+
t("div", {
|
|
232
|
+
class: Z([
|
|
233
|
+
"max-w-[86%] rounded-2xl px-4 py-3 text-sm leading-6",
|
|
234
|
+
o.role === "user" ? "rounded-br-md bg-primary text-primary-foreground" : "rounded-bl-md bg-muted"
|
|
235
|
+
])
|
|
236
|
+
}, [
|
|
237
|
+
t("p", De, u(o.content), 1),
|
|
238
|
+
o.role === "assistant" && o.sources?.length ? (l(), n("div", Pe, [
|
|
239
|
+
t("button", {
|
|
240
|
+
type: "button",
|
|
241
|
+
class: "flex w-full items-center gap-1.5 text-left text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",
|
|
242
|
+
onClick: (z) => o.showSources = !o.showSources
|
|
243
|
+
}, [
|
|
244
|
+
o.showSources ? (l(), v(r(fe), {
|
|
245
|
+
key: 0,
|
|
246
|
+
class: "size-3.5"
|
|
247
|
+
})) : (l(), v(r(ge), {
|
|
248
|
+
key: 1,
|
|
249
|
+
class: "size-3.5"
|
|
250
|
+
})),
|
|
251
|
+
m(" " + u(o.sources.length) + " supporting source" + u(o.sources.length === 1 ? "" : "s"), 1)
|
|
252
|
+
], 8, Re),
|
|
253
|
+
o.showSources ? (l(), n("div", Ue, [
|
|
254
|
+
(l(!0), n(T, null, M(o.sources, (z, ie) => (l(), n("div", {
|
|
255
|
+
key: `${z.title}-${ie}`,
|
|
256
|
+
class: "rounded-lg border bg-background/70 p-2.5"
|
|
257
|
+
}, [
|
|
258
|
+
t("p", je, u(z.title), 1),
|
|
259
|
+
z.excerpt ? (l(), n("p", Fe, u(z.excerpt), 1)) : p("", !0)
|
|
260
|
+
]))), 128))
|
|
261
|
+
])) : p("", !0)
|
|
262
|
+
])) : p("", !0)
|
|
263
|
+
], 2),
|
|
264
|
+
o.role === "user" ? (l(), n("div", Ie, [
|
|
265
|
+
s(r(he), { class: "size-3.5" })
|
|
266
|
+
])) : p("", !0)
|
|
267
|
+
], 2))), 128)),
|
|
268
|
+
y.value ? (l(), n("div", Qe, [
|
|
269
|
+
t("div", Oe, [
|
|
270
|
+
s(r(H), { class: "size-3.5" })
|
|
271
|
+
]),
|
|
272
|
+
t("div", We, [
|
|
273
|
+
s(r(U), { class: "size-4 animate-spin" }),
|
|
274
|
+
e[14] || (e[14] = m(" Preparing an answer… ", -1))
|
|
275
|
+
])
|
|
276
|
+
])) : p("", !0),
|
|
277
|
+
C.value ? (l(), n("div", Ye, [
|
|
278
|
+
s(r(L), { class: "mt-0.5 size-4 shrink-0" }),
|
|
279
|
+
t("span", null, u(C.value), 1)
|
|
280
|
+
])) : p("", !0)
|
|
281
|
+
], 512),
|
|
282
|
+
t("div", Ge, [
|
|
283
|
+
t("div", Je, [
|
|
284
|
+
s(X, {
|
|
285
|
+
modelValue: b.value,
|
|
286
|
+
"onUpdate:modelValue": e[0] || (e[0] = (o) => b.value = o),
|
|
287
|
+
rows: "2",
|
|
288
|
+
class: "min-h-[44px] flex-1 resize-none border-0 bg-transparent px-2 py-2 shadow-none focus-visible:ring-0",
|
|
289
|
+
placeholder: "Ask a question a visitor might type…",
|
|
290
|
+
disabled: y.value || !_.value,
|
|
291
|
+
maxlength: "10000",
|
|
292
|
+
onKeydown: ee(te(O, ["exact", "prevent"]), ["enter"])
|
|
293
|
+
}, null, 8, ["modelValue", "disabled", "onKeydown"]),
|
|
294
|
+
s(g, {
|
|
295
|
+
size: "icon",
|
|
296
|
+
class: "shrink-0",
|
|
297
|
+
disabled: !F.value,
|
|
298
|
+
"aria-label": "Send test question",
|
|
299
|
+
onClick: O
|
|
300
|
+
}, {
|
|
301
|
+
default: a(() => [
|
|
302
|
+
y.value ? (l(), v(r(U), {
|
|
303
|
+
key: 0,
|
|
304
|
+
class: "size-4 animate-spin"
|
|
305
|
+
})) : (l(), v(r(ye), {
|
|
306
|
+
key: 1,
|
|
307
|
+
class: "size-4"
|
|
308
|
+
}))
|
|
309
|
+
]),
|
|
310
|
+
_: 1
|
|
311
|
+
}, 8, ["disabled"])
|
|
312
|
+
]),
|
|
313
|
+
e[15] || (e[15] = t("p", { class: "mt-2 px-1 text-xs text-muted-foreground" }, " Press Enter to send · Shift + Enter for a new line ", -1))
|
|
314
|
+
])
|
|
315
|
+
]),
|
|
316
|
+
_: 1
|
|
317
|
+
}),
|
|
318
|
+
s(E, { class: "h-fit min-w-0" }, {
|
|
319
|
+
default: a(() => [
|
|
320
|
+
s(J, { class: "p-5" }, {
|
|
321
|
+
default: a(() => [
|
|
322
|
+
t("div", Xe, [
|
|
323
|
+
t("div", Ze, [
|
|
324
|
+
s(r(se), { class: "size-4" })
|
|
325
|
+
]),
|
|
326
|
+
t("div", null, [
|
|
327
|
+
s(Y, { class: "text-base" }, {
|
|
328
|
+
default: a(() => [...e[16] || (e[16] = [
|
|
329
|
+
m("Knowledge check", -1)
|
|
330
|
+
])]),
|
|
331
|
+
_: 1
|
|
332
|
+
}),
|
|
333
|
+
s(G, { class: "mt-1 leading-5" }, {
|
|
334
|
+
default: a(() => [...e[17] || (e[17] = [
|
|
335
|
+
m(" See which saved sources can support a question before reviewing the full reply. ", -1)
|
|
336
|
+
])]),
|
|
337
|
+
_: 1
|
|
338
|
+
})
|
|
339
|
+
])
|
|
340
|
+
])
|
|
341
|
+
]),
|
|
342
|
+
_: 1
|
|
343
|
+
}),
|
|
344
|
+
s(D, { class: "space-y-4 px-5 pb-5" }, {
|
|
345
|
+
default: a(() => [
|
|
346
|
+
t("div", et, [
|
|
347
|
+
e[18] || (e[18] = t("label", {
|
|
348
|
+
for: "helpbot-knowledge-question",
|
|
349
|
+
class: "text-sm font-medium"
|
|
350
|
+
}, " Visitor question ", -1)),
|
|
351
|
+
s(X, {
|
|
352
|
+
id: "helpbot-knowledge-question",
|
|
353
|
+
modelValue: V.value,
|
|
354
|
+
"onUpdate:modelValue": e[1] || (e[1] = (o) => V.value = o),
|
|
355
|
+
rows: "4",
|
|
356
|
+
placeholder: "What information should the helpbot find?",
|
|
357
|
+
disabled: f.value || !_.value,
|
|
358
|
+
maxlength: "2000",
|
|
359
|
+
onKeydown: ee(te(W, ["exact", "prevent"]), ["enter"])
|
|
360
|
+
}, null, 8, ["modelValue", "disabled", "onKeydown"])
|
|
361
|
+
]),
|
|
362
|
+
s(g, {
|
|
363
|
+
class: "w-full",
|
|
364
|
+
variant: "outline",
|
|
365
|
+
disabled: f.value || !V.value.trim() || !_.value,
|
|
366
|
+
onClick: W
|
|
367
|
+
}, {
|
|
368
|
+
default: a(() => [
|
|
369
|
+
f.value ? (l(), v(r(U), {
|
|
370
|
+
key: 0,
|
|
371
|
+
class: "mr-2 size-4 animate-spin"
|
|
372
|
+
})) : (l(), v(r(se), {
|
|
373
|
+
key: 1,
|
|
374
|
+
class: "mr-2 size-4"
|
|
375
|
+
})),
|
|
376
|
+
m(" " + u(f.value ? "Checking…" : "Check saved knowledge"), 1)
|
|
377
|
+
]),
|
|
378
|
+
_: 1
|
|
379
|
+
}, 8, ["disabled"]),
|
|
380
|
+
B.value ? (l(), n("div", tt, [
|
|
381
|
+
s(r(L), { class: "mt-0.5 size-4 shrink-0" }),
|
|
382
|
+
t("span", null, u(B.value), 1)
|
|
383
|
+
])) : p("", !0),
|
|
384
|
+
f.value ? (l(), n("div", st, [
|
|
385
|
+
(l(), n(T, null, M(3, (o) => s(i, {
|
|
386
|
+
key: o,
|
|
387
|
+
class: "h-20 rounded-lg"
|
|
388
|
+
})), 64))
|
|
389
|
+
])) : A.value && k.value.length ? (l(), n("div", lt, [
|
|
390
|
+
t("div", ot, [
|
|
391
|
+
s(r(be), { class: "size-4" }),
|
|
392
|
+
m(" " + u(k.value.length) + " supporting source" + u(k.value.length === 1 ? "" : "s") + " found ", 1)
|
|
393
|
+
]),
|
|
394
|
+
(l(!0), n(T, null, M(k.value, (o, P) => (l(), n("div", {
|
|
395
|
+
key: `${o.title}-${P}`,
|
|
396
|
+
class: "rounded-lg border p-3"
|
|
397
|
+
}, [
|
|
398
|
+
t("div", nt, [
|
|
399
|
+
(l(), v(ce(re(o)), { class: "size-4 shrink-0 text-primary" })),
|
|
400
|
+
t("p", rt, u(o.title), 1)
|
|
401
|
+
]),
|
|
402
|
+
o.excerpt ? (l(), n("p", at, u(o.excerpt), 1)) : p("", !0)
|
|
403
|
+
]))), 128))
|
|
404
|
+
])) : A.value ? (l(), n("div", it, [
|
|
405
|
+
s(r(le), { class: "mx-auto size-6 text-muted-foreground" }),
|
|
406
|
+
e[20] || (e[20] = t("p", { class: "mt-2 text-sm font-medium" }, "No supporting knowledge found", -1)),
|
|
407
|
+
e[21] || (e[21] = t("p", { class: "mt-1 text-xs leading-5 text-muted-foreground" }, " Add or improve an answer before relying on this response. ", -1)),
|
|
408
|
+
s(ae, {
|
|
409
|
+
to: r(oe)("/knowledge"),
|
|
410
|
+
class: "mt-3 inline-flex items-center text-xs font-medium text-primary hover:underline"
|
|
411
|
+
}, {
|
|
412
|
+
default: a(() => [
|
|
413
|
+
e[19] || (e[19] = m(" Review knowledge ", -1)),
|
|
414
|
+
s(r(ke), { class: "ml-1 size-3.5" })
|
|
415
|
+
]),
|
|
416
|
+
_: 1
|
|
417
|
+
}, 8, ["to"])
|
|
418
|
+
])) : p("", !0)
|
|
419
|
+
]),
|
|
420
|
+
_: 1
|
|
421
|
+
})
|
|
422
|
+
]),
|
|
423
|
+
_: 1
|
|
424
|
+
})
|
|
425
|
+
])
|
|
426
|
+
], 64)) : (l(), v(E, { key: 2 }, {
|
|
427
|
+
default: a(() => [
|
|
428
|
+
s(D, { class: "flex flex-col items-center px-6 py-14 text-center" }, {
|
|
429
|
+
default: a(() => [
|
|
430
|
+
t("div", Ee, [
|
|
431
|
+
s(r(H), { class: "size-6" })
|
|
432
|
+
]),
|
|
433
|
+
e[7] || (e[7] = t("h2", { class: "mt-4 font-semibold" }, "You do not have access to private testing", -1)),
|
|
434
|
+
e[8] || (e[8] = t("p", { class: "mt-1 max-w-md text-sm leading-6 text-muted-foreground" }, " Ask a project administrator to grant you the “Test the helpbot” permission. ", -1))
|
|
435
|
+
]),
|
|
436
|
+
_: 1
|
|
437
|
+
})
|
|
438
|
+
]),
|
|
439
|
+
_: 1
|
|
440
|
+
}))
|
|
441
|
+
]);
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
export {
|
|
446
|
+
xt as default
|
|
447
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("lucide-vue-next"),H=require("@oneclick.dev/cms-kit"),N=require("./useHelpbotApi-BIIungOh.js"),j={class:"mx-auto flex w-full max-w-7xl flex-col gap-6 py-6 @3xl:py-8"},U={class:"max-w-2xl"},O={class:"mb-2 flex items-center gap-2 text-sm font-medium text-primary"},I={key:0,class:"grid gap-4 @4xl:grid-cols-[minmax(0,1.45fr)_minmax(320px,0.75fr)]"},Q={class:"grid size-12 place-items-center rounded-xl bg-destructive/10 text-destructive"},W={class:"mt-1 max-w-md text-sm leading-6 text-muted-foreground"},Y={class:"grid size-12 place-items-center rounded-xl bg-muted text-muted-foreground"},G={key:0,class:"flex items-start gap-3 rounded-xl border border-amber-500/30 bg-amber-500/5 px-4 py-3 text-sm",role:"alert"},J={class:"grid min-w-0 gap-4 @4xl:grid-cols-[minmax(0,1.45fr)_minmax(320px,0.75fr)]"},X={class:"min-w-0"},Z={key:0,class:"m-auto flex max-w-md flex-col items-center px-4 py-12 text-center"},ee={class:"grid size-12 place-items-center rounded-2xl bg-primary/10 text-primary"},te={key:0,class:"grid size-7 shrink-0 place-items-center rounded-full bg-primary/10 text-primary"},oe={class:"whitespace-pre-wrap"},re={key:0,class:"mt-3 border-t border-border/60 pt-2"},le=["onClick"],ne={key:0,class:"mt-2 space-y-2"},se={class:"text-xs font-medium"},ae={key:0,class:"mt-1 line-clamp-3 text-xs leading-5 text-muted-foreground"},ce={key:1,class:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-muted-foreground"},ie={key:1,class:"flex items-end gap-2"},de={class:"grid size-7 shrink-0 place-items-center rounded-full bg-primary/10 text-primary"},ue={class:"flex items-center gap-2 rounded-2xl rounded-bl-md bg-muted px-4 py-3 text-sm text-muted-foreground"},me={key:2,class:"flex items-start gap-2 rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive",role:"alert"},pe={class:"border-t p-3 @md:p-4"},xe={class:"flex items-end gap-2 rounded-xl border bg-background p-2 focus-within:ring-2 focus-within:ring-ring"},fe={class:"flex items-start gap-3"},ve={class:"grid size-9 shrink-0 place-items-center rounded-lg bg-primary/10 text-primary"},ke={class:"space-y-1.5"},ge={key:0,class:"flex items-start gap-2 rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive",role:"alert"},he={key:1,class:"space-y-2 pt-1"},ye={key:2,class:"space-y-2 pt-1"},Ve={class:"flex items-center gap-2 text-xs font-medium text-emerald-700 dark:text-emerald-300"},Ne={class:"flex items-center gap-2"},be={class:"min-w-0 truncate text-sm font-medium"},we={key:0,class:"mt-2 line-clamp-3 text-xs leading-5 text-muted-foreground"},Ce={key:3,class:"rounded-lg border-2 border-dashed px-4 py-6 text-center"},_e=e.defineComponent({__name:"Test",setup(Be){H.useModuleBreadcrumbs(()=>[{text:"Test helpbot"}]);const{resolvePath:K}=H.useModuleRoute(),b=N.useHelpbotApi(),p=e.ref(null),w=e.ref(!0),v=e.ref(""),c=e.ref([]),d=e.ref(""),i=e.ref(!1),x=e.ref(""),k=e.ref(null),g=e.ref(""),s=e.ref(!1),h=e.ref(!1),y=e.ref(""),u=e.ref([]),C=e.computed(()=>p.value?.permissions.canTestHelpbot===!0),m=e.computed(()=>p.value?.configured!==!1&&p.value?.connected!==!1),E=e.computed(()=>C.value&&m.value&&!i.value&&!!d.value.trim());async function z(){w.value=!0,v.value="";try{p.value=await b.getStatus()}catch(n){p.value=null,v.value=N.getHelpbotErrorMessage(n,"The helpbot connection could not be checked.")}finally{w.value=!1}}function T(){e.nextTick(()=>{k.value&&(k.value.scrollTop=k.value.scrollHeight)})}async function S(){const n=d.value.trim();if(!n||!E.value)return;const t=c.value.map(({role:l,content:a})=>({role:l,content:a.slice(0,1e4)})).slice(-20);for(;t.length&&n.length+t.reduce((l,a)=>l+a.content.length,0)>6e4;)t.shift();c.value.push({role:"user",content:n}),d.value="",x.value="",i.value=!0,T();try{const l=await b.chat(n,t);if(!l.answer)throw new Error("The helpbot returned an empty answer.");c.value.push({role:"assistant",content:l.answer,sources:l.sources,showSources:!1})}catch(l){x.value=N.getHelpbotErrorMessage(l,"The helpbot could not answer this question.")}finally{i.value=!1,T()}}function P(){c.value=[],x.value="",d.value=""}async function D(){const n=g.value.trim();if(!(!n||s.value||!C.value||!m.value)){s.value=!0,h.value=!1,y.value="",u.value=[];try{u.value=await b.query(n),h.value=!0}catch(t){y.value=N.getHelpbotErrorMessage(t,"The saved knowledge could not be checked.")}finally{s.value=!1}}}function $(n){return n.kind==="pdf"?r.FileText:r.BookOpen}return e.onMounted(z),(n,t)=>{const l=e.resolveComponent("Skeleton"),a=e.resolveComponent("Button"),_=e.resolveComponent("CardContent"),V=e.resolveComponent("Card"),q=e.resolveComponent("CardTitle"),A=e.resolveComponent("CardDescription"),L=e.resolveComponent("CardHeader"),M=e.resolveComponent("Textarea"),F=e.resolveComponent("NuxtLink");return e.openBlock(),e.createElementBlock("main",j,[e.createElementVNode("header",U,[e.createElementVNode("div",O,[e.createVNode(e.unref(r.MessageCircleQuestion),{class:"size-4"}),t[2]||(t[2]=e.createTextVNode(" Private workspace ",-1))]),t[3]||(t[3]=e.createElementVNode("h1",{class:"text-2xl font-semibold tracking-tight @2xl:text-3xl"},"Test your helpbot",-1)),t[4]||(t[4]=e.createElementVNode("p",{class:"mt-2 text-sm leading-6 text-muted-foreground"}," Ask questions as a visitor and verify that the reply is supported by your saved knowledge. These tests are not visible on your website. ",-1))]),w.value?(e.openBlock(),e.createElementBlock("div",I,[e.createVNode(l,{class:"h-[640px] rounded-xl"}),e.createVNode(l,{class:"h-[520px] rounded-xl"})])):v.value?(e.openBlock(),e.createBlock(V,{key:1},{default:e.withCtx(()=>[e.createVNode(_,{class:"flex flex-col items-center px-6 py-14 text-center"},{default:e.withCtx(()=>[e.createElementVNode("div",Q,[e.createVNode(e.unref(r.AlertCircle),{class:"size-6"})]),t[6]||(t[6]=e.createElementVNode("h2",{class:"mt-4 font-semibold"},"Private test is unavailable",-1)),e.createElementVNode("p",W,e.toDisplayString(v.value),1),e.createVNode(a,{variant:"outline",class:"mt-4",onClick:z},{default:e.withCtx(()=>[e.createVNode(e.unref(r.RefreshCw),{class:"mr-2 size-4"}),t[5]||(t[5]=e.createTextVNode(" Try again ",-1))]),_:1})]),_:1})]),_:1})):C.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",G,[e.createVNode(e.unref(r.AlertCircle),{class:"mt-0.5 size-4 shrink-0 text-amber-600 dark:text-amber-400"}),t[9]||(t[9]=e.createElementVNode("div",null,[e.createElementVNode("p",{class:"font-medium"},"The helpbot connection needs attention"),e.createElementVNode("p",{class:"mt-0.5 text-muted-foreground"}," Private testing will be available after your agency restores the website helpbot connection. ")],-1))])),e.createElementVNode("div",J,[e.createVNode(V,{class:"flex min-h-[620px] min-w-0 flex-col overflow-hidden"},{default:e.withCtx(()=>[e.createVNode(L,{class:"flex-row items-center justify-between gap-4 space-y-0 border-b p-4 @md:p-5"},{default:e.withCtx(()=>[e.createElementVNode("div",X,[e.createVNode(q,{class:"text-base"},{default:e.withCtx(()=>[...t[10]||(t[10]=[e.createTextVNode("Helpbot preview",-1)])]),_:1}),e.createVNode(A,{class:"mt-1"},{default:e.withCtx(()=>[...t[11]||(t[11]=[e.createTextVNode(" Uses the knowledge currently available to the connected helpbot. ",-1)])]),_:1})]),e.createVNode(a,{variant:"ghost",size:"icon",class:"shrink-0",disabled:c.value.length===0||i.value,"aria-label":"Clear test conversation",onClick:P},{default:e.withCtx(()=>[e.createVNode(e.unref(r.Trash2),{class:"size-4"})]),_:1},8,["disabled"])]),_:1}),e.createElementVNode("div",{ref_key:"chatContainer",ref:k,class:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-4 @md:p-5","aria-live":"polite"},[c.value.length===0?(e.openBlock(),e.createElementBlock("div",Z,[e.createElementVNode("div",ee,[e.createVNode(e.unref(r.Bot),{class:"size-6"})]),t[12]||(t[12]=e.createElementVNode("h2",{class:"mt-4 font-semibold"},"Ask a real visitor question",-1)),t[13]||(t[13]=e.createElementVNode("p",{class:"mt-1 text-sm leading-6 text-muted-foreground"}," Try an important question about your services, policies, opening hours, or products. ",-1))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,B)=>(e.openBlock(),e.createElementBlock("div",{key:`${o.role}-${B}`,class:e.normalizeClass(["flex items-end gap-2",o.role==="user"?"justify-end":"justify-start"])},[o.role==="assistant"?(e.openBlock(),e.createElementBlock("div",te,[e.createVNode(e.unref(r.Bot),{class:"size-3.5"})])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["max-w-[86%] rounded-2xl px-4 py-3 text-sm leading-6",o.role==="user"?"rounded-br-md bg-primary text-primary-foreground":"rounded-bl-md bg-muted"])},[e.createElementVNode("p",oe,e.toDisplayString(o.content),1),o.role==="assistant"&&o.sources?.length?(e.openBlock(),e.createElementBlock("div",re,[e.createElementVNode("button",{type:"button",class:"flex w-full items-center gap-1.5 text-left text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",onClick:f=>o.showSources=!o.showSources},[o.showSources?(e.openBlock(),e.createBlock(e.unref(r.ChevronUp),{key:0,class:"size-3.5"})):(e.openBlock(),e.createBlock(e.unref(r.ChevronDown),{key:1,class:"size-3.5"})),e.createTextVNode(" "+e.toDisplayString(o.sources.length)+" supporting source"+e.toDisplayString(o.sources.length===1?"":"s"),1)],8,le),o.showSources?(e.openBlock(),e.createElementBlock("div",ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.sources,(f,R)=>(e.openBlock(),e.createElementBlock("div",{key:`${f.title}-${R}`,class:"rounded-lg border bg-background/70 p-2.5"},[e.createElementVNode("p",se,e.toDisplayString(f.title),1),f.excerpt?(e.openBlock(),e.createElementBlock("p",ae,e.toDisplayString(f.excerpt),1)):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2),o.role==="user"?(e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(e.unref(r.UserRound),{class:"size-3.5"})])):e.createCommentVNode("",!0)],2))),128)),i.value?(e.openBlock(),e.createElementBlock("div",ie,[e.createElementVNode("div",de,[e.createVNode(e.unref(r.Bot),{class:"size-3.5"})]),e.createElementVNode("div",ue,[e.createVNode(e.unref(r.Loader2),{class:"size-4 animate-spin"}),t[14]||(t[14]=e.createTextVNode(" Preparing an answer… ",-1))])])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("div",me,[e.createVNode(e.unref(r.AlertCircle),{class:"mt-0.5 size-4 shrink-0"}),e.createElementVNode("span",null,e.toDisplayString(x.value),1)])):e.createCommentVNode("",!0)],512),e.createElementVNode("div",pe,[e.createElementVNode("div",xe,[e.createVNode(M,{modelValue:d.value,"onUpdate:modelValue":t[0]||(t[0]=o=>d.value=o),rows:"2",class:"min-h-[44px] flex-1 resize-none border-0 bg-transparent px-2 py-2 shadow-none focus-visible:ring-0",placeholder:"Ask a question a visitor might type…",disabled:i.value||!m.value,maxlength:"10000",onKeydown:e.withKeys(e.withModifiers(S,["exact","prevent"]),["enter"])},null,8,["modelValue","disabled","onKeydown"]),e.createVNode(a,{size:"icon",class:"shrink-0",disabled:!E.value,"aria-label":"Send test question",onClick:S},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(e.unref(r.Loader2),{key:0,class:"size-4 animate-spin"})):(e.openBlock(),e.createBlock(e.unref(r.Send),{key:1,class:"size-4"}))]),_:1},8,["disabled"])]),t[15]||(t[15]=e.createElementVNode("p",{class:"mt-2 px-1 text-xs text-muted-foreground"}," Press Enter to send · Shift + Enter for a new line ",-1))])]),_:1}),e.createVNode(V,{class:"h-fit min-w-0"},{default:e.withCtx(()=>[e.createVNode(L,{class:"p-5"},{default:e.withCtx(()=>[e.createElementVNode("div",fe,[e.createElementVNode("div",ve,[e.createVNode(e.unref(r.Search),{class:"size-4"})]),e.createElementVNode("div",null,[e.createVNode(q,{class:"text-base"},{default:e.withCtx(()=>[...t[16]||(t[16]=[e.createTextVNode("Knowledge check",-1)])]),_:1}),e.createVNode(A,{class:"mt-1 leading-5"},{default:e.withCtx(()=>[...t[17]||(t[17]=[e.createTextVNode(" See which saved sources can support a question before reviewing the full reply. ",-1)])]),_:1})])])]),_:1}),e.createVNode(_,{class:"space-y-4 px-5 pb-5"},{default:e.withCtx(()=>[e.createElementVNode("div",ke,[t[18]||(t[18]=e.createElementVNode("label",{for:"helpbot-knowledge-question",class:"text-sm font-medium"}," Visitor question ",-1)),e.createVNode(M,{id:"helpbot-knowledge-question",modelValue:g.value,"onUpdate:modelValue":t[1]||(t[1]=o=>g.value=o),rows:"4",placeholder:"What information should the helpbot find?",disabled:s.value||!m.value,maxlength:"2000",onKeydown:e.withKeys(e.withModifiers(D,["exact","prevent"]),["enter"])},null,8,["modelValue","disabled","onKeydown"])]),e.createVNode(a,{class:"w-full",variant:"outline",disabled:s.value||!g.value.trim()||!m.value,onClick:D},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createBlock(e.unref(r.Loader2),{key:0,class:"mr-2 size-4 animate-spin"})):(e.openBlock(),e.createBlock(e.unref(r.Search),{key:1,class:"mr-2 size-4"})),e.createTextVNode(" "+e.toDisplayString(s.value?"Checking…":"Check saved knowledge"),1)]),_:1},8,["disabled"]),y.value?(e.openBlock(),e.createElementBlock("div",ge,[e.createVNode(e.unref(r.AlertCircle),{class:"mt-0.5 size-4 shrink-0"}),e.createElementVNode("span",null,e.toDisplayString(y.value),1)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",he,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(3,o=>e.createVNode(l,{key:o,class:"h-20 rounded-lg"})),64))])):h.value&&u.value.length?(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("div",Ve,[e.createVNode(e.unref(r.CheckCircle2),{class:"size-4"}),e.createTextVNode(" "+e.toDisplayString(u.value.length)+" supporting source"+e.toDisplayString(u.value.length===1?"":"s")+" found ",1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(o,B)=>(e.openBlock(),e.createElementBlock("div",{key:`${o.title}-${B}`,class:"rounded-lg border p-3"},[e.createElementVNode("div",Ne,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent($(o)),{class:"size-4 shrink-0 text-primary"})),e.createElementVNode("p",be,e.toDisplayString(o.title),1)]),o.excerpt?(e.openBlock(),e.createElementBlock("p",we,e.toDisplayString(o.excerpt),1)):e.createCommentVNode("",!0)]))),128))])):h.value?(e.openBlock(),e.createElementBlock("div",Ce,[e.createVNode(e.unref(r.BookOpen),{class:"mx-auto size-6 text-muted-foreground"}),t[20]||(t[20]=e.createElementVNode("p",{class:"mt-2 text-sm font-medium"},"No supporting knowledge found",-1)),t[21]||(t[21]=e.createElementVNode("p",{class:"mt-1 text-xs leading-5 text-muted-foreground"}," Add or improve an answer before relying on this response. ",-1)),e.createVNode(F,{to:e.unref(K)("/knowledge"),class:"mt-3 inline-flex items-center text-xs font-medium text-primary hover:underline"},{default:e.withCtx(()=>[t[19]||(t[19]=e.createTextVNode(" Review knowledge ",-1)),e.createVNode(e.unref(r.ArrowRight),{class:"ml-1 size-3.5"})]),_:1},8,["to"])])):e.createCommentVNode("",!0)]),_:1})]),_:1})])],64)):(e.openBlock(),e.createBlock(V,{key:2},{default:e.withCtx(()=>[e.createVNode(_,{class:"flex flex-col items-center px-6 py-14 text-center"},{default:e.withCtx(()=>[e.createElementVNode("div",Y,[e.createVNode(e.unref(r.Bot),{class:"size-6"})]),t[7]||(t[7]=e.createElementVNode("h2",{class:"mt-4 font-semibold"},"You do not have access to private testing",-1)),t[8]||(t[8]=e.createElementVNode("p",{class:"mt-1 max-w-md text-sm leading-6 text-muted-foreground"}," Ask a project administrator to grant you the “Test the helpbot” permission. ",-1))]),_:1})]),_:1}))])}}});exports.default=_e;
|