@pagelines/sdk 1.0.167 → 1.0.169
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.vue_vue_type_script_setup_true_lang-vzGl9adQ.js → AgentProvider.vue_vue_type_script_setup_true_lang-DCanEQe2.js} +2 -2
- package/dist/{AgentProvider.vue_vue_type_script_setup_true_lang-vzGl9adQ.js.map → AgentProvider.vue_vue_type_script_setup_true_lang-DCanEQe2.js.map} +1 -1
- package/dist/{AgentWidgetInline-xKwzOBQ7.js → AgentWidgetInline-BW7Kg22N.js} +2 -2
- package/dist/{AgentWidgetInline-xKwzOBQ7.js.map → AgentWidgetInline-BW7Kg22N.js.map} +1 -1
- package/dist/{AgentWidgetModal-BesI4epW.js → AgentWidgetModal-dH9xiLtO.js} +2 -2
- package/dist/{AgentWidgetModal-BesI4epW.js.map → AgentWidgetModal-dH9xiLtO.js.map} +1 -1
- package/dist/{AgentWidgetPopup-KU7OGmSO.js → AgentWidgetPopup--EAvcTDh.js} +2 -2
- package/dist/{AgentWidgetPopup-KU7OGmSO.js.map → AgentWidgetPopup--EAvcTDh.js.map} +1 -1
- package/dist/{AgentWrap.vue_vue_type_script_setup_true_lang-Dnt1w4Uv.js → AgentWrap.vue_vue_type_script_setup_true_lang-DWBaKmcq.js} +471 -467
- package/dist/{AgentWrap.vue_vue_type_script_setup_true_lang-Dnt1w4Uv.js.map → AgentWrap.vue_vue_type_script_setup_true_lang-DWBaKmcq.js.map} +1 -1
- package/dist/agent/ui/AgentWrap.vue.d.ts +0 -1
- package/dist/agent.js +3 -3
- package/dist/demo/index.d.ts +0 -1
- package/dist/sdkClient.d.ts +0 -3
- package/dist/widget.js +3 -3
- package/package.json +2 -2
|
@@ -2,9 +2,9 @@ var Ze = Object.defineProperty;
|
|
|
2
2
|
var zt = (e, n, t) => n in e ? Ze(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
3
|
var r = (e, n) => Ze(e, "name", { value: n, configurable: !0 });
|
|
4
4
|
var E = (e, n, t) => zt(e, typeof n != "symbol" ? n + "" : n, t);
|
|
5
|
-
import { defineComponent as R, createElementBlock as h, openBlock as u, createElementVNode as
|
|
6
|
-
import { S as
|
|
7
|
-
import { S as
|
|
5
|
+
import { defineComponent as R, createElementBlock as h, openBlock as u, createElementVNode as d, normalizeClass as S, ref as L, watch as Q, createBlock as U, TransitionGroup as st, withCtx as H, renderSlot as se, computed as I, createCommentVNode as T, onMounted as ue, Fragment as K, renderList as he, withDirectives as it, vModelText as lt, toDisplayString as N, createVNode as P, withKeys as Tt, createTextVNode as de, unref as j, resolveDynamicComponent as $t, nextTick as Ie, Transition as Ke, withModifiers as Te, normalizeStyle as dt, shallowRef as Et, onUnmounted as Dt } from "vue";
|
|
6
|
+
import { S as ae } from "./socialPlatforms-Ck-b3SnQ.js";
|
|
7
|
+
import { S as ct, c as Lt, P as Vt } from "./sdkClient-DlvpHeVt.js";
|
|
8
8
|
const jt = { class: "spinner max-w-sm" }, Pt = {
|
|
9
9
|
class: "ring-circular h-full w-full origin-center",
|
|
10
10
|
viewBox: "25 25 50 50"
|
|
@@ -17,7 +17,7 @@ const jt = { class: "spinner max-w-sm" }, Pt = {
|
|
|
17
17
|
setup(e) {
|
|
18
18
|
return (n, t) => (u(), h("div", jt, [
|
|
19
19
|
(u(), h("svg", Pt, [
|
|
20
|
-
|
|
20
|
+
d("circle", {
|
|
21
21
|
class: S([e.colorMode, "ring-path"]),
|
|
22
22
|
cx: "50",
|
|
23
23
|
cy: "50",
|
|
@@ -187,7 +187,7 @@ const ut = [
|
|
|
187
187
|
label: "About",
|
|
188
188
|
icon: "i-tabler-user-circle"
|
|
189
189
|
}
|
|
190
|
-
], Nt = 256, Ot = 0.8, Rt = 50,
|
|
190
|
+
], Nt = 256, Ot = 0.8, Rt = 50, vn = {
|
|
191
191
|
bars: 64,
|
|
192
192
|
barWidth: 3,
|
|
193
193
|
barSpacing: 1,
|
|
@@ -200,7 +200,7 @@ const ut = [
|
|
|
200
200
|
// ms to hold peaks
|
|
201
201
|
PEAK_DECAY_STIFFNESS: 0.12,
|
|
202
202
|
PEAK_DECAY_DAMPING: 0.15
|
|
203
|
-
},
|
|
203
|
+
}, pn = [
|
|
204
204
|
// Low fundamentals
|
|
205
205
|
85,
|
|
206
206
|
100,
|
|
@@ -274,7 +274,7 @@ const ut = [
|
|
|
274
274
|
7500,
|
|
275
275
|
8e3,
|
|
276
276
|
8500
|
|
277
|
-
], Be = class Be extends
|
|
277
|
+
], Be = class Be extends ct {
|
|
278
278
|
constructor(t) {
|
|
279
279
|
super("ClientAudio", t);
|
|
280
280
|
E(this, "audioContext");
|
|
@@ -326,16 +326,16 @@ const ut = [
|
|
|
326
326
|
try {
|
|
327
327
|
const {
|
|
328
328
|
noiseSuppression: o = !0,
|
|
329
|
-
echoCancellation:
|
|
329
|
+
echoCancellation: a = !0,
|
|
330
330
|
autoGainControl: i = !0,
|
|
331
|
-
voiceIsolation:
|
|
331
|
+
voiceIsolation: s = !0
|
|
332
332
|
} = t, l = {
|
|
333
333
|
audio: {
|
|
334
334
|
noiseSuppression: { ideal: o, exact: o },
|
|
335
|
-
echoCancellation: { ideal:
|
|
335
|
+
echoCancellation: { ideal: a, exact: a },
|
|
336
336
|
autoGainControl: { ideal: i, exact: i },
|
|
337
337
|
// Chrome-specific voice isolation (degrades gracefully in other browsers)
|
|
338
|
-
voiceIsolation: { ideal:
|
|
338
|
+
voiceIsolation: { ideal: s, exact: s },
|
|
339
339
|
advanced: [
|
|
340
340
|
// Prioritize speech frequencies (300-3400 Hz) - Chrome-specific goog* properties
|
|
341
341
|
// @ts-expect-error - Chrome-specific constraint
|
|
@@ -349,9 +349,9 @@ const ut = [
|
|
|
349
349
|
// @ts-expect-error - Chrome-specific constraint
|
|
350
350
|
{ googNoiseSuppression2: o },
|
|
351
351
|
// @ts-expect-error - Chrome-specific constraint
|
|
352
|
-
{ googEchoCancellation:
|
|
352
|
+
{ googEchoCancellation: a },
|
|
353
353
|
// @ts-expect-error - Chrome-specific constraint
|
|
354
|
-
{ googEchoCancellation2:
|
|
354
|
+
{ googEchoCancellation2: a },
|
|
355
355
|
// @ts-expect-error - Chrome-specific constraint
|
|
356
356
|
{ googHighpassFilter: !0 },
|
|
357
357
|
// Remove low-frequency noise (bass from music)
|
|
@@ -421,26 +421,26 @@ const ut = [
|
|
|
421
421
|
return;
|
|
422
422
|
}
|
|
423
423
|
this.logger.info("Starting audio level monitoring with VAD at timestamp:", Date.now());
|
|
424
|
-
const
|
|
424
|
+
const a = new Uint8Array(this.analyser.frequencyBinCount), i = /* @__PURE__ */ r(async () => {
|
|
425
425
|
if (!this.analyser) {
|
|
426
426
|
this.logger.info("Stopping audio level monitoring - missing analyser");
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
429
|
try {
|
|
430
|
-
this.analyser.getByteFrequencyData(
|
|
431
|
-
const l =
|
|
432
|
-
!this.detectVoiceActivity(
|
|
430
|
+
this.analyser.getByteFrequencyData(a);
|
|
431
|
+
const l = a.reduce((f, v) => f + v, 0) / a.length, c = Math.min(l / 128, 1);
|
|
432
|
+
!this.detectVoiceActivity(c) && this.hasUserStoppedSpeaking() && o && (this.logger.info("VAD: User stopped speaking (silence detected)"), o(), this.lastSpeechTime = 0);
|
|
433
433
|
const x = t?.() ? 0.3 : 0;
|
|
434
|
-
this.audioLevels.value = { inputLevel:
|
|
434
|
+
this.audioLevels.value = { inputLevel: c, outputLevel: x };
|
|
435
435
|
} catch (l) {
|
|
436
436
|
this.logger.error("Error in audio level monitoring:", l), this.stopAudioLevelMonitoring();
|
|
437
437
|
}
|
|
438
|
-
}, "updateLevels"),
|
|
438
|
+
}, "updateLevels"), s = /* @__PURE__ */ r(() => {
|
|
439
439
|
i().catch((l) => {
|
|
440
440
|
this.logger.error("Async error in audio level monitoring:", l);
|
|
441
441
|
});
|
|
442
442
|
}, "intervalWrapper");
|
|
443
|
-
this.audioLevelInterval = window.setInterval(
|
|
443
|
+
this.audioLevelInterval = window.setInterval(s, Rt);
|
|
444
444
|
}
|
|
445
445
|
/**
|
|
446
446
|
* Stop monitoring audio levels
|
|
@@ -497,13 +497,13 @@ function ke(e) {
|
|
|
497
497
|
return Je(e.cover) || Je(e.avatar) || "/img/placeholder-avatar.png";
|
|
498
498
|
}
|
|
499
499
|
r(ke, "getAgentAvatarUrl");
|
|
500
|
-
function
|
|
500
|
+
function ce() {
|
|
501
501
|
return "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiByeD0iNDAiIGZpbGw9IiM2MzY2RjEiLz4KPHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeD0iMjAiIHk9IjIwIj4KPHA0aCBkPSJNMTIgMTJjMi4yMSAwIDQtMS43OSA0LTRTNC4yMSA0IDIgNHMxLjc5IDQgNCA0em0wIDJjLTIuNjcgMC04IDEuMzQtOCA0djJoMTZ2LTJjMC0yLjY2LTUuMzMtNC04LTR6IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4KPC9zdmc+";
|
|
502
502
|
}
|
|
503
|
-
r(
|
|
503
|
+
r(ce, "getFallbackAvatarDataUrl");
|
|
504
504
|
function ye(e) {
|
|
505
505
|
const n = e.target;
|
|
506
|
-
n.dataset.fallbackUsed || (n.dataset.fallbackUsed = "true", n.src =
|
|
506
|
+
n.dataset.fallbackUsed || (n.dataset.fallbackUsed = "true", n.src = ce());
|
|
507
507
|
}
|
|
508
508
|
r(ye, "handleImageError");
|
|
509
509
|
function Ft(e) {
|
|
@@ -514,21 +514,21 @@ function Ft(e) {
|
|
|
514
514
|
user: "user",
|
|
515
515
|
ai: "agent",
|
|
516
516
|
agent: "agent"
|
|
517
|
-
},
|
|
517
|
+
}, a = o[t] || "agent";
|
|
518
518
|
if (typeof n == "string")
|
|
519
|
-
return n.trim() ? { text: n.trim(), sender:
|
|
519
|
+
return n.trim() ? { text: n.trim(), sender: a } : null;
|
|
520
520
|
if (typeof n != "object")
|
|
521
521
|
return null;
|
|
522
522
|
const i = [
|
|
523
|
-
(
|
|
524
|
-
if (!("source" in
|
|
523
|
+
(s) => {
|
|
524
|
+
if (!("source" in s))
|
|
525
525
|
return null;
|
|
526
|
-
const l = o[
|
|
527
|
-
return l ? { text:
|
|
526
|
+
const l = o[s.source];
|
|
527
|
+
return l ? { text: s.message || "", sender: l } : null;
|
|
528
528
|
}
|
|
529
529
|
];
|
|
530
|
-
for (const
|
|
531
|
-
const l =
|
|
530
|
+
for (const s of i) {
|
|
531
|
+
const l = s(n);
|
|
532
532
|
if (l && l.text.trim())
|
|
533
533
|
return { text: l.text.trim(), sender: l.sender };
|
|
534
534
|
}
|
|
@@ -545,7 +545,7 @@ function Gt(e) {
|
|
|
545
545
|
return n.replace(/{name}/g, t.name || "Digital Agent").replace(/{title}/g, t.title || "").replace(/{handle}/g, t.handle || "").replace(/{orgName}/g, t.org?.name || "");
|
|
546
546
|
}
|
|
547
547
|
r(Gt, "parseButtonTemplate");
|
|
548
|
-
const Ne = class Ne extends
|
|
548
|
+
const Ne = class Ne extends ct {
|
|
549
549
|
constructor(t) {
|
|
550
550
|
super("AgentController", t);
|
|
551
551
|
E(this, "conversation");
|
|
@@ -616,8 +616,8 @@ const Ne = class Ne extends dt {
|
|
|
616
616
|
return t.includes("timed out") || t.includes("starting up") || t.includes("503");
|
|
617
617
|
}
|
|
618
618
|
isDuplicateMessage(t, o) {
|
|
619
|
-
const
|
|
620
|
-
return
|
|
619
|
+
const a = `${o}:${t.toLowerCase().trim()}`, i = Date.now(), s = a === this.lastMessage.hash && i - this.lastMessage.time < 500;
|
|
620
|
+
return s || (this.lastMessage = { hash: a, time: i }), s;
|
|
621
621
|
}
|
|
622
622
|
addMessage(t, o) {
|
|
623
623
|
this.isDuplicateMessage(t, o) || (this.sharedMessages.value = [
|
|
@@ -626,13 +626,13 @@ const Ne = class Ne extends dt {
|
|
|
626
626
|
]);
|
|
627
627
|
}
|
|
628
628
|
getDynamicSettings() {
|
|
629
|
-
const { sdk: t } = this.settings, o = t.activeUser.value,
|
|
629
|
+
const { sdk: t } = this.settings, o = t.activeUser.value, a = o?.agents?.find((s) => s.agentId === o.primaryAgentId), i = o ? `
|
|
630
630
|
|
|
631
631
|
Current User:
|
|
632
|
-
- Name: ${
|
|
632
|
+
- Name: ${a?.name || "Anonymous"}
|
|
633
633
|
- Email: ${o.email}
|
|
634
|
-
- Title: ${
|
|
635
|
-
- About: ${
|
|
634
|
+
- Title: ${a?.title || ""}
|
|
635
|
+
- About: ${a?.summary || ""}
|
|
636
636
|
` : "";
|
|
637
637
|
return {
|
|
638
638
|
context: `${this.settings.context || ""}${i}`.trim(),
|
|
@@ -666,27 +666,27 @@ Current User:
|
|
|
666
666
|
});
|
|
667
667
|
}
|
|
668
668
|
handleMessage(t, o) {
|
|
669
|
-
const
|
|
670
|
-
if (
|
|
671
|
-
const i =
|
|
672
|
-
|
|
669
|
+
const a = Ft(t);
|
|
670
|
+
if (a && (o && a.sender === "user" && this.logger.info("User transcription received", { text: a.text }), this.addMessage(a.text, a.sender), !o && a.sender === "agent" && this.updateState(this.textState, { isThinking: !1 }), this.sessionId && this.hostParticipantId && this.visitorParticipantId)) {
|
|
671
|
+
const i = a.sender === "agent" ? this.hostParticipantId : this.visitorParticipantId, { sdk: s } = this.settings;
|
|
672
|
+
s.saveMessage({
|
|
673
673
|
conversationId: this.sessionId,
|
|
674
674
|
participantId: i,
|
|
675
|
-
content:
|
|
676
|
-
role:
|
|
675
|
+
content: a.text,
|
|
676
|
+
role: a.sender === "agent" ? "agent" : "user"
|
|
677
677
|
}).catch((l) => {
|
|
678
678
|
this.logger.warn("Failed to save message", { error: l });
|
|
679
679
|
});
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
682
|
handleError(t, o) {
|
|
683
|
-
const
|
|
683
|
+
const a = t.message;
|
|
684
684
|
this.logger.error("Conversation error:", t), this.resetState(o), o ? this.updateState(this.voiceState, {
|
|
685
|
-
error:
|
|
685
|
+
error: a,
|
|
686
686
|
connectionStatus: "error",
|
|
687
687
|
transcript: "Failed to start call."
|
|
688
688
|
}) : this.updateState(this.textState, {
|
|
689
|
-
error:
|
|
689
|
+
error: a,
|
|
690
690
|
connectionStatus: "error"
|
|
691
691
|
});
|
|
692
692
|
}
|
|
@@ -735,8 +735,8 @@ Current User:
|
|
|
735
735
|
this.addMessage("Agent is currently offline.", "system");
|
|
736
736
|
return;
|
|
737
737
|
}
|
|
738
|
-
const { sdk: o, agent:
|
|
739
|
-
if (!
|
|
738
|
+
const { sdk: o, agent: a } = this.settings;
|
|
739
|
+
if (!a.handle) {
|
|
740
740
|
this.handleError(new Error("Agent handle required for chat"), !1);
|
|
741
741
|
return;
|
|
742
742
|
}
|
|
@@ -747,28 +747,28 @@ Current User:
|
|
|
747
747
|
const { context: i } = this.getDynamicSettings();
|
|
748
748
|
try {
|
|
749
749
|
await o.chatStream({
|
|
750
|
-
handle:
|
|
750
|
+
handle: a.handle,
|
|
751
751
|
message: t,
|
|
752
752
|
conversationId: this.conversationId,
|
|
753
753
|
history: this.buildHistory(),
|
|
754
754
|
visitorId: o.generateAnonId(),
|
|
755
755
|
context: i || void 0,
|
|
756
|
-
onDelta: /* @__PURE__ */ r((
|
|
757
|
-
const l = this.sharedMessages.value,
|
|
758
|
-
|
|
756
|
+
onDelta: /* @__PURE__ */ r((s) => {
|
|
757
|
+
const l = this.sharedMessages.value, c = l[l.length - 1];
|
|
758
|
+
c?.sender === "agent" && (c.text += s, this.sharedMessages.value = [...l]);
|
|
759
759
|
}, "onDelta"),
|
|
760
|
-
onDone: /* @__PURE__ */ r((
|
|
761
|
-
|
|
760
|
+
onDone: /* @__PURE__ */ r((s) => {
|
|
761
|
+
s && (this.conversationId = s), this.updateState(this.textState, { isThinking: !1 });
|
|
762
762
|
}, "onDone"),
|
|
763
|
-
onError: /* @__PURE__ */ r((
|
|
764
|
-
const l = this.sharedMessages.value,
|
|
765
|
-
|
|
766
|
-
const b = this.mapChatError(
|
|
767
|
-
this.isTransientError(
|
|
763
|
+
onError: /* @__PURE__ */ r((s) => {
|
|
764
|
+
const l = this.sharedMessages.value, c = l[l.length - 1];
|
|
765
|
+
c?.sender === "agent" && !c.text && (this.sharedMessages.value = l.slice(0, -1));
|
|
766
|
+
const b = this.mapChatError(s);
|
|
767
|
+
this.isTransientError(s) ? (this.addMessage(b, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(b), !1);
|
|
768
768
|
}, "onError")
|
|
769
769
|
});
|
|
770
|
-
} catch (
|
|
771
|
-
this.handleError(
|
|
770
|
+
} catch (s) {
|
|
771
|
+
this.handleError(s, !1);
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
774
|
buildHistory() {
|
|
@@ -809,11 +809,11 @@ const Ut = /* @__PURE__ */ R({
|
|
|
809
809
|
mode: { default: "block" }
|
|
810
810
|
},
|
|
811
811
|
setup(e) {
|
|
812
|
-
return (n, t) => (u(), U(
|
|
812
|
+
return (n, t) => (u(), U(st, {
|
|
813
813
|
name: e.disabled ? "" : "nlist"
|
|
814
814
|
}, {
|
|
815
815
|
default: H(() => [
|
|
816
|
-
|
|
816
|
+
se(n.$slots, "default")
|
|
817
817
|
]),
|
|
818
818
|
_: 3
|
|
819
819
|
}, 8, ["name"]));
|
|
@@ -845,20 +845,20 @@ const Ut = /* @__PURE__ */ R({
|
|
|
845
845
|
md: "size-4",
|
|
846
846
|
lg: "size-5"
|
|
847
847
|
})[e.size]);
|
|
848
|
-
return (
|
|
848
|
+
return (a, i) => (u(), h("button", {
|
|
849
849
|
class: S(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [n.value, t.value]])
|
|
850
850
|
}, [
|
|
851
851
|
e.loading ? (u(), h("div", Ht, [...i[0] || (i[0] = [
|
|
852
|
-
|
|
852
|
+
d("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
|
|
853
853
|
])])) : T("", !0),
|
|
854
|
-
|
|
854
|
+
d("span", {
|
|
855
855
|
class: S(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"])
|
|
856
856
|
}, [
|
|
857
857
|
e.icon ? (u(), h("i", {
|
|
858
858
|
key: 0,
|
|
859
859
|
class: S([e.icon, o.value])
|
|
860
860
|
}, null, 2)) : T("", !0),
|
|
861
|
-
|
|
861
|
+
se(a.$slots, "default"),
|
|
862
862
|
e.iconAfter ? (u(), h("i", {
|
|
863
863
|
key: 1,
|
|
864
864
|
class: S([e.iconAfter, o.value])
|
|
@@ -874,14 +874,14 @@ const Ut = /* @__PURE__ */ R({
|
|
|
874
874
|
emits: ["update:modelValue"],
|
|
875
875
|
setup(e, { emit: n }) {
|
|
876
876
|
const t = n;
|
|
877
|
-
return (o,
|
|
877
|
+
return (o, a) => (u(), h("input", {
|
|
878
878
|
type: "email",
|
|
879
879
|
autocomplete: "email",
|
|
880
880
|
placeholder: "Enter Your Email",
|
|
881
881
|
value: e.modelValue,
|
|
882
882
|
class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-all",
|
|
883
883
|
style: { "font-size": "16px" },
|
|
884
|
-
onInput:
|
|
884
|
+
onInput: a[0] || (a[0] = (i) => t("update:modelValue", i.target.value))
|
|
885
885
|
}, null, 40, Wt));
|
|
886
886
|
}
|
|
887
887
|
}), Zt = { class: "flex gap-1.5 justify-center" }, Kt = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], Yt = /* @__PURE__ */ R({
|
|
@@ -893,64 +893,64 @@ const Ut = /* @__PURE__ */ R({
|
|
|
893
893
|
},
|
|
894
894
|
emits: ["update:modelValue", "autoSubmit"],
|
|
895
895
|
setup(e, { emit: n }) {
|
|
896
|
-
const t = e, o = n,
|
|
896
|
+
const t = e, o = n, a = L([]), i = L(Array.from({ length: t.length }).fill("")), s = L(!1);
|
|
897
897
|
ue(() => {
|
|
898
|
-
t.modelValue && (i.value = t.modelValue.split("").slice(0, t.length)), t.focusFirst && !("ontouchstart" in window) &&
|
|
898
|
+
t.modelValue && (i.value = t.modelValue.split("").slice(0, t.length)), t.focusFirst && !("ontouchstart" in window) && a.value[0]?.focus();
|
|
899
899
|
}), Q(() => t.modelValue, (f) => {
|
|
900
900
|
i.value = f ? f.split("").slice(0, t.length) : Array.from({ length: t.length }).fill("");
|
|
901
901
|
}), Q(i, () => {
|
|
902
902
|
const f = i.value.filter(Boolean).join("");
|
|
903
903
|
o("update:modelValue", f), f.length === t.length && o("autoSubmit", f);
|
|
904
904
|
}, { deep: !0 });
|
|
905
|
-
function l(f,
|
|
906
|
-
|
|
907
|
-
const A = (
|
|
905
|
+
function l(f, v) {
|
|
906
|
+
v.preventDefault(), s.value = !0;
|
|
907
|
+
const A = (v.clipboardData?.getData("text") || "").replace(/\D/g, "");
|
|
908
908
|
if (A.length === t.length)
|
|
909
909
|
i.value = A.split(""), setTimeout(() => {
|
|
910
|
-
|
|
910
|
+
a.value[t.length - 1]?.focus(), s.value = !1;
|
|
911
911
|
}, 10);
|
|
912
912
|
else {
|
|
913
|
-
const
|
|
913
|
+
const p = [...i.value];
|
|
914
914
|
A.split("").slice(0, t.length - f).forEach((z, O) => {
|
|
915
|
-
|
|
916
|
-
}), i.value =
|
|
915
|
+
p[f + O] = z;
|
|
916
|
+
}), i.value = p;
|
|
917
917
|
const M = Math.min(f + A.length, t.length - 1);
|
|
918
918
|
setTimeout(() => {
|
|
919
|
-
|
|
919
|
+
a.value[M]?.focus(), s.value = !1;
|
|
920
920
|
}, 10);
|
|
921
921
|
}
|
|
922
922
|
}
|
|
923
923
|
r(l, "onPaste");
|
|
924
|
-
function
|
|
925
|
-
const A =
|
|
926
|
-
i.value[f] = A, A && f < t.length - 1 &&
|
|
924
|
+
function c(f, v) {
|
|
925
|
+
const A = v.target.value.slice(-1).replace(/\D/g, "");
|
|
926
|
+
i.value[f] = A, A && f < t.length - 1 && a.value[f + 1]?.focus();
|
|
927
927
|
}
|
|
928
|
-
r(
|
|
929
|
-
function b(f,
|
|
930
|
-
|
|
928
|
+
r(c, "onInput");
|
|
929
|
+
function b(f, v) {
|
|
930
|
+
v.key === "Backspace" ? (v.preventDefault(), i.value[f] = "", f > 0 && a.value[f - 1]?.focus()) : v.key === "ArrowLeft" && f > 0 ? a.value[f - 1]?.focus() : v.key === "ArrowRight" && f < t.length - 1 && a.value[f + 1]?.focus();
|
|
931
931
|
}
|
|
932
932
|
r(b, "onKeydown");
|
|
933
933
|
function x(f) {
|
|
934
|
-
if (
|
|
935
|
-
for (let
|
|
936
|
-
i.value[
|
|
934
|
+
if (a.value[f]?.select(), !s.value && i.value[f])
|
|
935
|
+
for (let v = f; v < t.length; v++)
|
|
936
|
+
i.value[v] = "";
|
|
937
937
|
}
|
|
938
|
-
return r(x, "onFocus"), (f,
|
|
938
|
+
return r(x, "onFocus"), (f, v) => (u(), h("div", Zt, [
|
|
939
939
|
(u(!0), h(K, null, he(e.length, (A) => it((u(), h("input", {
|
|
940
940
|
key: A,
|
|
941
941
|
ref_for: !0,
|
|
942
|
-
ref: /* @__PURE__ */ r((
|
|
943
|
-
"onUpdate:modelValue": /* @__PURE__ */ r((
|
|
942
|
+
ref: /* @__PURE__ */ r((p) => a.value[A - 1] = p, "ref"),
|
|
943
|
+
"onUpdate:modelValue": /* @__PURE__ */ r((p) => i.value[A - 1] = p, "onUpdate:modelValue"),
|
|
944
944
|
type: "text",
|
|
945
945
|
inputmode: "numeric",
|
|
946
946
|
autocomplete: "one-time-code",
|
|
947
947
|
class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
|
|
948
948
|
style: { "font-size": "16px" },
|
|
949
949
|
maxlength: "1",
|
|
950
|
-
onInput: /* @__PURE__ */ r((
|
|
951
|
-
onKeydown: /* @__PURE__ */ r((
|
|
952
|
-
onPaste: /* @__PURE__ */ r((
|
|
953
|
-
onFocus: /* @__PURE__ */ r((
|
|
950
|
+
onInput: /* @__PURE__ */ r((p) => c(A - 1, p), "onInput"),
|
|
951
|
+
onKeydown: /* @__PURE__ */ r((p) => b(A - 1, p), "onKeydown"),
|
|
952
|
+
onPaste: /* @__PURE__ */ r((p) => l(A - 1, p), "onPaste"),
|
|
953
|
+
onFocus: /* @__PURE__ */ r((p) => x(A - 1), "onFocus")
|
|
954
954
|
}, null, 40, Kt)), [
|
|
955
955
|
[lt, i.value[A - 1]]
|
|
956
956
|
])), 128))
|
|
@@ -971,7 +971,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
971
971
|
sdk: {}
|
|
972
972
|
},
|
|
973
973
|
setup(e) {
|
|
974
|
-
const n = L({ email: "", code: "" }), t = L("email"), o = L(!1),
|
|
974
|
+
const n = L({ email: "", code: "" }), t = L("email"), o = L(!1), a = {
|
|
975
975
|
email: {
|
|
976
976
|
title: "Enter Your Email",
|
|
977
977
|
button: { label: "Continue", disabled: /* @__PURE__ */ r(() => !n.value.email || o.value, "disabled") },
|
|
@@ -1000,31 +1000,31 @@ const Ut = /* @__PURE__ */ R({
|
|
|
1000
1000
|
}
|
|
1001
1001
|
}, "action")
|
|
1002
1002
|
}
|
|
1003
|
-
}, i = I(() =>
|
|
1004
|
-
return Q(() => e.sdk.activeUser.value, (
|
|
1005
|
-
|
|
1006
|
-
}), (
|
|
1003
|
+
}, i = I(() => a[t.value]);
|
|
1004
|
+
return Q(() => e.sdk.activeUser.value, (s) => {
|
|
1005
|
+
s && t.value === "code" && console.log("[ElAuthGate] Authentication successful", { email: s.email });
|
|
1006
|
+
}), (s, l) => (u(), h("div", {
|
|
1007
1007
|
"data-test": "auth-form",
|
|
1008
1008
|
"data-test-mode": t.value,
|
|
1009
1009
|
class: "flex flex-col items-center justify-center h-full p-6"
|
|
1010
1010
|
}, [
|
|
1011
|
-
|
|
1011
|
+
d("div", Qt, [
|
|
1012
1012
|
e.sdk.error.value ? (u(), h("p", Xt, N(e.sdk.error.value), 1)) : T("", !0),
|
|
1013
|
-
|
|
1014
|
-
|
|
1013
|
+
d("h3", _t, N(i.value.title), 1),
|
|
1014
|
+
d("div", eo, [
|
|
1015
1015
|
P(Ut, null, {
|
|
1016
1016
|
default: H(() => [
|
|
1017
1017
|
t.value === "email" ? (u(), h("div", to, [
|
|
1018
1018
|
P(qt, {
|
|
1019
1019
|
modelValue: n.value.email,
|
|
1020
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
1020
|
+
"onUpdate:modelValue": l[0] || (l[0] = (c) => n.value.email = c),
|
|
1021
1021
|
"data-test": "auth-email-input",
|
|
1022
1022
|
onKeyup: Tt(i.value.action, ["enter"])
|
|
1023
1023
|
}, null, 8, ["modelValue", "onKeyup"])
|
|
1024
1024
|
])) : (u(), h("div", oo, [
|
|
1025
1025
|
P(Yt, {
|
|
1026
1026
|
modelValue: n.value.code,
|
|
1027
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
1027
|
+
"onUpdate:modelValue": l[1] || (l[1] = (c) => n.value.code = c),
|
|
1028
1028
|
length: 6,
|
|
1029
1029
|
"focus-first": !0,
|
|
1030
1030
|
"data-test": "auth-code-input",
|
|
@@ -1045,14 +1045,14 @@ const Ut = /* @__PURE__ */ R({
|
|
|
1045
1045
|
onClick: i.value.action
|
|
1046
1046
|
}, {
|
|
1047
1047
|
default: H(() => [
|
|
1048
|
-
|
|
1048
|
+
de(N(i.value.button.label), 1)
|
|
1049
1049
|
]),
|
|
1050
1050
|
_: 1
|
|
1051
1051
|
}, 8, ["loading", "disabled", "onClick"]),
|
|
1052
1052
|
t.value === "code" ? (u(), h("button", {
|
|
1053
1053
|
key: 0,
|
|
1054
1054
|
class: "w-full text-xs text-white/50 hover:text-white/70 transition-colors py-2",
|
|
1055
|
-
onClick: l[2] || (l[2] = (
|
|
1055
|
+
onClick: l[2] || (l[2] = (c) => t.value = "email")
|
|
1056
1056
|
}, " Change Email ")) : T("", !0)
|
|
1057
1057
|
]))
|
|
1058
1058
|
]),
|
|
@@ -1062,10 +1062,10 @@ const Ut = /* @__PURE__ */ R({
|
|
|
1062
1062
|
])
|
|
1063
1063
|
], 8, Jt));
|
|
1064
1064
|
}
|
|
1065
|
-
}), ro = { class: "relative flex-shrink-0" }, no = ["src", "alt"],
|
|
1065
|
+
}), ro = { class: "relative flex-shrink-0" }, no = ["src", "alt"], ao = {
|
|
1066
1066
|
key: 0,
|
|
1067
1067
|
class: "absolute top-1 right-1"
|
|
1068
|
-
},
|
|
1068
|
+
}, so = { class: "min-w-0" }, Ve = /* @__PURE__ */ R({
|
|
1069
1069
|
__name: "ElModeHeader",
|
|
1070
1070
|
props: {
|
|
1071
1071
|
agent: {},
|
|
@@ -1075,41 +1075,41 @@ const Ut = /* @__PURE__ */ R({
|
|
|
1075
1075
|
},
|
|
1076
1076
|
setup(e) {
|
|
1077
1077
|
function n() {
|
|
1078
|
-
return e.agent.avatar?.src ? e.agent.avatar.src :
|
|
1078
|
+
return e.agent.avatar?.src ? e.agent.avatar.src : ce();
|
|
1079
1079
|
}
|
|
1080
1080
|
return r(n, "getAvatarSrc"), (t, o) => (u(), h("div", {
|
|
1081
1081
|
class: S(["flex gap-4", [
|
|
1082
1082
|
e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
|
|
1083
1083
|
]])
|
|
1084
1084
|
}, [
|
|
1085
|
-
|
|
1086
|
-
|
|
1085
|
+
d("div", ro, [
|
|
1086
|
+
d("div", {
|
|
1087
1087
|
class: S(["rounded-full overflow-hidden border-white", e.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
|
|
1088
1088
|
}, [
|
|
1089
|
-
|
|
1089
|
+
d("img", {
|
|
1090
1090
|
src: n(),
|
|
1091
1091
|
alt: e.agent.name,
|
|
1092
1092
|
class: "w-full h-full object-cover",
|
|
1093
1093
|
onError: o[0] || (o[0] = //@ts-ignore
|
|
1094
|
-
(...
|
|
1094
|
+
(...a) => j(ye) && j(ye)(...a))
|
|
1095
1095
|
}, null, 40, no)
|
|
1096
1096
|
], 2),
|
|
1097
|
-
e.showOnlineIndicator ? (u(), h("div",
|
|
1098
|
-
|
|
1097
|
+
e.showOnlineIndicator ? (u(), h("div", ao, [...o[1] || (o[1] = [
|
|
1098
|
+
d("div", {
|
|
1099
1099
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
1100
1100
|
style: { "animation-duration": "3s" }
|
|
1101
1101
|
}, null, -1),
|
|
1102
|
-
|
|
1102
|
+
d("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1)
|
|
1103
1103
|
])])) : T("", !0)
|
|
1104
1104
|
]),
|
|
1105
|
-
|
|
1106
|
-
|
|
1105
|
+
d("div", so, [
|
|
1106
|
+
d("h1", {
|
|
1107
1107
|
class: S(["font-light text-white mb-1 truncate", [
|
|
1108
1108
|
e.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
|
|
1109
1109
|
e.layout === "horizontal" ? "text-white/95" : ""
|
|
1110
1110
|
]])
|
|
1111
1111
|
}, N(e.agent.name), 3),
|
|
1112
|
-
|
|
1112
|
+
d("p", {
|
|
1113
1113
|
class: S(["font-light line-clamp-1", [
|
|
1114
1114
|
e.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
|
|
1115
1115
|
e.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
|
|
@@ -1138,34 +1138,34 @@ const Ut = /* @__PURE__ */ R({
|
|
|
1138
1138
|
conflictingClassGroupModifiers: o
|
|
1139
1139
|
} = e;
|
|
1140
1140
|
return {
|
|
1141
|
-
getClassGroupId: /* @__PURE__ */ r((
|
|
1142
|
-
if (
|
|
1143
|
-
return ho(
|
|
1144
|
-
const l =
|
|
1145
|
-
return mt(l,
|
|
1141
|
+
getClassGroupId: /* @__PURE__ */ r((s) => {
|
|
1142
|
+
if (s.startsWith("[") && s.endsWith("]"))
|
|
1143
|
+
return ho(s);
|
|
1144
|
+
const l = s.split(we), c = l[0] === "" && l.length > 1 ? 1 : 0;
|
|
1145
|
+
return mt(l, c, n);
|
|
1146
1146
|
}, "getClassGroupId"),
|
|
1147
|
-
getConflictingClassGroupIds: /* @__PURE__ */ r((
|
|
1147
|
+
getConflictingClassGroupIds: /* @__PURE__ */ r((s, l) => {
|
|
1148
1148
|
if (l) {
|
|
1149
|
-
const
|
|
1150
|
-
return
|
|
1149
|
+
const c = o[s], b = t[s];
|
|
1150
|
+
return c ? b ? io(b, c) : c : b || Xe;
|
|
1151
1151
|
}
|
|
1152
|
-
return t[
|
|
1152
|
+
return t[s] || Xe;
|
|
1153
1153
|
}, "getConflictingClassGroupIds")
|
|
1154
1154
|
};
|
|
1155
1155
|
}, "createClassGroupUtils"), mt = /* @__PURE__ */ r((e, n, t) => {
|
|
1156
1156
|
if (e.length - n === 0)
|
|
1157
1157
|
return t.classGroupId;
|
|
1158
|
-
const
|
|
1158
|
+
const a = e[n], i = t.nextPart.get(a);
|
|
1159
1159
|
if (i) {
|
|
1160
1160
|
const b = mt(e, n + 1, i);
|
|
1161
1161
|
if (b) return b;
|
|
1162
1162
|
}
|
|
1163
|
-
const
|
|
1164
|
-
if (
|
|
1163
|
+
const s = t.validators;
|
|
1164
|
+
if (s === null)
|
|
1165
1165
|
return;
|
|
1166
|
-
const l = n === 0 ? e.join(we) : e.slice(n).join(we),
|
|
1167
|
-
for (let b = 0; b <
|
|
1168
|
-
const x =
|
|
1166
|
+
const l = n === 0 ? e.join(we) : e.slice(n).join(we), c = s.length;
|
|
1167
|
+
for (let b = 0; b < c; b++) {
|
|
1168
|
+
const x = s[b];
|
|
1169
1169
|
if (x.validator(l))
|
|
1170
1170
|
return x.classGroupId;
|
|
1171
1171
|
}
|
|
@@ -1181,15 +1181,15 @@ const Ut = /* @__PURE__ */ R({
|
|
|
1181
1181
|
}, "createClassMap"), mo = /* @__PURE__ */ r((e, n) => {
|
|
1182
1182
|
const t = gt();
|
|
1183
1183
|
for (const o in e) {
|
|
1184
|
-
const
|
|
1185
|
-
je(
|
|
1184
|
+
const a = e[o];
|
|
1185
|
+
je(a, t, o, n);
|
|
1186
1186
|
}
|
|
1187
1187
|
return t;
|
|
1188
1188
|
}, "processClassGroups"), je = /* @__PURE__ */ r((e, n, t, o) => {
|
|
1189
|
-
const
|
|
1190
|
-
for (let i = 0; i <
|
|
1191
|
-
const
|
|
1192
|
-
fo(
|
|
1189
|
+
const a = e.length;
|
|
1190
|
+
for (let i = 0; i < a; i++) {
|
|
1191
|
+
const s = e[i];
|
|
1192
|
+
fo(s, n, t, o);
|
|
1193
1193
|
}
|
|
1194
1194
|
}, "processClassesRecursively"), fo = /* @__PURE__ */ r((e, n, t, o) => {
|
|
1195
1195
|
if (typeof e == "string") {
|
|
@@ -1197,32 +1197,32 @@ const Ut = /* @__PURE__ */ R({
|
|
|
1197
1197
|
return;
|
|
1198
1198
|
}
|
|
1199
1199
|
if (typeof e == "function") {
|
|
1200
|
-
|
|
1200
|
+
vo(e, n, t, o);
|
|
1201
1201
|
return;
|
|
1202
1202
|
}
|
|
1203
|
-
|
|
1203
|
+
po(e, n, t, o);
|
|
1204
1204
|
}, "processClassDefinition"), bo = /* @__PURE__ */ r((e, n, t) => {
|
|
1205
1205
|
const o = e === "" ? n : ft(n, e);
|
|
1206
1206
|
o.classGroupId = t;
|
|
1207
|
-
}, "processStringDefinition"),
|
|
1207
|
+
}, "processStringDefinition"), vo = /* @__PURE__ */ r((e, n, t, o) => {
|
|
1208
1208
|
if (xo(e)) {
|
|
1209
1209
|
je(e(o), n, t, o);
|
|
1210
1210
|
return;
|
|
1211
1211
|
}
|
|
1212
1212
|
n.validators === null && (n.validators = []), n.validators.push(lo(t, e));
|
|
1213
|
-
}, "processFunctionDefinition"),
|
|
1214
|
-
const
|
|
1215
|
-
for (let
|
|
1216
|
-
const [l,
|
|
1217
|
-
je(
|
|
1213
|
+
}, "processFunctionDefinition"), po = /* @__PURE__ */ r((e, n, t, o) => {
|
|
1214
|
+
const a = Object.entries(e), i = a.length;
|
|
1215
|
+
for (let s = 0; s < i; s++) {
|
|
1216
|
+
const [l, c] = a[s];
|
|
1217
|
+
je(c, ft(n, l), t, o);
|
|
1218
1218
|
}
|
|
1219
1219
|
}, "processObjectDefinition"), ft = /* @__PURE__ */ r((e, n) => {
|
|
1220
1220
|
let t = e;
|
|
1221
|
-
const o = n.split(we),
|
|
1222
|
-
for (let i = 0; i <
|
|
1223
|
-
const
|
|
1224
|
-
let l = t.nextPart.get(
|
|
1225
|
-
l || (l = gt(), t.nextPart.set(
|
|
1221
|
+
const o = n.split(we), a = o.length;
|
|
1222
|
+
for (let i = 0; i < a; i++) {
|
|
1223
|
+
const s = o[i];
|
|
1224
|
+
let l = t.nextPart.get(s);
|
|
1225
|
+
l || (l = gt(), t.nextPart.set(s, l)), t = l;
|
|
1226
1226
|
}
|
|
1227
1227
|
return t;
|
|
1228
1228
|
}, "getPart"), xo = /* @__PURE__ */ r((e) => "isThemeGetter" in e && e.isThemeGetter === !0, "isThemeGetter"), ko = /* @__PURE__ */ r((e) => {
|
|
@@ -1234,41 +1234,41 @@ const Ut = /* @__PURE__ */ R({
|
|
|
1234
1234
|
}, "set")
|
|
1235
1235
|
};
|
|
1236
1236
|
let n = 0, t = /* @__PURE__ */ Object.create(null), o = /* @__PURE__ */ Object.create(null);
|
|
1237
|
-
const
|
|
1238
|
-
t[i] =
|
|
1237
|
+
const a = /* @__PURE__ */ r((i, s) => {
|
|
1238
|
+
t[i] = s, n++, n > e && (n = 0, o = t, t = /* @__PURE__ */ Object.create(null));
|
|
1239
1239
|
}, "update");
|
|
1240
1240
|
return {
|
|
1241
1241
|
get(i) {
|
|
1242
|
-
let
|
|
1243
|
-
if (
|
|
1244
|
-
return
|
|
1245
|
-
if ((
|
|
1246
|
-
return
|
|
1242
|
+
let s = t[i];
|
|
1243
|
+
if (s !== void 0)
|
|
1244
|
+
return s;
|
|
1245
|
+
if ((s = o[i]) !== void 0)
|
|
1246
|
+
return a(i, s), s;
|
|
1247
1247
|
},
|
|
1248
|
-
set(i,
|
|
1249
|
-
i in t ? t[i] =
|
|
1248
|
+
set(i, s) {
|
|
1249
|
+
i in t ? t[i] = s : a(i, s);
|
|
1250
1250
|
}
|
|
1251
1251
|
};
|
|
1252
|
-
}, "createLruCache"), De = "!", _e = ":", yo = [], et = /* @__PURE__ */ r((e, n, t, o,
|
|
1252
|
+
}, "createLruCache"), De = "!", _e = ":", yo = [], et = /* @__PURE__ */ r((e, n, t, o, a) => ({
|
|
1253
1253
|
modifiers: e,
|
|
1254
1254
|
hasImportantModifier: n,
|
|
1255
1255
|
baseClassName: t,
|
|
1256
1256
|
maybePostfixModifierPosition: o,
|
|
1257
|
-
isExternal:
|
|
1257
|
+
isExternal: a
|
|
1258
1258
|
}), "createResultObject"), wo = /* @__PURE__ */ r((e) => {
|
|
1259
1259
|
const {
|
|
1260
1260
|
prefix: n,
|
|
1261
1261
|
experimentalParseClassName: t
|
|
1262
1262
|
} = e;
|
|
1263
|
-
let o = /* @__PURE__ */ r((
|
|
1263
|
+
let o = /* @__PURE__ */ r((a) => {
|
|
1264
1264
|
const i = [];
|
|
1265
|
-
let
|
|
1266
|
-
const x =
|
|
1265
|
+
let s = 0, l = 0, c = 0, b;
|
|
1266
|
+
const x = a.length;
|
|
1267
1267
|
for (let M = 0; M < x; M++) {
|
|
1268
|
-
const z =
|
|
1269
|
-
if (
|
|
1268
|
+
const z = a[M];
|
|
1269
|
+
if (s === 0 && l === 0) {
|
|
1270
1270
|
if (z === _e) {
|
|
1271
|
-
i.push(
|
|
1271
|
+
i.push(a.slice(c, M)), c = M + 1;
|
|
1272
1272
|
continue;
|
|
1273
1273
|
}
|
|
1274
1274
|
if (z === "/") {
|
|
@@ -1276,29 +1276,29 @@ const Ut = /* @__PURE__ */ R({
|
|
|
1276
1276
|
continue;
|
|
1277
1277
|
}
|
|
1278
1278
|
}
|
|
1279
|
-
z === "[" ?
|
|
1279
|
+
z === "[" ? s++ : z === "]" ? s-- : z === "(" ? l++ : z === ")" && l--;
|
|
1280
1280
|
}
|
|
1281
|
-
const f = i.length === 0 ?
|
|
1282
|
-
let
|
|
1283
|
-
f.endsWith(De) ? (
|
|
1281
|
+
const f = i.length === 0 ? a : a.slice(c);
|
|
1282
|
+
let v = f, A = !1;
|
|
1283
|
+
f.endsWith(De) ? (v = f.slice(0, -1), A = !0) : (
|
|
1284
1284
|
/**
|
|
1285
1285
|
* In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.
|
|
1286
1286
|
* @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864
|
|
1287
1287
|
*/
|
|
1288
|
-
f.startsWith(De) && (
|
|
1288
|
+
f.startsWith(De) && (v = f.slice(1), A = !0)
|
|
1289
1289
|
);
|
|
1290
|
-
const
|
|
1291
|
-
return et(i, A,
|
|
1290
|
+
const p = b && b > c ? b - c : void 0;
|
|
1291
|
+
return et(i, A, v, p);
|
|
1292
1292
|
}, "parseClassName");
|
|
1293
1293
|
if (n) {
|
|
1294
|
-
const
|
|
1295
|
-
o = /* @__PURE__ */ r((
|
|
1294
|
+
const a = n + _e, i = o;
|
|
1295
|
+
o = /* @__PURE__ */ r((s) => s.startsWith(a) ? i(s.slice(a.length)) : et(yo, !1, s, void 0, !0), "parseClassName");
|
|
1296
1296
|
}
|
|
1297
1297
|
if (t) {
|
|
1298
|
-
const
|
|
1298
|
+
const a = o;
|
|
1299
1299
|
o = /* @__PURE__ */ r((i) => t({
|
|
1300
1300
|
className: i,
|
|
1301
|
-
parseClassName:
|
|
1301
|
+
parseClassName: a
|
|
1302
1302
|
}), "parseClassName");
|
|
1303
1303
|
}
|
|
1304
1304
|
return o;
|
|
@@ -1308,12 +1308,12 @@ const Ut = /* @__PURE__ */ R({
|
|
|
1308
1308
|
n.set(t, 1e6 + o);
|
|
1309
1309
|
}), (t) => {
|
|
1310
1310
|
const o = [];
|
|
1311
|
-
let
|
|
1311
|
+
let a = [];
|
|
1312
1312
|
for (let i = 0; i < t.length; i++) {
|
|
1313
|
-
const
|
|
1314
|
-
l ||
|
|
1313
|
+
const s = t[i], l = s[0] === "[", c = n.has(s);
|
|
1314
|
+
l || c ? (a.length > 0 && (a.sort(), o.push(...a), a = []), o.push(s)) : a.push(s);
|
|
1315
1315
|
}
|
|
1316
|
-
return
|
|
1316
|
+
return a.length > 0 && (a.sort(), o.push(...a)), o;
|
|
1317
1317
|
};
|
|
1318
1318
|
}, "createSortModifiers"), Ao = /* @__PURE__ */ r((e) => ({
|
|
1319
1319
|
cache: ko(e.cacheSize),
|
|
@@ -1324,51 +1324,51 @@ const Ut = /* @__PURE__ */ R({
|
|
|
1324
1324
|
const {
|
|
1325
1325
|
parseClassName: t,
|
|
1326
1326
|
getClassGroupId: o,
|
|
1327
|
-
getConflictingClassGroupIds:
|
|
1327
|
+
getConflictingClassGroupIds: a,
|
|
1328
1328
|
sortModifiers: i
|
|
1329
|
-
} = n,
|
|
1330
|
-
let
|
|
1329
|
+
} = n, s = [], l = e.trim().split(So);
|
|
1330
|
+
let c = "";
|
|
1331
1331
|
for (let b = l.length - 1; b >= 0; b -= 1) {
|
|
1332
1332
|
const x = l[b], {
|
|
1333
1333
|
isExternal: f,
|
|
1334
|
-
modifiers:
|
|
1334
|
+
modifiers: v,
|
|
1335
1335
|
hasImportantModifier: A,
|
|
1336
|
-
baseClassName:
|
|
1336
|
+
baseClassName: p,
|
|
1337
1337
|
maybePostfixModifierPosition: M
|
|
1338
1338
|
} = t(x);
|
|
1339
1339
|
if (f) {
|
|
1340
|
-
|
|
1340
|
+
c = x + (c.length > 0 ? " " + c : c);
|
|
1341
1341
|
continue;
|
|
1342
1342
|
}
|
|
1343
|
-
let z = !!M, O = o(z ?
|
|
1343
|
+
let z = !!M, O = o(z ? p.substring(0, M) : p);
|
|
1344
1344
|
if (!O) {
|
|
1345
1345
|
if (!z) {
|
|
1346
|
-
|
|
1346
|
+
c = x + (c.length > 0 ? " " + c : c);
|
|
1347
1347
|
continue;
|
|
1348
1348
|
}
|
|
1349
|
-
if (O = o(
|
|
1350
|
-
|
|
1349
|
+
if (O = o(p), !O) {
|
|
1350
|
+
c = x + (c.length > 0 ? " " + c : c);
|
|
1351
1351
|
continue;
|
|
1352
1352
|
}
|
|
1353
1353
|
z = !1;
|
|
1354
1354
|
}
|
|
1355
|
-
const $ =
|
|
1356
|
-
if (
|
|
1355
|
+
const $ = v.length === 0 ? "" : v.length === 1 ? v[0] : i(v).join(":"), y = A ? $ + De : $, D = y + O;
|
|
1356
|
+
if (s.indexOf(D) > -1)
|
|
1357
1357
|
continue;
|
|
1358
|
-
|
|
1359
|
-
const Y =
|
|
1358
|
+
s.push(D);
|
|
1359
|
+
const Y = a(O, z);
|
|
1360
1360
|
for (let _ = 0; _ < Y.length; ++_) {
|
|
1361
1361
|
const ie = Y[_];
|
|
1362
|
-
|
|
1362
|
+
s.push(y + ie);
|
|
1363
1363
|
}
|
|
1364
|
-
|
|
1364
|
+
c = x + (c.length > 0 ? " " + c : c);
|
|
1365
1365
|
}
|
|
1366
|
-
return
|
|
1366
|
+
return c;
|
|
1367
1367
|
}, "mergeClassList"), Mo = /* @__PURE__ */ r((...e) => {
|
|
1368
|
-
let n = 0, t, o,
|
|
1368
|
+
let n = 0, t, o, a = "";
|
|
1369
1369
|
for (; n < e.length; )
|
|
1370
|
-
(t = e[n++]) && (o = bt(t)) && (
|
|
1371
|
-
return
|
|
1370
|
+
(t = e[n++]) && (o = bt(t)) && (a && (a += " "), a += o);
|
|
1371
|
+
return a;
|
|
1372
1372
|
}, "twJoin"), bt = /* @__PURE__ */ r((e) => {
|
|
1373
1373
|
if (typeof e == "string")
|
|
1374
1374
|
return e;
|
|
@@ -1377,34 +1377,34 @@ const Ut = /* @__PURE__ */ R({
|
|
|
1377
1377
|
e[o] && (n = bt(e[o])) && (t && (t += " "), t += n);
|
|
1378
1378
|
return t;
|
|
1379
1379
|
}, "toValue"), zo = /* @__PURE__ */ r((e, ...n) => {
|
|
1380
|
-
let t, o,
|
|
1381
|
-
const
|
|
1380
|
+
let t, o, a, i;
|
|
1381
|
+
const s = /* @__PURE__ */ r((c) => {
|
|
1382
1382
|
const b = n.reduce((x, f) => f(x), e());
|
|
1383
|
-
return t = Ao(b), o = t.cache.get,
|
|
1384
|
-
}, "initTailwindMerge"), l = /* @__PURE__ */ r((
|
|
1385
|
-
const b = o(
|
|
1383
|
+
return t = Ao(b), o = t.cache.get, a = t.cache.set, i = l, l(c);
|
|
1384
|
+
}, "initTailwindMerge"), l = /* @__PURE__ */ r((c) => {
|
|
1385
|
+
const b = o(c);
|
|
1386
1386
|
if (b)
|
|
1387
1387
|
return b;
|
|
1388
|
-
const x = Io(
|
|
1389
|
-
return
|
|
1388
|
+
const x = Io(c, t);
|
|
1389
|
+
return a(c, x), x;
|
|
1390
1390
|
}, "tailwindMerge");
|
|
1391
|
-
return i =
|
|
1391
|
+
return i = s, (...c) => i(Mo(...c));
|
|
1392
1392
|
}, "createTailwindMerge"), To = [], V = /* @__PURE__ */ r((e) => {
|
|
1393
1393
|
const n = /* @__PURE__ */ r((t) => t[e] || To, "themeGetter");
|
|
1394
1394
|
return n.isThemeGetter = !0, n;
|
|
1395
|
-
}, "fromTheme"),
|
|
1395
|
+
}, "fromTheme"), vt = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, pt = /^\((?:(\w[\w-]*):)?(.+)\)$/i, $o = /^\d+\/\d+$/, Eo = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, Do = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, Lo = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, Vo = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, jo = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, ne = /* @__PURE__ */ r((e) => $o.test(e), "isFraction"), C = /* @__PURE__ */ r((e) => !!e && !Number.isNaN(Number(e)), "isNumber"), J = /* @__PURE__ */ r((e) => !!e && Number.isInteger(Number(e)), "isInteger"), Me = /* @__PURE__ */ r((e) => e.endsWith("%") && C(e.slice(0, -1)), "isPercent"), Z = /* @__PURE__ */ r((e) => Eo.test(e), "isTshirtSize"), xt = /* @__PURE__ */ r(() => !0, "isAny"), Po = /* @__PURE__ */ r((e) => (
|
|
1396
1396
|
// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
|
|
1397
1397
|
// For example, `hsl(0 0% 0%)` would be classified as a length without this check.
|
|
1398
1398
|
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
1399
1399
|
Do.test(e) && !Lo.test(e)
|
|
1400
|
-
), "isLengthOnly"), Pe = /* @__PURE__ */ r(() => !1, "isNever"), Bo = /* @__PURE__ */ r((e) => Vo.test(e), "isShadow"), No = /* @__PURE__ */ r((e) => jo.test(e), "isImage"), Oo = /* @__PURE__ */ r((e) => !g(e) && !m(e), "isAnyNonArbitrary"), Ro = /* @__PURE__ */ r((e) => X(e, wt, Pe), "isArbitrarySize"), g = /* @__PURE__ */ r((e) =>
|
|
1401
|
-
const o =
|
|
1400
|
+
), "isLengthOnly"), Pe = /* @__PURE__ */ r(() => !1, "isNever"), Bo = /* @__PURE__ */ r((e) => Vo.test(e), "isShadow"), No = /* @__PURE__ */ r((e) => jo.test(e), "isImage"), Oo = /* @__PURE__ */ r((e) => !g(e) && !m(e), "isAnyNonArbitrary"), Ro = /* @__PURE__ */ r((e) => X(e, wt, Pe), "isArbitrarySize"), g = /* @__PURE__ */ r((e) => vt.test(e), "isArbitraryValue"), te = /* @__PURE__ */ r((e) => X(e, Ct, Po), "isArbitraryLength"), tt = /* @__PURE__ */ r((e) => X(e, Ko, C), "isArbitraryNumber"), Fo = /* @__PURE__ */ r((e) => X(e, St, xt), "isArbitraryWeight"), Go = /* @__PURE__ */ r((e) => X(e, At, Pe), "isArbitraryFamilyName"), ot = /* @__PURE__ */ r((e) => X(e, kt, Pe), "isArbitraryPosition"), Uo = /* @__PURE__ */ r((e) => X(e, yt, No), "isArbitraryImage"), pe = /* @__PURE__ */ r((e) => X(e, It, Bo), "isArbitraryShadow"), m = /* @__PURE__ */ r((e) => pt.test(e), "isArbitraryVariable"), le = /* @__PURE__ */ r((e) => oe(e, Ct), "isArbitraryVariableLength"), Ho = /* @__PURE__ */ r((e) => oe(e, At), "isArbitraryVariableFamilyName"), rt = /* @__PURE__ */ r((e) => oe(e, kt), "isArbitraryVariablePosition"), Wo = /* @__PURE__ */ r((e) => oe(e, wt), "isArbitraryVariableSize"), qo = /* @__PURE__ */ r((e) => oe(e, yt), "isArbitraryVariableImage"), xe = /* @__PURE__ */ r((e) => oe(e, It, !0), "isArbitraryVariableShadow"), Zo = /* @__PURE__ */ r((e) => oe(e, St, !0), "isArbitraryVariableWeight"), X = /* @__PURE__ */ r((e, n, t) => {
|
|
1401
|
+
const o = vt.exec(e);
|
|
1402
1402
|
return o ? o[1] ? n(o[1]) : t(o[2]) : !1;
|
|
1403
1403
|
}, "getIsArbitraryValue"), oe = /* @__PURE__ */ r((e, n, t = !1) => {
|
|
1404
|
-
const o =
|
|
1404
|
+
const o = pt.exec(e);
|
|
1405
1405
|
return o ? o[1] ? n(o[1]) : t : !1;
|
|
1406
1406
|
}, "getIsArbitraryVariable"), kt = /* @__PURE__ */ r((e) => e === "position" || e === "percentage", "isLabelPosition"), yt = /* @__PURE__ */ r((e) => e === "image" || e === "url", "isLabelImage"), wt = /* @__PURE__ */ r((e) => e === "length" || e === "size" || e === "bg-size", "isLabelSize"), Ct = /* @__PURE__ */ r((e) => e === "length", "isLabelLength"), Ko = /* @__PURE__ */ r((e) => e === "number", "isLabelNumber"), At = /* @__PURE__ */ r((e) => e === "family-name", "isLabelFamilyName"), St = /* @__PURE__ */ r((e) => e === "number" || e === "weight", "isLabelWeight"), It = /* @__PURE__ */ r((e) => e === "shadow", "isLabelShadow"), Yo = /* @__PURE__ */ r(() => {
|
|
1407
|
-
const e = V("color"), n = V("font"), t = V("text"), o = V("font-weight"),
|
|
1407
|
+
const e = V("color"), n = V("font"), t = V("text"), o = V("font-weight"), a = V("tracking"), i = V("leading"), s = V("breakpoint"), l = V("container"), c = V("spacing"), b = V("radius"), x = V("shadow"), f = V("inset-shadow"), v = V("text-shadow"), A = V("drop-shadow"), p = V("blur"), M = V("perspective"), z = V("aspect"), O = V("ease"), $ = V("animate"), y = /* @__PURE__ */ r(() => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], "scaleBreak"), D = /* @__PURE__ */ r(() => [
|
|
1408
1408
|
"center",
|
|
1409
1409
|
"top",
|
|
1410
1410
|
"bottom",
|
|
@@ -1422,7 +1422,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
1422
1422
|
"bottom-left",
|
|
1423
1423
|
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
1424
1424
|
"left-bottom"
|
|
1425
|
-
], "scalePosition"), Y = /* @__PURE__ */ r(() => [...D(), m, g], "scalePositionWithArbitrary"), _ = /* @__PURE__ */ r(() => ["auto", "hidden", "clip", "visible", "scroll"], "scaleOverflow"), ie = /* @__PURE__ */ r(() => ["auto", "contain", "none"], "scaleOverscroll"), w = /* @__PURE__ */ r(() => [m, g,
|
|
1425
|
+
], "scalePosition"), Y = /* @__PURE__ */ r(() => [...D(), m, g], "scalePositionWithArbitrary"), _ = /* @__PURE__ */ r(() => ["auto", "hidden", "clip", "visible", "scroll"], "scaleOverflow"), ie = /* @__PURE__ */ r(() => ["auto", "contain", "none"], "scaleOverscroll"), w = /* @__PURE__ */ r(() => [m, g, c], "scaleUnambiguousSpacing"), W = /* @__PURE__ */ r(() => [ne, "full", "auto", ...w()], "scaleInset"), Oe = /* @__PURE__ */ r(() => [J, "none", "subgrid", m, g], "scaleGridTemplateColsRows"), Re = /* @__PURE__ */ r(() => ["auto", {
|
|
1426
1426
|
span: ["full", J, m, g]
|
|
1427
1427
|
}, J, m, g], "scaleGridColRowStartAndEnd"), ge = /* @__PURE__ */ r(() => [J, "auto", m, g], "scaleGridColRowStartOrEnd"), Fe = /* @__PURE__ */ r(() => ["auto", "min", "max", "fr", m, g], "scaleGridAutoColsRows"), Ce = /* @__PURE__ */ r(() => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], "scaleAlignPrimaryAxis"), re = /* @__PURE__ */ r(() => ["start", "end", "center", "stretch", "center-safe", "end-safe"], "scaleAlignSecondaryAxis"), q = /* @__PURE__ */ r(() => ["auto", ...w()], "scaleMargin"), ee = /* @__PURE__ */ r(() => [ne, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...w()], "scaleSizing"), k = /* @__PURE__ */ r(() => [e, m, g], "scaleColor"), Ge = /* @__PURE__ */ r(() => [...D(), rt, ot, {
|
|
1428
1428
|
position: [m, g]
|
|
@@ -1442,10 +1442,10 @@ const Ut = /* @__PURE__ */ R({
|
|
|
1442
1442
|
// Deprecated since Tailwind CSS v4.0.0
|
|
1443
1443
|
"",
|
|
1444
1444
|
"none",
|
|
1445
|
-
|
|
1445
|
+
p,
|
|
1446
1446
|
m,
|
|
1447
1447
|
g
|
|
1448
|
-
], "scaleBlur"), fe = /* @__PURE__ */ r(() => ["none", C, m, g], "scaleRotate"), be = /* @__PURE__ */ r(() => ["none", C, m, g], "scaleScale"), Se = /* @__PURE__ */ r(() => [C, m, g], "scaleSkew"),
|
|
1448
|
+
], "scaleBlur"), fe = /* @__PURE__ */ r(() => ["none", C, m, g], "scaleRotate"), be = /* @__PURE__ */ r(() => ["none", C, m, g], "scaleScale"), Se = /* @__PURE__ */ r(() => [C, m, g], "scaleSkew"), ve = /* @__PURE__ */ r(() => [ne, "full", ...w()], "scaleTranslate");
|
|
1449
1449
|
return {
|
|
1450
1450
|
cacheSize: 500,
|
|
1451
1451
|
theme: {
|
|
@@ -2104,7 +2104,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
2104
2104
|
"prose",
|
|
2105
2105
|
/** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
|
|
2106
2106
|
{
|
|
2107
|
-
screen: [
|
|
2107
|
+
screen: [s]
|
|
2108
2108
|
},
|
|
2109
2109
|
...ee()
|
|
2110
2110
|
]
|
|
@@ -2206,7 +2206,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
2206
2206
|
* @see https://tailwindcss.com/docs/letter-spacing
|
|
2207
2207
|
*/
|
|
2208
2208
|
tracking: [{
|
|
2209
|
-
tracking: [
|
|
2209
|
+
tracking: [a, m, g]
|
|
2210
2210
|
}],
|
|
2211
2211
|
/**
|
|
2212
2212
|
* Line Clamp
|
|
@@ -2796,7 +2796,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
2796
2796
|
"none",
|
|
2797
2797
|
x,
|
|
2798
2798
|
xe,
|
|
2799
|
-
|
|
2799
|
+
pe
|
|
2800
2800
|
]
|
|
2801
2801
|
}],
|
|
2802
2802
|
/**
|
|
@@ -2811,7 +2811,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
2811
2811
|
* @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow
|
|
2812
2812
|
*/
|
|
2813
2813
|
"inset-shadow": [{
|
|
2814
|
-
"inset-shadow": ["none", f, xe,
|
|
2814
|
+
"inset-shadow": ["none", f, xe, pe]
|
|
2815
2815
|
}],
|
|
2816
2816
|
/**
|
|
2817
2817
|
* Inset Box Shadow Color
|
|
@@ -2878,7 +2878,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
2878
2878
|
* @see https://tailwindcss.com/docs/text-shadow
|
|
2879
2879
|
*/
|
|
2880
2880
|
"text-shadow": [{
|
|
2881
|
-
"text-shadow": ["none",
|
|
2881
|
+
"text-shadow": ["none", v, xe, pe]
|
|
2882
2882
|
}],
|
|
2883
2883
|
/**
|
|
2884
2884
|
* Text Shadow Color
|
|
@@ -3152,7 +3152,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
3152
3152
|
"none",
|
|
3153
3153
|
A,
|
|
3154
3154
|
xe,
|
|
3155
|
-
|
|
3155
|
+
pe
|
|
3156
3156
|
]
|
|
3157
3157
|
}],
|
|
3158
3158
|
/**
|
|
@@ -3495,28 +3495,28 @@ const Ut = /* @__PURE__ */ R({
|
|
|
3495
3495
|
* @see https://tailwindcss.com/docs/translate
|
|
3496
3496
|
*/
|
|
3497
3497
|
translate: [{
|
|
3498
|
-
translate:
|
|
3498
|
+
translate: ve()
|
|
3499
3499
|
}],
|
|
3500
3500
|
/**
|
|
3501
3501
|
* Translate X
|
|
3502
3502
|
* @see https://tailwindcss.com/docs/translate
|
|
3503
3503
|
*/
|
|
3504
3504
|
"translate-x": [{
|
|
3505
|
-
"translate-x":
|
|
3505
|
+
"translate-x": ve()
|
|
3506
3506
|
}],
|
|
3507
3507
|
/**
|
|
3508
3508
|
* Translate Y
|
|
3509
3509
|
* @see https://tailwindcss.com/docs/translate
|
|
3510
3510
|
*/
|
|
3511
3511
|
"translate-y": [{
|
|
3512
|
-
"translate-y":
|
|
3512
|
+
"translate-y": ve()
|
|
3513
3513
|
}],
|
|
3514
3514
|
/**
|
|
3515
3515
|
* Translate Z
|
|
3516
3516
|
* @see https://tailwindcss.com/docs/translate
|
|
3517
3517
|
*/
|
|
3518
3518
|
"translate-z": [{
|
|
3519
|
-
"translate-z":
|
|
3519
|
+
"translate-z": ve()
|
|
3520
3520
|
}],
|
|
3521
3521
|
/**
|
|
3522
3522
|
* Translate None
|
|
@@ -4162,7 +4162,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4162
4162
|
}, Qo = {
|
|
4163
4163
|
key: 0,
|
|
4164
4164
|
class: "absolute inset-0 flex items-center justify-center"
|
|
4165
|
-
},
|
|
4165
|
+
}, at = /* @__PURE__ */ R({
|
|
4166
4166
|
__name: "FButton",
|
|
4167
4167
|
props: {
|
|
4168
4168
|
theme: { default: "default" },
|
|
@@ -4174,10 +4174,11 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4174
4174
|
iconAfter: {},
|
|
4175
4175
|
tag: { default: "button" },
|
|
4176
4176
|
loading: { type: Boolean, default: !1 },
|
|
4177
|
+
disabled: { type: Boolean, default: !1 },
|
|
4177
4178
|
class: { default: "" }
|
|
4178
4179
|
},
|
|
4179
4180
|
setup(e) {
|
|
4180
|
-
const n = I(() => typeof e.icon == "string" ? e.icon : e.icon?.className), t = I(() => typeof e.iconAfter == "string" ? e.iconAfter : e.iconAfter?.className), o = I(() => e.href ? "a" : e.tag),
|
|
4181
|
+
const n = I(() => typeof e.icon == "string" ? e.icon : e.icon?.className), t = I(() => typeof e.iconAfter == "string" ? e.iconAfter : e.iconAfter?.className), o = I(() => e.href ? "a" : e.tag), a = I(() => ({
|
|
4181
4182
|
xxs: "size-2.5",
|
|
4182
4183
|
xs: "size-3",
|
|
4183
4184
|
sm: "size-3.5",
|
|
@@ -4185,10 +4186,10 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4185
4186
|
lg: "size-5",
|
|
4186
4187
|
xl: "size-6"
|
|
4187
4188
|
})[e.size]), i = I(() => {
|
|
4188
|
-
const
|
|
4189
|
-
return
|
|
4190
|
-
}),
|
|
4191
|
-
const
|
|
4189
|
+
const c = nt[e.theme]?.[e.design] || nt.default[e.design];
|
|
4190
|
+
return c || console.warn(`FButton: No theme configuration found for theme "${e.theme}" and design "${e.design}". Falling back to default solid theme.`), c || { base: "", border: "", hover: "", icon: "" };
|
|
4191
|
+
}), s = I(() => {
|
|
4192
|
+
const c = "relative inline-flex items-center justify-center gap-2 font-medium transition-colors duration-200 focus:outline-none active:opacity-80 cursor-pointer", b = {
|
|
4192
4193
|
xxs: "px-2 py-0.5 text-[10px]",
|
|
4193
4194
|
xs: "px-3 py-1 text-[11px]",
|
|
4194
4195
|
sm: "px-3 py-1.5 text-xs",
|
|
@@ -4200,37 +4201,40 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4200
4201
|
lg: "rounded-lg",
|
|
4201
4202
|
"2xl": "rounded-2xl",
|
|
4202
4203
|
full: "rounded-full"
|
|
4203
|
-
},
|
|
4204
|
-
|
|
4204
|
+
}, v = i.value, A = e.disabled ? "opacity-50 cursor-not-allowed pointer-events-none" : "", p = [
|
|
4205
|
+
c,
|
|
4205
4206
|
b[e.size],
|
|
4206
4207
|
x,
|
|
4207
4208
|
f[e.rounding],
|
|
4208
|
-
|
|
4209
|
-
`border ${
|
|
4210
|
-
|
|
4209
|
+
v.base,
|
|
4210
|
+
`border ${v.border}`,
|
|
4211
|
+
e.disabled ? "" : v.hover,
|
|
4212
|
+
A
|
|
4211
4213
|
].filter(Boolean).join(" ");
|
|
4212
|
-
return Jo(
|
|
4214
|
+
return Jo(p, e.class);
|
|
4213
4215
|
}), l = I(() => ({
|
|
4214
4216
|
design: i.value.icon || ""
|
|
4215
4217
|
}));
|
|
4216
|
-
return (
|
|
4217
|
-
href: e.href,
|
|
4218
|
-
|
|
4218
|
+
return (c, b) => (u(), U($t(o.value), {
|
|
4219
|
+
href: e.disabled ? void 0 : e.href,
|
|
4220
|
+
disabled: e.disabled || void 0,
|
|
4221
|
+
"aria-disabled": e.disabled || void 0,
|
|
4222
|
+
class: S(s.value)
|
|
4219
4223
|
}, {
|
|
4220
4224
|
default: H(() => [
|
|
4221
4225
|
e.loading ? (u(), h("div", Qo, [
|
|
4222
4226
|
P(Le, {
|
|
4223
|
-
class: S(
|
|
4227
|
+
class: S(a.value)
|
|
4224
4228
|
}, null, 8, ["class"])
|
|
4225
4229
|
])) : T("", !0),
|
|
4226
|
-
|
|
4230
|
+
d("span", {
|
|
4227
4231
|
class: S(["flex items-center gap-2 transition-opacity duration-200 whitespace-nowrap", e.loading ? "opacity-0" : "opacity-100"])
|
|
4228
4232
|
}, [
|
|
4229
4233
|
n.value ? (u(), h("span", {
|
|
4230
4234
|
key: 0,
|
|
4231
4235
|
class: S(["flex items-center size-[1.1em] mt-[-.07em]", [n.value, l.value.design]])
|
|
4232
4236
|
}, null, 2)) : T("", !0),
|
|
4233
|
-
|
|
4237
|
+
se(c.$slots, "default"),
|
|
4234
4238
|
t.value ? (u(), h("span", {
|
|
4235
4239
|
key: 1,
|
|
4236
4240
|
class: S(["flex items-center size-[1.1em] mt-[-.07em]", [t.value, l.value.design]])
|
|
@@ -4238,7 +4242,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4238
4242
|
], 2)
|
|
4239
4243
|
]),
|
|
4240
4244
|
_: 3
|
|
4241
|
-
}, 8, ["href", "class"]));
|
|
4245
|
+
}, 8, ["href", "disabled", "aria-disabled", "class"]));
|
|
4242
4246
|
}
|
|
4243
4247
|
}), Xo = { 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" }, _o = { class: "flex-1 space-y-6 pb-12" }, er = {
|
|
4244
4248
|
key: 0,
|
|
@@ -4249,10 +4253,10 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4249
4253
|
}, rr = { class: "text-sm text-white/70 leading-relaxed" }, nr = {
|
|
4250
4254
|
key: 2,
|
|
4251
4255
|
class: "space-y-3"
|
|
4252
|
-
},
|
|
4256
|
+
}, ar = {
|
|
4253
4257
|
key: 3,
|
|
4254
4258
|
class: "space-y-3"
|
|
4255
|
-
},
|
|
4259
|
+
}, sr = { class: "grid grid-cols-2 gap-3" }, ir = /* @__PURE__ */ R({
|
|
4256
4260
|
__name: "ElAgentAbout",
|
|
4257
4261
|
props: {
|
|
4258
4262
|
agent: {}
|
|
@@ -4260,21 +4264,21 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4260
4264
|
setup(e) {
|
|
4261
4265
|
return (n, t) => (u(), h("div", Xo, [
|
|
4262
4266
|
P(Ve, { agent: e.agent }, null, 8, ["agent"]),
|
|
4263
|
-
|
|
4267
|
+
d("div", _o, [
|
|
4264
4268
|
e.agent.summary ? (u(), h("div", er, [
|
|
4265
|
-
t[0] || (t[0] =
|
|
4266
|
-
|
|
4269
|
+
t[0] || (t[0] = d("h3", { class: "font-medium text-white/50" }, " About ", -1)),
|
|
4270
|
+
d("div", {
|
|
4267
4271
|
class: "text-white/70 leading-relaxed",
|
|
4268
4272
|
innerHTML: e.agent.summary
|
|
4269
4273
|
}, null, 8, tr)
|
|
4270
4274
|
])) : T("", !0),
|
|
4271
4275
|
e.agent.entityType === "company" ? (u(), h("div", or, [
|
|
4272
|
-
t[1] || (t[1] =
|
|
4273
|
-
|
|
4276
|
+
t[1] || (t[1] = d("h3", { class: "text-sm font-medium text-white/90 mb-2" }, " Company Info ", -1)),
|
|
4277
|
+
d("p", rr, " This is a company agent representing " + N(e.agent.name) + ". ", 1)
|
|
4274
4278
|
])) : T("", !0),
|
|
4275
4279
|
e.agent.email ? (u(), h("div", nr, [
|
|
4276
|
-
t[3] || (t[3] =
|
|
4277
|
-
P(
|
|
4280
|
+
t[3] || (t[3] = d("h3", { class: "text-sm font-medium text-white/90" }, " Contact ", -1)),
|
|
4281
|
+
P(at, {
|
|
4278
4282
|
design: "ghost",
|
|
4279
4283
|
theme: "default",
|
|
4280
4284
|
size: "sm",
|
|
@@ -4284,26 +4288,26 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4284
4288
|
target: "_blank"
|
|
4285
4289
|
}, {
|
|
4286
4290
|
default: H(() => [...t[2] || (t[2] = [
|
|
4287
|
-
|
|
4291
|
+
de(" Email ", -1)
|
|
4288
4292
|
])]),
|
|
4289
4293
|
_: 1
|
|
4290
4294
|
}, 8, ["href"])
|
|
4291
4295
|
])) : T("", !0),
|
|
4292
|
-
e.agent.accounts && e.agent.accounts.length > 0 ? (u(), h("div",
|
|
4293
|
-
t[4] || (t[4] =
|
|
4294
|
-
|
|
4295
|
-
(u(!0), h(K, null, he(e.agent.accounts, (o) => (u(), U(
|
|
4296
|
+
e.agent.accounts && e.agent.accounts.length > 0 ? (u(), h("div", ar, [
|
|
4297
|
+
t[4] || (t[4] = d("h3", { class: "text-sm font-medium text-white/90" }, " Links ", -1)),
|
|
4298
|
+
d("div", sr, [
|
|
4299
|
+
(u(!0), h(K, null, he(e.agent.accounts, (o) => (u(), U(at, {
|
|
4296
4300
|
key: `${o.platform}-${o.handle}`,
|
|
4297
4301
|
design: "ghost",
|
|
4298
4302
|
theme: "default",
|
|
4299
4303
|
size: "md",
|
|
4300
4304
|
class: "bg-white/10 hover:bg-white/20 border border-white/20 text-white/80",
|
|
4301
|
-
icon: j(
|
|
4302
|
-
href: j(
|
|
4305
|
+
icon: j(ae)[o.platform].icon,
|
|
4306
|
+
href: j(ae)[o.platform].getUrl(o.handle),
|
|
4303
4307
|
target: "_blank"
|
|
4304
4308
|
}, {
|
|
4305
4309
|
default: H(() => [
|
|
4306
|
-
|
|
4310
|
+
de(N(j(ae)[o.platform].label), 1)
|
|
4307
4311
|
]),
|
|
4308
4312
|
_: 2
|
|
4309
4313
|
}, 1032, ["icon", "href"]))), 128))
|
|
@@ -4312,7 +4316,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4312
4316
|
])
|
|
4313
4317
|
]));
|
|
4314
4318
|
}
|
|
4315
|
-
}), lr = { class: "flex flex-col h-full relative" },
|
|
4319
|
+
}), lr = { class: "flex flex-col h-full relative" }, dr = { class: "pb-4" }, cr = {
|
|
4316
4320
|
key: 0,
|
|
4317
4321
|
class: "text-white/60 py-16 flex flex-col items-center justify-center gap-3 text-sm"
|
|
4318
4322
|
}, ur = {
|
|
@@ -4324,79 +4328,79 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4324
4328
|
}, gr = ["src", "alt"], mr = { class: "max-w-[70%]" }, fr = { class: "text-sm leading-[1.5] whitespace-pre-wrap break-words" }, br = {
|
|
4325
4329
|
key: 0,
|
|
4326
4330
|
class: "flex gap-2 justify-start items-end mb-4"
|
|
4327
|
-
},
|
|
4331
|
+
}, vr = { class: "flex-shrink-0" }, pr = ["src", "alt"], xr = { class: "flex-shrink-0 pt-6 pb-2" }, kr = ["placeholder", "disabled"], ze = /* @__PURE__ */ R({
|
|
4328
4332
|
__name: "ElAgentChat",
|
|
4329
4333
|
props: {
|
|
4330
4334
|
agentController: {},
|
|
4331
4335
|
agent: {}
|
|
4332
4336
|
},
|
|
4333
4337
|
setup(e) {
|
|
4334
|
-
const n = L(""), t = L(), o = L(),
|
|
4335
|
-
function i(
|
|
4336
|
-
const z =
|
|
4338
|
+
const n = L(""), t = L(), o = L(), a = I(() => ke(e.agent));
|
|
4339
|
+
function i(p, M) {
|
|
4340
|
+
const z = p[M], O = p[M + 1];
|
|
4337
4341
|
return !O || O.sender !== z.sender;
|
|
4338
4342
|
}
|
|
4339
4343
|
r(i, "shouldShowAvatar"), ue(async () => {
|
|
4340
4344
|
if (e.agentController && !e.agentController.textState.value.isConnected)
|
|
4341
4345
|
try {
|
|
4342
4346
|
await e.agentController.startTextConversation();
|
|
4343
|
-
} catch (
|
|
4344
|
-
console.error("Failed to start text conversation:",
|
|
4347
|
+
} catch (p) {
|
|
4348
|
+
console.error("Failed to start text conversation:", p);
|
|
4345
4349
|
}
|
|
4346
4350
|
});
|
|
4347
|
-
async function
|
|
4351
|
+
async function s() {
|
|
4348
4352
|
if (!n.value.trim() || !e.agentController || !e.agentController.textState.value.isConnected)
|
|
4349
4353
|
return;
|
|
4350
|
-
const
|
|
4354
|
+
const p = n.value;
|
|
4351
4355
|
n.value = "", o.value && (o.value.style.height = "auto", o.value.focus());
|
|
4352
4356
|
try {
|
|
4353
|
-
await e.agentController.sendChatMessage(
|
|
4357
|
+
await e.agentController.sendChatMessage(p), c();
|
|
4354
4358
|
} catch (M) {
|
|
4355
4359
|
console.error("Error sending message:", M);
|
|
4356
4360
|
}
|
|
4357
4361
|
}
|
|
4358
|
-
r(
|
|
4359
|
-
function l(
|
|
4360
|
-
|
|
4362
|
+
r(s, "sendMessage");
|
|
4363
|
+
function l(p) {
|
|
4364
|
+
p.key === "Enter" && !p.shiftKey && (p.preventDefault(), s());
|
|
4361
4365
|
}
|
|
4362
4366
|
r(l, "handleKeydown");
|
|
4363
|
-
function
|
|
4367
|
+
function c() {
|
|
4364
4368
|
t.value && Ie(() => {
|
|
4365
|
-
const
|
|
4366
|
-
|
|
4369
|
+
const p = t.value;
|
|
4370
|
+
p.scrollTop = p.scrollHeight;
|
|
4367
4371
|
});
|
|
4368
4372
|
}
|
|
4369
|
-
r(
|
|
4373
|
+
r(c, "scrollToBottom");
|
|
4370
4374
|
function b() {
|
|
4371
4375
|
if (!o.value)
|
|
4372
4376
|
return;
|
|
4373
4377
|
o.value.style.height = "auto";
|
|
4374
|
-
const
|
|
4375
|
-
o.value.style.height = `${
|
|
4378
|
+
const p = Math.min(o.value.scrollHeight, 150);
|
|
4379
|
+
o.value.style.height = `${p}px`;
|
|
4376
4380
|
}
|
|
4377
4381
|
r(b, "adjustTextareaHeight"), Q(n, () => {
|
|
4378
4382
|
Ie(() => b());
|
|
4379
4383
|
});
|
|
4380
4384
|
const x = I(() => {
|
|
4381
|
-
const
|
|
4382
|
-
return
|
|
4385
|
+
const p = e.agentController?.textState.value;
|
|
4386
|
+
return p?.connectionStatus === "disconnected" && !!p?.error;
|
|
4383
4387
|
}), f = I(() => {
|
|
4384
|
-
const
|
|
4385
|
-
return
|
|
4386
|
-
}),
|
|
4387
|
-
return Q(() => e.agentController?.sharedMessages.value, (
|
|
4388
|
-
|
|
4389
|
-
}, { immediate: !0, deep: !0 }), (
|
|
4390
|
-
|
|
4388
|
+
const p = e.agentController?.textState.value;
|
|
4389
|
+
return p?.connectionStatus !== "connected" && !p?.error;
|
|
4390
|
+
}), v = I(() => x.value ? "Agent is offline" : f.value ? "Connecting..." : "Message"), A = I(() => !e.agentController?.textState.value.isConnected);
|
|
4391
|
+
return Q(() => e.agentController?.sharedMessages.value, (p) => {
|
|
4392
|
+
p && p.length > 0 && Ie(() => c());
|
|
4393
|
+
}, { immediate: !0, deep: !0 }), (p, M) => (u(), h("div", lr, [
|
|
4394
|
+
d("div", dr, [
|
|
4391
4395
|
P(Ve, { agent: e.agent }, null, 8, ["agent"])
|
|
4392
4396
|
]),
|
|
4393
|
-
x.value ? (u(), h("div",
|
|
4394
|
-
M[1] || (M[1] =
|
|
4395
|
-
|
|
4397
|
+
x.value ? (u(), h("div", cr, [
|
|
4398
|
+
M[1] || (M[1] = d("i", { class: "i-heroicons-cloud-arrow-down size-8 text-white/40" }, null, -1)),
|
|
4399
|
+
d("span", null, N(e.agentController?.textState.value.error), 1)
|
|
4396
4400
|
])) : f.value ? (u(), h("div", ur, [
|
|
4397
4401
|
P(Le, { class: "size-4" })
|
|
4398
4402
|
])) : T("", !0),
|
|
4399
|
-
|
|
4403
|
+
d("div", {
|
|
4400
4404
|
ref_key: "messagesContainer",
|
|
4401
4405
|
ref: t,
|
|
4402
4406
|
class: "flex-1 overflow-y-auto overflow-x-hidden py-8 space-y-1 min-h-0 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden"
|
|
@@ -4412,39 +4416,39 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4412
4416
|
z.sender === "agent" ? (u(), h("div", hr, [
|
|
4413
4417
|
i(e.agentController?.sharedMessages.value.filter(($) => $.sender !== "system") ?? [], O) ? (u(), h("img", {
|
|
4414
4418
|
key: 0,
|
|
4415
|
-
src:
|
|
4419
|
+
src: a.value,
|
|
4416
4420
|
alt: e.agent.name,
|
|
4417
4421
|
class: "size-7 rounded-full object-cover"
|
|
4418
4422
|
}, null, 8, gr)) : T("", !0)
|
|
4419
4423
|
])) : T("", !0),
|
|
4420
|
-
|
|
4421
|
-
|
|
4424
|
+
d("div", mr, [
|
|
4425
|
+
d("div", {
|
|
4422
4426
|
class: S(["rounded-2xl px-3.5 py-1.5 backdrop-blur-sm", z.sender === "user" ? "bg-primary-500/80 text-white" : "bg-white/15 text-white/95"])
|
|
4423
4427
|
}, [
|
|
4424
|
-
|
|
4428
|
+
d("p", fr, N(z.text), 1)
|
|
4425
4429
|
], 2)
|
|
4426
4430
|
])
|
|
4427
4431
|
], 2))), 128)),
|
|
4428
4432
|
e.agentController?.textState.value.isThinking ? (u(), h("div", br, [
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
src:
|
|
4433
|
+
d("div", vr, [
|
|
4434
|
+
d("img", {
|
|
4435
|
+
src: a.value,
|
|
4432
4436
|
alt: e.agent.name,
|
|
4433
4437
|
class: "size-8 rounded-full object-cover"
|
|
4434
|
-
}, null, 8,
|
|
4438
|
+
}, null, 8, pr)
|
|
4435
4439
|
]),
|
|
4436
|
-
M[2] || (M[2] =
|
|
4437
|
-
|
|
4440
|
+
M[2] || (M[2] = d("div", { class: "rounded-2xl px-4 py-2.5 bg-white/15 backdrop-blur-sm flex items-center" }, [
|
|
4441
|
+
d("i", { class: "i-svg-spinners-3-dots-fade size-6 text-white/70" })
|
|
4438
4442
|
], -1))
|
|
4439
4443
|
])) : T("", !0)
|
|
4440
4444
|
], 512),
|
|
4441
|
-
|
|
4442
|
-
it(
|
|
4445
|
+
d("div", xr, [
|
|
4446
|
+
it(d("textarea", {
|
|
4443
4447
|
ref_key: "textarea",
|
|
4444
4448
|
ref: o,
|
|
4445
4449
|
"onUpdate:modelValue": M[0] || (M[0] = (z) => n.value = z),
|
|
4446
4450
|
rows: "1",
|
|
4447
|
-
placeholder:
|
|
4451
|
+
placeholder: v.value,
|
|
4448
4452
|
disabled: A.value,
|
|
4449
4453
|
style: { "font-size": "16px", resize: "none" },
|
|
4450
4454
|
class: "w-full bg-white/10 backdrop-blur-sm border border-white/20 rounded-3xl px-5 py-3 text-white placeholder-white/50 focus:outline-none focus:border-white/40 disabled:opacity-50 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
@@ -4452,7 +4456,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4452
4456
|
}, null, 40, kr), [
|
|
4453
4457
|
[lt, n.value]
|
|
4454
4458
|
]),
|
|
4455
|
-
M[3] || (M[3] =
|
|
4459
|
+
M[3] || (M[3] = d("div", { class: "text-[10px] text-white/40 text-center mt-2" }, " Press Enter to send, Shift+Enter for new line ", -1))
|
|
4456
4460
|
])
|
|
4457
4461
|
]));
|
|
4458
4462
|
}
|
|
@@ -4463,30 +4467,30 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4463
4467
|
},
|
|
4464
4468
|
setup(e) {
|
|
4465
4469
|
function n() {
|
|
4466
|
-
return e.agent.avatar?.src ? e.agent.avatar.src :
|
|
4470
|
+
return e.agent.avatar?.src ? e.agent.avatar.src : ce();
|
|
4467
4471
|
}
|
|
4468
4472
|
return r(n, "getAvatarSrc"), (t, o) => (u(), h("div", yr, [
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4473
|
+
d("div", wr, [
|
|
4474
|
+
d("div", Cr, [
|
|
4475
|
+
d("img", {
|
|
4472
4476
|
src: n(),
|
|
4473
4477
|
alt: e.agent.name,
|
|
4474
4478
|
class: "w-full h-full object-cover",
|
|
4475
4479
|
onError: o[0] || (o[0] = //@ts-ignore
|
|
4476
|
-
(...
|
|
4480
|
+
(...a) => j(ye) && j(ye)(...a))
|
|
4477
4481
|
}, null, 40, Ar)
|
|
4478
4482
|
]),
|
|
4479
|
-
o[1] || (o[1] =
|
|
4480
|
-
|
|
4483
|
+
o[1] || (o[1] = d("div", { class: "absolute top-1.5 right-1.5" }, [
|
|
4484
|
+
d("div", {
|
|
4481
4485
|
class: "size-4 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
4482
4486
|
style: { "animation-duration": "3s" }
|
|
4483
4487
|
}),
|
|
4484
|
-
|
|
4488
|
+
d("div", { class: "size-4 bg-green-500 rounded-full ring-2 ring-white" })
|
|
4485
4489
|
], -1))
|
|
4486
4490
|
]),
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4491
|
+
d("div", Sr, [
|
|
4492
|
+
d("h1", Ir, N(e.agent.name), 1),
|
|
4493
|
+
d("p", Mr, N(e.agent.title), 1)
|
|
4490
4494
|
])
|
|
4491
4495
|
]));
|
|
4492
4496
|
}
|
|
@@ -4502,15 +4506,15 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4502
4506
|
}, 100);
|
|
4503
4507
|
}), (t, o) => (u(), h("a", {
|
|
4504
4508
|
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",
|
|
4505
|
-
onClick: o[0] || (o[0] = (
|
|
4509
|
+
onClick: o[0] || (o[0] = (a) => t.$emit("click", a))
|
|
4506
4510
|
}, [
|
|
4507
|
-
o[1] || (o[1] =
|
|
4508
|
-
|
|
4509
|
-
|
|
4511
|
+
o[1] || (o[1] = d("span", { class: "absolute inset-0 rounded-full transition-all" }, null, -1)),
|
|
4512
|
+
d("span", Tr, [
|
|
4513
|
+
d("span", {
|
|
4510
4514
|
class: S(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", n.value ? "translate-y-0 translate-x-0 rotate-45" : "translate-y-[30px] -translate-x-[30px] rotate-0"]),
|
|
4511
4515
|
style: { "background-color": "currentColor", "transition-delay": "0.15s" }
|
|
4512
4516
|
}, null, 2),
|
|
4513
|
-
|
|
4517
|
+
d("span", {
|
|
4514
4518
|
class: S(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", n.value ? "translate-y-0 translate-x-0 -rotate-45" : "-translate-y-[30px] -translate-x-[30px] rotate-0"]),
|
|
4515
4519
|
style: { "background-color": "currentColor", "transition-delay": "0.45s" }
|
|
4516
4520
|
}, null, 2)
|
|
@@ -4539,15 +4543,15 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4539
4543
|
},
|
|
4540
4544
|
emits: ["update:modelValue"],
|
|
4541
4545
|
setup(e, { emit: n }) {
|
|
4542
|
-
const t = e, o = n,
|
|
4546
|
+
const t = e, o = n, a = t.position || "left", i = t.widthClasses || "w-[80%] max-w-[300px]", s = I({
|
|
4543
4547
|
get: /* @__PURE__ */ r(() => t.modelValue, "get"),
|
|
4544
4548
|
set: /* @__PURE__ */ r((x) => o("update:modelValue", x), "set")
|
|
4545
4549
|
}), l = I(() => t.items.filter((x) => !x.isHidden));
|
|
4546
|
-
function
|
|
4547
|
-
x.isDisabled || (x.onClick ? x.onClick({ item: x, event: new MouseEvent("click") }) : x.href && (x.href.includes("http") ? window.open(x.href, x.target || "_self")?.focus() : window.location.href = x.href),
|
|
4550
|
+
function c(x) {
|
|
4551
|
+
x.isDisabled || (x.onClick ? x.onClick({ item: x, event: new MouseEvent("click") }) : x.href && (x.href.includes("http") ? window.open(x.href, x.target || "_self")?.focus() : window.location.href = x.href), s.value = !1);
|
|
4548
4552
|
}
|
|
4549
|
-
r(
|
|
4550
|
-
const b = I(() =>
|
|
4553
|
+
r(c, "handleItemClick");
|
|
4554
|
+
const b = I(() => a === "left" ? {
|
|
4551
4555
|
enter: "-translate-x-full",
|
|
4552
4556
|
leave: "-translate-x-full",
|
|
4553
4557
|
position: "justify-start",
|
|
@@ -4568,10 +4572,10 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4568
4572
|
"leave-to-class": "opacity-0"
|
|
4569
4573
|
}, {
|
|
4570
4574
|
default: H(() => [
|
|
4571
|
-
|
|
4575
|
+
s.value ? (u(), h("div", {
|
|
4572
4576
|
key: 0,
|
|
4573
4577
|
class: "absolute inset-0 z-40 bg-black/50 backdrop-blur-sm",
|
|
4574
|
-
onClick: f[0] || (f[0] = (
|
|
4578
|
+
onClick: f[0] || (f[0] = (v) => s.value = !1)
|
|
4575
4579
|
})) : T("", !0)
|
|
4576
4580
|
]),
|
|
4577
4581
|
_: 1
|
|
@@ -4585,61 +4589,61 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4585
4589
|
"leave-to-class": b.value.leave
|
|
4586
4590
|
}, {
|
|
4587
4591
|
default: H(() => [
|
|
4588
|
-
|
|
4592
|
+
s.value ? (u(), h("div", {
|
|
4589
4593
|
key: 0,
|
|
4590
4594
|
class: S(["absolute inset-0 z-50 flex", b.value.position]),
|
|
4591
|
-
onClick: f[3] || (f[3] = (
|
|
4595
|
+
onClick: f[3] || (f[3] = (v) => s.value = !1)
|
|
4592
4596
|
}, [
|
|
4593
|
-
|
|
4597
|
+
d("div", {
|
|
4594
4598
|
class: S(["relative h-full shadow-2xl bg-black/30 backdrop-blur-xl flex flex-col justify-center", j(i)]),
|
|
4595
4599
|
onClick: f[2] || (f[2] = Te(() => {
|
|
4596
4600
|
}, ["stop"]))
|
|
4597
4601
|
}, [
|
|
4598
4602
|
P($r, {
|
|
4599
4603
|
class: S(["absolute top-4 z-10 text-white", b.value.closeButton]),
|
|
4600
|
-
onClick: f[1] || (f[1] = (
|
|
4604
|
+
onClick: f[1] || (f[1] = (v) => s.value = !1)
|
|
4601
4605
|
}, null, 8, ["class"]),
|
|
4602
4606
|
e.title ? (u(), h("div", Er, [
|
|
4603
|
-
|
|
4607
|
+
d("h3", Dr, N(e.title), 1)
|
|
4604
4608
|
])) : T("", !0),
|
|
4605
4609
|
x.$slots.header ? (u(), h("div", Lr, [
|
|
4606
|
-
|
|
4610
|
+
se(x.$slots, "header")
|
|
4607
4611
|
])) : T("", !0),
|
|
4608
|
-
|
|
4612
|
+
d("div", {
|
|
4609
4613
|
class: S(["flex-1 p-6 space-y-2 overflow-y-auto", { "pt-6": !e.title && !x.$slots.header, "pt-4": e.title || x.$slots.header }])
|
|
4610
4614
|
}, [
|
|
4611
|
-
P(
|
|
4615
|
+
P(st, {
|
|
4612
4616
|
"enter-active-class": "transition-all duration-400 ease-[cubic-bezier(0.25,1,0.33,1)]",
|
|
4613
4617
|
"leave-active-class": "transition-all duration-200 ease-[cubic-bezier(0.25,1,0.33,1)]",
|
|
4614
|
-
"enter-from-class": j(
|
|
4618
|
+
"enter-from-class": j(a) === "left" ? "-translate-x-4 opacity-0" : "translate-x-4 opacity-0",
|
|
4615
4619
|
"enter-to-class": "translate-x-0 opacity-100",
|
|
4616
4620
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
4617
|
-
"leave-to-class": j(
|
|
4621
|
+
"leave-to-class": j(a) === "left" ? "-translate-x-4 opacity-0" : "translate-x-4 opacity-0"
|
|
4618
4622
|
}, {
|
|
4619
4623
|
default: H(() => [
|
|
4620
|
-
(u(!0), h(K, null, he(l.value, (
|
|
4621
|
-
key:
|
|
4622
|
-
style:
|
|
4624
|
+
(u(!0), h(K, null, he(l.value, (v, A) => (u(), h("button", {
|
|
4625
|
+
key: v.key || v.label || A,
|
|
4626
|
+
style: dt({ transitionDelay: `${A * 40}ms` }),
|
|
4623
4627
|
class: S(["cursor-pointer w-full text-left p-3 rounded-xl transition-all duration-200 ease-[cubic-bezier(0.25,1,0.33,1)] group", [
|
|
4624
|
-
|
|
4625
|
-
|
|
4628
|
+
v.isActive ? "bg-primary-500/20 border border-primary-500/40" : "hover:bg-white/10",
|
|
4629
|
+
v.isDisabled && "opacity-50 cursor-not-allowed"
|
|
4626
4630
|
]]),
|
|
4627
|
-
disabled:
|
|
4628
|
-
onClick: /* @__PURE__ */ r((
|
|
4631
|
+
disabled: v.isDisabled,
|
|
4632
|
+
onClick: /* @__PURE__ */ r((p) => c(v), "onClick")
|
|
4629
4633
|
}, [
|
|
4630
|
-
|
|
4631
|
-
|
|
4634
|
+
d("div", jr, [
|
|
4635
|
+
v.icon?.src ? (u(), h("i", {
|
|
4632
4636
|
key: 0,
|
|
4633
4637
|
class: S(["size-5 flex-shrink-0 transition-transform duration-200 ease-[cubic-bezier(0.25,1,0.33,1)] group-hover:scale-110", [
|
|
4634
|
-
|
|
4635
|
-
|
|
4638
|
+
v.icon.src,
|
|
4639
|
+
v.isActive ? "text-primary-400" : "text-white/70 group-hover:text-white"
|
|
4636
4640
|
]])
|
|
4637
4641
|
}, null, 2)) : T("", !0),
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
class: S(["font-medium text-sm",
|
|
4641
|
-
}, N(
|
|
4642
|
-
|
|
4642
|
+
d("div", Pr, [
|
|
4643
|
+
d("div", {
|
|
4644
|
+
class: S(["font-medium text-sm", v.isActive ? "text-primary-300" : "text-white"])
|
|
4645
|
+
}, N(v.label), 3),
|
|
4646
|
+
v.subLabel ? (u(), h("div", Br, N(v.subLabel), 1)) : T("", !0)
|
|
4643
4647
|
])
|
|
4644
4648
|
])
|
|
4645
4649
|
], 14, Vr))), 128))
|
|
@@ -4647,12 +4651,12 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4647
4651
|
_: 1
|
|
4648
4652
|
}, 8, ["enter-from-class", "leave-to-class"])
|
|
4649
4653
|
], 2),
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
f[4] || (f[4] =
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4654
|
+
d("div", Nr, [
|
|
4655
|
+
se(x.$slots, "footer", {}, () => [
|
|
4656
|
+
f[4] || (f[4] = d("div", { class: "text-center" }, [
|
|
4657
|
+
d("p", { class: "text-[10px] text-white/40 font-sans" }, [
|
|
4658
|
+
de(" AI Agent by "),
|
|
4659
|
+
d("a", {
|
|
4656
4660
|
href: "https://www.pagelines.com",
|
|
4657
4661
|
target: "_blank",
|
|
4658
4662
|
class: "text-white/60 hover:text-white/80 transition-colors"
|
|
@@ -4677,10 +4681,10 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4677
4681
|
},
|
|
4678
4682
|
emits: ["update:modelValue"],
|
|
4679
4683
|
setup(e, { emit: n }) {
|
|
4680
|
-
const t = e, o = n,
|
|
4684
|
+
const t = e, o = n, a = I({
|
|
4681
4685
|
get: /* @__PURE__ */ r(() => t.modelValue, "get"),
|
|
4682
4686
|
set: /* @__PURE__ */ r((l) => o("update:modelValue", l), "set")
|
|
4683
|
-
}), i = I(() => t.agentController?.agentMode?.value ?? "self"),
|
|
4687
|
+
}), i = I(() => t.agentController?.agentMode?.value ?? "self"), s = I(() => ut.map((l) => ({
|
|
4684
4688
|
key: l.mode,
|
|
4685
4689
|
icon: { src: l.icon },
|
|
4686
4690
|
label: l.label,
|
|
@@ -4689,10 +4693,10 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4689
4693
|
t.agentController?.setMode(l.mode);
|
|
4690
4694
|
}, "onClick")
|
|
4691
4695
|
})));
|
|
4692
|
-
return (l,
|
|
4693
|
-
modelValue:
|
|
4694
|
-
"onUpdate:modelValue":
|
|
4695
|
-
items:
|
|
4696
|
+
return (l, c) => (u(), U(Mt, {
|
|
4697
|
+
modelValue: a.value,
|
|
4698
|
+
"onUpdate:modelValue": c[0] || (c[0] = (b) => a.value = b),
|
|
4699
|
+
items: s.value,
|
|
4696
4700
|
position: "right",
|
|
4697
4701
|
title: "Mode",
|
|
4698
4702
|
"width-classes": "w-[80%] max-w-[255px]"
|
|
@@ -4709,11 +4713,11 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4709
4713
|
},
|
|
4710
4714
|
emits: ["update:modelValue"],
|
|
4711
4715
|
setup(e, { emit: n }) {
|
|
4712
|
-
const t = e, o = n,
|
|
4716
|
+
const t = e, o = n, a = I({
|
|
4713
4717
|
get: /* @__PURE__ */ r(() => t.modelValue, "get"),
|
|
4714
|
-
set: /* @__PURE__ */ r((
|
|
4718
|
+
set: /* @__PURE__ */ r((s) => o("update:modelValue", s), "set")
|
|
4715
4719
|
}), i = I(() => {
|
|
4716
|
-
const
|
|
4720
|
+
const s = [
|
|
4717
4721
|
{
|
|
4718
4722
|
key: "share",
|
|
4719
4723
|
icon: { src: "i-tabler-share" },
|
|
@@ -4740,18 +4744,18 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4740
4744
|
}, "onClick")
|
|
4741
4745
|
}
|
|
4742
4746
|
];
|
|
4743
|
-
return t.sdk.activeUser.value &&
|
|
4747
|
+
return t.sdk.activeUser.value && s.push({
|
|
4744
4748
|
key: "logout",
|
|
4745
4749
|
icon: { src: "i-tabler-logout" },
|
|
4746
4750
|
label: "Logout",
|
|
4747
4751
|
onClick: /* @__PURE__ */ r(async () => {
|
|
4748
4752
|
await t.sdk.logout();
|
|
4749
4753
|
}, "onClick")
|
|
4750
|
-
}),
|
|
4754
|
+
}), s;
|
|
4751
4755
|
});
|
|
4752
|
-
return (
|
|
4753
|
-
modelValue:
|
|
4754
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
4756
|
+
return (s, l) => (u(), U(Mt, {
|
|
4757
|
+
modelValue: a.value,
|
|
4758
|
+
"onUpdate:modelValue": l[0] || (l[0] = (c) => a.value = c),
|
|
4755
4759
|
items: i.value,
|
|
4756
4760
|
position: "left",
|
|
4757
4761
|
title: e.title || "Menu"
|
|
@@ -4784,10 +4788,10 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4784
4788
|
}, rn = { class: "max-w-md mx-auto" }, nn = {
|
|
4785
4789
|
key: 2,
|
|
4786
4790
|
class: "flex-1 flex flex-col relative z-20 min-h-0 w-full px-4 @[480px]/agent:px-6"
|
|
4787
|
-
},
|
|
4791
|
+
}, an = { class: "flex-1 min-h-0 max-w-md mx-auto w-full" }, sn = {
|
|
4788
4792
|
key: 2,
|
|
4789
4793
|
class: "bg-gradient-to-br from-theme-800 to-theme-950 text-white flex items-center justify-center h-full p-8"
|
|
4790
|
-
}, ln = { class: "text-center max-w-md space-y-4" },
|
|
4794
|
+
}, ln = { class: "text-center max-w-md space-y-4" }, dn = { class: "text-sm text-white/70 leading-relaxed" }, cn = {
|
|
4791
4795
|
key: 3,
|
|
4792
4796
|
class: "bg-white/10 backdrop-blur-sm text-white/70 flex items-center justify-center h-full"
|
|
4793
4797
|
}, kn = /* @__PURE__ */ R({
|
|
@@ -4808,7 +4812,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4808
4812
|
},
|
|
4809
4813
|
emits: ["close", "error"],
|
|
4810
4814
|
setup(e, { emit: n }) {
|
|
4811
|
-
const t = n, o = Et(),
|
|
4815
|
+
const t = n, o = Et(), a = L(!1), i = L(!1), s = L(), l = L(), c = I(() => o.value?.agentMode?.value ?? "self"), b = I(() => e.sdk.activeUser.value !== void 0), x = I(() => ut.find((y) => y.mode === c.value));
|
|
4812
4816
|
function f() {
|
|
4813
4817
|
o.value && o.value.destroy();
|
|
4814
4818
|
try {
|
|
@@ -4823,7 +4827,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4823
4827
|
}
|
|
4824
4828
|
}
|
|
4825
4829
|
r(f, "createAgentController");
|
|
4826
|
-
function
|
|
4830
|
+
function v($) {
|
|
4827
4831
|
if (!l.value)
|
|
4828
4832
|
return;
|
|
4829
4833
|
const y = Bt($);
|
|
@@ -4831,23 +4835,23 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4831
4835
|
l.value.style.setProperty(`--primary-${D}`, Y);
|
|
4832
4836
|
});
|
|
4833
4837
|
}
|
|
4834
|
-
r(
|
|
4838
|
+
r(v, "applyTheme"), ue(() => {
|
|
4835
4839
|
try {
|
|
4836
|
-
f(),
|
|
4840
|
+
f(), v(e.theme), e.chatOnly && o.value && o.value.setMode("chat");
|
|
4837
4841
|
} catch ($) {
|
|
4838
4842
|
const y = $ instanceof Error ? $.message : "Failed to initialize digital agent";
|
|
4839
|
-
|
|
4843
|
+
s.value = y, t("error", y);
|
|
4840
4844
|
}
|
|
4841
4845
|
}), Dt(() => {
|
|
4842
4846
|
o.value && o.value.destroy();
|
|
4843
4847
|
}), Q(() => e.theme, ($) => {
|
|
4844
|
-
|
|
4848
|
+
v($);
|
|
4845
4849
|
}), Q(() => e.sdk.activeUser.value, ($, y) => {
|
|
4846
4850
|
y && !$ && o.value && o.value.setMode("self");
|
|
4847
4851
|
});
|
|
4848
|
-
const A = I(() => e.agent.cover?.src && e.agent.cover?.quality === "low" ? !0 : !!(e.agent.avatar?.src && e.agent.avatar?.quality === "low")),
|
|
4852
|
+
const A = I(() => e.agent.cover?.src && e.agent.cover?.quality === "low" ? !0 : !!(e.agent.avatar?.src && e.agent.avatar?.quality === "low")), p = I(() => {
|
|
4849
4853
|
const $ = [A.value ? "backdrop-blur-sm" : ""];
|
|
4850
|
-
return A.value &&
|
|
4854
|
+
return A.value && c.value === "self" ? $.push("from-black/80 via-black/60 to-black/80") : c.value === "self" ? $.push("from-black/70 via-black/50 to-black/80") : $.push("from-black/90 via-black/90 to-black/100"), $.join(" ");
|
|
4851
4855
|
}), M = {
|
|
4852
4856
|
phone: "i-heroicons-phone",
|
|
4853
4857
|
calendar: "i-heroicons-calendar",
|
|
@@ -4867,84 +4871,84 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4867
4871
|
}, [
|
|
4868
4872
|
e.loading ? (u(), h("div", Fr, [
|
|
4869
4873
|
P(Le, { class: "text-white size-8" })
|
|
4870
|
-
])) : e.agent && !
|
|
4874
|
+
])) : e.agent && !s.value ? (u(), h("div", {
|
|
4871
4875
|
key: 1,
|
|
4872
4876
|
class: "absolute inset-0 bg-cover bg-center bg-no-repeat",
|
|
4873
|
-
style:
|
|
4877
|
+
style: dt({ backgroundImage: `url(${j(ke)(e.agent) || j(ce)()})` }),
|
|
4874
4878
|
"data-quality": e.agent.avatar?.quality || "none"
|
|
4875
4879
|
}, [
|
|
4876
|
-
|
|
4877
|
-
class: S(["absolute inset-0 bg-gradient-to-br z-0",
|
|
4880
|
+
d("div", {
|
|
4881
|
+
class: S(["absolute inset-0 bg-gradient-to-br z-0", p.value])
|
|
4878
4882
|
}, null, 2),
|
|
4879
|
-
|
|
4883
|
+
d("div", {
|
|
4880
4884
|
class: S(["relative z-10 flex flex-col h-full transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] will-change-transform", e.isActive ? "opacity-100 translate-y-0" : "opacity-0 translate-y-2"])
|
|
4881
4885
|
}, [
|
|
4882
|
-
|
|
4883
|
-
class: S(["relative z-30 p-2",
|
|
4886
|
+
d("div", {
|
|
4887
|
+
class: S(["relative z-30 p-2", c.value !== "self" ? "backdrop-blur-lg" : ""])
|
|
4884
4888
|
}, [
|
|
4885
4889
|
e.chatOnly ? (u(), h("div", Ur, [
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
src: j(ke)(e.agent) || j(
|
|
4890
|
+
d("div", Hr, [
|
|
4891
|
+
d("img", {
|
|
4892
|
+
src: j(ke)(e.agent) || j(ce)(),
|
|
4889
4893
|
alt: e.agent.name,
|
|
4890
4894
|
class: "size-8 rounded-full object-cover"
|
|
4891
4895
|
}, null, 8, Wr),
|
|
4892
|
-
|
|
4896
|
+
d("span", qr, N(e.agent.name), 1)
|
|
4893
4897
|
]),
|
|
4894
4898
|
e.hasClose ? (u(), h("div", Zr, [
|
|
4895
|
-
|
|
4899
|
+
d("button", {
|
|
4896
4900
|
class: "cursor-pointer flex items-center p-3 rounded-2xl text-white/70 hover:bg-white/10 transition-colors",
|
|
4897
4901
|
onClick: y[0] || (y[0] = Te((D) => t("close", "button"), ["stop"]))
|
|
4898
4902
|
}, [...y[7] || (y[7] = [
|
|
4899
|
-
|
|
4903
|
+
d("i", { class: "size-6 i-tabler-x" }, null, -1)
|
|
4900
4904
|
])])
|
|
4901
4905
|
])) : T("", !0)
|
|
4902
4906
|
])) : (u(), h("div", {
|
|
4903
4907
|
key: 1,
|
|
4904
4908
|
class: S(["flex items-center", e.hasClose ? "" : "justify-between"])
|
|
4905
4909
|
}, [
|
|
4906
|
-
|
|
4910
|
+
d("div", {
|
|
4907
4911
|
class: S(e.hasClose ? "flex-1 basis-0" : "")
|
|
4908
4912
|
}, [
|
|
4909
|
-
|
|
4913
|
+
d("button", {
|
|
4910
4914
|
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",
|
|
4911
|
-
onClick: y[1] || (y[1] = (D) =>
|
|
4915
|
+
onClick: y[1] || (y[1] = (D) => a.value = !0)
|
|
4912
4916
|
}, [...y[8] || (y[8] = [
|
|
4913
|
-
|
|
4917
|
+
d("i", { class: "i-tabler-menu size-7" }, null, -1)
|
|
4914
4918
|
])])
|
|
4915
4919
|
], 2),
|
|
4916
|
-
|
|
4920
|
+
d("button", {
|
|
4917
4921
|
class: S(["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": i.value }]),
|
|
4918
4922
|
onClick: y[2] || (y[2] = (D) => i.value = !0)
|
|
4919
4923
|
}, [
|
|
4920
|
-
|
|
4924
|
+
d("i", {
|
|
4921
4925
|
class: S([x.value?.icon, "size-4 opacity-60"])
|
|
4922
4926
|
}, null, 2),
|
|
4923
|
-
|
|
4924
|
-
y[9] || (y[9] =
|
|
4927
|
+
d("span", Kr, N(x.value?.label), 1),
|
|
4928
|
+
y[9] || (y[9] = d("i", { class: "i-tabler-chevron-down size-4" }, null, -1))
|
|
4925
4929
|
], 2),
|
|
4926
4930
|
e.hasClose ? (u(), h("div", Yr, [
|
|
4927
|
-
|
|
4931
|
+
d("button", {
|
|
4928
4932
|
class: "cursor-pointer flex items-center p-3 rounded-2xl text-white/70 hover:bg-white/10 transition-colors",
|
|
4929
4933
|
onClick: y[3] || (y[3] = Te((D) => t("close", "button"), ["stop"]))
|
|
4930
4934
|
}, [...y[10] || (y[10] = [
|
|
4931
|
-
|
|
4935
|
+
d("i", { class: "size-6 i-tabler-x" }, null, -1)
|
|
4932
4936
|
])])
|
|
4933
4937
|
])) : T("", !0)
|
|
4934
4938
|
], 2))
|
|
4935
4939
|
], 2),
|
|
4936
4940
|
e.chatOnly ? (u(), h("div", Jr, [
|
|
4937
|
-
|
|
4941
|
+
d("div", Qr, [
|
|
4938
4942
|
P(ze, {
|
|
4939
4943
|
"agent-controller": o.value,
|
|
4940
4944
|
agent: e.agent
|
|
4941
4945
|
}, null, 8, ["agent-controller", "agent"])
|
|
4942
4946
|
])
|
|
4943
4947
|
])) : (u(), h(K, { key: 1 }, [
|
|
4944
|
-
|
|
4945
|
-
y[11] || (y[11] =
|
|
4948
|
+
c.value === "self" ? (u(), h("div", Xr, [
|
|
4949
|
+
y[11] || (y[11] = d("div", { class: "flex-1 basis-0 mb-12" }, null, -1)),
|
|
4946
4950
|
P(zr, { agent: e.agent }, null, 8, ["agent"]),
|
|
4947
|
-
|
|
4951
|
+
d("div", _r, [
|
|
4948
4952
|
P(ht, {
|
|
4949
4953
|
theme: "primary",
|
|
4950
4954
|
size: "lg",
|
|
@@ -4954,30 +4958,30 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4954
4958
|
onClick: y[4] || (y[4] = (D) => o.value?.setMode("talk"))
|
|
4955
4959
|
}, {
|
|
4956
4960
|
default: H(() => [
|
|
4957
|
-
|
|
4961
|
+
de(N(z.value), 1)
|
|
4958
4962
|
]),
|
|
4959
4963
|
_: 1
|
|
4960
4964
|
}, 8, ["icon"]),
|
|
4961
4965
|
e.agent.accounts && e.agent.accounts.length > 0 ? (u(), h("div", en, [
|
|
4962
|
-
(u(!0), h(K, null, he(e.agent.accounts.filter((D) => j(
|
|
4966
|
+
(u(!0), h(K, null, he(e.agent.accounts.filter((D) => j(ae)[D.platform]), (D) => (u(), h("a", {
|
|
4963
4967
|
key: `${D.platform}-${D.handle}`,
|
|
4964
|
-
href: j(
|
|
4968
|
+
href: j(ae)[D.platform].getUrl(D.handle),
|
|
4965
4969
|
target: "_blank",
|
|
4966
4970
|
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"
|
|
4967
4971
|
}, [
|
|
4968
|
-
|
|
4969
|
-
class: S([j(
|
|
4972
|
+
d("i", {
|
|
4973
|
+
class: S([j(ae)[D.platform].icon, "size-5"])
|
|
4970
4974
|
}, null, 2)
|
|
4971
4975
|
], 8, tn))), 128))
|
|
4972
4976
|
])) : T("", !0)
|
|
4973
4977
|
])
|
|
4974
|
-
])) :
|
|
4978
|
+
])) : c.value === "talk" ? (u(), h("div", on, [
|
|
4975
4979
|
e.requireAuth && !b.value ? (u(), U(Qe, {
|
|
4976
4980
|
key: 0,
|
|
4977
4981
|
sdk: e.sdk
|
|
4978
4982
|
}, null, 8, ["sdk"])) : (u(), h(K, { key: 1 }, [
|
|
4979
|
-
|
|
4980
|
-
|
|
4983
|
+
d("div", null, [
|
|
4984
|
+
d("div", rn, [
|
|
4981
4985
|
P(Ve, { agent: e.agent }, null, 8, ["agent"])
|
|
4982
4986
|
])
|
|
4983
4987
|
]),
|
|
@@ -4987,8 +4991,8 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4987
4991
|
}, null, 8, ["agent-controller", "agent"])
|
|
4988
4992
|
], 64))
|
|
4989
4993
|
])) : (u(), h("div", nn, [
|
|
4990
|
-
|
|
4991
|
-
|
|
4994
|
+
d("div", an, [
|
|
4995
|
+
c.value === "chat" ? (u(), h(K, { key: 0 }, [
|
|
4992
4996
|
e.requireAuth && !b.value ? (u(), U(Qe, {
|
|
4993
4997
|
key: 0,
|
|
4994
4998
|
sdk: e.sdk
|
|
@@ -4997,41 +5001,41 @@ const Ut = /* @__PURE__ */ R({
|
|
|
4997
5001
|
"agent-controller": o.value,
|
|
4998
5002
|
agent: e.agent
|
|
4999
5003
|
}, null, 8, ["agent-controller", "agent"]))
|
|
5000
|
-
], 64)) :
|
|
5004
|
+
], 64)) : c.value === "info" ? (u(), U(ir, {
|
|
5001
5005
|
key: 1,
|
|
5002
5006
|
agent: e.agent
|
|
5003
5007
|
}, null, 8, ["agent"])) : T("", !0)
|
|
5004
5008
|
])
|
|
5005
5009
|
]))
|
|
5006
5010
|
], 64)),
|
|
5007
|
-
|
|
5008
|
-
class: S(["relative z-20 text-center py-5 px-6",
|
|
5011
|
+
d("div", {
|
|
5012
|
+
class: S(["relative z-20 text-center py-5 px-6", c.value === "info" ? "hidden" : ""])
|
|
5009
5013
|
}, [...y[12] || (y[12] = [
|
|
5010
|
-
|
|
5014
|
+
d("a", {
|
|
5011
5015
|
href: "https://www.pagelines.com",
|
|
5012
5016
|
class: "flex items-center justify-center gap-1.5 text-[10px] font-sans font-normal text-white/50 hover:text-white/70 transition-colors"
|
|
5013
5017
|
}, [
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5018
|
+
d("span", { class: "" }, "AI Agent™"),
|
|
5019
|
+
d("span", { class: "text-white/20" }, "by"),
|
|
5020
|
+
d("span", null, "PageLines")
|
|
5017
5021
|
], -1)
|
|
5018
5022
|
])], 2)
|
|
5019
5023
|
], 2)
|
|
5020
|
-
], 12, Gr)) :
|
|
5021
|
-
|
|
5022
|
-
y[13] || (y[13] =
|
|
5023
|
-
|
|
5024
|
-
|
|
5024
|
+
], 12, Gr)) : s.value ? (u(), h("div", sn, [
|
|
5025
|
+
d("div", ln, [
|
|
5026
|
+
y[13] || (y[13] = d("div", { class: "flex justify-center" }, [
|
|
5027
|
+
d("div", { class: "rounded-full bg-red-500/20 flex items-center justify-center size-10" }, [
|
|
5028
|
+
d("i", { class: "i-tabler-alert-circle size-6 text-red-400" })
|
|
5025
5029
|
])
|
|
5026
5030
|
], -1)),
|
|
5027
|
-
y[14] || (y[14] =
|
|
5028
|
-
|
|
5031
|
+
y[14] || (y[14] = d("h3", { class: "text-lg font-medium" }, " Agent Error ", -1)),
|
|
5032
|
+
d("p", dn, N(s.value), 1)
|
|
5029
5033
|
])
|
|
5030
|
-
])) : (u(), h("div",
|
|
5034
|
+
])) : (u(), h("div", cn, " There was an error loading the digital agent. Please try again later. ")),
|
|
5031
5035
|
e.chatOnly ? T("", !0) : (u(), U(Rr, {
|
|
5032
5036
|
key: 4,
|
|
5033
|
-
modelValue:
|
|
5034
|
-
"onUpdate:modelValue": y[5] || (y[5] = (D) =>
|
|
5037
|
+
modelValue: a.value,
|
|
5038
|
+
"onUpdate:modelValue": y[5] || (y[5] = (D) => a.value = D),
|
|
5035
5039
|
agent: e.agent,
|
|
5036
5040
|
sdk: e.sdk,
|
|
5037
5041
|
title: e.agent.name,
|
|
@@ -5066,17 +5070,17 @@ const Ut = /* @__PURE__ */ R({
|
|
|
5066
5070
|
const n = Lt("AgentWrap"), t = e, o = t.sdk || Vt.getInstance({
|
|
5067
5071
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
5068
5072
|
...t.apiBase && { apiBase: t.apiBase }
|
|
5069
|
-
}),
|
|
5073
|
+
}), a = L(!t.agent), i = L(t.agent), s = L();
|
|
5070
5074
|
return ue(async () => {
|
|
5071
5075
|
if (t.agent) {
|
|
5072
5076
|
n.debug("Agent provided via props, skipping fetch", {
|
|
5073
5077
|
agentId: t.agent.agentId,
|
|
5074
5078
|
handle: t.agent.handle
|
|
5075
|
-
}),
|
|
5079
|
+
}), a.value = !1;
|
|
5076
5080
|
return;
|
|
5077
5081
|
}
|
|
5078
5082
|
if (!t.handle) {
|
|
5079
|
-
|
|
5083
|
+
s.value = "No handle or agent provided", n.warn("AgentWrap mounted without handle or agent", {
|
|
5080
5084
|
propsReceived: {
|
|
5081
5085
|
handle: t.handle,
|
|
5082
5086
|
agent: t.agent,
|
|
@@ -5087,11 +5091,11 @@ const Ut = /* @__PURE__ */ R({
|
|
|
5087
5091
|
isDev: o.isDev,
|
|
5088
5092
|
apiBase: o.apiBase
|
|
5089
5093
|
}
|
|
5090
|
-
}),
|
|
5094
|
+
}), a.value = !1;
|
|
5091
5095
|
return;
|
|
5092
5096
|
}
|
|
5093
5097
|
try {
|
|
5094
|
-
|
|
5098
|
+
a.value = !0, n.debug("Fetching public agent", { handle: t.handle });
|
|
5095
5099
|
const l = await o.getPublicAgent({ handle: t.handle });
|
|
5096
5100
|
l ? (i.value = l, n.debug("Successfully fetched public agent", {
|
|
5097
5101
|
agentId: l.agentId,
|
|
@@ -5102,7 +5106,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
5102
5106
|
properties: {
|
|
5103
5107
|
viewSource: "widget"
|
|
5104
5108
|
}
|
|
5105
|
-
})) : (
|
|
5109
|
+
})) : (s.value = o.error.value || "Agent not found", n.error("Failed to fetch public agent - no data returned", {
|
|
5106
5110
|
handle: t.handle,
|
|
5107
5111
|
sdkError: o.error.value,
|
|
5108
5112
|
sdkState: {
|
|
@@ -5112,7 +5116,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
5112
5116
|
}
|
|
5113
5117
|
}));
|
|
5114
5118
|
} catch (l) {
|
|
5115
|
-
|
|
5119
|
+
s.value = l instanceof Error ? l.message : "Failed to fetch agent", n.error("Exception while fetching public agent", {
|
|
5116
5120
|
handle: t.handle,
|
|
5117
5121
|
error: l instanceof Error ? {
|
|
5118
5122
|
message: l.message,
|
|
@@ -5125,11 +5129,11 @@ const Ut = /* @__PURE__ */ R({
|
|
|
5125
5129
|
}
|
|
5126
5130
|
});
|
|
5127
5131
|
} finally {
|
|
5128
|
-
|
|
5132
|
+
a.value = !1, i.value || n.debug("AgentWrap component will render empty (silent failure)", {
|
|
5129
5133
|
state: {
|
|
5130
|
-
loading:
|
|
5134
|
+
loading: a.value,
|
|
5131
5135
|
hasAgent: !!i.value,
|
|
5132
|
-
error:
|
|
5136
|
+
error: s.value
|
|
5133
5137
|
},
|
|
5134
5138
|
props: {
|
|
5135
5139
|
handle: t.handle,
|
|
@@ -5143,10 +5147,10 @@ const Ut = /* @__PURE__ */ R({
|
|
|
5143
5147
|
}
|
|
5144
5148
|
});
|
|
5145
5149
|
}
|
|
5146
|
-
}), (l,
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
])])) : i.value ?
|
|
5150
|
+
}), (l, c) => (u(), h("div", un, [
|
|
5151
|
+
a.value ? (u(), h("div", hn, [...c[0] || (c[0] = [
|
|
5152
|
+
d("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
|
|
5153
|
+
])])) : i.value ? se(l.$slots, "default", {
|
|
5150
5154
|
key: 1,
|
|
5151
5155
|
sdk: j(o),
|
|
5152
5156
|
agent: i.value,
|
|
@@ -5154,7 +5158,7 @@ const Ut = /* @__PURE__ */ R({
|
|
|
5154
5158
|
firstMessage: e.firstMessage,
|
|
5155
5159
|
buttonText: e.buttonText,
|
|
5156
5160
|
buttonIcon: e.buttonIcon,
|
|
5157
|
-
loading:
|
|
5161
|
+
loading: a.value
|
|
5158
5162
|
}) : T("", !0)
|
|
5159
5163
|
]));
|
|
5160
5164
|
}
|
|
@@ -5162,13 +5166,13 @@ const Ut = /* @__PURE__ */ R({
|
|
|
5162
5166
|
export {
|
|
5163
5167
|
Nt as A,
|
|
5164
5168
|
$e as C,
|
|
5165
|
-
|
|
5169
|
+
vn as V,
|
|
5166
5170
|
yn as _,
|
|
5167
5171
|
kn as a,
|
|
5168
|
-
|
|
5172
|
+
ce as b,
|
|
5169
5173
|
Ot as c,
|
|
5170
5174
|
Rt as d,
|
|
5171
|
-
|
|
5175
|
+
pn as e,
|
|
5172
5176
|
ut as f,
|
|
5173
5177
|
ke as g,
|
|
5174
5178
|
Je as h,
|
|
@@ -5177,4 +5181,4 @@ export {
|
|
|
5177
5181
|
Gt as k,
|
|
5178
5182
|
Ft as p
|
|
5179
5183
|
};
|
|
5180
|
-
//# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang-
|
|
5184
|
+
//# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang-DWBaKmcq.js.map
|