@paramms/chat-widget 1.0.32 → 1.0.33
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/core.js +27 -26
- package/dist/core.js.map +1 -1
- package/dist/e2e.js +109 -1485
- package/dist/e2e.js.map +1 -1
- package/dist/embed.js +4 -4
- package/dist/embed.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +18 -14
- package/dist/index.js.map +1 -1
- package/dist/outbox.js +1382 -0
- package/dist/outbox.js.map +1 -0
- package/dist/react.js +214 -207
- package/dist/react.js.map +1 -1
- package/package.json +4 -3
package/dist/react.js
CHANGED
|
@@ -1,205 +1,208 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as W, jsx as p, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { useState as D, useRef as M, useEffect as z } from "react";
|
|
3
3
|
import { mount as H } from "./index.js";
|
|
4
|
-
function
|
|
5
|
-
url:
|
|
6
|
-
apiUrl:
|
|
4
|
+
function P({
|
|
5
|
+
url: g,
|
|
6
|
+
apiUrl: l,
|
|
7
7
|
profileId: v,
|
|
8
|
-
token:
|
|
9
|
-
refreshToken:
|
|
10
|
-
userId:
|
|
8
|
+
token: d,
|
|
9
|
+
refreshToken: w,
|
|
10
|
+
userId: n,
|
|
11
11
|
userName: c,
|
|
12
|
-
userEmail:
|
|
13
|
-
userAvatar:
|
|
12
|
+
userEmail: s,
|
|
13
|
+
userAvatar: f,
|
|
14
14
|
contextTitle: x,
|
|
15
|
-
contextSubtitle:
|
|
16
|
-
contextStatus:
|
|
15
|
+
contextSubtitle: y,
|
|
16
|
+
contextStatus: R,
|
|
17
17
|
subjectId: t,
|
|
18
18
|
accent: b,
|
|
19
|
-
launcher:
|
|
20
|
-
position:
|
|
21
|
-
quickReplies:
|
|
22
|
-
height:
|
|
23
|
-
i18n:
|
|
24
|
-
translateLang:
|
|
19
|
+
launcher: h,
|
|
20
|
+
position: i,
|
|
21
|
+
quickReplies: u,
|
|
22
|
+
height: m = "100%",
|
|
23
|
+
i18n: a,
|
|
24
|
+
translateLang: C
|
|
25
25
|
}) {
|
|
26
|
-
const
|
|
27
|
-
return
|
|
28
|
-
var
|
|
29
|
-
if (
|
|
30
|
-
return (
|
|
31
|
-
el:
|
|
32
|
-
url:
|
|
33
|
-
...
|
|
26
|
+
const r = M(null), o = M(null);
|
|
27
|
+
return z(() => {
|
|
28
|
+
var e;
|
|
29
|
+
if (r.current)
|
|
30
|
+
return (e = o.current) == null || e.close(), o.current = H({
|
|
31
|
+
el: r.current,
|
|
32
|
+
url: g,
|
|
33
|
+
...l ? { apiUrl: l } : {},
|
|
34
34
|
profileId: v,
|
|
35
35
|
...t ? { subjectId: t } : {},
|
|
36
|
-
...
|
|
37
|
-
...
|
|
38
|
-
...
|
|
39
|
-
...
|
|
36
|
+
...d ? { token: d } : {},
|
|
37
|
+
...w ? { refreshToken: w } : {},
|
|
38
|
+
...n ? { userId: n } : {},
|
|
39
|
+
...n || c || s || f ? {
|
|
40
40
|
user: {
|
|
41
41
|
...c ? { name: c } : {},
|
|
42
|
-
...
|
|
43
|
-
...
|
|
42
|
+
...s ? { email: s } : {},
|
|
43
|
+
...f ? { avatar: f } : {}
|
|
44
44
|
}
|
|
45
45
|
} : {},
|
|
46
46
|
...x ? {
|
|
47
47
|
subject: {
|
|
48
48
|
title: x,
|
|
49
|
-
...
|
|
50
|
-
...
|
|
49
|
+
...y ? { subtitle: y } : {},
|
|
50
|
+
...R ? { status: R } : {}
|
|
51
51
|
}
|
|
52
52
|
} : {},
|
|
53
|
-
...
|
|
53
|
+
...u ? { quickReplies: u } : {},
|
|
54
54
|
...b ? { accent: b } : {},
|
|
55
|
-
...
|
|
56
|
-
...
|
|
57
|
-
...
|
|
55
|
+
...C ? { translateLang: C } : {},
|
|
56
|
+
...a ? { i18n: a } : {},
|
|
57
|
+
...h ? { launcher: h, position: i ?? "bottom-right" } : {}
|
|
58
58
|
}), () => {
|
|
59
|
-
var
|
|
60
|
-
(
|
|
59
|
+
var j;
|
|
60
|
+
(j = o.current) == null || j.close(), o.current = null;
|
|
61
61
|
};
|
|
62
|
-
}, [
|
|
62
|
+
}, [g, l, v, t, d, n, c, s, b, h, i, C]), /* @__PURE__ */ p(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
|
-
ref:
|
|
66
|
-
style:
|
|
65
|
+
ref: r,
|
|
66
|
+
style: h ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height: m, minHeight: m === "100%" ? "480px" : void 0 }
|
|
67
67
|
}
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const O = [
|
|
71
71
|
"Is this still available?",
|
|
72
72
|
"Can I schedule a viewing?",
|
|
73
73
|
"What is your best price?"
|
|
74
74
|
];
|
|
75
75
|
function G({
|
|
76
|
-
url:
|
|
77
|
-
apiUrl:
|
|
76
|
+
url: g,
|
|
77
|
+
apiUrl: l,
|
|
78
78
|
profileId: v,
|
|
79
|
-
token:
|
|
80
|
-
refreshToken:
|
|
81
|
-
listingId:
|
|
79
|
+
token: d,
|
|
80
|
+
refreshToken: w,
|
|
81
|
+
listingId: n,
|
|
82
82
|
listingTitle: c,
|
|
83
|
-
listingMeta:
|
|
84
|
-
listingPrice:
|
|
83
|
+
listingMeta: s,
|
|
84
|
+
listingPrice: f,
|
|
85
85
|
listingStatus: x,
|
|
86
|
-
userId:
|
|
87
|
-
userName:
|
|
86
|
+
userId: y,
|
|
87
|
+
userName: R,
|
|
88
88
|
userEmail: t,
|
|
89
89
|
userAvatar: b,
|
|
90
|
-
accent:
|
|
91
|
-
launcher:
|
|
92
|
-
position:
|
|
93
|
-
quickReplies:
|
|
94
|
-
height:
|
|
95
|
-
i18n:
|
|
96
|
-
translateLang:
|
|
90
|
+
accent: h,
|
|
91
|
+
launcher: i,
|
|
92
|
+
position: u,
|
|
93
|
+
quickReplies: m,
|
|
94
|
+
height: a = "100%",
|
|
95
|
+
i18n: C,
|
|
96
|
+
translateLang: r
|
|
97
97
|
}) {
|
|
98
|
-
const o =
|
|
99
|
-
return
|
|
98
|
+
const o = M(null), e = M(null);
|
|
99
|
+
return z(() => {
|
|
100
100
|
if (!o.current) return;
|
|
101
|
-
let
|
|
102
|
-
const
|
|
103
|
-
var
|
|
104
|
-
|
|
101
|
+
let j = !1;
|
|
102
|
+
const $ = setTimeout(() => {
|
|
103
|
+
var L;
|
|
104
|
+
j || !o.current || ((L = e.current) == null || L.close(), e.current = H({
|
|
105
105
|
el: o.current,
|
|
106
|
-
url:
|
|
107
|
-
...
|
|
106
|
+
url: g,
|
|
107
|
+
...l ? { apiUrl: l } : {},
|
|
108
108
|
profileId: v,
|
|
109
|
-
...
|
|
110
|
-
...
|
|
111
|
-
...
|
|
112
|
-
...
|
|
113
|
-
...
|
|
109
|
+
...n ? { subjectId: `listing_${n}` } : {},
|
|
110
|
+
...d ? { token: d } : {},
|
|
111
|
+
...w ? { refreshToken: w } : {},
|
|
112
|
+
...y ? { userId: y } : {},
|
|
113
|
+
...y || R || t || b ? {
|
|
114
114
|
user: {
|
|
115
|
-
...
|
|
115
|
+
...R ? { name: R } : {},
|
|
116
116
|
...t ? { email: t } : {},
|
|
117
117
|
...b ? { avatar: b } : {},
|
|
118
|
-
...
|
|
118
|
+
...n ? { meta: { listingId: n } } : {}
|
|
119
119
|
}
|
|
120
120
|
} : {},
|
|
121
121
|
...c ? {
|
|
122
122
|
subject: {
|
|
123
123
|
title: c,
|
|
124
|
-
...
|
|
125
|
-
...
|
|
124
|
+
...s ? { subtitle: s } : {},
|
|
125
|
+
...f ? { tags: [`$${f.toLocaleString()}`] } : {},
|
|
126
126
|
...x ? { status: x } : {}
|
|
127
127
|
}
|
|
128
128
|
} : {},
|
|
129
|
-
quickReplies:
|
|
130
|
-
...
|
|
131
|
-
...
|
|
132
|
-
...
|
|
133
|
-
...
|
|
129
|
+
quickReplies: m ?? O,
|
|
130
|
+
...h ? { accent: h } : {},
|
|
131
|
+
...r ? { translateLang: r } : {},
|
|
132
|
+
...C ? { i18n: C } : {},
|
|
133
|
+
...i ? { launcher: i, position: u ?? "bottom-right" } : {}
|
|
134
134
|
}));
|
|
135
135
|
}, 0);
|
|
136
136
|
return () => {
|
|
137
|
-
var
|
|
138
|
-
|
|
137
|
+
var L;
|
|
138
|
+
j = !0, clearTimeout($), (L = e.current) == null || L.close(), e.current = null;
|
|
139
139
|
};
|
|
140
|
-
}, [
|
|
140
|
+
}, [g, l, v, n, d, y, h, i, u, r]), /* @__PURE__ */ p(
|
|
141
141
|
"div",
|
|
142
142
|
{
|
|
143
143
|
ref: o,
|
|
144
|
-
style:
|
|
144
|
+
style: i ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height: a, minHeight: a === "100%" ? "480px" : void 0 }
|
|
145
145
|
}
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
url:
|
|
150
|
-
apiUrl:
|
|
148
|
+
function B({
|
|
149
|
+
url: g,
|
|
150
|
+
apiUrl: l,
|
|
151
151
|
profileId: v,
|
|
152
|
-
token:
|
|
153
|
-
refreshToken:
|
|
154
|
-
userId:
|
|
152
|
+
token: d,
|
|
153
|
+
refreshToken: w,
|
|
154
|
+
userId: n,
|
|
155
155
|
userName: c,
|
|
156
|
-
userEmail:
|
|
157
|
-
accent:
|
|
156
|
+
userEmail: s,
|
|
157
|
+
accent: f,
|
|
158
158
|
height: x = "100%",
|
|
159
|
-
i18n:
|
|
160
|
-
scope:
|
|
159
|
+
i18n: y,
|
|
160
|
+
scope: R = "tenant"
|
|
161
161
|
}) {
|
|
162
|
-
const [t, b] =
|
|
163
|
-
|
|
164
|
-
if (!
|
|
165
|
-
let
|
|
166
|
-
return import("./chatlist.js").then(({ mountChatList:
|
|
167
|
-
|
|
168
|
-
el:
|
|
169
|
-
url:
|
|
170
|
-
...
|
|
162
|
+
const [t, b] = D(null), h = M(null), i = M(null), u = M(null), m = M(null);
|
|
163
|
+
z(() => {
|
|
164
|
+
if (!h.current) return;
|
|
165
|
+
let r = !1;
|
|
166
|
+
return import("./chatlist.js").then(({ mountChatList: o }) => {
|
|
167
|
+
r || !h.current || (u.current = o({
|
|
168
|
+
el: h.current,
|
|
169
|
+
url: g,
|
|
170
|
+
...l ? { apiUrl: l } : {},
|
|
171
171
|
profileId: v,
|
|
172
|
-
scope:
|
|
173
|
-
onSelect: (
|
|
172
|
+
scope: R,
|
|
173
|
+
onSelect: (e) => b(e),
|
|
174
174
|
// Compose (✎) opens the chatroom's general support thread — without
|
|
175
175
|
// this a user with no conversations yet had an empty list and no way
|
|
176
176
|
// to ever start one, which is what made ChatApp feel broken.
|
|
177
177
|
onNewChat: () => b({ id: "__new__", state: "open", updatedAt: Date.now() }),
|
|
178
|
-
...
|
|
179
|
-
...
|
|
180
|
-
...
|
|
181
|
-
...
|
|
178
|
+
...d ? { token: d } : {},
|
|
179
|
+
...n ? { userId: n } : {},
|
|
180
|
+
...f ? { accent: f } : {},
|
|
181
|
+
...y ? { i18n: y } : {}
|
|
182
182
|
}));
|
|
183
183
|
}), () => {
|
|
184
|
-
var
|
|
185
|
-
|
|
184
|
+
var o;
|
|
185
|
+
r = !0, (o = u.current) == null || o.close(), u.current = null;
|
|
186
186
|
};
|
|
187
|
-
}, [
|
|
188
|
-
var
|
|
189
|
-
if (!
|
|
190
|
-
(
|
|
191
|
-
el:
|
|
192
|
-
url:
|
|
193
|
-
...
|
|
187
|
+
}, [g, l, v, d, n, R]), z(() => {
|
|
188
|
+
var o;
|
|
189
|
+
if (!i.current || !t) return;
|
|
190
|
+
(o = m.current) == null || o.close(), m.current = H({
|
|
191
|
+
el: i.current,
|
|
192
|
+
url: g,
|
|
193
|
+
...l ? { apiUrl: l } : {},
|
|
194
194
|
profileId: t.profileId ?? v,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
...
|
|
199
|
-
...
|
|
195
|
+
// DM rows open as direct conversations (kind + peer). Opening them via
|
|
196
|
+
// their dm:… subjectId only works for the participant that OWNS the
|
|
197
|
+
// thread key — the other side would silently fork a duplicate.
|
|
198
|
+
...t.kind === "direct" && t.peerId ? { kind: "direct", peerId: t.peerId } : t.subjectId ? { subjectId: t.subjectId } : {},
|
|
199
|
+
...d ? { token: d } : {},
|
|
200
|
+
...w ? { refreshToken: w } : {},
|
|
201
|
+
...n ? { userId: n } : {},
|
|
202
|
+
...n || c || s ? {
|
|
200
203
|
user: {
|
|
201
204
|
...c ? { name: c } : {},
|
|
202
|
-
...
|
|
205
|
+
...s ? { email: s } : {}
|
|
203
206
|
}
|
|
204
207
|
} : {},
|
|
205
208
|
...t.subjectTitle ? {
|
|
@@ -208,29 +211,33 @@ function A({
|
|
|
208
211
|
...t.subjectMeta ? { subtitle: t.subjectMeta } : {}
|
|
209
212
|
}
|
|
210
213
|
} : {},
|
|
211
|
-
...
|
|
214
|
+
...f ? { accent: f } : {}
|
|
212
215
|
});
|
|
213
|
-
const
|
|
214
|
-
var
|
|
215
|
-
return (
|
|
216
|
+
const r = setInterval(() => {
|
|
217
|
+
var e;
|
|
218
|
+
return (e = u.current) == null ? void 0 : e.refresh();
|
|
216
219
|
}, 2e4);
|
|
217
220
|
return () => {
|
|
218
|
-
var
|
|
219
|
-
clearInterval(
|
|
221
|
+
var e, j;
|
|
222
|
+
clearInterval(r), (e = m.current) == null || e.close(), m.current = null, (j = u.current) == null || j.refresh();
|
|
220
223
|
};
|
|
221
224
|
}, [t == null ? void 0 : t.id]);
|
|
222
|
-
const
|
|
223
|
-
return
|
|
225
|
+
const [a, C] = D(typeof window < "u" && window.innerWidth < 768);
|
|
226
|
+
return z(() => {
|
|
227
|
+
if (typeof window > "u" || !window.matchMedia) return;
|
|
228
|
+
const r = window.matchMedia("(max-width: 767px)"), o = (e) => C(e.matches);
|
|
229
|
+
return C(r.matches), r.addEventListener("change", o), () => r.removeEventListener("change", o);
|
|
230
|
+
}, []), /* @__PURE__ */ W("div", { style: { display: "flex", width: "100%", height: x, minHeight: "400px", overflow: "hidden" }, children: [
|
|
224
231
|
/* @__PURE__ */ p("div", { style: {
|
|
225
|
-
width:
|
|
226
|
-
flex:
|
|
227
|
-
display:
|
|
232
|
+
width: a ? "100%" : "360px",
|
|
233
|
+
flex: a && t ? "none" : void 0,
|
|
234
|
+
display: a && t ? "none" : "flex",
|
|
228
235
|
flexDirection: "column",
|
|
229
|
-
borderRight:
|
|
236
|
+
borderRight: a ? "none" : "1px solid #e8eaed",
|
|
230
237
|
minWidth: 0
|
|
231
|
-
}, children: /* @__PURE__ */ p("div", { ref:
|
|
232
|
-
t ? /* @__PURE__ */
|
|
233
|
-
|
|
238
|
+
}, children: /* @__PURE__ */ p("div", { ref: h, style: { width: "100%", height: "100%" } }) }),
|
|
239
|
+
t ? /* @__PURE__ */ W("div", { style: { flex: 1, display: "flex", flexDirection: "column", minWidth: 0, position: "relative" }, children: [
|
|
240
|
+
a && /* @__PURE__ */ p(
|
|
234
241
|
"button",
|
|
235
242
|
{
|
|
236
243
|
onClick: () => b(null),
|
|
@@ -238,68 +245,68 @@ function A({
|
|
|
238
245
|
children: "←"
|
|
239
246
|
}
|
|
240
247
|
),
|
|
241
|
-
/* @__PURE__ */ p("div", { ref:
|
|
242
|
-
] }) : /* @__PURE__ */ p("div", { style: { flex: 1, display:
|
|
248
|
+
/* @__PURE__ */ p("div", { ref: i, style: { width: "100%", height: "100%" } })
|
|
249
|
+
] }) : /* @__PURE__ */ p("div", { style: { flex: 1, display: a ? "none" : "flex", alignItems: "center", justifyContent: "center", color: "#9b9690", fontSize: 14 }, children: "Select a conversation" })
|
|
243
250
|
] });
|
|
244
251
|
}
|
|
245
252
|
function J({
|
|
246
|
-
url:
|
|
247
|
-
apiUrl:
|
|
253
|
+
url: g,
|
|
254
|
+
apiUrl: l,
|
|
248
255
|
profileId: v,
|
|
249
|
-
token:
|
|
250
|
-
refreshToken:
|
|
251
|
-
userId:
|
|
256
|
+
token: d,
|
|
257
|
+
refreshToken: w,
|
|
258
|
+
userId: n,
|
|
252
259
|
userName: c,
|
|
253
|
-
userEmail:
|
|
254
|
-
scope:
|
|
260
|
+
userEmail: s,
|
|
261
|
+
scope: f,
|
|
255
262
|
accent: x = "#4F63F5",
|
|
256
|
-
floating:
|
|
257
|
-
position:
|
|
263
|
+
floating: y = !0,
|
|
264
|
+
position: R = "bottom-right",
|
|
258
265
|
label: t,
|
|
259
266
|
panelWidth: b,
|
|
260
|
-
panelHeight:
|
|
267
|
+
panelHeight: h = "600px"
|
|
261
268
|
}) {
|
|
262
|
-
const [
|
|
263
|
-
if (
|
|
264
|
-
const S = (
|
|
265
|
-
|
|
269
|
+
const [i, u] = D(!1), m = M(null), a = R === "bottom-right", r = t ?? (y ? "💬" : "Messages");
|
|
270
|
+
if (z(() => {
|
|
271
|
+
const S = (F) => {
|
|
272
|
+
F.key === "Escape" && u(!1);
|
|
266
273
|
};
|
|
267
274
|
return document.addEventListener("keydown", S), () => document.removeEventListener("keydown", S);
|
|
268
|
-
}, []),
|
|
269
|
-
const S = typeof window < "u" && window.innerWidth < 480,
|
|
270
|
-
return /* @__PURE__ */
|
|
275
|
+
}, []), y) {
|
|
276
|
+
const S = typeof window < "u" && window.innerWidth < 480, F = S ? "100vw" : b ?? "420px", E = S ? "100dvh" : h;
|
|
277
|
+
return /* @__PURE__ */ W("div", { style: {
|
|
271
278
|
position: "fixed",
|
|
272
|
-
[
|
|
279
|
+
[a ? "right" : "left"]: "20px",
|
|
273
280
|
bottom: "20px",
|
|
274
281
|
zIndex: 9999,
|
|
275
282
|
display: "flex",
|
|
276
283
|
flexDirection: "column",
|
|
277
|
-
alignItems:
|
|
284
|
+
alignItems: a ? "flex-end" : "flex-start",
|
|
278
285
|
gap: "12px"
|
|
279
286
|
}, children: [
|
|
280
287
|
/* @__PURE__ */ p("div", { style: {
|
|
281
|
-
width:
|
|
282
|
-
height:
|
|
288
|
+
width: F,
|
|
289
|
+
height: E,
|
|
283
290
|
borderRadius: S ? "0" : "16px",
|
|
284
291
|
overflow: "hidden",
|
|
285
292
|
boxShadow: "0 8px 40px rgba(0,0,0,.18)",
|
|
286
293
|
background: "#fff",
|
|
287
|
-
display:
|
|
294
|
+
display: i ? "flex" : "none",
|
|
288
295
|
flexDirection: "column",
|
|
289
|
-
transformOrigin: `bottom ${
|
|
290
|
-
animation:
|
|
296
|
+
transformOrigin: `bottom ${a ? "right" : "left"}`,
|
|
297
|
+
animation: i ? "ocl-pop-in .18s ease" : "none"
|
|
291
298
|
}, children: /* @__PURE__ */ p(
|
|
292
|
-
|
|
299
|
+
B,
|
|
293
300
|
{
|
|
294
|
-
url:
|
|
295
|
-
...
|
|
301
|
+
url: g,
|
|
302
|
+
...l ? { apiUrl: l } : {},
|
|
296
303
|
profileId: v,
|
|
297
|
-
...
|
|
298
|
-
...
|
|
299
|
-
...
|
|
304
|
+
...d ? { token: d } : {},
|
|
305
|
+
...w ? { refreshToken: w } : {},
|
|
306
|
+
...n ? { userId: n } : {},
|
|
300
307
|
...c ? { userName: c } : {},
|
|
301
|
-
...
|
|
302
|
-
...
|
|
308
|
+
...s ? { userEmail: s } : {},
|
|
309
|
+
...f ? { scope: f } : {},
|
|
303
310
|
accent: x,
|
|
304
311
|
height: "100%"
|
|
305
312
|
}
|
|
@@ -307,8 +314,8 @@ function J({
|
|
|
307
314
|
/* @__PURE__ */ p(
|
|
308
315
|
"button",
|
|
309
316
|
{
|
|
310
|
-
ref:
|
|
311
|
-
onClick: () =>
|
|
317
|
+
ref: m,
|
|
318
|
+
onClick: () => u((_) => !_),
|
|
312
319
|
style: {
|
|
313
320
|
width: "56px",
|
|
314
321
|
height: "56px",
|
|
@@ -322,35 +329,35 @@ function J({
|
|
|
322
329
|
boxShadow: "0 4px 16px rgba(0,0,0,.25)",
|
|
323
330
|
transition: "transform .15s"
|
|
324
331
|
},
|
|
325
|
-
onMouseEnter: (
|
|
326
|
-
|
|
332
|
+
onMouseEnter: (_) => {
|
|
333
|
+
_.target.style.transform = "scale(1.08)";
|
|
327
334
|
},
|
|
328
|
-
onMouseLeave: (
|
|
329
|
-
|
|
335
|
+
onMouseLeave: (_) => {
|
|
336
|
+
_.target.style.transform = "scale(1)";
|
|
330
337
|
},
|
|
331
|
-
children:
|
|
338
|
+
children: i ? "✕" : r
|
|
332
339
|
}
|
|
333
340
|
),
|
|
334
341
|
/* @__PURE__ */ p("style", { children: "@keyframes ocl-pop-in { from { opacity:0; transform:scale(.95) } to { opacity:1; transform:scale(1) } }" })
|
|
335
342
|
] });
|
|
336
343
|
}
|
|
337
|
-
const o = b ?? "420px", [
|
|
338
|
-
!
|
|
339
|
-
},
|
|
340
|
-
return /* @__PURE__ */
|
|
341
|
-
/* @__PURE__ */
|
|
344
|
+
const o = b ?? "420px", [e, j] = D(null), $ = () => {
|
|
345
|
+
!i && m.current && j(m.current.getBoundingClientRect()), u((S) => !S);
|
|
346
|
+
}, L = e ? e.bottom + 8 : 0, A = e ? window.innerWidth - e.right : 0;
|
|
347
|
+
return /* @__PURE__ */ W(k, { children: [
|
|
348
|
+
/* @__PURE__ */ W(
|
|
342
349
|
"button",
|
|
343
350
|
{
|
|
344
|
-
ref:
|
|
345
|
-
onClick:
|
|
351
|
+
ref: m,
|
|
352
|
+
onClick: $,
|
|
346
353
|
style: {
|
|
347
354
|
display: "inline-flex",
|
|
348
355
|
alignItems: "center",
|
|
349
356
|
gap: "6px",
|
|
350
357
|
padding: "8px 16px",
|
|
351
358
|
borderRadius: "8px",
|
|
352
|
-
background:
|
|
353
|
-
color:
|
|
359
|
+
background: i ? x : "transparent",
|
|
360
|
+
color: i ? "#fff" : x,
|
|
354
361
|
border: `2px solid ${x}`,
|
|
355
362
|
fontSize: "14px",
|
|
356
363
|
fontWeight: 600,
|
|
@@ -359,24 +366,24 @@ function J({
|
|
|
359
366
|
},
|
|
360
367
|
children: [
|
|
361
368
|
"💬 ",
|
|
362
|
-
|
|
369
|
+
r
|
|
363
370
|
]
|
|
364
371
|
}
|
|
365
372
|
),
|
|
366
|
-
|
|
373
|
+
i && e && /* @__PURE__ */ W(k, { children: [
|
|
367
374
|
/* @__PURE__ */ p(
|
|
368
375
|
"div",
|
|
369
376
|
{
|
|
370
|
-
onClick: () =>
|
|
377
|
+
onClick: () => u(!1),
|
|
371
378
|
style: { position: "fixed", inset: 0, zIndex: 9998 }
|
|
372
379
|
}
|
|
373
380
|
),
|
|
374
381
|
/* @__PURE__ */ p("div", { style: {
|
|
375
382
|
position: "fixed",
|
|
376
|
-
top:
|
|
377
|
-
right:
|
|
383
|
+
top: L,
|
|
384
|
+
right: A,
|
|
378
385
|
width: o,
|
|
379
|
-
height:
|
|
386
|
+
height: h,
|
|
380
387
|
borderRadius: "16px",
|
|
381
388
|
overflow: "hidden",
|
|
382
389
|
boxShadow: "0 8px 40px rgba(0,0,0,.2)",
|
|
@@ -384,17 +391,17 @@ function J({
|
|
|
384
391
|
zIndex: 9999,
|
|
385
392
|
animation: "ocl-slide-in .18s ease"
|
|
386
393
|
}, children: /* @__PURE__ */ p(
|
|
387
|
-
|
|
394
|
+
B,
|
|
388
395
|
{
|
|
389
|
-
url:
|
|
390
|
-
...
|
|
396
|
+
url: g,
|
|
397
|
+
...l ? { apiUrl: l } : {},
|
|
391
398
|
profileId: v,
|
|
392
|
-
...
|
|
393
|
-
...
|
|
394
|
-
...
|
|
399
|
+
...d ? { token: d } : {},
|
|
400
|
+
...w ? { refreshToken: w } : {},
|
|
401
|
+
...n ? { userId: n } : {},
|
|
395
402
|
...c ? { userName: c } : {},
|
|
396
|
-
...
|
|
397
|
-
...
|
|
403
|
+
...s ? { userEmail: s } : {},
|
|
404
|
+
...f ? { scope: f } : {},
|
|
398
405
|
accent: x,
|
|
399
406
|
height: "100%"
|
|
400
407
|
}
|
|
@@ -404,9 +411,9 @@ function J({
|
|
|
404
411
|
] });
|
|
405
412
|
}
|
|
406
413
|
export {
|
|
407
|
-
|
|
414
|
+
B as ChatApp,
|
|
408
415
|
J as ChatAppLauncher,
|
|
409
|
-
|
|
416
|
+
P as ChatWidget,
|
|
410
417
|
G as MarketplaceChat
|
|
411
418
|
};
|
|
412
419
|
//# sourceMappingURL=react.js.map
|