@autogames/sdk 1.2.3 → 1.2.4

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.
@@ -1,10 +1,6 @@
1
- import { jsx as l, jsxs as M } from "react/jsx-runtime";
2
- import * as $ from "react";
3
- import { forwardRef as It, createElement as bt, useMemo as Tt, useRef as j, useReducer as Qe, useLayoutEffect as xt, useEffect as wt, useImperativeHandle as $e, memo as Le, useState as oe, useCallback as Kt, StrictMode as qe } from "react";
4
- import { c as Ue } from "./client-CgE37lov.js";
5
- import { flushSync as _e } from "react-dom";
6
- import { a as Ft, A as ce, u as gt } from "./main-BGvL9KWK.js";
7
- var et = class {
1
+ import { j as h, r as Ee, c as Pe } from "./index-BfOurzzw.js";
2
+ import { a as f, b as kt, A as Zt, u as pt } from "./main-DBE9yqee.js";
3
+ var Z = class {
8
4
  constructor() {
9
5
  this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
10
6
  }
@@ -20,7 +16,7 @@ var et = class {
20
16
  }
21
17
  onUnsubscribe() {
22
18
  }
23
- }, je = {
19
+ }, Me = {
24
20
  // We need the wrapper function syntax below instead of direct references to
25
21
  // global setTimeout etc.
26
22
  //
@@ -35,14 +31,14 @@ var et = class {
35
31
  clearTimeout: (t) => clearTimeout(t),
36
32
  setInterval: (t, e) => setInterval(t, e),
37
33
  clearInterval: (t) => clearInterval(t)
38
- }, Ke = class {
34
+ }, je = class {
39
35
  // We cannot have TimeoutManager<T> as we must instantiate it with a concrete
40
36
  // type at app boot; and if we leave that type, then any new timer provider
41
37
  // would need to support ReturnType<typeof setTimeout>, which is infeasible.
42
38
  //
43
39
  // We settle for type safety for the TimeoutProvider type, and accept that
44
40
  // this class is unsafe internally to allow for extension.
45
- #t = je;
41
+ #t = Me;
46
42
  #e = !1;
47
43
  setTimeoutProvider(t) {
48
44
  this.#t = t;
@@ -59,29 +55,29 @@ var et = class {
59
55
  clearInterval(t) {
60
56
  this.#t.clearInterval(t);
61
57
  }
62
- }, V = new Ke();
63
- function ze(t) {
58
+ }, G = new je();
59
+ function Ne(t) {
64
60
  setTimeout(t, 0);
65
61
  }
66
- var X = typeof window > "u" || "Deno" in globalThis;
67
- function U() {
62
+ var V = typeof window > "u" || "Deno" in globalThis;
63
+ function L() {
68
64
  }
69
- function Be(t, e) {
65
+ function Ie(t, e) {
70
66
  return typeof t == "function" ? t(e) : t;
71
67
  }
72
- function Ct(t) {
68
+ function yt(t) {
73
69
  return typeof t == "number" && t >= 0 && t !== 1 / 0;
74
70
  }
75
- function ue(t, e) {
71
+ function te(t, e) {
76
72
  return Math.max(t + (e || 0) - Date.now(), 0);
77
73
  }
78
- function W(t, e) {
74
+ function H(t, e) {
79
75
  return typeof t == "function" ? t(e) : t;
80
76
  }
81
- function z(t, e) {
77
+ function _(t, e) {
82
78
  return typeof t == "function" ? t(e) : t;
83
79
  }
84
- function zt(t, e) {
80
+ function Dt(t, e) {
85
81
  const {
86
82
  type: s = "all",
87
83
  exact: r,
@@ -92,9 +88,9 @@ function zt(t, e) {
92
88
  } = t;
93
89
  if (o) {
94
90
  if (r) {
95
- if (e.queryHash !== At(o, e.options))
91
+ if (e.queryHash !== Et(o, e.options))
96
92
  return !1;
97
- } else if (!it(e.queryKey, o))
93
+ } else if (!st(e.queryKey, o))
98
94
  return !1;
99
95
  }
100
96
  if (s !== "all") {
@@ -104,55 +100,55 @@ function zt(t, e) {
104
100
  }
105
101
  return !(typeof a == "boolean" && e.isStale() !== a || i && i !== e.state.fetchStatus || n && !n(e));
106
102
  }
107
- function Bt(t, e) {
103
+ function Qt(t, e) {
108
104
  const { exact: s, status: r, predicate: i, mutationKey: n } = t;
109
105
  if (n) {
110
106
  if (!e.options.mutationKey)
111
107
  return !1;
112
108
  if (s) {
113
- if (J(e.options.mutationKey) !== J(n))
109
+ if (Y(e.options.mutationKey) !== Y(n))
114
110
  return !1;
115
- } else if (!it(e.options.mutationKey, n))
111
+ } else if (!st(e.options.mutationKey, n))
116
112
  return !1;
117
113
  }
118
114
  return !(r && e.state.status !== r || i && !i(e));
119
115
  }
120
- function At(t, e) {
121
- return (e?.queryKeyHashFn || J)(t);
116
+ function Et(t, e) {
117
+ return (e?.queryKeyHashFn || Y)(t);
122
118
  }
123
- function J(t) {
119
+ function Y(t) {
124
120
  return JSON.stringify(
125
121
  t,
126
- (e, s) => St(s) ? Object.keys(s).sort().reduce((r, i) => (r[i] = s[i], r), {}) : s
122
+ (e, s) => vt(s) ? Object.keys(s).sort().reduce((r, i) => (r[i] = s[i], r), {}) : s
127
123
  );
128
124
  }
129
- function it(t, e) {
130
- return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((s) => it(t[s], e[s])) : !1;
125
+ function st(t, e) {
126
+ return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? Object.keys(e).every((s) => st(t[s], e[s])) : !1;
131
127
  }
132
- var He = Object.prototype.hasOwnProperty;
133
- function he(t, e) {
128
+ var Te = Object.prototype.hasOwnProperty;
129
+ function ee(t, e) {
134
130
  if (t === e)
135
131
  return t;
136
- const s = Ht(t) && Ht(e);
137
- if (!s && !(St(t) && St(e))) return e;
132
+ const s = $t(t) && $t(e);
133
+ if (!s && !(vt(t) && vt(e))) return e;
138
134
  const i = (s ? t : Object.keys(t)).length, n = s ? e : Object.keys(e), o = n.length, a = s ? new Array(o) : {};
139
135
  let u = 0;
140
- for (let h = 0; h < o; h++) {
141
- const c = s ? h : n[h], f = t[c], d = e[c];
142
- if (f === d) {
143
- a[c] = f, (s ? h < i : He.call(t, c)) && u++;
136
+ for (let l = 0; l < o; l++) {
137
+ const c = s ? l : n[l], p = t[c], d = e[c];
138
+ if (p === d) {
139
+ a[c] = p, (s ? l < i : Te.call(t, c)) && u++;
144
140
  continue;
145
141
  }
146
- if (f === null || d === null || typeof f != "object" || typeof d != "object") {
142
+ if (p === null || d === null || typeof p != "object" || typeof d != "object") {
147
143
  a[c] = d;
148
144
  continue;
149
145
  }
150
- const C = he(f, d);
151
- a[c] = C, C === f && u++;
146
+ const S = ee(p, d);
147
+ a[c] = S, S === p && u++;
152
148
  }
153
149
  return i === o && u === i ? t : a;
154
150
  }
155
- function lt(t, e) {
151
+ function ut(t, e) {
156
152
  if (!e || Object.keys(t).length !== Object.keys(e).length)
157
153
  return !1;
158
154
  for (const s in t)
@@ -160,51 +156,51 @@ function lt(t, e) {
160
156
  return !1;
161
157
  return !0;
162
158
  }
163
- function Ht(t) {
159
+ function $t(t) {
164
160
  return Array.isArray(t) && t.length === Object.keys(t).length;
165
161
  }
166
- function St(t) {
167
- if (!Gt(t))
162
+ function vt(t) {
163
+ if (!Lt(t))
168
164
  return !1;
169
165
  const e = t.constructor;
170
166
  if (e === void 0)
171
167
  return !0;
172
168
  const s = e.prototype;
173
- return !(!Gt(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
169
+ return !(!Lt(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(t) !== Object.prototype);
174
170
  }
175
- function Gt(t) {
171
+ function Lt(t) {
176
172
  return Object.prototype.toString.call(t) === "[object Object]";
177
173
  }
178
- function Ge(t) {
174
+ function Fe(t) {
179
175
  return new Promise((e) => {
180
- V.setTimeout(e, t);
176
+ G.setTimeout(e, t);
181
177
  });
182
178
  }
183
- function Ot(t, e, s) {
184
- return typeof s.structuralSharing == "function" ? s.structuralSharing(t, e) : s.structuralSharing !== !1 ? he(t, e) : e;
179
+ function bt(t, e, s) {
180
+ return typeof s.structuralSharing == "function" ? s.structuralSharing(t, e) : s.structuralSharing !== !1 ? ee(t, e) : e;
185
181
  }
186
- function We(t, e, s = 0) {
182
+ function Ae(t, e, s = 0) {
187
183
  const r = [...t, e];
188
184
  return s && r.length > s ? r.slice(1) : r;
189
185
  }
190
- function Ve(t, e, s = 0) {
186
+ function De(t, e, s = 0) {
191
187
  const r = [e, ...t];
192
188
  return s && r.length > s ? r.slice(0, -1) : r;
193
189
  }
194
- var Dt = Symbol();
195
- function le(t, e) {
196
- return !t.queryFn && e?.initialPromise ? () => e.initialPromise : !t.queryFn || t.queryFn === Dt ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
190
+ var Pt = Symbol();
191
+ function se(t, e) {
192
+ return !t.queryFn && e?.initialPromise ? () => e.initialPromise : !t.queryFn || t.queryFn === Pt ? () => Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)) : t.queryFn;
197
193
  }
198
- function de(t, e) {
194
+ function re(t, e) {
199
195
  return typeof t == "function" ? t(...e) : !!t;
200
196
  }
201
- var Ye = class extends et {
197
+ var Qe = class extends Z {
202
198
  #t;
203
199
  #e;
204
200
  #s;
205
201
  constructor() {
206
202
  super(), this.#s = (t) => {
207
- if (!X && window.addEventListener) {
203
+ if (!V && window.addEventListener) {
208
204
  const e = () => t();
209
205
  return window.addEventListener("visibilitychange", e, !1), () => {
210
206
  window.removeEventListener("visibilitychange", e);
@@ -235,8 +231,8 @@ var Ye = class extends et {
235
231
  isFocused() {
236
232
  return typeof this.#t == "boolean" ? this.#t : globalThis.document?.visibilityState !== "hidden";
237
233
  }
238
- }, Qt = new Ye();
239
- function kt() {
234
+ }, Mt = new Qe();
235
+ function xt() {
240
236
  let t, e;
241
237
  const s = new Promise((i, n) => {
242
238
  t = i, e = n;
@@ -258,13 +254,13 @@ function kt() {
258
254
  }), e(i);
259
255
  }, s;
260
256
  }
261
- var Xe = ze;
262
- function Je() {
257
+ var $e = Ne;
258
+ function Le() {
263
259
  let t = [], e = 0, s = (a) => {
264
260
  a();
265
261
  }, r = (a) => {
266
262
  a();
267
- }, i = Xe;
263
+ }, i = $e;
268
264
  const n = (a) => {
269
265
  e ? t.push(a) : i(() => {
270
266
  s(a);
@@ -318,13 +314,13 @@ function Je() {
318
314
  }
319
315
  };
320
316
  }
321
- var A = Je(), Ze = class extends et {
317
+ var F = Le(), qe = class extends Z {
322
318
  #t = !0;
323
319
  #e;
324
320
  #s;
325
321
  constructor() {
326
322
  super(), this.#s = (t) => {
327
- if (!X && window.addEventListener) {
323
+ if (!V && window.addEventListener) {
328
324
  const e = () => t(!0), s = () => t(!1);
329
325
  return window.addEventListener("online", e, !1), window.addEventListener("offline", s, !1), () => {
330
326
  window.removeEventListener("online", e), window.removeEventListener("offline", s);
@@ -349,59 +345,59 @@ var A = Je(), Ze = class extends et {
349
345
  isOnline() {
350
346
  return this.#t;
351
347
  }
352
- }, dt = new Ze();
353
- function ts(t) {
348
+ }, ht = new qe();
349
+ function Ue(t) {
354
350
  return Math.min(1e3 * 2 ** t, 3e4);
355
351
  }
356
- function fe(t) {
357
- return (t ?? "online") === "online" ? dt.isOnline() : !0;
352
+ function ie(t) {
353
+ return (t ?? "online") === "online" ? ht.isOnline() : !0;
358
354
  }
359
- var Pt = class extends Error {
355
+ var wt = class extends Error {
360
356
  constructor(t) {
361
357
  super("CancelledError"), this.revert = t?.revert, this.silent = t?.silent;
362
358
  }
363
359
  };
364
- function pe(t) {
360
+ function ne(t) {
365
361
  let e = !1, s = 0, r;
366
- const i = kt(), n = () => i.status !== "pending", o = (p) => {
362
+ const i = xt(), n = () => i.status !== "pending", o = (m) => {
367
363
  if (!n()) {
368
- const y = new Pt(p);
369
- d(y), t.onCancel?.(y);
364
+ const v = new wt(m);
365
+ d(v), t.onCancel?.(v);
370
366
  }
371
367
  }, a = () => {
372
368
  e = !0;
373
369
  }, u = () => {
374
370
  e = !1;
375
- }, h = () => Qt.isFocused() && (t.networkMode === "always" || dt.isOnline()) && t.canRun(), c = () => fe(t.networkMode) && t.canRun(), f = (p) => {
376
- n() || (r?.(), i.resolve(p));
377
- }, d = (p) => {
378
- n() || (r?.(), i.reject(p));
379
- }, C = () => new Promise((p) => {
380
- r = (y) => {
381
- (n() || h()) && p(y);
371
+ }, l = () => Mt.isFocused() && (t.networkMode === "always" || ht.isOnline()) && t.canRun(), c = () => ie(t.networkMode) && t.canRun(), p = (m) => {
372
+ n() || (r?.(), i.resolve(m));
373
+ }, d = (m) => {
374
+ n() || (r?.(), i.reject(m));
375
+ }, S = () => new Promise((m) => {
376
+ r = (v) => {
377
+ (n() || l()) && m(v);
382
378
  }, t.onPause?.();
383
379
  }).then(() => {
384
380
  r = void 0, n() || t.onContinue?.();
385
- }), g = () => {
381
+ }), y = () => {
386
382
  if (n())
387
383
  return;
388
- let p;
389
- const y = s === 0 ? t.initialPromise : void 0;
384
+ let m;
385
+ const v = s === 0 ? t.initialPromise : void 0;
390
386
  try {
391
- p = y ?? t.fn();
392
- } catch (b) {
393
- p = Promise.reject(b);
387
+ m = v ?? t.fn();
388
+ } catch (x) {
389
+ m = Promise.reject(x);
394
390
  }
395
- Promise.resolve(p).then(f).catch((b) => {
391
+ Promise.resolve(m).then(p).catch((x) => {
396
392
  if (n())
397
393
  return;
398
- const R = t.retry ?? (X ? 0 : 3), P = t.retryDelay ?? ts, D = typeof P == "function" ? P(s, b) : P, L = R === !0 || typeof R == "number" && s < R || typeof R == "function" && R(s, b);
399
- if (e || !L) {
400
- d(b);
394
+ const P = t.retry ?? (V ? 0 : 3), E = t.retryDelay ?? Ue, A = typeof E == "function" ? E(s, x) : E, Q = P === !0 || typeof P == "number" && s < P || typeof P == "function" && P(s, x);
395
+ if (e || !Q) {
396
+ d(x);
401
397
  return;
402
398
  }
403
- s++, t.onFail?.(s, b), Ge(D).then(() => h() ? void 0 : C()).then(() => {
404
- e ? d(b) : g();
399
+ s++, t.onFail?.(s, x), Fe(A).then(() => l() ? void 0 : S()).then(() => {
400
+ e ? d(x) : y();
405
401
  });
406
402
  });
407
403
  };
@@ -413,29 +409,29 @@ function pe(t) {
413
409
  cancelRetry: a,
414
410
  continueRetry: u,
415
411
  canStart: c,
416
- start: () => (c() ? g() : C().then(g), i)
412
+ start: () => (c() ? y() : S().then(y), i)
417
413
  };
418
414
  }
419
- var me = class {
415
+ var ae = class {
420
416
  #t;
421
417
  destroy() {
422
418
  this.clearGcTimeout();
423
419
  }
424
420
  scheduleGc() {
425
- this.clearGcTimeout(), Ct(this.gcTime) && (this.#t = V.setTimeout(() => {
421
+ this.clearGcTimeout(), yt(this.gcTime) && (this.#t = G.setTimeout(() => {
426
422
  this.optionalRemove();
427
423
  }, this.gcTime));
428
424
  }
429
425
  updateGcTime(t) {
430
426
  this.gcTime = Math.max(
431
427
  this.gcTime || 0,
432
- t ?? (X ? 1 / 0 : 300 * 1e3)
428
+ t ?? (V ? 1 / 0 : 300 * 1e3)
433
429
  );
434
430
  }
435
431
  clearGcTimeout() {
436
- this.#t && (V.clearTimeout(this.#t), this.#t = void 0);
432
+ this.#t && (G.clearTimeout(this.#t), this.#t = void 0);
437
433
  }
438
- }, es = class extends me {
434
+ }, _e = class extends ae {
439
435
  #t;
440
436
  #e;
441
437
  #s;
@@ -444,7 +440,7 @@ var me = class {
444
440
  #a;
445
441
  #o;
446
442
  constructor(t) {
447
- super(), this.#o = !1, this.#a = t.defaultOptions, this.setOptions(t.options), this.observers = [], this.#i = t.client, this.#s = this.#i.getQueryCache(), this.queryKey = t.queryKey, this.queryHash = t.queryHash, this.#t = Vt(this.options), this.state = t.state ?? this.#t, this.scheduleGc();
443
+ super(), this.#o = !1, this.#a = t.defaultOptions, this.setOptions(t.options), this.observers = [], this.#i = t.client, this.#s = this.#i.getQueryCache(), this.queryKey = t.queryKey, this.queryHash = t.queryHash, this.#t = Ut(this.options), this.state = t.state ?? this.#t, this.scheduleGc();
448
444
  }
449
445
  get meta() {
450
446
  return this.options.meta;
@@ -454,9 +450,9 @@ var me = class {
454
450
  }
455
451
  setOptions(t) {
456
452
  if (this.options = { ...this.#a, ...t }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
457
- const e = Vt(this.options);
453
+ const e = Ut(this.options);
458
454
  e.data !== void 0 && (this.setState(
459
- Wt(e.data, e.dataUpdatedAt)
455
+ qt(e.data, e.dataUpdatedAt)
460
456
  ), this.#t = e);
461
457
  }
462
458
  }
@@ -464,7 +460,7 @@ var me = class {
464
460
  !this.observers.length && this.state.fetchStatus === "idle" && this.#s.remove(this);
465
461
  }
466
462
  setData(t, e) {
467
- const s = Ot(this.state.data, t, this.options);
463
+ const s = bt(this.state.data, t, this.options);
468
464
  return this.#n({
469
465
  data: s,
470
466
  type: "success",
@@ -477,7 +473,7 @@ var me = class {
477
473
  }
478
474
  cancel(t) {
479
475
  const e = this.#r?.promise;
480
- return this.#r?.cancel(t), e ? e.then(U).catch(U) : Promise.resolve();
476
+ return this.#r?.cancel(t), e ? e.then(L).catch(L) : Promise.resolve();
481
477
  }
482
478
  destroy() {
483
479
  super.destroy(), this.cancel({ silent: !0 });
@@ -487,15 +483,15 @@ var me = class {
487
483
  }
488
484
  isActive() {
489
485
  return this.observers.some(
490
- (t) => z(t.options.enabled, this) !== !1
486
+ (t) => _(t.options.enabled, this) !== !1
491
487
  );
492
488
  }
493
489
  isDisabled() {
494
- return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === Dt || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
490
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === Pt || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
495
491
  }
496
492
  isStatic() {
497
493
  return this.getObserversCount() > 0 ? this.observers.some(
498
- (t) => W(t.options.staleTime, this) === "static"
494
+ (t) => H(t.options.staleTime, this) === "static"
499
495
  ) : !1;
500
496
  }
501
497
  isStale() {
@@ -504,7 +500,7 @@ var me = class {
504
500
  ) : this.state.data === void 0 || this.state.isInvalidated;
505
501
  }
506
502
  isStaleByTime(t = 0) {
507
- return this.state.data === void 0 ? !0 : t === "static" ? !1 : this.state.isInvalidated ? !0 : !ue(this.state.dataUpdatedAt, t);
503
+ return this.state.data === void 0 ? !0 : t === "static" ? !1 : this.state.isInvalidated ? !0 : !te(this.state.dataUpdatedAt, t);
508
504
  }
509
505
  onFocus() {
510
506
  this.observers.find((e) => e.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
@@ -544,7 +540,7 @@ var me = class {
544
540
  get: () => (this.#o = !0, s.signal)
545
541
  });
546
542
  }, i = () => {
547
- const a = le(this.options, e), h = (() => {
543
+ const a = se(this.options, e), l = (() => {
548
544
  const c = {
549
545
  client: this.#i,
550
546
  queryKey: this.queryKey,
@@ -554,9 +550,9 @@ var me = class {
554
550
  })();
555
551
  return this.#o = !1, this.options.persister ? this.options.persister(
556
552
  a,
557
- h,
553
+ l,
558
554
  this
559
- ) : a(h);
555
+ ) : a(l);
560
556
  }, o = (() => {
561
557
  const a = {
562
558
  fetchOptions: e,
@@ -568,11 +564,11 @@ var me = class {
568
564
  };
569
565
  return r(a), a;
570
566
  })();
571
- this.options.behavior?.onFetch(o, this), this.#e = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#n({ type: "fetch", meta: o.fetchOptions?.meta }), this.#r = pe({
567
+ this.options.behavior?.onFetch(o, this), this.#e = this.state, (this.state.fetchStatus === "idle" || this.state.fetchMeta !== o.fetchOptions?.meta) && this.#n({ type: "fetch", meta: o.fetchOptions?.meta }), this.#r = ne({
572
568
  initialPromise: e?.initialPromise,
573
569
  fn: o.fetchFn,
574
570
  onCancel: (a) => {
575
- a instanceof Pt && a.revert && this.setState({
571
+ a instanceof wt && a.revert && this.setState({
576
572
  ...this.#e,
577
573
  fetchStatus: "idle"
578
574
  }), s.abort();
@@ -601,7 +597,7 @@ var me = class {
601
597
  this
602
598
  ), a;
603
599
  } catch (a) {
604
- if (a instanceof Pt) {
600
+ if (a instanceof wt) {
605
601
  if (a.silent)
606
602
  return this.#r.promise;
607
603
  if (a.revert) {
@@ -647,13 +643,13 @@ var me = class {
647
643
  case "fetch":
648
644
  return {
649
645
  ...s,
650
- ...ge(s.data, this.options),
646
+ ...oe(s.data, this.options),
651
647
  fetchMeta: t.meta ?? null
652
648
  };
653
649
  case "success":
654
650
  const r = {
655
651
  ...s,
656
- ...Wt(t.data, t.dataUpdatedAt),
652
+ ...qt(t.data, t.dataUpdatedAt),
657
653
  dataUpdateCount: s.dataUpdateCount + 1,
658
654
  ...!t.manual && {
659
655
  fetchStatus: "idle",
@@ -686,25 +682,25 @@ var me = class {
686
682
  };
687
683
  }
688
684
  };
689
- this.state = e(this.state), A.batch(() => {
685
+ this.state = e(this.state), F.batch(() => {
690
686
  this.observers.forEach((s) => {
691
687
  s.onQueryUpdate();
692
688
  }), this.#s.notify({ query: this, type: "updated", action: t });
693
689
  });
694
690
  }
695
691
  };
696
- function ge(t, e) {
692
+ function oe(t, e) {
697
693
  return {
698
694
  fetchFailureCount: 0,
699
695
  fetchFailureReason: null,
700
- fetchStatus: fe(e.networkMode) ? "fetching" : "paused",
696
+ fetchStatus: ie(e.networkMode) ? "fetching" : "paused",
701
697
  ...t === void 0 && {
702
698
  error: null,
703
699
  status: "pending"
704
700
  }
705
701
  };
706
702
  }
707
- function Wt(t, e) {
703
+ function qt(t, e) {
708
704
  return {
709
705
  data: t,
710
706
  dataUpdatedAt: e ?? Date.now(),
@@ -713,7 +709,7 @@ function Wt(t, e) {
713
709
  status: "success"
714
710
  };
715
711
  }
716
- function Vt(t) {
712
+ function Ut(t) {
717
713
  const e = typeof t.initialData == "function" ? t.initialData() : t.initialData, s = e !== void 0, r = s ? typeof t.initialDataUpdatedAt == "function" ? t.initialDataUpdatedAt() : t.initialDataUpdatedAt : 0;
718
714
  return {
719
715
  data: e,
@@ -730,9 +726,9 @@ function Vt(t) {
730
726
  fetchStatus: "idle"
731
727
  };
732
728
  }
733
- var ye = class extends et {
729
+ var ce = class extends Z {
734
730
  constructor(t, e) {
735
- super(), this.options = e, this.#t = t, this.#n = null, this.#o = kt(), this.bindMethods(), this.setOptions(e);
731
+ super(), this.options = e, this.#t = t, this.#n = null, this.#o = xt(), this.bindMethods(), this.setOptions(e);
736
732
  }
737
733
  #t;
738
734
  #e = void 0;
@@ -755,20 +751,20 @@ var ye = class extends et {
755
751
  this.refetch = this.refetch.bind(this);
756
752
  }
757
753
  onSubscribe() {
758
- this.listeners.size === 1 && (this.#e.addObserver(this), Yt(this.#e, this.options) ? this.#l() : this.updateResult(), this.#b());
754
+ this.listeners.size === 1 && (this.#e.addObserver(this), _t(this.#e, this.options) ? this.#l() : this.updateResult(), this.#b());
759
755
  }
760
756
  onUnsubscribe() {
761
757
  this.hasListeners() || this.destroy();
762
758
  }
763
759
  shouldFetchOnReconnect() {
764
- return Rt(
760
+ return Ct(
765
761
  this.#e,
766
762
  this.options,
767
763
  this.options.refetchOnReconnect
768
764
  );
769
765
  }
770
766
  shouldFetchOnWindowFocus() {
771
- return Rt(
767
+ return Ct(
772
768
  this.#e,
773
769
  this.options,
774
770
  this.options.refetchOnWindowFocus
@@ -779,28 +775,28 @@ var ye = class extends et {
779
775
  }
780
776
  setOptions(t) {
781
777
  const e = this.options, s = this.#e;
782
- if (this.options = this.#t.defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof z(this.options.enabled, this.#e) != "boolean")
778
+ if (this.options = this.#t.defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof _(this.options.enabled, this.#e) != "boolean")
783
779
  throw new Error(
784
780
  "Expected enabled to be a boolean or a callback that returns a boolean"
785
781
  );
786
- this.#C(), this.#e.setOptions(this.options), e._defaulted && !lt(this.options, e) && this.#t.getQueryCache().notify({
782
+ this.#C(), this.#e.setOptions(this.options), e._defaulted && !ut(this.options, e) && this.#t.getQueryCache().notify({
787
783
  type: "observerOptionsUpdated",
788
784
  query: this.#e,
789
785
  observer: this
790
786
  });
791
787
  const r = this.hasListeners();
792
- r && Xt(
788
+ r && Kt(
793
789
  this.#e,
794
790
  s,
795
791
  this.options,
796
792
  e
797
- ) && this.#l(), this.updateResult(), r && (this.#e !== s || z(this.options.enabled, this.#e) !== z(e.enabled, this.#e) || W(this.options.staleTime, this.#e) !== W(e.staleTime, this.#e)) && this.#g();
793
+ ) && this.#l(), this.updateResult(), r && (this.#e !== s || _(this.options.enabled, this.#e) !== _(e.enabled, this.#e) || H(this.options.staleTime, this.#e) !== H(e.staleTime, this.#e)) && this.#g();
798
794
  const i = this.#y();
799
- r && (this.#e !== s || z(this.options.enabled, this.#e) !== z(e.enabled, this.#e) || i !== this.#c) && this.#v(i);
795
+ r && (this.#e !== s || _(this.options.enabled, this.#e) !== _(e.enabled, this.#e) || i !== this.#c) && this.#v(i);
800
796
  }
801
797
  getOptimisticResult(t) {
802
798
  const e = this.#t.getQueryCache().build(this.#t, t), s = this.createResult(e, t);
803
- return rs(this, s) && (this.#i = s, this.#a = this.options, this.#r = this.#e.state), s;
799
+ return ze(this, s) && (this.#i = s, this.#a = this.options, this.#r = this.#e.state), s;
804
800
  }
805
801
  getCurrentResult() {
806
802
  return this.#i;
@@ -841,18 +837,18 @@ var ye = class extends et {
841
837
  this.options,
842
838
  t
843
839
  );
844
- return t?.throwOnError || (e = e.catch(U)), e;
840
+ return t?.throwOnError || (e = e.catch(L)), e;
845
841
  }
846
842
  #g() {
847
843
  this.#x();
848
- const t = W(
844
+ const t = H(
849
845
  this.options.staleTime,
850
846
  this.#e
851
847
  );
852
- if (X || this.#i.isStale || !Ct(t))
848
+ if (V || this.#i.isStale || !yt(t))
853
849
  return;
854
- const s = ue(this.#i.dataUpdatedAt, t) + 1;
855
- this.#u = V.setTimeout(() => {
850
+ const s = te(this.#i.dataUpdatedAt, t) + 1;
851
+ this.#u = G.setTimeout(() => {
856
852
  this.#i.isStale || this.updateResult();
857
853
  }, s);
858
854
  }
@@ -860,105 +856,105 @@ var ye = class extends et {
860
856
  return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#e) : this.options.refetchInterval) ?? !1;
861
857
  }
862
858
  #v(t) {
863
- this.#w(), this.#c = t, !(X || z(this.options.enabled, this.#e) === !1 || !Ct(this.#c) || this.#c === 0) && (this.#h = V.setInterval(() => {
864
- (this.options.refetchIntervalInBackground || Qt.isFocused()) && this.#l();
859
+ this.#w(), this.#c = t, !(V || _(this.options.enabled, this.#e) === !1 || !yt(this.#c) || this.#c === 0) && (this.#h = G.setInterval(() => {
860
+ (this.options.refetchIntervalInBackground || Mt.isFocused()) && this.#l();
865
861
  }, this.#c));
866
862
  }
867
863
  #b() {
868
864
  this.#g(), this.#v(this.#y());
869
865
  }
870
866
  #x() {
871
- this.#u && (V.clearTimeout(this.#u), this.#u = void 0);
867
+ this.#u && (G.clearTimeout(this.#u), this.#u = void 0);
872
868
  }
873
869
  #w() {
874
- this.#h && (V.clearInterval(this.#h), this.#h = void 0);
870
+ this.#h && (G.clearInterval(this.#h), this.#h = void 0);
875
871
  }
876
872
  createResult(t, e) {
877
- const s = this.#e, r = this.options, i = this.#i, n = this.#r, o = this.#a, u = t !== s ? t.state : this.#s, { state: h } = t;
878
- let c = { ...h }, f = !1, d;
873
+ const s = this.#e, r = this.options, i = this.#i, n = this.#r, o = this.#a, u = t !== s ? t.state : this.#s, { state: l } = t;
874
+ let c = { ...l }, p = !1, d;
879
875
  if (e._optimisticResults) {
880
- const E = this.hasListeners(), N = !E && Yt(t, e), q = E && Xt(t, s, e, r);
881
- (N || q) && (c = {
876
+ const M = this.hasListeners(), j = !M && _t(t, e), $ = M && Kt(t, s, e, r);
877
+ (j || $) && (c = {
882
878
  ...c,
883
- ...ge(h.data, t.options)
879
+ ...oe(l.data, t.options)
884
880
  }), e._optimisticResults === "isRestoring" && (c.fetchStatus = "idle");
885
881
  }
886
- let { error: C, errorUpdatedAt: g, status: p } = c;
882
+ let { error: S, errorUpdatedAt: y, status: m } = c;
887
883
  d = c.data;
888
- let y = !1;
889
- if (e.placeholderData !== void 0 && d === void 0 && p === "pending") {
890
- let E;
891
- i?.isPlaceholderData && e.placeholderData === o?.placeholderData ? (E = i.data, y = !0) : E = typeof e.placeholderData == "function" ? e.placeholderData(
884
+ let v = !1;
885
+ if (e.placeholderData !== void 0 && d === void 0 && m === "pending") {
886
+ let M;
887
+ i?.isPlaceholderData && e.placeholderData === o?.placeholderData ? (M = i.data, v = !0) : M = typeof e.placeholderData == "function" ? e.placeholderData(
892
888
  this.#f?.state.data,
893
889
  this.#f
894
- ) : e.placeholderData, E !== void 0 && (p = "success", d = Ot(
890
+ ) : e.placeholderData, M !== void 0 && (m = "success", d = bt(
895
891
  i?.data,
896
- E,
892
+ M,
897
893
  e
898
- ), f = !0);
894
+ ), p = !0);
899
895
  }
900
- if (e.select && d !== void 0 && !y)
896
+ if (e.select && d !== void 0 && !v)
901
897
  if (i && d === n?.data && e.select === this.#m)
902
898
  d = this.#d;
903
899
  else
904
900
  try {
905
- this.#m = e.select, d = e.select(d), d = Ot(i?.data, d, e), this.#d = d, this.#n = null;
906
- } catch (E) {
907
- this.#n = E;
901
+ this.#m = e.select, d = e.select(d), d = bt(i?.data, d, e), this.#d = d, this.#n = null;
902
+ } catch (M) {
903
+ this.#n = M;
908
904
  }
909
- this.#n && (C = this.#n, d = this.#d, g = Date.now(), p = "error");
910
- const b = c.fetchStatus === "fetching", R = p === "pending", P = p === "error", D = R && b, L = d !== void 0, T = {
911
- status: p,
905
+ this.#n && (S = this.#n, d = this.#d, y = Date.now(), m = "error");
906
+ const x = c.fetchStatus === "fetching", P = m === "pending", E = m === "error", A = P && x, Q = d !== void 0, I = {
907
+ status: m,
912
908
  fetchStatus: c.fetchStatus,
913
- isPending: R,
914
- isSuccess: p === "success",
915
- isError: P,
916
- isInitialLoading: D,
917
- isLoading: D,
909
+ isPending: P,
910
+ isSuccess: m === "success",
911
+ isError: E,
912
+ isInitialLoading: A,
913
+ isLoading: A,
918
914
  data: d,
919
915
  dataUpdatedAt: c.dataUpdatedAt,
920
- error: C,
921
- errorUpdatedAt: g,
916
+ error: S,
917
+ errorUpdatedAt: y,
922
918
  failureCount: c.fetchFailureCount,
923
919
  failureReason: c.fetchFailureReason,
924
920
  errorUpdateCount: c.errorUpdateCount,
925
921
  isFetched: c.dataUpdateCount > 0 || c.errorUpdateCount > 0,
926
922
  isFetchedAfterMount: c.dataUpdateCount > u.dataUpdateCount || c.errorUpdateCount > u.errorUpdateCount,
927
- isFetching: b,
928
- isRefetching: b && !R,
929
- isLoadingError: P && !L,
923
+ isFetching: x,
924
+ isRefetching: x && !P,
925
+ isLoadingError: E && !Q,
930
926
  isPaused: c.fetchStatus === "paused",
931
- isPlaceholderData: f,
932
- isRefetchError: P && L,
933
- isStale: $t(t, e),
927
+ isPlaceholderData: p,
928
+ isRefetchError: E && Q,
929
+ isStale: jt(t, e),
934
930
  refetch: this.refetch,
935
931
  promise: this.#o,
936
- isEnabled: z(e.enabled, t) !== !1
932
+ isEnabled: _(e.enabled, t) !== !1
937
933
  };
938
934
  if (this.options.experimental_prefetchInRender) {
939
- const E = (K) => {
940
- T.status === "error" ? K.reject(T.error) : T.data !== void 0 && K.resolve(T.data);
941
- }, N = () => {
942
- const K = this.#o = T.promise = kt();
943
- E(K);
944
- }, q = this.#o;
945
- switch (q.status) {
935
+ const M = (U) => {
936
+ I.status === "error" ? U.reject(I.error) : I.data !== void 0 && U.resolve(I.data);
937
+ }, j = () => {
938
+ const U = this.#o = I.promise = xt();
939
+ M(U);
940
+ }, $ = this.#o;
941
+ switch ($.status) {
946
942
  case "pending":
947
- t.queryHash === s.queryHash && E(q);
943
+ t.queryHash === s.queryHash && M($);
948
944
  break;
949
945
  case "fulfilled":
950
- (T.status === "error" || T.data !== q.value) && N();
946
+ (I.status === "error" || I.data !== $.value) && j();
951
947
  break;
952
948
  case "rejected":
953
- (T.status !== "error" || T.error !== q.reason) && N();
949
+ (I.status !== "error" || I.error !== $.reason) && j();
954
950
  break;
955
951
  }
956
952
  }
957
- return T;
953
+ return I;
958
954
  }
959
955
  updateResult() {
960
956
  const t = this.#i, e = this.createResult(this.#e, this.options);
961
- if (this.#r = this.#e.state, this.#a = this.options, this.#r.data !== void 0 && (this.#f = this.#e), lt(e, t))
957
+ if (this.#r = this.#e.state, this.#a = this.options, this.#r.data !== void 0 && (this.#f = this.#e), ut(e, t))
962
958
  return;
963
959
  this.#i = e;
964
960
  const s = () => {
@@ -988,7 +984,7 @@ var ye = class extends et {
988
984
  this.updateResult(), this.hasListeners() && this.#b();
989
985
  }
990
986
  #S(t) {
991
- A.batch(() => {
987
+ F.batch(() => {
992
988
  t.listeners && this.listeners.forEach((e) => {
993
989
  e(this.#i);
994
990
  }), this.#t.getQueryCache().notify({
@@ -998,81 +994,81 @@ var ye = class extends et {
998
994
  });
999
995
  }
1000
996
  };
1001
- function ss(t, e) {
1002
- return z(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
997
+ function Ke(t, e) {
998
+ return _(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && e.retryOnMount === !1);
1003
999
  }
1004
- function Yt(t, e) {
1005
- return ss(t, e) || t.state.data !== void 0 && Rt(t, e, e.refetchOnMount);
1000
+ function _t(t, e) {
1001
+ return Ke(t, e) || t.state.data !== void 0 && Ct(t, e, e.refetchOnMount);
1006
1002
  }
1007
- function Rt(t, e, s) {
1008
- if (z(e.enabled, t) !== !1 && W(e.staleTime, t) !== "static") {
1003
+ function Ct(t, e, s) {
1004
+ if (_(e.enabled, t) !== !1 && H(e.staleTime, t) !== "static") {
1009
1005
  const r = typeof s == "function" ? s(t) : s;
1010
- return r === "always" || r !== !1 && $t(t, e);
1006
+ return r === "always" || r !== !1 && jt(t, e);
1011
1007
  }
1012
1008
  return !1;
1013
1009
  }
1014
- function Xt(t, e, s, r) {
1015
- return (t !== e || z(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && $t(t, s);
1010
+ function Kt(t, e, s, r) {
1011
+ return (t !== e || _(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && jt(t, s);
1016
1012
  }
1017
- function $t(t, e) {
1018
- return z(e.enabled, t) !== !1 && t.isStaleByTime(W(e.staleTime, t));
1013
+ function jt(t, e) {
1014
+ return _(e.enabled, t) !== !1 && t.isStaleByTime(H(e.staleTime, t));
1019
1015
  }
1020
- function rs(t, e) {
1021
- return !lt(t.getCurrentResult(), e);
1016
+ function ze(t, e) {
1017
+ return !ut(t.getCurrentResult(), e);
1022
1018
  }
1023
- function ft(t) {
1019
+ function lt(t) {
1024
1020
  return {
1025
1021
  onFetch: (e, s) => {
1026
1022
  const r = e.options, i = e.fetchOptions?.meta?.fetchMore?.direction, n = e.state.data?.pages || [], o = e.state.data?.pageParams || [];
1027
1023
  let a = { pages: [], pageParams: [] }, u = 0;
1028
- const h = async () => {
1024
+ const l = async () => {
1029
1025
  let c = !1;
1030
- const f = (g) => {
1031
- Object.defineProperty(g, "signal", {
1026
+ const p = (y) => {
1027
+ Object.defineProperty(y, "signal", {
1032
1028
  enumerable: !0,
1033
1029
  get: () => (e.signal.aborted ? c = !0 : e.signal.addEventListener("abort", () => {
1034
1030
  c = !0;
1035
1031
  }), e.signal)
1036
1032
  });
1037
- }, d = le(e.options, e.fetchOptions), C = async (g, p, y) => {
1033
+ }, d = se(e.options, e.fetchOptions), S = async (y, m, v) => {
1038
1034
  if (c)
1039
1035
  return Promise.reject();
1040
- if (p == null && g.pages.length)
1041
- return Promise.resolve(g);
1042
- const R = (() => {
1043
- const O = {
1036
+ if (m == null && y.pages.length)
1037
+ return Promise.resolve(y);
1038
+ const P = (() => {
1039
+ const R = {
1044
1040
  client: e.client,
1045
1041
  queryKey: e.queryKey,
1046
- pageParam: p,
1047
- direction: y ? "backward" : "forward",
1042
+ pageParam: m,
1043
+ direction: v ? "backward" : "forward",
1048
1044
  meta: e.options.meta
1049
1045
  };
1050
- return f(O), O;
1051
- })(), P = await d(R), { maxPages: D } = e.options, L = y ? Ve : We;
1046
+ return p(R), R;
1047
+ })(), E = await d(P), { maxPages: A } = e.options, Q = v ? De : Ae;
1052
1048
  return {
1053
- pages: L(g.pages, P, D),
1054
- pageParams: L(g.pageParams, p, D)
1049
+ pages: Q(y.pages, E, A),
1050
+ pageParams: Q(y.pageParams, m, A)
1055
1051
  };
1056
1052
  };
1057
1053
  if (i && n.length) {
1058
- const g = i === "backward", p = g ? ve : Et, y = {
1054
+ const y = i === "backward", m = y ? ue : St, v = {
1059
1055
  pages: n,
1060
1056
  pageParams: o
1061
- }, b = p(r, y);
1062
- a = await C(y, b, g);
1057
+ }, x = m(r, v);
1058
+ a = await S(v, x, y);
1063
1059
  } else {
1064
- const g = t ?? n.length;
1060
+ const y = t ?? n.length;
1065
1061
  do {
1066
- const p = u === 0 ? o[0] ?? r.initialPageParam : Et(r, a);
1067
- if (u > 0 && p == null)
1062
+ const m = u === 0 ? o[0] ?? r.initialPageParam : St(r, a);
1063
+ if (u > 0 && m == null)
1068
1064
  break;
1069
- a = await C(a, p), u++;
1070
- } while (u < g);
1065
+ a = await S(a, m), u++;
1066
+ } while (u < y);
1071
1067
  }
1072
1068
  return a;
1073
1069
  };
1074
1070
  e.options.persister ? e.fetchFn = () => e.options.persister?.(
1075
- h,
1071
+ l,
1076
1072
  {
1077
1073
  client: e.client,
1078
1074
  queryKey: e.queryKey,
@@ -1080,11 +1076,11 @@ function ft(t) {
1080
1076
  signal: e.signal
1081
1077
  },
1082
1078
  s
1083
- ) : e.fetchFn = h;
1079
+ ) : e.fetchFn = l;
1084
1080
  }
1085
1081
  };
1086
1082
  }
1087
- function Et(t, { pages: e, pageParams: s }) {
1083
+ function St(t, { pages: e, pageParams: s }) {
1088
1084
  const r = e.length - 1;
1089
1085
  return e.length > 0 ? t.getNextPageParam(
1090
1086
  e[r],
@@ -1093,16 +1089,16 @@ function Et(t, { pages: e, pageParams: s }) {
1093
1089
  s
1094
1090
  ) : void 0;
1095
1091
  }
1096
- function ve(t, { pages: e, pageParams: s }) {
1092
+ function ue(t, { pages: e, pageParams: s }) {
1097
1093
  return e.length > 0 ? t.getPreviousPageParam?.(e[0], e, s[0], s) : void 0;
1098
1094
  }
1099
- function is(t, e) {
1100
- return e ? Et(t, e) != null : !1;
1095
+ function Be(t, e) {
1096
+ return e ? St(t, e) != null : !1;
1101
1097
  }
1102
- function ns(t, e) {
1103
- return !e || !t.getPreviousPageParam ? !1 : ve(t, e) != null;
1098
+ function He(t, e) {
1099
+ return !e || !t.getPreviousPageParam ? !1 : ue(t, e) != null;
1104
1100
  }
1105
- var as = class extends ye {
1101
+ var Ge = class extends ce {
1106
1102
  constructor(t, e) {
1107
1103
  super(t, e);
1108
1104
  }
@@ -1112,11 +1108,11 @@ var as = class extends ye {
1112
1108
  setOptions(t) {
1113
1109
  super.setOptions({
1114
1110
  ...t,
1115
- behavior: ft()
1111
+ behavior: lt()
1116
1112
  });
1117
1113
  }
1118
1114
  getOptimisticResult(t) {
1119
- return t.behavior = ft(), super.getOptimisticResult(t);
1115
+ return t.behavior = lt(), super.getOptimisticResult(t);
1120
1116
  }
1121
1117
  fetchNextPage(t) {
1122
1118
  return this.fetch({
@@ -1135,28 +1131,28 @@ var as = class extends ye {
1135
1131
  });
1136
1132
  }
1137
1133
  createResult(t, e) {
1138
- const { state: s } = t, r = super.createResult(t, e), { isFetching: i, isRefetching: n, isError: o, isRefetchError: a } = r, u = s.fetchMeta?.fetchMore?.direction, h = o && u === "forward", c = i && u === "forward", f = o && u === "backward", d = i && u === "backward";
1134
+ const { state: s } = t, r = super.createResult(t, e), { isFetching: i, isRefetching: n, isError: o, isRefetchError: a } = r, u = s.fetchMeta?.fetchMore?.direction, l = o && u === "forward", c = i && u === "forward", p = o && u === "backward", d = i && u === "backward";
1139
1135
  return {
1140
1136
  ...r,
1141
1137
  fetchNextPage: this.fetchNextPage,
1142
1138
  fetchPreviousPage: this.fetchPreviousPage,
1143
- hasNextPage: is(e, s.data),
1144
- hasPreviousPage: ns(e, s.data),
1145
- isFetchNextPageError: h,
1139
+ hasNextPage: Be(e, s.data),
1140
+ hasPreviousPage: He(e, s.data),
1141
+ isFetchNextPageError: l,
1146
1142
  isFetchingNextPage: c,
1147
- isFetchPreviousPageError: f,
1143
+ isFetchPreviousPageError: p,
1148
1144
  isFetchingPreviousPage: d,
1149
- isRefetchError: a && !h && !f,
1145
+ isRefetchError: a && !l && !p,
1150
1146
  isRefetching: n && !c && !d
1151
1147
  };
1152
1148
  }
1153
- }, os = class extends me {
1149
+ }, We = class extends ae {
1154
1150
  #t;
1155
1151
  #e;
1156
1152
  #s;
1157
1153
  #i;
1158
1154
  constructor(t) {
1159
- super(), this.#t = t.client, this.mutationId = t.mutationId, this.#s = t.mutationCache, this.#e = [], this.state = t.state || be(), this.setOptions(t.options), this.scheduleGc();
1155
+ super(), this.#t = t.client, this.mutationId = t.mutationId, this.#s = t.mutationCache, this.#e = [], this.state = t.state || he(), this.setOptions(t.options), this.scheduleGc();
1160
1156
  }
1161
1157
  setOptions(t) {
1162
1158
  this.options = t, this.updateGcTime(this.options.gcTime);
@@ -1193,7 +1189,7 @@ var as = class extends ye {
1193
1189
  meta: this.options.meta,
1194
1190
  mutationKey: this.options.mutationKey
1195
1191
  };
1196
- this.#i = pe({
1192
+ this.#i = ne({
1197
1193
  fn: () => this.options.mutationFn ? this.options.mutationFn(t, s) : Promise.reject(new Error("No mutationFn found")),
1198
1194
  onFail: (n, o) => {
1199
1195
  this.#r({ type: "failed", failureCount: n, error: o });
@@ -1342,7 +1338,7 @@ var as = class extends ye {
1342
1338
  };
1343
1339
  }
1344
1340
  };
1345
- this.state = e(this.state), A.batch(() => {
1341
+ this.state = e(this.state), F.batch(() => {
1346
1342
  this.#e.forEach((s) => {
1347
1343
  s.onMutationUpdate(t);
1348
1344
  }), this.#s.notify({
@@ -1353,7 +1349,7 @@ var as = class extends ye {
1353
1349
  });
1354
1350
  }
1355
1351
  };
1356
- function be() {
1352
+ function he() {
1357
1353
  return {
1358
1354
  context: void 0,
1359
1355
  data: void 0,
@@ -1366,7 +1362,7 @@ function be() {
1366
1362
  submittedAt: 0
1367
1363
  };
1368
1364
  }
1369
- var cs = class extends et {
1365
+ var Ve = class extends Z {
1370
1366
  constructor(t = {}) {
1371
1367
  super(), this.config = t, this.#t = /* @__PURE__ */ new Set(), this.#e = /* @__PURE__ */ new Map(), this.#s = 0;
1372
1368
  }
@@ -1374,7 +1370,7 @@ var cs = class extends et {
1374
1370
  #e;
1375
1371
  #s;
1376
1372
  build(t, e, s) {
1377
- const r = new os({
1373
+ const r = new We({
1378
1374
  client: t,
1379
1375
  mutationCache: this,
1380
1376
  mutationId: ++this.#s,
@@ -1385,7 +1381,7 @@ var cs = class extends et {
1385
1381
  }
1386
1382
  add(t) {
1387
1383
  this.#t.add(t);
1388
- const e = ut(t);
1384
+ const e = ot(t);
1389
1385
  if (typeof e == "string") {
1390
1386
  const s = this.#e.get(e);
1391
1387
  s ? s.push(t) : this.#e.set(e, [t]);
@@ -1394,7 +1390,7 @@ var cs = class extends et {
1394
1390
  }
1395
1391
  remove(t) {
1396
1392
  if (this.#t.delete(t)) {
1397
- const e = ut(t);
1393
+ const e = ot(t);
1398
1394
  if (typeof e == "string") {
1399
1395
  const s = this.#e.get(e);
1400
1396
  if (s)
@@ -1407,7 +1403,7 @@ var cs = class extends et {
1407
1403
  this.notify({ type: "removed", mutation: t });
1408
1404
  }
1409
1405
  canRun(t) {
1410
- const e = ut(t);
1406
+ const e = ot(t);
1411
1407
  if (typeof e == "string") {
1412
1408
  const r = this.#e.get(e)?.find(
1413
1409
  (i) => i.state.status === "pending"
@@ -1417,11 +1413,11 @@ var cs = class extends et {
1417
1413
  return !0;
1418
1414
  }
1419
1415
  runNext(t) {
1420
- const e = ut(t);
1416
+ const e = ot(t);
1421
1417
  return typeof e == "string" ? this.#e.get(e)?.find((r) => r !== t && r.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
1422
1418
  }
1423
1419
  clear() {
1424
- A.batch(() => {
1420
+ F.batch(() => {
1425
1421
  this.#t.forEach((t) => {
1426
1422
  this.notify({ type: "removed", mutation: t });
1427
1423
  }), this.#t.clear(), this.#e.clear();
@@ -1433,14 +1429,14 @@ var cs = class extends et {
1433
1429
  find(t) {
1434
1430
  const e = { exact: !0, ...t };
1435
1431
  return this.getAll().find(
1436
- (s) => Bt(e, s)
1432
+ (s) => Qt(e, s)
1437
1433
  );
1438
1434
  }
1439
1435
  findAll(t = {}) {
1440
- return this.getAll().filter((e) => Bt(t, e));
1436
+ return this.getAll().filter((e) => Qt(t, e));
1441
1437
  }
1442
1438
  notify(t) {
1443
- A.batch(() => {
1439
+ F.batch(() => {
1444
1440
  this.listeners.forEach((e) => {
1445
1441
  e(t);
1446
1442
  });
@@ -1448,17 +1444,17 @@ var cs = class extends et {
1448
1444
  }
1449
1445
  resumePausedMutations() {
1450
1446
  const t = this.getAll().filter((e) => e.state.isPaused);
1451
- return A.batch(
1447
+ return F.batch(
1452
1448
  () => Promise.all(
1453
- t.map((e) => e.continue().catch(U))
1449
+ t.map((e) => e.continue().catch(L))
1454
1450
  )
1455
1451
  );
1456
1452
  }
1457
1453
  };
1458
- function ut(t) {
1454
+ function ot(t) {
1459
1455
  return t.options.scope?.id;
1460
1456
  }
1461
- var us = class extends et {
1457
+ var Ye = class extends Z {
1462
1458
  #t;
1463
1459
  #e = void 0;
1464
1460
  #s;
@@ -1471,11 +1467,11 @@ var us = class extends et {
1471
1467
  }
1472
1468
  setOptions(e) {
1473
1469
  const s = this.options;
1474
- this.options = this.#t.defaultMutationOptions(e), lt(this.options, s) || this.#t.getMutationCache().notify({
1470
+ this.options = this.#t.defaultMutationOptions(e), ut(this.options, s) || this.#t.getMutationCache().notify({
1475
1471
  type: "observerOptionsUpdated",
1476
1472
  mutation: this.#s,
1477
1473
  observer: this
1478
- }), s?.mutationKey && this.options.mutationKey && J(s.mutationKey) !== J(this.options.mutationKey) ? this.reset() : this.#s?.state.status === "pending" && this.#s.setOptions(this.options);
1474
+ }), s?.mutationKey && this.options.mutationKey && Y(s.mutationKey) !== Y(this.options.mutationKey) ? this.reset() : this.#s?.state.status === "pending" && this.#s.setOptions(this.options);
1479
1475
  }
1480
1476
  onUnsubscribe() {
1481
1477
  this.hasListeners() || this.#s?.removeObserver(this);
@@ -1493,7 +1489,7 @@ var us = class extends et {
1493
1489
  return this.#i = s, this.#s?.removeObserver(this), this.#s = this.#t.getMutationCache().build(this.#t, this.options), this.#s.addObserver(this), this.#s.execute(e);
1494
1490
  }
1495
1491
  #r() {
1496
- const e = this.#s?.state ?? be();
1492
+ const e = this.#s?.state ?? he();
1497
1493
  this.#e = {
1498
1494
  ...e,
1499
1495
  isPending: e.status === "pending",
@@ -1505,7 +1501,7 @@ var us = class extends et {
1505
1501
  };
1506
1502
  }
1507
1503
  #a(e) {
1508
- A.batch(() => {
1504
+ F.batch(() => {
1509
1505
  if (this.#i && this.hasListeners()) {
1510
1506
  const s = this.#e.variables, r = this.#e.context, i = {
1511
1507
  client: this.#t,
@@ -1541,15 +1537,15 @@ var us = class extends et {
1541
1537
  });
1542
1538
  });
1543
1539
  }
1544
- }, hs = class extends et {
1540
+ }, Xe = class extends Z {
1545
1541
  constructor(t = {}) {
1546
1542
  super(), this.config = t, this.#t = /* @__PURE__ */ new Map();
1547
1543
  }
1548
1544
  #t;
1549
1545
  build(t, e, s) {
1550
- const r = e.queryKey, i = e.queryHash ?? At(r, e);
1546
+ const r = e.queryKey, i = e.queryHash ?? Et(r, e);
1551
1547
  let n = this.get(i);
1552
- return n || (n = new es({
1548
+ return n || (n = new _e({
1553
1549
  client: t,
1554
1550
  queryKey: r,
1555
1551
  queryHash: i,
@@ -1569,7 +1565,7 @@ var us = class extends et {
1569
1565
  e && (t.destroy(), e === t && this.#t.delete(t.queryHash), this.notify({ type: "removed", query: t }));
1570
1566
  }
1571
1567
  clear() {
1572
- A.batch(() => {
1568
+ F.batch(() => {
1573
1569
  this.getAll().forEach((t) => {
1574
1570
  this.remove(t);
1575
1571
  });
@@ -1584,35 +1580,35 @@ var us = class extends et {
1584
1580
  find(t) {
1585
1581
  const e = { exact: !0, ...t };
1586
1582
  return this.getAll().find(
1587
- (s) => zt(e, s)
1583
+ (s) => Dt(e, s)
1588
1584
  );
1589
1585
  }
1590
1586
  findAll(t = {}) {
1591
1587
  const e = this.getAll();
1592
- return Object.keys(t).length > 0 ? e.filter((s) => zt(t, s)) : e;
1588
+ return Object.keys(t).length > 0 ? e.filter((s) => Dt(t, s)) : e;
1593
1589
  }
1594
1590
  notify(t) {
1595
- A.batch(() => {
1591
+ F.batch(() => {
1596
1592
  this.listeners.forEach((e) => {
1597
1593
  e(t);
1598
1594
  });
1599
1595
  });
1600
1596
  }
1601
1597
  onFocus() {
1602
- A.batch(() => {
1598
+ F.batch(() => {
1603
1599
  this.getAll().forEach((t) => {
1604
1600
  t.onFocus();
1605
1601
  });
1606
1602
  });
1607
1603
  }
1608
1604
  onOnline() {
1609
- A.batch(() => {
1605
+ F.batch(() => {
1610
1606
  this.getAll().forEach((t) => {
1611
1607
  t.onOnline();
1612
1608
  });
1613
1609
  });
1614
1610
  }
1615
- }, ls = class {
1611
+ }, Je = class {
1616
1612
  #t;
1617
1613
  #e;
1618
1614
  #s;
@@ -1622,12 +1618,12 @@ var us = class extends et {
1622
1618
  #o;
1623
1619
  #n;
1624
1620
  constructor(t = {}) {
1625
- this.#t = t.queryCache || new hs(), this.#e = t.mutationCache || new cs(), this.#s = t.defaultOptions || {}, this.#i = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#a = 0;
1621
+ this.#t = t.queryCache || new Xe(), this.#e = t.mutationCache || new Ve(), this.#s = t.defaultOptions || {}, this.#i = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#a = 0;
1626
1622
  }
1627
1623
  mount() {
1628
- this.#a++, this.#a === 1 && (this.#o = Qt.subscribe(async (t) => {
1624
+ this.#a++, this.#a === 1 && (this.#o = Mt.subscribe(async (t) => {
1629
1625
  t && (await this.resumePausedMutations(), this.#t.onFocus());
1630
- }), this.#n = dt.subscribe(async (t) => {
1626
+ }), this.#n = ht.subscribe(async (t) => {
1631
1627
  t && (await this.resumePausedMutations(), this.#t.onOnline());
1632
1628
  }));
1633
1629
  }
@@ -1653,7 +1649,7 @@ var us = class extends et {
1653
1649
  }
1654
1650
  ensureQueryData(t) {
1655
1651
  const e = this.defaultQueryOptions(t), s = this.#t.build(this, e), r = s.state.data;
1656
- return r === void 0 ? this.fetchQuery(t) : (t.revalidateIfStale && s.isStaleByTime(W(e.staleTime, s)) && this.prefetchQuery(e), Promise.resolve(r));
1652
+ return r === void 0 ? this.fetchQuery(t) : (t.revalidateIfStale && s.isStaleByTime(H(e.staleTime, s)) && this.prefetchQuery(e), Promise.resolve(r));
1657
1653
  }
1658
1654
  getQueriesData(t) {
1659
1655
  return this.#t.findAll(t).map(({ queryKey: e, state: s }) => {
@@ -1664,12 +1660,12 @@ var us = class extends et {
1664
1660
  setQueryData(t, e, s) {
1665
1661
  const r = this.defaultQueryOptions({ queryKey: t }), n = this.#t.get(
1666
1662
  r.queryHash
1667
- )?.state.data, o = Be(e, n);
1663
+ )?.state.data, o = Ie(e, n);
1668
1664
  if (o !== void 0)
1669
1665
  return this.#t.build(this, r).setData(o, { ...s, manual: !0 });
1670
1666
  }
1671
1667
  setQueriesData(t, e, s) {
1672
- return A.batch(
1668
+ return F.batch(
1673
1669
  () => this.#t.findAll(t).map(({ queryKey: r }) => [
1674
1670
  r,
1675
1671
  this.setQueryData(r, e, s)
@@ -1684,7 +1680,7 @@ var us = class extends et {
1684
1680
  }
1685
1681
  removeQueries(t) {
1686
1682
  const e = this.#t;
1687
- A.batch(() => {
1683
+ F.batch(() => {
1688
1684
  e.findAll(t).forEach((s) => {
1689
1685
  e.remove(s);
1690
1686
  });
@@ -1692,7 +1688,7 @@ var us = class extends et {
1692
1688
  }
1693
1689
  resetQueries(t, e) {
1694
1690
  const s = this.#t;
1695
- return A.batch(() => (s.findAll(t).forEach((r) => {
1691
+ return F.batch(() => (s.findAll(t).forEach((r) => {
1696
1692
  r.reset();
1697
1693
  }), this.refetchQueries(
1698
1694
  {
@@ -1703,13 +1699,13 @@ var us = class extends et {
1703
1699
  )));
1704
1700
  }
1705
1701
  cancelQueries(t, e = {}) {
1706
- const s = { revert: !0, ...e }, r = A.batch(
1702
+ const s = { revert: !0, ...e }, r = F.batch(
1707
1703
  () => this.#t.findAll(t).map((i) => i.cancel(s))
1708
1704
  );
1709
- return Promise.all(r).then(U).catch(U);
1705
+ return Promise.all(r).then(L).catch(L);
1710
1706
  }
1711
1707
  invalidateQueries(t, e = {}) {
1712
- return A.batch(() => (this.#t.findAll(t).forEach((s) => {
1708
+ return F.batch(() => (this.#t.findAll(t).forEach((s) => {
1713
1709
  s.invalidate();
1714
1710
  }), t?.refetchType === "none" ? Promise.resolve() : this.refetchQueries(
1715
1711
  {
@@ -1723,36 +1719,36 @@ var us = class extends et {
1723
1719
  const s = {
1724
1720
  ...e,
1725
1721
  cancelRefetch: e.cancelRefetch ?? !0
1726
- }, r = A.batch(
1722
+ }, r = F.batch(
1727
1723
  () => this.#t.findAll(t).filter((i) => !i.isDisabled() && !i.isStatic()).map((i) => {
1728
1724
  let n = i.fetch(void 0, s);
1729
- return s.throwOnError || (n = n.catch(U)), i.state.fetchStatus === "paused" ? Promise.resolve() : n;
1725
+ return s.throwOnError || (n = n.catch(L)), i.state.fetchStatus === "paused" ? Promise.resolve() : n;
1730
1726
  })
1731
1727
  );
1732
- return Promise.all(r).then(U);
1728
+ return Promise.all(r).then(L);
1733
1729
  }
1734
1730
  fetchQuery(t) {
1735
1731
  const e = this.defaultQueryOptions(t);
1736
1732
  e.retry === void 0 && (e.retry = !1);
1737
1733
  const s = this.#t.build(this, e);
1738
1734
  return s.isStaleByTime(
1739
- W(e.staleTime, s)
1735
+ H(e.staleTime, s)
1740
1736
  ) ? s.fetch(e) : Promise.resolve(s.state.data);
1741
1737
  }
1742
1738
  prefetchQuery(t) {
1743
- return this.fetchQuery(t).then(U).catch(U);
1739
+ return this.fetchQuery(t).then(L).catch(L);
1744
1740
  }
1745
1741
  fetchInfiniteQuery(t) {
1746
- return t.behavior = ft(t.pages), this.fetchQuery(t);
1742
+ return t.behavior = lt(t.pages), this.fetchQuery(t);
1747
1743
  }
1748
1744
  prefetchInfiniteQuery(t) {
1749
- return this.fetchInfiniteQuery(t).then(U).catch(U);
1745
+ return this.fetchInfiniteQuery(t).then(L).catch(L);
1750
1746
  }
1751
1747
  ensureInfiniteQueryData(t) {
1752
- return t.behavior = ft(t.pages), this.ensureQueryData(t);
1748
+ return t.behavior = lt(t.pages), this.ensureQueryData(t);
1753
1749
  }
1754
1750
  resumePausedMutations() {
1755
- return dt.isOnline() ? this.#e.resumePausedMutations() : Promise.resolve();
1751
+ return ht.isOnline() ? this.#e.resumePausedMutations() : Promise.resolve();
1756
1752
  }
1757
1753
  getQueryCache() {
1758
1754
  return this.#t;
@@ -1767,7 +1763,7 @@ var us = class extends et {
1767
1763
  this.#s = t;
1768
1764
  }
1769
1765
  setQueryDefaults(t, e) {
1770
- this.#i.set(J(t), {
1766
+ this.#i.set(Y(t), {
1771
1767
  queryKey: t,
1772
1768
  defaultOptions: e
1773
1769
  });
@@ -1775,11 +1771,11 @@ var us = class extends et {
1775
1771
  getQueryDefaults(t) {
1776
1772
  const e = [...this.#i.values()], s = {};
1777
1773
  return e.forEach((r) => {
1778
- it(t, r.queryKey) && Object.assign(s, r.defaultOptions);
1774
+ st(t, r.queryKey) && Object.assign(s, r.defaultOptions);
1779
1775
  }), s;
1780
1776
  }
1781
1777
  setMutationDefaults(t, e) {
1782
- this.#r.set(J(t), {
1778
+ this.#r.set(Y(t), {
1783
1779
  mutationKey: t,
1784
1780
  defaultOptions: e
1785
1781
  });
@@ -1787,7 +1783,7 @@ var us = class extends et {
1787
1783
  getMutationDefaults(t) {
1788
1784
  const e = [...this.#r.values()], s = {};
1789
1785
  return e.forEach((r) => {
1790
- it(t, r.mutationKey) && Object.assign(s, r.defaultOptions);
1786
+ st(t, r.mutationKey) && Object.assign(s, r.defaultOptions);
1791
1787
  }), s;
1792
1788
  }
1793
1789
  defaultQueryOptions(t) {
@@ -1799,10 +1795,10 @@ var us = class extends et {
1799
1795
  ...t,
1800
1796
  _defaulted: !0
1801
1797
  };
1802
- return e.queryHash || (e.queryHash = At(
1798
+ return e.queryHash || (e.queryHash = Et(
1803
1799
  e.queryKey,
1804
1800
  e
1805
- )), e.refetchOnReconnect === void 0 && (e.refetchOnReconnect = e.networkMode !== "always"), e.throwOnError === void 0 && (e.throwOnError = !!e.suspense), !e.networkMode && e.persister && (e.networkMode = "offlineFirst"), e.queryFn === Dt && (e.enabled = !1), e;
1801
+ )), e.refetchOnReconnect === void 0 && (e.refetchOnReconnect = e.networkMode !== "always"), e.throwOnError === void 0 && (e.throwOnError = !!e.suspense), !e.networkMode && e.persister && (e.networkMode = "offlineFirst"), e.queryFn === Pt && (e.enabled = !1), e;
1806
1802
  }
1807
1803
  defaultMutationOptions(t) {
1808
1804
  return t?._defaulted ? t : {
@@ -1815,21 +1811,21 @@ var us = class extends et {
1815
1811
  clear() {
1816
1812
  this.#t.clear(), this.#e.clear();
1817
1813
  }
1818
- }, xe = $.createContext(
1814
+ }, le = f.createContext(
1819
1815
  void 0
1820
- ), Lt = (t) => {
1821
- const e = $.useContext(xe);
1816
+ ), Nt = (t) => {
1817
+ const e = f.useContext(le);
1822
1818
  if (!e)
1823
1819
  throw new Error("No QueryClient set, use QueryClientProvider to set one");
1824
1820
  return e;
1825
- }, ds = ({
1821
+ }, Ze = ({
1826
1822
  client: t,
1827
1823
  children: e
1828
- }) => ($.useEffect(() => (t.mount(), () => {
1824
+ }) => (f.useEffect(() => (t.mount(), () => {
1829
1825
  t.unmount();
1830
- }), [t]), /* @__PURE__ */ l(xe.Provider, { value: t, children: e })), we = $.createContext(!1), fs = () => $.useContext(we);
1831
- we.Provider;
1832
- function ps() {
1826
+ }), [t]), /* @__PURE__ */ h.jsx(le.Provider, { value: t, children: e })), de = f.createContext(!1), ts = () => f.useContext(de);
1827
+ de.Provider;
1828
+ function es() {
1833
1829
  let t = !1;
1834
1830
  return {
1835
1831
  clearReset: () => {
@@ -1841,19 +1837,19 @@ function ps() {
1841
1837
  isReset: () => t
1842
1838
  };
1843
1839
  }
1844
- var ms = $.createContext(ps()), gs = () => $.useContext(ms), ys = (t, e) => {
1840
+ var ss = f.createContext(es()), rs = () => f.useContext(ss), is = (t, e) => {
1845
1841
  (t.suspense || t.throwOnError || t.experimental_prefetchInRender) && (e.isReset() || (t.retryOnMount = !1));
1846
- }, vs = (t) => {
1847
- $.useEffect(() => {
1842
+ }, ns = (t) => {
1843
+ f.useEffect(() => {
1848
1844
  t.clearReset();
1849
1845
  }, [t]);
1850
- }, bs = ({
1846
+ }, as = ({
1851
1847
  result: t,
1852
1848
  errorResetBoundary: e,
1853
1849
  throwOnError: s,
1854
1850
  query: r,
1855
1851
  suspense: i
1856
- }) => t.isError && !e.isReset() && !t.isFetching && r && (i && t.data === void 0 || de(s, [t.error, r])), xs = (t) => {
1852
+ }) => t.isError && !e.isReset() && !t.isFetching && r && (i && t.data === void 0 || re(s, [t.error, r])), os = (t) => {
1857
1853
  if (t.suspense) {
1858
1854
  const s = (i) => i === "static" ? i : Math.max(i ?? 1e3, 1e3), r = t.staleTime;
1859
1855
  t.staleTime = typeof r == "function" ? (...i) => s(r(...i)) : s(r), typeof t.gcTime == "number" && (t.gcTime = Math.max(
@@ -1861,103 +1857,103 @@ var ms = $.createContext(ps()), gs = () => $.useContext(ms), ys = (t, e) => {
1861
1857
  1e3
1862
1858
  ));
1863
1859
  }
1864
- }, ws = (t, e) => t.isLoading && t.isFetching && !e, Cs = (t, e) => t?.suspense && e.isPending, Jt = (t, e, s) => e.fetchOptimistic(t).catch(() => {
1860
+ }, cs = (t, e) => t.isLoading && t.isFetching && !e, us = (t, e) => t?.suspense && e.isPending, zt = (t, e, s) => e.fetchOptimistic(t).catch(() => {
1865
1861
  s.clearReset();
1866
1862
  });
1867
- function Ce(t, e, s) {
1868
- const r = fs(), i = gs(), n = Lt(), o = n.defaultQueryOptions(t);
1863
+ function fe(t, e, s) {
1864
+ const r = ts(), i = rs(), n = Nt(), o = n.defaultQueryOptions(t);
1869
1865
  n.getDefaultOptions().queries?._experimental_beforeQuery?.(
1870
1866
  o
1871
- ), o._optimisticResults = r ? "isRestoring" : "optimistic", xs(o), ys(o, i), vs(i);
1872
- const a = !n.getQueryCache().get(o.queryHash), [u] = $.useState(
1867
+ ), o._optimisticResults = r ? "isRestoring" : "optimistic", os(o), is(o, i), ns(i);
1868
+ const a = !n.getQueryCache().get(o.queryHash), [u] = f.useState(
1873
1869
  () => new e(
1874
1870
  n,
1875
1871
  o
1876
1872
  )
1877
- ), h = u.getOptimisticResult(o), c = !r && t.subscribed !== !1;
1878
- if ($.useSyncExternalStore(
1879
- $.useCallback(
1880
- (f) => {
1881
- const d = c ? u.subscribe(A.batchCalls(f)) : U;
1873
+ ), l = u.getOptimisticResult(o), c = !r && t.subscribed !== !1;
1874
+ if (f.useSyncExternalStore(
1875
+ f.useCallback(
1876
+ (p) => {
1877
+ const d = c ? u.subscribe(F.batchCalls(p)) : L;
1882
1878
  return u.updateResult(), d;
1883
1879
  },
1884
1880
  [u, c]
1885
1881
  ),
1886
1882
  () => u.getCurrentResult(),
1887
1883
  () => u.getCurrentResult()
1888
- ), $.useEffect(() => {
1884
+ ), f.useEffect(() => {
1889
1885
  u.setOptions(o);
1890
- }, [o, u]), Cs(o, h))
1891
- throw Jt(o, u, i);
1892
- if (bs({
1893
- result: h,
1886
+ }, [o, u]), us(o, l))
1887
+ throw zt(o, u, i);
1888
+ if (as({
1889
+ result: l,
1894
1890
  errorResetBoundary: i,
1895
1891
  throwOnError: o.throwOnError,
1896
1892
  query: n.getQueryCache().get(o.queryHash),
1897
1893
  suspense: o.suspense
1898
1894
  }))
1899
- throw h.error;
1895
+ throw l.error;
1900
1896
  return n.getDefaultOptions().queries?._experimental_afterQuery?.(
1901
1897
  o,
1902
- h
1903
- ), o.experimental_prefetchInRender && !X && ws(h, r) && (a ? (
1898
+ l
1899
+ ), o.experimental_prefetchInRender && !V && cs(l, r) && (a ? (
1904
1900
  // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
1905
- Jt(o, u, i)
1901
+ zt(o, u, i)
1906
1902
  ) : (
1907
1903
  // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
1908
1904
  n.getQueryCache().get(o.queryHash)?.promise
1909
- ))?.catch(U).finally(() => {
1905
+ ))?.catch(L).finally(() => {
1910
1906
  u.updateResult();
1911
- }), o.notifyOnChangeProps ? h : u.trackResult(h);
1907
+ }), o.notifyOnChangeProps ? l : u.trackResult(l);
1912
1908
  }
1913
- function Ss(t, e) {
1914
- return Ce(t, ye);
1909
+ function hs(t, e) {
1910
+ return fe(t, ce);
1915
1911
  }
1916
- function Os(t, e) {
1917
- const s = Lt(), [r] = $.useState(
1918
- () => new us(
1912
+ function ls(t, e) {
1913
+ const s = Nt(), [r] = f.useState(
1914
+ () => new Ye(
1919
1915
  s,
1920
1916
  t
1921
1917
  )
1922
1918
  );
1923
- $.useEffect(() => {
1919
+ f.useEffect(() => {
1924
1920
  r.setOptions(t);
1925
1921
  }, [r, t]);
1926
- const i = $.useSyncExternalStore(
1927
- $.useCallback(
1928
- (o) => r.subscribe(A.batchCalls(o)),
1922
+ const i = f.useSyncExternalStore(
1923
+ f.useCallback(
1924
+ (o) => r.subscribe(F.batchCalls(o)),
1929
1925
  [r]
1930
1926
  ),
1931
1927
  () => r.getCurrentResult(),
1932
1928
  () => r.getCurrentResult()
1933
- ), n = $.useCallback(
1929
+ ), n = f.useCallback(
1934
1930
  (o, a) => {
1935
- r.mutate(o, a).catch(U);
1931
+ r.mutate(o, a).catch(L);
1936
1932
  },
1937
1933
  [r]
1938
1934
  );
1939
- if (i.error && de(r.options.throwOnError, [i.error]))
1935
+ if (i.error && re(r.options.throwOnError, [i.error]))
1940
1936
  throw i.error;
1941
1937
  return { ...i, mutate: n, mutateAsync: i.mutate };
1942
1938
  }
1943
- function ks(t, e) {
1944
- return Ce(
1939
+ function ds(t, e) {
1940
+ return fe(
1945
1941
  t,
1946
- as
1942
+ Ge
1947
1943
  );
1948
1944
  }
1949
- const Ps = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Rs = (t) => t.replace(
1945
+ const fs = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ps = (t) => t.replace(
1950
1946
  /^([A-Z])|[\s-_]+(\w)/g,
1951
1947
  (e, s, r) => r ? r.toUpperCase() : s.toLowerCase()
1952
- ), Zt = (t) => {
1953
- const e = Rs(t);
1948
+ ), Bt = (t) => {
1949
+ const e = ps(t);
1954
1950
  return e.charAt(0).toUpperCase() + e.slice(1);
1955
- }, Se = (...t) => t.filter((e, s, r) => !!e && e.trim() !== "" && r.indexOf(e) === s).join(" ").trim(), Es = (t) => {
1951
+ }, pe = (...t) => t.filter((e, s, r) => !!e && e.trim() !== "" && r.indexOf(e) === s).join(" ").trim(), ms = (t) => {
1956
1952
  for (const e in t)
1957
1953
  if (e.startsWith("aria-") || e === "role" || e === "title")
1958
1954
  return !0;
1959
1955
  };
1960
- var Ms = {
1956
+ var gs = {
1961
1957
  xmlns: "http://www.w3.org/2000/svg",
1962
1958
  width: 24,
1963
1959
  height: 24,
@@ -1968,7 +1964,7 @@ var Ms = {
1968
1964
  strokeLinecap: "round",
1969
1965
  strokeLinejoin: "round"
1970
1966
  };
1971
- const Ns = It(
1967
+ const ys = f.forwardRef(
1972
1968
  ({
1973
1969
  color: t = "currentColor",
1974
1970
  size: e = 24,
@@ -1978,47 +1974,47 @@ const Ns = It(
1978
1974
  children: n,
1979
1975
  iconNode: o,
1980
1976
  ...a
1981
- }, u) => bt(
1977
+ }, u) => f.createElement(
1982
1978
  "svg",
1983
1979
  {
1984
1980
  ref: u,
1985
- ...Ms,
1981
+ ...gs,
1986
1982
  width: e,
1987
1983
  height: e,
1988
1984
  stroke: t,
1989
1985
  strokeWidth: r ? Number(s) * 24 / Number(e) : s,
1990
- className: Se("lucide", i),
1991
- ...!n && !Es(a) && { "aria-hidden": "true" },
1986
+ className: pe("lucide", i),
1987
+ ...!n && !ms(a) && { "aria-hidden": "true" },
1992
1988
  ...a
1993
1989
  },
1994
1990
  [
1995
- ...o.map(([h, c]) => bt(h, c)),
1991
+ ...o.map(([l, c]) => f.createElement(l, c)),
1996
1992
  ...Array.isArray(n) ? n : [n]
1997
1993
  ]
1998
1994
  )
1999
1995
  );
2000
- const at = (t, e) => {
2001
- const s = It(
2002
- ({ className: r, ...i }, n) => bt(Ns, {
1996
+ const it = (t, e) => {
1997
+ const s = f.forwardRef(
1998
+ ({ className: r, ...i }, n) => f.createElement(ys, {
2003
1999
  ref: n,
2004
2000
  iconNode: e,
2005
- className: Se(
2006
- `lucide-${Ps(Zt(t))}`,
2001
+ className: pe(
2002
+ `lucide-${fs(Bt(t))}`,
2007
2003
  `lucide-${t}`,
2008
2004
  r
2009
2005
  ),
2010
2006
  ...i
2011
2007
  })
2012
2008
  );
2013
- return s.displayName = Zt(t), s;
2009
+ return s.displayName = Bt(t), s;
2014
2010
  };
2015
- const Is = [
2011
+ const vs = [
2016
2012
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
2017
2013
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
2018
- ], Ts = at("arrow-up", Is);
2019
- const Fs = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], As = at("chevron-down", Fs);
2020
- const Ds = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], Mt = at("loader-circle", Ds);
2021
- const Qs = [
2014
+ ], bs = it("arrow-up", vs);
2015
+ const xs = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], ws = it("chevron-down", xs);
2016
+ const Cs = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], Ot = it("loader-circle", Cs);
2017
+ const Ss = [
2022
2018
  [
2023
2019
  "path",
2024
2020
  {
@@ -2029,193 +2025,193 @@ const Qs = [
2029
2025
  ["path", { d: "M7 11h10", key: "1twpyw" }],
2030
2026
  ["path", { d: "M7 15h6", key: "d9of3u" }],
2031
2027
  ["path", { d: "M7 7h8", key: "af5zfr" }]
2032
- ], te = at("message-square-text", Qs);
2033
- const $s = [
2028
+ ], Ht = it("message-square-text", Ss);
2029
+ const Os = [
2034
2030
  ["path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8", key: "1p45f6" }],
2035
2031
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }]
2036
- ], ee = at("rotate-cw", $s), nt = null, { min: Y, max: B, abs: se, floor: Ls } = Math, Oe = (t, e, s) => Y(s, B(e, t)), ke = (t) => [...t].sort(((e, s) => e - s)), Pe = typeof queueMicrotask == "function" ? queueMicrotask : (t) => {
2032
+ ], Gt = it("rotate-cw", Os), rt = null, { min: W, max: K, abs: Wt, floor: Rs } = Math, me = (t, e, s) => W(s, K(e, t)), ge = (t) => [...t].sort(((e, s) => e - s)), ye = typeof queueMicrotask == "function" ? queueMicrotask : (t) => {
2037
2033
  Promise.resolve().then(t);
2038
- }, Nt = () => {
2034
+ }, Rt = () => {
2039
2035
  let t;
2040
2036
  return [new Promise(((e) => {
2041
2037
  t = e;
2042
2038
  })), t];
2043
- }, Re = (t) => {
2039
+ }, ve = (t) => {
2044
2040
  let e;
2045
2041
  return () => (t && (e = t(), t = void 0), e);
2046
- }, rt = (t, e, s) => {
2042
+ }, et = (t, e, s) => {
2047
2043
  const r = s ? "unshift" : "push";
2048
2044
  for (let i = 0; i < e; i++) t[r](-1);
2049
2045
  return t;
2050
- }, Ee = (t, e) => {
2046
+ }, be = (t, e) => {
2051
2047
  const s = t.t[e];
2052
2048
  return s === -1 ? t.o : s;
2053
- }, qs = (t, e, s) => {
2049
+ }, ks = (t, e, s) => {
2054
2050
  const r = t.t[e] === -1;
2055
- return t.t[e] = s, t.i = Y(e, t.i), r;
2056
- }, ht = (t, e) => {
2051
+ return t.t[e] = s, t.i = W(e, t.i), r;
2052
+ }, ct = (t, e) => {
2057
2053
  if (!t.l) return 0;
2058
2054
  if (t.i >= e) return t.u[e];
2059
2055
  t.i < 0 && (t.u[0] = 0, t.i = 0);
2060
2056
  let s = t.i, r = t.u[s];
2061
- for (; s < e; ) r += Ee(t, s), t.u[++s] = r;
2057
+ for (; s < e; ) r += be(t, s), t.u[++s] = r;
2062
2058
  return t.i = e, r;
2063
- }, Z = (t, e, s = 0, r = t.l - 1) => {
2059
+ }, X = (t, e, s = 0, r = t.l - 1) => {
2064
2060
  let i = s;
2065
2061
  for (; s <= r; ) {
2066
- const n = Ls((s + r) / 2);
2067
- ht(t, n) <= e ? (i = n, s = n + 1) : r = n - 1;
2062
+ const n = Rs((s + r) / 2);
2063
+ ct(t, n) <= e ? (i = n, s = n + 1) : r = n - 1;
2068
2064
  }
2069
- return Oe(i, 0, t.l - 1);
2070
- }, re = (t, e, s) => {
2065
+ return me(i, 0, t.l - 1);
2066
+ }, Vt = (t, e, s) => {
2071
2067
  const r = e - t.l;
2072
- return t.i = s ? -1 : Y(e - 1, t.i), t.l = e, r > 0 ? (rt(t.u, r), rt(t.t, r, s), t.o * r) : (t.u.splice(r), (s ? t.t.splice(0, -r) : t.t.splice(r)).reduce(((i, n) => i - (n === -1 ? t.o : n)), 0));
2073
- }, Us = typeof window < "u", _s = (t) => t.documentElement, js = (t) => t.ownerDocument, Ks = (t) => t.defaultView, Me = /* @__PURE__ */ Re((() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 0)), zs = /* @__PURE__ */ Re((() => "scrollBehavior" in _s(document).style)), Bs = (t) => B(t.h(), t.p()), Hs = (t, e = 40, s = 0, r, i = !1) => {
2074
- let n = !!s, o = 1, a = 0, u = 0, h = 0, c = 0, f = 0, d = 0, C = 0, g = 0, p = nt, y = [0, n ? B(s - 1, 0) : -1], b = 0, R = !1;
2075
- const P = ((x, m, S) => ({ o: m, t: S ? rt(S.slice(0, Y(x, S.length)), B(0, x - S.length)) : rt([], x), l: x, i: -1, u: rt([], x + 1) }))(t, r ? r[1] : e, r && r[0]), D = /* @__PURE__ */ new Set(), L = () => h - u, O = () => L() + f + c, T = (x, m) => ((S, F, I, k) => {
2076
- if (k = Y(k, S.l - 1), ht(S, k) <= F) {
2077
- const v = Z(S, I, k);
2078
- return [Z(S, F, k, v), v];
2068
+ return t.i = s ? -1 : W(e - 1, t.i), t.l = e, r > 0 ? (et(t.u, r), et(t.t, r, s), t.o * r) : (t.u.splice(r), (s ? t.t.splice(0, -r) : t.t.splice(r)).reduce(((i, n) => i - (n === -1 ? t.o : n)), 0));
2069
+ }, Es = typeof window < "u", Ps = (t) => t.documentElement, Ms = (t) => t.ownerDocument, js = (t) => t.defaultView, xe = /* @__PURE__ */ ve((() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 0)), Ns = /* @__PURE__ */ ve((() => "scrollBehavior" in Ps(document).style)), Is = (t) => K(t.h(), t.p()), Ts = (t, e = 40, s = 0, r, i = !1) => {
2070
+ let n = !!s, o = 1, a = 0, u = 0, l = 0, c = 0, p = 0, d = 0, S = 0, y = 0, m = rt, v = [0, n ? K(s - 1, 0) : -1], x = 0, P = !1;
2071
+ const E = ((w, g, O) => ({ o: g, t: O ? et(O.slice(0, W(w, O.length)), K(0, w - O.length)) : et([], w), l: w, i: -1, u: et([], w + 1) }))(t, r ? r[1] : e, r && r[0]), A = /* @__PURE__ */ new Set(), Q = () => l - u, R = () => Q() + p + c, I = (w, g) => ((O, T, N, k) => {
2072
+ if (k = W(k, O.l - 1), ct(O, k) <= T) {
2073
+ const b = X(O, N, k);
2074
+ return [X(O, T, k, b), b];
2079
2075
  }
2080
2076
  {
2081
- const v = Z(S, F, void 0, k);
2082
- return [v, Z(S, I, v)];
2077
+ const b = X(O, T, void 0, k);
2078
+ return [b, X(O, N, b)];
2083
2079
  }
2084
- })(P, x, m, y[0]), E = () => ht(P, P.l), N = (x, m) => {
2085
- const S = ht(P, x) - f;
2086
- return m ? E() - S - q(x) : S;
2087
- }, q = (x) => Ee(P, x), K = (x, m = -1) => P.t[x] === m, G = (x) => {
2088
- x && (Me() && C !== 0 || p && g === 1 ? f += x : c += x);
2080
+ })(E, w, g, v[0]), M = () => ct(E, E.l), j = (w, g) => {
2081
+ const O = ct(E, w) - p;
2082
+ return g ? M() - O - $(w) : O;
2083
+ }, $ = (w) => be(E, w), U = (w, g = -1) => E.t[w] === g, B = (w) => {
2084
+ w && (xe() && S !== 0 || m && y === 1 ? p += w : c += w);
2089
2085
  };
2090
2086
  return { v: () => {
2091
- D.clear();
2092
- }, m: () => o, _: () => ((x) => [x.t.slice(), x.o])(P), S: (x = 200) => {
2093
- if (!R || n) return y;
2094
- let m, S;
2095
- if (d) [m, S] = y;
2087
+ A.clear();
2088
+ }, m: () => o, _: () => ((w) => [w.t.slice(), w.o])(E), S: (w = 200) => {
2089
+ if (!P || n) return v;
2090
+ let g, O;
2091
+ if (d) [g, O] = v;
2096
2092
  else {
2097
- let F = B(0, O()), I = F + a;
2098
- i || (x = B(0, x), C !== 1 && (F -= x), C !== 2 && (I += x)), [m, S] = y = T(B(0, F), B(0, I)), p && (m = Y(m, p[0]), S = B(S, p[1]));
2093
+ let T = K(0, R()), N = T + a;
2094
+ i || (w = K(0, w), S !== 1 && (T -= w), S !== 2 && (N += w)), [g, O] = v = I(K(0, T), K(0, N)), m && (g = W(g, m[0]), O = K(O, m[1]));
2099
2095
  }
2100
- return [B(m, 0), Y(S, P.l - 1)];
2101
- }, $: (x) => Z(P, x - u), I: K, k: N, R: q, T: () => P.l, C: () => h, M: () => C !== 0, p: () => a, O: () => u, h: E, H: () => (d = c, c = 0, [d, g === 2]), W: (x, m) => {
2102
- const S = [x, m];
2103
- return D.add(S), () => {
2104
- D.delete(S);
2096
+ return [K(g, 0), W(O, E.l - 1)];
2097
+ }, $: (w) => X(E, w - u), I: U, k: j, R: $, T: () => E.l, C: () => l, M: () => S !== 0, p: () => a, O: () => u, h: M, H: () => (d = c, c = 0, [d, y === 2]), W: (w, g) => {
2098
+ const O = [w, g];
2099
+ return A.add(O), () => {
2100
+ A.delete(O);
2105
2101
  };
2106
- }, B: (x, m) => {
2107
- let S, F, I = 0;
2108
- switch (x) {
2102
+ }, B: (w, g) => {
2103
+ let O, T, N = 0;
2104
+ switch (w) {
2109
2105
  case 1: {
2110
- if (m === h && g === 0) break;
2106
+ if (g === l && y === 0) break;
2111
2107
  const k = d;
2112
2108
  d = 0;
2113
- const v = m - h, Q = se(v);
2114
- k && Q < se(k) + 1 || g !== 0 || (C = v < 0 ? 2 : 1), n && (n = !1), h = m, I = 4;
2115
- const H = L();
2116
- H >= -a && H <= E() && (I += 1, F = Q > a);
2109
+ const b = g - l, D = Wt(b);
2110
+ k && D < Wt(k) + 1 || y !== 0 || (S = b < 0 ? 2 : 1), n && (n = !1), l = g, N = 4;
2111
+ const z = Q();
2112
+ z >= -a && z <= M() && (N += 1, T = D > a);
2117
2113
  break;
2118
2114
  }
2119
2115
  case 2:
2120
- I = 8, C !== 0 && (S = !0, I += 1), C = 0, g = 0, p = nt;
2116
+ N = 8, S !== 0 && (O = !0, N += 1), S = 0, y = 0, m = rt;
2121
2117
  break;
2122
2118
  case 3: {
2123
- const k = m.filter((([v, Q]) => !K(v, Q)));
2119
+ const k = g.filter((([b, D]) => !U(b, D)));
2124
2120
  if (!k.length) break;
2125
- G(k.reduce(((v, [Q, H]) => ((g === 2 || (p && g === 1 ? Q < p[0] : N(Q + (C === 0 && g === 0 ? 1 : 0)) < L())) && (v += H - q(Q)), v)), 0));
2126
- for (const [v, Q] of k) {
2127
- const H = q(v), ot = qs(P, v, Q);
2128
- i && (b += ot ? Q : Q - H);
2121
+ B(k.reduce(((b, [D, z]) => ((y === 2 || (m && y === 1 ? D < m[0] : j(D + (S === 0 && y === 0 ? 1 : 0)) < Q())) && (b += z - $(D)), b)), 0));
2122
+ for (const [b, D] of k) {
2123
+ const z = $(b), nt = ks(E, b, D);
2124
+ i && (x += nt ? D : D - z);
2129
2125
  }
2130
- i && a && b > a && (G(((v, Q) => {
2131
- let H = 0;
2132
- const ot = [];
2133
- v.t.forEach(((jt, De) => {
2134
- jt !== -1 && (ot.push(jt), De < Q && H++);
2135
- })), v.i = -1;
2136
- const ct = ke(ot), _t = ct.length, mt = _t / 2 | 0, Fe = _t % 2 == 0 ? (ct[mt - 1] + ct[mt]) / 2 : ct[mt], Ae = v.o;
2137
- return ((v.o = Fe) - Ae) * B(Q - H, 0);
2138
- })(P, Z(P, O()))), i = !1), I = 3, F = !0;
2126
+ i && a && x > a && (B(((b, D) => {
2127
+ let z = 0;
2128
+ const nt = [];
2129
+ b.t.forEach(((At, ke) => {
2130
+ At !== -1 && (nt.push(At), ke < D && z++);
2131
+ })), b.i = -1;
2132
+ const at = ge(nt), Ft = at.length, ft = Ft / 2 | 0, Oe = Ft % 2 == 0 ? (at[ft - 1] + at[ft]) / 2 : at[ft], Re = b.o;
2133
+ return ((b.o = Oe) - Re) * K(D - z, 0);
2134
+ })(E, X(E, R()))), i = !1), N = 3, T = !0;
2139
2135
  break;
2140
2136
  }
2141
2137
  case 4:
2142
- a !== m && (a || (R = F = !0), a = m, I = 3);
2138
+ a !== g && (a || (P = T = !0), a = g, N = 3);
2143
2139
  break;
2144
2140
  case 5:
2145
- m[1] ? (G(re(P, m[0], !0)), g = 2, I = 1) : (re(P, m[0]), I = 1);
2141
+ g[1] ? (B(Vt(E, g[0], !0)), y = 2, N = 1) : (Vt(E, g[0]), N = 1);
2146
2142
  break;
2147
2143
  case 6:
2148
- u = m;
2144
+ u = g;
2149
2145
  break;
2150
2146
  case 7:
2151
- g = 1;
2147
+ y = 1;
2152
2148
  break;
2153
2149
  case 8:
2154
- p = T(m, m + a), I = 1;
2150
+ m = I(g, g + a), N = 1;
2155
2151
  }
2156
- I && (o = 1 + (2147483647 & o), S && f && (c += f, f = 0), D.forEach((([k, v]) => {
2157
- I & k && v(F);
2152
+ N && (o = 1 + (2147483647 & o), O && p && (c += p, p = 0), A.forEach((([k, b]) => {
2153
+ N & k && b(T);
2158
2154
  })));
2159
2155
  } };
2160
- }, qt = setTimeout, yt = (t, e) => e ? -t : t, Gs = (t, e, s, r, i, n) => {
2156
+ }, It = setTimeout, mt = (t, e) => e ? -t : t, Fs = (t, e, s, r, i, n) => {
2161
2157
  const o = Date.now;
2162
- let a = 0, u = !1, h = !1, c = !1, f = !1;
2158
+ let a = 0, u = !1, l = !1, c = !1, p = !1;
2163
2159
  const d = (() => {
2164
- let b;
2165
- const R = () => {
2166
- b != nt && clearTimeout(b);
2167
- }, P = () => {
2168
- R(), b = qt((() => {
2169
- b = nt, (() => {
2170
- if (u || h) return u = !1, void d();
2160
+ let x;
2161
+ const P = () => {
2162
+ x != rt && clearTimeout(x);
2163
+ }, E = () => {
2164
+ P(), x = It((() => {
2165
+ x = rt, (() => {
2166
+ if (u || l) return u = !1, void d();
2171
2167
  c = !1, t.B(2);
2172
2168
  })();
2173
2169
  }), 150);
2174
2170
  };
2175
- return P.J = R, P;
2176
- })(), C = () => {
2177
- a = o(), c && (f = !0), t.B(1, r()), d();
2178
- }, g = (b) => {
2179
- if (u || !t.M() || b.ctrlKey) return;
2180
- const R = o() - a;
2181
- 150 > R && 50 < R && (s ? b.deltaX : b.deltaY) && (u = !0);
2182
- }, p = () => {
2183
- h = !0, c = f = !1;
2184
- }, y = () => {
2185
- h = !1, Me() && (c = !0);
2171
+ return E.J = P, E;
2172
+ })(), S = () => {
2173
+ a = o(), c && (p = !0), t.B(1, r()), d();
2174
+ }, y = (x) => {
2175
+ if (u || !t.M() || x.ctrlKey) return;
2176
+ const P = o() - a;
2177
+ 150 > P && 50 < P && (s ? x.deltaX : x.deltaY) && (u = !0);
2178
+ }, m = () => {
2179
+ l = !0, c = p = !1;
2180
+ }, v = () => {
2181
+ l = !1, xe() && (c = !0);
2186
2182
  };
2187
- return e.addEventListener("scroll", C), e.addEventListener("wheel", g, { passive: !0 }), e.addEventListener("touchstart", p, { passive: !0 }), e.addEventListener("touchend", y, { passive: !0 }), { A: () => {
2188
- e.removeEventListener("scroll", C), e.removeEventListener("wheel", g), e.removeEventListener("touchstart", p), e.removeEventListener("touchend", y), d.J();
2183
+ return e.addEventListener("scroll", S), e.addEventListener("wheel", y, { passive: !0 }), e.addEventListener("touchstart", m, { passive: !0 }), e.addEventListener("touchend", v, { passive: !0 }), { A: () => {
2184
+ e.removeEventListener("scroll", S), e.removeEventListener("wheel", y), e.removeEventListener("touchstart", m), e.removeEventListener("touchend", v), d.J();
2189
2185
  }, L: () => {
2190
- const [b, R] = t.H();
2191
- b && (i(b, R, f), f = !1, R && t.p() > t.h() && t.B(1, r()));
2186
+ const [x, P] = t.H();
2187
+ x && (i(x, P, p), p = !1, P && t.p() > t.h() && t.B(1, r()));
2192
2188
  } };
2193
- }, Ws = (t, e, s) => {
2189
+ }, As = (t, e, s) => {
2194
2190
  let r;
2195
2191
  return [async (i, n) => {
2196
2192
  if (!await e()) return;
2197
2193
  r && r();
2198
2194
  const o = () => {
2199
- const [a, u] = Nt();
2195
+ const [a, u] = Rt();
2200
2196
  return r = () => {
2201
2197
  u(!1);
2202
- }, t.p() && qt(r, 150), [a, t.W(2, (() => {
2198
+ }, t.p() && It(r, 150), [a, t.W(2, (() => {
2203
2199
  u(!0);
2204
2200
  }))];
2205
2201
  };
2206
- if (n && zs()) t.B(8, i()), Pe((async () => {
2202
+ if (n && Ns()) t.B(8, i()), ye((async () => {
2207
2203
  for (; ; ) {
2208
2204
  let a = !0;
2209
- for (let [c, f] = t.S(); c <= f; c++) if (t.I(c)) {
2205
+ for (let [c, p] = t.S(); c <= p; c++) if (t.I(c)) {
2210
2206
  a = !1;
2211
2207
  break;
2212
2208
  }
2213
2209
  if (a) break;
2214
- const [u, h] = o();
2210
+ const [u, l] = o();
2215
2211
  try {
2216
2212
  if (!await u) return;
2217
2213
  } finally {
2218
- h();
2214
+ l();
2219
2215
  }
2220
2216
  }
2221
2217
  t.B(7), s(i(), n);
@@ -2231,57 +2227,57 @@ const $s = [
2231
2227
  }, () => {
2232
2228
  r && r();
2233
2229
  }];
2234
- }, Vs = (t, e) => {
2235
- let s, r, i = Nt(), n = !1;
2236
- const o = e ? "scrollLeft" : "scrollTop", a = e ? "overflowX" : "overflowY", [u, h] = Ws(t, (() => i[0]), ((c, f) => {
2237
- c = yt(c, n), f ? s.scrollTo({ [e ? "left" : "top"]: c, behavior: "smooth" }) : s[o] = c;
2230
+ }, Ds = (t, e) => {
2231
+ let s, r, i = Rt(), n = !1;
2232
+ const o = e ? "scrollLeft" : "scrollTop", a = e ? "overflowX" : "overflowY", [u, l] = As(t, (() => i[0]), ((c, p) => {
2233
+ c = mt(c, n), p ? s.scrollTo({ [e ? "left" : "top"]: c, behavior: "smooth" }) : s[o] = c;
2238
2234
  }));
2239
2235
  return { N(c) {
2240
- s = c, e && (n = getComputedStyle(c).direction === "rtl"), r = Gs(t, c, e, (() => yt(c[o], n)), ((f, d, C) => {
2241
- if (C) {
2242
- const g = c.style, p = g[a];
2243
- g[a] = "hidden", qt((() => {
2244
- g[a] = p;
2236
+ s = c, e && (n = getComputedStyle(c).direction === "rtl"), r = Fs(t, c, e, (() => mt(c[o], n)), ((p, d, S) => {
2237
+ if (S) {
2238
+ const y = c.style, m = y[a];
2239
+ y[a] = "hidden", It((() => {
2240
+ y[a] = m;
2245
2241
  }));
2246
2242
  }
2247
- c[o] = yt(t.C() + f, n), d && h();
2243
+ c[o] = mt(t.C() + p, n), d && l();
2248
2244
  })), i[1](!0);
2249
2245
  }, v() {
2250
- r && r.A(), i[1](!1), i = Nt();
2246
+ r && r.A(), i[1](!1), i = Rt();
2251
2247
  }, P: () => n, V(c) {
2252
2248
  u((() => c));
2253
2249
  }, X(c) {
2254
2250
  c += t.C(), u((() => c));
2255
- }, Y(c, { align: f, smooth: d, offset: C = 0 } = {}) {
2256
- if (c = Oe(c, 0, t.T() - 1), f === "nearest") {
2257
- const g = t.k(c), p = t.C();
2258
- if (g < p) f = "start";
2251
+ }, Y(c, { align: p, smooth: d, offset: S = 0 } = {}) {
2252
+ if (c = me(c, 0, t.T() - 1), p === "nearest") {
2253
+ const y = t.k(c), m = t.C();
2254
+ if (y < m) p = "start";
2259
2255
  else {
2260
- if (!(g + t.R(c) > p + t.p())) return;
2261
- f = "end";
2256
+ if (!(y + t.R(c) > m + t.p())) return;
2257
+ p = "end";
2262
2258
  }
2263
2259
  }
2264
- u((() => C + t.O() + t.k(c) + (f === "end" ? t.R(c) - t.p() : f === "center" ? (t.R(c) - t.p()) / 2 : 0)), d);
2260
+ u((() => S + t.O() + t.k(c) + (p === "end" ? t.R(c) - t.p() : p === "center" ? (t.R(c) - t.p()) / 2 : 0)), d);
2265
2261
  }, q: () => {
2266
2262
  r && r.L();
2267
2263
  } };
2268
- }, Ys = (t) => {
2264
+ }, Qs = (t) => {
2269
2265
  let e;
2270
2266
  return { D(s) {
2271
- (e || (e = new (Ks(js(s))).ResizeObserver(t))).observe(s);
2267
+ (e || (e = new (js(Ms(s))).ResizeObserver(t))).observe(s);
2272
2268
  }, j(s) {
2273
2269
  e.unobserve(s);
2274
2270
  }, A() {
2275
2271
  e && e.disconnect();
2276
2272
  } };
2277
- }, Xs = (t, e) => {
2273
+ }, $s = (t, e) => {
2278
2274
  let s;
2279
- const r = e ? "width" : "height", i = /* @__PURE__ */ new WeakMap(), n = Ys(((o) => {
2275
+ const r = e ? "width" : "height", i = /* @__PURE__ */ new WeakMap(), n = Qs(((o) => {
2280
2276
  const a = [];
2281
- for (const { target: u, contentRect: h } of o) if (u.offsetParent) if (u === s) t.B(4, h[r]);
2277
+ for (const { target: u, contentRect: l } of o) if (u.offsetParent) if (u === s) t.B(4, l[r]);
2282
2278
  else {
2283
2279
  const c = i.get(u);
2284
- c != nt && a.push([c, h[r]]);
2280
+ c != rt && a.push([c, l[r]]);
2285
2281
  }
2286
2282
  a.length && t.B(3, a);
2287
2283
  }));
@@ -2290,96 +2286,96 @@ const $s = [
2290
2286
  }, U: (o, a) => (i.set(o, a), n.D(o), () => {
2291
2287
  i.delete(o), n.j(o);
2292
2288
  }), v: n.A };
2293
- }, pt = Us ? xt : wt, _ = "current", Ne = (t, e) => {
2294
- if (Array.isArray(t)) for (const s of t) Ne(s, e);
2289
+ }, dt = Es ? f.useLayoutEffect : f.useEffect, q = "current", we = (t, e) => {
2290
+ if (Array.isArray(t)) for (const s of t) we(s, e);
2295
2291
  else t == null || typeof t == "boolean" || e.push(t);
2296
- }, Js = (t, e) => {
2292
+ }, Ls = (t, e) => {
2297
2293
  const s = t.key;
2298
2294
  return s ?? "_" + e;
2299
- }, Zs = (t) => {
2300
- const e = j(null);
2301
- return e[_] || (e[_] = t());
2302
- }, ie = (t) => {
2303
- const e = j(t);
2304
- return pt((() => {
2305
- e[_] = t;
2295
+ }, qs = (t) => {
2296
+ const e = f.useRef(null);
2297
+ return e[q] || (e[q] = t());
2298
+ }, Yt = (t) => {
2299
+ const e = f.useRef(t);
2300
+ return dt((() => {
2301
+ e[q] = t;
2306
2302
  }), [t]), e;
2307
- }, tr = /* @__PURE__ */ Le((({ Z: t, ee: e, te: s, oe: r, ne: i, re: n, se: o, ie: a }) => {
2308
- const u = j(null);
2309
- pt((() => e(u[_], s)), [s]);
2310
- const h = Tt((() => {
2303
+ }, Us = /* @__PURE__ */ f.memo((({ Z: t, ee: e, te: s, oe: r, ne: i, re: n, se: o, ie: a }) => {
2304
+ const u = f.useRef(null);
2305
+ dt((() => e(u[q], s)), [s]);
2306
+ const l = f.useMemo((() => {
2311
2307
  const c = { contain: "layout style", position: i && a ? void 0 : "absolute", [o ? "height" : "width"]: "100%", [o ? "top" : "left"]: 0, [o ? "left" : "top"]: r, visibility: !i || a ? void 0 : "hidden" };
2312
2308
  return o && (c.display = "inline-flex"), c;
2313
2309
  }), [r, i, a, o]);
2314
- return l(n, typeof n == "string" ? { ref: u, style: h, children: t } : { ref: u, style: h, index: s, children: t });
2315
- })), er = (t, e) => Tt((() => {
2310
+ return h.jsx(n, typeof n == "string" ? { ref: u, style: l, children: t } : { ref: u, style: l, index: s, children: t });
2311
+ })), _s = (t, e) => f.useMemo((() => {
2316
2312
  if (typeof t == "function") return [(r) => t(e[r], r), e.length];
2317
2313
  const s = ((r) => {
2318
2314
  const i = [];
2319
- return Ne(r, i), i;
2315
+ return we(r, i), i;
2320
2316
  })(t);
2321
2317
  return [(r) => s[r], s.length];
2322
- }), [t, e]), sr = /* @__PURE__ */ It((({ children: t, data: e, bufferSize: s, itemSize: r, shift: i, horizontal: n, keepMounted: o, cache: a, startMargin: u = 0, ssrCount: h, as: c = "div", item: f = "div", scrollRef: d, onScroll: C, onScrollEnd: g }, p) => {
2323
- const [y, b] = er(t, e), R = j(null), P = j(!!h), D = ie(C), L = ie(g), [O, T, E, N] = Zs((() => {
2324
- const k = !!n, v = Hs(b, r, h, a, !r);
2325
- return [v, Xs(v, k), Vs(v, k), k];
2318
+ }), [t, e]), Ks = /* @__PURE__ */ f.forwardRef((({ children: t, data: e, bufferSize: s, itemSize: r, shift: i, horizontal: n, keepMounted: o, cache: a, startMargin: u = 0, ssrCount: l, as: c = "div", item: p = "div", scrollRef: d, onScroll: S, onScrollEnd: y }, m) => {
2319
+ const [v, x] = _s(t, e), P = f.useRef(null), E = f.useRef(!!l), A = Yt(S), Q = Yt(y), [R, I, M, j] = qs((() => {
2320
+ const k = !!n, b = Ts(x, r, l, a, !r);
2321
+ return [b, $s(b, k), Ds(b, k), k];
2326
2322
  }));
2327
- b !== O.T() && O.B(5, [b, i]), u !== O.O() && O.B(6, u);
2328
- const [q, K] = Qe(O.m, void 0, O.m), G = O.M(), x = O.h(), m = E.P(), S = !N && m ? "unshift" : "push", F = [], I = (k) => {
2329
- const v = y(k);
2330
- return l(tr, { ee: T.U, te: k, oe: O.k(k, m), ne: O.I(k), re: f, Z: v, se: N, ie: P[_] }, Js(v, k));
2323
+ x !== R.T() && R.B(5, [x, i]), u !== R.O() && R.B(6, u);
2324
+ const [$, U] = f.useReducer(R.m, void 0, R.m), B = R.M(), w = R.h(), g = M.P(), O = !j && g ? "unshift" : "push", T = [], N = (k) => {
2325
+ const b = v(k);
2326
+ return h.jsx(Us, { ee: I.U, te: k, oe: R.k(k, g), ne: R.I(k), re: p, Z: b, se: j, ie: E[q] }, Ls(b, k));
2331
2327
  };
2332
- if (pt((() => {
2333
- P[_] = !1, O.W(1, ((v) => {
2334
- v ? _e(K) : K();
2335
- })), O.W(4, (() => {
2336
- D[_] && D[_](O.C());
2337
- })), O.W(8, (() => {
2338
- L[_] && L[_]();
2328
+ if (dt((() => {
2329
+ E[q] = !1, R.W(1, ((b) => {
2330
+ b ? Ee.flushSync(U) : U();
2331
+ })), R.W(4, (() => {
2332
+ A[q] && A[q](R.C());
2333
+ })), R.W(8, (() => {
2334
+ Q[q] && Q[q]();
2339
2335
  }));
2340
- const k = (v) => {
2341
- T.G(v), E.N(v);
2336
+ const k = (b) => {
2337
+ I.G(b), M.N(b);
2342
2338
  };
2343
- return d ? Pe((() => {
2344
- d[_] && k(d[_]);
2345
- })) : k(R[_].parentElement), () => {
2346
- O.v(), T.v(), E.v();
2339
+ return d ? ye((() => {
2340
+ d[q] && k(d[q]);
2341
+ })) : k(P[q].parentElement), () => {
2342
+ R.v(), I.v(), M.v();
2347
2343
  };
2348
- }), []), pt((() => {
2349
- E.q();
2350
- }), [q]), $e(p, (() => ({ get cache() {
2351
- return O._();
2344
+ }), []), dt((() => {
2345
+ M.q();
2346
+ }), [$]), f.useImperativeHandle(m, (() => ({ get cache() {
2347
+ return R._();
2352
2348
  }, get scrollOffset() {
2353
- return O.C();
2349
+ return R.C();
2354
2350
  }, get scrollSize() {
2355
- return Bs(O);
2351
+ return Is(R);
2356
2352
  }, get viewportSize() {
2357
- return O.p();
2358
- }, findItemIndex: O.$, getItemOffset: O.k, getItemSize: O.R, scrollToIndex: E.Y, scrollTo: E.V, scrollBy: E.X })), []), o) {
2353
+ return R.p();
2354
+ }, findItemIndex: R.$, getItemOffset: R.k, getItemSize: R.R, scrollToIndex: M.Y, scrollTo: M.V, scrollBy: M.X })), []), o) {
2359
2355
  const k = new Set(o);
2360
- for (let [v, Q] = O.S(s); v <= Q; v++) k.add(v);
2361
- ke([...k]).forEach(((v) => {
2362
- F[S](I(v));
2356
+ for (let [b, D] = R.S(s); b <= D; b++) k.add(b);
2357
+ ge([...k]).forEach(((b) => {
2358
+ T[O](N(b));
2363
2359
  }));
2364
- } else for (let [k, v] = O.S(s); k <= v; k++) F[S](I(k));
2365
- return l(c, { ref: R, style: { contain: "size style", overflowAnchor: "none", flex: "none", position: "relative", width: N ? x : "100%", height: N ? "100%" : x, pointerEvents: G ? "none" : void 0 }, children: F });
2360
+ } else for (let [k, b] = R.S(s); k <= b; k++) T[O](N(k));
2361
+ return h.jsx(c, { ref: P, style: { contain: "size style", overflowAnchor: "none", flex: "none", position: "relative", width: j ? w : "100%", height: j ? "100%" : w, pointerEvents: B ? "none" : void 0 }, children: T });
2366
2362
  }));
2367
- async function rr(t, e) {
2368
- return (await Ft.get(`/chats/${t}/entries`, {
2363
+ async function zs(t, e) {
2364
+ return (await kt.get(`/chats/${t}/entries`, {
2369
2365
  params: e
2370
2366
  })).data?.entries ?? [];
2371
2367
  }
2372
- const ne = 50, Ie = "chat-messages", ir = (t, e = { limit: ne }) => {
2373
- const s = e.limit ?? ne;
2368
+ const Xt = 50, Ce = "chat-messages", Bs = (t, e = { limit: Xt }) => {
2369
+ const s = e.limit ?? Xt;
2374
2370
  return {
2375
- queryKey: [Ie, t ? Number(t) : null, { limit: s }],
2371
+ queryKey: [Ce, t ? Number(t) : null, { limit: s }],
2376
2372
  enabled: t !== null,
2377
2373
  initialPageParam: null,
2378
2374
  refetchInterval: 5e3,
2379
2375
  // Fetch new messages every 5 seconds
2380
2376
  queryFn: async ({ pageParam: r }) => {
2381
2377
  if (!t) throw new Error("Chat ID is required");
2382
- return rr(t, {
2378
+ return zs(t, {
2383
2379
  limit: s,
2384
2380
  prev_message: r ? JSON.stringify(r) : void 0
2385
2381
  });
@@ -2387,202 +2383,202 @@ const ne = 50, Ie = "chat-messages", ir = (t, e = { limit: ne }) => {
2387
2383
  getNextPageParam: (r) => !r || r.length !== s ? null : r[r.length - 1]
2388
2384
  };
2389
2385
  };
2390
- function nr(t, e) {
2391
- return ks(ir(t, e));
2386
+ function Hs(t, e) {
2387
+ return ds(Bs(t, e));
2392
2388
  }
2393
- async function ar(t) {
2389
+ async function Gs(t) {
2394
2390
  try {
2395
- return (await Ft.get(`/games/${t}`)).data.game;
2391
+ return (await kt.get(`/games/${t}`)).data.game;
2396
2392
  } catch (e) {
2397
- if (e instanceof ce && e.response?.status === 404)
2393
+ if (e instanceof Zt && e.response?.status === 404)
2398
2394
  return null;
2399
2395
  throw e;
2400
2396
  }
2401
2397
  }
2402
- const or = "game", cr = (t) => ({
2403
- queryKey: [or, Number(t)],
2404
- queryFn: async () => ar(t),
2398
+ const Ws = "game", Vs = (t) => ({
2399
+ queryKey: [Ws, Number(t)],
2400
+ queryFn: async () => Gs(t),
2405
2401
  staleTime: 1 / 0
2406
2402
  });
2407
- function ur(t) {
2408
- return Ss(cr(t));
2403
+ function Ys(t) {
2404
+ return hs(Vs(t));
2409
2405
  }
2410
- class Te extends Error {
2406
+ class Se extends Error {
2411
2407
  constructor(e = "You are sending messages too quickly. Please wait a moment.") {
2412
2408
  super(e), this.name = "RateLimitError";
2413
2409
  }
2414
2410
  }
2415
- async function hr(t) {
2411
+ async function Xs(t) {
2416
2412
  try {
2417
- return (await Ft.post(`/chats/${t.chatID}/messages`, {
2413
+ return (await kt.post(`/chats/${t.chatID}/messages`, {
2418
2414
  chatID: t.chatID,
2419
2415
  content: t.content
2420
2416
  })).data;
2421
2417
  } catch (e) {
2422
- throw e instanceof ce && e.response?.status === 429 ? new Te() : e;
2418
+ throw e instanceof Zt && e.response?.status === 429 ? new Se() : e;
2423
2419
  }
2424
2420
  }
2425
- function lr(t) {
2426
- const e = Lt(), { onSettled: s, onError: r, ...i } = t ?? {};
2427
- return Os({
2428
- mutationFn: (n) => hr(n),
2421
+ function Js(t) {
2422
+ const e = Nt(), { onSettled: s, onError: r, ...i } = t ?? {};
2423
+ return ls({
2424
+ mutationFn: (n) => Xs(n),
2429
2425
  onError: (n, ...o) => {
2430
- n instanceof Te && console.error(n.message), r?.(n, ...o);
2426
+ n instanceof Se && console.error(n.message), r?.(n, ...o);
2431
2427
  },
2432
2428
  onSettled: (n, ...o) => {
2433
- n && e.invalidateQueries({ queryKey: [Ie, n.entry.ChatID] }), s?.(n, ...o);
2429
+ n && e.invalidateQueries({ queryKey: [Ce, n.entry.ChatID] }), s?.(n, ...o);
2434
2430
  },
2435
2431
  ...i
2436
2432
  });
2437
2433
  }
2438
- const vt = 255;
2439
- function dr({ chatId: t, onMessageSent: e }) {
2440
- const [s, r] = oe(""), i = j(null), n = gt((y) => y.user), o = gt((y) => y.isAuthenticated), a = gt((y) => y.login), { mutate: u, isPending: h } = lr({
2434
+ const gt = 255;
2435
+ function Zs({ chatId: t, onMessageSent: e }) {
2436
+ const [s, r] = f.useState(""), i = f.useRef(null), n = pt((v) => v.user), o = pt((v) => v.isAuthenticated), a = pt((v) => v.login), { mutate: u, isPending: l } = Js({
2441
2437
  onSuccess: () => {
2442
2438
  r(""), e?.();
2443
2439
  }
2444
2440
  }), c = () => {
2445
- const y = s.trim();
2446
- if (!(!y || h)) {
2441
+ const v = s.trim();
2442
+ if (!(!v || l)) {
2447
2443
  if (!o) {
2448
2444
  a();
2449
2445
  return;
2450
2446
  }
2451
- u({ chatID: t, content: y });
2447
+ u({ chatID: t, content: v });
2452
2448
  }
2453
- }, f = (y) => {
2454
- y.key === "Enter" && !y.shiftKey && (y.preventDefault(), c());
2455
- }, d = s.length > vt, C = h || !s.trim() || d, g = n?.SolanaAddress || n?.ID?.toString() || "anonymous", p = n?.ImageURL || `https://api.dicebear.com/7.x/avataaars/svg?seed=${g}`;
2456
- return /* @__PURE__ */ l("div", { className: "chat-input-container", children: /* @__PURE__ */ M("div", { className: "chat-input-wrapper", children: [
2457
- /* @__PURE__ */ l(
2449
+ }, p = (v) => {
2450
+ v.key === "Enter" && !v.shiftKey && (v.preventDefault(), c());
2451
+ }, d = s.length > gt, S = l || !s.trim() || d, y = n?.SolanaAddress || n?.ID?.toString() || "anonymous", m = n?.ImageURL || `https://api.dicebear.com/7.x/avataaars/svg?seed=${y}`;
2452
+ return /* @__PURE__ */ h.jsx("div", { className: "chat-input-container", children: /* @__PURE__ */ h.jsxs("div", { className: "chat-input-wrapper", children: [
2453
+ /* @__PURE__ */ h.jsx(
2458
2454
  "textarea",
2459
2455
  {
2460
2456
  ref: i,
2461
2457
  value: s,
2462
- onChange: (y) => r(y.target.value),
2463
- onKeyDown: f,
2458
+ onChange: (v) => r(v.target.value),
2459
+ onKeyDown: p,
2464
2460
  placeholder: o ? "Write a message..." : "Login to send messages...",
2465
2461
  className: "chat-input-textarea",
2466
- disabled: h,
2467
- maxLength: vt + 50
2462
+ disabled: l,
2463
+ maxLength: gt + 50
2468
2464
  }
2469
2465
  ),
2470
- /* @__PURE__ */ M("div", { className: "chat-input-footer", children: [
2471
- o && n && /* @__PURE__ */ l("div", { className: "chat-input-avatar", children: /* @__PURE__ */ l("img", { src: p, alt: "You", className: "chat-input-avatar-img" }) }),
2472
- /* @__PURE__ */ M("span", { className: `chat-input-counter ${d ? "chat-input-counter--error" : ""}`, children: [
2466
+ /* @__PURE__ */ h.jsxs("div", { className: "chat-input-footer", children: [
2467
+ o && n && /* @__PURE__ */ h.jsx("div", { className: "chat-input-avatar", children: /* @__PURE__ */ h.jsx("img", { src: m, alt: "You", className: "chat-input-avatar-img" }) }),
2468
+ /* @__PURE__ */ h.jsxs("span", { className: `chat-input-counter ${d ? "chat-input-counter--error" : ""}`, children: [
2473
2469
  s.length,
2474
2470
  "/",
2475
- vt
2471
+ gt
2476
2472
  ] }),
2477
- /* @__PURE__ */ l("div", { className: "chat-input-divider" }),
2478
- /* @__PURE__ */ l(
2473
+ /* @__PURE__ */ h.jsx("div", { className: "chat-input-divider" }),
2474
+ /* @__PURE__ */ h.jsx(
2479
2475
  "button",
2480
2476
  {
2481
2477
  type: "button",
2482
2478
  onClick: c,
2483
- disabled: C,
2479
+ disabled: S,
2484
2480
  className: "chat-input-button",
2485
2481
  "aria-label": o ? "Send message" : "Login to send",
2486
- children: h ? /* @__PURE__ */ l(Mt, { className: "chat-input-spinner" }) : /* @__PURE__ */ l(Ts, { className: "chat-input-icon" })
2482
+ children: l ? /* @__PURE__ */ h.jsx(Ot, { className: "chat-input-spinner" }) : /* @__PURE__ */ h.jsx(bs, { className: "chat-input-icon" })
2487
2483
  }
2488
2484
  )
2489
2485
  ] })
2490
2486
  ] }) });
2491
2487
  }
2492
- function ae(t, e = 4) {
2488
+ function Jt(t, e = 4) {
2493
2489
  return !t || t.length < e * 2 + 3 ? t : `${t.slice(0, e)}...${t.slice(-e)}`;
2494
2490
  }
2495
- function Ut(t) {
2491
+ function Tt(t) {
2496
2492
  const e = new Date(t), r = (/* @__PURE__ */ new Date()).getTime() - e.getTime(), i = Math.floor(r / 1e3), n = Math.floor(i / 60), o = Math.floor(n / 60), a = Math.floor(o / 24);
2497
2493
  return i < 60 ? "now" : n < 60 ? `${n}m` : o < 24 ? `${o}h` : a < 7 ? `${a}d` : e.toLocaleDateString();
2498
2494
  }
2499
- function fr({ entry: t }) {
2495
+ function tr({ entry: t }) {
2500
2496
  if (t.EntryType !== "user_message" || !t.UserMessage) return null;
2501
2497
  const { UserMessage: e } = t, s = e.User, r = s.SolanaAddress || s.ID.toString(), i = s.ImageURL || `https://api.dicebear.com/7.x/avataaars/svg?seed=${r}`;
2502
- return /* @__PURE__ */ M("div", { className: "chat-message-card", "data-entry-id": t.ID, "data-entry-type": "user_message", children: [
2503
- /* @__PURE__ */ l("div", { className: "chat-message-avatar", children: /* @__PURE__ */ l(
2498
+ return /* @__PURE__ */ h.jsxs("div", { className: "chat-message-card", "data-entry-id": t.ID, "data-entry-type": "user_message", children: [
2499
+ /* @__PURE__ */ h.jsx("div", { className: "chat-message-avatar", children: /* @__PURE__ */ h.jsx(
2504
2500
  "img",
2505
2501
  {
2506
2502
  src: i,
2507
- alt: ae(s.SolanaAddress),
2503
+ alt: Jt(s.SolanaAddress),
2508
2504
  className: "chat-message-avatar-img"
2509
2505
  }
2510
2506
  ) }),
2511
- /* @__PURE__ */ M("div", { className: "chat-message-content", children: [
2512
- /* @__PURE__ */ M("div", { className: "chat-message-header", children: [
2513
- /* @__PURE__ */ l("span", { className: "chat-message-username", children: ae(s.SolanaAddress) }),
2514
- /* @__PURE__ */ l("span", { className: "chat-message-time", children: Ut(t.CreatedAt) })
2507
+ /* @__PURE__ */ h.jsxs("div", { className: "chat-message-content", children: [
2508
+ /* @__PURE__ */ h.jsxs("div", { className: "chat-message-header", children: [
2509
+ /* @__PURE__ */ h.jsx("span", { className: "chat-message-username", children: Jt(s.SolanaAddress) }),
2510
+ /* @__PURE__ */ h.jsx("span", { className: "chat-message-time", children: Tt(t.CreatedAt) })
2515
2511
  ] }),
2516
- /* @__PURE__ */ l("p", { className: "chat-message-text", children: e.Content })
2512
+ /* @__PURE__ */ h.jsx("p", { className: "chat-message-text", children: e.Content })
2517
2513
  ] })
2518
2514
  ] });
2519
2515
  }
2520
- function pr({ entry: t }) {
2516
+ function er({ entry: t }) {
2521
2517
  if (t.EntryType !== "game_event" || !t.GameEvent) return null;
2522
2518
  const { GameEvent: e } = t, s = e.Game;
2523
- return /* @__PURE__ */ l(
2519
+ return /* @__PURE__ */ h.jsx(
2524
2520
  "div",
2525
2521
  {
2526
2522
  className: "chat-message-card chat-message-card--event",
2527
2523
  "data-entry-id": t.ID,
2528
2524
  "data-entry-type": "game_event",
2529
- children: /* @__PURE__ */ M("div", { className: "chat-message-content", children: [
2530
- /* @__PURE__ */ M("div", { className: "chat-message-header", children: [
2531
- s && /* @__PURE__ */ l("span", { className: "chat-message-username chat-message-username--link", children: e.Title }),
2532
- !s && /* @__PURE__ */ l("span", { className: "chat-message-username", children: e.Title }),
2533
- /* @__PURE__ */ l("span", { className: "chat-message-time", children: Ut(t.CreatedAt) })
2525
+ children: /* @__PURE__ */ h.jsxs("div", { className: "chat-message-content", children: [
2526
+ /* @__PURE__ */ h.jsxs("div", { className: "chat-message-header", children: [
2527
+ s && /* @__PURE__ */ h.jsx("span", { className: "chat-message-username chat-message-username--link", children: e.Title }),
2528
+ !s && /* @__PURE__ */ h.jsx("span", { className: "chat-message-username", children: e.Title }),
2529
+ /* @__PURE__ */ h.jsx("span", { className: "chat-message-time", children: Tt(t.CreatedAt) })
2534
2530
  ] }),
2535
- /* @__PURE__ */ M("div", { className: "chat-message-event-content", children: [
2536
- /* @__PURE__ */ l("p", { className: "chat-message-text chat-message-text--title", children: e.Title }),
2537
- e.ShortSummary && /* @__PURE__ */ l("p", { className: "chat-message-text chat-message-text--summary", children: e.ShortSummary }),
2538
- e.Description && /* @__PURE__ */ l("p", { className: "chat-message-text", children: e.Description })
2531
+ /* @__PURE__ */ h.jsxs("div", { className: "chat-message-event-content", children: [
2532
+ /* @__PURE__ */ h.jsx("p", { className: "chat-message-text chat-message-text--title", children: e.Title }),
2533
+ e.ShortSummary && /* @__PURE__ */ h.jsx("p", { className: "chat-message-text chat-message-text--summary", children: e.ShortSummary }),
2534
+ e.Description && /* @__PURE__ */ h.jsx("p", { className: "chat-message-text", children: e.Description })
2539
2535
  ] })
2540
2536
  ] })
2541
2537
  }
2542
2538
  );
2543
2539
  }
2544
- function mr({ entry: t }) {
2540
+ function sr({ entry: t }) {
2545
2541
  if (t.EntryType !== "token_event" || !t.TokenEvent) return null;
2546
2542
  const { TokenEvent: e } = t, s = e.Token;
2547
- return /* @__PURE__ */ l(
2543
+ return /* @__PURE__ */ h.jsx(
2548
2544
  "div",
2549
2545
  {
2550
2546
  className: "chat-message-card chat-message-card--event",
2551
2547
  "data-entry-id": t.ID,
2552
2548
  "data-entry-type": "token_event",
2553
- children: /* @__PURE__ */ M("div", { className: "chat-message-content", children: [
2554
- /* @__PURE__ */ M("div", { className: "chat-message-header", children: [
2555
- s && /* @__PURE__ */ M("span", { className: "chat-message-username chat-message-username--link", children: [
2549
+ children: /* @__PURE__ */ h.jsxs("div", { className: "chat-message-content", children: [
2550
+ /* @__PURE__ */ h.jsxs("div", { className: "chat-message-header", children: [
2551
+ s && /* @__PURE__ */ h.jsxs("span", { className: "chat-message-username chat-message-username--link", children: [
2556
2552
  e.Title,
2557
2553
  " (",
2558
2554
  e.Token?.Ticker,
2559
2555
  ")"
2560
2556
  ] }),
2561
- !s && /* @__PURE__ */ l("span", { className: "chat-message-username", children: e.Title }),
2562
- /* @__PURE__ */ l("span", { className: "chat-message-time", children: Ut(t.CreatedAt) })
2557
+ !s && /* @__PURE__ */ h.jsx("span", { className: "chat-message-username", children: e.Title }),
2558
+ /* @__PURE__ */ h.jsx("span", { className: "chat-message-time", children: Tt(t.CreatedAt) })
2563
2559
  ] }),
2564
- /* @__PURE__ */ M("div", { className: "chat-message-event-content", children: [
2565
- /* @__PURE__ */ l("p", { className: "chat-message-text chat-message-text--title", children: e.Title }),
2566
- e.ShortSummary && /* @__PURE__ */ l("p", { className: "chat-message-text chat-message-text--summary", children: e.ShortSummary }),
2567
- e.Description && /* @__PURE__ */ l("p", { className: "chat-message-text", children: e.Description })
2560
+ /* @__PURE__ */ h.jsxs("div", { className: "chat-message-event-content", children: [
2561
+ /* @__PURE__ */ h.jsx("p", { className: "chat-message-text chat-message-text--title", children: e.Title }),
2562
+ e.ShortSummary && /* @__PURE__ */ h.jsx("p", { className: "chat-message-text chat-message-text--summary", children: e.ShortSummary }),
2563
+ e.Description && /* @__PURE__ */ h.jsx("p", { className: "chat-message-text", children: e.Description })
2568
2564
  ] })
2569
2565
  ] })
2570
2566
  }
2571
2567
  );
2572
2568
  }
2573
- function gr({ entry: t }) {
2569
+ function rr({ entry: t }) {
2574
2570
  switch (t.EntryType) {
2575
2571
  case "user_message":
2576
- return /* @__PURE__ */ l(fr, { entry: t });
2572
+ return /* @__PURE__ */ h.jsx(tr, { entry: t });
2577
2573
  case "game_event":
2578
- return /* @__PURE__ */ l(pr, { entry: t });
2574
+ return /* @__PURE__ */ h.jsx(er, { entry: t });
2579
2575
  case "token_event":
2580
- return /* @__PURE__ */ l(mr, { entry: t });
2576
+ return /* @__PURE__ */ h.jsx(sr, { entry: t });
2581
2577
  default:
2582
2578
  return null;
2583
2579
  }
2584
2580
  }
2585
- const yr = new ls({
2581
+ const ir = new Je({
2586
2582
  defaultOptions: {
2587
2583
  queries: {
2588
2584
  staleTime: 1e3 * 60,
@@ -2591,147 +2587,147 @@ const yr = new ls({
2591
2587
  }
2592
2588
  }
2593
2589
  });
2594
- function vr({ gameId: t, onOpenChange: e }) {
2595
- const [s, r] = oe(!1), i = j(!1), n = j(!1), o = j(!1), a = j(!1), u = j(!0), h = j(!1), c = j(null), {
2596
- data: f,
2590
+ function nr({ gameId: t, onOpenChange: e }) {
2591
+ const [s, r] = f.useState(!1), i = f.useRef(!1), n = f.useRef(!1), o = f.useRef(!1), a = f.useRef(!1), u = f.useRef(!0), l = f.useRef(!1), c = f.useRef(null), {
2592
+ data: p,
2597
2593
  isLoading: d,
2598
- isError: C,
2599
- error: g,
2600
- refetch: p
2601
- } = ur(t), y = f?.ChatID ?? null, {
2602
- data: b,
2603
- fetchNextPage: R,
2604
- hasNextPage: P,
2605
- isFetchingNextPage: D,
2606
- isLoading: L,
2607
- isFetching: O,
2608
- isError: T,
2609
- refetch: E
2610
- } = nr(y), N = Tt(() => b ? b.pages.flat().reverse() : [], [b]), q = Kt(() => {
2594
+ isError: S,
2595
+ error: y,
2596
+ refetch: m
2597
+ } = Ys(t), v = p?.ChatID ?? null, {
2598
+ data: x,
2599
+ fetchNextPage: P,
2600
+ hasNextPage: E,
2601
+ isFetchingNextPage: A,
2602
+ isLoading: Q,
2603
+ isFetching: R,
2604
+ isError: I,
2605
+ refetch: M
2606
+ } = Hs(v), j = f.useMemo(() => x ? x.pages.flat().reverse() : [], [x]), $ = f.useCallback(() => {
2611
2607
  u.current = !0, n.current = !0;
2612
- }, []), K = Kt(() => {
2613
- i.current || !P || D || (i.current = !0, a.current = !0, R().finally(() => {
2608
+ }, []), U = f.useCallback(() => {
2609
+ i.current || !E || A || (i.current = !0, a.current = !0, P().finally(() => {
2614
2610
  i.current = !1;
2615
2611
  }));
2616
- }, [P, D, R]);
2617
- xt(() => {
2612
+ }, [E, A, P]);
2613
+ f.useLayoutEffect(() => {
2618
2614
  a.current = !1;
2619
- }), wt(() => {
2615
+ }), f.useEffect(() => {
2620
2616
  if (!c.current) return;
2621
- const m = c.current, S = N.length - 1;
2622
- u.current && S >= 0 && m.scrollToIndex(S, { align: "end" });
2623
- }, [N.length]), xt(() => {
2624
- if (s && c.current && N.length > 0 && !h.current) {
2625
- const m = c.current, S = N.length - 1;
2626
- m.scrollToIndex(S, { align: "end" }), u.current = !0, h.current = !0;
2617
+ const g = c.current, O = j.length - 1;
2618
+ u.current && O >= 0 && g.scrollToIndex(O, { align: "end" });
2619
+ }, [j.length]), f.useLayoutEffect(() => {
2620
+ if (s && c.current && j.length > 0 && !l.current) {
2621
+ const g = c.current, O = j.length - 1;
2622
+ g.scrollToIndex(O, { align: "end" }), u.current = !0, l.current = !0;
2627
2623
  }
2628
- s || (h.current = !1);
2629
- }, [s, N.length]), wt(() => {
2630
- const m = c.current;
2631
- if (!m) return;
2632
- const S = o.current && !O;
2633
- if (n.current && S) {
2634
- const F = N.length - 1;
2635
- F >= 0 && m.scrollToIndex(F, { align: "end" }), n.current = !1;
2624
+ s || (l.current = !1);
2625
+ }, [s, j.length]), f.useEffect(() => {
2626
+ const g = c.current;
2627
+ if (!g) return;
2628
+ const O = o.current && !R;
2629
+ if (n.current && O) {
2630
+ const T = j.length - 1;
2631
+ T >= 0 && g.scrollToIndex(T, { align: "end" }), n.current = !1;
2636
2632
  }
2637
- o.current = O;
2638
- }, [O, N.length]);
2639
- const G = () => {
2640
- const m = !s;
2641
- r(m), e?.(m);
2642
- }, x = () => d ? /* @__PURE__ */ M("div", { className: "chat-empty", children: [
2643
- /* @__PURE__ */ l("div", { className: "chat-empty-icon", children: /* @__PURE__ */ l(Mt, { className: "chat-spinner" }) }),
2644
- /* @__PURE__ */ l("p", { className: "chat-empty-text", children: "Loading game data..." })
2645
- ] }) : C ? /* @__PURE__ */ M("div", { className: "chat-empty", children: [
2646
- /* @__PURE__ */ l("p", { className: "chat-empty-title", children: "Failed to load game" }),
2647
- /* @__PURE__ */ l("p", { className: "chat-empty-text", children: g instanceof Error ? g.message : "Unknown error occurred" }),
2648
- /* @__PURE__ */ M("button", { type: "button", onClick: () => p(), className: "chat-retry-button", children: [
2649
- /* @__PURE__ */ l(ee, { className: "chat-retry-icon" }),
2633
+ o.current = R;
2634
+ }, [R, j.length]);
2635
+ const B = () => {
2636
+ const g = !s;
2637
+ r(g), e?.(g);
2638
+ }, w = () => d ? /* @__PURE__ */ h.jsxs("div", { className: "chat-empty", children: [
2639
+ /* @__PURE__ */ h.jsx("div", { className: "chat-empty-icon", children: /* @__PURE__ */ h.jsx(Ot, { className: "chat-spinner" }) }),
2640
+ /* @__PURE__ */ h.jsx("p", { className: "chat-empty-text", children: "Loading game data..." })
2641
+ ] }) : S ? /* @__PURE__ */ h.jsxs("div", { className: "chat-empty", children: [
2642
+ /* @__PURE__ */ h.jsx("p", { className: "chat-empty-title", children: "Failed to load game" }),
2643
+ /* @__PURE__ */ h.jsx("p", { className: "chat-empty-text", children: y instanceof Error ? y.message : "Unknown error occurred" }),
2644
+ /* @__PURE__ */ h.jsxs("button", { type: "button", onClick: () => m(), className: "chat-retry-button", children: [
2645
+ /* @__PURE__ */ h.jsx(Gt, { className: "chat-retry-icon" }),
2650
2646
  "Retry"
2651
2647
  ] })
2652
- ] }) : y ? L ? /* @__PURE__ */ M("div", { className: "chat-empty", children: [
2653
- /* @__PURE__ */ l("div", { className: "chat-empty-icon", children: /* @__PURE__ */ l(Mt, { className: "chat-spinner" }) }),
2654
- /* @__PURE__ */ l("p", { className: "chat-empty-text", children: "Loading messages..." })
2655
- ] }) : T ? /* @__PURE__ */ M("div", { className: "chat-empty", children: [
2656
- /* @__PURE__ */ l("p", { className: "chat-empty-title", children: "Failed to load messages" }),
2657
- /* @__PURE__ */ M("button", { type: "button", onClick: () => E(), className: "chat-retry-button", children: [
2658
- /* @__PURE__ */ l(ee, { className: "chat-retry-icon" }),
2648
+ ] }) : v ? Q ? /* @__PURE__ */ h.jsxs("div", { className: "chat-empty", children: [
2649
+ /* @__PURE__ */ h.jsx("div", { className: "chat-empty-icon", children: /* @__PURE__ */ h.jsx(Ot, { className: "chat-spinner" }) }),
2650
+ /* @__PURE__ */ h.jsx("p", { className: "chat-empty-text", children: "Loading messages..." })
2651
+ ] }) : I ? /* @__PURE__ */ h.jsxs("div", { className: "chat-empty", children: [
2652
+ /* @__PURE__ */ h.jsx("p", { className: "chat-empty-title", children: "Failed to load messages" }),
2653
+ /* @__PURE__ */ h.jsxs("button", { type: "button", onClick: () => M(), className: "chat-retry-button", children: [
2654
+ /* @__PURE__ */ h.jsx(Gt, { className: "chat-retry-icon" }),
2659
2655
  "Retry"
2660
2656
  ] })
2661
- ] }) : N.length === 0 ? /* @__PURE__ */ M("div", { className: "chat-empty", children: [
2662
- /* @__PURE__ */ l("div", { className: "chat-empty-icon", children: /* @__PURE__ */ l(te, { className: "chat-empty-svg" }) }),
2663
- /* @__PURE__ */ l("p", { className: "chat-empty-title", children: "No messages yet" }),
2664
- /* @__PURE__ */ l("p", { className: "chat-empty-text", children: "Be the first to start the conversation!" })
2665
- ] }) : /* @__PURE__ */ M("div", { className: "chat-messages-container", children: [
2666
- /* @__PURE__ */ l("div", { className: "chat-messages-spacer" }),
2667
- /* @__PURE__ */ l(
2668
- sr,
2657
+ ] }) : j.length === 0 ? /* @__PURE__ */ h.jsxs("div", { className: "chat-empty", children: [
2658
+ /* @__PURE__ */ h.jsx("div", { className: "chat-empty-icon", children: /* @__PURE__ */ h.jsx(Ht, { className: "chat-empty-svg" }) }),
2659
+ /* @__PURE__ */ h.jsx("p", { className: "chat-empty-title", children: "No messages yet" }),
2660
+ /* @__PURE__ */ h.jsx("p", { className: "chat-empty-text", children: "Be the first to start the conversation!" })
2661
+ ] }) : /* @__PURE__ */ h.jsxs("div", { className: "chat-messages-container", children: [
2662
+ /* @__PURE__ */ h.jsx("div", { className: "chat-messages-spacer" }),
2663
+ /* @__PURE__ */ h.jsx(
2664
+ Ks,
2669
2665
  {
2670
2666
  ref: c,
2671
2667
  shift: a.current,
2672
- onScroll: (m) => {
2673
- c.current && (u.current = m - c.current.scrollSize + c.current.viewportSize >= -1.5, m < 100 && (a.current = !0, K()));
2668
+ onScroll: (g) => {
2669
+ c.current && (u.current = g - c.current.scrollSize + c.current.viewportSize >= -1.5, g < 100 && (a.current = !0, U()));
2674
2670
  },
2675
- children: N.map((m) => /* @__PURE__ */ l(gr, { entry: m }, m.ID))
2671
+ children: j.map((g) => /* @__PURE__ */ h.jsx(rr, { entry: g }, g.ID))
2676
2672
  }
2677
2673
  )
2678
- ] }) : /* @__PURE__ */ M("div", { className: "chat-empty", children: [
2679
- /* @__PURE__ */ l("p", { className: "chat-empty-title", children: "Chat not available" }),
2680
- /* @__PURE__ */ l("p", { className: "chat-empty-text", children: "This game does not have a chat configured." })
2674
+ ] }) : /* @__PURE__ */ h.jsxs("div", { className: "chat-empty", children: [
2675
+ /* @__PURE__ */ h.jsx("p", { className: "chat-empty-title", children: "Chat not available" }),
2676
+ /* @__PURE__ */ h.jsx("p", { className: "chat-empty-text", children: "This game does not have a chat configured." })
2681
2677
  ] });
2682
- return s ? /* @__PURE__ */ M("div", { className: "chat-widget", children: [
2683
- /* @__PURE__ */ l("div", { className: "chat-widget-header", children: /* @__PURE__ */ l(
2678
+ return s ? /* @__PURE__ */ h.jsxs("div", { className: "chat-widget", children: [
2679
+ /* @__PURE__ */ h.jsx("div", { className: "chat-widget-header", children: /* @__PURE__ */ h.jsx(
2684
2680
  "button",
2685
2681
  {
2686
2682
  type: "button",
2687
2683
  className: "chat-widget-header-button",
2688
- onClick: G,
2684
+ onClick: B,
2689
2685
  "aria-label": "Minimize chat",
2690
- children: /* @__PURE__ */ l(As, { className: "chat-widget-header-icon" })
2686
+ children: /* @__PURE__ */ h.jsx(ws, { className: "chat-widget-header-icon" })
2691
2687
  }
2692
2688
  ) }),
2693
- /* @__PURE__ */ l("div", { className: "chat-widget-body", children: x() }),
2694
- y && /* @__PURE__ */ l(dr, { chatId: y, onMessageSent: q })
2695
- ] }) : /* @__PURE__ */ l(
2689
+ /* @__PURE__ */ h.jsx("div", { className: "chat-widget-body", children: w() }),
2690
+ v && /* @__PURE__ */ h.jsx(Zs, { chatId: v, onMessageSent: $ })
2691
+ ] }) : /* @__PURE__ */ h.jsx(
2696
2692
  "button",
2697
2693
  {
2698
2694
  type: "button",
2699
2695
  className: "chat-widget-bubble",
2700
- onClick: G,
2696
+ onClick: B,
2701
2697
  "aria-label": "Open chat",
2702
- children: /* @__PURE__ */ l(te, { className: "chat-widget-bubble-icon" })
2698
+ children: /* @__PURE__ */ h.jsx(Ht, { className: "chat-widget-bubble-icon" })
2703
2699
  }
2704
2700
  );
2705
2701
  }
2706
- function br(t) {
2707
- return /* @__PURE__ */ l(ds, { client: yr, children: /* @__PURE__ */ l(vr, { ...t }) });
2702
+ function ar(t) {
2703
+ return /* @__PURE__ */ h.jsx(Ze, { client: ir, children: /* @__PURE__ */ h.jsx(nr, { ...t }) });
2708
2704
  }
2709
- const xr = ":host{--chat-position-offset-x: 20px;--chat-position-offset-y: 20px;position:fixed;z-index:9999;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;color:#fffffff2;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;inset:auto}:host:not([data-side]):not([data-vertical]){left:auto;right:var(--chat-position-offset-x, 20px);top:auto;bottom:var(--chat-position-offset-y, 20px)}:host[data-side=left][data-vertical=top]{left:var(--chat-position-offset-x, 20px);right:auto;top:var(--chat-position-offset-y, 20px);bottom:auto}:host[data-side=right][data-vertical=top]{left:auto;right:var(--chat-position-offset-x, 20px);top:var(--chat-position-offset-y, 20px);bottom:auto}:host[data-side=left][data-vertical=bottom]{left:var(--chat-position-offset-x, 20px);right:auto;top:auto;bottom:var(--chat-position-offset-y, 20px)}:host[data-side=right][data-vertical=bottom]{left:auto;right:var(--chat-position-offset-x, 20px);top:auto;bottom:var(--chat-position-offset-y, 20px)}:host[data-side=left]{left:var(--chat-position-offset-x, 20px);right:auto}:host[data-side=right]{left:auto;right:var(--chat-position-offset-x, 20px)}:host[data-vertical=top]{top:var(--chat-position-offset-y, 20px);bottom:auto}:host[data-vertical=bottom]{top:auto;bottom:var(--chat-position-offset-y, 20px)}:host[data-vertical=middle]{top:auto;bottom:var(--chat-position-offset-y, 20px)}:host[data-vertical=middle].chat-widget-open{top:50%;bottom:auto;transform:translateY(-50%)}:host[data-side=left][data-vertical=middle]{left:var(--chat-position-offset-x, 20px);right:auto;top:auto;bottom:var(--chat-position-offset-y, 20px)}:host[data-side=left][data-vertical=middle].chat-widget-open{left:var(--chat-position-offset-x, 20px);right:auto;top:50%;bottom:auto;transform:translateY(-50%)}:host[data-side=right][data-vertical=middle]{left:auto;right:var(--chat-position-offset-x, 20px);top:auto;bottom:var(--chat-position-offset-y, 20px)}:host[data-side=right][data-vertical=middle].chat-widget-open{left:auto;right:var(--chat-position-offset-x, 20px);top:50%;bottom:auto;transform:translateY(-50%)}.chat-widget-bubble{display:flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:50%;background:#000000a6;background-blend-mode:overlay;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);color:#fffffff2;border:.5px solid rgba(255,255,255,.1);cursor:pointer;box-shadow:0 4px 12px #00000026;will-change:transform;transition:transform .2s ease,box-shadow .2s ease,background .2s ease}.chat-widget-bubble:hover{transform:scale(1.05);box-shadow:0 6px 16px #0003}.chat-widget-bubble:active{transform:scale(.98)}.chat-widget-bubble-icon{width:24px;height:24px}.chat-widget{display:flex;flex-direction:column;width:380px;height:520px;max-width:calc(100vw - 40px);max-height:calc(100vh - 100px);background:transparent;border:none;border-radius:16px;overflow:hidden;animation:chat-widget-open .2s ease-out}@keyframes chat-widget-open{0%{opacity:0;transform:translateY(10px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}.chat-widget-header{display:flex;align-items:center;justify-content:flex-end;padding:6px;background:transparent;border-bottom:none}.chat-widget-header-button{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;background:#000000a6;background-blend-mode:overlay;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);color:#fffffff2;border:.5px solid rgba(255,255,255,.1);cursor:pointer;box-shadow:0 4px 12px #00000026;will-change:transform;transition:transform .2s ease,box-shadow .2s ease,background .2s ease}.chat-widget-header-button:hover{transform:scale(1.05);background:#11111180;box-shadow:0 6px 16px #0003}.chat-widget-header-button:active{transform:scale(.98)}.chat-widget-header-icon{width:20px;height:20px}.chat-widget-body{flex:1;overflow:hidden;display:flex;flex-direction:column}.chat-messages-container{flex:1;overflow-y:auto;overflow-anchor:none;overscroll-behavior:contain;display:flex;flex-direction:column;padding:12px 12px 0}.chat-messages-spacer{flex-grow:1}.chat-message-card{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;margin-bottom:8px;background:#000000a6;background-blend-mode:overlay;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-radius:16px;border:.5px solid rgba(255,255,255,.1)}.chat-message-avatar{flex-shrink:0}.chat-message-avatar-img{width:36px;height:36px;border-radius:50%;background:#ffffff1a;object-fit:cover}.chat-message-content{flex:1;min-width:0}.chat-message-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:4px}.chat-message-username{font-size:13px;font-weight:500;color:#ffffffb3}.chat-message-time{font-size:11px;color:#fff9;flex-shrink:0}.chat-message-text{margin:0;font-size:14px;color:#fffffff2;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}.chat-message-text--title{font-weight:600;margin-bottom:4px}.chat-message-text--summary{color:#ffffffb3;margin-bottom:4px}.chat-message-username--link{cursor:pointer;text-decoration:underline;text-decoration-color:transparent;transition:text-decoration-color .15s ease}.chat-message-username--link:hover{text-decoration-color:currentColor}.chat-message-card--event{padding-left:12px}.chat-message-event-content{display:flex;flex-direction:column;gap:4px}.chat-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;padding:32px;text-align:center;margin:12px;background:#000000a6;background-blend-mode:overlay;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-radius:16px;border:.5px solid rgba(255,255,255,.1)}.chat-empty-icon{margin-bottom:12px}.chat-empty-svg{width:40px;height:40px;color:#ffffffb3}.chat-empty-title{margin:0 0 4px;font-size:15px;font-weight:600;color:#fffffff2}.chat-empty-text{margin:0;font-size:13px;color:#ffffffb3}.chat-retry-button{display:inline-flex;align-items:center;gap:6px;margin-top:12px;padding:8px 14px;font-size:13px;font-weight:500;color:#fffffff2;background:#000000a6;background-blend-mode:overlay;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:.5px solid rgba(255,255,255,.1);border-radius:8px;cursor:pointer;transition:border-color .15s ease}.chat-retry-button:hover{border-color:#fff3}.chat-retry-icon{width:14px;height:14px}.chat-spinner{width:24px;height:24px;color:#fffffff2;animation:chat-spinner-rotate 1s linear infinite}@keyframes chat-spinner-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.chat-input-container{border-top:none;background:transparent}.chat-input-wrapper{display:flex;flex-direction:column;background:#000000a6;background-blend-mode:overlay;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:.5px solid rgba(255,255,255,.1);border-radius:16px;overflow:hidden;transition:border-color .15s ease;min-width:0;max-width:100%}.chat-input-wrapper:focus-within{border-color:#fff3}.chat-input-textarea{width:100%;min-height:80px;max-height:120px;padding:10px 12px;font-size:16px;font-family:inherit;line-height:1.5;color:#fffffff2;background:transparent;border:none;resize:none;outline:none;box-sizing:border-box;overflow-wrap:break-word;word-wrap:break-word;overflow-x:hidden}.chat-input-textarea::placeholder{color:#ffffff80}.chat-input-textarea:disabled{opacity:.6;cursor:not-allowed}.chat-input-footer{display:flex;align-items:center;gap:8px;padding:8px 12px;background:transparent;border-top:1px solid rgba(255,255,255,.1)}.chat-input-avatar{flex-shrink:0}.chat-input-avatar-img{width:28px;height:28px;border-radius:50%;background:#ffffff1a;object-fit:cover}.chat-input-counter{font-size:12px;color:#ffffffb3;margin-left:auto}.chat-input-counter--error{color:#ff5757e6}.chat-input-divider{width:1px;height:16px;background:#ffffff1a}.chat-input-button{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;border-radius:50%;background:#4fff7e;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);color:#000000e6;cursor:pointer;transition:opacity .15s ease,transform .15s ease,background .15s ease}.chat-input-button:hover:not(:disabled){background:#3fe66a;opacity:1}.chat-input-button:active:not(:disabled){transform:scale(.95)}.chat-input-button:disabled{opacity:.5;cursor:not-allowed}.chat-input-icon{width:16px;height:16px}.chat-input-spinner{width:16px;height:16px;animation:chat-spinner-rotate 1s linear infinite}@media(max-width:480px){:host{inset:auto 10px 10px}:host .chat-widget{width:100%;max-width:none;height:calc(100vh - 80px);transform:none;top:auto;bottom:10px}.chat-widget-bubble{width:48px;height:48px}.chat-widget-bubble-icon{width:20px;height:20px}}";
2710
- let tt = null, w = null, st = null;
2711
- function Er(t, e) {
2712
- if (tt) {
2705
+ const or = ":host{--chat-position-offset-x: 20px;--chat-position-offset-y: 20px;position:fixed;z-index:9999;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;color:#fffffff2;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;inset:auto}:host:not([data-side]):not([data-vertical]){left:auto;right:var(--chat-position-offset-x, 20px);top:auto;bottom:var(--chat-position-offset-y, 20px)}:host[data-side=left][data-vertical=top]{left:var(--chat-position-offset-x, 20px);right:auto;top:var(--chat-position-offset-y, 20px);bottom:auto}:host[data-side=right][data-vertical=top]{left:auto;right:var(--chat-position-offset-x, 20px);top:var(--chat-position-offset-y, 20px);bottom:auto}:host[data-side=left][data-vertical=bottom]{left:var(--chat-position-offset-x, 20px);right:auto;top:auto;bottom:var(--chat-position-offset-y, 20px)}:host[data-side=right][data-vertical=bottom]{left:auto;right:var(--chat-position-offset-x, 20px);top:auto;bottom:var(--chat-position-offset-y, 20px)}:host[data-side=left]{left:var(--chat-position-offset-x, 20px);right:auto}:host[data-side=right]{left:auto;right:var(--chat-position-offset-x, 20px)}:host[data-vertical=top]{top:var(--chat-position-offset-y, 20px);bottom:auto}:host[data-vertical=bottom]{top:auto;bottom:var(--chat-position-offset-y, 20px)}:host[data-vertical=middle]{top:auto;bottom:var(--chat-position-offset-y, 20px)}:host[data-vertical=middle].chat-widget-open{top:50%;bottom:auto;transform:translateY(-50%)}:host[data-side=left][data-vertical=middle]{left:var(--chat-position-offset-x, 20px);right:auto;top:auto;bottom:var(--chat-position-offset-y, 20px)}:host[data-side=left][data-vertical=middle].chat-widget-open{left:var(--chat-position-offset-x, 20px);right:auto;top:50%;bottom:auto;transform:translateY(-50%)}:host[data-side=right][data-vertical=middle]{left:auto;right:var(--chat-position-offset-x, 20px);top:auto;bottom:var(--chat-position-offset-y, 20px)}:host[data-side=right][data-vertical=middle].chat-widget-open{left:auto;right:var(--chat-position-offset-x, 20px);top:50%;bottom:auto;transform:translateY(-50%)}.chat-widget-bubble{display:flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:50%;background:#000000a6;background-blend-mode:overlay;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);color:#fffffff2;border:.5px solid rgba(255,255,255,.1);cursor:pointer;box-shadow:0 4px 12px #00000026;will-change:transform;transition:transform .2s ease,box-shadow .2s ease,background .2s ease}.chat-widget-bubble:hover{transform:scale(1.05);box-shadow:0 6px 16px #0003}.chat-widget-bubble:active{transform:scale(.98)}.chat-widget-bubble-icon{width:24px;height:24px}.chat-widget{display:flex;flex-direction:column;width:380px;height:520px;max-width:calc(100vw - 40px);max-height:calc(100vh - 100px);background:transparent;border:none;border-radius:16px;overflow:hidden;animation:chat-widget-open .2s ease-out}@keyframes chat-widget-open{0%{opacity:0;transform:translateY(10px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}.chat-widget-header{display:flex;align-items:center;justify-content:flex-end;padding:6px;background:transparent;border-bottom:none}.chat-widget-header-button{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;background:#000000a6;background-blend-mode:overlay;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);color:#fffffff2;border:.5px solid rgba(255,255,255,.1);cursor:pointer;box-shadow:0 4px 12px #00000026;will-change:transform;transition:transform .2s ease,box-shadow .2s ease,background .2s ease}.chat-widget-header-button:hover{transform:scale(1.05);background:#11111180;box-shadow:0 6px 16px #0003}.chat-widget-header-button:active{transform:scale(.98)}.chat-widget-header-icon{width:20px;height:20px}.chat-widget-body{flex:1;overflow:hidden;display:flex;flex-direction:column}.chat-messages-container{flex:1;overflow-y:auto;overflow-anchor:none;overscroll-behavior:contain;display:flex;flex-direction:column;padding:12px 12px 0}.chat-messages-spacer{flex-grow:1}.chat-message-card{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;margin-bottom:8px;background:#000000a6;background-blend-mode:overlay;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-radius:16px;border:.5px solid rgba(255,255,255,.1)}.chat-message-avatar{flex-shrink:0}.chat-message-avatar-img{width:36px;height:36px;border-radius:50%;background:#ffffff1a;object-fit:cover}.chat-message-content{flex:1;min-width:0}.chat-message-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:4px}.chat-message-username{font-size:13px;font-weight:500;color:#ffffffb3}.chat-message-time{font-size:11px;color:#fff9;flex-shrink:0}.chat-message-text{margin:0;font-size:14px;color:#fffffff2;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}.chat-message-text--title{font-weight:600;margin-bottom:4px}.chat-message-text--summary{color:#ffffffb3;margin-bottom:4px}.chat-message-username--link{cursor:pointer;text-decoration:underline;text-decoration-color:transparent;transition:text-decoration-color .15s ease}.chat-message-username--link:hover{text-decoration-color:currentColor}.chat-message-card--event{padding-left:12px}.chat-message-event-content{display:flex;flex-direction:column;gap:4px}.chat-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;padding:32px;text-align:center;margin:12px;background:#000000a6;background-blend-mode:overlay;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-radius:16px;border:.5px solid rgba(255,255,255,.1)}.chat-empty-icon{margin-bottom:12px}.chat-empty-svg{width:40px;height:40px;color:#ffffffb3}.chat-empty-title{margin:0 0 4px;font-size:15px;font-weight:600;color:#fffffff2}.chat-empty-text{margin:0;font-size:13px;color:#ffffffb3}.chat-retry-button{display:inline-flex;align-items:center;gap:6px;margin-top:12px;padding:8px 14px;font-size:13px;font-weight:500;color:#fffffff2;background:#000000a6;background-blend-mode:overlay;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:.5px solid rgba(255,255,255,.1);border-radius:8px;cursor:pointer;transition:border-color .15s ease}.chat-retry-button:hover{border-color:#fff3}.chat-retry-icon{width:14px;height:14px}.chat-spinner{width:24px;height:24px;color:#fffffff2;animation:chat-spinner-rotate 1s linear infinite}@keyframes chat-spinner-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.chat-input-container{border-top:none;background:transparent}.chat-input-wrapper{display:flex;flex-direction:column;background:#000000a6;background-blend-mode:overlay;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:.5px solid rgba(255,255,255,.1);border-radius:16px;overflow:hidden;transition:border-color .15s ease;min-width:0;max-width:100%}.chat-input-wrapper:focus-within{border-color:#fff3}.chat-input-textarea{width:100%;min-height:80px;max-height:120px;padding:10px 12px;font-size:16px;font-family:inherit;line-height:1.5;color:#fffffff2;background:transparent;border:none;resize:none;outline:none;box-sizing:border-box;overflow-wrap:break-word;word-wrap:break-word;overflow-x:hidden}.chat-input-textarea::placeholder{color:#ffffff80}.chat-input-textarea:disabled{opacity:.6;cursor:not-allowed}.chat-input-footer{display:flex;align-items:center;gap:8px;padding:8px 12px;background:transparent;border-top:1px solid rgba(255,255,255,.1)}.chat-input-avatar{flex-shrink:0}.chat-input-avatar-img{width:28px;height:28px;border-radius:50%;background:#ffffff1a;object-fit:cover}.chat-input-counter{font-size:12px;color:#ffffffb3;margin-left:auto}.chat-input-counter--error{color:#ff5757e6}.chat-input-divider{width:1px;height:16px;background:#ffffff1a}.chat-input-button{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;border-radius:50%;background:#4fff7e;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);color:#000000e6;cursor:pointer;transition:opacity .15s ease,transform .15s ease,background .15s ease}.chat-input-button:hover:not(:disabled){background:#3fe66a;opacity:1}.chat-input-button:active:not(:disabled){transform:scale(.95)}.chat-input-button:disabled{opacity:.5;cursor:not-allowed}.chat-input-icon{width:16px;height:16px}.chat-input-spinner{width:16px;height:16px;animation:chat-spinner-rotate 1s linear infinite}@media(max-width:480px){:host{inset:auto 10px 10px}:host .chat-widget{width:100%;max-width:none;height:calc(100vh - 80px);transform:none;top:auto;bottom:10px}.chat-widget-bubble{width:48px;height:48px}.chat-widget-bubble-icon{width:20px;height:20px}}";
2706
+ let J = null, C = null, tt = null;
2707
+ function dr(t, e) {
2708
+ if (J) {
2713
2709
  console.warn("Chat widget already mounted");
2714
2710
  return;
2715
2711
  }
2716
- w = document.createElement("div"), w.id = "autogames-chat-widget", document.body.appendChild(w);
2717
- const s = e?.position || {}, r = s.side || "right", i = s.vertical || "bottom", n = s.offsetX ?? 20, o = s.offsetY ?? 20, a = w.attachShadow({ mode: "open" });
2718
- w.setAttribute("data-side", r), w.setAttribute("data-vertical", i), w.style.setProperty("--chat-position-offset-x", `${n}px`), w.style.setProperty("--chat-position-offset-y", `${o}px`), w.style.position = "fixed", w.style.zIndex = "9999", w.style.left = "auto", w.style.right = "auto", w.style.top = "auto", w.style.bottom = "auto", r === "left" ? (w.style.left = `${n}px`, w.style.right = "auto") : (w.style.left = "auto", w.style.right = `${n}px`), i === "top" ? (w.style.top = `${o}px`, w.style.bottom = "auto") : (i === "bottom" || i === "middle") && (w.style.top = "auto", w.style.bottom = `${o}px`);
2712
+ C = document.createElement("div"), C.id = "autogames-chat-widget", document.body.appendChild(C);
2713
+ const s = e?.position || {}, r = s.side || "right", i = s.vertical || "bottom", n = s.offsetX ?? 20, o = s.offsetY ?? 20, a = C.attachShadow({ mode: "open" });
2714
+ C.setAttribute("data-side", r), C.setAttribute("data-vertical", i), C.style.setProperty("--chat-position-offset-x", `${n}px`), C.style.setProperty("--chat-position-offset-y", `${o}px`), C.style.position = "fixed", C.style.zIndex = "9999", C.style.left = "auto", C.style.right = "auto", C.style.top = "auto", C.style.bottom = "auto", r === "left" ? (C.style.left = `${n}px`, C.style.right = "auto") : (C.style.left = "auto", C.style.right = `${n}px`), i === "top" ? (C.style.top = `${o}px`, C.style.bottom = "auto") : (i === "bottom" || i === "middle") && (C.style.top = "auto", C.style.bottom = `${o}px`);
2719
2715
  const u = document.createElement("style");
2720
- u.textContent = xr, a.appendChild(u);
2721
- const h = document.createElement("div");
2722
- h.id = "chat-widget-root", a.appendChild(h), st = h, tt = Ue.createRoot(h), tt.render(
2723
- /* @__PURE__ */ l(qe, { children: /* @__PURE__ */ l(
2724
- br,
2716
+ u.textContent = or, a.appendChild(u);
2717
+ const l = document.createElement("div");
2718
+ l.id = "chat-widget-root", a.appendChild(l), tt = l, J = Pe.createRoot(l), J.render(
2719
+ /* @__PURE__ */ h.jsx(f.StrictMode, { children: /* @__PURE__ */ h.jsx(
2720
+ ar,
2725
2721
  {
2726
2722
  gameId: t,
2727
- onClose: () => wr(),
2723
+ onClose: () => cr(),
2728
2724
  onOpenChange: (c) => {
2729
- if (st && (c ? st.classList.add("chat-widget-open") : st.classList.remove("chat-widget-open")), w) {
2725
+ if (tt && (c ? tt.classList.add("chat-widget-open") : tt.classList.remove("chat-widget-open")), C) {
2730
2726
  if (c)
2731
- w.classList.add("chat-widget-open"), w.getAttribute("data-vertical") === "middle" && (w.style.top = "50%", w.style.bottom = "auto", w.style.transform = "translateY(-50%)");
2732
- else if (w.classList.remove("chat-widget-open"), w.getAttribute("data-vertical") === "middle") {
2733
- const C = w.style.getPropertyValue("--chat-position-offset-y") || "20px";
2734
- w.style.top = "auto", w.style.bottom = C, w.style.transform = "none";
2727
+ C.classList.add("chat-widget-open"), C.getAttribute("data-vertical") === "middle" && (C.style.top = "50%", C.style.bottom = "auto", C.style.transform = "translateY(-50%)");
2728
+ else if (C.classList.remove("chat-widget-open"), C.getAttribute("data-vertical") === "middle") {
2729
+ const S = C.style.getPropertyValue("--chat-position-offset-y") || "20px";
2730
+ C.style.top = "auto", C.style.bottom = S, C.style.transform = "none";
2735
2731
  }
2736
2732
  }
2737
2733
  }
@@ -2739,10 +2735,10 @@ function Er(t, e) {
2739
2735
  ) })
2740
2736
  );
2741
2737
  }
2742
- function wr() {
2743
- tt && (tt.unmount(), tt = null), w && (w.remove(), w = null), st = null;
2738
+ function cr() {
2739
+ J && (J.unmount(), J = null), C && (C.remove(), C = null), tt = null;
2744
2740
  }
2745
2741
  export {
2746
- Er as mountChatWidget,
2747
- wr as unmountChatWidget
2742
+ dr as mountChatWidget,
2743
+ cr as unmountChatWidget
2748
2744
  };