ordify-chat-widget 1.0.45 → 1.0.46

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.
Files changed (53) hide show
  1. package/dist/components/AttachmentChips.d.ts +10 -0
  2. package/dist/components/AttachmentChips.d.ts.map +1 -0
  3. package/dist/components/AttachmentPicker.d.ts +16 -0
  4. package/dist/components/AttachmentPicker.d.ts.map +1 -0
  5. package/dist/components/ChatHeader.d.ts +13 -0
  6. package/dist/components/ChatHeader.d.ts.map +1 -0
  7. package/dist/components/Conversation.d.ts +22 -0
  8. package/dist/components/Conversation.d.ts.map +1 -0
  9. package/dist/components/EmbeddedChat.d.ts +9 -0
  10. package/dist/components/EmbeddedChat.d.ts.map +1 -0
  11. package/dist/components/FloatingChat.d.ts +9 -0
  12. package/dist/components/FloatingChat.d.ts.map +1 -0
  13. package/dist/components/Icons.d.ts +10 -0
  14. package/dist/components/Icons.d.ts.map +1 -0
  15. package/dist/components/InlineChat.d.ts +9 -0
  16. package/dist/components/InlineChat.d.ts.map +1 -0
  17. package/dist/components/MarkdownRenderer.d.ts +7 -0
  18. package/dist/components/MarkdownRenderer.d.ts.map +1 -0
  19. package/dist/components/OrdifyChat.d.ts +4 -0
  20. package/dist/components/OrdifyChat.d.ts.map +1 -0
  21. package/dist/components/ProfessionalInput.d.ts +15 -0
  22. package/dist/components/ProfessionalInput.d.ts.map +1 -0
  23. package/dist/components/ResizeHandle.d.ts +8 -0
  24. package/dist/components/ResizeHandle.d.ts.map +1 -0
  25. package/dist/components/SendIcon.d.ts +4 -0
  26. package/dist/components/SendIcon.d.ts.map +1 -0
  27. package/dist/components/WelcomeScreen.d.ts +11 -0
  28. package/dist/components/WelcomeScreen.d.ts.map +1 -0
  29. package/dist/components/styled/ChatComponents.d.ts +45 -0
  30. package/dist/components/styled/ChatComponents.d.ts.map +1 -0
  31. package/dist/hooks/useOrdifyChat.d.ts +4 -0
  32. package/dist/hooks/useOrdifyChat.d.ts.map +1 -0
  33. package/dist/hooks/useOrdifyConfig.d.ts +36 -0
  34. package/dist/hooks/useOrdifyConfig.d.ts.map +1 -0
  35. package/dist/hooks/useWidgetAttachmentStaging.d.ts +16 -0
  36. package/dist/hooks/useWidgetAttachmentStaging.d.ts.map +1 -0
  37. package/dist/index.cjs.js +1182 -0
  38. package/dist/index.d.ts +12 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.esm.js +4482 -0
  41. package/dist/ordify-chat-widget.standalone.js +346 -67
  42. package/dist/ordify-chat-widget.standalone.js.map +1 -1
  43. package/dist/standalone.d.ts +12 -0
  44. package/dist/standalone.d.ts.map +1 -0
  45. package/dist/types/index.d.ts +150 -0
  46. package/dist/types/index.d.ts.map +1 -0
  47. package/dist/utils/api.d.ts +26 -0
  48. package/dist/utils/api.d.ts.map +1 -0
  49. package/dist/utils/attachments.d.ts +6 -0
  50. package/dist/utils/attachments.d.ts.map +1 -0
  51. package/dist/utils/index.d.ts +5 -0
  52. package/dist/utils/index.d.ts.map +1 -0
  53. package/package.json +2 -1
@@ -0,0 +1,4482 @@
1
+ var An = Object.defineProperty;
2
+ var Tn = (e, t, r) => t in e ? An(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var gt = (e, t, r) => Tn(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import * as Ot from "react";
5
+ import F, { useState as J, useRef as ae, useEffect as De, useCallback as Z, useMemo as Bt, forwardRef as Lr, createElement as Ze, useContext as Fr, useImperativeHandle as En, useLayoutEffect as Mn, createContext as _n } from "react";
6
+ var Kr = { exports: {} }, nt = {};
7
+ /**
8
+ * @license React
9
+ * react-jsx-runtime.production.min.js
10
+ *
11
+ * Copyright (c) Facebook, Inc. and its affiliates.
12
+ *
13
+ * This source code is licensed under the MIT license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
16
+ var Rn = F, zn = Symbol.for("react.element"), Dn = Symbol.for("react.fragment"), Nn = Object.prototype.hasOwnProperty, On = Rn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Bn = { key: !0, ref: !0, __self: !0, __source: !0 };
17
+ function Wr(e, t, r) {
18
+ var n, a = {}, c = null, u = null;
19
+ r !== void 0 && (c = "" + r), t.key !== void 0 && (c = "" + t.key), t.ref !== void 0 && (u = t.ref);
20
+ for (n in t) Nn.call(t, n) && !Bn.hasOwnProperty(n) && (a[n] = t[n]);
21
+ if (e && e.defaultProps) for (n in t = e.defaultProps, t) a[n] === void 0 && (a[n] = t[n]);
22
+ return { $$typeof: zn, type: e, key: c, ref: u, props: a, _owner: On.current };
23
+ }
24
+ nt.Fragment = Dn;
25
+ nt.jsx = Wr;
26
+ nt.jsxs = Wr;
27
+ Kr.exports = nt;
28
+ var l = Kr.exports;
29
+ function We() {
30
+ return Math.random().toString(36).substr(2, 9);
31
+ }
32
+ function si(e) {
33
+ return new Intl.DateTimeFormat("en-US", {
34
+ hour: "2-digit",
35
+ minute: "2-digit",
36
+ hour12: !0
37
+ }).format(e);
38
+ }
39
+ function ii(e, t) {
40
+ let r;
41
+ return (...n) => {
42
+ clearTimeout(r), r = setTimeout(() => e(...n), t);
43
+ };
44
+ }
45
+ function ci(e, t) {
46
+ let r;
47
+ return (...n) => {
48
+ r || (e(...n), r = !0, setTimeout(() => r = !1, t));
49
+ };
50
+ }
51
+ function Pn(e) {
52
+ return {
53
+ id: e.id,
54
+ name: e.name,
55
+ url: e.url,
56
+ content_type: e.content_type,
57
+ type: e.type,
58
+ size: e.size ?? null,
59
+ preview: null,
60
+ oauth_token: null
61
+ };
62
+ }
63
+ class Ln {
64
+ constructor(t) {
65
+ gt(this, "config");
66
+ gt(this, "warnedLegacyApiKey", !1);
67
+ if (this.config = t, !this.config.publishableKey && !this.config.apiKey)
68
+ throw new Error("Either publishableKey or apiKey is required.");
69
+ this.config.publishableKey && this.config.apiKey && console.warn("[Ordify] Both publishableKey and apiKey provided. publishableKey will be used.");
70
+ }
71
+ usePublishableKey() {
72
+ return !!this.config.publishableKey;
73
+ }
74
+ maybeWarnLegacyApiKey() {
75
+ this.usePublishableKey() || this.warnedLegacyApiKey || (this.warnedLegacyApiKey = !0, console.warn(
76
+ "[Ordify] Using legacy apiKey in browser. For production embeds, use publishableKey from user settings."
77
+ ));
78
+ }
79
+ getAuthHeaders(t = !1) {
80
+ return this.usePublishableKey() ? {
81
+ ...t ? { "Content-Type": "application/json" } : {},
82
+ "x-ordify-publishable-key": this.config.publishableKey,
83
+ accept: "application/json"
84
+ } : (this.maybeWarnLegacyApiKey(), {
85
+ ...t ? { "Content-Type": "application/json" } : {},
86
+ "api-key": this.config.apiKey,
87
+ accept: "application/json"
88
+ });
89
+ }
90
+ async sendMessage(t, r, n, a) {
91
+ const c = this.usePublishableKey() ? `/widget/chat/${this.config.agentId}` : `/chat/agents/${this.config.agentId}`, u = `${this.config.apiBaseUrl}${c}`, d = a != null && a.length ? a.map(Pn) : void 0, h = {
92
+ message: t,
93
+ sessionId: r,
94
+ context: n
95
+ };
96
+ d != null && d.length && (h.attachments = d, h.use_document_understanding = d.some(
97
+ (b) => b.type === "document" || !b.type && !String(b.content_type || "").startsWith("image/")
98
+ ));
99
+ const g = await fetch(u, {
100
+ method: "POST",
101
+ headers: this.getAuthHeaders(!0),
102
+ body: JSON.stringify(h)
103
+ });
104
+ if (!g.ok) {
105
+ const b = await g.json();
106
+ throw new Error(`API Error: ${b.detail}`);
107
+ }
108
+ if (!g.body)
109
+ throw new Error("No response body");
110
+ return g.body;
111
+ }
112
+ /**
113
+ * Upload a file for widget chat. Requires publishableKey (browser-safe auth).
114
+ */
115
+ async uploadAttachment(t) {
116
+ if (!this.usePublishableKey())
117
+ throw new Error("[Ordify] uploadAttachment requires publishableKey.");
118
+ const r = `${this.config.apiBaseUrl}/widget/attachments`, n = new FormData();
119
+ n.append("file", t);
120
+ const a = await fetch(r, {
121
+ method: "POST",
122
+ headers: this.getAuthHeaders(!1),
123
+ body: n
124
+ });
125
+ if (!a.ok) {
126
+ let u = `HTTP ${a.status}`;
127
+ try {
128
+ u = (await a.json()).detail || u;
129
+ } catch {
130
+ }
131
+ throw new Error(`API Error: ${u}`);
132
+ }
133
+ const c = await a.json();
134
+ if (!(c != null && c.url) || !(c != null && c.content_type) || !(c != null && c.name))
135
+ throw new Error("Invalid attachment response from server");
136
+ return {
137
+ id: c.id,
138
+ name: c.name,
139
+ type: c.type === "image" ? "image" : "document",
140
+ url: c.url,
141
+ content_type: c.content_type,
142
+ size: c.size,
143
+ preview: c.preview
144
+ };
145
+ }
146
+ async createSession() {
147
+ const t = this.usePublishableKey() ? "/widget/sessions" : "/sessions", r = `${this.config.apiBaseUrl}${t}`, n = await fetch(r, {
148
+ method: "POST",
149
+ headers: this.getAuthHeaders(!0),
150
+ body: JSON.stringify({
151
+ name: "Chat Session",
152
+ agentConfig: {
153
+ type: "chat",
154
+ settings: null
155
+ }
156
+ })
157
+ });
158
+ if (!n.ok) {
159
+ const a = await n.json();
160
+ throw new Error(`API Error: ${a.detail}`);
161
+ }
162
+ return n.json();
163
+ }
164
+ async getSessionWithMessages(t) {
165
+ const r = this.usePublishableKey() ? `/widget/sessions/${t}/with-messages` : `/sessions/${t}/with-messages`, n = `${this.config.apiBaseUrl}${r}`, a = await fetch(n, {
166
+ method: "GET",
167
+ headers: this.getAuthHeaders()
168
+ });
169
+ if (!a.ok) {
170
+ const c = await a.json();
171
+ throw new Error(`API Error: ${c.detail}`);
172
+ }
173
+ return a.json();
174
+ }
175
+ /** @deprecated Use the Ordify dashboard to list agents. Will be removed in a future major version. */
176
+ async getAgents() {
177
+ if (!this.config.apiKey)
178
+ throw new Error("[Ordify] getAgents() requires apiKey and is not supported with publishableKey.");
179
+ const t = `${this.config.apiBaseUrl}/chat/agents`, r = await fetch(t, {
180
+ method: "GET",
181
+ headers: { "api-key": this.config.apiKey, accept: "application/json" }
182
+ });
183
+ if (!r.ok) {
184
+ const a = await r.json();
185
+ throw new Error(`API Error: ${a.detail}`);
186
+ }
187
+ return (await r.json()).agents || [];
188
+ }
189
+ /** @deprecated Use sessionId prop to load sessions. Will be removed in a future major version. */
190
+ async getSessions() {
191
+ if (!this.config.apiKey)
192
+ throw new Error("[Ordify] getSessions() requires apiKey and is not supported with publishableKey.");
193
+ const t = `${this.config.apiBaseUrl}/sessions`, r = await fetch(t, {
194
+ method: "GET",
195
+ headers: { "api-key": this.config.apiKey, accept: "application/json" }
196
+ });
197
+ if (!r.ok) {
198
+ const n = await r.json();
199
+ throw new Error(`API Error: ${n.detail}`);
200
+ }
201
+ return r.json();
202
+ }
203
+ }
204
+ function Fn(e) {
205
+ try {
206
+ if (e.startsWith("data: ")) {
207
+ const t = e.slice(6).trim();
208
+ if (t === "[DONE]" || t === "")
209
+ return { text: "", sessionId: "", type: "done" };
210
+ const r = JSON.parse(t);
211
+ return r.done ? { text: "", sessionId: r.sessionId || "", type: "done" } : r;
212
+ }
213
+ } catch (t) {
214
+ console.warn("Failed to parse streaming response:", t);
215
+ }
216
+ return null;
217
+ }
218
+ function ar(e) {
219
+ const t = (e.attachments || []).map((r) => r.id).join("|");
220
+ return `${e.role}:${e.content.trim()}:${t}`;
221
+ }
222
+ function Kn(e) {
223
+ const t = e.attachments;
224
+ if (!t || !Array.isArray(t) || t.length === 0) return;
225
+ const r = [];
226
+ for (const n of t) {
227
+ const a = n.url || "";
228
+ a && r.push({
229
+ id: n.id || We(),
230
+ name: String(n.name || "attachment"),
231
+ type: n.type === "image" ? "image" : "document",
232
+ url: a,
233
+ content_type: String(n.content_type || n.contentType || "application/octet-stream"),
234
+ size: n.size,
235
+ preview: n.preview
236
+ });
237
+ }
238
+ return r.length ? r : void 0;
239
+ }
240
+ function Wn(e) {
241
+ const [t, r] = J([]), [n, a] = J(!1), [c, u] = J(null), [d, h] = J(e.sessionId || null), [g, b] = J(!1), [p, w] = J(!1), [k, $] = J(!1), [j, S] = J(!1), [o, i] = J(!1), s = ae(null), f = ae(""), m = ae(!1), y = ae(!1), x = ae(!1), A = `${e.publishableKey ?? ""}|${e.apiKey ?? ""}|${e.apiBaseUrl ?? ""}|${e.agentId}`;
242
+ f.current !== A && (s.current = null, f.current = A), s.current || (s.current = new Ln({
243
+ publishableKey: e.publishableKey,
244
+ apiKey: e.apiKey,
245
+ apiBaseUrl: e.apiBaseUrl || "https://api.ordify.ai",
246
+ agentId: e.agentId
247
+ }));
248
+ const M = ae(null), C = ae(/* @__PURE__ */ new Set());
249
+ De(() => {
250
+ if (e.sessionId && e.sessionId !== d) {
251
+ const I = C.current.has(e.sessionId);
252
+ h(e.sessionId), y.current = !1, M.current = null, $(!1), I || r([]);
253
+ }
254
+ }, [e.sessionId]), De(() => {
255
+ (async () => {
256
+ const D = d || e.sessionId;
257
+ if (x.current || n)
258
+ return;
259
+ if (!D) {
260
+ y.current = !0, M.current = null, $(!1);
261
+ return;
262
+ }
263
+ if (M.current === D)
264
+ return;
265
+ if (C.current.has(D) && t.length > 0 && !y.current) {
266
+ y.current = !0, M.current = D, S(!1);
267
+ return;
268
+ }
269
+ M.current = D, S(!0);
270
+ try {
271
+ const v = await s.current.getSessionWithMessages(D);
272
+ if (v.messages && v.messages.length > 0) {
273
+ const N = v.messages.map((R) => ({
274
+ id: R.id || We(),
275
+ content: R.content || "",
276
+ role: R.role === "assistant" ? "assistant" : "user",
277
+ timestamp: R.timestamp ? new Date(R.timestamp) : /* @__PURE__ */ new Date(),
278
+ sessionId: D,
279
+ attachments: Kn(R)
280
+ }));
281
+ r((R) => {
282
+ if (R.length > 0) {
283
+ const W = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map();
284
+ return R.forEach((z) => {
285
+ W.set(z.id, z);
286
+ const U = ar(z);
287
+ O.has(U) || O.set(U, z);
288
+ }), N.forEach((z) => {
289
+ const U = ar(z);
290
+ !W.has(z.id) && !O.has(U) ? (W.set(z.id, z), O.set(U, z)) : W.has(z.id) && W.set(z.id, z);
291
+ }), Array.from(W.values()).sort(
292
+ (z, U) => z.timestamp.getTime() - U.timestamp.getTime()
293
+ );
294
+ }
295
+ return N;
296
+ }), $(!0), i(!0);
297
+ } else
298
+ $(!1);
299
+ } catch (v) {
300
+ console.warn("Failed to load session history:", v), $(!1), v instanceof Error && v.message.includes("404") && (h(null), M.current = null);
301
+ } finally {
302
+ S(!1), y.current = !0;
303
+ }
304
+ })();
305
+ }, [d, e.sessionId]);
306
+ const E = Z(() => {
307
+ u(null);
308
+ }, []), K = Z(async (I) => {
309
+ if (!s.current)
310
+ throw new Error("API client not initialized");
311
+ return s.current.uploadAttachment(I);
312
+ }, []), P = Z(
313
+ async (I, D, H) => {
314
+ const v = I.trim(), N = !!(H && H.length > 0);
315
+ if (!(!v && !N || n)) {
316
+ a(!0), u(null);
317
+ try {
318
+ const R = H != null && H.length ? H.map((V) => ({ ...V })) : void 0, W = {
319
+ id: We(),
320
+ content: v,
321
+ role: "user",
322
+ timestamp: /* @__PURE__ */ new Date(),
323
+ sessionId: d || void 0,
324
+ attachments: R
325
+ };
326
+ r((V) => [...V, W]), i(!0);
327
+ let O = d || e.sessionId || null;
328
+ O ? O !== d && h(O) : (O = (await s.current.createSession()).id, C.current.add(O), e.onSessionCreated && e.onSessionCreated(O)), x.current = !0;
329
+ const z = (await s.current.sendMessage(
330
+ v || "(see attachments)",
331
+ O,
332
+ D,
333
+ R
334
+ )).getReader(), U = new TextDecoder();
335
+ let Q = {
336
+ id: We(),
337
+ content: "",
338
+ role: "assistant",
339
+ timestamp: /* @__PURE__ */ new Date(),
340
+ sessionId: O
341
+ };
342
+ for (r((V) => [...V, Q]); ; ) {
343
+ const { done: V, value: ie } = await z.read();
344
+ if (V) break;
345
+ const ce = U.decode(ie, { stream: !0 }).split(`
346
+ `);
347
+ for (const ke of ce) {
348
+ if (!ke.trim()) continue;
349
+ const ne = Fn(ke);
350
+ if (ne) {
351
+ if (ne.type === "stream" && ne.text)
352
+ Q.content += ne.text, r((ee) => ee.find((_e) => _e.id === Q.id) ? ee.map(
353
+ (_e) => _e.id === Q.id ? { ..._e, content: Q.content } : _e
354
+ ) : [...ee, { ...Q, content: Q.content }]);
355
+ else if (ne.type === "done")
356
+ break;
357
+ }
358
+ }
359
+ }
360
+ O && O !== d && h(O), e.onMessage && e.onMessage(Q);
361
+ } catch (R) {
362
+ const W = R instanceof Error ? R.message : "Failed to send message";
363
+ u(W), e.onError && e.onError(R instanceof Error ? R : new Error(W));
364
+ } finally {
365
+ x.current = !1, a(!1);
366
+ }
367
+ }
368
+ },
369
+ [e.onSessionCreated, e.onMessage, e.onError, e.sessionId, n, d]
370
+ );
371
+ return De(() => {
372
+ const D = !(d || e.sessionId) || !k, H = e.quickQuestions && e.quickQuestions.length > 0;
373
+ if ((e.initialMessage || e.initialContext) && D && !p && !n && !j && !m.current && y.current && !H) {
374
+ w(!0), m.current = !0;
375
+ let v, N;
376
+ if (e.initialMessage && e.initialContext)
377
+ v = e.initialMessage, N = e.initialContext;
378
+ else if (e.initialMessage)
379
+ v = e.initialMessage, N = void 0;
380
+ else if (e.initialContext)
381
+ v = "Hi", N = e.initialContext;
382
+ else
383
+ return;
384
+ setTimeout(() => {
385
+ P(v, N);
386
+ }, 0);
387
+ }
388
+ }, [e.initialMessage, e.initialContext, p, n, j, k, d, e.sessionId, P]), {
389
+ messages: t,
390
+ sendMessage: P,
391
+ uploadAttachment: K,
392
+ isLoading: n,
393
+ error: c,
394
+ clearError: E,
395
+ sessionId: d,
396
+ isOpen: g,
397
+ setIsOpen: b,
398
+ hasSessionStarted: o
399
+ };
400
+ }
401
+ function Un(e) {
402
+ return Bt(() => {
403
+ const t = e.agentId || process.env.ORDIFY_AGENT_ID, r = e.publishableKey || process.env.ORDIFY_PUBLISHABLE_KEY, n = e.apiKey || process.env.ORDIFY_API_KEY, a = e.apiBaseUrl || process.env.ORDIFY_API_BASE_URL || "https://r.ordify.ai";
404
+ if (!t)
405
+ throw new Error("Ordify agent ID is required. Provide agentId prop or set ORDIFY_AGENT_ID environment variable.");
406
+ if (!r && !n)
407
+ throw new Error(
408
+ "Ordify credentials are required. Provide publishableKey (recommended) or apiKey."
409
+ );
410
+ return {
411
+ agentId: t,
412
+ publishableKey: r,
413
+ apiKey: n,
414
+ apiBaseUrl: a,
415
+ mode: e.mode || "floating",
416
+ position: e.position || "bottom-right",
417
+ theme: e.theme || "auto",
418
+ placeholder: e.placeholder || "Type a message...",
419
+ height: e.height || "500px",
420
+ className: e.className || "",
421
+ buttonStyle: e.buttonStyle || {},
422
+ chatWindowStyle: e.chatWindowStyle || {},
423
+ showHeader: e.showHeader !== !1,
424
+ buttonText: e.buttonText,
425
+ chatName: e.chatName,
426
+ primaryColor: e.primaryColor,
427
+ agentImage: e.agentImage,
428
+ onMessage: e.onMessage,
429
+ onError: e.onError,
430
+ onClose: e.onClose,
431
+ onSessionCreated: e.onSessionCreated,
432
+ initialMessage: e.initialMessage,
433
+ initialContext: e.initialContext,
434
+ sessionId: e.sessionId,
435
+ quickQuestions: e.quickQuestions,
436
+ welcomeMessage: e.welcomeMessage,
437
+ welcomeImage: e.welcomeImage,
438
+ enableAttachments: e.enableAttachments,
439
+ maxAttachmentSizeMB: e.maxAttachmentSizeMB,
440
+ maxAttachments: e.maxAttachments,
441
+ allowedAttachmentTypes: e.allowedAttachmentTypes
442
+ };
443
+ }, [e]);
444
+ }
445
+ /**
446
+ * @license lucide-react v0.544.0 - ISC
447
+ *
448
+ * This source code is licensed under the ISC license.
449
+ * See the LICENSE file in the root directory of this source tree.
450
+ */
451
+ const Hn = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), qn = (e) => e.replace(
452
+ /^([A-Z])|[\s-_]+(\w)/g,
453
+ (t, r, n) => n ? n.toUpperCase() : r.toLowerCase()
454
+ ), sr = (e) => {
455
+ const t = qn(e);
456
+ return t.charAt(0).toUpperCase() + t.slice(1);
457
+ }, Ur = (...e) => e.filter((t, r, n) => !!t && t.trim() !== "" && n.indexOf(t) === r).join(" ").trim(), Gn = (e) => {
458
+ for (const t in e)
459
+ if (t.startsWith("aria-") || t === "role" || t === "title")
460
+ return !0;
461
+ };
462
+ /**
463
+ * @license lucide-react v0.544.0 - ISC
464
+ *
465
+ * This source code is licensed under the ISC license.
466
+ * See the LICENSE file in the root directory of this source tree.
467
+ */
468
+ var Yn = {
469
+ xmlns: "http://www.w3.org/2000/svg",
470
+ width: 24,
471
+ height: 24,
472
+ viewBox: "0 0 24 24",
473
+ fill: "none",
474
+ stroke: "currentColor",
475
+ strokeWidth: 2,
476
+ strokeLinecap: "round",
477
+ strokeLinejoin: "round"
478
+ };
479
+ /**
480
+ * @license lucide-react v0.544.0 - ISC
481
+ *
482
+ * This source code is licensed under the ISC license.
483
+ * See the LICENSE file in the root directory of this source tree.
484
+ */
485
+ const Qn = Lr(
486
+ ({
487
+ color: e = "currentColor",
488
+ size: t = 24,
489
+ strokeWidth: r = 2,
490
+ absoluteStrokeWidth: n,
491
+ className: a = "",
492
+ children: c,
493
+ iconNode: u,
494
+ ...d
495
+ }, h) => Ze(
496
+ "svg",
497
+ {
498
+ ref: h,
499
+ ...Yn,
500
+ width: t,
501
+ height: t,
502
+ stroke: e,
503
+ strokeWidth: n ? Number(r) * 24 / Number(t) : r,
504
+ className: Ur("lucide", a),
505
+ ...!c && !Gn(d) && { "aria-hidden": "true" },
506
+ ...d
507
+ },
508
+ [
509
+ ...u.map(([g, b]) => Ze(g, b)),
510
+ ...Array.isArray(c) ? c : [c]
511
+ ]
512
+ )
513
+ );
514
+ /**
515
+ * @license lucide-react v0.544.0 - ISC
516
+ *
517
+ * This source code is licensed under the ISC license.
518
+ * See the LICENSE file in the root directory of this source tree.
519
+ */
520
+ const ot = (e, t) => {
521
+ const r = Lr(
522
+ ({ className: n, ...a }, c) => Ze(Qn, {
523
+ ref: c,
524
+ iconNode: t,
525
+ className: Ur(
526
+ `lucide-${Hn(sr(e))}`,
527
+ `lucide-${e}`,
528
+ n
529
+ ),
530
+ ...a
531
+ })
532
+ );
533
+ return r.displayName = sr(e), r;
534
+ };
535
+ /**
536
+ * @license lucide-react v0.544.0 - ISC
537
+ *
538
+ * This source code is licensed under the ISC license.
539
+ * See the LICENSE file in the root directory of this source tree.
540
+ */
541
+ const Vn = [
542
+ ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
543
+ ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
544
+ ["path", { d: "M10 9H8", key: "b1mrlr" }],
545
+ ["path", { d: "M16 13H8", key: "t4e002" }],
546
+ ["path", { d: "M16 17H8", key: "z1uh3a" }]
547
+ ], Zn = ot("file-text", Vn);
548
+ /**
549
+ * @license lucide-react v0.544.0 - ISC
550
+ *
551
+ * This source code is licensed under the ISC license.
552
+ * See the LICENSE file in the root directory of this source tree.
553
+ */
554
+ const Jn = [
555
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
556
+ ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
557
+ ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
558
+ ], Xn = ot("image", Jn);
559
+ /**
560
+ * @license lucide-react v0.544.0 - ISC
561
+ *
562
+ * This source code is licensed under the ISC license.
563
+ * See the LICENSE file in the root directory of this source tree.
564
+ */
565
+ const eo = [
566
+ [
567
+ "path",
568
+ {
569
+ d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
570
+ key: "1miecu"
571
+ }
572
+ ]
573
+ ], to = ot("paperclip", eo);
574
+ /**
575
+ * @license lucide-react v0.544.0 - ISC
576
+ *
577
+ * This source code is licensed under the ISC license.
578
+ * See the LICENSE file in the root directory of this source tree.
579
+ */
580
+ const ro = [
581
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
582
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
583
+ ], no = ot("x", ro);
584
+ var X = function() {
585
+ return X = Object.assign || function(t) {
586
+ for (var r, n = 1, a = arguments.length; n < a; n++) {
587
+ r = arguments[n];
588
+ for (var c in r) Object.prototype.hasOwnProperty.call(r, c) && (t[c] = r[c]);
589
+ }
590
+ return t;
591
+ }, X.apply(this, arguments);
592
+ };
593
+ function Je(e, t, r) {
594
+ if (r || arguments.length === 2) for (var n = 0, a = t.length, c; n < a; n++)
595
+ (c || !(n in t)) && (c || (c = Array.prototype.slice.call(t, 0, n)), c[n] = t[n]);
596
+ return e.concat(c || Array.prototype.slice.call(t));
597
+ }
598
+ var L = "-ms-", Ne = "-moz-", B = "-webkit-", Hr = "comm", at = "rule", Pt = "decl", oo = "@import", qr = "@keyframes", ao = "@layer", Gr = Math.abs, Lt = String.fromCharCode, Et = Object.assign;
599
+ function so(e, t) {
600
+ return Y(e, 0) ^ 45 ? (((t << 2 ^ Y(e, 0)) << 2 ^ Y(e, 1)) << 2 ^ Y(e, 2)) << 2 ^ Y(e, 3) : 0;
601
+ }
602
+ function Yr(e) {
603
+ return e.trim();
604
+ }
605
+ function de(e, t) {
606
+ return (e = t.exec(e)) ? e[0] : e;
607
+ }
608
+ function _(e, t, r) {
609
+ return e.replace(t, r);
610
+ }
611
+ function Ue(e, t, r) {
612
+ return e.indexOf(t, r);
613
+ }
614
+ function Y(e, t) {
615
+ return e.charCodeAt(t) | 0;
616
+ }
617
+ function $e(e, t, r) {
618
+ return e.slice(t, r);
619
+ }
620
+ function se(e) {
621
+ return e.length;
622
+ }
623
+ function Qr(e) {
624
+ return e.length;
625
+ }
626
+ function ze(e, t) {
627
+ return t.push(e), e;
628
+ }
629
+ function io(e, t) {
630
+ return e.map(t).join("");
631
+ }
632
+ function ir(e, t) {
633
+ return e.filter(function(r) {
634
+ return !de(r, t);
635
+ });
636
+ }
637
+ var st = 1, Se = 1, Vr = 0, te = 0, G = 0, Me = "";
638
+ function it(e, t, r, n, a, c, u, d) {
639
+ return { value: e, root: t, parent: r, type: n, props: a, children: c, line: st, column: Se, length: u, return: "", siblings: d };
640
+ }
641
+ function fe(e, t) {
642
+ return Et(it("", null, null, "", null, null, 0, e.siblings), e, { length: -e.length }, t);
643
+ }
644
+ function we(e) {
645
+ for (; e.root; )
646
+ e = fe(e.root, { children: [e] });
647
+ ze(e, e.siblings);
648
+ }
649
+ function co() {
650
+ return G;
651
+ }
652
+ function lo() {
653
+ return G = te > 0 ? Y(Me, --te) : 0, Se--, G === 10 && (Se = 1, st--), G;
654
+ }
655
+ function re() {
656
+ return G = te < Vr ? Y(Me, te++) : 0, Se++, G === 10 && (Se = 1, st++), G;
657
+ }
658
+ function ge() {
659
+ return Y(Me, te);
660
+ }
661
+ function He() {
662
+ return te;
663
+ }
664
+ function ct(e, t) {
665
+ return $e(Me, e, t);
666
+ }
667
+ function Mt(e) {
668
+ switch (e) {
669
+ case 0:
670
+ case 9:
671
+ case 10:
672
+ case 13:
673
+ case 32:
674
+ return 5;
675
+ case 33:
676
+ case 43:
677
+ case 44:
678
+ case 47:
679
+ case 62:
680
+ case 64:
681
+ case 126:
682
+ case 59:
683
+ case 123:
684
+ case 125:
685
+ return 4;
686
+ case 58:
687
+ return 3;
688
+ case 34:
689
+ case 39:
690
+ case 40:
691
+ case 91:
692
+ return 2;
693
+ case 41:
694
+ case 93:
695
+ return 1;
696
+ }
697
+ return 0;
698
+ }
699
+ function uo(e) {
700
+ return st = Se = 1, Vr = se(Me = e), te = 0, [];
701
+ }
702
+ function po(e) {
703
+ return Me = "", e;
704
+ }
705
+ function bt(e) {
706
+ return Yr(ct(te - 1, _t(e === 91 ? e + 2 : e === 40 ? e + 1 : e)));
707
+ }
708
+ function fo(e) {
709
+ for (; (G = ge()) && G < 33; )
710
+ re();
711
+ return Mt(e) > 2 || Mt(G) > 3 ? "" : " ";
712
+ }
713
+ function ho(e, t) {
714
+ for (; --t && re() && !(G < 48 || G > 102 || G > 57 && G < 65 || G > 70 && G < 97); )
715
+ ;
716
+ return ct(e, He() + (t < 6 && ge() == 32 && re() == 32));
717
+ }
718
+ function _t(e) {
719
+ for (; re(); )
720
+ switch (G) {
721
+ case e:
722
+ return te;
723
+ case 34:
724
+ case 39:
725
+ e !== 34 && e !== 39 && _t(G);
726
+ break;
727
+ case 40:
728
+ e === 41 && _t(e);
729
+ break;
730
+ case 92:
731
+ re();
732
+ break;
733
+ }
734
+ return te;
735
+ }
736
+ function mo(e, t) {
737
+ for (; re() && e + G !== 57; )
738
+ if (e + G === 84 && ge() === 47)
739
+ break;
740
+ return "/*" + ct(t, te - 1) + "*" + Lt(e === 47 ? e : re());
741
+ }
742
+ function go(e) {
743
+ for (; !Mt(ge()); )
744
+ re();
745
+ return ct(e, te);
746
+ }
747
+ function bo(e) {
748
+ return po(qe("", null, null, null, [""], e = uo(e), 0, [0], e));
749
+ }
750
+ function qe(e, t, r, n, a, c, u, d, h) {
751
+ for (var g = 0, b = 0, p = u, w = 0, k = 0, $ = 0, j = 1, S = 1, o = 1, i = 0, s = "", f = a, m = c, y = n, x = s; S; )
752
+ switch ($ = i, i = re()) {
753
+ case 40:
754
+ if ($ != 108 && Y(x, p - 1) == 58) {
755
+ Ue(x += _(bt(i), "&", "&\f"), "&\f", Gr(g ? d[g - 1] : 0)) != -1 && (o = -1);
756
+ break;
757
+ }
758
+ case 34:
759
+ case 39:
760
+ case 91:
761
+ x += bt(i);
762
+ break;
763
+ case 9:
764
+ case 10:
765
+ case 13:
766
+ case 32:
767
+ x += fo($);
768
+ break;
769
+ case 92:
770
+ x += ho(He() - 1, 7);
771
+ continue;
772
+ case 47:
773
+ switch (ge()) {
774
+ case 42:
775
+ case 47:
776
+ ze(xo(mo(re(), He()), t, r, h), h);
777
+ break;
778
+ default:
779
+ x += "/";
780
+ }
781
+ break;
782
+ case 123 * j:
783
+ d[g++] = se(x) * o;
784
+ case 125 * j:
785
+ case 59:
786
+ case 0:
787
+ switch (i) {
788
+ case 0:
789
+ case 125:
790
+ S = 0;
791
+ case 59 + b:
792
+ o == -1 && (x = _(x, /\f/g, "")), k > 0 && se(x) - p && ze(k > 32 ? lr(x + ";", n, r, p - 1, h) : lr(_(x, " ", "") + ";", n, r, p - 2, h), h);
793
+ break;
794
+ case 59:
795
+ x += ";";
796
+ default:
797
+ if (ze(y = cr(x, t, r, g, b, a, d, s, f = [], m = [], p, c), c), i === 123)
798
+ if (b === 0)
799
+ qe(x, t, y, y, f, c, p, d, m);
800
+ else
801
+ switch (w === 99 && Y(x, 3) === 110 ? 100 : w) {
802
+ case 100:
803
+ case 108:
804
+ case 109:
805
+ case 115:
806
+ qe(e, y, y, n && ze(cr(e, y, y, 0, 0, a, d, s, a, f = [], p, m), m), a, m, p, d, n ? f : m);
807
+ break;
808
+ default:
809
+ qe(x, y, y, y, [""], m, 0, d, m);
810
+ }
811
+ }
812
+ g = b = k = 0, j = o = 1, s = x = "", p = u;
813
+ break;
814
+ case 58:
815
+ p = 1 + se(x), k = $;
816
+ default:
817
+ if (j < 1) {
818
+ if (i == 123)
819
+ --j;
820
+ else if (i == 125 && j++ == 0 && lo() == 125)
821
+ continue;
822
+ }
823
+ switch (x += Lt(i), i * j) {
824
+ case 38:
825
+ o = b > 0 ? 1 : (x += "\f", -1);
826
+ break;
827
+ case 44:
828
+ d[g++] = (se(x) - 1) * o, o = 1;
829
+ break;
830
+ case 64:
831
+ ge() === 45 && (x += bt(re())), w = ge(), b = p = se(s = x += go(He())), i++;
832
+ break;
833
+ case 45:
834
+ $ === 45 && se(x) == 2 && (j = 0);
835
+ }
836
+ }
837
+ return c;
838
+ }
839
+ function cr(e, t, r, n, a, c, u, d, h, g, b, p) {
840
+ for (var w = a - 1, k = a === 0 ? c : [""], $ = Qr(k), j = 0, S = 0, o = 0; j < n; ++j)
841
+ for (var i = 0, s = $e(e, w + 1, w = Gr(S = u[j])), f = e; i < $; ++i)
842
+ (f = Yr(S > 0 ? k[i] + " " + s : _(s, /&\f/g, k[i]))) && (h[o++] = f);
843
+ return it(e, t, r, a === 0 ? at : d, h, g, b, p);
844
+ }
845
+ function xo(e, t, r, n) {
846
+ return it(e, t, r, Hr, Lt(co()), $e(e, 2, -2), 0, n);
847
+ }
848
+ function lr(e, t, r, n, a) {
849
+ return it(e, t, r, Pt, $e(e, 0, n), $e(e, n + 1, -1), n, a);
850
+ }
851
+ function Zr(e, t, r) {
852
+ switch (so(e, t)) {
853
+ case 5103:
854
+ return B + "print-" + e + e;
855
+ case 5737:
856
+ case 4201:
857
+ case 3177:
858
+ case 3433:
859
+ case 1641:
860
+ case 4457:
861
+ case 2921:
862
+ case 5572:
863
+ case 6356:
864
+ case 5844:
865
+ case 3191:
866
+ case 6645:
867
+ case 3005:
868
+ case 6391:
869
+ case 5879:
870
+ case 5623:
871
+ case 6135:
872
+ case 4599:
873
+ case 4855:
874
+ case 4215:
875
+ case 6389:
876
+ case 5109:
877
+ case 5365:
878
+ case 5621:
879
+ case 3829:
880
+ return B + e + e;
881
+ case 4789:
882
+ return Ne + e + e;
883
+ case 5349:
884
+ case 4246:
885
+ case 4810:
886
+ case 6968:
887
+ case 2756:
888
+ return B + e + Ne + e + L + e + e;
889
+ case 5936:
890
+ switch (Y(e, t + 11)) {
891
+ case 114:
892
+ return B + e + L + _(e, /[svh]\w+-[tblr]{2}/, "tb") + e;
893
+ case 108:
894
+ return B + e + L + _(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e;
895
+ case 45:
896
+ return B + e + L + _(e, /[svh]\w+-[tblr]{2}/, "lr") + e;
897
+ }
898
+ case 6828:
899
+ case 4268:
900
+ case 2903:
901
+ return B + e + L + e + e;
902
+ case 6165:
903
+ return B + e + L + "flex-" + e + e;
904
+ case 5187:
905
+ return B + e + _(e, /(\w+).+(:[^]+)/, B + "box-$1$2" + L + "flex-$1$2") + e;
906
+ case 5443:
907
+ return B + e + L + "flex-item-" + _(e, /flex-|-self/g, "") + (de(e, /flex-|baseline/) ? "" : L + "grid-row-" + _(e, /flex-|-self/g, "")) + e;
908
+ case 4675:
909
+ return B + e + L + "flex-line-pack" + _(e, /align-content|flex-|-self/g, "") + e;
910
+ case 5548:
911
+ return B + e + L + _(e, "shrink", "negative") + e;
912
+ case 5292:
913
+ return B + e + L + _(e, "basis", "preferred-size") + e;
914
+ case 6060:
915
+ return B + "box-" + _(e, "-grow", "") + B + e + L + _(e, "grow", "positive") + e;
916
+ case 4554:
917
+ return B + _(e, /([^-])(transform)/g, "$1" + B + "$2") + e;
918
+ case 6187:
919
+ return _(_(_(e, /(zoom-|grab)/, B + "$1"), /(image-set)/, B + "$1"), e, "") + e;
920
+ case 5495:
921
+ case 3959:
922
+ return _(e, /(image-set\([^]*)/, B + "$1$`$1");
923
+ case 4968:
924
+ return _(_(e, /(.+:)(flex-)?(.*)/, B + "box-pack:$3" + L + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + B + e + e;
925
+ case 4200:
926
+ if (!de(e, /flex-|baseline/)) return L + "grid-column-align" + $e(e, t) + e;
927
+ break;
928
+ case 2592:
929
+ case 3360:
930
+ return L + _(e, "template-", "") + e;
931
+ case 4384:
932
+ case 3616:
933
+ return r && r.some(function(n, a) {
934
+ return t = a, de(n.props, /grid-\w+-end/);
935
+ }) ? ~Ue(e + (r = r[t].value), "span", 0) ? e : L + _(e, "-start", "") + e + L + "grid-row-span:" + (~Ue(r, "span", 0) ? de(r, /\d+/) : +de(r, /\d+/) - +de(e, /\d+/)) + ";" : L + _(e, "-start", "") + e;
936
+ case 4896:
937
+ case 4128:
938
+ return r && r.some(function(n) {
939
+ return de(n.props, /grid-\w+-start/);
940
+ }) ? e : L + _(_(e, "-end", "-span"), "span ", "") + e;
941
+ case 4095:
942
+ case 3583:
943
+ case 4068:
944
+ case 2532:
945
+ return _(e, /(.+)-inline(.+)/, B + "$1$2") + e;
946
+ case 8116:
947
+ case 7059:
948
+ case 5753:
949
+ case 5535:
950
+ case 5445:
951
+ case 5701:
952
+ case 4933:
953
+ case 4677:
954
+ case 5533:
955
+ case 5789:
956
+ case 5021:
957
+ case 4765:
958
+ if (se(e) - 1 - t > 6)
959
+ switch (Y(e, t + 1)) {
960
+ case 109:
961
+ if (Y(e, t + 4) !== 45)
962
+ break;
963
+ case 102:
964
+ return _(e, /(.+:)(.+)-([^]+)/, "$1" + B + "$2-$3$1" + Ne + (Y(e, t + 3) == 108 ? "$3" : "$2-$3")) + e;
965
+ case 115:
966
+ return ~Ue(e, "stretch", 0) ? Zr(_(e, "stretch", "fill-available"), t, r) + e : e;
967
+ }
968
+ break;
969
+ case 5152:
970
+ case 5920:
971
+ return _(e, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(n, a, c, u, d, h, g) {
972
+ return L + a + ":" + c + g + (u ? L + a + "-span:" + (d ? h : +h - +c) + g : "") + e;
973
+ });
974
+ case 4949:
975
+ if (Y(e, t + 6) === 121)
976
+ return _(e, ":", ":" + B) + e;
977
+ break;
978
+ case 6444:
979
+ switch (Y(e, Y(e, 14) === 45 ? 18 : 11)) {
980
+ case 120:
981
+ return _(e, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + B + (Y(e, 14) === 45 ? "inline-" : "") + "box$3$1" + B + "$2$3$1" + L + "$2box$3") + e;
982
+ case 100:
983
+ return _(e, ":", ":" + L) + e;
984
+ }
985
+ break;
986
+ case 5719:
987
+ case 2647:
988
+ case 2135:
989
+ case 3927:
990
+ case 2391:
991
+ return _(e, "scroll-", "scroll-snap-") + e;
992
+ }
993
+ return e;
994
+ }
995
+ function Xe(e, t) {
996
+ for (var r = "", n = 0; n < e.length; n++)
997
+ r += t(e[n], n, e, t) || "";
998
+ return r;
999
+ }
1000
+ function yo(e, t, r, n) {
1001
+ switch (e.type) {
1002
+ case ao:
1003
+ if (e.children.length) break;
1004
+ case oo:
1005
+ case Pt:
1006
+ return e.return = e.return || e.value;
1007
+ case Hr:
1008
+ return "";
1009
+ case qr:
1010
+ return e.return = e.value + "{" + Xe(e.children, n) + "}";
1011
+ case at:
1012
+ if (!se(e.value = e.props.join(","))) return "";
1013
+ }
1014
+ return se(r = Xe(e.children, n)) ? e.return = e.value + "{" + r + "}" : "";
1015
+ }
1016
+ function ko(e) {
1017
+ var t = Qr(e);
1018
+ return function(r, n, a, c) {
1019
+ for (var u = "", d = 0; d < t; d++)
1020
+ u += e[d](r, n, a, c) || "";
1021
+ return u;
1022
+ };
1023
+ }
1024
+ function wo(e) {
1025
+ return function(t) {
1026
+ t.root || (t = t.return) && e(t);
1027
+ };
1028
+ }
1029
+ function vo(e, t, r, n) {
1030
+ if (e.length > -1 && !e.return)
1031
+ switch (e.type) {
1032
+ case Pt:
1033
+ e.return = Zr(e.value, e.length, r);
1034
+ return;
1035
+ case qr:
1036
+ return Xe([fe(e, { value: _(e.value, "@", "@" + B) })], n);
1037
+ case at:
1038
+ if (e.length)
1039
+ return io(r = e.props, function(a) {
1040
+ switch (de(a, n = /(::plac\w+|:read-\w+)/)) {
1041
+ case ":read-only":
1042
+ case ":read-write":
1043
+ we(fe(e, { props: [_(a, /:(read-\w+)/, ":" + Ne + "$1")] })), we(fe(e, { props: [a] })), Et(e, { props: ir(r, n) });
1044
+ break;
1045
+ case "::placeholder":
1046
+ we(fe(e, { props: [_(a, /:(plac\w+)/, ":" + B + "input-$1")] })), we(fe(e, { props: [_(a, /:(plac\w+)/, ":" + Ne + "$1")] })), we(fe(e, { props: [_(a, /:(plac\w+)/, L + "input-$1")] })), we(fe(e, { props: [a] })), Et(e, { props: ir(r, n) });
1047
+ break;
1048
+ }
1049
+ return "";
1050
+ });
1051
+ }
1052
+ }
1053
+ var $o = {
1054
+ animationIterationCount: 1,
1055
+ aspectRatio: 1,
1056
+ borderImageOutset: 1,
1057
+ borderImageSlice: 1,
1058
+ borderImageWidth: 1,
1059
+ boxFlex: 1,
1060
+ boxFlexGroup: 1,
1061
+ boxOrdinalGroup: 1,
1062
+ columnCount: 1,
1063
+ columns: 1,
1064
+ flex: 1,
1065
+ flexGrow: 1,
1066
+ flexPositive: 1,
1067
+ flexShrink: 1,
1068
+ flexNegative: 1,
1069
+ flexOrder: 1,
1070
+ gridRow: 1,
1071
+ gridRowEnd: 1,
1072
+ gridRowSpan: 1,
1073
+ gridRowStart: 1,
1074
+ gridColumn: 1,
1075
+ gridColumnEnd: 1,
1076
+ gridColumnSpan: 1,
1077
+ gridColumnStart: 1,
1078
+ msGridRow: 1,
1079
+ msGridRowSpan: 1,
1080
+ msGridColumn: 1,
1081
+ msGridColumnSpan: 1,
1082
+ fontWeight: 1,
1083
+ lineHeight: 1,
1084
+ opacity: 1,
1085
+ order: 1,
1086
+ orphans: 1,
1087
+ tabSize: 1,
1088
+ widows: 1,
1089
+ zIndex: 1,
1090
+ zoom: 1,
1091
+ WebkitLineClamp: 1,
1092
+ // SVG-related properties
1093
+ fillOpacity: 1,
1094
+ floodOpacity: 1,
1095
+ stopOpacity: 1,
1096
+ strokeDasharray: 1,
1097
+ strokeDashoffset: 1,
1098
+ strokeMiterlimit: 1,
1099
+ strokeOpacity: 1,
1100
+ strokeWidth: 1
1101
+ }, Ce = typeof process < "u" && process.env !== void 0 && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || "data-styled", Jr = "active", Xr = "data-styled-version", lt = "6.1.19", Ft = `/*!sc*/
1102
+ `, et = typeof window < "u" && typeof document < "u", So = !!(typeof SC_DISABLE_SPEEDY == "boolean" ? SC_DISABLE_SPEEDY : typeof process < "u" && process.env !== void 0 && process.env.REACT_APP_SC_DISABLE_SPEEDY !== void 0 && process.env.REACT_APP_SC_DISABLE_SPEEDY !== "" ? process.env.REACT_APP_SC_DISABLE_SPEEDY !== "false" && process.env.REACT_APP_SC_DISABLE_SPEEDY : typeof process < "u" && process.env !== void 0 && process.env.SC_DISABLE_SPEEDY !== void 0 && process.env.SC_DISABLE_SPEEDY !== "" && process.env.SC_DISABLE_SPEEDY !== "false" && process.env.SC_DISABLE_SPEEDY), dt = Object.freeze([]), je = Object.freeze({});
1103
+ function Co(e, t, r) {
1104
+ return r === void 0 && (r = je), e.theme !== r.theme && e.theme || t || r.theme;
1105
+ }
1106
+ var en = /* @__PURE__ */ new Set(["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "u", "ul", "use", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"]), jo = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, Io = /(^-|-$)/g;
1107
+ function dr(e) {
1108
+ return e.replace(jo, "-").replace(Io, "");
1109
+ }
1110
+ var Ao = /(a)(d)/gi, Le = 52, ur = function(e) {
1111
+ return String.fromCharCode(e + (e > 25 ? 39 : 97));
1112
+ };
1113
+ function Rt(e) {
1114
+ var t, r = "";
1115
+ for (t = Math.abs(e); t > Le; t = t / Le | 0) r = ur(t % Le) + r;
1116
+ return (ur(t % Le) + r).replace(Ao, "$1-$2");
1117
+ }
1118
+ var xt, tn = 5381, ve = function(e, t) {
1119
+ for (var r = t.length; r; ) e = 33 * e ^ t.charCodeAt(--r);
1120
+ return e;
1121
+ }, rn = function(e) {
1122
+ return ve(tn, e);
1123
+ };
1124
+ function To(e) {
1125
+ return Rt(rn(e) >>> 0);
1126
+ }
1127
+ function Eo(e) {
1128
+ return e.displayName || e.name || "Component";
1129
+ }
1130
+ function yt(e) {
1131
+ return typeof e == "string" && !0;
1132
+ }
1133
+ var nn = typeof Symbol == "function" && Symbol.for, on = nn ? Symbol.for("react.memo") : 60115, Mo = nn ? Symbol.for("react.forward_ref") : 60112, _o = { childContextTypes: !0, contextType: !0, contextTypes: !0, defaultProps: !0, displayName: !0, getDefaultProps: !0, getDerivedStateFromError: !0, getDerivedStateFromProps: !0, mixins: !0, propTypes: !0, type: !0 }, Ro = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 }, an = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, zo = ((xt = {})[Mo] = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, xt[on] = an, xt);
1134
+ function pr(e) {
1135
+ return ("type" in (t = e) && t.type.$$typeof) === on ? an : "$$typeof" in e ? zo[e.$$typeof] : _o;
1136
+ var t;
1137
+ }
1138
+ var Do = Object.defineProperty, No = Object.getOwnPropertyNames, fr = Object.getOwnPropertySymbols, Oo = Object.getOwnPropertyDescriptor, Bo = Object.getPrototypeOf, hr = Object.prototype;
1139
+ function sn(e, t, r) {
1140
+ if (typeof t != "string") {
1141
+ if (hr) {
1142
+ var n = Bo(t);
1143
+ n && n !== hr && sn(e, n, r);
1144
+ }
1145
+ var a = No(t);
1146
+ fr && (a = a.concat(fr(t)));
1147
+ for (var c = pr(e), u = pr(t), d = 0; d < a.length; ++d) {
1148
+ var h = a[d];
1149
+ if (!(h in Ro || r && r[h] || u && h in u || c && h in c)) {
1150
+ var g = Oo(t, h);
1151
+ try {
1152
+ Do(e, h, g);
1153
+ } catch {
1154
+ }
1155
+ }
1156
+ }
1157
+ }
1158
+ return e;
1159
+ }
1160
+ function Ie(e) {
1161
+ return typeof e == "function";
1162
+ }
1163
+ function Kt(e) {
1164
+ return typeof e == "object" && "styledComponentId" in e;
1165
+ }
1166
+ function me(e, t) {
1167
+ return e && t ? "".concat(e, " ").concat(t) : e || t || "";
1168
+ }
1169
+ function mr(e, t) {
1170
+ if (e.length === 0) return "";
1171
+ for (var r = e[0], n = 1; n < e.length; n++) r += e[n];
1172
+ return r;
1173
+ }
1174
+ function Be(e) {
1175
+ return e !== null && typeof e == "object" && e.constructor.name === Object.name && !("props" in e && e.$$typeof);
1176
+ }
1177
+ function zt(e, t, r) {
1178
+ if (r === void 0 && (r = !1), !r && !Be(e) && !Array.isArray(e)) return t;
1179
+ if (Array.isArray(t)) for (var n = 0; n < t.length; n++) e[n] = zt(e[n], t[n]);
1180
+ else if (Be(t)) for (var n in t) e[n] = zt(e[n], t[n]);
1181
+ return e;
1182
+ }
1183
+ function Wt(e, t) {
1184
+ Object.defineProperty(e, "toString", { value: t });
1185
+ }
1186
+ function Pe(e) {
1187
+ for (var t = [], r = 1; r < arguments.length; r++) t[r - 1] = arguments[r];
1188
+ return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e, " for more information.").concat(t.length > 0 ? " Args: ".concat(t.join(", ")) : ""));
1189
+ }
1190
+ var Po = function() {
1191
+ function e(t) {
1192
+ this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = t;
1193
+ }
1194
+ return e.prototype.indexOfGroup = function(t) {
1195
+ for (var r = 0, n = 0; n < t; n++) r += this.groupSizes[n];
1196
+ return r;
1197
+ }, e.prototype.insertRules = function(t, r) {
1198
+ if (t >= this.groupSizes.length) {
1199
+ for (var n = this.groupSizes, a = n.length, c = a; t >= c; ) if ((c <<= 1) < 0) throw Pe(16, "".concat(t));
1200
+ this.groupSizes = new Uint32Array(c), this.groupSizes.set(n), this.length = c;
1201
+ for (var u = a; u < c; u++) this.groupSizes[u] = 0;
1202
+ }
1203
+ for (var d = this.indexOfGroup(t + 1), h = (u = 0, r.length); u < h; u++) this.tag.insertRule(d, r[u]) && (this.groupSizes[t]++, d++);
1204
+ }, e.prototype.clearGroup = function(t) {
1205
+ if (t < this.length) {
1206
+ var r = this.groupSizes[t], n = this.indexOfGroup(t), a = n + r;
1207
+ this.groupSizes[t] = 0;
1208
+ for (var c = n; c < a; c++) this.tag.deleteRule(n);
1209
+ }
1210
+ }, e.prototype.getGroup = function(t) {
1211
+ var r = "";
1212
+ if (t >= this.length || this.groupSizes[t] === 0) return r;
1213
+ for (var n = this.groupSizes[t], a = this.indexOfGroup(t), c = a + n, u = a; u < c; u++) r += "".concat(this.tag.getRule(u)).concat(Ft);
1214
+ return r;
1215
+ }, e;
1216
+ }(), Ge = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map(), Ye = 1, Fe = function(e) {
1217
+ if (Ge.has(e)) return Ge.get(e);
1218
+ for (; tt.has(Ye); ) Ye++;
1219
+ var t = Ye++;
1220
+ return Ge.set(e, t), tt.set(t, e), t;
1221
+ }, Lo = function(e, t) {
1222
+ Ye = t + 1, Ge.set(e, t), tt.set(t, e);
1223
+ }, Fo = "style[".concat(Ce, "][").concat(Xr, '="').concat(lt, '"]'), Ko = new RegExp("^".concat(Ce, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), Wo = function(e, t, r) {
1224
+ for (var n, a = r.split(","), c = 0, u = a.length; c < u; c++) (n = a[c]) && e.registerName(t, n);
1225
+ }, Uo = function(e, t) {
1226
+ for (var r, n = ((r = t.textContent) !== null && r !== void 0 ? r : "").split(Ft), a = [], c = 0, u = n.length; c < u; c++) {
1227
+ var d = n[c].trim();
1228
+ if (d) {
1229
+ var h = d.match(Ko);
1230
+ if (h) {
1231
+ var g = 0 | parseInt(h[1], 10), b = h[2];
1232
+ g !== 0 && (Lo(b, g), Wo(e, b, h[3]), e.getTag().insertRules(g, a)), a.length = 0;
1233
+ } else a.push(d);
1234
+ }
1235
+ }
1236
+ }, gr = function(e) {
1237
+ for (var t = document.querySelectorAll(Fo), r = 0, n = t.length; r < n; r++) {
1238
+ var a = t[r];
1239
+ a && a.getAttribute(Ce) !== Jr && (Uo(e, a), a.parentNode && a.parentNode.removeChild(a));
1240
+ }
1241
+ };
1242
+ function Ho() {
1243
+ return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : null;
1244
+ }
1245
+ var cn = function(e) {
1246
+ var t = document.head, r = e || t, n = document.createElement("style"), a = function(d) {
1247
+ var h = Array.from(d.querySelectorAll("style[".concat(Ce, "]")));
1248
+ return h[h.length - 1];
1249
+ }(r), c = a !== void 0 ? a.nextSibling : null;
1250
+ n.setAttribute(Ce, Jr), n.setAttribute(Xr, lt);
1251
+ var u = Ho();
1252
+ return u && n.setAttribute("nonce", u), r.insertBefore(n, c), n;
1253
+ }, qo = function() {
1254
+ function e(t) {
1255
+ this.element = cn(t), this.element.appendChild(document.createTextNode("")), this.sheet = function(r) {
1256
+ if (r.sheet) return r.sheet;
1257
+ for (var n = document.styleSheets, a = 0, c = n.length; a < c; a++) {
1258
+ var u = n[a];
1259
+ if (u.ownerNode === r) return u;
1260
+ }
1261
+ throw Pe(17);
1262
+ }(this.element), this.length = 0;
1263
+ }
1264
+ return e.prototype.insertRule = function(t, r) {
1265
+ try {
1266
+ return this.sheet.insertRule(r, t), this.length++, !0;
1267
+ } catch {
1268
+ return !1;
1269
+ }
1270
+ }, e.prototype.deleteRule = function(t) {
1271
+ this.sheet.deleteRule(t), this.length--;
1272
+ }, e.prototype.getRule = function(t) {
1273
+ var r = this.sheet.cssRules[t];
1274
+ return r && r.cssText ? r.cssText : "";
1275
+ }, e;
1276
+ }(), Go = function() {
1277
+ function e(t) {
1278
+ this.element = cn(t), this.nodes = this.element.childNodes, this.length = 0;
1279
+ }
1280
+ return e.prototype.insertRule = function(t, r) {
1281
+ if (t <= this.length && t >= 0) {
1282
+ var n = document.createTextNode(r);
1283
+ return this.element.insertBefore(n, this.nodes[t] || null), this.length++, !0;
1284
+ }
1285
+ return !1;
1286
+ }, e.prototype.deleteRule = function(t) {
1287
+ this.element.removeChild(this.nodes[t]), this.length--;
1288
+ }, e.prototype.getRule = function(t) {
1289
+ return t < this.length ? this.nodes[t].textContent : "";
1290
+ }, e;
1291
+ }(), Yo = function() {
1292
+ function e(t) {
1293
+ this.rules = [], this.length = 0;
1294
+ }
1295
+ return e.prototype.insertRule = function(t, r) {
1296
+ return t <= this.length && (this.rules.splice(t, 0, r), this.length++, !0);
1297
+ }, e.prototype.deleteRule = function(t) {
1298
+ this.rules.splice(t, 1), this.length--;
1299
+ }, e.prototype.getRule = function(t) {
1300
+ return t < this.length ? this.rules[t] : "";
1301
+ }, e;
1302
+ }(), br = et, Qo = { isServer: !et, useCSSOMInjection: !So }, ln = function() {
1303
+ function e(t, r, n) {
1304
+ t === void 0 && (t = je), r === void 0 && (r = {});
1305
+ var a = this;
1306
+ this.options = X(X({}, Qo), t), this.gs = r, this.names = new Map(n), this.server = !!t.isServer, !this.server && et && br && (br = !1, gr(this)), Wt(this, function() {
1307
+ return function(c) {
1308
+ for (var u = c.getTag(), d = u.length, h = "", g = function(p) {
1309
+ var w = function(o) {
1310
+ return tt.get(o);
1311
+ }(p);
1312
+ if (w === void 0) return "continue";
1313
+ var k = c.names.get(w), $ = u.getGroup(p);
1314
+ if (k === void 0 || !k.size || $.length === 0) return "continue";
1315
+ var j = "".concat(Ce, ".g").concat(p, '[id="').concat(w, '"]'), S = "";
1316
+ k !== void 0 && k.forEach(function(o) {
1317
+ o.length > 0 && (S += "".concat(o, ","));
1318
+ }), h += "".concat($).concat(j, '{content:"').concat(S, '"}').concat(Ft);
1319
+ }, b = 0; b < d; b++) g(b);
1320
+ return h;
1321
+ }(a);
1322
+ });
1323
+ }
1324
+ return e.registerId = function(t) {
1325
+ return Fe(t);
1326
+ }, e.prototype.rehydrate = function() {
1327
+ !this.server && et && gr(this);
1328
+ }, e.prototype.reconstructWithOptions = function(t, r) {
1329
+ return r === void 0 && (r = !0), new e(X(X({}, this.options), t), this.gs, r && this.names || void 0);
1330
+ }, e.prototype.allocateGSInstance = function(t) {
1331
+ return this.gs[t] = (this.gs[t] || 0) + 1;
1332
+ }, e.prototype.getTag = function() {
1333
+ return this.tag || (this.tag = (t = function(r) {
1334
+ var n = r.useCSSOMInjection, a = r.target;
1335
+ return r.isServer ? new Yo(a) : n ? new qo(a) : new Go(a);
1336
+ }(this.options), new Po(t)));
1337
+ var t;
1338
+ }, e.prototype.hasNameForId = function(t, r) {
1339
+ return this.names.has(t) && this.names.get(t).has(r);
1340
+ }, e.prototype.registerName = function(t, r) {
1341
+ if (Fe(t), this.names.has(t)) this.names.get(t).add(r);
1342
+ else {
1343
+ var n = /* @__PURE__ */ new Set();
1344
+ n.add(r), this.names.set(t, n);
1345
+ }
1346
+ }, e.prototype.insertRules = function(t, r, n) {
1347
+ this.registerName(t, r), this.getTag().insertRules(Fe(t), n);
1348
+ }, e.prototype.clearNames = function(t) {
1349
+ this.names.has(t) && this.names.get(t).clear();
1350
+ }, e.prototype.clearRules = function(t) {
1351
+ this.getTag().clearGroup(Fe(t)), this.clearNames(t);
1352
+ }, e.prototype.clearTag = function() {
1353
+ this.tag = void 0;
1354
+ }, e;
1355
+ }(), Vo = /&/g, Zo = /^\s*\/\/.*$/gm;
1356
+ function dn(e, t) {
1357
+ return e.map(function(r) {
1358
+ return r.type === "rule" && (r.value = "".concat(t, " ").concat(r.value), r.value = r.value.replaceAll(",", ",".concat(t, " ")), r.props = r.props.map(function(n) {
1359
+ return "".concat(t, " ").concat(n);
1360
+ })), Array.isArray(r.children) && r.type !== "@keyframes" && (r.children = dn(r.children, t)), r;
1361
+ });
1362
+ }
1363
+ function Jo(e) {
1364
+ var t, r, n, a = je, c = a.options, u = c === void 0 ? je : c, d = a.plugins, h = d === void 0 ? dt : d, g = function(w, k, $) {
1365
+ return $.startsWith(r) && $.endsWith(r) && $.replaceAll(r, "").length > 0 ? ".".concat(t) : w;
1366
+ }, b = h.slice();
1367
+ b.push(function(w) {
1368
+ w.type === at && w.value.includes("&") && (w.props[0] = w.props[0].replace(Vo, r).replace(n, g));
1369
+ }), u.prefix && b.push(vo), b.push(yo);
1370
+ var p = function(w, k, $, j) {
1371
+ k === void 0 && (k = ""), $ === void 0 && ($ = ""), j === void 0 && (j = "&"), t = j, r = k, n = new RegExp("\\".concat(r, "\\b"), "g");
1372
+ var S = w.replace(Zo, ""), o = bo($ || k ? "".concat($, " ").concat(k, " { ").concat(S, " }") : S);
1373
+ u.namespace && (o = dn(o, u.namespace));
1374
+ var i = [];
1375
+ return Xe(o, ko(b.concat(wo(function(s) {
1376
+ return i.push(s);
1377
+ })))), i;
1378
+ };
1379
+ return p.hash = h.length ? h.reduce(function(w, k) {
1380
+ return k.name || Pe(15), ve(w, k.name);
1381
+ }, tn).toString() : "", p;
1382
+ }
1383
+ var Xo = new ln(), Dt = Jo(), un = F.createContext({ shouldForwardProp: void 0, styleSheet: Xo, stylis: Dt });
1384
+ un.Consumer;
1385
+ F.createContext(void 0);
1386
+ function xr() {
1387
+ return Fr(un);
1388
+ }
1389
+ var ea = function() {
1390
+ function e(t, r) {
1391
+ var n = this;
1392
+ this.inject = function(a, c) {
1393
+ c === void 0 && (c = Dt);
1394
+ var u = n.name + c.hash;
1395
+ a.hasNameForId(n.id, u) || a.insertRules(n.id, u, c(n.rules, u, "@keyframes"));
1396
+ }, this.name = t, this.id = "sc-keyframes-".concat(t), this.rules = r, Wt(this, function() {
1397
+ throw Pe(12, String(n.name));
1398
+ });
1399
+ }
1400
+ return e.prototype.getName = function(t) {
1401
+ return t === void 0 && (t = Dt), this.name + t.hash;
1402
+ }, e;
1403
+ }(), ta = function(e) {
1404
+ return e >= "A" && e <= "Z";
1405
+ };
1406
+ function yr(e) {
1407
+ for (var t = "", r = 0; r < e.length; r++) {
1408
+ var n = e[r];
1409
+ if (r === 1 && n === "-" && e[0] === "-") return e;
1410
+ ta(n) ? t += "-" + n.toLowerCase() : t += n;
1411
+ }
1412
+ return t.startsWith("ms-") ? "-" + t : t;
1413
+ }
1414
+ var pn = function(e) {
1415
+ return e == null || e === !1 || e === "";
1416
+ }, fn = function(e) {
1417
+ var t, r, n = [];
1418
+ for (var a in e) {
1419
+ var c = e[a];
1420
+ e.hasOwnProperty(a) && !pn(c) && (Array.isArray(c) && c.isCss || Ie(c) ? n.push("".concat(yr(a), ":"), c, ";") : Be(c) ? n.push.apply(n, Je(Je(["".concat(a, " {")], fn(c), !1), ["}"], !1)) : n.push("".concat(yr(a), ": ").concat((t = a, (r = c) == null || typeof r == "boolean" || r === "" ? "" : typeof r != "number" || r === 0 || t in $o || t.startsWith("--") ? String(r).trim() : "".concat(r, "px")), ";")));
1421
+ }
1422
+ return n;
1423
+ };
1424
+ function be(e, t, r, n) {
1425
+ if (pn(e)) return [];
1426
+ if (Kt(e)) return [".".concat(e.styledComponentId)];
1427
+ if (Ie(e)) {
1428
+ if (!Ie(c = e) || c.prototype && c.prototype.isReactComponent || !t) return [e];
1429
+ var a = e(t);
1430
+ return be(a, t, r, n);
1431
+ }
1432
+ var c;
1433
+ return e instanceof ea ? r ? (e.inject(r, n), [e.getName(n)]) : [e] : Be(e) ? fn(e) : Array.isArray(e) ? Array.prototype.concat.apply(dt, e.map(function(u) {
1434
+ return be(u, t, r, n);
1435
+ })) : [e.toString()];
1436
+ }
1437
+ function ra(e) {
1438
+ for (var t = 0; t < e.length; t += 1) {
1439
+ var r = e[t];
1440
+ if (Ie(r) && !Kt(r)) return !1;
1441
+ }
1442
+ return !0;
1443
+ }
1444
+ var na = rn(lt), oa = function() {
1445
+ function e(t, r, n) {
1446
+ this.rules = t, this.staticRulesId = "", this.isStatic = (n === void 0 || n.isStatic) && ra(t), this.componentId = r, this.baseHash = ve(na, r), this.baseStyle = n, ln.registerId(r);
1447
+ }
1448
+ return e.prototype.generateAndInjectStyles = function(t, r, n) {
1449
+ var a = this.baseStyle ? this.baseStyle.generateAndInjectStyles(t, r, n) : "";
1450
+ if (this.isStatic && !n.hash) if (this.staticRulesId && r.hasNameForId(this.componentId, this.staticRulesId)) a = me(a, this.staticRulesId);
1451
+ else {
1452
+ var c = mr(be(this.rules, t, r, n)), u = Rt(ve(this.baseHash, c) >>> 0);
1453
+ if (!r.hasNameForId(this.componentId, u)) {
1454
+ var d = n(c, ".".concat(u), void 0, this.componentId);
1455
+ r.insertRules(this.componentId, u, d);
1456
+ }
1457
+ a = me(a, u), this.staticRulesId = u;
1458
+ }
1459
+ else {
1460
+ for (var h = ve(this.baseHash, n.hash), g = "", b = 0; b < this.rules.length; b++) {
1461
+ var p = this.rules[b];
1462
+ if (typeof p == "string") g += p;
1463
+ else if (p) {
1464
+ var w = mr(be(p, t, r, n));
1465
+ h = ve(h, w + b), g += w;
1466
+ }
1467
+ }
1468
+ if (g) {
1469
+ var k = Rt(h >>> 0);
1470
+ r.hasNameForId(this.componentId, k) || r.insertRules(this.componentId, k, n(g, ".".concat(k), void 0, this.componentId)), a = me(a, k);
1471
+ }
1472
+ }
1473
+ return a;
1474
+ }, e;
1475
+ }(), hn = F.createContext(void 0);
1476
+ hn.Consumer;
1477
+ var kt = {};
1478
+ function aa(e, t, r) {
1479
+ var n = Kt(e), a = e, c = !yt(e), u = t.attrs, d = u === void 0 ? dt : u, h = t.componentId, g = h === void 0 ? function(f, m) {
1480
+ var y = typeof f != "string" ? "sc" : dr(f);
1481
+ kt[y] = (kt[y] || 0) + 1;
1482
+ var x = "".concat(y, "-").concat(To(lt + y + kt[y]));
1483
+ return m ? "".concat(m, "-").concat(x) : x;
1484
+ }(t.displayName, t.parentComponentId) : h, b = t.displayName, p = b === void 0 ? function(f) {
1485
+ return yt(f) ? "styled.".concat(f) : "Styled(".concat(Eo(f), ")");
1486
+ }(e) : b, w = t.displayName && t.componentId ? "".concat(dr(t.displayName), "-").concat(t.componentId) : t.componentId || g, k = n && a.attrs ? a.attrs.concat(d).filter(Boolean) : d, $ = t.shouldForwardProp;
1487
+ if (n && a.shouldForwardProp) {
1488
+ var j = a.shouldForwardProp;
1489
+ if (t.shouldForwardProp) {
1490
+ var S = t.shouldForwardProp;
1491
+ $ = function(f, m) {
1492
+ return j(f, m) && S(f, m);
1493
+ };
1494
+ } else $ = j;
1495
+ }
1496
+ var o = new oa(r, w, n ? a.componentStyle : void 0);
1497
+ function i(f, m) {
1498
+ return function(y, x, A) {
1499
+ var M = y.attrs, C = y.componentStyle, E = y.defaultProps, K = y.foldedComponentIds, P = y.styledComponentId, I = y.target, D = F.useContext(hn), H = xr(), v = y.shouldForwardProp || H.shouldForwardProp, N = Co(x, D, E) || je, R = function(Q, V, ie) {
1500
+ for (var ye, ce = X(X({}, V), { className: void 0, theme: ie }), ke = 0; ke < Q.length; ke += 1) {
1501
+ var ne = Ie(ye = Q[ke]) ? ye(ce) : ye;
1502
+ for (var ee in ne) ce[ee] = ee === "className" ? me(ce[ee], ne[ee]) : ee === "style" ? X(X({}, ce[ee]), ne[ee]) : ne[ee];
1503
+ }
1504
+ return V.className && (ce.className = me(ce.className, V.className)), ce;
1505
+ }(M, x, N), W = R.as || I, O = {};
1506
+ for (var q in R) R[q] === void 0 || q[0] === "$" || q === "as" || q === "theme" && R.theme === N || (q === "forwardedAs" ? O.as = R.forwardedAs : v && !v(q, W) || (O[q] = R[q]));
1507
+ var z = function(Q, V) {
1508
+ var ie = xr(), ye = Q.generateAndInjectStyles(V, ie.styleSheet, ie.stylis);
1509
+ return ye;
1510
+ }(C, R), U = me(K, P);
1511
+ return z && (U += " " + z), R.className && (U += " " + R.className), O[yt(W) && !en.has(W) ? "class" : "className"] = U, A && (O.ref = A), Ze(W, O);
1512
+ }(s, f, m);
1513
+ }
1514
+ i.displayName = p;
1515
+ var s = F.forwardRef(i);
1516
+ return s.attrs = k, s.componentStyle = o, s.displayName = p, s.shouldForwardProp = $, s.foldedComponentIds = n ? me(a.foldedComponentIds, a.styledComponentId) : "", s.styledComponentId = w, s.target = n ? a.target : e, Object.defineProperty(s, "defaultProps", { get: function() {
1517
+ return this._foldedDefaultProps;
1518
+ }, set: function(f) {
1519
+ this._foldedDefaultProps = n ? function(m) {
1520
+ for (var y = [], x = 1; x < arguments.length; x++) y[x - 1] = arguments[x];
1521
+ for (var A = 0, M = y; A < M.length; A++) zt(m, M[A], !0);
1522
+ return m;
1523
+ }({}, a.defaultProps, f) : f;
1524
+ } }), Wt(s, function() {
1525
+ return ".".concat(s.styledComponentId);
1526
+ }), c && sn(s, e, { attrs: !0, componentStyle: !0, displayName: !0, foldedComponentIds: !0, shouldForwardProp: !0, styledComponentId: !0, target: !0 }), s;
1527
+ }
1528
+ function kr(e, t) {
1529
+ for (var r = [e[0]], n = 0, a = t.length; n < a; n += 1) r.push(t[n], e[n + 1]);
1530
+ return r;
1531
+ }
1532
+ var wr = function(e) {
1533
+ return Object.assign(e, { isCss: !0 });
1534
+ };
1535
+ function sa(e) {
1536
+ for (var t = [], r = 1; r < arguments.length; r++) t[r - 1] = arguments[r];
1537
+ if (Ie(e) || Be(e)) return wr(be(kr(dt, Je([e], t, !0))));
1538
+ var n = e;
1539
+ return t.length === 0 && n.length === 1 && typeof n[0] == "string" ? be(n) : wr(be(kr(n, t)));
1540
+ }
1541
+ function Nt(e, t, r) {
1542
+ if (r === void 0 && (r = je), !t) throw Pe(1, t);
1543
+ var n = function(a) {
1544
+ for (var c = [], u = 1; u < arguments.length; u++) c[u - 1] = arguments[u];
1545
+ return e(t, r, sa.apply(void 0, Je([a], c, !1)));
1546
+ };
1547
+ return n.attrs = function(a) {
1548
+ return Nt(e, t, X(X({}, r), { attrs: Array.prototype.concat(r.attrs, a).filter(Boolean) }));
1549
+ }, n.withConfig = function(a) {
1550
+ return Nt(e, t, X(X({}, r), a));
1551
+ }, n;
1552
+ }
1553
+ var mn = function(e) {
1554
+ return Nt(aa, e);
1555
+ }, T = mn;
1556
+ en.forEach(function(e) {
1557
+ T[e] = mn(e);
1558
+ });
1559
+ const ia = T.div`
1560
+ display: flex;
1561
+ flex-wrap: wrap;
1562
+ gap: 6px;
1563
+ margin-bottom: 6px;
1564
+ `, ca = T.div`
1565
+ display: inline-flex;
1566
+ align-items: center;
1567
+ gap: 6px;
1568
+ max-width: 220px;
1569
+ padding: 4px 8px;
1570
+ border-radius: 8px;
1571
+ font-size: 12px;
1572
+ background: ${(e) => e.$isImage ? "rgba(59, 130, 246, 0.12)" : "rgba(107, 114, 128, 0.12)"};
1573
+ color: #374151;
1574
+ border: 1px solid #e5e7eb;
1575
+
1576
+ [data-theme='dark'] & {
1577
+ color: #e5e7eb;
1578
+ border-color: #4b5563;
1579
+ background: ${(e) => e.$isImage ? "rgba(59, 130, 246, 0.2)" : "rgba(107, 114, 128, 0.25)"};
1580
+ }
1581
+ `, la = T.img`
1582
+ width: 28px;
1583
+ height: 28px;
1584
+ object-fit: cover;
1585
+ border-radius: 4px;
1586
+ `, da = T.span`
1587
+ overflow: hidden;
1588
+ text-overflow: ellipsis;
1589
+ white-space: nowrap;
1590
+ flex: 1;
1591
+ min-width: 0;
1592
+ `, ua = T.button`
1593
+ display: flex;
1594
+ align-items: center;
1595
+ justify-content: center;
1596
+ padding: 2px;
1597
+ border: none;
1598
+ background: transparent;
1599
+ cursor: pointer;
1600
+ color: #6b7280;
1601
+ border-radius: 4px;
1602
+
1603
+ &:hover {
1604
+ color: #ef4444;
1605
+ background: rgba(239, 68, 68, 0.1);
1606
+ }
1607
+ `;
1608
+ function Ae({ attachments: e, onRemove: t, readOnly: r }) {
1609
+ return e.length ? /* @__PURE__ */ l.jsx(ia, { children: e.map((n) => {
1610
+ const a = n.type === "image", c = a && (n.preview || n.url);
1611
+ return /* @__PURE__ */ l.jsxs(ca, { $isImage: a, title: n.name, children: [
1612
+ c ? /* @__PURE__ */ l.jsx(la, { src: n.preview || n.url, alt: "", loading: "lazy", decoding: "async" }) : a ? /* @__PURE__ */ l.jsx(Xn, { size: 16, "aria-hidden": !0 }) : /* @__PURE__ */ l.jsx(Zn, { size: 16, "aria-hidden": !0 }),
1613
+ /* @__PURE__ */ l.jsx(da, { children: n.name }),
1614
+ !r && t && /* @__PURE__ */ l.jsx(ua, { type: "button", onClick: () => t(n.id), "aria-label": `Remove ${n.name}`, children: /* @__PURE__ */ l.jsx(no, { size: 14 }) })
1615
+ ] }, n.id);
1616
+ }) }) : null;
1617
+ }
1618
+ const gn = [
1619
+ "application/pdf",
1620
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
1621
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1622
+ "application/vnd.ms-excel",
1623
+ "text/csv",
1624
+ "text/plain",
1625
+ "text/markdown",
1626
+ "application/json",
1627
+ "image/png",
1628
+ "image/jpeg",
1629
+ "image/webp",
1630
+ "image/gif"
1631
+ ], pa = {
1632
+ ".pdf": "application/pdf",
1633
+ ".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
1634
+ ".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1635
+ ".xls": "application/vnd.ms-excel",
1636
+ ".csv": "text/csv",
1637
+ ".txt": "text/plain",
1638
+ ".md": "text/markdown",
1639
+ ".json": "application/json",
1640
+ ".png": "image/png",
1641
+ ".jpg": "image/jpeg",
1642
+ ".jpeg": "image/jpeg",
1643
+ ".webp": "image/webp",
1644
+ ".gif": "image/gif"
1645
+ };
1646
+ function fa(e) {
1647
+ const t = e.lastIndexOf(".");
1648
+ if (!(t < 0))
1649
+ return pa[e.slice(t).toLowerCase()];
1650
+ }
1651
+ async function Ut(e) {
1652
+ var r;
1653
+ if (!e) return [];
1654
+ const t = [];
1655
+ if ((r = e.files) != null && r.length)
1656
+ for (let n = 0; n < e.files.length; n++)
1657
+ t.push(e.files[n]);
1658
+ return t;
1659
+ }
1660
+ function bn(e, t, r) {
1661
+ if (e.size > t)
1662
+ return `File too large (max ${Math.floor(t / (1024 * 1024))}MB)`;
1663
+ if (r.includes(e.type)) return null;
1664
+ const n = fa(e.name);
1665
+ return n && r.includes(n) ? null : "File type not allowed for attachments";
1666
+ }
1667
+ const ha = T.button`
1668
+ display: flex;
1669
+ align-items: center;
1670
+ justify-content: center;
1671
+ width: 36px;
1672
+ height: 36px;
1673
+ min-width: 36px;
1674
+ min-height: 36px;
1675
+ border-radius: 8px;
1676
+ border: 1px solid #d1d5db;
1677
+ background: #f9fafb;
1678
+ color: #374151;
1679
+ cursor: pointer;
1680
+ flex-shrink: 0;
1681
+ transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
1682
+
1683
+ &:hover:not(:disabled) {
1684
+ background: #f3f4f6;
1685
+ border-color: #9ca3af;
1686
+ }
1687
+
1688
+ &:disabled {
1689
+ opacity: 0.45;
1690
+ cursor: not-allowed;
1691
+ }
1692
+
1693
+ [data-theme='dark'] & {
1694
+ background: #374151;
1695
+ border-color: #4b5563;
1696
+ color: #e5e7eb;
1697
+ }
1698
+ `, ma = T.button`
1699
+ display: flex;
1700
+ align-items: center;
1701
+ justify-content: center;
1702
+ width: 28px;
1703
+ height: 28px;
1704
+ min-width: 28px;
1705
+ min-height: 28px;
1706
+ border: none;
1707
+ border-radius: 8px;
1708
+ background: transparent;
1709
+ color: #64748b;
1710
+ cursor: pointer;
1711
+ flex-shrink: 0;
1712
+ transition: background 0.2s ease, color 0.2s ease;
1713
+
1714
+ &:hover:not(:disabled) {
1715
+ background: rgba(15, 23, 42, 0.06);
1716
+ color: #334155;
1717
+ }
1718
+
1719
+ &:disabled {
1720
+ opacity: 0.45;
1721
+ cursor: not-allowed;
1722
+ }
1723
+
1724
+ @media (prefers-color-scheme: dark) {
1725
+ color: #94a3b8;
1726
+
1727
+ &:hover:not(:disabled) {
1728
+ background: rgba(255, 255, 255, 0.08);
1729
+ color: #e2e8f0;
1730
+ }
1731
+ }
1732
+
1733
+ [data-theme='dark'] & {
1734
+ color: #94a3b8;
1735
+
1736
+ &:hover:not(:disabled) {
1737
+ background: rgba(255, 255, 255, 0.08);
1738
+ color: #e2e8f0;
1739
+ }
1740
+ }
1741
+ `;
1742
+ function Ht({
1743
+ disabled: e,
1744
+ integrated: t = !1,
1745
+ maxFileBytes: r,
1746
+ maxFiles: n,
1747
+ allowedMime: a = gn,
1748
+ currentCount: c,
1749
+ uploadAttachment: u,
1750
+ onUploaded: d,
1751
+ onError: h
1752
+ }) {
1753
+ const g = F.useRef(null), [b, p] = F.useState(!1), w = F.useMemo(
1754
+ () => [
1755
+ ".pdf,.docx,.xlsx,.xls,.csv,.txt,.md,.json",
1756
+ "image/png,image/jpeg,image/webp,image/gif"
1757
+ ].join(","),
1758
+ []
1759
+ ), k = F.useCallback(
1760
+ async (i) => {
1761
+ const s = Array.from(i);
1762
+ if (!s.length) return;
1763
+ let f = 0;
1764
+ for (const m of s) {
1765
+ if (c + f >= n) {
1766
+ h == null || h(`You can attach at most ${n} files per message.`);
1767
+ break;
1768
+ }
1769
+ const y = bn(m, r, a);
1770
+ if (y) {
1771
+ h == null || h(`${m.name}: ${y}`);
1772
+ continue;
1773
+ }
1774
+ try {
1775
+ p(!0);
1776
+ const x = await u(m);
1777
+ d(x), f += 1;
1778
+ } catch (x) {
1779
+ const A = x instanceof Error ? x.message : "Upload failed";
1780
+ h == null || h(A);
1781
+ } finally {
1782
+ p(!1);
1783
+ }
1784
+ }
1785
+ },
1786
+ [a, c, r, n, h, d, u]
1787
+ ), $ = (i) => {
1788
+ const s = i.target.files;
1789
+ s != null && s.length && k(s), i.target.value = "";
1790
+ }, j = c >= n, S = !!(e || b || j), o = t ? ma : ha;
1791
+ return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
1792
+ /* @__PURE__ */ l.jsx(
1793
+ "input",
1794
+ {
1795
+ ref: g,
1796
+ type: "file",
1797
+ multiple: !0,
1798
+ accept: w,
1799
+ style: { display: "none" },
1800
+ onChange: $
1801
+ }
1802
+ ),
1803
+ /* @__PURE__ */ l.jsx(
1804
+ o,
1805
+ {
1806
+ type: "button",
1807
+ disabled: S,
1808
+ "aria-label": "Attach file",
1809
+ title: "Attach file",
1810
+ onClick: () => {
1811
+ var i;
1812
+ return (i = g.current) == null ? void 0 : i.click();
1813
+ },
1814
+ children: /* @__PURE__ */ l.jsx(to, { size: 16, strokeWidth: 2 })
1815
+ }
1816
+ )
1817
+ ] });
1818
+ }
1819
+ function he() {
1820
+ return he = Object.assign ? Object.assign.bind() : function(e) {
1821
+ for (var t = 1; t < arguments.length; t++) {
1822
+ var r = arguments[t];
1823
+ for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
1824
+ }
1825
+ return e;
1826
+ }, he.apply(this, arguments);
1827
+ }
1828
+ const ga = ["children", "options"], vr = ["allowFullScreen", "allowTransparency", "autoComplete", "autoFocus", "autoPlay", "cellPadding", "cellSpacing", "charSet", "classId", "colSpan", "contentEditable", "contextMenu", "crossOrigin", "encType", "formAction", "formEncType", "formMethod", "formNoValidate", "formTarget", "frameBorder", "hrefLang", "inputMode", "keyParams", "keyType", "marginHeight", "marginWidth", "maxLength", "mediaGroup", "minLength", "noValidate", "radioGroup", "readOnly", "rowSpan", "spellCheck", "srcDoc", "srcLang", "srcSet", "tabIndex", "useMap"].reduce((e, t) => (e[t.toLowerCase()] = t, e), { class: "className", for: "htmlFor" }), $r = { amp: "&", apos: "'", gt: ">", lt: "<", nbsp: " ", quot: "“" }, ba = ["style", "script", "pre"], xa = ["src", "href", "data", "formAction", "srcDoc", "action"], ya = /([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi, ka = /mailto:/i, wa = /\n{2,}$/, Sr = /^(\s*>[\s\S]*?)(?=\n\n|$)/, va = /^ *> ?/gm, $a = /^(?:\[!([^\]]*)\]\n)?([\s\S]*)/, Sa = /^ {2,}\n/, Ca = /^(?:( *[-*_])){3,} *(?:\n *)+\n/, Cr = /^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/, jr = /^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/, ja = /^(`+)((?:\\`|(?!\1)`|[^`])+)\1/, Ia = /^(?:\n *)*\n/, Aa = /\r\n?/g, Ta = /^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/, Ea = /^\[\^([^\]]+)]/, Ma = /\f/g, _a = /^---[ \t]*\n(.|\n)*\n---[ \t]*\n/, Ra = /^\s*?\[(x|\s)\]/, Ir = /^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/, Ar = /^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/, Tr = /^([^\n]+)\n *(=|-){3,} *\n/, wt = /^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i, za = /&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi, Er = /^<!--[\s\S]*?(?:-->)/, Da = /^(data|aria|x)-[a-z_][a-z\d_.-]*$/, vt = /^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i, Na = /^\{.*\}$/, Oa = /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, Ba = /^<([^ >]+@[^ >]+)>/, Pa = /^<([^ >]+:\/[^ >]+)>/, La = /-([a-z])?/gi, Mr = /^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/, Fa = /^[^\n]+(?: \n|\n{2,})/, Ka = /^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/, Wa = /^!\[([^\]]*)\] ?\[([^\]]*)\]/, Ua = /^\[([^\]]*)\] ?\[([^\]]*)\]/, Ha = /(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/, qa = /\t/g, Ga = /(^ *\||\| *$)/g, Ya = /^ *:-+: *$/, Qa = /^ *:-+ *$/, Va = /^ *-+: *$/, ut = (e) => `(?=[\\s\\S]+?\\1${e ? "\\1" : ""})`, pt = "((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)", Za = RegExp(`^([*_])\\1${ut(1)}${pt}\\1\\1(?!\\1)`), Ja = RegExp(`^([*_])${ut(0)}${pt}\\1(?!\\1)`), Xa = RegExp(`^(==)${ut(0)}${pt}\\1`), es = RegExp(`^(~~)${ut(0)}${pt}\\1`), ts = /^(:[a-zA-Z0-9-_]+:)/, rs = /^\\([^0-9A-Za-z\s])/, ns = /\\([^0-9A-Za-z\s])/g, os = /^[\s\S](?:(?! \n|[0-9]\.|http)[^=*_~\-\n:<`\\\[!])*/, as = /^\n+/, ss = /^([ \t]*)/, is = /(?:^|\n)( *)$/, qt = "(?:\\d+\\.)", Gt = "(?:[*+-])";
1829
+ function xn(e) {
1830
+ return "( *)(" + (e === 1 ? qt : Gt) + ") +";
1831
+ }
1832
+ const yn = xn(1), kn = xn(2);
1833
+ function wn(e) {
1834
+ return RegExp("^" + (e === 1 ? yn : kn));
1835
+ }
1836
+ const cs = wn(1), ls = wn(2);
1837
+ function vn(e) {
1838
+ return RegExp("^" + (e === 1 ? yn : kn) + "[^\\n]*(?:\\n(?!\\1" + (e === 1 ? qt : Gt) + " )[^\\n]*)*(\\n|$)", "gm");
1839
+ }
1840
+ const ds = vn(1), us = vn(2);
1841
+ function $n(e) {
1842
+ const t = e === 1 ? qt : Gt;
1843
+ return RegExp("^( *)(" + t + ") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1" + t + " (?!" + t + " ))\\n*|\\s*\\n*$)");
1844
+ }
1845
+ const Sn = $n(1), Cn = $n(2);
1846
+ function _r(e, t) {
1847
+ const r = t === 1, n = r ? Sn : Cn, a = r ? ds : us, c = r ? cs : ls;
1848
+ return { t: (u) => c.test(u), o: Te(function(u, d) {
1849
+ const h = is.exec(d.prevCapture);
1850
+ return h && (d.list || !d.inline && !d.simple) ? n.exec(u = h[1] + u) : null;
1851
+ }), i: 1, u(u, d, h) {
1852
+ const g = r ? +u[2] : void 0, b = u[0].replace(wa, `
1853
+ `).match(a);
1854
+ let p = !1;
1855
+ return { items: b.map(function(w, k) {
1856
+ const $ = c.exec(w)[0].length, j = RegExp("^ {1," + $ + "}", "gm"), S = w.replace(j, "").replace(c, ""), o = k === b.length - 1, i = S.indexOf(`
1857
+
1858
+ `) !== -1 || o && p;
1859
+ p = i;
1860
+ const s = h.inline, f = h.list;
1861
+ let m;
1862
+ h.list = !0, i ? (h.inline = !1, m = Oe(S) + `
1863
+
1864
+ `) : (h.inline = !0, m = Oe(S));
1865
+ const y = d(m, h);
1866
+ return h.inline = s, h.list = f, y;
1867
+ }), ordered: r, start: g };
1868
+ }, l: (u, d, h) => e(u.ordered ? "ol" : "ul", { key: h.key, start: u.type === "20" ? u.start : void 0 }, u.items.map(function(g, b) {
1869
+ return e("li", { key: b }, d(g, h));
1870
+ })) };
1871
+ }
1872
+ const ps = RegExp(`^\\[((?:\\[[^\\[\\]]*(?:\\[[^\\[\\]]*\\][^\\[\\]]*)*\\]|[^\\[\\]])*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['"]([\\s\\S]*?)['"])?\\s*\\)`), fs = /^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/;
1873
+ function Oe(e) {
1874
+ let t = e.length;
1875
+ for (; t > 0 && e[t - 1] <= " "; ) t--;
1876
+ return e.slice(0, t);
1877
+ }
1878
+ function Qe(e, t) {
1879
+ return e.startsWith(t);
1880
+ }
1881
+ function hs(e, t, r) {
1882
+ if (Array.isArray(r)) {
1883
+ for (let n = 0; n < r.length; n++) if (Qe(e, r[n])) return !0;
1884
+ return !1;
1885
+ }
1886
+ return r(e, t);
1887
+ }
1888
+ function Re(e) {
1889
+ return e.replace(/[ÀÁÂÃÄÅàáâãä忯]/g, "a").replace(/[çÇ]/g, "c").replace(/[ðÐ]/g, "d").replace(/[ÈÉÊËéèêë]/g, "e").replace(/[ÏïÎîÍíÌì]/g, "i").replace(/[Ññ]/g, "n").replace(/[øØœŒÕõÔôÓóÒò]/g, "o").replace(/[ÜüÛûÚúÙù]/g, "u").replace(/[ŸÿÝý]/g, "y").replace(/[^a-z0-9- ]/gi, "").replace(/ /gi, "-").toLowerCase();
1890
+ }
1891
+ function ms(e) {
1892
+ return Va.test(e) ? "right" : Ya.test(e) ? "center" : Qa.test(e) ? "left" : null;
1893
+ }
1894
+ function Rr(e, t, r, n) {
1895
+ const a = r.inTable;
1896
+ r.inTable = !0;
1897
+ let c = [[]], u = "";
1898
+ function d() {
1899
+ if (!u) return;
1900
+ const h = c[c.length - 1];
1901
+ h.push.apply(h, t(u, r)), u = "";
1902
+ }
1903
+ return e.trim().split(/(`[^`]*`|\\\||\|)/).filter(Boolean).forEach((h, g, b) => {
1904
+ h.trim() === "|" && (d(), n) ? g !== 0 && g !== b.length - 1 && c.push([]) : u += h;
1905
+ }), d(), r.inTable = a, c;
1906
+ }
1907
+ function gs(e, t, r) {
1908
+ r.inline = !0;
1909
+ const n = e[2] ? e[2].replace(Ga, "").split("|").map(ms) : [], a = e[3] ? function(u, d, h) {
1910
+ return u.trim().split(`
1911
+ `).map(function(g) {
1912
+ return Rr(g, d, h, !0);
1913
+ });
1914
+ }(e[3], t, r) : [], c = Rr(e[1], t, r, !!a.length);
1915
+ return r.inline = !1, a.length ? { align: n, cells: a, header: c, type: "25" } : { children: c, type: "21" };
1916
+ }
1917
+ function zr(e, t) {
1918
+ return e.align[t] == null ? {} : { textAlign: e.align[t] };
1919
+ }
1920
+ function Te(e) {
1921
+ return e.inline = 1, e;
1922
+ }
1923
+ function ue(e) {
1924
+ return Te(function(t, r) {
1925
+ return r.inline ? e.exec(t) : null;
1926
+ });
1927
+ }
1928
+ function pe(e) {
1929
+ return Te(function(t, r) {
1930
+ return r.inline || r.simple ? e.exec(t) : null;
1931
+ });
1932
+ }
1933
+ function le(e) {
1934
+ return function(t, r) {
1935
+ return r.inline || r.simple ? null : e.exec(t);
1936
+ };
1937
+ }
1938
+ function Ke(e) {
1939
+ return Te(function(t) {
1940
+ return e.exec(t);
1941
+ });
1942
+ }
1943
+ const bs = /(javascript|vbscript|data(?!:image)):/i;
1944
+ function xs(e) {
1945
+ try {
1946
+ const t = decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g, "");
1947
+ if (bs.test(t)) return null;
1948
+ } catch {
1949
+ return null;
1950
+ }
1951
+ return e;
1952
+ }
1953
+ function oe(e) {
1954
+ return e && e.replace(ns, "$1");
1955
+ }
1956
+ function Ve(e, t, r) {
1957
+ const n = r.inline || !1, a = r.simple || !1;
1958
+ r.inline = !0, r.simple = !0;
1959
+ const c = e(t, r);
1960
+ return r.inline = n, r.simple = a, c;
1961
+ }
1962
+ function ys(e, t, r) {
1963
+ const n = r.inline || !1, a = r.simple || !1;
1964
+ r.inline = !1, r.simple = !0;
1965
+ const c = e(t, r);
1966
+ return r.inline = n, r.simple = a, c;
1967
+ }
1968
+ function ks(e, t, r) {
1969
+ const n = r.inline || !1;
1970
+ r.inline = !1;
1971
+ const a = e(t, r);
1972
+ return r.inline = n, a;
1973
+ }
1974
+ const $t = (e, t, r) => ({ children: Ve(t, e[2], r) });
1975
+ function St() {
1976
+ return {};
1977
+ }
1978
+ function Ct() {
1979
+ return null;
1980
+ }
1981
+ function ws(...e) {
1982
+ return e.filter(Boolean).join(" ");
1983
+ }
1984
+ function jt(e, t, r) {
1985
+ let n = e;
1986
+ const a = t.split(".");
1987
+ for (; a.length && (n = n[a[0]], n !== void 0); ) a.shift();
1988
+ return n || r;
1989
+ }
1990
+ function vs(e = "", t = {}) {
1991
+ t.overrides = t.overrides || {}, t.namedCodesToUnicode = t.namedCodesToUnicode ? he({}, $r, t.namedCodesToUnicode) : $r;
1992
+ const r = t.slugify || Re, n = t.sanitizer || xs, a = t.createElement || Ot.createElement, c = [Sr, Cr, jr, t.enforceAtxHeadings ? Ar : Ir, Tr, Mr, Sn, Cn], u = [...c, Fa, wt, Er, vt];
1993
+ function d(o, i, ...s) {
1994
+ const f = jt(t.overrides, o + ".props", {});
1995
+ return a(function(m, y) {
1996
+ const x = jt(y, m);
1997
+ return x ? typeof x == "function" || typeof x == "object" && "render" in x ? x : jt(y, m + ".component", m) : m;
1998
+ }(o, t.overrides), he({}, i, f, { className: ws(i == null ? void 0 : i.className, f.className) || void 0 }), ...s);
1999
+ }
2000
+ function h(o) {
2001
+ o = o.replace(_a, "");
2002
+ let i = !1;
2003
+ t.forceInline ? i = !0 : t.forceBlock || (i = Ha.test(o) === !1);
2004
+ const s = $(k(i ? o : Oe(o).replace(as, "") + `
2005
+
2006
+ `, { inline: i }));
2007
+ for (; typeof s[s.length - 1] == "string" && !s[s.length - 1].trim(); ) s.pop();
2008
+ if (t.wrapper === null) return s;
2009
+ const f = t.wrapper || (i ? "span" : "div");
2010
+ let m;
2011
+ if (s.length > 1 || t.forceWrapper) m = s;
2012
+ else {
2013
+ if (s.length === 1) return m = s[0], typeof m == "string" ? d("span", { key: "outer" }, m) : m;
2014
+ m = null;
2015
+ }
2016
+ return a(f, { key: "outer" }, m);
2017
+ }
2018
+ function g(o, i) {
2019
+ if (!i || !i.trim()) return null;
2020
+ const s = i.match(ya);
2021
+ return s ? s.reduce(function(f, m) {
2022
+ const y = m.indexOf("=");
2023
+ if (y !== -1) {
2024
+ const x = function(E) {
2025
+ return E.indexOf("-") !== -1 && E.match(Da) === null && (E = E.replace(La, function(K, P) {
2026
+ return P.toUpperCase();
2027
+ })), E;
2028
+ }(m.slice(0, y)).trim(), A = function(E) {
2029
+ const K = E[0];
2030
+ return (K === '"' || K === "'") && E.length >= 2 && E[E.length - 1] === K ? E.slice(1, -1) : E;
2031
+ }(m.slice(y + 1).trim()), M = vr[x] || x;
2032
+ if (M === "ref") return f;
2033
+ const C = f[M] = function(E, K, P, I) {
2034
+ return K === "style" ? function(D) {
2035
+ const H = [];
2036
+ let v = "", N = !1, R = !1, W = "";
2037
+ if (!D) return H;
2038
+ for (let q = 0; q < D.length; q++) {
2039
+ const z = D[q];
2040
+ if (z !== '"' && z !== "'" || N || (R ? z === W && (R = !1, W = "") : (R = !0, W = z)), z === "(" && v.endsWith("url") ? N = !0 : z === ")" && N && (N = !1), z !== ";" || R || N) v += z;
2041
+ else {
2042
+ const U = v.trim();
2043
+ if (U) {
2044
+ const Q = U.indexOf(":");
2045
+ if (Q > 0) {
2046
+ const V = U.slice(0, Q).trim(), ie = U.slice(Q + 1).trim();
2047
+ H.push([V, ie]);
2048
+ }
2049
+ }
2050
+ v = "";
2051
+ }
2052
+ }
2053
+ const O = v.trim();
2054
+ if (O) {
2055
+ const q = O.indexOf(":");
2056
+ if (q > 0) {
2057
+ const z = O.slice(0, q).trim(), U = O.slice(q + 1).trim();
2058
+ H.push([z, U]);
2059
+ }
2060
+ }
2061
+ return H;
2062
+ }(P).reduce(function(D, [H, v]) {
2063
+ return D[H.replace(/(-[a-z])/g, (N) => N[1].toUpperCase())] = I(v, E, H), D;
2064
+ }, {}) : xa.indexOf(K) !== -1 ? I(oe(P), E, K) : (P.match(Na) && (P = oe(P.slice(1, P.length - 1))), P === "true" || P !== "false" && P);
2065
+ }(o, x, A, n);
2066
+ typeof C == "string" && (wt.test(C) || vt.test(C)) && (f[M] = h(C.trim()));
2067
+ } else m !== "style" && (f[vr[m] || m] = !0);
2068
+ return f;
2069
+ }, {}) : null;
2070
+ }
2071
+ const b = [], p = {}, w = { 0: { t: [">"], o: le(Sr), i: 1, u(o, i, s) {
2072
+ const [, f, m] = o[0].replace(va, "").match($a);
2073
+ return { alert: f, children: i(m, s) };
2074
+ }, l(o, i, s) {
2075
+ const f = { key: s.key };
2076
+ return o.alert && (f.className = "markdown-alert-" + r(o.alert.toLowerCase(), Re), o.children.unshift({ attrs: {}, children: [{ type: "27", text: o.alert }], noInnerParse: !0, type: "11", tag: "header" })), d("blockquote", f, i(o.children, s));
2077
+ } }, 1: { o: Ke(Sa), i: 1, u: St, l: (o, i, s) => d("br", { key: s.key }) }, 2: { t: (o) => {
2078
+ const i = o[0];
2079
+ return i === "-" || i === "*" || i === "_";
2080
+ }, o: le(Ca), i: 1, u: St, l: (o, i, s) => d("hr", { key: s.key }) }, 3: { t: [" "], o: le(jr), i: 0, u: (o) => ({ lang: void 0, text: oe(Oe(o[0].replace(/^ {4}/gm, ""))) }), l: (o, i, s) => d("pre", { key: s.key }, d("code", he({}, o.attrs, { className: o.lang ? "lang-" + o.lang : "" }), o.text)) }, 4: { t: ["```", "~~~"], o: le(Cr), i: 0, u: (o) => ({ attrs: g("code", o[3] || ""), lang: o[2] || void 0, text: o[4], type: "3" }) }, 5: { t: ["`"], o: pe(ja), i: 3, u: (o) => ({ text: oe(o[2]) }), l: (o, i, s) => d("code", { key: s.key }, o.text) }, 6: { t: ["[^"], o: le(Ta), i: 0, u: (o) => (b.push({ footnote: o[2], identifier: o[1] }), {}), l: Ct }, 7: { t: ["[^"], o: ue(Ea), i: 1, u: (o) => ({ target: "#" + r(o[1], Re), text: o[1] }), l: (o, i, s) => d("a", { key: s.key, href: n(o.target, "a", "href") }, d("sup", { key: s.key }, o.text)) }, 8: { t: ["[ ]", "[x]"], o: ue(Ra), i: 1, u: (o) => ({ completed: o[1].toLowerCase() === "x" }), l: (o, i, s) => d("input", { checked: o.completed, key: s.key, readOnly: !0, type: "checkbox" }) }, 9: { t: ["#"], o: le(t.enforceAtxHeadings ? Ar : Ir), i: 1, u: (o, i, s) => ({ children: Ve(i, o[2], s), id: r(o[2], Re), level: o[1].length }), l: (o, i, s) => d("h" + o.level, { id: o.id, key: s.key }, i(o.children, s)) }, 10: { o: le(Tr), i: 0, u: (o, i, s) => ({ children: Ve(i, o[1], s), level: o[2] === "=" ? 1 : 2, type: "9" }) }, 11: { t: ["<"], o: Ke(wt), i: 1, u(o, i, s) {
2081
+ const [, f] = o[3].match(ss), m = RegExp("^" + f, "gm"), y = o[3].replace(m, ""), x = (A = y, u.some((P) => P.test(A)) ? ks : Ve);
2082
+ var A;
2083
+ const M = o[1].toLowerCase(), C = ba.indexOf(M) !== -1, E = (C ? M : o[1]).trim(), K = { attrs: g(E, o[2]), noInnerParse: C, tag: E };
2084
+ if (s.inAnchor = s.inAnchor || M === "a", C) K.text = o[3];
2085
+ else {
2086
+ const P = s.inHTML;
2087
+ s.inHTML = !0, K.children = x(i, y, s), s.inHTML = P;
2088
+ }
2089
+ return s.inAnchor = !1, K;
2090
+ }, l: (o, i, s) => d(o.tag, he({ key: s.key }, o.attrs), o.text || (o.children ? i(o.children, s) : "")) }, 13: { t: ["<"], o: Ke(vt), i: 1, u(o) {
2091
+ const i = o[1].trim();
2092
+ return { attrs: g(i, o[2] || ""), tag: i };
2093
+ }, l: (o, i, s) => d(o.tag, he({}, o.attrs, { key: s.key })) }, 12: { t: ["<!--"], o: Ke(Er), i: 1, u: () => ({}), l: Ct }, 14: { t: ["!["], o: pe(fs), i: 1, u: (o) => ({ alt: oe(o[1]), target: oe(o[2]), title: oe(o[3]) }), l: (o, i, s) => d("img", { key: s.key, alt: o.alt || void 0, title: o.title || void 0, src: n(o.target, "img", "src") }) }, 15: { t: ["["], o: ue(ps), i: 3, u: (o, i, s) => ({ children: ys(i, o[1], s), target: oe(o[2]), title: oe(o[3]) }), l: (o, i, s) => d("a", { key: s.key, href: n(o.target, "a", "href"), title: o.title }, i(o.children, s)) }, 16: { t: ["<"], o: ue(Pa), i: 0, u: (o) => ({ children: [{ text: o[1], type: "27" }], target: o[1], type: "15" }) }, 17: { t: (o, i) => !i.inAnchor && !t.disableAutoLink && (Qe(o, "http://") || Qe(o, "https://")), o: ue(Oa), i: 0, u: (o) => ({ children: [{ text: o[1], type: "27" }], target: o[1], title: void 0, type: "15" }) }, 18: { t: ["<"], o: ue(Ba), i: 0, u(o) {
2094
+ let i = o[1], s = o[1];
2095
+ return ka.test(s) || (s = "mailto:" + s), { children: [{ text: i.replace("mailto:", ""), type: "27" }], target: s, type: "15" };
2096
+ } }, 20: _r(d, 1), 33: _r(d, 2), 19: { o: le(Ia), i: 3, u: St, l: () => `
2097
+ ` }, 21: { o: Te(function(o, i) {
2098
+ if (i.inline || i.simple || i.inHTML && o.indexOf(`
2099
+
2100
+ `) === -1 && i.prevCapture.indexOf(`
2101
+
2102
+ `) === -1) return null;
2103
+ let s = "";
2104
+ o.split(`
2105
+ `).every((m) => (m += `
2106
+ `, !c.some((y) => y.test(m)) && (s += m, !!m.trim())));
2107
+ const f = Oe(s);
2108
+ return f === "" ? null : [s, , f];
2109
+ }), i: 3, u: $t, l: (o, i, s) => d("p", { key: s.key }, i(o.children, s)) }, 22: { t: ["["], o: ue(Ka), i: 0, u: (o) => (p[o[1]] = { target: o[2], title: o[4] }, {}), l: Ct }, 23: { t: ["!["], o: pe(Wa), i: 0, u: (o) => ({ alt: o[1] ? oe(o[1]) : void 0, ref: o[2] }), l: (o, i, s) => p[o.ref] ? d("img", { key: s.key, alt: o.alt, src: n(p[o.ref].target, "img", "src"), title: p[o.ref].title }) : null }, 24: { t: (o) => o[0] === "[" && o.indexOf("](") === -1, o: ue(Ua), i: 0, u: (o, i, s) => ({ children: i(o[1], s), fallbackChildren: o[0], ref: o[2] }), l: (o, i, s) => p[o.ref] ? d("a", { key: s.key, href: n(p[o.ref].target, "a", "href"), title: p[o.ref].title }, i(o.children, s)) : d("span", { key: s.key }, o.fallbackChildren) }, 25: { t: ["|"], o: le(Mr), i: 1, u: gs, l(o, i, s) {
2110
+ const f = o;
2111
+ return d("table", { key: s.key }, d("thead", null, d("tr", null, f.header.map(function(m, y) {
2112
+ return d("th", { key: y, style: zr(f, y) }, i(m, s));
2113
+ }))), d("tbody", null, f.cells.map(function(m, y) {
2114
+ return d("tr", { key: y }, m.map(function(x, A) {
2115
+ return d("td", { key: A, style: zr(f, A) }, i(x, s));
2116
+ }));
2117
+ })));
2118
+ } }, 27: { o: Te(function(o, i) {
2119
+ let s;
2120
+ return Qe(o, ":") && (s = ts.exec(o)), s || os.exec(o);
2121
+ }), i: 4, u(o) {
2122
+ const i = o[0];
2123
+ return { text: i.indexOf("&") === -1 ? i : i.replace(za, (s, f) => t.namedCodesToUnicode[f] || s) };
2124
+ }, l: (o) => o.text }, 28: { t: ["**", "__"], o: pe(Za), i: 2, u: (o, i, s) => ({ children: i(o[2], s) }), l: (o, i, s) => d("strong", { key: s.key }, i(o.children, s)) }, 29: { t: (o) => {
2125
+ const i = o[0];
2126
+ return (i === "*" || i === "_") && o[1] !== i;
2127
+ }, o: pe(Ja), i: 3, u: (o, i, s) => ({ children: i(o[2], s) }), l: (o, i, s) => d("em", { key: s.key }, i(o.children, s)) }, 30: { t: ["\\"], o: pe(rs), i: 1, u: (o) => ({ text: o[1], type: "27" }) }, 31: { t: ["=="], o: pe(Xa), i: 3, u: $t, l: (o, i, s) => d("mark", { key: s.key }, i(o.children, s)) }, 32: { t: ["~~"], o: pe(es), i: 3, u: $t, l: (o, i, s) => d("del", { key: s.key }, i(o.children, s)) } };
2128
+ t.disableParsingRawHTML === !0 && (delete w[11], delete w[13]);
2129
+ const k = function(o) {
2130
+ var i = Object.keys(o);
2131
+ function s(f, m) {
2132
+ var y = [];
2133
+ if (m.prevCapture = m.prevCapture || "", f.trim()) for (; f; ) for (var x = 0; x < i.length; ) {
2134
+ var A = i[x], M = o[A];
2135
+ if (!M.t || hs(f, m, M.t)) {
2136
+ var C = M.o(f, m);
2137
+ if (C && C[0]) {
2138
+ f = f.substring(C[0].length);
2139
+ var E = M.u(C, s, m);
2140
+ m.prevCapture += C[0], E.type || (E.type = A), y.push(E);
2141
+ break;
2142
+ }
2143
+ x++;
2144
+ } else x++;
2145
+ }
2146
+ return m.prevCapture = "", y;
2147
+ }
2148
+ return i.sort(function(f, m) {
2149
+ return o[f].i - o[m].i || (f < m ? -1 : 1);
2150
+ }), function(f, m) {
2151
+ return s(function(y) {
2152
+ return y.replace(Aa, `
2153
+ `).replace(Ma, "").replace(qa, " ");
2154
+ }(f), m);
2155
+ };
2156
+ }(w), $ = (j = /* @__PURE__ */ function(o, i) {
2157
+ return function(s, f, m) {
2158
+ const y = o[s.type].l;
2159
+ return i ? i(() => y(s, f, m), s, f, m) : y(s, f, m);
2160
+ };
2161
+ }(w, t.renderRule), function o(i, s = {}) {
2162
+ if (Array.isArray(i)) {
2163
+ const f = s.key, m = [];
2164
+ let y = !1;
2165
+ for (let x = 0; x < i.length; x++) {
2166
+ s.key = x;
2167
+ const A = o(i[x], s), M = typeof A == "string";
2168
+ M && y ? m[m.length - 1] += A : A !== null && m.push(A), y = M;
2169
+ }
2170
+ return s.key = f, m;
2171
+ }
2172
+ return j(i, o, s);
2173
+ });
2174
+ var j;
2175
+ const S = h(e);
2176
+ return b.length ? d("div", null, S, d("footer", { key: "footer" }, b.map(function(o) {
2177
+ return d("div", { id: r(o.identifier, Re), key: o.identifier }, o.identifier, $(k(o.footnote, { inline: !0 })));
2178
+ }))) : S;
2179
+ }
2180
+ const $s = (e) => {
2181
+ let { children: t = "", options: r } = e, n = function(a, c) {
2182
+ if (a == null) return {};
2183
+ var u, d, h = {}, g = Object.keys(a);
2184
+ for (d = 0; d < g.length; d++) c.indexOf(u = g[d]) >= 0 || (h[u] = a[u]);
2185
+ return h;
2186
+ }(e, ga);
2187
+ return Ot.cloneElement(vs(t, r), n);
2188
+ }, Ss = T.div`
2189
+ code {
2190
+ @media (prefers-color-scheme: dark) {
2191
+ background-color: #374151 !important;
2192
+ color: #e5e7eb !important;
2193
+ }
2194
+
2195
+ [data-theme="dark"] & {
2196
+ background-color: #374151 !important;
2197
+ color: #e5e7eb !important;
2198
+ }
2199
+ }
2200
+
2201
+ pre {
2202
+ @media (prefers-color-scheme: dark) {
2203
+ background-color: #374151 !important;
2204
+ color: #e5e7eb !important;
2205
+ }
2206
+
2207
+ [data-theme="dark"] & {
2208
+ background-color: #374151 !important;
2209
+ color: #e5e7eb !important;
2210
+ }
2211
+ }
2212
+
2213
+ blockquote {
2214
+ @media (prefers-color-scheme: dark) {
2215
+ background-color: #1e3a8a !important;
2216
+ border-left-color: #3b82f6 !important;
2217
+ color: #e5e7eb !important;
2218
+ }
2219
+
2220
+ [data-theme="dark"] & {
2221
+ background-color: #1e3a8a !important;
2222
+ border-left-color: #3b82f6 !important;
2223
+ color: #e5e7eb !important;
2224
+ }
2225
+ }
2226
+ `;
2227
+ function Yt({ content: e, className: t }) {
2228
+ return /* @__PURE__ */ l.jsx(Ss, { className: t, children: /* @__PURE__ */ l.jsx(
2229
+ $s,
2230
+ {
2231
+ options: {
2232
+ overrides: {
2233
+ // Custom styling for markdown elements with better spacing
2234
+ p: {
2235
+ props: {
2236
+ style: {
2237
+ marginBottom: "12px",
2238
+ lineHeight: "1.5",
2239
+ color: "inherit"
2240
+ }
2241
+ }
2242
+ },
2243
+ strong: {
2244
+ props: {
2245
+ style: {
2246
+ fontWeight: 700,
2247
+ color: "inherit"
2248
+ }
2249
+ }
2250
+ },
2251
+ em: {
2252
+ props: {
2253
+ style: {
2254
+ fontStyle: "italic",
2255
+ color: "inherit"
2256
+ }
2257
+ }
2258
+ },
2259
+ code: {
2260
+ props: {
2261
+ style: {
2262
+ backgroundColor: "#f3f4f6",
2263
+ padding: "2px 6px",
2264
+ borderRadius: "4px",
2265
+ fontSize: "14px",
2266
+ fontFamily: "monospace",
2267
+ color: "#111827"
2268
+ }
2269
+ }
2270
+ },
2271
+ pre: {
2272
+ props: {
2273
+ style: {
2274
+ backgroundColor: "#f3f4f6",
2275
+ padding: "12px",
2276
+ borderRadius: "6px",
2277
+ fontSize: "14px",
2278
+ fontFamily: "monospace",
2279
+ color: "#111827",
2280
+ overflowX: "auto",
2281
+ marginBottom: "12px"
2282
+ }
2283
+ }
2284
+ },
2285
+ ul: {
2286
+ props: {
2287
+ className: "list-disc list-inside mb-3 space-y-1 ml-2"
2288
+ }
2289
+ },
2290
+ ol: {
2291
+ props: {
2292
+ className: "list-decimal list-inside mb-3 space-y-1 ml-2"
2293
+ }
2294
+ },
2295
+ li: {
2296
+ props: {
2297
+ className: "leading-relaxed"
2298
+ }
2299
+ },
2300
+ blockquote: {
2301
+ props: {
2302
+ style: {
2303
+ borderLeft: "4px solid #93c5fd",
2304
+ paddingLeft: "16px",
2305
+ padding: "8px",
2306
+ fontStyle: "italic",
2307
+ marginBottom: "12px",
2308
+ backgroundColor: "#eff6ff",
2309
+ borderRadius: "4px",
2310
+ color: "inherit"
2311
+ }
2312
+ }
2313
+ },
2314
+ h1: {
2315
+ props: {
2316
+ style: {
2317
+ fontSize: "20px",
2318
+ fontWeight: 700,
2319
+ marginBottom: "12px",
2320
+ color: "inherit"
2321
+ }
2322
+ }
2323
+ },
2324
+ h2: {
2325
+ props: {
2326
+ style: {
2327
+ fontSize: "18px",
2328
+ fontWeight: 700,
2329
+ marginBottom: "8px",
2330
+ color: "inherit"
2331
+ }
2332
+ }
2333
+ },
2334
+ h3: {
2335
+ props: {
2336
+ style: {
2337
+ fontSize: "16px",
2338
+ fontWeight: 700,
2339
+ marginBottom: "8px",
2340
+ color: "inherit"
2341
+ }
2342
+ }
2343
+ },
2344
+ h4: {
2345
+ props: {
2346
+ style: {
2347
+ fontSize: "14px",
2348
+ fontWeight: 700,
2349
+ marginBottom: "8px",
2350
+ color: "inherit"
2351
+ }
2352
+ }
2353
+ },
2354
+ h5: {
2355
+ props: {
2356
+ style: {
2357
+ fontSize: "14px",
2358
+ fontWeight: 700,
2359
+ marginBottom: "8px",
2360
+ color: "inherit"
2361
+ }
2362
+ }
2363
+ },
2364
+ h6: {
2365
+ props: {
2366
+ style: {
2367
+ fontSize: "14px",
2368
+ fontWeight: 700,
2369
+ marginBottom: "8px",
2370
+ color: "inherit"
2371
+ }
2372
+ }
2373
+ },
2374
+ hr: {
2375
+ props: {
2376
+ style: {
2377
+ margin: "16px 0",
2378
+ borderColor: "#e5e7eb",
2379
+ borderWidth: "1px",
2380
+ borderStyle: "solid"
2381
+ }
2382
+ }
2383
+ },
2384
+ a: {
2385
+ props: {
2386
+ style: {
2387
+ color: "#2563eb",
2388
+ textDecoration: "underline"
2389
+ },
2390
+ target: "_blank",
2391
+ rel: "noopener noreferrer"
2392
+ }
2393
+ }
2394
+ }
2395
+ },
2396
+ children: e
2397
+ }
2398
+ ) });
2399
+ }
2400
+ const jn = T.div`
2401
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
2402
+ background-color: white;
2403
+ border: 1px solid #e5e7eb;
2404
+ min-height: 0;
2405
+
2406
+ /* Scoped CSS reset to prevent host page style leakage */
2407
+ & button,
2408
+ & input,
2409
+ & textarea,
2410
+ & select {
2411
+ margin: 0;
2412
+ padding: 0;
2413
+ border: none;
2414
+ background: none;
2415
+ box-sizing: border-box;
2416
+ font-family: inherit;
2417
+ font-size: inherit;
2418
+ font-weight: normal;
2419
+ line-height: normal;
2420
+ color: inherit;
2421
+ text-shadow: none;
2422
+ -webkit-appearance: none;
2423
+ appearance: none;
2424
+ }
2425
+
2426
+ /* Try both media query approaches */
2427
+ @media (prefers-color-scheme: dark) {
2428
+ background-color: #1f2937;
2429
+ border-color: #374151;
2430
+ }
2431
+
2432
+ /* Alternative approach using data attribute */
2433
+ &[data-theme="dark"] {
2434
+ background-color: #1f2937;
2435
+ border-color: #374151;
2436
+ }
2437
+ `, Ee = T.div`
2438
+ max-width: 80%;
2439
+ padding: 12px;
2440
+ border-radius: 8px;
2441
+ font-size: 14px;
2442
+ word-break: break-word;
2443
+ margin-left: ${(e) => e.$isUser ? "auto" : "0"};
2444
+ margin-right: ${(e) => e.$isUser ? "0" : "auto"};
2445
+ line-height: 1.5;
2446
+
2447
+ /* User message styles - Light mode */
2448
+ background-color: ${(e) => e.$isUser ? "#3b82f6" : "#f3f4f6"};
2449
+ color: ${(e) => e.$isUser ? "#ffffff" : "#111827"};
2450
+
2451
+ /* Ensure bold text has proper contrast */
2452
+ strong, b {
2453
+ font-weight: 600;
2454
+ color: inherit;
2455
+ }
2456
+
2457
+ /* Dark mode support - Media query */
2458
+ @media (prefers-color-scheme: dark) {
2459
+ background-color: ${(e) => e.$isUser ? "#3b82f6" : "transparent"};
2460
+ color: ${(e) => e.$isUser ? "#ffffff" : "#e5e7eb"};
2461
+
2462
+ strong, b {
2463
+ color: ${(e) => (e.$isUser, "#ffffff")};
2464
+ font-weight: 700;
2465
+ }
2466
+ }
2467
+
2468
+ /* Dark mode support - Data attribute (for ChatWindow/ChatWidget parents) */
2469
+ [data-theme="dark"] & {
2470
+ background-color: ${(e) => e.$isUser ? "#3b82f6" : "transparent"};
2471
+ color: ${(e) => e.$isUser ? "#ffffff" : "#e5e7eb"};
2472
+
2473
+ strong, b {
2474
+ color: ${(e) => (e.$isUser, "#ffffff")};
2475
+ font-weight: 700;
2476
+ }
2477
+ }
2478
+ `, Qt = T.div`
2479
+ display: flex;
2480
+ flex-direction: column;
2481
+ flex: 1;
2482
+ min-width: 0;
2483
+ border: 1px solid #e5e7eb;
2484
+ border-radius: 14px;
2485
+ background-color: #ffffff;
2486
+ overflow: hidden;
2487
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
2488
+
2489
+ &:focus-within {
2490
+ border-color: #9ca3af;
2491
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
2492
+ }
2493
+
2494
+ @media (prefers-color-scheme: dark) {
2495
+ background-color: #18181b;
2496
+ border-color: rgba(255, 255, 255, 0.1);
2497
+
2498
+ &:focus-within {
2499
+ border-color: rgba(255, 255, 255, 0.3);
2500
+ }
2501
+ }
2502
+
2503
+ [data-theme='dark'] & {
2504
+ background-color: #18181b;
2505
+ border-color: rgba(255, 255, 255, 0.1);
2506
+
2507
+ &:focus-within {
2508
+ border-color: rgba(255, 255, 255, 0.3);
2509
+ }
2510
+ }
2511
+ `, Vt = T.div`
2512
+ display: flex;
2513
+ align-items: center;
2514
+ justify-content: space-between;
2515
+ gap: 6px;
2516
+ flex-shrink: 0;
2517
+ padding: 6px 10px;
2518
+ border-top: 1px solid #e5e7eb;
2519
+ background-color: #f9fafb;
2520
+
2521
+ @media (prefers-color-scheme: dark) {
2522
+ border-top-color: #52525b;
2523
+ background-color: #3f3f46;
2524
+ }
2525
+
2526
+ [data-theme='dark'] & {
2527
+ border-top-color: #52525b;
2528
+ background-color: #3f3f46;
2529
+ }
2530
+ `, Cs = T.textarea`
2531
+ display: block;
2532
+ width: 100%;
2533
+ min-width: 0;
2534
+ min-height: 42px;
2535
+ max-height: 96px;
2536
+ padding: 8px 12px;
2537
+ border: none;
2538
+ border-radius: 0;
2539
+ background-color: transparent;
2540
+ color: #1f2937;
2541
+ font-size: 14px;
2542
+ line-height: 1.5;
2543
+ font-family: inherit;
2544
+ resize: none;
2545
+ outline: none;
2546
+ transition: color 0.2s ease;
2547
+ box-sizing: border-box;
2548
+ overflow-y: auto;
2549
+
2550
+ &::placeholder {
2551
+ color: #6b7280;
2552
+ }
2553
+
2554
+ &:disabled {
2555
+ opacity: 0.5;
2556
+ cursor: not-allowed;
2557
+ }
2558
+
2559
+ @media (prefers-color-scheme: dark) {
2560
+ color: #f9fafb;
2561
+
2562
+ &::placeholder {
2563
+ color: #9ca3af;
2564
+ }
2565
+ }
2566
+
2567
+ [data-theme='dark'] & {
2568
+ color: #f9fafb;
2569
+
2570
+ &::placeholder {
2571
+ color: #9ca3af;
2572
+ }
2573
+ }
2574
+ `, Zt = T.div`
2575
+ display: flex;
2576
+ align-items: center;
2577
+ gap: 8px;
2578
+ padding: 8px 12px 10px;
2579
+ border-top: 1px solid #e5e7eb;
2580
+ background-color: #ffffff;
2581
+
2582
+ @media (prefers-color-scheme: dark) {
2583
+ background-color: #1f2937;
2584
+ border-top-color: #374151;
2585
+ }
2586
+
2587
+ [data-theme="dark"] & {
2588
+ background-color: #1f2937;
2589
+ border-top-color: #374151;
2590
+ }
2591
+ `, js = T.textarea`
2592
+ flex: 1;
2593
+ width: 100%;
2594
+ min-height: 40px;
2595
+ max-height: 120px;
2596
+ padding: 8px 12px;
2597
+ border: 1px solid #d1d5db;
2598
+ border-radius: 6px;
2599
+ background-color: #ffffff;
2600
+ color: #1f2937;
2601
+ font-size: 14px;
2602
+ font-family: inherit;
2603
+ resize: none;
2604
+ outline: none;
2605
+ transition: all 0.2s ease;
2606
+
2607
+ &::placeholder {
2608
+ color: #6b7280;
2609
+ }
2610
+
2611
+ &:focus {
2612
+ border-color: #3b82f6;
2613
+ box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
2614
+ }
2615
+
2616
+ &:disabled {
2617
+ opacity: 0.5;
2618
+ cursor: not-allowed;
2619
+ }
2620
+
2621
+ @media (prefers-color-scheme: dark) {
2622
+ background-color: #374151;
2623
+ color: #f9fafb;
2624
+ border-color: #4b5563;
2625
+
2626
+ &::placeholder {
2627
+ color: #9ca3af;
2628
+ }
2629
+
2630
+ &:focus {
2631
+ border-color: #3b82f6;
2632
+ box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
2633
+ }
2634
+ }
2635
+
2636
+ [data-theme="dark"] & {
2637
+ background-color: #374151;
2638
+ color: #f9fafb;
2639
+ border-color: #4b5563;
2640
+
2641
+ &::placeholder {
2642
+ color: #9ca3af;
2643
+ }
2644
+
2645
+ &:focus {
2646
+ border-color: #3b82f6;
2647
+ box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
2648
+ }
2649
+ }
2650
+ `, Is = T.button`
2651
+ width: 32px;
2652
+ height: 32px;
2653
+ min-width: 32px;
2654
+ min-height: 32px;
2655
+ padding: 0;
2656
+ box-sizing: border-box;
2657
+ line-height: normal;
2658
+ background: transparent;
2659
+ border: 2px solid #3b82f6;
2660
+ border-radius: 50%;
2661
+ color: #3b82f6;
2662
+ cursor: pointer;
2663
+ display: flex;
2664
+ align-items: center;
2665
+ justify-content: center;
2666
+ transition: all 0.2s ease;
2667
+ flex-shrink: 0;
2668
+
2669
+ &:hover:not(:disabled) {
2670
+ background: #3b82f6;
2671
+ color: white;
2672
+ }
2673
+
2674
+ &:disabled {
2675
+ opacity: 0.5;
2676
+ cursor: not-allowed;
2677
+ border-color: #9ca3af;
2678
+ color: #9ca3af;
2679
+ }
2680
+
2681
+ svg {
2682
+ width: 16px !important;
2683
+ height: 16px !important;
2684
+ min-width: 16px !important;
2685
+ min-height: 16px !important;
2686
+ color: inherit;
2687
+ display: block !important;
2688
+ visibility: visible !important;
2689
+ opacity: 1 !important;
2690
+ flex-shrink: 0;
2691
+ }
2692
+ svg path {
2693
+ stroke: currentColor !important;
2694
+ fill: none !important;
2695
+ visibility: visible !important;
2696
+ }
2697
+
2698
+ @media (prefers-color-scheme: dark) {
2699
+ border-color: #60a5fa;
2700
+ color: #60a5fa;
2701
+ &:hover:not(:disabled) {
2702
+ background: #2563eb;
2703
+ color: white;
2704
+ }
2705
+ &:disabled {
2706
+ border-color: #6b7280;
2707
+ color: #6b7280;
2708
+ }
2709
+ }
2710
+
2711
+ [data-theme="dark"] & {
2712
+ border-color: #60a5fa;
2713
+ color: #60a5fa;
2714
+ &:hover:not(:disabled) {
2715
+ background: #2563eb;
2716
+ color: white;
2717
+ }
2718
+ &:disabled {
2719
+ border-color: #6b7280;
2720
+ color: #6b7280;
2721
+ }
2722
+ }
2723
+ `, Jt = T.button`
2724
+ width: 26px;
2725
+ height: 26px;
2726
+ min-width: 26px;
2727
+ min-height: 26px;
2728
+ padding: 0;
2729
+ box-sizing: border-box;
2730
+ line-height: normal;
2731
+ background: transparent;
2732
+ border: 1px solid #3b82f6;
2733
+ border-radius: 8px;
2734
+ color: #3b82f6;
2735
+ cursor: pointer;
2736
+ display: flex;
2737
+ align-items: center;
2738
+ justify-content: center;
2739
+ transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
2740
+ box-shadow 0.2s ease;
2741
+ flex-shrink: 0;
2742
+
2743
+ &:hover:not(:disabled) {
2744
+ background: rgba(59, 130, 246, 0.12);
2745
+ color: #2563eb;
2746
+ border-color: #2563eb;
2747
+ }
2748
+
2749
+ &:focus-visible {
2750
+ outline: none;
2751
+ box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(59, 130, 246, 0.45);
2752
+ }
2753
+
2754
+ &:disabled {
2755
+ opacity: 0.45;
2756
+ cursor: not-allowed;
2757
+ border-color: #9ca3af;
2758
+ color: #9ca3af;
2759
+ }
2760
+
2761
+ svg {
2762
+ width: 13px !important;
2763
+ height: 13px !important;
2764
+ min-width: 13px !important;
2765
+ min-height: 13px !important;
2766
+ color: inherit;
2767
+ display: block !important;
2768
+ visibility: visible !important;
2769
+ opacity: 1 !important;
2770
+ flex-shrink: 0;
2771
+ }
2772
+
2773
+ svg path {
2774
+ stroke: currentColor !important;
2775
+ fill: none !important;
2776
+ visibility: visible !important;
2777
+ }
2778
+
2779
+ @media (prefers-color-scheme: dark) {
2780
+ border-color: #60a5fa;
2781
+ color: #60a5fa;
2782
+
2783
+ &:hover:not(:disabled) {
2784
+ background: rgba(96, 165, 250, 0.14);
2785
+ color: #93c5fd;
2786
+ border-color: #93c5fd;
2787
+ }
2788
+
2789
+ &:focus-visible {
2790
+ box-shadow: 0 0 0 2px #18181b, 0 0 0 4px rgba(96, 165, 250, 0.45);
2791
+ }
2792
+
2793
+ &:disabled {
2794
+ border-color: #6b7280;
2795
+ color: #6b7280;
2796
+ }
2797
+ }
2798
+
2799
+ [data-theme='dark'] & {
2800
+ border-color: #60a5fa;
2801
+ color: #60a5fa;
2802
+
2803
+ &:hover:not(:disabled) {
2804
+ background: rgba(96, 165, 250, 0.14);
2805
+ color: #93c5fd;
2806
+ border-color: #93c5fd;
2807
+ }
2808
+
2809
+ &:focus-visible {
2810
+ box-shadow: 0 0 0 2px #18181b, 0 0 0 4px rgba(96, 165, 250, 0.45);
2811
+ }
2812
+
2813
+ &:disabled {
2814
+ border-color: #6b7280;
2815
+ color: #6b7280;
2816
+ }
2817
+ }
2818
+ `, It = (e, t = 0.15) => {
2819
+ if (e && e.startsWith("#")) {
2820
+ const r = e.replace("#", ""), n = parseInt(r, 16);
2821
+ if (isNaN(n)) return e;
2822
+ const a = Math.max(0, Math.min(255, n >> 16 & 255) * (1 - t)), c = Math.max(0, Math.min(255, n >> 8 & 255) * (1 - t)), u = Math.max(0, Math.min(255, n & 255) * (1 - t));
2823
+ return `#${Math.floor(a).toString(16).padStart(2, "0")}${Math.floor(c).toString(16).padStart(2, "0")}${Math.floor(u).toString(16).padStart(2, "0")}`;
2824
+ }
2825
+ return e || "#2563eb";
2826
+ }, As = T.button`
2827
+ position: fixed;
2828
+ z-index: 50;
2829
+ height: 48px;
2830
+ padding: 0 16px;
2831
+ box-sizing: border-box;
2832
+ line-height: normal;
2833
+ background: ${(e) => {
2834
+ if (e.$primaryColor) {
2835
+ const t = It(e.$primaryColor, 0.1);
2836
+ return `linear-gradient(135deg, ${e.$primaryColor} 0%, ${t} 100%)`;
2837
+ }
2838
+ return "linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%)";
2839
+ }};
2840
+ color: white;
2841
+ border: none;
2842
+ border-radius: 24px;
2843
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
2844
+ cursor: pointer;
2845
+ display: flex;
2846
+ align-items: center;
2847
+ gap: 8px;
2848
+ font-weight: 500;
2849
+ font-size: 14px;
2850
+ transition: all 0.2s ease;
2851
+
2852
+ /* Position based on prop */
2853
+ ${(e) => {
2854
+ switch (e.$position) {
2855
+ case "bottom-left":
2856
+ return "bottom: 24px; left: 24px;";
2857
+ case "top-right":
2858
+ return "top: 24px; right: 24px;";
2859
+ case "top-left":
2860
+ return "top: 24px; left: 24px;";
2861
+ default:
2862
+ return "bottom: 24px; right: 24px;";
2863
+ }
2864
+ }}
2865
+
2866
+ &:hover {
2867
+ background: ${(e) => {
2868
+ if (e.$primaryColor) {
2869
+ const t = It(e.$primaryColor, 0.2), r = It(e.$primaryColor, 0.3);
2870
+ return `linear-gradient(135deg, ${t} 0%, ${r} 100%)`;
2871
+ }
2872
+ return "linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%)";
2873
+ }};
2874
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
2875
+ }
2876
+
2877
+ .icon-container {
2878
+ width: 24px;
2879
+ height: 24px;
2880
+ background: rgba(255, 255, 255, 0.2);
2881
+ border-radius: 50%;
2882
+ display: flex;
2883
+ align-items: center;
2884
+ justify-content: center;
2885
+ }
2886
+ `, Ts = T.div`
2887
+ position: fixed;
2888
+ z-index: 50;
2889
+ width: 320px;
2890
+ background: white;
2891
+ border: 1px solid #e5e7eb;
2892
+ border-radius: 8px;
2893
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
2894
+ display: flex;
2895
+ flex-direction: column;
2896
+
2897
+ /* Position based on prop */
2898
+ ${(e) => {
2899
+ switch (e.$position) {
2900
+ case "bottom-left":
2901
+ return "bottom: 24px; left: 24px;";
2902
+ case "top-right":
2903
+ return "top: 24px; right: 24px;";
2904
+ case "top-left":
2905
+ return "top: 24px; left: 24px;";
2906
+ default:
2907
+ return "bottom: 24px; right: 24px;";
2908
+ }
2909
+ }}
2910
+
2911
+ @media (prefers-color-scheme: dark) {
2912
+ background: #1f2937;
2913
+ border-color: #374151;
2914
+ }
2915
+
2916
+ &[data-theme="dark"] {
2917
+ background: #1f2937;
2918
+ border-color: #374151;
2919
+ }
2920
+
2921
+ @media (min-width: 640px) {
2922
+ width: 384px;
2923
+ }
2924
+ `;
2925
+ T.div`
2926
+ padding: 12px 16px;
2927
+ background: ${(e) => e.primaryColor || "#3b82f6"};
2928
+ color: white;
2929
+ border-radius: 8px 8px 0 0;
2930
+ display: flex;
2931
+ align-items: center;
2932
+ justify-content: space-between;
2933
+ font-weight: 500;
2934
+
2935
+ .header-content {
2936
+ display: flex;
2937
+ align-items: center;
2938
+ gap: 8px;
2939
+ }
2940
+
2941
+ .header-actions {
2942
+ display: flex;
2943
+ align-items: center;
2944
+ gap: 4px;
2945
+ }
2946
+ `;
2947
+ T.button`
2948
+ width: 24px;
2949
+ height: 24px;
2950
+ padding: 0;
2951
+ box-sizing: border-box;
2952
+ line-height: normal;
2953
+ background: transparent;
2954
+ border: none;
2955
+ color: white;
2956
+ cursor: pointer;
2957
+ display: flex;
2958
+ align-items: center;
2959
+ justify-content: center;
2960
+ border-radius: 4px;
2961
+ transition: background-color 0.2s ease;
2962
+
2963
+ &:hover {
2964
+ background: rgba(255, 255, 255, 0.1);
2965
+ }
2966
+
2967
+ svg {
2968
+ width: 16px;
2969
+ height: 16px;
2970
+ }
2971
+ `;
2972
+ T.div`
2973
+ flex: 1;
2974
+ overflow-y: auto;
2975
+ padding: 16px;
2976
+ display: flex;
2977
+ flex-direction: column;
2978
+ gap: 16px;
2979
+
2980
+ /* Custom scrollbar */
2981
+ &::-webkit-scrollbar {
2982
+ width: 6px;
2983
+ }
2984
+
2985
+ &::-webkit-scrollbar-track {
2986
+ background: #f1f5f9;
2987
+ }
2988
+
2989
+ &::-webkit-scrollbar-thumb {
2990
+ background: #cbd5e1;
2991
+ border-radius: 3px;
2992
+ }
2993
+
2994
+ &::-webkit-scrollbar-thumb:hover {
2995
+ background: #94a3b8;
2996
+ }
2997
+
2998
+ @media (prefers-color-scheme: dark) {
2999
+ &::-webkit-scrollbar-track {
3000
+ background: #374151;
3001
+ }
3002
+
3003
+ &::-webkit-scrollbar-thumb {
3004
+ background: #6b7280;
3005
+ }
3006
+
3007
+ &::-webkit-scrollbar-thumb:hover {
3008
+ background: #9ca3af;
3009
+ }
3010
+ }
3011
+
3012
+ [data-theme="dark"] & {
3013
+ &::-webkit-scrollbar-track {
3014
+ background: #374151;
3015
+ }
3016
+
3017
+ &::-webkit-scrollbar-thumb {
3018
+ background: #6b7280;
3019
+ }
3020
+
3021
+ &::-webkit-scrollbar-thumb:hover {
3022
+ background: #9ca3af;
3023
+ }
3024
+ }
3025
+ `;
3026
+ const Xt = T.div`
3027
+ display: flex;
3028
+ gap: 4px;
3029
+ align-items: center;
3030
+
3031
+ .dot {
3032
+ width: 8px;
3033
+ height: 8px;
3034
+ background: #6b7280;
3035
+ border-radius: 50%;
3036
+ animation: bounce 1.4s ease-in-out infinite both;
3037
+
3038
+ &:nth-child(1) { animation-delay: -0.32s; }
3039
+ &:nth-child(2) { animation-delay: -0.16s; }
3040
+ &:nth-child(3) { animation-delay: 0s; }
3041
+ }
3042
+
3043
+ @keyframes bounce {
3044
+ 0%, 80%, 100% {
3045
+ transform: scale(0);
3046
+ }
3047
+ 40% {
3048
+ transform: scale(1);
3049
+ }
3050
+ }
3051
+
3052
+ @media (prefers-color-scheme: dark) {
3053
+ .dot {
3054
+ background: #9ca3af;
3055
+ }
3056
+ }
3057
+ `;
3058
+ T.div`
3059
+ font-size: 12px;
3060
+ margin-top: 4px;
3061
+ color: ${(e) => e.$isUser ? "rgba(255, 255, 255, 0.8)" : "#6b7280"};
3062
+
3063
+ @media (prefers-color-scheme: dark) {
3064
+ color: ${(e) => e.$isUser ? "rgba(255, 255, 255, 0.8)" : "#d1d5db"};
3065
+ }
3066
+
3067
+ [data-theme="dark"] & {
3068
+ color: ${(e) => e.$isUser ? "rgba(255, 255, 255, 0.8)" : "#d1d5db"};
3069
+ }
3070
+ `;
3071
+ const er = T.div`
3072
+ font-size: 14px;
3073
+ color: #dc2626;
3074
+ text-align: center;
3075
+ padding: 8px;
3076
+ margin: 16px 0;
3077
+
3078
+ @media (prefers-color-scheme: dark) {
3079
+ color: #f87171;
3080
+ }
3081
+ `, Es = T.div`
3082
+ position: absolute;
3083
+ ${(e) => e.$position === "top" ? "top: 0;" : "bottom: 0;"}
3084
+ left: 0;
3085
+ right: 0;
3086
+ height: 6px;
3087
+ background: linear-gradient(90deg, #e5e7eb 0%, #3b82f6 50%, #e5e7eb 100%);
3088
+ cursor: ${(e) => (e.$position === "top", "ns-resize")};
3089
+ border-radius: ${(e) => e.$position === "top" ? "8px 8px 0 0" : "0 0 8px 8px"};
3090
+ opacity: 0.7;
3091
+ transition: opacity 0.2s ease;
3092
+
3093
+ &:hover {
3094
+ opacity: 1;
3095
+ background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 50%, #3b82f6 100%);
3096
+ }
3097
+
3098
+ @media (prefers-color-scheme: dark) {
3099
+ background: linear-gradient(90deg, #374151 0%, #3b82f6 50%, #374151 100%);
3100
+
3101
+ &:hover {
3102
+ background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 50%, #3b82f6 100%);
3103
+ }
3104
+ }
3105
+ `, xe = T.img`
3106
+ width: ${(e) => e.$size || "32px"};
3107
+ height: ${(e) => e.$size || "32px"};
3108
+ border-radius: 50%;
3109
+ object-fit: cover;
3110
+ flex-shrink: 0;
3111
+ border: 2px solid rgba(255, 255, 255, 0.2);
3112
+ background-color: rgba(255, 255, 255, 0.1);
3113
+ `, Ms = T.div`
3114
+ display: flex;
3115
+ flex-direction: column;
3116
+ align-items: center;
3117
+ justify-content: flex-start;
3118
+ padding: 24px 16px;
3119
+ flex: 1;
3120
+ min-height: 0;
3121
+ overflow-y: auto;
3122
+ gap: 20px;
3123
+ position: relative;
3124
+
3125
+ /* Gradient background - starts with full primary color at top, fades to background color */
3126
+ background: ${(e) => e.$primaryColor ? `linear-gradient(to bottom, ${e.$primaryColor} 0%, ${e.$primaryColor} 20%, rgba(255, 255, 255, 0.3) 45%, rgba(255, 255, 255, 0.7) 65%, rgba(255, 255, 255, 1) 100%)` : "transparent"};
3127
+
3128
+ @media (prefers-color-scheme: dark) {
3129
+ background: ${(e) => e.$primaryColor ? `linear-gradient(to bottom, ${e.$primaryColor} 0%, ${e.$primaryColor} 20%, rgba(31, 41, 55, 0.3) 45%, rgba(31, 41, 55, 0.7) 65%, rgba(31, 41, 55, 1) 100%)` : "transparent"};
3130
+ }
3131
+
3132
+ [data-theme="dark"] & {
3133
+ background: ${(e) => e.$primaryColor ? `linear-gradient(to bottom, ${e.$primaryColor} 0%, ${e.$primaryColor} 20%, rgba(31, 41, 55, 0.3) 45%, rgba(31, 41, 55, 0.7) 65%, rgba(31, 41, 55, 1) 100%)` : "transparent"};
3134
+ }
3135
+ `, _s = T.div`
3136
+ font-size: 18px;
3137
+ font-weight: 600;
3138
+ text-align: center;
3139
+ color: #111827;
3140
+ margin-bottom: 8px;
3141
+
3142
+ @media (prefers-color-scheme: dark) {
3143
+ color: #f9fafb;
3144
+ }
3145
+
3146
+ [data-theme="dark"] & {
3147
+ color: #f9fafb;
3148
+ }
3149
+ `, Rs = T.img`
3150
+ max-width: 120px;
3151
+ max-height: 120px;
3152
+ width: auto;
3153
+ height: auto;
3154
+ object-fit: contain;
3155
+ margin-bottom: 8px;
3156
+ border-radius: 8px;
3157
+ `, zs = T.div`
3158
+ display: flex;
3159
+ flex-direction: column;
3160
+ gap: 12px;
3161
+ width: 100%;
3162
+ max-width: 100%;
3163
+ margin-bottom: 16px;
3164
+ `, Ds = T.button`
3165
+ width: 100%;
3166
+ padding: 12px 16px;
3167
+ box-sizing: border-box;
3168
+ line-height: normal;
3169
+ text-align: left;
3170
+ border: 1px solid #e5e7eb;
3171
+ border-radius: 8px;
3172
+ background-color: #ffffff;
3173
+ color: #111827;
3174
+ font-size: 14px;
3175
+ font-weight: 500;
3176
+ cursor: pointer;
3177
+ transition: all 0.2s ease;
3178
+
3179
+ &:hover:not(:disabled) {
3180
+ background-color: ${(e) => e.$primaryColor ? `${e.$primaryColor}15` : "#f3f4f6"};
3181
+ border-color: ${(e) => e.$primaryColor || "#d1d5db"};
3182
+ transform: translateY(-1px);
3183
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
3184
+ }
3185
+
3186
+ &:active:not(:disabled) {
3187
+ transform: translateY(0);
3188
+ }
3189
+
3190
+ &:disabled {
3191
+ opacity: 0.5;
3192
+ cursor: not-allowed;
3193
+ }
3194
+
3195
+ @media (prefers-color-scheme: dark) {
3196
+ background-color: #374151;
3197
+ color: #f9fafb;
3198
+ border-color: #4b5563;
3199
+
3200
+ &:hover:not(:disabled) {
3201
+ background-color: ${(e) => e.$primaryColor ? `${e.$primaryColor}25` : "#4b5563"};
3202
+ border-color: ${(e) => e.$primaryColor || "#6b7280"};
3203
+ }
3204
+ }
3205
+
3206
+ [data-theme="dark"] & {
3207
+ background-color: #374151;
3208
+ color: #f9fafb;
3209
+ border-color: #4b5563;
3210
+
3211
+ &:hover:not(:disabled) {
3212
+ background-color: ${(e) => e.$primaryColor ? `${e.$primaryColor}25` : "#4b5563"};
3213
+ border-color: ${(e) => e.$primaryColor || "#6b7280"};
3214
+ }
3215
+ }
3216
+ `, Ns = T.div`
3217
+ display: flex;
3218
+ align-items: center;
3219
+ gap: 8px;
3220
+ width: 100%;
3221
+ margin-top: auto;
3222
+ padding-top: 16px;
3223
+ border-top: 1px solid #e5e7eb;
3224
+
3225
+ @media (prefers-color-scheme: dark) {
3226
+ border-top-color: #374151;
3227
+ }
3228
+
3229
+ [data-theme="dark"] & {
3230
+ border-top-color: #374151;
3231
+ }
3232
+ `, ft = F.forwardRef(function({
3233
+ value: t,
3234
+ onChange: r,
3235
+ onKeyDown: n,
3236
+ placeholder: a = "Type a message...",
3237
+ disabled: c = !1,
3238
+ className: u,
3239
+ maxLength: d = 2e3,
3240
+ variant: h = "default"
3241
+ }, g) {
3242
+ const b = (k) => {
3243
+ r(k.target.value);
3244
+ }, p = (k) => {
3245
+ k.key === "Enter" && !k.shiftKey && k.preventDefault(), n(k);
3246
+ }, w = h === "composer" ? Cs : js;
3247
+ return /* @__PURE__ */ l.jsx(
3248
+ w,
3249
+ {
3250
+ ref: g,
3251
+ value: t,
3252
+ onChange: b,
3253
+ onKeyDown: p,
3254
+ placeholder: a,
3255
+ disabled: c,
3256
+ maxLength: d,
3257
+ className: u,
3258
+ onInput: (k) => {
3259
+ const $ = k.target;
3260
+ $.style.height = "auto";
3261
+ const j = h === "composer" ? 96 : 120;
3262
+ $.style.height = `${Math.min($.scrollHeight, j)}px`;
3263
+ }
3264
+ }
3265
+ );
3266
+ });
3267
+ function ht({ size: e = 16 }) {
3268
+ return /* @__PURE__ */ l.jsxs(
3269
+ "svg",
3270
+ {
3271
+ width: e,
3272
+ height: e,
3273
+ viewBox: "0 0 24 24",
3274
+ fill: "none",
3275
+ stroke: "currentColor",
3276
+ strokeWidth: "2",
3277
+ strokeLinecap: "round",
3278
+ strokeLinejoin: "round",
3279
+ "aria-hidden": !0,
3280
+ children: [
3281
+ /* @__PURE__ */ l.jsx("path", { d: "M22 2L11 13" }),
3282
+ /* @__PURE__ */ l.jsx("path", { d: "M22 2L15 22L11 13L2 9L22 2Z" })
3283
+ ]
3284
+ }
3285
+ );
3286
+ }
3287
+ function tr({ config: e, onQuestionClick: t, onSendMessage: r, isLoading: n }) {
3288
+ const [a, c] = F.useState(""), u = F.useRef(null), d = async () => {
3289
+ !a.trim() || n || (await r(a.trim()), c(""));
3290
+ }, h = (b) => {
3291
+ b.key === "Enter" && !b.shiftKey && (b.preventDefault(), d());
3292
+ }, g = e.welcomeMessage || "Hi there 👋 How can we help?";
3293
+ return /* @__PURE__ */ l.jsxs(Ms, { $primaryColor: e.primaryColor, children: [
3294
+ e.welcomeImage && /* @__PURE__ */ l.jsx(
3295
+ Rs,
3296
+ {
3297
+ src: e.welcomeImage,
3298
+ alt: "Welcome"
3299
+ }
3300
+ ),
3301
+ /* @__PURE__ */ l.jsx(_s, { children: g }),
3302
+ e.quickQuestions && e.quickQuestions.length > 0 && /* @__PURE__ */ l.jsx(zs, { children: e.quickQuestions.map((b, p) => /* @__PURE__ */ l.jsx(
3303
+ Ds,
3304
+ {
3305
+ onClick: () => t(b),
3306
+ disabled: n,
3307
+ $primaryColor: e.primaryColor,
3308
+ children: b
3309
+ },
3310
+ p
3311
+ )) }),
3312
+ /* @__PURE__ */ l.jsxs(Ns, { children: [
3313
+ /* @__PURE__ */ l.jsx(
3314
+ ft,
3315
+ {
3316
+ ref: u,
3317
+ value: a,
3318
+ onChange: c,
3319
+ onKeyDown: h,
3320
+ placeholder: e.placeholder || "Type a message...",
3321
+ disabled: n
3322
+ }
3323
+ ),
3324
+ /* @__PURE__ */ l.jsx(
3325
+ Is,
3326
+ {
3327
+ onClick: d,
3328
+ disabled: n || !a.trim(),
3329
+ children: /* @__PURE__ */ l.jsx(ht, { size: 16 })
3330
+ }
3331
+ )
3332
+ ] })
3333
+ ] });
3334
+ }
3335
+ function rr(e, t) {
3336
+ var j;
3337
+ const r = (e.maxAttachmentSizeMB ?? 10) * 1024 * 1024, n = e.maxAttachments ?? 3, a = (j = e.allowedAttachmentTypes) != null && j.length ? e.allowedAttachmentTypes : gn, c = !!(e.enableAttachments && e.publishableKey), [u, d] = J([]), [h, g] = J(null), b = ae([]);
3338
+ De(() => {
3339
+ b.current = u;
3340
+ }, [u]);
3341
+ const p = Z(
3342
+ async (S) => {
3343
+ if (c) {
3344
+ g(null);
3345
+ for (const o of S) {
3346
+ if (b.current.length >= n) {
3347
+ g(`At most ${n} attachments per message.`);
3348
+ break;
3349
+ }
3350
+ const i = bn(o, r, a);
3351
+ if (i) {
3352
+ g(`${o.name}: ${i}`);
3353
+ continue;
3354
+ }
3355
+ try {
3356
+ const s = await t(o);
3357
+ d((f) => {
3358
+ if (f.length >= n) return f;
3359
+ const m = [...f, s];
3360
+ return b.current = m, m;
3361
+ });
3362
+ } catch (s) {
3363
+ g(s instanceof Error ? s.message : "Upload failed");
3364
+ }
3365
+ }
3366
+ }
3367
+ },
3368
+ [a, c, r, n, t]
3369
+ ), w = Z((S) => {
3370
+ d((o) => {
3371
+ const i = o.filter((s) => s.id !== S);
3372
+ return b.current = i, i;
3373
+ });
3374
+ }, []), k = Z(() => {
3375
+ d([]), b.current = [], g(null);
3376
+ }, []), $ = Z(
3377
+ (S) => {
3378
+ g(null), d((o) => {
3379
+ if (o.length >= n) return o;
3380
+ const i = [...o, S];
3381
+ return b.current = i, i;
3382
+ });
3383
+ },
3384
+ [n]
3385
+ );
3386
+ return {
3387
+ enabled: c,
3388
+ staged: u,
3389
+ attachmentError: h,
3390
+ setAttachmentError: g,
3391
+ addFiles: p,
3392
+ appendStaged: $,
3393
+ removeStaged: w,
3394
+ clearStaged: k,
3395
+ maxFiles: n,
3396
+ maxBytes: r,
3397
+ allowed: a
3398
+ };
3399
+ }
3400
+ function Os({ size: e = 16 }) {
3401
+ return /* @__PURE__ */ l.jsx(
3402
+ "svg",
3403
+ {
3404
+ width: e,
3405
+ height: e,
3406
+ viewBox: "0 0 24 24",
3407
+ fill: "none",
3408
+ stroke: "currentColor",
3409
+ strokeWidth: "2",
3410
+ strokeLinecap: "round",
3411
+ strokeLinejoin: "round",
3412
+ "aria-hidden": !0,
3413
+ children: /* @__PURE__ */ l.jsx("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
3414
+ }
3415
+ );
3416
+ }
3417
+ function Bs({ size: e = 16 }) {
3418
+ return /* @__PURE__ */ l.jsxs(
3419
+ "svg",
3420
+ {
3421
+ width: e,
3422
+ height: e,
3423
+ viewBox: "0 0 24 24",
3424
+ fill: "none",
3425
+ stroke: "currentColor",
3426
+ strokeWidth: "2",
3427
+ strokeLinecap: "round",
3428
+ strokeLinejoin: "round",
3429
+ "aria-hidden": !0,
3430
+ children: [
3431
+ /* @__PURE__ */ l.jsx("path", { d: "M18 6 6 18" }),
3432
+ /* @__PURE__ */ l.jsx("path", { d: "m6 6 12 12" })
3433
+ ]
3434
+ }
3435
+ );
3436
+ }
3437
+ /*!---------------------------------------------------------------------------------------------
3438
+ * Copyright (c) StackBlitz. All rights reserved.
3439
+ * Licensed under the MIT License. See License.txt in the project root for license information.
3440
+ *--------------------------------------------------------------------------------------------*/
3441
+ const Ps = {
3442
+ /**
3443
+ * A value from 0 to 1, on how much to damp the animation.
3444
+ * 0 means no damping, 1 means full damping.
3445
+ *
3446
+ * @default 0.7
3447
+ */
3448
+ damping: 0.7,
3449
+ /**
3450
+ * The stiffness of how fast/slow the animation gets up to speed.
3451
+ *
3452
+ * @default 0.05
3453
+ */
3454
+ stiffness: 0.05,
3455
+ /**
3456
+ * The inertial mass associated with the animation.
3457
+ * Higher numbers make the animation slower.
3458
+ *
3459
+ * @default 1.25
3460
+ */
3461
+ mass: 1.25
3462
+ }, Ls = 70, Fs = 1e3 / 60, Ks = 350;
3463
+ let mt = !1;
3464
+ var Or;
3465
+ (Or = globalThis.document) == null || Or.addEventListener("mousedown", () => {
3466
+ mt = !0;
3467
+ });
3468
+ var Br;
3469
+ (Br = globalThis.document) == null || Br.addEventListener("mouseup", () => {
3470
+ mt = !1;
3471
+ });
3472
+ var Pr;
3473
+ (Pr = globalThis.document) == null || Pr.addEventListener("click", () => {
3474
+ mt = !1;
3475
+ });
3476
+ const Ws = (e = {}) => {
3477
+ const [t, r] = J(!1), [n, a] = J(e.initial !== !1), [c, u] = J(!1), d = ae(null);
3478
+ d.current = e;
3479
+ const h = Z(() => {
3480
+ var f;
3481
+ if (!mt)
3482
+ return !1;
3483
+ const i = window.getSelection();
3484
+ if (!i || !i.rangeCount)
3485
+ return !1;
3486
+ const s = i.getRangeAt(0);
3487
+ return s.commonAncestorContainer.contains(S.current) || ((f = S.current) == null ? void 0 : f.contains(s.commonAncestorContainer));
3488
+ }, []), g = Z((i) => {
3489
+ p.isAtBottom = i, a(i);
3490
+ }, []), b = Z((i) => {
3491
+ p.escapedFromLock = i, r(i);
3492
+ }, []), p = Bt(() => {
3493
+ let i;
3494
+ return {
3495
+ escapedFromLock: t,
3496
+ isAtBottom: n,
3497
+ resizeDifference: 0,
3498
+ accumulated: 0,
3499
+ velocity: 0,
3500
+ listeners: /* @__PURE__ */ new Set(),
3501
+ get scrollTop() {
3502
+ var s;
3503
+ return ((s = S.current) == null ? void 0 : s.scrollTop) ?? 0;
3504
+ },
3505
+ set scrollTop(s) {
3506
+ S.current && (S.current.scrollTop = s, p.ignoreScrollToTop = S.current.scrollTop);
3507
+ },
3508
+ get targetScrollTop() {
3509
+ return !S.current || !o.current ? 0 : S.current.scrollHeight - 1 - S.current.clientHeight;
3510
+ },
3511
+ get calculatedTargetScrollTop() {
3512
+ if (!S.current || !o.current)
3513
+ return 0;
3514
+ const { targetScrollTop: s } = this;
3515
+ if (!e.targetScrollTop)
3516
+ return s;
3517
+ if ((i == null ? void 0 : i.targetScrollTop) === s)
3518
+ return i.calculatedScrollTop;
3519
+ const f = Math.max(Math.min(e.targetScrollTop(s, {
3520
+ scrollElement: S.current,
3521
+ contentElement: o.current
3522
+ }), s), 0);
3523
+ return i = { targetScrollTop: s, calculatedScrollTop: f }, requestAnimationFrame(() => {
3524
+ i = void 0;
3525
+ }), f;
3526
+ },
3527
+ get scrollDifference() {
3528
+ return this.calculatedTargetScrollTop - this.scrollTop;
3529
+ },
3530
+ get isNearBottom() {
3531
+ return this.scrollDifference <= Ls;
3532
+ }
3533
+ };
3534
+ }, []), w = Z((i = {}) => {
3535
+ var M;
3536
+ typeof i == "string" && (i = { animation: i }), i.preserveScrollPosition || g(!0);
3537
+ const s = Date.now() + (Number(i.wait) || 0), f = Tt(d.current, i.animation), { ignoreEscapes: m = !1 } = i;
3538
+ let y, x = p.calculatedTargetScrollTop;
3539
+ i.duration instanceof Promise ? i.duration.finally(() => {
3540
+ y = Date.now();
3541
+ }) : y = s + (i.duration ?? 0);
3542
+ const A = async () => {
3543
+ const C = new Promise(requestAnimationFrame).then(() => {
3544
+ var I;
3545
+ if (!p.isAtBottom)
3546
+ return p.animation = void 0, !1;
3547
+ const { scrollTop: E } = p, K = performance.now(), P = (K - (p.lastTick ?? K)) / Fs;
3548
+ if (p.animation || (p.animation = { behavior: f, promise: C, ignoreEscapes: m }), p.animation.behavior === f && (p.lastTick = K), h() || s > Date.now())
3549
+ return A();
3550
+ if (E < Math.min(x, p.calculatedTargetScrollTop)) {
3551
+ if (((I = p.animation) == null ? void 0 : I.behavior) === f) {
3552
+ if (f === "instant")
3553
+ return p.scrollTop = p.calculatedTargetScrollTop, A();
3554
+ p.velocity = (f.damping * p.velocity + f.stiffness * p.scrollDifference) / f.mass, p.accumulated += p.velocity * P, p.scrollTop += p.accumulated, p.scrollTop !== E && (p.accumulated = 0);
3555
+ }
3556
+ return A();
3557
+ }
3558
+ return y > Date.now() ? (x = p.calculatedTargetScrollTop, A()) : (p.animation = void 0, p.scrollTop < p.calculatedTargetScrollTop ? w({
3559
+ animation: Tt(d.current, d.current.resize),
3560
+ ignoreEscapes: m,
3561
+ duration: Math.max(0, y - Date.now()) || void 0
3562
+ }) : p.isAtBottom);
3563
+ });
3564
+ return C.then((E) => (requestAnimationFrame(() => {
3565
+ p.animation || (p.lastTick = void 0, p.velocity = 0);
3566
+ }), E));
3567
+ };
3568
+ return i.wait !== !0 && (p.animation = void 0), ((M = p.animation) == null ? void 0 : M.behavior) === f ? p.animation.promise : A();
3569
+ }, [g, h, p]), k = Z(() => {
3570
+ b(!0), g(!1);
3571
+ }, [b, g]), $ = Z(({ target: i }) => {
3572
+ if (i !== S.current)
3573
+ return;
3574
+ const { scrollTop: s, ignoreScrollToTop: f } = p;
3575
+ let { lastScrollTop: m = s } = p;
3576
+ p.lastScrollTop = s, p.ignoreScrollToTop = void 0, f && f > s && (m = f), u(p.isNearBottom), setTimeout(() => {
3577
+ var A;
3578
+ if (p.resizeDifference || s === f)
3579
+ return;
3580
+ if (h()) {
3581
+ b(!0), g(!1);
3582
+ return;
3583
+ }
3584
+ const y = s > m, x = s < m;
3585
+ if ((A = p.animation) != null && A.ignoreEscapes) {
3586
+ p.scrollTop = m;
3587
+ return;
3588
+ }
3589
+ x && (b(!0), g(!1)), y && b(!1), !p.escapedFromLock && p.isNearBottom && g(!0);
3590
+ }, 1);
3591
+ }, [b, g, h, p]), j = Z(({ target: i, deltaY: s }) => {
3592
+ var m;
3593
+ let f = i;
3594
+ for (; !["scroll", "auto"].includes(getComputedStyle(f).overflow); ) {
3595
+ if (!f.parentElement)
3596
+ return;
3597
+ f = f.parentElement;
3598
+ }
3599
+ f === S.current && s < 0 && S.current.scrollHeight > S.current.clientHeight && !((m = p.animation) != null && m.ignoreEscapes) && (b(!0), g(!1));
3600
+ }, [b, g, p]), S = Dr((i) => {
3601
+ var s, f;
3602
+ (s = S.current) == null || s.removeEventListener("scroll", $), (f = S.current) == null || f.removeEventListener("wheel", j), i == null || i.addEventListener("scroll", $, { passive: !0 }), i == null || i.addEventListener("wheel", j, { passive: !0 });
3603
+ }, []), o = Dr((i) => {
3604
+ var f, m;
3605
+ if ((f = p.resizeObserver) == null || f.disconnect(), !i)
3606
+ return;
3607
+ let s;
3608
+ p.resizeObserver = new ResizeObserver(([y]) => {
3609
+ const { height: x } = y.contentRect, A = x - (s ?? x);
3610
+ if (p.resizeDifference = A, p.scrollTop > p.targetScrollTop && (p.scrollTop = p.targetScrollTop), u(p.isNearBottom), A >= 0) {
3611
+ const M = Tt(d.current, s ? d.current.resize : d.current.initial);
3612
+ w({
3613
+ animation: M,
3614
+ wait: !0,
3615
+ preserveScrollPosition: !0,
3616
+ duration: M === "instant" ? void 0 : Ks
3617
+ });
3618
+ } else
3619
+ p.isNearBottom && (b(!1), g(!0));
3620
+ s = x, requestAnimationFrame(() => {
3621
+ setTimeout(() => {
3622
+ p.resizeDifference === A && (p.resizeDifference = 0);
3623
+ }, 1);
3624
+ });
3625
+ }), (m = p.resizeObserver) == null || m.observe(i);
3626
+ }, []);
3627
+ return {
3628
+ contentRef: o,
3629
+ scrollRef: S,
3630
+ scrollToBottom: w,
3631
+ stopScroll: k,
3632
+ isAtBottom: n || c,
3633
+ isNearBottom: c,
3634
+ escapedFromLock: t,
3635
+ state: p
3636
+ };
3637
+ };
3638
+ function Dr(e, t) {
3639
+ const r = Z((n) => (r.current = n, e(n)), t);
3640
+ return r;
3641
+ }
3642
+ const At = /* @__PURE__ */ new Map();
3643
+ function Tt(...e) {
3644
+ const t = { ...Ps };
3645
+ let r = !1;
3646
+ for (const a of e) {
3647
+ if (a === "instant") {
3648
+ r = !0;
3649
+ continue;
3650
+ }
3651
+ typeof a == "object" && (r = !1, t.damping = a.damping ?? t.damping, t.stiffness = a.stiffness ?? t.stiffness, t.mass = a.mass ?? t.mass);
3652
+ }
3653
+ const n = JSON.stringify(t);
3654
+ return At.has(n) || At.set(n, Object.freeze(t)), r ? "instant" : At.get(n);
3655
+ }
3656
+ const In = _n(null), Us = typeof window < "u" ? Mn : De;
3657
+ function rt({ instance: e, children: t, resize: r, initial: n, mass: a, damping: c, stiffness: u, targetScrollTop: d, contextRef: h, ...g }) {
3658
+ const b = ae(null), p = Ot.useCallback((m, y) => {
3659
+ const x = (f == null ? void 0 : f.targetScrollTop) ?? d;
3660
+ return (x == null ? void 0 : x(m, y)) ?? m;
3661
+ }, [d]), w = Ws({
3662
+ mass: a,
3663
+ damping: c,
3664
+ stiffness: u,
3665
+ resize: r,
3666
+ initial: n,
3667
+ targetScrollTop: p
3668
+ }), { scrollRef: k, contentRef: $, scrollToBottom: j, stopScroll: S, isAtBottom: o, escapedFromLock: i, state: s } = e ?? w, f = Bt(() => ({
3669
+ scrollToBottom: j,
3670
+ stopScroll: S,
3671
+ scrollRef: k,
3672
+ isAtBottom: o,
3673
+ escapedFromLock: i,
3674
+ contentRef: $,
3675
+ state: s,
3676
+ get targetScrollTop() {
3677
+ return b.current;
3678
+ },
3679
+ set targetScrollTop(m) {
3680
+ b.current = m;
3681
+ }
3682
+ }), [
3683
+ j,
3684
+ o,
3685
+ $,
3686
+ k,
3687
+ S,
3688
+ i,
3689
+ s
3690
+ ]);
3691
+ return En(h, () => f, [f]), Us(() => {
3692
+ k.current && getComputedStyle(k.current).overflow === "visible" && (k.current.style.overflow = "auto");
3693
+ }, []), l.jsx(In.Provider, { value: f, children: l.jsx("div", { ...g, children: typeof t == "function" ? t(f) : t }) });
3694
+ }
3695
+ (function(e) {
3696
+ function t({ children: r, ...n }) {
3697
+ const a = Hs();
3698
+ return l.jsx("div", { ref: a.scrollRef, style: {
3699
+ height: "100%",
3700
+ width: "100%"
3701
+ }, children: l.jsx("div", { ...n, ref: a.contentRef, children: typeof r == "function" ? r(a) : r }) });
3702
+ }
3703
+ e.Content = t;
3704
+ })(rt || (rt = {}));
3705
+ function Hs() {
3706
+ const e = Fr(In);
3707
+ if (!e)
3708
+ throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");
3709
+ return e;
3710
+ }
3711
+ const qs = T(rt)`
3712
+ position: relative;
3713
+ flex: 1;
3714
+ overflow-y: auto;
3715
+ scroll-behavior: smooth;
3716
+ scrollbar-width: thin;
3717
+ scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
3718
+
3719
+ &::-webkit-scrollbar {
3720
+ width: 8px;
3721
+ }
3722
+
3723
+ &::-webkit-scrollbar-track {
3724
+ background: transparent;
3725
+ }
3726
+
3727
+ &::-webkit-scrollbar-thumb {
3728
+ background-color: rgba(148, 163, 184, 0.45);
3729
+ border-radius: 999px;
3730
+ border: 2px solid transparent;
3731
+ background-clip: padding-box;
3732
+ }
3733
+
3734
+ &::-webkit-scrollbar-thumb:hover {
3735
+ background-color: rgba(100, 116, 139, 0.55);
3736
+ }
3737
+
3738
+ @media (prefers-color-scheme: dark) {
3739
+ scrollbar-color: rgba(71, 85, 105, 0.75) transparent;
3740
+
3741
+ &::-webkit-scrollbar-thumb {
3742
+ background-color: rgba(71, 85, 105, 0.65);
3743
+ }
3744
+
3745
+ &::-webkit-scrollbar-thumb:hover {
3746
+ background-color: rgba(100, 116, 139, 0.75);
3747
+ }
3748
+ }
3749
+
3750
+ [data-theme='dark'] & {
3751
+ scrollbar-color: rgba(71, 85, 105, 0.75) transparent;
3752
+
3753
+ &::-webkit-scrollbar-thumb {
3754
+ background-color: rgba(71, 85, 105, 0.65);
3755
+ }
3756
+
3757
+ &::-webkit-scrollbar-thumb:hover {
3758
+ background-color: rgba(100, 116, 139, 0.75);
3759
+ }
3760
+ }
3761
+ `, Gs = T(rt.Content)`
3762
+ padding: 16px;
3763
+ `;
3764
+ T.button`
3765
+ position: absolute;
3766
+ bottom: 16px;
3767
+ left: 50%;
3768
+ transform: translateX(-50%);
3769
+ width: 40px;
3770
+ height: 40px;
3771
+ border-radius: 50%;
3772
+ border: 1px solid #d1d5db;
3773
+ background: white;
3774
+ color: #6b7280;
3775
+ cursor: pointer;
3776
+ display: flex;
3777
+ align-items: center;
3778
+ justify-content: center;
3779
+ transition: all 0.2s ease;
3780
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
3781
+
3782
+ &:hover {
3783
+ background: #f9fafb;
3784
+ border-color: #9ca3af;
3785
+ color: #374151;
3786
+ }
3787
+
3788
+ svg {
3789
+ width: 16px;
3790
+ height: 16px;
3791
+ }
3792
+
3793
+ @media (prefers-color-scheme: dark) {
3794
+ background: #1f2937;
3795
+ border-color: #374151;
3796
+ color: #9ca3af;
3797
+
3798
+ &:hover {
3799
+ background: #374151;
3800
+ border-color: #4b5563;
3801
+ color: #d1d5db;
3802
+ }
3803
+ }
3804
+ `;
3805
+ function nr({
3806
+ className: e,
3807
+ children: t,
3808
+ style: r,
3809
+ onDragOver: n,
3810
+ onDragLeave: a,
3811
+ onDrop: c
3812
+ }) {
3813
+ return /* @__PURE__ */ l.jsx(
3814
+ qs,
3815
+ {
3816
+ className: e,
3817
+ style: r,
3818
+ initial: "smooth",
3819
+ resize: "smooth",
3820
+ role: "log",
3821
+ onDragOver: n,
3822
+ onDragLeave: a,
3823
+ onDrop: c,
3824
+ children: t
3825
+ }
3826
+ );
3827
+ }
3828
+ function or({ className: e, children: t }) {
3829
+ return /* @__PURE__ */ l.jsx(Gs, { className: e, children: t });
3830
+ }
3831
+ function Ys({ config: e, chat: t }) {
3832
+ const { messages: r, sendMessage: n, uploadAttachment: a, isLoading: c, error: u, hasSessionStarted: d } = t, [h, g] = F.useState(""), [b, p] = F.useState(!1), w = F.useRef(null), {
3833
+ enabled: k,
3834
+ staged: $,
3835
+ attachmentError: j,
3836
+ setAttachmentError: S,
3837
+ addFiles: o,
3838
+ appendStaged: i,
3839
+ removeStaged: s,
3840
+ clearStaged: f,
3841
+ maxFiles: m,
3842
+ maxBytes: y,
3843
+ allowed: x
3844
+ } = rr(e, a), A = () => e.theme === "dark" ? "dark" : e.theme === "light" ? "light" : b ? "dark" : "light";
3845
+ F.useEffect(() => {
3846
+ if (e.theme === "auto" || !e.theme) {
3847
+ const I = () => {
3848
+ p(window.matchMedia("(prefers-color-scheme: dark)").matches);
3849
+ };
3850
+ I();
3851
+ const D = window.matchMedia("(prefers-color-scheme: dark)");
3852
+ return D.addEventListener("change", I), () => D.removeEventListener("change", I);
3853
+ } else
3854
+ p(e.theme === "dark");
3855
+ }, [e.theme]);
3856
+ const M = async () => {
3857
+ const I = h.trim();
3858
+ !I && $.length === 0 || c || (await n(I, void 0, $.length ? $ : void 0), g(""), f(), setTimeout(() => {
3859
+ var D;
3860
+ (D = w.current) == null || D.focus();
3861
+ }, 100));
3862
+ }, C = (I) => {
3863
+ I.key === "Enter" && !I.shiftKey && (I.preventDefault(), M());
3864
+ }, E = F.useMemo(() => e.height === "100%" || e.height === "100vh" ? {
3865
+ height: "100%",
3866
+ minHeight: 0,
3867
+ display: "flex",
3868
+ flexDirection: "column",
3869
+ borderRadius: "8px"
3870
+ } : {
3871
+ height: e.height,
3872
+ display: "flex",
3873
+ flexDirection: "column",
3874
+ borderRadius: "8px"
3875
+ }, [e.height]), K = (I) => {
3876
+ k && (I.preventDefault(), I.dataTransfer.dropEffect = "copy");
3877
+ }, P = async (I) => {
3878
+ if (!k) return;
3879
+ I.preventDefault();
3880
+ const D = await Ut(I.dataTransfer);
3881
+ D.length && await o(D);
3882
+ };
3883
+ return /* @__PURE__ */ l.jsx(
3884
+ jn,
3885
+ {
3886
+ "data-theme": A(),
3887
+ style: E,
3888
+ children: e.quickQuestions && e.quickQuestions.length > 0 && !d ? /* @__PURE__ */ l.jsx(
3889
+ tr,
3890
+ {
3891
+ config: e,
3892
+ onQuestionClick: async (I) => {
3893
+ await n(I);
3894
+ },
3895
+ onSendMessage: n,
3896
+ isLoading: c
3897
+ }
3898
+ ) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3899
+ /* @__PURE__ */ l.jsx(nr, { style: { flex: 1 }, onDragOver: K, onDrop: P, children: /* @__PURE__ */ l.jsxs(or, { children: [
3900
+ r.map((I) => /* @__PURE__ */ l.jsxs(
3901
+ "div",
3902
+ {
3903
+ style: {
3904
+ display: "flex",
3905
+ marginBottom: "16px",
3906
+ justifyContent: I.role === "user" ? "flex-end" : "flex-start",
3907
+ alignItems: "flex-start",
3908
+ gap: "8px"
3909
+ },
3910
+ children: [
3911
+ I.role === "assistant" && e.agentImage && /* @__PURE__ */ l.jsx(
3912
+ xe,
3913
+ {
3914
+ src: e.agentImage,
3915
+ alt: e.chatName || "Agent",
3916
+ $size: "28px"
3917
+ }
3918
+ ),
3919
+ /* @__PURE__ */ l.jsx(Ee, { $isUser: I.role === "user", children: I.role === "assistant" ? /* @__PURE__ */ l.jsx(Yt, { content: I.content }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3920
+ I.attachments && I.attachments.length > 0 && /* @__PURE__ */ l.jsx(Ae, { attachments: I.attachments, readOnly: !0 }),
3921
+ I.content ? I.content : null
3922
+ ] }) })
3923
+ ]
3924
+ },
3925
+ I.id
3926
+ )),
3927
+ c && /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", justifyContent: "flex-start", alignItems: "flex-start", gap: "8px", marginBottom: "16px" }, children: [
3928
+ e.agentImage && /* @__PURE__ */ l.jsx(
3929
+ xe,
3930
+ {
3931
+ src: e.agentImage,
3932
+ alt: e.chatName || "Agent",
3933
+ $size: "28px"
3934
+ }
3935
+ ),
3936
+ /* @__PURE__ */ l.jsx(Ee, { $isUser: !1, children: /* @__PURE__ */ l.jsxs(Xt, { children: [
3937
+ /* @__PURE__ */ l.jsx("div", { className: "dot" }),
3938
+ /* @__PURE__ */ l.jsx("div", { className: "dot" }),
3939
+ /* @__PURE__ */ l.jsx("div", { className: "dot" })
3940
+ ] }) })
3941
+ ] }),
3942
+ u && /* @__PURE__ */ l.jsx(er, { children: u })
3943
+ ] }) }),
3944
+ /* @__PURE__ */ l.jsxs(Zt, { style: { flexDirection: "column", alignItems: "stretch", gap: 0 }, children: [
3945
+ (j || k && $.length > 0) && /* @__PURE__ */ l.jsxs("div", { style: { paddingBottom: 8 }, children: [
3946
+ j && /* @__PURE__ */ l.jsx("div", { style: { fontSize: 12, color: "#dc2626", marginBottom: 4 }, children: j }),
3947
+ k && $.length > 0 && /* @__PURE__ */ l.jsx(Ae, { attachments: $, onRemove: s })
3948
+ ] }),
3949
+ /* @__PURE__ */ l.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ l.jsxs(Qt, { children: [
3950
+ /* @__PURE__ */ l.jsx(
3951
+ ft,
3952
+ {
3953
+ ref: w,
3954
+ variant: "composer",
3955
+ value: h,
3956
+ onChange: g,
3957
+ onKeyDown: C,
3958
+ placeholder: e.placeholder,
3959
+ disabled: c
3960
+ }
3961
+ ),
3962
+ /* @__PURE__ */ l.jsxs(Vt, { children: [
3963
+ /* @__PURE__ */ l.jsx("div", { style: { display: "flex", alignItems: "center", gap: 8, flex: 1, minWidth: 0 }, children: k && /* @__PURE__ */ l.jsx(
3964
+ Ht,
3965
+ {
3966
+ integrated: !0,
3967
+ disabled: c,
3968
+ maxFileBytes: y,
3969
+ maxFiles: m,
3970
+ allowedMime: x,
3971
+ currentCount: $.length,
3972
+ uploadAttachment: a,
3973
+ onUploaded: i,
3974
+ onError: S
3975
+ }
3976
+ ) }),
3977
+ /* @__PURE__ */ l.jsx(
3978
+ Jt,
3979
+ {
3980
+ type: "button",
3981
+ onClick: M,
3982
+ disabled: c || !h.trim() && $.length === 0,
3983
+ "aria-label": "Send message",
3984
+ children: /* @__PURE__ */ l.jsx(ht, { size: 13 })
3985
+ }
3986
+ )
3987
+ ] })
3988
+ ] }) })
3989
+ ] })
3990
+ ] })
3991
+ }
3992
+ );
3993
+ }
3994
+ const Qs = T.div`
3995
+ display: flex;
3996
+ align-items: center;
3997
+ justify-content: space-between;
3998
+ padding: 12px 16px;
3999
+ border-radius: 8px 8px 0 0;
4000
+ background: ${(e) => e.$showWelcomeScreen && e.$primaryColor ? e.$primaryColor : "#ffffff"};
4001
+ color: ${(e) => e.$showWelcomeScreen && e.$primaryColor ? "white" : "#111827"};
4002
+ border-bottom: none;
4003
+ transition: background-color 0.3s ease, color 0.3s ease;
4004
+
4005
+ @media (prefers-color-scheme: dark) {
4006
+ background: ${(e) => e.$showWelcomeScreen && e.$primaryColor ? e.$primaryColor : "#1f2937"};
4007
+ color: ${(e) => e.$showWelcomeScreen && e.$primaryColor ? "white" : "#f9fafb"};
4008
+ border-bottom: none;
4009
+ }
4010
+
4011
+ [data-theme="dark"] & {
4012
+ background: ${(e) => e.$showWelcomeScreen && e.$primaryColor ? e.$primaryColor : "#1f2937"};
4013
+ color: ${(e) => e.$showWelcomeScreen && e.$primaryColor ? "white" : "#f9fafb"};
4014
+ }
4015
+
4016
+ [data-theme="light"] & {
4017
+ background: ${(e) => e.$showWelcomeScreen && e.$primaryColor ? e.$primaryColor : "#ffffff"};
4018
+ color: ${(e) => e.$showWelcomeScreen && e.$primaryColor ? "white" : "#111827"};
4019
+ }
4020
+ `, Vs = T.div`
4021
+ display: flex;
4022
+ align-items: center;
4023
+ gap: 12px;
4024
+ `, Zs = T.div`
4025
+ display: flex;
4026
+ align-items: center;
4027
+ gap: 8px;
4028
+ `, Js = T.div`
4029
+ width: 8px;
4030
+ height: 8px;
4031
+ background: #10b981;
4032
+ border-radius: 50%;
4033
+ animation: pulse 2s infinite;
4034
+
4035
+ @keyframes pulse {
4036
+ 0%, 100% {
4037
+ opacity: 1;
4038
+ }
4039
+ 50% {
4040
+ opacity: 0.5;
4041
+ }
4042
+ }
4043
+ `, Xs = T.span`
4044
+ font-weight: 500;
4045
+ font-size: 14px;
4046
+ `, ei = T.div`
4047
+ display: flex;
4048
+ align-items: center;
4049
+ gap: 4px;
4050
+ `, ti = T.button`
4051
+ padding: 4px;
4052
+ background: transparent;
4053
+ border: none;
4054
+ color: inherit;
4055
+ cursor: pointer;
4056
+ border-radius: 4px;
4057
+ transition: background-color 0.2s ease;
4058
+ display: flex;
4059
+ align-items: center;
4060
+ justify-content: center;
4061
+
4062
+ &:hover {
4063
+ background: rgba(255, 255, 255, 0.1);
4064
+ }
4065
+
4066
+ svg {
4067
+ width: 16px;
4068
+ height: 16px;
4069
+ }
4070
+ `;
4071
+ function ri({
4072
+ chatName: e = "Chat Assistant",
4073
+ showCloseButton: t = !0,
4074
+ onClose: r,
4075
+ agentImage: n,
4076
+ className: a,
4077
+ primaryColor: c,
4078
+ showWelcomeScreen: u = !1
4079
+ }) {
4080
+ return /* @__PURE__ */ l.jsxs(
4081
+ Qs,
4082
+ {
4083
+ className: a,
4084
+ $primaryColor: c,
4085
+ $showWelcomeScreen: u,
4086
+ children: [
4087
+ /* @__PURE__ */ l.jsxs(Vs, { children: [
4088
+ n && /* @__PURE__ */ l.jsx(
4089
+ xe,
4090
+ {
4091
+ src: n,
4092
+ alt: e || "Agent",
4093
+ $size: "32px"
4094
+ }
4095
+ ),
4096
+ /* @__PURE__ */ l.jsxs(Zs, { children: [
4097
+ /* @__PURE__ */ l.jsx(Js, {}),
4098
+ /* @__PURE__ */ l.jsx(Xs, { children: e })
4099
+ ] })
4100
+ ] }),
4101
+ /* @__PURE__ */ l.jsx(ei, { children: t && /* @__PURE__ */ l.jsx(
4102
+ ti,
4103
+ {
4104
+ onClick: r,
4105
+ "aria-label": "Close",
4106
+ children: /* @__PURE__ */ l.jsx(Bs, { size: 16 })
4107
+ }
4108
+ ) })
4109
+ ]
4110
+ }
4111
+ );
4112
+ }
4113
+ function Nr({ config: e, chat: t }) {
4114
+ const { messages: r, sendMessage: n, uploadAttachment: a, isLoading: c, error: u, isOpen: d, setIsOpen: h, hasSessionStarted: g } = t, [b, p] = F.useState(""), [w, k] = F.useState(e.height || 600), [$, j] = F.useState(!1), S = F.useRef(null), {
4115
+ enabled: o,
4116
+ staged: i,
4117
+ attachmentError: s,
4118
+ setAttachmentError: f,
4119
+ addFiles: m,
4120
+ appendStaged: y,
4121
+ removeStaged: x,
4122
+ clearStaged: A,
4123
+ maxFiles: M,
4124
+ maxBytes: C,
4125
+ allowed: E
4126
+ } = rr(e, a), K = () => e.theme === "dark" ? "dark" : e.theme === "light" ? "light" : $ ? "dark" : "light";
4127
+ F.useEffect(() => {
4128
+ if (e.theme === "auto" || !e.theme) {
4129
+ const v = () => {
4130
+ j(window.matchMedia("(prefers-color-scheme: dark)").matches);
4131
+ };
4132
+ v();
4133
+ const N = window.matchMedia("(prefers-color-scheme: dark)");
4134
+ return N.addEventListener("change", v), () => N.removeEventListener("change", v);
4135
+ } else
4136
+ j(e.theme === "dark");
4137
+ }, [e.theme]);
4138
+ const P = async () => {
4139
+ const v = b.trim();
4140
+ !v && i.length === 0 || c || (await n(v, void 0, i.length ? i : void 0), p(""), A(), setTimeout(() => {
4141
+ var N;
4142
+ (N = S.current) == null || N.focus();
4143
+ }, 100));
4144
+ }, I = (v) => {
4145
+ v.key === "Enter" && !v.shiftKey && (v.preventDefault(), P());
4146
+ }, D = (v) => {
4147
+ o && (v.preventDefault(), v.dataTransfer.dropEffect = "copy");
4148
+ }, H = async (v) => {
4149
+ if (!o) return;
4150
+ v.preventDefault();
4151
+ const N = await Ut(v.dataTransfer);
4152
+ N.length && await m(N);
4153
+ };
4154
+ return d ? /* @__PURE__ */ l.jsxs(
4155
+ Ts,
4156
+ {
4157
+ $position: e.position || "bottom-right",
4158
+ "data-theme": K(),
4159
+ style: {
4160
+ height: w,
4161
+ ...e.chatWindowStyle
4162
+ },
4163
+ children: [
4164
+ e.resizable !== !1 && /* @__PURE__ */ l.jsx(
4165
+ Es,
4166
+ {
4167
+ $position: "top",
4168
+ onMouseDown: (v) => {
4169
+ v.preventDefault();
4170
+ const N = v.clientY, R = typeof w == "number" ? w : 600, W = (q) => {
4171
+ const z = q.clientY - N, U = R - z;
4172
+ k(Math.max(200, Math.min(600, U)));
4173
+ }, O = () => {
4174
+ document.removeEventListener("mousemove", W), document.removeEventListener("mouseup", O);
4175
+ };
4176
+ document.addEventListener("mousemove", W), document.addEventListener("mouseup", O);
4177
+ }
4178
+ }
4179
+ ),
4180
+ e.showHeader !== !1 && /* @__PURE__ */ l.jsx(
4181
+ ri,
4182
+ {
4183
+ agentImage: e.agentImage,
4184
+ chatName: e.chatName,
4185
+ onClose: () => h(!1),
4186
+ primaryColor: e.primaryColor,
4187
+ showWelcomeScreen: e.quickQuestions && e.quickQuestions.length > 0 && !g
4188
+ }
4189
+ ),
4190
+ e.quickQuestions && e.quickQuestions.length > 0 && !g ? /* @__PURE__ */ l.jsx(
4191
+ tr,
4192
+ {
4193
+ config: e,
4194
+ onQuestionClick: async (v) => {
4195
+ await n(v);
4196
+ },
4197
+ onSendMessage: n,
4198
+ isLoading: c
4199
+ }
4200
+ ) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4201
+ /* @__PURE__ */ l.jsx(nr, { onDragOver: D, onDrop: H, children: /* @__PURE__ */ l.jsxs(or, { children: [
4202
+ r.map((v) => /* @__PURE__ */ l.jsxs(
4203
+ "div",
4204
+ {
4205
+ style: {
4206
+ display: "flex",
4207
+ marginBottom: "16px",
4208
+ justifyContent: v.role === "user" ? "flex-end" : "flex-start",
4209
+ alignItems: "flex-start",
4210
+ gap: "8px"
4211
+ },
4212
+ children: [
4213
+ v.role === "assistant" && e.agentImage && /* @__PURE__ */ l.jsx(
4214
+ xe,
4215
+ {
4216
+ src: e.agentImage,
4217
+ alt: e.chatName || "Agent",
4218
+ $size: "28px"
4219
+ }
4220
+ ),
4221
+ /* @__PURE__ */ l.jsx(Ee, { $isUser: v.role === "user", children: v.role === "assistant" ? /* @__PURE__ */ l.jsx(Yt, { content: v.content }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4222
+ v.attachments && v.attachments.length > 0 && /* @__PURE__ */ l.jsx(Ae, { attachments: v.attachments, readOnly: !0 }),
4223
+ v.content ? v.content : null
4224
+ ] }) })
4225
+ ]
4226
+ },
4227
+ v.id
4228
+ )),
4229
+ c && /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", justifyContent: "flex-start", alignItems: "flex-start", gap: "8px", marginBottom: "16px" }, children: [
4230
+ e.agentImage && /* @__PURE__ */ l.jsx(
4231
+ xe,
4232
+ {
4233
+ src: e.agentImage,
4234
+ alt: e.chatName || "Agent",
4235
+ $size: "28px"
4236
+ }
4237
+ ),
4238
+ /* @__PURE__ */ l.jsx(Ee, { $isUser: !1, children: /* @__PURE__ */ l.jsxs(Xt, { children: [
4239
+ /* @__PURE__ */ l.jsx("div", { className: "dot" }),
4240
+ /* @__PURE__ */ l.jsx("div", { className: "dot" }),
4241
+ /* @__PURE__ */ l.jsx("div", { className: "dot" })
4242
+ ] }) })
4243
+ ] }),
4244
+ u && /* @__PURE__ */ l.jsx(er, { children: u })
4245
+ ] }) }),
4246
+ /* @__PURE__ */ l.jsxs(Zt, { style: { flexDirection: "column", alignItems: "stretch", gap: 0 }, children: [
4247
+ (s || o && i.length > 0) && /* @__PURE__ */ l.jsxs("div", { style: { paddingBottom: 8 }, children: [
4248
+ s && /* @__PURE__ */ l.jsx("div", { style: { fontSize: 12, color: "#dc2626", marginBottom: 4 }, children: s }),
4249
+ o && i.length > 0 && /* @__PURE__ */ l.jsx(Ae, { attachments: i, onRemove: x })
4250
+ ] }),
4251
+ /* @__PURE__ */ l.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ l.jsxs(Qt, { children: [
4252
+ /* @__PURE__ */ l.jsx(
4253
+ ft,
4254
+ {
4255
+ ref: S,
4256
+ variant: "composer",
4257
+ value: b,
4258
+ onChange: p,
4259
+ onKeyDown: I,
4260
+ placeholder: e.placeholder,
4261
+ disabled: c
4262
+ }
4263
+ ),
4264
+ /* @__PURE__ */ l.jsxs(Vt, { children: [
4265
+ /* @__PURE__ */ l.jsx("div", { style: { display: "flex", alignItems: "center", gap: 8, flex: 1, minWidth: 0 }, children: o && /* @__PURE__ */ l.jsx(
4266
+ Ht,
4267
+ {
4268
+ integrated: !0,
4269
+ disabled: c,
4270
+ maxFileBytes: C,
4271
+ maxFiles: M,
4272
+ allowedMime: E,
4273
+ currentCount: i.length,
4274
+ uploadAttachment: a,
4275
+ onUploaded: y,
4276
+ onError: f
4277
+ }
4278
+ ) }),
4279
+ /* @__PURE__ */ l.jsx(
4280
+ Jt,
4281
+ {
4282
+ type: "button",
4283
+ onClick: P,
4284
+ disabled: c || !b.trim() && i.length === 0,
4285
+ "aria-label": "Send message",
4286
+ children: /* @__PURE__ */ l.jsx(ht, { size: 13 })
4287
+ }
4288
+ )
4289
+ ] })
4290
+ ] }) })
4291
+ ] })
4292
+ ] })
4293
+ ]
4294
+ }
4295
+ ) : /* @__PURE__ */ l.jsxs(
4296
+ As,
4297
+ {
4298
+ onClick: () => h(!0),
4299
+ style: e.buttonStyle,
4300
+ $position: e.position || "bottom-right",
4301
+ $primaryColor: e.primaryColor,
4302
+ "aria-label": "Open chat",
4303
+ children: [
4304
+ /* @__PURE__ */ l.jsx("div", { className: "icon-container", children: /* @__PURE__ */ l.jsx(Os, { size: 16 }) }),
4305
+ /* @__PURE__ */ l.jsx("span", { children: e.buttonText || e.chatName || "AI Chat" })
4306
+ ]
4307
+ }
4308
+ );
4309
+ }
4310
+ function li(e) {
4311
+ const t = Un(e), r = Wn(t);
4312
+ switch (t.mode) {
4313
+ case "floating":
4314
+ return /* @__PURE__ */ l.jsx(Nr, { config: t, chat: r });
4315
+ case "embedded":
4316
+ return /* @__PURE__ */ l.jsx(Ys, { config: t, chat: r });
4317
+ default:
4318
+ return /* @__PURE__ */ l.jsx(Nr, { config: t, chat: r });
4319
+ }
4320
+ }
4321
+ function di({ config: e, chat: t }) {
4322
+ const { messages: r, sendMessage: n, uploadAttachment: a, isLoading: c, error: u, hasSessionStarted: d } = t, [h, g] = F.useState(""), b = F.useRef(null), {
4323
+ enabled: p,
4324
+ staged: w,
4325
+ attachmentError: k,
4326
+ setAttachmentError: $,
4327
+ addFiles: j,
4328
+ appendStaged: S,
4329
+ removeStaged: o,
4330
+ clearStaged: i,
4331
+ maxFiles: s,
4332
+ maxBytes: f,
4333
+ allowed: m
4334
+ } = rr(e, a), y = async () => {
4335
+ const C = h.trim();
4336
+ !C && w.length === 0 || c || (await n(C, void 0, w.length ? w : void 0), g(""), i(), setTimeout(() => {
4337
+ var E;
4338
+ (E = b.current) == null || E.focus();
4339
+ }, 100));
4340
+ }, x = (C) => {
4341
+ C.key === "Enter" && !C.shiftKey && (C.preventDefault(), y());
4342
+ }, A = (C) => {
4343
+ p && (C.preventDefault(), C.dataTransfer.dropEffect = "copy");
4344
+ }, M = async (C) => {
4345
+ if (!p) return;
4346
+ C.preventDefault();
4347
+ const E = await Ut(C.dataTransfer);
4348
+ E.length && await j(E);
4349
+ };
4350
+ return /* @__PURE__ */ l.jsx(
4351
+ jn,
4352
+ {
4353
+ style: {
4354
+ height: e.height,
4355
+ display: "flex",
4356
+ flexDirection: "column",
4357
+ backgroundColor: "white",
4358
+ border: "1px solid #e5e7eb",
4359
+ borderRadius: "8px"
4360
+ },
4361
+ children: e.quickQuestions && e.quickQuestions.length > 0 && !d ? /* @__PURE__ */ l.jsx(
4362
+ tr,
4363
+ {
4364
+ config: e,
4365
+ onQuestionClick: async (C) => {
4366
+ await n(C);
4367
+ },
4368
+ onSendMessage: n,
4369
+ isLoading: c
4370
+ }
4371
+ ) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4372
+ /* @__PURE__ */ l.jsx(nr, { style: { flex: 1 }, onDragOver: A, onDrop: M, children: /* @__PURE__ */ l.jsxs(or, { children: [
4373
+ r.map((C) => /* @__PURE__ */ l.jsxs(
4374
+ "div",
4375
+ {
4376
+ style: {
4377
+ display: "flex",
4378
+ marginBottom: "12px",
4379
+ justifyContent: C.role === "user" ? "flex-end" : "flex-start",
4380
+ alignItems: "flex-start",
4381
+ gap: "8px"
4382
+ },
4383
+ children: [
4384
+ C.role === "assistant" && e.agentImage && /* @__PURE__ */ l.jsx(
4385
+ xe,
4386
+ {
4387
+ src: e.agentImage,
4388
+ alt: e.chatName || "Agent",
4389
+ $size: "28px"
4390
+ }
4391
+ ),
4392
+ /* @__PURE__ */ l.jsx(Ee, { $isUser: C.role === "user", children: C.role === "assistant" ? /* @__PURE__ */ l.jsx(Yt, { content: C.content }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4393
+ C.attachments && C.attachments.length > 0 && /* @__PURE__ */ l.jsx(Ae, { attachments: C.attachments, readOnly: !0 }),
4394
+ C.content ? C.content : null
4395
+ ] }) })
4396
+ ]
4397
+ },
4398
+ C.id
4399
+ )),
4400
+ c && /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", justifyContent: "flex-start", alignItems: "flex-start", gap: "8px", marginBottom: "12px" }, children: [
4401
+ e.agentImage && /* @__PURE__ */ l.jsx(
4402
+ xe,
4403
+ {
4404
+ src: e.agentImage,
4405
+ alt: e.chatName || "Agent",
4406
+ $size: "28px"
4407
+ }
4408
+ ),
4409
+ /* @__PURE__ */ l.jsx(Ee, { $isUser: !1, children: /* @__PURE__ */ l.jsxs(Xt, { children: [
4410
+ /* @__PURE__ */ l.jsx("div", { className: "dot" }),
4411
+ /* @__PURE__ */ l.jsx("div", { className: "dot" }),
4412
+ /* @__PURE__ */ l.jsx("div", { className: "dot" })
4413
+ ] }) })
4414
+ ] }),
4415
+ u && /* @__PURE__ */ l.jsx(er, { children: u })
4416
+ ] }) }),
4417
+ /* @__PURE__ */ l.jsxs(Zt, { style: { flexDirection: "column", alignItems: "stretch", gap: 0 }, children: [
4418
+ (k || p && w.length > 0) && /* @__PURE__ */ l.jsxs("div", { style: { paddingBottom: 8 }, children: [
4419
+ k && /* @__PURE__ */ l.jsx("div", { style: { fontSize: 12, color: "#dc2626", marginBottom: 4 }, children: k }),
4420
+ p && w.length > 0 && /* @__PURE__ */ l.jsx(Ae, { attachments: w, onRemove: o })
4421
+ ] }),
4422
+ /* @__PURE__ */ l.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ l.jsxs(Qt, { children: [
4423
+ /* @__PURE__ */ l.jsx(
4424
+ ft,
4425
+ {
4426
+ ref: b,
4427
+ variant: "composer",
4428
+ value: h,
4429
+ onChange: g,
4430
+ onKeyDown: x,
4431
+ placeholder: e.placeholder,
4432
+ disabled: c
4433
+ }
4434
+ ),
4435
+ /* @__PURE__ */ l.jsxs(Vt, { children: [
4436
+ /* @__PURE__ */ l.jsx("div", { style: { display: "flex", alignItems: "center", gap: 8, flex: 1, minWidth: 0 }, children: p && /* @__PURE__ */ l.jsx(
4437
+ Ht,
4438
+ {
4439
+ integrated: !0,
4440
+ disabled: c,
4441
+ maxFileBytes: f,
4442
+ maxFiles: s,
4443
+ allowedMime: m,
4444
+ currentCount: w.length,
4445
+ uploadAttachment: a,
4446
+ onUploaded: S,
4447
+ onError: $
4448
+ }
4449
+ ) }),
4450
+ /* @__PURE__ */ l.jsx(
4451
+ Jt,
4452
+ {
4453
+ type: "button",
4454
+ onClick: y,
4455
+ disabled: c || !h.trim() && w.length === 0,
4456
+ "aria-label": "Send message",
4457
+ children: /* @__PURE__ */ l.jsx(ht, { size: 13 })
4458
+ }
4459
+ )
4460
+ ] })
4461
+ ] }) })
4462
+ ] })
4463
+ ] })
4464
+ }
4465
+ );
4466
+ }
4467
+ export {
4468
+ Ys as EmbeddedChat,
4469
+ Nr as FloatingChat,
4470
+ di as InlineChat,
4471
+ Yt as MarkdownRenderer,
4472
+ Ln as OrdifyApiClient,
4473
+ li as OrdifyChat,
4474
+ ii as debounce,
4475
+ si as formatTime,
4476
+ We as generateId,
4477
+ Fn as parseStreamingResponse,
4478
+ ci as throttle,
4479
+ Wn as useOrdifyChat,
4480
+ Un as useOrdifyConfig,
4481
+ rr as useWidgetAttachmentStaging
4482
+ };