@_solaris/messenger-widget 0.6.4 → 0.6.6
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/iframe/iframe.css +1 -1
- package/dist/iframe/iframe.js +1 -1
- package/dist/messenger.cjs +1 -1
- package/dist/messenger.js +213 -209
- package/dist/snippet.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -2356,7 +2356,8 @@ const _n = /* @__PURE__ */ U(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
|
|
|
2356
2356
|
methods: {
|
|
2357
2357
|
// Open a conversation seeded with the typed first message. The
|
|
2358
2358
|
// parent (`startConv` + send) handles draft creation and the
|
|
2359
|
-
// screen
|
|
2359
|
+
// home→chat screen crossfade; we just hand it the text and clear
|
|
2360
|
+
// the field.
|
|
2360
2361
|
submitStarter() {
|
|
2361
2362
|
if (!this.canStart) return;
|
|
2362
2363
|
const e = this.starterText.trim();
|
|
@@ -2696,7 +2697,7 @@ function Qn(e, t, s, r, i, n) {
|
|
|
2696
2697
|
])
|
|
2697
2698
|
]);
|
|
2698
2699
|
}
|
|
2699
|
-
const Zn = /* @__PURE__ */ U(gn, [["render", Qn], ["__scopeId", "data-v-
|
|
2700
|
+
const Zn = /* @__PURE__ */ U(gn, [["render", Qn], ["__scopeId", "data-v-c754e832"]]), es = {
|
|
2700
2701
|
name: "WmHistory",
|
|
2701
2702
|
components: { AIAvatar: he, HumanAvatar: ve },
|
|
2702
2703
|
inject: {
|
|
@@ -4326,7 +4327,7 @@ function Ke({ audio: e }) {
|
|
|
4326
4327
|
systemAudio: e ? "include" : "exclude"
|
|
4327
4328
|
};
|
|
4328
4329
|
}
|
|
4329
|
-
function
|
|
4330
|
+
function yo(e) {
|
|
4330
4331
|
return e ? e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : "file" : "file";
|
|
4331
4332
|
}
|
|
4332
4333
|
async function ci() {
|
|
@@ -6368,14 +6369,13 @@ const Wa = /* @__PURE__ */ U(Pa, [["render", Ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
6368
6369
|
// quick-link without URL), so users who open the chat and walk away
|
|
6369
6370
|
// don't leave empty threads behind.
|
|
6370
6371
|
// Home-screen starter input → open a conversation already seeded
|
|
6371
|
-
// with the user's first message. Entering draft mode
|
|
6372
|
-
// conversation view
|
|
6373
|
-
// transition
|
|
6374
|
-
// and posts the text.
|
|
6372
|
+
// with the user's first message. Entering draft mode swaps the
|
|
6373
|
+
// home screen for the conversation view, which crossfades in via
|
|
6374
|
+
// the `wm-screen` transition ; `onSend` then materializes the
|
|
6375
|
+
// draft server-side and posts the text.
|
|
6375
6376
|
onOnboardingStart(e) {
|
|
6376
|
-
this.startConv();
|
|
6377
6377
|
const t = (e || "").trim();
|
|
6378
|
-
t && this.$nextTick(() => this.onSend(t));
|
|
6378
|
+
this.startConv(), t && this.$nextTick(() => this.onSend(t));
|
|
6379
6379
|
},
|
|
6380
6380
|
startConv() {
|
|
6381
6381
|
this.draftConv = {
|
|
@@ -6723,34 +6723,37 @@ const Wa = /* @__PURE__ */ U(Pa, [["render", Ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
6723
6723
|
class: "wm-loading",
|
|
6724
6724
|
"aria-busy": "true",
|
|
6725
6725
|
"aria-live": "polite"
|
|
6726
|
-
}, Ya = ["aria-label"], Ja = {
|
|
6727
|
-
key:
|
|
6728
|
-
class: "wm-state"
|
|
6729
|
-
},
|
|
6726
|
+
}, Ya = ["aria-label"], Ja = { class: "wm-screens" }, Xa = {
|
|
6727
|
+
key: "error",
|
|
6728
|
+
class: "wm-screen wm-state"
|
|
6729
|
+
}, Qa = { class: "wm-state__err" }, Za = { class: "wm-state__errTitle" }, eo = { class: "wm-state__errSub" }, to = {
|
|
6730
|
+
key: "chat",
|
|
6731
|
+
class: "wm-screen wm-screen--chat"
|
|
6732
|
+
}, no = { class: "wm-bottom" }, so = {
|
|
6730
6733
|
key: 0,
|
|
6731
6734
|
ref: "floatEl",
|
|
6732
6735
|
class: "wm-float"
|
|
6733
|
-
},
|
|
6736
|
+
}, ro = {
|
|
6734
6737
|
key: 1,
|
|
6735
6738
|
class: "wm-actionWait",
|
|
6736
6739
|
role: "status",
|
|
6737
6740
|
"aria-live": "polite"
|
|
6738
|
-
},
|
|
6741
|
+
}, io = { class: "wm-actionWait__lbl" }, ao = {
|
|
6739
6742
|
key: 2,
|
|
6740
6743
|
class: "wm-attached"
|
|
6741
|
-
},
|
|
6744
|
+
}, oo = ["src", "alt"], lo = {
|
|
6742
6745
|
key: 1,
|
|
6743
6746
|
class: "wm-attached__file"
|
|
6744
|
-
},
|
|
6747
|
+
}, co = { class: "wm-attached__fileMeta" }, uo = { class: "wm-attached__fileName" }, mo = {
|
|
6745
6748
|
key: 0,
|
|
6746
6749
|
class: "wm-attached__fileSize"
|
|
6747
|
-
},
|
|
6750
|
+
}, ho = ["aria-label", "onClick"], fo = {
|
|
6748
6751
|
key: 3,
|
|
6749
6752
|
class: "wm-ended",
|
|
6750
6753
|
role: "status",
|
|
6751
6754
|
"aria-live": "polite"
|
|
6752
|
-
},
|
|
6753
|
-
function
|
|
6755
|
+
}, _o = { class: "wm-ended__lbl" };
|
|
6756
|
+
function go(e, t, s, r, i, n) {
|
|
6754
6757
|
const a = P("Launcher"), o = P("Header"), f = P("History"), k = P("Onboarding"), y = P("MessageList"), T = P("InlineCallbacks"), I = P("FormCard"), S = P("Feedback"), z = P("Composer"), M = P("MoreMenu"), D = P("RenameDialog");
|
|
6755
6758
|
return c(), d("div", {
|
|
6756
6759
|
class: R(["wm-root", `wm-root--${s.displayMode}`]),
|
|
@@ -6817,203 +6820,204 @@ function fo(e, t, s, r, i, n) {
|
|
|
6817
6820
|
onMore: n.toggleMore,
|
|
6818
6821
|
onClose: n.close
|
|
6819
6822
|
}, null, 8, ["title", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "agent-name", "agent-avatar-url", "onBack", "onMore", "onClose"]),
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
t[10] || (t[10] = l("div", { class: "wm-state__errIcon" }, [
|
|
6823
|
-
l("svg", {
|
|
6824
|
-
width: "14",
|
|
6825
|
-
height: "14",
|
|
6826
|
-
viewBox: "0 0 24 24",
|
|
6827
|
-
fill: "none",
|
|
6828
|
-
stroke: "currentColor",
|
|
6829
|
-
"stroke-width": "2",
|
|
6830
|
-
"stroke-linecap": "round",
|
|
6831
|
-
"stroke-linejoin": "round",
|
|
6832
|
-
"aria-hidden": "true"
|
|
6833
|
-
}, [
|
|
6834
|
-
l("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
6835
|
-
])
|
|
6836
|
-
], -1)),
|
|
6837
|
-
l("div", null, [
|
|
6838
|
-
l("div", Qa, v(n.t("error.connectionFailed")), 1),
|
|
6839
|
-
l("div", Za, v(n.error), 1)
|
|
6840
|
-
])
|
|
6841
|
-
])
|
|
6842
|
-
])) : !n.currentConv && i.showHistory ? (c(), B(f, {
|
|
6843
|
-
key: 1,
|
|
6844
|
-
threads: n.openThreads,
|
|
6845
|
-
onResume: n.onDrawerPick
|
|
6846
|
-
}, null, 8, ["threads", "onResume"])) : n.currentConv ? (c(), d(E, { key: 3 }, [
|
|
6847
|
-
K(Ae, {
|
|
6848
|
-
appear: "",
|
|
6849
|
-
name: "wm-convEnter"
|
|
6850
|
-
}, {
|
|
6823
|
+
l("div", Ja, [
|
|
6824
|
+
K(Ae, { name: "wm-screen" }, {
|
|
6851
6825
|
default: Se(() => [
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
"streaming-active": n.streamingActive,
|
|
6856
|
-
"date-label": n.dateLabel,
|
|
6857
|
-
"conversation-id": n.currentConv ? n.currentConv.id : null,
|
|
6858
|
-
"loading-more": n.paginationState.loading,
|
|
6859
|
-
"has-more": n.paginationState.hasMore,
|
|
6860
|
-
"unread-anchor-id": e.unreadAnchorId,
|
|
6861
|
-
"unread-boundary-ts": e.unreadBoundaryTs,
|
|
6862
|
-
"ai-agent-name": n.agentName,
|
|
6863
|
-
"ai-agent-avatar-url": n.agentAvatarUrl,
|
|
6864
|
-
onLoadMore: n.onLoadMore
|
|
6865
|
-
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-id", "unread-boundary-ts", "ai-agent-name", "ai-agent-avatar-url", "onLoadMore"])
|
|
6866
|
-
]),
|
|
6867
|
-
_: 1
|
|
6868
|
-
}),
|
|
6869
|
-
l("div", eo, [
|
|
6870
|
-
n.floatVisible ? (c(), d("div", to, [
|
|
6871
|
-
n.pendingApproval ? (c(), B(T, {
|
|
6872
|
-
key: `appr-${n.pendingApproval.id}`,
|
|
6873
|
-
variant: "buttons",
|
|
6874
|
-
items: n.approvalCallbacks,
|
|
6875
|
-
onSelect: n.onApprovalSelect
|
|
6876
|
-
}, null, 8, ["items", "onSelect"])) : n.pendingResolution ? (c(), B(T, {
|
|
6877
|
-
key: `res-${n.pendingResolution.id}`,
|
|
6878
|
-
variant: "buttons",
|
|
6879
|
-
items: n.resolutionCallbacks,
|
|
6880
|
-
onSelect: n.onResolutionSelect
|
|
6881
|
-
}, null, 8, ["items", "onSelect"])) : n.pendingForm ? (c(), B(I, {
|
|
6882
|
-
key: n.pendingForm.message && n.pendingForm.message.id,
|
|
6883
|
-
form: n.pendingForm.form,
|
|
6884
|
-
"agent-name": n.agentName,
|
|
6885
|
-
"agent-avatar-url": n.agentAvatarUrl,
|
|
6886
|
-
onSubmit: n.onFormSubmit
|
|
6887
|
-
}, null, 8, ["form", "agent-name", "agent-avatar-url", "onSubmit"])) : n.showFeedback ? (c(), B(S, {
|
|
6888
|
-
key: 3,
|
|
6889
|
-
busy: i.feedbackBusy,
|
|
6890
|
-
done: !!(n.currentConv && i.feedbackDone[n.currentConv.id]),
|
|
6891
|
-
onSubmit: n.onFeedback
|
|
6892
|
-
}, null, 8, ["busy", "done", "onSubmit"])) : (c(), B(T, {
|
|
6893
|
-
key: 4,
|
|
6894
|
-
items: n.suggestions,
|
|
6895
|
-
onSelect: n.onSuggestion
|
|
6896
|
-
}, null, 8, ["items", "onSelect"]))
|
|
6897
|
-
], 512)) : b("", !0),
|
|
6898
|
-
n.actionInFlight ? (c(), d("div", no, [
|
|
6899
|
-
t[11] || (t[11] = l("span", {
|
|
6900
|
-
class: "wm-actionWait__spinner",
|
|
6901
|
-
"aria-hidden": "true"
|
|
6902
|
-
}, null, -1)),
|
|
6903
|
-
l("span", so, v(n.t("action.inProgress", {
|
|
6904
|
-
name: n.actionInFlightName
|
|
6905
|
-
})), 1)
|
|
6906
|
-
])) : b("", !0),
|
|
6907
|
-
i.pendingAttachments.length ? (c(), d("div", ro, [
|
|
6908
|
-
(c(!0), d(E, null, N(i.pendingAttachments, (x, q) => (c(), d("div", {
|
|
6909
|
-
key: x.path || q,
|
|
6910
|
-
class: "wm-attached__item"
|
|
6911
|
-
}, [
|
|
6912
|
-
x.previewUrl ? (c(), d("img", {
|
|
6913
|
-
key: 0,
|
|
6914
|
-
class: "wm-attached__thumb",
|
|
6915
|
-
src: x.previewUrl,
|
|
6916
|
-
alt: x.name
|
|
6917
|
-
}, null, 8, io)) : (c(), d("div", ao, [
|
|
6918
|
-
t[12] || (t[12] = l("span", { class: "wm-attached__fileIcon" }, [
|
|
6826
|
+
n.error ? (c(), d("div", Xa, [
|
|
6827
|
+
l("div", Qa, [
|
|
6828
|
+
t[10] || (t[10] = l("div", { class: "wm-state__errIcon" }, [
|
|
6919
6829
|
l("svg", {
|
|
6920
|
-
width: "
|
|
6921
|
-
height: "
|
|
6830
|
+
width: "14",
|
|
6831
|
+
height: "14",
|
|
6922
6832
|
viewBox: "0 0 24 24",
|
|
6923
6833
|
fill: "none",
|
|
6924
6834
|
stroke: "currentColor",
|
|
6925
|
-
"stroke-width": "
|
|
6835
|
+
"stroke-width": "2",
|
|
6926
6836
|
"stroke-linecap": "round",
|
|
6927
6837
|
"stroke-linejoin": "round",
|
|
6928
6838
|
"aria-hidden": "true"
|
|
6929
6839
|
}, [
|
|
6930
|
-
l("path", { d: "
|
|
6931
|
-
l("path", { d: "M14 2v6h6" })
|
|
6840
|
+
l("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
6932
6841
|
])
|
|
6933
6842
|
], -1)),
|
|
6934
|
-
l("
|
|
6935
|
-
l("
|
|
6936
|
-
|
|
6937
|
-
x.size_bytes
|
|
6938
|
-
)), 1)) : b("", !0)
|
|
6843
|
+
l("div", null, [
|
|
6844
|
+
l("div", Za, v(n.t("error.connectionFailed")), 1),
|
|
6845
|
+
l("div", eo, v(n.error), 1)
|
|
6939
6846
|
])
|
|
6940
|
-
])
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
6847
|
+
])
|
|
6848
|
+
])) : !n.currentConv && i.showHistory ? (c(), B(f, {
|
|
6849
|
+
key: "history",
|
|
6850
|
+
class: "wm-screen",
|
|
6851
|
+
threads: n.openThreads,
|
|
6852
|
+
onResume: n.onDrawerPick
|
|
6853
|
+
}, null, 8, ["threads", "onResume"])) : n.currentConv ? (c(), d("div", to, [
|
|
6854
|
+
K(y, {
|
|
6855
|
+
ref: "messageList",
|
|
6856
|
+
messages: n.displayedMessages,
|
|
6857
|
+
"streaming-active": n.streamingActive,
|
|
6858
|
+
"date-label": n.dateLabel,
|
|
6859
|
+
"conversation-id": n.currentConv ? n.currentConv.id : null,
|
|
6860
|
+
"loading-more": n.paginationState.loading,
|
|
6861
|
+
"has-more": n.paginationState.hasMore,
|
|
6862
|
+
"unread-anchor-id": e.unreadAnchorId,
|
|
6863
|
+
"unread-boundary-ts": e.unreadBoundaryTs,
|
|
6864
|
+
"ai-agent-name": n.agentName,
|
|
6865
|
+
"ai-agent-avatar-url": n.agentAvatarUrl,
|
|
6866
|
+
onLoadMore: n.onLoadMore
|
|
6867
|
+
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-id", "unread-boundary-ts", "ai-agent-name", "ai-agent-avatar-url", "onLoadMore"]),
|
|
6868
|
+
l("div", no, [
|
|
6869
|
+
n.floatVisible ? (c(), d("div", so, [
|
|
6870
|
+
n.pendingApproval ? (c(), B(T, {
|
|
6871
|
+
key: `appr-${n.pendingApproval.id}`,
|
|
6872
|
+
variant: "buttons",
|
|
6873
|
+
items: n.approvalCallbacks,
|
|
6874
|
+
onSelect: n.onApprovalSelect
|
|
6875
|
+
}, null, 8, ["items", "onSelect"])) : n.pendingResolution ? (c(), B(T, {
|
|
6876
|
+
key: `res-${n.pendingResolution.id}`,
|
|
6877
|
+
variant: "buttons",
|
|
6878
|
+
items: n.resolutionCallbacks,
|
|
6879
|
+
onSelect: n.onResolutionSelect
|
|
6880
|
+
}, null, 8, ["items", "onSelect"])) : n.pendingForm ? (c(), B(I, {
|
|
6881
|
+
key: n.pendingForm.message && n.pendingForm.message.id,
|
|
6882
|
+
form: n.pendingForm.form,
|
|
6883
|
+
"agent-name": n.agentName,
|
|
6884
|
+
"agent-avatar-url": n.agentAvatarUrl,
|
|
6885
|
+
onSubmit: n.onFormSubmit
|
|
6886
|
+
}, null, 8, ["form", "agent-name", "agent-avatar-url", "onSubmit"])) : n.showFeedback ? (c(), B(S, {
|
|
6887
|
+
key: 3,
|
|
6888
|
+
busy: i.feedbackBusy,
|
|
6889
|
+
done: !!(n.currentConv && i.feedbackDone[n.currentConv.id]),
|
|
6890
|
+
onSubmit: n.onFeedback
|
|
6891
|
+
}, null, 8, ["busy", "done", "onSubmit"])) : (c(), B(T, {
|
|
6892
|
+
key: 4,
|
|
6893
|
+
items: n.suggestions,
|
|
6894
|
+
onSelect: n.onSuggestion
|
|
6895
|
+
}, null, 8, ["items", "onSelect"]))
|
|
6896
|
+
], 512)) : b("", !0),
|
|
6897
|
+
n.actionInFlight ? (c(), d("div", ro, [
|
|
6898
|
+
t[11] || (t[11] = l("span", {
|
|
6899
|
+
class: "wm-actionWait__spinner",
|
|
6900
|
+
"aria-hidden": "true"
|
|
6901
|
+
}, null, -1)),
|
|
6902
|
+
l("span", io, v(n.t("action.inProgress", {
|
|
6903
|
+
name: n.actionInFlightName
|
|
6904
|
+
})), 1)
|
|
6905
|
+
])) : b("", !0),
|
|
6906
|
+
i.pendingAttachments.length ? (c(), d("div", ao, [
|
|
6907
|
+
(c(!0), d(E, null, N(i.pendingAttachments, (x, q) => (c(), d("div", {
|
|
6908
|
+
key: x.path || q,
|
|
6909
|
+
class: "wm-attached__item"
|
|
6910
|
+
}, [
|
|
6911
|
+
x.previewUrl ? (c(), d("img", {
|
|
6912
|
+
key: 0,
|
|
6913
|
+
class: "wm-attached__thumb",
|
|
6914
|
+
src: x.previewUrl,
|
|
6915
|
+
alt: x.name
|
|
6916
|
+
}, null, 8, oo)) : (c(), d("div", lo, [
|
|
6917
|
+
t[12] || (t[12] = l("span", { class: "wm-attached__fileIcon" }, [
|
|
6918
|
+
l("svg", {
|
|
6919
|
+
width: "16",
|
|
6920
|
+
height: "16",
|
|
6921
|
+
viewBox: "0 0 24 24",
|
|
6922
|
+
fill: "none",
|
|
6923
|
+
stroke: "currentColor",
|
|
6924
|
+
"stroke-width": "1.7",
|
|
6925
|
+
"stroke-linecap": "round",
|
|
6926
|
+
"stroke-linejoin": "round",
|
|
6927
|
+
"aria-hidden": "true"
|
|
6928
|
+
}, [
|
|
6929
|
+
l("path", { d: "M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" }),
|
|
6930
|
+
l("path", { d: "M14 2v6h6" })
|
|
6931
|
+
])
|
|
6932
|
+
], -1)),
|
|
6933
|
+
l("span", co, [
|
|
6934
|
+
l("span", uo, v(x.name), 1),
|
|
6935
|
+
n.formatAttachmentSize(x.size_bytes) ? (c(), d("span", mo, v(n.formatAttachmentSize(
|
|
6936
|
+
x.size_bytes
|
|
6937
|
+
)), 1)) : b("", !0)
|
|
6938
|
+
])
|
|
6939
|
+
])),
|
|
6940
|
+
l("button", {
|
|
6941
|
+
type: "button",
|
|
6942
|
+
class: "wm-attached__remove",
|
|
6943
|
+
"aria-label": n.t("attachment.remove"),
|
|
6944
|
+
onClick: (J) => n.removePendingAttachment(q)
|
|
6945
|
+
}, [...t[13] || (t[13] = [
|
|
6946
|
+
l("svg", {
|
|
6947
|
+
width: "10",
|
|
6948
|
+
height: "10",
|
|
6949
|
+
viewBox: "0 0 24 24",
|
|
6950
|
+
fill: "none",
|
|
6951
|
+
stroke: "currentColor",
|
|
6952
|
+
"stroke-width": "2.4",
|
|
6953
|
+
"stroke-linecap": "round",
|
|
6954
|
+
"stroke-linejoin": "round",
|
|
6955
|
+
"aria-hidden": "true"
|
|
6956
|
+
}, [
|
|
6957
|
+
l("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
6958
|
+
], -1)
|
|
6959
|
+
])], 8, ho)
|
|
6960
|
+
]))), 128))
|
|
6961
|
+
])) : b("", !0),
|
|
6962
|
+
n.endedBlockVisible ? (c(), d("div", fo, [
|
|
6963
|
+
l("span", _o, v(n.isClosed ? n.t("composer.conversationClosed") : n.t("composer.conversationEnded")), 1),
|
|
6964
|
+
l("button", {
|
|
6965
|
+
type: "button",
|
|
6966
|
+
class: "wm-ended__btn",
|
|
6967
|
+
onClick: t[2] || (t[2] = (x) => n.isClosed ? n.onReopen() : n.startConv())
|
|
6968
|
+
}, v(n.isClosed ? n.t("composer.reopen") : n.t("composer.newConversation")), 1)
|
|
6969
|
+
])) : n.actionInFlight ? b("", !0) : (c(), B(z, {
|
|
6970
|
+
key: 4,
|
|
6971
|
+
ref: "composer",
|
|
6972
|
+
modelValue: i.draft,
|
|
6973
|
+
"onUpdate:modelValue": t[3] || (t[3] = (x) => i.draft = x),
|
|
6974
|
+
placeholder: n.composerPlaceholder,
|
|
6975
|
+
"attach-label": n.t("composer.attachFile"),
|
|
6976
|
+
"display-mode": s.displayMode,
|
|
6977
|
+
onSend: n.onSend,
|
|
6978
|
+
onAttach: n.onAttach
|
|
6979
|
+
}, null, 8, ["modelValue", "placeholder", "attach-label", "display-mode", "onSend", "onAttach"]))
|
|
6980
|
+
]),
|
|
6981
|
+
i.moreOpen ? (c(), B(M, {
|
|
6982
|
+
key: 0,
|
|
6983
|
+
"can-rename": !!n.currentConv && !n.currentConv._draft,
|
|
6984
|
+
"can-export": !!n.currentConv && !n.currentConv._draft,
|
|
6985
|
+
"sound-enabled": e.soundEnabled,
|
|
6986
|
+
"status-url": n.statusUrl,
|
|
6987
|
+
"help-url": n.helpUrl,
|
|
6988
|
+
onClose: t[4] || (t[4] = (x) => i.moreOpen = !1),
|
|
6989
|
+
onSoundToggle: e.onSoundToggle,
|
|
6990
|
+
onAction: n.onMoreAction
|
|
6991
|
+
}, null, 8, ["can-rename", "can-export", "sound-enabled", "status-url", "help-url", "onSoundToggle", "onAction"])) : b("", !0),
|
|
6992
|
+
i.renameDialogOpen && n.currentConv && !n.currentConv._draft ? (c(), B(D, {
|
|
6993
|
+
key: 1,
|
|
6994
|
+
"initial-value": n.currentConv.name || "",
|
|
6995
|
+
title: n.t("rename.dialogTitle"),
|
|
6996
|
+
onClose: t[5] || (t[5] = (x) => i.renameDialogOpen = !1),
|
|
6997
|
+
onSubmit: n.onRenameSubmit
|
|
6998
|
+
}, null, 8, ["initial-value", "title", "onSubmit"])) : b("", !0)
|
|
6999
|
+
])) : (c(), B(k, {
|
|
7000
|
+
key: "home",
|
|
7001
|
+
class: "wm-screen",
|
|
7002
|
+
title: n.widgetTitle,
|
|
7003
|
+
subtitle: n.widgetSubtitle,
|
|
7004
|
+
"agent-name": n.agentName,
|
|
7005
|
+
"default-icon-url": n.defaultIconUrl,
|
|
7006
|
+
"cover-image-url": n.coverImageUrl,
|
|
7007
|
+
"quick-links": n.quickLinks,
|
|
7008
|
+
"open-threads": n.openThreads,
|
|
7009
|
+
busy: i.busy,
|
|
7010
|
+
onStart: n.onOnboardingStart,
|
|
7011
|
+
onSelect: n.onQuickLink,
|
|
7012
|
+
onResume: n.onDrawerPick,
|
|
7013
|
+
onViewHistory: t[1] || (t[1] = (x) => i.showHistory = !0)
|
|
7014
|
+
}, null, 8, ["title", "subtitle", "agent-name", "default-icon-url", "cover-image-url", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"]))
|
|
7015
|
+
]),
|
|
7016
|
+
_: 1
|
|
7017
|
+
})
|
|
7018
|
+
]),
|
|
7015
7019
|
i.moreOpen && !n.currentConv ? (c(), B(M, {
|
|
7016
|
-
key:
|
|
7020
|
+
key: 0,
|
|
7017
7021
|
"can-rename": !1,
|
|
7018
7022
|
"can-export": !1,
|
|
7019
7023
|
"sound-enabled": e.soundEnabled,
|
|
@@ -7027,7 +7031,7 @@ function fo(e, t, s, r, i, n) {
|
|
|
7027
7031
|
], 6)) : b("", !0)
|
|
7028
7032
|
], 6);
|
|
7029
7033
|
}
|
|
7030
|
-
const
|
|
7034
|
+
const po = /* @__PURE__ */ U($a, [["render", go], ["__scopeId", "data-v-92685b04"]]), wo = "0.6.6";
|
|
7031
7035
|
export {
|
|
7032
7036
|
he as AIAvatar,
|
|
7033
7037
|
be as AVATAR_COLORS,
|
|
@@ -7049,14 +7053,14 @@ export {
|
|
|
7049
7053
|
qt as Launcher,
|
|
7050
7054
|
Le as MEDIA_RECORDER_SUPPORTED,
|
|
7051
7055
|
oi as MessageList,
|
|
7052
|
-
|
|
7056
|
+
po as Messenger,
|
|
7053
7057
|
Ba as MoreMenu,
|
|
7054
7058
|
Zn as Onboarding,
|
|
7055
7059
|
ge as SCREEN_CAPTURE_SUPPORTED,
|
|
7056
7060
|
mt as SUPPORTED_LANGUAGES,
|
|
7057
7061
|
tn as TeamAvatars,
|
|
7058
7062
|
Br as Typing,
|
|
7059
|
-
|
|
7063
|
+
wo as VERSION,
|
|
7060
7064
|
xe as avatarColor,
|
|
7061
7065
|
Oe as avatarInitials,
|
|
7062
7066
|
ci as captureScreenshotFile,
|
|
@@ -7065,9 +7069,9 @@ export {
|
|
|
7065
7069
|
H as createTranslator,
|
|
7066
7070
|
tt as createTransport,
|
|
7067
7071
|
re as dateLocale,
|
|
7068
|
-
|
|
7072
|
+
po as default,
|
|
7069
7073
|
Ce as formatTime,
|
|
7070
|
-
|
|
7074
|
+
yo as guessAttachmentKind,
|
|
7071
7075
|
li as pickRecorderMime,
|
|
7072
7076
|
Ve as renderInlineMarkdown,
|
|
7073
7077
|
_t as renderMarkdown,
|
package/dist/snippet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Messenger=function(u){"use strict";let t=null,a=null,d=null,l="",p=null,w=null,g=null;function M(e){t&&b();const n=e.widgetId||"",c=e.baseUrl||"";l=e.widgetOrigin||c;const r=e.token||"";let h=null;e.variables&&typeof e.variables=="object"?h=e.variables:e.context&&typeof e.context=="object"&&(h=e.context);const s=e.displayMode||"floating",o=e.language||"",f=e.allowUnauthenticated===!0;if(!n||!l){console.warn("[messenger] init skipped — missing widgetId or widgetOrigin");return}!f&&!r&&console.warn("[messenger] init: allowUnauthenticated=false but no token provided. In app mode you must pass a `token` (JWT linked) at every init() call. See messenger-back /auth/jwt to generate one server-side. Without a token, /session will return 403.");const m=new URL(`${U(l)}/widget/${encodeURIComponent(n)}`);s!=="floating"&&m.searchParams.set("display_mode",s),o&&m.searchParams.set("language",o),t=document.createElement("iframe"),t.src=m.toString(),t.title="Messenger",t.setAttribute("aria-label","Messenger"),t.setAttribute("allow","clipboard-write; microphone; notifications; display-capture"),t.setAttribute("data-messenger-widget",""),y(t,s,"closed"),document.body.appendChild(t),window.visualViewport&&(g=()=>{t&&w&&w.state!=="closed"&&y(t,w.displayMode,w.state,w.dims)},window.visualViewport.addEventListener("resize",g),window.visualViewport.addEventListener("scroll",g)),a=document.createElement("div"),a.setAttribute("data-messenger-shadow",""),v(a,{hidden:!0}),document.body.appendChild(a),d=document.createElement("div"),d.setAttribute("data-messenger-peek-shadow",""),x(d,{hidden:!0}),document.body.appendChild(d);let E=!1;const O=()=>{E||!t||(E=!0,t.contentWindow.postMessage({type:"INIT",origin:window.location.origin,token:r||null,variables:h||null,allowUnauthenticated:f},l))};p=I=>{if(I.origin!==l)return;const i=I.data;!i||typeof i!="object"||(i.type==="READY"?O():i.type==="RESIZE"&&t&&(y(t,i.displayMode||s,i.state,{width:i.width,height:i.height}),a&&(i.state==="closed"&&i.launcherWidth&&i.launcherHeight?v(a,{width:i.launcherWidth,height:i.launcherHeight,hovered:!!i.launcherHovered}):v(a,{hidden:!0})),d&&(i.state==="closed"&&i.peek?x(d,{...i.peek,hovered:!!i.peekHovered}):x(d,{hidden:!0}))))},window.addEventListener("message",p),t.addEventListener("load",O),setTimeout(()=>{E||console.warn("[messenger] iframe did not boot after",1e4,"ms — check CSP frame-ancestors and network")},1e4)}function b(){p&&(window.removeEventListener("message",p),p=null),g&&window.visualViewport&&(window.visualViewport.removeEventListener("resize",g),window.visualViewport.removeEventListener("scroll",g),g=null),w=null,t&&(t.remove(),t=null),a&&(a.remove(),a=null),d&&(d.remove(),d=null),l=""}function S(e){!t||!l||!e||typeof e!="object"||t.contentWindow.postMessage({type:"UPDATE",payload:e},l)}function k(e){!t||!l||!e||typeof e!="object"||t.contentWindow.postMessage({type:"CONTEXT",payload:e},l)}function v(e,n){if(n.hidden){e.style.cssText="display:none";return}const c=n.width||50,r=n.height||50,h=Math.max(20,c-6),s=Math.max(20,r-6),o=8+(c-h)/2,f=8+(r-s)/2,m=n.hovered?"0 8px 22px rgba(0, 0, 0, 0.26)":"0 4px 14px rgba(0, 0, 0, 0.18)";e.style.cssText=["position:fixed","pointer-events:none",`bottom:${f}px`,`right:${o}px`,`width:${h}px`,`height:${s}px`,"border-radius:50%","background:transparent",`box-shadow:${m}`,"transition:box-shadow 100ms ease","z-index:2147483646"].join(";")}function x(e,n){if(n.hidden){e.style.cssText="display:none";return}const c=n.width||286,r=n.height||80,h=8+(n.rightOffset||0),s=8+(n.bottomOffset||0),o=n.hovered?"0 6px 18px rgba(0, 0, 0, 0.16)":"0 3px 10px rgba(0, 0, 0, 0.10)";e.style.cssText=["position:fixed","pointer-events:none",`bottom:${s}px`,`right:${h}px`,`width:${c}px`,`height:${r}px`,"border-radius:16px 16px 8px 16px","background:transparent",`box-shadow:${o}`,"transition:box-shadow 100ms ease, width 100ms ease, height 100ms ease, right 100ms ease, bottom 100ms ease","z-index:2147483646"].join(";")}function U(e){return e.endsWith("/")?e.slice(0,-1):e}function y(e,n,c,r){w={displayMode:n,state:c,dims:r};const h=["position:fixed","border:0","z-index:2147483647","color-scheme:normal","background:transparent"];let s;if(n==="embedded")s=["inset:0","width:100%","height:100%"];else if(c==="closed"){const o=r&&r.width>0?r.width:80,f=r&&r.height>0?r.height:80;s=["bottom:0","right:0",`width:${o}px`,`height:${f}px`]}else if(n==="sheet"){const o=T();o?s=[`top:${o.top}px`,"right:0","width:min(470px, 100vw)",`height:${o.height}px`]:s=["top:0","bottom:0","right:0","width:min(470px, 100vw)","height:100dvh"]}else{const o=T();s=[`bottom:${o?o.bottom:0}px`,"right:0","width:460px","height:720px","max-width:100vw",`max-height:${o?`${o.height}px`:"100vh"}`]}e.style.cssText=h.concat(s).join(";")}function T(){const e=window.visualViewport;if(!e)return null;const n=Math.max(0,Math.round(window.innerHeight-e.height-e.offsetTop));return n<80?null:{top:Math.round(e.offsetTop),height:Math.round(e.height),bottom:n}}const $="0.6.
|
|
1
|
+
var Messenger=function(u){"use strict";let t=null,a=null,d=null,l="",p=null,w=null,g=null;function M(e){t&&b();const n=e.widgetId||"",c=e.baseUrl||"";l=e.widgetOrigin||c;const r=e.token||"";let h=null;e.variables&&typeof e.variables=="object"?h=e.variables:e.context&&typeof e.context=="object"&&(h=e.context);const s=e.displayMode||"floating",o=e.language||"",f=e.allowUnauthenticated===!0;if(!n||!l){console.warn("[messenger] init skipped — missing widgetId or widgetOrigin");return}!f&&!r&&console.warn("[messenger] init: allowUnauthenticated=false but no token provided. In app mode you must pass a `token` (JWT linked) at every init() call. See messenger-back /auth/jwt to generate one server-side. Without a token, /session will return 403.");const m=new URL(`${U(l)}/widget/${encodeURIComponent(n)}`);s!=="floating"&&m.searchParams.set("display_mode",s),o&&m.searchParams.set("language",o),t=document.createElement("iframe"),t.src=m.toString(),t.title="Messenger",t.setAttribute("aria-label","Messenger"),t.setAttribute("allow","clipboard-write; microphone; notifications; display-capture"),t.setAttribute("data-messenger-widget",""),y(t,s,"closed"),document.body.appendChild(t),window.visualViewport&&(g=()=>{t&&w&&w.state!=="closed"&&y(t,w.displayMode,w.state,w.dims)},window.visualViewport.addEventListener("resize",g),window.visualViewport.addEventListener("scroll",g)),a=document.createElement("div"),a.setAttribute("data-messenger-shadow",""),v(a,{hidden:!0}),document.body.appendChild(a),d=document.createElement("div"),d.setAttribute("data-messenger-peek-shadow",""),x(d,{hidden:!0}),document.body.appendChild(d);let E=!1;const O=()=>{E||!t||(E=!0,t.contentWindow.postMessage({type:"INIT",origin:window.location.origin,token:r||null,variables:h||null,allowUnauthenticated:f},l))};p=I=>{if(I.origin!==l)return;const i=I.data;!i||typeof i!="object"||(i.type==="READY"?O():i.type==="RESIZE"&&t&&(y(t,i.displayMode||s,i.state,{width:i.width,height:i.height}),a&&(i.state==="closed"&&i.launcherWidth&&i.launcherHeight?v(a,{width:i.launcherWidth,height:i.launcherHeight,hovered:!!i.launcherHovered}):v(a,{hidden:!0})),d&&(i.state==="closed"&&i.peek?x(d,{...i.peek,hovered:!!i.peekHovered}):x(d,{hidden:!0}))))},window.addEventListener("message",p),t.addEventListener("load",O),setTimeout(()=>{E||console.warn("[messenger] iframe did not boot after",1e4,"ms — check CSP frame-ancestors and network")},1e4)}function b(){p&&(window.removeEventListener("message",p),p=null),g&&window.visualViewport&&(window.visualViewport.removeEventListener("resize",g),window.visualViewport.removeEventListener("scroll",g),g=null),w=null,t&&(t.remove(),t=null),a&&(a.remove(),a=null),d&&(d.remove(),d=null),l=""}function S(e){!t||!l||!e||typeof e!="object"||t.contentWindow.postMessage({type:"UPDATE",payload:e},l)}function k(e){!t||!l||!e||typeof e!="object"||t.contentWindow.postMessage({type:"CONTEXT",payload:e},l)}function v(e,n){if(n.hidden){e.style.cssText="display:none";return}const c=n.width||50,r=n.height||50,h=Math.max(20,c-6),s=Math.max(20,r-6),o=8+(c-h)/2,f=8+(r-s)/2,m=n.hovered?"0 8px 22px rgba(0, 0, 0, 0.26)":"0 4px 14px rgba(0, 0, 0, 0.18)";e.style.cssText=["position:fixed","pointer-events:none",`bottom:${f}px`,`right:${o}px`,`width:${h}px`,`height:${s}px`,"border-radius:50%","background:transparent",`box-shadow:${m}`,"transition:box-shadow 100ms ease","z-index:2147483646"].join(";")}function x(e,n){if(n.hidden){e.style.cssText="display:none";return}const c=n.width||286,r=n.height||80,h=8+(n.rightOffset||0),s=8+(n.bottomOffset||0),o=n.hovered?"0 6px 18px rgba(0, 0, 0, 0.16)":"0 3px 10px rgba(0, 0, 0, 0.10)";e.style.cssText=["position:fixed","pointer-events:none",`bottom:${s}px`,`right:${h}px`,`width:${c}px`,`height:${r}px`,"border-radius:16px 16px 8px 16px","background:transparent",`box-shadow:${o}`,"transition:box-shadow 100ms ease, width 100ms ease, height 100ms ease, right 100ms ease, bottom 100ms ease","z-index:2147483646"].join(";")}function U(e){return e.endsWith("/")?e.slice(0,-1):e}function y(e,n,c,r){w={displayMode:n,state:c,dims:r};const h=["position:fixed","border:0","z-index:2147483647","color-scheme:normal","background:transparent"];let s;if(n==="embedded")s=["inset:0","width:100%","height:100%"];else if(c==="closed"){const o=r&&r.width>0?r.width:80,f=r&&r.height>0?r.height:80;s=["bottom:0","right:0",`width:${o}px`,`height:${f}px`]}else if(n==="sheet"){const o=T();o?s=[`top:${o.top}px`,"right:0","width:min(470px, 100vw)",`height:${o.height}px`]:s=["top:0","bottom:0","right:0","width:min(470px, 100vw)","height:100dvh"]}else{const o=T();s=[`bottom:${o?o.bottom:0}px`,"right:0","width:460px","height:720px","max-width:100vw",`max-height:${o?`${o.height}px`:"100vh"}`]}e.style.cssText=h.concat(s).join(";")}function T(){const e=window.visualViewport;if(!e)return null;const n=Math.max(0,Math.round(window.innerHeight-e.height-e.offsetTop));return n<80?null:{top:Math.round(e.offsetTop),height:Math.round(e.height),bottom:n}}const $="0.6.6",j={init:M,destroy:b,update:S,context:k,version:$};return u.context=k,u.default=j,u.destroy=b,u.init=M,u.update=S,u.version=$,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),u}({});
|