@nice2dev/events 1.1.5 → 1.1.7
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/CHANGELOG.md +52 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +305 -305
- package/package.json +5 -6
package/dist/index.mjs
CHANGED
|
@@ -13,14 +13,14 @@ function mn(s, t, r) {
|
|
|
13
13
|
return [...s];
|
|
14
14
|
if (r < 0 || r >= s.length)
|
|
15
15
|
return [...s];
|
|
16
|
-
const n = [...s], [
|
|
17
|
-
return n.splice(r, 0,
|
|
16
|
+
const n = [...s], [l] = n.splice(t, 1);
|
|
17
|
+
return n.splice(r, 0, l), n;
|
|
18
18
|
}
|
|
19
19
|
function Mn(s) {
|
|
20
|
-
const { items: t, onReorder: r, disabled: n = !1 } = s, [
|
|
20
|
+
const { items: t, onReorder: r, disabled: n = !1 } = s, [l, o] = E(null), [d, m] = E(null), [h, i] = E(!1), u = ve(null), p = G((w) => t.findIndex((k) => k.id === w), [t]), b = G(
|
|
21
21
|
(w, k) => {
|
|
22
22
|
const _ = p(w), $ = p(k);
|
|
23
|
-
_ < 0 || $ < 0 || _ === $ || r == null || r(mn([...t], _, $).map((
|
|
23
|
+
_ < 0 || $ < 0 || _ === $ || r == null || r(mn([...t], _, $).map((c) => c.id));
|
|
24
24
|
},
|
|
25
25
|
[t, p, r]
|
|
26
26
|
), f = G(() => {
|
|
@@ -32,47 +32,47 @@ function Mn(s) {
|
|
|
32
32
|
// native HTML5 drag enabled would fight it on desktop.
|
|
33
33
|
draggable: !1,
|
|
34
34
|
tabIndex: n ? -1 : 0,
|
|
35
|
-
"aria-grabbed":
|
|
35
|
+
"aria-grabbed": l === w,
|
|
36
36
|
onPointerDown: (_) => {
|
|
37
37
|
var y, v;
|
|
38
38
|
if (n || _.button !== 0 && _.pointerType === "mouse")
|
|
39
39
|
return;
|
|
40
40
|
(v = (y = _.currentTarget).setPointerCapture) == null || v.call(y, _.pointerId), o(w), i(!0), u.current = t.map((A) => A.id);
|
|
41
41
|
const $ = () => {
|
|
42
|
-
window.removeEventListener("pointerup", $), window.removeEventListener("pointercancel",
|
|
43
|
-
},
|
|
44
|
-
window.removeEventListener("pointerup", $), window.removeEventListener("pointercancel",
|
|
42
|
+
window.removeEventListener("pointerup", $), window.removeEventListener("pointercancel", c), i(!1), o(null), m(null);
|
|
43
|
+
}, c = () => {
|
|
44
|
+
window.removeEventListener("pointerup", $), window.removeEventListener("pointercancel", c), u.current && (r == null || r(u.current)), f();
|
|
45
45
|
};
|
|
46
|
-
window.addEventListener("pointerup", $), window.addEventListener("pointercancel",
|
|
46
|
+
window.addEventListener("pointerup", $), window.addEventListener("pointercancel", c);
|
|
47
47
|
},
|
|
48
48
|
onPointerEnter: () => {
|
|
49
|
-
n || !
|
|
49
|
+
n || !l || l === w || (m(w), b(l, w));
|
|
50
50
|
},
|
|
51
51
|
onKeyDown: (_) => {
|
|
52
52
|
if (n)
|
|
53
53
|
return;
|
|
54
54
|
if (_.key === " " || _.key === "Enter") {
|
|
55
|
-
_.preventDefault(),
|
|
55
|
+
_.preventDefault(), l === w ? f() : (o(w), u.current = t.map((A) => A.id));
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
if (_.key === "Escape" &&
|
|
58
|
+
if (_.key === "Escape" && l === w) {
|
|
59
59
|
_.preventDefault(), u.current && (r == null || r(u.current)), f();
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
if (
|
|
62
|
+
if (l !== w)
|
|
63
63
|
return;
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
64
|
+
const c = _.key === "ArrowLeft" || _.key === "ArrowUp" ? -1 : _.key === "ArrowRight" || _.key === "ArrowDown" ? 1 : 0;
|
|
65
|
+
if (c === 0)
|
|
66
66
|
return;
|
|
67
67
|
_.preventDefault();
|
|
68
|
-
const y = p(w), v = y +
|
|
68
|
+
const y = p(w), v = y + c;
|
|
69
69
|
v < 0 || v >= t.length || r == null || r(mn([...t], y, v).map((A) => A.id));
|
|
70
70
|
},
|
|
71
71
|
...k ? { "aria-label": k } : {}
|
|
72
72
|
}),
|
|
73
|
-
[
|
|
73
|
+
[l, b, n, f, p, t, r]
|
|
74
74
|
);
|
|
75
|
-
return { activeId:
|
|
75
|
+
return { activeId: l, overId: d, getHandleProps: g, dragging: h };
|
|
76
76
|
}
|
|
77
77
|
const Pt = ({ item: s }) => {
|
|
78
78
|
const [t, r] = E(!1), n = s.thumbnailUrl ?? s.url;
|
|
@@ -90,7 +90,7 @@ const Pt = ({ item: s }) => {
|
|
|
90
90
|
function(t, r) {
|
|
91
91
|
const {
|
|
92
92
|
items: n,
|
|
93
|
-
onUpload:
|
|
93
|
+
onUpload: l,
|
|
94
94
|
onDelete: o,
|
|
95
95
|
onLike: d,
|
|
96
96
|
onItemClick: m,
|
|
@@ -100,9 +100,9 @@ const Pt = ({ item: s }) => {
|
|
|
100
100
|
onReorder: p,
|
|
101
101
|
className: b,
|
|
102
102
|
style: f
|
|
103
|
-
} = t, [g, w] = E(""), k = X(() => At(n), [n]), _ = X(() => u === "all" ? k : k.filter((A) => A.type === u), [k, u]), $ = !!p && u === "all",
|
|
103
|
+
} = t, [g, w] = E(""), k = X(() => At(n), [n]), _ = X(() => u === "all" ? k : k.filter((A) => A.type === u), [k, u]), $ = !!p && u === "all", c = Mn({ items: k, onReorder: p, disabled: !$ }), y = (A) => {
|
|
104
104
|
const I = A[0];
|
|
105
|
-
!I || !
|
|
105
|
+
!I || !l || (l(I, g.trim() || void 0), w(""));
|
|
106
106
|
}, v = h === "list";
|
|
107
107
|
return /* @__PURE__ */ a(
|
|
108
108
|
"div",
|
|
@@ -116,7 +116,7 @@ const Pt = ({ item: s }) => {
|
|
|
116
116
|
_.length,
|
|
117
117
|
")"
|
|
118
118
|
] }) }),
|
|
119
|
-
i &&
|
|
119
|
+
i && l && /* @__PURE__ */ a("div", { className: "nice-event-media__upload", children: [
|
|
120
120
|
/* @__PURE__ */ e(
|
|
121
121
|
qe,
|
|
122
122
|
{
|
|
@@ -136,11 +136,11 @@ const Pt = ({ item: s }) => {
|
|
|
136
136
|
gap: 12,
|
|
137
137
|
align: "stretch",
|
|
138
138
|
children: _.map((A, I) => {
|
|
139
|
-
const D = $ ?
|
|
139
|
+
const D = $ ? c.getHandleProps(A.id, `Move ${A.caption ?? `item ${I + 1}`}`) : null;
|
|
140
140
|
return /* @__PURE__ */ a(
|
|
141
141
|
"div",
|
|
142
142
|
{
|
|
143
|
-
className: `nice-event-media__card${v ? " nice-event-media__card--row" : ""}${
|
|
143
|
+
className: `nice-event-media__card${v ? " nice-event-media__card--row" : ""}${c.activeId === A.id ? " nice-event-media__card--dragging" : ""}`,
|
|
144
144
|
onClick: () => m == null ? void 0 : m(A),
|
|
145
145
|
onPointerEnter: D == null ? void 0 : D.onPointerEnter,
|
|
146
146
|
role: m ? "button" : void 0,
|
|
@@ -212,7 +212,7 @@ const Pt = ({ item: s }) => {
|
|
|
212
212
|
description: t,
|
|
213
213
|
icon: r,
|
|
214
214
|
action: n,
|
|
215
|
-
className:
|
|
215
|
+
className: l
|
|
216
216
|
}) => /* @__PURE__ */ e(
|
|
217
217
|
kt,
|
|
218
218
|
{
|
|
@@ -221,13 +221,13 @@ const Pt = ({ item: s }) => {
|
|
|
221
221
|
description: t,
|
|
222
222
|
icon: r,
|
|
223
223
|
action: n,
|
|
224
|
-
className:
|
|
224
|
+
className: l
|
|
225
225
|
}
|
|
226
226
|
), zi = ee(
|
|
227
227
|
function(t, r) {
|
|
228
228
|
const {
|
|
229
229
|
items: n,
|
|
230
|
-
layout:
|
|
230
|
+
layout: l = "grid",
|
|
231
231
|
onReorder: o,
|
|
232
232
|
onItemAdd: d,
|
|
233
233
|
onItemRemove: m,
|
|
@@ -242,7 +242,7 @@ const Pt = ({ item: s }) => {
|
|
|
242
242
|
size: k = "md",
|
|
243
243
|
className: _,
|
|
244
244
|
style: $
|
|
245
|
-
} = t, [
|
|
245
|
+
} = t, [c, y] = E(0), [v, A] = E(null), [I, D] = E(""), N = g || w, L = !!o && !N, V = Mn({ items: n, onReorder: o, disabled: !L }), B = n.length > 0 ? Math.min(c, n.length - 1) : 0, C = n[B], O = (C == null ? void 0 : C.durationMs) ?? b;
|
|
246
246
|
Oe(() => {
|
|
247
247
|
if (!u || !f || n.length < 2)
|
|
248
248
|
return;
|
|
@@ -324,7 +324,7 @@ const Pt = ({ item: s }) => {
|
|
|
324
324
|
"div",
|
|
325
325
|
{
|
|
326
326
|
ref: r,
|
|
327
|
-
className: `nice-media-collage nice-media-collage--${
|
|
327
|
+
className: `nice-media-collage nice-media-collage--${l} nice-media-collage--${k} ${_ ?? ""}`,
|
|
328
328
|
style: $,
|
|
329
329
|
children: [
|
|
330
330
|
/* @__PURE__ */ a("div", { className: "nice-media-collage__toolbar", children: [
|
|
@@ -332,7 +332,7 @@ const Pt = ({ item: s }) => {
|
|
|
332
332
|
Tn,
|
|
333
333
|
{
|
|
334
334
|
size: "sm",
|
|
335
|
-
value:
|
|
335
|
+
value: l,
|
|
336
336
|
readOnly: !0,
|
|
337
337
|
options: [
|
|
338
338
|
{ value: "sequence", label: "Sequence" },
|
|
@@ -482,10 +482,10 @@ const Tt = {
|
|
|
482
482
|
]
|
|
483
483
|
}, $i = ee(
|
|
484
484
|
function(t, r) {
|
|
485
|
-
var an, sn, rn,
|
|
485
|
+
var an, sn, rn, cn, ln, on;
|
|
486
486
|
const {
|
|
487
487
|
event: n,
|
|
488
|
-
participants:
|
|
488
|
+
participants: l = [],
|
|
489
489
|
surveys: o = [],
|
|
490
490
|
billing: d = [],
|
|
491
491
|
scheduleItems: m = [],
|
|
@@ -500,7 +500,7 @@ const Tt = {
|
|
|
500
500
|
tabsCentered: k = "auto",
|
|
501
501
|
countLocation: _ = "bottom",
|
|
502
502
|
showDetails: $ = !0,
|
|
503
|
-
showLocation:
|
|
503
|
+
showLocation: c = !0,
|
|
504
504
|
showSchedule: y = !0,
|
|
505
505
|
showParticipants: v = !0,
|
|
506
506
|
showTasks: A = !0,
|
|
@@ -521,9 +521,9 @@ const Tt = {
|
|
|
521
521
|
onAddBilling: Y,
|
|
522
522
|
className: q,
|
|
523
523
|
style: Q
|
|
524
|
-
} = t, [R, ne] = E(n.title), [H, _e] = E(n.description ?? ""), [
|
|
524
|
+
} = t, [R, ne] = E(n.title), [H, _e] = E(n.description ?? ""), [ce, me] = E(n.startDate ?? ""), [Ne, Me] = E(n.endDate ?? ""), [be, he] = E(((an = n.location) == null ? void 0 : an.name) ?? ""), [we, Ve] = E(((sn = n.location) == null ? void 0 : sn.address) ?? ""), [pe, oe] = E(((rn = n.location) == null ? void 0 : rn.virtualUrl) ?? ""), [re, Ie] = E(((cn = n.location) == null ? void 0 : cn.isVirtual) ?? !1), [ge, Ce] = E(""), [fe, Fe] = E("single"), [Se, ze] = E(""), [de, $e] = E(""), [xe, T] = E(""), [U, K] = E("PLN"), Z = {
|
|
525
525
|
details: $,
|
|
526
|
-
location:
|
|
526
|
+
location: c,
|
|
527
527
|
schedule: y,
|
|
528
528
|
participants: v,
|
|
529
529
|
tasks: A,
|
|
@@ -534,18 +534,18 @@ const Tt = {
|
|
|
534
534
|
settings: V
|
|
535
535
|
}, ue = (b ?? Tt[p]).filter((x) => Z[x] !== !1), [De, On] = E(ue[0] ?? "details"), Rn = f ?? De, Un = G(
|
|
536
536
|
(x) => {
|
|
537
|
-
const
|
|
538
|
-
f === void 0 && On(
|
|
537
|
+
const le = x;
|
|
538
|
+
f === void 0 && On(le), g == null || g(le);
|
|
539
539
|
},
|
|
540
540
|
[f, g]
|
|
541
541
|
), Yn = G(() => {
|
|
542
542
|
M == null || M({
|
|
543
543
|
title: R,
|
|
544
544
|
description: H || void 0,
|
|
545
|
-
startDate:
|
|
545
|
+
startDate: ce || void 0,
|
|
546
546
|
endDate: Ne || void 0
|
|
547
547
|
});
|
|
548
|
-
}, [R, H,
|
|
548
|
+
}, [R, H, ce, Ne, M]), Xn = G(() => {
|
|
549
549
|
j == null || j({
|
|
550
550
|
name: be,
|
|
551
551
|
address: we || void 0,
|
|
@@ -555,7 +555,7 @@ const Tt = {
|
|
|
555
555
|
}, [be, we, pe, re, j]), Vn = G(() => {
|
|
556
556
|
if (!ge.trim() || !W)
|
|
557
557
|
return;
|
|
558
|
-
const x = Se.split(",").map((
|
|
558
|
+
const x = Se.split(",").map((le) => le.trim()).filter(Boolean);
|
|
559
559
|
W(ge.trim(), fe, x.length > 0 ? x : void 0), Ce(""), ze("");
|
|
560
560
|
}, [ge, fe, Se, W]), Fn = G(() => {
|
|
561
561
|
!de.trim() || !Y || (Y({
|
|
@@ -569,7 +569,7 @@ const Tt = {
|
|
|
569
569
|
amount: x.amount
|
|
570
570
|
})),
|
|
571
571
|
[d]
|
|
572
|
-
), qn = X(() => d.reduce((x,
|
|
572
|
+
), qn = X(() => d.reduce((x, le) => x + le.amount, 0), [d]), jn = ((ln = d[0]) == null ? void 0 : ln.currency) ?? "PLN", Gn = /* @__PURE__ */ a("div", { className: "nice-event-planning__form", children: [
|
|
573
573
|
/* @__PURE__ */ e(
|
|
574
574
|
J,
|
|
575
575
|
{
|
|
@@ -597,7 +597,7 @@ const Tt = {
|
|
|
597
597
|
{
|
|
598
598
|
className: "nice-input",
|
|
599
599
|
type: "datetime-local",
|
|
600
|
-
value:
|
|
600
|
+
value: ce,
|
|
601
601
|
onChange: (x) => me(x.target.value),
|
|
602
602
|
readOnly: !B
|
|
603
603
|
}
|
|
@@ -671,9 +671,9 @@ const Tt = {
|
|
|
671
671
|
children: "Save location"
|
|
672
672
|
}
|
|
673
673
|
)
|
|
674
|
-
] }), Hn = /* @__PURE__ */ e("div", { className: "nice-event-planning__participants", children:
|
|
675
|
-
/* @__PURE__ */ e(un, { max: 8, children:
|
|
676
|
-
/* @__PURE__ */ e("ul", { className: "nice-event-planning__participant-list", children:
|
|
674
|
+
] }), Hn = /* @__PURE__ */ e("div", { className: "nice-event-planning__participants", children: l.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No participants yet." }) : /* @__PURE__ */ a(Ke, { children: [
|
|
675
|
+
/* @__PURE__ */ e(un, { max: 8, children: l.map((x) => /* @__PURE__ */ e(Be, { name: x.name, src: x.avatarUrl }, x.id)) }),
|
|
676
|
+
/* @__PURE__ */ e("ul", { className: "nice-event-planning__participant-list", children: l.map((x) => /* @__PURE__ */ a("li", { className: "nice-event-planning__participant", children: [
|
|
677
677
|
/* @__PURE__ */ e(Be, { name: x.name, src: x.avatarUrl, size: "sm" }),
|
|
678
678
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__participant-name", children: x.name }),
|
|
679
679
|
/* @__PURE__ */ e(te, { size: "xs", subtle: !0, variant: Ee(x.status), children: x.status })
|
|
@@ -683,13 +683,13 @@ const Tt = {
|
|
|
683
683
|
/* @__PURE__ */ e("strong", { children: x.question }),
|
|
684
684
|
" ",
|
|
685
685
|
/* @__PURE__ */ e(te, { size: "xs", outline: !0, variant: "info", children: x.type }),
|
|
686
|
-
x.options && /* @__PURE__ */ e("div", { className: "nice-event-planning__survey-options", children: x.options.map((
|
|
686
|
+
x.options && /* @__PURE__ */ e("div", { className: "nice-event-planning__survey-options", children: x.options.map((le, ot) => /* @__PURE__ */ e(
|
|
687
687
|
F,
|
|
688
688
|
{
|
|
689
689
|
size: "sm",
|
|
690
690
|
variant: "outline",
|
|
691
|
-
onClick: () => S == null ? void 0 : S(x.id,
|
|
692
|
-
children:
|
|
691
|
+
onClick: () => S == null ? void 0 : S(x.id, le),
|
|
692
|
+
children: le
|
|
693
693
|
},
|
|
694
694
|
ot
|
|
695
695
|
)) }),
|
|
@@ -861,19 +861,19 @@ const Tt = {
|
|
|
861
861
|
settings: "settings"
|
|
862
862
|
}, rt = {
|
|
863
863
|
schedule: m.length || void 0,
|
|
864
|
-
participants:
|
|
864
|
+
participants: l.length || void 0,
|
|
865
865
|
tasks: h.length || void 0,
|
|
866
866
|
surveys: o.length || void 0,
|
|
867
867
|
vendors: i.length || void 0,
|
|
868
868
|
budget: d.length || void 0,
|
|
869
869
|
documents: u.length || void 0
|
|
870
|
-
},
|
|
870
|
+
}, ct = ue.map((x) => ({
|
|
871
871
|
id: x,
|
|
872
872
|
label: x.charAt(0).toUpperCase() + x.slice(1),
|
|
873
873
|
icon: /* @__PURE__ */ e(ie, { name: st[x], size: "sm" }),
|
|
874
874
|
badge: rt[x],
|
|
875
875
|
content: at[x]
|
|
876
|
-
})),
|
|
876
|
+
})), lt = /* @__PURE__ */ a("div", { className: "nice-event-planning__toolbar", children: [
|
|
877
877
|
/* @__PURE__ */ a("div", { className: "nice-event-planning__toolbar-title", children: [
|
|
878
878
|
/* @__PURE__ */ e(ie, { name: "calendar", size: "md" }),
|
|
879
879
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__title", children: n.title }),
|
|
@@ -939,7 +939,7 @@ const Tt = {
|
|
|
939
939
|
] })
|
|
940
940
|
] }),
|
|
941
941
|
/* @__PURE__ */ e(te, { size: "sm", variant: Ee(n.status), children: n.status }),
|
|
942
|
-
|
|
942
|
+
l.length > 0 && /* @__PURE__ */ e(un, { max: 4, size: "sm", children: l.map((x) => /* @__PURE__ */ e(Be, { name: x.name, src: x.avatarUrl, size: "sm" }, x.id)) })
|
|
943
943
|
] })
|
|
944
944
|
}
|
|
945
945
|
) : /* @__PURE__ */ a(
|
|
@@ -949,11 +949,11 @@ const Tt = {
|
|
|
949
949
|
className: `nice-event-planning nice-event-planning--${p} ${q ?? ""}`,
|
|
950
950
|
style: Q,
|
|
951
951
|
children: [
|
|
952
|
-
|
|
952
|
+
lt,
|
|
953
953
|
/* @__PURE__ */ e(
|
|
954
954
|
Ct,
|
|
955
955
|
{
|
|
956
|
-
tabs:
|
|
956
|
+
tabs: ct,
|
|
957
957
|
activeTab: Rn,
|
|
958
958
|
onChange: Un,
|
|
959
959
|
iconOnly: w,
|
|
@@ -985,7 +985,7 @@ const je = ({
|
|
|
985
985
|
showRole: t = !0,
|
|
986
986
|
showStatus: r = !0,
|
|
987
987
|
meta: n,
|
|
988
|
-
children:
|
|
988
|
+
children: l,
|
|
989
989
|
size: o = "md",
|
|
990
990
|
className: d
|
|
991
991
|
}) => /* @__PURE__ */ a("li", { className: `nice-participant-row nice-participant-row--${o} ${d ?? ""}`, children: [
|
|
@@ -994,14 +994,14 @@ const je = ({
|
|
|
994
994
|
t && s.role && /* @__PURE__ */ e(te, { size: "xs", outline: !0, variant: "info", children: s.role }),
|
|
995
995
|
r && s.status && /* @__PURE__ */ e(te, { size: "xs", subtle: !0, variant: Mt(s.status), children: s.status }),
|
|
996
996
|
n && /* @__PURE__ */ e("span", { className: "nice-participant-row__meta", children: n }),
|
|
997
|
-
|
|
997
|
+
l && /* @__PURE__ */ e("span", { className: "nice-participant-row__trailing", children: l })
|
|
998
998
|
] }), Dt = /^[^\s@,;]+@[^\s@,;]+\.[^\s@,;]{2,}$/, hn = /^.*<\s*([^<>\s]+)\s*>$/;
|
|
999
999
|
function Dn(s) {
|
|
1000
1000
|
var o, d;
|
|
1001
1001
|
const t = [], r = [], n = /* @__PURE__ */ new Set();
|
|
1002
|
-
let
|
|
1002
|
+
let l = 0;
|
|
1003
1003
|
if (!s)
|
|
1004
|
-
return { valid: t, invalid: r, duplicates:
|
|
1004
|
+
return { valid: t, invalid: r, duplicates: l };
|
|
1005
1005
|
for (const m of s.split(/[,;\r\n\t]+/)) {
|
|
1006
1006
|
const h = m.trim();
|
|
1007
1007
|
if (!h)
|
|
@@ -1016,24 +1016,24 @@ function Dn(s) {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
const b = p.toLowerCase();
|
|
1018
1018
|
if (n.has(b)) {
|
|
1019
|
-
|
|
1019
|
+
l += 1;
|
|
1020
1020
|
continue;
|
|
1021
1021
|
}
|
|
1022
1022
|
n.add(b), t.push(p);
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
|
-
return { valid: t, invalid: r, duplicates:
|
|
1025
|
+
return { valid: t, invalid: r, duplicates: l };
|
|
1026
1026
|
}
|
|
1027
1027
|
function Et(s, t) {
|
|
1028
|
-
const r = new Set(s.map((
|
|
1029
|
-
for (const
|
|
1030
|
-
const o =
|
|
1031
|
-
r.has(o) || (r.add(o), n.push(
|
|
1028
|
+
const r = new Set(s.map((l) => l.toLowerCase())), n = [...s];
|
|
1029
|
+
for (const l of t) {
|
|
1030
|
+
const o = l.toLowerCase();
|
|
1031
|
+
r.has(o) || (r.add(o), n.push(l));
|
|
1032
1032
|
}
|
|
1033
1033
|
return n;
|
|
1034
1034
|
}
|
|
1035
1035
|
function En(s = {}) {
|
|
1036
|
-
const { currentUserId: t, currentUserName: r, requireIdentity: n = !0 } = s, [
|
|
1036
|
+
const { currentUserId: t, currentUserName: r, requireIdentity: n = !0 } = s, [l, o] = E(""), d = !t, m = r ?? l, h = !n || m.trim().length > 0;
|
|
1037
1037
|
return {
|
|
1038
1038
|
isAnonymous: d,
|
|
1039
1039
|
name: m,
|
|
@@ -1050,7 +1050,7 @@ const Lt = [
|
|
|
1050
1050
|
function(t, r) {
|
|
1051
1051
|
const {
|
|
1052
1052
|
value: n,
|
|
1053
|
-
onRespond:
|
|
1053
|
+
onRespond: l,
|
|
1054
1054
|
allowPlusOnes: o = !1,
|
|
1055
1055
|
maxPlusOnes: d = 5,
|
|
1056
1056
|
plusOnes: m = 0,
|
|
@@ -1063,8 +1063,8 @@ const Lt = [
|
|
|
1063
1063
|
size: g = "md",
|
|
1064
1064
|
className: w,
|
|
1065
1065
|
style: k
|
|
1066
|
-
} = t, _ = En({ currentUserId: i, currentUserName: u }), [$,
|
|
1067
|
-
I || !
|
|
1066
|
+
} = t, _ = En({ currentUserId: i, currentUserName: u }), [$, c] = E(m), [y, v] = E(""), A = !p && _.isAnonymous && !_.canAct, I = b || f, D = (N) => {
|
|
1067
|
+
I || !l || l({
|
|
1068
1068
|
answer: N,
|
|
1069
1069
|
plusOnes: o && N !== "no" ? $ : void 0,
|
|
1070
1070
|
note: h && y.trim() ? y.trim() : void 0,
|
|
@@ -1110,7 +1110,7 @@ const Lt = [
|
|
|
1110
1110
|
Je,
|
|
1111
1111
|
{
|
|
1112
1112
|
value: $,
|
|
1113
|
-
onChange: (N) =>
|
|
1113
|
+
onChange: (N) => c(Math.max(0, Math.min(d, N ?? 0))),
|
|
1114
1114
|
min: 0,
|
|
1115
1115
|
max: d,
|
|
1116
1116
|
step: 1,
|
|
@@ -1153,7 +1153,7 @@ const Lt = [
|
|
|
1153
1153
|
function(t, r) {
|
|
1154
1154
|
const {
|
|
1155
1155
|
participants: n,
|
|
1156
|
-
mode:
|
|
1156
|
+
mode: l = "organizer",
|
|
1157
1157
|
currentUserId: o,
|
|
1158
1158
|
currentUserName: d,
|
|
1159
1159
|
onRsvpChange: m,
|
|
@@ -1168,10 +1168,10 @@ const Lt = [
|
|
|
1168
1168
|
allowPlusOnes: k = !1,
|
|
1169
1169
|
disabled: _ = !1,
|
|
1170
1170
|
readOnly: $ = !1,
|
|
1171
|
-
size:
|
|
1171
|
+
size: c = "md",
|
|
1172
1172
|
className: y,
|
|
1173
1173
|
style: v
|
|
1174
|
-
} = t, [A, I] = E(""), [D, N] = E("all"), [L, V] = E(""), B = _ || $, C =
|
|
1174
|
+
} = t, [A, I] = E(""), [D, N] = E("all"), [L, V] = E(""), B = _ || $, C = l === "guest", O = X(() => {
|
|
1175
1175
|
const S = { total: n.length };
|
|
1176
1176
|
for (const Y of Le)
|
|
1177
1177
|
S[Y] = 0;
|
|
@@ -1206,7 +1206,7 @@ const Lt = [
|
|
|
1206
1206
|
className: `nice-participant-list nice-participant-list--guest ${y ?? ""}`,
|
|
1207
1207
|
style: v,
|
|
1208
1208
|
children: [
|
|
1209
|
-
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: /* @__PURE__ */ e(je, { participant: S, size:
|
|
1209
|
+
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: /* @__PURE__ */ e(je, { participant: S, size: c }) }),
|
|
1210
1210
|
/* @__PURE__ */ e(
|
|
1211
1211
|
pn,
|
|
1212
1212
|
{
|
|
@@ -1217,7 +1217,7 @@ const Lt = [
|
|
|
1217
1217
|
currentUserName: d ?? S.name,
|
|
1218
1218
|
disabled: _,
|
|
1219
1219
|
readOnly: $,
|
|
1220
|
-
size:
|
|
1220
|
+
size: c
|
|
1221
1221
|
}
|
|
1222
1222
|
)
|
|
1223
1223
|
]
|
|
@@ -1262,7 +1262,7 @@ const Lt = [
|
|
|
1262
1262
|
onChange: I,
|
|
1263
1263
|
placeholder: "Search guests…",
|
|
1264
1264
|
prefix: /* @__PURE__ */ e(mt, { size: 15 }),
|
|
1265
|
-
size:
|
|
1265
|
+
size: c
|
|
1266
1266
|
}
|
|
1267
1267
|
),
|
|
1268
1268
|
/* @__PURE__ */ e(
|
|
@@ -1270,7 +1270,7 @@ const Lt = [
|
|
|
1270
1270
|
{
|
|
1271
1271
|
value: D,
|
|
1272
1272
|
onChange: (S) => N(S),
|
|
1273
|
-
size:
|
|
1273
|
+
size: c,
|
|
1274
1274
|
options: [
|
|
1275
1275
|
{ value: "all", label: "All statuses" },
|
|
1276
1276
|
...Le.map((S) => ({ value: S, label: S }))
|
|
@@ -1304,7 +1304,7 @@ const Lt = [
|
|
|
1304
1304
|
je,
|
|
1305
1305
|
{
|
|
1306
1306
|
participant: Y,
|
|
1307
|
-
size:
|
|
1307
|
+
size: c,
|
|
1308
1308
|
meta: b == null ? void 0 : b.map((q) => /* @__PURE__ */ e("span", { className: "nice-participant-list__extra", children: q.render ? q.render(Y) : String(
|
|
1309
1309
|
Y[q.key] ?? ""
|
|
1310
1310
|
) }, q.key)),
|
|
@@ -1347,14 +1347,14 @@ const Lt = [
|
|
|
1347
1347
|
placeholder: "Paste addresses — commas, semicolons or new lines",
|
|
1348
1348
|
rows: 3,
|
|
1349
1349
|
disabled: _,
|
|
1350
|
-
size:
|
|
1350
|
+
size: c
|
|
1351
1351
|
}
|
|
1352
1352
|
),
|
|
1353
1353
|
/* @__PURE__ */ a(
|
|
1354
1354
|
F,
|
|
1355
1355
|
{
|
|
1356
1356
|
variant: "primary",
|
|
1357
|
-
size:
|
|
1357
|
+
size: c,
|
|
1358
1358
|
leftIcon: /* @__PURE__ */ e(In, { size: 15 }),
|
|
1359
1359
|
disabled: _ || M.valid.length === 0,
|
|
1360
1360
|
onClick: W,
|
|
@@ -1410,16 +1410,16 @@ function Ye(s, t) {
|
|
|
1410
1410
|
return r === 0 ? s : s / 10 ** r;
|
|
1411
1411
|
}
|
|
1412
1412
|
function Rt(s, t, r) {
|
|
1413
|
-
const n = en(t),
|
|
1413
|
+
const n = en(t), l = Ye(s, t);
|
|
1414
1414
|
try {
|
|
1415
1415
|
return new Intl.NumberFormat(r, {
|
|
1416
1416
|
style: "currency",
|
|
1417
1417
|
currency: t.toUpperCase(),
|
|
1418
1418
|
minimumFractionDigits: n,
|
|
1419
1419
|
maximumFractionDigits: n
|
|
1420
|
-
}).format(
|
|
1420
|
+
}).format(l);
|
|
1421
1421
|
} catch {
|
|
1422
|
-
return `${
|
|
1422
|
+
return `${l.toFixed(n)} ${t}`;
|
|
1423
1423
|
}
|
|
1424
1424
|
}
|
|
1425
1425
|
function se(s, t, r) {
|
|
@@ -1429,10 +1429,10 @@ const Ge = { minX: 0, minY: 0, maxX: 0, maxY: 0 };
|
|
|
1429
1429
|
function Ut(s, t = 0) {
|
|
1430
1430
|
if (s.length === 0)
|
|
1431
1431
|
return { ...Ge };
|
|
1432
|
-
let r = 1 / 0, n = 1 / 0,
|
|
1432
|
+
let r = 1 / 0, n = 1 / 0, l = -1 / 0, o = -1 / 0;
|
|
1433
1433
|
for (const d of s)
|
|
1434
|
-
d.x < r && (r = d.x), d.y < n && (n = d.y), d.x >
|
|
1435
|
-
return { minX: r - t, minY: n - t, maxX:
|
|
1434
|
+
d.x < r && (r = d.x), d.y < n && (n = d.y), d.x > l && (l = d.x), d.y > o && (o = d.y);
|
|
1435
|
+
return { minX: r - t, minY: n - t, maxX: l + t, maxY: o + t };
|
|
1436
1436
|
}
|
|
1437
1437
|
function fn(s, t) {
|
|
1438
1438
|
return {
|
|
@@ -1446,16 +1446,16 @@ function vn(s, t) {
|
|
|
1446
1446
|
return s.minX <= t.maxX && s.maxX >= t.minX && s.minY <= t.maxY && s.maxY >= t.minY;
|
|
1447
1447
|
}
|
|
1448
1448
|
function Yt(s, t, r = 0) {
|
|
1449
|
-
const n = s.zoom || 1,
|
|
1449
|
+
const n = s.zoom || 1, l = -s.pan.x / n - r, o = -s.pan.y / n - r;
|
|
1450
1450
|
return {
|
|
1451
|
-
minX:
|
|
1451
|
+
minX: l,
|
|
1452
1452
|
minY: o,
|
|
1453
|
-
maxX:
|
|
1453
|
+
maxX: l + t.width / n + r * 2,
|
|
1454
1454
|
maxY: o + t.height / n + r * 2
|
|
1455
1455
|
};
|
|
1456
1456
|
}
|
|
1457
1457
|
function Xt(s, t = 12) {
|
|
1458
|
-
const r = [], n = [],
|
|
1458
|
+
const r = [], n = [], l = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
1459
1459
|
let d = null, m = 0;
|
|
1460
1460
|
for (const h of s.sections ?? []) {
|
|
1461
1461
|
let i = null, u = 0;
|
|
@@ -1465,7 +1465,7 @@ function Xt(s, t = 12) {
|
|
|
1465
1465
|
return;
|
|
1466
1466
|
const w = Ut(g, t);
|
|
1467
1467
|
n.push({ sectionId: h.id, rowIndex: f, label: b.label, seats: g, bounds: w }), g.forEach((k, _) => {
|
|
1468
|
-
|
|
1468
|
+
l.set(k.id, k), o.set(k.id, { sectionId: h.id, rowIndex: f, seatIndex: _ });
|
|
1469
1469
|
}), u += g.length, i = i ? fn(i, w) : w;
|
|
1470
1470
|
});
|
|
1471
1471
|
const p = i ?? { ...Ge };
|
|
@@ -1476,7 +1476,7 @@ function Xt(s, t = 12) {
|
|
|
1476
1476
|
rows: n,
|
|
1477
1477
|
bounds: d ?? { ...Ge },
|
|
1478
1478
|
totalSeats: m,
|
|
1479
|
-
seatById:
|
|
1479
|
+
seatById: l,
|
|
1480
1480
|
locationById: o
|
|
1481
1481
|
};
|
|
1482
1482
|
}
|
|
@@ -1487,7 +1487,7 @@ function Ft(s, t) {
|
|
|
1487
1487
|
return s > t * 4 ? "section" : s > t ? "row" : "seat";
|
|
1488
1488
|
}
|
|
1489
1489
|
function Wt(s, t, r = 2500, n) {
|
|
1490
|
-
const
|
|
1490
|
+
const l = s.sections.filter((u) => vn(u.bounds, t)), o = new Set(l.map((u) => u.section.id)), d = s.rows.filter(
|
|
1491
1491
|
(u) => o.has(u.sectionId) && vn(u.bounds, t)
|
|
1492
1492
|
);
|
|
1493
1493
|
let m = 0;
|
|
@@ -1502,7 +1502,7 @@ function Wt(s, t, r = 2500, n) {
|
|
|
1502
1502
|
for (const p of u.seats)
|
|
1503
1503
|
p.x >= t.minX && p.x <= t.maxX && p.y >= t.minY && p.y <= t.maxY && i.push(p);
|
|
1504
1504
|
}
|
|
1505
|
-
return { tier: h, sections:
|
|
1505
|
+
return { tier: h, sections: l, rows: h === "section" ? [] : d, seats: i, visibleSeatCount: m };
|
|
1506
1506
|
}
|
|
1507
1507
|
function tn(s) {
|
|
1508
1508
|
if (s.accessType)
|
|
@@ -1515,8 +1515,8 @@ function ke(s, t) {
|
|
|
1515
1515
|
return r === "wheelchair" || r === "companion" ? "available" : r;
|
|
1516
1516
|
}
|
|
1517
1517
|
function yn(s, t, r) {
|
|
1518
|
-
var
|
|
1519
|
-
const n = (
|
|
1518
|
+
var l;
|
|
1519
|
+
const n = (l = t.priceCategories) == null ? void 0 : l.find((o) => o.id === s.priceCategoryId);
|
|
1520
1520
|
return {
|
|
1521
1521
|
amount: (n == null ? void 0 : n.price) ?? r.basePrice,
|
|
1522
1522
|
currency: r.currency
|
|
@@ -1527,14 +1527,14 @@ function qt(s, t = {}, r) {
|
|
|
1527
1527
|
}
|
|
1528
1528
|
function Ln(s, t = {}, r) {
|
|
1529
1529
|
const n = [];
|
|
1530
|
-
let
|
|
1530
|
+
let l = null;
|
|
1531
1531
|
return s.forEach((o, d) => {
|
|
1532
|
-
qt(o, t, r) ?
|
|
1533
|
-
}),
|
|
1532
|
+
qt(o, t, r) ? l ? l.seats.push(o) : l = { start: d, seats: [o] } : l && (n.push(l), l = null);
|
|
1533
|
+
}), l && n.push(l), n;
|
|
1534
1534
|
}
|
|
1535
1535
|
function jt(s, t, r = {}, n) {
|
|
1536
|
-
const
|
|
1537
|
-
if (s.length >
|
|
1536
|
+
const l = r.maxSeats ?? 8;
|
|
1537
|
+
if (s.length > l)
|
|
1538
1538
|
return { ok: !1, reason: "max-seats" };
|
|
1539
1539
|
for (const d of s) {
|
|
1540
1540
|
const m = t.seatById.get(d);
|
|
@@ -1556,20 +1556,20 @@ function jt(s, t, r = {}, n) {
|
|
|
1556
1556
|
i ? i.push(d) : o.set(h, [d]);
|
|
1557
1557
|
}
|
|
1558
1558
|
for (const [d, m] of o) {
|
|
1559
|
-
const [h, i] = d.split("::"), u = Number(i), p = t.rows.find((
|
|
1559
|
+
const [h, i] = d.split("::"), u = Number(i), p = t.rows.find((c) => c.sectionId === h && c.rowIndex === u);
|
|
1560
1560
|
if (!p)
|
|
1561
1561
|
continue;
|
|
1562
1562
|
const b = Ln(p.seats, r, n), f = new Set(m);
|
|
1563
1563
|
let g = null;
|
|
1564
|
-
for (const
|
|
1565
|
-
if (
|
|
1564
|
+
for (const c of b)
|
|
1565
|
+
if (c.seats.some((y) => f.has(y.id))) {
|
|
1566
1566
|
if (g)
|
|
1567
1567
|
return { ok: !1, reason: "not-adjacent", seatId: m[0] };
|
|
1568
|
-
g =
|
|
1568
|
+
g = c;
|
|
1569
1569
|
}
|
|
1570
1570
|
if (!g)
|
|
1571
1571
|
continue;
|
|
1572
|
-
const w = g.seats.map((
|
|
1572
|
+
const w = g.seats.map((c, y) => f.has(c.id) ? y : -1).filter((c) => c >= 0);
|
|
1573
1573
|
if (w.length === 0)
|
|
1574
1574
|
continue;
|
|
1575
1575
|
const k = w[0], _ = w[w.length - 1];
|
|
@@ -1581,20 +1581,20 @@ function jt(s, t, r = {}, n) {
|
|
|
1581
1581
|
}
|
|
1582
1582
|
return { ok: !0 };
|
|
1583
1583
|
}
|
|
1584
|
-
function Gt(s, t, r, n = {},
|
|
1584
|
+
function Gt(s, t, r, n = {}, l) {
|
|
1585
1585
|
if (s.includes(t))
|
|
1586
1586
|
return { selected: s.filter((m) => m !== t) };
|
|
1587
|
-
const o = [...s, t], d = jt(o, r, n,
|
|
1587
|
+
const o = [...s, t], d = jt(o, r, n, l);
|
|
1588
1588
|
return d.ok ? { selected: o } : { rejected: d.reason ?? "not-adjacent" };
|
|
1589
1589
|
}
|
|
1590
|
-
function Kt(s, t, r = {}, n = {},
|
|
1590
|
+
function Kt(s, t, r = {}, n = {}, l) {
|
|
1591
1591
|
if (t <= 0)
|
|
1592
1592
|
return [];
|
|
1593
1593
|
const o = n.categoryId ? { ...r, allowedCategories: [n.categoryId] } : r;
|
|
1594
1594
|
let d = null;
|
|
1595
1595
|
for (const m of s.rows)
|
|
1596
1596
|
if (!(n.sectionId && m.sectionId !== n.sectionId))
|
|
1597
|
-
for (const h of Ln(m.seats, o,
|
|
1597
|
+
for (const h of Ln(m.seats, o, l)) {
|
|
1598
1598
|
const i = h.seats.length;
|
|
1599
1599
|
if (!(i < t))
|
|
1600
1600
|
for (let u = 0; u + t <= i; u += 1) {
|
|
@@ -1612,12 +1612,12 @@ function Ht(s, t, r) {
|
|
|
1612
1612
|
const n = s.locationById.get(t);
|
|
1613
1613
|
if (!n)
|
|
1614
1614
|
return null;
|
|
1615
|
-
const
|
|
1615
|
+
const l = s.rows.findIndex(
|
|
1616
1616
|
(g) => g.sectionId === n.sectionId && g.rowIndex === n.rowIndex
|
|
1617
1617
|
);
|
|
1618
|
-
if (
|
|
1618
|
+
if (l < 0)
|
|
1619
1619
|
return null;
|
|
1620
|
-
const o = s.rows[
|
|
1620
|
+
const o = s.rows[l];
|
|
1621
1621
|
if (r === "left")
|
|
1622
1622
|
return ((u = o.seats[n.seatIndex - 1]) == null ? void 0 : u.id) ?? null;
|
|
1623
1623
|
if (r === "right")
|
|
@@ -1626,7 +1626,7 @@ function Ht(s, t, r) {
|
|
|
1626
1626
|
return ((b = o.seats[0]) == null ? void 0 : b.id) ?? null;
|
|
1627
1627
|
if (r === "row-end")
|
|
1628
1628
|
return ((f = o.seats[o.seats.length - 1]) == null ? void 0 : f.id) ?? null;
|
|
1629
|
-
const d = s.rows[r === "up" ?
|
|
1629
|
+
const d = s.rows[r === "up" ? l - 1 : l + 1];
|
|
1630
1630
|
if (!d)
|
|
1631
1631
|
return null;
|
|
1632
1632
|
const m = o.seats[n.seatIndex].x;
|
|
@@ -1642,7 +1642,7 @@ function Qt(s, t, r) {
|
|
|
1642
1642
|
const n = s.sections.filter((p) => p.seatCount > 0);
|
|
1643
1643
|
if (n.length === 0)
|
|
1644
1644
|
return null;
|
|
1645
|
-
const
|
|
1645
|
+
const l = t ? (h = s.locationById.get(t)) == null ? void 0 : h.sectionId : void 0, o = n.findIndex((p) => p.section.id === l), d = o < 0 ? 0 : r === "next" ? o + 1 : o - 1, m = n[d];
|
|
1646
1646
|
return m ? ((u = (i = s.rows.find((p) => p.sectionId === m.section.id)) == null ? void 0 : i.seats[0]) == null ? void 0 : u.id) ?? null : null;
|
|
1647
1647
|
}
|
|
1648
1648
|
const Ae = 8;
|
|
@@ -1654,7 +1654,7 @@ const Jt = ({
|
|
|
1654
1654
|
selectedIds: t,
|
|
1655
1655
|
cursorId: r,
|
|
1656
1656
|
statusOverrides: n,
|
|
1657
|
-
sectionColorById:
|
|
1657
|
+
sectionColorById: l,
|
|
1658
1658
|
interactive: o,
|
|
1659
1659
|
onSeatClick: d,
|
|
1660
1660
|
onSectionClick: m,
|
|
@@ -1669,7 +1669,7 @@ const Jt = ({
|
|
|
1669
1669
|
height: u.maxY - u.minY,
|
|
1670
1670
|
rx: 12,
|
|
1671
1671
|
className: "nice-seating-chart__section-shape",
|
|
1672
|
-
style: { fill:
|
|
1672
|
+
style: { fill: l.get(i.id) },
|
|
1673
1673
|
role: m ? "button" : "img",
|
|
1674
1674
|
"aria-label": `${i.name}, ${p} seats`,
|
|
1675
1675
|
tabIndex: m ? 0 : void 0,
|
|
@@ -1701,7 +1701,7 @@ const Jt = ({
|
|
|
1701
1701
|
rx: 8,
|
|
1702
1702
|
className: "nice-seating-chart__row-shape",
|
|
1703
1703
|
style: {
|
|
1704
|
-
fill:
|
|
1704
|
+
fill: l.get(i.sectionId),
|
|
1705
1705
|
fillOpacity: 0.25 + u * 0.65
|
|
1706
1706
|
},
|
|
1707
1707
|
role: "img",
|
|
@@ -1794,7 +1794,7 @@ const Jt = ({
|
|
|
1794
1794
|
selectedIds: t,
|
|
1795
1795
|
statusOverrides: r,
|
|
1796
1796
|
maxSeats: n,
|
|
1797
|
-
onSeatToggle:
|
|
1797
|
+
onSeatToggle: l,
|
|
1798
1798
|
onBestAvailable: o,
|
|
1799
1799
|
describeSeat: d,
|
|
1800
1800
|
disabled: m = !1,
|
|
@@ -1802,12 +1802,12 @@ const Jt = ({
|
|
|
1802
1802
|
}) => {
|
|
1803
1803
|
var $;
|
|
1804
1804
|
const i = X(
|
|
1805
|
-
() => s.sections.filter((
|
|
1805
|
+
() => s.sections.filter((c) => c.seatCount > 0),
|
|
1806
1806
|
[s.sections]
|
|
1807
1807
|
), [u, p] = E((($ = i[0]) == null ? void 0 : $.section.id) ?? ""), [b, f] = E(0), [g, w] = E(2), k = X(
|
|
1808
|
-
() => s.rows.filter((
|
|
1808
|
+
() => s.rows.filter((c) => c.sectionId === u),
|
|
1809
1809
|
[s.rows, u]
|
|
1810
|
-
), _ = k.find((
|
|
1810
|
+
), _ = k.find((c) => c.rowIndex === b) ?? k[0];
|
|
1811
1811
|
return /* @__PURE__ */ a(
|
|
1812
1812
|
St,
|
|
1813
1813
|
{
|
|
@@ -1822,7 +1822,7 @@ const Jt = ({
|
|
|
1822
1822
|
Je,
|
|
1823
1823
|
{
|
|
1824
1824
|
value: g,
|
|
1825
|
-
onChange: (
|
|
1825
|
+
onChange: (c) => w(Math.max(1, Math.min(n, c ?? 1))),
|
|
1826
1826
|
min: 1,
|
|
1827
1827
|
max: n,
|
|
1828
1828
|
size: "xs",
|
|
@@ -1850,12 +1850,12 @@ const Jt = ({
|
|
|
1850
1850
|
size: "sm",
|
|
1851
1851
|
value: u,
|
|
1852
1852
|
disabled: m,
|
|
1853
|
-
onChange: (
|
|
1854
|
-
p(
|
|
1853
|
+
onChange: (c) => {
|
|
1854
|
+
p(c), f(0);
|
|
1855
1855
|
},
|
|
1856
|
-
options: i.map((
|
|
1857
|
-
value:
|
|
1858
|
-
label: `${
|
|
1856
|
+
options: i.map((c) => ({
|
|
1857
|
+
value: c.section.id,
|
|
1858
|
+
label: `${c.section.name} (${c.seatCount})`
|
|
1859
1859
|
}))
|
|
1860
1860
|
}
|
|
1861
1861
|
)
|
|
@@ -1868,32 +1868,32 @@ const Jt = ({
|
|
|
1868
1868
|
size: "sm",
|
|
1869
1869
|
value: String((_ == null ? void 0 : _.rowIndex) ?? 0),
|
|
1870
1870
|
disabled: m || k.length === 0,
|
|
1871
|
-
onChange: (
|
|
1872
|
-
options: k.map((
|
|
1873
|
-
value: String(
|
|
1874
|
-
label: `${
|
|
1871
|
+
onChange: (c) => f(Number(c)),
|
|
1872
|
+
options: k.map((c) => ({
|
|
1873
|
+
value: String(c.rowIndex),
|
|
1874
|
+
label: `${c.label} (${c.seats.length})`
|
|
1875
1875
|
}))
|
|
1876
1876
|
}
|
|
1877
1877
|
)
|
|
1878
1878
|
] })
|
|
1879
1879
|
] }),
|
|
1880
|
-
_ && /* @__PURE__ */ e("ul", { className: "nice-seating-chart__seat-list", children: _.seats.map((
|
|
1881
|
-
const y = ke(
|
|
1880
|
+
_ && /* @__PURE__ */ e("ul", { className: "nice-seating-chart__seat-list", children: _.seats.map((c) => {
|
|
1881
|
+
const y = ke(c, r), v = tn(c), A = t.has(c.id);
|
|
1882
1882
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ a(
|
|
1883
1883
|
F,
|
|
1884
1884
|
{
|
|
1885
1885
|
size: "sm",
|
|
1886
1886
|
variant: A ? "primary" : "outline",
|
|
1887
1887
|
disabled: m || y !== "available",
|
|
1888
|
-
ariaLabel: d(
|
|
1888
|
+
ariaLabel: d(c),
|
|
1889
1889
|
"aria-pressed": A,
|
|
1890
|
-
onClick: () => c
|
|
1890
|
+
onClick: () => l(c),
|
|
1891
1891
|
children: [
|
|
1892
|
-
|
|
1892
|
+
c.number,
|
|
1893
1893
|
v && /* @__PURE__ */ e(Cn, { size: 11 })
|
|
1894
1894
|
]
|
|
1895
1895
|
}
|
|
1896
|
-
) },
|
|
1896
|
+
) }, c.id);
|
|
1897
1897
|
}) })
|
|
1898
1898
|
]
|
|
1899
1899
|
}
|
|
@@ -1904,14 +1904,14 @@ function ti(s = {}) {
|
|
|
1904
1904
|
minZoom: t = 0.1,
|
|
1905
1905
|
maxZoom: r = 10,
|
|
1906
1906
|
initial: n = ni,
|
|
1907
|
-
viewport:
|
|
1907
|
+
viewport: l,
|
|
1908
1908
|
onViewportChange: o,
|
|
1909
1909
|
disabled: d = !1
|
|
1910
|
-
} = s, [m, h] = E(n), i =
|
|
1910
|
+
} = s, [m, h] = E(n), i = l ?? m, [u, p] = E(!1), b = ve(/* @__PURE__ */ new Map()), f = ve(null), g = ve(null), w = G(
|
|
1911
1911
|
(N) => {
|
|
1912
|
-
|
|
1912
|
+
l === void 0 && h(N), o == null || o(N);
|
|
1913
1913
|
},
|
|
1914
|
-
[
|
|
1914
|
+
[l, o]
|
|
1915
1915
|
), k = G(
|
|
1916
1916
|
(N) => Math.min(r, Math.max(t, N)),
|
|
1917
1917
|
[t, r]
|
|
@@ -1936,7 +1936,7 @@ function ti(s = {}) {
|
|
|
1936
1936
|
_(N, B);
|
|
1937
1937
|
},
|
|
1938
1938
|
[_]
|
|
1939
|
-
),
|
|
1939
|
+
), c = G(
|
|
1940
1940
|
(N, L, V = 24) => {
|
|
1941
1941
|
const B = Math.max(1, N.maxX - N.minX), C = Math.max(1, N.maxY - N.minY), O = k(
|
|
1942
1942
|
Math.min((L.width - V * 2) / B, (L.height - V * 2) / C)
|
|
@@ -2009,7 +2009,7 @@ function ti(s = {}) {
|
|
|
2009
2009
|
}
|
|
2010
2010
|
},
|
|
2011
2011
|
zoomBy: $,
|
|
2012
|
-
fitTo:
|
|
2012
|
+
fitTo: c,
|
|
2013
2013
|
reset: y,
|
|
2014
2014
|
screenToWorld: v,
|
|
2015
2015
|
worldToScreen: A,
|
|
@@ -2027,7 +2027,7 @@ const ii = {
|
|
|
2027
2027
|
var de, $e, xe;
|
|
2028
2028
|
const {
|
|
2029
2029
|
chart: n,
|
|
2030
|
-
mode:
|
|
2030
|
+
mode: l = "select",
|
|
2031
2031
|
selection: o = {},
|
|
2032
2032
|
selectedSeatIds: d,
|
|
2033
2033
|
defaultSelectedSeatIds: m = [],
|
|
@@ -2042,13 +2042,13 @@ const ii = {
|
|
|
2042
2042
|
containerSize: k,
|
|
2043
2043
|
showLegend: _ = !0,
|
|
2044
2044
|
showList: $ = !1,
|
|
2045
|
-
zoomable:
|
|
2045
|
+
zoomable: c = !0,
|
|
2046
2046
|
locale: y,
|
|
2047
2047
|
disabled: v = !1,
|
|
2048
2048
|
readOnly: A = !1,
|
|
2049
2049
|
className: I,
|
|
2050
2050
|
style: D
|
|
2051
|
-
} = t, N = ve(null), [L, V] = E({ width: 800, height: 500 }), [B, C] = E(!1), [O, z] = E(m), [P, M] = E(null), [j, W] = E(""), S = d ?? O, Y = X(() => new Set(S), [S]), q =
|
|
2051
|
+
} = t, N = ve(null), [L, V] = E({ width: 800, height: 500 }), [B, C] = E(!1), [O, z] = E(m), [P, M] = E(null), [j, W] = E(""), S = d ?? O, Y = X(() => new Set(S), [S]), q = l === "select" && !v && !A && o.interactive !== !1, Q = o.maxSeats ?? 8, R = X(() => Xt(n), [n]), ne = k ?? L, H = !!k || B;
|
|
2052
2052
|
Oe(() => {
|
|
2053
2053
|
if (k || !N.current || typeof ResizeObserver > "u")
|
|
2054
2054
|
return;
|
|
@@ -2058,10 +2058,10 @@ const ii = {
|
|
|
2058
2058
|
});
|
|
2059
2059
|
return U.observe(T), () => U.disconnect();
|
|
2060
2060
|
}, [k]);
|
|
2061
|
-
const _e = ti({ disabled: !
|
|
2061
|
+
const _e = ti({ disabled: !c || v }), { fitTo: ce, viewport: me } = _e, Ne = ve(!1);
|
|
2062
2062
|
Oe(() => {
|
|
2063
|
-
Ne.current || !H || R.totalSeats === 0 || ne.width <= 0 || (Ne.current = !0,
|
|
2064
|
-
}, [
|
|
2063
|
+
Ne.current || !H || R.totalSeats === 0 || ne.width <= 0 || (Ne.current = !0, ce(R.bounds, ne));
|
|
2064
|
+
}, [ce, R, ne, H]);
|
|
2065
2065
|
const Me = X(() => Yt(me, ne, 40), [me, ne]), be = f !== "auto" ? f : P ? "seat" : void 0, he = X(
|
|
2066
2066
|
() => Wt(R, Me, w, be),
|
|
2067
2067
|
[R, Me, w, be]
|
|
@@ -2145,9 +2145,9 @@ const ii = {
|
|
|
2145
2145
|
const K = R.rows.find(
|
|
2146
2146
|
(Z) => Z.sectionId === U.sectionId && Z.rowIndex === U.rowIndex
|
|
2147
2147
|
);
|
|
2148
|
-
K &&
|
|
2148
|
+
K && ce(K.bounds, ne, 80);
|
|
2149
2149
|
},
|
|
2150
|
-
[
|
|
2150
|
+
[ce, R, ne]
|
|
2151
2151
|
), fe = G(
|
|
2152
2152
|
(T) => {
|
|
2153
2153
|
if (!T)
|
|
@@ -2202,7 +2202,7 @@ const ii = {
|
|
|
2202
2202
|
"div",
|
|
2203
2203
|
{
|
|
2204
2204
|
ref: r,
|
|
2205
|
-
className: `nice-seating-chart nice-seating-chart--${
|
|
2205
|
+
className: `nice-seating-chart nice-seating-chart--${l} ${I ?? ""}`,
|
|
2206
2206
|
style: D,
|
|
2207
2207
|
children: [
|
|
2208
2208
|
/* @__PURE__ */ a(
|
|
@@ -2258,7 +2258,7 @@ const ii = {
|
|
|
2258
2258
|
]
|
|
2259
2259
|
}
|
|
2260
2260
|
),
|
|
2261
|
-
|
|
2261
|
+
c && /* @__PURE__ */ a("div", { className: "nice-seating-chart__zoom", children: [
|
|
2262
2262
|
/* @__PURE__ */ e(
|
|
2263
2263
|
F,
|
|
2264
2264
|
{
|
|
@@ -2285,7 +2285,7 @@ const ii = {
|
|
|
2285
2285
|
size: "sm",
|
|
2286
2286
|
variant: "ghost",
|
|
2287
2287
|
ariaLabel: "Fit to view",
|
|
2288
|
-
onClick: () =>
|
|
2288
|
+
onClick: () => ce(R.bounds, ne),
|
|
2289
2289
|
children: "Fit"
|
|
2290
2290
|
}
|
|
2291
2291
|
)
|
|
@@ -2313,7 +2313,7 @@ const ii = {
|
|
|
2313
2313
|
" Sold"
|
|
2314
2314
|
] })
|
|
2315
2315
|
] }),
|
|
2316
|
-
|
|
2316
|
+
l === "select" && S.length > 0 && /* @__PURE__ */ a("p", { className: "nice-seating-chart__total", children: [
|
|
2317
2317
|
S.length,
|
|
2318
2318
|
" seat",
|
|
2319
2319
|
S.length === 1 ? "" : "s",
|
|
@@ -2332,7 +2332,7 @@ const ii = {
|
|
|
2332
2332
|
onBestAvailable: ge,
|
|
2333
2333
|
describeSeat: oe,
|
|
2334
2334
|
disabled: !q,
|
|
2335
|
-
defaultOpen:
|
|
2335
|
+
defaultOpen: l === "select" && $
|
|
2336
2336
|
}
|
|
2337
2337
|
)
|
|
2338
2338
|
]
|
|
@@ -2340,11 +2340,11 @@ const ii = {
|
|
|
2340
2340
|
);
|
|
2341
2341
|
}
|
|
2342
2342
|
), Pi = ee(
|
|
2343
|
-
function({ showList: t = !0, className: r, ...n },
|
|
2343
|
+
function({ showList: t = !0, className: r, ...n }, l) {
|
|
2344
2344
|
return /* @__PURE__ */ e(
|
|
2345
2345
|
ai,
|
|
2346
2346
|
{
|
|
2347
|
-
ref:
|
|
2347
|
+
ref: l,
|
|
2348
2348
|
mode: "select",
|
|
2349
2349
|
showList: t,
|
|
2350
2350
|
className: `nice-seat-picker ${r ?? ""}`,
|
|
@@ -2362,26 +2362,26 @@ const ii = {
|
|
|
2362
2362
|
function ri(s) {
|
|
2363
2363
|
return s.replace(/[&<>"']/g, (t) => si[t] ?? t);
|
|
2364
2364
|
}
|
|
2365
|
-
function
|
|
2365
|
+
function ci(s) {
|
|
2366
2366
|
const t = [], r = /* @__PURE__ */ new Set();
|
|
2367
2367
|
for (const n of s.matchAll(Bn)) {
|
|
2368
|
-
const
|
|
2369
|
-
r.has(
|
|
2368
|
+
const l = n[1];
|
|
2369
|
+
r.has(l) || (r.add(l), t.push(l));
|
|
2370
2370
|
}
|
|
2371
2371
|
return t;
|
|
2372
2372
|
}
|
|
2373
|
-
function
|
|
2374
|
-
const { escape: n = !0, missing:
|
|
2373
|
+
function li(s, t = {}, r = {}) {
|
|
2374
|
+
const { escape: n = !0, missing: l = "keep" } = r;
|
|
2375
2375
|
return s.replace(Bn, (o, d) => {
|
|
2376
2376
|
const m = t[d];
|
|
2377
|
-
return m == null ?
|
|
2377
|
+
return m == null ? l === "blank" ? "" : o : n ? ri(String(m)) : String(m);
|
|
2378
2378
|
});
|
|
2379
2379
|
}
|
|
2380
2380
|
function _n(s) {
|
|
2381
2381
|
return `{{${s}}}`;
|
|
2382
2382
|
}
|
|
2383
2383
|
function oi(s, t = {}) {
|
|
2384
|
-
return
|
|
2384
|
+
return ci(s).filter((r) => t[r] === void 0 || t[r] === null);
|
|
2385
2385
|
}
|
|
2386
2386
|
const di = [
|
|
2387
2387
|
"bold",
|
|
@@ -2401,7 +2401,7 @@ const di = [
|
|
|
2401
2401
|
function(t, r) {
|
|
2402
2402
|
const {
|
|
2403
2403
|
template: n,
|
|
2404
|
-
onTemplateChange:
|
|
2404
|
+
onTemplateChange: l,
|
|
2405
2405
|
tokens: o = [],
|
|
2406
2406
|
previewData: d = {},
|
|
2407
2407
|
recipients: m = [],
|
|
@@ -2414,18 +2414,18 @@ const di = [
|
|
|
2414
2414
|
size: g = "md",
|
|
2415
2415
|
className: w,
|
|
2416
2416
|
style: k
|
|
2417
|
-
} = t, [_, $] = E(""),
|
|
2417
|
+
} = t, [_, $] = E(""), c = b || f || u, y = X(() => Dn(_), [_]), v = X(() => {
|
|
2418
2418
|
const C = {};
|
|
2419
2419
|
for (const O of o)
|
|
2420
2420
|
O.sample !== void 0 && (C[O.key] = O.sample);
|
|
2421
2421
|
return { ...C, ...d };
|
|
2422
2422
|
}, [o, d]), A = X(
|
|
2423
|
-
() =>
|
|
2423
|
+
() => li(n.body ?? "", v),
|
|
2424
2424
|
[n.body, v]
|
|
2425
2425
|
), I = X(
|
|
2426
2426
|
() => oi(n.body ?? "", v),
|
|
2427
2427
|
[n.body, v]
|
|
2428
|
-
), D = m.map((C) => C.email), N = (C) =>
|
|
2428
|
+
), D = m.map((C) => C.email), N = (C) => l == null ? void 0 : l({ ...n, ...C }), L = (C) => {
|
|
2429
2429
|
N({ body: `${n.body ?? ""}${_n(C)}` });
|
|
2430
2430
|
}, V = () => {
|
|
2431
2431
|
!h || y.valid.length === 0 || (h(Et(D, y.valid)), $(""));
|
|
@@ -2447,7 +2447,7 @@ const di = [
|
|
|
2447
2447
|
value: n.name,
|
|
2448
2448
|
onChange: (C) => N({ name: C }),
|
|
2449
2449
|
placeholder: "Birthday invitation",
|
|
2450
|
-
disabled:
|
|
2450
|
+
disabled: c,
|
|
2451
2451
|
size: g
|
|
2452
2452
|
}
|
|
2453
2453
|
),
|
|
@@ -2458,7 +2458,7 @@ const di = [
|
|
|
2458
2458
|
{
|
|
2459
2459
|
size: "sm",
|
|
2460
2460
|
variant: "outline",
|
|
2461
|
-
disabled:
|
|
2461
|
+
disabled: c,
|
|
2462
2462
|
onClick: () => L(C.key),
|
|
2463
2463
|
children: C.label
|
|
2464
2464
|
},
|
|
@@ -2516,7 +2516,7 @@ const di = [
|
|
|
2516
2516
|
onChange: $,
|
|
2517
2517
|
placeholder: "Paste a list — commas, semicolons or new lines",
|
|
2518
2518
|
rows: 3,
|
|
2519
|
-
disabled:
|
|
2519
|
+
disabled: c,
|
|
2520
2520
|
size: g
|
|
2521
2521
|
}
|
|
2522
2522
|
),
|
|
@@ -2527,7 +2527,7 @@ const di = [
|
|
|
2527
2527
|
size: g,
|
|
2528
2528
|
variant: "outline",
|
|
2529
2529
|
leftIcon: /* @__PURE__ */ e(In, { size: 15 }),
|
|
2530
|
-
disabled:
|
|
2530
|
+
disabled: c || y.valid.length === 0,
|
|
2531
2531
|
onClick: V,
|
|
2532
2532
|
children: [
|
|
2533
2533
|
"Add ",
|
|
@@ -2558,7 +2558,7 @@ const di = [
|
|
|
2558
2558
|
size: "sm",
|
|
2559
2559
|
variant: "ghost",
|
|
2560
2560
|
ariaLabel: `Remove ${C.email}`,
|
|
2561
|
-
disabled:
|
|
2561
|
+
disabled: c,
|
|
2562
2562
|
onClick: () => B(C.email),
|
|
2563
2563
|
children: /* @__PURE__ */ e(Te, { size: 13 })
|
|
2564
2564
|
}
|
|
@@ -2587,7 +2587,7 @@ const di = [
|
|
|
2587
2587
|
max: t,
|
|
2588
2588
|
currency: r,
|
|
2589
2589
|
locale: n,
|
|
2590
|
-
label:
|
|
2590
|
+
label: l,
|
|
2591
2591
|
className: o
|
|
2592
2592
|
}) => {
|
|
2593
2593
|
const d = t > 0 ? t : 1, m = s >= t && t > 0, h = (i, u) => r ? `${se(i, r, n)} / ${se(u, r, n)}` : `${i} / ${u}`;
|
|
@@ -2601,7 +2601,7 @@ const di = [
|
|
|
2601
2601
|
size: "sm",
|
|
2602
2602
|
showValue: !0,
|
|
2603
2603
|
formatValue: () => h(s, t),
|
|
2604
|
-
"aria-label":
|
|
2604
|
+
"aria-label": l
|
|
2605
2605
|
}
|
|
2606
2606
|
);
|
|
2607
2607
|
};
|
|
@@ -2615,7 +2615,7 @@ const Mi = ee(
|
|
|
2615
2615
|
function(t, r) {
|
|
2616
2616
|
const {
|
|
2617
2617
|
items: n,
|
|
2618
|
-
kind:
|
|
2618
|
+
kind: l = "registry",
|
|
2619
2619
|
mode: o = "owner",
|
|
2620
2620
|
currency: d = "PLN",
|
|
2621
2621
|
locale: m,
|
|
@@ -2630,11 +2630,11 @@ const Mi = ee(
|
|
|
2630
2630
|
onItemClick: k,
|
|
2631
2631
|
layout: _ = "grid",
|
|
2632
2632
|
disabled: $ = !1,
|
|
2633
|
-
readOnly:
|
|
2633
|
+
readOnly: c = !1,
|
|
2634
2634
|
size: y = "md",
|
|
2635
2635
|
className: v,
|
|
2636
2636
|
style: A
|
|
2637
|
-
} = t, I = En({ currentUserId: i, currentUserName: u }), [D, N] = E(null), [L, V] = E(0), [B, C] = E(""), O = o === "owner", z = $ ||
|
|
2637
|
+
} = t, I = En({ currentUserId: i, currentUserName: u }), [D, N] = E(null), [L, V] = E(0), [B, C] = E(""), O = o === "owner", z = $ || c, P = l === "wishlist", M = X(() => P ? [...n].sort(
|
|
2638
2638
|
(S, Y) => Number(S.isPurchased ?? !1) - Number(Y.isPurchased ?? !1) || (Y.priority ?? 0) - (S.priority ?? 0)
|
|
2639
2639
|
) : n, [n, P]), j = () => {
|
|
2640
2640
|
N(null), V(0);
|
|
@@ -2657,7 +2657,7 @@ const Mi = ee(
|
|
|
2657
2657
|
"div",
|
|
2658
2658
|
{
|
|
2659
2659
|
ref: r,
|
|
2660
|
-
className: `nice-gift-registry nice-gift-registry--${
|
|
2660
|
+
className: `nice-gift-registry nice-gift-registry--${l} nice-gift-registry--${_} nice-gift-registry--${y} ${v ?? ""}`,
|
|
2661
2661
|
style: A,
|
|
2662
2662
|
children: [
|
|
2663
2663
|
!O && I.isAnonymous && (p || b) && /* @__PURE__ */ e(
|
|
@@ -2673,7 +2673,7 @@ const Mi = ee(
|
|
|
2673
2673
|
}
|
|
2674
2674
|
),
|
|
2675
2675
|
/* @__PURE__ */ e(Pn, { columns: _ === "list" ? 1 : void 0, minColumnWidth: 240, gap: 12, children: M.map((S) => {
|
|
2676
|
-
const { value: Y, max: q, complete: Q } = mi(S,
|
|
2676
|
+
const { value: Y, max: q, complete: Q } = mi(S, l), R = S.price, ne = S.contributions ?? [];
|
|
2677
2677
|
return /* @__PURE__ */ a(
|
|
2678
2678
|
"div",
|
|
2679
2679
|
{
|
|
@@ -2772,7 +2772,7 @@ const Mi = ee(
|
|
|
2772
2772
|
children: "Chip in"
|
|
2773
2773
|
}
|
|
2774
2774
|
),
|
|
2775
|
-
O && w && !
|
|
2775
|
+
O && w && !c && /* @__PURE__ */ e(
|
|
2776
2776
|
F,
|
|
2777
2777
|
{
|
|
2778
2778
|
size: "sm",
|
|
@@ -2820,7 +2820,7 @@ const Mi = ee(
|
|
|
2820
2820
|
S.id
|
|
2821
2821
|
);
|
|
2822
2822
|
}) }),
|
|
2823
|
-
O && g && !
|
|
2823
|
+
O && g && !c && /* @__PURE__ */ a("div", { className: "nice-gift-registry__add", children: [
|
|
2824
2824
|
/* @__PURE__ */ e(
|
|
2825
2825
|
J,
|
|
2826
2826
|
{
|
|
@@ -2854,16 +2854,16 @@ const Mi = ee(
|
|
|
2854
2854
|
function hi(s) {
|
|
2855
2855
|
const t = /* @__PURE__ */ new Map();
|
|
2856
2856
|
for (const r of s) {
|
|
2857
|
-
const n = (r.currency || "").toUpperCase(),
|
|
2858
|
-
|
|
2857
|
+
const n = (r.currency || "").toUpperCase(), l = t.get(n);
|
|
2858
|
+
l ? l.push(r) : t.set(n, [r]);
|
|
2859
2859
|
}
|
|
2860
2860
|
return t;
|
|
2861
2861
|
}
|
|
2862
2862
|
function pi(s, t, r) {
|
|
2863
2863
|
var h;
|
|
2864
|
-
const n = new Set(t.map((i) => i.id)),
|
|
2864
|
+
const n = new Set(t.map((i) => i.id)), l = t.map((i) => i.id), o = new Map(l.map((i) => [i, 0])), d = [];
|
|
2865
2865
|
let m = 0;
|
|
2866
|
-
if (
|
|
2866
|
+
if (l.length === 0)
|
|
2867
2867
|
return {
|
|
2868
2868
|
balances: o,
|
|
2869
2869
|
issues: s.map((i) => ({ itemId: i.id, reason: "no-participants" })),
|
|
@@ -2879,8 +2879,8 @@ function pi(s, t, r) {
|
|
|
2879
2879
|
d.push({ itemId: i.id, reason: "unknown-payer" });
|
|
2880
2880
|
continue;
|
|
2881
2881
|
}
|
|
2882
|
-
let p = (h = i.splitAmong) != null && h.length ? i.splitAmong.filter((_) => n.has(_)) :
|
|
2883
|
-
p.length === 0 && (p =
|
|
2882
|
+
let p = (h = i.splitAmong) != null && h.length ? i.splitAmong.filter((_) => n.has(_)) : l;
|
|
2883
|
+
p.length === 0 && (p = l);
|
|
2884
2884
|
const b = nn(i.amount, r);
|
|
2885
2885
|
m += b;
|
|
2886
2886
|
const f = p.length, g = Math.floor(b / f), w = b - g * f, k = new Map(p.map((_) => [_, g]));
|
|
@@ -2889,8 +2889,8 @@ function pi(s, t, r) {
|
|
|
2889
2889
|
k.set(u, (k.get(u) ?? 0) + w);
|
|
2890
2890
|
else {
|
|
2891
2891
|
const _ = [...p].sort(Xe), $ = w > 0 ? 1 : -1;
|
|
2892
|
-
for (let
|
|
2893
|
-
const y = _[
|
|
2892
|
+
for (let c = 0; c < Math.abs(w); c += 1) {
|
|
2893
|
+
const y = _[c % _.length];
|
|
2894
2894
|
k.set(y, (k.get(y) ?? 0) + $);
|
|
2895
2895
|
}
|
|
2896
2896
|
}
|
|
@@ -2904,31 +2904,31 @@ function gi(s, t, r) {
|
|
|
2904
2904
|
for (const n of t) {
|
|
2905
2905
|
if ((n.currency || "").toUpperCase() !== r || !s.has(n.fromId) || !s.has(n.toId))
|
|
2906
2906
|
continue;
|
|
2907
|
-
const
|
|
2908
|
-
s.set(n.fromId, (s.get(n.fromId) ?? 0) +
|
|
2907
|
+
const l = nn(n.amount, r);
|
|
2908
|
+
s.set(n.fromId, (s.get(n.fromId) ?? 0) + l), s.set(n.toId, (s.get(n.toId) ?? 0) - l);
|
|
2909
2909
|
}
|
|
2910
2910
|
}
|
|
2911
2911
|
function fi(s, t, r) {
|
|
2912
|
-
const n = new Map(t.map((i) => [i.id, i.name])),
|
|
2912
|
+
const n = new Map(t.map((i) => [i.id, i.name])), l = [...s.entries()].filter(([, i]) => i > 0).map(([i, u]) => ({ id: i, v: u })).sort((i, u) => u.v - i.v || Xe(i.id, u.id)), o = [...s.entries()].filter(([, i]) => i < 0).map(([i, u]) => ({ id: i, v: u })).sort((i, u) => i.v - u.v || Xe(i.id, u.id)), d = [];
|
|
2913
2913
|
let m = 0, h = 0;
|
|
2914
|
-
for (; m < o.length && h <
|
|
2915
|
-
const i = Math.min(-o[m].v,
|
|
2914
|
+
for (; m < o.length && h < l.length; ) {
|
|
2915
|
+
const i = Math.min(-o[m].v, l[h].v);
|
|
2916
2916
|
i > 0 && d.push({
|
|
2917
2917
|
fromId: o[m].id,
|
|
2918
2918
|
fromName: n.get(o[m].id) ?? o[m].id,
|
|
2919
|
-
toId:
|
|
2920
|
-
toName: n.get(
|
|
2919
|
+
toId: l[h].id,
|
|
2920
|
+
toName: n.get(l[h].id) ?? l[h].id,
|
|
2921
2921
|
amount: Ye(i, r),
|
|
2922
2922
|
currency: r
|
|
2923
|
-
}), o[m].v += i,
|
|
2923
|
+
}), o[m].v += i, l[h].v -= i, o[m].v === 0 && (m += 1), l[h].v === 0 && (h += 1);
|
|
2924
2924
|
}
|
|
2925
2925
|
return d;
|
|
2926
2926
|
}
|
|
2927
2927
|
function vi(s, t, r = []) {
|
|
2928
|
-
const n = [],
|
|
2928
|
+
const n = [], l = [], o = [...hi(s).entries()].sort(([d], [m]) => Xe(d, m));
|
|
2929
2929
|
for (const [d, m] of o) {
|
|
2930
2930
|
const h = pi(m, t, d);
|
|
2931
|
-
|
|
2931
|
+
l.push(...h.issues), gi(h.balances, r, d), n.push({
|
|
2932
2932
|
currency: d,
|
|
2933
2933
|
total: Ye(h.totalMinor, d),
|
|
2934
2934
|
balances: t.map((i) => ({
|
|
@@ -2940,7 +2940,7 @@ function vi(s, t, r = []) {
|
|
|
2940
2940
|
transfers: fi(h.balances, t, d)
|
|
2941
2941
|
});
|
|
2942
2942
|
}
|
|
2943
|
-
return { groups: n, issues:
|
|
2943
|
+
return { groups: n, issues: l };
|
|
2944
2944
|
}
|
|
2945
2945
|
function Xe(s, t) {
|
|
2946
2946
|
return s < t ? -1 : s > t ? 1 : 0;
|
|
@@ -2949,7 +2949,7 @@ const Di = ee(
|
|
|
2949
2949
|
function(t, r) {
|
|
2950
2950
|
const {
|
|
2951
2951
|
items: n,
|
|
2952
|
-
participants:
|
|
2952
|
+
participants: l,
|
|
2953
2953
|
settlements: o = [],
|
|
2954
2954
|
view: d,
|
|
2955
2955
|
defaultView: m = "expenses",
|
|
@@ -2964,10 +2964,10 @@ const Di = ee(
|
|
|
2964
2964
|
readOnly: k = !1,
|
|
2965
2965
|
size: _ = "md",
|
|
2966
2966
|
className: $,
|
|
2967
|
-
style:
|
|
2967
|
+
style: c
|
|
2968
2968
|
} = t, [y, v] = E(m), A = d ?? y, I = w || k, D = X(
|
|
2969
|
-
() =>
|
|
2970
|
-
[
|
|
2969
|
+
() => l.map((z) => ({ id: z.id, name: z.name })),
|
|
2970
|
+
[l]
|
|
2971
2971
|
), N = X(() => vi(n, D, o), [n, D, o]), L = X(() => f === "none" ? n : n.map((z, P) => ({ item: z, index: P })).sort((z, P) => {
|
|
2972
2972
|
if (f === "amount")
|
|
2973
2973
|
return P.item.amount - z.item.amount || z.index - P.index;
|
|
@@ -2978,15 +2978,15 @@ const Di = ee(
|
|
|
2978
2978
|
b == null || b(N.issues);
|
|
2979
2979
|
}, [V]);
|
|
2980
2980
|
const B = X(
|
|
2981
|
-
() => new Map(
|
|
2982
|
-
[
|
|
2981
|
+
() => new Map(l.map((z) => [z.id, z.avatarUrl])),
|
|
2982
|
+
[l]
|
|
2983
2983
|
), C = X(
|
|
2984
2984
|
() => new Map(N.issues.map((z) => [z.itemId, z.reason])),
|
|
2985
2985
|
[N.issues]
|
|
2986
2986
|
), O = (z) => {
|
|
2987
2987
|
d === void 0 && v(z), h == null || h(z);
|
|
2988
2988
|
};
|
|
2989
|
-
return n.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-expense-split ${$ ?? ""}`, style:
|
|
2989
|
+
return n.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-expense-split ${$ ?? ""}`, style: c, children: /* @__PURE__ */ e(
|
|
2990
2990
|
ye,
|
|
2991
2991
|
{
|
|
2992
2992
|
icon: /* @__PURE__ */ e(yt, { size: 28 }),
|
|
@@ -2998,7 +2998,7 @@ const Di = ee(
|
|
|
2998
2998
|
{
|
|
2999
2999
|
ref: r,
|
|
3000
3000
|
className: `nice-expense-split nice-expense-split--${_} ${$ ?? ""}`,
|
|
3001
|
-
style:
|
|
3001
|
+
style: c,
|
|
3002
3002
|
children: [
|
|
3003
3003
|
/* @__PURE__ */ e(
|
|
3004
3004
|
Tn,
|
|
@@ -3151,7 +3151,7 @@ const Di = ee(
|
|
|
3151
3151
|
function(t, r) {
|
|
3152
3152
|
const {
|
|
3153
3153
|
rounds: n,
|
|
3154
|
-
activeRoundId:
|
|
3154
|
+
activeRoundId: l,
|
|
3155
3155
|
onSelect: o,
|
|
3156
3156
|
onStart: d,
|
|
3157
3157
|
onEnd: m,
|
|
@@ -3170,7 +3170,7 @@ const Di = ee(
|
|
|
3170
3170
|
i && h && /* @__PURE__ */ e("button", { onClick: h, children: "+ Add Round" })
|
|
3171
3171
|
] }),
|
|
3172
3172
|
b.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-round-list__empty", children: "No rounds yet." }) : /* @__PURE__ */ e("div", { className: "nice-round-list__items", children: b.map((f) => {
|
|
3173
|
-
const g = f.id ===
|
|
3173
|
+
const g = f.id === l;
|
|
3174
3174
|
return /* @__PURE__ */ a(
|
|
3175
3175
|
"div",
|
|
3176
3176
|
{
|
|
@@ -3220,7 +3220,7 @@ const Di = ee(
|
|
|
3220
3220
|
function(t, r) {
|
|
3221
3221
|
const {
|
|
3222
3222
|
round: n,
|
|
3223
|
-
timerRunning:
|
|
3223
|
+
timerRunning: l = !1,
|
|
3224
3224
|
remainingSeconds: o,
|
|
3225
3225
|
onSubmitScore: d,
|
|
3226
3226
|
onStart: m,
|
|
@@ -3231,15 +3231,15 @@ const Di = ee(
|
|
|
3231
3231
|
className: b,
|
|
3232
3232
|
style: f
|
|
3233
3233
|
} = t, [g, w] = E({}), k = G(
|
|
3234
|
-
(
|
|
3235
|
-
const y = parseFloat(g[
|
|
3236
|
-
isNaN(y) || !d || (d(
|
|
3234
|
+
(c) => {
|
|
3235
|
+
const y = parseFloat(g[c] ?? "");
|
|
3236
|
+
isNaN(y) || !d || (d(c, y), w((v) => ({ ...v, [c]: "" })));
|
|
3237
3237
|
},
|
|
3238
3238
|
[g, d]
|
|
3239
|
-
), _ = (
|
|
3240
|
-
const y = Math.floor(
|
|
3239
|
+
), _ = (c) => {
|
|
3240
|
+
const y = Math.floor(c / 60), v = c % 60;
|
|
3241
3241
|
return `${y}:${v.toString().padStart(2, "0")}`;
|
|
3242
|
-
}, $ = n.scores ? [...n.scores].sort((
|
|
3242
|
+
}, $ = n.scores ? [...n.scores].sort((c, y) => y.score - c.score) : [];
|
|
3243
3243
|
return /* @__PURE__ */ a(
|
|
3244
3244
|
"div",
|
|
3245
3245
|
{
|
|
@@ -3256,10 +3256,10 @@ const Di = ee(
|
|
|
3256
3256
|
/* @__PURE__ */ e("span", { className: "nice-round-card__status", children: n.status })
|
|
3257
3257
|
] }),
|
|
3258
3258
|
n.description && /* @__PURE__ */ e("p", { className: "nice-round-card__description", children: n.description }),
|
|
3259
|
-
(
|
|
3259
|
+
(l || o != null) && /* @__PURE__ */ a(
|
|
3260
3260
|
"div",
|
|
3261
3261
|
{
|
|
3262
|
-
className: `nice-round-card__timer ${
|
|
3262
|
+
className: `nice-round-card__timer ${l ? "nice-round-card__timer--running" : ""}`,
|
|
3263
3263
|
children: [
|
|
3264
3264
|
"⏱️ ",
|
|
3265
3265
|
o != null ? _(o) : "—"
|
|
@@ -3274,40 +3274,40 @@ const Di = ee(
|
|
|
3274
3274
|
/* @__PURE__ */ e("th", { children: "Participant" }),
|
|
3275
3275
|
/* @__PURE__ */ e("th", { children: "Score" })
|
|
3276
3276
|
] }) }),
|
|
3277
|
-
/* @__PURE__ */ e("tbody", { children: $.map((
|
|
3277
|
+
/* @__PURE__ */ e("tbody", { children: $.map((c, y) => /* @__PURE__ */ a(
|
|
3278
3278
|
"tr",
|
|
3279
3279
|
{
|
|
3280
3280
|
className: y < 3 ? `nice-round-card__top-${y + 1}` : "",
|
|
3281
3281
|
children: [
|
|
3282
3282
|
/* @__PURE__ */ a("td", { children: [
|
|
3283
|
-
|
|
3283
|
+
c.rank ?? y + 1,
|
|
3284
3284
|
y === 0 ? " 🥇" : y === 1 ? " 🥈" : y === 2 ? " 🥉" : ""
|
|
3285
3285
|
] }),
|
|
3286
|
-
/* @__PURE__ */ e("td", { children:
|
|
3287
|
-
/* @__PURE__ */ e("td", { children:
|
|
3286
|
+
/* @__PURE__ */ e("td", { children: c.participantName }),
|
|
3287
|
+
/* @__PURE__ */ e("td", { children: c.score })
|
|
3288
3288
|
]
|
|
3289
3289
|
},
|
|
3290
|
-
|
|
3290
|
+
c.participantId
|
|
3291
3291
|
)) })
|
|
3292
3292
|
] })
|
|
3293
3293
|
] }),
|
|
3294
3294
|
d && (n.status === "active" || n.status === "voting") && $.length > 0 && /* @__PURE__ */ a("div", { className: "nice-round-card__score-input", children: [
|
|
3295
3295
|
/* @__PURE__ */ e("h4", { children: "Submit Scores" }),
|
|
3296
|
-
$.map((
|
|
3297
|
-
/* @__PURE__ */ e("span", { children:
|
|
3296
|
+
$.map((c) => /* @__PURE__ */ a("div", { className: "nice-round-card__score-row", children: [
|
|
3297
|
+
/* @__PURE__ */ e("span", { children: c.participantName }),
|
|
3298
3298
|
/* @__PURE__ */ e(
|
|
3299
3299
|
"input",
|
|
3300
3300
|
{
|
|
3301
3301
|
type: "number",
|
|
3302
|
-
value: g[
|
|
3303
|
-
onChange: (y) => w((v) => ({ ...v, [
|
|
3302
|
+
value: g[c.participantId] ?? "",
|
|
3303
|
+
onChange: (y) => w((v) => ({ ...v, [c.participantId]: y.target.value })),
|
|
3304
3304
|
min: 0,
|
|
3305
3305
|
step: 1,
|
|
3306
3306
|
placeholder: "Score"
|
|
3307
3307
|
}
|
|
3308
3308
|
),
|
|
3309
|
-
/* @__PURE__ */ e("button", { onClick: () => k(
|
|
3310
|
-
] },
|
|
3309
|
+
/* @__PURE__ */ e("button", { onClick: () => k(c.participantId), children: "Submit" })
|
|
3310
|
+
] }, c.participantId))
|
|
3311
3311
|
] }),
|
|
3312
3312
|
/* @__PURE__ */ a("div", { className: "nice-round-card__footer", children: [
|
|
3313
3313
|
u && /* @__PURE__ */ a("div", { className: "nice-round-card__actions", children: [
|
|
@@ -3329,7 +3329,7 @@ const Di = ee(
|
|
|
3329
3329
|
function(t, r) {
|
|
3330
3330
|
const {
|
|
3331
3331
|
songs: n,
|
|
3332
|
-
onAdd:
|
|
3332
|
+
onAdd: l,
|
|
3333
3333
|
onRemove: o,
|
|
3334
3334
|
onVote: d,
|
|
3335
3335
|
onSearch: m,
|
|
@@ -3340,16 +3340,16 @@ const Di = ee(
|
|
|
3340
3340
|
} = t, [b, f] = E(""), g = X(() => {
|
|
3341
3341
|
if (!b.trim())
|
|
3342
3342
|
return n;
|
|
3343
|
-
const
|
|
3343
|
+
const c = b.toLowerCase();
|
|
3344
3344
|
return n.filter(
|
|
3345
|
-
(y) => y.title.toLowerCase().includes(
|
|
3345
|
+
(y) => y.title.toLowerCase().includes(c) || y.artist.toLowerCase().includes(c)
|
|
3346
3346
|
);
|
|
3347
|
-
}, [n, b]), w = X(() => n.filter((
|
|
3348
|
-
f(
|
|
3349
|
-
}, $ = (
|
|
3350
|
-
if (!
|
|
3347
|
+
}, [n, b]), w = X(() => n.filter((c) => c.isQueued), [n]), k = n.find((c) => c.isPlaying), _ = (c) => {
|
|
3348
|
+
f(c), m == null || m(c);
|
|
3349
|
+
}, $ = (c) => {
|
|
3350
|
+
if (!c)
|
|
3351
3351
|
return "";
|
|
3352
|
-
const y = Math.floor(
|
|
3352
|
+
const y = Math.floor(c / 60), v = c % 60;
|
|
3353
3353
|
return `${y}:${v.toString().padStart(2, "0")}`;
|
|
3354
3354
|
};
|
|
3355
3355
|
return /* @__PURE__ */ a("div", { ref: r, className: `nice-song-picker ${u ?? ""}`, style: p, children: [
|
|
@@ -3364,37 +3364,37 @@ const Di = ee(
|
|
|
3364
3364
|
{
|
|
3365
3365
|
type: "text",
|
|
3366
3366
|
value: b,
|
|
3367
|
-
onChange: (
|
|
3367
|
+
onChange: (c) => _(c.target.value),
|
|
3368
3368
|
placeholder: "Search songs…",
|
|
3369
3369
|
className: "nice-song-picker__search"
|
|
3370
3370
|
}
|
|
3371
3371
|
),
|
|
3372
|
-
/* @__PURE__ */ e("div", { className: "nice-song-picker__list", children: g.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-song-picker__empty", children: "No songs found." }) : g.map((
|
|
3372
|
+
/* @__PURE__ */ e("div", { className: "nice-song-picker__list", children: g.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-song-picker__empty", children: "No songs found." }) : g.map((c) => /* @__PURE__ */ a(
|
|
3373
3373
|
"div",
|
|
3374
3374
|
{
|
|
3375
|
-
className: `nice-song-picker__item ${
|
|
3375
|
+
className: `nice-song-picker__item ${c.isPlaying ? "nice-song-picker__item--playing" : ""}`,
|
|
3376
3376
|
children: [
|
|
3377
|
-
|
|
3377
|
+
c.albumArt && /* @__PURE__ */ e("img", { src: c.albumArt, alt: "", className: "nice-song-picker__thumb" }),
|
|
3378
3378
|
/* @__PURE__ */ a("div", { className: "nice-song-picker__info", children: [
|
|
3379
|
-
/* @__PURE__ */ e("strong", { children:
|
|
3380
|
-
/* @__PURE__ */ e("span", { children:
|
|
3381
|
-
|
|
3382
|
-
|
|
3379
|
+
/* @__PURE__ */ e("strong", { children: c.title }),
|
|
3380
|
+
/* @__PURE__ */ e("span", { children: c.artist }),
|
|
3381
|
+
c.duration && /* @__PURE__ */ e("span", { className: "nice-song-picker__duration", children: $(c.duration) }),
|
|
3382
|
+
c.addedByName && /* @__PURE__ */ a("small", { children: [
|
|
3383
3383
|
"Added by ",
|
|
3384
|
-
|
|
3384
|
+
c.addedByName
|
|
3385
3385
|
] })
|
|
3386
3386
|
] }),
|
|
3387
3387
|
!i && /* @__PURE__ */ a("div", { className: "nice-song-picker__actions", children: [
|
|
3388
|
-
d && /* @__PURE__ */ a("button", { onClick: () => d(
|
|
3388
|
+
d && /* @__PURE__ */ a("button", { onClick: () => d(c.id), children: [
|
|
3389
3389
|
"👍 ",
|
|
3390
|
-
|
|
3390
|
+
c.votes ?? 0
|
|
3391
3391
|
] }),
|
|
3392
|
-
|
|
3393
|
-
o &&
|
|
3392
|
+
l && !c.isQueued && /* @__PURE__ */ e("button", { onClick: () => l(c.id), children: "+ Queue" }),
|
|
3393
|
+
o && c.isQueued && /* @__PURE__ */ e("button", { onClick: () => o(c.id), children: "Remove" })
|
|
3394
3394
|
] })
|
|
3395
3395
|
]
|
|
3396
3396
|
},
|
|
3397
|
-
|
|
3397
|
+
c.id
|
|
3398
3398
|
)) }),
|
|
3399
3399
|
h && w.length > 0 && /* @__PURE__ */ a("div", { className: "nice-song-picker__queue", children: [
|
|
3400
3400
|
/* @__PURE__ */ a("h4", { children: [
|
|
@@ -3402,17 +3402,17 @@ const Di = ee(
|
|
|
3402
3402
|
w.length,
|
|
3403
3403
|
")"
|
|
3404
3404
|
] }),
|
|
3405
|
-
w.map((
|
|
3405
|
+
w.map((c, y) => /* @__PURE__ */ a("div", { className: "nice-song-picker__queue-item", children: [
|
|
3406
3406
|
/* @__PURE__ */ a("span", { className: "nice-song-picker__queue-pos", children: [
|
|
3407
3407
|
y + 1,
|
|
3408
3408
|
"."
|
|
3409
3409
|
] }),
|
|
3410
3410
|
/* @__PURE__ */ a("span", { children: [
|
|
3411
|
-
|
|
3411
|
+
c.title,
|
|
3412
3412
|
" — ",
|
|
3413
|
-
|
|
3413
|
+
c.artist
|
|
3414
3414
|
] })
|
|
3415
|
-
] },
|
|
3415
|
+
] }, c.id))
|
|
3416
3416
|
] })
|
|
3417
3417
|
] });
|
|
3418
3418
|
}
|
|
@@ -3420,7 +3420,7 @@ const Di = ee(
|
|
|
3420
3420
|
function(t, r) {
|
|
3421
3421
|
const {
|
|
3422
3422
|
songs: n,
|
|
3423
|
-
queue:
|
|
3423
|
+
queue: l = [],
|
|
3424
3424
|
onEnqueue: o,
|
|
3425
3425
|
onDequeue: d,
|
|
3426
3426
|
onNext: m,
|
|
@@ -3437,7 +3437,7 @@ const Di = ee(
|
|
|
3437
3437
|
);
|
|
3438
3438
|
}
|
|
3439
3439
|
return g && (v = v.filter((A) => A.difficulty === g)), v;
|
|
3440
|
-
}, [n, b, g]), $ = X(() => new Set(
|
|
3440
|
+
}, [n, b, g]), $ = X(() => new Set(l.map((v) => v.id)), [l]), c = ["easy", "medium", "hard", "expert"], y = (v) => {
|
|
3441
3441
|
switch (v) {
|
|
3442
3442
|
case "easy":
|
|
3443
3443
|
return "#4caf50";
|
|
@@ -3496,7 +3496,7 @@ const Di = ee(
|
|
|
3496
3496
|
),
|
|
3497
3497
|
/* @__PURE__ */ a("select", { value: g, onChange: (v) => w(v.target.value), children: [
|
|
3498
3498
|
/* @__PURE__ */ e("option", { value: "", children: "All Difficulties" }),
|
|
3499
|
-
|
|
3499
|
+
c.map((v) => /* @__PURE__ */ e("option", { value: v, children: v }, v))
|
|
3500
3500
|
] })
|
|
3501
3501
|
]
|
|
3502
3502
|
}
|
|
@@ -3545,13 +3545,13 @@ const Di = ee(
|
|
|
3545
3545
|
},
|
|
3546
3546
|
v.id
|
|
3547
3547
|
)) }),
|
|
3548
|
-
|
|
3548
|
+
l.length > 0 && /* @__PURE__ */ a("div", { className: "nice-karaoke-picker__queue", style: { marginTop: 16 }, children: [
|
|
3549
3549
|
/* @__PURE__ */ a("h4", { children: [
|
|
3550
3550
|
"🎶 Queue (",
|
|
3551
|
-
|
|
3551
|
+
l.length,
|
|
3552
3552
|
")"
|
|
3553
3553
|
] }),
|
|
3554
|
-
|
|
3554
|
+
l.map((v, A) => /* @__PURE__ */ a(
|
|
3555
3555
|
"div",
|
|
3556
3556
|
{
|
|
3557
3557
|
style: { display: "flex", justifyContent: "space-between", padding: "4px 0" },
|
|
@@ -3599,7 +3599,7 @@ const Di = ee(
|
|
|
3599
3599
|
function(t, r) {
|
|
3600
3600
|
const {
|
|
3601
3601
|
attractions: n,
|
|
3602
|
-
onSelect:
|
|
3602
|
+
onSelect: l,
|
|
3603
3603
|
onDeselect: o,
|
|
3604
3604
|
onVote: d,
|
|
3605
3605
|
selectedIds: m = [],
|
|
@@ -3609,7 +3609,7 @@ const Di = ee(
|
|
|
3609
3609
|
layout: p = "grid",
|
|
3610
3610
|
className: b,
|
|
3611
3611
|
style: f
|
|
3612
|
-
} = t, [g, w] = E(""), [k, _] = E(""), $ = X(() => new Set(m), [m]),
|
|
3612
|
+
} = t, [g, w] = E(""), [k, _] = E(""), $ = X(() => new Set(m), [m]), c = X(() => {
|
|
3613
3613
|
const I = new Set(n.map((D) => D.category));
|
|
3614
3614
|
return Array.from(I);
|
|
3615
3615
|
}, [n]), y = X(() => {
|
|
@@ -3625,14 +3625,14 @@ const Di = ee(
|
|
|
3625
3625
|
}
|
|
3626
3626
|
return I;
|
|
3627
3627
|
}, [n, g, k]), v = !h || $.size < h, A = (I) => {
|
|
3628
|
-
u || ($.has(I) ? o == null || o(I) : v && (
|
|
3628
|
+
u || ($.has(I) ? o == null || o(I) : v && (l == null || l(I)));
|
|
3629
3629
|
};
|
|
3630
3630
|
return /* @__PURE__ */ a(
|
|
3631
3631
|
"div",
|
|
3632
3632
|
{
|
|
3633
3633
|
ref: r,
|
|
3634
3634
|
className: `nice-attraction-picker ${b ?? ""}`,
|
|
3635
|
-
style: { color: "var(--text-primary)", ...f },
|
|
3635
|
+
style: { color: "var(--nice-text-primary)", ...f },
|
|
3636
3636
|
children: [
|
|
3637
3637
|
/* @__PURE__ */ a(
|
|
3638
3638
|
"div",
|
|
@@ -3645,7 +3645,7 @@ const Di = ee(
|
|
|
3645
3645
|
},
|
|
3646
3646
|
children: [
|
|
3647
3647
|
/* @__PURE__ */ e("h3", { style: { margin: 0 }, children: "Attractions" }),
|
|
3648
|
-
h && /* @__PURE__ */ a("span", { style: { color: "var(--text-secondary, #64748b)", fontSize: 14 }, children: [
|
|
3648
|
+
h && /* @__PURE__ */ a("span", { style: { color: "var(--nice-text-secondary, #64748b)", fontSize: 14 }, children: [
|
|
3649
3649
|
$.size,
|
|
3650
3650
|
"/",
|
|
3651
3651
|
h,
|
|
@@ -3673,7 +3673,7 @@ const Di = ee(
|
|
|
3673
3673
|
children: "All"
|
|
3674
3674
|
}
|
|
3675
3675
|
),
|
|
3676
|
-
|
|
3676
|
+
c.map((I) => /* @__PURE__ */ a(
|
|
3677
3677
|
"button",
|
|
3678
3678
|
{
|
|
3679
3679
|
onClick: () => w(I === g ? "" : I),
|
|
@@ -3708,11 +3708,11 @@ const Di = ee(
|
|
|
3708
3708
|
{
|
|
3709
3709
|
className: "nice-attraction-picker__card",
|
|
3710
3710
|
style: {
|
|
3711
|
-
border: D ? "2px solid var(--color-primary, #6366f1)" : "1px solid var(--border-color, #cbd5e1)",
|
|
3711
|
+
border: D ? "2px solid var(--nice-color-primary, #6366f1)" : "1px solid var(--nice-border-color, #cbd5e1)",
|
|
3712
3712
|
borderRadius: 8,
|
|
3713
3713
|
padding: 12,
|
|
3714
3714
|
cursor: u ? "default" : "pointer",
|
|
3715
|
-
background: D ? "color-mix(in srgb, var(--color-primary) 12%, transparent)" : "var(--bg-elevated, var(--bg-primary))",
|
|
3715
|
+
background: D ? "color-mix(in srgb, var(--nice-color-primary) 12%, transparent)" : "var(--nice-bg-elevated, var(--nice-bg-primary))",
|
|
3716
3716
|
transition: "all 0.2s"
|
|
3717
3717
|
},
|
|
3718
3718
|
onClick: () => A(I.id),
|
|
@@ -3740,7 +3740,7 @@ const Di = ee(
|
|
|
3740
3740
|
{
|
|
3741
3741
|
style: {
|
|
3742
3742
|
fontSize: 13,
|
|
3743
|
-
color: "var(--text-secondary, #64748b)",
|
|
3743
|
+
color: "var(--nice-text-secondary, #64748b)",
|
|
3744
3744
|
margin: "6px 0"
|
|
3745
3745
|
},
|
|
3746
3746
|
children: I.description
|
|
@@ -3808,7 +3808,7 @@ const Di = ee(
|
|
|
3808
3808
|
function(t, r) {
|
|
3809
3809
|
const {
|
|
3810
3810
|
attractions: n,
|
|
3811
|
-
onVote:
|
|
3811
|
+
onVote: l,
|
|
3812
3812
|
onUnvote: o,
|
|
3813
3813
|
votedIds: d = [],
|
|
3814
3814
|
maxVotes: m,
|
|
@@ -3818,26 +3818,26 @@ const Di = ee(
|
|
|
3818
3818
|
className: p,
|
|
3819
3819
|
style: b
|
|
3820
3820
|
} = t, f = X(() => new Set(d), [d]), g = m ? m - f.size : void 0, w = X(() => {
|
|
3821
|
-
const
|
|
3821
|
+
const c = [...n];
|
|
3822
3822
|
switch (i) {
|
|
3823
3823
|
case "votes":
|
|
3824
|
-
|
|
3824
|
+
c.sort((y, v) => (v.votes ?? 0) - (y.votes ?? 0));
|
|
3825
3825
|
break;
|
|
3826
3826
|
case "name":
|
|
3827
|
-
|
|
3827
|
+
c.sort((y, v) => y.name.localeCompare(v.name));
|
|
3828
3828
|
break;
|
|
3829
3829
|
case "category":
|
|
3830
|
-
|
|
3830
|
+
c.sort((y, v) => y.category.localeCompare(v.category));
|
|
3831
3831
|
break;
|
|
3832
3832
|
}
|
|
3833
|
-
return
|
|
3833
|
+
return c;
|
|
3834
3834
|
}, [n, i]), k = X(
|
|
3835
|
-
() => Math.max(...n.map((
|
|
3835
|
+
() => Math.max(...n.map((c) => c.votes ?? 0), 1),
|
|
3836
3836
|
[n]
|
|
3837
|
-
), _ = (
|
|
3838
|
-
h || (f.has(
|
|
3839
|
-
}, $ = (
|
|
3840
|
-
switch (
|
|
3837
|
+
), _ = (c) => {
|
|
3838
|
+
h || (f.has(c) ? o == null || o(c) : (!g || g > 0) && (l == null || l(c)));
|
|
3839
|
+
}, $ = (c) => {
|
|
3840
|
+
switch (c) {
|
|
3841
3841
|
case 0:
|
|
3842
3842
|
return /* @__PURE__ */ e(xt, { size: 18, primaryColor: "#f59e0b", title: "1st place" });
|
|
3843
3843
|
case 1:
|
|
@@ -3845,7 +3845,7 @@ const Di = ee(
|
|
|
3845
3845
|
case 2:
|
|
3846
3846
|
return /* @__PURE__ */ e(dn, { size: 18, primaryColor: "#b45309", title: "3rd place" });
|
|
3847
3847
|
default:
|
|
3848
|
-
return `${
|
|
3848
|
+
return `${c + 1}.`;
|
|
3849
3849
|
}
|
|
3850
3850
|
};
|
|
3851
3851
|
return /* @__PURE__ */ a(
|
|
@@ -3853,7 +3853,7 @@ const Di = ee(
|
|
|
3853
3853
|
{
|
|
3854
3854
|
ref: r,
|
|
3855
3855
|
className: `nice-attraction-voting ${p ?? ""}`,
|
|
3856
|
-
style: { color: "var(--text-primary)", ...b },
|
|
3856
|
+
style: { color: "var(--nice-text-primary)", ...b },
|
|
3857
3857
|
children: [
|
|
3858
3858
|
/* @__PURE__ */ a(
|
|
3859
3859
|
"div",
|
|
@@ -3874,7 +3874,7 @@ const Di = ee(
|
|
|
3874
3874
|
{
|
|
3875
3875
|
style: {
|
|
3876
3876
|
fontSize: 14,
|
|
3877
|
-
color: g > 0 ? "var(--color-primary, #6366f1)" : "var(--color-error, #ef4444)"
|
|
3877
|
+
color: g > 0 ? "var(--nice-color-primary, #6366f1)" : "var(--nice-color-error, #ef4444)"
|
|
3878
3878
|
},
|
|
3879
3879
|
children: [
|
|
3880
3880
|
g,
|
|
@@ -3887,9 +3887,9 @@ const Di = ee(
|
|
|
3887
3887
|
]
|
|
3888
3888
|
}
|
|
3889
3889
|
),
|
|
3890
|
-
h && /* @__PURE__ */ e("p", { style: { color: "var(--text-secondary, #64748b)", marginBottom: 12 }, children: "Voting is closed. Final results:" }),
|
|
3891
|
-
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: w.map((
|
|
3892
|
-
const v = f.has(
|
|
3890
|
+
h && /* @__PURE__ */ e("p", { style: { color: "var(--nice-text-secondary, #64748b)", marginBottom: 12 }, children: "Voting is closed. Final results:" }),
|
|
3891
|
+
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: w.map((c, y) => {
|
|
3892
|
+
const v = f.has(c.id), A = c.votes ?? 0, I = u ? `${Math.round(A / k * 100)}%` : "0%";
|
|
3893
3893
|
return /* @__PURE__ */ a(
|
|
3894
3894
|
"div",
|
|
3895
3895
|
{
|
|
@@ -3899,28 +3899,28 @@ const Di = ee(
|
|
|
3899
3899
|
gap: 12,
|
|
3900
3900
|
padding: "10px 14px",
|
|
3901
3901
|
borderRadius: 8,
|
|
3902
|
-
border: v ? "2px solid var(--color-primary, #6366f1)" : "1px solid var(--border-color, #cbd5e1)",
|
|
3903
|
-
background: v ? "color-mix(in srgb, var(--color-primary) 12%, transparent)" : "var(--bg-elevated, var(--bg-primary))",
|
|
3902
|
+
border: v ? "2px solid var(--nice-color-primary, #6366f1)" : "1px solid var(--nice-border-color, #cbd5e1)",
|
|
3903
|
+
background: v ? "color-mix(in srgb, var(--nice-color-primary) 12%, transparent)" : "var(--nice-bg-elevated, var(--nice-bg-primary))",
|
|
3904
3904
|
cursor: h ? "default" : "pointer",
|
|
3905
3905
|
transition: "all 0.2s"
|
|
3906
3906
|
},
|
|
3907
|
-
onClick: () => _(
|
|
3907
|
+
onClick: () => _(c.id),
|
|
3908
3908
|
children: [
|
|
3909
3909
|
u && /* @__PURE__ */ e("span", { style: { fontSize: 18, minWidth: 32, textAlign: "center" }, children: $(y) }),
|
|
3910
|
-
/* @__PURE__ */ e("span", { style: { display: "inline-flex", fontSize: 20 }, children: Ue.createElement(bi[
|
|
3910
|
+
/* @__PURE__ */ e("span", { style: { display: "inline-flex", fontSize: 20 }, children: Ue.createElement(bi[c.category], { size: 20 }) }),
|
|
3911
3911
|
/* @__PURE__ */ a("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
3912
|
-
/* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children:
|
|
3913
|
-
|
|
3912
|
+
/* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children: c.name }),
|
|
3913
|
+
c.description && /* @__PURE__ */ e(
|
|
3914
3914
|
"div",
|
|
3915
3915
|
{
|
|
3916
3916
|
style: {
|
|
3917
3917
|
fontSize: 13,
|
|
3918
|
-
color: "var(--text-secondary, #64748b)",
|
|
3918
|
+
color: "var(--nice-text-secondary, #64748b)",
|
|
3919
3919
|
overflow: "hidden",
|
|
3920
3920
|
textOverflow: "ellipsis",
|
|
3921
3921
|
whiteSpace: "nowrap"
|
|
3922
3922
|
},
|
|
3923
|
-
children:
|
|
3923
|
+
children: c.description
|
|
3924
3924
|
}
|
|
3925
3925
|
),
|
|
3926
3926
|
u && /* @__PURE__ */ e(
|
|
@@ -3930,7 +3930,7 @@ const Di = ee(
|
|
|
3930
3930
|
marginTop: 4,
|
|
3931
3931
|
height: 6,
|
|
3932
3932
|
borderRadius: 3,
|
|
3933
|
-
background: "var(--bg-tertiary, #e2e8f0)",
|
|
3933
|
+
background: "var(--nice-bg-tertiary, #e2e8f0)",
|
|
3934
3934
|
overflow: "hidden"
|
|
3935
3935
|
},
|
|
3936
3936
|
children: /* @__PURE__ */ e(
|
|
@@ -3939,7 +3939,7 @@ const Di = ee(
|
|
|
3939
3939
|
style: {
|
|
3940
3940
|
height: "100%",
|
|
3941
3941
|
width: I,
|
|
3942
|
-
background: "var(--color-primary, #6366f1)",
|
|
3942
|
+
background: "var(--nice-color-primary, #6366f1)",
|
|
3943
3943
|
borderRadius: 3,
|
|
3944
3944
|
transition: "width 0.3s"
|
|
3945
3945
|
}
|
|
@@ -3953,13 +3953,13 @@ const Di = ee(
|
|
|
3953
3953
|
"button",
|
|
3954
3954
|
{
|
|
3955
3955
|
onClick: (D) => {
|
|
3956
|
-
D.stopPropagation(), _(
|
|
3956
|
+
D.stopPropagation(), _(c.id);
|
|
3957
3957
|
},
|
|
3958
3958
|
style: {
|
|
3959
3959
|
padding: "4px 12px",
|
|
3960
3960
|
borderRadius: 4,
|
|
3961
3961
|
border: "none",
|
|
3962
|
-
background: v ? "var(--color-error, #ef4444)" : "var(--color-primary, #6366f1)",
|
|
3962
|
+
background: v ? "var(--nice-color-error, #ef4444)" : "var(--nice-color-primary, #6366f1)",
|
|
3963
3963
|
color: "#fff",
|
|
3964
3964
|
cursor: "pointer",
|
|
3965
3965
|
fontSize: 13
|
|
@@ -3969,7 +3969,7 @@ const Di = ee(
|
|
|
3969
3969
|
)
|
|
3970
3970
|
]
|
|
3971
3971
|
},
|
|
3972
|
-
|
|
3972
|
+
c.id
|
|
3973
3973
|
);
|
|
3974
3974
|
}) }),
|
|
3975
3975
|
u && /* @__PURE__ */ a(
|
|
@@ -3979,11 +3979,11 @@ const Di = ee(
|
|
|
3979
3979
|
marginTop: 12,
|
|
3980
3980
|
textAlign: "right",
|
|
3981
3981
|
fontSize: 13,
|
|
3982
|
-
color: "var(--text-secondary, #64748b)"
|
|
3982
|
+
color: "var(--nice-text-secondary, #64748b)"
|
|
3983
3983
|
},
|
|
3984
3984
|
children: [
|
|
3985
3985
|
"Total votes: ",
|
|
3986
|
-
n.reduce((
|
|
3986
|
+
n.reduce((c, y) => c + (y.votes ?? 0), 0)
|
|
3987
3987
|
]
|
|
3988
3988
|
}
|
|
3989
3989
|
)
|