teodor-new-chat-ui 1.5.16 → 1.5.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,12 +1,12 @@
1
- import { jsx as c, jsxs as N, Fragment as Le } from "react/jsx-runtime";
1
+ import { jsx as c, jsxs as N, Fragment as Fe } from "react/jsx-runtime";
2
2
  import * as l from "react";
3
- import Ze, { useState as ce, useRef as nt, useCallback as Se, useEffect as we, useReducer as Bu, useMemo as tt, createContext as pa, useContext as ha, useLayoutEffect as Uu } from "react";
4
- import { ChevronUp as Gt, ChevronDown as Tt, Copy as cs, Edit as ls, RotateCcw as Kr, GitBranch as ma, ChevronLeft as zu, ChevronRight as ga, Bot as us, Wrench as Hu, User as Wu, Image as Vu, Check as yo, Circle as ju, X as Xt, Edit3 as ba, Paperclip as ds, Plus as va, Square as Ku, Send as Gu, MessageSquare as qu, Calendar as Yu, Trash2 as Xu, PanelLeft as Ju, Settings as Zu, Server as Qu, EyeOff as ed, Eye as td, Layout as nd, MessageCircle as rd, Save as od } from "lucide-react";
3
+ import Qe, { useState as ce, useRef as rt, useCallback as Se, useEffect as ve, useReducer as Bu, useMemo as nt, createContext as pa, useContext as ha, useLayoutEffect as Uu } from "react";
4
+ import { ChevronUp as Gt, ChevronDown as Tt, Copy as cs, Edit as ls, RotateCcw as jr, GitBranch as ma, ChevronLeft as zu, ChevronRight as ga, Bot as us, Wrench as Hu, User as Wu, Image as Vu, Check as wo, Circle as ju, X as Xt, Edit3 as ba, Paperclip as ds, Plus as va, Square as Ku, Send as Gu, MessageSquare as qu, Calendar as Yu, Trash2 as Xu, PanelLeft as Ju, Settings as Zu, Server as Qu, EyeOff as ed, Eye as td, Layout as nd, MessageCircle as rd, Save as od } from "lucide-react";
5
5
  import { Slot as Lt, createSlot as It, createSlottable as sd } from "@radix-ui/react-slot";
6
- import { cva as cn } from "class-variance-authority";
6
+ import { cva as an } from "class-variance-authority";
7
7
  import { clsx as ad } from "clsx";
8
8
  import { twMerge as id } from "tailwind-merge";
9
- import * as Zn from "react-dom";
9
+ import * as Jn from "react-dom";
10
10
  import cd from "react-dom";
11
11
  import ld from "react-markdown";
12
12
  import ud from "remark-gfm";
@@ -15,37 +15,37 @@ function wa(e, t) {
15
15
  return e.apply(t, arguments);
16
16
  };
17
17
  }
18
- const { toString: dd } = Object.prototype, { getPrototypeOf: xo } = Object, { iterator: Qn, toStringTag: ya } = Symbol, er = /* @__PURE__ */ ((e) => (t) => {
18
+ const { toString: dd } = Object.prototype, { getPrototypeOf: yo } = Object, { iterator: Zn, toStringTag: ya } = Symbol, Qn = /* @__PURE__ */ ((e) => (t) => {
19
19
  const n = dd.call(t);
20
20
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
21
- })(/* @__PURE__ */ Object.create(null)), Ue = (e) => (e = e.toLowerCase(), (t) => er(t) === e), tr = (e) => (t) => typeof t === e, { isArray: Ft } = Array, Ot = tr("undefined");
22
- function ln(e) {
21
+ })(/* @__PURE__ */ Object.create(null)), ze = (e) => (e = e.toLowerCase(), (t) => Qn(t) === e), er = (e) => (t) => typeof t === e, { isArray: Ft } = Array, Ot = er("undefined");
22
+ function cn(e) {
23
23
  return e !== null && !Ot(e) && e.constructor !== null && !Ot(e.constructor) && Te(e.constructor.isBuffer) && e.constructor.isBuffer(e);
24
24
  }
25
- const xa = Ue("ArrayBuffer");
25
+ const xa = ze("ArrayBuffer");
26
26
  function fd(e) {
27
27
  let t;
28
28
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && xa(e.buffer), t;
29
29
  }
30
- const pd = tr("string"), Te = tr("function"), Sa = tr("number"), un = (e) => e !== null && typeof e == "object", hd = (e) => e === !0 || e === !1, Nn = (e) => {
31
- if (er(e) !== "object")
30
+ const pd = er("string"), Te = er("function"), Sa = er("number"), ln = (e) => e !== null && typeof e == "object", hd = (e) => e === !0 || e === !1, Rn = (e) => {
31
+ if (Qn(e) !== "object")
32
32
  return !1;
33
- const t = xo(e);
34
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(ya in e) && !(Qn in e);
33
+ const t = yo(e);
34
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(ya in e) && !(Zn in e);
35
35
  }, md = (e) => {
36
- if (!un(e) || ln(e))
36
+ if (!ln(e) || cn(e))
37
37
  return !1;
38
38
  try {
39
39
  return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
40
40
  } catch {
41
41
  return !1;
42
42
  }
43
- }, gd = Ue("Date"), bd = Ue("File"), vd = Ue("Blob"), wd = Ue("FileList"), yd = (e) => un(e) && Te(e.pipe), xd = (e) => {
43
+ }, gd = ze("Date"), bd = ze("File"), vd = ze("Blob"), wd = ze("FileList"), yd = (e) => ln(e) && Te(e.pipe), xd = (e) => {
44
44
  let t;
45
- return e && (typeof FormData == "function" && e instanceof FormData || Te(e.append) && ((t = er(e)) === "formdata" || // detect form-data instance
45
+ return e && (typeof FormData == "function" && e instanceof FormData || Te(e.append) && ((t = Qn(e)) === "formdata" || // detect form-data instance
46
46
  t === "object" && Te(e.toString) && e.toString() === "[object FormData]"));
47
- }, Sd = Ue("URLSearchParams"), [Cd, Ed, Rd, Nd] = ["ReadableStream", "Request", "Response", "Headers"].map(Ue), Td = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
48
- function dn(e, t, { allOwnKeys: n = !1 } = {}) {
47
+ }, Sd = ze("URLSearchParams"), [Cd, Ed, Rd, Nd] = ["ReadableStream", "Request", "Response", "Headers"].map(ze), Td = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
48
+ function un(e, t, { allOwnKeys: n = !1 } = {}) {
49
49
  if (e === null || typeof e > "u")
50
50
  return;
51
51
  let r, o;
@@ -53,7 +53,7 @@ function dn(e, t, { allOwnKeys: n = !1 } = {}) {
53
53
  for (r = 0, o = e.length; r < o; r++)
54
54
  t.call(null, e[r], r, e);
55
55
  else {
56
- if (ln(e))
56
+ if (cn(e))
57
57
  return;
58
58
  const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e), a = s.length;
59
59
  let i;
@@ -62,7 +62,7 @@ function dn(e, t, { allOwnKeys: n = !1 } = {}) {
62
62
  }
63
63
  }
64
64
  function Ca(e, t) {
65
- if (ln(e))
65
+ if (cn(e))
66
66
  return null;
67
67
  t = t.toLowerCase();
68
68
  const n = Object.keys(e);
@@ -73,16 +73,16 @@ function Ca(e, t) {
73
73
  return null;
74
74
  }
75
75
  const dt = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ea = (e) => !Ot(e) && e !== dt;
76
- function Gr() {
76
+ function Kr() {
77
77
  const { caseless: e, skipUndefined: t } = Ea(this) && this || {}, n = {}, r = (o, s) => {
78
78
  const a = e && Ca(n, s) || s;
79
- Nn(n[a]) && Nn(o) ? n[a] = Gr(n[a], o) : Nn(o) ? n[a] = Gr({}, o) : Ft(o) ? n[a] = o.slice() : (!t || !Ot(o)) && (n[a] = o);
79
+ Rn(n[a]) && Rn(o) ? n[a] = Kr(n[a], o) : Rn(o) ? n[a] = Kr({}, o) : Ft(o) ? n[a] = o.slice() : (!t || !Ot(o)) && (n[a] = o);
80
80
  };
81
81
  for (let o = 0, s = arguments.length; o < s; o++)
82
- arguments[o] && dn(arguments[o], r);
82
+ arguments[o] && un(arguments[o], r);
83
83
  return n;
84
84
  }
85
- const Ad = (e, t, n, { allOwnKeys: r } = {}) => (dn(t, (o, s) => {
85
+ const Ad = (e, t, n, { allOwnKeys: r } = {}) => (un(t, (o, s) => {
86
86
  n && Te(o) ? e[s] = wa(o, n) : e[s] = o;
87
87
  }, { allOwnKeys: r }), e), Pd = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), _d = (e, t, n, r) => {
88
88
  e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
@@ -95,7 +95,7 @@ const Ad = (e, t, n, { allOwnKeys: r } = {}) => (dn(t, (o, s) => {
95
95
  do {
96
96
  for (o = Object.getOwnPropertyNames(e), s = o.length; s-- > 0; )
97
97
  a = o[s], (!r || r(a, e, t)) && !i[a] && (t[a] = e[a], i[a] = !0);
98
- e = n !== !1 && xo(e);
98
+ e = n !== !1 && yo(e);
99
99
  } while (e && (!n || n(e, t)) && e !== Object.prototype);
100
100
  return t;
101
101
  }, Od = (e, t, n) => {
@@ -111,8 +111,8 @@ const Ad = (e, t, n, { allOwnKeys: r } = {}) => (dn(t, (o, s) => {
111
111
  for (; t-- > 0; )
112
112
  n[t] = e[t];
113
113
  return n;
114
- }, kd = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && xo(Uint8Array)), Dd = (e, t) => {
115
- const r = (e && e[Qn]).call(e);
114
+ }, kd = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && yo(Uint8Array)), Dd = (e, t) => {
115
+ const r = (e && e[Zn]).call(e);
116
116
  let o;
117
117
  for (; (o = r.next()) && !o.done; ) {
118
118
  const s = o.value;
@@ -124,14 +124,14 @@ const Ad = (e, t, n, { allOwnKeys: r } = {}) => (dn(t, (o, s) => {
124
124
  for (; (n = e.exec(t)) !== null; )
125
125
  r.push(n);
126
126
  return r;
127
- }, Fd = Ue("HTMLFormElement"), $d = (e) => e.toLowerCase().replace(
127
+ }, Fd = ze("HTMLFormElement"), $d = (e) => e.toLowerCase().replace(
128
128
  /[-_\s]([a-z\d])(\w*)/g,
129
129
  function(n, r, o) {
130
130
  return r.toUpperCase() + o;
131
131
  }
132
- ), fs = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Bd = Ue("RegExp"), Ra = (e, t) => {
132
+ ), fs = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Bd = ze("RegExp"), Ra = (e, t) => {
133
133
  const n = Object.getOwnPropertyDescriptors(e), r = {};
134
- dn(n, (o, s) => {
134
+ un(n, (o, s) => {
135
135
  let a;
136
136
  (a = t(o, s, e)) !== !1 && (r[s] = a || o);
137
137
  }), Object.defineProperties(e, r);
@@ -160,19 +160,19 @@ const Ad = (e, t, n, { allOwnKeys: r } = {}) => (dn(t, (o, s) => {
160
160
  }, Hd = () => {
161
161
  }, Wd = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
162
162
  function Vd(e) {
163
- return !!(e && Te(e.append) && e[ya] === "FormData" && e[Qn]);
163
+ return !!(e && Te(e.append) && e[ya] === "FormData" && e[Zn]);
164
164
  }
165
165
  const jd = (e) => {
166
166
  const t = new Array(10), n = (r, o) => {
167
- if (un(r)) {
167
+ if (ln(r)) {
168
168
  if (t.indexOf(r) >= 0)
169
169
  return;
170
- if (ln(r))
170
+ if (cn(r))
171
171
  return r;
172
172
  if (!("toJSON" in r)) {
173
173
  t[o] = r;
174
174
  const s = Ft(r) ? [] : {};
175
- return dn(r, (a, i) => {
175
+ return un(r, (a, i) => {
176
176
  const u = n(a, o + 1);
177
177
  !Ot(u) && (s[i] = u);
178
178
  }), t[o] = void 0, s;
@@ -181,24 +181,24 @@ const jd = (e) => {
181
181
  return r;
182
182
  };
183
183
  return n(e, 0);
184
- }, Kd = Ue("AsyncFunction"), Gd = (e) => e && (un(e) || Te(e)) && Te(e.then) && Te(e.catch), Na = ((e, t) => e ? setImmediate : t ? ((n, r) => (dt.addEventListener("message", ({ source: o, data: s }) => {
184
+ }, Kd = ze("AsyncFunction"), Gd = (e) => e && (ln(e) || Te(e)) && Te(e.then) && Te(e.catch), Na = ((e, t) => e ? setImmediate : t ? ((n, r) => (dt.addEventListener("message", ({ source: o, data: s }) => {
185
185
  o === dt && s === n && r.length && r.shift()();
186
186
  }, !1), (o) => {
187
187
  r.push(o), dt.postMessage(n, "*");
188
188
  }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
189
189
  typeof setImmediate == "function",
190
190
  Te(dt.postMessage)
191
- ), qd = typeof queueMicrotask < "u" ? queueMicrotask.bind(dt) : typeof process < "u" && process.nextTick || Na, Yd = (e) => e != null && Te(e[Qn]), S = {
191
+ ), qd = typeof queueMicrotask < "u" ? queueMicrotask.bind(dt) : typeof process < "u" && process.nextTick || Na, Yd = (e) => e != null && Te(e[Zn]), S = {
192
192
  isArray: Ft,
193
193
  isArrayBuffer: xa,
194
- isBuffer: ln,
194
+ isBuffer: cn,
195
195
  isFormData: xd,
196
196
  isArrayBufferView: fd,
197
197
  isString: pd,
198
198
  isNumber: Sa,
199
199
  isBoolean: hd,
200
- isObject: un,
201
- isPlainObject: Nn,
200
+ isObject: ln,
201
+ isPlainObject: Rn,
202
202
  isEmptyObject: md,
203
203
  isReadableStream: Cd,
204
204
  isRequest: Ed,
@@ -214,15 +214,15 @@ const jd = (e) => {
214
214
  isURLSearchParams: Sd,
215
215
  isTypedArray: kd,
216
216
  isFileList: wd,
217
- forEach: dn,
218
- merge: Gr,
217
+ forEach: un,
218
+ merge: Kr,
219
219
  extend: Ad,
220
220
  trim: Td,
221
221
  stripBOM: Pd,
222
222
  inherits: _d,
223
223
  toFlatObject: Id,
224
- kindOf: er,
225
- kindOfTest: Ue,
224
+ kindOf: Qn,
225
+ kindOfTest: ze,
226
226
  endsWith: Od,
227
227
  toArray: Md,
228
228
  forEachEntry: Dd,
@@ -301,7 +301,7 @@ ee.from = (e, t, n, r, o, s) => {
301
301
  return ee.call(a, i, u, n, r, o), e && a.cause == null && Object.defineProperty(a, "cause", { value: e, configurable: !0 }), a.name = e && e.name || "Error", s && Object.assign(a, s), a;
302
302
  };
303
303
  const Xd = null;
304
- function qr(e) {
304
+ function Gr(e) {
305
305
  return S.isPlainObject(e) || S.isArray(e);
306
306
  }
307
307
  function Pa(e) {
@@ -313,12 +313,12 @@ function ps(e, t, n) {
313
313
  }).join(n ? "." : "") : t;
314
314
  }
315
315
  function Jd(e) {
316
- return S.isArray(e) && !e.some(qr);
316
+ return S.isArray(e) && !e.some(Gr);
317
317
  }
318
318
  const Zd = S.toFlatObject(S, {}, null, function(t) {
319
319
  return /^is[A-Z]/.test(t);
320
320
  });
321
- function nr(e, t, n) {
321
+ function tr(e, t, n) {
322
322
  if (!S.isObject(e))
323
323
  throw new TypeError("target must be an object");
324
324
  t = t || new FormData(), n = S.toFlatObject(n, {
@@ -355,12 +355,12 @@ function nr(e, t, n) {
355
355
  );
356
356
  }), !1;
357
357
  }
358
- return qr(h) ? !0 : (t.append(ps(b, g, s), f(h)), !1);
358
+ return Gr(h) ? !0 : (t.append(ps(b, g, s), f(h)), !1);
359
359
  }
360
360
  const p = [], m = Object.assign(Zd, {
361
361
  defaultVisitor: d,
362
362
  convertValue: f,
363
- isVisitable: qr
363
+ isVisitable: Gr
364
364
  });
365
365
  function v(h, g) {
366
366
  if (!S.isUndefined(h)) {
@@ -395,10 +395,10 @@ function hs(e) {
395
395
  return t[r];
396
396
  });
397
397
  }
398
- function So(e, t) {
399
- this._pairs = [], e && nr(e, this, t);
398
+ function xo(e, t) {
399
+ this._pairs = [], e && tr(e, this, t);
400
400
  }
401
- const _a = So.prototype;
401
+ const _a = xo.prototype;
402
402
  _a.append = function(t, n) {
403
403
  this._pairs.push([t, n]);
404
404
  };
@@ -422,7 +422,7 @@ function Ia(e, t, n) {
422
422
  });
423
423
  const o = n && n.serialize;
424
424
  let s;
425
- if (o ? s = o(t, n) : s = S.isURLSearchParams(t) ? t.toString() : new So(t, n).toString(r), s) {
425
+ if (o ? s = o(t, n) : s = S.isURLSearchParams(t) ? t.toString() : new xo(t, n).toString(r), s) {
426
426
  const a = e.indexOf("#");
427
427
  a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
428
428
  }
@@ -486,7 +486,7 @@ const Oa = {
486
486
  silentJSONParsing: !0,
487
487
  forcedJSONParsing: !0,
488
488
  clarifyTimeoutError: !1
489
- }, ef = typeof URLSearchParams < "u" ? URLSearchParams : So, tf = typeof FormData < "u" ? FormData : null, nf = typeof Blob < "u" ? Blob : null, rf = {
489
+ }, ef = typeof URLSearchParams < "u" ? URLSearchParams : xo, tf = typeof FormData < "u" ? FormData : null, nf = typeof Blob < "u" ? Blob : null, rf = {
490
490
  isBrowser: !0,
491
491
  classes: {
492
492
  URLSearchParams: ef,
@@ -494,20 +494,20 @@ const Oa = {
494
494
  Blob: nf
495
495
  },
496
496
  protocols: ["http", "https", "file", "blob", "url", "data"]
497
- }, Co = typeof window < "u" && typeof document < "u", Yr = typeof navigator == "object" && navigator || void 0, of = Co && (!Yr || ["ReactNative", "NativeScript", "NS"].indexOf(Yr.product) < 0), sf = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
498
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", af = Co && window.location.href || "http://localhost", cf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
497
+ }, So = typeof window < "u" && typeof document < "u", qr = typeof navigator == "object" && navigator || void 0, of = So && (!qr || ["ReactNative", "NativeScript", "NS"].indexOf(qr.product) < 0), sf = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
498
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", af = So && window.location.href || "http://localhost", cf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
499
499
  __proto__: null,
500
- hasBrowserEnv: Co,
500
+ hasBrowserEnv: So,
501
501
  hasStandardBrowserEnv: of,
502
502
  hasStandardBrowserWebWorkerEnv: sf,
503
- navigator: Yr,
503
+ navigator: qr,
504
504
  origin: af
505
505
  }, Symbol.toStringTag, { value: "Module" })), ye = {
506
506
  ...cf,
507
507
  ...rf
508
508
  };
509
509
  function lf(e, t) {
510
- return nr(e, new ye.classes.URLSearchParams(), {
510
+ return tr(e, new ye.classes.URLSearchParams(), {
511
511
  visitor: function(n, r, o, s) {
512
512
  return ye.isNode && S.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
513
513
  },
@@ -551,7 +551,7 @@ function ff(e, t, n) {
551
551
  }
552
552
  return (n || JSON.stringify)(e);
553
553
  }
554
- const fn = {
554
+ const dn = {
555
555
  transitional: Oa,
556
556
  adapter: ["xhr", "http", "fetch"],
557
557
  transformRequest: [function(t, n) {
@@ -570,7 +570,7 @@ const fn = {
570
570
  return lf(t, this.formSerializer).toString();
571
571
  if ((i = S.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
572
572
  const u = this.env && this.env.FormData;
573
- return nr(
573
+ return tr(
574
574
  i ? { "files[]": t } : t,
575
575
  u && new u(),
576
576
  this.formSerializer
@@ -580,7 +580,7 @@ const fn = {
580
580
  return s || o ? (n.setContentType("application/json", !1), ff(t)) : t;
581
581
  }],
582
582
  transformResponse: [function(t) {
583
- const n = this.transitional || fn.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
583
+ const n = this.transitional || dn.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
584
584
  if (S.isResponse(t) || S.isReadableStream(t))
585
585
  return t;
586
586
  if (t && S.isString(t) && (r && !this.responseType || o)) {
@@ -618,7 +618,7 @@ const fn = {
618
618
  }
619
619
  };
620
620
  S.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
621
- fn.headers[e] = {};
621
+ dn.headers[e] = {};
622
622
  });
623
623
  const pf = S.toObjectSet([
624
624
  "age",
@@ -649,8 +649,8 @@ const pf = S.toObjectSet([
649
649
  function Wt(e) {
650
650
  return e && String(e).trim().toLowerCase();
651
651
  }
652
- function Tn(e) {
653
- return e === !1 || e == null ? e : S.isArray(e) ? e.map(Tn) : String(e);
652
+ function Nn(e) {
653
+ return e === !1 || e == null ? e : S.isArray(e) ? e.map(Nn) : String(e);
654
654
  }
655
655
  function mf(e) {
656
656
  const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
@@ -660,7 +660,7 @@ function mf(e) {
660
660
  return t;
661
661
  }
662
662
  const gf = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
663
- function Ar(e, t, n, r, o) {
663
+ function Tr(e, t, n, r, o) {
664
664
  if (S.isFunction(r))
665
665
  return r.call(this, t, n);
666
666
  if (o && (t = n), !!S.isString(t)) {
@@ -695,7 +695,7 @@ let Ae = class {
695
695
  if (!d)
696
696
  throw new Error("header name must be a non-empty string");
697
697
  const p = S.findKey(o, d);
698
- (!p || o[p] === void 0 || f === !0 || f === void 0 && o[p] !== !1) && (o[p || u] = Tn(i));
698
+ (!p || o[p] === void 0 || f === !0 || f === void 0 && o[p] !== !1) && (o[p || u] = Nn(i));
699
699
  }
700
700
  const a = (i, u) => S.forEach(i, (f, d) => s(f, d, u));
701
701
  if (S.isPlainObject(t) || t instanceof this.constructor)
@@ -734,7 +734,7 @@ let Ae = class {
734
734
  has(t, n) {
735
735
  if (t = Wt(t), t) {
736
736
  const r = S.findKey(this, t);
737
- return !!(r && this[r] !== void 0 && (!n || Ar(this, this[r], r, n)));
737
+ return !!(r && this[r] !== void 0 && (!n || Tr(this, this[r], r, n)));
738
738
  }
739
739
  return !1;
740
740
  }
@@ -744,7 +744,7 @@ let Ae = class {
744
744
  function s(a) {
745
745
  if (a = Wt(a), a) {
746
746
  const i = S.findKey(r, a);
747
- i && (!n || Ar(r, r[i], i, n)) && (delete r[i], o = !0);
747
+ i && (!n || Tr(r, r[i], i, n)) && (delete r[i], o = !0);
748
748
  }
749
749
  }
750
750
  return S.isArray(t) ? t.forEach(s) : s(t), o;
@@ -754,7 +754,7 @@ let Ae = class {
754
754
  let r = n.length, o = !1;
755
755
  for (; r--; ) {
756
756
  const s = n[r];
757
- (!t || Ar(this, this[s], s, t, !0)) && (delete this[s], o = !0);
757
+ (!t || Tr(this, this[s], s, t, !0)) && (delete this[s], o = !0);
758
758
  }
759
759
  return o;
760
760
  }
@@ -763,11 +763,11 @@ let Ae = class {
763
763
  return S.forEach(this, (o, s) => {
764
764
  const a = S.findKey(r, s);
765
765
  if (a) {
766
- n[a] = Tn(o), delete n[s];
766
+ n[a] = Nn(o), delete n[s];
767
767
  return;
768
768
  }
769
769
  const i = t ? bf(s) : String(s).trim();
770
- i !== s && delete n[s], n[i] = Tn(o), r[i] = !0;
770
+ i !== s && delete n[s], n[i] = Nn(o), r[i] = !0;
771
771
  }), this;
772
772
  }
773
773
  concat(...t) {
@@ -821,8 +821,8 @@ S.reduceDescriptors(Ae.prototype, ({ value: e }, t) => {
821
821
  };
822
822
  });
823
823
  S.freezeMethods(Ae);
824
- function Pr(e, t) {
825
- const n = this || fn, r = t || n, o = Ae.from(r.headers);
824
+ function Ar(e, t) {
825
+ const n = this || dn, r = t || n, o = Ae.from(r.headers);
826
826
  let s = r.data;
827
827
  return S.forEach(e, function(i) {
828
828
  s = i.call(n, s, o.normalize(), t ? t.status : void 0);
@@ -879,7 +879,7 @@ function xf(e, t) {
879
879
  }, r - p)));
880
880
  }, () => o && a(o)];
881
881
  }
882
- const Un = (e, t, n = 3) => {
882
+ const Bn = (e, t, n = 3) => {
883
883
  let r = 0;
884
884
  const o = yf(50, 250);
885
885
  return xf((s) => {
@@ -1079,7 +1079,7 @@ const Fa = (e) => {
1079
1079
  )), b = null;
1080
1080
  }, s === void 0 && a.setContentType(null), "setRequestHeader" in b && S.forEach(a.toJSON(), function(E, C) {
1081
1081
  b.setRequestHeader(C, E);
1082
- }), S.isUndefined(o.withCredentials) || (b.withCredentials = !!o.withCredentials), i && i !== "json" && (b.responseType = o.responseType), f && ([m, h] = Un(f, !0), b.addEventListener("progress", m)), u && b.upload && ([p, v] = Un(u), b.upload.addEventListener("progress", p), b.upload.addEventListener("loadend", v)), (o.cancelToken || o.signal) && (d = (x) => {
1082
+ }), S.isUndefined(o.withCredentials) || (b.withCredentials = !!o.withCredentials), i && i !== "json" && (b.responseType = o.responseType), f && ([m, h] = Bn(f, !0), b.addEventListener("progress", m)), u && b.upload && ([p, v] = Bn(u), b.upload.addEventListener("progress", p), b.upload.addEventListener("loadend", v)), (o.cancelToken || o.signal) && (d = (x) => {
1083
1083
  b && (r(!x || x.type ? new $t(null, e, b) : x), b.abort(), b = null);
1084
1084
  }, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
1085
1085
  const y = wf(o.url);
@@ -1169,7 +1169,7 @@ const Fa = (e) => {
1169
1169
  }, {
1170
1170
  highWaterMark: 2
1171
1171
  });
1172
- }, xs = 64 * 1024, { isFunction: vn } = S, Of = (({ Request: e, Response: t }) => ({
1172
+ }, xs = 64 * 1024, { isFunction: bn } = S, Of = (({ Request: e, Response: t }) => ({
1173
1173
  Request: e,
1174
1174
  Response: t
1175
1175
  }))(S.global), {
@@ -1185,10 +1185,10 @@ const Fa = (e) => {
1185
1185
  e = S.merge.call({
1186
1186
  skipUndefined: !0
1187
1187
  }, Of, e);
1188
- const { fetch: t, Request: n, Response: r } = e, o = t ? vn(t) : typeof fetch == "function", s = vn(n), a = vn(r);
1188
+ const { fetch: t, Request: n, Response: r } = e, o = t ? bn(t) : typeof fetch == "function", s = bn(n), a = bn(r);
1189
1189
  if (!o)
1190
1190
  return !1;
1191
- const i = o && vn(Ss), u = o && (typeof Cs == "function" ? /* @__PURE__ */ ((h) => (g) => h.encode(g))(new Cs()) : async (h) => new Uint8Array(await new n(h).arrayBuffer())), f = s && i && Es(() => {
1191
+ const i = o && bn(Ss), u = o && (typeof Cs == "function" ? /* @__PURE__ */ ((h) => (g) => h.encode(g))(new Cs()) : async (h) => new Uint8Array(await new n(h).arrayBuffer())), f = s && i && Es(() => {
1192
1192
  let h = !1;
1193
1193
  const g = new n(ye.origin, {
1194
1194
  body: new Ss(),
@@ -1258,7 +1258,7 @@ const Fa = (e) => {
1258
1258
  if (S.isFormData(w) && (Y = O.headers.get("content-type")) && D.setContentType(Y), O.body) {
1259
1259
  const [$, z] = bs(
1260
1260
  q,
1261
- Un(vs(I))
1261
+ Bn(vs(I))
1262
1262
  );
1263
1263
  w = ys(O.body, xs, $, z);
1264
1264
  }
@@ -1283,7 +1283,7 @@ const Fa = (e) => {
1283
1283
  });
1284
1284
  const Y = S.toFiniteNumber(T.headers.get("content-length")), [$, z] = C && bs(
1285
1285
  Y,
1286
- Un(vs(C), !0)
1286
+ Bn(vs(C), !0)
1287
1287
  ) || [];
1288
1288
  T = new r(
1289
1289
  ys(T.body, xs, $, () => {
@@ -1326,14 +1326,14 @@ const Fa = (e) => {
1326
1326
  return f;
1327
1327
  };
1328
1328
  $a();
1329
- const Xr = {
1329
+ const Yr = {
1330
1330
  http: Xd,
1331
1331
  xhr: Tf,
1332
1332
  fetch: {
1333
1333
  get: $a
1334
1334
  }
1335
1335
  };
1336
- S.forEach(Xr, (e, t) => {
1336
+ S.forEach(Yr, (e, t) => {
1337
1337
  if (e) {
1338
1338
  try {
1339
1339
  Object.defineProperty(e, "name", { value: t });
@@ -1351,7 +1351,7 @@ const Rs = (e) => `- ${e}`, Df = (e) => S.isFunction(e) || e === null || e === !
1351
1351
  for (let a = 0; a < n; a++) {
1352
1352
  r = e[a];
1353
1353
  let i;
1354
- if (o = r, !Df(r) && (o = Xr[(i = String(r)).toLowerCase()], o === void 0))
1354
+ if (o = r, !Df(r) && (o = Yr[(i = String(r)).toLowerCase()], o === void 0))
1355
1355
  throw new ee(`Unknown adapter '${i}'`);
1356
1356
  if (o && (S.isFunction(o) || (o = o.get(t))))
1357
1357
  break;
@@ -1371,38 +1371,38 @@ const Rs = (e) => `- ${e}`, Df = (e) => S.isFunction(e) || e === null || e === !
1371
1371
  }
1372
1372
  return o;
1373
1373
  },
1374
- adapters: Xr
1374
+ adapters: Yr
1375
1375
  };
1376
- function _r(e) {
1376
+ function Pr(e) {
1377
1377
  if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1378
1378
  throw new $t(null, e);
1379
1379
  }
1380
1380
  function Ns(e) {
1381
- return _r(e), e.headers = Ae.from(e.headers), e.data = Pr.call(
1381
+ return Pr(e), e.headers = Ae.from(e.headers), e.data = Ar.call(
1382
1382
  e,
1383
1383
  e.transformRequest
1384
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Ba.getAdapter(e.adapter || fn.adapter, e)(e).then(function(r) {
1385
- return _r(e), r.data = Pr.call(
1384
+ ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Ba.getAdapter(e.adapter || dn.adapter, e)(e).then(function(r) {
1385
+ return Pr(e), r.data = Ar.call(
1386
1386
  e,
1387
1387
  e.transformResponse,
1388
1388
  r
1389
1389
  ), r.headers = Ae.from(r.headers), r;
1390
1390
  }, function(r) {
1391
- return ka(r) || (_r(e), r && r.response && (r.response.data = Pr.call(
1391
+ return ka(r) || (Pr(e), r && r.response && (r.response.data = Ar.call(
1392
1392
  e,
1393
1393
  e.transformResponse,
1394
1394
  r.response
1395
1395
  ), r.response.headers = Ae.from(r.response.headers))), Promise.reject(r);
1396
1396
  });
1397
1397
  }
1398
- const Ua = "1.12.2", rr = {};
1398
+ const Ua = "1.12.2", nr = {};
1399
1399
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1400
- rr[e] = function(r) {
1400
+ nr[e] = function(r) {
1401
1401
  return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1402
1402
  };
1403
1403
  });
1404
1404
  const Ts = {};
1405
- rr.transitional = function(t, n, r) {
1405
+ nr.transitional = function(t, n, r) {
1406
1406
  function o(s, a) {
1407
1407
  return "[Axios v" + Ua + "] Transitional option '" + s + "'" + a + (r ? ". " + r : "");
1408
1408
  }
@@ -1420,7 +1420,7 @@ rr.transitional = function(t, n, r) {
1420
1420
  )), t ? t(s, a, i) : !0;
1421
1421
  };
1422
1422
  };
1423
- rr.spelling = function(t) {
1423
+ nr.spelling = function(t) {
1424
1424
  return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
1425
1425
  };
1426
1426
  function Lf(e, t, n) {
@@ -1440,10 +1440,10 @@ function Lf(e, t, n) {
1440
1440
  throw new ee("Unknown option " + s, ee.ERR_BAD_OPTION);
1441
1441
  }
1442
1442
  }
1443
- const An = {
1443
+ const Tn = {
1444
1444
  assertOptions: Lf,
1445
- validators: rr
1446
- }, We = An.validators;
1445
+ validators: nr
1446
+ }, Ve = Tn.validators;
1447
1447
  let pt = class {
1448
1448
  constructor(t) {
1449
1449
  this.defaults = t || {}, this.interceptors = {
@@ -1479,18 +1479,18 @@ let pt = class {
1479
1479
  _request(t, n) {
1480
1480
  typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = ht(this.defaults, n);
1481
1481
  const { transitional: r, paramsSerializer: o, headers: s } = n;
1482
- r !== void 0 && An.assertOptions(r, {
1483
- silentJSONParsing: We.transitional(We.boolean),
1484
- forcedJSONParsing: We.transitional(We.boolean),
1485
- clarifyTimeoutError: We.transitional(We.boolean)
1482
+ r !== void 0 && Tn.assertOptions(r, {
1483
+ silentJSONParsing: Ve.transitional(Ve.boolean),
1484
+ forcedJSONParsing: Ve.transitional(Ve.boolean),
1485
+ clarifyTimeoutError: Ve.transitional(Ve.boolean)
1486
1486
  }, !1), o != null && (S.isFunction(o) ? n.paramsSerializer = {
1487
1487
  serialize: o
1488
- } : An.assertOptions(o, {
1489
- encode: We.function,
1490
- serialize: We.function
1491
- }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), An.assertOptions(n, {
1492
- baseUrl: We.spelling("baseURL"),
1493
- withXsrfToken: We.spelling("withXSRFToken")
1488
+ } : Tn.assertOptions(o, {
1489
+ encode: Ve.function,
1490
+ serialize: Ve.function
1491
+ }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), Tn.assertOptions(n, {
1492
+ baseUrl: Ve.spelling("baseURL"),
1493
+ withXsrfToken: Ve.spelling("withXSRFToken")
1494
1494
  }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1495
1495
  let a = s && S.merge(
1496
1496
  s.common,
@@ -1649,7 +1649,7 @@ function $f(e) {
1649
1649
  function Bf(e) {
1650
1650
  return S.isObject(e) && e.isAxiosError === !0;
1651
1651
  }
1652
- const Jr = {
1652
+ const Xr = {
1653
1653
  Continue: 100,
1654
1654
  SwitchingProtocols: 101,
1655
1655
  Processing: 102,
@@ -1714,8 +1714,8 @@ const Jr = {
1714
1714
  NotExtended: 510,
1715
1715
  NetworkAuthenticationRequired: 511
1716
1716
  };
1717
- Object.entries(Jr).forEach(([e, t]) => {
1718
- Jr[t] = e;
1717
+ Object.entries(Xr).forEach(([e, t]) => {
1718
+ Xr[t] = e;
1719
1719
  });
1720
1720
  function Ha(e) {
1721
1721
  const t = new pt(e), n = wa(pt.prototype.request, t);
@@ -1723,13 +1723,13 @@ function Ha(e) {
1723
1723
  return Ha(ht(e, o));
1724
1724
  }, n;
1725
1725
  }
1726
- const he = Ha(fn);
1726
+ const he = Ha(dn);
1727
1727
  he.Axios = pt;
1728
1728
  he.CanceledError = $t;
1729
1729
  he.CancelToken = Ff;
1730
1730
  he.isCancel = ka;
1731
1731
  he.VERSION = Ua;
1732
- he.toFormData = nr;
1732
+ he.toFormData = tr;
1733
1733
  he.AxiosError = ee;
1734
1734
  he.Cancel = he.CanceledError;
1735
1735
  he.all = function(t) {
@@ -1741,7 +1741,7 @@ he.mergeConfig = ht;
1741
1741
  he.AxiosHeaders = Ae;
1742
1742
  he.formToJSON = (e) => Ma(S.isHTMLForm(e) ? new FormData(e) : e);
1743
1743
  he.getAdapter = Ba.getAdapter;
1744
- he.HttpStatusCode = Jr;
1744
+ he.HttpStatusCode = Xr;
1745
1745
  he.default = he;
1746
1746
  const {
1747
1747
  Axios: sy,
@@ -1769,57 +1769,57 @@ function ft() {
1769
1769
  return !1;
1770
1770
  }
1771
1771
  }
1772
- const en = At == null ? void 0 : At.VITE_API_BASE_URL, As = At == null ? void 0 : At.VITE_AUTH_TOKEN;
1773
- if (!en)
1774
- throw new Error("VITE_API_BASE_URL is not set. Add it to your .env (e.g., http://localhost:8000)");
1775
- const Zr = "auth_token";
1776
- let zn = (() => {
1772
+ const Co = At == null ? void 0 : At.VITE_API_BASE_URL, As = At == null ? void 0 : At.VITE_AUTH_TOKEN;
1773
+ !Co && typeof window < "u" && console.warn("VITE_API_BASE_URL is not set. The API client will need to be configured via apiConfig prop.");
1774
+ const Jr = "auth_token";
1775
+ let Un = (() => {
1777
1776
  try {
1778
- return (typeof localStorage < "u" ? localStorage.getItem(Zr) : null) || As || null;
1777
+ return (typeof localStorage < "u" ? localStorage.getItem(Jr) : null) || As || null;
1779
1778
  } catch {
1780
1779
  return As || null;
1781
1780
  }
1782
1781
  })();
1783
- const Qr = /* @__PURE__ */ new Set();
1782
+ const Zr = /* @__PURE__ */ new Set();
1784
1783
  function Wa() {
1785
- return zn;
1784
+ return Un;
1786
1785
  }
1787
- function eo(e) {
1788
- zn = e;
1786
+ function Qr(e) {
1787
+ Un = e;
1789
1788
  try {
1790
- typeof localStorage < "u" && (e ? localStorage.setItem(Zr, e) : localStorage.removeItem(Zr));
1789
+ typeof localStorage < "u" && (e ? localStorage.setItem(Jr, e) : localStorage.removeItem(Jr));
1791
1790
  } catch {
1792
1791
  }
1793
- Qr.forEach((t) => t(e));
1792
+ Zr.forEach((t) => t(e));
1794
1793
  }
1795
1794
  function Uf(e) {
1796
- return Qr.add(e), () => Qr.delete(e);
1795
+ return Zr.add(e), () => Zr.delete(e);
1797
1796
  }
1798
- const rt = he.create({
1799
- baseURL: en,
1797
+ const ke = he.create({
1798
+ baseURL: Co || "http://localhost:8000",
1799
+ // Fallback base URL
1800
1800
  timeout: 3e4,
1801
1801
  withCredentials: !0
1802
1802
  });
1803
- rt.interceptors.request.use((e) => (zn && (e.headers.Authorization = `Bearer ${zn}`), e));
1804
- let Ir = !1, Vt = [];
1803
+ ke.interceptors.request.use((e) => (Un && (e.headers.Authorization = `Bearer ${Un}`), e));
1804
+ let _r = !1, Vt = [];
1805
1805
  async function zf() {
1806
- if (Ir)
1806
+ if (_r)
1807
1807
  return new Promise((e) => Vt.push(e));
1808
- Ir = !0;
1808
+ _r = !0;
1809
1809
  try {
1810
1810
  const { data: e } = await he.post(
1811
- `${en}/auth/refresh`,
1811
+ `${Co || ke.defaults.baseURL}/auth/refresh`,
1812
1812
  {},
1813
1813
  { withCredentials: !0, timeout: 3e4 }
1814
1814
  ), t = (e == null ? void 0 : e.accessToken) ?? null;
1815
- return eo(t), Vt.forEach((n) => n(t)), Vt = [], t;
1815
+ return Qr(t), Vt.forEach((n) => n(t)), Vt = [], t;
1816
1816
  } catch {
1817
- return eo(null), Vt.forEach((t) => t(null)), Vt = [], null;
1817
+ return Qr(null), Vt.forEach((t) => t(null)), Vt = [], null;
1818
1818
  } finally {
1819
- Ir = !1;
1819
+ _r = !1;
1820
1820
  }
1821
1821
  }
1822
- rt.interceptors.response.use(
1822
+ ke.interceptors.response.use(
1823
1823
  (e) => e,
1824
1824
  async (e) => {
1825
1825
  var n;
@@ -1828,22 +1828,22 @@ rt.interceptors.response.use(
1828
1828
  t._retry = !0;
1829
1829
  const r = await zf();
1830
1830
  if (r && t)
1831
- return t.headers.Authorization = `Bearer ${r}`, rt(t);
1831
+ return t.headers.Authorization = `Bearer ${r}`, ke(t);
1832
1832
  }
1833
1833
  return Promise.reject(e);
1834
1834
  }
1835
1835
  );
1836
1836
  async function lt(e, t) {
1837
- return (await rt.get(e, t)).data;
1837
+ return (await ke.get(e, t)).data;
1838
1838
  }
1839
1839
  async function jt(e, t, n) {
1840
- return (await rt.post(e, t, n)).data;
1840
+ return (await ke.post(e, t, n)).data;
1841
1841
  }
1842
1842
  async function Hf(e, t, n) {
1843
- return (await rt.put(e, t, n)).data;
1843
+ return (await ke.put(e, t, n)).data;
1844
1844
  }
1845
1845
  async function Wf(e, t) {
1846
- return (await rt.delete(e, t)).data;
1846
+ return (await ke.delete(e, t)).data;
1847
1847
  }
1848
1848
  async function Vf(e, t) {
1849
1849
  var p;
@@ -1855,9 +1855,9 @@ async function Vf(e, t) {
1855
1855
  (p = v == null ? void 0 : v.payload) != null && p.files_info && Array.isArray(v.payload.files_info) && (v.payload.files_info = v.payload.files_info.map((h) => ({ ...h, data: h != null && h.data ? `<base64 ${String(h.data).length} chars>` : h == null ? void 0 : h.data }))), m = v;
1856
1856
  } catch {
1857
1857
  }
1858
- console.debug("[api.stream]", n, `${en}${e}`, m);
1858
+ console.debug("[api.stream]", n, `${ke.defaults.baseURL}${e}`, m);
1859
1859
  }
1860
- const u = await fetch(`${en}${e.startsWith("/") ? "" : "/"}${e}`, {
1860
+ const u = await fetch(`${ke.defaults.baseURL}${e.startsWith("/") ? "" : "/"}${e}`, {
1861
1861
  method: n,
1862
1862
  headers: {
1863
1863
  "Content-Type": "application/json",
@@ -1886,14 +1886,17 @@ function Ne(e) {
1886
1886
  class Eo {
1887
1887
  // ---- Configuration ----
1888
1888
  get baseUrl() {
1889
- return rt.defaults.baseURL || "";
1889
+ return ke.defaults.baseURL || "";
1890
+ }
1891
+ updateConfig(t) {
1892
+ t.baseUrl && (ke.defaults.baseURL = t.baseUrl), t.authToken !== void 0 && this.setAuthToken(t.authToken);
1890
1893
  }
1891
1894
  // ---- Authentication ----
1892
1895
  getAuthToken() {
1893
1896
  return Wa();
1894
1897
  }
1895
1898
  setAuthToken(t) {
1896
- eo(t);
1899
+ Qr(t);
1897
1900
  }
1898
1901
  onTokenChange(t) {
1899
1902
  return Uf(t);
@@ -1921,28 +1924,28 @@ class Eo {
1921
1924
  }
1922
1925
  // ---- Thread Management ----
1923
1926
  async listThreads() {
1924
- const t = await lt("/threads"), n = Ne(t);
1927
+ const t = await lt("/chat/threads"), n = Ne(t);
1925
1928
  return (n == null ? void 0 : n.items) ?? (t == null ? void 0 : t.items) ?? [];
1926
1929
  }
1927
1930
  async createThread(t) {
1928
- const r = await jt("/threads", t ? { title: t } : void 0);
1931
+ const r = await jt("/chat/threads", t ? { title: t } : void 0);
1929
1932
  return Ne(r);
1930
1933
  }
1931
1934
  async updateThread(t, n) {
1932
- const r = await Hf(`/threads/${t}`, { title: n });
1935
+ const r = await Hf(`/chat/threads/${t}`, { title: n });
1933
1936
  return Ne(r);
1934
1937
  }
1935
1938
  async deleteThread(t) {
1936
- const n = await Wf(`/threads/${t}`);
1939
+ const n = await Wf(`/chat/threads/${t}`);
1937
1940
  return Ne(n);
1938
1941
  }
1939
1942
  async threadInfo(t) {
1940
- const n = await lt(`/threads/${t}/info`);
1943
+ const n = await lt(`/chat/threads/${t}/info`);
1941
1944
  return Ne(n);
1942
1945
  }
1943
1946
  // ---- Messages & State ----
1944
1947
  async getMessages(t) {
1945
- const n = await lt("/messages", {
1948
+ const n = await lt("/chat/messages", {
1946
1949
  params: {
1947
1950
  thread_id: t.threadId,
1948
1951
  checkpoint_id: t.checkpointId,
@@ -1952,7 +1955,7 @@ class Eo {
1952
1955
  return Ne(n);
1953
1956
  }
1954
1957
  async getState(t) {
1955
- const n = await lt("/state", {
1958
+ const n = await lt("/chat/state", {
1956
1959
  params: {
1957
1960
  thread_id: t.threadId,
1958
1961
  checkpoint_id: t.checkpointId,
@@ -1962,7 +1965,7 @@ class Eo {
1962
1965
  return Ne(n);
1963
1966
  }
1964
1967
  async getStateHistory(t) {
1965
- const n = await lt("/state/history", {
1968
+ const n = await lt("/chat/state/history", {
1966
1969
  params: {
1967
1970
  thread_id: t.threadId,
1968
1971
  checkpoint_id: t.checkpointId,
@@ -1973,7 +1976,7 @@ class Eo {
1973
1976
  }
1974
1977
  // ---- Checkpoints ----
1975
1978
  async listCheckpoints(t) {
1976
- const n = await lt("/checkpoints", {
1979
+ const n = await lt("/chat/checkpoints", {
1977
1980
  params: { thread_id: t }
1978
1981
  });
1979
1982
  return Ne(n);
@@ -1999,7 +2002,7 @@ class Eo {
1999
2002
  async streamChat(t, n, r) {
2000
2003
  var o;
2001
2004
  try {
2002
- await Vf("/stream", {
2005
+ await Vf("/chat/stream", {
2003
2006
  method: "POST",
2004
2007
  body: t,
2005
2008
  onChunk: (s) => {
@@ -2025,7 +2028,7 @@ class Eo {
2025
2028
  }
2026
2029
  const mt = new Eo(), xy = Eo, Sy = Eo;
2027
2030
  function jf(e = {}) {
2028
- const t = e.baseUrl ?? "/api", n = e.streamPath ?? "/stream", [r, o] = ce(e.token ?? null), s = nt(e.headers ?? {}), [a, i] = ce(!1), [u, f] = ce(null), [d, p] = ce(""), [m, v] = ce(null), h = nt(null), g = Se((x) => {
2031
+ const t = e.baseUrl ?? "/api", n = e.streamPath ?? "/stream", [r, o] = ce(e.token ?? null), s = rt(e.headers ?? {}), [a, i] = ce(!1), [u, f] = ce(null), [d, p] = ce(""), [m, v] = ce(null), h = rt(null), g = Se((x) => {
2029
2032
  o(x);
2030
2033
  }, []), b = Se(() => {
2031
2034
  var x;
@@ -2132,7 +2135,7 @@ function jf(e = {}) {
2132
2135
  },
2133
2136
  [t, r, e.autoAppendAssistant]
2134
2137
  );
2135
- return we(() => () => {
2138
+ return ve(() => () => {
2136
2139
  var x;
2137
2140
  return (x = h.current) == null ? void 0 : x.abort();
2138
2141
  }, []), {
@@ -2202,15 +2205,15 @@ function Yf(e, t) {
2202
2205
  return { ...e, assemblingId: s, messages: [...e.messages, i] };
2203
2206
  }
2204
2207
  if (o.type === "token") {
2205
- const s = e.assemblingId ?? Or(e.messages);
2208
+ const s = e.assemblingId ?? Ir(e.messages);
2206
2209
  return s ? { ...e, messages: Jf(e.messages, s, o.content) } : e;
2207
2210
  }
2208
2211
  if (o.type === "message_delta") {
2209
- const s = e.assemblingId ?? Or(e.messages);
2212
+ const s = e.assemblingId ?? Ir(e.messages);
2210
2213
  return s ? { ...e, messages: _s(e.messages, s, o.delta) } : e;
2211
2214
  }
2212
2215
  if (o.type === "message_end") {
2213
- const s = e.assemblingId ?? Or(e.messages);
2216
+ const s = e.assemblingId ?? Ir(e.messages);
2214
2217
  if (!s) return { ...e, assemblingId: null };
2215
2218
  const a = e.messages, i = a.findIndex((u) => u.id === s && u.role === "assistant");
2216
2219
  if (i >= 0 && !((r = a[i].content) == null ? void 0 : r.some((d) => {
@@ -2262,7 +2265,7 @@ function Yf(e, t) {
2262
2265
  function Xf(e = []) {
2263
2266
  const [t, n] = Bu(Yf, { ...qf, messages: e }), r = Se((s) => {
2264
2267
  n({ type: "event", payload: { ev: s } });
2265
- }, []), o = tt(() => ({
2268
+ }, []), o = nt(() => ({
2266
2269
  reset: (s) => n({ type: "reset", payload: { messages: s } }),
2267
2270
  seed: (s) => n({ type: "seed", payload: { messages: s } }),
2268
2271
  pushUser: (s) => n({ type: "user_message", payload: { message: s } }),
@@ -2282,7 +2285,7 @@ function Ps(e) {
2282
2285
  return !!(n || r);
2283
2286
  });
2284
2287
  }
2285
- function Or(e) {
2288
+ function Ir(e) {
2286
2289
  for (let t = e.length - 1; t >= 0; t--)
2287
2290
  if (e[t].role === "assistant") return e[t].id;
2288
2291
  return null;
@@ -2321,8 +2324,15 @@ function ep(e) {
2321
2324
  return t[t.length - 1] || null;
2322
2325
  }
2323
2326
  const Va = pa(null);
2324
- function Pn({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialThreadId: o = null }) {
2325
- const s = mt, { isStreaming: a, error: i, stream: u, stop: f, setToken: d } = jf({
2327
+ function An({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialThreadId: o = null }) {
2328
+ const s = mt;
2329
+ ve(() => {
2330
+ t && s.updateConfig({
2331
+ baseUrl: t.baseUrl,
2332
+ authToken: t.apiKey
2333
+ });
2334
+ }, [s, t]);
2335
+ const { isStreaming: a, error: i, stream: u, stop: f, setToken: d } = jf({
2326
2336
  baseUrl: s.baseUrl,
2327
2337
  token: null,
2328
2338
  // we update with setStreamToken below when the API tells us the token
@@ -2330,7 +2340,7 @@ function Pn({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2330
2340
  // any extra headers caller wants
2331
2341
  streamPath: "/stream"
2332
2342
  }), [p, m] = ce(() => typeof s.getAuthToken == "function" ? s.getAuthToken() : null);
2333
- we(() => {
2343
+ ve(() => {
2334
2344
  d(typeof s.getAuthToken == "function" ? s.getAuthToken() : null);
2335
2345
  const _ = s.onTokenChange((O) => {
2336
2346
  m(O), d(O);
@@ -2345,18 +2355,18 @@ function Pn({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2345
2355
  const _ = await s.listThreads();
2346
2356
  E(_);
2347
2357
  }, [s]);
2348
- we(() => {
2358
+ ve(() => {
2349
2359
  R().catch(() => {
2350
2360
  });
2351
- }, [R]), we(() => {
2361
+ }, [R]), ve(() => {
2352
2362
  r == null || r(C);
2353
2363
  }, [C, r]);
2354
- const D = nt(null);
2355
- we(() => {
2364
+ const D = rt(null);
2365
+ ve(() => {
2356
2366
  o && D.current !== o && (D.current = o, k(o).catch(() => {
2357
2367
  }));
2358
2368
  }, [o]);
2359
- const M = nt(null), k = Se(
2369
+ const M = rt(null), k = Se(
2360
2370
  async (_, O, Y) => {
2361
2371
  var $;
2362
2372
  if (M.current !== _) {
@@ -2377,8 +2387,8 @@ function Pn({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2377
2387
  }, [s, C, g]), W = Se(async () => {
2378
2388
  if (!C) throw new Error("No active thread");
2379
2389
  await k(C);
2380
- }, [C, k]), B = nt(!1);
2381
- we(() => {
2390
+ }, [C, k]), B = rt(!1);
2391
+ ve(() => {
2382
2392
  const _ = B.current;
2383
2393
  if (B.current = a, _ && !a && C) {
2384
2394
  const O = h.lastCheckpointId ?? void 0;
@@ -2512,7 +2522,7 @@ function ja() {
2512
2522
  function A(...e) {
2513
2523
  return id(ad(e));
2514
2524
  }
2515
- const tp = cn(
2525
+ const tp = an(
2516
2526
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
2517
2527
  {
2518
2528
  variants: {
@@ -2561,7 +2571,7 @@ const Ka = l.forwardRef(
2561
2571
  )
2562
2572
  );
2563
2573
  Ka.displayName = "Textarea";
2564
- const np = cn(
2574
+ const np = an(
2565
2575
  "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
2566
2576
  {
2567
2577
  variants: {
@@ -2600,7 +2610,7 @@ function rp(e, t) {
2600
2610
  }
2601
2611
  return [r, o];
2602
2612
  }
2603
- function ze(e, t = []) {
2613
+ function He(e, t = []) {
2604
2614
  let n = [];
2605
2615
  function r(s, a) {
2606
2616
  const i = l.createContext(a), u = n.length;
@@ -2750,7 +2760,7 @@ var cp = [
2750
2760
  return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
2751
2761
  }, {});
2752
2762
  function qa(e, t) {
2753
- e && Zn.flushSync(() => e.dispatchEvent(t));
2763
+ e && Jn.flushSync(() => e.dispatchEvent(t));
2754
2764
  }
2755
2765
  function lp(e, t) {
2756
2766
  return l.useReducer((n, r) => t[n][r] ?? n, e);
@@ -2775,19 +2785,19 @@ function up(e) {
2775
2785
  }
2776
2786
  });
2777
2787
  return l.useEffect(() => {
2778
- const f = wn(r.current);
2788
+ const f = vn(r.current);
2779
2789
  s.current = i === "mounted" ? f : "none";
2780
2790
  }, [i]), be(() => {
2781
2791
  const f = r.current, d = o.current;
2782
2792
  if (d !== e) {
2783
- const m = s.current, v = wn(f);
2793
+ const m = s.current, v = vn(f);
2784
2794
  e ? u("MOUNT") : v === "none" || (f == null ? void 0 : f.display) === "none" ? u("UNMOUNT") : u(d && m !== v ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
2785
2795
  }
2786
2796
  }, [e, u]), be(() => {
2787
2797
  if (t) {
2788
2798
  let f;
2789
2799
  const d = t.ownerDocument.defaultView ?? window, p = (v) => {
2790
- const g = wn(r.current).includes(CSS.escape(v.animationName));
2800
+ const g = vn(r.current).includes(CSS.escape(v.animationName));
2791
2801
  if (v.target === t && g && (u("ANIMATION_END"), !o.current)) {
2792
2802
  const b = t.style.animationFillMode;
2793
2803
  t.style.animationFillMode = "forwards", f = d.setTimeout(() => {
@@ -2795,7 +2805,7 @@ function up(e) {
2795
2805
  });
2796
2806
  }
2797
2807
  }, m = (v) => {
2798
- v.target === t && (s.current = wn(r.current));
2808
+ v.target === t && (s.current = vn(r.current));
2799
2809
  };
2800
2810
  return t.addEventListener("animationstart", m), t.addEventListener("animationcancel", p), t.addEventListener("animationend", p), () => {
2801
2811
  d.clearTimeout(f), t.removeEventListener("animationstart", m), t.removeEventListener("animationcancel", p), t.removeEventListener("animationend", p);
@@ -2809,7 +2819,7 @@ function up(e) {
2809
2819
  }, [])
2810
2820
  };
2811
2821
  }
2812
- function wn(e) {
2822
+ function vn(e) {
2813
2823
  return (e == null ? void 0 : e.animationName) || "none";
2814
2824
  }
2815
2825
  function dp(e) {
@@ -2819,13 +2829,13 @@ function dp(e) {
2819
2829
  }
2820
2830
  var fp = l[" useId ".trim().toString()] || (() => {
2821
2831
  }), pp = 0;
2822
- function Fe(e) {
2832
+ function $e(e) {
2823
2833
  const [t, n] = l.useState(fp());
2824
2834
  return be(() => {
2825
2835
  n((r) => r ?? String(pp++));
2826
2836
  }, [e]), t ? `radix-${t}` : "";
2827
2837
  }
2828
- var or = "Collapsible", [hp, Cy] = ze(or), [mp, No] = hp(or), Ya = l.forwardRef(
2838
+ var rr = "Collapsible", [hp, Cy] = He(rr), [mp, No] = hp(rr), Ya = l.forwardRef(
2829
2839
  (e, t) => {
2830
2840
  const {
2831
2841
  __scopeCollapsible: n,
@@ -2838,14 +2848,14 @@ var or = "Collapsible", [hp, Cy] = ze(or), [mp, No] = hp(or), Ya = l.forwardRef(
2838
2848
  prop: r,
2839
2849
  defaultProp: o ?? !1,
2840
2850
  onChange: a,
2841
- caller: or
2851
+ caller: rr
2842
2852
  });
2843
2853
  return /* @__PURE__ */ c(
2844
2854
  mp,
2845
2855
  {
2846
2856
  scope: n,
2847
2857
  disabled: s,
2848
- contentId: Fe(),
2858
+ contentId: $e(),
2849
2859
  open: u,
2850
2860
  onOpenToggle: l.useCallback(() => f((d) => !d), [f]),
2851
2861
  children: /* @__PURE__ */ c(
@@ -2861,7 +2871,7 @@ var or = "Collapsible", [hp, Cy] = ze(or), [mp, No] = hp(or), Ya = l.forwardRef(
2861
2871
  );
2862
2872
  }
2863
2873
  );
2864
- Ya.displayName = or;
2874
+ Ya.displayName = rr;
2865
2875
  var Xa = "CollapsibleTrigger", Ja = l.forwardRef(
2866
2876
  (e, t) => {
2867
2877
  const { __scopeCollapsible: n, ...r } = e, o = No(Xa, n);
@@ -2927,7 +2937,7 @@ function Ao(e) {
2927
2937
  }
2928
2938
  var vp = Ya;
2929
2939
  const Os = vp, Ms = Ja;
2930
- function yn({ content: e, className: t = "" }) {
2940
+ function wn({ content: e, className: t = "" }) {
2931
2941
  return /* @__PURE__ */ c("div", { className: `prose prose-sm max-w-none dark:prose-invert prose-pre:rounded prose-pre:border prose-pre:bg-background/50 prose-code:bg-background/50 prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-table:my-4 prose-th:px-2 prose-td:px-2 leading-relaxed ${t}`, children: /* @__PURE__ */ c(
2932
2942
  ld,
2933
2943
  {
@@ -2975,7 +2985,7 @@ function wp({
2975
2985
  onCancelEdit: D,
2976
2986
  onCopy: M
2977
2987
  }) {
2978
- const [k, j] = ce(!1), [K, W] = ce(!1), [B, q] = ce(!1), [L, G] = ce(!1), T = u === "phone" || u === "half-screen", P = e.role, _ = P === "tool", O = tt(() => yp(e.content), [e.content]), Y = tt(() => Np(e.content), [e.content]), $ = tt(() => e.content.filter((X) => X.type === "image_url"), [e.content]), z = tt(() => e.content.filter((X) => X.type === "file"), [e.content]), le = Pp(O, n ? r : 0), se = async () => {
2988
+ const [k, j] = ce(!1), [K, W] = ce(!1), [B, q] = ce(!1), [L, G] = ce(!1), T = u === "phone" || u === "half-screen", P = e.role, _ = P === "tool", O = nt(() => yp(e.content), [e.content]), Y = nt(() => Np(e.content), [e.content]), $ = nt(() => e.content.filter((X) => X.type === "image_url"), [e.content]), z = nt(() => e.content.filter((X) => X.type === "file"), [e.content]), le = Pp(O, n ? r : 0), se = async () => {
2979
2989
  try {
2980
2990
  const X = _ ? Kt(e.content) : O;
2981
2991
  await navigator.clipboard.writeText(X), j(!0), setTimeout(() => j(!1), 2e3), M == null || M(X);
@@ -3046,10 +3056,10 @@ function wp({
3046
3056
  const ae = Kt(e.content), me = ae.length > d;
3047
3057
  return /* @__PURE__ */ c(Os, { open: K, onOpenChange: W, children: /* @__PURE__ */ N("div", { className: "font-mono text-sm", children: [
3048
3058
  /* @__PURE__ */ c("pre", { className: A("whitespace-pre-wrap break-words", T && "text-xs"), children: me && !K ? ae.substring(0, d) + "..." : ae }),
3049
- me && /* @__PURE__ */ c(Ms, { asChild: !0, children: /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", className: "h-6 text-xs", children: K ? /* @__PURE__ */ N(Le, { children: [
3059
+ me && /* @__PURE__ */ c(Ms, { asChild: !0, children: /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", className: "h-6 text-xs", children: K ? /* @__PURE__ */ N(Fe, { children: [
3050
3060
  /* @__PURE__ */ c(Gt, { className: "h-3 w-3 mr-1" }),
3051
3061
  "Show less"
3052
- ] }) : /* @__PURE__ */ N(Le, { children: [
3062
+ ] }) : /* @__PURE__ */ N(Fe, { children: [
3053
3063
  /* @__PURE__ */ c(Tt, { className: "h-3 w-3 mr-1" }),
3054
3064
  "Show more (",
3055
3065
  ae.length - d,
@@ -3060,7 +3070,7 @@ function wp({
3060
3070
  if (_ && B && !f) {
3061
3071
  const ae = Rp(e.content);
3062
3072
  if (ae && xp(ae))
3063
- return /* @__PURE__ */ c(yn, { content: ae.trim() });
3073
+ return /* @__PURE__ */ c(wn, { content: ae.trim() });
3064
3074
  const me = Kt(e.content);
3065
3075
  return /* @__PURE__ */ c("div", { className: "font-mono text-sm", children: /* @__PURE__ */ c("pre", { className: A("whitespace-pre-wrap break-words", T && "text-xs"), children: me }) });
3066
3076
  }
@@ -3069,7 +3079,7 @@ function wp({
3069
3079
  n ? /* @__PURE__ */ N("div", { className: "relative", children: [
3070
3080
  (() => {
3071
3081
  const ae = ks(le);
3072
- return ae !== null ? /* @__PURE__ */ c(Ds, { data: ae }) : /* @__PURE__ */ c(yn, { content: Cp(Sp(le)) });
3082
+ return ae !== null ? /* @__PURE__ */ c(Ds, { data: ae }) : /* @__PURE__ */ c(wn, { content: Cp(Sp(le)) });
3073
3083
  })(),
3074
3084
  /* @__PURE__ */ c("span", { className: "inline-block w-[6px] h-[14px] align-baseline ml-0.5 bg-foreground/40 animate-pulse", style: { verticalAlign: "text-bottom" } })
3075
3085
  ] }) : (() => {
@@ -3079,14 +3089,14 @@ function wp({
3079
3089
  const me = O.trim();
3080
3090
  if (me.length > m)
3081
3091
  return /* @__PURE__ */ N(Os, { open: L, onOpenChange: G, children: [
3082
- /* @__PURE__ */ c("div", { className: A("text-sm", T && "text-xs"), children: L ? /* @__PURE__ */ c(yn, { content: me }) : /* @__PURE__ */ N("pre", { className: A("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0", T && "text-xs"), children: [
3092
+ /* @__PURE__ */ c("div", { className: A("text-sm", T && "text-xs"), children: L ? /* @__PURE__ */ c(wn, { content: me }) : /* @__PURE__ */ N("pre", { className: A("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0", T && "text-xs"), children: [
3083
3093
  me.substring(0, m),
3084
3094
  "..."
3085
3095
  ] }) }),
3086
- /* @__PURE__ */ c(Ms, { asChild: !0, children: /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", className: "h-6 text-xs", children: L ? /* @__PURE__ */ N(Le, { children: [
3096
+ /* @__PURE__ */ c(Ms, { asChild: !0, children: /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", className: "h-6 text-xs", children: L ? /* @__PURE__ */ N(Fe, { children: [
3087
3097
  /* @__PURE__ */ c(Gt, { className: "h-3 w-3 mr-1" }),
3088
3098
  " Show less"
3089
- ] }) : /* @__PURE__ */ N(Le, { children: [
3099
+ ] }) : /* @__PURE__ */ N(Fe, { children: [
3090
3100
  /* @__PURE__ */ c(Tt, { className: "h-3 w-3 mr-1" }),
3091
3101
  " Show more (",
3092
3102
  me.length - m,
@@ -3094,7 +3104,7 @@ function wp({
3094
3104
  ] }) }) })
3095
3105
  ] });
3096
3106
  }
3097
- return /* @__PURE__ */ c(yn, { content: O.trim() });
3107
+ return /* @__PURE__ */ c(wn, { content: O.trim() });
3098
3108
  })(),
3099
3109
  X && /* @__PURE__ */ c("div", { className: "mt-2 grid grid-cols-2 gap-2", children: $.map((ae, me) => /* @__PURE__ */ N("div", { className: "relative border rounded overflow-hidden", children: [
3100
3110
  /* @__PURE__ */ c("img", { src: ae.url, alt: ae.alt ?? "image", className: "w-full h-auto" }),
@@ -3123,8 +3133,8 @@ function wp({
3123
3133
  );
3124
3134
  }) })
3125
3135
  ] });
3126
- }, pe = tt(() => Tp(e), [e]);
3127
- return tt(() => Ap(e, g), [e, g]), /* @__PURE__ */ c("div", { className: A(oe(), v.container), children: /* @__PURE__ */ N("div", { className: A(H(), v.content), children: [
3136
+ }, pe = nt(() => Tp(e), [e]);
3137
+ return nt(() => Ap(e, g), [e, g]), /* @__PURE__ */ c("div", { className: A(oe(), v.container), children: /* @__PURE__ */ N("div", { className: A(H(), v.content), children: [
3128
3138
  (a || i || _) && /* @__PURE__ */ N(
3129
3139
  "div",
3130
3140
  {
@@ -3192,7 +3202,7 @@ function wp({
3192
3202
  size: "sm",
3193
3203
  onClick: re,
3194
3204
  className: A("h-6 w-6 p-0 hover:bg-background/50", T && "h-5 w-5"),
3195
- children: /* @__PURE__ */ c(Kr, { className: A(T ? "h-3 w-3" : "h-4 w-4") })
3205
+ children: /* @__PURE__ */ c(jr, { className: A(T ? "h-3 w-3" : "h-4 w-4") })
3196
3206
  }
3197
3207
  )
3198
3208
  ]
@@ -3284,7 +3294,7 @@ function wp({
3284
3294
  size: "sm",
3285
3295
  onClick: re,
3286
3296
  className: A("h-6 w-6 p-0 hover:bg-background/50", T && "h-5 w-5"),
3287
- children: /* @__PURE__ */ c(Kr, { className: A(T ? "h-3 w-3" : "h-4 w-4") })
3297
+ children: /* @__PURE__ */ c(jr, { className: A(T ? "h-3 w-3" : "h-4 w-4") })
3288
3298
  }
3289
3299
  )
3290
3300
  ]
@@ -3409,7 +3419,7 @@ function Ap(e, t) {
3409
3419
  }
3410
3420
  function Pp(e, t) {
3411
3421
  const [n, r] = ce(e);
3412
- return we(() => {
3422
+ return ve(() => {
3413
3423
  if (!t) {
3414
3424
  r(e);
3415
3425
  return;
@@ -3458,31 +3468,31 @@ function Op(e) {
3458
3468
  return typeof e == "string" ? t = e : typeof e == "object" && e !== null ? t = JSON.stringify(e) : t = String(e), Ip(t), _p(t);
3459
3469
  }
3460
3470
  function Po(e) {
3461
- const t = e + "CollectionProvider", [n, r] = ze(t), [o, s] = n(
3471
+ const t = e + "CollectionProvider", [n, r] = He(t), [o, s] = n(
3462
3472
  t,
3463
3473
  { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
3464
3474
  ), a = (g) => {
3465
- const { scope: b, children: w } = g, y = Ze.useRef(null), x = Ze.useRef(/* @__PURE__ */ new Map()).current;
3475
+ const { scope: b, children: w } = g, y = Qe.useRef(null), x = Qe.useRef(/* @__PURE__ */ new Map()).current;
3466
3476
  return /* @__PURE__ */ c(o, { scope: b, itemMap: x, collectionRef: y, children: w });
3467
3477
  };
3468
3478
  a.displayName = t;
3469
- const i = e + "CollectionSlot", u = It(i), f = Ze.forwardRef(
3479
+ const i = e + "CollectionSlot", u = It(i), f = Qe.forwardRef(
3470
3480
  (g, b) => {
3471
3481
  const { scope: w, children: y } = g, x = s(i, w), E = te(b, x.collectionRef);
3472
3482
  return /* @__PURE__ */ c(u, { ref: E, children: y });
3473
3483
  }
3474
3484
  );
3475
3485
  f.displayName = i;
3476
- const d = e + "CollectionItemSlot", p = "data-radix-collection-item", m = It(d), v = Ze.forwardRef(
3486
+ const d = e + "CollectionItemSlot", p = "data-radix-collection-item", m = It(d), v = Qe.forwardRef(
3477
3487
  (g, b) => {
3478
- const { scope: w, children: y, ...x } = g, E = Ze.useRef(null), C = te(b, E), I = s(d, w);
3479
- return Ze.useEffect(() => (I.itemMap.set(E, { ref: E, ...x }), () => void I.itemMap.delete(E))), /* @__PURE__ */ c(m, { [p]: "", ref: C, children: y });
3488
+ const { scope: w, children: y, ...x } = g, E = Qe.useRef(null), C = te(b, E), I = s(d, w);
3489
+ return Qe.useEffect(() => (I.itemMap.set(E, { ref: E, ...x }), () => void I.itemMap.delete(E))), /* @__PURE__ */ c(m, { [p]: "", ref: C, children: y });
3480
3490
  }
3481
3491
  );
3482
3492
  v.displayName = d;
3483
3493
  function h(g) {
3484
3494
  const b = s(e + "CollectionConsumer", g);
3485
- return Ze.useCallback(() => {
3495
+ return Qe.useCallback(() => {
3486
3496
  const y = b.collectionRef.current;
3487
3497
  if (!y) return [];
3488
3498
  const x = Array.from(y.querySelectorAll(`[${p}]`));
@@ -3498,11 +3508,11 @@ function Po(e) {
3498
3508
  ];
3499
3509
  }
3500
3510
  var Mp = l.createContext(void 0);
3501
- function sr(e) {
3511
+ function or(e) {
3502
3512
  const t = l.useContext(Mp);
3503
3513
  return e || t || "ltr";
3504
3514
  }
3505
- function ve(e) {
3515
+ function we(e) {
3506
3516
  const t = l.useRef(e);
3507
3517
  return l.useEffect(() => {
3508
3518
  t.current = e;
@@ -3512,7 +3522,7 @@ function ve(e) {
3512
3522
  }, []);
3513
3523
  }
3514
3524
  function kp(e, t = globalThis == null ? void 0 : globalThis.document) {
3515
- const n = ve(e);
3525
+ const n = we(e);
3516
3526
  l.useEffect(() => {
3517
3527
  const r = (o) => {
3518
3528
  o.key === "Escape" && n(o);
@@ -3520,11 +3530,11 @@ function kp(e, t = globalThis == null ? void 0 : globalThis.document) {
3520
3530
  return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
3521
3531
  }, [n, t]);
3522
3532
  }
3523
- var Dp = "DismissableLayer", to = "dismissableLayer.update", Lp = "dismissableLayer.pointerDownOutside", Fp = "dismissableLayer.focusOutside", Ls, Za = l.createContext({
3533
+ var Dp = "DismissableLayer", eo = "dismissableLayer.update", Lp = "dismissableLayer.pointerDownOutside", Fp = "dismissableLayer.focusOutside", Ls, Za = l.createContext({
3524
3534
  layers: /* @__PURE__ */ new Set(),
3525
3535
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
3526
3536
  branches: /* @__PURE__ */ new Set()
3527
- }), pn = l.forwardRef(
3537
+ }), fn = l.forwardRef(
3528
3538
  (e, t) => {
3529
3539
  const {
3530
3540
  disableOutsidePointerEvents: n = !1,
@@ -3552,7 +3562,7 @@ var Dp = "DismissableLayer", to = "dismissableLayer.update", Lp = "dismissableLa
3552
3562
  d && (f.layers.delete(d), f.layersWithOutsidePointerEventsDisabled.delete(d), Fs());
3553
3563
  }, [d, f]), l.useEffect(() => {
3554
3564
  const R = () => v({});
3555
- return document.addEventListener(to, R), () => document.removeEventListener(to, R);
3565
+ return document.addEventListener(eo, R), () => document.removeEventListener(eo, R);
3556
3566
  }, []), /* @__PURE__ */ c(
3557
3567
  J.div,
3558
3568
  {
@@ -3572,7 +3582,7 @@ var Dp = "DismissableLayer", to = "dismissableLayer.update", Lp = "dismissableLa
3572
3582
  );
3573
3583
  }
3574
3584
  );
3575
- pn.displayName = Dp;
3585
+ fn.displayName = Dp;
3576
3586
  var $p = "DismissableLayerBranch", Bp = l.forwardRef((e, t) => {
3577
3587
  const n = l.useContext(Za), r = l.useRef(null), o = te(t, r);
3578
3588
  return l.useEffect(() => {
@@ -3585,7 +3595,7 @@ var $p = "DismissableLayerBranch", Bp = l.forwardRef((e, t) => {
3585
3595
  });
3586
3596
  Bp.displayName = $p;
3587
3597
  function Up(e, t = globalThis == null ? void 0 : globalThis.document) {
3588
- const n = ve(e), r = l.useRef(!1), o = l.useRef(() => {
3598
+ const n = we(e), r = l.useRef(!1), o = l.useRef(() => {
3589
3599
  });
3590
3600
  return l.useEffect(() => {
3591
3601
  const s = (i) => {
@@ -3615,7 +3625,7 @@ function Up(e, t = globalThis == null ? void 0 : globalThis.document) {
3615
3625
  };
3616
3626
  }
3617
3627
  function zp(e, t = globalThis == null ? void 0 : globalThis.document) {
3618
- const n = ve(e), r = l.useRef(!1);
3628
+ const n = we(e), r = l.useRef(!1);
3619
3629
  return l.useEffect(() => {
3620
3630
  const o = (s) => {
3621
3631
  s.target && !r.current && Qa(Fp, n, { originalEvent: s }, {
@@ -3629,19 +3639,19 @@ function zp(e, t = globalThis == null ? void 0 : globalThis.document) {
3629
3639
  };
3630
3640
  }
3631
3641
  function Fs() {
3632
- const e = new CustomEvent(to);
3642
+ const e = new CustomEvent(eo);
3633
3643
  document.dispatchEvent(e);
3634
3644
  }
3635
3645
  function Qa(e, t, n, { discrete: r }) {
3636
3646
  const o = n.originalEvent.target, s = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
3637
3647
  t && o.addEventListener(e, t, { once: !0 }), r ? qa(o, s) : o.dispatchEvent(s);
3638
3648
  }
3639
- var Mr = 0;
3649
+ var Or = 0;
3640
3650
  function _o() {
3641
3651
  l.useEffect(() => {
3642
3652
  const e = document.querySelectorAll("[data-radix-focus-guard]");
3643
- return document.body.insertAdjacentElement("afterbegin", e[0] ?? $s()), document.body.insertAdjacentElement("beforeend", e[1] ?? $s()), Mr++, () => {
3644
- Mr === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), Mr--;
3653
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? $s()), document.body.insertAdjacentElement("beforeend", e[1] ?? $s()), Or++, () => {
3654
+ Or === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), Or--;
3645
3655
  };
3646
3656
  }, []);
3647
3657
  }
@@ -3649,14 +3659,14 @@ function $s() {
3649
3659
  const e = document.createElement("span");
3650
3660
  return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
3651
3661
  }
3652
- var kr = "focusScope.autoFocusOnMount", Dr = "focusScope.autoFocusOnUnmount", Bs = { bubbles: !1, cancelable: !0 }, Hp = "FocusScope", ar = l.forwardRef((e, t) => {
3662
+ var Mr = "focusScope.autoFocusOnMount", kr = "focusScope.autoFocusOnUnmount", Bs = { bubbles: !1, cancelable: !0 }, Hp = "FocusScope", sr = l.forwardRef((e, t) => {
3653
3663
  const {
3654
3664
  loop: n = !1,
3655
3665
  trapped: r = !1,
3656
3666
  onMountAutoFocus: o,
3657
3667
  onUnmountAutoFocus: s,
3658
3668
  ...a
3659
- } = e, [i, u] = l.useState(null), f = ve(o), d = ve(s), p = l.useRef(null), m = te(t, (g) => u(g)), v = l.useRef({
3669
+ } = e, [i, u] = l.useState(null), f = we(o), d = we(s), p = l.useRef(null), m = te(t, (g) => u(g)), v = l.useRef({
3660
3670
  paused: !1,
3661
3671
  pause() {
3662
3672
  this.paused = !0;
@@ -3670,15 +3680,15 @@ var kr = "focusScope.autoFocusOnMount", Dr = "focusScope.autoFocusOnUnmount", Bs
3670
3680
  let g = function(x) {
3671
3681
  if (v.paused || !i) return;
3672
3682
  const E = x.target;
3673
- i.contains(E) ? p.current = E : Qe(p.current, { select: !0 });
3683
+ i.contains(E) ? p.current = E : et(p.current, { select: !0 });
3674
3684
  }, b = function(x) {
3675
3685
  if (v.paused || !i) return;
3676
3686
  const E = x.relatedTarget;
3677
- E !== null && (i.contains(E) || Qe(p.current, { select: !0 }));
3687
+ E !== null && (i.contains(E) || et(p.current, { select: !0 }));
3678
3688
  }, w = function(x) {
3679
3689
  if (document.activeElement === document.body)
3680
3690
  for (const C of x)
3681
- C.removedNodes.length > 0 && Qe(i);
3691
+ C.removedNodes.length > 0 && et(i);
3682
3692
  };
3683
3693
  document.addEventListener("focusin", g), document.addEventListener("focusout", b);
3684
3694
  const y = new MutationObserver(w);
@@ -3691,13 +3701,13 @@ var kr = "focusScope.autoFocusOnMount", Dr = "focusScope.autoFocusOnUnmount", Bs
3691
3701
  zs.add(v);
3692
3702
  const g = document.activeElement;
3693
3703
  if (!i.contains(g)) {
3694
- const w = new CustomEvent(kr, Bs);
3695
- i.addEventListener(kr, f), i.dispatchEvent(w), w.defaultPrevented || (Wp(qp(ei(i)), { select: !0 }), document.activeElement === g && Qe(i));
3704
+ const w = new CustomEvent(Mr, Bs);
3705
+ i.addEventListener(Mr, f), i.dispatchEvent(w), w.defaultPrevented || (Wp(qp(ei(i)), { select: !0 }), document.activeElement === g && et(i));
3696
3706
  }
3697
3707
  return () => {
3698
- i.removeEventListener(kr, f), setTimeout(() => {
3699
- const w = new CustomEvent(Dr, Bs);
3700
- i.addEventListener(Dr, d), i.dispatchEvent(w), w.defaultPrevented || Qe(g ?? document.body, { select: !0 }), i.removeEventListener(Dr, d), zs.remove(v);
3708
+ i.removeEventListener(Mr, f), setTimeout(() => {
3709
+ const w = new CustomEvent(kr, Bs);
3710
+ i.addEventListener(kr, d), i.dispatchEvent(w), w.defaultPrevented || et(g ?? document.body, { select: !0 }), i.removeEventListener(kr, d), zs.remove(v);
3701
3711
  }, 0);
3702
3712
  };
3703
3713
  }
@@ -3708,18 +3718,18 @@ var kr = "focusScope.autoFocusOnMount", Dr = "focusScope.autoFocusOnUnmount", Bs
3708
3718
  const b = g.key === "Tab" && !g.altKey && !g.ctrlKey && !g.metaKey, w = document.activeElement;
3709
3719
  if (b && w) {
3710
3720
  const y = g.currentTarget, [x, E] = Vp(y);
3711
- x && E ? !g.shiftKey && w === E ? (g.preventDefault(), n && Qe(x, { select: !0 })) : g.shiftKey && w === x && (g.preventDefault(), n && Qe(E, { select: !0 })) : w === y && g.preventDefault();
3721
+ x && E ? !g.shiftKey && w === E ? (g.preventDefault(), n && et(x, { select: !0 })) : g.shiftKey && w === x && (g.preventDefault(), n && et(E, { select: !0 })) : w === y && g.preventDefault();
3712
3722
  }
3713
3723
  },
3714
3724
  [n, r, v.paused]
3715
3725
  );
3716
3726
  return /* @__PURE__ */ c(J.div, { tabIndex: -1, ...a, ref: m, onKeyDown: h });
3717
3727
  });
3718
- ar.displayName = Hp;
3728
+ sr.displayName = Hp;
3719
3729
  function Wp(e, { select: t = !1 } = {}) {
3720
3730
  const n = document.activeElement;
3721
3731
  for (const r of e)
3722
- if (Qe(r, { select: t }), document.activeElement !== n) return;
3732
+ if (et(r, { select: t }), document.activeElement !== n) return;
3723
3733
  }
3724
3734
  function Vp(e) {
3725
3735
  const t = ei(e), n = Us(t, e), r = Us(t.reverse(), e);
@@ -3751,7 +3761,7 @@ function jp(e, { upTo: t }) {
3751
3761
  function Kp(e) {
3752
3762
  return e instanceof HTMLInputElement && "select" in e;
3753
3763
  }
3754
- function Qe(e, { select: t = !1 } = {}) {
3764
+ function et(e, { select: t = !1 } = {}) {
3755
3765
  if (e && e.focus) {
3756
3766
  const n = document.activeElement;
3757
3767
  e.focus({ preventScroll: !0 }), e !== n && Kp(e) && t && e.select();
@@ -3778,7 +3788,7 @@ function Hs(e, t) {
3778
3788
  function qp(e) {
3779
3789
  return e.filter((t) => t.tagName !== "A");
3780
3790
  }
3781
- const Yp = ["top", "right", "bottom", "left"], st = Math.min, _e = Math.max, Hn = Math.round, xn = Math.floor, Ke = (e) => ({
3791
+ const Yp = ["top", "right", "bottom", "left"], st = Math.min, _e = Math.max, zn = Math.round, yn = Math.floor, Ge = (e) => ({
3782
3792
  x: e,
3783
3793
  y: e
3784
3794
  }), Xp = {
@@ -3790,13 +3800,13 @@ const Yp = ["top", "right", "bottom", "left"], st = Math.min, _e = Math.max, Hn
3790
3800
  start: "end",
3791
3801
  end: "start"
3792
3802
  };
3793
- function no(e, t, n) {
3803
+ function to(e, t, n) {
3794
3804
  return _e(e, st(t, n));
3795
3805
  }
3796
- function Xe(e, t) {
3806
+ function Je(e, t) {
3797
3807
  return typeof e == "function" ? e(t) : e;
3798
3808
  }
3799
- function Je(e) {
3809
+ function Ze(e) {
3800
3810
  return e.split("-")[0];
3801
3811
  }
3802
3812
  function Bt(e) {
@@ -3809,23 +3819,23 @@ function Oo(e) {
3809
3819
  return e === "y" ? "height" : "width";
3810
3820
  }
3811
3821
  const Zp = /* @__PURE__ */ new Set(["top", "bottom"]);
3812
- function je(e) {
3813
- return Zp.has(Je(e)) ? "y" : "x";
3822
+ function Ke(e) {
3823
+ return Zp.has(Ze(e)) ? "y" : "x";
3814
3824
  }
3815
3825
  function Mo(e) {
3816
- return Io(je(e));
3826
+ return Io(Ke(e));
3817
3827
  }
3818
3828
  function Qp(e, t, n) {
3819
3829
  n === void 0 && (n = !1);
3820
3830
  const r = Bt(e), o = Mo(e), s = Oo(o);
3821
3831
  let a = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
3822
- return t.reference[s] > t.floating[s] && (a = Wn(a)), [a, Wn(a)];
3832
+ return t.reference[s] > t.floating[s] && (a = Hn(a)), [a, Hn(a)];
3823
3833
  }
3824
3834
  function eh(e) {
3825
- const t = Wn(e);
3826
- return [ro(e), t, ro(t)];
3835
+ const t = Hn(e);
3836
+ return [no(e), t, no(t)];
3827
3837
  }
3828
- function ro(e) {
3838
+ function no(e) {
3829
3839
  return e.replace(/start|end/g, (t) => Jp[t]);
3830
3840
  }
3831
3841
  const Ws = ["left", "right"], Vs = ["right", "left"], th = ["top", "bottom"], nh = ["bottom", "top"];
@@ -3843,10 +3853,10 @@ function rh(e, t, n) {
3843
3853
  }
3844
3854
  function oh(e, t, n, r) {
3845
3855
  const o = Bt(e);
3846
- let s = rh(Je(e), n === "start", r);
3847
- return o && (s = s.map((a) => a + "-" + o), t && (s = s.concat(s.map(ro)))), s;
3856
+ let s = rh(Ze(e), n === "start", r);
3857
+ return o && (s = s.map((a) => a + "-" + o), t && (s = s.concat(s.map(no)))), s;
3848
3858
  }
3849
- function Wn(e) {
3859
+ function Hn(e) {
3850
3860
  return e.replace(/left|right|bottom|top/g, (t) => Xp[t]);
3851
3861
  }
3852
3862
  function sh(e) {
@@ -3866,7 +3876,7 @@ function ti(e) {
3866
3876
  left: e
3867
3877
  };
3868
3878
  }
3869
- function Vn(e) {
3879
+ function Wn(e) {
3870
3880
  const {
3871
3881
  x: t,
3872
3882
  y: n,
@@ -3889,7 +3899,7 @@ function js(e, t, n) {
3889
3899
  reference: r,
3890
3900
  floating: o
3891
3901
  } = e;
3892
- const s = je(t), a = Mo(t), i = Oo(a), u = Je(t), f = s === "y", d = r.x + r.width / 2 - o.width / 2, p = r.y + r.height / 2 - o.height / 2, m = r[i] / 2 - o[i] / 2;
3902
+ const s = Ke(t), a = Mo(t), i = Oo(a), u = Ze(t), f = s === "y", d = r.x + r.width / 2 - o.width / 2, p = r.y + r.height / 2 - o.height / 2, m = r[i] / 2 - o[i] / 2;
3893
3903
  let v;
3894
3904
  switch (u) {
3895
3905
  case "top":
@@ -3993,7 +4003,7 @@ const ah = async (e, t, n) => {
3993
4003
  middlewareData: v
3994
4004
  };
3995
4005
  };
3996
- async function tn(e, t) {
4006
+ async function en(e, t) {
3997
4007
  var n;
3998
4008
  t === void 0 && (t = {});
3999
4009
  const {
@@ -4009,7 +4019,7 @@ async function tn(e, t) {
4009
4019
  elementContext: p = "floating",
4010
4020
  altBoundary: m = !1,
4011
4021
  padding: v = 0
4012
- } = Xe(t, e), h = ti(v), b = i[m ? p === "floating" ? "reference" : "floating" : p], w = Vn(await s.getClippingRect({
4022
+ } = Je(t, e), h = ti(v), b = i[m ? p === "floating" ? "reference" : "floating" : p], w = Wn(await s.getClippingRect({
4013
4023
  element: (n = await (s.isElement == null ? void 0 : s.isElement(b))) == null || n ? b : b.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(i.floating)),
4014
4024
  boundary: f,
4015
4025
  rootBoundary: d,
@@ -4025,7 +4035,7 @@ async function tn(e, t) {
4025
4035
  } : {
4026
4036
  x: 1,
4027
4037
  y: 1
4028
- }, C = Vn(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
4038
+ }, C = Wn(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
4029
4039
  elements: i,
4030
4040
  rect: y,
4031
4041
  offsetParent: x,
@@ -4053,7 +4063,7 @@ const ih = (e) => ({
4053
4063
  } = t, {
4054
4064
  element: f,
4055
4065
  padding: d = 0
4056
- } = Xe(e, t) || {};
4066
+ } = Je(e, t) || {};
4057
4067
  if (f == null)
4058
4068
  return {};
4059
4069
  const p = ti(d), m = {
@@ -4062,7 +4072,7 @@ const ih = (e) => ({
4062
4072
  }, v = Mo(o), h = Oo(v), g = await a.getDimensions(f), b = v === "y", w = b ? "top" : "left", y = b ? "bottom" : "right", x = b ? "clientHeight" : "clientWidth", E = s.reference[h] + s.reference[v] - m[v] - s.floating[h], C = m[v] - s.reference[v], I = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(f));
4063
4073
  let R = I ? I[x] : 0;
4064
4074
  (!R || !await (a.isElement == null ? void 0 : a.isElement(I))) && (R = i.floating[x] || s.floating[h]);
4065
- const D = E / 2 - C / 2, M = R / 2 - g[h] / 2 - 1, k = st(p[w], M), j = st(p[y], M), K = k, W = R - g[h] - j, B = R / 2 - g[h] / 2 + D, q = no(K, B, W), L = !u.arrow && Bt(o) != null && B !== q && s.reference[h] / 2 - (B < K ? k : j) - g[h] / 2 < 0, G = L ? B < K ? B - K : B - W : 0;
4075
+ const D = E / 2 - C / 2, M = R / 2 - g[h] / 2 - 1, k = st(p[w], M), j = st(p[y], M), K = k, W = R - g[h] - j, B = R / 2 - g[h] / 2 + D, q = to(K, B, W), L = !u.arrow && Bt(o) != null && B !== q && s.reference[h] / 2 - (B < K ? k : j) - g[h] / 2 < 0, G = L ? B < K ? B - K : B - W : 0;
4066
4076
  return {
4067
4077
  [v]: m[v] + G,
4068
4078
  data: {
@@ -4096,12 +4106,12 @@ const ih = (e) => ({
4096
4106
  fallbackAxisSideDirection: h = "none",
4097
4107
  flipAlignment: g = !0,
4098
4108
  ...b
4099
- } = Xe(e, t);
4109
+ } = Je(e, t);
4100
4110
  if ((n = s.arrow) != null && n.alignmentOffset)
4101
4111
  return {};
4102
- const w = Je(o), y = je(i), x = Je(i) === i, E = await (u.isRTL == null ? void 0 : u.isRTL(f.floating)), C = m || (x || !g ? [Wn(i)] : eh(i)), I = h !== "none";
4112
+ const w = Ze(o), y = Ke(i), x = Ze(i) === i, E = await (u.isRTL == null ? void 0 : u.isRTL(f.floating)), C = m || (x || !g ? [Hn(i)] : eh(i)), I = h !== "none";
4103
4113
  !m && I && C.push(...oh(i, g, h, E));
4104
- const R = [i, ...C], D = await tn(t, b), M = [];
4114
+ const R = [i, ...C], D = await en(t, b), M = [];
4105
4115
  let k = ((r = s.flip) == null ? void 0 : r.overflows) || [];
4106
4116
  if (d && M.push(D[w]), p) {
4107
4117
  const B = Qp(o, a, E);
@@ -4113,9 +4123,9 @@ const ih = (e) => ({
4113
4123
  }], !M.every((B) => B <= 0)) {
4114
4124
  var j, K;
4115
4125
  const B = (((j = s.flip) == null ? void 0 : j.index) || 0) + 1, q = R[B];
4116
- if (q && (!(p === "alignment" ? y !== je(q) : !1) || // We leave the current main axis only if every placement on that axis
4126
+ if (q && (!(p === "alignment" ? y !== Ke(q) : !1) || // We leave the current main axis only if every placement on that axis
4117
4127
  // overflows the main axis.
4118
- k.every((T) => je(T.placement) === y ? T.overflows[0] > 0 : !0)))
4128
+ k.every((T) => Ke(T.placement) === y ? T.overflows[0] > 0 : !0)))
4119
4129
  return {
4120
4130
  data: {
4121
4131
  index: B,
@@ -4132,7 +4142,7 @@ const ih = (e) => ({
4132
4142
  var W;
4133
4143
  const G = (W = k.filter((T) => {
4134
4144
  if (I) {
4135
- const P = je(T.placement);
4145
+ const P = Ke(T.placement);
4136
4146
  return P === y || // Create a bias to the `y` side axis due to horizontal
4137
4147
  // reading directions favoring greater width.
4138
4148
  P === "y";
@@ -4178,10 +4188,10 @@ const lh = function(e) {
4178
4188
  } = t, {
4179
4189
  strategy: r = "referenceHidden",
4180
4190
  ...o
4181
- } = Xe(e, t);
4191
+ } = Je(e, t);
4182
4192
  switch (r) {
4183
4193
  case "referenceHidden": {
4184
- const s = await tn(t, {
4194
+ const s = await en(t, {
4185
4195
  ...o,
4186
4196
  elementContext: "reference"
4187
4197
  }), a = Ks(s, n.reference);
@@ -4193,7 +4203,7 @@ const lh = function(e) {
4193
4203
  };
4194
4204
  }
4195
4205
  case "escaped": {
4196
- const s = await tn(t, {
4206
+ const s = await en(t, {
4197
4207
  ...o,
4198
4208
  altBoundary: !0
4199
4209
  }), a = Ks(s, n.floating);
@@ -4215,7 +4225,7 @@ async function uh(e, t) {
4215
4225
  placement: n,
4216
4226
  platform: r,
4217
4227
  elements: o
4218
- } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), a = Je(n), i = Bt(n), u = je(n) === "y", f = ni.has(a) ? -1 : 1, d = s && u ? -1 : 1, p = Xe(t, e);
4228
+ } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), a = Ze(n), i = Bt(n), u = Ke(n) === "y", f = ni.has(a) ? -1 : 1, d = s && u ? -1 : 1, p = Je(t, e);
4219
4229
  let {
4220
4230
  mainAxis: m,
4221
4231
  crossAxis: v,
@@ -4284,18 +4294,18 @@ const dh = function(e) {
4284
4294
  }
4285
4295
  },
4286
4296
  ...u
4287
- } = Xe(e, t), f = {
4297
+ } = Je(e, t), f = {
4288
4298
  x: n,
4289
4299
  y: r
4290
- }, d = await tn(t, u), p = je(Je(o)), m = Io(p);
4300
+ }, d = await en(t, u), p = Ke(Ze(o)), m = Io(p);
4291
4301
  let v = f[m], h = f[p];
4292
4302
  if (s) {
4293
4303
  const b = m === "y" ? "top" : "left", w = m === "y" ? "bottom" : "right", y = v + d[b], x = v - d[w];
4294
- v = no(y, v, x);
4304
+ v = to(y, v, x);
4295
4305
  }
4296
4306
  if (a) {
4297
4307
  const b = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", y = h + d[b], x = h - d[w];
4298
- h = no(y, h, x);
4308
+ h = to(y, h, x);
4299
4309
  }
4300
4310
  const g = i.fn({
4301
4311
  ...t,
@@ -4329,12 +4339,12 @@ const dh = function(e) {
4329
4339
  offset: i = 0,
4330
4340
  mainAxis: u = !0,
4331
4341
  crossAxis: f = !0
4332
- } = Xe(e, t), d = {
4342
+ } = Je(e, t), d = {
4333
4343
  x: n,
4334
4344
  y: r
4335
- }, p = je(o), m = Io(p);
4345
+ }, p = Ke(o), m = Io(p);
4336
4346
  let v = d[m], h = d[p];
4337
- const g = Xe(i, t), b = typeof g == "number" ? {
4347
+ const g = Je(i, t), b = typeof g == "number" ? {
4338
4348
  mainAxis: g,
4339
4349
  crossAxis: 0
4340
4350
  } : {
@@ -4348,7 +4358,7 @@ const dh = function(e) {
4348
4358
  }
4349
4359
  if (f) {
4350
4360
  var w, y;
4351
- const x = m === "y" ? "width" : "height", E = ni.has(Je(o)), C = s.reference[p] - s.floating[x] + (E && ((w = a.offset) == null ? void 0 : w[p]) || 0) + (E ? 0 : b.crossAxis), I = s.reference[p] + s.reference[x] + (E ? 0 : ((y = a.offset) == null ? void 0 : y[p]) || 0) - (E ? b.crossAxis : 0);
4361
+ const x = m === "y" ? "width" : "height", E = ni.has(Ze(o)), C = s.reference[p] - s.floating[x] + (E && ((w = a.offset) == null ? void 0 : w[p]) || 0) + (E ? 0 : b.crossAxis), I = s.reference[p] + s.reference[x] + (E ? 0 : ((y = a.offset) == null ? void 0 : y[p]) || 0) - (E ? b.crossAxis : 0);
4352
4362
  h < C ? h = C : h > I && (h = I);
4353
4363
  }
4354
4364
  return {
@@ -4372,7 +4382,7 @@ const dh = function(e) {
4372
4382
  apply: u = () => {
4373
4383
  },
4374
4384
  ...f
4375
- } = Xe(e, t), d = await tn(t, f), p = Je(o), m = Bt(o), v = je(o) === "y", {
4385
+ } = Je(e, t), d = await en(t, f), p = Ze(o), m = Bt(o), v = Ke(o) === "y", {
4376
4386
  width: h,
4377
4387
  height: g
4378
4388
  } = s.floating;
@@ -4398,7 +4408,7 @@ const dh = function(e) {
4398
4408
  }
4399
4409
  };
4400
4410
  };
4401
- function ir() {
4411
+ function ar() {
4402
4412
  return typeof window < "u";
4403
4413
  }
4404
4414
  function Ut(e) {
@@ -4408,30 +4418,30 @@ function Ie(e) {
4408
4418
  var t;
4409
4419
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
4410
4420
  }
4411
- function qe(e) {
4421
+ function Ye(e) {
4412
4422
  var t;
4413
4423
  return (t = (ri(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
4414
4424
  }
4415
4425
  function ri(e) {
4416
- return ir() ? e instanceof Node || e instanceof Ie(e).Node : !1;
4426
+ return ar() ? e instanceof Node || e instanceof Ie(e).Node : !1;
4417
4427
  }
4418
- function $e(e) {
4419
- return ir() ? e instanceof Element || e instanceof Ie(e).Element : !1;
4428
+ function Be(e) {
4429
+ return ar() ? e instanceof Element || e instanceof Ie(e).Element : !1;
4420
4430
  }
4421
- function Ge(e) {
4422
- return ir() ? e instanceof HTMLElement || e instanceof Ie(e).HTMLElement : !1;
4431
+ function qe(e) {
4432
+ return ar() ? e instanceof HTMLElement || e instanceof Ie(e).HTMLElement : !1;
4423
4433
  }
4424
4434
  function qs(e) {
4425
- return !ir() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Ie(e).ShadowRoot;
4435
+ return !ar() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Ie(e).ShadowRoot;
4426
4436
  }
4427
4437
  const mh = /* @__PURE__ */ new Set(["inline", "contents"]);
4428
- function hn(e) {
4438
+ function pn(e) {
4429
4439
  const {
4430
4440
  overflow: t,
4431
4441
  overflowX: n,
4432
4442
  overflowY: r,
4433
4443
  display: o
4434
- } = Be(e);
4444
+ } = Ue(e);
4435
4445
  return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !mh.has(o);
4436
4446
  }
4437
4447
  const gh = /* @__PURE__ */ new Set(["table", "td", "th"]);
@@ -4439,7 +4449,7 @@ function bh(e) {
4439
4449
  return gh.has(Ut(e));
4440
4450
  }
4441
4451
  const vh = [":popover-open", ":modal"];
4442
- function cr(e) {
4452
+ function ir(e) {
4443
4453
  return vh.some((t) => {
4444
4454
  try {
4445
4455
  return e.matches(t);
@@ -4450,15 +4460,15 @@ function cr(e) {
4450
4460
  }
4451
4461
  const wh = ["transform", "translate", "scale", "rotate", "perspective"], yh = ["transform", "translate", "scale", "rotate", "perspective", "filter"], xh = ["paint", "layout", "strict", "content"];
4452
4462
  function ko(e) {
4453
- const t = Do(), n = $e(e) ? Be(e) : e;
4463
+ const t = Do(), n = Be(e) ? Ue(e) : e;
4454
4464
  return wh.some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || yh.some((r) => (n.willChange || "").includes(r)) || xh.some((r) => (n.contain || "").includes(r));
4455
4465
  }
4456
4466
  function Sh(e) {
4457
4467
  let t = at(e);
4458
- for (; Ge(t) && !Mt(t); ) {
4468
+ for (; qe(t) && !Mt(t); ) {
4459
4469
  if (ko(t))
4460
4470
  return t;
4461
- if (cr(t))
4471
+ if (ir(t))
4462
4472
  return null;
4463
4473
  t = at(t);
4464
4474
  }
@@ -4471,11 +4481,11 @@ const Ch = /* @__PURE__ */ new Set(["html", "body", "#document"]);
4471
4481
  function Mt(e) {
4472
4482
  return Ch.has(Ut(e));
4473
4483
  }
4474
- function Be(e) {
4484
+ function Ue(e) {
4475
4485
  return Ie(e).getComputedStyle(e);
4476
4486
  }
4477
- function lr(e) {
4478
- return $e(e) ? {
4487
+ function cr(e) {
4488
+ return Be(e) ? {
4479
4489
  scrollLeft: e.scrollLeft,
4480
4490
  scrollTop: e.scrollTop
4481
4491
  } : {
@@ -4491,31 +4501,31 @@ function at(e) {
4491
4501
  e.assignedSlot || // DOM Element detected.
4492
4502
  e.parentNode || // ShadowRoot detected.
4493
4503
  qs(e) && e.host || // Fallback.
4494
- qe(e)
4504
+ Ye(e)
4495
4505
  );
4496
4506
  return qs(t) ? t.host : t;
4497
4507
  }
4498
4508
  function oi(e) {
4499
4509
  const t = at(e);
4500
- return Mt(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : Ge(t) && hn(t) ? t : oi(t);
4510
+ return Mt(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : qe(t) && pn(t) ? t : oi(t);
4501
4511
  }
4502
- function nn(e, t, n) {
4512
+ function tn(e, t, n) {
4503
4513
  var r;
4504
4514
  t === void 0 && (t = []), n === void 0 && (n = !0);
4505
4515
  const o = oi(e), s = o === ((r = e.ownerDocument) == null ? void 0 : r.body), a = Ie(o);
4506
4516
  if (s) {
4507
- const i = oo(a);
4508
- return t.concat(a, a.visualViewport || [], hn(o) ? o : [], i && n ? nn(i) : []);
4517
+ const i = ro(a);
4518
+ return t.concat(a, a.visualViewport || [], pn(o) ? o : [], i && n ? tn(i) : []);
4509
4519
  }
4510
- return t.concat(o, nn(o, [], n));
4520
+ return t.concat(o, tn(o, [], n));
4511
4521
  }
4512
- function oo(e) {
4522
+ function ro(e) {
4513
4523
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
4514
4524
  }
4515
4525
  function si(e) {
4516
- const t = Be(e);
4526
+ const t = Ue(e);
4517
4527
  let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
4518
- const o = Ge(e), s = o ? e.offsetWidth : n, a = o ? e.offsetHeight : r, i = Hn(n) !== s || Hn(r) !== a;
4528
+ const o = qe(e), s = o ? e.offsetWidth : n, a = o ? e.offsetHeight : r, i = zn(n) !== s || zn(r) !== a;
4519
4529
  return i && (n = s, r = a), {
4520
4530
  width: n,
4521
4531
  height: r,
@@ -4523,24 +4533,24 @@ function si(e) {
4523
4533
  };
4524
4534
  }
4525
4535
  function Lo(e) {
4526
- return $e(e) ? e : e.contextElement;
4536
+ return Be(e) ? e : e.contextElement;
4527
4537
  }
4528
4538
  function Pt(e) {
4529
4539
  const t = Lo(e);
4530
- if (!Ge(t))
4531
- return Ke(1);
4540
+ if (!qe(t))
4541
+ return Ge(1);
4532
4542
  const n = t.getBoundingClientRect(), {
4533
4543
  width: r,
4534
4544
  height: o,
4535
4545
  $: s
4536
4546
  } = si(t);
4537
- let a = (s ? Hn(n.width) : n.width) / r, i = (s ? Hn(n.height) : n.height) / o;
4547
+ let a = (s ? zn(n.width) : n.width) / r, i = (s ? zn(n.height) : n.height) / o;
4538
4548
  return (!a || !Number.isFinite(a)) && (a = 1), (!i || !Number.isFinite(i)) && (i = 1), {
4539
4549
  x: a,
4540
4550
  y: i
4541
4551
  };
4542
4552
  }
4543
- const Eh = /* @__PURE__ */ Ke(0);
4553
+ const Eh = /* @__PURE__ */ Ge(0);
4544
4554
  function ai(e) {
4545
4555
  const t = Ie(e);
4546
4556
  return !Do() || !t.visualViewport ? Eh : {
@@ -4554,31 +4564,31 @@ function Rh(e, t, n) {
4554
4564
  function gt(e, t, n, r) {
4555
4565
  t === void 0 && (t = !1), n === void 0 && (n = !1);
4556
4566
  const o = e.getBoundingClientRect(), s = Lo(e);
4557
- let a = Ke(1);
4558
- t && (r ? $e(r) && (a = Pt(r)) : a = Pt(e));
4559
- const i = Rh(s, n, r) ? ai(s) : Ke(0);
4567
+ let a = Ge(1);
4568
+ t && (r ? Be(r) && (a = Pt(r)) : a = Pt(e));
4569
+ const i = Rh(s, n, r) ? ai(s) : Ge(0);
4560
4570
  let u = (o.left + i.x) / a.x, f = (o.top + i.y) / a.y, d = o.width / a.x, p = o.height / a.y;
4561
4571
  if (s) {
4562
- const m = Ie(s), v = r && $e(r) ? Ie(r) : r;
4563
- let h = m, g = oo(h);
4572
+ const m = Ie(s), v = r && Be(r) ? Ie(r) : r;
4573
+ let h = m, g = ro(h);
4564
4574
  for (; g && r && v !== h; ) {
4565
- const b = Pt(g), w = g.getBoundingClientRect(), y = Be(g), x = w.left + (g.clientLeft + parseFloat(y.paddingLeft)) * b.x, E = w.top + (g.clientTop + parseFloat(y.paddingTop)) * b.y;
4566
- u *= b.x, f *= b.y, d *= b.x, p *= b.y, u += x, f += E, h = Ie(g), g = oo(h);
4575
+ const b = Pt(g), w = g.getBoundingClientRect(), y = Ue(g), x = w.left + (g.clientLeft + parseFloat(y.paddingLeft)) * b.x, E = w.top + (g.clientTop + parseFloat(y.paddingTop)) * b.y;
4576
+ u *= b.x, f *= b.y, d *= b.x, p *= b.y, u += x, f += E, h = Ie(g), g = ro(h);
4567
4577
  }
4568
4578
  }
4569
- return Vn({
4579
+ return Wn({
4570
4580
  width: d,
4571
4581
  height: p,
4572
4582
  x: u,
4573
4583
  y: f
4574
4584
  });
4575
4585
  }
4576
- function ur(e, t) {
4577
- const n = lr(e).scrollLeft;
4578
- return t ? t.left + n : gt(qe(e)).left + n;
4586
+ function lr(e, t) {
4587
+ const n = cr(e).scrollLeft;
4588
+ return t ? t.left + n : gt(Ye(e)).left + n;
4579
4589
  }
4580
4590
  function ii(e, t) {
4581
- const n = e.getBoundingClientRect(), r = n.left + t.scrollLeft - ur(e, n), o = n.top + t.scrollTop;
4591
+ const n = e.getBoundingClientRect(), r = n.left + t.scrollLeft - lr(e, n), o = n.top + t.scrollTop;
4582
4592
  return {
4583
4593
  x: r,
4584
4594
  y: o
@@ -4591,19 +4601,19 @@ function Nh(e) {
4591
4601
  offsetParent: r,
4592
4602
  strategy: o
4593
4603
  } = e;
4594
- const s = o === "fixed", a = qe(r), i = t ? cr(t.floating) : !1;
4604
+ const s = o === "fixed", a = Ye(r), i = t ? ir(t.floating) : !1;
4595
4605
  if (r === a || i && s)
4596
4606
  return n;
4597
4607
  let u = {
4598
4608
  scrollLeft: 0,
4599
4609
  scrollTop: 0
4600
- }, f = Ke(1);
4601
- const d = Ke(0), p = Ge(r);
4602
- if ((p || !p && !s) && ((Ut(r) !== "body" || hn(a)) && (u = lr(r)), Ge(r))) {
4610
+ }, f = Ge(1);
4611
+ const d = Ge(0), p = qe(r);
4612
+ if ((p || !p && !s) && ((Ut(r) !== "body" || pn(a)) && (u = cr(r)), qe(r))) {
4603
4613
  const v = gt(r);
4604
4614
  f = Pt(r), d.x = v.x + r.clientLeft, d.y = v.y + r.clientTop;
4605
4615
  }
4606
- const m = a && !p && !s ? ii(a, u) : Ke(0);
4616
+ const m = a && !p && !s ? ii(a, u) : Ge(0);
4607
4617
  return {
4608
4618
  width: n.width * f.x,
4609
4619
  height: n.height * f.y,
@@ -4615,10 +4625,10 @@ function Th(e) {
4615
4625
  return Array.from(e.getClientRects());
4616
4626
  }
4617
4627
  function Ah(e) {
4618
- const t = qe(e), n = lr(e), r = e.ownerDocument.body, o = _e(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = _e(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
4619
- let a = -n.scrollLeft + ur(e);
4628
+ const t = Ye(e), n = cr(e), r = e.ownerDocument.body, o = _e(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = _e(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
4629
+ let a = -n.scrollLeft + lr(e);
4620
4630
  const i = -n.scrollTop;
4621
- return Be(r).direction === "rtl" && (a += _e(t.clientWidth, r.clientWidth) - o), {
4631
+ return Ue(r).direction === "rtl" && (a += _e(t.clientWidth, r.clientWidth) - o), {
4622
4632
  width: o,
4623
4633
  height: s,
4624
4634
  x: a,
@@ -4627,14 +4637,14 @@ function Ah(e) {
4627
4637
  }
4628
4638
  const Ys = 25;
4629
4639
  function Ph(e, t) {
4630
- const n = Ie(e), r = qe(e), o = n.visualViewport;
4640
+ const n = Ie(e), r = Ye(e), o = n.visualViewport;
4631
4641
  let s = r.clientWidth, a = r.clientHeight, i = 0, u = 0;
4632
4642
  if (o) {
4633
4643
  s = o.width, a = o.height;
4634
4644
  const d = Do();
4635
4645
  (!d || d && t === "fixed") && (i = o.offsetLeft, u = o.offsetTop);
4636
4646
  }
4637
- const f = ur(r);
4647
+ const f = lr(r);
4638
4648
  if (f <= 0) {
4639
4649
  const d = r.ownerDocument, p = d.body, m = getComputedStyle(p), v = d.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, h = Math.abs(r.clientWidth - p.clientWidth - v);
4640
4650
  h <= Ys && (s -= h);
@@ -4648,7 +4658,7 @@ function Ph(e, t) {
4648
4658
  }
4649
4659
  const _h = /* @__PURE__ */ new Set(["absolute", "fixed"]);
4650
4660
  function Ih(e, t) {
4651
- const n = gt(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = Ge(e) ? Pt(e) : Ke(1), a = e.clientWidth * s.x, i = e.clientHeight * s.y, u = o * s.x, f = r * s.y;
4661
+ const n = gt(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = qe(e) ? Pt(e) : Ge(1), a = e.clientWidth * s.x, i = e.clientHeight * s.y, u = o * s.x, f = r * s.y;
4652
4662
  return {
4653
4663
  width: a,
4654
4664
  height: i,
@@ -4661,8 +4671,8 @@ function Xs(e, t, n) {
4661
4671
  if (t === "viewport")
4662
4672
  r = Ph(e, n);
4663
4673
  else if (t === "document")
4664
- r = Ah(qe(e));
4665
- else if ($e(t))
4674
+ r = Ah(Ye(e));
4675
+ else if (Be(t))
4666
4676
  r = Ih(t, n);
4667
4677
  else {
4668
4678
  const o = ai(e);
@@ -4673,22 +4683,22 @@ function Xs(e, t, n) {
4673
4683
  height: t.height
4674
4684
  };
4675
4685
  }
4676
- return Vn(r);
4686
+ return Wn(r);
4677
4687
  }
4678
4688
  function ci(e, t) {
4679
4689
  const n = at(e);
4680
- return n === t || !$e(n) || Mt(n) ? !1 : Be(n).position === "fixed" || ci(n, t);
4690
+ return n === t || !Be(n) || Mt(n) ? !1 : Ue(n).position === "fixed" || ci(n, t);
4681
4691
  }
4682
4692
  function Oh(e, t) {
4683
4693
  const n = t.get(e);
4684
4694
  if (n)
4685
4695
  return n;
4686
- let r = nn(e, [], !1).filter((i) => $e(i) && Ut(i) !== "body"), o = null;
4687
- const s = Be(e).position === "fixed";
4696
+ let r = tn(e, [], !1).filter((i) => Be(i) && Ut(i) !== "body"), o = null;
4697
+ const s = Ue(e).position === "fixed";
4688
4698
  let a = s ? at(e) : e;
4689
- for (; $e(a) && !Mt(a); ) {
4690
- const i = Be(a), u = ko(a);
4691
- !u && i.position === "fixed" && (o = null), (s ? !u && !o : !u && i.position === "static" && !!o && _h.has(o.position) || hn(a) && !u && ci(e, a)) ? r = r.filter((d) => d !== a) : o = i, a = at(a);
4699
+ for (; Be(a) && !Mt(a); ) {
4700
+ const i = Ue(a), u = ko(a);
4701
+ !u && i.position === "fixed" && (o = null), (s ? !u && !o : !u && i.position === "static" && !!o && _h.has(o.position) || pn(a) && !u && ci(e, a)) ? r = r.filter((d) => d !== a) : o = i, a = at(a);
4692
4702
  }
4693
4703
  return t.set(e, r), r;
4694
4704
  }
@@ -4699,7 +4709,7 @@ function Mh(e) {
4699
4709
  rootBoundary: r,
4700
4710
  strategy: o
4701
4711
  } = e;
4702
- const a = [...n === "clippingAncestors" ? cr(t) ? [] : Oh(t, this._c) : [].concat(n), r], i = a[0], u = a.reduce((f, d) => {
4712
+ const a = [...n === "clippingAncestors" ? ir(t) ? [] : Oh(t, this._c) : [].concat(n), r], i = a[0], u = a.reduce((f, d) => {
4703
4713
  const p = Xs(t, d, o);
4704
4714
  return f.top = _e(p.top, f.top), f.right = st(p.right, f.right), f.bottom = st(p.bottom, f.bottom), f.left = _e(p.left, f.left), f;
4705
4715
  }, Xs(t, i, o));
@@ -4721,22 +4731,22 @@ function kh(e) {
4721
4731
  };
4722
4732
  }
4723
4733
  function Dh(e, t, n) {
4724
- const r = Ge(t), o = qe(t), s = n === "fixed", a = gt(e, !0, s, t);
4734
+ const r = qe(t), o = Ye(t), s = n === "fixed", a = gt(e, !0, s, t);
4725
4735
  let i = {
4726
4736
  scrollLeft: 0,
4727
4737
  scrollTop: 0
4728
4738
  };
4729
- const u = Ke(0);
4739
+ const u = Ge(0);
4730
4740
  function f() {
4731
- u.x = ur(o);
4741
+ u.x = lr(o);
4732
4742
  }
4733
4743
  if (r || !r && !s)
4734
- if ((Ut(t) !== "body" || hn(o)) && (i = lr(t)), r) {
4744
+ if ((Ut(t) !== "body" || pn(o)) && (i = cr(t)), r) {
4735
4745
  const v = gt(t, !0, s, t);
4736
4746
  u.x = v.x + t.clientLeft, u.y = v.y + t.clientTop;
4737
4747
  } else o && f();
4738
4748
  s && !r && o && f();
4739
- const d = o && !r && !s ? ii(o, i) : Ke(0), p = a.left + i.scrollLeft - u.x - d.x, m = a.top + i.scrollTop - u.y - d.y;
4749
+ const d = o && !r && !s ? ii(o, i) : Ge(0), p = a.left + i.scrollLeft - u.x - d.x, m = a.top + i.scrollTop - u.y - d.y;
4740
4750
  return {
4741
4751
  x: p,
4742
4752
  y: m,
@@ -4744,34 +4754,34 @@ function Dh(e, t, n) {
4744
4754
  height: a.height
4745
4755
  };
4746
4756
  }
4747
- function Lr(e) {
4748
- return Be(e).position === "static";
4757
+ function Dr(e) {
4758
+ return Ue(e).position === "static";
4749
4759
  }
4750
4760
  function Js(e, t) {
4751
- if (!Ge(e) || Be(e).position === "fixed")
4761
+ if (!qe(e) || Ue(e).position === "fixed")
4752
4762
  return null;
4753
4763
  if (t)
4754
4764
  return t(e);
4755
4765
  let n = e.offsetParent;
4756
- return qe(e) === n && (n = n.ownerDocument.body), n;
4766
+ return Ye(e) === n && (n = n.ownerDocument.body), n;
4757
4767
  }
4758
4768
  function li(e, t) {
4759
4769
  const n = Ie(e);
4760
- if (cr(e))
4770
+ if (ir(e))
4761
4771
  return n;
4762
- if (!Ge(e)) {
4772
+ if (!qe(e)) {
4763
4773
  let o = at(e);
4764
4774
  for (; o && !Mt(o); ) {
4765
- if ($e(o) && !Lr(o))
4775
+ if (Be(o) && !Dr(o))
4766
4776
  return o;
4767
4777
  o = at(o);
4768
4778
  }
4769
4779
  return n;
4770
4780
  }
4771
4781
  let r = Js(e, t);
4772
- for (; r && bh(r) && Lr(r); )
4782
+ for (; r && bh(r) && Dr(r); )
4773
4783
  r = Js(r, t);
4774
- return r && Mt(r) && Lr(r) && !ko(r) ? n : r || Sh(e) || n;
4784
+ return r && Mt(r) && Dr(r) && !ko(r) ? n : r || Sh(e) || n;
4775
4785
  }
4776
4786
  const Lh = async function(e) {
4777
4787
  const t = this.getOffsetParent || li, n = this.getDimensions, r = await n(e.floating);
@@ -4786,18 +4796,18 @@ const Lh = async function(e) {
4786
4796
  };
4787
4797
  };
4788
4798
  function Fh(e) {
4789
- return Be(e).direction === "rtl";
4799
+ return Ue(e).direction === "rtl";
4790
4800
  }
4791
4801
  const $h = {
4792
4802
  convertOffsetParentRelativeRectToViewportRelativeRect: Nh,
4793
- getDocumentElement: qe,
4803
+ getDocumentElement: Ye,
4794
4804
  getClippingRect: Mh,
4795
4805
  getOffsetParent: li,
4796
4806
  getElementRects: Lh,
4797
4807
  getClientRects: Th,
4798
4808
  getDimensions: kh,
4799
4809
  getScale: Pt,
4800
- isElement: $e,
4810
+ isElement: Be,
4801
4811
  isRTL: Fh
4802
4812
  };
4803
4813
  function ui(e, t) {
@@ -4805,7 +4815,7 @@ function ui(e, t) {
4805
4815
  }
4806
4816
  function Bh(e, t) {
4807
4817
  let n = null, r;
4808
- const o = qe(e);
4818
+ const o = Ye(e);
4809
4819
  function s() {
4810
4820
  var i;
4811
4821
  clearTimeout(r), (i = n) == null || i.disconnect(), n = null;
@@ -4820,7 +4830,7 @@ function Bh(e, t) {
4820
4830
  } = f;
4821
4831
  if (i || t(), !m || !v)
4822
4832
  return;
4823
- const h = xn(p), g = xn(o.clientWidth - (d + m)), b = xn(o.clientHeight - (p + v)), w = xn(d), x = {
4833
+ const h = yn(p), g = yn(o.clientWidth - (d + m)), b = yn(o.clientHeight - (p + v)), w = yn(d), x = {
4824
4834
  rootMargin: -h + "px " + -g + "px " + -b + "px " + -w + "px",
4825
4835
  threshold: _e(0, st(1, u)) || 1
4826
4836
  };
@@ -4857,7 +4867,7 @@ function Uh(e, t, n, r) {
4857
4867
  elementResize: a = typeof ResizeObserver == "function",
4858
4868
  layoutShift: i = typeof IntersectionObserver == "function",
4859
4869
  animationFrame: u = !1
4860
- } = r, f = Lo(e), d = o || s ? [...f ? nn(f) : [], ...nn(t)] : [];
4870
+ } = r, f = Lo(e), d = o || s ? [...f ? tn(f) : [], ...tn(t)] : [];
4861
4871
  d.forEach((w) => {
4862
4872
  o && w.addEventListener("scroll", n, {
4863
4873
  passive: !0
@@ -4899,8 +4909,8 @@ const zh = dh, Hh = fh, Wh = ch, Vh = hh, jh = lh, Zs = ih, Kh = ph, Gh = (e, t,
4899
4909
  });
4900
4910
  };
4901
4911
  var qh = typeof document < "u", Yh = function() {
4902
- }, _n = qh ? Uu : Yh;
4903
- function jn(e, t) {
4912
+ }, Pn = qh ? Uu : Yh;
4913
+ function Vn(e, t) {
4904
4914
  if (e === t)
4905
4915
  return !0;
4906
4916
  if (typeof e != typeof t)
@@ -4912,7 +4922,7 @@ function jn(e, t) {
4912
4922
  if (Array.isArray(e)) {
4913
4923
  if (n = e.length, n !== t.length) return !1;
4914
4924
  for (r = n; r-- !== 0; )
4915
- if (!jn(e[r], t[r]))
4925
+ if (!Vn(e[r], t[r]))
4916
4926
  return !1;
4917
4927
  return !0;
4918
4928
  }
@@ -4923,7 +4933,7 @@ function jn(e, t) {
4923
4933
  return !1;
4924
4934
  for (r = n; r-- !== 0; ) {
4925
4935
  const s = o[r];
4926
- if (!(s === "_owner" && e.$$typeof) && !jn(e[s], t[s]))
4936
+ if (!(s === "_owner" && e.$$typeof) && !Vn(e[s], t[s]))
4927
4937
  return !1;
4928
4938
  }
4929
4939
  return !0;
@@ -4937,9 +4947,9 @@ function Qs(e, t) {
4937
4947
  const n = di(e);
4938
4948
  return Math.round(t * n) / n;
4939
4949
  }
4940
- function Fr(e) {
4950
+ function Lr(e) {
4941
4951
  const t = l.useRef(e);
4942
- return _n(() => {
4952
+ return Pn(() => {
4943
4953
  t.current = e;
4944
4954
  }), t;
4945
4955
  }
@@ -4965,12 +4975,12 @@ function Xh(e) {
4965
4975
  middlewareData: {},
4966
4976
  isPositioned: !1
4967
4977
  }), [m, v] = l.useState(r);
4968
- jn(m, r) || v(r);
4978
+ Vn(m, r) || v(r);
4969
4979
  const [h, g] = l.useState(null), [b, w] = l.useState(null), y = l.useCallback((T) => {
4970
4980
  T !== I.current && (I.current = T, g(T));
4971
4981
  }, []), x = l.useCallback((T) => {
4972
4982
  T !== R.current && (R.current = T, w(T));
4973
- }, []), E = s || h, C = a || b, I = l.useRef(null), R = l.useRef(null), D = l.useRef(d), M = u != null, k = Fr(u), j = Fr(o), K = Fr(f), W = l.useCallback(() => {
4983
+ }, []), E = s || h, C = a || b, I = l.useRef(null), R = l.useRef(null), D = l.useRef(d), M = u != null, k = Lr(u), j = Lr(o), K = Lr(f), W = l.useCallback(() => {
4974
4984
  if (!I.current || !R.current)
4975
4985
  return;
4976
4986
  const T = {
@@ -4987,21 +4997,21 @@ function Xh(e) {
4987
4997
  // setting it to `true` when `open === false` (must be specified).
4988
4998
  isPositioned: K.current !== !1
4989
4999
  };
4990
- B.current && !jn(D.current, _) && (D.current = _, Zn.flushSync(() => {
5000
+ B.current && !Vn(D.current, _) && (D.current = _, Jn.flushSync(() => {
4991
5001
  p(_);
4992
5002
  }));
4993
5003
  });
4994
5004
  }, [m, t, n, j, K]);
4995
- _n(() => {
5005
+ Pn(() => {
4996
5006
  f === !1 && D.current.isPositioned && (D.current.isPositioned = !1, p((T) => ({
4997
5007
  ...T,
4998
5008
  isPositioned: !1
4999
5009
  })));
5000
5010
  }, [f]);
5001
5011
  const B = l.useRef(!1);
5002
- _n(() => (B.current = !0, () => {
5012
+ Pn(() => (B.current = !0, () => {
5003
5013
  B.current = !1;
5004
- }), []), _n(() => {
5014
+ }), []), Pn(() => {
5005
5015
  if (E && (I.current = E), C && (R.current = C), E && C) {
5006
5016
  if (k.current)
5007
5017
  return k.current(E, C, W);
@@ -5127,7 +5137,7 @@ function pi(e) {
5127
5137
  n(void 0);
5128
5138
  }, [e]), t;
5129
5139
  }
5130
- var Fo = "Popper", [hi, zt] = ze(Fo), [im, mi] = hi(Fo), gi = (e) => {
5140
+ var Fo = "Popper", [hi, zt] = He(Fo), [im, mi] = hi(Fo), gi = (e) => {
5131
5141
  const { __scopePopper: t, children: n } = e, [r, o] = l.useState(null);
5132
5142
  return /* @__PURE__ */ c(im, { scope: t, anchor: r, onAnchorChange: o, children: n });
5133
5143
  };
@@ -5195,7 +5205,7 @@ var $o = "PopperContent", [cm, lm] = hi($o), wi = l.forwardRef(
5195
5205
  fm({ arrowWidth: R, arrowHeight: D }),
5196
5206
  m && rm({ strategy: "referenceHidden", ...W })
5197
5207
  ]
5198
- }), [P, _] = Si(L), O = ve(h);
5208
+ }), [P, _] = Si(L), O = we(h);
5199
5209
  be(() => {
5200
5210
  G && (O == null || O());
5201
5211
  }, [G, O]);
@@ -5325,21 +5335,21 @@ function Si(e) {
5325
5335
  const [t, n = "center"] = e.split("-");
5326
5336
  return [t, n];
5327
5337
  }
5328
- var Bo = gi, Uo = vi, zo = wi, Ho = xi, pm = "Portal", dr = l.forwardRef((e, t) => {
5338
+ var Bo = gi, Uo = vi, zo = wi, Ho = xi, pm = "Portal", ur = l.forwardRef((e, t) => {
5329
5339
  var i;
5330
5340
  const { container: n, ...r } = e, [o, s] = l.useState(!1);
5331
5341
  be(() => s(!0), []);
5332
5342
  const a = n || o && ((i = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : i.body);
5333
5343
  return a ? cd.createPortal(/* @__PURE__ */ c(J.div, { ...r, ref: t }), a) : null;
5334
5344
  });
5335
- dr.displayName = pm;
5336
- var $r = "rovingFocusGroup.onEntryFocus", hm = { bubbles: !1, cancelable: !0 }, mn = "RovingFocusGroup", [so, Ci, mm] = Po(mn), [gm, Ei] = ze(
5337
- mn,
5345
+ ur.displayName = pm;
5346
+ var Fr = "rovingFocusGroup.onEntryFocus", hm = { bubbles: !1, cancelable: !0 }, hn = "RovingFocusGroup", [oo, Ci, mm] = Po(hn), [gm, Ei] = He(
5347
+ hn,
5338
5348
  [mm]
5339
- ), [bm, vm] = gm(mn), Ri = l.forwardRef(
5340
- (e, t) => /* @__PURE__ */ c(so.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ c(so.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ c(wm, { ...e, ref: t }) }) })
5349
+ ), [bm, vm] = gm(hn), Ri = l.forwardRef(
5350
+ (e, t) => /* @__PURE__ */ c(oo.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ c(oo.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ c(wm, { ...e, ref: t }) }) })
5341
5351
  );
5342
- Ri.displayName = mn;
5352
+ Ri.displayName = hn;
5343
5353
  var wm = l.forwardRef((e, t) => {
5344
5354
  const {
5345
5355
  __scopeRovingFocusGroup: n,
@@ -5352,16 +5362,16 @@ var wm = l.forwardRef((e, t) => {
5352
5362
  onEntryFocus: f,
5353
5363
  preventScrollOnEntryFocus: d = !1,
5354
5364
  ...p
5355
- } = e, m = l.useRef(null), v = te(t, m), h = sr(s), [g, b] = ot({
5365
+ } = e, m = l.useRef(null), v = te(t, m), h = or(s), [g, b] = ot({
5356
5366
  prop: a,
5357
5367
  defaultProp: i ?? null,
5358
5368
  onChange: u,
5359
- caller: mn
5360
- }), [w, y] = l.useState(!1), x = ve(f), E = Ci(n), C = l.useRef(!1), [I, R] = l.useState(0);
5369
+ caller: hn
5370
+ }), [w, y] = l.useState(!1), x = we(f), E = Ci(n), C = l.useRef(!1), [I, R] = l.useState(0);
5361
5371
  return l.useEffect(() => {
5362
5372
  const D = m.current;
5363
5373
  if (D)
5364
- return D.addEventListener($r, x), () => D.removeEventListener($r, x);
5374
+ return D.addEventListener(Fr, x), () => D.removeEventListener(Fr, x);
5365
5375
  }, [x]), /* @__PURE__ */ c(
5366
5376
  bm,
5367
5377
  {
@@ -5397,7 +5407,7 @@ var wm = l.forwardRef((e, t) => {
5397
5407
  onFocus: U(e.onFocus, (D) => {
5398
5408
  const M = !C.current;
5399
5409
  if (D.target === D.currentTarget && M && !w) {
5400
- const k = new CustomEvent($r, hm);
5410
+ const k = new CustomEvent(Fr, hm);
5401
5411
  if (D.currentTarget.dispatchEvent(k), !k.defaultPrevented) {
5402
5412
  const j = E().filter((L) => L.focusable), K = j.find((L) => L.active), W = j.find((L) => L.id === g), q = [K, W, ...j].filter(
5403
5413
  Boolean
@@ -5421,12 +5431,12 @@ var wm = l.forwardRef((e, t) => {
5421
5431
  tabStopId: s,
5422
5432
  children: a,
5423
5433
  ...i
5424
- } = e, u = Fe(), f = s || u, d = vm(Ni, n), p = d.currentTabStopId === f, m = Ci(n), { onFocusableItemAdd: v, onFocusableItemRemove: h, currentTabStopId: g } = d;
5434
+ } = e, u = $e(), f = s || u, d = vm(Ni, n), p = d.currentTabStopId === f, m = Ci(n), { onFocusableItemAdd: v, onFocusableItemRemove: h, currentTabStopId: g } = d;
5425
5435
  return l.useEffect(() => {
5426
5436
  if (r)
5427
5437
  return v(), () => h();
5428
5438
  }, [r, v, h]), /* @__PURE__ */ c(
5429
- so.ItemSlot,
5439
+ oo.ItemSlot,
5430
5440
  {
5431
5441
  scope: n,
5432
5442
  id: f,
@@ -5502,7 +5512,7 @@ var Em = Ri, Rm = Ti, Nm = function(e) {
5502
5512
  return null;
5503
5513
  var t = Array.isArray(e) ? e[0] : e;
5504
5514
  return t.ownerDocument.body;
5505
- }, Ct = /* @__PURE__ */ new WeakMap(), Sn = /* @__PURE__ */ new WeakMap(), Cn = {}, Br = 0, Pi = function(e) {
5515
+ }, Ct = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap(), Sn = {}, $r = 0, Pi = function(e) {
5506
5516
  return e && (e.host || Pi(e.parentNode));
5507
5517
  }, Tm = function(e, t) {
5508
5518
  return t.map(function(n) {
@@ -5515,8 +5525,8 @@ var Em = Ri, Rm = Ti, Nm = function(e) {
5515
5525
  });
5516
5526
  }, Am = function(e, t, n, r) {
5517
5527
  var o = Tm(t, Array.isArray(e) ? e : [e]);
5518
- Cn[n] || (Cn[n] = /* @__PURE__ */ new WeakMap());
5519
- var s = Cn[n], a = [], i = /* @__PURE__ */ new Set(), u = new Set(o), f = function(p) {
5528
+ Sn[n] || (Sn[n] = /* @__PURE__ */ new WeakMap());
5529
+ var s = Sn[n], a = [], i = /* @__PURE__ */ new Set(), u = new Set(o), f = function(p) {
5520
5530
  !p || i.has(p) || (i.add(p), f(p.parentNode));
5521
5531
  };
5522
5532
  o.forEach(f);
@@ -5527,17 +5537,17 @@ var Em = Ri, Rm = Ti, Nm = function(e) {
5527
5537
  else
5528
5538
  try {
5529
5539
  var v = m.getAttribute(r), h = v !== null && v !== "false", g = (Ct.get(m) || 0) + 1, b = (s.get(m) || 0) + 1;
5530
- Ct.set(m, g), s.set(m, b), a.push(m), g === 1 && h && Sn.set(m, !0), b === 1 && m.setAttribute(n, "true"), h || m.setAttribute(r, "true");
5540
+ Ct.set(m, g), s.set(m, b), a.push(m), g === 1 && h && xn.set(m, !0), b === 1 && m.setAttribute(n, "true"), h || m.setAttribute(r, "true");
5531
5541
  } catch (w) {
5532
5542
  console.error("aria-hidden: cannot operate on ", m, w);
5533
5543
  }
5534
5544
  });
5535
5545
  };
5536
- return d(t), i.clear(), Br++, function() {
5546
+ return d(t), i.clear(), $r++, function() {
5537
5547
  a.forEach(function(p) {
5538
5548
  var m = Ct.get(p) - 1, v = s.get(p) - 1;
5539
- Ct.set(p, m), s.set(p, v), m || (Sn.has(p) || p.removeAttribute(r), Sn.delete(p)), v || p.removeAttribute(n);
5540
- }), Br--, Br || (Ct = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(), Sn = /* @__PURE__ */ new WeakMap(), Cn = {});
5549
+ Ct.set(p, m), s.set(p, v), m || (xn.has(p) || p.removeAttribute(r), xn.delete(p)), v || p.removeAttribute(n);
5550
+ }), $r--, $r || (Ct = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap(), Sn = {});
5541
5551
  };
5542
5552
  }, Wo = function(e, t, n) {
5543
5553
  n === void 0 && (n = "data-aria-hidden");
@@ -5545,14 +5555,14 @@ var Em = Ri, Rm = Ti, Nm = function(e) {
5545
5555
  return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), Am(r, o, n, "aria-hidden")) : function() {
5546
5556
  return null;
5547
5557
  };
5548
- }, Ve = function() {
5549
- return Ve = Object.assign || function(t) {
5558
+ }, je = function() {
5559
+ return je = Object.assign || function(t) {
5550
5560
  for (var n, r = 1, o = arguments.length; r < o; r++) {
5551
5561
  n = arguments[r];
5552
5562
  for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
5553
5563
  }
5554
5564
  return t;
5555
- }, Ve.apply(this, arguments);
5565
+ }, je.apply(this, arguments);
5556
5566
  };
5557
5567
  function _i(e, t) {
5558
5568
  var n = {};
@@ -5567,8 +5577,8 @@ function Pm(e, t, n) {
5567
5577
  (s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
5568
5578
  return e.concat(s || Array.prototype.slice.call(t));
5569
5579
  }
5570
- var In = "right-scroll-bar-position", On = "width-before-scroll-bar", _m = "with-scroll-bars-hidden", Im = "--removed-body-scroll-bar-size";
5571
- function Ur(e, t) {
5580
+ var _n = "right-scroll-bar-position", In = "width-before-scroll-bar", _m = "with-scroll-bars-hidden", Im = "--removed-body-scroll-bar-size";
5581
+ function Br(e, t) {
5572
5582
  return typeof e == "function" ? e(t) : e && (e.current = t), e;
5573
5583
  }
5574
5584
  function Om(e, t) {
@@ -5596,7 +5606,7 @@ var Mm = typeof window < "u" ? l.useLayoutEffect : l.useEffect, ea = /* @__PURE_
5596
5606
  function km(e, t) {
5597
5607
  var n = Om(null, function(r) {
5598
5608
  return e.forEach(function(o) {
5599
- return Ur(o, r);
5609
+ return Br(o, r);
5600
5610
  });
5601
5611
  });
5602
5612
  return Mm(function() {
@@ -5604,9 +5614,9 @@ function km(e, t) {
5604
5614
  if (r) {
5605
5615
  var o = new Set(r), s = new Set(e), a = n.current;
5606
5616
  o.forEach(function(i) {
5607
- s.has(i) || Ur(i, null);
5617
+ s.has(i) || Br(i, null);
5608
5618
  }), s.forEach(function(i) {
5609
- o.has(i) || Ur(i, a);
5619
+ o.has(i) || Br(i, a);
5610
5620
  });
5611
5621
  }
5612
5622
  ea.set(n, e);
@@ -5673,7 +5683,7 @@ function Lm(e, t) {
5673
5683
  function Fm(e) {
5674
5684
  e === void 0 && (e = {});
5675
5685
  var t = Lm(null);
5676
- return t.options = Ve({ async: !0, ssr: !1 }, e), t;
5686
+ return t.options = je({ async: !0, ssr: !1 }, e), t;
5677
5687
  }
5678
5688
  var Ii = function(e) {
5679
5689
  var t = e.sideCar, n = _i(e, ["sideCar"]);
@@ -5682,34 +5692,34 @@ var Ii = function(e) {
5682
5692
  var r = t.read();
5683
5693
  if (!r)
5684
5694
  throw new Error("Sidecar medium not found");
5685
- return l.createElement(r, Ve({}, n));
5695
+ return l.createElement(r, je({}, n));
5686
5696
  };
5687
5697
  Ii.isSideCarExport = !0;
5688
5698
  function $m(e, t) {
5689
5699
  return e.useMedium(t), Ii;
5690
5700
  }
5691
- var Oi = Fm(), zr = function() {
5692
- }, fr = l.forwardRef(function(e, t) {
5701
+ var Oi = Fm(), Ur = function() {
5702
+ }, dr = l.forwardRef(function(e, t) {
5693
5703
  var n = l.useRef(null), r = l.useState({
5694
- onScrollCapture: zr,
5695
- onWheelCapture: zr,
5696
- onTouchMoveCapture: zr
5697
- }), o = r[0], s = r[1], a = e.forwardProps, i = e.children, u = e.className, f = e.removeScrollBar, d = e.enabled, p = e.shards, m = e.sideCar, v = e.noRelative, h = e.noIsolation, g = e.inert, b = e.allowPinchZoom, w = e.as, y = w === void 0 ? "div" : w, x = e.gapMode, E = _i(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = m, I = km([n, t]), R = Ve(Ve({}, E), o);
5704
+ onScrollCapture: Ur,
5705
+ onWheelCapture: Ur,
5706
+ onTouchMoveCapture: Ur
5707
+ }), o = r[0], s = r[1], a = e.forwardProps, i = e.children, u = e.className, f = e.removeScrollBar, d = e.enabled, p = e.shards, m = e.sideCar, v = e.noRelative, h = e.noIsolation, g = e.inert, b = e.allowPinchZoom, w = e.as, y = w === void 0 ? "div" : w, x = e.gapMode, E = _i(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = m, I = km([n, t]), R = je(je({}, E), o);
5698
5708
  return l.createElement(
5699
5709
  l.Fragment,
5700
5710
  null,
5701
5711
  d && l.createElement(C, { sideCar: Oi, removeScrollBar: f, shards: p, noRelative: v, noIsolation: h, inert: g, setCallbacks: s, allowPinchZoom: !!b, lockRef: n, gapMode: x }),
5702
- a ? l.cloneElement(l.Children.only(i), Ve(Ve({}, R), { ref: I })) : l.createElement(y, Ve({}, R, { className: u, ref: I }), i)
5712
+ a ? l.cloneElement(l.Children.only(i), je(je({}, R), { ref: I })) : l.createElement(y, je({}, R, { className: u, ref: I }), i)
5703
5713
  );
5704
5714
  });
5705
- fr.defaultProps = {
5715
+ dr.defaultProps = {
5706
5716
  enabled: !0,
5707
5717
  removeScrollBar: !0,
5708
5718
  inert: !1
5709
5719
  };
5710
- fr.classNames = {
5711
- fullWidth: On,
5712
- zeroRight: In
5720
+ dr.classNames = {
5721
+ fullWidth: In,
5722
+ zeroRight: _n
5713
5723
  };
5714
5724
  var Bm = function() {
5715
5725
  if (typeof __webpack_nonce__ < "u")
@@ -5760,11 +5770,11 @@ var Wm = function() {
5760
5770
  top: 0,
5761
5771
  right: 0,
5762
5772
  gap: 0
5763
- }, Hr = function(e) {
5773
+ }, zr = function(e) {
5764
5774
  return parseInt(e || "", 10) || 0;
5765
5775
  }, Km = function(e) {
5766
5776
  var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
5767
- return [Hr(n), Hr(r), Hr(o)];
5777
+ return [zr(n), zr(r), zr(o)];
5768
5778
  }, Gm = function(e) {
5769
5779
  if (e === void 0 && (e = "margin"), typeof window > "u")
5770
5780
  return jm;
@@ -5799,19 +5809,19 @@ var Wm = function() {
5799
5809
  ].filter(Boolean).join(""), `
5800
5810
  }
5801
5811
 
5802
- .`).concat(In, ` {
5812
+ .`).concat(_n, ` {
5803
5813
  right: `).concat(i, "px ").concat(r, `;
5804
5814
  }
5805
5815
 
5806
- .`).concat(On, ` {
5816
+ .`).concat(In, ` {
5807
5817
  margin-right: `).concat(i, "px ").concat(r, `;
5808
5818
  }
5809
5819
 
5810
- .`).concat(In, " .").concat(In, ` {
5820
+ .`).concat(_n, " .").concat(_n, ` {
5811
5821
  right: 0 `).concat(r, `;
5812
5822
  }
5813
5823
 
5814
- .`).concat(On, " .").concat(On, ` {
5824
+ .`).concat(In, " .").concat(In, ` {
5815
5825
  margin-right: 0 `).concat(r, `;
5816
5826
  }
5817
5827
 
@@ -5836,19 +5846,19 @@ var Wm = function() {
5836
5846
  return Gm(o);
5837
5847
  }, [o]);
5838
5848
  return l.createElement(qm, { styles: Ym(s, !t, o, n ? "" : "!important") });
5839
- }, ao = !1;
5849
+ }, so = !1;
5840
5850
  if (typeof window < "u")
5841
5851
  try {
5842
- var En = Object.defineProperty({}, "passive", {
5852
+ var Cn = Object.defineProperty({}, "passive", {
5843
5853
  get: function() {
5844
- return ao = !0, !0;
5854
+ return so = !0, !0;
5845
5855
  }
5846
5856
  });
5847
- window.addEventListener("test", En, En), window.removeEventListener("test", En, En);
5857
+ window.addEventListener("test", Cn, Cn), window.removeEventListener("test", Cn, Cn);
5848
5858
  } catch {
5849
- ao = !1;
5859
+ so = !1;
5850
5860
  }
5851
- var Et = ao ? { passive: !1 } : !1, Zm = function(e) {
5861
+ var Et = so ? { passive: !1 } : !1, Zm = function(e) {
5852
5862
  return e.tagName === "TEXTAREA";
5853
5863
  }, ki = function(e, t) {
5854
5864
  if (!(e instanceof Element))
@@ -5911,7 +5921,7 @@ var Et = ao ? { passive: !1 } : !1, Zm = function(e) {
5911
5921
  u && (t.contains(i) || t === i)
5912
5922
  );
5913
5923
  return (d && Math.abs(p) < 1 || !d && Math.abs(m) < 1) && (f = !0), f;
5914
- }, Rn = function(e) {
5924
+ }, En = function(e) {
5915
5925
  return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
5916
5926
  }, ra = function(e) {
5917
5927
  return [e.deltaX, e.deltaY];
@@ -5945,7 +5955,7 @@ function cg(e) {
5945
5955
  var i = l.useCallback(function(g, b) {
5946
5956
  if ("touches" in g && g.touches.length === 2 || g.type === "wheel" && g.ctrlKey)
5947
5957
  return !a.current.allowPinchZoom;
5948
- var w = Rn(g), y = n.current, x = "deltaX" in g ? g.deltaX : y[0] - w[0], E = "deltaY" in g ? g.deltaY : y[1] - w[1], C, I = g.target, R = Math.abs(x) > Math.abs(E) ? "h" : "v";
5958
+ var w = En(g), y = n.current, x = "deltaX" in g ? g.deltaX : y[0] - w[0], E = "deltaY" in g ? g.deltaY : y[1] - w[1], C, I = g.target, R = Math.abs(x) > Math.abs(E) ? "h" : "v";
5949
5959
  if ("touches" in g && R === "h" && I.type === "range")
5950
5960
  return !1;
5951
5961
  var D = na(R, I);
@@ -5960,7 +5970,7 @@ function cg(e) {
5960
5970
  }, []), u = l.useCallback(function(g) {
5961
5971
  var b = g;
5962
5972
  if (!(!Rt.length || Rt[Rt.length - 1] !== s)) {
5963
- var w = "deltaY" in b ? ra(b) : Rn(b), y = t.current.filter(function(C) {
5973
+ var w = "deltaY" in b ? ra(b) : En(b), y = t.current.filter(function(C) {
5964
5974
  return C.name === b.type && (C.target === b.target || b.target === C.shadowParent) && sg(C.delta, w);
5965
5975
  })[0];
5966
5976
  if (y && y.should) {
@@ -5982,11 +5992,11 @@ function cg(e) {
5982
5992
  });
5983
5993
  }, 1);
5984
5994
  }, []), d = l.useCallback(function(g) {
5985
- n.current = Rn(g), r.current = void 0;
5995
+ n.current = En(g), r.current = void 0;
5986
5996
  }, []), p = l.useCallback(function(g) {
5987
5997
  f(g.type, ra(g), g.target, i(g, e.lockRef.current));
5988
5998
  }, []), m = l.useCallback(function(g) {
5989
- f(g.type, Rn(g), g.target, i(g, e.lockRef.current));
5999
+ f(g.type, En(g), g.target, i(g, e.lockRef.current));
5990
6000
  }, []);
5991
6001
  l.useEffect(function() {
5992
6002
  return Rt.push(s), e.setCallbacks({
@@ -6013,22 +6023,22 @@ function lg(e) {
6013
6023
  return t;
6014
6024
  }
6015
6025
  const ug = $m(Oi, cg);
6016
- var pr = l.forwardRef(function(e, t) {
6017
- return l.createElement(fr, Ve({}, e, { ref: t, sideCar: ug }));
6026
+ var fr = l.forwardRef(function(e, t) {
6027
+ return l.createElement(dr, je({}, e, { ref: t, sideCar: ug }));
6018
6028
  });
6019
- pr.classNames = fr.classNames;
6020
- var io = ["Enter", " "], dg = ["ArrowDown", "PageUp", "Home"], Fi = ["ArrowUp", "PageDown", "End"], fg = [...dg, ...Fi], pg = {
6021
- ltr: [...io, "ArrowRight"],
6022
- rtl: [...io, "ArrowLeft"]
6029
+ fr.classNames = dr.classNames;
6030
+ var ao = ["Enter", " "], dg = ["ArrowDown", "PageUp", "Home"], Fi = ["ArrowUp", "PageDown", "End"], fg = [...dg, ...Fi], pg = {
6031
+ ltr: [...ao, "ArrowRight"],
6032
+ rtl: [...ao, "ArrowLeft"]
6023
6033
  }, hg = {
6024
6034
  ltr: ["ArrowLeft"],
6025
6035
  rtl: ["ArrowRight"]
6026
- }, gn = "Menu", [rn, mg, gg] = Po(gn), [yt, $i] = ze(gn, [
6036
+ }, mn = "Menu", [nn, mg, gg] = Po(mn), [yt, $i] = He(mn, [
6027
6037
  gg,
6028
6038
  zt,
6029
6039
  Ei
6030
- ]), hr = zt(), Bi = Ei(), [bg, xt] = yt(gn), [vg, bn] = yt(gn), Ui = (e) => {
6031
- const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: a = !0 } = e, i = hr(t), [u, f] = l.useState(null), d = l.useRef(!1), p = ve(s), m = sr(o);
6040
+ ]), pr = zt(), Bi = Ei(), [bg, xt] = yt(mn), [vg, gn] = yt(mn), Ui = (e) => {
6041
+ const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: a = !0 } = e, i = pr(t), [u, f] = l.useState(null), d = l.useRef(!1), p = we(s), m = or(o);
6032
6042
  return l.useEffect(() => {
6033
6043
  const v = () => {
6034
6044
  d.current = !0, document.addEventListener("pointerdown", h, { capture: !0, once: !0 }), document.addEventListener("pointermove", h, { capture: !0, once: !0 });
@@ -6058,10 +6068,10 @@ var io = ["Enter", " "], dg = ["ArrowDown", "PageUp", "Home"], Fi = ["ArrowUp",
6058
6068
  }
6059
6069
  ) });
6060
6070
  };
6061
- Ui.displayName = gn;
6071
+ Ui.displayName = mn;
6062
6072
  var wg = "MenuAnchor", Vo = l.forwardRef(
6063
6073
  (e, t) => {
6064
- const { __scopeMenu: n, ...r } = e, o = hr(n);
6074
+ const { __scopeMenu: n, ...r } = e, o = pr(n);
6065
6075
  return /* @__PURE__ */ c(Uo, { ...o, ...r, ref: t });
6066
6076
  }
6067
6077
  );
@@ -6070,13 +6080,13 @@ var jo = "MenuPortal", [yg, zi] = yt(jo, {
6070
6080
  forceMount: void 0
6071
6081
  }), Hi = (e) => {
6072
6082
  const { __scopeMenu: t, forceMount: n, children: r, container: o } = e, s = xt(jo, t);
6073
- return /* @__PURE__ */ c(yg, { scope: t, forceMount: n, children: /* @__PURE__ */ c(Pe, { present: n || s.open, children: /* @__PURE__ */ c(dr, { asChild: !0, container: o, children: r }) }) });
6083
+ return /* @__PURE__ */ c(yg, { scope: t, forceMount: n, children: /* @__PURE__ */ c(Pe, { present: n || s.open, children: /* @__PURE__ */ c(ur, { asChild: !0, container: o, children: r }) }) });
6074
6084
  };
6075
6085
  Hi.displayName = jo;
6076
6086
  var Me = "MenuContent", [xg, Ko] = yt(Me), Wi = l.forwardRef(
6077
6087
  (e, t) => {
6078
- const n = zi(Me, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = xt(Me, e.__scopeMenu), a = bn(Me, e.__scopeMenu);
6079
- return /* @__PURE__ */ c(rn.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(Pe, { present: r || s.open, children: /* @__PURE__ */ c(rn.Slot, { scope: e.__scopeMenu, children: a.modal ? /* @__PURE__ */ c(Sg, { ...o, ref: t }) : /* @__PURE__ */ c(Cg, { ...o, ref: t }) }) }) });
6088
+ const n = zi(Me, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = xt(Me, e.__scopeMenu), a = gn(Me, e.__scopeMenu);
6089
+ return /* @__PURE__ */ c(nn.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(Pe, { present: r || s.open, children: /* @__PURE__ */ c(nn.Slot, { scope: e.__scopeMenu, children: a.modal ? /* @__PURE__ */ c(Sg, { ...o, ref: t }) : /* @__PURE__ */ c(Cg, { ...o, ref: t }) }) }) });
6080
6090
  }
6081
6091
  ), Sg = l.forwardRef(
6082
6092
  (e, t) => {
@@ -6131,7 +6141,7 @@ var Me = "MenuContent", [xg, Ko] = yt(Me), Wi = l.forwardRef(
6131
6141
  onDismiss: v,
6132
6142
  disableOutsideScroll: h,
6133
6143
  ...g
6134
- } = e, b = xt(Me, n), w = bn(Me, n), y = hr(n), x = Bi(n), E = mg(n), [C, I] = l.useState(null), R = l.useRef(null), D = te(t, R, b.onContentChange), M = l.useRef(0), k = l.useRef(""), j = l.useRef(0), K = l.useRef(null), W = l.useRef("right"), B = l.useRef(0), q = h ? pr : l.Fragment, L = h ? { as: Eg, allowPinchZoom: !0 } : void 0, G = (P) => {
6144
+ } = e, b = xt(Me, n), w = gn(Me, n), y = pr(n), x = Bi(n), E = mg(n), [C, I] = l.useState(null), R = l.useRef(null), D = te(t, R, b.onContentChange), M = l.useRef(0), k = l.useRef(""), j = l.useRef(0), K = l.useRef(null), W = l.useRef("right"), B = l.useRef(0), q = h ? fr : l.Fragment, L = h ? { as: Eg, allowPinchZoom: !0 } : void 0, G = (P) => {
6135
6145
  var V, re;
6136
6146
  const _ = k.current + P, O = E().filter((ie) => !ie.disabled), Y = document.activeElement, $ = (V = O.find((ie) => ie.ref.current === Y)) == null ? void 0 : V.textValue, z = O.map((ie) => ie.textValue), le = Lg(z, _, $), se = (re = O.find((ie) => ie.textValue === le)) == null ? void 0 : re.ref.current;
6137
6147
  (function ie(oe) {
@@ -6172,7 +6182,7 @@ var Me = "MenuContent", [xg, Ko] = yt(Me), Wi = l.forwardRef(
6172
6182
  K.current = P;
6173
6183
  }, []),
6174
6184
  children: /* @__PURE__ */ c(q, { ...L, children: /* @__PURE__ */ c(
6175
- ar,
6185
+ sr,
6176
6186
  {
6177
6187
  asChild: !0,
6178
6188
  trapped: o,
@@ -6182,7 +6192,7 @@ var Me = "MenuContent", [xg, Ko] = yt(Me), Wi = l.forwardRef(
6182
6192
  }),
6183
6193
  onUnmountAutoFocus: a,
6184
6194
  children: /* @__PURE__ */ c(
6185
- pn,
6195
+ fn,
6186
6196
  {
6187
6197
  asChild: !0,
6188
6198
  disableOutsidePointerEvents: i,
@@ -6231,7 +6241,7 @@ var Me = "MenuContent", [xg, Ko] = yt(Me), Wi = l.forwardRef(
6231
6241
  }),
6232
6242
  onPointerMove: U(
6233
6243
  e.onPointerMove,
6234
- on((P) => {
6244
+ rn((P) => {
6235
6245
  const _ = P.target, O = B.current !== P.clientX;
6236
6246
  if (P.currentTarget.contains(_) && O) {
6237
6247
  const Y = P.clientX > B.current ? "right" : "left";
@@ -6266,9 +6276,9 @@ var Ng = "MenuLabel", Vi = l.forwardRef(
6266
6276
  }
6267
6277
  );
6268
6278
  Vi.displayName = Ng;
6269
- var Kn = "MenuItem", sa = "menu.itemSelect", mr = l.forwardRef(
6279
+ var jn = "MenuItem", sa = "menu.itemSelect", hr = l.forwardRef(
6270
6280
  (e, t) => {
6271
- const { disabled: n = !1, onSelect: r, ...o } = e, s = l.useRef(null), a = bn(Kn, e.__scopeMenu), i = Ko(Kn, e.__scopeMenu), u = te(t, s), f = l.useRef(!1), d = () => {
6281
+ const { disabled: n = !1, onSelect: r, ...o } = e, s = l.useRef(null), a = gn(jn, e.__scopeMenu), i = Ko(jn, e.__scopeMenu), u = te(t, s), f = l.useRef(!1), d = () => {
6272
6282
  const p = s.current;
6273
6283
  if (!n && p) {
6274
6284
  const m = new CustomEvent(sa, { bubbles: !0, cancelable: !0 });
@@ -6292,21 +6302,21 @@ var Kn = "MenuItem", sa = "menu.itemSelect", mr = l.forwardRef(
6292
6302
  }),
6293
6303
  onKeyDown: U(e.onKeyDown, (p) => {
6294
6304
  const m = i.searchRef.current !== "";
6295
- n || m && p.key === " " || io.includes(p.key) && (p.currentTarget.click(), p.preventDefault());
6305
+ n || m && p.key === " " || ao.includes(p.key) && (p.currentTarget.click(), p.preventDefault());
6296
6306
  })
6297
6307
  }
6298
6308
  );
6299
6309
  }
6300
6310
  );
6301
- mr.displayName = Kn;
6311
+ hr.displayName = jn;
6302
6312
  var ji = l.forwardRef(
6303
6313
  (e, t) => {
6304
- const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, a = Ko(Kn, n), i = Bi(n), u = l.useRef(null), f = te(t, u), [d, p] = l.useState(!1), [m, v] = l.useState("");
6314
+ const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, a = Ko(jn, n), i = Bi(n), u = l.useRef(null), f = te(t, u), [d, p] = l.useState(!1), [m, v] = l.useState("");
6305
6315
  return l.useEffect(() => {
6306
6316
  const h = u.current;
6307
6317
  h && v((h.textContent ?? "").trim());
6308
6318
  }, [s.children]), /* @__PURE__ */ c(
6309
- rn.ItemSlot,
6319
+ nn.ItemSlot,
6310
6320
  {
6311
6321
  scope: n,
6312
6322
  disabled: r,
@@ -6322,13 +6332,13 @@ var ji = l.forwardRef(
6322
6332
  ref: f,
6323
6333
  onPointerMove: U(
6324
6334
  e.onPointerMove,
6325
- on((h) => {
6335
+ rn((h) => {
6326
6336
  r ? a.onItemLeave(h) : (a.onItemEnter(h), h.defaultPrevented || h.currentTarget.focus({ preventScroll: !0 }));
6327
6337
  })
6328
6338
  ),
6329
6339
  onPointerLeave: U(
6330
6340
  e.onPointerLeave,
6331
- on((h) => a.onItemLeave(h))
6341
+ rn((h) => a.onItemLeave(h))
6332
6342
  ),
6333
6343
  onFocus: U(e.onFocus, () => p(!0)),
6334
6344
  onBlur: U(e.onBlur, () => p(!1))
@@ -6341,16 +6351,16 @@ var ji = l.forwardRef(
6341
6351
  (e, t) => {
6342
6352
  const { checked: n = !1, onCheckedChange: r, ...o } = e;
6343
6353
  return /* @__PURE__ */ c(Ji, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ c(
6344
- mr,
6354
+ hr,
6345
6355
  {
6346
6356
  role: "menuitemcheckbox",
6347
- "aria-checked": Gn(n) ? "mixed" : n,
6357
+ "aria-checked": Kn(n) ? "mixed" : n,
6348
6358
  ...o,
6349
6359
  ref: t,
6350
6360
  "data-state": Xo(n),
6351
6361
  onSelect: U(
6352
6362
  o.onSelect,
6353
- () => r == null ? void 0 : r(Gn(n) ? !0 : !n),
6363
+ () => r == null ? void 0 : r(Kn(n) ? !0 : !n),
6354
6364
  { checkForDefaultPrevented: !1 }
6355
6365
  )
6356
6366
  }
@@ -6364,7 +6374,7 @@ var Gi = "MenuRadioGroup", [Ag, Pg] = yt(
6364
6374
  } }
6365
6375
  ), qi = l.forwardRef(
6366
6376
  (e, t) => {
6367
- const { value: n, onValueChange: r, ...o } = e, s = ve(r);
6377
+ const { value: n, onValueChange: r, ...o } = e, s = we(r);
6368
6378
  return /* @__PURE__ */ c(Ag, { scope: e.__scopeMenu, value: n, onValueChange: s, children: /* @__PURE__ */ c(qo, { ...o, ref: t }) });
6369
6379
  }
6370
6380
  );
@@ -6373,7 +6383,7 @@ var Yi = "MenuRadioItem", Xi = l.forwardRef(
6373
6383
  (e, t) => {
6374
6384
  const { value: n, ...r } = e, o = Pg(Yi, e.__scopeMenu), s = n === o.value;
6375
6385
  return /* @__PURE__ */ c(Ji, { scope: e.__scopeMenu, checked: s, children: /* @__PURE__ */ c(
6376
- mr,
6386
+ hr,
6377
6387
  {
6378
6388
  role: "menuitemradio",
6379
6389
  "aria-checked": s,
@@ -6402,7 +6412,7 @@ var Yo = "MenuItemIndicator", [Ji, _g] = yt(
6402
6412
  return /* @__PURE__ */ c(
6403
6413
  Pe,
6404
6414
  {
6405
- present: r || Gn(s.checked) || s.checked === !0,
6415
+ present: r || Kn(s.checked) || s.checked === !0,
6406
6416
  children: /* @__PURE__ */ c(
6407
6417
  J.span,
6408
6418
  {
@@ -6433,14 +6443,14 @@ var Ig = "MenuSeparator", Qi = l.forwardRef(
6433
6443
  Qi.displayName = Ig;
6434
6444
  var Og = "MenuArrow", ec = l.forwardRef(
6435
6445
  (e, t) => {
6436
- const { __scopeMenu: n, ...r } = e, o = hr(n);
6446
+ const { __scopeMenu: n, ...r } = e, o = pr(n);
6437
6447
  return /* @__PURE__ */ c(Ho, { ...o, ...r, ref: t });
6438
6448
  }
6439
6449
  );
6440
6450
  ec.displayName = Og;
6441
6451
  var Mg = "MenuSub", [Ey, tc] = yt(Mg), qt = "MenuSubTrigger", nc = l.forwardRef(
6442
6452
  (e, t) => {
6443
- const n = xt(qt, e.__scopeMenu), r = bn(qt, e.__scopeMenu), o = tc(qt, e.__scopeMenu), s = Ko(qt, e.__scopeMenu), a = l.useRef(null), { pointerGraceTimerRef: i, onPointerGraceIntentChange: u } = s, f = { __scopeMenu: e.__scopeMenu }, d = l.useCallback(() => {
6453
+ const n = xt(qt, e.__scopeMenu), r = gn(qt, e.__scopeMenu), o = tc(qt, e.__scopeMenu), s = Ko(qt, e.__scopeMenu), a = l.useRef(null), { pointerGraceTimerRef: i, onPointerGraceIntentChange: u } = s, f = { __scopeMenu: e.__scopeMenu }, d = l.useCallback(() => {
6444
6454
  a.current && window.clearTimeout(a.current), a.current = null;
6445
6455
  }, []);
6446
6456
  return l.useEffect(() => d, [d]), l.useEffect(() => {
@@ -6464,7 +6474,7 @@ var Mg = "MenuSub", [Ey, tc] = yt(Mg), qt = "MenuSubTrigger", nc = l.forwardRef(
6464
6474
  },
6465
6475
  onPointerMove: U(
6466
6476
  e.onPointerMove,
6467
- on((p) => {
6477
+ rn((p) => {
6468
6478
  s.onItemEnter(p), !p.defaultPrevented && !e.disabled && !n.open && !a.current && (s.onPointerGraceIntentChange(null), a.current = window.setTimeout(() => {
6469
6479
  n.onOpenChange(!0), d();
6470
6480
  }, 100));
@@ -6472,7 +6482,7 @@ var Mg = "MenuSub", [Ey, tc] = yt(Mg), qt = "MenuSubTrigger", nc = l.forwardRef(
6472
6482
  ),
6473
6483
  onPointerLeave: U(
6474
6484
  e.onPointerLeave,
6475
- on((p) => {
6485
+ rn((p) => {
6476
6486
  var v, h;
6477
6487
  d();
6478
6488
  const m = (v = n.content) == null ? void 0 : v.getBoundingClientRect();
@@ -6511,8 +6521,8 @@ var Mg = "MenuSub", [Ey, tc] = yt(Mg), qt = "MenuSubTrigger", nc = l.forwardRef(
6511
6521
  nc.displayName = qt;
6512
6522
  var rc = "MenuSubContent", oc = l.forwardRef(
6513
6523
  (e, t) => {
6514
- const n = zi(Me, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = xt(Me, e.__scopeMenu), a = bn(Me, e.__scopeMenu), i = tc(rc, e.__scopeMenu), u = l.useRef(null), f = te(t, u);
6515
- return /* @__PURE__ */ c(rn.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(Pe, { present: r || s.open, children: /* @__PURE__ */ c(rn.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(
6524
+ const n = zi(Me, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = xt(Me, e.__scopeMenu), a = gn(Me, e.__scopeMenu), i = tc(rc, e.__scopeMenu), u = l.useRef(null), f = te(t, u);
6525
+ return /* @__PURE__ */ c(nn.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(Pe, { present: r || s.open, children: /* @__PURE__ */ c(nn.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(
6516
6526
  Go,
6517
6527
  {
6518
6528
  id: i.contentId,
@@ -6548,11 +6558,11 @@ oc.displayName = rc;
6548
6558
  function sc(e) {
6549
6559
  return e ? "open" : "closed";
6550
6560
  }
6551
- function Gn(e) {
6561
+ function Kn(e) {
6552
6562
  return e === "indeterminate";
6553
6563
  }
6554
6564
  function Xo(e) {
6555
- return Gn(e) ? "indeterminate" : e ? "checked" : "unchecked";
6565
+ return Kn(e) ? "indeterminate" : e ? "checked" : "unchecked";
6556
6566
  }
6557
6567
  function kg(e) {
6558
6568
  const t = document.activeElement;
@@ -6585,13 +6595,13 @@ function $g(e, t) {
6585
6595
  const n = { x: e.clientX, y: e.clientY };
6586
6596
  return Fg(n, t);
6587
6597
  }
6588
- function on(e) {
6598
+ function rn(e) {
6589
6599
  return (t) => t.pointerType === "mouse" ? e(t) : void 0;
6590
6600
  }
6591
- var Bg = Ui, Ug = Vo, zg = Hi, Hg = Wi, Wg = qo, Vg = Vi, jg = mr, Kg = Ki, Gg = qi, qg = Xi, Yg = Zi, Xg = Qi, Jg = ec, Zg = nc, Qg = oc, gr = "DropdownMenu", [eb, Ry] = ze(
6592
- gr,
6601
+ var Bg = Ui, Ug = Vo, zg = Hi, Hg = Wi, Wg = qo, Vg = Vi, jg = hr, Kg = Ki, Gg = qi, qg = Xi, Yg = Zi, Xg = Qi, Jg = ec, Zg = nc, Qg = oc, mr = "DropdownMenu", [eb, Ry] = He(
6602
+ mr,
6593
6603
  [$i]
6594
- ), Ce = $i(), [tb, ac] = eb(gr), ic = (e) => {
6604
+ ), Ce = $i(), [tb, ac] = eb(mr), ic = (e) => {
6595
6605
  const {
6596
6606
  __scopeDropdownMenu: t,
6597
6607
  children: n,
@@ -6604,15 +6614,15 @@ var Bg = Ui, Ug = Vo, zg = Hi, Hg = Wi, Wg = qo, Vg = Vi, jg = mr, Kg = Ki, Gg =
6604
6614
  prop: o,
6605
6615
  defaultProp: s ?? !1,
6606
6616
  onChange: a,
6607
- caller: gr
6617
+ caller: mr
6608
6618
  });
6609
6619
  return /* @__PURE__ */ c(
6610
6620
  tb,
6611
6621
  {
6612
6622
  scope: t,
6613
- triggerId: Fe(),
6623
+ triggerId: $e(),
6614
6624
  triggerRef: f,
6615
- contentId: Fe(),
6625
+ contentId: $e(),
6616
6626
  open: d,
6617
6627
  onOpenChange: p,
6618
6628
  onOpenToggle: l.useCallback(() => p((m) => !m), [p]),
@@ -6621,7 +6631,7 @@ var Bg = Ui, Ug = Vo, zg = Hi, Hg = Wi, Wg = qo, Vg = Vi, jg = mr, Kg = Ki, Gg =
6621
6631
  }
6622
6632
  );
6623
6633
  };
6624
- ic.displayName = gr;
6634
+ ic.displayName = mr;
6625
6635
  var cc = "DropdownMenuTrigger", lc = l.forwardRef(
6626
6636
  (e, t) => {
6627
6637
  const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = ac(cc, n), a = Ce(n);
@@ -6831,7 +6841,7 @@ const Eb = l.forwardRef(({ className: e, children: t, checked: n, ...r }, o) =>
6831
6841
  checked: n,
6832
6842
  ...r,
6833
6843
  children: [
6834
- /* @__PURE__ */ c("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ c(Nc, { children: /* @__PURE__ */ c(yo, { className: "h-4 w-4" }) }) }),
6844
+ /* @__PURE__ */ c("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ c(Nc, { children: /* @__PURE__ */ c(wo, { className: "h-4 w-4" }) }) }),
6835
6845
  t
6836
6846
  ]
6837
6847
  }
@@ -6875,7 +6885,7 @@ const Tb = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
6875
6885
  }
6876
6886
  ));
6877
6887
  Tb.displayName = Tc.displayName;
6878
- function Mn({
6888
+ function On({
6879
6889
  className: e = "",
6880
6890
  placeholder: t = "Type your message...",
6881
6891
  autoFocus: n = !0,
@@ -6899,22 +6909,22 @@ function Mn({
6899
6909
  listCheckpoints: y,
6900
6910
  navigateToCheckpoint: x,
6901
6911
  returnToLatest: E
6902
- } = ja(), [C, I] = ce(""), [R, D] = ce(null), [M, k] = ce(null), [j, K] = ce([]), [W, B] = ce(!1), [q, L] = ce([]), [G, T] = ce(null), P = nt(null), _ = nt(null), O = nt(null), [Y, $] = ce("desktop");
6903
- we(() => {
6912
+ } = ja(), [C, I] = ce(""), [R, D] = ce(null), [M, k] = ce(null), [j, K] = ce([]), [W, B] = ce(!1), [q, L] = ce([]), [G, T] = ce(null), P = rt(null), _ = rt(null), O = rt(null), [Y, $] = ce("desktop");
6913
+ ve(() => {
6904
6914
  const F = () => {
6905
6915
  const Q = window.innerWidth;
6906
6916
  $(Q < 640 ? "phone" : Q < 1024 ? "tablet" : "desktop");
6907
6917
  };
6908
6918
  return F(), window.addEventListener("resize", F), () => window.removeEventListener("resize", F);
6909
- }, []), we(() => {
6919
+ }, []), ve(() => {
6910
6920
  var F;
6911
6921
  (F = P.current) == null || F.scrollIntoView({ behavior: "smooth" });
6912
- }, [p]), we(() => {
6922
+ }, [p]), ve(() => {
6913
6923
  var F;
6914
6924
  n && ((F = _.current) == null || F.focus());
6915
- }, [n]), we(() => {
6925
+ }, [n]), ve(() => {
6916
6926
  h && !W && (f == null || f(h));
6917
- }, [h, W, f]), we(() => {
6927
+ }, [h, W, f]), ve(() => {
6918
6928
  let F = !0;
6919
6929
  if (!d) {
6920
6930
  L([]), T(null);
@@ -6933,7 +6943,7 @@ function Mn({
6933
6943
  }), () => {
6934
6944
  F = !1;
6935
6945
  };
6936
- }, [d, y]), we(() => {
6946
+ }, [d, y]), ve(() => {
6937
6947
  w && T(w);
6938
6948
  }, [w]);
6939
6949
  const z = (F) => {
@@ -7139,7 +7149,18 @@ function Mn({
7139
7149
  M && /* @__PURE__ */ c("div", { className: "mb-3 text-sm text-red-600 bg-red-50 border border-red-200 rounded px-3 py-2", children: M }),
7140
7150
  /* @__PURE__ */ N("div", { className: "flex items-end gap-2", children: [
7141
7151
  s && /* @__PURE__ */ N(yb, { children: [
7142
- /* @__PURE__ */ c(xb, { asChild: !0, children: /* @__PURE__ */ c(fe, { type: "button", size: "icon", variant: "outline", disabled: m, title: "More input actions", className: `${i.moreButton || ""}`, children: /* @__PURE__ */ c(va, { size: 16 }) }) }),
7152
+ /* @__PURE__ */ c(xb, { asChild: !0, children: /* @__PURE__ */ c(
7153
+ fe,
7154
+ {
7155
+ type: "button",
7156
+ size: "icon",
7157
+ variant: "outline",
7158
+ disabled: m,
7159
+ title: "More input actions",
7160
+ className: i.moreButton || "",
7161
+ children: /* @__PURE__ */ c(va, { size: 16 })
7162
+ }
7163
+ ) }),
7143
7164
  /* @__PURE__ */ c(_c, { align: "start", sideOffset: 6, className: "w-52", children: /* @__PURE__ */ N(Ic, { onClick: () => {
7144
7165
  var F;
7145
7166
  return (F = O.current) == null ? void 0 : F.click();
@@ -7196,7 +7217,7 @@ function Mn({
7196
7217
  ] })
7197
7218
  ] });
7198
7219
  }
7199
- const sn = l.forwardRef(
7220
+ const on = l.forwardRef(
7200
7221
  ({ className: e, type: t, ...n }, r) => /* @__PURE__ */ c(
7201
7222
  "input",
7202
7223
  {
@@ -7210,14 +7231,14 @@ const sn = l.forwardRef(
7210
7231
  }
7211
7232
  )
7212
7233
  );
7213
- sn.displayName = "Input";
7214
- function co(e, [t, n]) {
7234
+ on.displayName = "Input";
7235
+ function io(e, [t, n]) {
7215
7236
  return Math.min(n, Math.max(t, e));
7216
7237
  }
7217
7238
  function Ab(e, t) {
7218
7239
  return l.useReducer((n, r) => t[n][r] ?? n, e);
7219
7240
  }
7220
- var Jo = "ScrollArea", [Oc, Ny] = ze(Jo), [Pb, ke] = Oc(Jo), Mc = l.forwardRef(
7241
+ var Jo = "ScrollArea", [Oc, Ny] = He(Jo), [Pb, De] = Oc(Jo), Mc = l.forwardRef(
7221
7242
  (e, t) => {
7222
7243
  const {
7223
7244
  __scopeScrollArea: n,
@@ -7225,7 +7246,7 @@ var Jo = "ScrollArea", [Oc, Ny] = ze(Jo), [Pb, ke] = Oc(Jo), Mc = l.forwardRef(
7225
7246
  dir: o,
7226
7247
  scrollHideDelay: s = 600,
7227
7248
  ...a
7228
- } = e, [i, u] = l.useState(null), [f, d] = l.useState(null), [p, m] = l.useState(null), [v, h] = l.useState(null), [g, b] = l.useState(null), [w, y] = l.useState(0), [x, E] = l.useState(0), [C, I] = l.useState(!1), [R, D] = l.useState(!1), M = te(t, (j) => u(j)), k = sr(o);
7249
+ } = e, [i, u] = l.useState(null), [f, d] = l.useState(null), [p, m] = l.useState(null), [v, h] = l.useState(null), [g, b] = l.useState(null), [w, y] = l.useState(0), [x, E] = l.useState(0), [C, I] = l.useState(!1), [R, D] = l.useState(!1), M = te(t, (j) => u(j)), k = or(o);
7229
7250
  return /* @__PURE__ */ c(
7230
7251
  Pb,
7231
7252
  {
@@ -7270,8 +7291,8 @@ var Jo = "ScrollArea", [Oc, Ny] = ze(Jo), [Pb, ke] = Oc(Jo), Mc = l.forwardRef(
7270
7291
  Mc.displayName = Jo;
7271
7292
  var kc = "ScrollAreaViewport", Dc = l.forwardRef(
7272
7293
  (e, t) => {
7273
- const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, a = ke(kc, n), i = l.useRef(null), u = te(t, i, a.onViewportChange);
7274
- return /* @__PURE__ */ N(Le, { children: [
7294
+ const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, a = De(kc, n), i = l.useRef(null), u = te(t, i, a.onViewportChange);
7295
+ return /* @__PURE__ */ N(Fe, { children: [
7275
7296
  /* @__PURE__ */ c(
7276
7297
  "style",
7277
7298
  {
@@ -7310,17 +7331,17 @@ var kc = "ScrollAreaViewport", Dc = l.forwardRef(
7310
7331
  }
7311
7332
  );
7312
7333
  Dc.displayName = kc;
7313
- var Ye = "ScrollAreaScrollbar", Zo = l.forwardRef(
7334
+ var Xe = "ScrollAreaScrollbar", Zo = l.forwardRef(
7314
7335
  (e, t) => {
7315
- const { forceMount: n, ...r } = e, o = ke(Ye, e.__scopeScrollArea), { onScrollbarXEnabledChange: s, onScrollbarYEnabledChange: a } = o, i = e.orientation === "horizontal";
7336
+ const { forceMount: n, ...r } = e, o = De(Xe, e.__scopeScrollArea), { onScrollbarXEnabledChange: s, onScrollbarYEnabledChange: a } = o, i = e.orientation === "horizontal";
7316
7337
  return l.useEffect(() => (i ? s(!0) : a(!0), () => {
7317
7338
  i ? s(!1) : a(!1);
7318
7339
  }), [i, s, a]), o.type === "hover" ? /* @__PURE__ */ c(_b, { ...r, ref: t, forceMount: n }) : o.type === "scroll" ? /* @__PURE__ */ c(Ib, { ...r, ref: t, forceMount: n }) : o.type === "auto" ? /* @__PURE__ */ c(Lc, { ...r, ref: t, forceMount: n }) : o.type === "always" ? /* @__PURE__ */ c(Qo, { ...r, ref: t }) : null;
7319
7340
  }
7320
7341
  );
7321
- Zo.displayName = Ye;
7342
+ Zo.displayName = Xe;
7322
7343
  var _b = l.forwardRef((e, t) => {
7323
- const { forceMount: n, ...r } = e, o = ke(Ye, e.__scopeScrollArea), [s, a] = l.useState(!1);
7344
+ const { forceMount: n, ...r } = e, o = De(Xe, e.__scopeScrollArea), [s, a] = l.useState(!1);
7324
7345
  return l.useEffect(() => {
7325
7346
  const i = o.scrollArea;
7326
7347
  let u = 0;
@@ -7343,7 +7364,7 @@ var _b = l.forwardRef((e, t) => {
7343
7364
  }
7344
7365
  ) });
7345
7366
  }), Ib = l.forwardRef((e, t) => {
7346
- const { forceMount: n, ...r } = e, o = ke(Ye, e.__scopeScrollArea), s = e.orientation === "horizontal", a = vr(() => u("SCROLL_END"), 100), [i, u] = Ab("hidden", {
7367
+ const { forceMount: n, ...r } = e, o = De(Xe, e.__scopeScrollArea), s = e.orientation === "horizontal", a = br(() => u("SCROLL_END"), 100), [i, u] = Ab("hidden", {
7347
7368
  hidden: {
7348
7369
  SCROLL: "scrolling"
7349
7370
  },
@@ -7387,7 +7408,7 @@ var _b = l.forwardRef((e, t) => {
7387
7408
  }
7388
7409
  ) });
7389
7410
  }), Lc = l.forwardRef((e, t) => {
7390
- const n = ke(Ye, e.__scopeScrollArea), { forceMount: r, ...o } = e, [s, a] = l.useState(!1), i = e.orientation === "horizontal", u = vr(() => {
7411
+ const n = De(Xe, e.__scopeScrollArea), { forceMount: r, ...o } = e, [s, a] = l.useState(!1), i = e.orientation === "horizontal", u = br(() => {
7391
7412
  if (n.viewport) {
7392
7413
  const f = n.viewport.offsetWidth < n.viewport.scrollWidth, d = n.viewport.offsetHeight < n.viewport.scrollHeight;
7393
7414
  a(i ? f : d);
@@ -7402,7 +7423,7 @@ var _b = l.forwardRef((e, t) => {
7402
7423
  }
7403
7424
  ) });
7404
7425
  }), Qo = l.forwardRef((e, t) => {
7405
- const { orientation: n = "vertical", ...r } = e, o = ke(Ye, e.__scopeScrollArea), s = l.useRef(null), a = l.useRef(0), [i, u] = l.useState({
7426
+ const { orientation: n = "vertical", ...r } = e, o = De(Xe, e.__scopeScrollArea), s = l.useRef(null), a = l.useRef(0), [i, u] = l.useState({
7406
7427
  content: 0,
7407
7428
  viewport: 0,
7408
7429
  scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
@@ -7456,7 +7477,7 @@ var _b = l.forwardRef((e, t) => {
7456
7477
  }
7457
7478
  ) : null;
7458
7479
  }), Ob = l.forwardRef((e, t) => {
7459
- const { sizes: n, onSizesChange: r, ...o } = e, s = ke(Ye, e.__scopeScrollArea), [a, i] = l.useState(), u = l.useRef(null), f = te(t, u, s.onScrollbarXChange);
7480
+ const { sizes: n, onSizesChange: r, ...o } = e, s = De(Xe, e.__scopeScrollArea), [a, i] = l.useState(), u = l.useRef(null), f = te(t, u, s.onScrollbarXChange);
7460
7481
  return l.useEffect(() => {
7461
7482
  u.current && i(getComputedStyle(u.current));
7462
7483
  }, [u]), /* @__PURE__ */ c(
@@ -7470,7 +7491,7 @@ var _b = l.forwardRef((e, t) => {
7470
7491
  bottom: 0,
7471
7492
  left: s.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
7472
7493
  right: s.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
7473
- "--radix-scroll-area-thumb-width": br(n) + "px",
7494
+ "--radix-scroll-area-thumb-width": gr(n) + "px",
7474
7495
  ...e.style
7475
7496
  },
7476
7497
  onThumbPointerDown: (d) => e.onThumbPointerDown(d.x),
@@ -7487,15 +7508,15 @@ var _b = l.forwardRef((e, t) => {
7487
7508
  viewport: s.viewport.offsetWidth,
7488
7509
  scrollbar: {
7489
7510
  size: u.current.clientWidth,
7490
- paddingStart: Yn(a.paddingLeft),
7491
- paddingEnd: Yn(a.paddingRight)
7511
+ paddingStart: qn(a.paddingLeft),
7512
+ paddingEnd: qn(a.paddingRight)
7492
7513
  }
7493
7514
  });
7494
7515
  }
7495
7516
  }
7496
7517
  );
7497
7518
  }), Mb = l.forwardRef((e, t) => {
7498
- const { sizes: n, onSizesChange: r, ...o } = e, s = ke(Ye, e.__scopeScrollArea), [a, i] = l.useState(), u = l.useRef(null), f = te(t, u, s.onScrollbarYChange);
7519
+ const { sizes: n, onSizesChange: r, ...o } = e, s = De(Xe, e.__scopeScrollArea), [a, i] = l.useState(), u = l.useRef(null), f = te(t, u, s.onScrollbarYChange);
7499
7520
  return l.useEffect(() => {
7500
7521
  u.current && i(getComputedStyle(u.current));
7501
7522
  }, [u]), /* @__PURE__ */ c(
@@ -7510,7 +7531,7 @@ var _b = l.forwardRef((e, t) => {
7510
7531
  right: s.dir === "ltr" ? 0 : void 0,
7511
7532
  left: s.dir === "rtl" ? 0 : void 0,
7512
7533
  bottom: "var(--radix-scroll-area-corner-height)",
7513
- "--radix-scroll-area-thumb-height": br(n) + "px",
7534
+ "--radix-scroll-area-thumb-height": gr(n) + "px",
7514
7535
  ...e.style
7515
7536
  },
7516
7537
  onThumbPointerDown: (d) => e.onThumbPointerDown(d.y),
@@ -7527,14 +7548,14 @@ var _b = l.forwardRef((e, t) => {
7527
7548
  viewport: s.viewport.offsetHeight,
7528
7549
  scrollbar: {
7529
7550
  size: u.current.clientHeight,
7530
- paddingStart: Yn(a.paddingTop),
7531
- paddingEnd: Yn(a.paddingBottom)
7551
+ paddingStart: qn(a.paddingTop),
7552
+ paddingEnd: qn(a.paddingBottom)
7532
7553
  }
7533
7554
  });
7534
7555
  }
7535
7556
  }
7536
7557
  );
7537
- }), [kb, Fc] = Oc(Ye), $c = l.forwardRef((e, t) => {
7558
+ }), [kb, Fc] = Oc(Xe), $c = l.forwardRef((e, t) => {
7538
7559
  const {
7539
7560
  __scopeScrollArea: n,
7540
7561
  sizes: r,
@@ -7547,7 +7568,7 @@ var _b = l.forwardRef((e, t) => {
7547
7568
  onWheelScroll: d,
7548
7569
  onResize: p,
7549
7570
  ...m
7550
- } = e, v = ke(Ye, n), [h, g] = l.useState(null), b = te(t, (M) => g(M)), w = l.useRef(null), y = l.useRef(""), x = v.viewport, E = r.content - r.viewport, C = ve(d), I = ve(u), R = vr(p, 10);
7571
+ } = e, v = De(Xe, n), [h, g] = l.useState(null), b = te(t, (M) => g(M)), w = l.useRef(null), y = l.useRef(""), x = v.viewport, E = r.content - r.viewport, C = we(d), I = we(u), R = br(p, 10);
7551
7572
  function D(M) {
7552
7573
  if (w.current) {
7553
7574
  const k = M.clientX - w.current.left, j = M.clientY - w.current.top;
@@ -7566,10 +7587,10 @@ var _b = l.forwardRef((e, t) => {
7566
7587
  scope: n,
7567
7588
  scrollbar: h,
7568
7589
  hasThumb: o,
7569
- onThumbChange: ve(s),
7570
- onThumbPointerUp: ve(a),
7590
+ onThumbChange: we(s),
7591
+ onThumbPointerUp: we(a),
7571
7592
  onThumbPositionChange: I,
7572
- onThumbPointerDown: ve(i),
7593
+ onThumbPointerDown: we(i),
7573
7594
  children: /* @__PURE__ */ c(
7574
7595
  J.div,
7575
7596
  {
@@ -7588,17 +7609,17 @@ var _b = l.forwardRef((e, t) => {
7588
7609
  )
7589
7610
  }
7590
7611
  );
7591
- }), qn = "ScrollAreaThumb", Bc = l.forwardRef(
7612
+ }), Gn = "ScrollAreaThumb", Bc = l.forwardRef(
7592
7613
  (e, t) => {
7593
- const { forceMount: n, ...r } = e, o = Fc(qn, e.__scopeScrollArea);
7614
+ const { forceMount: n, ...r } = e, o = Fc(Gn, e.__scopeScrollArea);
7594
7615
  return /* @__PURE__ */ c(Pe, { present: n || o.hasThumb, children: /* @__PURE__ */ c(Db, { ref: t, ...r }) });
7595
7616
  }
7596
7617
  ), Db = l.forwardRef(
7597
7618
  (e, t) => {
7598
- const { __scopeScrollArea: n, style: r, ...o } = e, s = ke(qn, n), a = Fc(qn, n), { onThumbPositionChange: i } = a, u = te(
7619
+ const { __scopeScrollArea: n, style: r, ...o } = e, s = De(Gn, n), a = Fc(Gn, n), { onThumbPositionChange: i } = a, u = te(
7599
7620
  t,
7600
7621
  (p) => a.onThumbChange(p)
7601
- ), f = l.useRef(void 0), d = vr(() => {
7622
+ ), f = l.useRef(void 0), d = br(() => {
7602
7623
  f.current && (f.current(), f.current = void 0);
7603
7624
  }, 100);
7604
7625
  return l.useEffect(() => {
@@ -7632,16 +7653,16 @@ var _b = l.forwardRef((e, t) => {
7632
7653
  );
7633
7654
  }
7634
7655
  );
7635
- Bc.displayName = qn;
7656
+ Bc.displayName = Gn;
7636
7657
  var es = "ScrollAreaCorner", Uc = l.forwardRef(
7637
7658
  (e, t) => {
7638
- const n = ke(es, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
7659
+ const n = De(es, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
7639
7660
  return n.type !== "scroll" && r ? /* @__PURE__ */ c(Lb, { ...e, ref: t }) : null;
7640
7661
  }
7641
7662
  );
7642
7663
  Uc.displayName = es;
7643
7664
  var Lb = l.forwardRef((e, t) => {
7644
- const { __scopeScrollArea: n, ...r } = e, o = ke(es, n), [s, a] = l.useState(0), [i, u] = l.useState(0), f = !!(s && i);
7665
+ const { __scopeScrollArea: n, ...r } = e, o = De(es, n), [s, a] = l.useState(0), [i, u] = l.useState(0), f = !!(s && i);
7645
7666
  return kt(o.scrollbarX, () => {
7646
7667
  var p;
7647
7668
  const d = ((p = o.scrollbarX) == null ? void 0 : p.offsetHeight) || 0;
@@ -7667,23 +7688,23 @@ var Lb = l.forwardRef((e, t) => {
7667
7688
  }
7668
7689
  ) : null;
7669
7690
  });
7670
- function Yn(e) {
7691
+ function qn(e) {
7671
7692
  return e ? parseInt(e, 10) : 0;
7672
7693
  }
7673
7694
  function zc(e, t) {
7674
7695
  const n = e / t;
7675
7696
  return isNaN(n) ? 0 : n;
7676
7697
  }
7677
- function br(e) {
7698
+ function gr(e) {
7678
7699
  const t = zc(e.viewport, e.content), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, r = (e.scrollbar.size - n) * t;
7679
7700
  return Math.max(r, 18);
7680
7701
  }
7681
7702
  function Fb(e, t, n, r = "ltr") {
7682
- const o = br(n), s = o / 2, a = t || s, i = o - a, u = n.scrollbar.paddingStart + a, f = n.scrollbar.size - n.scrollbar.paddingEnd - i, d = n.content - n.viewport, p = r === "ltr" ? [0, d] : [d * -1, 0];
7703
+ const o = gr(n), s = o / 2, a = t || s, i = o - a, u = n.scrollbar.paddingStart + a, f = n.scrollbar.size - n.scrollbar.paddingEnd - i, d = n.content - n.viewport, p = r === "ltr" ? [0, d] : [d * -1, 0];
7683
7704
  return Hc([u, f], p)(e);
7684
7705
  }
7685
7706
  function aa(e, t, n = "ltr") {
7686
- const r = br(t), o = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, s = t.scrollbar.size - o, a = t.content - t.viewport, i = s - r, u = n === "ltr" ? [0, a] : [a * -1, 0], f = co(e, u);
7707
+ const r = gr(t), o = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, s = t.scrollbar.size - o, a = t.content - t.viewport, i = s - r, u = n === "ltr" ? [0, a] : [a * -1, 0], f = io(e, u);
7687
7708
  return Hc([0, a], [0, i])(f);
7688
7709
  }
7689
7710
  function Hc(e, t) {
@@ -7704,14 +7725,14 @@ var $b = (e, t = () => {
7704
7725
  (a || i) && t(), n = s, r = window.requestAnimationFrame(o);
7705
7726
  }(), () => window.cancelAnimationFrame(r);
7706
7727
  };
7707
- function vr(e, t) {
7708
- const n = ve(e), r = l.useRef(0);
7728
+ function br(e, t) {
7729
+ const n = we(e), r = l.useRef(0);
7709
7730
  return l.useEffect(() => () => window.clearTimeout(r.current), []), l.useCallback(() => {
7710
7731
  window.clearTimeout(r.current), r.current = window.setTimeout(n, t);
7711
7732
  }, [n, t]);
7712
7733
  }
7713
7734
  function kt(e, t) {
7714
- const n = ve(t);
7735
+ const n = we(t);
7715
7736
  be(() => {
7716
7737
  let r = 0;
7717
7738
  if (e) {
@@ -7755,7 +7776,7 @@ const Kc = l.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r)
7755
7776
  }
7756
7777
  ));
7757
7778
  Kc.displayName = Zo.displayName;
7758
- function lo({
7779
+ function co({
7759
7780
  className: e = "",
7760
7781
  showCreateButton: t = !0,
7761
7782
  showDeleteButton: n = !0,
@@ -7777,7 +7798,7 @@ function lo({
7777
7798
  deleteThread: b,
7778
7799
  renameThread: w
7779
7800
  } = ja(), [y, x] = ce(m ?? []), [E, C] = ce(!1), [I, R] = ce(null), [D, M] = ce(null), [k, j] = ce(""), [K, W] = ce(!1);
7780
- we(() => {
7801
+ ve(() => {
7781
7802
  x(m ?? []);
7782
7803
  }, [m]);
7783
7804
  const B = async ($) => {
@@ -7841,10 +7862,10 @@ function lo({
7841
7862
  children: [
7842
7863
  /* @__PURE__ */ N("div", { className: "flex items-center justify-between", children: [
7843
7864
  /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: D === $.threadId ? /* @__PURE__ */ N("div", { className: "flex items-center gap-2", onClick: (z) => z.stopPropagation(), children: [
7844
- /* @__PURE__ */ c(sn, { value: k, onChange: (z) => j(z.target.value), onKeyDown: (z) => _(z, $.threadId), className: "h-6 text-sm", autoFocus: !0 }),
7845
- /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: () => T($.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(yo, { size: 12 }) }),
7865
+ /* @__PURE__ */ c(on, { value: k, onChange: (z) => j(z.target.value), onKeyDown: (z) => _(z, $.threadId), className: "h-6 text-sm", autoFocus: !0 }),
7866
+ /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: () => T($.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(wo, { size: 12 }) }),
7846
7867
  /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: P, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(Xt, { size: 12 }) })
7847
- ] }) : /* @__PURE__ */ N(Le, { children: [
7868
+ ] }) : /* @__PURE__ */ N(Fe, { children: [
7848
7869
  /* @__PURE__ */ c("div", { className: "font-medium text-sm truncate text-slate-100", children: Y($) }),
7849
7870
  /* @__PURE__ */ N("div", { className: "flex items-center gap-2 text-xs text-slate-400 mt-1", children: [
7850
7871
  /* @__PURE__ */ c(Yu, { size: 10 }),
@@ -7875,7 +7896,7 @@ function lo({
7875
7896
  }
7876
7897
  const Gc = pa(null);
7877
7898
  function Ty({ children: e, basePath: t = "/chat" }) {
7878
- const n = tt(() => t ? t === "/" ? "" : t.endsWith("/") ? t.slice(0, -1) : t : "/chat", [t]), r = {
7899
+ const n = nt(() => t ? t === "/" ? "" : t.endsWith("/") ? t.slice(0, -1) : t : "/chat", [t]), r = {
7879
7900
  basePath: n,
7880
7901
  buildThreadPath: (o) => `${n}/${o}`,
7881
7902
  buildBasePath: () => n
@@ -7954,14 +7975,14 @@ function Py() {
7954
7975
  function _y(e) {
7955
7976
  e.apiKey && mt.setAuthToken(e.apiKey), Kb(e);
7956
7977
  }
7957
- const Wr = 768;
7978
+ const Hr = 768;
7958
7979
  function Gb() {
7959
7980
  const [e, t] = l.useState(void 0);
7960
7981
  return l.useEffect(() => {
7961
- const n = window.matchMedia(`(max-width: ${Wr - 1}px)`), r = () => {
7962
- t(window.innerWidth < Wr);
7982
+ const n = window.matchMedia(`(max-width: ${Hr - 1}px)`), r = () => {
7983
+ t(window.innerWidth < Hr);
7963
7984
  };
7964
- return n.addEventListener("change", r), t(window.innerWidth < Wr), () => n.removeEventListener("change", r);
7985
+ return n.addEventListener("change", r), t(window.innerWidth < Hr), () => n.removeEventListener("change", r);
7965
7986
  }, []), !!e;
7966
7987
  }
7967
7988
  var qb = "Separator", ca = "horizontal", Yb = ["horizontal", "vertical"], Yc = l.forwardRef((e, t) => {
@@ -7998,7 +8019,7 @@ const ts = l.forwardRef(
7998
8019
  )
7999
8020
  );
8000
8021
  ts.displayName = Xc.displayName;
8001
- var wr = "Dialog", [Jc, Iy] = ze(wr), [Jb, He] = Jc(wr), Zc = (e) => {
8022
+ var vr = "Dialog", [Jc, Iy] = He(vr), [Jb, We] = Jc(vr), Zc = (e) => {
8002
8023
  const {
8003
8024
  __scopeDialog: t,
8004
8025
  children: n,
@@ -8010,7 +8031,7 @@ var wr = "Dialog", [Jc, Iy] = ze(wr), [Jb, He] = Jc(wr), Zc = (e) => {
8010
8031
  prop: r,
8011
8032
  defaultProp: o ?? !1,
8012
8033
  onChange: s,
8013
- caller: wr
8034
+ caller: vr
8014
8035
  });
8015
8036
  return /* @__PURE__ */ c(
8016
8037
  Jb,
@@ -8018,9 +8039,9 @@ var wr = "Dialog", [Jc, Iy] = ze(wr), [Jb, He] = Jc(wr), Zc = (e) => {
8018
8039
  scope: t,
8019
8040
  triggerRef: i,
8020
8041
  contentRef: u,
8021
- contentId: Fe(),
8022
- titleId: Fe(),
8023
- descriptionId: Fe(),
8042
+ contentId: $e(),
8043
+ titleId: $e(),
8044
+ descriptionId: $e(),
8024
8045
  open: f,
8025
8046
  onOpenChange: d,
8026
8047
  onOpenToggle: l.useCallback(() => d((p) => !p), [d]),
@@ -8029,10 +8050,10 @@ var wr = "Dialog", [Jc, Iy] = ze(wr), [Jb, He] = Jc(wr), Zc = (e) => {
8029
8050
  }
8030
8051
  );
8031
8052
  };
8032
- Zc.displayName = wr;
8053
+ Zc.displayName = vr;
8033
8054
  var Qc = "DialogTrigger", el = l.forwardRef(
8034
8055
  (e, t) => {
8035
- const { __scopeDialog: n, ...r } = e, o = He(Qc, n), s = te(t, o.triggerRef);
8056
+ const { __scopeDialog: n, ...r } = e, o = We(Qc, n), s = te(t, o.triggerRef);
8036
8057
  return /* @__PURE__ */ c(
8037
8058
  J.button,
8038
8059
  {
@@ -8052,24 +8073,24 @@ el.displayName = Qc;
8052
8073
  var ns = "DialogPortal", [Zb, tl] = Jc(ns, {
8053
8074
  forceMount: void 0
8054
8075
  }), nl = (e) => {
8055
- const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, s = He(ns, t);
8056
- return /* @__PURE__ */ c(Zb, { scope: t, forceMount: n, children: l.Children.map(r, (a) => /* @__PURE__ */ c(Pe, { present: n || s.open, children: /* @__PURE__ */ c(dr, { asChild: !0, container: o, children: a }) })) });
8076
+ const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, s = We(ns, t);
8077
+ return /* @__PURE__ */ c(Zb, { scope: t, forceMount: n, children: l.Children.map(r, (a) => /* @__PURE__ */ c(Pe, { present: n || s.open, children: /* @__PURE__ */ c(ur, { asChild: !0, container: o, children: a }) })) });
8057
8078
  };
8058
8079
  nl.displayName = ns;
8059
- var Xn = "DialogOverlay", rl = l.forwardRef(
8080
+ var Yn = "DialogOverlay", rl = l.forwardRef(
8060
8081
  (e, t) => {
8061
- const n = tl(Xn, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = He(Xn, e.__scopeDialog);
8082
+ const n = tl(Yn, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = We(Yn, e.__scopeDialog);
8062
8083
  return s.modal ? /* @__PURE__ */ c(Pe, { present: r || s.open, children: /* @__PURE__ */ c(ev, { ...o, ref: t }) }) : null;
8063
8084
  }
8064
8085
  );
8065
- rl.displayName = Xn;
8086
+ rl.displayName = Yn;
8066
8087
  var Qb = It("DialogOverlay.RemoveScroll"), ev = l.forwardRef(
8067
8088
  (e, t) => {
8068
- const { __scopeDialog: n, ...r } = e, o = He(Xn, n);
8089
+ const { __scopeDialog: n, ...r } = e, o = We(Yn, n);
8069
8090
  return (
8070
8091
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
8071
8092
  // ie. when `Overlay` and `Content` are siblings
8072
- /* @__PURE__ */ c(pr, { as: Qb, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ c(
8093
+ /* @__PURE__ */ c(fr, { as: Qb, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ c(
8073
8094
  J.div,
8074
8095
  {
8075
8096
  "data-state": os(o.open),
@@ -8082,14 +8103,14 @@ var Qb = It("DialogOverlay.RemoveScroll"), ev = l.forwardRef(
8082
8103
  }
8083
8104
  ), bt = "DialogContent", ol = l.forwardRef(
8084
8105
  (e, t) => {
8085
- const n = tl(bt, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = He(bt, e.__scopeDialog);
8106
+ const n = tl(bt, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = We(bt, e.__scopeDialog);
8086
8107
  return /* @__PURE__ */ c(Pe, { present: r || s.open, children: s.modal ? /* @__PURE__ */ c(tv, { ...o, ref: t }) : /* @__PURE__ */ c(nv, { ...o, ref: t }) });
8087
8108
  }
8088
8109
  );
8089
8110
  ol.displayName = bt;
8090
8111
  var tv = l.forwardRef(
8091
8112
  (e, t) => {
8092
- const n = He(bt, e.__scopeDialog), r = l.useRef(null), o = te(t, n.contentRef, r);
8113
+ const n = We(bt, e.__scopeDialog), r = l.useRef(null), o = te(t, n.contentRef, r);
8093
8114
  return l.useEffect(() => {
8094
8115
  const s = r.current;
8095
8116
  if (s) return Wo(s);
@@ -8117,7 +8138,7 @@ var tv = l.forwardRef(
8117
8138
  }
8118
8139
  ), nv = l.forwardRef(
8119
8140
  (e, t) => {
8120
- const n = He(bt, e.__scopeDialog), r = l.useRef(!1), o = l.useRef(!1);
8141
+ const n = We(bt, e.__scopeDialog), r = l.useRef(!1), o = l.useRef(!1);
8121
8142
  return /* @__PURE__ */ c(
8122
8143
  sl,
8123
8144
  {
@@ -8140,10 +8161,10 @@ var tv = l.forwardRef(
8140
8161
  }
8141
8162
  ), sl = l.forwardRef(
8142
8163
  (e, t) => {
8143
- const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...a } = e, i = He(bt, n), u = l.useRef(null), f = te(t, u);
8144
- return _o(), /* @__PURE__ */ N(Le, { children: [
8164
+ const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...a } = e, i = We(bt, n), u = l.useRef(null), f = te(t, u);
8165
+ return _o(), /* @__PURE__ */ N(Fe, { children: [
8145
8166
  /* @__PURE__ */ c(
8146
- ar,
8167
+ sr,
8147
8168
  {
8148
8169
  asChild: !0,
8149
8170
  loop: !0,
@@ -8151,7 +8172,7 @@ var tv = l.forwardRef(
8151
8172
  onMountAutoFocus: o,
8152
8173
  onUnmountAutoFocus: s,
8153
8174
  children: /* @__PURE__ */ c(
8154
- pn,
8175
+ fn,
8155
8176
  {
8156
8177
  role: "dialog",
8157
8178
  id: i.contentId,
@@ -8165,7 +8186,7 @@ var tv = l.forwardRef(
8165
8186
  )
8166
8187
  }
8167
8188
  ),
8168
- /* @__PURE__ */ N(Le, { children: [
8189
+ /* @__PURE__ */ N(Fe, { children: [
8169
8190
  /* @__PURE__ */ c(rv, { titleId: i.titleId }),
8170
8191
  /* @__PURE__ */ c(sv, { contentRef: u, descriptionId: i.descriptionId })
8171
8192
  ] })
@@ -8173,21 +8194,21 @@ var tv = l.forwardRef(
8173
8194
  }
8174
8195
  ), rs = "DialogTitle", al = l.forwardRef(
8175
8196
  (e, t) => {
8176
- const { __scopeDialog: n, ...r } = e, o = He(rs, n);
8197
+ const { __scopeDialog: n, ...r } = e, o = We(rs, n);
8177
8198
  return /* @__PURE__ */ c(J.h2, { id: o.titleId, ...r, ref: t });
8178
8199
  }
8179
8200
  );
8180
8201
  al.displayName = rs;
8181
8202
  var il = "DialogDescription", cl = l.forwardRef(
8182
8203
  (e, t) => {
8183
- const { __scopeDialog: n, ...r } = e, o = He(il, n);
8204
+ const { __scopeDialog: n, ...r } = e, o = We(il, n);
8184
8205
  return /* @__PURE__ */ c(J.p, { id: o.descriptionId, ...r, ref: t });
8185
8206
  }
8186
8207
  );
8187
8208
  cl.displayName = il;
8188
8209
  var ll = "DialogClose", ul = l.forwardRef(
8189
8210
  (e, t) => {
8190
- const { __scopeDialog: n, ...r } = e, o = He(ll, n);
8211
+ const { __scopeDialog: n, ...r } = e, o = We(ll, n);
8191
8212
  return /* @__PURE__ */ c(
8192
8213
  J.button,
8193
8214
  {
@@ -8236,7 +8257,7 @@ const bl = av, uv = iv, dv = cv, vl = l.forwardRef(({ className: e, ...t }, n) =
8236
8257
  }
8237
8258
  ));
8238
8259
  vl.displayName = pl.displayName;
8239
- const fv = cn(
8260
+ const fv = an(
8240
8261
  "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
8241
8262
  {
8242
8263
  variants: {
@@ -8337,9 +8358,9 @@ var Sl = Object.freeze({
8337
8358
  )
8338
8359
  );
8339
8360
  Cl.displayName = pv;
8340
- var hv = Cl, [yr, My] = ze("Tooltip", [
8361
+ var hv = Cl, [wr, My] = He("Tooltip", [
8341
8362
  zt
8342
- ]), xr = zt(), El = "TooltipProvider", mv = 700, uo = "tooltip.open", [gv, as] = yr(El), Rl = (e) => {
8363
+ ]), yr = zt(), El = "TooltipProvider", mv = 700, lo = "tooltip.open", [gv, as] = wr(El), Rl = (e) => {
8343
8364
  const {
8344
8365
  __scopeTooltip: t,
8345
8366
  delayDuration: n = mv,
@@ -8375,7 +8396,7 @@ var hv = Cl, [yr, My] = ze("Tooltip", [
8375
8396
  );
8376
8397
  };
8377
8398
  Rl.displayName = El;
8378
- var an = "Tooltip", [bv, Sr] = yr(an), Nl = (e) => {
8399
+ var sn = "Tooltip", [bv, xr] = wr(sn), Nl = (e) => {
8379
8400
  const {
8380
8401
  __scopeTooltip: t,
8381
8402
  children: n,
@@ -8384,13 +8405,13 @@ var an = "Tooltip", [bv, Sr] = yr(an), Nl = (e) => {
8384
8405
  onOpenChange: s,
8385
8406
  disableHoverableContent: a,
8386
8407
  delayDuration: i
8387
- } = e, u = as(an, e.__scopeTooltip), f = xr(t), [d, p] = l.useState(null), m = Fe(), v = l.useRef(0), h = a ?? u.disableHoverableContent, g = i ?? u.delayDuration, b = l.useRef(!1), [w, y] = ot({
8408
+ } = e, u = as(sn, e.__scopeTooltip), f = yr(t), [d, p] = l.useState(null), m = $e(), v = l.useRef(0), h = a ?? u.disableHoverableContent, g = i ?? u.delayDuration, b = l.useRef(!1), [w, y] = ot({
8388
8409
  prop: r,
8389
8410
  defaultProp: o ?? !1,
8390
8411
  onChange: (R) => {
8391
- R ? (u.onOpen(), document.dispatchEvent(new CustomEvent(uo))) : u.onClose(), s == null || s(R);
8412
+ R ? (u.onOpen(), document.dispatchEvent(new CustomEvent(lo))) : u.onClose(), s == null || s(R);
8392
8413
  },
8393
- caller: an
8414
+ caller: sn
8394
8415
  }), x = l.useMemo(() => w ? b.current ? "delayed-open" : "instant-open" : "closed", [w]), E = l.useCallback(() => {
8395
8416
  window.clearTimeout(v.current), v.current = 0, b.current = !1, y(!0);
8396
8417
  }, [y]), C = l.useCallback(() => {
@@ -8424,10 +8445,10 @@ var an = "Tooltip", [bv, Sr] = yr(an), Nl = (e) => {
8424
8445
  }
8425
8446
  ) });
8426
8447
  };
8427
- Nl.displayName = an;
8428
- var fo = "TooltipTrigger", Tl = l.forwardRef(
8448
+ Nl.displayName = sn;
8449
+ var uo = "TooltipTrigger", Tl = l.forwardRef(
8429
8450
  (e, t) => {
8430
- const { __scopeTooltip: n, ...r } = e, o = Sr(fo, n), s = as(fo, n), a = xr(n), i = l.useRef(null), u = te(t, i, o.onTriggerChange), f = l.useRef(!1), d = l.useRef(!1), p = l.useCallback(() => f.current = !1, []);
8451
+ const { __scopeTooltip: n, ...r } = e, o = xr(uo, n), s = as(uo, n), a = yr(n), i = l.useRef(null), u = te(t, i, o.onTriggerChange), f = l.useRef(!1), d = l.useRef(!1), p = l.useCallback(() => f.current = !1, []);
8431
8452
  return l.useEffect(() => () => document.removeEventListener("pointerup", p), [p]), /* @__PURE__ */ c(Uo, { asChild: !0, ...a, children: /* @__PURE__ */ c(
8432
8453
  J.button,
8433
8454
  {
@@ -8453,16 +8474,16 @@ var fo = "TooltipTrigger", Tl = l.forwardRef(
8453
8474
  ) });
8454
8475
  }
8455
8476
  );
8456
- Tl.displayName = fo;
8457
- var vv = "TooltipPortal", [ky, wv] = yr(vv, {
8477
+ Tl.displayName = uo;
8478
+ var vv = "TooltipPortal", [ky, wv] = wr(vv, {
8458
8479
  forceMount: void 0
8459
8480
  }), Dt = "TooltipContent", Al = l.forwardRef(
8460
8481
  (e, t) => {
8461
- const n = wv(Dt, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...s } = e, a = Sr(Dt, e.__scopeTooltip);
8482
+ const n = wv(Dt, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...s } = e, a = xr(Dt, e.__scopeTooltip);
8462
8483
  return /* @__PURE__ */ c(Pe, { present: r || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ c(Pl, { side: o, ...s, ref: t }) : /* @__PURE__ */ c(yv, { side: o, ...s, ref: t }) });
8463
8484
  }
8464
8485
  ), yv = l.forwardRef((e, t) => {
8465
- const n = Sr(Dt, e.__scopeTooltip), r = as(Dt, e.__scopeTooltip), o = l.useRef(null), s = te(t, o), [a, i] = l.useState(null), { trigger: u, onClose: f } = n, d = o.current, { onPointerInTransitChange: p } = r, m = l.useCallback(() => {
8486
+ const n = xr(Dt, e.__scopeTooltip), r = as(Dt, e.__scopeTooltip), o = l.useRef(null), s = te(t, o), [a, i] = l.useState(null), { trigger: u, onClose: f } = n, d = o.current, { onPointerInTransitChange: p } = r, m = l.useCallback(() => {
8466
8487
  i(null), p(!1);
8467
8488
  }, [p]), v = l.useCallback(
8468
8489
  (h, g) => {
@@ -8487,7 +8508,7 @@ var vv = "TooltipPortal", [ky, wv] = yr(vv, {
8487
8508
  return document.addEventListener("pointermove", h), () => document.removeEventListener("pointermove", h);
8488
8509
  }
8489
8510
  }, [u, d, a, f, m]), /* @__PURE__ */ c(Pl, { ...e, ref: s });
8490
- }), [xv, Sv] = yr(an, { isInside: !1 }), Cv = sd("TooltipContent"), Pl = l.forwardRef(
8511
+ }), [xv, Sv] = wr(sn, { isInside: !1 }), Cv = sd("TooltipContent"), Pl = l.forwardRef(
8491
8512
  (e, t) => {
8492
8513
  const {
8493
8514
  __scopeTooltip: n,
@@ -8496,8 +8517,8 @@ var vv = "TooltipPortal", [ky, wv] = yr(vv, {
8496
8517
  onEscapeKeyDown: s,
8497
8518
  onPointerDownOutside: a,
8498
8519
  ...i
8499
- } = e, u = Sr(Dt, n), f = xr(n), { onClose: d } = u;
8500
- return l.useEffect(() => (document.addEventListener(uo, d), () => document.removeEventListener(uo, d)), [d]), l.useEffect(() => {
8520
+ } = e, u = xr(Dt, n), f = yr(n), { onClose: d } = u;
8521
+ return l.useEffect(() => (document.addEventListener(lo, d), () => document.removeEventListener(lo, d)), [d]), l.useEffect(() => {
8501
8522
  if (u.trigger) {
8502
8523
  const p = (m) => {
8503
8524
  const v = m.target;
@@ -8506,7 +8527,7 @@ var vv = "TooltipPortal", [ky, wv] = yr(vv, {
8506
8527
  return window.addEventListener("scroll", p, { capture: !0 }), () => window.removeEventListener("scroll", p, { capture: !0 });
8507
8528
  }
8508
8529
  }, [u.trigger, d]), /* @__PURE__ */ c(
8509
- pn,
8530
+ fn,
8510
8531
  {
8511
8532
  asChild: !0,
8512
8533
  disableOutsidePointerEvents: !1,
@@ -8542,7 +8563,7 @@ var vv = "TooltipPortal", [ky, wv] = yr(vv, {
8542
8563
  Al.displayName = Dt;
8543
8564
  var _l = "TooltipArrow", Ev = l.forwardRef(
8544
8565
  (e, t) => {
8545
- const { __scopeTooltip: n, ...r } = e, o = xr(n);
8566
+ const { __scopeTooltip: n, ...r } = e, o = yr(n);
8546
8567
  return Sv(
8547
8568
  _l,
8548
8569
  n
@@ -8657,7 +8678,7 @@ const kv = Iv, Dv = Ov, Lv = Mv, Ol = l.forwardRef(({ className: e, sideOffset:
8657
8678
  ));
8658
8679
  Ol.displayName = Il.displayName;
8659
8680
  const Fv = "sidebar:state", $v = 60 * 60 * 24 * 7, Bv = "16rem", Uv = "18rem", zv = "3rem", Hv = "b", Ml = l.createContext(null);
8660
- function Cr() {
8681
+ function Sr() {
8661
8682
  const e = l.useContext(Ml);
8662
8683
  if (!e)
8663
8684
  throw new Error("useSidebar must be used within a SidebarProvider.");
@@ -8727,7 +8748,7 @@ const Dl = l.forwardRef(
8727
8748
  children: o,
8728
8749
  ...s
8729
8750
  }, a) => {
8730
- const { isMobile: i, state: u, openMobile: f, setOpenMobile: d } = Cr();
8751
+ const { isMobile: i, state: u, openMobile: f, setOpenMobile: d } = Sr();
8731
8752
  return n === "none" ? /* @__PURE__ */ c(
8732
8753
  "div",
8733
8754
  {
@@ -8800,7 +8821,7 @@ const Dl = l.forwardRef(
8800
8821
  );
8801
8822
  Dl.displayName = "Sidebar";
8802
8823
  const Ll = l.forwardRef(({ className: e, onClick: t, ...n }, r) => {
8803
- const { toggleSidebar: o } = Cr();
8824
+ const { toggleSidebar: o } = Sr();
8804
8825
  return /* @__PURE__ */ N(
8805
8826
  fe,
8806
8827
  {
@@ -8822,7 +8843,7 @@ const Ll = l.forwardRef(({ className: e, onClick: t, ...n }, r) => {
8822
8843
  });
8823
8844
  Ll.displayName = "SidebarTrigger";
8824
8845
  const Wv = l.forwardRef(({ className: e, ...t }, n) => {
8825
- const { toggleSidebar: r } = Cr();
8846
+ const { toggleSidebar: r } = Sr();
8826
8847
  return /* @__PURE__ */ c(
8827
8848
  "button",
8828
8849
  {
@@ -8860,7 +8881,7 @@ const Fl = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8860
8881
  ));
8861
8882
  Fl.displayName = "SidebarInset";
8862
8883
  const Vv = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8863
- sn,
8884
+ on,
8864
8885
  {
8865
8886
  ref: n,
8866
8887
  "data-sidebar": "input",
@@ -8985,7 +9006,7 @@ const Vl = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8985
9006
  }
8986
9007
  ));
8987
9008
  Vl.displayName = "SidebarMenuItem";
8988
- const qv = cn(
9009
+ const qv = an(
8989
9010
  "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
8990
9011
  {
8991
9012
  variants: {
@@ -9014,7 +9035,7 @@ const qv = cn(
9014
9035
  className: s,
9015
9036
  ...a
9016
9037
  }, i) => {
9017
- const u = e ? Lt : "button", { isMobile: f, state: d } = Cr(), p = /* @__PURE__ */ c(
9038
+ const u = e ? Lt : "button", { isMobile: f, state: d } = Sr(), p = /* @__PURE__ */ c(
9018
9039
  u,
9019
9040
  {
9020
9041
  ref: i,
@@ -9156,13 +9177,13 @@ function Dy({
9156
9177
  chatClassName: s = "",
9157
9178
  ...a
9158
9179
  }) {
9159
- return /* @__PURE__ */ c(Pn, { ...a, children: /* @__PURE__ */ N(kl, { className: `w-full ${r}`, children: [
9180
+ return /* @__PURE__ */ c(An, { ...a, children: /* @__PURE__ */ N(kl, { className: `w-full ${r}`, children: [
9160
9181
  /* @__PURE__ */ N(Dl, { className: `border-r ${o}`, children: [
9161
9182
  /* @__PURE__ */ c($l, { children: /* @__PURE__ */ c(Wl, { children: /* @__PURE__ */ c(Vl, { children: /* @__PURE__ */ c(jl, { size: "lg", children: /* @__PURE__ */ c("span", { className: "font-semibold", children: t }) }) }) }) }),
9162
9183
  /* @__PURE__ */ c(Bl, { children: n && /* @__PURE__ */ N(Ul, { children: [
9163
9184
  /* @__PURE__ */ c(zl, { children: "Conversations" }),
9164
9185
  /* @__PURE__ */ c(Hl, { children: /* @__PURE__ */ c("div", { className: "px-2 py-1", children: /* @__PURE__ */ c(
9165
- lo,
9186
+ co,
9166
9187
  {
9167
9188
  showCreateButton: !0,
9168
9189
  showDeleteButton: !0,
@@ -9178,7 +9199,7 @@ function Dy({
9178
9199
  /* @__PURE__ */ c("div", { className: "flex-1" }),
9179
9200
  e
9180
9201
  ] }),
9181
- /* @__PURE__ */ c("main", { className: `flex-1 min-h-0 overflow-hidden ${s}`, children: /* @__PURE__ */ c(Mn, {}) })
9202
+ /* @__PURE__ */ c("main", { className: `flex-1 min-h-0 overflow-hidden ${s}`, children: /* @__PURE__ */ c(On, {}) })
9182
9203
  ] })
9183
9204
  ] }) });
9184
9205
  }
@@ -9195,7 +9216,7 @@ var tw = "Label", Kl = l.forwardRef((e, t) => /* @__PURE__ */ c(
9195
9216
  ));
9196
9217
  Kl.displayName = tw;
9197
9218
  var Gl = Kl;
9198
- const nw = cn(
9219
+ const nw = an(
9199
9220
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
9200
9221
  ), Oe = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
9201
9222
  Gl,
@@ -9210,7 +9231,7 @@ function ql(e) {
9210
9231
  const t = l.useRef({ value: e, previous: e });
9211
9232
  return l.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
9212
9233
  }
9213
- var Er = "Switch", [rw, Ly] = ze(Er), [ow, sw] = rw(Er), Yl = l.forwardRef(
9234
+ var Cr = "Switch", [rw, Ly] = He(Cr), [ow, sw] = rw(Cr), Yl = l.forwardRef(
9214
9235
  (e, t) => {
9215
9236
  const {
9216
9237
  __scopeSwitch: n,
@@ -9227,7 +9248,7 @@ var Er = "Switch", [rw, Ly] = ze(Er), [ow, sw] = rw(Er), Yl = l.forwardRef(
9227
9248
  prop: o,
9228
9249
  defaultProp: s ?? !1,
9229
9250
  onChange: f,
9230
- caller: Er
9251
+ caller: Cr
9231
9252
  });
9232
9253
  return /* @__PURE__ */ N(ow, { scope: n, checked: w, disabled: i, children: [
9233
9254
  /* @__PURE__ */ c(
@@ -9265,7 +9286,7 @@ var Er = "Switch", [rw, Ly] = ze(Er), [ow, sw] = rw(Er), Yl = l.forwardRef(
9265
9286
  ] });
9266
9287
  }
9267
9288
  );
9268
- Yl.displayName = Er;
9289
+ Yl.displayName = Cr;
9269
9290
  var Xl = "SwitchThumb", Jl = l.forwardRef(
9270
9291
  (e, t) => {
9271
9292
  const { __scopeSwitch: n, ...r } = e, o = sw(Xl, n);
@@ -9327,7 +9348,7 @@ function Ql(e) {
9327
9348
  return e ? "checked" : "unchecked";
9328
9349
  }
9329
9350
  var eu = Yl, iw = Jl;
9330
- const et = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
9351
+ const tt = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
9331
9352
  eu,
9332
9353
  {
9333
9354
  className: A(
@@ -9346,11 +9367,11 @@ const et = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
9346
9367
  )
9347
9368
  }
9348
9369
  ));
9349
- et.displayName = eu.displayName;
9350
- var cw = [" ", "Enter", "ArrowUp", "ArrowDown"], lw = [" ", "Enter"], vt = "Select", [Rr, Nr, uw] = Po(vt), [Ht, Fy] = ze(vt, [
9370
+ tt.displayName = eu.displayName;
9371
+ var cw = [" ", "Enter", "ArrowUp", "ArrowDown"], lw = [" ", "Enter"], vt = "Select", [Er, Rr, uw] = Po(vt), [Ht, Fy] = He(vt, [
9351
9372
  uw,
9352
9373
  zt
9353
- ]), Tr = zt(), [dw, it] = Ht(vt), [fw, pw] = Ht(vt), tu = (e) => {
9374
+ ]), Nr = zt(), [dw, it] = Ht(vt), [fw, pw] = Ht(vt), tu = (e) => {
9354
9375
  const {
9355
9376
  __scopeSelect: t,
9356
9377
  children: n,
@@ -9366,7 +9387,7 @@ var cw = [" ", "Enter", "ArrowUp", "ArrowDown"], lw = [" ", "Enter"], vt = "Sele
9366
9387
  disabled: m,
9367
9388
  required: v,
9368
9389
  form: h
9369
- } = e, g = Tr(t), [b, w] = l.useState(null), [y, x] = l.useState(null), [E, C] = l.useState(!1), I = sr(f), [R, D] = ot({
9390
+ } = e, g = Nr(t), [b, w] = l.useState(null), [y, x] = l.useState(null), [E, C] = l.useState(!1), I = or(f), [R, D] = ot({
9370
9391
  prop: r,
9371
9392
  defaultProp: o ?? !1,
9372
9393
  onChange: s,
@@ -9388,7 +9409,7 @@ var cw = [" ", "Enter", "ArrowUp", "ArrowDown"], lw = [" ", "Enter"], vt = "Sele
9388
9409
  onValueNodeChange: x,
9389
9410
  valueNodeHasChildren: E,
9390
9411
  onValueNodeHasChildrenChange: C,
9391
- contentId: Fe(),
9412
+ contentId: $e(),
9392
9413
  value: M,
9393
9414
  onValueChange: k,
9394
9415
  open: R,
@@ -9397,7 +9418,7 @@ var cw = [" ", "Enter", "ArrowUp", "ArrowDown"], lw = [" ", "Enter"], vt = "Sele
9397
9418
  triggerPointerDownPosRef: j,
9398
9419
  disabled: m,
9399
9420
  children: [
9400
- /* @__PURE__ */ c(Rr.Provider, { scope: t, children: /* @__PURE__ */ c(
9421
+ /* @__PURE__ */ c(Er.Provider, { scope: t, children: /* @__PURE__ */ c(
9401
9422
  fw,
9402
9423
  {
9403
9424
  scope: e.__scopeSelect,
@@ -9439,7 +9460,7 @@ var cw = [" ", "Enter", "ArrowUp", "ArrowDown"], lw = [" ", "Enter"], vt = "Sele
9439
9460
  tu.displayName = vt;
9440
9461
  var nu = "SelectTrigger", ru = l.forwardRef(
9441
9462
  (e, t) => {
9442
- const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Tr(n), a = it(nu, n), i = a.disabled || r, u = te(t, a.onTriggerChange), f = Nr(n), d = l.useRef("touch"), [p, m, v] = Tu((g) => {
9463
+ const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Nr(n), a = it(nu, n), i = a.disabled || r, u = te(t, a.onTriggerChange), f = Rr(n), d = l.useRef("touch"), [p, m, v] = Tu((g) => {
9443
9464
  const b = f().filter((x) => !x.disabled), w = b.find((x) => x.value === a.value), y = Au(b, g, w);
9444
9465
  y !== void 0 && a.onValueChange(y.value);
9445
9466
  }), h = (g) => {
@@ -9492,7 +9513,7 @@ var ou = "SelectValue", su = l.forwardRef(
9492
9513
  ...i,
9493
9514
  ref: p,
9494
9515
  style: { pointerEvents: "none" },
9495
- children: Nu(u.value) ? /* @__PURE__ */ c(Le, { children: a }) : s
9516
+ children: Nu(u.value) ? /* @__PURE__ */ c(Fe, { children: a }) : s
9496
9517
  }
9497
9518
  );
9498
9519
  }
@@ -9505,7 +9526,7 @@ var hw = "SelectIcon", au = l.forwardRef(
9505
9526
  }
9506
9527
  );
9507
9528
  au.displayName = hw;
9508
- var mw = "SelectPortal", iu = (e) => /* @__PURE__ */ c(dr, { asChild: !0, ...e });
9529
+ var mw = "SelectPortal", iu = (e) => /* @__PURE__ */ c(ur, { asChild: !0, ...e });
9509
9530
  iu.displayName = mw;
9510
9531
  var wt = "SelectContent", cu = l.forwardRef(
9511
9532
  (e, t) => {
@@ -9514,8 +9535,8 @@ var wt = "SelectContent", cu = l.forwardRef(
9514
9535
  o(new DocumentFragment());
9515
9536
  }, []), !n.open) {
9516
9537
  const s = r;
9517
- return s ? Zn.createPortal(
9518
- /* @__PURE__ */ c(lu, { scope: e.__scopeSelect, children: /* @__PURE__ */ c(Rr.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ c("div", { children: e.children }) }) }),
9538
+ return s ? Jn.createPortal(
9539
+ /* @__PURE__ */ c(lu, { scope: e.__scopeSelect, children: /* @__PURE__ */ c(Er.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ c("div", { children: e.children }) }) }),
9519
9540
  s
9520
9541
  ) : null;
9521
9542
  }
@@ -9523,7 +9544,7 @@ var wt = "SelectContent", cu = l.forwardRef(
9523
9544
  }
9524
9545
  );
9525
9546
  cu.displayName = wt;
9526
- var De = 10, [lu, ct] = Ht(wt), gw = "SelectContentImpl", bw = It("SelectContent.RemoveScroll"), uu = l.forwardRef(
9547
+ var Le = 10, [lu, ct] = Ht(wt), gw = "SelectContentImpl", bw = It("SelectContent.RemoveScroll"), uu = l.forwardRef(
9527
9548
  (e, t) => {
9528
9549
  const {
9529
9550
  __scopeSelect: n,
@@ -9547,7 +9568,7 @@ var De = 10, [lu, ct] = Ht(wt), gw = "SelectContentImpl", bw = It("SelectContent
9547
9568
  ...w
9548
9569
  } = e, y = it(wt, n), [x, E] = l.useState(null), [C, I] = l.useState(null), R = te(t, (V) => E(V)), [D, M] = l.useState(null), [k, j] = l.useState(
9549
9570
  null
9550
- ), K = Nr(n), [W, B] = l.useState(!1), q = l.useRef(!1);
9571
+ ), K = Rr(n), [W, B] = l.useState(!1), q = l.useRef(!1);
9551
9572
  l.useEffect(() => {
9552
9573
  if (x) return Wo(x);
9553
9574
  }, [x]), _o();
@@ -9603,7 +9624,7 @@ var De = 10, [lu, ct] = Ht(wt), gw = "SelectContentImpl", bw = It("SelectContent
9603
9624
  (y.value !== void 0 && y.value === re || oe) && j(V);
9604
9625
  },
9605
9626
  [y.value]
9606
- ), le = r === "popper" ? po : du, se = le === po ? {
9627
+ ), le = r === "popper" ? fo : du, se = le === fo ? {
9607
9628
  side: i,
9608
9629
  sideOffset: u,
9609
9630
  align: f,
@@ -9631,8 +9652,8 @@ var De = 10, [lu, ct] = Ht(wt), gw = "SelectContentImpl", bw = It("SelectContent
9631
9652
  position: r,
9632
9653
  isPositioned: W,
9633
9654
  searchRef: _,
9634
- children: /* @__PURE__ */ c(pr, { as: bw, allowPinchZoom: !0, children: /* @__PURE__ */ c(
9635
- ar,
9655
+ children: /* @__PURE__ */ c(fr, { as: bw, allowPinchZoom: !0, children: /* @__PURE__ */ c(
9656
+ sr,
9636
9657
  {
9637
9658
  asChild: !0,
9638
9659
  trapped: y.open,
@@ -9644,7 +9665,7 @@ var De = 10, [lu, ct] = Ht(wt), gw = "SelectContentImpl", bw = It("SelectContent
9644
9665
  (re = y.trigger) == null || re.focus({ preventScroll: !0 }), V.preventDefault();
9645
9666
  }),
9646
9667
  children: /* @__PURE__ */ c(
9647
- pn,
9668
+ fn,
9648
9669
  {
9649
9670
  asChild: !0,
9650
9671
  disableOutsidePointerEvents: !0,
@@ -9695,28 +9716,28 @@ var De = 10, [lu, ct] = Ht(wt), gw = "SelectContentImpl", bw = It("SelectContent
9695
9716
  );
9696
9717
  uu.displayName = gw;
9697
9718
  var vw = "SelectItemAlignedPosition", du = l.forwardRef((e, t) => {
9698
- const { __scopeSelect: n, onPlaced: r, ...o } = e, s = it(wt, n), a = ct(wt, n), [i, u] = l.useState(null), [f, d] = l.useState(null), p = te(t, (R) => d(R)), m = Nr(n), v = l.useRef(!1), h = l.useRef(!0), { viewport: g, selectedItem: b, selectedItemText: w, focusSelectedItem: y } = a, x = l.useCallback(() => {
9719
+ const { __scopeSelect: n, onPlaced: r, ...o } = e, s = it(wt, n), a = ct(wt, n), [i, u] = l.useState(null), [f, d] = l.useState(null), p = te(t, (R) => d(R)), m = Rr(n), v = l.useRef(!1), h = l.useRef(!0), { viewport: g, selectedItem: b, selectedItemText: w, focusSelectedItem: y } = a, x = l.useCallback(() => {
9699
9720
  if (s.trigger && s.valueNode && i && f && g && b && w) {
9700
9721
  const R = s.trigger.getBoundingClientRect(), D = f.getBoundingClientRect(), M = s.valueNode.getBoundingClientRect(), k = w.getBoundingClientRect();
9701
9722
  if (s.dir !== "rtl") {
9702
- const H = k.left - D.left, Z = M.left - H, de = R.left - Z, pe = R.width + de, X = Math.max(pe, D.width), ge = window.innerWidth - De, ae = co(Z, [
9703
- De,
9723
+ const H = k.left - D.left, Z = M.left - H, de = R.left - Z, pe = R.width + de, X = Math.max(pe, D.width), ge = window.innerWidth - Le, ae = io(Z, [
9724
+ Le,
9704
9725
  // Prevents the content from going off the starting edge of the
9705
9726
  // viewport. It may still go off the ending edge, but this can be
9706
9727
  // controlled by the user since they may want to manage overflow in a
9707
9728
  // specific way.
9708
9729
  // https://github.com/radix-ui/primitives/issues/2049
9709
- Math.max(De, ge - X)
9730
+ Math.max(Le, ge - X)
9710
9731
  ]);
9711
9732
  i.style.minWidth = pe + "px", i.style.left = ae + "px";
9712
9733
  } else {
9713
- const H = D.right - k.right, Z = window.innerWidth - M.right - H, de = window.innerWidth - R.right - Z, pe = R.width + de, X = Math.max(pe, D.width), ge = window.innerWidth - De, ae = co(Z, [
9714
- De,
9715
- Math.max(De, ge - X)
9734
+ const H = D.right - k.right, Z = window.innerWidth - M.right - H, de = window.innerWidth - R.right - Z, pe = R.width + de, X = Math.max(pe, D.width), ge = window.innerWidth - Le, ae = io(Z, [
9735
+ Le,
9736
+ Math.max(Le, ge - X)
9716
9737
  ]);
9717
9738
  i.style.minWidth = pe + "px", i.style.right = ae + "px";
9718
9739
  }
9719
- const j = m(), K = window.innerHeight - De * 2, W = g.scrollHeight, B = window.getComputedStyle(f), q = parseInt(B.borderTopWidth, 10), L = parseInt(B.paddingTop, 10), G = parseInt(B.borderBottomWidth, 10), T = parseInt(B.paddingBottom, 10), P = q + L + W + T + G, _ = Math.min(b.offsetHeight * 5, P), O = window.getComputedStyle(g), Y = parseInt(O.paddingTop, 10), $ = parseInt(O.paddingBottom, 10), z = R.top + R.height / 2 - De, le = K - z, se = b.offsetHeight / 2, V = b.offsetTop + se, re = q + L + V, ie = P - re;
9740
+ const j = m(), K = window.innerHeight - Le * 2, W = g.scrollHeight, B = window.getComputedStyle(f), q = parseInt(B.borderTopWidth, 10), L = parseInt(B.paddingTop, 10), G = parseInt(B.borderBottomWidth, 10), T = parseInt(B.paddingBottom, 10), P = q + L + W + T + G, _ = Math.min(b.offsetHeight * 5, P), O = window.getComputedStyle(g), Y = parseInt(O.paddingTop, 10), $ = parseInt(O.paddingBottom, 10), z = R.top + R.height / 2 - Le, le = K - z, se = b.offsetHeight / 2, V = b.offsetTop + se, re = q + L + V, ie = P - re;
9720
9741
  if (re <= z) {
9721
9742
  const H = j.length > 0 && b === j[j.length - 1].ref.current;
9722
9743
  i.style.bottom = "0px";
@@ -9736,7 +9757,7 @@ var vw = "SelectItemAlignedPosition", du = l.forwardRef((e, t) => {
9736
9757
  ) + ie;
9737
9758
  i.style.height = de + "px", g.scrollTop = re - z + g.offsetTop;
9738
9759
  }
9739
- i.style.margin = `${De}px 0`, i.style.minHeight = _ + "px", i.style.maxHeight = K + "px", r == null || r(), requestAnimationFrame(() => v.current = !0);
9760
+ i.style.margin = `${Le}px 0`, i.style.minHeight = _ + "px", i.style.maxHeight = K + "px", r == null || r(), requestAnimationFrame(() => v.current = !0);
9740
9761
  }
9741
9762
  }, [
9742
9763
  m,
@@ -9799,13 +9820,13 @@ var vw = "SelectItemAlignedPosition", du = l.forwardRef((e, t) => {
9799
9820
  );
9800
9821
  });
9801
9822
  du.displayName = vw;
9802
- var ww = "SelectPopperPosition", po = l.forwardRef((e, t) => {
9823
+ var ww = "SelectPopperPosition", fo = l.forwardRef((e, t) => {
9803
9824
  const {
9804
9825
  __scopeSelect: n,
9805
9826
  align: r = "start",
9806
- collisionPadding: o = De,
9827
+ collisionPadding: o = Le,
9807
9828
  ...s
9808
- } = e, a = Tr(n);
9829
+ } = e, a = Nr(n);
9809
9830
  return /* @__PURE__ */ c(
9810
9831
  zo,
9811
9832
  {
@@ -9827,11 +9848,11 @@ var ww = "SelectPopperPosition", po = l.forwardRef((e, t) => {
9827
9848
  }
9828
9849
  );
9829
9850
  });
9830
- po.displayName = ww;
9831
- var [yw, is] = Ht(wt, {}), ho = "SelectViewport", fu = l.forwardRef(
9851
+ fo.displayName = ww;
9852
+ var [yw, is] = Ht(wt, {}), po = "SelectViewport", fu = l.forwardRef(
9832
9853
  (e, t) => {
9833
- const { __scopeSelect: n, nonce: r, ...o } = e, s = ct(ho, n), a = is(ho, n), i = te(t, s.onViewportChange), u = l.useRef(0);
9834
- return /* @__PURE__ */ N(Le, { children: [
9854
+ const { __scopeSelect: n, nonce: r, ...o } = e, s = ct(po, n), a = is(po, n), i = te(t, s.onViewportChange), u = l.useRef(0);
9855
+ return /* @__PURE__ */ N(Fe, { children: [
9835
9856
  /* @__PURE__ */ c(
9836
9857
  "style",
9837
9858
  {
@@ -9841,7 +9862,7 @@ var [yw, is] = Ht(wt, {}), ho = "SelectViewport", fu = l.forwardRef(
9841
9862
  nonce: r
9842
9863
  }
9843
9864
  ),
9844
- /* @__PURE__ */ c(Rr.Slot, { scope: n, children: /* @__PURE__ */ c(
9865
+ /* @__PURE__ */ c(Er.Slot, { scope: n, children: /* @__PURE__ */ c(
9845
9866
  J.div,
9846
9867
  {
9847
9868
  "data-radix-select-viewport": "",
@@ -9866,7 +9887,7 @@ var [yw, is] = Ht(wt, {}), ho = "SelectViewport", fu = l.forwardRef(
9866
9887
  if (m != null && m.current && p) {
9867
9888
  const v = Math.abs(u.current - d.scrollTop);
9868
9889
  if (v > 0) {
9869
- const h = window.innerHeight - De * 2, g = parseFloat(p.style.minHeight), b = parseFloat(p.style.height), w = Math.max(g, b);
9890
+ const h = window.innerHeight - Le * 2, g = parseFloat(p.style.minHeight), b = parseFloat(p.style.height), w = Math.max(g, b);
9870
9891
  if (w < h) {
9871
9892
  const y = w + v, x = Math.min(h, y), E = y - x;
9872
9893
  p.style.height = x + "px", p.style.bottom === "0px" && (d.scrollTop = E > 0 ? E : 0, p.style.justifyContent = "flex-end");
@@ -9880,10 +9901,10 @@ var [yw, is] = Ht(wt, {}), ho = "SelectViewport", fu = l.forwardRef(
9880
9901
  ] });
9881
9902
  }
9882
9903
  );
9883
- fu.displayName = ho;
9904
+ fu.displayName = po;
9884
9905
  var pu = "SelectGroup", [xw, Sw] = Ht(pu), Cw = l.forwardRef(
9885
9906
  (e, t) => {
9886
- const { __scopeSelect: n, ...r } = e, o = Fe();
9907
+ const { __scopeSelect: n, ...r } = e, o = $e();
9887
9908
  return /* @__PURE__ */ c(xw, { scope: n, id: o, children: /* @__PURE__ */ c(J.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
9888
9909
  }
9889
9910
  );
@@ -9895,7 +9916,7 @@ var hu = "SelectLabel", mu = l.forwardRef(
9895
9916
  }
9896
9917
  );
9897
9918
  mu.displayName = hu;
9898
- var Jn = "SelectItem", [Ew, gu] = Ht(Jn), bu = l.forwardRef(
9919
+ var Xn = "SelectItem", [Ew, gu] = Ht(Xn), bu = l.forwardRef(
9899
9920
  (e, t) => {
9900
9921
  const {
9901
9922
  __scopeSelect: n,
@@ -9903,13 +9924,13 @@ var Jn = "SelectItem", [Ew, gu] = Ht(Jn), bu = l.forwardRef(
9903
9924
  disabled: o = !1,
9904
9925
  textValue: s,
9905
9926
  ...a
9906
- } = e, i = it(Jn, n), u = ct(Jn, n), f = i.value === r, [d, p] = l.useState(s ?? ""), [m, v] = l.useState(!1), h = te(
9927
+ } = e, i = it(Xn, n), u = ct(Xn, n), f = i.value === r, [d, p] = l.useState(s ?? ""), [m, v] = l.useState(!1), h = te(
9907
9928
  t,
9908
9929
  (y) => {
9909
9930
  var x;
9910
9931
  return (x = u.itemRefCallback) == null ? void 0 : x.call(u, y, r, o);
9911
9932
  }
9912
- ), g = Fe(), b = l.useRef("touch"), w = () => {
9933
+ ), g = $e(), b = l.useRef("touch"), w = () => {
9913
9934
  o || (i.onValueChange(r), i.onOpenChange(!1));
9914
9935
  };
9915
9936
  if (r === "")
@@ -9928,7 +9949,7 @@ var Jn = "SelectItem", [Ew, gu] = Ht(Jn), bu = l.forwardRef(
9928
9949
  p((x) => x || ((y == null ? void 0 : y.textContent) ?? "").trim());
9929
9950
  }, []),
9930
9951
  children: /* @__PURE__ */ c(
9931
- Rr.ItemSlot,
9952
+ Er.ItemSlot,
9932
9953
  {
9933
9954
  scope: n,
9934
9955
  value: r,
@@ -9978,7 +9999,7 @@ var Jn = "SelectItem", [Ew, gu] = Ht(Jn), bu = l.forwardRef(
9978
9999
  );
9979
10000
  }
9980
10001
  );
9981
- bu.displayName = Jn;
10002
+ bu.displayName = Xn;
9982
10003
  var Yt = "SelectItemText", vu = l.forwardRef(
9983
10004
  (e, t) => {
9984
10005
  const { __scopeSelect: n, className: r, style: o, ...s } = e, a = it(Yt, n), i = ct(Yt, n), u = gu(Yt, n), f = pw(Yt, n), [d, p] = l.useState(null), m = te(
@@ -9993,9 +10014,9 @@ var Yt = "SelectItemText", vu = l.forwardRef(
9993
10014
  () => /* @__PURE__ */ c("option", { value: u.value, disabled: u.disabled, children: v }, u.value),
9994
10015
  [u.disabled, u.value, v]
9995
10016
  ), { onNativeOptionAdd: g, onNativeOptionRemove: b } = f;
9996
- return be(() => (g(h), () => b(h)), [g, b, h]), /* @__PURE__ */ N(Le, { children: [
10017
+ return be(() => (g(h), () => b(h)), [g, b, h]), /* @__PURE__ */ N(Fe, { children: [
9997
10018
  /* @__PURE__ */ c(J.span, { id: u.textId, ...s, ref: m }),
9998
- u.isSelected && a.valueNode && !a.valueNodeHasChildren ? Zn.createPortal(s.children, a.valueNode) : null
10019
+ u.isSelected && a.valueNode && !a.valueNodeHasChildren ? Jn.createPortal(s.children, a.valueNode) : null
9999
10020
  ] });
10000
10021
  }
10001
10022
  );
@@ -10007,8 +10028,8 @@ var wu = "SelectItemIndicator", yu = l.forwardRef(
10007
10028
  }
10008
10029
  );
10009
10030
  yu.displayName = wu;
10010
- var mo = "SelectScrollUpButton", xu = l.forwardRef((e, t) => {
10011
- const n = ct(mo, e.__scopeSelect), r = is(mo, e.__scopeSelect), [o, s] = l.useState(!1), a = te(t, r.onScrollButtonChange);
10031
+ var ho = "SelectScrollUpButton", xu = l.forwardRef((e, t) => {
10032
+ const n = ct(ho, e.__scopeSelect), r = is(ho, e.__scopeSelect), [o, s] = l.useState(!1), a = te(t, r.onScrollButtonChange);
10012
10033
  return be(() => {
10013
10034
  if (n.viewport && n.isPositioned) {
10014
10035
  let i = function() {
@@ -10030,9 +10051,9 @@ var mo = "SelectScrollUpButton", xu = l.forwardRef((e, t) => {
10030
10051
  }
10031
10052
  ) : null;
10032
10053
  });
10033
- xu.displayName = mo;
10034
- var go = "SelectScrollDownButton", Su = l.forwardRef((e, t) => {
10035
- const n = ct(go, e.__scopeSelect), r = is(go, e.__scopeSelect), [o, s] = l.useState(!1), a = te(t, r.onScrollButtonChange);
10054
+ xu.displayName = ho;
10055
+ var mo = "SelectScrollDownButton", Su = l.forwardRef((e, t) => {
10056
+ const n = ct(mo, e.__scopeSelect), r = is(mo, e.__scopeSelect), [o, s] = l.useState(!1), a = te(t, r.onScrollButtonChange);
10036
10057
  return be(() => {
10037
10058
  if (n.viewport && n.isPositioned) {
10038
10059
  let i = function() {
@@ -10054,9 +10075,9 @@ var go = "SelectScrollDownButton", Su = l.forwardRef((e, t) => {
10054
10075
  }
10055
10076
  ) : null;
10056
10077
  });
10057
- Su.displayName = go;
10078
+ Su.displayName = mo;
10058
10079
  var Cu = l.forwardRef((e, t) => {
10059
- const { __scopeSelect: n, onAutoScroll: r, ...o } = e, s = ct("SelectScrollButton", n), a = l.useRef(null), i = Nr(n), u = l.useCallback(() => {
10080
+ const { __scopeSelect: n, onAutoScroll: r, ...o } = e, s = ct("SelectScrollButton", n), a = l.useRef(null), i = Rr(n), u = l.useCallback(() => {
10060
10081
  a.current !== null && (window.clearInterval(a.current), a.current = null);
10061
10082
  }, []);
10062
10083
  return l.useEffect(() => () => u(), [u]), be(() => {
@@ -10089,13 +10110,13 @@ var Cu = l.forwardRef((e, t) => {
10089
10110
  }
10090
10111
  );
10091
10112
  Eu.displayName = Rw;
10092
- var bo = "SelectArrow", Nw = l.forwardRef(
10113
+ var go = "SelectArrow", Nw = l.forwardRef(
10093
10114
  (e, t) => {
10094
- const { __scopeSelect: n, ...r } = e, o = Tr(n), s = it(bo, n), a = ct(bo, n);
10115
+ const { __scopeSelect: n, ...r } = e, o = Nr(n), s = it(go, n), a = ct(go, n);
10095
10116
  return s.open && a.position === "popper" ? /* @__PURE__ */ c(Ho, { ...o, ...r, ref: t }) : null;
10096
10117
  }
10097
10118
  );
10098
- Nw.displayName = bo;
10119
+ Nw.displayName = go;
10099
10120
  var Tw = "SelectBubbleInput", Ru = l.forwardRef(
10100
10121
  ({ __scopeSelect: e, value: t, ...n }, r) => {
10101
10122
  const o = l.useRef(null), s = te(r, o), a = ql(t);
@@ -10126,7 +10147,7 @@ function Nu(e) {
10126
10147
  return e === "" || e === void 0;
10127
10148
  }
10128
10149
  function Tu(e) {
10129
- const t = ve(e), n = l.useRef(""), r = l.useRef(0), o = l.useCallback(
10150
+ const t = we(e), n = l.useRef(""), r = l.useRef(0), o = l.useCallback(
10130
10151
  (a) => {
10131
10152
  const i = n.current + a;
10132
10153
  t(i), function u(f) {
@@ -10152,7 +10173,7 @@ function Aw(e, t) {
10152
10173
  return e.map((n, r) => e[(t + r) % e.length]);
10153
10174
  }
10154
10175
  var Pw = tu, Pu = ru, _w = su, Iw = au, Ow = iu, _u = cu, Mw = fu, Iu = mu, Ou = bu, kw = vu, Dw = yu, Mu = xu, ku = Su, Du = Eu;
10155
- const ua = Pw, da = _w, vo = l.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ N(
10176
+ const ua = Pw, da = _w, bo = l.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ N(
10156
10177
  Pu,
10157
10178
  {
10158
10179
  ref: r,
@@ -10167,7 +10188,7 @@ const ua = Pw, da = _w, vo = l.forwardRef(({ className: e, children: t, ...n },
10167
10188
  ]
10168
10189
  }
10169
10190
  ));
10170
- vo.displayName = Pu.displayName;
10191
+ bo.displayName = Pu.displayName;
10171
10192
  const Lu = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10172
10193
  Mu,
10173
10194
  {
@@ -10194,7 +10215,7 @@ const Fu = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10194
10215
  }
10195
10216
  ));
10196
10217
  Fu.displayName = ku.displayName;
10197
- const wo = l.forwardRef(({ className: e, children: t, position: n = "popper", ...r }, o) => /* @__PURE__ */ c(Ow, { children: /* @__PURE__ */ N(
10218
+ const vo = l.forwardRef(({ className: e, children: t, position: n = "popper", ...r }, o) => /* @__PURE__ */ c(Ow, { children: /* @__PURE__ */ N(
10198
10219
  _u,
10199
10220
  {
10200
10221
  ref: o,
@@ -10221,7 +10242,7 @@ const wo = l.forwardRef(({ className: e, children: t, position: n = "popper", ..
10221
10242
  ]
10222
10243
  }
10223
10244
  ) }));
10224
- wo.displayName = _u.displayName;
10245
+ vo.displayName = _u.displayName;
10225
10246
  const Lw = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10226
10247
  Iu,
10227
10248
  {
@@ -10241,7 +10262,7 @@ const ut = l.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
10241
10262
  ),
10242
10263
  ...n,
10243
10264
  children: [
10244
- /* @__PURE__ */ c("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ c(Dw, { children: /* @__PURE__ */ c(yo, { className: "h-4 w-4" }) }) }),
10265
+ /* @__PURE__ */ c("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ c(Dw, { children: /* @__PURE__ */ c(wo, { className: "h-4 w-4" }) }) }),
10245
10266
  /* @__PURE__ */ c(kw, { children: t })
10246
10267
  ]
10247
10268
  }
@@ -10256,7 +10277,7 @@ const Fw = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10256
10277
  }
10257
10278
  ));
10258
10279
  Fw.displayName = Du.displayName;
10259
- const kn = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10280
+ const Mn = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10260
10281
  "div",
10261
10282
  {
10262
10283
  ref: n,
@@ -10267,8 +10288,8 @@ const kn = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10267
10288
  ...t
10268
10289
  }
10269
10290
  ));
10270
- kn.displayName = "Card";
10271
- const Dn = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10291
+ Mn.displayName = "Card";
10292
+ const kn = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10272
10293
  "div",
10273
10294
  {
10274
10295
  ref: n,
@@ -10276,8 +10297,8 @@ const Dn = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10276
10297
  ...t
10277
10298
  }
10278
10299
  ));
10279
- Dn.displayName = "CardHeader";
10280
- const Ln = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10300
+ kn.displayName = "CardHeader";
10301
+ const Dn = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10281
10302
  "h3",
10282
10303
  {
10283
10304
  ref: n,
@@ -10288,7 +10309,7 @@ const Ln = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10288
10309
  ...t
10289
10310
  }
10290
10311
  ));
10291
- Ln.displayName = "CardTitle";
10312
+ Dn.displayName = "CardTitle";
10292
10313
  const $w = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10293
10314
  "p",
10294
10315
  {
@@ -10298,8 +10319,8 @@ const $w = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10298
10319
  }
10299
10320
  ));
10300
10321
  $w.displayName = "CardDescription";
10301
- const Fn = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c("div", { ref: n, className: A("p-6 pt-0", e), ...t }));
10302
- Fn.displayName = "CardContent";
10322
+ const Ln = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c("div", { ref: n, className: A("p-6 pt-0", e), ...t }));
10323
+ Ln.displayName = "CardContent";
10303
10324
  const Bw = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10304
10325
  "div",
10305
10326
  {
@@ -10310,20 +10331,20 @@ const Bw = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10310
10331
  ));
10311
10332
  Bw.displayName = "CardFooter";
10312
10333
  const Uw = 1, zw = 1e6;
10313
- let Vr = 0;
10334
+ let Wr = 0;
10314
10335
  function Hw() {
10315
- return Vr = (Vr + 1) % Number.MAX_SAFE_INTEGER, Vr.toString();
10336
+ return Wr = (Wr + 1) % Number.MAX_SAFE_INTEGER, Wr.toString();
10316
10337
  }
10317
- const jr = /* @__PURE__ */ new Map(), fa = (e) => {
10318
- if (jr.has(e))
10338
+ const Vr = /* @__PURE__ */ new Map(), fa = (e) => {
10339
+ if (Vr.has(e))
10319
10340
  return;
10320
10341
  const t = setTimeout(() => {
10321
- jr.delete(e), Qt({
10342
+ Vr.delete(e), Qt({
10322
10343
  type: "REMOVE_TOAST",
10323
10344
  toastId: e
10324
10345
  });
10325
10346
  }, zw);
10326
- jr.set(e, t);
10347
+ Vr.set(e, t);
10327
10348
  }, Ww = (e, t) => {
10328
10349
  switch (t.type) {
10329
10350
  case "ADD_TOAST":
@@ -10361,11 +10382,11 @@ const jr = /* @__PURE__ */ new Map(), fa = (e) => {
10361
10382
  toasts: e.toasts.filter((n) => n.id !== t.toastId)
10362
10383
  };
10363
10384
  }
10364
- }, $n = [];
10365
- let Bn = { toasts: [] };
10385
+ }, Fn = [];
10386
+ let $n = { toasts: [] };
10366
10387
  function Qt(e) {
10367
- Bn = Ww(Bn, e), $n.forEach((t) => {
10368
- t(Bn);
10388
+ $n = Ww($n, e), Fn.forEach((t) => {
10389
+ t($n);
10369
10390
  });
10370
10391
  }
10371
10392
  function Vw({ ...e }) {
@@ -10390,10 +10411,10 @@ function Vw({ ...e }) {
10390
10411
  };
10391
10412
  }
10392
10413
  function jw() {
10393
- const [e, t] = l.useState(Bn);
10394
- return l.useEffect(() => ($n.push(t), () => {
10395
- const n = $n.indexOf(t);
10396
- n > -1 && $n.splice(n, 1);
10414
+ const [e, t] = l.useState($n);
10415
+ return l.useEffect(() => (Fn.push(t), () => {
10416
+ const n = Fn.indexOf(t);
10417
+ n > -1 && Fn.splice(n, 1);
10397
10418
  }), [e]), {
10398
10419
  ...e,
10399
10420
  toast: Vw,
@@ -10421,10 +10442,10 @@ const Kw = {
10421
10442
  };
10422
10443
  function $y({ settings: e, onSettingsChange: t, className: n = "" }) {
10423
10444
  const [r, o] = ce(!1), [s, a] = ce(!1), [i, u] = ce(e), [f, d] = ce(!1), { toast: p } = jw();
10424
- we(() => {
10445
+ ve(() => {
10425
10446
  const b = JSON.stringify(i) !== JSON.stringify(e);
10426
10447
  d(b);
10427
- }, [i, e]), we(() => {
10448
+ }, [i, e]), ve(() => {
10428
10449
  u(e);
10429
10450
  }, [e]);
10430
10451
  const m = () => {
@@ -10466,17 +10487,17 @@ function $y({ settings: e, onSettingsChange: t, className: n = "" }) {
10466
10487
  /* @__PURE__ */ c(xl, { children: "Configure your chat interface, API connection, and behavior preferences." })
10467
10488
  ] }),
10468
10489
  /* @__PURE__ */ N("div", { className: "space-y-6 py-6", children: [
10469
- /* @__PURE__ */ N(kn, { children: [
10470
- /* @__PURE__ */ c(Dn, { className: "pb-3", children: /* @__PURE__ */ N(Ln, { className: "text-lg flex items-center gap-2", children: [
10490
+ /* @__PURE__ */ N(Mn, { children: [
10491
+ /* @__PURE__ */ c(kn, { className: "pb-3", children: /* @__PURE__ */ N(Dn, { className: "text-lg flex items-center gap-2", children: [
10471
10492
  /* @__PURE__ */ c(Qu, { className: "h-5 w-5" }),
10472
10493
  "API Configuration"
10473
10494
  ] }) }),
10474
- /* @__PURE__ */ N(Fn, { className: "space-y-4", children: [
10495
+ /* @__PURE__ */ N(Ln, { className: "space-y-4", children: [
10475
10496
  /* @__PURE__ */ N("div", { className: "space-y-2", children: [
10476
10497
  /* @__PURE__ */ c(Oe, { htmlFor: "api-url", children: "API Base URL" }),
10477
10498
  /* @__PURE__ */ N("div", { className: "flex gap-2", children: [
10478
10499
  /* @__PURE__ */ c(
10479
- sn,
10500
+ on,
10480
10501
  {
10481
10502
  id: "api-url",
10482
10503
  value: i.api.baseUrl,
@@ -10493,7 +10514,7 @@ function $y({ settings: e, onSettingsChange: t, className: n = "" }) {
10493
10514
  /* @__PURE__ */ N("div", { className: "flex items-center justify-between", children: [
10494
10515
  /* @__PURE__ */ c(Oe, { htmlFor: "enable-auth", children: "Enable Authentication" }),
10495
10516
  /* @__PURE__ */ c(
10496
- et,
10517
+ tt,
10497
10518
  {
10498
10519
  id: "enable-auth",
10499
10520
  checked: i.api.enableAuth,
@@ -10508,7 +10529,7 @@ function $y({ settings: e, onSettingsChange: t, className: n = "" }) {
10508
10529
  /* @__PURE__ */ c(Oe, { htmlFor: "auth-token", children: "Authentication Token" }),
10509
10530
  /* @__PURE__ */ N("div", { className: "flex gap-2", children: [
10510
10531
  /* @__PURE__ */ c(
10511
- sn,
10532
+ on,
10512
10533
  {
10513
10534
  id: "auth-token",
10514
10535
  type: s ? "text" : "password",
@@ -10533,12 +10554,12 @@ function $y({ settings: e, onSettingsChange: t, className: n = "" }) {
10533
10554
  ] })
10534
10555
  ] })
10535
10556
  ] }),
10536
- /* @__PURE__ */ N(kn, { children: [
10537
- /* @__PURE__ */ c(Dn, { className: "pb-3", children: /* @__PURE__ */ N(Ln, { className: "text-lg flex items-center gap-2", children: [
10557
+ /* @__PURE__ */ N(Mn, { children: [
10558
+ /* @__PURE__ */ c(kn, { className: "pb-3", children: /* @__PURE__ */ N(Dn, { className: "text-lg flex items-center gap-2", children: [
10538
10559
  /* @__PURE__ */ c(nd, { className: "h-5 w-5" }),
10539
10560
  "Interface Settings"
10540
10561
  ] }) }),
10541
- /* @__PURE__ */ N(Fn, { className: "space-y-4", children: [
10562
+ /* @__PURE__ */ N(Ln, { className: "space-y-4", children: [
10542
10563
  /* @__PURE__ */ N("div", { className: "space-y-2", children: [
10543
10564
  /* @__PURE__ */ c(Oe, { htmlFor: "layout", children: "Layout Style" }),
10544
10565
  /* @__PURE__ */ N(
@@ -10550,8 +10571,8 @@ function $y({ settings: e, onSettingsChange: t, className: n = "" }) {
10550
10571
  ui: { ...w.ui, layout: b }
10551
10572
  })),
10552
10573
  children: [
10553
- /* @__PURE__ */ c(vo, { children: /* @__PURE__ */ c(da, {}) }),
10554
- /* @__PURE__ */ N(wo, { children: [
10574
+ /* @__PURE__ */ c(bo, { children: /* @__PURE__ */ c(da, {}) }),
10575
+ /* @__PURE__ */ N(vo, { children: [
10555
10576
  /* @__PURE__ */ c(ut, { value: "sidebar", children: "Sidebar Layout" }),
10556
10577
  /* @__PURE__ */ c(ut, { value: "fullscreen", children: "Fullscreen" }),
10557
10578
  /* @__PURE__ */ c(ut, { value: "tabs", children: "Tabbed Interface" })
@@ -10571,8 +10592,8 @@ function $y({ settings: e, onSettingsChange: t, className: n = "" }) {
10571
10592
  ui: { ...w.ui, theme: b }
10572
10593
  })),
10573
10594
  children: [
10574
- /* @__PURE__ */ c(vo, { children: /* @__PURE__ */ c(da, {}) }),
10575
- /* @__PURE__ */ N(wo, { children: [
10595
+ /* @__PURE__ */ c(bo, { children: /* @__PURE__ */ c(da, {}) }),
10596
+ /* @__PURE__ */ N(vo, { children: [
10576
10597
  /* @__PURE__ */ c(ut, { value: "light", children: "Light" }),
10577
10598
  /* @__PURE__ */ c(ut, { value: "dark", children: "Dark" }),
10578
10599
  /* @__PURE__ */ c(ut, { value: "system", children: "System" })
@@ -10586,7 +10607,7 @@ function $y({ settings: e, onSettingsChange: t, className: n = "" }) {
10586
10607
  /* @__PURE__ */ N("div", { className: "flex items-center justify-between", children: [
10587
10608
  /* @__PURE__ */ c(Oe, { htmlFor: "show-timestamps", children: "Show Timestamps" }),
10588
10609
  /* @__PURE__ */ c(
10589
- et,
10610
+ tt,
10590
10611
  {
10591
10612
  id: "show-timestamps",
10592
10613
  checked: i.ui.showTimestamps,
@@ -10600,7 +10621,7 @@ function $y({ settings: e, onSettingsChange: t, className: n = "" }) {
10600
10621
  /* @__PURE__ */ N("div", { className: "flex items-center justify-between", children: [
10601
10622
  /* @__PURE__ */ c(Oe, { htmlFor: "show-agent-names", children: "Show Agent Names" }),
10602
10623
  /* @__PURE__ */ c(
10603
- et,
10624
+ tt,
10604
10625
  {
10605
10626
  id: "show-agent-names",
10606
10627
  checked: i.ui.showAgentNames,
@@ -10614,7 +10635,7 @@ function $y({ settings: e, onSettingsChange: t, className: n = "" }) {
10614
10635
  /* @__PURE__ */ N("div", { className: "flex items-center justify-between", children: [
10615
10636
  /* @__PURE__ */ c(Oe, { htmlFor: "compact-messages", children: "Compact Messages" }),
10616
10637
  /* @__PURE__ */ c(
10617
- et,
10638
+ tt,
10618
10639
  {
10619
10640
  id: "compact-messages",
10620
10641
  checked: i.ui.compactMessages,
@@ -10628,19 +10649,19 @@ function $y({ settings: e, onSettingsChange: t, className: n = "" }) {
10628
10649
  ] })
10629
10650
  ] })
10630
10651
  ] }),
10631
- /* @__PURE__ */ N(kn, { children: [
10632
- /* @__PURE__ */ c(Dn, { className: "pb-3", children: /* @__PURE__ */ N(Ln, { className: "text-lg flex items-center gap-2", children: [
10652
+ /* @__PURE__ */ N(Mn, { children: [
10653
+ /* @__PURE__ */ c(kn, { className: "pb-3", children: /* @__PURE__ */ N(Dn, { className: "text-lg flex items-center gap-2", children: [
10633
10654
  /* @__PURE__ */ c(rd, { className: "h-5 w-5" }),
10634
10655
  "Behavior Settings"
10635
10656
  ] }) }),
10636
- /* @__PURE__ */ N(Fn, { className: "space-y-4", children: [
10657
+ /* @__PURE__ */ N(Ln, { className: "space-y-4", children: [
10637
10658
  /* @__PURE__ */ N("div", { className: "flex items-center justify-between", children: [
10638
10659
  /* @__PURE__ */ N("div", { children: [
10639
10660
  /* @__PURE__ */ c(Oe, { htmlFor: "auto-save", children: "Auto-save Conversations" }),
10640
10661
  /* @__PURE__ */ c("p", { className: "text-sm text-muted-foreground", children: "Automatically save messages to threads" })
10641
10662
  ] }),
10642
10663
  /* @__PURE__ */ c(
10643
- et,
10664
+ tt,
10644
10665
  {
10645
10666
  id: "auto-save",
10646
10667
  checked: i.behavior.autoSave,
@@ -10657,7 +10678,7 @@ function $y({ settings: e, onSettingsChange: t, className: n = "" }) {
10657
10678
  /* @__PURE__ */ c("p", { className: "text-sm text-muted-foreground", children: "Stream responses in real-time" })
10658
10679
  ] }),
10659
10680
  /* @__PURE__ */ c(
10660
- et,
10681
+ tt,
10661
10682
  {
10662
10683
  id: "enable-streaming",
10663
10684
  checked: i.behavior.enableStreaming,
@@ -10674,7 +10695,7 @@ function $y({ settings: e, onSettingsChange: t, className: n = "" }) {
10674
10695
  /* @__PURE__ */ c("p", { className: "text-sm text-muted-foreground", children: "Show typing indicator during responses" })
10675
10696
  ] }),
10676
10697
  /* @__PURE__ */ c(
10677
- et,
10698
+ tt,
10678
10699
  {
10679
10700
  id: "typing-indicator",
10680
10701
  checked: i.behavior.showTypingIndicator,
@@ -10690,7 +10711,7 @@ function $y({ settings: e, onSettingsChange: t, className: n = "" }) {
10690
10711
  ] }),
10691
10712
  /* @__PURE__ */ N("div", { className: "flex items-center justify-between pt-6 border-t", children: [
10692
10713
  /* @__PURE__ */ N(fe, { variant: "outline", onClick: v, children: [
10693
- /* @__PURE__ */ c(Kr, { className: "h-4 w-4 mr-2" }),
10714
+ /* @__PURE__ */ c(jr, { className: "h-4 w-4 mr-2" }),
10694
10715
  "Reset"
10695
10716
  ] }),
10696
10717
  /* @__PURE__ */ N("div", { className: "flex gap-2", children: [
@@ -10729,25 +10750,25 @@ function By({
10729
10750
  "--chat-sidebar-width": f === "phone" ? "100%" : f === "tablet" ? "280px" : f === "half-screen" ? "240px" : "320px",
10730
10751
  "--chat-message-max-width": f === "phone" ? "95%" : f === "tablet" ? "90%" : f === "half-screen" ? "85%" : "80%",
10731
10752
  "--chat-input-height": f === "phone" ? "120px" : "100px"
10732
- }), u = Ze.useCallback((f) => {
10753
+ }), u = Qe.useCallback((f) => {
10733
10754
  var d;
10734
10755
  (d = s.onThreadChange) == null || d.call(s, f);
10735
10756
  }, [s.onThreadChange]);
10736
- return e === "fullscreen" ? /* @__PURE__ */ c(Pn, { ...s, onThreadChange: u, children: /* @__PURE__ */ c(
10757
+ return e === "fullscreen" ? /* @__PURE__ */ c(An, { ...s, onThreadChange: u, children: /* @__PURE__ */ c(
10737
10758
  "div",
10738
10759
  {
10739
10760
  className: `${a(t)} flex flex-col overflow-hidden ${r} ${o.container || ""}`,
10740
10761
  style: i(t),
10741
- children: /* @__PURE__ */ c(Mn, { className: "flex-1", onError: s.onError, enableFileUpload: !0 })
10762
+ children: /* @__PURE__ */ c(On, { className: "flex-1", onError: s.onError, enableFileUpload: !0 })
10742
10763
  }
10743
- ) }) : e === "tabs" ? /* @__PURE__ */ c(Pn, { ...s, onThreadChange: u, children: /* @__PURE__ */ c(
10764
+ ) }) : e === "tabs" ? /* @__PURE__ */ c(An, { ...s, onThreadChange: u, children: /* @__PURE__ */ c(
10744
10765
  "div",
10745
10766
  {
10746
10767
  className: `${a(t)} flex flex-col overflow-hidden ${r} ${o.container || ""}`,
10747
10768
  style: i(t),
10748
10769
  children: /* @__PURE__ */ N("div", { className: "flex-1 flex min-h-0 overflow-hidden", children: [
10749
10770
  n && /* @__PURE__ */ c("div", { className: `w-80 border-r flex-shrink-0 overflow-hidden ${o.sidebar || ""}`, children: /* @__PURE__ */ c(
10750
- lo,
10771
+ co,
10751
10772
  {
10752
10773
  showCreateButton: !0,
10753
10774
  showDeleteButton: !0,
@@ -10755,17 +10776,17 @@ function By({
10755
10776
  className: "h-full"
10756
10777
  }
10757
10778
  ) }),
10758
- /* @__PURE__ */ c("div", { className: `flex-1 min-w-0 overflow-hidden ${o.chatArea || ""}`, children: /* @__PURE__ */ c(Mn, { onError: s.onError, enableFileUpload: !0 }) })
10779
+ /* @__PURE__ */ c("div", { className: `flex-1 min-w-0 overflow-hidden ${o.chatArea || ""}`, children: /* @__PURE__ */ c(On, { onError: s.onError, enableFileUpload: !0 }) })
10759
10780
  ] })
10760
10781
  }
10761
- ) }) : /* @__PURE__ */ c(Pn, { ...s, onThreadChange: u, children: /* @__PURE__ */ N(
10782
+ ) }) : /* @__PURE__ */ c(An, { ...s, onThreadChange: u, children: /* @__PURE__ */ N(
10762
10783
  "div",
10763
10784
  {
10764
10785
  className: `${a(t)} flex overflow-hidden ${r} ${o.container || ""}`,
10765
10786
  style: i(t),
10766
10787
  children: [
10767
10788
  n && /* @__PURE__ */ c("div", { className: `w-80 border-r bg-gray-50 flex-shrink-0 overflow-hidden ${o.sidebar || ""}`, children: /* @__PURE__ */ c(
10768
- lo,
10789
+ co,
10769
10790
  {
10770
10791
  showCreateButton: !0,
10771
10792
  showDeleteButton: !0,
@@ -10773,7 +10794,7 @@ function By({
10773
10794
  className: "h-full"
10774
10795
  }
10775
10796
  ) }),
10776
- /* @__PURE__ */ c("div", { className: `flex-1 min-w-0 overflow-hidden ${o.chatArea || ""}`, children: /* @__PURE__ */ c(Mn, { onError: s.onError, enableFileUpload: !0 }) })
10797
+ /* @__PURE__ */ c("div", { className: `flex-1 min-w-0 overflow-hidden ${o.chatArea || ""}`, children: /* @__PURE__ */ c(On, { onError: s.onError, enableFileUpload: !0 }) })
10777
10798
  ]
10778
10799
  }
10779
10800
  ) });
@@ -10782,14 +10803,14 @@ export {
10782
10803
  Eo as Api,
10783
10804
  Sy as AuthApi,
10784
10805
  xy as ChatApi,
10785
- Mn as ChatInterface,
10806
+ On as ChatInterface,
10786
10807
  Dy as ChatMainLayout,
10787
- Pn as ChatProvider,
10808
+ An as ChatProvider,
10788
10809
  Ty as ChatRoutingProvider,
10789
10810
  $y as ChatSettings,
10790
- yn as MarkdownContent,
10811
+ wn as MarkdownContent,
10791
10812
  wp as MessageComponent,
10792
- lo as ThreadManager,
10813
+ co as ThreadManager,
10793
10814
  mt as apiClient,
10794
10815
  _y as applySettings,
10795
10816
  By as default,
@@ -10802,7 +10823,7 @@ export {
10802
10823
  Uf as onAuthTokenChanged,
10803
10824
  jt as post,
10804
10825
  Hf as put,
10805
- eo as setAuthToken,
10826
+ Qr as setAuthToken,
10806
10827
  Vf as stream,
10807
10828
  ja as useChat,
10808
10829
  Ay as useChatRouting,