@pagelines/sdk 1.0.933 → 1.0.934
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/BotProvider.js +219 -219
- package/dist/BotProvider.js.map +1 -1
- package/dist/BotWrap.js +156 -156
- package/dist/BotWrap.js.map +1 -1
- package/dist/bot/index.d.ts +1 -0
- package/dist/bot/ui/ChatTurn.vue.d.ts +4 -3
- package/dist/bot/ui/chat-type.d.ts +6 -0
- package/dist/bot.js +47 -47
- package/dist/bot.js.map +1 -1
- package/dist/sdk.css +1 -1
- package/dist/widget.js +57 -57
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
package/dist/BotProvider.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./rolldown-runtime.js";
|
|
2
2
|
import { SOCIAL_PLATFORMS as e } from "./constants.js";
|
|
3
|
-
import { _ as t, d as n, f as r, g as i,
|
|
4
|
-
import { Bot as
|
|
5
|
-
import { Fragment as
|
|
3
|
+
import { _ as t, d as n, f as r, g as i, m as a, n as o, p as s, t as c, v as ee, y as te } from "./BotWrap.js";
|
|
4
|
+
import { Bot as l, getColorSchemeOklch as ne } from "@pagelines/core";
|
|
5
|
+
import { Fragment as u, Transition as d, TransitionGroup as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createSlots as v, createTextVNode as y, createVNode as b, defineComponent as x, guardReactiveProps as S, mergeProps as C, normalizeClass as w, normalizeProps as T, normalizeStyle as E, onMounted as D, onUnmounted as re, openBlock as O, ref as k, renderList as A, renderSlot as j, shallowRef as M, toDisplayString as N, unref as P, watch as F, withCtx as I, withKeys as L, withModifiers as R } from "vue";
|
|
6
6
|
// bot/schema.ts
|
|
7
|
-
var
|
|
7
|
+
var z = [
|
|
8
8
|
{
|
|
9
9
|
mode: "self",
|
|
10
10
|
label: "Overview",
|
|
@@ -25,7 +25,7 @@ var B = [
|
|
|
25
25
|
label: "About",
|
|
26
26
|
icon: "i-tabler-user-circle"
|
|
27
27
|
}
|
|
28
|
-
],
|
|
28
|
+
], B = /* @__PURE__ */ x({
|
|
29
29
|
__name: "EffectTransitionList",
|
|
30
30
|
props: {
|
|
31
31
|
disabled: {
|
|
@@ -35,41 +35,41 @@ var B = [
|
|
|
35
35
|
mode: { default: "block" }
|
|
36
36
|
},
|
|
37
37
|
setup(e) {
|
|
38
|
-
return (t, n) => (
|
|
39
|
-
default:
|
|
38
|
+
return (t, n) => (O(), m(f, { name: e.disabled ? "" : "nlist" }, {
|
|
39
|
+
default: I(() => [j(t.$slots, "default")]),
|
|
40
40
|
_: 3
|
|
41
41
|
}, 8, ["name"]));
|
|
42
42
|
}
|
|
43
|
-
}),
|
|
43
|
+
}), V = ["data-test-mode"], H = { class: "w-full max-w-xs space-y-12" }, U = {
|
|
44
44
|
key: 0,
|
|
45
45
|
class: "text-xs text-theme-400 text-center"
|
|
46
|
-
},
|
|
46
|
+
}, W = { class: "text-base font-light text-white text-center" }, G = { class: "space-y-6 relative" }, K = {
|
|
47
47
|
key: "email-field",
|
|
48
48
|
class: "w-full"
|
|
49
|
-
},
|
|
49
|
+
}, q = {
|
|
50
50
|
key: "code-field",
|
|
51
51
|
class: "w-full"
|
|
52
|
-
}, J = /* @__PURE__ */
|
|
52
|
+
}, J = /* @__PURE__ */ x({
|
|
53
53
|
__name: "ElAuthGate",
|
|
54
54
|
props: { sdk: {} },
|
|
55
55
|
setup(e) {
|
|
56
|
-
let t =
|
|
56
|
+
let t = k({
|
|
57
57
|
email: "",
|
|
58
58
|
code: ""
|
|
59
|
-
}),
|
|
59
|
+
}), n = k("email"), i = k(!1), o = {
|
|
60
60
|
email: {
|
|
61
61
|
title: "Enter Your Email",
|
|
62
62
|
button: {
|
|
63
63
|
label: "Continue",
|
|
64
|
-
disabled: () => !t.value.email ||
|
|
64
|
+
disabled: () => !t.value.email || i.value
|
|
65
65
|
},
|
|
66
66
|
action: async () => {
|
|
67
|
-
if (!
|
|
68
|
-
|
|
67
|
+
if (!i.value) {
|
|
68
|
+
i.value = !0;
|
|
69
69
|
try {
|
|
70
|
-
await e.sdk.auth.requestAuthCode({ email: t.value.email }) && (
|
|
70
|
+
await e.sdk.auth.requestAuthCode({ email: t.value.email }) && (n.value = "code");
|
|
71
71
|
} finally {
|
|
72
|
-
|
|
72
|
+
i.value = !1;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -78,49 +78,49 @@ var B = [
|
|
|
78
78
|
title: "Enter Verification Code",
|
|
79
79
|
button: {
|
|
80
80
|
label: "Verify",
|
|
81
|
-
disabled: () => t.value.code.length !== 6 ||
|
|
81
|
+
disabled: () => t.value.code.length !== 6 || i.value
|
|
82
82
|
},
|
|
83
83
|
action: async () => {
|
|
84
|
-
if (!
|
|
85
|
-
|
|
84
|
+
if (!i.value) {
|
|
85
|
+
i.value = !0;
|
|
86
86
|
try {
|
|
87
87
|
await e.sdk.auth.loginWithCode({
|
|
88
88
|
email: t.value.email,
|
|
89
89
|
code: t.value.code
|
|
90
90
|
});
|
|
91
91
|
} finally {
|
|
92
|
-
|
|
92
|
+
i.value = !1;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
}, c =
|
|
98
|
-
return
|
|
99
|
-
e &&
|
|
100
|
-
}), (
|
|
97
|
+
}, c = p(() => o[n.value]);
|
|
98
|
+
return F(() => e.sdk.activeUser.value, (e) => {
|
|
99
|
+
e && n.value === "code" && console.log("[ElAuthGate] Authentication successful", { email: e.email });
|
|
100
|
+
}), (i, o) => (O(), g("div", {
|
|
101
101
|
"data-test": "auth-form",
|
|
102
|
-
"data-test-mode":
|
|
102
|
+
"data-test-mode": n.value,
|
|
103
103
|
class: "flex flex-col items-center justify-center h-full p-6"
|
|
104
|
-
}, [
|
|
105
|
-
e.sdk.error.value ? (
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
default:
|
|
104
|
+
}, [_("div", H, [
|
|
105
|
+
e.sdk.error.value ? (O(), g("p", U, N(e.sdk.error.value), 1)) : h("", !0),
|
|
106
|
+
_("h3", W, N(c.value.title), 1),
|
|
107
|
+
_("div", G, [b(B, null, {
|
|
108
|
+
default: I(() => [n.value === "email" ? (O(), g("div", K, [b(s, {
|
|
109
109
|
modelValue: t.value.email,
|
|
110
110
|
"onUpdate:modelValue": o[0] || (o[0] = (e) => t.value.email = e),
|
|
111
111
|
"data-test": "auth-email-input",
|
|
112
|
-
onKeyup:
|
|
113
|
-
}, null, 8, ["modelValue", "onKeyup"])])) : (
|
|
112
|
+
onKeyup: L(c.value.action, ["enter"])
|
|
113
|
+
}, null, 8, ["modelValue", "onKeyup"])])) : (O(), g("div", q, [b(r, {
|
|
114
114
|
modelValue: t.value.code,
|
|
115
115
|
"onUpdate:modelValue": o[1] || (o[1] = (e) => t.value.code = e),
|
|
116
116
|
length: 6,
|
|
117
117
|
"focus-first": !0,
|
|
118
118
|
"data-test": "auth-code-input",
|
|
119
119
|
onAutoSubmit: c.value.action
|
|
120
|
-
}, null, 8, ["modelValue", "onAutoSubmit"])])), (
|
|
120
|
+
}, null, 8, ["modelValue", "onAutoSubmit"])])), (O(), g("div", {
|
|
121
121
|
key: c.value.button.label,
|
|
122
122
|
class: "space-y-4 w-full"
|
|
123
|
-
}, [
|
|
123
|
+
}, [b(a, {
|
|
124
124
|
theme: "primary",
|
|
125
125
|
size: "md",
|
|
126
126
|
class: "w-full",
|
|
@@ -129,20 +129,20 @@ var B = [
|
|
|
129
129
|
disabled: c.value.button.disabled() || e.sdk.loading.value,
|
|
130
130
|
onClick: c.value.action
|
|
131
131
|
}, {
|
|
132
|
-
default:
|
|
132
|
+
default: I(() => [y(N(c.value.button.label), 1)]),
|
|
133
133
|
_: 1
|
|
134
134
|
}, 8, [
|
|
135
135
|
"loading",
|
|
136
136
|
"disabled",
|
|
137
137
|
"onClick"
|
|
138
|
-
]),
|
|
138
|
+
]), n.value === "code" ? (O(), g("button", {
|
|
139
139
|
key: 0,
|
|
140
140
|
class: "w-full text-xs text-white/50 hover:text-white/70 transition-colors py-2",
|
|
141
|
-
onClick: o[2] || (o[2] = (e) =>
|
|
142
|
-
}, " Change Email ")) :
|
|
141
|
+
onClick: o[2] || (o[2] = (e) => n.value = "email")
|
|
142
|
+
}, " Change Email ")) : h("", !0)]))]),
|
|
143
143
|
_: 1
|
|
144
144
|
})])
|
|
145
|
-
])], 8,
|
|
145
|
+
])], 8, V));
|
|
146
146
|
}
|
|
147
147
|
}), Y = { class: "flex-1 flex flex-col min-h-0 py-6 space-y-6 h-full overflow-scroll [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden relative" }, X = { class: "flex-1 space-y-6 pb-12" }, ie = {
|
|
148
148
|
key: 0,
|
|
@@ -153,7 +153,7 @@ var B = [
|
|
|
153
153
|
}, se = ["href"], ce = {
|
|
154
154
|
key: 2,
|
|
155
155
|
class: "space-y-3"
|
|
156
|
-
}, le = { class: "grid grid-cols-2 gap-3" }, ue = ["href"], de = /* @__PURE__ */
|
|
156
|
+
}, le = { class: "grid grid-cols-2 gap-3" }, ue = ["href"], de = /* @__PURE__ */ x({
|
|
157
157
|
__name: "ElBotAbout",
|
|
158
158
|
props: {
|
|
159
159
|
bot: {},
|
|
@@ -163,30 +163,30 @@ var B = [
|
|
|
163
163
|
}
|
|
164
164
|
},
|
|
165
165
|
setup(t) {
|
|
166
|
-
return (
|
|
166
|
+
return (r, i) => (O(), g("div", Y, [b(n, {
|
|
167
167
|
bot: t.bot,
|
|
168
168
|
"is-online": t.isOnline
|
|
169
|
-
}, null, 8, ["bot", "is-online"]),
|
|
170
|
-
t.bot.summary.value ? (
|
|
171
|
-
t.bot.email.value ? (
|
|
169
|
+
}, null, 8, ["bot", "is-online"]), _("div", X, [
|
|
170
|
+
t.bot.summary.value ? (O(), g("div", ie, [i[0] || (i[0] = _("h3", { class: "font-medium text-white/50" }, " About ", -1)), _("p", ae, N(t.bot.summary.value), 1)])) : h("", !0),
|
|
171
|
+
t.bot.email.value ? (O(), g("div", oe, [i[2] || (i[2] = _("h3", { class: "text-sm font-medium text-white/90" }, " Contact ", -1)), _("a", {
|
|
172
172
|
href: `mailto:${t.bot.email.value}`,
|
|
173
173
|
target: "_blank",
|
|
174
174
|
rel: "noopener noreferrer",
|
|
175
175
|
class: "relative inline-flex items-center justify-center gap-2 rounded-full px-4 py-2 font-medium transition-colors duration-200 focus:outline-none active:opacity-80 cursor-pointer bg-white/5 hover:bg-white/10 border border-white/10 text-white/80 text-sm justify-start h-10 w-full"
|
|
176
|
-
}, [...
|
|
177
|
-
t.bot.accounts.value && t.bot.accounts.value.length > 0 ? (
|
|
176
|
+
}, [...i[1] || (i[1] = [_("span", { class: "i-heroicons-envelope flex items-center size-[1.1em] mt-[-.07em]" }, null, -1), y(" Email ", -1)])], 8, se)])) : h("", !0),
|
|
177
|
+
t.bot.accounts.value && t.bot.accounts.value.length > 0 ? (O(), g("div", ce, [i[3] || (i[3] = _("h3", { class: "text-sm font-medium text-white/90" }, " Links ", -1)), _("div", le, [(O(!0), g(u, null, A(t.bot.accounts.value, (t) => (O(), g("a", {
|
|
178
178
|
key: `${t.platform}-${t.handle}`,
|
|
179
|
-
href:
|
|
179
|
+
href: P(e)[t.platform].getUrl(t.handle),
|
|
180
180
|
target: "_blank",
|
|
181
181
|
rel: "noopener noreferrer",
|
|
182
182
|
class: "relative inline-flex items-center justify-center gap-2 rounded-full px-4 py-2 font-medium transition-colors duration-200 focus:outline-none active:opacity-80 cursor-pointer bg-white/10 hover:bg-white/20 border border-white/20 text-white/80 text-sm"
|
|
183
|
-
}, [
|
|
183
|
+
}, [_("span", { class: w(["flex items-center size-[1.1em] mt-[-.07em]", P(e)[t.platform].icon]) }, null, 2), y(" " + N(P(e)[t.platform].label), 1)], 8, ue))), 128))])])) : h("", !0)
|
|
184
184
|
])]));
|
|
185
185
|
}
|
|
186
186
|
}), fe = { class: "flex flex-col items-center text-center gap-4" }, pe = { class: "relative flex-shrink-0" }, me = { class: "w-20 h-20 sm:w-24 sm:h-24 rounded-full overflow-hidden border-4 border-white" }, he = ["src", "alt"], ge = { class: "absolute top-1.5 right-1.5" }, _e = {
|
|
187
187
|
key: 1,
|
|
188
188
|
class: "size-4 bg-theme-400 rounded-full ring-2 ring-white"
|
|
189
|
-
}, ve = { class: "min-w-0" }, ye = { class: "text-3xl font-light text-white mb-2 truncate" }, be = { class: "text-base font-light text-white/60 line-clamp-1" }, xe = /* @__PURE__ */
|
|
189
|
+
}, ve = { class: "min-w-0" }, ye = { class: "text-3xl font-light text-white mb-2 truncate" }, be = { class: "text-base font-light text-white/60 line-clamp-1" }, xe = /* @__PURE__ */ x({
|
|
190
190
|
__name: "ElBotHeader",
|
|
191
191
|
props: {
|
|
192
192
|
bot: {},
|
|
@@ -196,37 +196,37 @@ var B = [
|
|
|
196
196
|
}
|
|
197
197
|
},
|
|
198
198
|
setup(e) {
|
|
199
|
-
return (t, n) => (
|
|
199
|
+
return (t, n) => (O(), g("div", fe, [_("div", pe, [_("div", me, [_("img", {
|
|
200
200
|
src: e.bot.avatarUrl.value,
|
|
201
201
|
alt: e.bot.displayName.value,
|
|
202
202
|
class: "w-full h-full object-cover",
|
|
203
|
-
onError: n[0] || (n[0] = (...e) =>
|
|
204
|
-
}, null, 40, he)]),
|
|
203
|
+
onError: n[0] || (n[0] = (...e) => P(i) && P(i)(...e))
|
|
204
|
+
}, null, 40, he)]), _("div", ge, [e.isOnline ? (O(), g(u, { key: 0 }, [n[1] || (n[1] = _("div", {
|
|
205
205
|
class: "size-4 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
206
206
|
style: { "animation-duration": "3s" }
|
|
207
|
-
}, null, -1)), n[2] || (n[2] =
|
|
207
|
+
}, null, -1)), n[2] || (n[2] = _("div", { class: "size-4 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (O(), g("div", _e))])]), _("div", ve, [_("h1", ye, N(e.bot.displayName.value), 1), _("p", be, N(e.bot.title.value), 1)])]));
|
|
208
208
|
}
|
|
209
|
-
}), Se = { class: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden" }, Ce = /* @__PURE__ */
|
|
209
|
+
}), Se = { class: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden" }, Ce = /* @__PURE__ */ x({
|
|
210
210
|
name: "SelfSidebarClose",
|
|
211
211
|
__name: "BotSidebarClose",
|
|
212
212
|
emits: ["click"],
|
|
213
213
|
setup(e) {
|
|
214
|
-
let t =
|
|
215
|
-
return
|
|
214
|
+
let t = k(!1);
|
|
215
|
+
return D(() => {
|
|
216
216
|
setTimeout(() => {
|
|
217
217
|
t.value = !0;
|
|
218
218
|
}, 100);
|
|
219
|
-
}), (e, n) => (
|
|
219
|
+
}), (e, n) => (O(), g("a", {
|
|
220
220
|
class: "close block cursor-pointer w-[60px] h-[60px] rounded-full transition-all duration-1000 ease-[cubic-bezier(0.25,1,0.33,1)] hover:scale-110 active:scale-90 hover:rotate-90",
|
|
221
221
|
onClick: n[0] || (n[0] = (t) => e.$emit("click", t))
|
|
222
|
-
}, [n[1] || (n[1] =
|
|
223
|
-
class:
|
|
222
|
+
}, [n[1] || (n[1] = _("span", { class: "absolute inset-0 rounded-full transition-all" }, null, -1)), _("span", Se, [_("span", {
|
|
223
|
+
class: w(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", t.value ? "translate-y-0 translate-x-0 rotate-45" : "translate-y-[30px] -translate-x-[30px] rotate-0"]),
|
|
224
224
|
style: {
|
|
225
225
|
"background-color": "currentColor",
|
|
226
226
|
"transition-delay": "0.15s"
|
|
227
227
|
}
|
|
228
|
-
}, null, 2),
|
|
229
|
-
class:
|
|
228
|
+
}, null, 2), _("span", {
|
|
229
|
+
class: w(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", t.value ? "translate-y-0 translate-x-0 -rotate-45" : "-translate-y-[30px] -translate-x-[30px] rotate-0"]),
|
|
230
230
|
style: {
|
|
231
231
|
"background-color": "currentColor",
|
|
232
232
|
"transition-delay": "0.45s"
|
|
@@ -242,7 +242,7 @@ var B = [
|
|
|
242
242
|
}, De = ["disabled", "onClick"], Oe = { class: "flex items-center gap-3" }, ke = { class: "flex-1" }, Ae = {
|
|
243
243
|
key: 0,
|
|
244
244
|
class: "text-xs text-white/50 mt-0.5"
|
|
245
|
-
}, je = { class: "p-6" }, Z = /* @__PURE__ */
|
|
245
|
+
}, je = { class: "p-6" }, Z = /* @__PURE__ */ x({
|
|
246
246
|
name: "ElSidebar",
|
|
247
247
|
inheritAttrs: !1,
|
|
248
248
|
__name: "ElSidebar",
|
|
@@ -255,17 +255,17 @@ var B = [
|
|
|
255
255
|
},
|
|
256
256
|
emits: ["update:modelValue"],
|
|
257
257
|
setup(e, { emit: t }) {
|
|
258
|
-
let n = e, r = t, i = n.position || "left", a = n.widthClasses || "w-[80%] max-w-[300px]", o =
|
|
258
|
+
let n = e, r = t, i = n.position || "left", a = n.widthClasses || "w-[80%] max-w-[300px]", o = p({
|
|
259
259
|
get: () => n.modelValue,
|
|
260
260
|
set: (e) => r("update:modelValue", e)
|
|
261
|
-
}), s =
|
|
261
|
+
}), s = p(() => n.items.filter((e) => !e.isHidden));
|
|
262
262
|
function handleItemClick(e) {
|
|
263
263
|
e.isDisabled || (e.onClick ? e.onClick({
|
|
264
264
|
item: e,
|
|
265
265
|
event: new MouseEvent("click")
|
|
266
266
|
}) : e.href && (e.href.includes("http") ? window.open(e.href, e.target || "_self")?.focus() : window.location.href = e.href), o.value = !1);
|
|
267
267
|
}
|
|
268
|
-
let c =
|
|
268
|
+
let c = p(() => i === "left" ? {
|
|
269
269
|
enter: "-translate-x-full",
|
|
270
270
|
leave: "-translate-x-full",
|
|
271
271
|
position: "justify-start",
|
|
@@ -276,7 +276,7 @@ var B = [
|
|
|
276
276
|
position: "justify-end",
|
|
277
277
|
closeButton: "-left-16"
|
|
278
278
|
});
|
|
279
|
-
return (t, n) => (
|
|
279
|
+
return (t, n) => (O(), g(u, null, [b(d, {
|
|
280
280
|
"enter-active-class": "transition-opacity duration-300 ease-out",
|
|
281
281
|
"leave-active-class": "transition-opacity duration-200 ease-in",
|
|
282
282
|
"enter-from-class": "opacity-0",
|
|
@@ -284,13 +284,13 @@ var B = [
|
|
|
284
284
|
"leave-from-class": "opacity-100",
|
|
285
285
|
"leave-to-class": "opacity-0"
|
|
286
286
|
}, {
|
|
287
|
-
default:
|
|
287
|
+
default: I(() => [o.value ? (O(), g("div", {
|
|
288
288
|
key: 0,
|
|
289
289
|
class: "absolute inset-0 z-40 bg-black/50 backdrop-blur-sm",
|
|
290
290
|
onClick: n[0] || (n[0] = (e) => o.value = !1)
|
|
291
|
-
})) :
|
|
291
|
+
})) : h("", !0)]),
|
|
292
292
|
_: 1
|
|
293
|
-
}),
|
|
293
|
+
}), b(d, {
|
|
294
294
|
"enter-active-class": "transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)]",
|
|
295
295
|
"leave-active-class": "transition-all duration-400 ease-[cubic-bezier(0.25,1,0.33,1)]",
|
|
296
296
|
"enter-from-class": c.value.enter,
|
|
@@ -298,49 +298,49 @@ var B = [
|
|
|
298
298
|
"leave-from-class": "translate-x-0",
|
|
299
299
|
"leave-to-class": c.value.leave
|
|
300
300
|
}, {
|
|
301
|
-
default:
|
|
301
|
+
default: I(() => [o.value ? (O(), g("div", {
|
|
302
302
|
key: 0,
|
|
303
|
-
class:
|
|
303
|
+
class: w(["absolute inset-0 z-50 flex", c.value.position]),
|
|
304
304
|
onClick: n[3] || (n[3] = (e) => o.value = !1)
|
|
305
|
-
}, [
|
|
306
|
-
class:
|
|
307
|
-
onClick: n[2] || (n[2] =
|
|
305
|
+
}, [_("div", {
|
|
306
|
+
class: w(["relative h-full shadow-2xl bg-black/30 backdrop-blur-xl flex flex-col justify-center", P(a)]),
|
|
307
|
+
onClick: n[2] || (n[2] = R(() => {}, ["stop"]))
|
|
308
308
|
}, [
|
|
309
|
-
|
|
310
|
-
class:
|
|
309
|
+
b(Ce, {
|
|
310
|
+
class: w(["absolute top-4 z-10 text-white", c.value.closeButton]),
|
|
311
311
|
onClick: n[1] || (n[1] = (e) => o.value = !1)
|
|
312
312
|
}, null, 8, ["class"]),
|
|
313
|
-
e.title ? (
|
|
314
|
-
t.$slots.header ? (
|
|
315
|
-
|
|
313
|
+
e.title ? (O(), g("div", we, [_("h3", Te, N(e.title), 1)])) : h("", !0),
|
|
314
|
+
t.$slots.header ? (O(), g("div", Ee, [j(t.$slots, "header")])) : h("", !0),
|
|
315
|
+
_("div", { class: w(["flex-1 p-6 space-y-2 overflow-y-auto", {
|
|
316
316
|
"pt-6": !e.title && !t.$slots.header,
|
|
317
317
|
"pt-4": e.title || t.$slots.header
|
|
318
|
-
}]) }, [
|
|
318
|
+
}]) }, [b(f, {
|
|
319
319
|
"enter-active-class": "transition-all duration-400 ease-[cubic-bezier(0.25,1,0.33,1)]",
|
|
320
320
|
"leave-active-class": "transition-all duration-200 ease-[cubic-bezier(0.25,1,0.33,1)]",
|
|
321
|
-
"enter-from-class":
|
|
321
|
+
"enter-from-class": P(i) === "left" ? "-translate-x-4 opacity-0" : "translate-x-4 opacity-0",
|
|
322
322
|
"enter-to-class": "translate-x-0 opacity-100",
|
|
323
323
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
324
|
-
"leave-to-class":
|
|
324
|
+
"leave-to-class": P(i) === "left" ? "-translate-x-4 opacity-0" : "translate-x-4 opacity-0"
|
|
325
325
|
}, {
|
|
326
|
-
default:
|
|
326
|
+
default: I(() => [(O(!0), g(u, null, A(s.value, (e, t) => (O(), g("button", {
|
|
327
327
|
key: e.key || e.label || t,
|
|
328
|
-
style:
|
|
329
|
-
class:
|
|
328
|
+
style: E({ transitionDelay: `${t * 40}ms` }),
|
|
329
|
+
class: w(["cursor-pointer w-full text-left p-3 rounded-xl transition-all duration-200 ease-[cubic-bezier(0.25,1,0.33,1)] group", [e.isActive ? "bg-primary-500/20 border border-primary-500/40" : "hover:bg-white/10", e.isDisabled && "opacity-50 cursor-not-allowed"]]),
|
|
330
330
|
disabled: e.isDisabled,
|
|
331
331
|
onClick: (t) => handleItemClick(e)
|
|
332
|
-
}, [
|
|
332
|
+
}, [_("div", Oe, [e.icon?.src ? (O(), g("i", {
|
|
333
333
|
key: 0,
|
|
334
|
-
class:
|
|
335
|
-
}, null, 2)) :
|
|
334
|
+
class: w(["size-5 flex-shrink-0 transition-transform duration-200 ease-[cubic-bezier(0.25,1,0.33,1)] group-hover:scale-110", [e.icon.src, e.isActive ? "text-primary-400" : "text-white/70 group-hover:text-white"]])
|
|
335
|
+
}, null, 2)) : h("", !0), _("div", ke, [_("div", { class: w(["font-medium text-sm", e.isActive ? "text-primary-300" : "text-white"]) }, N(e.label), 3), e.subLabel ? (O(), g("div", Ae, N(e.subLabel), 1)) : h("", !0)])])], 14, De))), 128))]),
|
|
336
336
|
_: 1
|
|
337
337
|
}, 8, ["enter-from-class", "leave-to-class"])], 2),
|
|
338
|
-
|
|
339
|
-
], 2)], 2)) :
|
|
338
|
+
_("div", je, [j(t.$slots, "footer")])
|
|
339
|
+
], 2)], 2)) : h("", !0)]),
|
|
340
340
|
_: 3
|
|
341
341
|
}, 8, ["enter-from-class", "leave-to-class"])], 64));
|
|
342
342
|
}
|
|
343
|
-
}), Me = /* @__PURE__ */
|
|
343
|
+
}), Me = /* @__PURE__ */ x({
|
|
344
344
|
name: "BotModeSidebar",
|
|
345
345
|
__name: "ElBotModeSidebar",
|
|
346
346
|
props: {
|
|
@@ -349,10 +349,10 @@ var B = [
|
|
|
349
349
|
},
|
|
350
350
|
emits: ["update:modelValue"],
|
|
351
351
|
setup(e, { emit: t }) {
|
|
352
|
-
let n = e, r = t, i =
|
|
352
|
+
let n = e, r = t, i = p({
|
|
353
353
|
get: () => n.modelValue,
|
|
354
354
|
set: (e) => r("update:modelValue", e)
|
|
355
|
-
}), a =
|
|
355
|
+
}), a = p(() => n.chatController?.botMode?.value ?? "self"), o = p(() => z.map((e) => ({
|
|
356
356
|
key: e.mode,
|
|
357
357
|
icon: { src: e.icon },
|
|
358
358
|
label: e.label,
|
|
@@ -361,7 +361,7 @@ var B = [
|
|
|
361
361
|
n.chatController?.setMode(e.mode);
|
|
362
362
|
}
|
|
363
363
|
})));
|
|
364
|
-
return (e, t) => (
|
|
364
|
+
return (e, t) => (O(), m(Z, {
|
|
365
365
|
modelValue: i.value,
|
|
366
366
|
"onUpdate:modelValue": t[0] || (t[0] = (e) => i.value = e),
|
|
367
367
|
items: o.value,
|
|
@@ -370,7 +370,7 @@ var B = [
|
|
|
370
370
|
"width-classes": "w-[80%] max-w-[255px]"
|
|
371
371
|
}, null, 8, ["modelValue", "items"]));
|
|
372
372
|
}
|
|
373
|
-
}), Ne = /* @__PURE__ */
|
|
373
|
+
}), Ne = /* @__PURE__ */ x({
|
|
374
374
|
name: "BotSidebar",
|
|
375
375
|
__name: "ElBotSidebar",
|
|
376
376
|
props: {
|
|
@@ -381,10 +381,10 @@ var B = [
|
|
|
381
381
|
},
|
|
382
382
|
emits: ["update:modelValue"],
|
|
383
383
|
setup(e, { emit: t }) {
|
|
384
|
-
let n = e, r = t, i =
|
|
384
|
+
let n = e, r = t, i = p({
|
|
385
385
|
get: () => n.modelValue,
|
|
386
386
|
set: (e) => r("update:modelValue", e)
|
|
387
|
-
}), a =
|
|
387
|
+
}), a = p(() => {
|
|
388
388
|
let e = [
|
|
389
389
|
{
|
|
390
390
|
key: "share",
|
|
@@ -423,7 +423,7 @@ var B = [
|
|
|
423
423
|
}
|
|
424
424
|
}), e;
|
|
425
425
|
});
|
|
426
|
-
return (t, n) => (
|
|
426
|
+
return (t, n) => (O(), m(Z, {
|
|
427
427
|
modelValue: i.value,
|
|
428
428
|
"onUpdate:modelValue": n[0] || (n[0] = (e) => i.value = e),
|
|
429
429
|
items: a.value,
|
|
@@ -465,7 +465,7 @@ var B = [
|
|
|
465
465
|
}, Xe = { class: "text-center max-w-md space-y-4" }, Ze = { class: "text-sm text-white/70 leading-relaxed" }, Qe = {
|
|
466
466
|
key: 3,
|
|
467
467
|
class: "bg-white/10 backdrop-blur-sm text-white/70 flex items-center justify-center h-full"
|
|
468
|
-
}, $ = /* @__PURE__ */
|
|
468
|
+
}, $ = /* @__PURE__ */ x({
|
|
469
469
|
__name: "BotChat",
|
|
470
470
|
props: {
|
|
471
471
|
sdk: {},
|
|
@@ -508,19 +508,19 @@ var B = [
|
|
|
508
508
|
"turnStarted",
|
|
509
509
|
"turnCompleted"
|
|
510
510
|
],
|
|
511
|
-
setup(
|
|
512
|
-
let
|
|
511
|
+
setup(r, { emit: i }) {
|
|
512
|
+
let s = i, c = M(), l = k(!1), d = k(!1), f = k(), x = k(), C = p(() => c.value?.botMode?.value ?? "self"), L = p(() => c.value?.textState.value.isConnected ?? !1), B = p(() => r.sdk.activeUser.value !== void 0), V = p(() => z.find((e) => e.mode === C.value));
|
|
513
513
|
function createChatController() {
|
|
514
514
|
c.value && c.value.destroy();
|
|
515
515
|
try {
|
|
516
|
-
c.value = new
|
|
517
|
-
sdk:
|
|
518
|
-
bot:
|
|
519
|
-
context:
|
|
520
|
-
firstMessage:
|
|
521
|
-
...
|
|
522
|
-
onTurnStarted: () =>
|
|
523
|
-
onTurnCompleted: (e) =>
|
|
516
|
+
c.value = new ee({
|
|
517
|
+
sdk: r.sdk,
|
|
518
|
+
bot: r.bot,
|
|
519
|
+
context: r.context,
|
|
520
|
+
firstMessage: r.firstMessage,
|
|
521
|
+
...r.createVoiceClientFn ? { createVoiceClientFn: r.createVoiceClientFn } : {},
|
|
522
|
+
onTurnStarted: () => s("turnStarted"),
|
|
523
|
+
onTurnCompleted: (e) => s("turnCompleted", e)
|
|
524
524
|
});
|
|
525
525
|
} catch (e) {
|
|
526
526
|
throw console.error("BotChatController creation failed:", e), e;
|
|
@@ -530,104 +530,104 @@ var B = [
|
|
|
530
530
|
createChatController();
|
|
531
531
|
} catch (e) {
|
|
532
532
|
let t = e instanceof Error ? e.message : "Couldn't initialize your assistant";
|
|
533
|
-
|
|
533
|
+
f.value = t, s("error", t);
|
|
534
534
|
}
|
|
535
535
|
function applyTheme(e) {
|
|
536
|
-
if (!
|
|
537
|
-
let t =
|
|
536
|
+
if (!x.value) return;
|
|
537
|
+
let t = ne(e);
|
|
538
538
|
Object.entries(t).forEach(([e, t]) => {
|
|
539
|
-
|
|
539
|
+
x.value.style.setProperty(`--primary-${e}`, t);
|
|
540
540
|
});
|
|
541
541
|
}
|
|
542
|
-
|
|
542
|
+
D(() => {
|
|
543
543
|
try {
|
|
544
|
-
applyTheme(
|
|
544
|
+
applyTheme(r.theme), r.chatOnly && c.value && c.value.setMode("chat");
|
|
545
545
|
} catch (e) {
|
|
546
546
|
let t = e instanceof Error ? e.message : "Couldn't initialize your assistant";
|
|
547
|
-
|
|
547
|
+
f.value = t, s("error", t);
|
|
548
548
|
}
|
|
549
|
-
}),
|
|
549
|
+
}), re(() => {
|
|
550
550
|
c.value && c.value.destroy();
|
|
551
|
-
}),
|
|
551
|
+
}), F(() => r.theme, (e) => {
|
|
552
552
|
applyTheme(e);
|
|
553
|
-
}),
|
|
553
|
+
}), F(() => r.sdk.activeUser.value, (e, t) => {
|
|
554
554
|
t && !e && c.value && c.value.setMode("self");
|
|
555
555
|
});
|
|
556
|
-
let
|
|
557
|
-
let e = [
|
|
558
|
-
return
|
|
559
|
-
}),
|
|
556
|
+
let H = p(() => !!(r.bot.cover.value?.src && r.bot.cover.value?.quality === "low") || !!(r.bot.avatar.value?.src && r.bot.avatar.value?.quality === "low")), U = p(() => {
|
|
557
|
+
let e = [H.value ? "backdrop-blur-sm" : ""];
|
|
558
|
+
return H.value && C.value === "self" ? e.push("from-black/80 via-black/60 to-black/80") : C.value === "self" ? e.push("from-black/70 via-black/50 to-black/80") : e.push("from-black/90 via-black/90 to-black/100"), e.join(" ");
|
|
559
|
+
}), W = {
|
|
560
560
|
phone: "i-heroicons-phone",
|
|
561
561
|
calendar: "i-heroicons-calendar",
|
|
562
562
|
question: "i-heroicons-question-mark-circle",
|
|
563
563
|
message: "i-heroicons-chat-bubble-left-right",
|
|
564
564
|
sparkles: "i-heroicons-sparkles"
|
|
565
|
-
},
|
|
566
|
-
template:
|
|
567
|
-
bot:
|
|
568
|
-
})),
|
|
569
|
-
return (t,
|
|
565
|
+
}, G = p(() => t({
|
|
566
|
+
template: r.buttonText || "Talk to {name}",
|
|
567
|
+
bot: r.bot.toData()
|
|
568
|
+
})), K = p(() => W[r.buttonIcon || "phone"] || W.phone);
|
|
569
|
+
return (t, i) => (O(), g("div", {
|
|
570
570
|
ref_key: "rootElement",
|
|
571
|
-
ref:
|
|
572
|
-
key:
|
|
571
|
+
ref: x,
|
|
572
|
+
key: r.bot.avatarUrl.value,
|
|
573
573
|
class: "pagelines-sdk @container/bot pagelines-bot w-full h-full overflow-hidden relative",
|
|
574
574
|
"data-test": "bot-chat"
|
|
575
575
|
}, [
|
|
576
|
-
|
|
576
|
+
r.loading ? (O(), g("div", Pe, [b(te, { class: "text-white size-8" })])) : r.bot && !f.value ? (O(), g("div", {
|
|
577
577
|
key: 1,
|
|
578
|
-
class:
|
|
579
|
-
style:
|
|
580
|
-
"data-quality":
|
|
581
|
-
}, [
|
|
578
|
+
class: w(["absolute inset-0", r.bare ? "" : "bg-cover bg-center bg-no-repeat"]),
|
|
579
|
+
style: E(r.bare ? void 0 : { backgroundImage: `url(${r.bot.avatarUrl.value})` }),
|
|
580
|
+
"data-quality": r.bot.avatar.value?.quality || "none"
|
|
581
|
+
}, [r.bare ? h("", !0) : (O(), g("div", {
|
|
582
582
|
key: 0,
|
|
583
|
-
class:
|
|
584
|
-
}, null, 2)),
|
|
583
|
+
class: w(["absolute inset-0 bg-gradient-to-br z-0", U.value])
|
|
584
|
+
}, null, 2)), _("div", { class: w(["relative z-10 flex flex-col h-full transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] will-change-transform", r.isActive ? "opacity-100 translate-y-0" : "opacity-0 translate-y-2"]) }, [!r.bare || r.hasClose ? (O(), g("div", {
|
|
585
585
|
key: 0,
|
|
586
|
-
class:
|
|
587
|
-
}, [
|
|
586
|
+
class: w(["relative z-30 p-2", !r.bare && C.value !== "self" ? "backdrop-blur-lg" : ""])
|
|
587
|
+
}, [r.chatOnly ? (O(), g("div", {
|
|
588
588
|
key: 0,
|
|
589
|
-
class:
|
|
590
|
-
}, [
|
|
591
|
-
src:
|
|
592
|
-
alt:
|
|
589
|
+
class: w(["flex items-center", r.bare ? "justify-end" : ""])
|
|
590
|
+
}, [r.bare ? h("", !0) : (O(), g("div", Ie, [_("img", {
|
|
591
|
+
src: r.bot.avatarUrl.value,
|
|
592
|
+
alt: r.bot.displayName.value,
|
|
593
593
|
class: "size-8 rounded-full object-cover"
|
|
594
|
-
}, null, 8, Le),
|
|
595
|
-
class:
|
|
596
|
-
onClick:
|
|
597
|
-
}, [...
|
|
594
|
+
}, null, 8, Le), _("span", Re, N(r.bot.displayName.value), 1)])), r.hasClose ? (O(), g("div", ze, [_("button", {
|
|
595
|
+
class: w(["flex cursor-pointer items-center rounded-2xl p-3 transition-colors", r.bare ? "text-theme-500 hover:bg-theme-50" : "text-white/70 hover:bg-white/10"]),
|
|
596
|
+
onClick: i[0] || (i[0] = R((e) => s("close", "button"), ["stop"]))
|
|
597
|
+
}, [...i[7] || (i[7] = [_("i", { class: "size-6 i-tabler-x" }, null, -1)])], 2)])) : h("", !0)], 2)) : (O(), g("div", {
|
|
598
598
|
key: 1,
|
|
599
|
-
class:
|
|
599
|
+
class: w(["flex items-center", r.hasClose ? "" : "justify-between"])
|
|
600
600
|
}, [
|
|
601
|
-
|
|
601
|
+
_("div", { class: w(r.hasClose ? "flex-1 basis-0" : "") }, [_("button", {
|
|
602
602
|
class: "cursor-pointer p-2 flex items-center gap-2 rounded-2xl text-white/70 hover:bg-white/10 transition-all duration-300 ease-[cubic-bezier(0.25,1,0.33,1)] hover:scale-105 active:scale-95",
|
|
603
|
-
onClick:
|
|
604
|
-
}, [...
|
|
605
|
-
|
|
606
|
-
class:
|
|
607
|
-
onClick:
|
|
603
|
+
onClick: i[1] || (i[1] = (e) => l.value = !0)
|
|
604
|
+
}, [...i[8] || (i[8] = [_("i", { class: "i-tabler-menu size-7" }, null, -1)])])], 2),
|
|
605
|
+
_("button", {
|
|
606
|
+
class: w(["flex items-center gap-2 px-3.5 py-3 rounded-2xl text-white/90 hover:bg-white/10 transition-all cursor-pointer flex-grow-0", { "bg-white/10": d.value }]),
|
|
607
|
+
onClick: i[2] || (i[2] = (e) => d.value = !0)
|
|
608
608
|
}, [
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
609
|
+
_("i", { class: w([V.value?.icon, "size-4 opacity-60"]) }, null, 2),
|
|
610
|
+
_("span", Be, N(V.value?.label), 1),
|
|
611
|
+
i[9] || (i[9] = _("i", { class: "i-tabler-chevron-down size-4" }, null, -1))
|
|
612
612
|
], 2),
|
|
613
|
-
|
|
613
|
+
r.hasClose ? (O(), g("div", Ve, [_("button", {
|
|
614
614
|
class: "cursor-pointer flex items-center p-3 rounded-2xl text-white/70 hover:bg-white/10 transition-colors",
|
|
615
|
-
onClick:
|
|
616
|
-
}, [...
|
|
617
|
-
], 2))], 2)) :
|
|
615
|
+
onClick: i[3] || (i[3] = R((e) => s("close", "button"), ["stop"]))
|
|
616
|
+
}, [...i[10] || (i[10] = [_("i", { class: "size-6 i-tabler-x" }, null, -1)])])])) : h("", !0)
|
|
617
|
+
], 2))], 2)) : h("", !0), r.chatOnly ? (O(), g("div", {
|
|
618
618
|
key: 1,
|
|
619
|
-
class:
|
|
620
|
-
}, [
|
|
619
|
+
class: w(["relative z-20 flex min-h-0 w-full flex-1 flex-col", r.bare ? "" : "px-4"])
|
|
620
|
+
}, [_("div", { class: w(["min-h-0 w-full flex-1", r.bare ? "" : "mx-auto max-w-md"]) }, [b(o, {
|
|
621
621
|
"chat-controller": c.value,
|
|
622
|
-
bot:
|
|
623
|
-
scope:
|
|
624
|
-
"empty-state-message":
|
|
625
|
-
variant:
|
|
626
|
-
"show-header": !
|
|
627
|
-
centered:
|
|
628
|
-
},
|
|
622
|
+
bot: r.bot,
|
|
623
|
+
scope: B.value ? "private" : "public",
|
|
624
|
+
"empty-state-message": r.emptyStateMessage,
|
|
625
|
+
variant: r.bare ? "light" : "dark",
|
|
626
|
+
"show-header": !r.bare,
|
|
627
|
+
centered: r.bare
|
|
628
|
+
}, v({ _: 2 }, [t.$slots["empty-heading"] ? {
|
|
629
629
|
name: "empty-heading",
|
|
630
|
-
fn:
|
|
630
|
+
fn: I((e) => [j(t.$slots, "empty-heading", T(S(e)))]),
|
|
631
631
|
key: "0"
|
|
632
632
|
} : void 0]), 1032, [
|
|
633
633
|
"chat-controller",
|
|
@@ -637,61 +637,61 @@ var B = [
|
|
|
637
637
|
"variant",
|
|
638
638
|
"show-header",
|
|
639
639
|
"centered"
|
|
640
|
-
])], 2)], 2)) : (
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
bot:
|
|
644
|
-
"is-online":
|
|
640
|
+
])], 2)], 2)) : (O(), g(u, { key: 2 }, [C.value === "self" ? (O(), g("div", He, [
|
|
641
|
+
i[11] || (i[11] = _("div", { class: "flex-1 basis-0 mb-12" }, null, -1)),
|
|
642
|
+
b(xe, {
|
|
643
|
+
bot: r.bot,
|
|
644
|
+
"is-online": L.value
|
|
645
645
|
}, null, 8, ["bot", "is-online"]),
|
|
646
|
-
|
|
646
|
+
_("div", Q, [b(a, {
|
|
647
647
|
theme: "primary",
|
|
648
648
|
size: "lg",
|
|
649
649
|
class: "w-full",
|
|
650
|
-
icon:
|
|
650
|
+
icon: K.value,
|
|
651
651
|
"data-test": "voice-button",
|
|
652
|
-
onClick:
|
|
652
|
+
onClick: i[4] || (i[4] = (e) => c.value?.setMode("talk"))
|
|
653
653
|
}, {
|
|
654
|
-
default:
|
|
654
|
+
default: I(() => [y(N(G.value), 1)]),
|
|
655
655
|
_: 1
|
|
656
|
-
}, 8, ["icon"]),
|
|
656
|
+
}, 8, ["icon"]), r.bot.accounts.value && r.bot.accounts.value.length > 0 ? (O(), g("div", Ue, [(O(!0), g(u, null, A((r.bot.accounts.value || []).filter((t) => P(e)[t.platform]), (t) => (O(), g("a", {
|
|
657
657
|
key: `${t.platform}-${t.handle}`,
|
|
658
|
-
href:
|
|
658
|
+
href: P(e)[t.platform].getUrl(t.handle),
|
|
659
659
|
target: "_blank",
|
|
660
660
|
class: "size-12 rounded-full text-white/60 hover:text-white hover:bg-white/5 border border-white/0 hover:border-white/10 flex items-center justify-center transition-all duration-200 hover:scale-105"
|
|
661
|
-
}, [
|
|
662
|
-
])) :
|
|
661
|
+
}, [_("i", { class: w([P(e)[t.platform].icon, "size-5"]) }, null, 2)], 8, We))), 128))])) : h("", !0)])
|
|
662
|
+
])) : C.value === "talk" ? (O(), g("div", Ge, [r.requireAuth && !B.value ? (O(), m(J, {
|
|
663
663
|
key: 0,
|
|
664
|
-
sdk:
|
|
665
|
-
}, null, 8, ["sdk"])) : (
|
|
666
|
-
bot:
|
|
667
|
-
"is-online":
|
|
668
|
-
}, null, 8, ["bot", "is-online"])])]),
|
|
664
|
+
sdk: r.sdk
|
|
665
|
+
}, null, 8, ["sdk"])) : (O(), g(u, { key: 1 }, [_("div", null, [_("div", Ke, [b(n, {
|
|
666
|
+
bot: r.bot,
|
|
667
|
+
"is-online": L.value
|
|
668
|
+
}, null, 8, ["bot", "is-online"])])]), b(o, {
|
|
669
669
|
"chat-controller": c.value,
|
|
670
|
-
bot:
|
|
671
|
-
}, null, 8, ["chat-controller", "bot"])], 64))])) : (
|
|
670
|
+
bot: r.bot
|
|
671
|
+
}, null, 8, ["chat-controller", "bot"])], 64))])) : (O(), g("div", qe, [_("div", Je, [C.value === "chat" ? (O(), g(u, { key: 0 }, [r.requireAuth && !B.value ? (O(), m(J, {
|
|
672
672
|
key: 0,
|
|
673
|
-
sdk:
|
|
674
|
-
}, null, 8, ["sdk"])) : (
|
|
673
|
+
sdk: r.sdk
|
|
674
|
+
}, null, 8, ["sdk"])) : (O(), m(o, {
|
|
675
675
|
key: 1,
|
|
676
676
|
"chat-controller": c.value,
|
|
677
|
-
bot:
|
|
677
|
+
bot: r.bot,
|
|
678
678
|
"show-header": ""
|
|
679
|
-
}, null, 8, ["chat-controller", "bot"]))], 64)) :
|
|
679
|
+
}, null, 8, ["chat-controller", "bot"]))], 64)) : C.value === "info" ? (O(), m(de, {
|
|
680
680
|
key: 1,
|
|
681
|
-
bot:
|
|
682
|
-
"is-online":
|
|
683
|
-
}, null, 8, ["bot", "is-online"])) :
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
])])) : (
|
|
688
|
-
|
|
681
|
+
bot: r.bot,
|
|
682
|
+
"is-online": L.value
|
|
683
|
+
}, null, 8, ["bot", "is-online"])) : h("", !0)])]))], 64))], 2)], 14, Fe)) : f.value ? (O(), g("div", Ye, [_("div", Xe, [
|
|
684
|
+
i[12] || (i[12] = _("div", { class: "flex justify-center" }, [_("div", { class: "rounded-full bg-red-500/20 flex items-center justify-center size-10" }, [_("i", { class: "i-tabler-alert-circle size-6 text-red-400" })])], -1)),
|
|
685
|
+
i[13] || (i[13] = _("h3", { class: "text-lg font-medium" }, " Bot Error ", -1)),
|
|
686
|
+
_("p", Ze, N(f.value), 1)
|
|
687
|
+
])])) : (O(), g("div", Qe, " Couldn't load your assistant. Please try again later. ")),
|
|
688
|
+
r.chatOnly ? h("", !0) : (O(), m(Ne, {
|
|
689
689
|
key: 4,
|
|
690
|
-
modelValue:
|
|
691
|
-
"onUpdate:modelValue":
|
|
692
|
-
bot:
|
|
693
|
-
sdk:
|
|
694
|
-
title:
|
|
690
|
+
modelValue: l.value,
|
|
691
|
+
"onUpdate:modelValue": i[5] || (i[5] = (e) => l.value = e),
|
|
692
|
+
bot: r.bot,
|
|
693
|
+
sdk: r.sdk,
|
|
694
|
+
title: r.bot.displayName.value,
|
|
695
695
|
"data-test": "bot-sidebar"
|
|
696
696
|
}, null, 8, [
|
|
697
697
|
"modelValue",
|
|
@@ -699,16 +699,16 @@ var B = [
|
|
|
699
699
|
"sdk",
|
|
700
700
|
"title"
|
|
701
701
|
])),
|
|
702
|
-
|
|
702
|
+
r.chatOnly ? h("", !0) : (O(), m(Me, {
|
|
703
703
|
key: 5,
|
|
704
|
-
modelValue:
|
|
705
|
-
"onUpdate:modelValue":
|
|
704
|
+
modelValue: d.value,
|
|
705
|
+
"onUpdate:modelValue": i[6] || (i[6] = (e) => d.value = e),
|
|
706
706
|
"chat-controller": c.value,
|
|
707
707
|
"data-test": "bot-mode-sidebar"
|
|
708
708
|
}, null, 8, ["modelValue", "chat-controller"]))
|
|
709
709
|
]));
|
|
710
710
|
}
|
|
711
|
-
}), $e = /* @__PURE__ */
|
|
711
|
+
}), $e = /* @__PURE__ */ x({
|
|
712
712
|
__name: "BotProvider",
|
|
713
713
|
props: {
|
|
714
714
|
sdk: {},
|
|
@@ -733,8 +733,8 @@ var B = [
|
|
|
733
733
|
],
|
|
734
734
|
setup(e, { emit: t }) {
|
|
735
735
|
let n = e, r = t;
|
|
736
|
-
return (e, t) => (
|
|
737
|
-
default:
|
|
736
|
+
return (e, t) => (O(), m(c, C(n, { class: "bot-provider size-full relative" }), {
|
|
737
|
+
default: I((i) => [b($, {
|
|
738
738
|
sdk: i.sdk,
|
|
739
739
|
bot: i.bot,
|
|
740
740
|
context: i.context,
|
|
@@ -751,9 +751,9 @@ var B = [
|
|
|
751
751
|
onError: t[1] || (t[1] = (e) => r("error", e)),
|
|
752
752
|
onTurnStarted: t[2] || (t[2] = (e) => r("turnStarted")),
|
|
753
753
|
onTurnCompleted: t[3] || (t[3] = (e) => r("turnCompleted", e))
|
|
754
|
-
},
|
|
754
|
+
}, v({ _: 2 }, [e.$slots["empty-heading"] ? {
|
|
755
755
|
name: "empty-heading",
|
|
756
|
-
fn:
|
|
756
|
+
fn: I((t) => [j(e.$slots, "empty-heading", T(S(t)))]),
|
|
757
757
|
key: "0"
|
|
758
758
|
} : void 0]), 1032, [
|
|
759
759
|
"sdk",
|
|
@@ -771,6 +771,6 @@ var B = [
|
|
|
771
771
|
}, 16));
|
|
772
772
|
}
|
|
773
773
|
});
|
|
774
|
-
export {
|
|
774
|
+
export { l as i, $ as n, z as r, $e as t };
|
|
775
775
|
|
|
776
776
|
//# sourceMappingURL=BotProvider.js.map
|