@pagelines/sdk 1.0.686 → 1.0.688
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/AgentProvider.js +216 -163
- package/dist/AgentProvider.js.map +1 -1
- package/dist/AgentWrap.js +932 -872
- package/dist/AgentWrap.js.map +1 -1
- package/dist/agent/ui/AgentAvatar.vue.d.ts +27 -0
- package/dist/agent/ui/AgentChat.vue.d.ts +18 -2
- package/dist/agent/ui/AgentProvider.vue.d.ts +19 -2
- package/dist/agent/ui/AgentWrap.vue.d.ts +3 -0
- package/dist/agent/ui/ElAgentChat.vue.d.ts +16 -2
- package/dist/agent/ui/ElCreateAgent.vue.d.ts +54 -0
- package/dist/contract.js +10 -2
- package/dist/contract.js.map +1 -1
- package/dist/demo/index.d.ts +27 -0
- package/dist/sdkClient.d.ts +81 -0
- package/dist/widget/composables/useWidgetState.d.ts +81 -0
- package/dist/widget.js +1 -1
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
package/dist/AgentProvider.js
CHANGED
|
@@ -2,10 +2,10 @@ import "./rolldown-runtime.js";
|
|
|
2
2
|
import { SOCIAL_PLATFORMS as e } from "./constants.js";
|
|
3
3
|
import { a as t, c as n, d as r, f as i, i as a, l as o, m as s, n as c, o as l, s as u, t as d, u as ee } from "./AgentWrap.js";
|
|
4
4
|
import { getColorSchemeOklch as te } from "@pagelines/core";
|
|
5
|
-
import { Fragment as f, Transition as p, TransitionGroup as m, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y,
|
|
5
|
+
import { Fragment as f, Transition as p, TransitionGroup as m, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createSlots as b, createTextVNode as x, createVNode as S, defineComponent as C, guardReactiveProps as w, mergeProps as T, normalizeClass as E, normalizeProps as D, normalizeStyle as O, onMounted as k, onUnmounted as ne, openBlock as A, ref as j, renderList as M, renderSlot as N, shallowRef as re, toDisplayString as P, unref as F, watch as I, withCtx as L, withKeys as R, withModifiers as z } from "vue";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region ui/EffectTransitionList.vue
|
|
8
|
-
var
|
|
8
|
+
var B = /* @__PURE__ */ C({
|
|
9
9
|
__name: "EffectTransitionList",
|
|
10
10
|
props: {
|
|
11
11
|
disabled: {
|
|
@@ -15,28 +15,28 @@ var R = /* @__PURE__ */ S({
|
|
|
15
15
|
mode: { default: "block" }
|
|
16
16
|
},
|
|
17
17
|
setup(e) {
|
|
18
|
-
return (t, n) => (
|
|
19
|
-
default:
|
|
18
|
+
return (t, n) => (A(), g(m, { name: e.disabled ? "" : "nlist" }, {
|
|
19
|
+
default: L(() => [N(t.$slots, "default")]),
|
|
20
20
|
_: 3
|
|
21
21
|
}, 8, ["name"]));
|
|
22
22
|
}
|
|
23
|
-
}),
|
|
23
|
+
}), V = ["data-test-mode"], H = { class: "w-full max-w-xs space-y-12" }, U = {
|
|
24
24
|
key: 0,
|
|
25
25
|
class: "text-xs text-theme-400 text-center"
|
|
26
|
-
},
|
|
26
|
+
}, W = { class: "text-base font-light text-white text-center" }, G = { class: "space-y-6 relative" }, K = {
|
|
27
27
|
key: "email-field",
|
|
28
28
|
class: "w-full"
|
|
29
|
-
},
|
|
29
|
+
}, q = {
|
|
30
30
|
key: "code-field",
|
|
31
31
|
class: "w-full"
|
|
32
|
-
},
|
|
32
|
+
}, J = /* @__PURE__ */ C({
|
|
33
33
|
__name: "ElAuthGate",
|
|
34
34
|
props: { sdk: {} },
|
|
35
35
|
setup(e) {
|
|
36
|
-
let n =
|
|
36
|
+
let n = j({
|
|
37
37
|
email: "",
|
|
38
38
|
code: ""
|
|
39
|
-
}), r =
|
|
39
|
+
}), r = j("email"), i = j(!1), a = {
|
|
40
40
|
email: {
|
|
41
41
|
title: "Enter Your Email",
|
|
42
42
|
button: {
|
|
@@ -75,32 +75,32 @@ var R = /* @__PURE__ */ S({
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}, o = h(() => a[r.value]);
|
|
78
|
-
return
|
|
78
|
+
return I(() => e.sdk.activeUser.value, (e) => {
|
|
79
79
|
e && r.value === "code" && console.log("[ElAuthGate] Authentication successful", { email: e.email });
|
|
80
|
-
}), (i, a) => (
|
|
80
|
+
}), (i, a) => (A(), v("div", {
|
|
81
81
|
"data-test": "auth-form",
|
|
82
82
|
"data-test-mode": r.value,
|
|
83
83
|
class: "flex flex-col items-center justify-center h-full p-6"
|
|
84
|
-
}, [y("div",
|
|
85
|
-
e.sdk.error.value ? (
|
|
86
|
-
y("h3",
|
|
87
|
-
y("div",
|
|
88
|
-
default:
|
|
84
|
+
}, [y("div", H, [
|
|
85
|
+
e.sdk.error.value ? (A(), v("p", U, P(e.sdk.error.value), 1)) : _("", !0),
|
|
86
|
+
y("h3", W, P(o.value.title), 1),
|
|
87
|
+
y("div", G, [S(B, null, {
|
|
88
|
+
default: L(() => [r.value === "email" ? (A(), v("div", K, [S(l, {
|
|
89
89
|
modelValue: n.value.email,
|
|
90
90
|
"onUpdate:modelValue": a[0] || (a[0] = (e) => n.value.email = e),
|
|
91
91
|
"data-test": "auth-email-input",
|
|
92
|
-
onKeyup:
|
|
93
|
-
}, null, 8, ["modelValue", "onKeyup"])])) : (
|
|
92
|
+
onKeyup: R(o.value.action, ["enter"])
|
|
93
|
+
}, null, 8, ["modelValue", "onKeyup"])])) : (A(), v("div", q, [S(t, {
|
|
94
94
|
modelValue: n.value.code,
|
|
95
95
|
"onUpdate:modelValue": a[1] || (a[1] = (e) => n.value.code = e),
|
|
96
96
|
length: 6,
|
|
97
97
|
"focus-first": !0,
|
|
98
98
|
"data-test": "auth-code-input",
|
|
99
99
|
onAutoSubmit: o.value.action
|
|
100
|
-
}, null, 8, ["modelValue", "onAutoSubmit"])])), (
|
|
100
|
+
}, null, 8, ["modelValue", "onAutoSubmit"])])), (A(), v("div", {
|
|
101
101
|
key: o.value.button.label,
|
|
102
102
|
class: "space-y-4 w-full"
|
|
103
|
-
}, [
|
|
103
|
+
}, [S(u, {
|
|
104
104
|
theme: "primary",
|
|
105
105
|
size: "md",
|
|
106
106
|
class: "w-full",
|
|
@@ -109,34 +109,34 @@ var R = /* @__PURE__ */ S({
|
|
|
109
109
|
disabled: o.value.button.disabled() || e.sdk.loading.value,
|
|
110
110
|
onClick: o.value.action
|
|
111
111
|
}, {
|
|
112
|
-
default:
|
|
112
|
+
default: L(() => [x(P(o.value.button.label), 1)]),
|
|
113
113
|
_: 1
|
|
114
114
|
}, 8, [
|
|
115
115
|
"loading",
|
|
116
116
|
"disabled",
|
|
117
117
|
"onClick"
|
|
118
|
-
]), r.value === "code" ? (
|
|
118
|
+
]), r.value === "code" ? (A(), v("button", {
|
|
119
119
|
key: 0,
|
|
120
120
|
class: "w-full text-xs text-white/50 hover:text-white/70 transition-colors py-2",
|
|
121
121
|
onClick: a[2] || (a[2] = (e) => r.value = "email")
|
|
122
122
|
}, " Change Email ")) : _("", !0)]))]),
|
|
123
123
|
_: 1
|
|
124
124
|
})])
|
|
125
|
-
])], 8,
|
|
125
|
+
])], 8, V));
|
|
126
126
|
}
|
|
127
|
-
}),
|
|
127
|
+
}), 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 = {
|
|
128
128
|
key: 0,
|
|
129
129
|
class: "text-sm bg-white/10 backdrop-blur-sm rounded-2xl p-4 border border-white/20 space-y-3"
|
|
130
|
-
},
|
|
130
|
+
}, ae = ["innerHTML"], oe = {
|
|
131
131
|
key: 1,
|
|
132
132
|
class: "bg-white/5 backdrop-blur-sm rounded-2xl p-4 border border-white/10"
|
|
133
|
-
},
|
|
133
|
+
}, se = { class: "text-sm text-white/70 leading-relaxed" }, ce = {
|
|
134
134
|
key: 2,
|
|
135
135
|
class: "space-y-3"
|
|
136
|
-
},
|
|
136
|
+
}, le = ["href"], ue = {
|
|
137
137
|
key: 3,
|
|
138
138
|
class: "space-y-3"
|
|
139
|
-
},
|
|
139
|
+
}, de = { class: "grid grid-cols-2 gap-3" }, fe = ["href"], pe = /* @__PURE__ */ C({
|
|
140
140
|
__name: "ElAgentAbout",
|
|
141
141
|
props: {
|
|
142
142
|
agent: {},
|
|
@@ -146,34 +146,34 @@ var R = /* @__PURE__ */ S({
|
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
148
|
setup(t) {
|
|
149
|
-
return (n, r) => (
|
|
149
|
+
return (n, r) => (A(), v("div", Y, [S(a, {
|
|
150
150
|
agent: t.agent,
|
|
151
151
|
"is-online": t.isOnline
|
|
152
|
-
}, null, 8, ["agent", "is-online"]), y("div",
|
|
153
|
-
t.agent.summary.value ? (
|
|
152
|
+
}, null, 8, ["agent", "is-online"]), y("div", X, [
|
|
153
|
+
t.agent.summary.value ? (A(), v("div", ie, [r[0] || (r[0] = y("h3", { class: "font-medium text-white/50" }, " About ", -1)), y("div", {
|
|
154
154
|
class: "text-white/70 leading-relaxed",
|
|
155
155
|
innerHTML: t.agent.summary.value
|
|
156
|
-
}, null, 8,
|
|
157
|
-
t.agent.entityType.value === "company" ? (
|
|
158
|
-
t.agent.email.value ? (
|
|
156
|
+
}, null, 8, ae)])) : _("", !0),
|
|
157
|
+
t.agent.entityType.value === "company" ? (A(), v("div", oe, [r[1] || (r[1] = y("h3", { class: "text-sm font-medium text-white/90 mb-2" }, " Company Info ", -1)), y("p", se, " This is a company agent representing " + P(t.agent.name.value) + ". ", 1)])) : _("", !0),
|
|
158
|
+
t.agent.email.value ? (A(), v("div", ce, [r[3] || (r[3] = y("h3", { class: "text-sm font-medium text-white/90" }, " Contact ", -1)), y("a", {
|
|
159
159
|
href: `mailto:${t.agent.email.value}`,
|
|
160
160
|
target: "_blank",
|
|
161
161
|
rel: "noopener noreferrer",
|
|
162
162
|
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"
|
|
163
|
-
}, [...r[2] || (r[2] = [y("span", { class: "i-heroicons-envelope flex items-center size-[1.1em] mt-[-.07em]" }, null, -1),
|
|
164
|
-
t.agent.accounts.value && t.agent.accounts.value.length > 0 ? (
|
|
163
|
+
}, [...r[2] || (r[2] = [y("span", { class: "i-heroicons-envelope flex items-center size-[1.1em] mt-[-.07em]" }, null, -1), x(" Email ", -1)])], 8, le)])) : _("", !0),
|
|
164
|
+
t.agent.accounts.value && t.agent.accounts.value.length > 0 ? (A(), v("div", ue, [r[4] || (r[4] = y("h3", { class: "text-sm font-medium text-white/90" }, " Links ", -1)), y("div", de, [(A(!0), v(f, null, M(t.agent.accounts.value, (t) => (A(), v("a", {
|
|
165
165
|
key: `${t.platform}-${t.handle}`,
|
|
166
|
-
href:
|
|
166
|
+
href: F(e)[t.platform].getUrl(t.handle),
|
|
167
167
|
target: "_blank",
|
|
168
168
|
rel: "noopener noreferrer",
|
|
169
169
|
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"
|
|
170
|
-
}, [y("span", { class:
|
|
170
|
+
}, [y("span", { class: E(["flex items-center size-[1.1em] mt-[-.07em]", F(e)[t.platform].icon]) }, null, 2), x(" " + P(F(e)[t.platform].label), 1)], 8, fe))), 128))])])) : _("", !0)
|
|
171
171
|
])]));
|
|
172
172
|
}
|
|
173
|
-
}),
|
|
173
|
+
}), me = { class: "flex flex-col items-center text-center gap-4" }, he = { class: "relative flex-shrink-0" }, ge = { class: "w-20 h-20 sm:w-24 sm:h-24 rounded-full overflow-hidden border-4 border-white" }, _e = ["src", "alt"], ve = { class: "absolute top-1.5 right-1.5" }, ye = {
|
|
174
174
|
key: 1,
|
|
175
175
|
class: "size-4 bg-theme-400 rounded-full ring-2 ring-white"
|
|
176
|
-
},
|
|
176
|
+
}, be = { class: "min-w-0" }, xe = { class: "text-3xl font-light text-white mb-2 truncate" }, Se = { class: "text-base font-light text-white/60 line-clamp-1" }, Ce = /* @__PURE__ */ C({
|
|
177
177
|
__name: "ElAgentHeader",
|
|
178
178
|
props: {
|
|
179
179
|
agent: {},
|
|
@@ -183,53 +183,53 @@ var R = /* @__PURE__ */ S({
|
|
|
183
183
|
}
|
|
184
184
|
},
|
|
185
185
|
setup(e) {
|
|
186
|
-
return (t, n) => (
|
|
186
|
+
return (t, n) => (A(), v("div", me, [y("div", he, [y("div", ge, [y("img", {
|
|
187
187
|
src: e.agent.avatarUrl.value,
|
|
188
188
|
alt: e.agent.displayName.value,
|
|
189
189
|
class: "w-full h-full object-cover",
|
|
190
|
-
onError: n[0] || (n[0] = (...e) =>
|
|
191
|
-
}, null, 40,
|
|
190
|
+
onError: n[0] || (n[0] = (...e) => F(o) && F(o)(...e))
|
|
191
|
+
}, null, 40, _e)]), y("div", ve, [e.isOnline ? (A(), v(f, { key: 0 }, [n[1] || (n[1] = y("div", {
|
|
192
192
|
class: "size-4 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
193
193
|
style: { "animation-duration": "3s" }
|
|
194
|
-
}, null, -1)), n[2] || (n[2] = y("div", { class: "size-4 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (
|
|
194
|
+
}, null, -1)), n[2] || (n[2] = y("div", { class: "size-4 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (A(), v("div", ye))])]), y("div", be, [y("h1", xe, P(e.agent.displayName.value), 1), y("p", Se, P(e.agent.title.value), 1)])]));
|
|
195
195
|
}
|
|
196
|
-
}),
|
|
196
|
+
}), we = { class: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden" }, Te = /* @__PURE__ */ C({
|
|
197
197
|
name: "SelfSidebarClose",
|
|
198
198
|
__name: "AgentSidebarClose",
|
|
199
199
|
emits: ["click"],
|
|
200
200
|
setup(e) {
|
|
201
|
-
let t =
|
|
202
|
-
return
|
|
201
|
+
let t = j(!1);
|
|
202
|
+
return k(() => {
|
|
203
203
|
setTimeout(() => {
|
|
204
204
|
t.value = !0;
|
|
205
205
|
}, 100);
|
|
206
|
-
}), (e, n) => (
|
|
206
|
+
}), (e, n) => (A(), v("a", {
|
|
207
207
|
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",
|
|
208
208
|
onClick: n[0] || (n[0] = (t) => e.$emit("click", t))
|
|
209
|
-
}, [n[1] || (n[1] = y("span", { class: "absolute inset-0 rounded-full transition-all" }, null, -1)), y("span",
|
|
210
|
-
class:
|
|
209
|
+
}, [n[1] || (n[1] = y("span", { class: "absolute inset-0 rounded-full transition-all" }, null, -1)), y("span", we, [y("span", {
|
|
210
|
+
class: E(["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"]),
|
|
211
211
|
style: {
|
|
212
212
|
"background-color": "currentColor",
|
|
213
213
|
"transition-delay": "0.15s"
|
|
214
214
|
}
|
|
215
215
|
}, null, 2), y("span", {
|
|
216
|
-
class:
|
|
216
|
+
class: E(["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"]),
|
|
217
217
|
style: {
|
|
218
218
|
"background-color": "currentColor",
|
|
219
219
|
"transition-delay": "0.45s"
|
|
220
220
|
}
|
|
221
221
|
}, null, 2)])]));
|
|
222
222
|
}
|
|
223
|
-
}),
|
|
223
|
+
}), Ee = {
|
|
224
224
|
key: 0,
|
|
225
225
|
class: "px-9 pt-12 pb-4"
|
|
226
|
-
},
|
|
226
|
+
}, De = { class: "text-base font-medium text-theme-400" }, Oe = {
|
|
227
227
|
key: 1,
|
|
228
228
|
class: "px-4 pb-8 border-b border-white/10"
|
|
229
|
-
},
|
|
229
|
+
}, ke = ["disabled", "onClick"], Ae = { class: "flex items-center gap-3" }, je = { class: "flex-1" }, Me = {
|
|
230
230
|
key: 0,
|
|
231
231
|
class: "text-xs text-white/50 mt-0.5"
|
|
232
|
-
},
|
|
232
|
+
}, Ne = { class: "p-6" }, Z = /* @__PURE__ */ C({
|
|
233
233
|
name: "ElSidebar",
|
|
234
234
|
inheritAttrs: !1,
|
|
235
235
|
__name: "ElSidebar",
|
|
@@ -263,7 +263,7 @@ var R = /* @__PURE__ */ S({
|
|
|
263
263
|
position: "justify-end",
|
|
264
264
|
closeButton: "-left-16"
|
|
265
265
|
});
|
|
266
|
-
return (t, n) => (
|
|
266
|
+
return (t, n) => (A(), v(f, null, [S(p, {
|
|
267
267
|
"enter-active-class": "transition-opacity duration-300 ease-out",
|
|
268
268
|
"leave-active-class": "transition-opacity duration-200 ease-in",
|
|
269
269
|
"enter-from-class": "opacity-0",
|
|
@@ -271,13 +271,13 @@ var R = /* @__PURE__ */ S({
|
|
|
271
271
|
"leave-from-class": "opacity-100",
|
|
272
272
|
"leave-to-class": "opacity-0"
|
|
273
273
|
}, {
|
|
274
|
-
default:
|
|
274
|
+
default: L(() => [o.value ? (A(), v("div", {
|
|
275
275
|
key: 0,
|
|
276
276
|
class: "absolute inset-0 z-40 bg-black/50 backdrop-blur-sm",
|
|
277
277
|
onClick: n[0] || (n[0] = (e) => o.value = !1)
|
|
278
278
|
})) : _("", !0)]),
|
|
279
279
|
_: 1
|
|
280
|
-
}),
|
|
280
|
+
}), S(p, {
|
|
281
281
|
"enter-active-class": "transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)]",
|
|
282
282
|
"leave-active-class": "transition-all duration-400 ease-[cubic-bezier(0.25,1,0.33,1)]",
|
|
283
283
|
"enter-from-class": c.value.enter,
|
|
@@ -285,49 +285,49 @@ var R = /* @__PURE__ */ S({
|
|
|
285
285
|
"leave-from-class": "translate-x-0",
|
|
286
286
|
"leave-to-class": c.value.leave
|
|
287
287
|
}, {
|
|
288
|
-
default:
|
|
288
|
+
default: L(() => [o.value ? (A(), v("div", {
|
|
289
289
|
key: 0,
|
|
290
|
-
class:
|
|
290
|
+
class: E(["absolute inset-0 z-50 flex", c.value.position]),
|
|
291
291
|
onClick: n[3] || (n[3] = (e) => o.value = !1)
|
|
292
292
|
}, [y("div", {
|
|
293
|
-
class:
|
|
294
|
-
onClick: n[2] || (n[2] =
|
|
293
|
+
class: E(["relative h-full shadow-2xl bg-black/30 backdrop-blur-xl flex flex-col justify-center", F(a)]),
|
|
294
|
+
onClick: n[2] || (n[2] = z(() => {}, ["stop"]))
|
|
295
295
|
}, [
|
|
296
|
-
|
|
297
|
-
class:
|
|
296
|
+
S(Te, {
|
|
297
|
+
class: E(["absolute top-4 z-10 text-white", c.value.closeButton]),
|
|
298
298
|
onClick: n[1] || (n[1] = (e) => o.value = !1)
|
|
299
299
|
}, null, 8, ["class"]),
|
|
300
|
-
e.title ? (
|
|
301
|
-
t.$slots.header ? (
|
|
302
|
-
y("div", { class:
|
|
300
|
+
e.title ? (A(), v("div", Ee, [y("h3", De, P(e.title), 1)])) : _("", !0),
|
|
301
|
+
t.$slots.header ? (A(), v("div", Oe, [N(t.$slots, "header")])) : _("", !0),
|
|
302
|
+
y("div", { class: E(["flex-1 p-6 space-y-2 overflow-y-auto", {
|
|
303
303
|
"pt-6": !e.title && !t.$slots.header,
|
|
304
304
|
"pt-4": e.title || t.$slots.header
|
|
305
|
-
}]) }, [
|
|
305
|
+
}]) }, [S(m, {
|
|
306
306
|
"enter-active-class": "transition-all duration-400 ease-[cubic-bezier(0.25,1,0.33,1)]",
|
|
307
307
|
"leave-active-class": "transition-all duration-200 ease-[cubic-bezier(0.25,1,0.33,1)]",
|
|
308
|
-
"enter-from-class":
|
|
308
|
+
"enter-from-class": F(i) === "left" ? "-translate-x-4 opacity-0" : "translate-x-4 opacity-0",
|
|
309
309
|
"enter-to-class": "translate-x-0 opacity-100",
|
|
310
310
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
311
|
-
"leave-to-class":
|
|
311
|
+
"leave-to-class": F(i) === "left" ? "-translate-x-4 opacity-0" : "translate-x-4 opacity-0"
|
|
312
312
|
}, {
|
|
313
|
-
default:
|
|
313
|
+
default: L(() => [(A(!0), v(f, null, M(s.value, (e, t) => (A(), v("button", {
|
|
314
314
|
key: e.key || e.label || t,
|
|
315
|
-
style:
|
|
316
|
-
class:
|
|
315
|
+
style: O({ transitionDelay: `${t * 40}ms` }),
|
|
316
|
+
class: E(["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"]]),
|
|
317
317
|
disabled: e.isDisabled,
|
|
318
318
|
onClick: (t) => handleItemClick(e)
|
|
319
|
-
}, [y("div",
|
|
319
|
+
}, [y("div", Ae, [e.icon?.src ? (A(), v("i", {
|
|
320
320
|
key: 0,
|
|
321
|
-
class:
|
|
322
|
-
}, null, 2)) : _("", !0), y("div",
|
|
321
|
+
class: E(["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"]])
|
|
322
|
+
}, null, 2)) : _("", !0), y("div", je, [y("div", { class: E(["font-medium text-sm", e.isActive ? "text-primary-300" : "text-white"]) }, P(e.label), 3), e.subLabel ? (A(), v("div", Me, P(e.subLabel), 1)) : _("", !0)])])], 14, ke))), 128))]),
|
|
323
323
|
_: 1
|
|
324
324
|
}, 8, ["enter-from-class", "leave-to-class"])], 2),
|
|
325
|
-
y("div",
|
|
325
|
+
y("div", Ne, [N(t.$slots, "footer")])
|
|
326
326
|
], 2)], 2)) : _("", !0)]),
|
|
327
327
|
_: 3
|
|
328
328
|
}, 8, ["enter-from-class", "leave-to-class"])], 64));
|
|
329
329
|
}
|
|
330
|
-
}),
|
|
330
|
+
}), Pe = /* @__PURE__ */ C({
|
|
331
331
|
name: "AgentModeSidebar",
|
|
332
332
|
__name: "ElAgentModeSidebar",
|
|
333
333
|
props: {
|
|
@@ -348,7 +348,7 @@ var R = /* @__PURE__ */ S({
|
|
|
348
348
|
n.chatController?.setMode(e.mode);
|
|
349
349
|
}
|
|
350
350
|
})));
|
|
351
|
-
return (e, t) => (
|
|
351
|
+
return (e, t) => (A(), g(Z, {
|
|
352
352
|
modelValue: a.value,
|
|
353
353
|
"onUpdate:modelValue": t[0] || (t[0] = (e) => a.value = e),
|
|
354
354
|
items: s.value,
|
|
@@ -357,7 +357,7 @@ var R = /* @__PURE__ */ S({
|
|
|
357
357
|
"width-classes": "w-[80%] max-w-[255px]"
|
|
358
358
|
}, null, 8, ["modelValue", "items"]));
|
|
359
359
|
}
|
|
360
|
-
}),
|
|
360
|
+
}), Fe = /* @__PURE__ */ C({
|
|
361
361
|
name: "AgentSidebar",
|
|
362
362
|
__name: "ElAgentSidebar",
|
|
363
363
|
props: {
|
|
@@ -410,7 +410,7 @@ var R = /* @__PURE__ */ S({
|
|
|
410
410
|
}
|
|
411
411
|
}), e;
|
|
412
412
|
});
|
|
413
|
-
return (t, n) => (
|
|
413
|
+
return (t, n) => (A(), g(Z, {
|
|
414
414
|
modelValue: i.value,
|
|
415
415
|
"onUpdate:modelValue": n[0] || (n[0] = (e) => i.value = e),
|
|
416
416
|
items: a.value,
|
|
@@ -422,22 +422,19 @@ var R = /* @__PURE__ */ S({
|
|
|
422
422
|
"title"
|
|
423
423
|
]));
|
|
424
424
|
}
|
|
425
|
-
}),
|
|
425
|
+
}), Ie = {
|
|
426
426
|
key: 0,
|
|
427
427
|
class: "absolute inset-0 flex items-center justify-center bg-gradient-to-br from-theme-800 to-theme-950 rounded-3xl z-10"
|
|
428
|
-
},
|
|
429
|
-
key: 0,
|
|
430
|
-
class: "flex items-center"
|
|
431
|
-
}, Ie = { class: "flex-1 flex items-center gap-3 pl-2" }, Le = ["src", "alt"], Re = { class: "text-white/90 text-sm font-medium" }, ze = {
|
|
428
|
+
}, Le = ["data-quality"], Re = {
|
|
432
429
|
key: 0,
|
|
430
|
+
class: "flex flex-1 items-center gap-3 pl-2"
|
|
431
|
+
}, ze = ["src", "alt"], Be = { class: "text-sm font-medium text-white/90" }, Ve = {
|
|
432
|
+
key: 1,
|
|
433
433
|
class: "flex justify-end"
|
|
434
|
-
},
|
|
434
|
+
}, He = { class: "text-sm" }, Q = {
|
|
435
435
|
key: 0,
|
|
436
436
|
class: "flex-1 basis-0 flex justify-end"
|
|
437
|
-
},
|
|
438
|
-
key: 0,
|
|
439
|
-
class: "flex-1 flex flex-col relative z-20 min-h-0 w-full px-4"
|
|
440
|
-
}, Q = { class: "flex-1 min-h-0 max-w-md mx-auto w-full" }, Ue = {
|
|
437
|
+
}, Ue = {
|
|
441
438
|
key: 0,
|
|
442
439
|
class: "h-full pb-12 flex-1 flex flex-col relative z-20 min-h-0 px-4 @[480px]/agent:px-6 max-w-md mx-auto w-full"
|
|
443
440
|
}, We = { class: "flex-1 basis-0 flex flex-col justify-start pt-8 gap-7" }, Ge = {
|
|
@@ -455,7 +452,7 @@ var R = /* @__PURE__ */ S({
|
|
|
455
452
|
}, Qe = { class: "text-center max-w-md space-y-4" }, $e = { class: "text-sm text-white/70 leading-relaxed" }, et = {
|
|
456
453
|
key: 3,
|
|
457
454
|
class: "bg-white/10 backdrop-blur-sm text-white/70 flex items-center justify-center h-full"
|
|
458
|
-
}, $ = /* @__PURE__ */
|
|
455
|
+
}, $ = /* @__PURE__ */ C({
|
|
459
456
|
__name: "AgentChat",
|
|
460
457
|
props: {
|
|
461
458
|
sdk: {},
|
|
@@ -484,11 +481,17 @@ var R = /* @__PURE__ */ S({
|
|
|
484
481
|
chatOnly: {
|
|
485
482
|
type: Boolean,
|
|
486
483
|
default: !1
|
|
487
|
-
}
|
|
484
|
+
},
|
|
485
|
+
bare: {
|
|
486
|
+
type: Boolean,
|
|
487
|
+
default: !1
|
|
488
|
+
},
|
|
489
|
+
emptyStateMessage: {},
|
|
490
|
+
suggestedPrompts: { default: () => [] }
|
|
488
491
|
},
|
|
489
492
|
emits: ["close", "error"],
|
|
490
493
|
setup(t, { emit: o }) {
|
|
491
|
-
let l = o, d =
|
|
494
|
+
let l = o, d = re(), p = j(!1), m = j(!1), C = j(), T = j(), R = h(() => d.value?.agentMode?.value ?? "self"), B = h(() => d.value?.textState.value.isConnected ?? !1), V = h(() => t.sdk.activeUser.value !== void 0), H = h(() => i.find((e) => e.mode === R.value));
|
|
492
495
|
function createChatController() {
|
|
493
496
|
d.value && d.value.destroy();
|
|
494
497
|
try {
|
|
@@ -502,132 +505,168 @@ var R = /* @__PURE__ */ S({
|
|
|
502
505
|
throw console.error("AgentChatController creation failed:", e), e;
|
|
503
506
|
}
|
|
504
507
|
}
|
|
508
|
+
try {
|
|
509
|
+
createChatController();
|
|
510
|
+
} catch (e) {
|
|
511
|
+
let t = e instanceof Error ? e.message : "Couldn't initialize your assistant";
|
|
512
|
+
C.value = t, l("error", t);
|
|
513
|
+
}
|
|
505
514
|
function applyTheme(e) {
|
|
506
|
-
if (!
|
|
515
|
+
if (!T.value) return;
|
|
507
516
|
let t = te(e);
|
|
508
517
|
Object.entries(t).forEach(([e, t]) => {
|
|
509
|
-
|
|
518
|
+
T.value.style.setProperty(`--primary-${e}`, t);
|
|
510
519
|
});
|
|
511
520
|
}
|
|
512
|
-
|
|
521
|
+
k(() => {
|
|
513
522
|
try {
|
|
514
|
-
|
|
523
|
+
applyTheme(t.theme), t.chatOnly && d.value && d.value.setMode("chat");
|
|
515
524
|
} catch (e) {
|
|
516
525
|
let t = e instanceof Error ? e.message : "Couldn't initialize your assistant";
|
|
517
|
-
|
|
526
|
+
C.value = t, l("error", t);
|
|
518
527
|
}
|
|
519
|
-
}),
|
|
528
|
+
}), ne(() => {
|
|
520
529
|
d.value && d.value.destroy();
|
|
521
|
-
}),
|
|
530
|
+
}), I(() => t.theme, (e) => {
|
|
522
531
|
applyTheme(e);
|
|
523
|
-
}),
|
|
532
|
+
}), I(() => t.sdk.activeUser.value, (e, t) => {
|
|
524
533
|
t && !e && d.value && d.value.setMode("self");
|
|
525
534
|
});
|
|
526
|
-
let
|
|
527
|
-
let e = [
|
|
528
|
-
return
|
|
529
|
-
}),
|
|
535
|
+
let U = h(() => !!(t.agent.cover.value?.src && t.agent.cover.value?.quality === "low") || !!(t.agent.avatar.value?.src && t.agent.avatar.value?.quality === "low")), W = h(() => {
|
|
536
|
+
let e = [U.value ? "backdrop-blur-sm" : ""];
|
|
537
|
+
return U.value && R.value === "self" ? e.push("from-black/80 via-black/60 to-black/80") : R.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(" ");
|
|
538
|
+
}), G = {
|
|
530
539
|
phone: "i-heroicons-phone",
|
|
531
540
|
calendar: "i-heroicons-calendar",
|
|
532
541
|
question: "i-heroicons-question-mark-circle",
|
|
533
542
|
message: "i-heroicons-chat-bubble-left-right",
|
|
534
543
|
sparkles: "i-heroicons-sparkles"
|
|
535
|
-
},
|
|
544
|
+
}, K = h(() => ee({
|
|
536
545
|
template: t.buttonText || "Talk to {name}",
|
|
537
546
|
agent: t.agent.toConfig()
|
|
538
|
-
})),
|
|
539
|
-
return (r, i) => (
|
|
547
|
+
})), q = h(() => G[t.buttonIcon || "phone"] || G.phone);
|
|
548
|
+
return (r, i) => (A(), v("div", {
|
|
540
549
|
ref_key: "rootElement",
|
|
541
|
-
ref:
|
|
542
|
-
key:
|
|
550
|
+
ref: T,
|
|
551
|
+
key: F(n)(t.agent.toConfig()),
|
|
543
552
|
class: "pagelines-sdk @container/agent pagelines-agent w-full h-full overflow-hidden relative",
|
|
544
553
|
"data-test": "agent-chat"
|
|
545
554
|
}, [
|
|
546
|
-
t.loading ? (
|
|
555
|
+
t.loading ? (A(), v("div", Ie, [S(s, { class: "text-white size-8" })])) : t.agent && !C.value ? (A(), v("div", {
|
|
547
556
|
key: 1,
|
|
548
|
-
class: "absolute inset-0 bg-cover bg-center bg-no-repeat",
|
|
549
|
-
style:
|
|
557
|
+
class: E(["absolute inset-0", t.bare ? "bg-theme-0" : "bg-cover bg-center bg-no-repeat"]),
|
|
558
|
+
style: O(t.bare ? void 0 : { backgroundImage: `url(${F(n)(t.agent.toConfig())})` }),
|
|
550
559
|
"data-quality": t.agent.avatar.value?.quality || "none"
|
|
551
|
-
}, [
|
|
552
|
-
|
|
560
|
+
}, [t.bare ? _("", !0) : (A(), v("div", {
|
|
561
|
+
key: 0,
|
|
562
|
+
class: E(["absolute inset-0 bg-gradient-to-br z-0", W.value])
|
|
563
|
+
}, null, 2)), y("div", { class: E(["relative z-10 flex flex-col h-full transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] will-change-transform", t.isActive ? "opacity-100 translate-y-0" : "opacity-0 translate-y-2"]) }, [!t.bare || t.hasClose ? (A(), v("div", {
|
|
564
|
+
key: 0,
|
|
565
|
+
class: E(["relative z-30 p-2", !t.bare && R.value !== "self" ? "backdrop-blur-lg" : ""])
|
|
566
|
+
}, [t.chatOnly ? (A(), v("div", {
|
|
567
|
+
key: 0,
|
|
568
|
+
class: E(["flex items-center", t.bare ? "justify-end" : ""])
|
|
569
|
+
}, [t.bare ? _("", !0) : (A(), v("div", Re, [y("img", {
|
|
570
|
+
src: F(n)(t.agent.toConfig()),
|
|
553
571
|
alt: t.agent.displayName.value,
|
|
554
572
|
class: "size-8 rounded-full object-cover"
|
|
555
|
-
}, null, 8,
|
|
556
|
-
class: "cursor-pointer
|
|
557
|
-
onClick: i[0] || (i[0] =
|
|
558
|
-
}, [...i[7] || (i[7] = [y("i", { class: "size-6 i-tabler-x" }, null, -1)])])])) : _("", !0)])) : (
|
|
573
|
+
}, null, 8, ze), y("span", Be, P(t.agent.displayName.value), 1)])), t.hasClose ? (A(), v("div", Ve, [y("button", {
|
|
574
|
+
class: E(["flex cursor-pointer items-center rounded-2xl p-3 transition-colors", t.bare ? "text-theme-500 hover:bg-theme-50" : "text-white/70 hover:bg-white/10"]),
|
|
575
|
+
onClick: i[0] || (i[0] = z((e) => l("close", "button"), ["stop"]))
|
|
576
|
+
}, [...i[7] || (i[7] = [y("i", { class: "size-6 i-tabler-x" }, null, -1)])], 2)])) : _("", !0)], 2)) : (A(), v("div", {
|
|
559
577
|
key: 1,
|
|
560
|
-
class:
|
|
578
|
+
class: E(["flex items-center", t.hasClose ? "" : "justify-between"])
|
|
561
579
|
}, [
|
|
562
|
-
y("div", { class:
|
|
580
|
+
y("div", { class: E(t.hasClose ? "flex-1 basis-0" : "") }, [y("button", {
|
|
563
581
|
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",
|
|
564
582
|
onClick: i[1] || (i[1] = (e) => p.value = !0)
|
|
565
583
|
}, [...i[8] || (i[8] = [y("i", { class: "i-tabler-menu size-7" }, null, -1)])])], 2),
|
|
566
584
|
y("button", {
|
|
567
|
-
class:
|
|
585
|
+
class: E(["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": m.value }]),
|
|
568
586
|
onClick: i[2] || (i[2] = (e) => m.value = !0)
|
|
569
587
|
}, [
|
|
570
|
-
y("i", { class:
|
|
571
|
-
y("span",
|
|
588
|
+
y("i", { class: E([H.value?.icon, "size-4 opacity-60"]) }, null, 2),
|
|
589
|
+
y("span", He, P(H.value?.label), 1),
|
|
572
590
|
i[9] || (i[9] = y("i", { class: "i-tabler-chevron-down size-4" }, null, -1))
|
|
573
591
|
], 2),
|
|
574
|
-
t.hasClose ? (
|
|
592
|
+
t.hasClose ? (A(), v("div", Q, [y("button", {
|
|
575
593
|
class: "cursor-pointer flex items-center p-3 rounded-2xl text-white/70 hover:bg-white/10 transition-colors",
|
|
576
|
-
onClick: i[3] || (i[3] =
|
|
594
|
+
onClick: i[3] || (i[3] = z((e) => l("close", "button"), ["stop"]))
|
|
577
595
|
}, [...i[10] || (i[10] = [y("i", { class: "size-6 i-tabler-x" }, null, -1)])])])) : _("", !0)
|
|
578
|
-
], 2))], 2), t.chatOnly ? (
|
|
596
|
+
], 2))], 2)) : _("", !0), t.chatOnly ? (A(), v("div", {
|
|
597
|
+
key: 1,
|
|
598
|
+
class: E(["relative z-20 flex min-h-0 w-full flex-1 flex-col", t.bare ? "bg-theme-0" : "px-4"])
|
|
599
|
+
}, [y("div", { class: E(["min-h-0 w-full flex-1", t.bare ? "" : "mx-auto max-w-md"]) }, [S(c, {
|
|
579
600
|
"chat-controller": d.value,
|
|
580
601
|
agent: t.agent,
|
|
581
|
-
"
|
|
582
|
-
|
|
602
|
+
scope: V.value ? "private" : "public",
|
|
603
|
+
"empty-state-message": t.emptyStateMessage,
|
|
604
|
+
"suggested-prompts": t.suggestedPrompts,
|
|
605
|
+
variant: t.bare ? "light" : "dark",
|
|
606
|
+
"show-header": !t.bare,
|
|
607
|
+
centered: t.bare
|
|
608
|
+
}, b({ _: 2 }, [r.$slots["empty-heading"] ? {
|
|
609
|
+
name: "empty-heading",
|
|
610
|
+
fn: L((e) => [N(r.$slots, "empty-heading", D(w(e)))]),
|
|
611
|
+
key: "0"
|
|
612
|
+
} : void 0]), 1032, [
|
|
613
|
+
"chat-controller",
|
|
614
|
+
"agent",
|
|
615
|
+
"scope",
|
|
616
|
+
"empty-state-message",
|
|
617
|
+
"suggested-prompts",
|
|
618
|
+
"variant",
|
|
619
|
+
"show-header",
|
|
620
|
+
"centered"
|
|
621
|
+
])], 2)], 2)) : (A(), v(f, { key: 2 }, [R.value === "self" ? (A(), v("div", Ue, [
|
|
583
622
|
i[11] || (i[11] = y("div", { class: "flex-1 basis-0 mb-12" }, null, -1)),
|
|
584
|
-
|
|
623
|
+
S(Ce, {
|
|
585
624
|
agent: t.agent,
|
|
586
|
-
"is-online":
|
|
625
|
+
"is-online": B.value
|
|
587
626
|
}, null, 8, ["agent", "is-online"]),
|
|
588
|
-
y("div", We, [
|
|
627
|
+
y("div", We, [S(u, {
|
|
589
628
|
theme: "primary",
|
|
590
629
|
size: "lg",
|
|
591
630
|
class: "w-full",
|
|
592
|
-
icon:
|
|
631
|
+
icon: q.value,
|
|
593
632
|
"data-test": "voice-button",
|
|
594
633
|
onClick: i[4] || (i[4] = (e) => d.value?.setMode("talk"))
|
|
595
634
|
}, {
|
|
596
|
-
default:
|
|
635
|
+
default: L(() => [x(P(K.value), 1)]),
|
|
597
636
|
_: 1
|
|
598
|
-
}, 8, ["icon"]), t.agent.accounts.value && t.agent.accounts.value.length > 0 ? (
|
|
637
|
+
}, 8, ["icon"]), t.agent.accounts.value && t.agent.accounts.value.length > 0 ? (A(), v("div", Ge, [(A(!0), v(f, null, M((t.agent.accounts.value || []).filter((t) => F(e)[t.platform]), (t) => (A(), v("a", {
|
|
599
638
|
key: `${t.platform}-${t.handle}`,
|
|
600
|
-
href:
|
|
639
|
+
href: F(e)[t.platform].getUrl(t.handle),
|
|
601
640
|
target: "_blank",
|
|
602
641
|
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"
|
|
603
|
-
}, [y("i", { class:
|
|
604
|
-
])) :
|
|
642
|
+
}, [y("i", { class: E([F(e)[t.platform].icon, "size-5"]) }, null, 2)], 8, Ke))), 128))])) : _("", !0)])
|
|
643
|
+
])) : R.value === "talk" ? (A(), v("div", qe, [t.requireAuth && !V.value ? (A(), g(J, {
|
|
605
644
|
key: 0,
|
|
606
645
|
sdk: t.sdk
|
|
607
|
-
}, null, 8, ["sdk"])) : (
|
|
646
|
+
}, null, 8, ["sdk"])) : (A(), v(f, { key: 1 }, [y("div", null, [y("div", Je, [S(a, {
|
|
608
647
|
agent: t.agent,
|
|
609
|
-
"is-online":
|
|
610
|
-
}, null, 8, ["agent", "is-online"])])]),
|
|
648
|
+
"is-online": B.value
|
|
649
|
+
}, null, 8, ["agent", "is-online"])])]), S(c, {
|
|
611
650
|
"chat-controller": d.value,
|
|
612
651
|
agent: t.agent
|
|
613
|
-
}, null, 8, ["chat-controller", "agent"])], 64))])) : (
|
|
652
|
+
}, null, 8, ["chat-controller", "agent"])], 64))])) : (A(), v("div", Ye, [y("div", Xe, [R.value === "chat" ? (A(), v(f, { key: 0 }, [t.requireAuth && !V.value ? (A(), g(J, {
|
|
614
653
|
key: 0,
|
|
615
654
|
sdk: t.sdk
|
|
616
|
-
}, null, 8, ["sdk"])) : (
|
|
655
|
+
}, null, 8, ["sdk"])) : (A(), g(c, {
|
|
617
656
|
key: 1,
|
|
618
657
|
"chat-controller": d.value,
|
|
619
658
|
agent: t.agent,
|
|
620
659
|
"show-header": ""
|
|
621
|
-
}, null, 8, ["chat-controller", "agent"]))], 64)) :
|
|
660
|
+
}, null, 8, ["chat-controller", "agent"]))], 64)) : R.value === "info" ? (A(), g(pe, {
|
|
622
661
|
key: 1,
|
|
623
662
|
agent: t.agent,
|
|
624
|
-
"is-online":
|
|
625
|
-
}, null, 8, ["agent", "is-online"])) : _("", !0)])]))], 64))], 2)],
|
|
663
|
+
"is-online": B.value
|
|
664
|
+
}, null, 8, ["agent", "is-online"])) : _("", !0)])]))], 64))], 2)], 14, Le)) : C.value ? (A(), v("div", Ze, [y("div", Qe, [
|
|
626
665
|
i[12] || (i[12] = y("div", { class: "flex justify-center" }, [y("div", { class: "rounded-full bg-red-500/20 flex items-center justify-center size-10" }, [y("i", { class: "i-tabler-alert-circle size-6 text-red-400" })])], -1)),
|
|
627
666
|
i[13] || (i[13] = y("h3", { class: "text-lg font-medium" }, " Agent Error ", -1)),
|
|
628
|
-
y("p", $e,
|
|
629
|
-
])])) : (
|
|
630
|
-
t.chatOnly ? _("", !0) : (
|
|
667
|
+
y("p", $e, P(C.value), 1)
|
|
668
|
+
])])) : (A(), v("div", et, " Couldn't load your assistant. Please try again later. ")),
|
|
669
|
+
t.chatOnly ? _("", !0) : (A(), g(Fe, {
|
|
631
670
|
key: 4,
|
|
632
671
|
modelValue: p.value,
|
|
633
672
|
"onUpdate:modelValue": i[5] || (i[5] = (e) => p.value = e),
|
|
@@ -641,7 +680,7 @@ var R = /* @__PURE__ */ S({
|
|
|
641
680
|
"sdk",
|
|
642
681
|
"title"
|
|
643
682
|
])),
|
|
644
|
-
t.chatOnly ? _("", !0) : (
|
|
683
|
+
t.chatOnly ? _("", !0) : (A(), g(Pe, {
|
|
645
684
|
key: 5,
|
|
646
685
|
modelValue: m.value,
|
|
647
686
|
"onUpdate:modelValue": i[6] || (i[6] = (e) => m.value = e),
|
|
@@ -650,38 +689,49 @@ var R = /* @__PURE__ */ S({
|
|
|
650
689
|
}, null, 8, ["modelValue", "chat-controller"]))
|
|
651
690
|
]));
|
|
652
691
|
}
|
|
653
|
-
}), tt = /* @__PURE__ */
|
|
692
|
+
}), tt = /* @__PURE__ */ C({
|
|
654
693
|
__name: "AgentProvider",
|
|
655
694
|
props: {
|
|
656
695
|
sdk: {},
|
|
657
696
|
agent: {},
|
|
658
697
|
handle: {},
|
|
659
698
|
context: {},
|
|
699
|
+
clientContext: {},
|
|
660
700
|
firstMessage: {},
|
|
661
701
|
buttonText: {},
|
|
662
702
|
buttonIcon: {},
|
|
663
703
|
hasClose: { type: Boolean },
|
|
664
704
|
chatOnly: { type: Boolean },
|
|
665
|
-
|
|
705
|
+
bare: { type: Boolean },
|
|
706
|
+
apiBase: {},
|
|
707
|
+
emptyStateMessage: {},
|
|
708
|
+
suggestedPrompts: {}
|
|
666
709
|
},
|
|
667
710
|
emits: ["close", "error"],
|
|
668
711
|
setup(e, { emit: t }) {
|
|
669
712
|
let n = e, r = t;
|
|
670
|
-
return (e, t) => (
|
|
671
|
-
default:
|
|
672
|
-
sdk:
|
|
673
|
-
agent:
|
|
674
|
-
context:
|
|
675
|
-
"first-message":
|
|
713
|
+
return (e, t) => (A(), g(d, T(n, { class: "agent-provider size-full relative" }), {
|
|
714
|
+
default: L((i) => [S($, {
|
|
715
|
+
sdk: i.sdk,
|
|
716
|
+
agent: i.agent,
|
|
717
|
+
context: i.context,
|
|
718
|
+
"first-message": i.firstMessage,
|
|
676
719
|
"button-text": n.buttonText,
|
|
677
720
|
"button-icon": n.buttonIcon,
|
|
678
721
|
"has-close": n.hasClose,
|
|
679
722
|
"chat-only": n.chatOnly,
|
|
723
|
+
bare: n.bare,
|
|
724
|
+
"empty-state-message": n.emptyStateMessage,
|
|
725
|
+
"suggested-prompts": n.suggestedPrompts,
|
|
680
726
|
"is-active": !0,
|
|
681
727
|
class: "size-full",
|
|
682
728
|
onClose: t[0] || (t[0] = (e) => r("close", e)),
|
|
683
729
|
onError: t[1] || (t[1] = (e) => r("error", e))
|
|
684
|
-
},
|
|
730
|
+
}, b({ _: 2 }, [e.$slots["empty-heading"] ? {
|
|
731
|
+
name: "empty-heading",
|
|
732
|
+
fn: L((t) => [N(e.$slots, "empty-heading", D(w(t)))]),
|
|
733
|
+
key: "0"
|
|
734
|
+
} : void 0]), 1032, [
|
|
685
735
|
"sdk",
|
|
686
736
|
"agent",
|
|
687
737
|
"context",
|
|
@@ -689,9 +739,12 @@ var R = /* @__PURE__ */ S({
|
|
|
689
739
|
"button-text",
|
|
690
740
|
"button-icon",
|
|
691
741
|
"has-close",
|
|
692
|
-
"chat-only"
|
|
742
|
+
"chat-only",
|
|
743
|
+
"bare",
|
|
744
|
+
"empty-state-message",
|
|
745
|
+
"suggested-prompts"
|
|
693
746
|
])]),
|
|
694
|
-
_:
|
|
747
|
+
_: 3
|
|
695
748
|
}, 16));
|
|
696
749
|
}
|
|
697
750
|
});
|