@nice2dev/events 1.2.1 → 1.2.2
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 +39 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +976 -989
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { NtdMove as Tn, NtdHeart as yt, NtdTrash as
|
|
3
|
-
import { NiceUpload as en, NiceTextInput as Z, NiceCardGroup as
|
|
1
|
+
import { jsxs as s, jsx as e, Fragment as Ge } from "react/jsx-runtime";
|
|
2
|
+
import { NtdMove as Tn, NtdHeart as yt, NtdTrash as De, NtdPlay as Ke, NtdImage as Mn, NtdPlus as an, NtdCheck as je, NtdHelp as sn, NtdClose as Ln, NtdSearch as Nt, NtdQrCode as bt, NtdMail as $n, NtdWheelchair as Rn, NtdZoomIn as kt, NtdZoomOut as wt, NtdMaximize as St, NtdSend as Ct, NtdGiftCard as xt, NtdStar as It, NtdLink as Pt, NtdReceipt as zt, NtdCoins as At, NtdArrowRight as Tt, NtdSkipForward as rn, NtdBarChart as Mt, NtdThumbsUp as cn, NtdClock as Dn, NtdTrophy as ln, NtdMedal as Je, NtdStop as Lt, NtdMusic as Pe, NtdMicrophone as Xe, NtdFileText as $t, NtdSparkle as En, NtdCamera as On, NtdGamepad as Bn, NtdClipboardCheck as Rt } from "@nice2dev/icons";
|
|
3
|
+
import { NiceUpload as en, NiceTextInput as Z, NiceCardGroup as Yn, NiceEmpty as Dt, NiceButton as U, NiceSegmentedControl as Un, NiceTextArea as on, NiceToggle as Ze, NiceAvatarGroup as Nn, NiceAvatar as Ve, NiceBadge as ae, NiceSelect as ze, NiceAmountBreakdown as Et, NiceTabs as Ot, NiceNumericInput as dn, NiceCollapse as Bt, NiceHtmlEditor as Yt, NiceProgress as Ut } from "@nice2dev/ui";
|
|
4
4
|
import { useNiceTranslation as J, NiceIcon as se, useControllableState as Vt } from "@nice2dev/ui-core";
|
|
5
|
-
import
|
|
6
|
-
function Ft(
|
|
7
|
-
return
|
|
5
|
+
import Re, { useState as D, useRef as ye, useCallback as j, forwardRef as te, useMemo as F, useEffect as Fe } from "react";
|
|
6
|
+
function Ft(a) {
|
|
7
|
+
return a.map((i, r) => ({ item: i, index: r, key: i.order ?? r })).sort((i, r) => i.key - r.key || i.index - r.index).map((i) => i.item);
|
|
8
8
|
}
|
|
9
|
-
function bn(
|
|
9
|
+
function bn(a, i, r) {
|
|
10
10
|
if (i === r)
|
|
11
|
-
return [...
|
|
12
|
-
if (i < 0 || i >=
|
|
13
|
-
return [...
|
|
14
|
-
if (r < 0 || r >=
|
|
15
|
-
return [...
|
|
16
|
-
const n = [...
|
|
11
|
+
return [...a];
|
|
12
|
+
if (i < 0 || i >= a.length)
|
|
13
|
+
return [...a];
|
|
14
|
+
if (r < 0 || r >= a.length)
|
|
15
|
+
return [...a];
|
|
16
|
+
const n = [...a], [t] = n.splice(i, 1);
|
|
17
17
|
return n.splice(r, 0, t), n;
|
|
18
18
|
}
|
|
19
|
-
function Vn(
|
|
20
|
-
const { items: i, onReorder: r, disabled: n = !1 } =
|
|
21
|
-
(
|
|
22
|
-
const k = m(
|
|
19
|
+
function Vn(a) {
|
|
20
|
+
const { items: i, onReorder: r, disabled: n = !1 } = a, [t, d] = D(null), [o, u] = D(null), [_, c] = D(!1), l = ye(null), m = j((g) => i.findIndex((P) => P.id === g), [i]), h = j(
|
|
21
|
+
(g, P) => {
|
|
22
|
+
const k = m(g), T = m(P);
|
|
23
23
|
k < 0 || T < 0 || k === T || r == null || r(bn([...i], k, T).map((f) => f.id));
|
|
24
24
|
},
|
|
25
25
|
[i, m, r]
|
|
26
26
|
), z = j(() => {
|
|
27
27
|
d(null), u(null), c(!1), l.current = null;
|
|
28
|
-
}, []),
|
|
29
|
-
(
|
|
28
|
+
}, []), v = j(
|
|
29
|
+
(g, P) => ({
|
|
30
30
|
role: "button",
|
|
31
31
|
// Explicitly off: this is a pointer-driven control, and leaving the
|
|
32
32
|
// native HTML5 drag enabled would fight it on desktop.
|
|
33
33
|
draggable: !1,
|
|
34
34
|
tabIndex: n ? -1 : 0,
|
|
35
|
-
"aria-grabbed": t ===
|
|
35
|
+
"aria-grabbed": t === g,
|
|
36
36
|
onPointerDown: (k) => {
|
|
37
37
|
var p, A;
|
|
38
38
|
if (n || k.button !== 0 && k.pointerType === "mouse")
|
|
39
39
|
return;
|
|
40
|
-
(A = (p = k.currentTarget).setPointerCapture) == null || A.call(p, k.pointerId), d(
|
|
40
|
+
(A = (p = k.currentTarget).setPointerCapture) == null || A.call(p, k.pointerId), d(g), c(!0), l.current = i.map((y) => y.id);
|
|
41
41
|
const T = () => {
|
|
42
42
|
window.removeEventListener("pointerup", T), window.removeEventListener("pointercancel", f), c(!1), d(null), u(null);
|
|
43
43
|
}, f = () => {
|
|
@@ -46,37 +46,37 @@ function Vn(s) {
|
|
|
46
46
|
window.addEventListener("pointerup", T), window.addEventListener("pointercancel", f);
|
|
47
47
|
},
|
|
48
48
|
onPointerEnter: () => {
|
|
49
|
-
n || !t || t ===
|
|
49
|
+
n || !t || t === g || (u(g), h(t, g));
|
|
50
50
|
},
|
|
51
51
|
onKeyDown: (k) => {
|
|
52
52
|
if (n)
|
|
53
53
|
return;
|
|
54
54
|
if (k.key === " " || k.key === "Enter") {
|
|
55
|
-
k.preventDefault(), t ===
|
|
55
|
+
k.preventDefault(), t === g ? z() : (d(g), l.current = i.map((y) => y.id));
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
if (k.key === "Escape" && t ===
|
|
58
|
+
if (k.key === "Escape" && t === g) {
|
|
59
59
|
k.preventDefault(), l.current && (r == null || r(l.current)), z();
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
if (t !==
|
|
62
|
+
if (t !== g)
|
|
63
63
|
return;
|
|
64
64
|
const f = k.key === "ArrowLeft" || k.key === "ArrowUp" ? -1 : k.key === "ArrowRight" || k.key === "ArrowDown" ? 1 : 0;
|
|
65
65
|
if (f === 0)
|
|
66
66
|
return;
|
|
67
67
|
k.preventDefault();
|
|
68
|
-
const p = m(
|
|
68
|
+
const p = m(g), A = p + f;
|
|
69
69
|
A < 0 || A >= i.length || r == null || r(bn([...i], p, A).map((y) => y.id));
|
|
70
70
|
},
|
|
71
71
|
...P ? { "aria-label": P } : {}
|
|
72
72
|
}),
|
|
73
73
|
[t, h, n, z, m, i, r]
|
|
74
74
|
);
|
|
75
|
-
return { activeId: t, overId: o, getHandleProps:
|
|
75
|
+
return { activeId: t, overId: o, getHandleProps: v, dragging: _ };
|
|
76
76
|
}
|
|
77
|
-
const Xt = ({ item:
|
|
78
|
-
const { t: i } = J(), [r, n] =
|
|
79
|
-
return
|
|
77
|
+
const Xt = ({ item: a }) => {
|
|
78
|
+
const { t: i } = J(), [r, n] = D(!1), t = a.thumbnailUrl ?? a.url;
|
|
79
|
+
return a.type === "video" ? /* @__PURE__ */ e("div", { className: "nice-event-media__video-thumb", children: /* @__PURE__ */ e(Ke, { size: 26 }) }) : r || !t ? /* @__PURE__ */ e(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
className: "nice-event-media__broken",
|
|
@@ -90,7 +90,7 @@ const Xt = ({ item: s }) => {
|
|
|
90
90
|
"img",
|
|
91
91
|
{
|
|
92
92
|
src: t,
|
|
93
|
-
alt:
|
|
93
|
+
alt: a.caption ?? "",
|
|
94
94
|
className: "nice-event-media__thumb",
|
|
95
95
|
loading: "lazy",
|
|
96
96
|
onError: () => n(!0)
|
|
@@ -110,24 +110,23 @@ const Xt = ({ item: s }) => {
|
|
|
110
110
|
typeFilter: m = "all",
|
|
111
111
|
onReorder: h,
|
|
112
112
|
className: z,
|
|
113
|
-
style:
|
|
114
|
-
} = i, [
|
|
113
|
+
style: v
|
|
114
|
+
} = i, [g, P] = D(""), k = F(() => Ft(t), [t]), T = F(() => m === "all" ? k : k.filter((M) => M.type === m), [k, m]), f = !!h && m === "all", p = Vn({ items: k, onReorder: h, disabled: !f }), A = (M) => {
|
|
115
115
|
const w = M[0];
|
|
116
|
-
!w || !d || (d(w,
|
|
116
|
+
!w || !d || (d(w, g.trim() || void 0), P(""));
|
|
117
117
|
}, y = c === "list";
|
|
118
|
-
return /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ s(
|
|
119
119
|
"div",
|
|
120
120
|
{
|
|
121
121
|
ref: r,
|
|
122
122
|
className: `nice-event-media nice-event-media--${c} ${z ?? ""}`,
|
|
123
|
-
style:
|
|
123
|
+
style: v,
|
|
124
124
|
children: [
|
|
125
|
-
/* @__PURE__ */ e("div", { className: "nice-event-media__header", children: /* @__PURE__ */
|
|
126
|
-
"
|
|
127
|
-
T.length
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
l && d && /* @__PURE__ */ a("div", { className: "nice-event-media__upload", children: [
|
|
125
|
+
/* @__PURE__ */ e("div", { className: "nice-event-media__header", children: /* @__PURE__ */ e("h3", { children: n("eventMedia.media", "Media ({filtered})").replace(
|
|
126
|
+
"{filtered}",
|
|
127
|
+
String(T.length)
|
|
128
|
+
) }) }),
|
|
129
|
+
l && d && /* @__PURE__ */ s("div", { className: "nice-event-media__upload", children: [
|
|
131
130
|
/* @__PURE__ */ e(
|
|
132
131
|
en,
|
|
133
132
|
{
|
|
@@ -140,14 +139,14 @@ const Xt = ({ item: s }) => {
|
|
|
140
139
|
/* @__PURE__ */ e(
|
|
141
140
|
Z,
|
|
142
141
|
{
|
|
143
|
-
value:
|
|
142
|
+
value: g,
|
|
144
143
|
onChange: P,
|
|
145
144
|
placeholder: n("eventMedia.addACaption", "Add a caption…")
|
|
146
145
|
}
|
|
147
146
|
)
|
|
148
147
|
] }),
|
|
149
148
|
T.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-media__empty", children: n("eventMedia.noMediaYet", "No media yet.") }) : /* @__PURE__ */ e(
|
|
150
|
-
|
|
149
|
+
Yn,
|
|
151
150
|
{
|
|
152
151
|
columns: y ? 1 : void 0,
|
|
153
152
|
minColumnWidth: 200,
|
|
@@ -161,13 +160,13 @@ const Xt = ({ item: s }) => {
|
|
|
161
160
|
M.caption ?? n("eventMedia.itemN", "item {n}").replace("{n}", String(w + 1))
|
|
162
161
|
)
|
|
163
162
|
) : null;
|
|
164
|
-
return /* @__PURE__ */
|
|
163
|
+
return /* @__PURE__ */ s(
|
|
165
164
|
"div",
|
|
166
165
|
{
|
|
167
166
|
className: `nice-event-media__card${y ? " nice-event-media__card--row" : ""}${p.activeId === M.id ? " nice-event-media__card--dragging" : ""}`,
|
|
168
167
|
onClick: () => _ == null ? void 0 : _(M),
|
|
169
|
-
onKeyDown: (
|
|
170
|
-
_ &&
|
|
168
|
+
onKeyDown: (I) => {
|
|
169
|
+
_ && I.target === I.currentTarget && (I.key === "Enter" || I.key === " ") && (I.preventDefault(), _(M));
|
|
171
170
|
},
|
|
172
171
|
onPointerEnter: N == null ? void 0 : N.onPointerEnter,
|
|
173
172
|
role: _ ? "button" : void 0,
|
|
@@ -184,22 +183,22 @@ const Xt = ({ item: s }) => {
|
|
|
184
183
|
draggable: N.draggable,
|
|
185
184
|
onPointerDown: N.onPointerDown,
|
|
186
185
|
onKeyDown: N.onKeyDown,
|
|
187
|
-
onClick: (
|
|
186
|
+
onClick: (I) => I.stopPropagation(),
|
|
188
187
|
children: /* @__PURE__ */ e(Tn, { size: 14 })
|
|
189
188
|
}
|
|
190
189
|
),
|
|
191
190
|
/* @__PURE__ */ e(Xt, { item: M }),
|
|
192
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ s("div", { className: "nice-event-media__body", children: [
|
|
193
192
|
M.caption && /* @__PURE__ */ e("span", { className: "nice-event-media__caption", children: M.caption }),
|
|
194
193
|
M.uploadedByName && /* @__PURE__ */ e("span", { className: "nice-event-media__uploader", children: M.uploadedByName }),
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
u && /* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ s("div", { className: "nice-event-media__actions", children: [
|
|
195
|
+
u && /* @__PURE__ */ s(
|
|
197
196
|
"button",
|
|
198
197
|
{
|
|
199
198
|
type: "button",
|
|
200
199
|
className: "nice-event-media__action",
|
|
201
|
-
onClick: (
|
|
202
|
-
|
|
200
|
+
onClick: (I) => {
|
|
201
|
+
I.stopPropagation(), u(M.id);
|
|
203
202
|
},
|
|
204
203
|
"aria-label": n("eventMedia.like", "Like"),
|
|
205
204
|
children: [
|
|
@@ -214,11 +213,11 @@ const Xt = ({ item: s }) => {
|
|
|
214
213
|
{
|
|
215
214
|
type: "button",
|
|
216
215
|
className: "nice-event-media__action nice-event-media__action--danger",
|
|
217
|
-
onClick: (
|
|
218
|
-
|
|
216
|
+
onClick: (I) => {
|
|
217
|
+
I.stopPropagation(), o(M.id);
|
|
219
218
|
},
|
|
220
219
|
"aria-label": n("eventMedia.delete", "Delete"),
|
|
221
|
-
children: /* @__PURE__ */ e(
|
|
220
|
+
children: /* @__PURE__ */ e(De, { size: 15 })
|
|
222
221
|
}
|
|
223
222
|
)
|
|
224
223
|
] })
|
|
@@ -235,16 +234,16 @@ const Xt = ({ item: s }) => {
|
|
|
235
234
|
);
|
|
236
235
|
}
|
|
237
236
|
), Ne = ({
|
|
238
|
-
title:
|
|
237
|
+
title: a,
|
|
239
238
|
description: i,
|
|
240
239
|
icon: r,
|
|
241
240
|
action: n,
|
|
242
241
|
className: t
|
|
243
242
|
}) => /* @__PURE__ */ e(
|
|
244
|
-
|
|
243
|
+
Dt,
|
|
245
244
|
{
|
|
246
245
|
size: "sm",
|
|
247
|
-
title:
|
|
246
|
+
title: a,
|
|
248
247
|
description: i,
|
|
249
248
|
icon: r,
|
|
250
249
|
action: n,
|
|
@@ -263,27 +262,27 @@ const Xt = ({ item: s }) => {
|
|
|
263
262
|
previewMode: m = !1,
|
|
264
263
|
transition: h = "fade",
|
|
265
264
|
defaultDurationMs: z = 3e3,
|
|
266
|
-
autoPlay:
|
|
267
|
-
disabled:
|
|
265
|
+
autoPlay: v = !0,
|
|
266
|
+
disabled: g = !1,
|
|
268
267
|
readOnly: P = !1,
|
|
269
268
|
size: k = "md",
|
|
270
269
|
className: T,
|
|
271
270
|
style: f
|
|
272
|
-
} = i, [p, A] =
|
|
271
|
+
} = i, [p, A] = D(0), [y, M] = D(null), [w, N] = D(""), I = g || P, B = !!o && !I, X = Vn({ items: t, onReorder: o, disabled: !B }), E = t.length > 0 ? Math.min(p, t.length - 1) : 0, R = t[E], W = (R == null ? void 0 : R.durationMs) ?? z;
|
|
273
272
|
Fe(() => {
|
|
274
|
-
if (!m || !
|
|
273
|
+
if (!m || !v || t.length < 2)
|
|
275
274
|
return;
|
|
276
|
-
const
|
|
275
|
+
const L = window.setTimeout(
|
|
277
276
|
() => A((K) => (K + 1) % t.length),
|
|
278
277
|
Math.max(250, W)
|
|
279
278
|
);
|
|
280
|
-
return () => window.clearTimeout(
|
|
281
|
-
}, [m,
|
|
282
|
-
const
|
|
283
|
-
() => t.reduce((
|
|
279
|
+
return () => window.clearTimeout(L);
|
|
280
|
+
}, [m, v, t.length, E, W]);
|
|
281
|
+
const C = F(
|
|
282
|
+
() => t.reduce((L, K) => L + (K.durationMs ?? z), 0),
|
|
284
283
|
[t, z]
|
|
285
|
-
), b = (
|
|
286
|
-
c == null || c(
|
|
284
|
+
), b = (L) => {
|
|
285
|
+
c == null || c(L, w), M(null), N("");
|
|
287
286
|
};
|
|
288
287
|
return t.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-media-collage ${T ?? ""}`, style: f, children: /* @__PURE__ */ e(
|
|
289
288
|
Ne,
|
|
@@ -294,46 +293,46 @@ const Xt = ({ item: s }) => {
|
|
|
294
293
|
"mediaCollage.addPhotosOrVideoTo",
|
|
295
294
|
"Add photos or video to start arranging them."
|
|
296
295
|
),
|
|
297
|
-
action: u && !
|
|
296
|
+
action: u && !I ? /* @__PURE__ */ e(en, { accept: "image/*,video/*", multiple: !0, onFilesSelected: u }) : void 0
|
|
298
297
|
}
|
|
299
|
-
) }) : m ? /* @__PURE__ */
|
|
298
|
+
) }) : m ? /* @__PURE__ */ s(
|
|
300
299
|
"div",
|
|
301
300
|
{
|
|
302
301
|
ref: r,
|
|
303
302
|
className: `nice-media-collage nice-media-collage--preview nice-media-collage--${h} ${T ?? ""}`,
|
|
304
303
|
style: f,
|
|
305
304
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
(
|
|
305
|
+
/* @__PURE__ */ s("div", { className: "nice-media-collage__stage", "aria-live": "polite", children: [
|
|
306
|
+
(R == null ? void 0 : R.type) === "video" ? /* @__PURE__ */ e(
|
|
308
307
|
"video",
|
|
309
308
|
{
|
|
310
309
|
className: "nice-media-collage__slide",
|
|
311
|
-
src:
|
|
310
|
+
src: R.mediaUrl,
|
|
312
311
|
controls: !0
|
|
313
312
|
},
|
|
314
|
-
|
|
313
|
+
R.id
|
|
315
314
|
) : /* @__PURE__ */ e(
|
|
316
315
|
"img",
|
|
317
316
|
{
|
|
318
317
|
className: "nice-media-collage__slide",
|
|
319
|
-
src:
|
|
320
|
-
alt: (
|
|
318
|
+
src: R == null ? void 0 : R.mediaUrl,
|
|
319
|
+
alt: (R == null ? void 0 : R.caption) ?? ""
|
|
321
320
|
},
|
|
322
|
-
|
|
321
|
+
R == null ? void 0 : R.id
|
|
323
322
|
),
|
|
324
|
-
(
|
|
323
|
+
(R == null ? void 0 : R.caption) && /* @__PURE__ */ e("p", { className: "nice-media-collage__slide-caption", children: R.caption })
|
|
325
324
|
] }),
|
|
326
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ s("div", { className: "nice-media-collage__playbar", children: [
|
|
327
326
|
/* @__PURE__ */ e(
|
|
328
327
|
U,
|
|
329
328
|
{
|
|
330
329
|
size: "sm",
|
|
331
330
|
variant: "ghost",
|
|
332
|
-
onClick: () => A((
|
|
331
|
+
onClick: () => A((L) => (L - 1 + t.length) % t.length),
|
|
333
332
|
children: n("mediaCollage.previous", "Previous")
|
|
334
333
|
}
|
|
335
334
|
),
|
|
336
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ s("span", { className: "nice-media-collage__counter", children: [
|
|
337
336
|
E + 1,
|
|
338
337
|
" / ",
|
|
339
338
|
t.length
|
|
@@ -343,21 +342,21 @@ const Xt = ({ item: s }) => {
|
|
|
343
342
|
{
|
|
344
343
|
size: "sm",
|
|
345
344
|
variant: "ghost",
|
|
346
|
-
onClick: () => A((
|
|
345
|
+
onClick: () => A((L) => (L + 1) % t.length),
|
|
347
346
|
children: n("mediaCollage.next", "Next")
|
|
348
347
|
}
|
|
349
348
|
)
|
|
350
349
|
] })
|
|
351
350
|
]
|
|
352
351
|
}
|
|
353
|
-
) : /* @__PURE__ */
|
|
352
|
+
) : /* @__PURE__ */ s(
|
|
354
353
|
"div",
|
|
355
354
|
{
|
|
356
355
|
ref: r,
|
|
357
356
|
className: `nice-media-collage nice-media-collage--${d} nice-media-collage--${k} ${T ?? ""}`,
|
|
358
357
|
style: f,
|
|
359
358
|
children: [
|
|
360
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ s("div", { className: "nice-media-collage__toolbar", children: [
|
|
361
360
|
/* @__PURE__ */ e(
|
|
362
361
|
Un,
|
|
363
362
|
{
|
|
@@ -371,15 +370,8 @@ const Xt = ({ item: s }) => {
|
|
|
371
370
|
]
|
|
372
371
|
}
|
|
373
372
|
),
|
|
374
|
-
/* @__PURE__ */
|
|
375
|
-
|
|
376
|
-
" item",
|
|
377
|
-
t.length === 1 ? "" : "s",
|
|
378
|
-
" · ",
|
|
379
|
-
Math.round(S / 1e3),
|
|
380
|
-
"s"
|
|
381
|
-
] }),
|
|
382
|
-
u && !x && /* @__PURE__ */ e(
|
|
373
|
+
/* @__PURE__ */ e("span", { className: "nice-media-collage__duration", children: t.length === 1 ? n("mediaCollage.itemsOne", "{items} item · {totalDuration}s").replace("{items}", String(t.length)).replace("{totalDuration}", String(Math.round(C / 1e3))) : n("mediaCollage.itemsMany", "{items} items · {totalDuration}s").replace("{items}", String(t.length)).replace("{totalDuration}", String(Math.round(C / 1e3))) }),
|
|
374
|
+
u && !I && /* @__PURE__ */ e(
|
|
383
375
|
en,
|
|
384
376
|
{
|
|
385
377
|
accept: "image/*,video/*",
|
|
@@ -395,18 +387,18 @@ const Xt = ({ item: s }) => {
|
|
|
395
387
|
className: "nice-media-collage__tiles",
|
|
396
388
|
"aria-label": n("mediaCollage.collageOrder", "Collage order"),
|
|
397
389
|
"aria-busy": X.dragging,
|
|
398
|
-
children: t.map((
|
|
399
|
-
const q =
|
|
400
|
-
|
|
390
|
+
children: t.map((L, K) => {
|
|
391
|
+
const q = B ? X.getHandleProps(
|
|
392
|
+
L.id,
|
|
401
393
|
n("mediaCollage.moveItem", "Move {name}").replace(
|
|
402
394
|
"{name}",
|
|
403
|
-
|
|
395
|
+
L.caption ?? n("mediaCollage.itemN", "item {n}").replace("{n}", String(K + 1))
|
|
404
396
|
)
|
|
405
397
|
) : null;
|
|
406
|
-
return /* @__PURE__ */
|
|
398
|
+
return /* @__PURE__ */ s(
|
|
407
399
|
"li",
|
|
408
400
|
{
|
|
409
|
-
className: `nice-media-collage__tile${X.activeId ===
|
|
401
|
+
className: `nice-media-collage__tile${X.activeId === L.id ? " nice-media-collage__tile--active" : ""}${X.overId === L.id ? " nice-media-collage__tile--over" : ""}`,
|
|
410
402
|
onPointerEnter: q == null ? void 0 : q.onPointerEnter,
|
|
411
403
|
children: [
|
|
412
404
|
/* @__PURE__ */ e("span", { className: "nice-media-collage__index", "aria-hidden": "true", children: K + 1 }),
|
|
@@ -415,20 +407,20 @@ const Xt = ({ item: s }) => {
|
|
|
415
407
|
{
|
|
416
408
|
type: "button",
|
|
417
409
|
className: "nice-media-collage__thumb-button",
|
|
418
|
-
onClick: () => l == null ? void 0 : l(
|
|
410
|
+
onClick: () => l == null ? void 0 : l(L),
|
|
419
411
|
disabled: !l,
|
|
420
|
-
children:
|
|
412
|
+
children: L.type === "video" ? /* @__PURE__ */ e("span", { className: "nice-media-collage__video-thumb", children: /* @__PURE__ */ e(Ke, { size: 22 }) }) : /* @__PURE__ */ e(
|
|
421
413
|
"img",
|
|
422
414
|
{
|
|
423
415
|
className: "nice-media-collage__thumb",
|
|
424
|
-
src:
|
|
425
|
-
alt:
|
|
416
|
+
src: L.mediaUrl,
|
|
417
|
+
alt: L.caption ?? "",
|
|
426
418
|
loading: "lazy"
|
|
427
419
|
}
|
|
428
420
|
)
|
|
429
421
|
}
|
|
430
422
|
),
|
|
431
|
-
y ===
|
|
423
|
+
y === L.id ? /* @__PURE__ */ e(
|
|
432
424
|
Z,
|
|
433
425
|
{
|
|
434
426
|
value: w,
|
|
@@ -436,9 +428,9 @@ const Xt = ({ item: s }) => {
|
|
|
436
428
|
placeholder: n("mediaCollage.caption", "Caption"),
|
|
437
429
|
autoFocus: !0,
|
|
438
430
|
size: "sm",
|
|
439
|
-
onBlur: () => b(
|
|
440
|
-
onKeyDown: (
|
|
441
|
-
|
|
431
|
+
onBlur: () => b(L.id),
|
|
432
|
+
onKeyDown: (x) => {
|
|
433
|
+
x.key === "Enter" && b(L.id), x.key === "Escape" && M(null);
|
|
442
434
|
}
|
|
443
435
|
}
|
|
444
436
|
) : /* @__PURE__ */ e(
|
|
@@ -446,14 +438,14 @@ const Xt = ({ item: s }) => {
|
|
|
446
438
|
{
|
|
447
439
|
type: "button",
|
|
448
440
|
className: "nice-media-collage__caption",
|
|
449
|
-
disabled: !c ||
|
|
441
|
+
disabled: !c || I,
|
|
450
442
|
onClick: () => {
|
|
451
|
-
M(
|
|
443
|
+
M(L.id), N(L.caption ?? "");
|
|
452
444
|
},
|
|
453
|
-
children:
|
|
445
|
+
children: L.caption || /* @__PURE__ */ e("em", { children: n("mediaCollage.addACaption", "Add a caption") })
|
|
454
446
|
}
|
|
455
447
|
),
|
|
456
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ s("div", { className: "nice-media-collage__tile-actions", children: [
|
|
457
449
|
q && /* @__PURE__ */ e(
|
|
458
450
|
"span",
|
|
459
451
|
{
|
|
@@ -475,22 +467,22 @@ const Xt = ({ item: s }) => {
|
|
|
475
467
|
variant: "ghost",
|
|
476
468
|
ariaLabel: n("mediaCollage.removeItem", "Remove {name}").replace(
|
|
477
469
|
"{name}",
|
|
478
|
-
|
|
470
|
+
L.caption ?? n("mediaCollage.itemN", "item {n}").replace("{n}", String(K + 1))
|
|
479
471
|
),
|
|
480
|
-
disabled:
|
|
481
|
-
onClick: () => _(
|
|
482
|
-
children: /* @__PURE__ */ e(
|
|
472
|
+
disabled: g,
|
|
473
|
+
onClick: () => _(L.id),
|
|
474
|
+
children: /* @__PURE__ */ e(De, { size: 14 })
|
|
483
475
|
}
|
|
484
476
|
)
|
|
485
477
|
] })
|
|
486
478
|
]
|
|
487
479
|
},
|
|
488
|
-
|
|
480
|
+
L.id
|
|
489
481
|
);
|
|
490
482
|
})
|
|
491
483
|
}
|
|
492
484
|
),
|
|
493
|
-
u && !
|
|
485
|
+
u && !I && t.length > 0 && /* @__PURE__ */ s("p", { className: "nice-media-collage__hint", children: [
|
|
494
486
|
/* @__PURE__ */ e(an, { size: 12 }),
|
|
495
487
|
" ",
|
|
496
488
|
n(
|
|
@@ -503,8 +495,8 @@ const Xt = ({ item: s }) => {
|
|
|
503
495
|
);
|
|
504
496
|
}
|
|
505
497
|
);
|
|
506
|
-
function
|
|
507
|
-
const i =
|
|
498
|
+
function Be(a) {
|
|
499
|
+
const i = a.toLowerCase();
|
|
508
500
|
return ["active", "live", "published", "completed", "confirmed"].includes(i) ? "success" : ["cancelled", "canceled", "rejected", "failed"].includes(i) ? "error" : ["scheduled", "pending", "planning"].includes(i) ? "info" : ["draft", "archived"].includes(i) ? "secondary" : "warning";
|
|
509
501
|
}
|
|
510
502
|
const Gt = {
|
|
@@ -537,8 +529,8 @@ const Gt = {
|
|
|
537
529
|
documents: m = [],
|
|
538
530
|
displayMode: h = "normal",
|
|
539
531
|
tabs: z,
|
|
540
|
-
activeTab:
|
|
541
|
-
onTabChange:
|
|
532
|
+
activeTab: v,
|
|
533
|
+
onTabChange: g,
|
|
542
534
|
tabsIconOnly: P = !0,
|
|
543
535
|
tabsCentered: k = "auto",
|
|
544
536
|
countLocation: T = "bottom",
|
|
@@ -549,22 +541,22 @@ const Gt = {
|
|
|
549
541
|
showTasks: M = !0,
|
|
550
542
|
showSurveys: w = !0,
|
|
551
543
|
showVendors: N = !0,
|
|
552
|
-
showBudget:
|
|
553
|
-
showDocuments:
|
|
544
|
+
showBudget: I = !0,
|
|
545
|
+
showDocuments: B = !0,
|
|
554
546
|
showSettings: X = !0,
|
|
555
547
|
editable: E = !1,
|
|
556
|
-
onSave:
|
|
548
|
+
onSave: R,
|
|
557
549
|
onPublish: W,
|
|
558
|
-
onShare:
|
|
550
|
+
onShare: C,
|
|
559
551
|
onExport: b,
|
|
560
|
-
onUpdateEvent:
|
|
552
|
+
onUpdateEvent: L,
|
|
561
553
|
onUpdateLocation: K,
|
|
562
554
|
onAddSurvey: q,
|
|
563
|
-
onSurveyRespond:
|
|
555
|
+
onSurveyRespond: x,
|
|
564
556
|
onAddBilling: V,
|
|
565
557
|
className: G,
|
|
566
558
|
style: ee
|
|
567
|
-
} = i, [
|
|
559
|
+
} = i, [Y, ie] = D(t.title), [Q, be] = D(t.description ?? ""), [oe, he] = D(t.startDate ?? ""), [ke, Ee] = D(t.endDate ?? ""), [we, ge] = D(((hn = t.location) == null ? void 0 : hn.name) ?? ""), [Se, He] = D(((gn = t.location) == null ? void 0 : gn.address) ?? ""), [ve, ue] = D(((vn = t.location) == null ? void 0 : vn.virtualUrl) ?? ""), [le, Te] = D(((fn = t.location) == null ? void 0 : fn.isVirtual) ?? !1), [fe, Me] = D(""), [_e, Qe] = D("single"), [Ce, xe] = D(""), [me, Le] = D(""), [Ie, $] = D(""), [O, H] = D("PLN"), ne = {
|
|
568
560
|
details: f,
|
|
569
561
|
location: p,
|
|
570
562
|
schedule: A,
|
|
@@ -572,52 +564,52 @@ const Gt = {
|
|
|
572
564
|
tasks: M,
|
|
573
565
|
surveys: w,
|
|
574
566
|
vendors: N,
|
|
575
|
-
budget:
|
|
576
|
-
documents:
|
|
567
|
+
budget: I,
|
|
568
|
+
documents: B,
|
|
577
569
|
settings: X
|
|
578
|
-
}, pe = (z ?? Gt[h]).filter((
|
|
579
|
-
(
|
|
580
|
-
const de =
|
|
581
|
-
|
|
570
|
+
}, pe = (z ?? Gt[h]).filter((S) => ne[S] !== !1), [Oe, Gn] = D(pe[0] ?? "details"), Kn = v ?? Oe, jn = j(
|
|
571
|
+
(S) => {
|
|
572
|
+
const de = S;
|
|
573
|
+
v === void 0 && Gn(de), g == null || g(de);
|
|
582
574
|
},
|
|
583
|
-
[
|
|
575
|
+
[v, g]
|
|
584
576
|
), Hn = j(() => {
|
|
585
|
-
|
|
586
|
-
title:
|
|
577
|
+
L == null || L({
|
|
578
|
+
title: Y,
|
|
587
579
|
description: Q || void 0,
|
|
588
580
|
startDate: oe || void 0,
|
|
589
581
|
endDate: ke || void 0
|
|
590
582
|
});
|
|
591
|
-
}, [
|
|
583
|
+
}, [Y, Q, oe, ke, L]), Qn = j(() => {
|
|
592
584
|
K == null || K({
|
|
593
585
|
name: we,
|
|
594
|
-
address:
|
|
586
|
+
address: Se || void 0,
|
|
595
587
|
virtualUrl: ve || void 0,
|
|
596
588
|
isVirtual: le
|
|
597
589
|
});
|
|
598
|
-
}, [we,
|
|
590
|
+
}, [we, Se, ve, le, K]), Zn = j(() => {
|
|
599
591
|
if (!fe.trim() || !q)
|
|
600
592
|
return;
|
|
601
|
-
const
|
|
602
|
-
q(fe.trim(), _e,
|
|
603
|
-
}, [fe, _e,
|
|
593
|
+
const S = Ce.split(",").map((de) => de.trim()).filter(Boolean);
|
|
594
|
+
q(fe.trim(), _e, S.length > 0 ? S : void 0), Me(""), xe("");
|
|
595
|
+
}, [fe, _e, Ce, q]), Jn = j(() => {
|
|
604
596
|
!me.trim() || !V || (V({
|
|
605
597
|
label: me.trim(),
|
|
606
|
-
amount: parseFloat(
|
|
598
|
+
amount: parseFloat(Ie) || 0,
|
|
607
599
|
currency: O
|
|
608
|
-
}),
|
|
609
|
-
}, [me,
|
|
610
|
-
() => u.map((
|
|
611
|
-
label:
|
|
612
|
-
amount:
|
|
600
|
+
}), Le(""), $(""));
|
|
601
|
+
}, [me, Ie, O, V]), et = F(
|
|
602
|
+
() => u.map((S) => ({
|
|
603
|
+
label: S.label,
|
|
604
|
+
amount: S.amount
|
|
613
605
|
})),
|
|
614
606
|
[u]
|
|
615
|
-
), nt = F(() => u.reduce((
|
|
607
|
+
), nt = F(() => u.reduce((S, de) => S + de.amount, 0), [u]), tt = ((_n = u[0]) == null ? void 0 : _n.currency) ?? "PLN", it = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
616
608
|
/* @__PURE__ */ e(
|
|
617
609
|
Z,
|
|
618
610
|
{
|
|
619
611
|
label: n("eventPlanning.title", "Title"),
|
|
620
|
-
value:
|
|
612
|
+
value: Y,
|
|
621
613
|
onChange: ie,
|
|
622
614
|
readOnly: !E
|
|
623
615
|
}
|
|
@@ -632,8 +624,8 @@ const Gt = {
|
|
|
632
624
|
rows: 3
|
|
633
625
|
}
|
|
634
626
|
),
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
-
/* @__PURE__ */
|
|
627
|
+
/* @__PURE__ */ s("div", { className: "nice-event-planning__row", children: [
|
|
628
|
+
/* @__PURE__ */ s("label", { className: "nice-field", children: [
|
|
637
629
|
/* @__PURE__ */ e("span", { className: "nice-field__label", children: n("eventPlanning.start", "Start") }),
|
|
638
630
|
/* @__PURE__ */ e(
|
|
639
631
|
"input",
|
|
@@ -641,20 +633,20 @@ const Gt = {
|
|
|
641
633
|
className: "nice-input",
|
|
642
634
|
type: "datetime-local",
|
|
643
635
|
value: oe,
|
|
644
|
-
onChange: (
|
|
636
|
+
onChange: (S) => he(S.target.value),
|
|
645
637
|
readOnly: !E
|
|
646
638
|
}
|
|
647
639
|
)
|
|
648
640
|
] }),
|
|
649
|
-
/* @__PURE__ */
|
|
650
|
-
/* @__PURE__ */ e("span", { className: "nice-field__label", children: "End" }),
|
|
641
|
+
/* @__PURE__ */ s("label", { className: "nice-field", children: [
|
|
642
|
+
/* @__PURE__ */ e("span", { className: "nice-field__label", children: n("eventPlanning.end", "End") }),
|
|
651
643
|
/* @__PURE__ */ e(
|
|
652
644
|
"input",
|
|
653
645
|
{
|
|
654
646
|
className: "nice-input",
|
|
655
647
|
type: "datetime-local",
|
|
656
648
|
value: ke,
|
|
657
|
-
onChange: (
|
|
649
|
+
onChange: (S) => Ee(S.target.value),
|
|
658
650
|
readOnly: !E
|
|
659
651
|
}
|
|
660
652
|
)
|
|
@@ -669,13 +661,13 @@ const Gt = {
|
|
|
669
661
|
children: n("eventPlanning.saveDetails", "Save details")
|
|
670
662
|
}
|
|
671
663
|
)
|
|
672
|
-
] }), at = /* @__PURE__ */
|
|
664
|
+
] }), at = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
673
665
|
/* @__PURE__ */ e(
|
|
674
666
|
Ze,
|
|
675
667
|
{
|
|
676
668
|
label: n("eventPlanning.virtualEvent", "Virtual event"),
|
|
677
669
|
checked: le,
|
|
678
|
-
onChange:
|
|
670
|
+
onChange: Te,
|
|
679
671
|
disabled: !E
|
|
680
672
|
}
|
|
681
673
|
),
|
|
@@ -700,7 +692,7 @@ const Gt = {
|
|
|
700
692
|
Z,
|
|
701
693
|
{
|
|
702
694
|
label: n("eventPlanning.address", "Address"),
|
|
703
|
-
value:
|
|
695
|
+
value: Se,
|
|
704
696
|
onChange: He,
|
|
705
697
|
readOnly: !E
|
|
706
698
|
}
|
|
@@ -714,49 +706,49 @@ const Gt = {
|
|
|
714
706
|
children: n("eventPlanning.saveLocation", "Save location")
|
|
715
707
|
}
|
|
716
708
|
)
|
|
717
|
-
] }), st = /* @__PURE__ */ e("div", { className: "nice-event-planning__participants", children: d.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noParticipantsYet", "No participants yet.") }) : /* @__PURE__ */
|
|
718
|
-
/* @__PURE__ */ e(Nn, { max: 8, children: d.map((
|
|
719
|
-
/* @__PURE__ */ e("ul", { className: "nice-event-planning__participant-list", children: d.map((
|
|
720
|
-
/* @__PURE__ */ e(Ve, { name:
|
|
721
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__participant-name", children:
|
|
722
|
-
/* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant:
|
|
723
|
-
] },
|
|
724
|
-
] }) }), rt = /* @__PURE__ */
|
|
725
|
-
o.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noSurveysYet", "No surveys yet.") }) : o.map((
|
|
726
|
-
/* @__PURE__ */ e("strong", { children:
|
|
709
|
+
] }), st = /* @__PURE__ */ e("div", { className: "nice-event-planning__participants", children: d.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noParticipantsYet", "No participants yet.") }) : /* @__PURE__ */ s(Ge, { children: [
|
|
710
|
+
/* @__PURE__ */ e(Nn, { max: 8, children: d.map((S) => /* @__PURE__ */ e(Ve, { name: S.name, src: S.avatarUrl }, S.id)) }),
|
|
711
|
+
/* @__PURE__ */ e("ul", { className: "nice-event-planning__participant-list", children: d.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__participant", children: [
|
|
712
|
+
/* @__PURE__ */ e(Ve, { name: S.name, src: S.avatarUrl, size: "sm" }),
|
|
713
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__participant-name", children: S.name }),
|
|
714
|
+
/* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: Be(S.status), children: n(`participantList.status.${S.status}`, S.status) })
|
|
715
|
+
] }, S.id)) })
|
|
716
|
+
] }) }), rt = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
717
|
+
o.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noSurveysYet", "No surveys yet.") }) : o.map((S) => /* @__PURE__ */ s("div", { className: "nice-event-planning__survey", children: [
|
|
718
|
+
/* @__PURE__ */ e("strong", { children: S.question }),
|
|
727
719
|
" ",
|
|
728
|
-
/* @__PURE__ */ e(ae, { size: "xs", outline: !0, variant: "info", children: n(`eventPlanning.surveyType.${
|
|
729
|
-
|
|
720
|
+
/* @__PURE__ */ e(ae, { size: "xs", outline: !0, variant: "info", children: n(`eventPlanning.surveyType.${S.type}`, S.type) }),
|
|
721
|
+
S.options && /* @__PURE__ */ e("div", { className: "nice-event-planning__survey-options", children: S.options.map((de, _t) => /* @__PURE__ */ e(
|
|
730
722
|
U,
|
|
731
723
|
{
|
|
732
724
|
size: "sm",
|
|
733
725
|
variant: "outline",
|
|
734
|
-
onClick: () =>
|
|
726
|
+
onClick: () => x == null ? void 0 : x(S.id, de),
|
|
735
727
|
children: de
|
|
736
728
|
},
|
|
737
729
|
_t
|
|
738
730
|
)) }),
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
] },
|
|
744
|
-
E && q && /* @__PURE__ */
|
|
731
|
+
S.responses && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: n("eventPlanning.responses", "{responses} responses").replace(
|
|
732
|
+
"{responses}",
|
|
733
|
+
String(S.responses.length)
|
|
734
|
+
) })
|
|
735
|
+
] }, S.id)),
|
|
736
|
+
E && q && /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
745
737
|
/* @__PURE__ */ e(
|
|
746
738
|
Z,
|
|
747
739
|
{
|
|
748
740
|
label: n("eventPlanning.newSurveyQuestion", "New survey question"),
|
|
749
741
|
value: fe,
|
|
750
|
-
onChange:
|
|
742
|
+
onChange: Me,
|
|
751
743
|
placeholder: n("eventPlanning.question", "Question")
|
|
752
744
|
}
|
|
753
745
|
),
|
|
754
746
|
/* @__PURE__ */ e(
|
|
755
|
-
|
|
747
|
+
ze,
|
|
756
748
|
{
|
|
757
749
|
label: n("eventPlanning.type", "Type"),
|
|
758
750
|
value: _e,
|
|
759
|
-
onChange: (
|
|
751
|
+
onChange: (S) => Qe(S),
|
|
760
752
|
options: [
|
|
761
753
|
{ value: "single", label: n("eventPlanning.singleChoice", "Single choice") },
|
|
762
754
|
{ value: "multiple", label: n("eventPlanning.multipleChoice", "Multiple choice") },
|
|
@@ -769,8 +761,8 @@ const Gt = {
|
|
|
769
761
|
Z,
|
|
770
762
|
{
|
|
771
763
|
label: n("eventPlanning.optionsCommaSeparated", "Options (comma-separated)"),
|
|
772
|
-
value:
|
|
773
|
-
onChange:
|
|
764
|
+
value: Ce,
|
|
765
|
+
onChange: xe,
|
|
774
766
|
placeholder: n("eventPlanning.yesNoMaybe", "Yes, No, Maybe")
|
|
775
767
|
}
|
|
776
768
|
),
|
|
@@ -785,7 +777,7 @@ const Gt = {
|
|
|
785
777
|
}
|
|
786
778
|
)
|
|
787
779
|
] })
|
|
788
|
-
] }), ct = /* @__PURE__ */
|
|
780
|
+
] }), ct = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
789
781
|
u.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noBillingItemsYet", "No billing items yet.") }) : /* @__PURE__ */ e(
|
|
790
782
|
Et,
|
|
791
783
|
{
|
|
@@ -796,13 +788,13 @@ const Gt = {
|
|
|
796
788
|
currency: tt
|
|
797
789
|
}
|
|
798
790
|
),
|
|
799
|
-
E && V && /* @__PURE__ */
|
|
791
|
+
E && V && /* @__PURE__ */ s("div", { className: "nice-event-planning__row", children: [
|
|
800
792
|
/* @__PURE__ */ e(
|
|
801
793
|
Z,
|
|
802
794
|
{
|
|
803
795
|
label: n("eventPlanning.item", "Item"),
|
|
804
796
|
value: me,
|
|
805
|
-
onChange:
|
|
797
|
+
onChange: Le,
|
|
806
798
|
placeholder: n("eventPlanning.catering", "Catering")
|
|
807
799
|
}
|
|
808
800
|
),
|
|
@@ -810,17 +802,17 @@ const Gt = {
|
|
|
810
802
|
Z,
|
|
811
803
|
{
|
|
812
804
|
label: n("eventPlanning.amount", "Amount"),
|
|
813
|
-
value:
|
|
814
|
-
onChange:
|
|
805
|
+
value: Ie,
|
|
806
|
+
onChange: $,
|
|
815
807
|
placeholder: "0.00"
|
|
816
808
|
}
|
|
817
809
|
),
|
|
818
810
|
/* @__PURE__ */ e(
|
|
819
|
-
|
|
811
|
+
ze,
|
|
820
812
|
{
|
|
821
813
|
label: n("eventPlanning.currency", "Currency"),
|
|
822
814
|
value: O,
|
|
823
|
-
onChange: (
|
|
815
|
+
onChange: (S) => H(S),
|
|
824
816
|
options: ["PLN", "EUR", "USD", "GBP"]
|
|
825
817
|
}
|
|
826
818
|
),
|
|
@@ -831,11 +823,11 @@ const Gt = {
|
|
|
831
823
|
leftIcon: /* @__PURE__ */ e(se, { name: "plus", size: "sm" }),
|
|
832
824
|
onClick: Jn,
|
|
833
825
|
disabled: !me.trim(),
|
|
834
|
-
children: "Add"
|
|
826
|
+
children: n("eventPlanning.add", "Add")
|
|
835
827
|
}
|
|
836
828
|
)
|
|
837
829
|
] })
|
|
838
|
-
] }), lt = /* @__PURE__ */
|
|
830
|
+
] }), lt = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
839
831
|
/* @__PURE__ */ e(
|
|
840
832
|
Ze,
|
|
841
833
|
{
|
|
@@ -854,43 +846,38 @@ const Gt = {
|
|
|
854
846
|
readOnly: !E
|
|
855
847
|
}
|
|
856
848
|
),
|
|
857
|
-
/* @__PURE__ */
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
" · Created ",
|
|
861
|
-
new Date(t.createdAt).toLocaleDateString()
|
|
862
|
-
] })
|
|
863
|
-
] }), ot = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: _.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noAgendaItemsYet", "No agenda items yet.") }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__schedule", children: _.map((C) => /* @__PURE__ */ a("li", { className: "nice-event-planning__schedule-item", children: [
|
|
864
|
-
/* @__PURE__ */ a("span", { className: "nice-event-planning__schedule-time", children: [
|
|
849
|
+
/* @__PURE__ */ e("div", { className: "nice-event-planning__muted", children: n("eventPlanning.hostCreated", "Host: {hostName} · Created {createdAt}").replace("{hostName}", String(t.hostName)).replace("{createdAt}", String(new Date(t.createdAt).toLocaleDateString())) })
|
|
850
|
+
] }), ot = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: _.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noAgendaItemsYet", "No agenda items yet.") }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__schedule", children: _.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__schedule-item", children: [
|
|
851
|
+
/* @__PURE__ */ s("span", { className: "nice-event-planning__schedule-time", children: [
|
|
865
852
|
/* @__PURE__ */ e(se, { name: "clock", size: "sm" }),
|
|
866
|
-
|
|
867
|
-
|
|
853
|
+
S.startTime ?? "",
|
|
854
|
+
S.endTime ? `–${S.endTime}` : ""
|
|
868
855
|
] }),
|
|
869
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__schedule-title", children:
|
|
870
|
-
|
|
871
|
-
] },
|
|
872
|
-
/* @__PURE__ */ e(Ze, { label:
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
] },
|
|
856
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__schedule-title", children: S.title }),
|
|
857
|
+
S.location && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: S.location })
|
|
858
|
+
] }, S.id)) }) }), dt = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: c.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noTasksYet", "No tasks yet.") }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__tasks", children: c.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__task", children: [
|
|
859
|
+
/* @__PURE__ */ e(Ze, { label: S.title, checked: S.done ?? !1, disabled: !E }),
|
|
860
|
+
S.assigneeName && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: "info", children: S.assigneeName }),
|
|
861
|
+
S.dueDate && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: S.dueDate })
|
|
862
|
+
] }, S.id)) }) }), ut = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: l.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noVendorsYet", "No vendors yet.") }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__vendors", children: l.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__vendor", children: [
|
|
876
863
|
/* @__PURE__ */ e(se, { name: "briefcase", size: "sm" }),
|
|
877
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__vendor-name", children:
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
864
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__vendor-name", children: S.name }),
|
|
865
|
+
S.category && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: S.category }),
|
|
866
|
+
S.status && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: Be(S.status), children: n(`eventPlanning.vendorStatus.${S.status}`, S.status) }),
|
|
867
|
+
S.cost != null && /* @__PURE__ */ s("span", { className: "nice-event-planning__vendor-cost", children: [
|
|
868
|
+
S.cost,
|
|
882
869
|
" ",
|
|
883
|
-
|
|
870
|
+
S.currency ?? ""
|
|
884
871
|
] })
|
|
885
|
-
] },
|
|
872
|
+
] }, S.id)) }) }), mt = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: m.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noDocumentsYet", "No documents yet.") }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__documents", children: m.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__document", children: [
|
|
886
873
|
/* @__PURE__ */ e(se, { name: "file", size: "sm" }),
|
|
887
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__document-name", children:
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
874
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__document-name", children: S.name }),
|
|
875
|
+
S.fileType && /* @__PURE__ */ e(ae, { size: "xs", outline: !0, variant: "secondary", children: S.fileType }),
|
|
876
|
+
S.sizeKb != null && /* @__PURE__ */ s("span", { className: "nice-event-planning__muted", children: [
|
|
877
|
+
S.sizeKb,
|
|
891
878
|
" KB"
|
|
892
879
|
] })
|
|
893
|
-
] },
|
|
880
|
+
] }, S.id)) }) }), pt = {
|
|
894
881
|
details: it,
|
|
895
882
|
location: at,
|
|
896
883
|
schedule: ot,
|
|
@@ -920,27 +907,27 @@ const Gt = {
|
|
|
920
907
|
vendors: l.length || void 0,
|
|
921
908
|
budget: u.length || void 0,
|
|
922
909
|
documents: m.length || void 0
|
|
923
|
-
}, vt = pe.map((
|
|
924
|
-
id:
|
|
925
|
-
label:
|
|
926
|
-
icon: /* @__PURE__ */ e(se, { name: ht[
|
|
927
|
-
badge: gt[
|
|
928
|
-
content: pt[
|
|
929
|
-
})), ft = /* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
910
|
+
}, vt = pe.map((S) => ({
|
|
911
|
+
id: S,
|
|
912
|
+
label: S.charAt(0).toUpperCase() + S.slice(1),
|
|
913
|
+
icon: /* @__PURE__ */ e(se, { name: ht[S], size: "sm" }),
|
|
914
|
+
badge: gt[S],
|
|
915
|
+
content: pt[S]
|
|
916
|
+
})), ft = /* @__PURE__ */ s("div", { className: "nice-event-planning__toolbar", children: [
|
|
917
|
+
/* @__PURE__ */ s("div", { className: "nice-event-planning__toolbar-title", children: [
|
|
931
918
|
/* @__PURE__ */ e(se, { name: "calendar", size: "md" }),
|
|
932
919
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__title", children: t.title }),
|
|
933
|
-
/* @__PURE__ */ e(ae, { size: "sm", variant:
|
|
920
|
+
/* @__PURE__ */ e(ae, { size: "sm", variant: Be(t.status), children: n(`eventPlanning.eventStatus.${t.status}`, t.status) })
|
|
934
921
|
] }),
|
|
935
922
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__toolbar-spacer" }),
|
|
936
|
-
/* @__PURE__ */
|
|
937
|
-
|
|
923
|
+
/* @__PURE__ */ s("div", { className: "nice-event-planning__toolbar-actions", children: [
|
|
924
|
+
R && /* @__PURE__ */ e(
|
|
938
925
|
U,
|
|
939
926
|
{
|
|
940
927
|
size: "sm",
|
|
941
928
|
variant: "primary",
|
|
942
929
|
leftIcon: /* @__PURE__ */ e(se, { name: "check", size: "sm" }),
|
|
943
|
-
onClick: () =>
|
|
930
|
+
onClick: () => R({ title: Y, description: Q }),
|
|
944
931
|
children: n("eventPlanning.save", "Save")
|
|
945
932
|
}
|
|
946
933
|
),
|
|
@@ -954,13 +941,13 @@ const Gt = {
|
|
|
954
941
|
children: n("eventPlanning.publish", "Publish")
|
|
955
942
|
}
|
|
956
943
|
),
|
|
957
|
-
|
|
944
|
+
C && /* @__PURE__ */ e(
|
|
958
945
|
U,
|
|
959
946
|
{
|
|
960
947
|
size: "sm",
|
|
961
948
|
variant: "ghost",
|
|
962
949
|
leftIcon: /* @__PURE__ */ e(se, { name: "link", size: "sm" }),
|
|
963
|
-
onClick:
|
|
950
|
+
onClick: C,
|
|
964
951
|
children: n("eventPlanning.share", "Share")
|
|
965
952
|
}
|
|
966
953
|
),
|
|
@@ -982,20 +969,20 @@ const Gt = {
|
|
|
982
969
|
ref: r,
|
|
983
970
|
className: `nice-event-planning nice-event-planning--micro ${G ?? ""}`,
|
|
984
971
|
style: ee,
|
|
985
|
-
children: /* @__PURE__ */
|
|
972
|
+
children: /* @__PURE__ */ s("div", { className: "nice-event-planning__micro", children: [
|
|
986
973
|
/* @__PURE__ */ e(se, { name: "calendar", size: "md" }),
|
|
987
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ s("div", { className: "nice-event-planning__micro-body", children: [
|
|
988
975
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__title", children: t.title }),
|
|
989
|
-
/* @__PURE__ */
|
|
976
|
+
/* @__PURE__ */ s("span", { className: "nice-event-planning__muted", children: [
|
|
990
977
|
t.startDate ? new Date(t.startDate).toLocaleString() : n("eventPlanning.noDate", "No date"),
|
|
991
978
|
(yn = t.location) != null && yn.name ? ` · ${t.location.name}` : ""
|
|
992
979
|
] })
|
|
993
980
|
] }),
|
|
994
|
-
/* @__PURE__ */ e(ae, { size: "sm", variant:
|
|
995
|
-
d.length > 0 && /* @__PURE__ */ e(Nn, { max: 4, size: "sm", children: d.map((
|
|
981
|
+
/* @__PURE__ */ e(ae, { size: "sm", variant: Be(t.status), children: n(`eventPlanning.eventStatus.${t.status}`, t.status) }),
|
|
982
|
+
d.length > 0 && /* @__PURE__ */ e(Nn, { max: 4, size: "sm", children: d.map((S) => /* @__PURE__ */ e(Ve, { name: S.name, src: S.avatarUrl, size: "sm" }, S.id)) })
|
|
996
983
|
] })
|
|
997
984
|
}
|
|
998
|
-
) : /* @__PURE__ */
|
|
985
|
+
) : /* @__PURE__ */ s(
|
|
999
986
|
"div",
|
|
1000
987
|
{
|
|
1001
988
|
ref: r,
|
|
@@ -1019,8 +1006,8 @@ const Gt = {
|
|
|
1019
1006
|
);
|
|
1020
1007
|
}
|
|
1021
1008
|
);
|
|
1022
|
-
function Kt(
|
|
1023
|
-
switch (
|
|
1009
|
+
function Kt(a) {
|
|
1010
|
+
switch (a) {
|
|
1024
1011
|
case "confirmed":
|
|
1025
1012
|
return "success";
|
|
1026
1013
|
case "checked-in":
|
|
@@ -1034,7 +1021,7 @@ function Kt(s) {
|
|
|
1034
1021
|
}
|
|
1035
1022
|
}
|
|
1036
1023
|
const nn = ({
|
|
1037
|
-
participant:
|
|
1024
|
+
participant: a,
|
|
1038
1025
|
showRole: i = !0,
|
|
1039
1026
|
showStatus: r = !0,
|
|
1040
1027
|
meta: n,
|
|
@@ -1043,22 +1030,22 @@ const nn = ({
|
|
|
1043
1030
|
className: o
|
|
1044
1031
|
}) => {
|
|
1045
1032
|
const { t: u } = J();
|
|
1046
|
-
return /* @__PURE__ */
|
|
1047
|
-
/* @__PURE__ */ e(Ve, { name:
|
|
1048
|
-
/* @__PURE__ */ e("span", { className: "nice-participant-row__name", children:
|
|
1049
|
-
i &&
|
|
1050
|
-
r &&
|
|
1033
|
+
return /* @__PURE__ */ s("li", { className: `nice-participant-row nice-participant-row--${d} ${o ?? ""}`, children: [
|
|
1034
|
+
/* @__PURE__ */ e(Ve, { name: a.name, src: a.avatarUrl, size: d }),
|
|
1035
|
+
/* @__PURE__ */ e("span", { className: "nice-participant-row__name", children: a.name }),
|
|
1036
|
+
i && a.role && /* @__PURE__ */ e(ae, { size: "xs", outline: !0, variant: "info", children: u(`participantList.role.${a.role}`, a.role) }),
|
|
1037
|
+
r && a.status && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: Kt(a.status), children: u(`participantList.status.${a.status}`, a.status) }),
|
|
1051
1038
|
n && /* @__PURE__ */ e("span", { className: "nice-participant-row__meta", children: n }),
|
|
1052
1039
|
t && /* @__PURE__ */ e("span", { className: "nice-participant-row__trailing", children: t })
|
|
1053
1040
|
] });
|
|
1054
1041
|
}, jt = /^[^\s@,;]+@[^\s@,;]+\.[^\s@,;]{2,}$/, kn = /^.*<\s*([^<>\s]+)\s*>$/;
|
|
1055
|
-
function Fn(
|
|
1042
|
+
function Fn(a) {
|
|
1056
1043
|
var d, o;
|
|
1057
1044
|
const i = [], r = [], n = /* @__PURE__ */ new Set();
|
|
1058
1045
|
let t = 0;
|
|
1059
|
-
if (!
|
|
1046
|
+
if (!a)
|
|
1060
1047
|
return { valid: i, invalid: r, duplicates: t };
|
|
1061
|
-
for (const u of
|
|
1048
|
+
for (const u of a.split(/[,;\r\n\t]+/)) {
|
|
1062
1049
|
const _ = u.trim();
|
|
1063
1050
|
if (!_)
|
|
1064
1051
|
continue;
|
|
@@ -1080,16 +1067,16 @@ function Fn(s) {
|
|
|
1080
1067
|
}
|
|
1081
1068
|
return { valid: i, invalid: r, duplicates: t };
|
|
1082
1069
|
}
|
|
1083
|
-
function Ht(
|
|
1084
|
-
const r = new Set(
|
|
1070
|
+
function Ht(a, i) {
|
|
1071
|
+
const r = new Set(a.map((t) => t.toLowerCase())), n = [...a];
|
|
1085
1072
|
for (const t of i) {
|
|
1086
1073
|
const d = t.toLowerCase();
|
|
1087
1074
|
r.has(d) || (r.add(d), n.push(t));
|
|
1088
1075
|
}
|
|
1089
1076
|
return n;
|
|
1090
1077
|
}
|
|
1091
|
-
function Xn(
|
|
1092
|
-
const { currentUserId: i, currentUserName: r, requireIdentity: n = !0 } =
|
|
1078
|
+
function Xn(a = {}) {
|
|
1079
|
+
const { currentUserId: i, currentUserName: r, requireIdentity: n = !0 } = a, [t, d] = D(""), o = !i, u = r ?? t, _ = !n || u.trim().length > 0;
|
|
1093
1080
|
return {
|
|
1094
1081
|
isAnonymous: o,
|
|
1095
1082
|
name: u,
|
|
@@ -1101,7 +1088,7 @@ function Xn(s = {}) {
|
|
|
1101
1088
|
const Qt = [
|
|
1102
1089
|
{ answer: "yes", label: "Yes", variant: "success", Icon: je },
|
|
1103
1090
|
{ answer: "maybe", label: "Maybe", variant: "warning", Icon: sn },
|
|
1104
|
-
{ answer: "no", label: "No", variant: "error", Icon:
|
|
1091
|
+
{ answer: "no", label: "No", variant: "error", Icon: Ln }
|
|
1105
1092
|
], wn = /* @__PURE__ */ te(
|
|
1106
1093
|
function(i, r) {
|
|
1107
1094
|
const { t: n } = J(), {
|
|
@@ -1115,24 +1102,24 @@ const Qt = [
|
|
|
1115
1102
|
currentUserName: m,
|
|
1116
1103
|
compact: h = !1,
|
|
1117
1104
|
disabled: z = !1,
|
|
1118
|
-
readOnly:
|
|
1119
|
-
size:
|
|
1105
|
+
readOnly: v = !1,
|
|
1106
|
+
size: g = "md",
|
|
1120
1107
|
className: P,
|
|
1121
1108
|
style: k
|
|
1122
|
-
} = i, T = Xn({ currentUserId: l, currentUserName: m }), [f, p] =
|
|
1109
|
+
} = i, T = Xn({ currentUserId: l, currentUserName: m }), [f, p] = D(_), [A, y] = D(""), M = !h && T.isAnonymous && !T.canAct, w = z || v, N = (I) => {
|
|
1123
1110
|
w || !d || d({
|
|
1124
|
-
answer:
|
|
1125
|
-
plusOnes: o &&
|
|
1111
|
+
answer: I,
|
|
1112
|
+
plusOnes: o && I !== "no" ? f : void 0,
|
|
1126
1113
|
note: c && A.trim() ? A.trim() : void 0,
|
|
1127
1114
|
userId: T.actor.userId,
|
|
1128
1115
|
userName: T.actor.userName || void 0
|
|
1129
1116
|
});
|
|
1130
1117
|
};
|
|
1131
|
-
return /* @__PURE__ */
|
|
1118
|
+
return /* @__PURE__ */ s(
|
|
1132
1119
|
"div",
|
|
1133
1120
|
{
|
|
1134
1121
|
ref: r,
|
|
1135
|
-
className: `nice-rsvp-control nice-rsvp-control--${
|
|
1122
|
+
className: `nice-rsvp-control nice-rsvp-control--${g}${h ? " nice-rsvp-control--compact" : ""} ${P ?? ""}`,
|
|
1136
1123
|
style: k,
|
|
1137
1124
|
children: [
|
|
1138
1125
|
!h && T.isAnonymous && /* @__PURE__ */ e(
|
|
@@ -1144,7 +1131,7 @@ const Qt = [
|
|
|
1144
1131
|
placeholder: n("rsvpControl.whoIsReplying", "Who is replying?"),
|
|
1145
1132
|
required: !0,
|
|
1146
1133
|
disabled: w,
|
|
1147
|
-
size:
|
|
1134
|
+
size: g
|
|
1148
1135
|
}
|
|
1149
1136
|
),
|
|
1150
1137
|
/* @__PURE__ */ e(
|
|
@@ -1153,28 +1140,28 @@ const Qt = [
|
|
|
1153
1140
|
className: "nice-rsvp-control__answers",
|
|
1154
1141
|
role: "group",
|
|
1155
1142
|
"aria-label": n("rsvpControl.yourReply", "Your reply"),
|
|
1156
|
-
children: Qt.map(({ answer:
|
|
1143
|
+
children: Qt.map(({ answer: I, label: B, variant: X, Icon: E }) => /* @__PURE__ */ e(
|
|
1157
1144
|
U,
|
|
1158
1145
|
{
|
|
1159
|
-
size:
|
|
1160
|
-
variant: t ===
|
|
1146
|
+
size: g,
|
|
1147
|
+
variant: t === I ? X : "outline",
|
|
1161
1148
|
leftIcon: /* @__PURE__ */ e(E, { size: 16 }),
|
|
1162
1149
|
disabled: w || M,
|
|
1163
|
-
"aria-pressed": t ===
|
|
1164
|
-
onClick: () => N(
|
|
1165
|
-
children: n(`rsvpControl.answer.${
|
|
1150
|
+
"aria-pressed": t === I,
|
|
1151
|
+
onClick: () => N(I),
|
|
1152
|
+
children: n(`rsvpControl.answer.${I}`, B)
|
|
1166
1153
|
},
|
|
1167
|
-
|
|
1154
|
+
I
|
|
1168
1155
|
))
|
|
1169
1156
|
}
|
|
1170
1157
|
),
|
|
1171
|
-
!h && o && t !== "no" && /* @__PURE__ */
|
|
1158
|
+
!h && o && t !== "no" && /* @__PURE__ */ s("label", { className: "nice-rsvp-control__field", children: [
|
|
1172
1159
|
/* @__PURE__ */ e("span", { className: "nice-rsvp-control__field-label", children: n("rsvpControl.additionalGuests", "Additional guests") }),
|
|
1173
1160
|
/* @__PURE__ */ e(
|
|
1174
1161
|
dn,
|
|
1175
1162
|
{
|
|
1176
1163
|
value: f,
|
|
1177
|
-
onChange: (
|
|
1164
|
+
onChange: (I) => p(Math.max(0, Math.min(u, I ?? 0))),
|
|
1178
1165
|
min: 0,
|
|
1179
1166
|
max: u,
|
|
1180
1167
|
step: 1,
|
|
@@ -1191,7 +1178,7 @@ const Qt = [
|
|
|
1191
1178
|
onChange: y,
|
|
1192
1179
|
placeholder: n("rsvpControl.anythingWeShouldKnow", "Anything we should know?"),
|
|
1193
1180
|
disabled: w,
|
|
1194
|
-
size:
|
|
1181
|
+
size: g
|
|
1195
1182
|
}
|
|
1196
1183
|
),
|
|
1197
1184
|
M && /* @__PURE__ */ e("p", { className: "nice-rsvp-control__hint", children: n("rsvpControl.enterYourNameToReply", "Enter your name to reply.") })
|
|
@@ -1203,11 +1190,11 @@ const Qt = [
|
|
|
1203
1190
|
yes: "confirmed",
|
|
1204
1191
|
maybe: "invited",
|
|
1205
1192
|
no: "declined"
|
|
1206
|
-
},
|
|
1193
|
+
}, Sn = {
|
|
1207
1194
|
confirmed: "yes",
|
|
1208
1195
|
"checked-in": "yes",
|
|
1209
1196
|
declined: "no"
|
|
1210
|
-
},
|
|
1197
|
+
}, Ye = [
|
|
1211
1198
|
"confirmed",
|
|
1212
1199
|
"checked-in",
|
|
1213
1200
|
"invited",
|
|
@@ -1225,8 +1212,8 @@ const Qt = [
|
|
|
1225
1212
|
checkInSlot: m,
|
|
1226
1213
|
onInvite: h,
|
|
1227
1214
|
extraFields: z,
|
|
1228
|
-
groupBy:
|
|
1229
|
-
showSummary:
|
|
1215
|
+
groupBy: v = "none",
|
|
1216
|
+
showSummary: g = !0,
|
|
1230
1217
|
showSearch: P = !0,
|
|
1231
1218
|
allowPlusOnes: k = !1,
|
|
1232
1219
|
disabled: T = !1,
|
|
@@ -1234,50 +1221,50 @@ const Qt = [
|
|
|
1234
1221
|
size: p = "md",
|
|
1235
1222
|
className: A,
|
|
1236
1223
|
style: y
|
|
1237
|
-
} = i, [M, w] =
|
|
1238
|
-
const
|
|
1239
|
-
for (const V of
|
|
1240
|
-
|
|
1224
|
+
} = i, [M, w] = D(""), [N, I] = D("all"), [B, X] = D(""), E = T || f, R = d === "guest", W = F(() => {
|
|
1225
|
+
const x = { total: t.length };
|
|
1226
|
+
for (const V of Ye)
|
|
1227
|
+
x[V] = 0;
|
|
1241
1228
|
for (const V of t)
|
|
1242
|
-
|
|
1243
|
-
return
|
|
1244
|
-
}, [t]),
|
|
1245
|
-
if (
|
|
1229
|
+
x[V.status] = (x[V.status] ?? 0) + 1;
|
|
1230
|
+
return x;
|
|
1231
|
+
}, [t]), C = F(() => {
|
|
1232
|
+
if (R)
|
|
1246
1233
|
return t.filter((V) => V.userId === o || V.id === o);
|
|
1247
|
-
const
|
|
1248
|
-
return t.filter((V) => N !== "all" && V.status !== N ? !1 : !
|
|
1249
|
-
}, [t,
|
|
1250
|
-
if (
|
|
1251
|
-
return [{ key: "all", label: "", items:
|
|
1252
|
-
const
|
|
1253
|
-
for (const G of
|
|
1254
|
-
const ee =
|
|
1255
|
-
|
|
1234
|
+
const x = M.trim().toLowerCase();
|
|
1235
|
+
return t.filter((V) => N !== "all" && V.status !== N ? !1 : !x || V.name.toLowerCase().includes(x));
|
|
1236
|
+
}, [t, R, o, M, N]), b = F(() => {
|
|
1237
|
+
if (v === "none" || R)
|
|
1238
|
+
return [{ key: "all", label: "", items: C }];
|
|
1239
|
+
const x = /* @__PURE__ */ new Map();
|
|
1240
|
+
for (const G of C) {
|
|
1241
|
+
const ee = v === "status" ? G.status : G.role, Y = x.get(ee);
|
|
1242
|
+
Y ? Y.push(G) : x.set(ee, [G]);
|
|
1256
1243
|
}
|
|
1257
|
-
return [...
|
|
1258
|
-
}, [
|
|
1259
|
-
_ == null || _(
|
|
1244
|
+
return [...x.keys()].sort((G, ee) => v !== "status" ? G.localeCompare(ee) : Ye.indexOf(G) - Ye.indexOf(ee)).map((G) => ({ key: G, label: G, items: x.get(G) ?? [] }));
|
|
1245
|
+
}, [C, v, R]), L = F(() => Fn(B), [B]), K = (x) => (V) => {
|
|
1246
|
+
_ == null || _(x, Zt[V.answer], V);
|
|
1260
1247
|
}, q = () => {
|
|
1261
|
-
!h ||
|
|
1248
|
+
!h || L.valid.length === 0 || (h(L.valid), X(""));
|
|
1262
1249
|
};
|
|
1263
|
-
if (
|
|
1264
|
-
const
|
|
1265
|
-
return
|
|
1250
|
+
if (R) {
|
|
1251
|
+
const x = C[0];
|
|
1252
|
+
return x ? /* @__PURE__ */ s(
|
|
1266
1253
|
"div",
|
|
1267
1254
|
{
|
|
1268
1255
|
ref: r,
|
|
1269
1256
|
className: `nice-participant-list nice-participant-list--guest ${A ?? ""}`,
|
|
1270
1257
|
style: y,
|
|
1271
1258
|
children: [
|
|
1272
|
-
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: /* @__PURE__ */ e(nn, { participant:
|
|
1259
|
+
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: /* @__PURE__ */ e(nn, { participant: x, size: p }) }),
|
|
1273
1260
|
/* @__PURE__ */ e(
|
|
1274
1261
|
wn,
|
|
1275
1262
|
{
|
|
1276
|
-
value:
|
|
1277
|
-
onRespond: K(
|
|
1263
|
+
value: Sn[x.status],
|
|
1264
|
+
onRespond: K(x.id),
|
|
1278
1265
|
allowPlusOnes: k,
|
|
1279
|
-
currentUserId: o ??
|
|
1280
|
-
currentUserName: u ??
|
|
1266
|
+
currentUserId: o ?? x.userId,
|
|
1267
|
+
currentUserName: u ?? x.name,
|
|
1281
1268
|
disabled: T,
|
|
1282
1269
|
readOnly: f,
|
|
1283
1270
|
size: p
|
|
@@ -1296,31 +1283,36 @@ const Qt = [
|
|
|
1296
1283
|
}
|
|
1297
1284
|
) });
|
|
1298
1285
|
}
|
|
1299
|
-
return /* @__PURE__ */
|
|
1300
|
-
|
|
1301
|
-
/* @__PURE__ */
|
|
1286
|
+
return /* @__PURE__ */ s("div", { ref: r, className: `nice-participant-list ${A ?? ""}`, style: y, children: [
|
|
1287
|
+
g && /* @__PURE__ */ s("div", { className: "nice-participant-list__summary", children: [
|
|
1288
|
+
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat", children: [
|
|
1302
1289
|
/* @__PURE__ */ e("strong", { children: W.confirmed }),
|
|
1303
|
-
"
|
|
1290
|
+
" ",
|
|
1291
|
+
n("participantList.confirmed", "confirmed")
|
|
1304
1292
|
] }),
|
|
1305
|
-
/* @__PURE__ */
|
|
1293
|
+
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat", children: [
|
|
1306
1294
|
/* @__PURE__ */ e("strong", { children: W.invited }),
|
|
1307
|
-
"
|
|
1295
|
+
" ",
|
|
1296
|
+
n("participantList.awaitingReply", "awaiting reply")
|
|
1308
1297
|
] }),
|
|
1309
|
-
/* @__PURE__ */
|
|
1298
|
+
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat", children: [
|
|
1310
1299
|
/* @__PURE__ */ e("strong", { children: W.declined }),
|
|
1311
|
-
"
|
|
1300
|
+
" ",
|
|
1301
|
+
n("participantList.declined", "declined")
|
|
1312
1302
|
] }),
|
|
1313
|
-
/* @__PURE__ */
|
|
1303
|
+
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat", children: [
|
|
1314
1304
|
/* @__PURE__ */ e("strong", { children: W["checked-in"] }),
|
|
1315
|
-
"
|
|
1305
|
+
" ",
|
|
1306
|
+
n("participantList.checkedIn", "checked in")
|
|
1316
1307
|
] }),
|
|
1317
|
-
/* @__PURE__ */
|
|
1308
|
+
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat nice-participant-list__stat--total", children: [
|
|
1318
1309
|
/* @__PURE__ */ e("strong", { children: W.total }),
|
|
1319
|
-
"
|
|
1310
|
+
" ",
|
|
1311
|
+
n("participantList.total", "total")
|
|
1320
1312
|
] })
|
|
1321
1313
|
] }),
|
|
1322
|
-
(P || m || l) && /* @__PURE__ */
|
|
1323
|
-
P && /* @__PURE__ */
|
|
1314
|
+
(P || m || l) && /* @__PURE__ */ s("div", { className: "nice-participant-list__toolbar", children: [
|
|
1315
|
+
P && /* @__PURE__ */ s(Ge, { children: [
|
|
1324
1316
|
/* @__PURE__ */ e(
|
|
1325
1317
|
Z,
|
|
1326
1318
|
{
|
|
@@ -1332,45 +1324,45 @@ const Qt = [
|
|
|
1332
1324
|
}
|
|
1333
1325
|
),
|
|
1334
1326
|
/* @__PURE__ */ e(
|
|
1335
|
-
|
|
1327
|
+
ze,
|
|
1336
1328
|
{
|
|
1337
1329
|
value: N,
|
|
1338
|
-
onChange: (
|
|
1330
|
+
onChange: (x) => I(x),
|
|
1339
1331
|
size: p,
|
|
1340
1332
|
options: [
|
|
1341
1333
|
{ value: "all", label: n("participantList.allStatuses", "All statuses") },
|
|
1342
|
-
...
|
|
1343
|
-
value:
|
|
1344
|
-
label: n(`participantList.status.${
|
|
1334
|
+
...Ye.map((x) => ({
|
|
1335
|
+
value: x,
|
|
1336
|
+
label: n(`participantList.status.${x}`, x)
|
|
1345
1337
|
}))
|
|
1346
1338
|
]
|
|
1347
1339
|
}
|
|
1348
1340
|
)
|
|
1349
1341
|
] }),
|
|
1350
1342
|
m,
|
|
1351
|
-
l && !m && /* @__PURE__ */
|
|
1343
|
+
l && !m && /* @__PURE__ */ s("span", { className: "nice-participant-list__scan-hint", children: [
|
|
1352
1344
|
/* @__PURE__ */ e(bt, { size: 15 }),
|
|
1353
1345
|
" ",
|
|
1354
1346
|
n("participantList.scannerReady", "Scanner ready")
|
|
1355
1347
|
] })
|
|
1356
1348
|
] }),
|
|
1357
|
-
|
|
1349
|
+
C.length === 0 ? /* @__PURE__ */ e(
|
|
1358
1350
|
Ne,
|
|
1359
1351
|
{
|
|
1360
1352
|
title: n("participantList.noGuestsYet", "No guests yet"),
|
|
1361
1353
|
description: t.length > 0 ? n("participantList.noMatch", "No one matches the current filter.") : n("participantList.invitePeopleHint", "Invite people to see them here.")
|
|
1362
1354
|
}
|
|
1363
|
-
) : b.map((
|
|
1364
|
-
|
|
1365
|
-
|
|
1355
|
+
) : b.map((x) => /* @__PURE__ */ s("section", { className: "nice-participant-list__group", children: [
|
|
1356
|
+
x.label && /* @__PURE__ */ s("h4", { className: "nice-participant-list__group-title", children: [
|
|
1357
|
+
x.label,
|
|
1366
1358
|
" ",
|
|
1367
|
-
/* @__PURE__ */
|
|
1359
|
+
/* @__PURE__ */ s("span", { children: [
|
|
1368
1360
|
"(",
|
|
1369
|
-
|
|
1361
|
+
x.items.length,
|
|
1370
1362
|
")"
|
|
1371
1363
|
] })
|
|
1372
1364
|
] }),
|
|
1373
|
-
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children:
|
|
1365
|
+
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: x.items.map((V) => /* @__PURE__ */ s(
|
|
1374
1366
|
nn,
|
|
1375
1367
|
{
|
|
1376
1368
|
participant: V,
|
|
@@ -1383,7 +1375,7 @@ const Qt = [
|
|
|
1383
1375
|
wn,
|
|
1384
1376
|
{
|
|
1385
1377
|
compact: !0,
|
|
1386
|
-
value:
|
|
1378
|
+
value: Sn[V.status],
|
|
1387
1379
|
onRespond: K(V.id),
|
|
1388
1380
|
currentUserId: V.userId,
|
|
1389
1381
|
currentUserName: V.name,
|
|
@@ -1406,13 +1398,13 @@ const Qt = [
|
|
|
1406
1398
|
},
|
|
1407
1399
|
V.id
|
|
1408
1400
|
)) })
|
|
1409
|
-
] },
|
|
1410
|
-
h && !f && /* @__PURE__ */
|
|
1401
|
+
] }, x.key)),
|
|
1402
|
+
h && !f && /* @__PURE__ */ s("div", { className: "nice-participant-list__invite", children: [
|
|
1411
1403
|
/* @__PURE__ */ e(
|
|
1412
1404
|
on,
|
|
1413
1405
|
{
|
|
1414
1406
|
label: n("participantList.inviteByEmail", "Invite by email"),
|
|
1415
|
-
value:
|
|
1407
|
+
value: B,
|
|
1416
1408
|
onChange: X,
|
|
1417
1409
|
placeholder: n(
|
|
1418
1410
|
"participantList.pasteAddressesCommasSemicolonsOr",
|
|
@@ -1428,23 +1420,23 @@ const Qt = [
|
|
|
1428
1420
|
{
|
|
1429
1421
|
variant: "primary",
|
|
1430
1422
|
size: p,
|
|
1431
|
-
leftIcon: /* @__PURE__ */ e(
|
|
1432
|
-
disabled: T ||
|
|
1423
|
+
leftIcon: /* @__PURE__ */ e($n, { size: 15 }),
|
|
1424
|
+
disabled: T || L.valid.length === 0,
|
|
1433
1425
|
onClick: q,
|
|
1434
1426
|
children: n("participantList.invite", "Invite {valid}").replace(
|
|
1435
1427
|
"{valid}",
|
|
1436
|
-
|
|
1428
|
+
L.valid.length > 0 ? `(${L.valid.length})` : ""
|
|
1437
1429
|
)
|
|
1438
1430
|
}
|
|
1439
1431
|
),
|
|
1440
|
-
(
|
|
1441
|
-
|
|
1432
|
+
(L.invalid.length > 0 || L.duplicates > 0) && /* @__PURE__ */ s("p", { className: "nice-participant-list__invite-hint", children: [
|
|
1433
|
+
L.duplicates > 0 && `${n("participantList.duplicatesRemoved", "{count} duplicate(s) removed.").replace(
|
|
1442
1434
|
"{count}",
|
|
1443
|
-
String(
|
|
1435
|
+
String(L.duplicates)
|
|
1444
1436
|
)} `,
|
|
1445
|
-
|
|
1437
|
+
L.invalid.length > 0 && n("participantList.notRecognised", "{count} entry(ies) not recognised.").replace(
|
|
1446
1438
|
"{count}",
|
|
1447
|
-
String(
|
|
1439
|
+
String(L.invalid.length)
|
|
1448
1440
|
)
|
|
1449
1441
|
] })
|
|
1450
1442
|
] })
|
|
@@ -1477,18 +1469,18 @@ const Qt = [
|
|
|
1477
1469
|
OMR: 3,
|
|
1478
1470
|
TND: 3
|
|
1479
1471
|
};
|
|
1480
|
-
function un(
|
|
1481
|
-
return ei[
|
|
1472
|
+
function un(a) {
|
|
1473
|
+
return ei[a == null ? void 0 : a.toUpperCase()] ?? 2;
|
|
1482
1474
|
}
|
|
1483
|
-
function mn(
|
|
1484
|
-
return Number.isFinite(
|
|
1475
|
+
function mn(a, i) {
|
|
1476
|
+
return Number.isFinite(a) ? Math.round(a * 10 ** un(i)) : 0;
|
|
1485
1477
|
}
|
|
1486
|
-
function We(
|
|
1478
|
+
function We(a, i) {
|
|
1487
1479
|
const r = un(i);
|
|
1488
|
-
return r === 0 ?
|
|
1480
|
+
return r === 0 ? a : a / 10 ** r;
|
|
1489
1481
|
}
|
|
1490
|
-
function ni(
|
|
1491
|
-
const n = un(i), t = We(
|
|
1482
|
+
function ni(a, i, r) {
|
|
1483
|
+
const n = un(i), t = We(a, i);
|
|
1492
1484
|
try {
|
|
1493
1485
|
return new Intl.NumberFormat(r, {
|
|
1494
1486
|
style: "currency",
|
|
@@ -1500,31 +1492,31 @@ function ni(s, i, r) {
|
|
|
1500
1492
|
return `${t.toFixed(n)} ${i}`;
|
|
1501
1493
|
}
|
|
1502
1494
|
}
|
|
1503
|
-
function ce(
|
|
1504
|
-
return ni(mn(
|
|
1495
|
+
function ce(a, i, r) {
|
|
1496
|
+
return ni(mn(a, i), i, r);
|
|
1505
1497
|
}
|
|
1506
1498
|
const tn = { minX: 0, minY: 0, maxX: 0, maxY: 0 };
|
|
1507
|
-
function ti(
|
|
1508
|
-
if (
|
|
1499
|
+
function ti(a, i = 0) {
|
|
1500
|
+
if (a.length === 0)
|
|
1509
1501
|
return { ...tn };
|
|
1510
1502
|
let r = 1 / 0, n = 1 / 0, t = -1 / 0, d = -1 / 0;
|
|
1511
|
-
for (const o of
|
|
1503
|
+
for (const o of a)
|
|
1512
1504
|
o.x < r && (r = o.x), o.y < n && (n = o.y), o.x > t && (t = o.x), o.y > d && (d = o.y);
|
|
1513
1505
|
return { minX: r - i, minY: n - i, maxX: t + i, maxY: d + i };
|
|
1514
1506
|
}
|
|
1515
|
-
function
|
|
1507
|
+
function Cn(a, i) {
|
|
1516
1508
|
return {
|
|
1517
|
-
minX: Math.min(
|
|
1518
|
-
minY: Math.min(
|
|
1519
|
-
maxX: Math.max(
|
|
1520
|
-
maxY: Math.max(
|
|
1509
|
+
minX: Math.min(a.minX, i.minX),
|
|
1510
|
+
minY: Math.min(a.minY, i.minY),
|
|
1511
|
+
maxX: Math.max(a.maxX, i.maxX),
|
|
1512
|
+
maxY: Math.max(a.maxY, i.maxY)
|
|
1521
1513
|
};
|
|
1522
1514
|
}
|
|
1523
|
-
function
|
|
1524
|
-
return
|
|
1515
|
+
function xn(a, i) {
|
|
1516
|
+
return a.minX <= i.maxX && a.maxX >= i.minX && a.minY <= i.maxY && a.maxY >= i.minY;
|
|
1525
1517
|
}
|
|
1526
|
-
function ii(
|
|
1527
|
-
const n =
|
|
1518
|
+
function ii(a, i, r = 0) {
|
|
1519
|
+
const n = a.zoom || 1, t = -a.pan.x / n - r, d = -a.pan.y / n - r;
|
|
1528
1520
|
return {
|
|
1529
1521
|
minX: t,
|
|
1530
1522
|
minY: d,
|
|
@@ -1532,22 +1524,22 @@ function ii(s, i, r = 0) {
|
|
|
1532
1524
|
maxY: d + i.height / n + r * 2
|
|
1533
1525
|
};
|
|
1534
1526
|
}
|
|
1535
|
-
function ai(
|
|
1527
|
+
function ai(a, i = 12) {
|
|
1536
1528
|
const r = [], n = [], t = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
|
|
1537
1529
|
let o = null, u = 0;
|
|
1538
|
-
for (const _ of
|
|
1530
|
+
for (const _ of a.sections ?? []) {
|
|
1539
1531
|
let c = null, l = 0;
|
|
1540
1532
|
(_.rows ?? []).forEach((h, z) => {
|
|
1541
|
-
const
|
|
1542
|
-
if (
|
|
1533
|
+
const v = si(h.seats ?? []);
|
|
1534
|
+
if (v.length === 0)
|
|
1543
1535
|
return;
|
|
1544
|
-
const
|
|
1545
|
-
n.push({ sectionId: _.id, rowIndex: z, label: h.label, seats:
|
|
1536
|
+
const g = ti(v, i);
|
|
1537
|
+
n.push({ sectionId: _.id, rowIndex: z, label: h.label, seats: v, bounds: g }), v.forEach((P, k) => {
|
|
1546
1538
|
t.set(P.id, P), d.set(P.id, { sectionId: _.id, rowIndex: z, seatIndex: k });
|
|
1547
|
-
}), l +=
|
|
1539
|
+
}), l += v.length, c = c ? Cn(c, g) : g;
|
|
1548
1540
|
});
|
|
1549
1541
|
const m = c ?? { ...tn };
|
|
1550
|
-
r.push({ section: _, bounds: m, seatCount: l }), u += l, l > 0 && (o = o ?
|
|
1542
|
+
r.push({ section: _, bounds: m, seatCount: l }), u += l, l > 0 && (o = o ? Cn(o, m) : m);
|
|
1551
1543
|
}
|
|
1552
1544
|
return {
|
|
1553
1545
|
sections: r,
|
|
@@ -1558,15 +1550,15 @@ function ai(s, i = 12) {
|
|
|
1558
1550
|
locationById: d
|
|
1559
1551
|
};
|
|
1560
1552
|
}
|
|
1561
|
-
function si(
|
|
1562
|
-
return [...
|
|
1553
|
+
function si(a) {
|
|
1554
|
+
return [...a].sort((i, r) => i.number - r.number || i.x - r.x);
|
|
1563
1555
|
}
|
|
1564
|
-
function ri(
|
|
1565
|
-
return
|
|
1556
|
+
function ri(a, i) {
|
|
1557
|
+
return a > i * 4 ? "section" : a > i ? "row" : "seat";
|
|
1566
1558
|
}
|
|
1567
|
-
function ci(
|
|
1568
|
-
const t =
|
|
1569
|
-
(l) => d.has(l.sectionId) &&
|
|
1559
|
+
function ci(a, i, r = 2500, n) {
|
|
1560
|
+
const t = a.sections.filter((l) => xn(l.bounds, i)), d = new Set(t.map((l) => l.section.id)), o = a.rows.filter(
|
|
1561
|
+
(l) => d.has(l.sectionId) && xn(l.bounds, i)
|
|
1570
1562
|
);
|
|
1571
1563
|
let u = 0;
|
|
1572
1564
|
for (const l of o)
|
|
@@ -1582,51 +1574,51 @@ function ci(s, i, r = 2500, n) {
|
|
|
1582
1574
|
}
|
|
1583
1575
|
return { tier: _, sections: t, rows: _ === "section" ? [] : o, seats: c, visibleSeatCount: u };
|
|
1584
1576
|
}
|
|
1585
|
-
function pn(
|
|
1586
|
-
if (
|
|
1587
|
-
return
|
|
1588
|
-
if (
|
|
1589
|
-
return
|
|
1577
|
+
function pn(a) {
|
|
1578
|
+
if (a.accessType)
|
|
1579
|
+
return a.accessType;
|
|
1580
|
+
if (a.status === "wheelchair" || a.status === "companion")
|
|
1581
|
+
return a.status;
|
|
1590
1582
|
}
|
|
1591
|
-
function
|
|
1592
|
-
const r = (i == null ? void 0 : i[
|
|
1583
|
+
function Ae(a, i) {
|
|
1584
|
+
const r = (i == null ? void 0 : i[a.id]) ?? a.status;
|
|
1593
1585
|
return r === "wheelchair" || r === "companion" ? "available" : r;
|
|
1594
1586
|
}
|
|
1595
|
-
function In(
|
|
1587
|
+
function In(a, i, r) {
|
|
1596
1588
|
var t;
|
|
1597
|
-
const n = (t = i.priceCategories) == null ? void 0 : t.find((d) => d.id ===
|
|
1589
|
+
const n = (t = i.priceCategories) == null ? void 0 : t.find((d) => d.id === a.priceCategoryId);
|
|
1598
1590
|
return {
|
|
1599
1591
|
amount: (n == null ? void 0 : n.price) ?? r.basePrice,
|
|
1600
1592
|
currency: r.currency
|
|
1601
1593
|
};
|
|
1602
1594
|
}
|
|
1603
|
-
function li(
|
|
1604
|
-
return !(
|
|
1595
|
+
function li(a, i = {}, r) {
|
|
1596
|
+
return !(Ae(a, r) !== "available" || i.allowedCategories && !i.allowedCategories.includes(a.priceCategoryId));
|
|
1605
1597
|
}
|
|
1606
|
-
function Wn(
|
|
1598
|
+
function Wn(a, i = {}, r) {
|
|
1607
1599
|
const n = [];
|
|
1608
1600
|
let t = null;
|
|
1609
|
-
return
|
|
1601
|
+
return a.forEach((d, o) => {
|
|
1610
1602
|
li(d, i, r) ? t ? t.seats.push(d) : t = { start: o, seats: [d] } : t && (n.push(t), t = null);
|
|
1611
1603
|
}), t && n.push(t), n;
|
|
1612
1604
|
}
|
|
1613
|
-
function oi(
|
|
1605
|
+
function oi(a, i, r = {}, n) {
|
|
1614
1606
|
const t = r.maxSeats ?? 8;
|
|
1615
|
-
if (
|
|
1607
|
+
if (a.length > t)
|
|
1616
1608
|
return { ok: !1, reason: "max-seats" };
|
|
1617
|
-
for (const o of
|
|
1609
|
+
for (const o of a) {
|
|
1618
1610
|
const u = i.seatById.get(o);
|
|
1619
1611
|
if (u) {
|
|
1620
|
-
if (
|
|
1612
|
+
if (Ae(u, n) !== "available")
|
|
1621
1613
|
return { ok: !1, reason: "unavailable", seatId: o };
|
|
1622
1614
|
if (r.allowedCategories && !r.allowedCategories.includes(u.priceCategoryId))
|
|
1623
1615
|
return { ok: !1, reason: "category-not-allowed", seatId: o };
|
|
1624
1616
|
}
|
|
1625
1617
|
}
|
|
1626
|
-
if (!r.adjacentOnly ||
|
|
1618
|
+
if (!r.adjacentOnly || a.length === 0)
|
|
1627
1619
|
return { ok: !0 };
|
|
1628
1620
|
const d = /* @__PURE__ */ new Map();
|
|
1629
|
-
for (const o of
|
|
1621
|
+
for (const o of a) {
|
|
1630
1622
|
const u = i.locationById.get(o);
|
|
1631
1623
|
if (!u)
|
|
1632
1624
|
continue;
|
|
@@ -1638,39 +1630,39 @@ function oi(s, i, r = {}, n) {
|
|
|
1638
1630
|
if (!m)
|
|
1639
1631
|
continue;
|
|
1640
1632
|
const h = Wn(m.seats, r, n), z = new Set(u);
|
|
1641
|
-
let
|
|
1633
|
+
let v = null;
|
|
1642
1634
|
for (const f of h)
|
|
1643
1635
|
if (f.seats.some((p) => z.has(p.id))) {
|
|
1644
|
-
if (
|
|
1636
|
+
if (v)
|
|
1645
1637
|
return { ok: !1, reason: "not-adjacent", seatId: u[0] };
|
|
1646
|
-
|
|
1638
|
+
v = f;
|
|
1647
1639
|
}
|
|
1648
|
-
if (!
|
|
1640
|
+
if (!v)
|
|
1649
1641
|
continue;
|
|
1650
|
-
const
|
|
1651
|
-
if (
|
|
1642
|
+
const g = v.seats.map((f, p) => z.has(f.id) ? p : -1).filter((f) => f >= 0);
|
|
1643
|
+
if (g.length === 0)
|
|
1652
1644
|
continue;
|
|
1653
|
-
const P =
|
|
1654
|
-
if (k - P + 1 !==
|
|
1645
|
+
const P = g[0], k = g[g.length - 1];
|
|
1646
|
+
if (k - P + 1 !== g.length)
|
|
1655
1647
|
return { ok: !1, reason: "not-adjacent", seatId: u[0] };
|
|
1656
|
-
const T =
|
|
1648
|
+
const T = v.seats.length;
|
|
1657
1649
|
if (T > 1 && (P === 1 || T - 1 - k === 1))
|
|
1658
1650
|
return { ok: !1, reason: "orphan-seat", seatId: u[0] };
|
|
1659
1651
|
}
|
|
1660
1652
|
return { ok: !0 };
|
|
1661
1653
|
}
|
|
1662
|
-
function di(
|
|
1663
|
-
if (
|
|
1664
|
-
return { selected:
|
|
1665
|
-
const d = [...
|
|
1654
|
+
function di(a, i, r, n = {}, t) {
|
|
1655
|
+
if (a.includes(i))
|
|
1656
|
+
return { selected: a.filter((u) => u !== i) };
|
|
1657
|
+
const d = [...a, i], o = oi(d, r, n, t);
|
|
1666
1658
|
return o.ok ? { selected: d } : { rejected: o.reason ?? "not-adjacent" };
|
|
1667
1659
|
}
|
|
1668
|
-
function ui(
|
|
1660
|
+
function ui(a, i, r = {}, n = {}, t) {
|
|
1669
1661
|
if (i <= 0)
|
|
1670
1662
|
return [];
|
|
1671
1663
|
const d = n.categoryId ? { ...r, allowedCategories: [n.categoryId] } : r;
|
|
1672
1664
|
let o = null;
|
|
1673
|
-
for (const u of
|
|
1665
|
+
for (const u of a.rows)
|
|
1674
1666
|
if (!(n.sectionId && u.sectionId !== n.sectionId))
|
|
1675
1667
|
for (const _ of Wn(u.seats, d, t)) {
|
|
1676
1668
|
const c = _.seats.length;
|
|
@@ -1679,23 +1671,23 @@ function ui(s, i, r = {}, n = {}, t) {
|
|
|
1679
1671
|
const m = l + i - 1;
|
|
1680
1672
|
if (c > i && (l === 1 || c - 1 - m === 1))
|
|
1681
1673
|
continue;
|
|
1682
|
-
const h = _.seats.slice(l, m + 1), z = h.reduce((
|
|
1683
|
-
(!o || z > o.score) && (o = { ids: h.map((
|
|
1674
|
+
const h = _.seats.slice(l, m + 1), z = h.reduce((v, g) => v + (g.viewScore ?? 50), 0) / i;
|
|
1675
|
+
(!o || z > o.score) && (o = { ids: h.map((v) => v.id), score: z });
|
|
1684
1676
|
}
|
|
1685
1677
|
}
|
|
1686
1678
|
return (o == null ? void 0 : o.ids) ?? [];
|
|
1687
1679
|
}
|
|
1688
|
-
function mi(
|
|
1680
|
+
function mi(a, i, r) {
|
|
1689
1681
|
var l, m, h, z;
|
|
1690
|
-
const n =
|
|
1682
|
+
const n = a.locationById.get(i);
|
|
1691
1683
|
if (!n)
|
|
1692
1684
|
return null;
|
|
1693
|
-
const t =
|
|
1694
|
-
(
|
|
1685
|
+
const t = a.rows.findIndex(
|
|
1686
|
+
(v) => v.sectionId === n.sectionId && v.rowIndex === n.rowIndex
|
|
1695
1687
|
);
|
|
1696
1688
|
if (t < 0)
|
|
1697
1689
|
return null;
|
|
1698
|
-
const d =
|
|
1690
|
+
const d = a.rows[t];
|
|
1699
1691
|
if (r === "left")
|
|
1700
1692
|
return ((l = d.seats[n.seatIndex - 1]) == null ? void 0 : l.id) ?? null;
|
|
1701
1693
|
if (r === "right")
|
|
@@ -1704,31 +1696,31 @@ function mi(s, i, r) {
|
|
|
1704
1696
|
return ((h = d.seats[0]) == null ? void 0 : h.id) ?? null;
|
|
1705
1697
|
if (r === "row-end")
|
|
1706
1698
|
return ((z = d.seats[d.seats.length - 1]) == null ? void 0 : z.id) ?? null;
|
|
1707
|
-
const o =
|
|
1699
|
+
const o = a.rows[r === "up" ? t - 1 : t + 1];
|
|
1708
1700
|
if (!o)
|
|
1709
1701
|
return null;
|
|
1710
1702
|
const u = d.seats[n.seatIndex].x;
|
|
1711
1703
|
let _ = null, c = 1 / 0;
|
|
1712
|
-
for (const
|
|
1713
|
-
const
|
|
1714
|
-
|
|
1704
|
+
for (const v of o.seats) {
|
|
1705
|
+
const g = Math.abs(v.x - u);
|
|
1706
|
+
g < c && (c = g, _ = v);
|
|
1715
1707
|
}
|
|
1716
1708
|
return (_ == null ? void 0 : _.id) ?? null;
|
|
1717
1709
|
}
|
|
1718
|
-
function pi(
|
|
1710
|
+
function pi(a, i, r) {
|
|
1719
1711
|
var _, c, l;
|
|
1720
|
-
const n =
|
|
1712
|
+
const n = a.sections.filter((m) => m.seatCount > 0);
|
|
1721
1713
|
if (n.length === 0)
|
|
1722
1714
|
return null;
|
|
1723
|
-
const t = i ? (_ =
|
|
1724
|
-
return u ? ((l = (c =
|
|
1715
|
+
const t = i ? (_ = a.locationById.get(i)) == null ? void 0 : _.sectionId : void 0, d = n.findIndex((m) => m.section.id === t), o = d < 0 ? 0 : r === "next" ? d + 1 : d - 1, u = n[o];
|
|
1716
|
+
return u ? ((l = (c = a.rows.find((m) => m.sectionId === u.section.id)) == null ? void 0 : c.seats[0]) == null ? void 0 : l.id) ?? null : null;
|
|
1725
1717
|
}
|
|
1726
|
-
const
|
|
1727
|
-
function hi(
|
|
1728
|
-
return
|
|
1718
|
+
const $e = 8;
|
|
1719
|
+
function hi(a, i) {
|
|
1720
|
+
return a.seats.length === 0 ? 0 : a.seats.filter((n) => Ae(n, i) === "available").length / a.seats.length;
|
|
1729
1721
|
}
|
|
1730
1722
|
const gi = ({
|
|
1731
|
-
cull:
|
|
1723
|
+
cull: a,
|
|
1732
1724
|
selectedIds: i,
|
|
1733
1725
|
cursorId: r,
|
|
1734
1726
|
statusOverrides: n,
|
|
@@ -1739,7 +1731,7 @@ const gi = ({
|
|
|
1739
1731
|
describeSeat: _
|
|
1740
1732
|
}) => {
|
|
1741
1733
|
const { t: c } = J();
|
|
1742
|
-
return
|
|
1734
|
+
return a.tier === "section" ? /* @__PURE__ */ e("g", { className: "nice-seating-chart__sections", children: a.sections.map(({ section: l, bounds: m, seatCount: h }) => /* @__PURE__ */ s("g", { className: "nice-seating-chart__section", children: [
|
|
1743
1735
|
/* @__PURE__ */ e(
|
|
1744
1736
|
"rect",
|
|
1745
1737
|
{
|
|
@@ -1768,9 +1760,9 @@ const gi = ({
|
|
|
1768
1760
|
children: l.name
|
|
1769
1761
|
}
|
|
1770
1762
|
)
|
|
1771
|
-
] }, l.id)) }) :
|
|
1763
|
+
] }, l.id)) }) : a.tier === "row" ? /* @__PURE__ */ e("g", { className: "nice-seating-chart__rows", children: a.rows.map((l) => {
|
|
1772
1764
|
const m = hi(l, n);
|
|
1773
|
-
return /* @__PURE__ */
|
|
1765
|
+
return /* @__PURE__ */ s("g", { children: [
|
|
1774
1766
|
/* @__PURE__ */ e(
|
|
1775
1767
|
"rect",
|
|
1776
1768
|
{
|
|
@@ -1801,15 +1793,15 @@ const gi = ({
|
|
|
1801
1793
|
}
|
|
1802
1794
|
)
|
|
1803
1795
|
] }, `${l.sectionId}-${l.rowIndex}`);
|
|
1804
|
-
}) }) : /* @__PURE__ */ e("g", { className: "nice-seating-chart__seats", children:
|
|
1805
|
-
const m =
|
|
1796
|
+
}) }) : /* @__PURE__ */ e("g", { className: "nice-seating-chart__seats", children: a.seats.map((l) => {
|
|
1797
|
+
const m = Ae(l, n), h = pn(l), z = i.has(l.id), v = r === l.id, g = { row: l.row, number: l.number }, P = [
|
|
1806
1798
|
"nice-seating-chart__seat",
|
|
1807
1799
|
`nice-seating-chart__seat--${m}`,
|
|
1808
1800
|
z ? "nice-seating-chart__seat--selected" : "",
|
|
1809
1801
|
h ? `nice-seating-chart__seat--${h}` : "",
|
|
1810
|
-
|
|
1802
|
+
v ? "nice-seating-chart__seat--cursor" : ""
|
|
1811
1803
|
].filter(Boolean).join(" ");
|
|
1812
|
-
return /* @__PURE__ */
|
|
1804
|
+
return /* @__PURE__ */ s(
|
|
1813
1805
|
"g",
|
|
1814
1806
|
{
|
|
1815
1807
|
className: P,
|
|
@@ -1818,16 +1810,16 @@ const gi = ({
|
|
|
1818
1810
|
"aria-selected": z,
|
|
1819
1811
|
"aria-disabled": m !== "available",
|
|
1820
1812
|
"aria-label": _(l),
|
|
1821
|
-
tabIndex:
|
|
1813
|
+
tabIndex: v ? 0 : -1,
|
|
1822
1814
|
onClick: d && o ? () => o(l) : void 0,
|
|
1823
1815
|
children: [
|
|
1824
1816
|
h ? /* @__PURE__ */ e(
|
|
1825
1817
|
"rect",
|
|
1826
1818
|
{
|
|
1827
|
-
x: l.x -
|
|
1828
|
-
y: l.y -
|
|
1829
|
-
width:
|
|
1830
|
-
height:
|
|
1819
|
+
x: l.x - $e,
|
|
1820
|
+
y: l.y - $e,
|
|
1821
|
+
width: $e * 2,
|
|
1822
|
+
height: $e * 2,
|
|
1831
1823
|
rx: 3,
|
|
1832
1824
|
className: "nice-seating-chart__seat-shape",
|
|
1833
1825
|
fill: h === "companion" ? "url(#nice-seat-companion-hatch)" : void 0
|
|
@@ -1837,12 +1829,12 @@ const gi = ({
|
|
|
1837
1829
|
{
|
|
1838
1830
|
cx: l.x,
|
|
1839
1831
|
cy: l.y,
|
|
1840
|
-
r:
|
|
1832
|
+
r: $e,
|
|
1841
1833
|
className: "nice-seating-chart__seat-shape"
|
|
1842
1834
|
}
|
|
1843
1835
|
),
|
|
1844
1836
|
h === "wheelchair" && /* @__PURE__ */ e(
|
|
1845
|
-
|
|
1837
|
+
Rn,
|
|
1846
1838
|
{
|
|
1847
1839
|
size: 10,
|
|
1848
1840
|
x: l.x - 5,
|
|
@@ -1860,7 +1852,7 @@ const gi = ({
|
|
|
1860
1852
|
textAnchor: "middle",
|
|
1861
1853
|
dominantBaseline: "middle",
|
|
1862
1854
|
"aria-hidden": "true",
|
|
1863
|
-
children:
|
|
1855
|
+
children: g.number
|
|
1864
1856
|
}
|
|
1865
1857
|
)
|
|
1866
1858
|
]
|
|
@@ -1869,7 +1861,7 @@ const gi = ({
|
|
|
1869
1861
|
);
|
|
1870
1862
|
}) });
|
|
1871
1863
|
}, vi = ({
|
|
1872
|
-
index:
|
|
1864
|
+
index: a,
|
|
1873
1865
|
selectedIds: i,
|
|
1874
1866
|
statusOverrides: r,
|
|
1875
1867
|
maxSeats: n,
|
|
@@ -1881,26 +1873,26 @@ const gi = ({
|
|
|
1881
1873
|
}) => {
|
|
1882
1874
|
var f;
|
|
1883
1875
|
const { t: c } = J(), l = F(
|
|
1884
|
-
() =>
|
|
1885
|
-
[
|
|
1886
|
-
), [m, h] =
|
|
1887
|
-
() =>
|
|
1888
|
-
[
|
|
1876
|
+
() => a.sections.filter((p) => p.seatCount > 0),
|
|
1877
|
+
[a.sections]
|
|
1878
|
+
), [m, h] = D(((f = l[0]) == null ? void 0 : f.section.id) ?? ""), [z, v] = D(0), [g, P] = D(2), k = F(
|
|
1879
|
+
() => a.rows.filter((p) => p.sectionId === m),
|
|
1880
|
+
[a.rows, m]
|
|
1889
1881
|
), T = k.find((p) => p.rowIndex === z) ?? k[0];
|
|
1890
|
-
return /* @__PURE__ */
|
|
1891
|
-
|
|
1882
|
+
return /* @__PURE__ */ s(
|
|
1883
|
+
Bt,
|
|
1892
1884
|
{
|
|
1893
1885
|
trigger: c("seatListPanel.chooseWithoutMap", "Choose seats without the map"),
|
|
1894
1886
|
defaultExpanded: _,
|
|
1895
1887
|
className: "nice-seating-chart__list-panel",
|
|
1896
1888
|
children: [
|
|
1897
|
-
d && /* @__PURE__ */
|
|
1898
|
-
/* @__PURE__ */
|
|
1889
|
+
d && /* @__PURE__ */ s("div", { className: "nice-seating-chart__best", children: [
|
|
1890
|
+
/* @__PURE__ */ s("label", { className: "nice-seating-chart__field", children: [
|
|
1899
1891
|
/* @__PURE__ */ e("span", { children: c("seatListPanel.howManySeats", "How many seats?") }),
|
|
1900
1892
|
/* @__PURE__ */ e(
|
|
1901
1893
|
dn,
|
|
1902
1894
|
{
|
|
1903
|
-
value:
|
|
1895
|
+
value: g,
|
|
1904
1896
|
onChange: (p) => P(Math.max(1, Math.min(n, p ?? 1))),
|
|
1905
1897
|
min: 1,
|
|
1906
1898
|
max: n,
|
|
@@ -1915,22 +1907,22 @@ const gi = ({
|
|
|
1915
1907
|
size: "sm",
|
|
1916
1908
|
variant: "primary",
|
|
1917
1909
|
disabled: u,
|
|
1918
|
-
onClick: () => d(
|
|
1910
|
+
onClick: () => d(g, { sectionId: m || void 0 }),
|
|
1919
1911
|
children: c("seatListPanel.bestAvailable", "Best available")
|
|
1920
1912
|
}
|
|
1921
1913
|
)
|
|
1922
1914
|
] }),
|
|
1923
|
-
/* @__PURE__ */
|
|
1924
|
-
/* @__PURE__ */
|
|
1915
|
+
/* @__PURE__ */ s("div", { className: "nice-seating-chart__pickers", children: [
|
|
1916
|
+
/* @__PURE__ */ s("label", { className: "nice-seating-chart__field", children: [
|
|
1925
1917
|
/* @__PURE__ */ e("span", { children: c("seatListPanel.section", "Section") }),
|
|
1926
1918
|
/* @__PURE__ */ e(
|
|
1927
|
-
|
|
1919
|
+
ze,
|
|
1928
1920
|
{
|
|
1929
1921
|
size: "sm",
|
|
1930
1922
|
value: m,
|
|
1931
1923
|
disabled: u,
|
|
1932
1924
|
onChange: (p) => {
|
|
1933
|
-
h(p),
|
|
1925
|
+
h(p), v(0);
|
|
1934
1926
|
},
|
|
1935
1927
|
options: l.map((p) => ({
|
|
1936
1928
|
value: p.section.id,
|
|
@@ -1939,15 +1931,15 @@ const gi = ({
|
|
|
1939
1931
|
}
|
|
1940
1932
|
)
|
|
1941
1933
|
] }),
|
|
1942
|
-
/* @__PURE__ */
|
|
1943
|
-
/* @__PURE__ */ e("span", { children: "Row" }),
|
|
1934
|
+
/* @__PURE__ */ s("label", { className: "nice-seating-chart__field", children: [
|
|
1935
|
+
/* @__PURE__ */ e("span", { children: c("seatListPanel.row", "Row") }),
|
|
1944
1936
|
/* @__PURE__ */ e(
|
|
1945
|
-
|
|
1937
|
+
ze,
|
|
1946
1938
|
{
|
|
1947
1939
|
size: "sm",
|
|
1948
1940
|
value: String((T == null ? void 0 : T.rowIndex) ?? 0),
|
|
1949
1941
|
disabled: u || k.length === 0,
|
|
1950
|
-
onChange: (p) =>
|
|
1942
|
+
onChange: (p) => v(Number(p)),
|
|
1951
1943
|
options: k.map((p) => ({
|
|
1952
1944
|
value: String(p.rowIndex),
|
|
1953
1945
|
label: `${p.label} (${p.seats.length})`
|
|
@@ -1957,8 +1949,8 @@ const gi = ({
|
|
|
1957
1949
|
] })
|
|
1958
1950
|
] }),
|
|
1959
1951
|
T && /* @__PURE__ */ e("ul", { className: "nice-seating-chart__seat-list", children: T.seats.map((p) => {
|
|
1960
|
-
const A =
|
|
1961
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
1952
|
+
const A = Ae(p, r), y = pn(p), M = i.has(p.id);
|
|
1953
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
|
|
1962
1954
|
U,
|
|
1963
1955
|
{
|
|
1964
1956
|
size: "sm",
|
|
@@ -1969,7 +1961,7 @@ const gi = ({
|
|
|
1969
1961
|
onClick: () => t(p),
|
|
1970
1962
|
children: [
|
|
1971
1963
|
p.number,
|
|
1972
|
-
y && /* @__PURE__ */ e(
|
|
1964
|
+
y && /* @__PURE__ */ e(Rn, { size: 11 })
|
|
1973
1965
|
]
|
|
1974
1966
|
}
|
|
1975
1967
|
) }, p.id);
|
|
@@ -1978,7 +1970,7 @@ const gi = ({
|
|
|
1978
1970
|
}
|
|
1979
1971
|
);
|
|
1980
1972
|
}, fi = { zoom: 1, pan: { x: 0, y: 0 } };
|
|
1981
|
-
function _i(
|
|
1973
|
+
function _i(a = {}) {
|
|
1982
1974
|
const {
|
|
1983
1975
|
minZoom: i = 0.1,
|
|
1984
1976
|
maxZoom: r = 10,
|
|
@@ -1986,7 +1978,7 @@ function _i(s = {}) {
|
|
|
1986
1978
|
viewport: t,
|
|
1987
1979
|
onViewportChange: d,
|
|
1988
1980
|
disabled: o = !1
|
|
1989
|
-
} =
|
|
1981
|
+
} = a, [u, _] = D(n), c = t ?? u, [l, m] = D(!1), h = ye(/* @__PURE__ */ new Map()), z = ye(null), v = ye(null), g = j(
|
|
1990
1982
|
(N) => {
|
|
1991
1983
|
t === void 0 && _(N), d == null || d(N);
|
|
1992
1984
|
},
|
|
@@ -1995,41 +1987,41 @@ function _i(s = {}) {
|
|
|
1995
1987
|
(N) => Math.min(r, Math.max(i, N)),
|
|
1996
1988
|
[i, r]
|
|
1997
1989
|
), k = j(
|
|
1998
|
-
(N,
|
|
1999
|
-
const
|
|
2000
|
-
if (
|
|
1990
|
+
(N, I) => {
|
|
1991
|
+
const B = P(c.zoom * N);
|
|
1992
|
+
if (B === c.zoom)
|
|
2001
1993
|
return;
|
|
2002
|
-
const X =
|
|
2003
|
-
|
|
2004
|
-
zoom:
|
|
1994
|
+
const X = B / c.zoom;
|
|
1995
|
+
g({
|
|
1996
|
+
zoom: B,
|
|
2005
1997
|
pan: {
|
|
2006
|
-
x:
|
|
2007
|
-
y:
|
|
1998
|
+
x: I.x - (I.x - c.pan.x) * X,
|
|
1999
|
+
y: I.y - (I.y - c.pan.y) * X
|
|
2008
2000
|
}
|
|
2009
2001
|
});
|
|
2010
2002
|
},
|
|
2011
|
-
[
|
|
2003
|
+
[g, P, c]
|
|
2012
2004
|
), T = j(
|
|
2013
|
-
(N,
|
|
2014
|
-
const X =
|
|
2005
|
+
(N, I, B) => {
|
|
2006
|
+
const X = I ?? (B ? { x: B.width / 2, y: B.height / 2 } : { x: 0, y: 0 });
|
|
2015
2007
|
k(N, X);
|
|
2016
2008
|
},
|
|
2017
2009
|
[k]
|
|
2018
2010
|
), f = j(
|
|
2019
|
-
(N,
|
|
2020
|
-
const X = Math.max(1, N.maxX - N.minX), E = Math.max(1, N.maxY - N.minY),
|
|
2021
|
-
Math.min((
|
|
2011
|
+
(N, I, B = 24) => {
|
|
2012
|
+
const X = Math.max(1, N.maxX - N.minX), E = Math.max(1, N.maxY - N.minY), R = P(
|
|
2013
|
+
Math.min((I.width - B * 2) / X, (I.height - B * 2) / E)
|
|
2022
2014
|
);
|
|
2023
|
-
|
|
2024
|
-
zoom:
|
|
2015
|
+
g({
|
|
2016
|
+
zoom: R,
|
|
2025
2017
|
pan: {
|
|
2026
|
-
x: (
|
|
2027
|
-
y: (
|
|
2018
|
+
x: (I.width - X * R) / 2 - N.minX * R,
|
|
2019
|
+
y: (I.height - E * R) / 2 - N.minY * R
|
|
2028
2020
|
}
|
|
2029
2021
|
});
|
|
2030
2022
|
},
|
|
2031
|
-
[
|
|
2032
|
-
), p = j(() =>
|
|
2023
|
+
[g, P]
|
|
2024
|
+
), p = j(() => g(n), [g, n]), A = j(
|
|
2033
2025
|
(N) => ({
|
|
2034
2026
|
x: (N.x - c.pan.x) / c.zoom,
|
|
2035
2027
|
y: (N.y - c.pan.y) / c.zoom
|
|
@@ -2042,49 +2034,49 @@ function _i(s = {}) {
|
|
|
2042
2034
|
}),
|
|
2043
2035
|
[c]
|
|
2044
2036
|
), M = (N) => {
|
|
2045
|
-
const
|
|
2046
|
-
return { x: N.clientX -
|
|
2037
|
+
const I = N.currentTarget.getBoundingClientRect();
|
|
2038
|
+
return { x: N.clientX - I.left, y: N.clientY - I.top };
|
|
2047
2039
|
};
|
|
2048
2040
|
return {
|
|
2049
2041
|
viewport: c,
|
|
2050
|
-
setViewport:
|
|
2042
|
+
setViewport: g,
|
|
2051
2043
|
containerProps: o ? {} : {
|
|
2052
2044
|
onWheel: (N) => {
|
|
2053
2045
|
N.preventDefault();
|
|
2054
|
-
const
|
|
2055
|
-
k(Math.min(2, Math.max(0.5,
|
|
2046
|
+
const I = Math.exp(-N.deltaY * 2e-3);
|
|
2047
|
+
k(Math.min(2, Math.max(0.5, I)), M(N));
|
|
2056
2048
|
},
|
|
2057
2049
|
onPointerDown: (N) => {
|
|
2058
|
-
var
|
|
2059
|
-
const
|
|
2060
|
-
if (h.current.set(N.pointerId,
|
|
2061
|
-
const [E,
|
|
2050
|
+
var B, X;
|
|
2051
|
+
const I = M(N);
|
|
2052
|
+
if (h.current.set(N.pointerId, I), (X = (B = N.currentTarget).setPointerCapture) == null || X.call(B, N.pointerId), h.current.size === 2) {
|
|
2053
|
+
const [E, R] = [...h.current.values()];
|
|
2062
2054
|
z.current = {
|
|
2063
|
-
distance: Math.hypot(E.x -
|
|
2055
|
+
distance: Math.hypot(E.x - R.x, E.y - R.y) || 1,
|
|
2064
2056
|
zoom: c.zoom
|
|
2065
2057
|
};
|
|
2066
2058
|
} else
|
|
2067
|
-
|
|
2059
|
+
v.current = I, m(!0);
|
|
2068
2060
|
},
|
|
2069
2061
|
onPointerMove: (N) => {
|
|
2070
2062
|
if (!h.current.has(N.pointerId))
|
|
2071
2063
|
return;
|
|
2072
|
-
const
|
|
2073
|
-
if (h.current.set(N.pointerId,
|
|
2074
|
-
const [E,
|
|
2075
|
-
|
|
2064
|
+
const I = M(N);
|
|
2065
|
+
if (h.current.set(N.pointerId, I), h.current.size === 2 && z.current) {
|
|
2066
|
+
const [E, R] = [...h.current.values()], W = Math.hypot(E.x - R.x, E.y - R.y) || 1, C = P(z.current.zoom * (W / z.current.distance)), b = { x: (E.x + R.x) / 2, y: (E.y + R.y) / 2 };
|
|
2067
|
+
C !== c.zoom && k(C / c.zoom, b);
|
|
2076
2068
|
return;
|
|
2077
2069
|
}
|
|
2078
|
-
if (!
|
|
2070
|
+
if (!v.current)
|
|
2079
2071
|
return;
|
|
2080
|
-
const
|
|
2081
|
-
|
|
2072
|
+
const B = I.x - v.current.x, X = I.y - v.current.y;
|
|
2073
|
+
v.current = I, g({ zoom: c.zoom, pan: { x: c.pan.x + B, y: c.pan.y + X } });
|
|
2082
2074
|
},
|
|
2083
2075
|
onPointerUp: (N) => {
|
|
2084
|
-
h.current.delete(N.pointerId), h.current.size < 2 && (z.current = null), h.current.size === 0 && (
|
|
2076
|
+
h.current.delete(N.pointerId), h.current.size < 2 && (z.current = null), h.current.size === 0 && (v.current = null, m(!1));
|
|
2085
2077
|
},
|
|
2086
2078
|
onPointerCancel: (N) => {
|
|
2087
|
-
h.current.delete(N.pointerId), z.current = null,
|
|
2079
|
+
h.current.delete(N.pointerId), z.current = null, v.current = null, m(!1);
|
|
2088
2080
|
}
|
|
2089
2081
|
},
|
|
2090
2082
|
zoomBy: T,
|
|
@@ -2110,7 +2102,7 @@ const yi = {
|
|
|
2110
2102
|
totalSeats: 0
|
|
2111
2103
|
}, bi = /* @__PURE__ */ te(
|
|
2112
2104
|
function(i, r) {
|
|
2113
|
-
var me,
|
|
2105
|
+
var me, Le, Ie;
|
|
2114
2106
|
const { t: n } = J(), {
|
|
2115
2107
|
chart: t = Ni,
|
|
2116
2108
|
mode: d = "select",
|
|
@@ -2122,8 +2114,8 @@ const yi = {
|
|
|
2122
2114
|
seatStatusOverrides: m,
|
|
2123
2115
|
onSeatClick: h,
|
|
2124
2116
|
onBestAvailable: z,
|
|
2125
|
-
lod:
|
|
2126
|
-
onLodChange:
|
|
2117
|
+
lod: v = "auto",
|
|
2118
|
+
onLodChange: g,
|
|
2127
2119
|
maxRenderedSeats: P = 2500,
|
|
2128
2120
|
containerSize: k,
|
|
2129
2121
|
showLegend: T = !0,
|
|
@@ -2134,133 +2126,133 @@ const yi = {
|
|
|
2134
2126
|
readOnly: M = !1,
|
|
2135
2127
|
className: w,
|
|
2136
2128
|
style: N
|
|
2137
|
-
} = i,
|
|
2129
|
+
} = i, I = ye(null), [B, X] = D({ width: 800, height: 500 }), [E, R] = D(!1), [W, C] = D(_), [b, L] = D(null), [K, q] = D(""), x = u ?? W, V = F(() => new Set(x), [x]), G = d === "select" && !y && !M && o.interactive !== !1, ee = o.maxSeats ?? 8, Y = F(() => ai(t), [t]), ie = k ?? B, Q = !!k || E;
|
|
2138
2130
|
Fe(() => {
|
|
2139
|
-
if (k || !
|
|
2131
|
+
if (k || !I.current || typeof ResizeObserver > "u")
|
|
2140
2132
|
return;
|
|
2141
|
-
const
|
|
2133
|
+
const $ = I.current, O = new ResizeObserver(([H]) => {
|
|
2142
2134
|
const { width: ne, height: re } = H.contentRect;
|
|
2143
|
-
ne > 0 && re > 0 && (X({ width: ne, height: re }),
|
|
2135
|
+
ne > 0 && re > 0 && (X({ width: ne, height: re }), R(!0));
|
|
2144
2136
|
});
|
|
2145
|
-
return O.observe(
|
|
2137
|
+
return O.observe($), () => O.disconnect();
|
|
2146
2138
|
}, [k]);
|
|
2147
2139
|
const be = _i({ disabled: !p || y }), { fitTo: oe, viewport: he } = be, ke = ye(!1);
|
|
2148
2140
|
Fe(() => {
|
|
2149
|
-
ke.current || !Q ||
|
|
2150
|
-
}, [oe,
|
|
2151
|
-
const Ee = F(() => ii(he, ie, 40), [he, ie]), we =
|
|
2152
|
-
() => ci(
|
|
2153
|
-
[
|
|
2154
|
-
),
|
|
2141
|
+
ke.current || !Q || Y.totalSeats === 0 || ie.width <= 0 || (ke.current = !0, oe(Y.bounds, ie));
|
|
2142
|
+
}, [oe, Y, ie, Q]);
|
|
2143
|
+
const Ee = F(() => ii(he, ie, 40), [he, ie]), we = v !== "auto" ? v : b ? "seat" : void 0, ge = F(
|
|
2144
|
+
() => ci(Y, Ee, P, we),
|
|
2145
|
+
[Y, Ee, P, we]
|
|
2146
|
+
), Se = ye(null);
|
|
2155
2147
|
Fe(() => {
|
|
2156
|
-
|
|
2157
|
-
}, [ge.tier,
|
|
2148
|
+
Se.current !== ge.tier && (Se.current = ge.tier, g == null || g(ge.tier));
|
|
2149
|
+
}, [ge.tier, g]);
|
|
2158
2150
|
const He = F(
|
|
2159
2151
|
() => {
|
|
2160
|
-
var
|
|
2161
|
-
return new Map(((
|
|
2152
|
+
var $;
|
|
2153
|
+
return new Map((($ = t.sections) == null ? void 0 : $.map((O) => [O.id, O.color])) ?? []);
|
|
2162
2154
|
},
|
|
2163
2155
|
[t.sections]
|
|
2164
2156
|
), ve = F(
|
|
2165
2157
|
() => {
|
|
2166
|
-
var
|
|
2167
|
-
return new Map(((
|
|
2158
|
+
var $;
|
|
2159
|
+
return new Map((($ = t.sections) == null ? void 0 : $.map((O) => [O.id, O])) ?? []);
|
|
2168
2160
|
},
|
|
2169
2161
|
[t.sections]
|
|
2170
2162
|
), ue = j(
|
|
2171
|
-
(
|
|
2172
|
-
const O = ve.get(
|
|
2163
|
+
($) => {
|
|
2164
|
+
const O = ve.get($.sectorId), H = Ae($, m), ne = pn($), re = [
|
|
2173
2165
|
O ? O.name : "",
|
|
2174
|
-
n("seatingChart.rowN", "row {row}").replace("{row}", String(
|
|
2175
|
-
n("seatingChart.seatN", "seat {number}").replace("{number}", String(
|
|
2166
|
+
n("seatingChart.rowN", "row {row}").replace("{row}", String($.row)),
|
|
2167
|
+
n("seatingChart.seatN", "seat {number}").replace("{number}", String($.number))
|
|
2176
2168
|
].filter(Boolean);
|
|
2177
2169
|
if (O && o.showPrices !== !1) {
|
|
2178
|
-
const pe = In(
|
|
2170
|
+
const pe = In($, t, O);
|
|
2179
2171
|
re.push(ce(pe.amount, pe.currency, A));
|
|
2180
2172
|
}
|
|
2181
2173
|
return re.push(n(`seatingChart.status.${H}`, H)), ne === "wheelchair" && re.push(n("seatingChart.wheelchairAccessible", "wheelchair accessible")), ne === "companion" && re.push(n("seatingChart.companionSeat", "companion seat")), re.join(", ");
|
|
2182
2174
|
},
|
|
2183
2175
|
[t, ve, m, o.showPrices, A, n]
|
|
2184
2176
|
), le = j(
|
|
2185
|
-
(
|
|
2186
|
-
u === void 0 &&
|
|
2177
|
+
($) => {
|
|
2178
|
+
u === void 0 && C($), c == null || c($);
|
|
2187
2179
|
},
|
|
2188
2180
|
[u, c]
|
|
2189
|
-
),
|
|
2190
|
-
(
|
|
2191
|
-
if (h == null || h(
|
|
2181
|
+
), Te = j(
|
|
2182
|
+
($) => {
|
|
2183
|
+
if (h == null || h($), !G)
|
|
2192
2184
|
return;
|
|
2193
|
-
const O = di(
|
|
2185
|
+
const O = di(x, $.id, Y, o, m);
|
|
2194
2186
|
if ("rejected" in O) {
|
|
2195
|
-
l == null || l({ reason: O.rejected, seatId:
|
|
2187
|
+
l == null || l({ reason: O.rejected, seatId: $.id }), q(
|
|
2196
2188
|
n(`seatingChart.rejection.${O.rejected}`, yi[O.rejected])
|
|
2197
2189
|
);
|
|
2198
2190
|
return;
|
|
2199
2191
|
}
|
|
2200
2192
|
le(O.selected), q(
|
|
2201
|
-
n("seatingChart.seatSelected", "{seat}. {count} of {max} selected.").replace("{seat}", ue(
|
|
2193
|
+
n("seatingChart.seatSelected", "{seat}. {count} of {max} selected.").replace("{seat}", ue($)).replace("{count}", String(O.selected.length)).replace("{max}", String(ee))
|
|
2202
2194
|
);
|
|
2203
2195
|
},
|
|
2204
2196
|
[
|
|
2205
2197
|
n,
|
|
2206
2198
|
le,
|
|
2207
2199
|
ue,
|
|
2208
|
-
|
|
2200
|
+
Y,
|
|
2209
2201
|
G,
|
|
2210
2202
|
ee,
|
|
2211
2203
|
h,
|
|
2212
2204
|
l,
|
|
2213
2205
|
m,
|
|
2214
|
-
|
|
2206
|
+
x,
|
|
2215
2207
|
o
|
|
2216
2208
|
]
|
|
2217
2209
|
), fe = j(
|
|
2218
|
-
(
|
|
2210
|
+
($, O) => {
|
|
2219
2211
|
if (z) {
|
|
2220
|
-
z(
|
|
2212
|
+
z($, O);
|
|
2221
2213
|
return;
|
|
2222
2214
|
}
|
|
2223
|
-
const H = ui(
|
|
2215
|
+
const H = ui(Y, $, o, O, m);
|
|
2224
2216
|
if (H.length === 0) {
|
|
2225
2217
|
q(
|
|
2226
2218
|
n(
|
|
2227
2219
|
"seatingChart.noBlockAvailable",
|
|
2228
2220
|
"No block of {count} seats together is available."
|
|
2229
|
-
).replace("{count}", String(
|
|
2221
|
+
).replace("{count}", String($))
|
|
2230
2222
|
);
|
|
2231
2223
|
return;
|
|
2232
2224
|
}
|
|
2233
|
-
le(H),
|
|
2225
|
+
le(H), L(H[0]), q(
|
|
2234
2226
|
n("seatingChart.selectedTogether", "Selected {count} seats together.").replace(
|
|
2235
2227
|
"{count}",
|
|
2236
2228
|
String(H.length)
|
|
2237
2229
|
)
|
|
2238
2230
|
);
|
|
2239
2231
|
},
|
|
2240
|
-
[le,
|
|
2241
|
-
),
|
|
2242
|
-
(
|
|
2243
|
-
const O =
|
|
2232
|
+
[le, Y, z, m, o, n]
|
|
2233
|
+
), Me = j(
|
|
2234
|
+
($) => {
|
|
2235
|
+
const O = Y.locationById.get($);
|
|
2244
2236
|
if (!O)
|
|
2245
2237
|
return;
|
|
2246
|
-
const H =
|
|
2238
|
+
const H = Y.rows.find(
|
|
2247
2239
|
(ne) => ne.sectionId === O.sectionId && ne.rowIndex === O.rowIndex
|
|
2248
2240
|
);
|
|
2249
2241
|
H && oe(H.bounds, ie, 80);
|
|
2250
2242
|
},
|
|
2251
|
-
[oe,
|
|
2243
|
+
[oe, Y, ie]
|
|
2252
2244
|
), _e = j(
|
|
2253
|
-
(
|
|
2254
|
-
if (
|
|
2245
|
+
($) => {
|
|
2246
|
+
if (!$)
|
|
2255
2247
|
return;
|
|
2256
|
-
$
|
|
2257
|
-
const O =
|
|
2248
|
+
L($), Me($);
|
|
2249
|
+
const O = Y.seatById.get($);
|
|
2258
2250
|
O && q(ue(O));
|
|
2259
2251
|
},
|
|
2260
|
-
[ue,
|
|
2261
|
-
), Qe = (
|
|
2252
|
+
[ue, Y.seatById, Me]
|
|
2253
|
+
), Qe = ($) => {
|
|
2262
2254
|
var re, pe;
|
|
2263
|
-
const O = b ?? ((pe = (re =
|
|
2255
|
+
const O = b ?? ((pe = (re = Y.rows[0]) == null ? void 0 : re.seats[0]) == null ? void 0 : pe.id) ?? null;
|
|
2264
2256
|
if (!O)
|
|
2265
2257
|
return;
|
|
2266
2258
|
const ne = {
|
|
@@ -2270,24 +2262,24 @@ const yi = {
|
|
|
2270
2262
|
ArrowDown: "down",
|
|
2271
2263
|
Home: "row-start",
|
|
2272
2264
|
End: "row-end"
|
|
2273
|
-
}[
|
|
2265
|
+
}[$.key];
|
|
2274
2266
|
if (ne) {
|
|
2275
|
-
|
|
2267
|
+
$.preventDefault(), _e(b ? mi(Y, O, ne) : O);
|
|
2276
2268
|
return;
|
|
2277
2269
|
}
|
|
2278
|
-
if (
|
|
2279
|
-
|
|
2270
|
+
if ($.key === "PageDown" || $.key === "PageUp") {
|
|
2271
|
+
$.preventDefault(), _e(pi(Y, b, $.key === "PageDown" ? "next" : "prev"));
|
|
2280
2272
|
return;
|
|
2281
2273
|
}
|
|
2282
|
-
if (
|
|
2283
|
-
|
|
2284
|
-
const Oe =
|
|
2285
|
-
Oe &&
|
|
2274
|
+
if ($.key === "Enter" || $.key === " ") {
|
|
2275
|
+
$.preventDefault();
|
|
2276
|
+
const Oe = Y.seatById.get(O);
|
|
2277
|
+
Oe && Te(Oe);
|
|
2286
2278
|
return;
|
|
2287
2279
|
}
|
|
2288
|
-
|
|
2280
|
+
$.key === "Escape" && x.length > 0 && ($.preventDefault(), le([]), q(n("seatingChart.selectionCleared", "Selection cleared.")));
|
|
2289
2281
|
};
|
|
2290
|
-
if (
|
|
2282
|
+
if (Y.totalSeats === 0)
|
|
2291
2283
|
return /* @__PURE__ */ e("div", { ref: r, className: `nice-seating-chart ${w ?? ""}`, style: N, children: /* @__PURE__ */ e(
|
|
2292
2284
|
Ne,
|
|
2293
2285
|
{
|
|
@@ -2298,34 +2290,34 @@ const yi = {
|
|
|
2298
2290
|
)
|
|
2299
2291
|
}
|
|
2300
2292
|
) });
|
|
2301
|
-
const
|
|
2302
|
-
const H =
|
|
2303
|
-
return !H || !ne ?
|
|
2304
|
-
}, 0),
|
|
2305
|
-
return /* @__PURE__ */
|
|
2293
|
+
const Ce = x.reduce(($, O) => {
|
|
2294
|
+
const H = Y.seatById.get(O), ne = H ? ve.get(H.sectorId) : void 0;
|
|
2295
|
+
return !H || !ne ? $ : $ + In(H, t, ne).amount;
|
|
2296
|
+
}, 0), xe = ((Le = (me = t.sections) == null ? void 0 : me[0]) == null ? void 0 : Le.currency) ?? "PLN";
|
|
2297
|
+
return /* @__PURE__ */ s(
|
|
2306
2298
|
"div",
|
|
2307
2299
|
{
|
|
2308
2300
|
ref: r,
|
|
2309
2301
|
className: `nice-seating-chart nice-seating-chart--${d} ${w ?? ""}`,
|
|
2310
2302
|
style: N,
|
|
2311
2303
|
children: [
|
|
2312
|
-
/* @__PURE__ */
|
|
2304
|
+
/* @__PURE__ */ s(
|
|
2313
2305
|
"div",
|
|
2314
2306
|
{
|
|
2315
|
-
ref:
|
|
2307
|
+
ref: I,
|
|
2316
2308
|
className: "nice-seating-chart__canvas-host",
|
|
2317
2309
|
role: "grid",
|
|
2318
2310
|
"aria-label": n("seatingChart.chartLabel", "{name} seating chart").replace(
|
|
2319
2311
|
"{name}",
|
|
2320
2312
|
t.name
|
|
2321
2313
|
),
|
|
2322
|
-
"aria-rowcount":
|
|
2323
|
-
"aria-colcount":
|
|
2314
|
+
"aria-rowcount": Y.rows.length,
|
|
2315
|
+
"aria-colcount": Y.totalSeats,
|
|
2324
2316
|
tabIndex: b ? -1 : 0,
|
|
2325
2317
|
onKeyDown: Qe,
|
|
2326
2318
|
...be.containerProps,
|
|
2327
2319
|
children: [
|
|
2328
|
-
/* @__PURE__ */
|
|
2320
|
+
/* @__PURE__ */ s(
|
|
2329
2321
|
"svg",
|
|
2330
2322
|
{
|
|
2331
2323
|
className: "nice-seating-chart__canvas",
|
|
@@ -2353,10 +2345,10 @@ const yi = {
|
|
|
2353
2345
|
statusOverrides: m,
|
|
2354
2346
|
sectionColorById: He,
|
|
2355
2347
|
interactive: G,
|
|
2356
|
-
onSeatClick:
|
|
2357
|
-
onSectionClick: o.sectionSelect ? (
|
|
2348
|
+
onSeatClick: Te,
|
|
2349
|
+
onSectionClick: o.sectionSelect ? ($) => {
|
|
2358
2350
|
var H;
|
|
2359
|
-
const O = (H =
|
|
2351
|
+
const O = (H = Y.rows.find((ne) => ne.sectionId === $)) == null ? void 0 : H.seats[0];
|
|
2360
2352
|
O && _e(O.id);
|
|
2361
2353
|
} : void 0,
|
|
2362
2354
|
describeSeat: ue
|
|
@@ -2365,7 +2357,7 @@ const yi = {
|
|
|
2365
2357
|
]
|
|
2366
2358
|
}
|
|
2367
2359
|
),
|
|
2368
|
-
p && /* @__PURE__ */
|
|
2360
|
+
p && /* @__PURE__ */ s("div", { className: "nice-seating-chart__zoom", children: [
|
|
2369
2361
|
/* @__PURE__ */ e(
|
|
2370
2362
|
U,
|
|
2371
2363
|
{
|
|
@@ -2392,8 +2384,8 @@ const yi = {
|
|
|
2392
2384
|
size: "sm",
|
|
2393
2385
|
variant: "ghost",
|
|
2394
2386
|
ariaLabel: n("seatingChart.fitToView", "Fit to view"),
|
|
2395
|
-
onClick: () => oe(
|
|
2396
|
-
children: /* @__PURE__ */ e(
|
|
2387
|
+
onClick: () => oe(Y.bounds, ie),
|
|
2388
|
+
children: /* @__PURE__ */ e(St, { size: 16 })
|
|
2397
2389
|
}
|
|
2398
2390
|
)
|
|
2399
2391
|
] })
|
|
@@ -2401,42 +2393,35 @@ const yi = {
|
|
|
2401
2393
|
}
|
|
2402
2394
|
),
|
|
2403
2395
|
/* @__PURE__ */ e("p", { className: "nice-seating-chart__status", role: "status", "aria-live": "polite", children: K }),
|
|
2404
|
-
T && /* @__PURE__ */
|
|
2405
|
-
(
|
|
2396
|
+
T && /* @__PURE__ */ s("ul", { className: "nice-seating-chart__legend", children: [
|
|
2397
|
+
(Ie = t.priceCategories) == null ? void 0 : Ie.map(($) => /* @__PURE__ */ s("li", { className: "nice-seating-chart__legend-item", children: [
|
|
2406
2398
|
/* @__PURE__ */ e(
|
|
2407
2399
|
"span",
|
|
2408
2400
|
{
|
|
2409
2401
|
className: "nice-seating-chart__legend-swatch",
|
|
2410
|
-
style: { background:
|
|
2402
|
+
style: { background: $.color },
|
|
2411
2403
|
"aria-hidden": "true"
|
|
2412
2404
|
}
|
|
2413
2405
|
),
|
|
2414
|
-
|
|
2406
|
+
$.name,
|
|
2415
2407
|
" · ",
|
|
2416
|
-
ce(
|
|
2417
|
-
] },
|
|
2418
|
-
/* @__PURE__ */
|
|
2408
|
+
ce($.price, xe, A)
|
|
2409
|
+
] }, $.id)),
|
|
2410
|
+
/* @__PURE__ */ s("li", { className: "nice-seating-chart__legend-item nice-seating-chart__legend-item--sold", children: [
|
|
2419
2411
|
/* @__PURE__ */ e("span", { className: "nice-seating-chart__legend-swatch", "aria-hidden": "true" }),
|
|
2420
2412
|
" ",
|
|
2421
2413
|
n("seatingChart.sold", "Sold")
|
|
2422
2414
|
] })
|
|
2423
2415
|
] }),
|
|
2424
|
-
d === "select" &&
|
|
2425
|
-
I.length,
|
|
2426
|
-
" seat",
|
|
2427
|
-
I.length === 1 ? "" : "s",
|
|
2428
|
-
" ·",
|
|
2429
|
-
" ",
|
|
2430
|
-
ce(Te, Me, A)
|
|
2431
|
-
] }),
|
|
2416
|
+
d === "select" && x.length > 0 && /* @__PURE__ */ e("p", { className: "nice-seating-chart__total", children: x.length === 1 ? n("seatingChart.seatsOne", "{selected} seat · {amount}").replace("{selected}", String(x.length)).replace("{amount}", String(ce(Ce, xe, A))) : n("seatingChart.seatsMany", "{selected} seats · {amount}").replace("{selected}", String(x.length)).replace("{amount}", String(ce(Ce, xe, A))) }),
|
|
2432
2417
|
f && /* @__PURE__ */ e(
|
|
2433
2418
|
vi,
|
|
2434
2419
|
{
|
|
2435
|
-
index:
|
|
2420
|
+
index: Y,
|
|
2436
2421
|
selectedIds: V,
|
|
2437
2422
|
statusOverrides: m,
|
|
2438
2423
|
maxSeats: ee,
|
|
2439
|
-
onSeatToggle:
|
|
2424
|
+
onSeatToggle: Te,
|
|
2440
2425
|
onBestAvailable: fe,
|
|
2441
2426
|
describeSeat: ue,
|
|
2442
2427
|
disabled: !G,
|
|
@@ -2467,29 +2452,29 @@ const yi = {
|
|
|
2467
2452
|
'"': """,
|
|
2468
2453
|
"'": "'"
|
|
2469
2454
|
};
|
|
2470
|
-
function wi(
|
|
2471
|
-
return
|
|
2455
|
+
function wi(a) {
|
|
2456
|
+
return a.replace(/[&<>"']/g, (i) => ki[i] ?? i);
|
|
2472
2457
|
}
|
|
2473
|
-
function
|
|
2458
|
+
function Si(a) {
|
|
2474
2459
|
const i = [], r = /* @__PURE__ */ new Set();
|
|
2475
|
-
for (const n of
|
|
2460
|
+
for (const n of a.matchAll(qn)) {
|
|
2476
2461
|
const t = n[1];
|
|
2477
2462
|
r.has(t) || (r.add(t), i.push(t));
|
|
2478
2463
|
}
|
|
2479
2464
|
return i;
|
|
2480
2465
|
}
|
|
2481
|
-
function
|
|
2466
|
+
function Ci(a, i = {}, r = {}) {
|
|
2482
2467
|
const { escape: n = !0, missing: t = "keep" } = r;
|
|
2483
|
-
return
|
|
2468
|
+
return a.replace(qn, (d, o) => {
|
|
2484
2469
|
const u = i[o];
|
|
2485
2470
|
return u == null ? t === "blank" ? "" : d : n ? wi(String(u)) : String(u);
|
|
2486
2471
|
});
|
|
2487
2472
|
}
|
|
2488
|
-
function Pn(
|
|
2489
|
-
return `{{${
|
|
2473
|
+
function Pn(a) {
|
|
2474
|
+
return `{{${a}}}`;
|
|
2490
2475
|
}
|
|
2491
|
-
function
|
|
2492
|
-
return
|
|
2476
|
+
function xi(a, i = {}) {
|
|
2477
|
+
return Si(a).filter((r) => i[r] === void 0 || i[r] === null);
|
|
2493
2478
|
}
|
|
2494
2479
|
const Ii = { name: "", body: "" }, Pi = [
|
|
2495
2480
|
"bold",
|
|
@@ -2517,8 +2502,8 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2517
2502
|
onSend: m,
|
|
2518
2503
|
sending: h = !1,
|
|
2519
2504
|
toolbar: z = Pi,
|
|
2520
|
-
disabled:
|
|
2521
|
-
readOnly:
|
|
2505
|
+
disabled: v = !1,
|
|
2506
|
+
readOnly: g = !1,
|
|
2522
2507
|
size: P = "md",
|
|
2523
2508
|
className: k,
|
|
2524
2509
|
style: T
|
|
@@ -2528,32 +2513,32 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2528
2513
|
fallbackValue: Ii,
|
|
2529
2514
|
onChange: o,
|
|
2530
2515
|
componentName: "NiceInvitationDesigner"
|
|
2531
|
-
}), [A, y] =
|
|
2516
|
+
}), [A, y] = D(""), M = v || g || h, w = F(() => Fn(A), [A]), N = F(() => {
|
|
2532
2517
|
const b = {};
|
|
2533
|
-
for (const
|
|
2534
|
-
|
|
2518
|
+
for (const L of u)
|
|
2519
|
+
L.sample !== void 0 && (b[L.key] = L.sample);
|
|
2535
2520
|
return { ...b, ..._ };
|
|
2536
|
-
}, [u, _]),
|
|
2537
|
-
() =>
|
|
2521
|
+
}, [u, _]), I = F(
|
|
2522
|
+
() => Ci(f.body ?? "", N),
|
|
2538
2523
|
[f.body, N]
|
|
2539
|
-
),
|
|
2540
|
-
() =>
|
|
2524
|
+
), B = F(
|
|
2525
|
+
() => xi(f.body ?? "", N),
|
|
2541
2526
|
[f.body, N]
|
|
2542
|
-
), X = c.map((b) => b.email), E = (b) => p({ ...f, ...b }),
|
|
2527
|
+
), X = c.map((b) => b.email), E = (b) => p({ ...f, ...b }), R = (b) => {
|
|
2543
2528
|
E({ body: `${f.body ?? ""}${Pn(b)}` });
|
|
2544
2529
|
}, W = () => {
|
|
2545
2530
|
!l || w.valid.length === 0 || (l(Ht(X, w.valid)), y(""));
|
|
2546
|
-
},
|
|
2547
|
-
l == null || l(X.filter((
|
|
2531
|
+
}, C = (b) => {
|
|
2532
|
+
l == null || l(X.filter((L) => L !== b));
|
|
2548
2533
|
};
|
|
2549
|
-
return /* @__PURE__ */
|
|
2534
|
+
return /* @__PURE__ */ s(
|
|
2550
2535
|
"div",
|
|
2551
2536
|
{
|
|
2552
2537
|
ref: r,
|
|
2553
2538
|
className: `nice-invitation-designer nice-invitation-designer--${P} ${k ?? ""}`,
|
|
2554
2539
|
style: T,
|
|
2555
2540
|
children: [
|
|
2556
|
-
/* @__PURE__ */
|
|
2541
|
+
/* @__PURE__ */ s("section", { className: "nice-invitation-designer__editor", children: [
|
|
2557
2542
|
/* @__PURE__ */ e(
|
|
2558
2543
|
Z,
|
|
2559
2544
|
{
|
|
@@ -2565,71 +2550,71 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2565
2550
|
size: P
|
|
2566
2551
|
}
|
|
2567
2552
|
),
|
|
2568
|
-
u.length > 0 && !
|
|
2569
|
-
/* @__PURE__ */ e("span", { className: "nice-invitation-designer__tokens-label", children: "Insert:" }),
|
|
2553
|
+
u.length > 0 && !g && /* @__PURE__ */ s("div", { className: "nice-invitation-designer__tokens", children: [
|
|
2554
|
+
/* @__PURE__ */ e("span", { className: "nice-invitation-designer__tokens-label", children: n("invitationDesigner.insert", "Insert:") }),
|
|
2570
2555
|
u.map((b) => /* @__PURE__ */ e(
|
|
2571
2556
|
U,
|
|
2572
2557
|
{
|
|
2573
2558
|
size: "sm",
|
|
2574
2559
|
variant: "outline",
|
|
2575
2560
|
disabled: M,
|
|
2576
|
-
onClick: () =>
|
|
2561
|
+
onClick: () => R(b.key),
|
|
2577
2562
|
children: b.label
|
|
2578
2563
|
},
|
|
2579
2564
|
b.key
|
|
2580
2565
|
))
|
|
2581
2566
|
] }),
|
|
2582
2567
|
/* @__PURE__ */ e(
|
|
2583
|
-
|
|
2568
|
+
Yt,
|
|
2584
2569
|
{
|
|
2585
2570
|
value: f.body ?? "",
|
|
2586
2571
|
onChange: (b) => E({ body: b }),
|
|
2587
2572
|
toolbar: z,
|
|
2588
2573
|
height: 280,
|
|
2589
|
-
readOnly:
|
|
2590
|
-
disabled:
|
|
2574
|
+
readOnly: g || h,
|
|
2575
|
+
disabled: v
|
|
2591
2576
|
}
|
|
2592
2577
|
)
|
|
2593
2578
|
] }),
|
|
2594
|
-
/* @__PURE__ */
|
|
2579
|
+
/* @__PURE__ */ s(
|
|
2595
2580
|
"section",
|
|
2596
2581
|
{
|
|
2597
2582
|
className: "nice-invitation-designer__preview",
|
|
2598
2583
|
"aria-label": n("invitationDesigner.invitationPreview", "Invitation preview"),
|
|
2599
2584
|
children: [
|
|
2600
|
-
/* @__PURE__ */
|
|
2585
|
+
/* @__PURE__ */ s("header", { className: "nice-invitation-designer__preview-header", children: [
|
|
2601
2586
|
/* @__PURE__ */ e("h4", { children: n("invitationDesigner.preview", "Preview") }),
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2587
|
+
B.length > 0 && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: "warning", children: n("invitationDesigner.unresolved", "{unresolved} unresolved").replace(
|
|
2588
|
+
"{unresolved}",
|
|
2589
|
+
String(B.length)
|
|
2590
|
+
) })
|
|
2606
2591
|
] }),
|
|
2607
2592
|
f.coverImageUrl && /* @__PURE__ */ e("img", { className: "nice-invitation-designer__cover", src: f.coverImageUrl, alt: "" }),
|
|
2608
2593
|
/* @__PURE__ */ e(
|
|
2609
2594
|
"div",
|
|
2610
2595
|
{
|
|
2611
2596
|
className: "nice-invitation-designer__preview-body",
|
|
2612
|
-
dangerouslySetInnerHTML: { __html:
|
|
2597
|
+
dangerouslySetInnerHTML: { __html: I }
|
|
2613
2598
|
}
|
|
2614
2599
|
),
|
|
2615
|
-
|
|
2616
|
-
"
|
|
2617
|
-
|
|
2618
|
-
|
|
2600
|
+
B.length > 0 && /* @__PURE__ */ e("p", { className: "nice-invitation-designer__unresolved", children: n(
|
|
2601
|
+
"invitationDesigner.noPreviewValueFor",
|
|
2602
|
+
"No preview value for: {unresolved}"
|
|
2603
|
+
).replace("{unresolved}", String(B.map((b) => Pn(b)).join(", "))) })
|
|
2619
2604
|
]
|
|
2620
2605
|
}
|
|
2621
2606
|
),
|
|
2622
|
-
/* @__PURE__ */
|
|
2623
|
-
/* @__PURE__ */ e("header", { className: "nice-invitation-designer__recipients-header", children: /* @__PURE__ */
|
|
2607
|
+
/* @__PURE__ */ s("section", { className: "nice-invitation-designer__recipients", children: [
|
|
2608
|
+
/* @__PURE__ */ e("header", { className: "nice-invitation-designer__recipients-header", children: /* @__PURE__ */ s("h4", { children: [
|
|
2624
2609
|
n("invitationDesigner.recipients", "Recipients"),
|
|
2625
2610
|
" ",
|
|
2626
|
-
/* @__PURE__ */
|
|
2611
|
+
/* @__PURE__ */ s("span", { children: [
|
|
2627
2612
|
"(",
|
|
2628
2613
|
c.length,
|
|
2629
2614
|
")"
|
|
2630
2615
|
] })
|
|
2631
2616
|
] }) }),
|
|
2632
|
-
l && !
|
|
2617
|
+
l && !g && /* @__PURE__ */ s(Ge, { children: [
|
|
2633
2618
|
/* @__PURE__ */ e(
|
|
2634
2619
|
on,
|
|
2635
2620
|
{
|
|
@@ -2645,13 +2630,13 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2645
2630
|
size: P
|
|
2646
2631
|
}
|
|
2647
2632
|
),
|
|
2648
|
-
/* @__PURE__ */
|
|
2633
|
+
/* @__PURE__ */ s("div", { className: "nice-invitation-designer__paste-actions", children: [
|
|
2649
2634
|
/* @__PURE__ */ e(
|
|
2650
2635
|
U,
|
|
2651
2636
|
{
|
|
2652
2637
|
size: P,
|
|
2653
2638
|
variant: "outline",
|
|
2654
|
-
leftIcon: /* @__PURE__ */ e(
|
|
2639
|
+
leftIcon: /* @__PURE__ */ e($n, { size: 15 }),
|
|
2655
2640
|
disabled: M || w.valid.length === 0,
|
|
2656
2641
|
onClick: W,
|
|
2657
2642
|
children: w.valid.length > 0 ? n("invitationDesigner.addN", "Add ({count})").replace(
|
|
@@ -2660,7 +2645,7 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2660
2645
|
) : n("invitationDesigner.add", "Add")
|
|
2661
2646
|
}
|
|
2662
2647
|
),
|
|
2663
|
-
(w.invalid.length > 0 || w.duplicates > 0) && /* @__PURE__ */
|
|
2648
|
+
(w.invalid.length > 0 || w.duplicates > 0) && /* @__PURE__ */ s("span", { className: "nice-invitation-designer__paste-hint", children: [
|
|
2664
2649
|
w.duplicates > 0 && `${n("invitationDesigner.duplicates", "{count} duplicate(s).").replace(
|
|
2665
2650
|
"{count}",
|
|
2666
2651
|
String(w.duplicates)
|
|
@@ -2669,7 +2654,7 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2669
2654
|
] })
|
|
2670
2655
|
] })
|
|
2671
2656
|
] }),
|
|
2672
|
-
c.length > 0 && /* @__PURE__ */ e("ul", { className: "nice-invitation-designer__recipient-list", children: c.map((b) => /* @__PURE__ */
|
|
2657
|
+
c.length > 0 && /* @__PURE__ */ e("ul", { className: "nice-invitation-designer__recipient-list", children: c.map((b) => /* @__PURE__ */ s("li", { className: "nice-invitation-designer__recipient", children: [
|
|
2673
2658
|
/* @__PURE__ */ e("span", { children: b.name ? `${b.name} <${b.email}>` : b.email }),
|
|
2674
2659
|
b.status && b.status !== "pending" && /* @__PURE__ */ e(
|
|
2675
2660
|
ae,
|
|
@@ -2680,7 +2665,7 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2680
2665
|
children: n(`invitationDesigner.recipientStatus.${b.status}`, b.status)
|
|
2681
2666
|
}
|
|
2682
2667
|
),
|
|
2683
|
-
l && !
|
|
2668
|
+
l && !g && /* @__PURE__ */ e(
|
|
2684
2669
|
U,
|
|
2685
2670
|
{
|
|
2686
2671
|
size: "sm",
|
|
@@ -2690,20 +2675,20 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2690
2675
|
b.email
|
|
2691
2676
|
),
|
|
2692
2677
|
disabled: M,
|
|
2693
|
-
onClick: () =>
|
|
2694
|
-
children: /* @__PURE__ */ e(
|
|
2678
|
+
onClick: () => C(b.email),
|
|
2679
|
+
children: /* @__PURE__ */ e(De, { size: 13 })
|
|
2695
2680
|
}
|
|
2696
2681
|
)
|
|
2697
2682
|
] }, b.email)) }),
|
|
2698
|
-
m && !
|
|
2683
|
+
m && !g && /* @__PURE__ */ e(
|
|
2699
2684
|
U,
|
|
2700
2685
|
{
|
|
2701
2686
|
variant: "primary",
|
|
2702
2687
|
size: P,
|
|
2703
|
-
leftIcon: /* @__PURE__ */ e(
|
|
2688
|
+
leftIcon: /* @__PURE__ */ e(Ct, { size: 15 }),
|
|
2704
2689
|
loading: h,
|
|
2705
2690
|
ariaLabel: n("invitationDesigner.sendInvitations", "Send invitations"),
|
|
2706
|
-
disabled:
|
|
2691
|
+
disabled: v || h || c.length === 0,
|
|
2707
2692
|
onClick: () => m({ templateId: f.id, emails: X }),
|
|
2708
2693
|
children: h ? n("invitationDesigner.sending", "Sending…") : n("invitationDesigner.sendTo", "Send to {count}").replace(
|
|
2709
2694
|
"{count}",
|
|
@@ -2716,32 +2701,32 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2716
2701
|
}
|
|
2717
2702
|
);
|
|
2718
2703
|
}), zi = ({
|
|
2719
|
-
value:
|
|
2704
|
+
value: a,
|
|
2720
2705
|
max: i,
|
|
2721
2706
|
currency: r,
|
|
2722
2707
|
locale: n,
|
|
2723
2708
|
label: t,
|
|
2724
2709
|
className: d
|
|
2725
2710
|
}) => {
|
|
2726
|
-
const o = i > 0 ? i : 1, u =
|
|
2711
|
+
const o = i > 0 ? i : 1, u = a >= i && i > 0, _ = (c, l) => r ? `${ce(c, r, n)} / ${ce(l, r, n)}` : `${c} / ${l}`;
|
|
2727
2712
|
return /* @__PURE__ */ e(
|
|
2728
2713
|
Ut,
|
|
2729
2714
|
{
|
|
2730
2715
|
className: d,
|
|
2731
|
-
value: Math.min(
|
|
2716
|
+
value: Math.min(a, o),
|
|
2732
2717
|
max: o,
|
|
2733
2718
|
variant: u ? "success" : "primary",
|
|
2734
2719
|
size: "sm",
|
|
2735
2720
|
showValue: !0,
|
|
2736
|
-
formatValue: () => _(
|
|
2721
|
+
formatValue: () => _(a, i),
|
|
2737
2722
|
"aria-label": t
|
|
2738
2723
|
}
|
|
2739
2724
|
);
|
|
2740
2725
|
}, Ai = [];
|
|
2741
|
-
function Ti(
|
|
2726
|
+
function Ti(a, i) {
|
|
2742
2727
|
if (i === "wishlist")
|
|
2743
|
-
return { value:
|
|
2744
|
-
const r =
|
|
2728
|
+
return { value: a.isPurchased ? 1 : 0, max: 1, complete: !!a.isPurchased };
|
|
2729
|
+
const r = a.quantityNeeded ?? 1, n = a.quantityContributed ?? 0;
|
|
2745
2730
|
return { value: n, max: r, complete: r > 0 && n >= r };
|
|
2746
2731
|
}
|
|
2747
2732
|
const la = /* @__PURE__ */ te(
|
|
@@ -2757,8 +2742,8 @@ const la = /* @__PURE__ */ te(
|
|
|
2757
2742
|
currentUserName: m,
|
|
2758
2743
|
onContribute: h,
|
|
2759
2744
|
onClaim: z,
|
|
2760
|
-
onUnclaim:
|
|
2761
|
-
onItemAdd:
|
|
2745
|
+
onUnclaim: v,
|
|
2746
|
+
onItemAdd: g,
|
|
2762
2747
|
onItemDelete: P,
|
|
2763
2748
|
onItemClick: k,
|
|
2764
2749
|
layout: T = "grid",
|
|
@@ -2767,14 +2752,14 @@ const la = /* @__PURE__ */ te(
|
|
|
2767
2752
|
size: A = "md",
|
|
2768
2753
|
className: y,
|
|
2769
2754
|
style: M
|
|
2770
|
-
} = i, w = Xn({ currentUserId: l, currentUserName: m }), [N,
|
|
2771
|
-
(
|
|
2755
|
+
} = i, w = Xn({ currentUserId: l, currentUserName: m }), [N, I] = D(null), [B, X] = D(0), [E, R] = D(""), W = o === "owner", C = f || p, b = d === "wishlist", L = F(() => b ? [...t].sort(
|
|
2756
|
+
(x, V) => Number(x.isPurchased ?? !1) - Number(V.isPurchased ?? !1) || (V.priority ?? 0) - (x.priority ?? 0)
|
|
2772
2757
|
) : t, [t, b]), K = () => {
|
|
2773
|
-
|
|
2774
|
-
}, q = (
|
|
2775
|
-
!h || !w.canAct || (h(
|
|
2776
|
-
amount:
|
|
2777
|
-
quantity:
|
|
2758
|
+
I(null), X(0);
|
|
2759
|
+
}, q = (x) => {
|
|
2760
|
+
!h || !w.canAct || (h(x.id, {
|
|
2761
|
+
amount: B > 0 ? B : void 0,
|
|
2762
|
+
quantity: B > 0 ? void 0 : 1,
|
|
2778
2763
|
userName: w.actor.userName,
|
|
2779
2764
|
userId: w.actor.userId
|
|
2780
2765
|
}), K());
|
|
@@ -2782,11 +2767,11 @@ const la = /* @__PURE__ */ te(
|
|
|
2782
2767
|
return t.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-gift-registry ${y ?? ""}`, style: M, children: /* @__PURE__ */ e(
|
|
2783
2768
|
Ne,
|
|
2784
2769
|
{
|
|
2785
|
-
icon: /* @__PURE__ */ e(
|
|
2770
|
+
icon: /* @__PURE__ */ e(xt, { size: 28 }),
|
|
2786
2771
|
title: b ? n("giftRegistry.emptyWishlist", "Nothing on the wishlist yet") : n("giftRegistry.emptyRegistry", "No gifts on the registry yet"),
|
|
2787
2772
|
description: W ? n("giftRegistry.emptyOwnerHint", "Add what you would like and share the link.") : n("giftRegistry.emptyGuestHint", "The host has not added anything yet.")
|
|
2788
2773
|
}
|
|
2789
|
-
) }) : /* @__PURE__ */
|
|
2774
|
+
) }) : /* @__PURE__ */ s(
|
|
2790
2775
|
"div",
|
|
2791
2776
|
{
|
|
2792
2777
|
ref: r,
|
|
@@ -2801,51 +2786,51 @@ const la = /* @__PURE__ */ te(
|
|
|
2801
2786
|
onChange: w.setName,
|
|
2802
2787
|
placeholder: n("giftRegistry.soTheHostKnowsWho", "So the host knows who to thank"),
|
|
2803
2788
|
required: !0,
|
|
2804
|
-
disabled:
|
|
2789
|
+
disabled: C,
|
|
2805
2790
|
size: A
|
|
2806
2791
|
}
|
|
2807
2792
|
),
|
|
2808
|
-
/* @__PURE__ */ e(
|
|
2809
|
-
const { value: V, max: G, complete: ee } = Ti(
|
|
2810
|
-
return /* @__PURE__ */
|
|
2793
|
+
/* @__PURE__ */ e(Yn, { columns: T === "list" ? 1 : void 0, minColumnWidth: 240, gap: 12, children: L.map((x) => {
|
|
2794
|
+
const { value: V, max: G, complete: ee } = Ti(x, d), Y = x.price, ie = x.contributions ?? [];
|
|
2795
|
+
return /* @__PURE__ */ s(
|
|
2811
2796
|
"div",
|
|
2812
2797
|
{
|
|
2813
2798
|
className: `nice-gift-registry__item${ee ? " nice-gift-registry__item--complete" : ""}`,
|
|
2814
2799
|
children: [
|
|
2815
|
-
|
|
2800
|
+
x.imageUrl && /* @__PURE__ */ e(
|
|
2816
2801
|
"img",
|
|
2817
2802
|
{
|
|
2818
|
-
src:
|
|
2803
|
+
src: x.imageUrl,
|
|
2819
2804
|
alt: "",
|
|
2820
2805
|
className: "nice-gift-registry__image",
|
|
2821
2806
|
loading: "lazy"
|
|
2822
2807
|
}
|
|
2823
2808
|
),
|
|
2824
|
-
/* @__PURE__ */
|
|
2809
|
+
/* @__PURE__ */ s("div", { className: "nice-gift-registry__body", children: [
|
|
2825
2810
|
/* @__PURE__ */ e(
|
|
2826
2811
|
"button",
|
|
2827
2812
|
{
|
|
2828
2813
|
type: "button",
|
|
2829
2814
|
className: "nice-gift-registry__title",
|
|
2830
|
-
onClick: () => k == null ? void 0 : k(
|
|
2815
|
+
onClick: () => k == null ? void 0 : k(x),
|
|
2831
2816
|
disabled: !k,
|
|
2832
|
-
children:
|
|
2817
|
+
children: x.title
|
|
2833
2818
|
}
|
|
2834
2819
|
),
|
|
2835
|
-
|
|
2836
|
-
/* @__PURE__ */
|
|
2837
|
-
|
|
2838
|
-
b && (
|
|
2820
|
+
x.description && /* @__PURE__ */ e("p", { className: "nice-gift-registry__description", children: x.description }),
|
|
2821
|
+
/* @__PURE__ */ s("div", { className: "nice-gift-registry__facts", children: [
|
|
2822
|
+
Y && /* @__PURE__ */ e("span", { className: "nice-gift-registry__price", children: ce(Y.amount, Y.currency || u, _) }),
|
|
2823
|
+
b && (x.priority ?? 0) > 0 && /* @__PURE__ */ s(ae, { size: "xs", subtle: !0, variant: "warning", children: [
|
|
2839
2824
|
/* @__PURE__ */ e(It, { size: 11 }),
|
|
2840
2825
|
" ",
|
|
2841
|
-
|
|
2826
|
+
x.priority
|
|
2842
2827
|
] }),
|
|
2843
|
-
ee && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: "success", children: b ? "bought" : "fully covered" }),
|
|
2844
|
-
|
|
2828
|
+
ee && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: "success", children: b ? n("giftRegistry.bought", "bought") : n("giftRegistry.fullyCovered", "fully covered") }),
|
|
2829
|
+
x.url && /* @__PURE__ */ s(
|
|
2845
2830
|
"a",
|
|
2846
2831
|
{
|
|
2847
2832
|
className: "nice-gift-registry__link",
|
|
2848
|
-
href:
|
|
2833
|
+
href: x.url,
|
|
2849
2834
|
target: "_blank",
|
|
2850
2835
|
rel: "noopener noreferrer",
|
|
2851
2836
|
children: [
|
|
@@ -2861,38 +2846,38 @@ const la = /* @__PURE__ */ te(
|
|
|
2861
2846
|
{
|
|
2862
2847
|
value: V,
|
|
2863
2848
|
max: G,
|
|
2864
|
-
label: n("giftRegistry.covered", "{name}: {value} of {max} covered").replace("{name}",
|
|
2849
|
+
label: n("giftRegistry.covered", "{name}: {value} of {max} covered").replace("{name}", x.title).replace("{value}", String(V)).replace("{max}", String(G))
|
|
2865
2850
|
}
|
|
2866
2851
|
),
|
|
2867
|
-
!c && ie.length > 0 && /* @__PURE__ */ e("ul", { className: "nice-gift-registry__contributors", children: ie.map((Q) => /* @__PURE__ */
|
|
2852
|
+
!c && ie.length > 0 && /* @__PURE__ */ e("ul", { className: "nice-gift-registry__contributors", children: ie.map((Q) => /* @__PURE__ */ s("li", { className: "nice-gift-registry__contributor", children: [
|
|
2868
2853
|
/* @__PURE__ */ e("strong", { children: Q.contributorName }),
|
|
2869
|
-
Q.amount !== void 0 && ` — ${ce(Q.amount, (
|
|
2854
|
+
Q.amount !== void 0 && ` — ${ce(Q.amount, (Y == null ? void 0 : Y.currency) || u, _)}`,
|
|
2870
2855
|
Q.amount === void 0 && Q.quantity ? ` — ${Q.quantity}×` : "",
|
|
2871
|
-
Q.message && /* @__PURE__ */
|
|
2856
|
+
Q.message && /* @__PURE__ */ s("em", { children: [
|
|
2872
2857
|
" “",
|
|
2873
2858
|
Q.message,
|
|
2874
2859
|
"”"
|
|
2875
2860
|
] })
|
|
2876
2861
|
] }, Q.id)) }),
|
|
2877
|
-
/* @__PURE__ */
|
|
2862
|
+
/* @__PURE__ */ s("div", { className: "nice-gift-registry__actions", children: [
|
|
2878
2863
|
!W && !ee && z && /* @__PURE__ */ e(
|
|
2879
2864
|
U,
|
|
2880
2865
|
{
|
|
2881
2866
|
size: "sm",
|
|
2882
2867
|
variant: "primary",
|
|
2883
|
-
disabled:
|
|
2868
|
+
disabled: C || !w.canAct,
|
|
2884
2869
|
leftIcon: /* @__PURE__ */ e(je, { size: 14 }),
|
|
2885
|
-
onClick: () => z(
|
|
2886
|
-
children: "I'll take this"
|
|
2870
|
+
onClick: () => z(x.id, { ...w.actor, quantity: 1 }),
|
|
2871
|
+
children: n("giftRegistry.illTakeThis", "I'll take this")
|
|
2887
2872
|
}
|
|
2888
2873
|
),
|
|
2889
|
-
!W && ee &&
|
|
2874
|
+
!W && ee && v && /* @__PURE__ */ e(
|
|
2890
2875
|
U,
|
|
2891
2876
|
{
|
|
2892
2877
|
size: "sm",
|
|
2893
2878
|
variant: "ghost",
|
|
2894
|
-
disabled:
|
|
2895
|
-
onClick: () =>
|
|
2879
|
+
disabled: C,
|
|
2880
|
+
onClick: () => v(x.id),
|
|
2896
2881
|
children: n("giftRegistry.release", "Release")
|
|
2897
2882
|
}
|
|
2898
2883
|
),
|
|
@@ -2901,8 +2886,8 @@ const la = /* @__PURE__ */ te(
|
|
|
2901
2886
|
{
|
|
2902
2887
|
size: "sm",
|
|
2903
2888
|
variant: "outline",
|
|
2904
|
-
disabled:
|
|
2905
|
-
onClick: () =>
|
|
2889
|
+
disabled: C || !w.canAct,
|
|
2890
|
+
onClick: () => I(N === x.id ? null : x.id),
|
|
2906
2891
|
children: n("giftRegistry.chipIn", "Chip in")
|
|
2907
2892
|
}
|
|
2908
2893
|
),
|
|
@@ -2913,29 +2898,28 @@ const la = /* @__PURE__ */ te(
|
|
|
2913
2898
|
variant: "ghost",
|
|
2914
2899
|
ariaLabel: n("giftRegistry.deleteItem", "Delete {name}").replace(
|
|
2915
2900
|
"{name}",
|
|
2916
|
-
|
|
2901
|
+
x.title
|
|
2917
2902
|
),
|
|
2918
2903
|
disabled: f,
|
|
2919
|
-
onClick: () => P(
|
|
2920
|
-
children: /* @__PURE__ */ e(
|
|
2904
|
+
onClick: () => P(x.id),
|
|
2905
|
+
children: /* @__PURE__ */ e(De, { size: 14 })
|
|
2921
2906
|
}
|
|
2922
2907
|
)
|
|
2923
2908
|
] }),
|
|
2924
|
-
N ===
|
|
2925
|
-
/* @__PURE__ */
|
|
2926
|
-
/* @__PURE__ */
|
|
2927
|
-
"
|
|
2928
|
-
(
|
|
2929
|
-
|
|
2930
|
-
] }),
|
|
2909
|
+
N === x.id && /* @__PURE__ */ s("div", { className: "nice-gift-registry__pledge", children: [
|
|
2910
|
+
/* @__PURE__ */ s("label", { className: "nice-gift-registry__pledge-field", children: [
|
|
2911
|
+
/* @__PURE__ */ e("span", { children: n("giftRegistry.amount", "Amount ({currency})").replace(
|
|
2912
|
+
"{currency}",
|
|
2913
|
+
String((Y == null ? void 0 : Y.currency) || u)
|
|
2914
|
+
) }),
|
|
2931
2915
|
/* @__PURE__ */ e(
|
|
2932
2916
|
dn,
|
|
2933
2917
|
{
|
|
2934
|
-
value:
|
|
2918
|
+
value: B,
|
|
2935
2919
|
onChange: (Q) => X(Math.max(0, Q ?? 0)),
|
|
2936
2920
|
min: 0,
|
|
2937
2921
|
size: "xs",
|
|
2938
|
-
disabled:
|
|
2922
|
+
disabled: C
|
|
2939
2923
|
}
|
|
2940
2924
|
)
|
|
2941
2925
|
] }),
|
|
@@ -2944,8 +2928,8 @@ const la = /* @__PURE__ */ te(
|
|
|
2944
2928
|
{
|
|
2945
2929
|
size: "sm",
|
|
2946
2930
|
variant: "primary",
|
|
2947
|
-
disabled:
|
|
2948
|
-
onClick: () => q(
|
|
2931
|
+
disabled: C || !w.canAct,
|
|
2932
|
+
onClick: () => q(x),
|
|
2949
2933
|
children: n("giftRegistry.confirm", "Confirm")
|
|
2950
2934
|
}
|
|
2951
2935
|
),
|
|
@@ -2954,16 +2938,16 @@ const la = /* @__PURE__ */ te(
|
|
|
2954
2938
|
] })
|
|
2955
2939
|
]
|
|
2956
2940
|
},
|
|
2957
|
-
|
|
2941
|
+
x.id
|
|
2958
2942
|
);
|
|
2959
2943
|
}) }),
|
|
2960
|
-
W &&
|
|
2944
|
+
W && g && !p && /* @__PURE__ */ s("div", { className: "nice-gift-registry__add", children: [
|
|
2961
2945
|
/* @__PURE__ */ e(
|
|
2962
2946
|
Z,
|
|
2963
2947
|
{
|
|
2964
2948
|
label: b ? n("giftRegistry.addAWish", "Add a wish") : n("giftRegistry.addAGift", "Add a gift"),
|
|
2965
2949
|
value: E,
|
|
2966
|
-
onChange:
|
|
2950
|
+
onChange: R,
|
|
2967
2951
|
placeholder: n("giftRegistry.whatWouldYouLike", "What would you like?"),
|
|
2968
2952
|
disabled: f,
|
|
2969
2953
|
size: A
|
|
@@ -2977,9 +2961,9 @@ const la = /* @__PURE__ */ te(
|
|
|
2977
2961
|
leftIcon: /* @__PURE__ */ e(an, { size: 15 }),
|
|
2978
2962
|
disabled: f || !E.trim(),
|
|
2979
2963
|
onClick: () => {
|
|
2980
|
-
|
|
2964
|
+
g({ title: E.trim(), quantityNeeded: 1 }), R("");
|
|
2981
2965
|
},
|
|
2982
|
-
children: "Add"
|
|
2966
|
+
children: n("giftRegistry.add", "Add")
|
|
2983
2967
|
}
|
|
2984
2968
|
)
|
|
2985
2969
|
] })
|
|
@@ -2988,25 +2972,25 @@ const la = /* @__PURE__ */ te(
|
|
|
2988
2972
|
);
|
|
2989
2973
|
}
|
|
2990
2974
|
);
|
|
2991
|
-
function Mi(
|
|
2975
|
+
function Mi(a) {
|
|
2992
2976
|
const i = /* @__PURE__ */ new Map();
|
|
2993
|
-
for (const r of
|
|
2977
|
+
for (const r of a) {
|
|
2994
2978
|
const n = (r.currency || "").toUpperCase(), t = i.get(n);
|
|
2995
2979
|
t ? t.push(r) : i.set(n, [r]);
|
|
2996
2980
|
}
|
|
2997
2981
|
return i;
|
|
2998
2982
|
}
|
|
2999
|
-
function
|
|
2983
|
+
function Li(a, i, r) {
|
|
3000
2984
|
var _;
|
|
3001
2985
|
const n = new Set(i.map((c) => c.id)), t = i.map((c) => c.id), d = new Map(t.map((c) => [c, 0])), o = [];
|
|
3002
2986
|
let u = 0;
|
|
3003
2987
|
if (t.length === 0)
|
|
3004
2988
|
return {
|
|
3005
2989
|
balances: d,
|
|
3006
|
-
issues:
|
|
2990
|
+
issues: a.map((c) => ({ itemId: c.id, reason: "no-participants" })),
|
|
3007
2991
|
totalMinor: 0
|
|
3008
2992
|
};
|
|
3009
|
-
for (const c of
|
|
2993
|
+
for (const c of a) {
|
|
3010
2994
|
const l = c.paidById;
|
|
3011
2995
|
if (!l) {
|
|
3012
2996
|
o.push({ itemId: c.id, reason: "no-payer" });
|
|
@@ -3020,13 +3004,13 @@ function $i(s, i, r) {
|
|
|
3020
3004
|
m.length === 0 && (m = t);
|
|
3021
3005
|
const h = mn(c.amount, r);
|
|
3022
3006
|
u += h;
|
|
3023
|
-
const z = m.length,
|
|
3024
|
-
if (
|
|
3007
|
+
const z = m.length, v = Math.floor(h / z), g = h - v * z, P = new Map(m.map((k) => [k, v]));
|
|
3008
|
+
if (g !== 0)
|
|
3025
3009
|
if (P.has(l))
|
|
3026
|
-
P.set(l, (P.get(l) ?? 0) +
|
|
3010
|
+
P.set(l, (P.get(l) ?? 0) + g);
|
|
3027
3011
|
else {
|
|
3028
|
-
const k = [...m].sort(qe), T =
|
|
3029
|
-
for (let f = 0; f < Math.abs(
|
|
3012
|
+
const k = [...m].sort(qe), T = g > 0 ? 1 : -1;
|
|
3013
|
+
for (let f = 0; f < Math.abs(g); f += 1) {
|
|
3030
3014
|
const p = k[f % k.length];
|
|
3031
3015
|
P.set(p, (P.get(p) ?? 0) + T);
|
|
3032
3016
|
}
|
|
@@ -3037,16 +3021,16 @@ function $i(s, i, r) {
|
|
|
3037
3021
|
}
|
|
3038
3022
|
return { balances: d, issues: o, totalMinor: u };
|
|
3039
3023
|
}
|
|
3040
|
-
function
|
|
3024
|
+
function $i(a, i, r) {
|
|
3041
3025
|
for (const n of i) {
|
|
3042
|
-
if ((n.currency || "").toUpperCase() !== r || !
|
|
3026
|
+
if ((n.currency || "").toUpperCase() !== r || !a.has(n.fromId) || !a.has(n.toId))
|
|
3043
3027
|
continue;
|
|
3044
3028
|
const t = mn(n.amount, r);
|
|
3045
|
-
|
|
3029
|
+
a.set(n.fromId, (a.get(n.fromId) ?? 0) + t), a.set(n.toId, (a.get(n.toId) ?? 0) - t);
|
|
3046
3030
|
}
|
|
3047
3031
|
}
|
|
3048
|
-
function
|
|
3049
|
-
const n = new Map(i.map((c) => [c.id, c.name])), t = [...
|
|
3032
|
+
function Ri(a, i, r) {
|
|
3033
|
+
const n = new Map(i.map((c) => [c.id, c.name])), t = [...a.entries()].filter(([, c]) => c > 0).map(([c, l]) => ({ id: c, v: l })).sort((c, l) => l.v - c.v || qe(c.id, l.id)), d = [...a.entries()].filter(([, c]) => c < 0).map(([c, l]) => ({ id: c, v: l })).sort((c, l) => c.v - l.v || qe(c.id, l.id)), o = [];
|
|
3050
3034
|
let u = 0, _ = 0;
|
|
3051
3035
|
for (; u < d.length && _ < t.length; ) {
|
|
3052
3036
|
const c = Math.min(-d[u].v, t[_].v);
|
|
@@ -3061,11 +3045,11 @@ function Di(s, i, r) {
|
|
|
3061
3045
|
}
|
|
3062
3046
|
return o;
|
|
3063
3047
|
}
|
|
3064
|
-
function
|
|
3065
|
-
const n = [], t = [], d = [...Mi(
|
|
3048
|
+
function Di(a, i, r = []) {
|
|
3049
|
+
const n = [], t = [], d = [...Mi(a).entries()].sort(([o], [u]) => qe(o, u));
|
|
3066
3050
|
for (const [o, u] of d) {
|
|
3067
|
-
const _ =
|
|
3068
|
-
t.push(..._.issues),
|
|
3051
|
+
const _ = Li(u, i, o);
|
|
3052
|
+
t.push(..._.issues), $i(_.balances, r, o), n.push({
|
|
3069
3053
|
currency: o,
|
|
3070
3054
|
total: We(_.totalMinor, o),
|
|
3071
3055
|
balances: i.map((c) => ({
|
|
@@ -3074,13 +3058,13 @@ function Ri(s, i, r = []) {
|
|
|
3074
3058
|
amount: We(_.balances.get(c.id) ?? 0, o),
|
|
3075
3059
|
currency: o
|
|
3076
3060
|
})),
|
|
3077
|
-
transfers:
|
|
3061
|
+
transfers: Ri(_.balances, i, o)
|
|
3078
3062
|
});
|
|
3079
3063
|
}
|
|
3080
3064
|
return { groups: n, issues: t };
|
|
3081
3065
|
}
|
|
3082
|
-
function qe(
|
|
3083
|
-
return
|
|
3066
|
+
function qe(a, i) {
|
|
3067
|
+
return a < i ? -1 : a > i ? 1 : 0;
|
|
3084
3068
|
}
|
|
3085
3069
|
const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
3086
3070
|
function(i, r) {
|
|
@@ -3095,33 +3079,33 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3095
3079
|
onItemDelete: m,
|
|
3096
3080
|
onItemClick: h,
|
|
3097
3081
|
onValidationChange: z,
|
|
3098
|
-
sortBy:
|
|
3099
|
-
locale:
|
|
3082
|
+
sortBy: v = "date",
|
|
3083
|
+
locale: g,
|
|
3100
3084
|
disabled: P = !1,
|
|
3101
3085
|
readOnly: k = !1,
|
|
3102
3086
|
size: T = "md",
|
|
3103
3087
|
className: f,
|
|
3104
3088
|
style: p
|
|
3105
|
-
} = i, [A, y] =
|
|
3106
|
-
() => d.map((
|
|
3089
|
+
} = i, [A, y] = D(_), M = u ?? A, w = P || k, N = F(
|
|
3090
|
+
() => d.map((C) => ({ id: C.id, name: C.name })),
|
|
3107
3091
|
[d]
|
|
3108
|
-
),
|
|
3109
|
-
if (
|
|
3110
|
-
return b.item.amount -
|
|
3111
|
-
const
|
|
3112
|
-
return
|
|
3113
|
-
}).map((
|
|
3114
|
-
|
|
3115
|
-
z == null || z(
|
|
3092
|
+
), I = F(() => Di(t, N, o), [t, N, o]), B = F(() => v === "none" ? t : t.map((C, b) => ({ item: C, index: b })).sort((C, b) => {
|
|
3093
|
+
if (v === "amount")
|
|
3094
|
+
return b.item.amount - C.item.amount || C.index - b.index;
|
|
3095
|
+
const L = C.item.incurredAt, K = b.item.incurredAt;
|
|
3096
|
+
return L && K ? L.localeCompare(K) || C.index - b.index : L ? -1 : K ? 1 : C.index - b.index;
|
|
3097
|
+
}).map((C) => C.item), [t, v]), X = I.issues.map((C) => `${C.itemId}:${C.reason}`).join("|");
|
|
3098
|
+
Re.useEffect(() => {
|
|
3099
|
+
z == null || z(I.issues);
|
|
3116
3100
|
}, [X]);
|
|
3117
3101
|
const E = F(
|
|
3118
|
-
() => new Map(d.map((
|
|
3102
|
+
() => new Map(d.map((C) => [C.id, C.avatarUrl])),
|
|
3119
3103
|
[d]
|
|
3120
|
-
),
|
|
3121
|
-
() => new Map(
|
|
3122
|
-
[
|
|
3123
|
-
), W = (
|
|
3124
|
-
u === void 0 && y(
|
|
3104
|
+
), R = F(
|
|
3105
|
+
() => new Map(I.issues.map((C) => [C.itemId, C.reason])),
|
|
3106
|
+
[I.issues]
|
|
3107
|
+
), W = (C) => {
|
|
3108
|
+
u === void 0 && y(C), c == null || c(C);
|
|
3125
3109
|
};
|
|
3126
3110
|
return t.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-expense-split ${f ?? ""}`, style: p, children: /* @__PURE__ */ e(
|
|
3127
3111
|
Ne,
|
|
@@ -3133,7 +3117,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3133
3117
|
"Add what people paid for and this will work out who owes whom."
|
|
3134
3118
|
)
|
|
3135
3119
|
}
|
|
3136
|
-
) }) : /* @__PURE__ */
|
|
3120
|
+
) }) : /* @__PURE__ */ s(
|
|
3137
3121
|
"div",
|
|
3138
3122
|
{
|
|
3139
3123
|
ref: r,
|
|
@@ -3145,7 +3129,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3145
3129
|
{
|
|
3146
3130
|
size: T,
|
|
3147
3131
|
value: M,
|
|
3148
|
-
onChange: (
|
|
3132
|
+
onChange: (C) => W(C),
|
|
3149
3133
|
options: [
|
|
3150
3134
|
{ value: "expenses", label: n("expenseSplit.expenses", "Expenses") },
|
|
3151
3135
|
{ value: "balances", label: n("expenseSplit.balances", "Balances") },
|
|
@@ -3153,32 +3137,32 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3153
3137
|
]
|
|
3154
3138
|
}
|
|
3155
3139
|
),
|
|
3156
|
-
M === "expenses" && /* @__PURE__ */ e("ul", { className: "nice-expense-split__items", children:
|
|
3157
|
-
const b =
|
|
3158
|
-
return /* @__PURE__ */
|
|
3140
|
+
M === "expenses" && /* @__PURE__ */ e("ul", { className: "nice-expense-split__items", children: B.map((C) => {
|
|
3141
|
+
const b = R.get(C.id);
|
|
3142
|
+
return /* @__PURE__ */ s(
|
|
3159
3143
|
"li",
|
|
3160
3144
|
{
|
|
3161
3145
|
className: `nice-expense-split__item${b ? " nice-expense-split__item--excluded" : ""}`,
|
|
3162
3146
|
children: [
|
|
3163
|
-
/* @__PURE__ */
|
|
3147
|
+
/* @__PURE__ */ s(
|
|
3164
3148
|
"button",
|
|
3165
3149
|
{
|
|
3166
3150
|
type: "button",
|
|
3167
3151
|
className: "nice-expense-split__item-main",
|
|
3168
|
-
onClick: () => h == null ? void 0 : h(
|
|
3152
|
+
onClick: () => h == null ? void 0 : h(C),
|
|
3169
3153
|
disabled: !h,
|
|
3170
3154
|
children: [
|
|
3171
|
-
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-label", children:
|
|
3172
|
-
/* @__PURE__ */
|
|
3173
|
-
|
|
3174
|
-
"
|
|
3175
|
-
|
|
3155
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-label", children: C.label }),
|
|
3156
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-payer", children: n("expenseSplit.paidBy", "{payer} paid").replace(
|
|
3157
|
+
"{payer}",
|
|
3158
|
+
C.paidByName ?? C.paidById ?? n("expenseSplit.nobody", "nobody")
|
|
3159
|
+
) })
|
|
3176
3160
|
]
|
|
3177
3161
|
}
|
|
3178
3162
|
),
|
|
3179
|
-
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-amount", children: ce(
|
|
3180
|
-
|
|
3181
|
-
b && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: "warning", children: b === "no-payer" ? "no payer" : "unknown payer" }),
|
|
3163
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-amount", children: ce(C.amount, C.currency, g) }),
|
|
3164
|
+
C.isPaid && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: "success", children: n("expenseSplit.paid", "paid") }),
|
|
3165
|
+
b && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: "warning", children: b === "no-payer" ? n("expenseSplit.noPayer", "no payer") : n("expenseSplit.unknownPayer", "unknown payer") }),
|
|
3182
3166
|
m && !k && /* @__PURE__ */ e(
|
|
3183
3167
|
U,
|
|
3184
3168
|
{
|
|
@@ -3186,27 +3170,27 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3186
3170
|
variant: "ghost",
|
|
3187
3171
|
ariaLabel: n("expenseSplit.deleteItem", "Delete {name}").replace(
|
|
3188
3172
|
"{name}",
|
|
3189
|
-
|
|
3173
|
+
C.label
|
|
3190
3174
|
),
|
|
3191
3175
|
disabled: P,
|
|
3192
|
-
onClick: () => m(
|
|
3193
|
-
children: /* @__PURE__ */ e(
|
|
3176
|
+
onClick: () => m(C.id),
|
|
3177
|
+
children: /* @__PURE__ */ e(De, { size: 14 })
|
|
3194
3178
|
}
|
|
3195
3179
|
)
|
|
3196
3180
|
]
|
|
3197
3181
|
},
|
|
3198
|
-
|
|
3182
|
+
C.id
|
|
3199
3183
|
);
|
|
3200
3184
|
}) }),
|
|
3201
|
-
M === "balances" &&
|
|
3202
|
-
/* @__PURE__ */
|
|
3203
|
-
|
|
3204
|
-
/* @__PURE__ */
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3185
|
+
M === "balances" && I.groups.map((C) => /* @__PURE__ */ s("section", { className: "nice-expense-split__group", children: [
|
|
3186
|
+
/* @__PURE__ */ s("h4", { className: "nice-expense-split__group-title", children: [
|
|
3187
|
+
C.currency,
|
|
3188
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__group-total", children: n("expenseSplit.total", "{amount} total").replace(
|
|
3189
|
+
"{amount}",
|
|
3190
|
+
String(ce(C.total, C.currency, g))
|
|
3191
|
+
) })
|
|
3208
3192
|
] }),
|
|
3209
|
-
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children:
|
|
3193
|
+
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: C.balances.map((b) => /* @__PURE__ */ e(
|
|
3210
3194
|
nn,
|
|
3211
3195
|
{
|
|
3212
3196
|
participant: {
|
|
@@ -3217,22 +3201,28 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3217
3201
|
showRole: !1,
|
|
3218
3202
|
showStatus: !1,
|
|
3219
3203
|
size: T,
|
|
3220
|
-
children: /* @__PURE__ */
|
|
3204
|
+
children: /* @__PURE__ */ s(
|
|
3221
3205
|
"span",
|
|
3222
3206
|
{
|
|
3223
3207
|
className: `nice-expense-split__balance nice-expense-split__balance--${b.amount > 0 ? "owed" : b.amount < 0 ? "owes" : "settled"}`,
|
|
3224
3208
|
children: [
|
|
3225
|
-
b.amount === 0 ? "settled up" : ce(Math.abs(b.amount), b.currency,
|
|
3226
|
-
b.amount > 0 && /* @__PURE__ */
|
|
3227
|
-
|
|
3209
|
+
b.amount === 0 ? n("expenseSplit.settledUp", "settled up") : ce(Math.abs(b.amount), b.currency, g),
|
|
3210
|
+
b.amount > 0 && /* @__PURE__ */ s("em", { children: [
|
|
3211
|
+
" ",
|
|
3212
|
+
n("expenseSplit.isOwed", "is owed")
|
|
3213
|
+
] }),
|
|
3214
|
+
b.amount < 0 && /* @__PURE__ */ s("em", { children: [
|
|
3215
|
+
" ",
|
|
3216
|
+
n("expenseSplit.owes", "owes")
|
|
3217
|
+
] })
|
|
3228
3218
|
]
|
|
3229
3219
|
}
|
|
3230
3220
|
)
|
|
3231
3221
|
},
|
|
3232
3222
|
b.participantId
|
|
3233
3223
|
)) })
|
|
3234
|
-
] },
|
|
3235
|
-
M === "settlement" && (
|
|
3224
|
+
] }, C.currency)),
|
|
3225
|
+
M === "settlement" && (I.groups.every((C) => C.transfers.length === 0) ? /* @__PURE__ */ e(
|
|
3236
3226
|
Ne,
|
|
3237
3227
|
{
|
|
3238
3228
|
icon: /* @__PURE__ */ e(At, { size: 28 }),
|
|
@@ -3242,16 +3232,18 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3242
3232
|
"Nobody owes anybody anything."
|
|
3243
3233
|
)
|
|
3244
3234
|
}
|
|
3245
|
-
) :
|
|
3246
|
-
/* @__PURE__ */
|
|
3247
|
-
|
|
3248
|
-
/* @__PURE__ */
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3235
|
+
) : I.groups.filter((C) => C.transfers.length > 0).map((C) => /* @__PURE__ */ s("section", { className: "nice-expense-split__group", children: [
|
|
3236
|
+
/* @__PURE__ */ s("h4", { className: "nice-expense-split__group-title", children: [
|
|
3237
|
+
C.currency,
|
|
3238
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__group-total", children: C.transfers.length === 1 ? n("expenseSplit.transfersOne", "{transfers} transfer").replace(
|
|
3239
|
+
"{transfers}",
|
|
3240
|
+
String(C.transfers.length)
|
|
3241
|
+
) : n("expenseSplit.transfersMany", "{transfers} transfers").replace(
|
|
3242
|
+
"{transfers}",
|
|
3243
|
+
String(C.transfers.length)
|
|
3244
|
+
) })
|
|
3253
3245
|
] }),
|
|
3254
|
-
/* @__PURE__ */ e("ul", { className: "nice-expense-split__transfers", children:
|
|
3246
|
+
/* @__PURE__ */ e("ul", { className: "nice-expense-split__transfers", children: C.transfers.map((b) => /* @__PURE__ */ s(
|
|
3255
3247
|
"li",
|
|
3256
3248
|
{
|
|
3257
3249
|
className: "nice-expense-split__transfer",
|
|
@@ -3259,7 +3251,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3259
3251
|
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-from", children: b.fromName }),
|
|
3260
3252
|
/* @__PURE__ */ e(Tt, { size: 15 }),
|
|
3261
3253
|
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-to", children: b.toName }),
|
|
3262
|
-
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-amount", children: ce(b.amount, b.currency,
|
|
3254
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-amount", children: ce(b.amount, b.currency, g) }),
|
|
3263
3255
|
l && !k && /* @__PURE__ */ e(
|
|
3264
3256
|
U,
|
|
3265
3257
|
{
|
|
@@ -3274,13 +3266,13 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3274
3266
|
},
|
|
3275
3267
|
`${b.fromId}-${b.toId}-${b.amount}`
|
|
3276
3268
|
)) })
|
|
3277
|
-
] },
|
|
3269
|
+
] }, C.currency)))
|
|
3278
3270
|
]
|
|
3279
3271
|
}
|
|
3280
3272
|
);
|
|
3281
3273
|
}
|
|
3282
|
-
),
|
|
3283
|
-
upcoming:
|
|
3274
|
+
), Bi = [], Yi = {
|
|
3275
|
+
upcoming: Dn,
|
|
3284
3276
|
active: Ke,
|
|
3285
3277
|
voting: cn,
|
|
3286
3278
|
scored: Mt,
|
|
@@ -3296,7 +3288,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3296
3288
|
}, da = /* @__PURE__ */ te(
|
|
3297
3289
|
function(i, r) {
|
|
3298
3290
|
const { t: n } = J(), {
|
|
3299
|
-
rounds: t =
|
|
3291
|
+
rounds: t = Bi,
|
|
3300
3292
|
activeRoundId: d,
|
|
3301
3293
|
onSelect: o,
|
|
3302
3294
|
onStart: u,
|
|
@@ -3305,67 +3297,63 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3305
3297
|
editable: l = !1,
|
|
3306
3298
|
className: m,
|
|
3307
3299
|
style: h
|
|
3308
|
-
} = i, z = [...t].sort((
|
|
3309
|
-
return /* @__PURE__ */
|
|
3310
|
-
/* @__PURE__ */
|
|
3311
|
-
/* @__PURE__ */
|
|
3312
|
-
"Rounds (",
|
|
3313
|
-
t.length,
|
|
3314
|
-
")"
|
|
3315
|
-
] }),
|
|
3300
|
+
} = i, z = [...t].sort((v, g) => v.order - g.order);
|
|
3301
|
+
return /* @__PURE__ */ s("div", { ref: r, className: `nice-round-list ${m ?? ""}`, style: h, children: [
|
|
3302
|
+
/* @__PURE__ */ s("div", { className: "nice-round-list__header", children: [
|
|
3303
|
+
/* @__PURE__ */ e("h3", { children: n("roundList.rounds", "Rounds ({rounds})").replace("{rounds}", String(t.length)) }),
|
|
3316
3304
|
l && c && /* @__PURE__ */ e("button", { onClick: c, children: n("roundList.addRound", "+ Add Round") })
|
|
3317
3305
|
] }),
|
|
3318
|
-
z.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-round-list__empty", children: n("roundList.noRoundsYet", "No rounds yet.") }) : /* @__PURE__ */ e("div", { className: "nice-round-list__items", children: z.map((
|
|
3319
|
-
const
|
|
3320
|
-
return /* @__PURE__ */
|
|
3306
|
+
z.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-round-list__empty", children: n("roundList.noRoundsYet", "No rounds yet.") }) : /* @__PURE__ */ e("div", { className: "nice-round-list__items", children: z.map((v) => {
|
|
3307
|
+
const g = v.id === d;
|
|
3308
|
+
return /* @__PURE__ */ s(
|
|
3321
3309
|
"div",
|
|
3322
3310
|
{
|
|
3323
|
-
className: `nice-round-list__item ${
|
|
3324
|
-
onClick: () => o == null ? void 0 : o(
|
|
3311
|
+
className: `nice-round-list__item ${g ? "nice-round-list__item--active" : ""}`,
|
|
3312
|
+
onClick: () => o == null ? void 0 : o(v),
|
|
3325
3313
|
role: o ? "button" : void 0,
|
|
3326
3314
|
tabIndex: o ? 0 : void 0,
|
|
3327
3315
|
children: [
|
|
3328
|
-
/* @__PURE__ */
|
|
3316
|
+
/* @__PURE__ */ s("span", { className: "nice-round-list__order", children: [
|
|
3329
3317
|
"#",
|
|
3330
|
-
|
|
3318
|
+
v.order
|
|
3331
3319
|
] }),
|
|
3332
3320
|
/* @__PURE__ */ e(
|
|
3333
3321
|
"span",
|
|
3334
3322
|
{
|
|
3335
3323
|
className: "nice-round-list__icon",
|
|
3336
|
-
title: n(`roundCard.status.${
|
|
3337
|
-
children:
|
|
3324
|
+
title: n(`roundCard.status.${v.status}`, v.status),
|
|
3325
|
+
children: Re.createElement(Yi[v.status], { size: 16 })
|
|
3338
3326
|
}
|
|
3339
3327
|
),
|
|
3340
|
-
/* @__PURE__ */
|
|
3341
|
-
/* @__PURE__ */ e("strong", { className: "nice-round-list__name", children:
|
|
3342
|
-
|
|
3343
|
-
|
|
3328
|
+
/* @__PURE__ */ s("div", { className: "nice-round-list__info", children: [
|
|
3329
|
+
/* @__PURE__ */ e("strong", { className: "nice-round-list__name", children: v.name }),
|
|
3330
|
+
v.description && /* @__PURE__ */ e("small", { children: v.description }),
|
|
3331
|
+
v.type && /* @__PURE__ */ e("span", { className: "nice-round-list__type", children: v.type })
|
|
3344
3332
|
] }),
|
|
3345
3333
|
/* @__PURE__ */ e(
|
|
3346
3334
|
"span",
|
|
3347
3335
|
{
|
|
3348
3336
|
className: "nice-round-list__status",
|
|
3349
|
-
style: { color: Ui[
|
|
3350
|
-
children: n(`roundCard.status.${
|
|
3337
|
+
style: { color: Ui[v.status] },
|
|
3338
|
+
children: n(`roundCard.status.${v.status}`, v.status)
|
|
3351
3339
|
}
|
|
3352
3340
|
),
|
|
3353
|
-
|
|
3354
|
-
|
|
3341
|
+
v.durationMinutes && /* @__PURE__ */ s("span", { className: "nice-round-list__duration", children: [
|
|
3342
|
+
v.durationMinutes,
|
|
3355
3343
|
"m"
|
|
3356
3344
|
] }),
|
|
3357
|
-
|
|
3345
|
+
v.winnerIds && v.winnerIds.length > 0 && /* @__PURE__ */ s("span", { className: "nice-round-list__winners", children: [
|
|
3358
3346
|
/* @__PURE__ */ e(ln, { size: 14 }),
|
|
3359
3347
|
" ",
|
|
3360
|
-
|
|
3348
|
+
v.winnerIds.length
|
|
3361
3349
|
] }),
|
|
3362
|
-
l && /* @__PURE__ */
|
|
3363
|
-
|
|
3364
|
-
(
|
|
3350
|
+
l && /* @__PURE__ */ s("div", { className: "nice-round-list__actions", onClick: (P) => P.stopPropagation(), children: [
|
|
3351
|
+
v.status === "upcoming" && u && /* @__PURE__ */ e("button", { onClick: () => u(v.id), children: n("roundList.start", "Start") }),
|
|
3352
|
+
(v.status === "active" || v.status === "voting") && _ && /* @__PURE__ */ e("button", { onClick: () => _(v.id), children: n("roundList.end", "End") })
|
|
3365
3353
|
] })
|
|
3366
3354
|
]
|
|
3367
3355
|
},
|
|
3368
|
-
|
|
3356
|
+
v.id
|
|
3369
3357
|
);
|
|
3370
3358
|
}) })
|
|
3371
3359
|
] });
|
|
@@ -3387,57 +3375,57 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3387
3375
|
editable: m = !1,
|
|
3388
3376
|
footerActions: h,
|
|
3389
3377
|
className: z,
|
|
3390
|
-
style:
|
|
3391
|
-
} = i, [
|
|
3378
|
+
style: v
|
|
3379
|
+
} = i, [g, P] = D({}), k = j(
|
|
3392
3380
|
(p) => {
|
|
3393
|
-
const A = parseFloat(
|
|
3381
|
+
const A = parseFloat(g[p] ?? "");
|
|
3394
3382
|
isNaN(A) || !u || (u(p, A), P((y) => ({ ...y, [p]: "" })));
|
|
3395
3383
|
},
|
|
3396
|
-
[
|
|
3384
|
+
[g, u]
|
|
3397
3385
|
), T = (p) => {
|
|
3398
3386
|
const A = Math.floor(p / 60), y = p % 60;
|
|
3399
3387
|
return `${A}:${y.toString().padStart(2, "0")}`;
|
|
3400
3388
|
}, f = t.scores ? [...t.scores].sort((p, A) => A.score - p.score) : [];
|
|
3401
|
-
return /* @__PURE__ */
|
|
3389
|
+
return /* @__PURE__ */ s(
|
|
3402
3390
|
"div",
|
|
3403
3391
|
{
|
|
3404
3392
|
ref: r,
|
|
3405
3393
|
className: `nice-round-card nice-round-card--${t.status} ${z ?? ""}`,
|
|
3406
|
-
style:
|
|
3394
|
+
style: v,
|
|
3407
3395
|
children: [
|
|
3408
|
-
/* @__PURE__ */
|
|
3396
|
+
/* @__PURE__ */ s("div", { className: "nice-round-card__header", children: [
|
|
3409
3397
|
/* @__PURE__ */ e("span", { className: "nice-round-card__order", children: n("roundCard.roundN", "Round #{n}").replace("{n}", String(t.order)) }),
|
|
3410
3398
|
/* @__PURE__ */ e("h3", { className: "nice-round-card__name", children: t.name }),
|
|
3411
3399
|
/* @__PURE__ */ e("span", { className: "nice-round-card__status", children: n(`roundCard.status.${t.status}`, t.status) })
|
|
3412
3400
|
] }),
|
|
3413
3401
|
t.description && /* @__PURE__ */ e("p", { className: "nice-round-card__description", children: t.description }),
|
|
3414
|
-
(d || o != null) && /* @__PURE__ */
|
|
3402
|
+
(d || o != null) && /* @__PURE__ */ s(
|
|
3415
3403
|
"div",
|
|
3416
3404
|
{
|
|
3417
3405
|
className: `nice-round-card__timer ${d ? "nice-round-card__timer--running" : ""}`,
|
|
3418
3406
|
children: [
|
|
3419
|
-
/* @__PURE__ */ e(
|
|
3407
|
+
/* @__PURE__ */ e(Dn, { size: 14 }),
|
|
3420
3408
|
" ",
|
|
3421
3409
|
o != null ? T(o) : "—"
|
|
3422
3410
|
]
|
|
3423
3411
|
}
|
|
3424
3412
|
),
|
|
3425
|
-
f.length > 0 && /* @__PURE__ */
|
|
3413
|
+
f.length > 0 && /* @__PURE__ */ s("div", { className: "nice-round-card__scoreboard", children: [
|
|
3426
3414
|
/* @__PURE__ */ e("h4", { children: n("roundCard.scoreboard", "Scoreboard") }),
|
|
3427
|
-
/* @__PURE__ */
|
|
3428
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
3415
|
+
/* @__PURE__ */ s("table", { className: "nice-round-card__scores-table", children: [
|
|
3416
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ s("tr", { children: [
|
|
3429
3417
|
/* @__PURE__ */ e("th", { children: n("roundCard.rank", "Rank") }),
|
|
3430
3418
|
/* @__PURE__ */ e("th", { children: n("roundCard.participant", "Participant") }),
|
|
3431
3419
|
/* @__PURE__ */ e("th", { children: n("roundCard.score", "Score") })
|
|
3432
3420
|
] }) }),
|
|
3433
|
-
/* @__PURE__ */ e("tbody", { children: f.map((p, A) => /* @__PURE__ */
|
|
3421
|
+
/* @__PURE__ */ e("tbody", { children: f.map((p, A) => /* @__PURE__ */ s(
|
|
3434
3422
|
"tr",
|
|
3435
3423
|
{
|
|
3436
3424
|
className: A < 3 ? `nice-round-card__top-${A + 1}` : "",
|
|
3437
3425
|
children: [
|
|
3438
|
-
/* @__PURE__ */
|
|
3426
|
+
/* @__PURE__ */ s("td", { children: [
|
|
3439
3427
|
p.rank ?? A + 1,
|
|
3440
|
-
A < 3 && /* @__PURE__ */
|
|
3428
|
+
A < 3 && /* @__PURE__ */ s(Ge, { children: [
|
|
3441
3429
|
" ",
|
|
3442
3430
|
/* @__PURE__ */ e(
|
|
3443
3431
|
Je,
|
|
@@ -3460,15 +3448,15 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3460
3448
|
)) })
|
|
3461
3449
|
] })
|
|
3462
3450
|
] }),
|
|
3463
|
-
u && (t.status === "active" || t.status === "voting") && f.length > 0 && /* @__PURE__ */
|
|
3451
|
+
u && (t.status === "active" || t.status === "voting") && f.length > 0 && /* @__PURE__ */ s("div", { className: "nice-round-card__score-input", children: [
|
|
3464
3452
|
/* @__PURE__ */ e("h4", { children: n("roundCard.submitScores", "Submit Scores") }),
|
|
3465
|
-
f.map((p) => /* @__PURE__ */
|
|
3453
|
+
f.map((p) => /* @__PURE__ */ s("div", { className: "nice-round-card__score-row", children: [
|
|
3466
3454
|
/* @__PURE__ */ e("span", { children: p.participantName }),
|
|
3467
3455
|
/* @__PURE__ */ e(
|
|
3468
3456
|
"input",
|
|
3469
3457
|
{
|
|
3470
3458
|
type: "number",
|
|
3471
|
-
value:
|
|
3459
|
+
value: g[p.participantId] ?? "",
|
|
3472
3460
|
onChange: (A) => P((y) => ({ ...y, [p.participantId]: A.target.value })),
|
|
3473
3461
|
min: 0,
|
|
3474
3462
|
step: 1,
|
|
@@ -3478,19 +3466,19 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3478
3466
|
/* @__PURE__ */ e("button", { onClick: () => k(p.participantId), children: n("roundCard.submit", "Submit") })
|
|
3479
3467
|
] }, p.participantId))
|
|
3480
3468
|
] }),
|
|
3481
|
-
/* @__PURE__ */
|
|
3482
|
-
m && /* @__PURE__ */
|
|
3483
|
-
t.status === "upcoming" && _ && /* @__PURE__ */
|
|
3469
|
+
/* @__PURE__ */ s("div", { className: "nice-round-card__footer", children: [
|
|
3470
|
+
m && /* @__PURE__ */ s("div", { className: "nice-round-card__actions", children: [
|
|
3471
|
+
t.status === "upcoming" && _ && /* @__PURE__ */ s("button", { onClick: _, children: [
|
|
3484
3472
|
/* @__PURE__ */ e(Ke, { size: 14 }),
|
|
3485
3473
|
" ",
|
|
3486
3474
|
n("roundCard.startRound", "Start Round")
|
|
3487
3475
|
] }),
|
|
3488
|
-
(t.status === "active" || t.status === "voting") && c && /* @__PURE__ */
|
|
3489
|
-
/* @__PURE__ */ e(
|
|
3476
|
+
(t.status === "active" || t.status === "voting") && c && /* @__PURE__ */ s("button", { onClick: c, children: [
|
|
3477
|
+
/* @__PURE__ */ e(Lt, { size: 14 }),
|
|
3490
3478
|
" ",
|
|
3491
3479
|
n("roundCard.endRound", "End Round")
|
|
3492
3480
|
] }),
|
|
3493
|
-
t.status === "upcoming" && l && /* @__PURE__ */
|
|
3481
|
+
t.status === "upcoming" && l && /* @__PURE__ */ s("button", { onClick: l, children: [
|
|
3494
3482
|
/* @__PURE__ */ e(rn, { size: 14 }),
|
|
3495
3483
|
" ",
|
|
3496
3484
|
n("roundCard.skip", "Skip")
|
|
@@ -3498,19 +3486,22 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3498
3486
|
] }),
|
|
3499
3487
|
h
|
|
3500
3488
|
] }),
|
|
3501
|
-
t.winnerIds && t.winnerIds.length > 0 && /* @__PURE__ */
|
|
3489
|
+
t.winnerIds && t.winnerIds.length > 0 && /* @__PURE__ */ s("div", { className: "nice-round-card__winners", children: [
|
|
3502
3490
|
/* @__PURE__ */ e(ln, { size: 14 }),
|
|
3503
|
-
"
|
|
3504
|
-
|
|
3491
|
+
" ",
|
|
3492
|
+
n("roundCard.winners", "Winners: {winnerIds}").replace(
|
|
3493
|
+
"{winnerIds}",
|
|
3494
|
+
String(t.winnerIds.length)
|
|
3495
|
+
)
|
|
3505
3496
|
] })
|
|
3506
3497
|
]
|
|
3507
3498
|
}
|
|
3508
3499
|
);
|
|
3509
3500
|
}
|
|
3510
|
-
), Fi = [], Xi = (
|
|
3511
|
-
if (!
|
|
3501
|
+
), Fi = [], Xi = (a) => {
|
|
3502
|
+
if (!a)
|
|
3512
3503
|
return "";
|
|
3513
|
-
const i = Math.floor(
|
|
3504
|
+
const i = Math.floor(a / 60), r = a % 60;
|
|
3514
3505
|
return `${i}:${r.toString().padStart(2, "0")}`;
|
|
3515
3506
|
}, ma = /* @__PURE__ */ te(
|
|
3516
3507
|
function(i, r) {
|
|
@@ -3524,7 +3515,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3524
3515
|
readOnly: c = !1,
|
|
3525
3516
|
className: l,
|
|
3526
3517
|
style: m
|
|
3527
|
-
} = i, { t: h } = J(), [z,
|
|
3518
|
+
} = i, { t: h } = J(), [z, v] = D(""), g = F(() => {
|
|
3528
3519
|
if (!z.trim())
|
|
3529
3520
|
return n;
|
|
3530
3521
|
const f = z.toLowerCase();
|
|
@@ -3532,14 +3523,14 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3532
3523
|
(p) => p.title.toLowerCase().includes(f) || p.artist.toLowerCase().includes(f)
|
|
3533
3524
|
);
|
|
3534
3525
|
}, [n, z]), P = F(() => n.filter((f) => f.isQueued), [n]), k = n.find((f) => f.isPlaying), T = (f) => {
|
|
3535
|
-
|
|
3526
|
+
v(f), u == null || u(f);
|
|
3536
3527
|
};
|
|
3537
|
-
return /* @__PURE__ */
|
|
3538
|
-
k && /* @__PURE__ */
|
|
3528
|
+
return /* @__PURE__ */ s("div", { ref: r, className: `nice-song-picker ${l ?? ""}`, style: m, children: [
|
|
3529
|
+
k && /* @__PURE__ */ s("div", { className: "nice-song-picker__now-playing", children: [
|
|
3539
3530
|
k.albumArt && /* @__PURE__ */ e("img", { src: k.albumArt, alt: "", className: "nice-song-picker__album-art" }),
|
|
3540
|
-
/* @__PURE__ */
|
|
3541
|
-
/* @__PURE__ */
|
|
3542
|
-
/* @__PURE__ */ e(
|
|
3531
|
+
/* @__PURE__ */ s("div", { children: [
|
|
3532
|
+
/* @__PURE__ */ s("div", { className: "nice-song-picker__np-label", children: [
|
|
3533
|
+
/* @__PURE__ */ e(Pe, { size: 14 }),
|
|
3543
3534
|
" ",
|
|
3544
3535
|
h("songPicker.nowPlaying", "Now playing")
|
|
3545
3536
|
] }),
|
|
@@ -3559,13 +3550,13 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3559
3550
|
"aria-label": h("songPicker.search", "Search songs or artists…")
|
|
3560
3551
|
}
|
|
3561
3552
|
) }),
|
|
3562
|
-
/* @__PURE__ */ e("div", { className: "nice-song-picker__list", children:
|
|
3553
|
+
/* @__PURE__ */ e("div", { className: "nice-song-picker__list", children: g.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-song-picker__empty", children: h("songPicker.noMatch", "No songs found.") }) : g.map((f) => /* @__PURE__ */ s(
|
|
3563
3554
|
"div",
|
|
3564
3555
|
{
|
|
3565
3556
|
className: `nice-song-picker__item ${f.isPlaying ? "nice-song-picker__item--playing" : ""}`,
|
|
3566
3557
|
children: [
|
|
3567
3558
|
f.albumArt && /* @__PURE__ */ e("img", { src: f.albumArt, alt: "", className: "nice-song-picker__thumb" }),
|
|
3568
|
-
/* @__PURE__ */
|
|
3559
|
+
/* @__PURE__ */ s("div", { className: "nice-song-picker__info", children: [
|
|
3569
3560
|
/* @__PURE__ */ e("strong", { children: f.title }),
|
|
3570
3561
|
" — ",
|
|
3571
3562
|
/* @__PURE__ */ e("span", { children: f.artist }),
|
|
@@ -3575,8 +3566,8 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3575
3566
|
f.addedByName
|
|
3576
3567
|
) })
|
|
3577
3568
|
] }),
|
|
3578
|
-
!c && /* @__PURE__ */
|
|
3579
|
-
o && /* @__PURE__ */
|
|
3569
|
+
!c && /* @__PURE__ */ s("div", { className: "nice-song-picker__actions", children: [
|
|
3570
|
+
o && /* @__PURE__ */ s(
|
|
3580
3571
|
U,
|
|
3581
3572
|
{
|
|
3582
3573
|
variant: "ghost",
|
|
@@ -3593,7 +3584,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3593
3584
|
]
|
|
3594
3585
|
}
|
|
3595
3586
|
),
|
|
3596
|
-
t && !f.isQueued && /* @__PURE__ */
|
|
3587
|
+
t && !f.isQueued && /* @__PURE__ */ s(U, { variant: "primary", size: "sm", onClick: () => t(f.id), children: [
|
|
3597
3588
|
/* @__PURE__ */ e(an, { size: 14 }),
|
|
3598
3589
|
" ",
|
|
3599
3590
|
h("songPicker.addToQueue", "Queue")
|
|
@@ -3604,14 +3595,14 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3604
3595
|
},
|
|
3605
3596
|
f.id
|
|
3606
3597
|
)) }),
|
|
3607
|
-
_ && P.length > 0 && /* @__PURE__ */
|
|
3598
|
+
_ && P.length > 0 && /* @__PURE__ */ s("div", { className: "nice-song-picker__queue", children: [
|
|
3608
3599
|
/* @__PURE__ */ e("h4", { children: h("songPicker.queue", "Queue ({count})").replace("{count}", String(P.length)) }),
|
|
3609
|
-
P.map((f, p) => /* @__PURE__ */
|
|
3610
|
-
/* @__PURE__ */
|
|
3600
|
+
P.map((f, p) => /* @__PURE__ */ s("div", { className: "nice-song-picker__queue-item", children: [
|
|
3601
|
+
/* @__PURE__ */ s("span", { className: "nice-song-picker__queue-pos", children: [
|
|
3611
3602
|
p + 1,
|
|
3612
3603
|
"."
|
|
3613
3604
|
] }),
|
|
3614
|
-
/* @__PURE__ */
|
|
3605
|
+
/* @__PURE__ */ s("span", { children: [
|
|
3615
3606
|
f.title,
|
|
3616
3607
|
" — ",
|
|
3617
3608
|
f.artist
|
|
@@ -3642,54 +3633,54 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3642
3633
|
readOnly: c = !1,
|
|
3643
3634
|
className: l,
|
|
3644
3635
|
style: m
|
|
3645
|
-
} = i, { t: h } = J(), z = (y) => y in zn ? h(`karaokePicker.difficulty.${y}`, zn[y]) : y, [
|
|
3636
|
+
} = i, { t: h } = J(), z = (y) => y in zn ? h(`karaokePicker.difficulty.${y}`, zn[y]) : y, [v, g] = D(""), [P, k] = D(Ue), T = n.find((y) => y.id === _), f = F(() => {
|
|
3646
3637
|
let y = n;
|
|
3647
|
-
if (
|
|
3648
|
-
const M =
|
|
3638
|
+
if (v.trim()) {
|
|
3639
|
+
const M = v.toLowerCase();
|
|
3649
3640
|
y = y.filter(
|
|
3650
3641
|
(w) => w.title.toLowerCase().includes(M) || w.artist.toLowerCase().includes(M)
|
|
3651
3642
|
);
|
|
3652
3643
|
}
|
|
3653
3644
|
return P !== Ue && (y = y.filter((M) => M.difficulty === P)), y;
|
|
3654
|
-
}, [n,
|
|
3655
|
-
return /* @__PURE__ */
|
|
3656
|
-
T && /* @__PURE__ */
|
|
3657
|
-
/* @__PURE__ */
|
|
3645
|
+
}, [n, v, P]), p = F(() => new Set(t.map((y) => y.id)), [t]), A = ["easy", "medium", "hard", "expert"];
|
|
3646
|
+
return /* @__PURE__ */ s("div", { ref: r, className: `nice-karaoke-picker ${l ?? ""}`, style: m, children: [
|
|
3647
|
+
T && /* @__PURE__ */ s("div", { className: "nice-karaoke-picker__now-singing", children: [
|
|
3648
|
+
/* @__PURE__ */ s("span", { className: "nice-karaoke-picker__label", children: [
|
|
3658
3649
|
/* @__PURE__ */ e(Xe, { size: 14 }),
|
|
3659
3650
|
" ",
|
|
3660
3651
|
h("karaokePicker.nowSinging", "Now Singing")
|
|
3661
3652
|
] }),
|
|
3662
|
-
/* @__PURE__ */
|
|
3653
|
+
/* @__PURE__ */ s("div", { children: [
|
|
3663
3654
|
/* @__PURE__ */ e("strong", { children: T.title }),
|
|
3664
3655
|
" — ",
|
|
3665
3656
|
T.artist,
|
|
3666
|
-
T.performerName && /* @__PURE__ */
|
|
3657
|
+
T.performerName && /* @__PURE__ */ s("span", { children: [
|
|
3667
3658
|
" ",
|
|
3668
3659
|
"(",
|
|
3669
3660
|
h("karaokePicker.by", "by {name}").replace("{name}", T.performerName),
|
|
3670
3661
|
")"
|
|
3671
3662
|
] })
|
|
3672
3663
|
] }),
|
|
3673
|
-
!c && u && /* @__PURE__ */ e("div", { className: "nice-karaoke-picker__next", children: /* @__PURE__ */
|
|
3664
|
+
!c && u && /* @__PURE__ */ e("div", { className: "nice-karaoke-picker__next", children: /* @__PURE__ */ s(U, { variant: "secondary", size: "sm", onClick: u, children: [
|
|
3674
3665
|
h("karaokePicker.next", "Skip / Next"),
|
|
3675
3666
|
" ",
|
|
3676
3667
|
/* @__PURE__ */ e(rn, { size: 14 })
|
|
3677
3668
|
] }) })
|
|
3678
3669
|
] }),
|
|
3679
|
-
/* @__PURE__ */
|
|
3670
|
+
/* @__PURE__ */ s("div", { className: "nice-karaoke-picker__filters", children: [
|
|
3680
3671
|
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__search", children: /* @__PURE__ */ e(
|
|
3681
3672
|
Z,
|
|
3682
3673
|
{
|
|
3683
3674
|
size: "sm",
|
|
3684
3675
|
controlWidth: "100%",
|
|
3685
|
-
value:
|
|
3686
|
-
onChange:
|
|
3676
|
+
value: v,
|
|
3677
|
+
onChange: g,
|
|
3687
3678
|
placeholder: h("karaokePicker.search", "Search songs or artists…"),
|
|
3688
3679
|
"aria-label": h("karaokePicker.search", "Search songs or artists…")
|
|
3689
3680
|
}
|
|
3690
3681
|
) }),
|
|
3691
3682
|
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__difficulty-filter", children: /* @__PURE__ */ e(
|
|
3692
|
-
|
|
3683
|
+
ze,
|
|
3693
3684
|
{
|
|
3694
3685
|
size: "sm",
|
|
3695
3686
|
"aria-label": h("karaokePicker.allDifficulties", "All Difficulties"),
|
|
@@ -3702,12 +3693,12 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3702
3693
|
}
|
|
3703
3694
|
) })
|
|
3704
3695
|
] }),
|
|
3705
|
-
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__catalog", children: f.length === 0 ? /* @__PURE__ */ e("p", { children: h("karaokePicker.noMatch", "No songs match your search.") }) : f.map((y) => /* @__PURE__ */
|
|
3706
|
-
/* @__PURE__ */
|
|
3696
|
+
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__catalog", children: f.length === 0 ? /* @__PURE__ */ e("p", { children: h("karaokePicker.noMatch", "No songs match your search.") }) : f.map((y) => /* @__PURE__ */ s("div", { className: "nice-karaoke-picker__song", children: [
|
|
3697
|
+
/* @__PURE__ */ s("div", { children: [
|
|
3707
3698
|
/* @__PURE__ */ e("strong", { children: y.title }),
|
|
3708
3699
|
" — ",
|
|
3709
3700
|
y.artist,
|
|
3710
|
-
y.difficulty && /* @__PURE__ */
|
|
3701
|
+
y.difficulty && /* @__PURE__ */ s(
|
|
3711
3702
|
"span",
|
|
3712
3703
|
{
|
|
3713
3704
|
className: "nice-karaoke-picker__difficulty",
|
|
@@ -3727,30 +3718,30 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3727
3718
|
className: "nice-karaoke-picker__lyrics",
|
|
3728
3719
|
title: h("karaokePicker.lyrics", "Lyrics available"),
|
|
3729
3720
|
"aria-label": h("karaokePicker.lyrics", "Lyrics available"),
|
|
3730
|
-
children: /* @__PURE__ */ e(
|
|
3721
|
+
children: /* @__PURE__ */ e($t, { size: 12 })
|
|
3731
3722
|
}
|
|
3732
3723
|
),
|
|
3733
|
-
y.language && /* @__PURE__ */
|
|
3724
|
+
y.language && /* @__PURE__ */ s("span", { className: "nice-karaoke-picker__language", children: [
|
|
3734
3725
|
"(",
|
|
3735
3726
|
y.language,
|
|
3736
3727
|
")"
|
|
3737
3728
|
] })
|
|
3738
3729
|
] }),
|
|
3739
|
-
!c && /* @__PURE__ */ e("div", { children: p.has(y.id) ? /* @__PURE__ */ e(U, { variant: "outline", size: "sm", onClick: () => o == null ? void 0 : o(y.id), children: h("remove", "Remove") }) : /* @__PURE__ */
|
|
3730
|
+
!c && /* @__PURE__ */ e("div", { children: p.has(y.id) ? /* @__PURE__ */ e(U, { variant: "outline", size: "sm", onClick: () => o == null ? void 0 : o(y.id), children: h("remove", "Remove") }) : /* @__PURE__ */ s(U, { variant: "primary", size: "sm", onClick: () => d == null ? void 0 : d(y.id), children: [
|
|
3740
3731
|
/* @__PURE__ */ e(Xe, { size: 14 }),
|
|
3741
3732
|
" ",
|
|
3742
3733
|
h("karaokePicker.sing", "Sing")
|
|
3743
3734
|
] }) })
|
|
3744
3735
|
] }, y.id)) }),
|
|
3745
|
-
t.length > 0 && /* @__PURE__ */
|
|
3746
|
-
/* @__PURE__ */
|
|
3747
|
-
/* @__PURE__ */ e(
|
|
3736
|
+
t.length > 0 && /* @__PURE__ */ s("div", { className: "nice-karaoke-picker__queue", children: [
|
|
3737
|
+
/* @__PURE__ */ s("h4", { children: [
|
|
3738
|
+
/* @__PURE__ */ e(Pe, { size: 14 }),
|
|
3748
3739
|
" ",
|
|
3749
3740
|
h("karaokePicker.queue", "Queue ({count})").replace("{count}", String(t.length))
|
|
3750
3741
|
] }),
|
|
3751
|
-
t.map((y, M) => /* @__PURE__ */
|
|
3752
|
-
/* @__PURE__ */
|
|
3753
|
-
/* @__PURE__ */
|
|
3742
|
+
t.map((y, M) => /* @__PURE__ */ s("div", { className: "nice-karaoke-picker__queue-item", children: [
|
|
3743
|
+
/* @__PURE__ */ s("span", { children: [
|
|
3744
|
+
/* @__PURE__ */ s("strong", { children: [
|
|
3754
3745
|
M + 1,
|
|
3755
3746
|
"."
|
|
3756
3747
|
] }),
|
|
@@ -3758,7 +3749,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3758
3749
|
y.title,
|
|
3759
3750
|
" — ",
|
|
3760
3751
|
y.artist,
|
|
3761
|
-
y.performerName && /* @__PURE__ */
|
|
3752
|
+
y.performerName && /* @__PURE__ */ s("em", { children: [
|
|
3762
3753
|
" (",
|
|
3763
3754
|
y.performerName,
|
|
3764
3755
|
")"
|
|
@@ -3771,7 +3762,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3771
3762
|
size: "xs",
|
|
3772
3763
|
onClick: () => o(y.id),
|
|
3773
3764
|
"aria-label": `${h("remove", "Remove")} ${y.title}`,
|
|
3774
|
-
children: /* @__PURE__ */ e(
|
|
3765
|
+
children: /* @__PURE__ */ e(Ln, { size: 12 })
|
|
3775
3766
|
}
|
|
3776
3767
|
)
|
|
3777
3768
|
] }, y.id))
|
|
@@ -3779,9 +3770,9 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3779
3770
|
] });
|
|
3780
3771
|
}
|
|
3781
3772
|
), Gi = [], An = {
|
|
3782
|
-
game:
|
|
3783
|
-
music:
|
|
3784
|
-
dance:
|
|
3773
|
+
game: Bn,
|
|
3774
|
+
music: Pe,
|
|
3775
|
+
dance: Pe,
|
|
3785
3776
|
quiz: sn,
|
|
3786
3777
|
karaoke: Xe,
|
|
3787
3778
|
photo: On,
|
|
@@ -3806,36 +3797,31 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3806
3797
|
readOnly: m = !1,
|
|
3807
3798
|
layout: h = "grid",
|
|
3808
3799
|
className: z,
|
|
3809
|
-
style:
|
|
3810
|
-
} = i, [
|
|
3800
|
+
style: v
|
|
3801
|
+
} = i, [g, P] = D(""), [k, T] = D(""), f = F(() => new Set(_), [_]), p = F(() => {
|
|
3811
3802
|
const w = new Set(t.map((N) => N.category));
|
|
3812
3803
|
return Array.from(w);
|
|
3813
3804
|
}, [t]), A = F(() => {
|
|
3814
3805
|
let w = t;
|
|
3815
|
-
if (
|
|
3806
|
+
if (g && (w = w.filter((N) => N.category === g)), k.trim()) {
|
|
3816
3807
|
const N = k.toLowerCase();
|
|
3817
3808
|
w = w.filter(
|
|
3818
|
-
(
|
|
3819
|
-
var
|
|
3820
|
-
return
|
|
3809
|
+
(I) => {
|
|
3810
|
+
var B;
|
|
3811
|
+
return I.name.toLowerCase().includes(N) || ((B = I.description) == null ? void 0 : B.toLowerCase().includes(N));
|
|
3821
3812
|
}
|
|
3822
3813
|
);
|
|
3823
3814
|
}
|
|
3824
3815
|
return w;
|
|
3825
|
-
}, [t,
|
|
3816
|
+
}, [t, g, k]), y = !c || f.size < c, M = (w) => {
|
|
3826
3817
|
m || (f.has(w) ? o == null || o(w) : y && (d == null || d(w)));
|
|
3827
3818
|
};
|
|
3828
|
-
return /* @__PURE__ */
|
|
3829
|
-
/* @__PURE__ */
|
|
3819
|
+
return /* @__PURE__ */ s("div", { ref: r, className: `nice-attraction-picker ${z ?? ""}`, style: v, children: [
|
|
3820
|
+
/* @__PURE__ */ s("div", { className: "nice-attraction-picker__header", children: [
|
|
3830
3821
|
/* @__PURE__ */ e("h3", { className: "nice-attraction-picker__title", children: n("attractionPicker.attractions", "Attractions") }),
|
|
3831
|
-
c && /* @__PURE__ */
|
|
3832
|
-
f.size,
|
|
3833
|
-
"/",
|
|
3834
|
-
c,
|
|
3835
|
-
" selected"
|
|
3836
|
-
] })
|
|
3822
|
+
c && /* @__PURE__ */ e("span", { className: "nice-attraction-picker__count", children: n("attractionPicker.selected", "{size}/{maxSelections} selected").replace("{size}", String(f.size)).replace("{maxSelections}", String(c)) })
|
|
3837
3823
|
] }),
|
|
3838
|
-
/* @__PURE__ */
|
|
3824
|
+
/* @__PURE__ */ s("div", { className: "nice-attraction-picker__filters", children: [
|
|
3839
3825
|
/* @__PURE__ */ e(
|
|
3840
3826
|
"input",
|
|
3841
3827
|
{
|
|
@@ -3851,18 +3837,18 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3851
3837
|
{
|
|
3852
3838
|
type: "button",
|
|
3853
3839
|
onClick: () => P(""),
|
|
3854
|
-
className: `nice-attraction-picker__category${
|
|
3855
|
-
children: "All"
|
|
3840
|
+
className: `nice-attraction-picker__category${g ? "" : " nice-attraction-picker__category--active"}`,
|
|
3841
|
+
children: n("attractionPicker.all", "All")
|
|
3856
3842
|
}
|
|
3857
3843
|
),
|
|
3858
|
-
p.map((w) => /* @__PURE__ */
|
|
3844
|
+
p.map((w) => /* @__PURE__ */ s(
|
|
3859
3845
|
"button",
|
|
3860
3846
|
{
|
|
3861
3847
|
type: "button",
|
|
3862
|
-
onClick: () => P(w ===
|
|
3863
|
-
className: `nice-attraction-picker__category${w ===
|
|
3848
|
+
onClick: () => P(w === g ? "" : w),
|
|
3849
|
+
className: `nice-attraction-picker__category${w === g ? " nice-attraction-picker__category--active" : ""}`,
|
|
3864
3850
|
children: [
|
|
3865
|
-
|
|
3851
|
+
Re.createElement(An[w], { size: 14 }),
|
|
3866
3852
|
" ",
|
|
3867
3853
|
n(`attractionPicker.category.${w}`, Ki[w])
|
|
3868
3854
|
]
|
|
@@ -3872,20 +3858,20 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3872
3858
|
] }),
|
|
3873
3859
|
/* @__PURE__ */ e("div", { className: `nice-attraction-picker__items nice-attraction-picker__items--${h}`, children: A.length === 0 ? /* @__PURE__ */ e("p", { children: n("attractionPicker.noAttractionsFound", "No attractions found.") }) : A.map((w) => {
|
|
3874
3860
|
const N = f.has(w.id);
|
|
3875
|
-
return /* @__PURE__ */
|
|
3861
|
+
return /* @__PURE__ */ s(
|
|
3876
3862
|
"div",
|
|
3877
3863
|
{
|
|
3878
3864
|
className: `nice-attraction-picker__card${N ? " nice-attraction-picker__card--selected" : ""}${m ? " nice-attraction-picker__card--readonly" : ""}`,
|
|
3879
3865
|
onClick: () => M(w.id),
|
|
3880
3866
|
children: [
|
|
3881
3867
|
w.imageUrl && /* @__PURE__ */ e("img", { src: w.imageUrl, alt: w.name, className: "nice-attraction-picker__image" }),
|
|
3882
|
-
/* @__PURE__ */
|
|
3883
|
-
/* @__PURE__ */ e("span", { className: "nice-attraction-picker__icon", children:
|
|
3868
|
+
/* @__PURE__ */ s("div", { className: "nice-attraction-picker__name", children: [
|
|
3869
|
+
/* @__PURE__ */ e("span", { className: "nice-attraction-picker__icon", children: Re.createElement(An[w.category], { size: 16 }) }),
|
|
3884
3870
|
/* @__PURE__ */ e("strong", { children: w.name })
|
|
3885
3871
|
] }),
|
|
3886
3872
|
w.description && /* @__PURE__ */ e("p", { className: "nice-attraction-picker__description", children: w.description }),
|
|
3887
|
-
/* @__PURE__ */
|
|
3888
|
-
l && /* @__PURE__ */
|
|
3873
|
+
/* @__PURE__ */ s("div", { className: "nice-attraction-picker__card-footer", children: [
|
|
3874
|
+
l && /* @__PURE__ */ s("span", { className: "nice-attraction-picker__votes", children: [
|
|
3889
3875
|
/* @__PURE__ */ e(cn, { size: 14 }),
|
|
3890
3876
|
" ",
|
|
3891
3877
|
w.votes ?? 0
|
|
@@ -3895,8 +3881,8 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3895
3881
|
{
|
|
3896
3882
|
type: "button",
|
|
3897
3883
|
className: "nice-attraction-picker__vote",
|
|
3898
|
-
onClick: (
|
|
3899
|
-
|
|
3884
|
+
onClick: (I) => {
|
|
3885
|
+
I.stopPropagation(), u(w.id);
|
|
3900
3886
|
},
|
|
3901
3887
|
children: n("attractionPicker.vote", "Vote")
|
|
3902
3888
|
}
|
|
@@ -3909,9 +3895,9 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3909
3895
|
}) })
|
|
3910
3896
|
] });
|
|
3911
3897
|
}), ji = [], Hi = {
|
|
3912
|
-
game:
|
|
3913
|
-
music:
|
|
3914
|
-
dance:
|
|
3898
|
+
game: Bn,
|
|
3899
|
+
music: Pe,
|
|
3900
|
+
dance: Pe,
|
|
3915
3901
|
quiz: sn,
|
|
3916
3902
|
karaoke: Xe,
|
|
3917
3903
|
photo: On,
|
|
@@ -3928,7 +3914,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3928
3914
|
showResults: m = !0,
|
|
3929
3915
|
className: h,
|
|
3930
3916
|
style: z
|
|
3931
|
-
} = i,
|
|
3917
|
+
} = i, v = F(() => new Set(u), [u]), g = _ ? _ - v.size : void 0, P = F(() => {
|
|
3932
3918
|
const p = [...t];
|
|
3933
3919
|
switch (l) {
|
|
3934
3920
|
case "votes":
|
|
@@ -3946,7 +3932,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3946
3932
|
() => Math.max(...t.map((p) => p.votes ?? 0), 1),
|
|
3947
3933
|
[t]
|
|
3948
3934
|
), T = (p) => {
|
|
3949
|
-
c || (
|
|
3935
|
+
c || (v.has(p) ? o == null || o(p) : (!g || g > 0) && (d == null || d(p)));
|
|
3950
3936
|
}, f = (p) => {
|
|
3951
3937
|
switch (p) {
|
|
3952
3938
|
case 0:
|
|
@@ -3980,14 +3966,14 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3980
3966
|
return `${p + 1}.`;
|
|
3981
3967
|
}
|
|
3982
3968
|
};
|
|
3983
|
-
return /* @__PURE__ */
|
|
3969
|
+
return /* @__PURE__ */ s(
|
|
3984
3970
|
"div",
|
|
3985
3971
|
{
|
|
3986
3972
|
ref: r,
|
|
3987
3973
|
className: `nice-attraction-voting ${h ?? ""}`,
|
|
3988
3974
|
style: { color: "var(--nice-text-primary)", ...z },
|
|
3989
3975
|
children: [
|
|
3990
|
-
/* @__PURE__ */
|
|
3976
|
+
/* @__PURE__ */ s(
|
|
3991
3977
|
"div",
|
|
3992
3978
|
{
|
|
3993
3979
|
style: {
|
|
@@ -3997,32 +3983,33 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3997
3983
|
marginBottom: 16
|
|
3998
3984
|
},
|
|
3999
3985
|
children: [
|
|
4000
|
-
/* @__PURE__ */
|
|
4001
|
-
/* @__PURE__ */ e(
|
|
3986
|
+
/* @__PURE__ */ s("h3", { style: { margin: 0, display: "inline-flex", alignItems: "center", gap: 8 }, children: [
|
|
3987
|
+
/* @__PURE__ */ e(Rt, { size: 20 }),
|
|
4002
3988
|
c ? n("attractionVoting.votingResults", "Voting Results") : n("attractionVoting.voteForAttractions", "Vote for Attractions")
|
|
4003
3989
|
] }),
|
|
4004
|
-
!c &&
|
|
3990
|
+
!c && g !== void 0 && /* @__PURE__ */ e(
|
|
4005
3991
|
"span",
|
|
4006
3992
|
{
|
|
4007
3993
|
style: {
|
|
4008
3994
|
fontSize: 14,
|
|
4009
|
-
color:
|
|
3995
|
+
color: g > 0 ? "var(--nice-color-primary, #6366f1)" : "var(--nice-color-error, #ef4444)"
|
|
4010
3996
|
},
|
|
4011
|
-
children:
|
|
4012
|
-
|
|
4013
|
-
"
|
|
4014
|
-
|
|
4015
|
-
"
|
|
4016
|
-
|
|
3997
|
+
children: g !== 1 ? n(
|
|
3998
|
+
"attractionVoting.votesRemainingMany",
|
|
3999
|
+
"{votesRemaining} votes remaining"
|
|
4000
|
+
).replace("{votesRemaining}", String(g)) : n("attractionVoting.votesRemainingOne", "{votesRemaining} vote remaining").replace(
|
|
4001
|
+
"{votesRemaining}",
|
|
4002
|
+
String(g)
|
|
4003
|
+
)
|
|
4017
4004
|
}
|
|
4018
4005
|
)
|
|
4019
4006
|
]
|
|
4020
4007
|
}
|
|
4021
4008
|
),
|
|
4022
|
-
c && /* @__PURE__ */ e("p", { style: { color: "var(--nice-text-secondary, #64748b)", marginBottom: 12 }, children: "Voting is closed. Final results:" }),
|
|
4009
|
+
c && /* @__PURE__ */ e("p", { style: { color: "var(--nice-text-secondary, #64748b)", marginBottom: 12 }, children: n("attractionVoting.votingIsClosedFinalResults", "Voting is closed. Final results:") }),
|
|
4023
4010
|
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: P.map((p, A) => {
|
|
4024
|
-
const y =
|
|
4025
|
-
return /* @__PURE__ */
|
|
4011
|
+
const y = v.has(p.id), M = p.votes ?? 0, w = m ? `${Math.round(M / k * 100)}%` : "0%";
|
|
4012
|
+
return /* @__PURE__ */ s(
|
|
4026
4013
|
"div",
|
|
4027
4014
|
{
|
|
4028
4015
|
style: {
|
|
@@ -4039,8 +4026,8 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
4039
4026
|
onClick: () => T(p.id),
|
|
4040
4027
|
children: [
|
|
4041
4028
|
m && /* @__PURE__ */ e("span", { style: { fontSize: 18, minWidth: 32, textAlign: "center" }, children: f(A) }),
|
|
4042
|
-
/* @__PURE__ */ e("span", { style: { display: "inline-flex", fontSize: 20 }, children:
|
|
4043
|
-
/* @__PURE__ */
|
|
4029
|
+
/* @__PURE__ */ e("span", { style: { display: "inline-flex", fontSize: 20 }, children: Re.createElement(Hi[p.category], { size: 20 }) }),
|
|
4030
|
+
/* @__PURE__ */ s("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4044
4031
|
/* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children: p.name }),
|
|
4045
4032
|
p.description && /* @__PURE__ */ e(
|
|
4046
4033
|
"div",
|
|
@@ -4104,7 +4091,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
4104
4091
|
p.id
|
|
4105
4092
|
);
|
|
4106
4093
|
}) }),
|
|
4107
|
-
m && /* @__PURE__ */
|
|
4094
|
+
m && /* @__PURE__ */ e(
|
|
4108
4095
|
"div",
|
|
4109
4096
|
{
|
|
4110
4097
|
style: {
|
|
@@ -4113,10 +4100,10 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
4113
4100
|
fontSize: 13,
|
|
4114
4101
|
color: "var(--nice-text-secondary, #64748b)"
|
|
4115
4102
|
},
|
|
4116
|
-
children:
|
|
4117
|
-
"
|
|
4118
|
-
t.reduce((p, A) => p + (A.votes ?? 0), 0)
|
|
4119
|
-
|
|
4103
|
+
children: n("attractionVoting.totalVotes", "Total votes: {votes}").replace(
|
|
4104
|
+
"{votes}",
|
|
4105
|
+
String(t.reduce((p, A) => p + (A.votes ?? 0), 0))
|
|
4106
|
+
)
|
|
4120
4107
|
}
|
|
4121
4108
|
)
|
|
4122
4109
|
]
|