@paramms/chat-widget 1.0.35 → 1.0.36

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