ordify-chat-widget 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,8 +1,8 @@
1
- var Dn = Object.defineProperty;
2
- var Pn = (e, t, r) => t in e ? Dn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var yt = (e, t, r) => Pn(e, typeof t != "symbol" ? t + "" : t, r);
1
+ var Pn = Object.defineProperty;
2
+ var zn = (e, t, r) => t in e ? Pn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var yt = (e, t, r) => zn(e, typeof t != "symbol" ? t + "" : t, r);
4
4
  import * as Bt from "react";
5
- import L, { useState as ee, useRef as ae, useEffect as ze, useCallback as Z, useMemo as Lt, forwardRef as Ur, createElement as Xe, useContext as Hr, useImperativeHandle as zn, useLayoutEffect as On, createContext as Nn } from "react";
5
+ import F, { useState as ee, useRef as ae, useEffect as De, useCallback as Z, useMemo as Lt, forwardRef as Ur, createElement as Xe, useContext as Hr, useImperativeHandle as Dn, useLayoutEffect as On, createContext as Nn } from "react";
6
6
  var qr = { exports: {} }, at = {};
7
7
  /**
8
8
  * @license React
@@ -13,13 +13,13 @@ var qr = { exports: {} }, at = {};
13
13
  * This source code is licensed under the MIT license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
- var Bn = L, Ln = Symbol.for("react.element"), Fn = Symbol.for("react.fragment"), Kn = Object.prototype.hasOwnProperty, Wn = Bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Un = { key: !0, ref: !0, __self: !0, __source: !0 };
16
+ var Bn = F, Ln = Symbol.for("react.element"), Fn = Symbol.for("react.fragment"), Wn = Object.prototype.hasOwnProperty, Kn = Bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Un = { key: !0, ref: !0, __self: !0, __source: !0 };
17
17
  function Gr(e, t, r) {
18
- var n, a = {}, c = null, u = null;
18
+ var n, o = {}, c = null, u = null;
19
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) Kn.call(t, n) && !Un.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: Ln, type: e, key: c, ref: u, props: a, _owner: Wn.current };
20
+ for (n in t) Wn.call(t, n) && !Un.hasOwnProperty(n) && (o[n] = t[n]);
21
+ if (e && e.defaultProps) for (n in t = e.defaultProps, t) o[n] === void 0 && (o[n] = t[n]);
22
+ return { $$typeof: Ln, type: e, key: c, ref: u, props: o, _owner: Kn.current };
23
23
  }
24
24
  at.Fragment = Fn;
25
25
  at.jsx = Gr;
@@ -29,20 +29,20 @@ var l = qr.exports;
29
29
  function He() {
30
30
  return Math.random().toString(36).substr(2, 9);
31
31
  }
32
- function xi(e) {
32
+ function ki(e) {
33
33
  return new Intl.DateTimeFormat("en-US", {
34
34
  hour: "2-digit",
35
35
  minute: "2-digit",
36
36
  hour12: !0
37
37
  }).format(e);
38
38
  }
39
- function ki(e, t) {
39
+ function wi(e, t) {
40
40
  let r;
41
41
  return (...n) => {
42
42
  clearTimeout(r), r = setTimeout(() => e(...n), t);
43
43
  };
44
44
  }
45
- function wi(e, t) {
45
+ function vi(e, t) {
46
46
  let r;
47
47
  return (...n) => {
48
48
  r || (e(...n), r = !0, setTimeout(() => r = !1, t));
@@ -117,7 +117,7 @@ class Gn {
117
117
  * Export message content as PDF via POST /document-conversion/pdf (publishable or api-key auth).
118
118
  */
119
119
  async exportMessagePdf(t, r) {
120
- const n = `${this.config.apiBaseUrl}/document-conversion/pdf`, a = await fetch(n, {
120
+ const n = `${this.config.apiBaseUrl}/document-conversion/pdf`, o = await fetch(n, {
121
121
  method: "POST",
122
122
  headers: this.getAuthHeadersForPdfExport(),
123
123
  body: JSON.stringify({
@@ -132,21 +132,21 @@ class Gn {
132
132
  display_header_footer: !1
133
133
  })
134
134
  });
135
- if (!a.ok) {
136
- let p = `HTTP ${a.status}`;
135
+ if (!o.ok) {
136
+ let p = `HTTP ${o.status}`;
137
137
  try {
138
- const w = await a.json();
138
+ const w = await o.json();
139
139
  p = typeof w.detail == "string" ? w.detail : p;
140
140
  } catch {
141
141
  try {
142
- const w = await a.text();
142
+ const w = await o.text();
143
143
  w && (p = w.slice(0, 500));
144
144
  } catch {
145
145
  }
146
146
  }
147
147
  throw new Error(`PDF export failed: ${p}`);
148
148
  }
149
- const c = await a.blob(), u = a.headers.get("Content-Disposition");
149
+ const c = await o.blob(), u = o.headers.get("Content-Disposition");
150
150
  let d = r != null && r.endsWith(".pdf") ? r : `${r ?? "document"}.pdf`;
151
151
  const h = /filename\*?=(?:UTF-8''|")?([^";\n]+)/i.exec(u ?? "");
152
152
  if (h != null && h[1])
@@ -159,13 +159,14 @@ class Gn {
159
159
  const b = URL.createObjectURL(c), g = document.createElement("a");
160
160
  g.href = b, g.download = d, g.rel = "noopener noreferrer", document.body.appendChild(g), g.click(), document.body.removeChild(g), URL.revokeObjectURL(b);
161
161
  }
162
- async sendMessage(t, r, n, a) {
163
- 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(qn) : void 0, h = {
162
+ async sendMessage(t, r, n, o) {
163
+ const c = this.usePublishableKey() ? `/widget/chat/${this.config.agentId}` : `/chat/agents/${this.config.agentId}`, u = `${this.config.apiBaseUrl}${c}`, d = o != null && o.length ? o.map(qn) : void 0, h = {
164
164
  message: t,
165
165
  sessionId: r,
166
- context: n
166
+ context: n,
167
+ use_thinking: !!this.config.useThinking
167
168
  };
168
- d != null && d.length && (h.attachments = d, h.use_document_understanding = d.some(
169
+ this.usePublishableKey() && (h.enable_image_generation = this.config.enableImageGeneration === !0), d != null && d.length && (h.attachments = d, h.use_document_understanding = d.some(
169
170
  (g) => g.type === "document" || !g.type && !String(g.content_type || "").startsWith("image/")
170
171
  ));
171
172
  const b = await fetch(u, {
@@ -189,20 +190,20 @@ class Gn {
189
190
  throw new Error("[Ordify] uploadAttachment requires publishableKey.");
190
191
  const r = `${this.config.apiBaseUrl}/widget/attachments`, n = new FormData();
191
192
  n.append("file", t);
192
- const a = await fetch(r, {
193
+ const o = await fetch(r, {
193
194
  method: "POST",
194
195
  headers: this.getAuthHeaders(!1),
195
196
  body: n
196
197
  });
197
- if (!a.ok) {
198
- let u = `HTTP ${a.status}`;
198
+ if (!o.ok) {
199
+ let u = `HTTP ${o.status}`;
199
200
  try {
200
- u = (await a.json()).detail || u;
201
+ u = (await o.json()).detail || u;
201
202
  } catch {
202
203
  }
203
204
  throw new Error(`API Error: ${u}`);
204
205
  }
205
- const c = await a.json();
206
+ const c = await o.json();
206
207
  if (!(c != null && c.url) || !(c != null && c.content_type) || !(c != null && c.name))
207
208
  throw new Error("Invalid attachment response from server");
208
209
  return {
@@ -228,21 +229,21 @@ class Gn {
228
229
  })
229
230
  });
230
231
  if (!n.ok) {
231
- const a = await n.json();
232
- throw new Error(`API Error: ${a.detail}`);
232
+ const o = await n.json();
233
+ throw new Error(`API Error: ${o.detail}`);
233
234
  }
234
235
  return n.json();
235
236
  }
236
237
  async getSessionWithMessages(t) {
237
- const r = this.usePublishableKey() ? `/widget/sessions/${t}/with-messages` : `/sessions/${t}/with-messages`, n = `${this.config.apiBaseUrl}${r}`, a = await fetch(n, {
238
+ const r = this.usePublishableKey() ? `/widget/sessions/${t}/with-messages` : `/sessions/${t}/with-messages`, n = `${this.config.apiBaseUrl}${r}`, o = await fetch(n, {
238
239
  method: "GET",
239
240
  headers: this.getAuthHeaders()
240
241
  });
241
- if (!a.ok) {
242
- const c = await a.json();
242
+ if (!o.ok) {
243
+ const c = await o.json();
243
244
  throw new Error(`API Error: ${c.detail}`);
244
245
  }
245
- return a.json();
246
+ return o.json();
246
247
  }
247
248
  /** @deprecated Use the Ordify dashboard to list agents. Will be removed in a future major version. */
248
249
  async getAgents() {
@@ -253,8 +254,8 @@ class Gn {
253
254
  headers: { "api-key": this.config.apiKey, accept: "application/json" }
254
255
  });
255
256
  if (!r.ok) {
256
- const a = await r.json();
257
- throw new Error(`API Error: ${a.detail}`);
257
+ const o = await r.json();
258
+ throw new Error(`API Error: ${o.detail}`);
258
259
  }
259
260
  return (await r.json()).agents || [];
260
261
  }
@@ -280,7 +281,37 @@ function Yn(e) {
280
281
  if (t === "[DONE]" || t === "")
281
282
  return { text: "", sessionId: "", type: "done" };
282
283
  const r = JSON.parse(t);
283
- return r.done ? { text: "", sessionId: r.sessionId || "", type: "done" } : r.type === "adk_tool" || r.type === "turn_complete" || r.type === "image" ? null : r;
284
+ if (r.done)
285
+ return { text: "", sessionId: r.sessionId || "", type: "done" };
286
+ if (r.type === "turn_complete")
287
+ return null;
288
+ if (r.type === "adk_tool") {
289
+ const n = typeof r.content == "string" ? r.content.trim() : "";
290
+ return n ? {
291
+ type: "stream",
292
+ text: `
293
+
294
+ ${n}
295
+
296
+ `,
297
+ sessionId: r.sessionId || "",
298
+ agentName: r.agentName
299
+ } : null;
300
+ }
301
+ if (r.type === "image") {
302
+ const n = typeof r.url == "string" ? r.url.trim() : "";
303
+ return n && (n.startsWith("https://") || n.startsWith("http://")) ? {
304
+ type: "stream",
305
+ text: `
306
+
307
+ ![Generated image](${n})
308
+
309
+ `,
310
+ sessionId: r.sessionId || "",
311
+ agentName: r.agentName
312
+ } : null;
313
+ }
314
+ return r;
284
315
  }
285
316
  } catch (t) {
286
317
  console.warn("Failed to parse streaming response:", t);
@@ -296,12 +327,12 @@ function Qn(e) {
296
327
  if (!t || !Array.isArray(t) || t.length === 0) return;
297
328
  const r = [];
298
329
  for (const n of t) {
299
- const a = n.url || "";
300
- a && r.push({
330
+ const o = n.url || "";
331
+ o && r.push({
301
332
  id: n.id || He(),
302
333
  name: String(n.name || "attachment"),
303
334
  type: n.type === "image" ? "image" : "document",
304
- url: a,
335
+ url: o,
305
336
  content_type: String(n.content_type || n.contentType || "application/octet-stream"),
306
337
  size: n.size,
307
338
  preview: n.preview
@@ -310,69 +341,71 @@ function Qn(e) {
310
341
  return r.length ? r : void 0;
311
342
  }
312
343
  function Vn(e) {
313
- const [t, r] = ee([]), [n, a] = ee(!1), [c, u] = ee(null), [d, h] = ee(e.sessionId || null), [b, g] = ee(!1), [p, w] = ee(!1), [k, S] = ee(!1), [C, v] = ee(!1), [o, i] = ee(!1), s = ae(null), f = ae(""), m = ae(!1), x = ae(!1), y = ae(!1), A = `${e.publishableKey ?? ""}|${e.apiKey ?? ""}|${e.apiBaseUrl ?? ""}|${e.agentId}`;
344
+ const [t, r] = ee([]), [n, o] = ee(!1), [c, u] = ee(null), [d, h] = ee(e.sessionId || null), [b, g] = ee(!1), [p, w] = ee(!1), [k, S] = ee(!1), [C, v] = ee(!1), [a, i] = ee(!1), s = ae(null), f = ae(""), m = ae(!1), x = ae(!1), y = ae(!1), A = `${e.publishableKey ?? ""}|${e.apiKey ?? ""}|${e.apiBaseUrl ?? ""}|${e.agentId}|${e.useThinking === !0 ? "1" : "0"}|img:${e.enableImageGeneration === !0 ? "1" : e.enableImageGeneration === !1 ? "0" : ""}`;
314
345
  f.current !== A && (s.current = null, f.current = A), s.current || (s.current = new Gn({
315
346
  publishableKey: e.publishableKey,
316
347
  apiKey: e.apiKey,
317
348
  apiBaseUrl: e.apiBaseUrl || "https://api.ordify.ai",
318
- agentId: e.agentId
349
+ agentId: e.agentId,
350
+ useThinking: e.useThinking === !0,
351
+ enableImageGeneration: e.enableImageGeneration
319
352
  }));
320
- const M = ae(null), j = ae(/* @__PURE__ */ new Set());
321
- ze(() => {
353
+ const _ = ae(null), j = ae(/* @__PURE__ */ new Set());
354
+ De(() => {
322
355
  if (e.sessionId && e.sessionId !== d) {
323
356
  const I = j.current.has(e.sessionId);
324
- h(e.sessionId), x.current = !1, M.current = null, S(!1), I || r([]);
357
+ h(e.sessionId), x.current = !1, _.current = null, S(!1), I || r([]);
325
358
  }
326
- }, [e.sessionId]), ze(() => {
359
+ }, [e.sessionId]), De(() => {
327
360
  (async () => {
328
- const P = d || e.sessionId;
361
+ const z = d || e.sessionId;
329
362
  if (y.current || n)
330
363
  return;
331
- if (!P) {
332
- x.current = !0, M.current = null, S(!1);
364
+ if (!z) {
365
+ x.current = !0, _.current = null, S(!1);
333
366
  return;
334
367
  }
335
- if (M.current === P)
368
+ if (_.current === z)
336
369
  return;
337
- if (j.current.has(P) && t.length > 0 && !x.current) {
338
- x.current = !0, M.current = P, v(!1);
370
+ if (j.current.has(z) && t.length > 0 && !x.current) {
371
+ x.current = !0, _.current = z, v(!1);
339
372
  return;
340
373
  }
341
- M.current = P, v(!0);
374
+ _.current = z, v(!0);
342
375
  try {
343
- const $ = await s.current.getSessionWithMessages(P);
376
+ const $ = await s.current.getSessionWithMessages(z);
344
377
  if ($.messages && $.messages.length > 0) {
345
- const D = $.messages.filter((z) => !Hn(z)).map((z) => {
346
- const B = z.role === "assistant" ? "assistant" : "user", R = String(z.content || "");
378
+ const P = $.messages.filter((D) => !Hn(D)).map((D) => {
379
+ const B = D.role === "assistant" ? "assistant" : "user", R = String(D.content || "");
347
380
  return {
348
- id: z.id || He(),
381
+ id: D.id || He(),
349
382
  content: B === "assistant" ? ir(R) : R,
350
383
  role: B,
351
- timestamp: z.timestamp ? new Date(z.timestamp) : /* @__PURE__ */ new Date(),
352
- sessionId: P,
353
- attachments: Qn(z)
384
+ timestamp: D.timestamp ? new Date(D.timestamp) : /* @__PURE__ */ new Date(),
385
+ sessionId: z,
386
+ attachments: Qn(D)
354
387
  };
355
388
  });
356
- r((z) => {
357
- if (z.length > 0) {
389
+ r((D) => {
390
+ if (D.length > 0) {
358
391
  const B = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map();
359
- return z.forEach((O) => {
392
+ return D.forEach((O) => {
360
393
  B.set(O.id, O);
361
394
  const H = cr(O);
362
395
  R.has(H) || R.set(H, O);
363
- }), D.forEach((O) => {
396
+ }), P.forEach((O) => {
364
397
  const H = cr(O);
365
398
  !B.has(O.id) && !R.has(H) ? (B.set(O.id, O), R.set(H, O)) : B.has(O.id) && B.set(O.id, O);
366
399
  }), Array.from(B.values()).sort(
367
400
  (O, H) => O.timestamp.getTime() - H.timestamp.getTime()
368
401
  );
369
402
  }
370
- return D;
403
+ return P;
371
404
  }), S(!0), i(!0);
372
405
  } else
373
406
  S(!1);
374
407
  } catch ($) {
375
- console.warn("Failed to load session history:", $), S(!1), $ instanceof Error && $.message.includes("404") && (h(null), M.current = null);
408
+ console.warn("Failed to load session history:", $), S(!1), $ instanceof Error && $.message.includes("404") && (h(null), _.current = null);
376
409
  } finally {
377
410
  v(!1), x.current = !0;
378
411
  }
@@ -380,27 +413,27 @@ function Vn(e) {
380
413
  }, [d, e.sessionId]);
381
414
  const E = Z(() => {
382
415
  u(null);
383
- }, []), W = Z(async (I) => {
416
+ }, []), K = Z(async (I) => {
384
417
  if (!s.current)
385
418
  throw new Error("API client not initialized");
386
419
  return s.current.uploadAttachment(I);
387
- }, []), F = Z(async (I, P) => {
420
+ }, []), L = Z(async (I, z) => {
388
421
  if (!s.current)
389
422
  throw new Error("API client not initialized");
390
- await s.current.exportMessagePdf(I, P);
423
+ await s.current.exportMessagePdf(I, z);
391
424
  }, []), V = Z(
392
- async (I, P, U) => {
393
- const $ = I.trim(), D = !!(U && U.length > 0);
394
- if (!(!$ && !D || n)) {
395
- a(!0), u(null);
425
+ async (I, z, U) => {
426
+ const $ = I.trim(), P = !!(U && U.length > 0);
427
+ if (!(!$ && !P || n)) {
428
+ o(!0), u(null);
396
429
  try {
397
- const z = U != null && U.length ? U.map((J) => ({ ...J })) : void 0, B = {
430
+ const D = U != null && U.length ? U.map((J) => ({ ...J })) : void 0, B = {
398
431
  id: He(),
399
432
  content: $,
400
433
  role: "user",
401
434
  timestamp: /* @__PURE__ */ new Date(),
402
435
  sessionId: d || void 0,
403
- attachments: z
436
+ attachments: D
404
437
  };
405
438
  r((J) => [...J, B]), i(!0);
406
439
  let R = d || e.sessionId || null;
@@ -408,8 +441,8 @@ function Vn(e) {
408
441
  const O = (await s.current.sendMessage(
409
442
  $ || "(see attachments)",
410
443
  R,
411
- P,
412
- z
444
+ z,
445
+ D
413
446
  )).getReader(), H = new TextDecoder();
414
447
  let Q = {
415
448
  id: He(),
@@ -439,45 +472,53 @@ function Vn(e) {
439
472
  }
440
473
  }
441
474
  R && R !== d && h(R), e.onMessage && e.onMessage(Q);
442
- } catch (z) {
443
- const B = z instanceof Error ? z.message : "Failed to send message";
444
- u(B), e.onError && e.onError(z instanceof Error ? z : new Error(B));
475
+ } catch (D) {
476
+ const B = D instanceof Error ? D.message : "Failed to send message";
477
+ u(B), e.onError && e.onError(D instanceof Error ? D : new Error(B));
445
478
  } finally {
446
- y.current = !1, a(!1);
479
+ y.current = !1, o(!1);
447
480
  }
448
481
  }
449
482
  },
450
- [e.onSessionCreated, e.onMessage, e.onError, e.sessionId, n, d]
483
+ [
484
+ e.onSessionCreated,
485
+ e.onMessage,
486
+ e.onError,
487
+ e.sessionId,
488
+ e.useThinking,
489
+ n,
490
+ d
491
+ ]
451
492
  );
452
- return ze(() => {
453
- const P = !(d || e.sessionId) || !k, U = e.quickQuestions && e.quickQuestions.length > 0;
454
- if ((e.initialMessage || e.initialContext) && P && !p && !n && !C && !m.current && x.current && !U) {
493
+ return De(() => {
494
+ const z = !(d || e.sessionId) || !k, U = e.quickQuestions && e.quickQuestions.length > 0;
495
+ if ((e.initialMessage || e.initialContext) && z && !p && !n && !C && !m.current && x.current && !U) {
455
496
  w(!0), m.current = !0;
456
- let $, D;
497
+ let $, P;
457
498
  if (e.initialMessage && e.initialContext)
458
- $ = e.initialMessage, D = e.initialContext;
499
+ $ = e.initialMessage, P = e.initialContext;
459
500
  else if (e.initialMessage)
460
- $ = e.initialMessage, D = void 0;
501
+ $ = e.initialMessage, P = void 0;
461
502
  else if (e.initialContext)
462
- $ = "Hi", D = e.initialContext;
503
+ $ = "Hi", P = e.initialContext;
463
504
  else
464
505
  return;
465
506
  setTimeout(() => {
466
- V($, D);
507
+ V($, P);
467
508
  }, 0);
468
509
  }
469
510
  }, [e.initialMessage, e.initialContext, p, n, C, k, d, e.sessionId, V]), {
470
511
  messages: t,
471
512
  sendMessage: V,
472
- uploadAttachment: W,
473
- exportMessagePdf: F,
513
+ uploadAttachment: K,
514
+ exportMessagePdf: L,
474
515
  isLoading: n,
475
516
  error: c,
476
517
  clearError: E,
477
518
  sessionId: d,
478
519
  isOpen: b,
479
520
  setIsOpen: g,
480
- hasSessionStarted: o
521
+ hasSessionStarted: a
481
522
  };
482
523
  }
483
524
  function Fe(e) {
@@ -488,7 +529,7 @@ function Fe(e) {
488
529
  }
489
530
  function Zn(e) {
490
531
  return Lt(() => {
491
- const t = e.agentId || Fe("ORDIFY_AGENT_ID"), r = e.publishableKey || Fe("ORDIFY_PUBLISHABLE_KEY"), n = e.apiKey || Fe("ORDIFY_API_KEY"), a = e.apiBaseUrl || Fe("ORDIFY_API_BASE_URL") || "https://r.ordify.ai";
532
+ const t = e.agentId || Fe("ORDIFY_AGENT_ID"), r = e.publishableKey || Fe("ORDIFY_PUBLISHABLE_KEY"), n = e.apiKey || Fe("ORDIFY_API_KEY"), o = e.apiBaseUrl || Fe("ORDIFY_API_BASE_URL") || "https://r.ordify.ai";
492
533
  if (!t)
493
534
  throw new Error("Ordify agent ID is required. Provide agentId prop or set ORDIFY_AGENT_ID environment variable.");
494
535
  if (!r && !n)
@@ -499,12 +540,15 @@ function Zn(e) {
499
540
  agentId: t,
500
541
  publishableKey: r,
501
542
  apiKey: n,
502
- apiBaseUrl: a,
543
+ apiBaseUrl: o,
503
544
  mode: e.mode || "floating",
504
545
  position: e.position || "bottom-right",
505
546
  theme: e.theme || "auto",
506
547
  placeholder: e.placeholder || "Type a message...",
507
548
  height: e.height || "500px",
549
+ backgroundColor: e.backgroundColor,
550
+ textColor: e.textColor,
551
+ borderRadius: e.borderRadius,
508
552
  className: e.className || "",
509
553
  buttonStyle: e.buttonStyle || {},
510
554
  chatWindowStyle: e.chatWindowStyle || {},
@@ -526,7 +570,9 @@ function Zn(e) {
526
570
  enableAttachments: e.enableAttachments,
527
571
  maxAttachmentSizeMB: e.maxAttachmentSizeMB,
528
572
  maxAttachments: e.maxAttachments,
529
- allowedAttachmentTypes: e.allowedAttachmentTypes
573
+ allowedAttachmentTypes: e.allowedAttachmentTypes,
574
+ useThinking: e.useThinking === !0,
575
+ enableImageGeneration: e.enableImageGeneration
530
576
  };
531
577
  }, [e]);
532
578
  }
@@ -592,7 +638,7 @@ const no = Ur(
592
638
  size: t = 24,
593
639
  strokeWidth: r = 2,
594
640
  absoluteStrokeWidth: n,
595
- className: a = "",
641
+ className: o = "",
596
642
  children: c,
597
643
  iconNode: u,
598
644
  ...d
@@ -605,7 +651,7 @@ const no = Ur(
605
651
  height: t,
606
652
  stroke: e,
607
653
  strokeWidth: n ? Number(r) * 24 / Number(t) : r,
608
- className: Yr("lucide", a),
654
+ className: Yr("lucide", o),
609
655
  ...!c && !to(d) && { "aria-hidden": "true" },
610
656
  ...d
611
657
  },
@@ -623,7 +669,7 @@ const no = Ur(
623
669
  */
624
670
  const Ee = (e, t) => {
625
671
  const r = Ur(
626
- ({ className: n, ...a }, c) => Xe(no, {
672
+ ({ className: n, ...o }, c) => Xe(no, {
627
673
  ref: c,
628
674
  iconNode: t,
629
675
  className: Yr(
@@ -631,7 +677,7 @@ const Ee = (e, t) => {
631
677
  `lucide-${e}`,
632
678
  n
633
679
  ),
634
- ...a
680
+ ...o
635
681
  })
636
682
  );
637
683
  return r.displayName = lr(e), r;
@@ -709,7 +755,7 @@ const mo = [
709
755
  ], go = Ee("x", mo);
710
756
  var te = function() {
711
757
  return te = Object.assign || function(t) {
712
- for (var r, n = 1, a = arguments.length; n < a; n++) {
758
+ for (var r, n = 1, o = arguments.length; n < o; n++) {
713
759
  r = arguments[n];
714
760
  for (var c in r) Object.prototype.hasOwnProperty.call(r, c) && (t[c] = r[c]);
715
761
  }
@@ -717,11 +763,11 @@ var te = function() {
717
763
  }, te.apply(this, arguments);
718
764
  };
719
765
  function et(e, t, r) {
720
- if (r || arguments.length === 2) for (var n = 0, a = t.length, c; n < a; n++)
766
+ if (r || arguments.length === 2) for (var n = 0, o = t.length, c; n < o; n++)
721
767
  (c || !(n in t)) && (c || (c = Array.prototype.slice.call(t, 0, n)), c[n] = t[n]);
722
768
  return e.concat(c || Array.prototype.slice.call(t));
723
769
  }
724
- var K = "-ms-", Oe = "-moz-", N = "-webkit-", Qr = "comm", st = "rule", Ft = "decl", bo = "@import", Vr = "@keyframes", yo = "@layer", Zr = Math.abs, Kt = String.fromCharCode, Mt = Object.assign;
770
+ var W = "-ms-", Oe = "-moz-", N = "-webkit-", Qr = "comm", st = "rule", Ft = "decl", bo = "@import", Vr = "@keyframes", yo = "@layer", Zr = Math.abs, Wt = String.fromCharCode, Mt = Object.assign;
725
771
  function xo(e, t) {
726
772
  return G(e, 0) ^ 45 ? (((t << 2 ^ G(e, 0)) << 2 ^ G(e, 1)) << 2 ^ G(e, 2)) << 2 ^ G(e, 3) : 0;
727
773
  }
@@ -731,7 +777,7 @@ function Jr(e) {
731
777
  function ce(e, t) {
732
778
  return (e = t.exec(e)) ? e[0] : e;
733
779
  }
734
- function _(e, t, r) {
780
+ function M(e, t, r) {
735
781
  return e.replace(t, r);
736
782
  }
737
783
  function qe(e, t, r) {
@@ -740,7 +786,7 @@ function qe(e, t, r) {
740
786
  function G(e, t) {
741
787
  return e.charCodeAt(t) | 0;
742
788
  }
743
- function $e(e, t, r) {
789
+ function Se(e, t, r) {
744
790
  return e.slice(t, r);
745
791
  }
746
792
  function se(e) {
@@ -749,7 +795,7 @@ function se(e) {
749
795
  function Xr(e) {
750
796
  return e.length;
751
797
  }
752
- function Pe(e, t) {
798
+ function ze(e, t) {
753
799
  return t.push(e), e;
754
800
  }
755
801
  function ko(e, t) {
@@ -760,26 +806,26 @@ function dr(e, t) {
760
806
  return !ce(r, t);
761
807
  });
762
808
  }
763
- var it = 1, Se = 1, en = 0, re = 0, q = 0, _e = "";
764
- function ct(e, t, r, n, a, c, u, d) {
765
- return { value: e, root: t, parent: r, type: n, props: a, children: c, line: it, column: Se, length: u, return: "", siblings: d };
809
+ var it = 1, Ce = 1, en = 0, re = 0, q = 0, _e = "";
810
+ function ct(e, t, r, n, o, c, u, d) {
811
+ return { value: e, root: t, parent: r, type: n, props: o, children: c, line: it, column: Ce, length: u, return: "", siblings: d };
766
812
  }
767
813
  function fe(e, t) {
768
814
  return Mt(ct("", null, null, "", null, null, 0, e.siblings), e, { length: -e.length }, t);
769
815
  }
770
- function we(e) {
816
+ function ve(e) {
771
817
  for (; e.root; )
772
818
  e = fe(e.root, { children: [e] });
773
- Pe(e, e.siblings);
819
+ ze(e, e.siblings);
774
820
  }
775
821
  function wo() {
776
822
  return q;
777
823
  }
778
824
  function vo() {
779
- return q = re > 0 ? G(_e, --re) : 0, Se--, q === 10 && (Se = 1, it--), q;
825
+ return q = re > 0 ? G(_e, --re) : 0, Ce--, q === 10 && (Ce = 1, it--), q;
780
826
  }
781
827
  function ne() {
782
- return q = re < en ? G(_e, re++) : 0, Se++, q === 10 && (Se = 1, it++), q;
828
+ return q = re < en ? G(_e, re++) : 0, Ce++, q === 10 && (Ce = 1, it++), q;
783
829
  }
784
830
  function ye() {
785
831
  return G(_e, re);
@@ -788,7 +834,7 @@ function Ge() {
788
834
  return re;
789
835
  }
790
836
  function lt(e, t) {
791
- return $e(_e, e, t);
837
+ return Se(_e, e, t);
792
838
  }
793
839
  function Rt(e) {
794
840
  switch (e) {
@@ -823,13 +869,13 @@ function Rt(e) {
823
869
  return 0;
824
870
  }
825
871
  function $o(e) {
826
- return it = Se = 1, en = se(_e = e), re = 0, [];
872
+ return it = Ce = 1, en = se(_e = e), re = 0, [];
827
873
  }
828
874
  function So(e) {
829
875
  return _e = "", e;
830
876
  }
831
877
  function xt(e) {
832
- return Jr(lt(re - 1, Dt(e === 91 ? e + 2 : e === 40 ? e + 1 : e)));
878
+ return Jr(lt(re - 1, Pt(e === 91 ? e + 2 : e === 40 ? e + 1 : e)));
833
879
  }
834
880
  function Co(e) {
835
881
  for (; (q = ye()) && q < 33; )
@@ -841,17 +887,17 @@ function jo(e, t) {
841
887
  ;
842
888
  return lt(e, Ge() + (t < 6 && ye() == 32 && ne() == 32));
843
889
  }
844
- function Dt(e) {
890
+ function Pt(e) {
845
891
  for (; ne(); )
846
892
  switch (q) {
847
893
  case e:
848
894
  return re;
849
895
  case 34:
850
896
  case 39:
851
- e !== 34 && e !== 39 && Dt(q);
897
+ e !== 34 && e !== 39 && Pt(q);
852
898
  break;
853
899
  case 40:
854
- e === 41 && Dt(e);
900
+ e === 41 && Pt(e);
855
901
  break;
856
902
  case 92:
857
903
  ne();
@@ -863,7 +909,7 @@ function Io(e, t) {
863
909
  for (; ne() && e + q !== 57; )
864
910
  if (e + q === 84 && ye() === 47)
865
911
  break;
866
- return "/*" + lt(t, re - 1) + "*" + Kt(e === 47 ? e : ne());
912
+ return "/*" + lt(t, re - 1) + "*" + Wt(e === 47 ? e : ne());
867
913
  }
868
914
  function Ao(e) {
869
915
  for (; !Rt(ye()); )
@@ -873,12 +919,12 @@ function Ao(e) {
873
919
  function To(e) {
874
920
  return So(Ye("", null, null, null, [""], e = $o(e), 0, [0], e));
875
921
  }
876
- function Ye(e, t, r, n, a, c, u, d, h) {
877
- for (var b = 0, g = 0, p = u, w = 0, k = 0, S = 0, C = 1, v = 1, o = 1, i = 0, s = "", f = a, m = c, x = n, y = s; v; )
922
+ function Ye(e, t, r, n, o, c, u, d, h) {
923
+ for (var b = 0, g = 0, p = u, w = 0, k = 0, S = 0, C = 1, v = 1, a = 1, i = 0, s = "", f = o, m = c, x = n, y = s; v; )
878
924
  switch (S = i, i = ne()) {
879
925
  case 40:
880
926
  if (S != 108 && G(y, p - 1) == 58) {
881
- qe(y += _(xt(i), "&", "&\f"), "&\f", Zr(b ? d[b - 1] : 0)) != -1 && (o = -1);
927
+ qe(y += M(xt(i), "&", "&\f"), "&\f", Zr(b ? d[b - 1] : 0)) != -1 && (a = -1);
882
928
  break;
883
929
  }
884
930
  case 34:
@@ -899,14 +945,14 @@ function Ye(e, t, r, n, a, c, u, d, h) {
899
945
  switch (ye()) {
900
946
  case 42:
901
947
  case 47:
902
- Pe(Eo(Io(ne(), Ge()), t, r, h), h);
948
+ ze(Eo(Io(ne(), Ge()), t, r, h), h);
903
949
  break;
904
950
  default:
905
951
  y += "/";
906
952
  }
907
953
  break;
908
954
  case 123 * C:
909
- d[b++] = se(y) * o;
955
+ d[b++] = se(y) * a;
910
956
  case 125 * C:
911
957
  case 59:
912
958
  case 0:
@@ -915,12 +961,12 @@ function Ye(e, t, r, n, a, c, u, d, h) {
915
961
  case 125:
916
962
  v = 0;
917
963
  case 59 + g:
918
- o == -1 && (y = _(y, /\f/g, "")), k > 0 && se(y) - p && Pe(k > 32 ? pr(y + ";", n, r, p - 1, h) : pr(_(y, " ", "") + ";", n, r, p - 2, h), h);
964
+ a == -1 && (y = M(y, /\f/g, "")), k > 0 && se(y) - p && ze(k > 32 ? pr(y + ";", n, r, p - 1, h) : pr(M(y, " ", "") + ";", n, r, p - 2, h), h);
919
965
  break;
920
966
  case 59:
921
967
  y += ";";
922
968
  default:
923
- if (Pe(x = ur(y, t, r, b, g, a, d, s, f = [], m = [], p, c), c), i === 123)
969
+ if (ze(x = ur(y, t, r, b, g, o, d, s, f = [], m = [], p, c), c), i === 123)
924
970
  if (g === 0)
925
971
  Ye(y, t, x, x, f, c, p, d, m);
926
972
  else
@@ -929,13 +975,13 @@ function Ye(e, t, r, n, a, c, u, d, h) {
929
975
  case 108:
930
976
  case 109:
931
977
  case 115:
932
- Ye(e, x, x, n && Pe(ur(e, x, x, 0, 0, a, d, s, a, f = [], p, m), m), a, m, p, d, n ? f : m);
978
+ Ye(e, x, x, n && ze(ur(e, x, x, 0, 0, o, d, s, o, f = [], p, m), m), o, m, p, d, n ? f : m);
933
979
  break;
934
980
  default:
935
981
  Ye(y, x, x, x, [""], m, 0, d, m);
936
982
  }
937
983
  }
938
- b = g = k = 0, C = o = 1, s = y = "", p = u;
984
+ b = g = k = 0, C = a = 1, s = y = "", p = u;
939
985
  break;
940
986
  case 58:
941
987
  p = 1 + se(y), k = S;
@@ -946,12 +992,12 @@ function Ye(e, t, r, n, a, c, u, d, h) {
946
992
  else if (i == 125 && C++ == 0 && vo() == 125)
947
993
  continue;
948
994
  }
949
- switch (y += Kt(i), i * C) {
995
+ switch (y += Wt(i), i * C) {
950
996
  case 38:
951
- o = g > 0 ? 1 : (y += "\f", -1);
997
+ a = g > 0 ? 1 : (y += "\f", -1);
952
998
  break;
953
999
  case 44:
954
- d[b++] = (se(y) - 1) * o, o = 1;
1000
+ d[b++] = (se(y) - 1) * a, a = 1;
955
1001
  break;
956
1002
  case 64:
957
1003
  ye() === 45 && (y += xt(ne())), w = ye(), g = p = se(s = y += Ao(Ge())), i++;
@@ -962,17 +1008,17 @@ function Ye(e, t, r, n, a, c, u, d, h) {
962
1008
  }
963
1009
  return c;
964
1010
  }
965
- function ur(e, t, r, n, a, c, u, d, h, b, g, p) {
966
- for (var w = a - 1, k = a === 0 ? c : [""], S = Xr(k), C = 0, v = 0, o = 0; C < n; ++C)
967
- for (var i = 0, s = $e(e, w + 1, w = Zr(v = u[C])), f = e; i < S; ++i)
968
- (f = Jr(v > 0 ? k[i] + " " + s : _(s, /&\f/g, k[i]))) && (h[o++] = f);
969
- return ct(e, t, r, a === 0 ? st : d, h, b, g, p);
1011
+ function ur(e, t, r, n, o, c, u, d, h, b, g, p) {
1012
+ for (var w = o - 1, k = o === 0 ? c : [""], S = Xr(k), C = 0, v = 0, a = 0; C < n; ++C)
1013
+ for (var i = 0, s = Se(e, w + 1, w = Zr(v = u[C])), f = e; i < S; ++i)
1014
+ (f = Jr(v > 0 ? k[i] + " " + s : M(s, /&\f/g, k[i]))) && (h[a++] = f);
1015
+ return ct(e, t, r, o === 0 ? st : d, h, b, g, p);
970
1016
  }
971
1017
  function Eo(e, t, r, n) {
972
- return ct(e, t, r, Qr, Kt(wo()), $e(e, 2, -2), 0, n);
1018
+ return ct(e, t, r, Qr, Wt(wo()), Se(e, 2, -2), 0, n);
973
1019
  }
974
- function pr(e, t, r, n, a) {
975
- return ct(e, t, r, Ft, $e(e, 0, n), $e(e, n + 1, -1), n, a);
1020
+ function pr(e, t, r, n, o) {
1021
+ return ct(e, t, r, Ft, Se(e, 0, n), Se(e, n + 1, -1), n, o);
976
1022
  }
977
1023
  function tn(e, t, r) {
978
1024
  switch (xo(e, t)) {
@@ -1011,64 +1057,64 @@ function tn(e, t, r) {
1011
1057
  case 4810:
1012
1058
  case 6968:
1013
1059
  case 2756:
1014
- return N + e + Oe + e + K + e + e;
1060
+ return N + e + Oe + e + W + e + e;
1015
1061
  case 5936:
1016
1062
  switch (G(e, t + 11)) {
1017
1063
  case 114:
1018
- return N + e + K + _(e, /[svh]\w+-[tblr]{2}/, "tb") + e;
1064
+ return N + e + W + M(e, /[svh]\w+-[tblr]{2}/, "tb") + e;
1019
1065
  case 108:
1020
- return N + e + K + _(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e;
1066
+ return N + e + W + M(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e;
1021
1067
  case 45:
1022
- return N + e + K + _(e, /[svh]\w+-[tblr]{2}/, "lr") + e;
1068
+ return N + e + W + M(e, /[svh]\w+-[tblr]{2}/, "lr") + e;
1023
1069
  }
1024
1070
  case 6828:
1025
1071
  case 4268:
1026
1072
  case 2903:
1027
- return N + e + K + e + e;
1073
+ return N + e + W + e + e;
1028
1074
  case 6165:
1029
- return N + e + K + "flex-" + e + e;
1075
+ return N + e + W + "flex-" + e + e;
1030
1076
  case 5187:
1031
- return N + e + _(e, /(\w+).+(:[^]+)/, N + "box-$1$2" + K + "flex-$1$2") + e;
1077
+ return N + e + M(e, /(\w+).+(:[^]+)/, N + "box-$1$2" + W + "flex-$1$2") + e;
1032
1078
  case 5443:
1033
- return N + e + K + "flex-item-" + _(e, /flex-|-self/g, "") + (ce(e, /flex-|baseline/) ? "" : K + "grid-row-" + _(e, /flex-|-self/g, "")) + e;
1079
+ return N + e + W + "flex-item-" + M(e, /flex-|-self/g, "") + (ce(e, /flex-|baseline/) ? "" : W + "grid-row-" + M(e, /flex-|-self/g, "")) + e;
1034
1080
  case 4675:
1035
- return N + e + K + "flex-line-pack" + _(e, /align-content|flex-|-self/g, "") + e;
1081
+ return N + e + W + "flex-line-pack" + M(e, /align-content|flex-|-self/g, "") + e;
1036
1082
  case 5548:
1037
- return N + e + K + _(e, "shrink", "negative") + e;
1083
+ return N + e + W + M(e, "shrink", "negative") + e;
1038
1084
  case 5292:
1039
- return N + e + K + _(e, "basis", "preferred-size") + e;
1085
+ return N + e + W + M(e, "basis", "preferred-size") + e;
1040
1086
  case 6060:
1041
- return N + "box-" + _(e, "-grow", "") + N + e + K + _(e, "grow", "positive") + e;
1087
+ return N + "box-" + M(e, "-grow", "") + N + e + W + M(e, "grow", "positive") + e;
1042
1088
  case 4554:
1043
- return N + _(e, /([^-])(transform)/g, "$1" + N + "$2") + e;
1089
+ return N + M(e, /([^-])(transform)/g, "$1" + N + "$2") + e;
1044
1090
  case 6187:
1045
- return _(_(_(e, /(zoom-|grab)/, N + "$1"), /(image-set)/, N + "$1"), e, "") + e;
1091
+ return M(M(M(e, /(zoom-|grab)/, N + "$1"), /(image-set)/, N + "$1"), e, "") + e;
1046
1092
  case 5495:
1047
1093
  case 3959:
1048
- return _(e, /(image-set\([^]*)/, N + "$1$`$1");
1094
+ return M(e, /(image-set\([^]*)/, N + "$1$`$1");
1049
1095
  case 4968:
1050
- return _(_(e, /(.+:)(flex-)?(.*)/, N + "box-pack:$3" + K + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + N + e + e;
1096
+ return M(M(e, /(.+:)(flex-)?(.*)/, N + "box-pack:$3" + W + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + N + e + e;
1051
1097
  case 4200:
1052
- if (!ce(e, /flex-|baseline/)) return K + "grid-column-align" + $e(e, t) + e;
1098
+ if (!ce(e, /flex-|baseline/)) return W + "grid-column-align" + Se(e, t) + e;
1053
1099
  break;
1054
1100
  case 2592:
1055
1101
  case 3360:
1056
- return K + _(e, "template-", "") + e;
1102
+ return W + M(e, "template-", "") + e;
1057
1103
  case 4384:
1058
1104
  case 3616:
1059
- return r && r.some(function(n, a) {
1060
- return t = a, ce(n.props, /grid-\w+-end/);
1061
- }) ? ~qe(e + (r = r[t].value), "span", 0) ? e : K + _(e, "-start", "") + e + K + "grid-row-span:" + (~qe(r, "span", 0) ? ce(r, /\d+/) : +ce(r, /\d+/) - +ce(e, /\d+/)) + ";" : K + _(e, "-start", "") + e;
1105
+ return r && r.some(function(n, o) {
1106
+ return t = o, ce(n.props, /grid-\w+-end/);
1107
+ }) ? ~qe(e + (r = r[t].value), "span", 0) ? e : W + M(e, "-start", "") + e + W + "grid-row-span:" + (~qe(r, "span", 0) ? ce(r, /\d+/) : +ce(r, /\d+/) - +ce(e, /\d+/)) + ";" : W + M(e, "-start", "") + e;
1062
1108
  case 4896:
1063
1109
  case 4128:
1064
1110
  return r && r.some(function(n) {
1065
1111
  return ce(n.props, /grid-\w+-start/);
1066
- }) ? e : K + _(_(e, "-end", "-span"), "span ", "") + e;
1112
+ }) ? e : W + M(M(e, "-end", "-span"), "span ", "") + e;
1067
1113
  case 4095:
1068
1114
  case 3583:
1069
1115
  case 4068:
1070
1116
  case 2532:
1071
- return _(e, /(.+)-inline(.+)/, N + "$1$2") + e;
1117
+ return M(e, /(.+)-inline(.+)/, N + "$1$2") + e;
1072
1118
  case 8116:
1073
1119
  case 7059:
1074
1120
  case 5753:
@@ -1087,26 +1133,26 @@ function tn(e, t, r) {
1087
1133
  if (G(e, t + 4) !== 45)
1088
1134
  break;
1089
1135
  case 102:
1090
- return _(e, /(.+:)(.+)-([^]+)/, "$1" + N + "$2-$3$1" + Oe + (G(e, t + 3) == 108 ? "$3" : "$2-$3")) + e;
1136
+ return M(e, /(.+:)(.+)-([^]+)/, "$1" + N + "$2-$3$1" + Oe + (G(e, t + 3) == 108 ? "$3" : "$2-$3")) + e;
1091
1137
  case 115:
1092
- return ~qe(e, "stretch", 0) ? tn(_(e, "stretch", "fill-available"), t, r) + e : e;
1138
+ return ~qe(e, "stretch", 0) ? tn(M(e, "stretch", "fill-available"), t, r) + e : e;
1093
1139
  }
1094
1140
  break;
1095
1141
  case 5152:
1096
1142
  case 5920:
1097
- return _(e, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(n, a, c, u, d, h, b) {
1098
- return K + a + ":" + c + b + (u ? K + a + "-span:" + (d ? h : +h - +c) + b : "") + e;
1143
+ return M(e, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(n, o, c, u, d, h, b) {
1144
+ return W + o + ":" + c + b + (u ? W + o + "-span:" + (d ? h : +h - +c) + b : "") + e;
1099
1145
  });
1100
1146
  case 4949:
1101
1147
  if (G(e, t + 6) === 121)
1102
- return _(e, ":", ":" + N) + e;
1148
+ return M(e, ":", ":" + N) + e;
1103
1149
  break;
1104
1150
  case 6444:
1105
1151
  switch (G(e, G(e, 14) === 45 ? 18 : 11)) {
1106
1152
  case 120:
1107
- return _(e, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + N + (G(e, 14) === 45 ? "inline-" : "") + "box$3$1" + N + "$2$3$1" + K + "$2box$3") + e;
1153
+ return M(e, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + N + (G(e, 14) === 45 ? "inline-" : "") + "box$3$1" + N + "$2$3$1" + W + "$2box$3") + e;
1108
1154
  case 100:
1109
- return _(e, ":", ":" + K) + e;
1155
+ return M(e, ":", ":" + W) + e;
1110
1156
  }
1111
1157
  break;
1112
1158
  case 5719:
@@ -1114,7 +1160,7 @@ function tn(e, t, r) {
1114
1160
  case 2135:
1115
1161
  case 3927:
1116
1162
  case 2391:
1117
- return _(e, "scroll-", "scroll-snap-") + e;
1163
+ return M(e, "scroll-", "scroll-snap-") + e;
1118
1164
  }
1119
1165
  return e;
1120
1166
  }
@@ -1141,9 +1187,9 @@ function _o(e, t, r, n) {
1141
1187
  }
1142
1188
  function Mo(e) {
1143
1189
  var t = Xr(e);
1144
- return function(r, n, a, c) {
1190
+ return function(r, n, o, c) {
1145
1191
  for (var u = "", d = 0; d < t; d++)
1146
- u += e[d](r, n, a, c) || "";
1192
+ u += e[d](r, n, o, c) || "";
1147
1193
  return u;
1148
1194
  };
1149
1195
  }
@@ -1152,31 +1198,31 @@ function Ro(e) {
1152
1198
  t.root || (t = t.return) && e(t);
1153
1199
  };
1154
1200
  }
1155
- function Do(e, t, r, n) {
1201
+ function Po(e, t, r, n) {
1156
1202
  if (e.length > -1 && !e.return)
1157
1203
  switch (e.type) {
1158
1204
  case Ft:
1159
1205
  e.return = tn(e.value, e.length, r);
1160
1206
  return;
1161
1207
  case Vr:
1162
- return tt([fe(e, { value: _(e.value, "@", "@" + N) })], n);
1208
+ return tt([fe(e, { value: M(e.value, "@", "@" + N) })], n);
1163
1209
  case st:
1164
1210
  if (e.length)
1165
- return ko(r = e.props, function(a) {
1166
- switch (ce(a, n = /(::plac\w+|:read-\w+)/)) {
1211
+ return ko(r = e.props, function(o) {
1212
+ switch (ce(o, n = /(::plac\w+|:read-\w+)/)) {
1167
1213
  case ":read-only":
1168
1214
  case ":read-write":
1169
- we(fe(e, { props: [_(a, /:(read-\w+)/, ":" + Oe + "$1")] })), we(fe(e, { props: [a] })), Mt(e, { props: dr(r, n) });
1215
+ ve(fe(e, { props: [M(o, /:(read-\w+)/, ":" + Oe + "$1")] })), ve(fe(e, { props: [o] })), Mt(e, { props: dr(r, n) });
1170
1216
  break;
1171
1217
  case "::placeholder":
1172
- we(fe(e, { props: [_(a, /:(plac\w+)/, ":" + N + "input-$1")] })), we(fe(e, { props: [_(a, /:(plac\w+)/, ":" + Oe + "$1")] })), we(fe(e, { props: [_(a, /:(plac\w+)/, K + "input-$1")] })), we(fe(e, { props: [a] })), Mt(e, { props: dr(r, n) });
1218
+ ve(fe(e, { props: [M(o, /:(plac\w+)/, ":" + N + "input-$1")] })), ve(fe(e, { props: [M(o, /:(plac\w+)/, ":" + Oe + "$1")] })), ve(fe(e, { props: [M(o, /:(plac\w+)/, W + "input-$1")] })), ve(fe(e, { props: [o] })), Mt(e, { props: dr(r, n) });
1173
1219
  break;
1174
1220
  }
1175
1221
  return "";
1176
1222
  });
1177
1223
  }
1178
1224
  }
1179
- var Po = {
1225
+ var zo = {
1180
1226
  animationIterationCount: 1,
1181
1227
  aspectRatio: 1,
1182
1228
  borderImageOutset: 1,
@@ -1224,39 +1270,39 @@ var Po = {
1224
1270
  strokeMiterlimit: 1,
1225
1271
  strokeOpacity: 1,
1226
1272
  strokeWidth: 1
1227
- }, Ce = typeof process < "u" && process.env !== void 0 && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || "data-styled", rn = "active", nn = "data-styled-version", dt = "6.1.19", Wt = `/*!sc*/
1228
- `, rt = typeof window < "u" && typeof document < "u", zo = !!(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), ut = Object.freeze([]), je = Object.freeze({});
1273
+ }, je = typeof process < "u" && process.env !== void 0 && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || "data-styled", rn = "active", nn = "data-styled-version", dt = "6.1.19", Kt = `/*!sc*/
1274
+ `, rt = typeof window < "u" && typeof document < "u", Do = !!(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), ut = Object.freeze([]), Ie = Object.freeze({});
1229
1275
  function Oo(e, t, r) {
1230
- return r === void 0 && (r = je), e.theme !== r.theme && e.theme || t || r.theme;
1276
+ return r === void 0 && (r = Ie), e.theme !== r.theme && e.theme || t || r.theme;
1231
1277
  }
1232
1278
  var on = /* @__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"]), No = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, Bo = /(^-|-$)/g;
1233
1279
  function fr(e) {
1234
1280
  return e.replace(No, "-").replace(Bo, "");
1235
1281
  }
1236
- var Lo = /(a)(d)/gi, Ke = 52, hr = function(e) {
1282
+ var Lo = /(a)(d)/gi, We = 52, hr = function(e) {
1237
1283
  return String.fromCharCode(e + (e > 25 ? 39 : 97));
1238
1284
  };
1239
- function Pt(e) {
1285
+ function zt(e) {
1240
1286
  var t, r = "";
1241
- for (t = Math.abs(e); t > Ke; t = t / Ke | 0) r = hr(t % Ke) + r;
1242
- return (hr(t % Ke) + r).replace(Lo, "$1-$2");
1287
+ for (t = Math.abs(e); t > We; t = t / We | 0) r = hr(t % We) + r;
1288
+ return (hr(t % We) + r).replace(Lo, "$1-$2");
1243
1289
  }
1244
- var kt, an = 5381, ve = function(e, t) {
1290
+ var kt, an = 5381, $e = function(e, t) {
1245
1291
  for (var r = t.length; r; ) e = 33 * e ^ t.charCodeAt(--r);
1246
1292
  return e;
1247
1293
  }, sn = function(e) {
1248
- return ve(an, e);
1294
+ return $e(an, e);
1249
1295
  };
1250
1296
  function Fo(e) {
1251
- return Pt(sn(e) >>> 0);
1297
+ return zt(sn(e) >>> 0);
1252
1298
  }
1253
- function Ko(e) {
1299
+ function Wo(e) {
1254
1300
  return e.displayName || e.name || "Component";
1255
1301
  }
1256
1302
  function wt(e) {
1257
1303
  return typeof e == "string" && !0;
1258
1304
  }
1259
- var cn = typeof Symbol == "function" && Symbol.for, ln = cn ? Symbol.for("react.memo") : 60115, Wo = cn ? Symbol.for("react.forward_ref") : 60112, Uo = { childContextTypes: !0, contextType: !0, contextTypes: !0, defaultProps: !0, displayName: !0, getDefaultProps: !0, getDerivedStateFromError: !0, getDerivedStateFromProps: !0, mixins: !0, propTypes: !0, type: !0 }, Ho = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 }, dn = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, qo = ((kt = {})[Wo] = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, kt[ln] = dn, kt);
1305
+ var cn = typeof Symbol == "function" && Symbol.for, ln = cn ? Symbol.for("react.memo") : 60115, Ko = cn ? Symbol.for("react.forward_ref") : 60112, Uo = { childContextTypes: !0, contextType: !0, contextTypes: !0, defaultProps: !0, displayName: !0, getDefaultProps: !0, getDerivedStateFromError: !0, getDerivedStateFromProps: !0, mixins: !0, propTypes: !0, type: !0 }, Ho = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 }, dn = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, qo = ((kt = {})[Ko] = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, kt[ln] = dn, kt);
1260
1306
  function mr(e) {
1261
1307
  return ("type" in (t = e) && t.type.$$typeof) === ln ? dn : "$$typeof" in e ? qo[e.$$typeof] : Uo;
1262
1308
  var t;
@@ -1268,10 +1314,10 @@ function un(e, t, r) {
1268
1314
  var n = Vo(t);
1269
1315
  n && n !== br && un(e, n, r);
1270
1316
  }
1271
- var a = Yo(t);
1272
- gr && (a = a.concat(gr(t)));
1273
- for (var c = mr(e), u = mr(t), d = 0; d < a.length; ++d) {
1274
- var h = a[d];
1317
+ var o = Yo(t);
1318
+ gr && (o = o.concat(gr(t)));
1319
+ for (var c = mr(e), u = mr(t), d = 0; d < o.length; ++d) {
1320
+ var h = o[d];
1275
1321
  if (!(h in Ho || r && r[h] || u && h in u || c && h in c)) {
1276
1322
  var b = Qo(t, h);
1277
1323
  try {
@@ -1283,7 +1329,7 @@ function un(e, t, r) {
1283
1329
  }
1284
1330
  return e;
1285
1331
  }
1286
- function Ie(e) {
1332
+ function Ae(e) {
1287
1333
  return typeof e == "function";
1288
1334
  }
1289
1335
  function Ut(e) {
@@ -1300,10 +1346,10 @@ function yr(e, t) {
1300
1346
  function Be(e) {
1301
1347
  return e !== null && typeof e == "object" && e.constructor.name === Object.name && !("props" in e && e.$$typeof);
1302
1348
  }
1303
- function zt(e, t, r) {
1349
+ function Dt(e, t, r) {
1304
1350
  if (r === void 0 && (r = !1), !r && !Be(e) && !Array.isArray(e)) return t;
1305
- if (Array.isArray(t)) for (var n = 0; n < t.length; n++) e[n] = zt(e[n], t[n]);
1306
- else if (Be(t)) for (var n in t) e[n] = zt(e[n], t[n]);
1351
+ if (Array.isArray(t)) for (var n = 0; n < t.length; n++) e[n] = Dt(e[n], t[n]);
1352
+ else if (Be(t)) for (var n in t) e[n] = Dt(e[n], t[n]);
1307
1353
  return e;
1308
1354
  }
1309
1355
  function Ht(e, t) {
@@ -1322,66 +1368,66 @@ var Zo = function() {
1322
1368
  return r;
1323
1369
  }, e.prototype.insertRules = function(t, r) {
1324
1370
  if (t >= this.groupSizes.length) {
1325
- for (var n = this.groupSizes, a = n.length, c = a; t >= c; ) if ((c <<= 1) < 0) throw Le(16, "".concat(t));
1371
+ for (var n = this.groupSizes, o = n.length, c = o; t >= c; ) if ((c <<= 1) < 0) throw Le(16, "".concat(t));
1326
1372
  this.groupSizes = new Uint32Array(c), this.groupSizes.set(n), this.length = c;
1327
- for (var u = a; u < c; u++) this.groupSizes[u] = 0;
1373
+ for (var u = o; u < c; u++) this.groupSizes[u] = 0;
1328
1374
  }
1329
1375
  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++);
1330
1376
  }, e.prototype.clearGroup = function(t) {
1331
1377
  if (t < this.length) {
1332
- var r = this.groupSizes[t], n = this.indexOfGroup(t), a = n + r;
1378
+ var r = this.groupSizes[t], n = this.indexOfGroup(t), o = n + r;
1333
1379
  this.groupSizes[t] = 0;
1334
- for (var c = n; c < a; c++) this.tag.deleteRule(n);
1380
+ for (var c = n; c < o; c++) this.tag.deleteRule(n);
1335
1381
  }
1336
1382
  }, e.prototype.getGroup = function(t) {
1337
1383
  var r = "";
1338
1384
  if (t >= this.length || this.groupSizes[t] === 0) return r;
1339
- 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(Wt);
1385
+ for (var n = this.groupSizes[t], o = this.indexOfGroup(t), c = o + n, u = o; u < c; u++) r += "".concat(this.tag.getRule(u)).concat(Kt);
1340
1386
  return r;
1341
1387
  }, e;
1342
- }(), Qe = /* @__PURE__ */ new Map(), nt = /* @__PURE__ */ new Map(), Ve = 1, We = function(e) {
1388
+ }(), Qe = /* @__PURE__ */ new Map(), nt = /* @__PURE__ */ new Map(), Ve = 1, Ke = function(e) {
1343
1389
  if (Qe.has(e)) return Qe.get(e);
1344
1390
  for (; nt.has(Ve); ) Ve++;
1345
1391
  var t = Ve++;
1346
1392
  return Qe.set(e, t), nt.set(t, e), t;
1347
1393
  }, Jo = function(e, t) {
1348
1394
  Ve = t + 1, Qe.set(e, t), nt.set(t, e);
1349
- }, Xo = "style[".concat(Ce, "][").concat(nn, '="').concat(dt, '"]'), ea = new RegExp("^".concat(Ce, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), ta = function(e, t, r) {
1350
- for (var n, a = r.split(","), c = 0, u = a.length; c < u; c++) (n = a[c]) && e.registerName(t, n);
1395
+ }, Xo = "style[".concat(je, "][").concat(nn, '="').concat(dt, '"]'), ea = new RegExp("^".concat(je, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), ta = function(e, t, r) {
1396
+ for (var n, o = r.split(","), c = 0, u = o.length; c < u; c++) (n = o[c]) && e.registerName(t, n);
1351
1397
  }, ra = function(e, t) {
1352
- for (var r, n = ((r = t.textContent) !== null && r !== void 0 ? r : "").split(Wt), a = [], c = 0, u = n.length; c < u; c++) {
1398
+ for (var r, n = ((r = t.textContent) !== null && r !== void 0 ? r : "").split(Kt), o = [], c = 0, u = n.length; c < u; c++) {
1353
1399
  var d = n[c].trim();
1354
1400
  if (d) {
1355
1401
  var h = d.match(ea);
1356
1402
  if (h) {
1357
1403
  var b = 0 | parseInt(h[1], 10), g = h[2];
1358
- b !== 0 && (Jo(g, b), ta(e, g, h[3]), e.getTag().insertRules(b, a)), a.length = 0;
1359
- } else a.push(d);
1404
+ b !== 0 && (Jo(g, b), ta(e, g, h[3]), e.getTag().insertRules(b, o)), o.length = 0;
1405
+ } else o.push(d);
1360
1406
  }
1361
1407
  }
1362
1408
  }, xr = function(e) {
1363
1409
  for (var t = document.querySelectorAll(Xo), r = 0, n = t.length; r < n; r++) {
1364
- var a = t[r];
1365
- a && a.getAttribute(Ce) !== rn && (ra(e, a), a.parentNode && a.parentNode.removeChild(a));
1410
+ var o = t[r];
1411
+ o && o.getAttribute(je) !== rn && (ra(e, o), o.parentNode && o.parentNode.removeChild(o));
1366
1412
  }
1367
1413
  };
1368
1414
  function na() {
1369
1415
  return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : null;
1370
1416
  }
1371
1417
  var pn = function(e) {
1372
- var t = document.head, r = e || t, n = document.createElement("style"), a = function(d) {
1373
- var h = Array.from(d.querySelectorAll("style[".concat(Ce, "]")));
1418
+ var t = document.head, r = e || t, n = document.createElement("style"), o = function(d) {
1419
+ var h = Array.from(d.querySelectorAll("style[".concat(je, "]")));
1374
1420
  return h[h.length - 1];
1375
- }(r), c = a !== void 0 ? a.nextSibling : null;
1376
- n.setAttribute(Ce, rn), n.setAttribute(nn, dt);
1421
+ }(r), c = o !== void 0 ? o.nextSibling : null;
1422
+ n.setAttribute(je, rn), n.setAttribute(nn, dt);
1377
1423
  var u = na();
1378
1424
  return u && n.setAttribute("nonce", u), r.insertBefore(n, c), n;
1379
1425
  }, oa = function() {
1380
1426
  function e(t) {
1381
1427
  this.element = pn(t), this.element.appendChild(document.createTextNode("")), this.sheet = function(r) {
1382
1428
  if (r.sheet) return r.sheet;
1383
- for (var n = document.styleSheets, a = 0, c = n.length; a < c; a++) {
1384
- var u = n[a];
1429
+ for (var n = document.styleSheets, o = 0, c = n.length; o < c; o++) {
1430
+ var u = n[o];
1385
1431
  if (u.ownerNode === r) return u;
1386
1432
  }
1387
1433
  throw Le(17);
@@ -1425,30 +1471,30 @@ var pn = function(e) {
1425
1471
  }, e.prototype.getRule = function(t) {
1426
1472
  return t < this.length ? this.rules[t] : "";
1427
1473
  }, e;
1428
- }(), kr = rt, ia = { isServer: !rt, useCSSOMInjection: !zo }, fn = function() {
1474
+ }(), kr = rt, ia = { isServer: !rt, useCSSOMInjection: !Do }, fn = function() {
1429
1475
  function e(t, r, n) {
1430
- t === void 0 && (t = je), r === void 0 && (r = {});
1431
- var a = this;
1476
+ t === void 0 && (t = Ie), r === void 0 && (r = {});
1477
+ var o = this;
1432
1478
  this.options = te(te({}, ia), t), this.gs = r, this.names = new Map(n), this.server = !!t.isServer, !this.server && rt && kr && (kr = !1, xr(this)), Ht(this, function() {
1433
1479
  return function(c) {
1434
1480
  for (var u = c.getTag(), d = u.length, h = "", b = function(p) {
1435
- var w = function(o) {
1436
- return nt.get(o);
1481
+ var w = function(a) {
1482
+ return nt.get(a);
1437
1483
  }(p);
1438
1484
  if (w === void 0) return "continue";
1439
1485
  var k = c.names.get(w), S = u.getGroup(p);
1440
1486
  if (k === void 0 || !k.size || S.length === 0) return "continue";
1441
- var C = "".concat(Ce, ".g").concat(p, '[id="').concat(w, '"]'), v = "";
1442
- k !== void 0 && k.forEach(function(o) {
1443
- o.length > 0 && (v += "".concat(o, ","));
1444
- }), h += "".concat(S).concat(C, '{content:"').concat(v, '"}').concat(Wt);
1487
+ var C = "".concat(je, ".g").concat(p, '[id="').concat(w, '"]'), v = "";
1488
+ k !== void 0 && k.forEach(function(a) {
1489
+ a.length > 0 && (v += "".concat(a, ","));
1490
+ }), h += "".concat(S).concat(C, '{content:"').concat(v, '"}').concat(Kt);
1445
1491
  }, g = 0; g < d; g++) b(g);
1446
1492
  return h;
1447
- }(a);
1493
+ }(o);
1448
1494
  });
1449
1495
  }
1450
1496
  return e.registerId = function(t) {
1451
- return We(t);
1497
+ return Ke(t);
1452
1498
  }, e.prototype.rehydrate = function() {
1453
1499
  !this.server && rt && xr(this);
1454
1500
  }, e.prototype.reconstructWithOptions = function(t, r) {
@@ -1457,24 +1503,24 @@ var pn = function(e) {
1457
1503
  return this.gs[t] = (this.gs[t] || 0) + 1;
1458
1504
  }, e.prototype.getTag = function() {
1459
1505
  return this.tag || (this.tag = (t = function(r) {
1460
- var n = r.useCSSOMInjection, a = r.target;
1461
- return r.isServer ? new sa(a) : n ? new oa(a) : new aa(a);
1506
+ var n = r.useCSSOMInjection, o = r.target;
1507
+ return r.isServer ? new sa(o) : n ? new oa(o) : new aa(o);
1462
1508
  }(this.options), new Zo(t)));
1463
1509
  var t;
1464
1510
  }, e.prototype.hasNameForId = function(t, r) {
1465
1511
  return this.names.has(t) && this.names.get(t).has(r);
1466
1512
  }, e.prototype.registerName = function(t, r) {
1467
- if (We(t), this.names.has(t)) this.names.get(t).add(r);
1513
+ if (Ke(t), this.names.has(t)) this.names.get(t).add(r);
1468
1514
  else {
1469
1515
  var n = /* @__PURE__ */ new Set();
1470
1516
  n.add(r), this.names.set(t, n);
1471
1517
  }
1472
1518
  }, e.prototype.insertRules = function(t, r, n) {
1473
- this.registerName(t, r), this.getTag().insertRules(We(t), n);
1519
+ this.registerName(t, r), this.getTag().insertRules(Ke(t), n);
1474
1520
  }, e.prototype.clearNames = function(t) {
1475
1521
  this.names.has(t) && this.names.get(t).clear();
1476
1522
  }, e.prototype.clearRules = function(t) {
1477
- this.getTag().clearGroup(We(t)), this.clearNames(t);
1523
+ this.getTag().clearGroup(Ke(t)), this.clearNames(t);
1478
1524
  }, e.prototype.clearTag = function() {
1479
1525
  this.tag = void 0;
1480
1526
  }, e;
@@ -1487,38 +1533,38 @@ function hn(e, t) {
1487
1533
  });
1488
1534
  }
1489
1535
  function da(e) {
1490
- var t, r, n, a = je, c = a.options, u = c === void 0 ? je : c, d = a.plugins, h = d === void 0 ? ut : d, b = function(w, k, S) {
1536
+ var t, r, n, o = Ie, c = o.options, u = c === void 0 ? Ie : c, d = o.plugins, h = d === void 0 ? ut : d, b = function(w, k, S) {
1491
1537
  return S.startsWith(r) && S.endsWith(r) && S.replaceAll(r, "").length > 0 ? ".".concat(t) : w;
1492
1538
  }, g = h.slice();
1493
1539
  g.push(function(w) {
1494
1540
  w.type === st && w.value.includes("&") && (w.props[0] = w.props[0].replace(ca, r).replace(n, b));
1495
- }), u.prefix && g.push(Do), g.push(_o);
1541
+ }), u.prefix && g.push(Po), g.push(_o);
1496
1542
  var p = function(w, k, S, C) {
1497
1543
  k === void 0 && (k = ""), S === void 0 && (S = ""), C === void 0 && (C = "&"), t = C, r = k, n = new RegExp("\\".concat(r, "\\b"), "g");
1498
- var v = w.replace(la, ""), o = To(S || k ? "".concat(S, " ").concat(k, " { ").concat(v, " }") : v);
1499
- u.namespace && (o = hn(o, u.namespace));
1544
+ var v = w.replace(la, ""), a = To(S || k ? "".concat(S, " ").concat(k, " { ").concat(v, " }") : v);
1545
+ u.namespace && (a = hn(a, u.namespace));
1500
1546
  var i = [];
1501
- return tt(o, Mo(g.concat(Ro(function(s) {
1547
+ return tt(a, Mo(g.concat(Ro(function(s) {
1502
1548
  return i.push(s);
1503
1549
  })))), i;
1504
1550
  };
1505
1551
  return p.hash = h.length ? h.reduce(function(w, k) {
1506
- return k.name || Le(15), ve(w, k.name);
1552
+ return k.name || Le(15), $e(w, k.name);
1507
1553
  }, an).toString() : "", p;
1508
1554
  }
1509
- var ua = new fn(), Ot = da(), mn = L.createContext({ shouldForwardProp: void 0, styleSheet: ua, stylis: Ot });
1555
+ var ua = new fn(), Ot = da(), mn = F.createContext({ shouldForwardProp: void 0, styleSheet: ua, stylis: Ot });
1510
1556
  mn.Consumer;
1511
- L.createContext(void 0);
1557
+ F.createContext(void 0);
1512
1558
  function wr() {
1513
1559
  return Hr(mn);
1514
1560
  }
1515
1561
  var pa = function() {
1516
1562
  function e(t, r) {
1517
1563
  var n = this;
1518
- this.inject = function(a, c) {
1564
+ this.inject = function(o, c) {
1519
1565
  c === void 0 && (c = Ot);
1520
1566
  var u = n.name + c.hash;
1521
- a.hasNameForId(n.id, u) || a.insertRules(n.id, u, c(n.rules, u, "@keyframes"));
1567
+ o.hasNameForId(n.id, u) || o.insertRules(n.id, u, c(n.rules, u, "@keyframes"));
1522
1568
  }, this.name = t, this.id = "sc-keyframes-".concat(t), this.rules = r, Ht(this, function() {
1523
1569
  throw Le(12, String(n.name));
1524
1570
  });
@@ -1541,19 +1587,19 @@ var gn = function(e) {
1541
1587
  return e == null || e === !1 || e === "";
1542
1588
  }, bn = function(e) {
1543
1589
  var t, r, n = [];
1544
- for (var a in e) {
1545
- var c = e[a];
1546
- e.hasOwnProperty(a) && !gn(c) && (Array.isArray(c) && c.isCss || Ie(c) ? n.push("".concat(vr(a), ":"), c, ";") : Be(c) ? n.push.apply(n, et(et(["".concat(a, " {")], bn(c), !1), ["}"], !1)) : n.push("".concat(vr(a), ": ").concat((t = a, (r = c) == null || typeof r == "boolean" || r === "" ? "" : typeof r != "number" || r === 0 || t in Po || t.startsWith("--") ? String(r).trim() : "".concat(r, "px")), ";")));
1590
+ for (var o in e) {
1591
+ var c = e[o];
1592
+ e.hasOwnProperty(o) && !gn(c) && (Array.isArray(c) && c.isCss || Ae(c) ? n.push("".concat(vr(o), ":"), c, ";") : Be(c) ? n.push.apply(n, et(et(["".concat(o, " {")], bn(c), !1), ["}"], !1)) : n.push("".concat(vr(o), ": ").concat((t = o, (r = c) == null || typeof r == "boolean" || r === "" ? "" : typeof r != "number" || r === 0 || t in zo || t.startsWith("--") ? String(r).trim() : "".concat(r, "px")), ";")));
1547
1593
  }
1548
1594
  return n;
1549
1595
  };
1550
1596
  function xe(e, t, r, n) {
1551
1597
  if (gn(e)) return [];
1552
1598
  if (Ut(e)) return [".".concat(e.styledComponentId)];
1553
- if (Ie(e)) {
1554
- if (!Ie(c = e) || c.prototype && c.prototype.isReactComponent || !t) return [e];
1555
- var a = e(t);
1556
- return xe(a, t, r, n);
1599
+ if (Ae(e)) {
1600
+ if (!Ae(c = e) || c.prototype && c.prototype.isReactComponent || !t) return [e];
1601
+ var o = e(t);
1602
+ return xe(o, t, r, n);
1557
1603
  }
1558
1604
  var c;
1559
1605
  return e instanceof pa ? r ? (e.inject(r, n), [e.getName(n)]) : [e] : Be(e) ? bn(e) : Array.isArray(e) ? Array.prototype.concat.apply(ut, e.map(function(u) {
@@ -1563,55 +1609,55 @@ function xe(e, t, r, n) {
1563
1609
  function ha(e) {
1564
1610
  for (var t = 0; t < e.length; t += 1) {
1565
1611
  var r = e[t];
1566
- if (Ie(r) && !Ut(r)) return !1;
1612
+ if (Ae(r) && !Ut(r)) return !1;
1567
1613
  }
1568
1614
  return !0;
1569
1615
  }
1570
1616
  var ma = sn(dt), ga = function() {
1571
1617
  function e(t, r, n) {
1572
- this.rules = t, this.staticRulesId = "", this.isStatic = (n === void 0 || n.isStatic) && ha(t), this.componentId = r, this.baseHash = ve(ma, r), this.baseStyle = n, fn.registerId(r);
1618
+ this.rules = t, this.staticRulesId = "", this.isStatic = (n === void 0 || n.isStatic) && ha(t), this.componentId = r, this.baseHash = $e(ma, r), this.baseStyle = n, fn.registerId(r);
1573
1619
  }
1574
1620
  return e.prototype.generateAndInjectStyles = function(t, r, n) {
1575
- var a = this.baseStyle ? this.baseStyle.generateAndInjectStyles(t, r, n) : "";
1576
- if (this.isStatic && !n.hash) if (this.staticRulesId && r.hasNameForId(this.componentId, this.staticRulesId)) a = be(a, this.staticRulesId);
1621
+ var o = this.baseStyle ? this.baseStyle.generateAndInjectStyles(t, r, n) : "";
1622
+ if (this.isStatic && !n.hash) if (this.staticRulesId && r.hasNameForId(this.componentId, this.staticRulesId)) o = be(o, this.staticRulesId);
1577
1623
  else {
1578
- var c = yr(xe(this.rules, t, r, n)), u = Pt(ve(this.baseHash, c) >>> 0);
1624
+ var c = yr(xe(this.rules, t, r, n)), u = zt($e(this.baseHash, c) >>> 0);
1579
1625
  if (!r.hasNameForId(this.componentId, u)) {
1580
1626
  var d = n(c, ".".concat(u), void 0, this.componentId);
1581
1627
  r.insertRules(this.componentId, u, d);
1582
1628
  }
1583
- a = be(a, u), this.staticRulesId = u;
1629
+ o = be(o, u), this.staticRulesId = u;
1584
1630
  }
1585
1631
  else {
1586
- for (var h = ve(this.baseHash, n.hash), b = "", g = 0; g < this.rules.length; g++) {
1632
+ for (var h = $e(this.baseHash, n.hash), b = "", g = 0; g < this.rules.length; g++) {
1587
1633
  var p = this.rules[g];
1588
1634
  if (typeof p == "string") b += p;
1589
1635
  else if (p) {
1590
1636
  var w = yr(xe(p, t, r, n));
1591
- h = ve(h, w + g), b += w;
1637
+ h = $e(h, w + g), b += w;
1592
1638
  }
1593
1639
  }
1594
1640
  if (b) {
1595
- var k = Pt(h >>> 0);
1596
- r.hasNameForId(this.componentId, k) || r.insertRules(this.componentId, k, n(b, ".".concat(k), void 0, this.componentId)), a = be(a, k);
1641
+ var k = zt(h >>> 0);
1642
+ r.hasNameForId(this.componentId, k) || r.insertRules(this.componentId, k, n(b, ".".concat(k), void 0, this.componentId)), o = be(o, k);
1597
1643
  }
1598
1644
  }
1599
- return a;
1645
+ return o;
1600
1646
  }, e;
1601
- }(), yn = L.createContext(void 0);
1647
+ }(), yn = F.createContext(void 0);
1602
1648
  yn.Consumer;
1603
1649
  var vt = {};
1604
1650
  function ba(e, t, r) {
1605
- var n = Ut(e), a = e, c = !wt(e), u = t.attrs, d = u === void 0 ? ut : u, h = t.componentId, b = h === void 0 ? function(f, m) {
1651
+ var n = Ut(e), o = e, c = !wt(e), u = t.attrs, d = u === void 0 ? ut : u, h = t.componentId, b = h === void 0 ? function(f, m) {
1606
1652
  var x = typeof f != "string" ? "sc" : fr(f);
1607
1653
  vt[x] = (vt[x] || 0) + 1;
1608
1654
  var y = "".concat(x, "-").concat(Fo(dt + x + vt[x]));
1609
1655
  return m ? "".concat(m, "-").concat(y) : y;
1610
1656
  }(t.displayName, t.parentComponentId) : h, g = t.displayName, p = g === void 0 ? function(f) {
1611
- return wt(f) ? "styled.".concat(f) : "Styled(".concat(Ko(f), ")");
1612
- }(e) : g, w = t.displayName && t.componentId ? "".concat(fr(t.displayName), "-").concat(t.componentId) : t.componentId || b, k = n && a.attrs ? a.attrs.concat(d).filter(Boolean) : d, S = t.shouldForwardProp;
1613
- if (n && a.shouldForwardProp) {
1614
- var C = a.shouldForwardProp;
1657
+ return wt(f) ? "styled.".concat(f) : "Styled(".concat(Wo(f), ")");
1658
+ }(e) : g, w = t.displayName && t.componentId ? "".concat(fr(t.displayName), "-").concat(t.componentId) : t.componentId || b, k = n && o.attrs ? o.attrs.concat(d).filter(Boolean) : d, S = t.shouldForwardProp;
1659
+ if (n && o.shouldForwardProp) {
1660
+ var C = o.shouldForwardProp;
1615
1661
  if (t.shouldForwardProp) {
1616
1662
  var v = t.shouldForwardProp;
1617
1663
  S = function(f, m) {
@@ -1619,40 +1665,40 @@ function ba(e, t, r) {
1619
1665
  };
1620
1666
  } else S = C;
1621
1667
  }
1622
- var o = new ga(r, w, n ? a.componentStyle : void 0);
1668
+ var a = new ga(r, w, n ? o.componentStyle : void 0);
1623
1669
  function i(f, m) {
1624
1670
  return function(x, y, A) {
1625
- var M = x.attrs, j = x.componentStyle, E = x.defaultProps, W = x.foldedComponentIds, F = x.styledComponentId, V = x.target, I = L.useContext(yn), P = wr(), U = x.shouldForwardProp || P.shouldForwardProp, $ = Oo(y, I, E) || je, D = function(H, Q, J) {
1671
+ var _ = x.attrs, j = x.componentStyle, E = x.defaultProps, K = x.foldedComponentIds, L = x.styledComponentId, V = x.target, I = F.useContext(yn), z = wr(), U = x.shouldForwardProp || z.shouldForwardProp, $ = Oo(y, I, E) || Ie, P = function(H, Q, J) {
1626
1672
  for (var le, de = te(te({}, Q), { className: void 0, theme: J }), Me = 0; Me < H.length; Me += 1) {
1627
- var me = Ie(le = H[Me]) ? le(de) : le;
1673
+ var me = Ae(le = H[Me]) ? le(de) : le;
1628
1674
  for (var X in me) de[X] = X === "className" ? be(de[X], me[X]) : X === "style" ? te(te({}, de[X]), me[X]) : me[X];
1629
1675
  }
1630
1676
  return Q.className && (de.className = be(de.className, Q.className)), de;
1631
- }(M, y, $), z = D.as || V, B = {};
1632
- for (var R in D) D[R] === void 0 || R[0] === "$" || R === "as" || R === "theme" && D.theme === $ || (R === "forwardedAs" ? B.as = D.forwardedAs : U && !U(R, z) || (B[R] = D[R]));
1677
+ }(_, y, $), D = P.as || V, B = {};
1678
+ for (var R in P) P[R] === void 0 || R[0] === "$" || R === "as" || R === "theme" && P.theme === $ || (R === "forwardedAs" ? B.as = P.forwardedAs : U && !U(R, D) || (B[R] = P[R]));
1633
1679
  var Y = function(H, Q) {
1634
1680
  var J = wr(), le = H.generateAndInjectStyles(Q, J.styleSheet, J.stylis);
1635
1681
  return le;
1636
- }(j, D), O = be(W, F);
1637
- return Y && (O += " " + Y), D.className && (O += " " + D.className), B[wt(z) && !on.has(z) ? "class" : "className"] = O, A && (B.ref = A), Xe(z, B);
1682
+ }(j, P), O = be(K, L);
1683
+ return Y && (O += " " + Y), P.className && (O += " " + P.className), B[wt(D) && !on.has(D) ? "class" : "className"] = O, A && (B.ref = A), Xe(D, B);
1638
1684
  }(s, f, m);
1639
1685
  }
1640
1686
  i.displayName = p;
1641
- var s = L.forwardRef(i);
1642
- return s.attrs = k, s.componentStyle = o, s.displayName = p, s.shouldForwardProp = S, s.foldedComponentIds = n ? be(a.foldedComponentIds, a.styledComponentId) : "", s.styledComponentId = w, s.target = n ? a.target : e, Object.defineProperty(s, "defaultProps", { get: function() {
1687
+ var s = F.forwardRef(i);
1688
+ return s.attrs = k, s.componentStyle = a, s.displayName = p, s.shouldForwardProp = S, s.foldedComponentIds = n ? be(o.foldedComponentIds, o.styledComponentId) : "", s.styledComponentId = w, s.target = n ? o.target : e, Object.defineProperty(s, "defaultProps", { get: function() {
1643
1689
  return this._foldedDefaultProps;
1644
1690
  }, set: function(f) {
1645
1691
  this._foldedDefaultProps = n ? function(m) {
1646
1692
  for (var x = [], y = 1; y < arguments.length; y++) x[y - 1] = arguments[y];
1647
- for (var A = 0, M = x; A < M.length; A++) zt(m, M[A], !0);
1693
+ for (var A = 0, _ = x; A < _.length; A++) Dt(m, _[A], !0);
1648
1694
  return m;
1649
- }({}, a.defaultProps, f) : f;
1695
+ }({}, o.defaultProps, f) : f;
1650
1696
  } }), Ht(s, function() {
1651
1697
  return ".".concat(s.styledComponentId);
1652
1698
  }), c && un(s, e, { attrs: !0, componentStyle: !0, displayName: !0, foldedComponentIds: !0, shouldForwardProp: !0, styledComponentId: !0, target: !0 }), s;
1653
1699
  }
1654
1700
  function $r(e, t) {
1655
- for (var r = [e[0]], n = 0, a = t.length; n < a; n += 1) r.push(t[n], e[n + 1]);
1701
+ for (var r = [e[0]], n = 0, o = t.length; n < o; n += 1) r.push(t[n], e[n + 1]);
1656
1702
  return r;
1657
1703
  }
1658
1704
  var Sr = function(e) {
@@ -1660,20 +1706,20 @@ var Sr = function(e) {
1660
1706
  };
1661
1707
  function ya(e) {
1662
1708
  for (var t = [], r = 1; r < arguments.length; r++) t[r - 1] = arguments[r];
1663
- if (Ie(e) || Be(e)) return Sr(xe($r(ut, et([e], t, !0))));
1709
+ if (Ae(e) || Be(e)) return Sr(xe($r(ut, et([e], t, !0))));
1664
1710
  var n = e;
1665
1711
  return t.length === 0 && n.length === 1 && typeof n[0] == "string" ? xe(n) : Sr(xe($r(n, t)));
1666
1712
  }
1667
1713
  function Nt(e, t, r) {
1668
- if (r === void 0 && (r = je), !t) throw Le(1, t);
1669
- var n = function(a) {
1714
+ if (r === void 0 && (r = Ie), !t) throw Le(1, t);
1715
+ var n = function(o) {
1670
1716
  for (var c = [], u = 1; u < arguments.length; u++) c[u - 1] = arguments[u];
1671
- return e(t, r, ya.apply(void 0, et([a], c, !1)));
1717
+ return e(t, r, ya.apply(void 0, et([o], c, !1)));
1672
1718
  };
1673
- return n.attrs = function(a) {
1674
- return Nt(e, t, te(te({}, r), { attrs: Array.prototype.concat(r.attrs, a).filter(Boolean) }));
1675
- }, n.withConfig = function(a) {
1676
- return Nt(e, t, te(te({}, r), a));
1719
+ return n.attrs = function(o) {
1720
+ return Nt(e, t, te(te({}, r), { attrs: Array.prototype.concat(r.attrs, o).filter(Boolean) }));
1721
+ }, n.withConfig = function(o) {
1722
+ return Nt(e, t, te(te({}, r), o));
1677
1723
  }, n;
1678
1724
  }
1679
1725
  var xn = function(e) {
@@ -1726,14 +1772,14 @@ function kn({
1726
1772
  disabled: t,
1727
1773
  onExportPdf: r
1728
1774
  }) {
1729
- const [n, a] = L.useState(!1), c = () => {
1775
+ const [n, o] = F.useState(!1), c = () => {
1730
1776
  Jn(e);
1731
1777
  }, u = async () => {
1732
- a(!0);
1778
+ o(!0);
1733
1779
  try {
1734
1780
  await r(e);
1735
1781
  } finally {
1736
- a(!1);
1782
+ o(!1);
1737
1783
  }
1738
1784
  };
1739
1785
  return /* @__PURE__ */ l.jsxs(xa, { children: [
@@ -1810,217 +1856,16 @@ const ka = T.div`
1810
1856
  background: rgba(239, 68, 68, 0.1);
1811
1857
  }
1812
1858
  `;
1813
- function Ae({ attachments: e, onRemove: t, readOnly: r }) {
1859
+ function ke({ attachments: e, onRemove: t, readOnly: r }) {
1814
1860
  return e.length ? /* @__PURE__ */ l.jsx(ka, { children: e.map((n) => {
1815
- const a = n.type === "image", c = a && (n.preview || n.url);
1816
- return /* @__PURE__ */ l.jsxs(wa, { $isImage: a, title: n.name, children: [
1817
- c ? /* @__PURE__ */ l.jsx(va, { src: n.preview || n.url, alt: "", loading: "lazy", decoding: "async" }) : a ? /* @__PURE__ */ l.jsx(po, { size: 16, "aria-hidden": !0 }) : /* @__PURE__ */ l.jsx(lo, { size: 16, "aria-hidden": !0 }),
1861
+ const o = n.type === "image", c = o && (n.preview || n.url);
1862
+ return /* @__PURE__ */ l.jsxs(wa, { $isImage: o, title: n.name, children: [
1863
+ c ? /* @__PURE__ */ l.jsx(va, { src: n.preview || n.url, alt: "", loading: "lazy", decoding: "async" }) : o ? /* @__PURE__ */ l.jsx(po, { size: 16, "aria-hidden": !0 }) : /* @__PURE__ */ l.jsx(lo, { size: 16, "aria-hidden": !0 }),
1818
1864
  /* @__PURE__ */ l.jsx($a, { children: n.name }),
1819
1865
  !r && t && /* @__PURE__ */ l.jsx(Sa, { type: "button", onClick: () => t(n.id), "aria-label": `Remove ${n.name}`, children: /* @__PURE__ */ l.jsx(go, { size: 14 }) })
1820
1866
  ] }, n.id);
1821
1867
  }) }) : null;
1822
1868
  }
1823
- const wn = [
1824
- "application/pdf",
1825
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
1826
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1827
- "application/vnd.ms-excel",
1828
- "text/csv",
1829
- "text/plain",
1830
- "text/markdown",
1831
- "application/json",
1832
- "image/png",
1833
- "image/jpeg",
1834
- "image/webp",
1835
- "image/gif"
1836
- ], Ca = {
1837
- ".pdf": "application/pdf",
1838
- ".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
1839
- ".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1840
- ".xls": "application/vnd.ms-excel",
1841
- ".csv": "text/csv",
1842
- ".txt": "text/plain",
1843
- ".md": "text/markdown",
1844
- ".json": "application/json",
1845
- ".png": "image/png",
1846
- ".jpg": "image/jpeg",
1847
- ".jpeg": "image/jpeg",
1848
- ".webp": "image/webp",
1849
- ".gif": "image/gif"
1850
- };
1851
- function ja(e) {
1852
- const t = e.lastIndexOf(".");
1853
- if (!(t < 0))
1854
- return Ca[e.slice(t).toLowerCase()];
1855
- }
1856
- async function qt(e) {
1857
- var r;
1858
- if (!e) return [];
1859
- const t = [];
1860
- if ((r = e.files) != null && r.length)
1861
- for (let n = 0; n < e.files.length; n++)
1862
- t.push(e.files[n]);
1863
- return t;
1864
- }
1865
- function vn(e, t, r) {
1866
- if (e.size > t)
1867
- return `File too large (max ${Math.floor(t / (1024 * 1024))}MB)`;
1868
- if (r.includes(e.type)) return null;
1869
- const n = ja(e.name);
1870
- return n && r.includes(n) ? null : "File type not allowed for attachments";
1871
- }
1872
- const Ia = T.button`
1873
- display: flex;
1874
- align-items: center;
1875
- justify-content: center;
1876
- width: 36px;
1877
- height: 36px;
1878
- min-width: 36px;
1879
- min-height: 36px;
1880
- border-radius: 8px;
1881
- border: 1px solid #d1d5db;
1882
- background: #f9fafb;
1883
- color: #374151;
1884
- cursor: pointer;
1885
- flex-shrink: 0;
1886
- transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
1887
-
1888
- &:hover:not(:disabled) {
1889
- background: #f3f4f6;
1890
- border-color: #9ca3af;
1891
- }
1892
-
1893
- &:disabled {
1894
- opacity: 0.45;
1895
- cursor: not-allowed;
1896
- }
1897
-
1898
- [data-theme='dark'] & {
1899
- background: #374151;
1900
- border-color: #4b5563;
1901
- color: #e5e7eb;
1902
- }
1903
- `, Aa = T.button`
1904
- display: flex;
1905
- align-items: center;
1906
- justify-content: center;
1907
- width: 28px;
1908
- height: 28px;
1909
- min-width: 28px;
1910
- min-height: 28px;
1911
- border: none;
1912
- border-radius: 8px;
1913
- background: transparent;
1914
- color: #64748b;
1915
- cursor: pointer;
1916
- flex-shrink: 0;
1917
- transition: background 0.2s ease, color 0.2s ease;
1918
-
1919
- &:hover:not(:disabled) {
1920
- background: rgba(15, 23, 42, 0.06);
1921
- color: #334155;
1922
- }
1923
-
1924
- &:disabled {
1925
- opacity: 0.45;
1926
- cursor: not-allowed;
1927
- }
1928
-
1929
- @media (prefers-color-scheme: dark) {
1930
- color: #94a3b8;
1931
-
1932
- &:hover:not(:disabled) {
1933
- background: rgba(255, 255, 255, 0.08);
1934
- color: #e2e8f0;
1935
- }
1936
- }
1937
-
1938
- [data-theme='dark'] & {
1939
- color: #94a3b8;
1940
-
1941
- &:hover:not(:disabled) {
1942
- background: rgba(255, 255, 255, 0.08);
1943
- color: #e2e8f0;
1944
- }
1945
- }
1946
- `;
1947
- function Gt({
1948
- disabled: e,
1949
- integrated: t = !1,
1950
- maxFileBytes: r,
1951
- maxFiles: n,
1952
- allowedMime: a = wn,
1953
- currentCount: c,
1954
- uploadAttachment: u,
1955
- onUploaded: d,
1956
- onError: h
1957
- }) {
1958
- const b = L.useRef(null), [g, p] = L.useState(!1), w = L.useMemo(
1959
- () => [
1960
- ".pdf,.docx,.xlsx,.xls,.csv,.txt,.md,.json",
1961
- "image/png,image/jpeg,image/webp,image/gif"
1962
- ].join(","),
1963
- []
1964
- ), k = L.useCallback(
1965
- async (i) => {
1966
- const s = Array.from(i);
1967
- if (!s.length) return;
1968
- let f = 0;
1969
- for (const m of s) {
1970
- if (c + f >= n) {
1971
- h == null || h(`You can attach at most ${n} files per message.`);
1972
- break;
1973
- }
1974
- const x = vn(m, r, a);
1975
- if (x) {
1976
- h == null || h(`${m.name}: ${x}`);
1977
- continue;
1978
- }
1979
- try {
1980
- p(!0);
1981
- const y = await u(m);
1982
- d(y), f += 1;
1983
- } catch (y) {
1984
- const A = y instanceof Error ? y.message : "Upload failed";
1985
- h == null || h(A);
1986
- } finally {
1987
- p(!1);
1988
- }
1989
- }
1990
- },
1991
- [a, c, r, n, h, d, u]
1992
- ), S = (i) => {
1993
- const s = i.target.files;
1994
- s != null && s.length && k(s), i.target.value = "";
1995
- }, C = c >= n, v = !!(e || g || C), o = t ? Aa : Ia;
1996
- return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
1997
- /* @__PURE__ */ l.jsx(
1998
- "input",
1999
- {
2000
- ref: b,
2001
- type: "file",
2002
- multiple: !0,
2003
- accept: w,
2004
- style: { display: "none" },
2005
- onChange: S
2006
- }
2007
- ),
2008
- /* @__PURE__ */ l.jsx(
2009
- o,
2010
- {
2011
- type: "button",
2012
- disabled: v,
2013
- "aria-label": "Attach file",
2014
- title: "Attach file",
2015
- onClick: () => {
2016
- var i;
2017
- return (i = b.current) == null ? void 0 : i.click();
2018
- },
2019
- children: /* @__PURE__ */ l.jsx(ho, { size: 16, strokeWidth: 2 })
2020
- }
2021
- )
2022
- ] });
2023
- }
2024
1869
  function ge() {
2025
1870
  return ge = Object.assign ? Object.assign.bind() : function(e) {
2026
1871
  for (var t = 1; t < arguments.length; t++) {
@@ -2030,37 +1875,37 @@ function ge() {
2030
1875
  return e;
2031
1876
  }, ge.apply(this, arguments);
2032
1877
  }
2033
- const Ta = ["children", "options"], jr = ["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" }), Ir = { amp: "&", apos: "'", gt: ">", lt: "<", nbsp: " ", quot: "“" }, Ea = ["style", "script", "pre"], _a = ["src", "href", "data", "formAction", "srcDoc", "action"], Ma = /([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi, Ra = /mailto:/i, Da = /\n{2,}$/, Ar = /^(\s*>[\s\S]*?)(?=\n\n|$)/, Pa = /^ *> ?/gm, za = /^(?:\[!([^\]]*)\]\n)?([\s\S]*)/, Oa = /^ {2,}\n/, Na = /^(?:( *[-*_])){3,} *(?:\n *)+\n/, Tr = /^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/, Er = /^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/, Ba = /^(`+)((?:\\`|(?!\1)`|[^`])+)\1/, La = /^(?:\n *)*\n/, Fa = /\r\n?/g, Ka = /^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/, Wa = /^\[\^([^\]]+)]/, Ua = /\f/g, Ha = /^---[ \t]*\n(.|\n)*\n---[ \t]*\n/, qa = /^\s*?\[(x|\s)\]/, _r = /^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/, Mr = /^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/, Rr = /^([^\n]+)\n *(=|-){3,} *\n/, $t = /^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i, Ga = /&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi, Dr = /^<!--[\s\S]*?(?:-->)/, Ya = /^(data|aria|x)-[a-z_][a-z\d_.-]*$/, St = /^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i, Qa = /^\{.*\}$/, Va = /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, Za = /^<([^ >]+@[^ >]+)>/, Ja = /^<([^ >]+:\/[^ >]+)>/, Xa = /-([a-z])?/gi, Pr = /^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/, es = /^[^\n]+(?: \n|\n{2,})/, ts = /^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/, rs = /^!\[([^\]]*)\] ?\[([^\]]*)\]/, ns = /^\[([^\]]*)\] ?\[([^\]]*)\]/, os = /(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/, as = /\t/g, ss = /(^ *\||\| *$)/g, is = /^ *:-+: *$/, cs = /^ *:-+ *$/, ls = /^ *-+: *$/, pt = (e) => `(?=[\\s\\S]+?\\1${e ? "\\1" : ""})`, ft = "((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)", ds = RegExp(`^([*_])\\1${pt(1)}${ft}\\1\\1(?!\\1)`), us = RegExp(`^([*_])${pt(0)}${ft}\\1(?!\\1)`), ps = RegExp(`^(==)${pt(0)}${ft}\\1`), fs = RegExp(`^(~~)${pt(0)}${ft}\\1`), hs = /^(:[a-zA-Z0-9-_]+:)/, ms = /^\\([^0-9A-Za-z\s])/, gs = /\\([^0-9A-Za-z\s])/g, bs = /^[\s\S](?:(?! \n|[0-9]\.|http)[^=*_~\-\n:<`\\\[!])*/, ys = /^\n+/, xs = /^([ \t]*)/, ks = /(?:^|\n)( *)$/, Yt = "(?:\\d+\\.)", Qt = "(?:[*+-])";
2034
- function $n(e) {
2035
- return "( *)(" + (e === 1 ? Yt : Qt) + ") +";
1878
+ const Ca = ["children", "options"], jr = ["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" }), Ir = { amp: "&", apos: "'", gt: ">", lt: "<", nbsp: " ", quot: "“" }, ja = ["style", "script", "pre"], Ia = ["src", "href", "data", "formAction", "srcDoc", "action"], Aa = /([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi, Ta = /mailto:/i, Ea = /\n{2,}$/, Ar = /^(\s*>[\s\S]*?)(?=\n\n|$)/, _a = /^ *> ?/gm, Ma = /^(?:\[!([^\]]*)\]\n)?([\s\S]*)/, Ra = /^ {2,}\n/, Pa = /^(?:( *[-*_])){3,} *(?:\n *)+\n/, Tr = /^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/, Er = /^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/, za = /^(`+)((?:\\`|(?!\1)`|[^`])+)\1/, Da = /^(?:\n *)*\n/, Oa = /\r\n?/g, Na = /^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/, Ba = /^\[\^([^\]]+)]/, La = /\f/g, Fa = /^---[ \t]*\n(.|\n)*\n---[ \t]*\n/, Wa = /^\s*?\[(x|\s)\]/, _r = /^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/, Mr = /^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/, Rr = /^([^\n]+)\n *(=|-){3,} *\n/, $t = /^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i, Ka = /&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi, Pr = /^<!--[\s\S]*?(?:-->)/, Ua = /^(data|aria|x)-[a-z_][a-z\d_.-]*$/, St = /^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i, Ha = /^\{.*\}$/, qa = /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, Ga = /^<([^ >]+@[^ >]+)>/, Ya = /^<([^ >]+:\/[^ >]+)>/, Qa = /-([a-z])?/gi, zr = /^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/, Va = /^[^\n]+(?: \n|\n{2,})/, Za = /^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/, Ja = /^!\[([^\]]*)\] ?\[([^\]]*)\]/, Xa = /^\[([^\]]*)\] ?\[([^\]]*)\]/, es = /(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/, ts = /\t/g, rs = /(^ *\||\| *$)/g, ns = /^ *:-+: *$/, os = /^ *:-+ *$/, as = /^ *-+: *$/, pt = (e) => `(?=[\\s\\S]+?\\1${e ? "\\1" : ""})`, ft = "((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)", ss = RegExp(`^([*_])\\1${pt(1)}${ft}\\1\\1(?!\\1)`), is = RegExp(`^([*_])${pt(0)}${ft}\\1(?!\\1)`), cs = RegExp(`^(==)${pt(0)}${ft}\\1`), ls = RegExp(`^(~~)${pt(0)}${ft}\\1`), ds = /^(:[a-zA-Z0-9-_]+:)/, us = /^\\([^0-9A-Za-z\s])/, ps = /\\([^0-9A-Za-z\s])/g, fs = /^[\s\S](?:(?! \n|[0-9]\.|http)[^=*_~\-\n:<`\\\[!])*/, hs = /^\n+/, ms = /^([ \t]*)/, gs = /(?:^|\n)( *)$/, qt = "(?:\\d+\\.)", Gt = "(?:[*+-])";
1879
+ function wn(e) {
1880
+ return "( *)(" + (e === 1 ? qt : Gt) + ") +";
2036
1881
  }
2037
- const Sn = $n(1), Cn = $n(2);
2038
- function jn(e) {
2039
- return RegExp("^" + (e === 1 ? Sn : Cn));
1882
+ const vn = wn(1), $n = wn(2);
1883
+ function Sn(e) {
1884
+ return RegExp("^" + (e === 1 ? vn : $n));
2040
1885
  }
2041
- const ws = jn(1), vs = jn(2);
2042
- function In(e) {
2043
- return RegExp("^" + (e === 1 ? Sn : Cn) + "[^\\n]*(?:\\n(?!\\1" + (e === 1 ? Yt : Qt) + " )[^\\n]*)*(\\n|$)", "gm");
1886
+ const bs = Sn(1), ys = Sn(2);
1887
+ function Cn(e) {
1888
+ return RegExp("^" + (e === 1 ? vn : $n) + "[^\\n]*(?:\\n(?!\\1" + (e === 1 ? qt : Gt) + " )[^\\n]*)*(\\n|$)", "gm");
2044
1889
  }
2045
- const $s = In(1), Ss = In(2);
2046
- function An(e) {
2047
- const t = e === 1 ? Yt : Qt;
1890
+ const xs = Cn(1), ks = Cn(2);
1891
+ function jn(e) {
1892
+ const t = e === 1 ? qt : Gt;
2048
1893
  return RegExp("^( *)(" + t + ") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1" + t + " (?!" + t + " ))\\n*|\\s*\\n*$)");
2049
1894
  }
2050
- const Tn = An(1), En = An(2);
2051
- function zr(e, t) {
2052
- const r = t === 1, n = r ? Tn : En, a = r ? $s : Ss, c = r ? ws : vs;
1895
+ const In = jn(1), An = jn(2);
1896
+ function Dr(e, t) {
1897
+ const r = t === 1, n = r ? In : An, o = r ? xs : ks, c = r ? bs : ys;
2053
1898
  return { t: (u) => c.test(u), o: Te(function(u, d) {
2054
- const h = ks.exec(d.prevCapture);
1899
+ const h = gs.exec(d.prevCapture);
2055
1900
  return h && (d.list || !d.inline && !d.simple) ? n.exec(u = h[1] + u) : null;
2056
1901
  }), i: 1, u(u, d, h) {
2057
- const b = r ? +u[2] : void 0, g = u[0].replace(Da, `
2058
- `).match(a);
1902
+ const b = r ? +u[2] : void 0, g = u[0].replace(Ea, `
1903
+ `).match(o);
2059
1904
  let p = !1;
2060
1905
  return { items: g.map(function(w, k) {
2061
- const S = c.exec(w)[0].length, C = RegExp("^ {1," + S + "}", "gm"), v = w.replace(C, "").replace(c, ""), o = k === g.length - 1, i = v.indexOf(`
1906
+ const S = c.exec(w)[0].length, C = RegExp("^ {1," + S + "}", "gm"), v = w.replace(C, "").replace(c, ""), a = k === g.length - 1, i = v.indexOf(`
2062
1907
 
2063
- `) !== -1 || o && p;
1908
+ `) !== -1 || a && p;
2064
1909
  p = i;
2065
1910
  const s = h.inline, f = h.list;
2066
1911
  let m;
@@ -2074,7 +1919,7 @@ function zr(e, t) {
2074
1919
  return e("li", { key: g }, d(b, h));
2075
1920
  })) };
2076
1921
  }
2077
- const Cs = RegExp(`^\\[((?:\\[[^\\[\\]]*(?:\\[[^\\[\\]]*\\][^\\[\\]]*)*\\]|[^\\[\\]])*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['"]([\\s\\S]*?)['"])?\\s*\\)`), js = /^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/;
1922
+ const ws = RegExp(`^\\[((?:\\[[^\\[\\]]*(?:\\[[^\\[\\]]*\\][^\\[\\]]*)*\\]|[^\\[\\]])*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['"]([\\s\\S]*?)['"])?\\s*\\)`), vs = /^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/;
2078
1923
  function Ne(e) {
2079
1924
  let t = e.length;
2080
1925
  for (; t > 0 && e[t - 1] <= " "; ) t--;
@@ -2083,21 +1928,21 @@ function Ne(e) {
2083
1928
  function Ze(e, t) {
2084
1929
  return e.startsWith(t);
2085
1930
  }
2086
- function Is(e, t, r) {
1931
+ function $s(e, t, r) {
2087
1932
  if (Array.isArray(r)) {
2088
1933
  for (let n = 0; n < r.length; n++) if (Ze(e, r[n])) return !0;
2089
1934
  return !1;
2090
1935
  }
2091
1936
  return r(e, t);
2092
1937
  }
2093
- function De(e) {
1938
+ function Pe(e) {
2094
1939
  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();
2095
1940
  }
2096
- function As(e) {
2097
- return ls.test(e) ? "right" : is.test(e) ? "center" : cs.test(e) ? "left" : null;
1941
+ function Ss(e) {
1942
+ return as.test(e) ? "right" : ns.test(e) ? "center" : os.test(e) ? "left" : null;
2098
1943
  }
2099
1944
  function Or(e, t, r, n) {
2100
- const a = r.inTable;
1945
+ const o = r.inTable;
2101
1946
  r.inTable = !0;
2102
1947
  let c = [[]], u = "";
2103
1948
  function d() {
@@ -2107,17 +1952,17 @@ function Or(e, t, r, n) {
2107
1952
  }
2108
1953
  return e.trim().split(/(`[^`]*`|\\\||\|)/).filter(Boolean).forEach((h, b, g) => {
2109
1954
  h.trim() === "|" && (d(), n) ? b !== 0 && b !== g.length - 1 && c.push([]) : u += h;
2110
- }), d(), r.inTable = a, c;
1955
+ }), d(), r.inTable = o, c;
2111
1956
  }
2112
- function Ts(e, t, r) {
1957
+ function Cs(e, t, r) {
2113
1958
  r.inline = !0;
2114
- const n = e[2] ? e[2].replace(ss, "").split("|").map(As) : [], a = e[3] ? function(u, d, h) {
1959
+ const n = e[2] ? e[2].replace(rs, "").split("|").map(Ss) : [], o = e[3] ? function(u, d, h) {
2115
1960
  return u.trim().split(`
2116
1961
  `).map(function(b) {
2117
1962
  return Or(b, d, h, !0);
2118
1963
  });
2119
- }(e[3], t, r) : [], c = Or(e[1], t, r, !!a.length);
2120
- return r.inline = !1, a.length ? { align: n, cells: a, header: c, type: "25" } : { children: c, type: "21" };
1964
+ }(e[3], t, r) : [], c = Or(e[1], t, r, !!o.length);
1965
+ return r.inline = !1, o.length ? { align: n, cells: o, header: c, type: "25" } : { children: c, type: "21" };
2121
1966
  }
2122
1967
  function Nr(e, t) {
2123
1968
  return e.align[t] == null ? {} : { textAlign: e.align[t] };
@@ -2145,36 +1990,36 @@ function Ue(e) {
2145
1990
  return e.exec(t);
2146
1991
  });
2147
1992
  }
2148
- const Es = /(javascript|vbscript|data(?!:image)):/i;
2149
- function _s(e) {
1993
+ const js = /(javascript|vbscript|data(?!:image)):/i;
1994
+ function Is(e) {
2150
1995
  try {
2151
1996
  const t = decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g, "");
2152
- if (Es.test(t)) return null;
1997
+ if (js.test(t)) return null;
2153
1998
  } catch {
2154
1999
  return null;
2155
2000
  }
2156
2001
  return e;
2157
2002
  }
2158
2003
  function oe(e) {
2159
- return e && e.replace(gs, "$1");
2004
+ return e && e.replace(ps, "$1");
2160
2005
  }
2161
2006
  function Je(e, t, r) {
2162
- const n = r.inline || !1, a = r.simple || !1;
2007
+ const n = r.inline || !1, o = r.simple || !1;
2163
2008
  r.inline = !0, r.simple = !0;
2164
2009
  const c = e(t, r);
2165
- return r.inline = n, r.simple = a, c;
2010
+ return r.inline = n, r.simple = o, c;
2166
2011
  }
2167
- function Ms(e, t, r) {
2168
- const n = r.inline || !1, a = r.simple || !1;
2012
+ function As(e, t, r) {
2013
+ const n = r.inline || !1, o = r.simple || !1;
2169
2014
  r.inline = !1, r.simple = !0;
2170
2015
  const c = e(t, r);
2171
- return r.inline = n, r.simple = a, c;
2016
+ return r.inline = n, r.simple = o, c;
2172
2017
  }
2173
- function Rs(e, t, r) {
2018
+ function Ts(e, t, r) {
2174
2019
  const n = r.inline || !1;
2175
2020
  r.inline = !1;
2176
- const a = e(t, r);
2177
- return r.inline = n, a;
2021
+ const o = e(t, r);
2022
+ return r.inline = n, o;
2178
2023
  }
2179
2024
  const Ct = (e, t, r) => ({ children: Je(t, e[2], r) });
2180
2025
  function jt() {
@@ -2183,30 +2028,30 @@ function jt() {
2183
2028
  function It() {
2184
2029
  return null;
2185
2030
  }
2186
- function Ds(...e) {
2031
+ function Es(...e) {
2187
2032
  return e.filter(Boolean).join(" ");
2188
2033
  }
2189
2034
  function At(e, t, r) {
2190
2035
  let n = e;
2191
- const a = t.split(".");
2192
- for (; a.length && (n = n[a[0]], n !== void 0); ) a.shift();
2036
+ const o = t.split(".");
2037
+ for (; o.length && (n = n[o[0]], n !== void 0); ) o.shift();
2193
2038
  return n || r;
2194
2039
  }
2195
- function Ps(e = "", t = {}) {
2040
+ function _s(e = "", t = {}) {
2196
2041
  t.overrides = t.overrides || {}, t.namedCodesToUnicode = t.namedCodesToUnicode ? ge({}, Ir, t.namedCodesToUnicode) : Ir;
2197
- const r = t.slugify || De, n = t.sanitizer || _s, a = t.createElement || Bt.createElement, c = [Ar, Tr, Er, t.enforceAtxHeadings ? Mr : _r, Rr, Pr, Tn, En], u = [...c, es, $t, Dr, St];
2198
- function d(o, i, ...s) {
2199
- const f = At(t.overrides, o + ".props", {});
2200
- return a(function(m, x) {
2042
+ const r = t.slugify || Pe, n = t.sanitizer || Is, o = t.createElement || Bt.createElement, c = [Ar, Tr, Er, t.enforceAtxHeadings ? Mr : _r, Rr, zr, In, An], u = [...c, Va, $t, Pr, St];
2043
+ function d(a, i, ...s) {
2044
+ const f = At(t.overrides, a + ".props", {});
2045
+ return o(function(m, x) {
2201
2046
  const y = At(x, m);
2202
2047
  return y ? typeof y == "function" || typeof y == "object" && "render" in y ? y : At(x, m + ".component", m) : m;
2203
- }(o, t.overrides), ge({}, i, f, { className: Ds(i == null ? void 0 : i.className, f.className) || void 0 }), ...s);
2048
+ }(a, t.overrides), ge({}, i, f, { className: Es(i == null ? void 0 : i.className, f.className) || void 0 }), ...s);
2204
2049
  }
2205
- function h(o) {
2206
- o = o.replace(Ha, "");
2050
+ function h(a) {
2051
+ a = a.replace(Fa, "");
2207
2052
  let i = !1;
2208
- t.forceInline ? i = !0 : t.forceBlock || (i = os.test(o) === !1);
2209
- const s = S(k(i ? o : Ne(o).replace(ys, "") + `
2053
+ t.forceInline ? i = !0 : t.forceBlock || (i = es.test(a) === !1);
2054
+ const s = S(k(i ? a : Ne(a).replace(hs, "") + `
2210
2055
 
2211
2056
  `, { inline: i }));
2212
2057
  for (; typeof s[s.length - 1] == "string" && !s[s.length - 1].trim(); ) s.pop();
@@ -2218,38 +2063,38 @@ function Ps(e = "", t = {}) {
2218
2063
  if (s.length === 1) return m = s[0], typeof m == "string" ? d("span", { key: "outer" }, m) : m;
2219
2064
  m = null;
2220
2065
  }
2221
- return a(f, { key: "outer" }, m);
2066
+ return o(f, { key: "outer" }, m);
2222
2067
  }
2223
- function b(o, i) {
2068
+ function b(a, i) {
2224
2069
  if (!i || !i.trim()) return null;
2225
- const s = i.match(Ma);
2070
+ const s = i.match(Aa);
2226
2071
  return s ? s.reduce(function(f, m) {
2227
2072
  const x = m.indexOf("=");
2228
2073
  if (x !== -1) {
2229
2074
  const y = function(E) {
2230
- return E.indexOf("-") !== -1 && E.match(Ya) === null && (E = E.replace(Xa, function(W, F) {
2231
- return F.toUpperCase();
2075
+ return E.indexOf("-") !== -1 && E.match(Ua) === null && (E = E.replace(Qa, function(K, L) {
2076
+ return L.toUpperCase();
2232
2077
  })), E;
2233
2078
  }(m.slice(0, x)).trim(), A = function(E) {
2234
- const W = E[0];
2235
- return (W === '"' || W === "'") && E.length >= 2 && E[E.length - 1] === W ? E.slice(1, -1) : E;
2236
- }(m.slice(x + 1).trim()), M = jr[y] || y;
2237
- if (M === "ref") return f;
2238
- const j = f[M] = function(E, W, F, V) {
2239
- return W === "style" ? function(I) {
2240
- const P = [];
2241
- let U = "", $ = !1, D = !1, z = "";
2242
- if (!I) return P;
2079
+ const K = E[0];
2080
+ return (K === '"' || K === "'") && E.length >= 2 && E[E.length - 1] === K ? E.slice(1, -1) : E;
2081
+ }(m.slice(x + 1).trim()), _ = jr[y] || y;
2082
+ if (_ === "ref") return f;
2083
+ const j = f[_] = function(E, K, L, V) {
2084
+ return K === "style" ? function(I) {
2085
+ const z = [];
2086
+ let U = "", $ = !1, P = !1, D = "";
2087
+ if (!I) return z;
2243
2088
  for (let R = 0; R < I.length; R++) {
2244
2089
  const Y = I[R];
2245
- if (Y !== '"' && Y !== "'" || $ || (D ? Y === z && (D = !1, z = "") : (D = !0, z = Y)), Y === "(" && U.endsWith("url") ? $ = !0 : Y === ")" && $ && ($ = !1), Y !== ";" || D || $) U += Y;
2090
+ if (Y !== '"' && Y !== "'" || $ || (P ? Y === D && (P = !1, D = "") : (P = !0, D = Y)), Y === "(" && U.endsWith("url") ? $ = !0 : Y === ")" && $ && ($ = !1), Y !== ";" || P || $) U += Y;
2246
2091
  else {
2247
2092
  const O = U.trim();
2248
2093
  if (O) {
2249
2094
  const H = O.indexOf(":");
2250
2095
  if (H > 0) {
2251
2096
  const Q = O.slice(0, H).trim(), J = O.slice(H + 1).trim();
2252
- P.push([Q, J]);
2097
+ z.push([Q, J]);
2253
2098
  }
2254
2099
  }
2255
2100
  U = "";
@@ -2260,59 +2105,59 @@ function Ps(e = "", t = {}) {
2260
2105
  const R = B.indexOf(":");
2261
2106
  if (R > 0) {
2262
2107
  const Y = B.slice(0, R).trim(), O = B.slice(R + 1).trim();
2263
- P.push([Y, O]);
2108
+ z.push([Y, O]);
2264
2109
  }
2265
2110
  }
2266
- return P;
2267
- }(F).reduce(function(I, [P, U]) {
2268
- return I[P.replace(/(-[a-z])/g, ($) => $[1].toUpperCase())] = V(U, E, P), I;
2269
- }, {}) : _a.indexOf(W) !== -1 ? V(oe(F), E, W) : (F.match(Qa) && (F = oe(F.slice(1, F.length - 1))), F === "true" || F !== "false" && F);
2270
- }(o, y, A, n);
2271
- typeof j == "string" && ($t.test(j) || St.test(j)) && (f[M] = h(j.trim()));
2111
+ return z;
2112
+ }(L).reduce(function(I, [z, U]) {
2113
+ return I[z.replace(/(-[a-z])/g, ($) => $[1].toUpperCase())] = V(U, E, z), I;
2114
+ }, {}) : Ia.indexOf(K) !== -1 ? V(oe(L), E, K) : (L.match(Ha) && (L = oe(L.slice(1, L.length - 1))), L === "true" || L !== "false" && L);
2115
+ }(a, y, A, n);
2116
+ typeof j == "string" && ($t.test(j) || St.test(j)) && (f[_] = h(j.trim()));
2272
2117
  } else m !== "style" && (f[jr[m] || m] = !0);
2273
2118
  return f;
2274
2119
  }, {}) : null;
2275
2120
  }
2276
- const g = [], p = {}, w = { 0: { t: [">"], o: ie(Ar), i: 1, u(o, i, s) {
2277
- const [, f, m] = o[0].replace(Pa, "").match(za);
2121
+ const g = [], p = {}, w = { 0: { t: [">"], o: ie(Ar), i: 1, u(a, i, s) {
2122
+ const [, f, m] = a[0].replace(_a, "").match(Ma);
2278
2123
  return { alert: f, children: i(m, s) };
2279
- }, l(o, i, s) {
2124
+ }, l(a, i, s) {
2280
2125
  const f = { key: s.key };
2281
- return o.alert && (f.className = "markdown-alert-" + r(o.alert.toLowerCase(), De), o.children.unshift({ attrs: {}, children: [{ type: "27", text: o.alert }], noInnerParse: !0, type: "11", tag: "header" })), d("blockquote", f, i(o.children, s));
2282
- } }, 1: { o: Ue(Oa), i: 1, u: jt, l: (o, i, s) => d("br", { key: s.key }) }, 2: { t: (o) => {
2283
- const i = o[0];
2126
+ return a.alert && (f.className = "markdown-alert-" + r(a.alert.toLowerCase(), Pe), a.children.unshift({ attrs: {}, children: [{ type: "27", text: a.alert }], noInnerParse: !0, type: "11", tag: "header" })), d("blockquote", f, i(a.children, s));
2127
+ } }, 1: { o: Ue(Ra), i: 1, u: jt, l: (a, i, s) => d("br", { key: s.key }) }, 2: { t: (a) => {
2128
+ const i = a[0];
2284
2129
  return i === "-" || i === "*" || i === "_";
2285
- }, o: ie(Na), i: 1, u: jt, l: (o, i, s) => d("hr", { key: s.key }) }, 3: { t: [" "], o: ie(Er), i: 0, u: (o) => ({ lang: void 0, text: oe(Ne(o[0].replace(/^ {4}/gm, ""))) }), l: (o, i, s) => d("pre", { key: s.key }, d("code", ge({}, o.attrs, { className: o.lang ? "lang-" + o.lang : "" }), o.text)) }, 4: { t: ["```", "~~~"], o: ie(Tr), i: 0, u: (o) => ({ attrs: b("code", o[3] || ""), lang: o[2] || void 0, text: o[4], type: "3" }) }, 5: { t: ["`"], o: pe(Ba), i: 3, u: (o) => ({ text: oe(o[2]) }), l: (o, i, s) => d("code", { key: s.key }, o.text) }, 6: { t: ["[^"], o: ie(Ka), i: 0, u: (o) => (g.push({ footnote: o[2], identifier: o[1] }), {}), l: It }, 7: { t: ["[^"], o: ue(Wa), i: 1, u: (o) => ({ target: "#" + r(o[1], De), 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(qa), 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: ie(t.enforceAtxHeadings ? Mr : _r), i: 1, u: (o, i, s) => ({ children: Je(i, o[2], s), id: r(o[2], De), level: o[1].length }), l: (o, i, s) => d("h" + o.level, { id: o.id, key: s.key }, i(o.children, s)) }, 10: { o: ie(Rr), i: 0, u: (o, i, s) => ({ children: Je(i, o[1], s), level: o[2] === "=" ? 1 : 2, type: "9" }) }, 11: { t: ["<"], o: Ue($t), i: 1, u(o, i, s) {
2286
- const [, f] = o[3].match(xs), m = RegExp("^" + f, "gm"), x = o[3].replace(m, ""), y = (A = x, u.some((F) => F.test(A)) ? Rs : Je);
2130
+ }, o: ie(Pa), i: 1, u: jt, l: (a, i, s) => d("hr", { key: s.key }) }, 3: { t: [" "], o: ie(Er), i: 0, u: (a) => ({ lang: void 0, text: oe(Ne(a[0].replace(/^ {4}/gm, ""))) }), l: (a, i, s) => d("pre", { key: s.key }, d("code", ge({}, a.attrs, { className: a.lang ? "lang-" + a.lang : "" }), a.text)) }, 4: { t: ["```", "~~~"], o: ie(Tr), i: 0, u: (a) => ({ attrs: b("code", a[3] || ""), lang: a[2] || void 0, text: a[4], type: "3" }) }, 5: { t: ["`"], o: pe(za), i: 3, u: (a) => ({ text: oe(a[2]) }), l: (a, i, s) => d("code", { key: s.key }, a.text) }, 6: { t: ["[^"], o: ie(Na), i: 0, u: (a) => (g.push({ footnote: a[2], identifier: a[1] }), {}), l: It }, 7: { t: ["[^"], o: ue(Ba), i: 1, u: (a) => ({ target: "#" + r(a[1], Pe), text: a[1] }), l: (a, i, s) => d("a", { key: s.key, href: n(a.target, "a", "href") }, d("sup", { key: s.key }, a.text)) }, 8: { t: ["[ ]", "[x]"], o: ue(Wa), i: 1, u: (a) => ({ completed: a[1].toLowerCase() === "x" }), l: (a, i, s) => d("input", { checked: a.completed, key: s.key, readOnly: !0, type: "checkbox" }) }, 9: { t: ["#"], o: ie(t.enforceAtxHeadings ? Mr : _r), i: 1, u: (a, i, s) => ({ children: Je(i, a[2], s), id: r(a[2], Pe), level: a[1].length }), l: (a, i, s) => d("h" + a.level, { id: a.id, key: s.key }, i(a.children, s)) }, 10: { o: ie(Rr), i: 0, u: (a, i, s) => ({ children: Je(i, a[1], s), level: a[2] === "=" ? 1 : 2, type: "9" }) }, 11: { t: ["<"], o: Ue($t), i: 1, u(a, i, s) {
2131
+ const [, f] = a[3].match(ms), m = RegExp("^" + f, "gm"), x = a[3].replace(m, ""), y = (A = x, u.some((L) => L.test(A)) ? Ts : Je);
2287
2132
  var A;
2288
- const M = o[1].toLowerCase(), j = Ea.indexOf(M) !== -1, E = (j ? M : o[1]).trim(), W = { attrs: b(E, o[2]), noInnerParse: j, tag: E };
2289
- if (s.inAnchor = s.inAnchor || M === "a", j) W.text = o[3];
2133
+ const _ = a[1].toLowerCase(), j = ja.indexOf(_) !== -1, E = (j ? _ : a[1]).trim(), K = { attrs: b(E, a[2]), noInnerParse: j, tag: E };
2134
+ if (s.inAnchor = s.inAnchor || _ === "a", j) K.text = a[3];
2290
2135
  else {
2291
- const F = s.inHTML;
2292
- s.inHTML = !0, W.children = y(i, x, s), s.inHTML = F;
2136
+ const L = s.inHTML;
2137
+ s.inHTML = !0, K.children = y(i, x, s), s.inHTML = L;
2293
2138
  }
2294
- return s.inAnchor = !1, W;
2295
- }, l: (o, i, s) => d(o.tag, ge({ key: s.key }, o.attrs), o.text || (o.children ? i(o.children, s) : "")) }, 13: { t: ["<"], o: Ue(St), i: 1, u(o) {
2296
- const i = o[1].trim();
2297
- return { attrs: b(i, o[2] || ""), tag: i };
2298
- }, l: (o, i, s) => d(o.tag, ge({}, o.attrs, { key: s.key })) }, 12: { t: ["<!--"], o: Ue(Dr), i: 1, u: () => ({}), l: It }, 14: { t: ["!["], o: pe(js), 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(Cs), i: 3, u: (o, i, s) => ({ children: Ms(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(Ja), i: 0, u: (o) => ({ children: [{ text: o[1], type: "27" }], target: o[1], type: "15" }) }, 17: { t: (o, i) => !i.inAnchor && !t.disableAutoLink && (Ze(o, "http://") || Ze(o, "https://")), o: ue(Va), i: 0, u: (o) => ({ children: [{ text: o[1], type: "27" }], target: o[1], title: void 0, type: "15" }) }, 18: { t: ["<"], o: ue(Za), i: 0, u(o) {
2299
- let i = o[1], s = o[1];
2300
- return Ra.test(s) || (s = "mailto:" + s), { children: [{ text: i.replace("mailto:", ""), type: "27" }], target: s, type: "15" };
2301
- } }, 20: zr(d, 1), 33: zr(d, 2), 19: { o: ie(La), i: 3, u: jt, l: () => `
2302
- ` }, 21: { o: Te(function(o, i) {
2303
- if (i.inline || i.simple || i.inHTML && o.indexOf(`
2139
+ return s.inAnchor = !1, K;
2140
+ }, l: (a, i, s) => d(a.tag, ge({ key: s.key }, a.attrs), a.text || (a.children ? i(a.children, s) : "")) }, 13: { t: ["<"], o: Ue(St), i: 1, u(a) {
2141
+ const i = a[1].trim();
2142
+ return { attrs: b(i, a[2] || ""), tag: i };
2143
+ }, l: (a, i, s) => d(a.tag, ge({}, a.attrs, { key: s.key })) }, 12: { t: ["<!--"], o: Ue(Pr), i: 1, u: () => ({}), l: It }, 14: { t: ["!["], o: pe(vs), i: 1, u: (a) => ({ alt: oe(a[1]), target: oe(a[2]), title: oe(a[3]) }), l: (a, i, s) => d("img", { key: s.key, alt: a.alt || void 0, title: a.title || void 0, src: n(a.target, "img", "src") }) }, 15: { t: ["["], o: ue(ws), i: 3, u: (a, i, s) => ({ children: As(i, a[1], s), target: oe(a[2]), title: oe(a[3]) }), l: (a, i, s) => d("a", { key: s.key, href: n(a.target, "a", "href"), title: a.title }, i(a.children, s)) }, 16: { t: ["<"], o: ue(Ya), i: 0, u: (a) => ({ children: [{ text: a[1], type: "27" }], target: a[1], type: "15" }) }, 17: { t: (a, i) => !i.inAnchor && !t.disableAutoLink && (Ze(a, "http://") || Ze(a, "https://")), o: ue(qa), i: 0, u: (a) => ({ children: [{ text: a[1], type: "27" }], target: a[1], title: void 0, type: "15" }) }, 18: { t: ["<"], o: ue(Ga), i: 0, u(a) {
2144
+ let i = a[1], s = a[1];
2145
+ return Ta.test(s) || (s = "mailto:" + s), { children: [{ text: i.replace("mailto:", ""), type: "27" }], target: s, type: "15" };
2146
+ } }, 20: Dr(d, 1), 33: Dr(d, 2), 19: { o: ie(Da), i: 3, u: jt, l: () => `
2147
+ ` }, 21: { o: Te(function(a, i) {
2148
+ if (i.inline || i.simple || i.inHTML && a.indexOf(`
2304
2149
 
2305
2150
  `) === -1 && i.prevCapture.indexOf(`
2306
2151
 
2307
2152
  `) === -1) return null;
2308
2153
  let s = "";
2309
- o.split(`
2154
+ a.split(`
2310
2155
  `).every((m) => (m += `
2311
2156
  `, !c.some((x) => x.test(m)) && (s += m, !!m.trim())));
2312
2157
  const f = Ne(s);
2313
2158
  return f === "" ? null : [s, , f];
2314
- }), i: 3, u: Ct, l: (o, i, s) => d("p", { key: s.key }, i(o.children, s)) }, 22: { t: ["["], o: ue(ts), i: 0, u: (o) => (p[o[1]] = { target: o[2], title: o[4] }, {}), l: It }, 23: { t: ["!["], o: pe(rs), 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(ns), 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: ie(Pr), i: 1, u: Ts, l(o, i, s) {
2315
- const f = o;
2159
+ }), i: 3, u: Ct, l: (a, i, s) => d("p", { key: s.key }, i(a.children, s)) }, 22: { t: ["["], o: ue(Za), i: 0, u: (a) => (p[a[1]] = { target: a[2], title: a[4] }, {}), l: It }, 23: { t: ["!["], o: pe(Ja), i: 0, u: (a) => ({ alt: a[1] ? oe(a[1]) : void 0, ref: a[2] }), l: (a, i, s) => p[a.ref] ? d("img", { key: s.key, alt: a.alt, src: n(p[a.ref].target, "img", "src"), title: p[a.ref].title }) : null }, 24: { t: (a) => a[0] === "[" && a.indexOf("](") === -1, o: ue(Xa), i: 0, u: (a, i, s) => ({ children: i(a[1], s), fallbackChildren: a[0], ref: a[2] }), l: (a, i, s) => p[a.ref] ? d("a", { key: s.key, href: n(p[a.ref].target, "a", "href"), title: p[a.ref].title }, i(a.children, s)) : d("span", { key: s.key }, a.fallbackChildren) }, 25: { t: ["|"], o: ie(zr), i: 1, u: Cs, l(a, i, s) {
2160
+ const f = a;
2316
2161
  return d("table", { key: s.key }, d("thead", null, d("tr", null, f.header.map(function(m, x) {
2317
2162
  return d("th", { key: x, style: Nr(f, x) }, i(m, s));
2318
2163
  }))), d("tbody", null, f.cells.map(function(m, x) {
@@ -2320,28 +2165,28 @@ function Ps(e = "", t = {}) {
2320
2165
  return d("td", { key: A, style: Nr(f, A) }, i(y, s));
2321
2166
  }));
2322
2167
  })));
2323
- } }, 27: { o: Te(function(o, i) {
2168
+ } }, 27: { o: Te(function(a, i) {
2324
2169
  let s;
2325
- return Ze(o, ":") && (s = hs.exec(o)), s || bs.exec(o);
2326
- }), i: 4, u(o) {
2327
- const i = o[0];
2328
- return { text: i.indexOf("&") === -1 ? i : i.replace(Ga, (s, f) => t.namedCodesToUnicode[f] || s) };
2329
- }, l: (o) => o.text }, 28: { t: ["**", "__"], o: pe(ds), 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) => {
2330
- const i = o[0];
2331
- return (i === "*" || i === "_") && o[1] !== i;
2332
- }, o: pe(us), 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(ms), i: 1, u: (o) => ({ text: o[1], type: "27" }) }, 31: { t: ["=="], o: pe(ps), i: 3, u: Ct, l: (o, i, s) => d("mark", { key: s.key }, i(o.children, s)) }, 32: { t: ["~~"], o: pe(fs), i: 3, u: Ct, l: (o, i, s) => d("del", { key: s.key }, i(o.children, s)) } };
2170
+ return Ze(a, ":") && (s = ds.exec(a)), s || fs.exec(a);
2171
+ }), i: 4, u(a) {
2172
+ const i = a[0];
2173
+ return { text: i.indexOf("&") === -1 ? i : i.replace(Ka, (s, f) => t.namedCodesToUnicode[f] || s) };
2174
+ }, l: (a) => a.text }, 28: { t: ["**", "__"], o: pe(ss), i: 2, u: (a, i, s) => ({ children: i(a[2], s) }), l: (a, i, s) => d("strong", { key: s.key }, i(a.children, s)) }, 29: { t: (a) => {
2175
+ const i = a[0];
2176
+ return (i === "*" || i === "_") && a[1] !== i;
2177
+ }, o: pe(is), i: 3, u: (a, i, s) => ({ children: i(a[2], s) }), l: (a, i, s) => d("em", { key: s.key }, i(a.children, s)) }, 30: { t: ["\\"], o: pe(us), i: 1, u: (a) => ({ text: a[1], type: "27" }) }, 31: { t: ["=="], o: pe(cs), i: 3, u: Ct, l: (a, i, s) => d("mark", { key: s.key }, i(a.children, s)) }, 32: { t: ["~~"], o: pe(ls), i: 3, u: Ct, l: (a, i, s) => d("del", { key: s.key }, i(a.children, s)) } };
2333
2178
  t.disableParsingRawHTML === !0 && (delete w[11], delete w[13]);
2334
- const k = function(o) {
2335
- var i = Object.keys(o);
2179
+ const k = function(a) {
2180
+ var i = Object.keys(a);
2336
2181
  function s(f, m) {
2337
2182
  var x = [];
2338
2183
  if (m.prevCapture = m.prevCapture || "", f.trim()) for (; f; ) for (var y = 0; y < i.length; ) {
2339
- var A = i[y], M = o[A];
2340
- if (!M.t || Is(f, m, M.t)) {
2341
- var j = M.o(f, m);
2184
+ var A = i[y], _ = a[A];
2185
+ if (!_.t || $s(f, m, _.t)) {
2186
+ var j = _.o(f, m);
2342
2187
  if (j && j[0]) {
2343
2188
  f = f.substring(j[0].length);
2344
- var E = M.u(j, s, m);
2189
+ var E = _.u(j, s, m);
2345
2190
  m.prevCapture += j[0], E.type || (E.type = A), x.push(E);
2346
2191
  break;
2347
2192
  }
@@ -2351,46 +2196,46 @@ function Ps(e = "", t = {}) {
2351
2196
  return m.prevCapture = "", x;
2352
2197
  }
2353
2198
  return i.sort(function(f, m) {
2354
- return o[f].i - o[m].i || (f < m ? -1 : 1);
2199
+ return a[f].i - a[m].i || (f < m ? -1 : 1);
2355
2200
  }), function(f, m) {
2356
2201
  return s(function(x) {
2357
- return x.replace(Fa, `
2358
- `).replace(Ua, "").replace(as, " ");
2202
+ return x.replace(Oa, `
2203
+ `).replace(La, "").replace(ts, " ");
2359
2204
  }(f), m);
2360
2205
  };
2361
- }(w), S = (C = /* @__PURE__ */ function(o, i) {
2206
+ }(w), S = (C = /* @__PURE__ */ function(a, i) {
2362
2207
  return function(s, f, m) {
2363
- const x = o[s.type].l;
2208
+ const x = a[s.type].l;
2364
2209
  return i ? i(() => x(s, f, m), s, f, m) : x(s, f, m);
2365
2210
  };
2366
- }(w, t.renderRule), function o(i, s = {}) {
2211
+ }(w, t.renderRule), function a(i, s = {}) {
2367
2212
  if (Array.isArray(i)) {
2368
2213
  const f = s.key, m = [];
2369
2214
  let x = !1;
2370
2215
  for (let y = 0; y < i.length; y++) {
2371
2216
  s.key = y;
2372
- const A = o(i[y], s), M = typeof A == "string";
2373
- M && x ? m[m.length - 1] += A : A !== null && m.push(A), x = M;
2217
+ const A = a(i[y], s), _ = typeof A == "string";
2218
+ _ && x ? m[m.length - 1] += A : A !== null && m.push(A), x = _;
2374
2219
  }
2375
2220
  return s.key = f, m;
2376
2221
  }
2377
- return C(i, o, s);
2222
+ return C(i, a, s);
2378
2223
  });
2379
2224
  var C;
2380
2225
  const v = h(e);
2381
- return g.length ? d("div", null, v, d("footer", { key: "footer" }, g.map(function(o) {
2382
- return d("div", { id: r(o.identifier, De), key: o.identifier }, o.identifier, S(k(o.footnote, { inline: !0 })));
2226
+ return g.length ? d("div", null, v, d("footer", { key: "footer" }, g.map(function(a) {
2227
+ return d("div", { id: r(a.identifier, Pe), key: a.identifier }, a.identifier, S(k(a.footnote, { inline: !0 })));
2383
2228
  }))) : v;
2384
2229
  }
2385
- const zs = (e) => {
2386
- let { children: t = "", options: r } = e, n = function(a, c) {
2387
- if (a == null) return {};
2388
- var u, d, h = {}, b = Object.keys(a);
2389
- for (d = 0; d < b.length; d++) c.indexOf(u = b[d]) >= 0 || (h[u] = a[u]);
2230
+ const Ms = (e) => {
2231
+ let { children: t = "", options: r } = e, n = function(o, c) {
2232
+ if (o == null) return {};
2233
+ var u, d, h = {}, b = Object.keys(o);
2234
+ for (d = 0; d < b.length; d++) c.indexOf(u = b[d]) >= 0 || (h[u] = o[u]);
2390
2235
  return h;
2391
- }(e, Ta);
2392
- return Bt.cloneElement(Ps(t, r), n);
2393
- }, Os = T.div`
2236
+ }(e, Ca);
2237
+ return Bt.cloneElement(_s(t, r), n);
2238
+ }, Rs = T.div`
2394
2239
  code {
2395
2240
  @media (prefers-color-scheme: dark) {
2396
2241
  background-color: #374151 !important;
@@ -2429,9 +2274,9 @@ const zs = (e) => {
2429
2274
  }
2430
2275
  }
2431
2276
  `;
2432
- function Vt({ content: e, className: t }) {
2433
- return /* @__PURE__ */ l.jsx(Os, { className: t, children: /* @__PURE__ */ l.jsx(
2434
- zs,
2277
+ function Ps({ content: e, className: t }) {
2278
+ return /* @__PURE__ */ l.jsx(Rs, { className: t, children: /* @__PURE__ */ l.jsx(
2279
+ Ms,
2435
2280
  {
2436
2281
  options: {
2437
2282
  overrides: {
@@ -2595,6 +2440,19 @@ function Vt({ content: e, className: t }) {
2595
2440
  target: "_blank",
2596
2441
  rel: "noopener noreferrer"
2597
2442
  }
2443
+ },
2444
+ img: {
2445
+ props: {
2446
+ style: {
2447
+ maxWidth: "100%",
2448
+ height: "auto",
2449
+ borderRadius: "8px",
2450
+ display: "block",
2451
+ marginBottom: "10px"
2452
+ },
2453
+ loading: "lazy",
2454
+ decoding: "async"
2455
+ }
2598
2456
  }
2599
2457
  }
2600
2458
  },
@@ -2602,16 +2460,243 @@ function Vt({ content: e, className: t }) {
2602
2460
  }
2603
2461
  ) });
2604
2462
  }
2463
+ function Yt({ message: e, className: t }) {
2464
+ const r = e.attachments || [], n = r.filter((c) => c.type === "image" && c.url), o = r.filter((c) => !(c.type === "image" && c.url));
2465
+ return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2466
+ n.map((c) => /* @__PURE__ */ l.jsx(
2467
+ "img",
2468
+ {
2469
+ src: c.url,
2470
+ alt: c.name || "Generated image",
2471
+ loading: "lazy",
2472
+ decoding: "async",
2473
+ style: {
2474
+ maxWidth: "100%",
2475
+ height: "auto",
2476
+ borderRadius: 8,
2477
+ marginBottom: 10,
2478
+ display: "block"
2479
+ }
2480
+ },
2481
+ c.id
2482
+ )),
2483
+ o.length > 0 && /* @__PURE__ */ l.jsx(ke, { attachments: o, readOnly: !0 }),
2484
+ /* @__PURE__ */ l.jsx(Ps, { content: e.content, className: t })
2485
+ ] });
2486
+ }
2487
+ const Tn = [
2488
+ "application/pdf",
2489
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
2490
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
2491
+ "application/vnd.ms-excel",
2492
+ "text/csv",
2493
+ "text/plain",
2494
+ "text/markdown",
2495
+ "application/json",
2496
+ "image/png",
2497
+ "image/jpeg",
2498
+ "image/webp",
2499
+ "image/gif"
2500
+ ], zs = {
2501
+ ".pdf": "application/pdf",
2502
+ ".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
2503
+ ".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
2504
+ ".xls": "application/vnd.ms-excel",
2505
+ ".csv": "text/csv",
2506
+ ".txt": "text/plain",
2507
+ ".md": "text/markdown",
2508
+ ".json": "application/json",
2509
+ ".png": "image/png",
2510
+ ".jpg": "image/jpeg",
2511
+ ".jpeg": "image/jpeg",
2512
+ ".webp": "image/webp",
2513
+ ".gif": "image/gif"
2514
+ };
2515
+ function Ds(e) {
2516
+ const t = e.lastIndexOf(".");
2517
+ if (!(t < 0))
2518
+ return zs[e.slice(t).toLowerCase()];
2519
+ }
2520
+ async function Qt(e) {
2521
+ var r;
2522
+ if (!e) return [];
2523
+ const t = [];
2524
+ if ((r = e.files) != null && r.length)
2525
+ for (let n = 0; n < e.files.length; n++)
2526
+ t.push(e.files[n]);
2527
+ return t;
2528
+ }
2529
+ function En(e, t, r) {
2530
+ if (e.size > t)
2531
+ return `File too large (max ${Math.floor(t / (1024 * 1024))}MB)`;
2532
+ if (r.includes(e.type)) return null;
2533
+ const n = Ds(e.name);
2534
+ return n && r.includes(n) ? null : "File type not allowed for attachments";
2535
+ }
2536
+ const Os = T.button`
2537
+ display: flex;
2538
+ align-items: center;
2539
+ justify-content: center;
2540
+ width: 36px;
2541
+ height: 36px;
2542
+ min-width: 36px;
2543
+ min-height: 36px;
2544
+ border-radius: 8px;
2545
+ border: 1px solid #d1d5db;
2546
+ background: #f9fafb;
2547
+ color: #374151;
2548
+ cursor: pointer;
2549
+ flex-shrink: 0;
2550
+ transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
2551
+
2552
+ &:hover:not(:disabled) {
2553
+ background: #f3f4f6;
2554
+ border-color: #9ca3af;
2555
+ }
2556
+
2557
+ &:disabled {
2558
+ opacity: 0.45;
2559
+ cursor: not-allowed;
2560
+ }
2561
+
2562
+ [data-theme='dark'] & {
2563
+ background: #374151;
2564
+ border-color: #4b5563;
2565
+ color: #e5e7eb;
2566
+ }
2567
+ `, Ns = T.button`
2568
+ display: flex;
2569
+ align-items: center;
2570
+ justify-content: center;
2571
+ width: 28px;
2572
+ height: 28px;
2573
+ min-width: 28px;
2574
+ min-height: 28px;
2575
+ border: none;
2576
+ border-radius: 8px;
2577
+ background: transparent;
2578
+ color: #64748b;
2579
+ cursor: pointer;
2580
+ flex-shrink: 0;
2581
+ transition: background 0.2s ease, color 0.2s ease;
2582
+
2583
+ &:hover:not(:disabled) {
2584
+ background: rgba(15, 23, 42, 0.06);
2585
+ color: #334155;
2586
+ }
2587
+
2588
+ &:disabled {
2589
+ opacity: 0.45;
2590
+ cursor: not-allowed;
2591
+ }
2592
+
2593
+ @media (prefers-color-scheme: dark) {
2594
+ color: #94a3b8;
2595
+
2596
+ &:hover:not(:disabled) {
2597
+ background: rgba(255, 255, 255, 0.08);
2598
+ color: #e2e8f0;
2599
+ }
2600
+ }
2601
+
2602
+ [data-theme='dark'] & {
2603
+ color: #94a3b8;
2604
+
2605
+ &:hover:not(:disabled) {
2606
+ background: rgba(255, 255, 255, 0.08);
2607
+ color: #e2e8f0;
2608
+ }
2609
+ }
2610
+ `;
2611
+ function Vt({
2612
+ disabled: e,
2613
+ integrated: t = !1,
2614
+ maxFileBytes: r,
2615
+ maxFiles: n,
2616
+ allowedMime: o = Tn,
2617
+ currentCount: c,
2618
+ uploadAttachment: u,
2619
+ onUploaded: d,
2620
+ onError: h
2621
+ }) {
2622
+ const b = F.useRef(null), [g, p] = F.useState(!1), w = F.useMemo(
2623
+ () => [
2624
+ ".pdf,.docx,.xlsx,.xls,.csv,.txt,.md,.json",
2625
+ "image/png,image/jpeg,image/webp,image/gif"
2626
+ ].join(","),
2627
+ []
2628
+ ), k = F.useCallback(
2629
+ async (i) => {
2630
+ const s = Array.from(i);
2631
+ if (!s.length) return;
2632
+ let f = 0;
2633
+ for (const m of s) {
2634
+ if (c + f >= n) {
2635
+ h == null || h(`You can attach at most ${n} files per message.`);
2636
+ break;
2637
+ }
2638
+ const x = En(m, r, o);
2639
+ if (x) {
2640
+ h == null || h(`${m.name}: ${x}`);
2641
+ continue;
2642
+ }
2643
+ try {
2644
+ p(!0);
2645
+ const y = await u(m);
2646
+ d(y), f += 1;
2647
+ } catch (y) {
2648
+ const A = y instanceof Error ? y.message : "Upload failed";
2649
+ h == null || h(A);
2650
+ } finally {
2651
+ p(!1);
2652
+ }
2653
+ }
2654
+ },
2655
+ [o, c, r, n, h, d, u]
2656
+ ), S = (i) => {
2657
+ const s = i.target.files;
2658
+ s != null && s.length && k(s), i.target.value = "";
2659
+ }, C = c >= n, v = !!(e || g || C), a = t ? Ns : Os;
2660
+ return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2661
+ /* @__PURE__ */ l.jsx(
2662
+ "input",
2663
+ {
2664
+ ref: b,
2665
+ type: "file",
2666
+ multiple: !0,
2667
+ accept: w,
2668
+ style: { display: "none" },
2669
+ onChange: S
2670
+ }
2671
+ ),
2672
+ /* @__PURE__ */ l.jsx(
2673
+ a,
2674
+ {
2675
+ type: "button",
2676
+ disabled: v,
2677
+ "aria-label": "Attach file",
2678
+ title: "Attach file",
2679
+ onClick: () => {
2680
+ var i;
2681
+ return (i = b.current) == null ? void 0 : i.click();
2682
+ },
2683
+ children: /* @__PURE__ */ l.jsx(ho, { size: 16, strokeWidth: 2 })
2684
+ }
2685
+ )
2686
+ ] });
2687
+ }
2605
2688
  const _n = T.div`
2606
2689
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
2607
2690
  background-color: white;
2608
2691
  border: 1px solid #e5e7eb;
2609
2692
  min-height: 0;
2610
2693
 
2611
- /* Scoped CSS reset to prevent host page style leakage */
2694
+ /* Scoped CSS reset to prevent host page style leakage.
2695
+ * Do not include textarea in this selector: it zeroed padding and beat our
2696
+ * composer/welcome textarea styles in embedded mode (ChatWidget), while floating
2697
+ * (ChatWindow) looked fine. Textareas are styled via ComposerInnerInput / ProfessionalInput. */
2612
2698
  & button,
2613
2699
  & input,
2614
- & textarea,
2615
2700
  & select {
2616
2701
  margin: 0;
2617
2702
  padding: 0;
@@ -2639,6 +2724,13 @@ const _n = T.div`
2639
2724
  background-color: #1f2937;
2640
2725
  border-color: #374151;
2641
2726
  }
2727
+
2728
+ /* Prefer explicit embed theme over OS dark mode so inline/embedded stays readable on colored pages */
2729
+ &[data-theme="light"] {
2730
+ background-color: #ffffff;
2731
+ border-color: #e5e7eb;
2732
+ color: #111827;
2733
+ }
2642
2734
  `, he = T.div`
2643
2735
  max-width: 80%;
2644
2736
  padding: 12px;
@@ -2680,6 +2772,16 @@ const _n = T.div`
2680
2772
  font-weight: 700;
2681
2773
  }
2682
2774
  }
2775
+
2776
+ [data-theme="light"] & {
2777
+ background-color: ${(e) => e.$isUser ? "#3b82f6" : "#f3f4f6"};
2778
+ color: ${(e) => e.$isUser ? "#ffffff" : "#111827"};
2779
+
2780
+ strong, b {
2781
+ font-weight: 600;
2782
+ color: inherit;
2783
+ }
2784
+ }
2683
2785
  `, Zt = T.div`
2684
2786
  display: flex;
2685
2787
  flex-direction: column;
@@ -2717,9 +2819,9 @@ const _n = T.div`
2717
2819
  display: flex;
2718
2820
  align-items: center;
2719
2821
  justify-content: space-between;
2720
- gap: 6px;
2822
+ gap: 8px;
2721
2823
  flex-shrink: 0;
2722
- padding: 6px 10px;
2824
+ padding: 8px 16px 10px;
2723
2825
  border-top: 1px solid #e5e7eb;
2724
2826
  background-color: #f9fafb;
2725
2827
 
@@ -2732,13 +2834,14 @@ const _n = T.div`
2732
2834
  border-top-color: #52525b;
2733
2835
  background-color: #3f3f46;
2734
2836
  }
2735
- `, Ns = T.textarea`
2837
+ `, Bs = T.textarea`
2736
2838
  display: block;
2737
2839
  width: 100%;
2738
2840
  min-width: 0;
2841
+ margin: 0;
2739
2842
  min-height: 42px;
2740
2843
  max-height: 96px;
2741
- padding: 8px 12px;
2844
+ padding: 12px 18px;
2742
2845
  border: none;
2743
2846
  border-radius: 0;
2744
2847
  background-color: transparent;
@@ -2780,7 +2883,7 @@ const _n = T.div`
2780
2883
  display: flex;
2781
2884
  align-items: center;
2782
2885
  gap: 8px;
2783
- padding: 8px 12px 10px;
2886
+ padding: 10px 16px 12px;
2784
2887
  border-top: 1px solid #e5e7eb;
2785
2888
  background-color: #ffffff;
2786
2889
 
@@ -2793,9 +2896,10 @@ const _n = T.div`
2793
2896
  background-color: #1f2937;
2794
2897
  border-top-color: #374151;
2795
2898
  }
2796
- `, Bs = T.textarea`
2899
+ `, Ls = T.textarea`
2797
2900
  flex: 1;
2798
2901
  width: 100%;
2902
+ margin: 0;
2799
2903
  min-height: 40px;
2800
2904
  max-height: 120px;
2801
2905
  padding: 8px 12px;
@@ -2852,7 +2956,7 @@ const _n = T.div`
2852
2956
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
2853
2957
  }
2854
2958
  }
2855
- `, Ls = T.button`
2959
+ `, Fs = T.button`
2856
2960
  width: 32px;
2857
2961
  height: 32px;
2858
2962
  min-width: 32px;
@@ -3024,11 +3128,11 @@ const _n = T.div`
3024
3128
  if (e && e.startsWith("#")) {
3025
3129
  const r = e.replace("#", ""), n = parseInt(r, 16);
3026
3130
  if (isNaN(n)) return e;
3027
- 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));
3028
- 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")}`;
3131
+ const o = 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));
3132
+ return `#${Math.floor(o).toString(16).padStart(2, "0")}${Math.floor(c).toString(16).padStart(2, "0")}${Math.floor(u).toString(16).padStart(2, "0")}`;
3029
3133
  }
3030
3134
  return e || "#2563eb";
3031
- }, Fs = T.button`
3135
+ }, Ws = T.button`
3032
3136
  position: fixed;
3033
3137
  z-index: 50;
3034
3138
  height: 48px;
@@ -3122,6 +3226,12 @@ const _n = T.div`
3122
3226
  background: #1f2937;
3123
3227
  border-color: #374151;
3124
3228
  }
3229
+
3230
+ &[data-theme="light"] {
3231
+ background: #ffffff;
3232
+ border-color: #e5e7eb;
3233
+ color: #111827;
3234
+ }
3125
3235
 
3126
3236
  @media (min-width: 640px) {
3127
3237
  width: 384px;
@@ -3283,7 +3393,7 @@ const rr = T.div`
3283
3393
  @media (prefers-color-scheme: dark) {
3284
3394
  color: #f87171;
3285
3395
  }
3286
- `, Ws = T.div`
3396
+ `, Us = T.div`
3287
3397
  position: absolute;
3288
3398
  ${(e) => e.$position === "top" ? "top: 0;" : "bottom: 0;"}
3289
3399
  left: 0;
@@ -3307,7 +3417,7 @@ const rr = T.div`
3307
3417
  background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 50%, #3b82f6 100%);
3308
3418
  }
3309
3419
  }
3310
- `, ke = T.img`
3420
+ `, we = T.img`
3311
3421
  width: ${(e) => e.$size || "32px"};
3312
3422
  height: ${(e) => e.$size || "32px"};
3313
3423
  border-radius: 50%;
@@ -3315,7 +3425,7 @@ const rr = T.div`
3315
3425
  flex-shrink: 0;
3316
3426
  border: 2px solid rgba(255, 255, 255, 0.2);
3317
3427
  background-color: rgba(255, 255, 255, 0.1);
3318
- `, Us = T.div`
3428
+ `, Hs = T.div`
3319
3429
  display: flex;
3320
3430
  flex-direction: column;
3321
3431
  align-items: center;
@@ -3328,16 +3438,20 @@ const rr = T.div`
3328
3438
  position: relative;
3329
3439
 
3330
3440
  /* Gradient background - starts with full primary color at top, fades to background color */
3331
- 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"};
3441
+ 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%)` : "#ffffff"};
3332
3442
 
3333
3443
  @media (prefers-color-scheme: dark) {
3334
- 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"};
3444
+ 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%)` : "#1f2937"};
3335
3445
  }
3336
3446
 
3337
3447
  [data-theme="dark"] & {
3338
- 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"};
3448
+ 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%)` : "#1f2937"};
3339
3449
  }
3340
- `, Hs = T.div`
3450
+
3451
+ [data-theme="light"] & {
3452
+ 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%)` : "#ffffff"};
3453
+ }
3454
+ `, qs = T.div`
3341
3455
  font-size: 18px;
3342
3456
  font-weight: 600;
3343
3457
  text-align: center;
@@ -3351,7 +3465,11 @@ const rr = T.div`
3351
3465
  [data-theme="dark"] & {
3352
3466
  color: #f9fafb;
3353
3467
  }
3354
- `, qs = T.img`
3468
+
3469
+ [data-theme="light"] & {
3470
+ color: #111827;
3471
+ }
3472
+ `, Gs = T.img`
3355
3473
  max-width: 120px;
3356
3474
  max-height: 120px;
3357
3475
  width: auto;
@@ -3359,14 +3477,14 @@ const rr = T.div`
3359
3477
  object-fit: contain;
3360
3478
  margin-bottom: 8px;
3361
3479
  border-radius: 8px;
3362
- `, Gs = T.div`
3480
+ `, Ys = T.div`
3363
3481
  display: flex;
3364
3482
  flex-direction: column;
3365
3483
  gap: 12px;
3366
3484
  width: 100%;
3367
3485
  max-width: 100%;
3368
3486
  margin-bottom: 16px;
3369
- `, Ys = T.button`
3487
+ `, Qs = T.button`
3370
3488
  width: 100%;
3371
3489
  padding: 12px 16px;
3372
3490
  box-sizing: border-box;
@@ -3418,7 +3536,7 @@ const rr = T.div`
3418
3536
  border-color: ${(e) => e.$primaryColor || "#6b7280"};
3419
3537
  }
3420
3538
  }
3421
- `, Qs = T.div`
3539
+ `, Vs = T.div`
3422
3540
  display: flex;
3423
3541
  align-items: center;
3424
3542
  gap: 8px;
@@ -3434,11 +3552,11 @@ const rr = T.div`
3434
3552
  [data-theme="dark"] & {
3435
3553
  border-top-color: #374151;
3436
3554
  }
3437
- `, ht = L.forwardRef(function({
3555
+ `, ht = F.forwardRef(function({
3438
3556
  value: t,
3439
3557
  onChange: r,
3440
3558
  onKeyDown: n,
3441
- placeholder: a = "Type a message...",
3559
+ placeholder: o = "Type a message...",
3442
3560
  disabled: c = !1,
3443
3561
  className: u,
3444
3562
  maxLength: d = 2e3,
@@ -3448,7 +3566,7 @@ const rr = T.div`
3448
3566
  r(k.target.value);
3449
3567
  }, p = (k) => {
3450
3568
  k.key === "Enter" && !k.shiftKey && k.preventDefault(), n(k);
3451
- }, w = h === "composer" ? Ns : Bs;
3569
+ }, w = h === "composer" ? Bs : Ls;
3452
3570
  return /* @__PURE__ */ l.jsx(
3453
3571
  w,
3454
3572
  {
@@ -3456,7 +3574,7 @@ const rr = T.div`
3456
3574
  value: t,
3457
3575
  onChange: g,
3458
3576
  onKeyDown: p,
3459
- placeholder: a,
3577
+ placeholder: o,
3460
3578
  disabled: c,
3461
3579
  maxLength: d,
3462
3580
  className: u,
@@ -3490,22 +3608,22 @@ function mt({ size: e = 16 }) {
3490
3608
  );
3491
3609
  }
3492
3610
  function nr({ config: e, onQuestionClick: t, onSendMessage: r, isLoading: n }) {
3493
- const [a, c] = L.useState(""), u = L.useRef(null), d = async () => {
3494
- !a.trim() || n || (await r(a.trim()), c(""));
3611
+ const [o, c] = F.useState(""), u = F.useRef(null), d = async () => {
3612
+ !o.trim() || n || (await r(o.trim()), c(""));
3495
3613
  }, h = (g) => {
3496
3614
  g.key === "Enter" && !g.shiftKey && (g.preventDefault(), d());
3497
3615
  }, b = e.welcomeMessage || "Hi there 👋 How can we help?";
3498
- return /* @__PURE__ */ l.jsxs(Us, { $primaryColor: e.primaryColor, children: [
3616
+ return /* @__PURE__ */ l.jsxs(Hs, { $primaryColor: e.primaryColor, children: [
3499
3617
  e.welcomeImage && /* @__PURE__ */ l.jsx(
3500
- qs,
3618
+ Gs,
3501
3619
  {
3502
3620
  src: e.welcomeImage,
3503
3621
  alt: "Welcome"
3504
3622
  }
3505
3623
  ),
3506
- /* @__PURE__ */ l.jsx(Hs, { children: b }),
3507
- e.quickQuestions && e.quickQuestions.length > 0 && /* @__PURE__ */ l.jsx(Gs, { children: e.quickQuestions.map((g, p) => /* @__PURE__ */ l.jsx(
3508
- Ys,
3624
+ /* @__PURE__ */ l.jsx(qs, { children: b }),
3625
+ e.quickQuestions && e.quickQuestions.length > 0 && /* @__PURE__ */ l.jsx(Ys, { children: e.quickQuestions.map((g, p) => /* @__PURE__ */ l.jsx(
3626
+ Qs,
3509
3627
  {
3510
3628
  onClick: () => t(g),
3511
3629
  disabled: n,
@@ -3514,12 +3632,12 @@ function nr({ config: e, onQuestionClick: t, onSendMessage: r, isLoading: n }) {
3514
3632
  },
3515
3633
  p
3516
3634
  )) }),
3517
- /* @__PURE__ */ l.jsxs(Qs, { children: [
3635
+ /* @__PURE__ */ l.jsxs(Vs, { children: [
3518
3636
  /* @__PURE__ */ l.jsx(
3519
3637
  ht,
3520
3638
  {
3521
3639
  ref: u,
3522
- value: a,
3640
+ value: o,
3523
3641
  onChange: c,
3524
3642
  onKeyDown: h,
3525
3643
  placeholder: e.placeholder || "Type a message...",
@@ -3527,10 +3645,10 @@ function nr({ config: e, onQuestionClick: t, onSendMessage: r, isLoading: n }) {
3527
3645
  }
3528
3646
  ),
3529
3647
  /* @__PURE__ */ l.jsx(
3530
- Ls,
3648
+ Fs,
3531
3649
  {
3532
3650
  onClick: d,
3533
- disabled: n || !a.trim(),
3651
+ disabled: n || !o.trim(),
3534
3652
  children: /* @__PURE__ */ l.jsx(mt, { size: 16 })
3535
3653
  }
3536
3654
  )
@@ -3539,26 +3657,26 @@ function nr({ config: e, onQuestionClick: t, onSendMessage: r, isLoading: n }) {
3539
3657
  }
3540
3658
  function or(e, t) {
3541
3659
  var C;
3542
- const r = (e.maxAttachmentSizeMB ?? 10) * 1024 * 1024, n = e.maxAttachments ?? 3, a = (C = e.allowedAttachmentTypes) != null && C.length ? e.allowedAttachmentTypes : wn, c = !!(e.enableAttachments && e.publishableKey), [u, d] = ee([]), [h, b] = ee(null), g = ae([]);
3543
- ze(() => {
3660
+ const r = (e.maxAttachmentSizeMB ?? 10) * 1024 * 1024, n = e.maxAttachments ?? 3, o = (C = e.allowedAttachmentTypes) != null && C.length ? e.allowedAttachmentTypes : Tn, c = !!(e.enableAttachments && e.publishableKey), [u, d] = ee([]), [h, b] = ee(null), g = ae([]);
3661
+ De(() => {
3544
3662
  g.current = u;
3545
3663
  }, [u]);
3546
3664
  const p = Z(
3547
3665
  async (v) => {
3548
3666
  if (c) {
3549
3667
  b(null);
3550
- for (const o of v) {
3668
+ for (const a of v) {
3551
3669
  if (g.current.length >= n) {
3552
3670
  b(`At most ${n} attachments per message.`);
3553
3671
  break;
3554
3672
  }
3555
- const i = vn(o, r, a);
3673
+ const i = En(a, r, o);
3556
3674
  if (i) {
3557
- b(`${o.name}: ${i}`);
3675
+ b(`${a.name}: ${i}`);
3558
3676
  continue;
3559
3677
  }
3560
3678
  try {
3561
- const s = await t(o);
3679
+ const s = await t(a);
3562
3680
  d((f) => {
3563
3681
  if (f.length >= n) return f;
3564
3682
  const m = [...f, s];
@@ -3570,19 +3688,19 @@ function or(e, t) {
3570
3688
  }
3571
3689
  }
3572
3690
  },
3573
- [a, c, r, n, t]
3691
+ [o, c, r, n, t]
3574
3692
  ), w = Z((v) => {
3575
- d((o) => {
3576
- const i = o.filter((s) => s.id !== v);
3693
+ d((a) => {
3694
+ const i = a.filter((s) => s.id !== v);
3577
3695
  return g.current = i, i;
3578
3696
  });
3579
3697
  }, []), k = Z(() => {
3580
3698
  d([]), g.current = [], b(null);
3581
3699
  }, []), S = Z(
3582
3700
  (v) => {
3583
- b(null), d((o) => {
3584
- if (o.length >= n) return o;
3585
- const i = [...o, v];
3701
+ b(null), d((a) => {
3702
+ if (a.length >= n) return a;
3703
+ const i = [...a, v];
3586
3704
  return g.current = i, i;
3587
3705
  });
3588
3706
  },
@@ -3599,7 +3717,7 @@ function or(e, t) {
3599
3717
  clearStaged: k,
3600
3718
  maxFiles: n,
3601
3719
  maxBytes: r,
3602
- allowed: a
3720
+ allowed: o
3603
3721
  };
3604
3722
  }
3605
3723
  function Mn(e, t, r) {
@@ -3607,7 +3725,7 @@ function Mn(e, t, r) {
3607
3725
  const n = t[t.length - 1];
3608
3726
  return n ? !(r && n.role === "assistant" && n.id === e.id) : !0;
3609
3727
  }
3610
- function Vs({ size: e = 16 }) {
3728
+ function Zs({ size: e = 16 }) {
3611
3729
  return /* @__PURE__ */ l.jsx(
3612
3730
  "svg",
3613
3731
  {
@@ -3624,7 +3742,7 @@ function Vs({ size: e = 16 }) {
3624
3742
  }
3625
3743
  );
3626
3744
  }
3627
- function Zs({ size: e = 16 }) {
3745
+ function Js({ size: e = 16 }) {
3628
3746
  return /* @__PURE__ */ l.jsxs(
3629
3747
  "svg",
3630
3748
  {
@@ -3648,7 +3766,7 @@ function Zs({ size: e = 16 }) {
3648
3766
  * Copyright (c) StackBlitz. All rights reserved.
3649
3767
  * Licensed under the MIT License. See License.txt in the project root for license information.
3650
3768
  *--------------------------------------------------------------------------------------------*/
3651
- const Js = {
3769
+ const Xs = {
3652
3770
  /**
3653
3771
  * A value from 0 to 1, on how much to damp the animation.
3654
3772
  * 0 means no damping, 1 means full damping.
@@ -3669,22 +3787,22 @@ const Js = {
3669
3787
  * @default 1.25
3670
3788
  */
3671
3789
  mass: 1.25
3672
- }, Xs = 70, ei = 1e3 / 60, ti = 350;
3790
+ }, ei = 70, ti = 1e3 / 60, ri = 350;
3673
3791
  let gt = !1;
3674
3792
  var Fr;
3675
3793
  (Fr = globalThis.document) == null || Fr.addEventListener("mousedown", () => {
3676
3794
  gt = !0;
3677
3795
  });
3678
- var Kr;
3679
- (Kr = globalThis.document) == null || Kr.addEventListener("mouseup", () => {
3796
+ var Wr;
3797
+ (Wr = globalThis.document) == null || Wr.addEventListener("mouseup", () => {
3680
3798
  gt = !1;
3681
3799
  });
3682
- var Wr;
3683
- (Wr = globalThis.document) == null || Wr.addEventListener("click", () => {
3800
+ var Kr;
3801
+ (Kr = globalThis.document) == null || Kr.addEventListener("click", () => {
3684
3802
  gt = !1;
3685
3803
  });
3686
- const ri = (e = {}) => {
3687
- const [t, r] = ee(!1), [n, a] = ee(e.initial !== !1), [c, u] = ee(!1), d = ae(null);
3804
+ const ni = (e = {}) => {
3805
+ const [t, r] = ee(!1), [n, o] = ee(e.initial !== !1), [c, u] = ee(!1), d = ae(null);
3688
3806
  d.current = e;
3689
3807
  const h = Z(() => {
3690
3808
  var f;
@@ -3696,7 +3814,7 @@ const ri = (e = {}) => {
3696
3814
  const s = i.getRangeAt(0);
3697
3815
  return s.commonAncestorContainer.contains(v.current) || ((f = v.current) == null ? void 0 : f.contains(s.commonAncestorContainer));
3698
3816
  }, []), b = Z((i) => {
3699
- p.isAtBottom = i, a(i);
3817
+ p.isAtBottom = i, o(i);
3700
3818
  }, []), g = Z((i) => {
3701
3819
  p.escapedFromLock = i, r(i);
3702
3820
  }, []), p = Lt(() => {
@@ -3716,10 +3834,10 @@ const ri = (e = {}) => {
3716
3834
  v.current && (v.current.scrollTop = s, p.ignoreScrollToTop = v.current.scrollTop);
3717
3835
  },
3718
3836
  get targetScrollTop() {
3719
- return !v.current || !o.current ? 0 : v.current.scrollHeight - 1 - v.current.clientHeight;
3837
+ return !v.current || !a.current ? 0 : v.current.scrollHeight - 1 - v.current.clientHeight;
3720
3838
  },
3721
3839
  get calculatedTargetScrollTop() {
3722
- if (!v.current || !o.current)
3840
+ if (!v.current || !a.current)
3723
3841
  return 0;
3724
3842
  const { targetScrollTop: s } = this;
3725
3843
  if (!e.targetScrollTop)
@@ -3728,7 +3846,7 @@ const ri = (e = {}) => {
3728
3846
  return i.calculatedScrollTop;
3729
3847
  const f = Math.max(Math.min(e.targetScrollTop(s, {
3730
3848
  scrollElement: v.current,
3731
- contentElement: o.current
3849
+ contentElement: a.current
3732
3850
  }), s), 0);
3733
3851
  return i = { targetScrollTop: s, calculatedScrollTop: f }, requestAnimationFrame(() => {
3734
3852
  i = void 0;
@@ -3738,11 +3856,11 @@ const ri = (e = {}) => {
3738
3856
  return this.calculatedTargetScrollTop - this.scrollTop;
3739
3857
  },
3740
3858
  get isNearBottom() {
3741
- return this.scrollDifference <= Xs;
3859
+ return this.scrollDifference <= ei;
3742
3860
  }
3743
3861
  };
3744
3862
  }, []), w = Z((i = {}) => {
3745
- var M;
3863
+ var _;
3746
3864
  typeof i == "string" && (i = { animation: i }), i.preserveScrollPosition || b(!0);
3747
3865
  const s = Date.now() + (Number(i.wait) || 0), f = _t(d.current, i.animation), { ignoreEscapes: m = !1 } = i;
3748
3866
  let x, y = p.calculatedTargetScrollTop;
@@ -3754,14 +3872,14 @@ const ri = (e = {}) => {
3754
3872
  var V;
3755
3873
  if (!p.isAtBottom)
3756
3874
  return p.animation = void 0, !1;
3757
- const { scrollTop: E } = p, W = performance.now(), F = (W - (p.lastTick ?? W)) / ei;
3758
- if (p.animation || (p.animation = { behavior: f, promise: j, ignoreEscapes: m }), p.animation.behavior === f && (p.lastTick = W), h() || s > Date.now())
3875
+ const { scrollTop: E } = p, K = performance.now(), L = (K - (p.lastTick ?? K)) / ti;
3876
+ if (p.animation || (p.animation = { behavior: f, promise: j, ignoreEscapes: m }), p.animation.behavior === f && (p.lastTick = K), h() || s > Date.now())
3759
3877
  return A();
3760
3878
  if (E < Math.min(y, p.calculatedTargetScrollTop)) {
3761
3879
  if (((V = p.animation) == null ? void 0 : V.behavior) === f) {
3762
3880
  if (f === "instant")
3763
3881
  return p.scrollTop = p.calculatedTargetScrollTop, A();
3764
- p.velocity = (f.damping * p.velocity + f.stiffness * p.scrollDifference) / f.mass, p.accumulated += p.velocity * F, p.scrollTop += p.accumulated, p.scrollTop !== E && (p.accumulated = 0);
3882
+ p.velocity = (f.damping * p.velocity + f.stiffness * p.scrollDifference) / f.mass, p.accumulated += p.velocity * L, p.scrollTop += p.accumulated, p.scrollTop !== E && (p.accumulated = 0);
3765
3883
  }
3766
3884
  return A();
3767
3885
  }
@@ -3775,7 +3893,7 @@ const ri = (e = {}) => {
3775
3893
  p.animation || (p.lastTick = void 0, p.velocity = 0);
3776
3894
  }), E));
3777
3895
  };
3778
- return i.wait !== !0 && (p.animation = void 0), ((M = p.animation) == null ? void 0 : M.behavior) === f ? p.animation.promise : A();
3896
+ return i.wait !== !0 && (p.animation = void 0), ((_ = p.animation) == null ? void 0 : _.behavior) === f ? p.animation.promise : A();
3779
3897
  }, [b, h, p]), k = Z(() => {
3780
3898
  g(!0), b(!1);
3781
3899
  }, [g, b]), S = Z(({ target: i }) => {
@@ -3810,7 +3928,7 @@ const ri = (e = {}) => {
3810
3928
  }, [g, b, p]), v = Br((i) => {
3811
3929
  var s, f;
3812
3930
  (s = v.current) == null || s.removeEventListener("scroll", S), (f = v.current) == null || f.removeEventListener("wheel", C), i == null || i.addEventListener("scroll", S, { passive: !0 }), i == null || i.addEventListener("wheel", C, { passive: !0 });
3813
- }, []), o = Br((i) => {
3931
+ }, []), a = Br((i) => {
3814
3932
  var f, m;
3815
3933
  if ((f = p.resizeObserver) == null || f.disconnect(), !i)
3816
3934
  return;
@@ -3818,12 +3936,12 @@ const ri = (e = {}) => {
3818
3936
  p.resizeObserver = new ResizeObserver(([x]) => {
3819
3937
  const { height: y } = x.contentRect, A = y - (s ?? y);
3820
3938
  if (p.resizeDifference = A, p.scrollTop > p.targetScrollTop && (p.scrollTop = p.targetScrollTop), u(p.isNearBottom), A >= 0) {
3821
- const M = _t(d.current, s ? d.current.resize : d.current.initial);
3939
+ const _ = _t(d.current, s ? d.current.resize : d.current.initial);
3822
3940
  w({
3823
- animation: M,
3941
+ animation: _,
3824
3942
  wait: !0,
3825
3943
  preserveScrollPosition: !0,
3826
- duration: M === "instant" ? void 0 : ti
3944
+ duration: _ === "instant" ? void 0 : ri
3827
3945
  });
3828
3946
  } else
3829
3947
  p.isNearBottom && (g(!1), b(!0));
@@ -3835,7 +3953,7 @@ const ri = (e = {}) => {
3835
3953
  }), (m = p.resizeObserver) == null || m.observe(i);
3836
3954
  }, []);
3837
3955
  return {
3838
- contentRef: o,
3956
+ contentRef: a,
3839
3957
  scrollRef: v,
3840
3958
  scrollToBottom: w,
3841
3959
  stopScroll: k,
@@ -3851,35 +3969,35 @@ function Br(e, t) {
3851
3969
  }
3852
3970
  const Et = /* @__PURE__ */ new Map();
3853
3971
  function _t(...e) {
3854
- const t = { ...Js };
3972
+ const t = { ...Xs };
3855
3973
  let r = !1;
3856
- for (const a of e) {
3857
- if (a === "instant") {
3974
+ for (const o of e) {
3975
+ if (o === "instant") {
3858
3976
  r = !0;
3859
3977
  continue;
3860
3978
  }
3861
- typeof a == "object" && (r = !1, t.damping = a.damping ?? t.damping, t.stiffness = a.stiffness ?? t.stiffness, t.mass = a.mass ?? t.mass);
3979
+ typeof o == "object" && (r = !1, t.damping = o.damping ?? t.damping, t.stiffness = o.stiffness ?? t.stiffness, t.mass = o.mass ?? t.mass);
3862
3980
  }
3863
3981
  const n = JSON.stringify(t);
3864
3982
  return Et.has(n) || Et.set(n, Object.freeze(t)), r ? "instant" : Et.get(n);
3865
3983
  }
3866
- const Rn = Nn(null), ni = typeof window < "u" ? On : ze;
3867
- function ot({ instance: e, children: t, resize: r, initial: n, mass: a, damping: c, stiffness: u, targetScrollTop: d, contextRef: h, ...b }) {
3984
+ const Rn = Nn(null), oi = typeof window < "u" ? On : De;
3985
+ function ot({ instance: e, children: t, resize: r, initial: n, mass: o, damping: c, stiffness: u, targetScrollTop: d, contextRef: h, ...b }) {
3868
3986
  const g = ae(null), p = Bt.useCallback((m, x) => {
3869
3987
  const y = (f == null ? void 0 : f.targetScrollTop) ?? d;
3870
3988
  return (y == null ? void 0 : y(m, x)) ?? m;
3871
- }, [d]), w = ri({
3872
- mass: a,
3989
+ }, [d]), w = ni({
3990
+ mass: o,
3873
3991
  damping: c,
3874
3992
  stiffness: u,
3875
3993
  resize: r,
3876
3994
  initial: n,
3877
3995
  targetScrollTop: p
3878
- }), { scrollRef: k, contentRef: S, scrollToBottom: C, stopScroll: v, isAtBottom: o, escapedFromLock: i, state: s } = e ?? w, f = Lt(() => ({
3996
+ }), { scrollRef: k, contentRef: S, scrollToBottom: C, stopScroll: v, isAtBottom: a, escapedFromLock: i, state: s } = e ?? w, f = Lt(() => ({
3879
3997
  scrollToBottom: C,
3880
3998
  stopScroll: v,
3881
3999
  scrollRef: k,
3882
- isAtBottom: o,
4000
+ isAtBottom: a,
3883
4001
  escapedFromLock: i,
3884
4002
  contentRef: S,
3885
4003
  state: s,
@@ -3891,40 +4009,41 @@ function ot({ instance: e, children: t, resize: r, initial: n, mass: a, damping:
3891
4009
  }
3892
4010
  }), [
3893
4011
  C,
3894
- o,
4012
+ a,
3895
4013
  S,
3896
4014
  k,
3897
4015
  v,
3898
4016
  i,
3899
4017
  s
3900
4018
  ]);
3901
- return zn(h, () => f, [f]), ni(() => {
4019
+ return Dn(h, () => f, [f]), oi(() => {
3902
4020
  k.current && getComputedStyle(k.current).overflow === "visible" && (k.current.style.overflow = "auto");
3903
4021
  }, []), l.jsx(Rn.Provider, { value: f, children: l.jsx("div", { ...b, children: typeof t == "function" ? t(f) : t }) });
3904
4022
  }
3905
4023
  (function(e) {
3906
4024
  function t({ children: r, ...n }) {
3907
- const a = oi();
3908
- return l.jsx("div", { ref: a.scrollRef, style: {
4025
+ const o = ai();
4026
+ return l.jsx("div", { ref: o.scrollRef, style: {
3909
4027
  height: "100%",
3910
4028
  width: "100%"
3911
- }, children: l.jsx("div", { ...n, ref: a.contentRef, children: typeof r == "function" ? r(a) : r }) });
4029
+ }, children: l.jsx("div", { ...n, ref: o.contentRef, children: typeof r == "function" ? r(o) : r }) });
3912
4030
  }
3913
4031
  e.Content = t;
3914
4032
  })(ot || (ot = {}));
3915
- function oi() {
4033
+ function ai() {
3916
4034
  const e = Hr(Rn);
3917
4035
  if (!e)
3918
4036
  throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");
3919
4037
  return e;
3920
4038
  }
3921
- const ai = T(ot)`
4039
+ const si = T(ot)`
3922
4040
  position: relative;
3923
4041
  flex: 1;
3924
4042
  overflow-y: auto;
3925
4043
  scroll-behavior: smooth;
3926
4044
  scrollbar-width: thin;
3927
4045
  scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
4046
+ background-color: ${(e) => e.$surfaceTheme === "dark" ? "#1f2937" : "#ffffff"};
3928
4047
 
3929
4048
  &::-webkit-scrollbar {
3930
4049
  width: 8px;
@@ -3968,7 +4087,7 @@ const ai = T(ot)`
3968
4087
  background-color: rgba(100, 116, 139, 0.75);
3969
4088
  }
3970
4089
  }
3971
- `, si = T(ot.Content)`
4090
+ `, ii = T(ot.Content)`
3972
4091
  padding: 16px;
3973
4092
  `;
3974
4093
  T.button`
@@ -4016,42 +4135,45 @@ function ar({
4016
4135
  className: e,
4017
4136
  children: t,
4018
4137
  style: r,
4019
- onDragOver: n,
4020
- onDragLeave: a,
4021
- onDrop: c
4138
+ surfaceTheme: n = "light",
4139
+ onDragOver: o,
4140
+ onDragLeave: c,
4141
+ onDrop: u
4022
4142
  }) {
4143
+ const d = n === "dark" ? "dark" : "light";
4023
4144
  return /* @__PURE__ */ l.jsx(
4024
- ai,
4145
+ si,
4025
4146
  {
4026
4147
  className: e,
4027
4148
  style: r,
4149
+ $surfaceTheme: d,
4028
4150
  initial: "smooth",
4029
4151
  resize: "smooth",
4030
4152
  role: "log",
4031
- onDragOver: n,
4032
- onDragLeave: a,
4033
- onDrop: c,
4153
+ onDragOver: o,
4154
+ onDragLeave: c,
4155
+ onDrop: u,
4034
4156
  children: t
4035
4157
  }
4036
4158
  );
4037
4159
  }
4038
4160
  function sr({ className: e, children: t }) {
4039
- return /* @__PURE__ */ l.jsx(si, { className: e, children: t });
4161
+ return /* @__PURE__ */ l.jsx(ii, { className: e, children: t });
4040
4162
  }
4041
- function ii({ config: e, chat: t }) {
4163
+ function ci({ config: e, chat: t }) {
4042
4164
  const {
4043
4165
  messages: r,
4044
4166
  sendMessage: n,
4045
- uploadAttachment: a,
4167
+ uploadAttachment: o,
4046
4168
  exportMessagePdf: c,
4047
4169
  isLoading: u,
4048
4170
  error: d,
4049
4171
  hasSessionStarted: h
4050
- } = t, [b, g] = L.useState(""), [p, w] = L.useState(!1), k = L.useRef(null), {
4172
+ } = t, [b, g] = F.useState(""), [p, w] = F.useState(!1), k = F.useRef(null), {
4051
4173
  enabled: S,
4052
4174
  staged: C,
4053
4175
  attachmentError: v,
4054
- setAttachmentError: o,
4176
+ setAttachmentError: a,
4055
4177
  addFiles: i,
4056
4178
  appendStaged: s,
4057
4179
  removeStaged: f,
@@ -4059,27 +4181,27 @@ function ii({ config: e, chat: t }) {
4059
4181
  maxFiles: x,
4060
4182
  maxBytes: y,
4061
4183
  allowed: A
4062
- } = or(e, a), M = () => e.theme === "dark" ? "dark" : e.theme === "light" ? "light" : p ? "dark" : "light";
4063
- L.useEffect(() => {
4184
+ } = or(e, o), _ = () => e.theme === "dark" ? "dark" : e.theme === "light" ? "light" : p ? "dark" : "light";
4185
+ F.useEffect(() => {
4064
4186
  if (e.theme === "auto" || !e.theme) {
4065
4187
  const I = () => {
4066
4188
  w(window.matchMedia("(prefers-color-scheme: dark)").matches);
4067
4189
  };
4068
4190
  I();
4069
- const P = window.matchMedia("(prefers-color-scheme: dark)");
4070
- return P.addEventListener("change", I), () => P.removeEventListener("change", I);
4191
+ const z = window.matchMedia("(prefers-color-scheme: dark)");
4192
+ return z.addEventListener("change", I), () => z.removeEventListener("change", I);
4071
4193
  } else
4072
4194
  w(e.theme === "dark");
4073
4195
  }, [e.theme]);
4074
4196
  const j = async () => {
4075
4197
  const I = b.trim();
4076
4198
  !I && C.length === 0 || u || (await n(I, void 0, C.length ? C : void 0), g(""), m(), setTimeout(() => {
4077
- var P;
4078
- (P = k.current) == null || P.focus();
4199
+ var z;
4200
+ (z = k.current) == null || z.focus();
4079
4201
  }, 100));
4080
4202
  }, E = (I) => {
4081
4203
  I.key === "Enter" && !I.shiftKey && (I.preventDefault(), j());
4082
- }, W = L.useMemo(() => e.height === "100%" || e.height === "100vh" ? {
4204
+ }, K = F.useMemo(() => e.height === "100%" || e.height === "100vh" ? {
4083
4205
  height: "100%",
4084
4206
  minHeight: 0,
4085
4207
  display: "flex",
@@ -4090,19 +4212,24 @@ function ii({ config: e, chat: t }) {
4090
4212
  display: "flex",
4091
4213
  flexDirection: "column",
4092
4214
  borderRadius: "8px"
4093
- }, [e.height]), F = (I) => {
4215
+ }, [e.height]), L = (I) => {
4094
4216
  S && (I.preventDefault(), I.dataTransfer.dropEffect = "copy");
4095
4217
  }, V = async (I) => {
4096
4218
  if (!S) return;
4097
4219
  I.preventDefault();
4098
- const P = await qt(I.dataTransfer);
4099
- P.length && await i(P);
4220
+ const z = await Qt(I.dataTransfer);
4221
+ z.length && await i(z);
4100
4222
  };
4101
4223
  return /* @__PURE__ */ l.jsx(
4102
4224
  _n,
4103
4225
  {
4104
- "data-theme": M(),
4105
- style: W,
4226
+ "data-theme": _(),
4227
+ style: {
4228
+ ...K,
4229
+ ...e.backgroundColor ? { backgroundColor: e.backgroundColor } : {},
4230
+ ...e.textColor ? { color: e.textColor } : {},
4231
+ ...e.borderRadius != null && e.borderRadius !== "" ? { borderRadius: e.borderRadius } : {}
4232
+ },
4106
4233
  children: e.quickQuestions && e.quickQuestions.length > 0 && !h ? /* @__PURE__ */ l.jsx(
4107
4234
  nr,
4108
4235
  {
@@ -4114,76 +4241,85 @@ function ii({ config: e, chat: t }) {
4114
4241
  isLoading: u
4115
4242
  }
4116
4243
  ) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4117
- /* @__PURE__ */ l.jsx(ar, { style: { flex: 1 }, onDragOver: F, onDrop: V, children: /* @__PURE__ */ l.jsxs(sr, { children: [
4118
- r.map((I) => /* @__PURE__ */ l.jsxs(
4119
- "div",
4120
- {
4121
- style: {
4122
- display: "flex",
4123
- marginBottom: "16px",
4124
- justifyContent: I.role === "user" ? "flex-end" : "flex-start",
4125
- alignItems: "flex-start",
4126
- gap: "8px"
4127
- },
4128
- children: [
4129
- I.role === "assistant" && e.agentImage && /* @__PURE__ */ l.jsx(
4130
- ke,
4244
+ /* @__PURE__ */ l.jsx(
4245
+ ar,
4246
+ {
4247
+ style: { flex: 1 },
4248
+ surfaceTheme: _(),
4249
+ onDragOver: L,
4250
+ onDrop: V,
4251
+ children: /* @__PURE__ */ l.jsxs(sr, { children: [
4252
+ r.map((I) => /* @__PURE__ */ l.jsxs(
4253
+ "div",
4254
+ {
4255
+ style: {
4256
+ display: "flex",
4257
+ marginBottom: "16px",
4258
+ justifyContent: I.role === "user" ? "flex-end" : "flex-start",
4259
+ alignItems: "flex-start",
4260
+ gap: "8px"
4261
+ },
4262
+ children: [
4263
+ I.role === "assistant" && e.agentImage && /* @__PURE__ */ l.jsx(
4264
+ we,
4265
+ {
4266
+ src: e.agentImage,
4267
+ alt: e.chatName || "Agent",
4268
+ $size: "28px"
4269
+ }
4270
+ ),
4271
+ I.role === "assistant" ? /* @__PURE__ */ l.jsxs(
4272
+ "div",
4273
+ {
4274
+ style: {
4275
+ display: "flex",
4276
+ flexDirection: "column",
4277
+ alignItems: "flex-start",
4278
+ maxWidth: "80%"
4279
+ },
4280
+ children: [
4281
+ /* @__PURE__ */ l.jsx(he, { $isUser: !1, children: /* @__PURE__ */ l.jsx(Yt, { message: I }) }),
4282
+ Mn(I, r, u) && /* @__PURE__ */ l.jsx(
4283
+ kn,
4284
+ {
4285
+ content: I.content,
4286
+ disabled: u,
4287
+ onExportPdf: (z) => c(z)
4288
+ }
4289
+ )
4290
+ ]
4291
+ }
4292
+ ) : /* @__PURE__ */ l.jsx(he, { $isUser: !0, children: /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4293
+ I.attachments && I.attachments.length > 0 && /* @__PURE__ */ l.jsx(ke, { attachments: I.attachments, readOnly: !0 }),
4294
+ I.content ? I.content : null
4295
+ ] }) })
4296
+ ]
4297
+ },
4298
+ I.id
4299
+ )),
4300
+ u && /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", justifyContent: "flex-start", alignItems: "flex-start", gap: "8px", marginBottom: "16px" }, children: [
4301
+ e.agentImage && /* @__PURE__ */ l.jsx(
4302
+ we,
4131
4303
  {
4132
4304
  src: e.agentImage,
4133
4305
  alt: e.chatName || "Agent",
4134
4306
  $size: "28px"
4135
4307
  }
4136
4308
  ),
4137
- I.role === "assistant" ? /* @__PURE__ */ l.jsxs(
4138
- "div",
4139
- {
4140
- style: {
4141
- display: "flex",
4142
- flexDirection: "column",
4143
- alignItems: "flex-start",
4144
- maxWidth: "80%"
4145
- },
4146
- children: [
4147
- /* @__PURE__ */ l.jsx(he, { $isUser: !1, children: /* @__PURE__ */ l.jsx(Vt, { content: I.content }) }),
4148
- Mn(I, r, u) && /* @__PURE__ */ l.jsx(
4149
- kn,
4150
- {
4151
- content: I.content,
4152
- disabled: u,
4153
- onExportPdf: (P) => c(P)
4154
- }
4155
- )
4156
- ]
4157
- }
4158
- ) : /* @__PURE__ */ l.jsx(he, { $isUser: !0, children: /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4159
- I.attachments && I.attachments.length > 0 && /* @__PURE__ */ l.jsx(Ae, { attachments: I.attachments, readOnly: !0 }),
4160
- I.content ? I.content : null
4309
+ /* @__PURE__ */ l.jsx(he, { $isUser: !1, children: /* @__PURE__ */ l.jsxs(tr, { children: [
4310
+ /* @__PURE__ */ l.jsx("div", { className: "dot" }),
4311
+ /* @__PURE__ */ l.jsx("div", { className: "dot" }),
4312
+ /* @__PURE__ */ l.jsx("div", { className: "dot" })
4161
4313
  ] }) })
4162
- ]
4163
- },
4164
- I.id
4165
- )),
4166
- u && /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", justifyContent: "flex-start", alignItems: "flex-start", gap: "8px", marginBottom: "16px" }, children: [
4167
- e.agentImage && /* @__PURE__ */ l.jsx(
4168
- ke,
4169
- {
4170
- src: e.agentImage,
4171
- alt: e.chatName || "Agent",
4172
- $size: "28px"
4173
- }
4174
- ),
4175
- /* @__PURE__ */ l.jsx(he, { $isUser: !1, children: /* @__PURE__ */ l.jsxs(tr, { children: [
4176
- /* @__PURE__ */ l.jsx("div", { className: "dot" }),
4177
- /* @__PURE__ */ l.jsx("div", { className: "dot" }),
4178
- /* @__PURE__ */ l.jsx("div", { className: "dot" })
4179
- ] }) })
4180
- ] }),
4181
- d && /* @__PURE__ */ l.jsx(rr, { children: d })
4182
- ] }) }),
4314
+ ] }),
4315
+ d && /* @__PURE__ */ l.jsx(rr, { children: d })
4316
+ ] })
4317
+ }
4318
+ ),
4183
4319
  /* @__PURE__ */ l.jsxs(Xt, { style: { flexDirection: "column", alignItems: "stretch", gap: 0 }, children: [
4184
4320
  (v || S && C.length > 0) && /* @__PURE__ */ l.jsxs("div", { style: { paddingBottom: 8 }, children: [
4185
4321
  v && /* @__PURE__ */ l.jsx("div", { style: { fontSize: 12, color: "#dc2626", marginBottom: 4 }, children: v }),
4186
- S && C.length > 0 && /* @__PURE__ */ l.jsx(Ae, { attachments: C, onRemove: f })
4322
+ S && C.length > 0 && /* @__PURE__ */ l.jsx(ke, { attachments: C, onRemove: f })
4187
4323
  ] }),
4188
4324
  /* @__PURE__ */ l.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ l.jsxs(Zt, { children: [
4189
4325
  /* @__PURE__ */ l.jsx(
@@ -4200,7 +4336,7 @@ function ii({ config: e, chat: t }) {
4200
4336
  ),
4201
4337
  /* @__PURE__ */ l.jsxs(Jt, { children: [
4202
4338
  /* @__PURE__ */ l.jsx("div", { style: { display: "flex", alignItems: "center", gap: 8, flex: 1, minWidth: 0 }, children: S && /* @__PURE__ */ l.jsx(
4203
- Gt,
4339
+ Vt,
4204
4340
  {
4205
4341
  integrated: !0,
4206
4342
  disabled: u,
@@ -4208,9 +4344,9 @@ function ii({ config: e, chat: t }) {
4208
4344
  maxFiles: x,
4209
4345
  allowedMime: A,
4210
4346
  currentCount: C.length,
4211
- uploadAttachment: a,
4347
+ uploadAttachment: o,
4212
4348
  onUploaded: s,
4213
- onError: o
4349
+ onError: a
4214
4350
  }
4215
4351
  ) }),
4216
4352
  /* @__PURE__ */ l.jsx(
@@ -4230,7 +4366,7 @@ function ii({ config: e, chat: t }) {
4230
4366
  }
4231
4367
  );
4232
4368
  }
4233
- const ci = T.div`
4369
+ const li = T.div`
4234
4370
  display: flex;
4235
4371
  align-items: center;
4236
4372
  justify-content: space-between;
@@ -4256,15 +4392,15 @@ const ci = T.div`
4256
4392
  background: ${(e) => e.$showWelcomeScreen && e.$primaryColor ? e.$primaryColor : "#ffffff"};
4257
4393
  color: ${(e) => e.$showWelcomeScreen && e.$primaryColor ? "white" : "#111827"};
4258
4394
  }
4259
- `, li = T.div`
4395
+ `, di = T.div`
4260
4396
  display: flex;
4261
4397
  align-items: center;
4262
4398
  gap: 12px;
4263
- `, di = T.div`
4399
+ `, ui = T.div`
4264
4400
  display: flex;
4265
4401
  align-items: center;
4266
4402
  gap: 8px;
4267
- `, ui = T.div`
4403
+ `, pi = T.div`
4268
4404
  width: 8px;
4269
4405
  height: 8px;
4270
4406
  background: #10b981;
@@ -4279,14 +4415,14 @@ const ci = T.div`
4279
4415
  opacity: 0.5;
4280
4416
  }
4281
4417
  }
4282
- `, pi = T.span`
4418
+ `, fi = T.span`
4283
4419
  font-weight: 500;
4284
4420
  font-size: 14px;
4285
- `, fi = T.div`
4421
+ `, hi = T.div`
4286
4422
  display: flex;
4287
4423
  align-items: center;
4288
4424
  gap: 4px;
4289
- `, hi = T.button`
4425
+ `, mi = T.button`
4290
4426
  padding: 4px;
4291
4427
  background: transparent;
4292
4428
  border: none;
@@ -4307,42 +4443,42 @@ const ci = T.div`
4307
4443
  height: 16px;
4308
4444
  }
4309
4445
  `;
4310
- function mi({
4446
+ function gi({
4311
4447
  chatName: e = "Chat Assistant",
4312
4448
  showCloseButton: t = !0,
4313
4449
  onClose: r,
4314
4450
  agentImage: n,
4315
- className: a,
4451
+ className: o,
4316
4452
  primaryColor: c,
4317
4453
  showWelcomeScreen: u = !1
4318
4454
  }) {
4319
4455
  return /* @__PURE__ */ l.jsxs(
4320
- ci,
4456
+ li,
4321
4457
  {
4322
- className: a,
4458
+ className: o,
4323
4459
  $primaryColor: c,
4324
4460
  $showWelcomeScreen: u,
4325
4461
  children: [
4326
- /* @__PURE__ */ l.jsxs(li, { children: [
4462
+ /* @__PURE__ */ l.jsxs(di, { children: [
4327
4463
  n && /* @__PURE__ */ l.jsx(
4328
- ke,
4464
+ we,
4329
4465
  {
4330
4466
  src: n,
4331
4467
  alt: e || "Agent",
4332
4468
  $size: "32px"
4333
4469
  }
4334
4470
  ),
4335
- /* @__PURE__ */ l.jsxs(di, { children: [
4336
- /* @__PURE__ */ l.jsx(ui, {}),
4337
- /* @__PURE__ */ l.jsx(pi, { children: e })
4471
+ /* @__PURE__ */ l.jsxs(ui, { children: [
4472
+ /* @__PURE__ */ l.jsx(pi, {}),
4473
+ /* @__PURE__ */ l.jsx(fi, { children: e })
4338
4474
  ] })
4339
4475
  ] }),
4340
- /* @__PURE__ */ l.jsx(fi, { children: t && /* @__PURE__ */ l.jsx(
4341
- hi,
4476
+ /* @__PURE__ */ l.jsx(hi, { children: t && /* @__PURE__ */ l.jsx(
4477
+ mi,
4342
4478
  {
4343
4479
  onClick: r,
4344
4480
  "aria-label": "Close",
4345
- children: /* @__PURE__ */ l.jsx(Zs, { size: 16 })
4481
+ children: /* @__PURE__ */ l.jsx(Js, { size: 16 })
4346
4482
  }
4347
4483
  ) })
4348
4484
  ]
@@ -4353,14 +4489,14 @@ function Lr({ config: e, chat: t }) {
4353
4489
  const {
4354
4490
  messages: r,
4355
4491
  sendMessage: n,
4356
- uploadAttachment: a,
4492
+ uploadAttachment: o,
4357
4493
  exportMessagePdf: c,
4358
4494
  isLoading: u,
4359
4495
  error: d,
4360
4496
  isOpen: h,
4361
4497
  setIsOpen: b,
4362
4498
  hasSessionStarted: g
4363
- } = t, [p, w] = L.useState(""), [k, S] = L.useState(e.height || 600), [C, v] = L.useState(!1), o = L.useRef(null), {
4499
+ } = t, [p, w] = F.useState(""), [k, S] = F.useState(e.height || 600), [C, v] = F.useState(!1), a = F.useRef(null), {
4364
4500
  enabled: i,
4365
4501
  staged: s,
4366
4502
  attachmentError: f,
@@ -4368,56 +4504,58 @@ function Lr({ config: e, chat: t }) {
4368
4504
  addFiles: x,
4369
4505
  appendStaged: y,
4370
4506
  removeStaged: A,
4371
- clearStaged: M,
4507
+ clearStaged: _,
4372
4508
  maxFiles: j,
4373
4509
  maxBytes: E,
4374
- allowed: W
4375
- } = or(e, a), F = () => e.theme === "dark" ? "dark" : e.theme === "light" ? "light" : C ? "dark" : "light";
4376
- L.useEffect(() => {
4510
+ allowed: K
4511
+ } = or(e, o), L = () => e.theme === "dark" ? "dark" : e.theme === "light" ? "light" : C ? "dark" : "light";
4512
+ F.useEffect(() => {
4377
4513
  if (e.theme === "auto" || !e.theme) {
4378
4514
  const $ = () => {
4379
4515
  v(window.matchMedia("(prefers-color-scheme: dark)").matches);
4380
4516
  };
4381
4517
  $();
4382
- const D = window.matchMedia("(prefers-color-scheme: dark)");
4383
- return D.addEventListener("change", $), () => D.removeEventListener("change", $);
4518
+ const P = window.matchMedia("(prefers-color-scheme: dark)");
4519
+ return P.addEventListener("change", $), () => P.removeEventListener("change", $);
4384
4520
  } else
4385
4521
  v(e.theme === "dark");
4386
4522
  }, [e.theme]);
4387
4523
  const V = async () => {
4388
4524
  const $ = p.trim();
4389
- !$ && s.length === 0 || u || (await n($, void 0, s.length ? s : void 0), w(""), M(), setTimeout(() => {
4390
- var D;
4391
- (D = o.current) == null || D.focus();
4525
+ !$ && s.length === 0 || u || (await n($, void 0, s.length ? s : void 0), w(""), _(), setTimeout(() => {
4526
+ var P;
4527
+ (P = a.current) == null || P.focus();
4392
4528
  }, 100));
4393
4529
  }, I = ($) => {
4394
4530
  $.key === "Enter" && !$.shiftKey && ($.preventDefault(), V());
4395
- }, P = ($) => {
4531
+ }, z = ($) => {
4396
4532
  i && ($.preventDefault(), $.dataTransfer.dropEffect = "copy");
4397
4533
  }, U = async ($) => {
4398
4534
  if (!i) return;
4399
4535
  $.preventDefault();
4400
- const D = await qt($.dataTransfer);
4401
- D.length && await x(D);
4536
+ const P = await Qt($.dataTransfer);
4537
+ P.length && await x(P);
4402
4538
  };
4403
4539
  return h ? /* @__PURE__ */ l.jsxs(
4404
4540
  Ks,
4405
4541
  {
4406
4542
  $position: e.position || "bottom-right",
4407
- "data-theme": F(),
4543
+ "data-theme": L(),
4408
4544
  style: {
4409
4545
  height: k,
4546
+ ...e.backgroundColor ? { backgroundColor: e.backgroundColor } : {},
4547
+ ...e.textColor ? { color: e.textColor } : {},
4410
4548
  ...e.chatWindowStyle
4411
4549
  },
4412
4550
  children: [
4413
4551
  e.resizable !== !1 && /* @__PURE__ */ l.jsx(
4414
- Ws,
4552
+ Us,
4415
4553
  {
4416
4554
  $position: "top",
4417
4555
  onMouseDown: ($) => {
4418
4556
  $.preventDefault();
4419
- const D = $.clientY, z = typeof k == "number" ? k : 600, B = (Y) => {
4420
- const O = Y.clientY - D, H = z - O;
4557
+ const P = $.clientY, D = typeof k == "number" ? k : 600, B = (Y) => {
4558
+ const O = Y.clientY - P, H = D - O;
4421
4559
  S(Math.max(200, Math.min(600, H)));
4422
4560
  }, R = () => {
4423
4561
  document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", R);
@@ -4427,7 +4565,7 @@ function Lr({ config: e, chat: t }) {
4427
4565
  }
4428
4566
  ),
4429
4567
  e.showHeader !== !1 && /* @__PURE__ */ l.jsx(
4430
- mi,
4568
+ gi,
4431
4569
  {
4432
4570
  agentImage: e.agentImage,
4433
4571
  chatName: e.chatName,
@@ -4447,7 +4585,7 @@ function Lr({ config: e, chat: t }) {
4447
4585
  isLoading: u
4448
4586
  }
4449
4587
  ) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4450
- /* @__PURE__ */ l.jsx(ar, { onDragOver: P, onDrop: U, children: /* @__PURE__ */ l.jsxs(sr, { children: [
4588
+ /* @__PURE__ */ l.jsx(ar, { surfaceTheme: L(), onDragOver: z, onDrop: U, children: /* @__PURE__ */ l.jsxs(sr, { children: [
4451
4589
  r.map(($) => /* @__PURE__ */ l.jsxs(
4452
4590
  "div",
4453
4591
  {
@@ -4460,7 +4598,7 @@ function Lr({ config: e, chat: t }) {
4460
4598
  },
4461
4599
  children: [
4462
4600
  $.role === "assistant" && e.agentImage && /* @__PURE__ */ l.jsx(
4463
- ke,
4601
+ we,
4464
4602
  {
4465
4603
  src: e.agentImage,
4466
4604
  alt: e.chatName || "Agent",
@@ -4477,19 +4615,19 @@ function Lr({ config: e, chat: t }) {
4477
4615
  maxWidth: "80%"
4478
4616
  },
4479
4617
  children: [
4480
- /* @__PURE__ */ l.jsx(he, { $isUser: !1, children: /* @__PURE__ */ l.jsx(Vt, { content: $.content }) }),
4618
+ /* @__PURE__ */ l.jsx(he, { $isUser: !1, children: /* @__PURE__ */ l.jsx(Yt, { message: $ }) }),
4481
4619
  Mn($, r, u) && /* @__PURE__ */ l.jsx(
4482
4620
  kn,
4483
4621
  {
4484
4622
  content: $.content,
4485
4623
  disabled: u,
4486
- onExportPdf: (D) => c(D)
4624
+ onExportPdf: (P) => c(P)
4487
4625
  }
4488
4626
  )
4489
4627
  ]
4490
4628
  }
4491
4629
  ) : /* @__PURE__ */ l.jsx(he, { $isUser: !0, children: /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4492
- $.attachments && $.attachments.length > 0 && /* @__PURE__ */ l.jsx(Ae, { attachments: $.attachments, readOnly: !0 }),
4630
+ $.attachments && $.attachments.length > 0 && /* @__PURE__ */ l.jsx(ke, { attachments: $.attachments, readOnly: !0 }),
4493
4631
  $.content ? $.content : null
4494
4632
  ] }) })
4495
4633
  ]
@@ -4498,7 +4636,7 @@ function Lr({ config: e, chat: t }) {
4498
4636
  )),
4499
4637
  u && /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", justifyContent: "flex-start", alignItems: "flex-start", gap: "8px", marginBottom: "16px" }, children: [
4500
4638
  e.agentImage && /* @__PURE__ */ l.jsx(
4501
- ke,
4639
+ we,
4502
4640
  {
4503
4641
  src: e.agentImage,
4504
4642
  alt: e.chatName || "Agent",
@@ -4516,13 +4654,13 @@ function Lr({ config: e, chat: t }) {
4516
4654
  /* @__PURE__ */ l.jsxs(Xt, { style: { flexDirection: "column", alignItems: "stretch", gap: 0 }, children: [
4517
4655
  (f || i && s.length > 0) && /* @__PURE__ */ l.jsxs("div", { style: { paddingBottom: 8 }, children: [
4518
4656
  f && /* @__PURE__ */ l.jsx("div", { style: { fontSize: 12, color: "#dc2626", marginBottom: 4 }, children: f }),
4519
- i && s.length > 0 && /* @__PURE__ */ l.jsx(Ae, { attachments: s, onRemove: A })
4657
+ i && s.length > 0 && /* @__PURE__ */ l.jsx(ke, { attachments: s, onRemove: A })
4520
4658
  ] }),
4521
4659
  /* @__PURE__ */ l.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ l.jsxs(Zt, { children: [
4522
4660
  /* @__PURE__ */ l.jsx(
4523
4661
  ht,
4524
4662
  {
4525
- ref: o,
4663
+ ref: a,
4526
4664
  variant: "composer",
4527
4665
  value: p,
4528
4666
  onChange: w,
@@ -4533,15 +4671,15 @@ function Lr({ config: e, chat: t }) {
4533
4671
  ),
4534
4672
  /* @__PURE__ */ l.jsxs(Jt, { children: [
4535
4673
  /* @__PURE__ */ l.jsx("div", { style: { display: "flex", alignItems: "center", gap: 8, flex: 1, minWidth: 0 }, children: i && /* @__PURE__ */ l.jsx(
4536
- Gt,
4674
+ Vt,
4537
4675
  {
4538
4676
  integrated: !0,
4539
4677
  disabled: u,
4540
4678
  maxFileBytes: E,
4541
4679
  maxFiles: j,
4542
- allowedMime: W,
4680
+ allowedMime: K,
4543
4681
  currentCount: s.length,
4544
- uploadAttachment: a,
4682
+ uploadAttachment: o,
4545
4683
  onUploaded: y,
4546
4684
  onError: m
4547
4685
  }
@@ -4563,7 +4701,7 @@ function Lr({ config: e, chat: t }) {
4563
4701
  ]
4564
4702
  }
4565
4703
  ) : /* @__PURE__ */ l.jsxs(
4566
- Fs,
4704
+ Ws,
4567
4705
  {
4568
4706
  onClick: () => b(!0),
4569
4707
  style: e.buttonStyle,
@@ -4571,37 +4709,37 @@ function Lr({ config: e, chat: t }) {
4571
4709
  $primaryColor: e.primaryColor,
4572
4710
  "aria-label": "Open chat",
4573
4711
  children: [
4574
- /* @__PURE__ */ l.jsx("div", { className: "icon-container", children: /* @__PURE__ */ l.jsx(Vs, { size: 16 }) }),
4712
+ /* @__PURE__ */ l.jsx("div", { className: "icon-container", children: /* @__PURE__ */ l.jsx(Zs, { size: 16 }) }),
4575
4713
  /* @__PURE__ */ l.jsx("span", { children: e.buttonText || e.chatName || "AI Chat" })
4576
4714
  ]
4577
4715
  }
4578
4716
  );
4579
4717
  }
4580
- function vi(e) {
4718
+ function $i(e) {
4581
4719
  const t = Zn(e), r = Vn(t);
4582
4720
  switch (t.mode) {
4583
4721
  case "floating":
4584
4722
  return /* @__PURE__ */ l.jsx(Lr, { config: t, chat: r });
4585
4723
  case "embedded":
4586
- return /* @__PURE__ */ l.jsx(ii, { config: t, chat: r });
4724
+ return /* @__PURE__ */ l.jsx(ci, { config: t, chat: r });
4587
4725
  default:
4588
4726
  return /* @__PURE__ */ l.jsx(Lr, { config: t, chat: r });
4589
4727
  }
4590
4728
  }
4591
- function $i({ config: e, chat: t }) {
4592
- const { messages: r, sendMessage: n, uploadAttachment: a, isLoading: c, error: u, hasSessionStarted: d } = t, [h, b] = L.useState(""), g = L.useRef(null), {
4729
+ function Si({ config: e, chat: t }) {
4730
+ const { messages: r, sendMessage: n, uploadAttachment: o, isLoading: c, error: u, hasSessionStarted: d } = t, [h, b] = F.useState(""), g = F.useRef(null), {
4593
4731
  enabled: p,
4594
4732
  staged: w,
4595
4733
  attachmentError: k,
4596
4734
  setAttachmentError: S,
4597
4735
  addFiles: C,
4598
4736
  appendStaged: v,
4599
- removeStaged: o,
4737
+ removeStaged: a,
4600
4738
  clearStaged: i,
4601
4739
  maxFiles: s,
4602
4740
  maxBytes: f,
4603
4741
  allowed: m
4604
- } = or(e, a), x = async () => {
4742
+ } = or(e, o), x = async () => {
4605
4743
  const j = h.trim();
4606
4744
  !j && w.length === 0 || c || (await n(j, void 0, w.length ? w : void 0), b(""), i(), setTimeout(() => {
4607
4745
  var E;
@@ -4611,15 +4749,16 @@ function $i({ config: e, chat: t }) {
4611
4749
  j.key === "Enter" && !j.shiftKey && (j.preventDefault(), x());
4612
4750
  }, A = (j) => {
4613
4751
  p && (j.preventDefault(), j.dataTransfer.dropEffect = "copy");
4614
- }, M = async (j) => {
4752
+ }, _ = async (j) => {
4615
4753
  if (!p) return;
4616
4754
  j.preventDefault();
4617
- const E = await qt(j.dataTransfer);
4755
+ const E = await Qt(j.dataTransfer);
4618
4756
  E.length && await C(E);
4619
4757
  };
4620
4758
  return /* @__PURE__ */ l.jsx(
4621
4759
  _n,
4622
4760
  {
4761
+ "data-theme": "light",
4623
4762
  style: {
4624
4763
  height: e.height,
4625
4764
  display: "flex",
@@ -4639,7 +4778,7 @@ function $i({ config: e, chat: t }) {
4639
4778
  isLoading: c
4640
4779
  }
4641
4780
  ) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4642
- /* @__PURE__ */ l.jsx(ar, { style: { flex: 1 }, onDragOver: A, onDrop: M, children: /* @__PURE__ */ l.jsxs(sr, { children: [
4781
+ /* @__PURE__ */ l.jsx(ar, { style: { flex: 1 }, surfaceTheme: "light", onDragOver: A, onDrop: _, children: /* @__PURE__ */ l.jsxs(sr, { children: [
4643
4782
  r.map((j) => /* @__PURE__ */ l.jsxs(
4644
4783
  "div",
4645
4784
  {
@@ -4652,15 +4791,15 @@ function $i({ config: e, chat: t }) {
4652
4791
  },
4653
4792
  children: [
4654
4793
  j.role === "assistant" && e.agentImage && /* @__PURE__ */ l.jsx(
4655
- ke,
4794
+ we,
4656
4795
  {
4657
4796
  src: e.agentImage,
4658
4797
  alt: e.chatName || "Agent",
4659
4798
  $size: "28px"
4660
4799
  }
4661
4800
  ),
4662
- /* @__PURE__ */ l.jsx(he, { $isUser: j.role === "user", children: j.role === "assistant" ? /* @__PURE__ */ l.jsx(Vt, { content: j.content }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4663
- j.attachments && j.attachments.length > 0 && /* @__PURE__ */ l.jsx(Ae, { attachments: j.attachments, readOnly: !0 }),
4801
+ /* @__PURE__ */ l.jsx(he, { $isUser: j.role === "user", children: j.role === "assistant" ? /* @__PURE__ */ l.jsx(Yt, { message: j }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4802
+ j.attachments && j.attachments.length > 0 && /* @__PURE__ */ l.jsx(ke, { attachments: j.attachments, readOnly: !0 }),
4664
4803
  j.content ? j.content : null
4665
4804
  ] }) })
4666
4805
  ]
@@ -4669,7 +4808,7 @@ function $i({ config: e, chat: t }) {
4669
4808
  )),
4670
4809
  c && /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", justifyContent: "flex-start", alignItems: "flex-start", gap: "8px", marginBottom: "12px" }, children: [
4671
4810
  e.agentImage && /* @__PURE__ */ l.jsx(
4672
- ke,
4811
+ we,
4673
4812
  {
4674
4813
  src: e.agentImage,
4675
4814
  alt: e.chatName || "Agent",
@@ -4687,7 +4826,7 @@ function $i({ config: e, chat: t }) {
4687
4826
  /* @__PURE__ */ l.jsxs(Xt, { style: { flexDirection: "column", alignItems: "stretch", gap: 0 }, children: [
4688
4827
  (k || p && w.length > 0) && /* @__PURE__ */ l.jsxs("div", { style: { paddingBottom: 8 }, children: [
4689
4828
  k && /* @__PURE__ */ l.jsx("div", { style: { fontSize: 12, color: "#dc2626", marginBottom: 4 }, children: k }),
4690
- p && w.length > 0 && /* @__PURE__ */ l.jsx(Ae, { attachments: w, onRemove: o })
4829
+ p && w.length > 0 && /* @__PURE__ */ l.jsx(ke, { attachments: w, onRemove: a })
4691
4830
  ] }),
4692
4831
  /* @__PURE__ */ l.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ l.jsxs(Zt, { children: [
4693
4832
  /* @__PURE__ */ l.jsx(
@@ -4704,7 +4843,7 @@ function $i({ config: e, chat: t }) {
4704
4843
  ),
4705
4844
  /* @__PURE__ */ l.jsxs(Jt, { children: [
4706
4845
  /* @__PURE__ */ l.jsx("div", { style: { display: "flex", alignItems: "center", gap: 8, flex: 1, minWidth: 0 }, children: p && /* @__PURE__ */ l.jsx(
4707
- Gt,
4846
+ Vt,
4708
4847
  {
4709
4848
  integrated: !0,
4710
4849
  disabled: c,
@@ -4712,7 +4851,7 @@ function $i({ config: e, chat: t }) {
4712
4851
  maxFiles: s,
4713
4852
  allowedMime: m,
4714
4853
  currentCount: w.length,
4715
- uploadAttachment: a,
4854
+ uploadAttachment: o,
4716
4855
  onUploaded: v,
4717
4856
  onError: S
4718
4857
  }
@@ -4735,17 +4874,17 @@ function $i({ config: e, chat: t }) {
4735
4874
  );
4736
4875
  }
4737
4876
  export {
4738
- ii as EmbeddedChat,
4877
+ ci as EmbeddedChat,
4739
4878
  Lr as FloatingChat,
4740
- $i as InlineChat,
4741
- Vt as MarkdownRenderer,
4879
+ Si as InlineChat,
4880
+ Ps as MarkdownRenderer,
4742
4881
  Gn as OrdifyApiClient,
4743
- vi as OrdifyChat,
4744
- ki as debounce,
4745
- xi as formatTime,
4882
+ $i as OrdifyChat,
4883
+ wi as debounce,
4884
+ ki as formatTime,
4746
4885
  He as generateId,
4747
4886
  Yn as parseStreamingResponse,
4748
- wi as throttle,
4887
+ vi as throttle,
4749
4888
  Vn as useOrdifyChat,
4750
4889
  Zn as useOrdifyConfig,
4751
4890
  or as useWidgetAttachmentStaging