@veevarts/design-system 1.8.0-dev.2 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx as u, jsxs as A, Fragment as Je } from "react/jsx-runtime";
2
- import { HeroUIProvider as ml, Button as gl, cn as F, Select as pi, SelectItem as mi, Alert as In, Card as Ee, CardBody as Le, Divider as As, Tooltip as Tt, Dropdown as Ns, DropdownTrigger as Es, DropdownMenu as Ts, DropdownItem as Ms, Input as ur, Popover as Os, PopoverTrigger as Is, PopoverContent as Ds, ButtonGroup as yl, useInput as bl, NumberInput as Ls, CardHeader as Fs, Image as xl, CardFooter as kl, Chip as gi, Skeleton as me, Autocomplete as vl, AutocompleteItem as Sl, Checkbox as Cl, Switch as wl } from "@heroui/react";
2
+ import { HeroUIProvider as ml, Button as gl, cn as L, Select as pi, SelectItem as mi, Alert as In, Card as Ee, CardBody as Le, Divider as As, Tooltip as Tt, Dropdown as Ns, DropdownTrigger as Es, DropdownMenu as Ts, DropdownItem as Ms, Input as ur, Popover as Os, PopoverTrigger as Is, PopoverContent as Ds, ButtonGroup as yl, useInput as bl, NumberInput as Ls, CardHeader as Fs, Image as xl, CardFooter as kl, Chip as gi, Skeleton as me, Autocomplete as vl, AutocompleteItem as Sl, Checkbox as Cl, Switch as wl } from "@heroui/react";
3
3
  export * from "@heroui/react";
4
- import B, { forwardRef as tn, useState as J, useRef as It, useEffect as qe, useReducer as Al, useCallback as ce, useMemo as mt, createElement as dr, useId as Nl } from "react";
4
+ import B, { forwardRef as tn, useState as J, useRef as It, useEffect as qe, useReducer as Al, useCallback as ce, useMemo as it, createElement as dr, useId as Nl } from "react";
5
5
  import { Globe as yi, User as bi, Heading as Ps, Check as Rs, ListTodo as $s, ListOrdered as Vs, List as Pr, AlignJustify as El, AlignRight as Tl, AlignCenter as Ml, AlignLeft as zs, CornerDownLeft as Ol, Redo2 as Il, Undo2 as Dl, Eraser as xi, Minus as Ll, Quote as Fl, CodeSquare as Pl, FileText as Rl, Link2 as $l, Highlighter as Bs, Palette as _s, Code as Vl, Underline as zl, Strikethrough as Bl, Italic as _l, Bold as Hl, X as Ul, ZoomOut as ql, ZoomIn as Kl, Link as jl, Clock as ki, CheckCircle as Wl, AlertCircle as Jl } from "lucide-react";
6
6
  import { LazyMotion as Gl, domAnimation as Zl, m as fr, motion as hr, AnimatePresence as pr } from "framer-motion";
7
7
  import { EditorProvider as Ql, useCurrentEditor as Hs } from "@tiptap/react";
@@ -143,7 +143,7 @@ function ph({
143
143
  "nav",
144
144
  {
145
145
  "data-testid": "navbar",
146
- className: F(
146
+ className: L(
147
147
  "w-full px-4 md:px-8 py-3 bg-white border-b border-zinc-100 flex items-center justify-between",
148
148
  d
149
149
  ),
@@ -191,9 +191,9 @@ function $r(t, e, n) {
191
191
  ha(() => {
192
192
  s.current = a;
193
193
  });
194
- let [, c] = Al(() => ({}), {}), d = ce((f, ...p) => {
194
+ let [, c] = Al(() => ({}), {}), d = ce((f, ...h) => {
195
195
  let m = typeof f == "function" ? f(s.current) : f;
196
- Object.is(s.current, m) || (s.current = m, i(m), c(), n?.(m, ...p));
196
+ Object.is(s.current, m) || (s.current = m, i(m), c(), n?.(m, ...h));
197
197
  }, [
198
198
  n
199
199
  ]);
@@ -234,9 +234,9 @@ const ma = B.forwardRef(
234
234
  isDisabled: c = !1,
235
235
  ...d
236
236
  }, f) => {
237
- const [p, m] = $r(s, n, i), v = B.useMemo(() => {
238
- let b, y;
239
- const x = [
237
+ const [h, m] = $r(s, n, i), v = B.useMemo(() => {
238
+ let y, b;
239
+ const k = [
240
240
  "[--active-fg-color:hsl(var(--step-fg-color))]",
241
241
  "[--active-border-color:hsl(var(--step-color))]",
242
242
  "[--active-color:hsl(var(--step-color))]",
@@ -247,35 +247,35 @@ const ma = B.forwardRef(
247
247
  ];
248
248
  switch (t) {
249
249
  case "primary":
250
- b = "[--step-color:var(--heroui-primary)]", y = "[--step-fg-color:var(--heroui-primary-foreground)]";
250
+ y = "[--step-color:var(--heroui-primary)]", b = "[--step-fg-color:var(--heroui-primary-foreground)]";
251
251
  break;
252
252
  case "secondary":
253
- b = "[--step-color:var(--heroui-secondary)]", y = "[--step-fg-color:var(--heroui-secondary-foreground)]";
253
+ y = "[--step-color:var(--heroui-secondary)]", b = "[--step-fg-color:var(--heroui-secondary-foreground)]";
254
254
  break;
255
255
  case "success":
256
- b = "[--step-color:var(--heroui-success)]", y = "[--step-fg-color:var(--heroui-success-foreground)]";
256
+ y = "[--step-color:var(--heroui-success)]", b = "[--step-fg-color:var(--heroui-success-foreground)]";
257
257
  break;
258
258
  case "warning":
259
- b = "[--step-color:var(--heroui-warning)]", y = "[--step-fg-color:var(--heroui-warning-foreground)]";
259
+ y = "[--step-color:var(--heroui-warning)]", b = "[--step-fg-color:var(--heroui-warning-foreground)]";
260
260
  break;
261
261
  case "danger":
262
- b = "[--step-color:var(--heroui-danger)]", y = "[--step-fg-color:var(--heroui-danger-foreground)]";
262
+ y = "[--step-color:var(--heroui-danger)]", b = "[--step-fg-color:var(--heroui-danger-foreground)]";
263
263
  break;
264
264
  case "default":
265
- b = "[--step-color:var(--heroui-default)]", y = "[--step-fg-color:var(--heroui-default-foreground)]";
265
+ y = "[--step-color:var(--heroui-default)]", b = "[--step-fg-color:var(--heroui-default-foreground)]";
266
266
  break;
267
267
  default:
268
- b = "[--step-color:var(--heroui-primary)]", y = "[--step-fg-color:var(--heroui-primary-foreground)]";
268
+ y = "[--step-color:var(--heroui-primary)]", b = "[--step-fg-color:var(--heroui-primary-foreground)]";
269
269
  break;
270
270
  }
271
- return x.unshift(y), x.unshift(b), x;
271
+ return k.unshift(b), k.unshift(y), k;
272
272
  }, [t]);
273
273
  return /* @__PURE__ */ A(
274
274
  "nav",
275
275
  {
276
276
  ref: f,
277
277
  "aria-label": "Progress",
278
- className: F("flex max-w-fit items-center overflow-x-auto", a),
278
+ className: L("flex max-w-fit items-center overflow-x-auto", a),
279
279
  "data-testid": "stepper-root",
280
280
  ...d,
281
281
  children: [
@@ -287,34 +287,34 @@ const ma = B.forwardRef(
287
287
  children: r
288
288
  }
289
289
  ),
290
- /* @__PURE__ */ u("ol", { className: F("flex flex-row flex-nowrap gap-x-3", v, a), "data-testid": "stepper-list", children: Array.from({ length: e })?.map((b, y) => {
291
- const x = p === y ? "active" : p < y ? "inactive" : "complete";
290
+ /* @__PURE__ */ u("ol", { className: L("flex flex-row flex-nowrap gap-x-3", v, a), "data-testid": "stepper-list", children: Array.from({ length: e })?.map((y, b) => {
291
+ const k = h === b ? "active" : h < b ? "inactive" : "complete";
292
292
  return /* @__PURE__ */ u(
293
293
  "li",
294
294
  {
295
295
  className: "relative flex shrink-0 items-center pr-12",
296
- "data-testid": `stepper-step-${y}`,
296
+ "data-testid": `stepper-step-${b}`,
297
297
  children: /* @__PURE__ */ A(
298
298
  "button",
299
299
  {
300
- "aria-current": x === "active" ? "step" : void 0,
301
- className: F(
300
+ "aria-current": k === "active" ? "step" : void 0,
301
+ className: L(
302
302
  "group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5",
303
303
  { "cursor-not-allowed opacity-50": c },
304
304
  l
305
305
  ),
306
- onClick: () => !c && m(y),
306
+ onClick: () => !c && m(b),
307
307
  disabled: c,
308
- "data-testid": `stepper-step-btn-${y}`,
308
+ "data-testid": `stepper-step-btn-${b}`,
309
309
  children: [
310
- /* @__PURE__ */ u("div", { className: "h-full relative flex items-center", children: /* @__PURE__ */ u(Gl, { features: Zl, children: /* @__PURE__ */ u(fr.div, { animate: x, className: "relative", children: /* @__PURE__ */ u(
310
+ /* @__PURE__ */ u("div", { className: "h-full relative flex items-center", children: /* @__PURE__ */ u(Gl, { features: Zl, children: /* @__PURE__ */ u(fr.div, { animate: k, className: "relative", children: /* @__PURE__ */ u(
311
311
  fr.div,
312
312
  {
313
- animate: x,
314
- className: F(
313
+ animate: k,
314
+ className: L(
315
315
  "border-medium text-large text-default-foreground relative flex h-[26px] w-[26px] items-center justify-center rounded-full font-semibold",
316
316
  {
317
- "shadow-lg": x === "complete"
317
+ "shadow-lg": k === "complete"
318
318
  }
319
319
  ),
320
320
  initial: !1,
@@ -336,16 +336,16 @@ const ma = B.forwardRef(
336
336
  color: "var(--active-fg-color)"
337
337
  }
338
338
  },
339
- children: /* @__PURE__ */ u("div", { className: "flex items-center justify-center", children: x === "complete" ? /* @__PURE__ */ u(
339
+ children: /* @__PURE__ */ u("div", { className: "flex items-center justify-center", children: k === "complete" ? /* @__PURE__ */ u(
340
340
  pa,
341
341
  {
342
342
  className: "h-5 w-5 text-(--active-fg-color)",
343
- "data-testid": `stepper-step-check-${y}`
343
+ "data-testid": `stepper-step-check-${b}`
344
344
  }
345
345
  ) : /* @__PURE__ */ u("span", {}) })
346
346
  }
347
347
  ) }) }) }),
348
- y < e - 1 && !o && /* @__PURE__ */ u(
348
+ b < e - 1 && !o && /* @__PURE__ */ u(
349
349
  "div",
350
350
  {
351
351
  "aria-hidden": "true",
@@ -353,16 +353,16 @@ const ma = B.forwardRef(
353
353
  style: {
354
354
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
355
355
  // @ts-expect-error
356
- "--idx": y
356
+ "--idx": b
357
357
  },
358
358
  children: /* @__PURE__ */ u(
359
359
  "div",
360
360
  {
361
- className: F(
361
+ className: L(
362
362
  "bg-default-200 relative h-0.5 w-full transition-colors duration-300",
363
363
  "after:absolute after:block after:h-full after:w-0 after:bg-(--active-border-color) after:transition-[width] after:duration-300 after:content-['']",
364
364
  {
365
- "after:w-full": y < p
365
+ "after:w-full": b < h
366
366
  }
367
367
  )
368
368
  }
@@ -371,10 +371,10 @@ const ma = B.forwardRef(
371
371
  )
372
372
  ]
373
373
  },
374
- y
374
+ b
375
375
  )
376
376
  },
377
- y
377
+ b
378
378
  );
379
379
  }) })
380
380
  ]
@@ -408,7 +408,7 @@ function yh() {
408
408
  );
409
409
  }
410
410
  const bh = (t) => {
411
- const e = mt(
411
+ const e = it(
412
412
  () => JSON.stringify({ allItems: t.allItems, selected: t.selected }),
413
413
  [t.allItems, t.selected]
414
414
  );
@@ -422,64 +422,64 @@ const bh = (t) => {
422
422
  }) => {
423
423
  const [s, o] = J([]), [l, a] = J([]), [c, d] = J(
424
424
  null
425
- ), [f, p] = J(
425
+ ), [f, h] = J(
426
426
  null
427
- ), m = mt(() => new Set(e), [e]), v = mt(() => new Set(t), [t]), b = mt(
428
- () => t.filter((P) => !m.has(P)),
427
+ ), m = it(() => new Set(e), [e]), v = it(() => new Set(t), [t]), y = it(
428
+ () => t.filter((V) => !m.has(V)),
429
429
  [t, m]
430
- ), y = (P) => {
431
- if (P.length === 0) return;
432
- const I = Array.from(/* @__PURE__ */ new Set([...e, ...P]));
433
- n(I);
434
- }, x = (P) => {
435
- if (P.length === 0) return;
436
- const I = new Set(P);
437
- n(e.filter((R) => !I.has(R)));
430
+ ), b = (V) => {
431
+ if (V.length === 0) return;
432
+ const M = Array.from(/* @__PURE__ */ new Set([...e, ...V]));
433
+ n(M);
434
+ }, k = (V) => {
435
+ if (V.length === 0) return;
436
+ const M = new Set(V);
437
+ n(e.filter((P) => !M.has(P)));
438
+ }, S = () => {
439
+ s.length !== 0 && (b(s), o([]));
440
+ }, I = () => {
441
+ l.length !== 0 && (k(l), a([]));
438
442
  }, C = () => {
439
- s.length !== 0 && (y(s), o([]));
443
+ y.length !== 0 && (b(y), o([]));
440
444
  }, w = () => {
441
- l.length !== 0 && (x(l), a([]));
442
- }, S = () => {
443
- b.length !== 0 && (y(b), o([]));
444
- }, N = () => {
445
445
  e.length !== 0 && (n([]), a([]));
446
- }, T = (P, I, R) => {
447
- const $ = Math.min(I, R), _ = Math.max(I, R);
448
- return P.slice($, _ + 1);
449
- }, O = (P, I, R) => {
450
- if (R && c !== null) {
451
- o(T(b, c, I)), a([]), d(I);
446
+ }, T = (V, M, P) => {
447
+ const R = Math.min(M, P), H = Math.max(M, P);
448
+ return V.slice(R, H + 1);
449
+ }, N = (V, M, P) => {
450
+ if (P && c !== null) {
451
+ o(T(y, c, M)), a([]), d(M);
452
452
  return;
453
453
  }
454
- const $ = s.includes(P);
454
+ const R = s.includes(V);
455
455
  o(
456
- $ ? s.filter((_) => _ !== P) : [...s, P]
457
- ), a([]), d(I);
458
- }, V = (P, I, R) => {
459
- if (R && f !== null) {
460
- a(T(e, f, I)), o([]), p(I);
456
+ R ? s.filter((H) => H !== V) : [...s, V]
457
+ ), a([]), d(M);
458
+ }, $ = (V, M, P) => {
459
+ if (P && f !== null) {
460
+ a(T(e, f, M)), o([]), h(M);
461
461
  return;
462
462
  }
463
- const $ = l.includes(P);
463
+ const R = l.includes(V);
464
464
  a(
465
- $ ? l.filter((_) => _ !== P) : [...l, P]
466
- ), o([]), p(I);
467
- }, H = (P, I, R) => {
468
- const $ = R === "available" ? s.includes(I) ? s : [I] : l.includes(I) ? l : [I];
469
- P.dataTransfer.setData(
465
+ R ? l.filter((H) => H !== V) : [...l, V]
466
+ ), o([]), h(M);
467
+ }, _ = (V, M, P) => {
468
+ const R = P === "available" ? s.includes(M) ? s : [M] : l.includes(M) ? l : [M];
469
+ V.dataTransfer.setData(
470
470
  "text/plain",
471
- JSON.stringify({ source: R, items: $ })
472
- ), P.dataTransfer.effectAllowed = "move";
473
- }, U = (P, I) => {
474
- P.preventDefault();
475
- const R = P.dataTransfer.getData("text/plain");
476
- if (R)
471
+ JSON.stringify({ source: P, items: R })
472
+ ), V.dataTransfer.effectAllowed = "move";
473
+ }, U = (V, M) => {
474
+ V.preventDefault();
475
+ const P = V.dataTransfer.getData("text/plain");
476
+ if (P)
477
477
  try {
478
- const $ = JSON.parse(R), _ = ($.items || []).filter(
479
- (X) => v.has(X)
478
+ const R = JSON.parse(P), H = (R.items || []).filter(
479
+ (Q) => v.has(Q)
480
480
  );
481
- if (_.length === 0 || $.source === I) return;
482
- I === "selected" ? (y(_), o([])) : (x(_), a([]));
481
+ if (H.length === 0 || R.source === M) return;
482
+ M === "selected" ? (b(H), o([])) : (k(H), a([]));
483
483
  } catch {
484
484
  return;
485
485
  }
@@ -491,26 +491,26 @@ const bh = (t) => {
491
491
  Le,
492
492
  {
493
493
  className: "h-60 gap-2 overflow-y-auto",
494
- onDragOver: (P) => P.preventDefault(),
495
- onDrop: (P) => U(P, "available"),
496
- children: b.map((P, I) => {
497
- const R = s.includes(P);
494
+ onDragOver: (V) => V.preventDefault(),
495
+ onDrop: (V) => U(V, "available"),
496
+ children: y.map((V, M) => {
497
+ const P = s.includes(V);
498
498
  return /* @__PURE__ */ u(
499
499
  "button",
500
500
  {
501
501
  type: "button",
502
- onClick: ($) => {
503
- O(P, I, $.shiftKey);
502
+ onClick: (R) => {
503
+ N(V, M, R.shiftKey);
504
504
  },
505
- onMouseDown: ($) => {
506
- $.shiftKey && $.preventDefault();
505
+ onMouseDown: (R) => {
506
+ R.shiftKey && R.preventDefault();
507
507
  },
508
508
  draggable: !0,
509
- onDragStart: ($) => H($, P, "available"),
510
- className: `rounded-md px-3 py-2 text-left text-sm transition ${R ? "bg-[#E4571E]/10 text-[#E4571E]" : "text-gray-700 hover:bg-gray-100"}`,
511
- children: P
509
+ onDragStart: (R) => _(R, V, "available"),
510
+ className: `rounded-md px-3 py-2 text-left text-sm transition ${P ? "bg-[#E4571E]/10 text-[#E4571E]" : "text-gray-700 hover:bg-gray-100"}`,
511
+ children: V
512
512
  },
513
- P
513
+ V
514
514
  );
515
515
  })
516
516
  }
@@ -524,7 +524,7 @@ const bh = (t) => {
524
524
  className: "h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",
525
525
  isIconOnly: !0,
526
526
  "data-testid": "move-selected-to-available",
527
- onPress: C,
527
+ onPress: S,
528
528
  isDisabled: s.length === 0,
529
529
  "aria-label": "Move selected to right",
530
530
  children: "›"
@@ -537,7 +537,7 @@ const bh = (t) => {
537
537
  className: "h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",
538
538
  isIconOnly: !0,
539
539
  "data-testid": "move-selected-to-available",
540
- onPress: w,
540
+ onPress: I,
541
541
  isDisabled: l.length === 0,
542
542
  "aria-label": "Move selected to left",
543
543
  children: "‹"
@@ -550,8 +550,8 @@ const bh = (t) => {
550
550
  className: "h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",
551
551
  isIconOnly: !0,
552
552
  "data-testid": "move-all-to-selected",
553
- onPress: S,
554
- isDisabled: b.length === 0,
553
+ onPress: C,
554
+ isDisabled: y.length === 0,
555
555
  "aria-label": "Move all to right",
556
556
  children: "»"
557
557
  }
@@ -562,7 +562,7 @@ const bh = (t) => {
562
562
  variant: "light",
563
563
  className: "h-10 w-10 min-w-0 text-2xl font-semibold text-[#E4571E] hover:bg-[#E4571E]/10",
564
564
  isIconOnly: !0,
565
- onPress: N,
565
+ onPress: w,
566
566
  "data-testid": "move-all-to-available",
567
567
  isDisabled: e.length === 0,
568
568
  "aria-label": "Move all to left",
@@ -576,26 +576,26 @@ const bh = (t) => {
576
576
  Le,
577
577
  {
578
578
  className: "h-60 gap-2 overflow-y-auto",
579
- onDragOver: (P) => P.preventDefault(),
580
- onDrop: (P) => U(P, "selected"),
581
- children: e.map((P, I) => {
582
- const R = l.includes(P);
579
+ onDragOver: (V) => V.preventDefault(),
580
+ onDrop: (V) => U(V, "selected"),
581
+ children: e.map((V, M) => {
582
+ const P = l.includes(V);
583
583
  return /* @__PURE__ */ u(
584
584
  "button",
585
585
  {
586
586
  type: "button",
587
- onClick: ($) => {
588
- V(P, I, $.shiftKey);
587
+ onClick: (R) => {
588
+ $(V, M, R.shiftKey);
589
589
  },
590
- onMouseDown: ($) => {
591
- $.shiftKey && $.preventDefault();
590
+ onMouseDown: (R) => {
591
+ R.shiftKey && R.preventDefault();
592
592
  },
593
593
  draggable: !0,
594
- onDragStart: ($) => H($, P, "selected"),
595
- className: `rounded-md px-3 py-2 text-left text-sm transition ${R ? "bg-[#E4571E]/10 text-[#E4571E]" : "text-gray-700 hover:bg-gray-100"}`,
596
- children: P
594
+ onDragStart: (R) => _(R, V, "selected"),
595
+ className: `rounded-md px-3 py-2 text-left text-sm transition ${P ? "bg-[#E4571E]/10 text-[#E4571E]" : "text-gray-700 hover:bg-gray-100"}`,
596
+ children: V
597
597
  },
598
- P
598
+ V
599
599
  );
600
600
  })
601
601
  }
@@ -606,10 +606,10 @@ const bh = (t) => {
606
606
  function Jt(t) {
607
607
  return typeof t == "string" ? t : t.type;
608
608
  }
609
- function at({ className: t }) {
609
+ function ct({ className: t }) {
610
610
  return /* @__PURE__ */ u("div", { className: `flex items-center h-6 ${t || ""}`, children: /* @__PURE__ */ u(As, { orientation: "vertical" }) });
611
611
  }
612
- function ct({
612
+ function ut({
613
613
  icon: t,
614
614
  label: e,
615
615
  isActive: n = !1,
@@ -1124,17 +1124,17 @@ function Aa({ value: t, onChange: e, onApply: n, placeholder: r = "#000000" }) {
1124
1124
  ] });
1125
1125
  }
1126
1126
  function Ci({ editor: t, type: e, allowCustomColor: n = !0, label: r, isDisabled: i = !1 }) {
1127
- const [s, o] = J(!1), [l, a] = J(""), c = e === "textColor" ? va : Sa, d = (b) => {
1128
- const y = Ze[e];
1129
- y && y.execute({
1130
- editor: t,
1131
- config: { type: e, color: b }
1132
- }), o(!1), a("");
1133
- }, f = (b) => {
1134
- d(b);
1135
- }, p = () => {
1127
+ const [s, o] = J(!1), [l, a] = J(""), c = e === "textColor" ? va : Sa, d = (y) => {
1136
1128
  const b = Ze[e];
1137
1129
  b && b.execute({
1130
+ editor: t,
1131
+ config: { type: e, color: y }
1132
+ }), o(!1), a("");
1133
+ }, f = (y) => {
1134
+ d(y);
1135
+ }, h = () => {
1136
+ const y = Ze[e];
1137
+ y && y.execute({
1138
1138
  editor: t,
1139
1139
  config: { type: e, color: "" }
1140
1140
  }), o(!1);
@@ -1162,7 +1162,7 @@ function Ci({ editor: t, type: e, allowCustomColor: n = !0, label: r, isDisabled
1162
1162
  size: "sm",
1163
1163
  variant: "light",
1164
1164
  isIconOnly: !0,
1165
- onPress: p,
1165
+ onPress: h,
1166
1166
  "aria-label": "Clear color",
1167
1167
  children: /* @__PURE__ */ u(Ul, { size: 16 })
1168
1168
  }
@@ -1253,21 +1253,21 @@ function Na({
1253
1253
  function Ea({ editor: t, isDisabled: e = !1 }) {
1254
1254
  const [n, r] = J(!1), [i, s] = J(""), [o, l] = J(""), [a, c] = J(!1), d = t.isActive("link"), f = (m) => {
1255
1255
  if (m) {
1256
- const { from: v, to: b } = t.state.selection, y = t.isActive("link");
1257
- let x = "";
1258
- if (y) {
1259
- const w = t.schema.marks.link, S = t.state.doc.resolve(v), N = vi(S, w);
1260
- N && (x = t.state.doc.textBetween(N.from, N.to, ""));
1256
+ const { from: v, to: y } = t.state.selection, b = t.isActive("link");
1257
+ let k = "";
1258
+ if (b) {
1259
+ const I = t.schema.marks.link, C = t.state.doc.resolve(v), w = vi(C, I);
1260
+ w && (k = t.state.doc.textBetween(w.from, w.to, ""));
1261
1261
  } else
1262
- x = t.state.doc.textBetween(v, b, "");
1263
- const C = t.getAttributes("link").href || "";
1264
- s(x), l(C), c(y);
1262
+ k = t.state.doc.textBetween(v, y, "");
1263
+ const S = t.getAttributes("link").href || "";
1264
+ s(k), l(S), c(b);
1265
1265
  }
1266
1266
  r(m);
1267
- }, p = () => {
1267
+ }, h = () => {
1268
1268
  if (o.trim()) {
1269
- const { from: m, to: v } = t.state.selection, b = t.schema.marks.link, y = t.state.doc.resolve(m), x = vi(y, b), C = x?.from ?? m, w = x?.to ?? v, S = t.state.doc.textBetween(C, w, "");
1270
- i.trim() && i !== S ? t.chain().focus().setTextSelection({ from: C, to: w }).deleteSelection().insertContent(`<a href="${o.trim()}">${i.trim()}</a>`).run() : t.chain().focus().extendMarkRange("link").updateAttributes("link", { href: o.trim() }).run();
1269
+ const { from: m, to: v } = t.state.selection, y = t.schema.marks.link, b = t.state.doc.resolve(m), k = vi(b, y), S = k?.from ?? m, I = k?.to ?? v, C = t.state.doc.textBetween(S, I, "");
1270
+ i.trim() && i !== C ? t.chain().focus().setTextSelection({ from: S, to: I }).deleteSelection().insertContent(`<a href="${o.trim()}">${i.trim()}</a>`).run() : t.chain().focus().extendMarkRange("link").updateAttributes("link", { href: o.trim() }).run();
1271
1271
  }
1272
1272
  r(!1);
1273
1273
  };
@@ -1311,7 +1311,7 @@ function Ea({ editor: t, isDisabled: e = !1 }) {
1311
1311
  placeholder: "https://example.com",
1312
1312
  value: o,
1313
1313
  onChange: (m) => l(m.target.value),
1314
- onKeyDown: (m) => m.key === "Enter" && p(),
1314
+ onKeyDown: (m) => m.key === "Enter" && h(),
1315
1315
  classNames: {
1316
1316
  inputWrapper: "focus-within:border-default-400"
1317
1317
  }
@@ -1322,7 +1322,7 @@ function Ea({ editor: t, isDisabled: e = !1 }) {
1322
1322
  {
1323
1323
  size: "sm",
1324
1324
  color: "primary",
1325
- onPress: p,
1325
+ onPress: h,
1326
1326
  isDisabled: !o.trim(),
1327
1327
  children: a ? "Update" : "Apply"
1328
1328
  }
@@ -1334,7 +1334,7 @@ function Ta({ children: t, id: e, label: n, className: r, useButtonGroup: i = !0
1334
1334
  return i ? /* @__PURE__ */ u(yl, { size: "sm", id: e, "aria-label": n, className: r, children: t }) : /* @__PURE__ */ u("div", { id: e, role: "group", "aria-label": n, className: `flex items-center gap-2 ${r || ""}`, children: t });
1335
1335
  }
1336
1336
  function Us(t, e) {
1337
- const n = mt(() => {
1337
+ const n = it(() => {
1338
1338
  if (!t)
1339
1339
  return {};
1340
1340
  const s = {};
@@ -1469,7 +1469,7 @@ function Ia({ editor: t, modifiers: e, onToolbarAction: n }) {
1469
1469
  return s.length === 0 ? null : /* @__PURE__ */ u(Ta, { id: "text-formatting", label: "Text formatting", children: s.map((o) => {
1470
1470
  const l = r[o], a = wt(o);
1471
1471
  return /* @__PURE__ */ u(
1472
- ct,
1472
+ ut,
1473
1473
  {
1474
1474
  icon: a,
1475
1475
  label: o.charAt(0).toUpperCase() + o.slice(1),
@@ -1492,7 +1492,7 @@ function Da({
1492
1492
  }) {
1493
1493
  const l = Us(t, e), { toggleModifier: a, executeCommand: c } = qs(t, o);
1494
1494
  if (!t) return null;
1495
- const d = e.map((O) => Jt(O)), f = d.some((O) => ["bold", "italic", "strike", "underline", "code"].includes(O)), p = d.some((O) => ["textColor", "highlight"].includes(O)), m = d.includes("heading"), v = d.includes("textAlign"), b = d.some((O) => ["bulletList", "orderedList", "taskList"].includes(O)), y = d.includes("blockquote"), x = d.includes("codeBlock"), C = d.includes("link"), w = d.includes("horizontalRule"), S = d.some((O) => ["undo", "redo"].includes(O)), N = n !== void 0 && r !== void 0;
1495
+ const d = e.map((N) => Jt(N)), f = d.some((N) => ["bold", "italic", "strike", "underline", "code"].includes(N)), h = d.some((N) => ["textColor", "highlight"].includes(N)), m = d.includes("heading"), v = d.includes("textAlign"), y = d.some((N) => ["bulletList", "orderedList", "taskList"].includes(N)), b = d.includes("blockquote"), k = d.includes("codeBlock"), S = d.includes("link"), I = d.includes("horizontalRule"), C = d.some((N) => ["undo", "redo"].includes(N)), w = n !== void 0 && r !== void 0;
1496
1496
  return /* @__PURE__ */ u("div", { className: `w-full p-2 bg-background border-b border-divider ${i ? "sticky top-0 z-10" : ""} ${s || ""}`, children: /* @__PURE__ */ A("div", { className: "flex flex-row flex-wrap gap-2 w-full items-center", children: [
1497
1497
  f && /* @__PURE__ */ A(Je, { children: [
1498
1498
  /* @__PURE__ */ u(
@@ -1503,9 +1503,9 @@ function Da({
1503
1503
  onToolbarAction: o
1504
1504
  }
1505
1505
  ),
1506
- (p || m || v || b || y || x || C || w || S || N) && /* @__PURE__ */ u(at, {})
1506
+ (h || m || v || y || b || k || S || I || C || w) && /* @__PURE__ */ u(ct, {})
1507
1507
  ] }),
1508
- p && /* @__PURE__ */ A(Je, { children: [
1508
+ h && /* @__PURE__ */ A(Je, { children: [
1509
1509
  /* @__PURE__ */ A("div", { className: "flex items-center gap-1", children: [
1510
1510
  d.includes("textColor") && /* @__PURE__ */ u(
1511
1511
  Ci,
@@ -1526,48 +1526,48 @@ function Da({
1526
1526
  }
1527
1527
  )
1528
1528
  ] }),
1529
- (m || v || b || y || x || C || w || S || N) && /* @__PURE__ */ u(at, {})
1529
+ (m || v || y || b || k || S || I || C || w) && /* @__PURE__ */ u(ct, {})
1530
1530
  ] }),
1531
1531
  m && /* @__PURE__ */ A(Je, { children: [
1532
1532
  /* @__PURE__ */ u(ba, { editor: t }),
1533
- (v || b || y || x || C || w || S || N) && /* @__PURE__ */ u(at, {})
1533
+ (v || y || b || k || S || I || C || w) && /* @__PURE__ */ u(ct, {})
1534
1534
  ] }),
1535
1535
  v && /* @__PURE__ */ A(Je, { children: [
1536
- /* @__PURE__ */ u("div", { className: "flex items-center gap-1", children: ["left", "center", "right", "justify"].map((O) => {
1537
- const V = wa[O], H = t.isActive({ textAlign: O });
1536
+ /* @__PURE__ */ u("div", { className: "flex items-center gap-1", children: ["left", "center", "right", "justify"].map((N) => {
1537
+ const $ = wa[N], _ = t.isActive({ textAlign: N });
1538
1538
  return /* @__PURE__ */ u(
1539
- ct,
1539
+ ut,
1540
1540
  {
1541
- icon: V,
1542
- label: `Align ${O}`,
1543
- isActive: H,
1541
+ icon: $,
1542
+ label: `Align ${N}`,
1543
+ isActive: _,
1544
1544
  onClick: () => c("textAlign", {
1545
1545
  type: "textAlign",
1546
1546
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1547
- alignment: O
1547
+ alignment: N
1548
1548
  })
1549
1549
  },
1550
- O
1550
+ N
1551
1551
  );
1552
1552
  }) }),
1553
- (b || y || x || C || w || S || N) && /* @__PURE__ */ u(at, {})
1553
+ (y || b || k || S || I || C || w) && /* @__PURE__ */ u(ct, {})
1554
1554
  ] }),
1555
- b && /* @__PURE__ */ A(Je, { children: [
1555
+ y && /* @__PURE__ */ A(Je, { children: [
1556
1556
  /* @__PURE__ */ u(
1557
1557
  xa,
1558
1558
  {
1559
1559
  editor: t,
1560
1560
  types: d.filter(
1561
- (O) => ["bulletList", "orderedList", "taskList"].includes(O)
1561
+ (N) => ["bulletList", "orderedList", "taskList"].includes(N)
1562
1562
  )
1563
1563
  }
1564
1564
  ),
1565
- (y || x || C || w || S || N) && /* @__PURE__ */ u(at, {})
1565
+ (b || k || S || I || C || w) && /* @__PURE__ */ u(ct, {})
1566
1566
  ] }),
1567
- (y || x || C || w) && /* @__PURE__ */ A(Je, { children: [
1567
+ (b || k || S || I) && /* @__PURE__ */ A(Je, { children: [
1568
1568
  /* @__PURE__ */ A("div", { className: "flex items-center gap-1", children: [
1569
- y && /* @__PURE__ */ u(
1570
- ct,
1569
+ b && /* @__PURE__ */ u(
1570
+ ut,
1571
1571
  {
1572
1572
  icon: wt("blockquote"),
1573
1573
  label: "Blockquote",
@@ -1576,8 +1576,8 @@ function Da({
1576
1576
  onClick: () => a("blockquote")
1577
1577
  }
1578
1578
  ),
1579
- x && /* @__PURE__ */ u(
1580
- ct,
1579
+ k && /* @__PURE__ */ u(
1580
+ ut,
1581
1581
  {
1582
1582
  icon: wt("codeBlock"),
1583
1583
  label: "Code block",
@@ -1586,15 +1586,15 @@ function Da({
1586
1586
  onClick: () => a("codeBlock")
1587
1587
  }
1588
1588
  ),
1589
- C && /* @__PURE__ */ u(
1589
+ S && /* @__PURE__ */ u(
1590
1590
  Ea,
1591
1591
  {
1592
1592
  editor: t,
1593
1593
  isDisabled: l.link?.isDisabled
1594
1594
  }
1595
1595
  ),
1596
- w && /* @__PURE__ */ u(
1597
- ct,
1596
+ I && /* @__PURE__ */ u(
1597
+ ut,
1598
1598
  {
1599
1599
  icon: wt("horizontalRule"),
1600
1600
  label: "Horizontal rule",
@@ -1602,12 +1602,12 @@ function Da({
1602
1602
  }
1603
1603
  )
1604
1604
  ] }),
1605
- (S || N) && /* @__PURE__ */ u(at, {})
1605
+ (C || w) && /* @__PURE__ */ u(ct, {})
1606
1606
  ] }),
1607
- S && /* @__PURE__ */ A(Je, { children: [
1607
+ C && /* @__PURE__ */ A(Je, { children: [
1608
1608
  /* @__PURE__ */ A("div", { className: "flex items-center gap-1", children: [
1609
1609
  d.includes("undo") && /* @__PURE__ */ u(
1610
- ct,
1610
+ ut,
1611
1611
  {
1612
1612
  icon: wt("undo"),
1613
1613
  label: "Undo",
@@ -1616,7 +1616,7 @@ function Da({
1616
1616
  }
1617
1617
  ),
1618
1618
  d.includes("redo") && /* @__PURE__ */ u(
1619
- ct,
1619
+ ut,
1620
1620
  {
1621
1621
  icon: wt("redo"),
1622
1622
  label: "Redo",
@@ -1625,14 +1625,14 @@ function Da({
1625
1625
  }
1626
1626
  )
1627
1627
  ] }),
1628
- N && /* @__PURE__ */ u(at, {})
1628
+ w && /* @__PURE__ */ u(ct, {})
1629
1629
  ] }),
1630
- N && /* @__PURE__ */ u(
1630
+ w && /* @__PURE__ */ u(
1631
1631
  Na,
1632
1632
  {
1633
1633
  zoom: n,
1634
- onZoomChange: (O) => {
1635
- r?.(O), o?.({ type: "zoom", modifier: `${O}%` });
1634
+ onZoomChange: (N) => {
1635
+ r?.(N), o?.({ type: "zoom", modifier: `${N}%` });
1636
1636
  }
1637
1637
  }
1638
1638
  )
@@ -3337,18 +3337,18 @@ function fn(t, e, n, r) {
3337
3337
  d = 2;
3338
3338
  for (let f in c)
3339
3339
  if (c[f] != null) {
3340
- let p = f.indexOf(" ");
3341
- p > 0 ? a.setAttributeNS(f.slice(0, p), f.slice(p + 1), c[f]) : f == "style" && a.style ? a.style.cssText = c[f] : a.setAttribute(f, c[f]);
3340
+ let h = f.indexOf(" ");
3341
+ h > 0 ? a.setAttributeNS(f.slice(0, h), f.slice(h + 1), c[f]) : f == "style" && a.style ? a.style.cssText = c[f] : a.setAttribute(f, c[f]);
3342
3342
  }
3343
3343
  }
3344
3344
  for (let f = d; f < e.length; f++) {
3345
- let p = e[f];
3346
- if (p === 0) {
3345
+ let h = e[f];
3346
+ if (h === 0) {
3347
3347
  if (f < e.length - 1 || f > d)
3348
3348
  throw new RangeError("Content hole must be the only child of its parent node");
3349
3349
  return { dom: a, contentDOM: a };
3350
3350
  } else {
3351
- let { dom: m, contentDOM: v } = fn(t, p, n, r);
3351
+ let { dom: m, contentDOM: v } = fn(t, h, n, r);
3352
3352
  if (a.appendChild(m), v) {
3353
3353
  if (l)
3354
3354
  throw new RangeError("Multiple content holes");
@@ -3442,11 +3442,11 @@ class Oe {
3442
3442
  break;
3443
3443
  let c = this.ranges[l + s], d = this.ranges[l + o], f = a + c;
3444
3444
  if (e <= f) {
3445
- let p = c ? e == a ? -1 : e == f ? 1 : n : n, m = a + i + (p < 0 ? 0 : d);
3445
+ let h = c ? e == a ? -1 : e == f ? 1 : n : n, m = a + i + (h < 0 ? 0 : d);
3446
3446
  if (r)
3447
3447
  return m;
3448
- let v = e == (n < 0 ? a : f) ? null : fc(l / 3, e - a), b = e == a ? eo : e == f ? Xs : hn;
3449
- return (n < 0 ? e != a : e != f) && (b |= to), new br(m, b, v);
3448
+ let v = e == (n < 0 ? a : f) ? null : fc(l / 3, e - a), y = e == a ? eo : e == f ? Xs : hn;
3449
+ return (n < 0 ? e != a : e != f) && (y |= to), new br(m, y, v);
3450
3450
  }
3451
3451
  i += d - c;
3452
3452
  }
@@ -3693,7 +3693,7 @@ function Vr(t, e, n) {
3693
3693
  }
3694
3694
  return q.fromArray(r);
3695
3695
  }
3696
- class dt extends be {
3696
+ class ft extends be {
3697
3697
  /**
3698
3698
  Create a mark step.
3699
3699
  */
@@ -3705,14 +3705,14 @@ class dt extends be {
3705
3705
  return ue.fromReplace(e, this.from, this.to, s);
3706
3706
  }
3707
3707
  invert() {
3708
- return new ft(this.from, this.to, this.mark);
3708
+ return new ht(this.from, this.to, this.mark);
3709
3709
  }
3710
3710
  map(e) {
3711
3711
  let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
3712
- return n.deleted && r.deleted || n.pos >= r.pos ? null : new dt(n.pos, r.pos, this.mark);
3712
+ return n.deleted && r.deleted || n.pos >= r.pos ? null : new ft(n.pos, r.pos, this.mark);
3713
3713
  }
3714
3714
  merge(e) {
3715
- return e instanceof dt && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new dt(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;
3715
+ return e instanceof ft && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new ft(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;
3716
3716
  }
3717
3717
  toJSON() {
3718
3718
  return {
@@ -3728,11 +3728,11 @@ class dt extends be {
3728
3728
  static fromJSON(e, n) {
3729
3729
  if (typeof n.from != "number" || typeof n.to != "number")
3730
3730
  throw new RangeError("Invalid input for AddMarkStep.fromJSON");
3731
- return new dt(n.from, n.to, e.markFromJSON(n.mark));
3731
+ return new ft(n.from, n.to, e.markFromJSON(n.mark));
3732
3732
  }
3733
3733
  }
3734
- be.jsonID("addMark", dt);
3735
- class ft extends be {
3734
+ be.jsonID("addMark", ft);
3735
+ class ht extends be {
3736
3736
  /**
3737
3737
  Create a mark-removing step.
3738
3738
  */
@@ -3744,14 +3744,14 @@ class ft extends be {
3744
3744
  return ue.fromReplace(e, this.from, this.to, r);
3745
3745
  }
3746
3746
  invert() {
3747
- return new dt(this.from, this.to, this.mark);
3747
+ return new ft(this.from, this.to, this.mark);
3748
3748
  }
3749
3749
  map(e) {
3750
3750
  let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
3751
- return n.deleted && r.deleted || n.pos >= r.pos ? null : new ft(n.pos, r.pos, this.mark);
3751
+ return n.deleted && r.deleted || n.pos >= r.pos ? null : new ht(n.pos, r.pos, this.mark);
3752
3752
  }
3753
3753
  merge(e) {
3754
- return e instanceof ft && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new ft(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;
3754
+ return e instanceof ht && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new ht(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;
3755
3755
  }
3756
3756
  toJSON() {
3757
3757
  return {
@@ -3767,11 +3767,11 @@ class ft extends be {
3767
3767
  static fromJSON(e, n) {
3768
3768
  if (typeof n.from != "number" || typeof n.to != "number")
3769
3769
  throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");
3770
- return new ft(n.from, n.to, e.markFromJSON(n.mark));
3770
+ return new ht(n.from, n.to, e.markFromJSON(n.mark));
3771
3771
  }
3772
3772
  }
3773
- be.jsonID("removeMark", ft);
3774
- class ht extends be {
3773
+ be.jsonID("removeMark", ht);
3774
+ class pt extends be {
3775
3775
  /**
3776
3776
  Create a node mark step.
3777
3777
  */
@@ -3792,15 +3792,15 @@ class ht extends be {
3792
3792
  if (r.length == n.marks.length) {
3793
3793
  for (let i = 0; i < n.marks.length; i++)
3794
3794
  if (!n.marks[i].isInSet(r))
3795
- return new ht(this.pos, n.marks[i]);
3796
- return new ht(this.pos, this.mark);
3795
+ return new pt(this.pos, n.marks[i]);
3796
+ return new pt(this.pos, this.mark);
3797
3797
  }
3798
3798
  }
3799
3799
  return new Zt(this.pos, this.mark);
3800
3800
  }
3801
3801
  map(e) {
3802
3802
  let n = e.mapResult(this.pos, 1);
3803
- return n.deletedAfter ? null : new ht(n.pos, this.mark);
3803
+ return n.deletedAfter ? null : new pt(n.pos, this.mark);
3804
3804
  }
3805
3805
  toJSON() {
3806
3806
  return { stepType: "addNodeMark", pos: this.pos, mark: this.mark.toJSON() };
@@ -3811,10 +3811,10 @@ class ht extends be {
3811
3811
  static fromJSON(e, n) {
3812
3812
  if (typeof n.pos != "number")
3813
3813
  throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");
3814
- return new ht(n.pos, e.markFromJSON(n.mark));
3814
+ return new pt(n.pos, e.markFromJSON(n.mark));
3815
3815
  }
3816
3816
  }
3817
- be.jsonID("addNodeMark", ht);
3817
+ be.jsonID("addNodeMark", pt);
3818
3818
  class Zt extends be {
3819
3819
  /**
3820
3820
  Create a mark-removing step.
@@ -3831,7 +3831,7 @@ class Zt extends be {
3831
3831
  }
3832
3832
  invert(e) {
3833
3833
  let n = e.nodeAt(this.pos);
3834
- return !n || !this.mark.isInSet(n.marks) ? this : new ht(this.pos, this.mark);
3834
+ return !n || !this.mark.isInSet(n.marks) ? this : new pt(this.pos, this.mark);
3835
3835
  }
3836
3836
  map(e) {
3837
3837
  let n = e.mapResult(this.pos, 1);
@@ -4077,7 +4077,7 @@ Qt.prototype = Object.create(Error.prototype);
4077
4077
  Qt.prototype.constructor = Qt;
4078
4078
  Qt.prototype.name = "TransformError";
4079
4079
  const Qn = /* @__PURE__ */ Object.create(null);
4080
- class Y {
4080
+ class X {
4081
4081
  /**
4082
4082
  Initialize a selection with the head and anchor and ranges. If no
4083
4083
  ranges are given, constructs a single range across `$anchor` and
@@ -4171,7 +4171,7 @@ class Y {
4171
4171
  found.
4172
4172
  */
4173
4173
  static findFrom(e, n, r = !1) {
4174
- let i = e.parent.inlineContent ? new Q(e) : At(e.node(0), e.parent, e.pos, e.index(), n, r);
4174
+ let i = e.parent.inlineContent ? new Y(e) : At(e.node(0), e.parent, e.pos, e.index(), n, r);
4175
4175
  if (i)
4176
4176
  return i;
4177
4177
  for (let s = e.depth - 1; s >= 0; s--) {
@@ -4238,10 +4238,10 @@ class Y {
4238
4238
  returns the bookmark for that.
4239
4239
  */
4240
4240
  getBookmark() {
4241
- return Q.between(this.$anchor, this.$head).getBookmark();
4241
+ return Y.between(this.$anchor, this.$head).getBookmark();
4242
4242
  }
4243
4243
  }
4244
- Y.prototype.visible = !0;
4244
+ X.prototype.visible = !0;
4245
4245
  class pc {
4246
4246
  /**
4247
4247
  Create a range.
@@ -4254,7 +4254,7 @@ let Pi = !1;
4254
4254
  function Ri(t) {
4255
4255
  !Pi && !t.parent.inlineContent && (Pi = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + t.parent.type.name + ")"));
4256
4256
  }
4257
- class Q extends Y {
4257
+ class Y extends X {
4258
4258
  /**
4259
4259
  Construct a text selection between the given points.
4260
4260
  */
@@ -4271,9 +4271,9 @@ class Q extends Y {
4271
4271
  map(e, n) {
4272
4272
  let r = e.resolve(n.map(this.head));
4273
4273
  if (!r.parent.inlineContent)
4274
- return Y.near(r);
4274
+ return X.near(r);
4275
4275
  let i = e.resolve(n.map(this.anchor));
4276
- return new Q(i.parent.inlineContent ? i : r, r);
4276
+ return new Y(i.parent.inlineContent ? i : r, r);
4277
4277
  }
4278
4278
  replace(e, n = K.empty) {
4279
4279
  if (super.replace(e, n), n == K.empty) {
@@ -4282,7 +4282,7 @@ class Q extends Y {
4282
4282
  }
4283
4283
  }
4284
4284
  eq(e) {
4285
- return e instanceof Q && e.anchor == this.anchor && e.head == this.head;
4285
+ return e instanceof Y && e.anchor == this.anchor && e.head == this.head;
4286
4286
  }
4287
4287
  getBookmark() {
4288
4288
  return new Ln(this.anchor, this.head);
@@ -4296,7 +4296,7 @@ class Q extends Y {
4296
4296
  static fromJSON(e, n) {
4297
4297
  if (typeof n.anchor != "number" || typeof n.head != "number")
4298
4298
  throw new RangeError("Invalid input for TextSelection.fromJSON");
4299
- return new Q(e.resolve(n.anchor), e.resolve(n.head));
4299
+ return new Y(e.resolve(n.anchor), e.resolve(n.head));
4300
4300
  }
4301
4301
  /**
4302
4302
  Create a text selection from non-resolved positions.
@@ -4316,16 +4316,16 @@ class Q extends Y {
4316
4316
  static between(e, n, r) {
4317
4317
  let i = e.pos - n.pos;
4318
4318
  if ((!r || i) && (r = i >= 0 ? 1 : -1), !n.parent.inlineContent) {
4319
- let s = Y.findFrom(n, r, !0) || Y.findFrom(n, -r, !0);
4319
+ let s = X.findFrom(n, r, !0) || X.findFrom(n, -r, !0);
4320
4320
  if (s)
4321
4321
  n = s.$head;
4322
4322
  else
4323
- return Y.near(n, r);
4323
+ return X.near(n, r);
4324
4324
  }
4325
- return e.parent.inlineContent || (i == 0 ? e = n : (e = (Y.findFrom(e, -r, !0) || Y.findFrom(e, r, !0)).$anchor, e.pos < n.pos != i < 0 && (e = n))), new Q(e, n);
4325
+ return e.parent.inlineContent || (i == 0 ? e = n : (e = (X.findFrom(e, -r, !0) || X.findFrom(e, r, !0)).$anchor, e.pos < n.pos != i < 0 && (e = n))), new Y(e, n);
4326
4326
  }
4327
4327
  }
4328
- Y.jsonID("text", Q);
4328
+ X.jsonID("text", Y);
4329
4329
  class Ln {
4330
4330
  constructor(e, n) {
4331
4331
  this.anchor = e, this.head = n;
@@ -4334,10 +4334,10 @@ class Ln {
4334
4334
  return new Ln(e.map(this.anchor), e.map(this.head));
4335
4335
  }
4336
4336
  resolve(e) {
4337
- return Q.between(e.resolve(this.anchor), e.resolve(this.head));
4337
+ return Y.between(e.resolve(this.anchor), e.resolve(this.head));
4338
4338
  }
4339
4339
  }
4340
- class j extends Y {
4340
+ class j extends X {
4341
4341
  /**
4342
4342
  Create a node selection. Does not verify the validity of its
4343
4343
  argument.
@@ -4348,7 +4348,7 @@ class j extends Y {
4348
4348
  }
4349
4349
  map(e, n) {
4350
4350
  let { deleted: r, pos: i } = n.mapResult(this.anchor), s = e.resolve(i);
4351
- return r ? Y.near(s) : new j(s);
4351
+ return r ? X.near(s) : new j(s);
4352
4352
  }
4353
4353
  content() {
4354
4354
  return new K(q.from(this.node), 0, 0);
@@ -4385,7 +4385,7 @@ class j extends Y {
4385
4385
  }
4386
4386
  }
4387
4387
  j.prototype.visible = !1;
4388
- Y.jsonID("node", j);
4388
+ X.jsonID("node", j);
4389
4389
  class zr {
4390
4390
  constructor(e) {
4391
4391
  this.anchor = e;
@@ -4396,10 +4396,10 @@ class zr {
4396
4396
  }
4397
4397
  resolve(e) {
4398
4398
  let n = e.resolve(this.anchor), r = n.nodeAfter;
4399
- return r && j.isSelectable(r) ? new j(n) : Y.near(n);
4399
+ return r && j.isSelectable(r) ? new j(n) : X.near(n);
4400
4400
  }
4401
4401
  }
4402
- class Ke extends Y {
4402
+ class Ke extends X {
4403
4403
  /**
4404
4404
  Create an all-selection over the given document.
4405
4405
  */
@@ -4409,7 +4409,7 @@ class Ke extends Y {
4409
4409
  replace(e, n = K.empty) {
4410
4410
  if (n == K.empty) {
4411
4411
  e.delete(0, e.doc.content.size);
4412
- let r = Y.atStart(e.doc);
4412
+ let r = X.atStart(e.doc);
4413
4413
  r.eq(e.selection) || e.setSelection(r);
4414
4414
  } else
4415
4415
  super.replace(e, n);
@@ -4433,7 +4433,7 @@ class Ke extends Y {
4433
4433
  return mc;
4434
4434
  }
4435
4435
  }
4436
- Y.jsonID("all", Ke);
4436
+ X.jsonID("all", Ke);
4437
4437
  const mc = {
4438
4438
  map() {
4439
4439
  return this;
@@ -4444,7 +4444,7 @@ const mc = {
4444
4444
  };
4445
4445
  function At(t, e, n, r, i, s = !1) {
4446
4446
  if (e.inlineContent)
4447
- return Q.create(t, n);
4447
+ return Y.create(t, n);
4448
4448
  for (let o = r - (i > 0 ? 0 : 1); i > 0 ? o < e.childCount : o >= 0; o += i) {
4449
4449
  let l = e.child(o);
4450
4450
  if (l.isAtom) {
@@ -4469,7 +4469,7 @@ function $i(t, e, n) {
4469
4469
  let s = t.mapping.maps[r], o;
4470
4470
  s.forEach((l, a, c, d) => {
4471
4471
  o == null && (o = d);
4472
- }), t.setSelection(Y.near(t.doc.resolve(o), n));
4472
+ }), t.setSelection(X.near(t.doc.resolve(o), n));
4473
4473
  }
4474
4474
  function Vi(t, e) {
4475
4475
  return !e || !t ? t : t.bind(e);
@@ -4488,7 +4488,7 @@ new cn("doc", {
4488
4488
  }
4489
4489
  }), new cn("selection", {
4490
4490
  init(t, e) {
4491
- return t.selection || Y.atStart(e.doc);
4491
+ return t.selection || X.atStart(e.doc);
4492
4492
  },
4493
4493
  apply(t) {
4494
4494
  return t.selection;
@@ -4638,7 +4638,7 @@ const gc = /^```([a-z]+)?[\s\n]$/, yc = /^~~~([a-z]+)?[\s\n]$/, bc = Be.create({
4638
4638
  if (!s || i.parent.type !== this.type || !(i.parentOffset === i.parent.nodeSize - 2))
4639
4639
  return !1;
4640
4640
  const l = i.after();
4641
- return l === void 0 ? !1 : r.nodeAt(l) ? t.commands.command(({ tr: c }) => (c.setSelection(Y.near(r.resolve(l))), !0)) : t.commands.exitCode();
4641
+ return l === void 0 ? !1 : r.nodeAt(l) ? t.commands.command(({ tr: c }) => (c.setSelection(X.near(r.resolve(l))), !0)) : t.commands.exitCode();
4642
4642
  }
4643
4643
  };
4644
4644
  },
@@ -4675,7 +4675,7 @@ const gc = /^```([a-z]+)?[\s\n]$/, yc = /^~~~([a-z]+)?[\s\n]$/, bc = Be.create({
4675
4675
  return !1;
4676
4676
  const { tr: o, schema: l } = t.state, a = l.text(n.replace(/\r\n?/g, `
4677
4677
  `));
4678
- return o.replaceSelectionWith(this.type.create({ language: s }, a)), o.selection.$from.parent.type !== this.type && o.setSelection(Q.near(o.doc.resolve(Math.max(0, o.selection.from - 2)))), o.setMeta("paste", !0), t.dispatch(o), !0;
4678
+ return o.replaceSelectionWith(this.type.create({ language: s }, a)), o.selection.$from.parent.type !== this.type && o.setSelection(Y.near(o.doc.resolve(Math.max(0, o.selection.from - 2)))), o.setMeta("paste", !0), t.dispatch(o), !0;
4679
4679
  }
4680
4680
  }
4681
4681
  })
@@ -4751,10 +4751,10 @@ const gc = /^```([a-z]+)?[\s\n]$/, yc = /^~~~([a-z]+)?[\s\n]$/, bc = Be.create({
4751
4751
  if (l) {
4752
4752
  const { $to: c } = o.selection, d = c.end();
4753
4753
  if (c.nodeAfter)
4754
- c.nodeAfter.isTextblock ? o.setSelection(Q.create(o.doc, c.pos + 1)) : c.nodeAfter.isBlock ? o.setSelection(j.create(o.doc, c.pos)) : o.setSelection(Q.create(o.doc, c.pos));
4754
+ c.nodeAfter.isTextblock ? o.setSelection(Y.create(o.doc, c.pos + 1)) : c.nodeAfter.isBlock ? o.setSelection(j.create(o.doc, c.pos)) : o.setSelection(Y.create(o.doc, c.pos));
4755
4755
  else {
4756
4756
  const f = (a = c.parent.type.contentMatch.defaultType) === null || a === void 0 ? void 0 : a.create();
4757
- f && (o.insert(d, f), o.setSelection(Q.create(o.doc, d + 1)));
4757
+ f && (o.insert(d, f), o.setSelection(Y.create(o.doc, d + 1)));
4758
4758
  }
4759
4759
  o.scrollIntoView();
4760
4760
  }
@@ -4806,7 +4806,7 @@ const gc = /^```([a-z]+)?[\s\n]$/, yc = /^~~~([a-z]+)?[\s\n]$/, bc = Be.create({
4806
4806
  const { keepMarks: o } = this.options, { splittableMarks: l } = r.extensionManager, a = s || i.$to.parentOffset && i.$from.marks();
4807
4807
  return e().insertContent({ type: this.name }).command(({ tr: c, dispatch: d }) => {
4808
4808
  if (d && a && o) {
4809
- const f = a.filter((p) => l.includes(p.type.name));
4809
+ const f = a.filter((h) => l.includes(h.type.name));
4810
4810
  c.ensureMarks(f);
4811
4811
  }
4812
4812
  return !0;
@@ -4938,9 +4938,9 @@ class $e {
4938
4938
  let i, s;
4939
4939
  n && (i = this.remapping(r, this.items.length), s = i.maps.length);
4940
4940
  let o = e.tr, l, a, c = [], d = [];
4941
- return this.items.forEach((f, p) => {
4941
+ return this.items.forEach((f, h) => {
4942
4942
  if (!f.step) {
4943
- i || (i = this.remapping(r, p + 1), s = i.maps.length), s--, d.push(f);
4943
+ i || (i = this.remapping(r, h + 1), s = i.maps.length), s--, d.push(f);
4944
4944
  return;
4945
4945
  }
4946
4946
  if (i) {
@@ -4957,8 +4957,8 @@ class $e {
4957
4957
  addTransform(e, n, r, i) {
4958
4958
  let s = [], o = this.eventCount, l = this.items, a = !i && l.length ? l.get(l.length - 1) : null;
4959
4959
  for (let d = 0; d < e.steps.length; d++) {
4960
- let f = e.steps[d].invert(e.docs[d]), p = new He(e.mapping.maps[d], f, n), m;
4961
- (m = a && a.merge(p)) && (p = m, d ? s.pop() : l = l.slice(0, l.length - 1)), s.push(p), n && (o++, n = void 0), i || (a = p);
4960
+ let f = e.steps[d].invert(e.docs[d]), h = new He(e.mapping.maps[d], f, n), m;
4961
+ (m = a && a.merge(h)) && (h = m, d ? s.pop() : l = l.slice(0, l.length - 1)), s.push(h), n && (o++, n = void 0), i || (a = h);
4962
4962
  }
4963
4963
  let c = o - r.depth;
4964
4964
  return c > Nc && (l = Ac(l, c), o -= c), new $e(l.append(s), o);
@@ -4981,25 +4981,25 @@ class $e {
4981
4981
  if (!this.eventCount)
4982
4982
  return this;
4983
4983
  let r = [], i = Math.max(0, this.items.length - n), s = e.mapping, o = e.steps.length, l = this.eventCount;
4984
- this.items.forEach((p) => {
4985
- p.selection && l--;
4984
+ this.items.forEach((h) => {
4985
+ h.selection && l--;
4986
4986
  }, i);
4987
4987
  let a = n;
4988
- this.items.forEach((p) => {
4988
+ this.items.forEach((h) => {
4989
4989
  let m = s.getMirror(--a);
4990
4990
  if (m == null)
4991
4991
  return;
4992
4992
  o = Math.min(o, m);
4993
4993
  let v = s.maps[m];
4994
- if (p.step) {
4995
- let b = e.steps[m].invert(e.docs[m]), y = p.selection && p.selection.map(s.slice(a + 1, m));
4996
- y && l++, r.push(new He(v, b, y));
4994
+ if (h.step) {
4995
+ let y = e.steps[m].invert(e.docs[m]), b = h.selection && h.selection.map(s.slice(a + 1, m));
4996
+ b && l++, r.push(new He(v, y, b));
4997
4997
  } else
4998
4998
  r.push(new He(v));
4999
4999
  }, i);
5000
5000
  let c = [];
5001
- for (let p = n; p < o; p++)
5002
- c.push(new He(s.maps[p]));
5001
+ for (let h = n; h < o; h++)
5002
+ c.push(new He(s.maps[h]));
5003
5003
  let d = this.items.slice(0, i).append(c).append(r), f = new $e(d, l);
5004
5004
  return f.emptyItemCount() > wc && (f = f.compress(this.items.length - r.length)), f;
5005
5005
  }
@@ -5025,8 +5025,8 @@ class $e {
5025
5025
  if (r--, c && n.appendMap(c, r), a) {
5026
5026
  let d = o.selection && o.selection.map(n.slice(r));
5027
5027
  d && s++;
5028
- let f = new He(c.invert(), a, d), p, m = i.length - 1;
5029
- (p = i.length && i[m].merge(f)) ? i[m] = p : i.push(f);
5028
+ let f = new He(c.invert(), a, d), h, m = i.length - 1;
5029
+ (h = i.length && i[m].merge(f)) ? i[m] = h : i.push(f);
5030
5030
  }
5031
5031
  } else o.map && r--;
5032
5032
  }, this.items.length, 0), new $e(pe.from(i.reverse()), s);
@@ -5224,20 +5224,20 @@ class Pc {
5224
5224
  updateOverlay() {
5225
5225
  let e = this.editorView.state.doc.resolve(this.cursorPos), n = !e.parent.inlineContent, r, i = this.editorView.dom, s = i.getBoundingClientRect(), o = s.width / i.offsetWidth, l = s.height / i.offsetHeight;
5226
5226
  if (n) {
5227
- let f = e.nodeBefore, p = e.nodeAfter;
5228
- if (f || p) {
5227
+ let f = e.nodeBefore, h = e.nodeAfter;
5228
+ if (f || h) {
5229
5229
  let m = this.editorView.nodeDOM(this.cursorPos - (f ? f.nodeSize : 0));
5230
5230
  if (m) {
5231
- let v = m.getBoundingClientRect(), b = f ? v.bottom : v.top;
5232
- f && p && (b = (b + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);
5233
- let y = this.width / 2 * l;
5234
- r = { left: v.left, right: v.right, top: b - y, bottom: b + y };
5231
+ let v = m.getBoundingClientRect(), y = f ? v.bottom : v.top;
5232
+ f && h && (y = (y + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);
5233
+ let b = this.width / 2 * l;
5234
+ r = { left: v.left, right: v.right, top: y - b, bottom: y + b };
5235
5235
  }
5236
5236
  }
5237
5237
  }
5238
5238
  if (!r) {
5239
- let f = this.editorView.coordsAtPos(this.cursorPos), p = this.width / 2 * o;
5240
- r = { left: f.left - p, right: f.left + p, top: f.top, bottom: f.bottom };
5239
+ let f = this.editorView.coordsAtPos(this.cursorPos), h = this.width / 2 * o;
5240
+ r = { left: f.left - h, right: f.left + h, top: f.top, bottom: f.bottom };
5241
5241
  }
5242
5242
  let a = this.editorView.dom.offsetParent;
5243
5243
  this.element || (this.element = a.appendChild(document.createElement("div")), this.class && (this.element.className = this.class), this.element.style.cssText = "position: absolute; z-index: 50; pointer-events: none;", this.color && (this.element.style.backgroundColor = this.color)), this.element.classList.toggle("prosemirror-dropcursor-block", n), this.element.classList.toggle("prosemirror-dropcursor-inline", !n);
@@ -5245,8 +5245,8 @@ class Pc {
5245
5245
  if (!a || a == document.body && getComputedStyle(a).position == "static")
5246
5246
  c = -pageXOffset, d = -pageYOffset;
5247
5247
  else {
5248
- let f = a.getBoundingClientRect(), p = f.width / a.offsetWidth, m = f.height / a.offsetHeight;
5249
- c = f.left - a.scrollLeft * p, d = f.top - a.scrollTop * m;
5248
+ let f = a.getBoundingClientRect(), h = f.width / a.offsetWidth, m = f.height / a.offsetHeight;
5249
+ c = f.left - a.scrollLeft * h, d = f.top - a.scrollTop * m;
5250
5250
  }
5251
5251
  this.element.style.left = (r.left - c) / o + "px", this.element.style.top = (r.top - d) / l + "px", this.element.style.width = (r.right - r.left) / o + "px", this.element.style.height = (r.bottom - r.top) / l + "px";
5252
5252
  }
@@ -5291,7 +5291,7 @@ const Rc = Rr.create({
5291
5291
  ];
5292
5292
  }
5293
5293
  });
5294
- var st = {
5294
+ var ot = {
5295
5295
  8: "Backspace",
5296
5296
  9: "Tab",
5297
5297
  10: "Enter",
@@ -5370,13 +5370,13 @@ var st = {
5370
5370
  221: "}",
5371
5371
  222: '"'
5372
5372
  }, $c = typeof navigator < "u" && /Mac/.test(navigator.platform), Vc = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
5373
- for (var ge = 0; ge < 10; ge++) st[48 + ge] = st[96 + ge] = String(ge);
5374
- for (var ge = 1; ge <= 24; ge++) st[ge + 111] = "F" + ge;
5373
+ for (var ge = 0; ge < 10; ge++) ot[48 + ge] = ot[96 + ge] = String(ge);
5374
+ for (var ge = 1; ge <= 24; ge++) ot[ge + 111] = "F" + ge;
5375
5375
  for (var ge = 65; ge <= 90; ge++)
5376
- st[ge] = String.fromCharCode(ge + 32), vn[ge] = String.fromCharCode(ge);
5377
- for (var tr in st) vn.hasOwnProperty(tr) || (vn[tr] = st[tr]);
5376
+ ot[ge] = String.fromCharCode(ge + 32), vn[ge] = String.fromCharCode(ge);
5377
+ for (var tr in ot) vn.hasOwnProperty(tr) || (vn[tr] = ot[tr]);
5378
5378
  function zc(t) {
5379
- var e = $c && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || Vc && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", n = !e && t.key || (t.shiftKey ? vn : st)[t.keyCode] || t.key || "Unidentified";
5379
+ var e = $c && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || Vc && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", n = !e && t.key || (t.shiftKey ? vn : ot)[t.keyCode] || t.key || "Unidentified";
5380
5380
  return n == "Esc" && (n = "Escape"), n == "Del" && (n = "Delete"), n == "Left" && (n = "ArrowLeft"), n == "Up" && (n = "ArrowUp"), n == "Right" && (n = "ArrowRight"), n == "Down" && (n = "ArrowDown"), n;
5381
5381
  }
5382
5382
  const Bc = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), _c = typeof navigator < "u" && /Win/.test(navigator.platform);
@@ -5423,7 +5423,7 @@ function qc(t) {
5423
5423
  return !0;
5424
5424
  }
5425
5425
  if ((r.altKey || r.metaKey || r.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
5426
- !(_c && r.ctrlKey && r.altKey) && (s = st[r.keyCode]) && s != i) {
5426
+ !(_c && r.ctrlKey && r.altKey) && (s = ot[r.keyCode]) && s != i) {
5427
5427
  let l = e[nr(s, r)];
5428
5428
  if (l && l(n.state, n.dispatch, n))
5429
5429
  return !0;
@@ -5487,9 +5487,9 @@ function fo(t, e) {
5487
5487
  let n = document.createEvent("Event");
5488
5488
  return n.initEvent("keydown", !0, !0), n.keyCode = t, n.key = n.code = e, n;
5489
5489
  }
5490
- const je = typeof navigator < "u" ? navigator : null, Ui = typeof document < "u" ? document : null, ot = je && je.userAgent || "", kr = /Edge\/(\d+)/.exec(ot), ho = /MSIE \d/.exec(ot), vr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ot), rn = !!(ho || vr || kr), po = ho ? document.documentMode : vr ? +vr[1] : kr ? +kr[1] : 0, Pn = !rn && /gecko\/(\d+)/i.test(ot);
5491
- Pn && +(/Firefox\/(\d+)/.exec(ot) || [0, 0])[1];
5492
- const Sr = !rn && /Chrome\/(\d+)/.exec(ot), Qe = !!Sr, mo = Sr ? +Sr[1] : 0, kt = !rn && !!je && /Apple Computer/.test(je.vendor), Hr = kt && (/Mobile\/\w+/.test(ot) || !!je && je.maxTouchPoints > 2), Pe = Hr || (je ? /Mac/.test(je.platform) : !1), go = je ? /Win/.test(je.platform) : !1, sn = /Android \d/.test(ot), Ur = !!Ui && "webkitFontSmoothing" in Ui.documentElement.style, Wc = Ur ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5490
+ const je = typeof navigator < "u" ? navigator : null, Ui = typeof document < "u" ? document : null, lt = je && je.userAgent || "", kr = /Edge\/(\d+)/.exec(lt), ho = /MSIE \d/.exec(lt), vr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(lt), rn = !!(ho || vr || kr), po = ho ? document.documentMode : vr ? +vr[1] : kr ? +kr[1] : 0, Pn = !rn && /gecko\/(\d+)/i.test(lt);
5491
+ Pn && +(/Firefox\/(\d+)/.exec(lt) || [0, 0])[1];
5492
+ const Sr = !rn && /Chrome\/(\d+)/.exec(lt), Qe = !!Sr, mo = Sr ? +Sr[1] : 0, kt = !rn && !!je && /Apple Computer/.test(je.vendor), Hr = kt && (/Mobile\/\w+/.test(lt) || !!je && je.maxTouchPoints > 2), Pe = Hr || (je ? /Mac/.test(je.platform) : !1), go = je ? /Win/.test(je.platform) : !1, sn = /Android \d/.test(lt), Ur = !!Ui && "webkitFontSmoothing" in Ui.documentElement.style, Wc = Ur ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5493
5493
  function Jc(t, e = null) {
5494
5494
  let n = t.domSelectionRange(), r = t.state.doc;
5495
5495
  if (!n.focusNode)
@@ -5503,19 +5503,19 @@ function Jc(t, e = null) {
5503
5503
  i = i.parent;
5504
5504
  let f = i.node;
5505
5505
  if (i && f.isAtom && j.isSelectable(f) && i.parent && !(f.isInline && jc(n.focusNode, n.focusOffset, i.dom))) {
5506
- let p = i.posBefore;
5507
- c = new j(o == p ? l : r.resolve(p));
5506
+ let h = i.posBefore;
5507
+ c = new j(o == h ? l : r.resolve(h));
5508
5508
  }
5509
5509
  } else {
5510
5510
  if (n instanceof t.dom.ownerDocument.defaultView.Selection && n.rangeCount > 1) {
5511
- let f = o, p = o;
5511
+ let f = o, h = o;
5512
5512
  for (let m = 0; m < n.rangeCount; m++) {
5513
5513
  let v = n.getRangeAt(m);
5514
- f = Math.min(f, t.docView.posFromDOM(v.startContainer, v.startOffset, 1)), p = Math.max(p, t.docView.posFromDOM(v.endContainer, v.endOffset, -1));
5514
+ f = Math.min(f, t.docView.posFromDOM(v.startContainer, v.startOffset, 1)), h = Math.max(h, t.docView.posFromDOM(v.endContainer, v.endOffset, -1));
5515
5515
  }
5516
5516
  if (f < 0)
5517
5517
  return null;
5518
- [a, o] = p == t.state.selection.anchor ? [p, f] : [f, p], l = r.resolve(o);
5518
+ [a, o] = h == t.state.selection.anchor ? [h, f] : [f, h], l = r.resolve(o);
5519
5519
  } else
5520
5520
  a = t.docView.posFromDOM(n.anchorNode, n.anchorOffset, 1);
5521
5521
  if (a < 0)
@@ -5545,7 +5545,7 @@ function qr(t, e = !1) {
5545
5545
  Zc(t);
5546
5546
  else {
5547
5547
  let { anchor: r, head: i } = n, s, o;
5548
- qi && !(n instanceof Q) && (n.$from.parent.inlineContent || (s = Ki(t, n.from)), !n.empty && !n.$from.parent.inlineContent && (o = Ki(t, n.to))), t.docView.setSelection(r, i, t, e), qi && (s && ji(s), o && ji(o)), n.visible ? t.dom.classList.remove("ProseMirror-hideselection") : (t.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Gc(t));
5548
+ qi && !(n instanceof Y) && (n.$from.parent.inlineContent || (s = Ki(t, n.from)), !n.empty && !n.$from.parent.inlineContent && (o = Ki(t, n.to))), t.docView.setSelection(r, i, t, e), qi && (s && ji(s), o && ji(o)), n.visible ? t.dom.classList.remove("ProseMirror-hideselection") : (t.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Gc(t));
5549
5549
  }
5550
5550
  t.domObserver.setCurSelection(), t.domObserver.connectSelection();
5551
5551
  }
@@ -5596,7 +5596,7 @@ function Wi(t) {
5596
5596
  t.lastSelectedViewDesc && (t.lastSelectedViewDesc.parent && t.lastSelectedViewDesc.deselectNode(), t.lastSelectedViewDesc = void 0);
5597
5597
  }
5598
5598
  function bo(t, e, n, r) {
5599
- return t.someProp("createSelectionBetween", (i) => i(t, e, n)) || Q.between(e, n, r);
5599
+ return t.someProp("createSelectionBetween", (i) => i(t, e, n)) || Y.between(e, n, r);
5600
5600
  }
5601
5601
  function Yc(t) {
5602
5602
  let e = t.domSelectionRange();
@@ -5610,20 +5610,20 @@ function Yc(t) {
5610
5610
  }
5611
5611
  function Cr(t, e) {
5612
5612
  let { $anchor: n, $head: r } = t.selection, i = e > 0 ? n.max(r) : n.min(r), s = i.parent.inlineContent ? i.depth ? t.doc.resolve(e > 0 ? i.after() : i.before()) : null : i;
5613
- return s && Y.findFrom(s, e);
5613
+ return s && X.findFrom(s, e);
5614
5614
  }
5615
5615
  function nt(t, e) {
5616
5616
  return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()), !0;
5617
5617
  }
5618
5618
  function Ji(t, e, n) {
5619
5619
  let r = t.state.selection;
5620
- if (r instanceof Q)
5620
+ if (r instanceof Y)
5621
5621
  if (n.indexOf("s") > -1) {
5622
5622
  let { $head: i } = r, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter;
5623
5623
  if (!s || s.isText || !s.isLeaf)
5624
5624
  return !1;
5625
5625
  let o = t.state.doc.resolve(i.pos + s.nodeSize * (e < 0 ? -1 : 1));
5626
- return nt(t, new Q(r.$anchor, o));
5626
+ return nt(t, new Y(r.$anchor, o));
5627
5627
  } else if (r.empty) {
5628
5628
  if (t.endOfTextblock(e > 0 ? "forward" : "backward")) {
5629
5629
  let i = Cr(t.state, e);
@@ -5633,12 +5633,12 @@ function Ji(t, e, n) {
5633
5633
  if (!s || s.isText)
5634
5634
  return !1;
5635
5635
  let l = e < 0 ? i.pos - s.nodeSize : i.pos;
5636
- return s.isAtom || (o = t.docView.descAt(l)) && !o.contentDOM ? j.isSelectable(s) ? nt(t, new j(e < 0 ? t.state.doc.resolve(i.pos - s.nodeSize) : i)) : Ur ? nt(t, new Q(t.state.doc.resolve(e < 0 ? l : l + s.nodeSize))) : !1 : !1;
5636
+ return s.isAtom || (o = t.docView.descAt(l)) && !o.contentDOM ? j.isSelectable(s) ? nt(t, new j(e < 0 ? t.state.doc.resolve(i.pos - s.nodeSize) : i)) : Ur ? nt(t, new Y(t.state.doc.resolve(e < 0 ? l : l + s.nodeSize))) : !1 : !1;
5637
5637
  }
5638
5638
  } else return !1;
5639
5639
  else {
5640
5640
  if (r instanceof j && r.node.isInline)
5641
- return nt(t, new Q(e > 0 ? r.$to : r.$from));
5641
+ return nt(t, new Y(e > 0 ? r.$to : r.$from));
5642
5642
  {
5643
5643
  let i = Cr(t.state, e);
5644
5644
  return i ? nt(t, i) : !1;
@@ -5788,7 +5788,7 @@ function Gi(t, e) {
5788
5788
  }
5789
5789
  function Zi(t, e, n) {
5790
5790
  let r = t.state.selection;
5791
- if (r instanceof Q && !r.empty || n.indexOf("s") > -1 || Pe && n.indexOf("m") > -1)
5791
+ if (r instanceof Y && !r.empty || n.indexOf("s") > -1 || Pe && n.indexOf("m") > -1)
5792
5792
  return !1;
5793
5793
  let { $from: i, $to: s } = r;
5794
5794
  if (!i.parent.inlineContent || t.endOfTextblock(e < 0 ? "up" : "down")) {
@@ -5797,13 +5797,13 @@ function Zi(t, e, n) {
5797
5797
  return nt(t, o);
5798
5798
  }
5799
5799
  if (!i.parent.inlineContent) {
5800
- let o = e < 0 ? i : s, l = r instanceof Ke ? Y.near(o, e) : Y.findFrom(o, e);
5800
+ let o = e < 0 ? i : s, l = r instanceof Ke ? X.near(o, e) : X.findFrom(o, e);
5801
5801
  return l ? nt(t, l) : !1;
5802
5802
  }
5803
5803
  return !1;
5804
5804
  }
5805
5805
  function Qi(t, e) {
5806
- if (!(t.state.selection instanceof Q))
5806
+ if (!(t.state.selection instanceof Y))
5807
5807
  return !0;
5808
5808
  let { $head: n, $anchor: r, empty: i } = t.state.selection;
5809
5809
  if (!n.sameParent(r))
@@ -5883,10 +5883,10 @@ function ko(t, e) {
5883
5883
  c = a.firstChild;
5884
5884
  }
5885
5885
  c && c.nodeType == 1 && c.setAttribute("data-pm-slice", `${i} ${s}${f ? ` -${f}` : ""} ${JSON.stringify(n)}`);
5886
- let p = t.someProp("clipboardTextSerializer", (m) => m(e, t)) || e.content.textBetween(0, e.content.size, `
5886
+ let h = t.someProp("clipboardTextSerializer", (m) => m(e, t)) || e.content.textBetween(0, e.content.size, `
5887
5887
 
5888
5888
  `);
5889
- return { dom: a, text: p, slice: e };
5889
+ return { dom: a, text: h, slice: e };
5890
5890
  }
5891
5891
  function vo(t, e, n, r, i) {
5892
5892
  let s = i.parent.type.spec.code, o, l;
@@ -5894,21 +5894,21 @@ function vo(t, e, n, r, i) {
5894
5894
  return null;
5895
5895
  let a = !!e && (r || s || !n);
5896
5896
  if (a) {
5897
- if (t.someProp("transformPastedText", (p) => {
5898
- e = p(e, s || r, t);
5897
+ if (t.someProp("transformPastedText", (h) => {
5898
+ e = h(e, s || r, t);
5899
5899
  }), s)
5900
5900
  return l = new K(q.from(t.state.schema.text(e.replace(/\r\n?/g, `
5901
- `))), 0, 0), t.someProp("transformPasted", (p) => {
5902
- l = p(l, t, !0);
5901
+ `))), 0, 0), t.someProp("transformPasted", (h) => {
5902
+ l = h(l, t, !0);
5903
5903
  }), l;
5904
- let f = t.someProp("clipboardTextParser", (p) => p(e, i, r, t));
5904
+ let f = t.someProp("clipboardTextParser", (h) => h(e, i, r, t));
5905
5905
  if (f)
5906
5906
  l = f;
5907
5907
  else {
5908
- let p = i.marks(), { schema: m } = t.state, v = Dn.fromSchema(m);
5909
- o = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((b) => {
5910
- let y = o.appendChild(document.createElement("p"));
5911
- b && y.appendChild(v.serializeNode(m.text(b, p)));
5908
+ let h = i.marks(), { schema: m } = t.state, v = Dn.fromSchema(m);
5909
+ o = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((y) => {
5910
+ let b = o.appendChild(document.createElement("p"));
5911
+ y && b.appendChild(v.serializeNode(m.text(y, h)));
5912
5912
  });
5913
5913
  }
5914
5914
  } else
@@ -5918,28 +5918,28 @@ function vo(t, e, n, r, i) {
5918
5918
  let c = o && o.querySelector("[data-pm-slice]"), d = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
5919
5919
  if (d && d[3])
5920
5920
  for (let f = +d[3]; f > 0; f--) {
5921
- let p = o.firstChild;
5922
- for (; p && p.nodeType != 1; )
5923
- p = p.nextSibling;
5924
- if (!p)
5921
+ let h = o.firstChild;
5922
+ for (; h && h.nodeType != 1; )
5923
+ h = h.nextSibling;
5924
+ if (!h)
5925
5925
  break;
5926
- o = p;
5926
+ o = h;
5927
5927
  }
5928
5928
  if (l || (l = (t.someProp("clipboardParser") || t.someProp("domParser") || yn.fromSchema(t.state.schema)).parseSlice(o, {
5929
5929
  preserveWhitespace: !!(a || d),
5930
5930
  context: i,
5931
- ruleFromNode(p) {
5932
- return p.nodeName == "BR" && !p.nextSibling && p.parentNode && !ou.test(p.parentNode.nodeName) ? { ignore: !0 } : null;
5931
+ ruleFromNode(h) {
5932
+ return h.nodeName == "BR" && !h.nextSibling && h.parentNode && !ou.test(h.parentNode.nodeName) ? { ignore: !0 } : null;
5933
5933
  }
5934
5934
  })), d)
5935
5935
  l = du(Xi(l, +d[1], +d[2]), d[4]);
5936
5936
  else if (l = K.maxOpen(lu(l.content, i), !0), l.openStart || l.openEnd) {
5937
- let f = 0, p = 0;
5937
+ let f = 0, h = 0;
5938
5938
  for (let m = l.content.firstChild; f < l.openStart && !m.type.spec.isolating; f++, m = m.firstChild)
5939
5939
  ;
5940
- for (let m = l.content.lastChild; p < l.openEnd && !m.type.spec.isolating; p++, m = m.lastChild)
5940
+ for (let m = l.content.lastChild; h < l.openEnd && !m.type.spec.isolating; h++, m = m.lastChild)
5941
5941
  ;
5942
- l = Xi(l, f, p);
5942
+ l = Xi(l, f, h);
5943
5943
  }
5944
5944
  return t.someProp("transformPasted", (f) => {
5945
5945
  l = f(l, t, a);
@@ -6076,7 +6076,7 @@ Fe.keypress = (t, e) => {
6076
6076
  return;
6077
6077
  }
6078
6078
  let r = t.state.selection;
6079
- if (!(r instanceof Q) || !r.$from.sameParent(r.$to)) {
6079
+ if (!(r instanceof Y) || !r.$from.sameParent(r.$to)) {
6080
6080
  let i = String.fromCharCode(n.charCode), s = () => t.state.tr.insertText(i).scrollIntoView();
6081
6081
  !/[\r\n]/.test(i) && !t.someProp("handleTextInput", (o) => o(t, r.$from.pos, r.$to.pos, i, s)) && t.dispatch(s()), n.preventDefault();
6082
6082
  }
@@ -6138,12 +6138,12 @@ function bu(t, e, n) {
6138
6138
  return !1;
6139
6139
  let r = t.state.doc;
6140
6140
  if (e == -1)
6141
- return r.inlineContent ? (Ot(t, Q.create(r, 0, r.content.size)), !0) : !1;
6141
+ return r.inlineContent ? (Ot(t, Y.create(r, 0, r.content.size)), !0) : !1;
6142
6142
  let i = r.resolve(e);
6143
6143
  for (let s = i.depth + 1; s > 0; s--) {
6144
6144
  let o = s > i.depth ? i.nodeAfter : i.node(s), l = i.before(s);
6145
6145
  if (o.inlineContent)
6146
- Ot(t, Q.create(r, l + 1, l + 1 + o.content.size));
6146
+ Ot(t, Y.create(r, l + 1, l + 1 + o.content.size));
6147
6147
  else if (j.isSelectable(o))
6148
6148
  Ot(t, j.create(r, l));
6149
6149
  else
@@ -6200,7 +6200,7 @@ class xu {
6200
6200
  // (hidden) cursor is doesn't change the selection, and
6201
6201
  // thus doesn't get a reaction from ProseMirror. This
6202
6202
  // works around that.
6203
- Qe && !this.view.state.selection.visible && Math.min(Math.abs(n.pos - this.view.state.selection.from), Math.abs(n.pos - this.view.state.selection.to)) <= 2) ? (Ot(this.view, Y.near(this.view.state.doc.resolve(n.pos))), e.preventDefault()) : rt(this.view, "pointer");
6203
+ Qe && !this.view.state.selection.visible && Math.min(Math.abs(n.pos - this.view.state.selection.from), Math.abs(n.pos - this.view.state.selection.to)) <= 2) ? (Ot(this.view, X.near(this.view.state.doc.resolve(n.pos))), e.preventDefault()) : rt(this.view, "pointer");
6204
6204
  }
6205
6205
  move(e) {
6206
6206
  this.updateAllowDefault(e), rt(this.view, "pointer"), e.buttons == 0 && this.done();
@@ -6224,7 +6224,7 @@ Fe.compositionstart = Fe.compositionupdate = (t) => {
6224
6224
  if (!t.composing) {
6225
6225
  t.domObserver.flush();
6226
6226
  let { state: e } = t, n = e.selection.$to;
6227
- if (e.selection instanceof Q && (e.storedMarks || !n.textOffset && n.parentOffset && n.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || Qe && go && vu(t)))
6227
+ if (e.selection instanceof Y && (e.storedMarks || !n.textOffset && n.parentOffset && n.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1) || Qe && go && vu(t)))
6228
6228
  t.markCursor = t.state.storedMarks || n.marks(), wn(t, !0), t.markCursor = null;
6229
6229
  else if (wn(t, !e.selection.empty), Pn && e.selection.empty && n.parentOffset && !n.textOffset && n.nodeBefore.marks.length) {
6230
6230
  let r = t.domSelectionRange();
@@ -6396,12 +6396,12 @@ function Mu(t, e, n) {
6396
6396
  let c = a.mapping.map(l), d = s.openStart == 0 && s.openEnd == 0 && s.content.childCount == 1, f = a.doc;
6397
6397
  if (d ? a.replaceRangeWith(c, c, s.content.firstChild) : a.replaceRange(c, c, s), a.doc.eq(f))
6398
6398
  return;
6399
- let p = a.doc.resolve(c);
6400
- if (d && j.isSelectable(s.content.firstChild) && p.nodeAfter && p.nodeAfter.sameMarkup(s.content.firstChild))
6401
- a.setSelection(new j(p));
6399
+ let h = a.doc.resolve(c);
6400
+ if (d && j.isSelectable(s.content.firstChild) && h.nodeAfter && h.nodeAfter.sameMarkup(s.content.firstChild))
6401
+ a.setSelection(new j(h));
6402
6402
  else {
6403
6403
  let m = a.mapping.map(l);
6404
- a.mapping.maps[a.mapping.maps.length - 1].forEach((v, b, y, x) => m = x), a.setSelection(bo(t, p, a.doc.resolve(m)));
6404
+ a.mapping.maps[a.mapping.maps.length - 1].forEach((v, y, b, k) => m = k), a.setSelection(bo(t, h, a.doc.resolve(m)));
6405
6405
  }
6406
6406
  t.focus(), t.dispatch(a.setMeta("uiEvent", "drop"));
6407
6407
  }
@@ -6457,7 +6457,7 @@ class An {
6457
6457
  this.spec.destroy && this.spec.destroy(e);
6458
6458
  }
6459
6459
  }
6460
- class it {
6460
+ class st {
6461
6461
  constructor(e, n) {
6462
6462
  this.attrs = e, this.spec = n || yt;
6463
6463
  }
@@ -6469,10 +6469,10 @@ class it {
6469
6469
  return n.from < n.to;
6470
6470
  }
6471
6471
  eq(e) {
6472
- return this == e || e instanceof it && Xt(this.attrs, e.attrs) && Xt(this.spec, e.spec);
6472
+ return this == e || e instanceof st && Xt(this.attrs, e.attrs) && Xt(this.spec, e.spec);
6473
6473
  }
6474
6474
  static is(e) {
6475
- return e.type instanceof it;
6475
+ return e.type instanceof st;
6476
6476
  }
6477
6477
  destroy() {
6478
6478
  }
@@ -6539,7 +6539,7 @@ class Ue {
6539
6539
  each inline node between `from` and `to`.
6540
6540
  */
6541
6541
  static inline(e, n, r, i) {
6542
- return new Ue(e, n, new it(r, i));
6542
+ return new Ue(e, n, new st(r, i));
6543
6543
  }
6544
6544
  /**
6545
6545
  Creates a node decoration. `from` and `to` should point precisely
@@ -6560,7 +6560,7 @@ class Ue {
6560
6560
  @internal
6561
6561
  */
6562
6562
  get inline() {
6563
- return this.type instanceof it;
6563
+ return this.type instanceof st;
6564
6564
  }
6565
6565
  /**
6566
6566
  @internal
@@ -6691,14 +6691,14 @@ class he {
6691
6691
  let s = e + 1, o = s + n.content.size;
6692
6692
  for (let l = 0; l < this.local.length; l++) {
6693
6693
  let a = this.local[l];
6694
- if (a.from < o && a.to > s && a.type instanceof it) {
6694
+ if (a.from < o && a.to > s && a.type instanceof st) {
6695
6695
  let c = Math.max(s, a.from) - s, d = Math.min(o, a.to) - s;
6696
6696
  c < d && (i || (i = [])).push(a.copy(c, d));
6697
6697
  }
6698
6698
  }
6699
6699
  if (i) {
6700
6700
  let l = new he(i.sort(bt), Nt);
6701
- return r ? new ut([l, r]) : l;
6701
+ return r ? new dt([l, r]) : l;
6702
6702
  }
6703
6703
  return r || Ce;
6704
6704
  }
@@ -6730,11 +6730,11 @@ class he {
6730
6730
  localsInner(e) {
6731
6731
  if (this == Ce)
6732
6732
  return Nt;
6733
- if (e.inlineContent || !this.local.some(it.is))
6733
+ if (e.inlineContent || !this.local.some(st.is))
6734
6734
  return this.local;
6735
6735
  let n = [];
6736
6736
  for (let r = 0; r < this.local.length; r++)
6737
- this.local[r].type instanceof it || n.push(this.local[r]);
6737
+ this.local[r].type instanceof st || n.push(this.local[r]);
6738
6738
  return n;
6739
6739
  }
6740
6740
  forEachSet(e) {
@@ -6744,13 +6744,13 @@ class he {
6744
6744
  he.empty = new he([], []);
6745
6745
  he.removeOverlap = Jr;
6746
6746
  const Ce = he.empty;
6747
- class ut {
6747
+ class dt {
6748
6748
  constructor(e) {
6749
6749
  this.members = e;
6750
6750
  }
6751
6751
  map(e, n) {
6752
6752
  const r = this.members.map((i) => i.map(e, n, yt));
6753
- return ut.from(r);
6753
+ return dt.from(r);
6754
6754
  }
6755
6755
  forChild(e, n) {
6756
6756
  if (n.isLeaf)
@@ -6758,12 +6758,12 @@ class ut {
6758
6758
  let r = [];
6759
6759
  for (let i = 0; i < this.members.length; i++) {
6760
6760
  let s = this.members[i].forChild(e, n);
6761
- s != Ce && (s instanceof ut ? r = r.concat(s.members) : r.push(s));
6761
+ s != Ce && (s instanceof dt ? r = r.concat(s.members) : r.push(s));
6762
6762
  }
6763
- return ut.from(r);
6763
+ return dt.from(r);
6764
6764
  }
6765
6765
  eq(e) {
6766
- if (!(e instanceof ut) || e.members.length != this.members.length)
6766
+ if (!(e instanceof dt) || e.members.length != this.members.length)
6767
6767
  return !1;
6768
6768
  for (let n = 0; n < this.members.length; n++)
6769
6769
  if (!this.members[n].eq(e.members[n]))
@@ -6794,7 +6794,7 @@ class ut {
6794
6794
  case 1:
6795
6795
  return e[0];
6796
6796
  default:
6797
- return new ut(e.every((n) => n instanceof he) ? e : e.reduce((n, r) => n.concat(r instanceof he ? r : r.members), []));
6797
+ return new dt(e.every((n) => n instanceof he) ? e : e.reduce((n, r) => n.concat(r instanceof he ? r : r.members), []));
6798
6798
  }
6799
6799
  }
6800
6800
  forEachSet(e) {
@@ -6806,16 +6806,16 @@ function Ou(t, e, n, r, i, s, o) {
6806
6806
  let l = t.slice();
6807
6807
  for (let c = 0, d = s; c < n.maps.length; c++) {
6808
6808
  let f = 0;
6809
- n.maps[c].forEach((p, m, v, b) => {
6810
- let y = b - v - (m - p);
6811
- for (let x = 0; x < l.length; x += 3) {
6812
- let C = l[x + 1];
6813
- if (C < 0 || p > C + d - f)
6809
+ n.maps[c].forEach((h, m, v, y) => {
6810
+ let b = y - v - (m - h);
6811
+ for (let k = 0; k < l.length; k += 3) {
6812
+ let S = l[k + 1];
6813
+ if (S < 0 || h > S + d - f)
6814
6814
  continue;
6815
- let w = l[x] + d - f;
6816
- m >= w ? l[x + 1] = p <= w ? -2 : -1 : p >= d && y && (l[x] += y, l[x + 1] += y);
6815
+ let I = l[k] + d - f;
6816
+ m >= I ? l[k + 1] = h <= I ? -2 : -1 : h >= d && b && (l[k] += b, l[k + 1] += b);
6817
6817
  }
6818
- f += y;
6818
+ f += b;
6819
6819
  }), d = n.maps[c].map(d, -1);
6820
6820
  }
6821
6821
  let a = !1;
@@ -6830,10 +6830,10 @@ function Ou(t, e, n, r, i, s, o) {
6830
6830
  a = !0;
6831
6831
  continue;
6832
6832
  }
6833
- let p = n.map(t[c + 1] + s, -1), m = p - i, { index: v, offset: b } = r.content.findIndex(f), y = r.maybeChild(v);
6834
- if (y && b == f && b + y.nodeSize == m) {
6835
- let x = l[c + 2].mapInner(n, y, d + 1, t[c] + s + 1, o);
6836
- x != Ce ? (l[c] = f, l[c + 1] = m, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
6833
+ let h = n.map(t[c + 1] + s, -1), m = h - i, { index: v, offset: y } = r.content.findIndex(f), b = r.maybeChild(v);
6834
+ if (b && y == f && y + b.nodeSize == m) {
6835
+ let k = l[c + 2].mapInner(n, b, d + 1, t[c] + s + 1, o);
6836
+ k != Ce ? (l[c] = f, l[c + 1] = m, l[c + 2] = k) : (l[c + 1] = -2, a = !0);
6837
6837
  } else
6838
6838
  a = !0;
6839
6839
  }
@@ -6842,11 +6842,11 @@ function Ou(t, e, n, r, i, s, o) {
6842
6842
  e = d.local;
6843
6843
  for (let f = 0; f < l.length; f += 3)
6844
6844
  l[f + 1] < 0 && (l.splice(f, 3), f -= 3);
6845
- for (let f = 0, p = 0; f < d.children.length; f += 3) {
6845
+ for (let f = 0, h = 0; f < d.children.length; f += 3) {
6846
6846
  let m = d.children[f];
6847
- for (; p < l.length && l[p] < m; )
6848
- p += 3;
6849
- l.splice(p, 0, d.children[f], d.children[f + 1], d.children[f + 2]);
6847
+ for (; h < l.length && l[h] < m; )
6848
+ h += 3;
6849
+ l.splice(h, 0, d.children[f], d.children[f + 1], d.children[f + 2]);
6850
6850
  }
6851
6851
  }
6852
6852
  return new he(e.sort(bt), l);
@@ -6929,7 +6929,7 @@ function ts(t, e, n) {
6929
6929
  e++;
6930
6930
  t.splice(e, 0, n);
6931
6931
  }
6932
- class se extends Y {
6932
+ class se extends X {
6933
6933
  /**
6934
6934
  Create a gap cursor.
6935
6935
  */
@@ -6938,7 +6938,7 @@ class se extends Y {
6938
6938
  }
6939
6939
  map(e, n) {
6940
6940
  let r = e.resolve(n.map(this.head));
6941
- return se.valid(r) ? new se(r) : Y.near(r);
6941
+ return se.valid(r) ? new se(r) : X.near(r);
6942
6942
  }
6943
6943
  content() {
6944
6944
  return K.empty;
@@ -7016,7 +7016,7 @@ class se extends Y {
7016
7016
  }
7017
7017
  se.prototype.visible = !1;
7018
7018
  se.findFrom = se.findGapCursorFrom;
7019
- Y.jsonID("gapcursor", se);
7019
+ X.jsonID("gapcursor", se);
7020
7020
  class Gr {
7021
7021
  constructor(e) {
7022
7022
  this.pos = e;
@@ -7026,7 +7026,7 @@ class Gr {
7026
7026
  }
7027
7027
  resolve(e) {
7028
7028
  let n = e.resolve(this.pos);
7029
- return se.valid(n) ? new se(n) : Y.near(n);
7029
+ return se.valid(n) ? new se(n) : X.near(n);
7030
7030
  }
7031
7031
  }
7032
7032
  function Po(t) {
@@ -7089,7 +7089,7 @@ function un(t, e) {
7089
7089
  const n = t == "vert" ? e > 0 ? "down" : "up" : e > 0 ? "right" : "left";
7090
7090
  return function(r, i, s) {
7091
7091
  let o = r.selection, l = e > 0 ? o.$to : o.$from, a = o.empty;
7092
- if (o instanceof Q) {
7092
+ if (o instanceof Y) {
7093
7093
  if (!s.endOfTextblock(n) || l.depth == 0)
7094
7094
  return !1;
7095
7095
  a = !1, l = r.doc.resolve(e > 0 ? l.after() : l.before());
@@ -7117,7 +7117,7 @@ function $u(t, e) {
7117
7117
  for (let o = r.length - 1; o >= 0; o--)
7118
7118
  i = q.from(r[o].createAndFill(null, i));
7119
7119
  let s = t.state.tr.replace(n.pos, n.pos, new K(i, 0, 0));
7120
- return s.setSelection(Q.near(s.doc.resolve(n.pos + 1))), t.dispatch(s), !1;
7120
+ return s.setSelection(Y.near(s.doc.resolve(n.pos + 1))), t.dispatch(s), !1;
7121
7121
  }
7122
7122
  function Vu(t) {
7123
7123
  if (!(t.selection instanceof se))
@@ -7626,59 +7626,59 @@ const ju = ({
7626
7626
  variant: c = "bordered",
7627
7627
  initialContent: d,
7628
7628
  content: f,
7629
- onContentChange: p,
7629
+ onContentChange: h,
7630
7630
  onUpdate: m,
7631
7631
  onToolbarAction: v,
7632
- isReadOnly: b = !1,
7633
- isDisabled: y = !1,
7634
- includeInlineStyles: x = !0,
7635
- ...C
7636
- } = t, { zoom: w, setZoom: S } = Ma(), N = Si.lineHeight, T = n * N, O = i ? void 0 : r * N, V = B.useMemo(() => _u(a), [a]), { Component: H, label: U, shouldLabelBeOutside: P, getBaseProps: I, getLabelProps: R, getInputWrapperProps: $ } = bl({
7637
- ...C,
7632
+ isReadOnly: y = !1,
7633
+ isDisabled: b = !1,
7634
+ includeInlineStyles: k = !0,
7635
+ ...S
7636
+ } = t, { zoom: I, setZoom: C } = Ma(), w = Si.lineHeight, T = n * w, N = i ? void 0 : r * w, $ = B.useMemo(() => _u(a), [a]), { Component: _, label: U, shouldLabelBeOutside: V, getBaseProps: M, getLabelProps: P, getInputWrapperProps: R } = bl({
7637
+ ...S,
7638
7638
  variant: c,
7639
7639
  // Explicitly pass variant to ensure bordered styling
7640
7640
  ref: e,
7641
7641
  isMultiline: !0
7642
- }), _ = U ? /* @__PURE__ */ u("label", { ...R(), children: U }) : null, X = B.useCallback(
7642
+ }), H = U ? /* @__PURE__ */ u("label", { ...P(), children: U }) : null, Q = B.useCallback(
7643
7643
  ({ editor: W }) => {
7644
- const xe = W.getHTML(), fe = x ? Ku(xe) : xe, ke = W.getJSON(), Ye = W.getText(), vt = Ye.length, Pt = Ye.split(/\s+/).filter((Te) => Te.length > 0).length, ne = {
7644
+ const xe = W.getHTML(), fe = k ? Ku(xe) : xe, ke = W.getJSON(), Ye = W.getText(), vt = Ye.length, Pt = Ye.split(/\s+/).filter((Te) => Te.length > 0).length, ne = {
7645
7645
  html: fe,
7646
7646
  json: ke,
7647
7647
  text: Ye,
7648
7648
  characters: vt,
7649
7649
  words: Pt
7650
7650
  };
7651
- if (p?.(ne), m?.(ne), "onChange" in C && typeof C.onChange == "function") {
7651
+ if (h?.(ne), m?.(ne), "onChange" in S && typeof S.onChange == "function") {
7652
7652
  const Te = {
7653
7653
  target: { value: fe },
7654
7654
  currentTarget: { value: fe }
7655
7655
  };
7656
- C.onChange(Te);
7656
+ S.onChange(Te);
7657
7657
  }
7658
7658
  },
7659
- [p, m, C, x]
7659
+ [h, m, S, k]
7660
7660
  );
7661
- return /* @__PURE__ */ A(H, { ...I(), children: [
7662
- P ? _ : null,
7661
+ return /* @__PURE__ */ A(_, { ...M(), children: [
7662
+ V ? H : null,
7663
7663
  /* @__PURE__ */ u(
7664
7664
  "div",
7665
7665
  {
7666
- ...$(),
7667
- className: F($().className, "flex flex-col w-full p-0 gap-0 rich-text-editor"),
7666
+ ...R(),
7667
+ className: L(R().className, "flex flex-col w-full p-0 gap-0 rich-text-editor"),
7668
7668
  style: {
7669
- maxHeight: O ? `${O + Si.toolbarHeight}px` : void 0,
7670
- overflow: O ? "auto" : void 0
7669
+ maxHeight: N ? `${N + Si.toolbarHeight}px` : void 0,
7670
+ overflow: N ? "auto" : void 0
7671
7671
  },
7672
7672
  children: /* @__PURE__ */ u(
7673
7673
  Ql,
7674
7674
  {
7675
- editable: !b && !y,
7675
+ editable: !y && !b,
7676
7676
  slotBefore: l ? /* @__PURE__ */ u(
7677
7677
  ju,
7678
7678
  {
7679
7679
  modifiers: a,
7680
- zoom: w,
7681
- onZoomChange: S,
7680
+ zoom: I,
7681
+ onZoomChange: C,
7682
7682
  onToolbarAction: v
7683
7683
  }
7684
7684
  ) : void 0,
@@ -7687,7 +7687,7 @@ const ju = ({
7687
7687
  className: "w-full flex-1 outline-none",
7688
7688
  style: {
7689
7689
  minHeight: `${T}px`,
7690
- fontSize: `${w}%`,
7690
+ fontSize: `${I}%`,
7691
7691
  display: "flex",
7692
7692
  flexDirection: "column"
7693
7693
  }
@@ -7697,9 +7697,9 @@ const ju = ({
7697
7697
  class: "focus:outline-none w-full h-full"
7698
7698
  }
7699
7699
  },
7700
- extensions: V,
7700
+ extensions: $,
7701
7701
  content: f || d || t.defaultValue || "",
7702
- onUpdate: X
7702
+ onUpdate: Q
7703
7703
  }
7704
7704
  )
7705
7705
  }
@@ -7714,11 +7714,10 @@ const Ju = tn((t, e) => {
7714
7714
  Ju.displayName = "RichTextArea";
7715
7715
  function Gu(t, e = "en-US", n = "USD") {
7716
7716
  try {
7717
- return new Intl.NumberFormat("en-US", {
7717
+ return new Intl.NumberFormat(e, {
7718
7718
  style: "currency",
7719
7719
  currency: n,
7720
- currencyDisplay: "symbol",
7721
- minimumFractionDigits: 2,
7720
+ minimumFractionDigits: 0,
7722
7721
  maximumFractionDigits: 2
7723
7722
  }).format(t);
7724
7723
  } catch (r) {
@@ -7748,96 +7747,96 @@ const ns = [
7748
7747
  labels: c,
7749
7748
  mobileColumns: d = 2,
7750
7749
  desktopColumns: f = 3,
7751
- isDisabled: p = !1,
7750
+ isDisabled: h = !1,
7752
7751
  buttonVariant: m = "bordered",
7753
7752
  buttonColor: v = "default",
7754
- inputVariant: b = "bordered",
7755
- className: y = "",
7756
- showCard: x = !0
7753
+ inputVariant: y = "bordered",
7754
+ className: b = "",
7755
+ showCard: k = !0
7757
7756
  }) => {
7758
- const C = { ...Zu, ...c }, w = Array.isArray(t) ? t : ns, S = {
7757
+ const S = { ...Zu, ...c }, I = Array.isArray(t) ? t : ns, C = {
7759
7758
  2: "grid-cols-2",
7760
7759
  3: "grid-cols-3"
7761
- }, N = {
7760
+ }, w = {
7762
7761
  3: "sm:grid-cols-3",
7763
7762
  4: "sm:grid-cols-4",
7764
7763
  5: "sm:grid-cols-5",
7765
7764
  6: "sm:grid-cols-6"
7766
- }, T = `${S[d]} ${N[f]}`, [O, V] = $r(
7765
+ }, T = `${C[d]} ${w[f]}`, [N, $] = $r(
7767
7766
  e,
7768
7767
  n,
7769
7768
  r
7770
- ), [H, U] = J(""), P = ce(
7771
- (_) => {
7772
- if (p) return;
7773
- const X = {
7774
- amount: _.amount,
7769
+ ), [_, U] = J(""), V = ce(
7770
+ (H) => {
7771
+ if (h) return;
7772
+ const Q = {
7773
+ amount: H.amount,
7775
7774
  isCustom: !1,
7776
- presetId: _.id
7775
+ presetId: H.id
7777
7776
  };
7778
- V(X), U("");
7777
+ $(Q), U("");
7779
7778
  },
7780
- [p, V]
7781
- ), I = ce(
7782
- (_) => {
7783
- if (p) return;
7784
- if (U(_ !== void 0 ? String(_) : ""), _ === void 0 || isNaN(_)) {
7785
- V(null);
7779
+ [h, $]
7780
+ ), M = ce(
7781
+ (H) => {
7782
+ if (h) return;
7783
+ if (U(H !== void 0 ? String(H) : ""), H === void 0 || isNaN(H)) {
7784
+ $(null);
7786
7785
  return;
7787
7786
  }
7788
- V({
7789
- amount: _,
7787
+ $({
7788
+ amount: H,
7790
7789
  isCustom: !0
7791
7790
  });
7792
7791
  },
7793
- [p, V]
7794
- ), R = B.useMemo(
7792
+ [h, $]
7793
+ ), P = B.useMemo(
7795
7794
  () => ({
7796
7795
  style: "currency",
7797
7796
  currency: i,
7798
7797
  currencyDisplay: "symbol"
7798
+ // Locale is handled by NumberInput internally, but we ensure
7799
+ // the currency and formatting match our locale prop
7799
7800
  }),
7800
7801
  [i]
7801
- ), $ = /* @__PURE__ */ A("div", { className: "space-y-4", "data-testid": "donation-amounts-root", children: [
7802
- C.title && /* @__PURE__ */ u("h2", { className: "text-base font-semibold", "data-testid": "donation-amounts-title", children: C.title }),
7803
- w.length > 0 && /* @__PURE__ */ u("div", { className: F("grid gap-3", T), "data-testid": "donation-amounts-presets", children: w.map((_) => {
7804
- const X = O !== null && !O.isCustom && O.presetId === _.id;
7802
+ ), R = /* @__PURE__ */ A("div", { className: "space-y-4", "data-testid": "donation-amounts-root", children: [
7803
+ S.title && /* @__PURE__ */ u("h2", { className: "text-base font-semibold", "data-testid": "donation-amounts-title", children: S.title }),
7804
+ I.length > 0 && /* @__PURE__ */ u("div", { className: L("grid gap-3", T), "data-testid": "donation-amounts-presets", children: I.map((H) => {
7805
+ const Q = N !== null && !N.isCustom && N.presetId === H.id;
7805
7806
  return /* @__PURE__ */ u(
7806
7807
  oe,
7807
7808
  {
7808
- color: X ? "primary" : v,
7809
- variant: X ? "solid" : m,
7809
+ color: Q ? "primary" : v,
7810
+ variant: Q ? "solid" : m,
7810
7811
  className: "w-full",
7811
- onPress: () => P(_),
7812
- isDisabled: p,
7813
- "data-testid": `donation-amounts-preset-${_.id}`,
7814
- children: _.label || Gu(_.amount, s, i)
7812
+ onPress: () => V(H),
7813
+ isDisabled: h,
7814
+ "data-testid": `donation-amounts-preset-${H.id}`,
7815
+ children: H.label || Gu(H.amount, s, i)
7815
7816
  },
7816
- _.id
7817
+ H.id
7817
7818
  );
7818
7819
  }) }),
7819
7820
  o && /* @__PURE__ */ u(
7820
7821
  Ls,
7821
7822
  {
7822
- placeholder: C.customAmountPlaceholder,
7823
- "aria-label": C.customAmountAriaLabel,
7824
- variant: b,
7825
- radius: "full",
7823
+ placeholder: S.customAmountPlaceholder,
7824
+ "aria-label": S.customAmountAriaLabel,
7825
+ variant: y,
7826
+ radius: "md",
7826
7827
  minValue: l,
7827
7828
  maxValue: a,
7828
7829
  step: 0.01,
7829
- formatOptions: R,
7830
- value: H !== "" ? parseFloat(H) : void 0,
7831
- onValueChange: I,
7832
- isDisabled: p,
7833
- "data-testid": "donation-amounts-custom-input",
7834
- hideStepper: !0,
7835
- size: "md"
7830
+ formatOptions: P,
7831
+ value: _ !== "" ? parseFloat(_) : void 0,
7832
+ onValueChange: M,
7833
+ isDisabled: h,
7834
+ "data-testid": "donation-amounts-custom-input"
7836
7835
  },
7837
- O?.isCustom === !1 ? O.presetId : "custom"
7836
+ N?.isCustom === !1 ? N.presetId : "custom"
7838
7837
  )
7839
7838
  ] });
7840
- return x ? /* @__PURE__ */ u(Ee, { className: F("w-full", y), "data-testid": "donation-amounts-card", children: /* @__PURE__ */ u(Le, { children: $ }) }) : /* @__PURE__ */ u("div", { className: F("w-full", y), "data-testid": "donation-amounts-plain", children: $ });
7839
+ return k ? /* @__PURE__ */ u(Ee, { className: L("w-full", b), "data-testid": "donation-amounts-card", children: /* @__PURE__ */ u(Le, { children: R }) }) : /* @__PURE__ */ u("div", { className: L("w-full", b), "data-testid": "donation-amounts-plain", children: R });
7841
7840
  };
7842
7841
  Qu.displayName = "DonationAmounts";
7843
7842
  const Yu = (t) => {
@@ -7886,30 +7885,30 @@ const Yu = (t) => {
7886
7885
  position: c = "fixed",
7887
7886
  autoStart: d = !0,
7888
7887
  formatTime: f = Yu,
7889
- className: p,
7888
+ className: h,
7890
7889
  ...m
7891
7890
  }, v) => {
7892
- const [b, y] = $r(
7891
+ const [y, b] = $r(
7893
7892
  t !== void 0 ? Math.max(0, t) : void 0,
7894
7893
  Math.max(0, e),
7895
7894
  n
7896
- ), x = It(null), C = It(!1);
7895
+ ), k = It(null), S = It(!1);
7897
7896
  qe(() => () => {
7898
- x.current && clearInterval(x.current);
7897
+ k.current && clearInterval(k.current);
7899
7898
  }, []), qe(() => {
7900
- if (!d || b <= 0) {
7901
- x.current && (clearInterval(x.current), x.current = null);
7899
+ if (!d || y <= 0) {
7900
+ k.current && (clearInterval(k.current), k.current = null);
7902
7901
  return;
7903
7902
  }
7904
- return x.current = setInterval(() => {
7905
- y((T) => T <= 1 ? (x.current && (clearInterval(x.current), x.current = null), C.current || (C.current = !0, r?.()), 0) : T - 1);
7903
+ return k.current = setInterval(() => {
7904
+ b((T) => T <= 1 ? (k.current && (clearInterval(k.current), k.current = null), S.current || (S.current = !0, r?.()), 0) : T - 1);
7906
7905
  }, 1e3), () => {
7907
- x.current && (clearInterval(x.current), x.current = null);
7906
+ k.current && (clearInterval(k.current), k.current = null);
7908
7907
  };
7909
- }, [d, b, y, r]), qe(() => {
7910
- b > 0 && (C.current = !1);
7911
- }, [b]);
7912
- const w = a || Xu(i), S = ed(s), N = {
7908
+ }, [d, y, b, r]), qe(() => {
7909
+ y > 0 && (S.current = !1);
7910
+ }, [y]);
7911
+ const I = a || Xu(i), C = ed(s), w = {
7913
7912
  fixed: "fixed top-0 left-0",
7914
7913
  sticky: "sticky top-0",
7915
7914
  static: "static"
@@ -7920,9 +7919,9 @@ const Yu = (t) => {
7920
7919
  ref: v,
7921
7920
  role: "banner",
7922
7921
  "aria-live": "polite",
7923
- "aria-label": `${o} ${f(b)}`,
7922
+ "aria-label": `${o} ${f(y)}`,
7924
7923
  "data-testid": "expire-cart-timer",
7925
- className: F("w-full text-white z-50", S, N[c], p),
7924
+ className: L("w-full text-white z-50", C, w[c], h),
7926
7925
  ...m,
7927
7926
  children: /* @__PURE__ */ u("div", { className: "container mx-auto px-4 py-3 sm:py-2.5", "data-testid": "expire-cart-timer-container", children: /* @__PURE__ */ A("div", { className: "flex items-center justify-between gap-3 sm:gap-4", children: [
7928
7927
  /* @__PURE__ */ A(
@@ -7937,7 +7936,7 @@ const Yu = (t) => {
7937
7936
  className: "flex-shrink-0 w-[0.875rem] h-[0.875rem] sm:w-4 sm:h-4 rounded-full bg-white flex items-center justify-center overflow-hidden",
7938
7937
  "data-testid": "expire-cart-timer-icon-wrapper",
7939
7938
  children: /* @__PURE__ */ u(
7940
- w,
7939
+ I,
7941
7940
  {
7942
7941
  className: "text-primary-500 sm:text-primary-600",
7943
7942
  "aria-hidden": "true",
@@ -7962,9 +7961,9 @@ const Yu = (t) => {
7962
7961
  "span",
7963
7962
  {
7964
7963
  className: "text-sm sm:text-base font-semibold text-white",
7965
- "aria-label": `Time remaining: ${f(b)}`,
7964
+ "aria-label": `Time remaining: ${f(y)}`,
7966
7965
  "data-testid": "expire-cart-timer-value",
7967
- children: f(b)
7966
+ children: f(y)
7968
7967
  }
7969
7968
  ) })
7970
7969
  ] }) })
@@ -8215,29 +8214,29 @@ function gd(t, e) {
8215
8214
  height: n.height
8216
8215
  };
8217
8216
  let s = n.body;
8218
- [n, r].forEach((b) => {
8219
- const y = [], x = b.hFlip, C = b.vFlip;
8220
- let w = b.rotate;
8221
- x ? C ? w += 2 : (y.push("translate(" + (i.width + i.left).toString() + " " + (0 - i.top).toString() + ")"), y.push("scale(-1 1)"), i.top = i.left = 0) : C && (y.push("translate(" + (0 - i.left).toString() + " " + (i.height + i.top).toString() + ")"), y.push("scale(1 -1)"), i.top = i.left = 0);
8222
- let S;
8223
- switch (w < 0 && (w -= Math.floor(w / 4) * 4), w = w % 4, w) {
8217
+ [n, r].forEach((y) => {
8218
+ const b = [], k = y.hFlip, S = y.vFlip;
8219
+ let I = y.rotate;
8220
+ k ? S ? I += 2 : (b.push("translate(" + (i.width + i.left).toString() + " " + (0 - i.top).toString() + ")"), b.push("scale(-1 1)"), i.top = i.left = 0) : S && (b.push("translate(" + (0 - i.left).toString() + " " + (i.height + i.top).toString() + ")"), b.push("scale(1 -1)"), i.top = i.left = 0);
8221
+ let C;
8222
+ switch (I < 0 && (I -= Math.floor(I / 4) * 4), I = I % 4, I) {
8224
8223
  case 1:
8225
- S = i.height / 2 + i.top, y.unshift("rotate(90 " + S.toString() + " " + S.toString() + ")");
8224
+ C = i.height / 2 + i.top, b.unshift("rotate(90 " + C.toString() + " " + C.toString() + ")");
8226
8225
  break;
8227
8226
  case 2:
8228
- y.unshift("rotate(180 " + (i.width / 2 + i.left).toString() + " " + (i.height / 2 + i.top).toString() + ")");
8227
+ b.unshift("rotate(180 " + (i.width / 2 + i.left).toString() + " " + (i.height / 2 + i.top).toString() + ")");
8229
8228
  break;
8230
8229
  case 3:
8231
- S = i.width / 2 + i.left, y.unshift("rotate(-90 " + S.toString() + " " + S.toString() + ")");
8230
+ C = i.width / 2 + i.left, b.unshift("rotate(-90 " + C.toString() + " " + C.toString() + ")");
8232
8231
  break;
8233
8232
  }
8234
- w % 2 === 1 && (i.left !== i.top && (S = i.left, i.left = i.top, i.top = S), i.width !== i.height && (S = i.width, i.width = i.height, i.height = S)), y.length && (s = pd(s, '<g transform="' + y.join(" ") + '">', "</g>"));
8233
+ I % 2 === 1 && (i.left !== i.top && (C = i.left, i.left = i.top, i.top = C), i.width !== i.height && (C = i.width, i.width = i.height, i.height = C)), b.length && (s = pd(s, '<g transform="' + b.join(" ") + '">', "</g>"));
8235
8234
  });
8236
8235
  const o = r.width, l = r.height, a = i.width, c = i.height;
8237
8236
  let d, f;
8238
8237
  o === null ? (f = l === null ? "1em" : l === "auto" ? c : l, d = os(f, a / c)) : (d = o === "auto" ? a : o, f = l === null ? os(d, c / a) : l === "auto" ? c : l);
8239
- const p = {}, m = (b, y) => {
8240
- md(y) || (p[b] = y.toString());
8238
+ const h = {}, m = (y, b) => {
8239
+ md(b) || (h[y] = b.toString());
8241
8240
  };
8242
8241
  m("width", d), m("height", f);
8243
8242
  const v = [
@@ -8246,8 +8245,8 @@ function gd(t, e) {
8246
8245
  a,
8247
8246
  c
8248
8247
  ];
8249
- return p.viewBox = v.join(" "), {
8250
- attributes: p,
8248
+ return h.viewBox = v.join(" "), {
8249
+ attributes: h,
8251
8250
  viewBox: v,
8252
8251
  body: s
8253
8252
  };
@@ -8491,97 +8490,97 @@ function Rd(t, e, n, r) {
8491
8490
  if (t.random) {
8492
8491
  let T = t.resources.slice(0);
8493
8492
  for (o = []; T.length > 1; ) {
8494
- const O = Math.floor(Math.random() * T.length);
8495
- o.push(T[O]), T = T.slice(0, O).concat(T.slice(O + 1));
8493
+ const N = Math.floor(Math.random() * T.length);
8494
+ o.push(T[N]), T = T.slice(0, N).concat(T.slice(N + 1));
8496
8495
  }
8497
8496
  o = o.concat(T);
8498
8497
  } else o = t.resources.slice(s).concat(t.resources.slice(0, s));
8499
8498
  const l = Date.now();
8500
- let a = "pending", c = 0, d, f = null, p = [], m = [];
8499
+ let a = "pending", c = 0, d, f = null, h = [], m = [];
8501
8500
  typeof r == "function" && m.push(r);
8502
8501
  function v() {
8503
8502
  f && (clearTimeout(f), f = null);
8504
8503
  }
8505
- function b() {
8506
- a === "pending" && (a = "aborted"), v(), p.forEach((T) => {
8504
+ function y() {
8505
+ a === "pending" && (a = "aborted"), v(), h.forEach((T) => {
8507
8506
  T.status === "pending" && (T.status = "aborted");
8508
- }), p = [];
8507
+ }), h = [];
8509
8508
  }
8510
- function y(T, O) {
8511
- O && (m = []), typeof T == "function" && m.push(T);
8509
+ function b(T, N) {
8510
+ N && (m = []), typeof T == "function" && m.push(T);
8512
8511
  }
8513
- function x() {
8512
+ function k() {
8514
8513
  return {
8515
8514
  startTime: l,
8516
8515
  payload: e,
8517
8516
  status: a,
8518
8517
  queriesSent: c,
8519
- queriesPending: p.length,
8520
- subscribe: y,
8521
- abort: b
8518
+ queriesPending: h.length,
8519
+ subscribe: b,
8520
+ abort: y
8522
8521
  };
8523
8522
  }
8524
- function C() {
8523
+ function S() {
8525
8524
  a = "failed", m.forEach((T) => {
8526
8525
  T(void 0, d);
8527
8526
  });
8528
8527
  }
8529
- function w() {
8530
- p.forEach((T) => {
8528
+ function I() {
8529
+ h.forEach((T) => {
8531
8530
  T.status === "pending" && (T.status = "aborted");
8532
- }), p = [];
8531
+ }), h = [];
8533
8532
  }
8534
- function S(T, O, V) {
8535
- const H = O !== "success";
8536
- switch (p = p.filter((U) => U !== T), a) {
8533
+ function C(T, N, $) {
8534
+ const _ = N !== "success";
8535
+ switch (h = h.filter((U) => U !== T), a) {
8537
8536
  case "pending":
8538
8537
  break;
8539
8538
  case "failed":
8540
- if (H || !t.dataAfterTimeout) return;
8539
+ if (_ || !t.dataAfterTimeout) return;
8541
8540
  break;
8542
8541
  default:
8543
8542
  return;
8544
8543
  }
8545
- if (O === "abort") {
8546
- d = V, C();
8544
+ if (N === "abort") {
8545
+ d = $, S();
8547
8546
  return;
8548
8547
  }
8549
- if (H) {
8550
- d = V, p.length || (o.length ? N() : C());
8548
+ if (_) {
8549
+ d = $, h.length || (o.length ? w() : S());
8551
8550
  return;
8552
8551
  }
8553
- if (v(), w(), !t.random) {
8552
+ if (v(), I(), !t.random) {
8554
8553
  const U = t.resources.indexOf(T.resource);
8555
8554
  U !== -1 && U !== t.index && (t.index = U);
8556
8555
  }
8557
8556
  a = "completed", m.forEach((U) => {
8558
- U(V);
8557
+ U($);
8559
8558
  });
8560
8559
  }
8561
- function N() {
8560
+ function w() {
8562
8561
  if (a !== "pending") return;
8563
8562
  v();
8564
8563
  const T = o.shift();
8565
8564
  if (T === void 0) {
8566
- if (p.length) {
8565
+ if (h.length) {
8567
8566
  f = setTimeout(() => {
8568
- v(), a === "pending" && (w(), C());
8567
+ v(), a === "pending" && (I(), S());
8569
8568
  }, t.timeout);
8570
8569
  return;
8571
8570
  }
8572
- C();
8571
+ S();
8573
8572
  return;
8574
8573
  }
8575
- const O = {
8574
+ const N = {
8576
8575
  status: "pending",
8577
8576
  resource: T,
8578
- callback: (V, H) => {
8579
- S(O, V, H);
8577
+ callback: ($, _) => {
8578
+ C(N, $, _);
8580
8579
  }
8581
8580
  };
8582
- p.push(O), c++, f = setTimeout(N, t.rotate), n(T, e, O.callback);
8581
+ h.push(N), c++, f = setTimeout(w, t.rotate), n(T, e, N.callback);
8583
8582
  }
8584
- return setTimeout(N), x;
8583
+ return setTimeout(w), k;
8585
8584
  }
8586
8585
  function Ko(t) {
8587
8586
  const e = {
@@ -8593,8 +8592,8 @@ function Ko(t) {
8593
8592
  n = n.filter((l) => l().status === "pending");
8594
8593
  }
8595
8594
  function i(l, a, c) {
8596
- const d = Rd(e, l, a, (f, p) => {
8597
- r(), c && c(f, p);
8595
+ const d = Rd(e, l, a, (f, h) => {
8596
+ r(), c && c(f, h);
8598
8597
  });
8599
8598
  return n.push(d), d;
8600
8599
  }
@@ -8700,10 +8699,10 @@ function _d(t, e) {
8700
8699
  if (s) {
8701
8700
  i.forEach((d) => {
8702
8701
  const f = s(d, r, n);
8703
- us(f, (p) => {
8704
- const m = p ? {
8702
+ us(f, (h) => {
8703
+ const m = h ? {
8705
8704
  prefix: r,
8706
- icons: { [d]: p }
8705
+ icons: { [d]: h }
8707
8706
  } : null;
8708
8707
  zt(t, [d], m);
8709
8708
  });
@@ -8743,7 +8742,7 @@ const Hd = (t, e) => {
8743
8742
  const f = i[c] || (i[c] = /* @__PURE__ */ Object.create(null));
8744
8743
  f[d] || (f[d] = []);
8745
8744
  }), r.pending.forEach((a) => {
8746
- const { provider: c, prefix: d, name: f } = a, p = Ft(c, d), m = p.pendingIcons || (p.pendingIcons = /* @__PURE__ */ new Set());
8745
+ const { provider: c, prefix: d, name: f } = a, h = Ft(c, d), m = h.pendingIcons || (h.pendingIcons = /* @__PURE__ */ new Set());
8747
8746
  m.has(f) || (m.add(f), i[c][d].push(f));
8748
8747
  }), s.forEach((a) => {
8749
8748
  const c = i[a.provider][a.prefix];
@@ -8861,21 +8860,21 @@ const nf = (t, e, n) => {
8861
8860
  ...s === "svg" ? Xd : {}
8862
8861
  };
8863
8862
  if (n) {
8864
- const y = $n(n, !1, !0);
8865
- if (y) {
8866
- const x = ["iconify"], C = [
8863
+ const b = $n(n, !1, !0);
8864
+ if (b) {
8865
+ const k = ["iconify"], S = [
8867
8866
  "provider",
8868
8867
  "prefix"
8869
8868
  ];
8870
- for (const w of C)
8871
- y[w] && x.push("iconify--" + y[w]);
8872
- a.className = x.join(" ");
8869
+ for (const I of S)
8870
+ b[I] && k.push("iconify--" + b[I]);
8871
+ a.className = k.join(" ");
8873
8872
  }
8874
8873
  }
8875
- for (let y in e) {
8876
- const x = e[y];
8877
- if (x !== void 0)
8878
- switch (y) {
8874
+ for (let b in e) {
8875
+ const k = e[b];
8876
+ if (k !== void 0)
8877
+ switch (b) {
8879
8878
  // Properties to ignore
8880
8879
  case "icon":
8881
8880
  case "style":
@@ -8887,38 +8886,38 @@ const nf = (t, e, n) => {
8887
8886
  break;
8888
8887
  // Forward ref
8889
8888
  case "_ref":
8890
- a.ref = x;
8889
+ a.ref = k;
8891
8890
  break;
8892
8891
  // Merge class names
8893
8892
  case "className":
8894
- a[y] = (a[y] ? a[y] + " " : "") + x;
8893
+ a[b] = (a[b] ? a[b] + " " : "") + k;
8895
8894
  break;
8896
8895
  // Boolean attributes
8897
8896
  case "inline":
8898
8897
  case "hFlip":
8899
8898
  case "vFlip":
8900
- i[y] = x === !0 || x === "true" || x === 1;
8899
+ i[b] = k === !0 || k === "true" || k === 1;
8901
8900
  break;
8902
8901
  // Flip as string: 'horizontal,vertical'
8903
8902
  case "flip":
8904
- typeof x == "string" && Kd(i, x);
8903
+ typeof k == "string" && Kd(i, k);
8905
8904
  break;
8906
8905
  // Color: copy to style
8907
8906
  case "color":
8908
- o.color = x;
8907
+ o.color = k;
8909
8908
  break;
8910
8909
  // Rotation as string
8911
8910
  case "rotate":
8912
- typeof x == "string" ? i[y] = jd(x) : typeof x == "number" && (i[y] = x);
8911
+ typeof k == "string" ? i[b] = jd(k) : typeof k == "number" && (i[b] = k);
8913
8912
  break;
8914
8913
  // Remove aria-hidden
8915
8914
  case "ariaHidden":
8916
8915
  case "aria-hidden":
8917
- x !== !0 && x !== "true" && delete a["aria-hidden"];
8916
+ k !== !0 && k !== "true" && delete a["aria-hidden"];
8918
8917
  break;
8919
8918
  // Copy missing property if it does not exist in customisations
8920
8919
  default:
8921
- r[y] === void 0 && (a[y] = x);
8920
+ r[b] === void 0 && (a[b] = k);
8922
8921
  }
8923
8922
  }
8924
8923
  const c = gd(t, i), d = c.attributes;
@@ -8927,19 +8926,19 @@ const nf = (t, e, n) => {
8927
8926
  ...o,
8928
8927
  ...l
8929
8928
  }, Object.assign(a, d);
8930
- let y = 0, x = e.id;
8931
- return typeof x == "string" && (x = x.replace(/-/g, "_")), a.dangerouslySetInnerHTML = {
8932
- __html: Yd(kd(c.body, x ? () => x + "ID" + y++ : "iconifyReact"))
8929
+ let b = 0, k = e.id;
8930
+ return typeof k == "string" && (k = k.replace(/-/g, "_")), a.dangerouslySetInnerHTML = {
8931
+ __html: Yd(kd(c.body, k ? () => k + "ID" + b++ : "iconifyReact"))
8933
8932
  }, dr("svg", a);
8934
8933
  }
8935
- const { body: f, width: p, height: m } = t, v = s === "mask" || (s === "bg" ? !1 : f.indexOf("currentColor") !== -1), b = Wd(f, {
8934
+ const { body: f, width: h, height: m } = t, v = s === "mask" || (s === "bg" ? !1 : f.indexOf("currentColor") !== -1), y = Wd(f, {
8936
8935
  ...d,
8937
- width: p + "",
8936
+ width: h + "",
8938
8937
  height: m + ""
8939
8938
  });
8940
8939
  return a.style = {
8941
8940
  ...o,
8942
- "--svg": Zd(b),
8941
+ "--svg": Zd(y),
8943
8942
  width: hs(d.width),
8944
8943
  height: hs(d.height),
8945
8944
  ...ef,
@@ -8990,11 +8989,11 @@ function Jo(t) {
8990
8989
  name: "",
8991
8990
  data: v
8992
8991
  };
8993
- const b = ss(v);
8994
- if (b)
8992
+ const y = ss(v);
8993
+ if (y)
8995
8994
  return {
8996
8995
  name: v,
8997
- data: b
8996
+ data: y
8998
8997
  };
8999
8998
  }
9000
8999
  return {
@@ -9020,25 +9019,25 @@ function Jo(t) {
9020
9019
  });
9021
9020
  return;
9022
9021
  }
9023
- const b = ss(v);
9022
+ const y = ss(v);
9024
9023
  if (c({
9025
9024
  name: v,
9026
- data: b
9025
+ data: y
9027
9026
  }))
9028
- if (b === void 0) {
9029
- const y = Hd([v], d);
9027
+ if (y === void 0) {
9028
+ const b = Hd([v], d);
9030
9029
  i({
9031
- callback: y
9030
+ callback: b
9032
9031
  });
9033
- } else b && ((m = t.onLoad) === null || m === void 0 || m.call(t, v));
9032
+ } else y && ((m = t.onLoad) === null || m === void 0 || m.call(t, v));
9034
9033
  }
9035
9034
  qe(() => (n(!0), a), []), qe(() => {
9036
9035
  e && d();
9037
9036
  }, [t.icon, e]);
9038
- const { name: f, data: p } = o;
9039
- return p ? nf({
9037
+ const { name: f, data: h } = o;
9038
+ return h ? nf({
9040
9039
  ...Zr,
9041
- ...p
9040
+ ...h
9042
9041
  }, t, f) : t.children ? t.children : t.fallback ? t.fallback : dr("span", {});
9043
9042
  }
9044
9043
  const Ie = tn((t, e) => Jo({
@@ -9069,16 +9068,16 @@ const lr = ({
9069
9068
  showMoreButtonClassName: a,
9070
9069
  labels: c
9071
9070
  }) => {
9072
- const [d, f] = J(!1), [p, m] = J(!1), v = It(null);
9071
+ const [d, f] = J(!1), [h, m] = J(!1), v = It(null);
9073
9072
  return qe(() => {
9074
- const b = () => {
9073
+ const y = () => {
9075
9074
  if (v.current) {
9076
- const y = v.current.scrollHeight > v.current.clientHeight;
9077
- m(y);
9075
+ const b = v.current.scrollHeight > v.current.clientHeight;
9076
+ m(b);
9078
9077
  }
9079
9078
  };
9080
- return b(), window.addEventListener("resize", b), () => window.removeEventListener("resize", b);
9081
- }, [o]), /* @__PURE__ */ A(Ee, { className: F("border-0 shadow-none", t), "data-testid": "event-details-root", children: [
9079
+ return y(), window.addEventListener("resize", y), () => window.removeEventListener("resize", y);
9080
+ }, [o]), /* @__PURE__ */ A(Ee, { className: L("border-0 shadow-none", t), "data-testid": "event-details-root", children: [
9082
9081
  /* @__PURE__ */ A(Fs, { className: "pt-2 pb-0 flex-col items-start space-y-2", "data-testid": "event-details-header", children: [
9083
9082
  l && n && /* @__PURE__ */ u(
9084
9083
  "div",
@@ -9110,7 +9109,7 @@ const lr = ({
9110
9109
  "div",
9111
9110
  {
9112
9111
  ref: v,
9113
- className: F(
9112
+ className: L(
9114
9113
  "text-sm text-gray-700 leading-relaxed transition-all",
9115
9114
  !d && "line-clamp-3"
9116
9115
  ),
@@ -9118,12 +9117,12 @@ const lr = ({
9118
9117
  dangerouslySetInnerHTML: { __html: o }
9119
9118
  }
9120
9119
  ),
9121
- (p || d) && /* @__PURE__ */ u("div", { className: "flex justify-end mt-1", children: /* @__PURE__ */ u(
9120
+ (h || d) && /* @__PURE__ */ u("div", { className: "flex justify-end mt-1", children: /* @__PURE__ */ u(
9122
9121
  oe,
9123
9122
  {
9124
9123
  onPress: () => f(!d),
9125
9124
  variant: "light",
9126
- className: F("text-primary", a),
9125
+ className: L("text-primary", a),
9127
9126
  startContent: /* @__PURE__ */ u(
9128
9127
  Ie,
9129
9128
  {
@@ -9177,33 +9176,33 @@ const sf = {
9177
9176
  buttonVariant: c = "bordered",
9178
9177
  buttonColor: d = "default",
9179
9178
  showCard: f = !0,
9180
- showDescription: p = !0,
9179
+ showDescription: h = !0,
9181
9180
  showPeopleCount: m = !0,
9182
9181
  showPrice: v = !0,
9183
- classNames: b = {},
9184
- "data-testid": y,
9185
- selectedColor: x = "default"
9182
+ classNames: y = {},
9183
+ "data-testid": b,
9184
+ selectedColor: k = "default"
9186
9185
  }) => {
9187
- const C = { ...sf, ...o }, [w, S] = J(n), N = e !== void 0 ? e : w, T = (fe) => {
9186
+ const S = { ...sf, ...o }, [I, C] = J(n), w = e !== void 0 ? e : I, T = (fe) => {
9188
9187
  if (a) return;
9189
- const ke = Math.max(0, N + fe);
9190
- e === void 0 && S(ke), r?.(t.id, ke);
9191
- }, O = mt(() => !dn(t.totalTicketsSold) || !dn(t.ticketsAllowed) ? !1 : t.totalTicketsSold >= t.ticketsAllowed, [t.totalTicketsSold, t.ticketsAllowed]), V = mt(() => O || !dn(t.ticketsAllowed) ? !1 : N >= t.ticketsAllowed - (t.totalTicketsSold ?? 0), [O, t.ticketsAllowed, t.totalTicketsSold, N]), H = rf(t.price, s, i), U = () => l?.renderName ? l.renderName(t.name, t) : /* @__PURE__ */ u("h2", { "data-testid": "offer-card-name", className: F("text-base font-medium", b.name), children: t.name }), P = () => v ? l?.renderPrice ? l.renderPrice(t.price, H, t) : /* @__PURE__ */ u("p", { "data-testid": "offer-card-price", className: F("text-primary text-base mt-1", b.price), children: H }) : null, I = () => !p || !t.description ? null : l?.renderDescription ? l.renderDescription(t.description, t) : /* @__PURE__ */ u(
9188
+ const ke = Math.max(0, w + fe);
9189
+ e === void 0 && C(ke), r?.(t.id, ke);
9190
+ }, N = it(() => !dn(t.totalTicketsSold) || !dn(t.ticketsAllowed) ? !1 : t.totalTicketsSold >= t.ticketsAllowed, [t.totalTicketsSold, t.ticketsAllowed]), $ = it(() => N || !dn(t.ticketsAllowed) ? !1 : w >= t.ticketsAllowed - (t.totalTicketsSold ?? 0), [N, t.ticketsAllowed, t.totalTicketsSold, w]), _ = rf(t.price, s, i), U = () => l?.renderName ? l.renderName(t.name, t) : /* @__PURE__ */ u("h2", { "data-testid": "offer-card-name", className: L("text-base font-medium", y.name), children: t.name }), V = () => v ? l?.renderPrice ? l.renderPrice(t.price, _, t) : /* @__PURE__ */ u("p", { "data-testid": "offer-card-price", className: L("text-primary text-base mt-1", y.price), children: _ }) : null, M = () => !h || !t.description ? null : l?.renderDescription ? l.renderDescription(t.description, t) : /* @__PURE__ */ u(
9192
9191
  "p",
9193
9192
  {
9194
9193
  "data-testid": "offer-card-description",
9195
- className: F("mb-4 text-sm text-gray-700 leading-relaxed", b.description),
9194
+ className: L("mb-4 text-sm text-gray-700 leading-relaxed", y.description),
9196
9195
  children: t.description
9197
9196
  }
9198
- ), R = () => {
9197
+ ), P = () => {
9199
9198
  if (!m || !dn(t.numberOfPeople) || t.numberOfPeople <= 0)
9200
9199
  return null;
9201
- const fe = t.numberOfPeople === 1 ? C.person : C.people;
9200
+ const fe = t.numberOfPeople === 1 ? S.person : S.people;
9202
9201
  return l?.renderPeopleCount ? l.renderPeopleCount(t.numberOfPeople, fe, t) : /* @__PURE__ */ A(
9203
9202
  "p",
9204
9203
  {
9205
9204
  "data-testid": "offer-card-people-count",
9206
- className: F("text-sm text-gray-600 flex items-center mt-2", b.peopleCount),
9205
+ className: L("text-sm text-gray-600 flex items-center mt-2", y.peopleCount),
9207
9206
  children: [
9208
9207
  /* @__PURE__ */ u(
9209
9208
  Ie,
@@ -9219,16 +9218,16 @@ const sf = {
9219
9218
  ]
9220
9219
  }
9221
9220
  );
9222
- }, $ = () => {
9223
- const fe = N === 0 || a, ke = V || a;
9221
+ }, R = () => {
9222
+ const fe = w === 0 || a, ke = $ || a;
9224
9223
  return l?.renderQuantitySelector ? l.renderQuantitySelector({
9225
- quantity: N,
9224
+ quantity: w,
9226
9225
  onIncrement: () => T(1),
9227
9226
  onDecrement: () => T(-1),
9228
9227
  isDecrementDisabled: fe,
9229
9228
  isIncrementDisabled: ke,
9230
9229
  isDisabled: a
9231
- }) : /* @__PURE__ */ A("div", { className: F("flex items-center gap-2", b.quantitySelector), children: [
9230
+ }) : /* @__PURE__ */ A("div", { className: L("flex items-center gap-2", y.quantitySelector), children: [
9232
9231
  /* @__PURE__ */ u(
9233
9232
  oe,
9234
9233
  {
@@ -9236,7 +9235,7 @@ const sf = {
9236
9235
  onPress: () => T(-1),
9237
9236
  isDisabled: fe,
9238
9237
  variant: c,
9239
- color: N > 0 ? x : d,
9238
+ color: w > 0 ? k : d,
9240
9239
  radius: "full",
9241
9240
  isIconOnly: !0,
9242
9241
  size: "sm",
@@ -9244,7 +9243,7 @@ const sf = {
9244
9243
  children: /* @__PURE__ */ u(Ie, { icon: "gravity-ui:minus", width: 16 })
9245
9244
  }
9246
9245
  ),
9247
- /* @__PURE__ */ u("span", { "data-testid": "offer-card-quantity", className: F("min-w-[2rem] text-center font-medium"), children: N }),
9246
+ /* @__PURE__ */ u("span", { "data-testid": "offer-card-quantity", className: L("min-w-[2rem] text-center font-medium"), children: w }),
9248
9247
  /* @__PURE__ */ u(
9249
9248
  oe,
9250
9249
  {
@@ -9252,7 +9251,7 @@ const sf = {
9252
9251
  onPress: () => T(1),
9253
9252
  isDisabled: ke,
9254
9253
  variant: c,
9255
- color: N > 0 ? x : d,
9254
+ color: w > 0 ? k : d,
9256
9255
  radius: "full",
9257
9256
  isIconOnly: !0,
9258
9257
  size: "sm",
@@ -9261,16 +9260,16 @@ const sf = {
9261
9260
  }
9262
9261
  )
9263
9262
  ] });
9264
- }, _ = () => l?.renderSoldOut ? l.renderSoldOut(C.soldOut) : /* @__PURE__ */ u(
9263
+ }, H = () => l?.renderSoldOut ? l.renderSoldOut(S.soldOut) : /* @__PURE__ */ u(
9265
9264
  gi,
9266
9265
  {
9267
9266
  "data-testid": "offer-card-sold-out-chip",
9268
9267
  color: "danger",
9269
- className: F("gap-2 px-4 h-8", b.soldOut),
9268
+ className: L("gap-2 px-4 h-8", y.soldOut),
9270
9269
  startContent: /* @__PURE__ */ u(Ie, { icon: "gravity-ui:circle-info-fill", width: 14 }),
9271
- children: /* @__PURE__ */ u("span", { className: "font-medium text-sm", children: C.soldOut })
9270
+ children: /* @__PURE__ */ u("span", { className: "font-medium text-sm", children: S.soldOut })
9272
9271
  }
9273
- ), X = () => l?.renderMaxReachedAlert ? l.renderMaxReachedAlert(C.maxReached) : /* @__PURE__ */ u(
9272
+ ), Q = () => l?.renderMaxReachedAlert ? l.renderMaxReachedAlert(S.maxReached) : /* @__PURE__ */ u(
9274
9273
  gi,
9275
9274
  {
9276
9275
  "data-testid": "offer-card-max-reached-chip",
@@ -9280,30 +9279,30 @@ const sf = {
9280
9279
  base: "gap-2 px-4 h-10",
9281
9280
  content: "text-black"
9282
9281
  },
9283
- className: F(" text-black! gap-2 px-4 h-10", b.maxReachedAlert),
9282
+ className: L(" text-black! gap-2 px-4 h-10", y.maxReachedAlert),
9284
9283
  startContent: /* @__PURE__ */ u(Ie, { icon: "gravity-ui:triangle-exclamation-fill", className: "text-black", width: 16 }),
9285
- children: /* @__PURE__ */ u("span", { className: "font-medium text-sm", children: C.maxReached })
9284
+ children: /* @__PURE__ */ u("span", { className: "font-medium text-sm", children: S.maxReached })
9286
9285
  }
9287
9286
  ), W = /* @__PURE__ */ A("div", { className: "grid grid-cols-1 md:grid-cols-1 xl:grid-cols-3 lg:grid-cols-3 gap-2 items-start", children: [
9288
- /* @__PURE__ */ A("div", { className: F("h-full col-span-2", O ? "opacity-50 pointer-events-none select-none" : ""), children: [
9287
+ /* @__PURE__ */ A("div", { className: L("h-full col-span-2", N ? "opacity-50 pointer-events-none select-none" : ""), children: [
9289
9288
  U(),
9290
- P(),
9289
+ V(),
9291
9290
  /* @__PURE__ */ A(
9292
9291
  "div",
9293
9292
  {
9294
- className: F(
9293
+ className: L(
9295
9294
  "md:col-span-1 xl:col-span-2 lg:col-span-1 mb-2",
9296
- O ? "opacity-50 pointer-events-none select-none" : ""
9295
+ N ? "opacity-50 pointer-events-none select-none" : ""
9297
9296
  ),
9298
9297
  children: [
9299
- R(),
9300
- I()
9298
+ P(),
9299
+ M()
9301
9300
  ]
9302
9301
  }
9303
9302
  )
9304
9303
  ] }),
9305
- /* @__PURE__ */ u("div", { className: "space-x-2 pt-0 pb-2 md:p-2 h-full flex items-center justify-start md:justify-start lg:justify-end", children: O ? _() : $() })
9306
- ] }), xe = V && !O && /* @__PURE__ */ u(
9304
+ /* @__PURE__ */ u("div", { className: "space-x-2 pt-0 pb-2 md:p-2 h-full flex items-center justify-start md:justify-start lg:justify-end", children: N ? H() : R() })
9305
+ ] }), xe = $ && !N && /* @__PURE__ */ u(
9307
9306
  hr.div,
9308
9307
  {
9309
9308
  className: "w-full sm:max-w-[60%] md:max-w-[60%] lg:max-w-[60%]",
@@ -9311,15 +9310,15 @@ const sf = {
9311
9310
  animate: { opacity: 1, y: 0 },
9312
9311
  exit: { opacity: 0, y: 10 },
9313
9312
  transition: { duration: 0.3 },
9314
- children: X()
9313
+ children: Q()
9315
9314
  }
9316
9315
  );
9317
- return f ? /* @__PURE__ */ A(Ee, { className: F("w-full", b.base), "data-testid": y || `offer-card-${t.id}`, children: [
9318
- /* @__PURE__ */ u(Le, { className: F("pt-1 pb-0", b.body), children: W }),
9319
- /* @__PURE__ */ u(pr, { children: xe && /* @__PURE__ */ u(kl, { className: F("w-full mt-0 pt-0", b.footer), children: xe }) })
9320
- ] }) : /* @__PURE__ */ A("div", { className: F("w-full", b.base), "data-testid": y || `offer-card-${t.id}`, children: [
9321
- /* @__PURE__ */ u("div", { className: F("pt-1 pb-0", b.body), children: W }),
9322
- /* @__PURE__ */ u(pr, { children: xe && /* @__PURE__ */ u("div", { className: F("w-full mt-0 pt-0", b.footer), children: xe }) })
9316
+ return f ? /* @__PURE__ */ A(Ee, { className: L("w-full", y.base), "data-testid": b || `offer-card-${t.id}`, children: [
9317
+ /* @__PURE__ */ u(Le, { className: L("pt-1 pb-0", y.body), children: W }),
9318
+ /* @__PURE__ */ u(pr, { children: xe && /* @__PURE__ */ u(kl, { className: L("w-full mt-0 pt-0", y.footer), children: xe }) })
9319
+ ] }) : /* @__PURE__ */ A("div", { className: L("w-full", y.base), "data-testid": b || `offer-card-${t.id}`, children: [
9320
+ /* @__PURE__ */ u("div", { className: L("pt-1 pb-0", y.body), children: W }),
9321
+ /* @__PURE__ */ u(pr, { children: xe && /* @__PURE__ */ u("div", { className: L("w-full mt-0 pt-0", y.footer), children: xe }) })
9323
9322
  ] });
9324
9323
  };
9325
9324
  Go.displayName = "OfferCard";
@@ -9333,13 +9332,13 @@ const of = ({
9333
9332
  }) => {
9334
9333
  if (s) {
9335
9334
  const l = s();
9336
- return r ? /* @__PURE__ */ u(Ee, { "data-testid": "offer-card-empty", className: F("w-full", i.base), children: /* @__PURE__ */ u(Le, { "data-testid": "offer-card-empty-body", children: l }) }) : /* @__PURE__ */ u("div", { "data-testid": "offer-card-empty", className: F("w-full", i.base), children: l });
9335
+ return r ? /* @__PURE__ */ u(Ee, { "data-testid": "offer-card-empty", className: L("w-full", i.base), children: /* @__PURE__ */ u(Le, { "data-testid": "offer-card-empty-body", children: l }) }) : /* @__PURE__ */ u("div", { "data-testid": "offer-card-empty", className: L("w-full", i.base), children: l });
9337
9336
  }
9338
9337
  const o = /* @__PURE__ */ A(
9339
9338
  "div",
9340
9339
  {
9341
9340
  "data-testid": "offer-card-empty-content",
9342
- className: F(
9341
+ className: L(
9343
9342
  "flex flex-col items-center justify-center p-8 text-center text-gray-500",
9344
9343
  i.content
9345
9344
  ),
@@ -9350,14 +9349,14 @@ const of = ({
9350
9349
  "data-testid": "offer-card-empty-icon",
9351
9350
  icon: e,
9352
9351
  width: n,
9353
- className: F("mb-4", i.icon)
9352
+ className: L("mb-4", i.icon)
9354
9353
  }
9355
9354
  ),
9356
- /* @__PURE__ */ u("h3", { "data-testid": "offer-card-empty-message", className: F("text-lg", i.message), children: t })
9355
+ /* @__PURE__ */ u("h3", { "data-testid": "offer-card-empty-message", className: L("text-lg", i.message), children: t })
9357
9356
  ]
9358
9357
  }
9359
9358
  );
9360
- return r ? /* @__PURE__ */ u(Ee, { "data-testid": "offer-card-empty", className: F("w-full", i.base), children: /* @__PURE__ */ u(Le, { "data-testid": "offer-card-empty-body", children: o }) }) : /* @__PURE__ */ u("div", { "data-testid": "offer-card-empty", className: F("w-full", i.base), children: o });
9359
+ return r ? /* @__PURE__ */ u(Ee, { "data-testid": "offer-card-empty", className: L("w-full", i.base), children: /* @__PURE__ */ u(Le, { "data-testid": "offer-card-empty-body", children: o }) }) : /* @__PURE__ */ u("div", { "data-testid": "offer-card-empty", className: L("w-full", i.base), children: o });
9361
9360
  };
9362
9361
  of.displayName = "OfferCardEmpty";
9363
9362
  const lf = {
@@ -9380,7 +9379,7 @@ const lf = {
9380
9379
  className: i.alert
9381
9380
  }
9382
9381
  );
9383
- return n ? /* @__PURE__ */ u(Ee, { "data-testid": "offer-card-error", className: F("w-full", i.base), children: /* @__PURE__ */ u(Le, { "data-testid": "offer-card-error-body", children: o }) }) : /* @__PURE__ */ u("div", { "data-testid": "offer-card-error", className: F("w-full", i.base), children: o });
9382
+ return n ? /* @__PURE__ */ u(Ee, { "data-testid": "offer-card-error", className: L("w-full", i.base), children: /* @__PURE__ */ u(Le, { "data-testid": "offer-card-error-body", children: o }) }) : /* @__PURE__ */ u("div", { "data-testid": "offer-card-error", className: L("w-full", i.base), children: o });
9384
9383
  };
9385
9384
  af.displayName = "OfferCardError";
9386
9385
  const cf = {
@@ -9392,11 +9391,11 @@ const cf = {
9392
9391
  6: "space-y-6"
9393
9392
  }, uf = ({ quantity: t = 2, gap: e = 4, classNames: n = {} }) => {
9394
9393
  const r = cf[e];
9395
- return /* @__PURE__ */ u("div", { "data-testid": "offer-card-skeleton-container", className: F(r, n.base), children: Array.from({ length: t }).map((i, s) => /* @__PURE__ */ A(
9394
+ return /* @__PURE__ */ u("div", { "data-testid": "offer-card-skeleton-container", className: L(r, n.base), children: Array.from({ length: t }).map((i, s) => /* @__PURE__ */ A(
9396
9395
  Ee,
9397
9396
  {
9398
9397
  "data-testid": `offer-card-skeleton-${s}`,
9399
- className: F("w-full", n.card),
9398
+ className: L("w-full", n.card),
9400
9399
  children: [
9401
9400
  /* @__PURE__ */ u(
9402
9401
  Fs,
@@ -9528,26 +9527,26 @@ const df = {
9528
9527
  isDisabled: c = !1,
9529
9528
  buttonVariant: d = "bordered",
9530
9529
  buttonColor: f = "default",
9531
- showCard: p = !0,
9530
+ showCard: h = !0,
9532
9531
  animated: m = !0,
9533
9532
  gap: v = 2,
9534
- classNames: b = {}
9533
+ classNames: y = {}
9535
9534
  }) => {
9536
- const [y, x] = J(n), C = e !== void 0 ? e : y, w = ce(
9537
- (V, H) => {
9535
+ const [b, k] = J(n), S = e !== void 0 ? e : b, I = ce(
9536
+ ($, _) => {
9538
9537
  const U = {
9539
- ...C,
9540
- [V]: Math.max(0, H)
9538
+ ...S,
9539
+ [$]: Math.max(0, _)
9541
9540
  };
9542
- e === void 0 && x(U), r?.(U), i?.(V, U[V]);
9541
+ e === void 0 && k(U), r?.(U), i?.($, U[$]);
9543
9542
  },
9544
- [C, e, r, i]
9545
- ), S = [...t].sort((V, H) => (V.position ?? 0) - (H.position ?? 0)), N = hf[v], T = F("grid mx-auto pt-2", N, b.base), O = (V) => /* @__PURE__ */ u(
9543
+ [S, e, r, i]
9544
+ ), C = [...t].sort(($, _) => ($.position ?? 0) - (_.position ?? 0)), w = hf[v], T = L("grid mx-auto pt-2", w, y.base), N = ($) => /* @__PURE__ */ u(
9546
9545
  Go,
9547
9546
  {
9548
- offer: V,
9549
- quantity: C[V.id] || 0,
9550
- onQuantityChange: w,
9547
+ offer: $,
9548
+ quantity: S[$.id] || 0,
9549
+ onQuantityChange: I,
9551
9550
  currency: s,
9552
9551
  locale: o,
9553
9552
  labels: l,
@@ -9555,10 +9554,10 @@ const df = {
9555
9554
  isDisabled: c,
9556
9555
  buttonVariant: d,
9557
9556
  buttonColor: f,
9558
- showCard: p,
9559
- classNames: b.card
9557
+ showCard: h,
9558
+ classNames: y.card
9560
9559
  },
9561
- V.id
9560
+ $.id
9562
9561
  );
9563
9562
  return m ? /* @__PURE__ */ u(
9564
9563
  hr.div,
@@ -9568,25 +9567,25 @@ const df = {
9568
9567
  variants: df,
9569
9568
  initial: "hidden",
9570
9569
  animate: "show",
9571
- children: /* @__PURE__ */ u(pr, { children: S.map((V) => /* @__PURE__ */ u(
9570
+ children: /* @__PURE__ */ u(pr, { children: C.map(($) => /* @__PURE__ */ u(
9572
9571
  hr.div,
9573
9572
  {
9574
- "data-testid": `offer-card-list-item-${V.id}`,
9575
- className: b.cardWrapper,
9573
+ "data-testid": `offer-card-list-item-${$.id}`,
9574
+ className: y.cardWrapper,
9576
9575
  variants: ff,
9577
9576
  exit: { opacity: 0, y: -20 },
9578
9577
  transition: { duration: 0.3 },
9579
- children: O(V)
9578
+ children: N($)
9580
9579
  },
9581
- V.id
9580
+ $.id
9582
9581
  )) })
9583
9582
  }
9584
- ) : /* @__PURE__ */ u("div", { "data-testid": "offer-card-list", className: T, children: S.map(O) });
9583
+ ) : /* @__PURE__ */ u("div", { "data-testid": "offer-card-list", className: T, children: C.map(N) });
9585
9584
  };
9586
9585
  pf.displayName = "OfferCardList";
9587
- var on = (t) => t.type === "checkbox", pt = (t) => t instanceof Date, Ne = (t) => t == null;
9586
+ var on = (t) => t.type === "checkbox", mt = (t) => t instanceof Date, Ne = (t) => t == null;
9588
9587
  const Zo = (t) => typeof t == "object";
9589
- var de = (t) => !Ne(t) && !Array.isArray(t) && Zo(t) && !pt(t), Qo = (t) => de(t) && t.target ? on(t.target) ? t.target.checked : t.target.value : t, mf = (t) => t.substring(0, t.search(/\.\d+(\.|$)/)) || t, Yo = (t, e) => t.has(mf(e)), gf = (t) => {
9588
+ var de = (t) => !Ne(t) && !Array.isArray(t) && Zo(t) && !mt(t), Qo = (t) => de(t) && t.target ? on(t.target) ? t.target.checked : t.target.value : t, mf = (t) => t.substring(0, t.search(/\.\d+(\.|$)/)) || t, Yo = (t, e) => t.has(mf(e)), gf = (t) => {
9590
9589
  const e = t.constructor && t.constructor.prototype;
9591
9590
  return de(e) && e.hasOwnProperty("isPrototypeOf");
9592
9591
  }, ei = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
@@ -9688,7 +9687,7 @@ var De = (t) => typeof t == "string", Dr = (t, e, n, r, i) => De(t) ? (r && e.wa
9688
9687
  function ze(t, e, n = /* @__PURE__ */ new WeakSet()) {
9689
9688
  if (Lr(t) || Lr(e))
9690
9689
  return Object.is(t, e);
9691
- if (pt(t) && pt(e))
9690
+ if (mt(t) && mt(e))
9692
9691
  return Object.is(t.getTime(), e.getTime());
9693
9692
  const r = Object.keys(t), i = Object.keys(e);
9694
9693
  if (r.length !== i.length)
@@ -9702,48 +9701,48 @@ function ze(t, e, n = /* @__PURE__ */ new WeakSet()) {
9702
9701
  return !1;
9703
9702
  if (s !== "ref") {
9704
9703
  const l = e[s];
9705
- if (pt(o) && pt(l) || de(o) && de(l) || Array.isArray(o) && Array.isArray(l) ? !ze(o, l, n) : !Object.is(o, l))
9704
+ if (mt(o) && mt(l) || de(o) && de(l) || Array.isArray(o) && Array.isArray(l) ? !ze(o, l, n) : !Object.is(o, l))
9706
9705
  return !1;
9707
9706
  }
9708
9707
  }
9709
9708
  return !0;
9710
9709
  }
9711
9710
  function bf(t) {
9712
- const e = ri(), { control: n = e, name: r, defaultValue: i, disabled: s, exact: o, compute: l } = t || {}, a = B.useRef(i), c = B.useRef(l), d = B.useRef(void 0), f = B.useRef(n), p = B.useRef(r);
9711
+ const e = ri(), { control: n = e, name: r, defaultValue: i, disabled: s, exact: o, compute: l } = t || {}, a = B.useRef(i), c = B.useRef(l), d = B.useRef(void 0), f = B.useRef(n), h = B.useRef(r);
9713
9712
  c.current = l;
9714
9713
  const [m, v] = B.useState(() => {
9715
- const S = n._getWatch(r, a.current);
9716
- return c.current ? c.current(S) : S;
9717
- }), b = B.useCallback((S) => {
9718
- const N = Dr(r, n._names, S || n._formValues, !1, a.current);
9719
- return c.current ? c.current(N) : N;
9720
- }, [n._formValues, n._names, r]), y = B.useCallback((S) => {
9714
+ const C = n._getWatch(r, a.current);
9715
+ return c.current ? c.current(C) : C;
9716
+ }), y = B.useCallback((C) => {
9717
+ const w = Dr(r, n._names, C || n._formValues, !1, a.current);
9718
+ return c.current ? c.current(w) : w;
9719
+ }, [n._formValues, n._names, r]), b = B.useCallback((C) => {
9721
9720
  if (!s) {
9722
- const N = Dr(r, n._names, S || n._formValues, !1, a.current);
9721
+ const w = Dr(r, n._names, C || n._formValues, !1, a.current);
9723
9722
  if (c.current) {
9724
- const T = c.current(N);
9723
+ const T = c.current(w);
9725
9724
  ze(T, d.current) || (v(T), d.current = T);
9726
9725
  } else
9727
- v(N);
9726
+ v(w);
9728
9727
  }
9729
9728
  }, [n._formValues, n._names, s, r]);
9730
- ii(() => ((f.current !== n || !ze(p.current, r)) && (f.current = n, p.current = r, y()), n._subscribe({
9729
+ ii(() => ((f.current !== n || !ze(h.current, r)) && (f.current = n, h.current = r, b()), n._subscribe({
9731
9730
  name: r,
9732
9731
  formState: {
9733
9732
  values: !0
9734
9733
  },
9735
9734
  exact: o,
9736
- callback: (S) => {
9737
- y(S.values);
9735
+ callback: (C) => {
9736
+ b(C.values);
9738
9737
  }
9739
- })), [n, o, r, y]), B.useEffect(() => n._removeUnmounted());
9740
- const x = f.current !== n, C = p.current, w = B.useMemo(() => {
9738
+ })), [n, o, r, b]), B.useEffect(() => n._removeUnmounted());
9739
+ const k = f.current !== n, S = h.current, I = B.useMemo(() => {
9741
9740
  if (s)
9742
9741
  return null;
9743
- const S = !x && !ze(C, r);
9744
- return x || S ? b() : null;
9745
- }, [s, x, r, C, b]);
9746
- return w !== null ? w : m;
9742
+ const C = !k && !ze(S, r);
9743
+ return k || C ? y() : null;
9744
+ }, [s, k, r, S, y]);
9745
+ return I !== null ? I : m;
9747
9746
  }
9748
9747
  function xf(t) {
9749
9748
  const e = ri(), { name: n, disabled: r, control: i = e, shouldUnregister: s, defaultValue: o, exact: l = !0 } = t, a = Yo(i._names.array, n), c = B.useMemo(() => D(i._formValues, n, D(i._defaultValues, n, o)), [i, n, o]), d = bf({
@@ -9755,13 +9754,13 @@ function xf(t) {
9755
9754
  control: i,
9756
9755
  name: n,
9757
9756
  exact: l
9758
- }), p = B.useRef(t), m = B.useRef(void 0), v = B.useRef(i.register(n, {
9757
+ }), h = B.useRef(t), m = B.useRef(void 0), v = B.useRef(i.register(n, {
9759
9758
  ...t.rules,
9760
9759
  value: d,
9761
9760
  ...Me(t.disabled) ? { disabled: t.disabled } : {}
9762
9761
  }));
9763
- p.current = t;
9764
- const b = B.useMemo(() => Object.defineProperties({}, {
9762
+ h.current = t;
9763
+ const y = B.useMemo(() => Object.defineProperties({}, {
9765
9764
  invalid: {
9766
9765
  enumerable: !0,
9767
9766
  get: () => !!D(f.errors, n)
@@ -9782,50 +9781,50 @@ function xf(t) {
9782
9781
  enumerable: !0,
9783
9782
  get: () => D(f.errors, n)
9784
9783
  }
9785
- }), [f, n]), y = B.useCallback((S) => v.current.onChange({
9784
+ }), [f, n]), b = B.useCallback((C) => v.current.onChange({
9786
9785
  target: {
9787
- value: Qo(S),
9786
+ value: Qo(C),
9788
9787
  name: n
9789
9788
  },
9790
9789
  type: Tn.CHANGE
9791
- }), [n]), x = B.useCallback(() => v.current.onBlur({
9790
+ }), [n]), k = B.useCallback(() => v.current.onBlur({
9792
9791
  target: {
9793
9792
  value: D(i._formValues, n),
9794
9793
  name: n
9795
9794
  },
9796
9795
  type: Tn.BLUR
9797
- }), [n, i._formValues]), C = B.useCallback((S) => {
9798
- const N = D(i._fields, n);
9799
- N && N._f && S && (N._f.ref = {
9800
- focus: () => we(S.focus) && S.focus(),
9801
- select: () => we(S.select) && S.select(),
9802
- setCustomValidity: (T) => we(S.setCustomValidity) && S.setCustomValidity(T),
9803
- reportValidity: () => we(S.reportValidity) && S.reportValidity()
9796
+ }), [n, i._formValues]), S = B.useCallback((C) => {
9797
+ const w = D(i._fields, n);
9798
+ w && w._f && C && (w._f.ref = {
9799
+ focus: () => we(C.focus) && C.focus(),
9800
+ select: () => we(C.select) && C.select(),
9801
+ setCustomValidity: (T) => we(C.setCustomValidity) && C.setCustomValidity(T),
9802
+ reportValidity: () => we(C.reportValidity) && C.reportValidity()
9804
9803
  });
9805
- }, [i._fields, n]), w = B.useMemo(() => ({
9804
+ }, [i._fields, n]), I = B.useMemo(() => ({
9806
9805
  name: n,
9807
9806
  value: d,
9808
9807
  ...Me(r) || f.disabled ? { disabled: f.disabled || r } : {},
9809
- onChange: y,
9810
- onBlur: x,
9811
- ref: C
9812
- }), [n, r, f.disabled, y, x, C, d]);
9808
+ onChange: b,
9809
+ onBlur: k,
9810
+ ref: S
9811
+ }), [n, r, f.disabled, b, k, S, d]);
9813
9812
  return B.useEffect(() => {
9814
- const S = i._options.shouldUnregister || s, N = m.current;
9815
- N && N !== n && !a && i.unregister(N), i.register(n, {
9816
- ...p.current.rules,
9817
- ...Me(p.current.disabled) ? { disabled: p.current.disabled } : {}
9813
+ const C = i._options.shouldUnregister || s, w = m.current;
9814
+ w && w !== n && !a && i.unregister(w), i.register(n, {
9815
+ ...h.current.rules,
9816
+ ...Me(h.current.disabled) ? { disabled: h.current.disabled } : {}
9818
9817
  });
9819
- const T = (O, V) => {
9820
- const H = D(i._fields, O);
9821
- H && H._f && (H._f.mount = V);
9818
+ const T = (N, $) => {
9819
+ const _ = D(i._fields, N);
9820
+ _ && _._f && (_._f.mount = $);
9822
9821
  };
9823
- if (T(n, !0), S) {
9824
- const O = le(D(i._options.defaultValues, n, p.current.defaultValue));
9825
- ee(i._defaultValues, n, O), re(D(i._formValues, n)) && ee(i._formValues, n, O);
9822
+ if (T(n, !0), C) {
9823
+ const N = le(D(i._options.defaultValues, n, h.current.defaultValue));
9824
+ ee(i._defaultValues, n, N), re(D(i._formValues, n)) && ee(i._formValues, n, N);
9826
9825
  }
9827
9826
  return !a && i.register(n), m.current = n, () => {
9828
- (a ? S && !i._state.action : S) ? i.unregister(n) : T(n, !1);
9827
+ (a ? C && !i._state.action : C) ? i.unregister(n) : T(n, !1);
9829
9828
  };
9830
9829
  }, [n, i, a, s]), B.useEffect(() => {
9831
9830
  i._setDisabledField({
@@ -9833,10 +9832,10 @@ function xf(t) {
9833
9832
  name: n
9834
9833
  });
9835
9834
  }, [r, n, i]), B.useMemo(() => ({
9836
- field: w,
9835
+ field: I,
9837
9836
  formState: f,
9838
- fieldState: b
9839
- }), [w, f, b]);
9837
+ fieldState: y
9838
+ }), [I, f, y]);
9840
9839
  }
9841
9840
  const kf = B.createContext(null);
9842
9841
  kf.displayName = "HookFormContext";
@@ -10045,85 +10044,85 @@ var Ct = (t) => de(t) && !On(t) ? t : {
10045
10044
  value: t,
10046
10045
  message: ""
10047
10046
  }, ws = async (t, e, n, r, i, s) => {
10048
- const { ref: o, refs: l, required: a, maxLength: c, minLength: d, min: f, max: p, pattern: m, validate: v, name: b, valueAsNumber: y, mount: x } = t._f, C = D(n, b);
10049
- if (!x || e.has(b))
10047
+ const { ref: o, refs: l, required: a, maxLength: c, minLength: d, min: f, max: h, pattern: m, validate: v, name: y, valueAsNumber: b, mount: k } = t._f, S = D(n, y);
10048
+ if (!k || e.has(y))
10050
10049
  return {};
10051
- const w = l ? l[0] : o, S = (I) => {
10052
- i && w.reportValidity && (w.setCustomValidity(Me(I) ? "" : I || ""), w.reportValidity());
10053
- }, N = {}, T = oi(o), O = on(o), V = T || O, H = (y || si(o)) && re(o.value) && re(C) || Mn(o) && o.value === "" || C === "" || Array.isArray(C) && !C.length, U = vf.bind(null, b, r, N), P = (I, R, $, _ = We.maxLength, X = We.minLength) => {
10054
- const W = I ? R : $;
10055
- N[b] = {
10056
- type: I ? _ : X,
10050
+ const I = l ? l[0] : o, C = (M) => {
10051
+ i && I.reportValidity && (I.setCustomValidity(Me(M) ? "" : M || ""), I.reportValidity());
10052
+ }, w = {}, T = oi(o), N = on(o), $ = T || N, _ = (b || si(o)) && re(o.value) && re(S) || Mn(o) && o.value === "" || S === "" || Array.isArray(S) && !S.length, U = vf.bind(null, y, r, w), V = (M, P, R, H = We.maxLength, Q = We.minLength) => {
10053
+ const W = M ? P : R;
10054
+ w[y] = {
10055
+ type: M ? H : Q,
10057
10056
  message: W,
10058
10057
  ref: o,
10059
- ...U(I ? _ : X, W)
10058
+ ...U(M ? H : Q, W)
10060
10059
  };
10061
10060
  };
10062
- if (s ? !Array.isArray(C) || !C.length : a && (!V && (H || Ne(C)) || Me(C) && !C || O && !il(l).isValid || T && !ol(l).isValid)) {
10063
- const { value: I, message: R } = De(a) ? { value: !!a, message: a } : Ct(a);
10064
- if (I && (N[b] = {
10061
+ if (s ? !Array.isArray(S) || !S.length : a && (!$ && (_ || Ne(S)) || Me(S) && !S || N && !il(l).isValid || T && !ol(l).isValid)) {
10062
+ const { value: M, message: P } = De(a) ? { value: !!a, message: a } : Ct(a);
10063
+ if (M && (w[y] = {
10065
10064
  type: We.required,
10066
- message: R,
10067
- ref: w,
10068
- ...U(We.required, R)
10065
+ message: P,
10066
+ ref: I,
10067
+ ...U(We.required, P)
10069
10068
  }, !r))
10070
- return S(R), N;
10071
- }
10072
- if (!H && (!Ne(f) || !Ne(p))) {
10073
- let I, R;
10074
- const $ = Ct(p), _ = Ct(f);
10075
- if (!Ne(C) && !isNaN(C)) {
10076
- const X = o.valueAsNumber || C && +C;
10077
- Ne($.value) || (I = X > $.value), Ne(_.value) || (R = X < _.value);
10069
+ return C(P), w;
10070
+ }
10071
+ if (!_ && (!Ne(f) || !Ne(h))) {
10072
+ let M, P;
10073
+ const R = Ct(h), H = Ct(f);
10074
+ if (!Ne(S) && !isNaN(S)) {
10075
+ const Q = o.valueAsNumber || S && +S;
10076
+ Ne(R.value) || (M = Q > R.value), Ne(H.value) || (P = Q < H.value);
10078
10077
  } else {
10079
- const X = o.valueAsDate || new Date(C), W = (ke) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ke), xe = o.type == "time", fe = o.type == "week";
10080
- De($.value) && C && (I = xe ? W(C) > W($.value) : fe ? C > $.value : X > new Date($.value)), De(_.value) && C && (R = xe ? W(C) < W(_.value) : fe ? C < _.value : X < new Date(_.value));
10078
+ const Q = o.valueAsDate || new Date(S), W = (ke) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ke), xe = o.type == "time", fe = o.type == "week";
10079
+ De(R.value) && S && (M = xe ? W(S) > W(R.value) : fe ? S > R.value : Q > new Date(R.value)), De(H.value) && S && (P = xe ? W(S) < W(H.value) : fe ? S < H.value : Q < new Date(H.value));
10081
10080
  }
10082
- if ((I || R) && (P(!!I, $.message, _.message, We.max, We.min), !r))
10083
- return S(N[b].message), N;
10081
+ if ((M || P) && (V(!!M, R.message, H.message, We.max, We.min), !r))
10082
+ return C(w[y].message), w;
10084
10083
  }
10085
- if ((c || d) && !H && (De(C) || s && Array.isArray(C))) {
10086
- const I = Ct(c), R = Ct(d), $ = !Ne(I.value) && C.length > +I.value, _ = !Ne(R.value) && C.length < +R.value;
10087
- if (($ || _) && (P($, I.message, R.message), !r))
10088
- return S(N[b].message), N;
10084
+ if ((c || d) && !_ && (De(S) || s && Array.isArray(S))) {
10085
+ const M = Ct(c), P = Ct(d), R = !Ne(M.value) && S.length > +M.value, H = !Ne(P.value) && S.length < +P.value;
10086
+ if ((R || H) && (V(R, M.message, P.message), !r))
10087
+ return C(w[y].message), w;
10089
10088
  }
10090
- if (m && !H && De(C)) {
10091
- const { value: I, message: R } = Ct(m);
10092
- if (On(I) && !C.match(I) && (N[b] = {
10089
+ if (m && !_ && De(S)) {
10090
+ const { value: M, message: P } = Ct(m);
10091
+ if (On(M) && !S.match(M) && (w[y] = {
10093
10092
  type: We.pattern,
10094
- message: R,
10093
+ message: P,
10095
10094
  ref: o,
10096
- ...U(We.pattern, R)
10095
+ ...U(We.pattern, P)
10097
10096
  }, !r))
10098
- return S(R), N;
10097
+ return C(P), w;
10099
10098
  }
10100
10099
  if (v) {
10101
10100
  if (we(v)) {
10102
- const I = await v(C, n), R = Cs(I, w);
10103
- if (R && (N[b] = {
10104
- ...R,
10105
- ...U(We.validate, R.message)
10101
+ const M = await v(S, n), P = Cs(M, I);
10102
+ if (P && (w[y] = {
10103
+ ...P,
10104
+ ...U(We.validate, P.message)
10106
10105
  }, !r))
10107
- return S(R.message), N;
10106
+ return C(P.message), w;
10108
10107
  } else if (de(v)) {
10109
- let I = {};
10110
- for (const R in v) {
10111
- if (!Se(I) && !r)
10108
+ let M = {};
10109
+ for (const P in v) {
10110
+ if (!Se(M) && !r)
10112
10111
  break;
10113
- const $ = Cs(await v[R](C, n), w, R);
10114
- $ && (I = {
10115
- ...$,
10116
- ...U(R, $.message)
10117
- }, S($.message), r && (N[b] = I));
10112
+ const R = Cs(await v[P](S, n), I, P);
10113
+ R && (M = {
10114
+ ...R,
10115
+ ...U(P, R.message)
10116
+ }, C(R.message), r && (w[y] = M));
10118
10117
  }
10119
- if (!Se(I) && (N[b] = {
10120
- ref: w,
10121
- ...I
10118
+ if (!Se(M) && (w[y] = {
10119
+ ref: I,
10120
+ ...M
10122
10121
  }, !r))
10123
- return N;
10122
+ return w;
10124
10123
  }
10125
10124
  }
10126
- return S(!0), N;
10125
+ return C(!0), w;
10127
10126
  };
10128
10127
  const Ff = {
10129
10128
  mode: Ve.onSubmit,
@@ -10172,294 +10171,294 @@ function Pf(t = {}) {
10172
10171
  }, f = {
10173
10172
  ...d
10174
10173
  };
10175
- let p = {
10174
+ let h = {
10176
10175
  ...f
10177
10176
  };
10178
10177
  const m = {
10179
10178
  array: ps(),
10180
10179
  state: ps()
10181
- }, v = e.criteriaMode === Ve.all, b = (h) => (g) => {
10182
- clearTimeout(c), c = setTimeout(h, g);
10183
- }, y = async (h) => {
10184
- if (!o.keepIsValid && !e.disabled && (f.isValid || p.isValid || h)) {
10180
+ }, v = e.criteriaMode === Ve.all, y = (p) => (g) => {
10181
+ clearTimeout(c), c = setTimeout(p, g);
10182
+ }, b = async (p) => {
10183
+ if (!o.keepIsValid && !e.disabled && (f.isValid || h.isValid || p)) {
10185
10184
  let g;
10186
- e.resolver ? (g = Se((await V()).errors), x()) : g = await U(r, !0), g !== n.isValid && m.state.next({
10185
+ e.resolver ? (g = Se((await $()).errors), k()) : g = await U(r, !0), g !== n.isValid && m.state.next({
10187
10186
  isValid: g
10188
10187
  });
10189
10188
  }
10190
- }, x = (h, g) => {
10191
- !e.disabled && (f.isValidating || f.validatingFields || p.isValidating || p.validatingFields) && ((h || Array.from(l.mount)).forEach((k) => {
10192
- k && (g ? ee(n.validatingFields, k, g) : ae(n.validatingFields, k));
10189
+ }, k = (p, g) => {
10190
+ !e.disabled && (f.isValidating || f.validatingFields || h.isValidating || h.validatingFields) && ((p || Array.from(l.mount)).forEach((x) => {
10191
+ x && (g ? ee(n.validatingFields, x, g) : ae(n.validatingFields, x));
10193
10192
  }), m.state.next({
10194
10193
  validatingFields: n.validatingFields,
10195
10194
  isValidating: !Se(n.validatingFields)
10196
10195
  }));
10197
- }, C = (h, g = [], k, L, M = !0, E = !0) => {
10198
- if (L && k && !e.disabled) {
10199
- if (o.action = !0, E && Array.isArray(D(r, h))) {
10200
- const z = k(D(r, h), L.argA, L.argB);
10201
- M && ee(r, h, z);
10196
+ }, S = (p, g = [], x, F, O = !0, E = !0) => {
10197
+ if (F && x && !e.disabled) {
10198
+ if (o.action = !0, E && Array.isArray(D(r, p))) {
10199
+ const z = x(D(r, p), F.argA, F.argB);
10200
+ O && ee(r, p, z);
10202
10201
  }
10203
- if (E && Array.isArray(D(n.errors, h))) {
10204
- const z = k(D(n.errors, h), L.argA, L.argB);
10205
- M && ee(n.errors, h, z), Df(n.errors, h);
10202
+ if (E && Array.isArray(D(n.errors, p))) {
10203
+ const z = x(D(n.errors, p), F.argA, F.argB);
10204
+ O && ee(n.errors, p, z), Df(n.errors, p);
10206
10205
  }
10207
- if ((f.touchedFields || p.touchedFields) && E && Array.isArray(D(n.touchedFields, h))) {
10208
- const z = k(D(n.touchedFields, h), L.argA, L.argB);
10209
- M && ee(n.touchedFields, h, z);
10206
+ if ((f.touchedFields || h.touchedFields) && E && Array.isArray(D(n.touchedFields, p))) {
10207
+ const z = x(D(n.touchedFields, p), F.argA, F.argB);
10208
+ O && ee(n.touchedFields, p, z);
10210
10209
  }
10211
- (f.dirtyFields || p.dirtyFields) && (n.dirtyFields = Et(i, s)), m.state.next({
10212
- name: h,
10213
- isDirty: I(h, g),
10210
+ (f.dirtyFields || h.dirtyFields) && (n.dirtyFields = Et(i, s)), m.state.next({
10211
+ name: p,
10212
+ isDirty: M(p, g),
10214
10213
  dirtyFields: n.dirtyFields,
10215
10214
  errors: n.errors,
10216
10215
  isValid: n.isValid
10217
10216
  });
10218
10217
  } else
10219
- ee(s, h, g);
10220
- }, w = (h, g) => {
10221
- ee(n.errors, h, g), m.state.next({
10218
+ ee(s, p, g);
10219
+ }, I = (p, g) => {
10220
+ ee(n.errors, p, g), m.state.next({
10222
10221
  errors: n.errors
10223
10222
  });
10224
- }, S = (h) => {
10225
- n.errors = h, m.state.next({
10223
+ }, C = (p) => {
10224
+ n.errors = p, m.state.next({
10226
10225
  errors: n.errors,
10227
10226
  isValid: !1
10228
10227
  });
10229
- }, N = (h, g, k, L) => {
10230
- const M = D(r, h);
10231
- if (M) {
10232
- const E = D(s, h, re(k) ? D(i, h) : k);
10233
- re(E) || L && L.defaultChecked || g ? ee(s, h, g ? E : bs(M._f)) : _(h, E), o.mount && !o.action && y();
10228
+ }, w = (p, g, x, F) => {
10229
+ const O = D(r, p);
10230
+ if (O) {
10231
+ const E = D(s, p, re(x) ? D(i, p) : x);
10232
+ re(E) || F && F.defaultChecked || g ? ee(s, p, g ? E : bs(O._f)) : H(p, E), o.mount && !o.action && b();
10234
10233
  }
10235
- }, T = (h, g, k, L, M) => {
10234
+ }, T = (p, g, x, F, O) => {
10236
10235
  let E = !1, z = !1;
10237
10236
  const G = {
10238
- name: h
10237
+ name: p
10239
10238
  };
10240
10239
  if (!e.disabled) {
10241
- if (!k || L) {
10242
- (f.isDirty || p.isDirty) && (z = n.isDirty, n.isDirty = G.isDirty = I(), E = z !== G.isDirty);
10243
- const Z = ze(D(i, h), g);
10244
- z = !!D(n.dirtyFields, h), Z ? ae(n.dirtyFields, h) : ee(n.dirtyFields, h, !0), G.dirtyFields = n.dirtyFields, E = E || (f.dirtyFields || p.dirtyFields) && z !== !Z;
10240
+ if (!x || F) {
10241
+ (f.isDirty || h.isDirty) && (z = n.isDirty, n.isDirty = G.isDirty = M(), E = z !== G.isDirty);
10242
+ const Z = ze(D(i, p), g);
10243
+ z = !!D(n.dirtyFields, p), Z ? ae(n.dirtyFields, p) : ee(n.dirtyFields, p, !0), G.dirtyFields = n.dirtyFields, E = E || (f.dirtyFields || h.dirtyFields) && z !== !Z;
10245
10244
  }
10246
- if (k) {
10247
- const Z = D(n.touchedFields, h);
10248
- Z || (ee(n.touchedFields, h, k), G.touchedFields = n.touchedFields, E = E || (f.touchedFields || p.touchedFields) && Z !== k);
10245
+ if (x) {
10246
+ const Z = D(n.touchedFields, p);
10247
+ Z || (ee(n.touchedFields, p, x), G.touchedFields = n.touchedFields, E = E || (f.touchedFields || h.touchedFields) && Z !== x);
10249
10248
  }
10250
- E && M && m.state.next(G);
10249
+ E && O && m.state.next(G);
10251
10250
  }
10252
10251
  return E ? G : {};
10253
- }, O = (h, g, k, L) => {
10254
- const M = D(n.errors, h), E = (f.isValid || p.isValid) && Me(g) && n.isValid !== g;
10255
- if (e.delayError && k ? (a = b(() => w(h, k)), a(e.delayError)) : (clearTimeout(c), a = null, k ? ee(n.errors, h, k) : ae(n.errors, h)), (k ? !ze(M, k) : M) || !Se(L) || E) {
10252
+ }, N = (p, g, x, F) => {
10253
+ const O = D(n.errors, p), E = (f.isValid || h.isValid) && Me(g) && n.isValid !== g;
10254
+ if (e.delayError && x ? (a = y(() => I(p, x)), a(e.delayError)) : (clearTimeout(c), a = null, x ? ee(n.errors, p, x) : ae(n.errors, p)), (x ? !ze(O, x) : O) || !Se(F) || E) {
10256
10255
  const z = {
10257
- ...L,
10256
+ ...F,
10258
10257
  ...E && Me(g) ? { isValid: g } : {},
10259
10258
  errors: n.errors,
10260
- name: h
10259
+ name: p
10261
10260
  };
10262
10261
  n = {
10263
10262
  ...n,
10264
10263
  ...z
10265
10264
  }, m.state.next(z);
10266
10265
  }
10267
- }, V = async (h) => (x(h, !0), await e.resolver(s, e.context, Nf(h || l.mount, r, e.criteriaMode, e.shouldUseNativeValidation))), H = async (h) => {
10268
- const { errors: g } = await V(h);
10269
- if (x(h), h)
10270
- for (const k of h) {
10271
- const L = D(g, k);
10272
- L ? ee(n.errors, k, L) : ae(n.errors, k);
10266
+ }, $ = async (p) => (k(p, !0), await e.resolver(s, e.context, Nf(p || l.mount, r, e.criteriaMode, e.shouldUseNativeValidation))), _ = async (p) => {
10267
+ const { errors: g } = await $(p);
10268
+ if (k(p), p)
10269
+ for (const x of p) {
10270
+ const F = D(g, x);
10271
+ F ? ee(n.errors, x, F) : ae(n.errors, x);
10273
10272
  }
10274
10273
  else
10275
10274
  n.errors = g;
10276
10275
  return g;
10277
- }, U = async (h, g, k = {
10276
+ }, U = async (p, g, x = {
10278
10277
  valid: !0
10279
10278
  }) => {
10280
- for (const L in h) {
10281
- const M = h[L];
10282
- if (M) {
10283
- const { _f: E, ...z } = M;
10279
+ for (const F in p) {
10280
+ const O = p[F];
10281
+ if (O) {
10282
+ const { _f: E, ...z } = O;
10284
10283
  if (E) {
10285
- const G = l.array.has(E.name), Z = M._f && Ef(M._f);
10286
- Z && f.validatingFields && x([E.name], !0);
10287
- const ve = await ws(M, l.disabled, s, v, e.shouldUseNativeValidation && !g, G);
10288
- if (Z && f.validatingFields && x([E.name]), ve[E.name] && (k.valid = !1, g || t.shouldUseNativeValidation))
10284
+ const G = l.array.has(E.name), Z = O._f && Ef(O._f);
10285
+ Z && f.validatingFields && k([E.name], !0);
10286
+ const ve = await ws(O, l.disabled, s, v, e.shouldUseNativeValidation && !g, G);
10287
+ if (Z && f.validatingFields && k([E.name]), ve[E.name] && (x.valid = !1, g || t.shouldUseNativeValidation))
10289
10288
  break;
10290
10289
  !g && (D(ve, E.name) ? G ? Lf(n.errors, ve, E.name) : ee(n.errors, E.name, ve[E.name]) : ae(n.errors, E.name));
10291
10290
  }
10292
- !Se(z) && await U(z, g, k);
10291
+ !Se(z) && await U(z, g, x);
10293
10292
  }
10294
10293
  }
10295
- return k.valid;
10296
- }, P = () => {
10297
- for (const h of l.unMount) {
10298
- const g = D(r, h);
10299
- g && (g._f.refs ? g._f.refs.every((k) => !ar(k)) : !ar(g._f.ref)) && Bn(h);
10294
+ return x.valid;
10295
+ }, V = () => {
10296
+ for (const p of l.unMount) {
10297
+ const g = D(r, p);
10298
+ g && (g._f.refs ? g._f.refs.every((x) => !ar(x)) : !ar(g._f.ref)) && Bn(p);
10300
10299
  }
10301
10300
  l.unMount = /* @__PURE__ */ new Set();
10302
- }, I = (h, g) => !e.disabled && (h && g && ee(s, h, g), !ze(Ye(), i)), R = (h, g, k) => Dr(h, l, {
10303
- ...o.mount ? s : re(g) ? i : De(h) ? { [h]: g } : g
10304
- }, k, g), $ = (h) => ti(D(o.mount ? s : i, h, e.shouldUnregister ? D(i, h, []) : [])), _ = (h, g, k = {}) => {
10305
- const L = D(r, h);
10306
- let M = g;
10307
- if (L) {
10308
- const E = L._f;
10309
- E && (!E.disabled && ee(s, h, sl(g, E)), M = Mn(E.ref) && Ne(g) ? "" : g, nl(E.ref) ? [...E.ref.options].forEach((z) => z.selected = M.includes(z.value)) : E.refs ? on(E.ref) ? E.refs.forEach((z) => {
10310
- (!z.defaultChecked || !z.disabled) && (Array.isArray(M) ? z.checked = !!M.find((G) => G === z.value) : z.checked = M === z.value || !!M);
10311
- }) : E.refs.forEach((z) => z.checked = z.value === M) : si(E.ref) ? E.ref.value = "" : (E.ref.value = M, E.ref.type || m.state.next({
10312
- name: h,
10301
+ }, M = (p, g) => !e.disabled && (p && g && ee(s, p, g), !ze(Ye(), i)), P = (p, g, x) => Dr(p, l, {
10302
+ ...o.mount ? s : re(g) ? i : De(p) ? { [p]: g } : g
10303
+ }, x, g), R = (p) => ti(D(o.mount ? s : i, p, e.shouldUnregister ? D(i, p, []) : [])), H = (p, g, x = {}) => {
10304
+ const F = D(r, p);
10305
+ let O = g;
10306
+ if (F) {
10307
+ const E = F._f;
10308
+ E && (!E.disabled && ee(s, p, sl(g, E)), O = Mn(E.ref) && Ne(g) ? "" : g, nl(E.ref) ? [...E.ref.options].forEach((z) => z.selected = O.includes(z.value)) : E.refs ? on(E.ref) ? E.refs.forEach((z) => {
10309
+ (!z.defaultChecked || !z.disabled) && (Array.isArray(O) ? z.checked = !!O.find((G) => G === z.value) : z.checked = O === z.value || !!O);
10310
+ }) : E.refs.forEach((z) => z.checked = z.value === O) : si(E.ref) ? E.ref.value = "" : (E.ref.value = O, E.ref.type || m.state.next({
10311
+ name: p,
10313
10312
  values: le(s)
10314
10313
  })));
10315
10314
  }
10316
- (k.shouldDirty || k.shouldTouch) && T(h, M, k.shouldTouch, k.shouldDirty, !0), k.shouldValidate && ke(h);
10317
- }, X = (h, g, k) => {
10318
- for (const L in g) {
10319
- if (!g.hasOwnProperty(L))
10315
+ (x.shouldDirty || x.shouldTouch) && T(p, O, x.shouldTouch, x.shouldDirty, !0), x.shouldValidate && ke(p);
10316
+ }, Q = (p, g, x) => {
10317
+ for (const F in g) {
10318
+ if (!g.hasOwnProperty(F))
10320
10319
  return;
10321
- const M = g[L], E = h + "." + L, z = D(r, E);
10322
- (l.array.has(h) || de(M) || z && !z._f) && !pt(M) ? X(E, M, k) : _(E, M, k);
10320
+ const O = g[F], E = p + "." + F, z = D(r, E);
10321
+ (l.array.has(p) || de(O) || z && !z._f) && !mt(O) ? Q(E, O, x) : H(E, O, x);
10323
10322
  }
10324
- }, W = (h, g, k = {}) => {
10325
- const L = D(r, h), M = l.array.has(h), E = le(g);
10326
- ee(s, h, E), M ? (m.array.next({
10327
- name: h,
10323
+ }, W = (p, g, x = {}) => {
10324
+ const F = D(r, p), O = l.array.has(p), E = le(g);
10325
+ ee(s, p, E), O ? (m.array.next({
10326
+ name: p,
10328
10327
  values: le(s)
10329
- }), (f.isDirty || f.dirtyFields || p.isDirty || p.dirtyFields) && k.shouldDirty && m.state.next({
10330
- name: h,
10328
+ }), (f.isDirty || f.dirtyFields || h.isDirty || h.dirtyFields) && x.shouldDirty && m.state.next({
10329
+ name: p,
10331
10330
  dirtyFields: Et(i, s),
10332
- isDirty: I(h, E)
10333
- })) : L && !L._f && !Ne(E) ? X(h, E, k) : _(h, E, k), vs(h, l) ? m.state.next({
10331
+ isDirty: M(p, E)
10332
+ })) : F && !F._f && !Ne(E) ? Q(p, E, x) : H(p, E, x), vs(p, l) ? m.state.next({
10334
10333
  ...n,
10335
- name: h,
10334
+ name: p,
10336
10335
  values: le(s)
10337
10336
  }) : m.state.next({
10338
- name: o.mount ? h : void 0,
10337
+ name: o.mount ? p : void 0,
10339
10338
  values: le(s)
10340
10339
  });
10341
- }, xe = async (h) => {
10340
+ }, xe = async (p) => {
10342
10341
  o.mount = !0;
10343
- const g = h.target;
10344
- let k = g.name, L = !0;
10345
- const M = D(r, k), E = (Z) => {
10346
- L = Number.isNaN(Z) || pt(Z) && isNaN(Z.getTime()) || ze(Z, D(s, k, Z));
10342
+ const g = p.target;
10343
+ let x = g.name, F = !0;
10344
+ const O = D(r, x), E = (Z) => {
10345
+ F = Number.isNaN(Z) || mt(Z) && isNaN(Z.getTime()) || ze(Z, D(s, x, Z));
10347
10346
  }, z = xs(e.mode), G = xs(e.reValidateMode);
10348
- if (M) {
10347
+ if (O) {
10349
10348
  let Z, ve;
10350
- const lt = g.type ? bs(M._f) : Qo(h), Xe = h.type === Tn.BLUR || h.type === Tn.FOCUS_OUT, fl = !Tf(M._f) && !e.resolver && !D(n.errors, k) && !M._f.deps || If(Xe, D(n.touchedFields, k), n.isSubmitted, G, z), Un = vs(k, l, Xe);
10351
- ee(s, k, lt), Xe ? (!g || !g.readOnly) && (M._f.onBlur && M._f.onBlur(h), a && a(0)) : M._f.onChange && M._f.onChange(h);
10352
- const qn = T(k, lt, Xe), hl = !Se(qn) || Un;
10349
+ const at = g.type ? bs(O._f) : Qo(p), Xe = p.type === Tn.BLUR || p.type === Tn.FOCUS_OUT, fl = !Tf(O._f) && !e.resolver && !D(n.errors, x) && !O._f.deps || If(Xe, D(n.touchedFields, x), n.isSubmitted, G, z), Un = vs(x, l, Xe);
10350
+ ee(s, x, at), Xe ? (!g || !g.readOnly) && (O._f.onBlur && O._f.onBlur(p), a && a(0)) : O._f.onChange && O._f.onChange(p);
10351
+ const qn = T(x, at, Xe), hl = !Se(qn) || Un;
10353
10352
  if (!Xe && m.state.next({
10354
- name: k,
10355
- type: h.type,
10353
+ name: x,
10354
+ type: p.type,
10356
10355
  values: le(s)
10357
10356
  }), fl)
10358
- return (f.isValid || p.isValid) && (e.mode === "onBlur" ? Xe && y() : Xe || y()), hl && m.state.next({ name: k, ...Un ? {} : qn });
10357
+ return (f.isValid || h.isValid) && (e.mode === "onBlur" ? Xe && b() : Xe || b()), hl && m.state.next({ name: x, ...Un ? {} : qn });
10359
10358
  if (!Xe && Un && m.state.next({ ...n }), e.resolver) {
10360
- const { errors: fi } = await V([k]);
10361
- if (x([k]), E(lt), L) {
10362
- const pl = Ss(n.errors, r, k), hi = Ss(fi, r, pl.name || k);
10363
- Z = hi.error, k = hi.name, ve = Se(fi);
10359
+ const { errors: fi } = await $([x]);
10360
+ if (k([x]), E(at), F) {
10361
+ const pl = Ss(n.errors, r, x), hi = Ss(fi, r, pl.name || x);
10362
+ Z = hi.error, x = hi.name, ve = Se(fi);
10364
10363
  }
10365
10364
  } else
10366
- x([k], !0), Z = (await ws(M, l.disabled, s, v, e.shouldUseNativeValidation))[k], x([k]), E(lt), L && (Z ? ve = !1 : (f.isValid || p.isValid) && (ve = await U(r, !0)));
10367
- L && (M._f.deps && (!Array.isArray(M._f.deps) || M._f.deps.length > 0) && ke(M._f.deps), O(k, ve, Z, qn));
10368
- }
10369
- }, fe = (h, g) => {
10370
- if (D(n.errors, g) && h.focus)
10371
- return h.focus(), 1;
10372
- }, ke = async (h, g = {}) => {
10373
- let k, L;
10374
- const M = Kt(h);
10365
+ k([x], !0), Z = (await ws(O, l.disabled, s, v, e.shouldUseNativeValidation))[x], k([x]), E(at), F && (Z ? ve = !1 : (f.isValid || h.isValid) && (ve = await U(r, !0)));
10366
+ F && (O._f.deps && (!Array.isArray(O._f.deps) || O._f.deps.length > 0) && ke(O._f.deps), N(x, ve, Z, qn));
10367
+ }
10368
+ }, fe = (p, g) => {
10369
+ if (D(n.errors, g) && p.focus)
10370
+ return p.focus(), 1;
10371
+ }, ke = async (p, g = {}) => {
10372
+ let x, F;
10373
+ const O = Kt(p);
10375
10374
  if (e.resolver) {
10376
- const E = await H(re(h) ? h : M);
10377
- k = Se(E), L = h ? !M.some((z) => D(E, z)) : k;
10378
- } else h ? (L = (await Promise.all(M.map(async (E) => {
10375
+ const E = await _(re(p) ? p : O);
10376
+ x = Se(E), F = p ? !O.some((z) => D(E, z)) : x;
10377
+ } else p ? (F = (await Promise.all(O.map(async (E) => {
10379
10378
  const z = D(r, E);
10380
10379
  return await U(z && z._f ? { [E]: z } : z);
10381
- }))).every(Boolean), !(!L && !n.isValid) && y()) : L = k = await U(r);
10380
+ }))).every(Boolean), !(!F && !n.isValid) && b()) : F = x = await U(r);
10382
10381
  return m.state.next({
10383
- ...!De(h) || (f.isValid || p.isValid) && k !== n.isValid ? {} : { name: h },
10384
- ...e.resolver || !h ? { isValid: k } : {},
10382
+ ...!De(p) || (f.isValid || h.isValid) && x !== n.isValid ? {} : { name: p },
10383
+ ...e.resolver || !p ? { isValid: x } : {},
10385
10384
  errors: n.errors
10386
- }), g.shouldFocus && !L && jt(r, fe, h ? M : l.mount), L;
10387
- }, Ye = (h, g) => {
10388
- let k = {
10385
+ }), g.shouldFocus && !F && jt(r, fe, p ? O : l.mount), F;
10386
+ }, Ye = (p, g) => {
10387
+ let x = {
10389
10388
  ...o.mount ? s : i
10390
10389
  };
10391
- return g && (k = tl(g.dirtyFields ? n.dirtyFields : n.touchedFields, k)), re(h) ? k : De(h) ? D(k, h) : h.map((L) => D(k, L));
10392
- }, vt = (h, g) => ({
10393
- invalid: !!D((g || n).errors, h),
10394
- isDirty: !!D((g || n).dirtyFields, h),
10395
- error: D((g || n).errors, h),
10396
- isValidating: !!D(n.validatingFields, h),
10397
- isTouched: !!D((g || n).touchedFields, h)
10398
- }), Pt = (h) => {
10399
- h && Kt(h).forEach((g) => ae(n.errors, g)), m.state.next({
10400
- errors: h ? n.errors : {}
10390
+ return g && (x = tl(g.dirtyFields ? n.dirtyFields : n.touchedFields, x)), re(p) ? x : De(p) ? D(x, p) : p.map((F) => D(x, F));
10391
+ }, vt = (p, g) => ({
10392
+ invalid: !!D((g || n).errors, p),
10393
+ isDirty: !!D((g || n).dirtyFields, p),
10394
+ error: D((g || n).errors, p),
10395
+ isValidating: !!D(n.validatingFields, p),
10396
+ isTouched: !!D((g || n).touchedFields, p)
10397
+ }), Pt = (p) => {
10398
+ p && Kt(p).forEach((g) => ae(n.errors, g)), m.state.next({
10399
+ errors: p ? n.errors : {}
10401
10400
  });
10402
- }, ne = (h, g, k) => {
10403
- const L = (D(r, h, { _f: {} })._f || {}).ref, M = D(n.errors, h) || {}, { ref: E, message: z, type: G, ...Z } = M;
10404
- ee(n.errors, h, {
10401
+ }, ne = (p, g, x) => {
10402
+ const F = (D(r, p, { _f: {} })._f || {}).ref, O = D(n.errors, p) || {}, { ref: E, message: z, type: G, ...Z } = O;
10403
+ ee(n.errors, p, {
10405
10404
  ...Z,
10406
10405
  ...g,
10407
- ref: L
10406
+ ref: F
10408
10407
  }), m.state.next({
10409
- name: h,
10408
+ name: p,
10410
10409
  errors: n.errors,
10411
10410
  isValid: !1
10412
- }), k && k.shouldFocus && L && L.focus && L.focus();
10413
- }, Te = (h, g) => we(h) ? m.state.subscribe({
10414
- next: (k) => "values" in k && h(R(void 0, g), k)
10415
- }) : R(h, g, !0), Rt = (h) => m.state.subscribe({
10411
+ }), x && x.shouldFocus && F && F.focus && F.focus();
10412
+ }, Te = (p, g) => we(p) ? m.state.subscribe({
10413
+ next: (x) => "values" in x && p(P(void 0, g), x)
10414
+ }) : P(p, g, !0), Rt = (p) => m.state.subscribe({
10416
10415
  next: (g) => {
10417
- Of(h.name, g.name, h.exact) && Mf(g, h.formState || f, dl, h.reRenderRoot) && h.callback({
10416
+ Of(p.name, g.name, p.exact) && Mf(g, p.formState || f, dl, p.reRenderRoot) && p.callback({
10418
10417
  values: { ...s },
10419
10418
  ...n,
10420
10419
  ...g,
10421
10420
  defaultValues: i
10422
10421
  });
10423
10422
  }
10424
- }).unsubscribe, zn = (h) => (o.mount = !0, p = {
10425
- ...p,
10426
- ...h.formState
10427
- }, Rt({
10423
+ }).unsubscribe, zn = (p) => (o.mount = !0, h = {
10428
10424
  ...h,
10425
+ ...p.formState
10426
+ }, Rt({
10427
+ ...p,
10429
10428
  formState: {
10430
10429
  ...d,
10431
- ...h.formState
10430
+ ...p.formState
10432
10431
  }
10433
- })), Bn = (h, g = {}) => {
10434
- for (const k of h ? Kt(h) : l.mount)
10435
- l.mount.delete(k), l.array.delete(k), g.keepValue || (ae(r, k), ae(s, k)), !g.keepError && ae(n.errors, k), !g.keepDirty && ae(n.dirtyFields, k), !g.keepTouched && ae(n.touchedFields, k), !g.keepIsValidating && ae(n.validatingFields, k), !e.shouldUnregister && !g.keepDefaultValue && ae(i, k);
10432
+ })), Bn = (p, g = {}) => {
10433
+ for (const x of p ? Kt(p) : l.mount)
10434
+ l.mount.delete(x), l.array.delete(x), g.keepValue || (ae(r, x), ae(s, x)), !g.keepError && ae(n.errors, x), !g.keepDirty && ae(n.dirtyFields, x), !g.keepTouched && ae(n.touchedFields, x), !g.keepIsValidating && ae(n.validatingFields, x), !e.shouldUnregister && !g.keepDefaultValue && ae(i, x);
10436
10435
  m.state.next({
10437
10436
  values: le(s)
10438
10437
  }), m.state.next({
10439
10438
  ...n,
10440
- ...g.keepDirty ? { isDirty: I() } : {}
10441
- }), !g.keepIsValid && y();
10442
- }, li = ({ disabled: h, name: g }) => {
10443
- if (Me(h) && o.mount || h || l.disabled.has(g)) {
10444
- const M = l.disabled.has(g) !== !!h;
10445
- h ? l.disabled.add(g) : l.disabled.delete(g), M && o.mount && !o.action && y();
10446
- }
10447
- }, _n = (h, g = {}) => {
10448
- let k = D(r, h);
10449
- const L = Me(g.disabled) || Me(e.disabled);
10450
- return ee(r, h, {
10451
- ...k || {},
10439
+ ...g.keepDirty ? { isDirty: M() } : {}
10440
+ }), !g.keepIsValid && b();
10441
+ }, li = ({ disabled: p, name: g }) => {
10442
+ if (Me(p) && o.mount || p || l.disabled.has(g)) {
10443
+ const O = l.disabled.has(g) !== !!p;
10444
+ p ? l.disabled.add(g) : l.disabled.delete(g), O && o.mount && !o.action && b();
10445
+ }
10446
+ }, _n = (p, g = {}) => {
10447
+ let x = D(r, p);
10448
+ const F = Me(g.disabled) || Me(e.disabled);
10449
+ return ee(r, p, {
10450
+ ...x || {},
10452
10451
  _f: {
10453
- ...k && k._f ? k._f : { ref: { name: h } },
10454
- name: h,
10452
+ ...x && x._f ? x._f : { ref: { name: p } },
10453
+ name: p,
10455
10454
  mount: !0,
10456
10455
  ...g
10457
10456
  }
10458
- }), l.mount.add(h), k ? li({
10457
+ }), l.mount.add(p), x ? li({
10459
10458
  disabled: Me(g.disabled) ? g.disabled : e.disabled,
10460
- name: h
10461
- }) : N(h, !0, g.value), {
10462
- ...L ? { disabled: g.disabled || e.disabled } : {},
10459
+ name: p
10460
+ }) : w(p, !0, g.value), {
10461
+ ...F ? { disabled: g.disabled || e.disabled } : {},
10463
10462
  ...e.progressive ? {
10464
10463
  required: !!g.required,
10465
10464
  min: Bt(g.min),
@@ -10468,88 +10467,88 @@ function Pf(t = {}) {
10468
10467
  maxLength: Bt(g.maxLength),
10469
10468
  pattern: Bt(g.pattern)
10470
10469
  } : {},
10471
- name: h,
10470
+ name: p,
10472
10471
  onChange: xe,
10473
10472
  onBlur: xe,
10474
- ref: (M) => {
10475
- if (M) {
10476
- _n(h, g), k = D(r, h);
10477
- const E = re(M.value) && M.querySelectorAll && M.querySelectorAll("input,select,textarea")[0] || M, z = Sf(E), G = k._f.refs || [];
10478
- if (z ? G.find((Z) => Z === E) : E === k._f.ref)
10473
+ ref: (O) => {
10474
+ if (O) {
10475
+ _n(p, g), x = D(r, p);
10476
+ const E = re(O.value) && O.querySelectorAll && O.querySelectorAll("input,select,textarea")[0] || O, z = Sf(E), G = x._f.refs || [];
10477
+ if (z ? G.find((Z) => Z === E) : E === x._f.ref)
10479
10478
  return;
10480
- ee(r, h, {
10479
+ ee(r, p, {
10481
10480
  _f: {
10482
- ...k._f,
10481
+ ...x._f,
10483
10482
  ...z ? {
10484
10483
  refs: [
10485
10484
  ...G.filter(ar),
10486
10485
  E,
10487
- ...Array.isArray(D(i, h)) ? [{}] : []
10486
+ ...Array.isArray(D(i, p)) ? [{}] : []
10488
10487
  ],
10489
- ref: { type: E.type, name: h }
10488
+ ref: { type: E.type, name: p }
10490
10489
  } : { ref: E }
10491
10490
  }
10492
- }), N(h, !1, void 0, E);
10491
+ }), w(p, !1, void 0, E);
10493
10492
  } else
10494
- k = D(r, h, {}), k._f && (k._f.mount = !1), (e.shouldUnregister || g.shouldUnregister) && !(Yo(l.array, h) && o.action) && l.unMount.add(h);
10493
+ x = D(r, p, {}), x._f && (x._f.mount = !1), (e.shouldUnregister || g.shouldUnregister) && !(Yo(l.array, p) && o.action) && l.unMount.add(p);
10495
10494
  }
10496
10495
  };
10497
- }, Hn = () => e.shouldFocusError && jt(r, fe, l.mount), al = (h) => {
10498
- Me(h) && (m.state.next({ disabled: h }), jt(r, (g, k) => {
10499
- const L = D(r, k);
10500
- L && (g.disabled = L._f.disabled || h, Array.isArray(L._f.refs) && L._f.refs.forEach((M) => {
10501
- M.disabled = L._f.disabled || h;
10496
+ }, Hn = () => e.shouldFocusError && jt(r, fe, l.mount), al = (p) => {
10497
+ Me(p) && (m.state.next({ disabled: p }), jt(r, (g, x) => {
10498
+ const F = D(r, x);
10499
+ F && (g.disabled = F._f.disabled || p, Array.isArray(F._f.refs) && F._f.refs.forEach((O) => {
10500
+ O.disabled = F._f.disabled || p;
10502
10501
  }));
10503
10502
  }, 0, !1));
10504
- }, ai = (h, g) => async (k) => {
10505
- let L;
10506
- k && (k.preventDefault && k.preventDefault(), k.persist && k.persist());
10507
- let M = le(s);
10503
+ }, ai = (p, g) => async (x) => {
10504
+ let F;
10505
+ x && (x.preventDefault && x.preventDefault(), x.persist && x.persist());
10506
+ let O = le(s);
10508
10507
  if (m.state.next({
10509
10508
  isSubmitting: !0
10510
10509
  }), e.resolver) {
10511
- const { errors: E, values: z } = await V();
10512
- x(), n.errors = E, M = le(z);
10510
+ const { errors: E, values: z } = await $();
10511
+ k(), n.errors = E, O = le(z);
10513
10512
  } else
10514
10513
  await U(r);
10515
10514
  if (l.disabled.size)
10516
10515
  for (const E of l.disabled)
10517
- ae(M, E);
10516
+ ae(O, E);
10518
10517
  if (ae(n.errors, "root"), Se(n.errors)) {
10519
10518
  m.state.next({
10520
10519
  errors: {}
10521
10520
  });
10522
10521
  try {
10523
- await h(M, k);
10522
+ await p(O, x);
10524
10523
  } catch (E) {
10525
- L = E;
10524
+ F = E;
10526
10525
  }
10527
10526
  } else
10528
- g && await g({ ...n.errors }, k), Hn(), setTimeout(Hn);
10527
+ g && await g({ ...n.errors }, x), Hn(), setTimeout(Hn);
10529
10528
  if (m.state.next({
10530
10529
  isSubmitted: !0,
10531
10530
  isSubmitting: !1,
10532
- isSubmitSuccessful: Se(n.errors) && !L,
10531
+ isSubmitSuccessful: Se(n.errors) && !F,
10533
10532
  submitCount: n.submitCount + 1,
10534
10533
  errors: n.errors
10535
- }), L)
10536
- throw L;
10537
- }, cl = (h, g = {}) => {
10538
- D(r, h) && (re(g.defaultValue) ? W(h, le(D(i, h))) : (W(h, g.defaultValue), ee(i, h, le(g.defaultValue))), g.keepTouched || ae(n.touchedFields, h), g.keepDirty || (ae(n.dirtyFields, h), n.isDirty = g.defaultValue ? I(h, le(D(i, h))) : I()), g.keepError || (ae(n.errors, h), f.isValid && y()), m.state.next({ ...n }));
10539
- }, ci = (h, g = {}) => {
10540
- const k = h ? le(h) : i, L = le(k), M = Se(h), E = M ? i : L;
10541
- if (g.keepDefaultValues || (i = k), !g.keepValues) {
10534
+ }), F)
10535
+ throw F;
10536
+ }, cl = (p, g = {}) => {
10537
+ D(r, p) && (re(g.defaultValue) ? W(p, le(D(i, p))) : (W(p, g.defaultValue), ee(i, p, le(g.defaultValue))), g.keepTouched || ae(n.touchedFields, p), g.keepDirty || (ae(n.dirtyFields, p), n.isDirty = g.defaultValue ? M(p, le(D(i, p))) : M()), g.keepError || (ae(n.errors, p), f.isValid && b()), m.state.next({ ...n }));
10538
+ }, ci = (p, g = {}) => {
10539
+ const x = p ? le(p) : i, F = le(x), O = Se(p), E = O ? i : F;
10540
+ if (g.keepDefaultValues || (i = x), !g.keepValues) {
10542
10541
  if (g.keepDirtyValues) {
10543
10542
  const z = /* @__PURE__ */ new Set([
10544
10543
  ...l.mount,
10545
10544
  ...Object.keys(Et(i, s))
10546
10545
  ]);
10547
10546
  for (const G of Array.from(z)) {
10548
- const Z = D(n.dirtyFields, G), ve = D(s, G), lt = D(E, G);
10549
- Z && !re(ve) ? ee(E, G, ve) : !Z && !re(lt) && W(G, lt);
10547
+ const Z = D(n.dirtyFields, G), ve = D(s, G), at = D(E, G);
10548
+ Z && !re(ve) ? ee(E, G, ve) : !Z && !re(at) && W(G, at);
10550
10549
  }
10551
10550
  } else {
10552
- if (ei && re(h))
10551
+ if (ei && re(p))
10553
10552
  for (const z of l.mount) {
10554
10553
  const G = D(r, z);
10555
10554
  if (G && G._f) {
@@ -10585,27 +10584,27 @@ function Pf(t = {}) {
10585
10584
  focus: ""
10586
10585
  }, o.mount = !f.isValid || !!g.keepIsValid || !!g.keepDirtyValues || !e.shouldUnregister && !Se(E), o.watch = !!e.shouldUnregister, o.keepIsValid = !!g.keepIsValid, o.action = !1, g.keepErrors || (n.errors = {}), m.state.next({
10587
10586
  submitCount: g.keepSubmitCount ? n.submitCount : 0,
10588
- isDirty: M ? !1 : g.keepDirty ? n.isDirty : !!(g.keepDefaultValues && !ze(h, i)),
10587
+ isDirty: O ? !1 : g.keepDirty ? n.isDirty : !!(g.keepDefaultValues && !ze(p, i)),
10589
10588
  isSubmitted: g.keepIsSubmitted ? n.isSubmitted : !1,
10590
- dirtyFields: M ? {} : g.keepDirtyValues ? g.keepDefaultValues && s ? Et(i, s) : n.dirtyFields : g.keepDefaultValues && h ? Et(i, h) : g.keepDirty ? n.dirtyFields : {},
10589
+ dirtyFields: O ? {} : g.keepDirtyValues ? g.keepDefaultValues && s ? Et(i, s) : n.dirtyFields : g.keepDefaultValues && p ? Et(i, p) : g.keepDirty ? n.dirtyFields : {},
10591
10590
  touchedFields: g.keepTouched ? n.touchedFields : {},
10592
10591
  errors: g.keepErrors ? n.errors : {},
10593
10592
  isSubmitSuccessful: g.keepIsSubmitSuccessful ? n.isSubmitSuccessful : !1,
10594
10593
  isSubmitting: !1,
10595
10594
  defaultValues: i
10596
10595
  });
10597
- }, ui = (h, g) => ci(we(h) ? h(s) : h, { ...e.resetOptions, ...g }), ul = (h, g = {}) => {
10598
- const k = D(r, h), L = k && k._f;
10599
- if (L) {
10600
- const M = L.refs ? L.refs[0] : L.ref;
10601
- M.focus && setTimeout(() => {
10602
- M.focus(), g.shouldSelect && we(M.select) && M.select();
10596
+ }, ui = (p, g) => ci(we(p) ? p(s) : p, { ...e.resetOptions, ...g }), ul = (p, g = {}) => {
10597
+ const x = D(r, p), F = x && x._f;
10598
+ if (F) {
10599
+ const O = F.refs ? F.refs[0] : F.ref;
10600
+ O.focus && setTimeout(() => {
10601
+ O.focus(), g.shouldSelect && we(O.select) && O.select();
10603
10602
  });
10604
10603
  }
10605
- }, dl = (h) => {
10604
+ }, dl = (p) => {
10606
10605
  n = {
10607
10606
  ...n,
10608
- ...h
10607
+ ...p
10609
10608
  };
10610
10609
  }, di = {
10611
10610
  control: {
@@ -10615,23 +10614,23 @@ function Pf(t = {}) {
10615
10614
  handleSubmit: ai,
10616
10615
  setError: ne,
10617
10616
  _subscribe: Rt,
10618
- _runSchema: V,
10619
- _updateIsValidating: x,
10617
+ _runSchema: $,
10618
+ _updateIsValidating: k,
10620
10619
  _focusError: Hn,
10621
- _getWatch: R,
10622
- _getDirty: I,
10623
- _setValid: y,
10624
- _setFieldArray: C,
10620
+ _getWatch: P,
10621
+ _getDirty: M,
10622
+ _setValid: b,
10623
+ _setFieldArray: S,
10625
10624
  _setDisabledField: li,
10626
- _setErrors: S,
10627
- _getFieldArray: $,
10625
+ _setErrors: C,
10626
+ _getFieldArray: R,
10628
10627
  _reset: ci,
10629
- _resetDefaultValues: () => we(e.defaultValues) && e.defaultValues().then((h) => {
10630
- ui(h, e.resetOptions), m.state.next({
10628
+ _resetDefaultValues: () => we(e.defaultValues) && e.defaultValues().then((p) => {
10629
+ ui(p, e.resetOptions), m.state.next({
10631
10630
  isLoading: !1
10632
10631
  });
10633
10632
  }),
10634
- _removeUnmounted: P,
10633
+ _removeUnmounted: V,
10635
10634
  _disableForm: al,
10636
10635
  _subjects: m,
10637
10636
  _proxyFormState: f,
@@ -10644,8 +10643,8 @@ function Pf(t = {}) {
10644
10643
  get _state() {
10645
10644
  return o;
10646
10645
  },
10647
- set _state(h) {
10648
- o = h;
10646
+ set _state(p) {
10647
+ o = p;
10649
10648
  },
10650
10649
  get _defaultValues() {
10651
10650
  return i;
@@ -10653,8 +10652,8 @@ function Pf(t = {}) {
10653
10652
  get _names() {
10654
10653
  return l;
10655
10654
  },
10656
- set _names(h) {
10657
- l = h;
10655
+ set _names(p) {
10656
+ l = p;
10658
10657
  },
10659
10658
  get _formState() {
10660
10659
  return n;
@@ -10662,10 +10661,10 @@ function Pf(t = {}) {
10662
10661
  get _options() {
10663
10662
  return e;
10664
10663
  },
10665
- set _options(h) {
10664
+ set _options(p) {
10666
10665
  e = {
10667
10666
  ...e,
10668
- ...h
10667
+ ...p
10669
10668
  };
10670
10669
  }
10671
10670
  },
@@ -10832,29 +10831,29 @@ const $f = {
10832
10831
  onDelete: c,
10833
10832
  canDelete: d = !0,
10834
10833
  canEditTaxDeductible: f = !0,
10835
- isDisabled: p = !1,
10834
+ isDisabled: h = !1,
10836
10835
  labels: m,
10837
10836
  classNames: v = {},
10838
- "data-testid": b,
10837
+ "data-testid": y,
10839
10838
  // React Hook Form props
10840
- control: y,
10841
- name: x,
10842
- rules: C
10839
+ control: b,
10840
+ name: k,
10841
+ rules: S
10843
10842
  }) => {
10844
- const w = { ...$f, ...m }, S = y !== void 0 && x !== void 0, N = Rf({
10843
+ const I = { ...$f, ...m }, C = b !== void 0 && k !== void 0, w = Rf({
10845
10844
  defaultValues: { _internal: e || cr() }
10846
10845
  }), T = xf({
10847
- control: S ? y : N.control,
10848
- name: S ? x : "_internal",
10849
- rules: S ? C : void 0
10850
- }), [O, V] = J(
10846
+ control: C ? b : w.control,
10847
+ name: C ? k : "_internal",
10848
+ rules: C ? S : void 0
10849
+ }), [N, $] = J(
10851
10850
  e || cr()
10852
- ), H = S ? T.field.value ?? cr() : t ?? O, U = S && !!T.fieldState?.error, P = S && (T.fieldState?.isTouched ?? !1), I = U || P, R = I && (!H.amount || H.amount <= 0), $ = I && !H.glAccount, [_, X] = J(H.glAccount?.name || ""), W = ce(
10851
+ ), _ = C ? T.field.value ?? cr() : t ?? N, U = C && !!T.fieldState?.error, V = C && (T.fieldState?.isTouched ?? !1), M = U || V, P = M && (!_.amount || _.amount <= 0), R = M && !_.glAccount, [H, Q] = J(_.glAccount?.name || ""), W = ce(
10853
10852
  (ne) => {
10854
- const Te = { ...H, ...ne };
10855
- S && T.field.onChange(Te), !S && t === void 0 && V(Te), s?.(Te);
10853
+ const Te = { ..._, ...ne };
10854
+ C && T.field.onChange(Te), !C && t === void 0 && $(Te), s?.(Te);
10856
10855
  },
10857
- [H, t, s, S, T]
10856
+ [_, t, s, C, T]
10858
10857
  ), xe = ce(
10859
10858
  (ne) => {
10860
10859
  const Te = ne || 0;
@@ -10863,7 +10862,7 @@ const $f = {
10863
10862
  [W, o]
10864
10863
  ), fe = ce(
10865
10864
  (ne) => {
10866
- X(ne), i?.(ne);
10865
+ Q(ne), i?.(ne);
10867
10866
  },
10868
10867
  [i]
10869
10868
  ), ke = ce(
@@ -10877,7 +10876,7 @@ const $f = {
10877
10876
  },
10878
10877
  [n, W, l]
10879
10878
  ), Ye = ce(() => {
10880
- X(""), W({ glAccount: null }), l?.(null);
10879
+ Q(""), W({ glAccount: null }), l?.(null);
10881
10880
  }, [W, l]), vt = ce(
10882
10881
  (ne) => {
10883
10882
  W({ isTaxDeductible: ne }), a?.(ne);
@@ -10891,16 +10890,16 @@ const $f = {
10891
10890
  {
10892
10891
  radius: "md",
10893
10892
  shadow: "sm",
10894
- "data-testid": b || "revenue-distribution-card",
10895
- className: F(v.base),
10896
- children: /* @__PURE__ */ A(Le, { className: F("flex flex-row flex-nowrap items-start gap-4", v.body), children: [
10897
- /* @__PURE__ */ u("div", { className: F("shrink-0", v.amountContainer), children: /* @__PURE__ */ u(
10893
+ "data-testid": y || "revenue-distribution-card",
10894
+ className: L(v.base),
10895
+ children: /* @__PURE__ */ A(Le, { className: L("flex flex-row flex-nowrap items-start gap-4", v.body), children: [
10896
+ /* @__PURE__ */ u("div", { className: L("shrink-0", v.amountContainer), children: /* @__PURE__ */ u(
10898
10897
  Ls,
10899
10898
  {
10900
- "data-testid": `${b || "revenue-distribution-card"}-amount-input`,
10899
+ "data-testid": `${y || "revenue-distribution-card"}-amount-input`,
10901
10900
  label: /* @__PURE__ */ A("span", { className: "flex items-center gap-1", children: [
10902
- w.amount,
10903
- /* @__PURE__ */ u(Tt, { content: w.amountTooltip, children: /* @__PURE__ */ u(
10901
+ I.amount,
10902
+ /* @__PURE__ */ u(Tt, { content: I.amountTooltip, children: /* @__PURE__ */ u(
10904
10903
  Ie,
10905
10904
  {
10906
10905
  icon: "solar:info-circle-linear",
@@ -10909,29 +10908,29 @@ const $f = {
10909
10908
  }
10910
10909
  ) })
10911
10910
  ] }),
10912
- value: H.amount || void 0,
10911
+ value: _.amount || void 0,
10913
10912
  onValueChange: xe,
10914
10913
  labelPlacement: "outside",
10915
- placeholder: w.amountPlaceholder,
10914
+ placeholder: I.amountPlaceholder,
10916
10915
  isWheelDisabled: !0,
10917
10916
  hideStepper: !0,
10918
10917
  variant: "bordered",
10919
- isDisabled: p,
10920
- isInvalid: R,
10921
- errorMessage: R ? "Amount is required" : void 0,
10918
+ isDisabled: h,
10919
+ isInvalid: P,
10920
+ errorMessage: P ? "Amount is required" : void 0,
10922
10921
  minValue: 0,
10923
10922
  step: 0.01,
10924
10923
  className: v.amountInput,
10925
- startContent: /* @__PURE__ */ u("div", { className: "pointer-events-none flex items-center", children: /* @__PURE__ */ u("span", { className: "text-default-400 text-small", children: w.currencySymbol }) })
10924
+ startContent: /* @__PURE__ */ u("div", { className: "pointer-events-none flex items-center", children: /* @__PURE__ */ u("span", { className: "text-default-400 text-small", children: I.currencySymbol }) })
10926
10925
  }
10927
10926
  ) }),
10928
- /* @__PURE__ */ u("div", { className: F("grow", v.glAccountContainer), children: /* @__PURE__ */ u(
10927
+ /* @__PURE__ */ u("div", { className: L("grow", v.glAccountContainer), children: /* @__PURE__ */ u(
10929
10928
  vl,
10930
10929
  {
10931
- "data-testid": `${b || "revenue-distribution-card"}-gl-account-input`,
10930
+ "data-testid": `${y || "revenue-distribution-card"}-gl-account-input`,
10932
10931
  label: /* @__PURE__ */ A("span", { className: "flex items-center gap-1", children: [
10933
- w.glAccount,
10934
- /* @__PURE__ */ u(Tt, { content: w.glAccountTooltip, children: /* @__PURE__ */ u(
10932
+ I.glAccount,
10933
+ /* @__PURE__ */ u(Tt, { content: I.glAccountTooltip, children: /* @__PURE__ */ u(
10935
10934
  Ie,
10936
10935
  {
10937
10936
  icon: "solar:info-circle-linear",
@@ -10946,15 +10945,15 @@ const $f = {
10946
10945
  variant: "bordered",
10947
10946
  items: n,
10948
10947
  menuTrigger: "input",
10949
- inputValue: H.glAccount?.name ?? _,
10950
- selectedKey: H.glAccount?.id ?? null,
10951
- isDisabled: p,
10952
- isInvalid: $,
10953
- errorMessage: $ ? "GL Account is required" : void 0,
10948
+ inputValue: _.glAccount?.name ?? H,
10949
+ selectedKey: _.glAccount?.id ?? null,
10950
+ isDisabled: h,
10951
+ isInvalid: R,
10952
+ errorMessage: R ? "GL Account is required" : void 0,
10954
10953
  listboxProps: {
10955
- emptyContent: r ? w.searching : w.noGlAccountsFound
10954
+ emptyContent: r ? I.searching : I.noGlAccountsFound
10956
10955
  },
10957
- placeholder: w.glAccountPlaceholder,
10956
+ placeholder: I.glAccountPlaceholder,
10958
10957
  onInputChange: fe,
10959
10958
  onSelectionChange: ke,
10960
10959
  onClear: Ye,
@@ -10965,30 +10964,30 @@ const $f = {
10965
10964
  ] }) }, ne.id)
10966
10965
  }
10967
10966
  ) }),
10968
- /* @__PURE__ */ u("div", { className: F("shrink-0 pt-6 flex items-center", v.taxDeductibleContainer), children: /* @__PURE__ */ u(
10967
+ /* @__PURE__ */ u("div", { className: L("shrink-0 pt-6 flex items-center", v.taxDeductibleContainer), children: /* @__PURE__ */ u(
10969
10968
  Cl,
10970
10969
  {
10971
10970
  radius: "full",
10972
- "data-testid": `${b || "revenue-distribution-card"}-tax-deductible`,
10973
- isSelected: H.isTaxDeductible,
10971
+ "data-testid": `${y || "revenue-distribution-card"}-tax-deductible`,
10972
+ isSelected: _.isTaxDeductible,
10974
10973
  onValueChange: vt,
10975
- isDisabled: p || !f,
10974
+ isDisabled: h || !f,
10976
10975
  className: v.taxDeductibleCheckbox,
10977
- children: w.taxDeductible
10976
+ children: I.taxDeductible
10978
10977
  }
10979
10978
  ) }),
10980
- /* @__PURE__ */ u("div", { className: F("shrink-0 pt-6", v.deleteContainer), children: /* @__PURE__ */ u(
10979
+ /* @__PURE__ */ u("div", { className: L("shrink-0 pt-6", v.deleteContainer), children: /* @__PURE__ */ u(
10981
10980
  oe,
10982
10981
  {
10983
- "data-testid": `${b || "revenue-distribution-card"}-delete-button`,
10982
+ "data-testid": `${y || "revenue-distribution-card"}-delete-button`,
10984
10983
  size: "sm",
10985
10984
  color: "danger",
10986
10985
  variant: "flat",
10987
- isDisabled: p || !d,
10986
+ isDisabled: h || !d,
10988
10987
  onPress: Pt,
10989
10988
  startContent: /* @__PURE__ */ u(Ie, { icon: "solar:trash-bin-trash-linear", width: 16 }),
10990
- className: F("text-danger", v.deleteButton),
10991
- children: w.deleteButton
10989
+ className: L("text-danger", v.deleteButton),
10990
+ children: I.deleteButton
10992
10991
  }
10993
10992
  ) })
10994
10993
  ] })
@@ -11006,9 +11005,9 @@ const zf = ({
11006
11005
  }) => {
11007
11006
  if (s)
11008
11007
  return /* @__PURE__ */ u(Je, { children: s() });
11009
- const o = /* @__PURE__ */ A("div", { className: F("flex flex-col items-center justify-center py-8", i.content), children: [
11010
- /* @__PURE__ */ u(Ie, { icon: e, width: n, className: F("text-default-300 mb-4", i.icon) }),
11011
- /* @__PURE__ */ u("p", { className: F("text-default-500 text-sm text-center", i.message), children: t })
11008
+ const o = /* @__PURE__ */ A("div", { className: L("flex flex-col items-center justify-center py-8", i.content), children: [
11009
+ /* @__PURE__ */ u(Ie, { icon: e, width: n, className: L("text-default-300 mb-4", i.icon) }),
11010
+ /* @__PURE__ */ u("p", { className: L("text-default-500 text-sm text-center", i.message), children: t })
11012
11011
  ] });
11013
11012
  return r ? /* @__PURE__ */ u(
11014
11013
  Ee,
@@ -11016,10 +11015,10 @@ const zf = ({
11016
11015
  radius: "sm",
11017
11016
  shadow: "sm",
11018
11017
  "data-testid": "revenue-distribution-empty",
11019
- className: F("w-full", i.base),
11018
+ className: L("w-full", i.base),
11020
11019
  children: /* @__PURE__ */ u(Le, { children: o })
11021
11020
  }
11022
- ) : /* @__PURE__ */ u("div", { "data-testid": "revenue-distribution-empty", className: F("w-full", i.base), children: o });
11021
+ ) : /* @__PURE__ */ u("div", { "data-testid": "revenue-distribution-empty", className: L("w-full", i.base), children: o });
11023
11022
  };
11024
11023
  zf.displayName = "RevenueDistributionEmpty";
11025
11024
  const Bf = {
@@ -11048,10 +11047,10 @@ const Bf = {
11048
11047
  radius: "sm",
11049
11048
  shadow: "sm",
11050
11049
  "data-testid": "revenue-distribution-error",
11051
- className: F("w-full", i.base),
11050
+ className: L("w-full", i.base),
11052
11051
  children: /* @__PURE__ */ u(Le, { children: o })
11053
11052
  }
11054
- ) : /* @__PURE__ */ u("div", { "data-testid": "revenue-distribution-error", className: F("w-full", i.base), children: o });
11053
+ ) : /* @__PURE__ */ u("div", { "data-testid": "revenue-distribution-error", className: L("w-full", i.base), children: o });
11055
11054
  };
11056
11055
  _f.displayName = "RevenueDistributionError";
11057
11056
  const Hf = ({
@@ -11059,7 +11058,7 @@ const Hf = ({
11059
11058
  showCard: e = !0,
11060
11059
  classNames: n = {}
11061
11060
  }) => {
11062
- const r = Array.from({ length: t }, (s, o) => o), i = (s) => /* @__PURE__ */ A("div", { className: F("flex flex-row flex-nowrap items-end gap-4", n.row), children: [
11061
+ const r = Array.from({ length: t }, (s, o) => o), i = (s) => /* @__PURE__ */ A("div", { className: L("flex flex-row flex-nowrap items-end gap-4", n.row), children: [
11063
11062
  /* @__PURE__ */ A("div", { className: "shrink-0 flex flex-col gap-1", children: [
11064
11063
  /* @__PURE__ */ A("div", { className: "flex items-center gap-1", children: [
11065
11064
  /* @__PURE__ */ u(me, { className: "h-4 w-14 rounded-md" }),
@@ -11080,7 +11079,7 @@ const Hf = ({
11080
11079
  ] }),
11081
11080
  /* @__PURE__ */ u("div", { className: "shrink-0 pb-2", children: /* @__PURE__ */ u(me, { className: "h-8 w-20 rounded-lg" }) })
11082
11081
  ] }, s);
11083
- return e ? /* @__PURE__ */ u("div", { className: F("flex flex-col gap-3", n.base), children: r.map((s) => /* @__PURE__ */ u(Ee, { radius: "md", shadow: "sm", "data-testid": `revenue-distribution-skeleton-${s}`, children: /* @__PURE__ */ u(Le, { children: i(s) }) }, s)) }) : /* @__PURE__ */ u("div", { "data-testid": "revenue-distribution-skeleton", className: F("flex flex-col gap-3", n.base), children: r.map((s) => i(s)) });
11082
+ return e ? /* @__PURE__ */ u("div", { className: L("flex flex-col gap-3", n.base), children: r.map((s) => /* @__PURE__ */ u(Ee, { radius: "md", shadow: "sm", "data-testid": `revenue-distribution-skeleton-${s}`, children: /* @__PURE__ */ u(Le, { children: i(s) }) }, s)) }) : /* @__PURE__ */ u("div", { "data-testid": "revenue-distribution-skeleton", className: L("flex flex-col gap-3", n.base), children: r.map((s) => i(s)) });
11084
11083
  };
11085
11084
  Hf.displayName = "RevenueDistributionSkeleton";
11086
11085
  const Uf = {
@@ -11091,52 +11090,56 @@ const Uf = {
11091
11090
  cards: t,
11092
11091
  locale: e,
11093
11092
  currency: n,
11094
- labels: r,
11095
- showRenewal: i = !0,
11096
- defaultRenewalValue: s = !1,
11097
- onRenewalChange: o,
11098
- onCardSelect: l,
11099
- className: a = ""
11093
+ listHeightClassName: r = "",
11094
+ labels: i,
11095
+ showRenewal: s = !0,
11096
+ defaultRenewalValue: o = !1,
11097
+ onRenewalChange: l,
11098
+ onCardSelect: a,
11099
+ className: c = ""
11100
11100
  }) => {
11101
- const c = Array.isArray(t) ? t : [], [d, f] = J(null), [p, m] = J(s), v = { ...Uf, ...r }, b = (x) => {
11102
- x !== d && (f(x), l?.(x));
11103
- }, y = (x) => {
11104
- m(x), o?.(x);
11101
+ const d = Array.isArray(t) ? t : [], [f, h] = J(null), [m, v] = J(o), y = { ...Uf, ...i }, b = (S) => {
11102
+ S !== f && (h(S), a?.(S));
11103
+ }, k = (S) => {
11104
+ v(S), l?.(S);
11105
11105
  };
11106
11106
  return /* @__PURE__ */ A(
11107
11107
  "div",
11108
11108
  {
11109
- className: F("w-full flex flex-col gap-4 items-start p-4 h-svh", a),
11109
+ className: L("w-full flex flex-col gap-4 items-start p-4 h-svh", c),
11110
11110
  "data-testid": "membership-select-cards",
11111
11111
  children: [
11112
- /* @__PURE__ */ u("p", { className: "text-2xl font-semibold text-left", "data-testid": "membership-select-cards-title", children: v.title }),
11113
- i && /* @__PURE__ */ u(
11112
+ /* @__PURE__ */ u("p", { className: "text-2xl font-semibold text-left", "data-testid": "membership-select-cards-title", children: y.title }),
11113
+ s && /* @__PURE__ */ u(
11114
11114
  Kf,
11115
11115
  {
11116
- title: v.renewalTitle,
11117
- description: v.renewalDescription,
11118
- value: p,
11119
- onValueChange: y
11116
+ title: y.renewalTitle,
11117
+ description: y.renewalDescription,
11118
+ value: m,
11119
+ onValueChange: k
11120
11120
  }
11121
11121
  ),
11122
11122
  /* @__PURE__ */ u(
11123
11123
  "div",
11124
11124
  {
11125
- className: "w-full flex-1 min-h-0 flex flex-col gap-4 overflow-y-auto",
11125
+ className: L(
11126
+ "w-full min-h-0 flex flex-col gap-4 overflow-y-auto",
11127
+ r === "" ? "flex-1" : L("shrink-0", r)
11128
+ ),
11126
11129
  "data-testid": "membership-select-cards-list",
11127
- children: c.map((x) => /* @__PURE__ */ u(
11130
+ children: d.map((S) => /* @__PURE__ */ u(
11128
11131
  qf,
11129
11132
  {
11130
- itemKey: x.id,
11131
- name: x.name,
11132
- type: x.type,
11133
- price: x.price,
11133
+ itemKey: S.id,
11134
+ name: S.name,
11135
+ type: S.type,
11136
+ price: S.price,
11134
11137
  locale: e,
11135
11138
  currency: n,
11136
- isSelected: d === x.id,
11139
+ isSelected: f === S.id,
11137
11140
  onSelect: b
11138
11141
  },
11139
- x.id
11142
+ S.id
11140
11143
  ))
11141
11144
  }
11142
11145
  )
@@ -11166,7 +11169,7 @@ const Uf = {
11166
11169
  shadow: "none",
11167
11170
  isPressable: !!l,
11168
11171
  onPress: () => l?.(t),
11169
- className: F(
11172
+ className: L(
11170
11173
  "w-full min-h-fit border rounded-3xl",
11171
11174
  o ? "border-primary bg-primary/5" : "border-default",
11172
11175
  a
@@ -11187,7 +11190,7 @@ const Uf = {
11187
11190
  return /* @__PURE__ */ A(
11188
11191
  "div",
11189
11192
  {
11190
- className: F(
11193
+ className: L(
11191
11194
  "w-full flex flex-row items-center",
11192
11195
  t || n ? "justify-between gap-6" : "justify-start",
11193
11196
  i
@@ -11219,22 +11222,22 @@ const Uf = {
11219
11222
  i || s >= n || r?.(s + 1);
11220
11223
  }, l = () => {
11221
11224
  i || s <= e || r?.(s - 1);
11222
- }, a = (b) => {
11225
+ }, a = (y) => {
11223
11226
  if (i) return;
11224
- const y = parseInt(b.target.value, 10);
11225
- isNaN(y) || r?.(Math.max(e, Math.min(n, y)));
11226
- }, c = (b) => {
11227
- const y = parseInt(b.target.value, 10);
11228
- isNaN(y) && r?.(e);
11229
- }, d = s <= e, f = s >= n, p = "w-10 h-10 flex items-center justify-center border-0 rounded-full cursor-pointer transition-colors duration-150 text-white text-lg font-medium", m = "bg-[#C14615] hover:bg-[#a73c11]", v = "bg-[#e0a28a] cursor-not-allowed";
11230
- return /* @__PURE__ */ A("div", { className: "flex items-center gap-1", "data-testid": "quantity-selector", children: [
11227
+ const b = parseInt(y.target.value, 10);
11228
+ isNaN(b) || r?.(Math.max(e, Math.min(n, b)));
11229
+ }, c = (y) => {
11230
+ const b = parseInt(y.target.value, 10);
11231
+ isNaN(b) && r?.(e);
11232
+ }, d = s <= e, f = s >= n, h = "w-10 h-10 flex items-center justify-center border-0 rounded-full cursor-pointer transition-colors duration-150 text-white text-2xl font-regular", m = "bg-[#C14615] hover:bg-[#a73c11]", v = "bg-[#e0a28a] cursor-not-allowed";
11233
+ return /* @__PURE__ */ A("div", { className: "flex items-center gap-4", "data-testid": "quantity-selector", children: [
11231
11234
  /* @__PURE__ */ u(
11232
11235
  "button",
11233
11236
  {
11234
11237
  type: "button",
11235
11238
  onClick: l,
11236
11239
  disabled: i || d,
11237
- className: F(p, i || d ? v : m),
11240
+ className: L(h, i || d ? v : m),
11238
11241
  "aria-label": "Decrement quantity",
11239
11242
  "data-testid": "quantity-decrement",
11240
11243
  children: "-"
@@ -11251,7 +11254,7 @@ const Uf = {
11251
11254
  min: e,
11252
11255
  max: n,
11253
11256
  step: "1",
11254
- className: "w-12 h-8 text-center border-0 text-xl font-medium [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
11257
+ className: "w-12 h-10 rounded-md border-0 bg-zinc-100 text-center text-2xl font-medium text-zinc-900 [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
11255
11258
  "aria-label": `Selected quantity: ${s}`,
11256
11259
  "data-testid": "quantity-input"
11257
11260
  }
@@ -11262,7 +11265,7 @@ const Uf = {
11262
11265
  type: "button",
11263
11266
  onClick: o,
11264
11267
  disabled: i || f,
11265
- className: F(p, i || f ? v : m),
11268
+ className: L(h, i || f ? v : m),
11266
11269
  "aria-label": "Increment quantity",
11267
11270
  "data-testid": "quantity-increment",
11268
11271
  children: "+"
@@ -11292,7 +11295,7 @@ const Uf = {
11292
11295
  "aria-checked": i,
11293
11296
  "data-testid": "checkbox-button",
11294
11297
  "data-checked": i,
11295
- className: F(
11298
+ className: L(
11296
11299
  "flex items-center gap-1.5 px-4 py-3 border-0 rounded-[26px] cursor-pointer text-sm min-h-[30px]",
11297
11300
  "outline-none select-none transition-colors bg-zinc-100 hover:bg-zinc-200 text-[#C14615]",
11298
11301
  r && "cursor-not-allowed opacity-60"
@@ -11315,7 +11318,7 @@ const Uf = {
11315
11318
  /* @__PURE__ */ u(
11316
11319
  "span",
11317
11320
  {
11318
- className: F(
11321
+ className: L(
11319
11322
  "block w-3.5 h-3.5 rounded-[4px] relative",
11320
11323
  i ? "bg-[#C14615]" : "bg-white shadow-[0_0_3px_rgba(0,0,0,0.4)]"
11321
11324
  ),
@@ -11390,7 +11393,7 @@ const Uf = {
11390
11393
  labels: l,
11391
11394
  initialExpanded: a = !1
11392
11395
  }) => {
11393
- const [c, d] = J(a), f = e.tickets.reduce((p, m) => p + r(e.id, m.id), 0);
11396
+ const [c, d] = J(a), f = e.tickets.reduce((h, m) => h + r(e.id, m.id), 0);
11394
11397
  return /* @__PURE__ */ A("div", { className: "w-full overflow-hidden border-b border-zinc-200", "data-testid": "upgrade-ticket-header", children: [
11395
11398
  /* @__PURE__ */ u(
11396
11399
  "button",
@@ -11412,7 +11415,7 @@ const Uf = {
11412
11415
  /* @__PURE__ */ u(
11413
11416
  "span",
11414
11417
  {
11415
- className: F(
11418
+ className: L(
11416
11419
  "inline-flex items-center justify-center text-zinc-500 text-xl transition-transform duration-200",
11417
11420
  c && "rotate-180"
11418
11421
  ),
@@ -11428,139 +11431,140 @@ const Uf = {
11428
11431
  "div",
11429
11432
  {
11430
11433
  id: `upgrade-items-${e.id}`,
11431
- className: F(
11434
+ className: L(
11432
11435
  "transition-all duration-300 overflow-hidden",
11433
11436
  c ? "max-h-[1000px] opacity-100" : "max-h-0 opacity-0"
11434
11437
  ),
11435
11438
  "aria-hidden": !c,
11436
- children: c && /* @__PURE__ */ u("div", { className: "px-5 pb-5 flex flex-col", "data-testid": "upgrade-ticket-items", children: e.tickets.length > 0 ? e.tickets.map((p) => /* @__PURE__ */ u(
11439
+ children: c && /* @__PURE__ */ u("div", { className: "px-5 pb-5 flex flex-col", "data-testid": "upgrade-ticket-items", children: e.tickets.length > 0 ? e.tickets.map((h) => /* @__PURE__ */ u(
11437
11440
  Zf,
11438
11441
  {
11439
- item: p,
11440
- quantity: r(e.id, p.id),
11441
- onChange: (m) => n(e.id, p.id, m),
11442
+ item: h,
11443
+ quantity: r(e.id, h.id),
11444
+ onChange: (m) => n(e.id, h.id, m),
11442
11445
  getTotalSelectedTickets: i,
11443
11446
  userMaxLimit: s,
11444
11447
  settings: o,
11445
11448
  labels: l
11446
11449
  },
11447
- p.id
11450
+ h.id
11448
11451
  )) : /* @__PURE__ */ u("div", { className: "px-5 py-10 text-center", children: /* @__PURE__ */ u("p", { className: "m-0 text-zinc-500 italic", children: l.noUpgradeTicketsAvailable }) }) })
11449
11452
  }
11450
11453
  )
11451
11454
  ] });
11452
11455
  }, Eh = ({
11453
11456
  userMaxLimit: t = 10,
11454
- labels: e,
11455
- settings: n,
11456
- ticketSelectionData: r,
11457
- className: i = "",
11458
- onSelectionChange: s
11457
+ initialExpanded: e = !1,
11458
+ labels: n,
11459
+ settings: r,
11460
+ ticketSelectionData: i,
11461
+ className: s = "",
11462
+ onSelectionChange: o
11459
11463
  }) => {
11460
- const o = r ?? [], l = { ...jf, ...e }, [a, c] = J(!0), d = ce(() => {
11461
- const w = {};
11462
- let S = t;
11463
- for (const N of o) {
11464
- w[N.id] = {};
11465
- for (const T of N.tickets) {
11466
- const O = S > 0 ? Math.min(T.max, S) : 0;
11467
- w[N.id][T.id] = {
11468
- id: T.id,
11469
- selectedQuantity: O,
11470
- originalPrice: T.originalPrice,
11471
- discountedPrice: T.price
11472
- }, S -= O;
11464
+ const l = it(() => i ?? [], [i]), a = { ...jf, ...n }, [c, d] = J(!0), f = ce(() => {
11465
+ const C = {};
11466
+ let w = t;
11467
+ for (const T of l) {
11468
+ C[T.id] = {};
11469
+ for (const N of T.tickets) {
11470
+ const $ = w > 0 ? Math.min(N.max, w) : 0;
11471
+ C[T.id][N.id] = {
11472
+ id: N.id,
11473
+ selectedQuantity: $,
11474
+ originalPrice: N.originalPrice,
11475
+ discountedPrice: N.price
11476
+ }, w -= $;
11473
11477
  }
11474
11478
  }
11475
- return w;
11476
- }, [o, t]), [f, p] = J(() => d()), m = It(!1), v = (w = f) => {
11477
- const S = Object.values(w).reduce(
11478
- (N, T) => N + Object.values(T).reduce((O, V) => O + V.selectedQuantity, 0),
11479
+ return C;
11480
+ }, [l, t]), [h, m] = J(() => f()), v = It(!1), y = (C = h) => {
11481
+ const w = Object.values(C).reduce(
11482
+ (T, N) => T + Object.values(N).reduce(($, _) => $ + _.selectedQuantity, 0),
11479
11483
  0
11480
11484
  );
11481
- for (const N of o)
11482
- for (const T of N.tickets) {
11483
- const O = w[N.id]?.[T.id]?.selectedQuantity ?? 0, V = Math.min(T.max, t - (S - O));
11484
- if (O < V && V > 0) return !1;
11485
+ for (const T of l)
11486
+ for (const N of T.tickets) {
11487
+ const $ = C[T.id]?.[N.id]?.selectedQuantity ?? 0, _ = Math.min(N.max, t - (w - $));
11488
+ if ($ < _ && _ > 0) return !1;
11485
11489
  }
11486
11490
  return !0;
11487
- }, b = (w, S) => f[w]?.[S]?.selectedQuantity ?? 0, y = () => Object.values(f).reduce(
11488
- (w, S) => w + Object.values(S).reduce((N, T) => N + T.selectedQuantity, 0),
11491
+ }, b = (C, w) => h[C]?.[w]?.selectedQuantity ?? 0, k = () => Object.values(h).reduce(
11492
+ (C, w) => C + Object.values(w).reduce((T, N) => T + N.selectedQuantity, 0),
11489
11493
  0
11490
- ), x = (w, S, N) => {
11491
- if (Object.values(f).reduce((P, I) => P + Object.entries(I).reduce((R, [$, _]) => I === f[w] && $ === S ? R : R + _.selectedQuantity, 0), 0) + N > t) return;
11492
- const O = o.find((P) => P.id === w)?.tickets.find((P) => P.id === S);
11493
- if (!O) return;
11494
- const V = {
11495
- ...f,
11496
- [w]: {
11497
- ...f[w],
11498
- [S]: {
11499
- id: S,
11500
- selectedQuantity: N,
11501
- originalPrice: O.originalPrice,
11502
- discountedPrice: O.price
11494
+ ), S = (C, w, T) => {
11495
+ if (Object.values(h).reduce((M, P) => M + Object.entries(P).reduce((R, [H, Q]) => P === h[C] && H === w ? R : R + Q.selectedQuantity, 0), 0) + T > t) return;
11496
+ const $ = l.find((M) => M.id === C)?.tickets.find((M) => M.id === w);
11497
+ if (!$) return;
11498
+ const _ = {
11499
+ ...h,
11500
+ [C]: {
11501
+ ...h[C],
11502
+ [w]: {
11503
+ id: w,
11504
+ selectedQuantity: T,
11505
+ originalPrice: $.originalPrice,
11506
+ discountedPrice: $.price
11503
11507
  }
11504
11508
  }
11505
11509
  };
11506
- p(V), s?.(V);
11507
- const H = v(V), U = Object.values(V).reduce(
11508
- (P, I) => P + Object.values(I).reduce((R, $) => R + $.selectedQuantity, 0),
11510
+ m(_), o?.(_);
11511
+ const U = y(_), V = Object.values(_).reduce(
11512
+ (M, P) => M + Object.values(P).reduce((R, H) => R + H.selectedQuantity, 0),
11509
11513
  0
11510
11514
  );
11511
- H && !a ? c(!0) : !H && U !== 0 && a && c(!1);
11512
- }, C = (w) => {
11513
- if (c(w), w) {
11514
- const S = d();
11515
- p(S), s?.(S);
11515
+ U && !c ? d(!0) : !U && V !== 0 && c && d(!1);
11516
+ }, I = (C) => {
11517
+ if (d(C), C) {
11518
+ const w = f();
11519
+ m(w), o?.(w);
11516
11520
  } else {
11517
- const S = {};
11518
- for (const N of o) {
11519
- S[N.id] = {};
11520
- for (const T of N.tickets)
11521
- S[N.id][T.id] = {
11522
- id: T.id,
11521
+ const w = {};
11522
+ for (const T of l) {
11523
+ w[T.id] = {};
11524
+ for (const N of T.tickets)
11525
+ w[T.id][N.id] = {
11526
+ id: N.id,
11523
11527
  selectedQuantity: 0,
11524
- originalPrice: T.originalPrice,
11525
- discountedPrice: T.price
11528
+ originalPrice: N.originalPrice,
11529
+ discountedPrice: N.price
11526
11530
  };
11527
11531
  }
11528
- p(S), s?.(S);
11532
+ m(w), o?.(w);
11529
11533
  }
11530
11534
  };
11531
11535
  return qe(() => {
11532
- !m.current && a && (s?.(f), m.current = !0);
11533
- }, [a, f, s]), /* @__PURE__ */ A(
11536
+ !v.current && c && (o?.(h), v.current = !0);
11537
+ }, [c, h, o]), /* @__PURE__ */ A(
11534
11538
  "div",
11535
11539
  {
11536
- className: F("flex flex-col w-full font-sans", i),
11540
+ className: L("flex flex-col w-full font-sans", s),
11537
11541
  "data-testid": "ticket-selection",
11538
11542
  children: [
11539
11543
  /* @__PURE__ */ A("div", { className: "flex items-center justify-between py-2 gap-4", "data-testid": "ticket-selection-header", children: [
11540
- /* @__PURE__ */ u("h3", { className: "text-xl font-semibold m-0", "data-testid": "ticket-selection-title", children: l.ticketSelectionTitle }),
11544
+ /* @__PURE__ */ u("h3", { className: "text-xl font-semibold m-0", "data-testid": "ticket-selection-title", children: a.ticketSelectionTitle }),
11541
11545
  /* @__PURE__ */ u(
11542
11546
  Gf,
11543
11547
  {
11544
- label: l.selectAllButtonLabel,
11545
- checked: a,
11546
- onChange: C
11548
+ label: a.selectAllButtonLabel,
11549
+ checked: c,
11550
+ onChange: I
11547
11551
  }
11548
11552
  )
11549
11553
  ] }),
11550
- o.map((w) => /* @__PURE__ */ u(
11554
+ l.map((C) => /* @__PURE__ */ u(
11551
11555
  Qf,
11552
11556
  {
11553
- title: w.exhibitionName,
11554
- exhibition: w,
11555
- onQuantityChange: x,
11557
+ title: C.exhibitionName,
11558
+ exhibition: C,
11559
+ onQuantityChange: S,
11556
11560
  getTicketQuantity: b,
11557
- getTotalSelectedTickets: y,
11561
+ getTotalSelectedTickets: k,
11558
11562
  userMaxLimit: t,
11559
- settings: n,
11560
- labels: l,
11561
- initialExpanded: !1
11563
+ settings: r,
11564
+ labels: a,
11565
+ initialExpanded: e
11562
11566
  },
11563
- w.id
11567
+ C.id
11564
11568
  ))
11565
11569
  ]
11566
11570
  }