@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/README.md +34 -1
- package/dist/index.cjs +9 -9
- package/dist/index.js +1140 -1136
- package/dist/patterns/MembershipSelectCards/types.d.ts +2 -0
- package/dist/patterns/TicketSelection/types.d.ts +2 -0
- package/package.json +1 -1
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
|
|
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
|
|
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:
|
|
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, ...
|
|
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, ...
|
|
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 [
|
|
238
|
-
let
|
|
239
|
-
const
|
|
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
|
-
|
|
250
|
+
y = "[--step-color:var(--heroui-primary)]", b = "[--step-fg-color:var(--heroui-primary-foreground)]";
|
|
251
251
|
break;
|
|
252
252
|
case "secondary":
|
|
253
|
-
|
|
253
|
+
y = "[--step-color:var(--heroui-secondary)]", b = "[--step-fg-color:var(--heroui-secondary-foreground)]";
|
|
254
254
|
break;
|
|
255
255
|
case "success":
|
|
256
|
-
|
|
256
|
+
y = "[--step-color:var(--heroui-success)]", b = "[--step-fg-color:var(--heroui-success-foreground)]";
|
|
257
257
|
break;
|
|
258
258
|
case "warning":
|
|
259
|
-
|
|
259
|
+
y = "[--step-color:var(--heroui-warning)]", b = "[--step-fg-color:var(--heroui-warning-foreground)]";
|
|
260
260
|
break;
|
|
261
261
|
case "danger":
|
|
262
|
-
|
|
262
|
+
y = "[--step-color:var(--heroui-danger)]", b = "[--step-fg-color:var(--heroui-danger-foreground)]";
|
|
263
263
|
break;
|
|
264
264
|
case "default":
|
|
265
|
-
|
|
265
|
+
y = "[--step-color:var(--heroui-default)]", b = "[--step-fg-color:var(--heroui-default-foreground)]";
|
|
266
266
|
break;
|
|
267
267
|
default:
|
|
268
|
-
|
|
268
|
+
y = "[--step-color:var(--heroui-primary)]", b = "[--step-fg-color:var(--heroui-primary-foreground)]";
|
|
269
269
|
break;
|
|
270
270
|
}
|
|
271
|
-
return
|
|
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:
|
|
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:
|
|
291
|
-
const
|
|
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-${
|
|
296
|
+
"data-testid": `stepper-step-${b}`,
|
|
297
297
|
children: /* @__PURE__ */ A(
|
|
298
298
|
"button",
|
|
299
299
|
{
|
|
300
|
-
"aria-current":
|
|
301
|
-
className:
|
|
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(
|
|
306
|
+
onClick: () => !c && m(b),
|
|
307
307
|
disabled: c,
|
|
308
|
-
"data-testid": `stepper-step-btn-${
|
|
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:
|
|
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:
|
|
314
|
-
className:
|
|
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":
|
|
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:
|
|
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-${
|
|
343
|
+
"data-testid": `stepper-step-check-${b}`
|
|
344
344
|
}
|
|
345
345
|
) : /* @__PURE__ */ u("span", {}) })
|
|
346
346
|
}
|
|
347
347
|
) }) }) }),
|
|
348
|
-
|
|
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":
|
|
356
|
+
"--idx": b
|
|
357
357
|
},
|
|
358
358
|
children: /* @__PURE__ */ u(
|
|
359
359
|
"div",
|
|
360
360
|
{
|
|
361
|
-
className:
|
|
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":
|
|
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
|
-
|
|
374
|
+
b
|
|
375
375
|
)
|
|
376
376
|
},
|
|
377
|
-
|
|
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 =
|
|
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,
|
|
425
|
+
), [f, h] = J(
|
|
426
426
|
null
|
|
427
|
-
), m =
|
|
428
|
-
() => t.filter((
|
|
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
|
-
),
|
|
431
|
-
if (
|
|
432
|
-
const
|
|
433
|
-
n(
|
|
434
|
-
},
|
|
435
|
-
if (
|
|
436
|
-
const
|
|
437
|
-
n(e.filter((
|
|
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
|
-
|
|
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 = (
|
|
447
|
-
const
|
|
448
|
-
return
|
|
449
|
-
},
|
|
450
|
-
if (
|
|
451
|
-
o(T(
|
|
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
|
|
454
|
+
const R = s.includes(V);
|
|
455
455
|
o(
|
|
456
|
-
|
|
457
|
-
), a([]), d(
|
|
458
|
-
},
|
|
459
|
-
if (
|
|
460
|
-
a(T(e, f,
|
|
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
|
|
463
|
+
const R = l.includes(V);
|
|
464
464
|
a(
|
|
465
|
-
|
|
466
|
-
), o([]),
|
|
467
|
-
},
|
|
468
|
-
const
|
|
469
|
-
|
|
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:
|
|
472
|
-
),
|
|
473
|
-
}, U = (
|
|
474
|
-
|
|
475
|
-
const
|
|
476
|
-
if (
|
|
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
|
|
479
|
-
(
|
|
478
|
+
const R = JSON.parse(P), H = (R.items || []).filter(
|
|
479
|
+
(Q) => v.has(Q)
|
|
480
480
|
);
|
|
481
|
-
if (
|
|
482
|
-
|
|
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: (
|
|
495
|
-
onDrop: (
|
|
496
|
-
children:
|
|
497
|
-
const
|
|
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
|
-
|
|
502
|
+
onClick: (R) => {
|
|
503
|
+
N(V, M, R.shiftKey);
|
|
504
504
|
},
|
|
505
|
-
onMouseDown: (
|
|
506
|
-
|
|
505
|
+
onMouseDown: (R) => {
|
|
506
|
+
R.shiftKey && R.preventDefault();
|
|
507
507
|
},
|
|
508
508
|
draggable: !0,
|
|
509
|
-
onDragStart: (
|
|
510
|
-
className: `rounded-md px-3 py-2 text-left text-sm transition ${
|
|
511
|
-
children:
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
554
|
-
isDisabled:
|
|
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:
|
|
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: (
|
|
580
|
-
onDrop: (
|
|
581
|
-
children: e.map((
|
|
582
|
-
const
|
|
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
|
|
587
|
+
onClick: (R) => {
|
|
588
|
+
$(V, M, R.shiftKey);
|
|
589
589
|
},
|
|
590
|
-
onMouseDown: (
|
|
591
|
-
|
|
590
|
+
onMouseDown: (R) => {
|
|
591
|
+
R.shiftKey && R.preventDefault();
|
|
592
592
|
},
|
|
593
593
|
draggable: !0,
|
|
594
|
-
onDragStart: (
|
|
595
|
-
className: `rounded-md px-3 py-2 text-left text-sm transition ${
|
|
596
|
-
children:
|
|
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
|
-
|
|
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
|
|
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
|
|
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 = (
|
|
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:
|
|
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:
|
|
1257
|
-
let
|
|
1258
|
-
if (
|
|
1259
|
-
const
|
|
1260
|
-
|
|
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
|
-
|
|
1263
|
-
const
|
|
1264
|
-
s(
|
|
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
|
-
},
|
|
1267
|
+
}, h = () => {
|
|
1268
1268
|
if (o.trim()) {
|
|
1269
|
-
const { from: m, to: v } = t.state.selection,
|
|
1270
|
-
i.trim() && i !==
|
|
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" &&
|
|
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:
|
|
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 =
|
|
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
|
-
|
|
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((
|
|
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
|
-
(
|
|
1506
|
+
(h || m || v || y || b || k || S || I || C || w) && /* @__PURE__ */ u(ct, {})
|
|
1507
1507
|
] }),
|
|
1508
|
-
|
|
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 ||
|
|
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 ||
|
|
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((
|
|
1537
|
-
const
|
|
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
|
-
|
|
1539
|
+
ut,
|
|
1540
1540
|
{
|
|
1541
|
-
icon:
|
|
1542
|
-
label: `Align ${
|
|
1543
|
-
isActive:
|
|
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:
|
|
1547
|
+
alignment: N
|
|
1548
1548
|
})
|
|
1549
1549
|
},
|
|
1550
|
-
|
|
1550
|
+
N
|
|
1551
1551
|
);
|
|
1552
1552
|
}) }),
|
|
1553
|
-
(
|
|
1553
|
+
(y || b || k || S || I || C || w) && /* @__PURE__ */ u(ct, {})
|
|
1554
1554
|
] }),
|
|
1555
|
-
|
|
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
|
-
(
|
|
1561
|
+
(N) => ["bulletList", "orderedList", "taskList"].includes(N)
|
|
1562
1562
|
)
|
|
1563
1563
|
}
|
|
1564
1564
|
),
|
|
1565
|
-
(
|
|
1565
|
+
(b || k || S || I || C || w) && /* @__PURE__ */ u(ct, {})
|
|
1566
1566
|
] }),
|
|
1567
|
-
(
|
|
1567
|
+
(b || k || S || I) && /* @__PURE__ */ A(Je, { children: [
|
|
1568
1568
|
/* @__PURE__ */ A("div", { className: "flex items-center gap-1", children: [
|
|
1569
|
-
|
|
1570
|
-
|
|
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
|
-
|
|
1580
|
-
|
|
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
|
-
|
|
1589
|
+
S && /* @__PURE__ */ u(
|
|
1590
1590
|
Ea,
|
|
1591
1591
|
{
|
|
1592
1592
|
editor: t,
|
|
1593
1593
|
isDisabled: l.link?.isDisabled
|
|
1594
1594
|
}
|
|
1595
1595
|
),
|
|
1596
|
-
|
|
1597
|
-
|
|
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
|
-
(
|
|
1605
|
+
(C || w) && /* @__PURE__ */ u(ct, {})
|
|
1606
1606
|
] }),
|
|
1607
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1628
|
+
w && /* @__PURE__ */ u(ct, {})
|
|
1629
1629
|
] }),
|
|
1630
|
-
|
|
1630
|
+
w && /* @__PURE__ */ u(
|
|
1631
1631
|
Na,
|
|
1632
1632
|
{
|
|
1633
1633
|
zoom: n,
|
|
1634
|
-
onZoomChange: (
|
|
1635
|
-
r?.(
|
|
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
|
|
3341
|
-
|
|
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
|
|
3346
|
-
if (
|
|
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,
|
|
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
|
|
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),
|
|
3449
|
-
return (n < 0 ? e != a : e != f) && (
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
3731
|
+
return new ft(n.from, n.to, e.markFromJSON(n.mark));
|
|
3732
3732
|
}
|
|
3733
3733
|
}
|
|
3734
|
-
be.jsonID("addMark",
|
|
3735
|
-
class
|
|
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
|
|
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
|
|
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
|
|
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
|
|
3770
|
+
return new ht(n.from, n.to, e.markFromJSON(n.mark));
|
|
3771
3771
|
}
|
|
3772
3772
|
}
|
|
3773
|
-
be.jsonID("removeMark",
|
|
3774
|
-
class
|
|
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
|
|
3796
|
-
return new
|
|
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
|
|
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
|
|
3814
|
+
return new pt(n.pos, e.markFromJSON(n.mark));
|
|
3815
3815
|
}
|
|
3816
3816
|
}
|
|
3817
|
-
be.jsonID("addNodeMark",
|
|
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
|
|
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
|
|
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
|
|
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
|
|
4241
|
+
return Y.between(this.$anchor, this.$head).getBookmark();
|
|
4242
4242
|
}
|
|
4243
4243
|
}
|
|
4244
|
-
|
|
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
|
|
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
|
|
4274
|
+
return X.near(r);
|
|
4275
4275
|
let i = e.resolve(n.map(this.anchor));
|
|
4276
|
-
return new
|
|
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
|
|
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
|
|
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 =
|
|
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
|
|
4323
|
+
return X.near(n, r);
|
|
4324
4324
|
}
|
|
4325
|
-
return e.parent.inlineContent || (i == 0 ? e = n : (e = (
|
|
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
|
-
|
|
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
|
|
4337
|
+
return Y.between(e.resolve(this.anchor), e.resolve(this.head));
|
|
4338
4338
|
}
|
|
4339
4339
|
}
|
|
4340
|
-
class j extends
|
|
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 ?
|
|
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
|
-
|
|
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) :
|
|
4399
|
+
return r && j.isSelectable(r) ? new j(n) : X.near(n);
|
|
4400
4400
|
}
|
|
4401
4401
|
}
|
|
4402
|
-
class Ke extends
|
|
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 =
|
|
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
|
-
|
|
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
|
|
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(
|
|
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 ||
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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((
|
|
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,
|
|
4941
|
+
return this.items.forEach((f, h) => {
|
|
4942
4942
|
if (!f.step) {
|
|
4943
|
-
i || (i = this.remapping(r,
|
|
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]),
|
|
4961
|
-
(m = a && a.merge(
|
|
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((
|
|
4985
|
-
|
|
4984
|
+
this.items.forEach((h) => {
|
|
4985
|
+
h.selection && l--;
|
|
4986
4986
|
}, i);
|
|
4987
4987
|
let a = n;
|
|
4988
|
-
this.items.forEach((
|
|
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 (
|
|
4995
|
-
let
|
|
4996
|
-
|
|
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
|
|
5002
|
-
c.push(new He(s.maps[
|
|
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),
|
|
5029
|
-
(
|
|
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,
|
|
5228
|
-
if (f ||
|
|
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(),
|
|
5232
|
-
f &&
|
|
5233
|
-
let
|
|
5234
|
-
r = { left: v.left, right: v.right, top:
|
|
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),
|
|
5240
|
-
r = { left: f.left -
|
|
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(),
|
|
5249
|
-
c = f.left - a.scrollLeft *
|
|
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
|
|
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++)
|
|
5374
|
-
for (var ge = 1; ge <= 24; 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
|
-
|
|
5377
|
-
for (var tr in
|
|
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 :
|
|
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 =
|
|
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,
|
|
5491
|
-
Pn && +(/Firefox\/(\d+)/.exec(
|
|
5492
|
-
const Sr = !rn && /Chrome\/(\d+)/.exec(
|
|
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
|
|
5507
|
-
c = new j(o ==
|
|
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,
|
|
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)),
|
|
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] =
|
|
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
|
|
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)) ||
|
|
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 &&
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 ?
|
|
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
|
|
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
|
|
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:
|
|
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", (
|
|
5898
|
-
e =
|
|
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", (
|
|
5902
|
-
l =
|
|
5901
|
+
`))), 0, 0), t.someProp("transformPasted", (h) => {
|
|
5902
|
+
l = h(l, t, !0);
|
|
5903
5903
|
}), l;
|
|
5904
|
-
let f = t.someProp("clipboardTextParser", (
|
|
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
|
|
5909
|
-
o = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((
|
|
5910
|
-
let
|
|
5911
|
-
|
|
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
|
|
5922
|
-
for (;
|
|
5923
|
-
|
|
5924
|
-
if (!
|
|
5921
|
+
let h = o.firstChild;
|
|
5922
|
+
for (; h && h.nodeType != 1; )
|
|
5923
|
+
h = h.nextSibling;
|
|
5924
|
+
if (!h)
|
|
5925
5925
|
break;
|
|
5926
|
-
o =
|
|
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(
|
|
5932
|
-
return
|
|
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,
|
|
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;
|
|
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,
|
|
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
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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
|
|
6400
|
-
if (d && j.isSelectable(s.content.firstChild) &&
|
|
6401
|
-
a.setSelection(new j(
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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
|
|
6761
|
+
s != Ce && (s instanceof dt ? r = r.concat(s.members) : r.push(s));
|
|
6762
6762
|
}
|
|
6763
|
-
return
|
|
6763
|
+
return dt.from(r);
|
|
6764
6764
|
}
|
|
6765
6765
|
eq(e) {
|
|
6766
|
-
if (!(e instanceof
|
|
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
|
|
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((
|
|
6810
|
-
let
|
|
6811
|
-
for (let
|
|
6812
|
-
let
|
|
6813
|
-
if (
|
|
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
|
|
6816
|
-
m >=
|
|
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 +=
|
|
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
|
|
6834
|
-
if (
|
|
6835
|
-
let
|
|
6836
|
-
|
|
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,
|
|
6845
|
+
for (let f = 0, h = 0; f < d.children.length; f += 3) {
|
|
6846
6846
|
let m = d.children[f];
|
|
6847
|
-
for (;
|
|
6848
|
-
|
|
6849
|
-
l.splice(
|
|
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
|
|
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) :
|
|
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
|
-
|
|
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) :
|
|
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
|
|
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(
|
|
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:
|
|
7629
|
+
onContentChange: h,
|
|
7630
7630
|
onUpdate: m,
|
|
7631
7631
|
onToolbarAction: v,
|
|
7632
|
-
isReadOnly:
|
|
7633
|
-
isDisabled:
|
|
7634
|
-
includeInlineStyles:
|
|
7635
|
-
...
|
|
7636
|
-
} = t, { zoom:
|
|
7637
|
-
...
|
|
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
|
-
}),
|
|
7642
|
+
}), H = U ? /* @__PURE__ */ u("label", { ...P(), children: U }) : null, Q = B.useCallback(
|
|
7643
7643
|
({ editor: W }) => {
|
|
7644
|
-
const xe = W.getHTML(), fe =
|
|
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 (
|
|
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
|
-
|
|
7656
|
+
S.onChange(Te);
|
|
7657
7657
|
}
|
|
7658
7658
|
},
|
|
7659
|
-
[
|
|
7659
|
+
[h, m, S, k]
|
|
7660
7660
|
);
|
|
7661
|
-
return /* @__PURE__ */ A(
|
|
7662
|
-
|
|
7661
|
+
return /* @__PURE__ */ A(_, { ...M(), children: [
|
|
7662
|
+
V ? H : null,
|
|
7663
7663
|
/* @__PURE__ */ u(
|
|
7664
7664
|
"div",
|
|
7665
7665
|
{
|
|
7666
|
-
|
|
7667
|
-
className:
|
|
7666
|
+
...R(),
|
|
7667
|
+
className: L(R().className, "flex flex-col w-full p-0 gap-0 rich-text-editor"),
|
|
7668
7668
|
style: {
|
|
7669
|
-
maxHeight:
|
|
7670
|
-
overflow:
|
|
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: !
|
|
7675
|
+
editable: !y && !b,
|
|
7676
7676
|
slotBefore: l ? /* @__PURE__ */ u(
|
|
7677
7677
|
ju,
|
|
7678
7678
|
{
|
|
7679
7679
|
modifiers: a,
|
|
7680
|
-
zoom:
|
|
7681
|
-
onZoomChange:
|
|
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: `${
|
|
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:
|
|
7700
|
+
extensions: $,
|
|
7701
7701
|
content: f || d || t.defaultValue || "",
|
|
7702
|
-
onUpdate:
|
|
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(
|
|
7717
|
+
return new Intl.NumberFormat(e, {
|
|
7718
7718
|
style: "currency",
|
|
7719
7719
|
currency: n,
|
|
7720
|
-
|
|
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:
|
|
7750
|
+
isDisabled: h = !1,
|
|
7752
7751
|
buttonVariant: m = "bordered",
|
|
7753
7752
|
buttonColor: v = "default",
|
|
7754
|
-
inputVariant:
|
|
7755
|
-
className:
|
|
7756
|
-
showCard:
|
|
7753
|
+
inputVariant: y = "bordered",
|
|
7754
|
+
className: b = "",
|
|
7755
|
+
showCard: k = !0
|
|
7757
7756
|
}) => {
|
|
7758
|
-
const
|
|
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
|
-
},
|
|
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 = `${
|
|
7765
|
+
}, T = `${C[d]} ${w[f]}`, [N, $] = $r(
|
|
7767
7766
|
e,
|
|
7768
7767
|
n,
|
|
7769
7768
|
r
|
|
7770
|
-
), [
|
|
7771
|
-
(
|
|
7772
|
-
if (
|
|
7773
|
-
const
|
|
7774
|
-
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:
|
|
7775
|
+
presetId: H.id
|
|
7777
7776
|
};
|
|
7778
|
-
|
|
7777
|
+
$(Q), U("");
|
|
7779
7778
|
},
|
|
7780
|
-
[
|
|
7781
|
-
),
|
|
7782
|
-
(
|
|
7783
|
-
if (
|
|
7784
|
-
if (U(
|
|
7785
|
-
|
|
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
|
-
|
|
7789
|
-
amount:
|
|
7787
|
+
$({
|
|
7788
|
+
amount: H,
|
|
7790
7789
|
isCustom: !0
|
|
7791
7790
|
});
|
|
7792
7791
|
},
|
|
7793
|
-
[
|
|
7794
|
-
),
|
|
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
|
-
),
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
const
|
|
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:
|
|
7809
|
-
variant:
|
|
7809
|
+
color: Q ? "primary" : v,
|
|
7810
|
+
variant: Q ? "solid" : m,
|
|
7810
7811
|
className: "w-full",
|
|
7811
|
-
onPress: () =>
|
|
7812
|
-
isDisabled:
|
|
7813
|
-
"data-testid": `donation-amounts-preset-${
|
|
7814
|
-
children:
|
|
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
|
-
|
|
7817
|
+
H.id
|
|
7817
7818
|
);
|
|
7818
7819
|
}) }),
|
|
7819
7820
|
o && /* @__PURE__ */ u(
|
|
7820
7821
|
Ls,
|
|
7821
7822
|
{
|
|
7822
|
-
placeholder:
|
|
7823
|
-
"aria-label":
|
|
7824
|
-
variant:
|
|
7825
|
-
radius: "
|
|
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:
|
|
7830
|
-
value:
|
|
7831
|
-
onValueChange:
|
|
7832
|
-
isDisabled:
|
|
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
|
-
|
|
7836
|
+
N?.isCustom === !1 ? N.presetId : "custom"
|
|
7838
7837
|
)
|
|
7839
7838
|
] });
|
|
7840
|
-
return
|
|
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:
|
|
7888
|
+
className: h,
|
|
7890
7889
|
...m
|
|
7891
7890
|
}, v) => {
|
|
7892
|
-
const [
|
|
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
|
-
),
|
|
7895
|
+
), k = It(null), S = It(!1);
|
|
7897
7896
|
qe(() => () => {
|
|
7898
|
-
|
|
7897
|
+
k.current && clearInterval(k.current);
|
|
7899
7898
|
}, []), qe(() => {
|
|
7900
|
-
if (!d ||
|
|
7901
|
-
|
|
7899
|
+
if (!d || y <= 0) {
|
|
7900
|
+
k.current && (clearInterval(k.current), k.current = null);
|
|
7902
7901
|
return;
|
|
7903
7902
|
}
|
|
7904
|
-
return
|
|
7905
|
-
|
|
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
|
-
|
|
7906
|
+
k.current && (clearInterval(k.current), k.current = null);
|
|
7908
7907
|
};
|
|
7909
|
-
}, [d,
|
|
7910
|
-
|
|
7911
|
-
}, [
|
|
7912
|
-
const
|
|
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(
|
|
7922
|
+
"aria-label": `${o} ${f(y)}`,
|
|
7924
7923
|
"data-testid": "expire-cart-timer",
|
|
7925
|
-
className:
|
|
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
|
-
|
|
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(
|
|
7964
|
+
"aria-label": `Time remaining: ${f(y)}`,
|
|
7966
7965
|
"data-testid": "expire-cart-timer-value",
|
|
7967
|
-
children: f(
|
|
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((
|
|
8219
|
-
const
|
|
8220
|
-
let
|
|
8221
|
-
|
|
8222
|
-
let
|
|
8223
|
-
switch (
|
|
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
|
-
|
|
8224
|
+
C = i.height / 2 + i.top, b.unshift("rotate(90 " + C.toString() + " " + C.toString() + ")");
|
|
8226
8225
|
break;
|
|
8227
8226
|
case 2:
|
|
8228
|
-
|
|
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
|
-
|
|
8230
|
+
C = i.width / 2 + i.left, b.unshift("rotate(-90 " + C.toString() + " " + C.toString() + ")");
|
|
8232
8231
|
break;
|
|
8233
8232
|
}
|
|
8234
|
-
|
|
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
|
|
8240
|
-
md(
|
|
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
|
|
8250
|
-
attributes:
|
|
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
|
|
8495
|
-
o.push(T[
|
|
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,
|
|
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
|
|
8506
|
-
a === "pending" && (a = "aborted"), v(),
|
|
8504
|
+
function y() {
|
|
8505
|
+
a === "pending" && (a = "aborted"), v(), h.forEach((T) => {
|
|
8507
8506
|
T.status === "pending" && (T.status = "aborted");
|
|
8508
|
-
}),
|
|
8507
|
+
}), h = [];
|
|
8509
8508
|
}
|
|
8510
|
-
function
|
|
8511
|
-
|
|
8509
|
+
function b(T, N) {
|
|
8510
|
+
N && (m = []), typeof T == "function" && m.push(T);
|
|
8512
8511
|
}
|
|
8513
|
-
function
|
|
8512
|
+
function k() {
|
|
8514
8513
|
return {
|
|
8515
8514
|
startTime: l,
|
|
8516
8515
|
payload: e,
|
|
8517
8516
|
status: a,
|
|
8518
8517
|
queriesSent: c,
|
|
8519
|
-
queriesPending:
|
|
8520
|
-
subscribe:
|
|
8521
|
-
abort:
|
|
8518
|
+
queriesPending: h.length,
|
|
8519
|
+
subscribe: b,
|
|
8520
|
+
abort: y
|
|
8522
8521
|
};
|
|
8523
8522
|
}
|
|
8524
|
-
function
|
|
8523
|
+
function S() {
|
|
8525
8524
|
a = "failed", m.forEach((T) => {
|
|
8526
8525
|
T(void 0, d);
|
|
8527
8526
|
});
|
|
8528
8527
|
}
|
|
8529
|
-
function
|
|
8530
|
-
|
|
8528
|
+
function I() {
|
|
8529
|
+
h.forEach((T) => {
|
|
8531
8530
|
T.status === "pending" && (T.status = "aborted");
|
|
8532
|
-
}),
|
|
8531
|
+
}), h = [];
|
|
8533
8532
|
}
|
|
8534
|
-
function
|
|
8535
|
-
const
|
|
8536
|
-
switch (
|
|
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 (
|
|
8539
|
+
if (_ || !t.dataAfterTimeout) return;
|
|
8541
8540
|
break;
|
|
8542
8541
|
default:
|
|
8543
8542
|
return;
|
|
8544
8543
|
}
|
|
8545
|
-
if (
|
|
8546
|
-
d =
|
|
8544
|
+
if (N === "abort") {
|
|
8545
|
+
d = $, S();
|
|
8547
8546
|
return;
|
|
8548
8547
|
}
|
|
8549
|
-
if (
|
|
8550
|
-
d =
|
|
8548
|
+
if (_) {
|
|
8549
|
+
d = $, h.length || (o.length ? w() : S());
|
|
8551
8550
|
return;
|
|
8552
8551
|
}
|
|
8553
|
-
if (v(),
|
|
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(
|
|
8557
|
+
U($);
|
|
8559
8558
|
});
|
|
8560
8559
|
}
|
|
8561
|
-
function
|
|
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 (
|
|
8565
|
+
if (h.length) {
|
|
8567
8566
|
f = setTimeout(() => {
|
|
8568
|
-
v(), a === "pending" && (
|
|
8567
|
+
v(), a === "pending" && (I(), S());
|
|
8569
8568
|
}, t.timeout);
|
|
8570
8569
|
return;
|
|
8571
8570
|
}
|
|
8572
|
-
|
|
8571
|
+
S();
|
|
8573
8572
|
return;
|
|
8574
8573
|
}
|
|
8575
|
-
const
|
|
8574
|
+
const N = {
|
|
8576
8575
|
status: "pending",
|
|
8577
8576
|
resource: T,
|
|
8578
|
-
callback: (
|
|
8579
|
-
|
|
8577
|
+
callback: ($, _) => {
|
|
8578
|
+
C(N, $, _);
|
|
8580
8579
|
}
|
|
8581
8580
|
};
|
|
8582
|
-
|
|
8581
|
+
h.push(N), c++, f = setTimeout(w, t.rotate), n(T, e, N.callback);
|
|
8583
8582
|
}
|
|
8584
|
-
return setTimeout(
|
|
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,
|
|
8597
|
-
r(), c && c(f,
|
|
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, (
|
|
8704
|
-
const m =
|
|
8702
|
+
us(f, (h) => {
|
|
8703
|
+
const m = h ? {
|
|
8705
8704
|
prefix: r,
|
|
8706
|
-
icons: { [d]:
|
|
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,
|
|
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
|
|
8865
|
-
if (
|
|
8866
|
-
const
|
|
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
|
|
8871
|
-
|
|
8872
|
-
a.className =
|
|
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
|
|
8876
|
-
const
|
|
8877
|
-
if (
|
|
8878
|
-
switch (
|
|
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 =
|
|
8889
|
+
a.ref = k;
|
|
8891
8890
|
break;
|
|
8892
8891
|
// Merge class names
|
|
8893
8892
|
case "className":
|
|
8894
|
-
a[
|
|
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[
|
|
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
|
|
8903
|
+
typeof k == "string" && Kd(i, k);
|
|
8905
8904
|
break;
|
|
8906
8905
|
// Color: copy to style
|
|
8907
8906
|
case "color":
|
|
8908
|
-
o.color =
|
|
8907
|
+
o.color = k;
|
|
8909
8908
|
break;
|
|
8910
8909
|
// Rotation as string
|
|
8911
8910
|
case "rotate":
|
|
8912
|
-
typeof
|
|
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
|
-
|
|
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[
|
|
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
|
|
8931
|
-
return typeof
|
|
8932
|
-
__html: Yd(kd(c.body,
|
|
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:
|
|
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:
|
|
8936
|
+
width: h + "",
|
|
8938
8937
|
height: m + ""
|
|
8939
8938
|
});
|
|
8940
8939
|
return a.style = {
|
|
8941
8940
|
...o,
|
|
8942
|
-
"--svg": Zd(
|
|
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
|
|
8994
|
-
if (
|
|
8992
|
+
const y = ss(v);
|
|
8993
|
+
if (y)
|
|
8995
8994
|
return {
|
|
8996
8995
|
name: v,
|
|
8997
|
-
data:
|
|
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
|
|
9022
|
+
const y = ss(v);
|
|
9024
9023
|
if (c({
|
|
9025
9024
|
name: v,
|
|
9026
|
-
data:
|
|
9025
|
+
data: y
|
|
9027
9026
|
}))
|
|
9028
|
-
if (
|
|
9029
|
-
const
|
|
9027
|
+
if (y === void 0) {
|
|
9028
|
+
const b = Hd([v], d);
|
|
9030
9029
|
i({
|
|
9031
|
-
callback:
|
|
9030
|
+
callback: b
|
|
9032
9031
|
});
|
|
9033
|
-
} else
|
|
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:
|
|
9039
|
-
return
|
|
9037
|
+
const { name: f, data: h } = o;
|
|
9038
|
+
return h ? nf({
|
|
9040
9039
|
...Zr,
|
|
9041
|
-
...
|
|
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), [
|
|
9071
|
+
const [d, f] = J(!1), [h, m] = J(!1), v = It(null);
|
|
9073
9072
|
return qe(() => {
|
|
9074
|
-
const
|
|
9073
|
+
const y = () => {
|
|
9075
9074
|
if (v.current) {
|
|
9076
|
-
const
|
|
9077
|
-
m(
|
|
9075
|
+
const b = v.current.scrollHeight > v.current.clientHeight;
|
|
9076
|
+
m(b);
|
|
9078
9077
|
}
|
|
9079
9078
|
};
|
|
9080
|
-
return
|
|
9081
|
-
}, [o]), /* @__PURE__ */ A(Ee, { className:
|
|
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:
|
|
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
|
-
(
|
|
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:
|
|
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:
|
|
9179
|
+
showDescription: h = !0,
|
|
9181
9180
|
showPeopleCount: m = !0,
|
|
9182
9181
|
showPrice: v = !0,
|
|
9183
|
-
classNames:
|
|
9184
|
-
"data-testid":
|
|
9185
|
-
selectedColor:
|
|
9182
|
+
classNames: y = {},
|
|
9183
|
+
"data-testid": b,
|
|
9184
|
+
selectedColor: k = "default"
|
|
9186
9185
|
}) => {
|
|
9187
|
-
const
|
|
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,
|
|
9190
|
-
e === void 0 &&
|
|
9191
|
-
},
|
|
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:
|
|
9194
|
+
className: L("mb-4 text-sm text-gray-700 leading-relaxed", y.description),
|
|
9196
9195
|
children: t.description
|
|
9197
9196
|
}
|
|
9198
|
-
),
|
|
9197
|
+
), P = () => {
|
|
9199
9198
|
if (!m || !dn(t.numberOfPeople) || t.numberOfPeople <= 0)
|
|
9200
9199
|
return null;
|
|
9201
|
-
const fe = t.numberOfPeople === 1 ?
|
|
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:
|
|
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 =
|
|
9221
|
+
}, R = () => {
|
|
9222
|
+
const fe = w === 0 || a, ke = $ || a;
|
|
9224
9223
|
return l?.renderQuantitySelector ? l.renderQuantitySelector({
|
|
9225
|
-
quantity:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
},
|
|
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:
|
|
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:
|
|
9270
|
+
children: /* @__PURE__ */ u("span", { className: "font-medium text-sm", children: S.soldOut })
|
|
9272
9271
|
}
|
|
9273
|
-
),
|
|
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:
|
|
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:
|
|
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:
|
|
9287
|
+
/* @__PURE__ */ A("div", { className: L("h-full col-span-2", N ? "opacity-50 pointer-events-none select-none" : ""), children: [
|
|
9289
9288
|
U(),
|
|
9290
|
-
|
|
9289
|
+
V(),
|
|
9291
9290
|
/* @__PURE__ */ A(
|
|
9292
9291
|
"div",
|
|
9293
9292
|
{
|
|
9294
|
-
className:
|
|
9293
|
+
className: L(
|
|
9295
9294
|
"md:col-span-1 xl:col-span-2 lg:col-span-1 mb-2",
|
|
9296
|
-
|
|
9295
|
+
N ? "opacity-50 pointer-events-none select-none" : ""
|
|
9297
9296
|
),
|
|
9298
9297
|
children: [
|
|
9299
|
-
|
|
9300
|
-
|
|
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:
|
|
9306
|
-
] }), xe =
|
|
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:
|
|
9313
|
+
children: Q()
|
|
9315
9314
|
}
|
|
9316
9315
|
);
|
|
9317
|
-
return f ? /* @__PURE__ */ A(Ee, { className:
|
|
9318
|
-
/* @__PURE__ */ u(Le, { className:
|
|
9319
|
-
/* @__PURE__ */ u(pr, { children: xe && /* @__PURE__ */ u(kl, { className:
|
|
9320
|
-
] }) : /* @__PURE__ */ A("div", { className:
|
|
9321
|
-
/* @__PURE__ */ u("div", { className:
|
|
9322
|
-
/* @__PURE__ */ u(pr, { children: xe && /* @__PURE__ */ u("div", { className:
|
|
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:
|
|
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:
|
|
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:
|
|
9352
|
+
className: L("mb-4", i.icon)
|
|
9354
9353
|
}
|
|
9355
9354
|
),
|
|
9356
|
-
/* @__PURE__ */ u("h3", { "data-testid": "offer-card-empty-message", className:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
9530
|
+
showCard: h = !0,
|
|
9532
9531
|
animated: m = !0,
|
|
9533
9532
|
gap: v = 2,
|
|
9534
|
-
classNames:
|
|
9533
|
+
classNames: y = {}
|
|
9535
9534
|
}) => {
|
|
9536
|
-
const [
|
|
9537
|
-
(
|
|
9535
|
+
const [b, k] = J(n), S = e !== void 0 ? e : b, I = ce(
|
|
9536
|
+
($, _) => {
|
|
9538
9537
|
const U = {
|
|
9539
|
-
...
|
|
9540
|
-
[
|
|
9538
|
+
...S,
|
|
9539
|
+
[$]: Math.max(0, _)
|
|
9541
9540
|
};
|
|
9542
|
-
e === void 0 &&
|
|
9541
|
+
e === void 0 && k(U), r?.(U), i?.($, U[$]);
|
|
9543
9542
|
},
|
|
9544
|
-
[
|
|
9545
|
-
),
|
|
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:
|
|
9549
|
-
quantity:
|
|
9550
|
-
onQuantityChange:
|
|
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:
|
|
9559
|
-
classNames:
|
|
9557
|
+
showCard: h,
|
|
9558
|
+
classNames: y.card
|
|
9560
9559
|
},
|
|
9561
|
-
|
|
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:
|
|
9570
|
+
children: /* @__PURE__ */ u(pr, { children: C.map(($) => /* @__PURE__ */ u(
|
|
9572
9571
|
hr.div,
|
|
9573
9572
|
{
|
|
9574
|
-
"data-testid": `offer-card-list-item-${
|
|
9575
|
-
className:
|
|
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:
|
|
9578
|
+
children: N($)
|
|
9580
9579
|
},
|
|
9581
|
-
|
|
9580
|
+
$.id
|
|
9582
9581
|
)) })
|
|
9583
9582
|
}
|
|
9584
|
-
) : /* @__PURE__ */ u("div", { "data-testid": "offer-card-list", className: T, children:
|
|
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",
|
|
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) && !
|
|
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 (
|
|
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 (
|
|
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),
|
|
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
|
|
9716
|
-
return c.current ? c.current(
|
|
9717
|
-
}),
|
|
9718
|
-
const
|
|
9719
|
-
return c.current ? c.current(
|
|
9720
|
-
}, [n._formValues, n._names, r]),
|
|
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
|
|
9721
|
+
const w = Dr(r, n._names, C || n._formValues, !1, a.current);
|
|
9723
9722
|
if (c.current) {
|
|
9724
|
-
const T = c.current(
|
|
9723
|
+
const T = c.current(w);
|
|
9725
9724
|
ze(T, d.current) || (v(T), d.current = T);
|
|
9726
9725
|
} else
|
|
9727
|
-
v(
|
|
9726
|
+
v(w);
|
|
9728
9727
|
}
|
|
9729
9728
|
}, [n._formValues, n._names, s, r]);
|
|
9730
|
-
ii(() => ((f.current !== n || !ze(
|
|
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: (
|
|
9737
|
-
|
|
9735
|
+
callback: (C) => {
|
|
9736
|
+
b(C.values);
|
|
9738
9737
|
}
|
|
9739
|
-
})), [n, o, r,
|
|
9740
|
-
const
|
|
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
|
|
9744
|
-
return
|
|
9745
|
-
}, [s,
|
|
9746
|
-
return
|
|
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
|
-
}),
|
|
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
|
-
|
|
9764
|
-
const
|
|
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]),
|
|
9784
|
+
}), [f, n]), b = B.useCallback((C) => v.current.onChange({
|
|
9786
9785
|
target: {
|
|
9787
|
-
value: Qo(
|
|
9786
|
+
value: Qo(C),
|
|
9788
9787
|
name: n
|
|
9789
9788
|
},
|
|
9790
9789
|
type: Tn.CHANGE
|
|
9791
|
-
}), [n]),
|
|
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]),
|
|
9798
|
-
const
|
|
9799
|
-
|
|
9800
|
-
focus: () => we(
|
|
9801
|
-
select: () => we(
|
|
9802
|
-
setCustomValidity: (T) => we(
|
|
9803
|
-
reportValidity: () => we(
|
|
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]),
|
|
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:
|
|
9810
|
-
onBlur:
|
|
9811
|
-
ref:
|
|
9812
|
-
}), [n, r, f.disabled,
|
|
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
|
|
9815
|
-
|
|
9816
|
-
...
|
|
9817
|
-
...Me(
|
|
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 = (
|
|
9820
|
-
const
|
|
9821
|
-
|
|
9818
|
+
const T = (N, $) => {
|
|
9819
|
+
const _ = D(i._fields, N);
|
|
9820
|
+
_ && _._f && (_._f.mount = $);
|
|
9822
9821
|
};
|
|
9823
|
-
if (T(n, !0),
|
|
9824
|
-
const
|
|
9825
|
-
ee(i._defaultValues, n,
|
|
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 ?
|
|
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:
|
|
9835
|
+
field: I,
|
|
9837
9836
|
formState: f,
|
|
9838
|
-
fieldState:
|
|
9839
|
-
}), [
|
|
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:
|
|
10049
|
-
if (!
|
|
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
|
|
10052
|
-
i &&
|
|
10053
|
-
},
|
|
10054
|
-
const W =
|
|
10055
|
-
|
|
10056
|
-
type:
|
|
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(
|
|
10058
|
+
...U(M ? H : Q, W)
|
|
10060
10059
|
};
|
|
10061
10060
|
};
|
|
10062
|
-
if (s ? !Array.isArray(
|
|
10063
|
-
const { value:
|
|
10064
|
-
if (
|
|
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:
|
|
10067
|
-
ref:
|
|
10068
|
-
...U(We.required,
|
|
10065
|
+
message: P,
|
|
10066
|
+
ref: I,
|
|
10067
|
+
...U(We.required, P)
|
|
10069
10068
|
}, !r))
|
|
10070
|
-
return
|
|
10071
|
-
}
|
|
10072
|
-
if (!
|
|
10073
|
-
let
|
|
10074
|
-
const
|
|
10075
|
-
if (!Ne(
|
|
10076
|
-
const
|
|
10077
|
-
Ne(
|
|
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
|
|
10080
|
-
De(
|
|
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 ((
|
|
10083
|
-
return
|
|
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) && !
|
|
10086
|
-
const
|
|
10087
|
-
if ((
|
|
10088
|
-
return
|
|
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 && !
|
|
10091
|
-
const { value:
|
|
10092
|
-
if (On(
|
|
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:
|
|
10093
|
+
message: P,
|
|
10095
10094
|
ref: o,
|
|
10096
|
-
...U(We.pattern,
|
|
10095
|
+
...U(We.pattern, P)
|
|
10097
10096
|
}, !r))
|
|
10098
|
-
return
|
|
10097
|
+
return C(P), w;
|
|
10099
10098
|
}
|
|
10100
10099
|
if (v) {
|
|
10101
10100
|
if (we(v)) {
|
|
10102
|
-
const
|
|
10103
|
-
if (
|
|
10104
|
-
...
|
|
10105
|
-
...U(We.validate,
|
|
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
|
|
10106
|
+
return C(P.message), w;
|
|
10108
10107
|
} else if (de(v)) {
|
|
10109
|
-
let
|
|
10110
|
-
for (const
|
|
10111
|
-
if (!Se(
|
|
10108
|
+
let M = {};
|
|
10109
|
+
for (const P in v) {
|
|
10110
|
+
if (!Se(M) && !r)
|
|
10112
10111
|
break;
|
|
10113
|
-
const
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
...U(
|
|
10117
|
-
},
|
|
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(
|
|
10120
|
-
ref:
|
|
10121
|
-
...
|
|
10118
|
+
if (!Se(M) && (w[y] = {
|
|
10119
|
+
ref: I,
|
|
10120
|
+
...M
|
|
10122
10121
|
}, !r))
|
|
10123
|
-
return
|
|
10122
|
+
return w;
|
|
10124
10123
|
}
|
|
10125
10124
|
}
|
|
10126
|
-
return
|
|
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
|
|
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,
|
|
10182
|
-
clearTimeout(c), c = setTimeout(
|
|
10183
|
-
},
|
|
10184
|
-
if (!o.keepIsValid && !e.disabled && (f.isValid ||
|
|
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
|
|
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
|
-
},
|
|
10191
|
-
!e.disabled && (f.isValidating || f.validatingFields ||
|
|
10192
|
-
|
|
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
|
-
},
|
|
10198
|
-
if (
|
|
10199
|
-
if (o.action = !0, E && Array.isArray(D(r,
|
|
10200
|
-
const z =
|
|
10201
|
-
|
|
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,
|
|
10204
|
-
const z =
|
|
10205
|
-
|
|
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 ||
|
|
10208
|
-
const z =
|
|
10209
|
-
|
|
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 ||
|
|
10212
|
-
name:
|
|
10213
|
-
isDirty:
|
|
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,
|
|
10220
|
-
},
|
|
10221
|
-
ee(n.errors,
|
|
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
|
-
},
|
|
10225
|
-
n.errors =
|
|
10223
|
+
}, C = (p) => {
|
|
10224
|
+
n.errors = p, m.state.next({
|
|
10226
10225
|
errors: n.errors,
|
|
10227
10226
|
isValid: !1
|
|
10228
10227
|
});
|
|
10229
|
-
},
|
|
10230
|
-
const
|
|
10231
|
-
if (
|
|
10232
|
-
const E = D(s,
|
|
10233
|
-
re(E) ||
|
|
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 = (
|
|
10234
|
+
}, T = (p, g, x, F, O) => {
|
|
10236
10235
|
let E = !1, z = !1;
|
|
10237
10236
|
const G = {
|
|
10238
|
-
name:
|
|
10237
|
+
name: p
|
|
10239
10238
|
};
|
|
10240
10239
|
if (!e.disabled) {
|
|
10241
|
-
if (!
|
|
10242
|
-
(f.isDirty ||
|
|
10243
|
-
const Z = ze(D(i,
|
|
10244
|
-
z = !!D(n.dirtyFields,
|
|
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 (
|
|
10247
|
-
const Z = D(n.touchedFields,
|
|
10248
|
-
Z || (ee(n.touchedFields,
|
|
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 &&
|
|
10249
|
+
E && O && m.state.next(G);
|
|
10251
10250
|
}
|
|
10252
10251
|
return E ? G : {};
|
|
10253
|
-
},
|
|
10254
|
-
const
|
|
10255
|
-
if (e.delayError &&
|
|
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
|
-
...
|
|
10256
|
+
...F,
|
|
10258
10257
|
...E && Me(g) ? { isValid: g } : {},
|
|
10259
10258
|
errors: n.errors,
|
|
10260
|
-
name:
|
|
10259
|
+
name: p
|
|
10261
10260
|
};
|
|
10262
10261
|
n = {
|
|
10263
10262
|
...n,
|
|
10264
10263
|
...z
|
|
10265
10264
|
}, m.state.next(z);
|
|
10266
10265
|
}
|
|
10267
|
-
},
|
|
10268
|
-
const { errors: g } = await
|
|
10269
|
-
if (
|
|
10270
|
-
for (const
|
|
10271
|
-
const
|
|
10272
|
-
|
|
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 (
|
|
10276
|
+
}, U = async (p, g, x = {
|
|
10278
10277
|
valid: !0
|
|
10279
10278
|
}) => {
|
|
10280
|
-
for (const
|
|
10281
|
-
const
|
|
10282
|
-
if (
|
|
10283
|
-
const { _f: E, ...z } =
|
|
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 =
|
|
10286
|
-
Z && f.validatingFields &&
|
|
10287
|
-
const ve = await ws(
|
|
10288
|
-
if (Z && f.validatingFields &&
|
|
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,
|
|
10291
|
+
!Se(z) && await U(z, g, x);
|
|
10293
10292
|
}
|
|
10294
10293
|
}
|
|
10295
|
-
return
|
|
10296
|
-
},
|
|
10297
|
-
for (const
|
|
10298
|
-
const g = D(r,
|
|
10299
|
-
g && (g._f.refs ? g._f.refs.every((
|
|
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
|
-
},
|
|
10303
|
-
...o.mount ? s : re(g) ? i : De(
|
|
10304
|
-
},
|
|
10305
|
-
const
|
|
10306
|
-
let
|
|
10307
|
-
if (
|
|
10308
|
-
const E =
|
|
10309
|
-
E && (!E.disabled && ee(s,
|
|
10310
|
-
(!z.defaultChecked || !z.disabled) && (Array.isArray(
|
|
10311
|
-
}) : E.refs.forEach((z) => z.checked = z.value ===
|
|
10312
|
-
name:
|
|
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
|
-
(
|
|
10317
|
-
},
|
|
10318
|
-
for (const
|
|
10319
|
-
if (!g.hasOwnProperty(
|
|
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
|
|
10322
|
-
(l.array.has(
|
|
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 = (
|
|
10325
|
-
const
|
|
10326
|
-
ee(s,
|
|
10327
|
-
name:
|
|
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 ||
|
|
10330
|
-
name:
|
|
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:
|
|
10333
|
-
})) :
|
|
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:
|
|
10334
|
+
name: p,
|
|
10336
10335
|
values: le(s)
|
|
10337
10336
|
}) : m.state.next({
|
|
10338
|
-
name: o.mount ?
|
|
10337
|
+
name: o.mount ? p : void 0,
|
|
10339
10338
|
values: le(s)
|
|
10340
10339
|
});
|
|
10341
|
-
}, xe = async (
|
|
10340
|
+
}, xe = async (p) => {
|
|
10342
10341
|
o.mount = !0;
|
|
10343
|
-
const g =
|
|
10344
|
-
let
|
|
10345
|
-
const
|
|
10346
|
-
|
|
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 (
|
|
10347
|
+
if (O) {
|
|
10349
10348
|
let Z, ve;
|
|
10350
|
-
const
|
|
10351
|
-
ee(s,
|
|
10352
|
-
const qn = T(
|
|
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:
|
|
10355
|
-
type:
|
|
10353
|
+
name: x,
|
|
10354
|
+
type: p.type,
|
|
10356
10355
|
values: le(s)
|
|
10357
10356
|
}), fl)
|
|
10358
|
-
return (f.isValid ||
|
|
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
|
|
10361
|
-
if (
|
|
10362
|
-
const pl = Ss(n.errors, r,
|
|
10363
|
-
Z = hi.error,
|
|
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
|
-
|
|
10367
|
-
|
|
10368
|
-
}
|
|
10369
|
-
}, fe = (
|
|
10370
|
-
if (D(n.errors, g) &&
|
|
10371
|
-
return
|
|
10372
|
-
}, ke = async (
|
|
10373
|
-
let
|
|
10374
|
-
const
|
|
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
|
|
10377
|
-
|
|
10378
|
-
} else
|
|
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), !(!
|
|
10380
|
+
}))).every(Boolean), !(!F && !n.isValid) && b()) : F = x = await U(r);
|
|
10382
10381
|
return m.state.next({
|
|
10383
|
-
...!De(
|
|
10384
|
-
...e.resolver || !
|
|
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 && !
|
|
10387
|
-
}, Ye = (
|
|
10388
|
-
let
|
|
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 && (
|
|
10392
|
-
}, vt = (
|
|
10393
|
-
invalid: !!D((g || n).errors,
|
|
10394
|
-
isDirty: !!D((g || n).dirtyFields,
|
|
10395
|
-
error: D((g || n).errors,
|
|
10396
|
-
isValidating: !!D(n.validatingFields,
|
|
10397
|
-
isTouched: !!D((g || n).touchedFields,
|
|
10398
|
-
}), Pt = (
|
|
10399
|
-
|
|
10400
|
-
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 = (
|
|
10403
|
-
const
|
|
10404
|
-
ee(n.errors,
|
|
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:
|
|
10406
|
+
ref: F
|
|
10408
10407
|
}), m.state.next({
|
|
10409
|
-
name:
|
|
10408
|
+
name: p,
|
|
10410
10409
|
errors: n.errors,
|
|
10411
10410
|
isValid: !1
|
|
10412
|
-
}),
|
|
10413
|
-
}, Te = (
|
|
10414
|
-
next: (
|
|
10415
|
-
}) :
|
|
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(
|
|
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 = (
|
|
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
|
-
...
|
|
10430
|
+
...p.formState
|
|
10432
10431
|
}
|
|
10433
|
-
})), Bn = (
|
|
10434
|
-
for (const
|
|
10435
|
-
l.mount.delete(
|
|
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:
|
|
10441
|
-
}), !g.keepIsValid &&
|
|
10442
|
-
}, li = ({ disabled:
|
|
10443
|
-
if (Me(
|
|
10444
|
-
const
|
|
10445
|
-
|
|
10446
|
-
}
|
|
10447
|
-
}, _n = (
|
|
10448
|
-
let
|
|
10449
|
-
const
|
|
10450
|
-
return ee(r,
|
|
10451
|
-
...
|
|
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
|
-
...
|
|
10454
|
-
name:
|
|
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(
|
|
10457
|
+
}), l.mount.add(p), x ? li({
|
|
10459
10458
|
disabled: Me(g.disabled) ? g.disabled : e.disabled,
|
|
10460
|
-
name:
|
|
10461
|
-
}) :
|
|
10462
|
-
...
|
|
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:
|
|
10470
|
+
name: p,
|
|
10472
10471
|
onChange: xe,
|
|
10473
10472
|
onBlur: xe,
|
|
10474
|
-
ref: (
|
|
10475
|
-
if (
|
|
10476
|
-
_n(
|
|
10477
|
-
const E = re(
|
|
10478
|
-
if (z ? G.find((Z) => Z === E) : E ===
|
|
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,
|
|
10479
|
+
ee(r, p, {
|
|
10481
10480
|
_f: {
|
|
10482
|
-
...
|
|
10481
|
+
...x._f,
|
|
10483
10482
|
...z ? {
|
|
10484
10483
|
refs: [
|
|
10485
10484
|
...G.filter(ar),
|
|
10486
10485
|
E,
|
|
10487
|
-
...Array.isArray(D(i,
|
|
10486
|
+
...Array.isArray(D(i, p)) ? [{}] : []
|
|
10488
10487
|
],
|
|
10489
|
-
ref: { type: E.type, name:
|
|
10488
|
+
ref: { type: E.type, name: p }
|
|
10490
10489
|
} : { ref: E }
|
|
10491
10490
|
}
|
|
10492
|
-
}),
|
|
10491
|
+
}), w(p, !1, void 0, E);
|
|
10493
10492
|
} else
|
|
10494
|
-
|
|
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 = (
|
|
10498
|
-
Me(
|
|
10499
|
-
const
|
|
10500
|
-
|
|
10501
|
-
|
|
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 = (
|
|
10505
|
-
let
|
|
10506
|
-
|
|
10507
|
-
let
|
|
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
|
|
10512
|
-
|
|
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(
|
|
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
|
|
10522
|
+
await p(O, x);
|
|
10524
10523
|
} catch (E) {
|
|
10525
|
-
|
|
10524
|
+
F = E;
|
|
10526
10525
|
}
|
|
10527
10526
|
} else
|
|
10528
|
-
g && await g({ ...n.errors },
|
|
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) && !
|
|
10531
|
+
isSubmitSuccessful: Se(n.errors) && !F,
|
|
10533
10532
|
submitCount: n.submitCount + 1,
|
|
10534
10533
|
errors: n.errors
|
|
10535
|
-
}),
|
|
10536
|
-
throw
|
|
10537
|
-
}, cl = (
|
|
10538
|
-
D(r,
|
|
10539
|
-
}, ci = (
|
|
10540
|
-
const
|
|
10541
|
-
if (g.keepDefaultValues || (i =
|
|
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),
|
|
10549
|
-
Z && !re(ve) ? ee(E, G, ve) : !Z && !re(
|
|
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(
|
|
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:
|
|
10587
|
+
isDirty: O ? !1 : g.keepDirty ? n.isDirty : !!(g.keepDefaultValues && !ze(p, i)),
|
|
10589
10588
|
isSubmitted: g.keepIsSubmitted ? n.isSubmitted : !1,
|
|
10590
|
-
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 = (
|
|
10598
|
-
const
|
|
10599
|
-
if (
|
|
10600
|
-
const
|
|
10601
|
-
|
|
10602
|
-
|
|
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 = (
|
|
10604
|
+
}, dl = (p) => {
|
|
10606
10605
|
n = {
|
|
10607
10606
|
...n,
|
|
10608
|
-
...
|
|
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:
|
|
10619
|
-
_updateIsValidating:
|
|
10617
|
+
_runSchema: $,
|
|
10618
|
+
_updateIsValidating: k,
|
|
10620
10619
|
_focusError: Hn,
|
|
10621
|
-
_getWatch:
|
|
10622
|
-
_getDirty:
|
|
10623
|
-
_setValid:
|
|
10624
|
-
_setFieldArray:
|
|
10620
|
+
_getWatch: P,
|
|
10621
|
+
_getDirty: M,
|
|
10622
|
+
_setValid: b,
|
|
10623
|
+
_setFieldArray: S,
|
|
10625
10624
|
_setDisabledField: li,
|
|
10626
|
-
_setErrors:
|
|
10627
|
-
_getFieldArray:
|
|
10625
|
+
_setErrors: C,
|
|
10626
|
+
_getFieldArray: R,
|
|
10628
10627
|
_reset: ci,
|
|
10629
|
-
_resetDefaultValues: () => we(e.defaultValues) && e.defaultValues().then((
|
|
10630
|
-
ui(
|
|
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:
|
|
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(
|
|
10648
|
-
o =
|
|
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(
|
|
10657
|
-
l =
|
|
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(
|
|
10664
|
+
set _options(p) {
|
|
10666
10665
|
e = {
|
|
10667
10666
|
...e,
|
|
10668
|
-
...
|
|
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:
|
|
10834
|
+
isDisabled: h = !1,
|
|
10836
10835
|
labels: m,
|
|
10837
10836
|
classNames: v = {},
|
|
10838
|
-
"data-testid":
|
|
10837
|
+
"data-testid": y,
|
|
10839
10838
|
// React Hook Form props
|
|
10840
|
-
control:
|
|
10841
|
-
name:
|
|
10842
|
-
rules:
|
|
10839
|
+
control: b,
|
|
10840
|
+
name: k,
|
|
10841
|
+
rules: S
|
|
10843
10842
|
}) => {
|
|
10844
|
-
const
|
|
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:
|
|
10848
|
-
name:
|
|
10849
|
-
rules:
|
|
10850
|
-
}), [
|
|
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
|
-
),
|
|
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 = { ...
|
|
10855
|
-
|
|
10853
|
+
const Te = { ..._, ...ne };
|
|
10854
|
+
C && T.field.onChange(Te), !C && t === void 0 && $(Te), s?.(Te);
|
|
10856
10855
|
},
|
|
10857
|
-
[
|
|
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
|
-
|
|
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
|
-
|
|
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":
|
|
10895
|
-
className:
|
|
10896
|
-
children: /* @__PURE__ */ A(Le, { className:
|
|
10897
|
-
/* @__PURE__ */ u("div", { className:
|
|
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": `${
|
|
10899
|
+
"data-testid": `${y || "revenue-distribution-card"}-amount-input`,
|
|
10901
10900
|
label: /* @__PURE__ */ A("span", { className: "flex items-center gap-1", children: [
|
|
10902
|
-
|
|
10903
|
-
/* @__PURE__ */ u(Tt, { content:
|
|
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:
|
|
10911
|
+
value: _.amount || void 0,
|
|
10913
10912
|
onValueChange: xe,
|
|
10914
10913
|
labelPlacement: "outside",
|
|
10915
|
-
placeholder:
|
|
10914
|
+
placeholder: I.amountPlaceholder,
|
|
10916
10915
|
isWheelDisabled: !0,
|
|
10917
10916
|
hideStepper: !0,
|
|
10918
10917
|
variant: "bordered",
|
|
10919
|
-
isDisabled:
|
|
10920
|
-
isInvalid:
|
|
10921
|
-
errorMessage:
|
|
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:
|
|
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:
|
|
10927
|
+
/* @__PURE__ */ u("div", { className: L("grow", v.glAccountContainer), children: /* @__PURE__ */ u(
|
|
10929
10928
|
vl,
|
|
10930
10929
|
{
|
|
10931
|
-
"data-testid": `${
|
|
10930
|
+
"data-testid": `${y || "revenue-distribution-card"}-gl-account-input`,
|
|
10932
10931
|
label: /* @__PURE__ */ A("span", { className: "flex items-center gap-1", children: [
|
|
10933
|
-
|
|
10934
|
-
/* @__PURE__ */ u(Tt, { content:
|
|
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:
|
|
10950
|
-
selectedKey:
|
|
10951
|
-
isDisabled:
|
|
10952
|
-
isInvalid:
|
|
10953
|
-
errorMessage:
|
|
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 ?
|
|
10954
|
+
emptyContent: r ? I.searching : I.noGlAccountsFound
|
|
10956
10955
|
},
|
|
10957
|
-
placeholder:
|
|
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:
|
|
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": `${
|
|
10973
|
-
isSelected:
|
|
10971
|
+
"data-testid": `${y || "revenue-distribution-card"}-tax-deductible`,
|
|
10972
|
+
isSelected: _.isTaxDeductible,
|
|
10974
10973
|
onValueChange: vt,
|
|
10975
|
-
isDisabled:
|
|
10974
|
+
isDisabled: h || !f,
|
|
10976
10975
|
className: v.taxDeductibleCheckbox,
|
|
10977
|
-
children:
|
|
10976
|
+
children: I.taxDeductible
|
|
10978
10977
|
}
|
|
10979
10978
|
) }),
|
|
10980
|
-
/* @__PURE__ */ u("div", { className:
|
|
10979
|
+
/* @__PURE__ */ u("div", { className: L("shrink-0 pt-6", v.deleteContainer), children: /* @__PURE__ */ u(
|
|
10981
10980
|
oe,
|
|
10982
10981
|
{
|
|
10983
|
-
"data-testid": `${
|
|
10982
|
+
"data-testid": `${y || "revenue-distribution-card"}-delete-button`,
|
|
10984
10983
|
size: "sm",
|
|
10985
10984
|
color: "danger",
|
|
10986
10985
|
variant: "flat",
|
|
10987
|
-
isDisabled:
|
|
10986
|
+
isDisabled: h || !d,
|
|
10988
10987
|
onPress: Pt,
|
|
10989
10988
|
startContent: /* @__PURE__ */ u(Ie, { icon: "solar:trash-bin-trash-linear", width: 16 }),
|
|
10990
|
-
className:
|
|
10991
|
-
children:
|
|
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:
|
|
11010
|
-
/* @__PURE__ */ u(Ie, { icon: e, width: n, className:
|
|
11011
|
-
/* @__PURE__ */ u("p", { className:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
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
|
|
11102
|
-
|
|
11103
|
-
},
|
|
11104
|
-
|
|
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:
|
|
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:
|
|
11113
|
-
|
|
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:
|
|
11117
|
-
description:
|
|
11118
|
-
value:
|
|
11119
|
-
onValueChange:
|
|
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:
|
|
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:
|
|
11130
|
+
children: d.map((S) => /* @__PURE__ */ u(
|
|
11128
11131
|
qf,
|
|
11129
11132
|
{
|
|
11130
|
-
itemKey:
|
|
11131
|
-
name:
|
|
11132
|
-
type:
|
|
11133
|
-
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:
|
|
11139
|
+
isSelected: f === S.id,
|
|
11137
11140
|
onSelect: b
|
|
11138
11141
|
},
|
|
11139
|
-
|
|
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:
|
|
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:
|
|
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 = (
|
|
11225
|
+
}, a = (y) => {
|
|
11223
11226
|
if (i) return;
|
|
11224
|
-
const
|
|
11225
|
-
isNaN(
|
|
11226
|
-
}, c = (
|
|
11227
|
-
const
|
|
11228
|
-
isNaN(
|
|
11229
|
-
}, d = s <= e, f = s >= n,
|
|
11230
|
-
return /* @__PURE__ */ A("div", { className: "flex items-center gap-
|
|
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:
|
|
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-
|
|
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:
|
|
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:
|
|
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:
|
|
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((
|
|
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:
|
|
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:
|
|
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((
|
|
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:
|
|
11440
|
-
quantity: r(e.id,
|
|
11441
|
-
onChange: (m) => n(e.id,
|
|
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
|
-
|
|
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
|
-
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
|
|
11457
|
+
initialExpanded: e = !1,
|
|
11458
|
+
labels: n,
|
|
11459
|
+
settings: r,
|
|
11460
|
+
ticketSelectionData: i,
|
|
11461
|
+
className: s = "",
|
|
11462
|
+
onSelectionChange: o
|
|
11459
11463
|
}) => {
|
|
11460
|
-
const
|
|
11461
|
-
const
|
|
11462
|
-
let
|
|
11463
|
-
for (const
|
|
11464
|
-
|
|
11465
|
-
for (const
|
|
11466
|
-
const
|
|
11467
|
-
|
|
11468
|
-
id:
|
|
11469
|
-
selectedQuantity:
|
|
11470
|
-
originalPrice:
|
|
11471
|
-
discountedPrice:
|
|
11472
|
-
},
|
|
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
|
|
11476
|
-
}, [
|
|
11477
|
-
const
|
|
11478
|
-
(
|
|
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
|
|
11482
|
-
for (const
|
|
11483
|
-
const
|
|
11484
|
-
if (
|
|
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 = (
|
|
11488
|
-
(
|
|
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
|
-
),
|
|
11491
|
-
if (Object.values(
|
|
11492
|
-
const
|
|
11493
|
-
if (
|
|
11494
|
-
const
|
|
11495
|
-
...
|
|
11496
|
-
[
|
|
11497
|
-
...
|
|
11498
|
-
[
|
|
11499
|
-
id:
|
|
11500
|
-
selectedQuantity:
|
|
11501
|
-
originalPrice:
|
|
11502
|
-
discountedPrice:
|
|
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
|
-
|
|
11507
|
-
const
|
|
11508
|
-
(
|
|
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
|
-
|
|
11512
|
-
},
|
|
11513
|
-
if (
|
|
11514
|
-
const
|
|
11515
|
-
|
|
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
|
|
11518
|
-
for (const
|
|
11519
|
-
|
|
11520
|
-
for (const
|
|
11521
|
-
|
|
11522
|
-
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:
|
|
11525
|
-
discountedPrice:
|
|
11528
|
+
originalPrice: N.originalPrice,
|
|
11529
|
+
discountedPrice: N.price
|
|
11526
11530
|
};
|
|
11527
11531
|
}
|
|
11528
|
-
|
|
11532
|
+
m(w), o?.(w);
|
|
11529
11533
|
}
|
|
11530
11534
|
};
|
|
11531
11535
|
return qe(() => {
|
|
11532
|
-
!
|
|
11533
|
-
}, [
|
|
11536
|
+
!v.current && c && (o?.(h), v.current = !0);
|
|
11537
|
+
}, [c, h, o]), /* @__PURE__ */ A(
|
|
11534
11538
|
"div",
|
|
11535
11539
|
{
|
|
11536
|
-
className:
|
|
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:
|
|
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:
|
|
11545
|
-
checked:
|
|
11546
|
-
onChange:
|
|
11548
|
+
label: a.selectAllButtonLabel,
|
|
11549
|
+
checked: c,
|
|
11550
|
+
onChange: I
|
|
11547
11551
|
}
|
|
11548
11552
|
)
|
|
11549
11553
|
] }),
|
|
11550
|
-
|
|
11554
|
+
l.map((C) => /* @__PURE__ */ u(
|
|
11551
11555
|
Qf,
|
|
11552
11556
|
{
|
|
11553
|
-
title:
|
|
11554
|
-
exhibition:
|
|
11555
|
-
onQuantityChange:
|
|
11557
|
+
title: C.exhibitionName,
|
|
11558
|
+
exhibition: C,
|
|
11559
|
+
onQuantityChange: S,
|
|
11556
11560
|
getTicketQuantity: b,
|
|
11557
|
-
getTotalSelectedTickets:
|
|
11561
|
+
getTotalSelectedTickets: k,
|
|
11558
11562
|
userMaxLimit: t,
|
|
11559
|
-
settings:
|
|
11560
|
-
labels:
|
|
11561
|
-
initialExpanded:
|
|
11563
|
+
settings: r,
|
|
11564
|
+
labels: a,
|
|
11565
|
+
initialExpanded: e
|
|
11562
11566
|
},
|
|
11563
|
-
|
|
11567
|
+
C.id
|
|
11564
11568
|
))
|
|
11565
11569
|
]
|
|
11566
11570
|
}
|