@paramms/chat-widget 1.0.16 → 1.0.18
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/chatlist.d.ts +3 -0
- package/dist/chatlist.js +37 -37
- package/dist/chatlist.js.map +1 -1
- package/dist/history.d.ts +21 -2
- package/dist/index.d.ts +6 -1
- package/dist/index.js +771 -772
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +14 -5
- package/dist/react.js +196 -186
- package/dist/react.js.map +1 -1
- package/dist/uid.js +39 -33
- package/dist/uid.js.map +1 -1
- package/package.json +1 -1
package/dist/react.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { type MountOptions } from './index.js';
|
|
2
2
|
interface BaseProps {
|
|
3
|
-
/** Relay
|
|
3
|
+
/** Relay URL — set as NEXT_PUBLIC_RELAY_URL in .env. Any scheme works:
|
|
4
|
+
* `https://api.example.com` is fine. The WebSocket URL and REST base are
|
|
5
|
+
* derived automatically — you do NOT need to pass `wss://` or `/ws`. */
|
|
4
6
|
url: string;
|
|
7
|
+
/** HTTP(S) base for REST calls — only when the REST API is on a different
|
|
8
|
+
* origin than the socket. Normally omit. */
|
|
9
|
+
apiUrl?: string;
|
|
5
10
|
/** Your Relay profile ID — set as NEXT_PUBLIC_RELAY_PROFILE_ID in .env — required */
|
|
6
11
|
profileId: string;
|
|
7
12
|
/** Your logged-in user's stable ID. When omitted the widget automatically
|
|
@@ -64,7 +69,7 @@ export interface ChatWidgetProps extends BaseProps {
|
|
|
64
69
|
* />
|
|
65
70
|
* ```
|
|
66
71
|
*/
|
|
67
|
-
export declare function ChatWidget({ url, profileId, userId, userName, userEmail, userAvatar, contextTitle, contextSubtitle, contextStatus, subjectId, accent, launcher, position, quickReplies, height, i18n, translateLang, }: ChatWidgetProps): JSX.Element;
|
|
72
|
+
export declare function ChatWidget({ url, apiUrl, profileId, userId, userName, userEmail, userAvatar, contextTitle, contextSubtitle, contextStatus, subjectId, accent, launcher, position, quickReplies, height, i18n, translateLang, }: ChatWidgetProps): JSX.Element;
|
|
68
73
|
export interface MarketplaceChatProps extends BaseProps {
|
|
69
74
|
/** Unique ID for this listing — each listing gets its own thread.
|
|
70
75
|
* Omit for a general (non-item-specific) conversation. */
|
|
@@ -114,10 +119,12 @@ export interface MarketplaceChatProps extends BaseProps {
|
|
|
114
119
|
*
|
|
115
120
|
* Only `url` and `profileId` are required. All other props are optional.
|
|
116
121
|
*/
|
|
117
|
-
export declare function MarketplaceChat({ url, profileId, listingId, listingTitle, listingMeta, listingPrice, listingStatus, userId, userName, userEmail, userAvatar, accent, launcher, position, quickReplies, height, i18n, translateLang, }: MarketplaceChatProps): JSX.Element;
|
|
122
|
+
export declare function MarketplaceChat({ url, apiUrl, profileId, listingId, listingTitle, listingMeta, listingPrice, listingStatus, userId, userName, userEmail, userAvatar, accent, launcher, position, quickReplies, height, i18n, translateLang, }: MarketplaceChatProps): JSX.Element;
|
|
118
123
|
export interface ChatAppProps {
|
|
119
124
|
/** Relay WebSocket URL — required */
|
|
120
125
|
url: string;
|
|
126
|
+
/** HTTP(S) base for REST calls. Defaults to the WS origin. */
|
|
127
|
+
apiUrl?: string;
|
|
121
128
|
/** Your Relay profile ID — required */
|
|
122
129
|
profileId: string;
|
|
123
130
|
/** Your logged-in user's stable ID. Omit for anonymous (uses localStorage UID) */
|
|
@@ -160,10 +167,12 @@ export interface ChatAppProps {
|
|
|
160
167
|
* }
|
|
161
168
|
* ```
|
|
162
169
|
*/
|
|
163
|
-
export declare function ChatApp({ url, profileId, userId, userName, userEmail, accent, height, i18n, }: ChatAppProps): JSX.Element;
|
|
170
|
+
export declare function ChatApp({ url, apiUrl, profileId, userId, userName, userEmail, accent, height, i18n, }: ChatAppProps): JSX.Element;
|
|
164
171
|
export interface ChatAppLauncherProps {
|
|
165
172
|
/** Relay WebSocket URL — required */
|
|
166
173
|
url: string;
|
|
174
|
+
/** HTTP(S) base for REST calls. Defaults to the WS origin. */
|
|
175
|
+
apiUrl?: string;
|
|
167
176
|
/** Your Relay profile ID — required */
|
|
168
177
|
profileId: string;
|
|
169
178
|
/** Your logged-in user's stable ID */
|
|
@@ -215,5 +224,5 @@ export interface ChatAppLauncherProps {
|
|
|
215
224
|
* />
|
|
216
225
|
* ```
|
|
217
226
|
*/
|
|
218
|
-
export declare function ChatAppLauncher({ url, profileId, userId, userName, userEmail, accent, floating, position, label, panelWidth, panelHeight, }: ChatAppLauncherProps): JSX.Element;
|
|
227
|
+
export declare function ChatAppLauncher({ url, apiUrl, profileId, userId, userName, userEmail, accent, floating, position, label, panelWidth, panelHeight, }: ChatAppLauncherProps): JSX.Element;
|
|
219
228
|
export {};
|
package/dist/react.js
CHANGED
|
@@ -1,175 +1,182 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { mount as
|
|
4
|
-
function
|
|
5
|
-
url:
|
|
6
|
-
|
|
1
|
+
import { jsxs as j, jsx as u, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { useState as L, useRef as k, useEffect as W } from "react";
|
|
3
|
+
import { mount as D } from "./index.js";
|
|
4
|
+
function A({
|
|
5
|
+
url: b,
|
|
6
|
+
apiUrl: i,
|
|
7
|
+
profileId: a,
|
|
7
8
|
userId: e,
|
|
8
|
-
userName:
|
|
9
|
-
userEmail:
|
|
9
|
+
userName: l,
|
|
10
|
+
userEmail: c,
|
|
10
11
|
userAvatar: o,
|
|
11
|
-
contextTitle:
|
|
12
|
-
contextSubtitle:
|
|
12
|
+
contextTitle: m,
|
|
13
|
+
contextSubtitle: y,
|
|
13
14
|
contextStatus: t,
|
|
14
15
|
subjectId: p,
|
|
15
|
-
accent:
|
|
16
|
+
accent: s,
|
|
16
17
|
launcher: n,
|
|
17
|
-
position:
|
|
18
|
-
quickReplies:
|
|
19
|
-
height:
|
|
20
|
-
i18n:
|
|
21
|
-
translateLang:
|
|
18
|
+
position: d,
|
|
19
|
+
quickReplies: f,
|
|
20
|
+
height: h = "100%",
|
|
21
|
+
i18n: g,
|
|
22
|
+
translateLang: r
|
|
22
23
|
}) {
|
|
23
|
-
const
|
|
24
|
-
return
|
|
25
|
-
var
|
|
26
|
-
if (
|
|
27
|
-
return (
|
|
28
|
-
el:
|
|
29
|
-
url:
|
|
30
|
-
|
|
24
|
+
const w = k(null), x = k(null);
|
|
25
|
+
return W(() => {
|
|
26
|
+
var v;
|
|
27
|
+
if (w.current)
|
|
28
|
+
return (v = x.current) == null || v.close(), x.current = D({
|
|
29
|
+
el: w.current,
|
|
30
|
+
url: b,
|
|
31
|
+
...i ? { apiUrl: i } : {},
|
|
32
|
+
profileId: a,
|
|
31
33
|
...p ? { subjectId: p } : {},
|
|
32
34
|
...e ? { token: e } : {},
|
|
33
|
-
...e ||
|
|
35
|
+
...e || l || c || o ? {
|
|
34
36
|
user: {
|
|
35
|
-
...
|
|
36
|
-
...
|
|
37
|
+
...l ? { name: l } : {},
|
|
38
|
+
...c ? { email: c } : {},
|
|
37
39
|
...o ? { avatar: o } : {}
|
|
38
40
|
}
|
|
39
41
|
} : {},
|
|
40
|
-
...
|
|
42
|
+
...m ? {
|
|
41
43
|
subject: {
|
|
42
|
-
title:
|
|
43
|
-
...
|
|
44
|
+
title: m,
|
|
45
|
+
...y ? { subtitle: y } : {},
|
|
44
46
|
...t ? { status: t } : {}
|
|
45
47
|
}
|
|
46
48
|
} : {},
|
|
47
|
-
...
|
|
48
|
-
...
|
|
49
|
-
...
|
|
50
|
-
...
|
|
51
|
-
...n ? { launcher: n, position:
|
|
49
|
+
...f ? { quickReplies: f } : {},
|
|
50
|
+
...s ? { accent: s } : {},
|
|
51
|
+
...r ? { translateLang: r } : {},
|
|
52
|
+
...g ? { i18n: g } : {},
|
|
53
|
+
...n ? { launcher: n, position: d ?? "bottom-right" } : {}
|
|
52
54
|
}), () => {
|
|
53
|
-
var
|
|
54
|
-
(
|
|
55
|
+
var C;
|
|
56
|
+
(C = x.current) == null || C.close(), x.current = null;
|
|
55
57
|
};
|
|
56
|
-
}, [
|
|
58
|
+
}, [b, i, a, p, e, l, c, s, n, d, r]), /* @__PURE__ */ u(
|
|
57
59
|
"div",
|
|
58
60
|
{
|
|
59
|
-
ref:
|
|
60
|
-
style: n ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height:
|
|
61
|
+
ref: w,
|
|
62
|
+
style: n ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height: h, minHeight: h === "100%" ? "480px" : void 0 }
|
|
61
63
|
}
|
|
62
64
|
);
|
|
63
65
|
}
|
|
64
|
-
const
|
|
66
|
+
const T = [
|
|
65
67
|
"Is this still available?",
|
|
66
68
|
"Can I schedule a viewing?",
|
|
67
69
|
"What is your best price?"
|
|
68
70
|
];
|
|
69
|
-
function
|
|
70
|
-
url:
|
|
71
|
-
|
|
71
|
+
function K({
|
|
72
|
+
url: b,
|
|
73
|
+
apiUrl: i,
|
|
74
|
+
profileId: a,
|
|
72
75
|
listingId: e,
|
|
73
|
-
listingTitle:
|
|
74
|
-
listingMeta:
|
|
76
|
+
listingTitle: l,
|
|
77
|
+
listingMeta: c,
|
|
75
78
|
listingPrice: o,
|
|
76
|
-
listingStatus:
|
|
77
|
-
userId:
|
|
79
|
+
listingStatus: m,
|
|
80
|
+
userId: y,
|
|
78
81
|
userName: t,
|
|
79
82
|
userEmail: p,
|
|
80
|
-
userAvatar:
|
|
83
|
+
userAvatar: s,
|
|
81
84
|
accent: n,
|
|
82
|
-
launcher:
|
|
83
|
-
position:
|
|
84
|
-
quickReplies:
|
|
85
|
-
height:
|
|
86
|
-
i18n:
|
|
87
|
-
translateLang:
|
|
85
|
+
launcher: d,
|
|
86
|
+
position: f,
|
|
87
|
+
quickReplies: h,
|
|
88
|
+
height: g = "100%",
|
|
89
|
+
i18n: r,
|
|
90
|
+
translateLang: w
|
|
88
91
|
}) {
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
var
|
|
92
|
-
if (
|
|
93
|
-
return (
|
|
94
|
-
el:
|
|
95
|
-
url:
|
|
96
|
-
|
|
92
|
+
const x = k(null), v = k(null);
|
|
93
|
+
return W(() => {
|
|
94
|
+
var C;
|
|
95
|
+
if (x.current)
|
|
96
|
+
return (C = v.current) == null || C.close(), v.current = D({
|
|
97
|
+
el: x.current,
|
|
98
|
+
url: b,
|
|
99
|
+
...i ? { apiUrl: i } : {},
|
|
100
|
+
profileId: a,
|
|
97
101
|
...e ? { subjectId: `listing_${e}` } : {},
|
|
98
|
-
...
|
|
99
|
-
...
|
|
102
|
+
...y ? { token: y } : {},
|
|
103
|
+
...y || t || p || s ? {
|
|
100
104
|
user: {
|
|
101
105
|
...t ? { name: t } : {},
|
|
102
106
|
...p ? { email: p } : {},
|
|
103
|
-
...
|
|
107
|
+
...s ? { avatar: s } : {},
|
|
104
108
|
...e ? { meta: { listingId: e } } : {}
|
|
105
109
|
}
|
|
106
110
|
} : {},
|
|
107
|
-
...
|
|
111
|
+
...l ? {
|
|
108
112
|
subject: {
|
|
109
|
-
title:
|
|
110
|
-
...
|
|
113
|
+
title: l,
|
|
114
|
+
...c ? { subtitle: c } : {},
|
|
111
115
|
...o ? { tags: [`$${o.toLocaleString()}`] } : {},
|
|
112
|
-
...
|
|
116
|
+
...m ? { status: m } : {}
|
|
113
117
|
}
|
|
114
118
|
} : {},
|
|
115
|
-
quickReplies:
|
|
119
|
+
quickReplies: h ?? T,
|
|
116
120
|
...n ? { accent: n } : {},
|
|
117
|
-
...
|
|
118
|
-
...
|
|
119
|
-
...
|
|
121
|
+
...w ? { translateLang: w } : {},
|
|
122
|
+
...r ? { i18n: r } : {},
|
|
123
|
+
...d ? { launcher: d, position: f ?? "bottom-right" } : {}
|
|
120
124
|
}), () => {
|
|
121
|
-
var
|
|
122
|
-
(
|
|
125
|
+
var z;
|
|
126
|
+
(z = v.current) == null || z.close(), v.current = null;
|
|
123
127
|
};
|
|
124
|
-
}, [
|
|
128
|
+
}, [b, i, a, e, y, t, p, n, d, f, w]), /* @__PURE__ */ u(
|
|
125
129
|
"div",
|
|
126
130
|
{
|
|
127
|
-
ref:
|
|
128
|
-
style:
|
|
131
|
+
ref: x,
|
|
132
|
+
style: d ? { width: 0, height: 0, overflow: "hidden" } : { width: "100%", height: g, minHeight: g === "100%" ? "480px" : void 0 }
|
|
129
133
|
}
|
|
130
134
|
);
|
|
131
135
|
}
|
|
132
|
-
function
|
|
133
|
-
url:
|
|
134
|
-
|
|
136
|
+
function F({
|
|
137
|
+
url: b,
|
|
138
|
+
apiUrl: i,
|
|
139
|
+
profileId: a,
|
|
135
140
|
userId: e,
|
|
136
|
-
userName:
|
|
137
|
-
userEmail:
|
|
141
|
+
userName: l,
|
|
142
|
+
userEmail: c,
|
|
138
143
|
accent: o,
|
|
139
|
-
height:
|
|
140
|
-
i18n:
|
|
144
|
+
height: m = "100%",
|
|
145
|
+
i18n: y
|
|
141
146
|
}) {
|
|
142
|
-
const [t, p] =
|
|
143
|
-
|
|
144
|
-
if (!
|
|
145
|
-
let
|
|
146
|
-
return import("./chatlist.js").then(({ mountChatList:
|
|
147
|
-
|
|
148
|
-
el:
|
|
149
|
-
url:
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
const [t, p] = L(null), s = k(null), n = k(null), d = k(null), f = k(null);
|
|
148
|
+
W(() => {
|
|
149
|
+
if (!s.current) return;
|
|
150
|
+
let g = !1;
|
|
151
|
+
return import("./chatlist.js").then(({ mountChatList: r }) => {
|
|
152
|
+
g || !s.current || (d.current = r({
|
|
153
|
+
el: s.current,
|
|
154
|
+
url: b,
|
|
155
|
+
...i ? { apiUrl: i } : {},
|
|
156
|
+
profileId: a,
|
|
157
|
+
onSelect: (w) => p(w),
|
|
152
158
|
...e ? { userId: e } : {},
|
|
153
159
|
...o ? { accent: o } : {},
|
|
154
|
-
...
|
|
160
|
+
...y ? { i18n: y } : {}
|
|
155
161
|
}));
|
|
156
162
|
}), () => {
|
|
157
|
-
var
|
|
158
|
-
|
|
163
|
+
var r;
|
|
164
|
+
g = !0, (r = d.current) == null || r.close(), d.current = null;
|
|
159
165
|
};
|
|
160
|
-
}, [
|
|
161
|
-
var
|
|
166
|
+
}, [b, a, e]), W(() => {
|
|
167
|
+
var g;
|
|
162
168
|
if (!(!n.current || !t))
|
|
163
|
-
return (
|
|
169
|
+
return (g = f.current) == null || g.close(), f.current = D({
|
|
164
170
|
el: n.current,
|
|
165
|
-
url:
|
|
166
|
-
|
|
171
|
+
url: b,
|
|
172
|
+
...i ? { apiUrl: i } : {},
|
|
173
|
+
profileId: a,
|
|
167
174
|
...t.subjectId ? { subjectId: t.subjectId } : {},
|
|
168
175
|
...e ? { token: e } : {},
|
|
169
|
-
...e ||
|
|
176
|
+
...e || l || c ? {
|
|
170
177
|
user: {
|
|
171
|
-
...
|
|
172
|
-
...
|
|
178
|
+
...l ? { name: l } : {},
|
|
179
|
+
...c ? { email: c } : {}
|
|
173
180
|
}
|
|
174
181
|
} : {},
|
|
175
182
|
...t.subjectTitle ? {
|
|
@@ -180,22 +187,22 @@ function $({
|
|
|
180
187
|
} : {},
|
|
181
188
|
...o ? { accent: o } : {}
|
|
182
189
|
}), () => {
|
|
183
|
-
var
|
|
184
|
-
(
|
|
190
|
+
var r;
|
|
191
|
+
(r = f.current) == null || r.close(), f.current = null;
|
|
185
192
|
};
|
|
186
193
|
}, [t == null ? void 0 : t.id]);
|
|
187
|
-
const
|
|
188
|
-
return /* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
width:
|
|
191
|
-
flex:
|
|
192
|
-
display:
|
|
194
|
+
const h = typeof window < "u" && window.innerWidth < 768;
|
|
195
|
+
return /* @__PURE__ */ j("div", { style: { display: "flex", width: "100%", height: m, minHeight: "400px", overflow: "hidden" }, children: [
|
|
196
|
+
/* @__PURE__ */ u("div", { style: {
|
|
197
|
+
width: h ? "100%" : "360px",
|
|
198
|
+
flex: h && t ? "none" : void 0,
|
|
199
|
+
display: h && t ? "none" : "flex",
|
|
193
200
|
flexDirection: "column",
|
|
194
|
-
borderRight:
|
|
201
|
+
borderRight: h ? "none" : "1px solid #e8eaed",
|
|
195
202
|
minWidth: 0
|
|
196
|
-
}, children: /* @__PURE__ */
|
|
197
|
-
t ? /* @__PURE__ */
|
|
198
|
-
|
|
203
|
+
}, children: /* @__PURE__ */ u("div", { ref: s, style: { width: "100%", height: "100%" } }) }),
|
|
204
|
+
t ? /* @__PURE__ */ j("div", { style: { flex: 1, display: "flex", flexDirection: "column", minWidth: 0, position: "relative" }, children: [
|
|
205
|
+
h && /* @__PURE__ */ u(
|
|
199
206
|
"button",
|
|
200
207
|
{
|
|
201
208
|
onClick: () => p(null),
|
|
@@ -203,69 +210,71 @@ function $({
|
|
|
203
210
|
children: "←"
|
|
204
211
|
}
|
|
205
212
|
),
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
] }) : /* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ u("div", { ref: n, style: { width: "100%", height: "100%" } })
|
|
214
|
+
] }) : /* @__PURE__ */ u("div", { style: { flex: 1, display: h ? "none" : "flex", alignItems: "center", justifyContent: "center", color: "#9b9690", fontSize: 14 }, children: "Select a conversation" })
|
|
208
215
|
] });
|
|
209
216
|
}
|
|
210
|
-
function
|
|
211
|
-
url:
|
|
212
|
-
|
|
217
|
+
function P({
|
|
218
|
+
url: b,
|
|
219
|
+
apiUrl: i,
|
|
220
|
+
profileId: a,
|
|
213
221
|
userId: e,
|
|
214
|
-
userName:
|
|
215
|
-
userEmail:
|
|
222
|
+
userName: l,
|
|
223
|
+
userEmail: c,
|
|
216
224
|
accent: o = "#4F63F5",
|
|
217
|
-
floating:
|
|
218
|
-
position:
|
|
225
|
+
floating: m = !0,
|
|
226
|
+
position: y = "bottom-right",
|
|
219
227
|
label: t,
|
|
220
228
|
panelWidth: p,
|
|
221
|
-
panelHeight:
|
|
229
|
+
panelHeight: s = "600px"
|
|
222
230
|
}) {
|
|
223
|
-
const [n,
|
|
224
|
-
if (
|
|
225
|
-
const
|
|
226
|
-
|
|
231
|
+
const [n, d] = L(!1), f = k(null), h = y === "bottom-right", r = t ?? (m ? "💬" : "Messages");
|
|
232
|
+
if (W(() => {
|
|
233
|
+
const R = (M) => {
|
|
234
|
+
M.key === "Escape" && d(!1);
|
|
227
235
|
};
|
|
228
|
-
return document.addEventListener("keydown",
|
|
229
|
-
}, []),
|
|
230
|
-
const
|
|
231
|
-
return /* @__PURE__ */
|
|
236
|
+
return document.addEventListener("keydown", R), () => document.removeEventListener("keydown", R);
|
|
237
|
+
}, []), m) {
|
|
238
|
+
const R = typeof window < "u" && window.innerWidth < 480, M = R ? "100vw" : p ?? "420px", B = R ? "100dvh" : s;
|
|
239
|
+
return /* @__PURE__ */ j("div", { style: {
|
|
232
240
|
position: "fixed",
|
|
233
|
-
[
|
|
241
|
+
[h ? "right" : "left"]: "20px",
|
|
234
242
|
bottom: "20px",
|
|
235
243
|
zIndex: 9999,
|
|
236
244
|
display: "flex",
|
|
237
245
|
flexDirection: "column",
|
|
238
|
-
alignItems:
|
|
246
|
+
alignItems: h ? "flex-end" : "flex-start",
|
|
239
247
|
gap: "12px"
|
|
240
248
|
}, children: [
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
width:
|
|
243
|
-
height:
|
|
244
|
-
borderRadius:
|
|
249
|
+
/* @__PURE__ */ u("div", { style: {
|
|
250
|
+
width: M,
|
|
251
|
+
height: B,
|
|
252
|
+
borderRadius: R ? "0" : "16px",
|
|
245
253
|
overflow: "hidden",
|
|
246
254
|
boxShadow: "0 8px 40px rgba(0,0,0,.18)",
|
|
247
255
|
background: "#fff",
|
|
248
256
|
display: n ? "flex" : "none",
|
|
249
257
|
flexDirection: "column",
|
|
250
|
-
transformOrigin: `bottom ${
|
|
258
|
+
transformOrigin: `bottom ${h ? "right" : "left"}`,
|
|
251
259
|
animation: n ? "ocl-pop-in .18s ease" : "none"
|
|
252
|
-
}, children: /* @__PURE__ */
|
|
253
|
-
|
|
260
|
+
}, children: /* @__PURE__ */ u(
|
|
261
|
+
F,
|
|
254
262
|
{
|
|
255
|
-
url:
|
|
256
|
-
|
|
263
|
+
url: b,
|
|
264
|
+
...i ? { apiUrl: i } : {},
|
|
265
|
+
profileId: a,
|
|
257
266
|
...e ? { userId: e } : {},
|
|
258
|
-
...
|
|
259
|
-
...
|
|
267
|
+
...l ? { userName: l } : {},
|
|
268
|
+
...c ? { userEmail: c } : {},
|
|
260
269
|
accent: o,
|
|
261
270
|
height: "100%"
|
|
262
271
|
}
|
|
263
272
|
) }),
|
|
264
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ u(
|
|
265
274
|
"button",
|
|
266
275
|
{
|
|
267
|
-
ref:
|
|
268
|
-
onClick: () =>
|
|
276
|
+
ref: f,
|
|
277
|
+
onClick: () => d((S) => !S),
|
|
269
278
|
style: {
|
|
270
279
|
width: "56px",
|
|
271
280
|
height: "56px",
|
|
@@ -279,27 +288,27 @@ function K({
|
|
|
279
288
|
boxShadow: "0 4px 16px rgba(0,0,0,.25)",
|
|
280
289
|
transition: "transform .15s"
|
|
281
290
|
},
|
|
282
|
-
onMouseEnter: (
|
|
283
|
-
|
|
291
|
+
onMouseEnter: (S) => {
|
|
292
|
+
S.target.style.transform = "scale(1.08)";
|
|
284
293
|
},
|
|
285
|
-
onMouseLeave: (
|
|
286
|
-
|
|
294
|
+
onMouseLeave: (S) => {
|
|
295
|
+
S.target.style.transform = "scale(1)";
|
|
287
296
|
},
|
|
288
|
-
children: n ? "✕" :
|
|
297
|
+
children: n ? "✕" : r
|
|
289
298
|
}
|
|
290
299
|
),
|
|
291
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ u("style", { children: "@keyframes ocl-pop-in { from { opacity:0; transform:scale(.95) } to { opacity:1; transform:scale(1) } }" })
|
|
292
301
|
] });
|
|
293
302
|
}
|
|
294
|
-
const
|
|
295
|
-
!n &&
|
|
296
|
-
},
|
|
297
|
-
return /* @__PURE__ */
|
|
298
|
-
/* @__PURE__ */
|
|
303
|
+
const w = p ?? "420px", [x, v] = L(null), C = () => {
|
|
304
|
+
!n && f.current && v(f.current.getBoundingClientRect()), d((R) => !R);
|
|
305
|
+
}, z = x ? x.bottom + 8 : 0, H = x ? window.innerWidth - x.right : 0;
|
|
306
|
+
return /* @__PURE__ */ j($, { children: [
|
|
307
|
+
/* @__PURE__ */ j(
|
|
299
308
|
"button",
|
|
300
309
|
{
|
|
301
|
-
ref:
|
|
302
|
-
onClick:
|
|
310
|
+
ref: f,
|
|
311
|
+
onClick: C,
|
|
303
312
|
style: {
|
|
304
313
|
display: "inline-flex",
|
|
305
314
|
alignItems: "center",
|
|
@@ -316,50 +325,51 @@ function K({
|
|
|
316
325
|
},
|
|
317
326
|
children: [
|
|
318
327
|
"💬 ",
|
|
319
|
-
|
|
328
|
+
r
|
|
320
329
|
]
|
|
321
330
|
}
|
|
322
331
|
),
|
|
323
|
-
n &&
|
|
324
|
-
/* @__PURE__ */
|
|
332
|
+
n && x && /* @__PURE__ */ j($, { children: [
|
|
333
|
+
/* @__PURE__ */ u(
|
|
325
334
|
"div",
|
|
326
335
|
{
|
|
327
|
-
onClick: () =>
|
|
336
|
+
onClick: () => d(!1),
|
|
328
337
|
style: { position: "fixed", inset: 0, zIndex: 9998 }
|
|
329
338
|
}
|
|
330
339
|
),
|
|
331
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ u("div", { style: {
|
|
332
341
|
position: "fixed",
|
|
333
|
-
top:
|
|
334
|
-
right:
|
|
335
|
-
width:
|
|
336
|
-
height:
|
|
342
|
+
top: z,
|
|
343
|
+
right: H,
|
|
344
|
+
width: w,
|
|
345
|
+
height: s,
|
|
337
346
|
borderRadius: "16px",
|
|
338
347
|
overflow: "hidden",
|
|
339
348
|
boxShadow: "0 8px 40px rgba(0,0,0,.2)",
|
|
340
349
|
background: "#fff",
|
|
341
350
|
zIndex: 9999,
|
|
342
351
|
animation: "ocl-slide-in .18s ease"
|
|
343
|
-
}, children: /* @__PURE__ */
|
|
344
|
-
|
|
352
|
+
}, children: /* @__PURE__ */ u(
|
|
353
|
+
F,
|
|
345
354
|
{
|
|
346
|
-
url:
|
|
347
|
-
|
|
355
|
+
url: b,
|
|
356
|
+
...i ? { apiUrl: i } : {},
|
|
357
|
+
profileId: a,
|
|
348
358
|
...e ? { userId: e } : {},
|
|
349
|
-
...
|
|
350
|
-
...
|
|
359
|
+
...l ? { userName: l } : {},
|
|
360
|
+
...c ? { userEmail: c } : {},
|
|
351
361
|
accent: o,
|
|
352
362
|
height: "100%"
|
|
353
363
|
}
|
|
354
364
|
) }),
|
|
355
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ u("style", { children: "@keyframes ocl-slide-in { from { opacity:0; transform:translateY(-8px) } to { opacity:1; transform:translateY(0) } }" })
|
|
356
366
|
] })
|
|
357
367
|
] });
|
|
358
368
|
}
|
|
359
369
|
export {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
370
|
+
F as ChatApp,
|
|
371
|
+
P as ChatAppLauncher,
|
|
372
|
+
A as ChatWidget,
|
|
373
|
+
K as MarketplaceChat
|
|
364
374
|
};
|
|
365
375
|
//# sourceMappingURL=react.js.map
|