@nice2dev/events 1.4.66 → 1.4.67
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 +4 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1302 -1302
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as s, jsx as e, Fragment as
|
|
2
|
-
import { NtdMove as Mn, NtdHeart as
|
|
3
|
-
import { NiceUpload as en, NiceTextInput as
|
|
4
|
-
import { useNiceTranslation as
|
|
5
|
-
import
|
|
6
|
-
function
|
|
1
|
+
import { jsxs as s, jsx as e, Fragment as Ke } from "react/jsx-runtime";
|
|
2
|
+
import { NtdMove as Mn, NtdHeart as bt, NtdTrash as Re, NtdPlay as je, NtdImage as Ln, NtdPlus as an, NtdCheck as He, NtdHelp as sn, NtdClose as $n, NtdSearch as kt, NtdQrCode as wt, NtdMail as Rn, NtdWheelchair as Dn, NtdSend as St, NtdGiftCard as Ct, NtdStar as xt, NtdLink as It, NtdReceipt as Pt, NtdCoins as zt, NtdArrowRight as At, NtdSkipForward as rn, NtdBarChart as Tt, NtdThumbsUp as cn, NtdClock as En, NtdTrophy as ln, NtdMedal as Je, NtdStop as Mt, NtdMusic as Se, NtdMicrophone as qe, NtdFileText as Lt, NtdSparkle as On, NtdCamera as Yn, NtdGamepad as Bn, NtdClipboardCheck as $t } from "@nice2dev/icons";
|
|
3
|
+
import { NiceUpload as en, NiceTextInput as Z, NiceCardGroup as Un, NiceEmpty as Rt, NiceButton as U, NiceSegmentedControl as Vn, NiceTextArea as on, NiceToggle as Ze, NiceAvatarGroup as bn, NiceAvatar as Fe, NiceBadge as se, NiceSelect as Ce, NiceAmountBreakdown as Dt, NiceTabs as Et, NiceNumericInput as dn, NiceCollapse as Ot, NiceZoomControl as Yt, NiceDocumentEditor as Bt, NiceProgress as Ut } from "@nice2dev/ui";
|
|
4
|
+
import { useNiceTranslation as J, NiceIcon as re, formatLocaleDate as Vt, resolveDateLocale as Ft, useControllableState as Xt, clickOnActivationKey as un } from "@nice2dev/ui-core";
|
|
5
|
+
import $e, { useState as D, useRef as ye, useCallback as H, forwardRef as ie, useMemo as V, useEffect as Xe } from "react";
|
|
6
|
+
function qt(a) {
|
|
7
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
9
|
function kn(a, i, r) {
|
|
@@ -17,16 +17,16 @@ function kn(a, i, r) {
|
|
|
17
17
|
return n.splice(r, 0, t), n;
|
|
18
18
|
}
|
|
19
19
|
function Fn(a) {
|
|
20
|
-
const { items: i, onReorder: r, disabled: n = !1 } = a, [t,
|
|
21
|
-
(g,
|
|
22
|
-
const k = m(g), T = m(
|
|
23
|
-
k < 0 || T < 0 || k === T || r == null || r(kn([...i], k, T).map((
|
|
20
|
+
const { items: i, onReorder: r, disabled: n = !1 } = a, [t, l] = D(null), [d, u] = D(null), [f, c] = D(!1), o = ye(null), m = H((g) => i.findIndex((I) => I.id === g), [i]), h = H(
|
|
21
|
+
(g, I) => {
|
|
22
|
+
const k = m(g), T = m(I);
|
|
23
|
+
k < 0 || T < 0 || k === T || r == null || r(kn([...i], k, T).map((v) => v.id));
|
|
24
24
|
},
|
|
25
25
|
[i, m, r]
|
|
26
26
|
), z = H(() => {
|
|
27
|
-
|
|
28
|
-
}, []),
|
|
29
|
-
(g,
|
|
27
|
+
l(null), u(null), c(!1), o.current = null;
|
|
28
|
+
}, []), _ = H(
|
|
29
|
+
(g, I) => ({
|
|
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.
|
|
@@ -37,13 +37,13 @@ function Fn(a) {
|
|
|
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),
|
|
40
|
+
(A = (p = k.currentTarget).setPointerCapture) == null || A.call(p, k.pointerId), l(g), c(!0), o.current = i.map((y) => y.id);
|
|
41
41
|
const T = () => {
|
|
42
|
-
window.removeEventListener("pointerup", T), window.removeEventListener("pointercancel",
|
|
43
|
-
},
|
|
44
|
-
window.removeEventListener("pointerup", T), window.removeEventListener("pointercancel",
|
|
42
|
+
window.removeEventListener("pointerup", T), window.removeEventListener("pointercancel", v), c(!1), l(null), u(null);
|
|
43
|
+
}, v = () => {
|
|
44
|
+
window.removeEventListener("pointerup", T), window.removeEventListener("pointercancel", v), o.current && (r == null || r(o.current)), z();
|
|
45
45
|
};
|
|
46
|
-
window.addEventListener("pointerup", T), window.addEventListener("pointercancel",
|
|
46
|
+
window.addEventListener("pointerup", T), window.addEventListener("pointercancel", v);
|
|
47
47
|
},
|
|
48
48
|
onPointerEnter: () => {
|
|
49
49
|
n || !t || t === g || (u(g), h(t, g));
|
|
@@ -52,36 +52,36 @@ function Fn(a) {
|
|
|
52
52
|
if (n)
|
|
53
53
|
return;
|
|
54
54
|
if (k.key === " " || k.key === "Enter") {
|
|
55
|
-
k.preventDefault(), t === g ? z() : (
|
|
55
|
+
k.preventDefault(), t === g ? z() : (l(g), o.current = i.map((y) => y.id));
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
if (k.key === "Escape" && t === g) {
|
|
59
|
-
k.preventDefault(),
|
|
59
|
+
k.preventDefault(), o.current && (r == null || r(o.current)), z();
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
if (t !== g)
|
|
63
63
|
return;
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
64
|
+
const v = k.key === "ArrowLeft" || k.key === "ArrowUp" ? -1 : k.key === "ArrowRight" || k.key === "ArrowDown" ? 1 : 0;
|
|
65
|
+
if (v === 0)
|
|
66
66
|
return;
|
|
67
67
|
k.preventDefault();
|
|
68
|
-
const p = m(g), A = p +
|
|
68
|
+
const p = m(g), A = p + v;
|
|
69
69
|
A < 0 || A >= i.length || r == null || r(kn([...i], p, A).map((y) => y.id));
|
|
70
70
|
},
|
|
71
|
-
...
|
|
71
|
+
...I ? { "aria-label": I } : {}
|
|
72
72
|
}),
|
|
73
73
|
[t, h, n, z, m, i, r]
|
|
74
74
|
);
|
|
75
|
-
return { activeId: t, overId:
|
|
75
|
+
return { activeId: t, overId: d, getHandleProps: _, dragging: f };
|
|
76
76
|
}
|
|
77
|
-
const
|
|
78
|
-
const { t: i } =
|
|
79
|
-
return a.type === "video" ? /* @__PURE__ */ e("div", { className: "nice-event-media__video-thumb", children: /* @__PURE__ */ e(
|
|
77
|
+
const Wt = ({ 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(je, { size: 26 }) }) : r || !t ? /* @__PURE__ */ e(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
className: "nice-event-media__broken",
|
|
83
83
|
title: i("eventMedia.imageUnavailable", "Image unavailable"),
|
|
84
|
-
children: /* @__PURE__ */ e(
|
|
84
|
+
children: /* @__PURE__ */ e(Ln, { size: 24 })
|
|
85
85
|
}
|
|
86
86
|
) : (
|
|
87
87
|
// onError swaps in the placeholder when the file fails to load — no user interaction
|
|
@@ -96,36 +96,36 @@ const Ft = ({ item: a }) => {
|
|
|
96
96
|
}
|
|
97
97
|
)
|
|
98
98
|
);
|
|
99
|
-
},
|
|
99
|
+
}, Gt = [], aa = /* @__PURE__ */ ie(
|
|
100
100
|
function(i, r) {
|
|
101
|
-
const { t: n } =
|
|
102
|
-
items: t =
|
|
103
|
-
onUpload:
|
|
104
|
-
onDelete:
|
|
101
|
+
const { t: n } = J(), {
|
|
102
|
+
items: t = Gt,
|
|
103
|
+
onUpload: l,
|
|
104
|
+
onDelete: d,
|
|
105
105
|
onLike: u,
|
|
106
|
-
onItemClick:
|
|
106
|
+
onItemClick: f,
|
|
107
107
|
layout: c = "grid",
|
|
108
|
-
uploadEnabled:
|
|
108
|
+
uploadEnabled: o = !0,
|
|
109
109
|
typeFilter: m = "all",
|
|
110
110
|
onReorder: h,
|
|
111
111
|
className: z,
|
|
112
|
-
style:
|
|
113
|
-
} = i, [g,
|
|
112
|
+
style: _
|
|
113
|
+
} = i, [g, I] = D(""), k = V(() => qt(t), [t]), T = V(() => m === "all" ? k : k.filter((M) => M.type === m), [k, m]), v = !!h && m === "all", p = Fn({ items: k, onReorder: h, disabled: !v }), A = (M) => {
|
|
114
114
|
const w = M[0];
|
|
115
|
-
!w || !
|
|
115
|
+
!w || !l || (l(w, g.trim() || void 0), I(""));
|
|
116
116
|
}, y = c === "list";
|
|
117
117
|
return /* @__PURE__ */ s(
|
|
118
118
|
"div",
|
|
119
119
|
{
|
|
120
120
|
ref: r,
|
|
121
121
|
className: `nice-event-media nice-event-media--${c} ${z ?? ""}`,
|
|
122
|
-
style:
|
|
122
|
+
style: _,
|
|
123
123
|
children: [
|
|
124
124
|
/* @__PURE__ */ e("div", { className: "nice-event-media__header", children: /* @__PURE__ */ e("h3", { children: n("eventMedia.media", "Media ({filtered})").replace(
|
|
125
125
|
"{filtered}",
|
|
126
126
|
String(T.length)
|
|
127
127
|
) }) }),
|
|
128
|
-
|
|
128
|
+
o && l && /* @__PURE__ */ s("div", { className: "nice-event-media__upload", children: [
|
|
129
129
|
/* @__PURE__ */ e(
|
|
130
130
|
en,
|
|
131
131
|
{
|
|
@@ -136,10 +136,10 @@ const Ft = ({ item: a }) => {
|
|
|
136
136
|
}
|
|
137
137
|
),
|
|
138
138
|
/* @__PURE__ */ e(
|
|
139
|
-
|
|
139
|
+
Z,
|
|
140
140
|
{
|
|
141
141
|
value: g,
|
|
142
|
-
onChange:
|
|
142
|
+
onChange: I,
|
|
143
143
|
placeholder: n("eventMedia.addACaption", "Add a caption…")
|
|
144
144
|
}
|
|
145
145
|
)
|
|
@@ -152,7 +152,7 @@ const Ft = ({ item: a }) => {
|
|
|
152
152
|
gap: 12,
|
|
153
153
|
align: "stretch",
|
|
154
154
|
children: T.map((M, w) => {
|
|
155
|
-
const N =
|
|
155
|
+
const N = v ? p.getHandleProps(
|
|
156
156
|
M.id,
|
|
157
157
|
n("eventMedia.moveItem", "Move {name}").replace(
|
|
158
158
|
"{name}",
|
|
@@ -163,13 +163,13 @@ const Ft = ({ item: a }) => {
|
|
|
163
163
|
"div",
|
|
164
164
|
{
|
|
165
165
|
className: `nice-event-media__card${y ? " nice-event-media__card--row" : ""}${p.activeId === M.id ? " nice-event-media__card--dragging" : ""}`,
|
|
166
|
-
onClick: () =>
|
|
167
|
-
onKeyDown: (
|
|
168
|
-
|
|
166
|
+
onClick: () => f == null ? void 0 : f(M),
|
|
167
|
+
onKeyDown: (P) => {
|
|
168
|
+
f && P.target === P.currentTarget && (P.key === "Enter" || P.key === " ") && (P.preventDefault(), f(M));
|
|
169
169
|
},
|
|
170
170
|
onPointerEnter: N == null ? void 0 : N.onPointerEnter,
|
|
171
|
-
role:
|
|
172
|
-
tabIndex:
|
|
171
|
+
role: f ? "button" : void 0,
|
|
172
|
+
tabIndex: f ? 0 : void 0,
|
|
173
173
|
children: [
|
|
174
174
|
N && /* @__PURE__ */ e(
|
|
175
175
|
"span",
|
|
@@ -182,11 +182,11 @@ const Ft = ({ item: a }) => {
|
|
|
182
182
|
draggable: N.draggable,
|
|
183
183
|
onPointerDown: N.onPointerDown,
|
|
184
184
|
onKeyDown: N.onKeyDown,
|
|
185
|
-
onClick: (
|
|
185
|
+
onClick: (P) => P.stopPropagation(),
|
|
186
186
|
children: /* @__PURE__ */ e(Mn, { size: 14 })
|
|
187
187
|
}
|
|
188
188
|
),
|
|
189
|
-
/* @__PURE__ */ e(
|
|
189
|
+
/* @__PURE__ */ e(Wt, { item: M }),
|
|
190
190
|
/* @__PURE__ */ s("div", { className: "nice-event-media__body", children: [
|
|
191
191
|
M.caption && /* @__PURE__ */ e("span", { className: "nice-event-media__caption", children: M.caption }),
|
|
192
192
|
M.uploadedByName && /* @__PURE__ */ e("span", { className: "nice-event-media__uploader", children: M.uploadedByName }),
|
|
@@ -196,27 +196,27 @@ const Ft = ({ item: a }) => {
|
|
|
196
196
|
{
|
|
197
197
|
type: "button",
|
|
198
198
|
className: "nice-event-media__action",
|
|
199
|
-
onClick: (
|
|
200
|
-
|
|
199
|
+
onClick: (P) => {
|
|
200
|
+
P.stopPropagation(), u(M.id);
|
|
201
201
|
},
|
|
202
202
|
"aria-label": n("eventMedia.like", "Like"),
|
|
203
203
|
children: [
|
|
204
|
-
/* @__PURE__ */ e(
|
|
204
|
+
/* @__PURE__ */ e(bt, { size: 15 }),
|
|
205
205
|
" ",
|
|
206
206
|
M.likes ?? 0
|
|
207
207
|
]
|
|
208
208
|
}
|
|
209
209
|
),
|
|
210
|
-
|
|
210
|
+
d && /* @__PURE__ */ e(
|
|
211
211
|
"button",
|
|
212
212
|
{
|
|
213
213
|
type: "button",
|
|
214
214
|
className: "nice-event-media__action nice-event-media__action--danger",
|
|
215
|
-
onClick: (
|
|
216
|
-
|
|
215
|
+
onClick: (P) => {
|
|
216
|
+
P.stopPropagation(), d(M.id);
|
|
217
217
|
},
|
|
218
218
|
"aria-label": n("eventMedia.delete", "Delete"),
|
|
219
|
-
children: /* @__PURE__ */ e(
|
|
219
|
+
children: /* @__PURE__ */ e(Re, { size: 15 })
|
|
220
220
|
}
|
|
221
221
|
)
|
|
222
222
|
] })
|
|
@@ -239,7 +239,7 @@ const Ft = ({ item: a }) => {
|
|
|
239
239
|
action: n,
|
|
240
240
|
className: t
|
|
241
241
|
}) => /* @__PURE__ */ e(
|
|
242
|
-
|
|
242
|
+
Rt,
|
|
243
243
|
{
|
|
244
244
|
size: "sm",
|
|
245
245
|
title: a,
|
|
@@ -248,100 +248,100 @@ const Ft = ({ item: a }) => {
|
|
|
248
248
|
action: n,
|
|
249
249
|
className: t
|
|
250
250
|
}
|
|
251
|
-
),
|
|
251
|
+
), Kt = [], sa = /* @__PURE__ */ ie(
|
|
252
252
|
function(i, r) {
|
|
253
|
-
const { t: n } =
|
|
254
|
-
items: t =
|
|
255
|
-
layout:
|
|
256
|
-
onReorder:
|
|
253
|
+
const { t: n } = J(), {
|
|
254
|
+
items: t = Kt,
|
|
255
|
+
layout: l = "grid",
|
|
256
|
+
onReorder: d,
|
|
257
257
|
onItemAdd: u,
|
|
258
|
-
onItemRemove:
|
|
258
|
+
onItemRemove: f,
|
|
259
259
|
onCaptionChange: c,
|
|
260
|
-
onItemClick:
|
|
260
|
+
onItemClick: o,
|
|
261
261
|
previewMode: m = !1,
|
|
262
262
|
transition: h = "fade",
|
|
263
263
|
defaultDurationMs: z = 3e3,
|
|
264
|
-
autoPlay:
|
|
264
|
+
autoPlay: _ = !0,
|
|
265
265
|
disabled: g = !1,
|
|
266
|
-
readOnly:
|
|
266
|
+
readOnly: I = !1,
|
|
267
267
|
size: k = "md",
|
|
268
268
|
className: T,
|
|
269
|
-
style:
|
|
270
|
-
} = i, [p, A] = D(0), [y, M] = D(null), [w, N] = D(""),
|
|
271
|
-
|
|
272
|
-
if (!m || !
|
|
269
|
+
style: v
|
|
270
|
+
} = i, [p, A] = D(0), [y, M] = D(null), [w, N] = D(""), P = g || I, E = !!d && !P, F = Fn({ items: t, onReorder: d, disabled: !E }), X = t.length > 0 ? Math.min(p, t.length - 1) : 0, L = t[X], G = (L == null ? void 0 : L.durationMs) ?? z;
|
|
271
|
+
Xe(() => {
|
|
272
|
+
if (!m || !_ || t.length < 2)
|
|
273
273
|
return;
|
|
274
|
-
const
|
|
274
|
+
const R = window.setTimeout(
|
|
275
275
|
() => A((j) => (j + 1) % t.length),
|
|
276
|
-
Math.max(250,
|
|
276
|
+
Math.max(250, G)
|
|
277
277
|
);
|
|
278
|
-
return () => window.clearTimeout(
|
|
279
|
-
}, [m,
|
|
280
|
-
const C =
|
|
281
|
-
() => t.reduce((
|
|
278
|
+
return () => window.clearTimeout(R);
|
|
279
|
+
}, [m, _, t.length, X, G]);
|
|
280
|
+
const C = V(
|
|
281
|
+
() => t.reduce((R, j) => R + (j.durationMs ?? z), 0),
|
|
282
282
|
[t, z]
|
|
283
|
-
), b = (
|
|
284
|
-
c == null || c(
|
|
283
|
+
), b = (R) => {
|
|
284
|
+
c == null || c(R, w), M(null), N("");
|
|
285
285
|
};
|
|
286
|
-
return t.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-media-collage ${T ?? ""}`, style:
|
|
286
|
+
return t.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-media-collage ${T ?? ""}`, style: v, children: /* @__PURE__ */ e(
|
|
287
287
|
Ne,
|
|
288
288
|
{
|
|
289
|
-
icon: /* @__PURE__ */ e(
|
|
289
|
+
icon: /* @__PURE__ */ e(Ln, { size: 28 }),
|
|
290
290
|
title: n("mediaCollage.nothingInTheCollageYet", "Nothing in the collage yet"),
|
|
291
291
|
description: n(
|
|
292
292
|
"mediaCollage.addPhotosOrVideoTo",
|
|
293
293
|
"Add photos or video to start arranging them."
|
|
294
294
|
),
|
|
295
|
-
action: u && !
|
|
295
|
+
action: u && !P ? /* @__PURE__ */ e(en, { accept: "image/*,video/*", multiple: !0, onFilesSelected: u }) : void 0
|
|
296
296
|
}
|
|
297
297
|
) }) : m ? /* @__PURE__ */ s(
|
|
298
298
|
"div",
|
|
299
299
|
{
|
|
300
300
|
ref: r,
|
|
301
301
|
className: `nice-media-collage nice-media-collage--preview nice-media-collage--${h} ${T ?? ""}`,
|
|
302
|
-
style:
|
|
302
|
+
style: v,
|
|
303
303
|
children: [
|
|
304
304
|
/* @__PURE__ */ s("div", { className: "nice-media-collage__stage", "aria-live": "polite", children: [
|
|
305
|
-
(
|
|
305
|
+
(L == null ? void 0 : L.type) === "video" ? /* @__PURE__ */ e(
|
|
306
306
|
"video",
|
|
307
307
|
{
|
|
308
308
|
className: "nice-media-collage__slide",
|
|
309
|
-
src:
|
|
309
|
+
src: L.mediaUrl,
|
|
310
310
|
controls: !0
|
|
311
311
|
},
|
|
312
|
-
|
|
312
|
+
L.id
|
|
313
313
|
) : /* @__PURE__ */ e(
|
|
314
314
|
"img",
|
|
315
315
|
{
|
|
316
316
|
className: "nice-media-collage__slide",
|
|
317
|
-
src:
|
|
318
|
-
alt: (
|
|
317
|
+
src: L == null ? void 0 : L.mediaUrl,
|
|
318
|
+
alt: (L == null ? void 0 : L.caption) ?? ""
|
|
319
319
|
},
|
|
320
|
-
|
|
320
|
+
L == null ? void 0 : L.id
|
|
321
321
|
),
|
|
322
|
-
(
|
|
322
|
+
(L == null ? void 0 : L.caption) && /* @__PURE__ */ e("p", { className: "nice-media-collage__slide-caption", children: L.caption })
|
|
323
323
|
] }),
|
|
324
324
|
/* @__PURE__ */ s("div", { className: "nice-media-collage__playbar", children: [
|
|
325
325
|
/* @__PURE__ */ e(
|
|
326
|
-
|
|
326
|
+
U,
|
|
327
327
|
{
|
|
328
328
|
size: "sm",
|
|
329
329
|
variant: "ghost",
|
|
330
|
-
onClick: () => A((
|
|
330
|
+
onClick: () => A((R) => (R - 1 + t.length) % t.length),
|
|
331
331
|
children: n("mediaCollage.previous", "Previous")
|
|
332
332
|
}
|
|
333
333
|
),
|
|
334
334
|
/* @__PURE__ */ s("span", { className: "nice-media-collage__counter", children: [
|
|
335
|
-
|
|
335
|
+
X + 1,
|
|
336
336
|
" / ",
|
|
337
337
|
t.length
|
|
338
338
|
] }),
|
|
339
339
|
/* @__PURE__ */ e(
|
|
340
|
-
|
|
340
|
+
U,
|
|
341
341
|
{
|
|
342
342
|
size: "sm",
|
|
343
343
|
variant: "ghost",
|
|
344
|
-
onClick: () => A((
|
|
344
|
+
onClick: () => A((R) => (R + 1) % t.length),
|
|
345
345
|
children: n("mediaCollage.next", "Next")
|
|
346
346
|
}
|
|
347
347
|
)
|
|
@@ -352,15 +352,15 @@ const Ft = ({ item: a }) => {
|
|
|
352
352
|
"div",
|
|
353
353
|
{
|
|
354
354
|
ref: r,
|
|
355
|
-
className: `nice-media-collage nice-media-collage--${
|
|
356
|
-
style:
|
|
355
|
+
className: `nice-media-collage nice-media-collage--${l} nice-media-collage--${k} ${T ?? ""}`,
|
|
356
|
+
style: v,
|
|
357
357
|
children: [
|
|
358
358
|
/* @__PURE__ */ s("div", { className: "nice-media-collage__toolbar", children: [
|
|
359
359
|
/* @__PURE__ */ e(
|
|
360
360
|
Vn,
|
|
361
361
|
{
|
|
362
362
|
size: "sm",
|
|
363
|
-
value:
|
|
363
|
+
value: l,
|
|
364
364
|
readOnly: !0,
|
|
365
365
|
options: [
|
|
366
366
|
{ value: "sequence", label: n("mediaCollage.sequence", "Sequence") },
|
|
@@ -370,7 +370,7 @@ const Ft = ({ item: a }) => {
|
|
|
370
370
|
}
|
|
371
371
|
),
|
|
372
372
|
/* @__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))) }),
|
|
373
|
-
u && !
|
|
373
|
+
u && !P && /* @__PURE__ */ e(
|
|
374
374
|
en,
|
|
375
375
|
{
|
|
376
376
|
accept: "image/*,video/*",
|
|
@@ -385,20 +385,20 @@ const Ft = ({ item: a }) => {
|
|
|
385
385
|
{
|
|
386
386
|
className: "nice-media-collage__tiles",
|
|
387
387
|
"aria-label": n("mediaCollage.collageOrder", "Collage order"),
|
|
388
|
-
"aria-busy":
|
|
389
|
-
children: t.map((
|
|
390
|
-
const
|
|
391
|
-
|
|
388
|
+
"aria-busy": F.dragging,
|
|
389
|
+
children: t.map((R, j) => {
|
|
390
|
+
const K = E ? F.getHandleProps(
|
|
391
|
+
R.id,
|
|
392
392
|
n("mediaCollage.moveItem", "Move {name}").replace(
|
|
393
393
|
"{name}",
|
|
394
|
-
|
|
394
|
+
R.caption ?? n("mediaCollage.itemN", "item {n}").replace("{n}", String(j + 1))
|
|
395
395
|
)
|
|
396
396
|
) : null;
|
|
397
397
|
return /* @__PURE__ */ s(
|
|
398
398
|
"li",
|
|
399
399
|
{
|
|
400
|
-
className: `nice-media-collage__tile${
|
|
401
|
-
onPointerEnter:
|
|
400
|
+
className: `nice-media-collage__tile${F.activeId === R.id ? " nice-media-collage__tile--active" : ""}${F.overId === R.id ? " nice-media-collage__tile--over" : ""}`,
|
|
401
|
+
onPointerEnter: K == null ? void 0 : K.onPointerEnter,
|
|
402
402
|
children: [
|
|
403
403
|
/* @__PURE__ */ e("span", { className: "nice-media-collage__index", "aria-hidden": "true", children: j + 1 }),
|
|
404
404
|
/* @__PURE__ */ e(
|
|
@@ -406,30 +406,30 @@ const Ft = ({ item: a }) => {
|
|
|
406
406
|
{
|
|
407
407
|
type: "button",
|
|
408
408
|
className: "nice-media-collage__thumb-button",
|
|
409
|
-
onClick: () =>
|
|
410
|
-
disabled: !
|
|
411
|
-
children:
|
|
409
|
+
onClick: () => o == null ? void 0 : o(R),
|
|
410
|
+
disabled: !o,
|
|
411
|
+
children: R.type === "video" ? /* @__PURE__ */ e("span", { className: "nice-media-collage__video-thumb", children: /* @__PURE__ */ e(je, { size: 22 }) }) : /* @__PURE__ */ e(
|
|
412
412
|
"img",
|
|
413
413
|
{
|
|
414
414
|
className: "nice-media-collage__thumb",
|
|
415
|
-
src:
|
|
416
|
-
alt:
|
|
415
|
+
src: R.mediaUrl,
|
|
416
|
+
alt: R.caption ?? "",
|
|
417
417
|
loading: "lazy"
|
|
418
418
|
}
|
|
419
419
|
)
|
|
420
420
|
}
|
|
421
421
|
),
|
|
422
|
-
y ===
|
|
423
|
-
|
|
422
|
+
y === R.id ? /* @__PURE__ */ e(
|
|
423
|
+
Z,
|
|
424
424
|
{
|
|
425
425
|
value: w,
|
|
426
426
|
onChange: N,
|
|
427
427
|
placeholder: n("mediaCollage.caption", "Caption"),
|
|
428
428
|
autoFocus: !0,
|
|
429
429
|
size: "sm",
|
|
430
|
-
onBlur: () => b(
|
|
431
|
-
onKeyDown: (
|
|
432
|
-
|
|
430
|
+
onBlur: () => b(R.id),
|
|
431
|
+
onKeyDown: (x) => {
|
|
432
|
+
x.key === "Enter" && b(R.id), x.key === "Escape" && M(null);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
) : /* @__PURE__ */ e(
|
|
@@ -437,51 +437,51 @@ const Ft = ({ item: a }) => {
|
|
|
437
437
|
{
|
|
438
438
|
type: "button",
|
|
439
439
|
className: "nice-media-collage__caption",
|
|
440
|
-
disabled: !c ||
|
|
440
|
+
disabled: !c || P,
|
|
441
441
|
onClick: () => {
|
|
442
|
-
M(
|
|
442
|
+
M(R.id), N(R.caption ?? "");
|
|
443
443
|
},
|
|
444
|
-
children:
|
|
444
|
+
children: R.caption || /* @__PURE__ */ e("em", { children: n("mediaCollage.addACaption", "Add a caption") })
|
|
445
445
|
}
|
|
446
446
|
),
|
|
447
447
|
/* @__PURE__ */ s("div", { className: "nice-media-collage__tile-actions", children: [
|
|
448
|
-
|
|
448
|
+
K && /* @__PURE__ */ e(
|
|
449
449
|
"span",
|
|
450
450
|
{
|
|
451
451
|
className: "nice-media-collage__grip",
|
|
452
|
-
role:
|
|
453
|
-
tabIndex:
|
|
454
|
-
"aria-grabbed":
|
|
455
|
-
"aria-label":
|
|
456
|
-
draggable:
|
|
457
|
-
onPointerDown:
|
|
458
|
-
onKeyDown:
|
|
452
|
+
role: K.role,
|
|
453
|
+
tabIndex: K.tabIndex,
|
|
454
|
+
"aria-grabbed": K["aria-grabbed"],
|
|
455
|
+
"aria-label": K["aria-label"],
|
|
456
|
+
draggable: K.draggable,
|
|
457
|
+
onPointerDown: K.onPointerDown,
|
|
458
|
+
onKeyDown: K.onKeyDown,
|
|
459
459
|
children: /* @__PURE__ */ e(Mn, { size: 14 })
|
|
460
460
|
}
|
|
461
461
|
),
|
|
462
|
-
|
|
463
|
-
|
|
462
|
+
f && !I && /* @__PURE__ */ e(
|
|
463
|
+
U,
|
|
464
464
|
{
|
|
465
465
|
size: "sm",
|
|
466
466
|
variant: "ghost",
|
|
467
467
|
ariaLabel: n("mediaCollage.removeItem", "Remove {name}").replace(
|
|
468
468
|
"{name}",
|
|
469
|
-
|
|
469
|
+
R.caption ?? n("mediaCollage.itemN", "item {n}").replace("{n}", String(j + 1))
|
|
470
470
|
),
|
|
471
471
|
disabled: g,
|
|
472
|
-
onClick: () =>
|
|
473
|
-
children: /* @__PURE__ */ e(
|
|
472
|
+
onClick: () => f(R.id),
|
|
473
|
+
children: /* @__PURE__ */ e(Re, { size: 14 })
|
|
474
474
|
}
|
|
475
475
|
)
|
|
476
476
|
] })
|
|
477
477
|
]
|
|
478
478
|
},
|
|
479
|
-
|
|
479
|
+
R.id
|
|
480
480
|
);
|
|
481
481
|
})
|
|
482
482
|
}
|
|
483
483
|
),
|
|
484
|
-
u && !
|
|
484
|
+
u && !P && t.length > 0 && /* @__PURE__ */ s("p", { className: "nice-media-collage__hint", children: [
|
|
485
485
|
/* @__PURE__ */ e(an, { size: 12 }),
|
|
486
486
|
" ",
|
|
487
487
|
n(
|
|
@@ -494,11 +494,11 @@ const Ft = ({ item: a }) => {
|
|
|
494
494
|
);
|
|
495
495
|
}
|
|
496
496
|
);
|
|
497
|
-
function
|
|
497
|
+
function Be(a) {
|
|
498
498
|
const i = a.toLowerCase();
|
|
499
499
|
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";
|
|
500
500
|
}
|
|
501
|
-
const
|
|
501
|
+
const jt = {
|
|
502
502
|
micro: [],
|
|
503
503
|
compact: ["details", "location", "budget"],
|
|
504
504
|
normal: ["details", "location", "schedule", "participants", "tasks", "surveys", "budget"],
|
|
@@ -514,112 +514,112 @@ const Wt = {
|
|
|
514
514
|
"documents",
|
|
515
515
|
"settings"
|
|
516
516
|
]
|
|
517
|
-
},
|
|
517
|
+
}, ra = /* @__PURE__ */ ie(
|
|
518
518
|
function(i, r) {
|
|
519
519
|
var gn, vn, fn, _n, yn, Nn;
|
|
520
|
-
const { t: n } =
|
|
521
|
-
event:
|
|
520
|
+
const { t: n, lang: t } = J(), {
|
|
521
|
+
event: l,
|
|
522
522
|
participants: d = [],
|
|
523
|
-
surveys:
|
|
524
|
-
billing:
|
|
525
|
-
scheduleItems:
|
|
526
|
-
tasks:
|
|
527
|
-
vendors:
|
|
528
|
-
documents:
|
|
529
|
-
displayMode:
|
|
530
|
-
tabs:
|
|
531
|
-
activeTab:
|
|
532
|
-
onTabChange:
|
|
533
|
-
tabsIconOnly:
|
|
534
|
-
tabsCentered:
|
|
535
|
-
countLocation:
|
|
536
|
-
showDetails:
|
|
537
|
-
showLocation:
|
|
538
|
-
showSchedule:
|
|
539
|
-
showParticipants:
|
|
540
|
-
showTasks:
|
|
541
|
-
showSurveys:
|
|
542
|
-
showVendors:
|
|
543
|
-
showBudget:
|
|
544
|
-
showDocuments:
|
|
523
|
+
surveys: u = [],
|
|
524
|
+
billing: f = [],
|
|
525
|
+
scheduleItems: c = [],
|
|
526
|
+
tasks: o = [],
|
|
527
|
+
vendors: m = [],
|
|
528
|
+
documents: h = [],
|
|
529
|
+
displayMode: z = "normal",
|
|
530
|
+
tabs: _,
|
|
531
|
+
activeTab: g,
|
|
532
|
+
onTabChange: I,
|
|
533
|
+
tabsIconOnly: k = !0,
|
|
534
|
+
tabsCentered: T = "auto",
|
|
535
|
+
countLocation: v = "bottom",
|
|
536
|
+
showDetails: p = !0,
|
|
537
|
+
showLocation: A = !0,
|
|
538
|
+
showSchedule: y = !0,
|
|
539
|
+
showParticipants: M = !0,
|
|
540
|
+
showTasks: w = !0,
|
|
541
|
+
showSurveys: N = !0,
|
|
542
|
+
showVendors: P = !0,
|
|
543
|
+
showBudget: E = !0,
|
|
544
|
+
showDocuments: F = !0,
|
|
545
545
|
showSettings: X = !0,
|
|
546
|
-
editable:
|
|
547
|
-
onSave:
|
|
548
|
-
onPublish:
|
|
549
|
-
onShare:
|
|
550
|
-
onExport:
|
|
551
|
-
onUpdateEvent:
|
|
552
|
-
onUpdateLocation:
|
|
553
|
-
onAddSurvey:
|
|
554
|
-
onSurveyRespond:
|
|
555
|
-
onAddBilling:
|
|
556
|
-
className:
|
|
557
|
-
style:
|
|
558
|
-
} = i, [
|
|
559
|
-
details:
|
|
560
|
-
location:
|
|
561
|
-
schedule:
|
|
562
|
-
participants:
|
|
563
|
-
tasks:
|
|
564
|
-
surveys:
|
|
565
|
-
vendors:
|
|
566
|
-
budget:
|
|
567
|
-
documents:
|
|
546
|
+
editable: L = !1,
|
|
547
|
+
onSave: G,
|
|
548
|
+
onPublish: C,
|
|
549
|
+
onShare: b,
|
|
550
|
+
onExport: R,
|
|
551
|
+
onUpdateEvent: j,
|
|
552
|
+
onUpdateLocation: K,
|
|
553
|
+
onAddSurvey: x,
|
|
554
|
+
onSurveyRespond: B,
|
|
555
|
+
onAddBilling: q,
|
|
556
|
+
className: ee,
|
|
557
|
+
style: Y
|
|
558
|
+
} = i, [ne, te] = D(l.title), [me, ve] = D(l.description ?? ""), [le, De] = D(l.startDate ?? ""), [be, Ee] = D(l.endDate ?? ""), [de, Oe] = D(((gn = l.location) == null ? void 0 : gn.name) ?? ""), [Ie, Pe] = D(((vn = l.location) == null ? void 0 : vn.address) ?? ""), [oe, fe] = D(((fn = l.location) == null ? void 0 : fn.virtualUrl) ?? ""), [pe, Qe] = D(((_n = l.location) == null ? void 0 : _n.isVirtual) ?? !1), [he, ke] = D(""), [ze, Ye] = D("single"), [_e, Ae] = D(""), [ge, Te] = D(""), [$, O] = D(""), [W, Q] = D("PLN"), ae = {
|
|
559
|
+
details: p,
|
|
560
|
+
location: A,
|
|
561
|
+
schedule: y,
|
|
562
|
+
participants: M,
|
|
563
|
+
tasks: w,
|
|
564
|
+
surveys: N,
|
|
565
|
+
vendors: P,
|
|
566
|
+
budget: E,
|
|
567
|
+
documents: F,
|
|
568
568
|
settings: X
|
|
569
|
-
},
|
|
569
|
+
}, Me = (_ ?? jt[z]).filter((S) => ae[S] !== !1), [Kn, jn] = D(Me[0] ?? "details"), Hn = g ?? Kn, Qn = H(
|
|
570
570
|
(S) => {
|
|
571
571
|
const ue = S;
|
|
572
|
-
|
|
572
|
+
g === void 0 && jn(ue), I == null || I(ue);
|
|
573
573
|
},
|
|
574
|
-
[
|
|
575
|
-
),
|
|
576
|
-
|
|
577
|
-
title:
|
|
578
|
-
description:
|
|
579
|
-
startDate:
|
|
574
|
+
[g, I]
|
|
575
|
+
), Zn = H(() => {
|
|
576
|
+
j == null || j({
|
|
577
|
+
title: ne,
|
|
578
|
+
description: me || void 0,
|
|
579
|
+
startDate: le || void 0,
|
|
580
580
|
endDate: be || void 0
|
|
581
581
|
});
|
|
582
|
-
}, [
|
|
583
|
-
|
|
584
|
-
name:
|
|
585
|
-
address:
|
|
586
|
-
virtualUrl:
|
|
587
|
-
isVirtual:
|
|
582
|
+
}, [ne, me, le, be, j]), Jn = H(() => {
|
|
583
|
+
K == null || K({
|
|
584
|
+
name: de,
|
|
585
|
+
address: Ie || void 0,
|
|
586
|
+
virtualUrl: oe || void 0,
|
|
587
|
+
isVirtual: pe
|
|
588
588
|
});
|
|
589
|
-
}, [
|
|
590
|
-
if (!
|
|
589
|
+
}, [de, Ie, oe, pe, K]), et = H(() => {
|
|
590
|
+
if (!he.trim() || !x)
|
|
591
591
|
return;
|
|
592
|
-
const S =
|
|
593
|
-
|
|
594
|
-
}, [
|
|
595
|
-
!
|
|
596
|
-
label:
|
|
597
|
-
amount: parseFloat(
|
|
598
|
-
currency:
|
|
599
|
-
}),
|
|
600
|
-
}, [
|
|
601
|
-
() =>
|
|
592
|
+
const S = _e.split(",").map((ue) => ue.trim()).filter(Boolean);
|
|
593
|
+
x(he.trim(), ze, S.length > 0 ? S : void 0), ke(""), Ae("");
|
|
594
|
+
}, [he, ze, _e, x]), nt = H(() => {
|
|
595
|
+
!ge.trim() || !q || (q({
|
|
596
|
+
label: ge.trim(),
|
|
597
|
+
amount: parseFloat($) || 0,
|
|
598
|
+
currency: W
|
|
599
|
+
}), Te(""), O(""));
|
|
600
|
+
}, [ge, $, W, q]), tt = V(
|
|
601
|
+
() => f.map((S) => ({
|
|
602
602
|
label: S.label,
|
|
603
603
|
amount: S.amount
|
|
604
604
|
})),
|
|
605
|
-
[
|
|
606
|
-
),
|
|
605
|
+
[f]
|
|
606
|
+
), it = V(() => f.reduce((S, ue) => S + ue.amount, 0), [f]), at = ((yn = f[0]) == null ? void 0 : yn.currency) ?? "PLN", st = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
607
607
|
/* @__PURE__ */ e(
|
|
608
|
-
|
|
608
|
+
Z,
|
|
609
609
|
{
|
|
610
610
|
label: n("eventPlanning.title", "Title"),
|
|
611
|
-
value:
|
|
612
|
-
onChange:
|
|
613
|
-
readOnly: !
|
|
611
|
+
value: ne,
|
|
612
|
+
onChange: te,
|
|
613
|
+
readOnly: !L
|
|
614
614
|
}
|
|
615
615
|
),
|
|
616
616
|
/* @__PURE__ */ e(
|
|
617
617
|
on,
|
|
618
618
|
{
|
|
619
619
|
label: n("eventPlanning.description", "Description"),
|
|
620
|
-
value:
|
|
621
|
-
onChange:
|
|
622
|
-
readOnly: !
|
|
620
|
+
value: me,
|
|
621
|
+
onChange: ve,
|
|
622
|
+
readOnly: !L,
|
|
623
623
|
rows: 3
|
|
624
624
|
}
|
|
625
625
|
),
|
|
@@ -631,9 +631,9 @@ const Wt = {
|
|
|
631
631
|
{
|
|
632
632
|
className: "nice-input",
|
|
633
633
|
type: "datetime-local",
|
|
634
|
-
value:
|
|
635
|
-
onChange: (S) =>
|
|
636
|
-
readOnly: !
|
|
634
|
+
value: le,
|
|
635
|
+
onChange: (S) => De(S.target.value),
|
|
636
|
+
readOnly: !L
|
|
637
637
|
}
|
|
638
638
|
)
|
|
639
639
|
] }),
|
|
@@ -646,108 +646,108 @@ const Wt = {
|
|
|
646
646
|
type: "datetime-local",
|
|
647
647
|
value: be,
|
|
648
648
|
onChange: (S) => Ee(S.target.value),
|
|
649
|
-
readOnly: !
|
|
649
|
+
readOnly: !L
|
|
650
650
|
}
|
|
651
651
|
)
|
|
652
652
|
] })
|
|
653
653
|
] }),
|
|
654
|
-
|
|
655
|
-
|
|
654
|
+
L && /* @__PURE__ */ e(
|
|
655
|
+
U,
|
|
656
656
|
{
|
|
657
657
|
variant: "primary",
|
|
658
658
|
leftIcon: /* @__PURE__ */ e(re, { name: "check", size: "sm" }),
|
|
659
|
-
onClick:
|
|
659
|
+
onClick: Zn,
|
|
660
660
|
children: n("eventPlanning.saveDetails", "Save details")
|
|
661
661
|
}
|
|
662
662
|
)
|
|
663
|
-
] }),
|
|
663
|
+
] }), rt = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
664
664
|
/* @__PURE__ */ e(
|
|
665
665
|
Ze,
|
|
666
666
|
{
|
|
667
667
|
label: n("eventPlanning.virtualEvent", "Virtual event"),
|
|
668
|
-
checked:
|
|
669
|
-
onChange:
|
|
670
|
-
disabled: !
|
|
668
|
+
checked: pe,
|
|
669
|
+
onChange: Qe,
|
|
670
|
+
disabled: !L
|
|
671
671
|
}
|
|
672
672
|
),
|
|
673
673
|
/* @__PURE__ */ e(
|
|
674
|
-
|
|
674
|
+
Z,
|
|
675
675
|
{
|
|
676
676
|
label: n("eventPlanning.venueName", "Venue name"),
|
|
677
|
-
value:
|
|
678
|
-
onChange:
|
|
679
|
-
readOnly: !
|
|
677
|
+
value: de,
|
|
678
|
+
onChange: Oe,
|
|
679
|
+
readOnly: !L
|
|
680
680
|
}
|
|
681
681
|
),
|
|
682
|
-
|
|
683
|
-
|
|
682
|
+
pe ? /* @__PURE__ */ e(
|
|
683
|
+
Z,
|
|
684
684
|
{
|
|
685
685
|
label: n("eventPlanning.virtualUrl", "Virtual URL"),
|
|
686
|
-
value:
|
|
687
|
-
onChange:
|
|
688
|
-
readOnly: !
|
|
686
|
+
value: oe,
|
|
687
|
+
onChange: fe,
|
|
688
|
+
readOnly: !L
|
|
689
689
|
}
|
|
690
690
|
) : /* @__PURE__ */ e(
|
|
691
|
-
|
|
691
|
+
Z,
|
|
692
692
|
{
|
|
693
693
|
label: n("eventPlanning.address", "Address"),
|
|
694
|
-
value:
|
|
695
|
-
onChange:
|
|
696
|
-
readOnly: !
|
|
694
|
+
value: Ie,
|
|
695
|
+
onChange: Pe,
|
|
696
|
+
readOnly: !L
|
|
697
697
|
}
|
|
698
698
|
),
|
|
699
|
-
|
|
700
|
-
|
|
699
|
+
L && /* @__PURE__ */ e(
|
|
700
|
+
U,
|
|
701
701
|
{
|
|
702
702
|
variant: "primary",
|
|
703
703
|
leftIcon: /* @__PURE__ */ e(re, { name: "check", size: "sm" }),
|
|
704
|
-
onClick:
|
|
704
|
+
onClick: Jn,
|
|
705
705
|
children: n("eventPlanning.saveLocation", "Save location")
|
|
706
706
|
}
|
|
707
707
|
)
|
|
708
|
-
] }),
|
|
709
|
-
/* @__PURE__ */ e(bn, { max: 8, children: d.map((S) => /* @__PURE__ */ e(
|
|
708
|
+
] }), ct = /* @__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(Ke, { children: [
|
|
709
|
+
/* @__PURE__ */ e(bn, { max: 8, children: d.map((S) => /* @__PURE__ */ e(Fe, { name: S.name, src: S.avatarUrl }, S.id)) }),
|
|
710
710
|
/* @__PURE__ */ e("ul", { className: "nice-event-planning__participant-list", children: d.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__participant", children: [
|
|
711
|
-
/* @__PURE__ */ e(
|
|
711
|
+
/* @__PURE__ */ e(Fe, { name: S.name, src: S.avatarUrl, size: "sm" }),
|
|
712
712
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__participant-name", children: S.name }),
|
|
713
|
-
/* @__PURE__ */ e(
|
|
713
|
+
/* @__PURE__ */ e(se, { size: "xs", subtle: !0, variant: Be(S.status), children: n(`participantList.status.${S.status}`, S.status) })
|
|
714
714
|
] }, S.id)) })
|
|
715
|
-
] }) }),
|
|
716
|
-
|
|
715
|
+
] }) }), lt = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
716
|
+
u.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noSurveysYet", "No surveys yet.") }) : u.map((S) => /* @__PURE__ */ s("div", { className: "nice-event-planning__survey", children: [
|
|
717
717
|
/* @__PURE__ */ e("strong", { children: S.question }),
|
|
718
718
|
" ",
|
|
719
|
-
/* @__PURE__ */ e(
|
|
720
|
-
S.options && /* @__PURE__ */ e("div", { className: "nice-event-planning__survey-options", children: S.options.map((ue,
|
|
721
|
-
|
|
719
|
+
/* @__PURE__ */ e(se, { size: "xs", outline: !0, variant: "info", children: n(`eventPlanning.surveyType.${S.type}`, S.type) }),
|
|
720
|
+
S.options && /* @__PURE__ */ e("div", { className: "nice-event-planning__survey-options", children: S.options.map((ue, Nt) => /* @__PURE__ */ e(
|
|
721
|
+
U,
|
|
722
722
|
{
|
|
723
723
|
size: "sm",
|
|
724
724
|
variant: "outline",
|
|
725
|
-
onClick: () =>
|
|
725
|
+
onClick: () => B == null ? void 0 : B(S.id, ue),
|
|
726
726
|
children: ue
|
|
727
727
|
},
|
|
728
|
-
|
|
728
|
+
Nt
|
|
729
729
|
)) }),
|
|
730
730
|
S.responses && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: n("eventPlanning.responses", "{responses} responses").replace(
|
|
731
731
|
"{responses}",
|
|
732
732
|
String(S.responses.length)
|
|
733
733
|
) })
|
|
734
734
|
] }, S.id)),
|
|
735
|
-
|
|
735
|
+
L && x && /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
736
736
|
/* @__PURE__ */ e(
|
|
737
|
-
|
|
737
|
+
Z,
|
|
738
738
|
{
|
|
739
739
|
label: n("eventPlanning.newSurveyQuestion", "New survey question"),
|
|
740
|
-
value:
|
|
741
|
-
onChange:
|
|
740
|
+
value: he,
|
|
741
|
+
onChange: ke,
|
|
742
742
|
placeholder: n("eventPlanning.question", "Question")
|
|
743
743
|
}
|
|
744
744
|
),
|
|
745
745
|
/* @__PURE__ */ e(
|
|
746
|
-
|
|
746
|
+
Ce,
|
|
747
747
|
{
|
|
748
748
|
label: n("eventPlanning.type", "Type"),
|
|
749
|
-
value:
|
|
750
|
-
onChange: (S) =>
|
|
749
|
+
value: ze,
|
|
750
|
+
onChange: (S) => Ye(S),
|
|
751
751
|
options: [
|
|
752
752
|
{ value: "single", label: n("eventPlanning.singleChoice", "Single choice") },
|
|
753
753
|
{ value: "multiple", label: n("eventPlanning.multipleChoice", "Multiple choice") },
|
|
@@ -757,96 +757,96 @@ const Wt = {
|
|
|
757
757
|
}
|
|
758
758
|
),
|
|
759
759
|
/* @__PURE__ */ e(
|
|
760
|
-
|
|
760
|
+
Z,
|
|
761
761
|
{
|
|
762
762
|
label: n("eventPlanning.optionsCommaSeparated", "Options (comma-separated)"),
|
|
763
|
-
value:
|
|
764
|
-
onChange:
|
|
763
|
+
value: _e,
|
|
764
|
+
onChange: Ae,
|
|
765
765
|
placeholder: n("eventPlanning.yesNoMaybe", "Yes, No, Maybe")
|
|
766
766
|
}
|
|
767
767
|
),
|
|
768
768
|
/* @__PURE__ */ e(
|
|
769
|
-
|
|
769
|
+
U,
|
|
770
770
|
{
|
|
771
771
|
variant: "primary",
|
|
772
772
|
leftIcon: /* @__PURE__ */ e(re, { name: "plus", size: "sm" }),
|
|
773
|
-
onClick:
|
|
774
|
-
disabled: !
|
|
773
|
+
onClick: et,
|
|
774
|
+
disabled: !he.trim(),
|
|
775
775
|
children: n("eventPlanning.addSurvey", "Add survey")
|
|
776
776
|
}
|
|
777
777
|
)
|
|
778
778
|
] })
|
|
779
|
-
] }),
|
|
780
|
-
|
|
781
|
-
|
|
779
|
+
] }), ot = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
780
|
+
f.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noBillingItemsYet", "No billing items yet.") }) : /* @__PURE__ */ e(
|
|
781
|
+
Dt,
|
|
782
782
|
{
|
|
783
783
|
lines: [
|
|
784
|
-
...
|
|
785
|
-
{ label: n("eventPlanning.total", "Total"), amount:
|
|
784
|
+
...tt,
|
|
785
|
+
{ label: n("eventPlanning.total", "Total"), amount: it, isSummary: !0 }
|
|
786
786
|
],
|
|
787
|
-
currency:
|
|
787
|
+
currency: at
|
|
788
788
|
}
|
|
789
789
|
),
|
|
790
|
-
|
|
790
|
+
L && q && /* @__PURE__ */ s("div", { className: "nice-event-planning__row", children: [
|
|
791
791
|
/* @__PURE__ */ e(
|
|
792
|
-
|
|
792
|
+
Z,
|
|
793
793
|
{
|
|
794
794
|
label: n("eventPlanning.item", "Item"),
|
|
795
|
-
value:
|
|
796
|
-
onChange:
|
|
795
|
+
value: ge,
|
|
796
|
+
onChange: Te,
|
|
797
797
|
placeholder: n("eventPlanning.catering", "Catering")
|
|
798
798
|
}
|
|
799
799
|
),
|
|
800
800
|
/* @__PURE__ */ e(
|
|
801
|
-
|
|
801
|
+
Z,
|
|
802
802
|
{
|
|
803
803
|
label: n("eventPlanning.amount", "Amount"),
|
|
804
|
-
value:
|
|
805
|
-
onChange:
|
|
804
|
+
value: $,
|
|
805
|
+
onChange: O,
|
|
806
806
|
placeholder: "0.00"
|
|
807
807
|
}
|
|
808
808
|
),
|
|
809
809
|
/* @__PURE__ */ e(
|
|
810
|
-
|
|
810
|
+
Ce,
|
|
811
811
|
{
|
|
812
812
|
label: n("eventPlanning.currency", "Currency"),
|
|
813
|
-
value:
|
|
814
|
-
onChange: (S) =>
|
|
813
|
+
value: W,
|
|
814
|
+
onChange: (S) => Q(S),
|
|
815
815
|
options: ["PLN", "EUR", "USD", "GBP"]
|
|
816
816
|
}
|
|
817
817
|
),
|
|
818
818
|
/* @__PURE__ */ e(
|
|
819
|
-
|
|
819
|
+
U,
|
|
820
820
|
{
|
|
821
821
|
variant: "primary",
|
|
822
822
|
leftIcon: /* @__PURE__ */ e(re, { name: "plus", size: "sm" }),
|
|
823
|
-
onClick:
|
|
824
|
-
disabled: !
|
|
823
|
+
onClick: nt,
|
|
824
|
+
disabled: !ge.trim(),
|
|
825
825
|
children: n("eventPlanning.add", "Add")
|
|
826
826
|
}
|
|
827
827
|
)
|
|
828
828
|
] })
|
|
829
|
-
] }),
|
|
829
|
+
] }), dt = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
830
830
|
/* @__PURE__ */ e(
|
|
831
831
|
Ze,
|
|
832
832
|
{
|
|
833
833
|
label: n("eventPlanning.publicEvent", "Public event"),
|
|
834
|
-
checked:
|
|
835
|
-
disabled: !
|
|
834
|
+
checked: l.isPublic ?? !1,
|
|
835
|
+
disabled: !L
|
|
836
836
|
}
|
|
837
837
|
),
|
|
838
838
|
/* @__PURE__ */ e(
|
|
839
|
-
|
|
839
|
+
Z,
|
|
840
840
|
{
|
|
841
841
|
label: n("eventPlanning.maxParticipants", "Max participants"),
|
|
842
|
-
value:
|
|
842
|
+
value: l.maxParticipants != null ? String(l.maxParticipants) : "",
|
|
843
843
|
onChange: () => {
|
|
844
844
|
},
|
|
845
|
-
readOnly: !
|
|
845
|
+
readOnly: !L
|
|
846
846
|
}
|
|
847
847
|
),
|
|
848
|
-
/* @__PURE__ */ e("div", { className: "nice-event-planning__muted", children: n("eventPlanning.hostCreated", "Host: {hostName} · Created {createdAt}").replace("{hostName}", String(
|
|
849
|
-
] }),
|
|
848
|
+
/* @__PURE__ */ e("div", { className: "nice-event-planning__muted", children: n("eventPlanning.hostCreated", "Host: {hostName} · Created {createdAt}").replace("{hostName}", String(l.hostName)).replace("{createdAt}", Vt(l.createdAt, t)) })
|
|
849
|
+
] }), ut = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: c.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: c.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__schedule-item", children: [
|
|
850
850
|
/* @__PURE__ */ s("span", { className: "nice-event-planning__schedule-time", children: [
|
|
851
851
|
/* @__PURE__ */ e(re, { name: "clock", size: "sm" }),
|
|
852
852
|
S.startTime ?? "",
|
|
@@ -854,40 +854,40 @@ const Wt = {
|
|
|
854
854
|
] }),
|
|
855
855
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__schedule-title", children: S.title }),
|
|
856
856
|
S.location && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: S.location })
|
|
857
|
-
] }, S.id)) }) }),
|
|
858
|
-
/* @__PURE__ */ e(Ze, { label: S.title, checked: S.done ?? !1, disabled: !
|
|
859
|
-
S.assigneeName && /* @__PURE__ */ e(
|
|
857
|
+
] }, S.id)) }) }), mt = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: o.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: o.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__task", children: [
|
|
858
|
+
/* @__PURE__ */ e(Ze, { label: S.title, checked: S.done ?? !1, disabled: !L }),
|
|
859
|
+
S.assigneeName && /* @__PURE__ */ e(se, { size: "xs", subtle: !0, variant: "info", children: S.assigneeName }),
|
|
860
860
|
S.dueDate && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: S.dueDate })
|
|
861
|
-
] }, S.id)) }) }),
|
|
861
|
+
] }, S.id)) }) }), pt = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: m.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: m.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__vendor", children: [
|
|
862
862
|
/* @__PURE__ */ e(re, { name: "briefcase", size: "sm" }),
|
|
863
863
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__vendor-name", children: S.name }),
|
|
864
864
|
S.category && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: S.category }),
|
|
865
|
-
S.status && /* @__PURE__ */ e(
|
|
865
|
+
S.status && /* @__PURE__ */ e(se, { size: "xs", subtle: !0, variant: Be(S.status), children: n(`eventPlanning.vendorStatus.${S.status}`, S.status) }),
|
|
866
866
|
S.cost != null && /* @__PURE__ */ s("span", { className: "nice-event-planning__vendor-cost", children: [
|
|
867
867
|
S.cost,
|
|
868
868
|
" ",
|
|
869
869
|
S.currency ?? ""
|
|
870
870
|
] })
|
|
871
|
-
] }, S.id)) }) }),
|
|
871
|
+
] }, S.id)) }) }), ht = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: h.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: h.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__document", children: [
|
|
872
872
|
/* @__PURE__ */ e(re, { name: "file", size: "sm" }),
|
|
873
873
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__document-name", children: S.name }),
|
|
874
|
-
S.fileType && /* @__PURE__ */ e(
|
|
874
|
+
S.fileType && /* @__PURE__ */ e(se, { size: "xs", outline: !0, variant: "secondary", children: S.fileType }),
|
|
875
875
|
S.sizeKb != null && /* @__PURE__ */ s("span", { className: "nice-event-planning__muted", children: [
|
|
876
876
|
S.sizeKb,
|
|
877
877
|
" KB"
|
|
878
878
|
] })
|
|
879
|
-
] }, S.id)) }) }),
|
|
880
|
-
details:
|
|
881
|
-
location:
|
|
882
|
-
schedule:
|
|
883
|
-
participants:
|
|
884
|
-
tasks:
|
|
885
|
-
surveys:
|
|
886
|
-
vendors:
|
|
887
|
-
budget:
|
|
888
|
-
documents:
|
|
889
|
-
settings:
|
|
890
|
-
},
|
|
879
|
+
] }, S.id)) }) }), gt = {
|
|
880
|
+
details: st,
|
|
881
|
+
location: rt,
|
|
882
|
+
schedule: ut,
|
|
883
|
+
participants: ct,
|
|
884
|
+
tasks: mt,
|
|
885
|
+
surveys: lt,
|
|
886
|
+
vendors: pt,
|
|
887
|
+
budget: ot,
|
|
888
|
+
documents: ht,
|
|
889
|
+
settings: dt
|
|
890
|
+
}, vt = {
|
|
891
891
|
details: "file",
|
|
892
892
|
location: "home",
|
|
893
893
|
schedule: "clock",
|
|
@@ -898,106 +898,106 @@ const Wt = {
|
|
|
898
898
|
budget: "dollar",
|
|
899
899
|
documents: "folder",
|
|
900
900
|
settings: "settings"
|
|
901
|
-
},
|
|
902
|
-
schedule:
|
|
901
|
+
}, ft = {
|
|
902
|
+
schedule: c.length || void 0,
|
|
903
903
|
participants: d.length || void 0,
|
|
904
|
-
tasks:
|
|
905
|
-
surveys:
|
|
906
|
-
vendors:
|
|
907
|
-
budget:
|
|
908
|
-
documents:
|
|
909
|
-
},
|
|
904
|
+
tasks: o.length || void 0,
|
|
905
|
+
surveys: u.length || void 0,
|
|
906
|
+
vendors: m.length || void 0,
|
|
907
|
+
budget: f.length || void 0,
|
|
908
|
+
documents: h.length || void 0
|
|
909
|
+
}, _t = Me.map((S) => ({
|
|
910
910
|
id: S,
|
|
911
911
|
label: S.charAt(0).toUpperCase() + S.slice(1),
|
|
912
|
-
icon: /* @__PURE__ */ e(re, { name:
|
|
913
|
-
badge:
|
|
914
|
-
content:
|
|
915
|
-
})),
|
|
912
|
+
icon: /* @__PURE__ */ e(re, { name: vt[S], size: "sm" }),
|
|
913
|
+
badge: ft[S],
|
|
914
|
+
content: gt[S]
|
|
915
|
+
})), yt = /* @__PURE__ */ s("div", { className: "nice-event-planning__toolbar", children: [
|
|
916
916
|
/* @__PURE__ */ s("div", { className: "nice-event-planning__toolbar-title", children: [
|
|
917
917
|
/* @__PURE__ */ e(re, { name: "calendar", size: "md" }),
|
|
918
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__title", children:
|
|
919
|
-
/* @__PURE__ */ e(
|
|
918
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__title", children: l.title }),
|
|
919
|
+
/* @__PURE__ */ e(se, { size: "sm", variant: Be(l.status), children: n(`eventPlanning.eventStatus.${l.status}`, l.status) })
|
|
920
920
|
] }),
|
|
921
921
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__toolbar-spacer" }),
|
|
922
922
|
/* @__PURE__ */ s("div", { className: "nice-event-planning__toolbar-actions", children: [
|
|
923
|
-
|
|
924
|
-
|
|
923
|
+
G && /* @__PURE__ */ e(
|
|
924
|
+
U,
|
|
925
925
|
{
|
|
926
926
|
size: "sm",
|
|
927
927
|
variant: "primary",
|
|
928
928
|
leftIcon: /* @__PURE__ */ e(re, { name: "check", size: "sm" }),
|
|
929
|
-
onClick: () =>
|
|
929
|
+
onClick: () => G({ title: ne, description: me }),
|
|
930
930
|
children: n("eventPlanning.save", "Save")
|
|
931
931
|
}
|
|
932
932
|
),
|
|
933
|
-
|
|
934
|
-
|
|
933
|
+
C && /* @__PURE__ */ e(
|
|
934
|
+
U,
|
|
935
935
|
{
|
|
936
936
|
size: "sm",
|
|
937
937
|
variant: "success",
|
|
938
938
|
leftIcon: /* @__PURE__ */ e(re, { name: "upload", size: "sm" }),
|
|
939
|
-
onClick:
|
|
939
|
+
onClick: C,
|
|
940
940
|
children: n("eventPlanning.publish", "Publish")
|
|
941
941
|
}
|
|
942
942
|
),
|
|
943
|
-
|
|
944
|
-
|
|
943
|
+
b && /* @__PURE__ */ e(
|
|
944
|
+
U,
|
|
945
945
|
{
|
|
946
946
|
size: "sm",
|
|
947
947
|
variant: "ghost",
|
|
948
948
|
leftIcon: /* @__PURE__ */ e(re, { name: "link", size: "sm" }),
|
|
949
|
-
onClick:
|
|
949
|
+
onClick: b,
|
|
950
950
|
children: n("eventPlanning.share", "Share")
|
|
951
951
|
}
|
|
952
952
|
),
|
|
953
|
-
|
|
954
|
-
|
|
953
|
+
R && /* @__PURE__ */ e(
|
|
954
|
+
U,
|
|
955
955
|
{
|
|
956
956
|
size: "sm",
|
|
957
957
|
variant: "ghost",
|
|
958
958
|
leftIcon: /* @__PURE__ */ e(re, { name: "download", size: "sm" }),
|
|
959
|
-
onClick:
|
|
959
|
+
onClick: R,
|
|
960
960
|
children: n("eventPlanning.export", "Export")
|
|
961
961
|
}
|
|
962
962
|
)
|
|
963
963
|
] })
|
|
964
964
|
] });
|
|
965
|
-
return
|
|
965
|
+
return z === "micro" ? /* @__PURE__ */ e(
|
|
966
966
|
"div",
|
|
967
967
|
{
|
|
968
968
|
ref: r,
|
|
969
|
-
className: `nice-event-planning nice-event-planning--micro ${
|
|
970
|
-
style:
|
|
969
|
+
className: `nice-event-planning nice-event-planning--micro ${ee ?? ""}`,
|
|
970
|
+
style: Y,
|
|
971
971
|
children: /* @__PURE__ */ s("div", { className: "nice-event-planning__micro", children: [
|
|
972
972
|
/* @__PURE__ */ e(re, { name: "calendar", size: "md" }),
|
|
973
973
|
/* @__PURE__ */ s("div", { className: "nice-event-planning__micro-body", children: [
|
|
974
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__title", children:
|
|
974
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__title", children: l.title }),
|
|
975
975
|
/* @__PURE__ */ s("span", { className: "nice-event-planning__muted", children: [
|
|
976
|
-
|
|
977
|
-
(Nn =
|
|
976
|
+
l.startDate ? new Date(l.startDate).toLocaleString(Ft()) : n("eventPlanning.noDate", "No date"),
|
|
977
|
+
(Nn = l.location) != null && Nn.name ? ` · ${l.location.name}` : ""
|
|
978
978
|
] })
|
|
979
979
|
] }),
|
|
980
|
-
/* @__PURE__ */ e(
|
|
981
|
-
d.length > 0 && /* @__PURE__ */ e(bn, { max: 4, size: "sm", children: d.map((S) => /* @__PURE__ */ e(
|
|
980
|
+
/* @__PURE__ */ e(se, { size: "sm", variant: Be(l.status), children: n(`eventPlanning.eventStatus.${l.status}`, l.status) }),
|
|
981
|
+
d.length > 0 && /* @__PURE__ */ e(bn, { max: 4, size: "sm", children: d.map((S) => /* @__PURE__ */ e(Fe, { name: S.name, src: S.avatarUrl, size: "sm" }, S.id)) })
|
|
982
982
|
] })
|
|
983
983
|
}
|
|
984
984
|
) : /* @__PURE__ */ s(
|
|
985
985
|
"div",
|
|
986
986
|
{
|
|
987
987
|
ref: r,
|
|
988
|
-
className: `nice-event-planning nice-event-planning--${
|
|
989
|
-
style:
|
|
988
|
+
className: `nice-event-planning nice-event-planning--${z} ${ee ?? ""}`,
|
|
989
|
+
style: Y,
|
|
990
990
|
children: [
|
|
991
|
-
|
|
991
|
+
yt,
|
|
992
992
|
/* @__PURE__ */ e(
|
|
993
|
-
|
|
993
|
+
Et,
|
|
994
994
|
{
|
|
995
|
-
tabs:
|
|
996
|
-
activeTab:
|
|
997
|
-
onChange:
|
|
998
|
-
iconOnly:
|
|
999
|
-
centered:
|
|
1000
|
-
countLocation:
|
|
995
|
+
tabs: _t,
|
|
996
|
+
activeTab: Hn,
|
|
997
|
+
onChange: Qn,
|
|
998
|
+
iconOnly: k,
|
|
999
|
+
centered: T,
|
|
1000
|
+
countLocation: v
|
|
1001
1001
|
}
|
|
1002
1002
|
)
|
|
1003
1003
|
]
|
|
@@ -1005,7 +1005,7 @@ const Wt = {
|
|
|
1005
1005
|
);
|
|
1006
1006
|
}
|
|
1007
1007
|
);
|
|
1008
|
-
function
|
|
1008
|
+
function Ht(a) {
|
|
1009
1009
|
switch (a) {
|
|
1010
1010
|
case "confirmed":
|
|
1011
1011
|
return "success";
|
|
@@ -1025,34 +1025,34 @@ const nn = ({
|
|
|
1025
1025
|
showStatus: r = !0,
|
|
1026
1026
|
meta: n,
|
|
1027
1027
|
children: t,
|
|
1028
|
-
size:
|
|
1029
|
-
className:
|
|
1028
|
+
size: l = "md",
|
|
1029
|
+
className: d
|
|
1030
1030
|
}) => {
|
|
1031
|
-
const { t: u } =
|
|
1032
|
-
return /* @__PURE__ */ s("li", { className: `nice-participant-row nice-participant-row--${
|
|
1033
|
-
/* @__PURE__ */ e(
|
|
1031
|
+
const { t: u } = J();
|
|
1032
|
+
return /* @__PURE__ */ s("li", { className: `nice-participant-row nice-participant-row--${l} ${d ?? ""}`, children: [
|
|
1033
|
+
/* @__PURE__ */ e(Fe, { name: a.name, src: a.avatarUrl, size: l }),
|
|
1034
1034
|
/* @__PURE__ */ e("span", { className: "nice-participant-row__name", children: a.name }),
|
|
1035
|
-
i && a.role && /* @__PURE__ */ e(
|
|
1036
|
-
r && a.status && /* @__PURE__ */ e(
|
|
1035
|
+
i && a.role && /* @__PURE__ */ e(se, { size: "xs", outline: !0, variant: "info", children: u(`participantList.role.${a.role}`, a.role) }),
|
|
1036
|
+
r && a.status && /* @__PURE__ */ e(se, { size: "xs", subtle: !0, variant: Ht(a.status), children: u(`participantList.status.${a.status}`, a.status) }),
|
|
1037
1037
|
n && /* @__PURE__ */ e("span", { className: "nice-participant-row__meta", children: n }),
|
|
1038
1038
|
t && /* @__PURE__ */ e("span", { className: "nice-participant-row__trailing", children: t })
|
|
1039
1039
|
] });
|
|
1040
|
-
},
|
|
1040
|
+
}, Qt = /^[^\s@,;]+@[^\s@,;]+\.[^\s@,;]{2,}$/, wn = /^.*<\s*([^<>\s]+)\s*>$/;
|
|
1041
1041
|
function Xn(a) {
|
|
1042
|
-
var
|
|
1042
|
+
var l, d;
|
|
1043
1043
|
const i = [], r = [], n = /* @__PURE__ */ new Set();
|
|
1044
1044
|
let t = 0;
|
|
1045
1045
|
if (!a)
|
|
1046
1046
|
return { valid: i, invalid: r, duplicates: t };
|
|
1047
1047
|
for (const u of a.split(/[,;\r\n\t]+/)) {
|
|
1048
|
-
const
|
|
1049
|
-
if (!
|
|
1048
|
+
const f = u.trim();
|
|
1049
|
+
if (!f)
|
|
1050
1050
|
continue;
|
|
1051
|
-
const c = ((
|
|
1052
|
-
for (const m of
|
|
1051
|
+
const c = ((d = (l = wn.exec(f)) == null ? void 0 : l[1]) == null ? void 0 : d.trim()) ?? f, o = wn.test(f) ? [c] : c.split(/\s+/);
|
|
1052
|
+
for (const m of o) {
|
|
1053
1053
|
if (!m)
|
|
1054
1054
|
continue;
|
|
1055
|
-
if (!
|
|
1055
|
+
if (!Qt.test(m)) {
|
|
1056
1056
|
r.push(m);
|
|
1057
1057
|
continue;
|
|
1058
1058
|
}
|
|
@@ -1066,49 +1066,49 @@ function Xn(a) {
|
|
|
1066
1066
|
}
|
|
1067
1067
|
return { valid: i, invalid: r, duplicates: t };
|
|
1068
1068
|
}
|
|
1069
|
-
function
|
|
1069
|
+
function Zt(a, i) {
|
|
1070
1070
|
const r = new Set(a.map((t) => t.toLowerCase())), n = [...a];
|
|
1071
1071
|
for (const t of i) {
|
|
1072
|
-
const
|
|
1073
|
-
r.has(
|
|
1072
|
+
const l = t.toLowerCase();
|
|
1073
|
+
r.has(l) || (r.add(l), n.push(t));
|
|
1074
1074
|
}
|
|
1075
1075
|
return n;
|
|
1076
1076
|
}
|
|
1077
1077
|
function qn(a = {}) {
|
|
1078
|
-
const { currentUserId: i, currentUserName: r, requireIdentity: n = !0 } = a, [t,
|
|
1078
|
+
const { currentUserId: i, currentUserName: r, requireIdentity: n = !0 } = a, [t, l] = D(""), d = !i, u = r ?? t, f = !n || u.trim().length > 0;
|
|
1079
1079
|
return {
|
|
1080
|
-
isAnonymous:
|
|
1080
|
+
isAnonymous: d,
|
|
1081
1081
|
name: u,
|
|
1082
|
-
setName:
|
|
1083
|
-
canAct:
|
|
1082
|
+
setName: l,
|
|
1083
|
+
canAct: f,
|
|
1084
1084
|
actor: { userId: i, userName: u.trim() }
|
|
1085
1085
|
};
|
|
1086
1086
|
}
|
|
1087
|
-
const
|
|
1088
|
-
{ answer: "yes", label: "Yes", variant: "success", Icon:
|
|
1087
|
+
const Jt = [
|
|
1088
|
+
{ answer: "yes", label: "Yes", variant: "success", Icon: He },
|
|
1089
1089
|
{ answer: "maybe", label: "Maybe", variant: "warning", Icon: sn },
|
|
1090
|
-
{ answer: "no", label: "No", variant: "error", Icon:
|
|
1091
|
-
], Sn = /* @__PURE__ */
|
|
1090
|
+
{ answer: "no", label: "No", variant: "error", Icon: $n }
|
|
1091
|
+
], Sn = /* @__PURE__ */ ie(
|
|
1092
1092
|
function(i, r) {
|
|
1093
|
-
const { t: n } =
|
|
1093
|
+
const { t: n } = J(), {
|
|
1094
1094
|
value: t,
|
|
1095
|
-
onRespond:
|
|
1096
|
-
allowPlusOnes:
|
|
1095
|
+
onRespond: l,
|
|
1096
|
+
allowPlusOnes: d = !1,
|
|
1097
1097
|
maxPlusOnes: u = 5,
|
|
1098
|
-
plusOnes:
|
|
1098
|
+
plusOnes: f = 0,
|
|
1099
1099
|
allowNote: c = !1,
|
|
1100
|
-
currentUserId:
|
|
1100
|
+
currentUserId: o,
|
|
1101
1101
|
currentUserName: m,
|
|
1102
1102
|
compact: h = !1,
|
|
1103
1103
|
disabled: z = !1,
|
|
1104
|
-
readOnly:
|
|
1104
|
+
readOnly: _ = !1,
|
|
1105
1105
|
size: g = "md",
|
|
1106
|
-
className:
|
|
1106
|
+
className: I,
|
|
1107
1107
|
style: k
|
|
1108
|
-
} = i, T = qn({ currentUserId:
|
|
1109
|
-
w || !
|
|
1110
|
-
answer:
|
|
1111
|
-
plusOnes:
|
|
1108
|
+
} = i, T = qn({ currentUserId: o, currentUserName: m }), [v, p] = D(f), [A, y] = D(""), M = !h && T.isAnonymous && !T.canAct, w = z || _, N = (P) => {
|
|
1109
|
+
w || !l || l({
|
|
1110
|
+
answer: P,
|
|
1111
|
+
plusOnes: d && P !== "no" ? v : void 0,
|
|
1112
1112
|
note: c && A.trim() ? A.trim() : void 0,
|
|
1113
1113
|
userId: T.actor.userId,
|
|
1114
1114
|
userName: T.actor.userName || void 0
|
|
@@ -1118,11 +1118,11 @@ const Ht = [
|
|
|
1118
1118
|
"div",
|
|
1119
1119
|
{
|
|
1120
1120
|
ref: r,
|
|
1121
|
-
className: `nice-rsvp-control nice-rsvp-control--${g}${h ? " nice-rsvp-control--compact" : ""} ${
|
|
1121
|
+
className: `nice-rsvp-control nice-rsvp-control--${g}${h ? " nice-rsvp-control--compact" : ""} ${I ?? ""}`,
|
|
1122
1122
|
style: k,
|
|
1123
1123
|
children: [
|
|
1124
1124
|
!h && T.isAnonymous && /* @__PURE__ */ e(
|
|
1125
|
-
|
|
1125
|
+
Z,
|
|
1126
1126
|
{
|
|
1127
1127
|
label: n("rsvpControl.yourName", "Your name"),
|
|
1128
1128
|
value: T.name,
|
|
@@ -1139,28 +1139,28 @@ const Ht = [
|
|
|
1139
1139
|
className: "nice-rsvp-control__answers",
|
|
1140
1140
|
role: "group",
|
|
1141
1141
|
"aria-label": n("rsvpControl.yourReply", "Your reply"),
|
|
1142
|
-
children:
|
|
1143
|
-
|
|
1142
|
+
children: Jt.map(({ answer: P, label: E, variant: F, Icon: X }) => /* @__PURE__ */ e(
|
|
1143
|
+
U,
|
|
1144
1144
|
{
|
|
1145
1145
|
size: g,
|
|
1146
|
-
variant: t ===
|
|
1147
|
-
leftIcon: /* @__PURE__ */ e(
|
|
1146
|
+
variant: t === P ? F : "outline",
|
|
1147
|
+
leftIcon: /* @__PURE__ */ e(X, { size: 16 }),
|
|
1148
1148
|
disabled: w || M,
|
|
1149
|
-
"aria-pressed": t ===
|
|
1150
|
-
onClick: () => N(
|
|
1151
|
-
children: n(`rsvpControl.answer.${
|
|
1149
|
+
"aria-pressed": t === P,
|
|
1150
|
+
onClick: () => N(P),
|
|
1151
|
+
children: n(`rsvpControl.answer.${P}`, E)
|
|
1152
1152
|
},
|
|
1153
|
-
|
|
1153
|
+
P
|
|
1154
1154
|
))
|
|
1155
1155
|
}
|
|
1156
1156
|
),
|
|
1157
|
-
!h &&
|
|
1157
|
+
!h && d && t !== "no" && /* @__PURE__ */ s("label", { className: "nice-rsvp-control__field", children: [
|
|
1158
1158
|
/* @__PURE__ */ e("span", { className: "nice-rsvp-control__field-label", children: n("rsvpControl.additionalGuests", "Additional guests") }),
|
|
1159
1159
|
/* @__PURE__ */ e(
|
|
1160
1160
|
dn,
|
|
1161
1161
|
{
|
|
1162
|
-
value:
|
|
1163
|
-
onChange: (
|
|
1162
|
+
value: v,
|
|
1163
|
+
onChange: (P) => p(Math.max(0, Math.min(u, P ?? 0))),
|
|
1164
1164
|
min: 0,
|
|
1165
1165
|
max: u,
|
|
1166
1166
|
step: 1,
|
|
@@ -1170,7 +1170,7 @@ const Ht = [
|
|
|
1170
1170
|
)
|
|
1171
1171
|
] }),
|
|
1172
1172
|
!h && c && /* @__PURE__ */ e(
|
|
1173
|
-
|
|
1173
|
+
Z,
|
|
1174
1174
|
{
|
|
1175
1175
|
label: n("rsvpControl.note", "Note"),
|
|
1176
1176
|
value: A,
|
|
@@ -1185,7 +1185,7 @@ const Ht = [
|
|
|
1185
1185
|
}
|
|
1186
1186
|
);
|
|
1187
1187
|
}
|
|
1188
|
-
),
|
|
1188
|
+
), ei = {
|
|
1189
1189
|
yes: "confirmed",
|
|
1190
1190
|
maybe: "invited",
|
|
1191
1191
|
no: "declined"
|
|
@@ -1193,79 +1193,79 @@ const Ht = [
|
|
|
1193
1193
|
confirmed: "yes",
|
|
1194
1194
|
"checked-in": "yes",
|
|
1195
1195
|
declined: "no"
|
|
1196
|
-
},
|
|
1196
|
+
}, Ue = [
|
|
1197
1197
|
"confirmed",
|
|
1198
1198
|
"checked-in",
|
|
1199
1199
|
"invited",
|
|
1200
1200
|
"declined",
|
|
1201
1201
|
"no-show"
|
|
1202
|
-
],
|
|
1203
|
-
const { t: n } =
|
|
1204
|
-
participants: t =
|
|
1205
|
-
mode:
|
|
1206
|
-
currentUserId:
|
|
1202
|
+
], ni = [], ca = /* @__PURE__ */ ie(function(i, r) {
|
|
1203
|
+
const { t: n } = J(), {
|
|
1204
|
+
participants: t = ni,
|
|
1205
|
+
mode: l = "organizer",
|
|
1206
|
+
currentUserId: d,
|
|
1207
1207
|
currentUserName: u,
|
|
1208
|
-
onRsvpChange:
|
|
1208
|
+
onRsvpChange: f,
|
|
1209
1209
|
onCheckIn: c,
|
|
1210
|
-
onScan:
|
|
1210
|
+
onScan: o,
|
|
1211
1211
|
checkInSlot: m,
|
|
1212
1212
|
onInvite: h,
|
|
1213
1213
|
extraFields: z,
|
|
1214
|
-
groupBy:
|
|
1214
|
+
groupBy: _ = "none",
|
|
1215
1215
|
showSummary: g = !0,
|
|
1216
|
-
showSearch:
|
|
1216
|
+
showSearch: I = !0,
|
|
1217
1217
|
allowPlusOnes: k = !1,
|
|
1218
1218
|
disabled: T = !1,
|
|
1219
|
-
readOnly:
|
|
1219
|
+
readOnly: v = !1,
|
|
1220
1220
|
size: p = "md",
|
|
1221
1221
|
className: A,
|
|
1222
1222
|
style: y
|
|
1223
|
-
} = i, [M, w] = D(""), [N,
|
|
1224
|
-
const
|
|
1225
|
-
for (const
|
|
1226
|
-
|
|
1227
|
-
for (const
|
|
1228
|
-
|
|
1229
|
-
return
|
|
1230
|
-
}, [t]), C =
|
|
1231
|
-
if (
|
|
1232
|
-
return t.filter((
|
|
1233
|
-
const
|
|
1234
|
-
return t.filter((
|
|
1235
|
-
}, [t,
|
|
1236
|
-
if (
|
|
1223
|
+
} = i, [M, w] = D(""), [N, P] = D("all"), [E, F] = D(""), X = T || v, L = l === "guest", G = V(() => {
|
|
1224
|
+
const x = { total: t.length };
|
|
1225
|
+
for (const B of Ue)
|
|
1226
|
+
x[B] = 0;
|
|
1227
|
+
for (const B of t)
|
|
1228
|
+
x[B.status] = (x[B.status] ?? 0) + 1;
|
|
1229
|
+
return x;
|
|
1230
|
+
}, [t]), C = V(() => {
|
|
1231
|
+
if (L)
|
|
1232
|
+
return t.filter((B) => B.userId === d || B.id === d);
|
|
1233
|
+
const x = M.trim().toLowerCase();
|
|
1234
|
+
return t.filter((B) => N !== "all" && B.status !== N ? !1 : !x || B.name.toLowerCase().includes(x));
|
|
1235
|
+
}, [t, L, d, M, N]), b = V(() => {
|
|
1236
|
+
if (_ === "none" || L)
|
|
1237
1237
|
return [{ key: "all", label: "", items: C }];
|
|
1238
|
-
const
|
|
1239
|
-
for (const
|
|
1240
|
-
const
|
|
1241
|
-
|
|
1238
|
+
const x = /* @__PURE__ */ new Map();
|
|
1239
|
+
for (const q of C) {
|
|
1240
|
+
const ee = _ === "status" ? q.status : q.role, Y = x.get(ee);
|
|
1241
|
+
Y ? Y.push(q) : x.set(ee, [q]);
|
|
1242
1242
|
}
|
|
1243
|
-
return [...
|
|
1244
|
-
}, [C,
|
|
1245
|
-
|
|
1246
|
-
},
|
|
1247
|
-
!h ||
|
|
1243
|
+
return [...x.keys()].sort((q, ee) => _ !== "status" ? q.localeCompare(ee) : Ue.indexOf(q) - Ue.indexOf(ee)).map((q) => ({ key: q, label: q, items: x.get(q) ?? [] }));
|
|
1244
|
+
}, [C, _, L]), R = V(() => Xn(E), [E]), j = (x) => (B) => {
|
|
1245
|
+
f == null || f(x, ei[B.answer], B);
|
|
1246
|
+
}, K = () => {
|
|
1247
|
+
!h || R.valid.length === 0 || (h(R.valid), F(""));
|
|
1248
1248
|
};
|
|
1249
|
-
if (
|
|
1250
|
-
const
|
|
1251
|
-
return
|
|
1249
|
+
if (L) {
|
|
1250
|
+
const x = C[0];
|
|
1251
|
+
return x ? /* @__PURE__ */ s(
|
|
1252
1252
|
"div",
|
|
1253
1253
|
{
|
|
1254
1254
|
ref: r,
|
|
1255
1255
|
className: `nice-participant-list nice-participant-list--guest ${A ?? ""}`,
|
|
1256
1256
|
style: y,
|
|
1257
1257
|
children: [
|
|
1258
|
-
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: /* @__PURE__ */ e(nn, { participant:
|
|
1258
|
+
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: /* @__PURE__ */ e(nn, { participant: x, size: p }) }),
|
|
1259
1259
|
/* @__PURE__ */ e(
|
|
1260
1260
|
Sn,
|
|
1261
1261
|
{
|
|
1262
|
-
value: Cn[
|
|
1263
|
-
onRespond: j(
|
|
1262
|
+
value: Cn[x.status],
|
|
1263
|
+
onRespond: j(x.id),
|
|
1264
1264
|
allowPlusOnes: k,
|
|
1265
|
-
currentUserId:
|
|
1266
|
-
currentUserName: u ??
|
|
1265
|
+
currentUserId: d ?? x.userId,
|
|
1266
|
+
currentUserName: u ?? x.name,
|
|
1267
1267
|
disabled: T,
|
|
1268
|
-
readOnly:
|
|
1268
|
+
readOnly: v,
|
|
1269
1269
|
size: p
|
|
1270
1270
|
}
|
|
1271
1271
|
)
|
|
@@ -1285,62 +1285,62 @@ const Ht = [
|
|
|
1285
1285
|
return /* @__PURE__ */ s("div", { ref: r, className: `nice-participant-list ${A ?? ""}`, style: y, children: [
|
|
1286
1286
|
g && /* @__PURE__ */ s("div", { className: "nice-participant-list__summary", children: [
|
|
1287
1287
|
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat", children: [
|
|
1288
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1288
|
+
/* @__PURE__ */ e("strong", { children: G.confirmed }),
|
|
1289
1289
|
" ",
|
|
1290
1290
|
n("participantList.confirmed", "confirmed")
|
|
1291
1291
|
] }),
|
|
1292
1292
|
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat", children: [
|
|
1293
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1293
|
+
/* @__PURE__ */ e("strong", { children: G.invited }),
|
|
1294
1294
|
" ",
|
|
1295
1295
|
n("participantList.awaitingReply", "awaiting reply")
|
|
1296
1296
|
] }),
|
|
1297
1297
|
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat", children: [
|
|
1298
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1298
|
+
/* @__PURE__ */ e("strong", { children: G.declined }),
|
|
1299
1299
|
" ",
|
|
1300
1300
|
n("participantList.declined", "declined")
|
|
1301
1301
|
] }),
|
|
1302
1302
|
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat", children: [
|
|
1303
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1303
|
+
/* @__PURE__ */ e("strong", { children: G["checked-in"] }),
|
|
1304
1304
|
" ",
|
|
1305
1305
|
n("participantList.checkedIn", "checked in")
|
|
1306
1306
|
] }),
|
|
1307
1307
|
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat nice-participant-list__stat--total", children: [
|
|
1308
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1308
|
+
/* @__PURE__ */ e("strong", { children: G.total }),
|
|
1309
1309
|
" ",
|
|
1310
1310
|
n("participantList.total", "total")
|
|
1311
1311
|
] })
|
|
1312
1312
|
] }),
|
|
1313
|
-
(
|
|
1314
|
-
|
|
1313
|
+
(I || m || o) && /* @__PURE__ */ s("div", { className: "nice-participant-list__toolbar", children: [
|
|
1314
|
+
I && /* @__PURE__ */ s(Ke, { children: [
|
|
1315
1315
|
/* @__PURE__ */ e(
|
|
1316
|
-
|
|
1316
|
+
Z,
|
|
1317
1317
|
{
|
|
1318
1318
|
value: M,
|
|
1319
1319
|
onChange: w,
|
|
1320
1320
|
placeholder: n("participantList.searchGuests", "Search guests…"),
|
|
1321
|
-
prefix: /* @__PURE__ */ e(
|
|
1321
|
+
prefix: /* @__PURE__ */ e(kt, { size: 15 }),
|
|
1322
1322
|
size: p
|
|
1323
1323
|
}
|
|
1324
1324
|
),
|
|
1325
1325
|
/* @__PURE__ */ e(
|
|
1326
|
-
|
|
1326
|
+
Ce,
|
|
1327
1327
|
{
|
|
1328
1328
|
value: N,
|
|
1329
|
-
onChange: (
|
|
1329
|
+
onChange: (x) => P(x),
|
|
1330
1330
|
size: p,
|
|
1331
1331
|
options: [
|
|
1332
1332
|
{ value: "all", label: n("participantList.allStatuses", "All statuses") },
|
|
1333
|
-
...
|
|
1334
|
-
value:
|
|
1335
|
-
label: n(`participantList.status.${
|
|
1333
|
+
...Ue.map((x) => ({
|
|
1334
|
+
value: x,
|
|
1335
|
+
label: n(`participantList.status.${x}`, x)
|
|
1336
1336
|
}))
|
|
1337
1337
|
]
|
|
1338
1338
|
}
|
|
1339
1339
|
)
|
|
1340
1340
|
] }),
|
|
1341
1341
|
m,
|
|
1342
|
-
|
|
1343
|
-
/* @__PURE__ */ e(
|
|
1342
|
+
o && !m && /* @__PURE__ */ s("span", { className: "nice-participant-list__scan-hint", children: [
|
|
1343
|
+
/* @__PURE__ */ e(wt, { size: 15 }),
|
|
1344
1344
|
" ",
|
|
1345
1345
|
n("participantList.scannerReady", "Scanner ready")
|
|
1346
1346
|
] })
|
|
@@ -1351,60 +1351,60 @@ const Ht = [
|
|
|
1351
1351
|
title: n("participantList.noGuestsYet", "No guests yet"),
|
|
1352
1352
|
description: t.length > 0 ? n("participantList.noMatch", "No one matches the current filter.") : n("participantList.invitePeopleHint", "Invite people to see them here.")
|
|
1353
1353
|
}
|
|
1354
|
-
) : b.map((
|
|
1355
|
-
|
|
1356
|
-
|
|
1354
|
+
) : b.map((x) => /* @__PURE__ */ s("section", { className: "nice-participant-list__group", children: [
|
|
1355
|
+
x.label && /* @__PURE__ */ s("h4", { className: "nice-participant-list__group-title", children: [
|
|
1356
|
+
x.label,
|
|
1357
1357
|
" ",
|
|
1358
1358
|
/* @__PURE__ */ s("span", { children: [
|
|
1359
1359
|
"(",
|
|
1360
|
-
|
|
1360
|
+
x.items.length,
|
|
1361
1361
|
")"
|
|
1362
1362
|
] })
|
|
1363
1363
|
] }),
|
|
1364
|
-
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children:
|
|
1364
|
+
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: x.items.map((B) => /* @__PURE__ */ s(
|
|
1365
1365
|
nn,
|
|
1366
1366
|
{
|
|
1367
|
-
participant:
|
|
1367
|
+
participant: B,
|
|
1368
1368
|
size: p,
|
|
1369
|
-
meta: z == null ? void 0 : z.map((
|
|
1370
|
-
|
|
1371
|
-
) },
|
|
1369
|
+
meta: z == null ? void 0 : z.map((q) => /* @__PURE__ */ e("span", { className: "nice-participant-list__extra", children: q.render ? q.render(B) : String(
|
|
1370
|
+
B[q.key] ?? ""
|
|
1371
|
+
) }, q.key)),
|
|
1372
1372
|
children: [
|
|
1373
|
-
|
|
1373
|
+
f && /* @__PURE__ */ e(
|
|
1374
1374
|
Sn,
|
|
1375
1375
|
{
|
|
1376
1376
|
compact: !0,
|
|
1377
|
-
value: Cn[
|
|
1378
|
-
onRespond: j(
|
|
1379
|
-
currentUserId:
|
|
1380
|
-
currentUserName:
|
|
1381
|
-
disabled:
|
|
1377
|
+
value: Cn[B.status],
|
|
1378
|
+
onRespond: j(B.id),
|
|
1379
|
+
currentUserId: B.userId,
|
|
1380
|
+
currentUserName: B.name,
|
|
1381
|
+
disabled: X,
|
|
1382
1382
|
size: "sm"
|
|
1383
1383
|
}
|
|
1384
1384
|
),
|
|
1385
|
-
c &&
|
|
1386
|
-
|
|
1385
|
+
c && B.status !== "checked-in" && /* @__PURE__ */ e(
|
|
1386
|
+
U,
|
|
1387
1387
|
{
|
|
1388
1388
|
size: "sm",
|
|
1389
1389
|
variant: "outline",
|
|
1390
|
-
leftIcon: /* @__PURE__ */ e(
|
|
1391
|
-
disabled:
|
|
1392
|
-
onClick: () => c(
|
|
1390
|
+
leftIcon: /* @__PURE__ */ e(He, { size: 14 }),
|
|
1391
|
+
disabled: X,
|
|
1392
|
+
onClick: () => c(B.id),
|
|
1393
1393
|
children: n("participantList.checkIn", "Check in")
|
|
1394
1394
|
}
|
|
1395
1395
|
)
|
|
1396
1396
|
]
|
|
1397
1397
|
},
|
|
1398
|
-
|
|
1398
|
+
B.id
|
|
1399
1399
|
)) })
|
|
1400
|
-
] },
|
|
1401
|
-
h && !
|
|
1400
|
+
] }, x.key)),
|
|
1401
|
+
h && !v && /* @__PURE__ */ s("div", { className: "nice-participant-list__invite", children: [
|
|
1402
1402
|
/* @__PURE__ */ e(
|
|
1403
1403
|
on,
|
|
1404
1404
|
{
|
|
1405
1405
|
label: n("participantList.inviteByEmail", "Invite by email"),
|
|
1406
|
-
value:
|
|
1407
|
-
onChange:
|
|
1406
|
+
value: E,
|
|
1407
|
+
onChange: F,
|
|
1408
1408
|
placeholder: n(
|
|
1409
1409
|
"participantList.pasteAddressesCommasSemicolonsOr",
|
|
1410
1410
|
"Paste addresses — commas, semicolons or new lines"
|
|
@@ -1415,32 +1415,32 @@ const Ht = [
|
|
|
1415
1415
|
}
|
|
1416
1416
|
),
|
|
1417
1417
|
/* @__PURE__ */ e(
|
|
1418
|
-
|
|
1418
|
+
U,
|
|
1419
1419
|
{
|
|
1420
1420
|
variant: "primary",
|
|
1421
1421
|
size: p,
|
|
1422
1422
|
leftIcon: /* @__PURE__ */ e(Rn, { size: 15 }),
|
|
1423
|
-
disabled: T ||
|
|
1424
|
-
onClick:
|
|
1423
|
+
disabled: T || R.valid.length === 0,
|
|
1424
|
+
onClick: K,
|
|
1425
1425
|
children: n("participantList.invite", "Invite {valid}").replace(
|
|
1426
1426
|
"{valid}",
|
|
1427
|
-
|
|
1427
|
+
R.valid.length > 0 ? `(${R.valid.length})` : ""
|
|
1428
1428
|
)
|
|
1429
1429
|
}
|
|
1430
1430
|
),
|
|
1431
|
-
(
|
|
1432
|
-
|
|
1431
|
+
(R.invalid.length > 0 || R.duplicates > 0) && /* @__PURE__ */ s("p", { className: "nice-participant-list__invite-hint", children: [
|
|
1432
|
+
R.duplicates > 0 && `${n("participantList.duplicatesRemoved", "{count} duplicate(s) removed.").replace(
|
|
1433
1433
|
"{count}",
|
|
1434
|
-
String(
|
|
1434
|
+
String(R.duplicates)
|
|
1435
1435
|
)} `,
|
|
1436
|
-
|
|
1436
|
+
R.invalid.length > 0 && n("participantList.notRecognised", "{count} entry(ies) not recognised.").replace(
|
|
1437
1437
|
"{count}",
|
|
1438
|
-
String(
|
|
1438
|
+
String(R.invalid.length)
|
|
1439
1439
|
)
|
|
1440
1440
|
] })
|
|
1441
1441
|
] })
|
|
1442
1442
|
] });
|
|
1443
|
-
}),
|
|
1443
|
+
}), ti = {
|
|
1444
1444
|
// No minor unit at all.
|
|
1445
1445
|
BIF: 0,
|
|
1446
1446
|
CLP: 0,
|
|
@@ -1469,17 +1469,17 @@ const Ht = [
|
|
|
1469
1469
|
TND: 3
|
|
1470
1470
|
};
|
|
1471
1471
|
function mn(a) {
|
|
1472
|
-
return
|
|
1472
|
+
return ti[a == null ? void 0 : a.toUpperCase()] ?? 2;
|
|
1473
1473
|
}
|
|
1474
1474
|
function pn(a, i) {
|
|
1475
1475
|
return Number.isFinite(a) ? Math.round(a * 10 ** mn(i)) : 0;
|
|
1476
1476
|
}
|
|
1477
|
-
function
|
|
1477
|
+
function We(a, i) {
|
|
1478
1478
|
const r = mn(i);
|
|
1479
1479
|
return r === 0 ? a : a / 10 ** r;
|
|
1480
1480
|
}
|
|
1481
|
-
function
|
|
1482
|
-
const n = mn(i), t =
|
|
1481
|
+
function ii(a, i, r) {
|
|
1482
|
+
const n = mn(i), t = We(a, i);
|
|
1483
1483
|
try {
|
|
1484
1484
|
return new Intl.NumberFormat(r, {
|
|
1485
1485
|
style: "currency",
|
|
@@ -1492,16 +1492,16 @@ function ei(a, i, r) {
|
|
|
1492
1492
|
}
|
|
1493
1493
|
}
|
|
1494
1494
|
function ce(a, i, r) {
|
|
1495
|
-
return
|
|
1495
|
+
return ii(pn(a, i), i, r);
|
|
1496
1496
|
}
|
|
1497
1497
|
const tn = { minX: 0, minY: 0, maxX: 0, maxY: 0 };
|
|
1498
|
-
function
|
|
1498
|
+
function ai(a, i = 0) {
|
|
1499
1499
|
if (a.length === 0)
|
|
1500
1500
|
return { ...tn };
|
|
1501
|
-
let r = 1 / 0, n = 1 / 0, t = -1 / 0,
|
|
1502
|
-
for (const
|
|
1503
|
-
|
|
1504
|
-
return { minX: r - i, minY: n - i, maxX: t + i, maxY:
|
|
1501
|
+
let r = 1 / 0, n = 1 / 0, t = -1 / 0, l = -1 / 0;
|
|
1502
|
+
for (const d of a)
|
|
1503
|
+
d.x < r && (r = d.x), d.y < n && (n = d.y), d.x > t && (t = d.x), d.y > l && (l = d.y);
|
|
1504
|
+
return { minX: r - i, minY: n - i, maxX: t + i, maxY: l + i };
|
|
1505
1505
|
}
|
|
1506
1506
|
function xn(a, i) {
|
|
1507
1507
|
return {
|
|
@@ -1514,64 +1514,64 @@ function xn(a, i) {
|
|
|
1514
1514
|
function In(a, i) {
|
|
1515
1515
|
return a.minX <= i.maxX && a.maxX >= i.minX && a.minY <= i.maxY && a.maxY >= i.minY;
|
|
1516
1516
|
}
|
|
1517
|
-
function
|
|
1518
|
-
const n = a.zoom || 1, t = -a.pan.x / n - r,
|
|
1517
|
+
function si(a, i, r = 0) {
|
|
1518
|
+
const n = a.zoom || 1, t = -a.pan.x / n - r, l = -a.pan.y / n - r;
|
|
1519
1519
|
return {
|
|
1520
1520
|
minX: t,
|
|
1521
|
-
minY:
|
|
1521
|
+
minY: l,
|
|
1522
1522
|
maxX: t + i.width / n + r * 2,
|
|
1523
|
-
maxY:
|
|
1523
|
+
maxY: l + i.height / n + r * 2
|
|
1524
1524
|
};
|
|
1525
1525
|
}
|
|
1526
|
-
function
|
|
1527
|
-
const r = [], n = [], t = /* @__PURE__ */ new Map(),
|
|
1528
|
-
let
|
|
1529
|
-
for (const
|
|
1530
|
-
let c = null,
|
|
1531
|
-
(
|
|
1532
|
-
const
|
|
1533
|
-
if (
|
|
1526
|
+
function ri(a, i = 12) {
|
|
1527
|
+
const r = [], n = [], t = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
1528
|
+
let d = null, u = 0;
|
|
1529
|
+
for (const f of a.sections ?? []) {
|
|
1530
|
+
let c = null, o = 0;
|
|
1531
|
+
(f.rows ?? []).forEach((h, z) => {
|
|
1532
|
+
const _ = ci(h.seats ?? []);
|
|
1533
|
+
if (_.length === 0)
|
|
1534
1534
|
return;
|
|
1535
|
-
const g =
|
|
1536
|
-
n.push({ sectionId:
|
|
1537
|
-
t.set(
|
|
1538
|
-
}),
|
|
1535
|
+
const g = ai(_, i);
|
|
1536
|
+
n.push({ sectionId: f.id, rowIndex: z, label: h.label, seats: _, bounds: g }), _.forEach((I, k) => {
|
|
1537
|
+
t.set(I.id, I), l.set(I.id, { sectionId: f.id, rowIndex: z, seatIndex: k });
|
|
1538
|
+
}), o += _.length, c = c ? xn(c, g) : g;
|
|
1539
1539
|
});
|
|
1540
1540
|
const m = c ?? { ...tn };
|
|
1541
|
-
r.push({ section:
|
|
1541
|
+
r.push({ section: f, bounds: m, seatCount: o }), u += o, o > 0 && (d = d ? xn(d, m) : m);
|
|
1542
1542
|
}
|
|
1543
1543
|
return {
|
|
1544
1544
|
sections: r,
|
|
1545
1545
|
rows: n,
|
|
1546
|
-
bounds:
|
|
1546
|
+
bounds: d ?? { ...tn },
|
|
1547
1547
|
totalSeats: u,
|
|
1548
1548
|
seatById: t,
|
|
1549
|
-
locationById:
|
|
1549
|
+
locationById: l
|
|
1550
1550
|
};
|
|
1551
1551
|
}
|
|
1552
|
-
function
|
|
1552
|
+
function ci(a) {
|
|
1553
1553
|
return [...a].sort((i, r) => i.number - r.number || i.x - r.x);
|
|
1554
1554
|
}
|
|
1555
|
-
function
|
|
1555
|
+
function li(a, i) {
|
|
1556
1556
|
return a > i * 4 ? "section" : a > i ? "row" : "seat";
|
|
1557
1557
|
}
|
|
1558
|
-
function
|
|
1559
|
-
const t = a.sections.filter((
|
|
1560
|
-
(
|
|
1558
|
+
function oi(a, i, r = 2500, n) {
|
|
1559
|
+
const t = a.sections.filter((o) => In(o.bounds, i)), l = new Set(t.map((o) => o.section.id)), d = a.rows.filter(
|
|
1560
|
+
(o) => l.has(o.sectionId) && In(o.bounds, i)
|
|
1561
1561
|
);
|
|
1562
1562
|
let u = 0;
|
|
1563
|
-
for (const
|
|
1564
|
-
for (const m of
|
|
1563
|
+
for (const o of d)
|
|
1564
|
+
for (const m of o.seats)
|
|
1565
1565
|
m.x >= i.minX && m.x <= i.maxX && m.y >= i.minY && m.y <= i.maxY && (u += 1);
|
|
1566
|
-
const
|
|
1566
|
+
const f = n ?? li(u, r);
|
|
1567
1567
|
let c = [];
|
|
1568
|
-
if (
|
|
1568
|
+
if (f === "seat") {
|
|
1569
1569
|
c = [];
|
|
1570
|
-
for (const
|
|
1571
|
-
for (const m of
|
|
1570
|
+
for (const o of d)
|
|
1571
|
+
for (const m of o.seats)
|
|
1572
1572
|
m.x >= i.minX && m.x <= i.maxX && m.y >= i.minY && m.y <= i.maxY && c.push(m);
|
|
1573
1573
|
}
|
|
1574
|
-
return { tier:
|
|
1574
|
+
return { tier: f, sections: t, rows: f === "section" ? [] : d, seats: c, visibleSeatCount: u };
|
|
1575
1575
|
}
|
|
1576
1576
|
function hn(a) {
|
|
1577
1577
|
if (a.accessType)
|
|
@@ -1579,158 +1579,158 @@ function hn(a) {
|
|
|
1579
1579
|
if (a.status === "wheelchair" || a.status === "companion")
|
|
1580
1580
|
return a.status;
|
|
1581
1581
|
}
|
|
1582
|
-
function
|
|
1582
|
+
function xe(a, i) {
|
|
1583
1583
|
const r = (i == null ? void 0 : i[a.id]) ?? a.status;
|
|
1584
1584
|
return r === "wheelchair" || r === "companion" ? "available" : r;
|
|
1585
1585
|
}
|
|
1586
1586
|
function Pn(a, i, r) {
|
|
1587
1587
|
var t;
|
|
1588
|
-
const n = (t = i.priceCategories) == null ? void 0 : t.find((
|
|
1588
|
+
const n = (t = i.priceCategories) == null ? void 0 : t.find((l) => l.id === a.priceCategoryId);
|
|
1589
1589
|
return {
|
|
1590
1590
|
amount: (n == null ? void 0 : n.price) ?? r.basePrice,
|
|
1591
1591
|
currency: r.currency
|
|
1592
1592
|
};
|
|
1593
1593
|
}
|
|
1594
|
-
function
|
|
1595
|
-
return !(
|
|
1594
|
+
function di(a, i = {}, r) {
|
|
1595
|
+
return !(xe(a, r) !== "available" || i.allowedCategories && !i.allowedCategories.includes(a.priceCategoryId));
|
|
1596
1596
|
}
|
|
1597
1597
|
function Wn(a, i = {}, r) {
|
|
1598
1598
|
const n = [];
|
|
1599
1599
|
let t = null;
|
|
1600
|
-
return a.forEach((
|
|
1601
|
-
|
|
1600
|
+
return a.forEach((l, d) => {
|
|
1601
|
+
di(l, i, r) ? t ? t.seats.push(l) : t = { start: d, seats: [l] } : t && (n.push(t), t = null);
|
|
1602
1602
|
}), t && n.push(t), n;
|
|
1603
1603
|
}
|
|
1604
|
-
function
|
|
1604
|
+
function ui(a, i, r = {}, n) {
|
|
1605
1605
|
const t = r.maxSeats ?? 8;
|
|
1606
1606
|
if (a.length > t)
|
|
1607
1607
|
return { ok: !1, reason: "max-seats" };
|
|
1608
|
-
for (const
|
|
1609
|
-
const u = i.seatById.get(
|
|
1608
|
+
for (const d of a) {
|
|
1609
|
+
const u = i.seatById.get(d);
|
|
1610
1610
|
if (u) {
|
|
1611
|
-
if (
|
|
1612
|
-
return { ok: !1, reason: "unavailable", seatId:
|
|
1611
|
+
if (xe(u, n) !== "available")
|
|
1612
|
+
return { ok: !1, reason: "unavailable", seatId: d };
|
|
1613
1613
|
if (r.allowedCategories && !r.allowedCategories.includes(u.priceCategoryId))
|
|
1614
|
-
return { ok: !1, reason: "category-not-allowed", seatId:
|
|
1614
|
+
return { ok: !1, reason: "category-not-allowed", seatId: d };
|
|
1615
1615
|
}
|
|
1616
1616
|
}
|
|
1617
1617
|
if (!r.adjacentOnly || a.length === 0)
|
|
1618
1618
|
return { ok: !0 };
|
|
1619
|
-
const
|
|
1620
|
-
for (const
|
|
1621
|
-
const u = i.locationById.get(
|
|
1619
|
+
const l = /* @__PURE__ */ new Map();
|
|
1620
|
+
for (const d of a) {
|
|
1621
|
+
const u = i.locationById.get(d);
|
|
1622
1622
|
if (!u)
|
|
1623
1623
|
continue;
|
|
1624
|
-
const
|
|
1625
|
-
c ? c.push(
|
|
1624
|
+
const f = `${u.sectionId}::${u.rowIndex}`, c = l.get(f);
|
|
1625
|
+
c ? c.push(d) : l.set(f, [d]);
|
|
1626
1626
|
}
|
|
1627
|
-
for (const [
|
|
1628
|
-
const [
|
|
1627
|
+
for (const [d, u] of l) {
|
|
1628
|
+
const [f, c] = d.split("::"), o = Number(c), m = i.rows.find((v) => v.sectionId === f && v.rowIndex === o);
|
|
1629
1629
|
if (!m)
|
|
1630
1630
|
continue;
|
|
1631
1631
|
const h = Wn(m.seats, r, n), z = new Set(u);
|
|
1632
|
-
let
|
|
1633
|
-
for (const
|
|
1634
|
-
if (
|
|
1635
|
-
if (
|
|
1632
|
+
let _ = null;
|
|
1633
|
+
for (const v of h)
|
|
1634
|
+
if (v.seats.some((p) => z.has(p.id))) {
|
|
1635
|
+
if (_)
|
|
1636
1636
|
return { ok: !1, reason: "not-adjacent", seatId: u[0] };
|
|
1637
|
-
|
|
1637
|
+
_ = v;
|
|
1638
1638
|
}
|
|
1639
|
-
if (!
|
|
1639
|
+
if (!_)
|
|
1640
1640
|
continue;
|
|
1641
|
-
const g =
|
|
1641
|
+
const g = _.seats.map((v, p) => z.has(v.id) ? p : -1).filter((v) => v >= 0);
|
|
1642
1642
|
if (g.length === 0)
|
|
1643
1643
|
continue;
|
|
1644
|
-
const
|
|
1645
|
-
if (k -
|
|
1644
|
+
const I = g[0], k = g[g.length - 1];
|
|
1645
|
+
if (k - I + 1 !== g.length)
|
|
1646
1646
|
return { ok: !1, reason: "not-adjacent", seatId: u[0] };
|
|
1647
|
-
const T =
|
|
1648
|
-
if (T > 1 && (
|
|
1647
|
+
const T = _.seats.length;
|
|
1648
|
+
if (T > 1 && (I === 1 || T - 1 - k === 1))
|
|
1649
1649
|
return { ok: !1, reason: "orphan-seat", seatId: u[0] };
|
|
1650
1650
|
}
|
|
1651
1651
|
return { ok: !0 };
|
|
1652
1652
|
}
|
|
1653
|
-
function
|
|
1653
|
+
function mi(a, i, r, n = {}, t) {
|
|
1654
1654
|
if (a.includes(i))
|
|
1655
1655
|
return { selected: a.filter((u) => u !== i) };
|
|
1656
|
-
const
|
|
1657
|
-
return
|
|
1656
|
+
const l = [...a, i], d = ui(l, r, n, t);
|
|
1657
|
+
return d.ok ? { selected: l } : { rejected: d.reason ?? "not-adjacent" };
|
|
1658
1658
|
}
|
|
1659
|
-
function
|
|
1659
|
+
function pi(a, i, r = {}, n = {}, t) {
|
|
1660
1660
|
if (i <= 0)
|
|
1661
1661
|
return [];
|
|
1662
|
-
const
|
|
1663
|
-
let
|
|
1662
|
+
const l = n.categoryId ? { ...r, allowedCategories: [n.categoryId] } : r;
|
|
1663
|
+
let d = null;
|
|
1664
1664
|
for (const u of a.rows)
|
|
1665
1665
|
if (!(n.sectionId && u.sectionId !== n.sectionId))
|
|
1666
|
-
for (const
|
|
1667
|
-
const c =
|
|
1666
|
+
for (const f of Wn(u.seats, l, t)) {
|
|
1667
|
+
const c = f.seats.length;
|
|
1668
1668
|
if (!(c < i))
|
|
1669
|
-
for (let
|
|
1670
|
-
const m =
|
|
1671
|
-
if (c > i && (
|
|
1669
|
+
for (let o = 0; o + i <= c; o += 1) {
|
|
1670
|
+
const m = o + i - 1;
|
|
1671
|
+
if (c > i && (o === 1 || c - 1 - m === 1))
|
|
1672
1672
|
continue;
|
|
1673
|
-
const h =
|
|
1674
|
-
(!
|
|
1673
|
+
const h = f.seats.slice(o, m + 1), z = h.reduce((_, g) => _ + (g.viewScore ?? 50), 0) / i;
|
|
1674
|
+
(!d || z > d.score) && (d = { ids: h.map((_) => _.id), score: z });
|
|
1675
1675
|
}
|
|
1676
1676
|
}
|
|
1677
|
-
return (
|
|
1677
|
+
return (d == null ? void 0 : d.ids) ?? [];
|
|
1678
1678
|
}
|
|
1679
|
-
function
|
|
1680
|
-
var
|
|
1679
|
+
function hi(a, i, r) {
|
|
1680
|
+
var o, m, h, z;
|
|
1681
1681
|
const n = a.locationById.get(i);
|
|
1682
1682
|
if (!n)
|
|
1683
1683
|
return null;
|
|
1684
1684
|
const t = a.rows.findIndex(
|
|
1685
|
-
(
|
|
1685
|
+
(_) => _.sectionId === n.sectionId && _.rowIndex === n.rowIndex
|
|
1686
1686
|
);
|
|
1687
1687
|
if (t < 0)
|
|
1688
1688
|
return null;
|
|
1689
|
-
const
|
|
1689
|
+
const l = a.rows[t];
|
|
1690
1690
|
if (r === "left")
|
|
1691
|
-
return ((
|
|
1691
|
+
return ((o = l.seats[n.seatIndex - 1]) == null ? void 0 : o.id) ?? null;
|
|
1692
1692
|
if (r === "right")
|
|
1693
|
-
return ((m =
|
|
1693
|
+
return ((m = l.seats[n.seatIndex + 1]) == null ? void 0 : m.id) ?? null;
|
|
1694
1694
|
if (r === "row-start")
|
|
1695
|
-
return ((h =
|
|
1695
|
+
return ((h = l.seats[0]) == null ? void 0 : h.id) ?? null;
|
|
1696
1696
|
if (r === "row-end")
|
|
1697
|
-
return ((z =
|
|
1698
|
-
const
|
|
1699
|
-
if (!
|
|
1697
|
+
return ((z = l.seats[l.seats.length - 1]) == null ? void 0 : z.id) ?? null;
|
|
1698
|
+
const d = a.rows[r === "up" ? t - 1 : t + 1];
|
|
1699
|
+
if (!d)
|
|
1700
1700
|
return null;
|
|
1701
|
-
const u =
|
|
1702
|
-
let
|
|
1703
|
-
for (const
|
|
1704
|
-
const g = Math.abs(
|
|
1705
|
-
g < c && (c = g,
|
|
1701
|
+
const u = l.seats[n.seatIndex].x;
|
|
1702
|
+
let f = null, c = 1 / 0;
|
|
1703
|
+
for (const _ of d.seats) {
|
|
1704
|
+
const g = Math.abs(_.x - u);
|
|
1705
|
+
g < c && (c = g, f = _);
|
|
1706
1706
|
}
|
|
1707
|
-
return (
|
|
1707
|
+
return (f == null ? void 0 : f.id) ?? null;
|
|
1708
1708
|
}
|
|
1709
|
-
function
|
|
1710
|
-
var
|
|
1709
|
+
function gi(a, i, r) {
|
|
1710
|
+
var f, c, o;
|
|
1711
1711
|
const n = a.sections.filter((m) => m.seatCount > 0);
|
|
1712
1712
|
if (n.length === 0)
|
|
1713
1713
|
return null;
|
|
1714
|
-
const t = i ? (
|
|
1715
|
-
return u ? ((
|
|
1714
|
+
const t = i ? (f = a.locationById.get(i)) == null ? void 0 : f.sectionId : void 0, l = n.findIndex((m) => m.section.id === t), d = l < 0 ? 0 : r === "next" ? l + 1 : l - 1, u = n[d];
|
|
1715
|
+
return u ? ((o = (c = a.rows.find((m) => m.sectionId === u.section.id)) == null ? void 0 : c.seats[0]) == null ? void 0 : o.id) ?? null : null;
|
|
1716
1716
|
}
|
|
1717
1717
|
const Le = 8;
|
|
1718
|
-
function
|
|
1719
|
-
return a.seats.length === 0 ? 0 : a.seats.filter((n) =>
|
|
1718
|
+
function vi(a, i) {
|
|
1719
|
+
return a.seats.length === 0 ? 0 : a.seats.filter((n) => xe(n, i) === "available").length / a.seats.length;
|
|
1720
1720
|
}
|
|
1721
|
-
const
|
|
1721
|
+
const fi = ({
|
|
1722
1722
|
cull: a,
|
|
1723
1723
|
selectedIds: i,
|
|
1724
1724
|
cursorId: r,
|
|
1725
1725
|
statusOverrides: n,
|
|
1726
1726
|
sectionColorById: t,
|
|
1727
|
-
interactive:
|
|
1728
|
-
onSeatClick:
|
|
1727
|
+
interactive: l,
|
|
1728
|
+
onSeatClick: d,
|
|
1729
1729
|
onSectionClick: u,
|
|
1730
|
-
describeSeat:
|
|
1730
|
+
describeSeat: f
|
|
1731
1731
|
}) => {
|
|
1732
|
-
const { t: c } =
|
|
1733
|
-
return a.tier === "section" ? /* @__PURE__ */ e("g", { className: "nice-seating-chart__sections", children: a.sections.map(({ section:
|
|
1732
|
+
const { t: c } = J();
|
|
1733
|
+
return a.tier === "section" ? /* @__PURE__ */ e("g", { className: "nice-seating-chart__sections", children: a.sections.map(({ section: o, bounds: m, seatCount: h }) => /* @__PURE__ */ s("g", { className: "nice-seating-chart__section", children: [
|
|
1734
1734
|
/* @__PURE__ */ e(
|
|
1735
1735
|
"rect",
|
|
1736
1736
|
{
|
|
@@ -1740,11 +1740,11 @@ const hi = ({
|
|
|
1740
1740
|
height: m.maxY - m.minY,
|
|
1741
1741
|
rx: 12,
|
|
1742
1742
|
className: "nice-seating-chart__section-shape",
|
|
1743
|
-
style: { fill: t.get(
|
|
1743
|
+
style: { fill: t.get(o.id) },
|
|
1744
1744
|
role: u ? "button" : "img",
|
|
1745
|
-
"aria-label": c("seatingChart.sectionLabel", "{name}, {count} seats").replace("{name}",
|
|
1745
|
+
"aria-label": c("seatingChart.sectionLabel", "{name}, {count} seats").replace("{name}", o.name).replace("{count}", String(h)),
|
|
1746
1746
|
tabIndex: u ? 0 : void 0,
|
|
1747
|
-
onClick: u ? () => u(
|
|
1747
|
+
onClick: u ? () => u(o.id) : void 0
|
|
1748
1748
|
}
|
|
1749
1749
|
),
|
|
1750
1750
|
/* @__PURE__ */ e(
|
|
@@ -1756,67 +1756,67 @@ const hi = ({
|
|
|
1756
1756
|
textAnchor: "middle",
|
|
1757
1757
|
dominantBaseline: "middle",
|
|
1758
1758
|
"aria-hidden": "true",
|
|
1759
|
-
children:
|
|
1759
|
+
children: o.name
|
|
1760
1760
|
}
|
|
1761
1761
|
)
|
|
1762
|
-
] },
|
|
1763
|
-
const m =
|
|
1762
|
+
] }, o.id)) }) : a.tier === "row" ? /* @__PURE__ */ e("g", { className: "nice-seating-chart__rows", children: a.rows.map((o) => {
|
|
1763
|
+
const m = vi(o, n);
|
|
1764
1764
|
return /* @__PURE__ */ s("g", { children: [
|
|
1765
1765
|
/* @__PURE__ */ e(
|
|
1766
1766
|
"rect",
|
|
1767
1767
|
{
|
|
1768
|
-
x:
|
|
1769
|
-
y:
|
|
1770
|
-
width:
|
|
1771
|
-
height:
|
|
1768
|
+
x: o.bounds.minX,
|
|
1769
|
+
y: o.bounds.minY,
|
|
1770
|
+
width: o.bounds.maxX - o.bounds.minX,
|
|
1771
|
+
height: o.bounds.maxY - o.bounds.minY,
|
|
1772
1772
|
rx: 8,
|
|
1773
1773
|
className: "nice-seating-chart__row-shape",
|
|
1774
1774
|
style: {
|
|
1775
|
-
fill: t.get(
|
|
1775
|
+
fill: t.get(o.sectionId),
|
|
1776
1776
|
fillOpacity: 0.25 + m * 0.65
|
|
1777
1777
|
},
|
|
1778
1778
|
role: "img",
|
|
1779
|
-
"aria-label": c("seatingChart.rowLabel", "Row {row}, {count} seats, {free} available").replace("{row}", String(
|
|
1779
|
+
"aria-label": c("seatingChart.rowLabel", "Row {row}, {count} seats, {free} available").replace("{row}", String(o.label)).replace("{count}", String(o.seats.length)).replace("{free}", String(Math.round(m * o.seats.length)))
|
|
1780
1780
|
}
|
|
1781
1781
|
),
|
|
1782
1782
|
/* @__PURE__ */ e(
|
|
1783
1783
|
"text",
|
|
1784
1784
|
{
|
|
1785
|
-
x:
|
|
1786
|
-
y: (
|
|
1785
|
+
x: o.bounds.minX - 6,
|
|
1786
|
+
y: (o.bounds.minY + o.bounds.maxY) / 2,
|
|
1787
1787
|
className: "nice-seating-chart__row-label",
|
|
1788
1788
|
textAnchor: "end",
|
|
1789
1789
|
dominantBaseline: "middle",
|
|
1790
1790
|
"aria-hidden": "true",
|
|
1791
|
-
children:
|
|
1791
|
+
children: o.label
|
|
1792
1792
|
}
|
|
1793
1793
|
)
|
|
1794
|
-
] }, `${
|
|
1795
|
-
}) }) : /* @__PURE__ */ e("g", { className: "nice-seating-chart__seats", children: a.seats.map((
|
|
1796
|
-
const m =
|
|
1794
|
+
] }, `${o.sectionId}-${o.rowIndex}`);
|
|
1795
|
+
}) }) : /* @__PURE__ */ e("g", { className: "nice-seating-chart__seats", children: a.seats.map((o) => {
|
|
1796
|
+
const m = xe(o, n), h = hn(o), z = i.has(o.id), _ = r === o.id, g = { row: o.row, number: o.number }, I = [
|
|
1797
1797
|
"nice-seating-chart__seat",
|
|
1798
1798
|
`nice-seating-chart__seat--${m}`,
|
|
1799
1799
|
z ? "nice-seating-chart__seat--selected" : "",
|
|
1800
1800
|
h ? `nice-seating-chart__seat--${h}` : "",
|
|
1801
|
-
|
|
1801
|
+
_ ? "nice-seating-chart__seat--cursor" : ""
|
|
1802
1802
|
].filter(Boolean).join(" ");
|
|
1803
1803
|
return /* @__PURE__ */ s(
|
|
1804
1804
|
"g",
|
|
1805
1805
|
{
|
|
1806
|
-
className:
|
|
1807
|
-
"data-seat-id":
|
|
1806
|
+
className: I,
|
|
1807
|
+
"data-seat-id": o.id,
|
|
1808
1808
|
role: "gridcell",
|
|
1809
1809
|
"aria-selected": z,
|
|
1810
1810
|
"aria-disabled": m !== "available",
|
|
1811
|
-
"aria-label":
|
|
1812
|
-
tabIndex:
|
|
1813
|
-
onClick:
|
|
1811
|
+
"aria-label": f(o),
|
|
1812
|
+
tabIndex: _ ? 0 : -1,
|
|
1813
|
+
onClick: l && d ? () => d(o) : void 0,
|
|
1814
1814
|
children: [
|
|
1815
1815
|
h ? /* @__PURE__ */ e(
|
|
1816
1816
|
"rect",
|
|
1817
1817
|
{
|
|
1818
|
-
x:
|
|
1819
|
-
y:
|
|
1818
|
+
x: o.x - Le,
|
|
1819
|
+
y: o.y - Le,
|
|
1820
1820
|
width: Le * 2,
|
|
1821
1821
|
height: Le * 2,
|
|
1822
1822
|
rx: 3,
|
|
@@ -1826,8 +1826,8 @@ const hi = ({
|
|
|
1826
1826
|
) : /* @__PURE__ */ e(
|
|
1827
1827
|
"circle",
|
|
1828
1828
|
{
|
|
1829
|
-
cx:
|
|
1830
|
-
cy:
|
|
1829
|
+
cx: o.x,
|
|
1830
|
+
cy: o.y,
|
|
1831
1831
|
r: Le,
|
|
1832
1832
|
className: "nice-seating-chart__seat-shape"
|
|
1833
1833
|
}
|
|
@@ -1836,17 +1836,17 @@ const hi = ({
|
|
|
1836
1836
|
Dn,
|
|
1837
1837
|
{
|
|
1838
1838
|
size: 10,
|
|
1839
|
-
x:
|
|
1840
|
-
y:
|
|
1839
|
+
x: o.x - 5,
|
|
1840
|
+
y: o.y - 5,
|
|
1841
1841
|
className: "nice-seating-chart__seat-glyph"
|
|
1842
1842
|
}
|
|
1843
1843
|
),
|
|
1844
|
-
/* @__PURE__ */ e("title", { children:
|
|
1844
|
+
/* @__PURE__ */ e("title", { children: f(o) }),
|
|
1845
1845
|
/* @__PURE__ */ e(
|
|
1846
1846
|
"text",
|
|
1847
1847
|
{
|
|
1848
|
-
x:
|
|
1849
|
-
y:
|
|
1848
|
+
x: o.x,
|
|
1849
|
+
y: o.y,
|
|
1850
1850
|
className: "nice-seating-chart__seat-number",
|
|
1851
1851
|
textAnchor: "middle",
|
|
1852
1852
|
dominantBaseline: "middle",
|
|
@@ -1856,43 +1856,43 @@ const hi = ({
|
|
|
1856
1856
|
)
|
|
1857
1857
|
]
|
|
1858
1858
|
},
|
|
1859
|
-
|
|
1859
|
+
o.id
|
|
1860
1860
|
);
|
|
1861
1861
|
}) });
|
|
1862
|
-
},
|
|
1862
|
+
}, _i = ({
|
|
1863
1863
|
index: a,
|
|
1864
1864
|
selectedIds: i,
|
|
1865
1865
|
statusOverrides: r,
|
|
1866
1866
|
maxSeats: n,
|
|
1867
1867
|
onSeatToggle: t,
|
|
1868
|
-
onBestAvailable:
|
|
1869
|
-
describeSeat:
|
|
1868
|
+
onBestAvailable: l,
|
|
1869
|
+
describeSeat: d,
|
|
1870
1870
|
disabled: u = !1,
|
|
1871
|
-
defaultOpen:
|
|
1871
|
+
defaultOpen: f = !1
|
|
1872
1872
|
}) => {
|
|
1873
|
-
var
|
|
1874
|
-
const { t: c } =
|
|
1873
|
+
var v;
|
|
1874
|
+
const { t: c } = J(), o = V(
|
|
1875
1875
|
() => a.sections.filter((p) => p.seatCount > 0),
|
|
1876
1876
|
[a.sections]
|
|
1877
|
-
), [m, h] = D(((
|
|
1877
|
+
), [m, h] = D(((v = o[0]) == null ? void 0 : v.section.id) ?? ""), [z, _] = D(0), [g, I] = D(2), k = V(
|
|
1878
1878
|
() => a.rows.filter((p) => p.sectionId === m),
|
|
1879
1879
|
[a.rows, m]
|
|
1880
1880
|
), T = k.find((p) => p.rowIndex === z) ?? k[0];
|
|
1881
1881
|
return /* @__PURE__ */ s(
|
|
1882
|
-
|
|
1882
|
+
Ot,
|
|
1883
1883
|
{
|
|
1884
1884
|
trigger: c("seatListPanel.chooseWithoutMap", "Choose seats without the map"),
|
|
1885
|
-
defaultExpanded:
|
|
1885
|
+
defaultExpanded: f,
|
|
1886
1886
|
className: "nice-seating-chart__list-panel",
|
|
1887
1887
|
children: [
|
|
1888
|
-
|
|
1888
|
+
l && /* @__PURE__ */ s("div", { className: "nice-seating-chart__best", children: [
|
|
1889
1889
|
/* @__PURE__ */ s("label", { className: "nice-seating-chart__field", children: [
|
|
1890
1890
|
/* @__PURE__ */ e("span", { children: c("seatListPanel.howManySeats", "How many seats?") }),
|
|
1891
1891
|
/* @__PURE__ */ e(
|
|
1892
1892
|
dn,
|
|
1893
1893
|
{
|
|
1894
1894
|
value: g,
|
|
1895
|
-
onChange: (p) =>
|
|
1895
|
+
onChange: (p) => I(Math.max(1, Math.min(n, p ?? 1))),
|
|
1896
1896
|
min: 1,
|
|
1897
1897
|
max: n,
|
|
1898
1898
|
size: "xs",
|
|
@@ -1901,12 +1901,12 @@ const hi = ({
|
|
|
1901
1901
|
)
|
|
1902
1902
|
] }),
|
|
1903
1903
|
/* @__PURE__ */ e(
|
|
1904
|
-
|
|
1904
|
+
U,
|
|
1905
1905
|
{
|
|
1906
1906
|
size: "sm",
|
|
1907
1907
|
variant: "primary",
|
|
1908
1908
|
disabled: u,
|
|
1909
|
-
onClick: () =>
|
|
1909
|
+
onClick: () => l(g, { sectionId: m || void 0 }),
|
|
1910
1910
|
children: c("seatListPanel.bestAvailable", "Best available")
|
|
1911
1911
|
}
|
|
1912
1912
|
)
|
|
@@ -1915,15 +1915,15 @@ const hi = ({
|
|
|
1915
1915
|
/* @__PURE__ */ s("label", { className: "nice-seating-chart__field", children: [
|
|
1916
1916
|
/* @__PURE__ */ e("span", { children: c("seatListPanel.section", "Section") }),
|
|
1917
1917
|
/* @__PURE__ */ e(
|
|
1918
|
-
|
|
1918
|
+
Ce,
|
|
1919
1919
|
{
|
|
1920
1920
|
size: "sm",
|
|
1921
1921
|
value: m,
|
|
1922
1922
|
disabled: u,
|
|
1923
1923
|
onChange: (p) => {
|
|
1924
|
-
h(p),
|
|
1924
|
+
h(p), _(0);
|
|
1925
1925
|
},
|
|
1926
|
-
options:
|
|
1926
|
+
options: o.map((p) => ({
|
|
1927
1927
|
value: p.section.id,
|
|
1928
1928
|
label: `${p.section.name} (${p.seatCount})`
|
|
1929
1929
|
}))
|
|
@@ -1933,12 +1933,12 @@ const hi = ({
|
|
|
1933
1933
|
/* @__PURE__ */ s("label", { className: "nice-seating-chart__field", children: [
|
|
1934
1934
|
/* @__PURE__ */ e("span", { children: c("seatListPanel.row", "Row") }),
|
|
1935
1935
|
/* @__PURE__ */ e(
|
|
1936
|
-
|
|
1936
|
+
Ce,
|
|
1937
1937
|
{
|
|
1938
1938
|
size: "sm",
|
|
1939
1939
|
value: String((T == null ? void 0 : T.rowIndex) ?? 0),
|
|
1940
1940
|
disabled: u || k.length === 0,
|
|
1941
|
-
onChange: (p) =>
|
|
1941
|
+
onChange: (p) => _(Number(p)),
|
|
1942
1942
|
options: k.map((p) => ({
|
|
1943
1943
|
value: String(p.rowIndex),
|
|
1944
1944
|
label: `${p.label} (${p.seats.length})`
|
|
@@ -1948,14 +1948,14 @@ const hi = ({
|
|
|
1948
1948
|
] })
|
|
1949
1949
|
] }),
|
|
1950
1950
|
T && /* @__PURE__ */ e("ul", { className: "nice-seating-chart__seat-list", children: T.seats.map((p) => {
|
|
1951
|
-
const A =
|
|
1951
|
+
const A = xe(p, r), y = hn(p), M = i.has(p.id);
|
|
1952
1952
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
|
|
1953
|
-
|
|
1953
|
+
U,
|
|
1954
1954
|
{
|
|
1955
1955
|
size: "sm",
|
|
1956
1956
|
variant: M ? "primary" : "outline",
|
|
1957
1957
|
disabled: u || A !== "available",
|
|
1958
|
-
ariaLabel:
|
|
1958
|
+
ariaLabel: d(p),
|
|
1959
1959
|
"aria-pressed": M,
|
|
1960
1960
|
onClick: () => t(p),
|
|
1961
1961
|
children: [
|
|
@@ -1968,58 +1968,58 @@ const hi = ({
|
|
|
1968
1968
|
]
|
|
1969
1969
|
}
|
|
1970
1970
|
);
|
|
1971
|
-
},
|
|
1972
|
-
function
|
|
1971
|
+
}, yi = { zoom: 1, pan: { x: 0, y: 0 } };
|
|
1972
|
+
function Ni(a = {}) {
|
|
1973
1973
|
const {
|
|
1974
1974
|
minZoom: i = 0.1,
|
|
1975
1975
|
maxZoom: r = 10,
|
|
1976
|
-
initial: n =
|
|
1976
|
+
initial: n = yi,
|
|
1977
1977
|
viewport: t,
|
|
1978
|
-
onViewportChange:
|
|
1979
|
-
disabled:
|
|
1980
|
-
} = a, [u,
|
|
1978
|
+
onViewportChange: l,
|
|
1979
|
+
disabled: d = !1
|
|
1980
|
+
} = a, [u, f] = D(n), c = t ?? u, [o, m] = D(!1), h = ye(/* @__PURE__ */ new Map()), z = ye(null), _ = ye(null), g = H(
|
|
1981
1981
|
(N) => {
|
|
1982
|
-
t === void 0 &&
|
|
1982
|
+
t === void 0 && f(N), l == null || l(N);
|
|
1983
1983
|
},
|
|
1984
|
-
[t,
|
|
1985
|
-
),
|
|
1984
|
+
[t, l]
|
|
1985
|
+
), I = H(
|
|
1986
1986
|
(N) => Math.min(r, Math.max(i, N)),
|
|
1987
1987
|
[i, r]
|
|
1988
1988
|
), k = H(
|
|
1989
|
-
(N,
|
|
1990
|
-
const
|
|
1991
|
-
if (
|
|
1989
|
+
(N, P) => {
|
|
1990
|
+
const E = I(c.zoom * N);
|
|
1991
|
+
if (E === c.zoom)
|
|
1992
1992
|
return;
|
|
1993
|
-
const
|
|
1993
|
+
const F = E / c.zoom;
|
|
1994
1994
|
g({
|
|
1995
|
-
zoom:
|
|
1995
|
+
zoom: E,
|
|
1996
1996
|
pan: {
|
|
1997
|
-
x:
|
|
1998
|
-
y:
|
|
1997
|
+
x: P.x - (P.x - c.pan.x) * F,
|
|
1998
|
+
y: P.y - (P.y - c.pan.y) * F
|
|
1999
1999
|
}
|
|
2000
2000
|
});
|
|
2001
2001
|
},
|
|
2002
|
-
[g,
|
|
2002
|
+
[g, I, c]
|
|
2003
2003
|
), T = H(
|
|
2004
|
-
(N,
|
|
2005
|
-
const
|
|
2006
|
-
k(N,
|
|
2004
|
+
(N, P, E) => {
|
|
2005
|
+
const F = P ?? (E ? { x: E.width / 2, y: E.height / 2 } : { x: 0, y: 0 });
|
|
2006
|
+
k(N, F);
|
|
2007
2007
|
},
|
|
2008
2008
|
[k]
|
|
2009
|
-
),
|
|
2010
|
-
(N,
|
|
2011
|
-
const
|
|
2012
|
-
Math.min((
|
|
2009
|
+
), v = H(
|
|
2010
|
+
(N, P, E = 24) => {
|
|
2011
|
+
const F = Math.max(1, N.maxX - N.minX), X = Math.max(1, N.maxY - N.minY), L = I(
|
|
2012
|
+
Math.min((P.width - E * 2) / F, (P.height - E * 2) / X)
|
|
2013
2013
|
);
|
|
2014
2014
|
g({
|
|
2015
|
-
zoom:
|
|
2015
|
+
zoom: L,
|
|
2016
2016
|
pan: {
|
|
2017
|
-
x: (
|
|
2018
|
-
y: (
|
|
2017
|
+
x: (P.width - F * L) / 2 - N.minX * L,
|
|
2018
|
+
y: (P.height - X * L) / 2 - N.minY * L
|
|
2019
2019
|
}
|
|
2020
2020
|
});
|
|
2021
2021
|
},
|
|
2022
|
-
[g,
|
|
2022
|
+
[g, I]
|
|
2023
2023
|
), p = H(() => g(n), [g, n]), A = H(
|
|
2024
2024
|
(N) => ({
|
|
2025
2025
|
x: (N.x - c.pan.x) / c.zoom,
|
|
@@ -2033,187 +2033,187 @@ function fi(a = {}) {
|
|
|
2033
2033
|
}),
|
|
2034
2034
|
[c]
|
|
2035
2035
|
), M = (N) => {
|
|
2036
|
-
const
|
|
2037
|
-
return { x: N.clientX -
|
|
2036
|
+
const P = N.currentTarget.getBoundingClientRect();
|
|
2037
|
+
return { x: N.clientX - P.left, y: N.clientY - P.top };
|
|
2038
2038
|
};
|
|
2039
2039
|
return {
|
|
2040
2040
|
viewport: c,
|
|
2041
2041
|
setViewport: g,
|
|
2042
|
-
containerProps:
|
|
2042
|
+
containerProps: d ? {} : {
|
|
2043
2043
|
onWheel: (N) => {
|
|
2044
2044
|
N.preventDefault();
|
|
2045
|
-
const
|
|
2046
|
-
k(Math.min(2, Math.max(0.5,
|
|
2045
|
+
const P = Math.exp(-N.deltaY * 2e-3);
|
|
2046
|
+
k(Math.min(2, Math.max(0.5, P)), M(N));
|
|
2047
2047
|
},
|
|
2048
2048
|
onPointerDown: (N) => {
|
|
2049
|
-
var
|
|
2050
|
-
const
|
|
2051
|
-
if (h.current.set(N.pointerId,
|
|
2052
|
-
const [
|
|
2049
|
+
var E, F;
|
|
2050
|
+
const P = M(N);
|
|
2051
|
+
if (h.current.set(N.pointerId, P), (F = (E = N.currentTarget).setPointerCapture) == null || F.call(E, N.pointerId), h.current.size === 2) {
|
|
2052
|
+
const [X, L] = [...h.current.values()];
|
|
2053
2053
|
z.current = {
|
|
2054
|
-
distance: Math.hypot(
|
|
2054
|
+
distance: Math.hypot(X.x - L.x, X.y - L.y) || 1,
|
|
2055
2055
|
zoom: c.zoom
|
|
2056
2056
|
};
|
|
2057
2057
|
} else
|
|
2058
|
-
|
|
2058
|
+
_.current = P, m(!0);
|
|
2059
2059
|
},
|
|
2060
2060
|
onPointerMove: (N) => {
|
|
2061
2061
|
if (!h.current.has(N.pointerId))
|
|
2062
2062
|
return;
|
|
2063
|
-
const
|
|
2064
|
-
if (h.current.set(N.pointerId,
|
|
2065
|
-
const [
|
|
2063
|
+
const P = M(N);
|
|
2064
|
+
if (h.current.set(N.pointerId, P), h.current.size === 2 && z.current) {
|
|
2065
|
+
const [X, L] = [...h.current.values()], G = Math.hypot(X.x - L.x, X.y - L.y) || 1, C = I(z.current.zoom * (G / z.current.distance)), b = { x: (X.x + L.x) / 2, y: (X.y + L.y) / 2 };
|
|
2066
2066
|
C !== c.zoom && k(C / c.zoom, b);
|
|
2067
2067
|
return;
|
|
2068
2068
|
}
|
|
2069
|
-
if (!
|
|
2069
|
+
if (!_.current)
|
|
2070
2070
|
return;
|
|
2071
|
-
const
|
|
2072
|
-
|
|
2071
|
+
const E = P.x - _.current.x, F = P.y - _.current.y;
|
|
2072
|
+
_.current = P, g({ zoom: c.zoom, pan: { x: c.pan.x + E, y: c.pan.y + F } });
|
|
2073
2073
|
},
|
|
2074
2074
|
onPointerUp: (N) => {
|
|
2075
|
-
h.current.delete(N.pointerId), h.current.size < 2 && (z.current = null), h.current.size === 0 && (
|
|
2075
|
+
h.current.delete(N.pointerId), h.current.size < 2 && (z.current = null), h.current.size === 0 && (_.current = null, m(!1));
|
|
2076
2076
|
},
|
|
2077
2077
|
onPointerCancel: (N) => {
|
|
2078
|
-
h.current.delete(N.pointerId), z.current = null,
|
|
2078
|
+
h.current.delete(N.pointerId), z.current = null, _.current = null, m(!1);
|
|
2079
2079
|
}
|
|
2080
2080
|
},
|
|
2081
2081
|
zoomBy: T,
|
|
2082
|
-
fitTo:
|
|
2082
|
+
fitTo: v,
|
|
2083
2083
|
reset: p,
|
|
2084
2084
|
screenToWorld: A,
|
|
2085
2085
|
worldToScreen: y,
|
|
2086
|
-
panning:
|
|
2086
|
+
panning: o
|
|
2087
2087
|
};
|
|
2088
2088
|
}
|
|
2089
|
-
const
|
|
2089
|
+
const bi = {
|
|
2090
2090
|
"orphan-seat": "That would leave a single empty seat. Pick a different seat.",
|
|
2091
2091
|
"not-adjacent": "Seats must be next to each other.",
|
|
2092
2092
|
"max-seats": "You have selected as many seats as this order allows.",
|
|
2093
2093
|
"category-not-allowed": "That seat is not part of the selected ticket type.",
|
|
2094
2094
|
unavailable: "That seat is not available."
|
|
2095
|
-
},
|
|
2095
|
+
}, ki = {
|
|
2096
2096
|
id: "empty",
|
|
2097
2097
|
name: "",
|
|
2098
2098
|
venueId: "",
|
|
2099
2099
|
sections: [],
|
|
2100
2100
|
priceCategories: [],
|
|
2101
2101
|
totalSeats: 0
|
|
2102
|
-
},
|
|
2102
|
+
}, wi = /* @__PURE__ */ ie(
|
|
2103
2103
|
function(i, r) {
|
|
2104
|
-
var
|
|
2105
|
-
const { t: n } =
|
|
2106
|
-
chart: t =
|
|
2107
|
-
mode:
|
|
2108
|
-
selection:
|
|
2104
|
+
var Ae, ge, Te;
|
|
2105
|
+
const { t: n } = J(), {
|
|
2106
|
+
chart: t = ki,
|
|
2107
|
+
mode: l = "select",
|
|
2108
|
+
selection: d = {},
|
|
2109
2109
|
selectedSeatIds: u,
|
|
2110
|
-
defaultSelectedSeatIds:
|
|
2110
|
+
defaultSelectedSeatIds: f = [],
|
|
2111
2111
|
onSelectionChange: c,
|
|
2112
|
-
onSelectionRejected:
|
|
2112
|
+
onSelectionRejected: o,
|
|
2113
2113
|
seatStatusOverrides: m,
|
|
2114
2114
|
onSeatClick: h,
|
|
2115
2115
|
onBestAvailable: z,
|
|
2116
|
-
lod:
|
|
2116
|
+
lod: _ = "auto",
|
|
2117
2117
|
onLodChange: g,
|
|
2118
|
-
maxRenderedSeats:
|
|
2118
|
+
maxRenderedSeats: I = 2500,
|
|
2119
2119
|
containerSize: k,
|
|
2120
2120
|
showLegend: T = !0,
|
|
2121
|
-
showList:
|
|
2121
|
+
showList: v = !1,
|
|
2122
2122
|
zoomable: p = !0,
|
|
2123
2123
|
locale: A,
|
|
2124
2124
|
disabled: y = !1,
|
|
2125
2125
|
readOnly: M = !1,
|
|
2126
2126
|
className: w,
|
|
2127
2127
|
style: N
|
|
2128
|
-
} = i,
|
|
2129
|
-
|
|
2130
|
-
if (k || !
|
|
2128
|
+
} = i, P = ye(null), [E, F] = D({ width: 800, height: 500 }), [X, L] = D(!1), [G, C] = D(f), [b, R] = D(null), [j, K] = D(""), x = u ?? G, B = V(() => new Set(x), [x]), q = l === "select" && !y && !M && d.interactive !== !1, ee = d.maxSeats ?? 8, Y = V(() => ri(t), [t]), ne = k ?? E, te = !!k || X;
|
|
2129
|
+
Xe(() => {
|
|
2130
|
+
if (k || !P.current || typeof ResizeObserver > "u")
|
|
2131
2131
|
return;
|
|
2132
|
-
const $ =
|
|
2133
|
-
const { width: Q, height:
|
|
2134
|
-
Q > 0 &&
|
|
2132
|
+
const $ = P.current, O = new ResizeObserver(([W]) => {
|
|
2133
|
+
const { width: Q, height: ae } = W.contentRect;
|
|
2134
|
+
Q > 0 && ae > 0 && (F({ width: Q, height: ae }), L(!0));
|
|
2135
2135
|
});
|
|
2136
2136
|
return O.observe($), () => O.disconnect();
|
|
2137
2137
|
}, [k]);
|
|
2138
|
-
const
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
}, [
|
|
2142
|
-
const
|
|
2143
|
-
() =>
|
|
2144
|
-
[
|
|
2145
|
-
),
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
}, [
|
|
2149
|
-
const
|
|
2138
|
+
const me = Ni({ disabled: !p || y }), { fitTo: ve, viewport: le } = me, De = ye(!1);
|
|
2139
|
+
Xe(() => {
|
|
2140
|
+
De.current || !te || Y.totalSeats === 0 || ne.width <= 0 || (De.current = !0, ve(Y.bounds, ne));
|
|
2141
|
+
}, [ve, Y, ne, te]);
|
|
2142
|
+
const be = V(() => si(le, ne, 40), [le, ne]), Ee = _ !== "auto" ? _ : b ? "seat" : void 0, de = V(
|
|
2143
|
+
() => oi(Y, be, I, Ee),
|
|
2144
|
+
[Y, be, I, Ee]
|
|
2145
|
+
), Oe = ye(null);
|
|
2146
|
+
Xe(() => {
|
|
2147
|
+
Oe.current !== de.tier && (Oe.current = de.tier, g == null || g(de.tier));
|
|
2148
|
+
}, [de.tier, g]);
|
|
2149
|
+
const Ie = V(
|
|
2150
2150
|
() => {
|
|
2151
2151
|
var $;
|
|
2152
2152
|
return new Map((($ = t.sections) == null ? void 0 : $.map((O) => [O.id, O.color])) ?? []);
|
|
2153
2153
|
},
|
|
2154
2154
|
[t.sections]
|
|
2155
|
-
),
|
|
2155
|
+
), Pe = V(
|
|
2156
2156
|
() => {
|
|
2157
2157
|
var $;
|
|
2158
2158
|
return new Map((($ = t.sections) == null ? void 0 : $.map((O) => [O.id, O])) ?? []);
|
|
2159
2159
|
},
|
|
2160
2160
|
[t.sections]
|
|
2161
|
-
),
|
|
2161
|
+
), oe = H(
|
|
2162
2162
|
($) => {
|
|
2163
|
-
const O =
|
|
2163
|
+
const O = Pe.get($.sectorId), W = xe($, m), Q = hn($), ae = [
|
|
2164
2164
|
O ? O.name : "",
|
|
2165
2165
|
n("seatingChart.rowN", "row {row}").replace("{row}", String($.row)),
|
|
2166
2166
|
n("seatingChart.seatN", "seat {number}").replace("{number}", String($.number))
|
|
2167
2167
|
].filter(Boolean);
|
|
2168
|
-
if (O &&
|
|
2169
|
-
const
|
|
2170
|
-
|
|
2168
|
+
if (O && d.showPrices !== !1) {
|
|
2169
|
+
const we = Pn($, t, O);
|
|
2170
|
+
ae.push(ce(we.amount, we.currency, A));
|
|
2171
2171
|
}
|
|
2172
|
-
return
|
|
2172
|
+
return ae.push(n(`seatingChart.status.${W}`, W)), Q === "wheelchair" && ae.push(n("seatingChart.wheelchairAccessible", "wheelchair accessible")), Q === "companion" && ae.push(n("seatingChart.companionSeat", "companion seat")), ae.join(", ");
|
|
2173
2173
|
},
|
|
2174
|
-
[t,
|
|
2175
|
-
),
|
|
2174
|
+
[t, Pe, m, d.showPrices, A, n]
|
|
2175
|
+
), fe = H(
|
|
2176
2176
|
($) => {
|
|
2177
2177
|
u === void 0 && C($), c == null || c($);
|
|
2178
2178
|
},
|
|
2179
2179
|
[u, c]
|
|
2180
|
-
),
|
|
2180
|
+
), pe = H(
|
|
2181
2181
|
($) => {
|
|
2182
|
-
if (h == null || h($), !
|
|
2182
|
+
if (h == null || h($), !q)
|
|
2183
2183
|
return;
|
|
2184
|
-
const O =
|
|
2184
|
+
const O = mi(x, $.id, Y, d, m);
|
|
2185
2185
|
if ("rejected" in O) {
|
|
2186
|
-
|
|
2187
|
-
n(`seatingChart.rejection.${O.rejected}`,
|
|
2186
|
+
o == null || o({ reason: O.rejected, seatId: $.id }), K(
|
|
2187
|
+
n(`seatingChart.rejection.${O.rejected}`, bi[O.rejected])
|
|
2188
2188
|
);
|
|
2189
2189
|
return;
|
|
2190
2190
|
}
|
|
2191
|
-
|
|
2192
|
-
n("seatingChart.seatSelected", "{seat}. {count} of {max} selected.").replace("{seat}",
|
|
2191
|
+
fe(O.selected), K(
|
|
2192
|
+
n("seatingChart.seatSelected", "{seat}. {count} of {max} selected.").replace("{seat}", oe($)).replace("{count}", String(O.selected.length)).replace("{max}", String(ee))
|
|
2193
2193
|
);
|
|
2194
2194
|
},
|
|
2195
2195
|
[
|
|
2196
2196
|
n,
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2197
|
+
fe,
|
|
2198
|
+
oe,
|
|
2199
|
+
Y,
|
|
2200
|
+
q,
|
|
2201
|
+
ee,
|
|
2202
2202
|
h,
|
|
2203
|
-
|
|
2203
|
+
o,
|
|
2204
2204
|
m,
|
|
2205
|
-
|
|
2206
|
-
|
|
2205
|
+
x,
|
|
2206
|
+
d
|
|
2207
2207
|
]
|
|
2208
|
-
),
|
|
2208
|
+
), Qe = H(
|
|
2209
2209
|
($, O) => {
|
|
2210
2210
|
if (z) {
|
|
2211
2211
|
z($, O);
|
|
2212
2212
|
return;
|
|
2213
2213
|
}
|
|
2214
|
-
const
|
|
2215
|
-
if (
|
|
2216
|
-
|
|
2214
|
+
const W = pi(Y, $, d, O, m);
|
|
2215
|
+
if (W.length === 0) {
|
|
2216
|
+
K(
|
|
2217
2217
|
n(
|
|
2218
2218
|
"seatingChart.noBlockAvailable",
|
|
2219
2219
|
"No block of {count} seats together is available."
|
|
@@ -2221,43 +2221,43 @@ const _i = {
|
|
|
2221
2221
|
);
|
|
2222
2222
|
return;
|
|
2223
2223
|
}
|
|
2224
|
-
|
|
2224
|
+
fe(W), R(W[0]), K(
|
|
2225
2225
|
n("seatingChart.selectedTogether", "Selected {count} seats together.").replace(
|
|
2226
2226
|
"{count}",
|
|
2227
|
-
String(
|
|
2227
|
+
String(W.length)
|
|
2228
2228
|
)
|
|
2229
2229
|
);
|
|
2230
2230
|
},
|
|
2231
|
-
[
|
|
2232
|
-
),
|
|
2231
|
+
[fe, Y, z, m, d, n]
|
|
2232
|
+
), he = H(
|
|
2233
2233
|
($) => {
|
|
2234
|
-
const O =
|
|
2234
|
+
const O = Y.locationById.get($);
|
|
2235
2235
|
if (!O)
|
|
2236
2236
|
return;
|
|
2237
|
-
const
|
|
2237
|
+
const W = Y.rows.find(
|
|
2238
2238
|
(Q) => Q.sectionId === O.sectionId && Q.rowIndex === O.rowIndex
|
|
2239
2239
|
);
|
|
2240
|
-
|
|
2240
|
+
W && ve(W.bounds, ne, 80);
|
|
2241
2241
|
},
|
|
2242
|
-
[
|
|
2243
|
-
),
|
|
2242
|
+
[ve, Y, ne]
|
|
2243
|
+
), ke = H(
|
|
2244
2244
|
($) => {
|
|
2245
2245
|
if (!$)
|
|
2246
2246
|
return;
|
|
2247
|
-
|
|
2248
|
-
const O =
|
|
2249
|
-
O &&
|
|
2247
|
+
R($), he($);
|
|
2248
|
+
const O = Y.seatById.get($);
|
|
2249
|
+
O && K(oe(O)), requestAnimationFrame(() => {
|
|
2250
2250
|
var Q;
|
|
2251
|
-
const
|
|
2252
|
-
...((Q =
|
|
2253
|
-
].find((
|
|
2254
|
-
|
|
2251
|
+
const W = [
|
|
2252
|
+
...((Q = P.current) == null ? void 0 : Q.querySelectorAll("[data-seat-id]")) ?? []
|
|
2253
|
+
].find((ae) => ae.getAttribute("data-seat-id") === $);
|
|
2254
|
+
W == null || W.focus({ preventScroll: !0 });
|
|
2255
2255
|
});
|
|
2256
2256
|
},
|
|
2257
|
-
[
|
|
2258
|
-
),
|
|
2259
|
-
var
|
|
2260
|
-
const O = b ?? ((
|
|
2257
|
+
[oe, Y.seatById, he]
|
|
2258
|
+
), ze = ($) => {
|
|
2259
|
+
var ae, we;
|
|
2260
|
+
const O = b ?? ((we = (ae = Y.rows[0]) == null ? void 0 : ae.seats[0]) == null ? void 0 : we.id) ?? null;
|
|
2261
2261
|
if (!O)
|
|
2262
2262
|
return;
|
|
2263
2263
|
const Q = {
|
|
@@ -2269,22 +2269,22 @@ const _i = {
|
|
|
2269
2269
|
End: "row-end"
|
|
2270
2270
|
}[$.key];
|
|
2271
2271
|
if (Q) {
|
|
2272
|
-
$.preventDefault(),
|
|
2272
|
+
$.preventDefault(), ke(b ? hi(Y, O, Q) : O);
|
|
2273
2273
|
return;
|
|
2274
2274
|
}
|
|
2275
2275
|
if ($.key === "PageDown" || $.key === "PageUp") {
|
|
2276
|
-
$.preventDefault(),
|
|
2276
|
+
$.preventDefault(), ke(gi(Y, b, $.key === "PageDown" ? "next" : "prev"));
|
|
2277
2277
|
return;
|
|
2278
2278
|
}
|
|
2279
2279
|
if ($.key === "Enter" || $.key === " ") {
|
|
2280
2280
|
$.preventDefault();
|
|
2281
|
-
const
|
|
2282
|
-
|
|
2281
|
+
const Me = Y.seatById.get(O);
|
|
2282
|
+
Me && pe(Me);
|
|
2283
2283
|
return;
|
|
2284
2284
|
}
|
|
2285
|
-
$.key === "Escape" &&
|
|
2285
|
+
$.key === "Escape" && x.length > 0 && ($.preventDefault(), fe([]), K(n("seatingChart.selectionCleared", "Selection cleared.")));
|
|
2286
2286
|
};
|
|
2287
|
-
if (
|
|
2287
|
+
if (Y.totalSeats === 0)
|
|
2288
2288
|
return /* @__PURE__ */ e("div", { ref: r, className: `nice-seating-chart ${w ?? ""}`, style: N, children: /* @__PURE__ */ e(
|
|
2289
2289
|
Ne,
|
|
2290
2290
|
{
|
|
@@ -2295,33 +2295,33 @@ const _i = {
|
|
|
2295
2295
|
)
|
|
2296
2296
|
}
|
|
2297
2297
|
) });
|
|
2298
|
-
const
|
|
2299
|
-
const
|
|
2300
|
-
return !
|
|
2301
|
-
}, 0),
|
|
2298
|
+
const Ye = x.reduce(($, O) => {
|
|
2299
|
+
const W = Y.seatById.get(O), Q = W ? Pe.get(W.sectorId) : void 0;
|
|
2300
|
+
return !W || !Q ? $ : $ + Pn(W, t, Q).amount;
|
|
2301
|
+
}, 0), _e = ((ge = (Ae = t.sections) == null ? void 0 : Ae[0]) == null ? void 0 : ge.currency) ?? "PLN";
|
|
2302
2302
|
return /* @__PURE__ */ s(
|
|
2303
2303
|
"div",
|
|
2304
2304
|
{
|
|
2305
2305
|
ref: r,
|
|
2306
|
-
className: `nice-seating-chart nice-seating-chart--${
|
|
2306
|
+
className: `nice-seating-chart nice-seating-chart--${l} ${w ?? ""}`,
|
|
2307
2307
|
style: N,
|
|
2308
2308
|
children: [
|
|
2309
2309
|
/* @__PURE__ */ s("div", { className: "nice-seating-chart__stage", children: [
|
|
2310
2310
|
/* @__PURE__ */ e(
|
|
2311
2311
|
"div",
|
|
2312
2312
|
{
|
|
2313
|
-
ref:
|
|
2313
|
+
ref: P,
|
|
2314
2314
|
className: "nice-seating-chart__canvas-host",
|
|
2315
2315
|
role: "grid",
|
|
2316
2316
|
"aria-label": n("seatingChart.chartLabel", "{name} seating chart").replace(
|
|
2317
2317
|
"{name}",
|
|
2318
2318
|
t.name
|
|
2319
2319
|
),
|
|
2320
|
-
"aria-rowcount":
|
|
2321
|
-
"aria-colcount":
|
|
2320
|
+
"aria-rowcount": Y.rows.length,
|
|
2321
|
+
"aria-colcount": Y.totalSeats,
|
|
2322
2322
|
tabIndex: b ? -1 : 0,
|
|
2323
|
-
onKeyDown:
|
|
2324
|
-
...
|
|
2323
|
+
onKeyDown: ze,
|
|
2324
|
+
...me.containerProps,
|
|
2325
2325
|
children: /* @__PURE__ */ s(
|
|
2326
2326
|
"svg",
|
|
2327
2327
|
{
|
|
@@ -2344,23 +2344,23 @@ const _i = {
|
|
|
2344
2344
|
/* @__PURE__ */ e(
|
|
2345
2345
|
"g",
|
|
2346
2346
|
{
|
|
2347
|
-
transform: `translate(${
|
|
2347
|
+
transform: `translate(${le.pan.x} ${le.pan.y}) scale(${le.zoom})`,
|
|
2348
2348
|
children: /* @__PURE__ */ e(
|
|
2349
|
-
|
|
2349
|
+
fi,
|
|
2350
2350
|
{
|
|
2351
|
-
cull:
|
|
2352
|
-
selectedIds:
|
|
2351
|
+
cull: de,
|
|
2352
|
+
selectedIds: B,
|
|
2353
2353
|
cursorId: b,
|
|
2354
2354
|
statusOverrides: m,
|
|
2355
|
-
sectionColorById:
|
|
2356
|
-
interactive:
|
|
2357
|
-
onSeatClick:
|
|
2358
|
-
onSectionClick:
|
|
2359
|
-
var
|
|
2360
|
-
const O = (
|
|
2361
|
-
O &&
|
|
2355
|
+
sectionColorById: Ie,
|
|
2356
|
+
interactive: q,
|
|
2357
|
+
onSeatClick: pe,
|
|
2358
|
+
onSectionClick: d.sectionSelect ? ($) => {
|
|
2359
|
+
var W;
|
|
2360
|
+
const O = (W = Y.rows.find((Q) => Q.sectionId === $)) == null ? void 0 : W.seats[0];
|
|
2361
|
+
O && ke(O.id);
|
|
2362
2362
|
} : void 0,
|
|
2363
|
-
describeSeat:
|
|
2363
|
+
describeSeat: oe
|
|
2364
2364
|
}
|
|
2365
2365
|
)
|
|
2366
2366
|
}
|
|
@@ -2371,15 +2371,15 @@ const _i = {
|
|
|
2371
2371
|
}
|
|
2372
2372
|
),
|
|
2373
2373
|
p && /* @__PURE__ */ e(
|
|
2374
|
-
|
|
2374
|
+
Yt,
|
|
2375
2375
|
{
|
|
2376
2376
|
className: "nice-seating-chart__zoom",
|
|
2377
|
-
value:
|
|
2378
|
-
onChange: ($) =>
|
|
2377
|
+
value: le.zoom,
|
|
2378
|
+
onChange: ($) => me.zoomBy($ / le.zoom, void 0, ne),
|
|
2379
2379
|
min: 0.1,
|
|
2380
2380
|
max: 10,
|
|
2381
2381
|
step: 1.25,
|
|
2382
|
-
onFit: () =>
|
|
2382
|
+
onFit: () => ve(Y.bounds, ne),
|
|
2383
2383
|
variant: "floating",
|
|
2384
2384
|
orientation: "vertical",
|
|
2385
2385
|
size: "sm",
|
|
@@ -2389,7 +2389,7 @@ const _i = {
|
|
|
2389
2389
|
] }),
|
|
2390
2390
|
/* @__PURE__ */ e("p", { className: "nice-seating-chart__status", role: "status", "aria-live": "polite", children: j }),
|
|
2391
2391
|
T && /* @__PURE__ */ s("ul", { className: "nice-seating-chart__legend", children: [
|
|
2392
|
-
(
|
|
2392
|
+
(Te = t.priceCategories) == null ? void 0 : Te.map(($) => /* @__PURE__ */ s("li", { className: "nice-seating-chart__legend-item", children: [
|
|
2393
2393
|
/* @__PURE__ */ e(
|
|
2394
2394
|
"span",
|
|
2395
2395
|
{
|
|
@@ -2400,7 +2400,7 @@ const _i = {
|
|
|
2400
2400
|
),
|
|
2401
2401
|
$.name,
|
|
2402
2402
|
" · ",
|
|
2403
|
-
ce($.price,
|
|
2403
|
+
ce($.price, _e, A)
|
|
2404
2404
|
] }, $.id)),
|
|
2405
2405
|
/* @__PURE__ */ s("li", { className: "nice-seating-chart__legend-item nice-seating-chart__legend-item--sold", children: [
|
|
2406
2406
|
/* @__PURE__ */ e("span", { className: "nice-seating-chart__legend-swatch", "aria-hidden": "true" }),
|
|
@@ -2408,29 +2408,29 @@ const _i = {
|
|
|
2408
2408
|
n("seatingChart.sold", "Sold")
|
|
2409
2409
|
] })
|
|
2410
2410
|
] }),
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2411
|
+
l === "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(Ye, _e, A))) : n("seatingChart.seatsMany", "{selected} seats · {amount}").replace("{selected}", String(x.length)).replace("{amount}", String(ce(Ye, _e, A))) }),
|
|
2412
|
+
v && /* @__PURE__ */ e(
|
|
2413
|
+
_i,
|
|
2414
2414
|
{
|
|
2415
|
-
index:
|
|
2416
|
-
selectedIds:
|
|
2415
|
+
index: Y,
|
|
2416
|
+
selectedIds: B,
|
|
2417
2417
|
statusOverrides: m,
|
|
2418
|
-
maxSeats:
|
|
2419
|
-
onSeatToggle:
|
|
2420
|
-
onBestAvailable:
|
|
2421
|
-
describeSeat:
|
|
2422
|
-
disabled: !
|
|
2423
|
-
defaultOpen:
|
|
2418
|
+
maxSeats: ee,
|
|
2419
|
+
onSeatToggle: pe,
|
|
2420
|
+
onBestAvailable: Qe,
|
|
2421
|
+
describeSeat: oe,
|
|
2422
|
+
disabled: !q,
|
|
2423
|
+
defaultOpen: l === "select" && v
|
|
2424
2424
|
}
|
|
2425
2425
|
)
|
|
2426
2426
|
]
|
|
2427
2427
|
}
|
|
2428
2428
|
);
|
|
2429
2429
|
}
|
|
2430
|
-
),
|
|
2430
|
+
), la = /* @__PURE__ */ ie(
|
|
2431
2431
|
function({ showList: i = !0, className: r, ...n }, t) {
|
|
2432
2432
|
return /* @__PURE__ */ e(
|
|
2433
|
-
|
|
2433
|
+
wi,
|
|
2434
2434
|
{
|
|
2435
2435
|
ref: t,
|
|
2436
2436
|
mode: "select",
|
|
@@ -2440,17 +2440,17 @@ const _i = {
|
|
|
2440
2440
|
}
|
|
2441
2441
|
);
|
|
2442
2442
|
}
|
|
2443
|
-
), Gn = /\{\{\s*([\w.-]+)\s*\}\}/g,
|
|
2443
|
+
), Gn = /\{\{\s*([\w.-]+)\s*\}\}/g, Si = {
|
|
2444
2444
|
"&": "&",
|
|
2445
2445
|
"<": "<",
|
|
2446
2446
|
">": ">",
|
|
2447
2447
|
'"': """,
|
|
2448
2448
|
"'": "'"
|
|
2449
2449
|
};
|
|
2450
|
-
function
|
|
2451
|
-
return a.replace(/[&<>"']/g, (i) =>
|
|
2450
|
+
function Ci(a) {
|
|
2451
|
+
return a.replace(/[&<>"']/g, (i) => Si[i] ?? i);
|
|
2452
2452
|
}
|
|
2453
|
-
function
|
|
2453
|
+
function xi(a) {
|
|
2454
2454
|
const i = [], r = /* @__PURE__ */ new Set();
|
|
2455
2455
|
for (const n of a.matchAll(Gn)) {
|
|
2456
2456
|
const t = n[1];
|
|
@@ -2458,20 +2458,20 @@ function wi(a) {
|
|
|
2458
2458
|
}
|
|
2459
2459
|
return i;
|
|
2460
2460
|
}
|
|
2461
|
-
function
|
|
2461
|
+
function Ii(a, i = {}, r = {}) {
|
|
2462
2462
|
const { escape: n = !0, missing: t = "keep" } = r;
|
|
2463
|
-
return a.replace(Gn, (
|
|
2464
|
-
const u = i[
|
|
2465
|
-
return u == null ? t === "blank" ? "" :
|
|
2463
|
+
return a.replace(Gn, (l, d) => {
|
|
2464
|
+
const u = i[d];
|
|
2465
|
+
return u == null ? t === "blank" ? "" : l : n ? Ci(String(u)) : String(u);
|
|
2466
2466
|
});
|
|
2467
2467
|
}
|
|
2468
2468
|
function zn(a) {
|
|
2469
2469
|
return `{{${a}}}`;
|
|
2470
2470
|
}
|
|
2471
|
-
function
|
|
2472
|
-
return
|
|
2471
|
+
function Pi(a, i = {}) {
|
|
2472
|
+
return xi(a).filter((r) => i[r] === void 0 || i[r] === null);
|
|
2473
2473
|
}
|
|
2474
|
-
const
|
|
2474
|
+
const zi = { name: "", body: "" }, Ai = [
|
|
2475
2475
|
"undo",
|
|
2476
2476
|
"redo",
|
|
2477
2477
|
"|",
|
|
@@ -2491,91 +2491,91 @@ const xi = { name: "", body: "" }, Ii = [
|
|
|
2491
2491
|
"|",
|
|
2492
2492
|
"link",
|
|
2493
2493
|
"image"
|
|
2494
|
-
],
|
|
2495
|
-
const { t: n } =
|
|
2494
|
+
], oa = /* @__PURE__ */ ie(function(i, r) {
|
|
2495
|
+
const { t: n } = J(), {
|
|
2496
2496
|
template: t,
|
|
2497
|
-
defaultTemplate:
|
|
2498
|
-
onTemplateChange:
|
|
2497
|
+
defaultTemplate: l,
|
|
2498
|
+
onTemplateChange: d,
|
|
2499
2499
|
tokens: u = [],
|
|
2500
|
-
previewData:
|
|
2500
|
+
previewData: f = {},
|
|
2501
2501
|
recipients: c = [],
|
|
2502
|
-
onRecipientsChange:
|
|
2502
|
+
onRecipientsChange: o,
|
|
2503
2503
|
onSend: m,
|
|
2504
2504
|
sending: h = !1,
|
|
2505
|
-
toolbar: z =
|
|
2506
|
-
disabled:
|
|
2505
|
+
toolbar: z = Ai,
|
|
2506
|
+
disabled: _ = !1,
|
|
2507
2507
|
readOnly: g = !1,
|
|
2508
|
-
size:
|
|
2508
|
+
size: I = "md",
|
|
2509
2509
|
className: k,
|
|
2510
2510
|
style: T
|
|
2511
|
-
} = i, [
|
|
2511
|
+
} = i, [v, p] = Xt({
|
|
2512
2512
|
value: t,
|
|
2513
|
-
defaultValue:
|
|
2514
|
-
fallbackValue:
|
|
2515
|
-
onChange:
|
|
2513
|
+
defaultValue: l,
|
|
2514
|
+
fallbackValue: zi,
|
|
2515
|
+
onChange: d,
|
|
2516
2516
|
componentName: "NiceInvitationDesigner"
|
|
2517
|
-
}), [A, y] = D(""), M =
|
|
2517
|
+
}), [A, y] = D(""), M = _ || g || h, w = V(() => Xn(A), [A]), N = V(() => {
|
|
2518
2518
|
const b = {};
|
|
2519
|
-
for (const
|
|
2520
|
-
|
|
2521
|
-
return { ...b, ...
|
|
2522
|
-
}, [u,
|
|
2523
|
-
() =>
|
|
2524
|
-
[
|
|
2525
|
-
),
|
|
2526
|
-
() =>
|
|
2527
|
-
[
|
|
2528
|
-
),
|
|
2529
|
-
|
|
2530
|
-
},
|
|
2531
|
-
!
|
|
2519
|
+
for (const R of u)
|
|
2520
|
+
R.sample !== void 0 && (b[R.key] = R.sample);
|
|
2521
|
+
return { ...b, ...f };
|
|
2522
|
+
}, [u, f]), P = V(
|
|
2523
|
+
() => Ii(v.body ?? "", N),
|
|
2524
|
+
[v.body, N]
|
|
2525
|
+
), E = V(
|
|
2526
|
+
() => Pi(v.body ?? "", N),
|
|
2527
|
+
[v.body, N]
|
|
2528
|
+
), F = c.map((b) => b.email), X = (b) => p({ ...v, ...b }), L = (b) => {
|
|
2529
|
+
X({ body: `${v.body ?? ""}${zn(b)}` });
|
|
2530
|
+
}, G = () => {
|
|
2531
|
+
!o || w.valid.length === 0 || (o(Zt(F, w.valid)), y(""));
|
|
2532
2532
|
}, C = (b) => {
|
|
2533
|
-
|
|
2533
|
+
o == null || o(F.filter((R) => R !== b));
|
|
2534
2534
|
};
|
|
2535
2535
|
return /* @__PURE__ */ s(
|
|
2536
2536
|
"div",
|
|
2537
2537
|
{
|
|
2538
2538
|
ref: r,
|
|
2539
|
-
className: `nice-invitation-designer nice-invitation-designer--${
|
|
2539
|
+
className: `nice-invitation-designer nice-invitation-designer--${I} ${k ?? ""}`,
|
|
2540
2540
|
style: T,
|
|
2541
2541
|
children: [
|
|
2542
2542
|
/* @__PURE__ */ s("section", { className: "nice-invitation-designer__editor", children: [
|
|
2543
2543
|
/* @__PURE__ */ e(
|
|
2544
|
-
|
|
2544
|
+
Z,
|
|
2545
2545
|
{
|
|
2546
2546
|
label: n("invitationDesigner.templateName", "Template name"),
|
|
2547
|
-
value:
|
|
2548
|
-
onChange: (b) =>
|
|
2547
|
+
value: v.name,
|
|
2548
|
+
onChange: (b) => X({ name: b }),
|
|
2549
2549
|
placeholder: n("invitationDesigner.birthdayInvitation", "Birthday invitation"),
|
|
2550
2550
|
disabled: M,
|
|
2551
|
-
size:
|
|
2551
|
+
size: I
|
|
2552
2552
|
}
|
|
2553
2553
|
),
|
|
2554
2554
|
u.length > 0 && !g && /* @__PURE__ */ s("div", { className: "nice-invitation-designer__tokens", children: [
|
|
2555
2555
|
/* @__PURE__ */ e("span", { className: "nice-invitation-designer__tokens-label", children: n("invitationDesigner.insert", "Insert:") }),
|
|
2556
2556
|
u.map((b) => /* @__PURE__ */ e(
|
|
2557
|
-
|
|
2557
|
+
U,
|
|
2558
2558
|
{
|
|
2559
2559
|
size: "sm",
|
|
2560
2560
|
variant: "outline",
|
|
2561
2561
|
disabled: M,
|
|
2562
|
-
onClick: () =>
|
|
2562
|
+
onClick: () => L(b.key),
|
|
2563
2563
|
children: b.label
|
|
2564
2564
|
},
|
|
2565
2565
|
b.key
|
|
2566
2566
|
))
|
|
2567
2567
|
] }),
|
|
2568
2568
|
/* @__PURE__ */ e(
|
|
2569
|
-
|
|
2569
|
+
Bt,
|
|
2570
2570
|
{
|
|
2571
2571
|
format: "html",
|
|
2572
|
-
value:
|
|
2573
|
-
onChange: (b) =>
|
|
2572
|
+
value: v.body ?? "",
|
|
2573
|
+
onChange: (b) => X({ body: b }),
|
|
2574
2574
|
toolbar: z,
|
|
2575
2575
|
height: 280,
|
|
2576
2576
|
editorSize: "compact",
|
|
2577
2577
|
readOnly: g || h,
|
|
2578
|
-
disabled:
|
|
2578
|
+
disabled: _
|
|
2579
2579
|
}
|
|
2580
2580
|
)
|
|
2581
2581
|
] }),
|
|
@@ -2587,23 +2587,23 @@ const xi = { name: "", body: "" }, Ii = [
|
|
|
2587
2587
|
children: [
|
|
2588
2588
|
/* @__PURE__ */ s("header", { className: "nice-invitation-designer__preview-header", children: [
|
|
2589
2589
|
/* @__PURE__ */ e("h4", { children: n("invitationDesigner.preview", "Preview") }),
|
|
2590
|
-
|
|
2590
|
+
E.length > 0 && /* @__PURE__ */ e(se, { size: "xs", subtle: !0, variant: "warning", children: n("invitationDesigner.unresolved", "{unresolved} unresolved").replace(
|
|
2591
2591
|
"{unresolved}",
|
|
2592
|
-
String(
|
|
2592
|
+
String(E.length)
|
|
2593
2593
|
) })
|
|
2594
2594
|
] }),
|
|
2595
|
-
|
|
2595
|
+
v.coverImageUrl && /* @__PURE__ */ e("img", { className: "nice-invitation-designer__cover", src: v.coverImageUrl, alt: "" }),
|
|
2596
2596
|
/* @__PURE__ */ e(
|
|
2597
2597
|
"div",
|
|
2598
2598
|
{
|
|
2599
2599
|
className: "nice-invitation-designer__preview-body",
|
|
2600
|
-
dangerouslySetInnerHTML: { __html:
|
|
2600
|
+
dangerouslySetInnerHTML: { __html: P }
|
|
2601
2601
|
}
|
|
2602
2602
|
),
|
|
2603
|
-
|
|
2603
|
+
E.length > 0 && /* @__PURE__ */ e("p", { className: "nice-invitation-designer__unresolved", children: n(
|
|
2604
2604
|
"invitationDesigner.noPreviewValueFor",
|
|
2605
2605
|
"No preview value for: {unresolved}"
|
|
2606
|
-
).replace("{unresolved}", String(
|
|
2606
|
+
).replace("{unresolved}", String(E.map((b) => zn(b)).join(", "))) })
|
|
2607
2607
|
]
|
|
2608
2608
|
}
|
|
2609
2609
|
),
|
|
@@ -2617,7 +2617,7 @@ const xi = { name: "", body: "" }, Ii = [
|
|
|
2617
2617
|
")"
|
|
2618
2618
|
] })
|
|
2619
2619
|
] }) }),
|
|
2620
|
-
|
|
2620
|
+
o && !g && /* @__PURE__ */ s(Ke, { children: [
|
|
2621
2621
|
/* @__PURE__ */ e(
|
|
2622
2622
|
on,
|
|
2623
2623
|
{
|
|
@@ -2630,18 +2630,18 @@ const xi = { name: "", body: "" }, Ii = [
|
|
|
2630
2630
|
),
|
|
2631
2631
|
rows: 3,
|
|
2632
2632
|
disabled: M,
|
|
2633
|
-
size:
|
|
2633
|
+
size: I
|
|
2634
2634
|
}
|
|
2635
2635
|
),
|
|
2636
2636
|
/* @__PURE__ */ s("div", { className: "nice-invitation-designer__paste-actions", children: [
|
|
2637
2637
|
/* @__PURE__ */ e(
|
|
2638
|
-
|
|
2638
|
+
U,
|
|
2639
2639
|
{
|
|
2640
|
-
size:
|
|
2640
|
+
size: I,
|
|
2641
2641
|
variant: "outline",
|
|
2642
2642
|
leftIcon: /* @__PURE__ */ e(Rn, { size: 15 }),
|
|
2643
2643
|
disabled: M || w.valid.length === 0,
|
|
2644
|
-
onClick:
|
|
2644
|
+
onClick: G,
|
|
2645
2645
|
children: w.valid.length > 0 ? n("invitationDesigner.addN", "Add ({count})").replace(
|
|
2646
2646
|
"{count}",
|
|
2647
2647
|
String(w.valid.length)
|
|
@@ -2660,7 +2660,7 @@ const xi = { name: "", body: "" }, Ii = [
|
|
|
2660
2660
|
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: [
|
|
2661
2661
|
/* @__PURE__ */ e("span", { children: b.name ? `${b.name} <${b.email}>` : b.email }),
|
|
2662
2662
|
b.status && b.status !== "pending" && /* @__PURE__ */ e(
|
|
2663
|
-
|
|
2663
|
+
se,
|
|
2664
2664
|
{
|
|
2665
2665
|
size: "xs",
|
|
2666
2666
|
subtle: !0,
|
|
@@ -2668,8 +2668,8 @@ const xi = { name: "", body: "" }, Ii = [
|
|
|
2668
2668
|
children: n(`invitationDesigner.recipientStatus.${b.status}`, b.status)
|
|
2669
2669
|
}
|
|
2670
2670
|
),
|
|
2671
|
-
|
|
2672
|
-
|
|
2671
|
+
o && !g && /* @__PURE__ */ e(
|
|
2672
|
+
U,
|
|
2673
2673
|
{
|
|
2674
2674
|
size: "sm",
|
|
2675
2675
|
variant: "ghost",
|
|
@@ -2679,20 +2679,20 @@ const xi = { name: "", body: "" }, Ii = [
|
|
|
2679
2679
|
),
|
|
2680
2680
|
disabled: M,
|
|
2681
2681
|
onClick: () => C(b.email),
|
|
2682
|
-
children: /* @__PURE__ */ e(
|
|
2682
|
+
children: /* @__PURE__ */ e(Re, { size: 13 })
|
|
2683
2683
|
}
|
|
2684
2684
|
)
|
|
2685
2685
|
] }, b.email)) }),
|
|
2686
2686
|
m && !g && /* @__PURE__ */ e(
|
|
2687
|
-
|
|
2687
|
+
U,
|
|
2688
2688
|
{
|
|
2689
2689
|
variant: "primary",
|
|
2690
|
-
size:
|
|
2691
|
-
leftIcon: /* @__PURE__ */ e(
|
|
2690
|
+
size: I,
|
|
2691
|
+
leftIcon: /* @__PURE__ */ e(St, { size: 15 }),
|
|
2692
2692
|
loading: h,
|
|
2693
2693
|
ariaLabel: n("invitationDesigner.sendInvitations", "Send invitations"),
|
|
2694
|
-
disabled:
|
|
2695
|
-
onClick: () => m({ templateId:
|
|
2694
|
+
disabled: _ || h || c.length === 0,
|
|
2695
|
+
onClick: () => m({ templateId: v.id, emails: F }),
|
|
2696
2696
|
children: h ? n("invitationDesigner.sending", "Sending…") : n("invitationDesigner.sendTo", "Send to {count}").replace(
|
|
2697
2697
|
"{count}",
|
|
2698
2698
|
String(c.length)
|
|
@@ -2703,66 +2703,66 @@ const xi = { name: "", body: "" }, Ii = [
|
|
|
2703
2703
|
]
|
|
2704
2704
|
}
|
|
2705
2705
|
);
|
|
2706
|
-
}),
|
|
2706
|
+
}), Ti = ({
|
|
2707
2707
|
value: a,
|
|
2708
2708
|
max: i,
|
|
2709
2709
|
currency: r,
|
|
2710
2710
|
locale: n,
|
|
2711
2711
|
label: t,
|
|
2712
|
-
className:
|
|
2712
|
+
className: l
|
|
2713
2713
|
}) => {
|
|
2714
|
-
const
|
|
2714
|
+
const d = i > 0 ? i : 1, u = a >= i && i > 0, f = (c, o) => r ? `${ce(c, r, n)} / ${ce(o, r, n)}` : `${c} / ${o}`;
|
|
2715
2715
|
return /* @__PURE__ */ e(
|
|
2716
|
-
|
|
2716
|
+
Ut,
|
|
2717
2717
|
{
|
|
2718
|
-
className:
|
|
2719
|
-
value: Math.min(a,
|
|
2720
|
-
max:
|
|
2718
|
+
className: l,
|
|
2719
|
+
value: Math.min(a, d),
|
|
2720
|
+
max: d,
|
|
2721
2721
|
variant: u ? "success" : "primary",
|
|
2722
2722
|
size: "sm",
|
|
2723
2723
|
showValue: !0,
|
|
2724
|
-
formatValue: () =>
|
|
2724
|
+
formatValue: () => f(a, i),
|
|
2725
2725
|
"aria-label": t
|
|
2726
2726
|
}
|
|
2727
2727
|
);
|
|
2728
|
-
},
|
|
2729
|
-
function
|
|
2728
|
+
}, Mi = [];
|
|
2729
|
+
function Li(a, i) {
|
|
2730
2730
|
if (i === "wishlist")
|
|
2731
2731
|
return { value: a.isPurchased ? 1 : 0, max: 1, complete: !!a.isPurchased };
|
|
2732
2732
|
const r = a.quantityNeeded ?? 1, n = a.quantityContributed ?? 0;
|
|
2733
2733
|
return { value: n, max: r, complete: r > 0 && n >= r };
|
|
2734
2734
|
}
|
|
2735
|
-
const
|
|
2735
|
+
const da = /* @__PURE__ */ ie(
|
|
2736
2736
|
function(i, r) {
|
|
2737
|
-
const { t: n } =
|
|
2738
|
-
items: t =
|
|
2739
|
-
kind:
|
|
2740
|
-
mode:
|
|
2737
|
+
const { t: n } = J(), {
|
|
2738
|
+
items: t = Mi,
|
|
2739
|
+
kind: l = "registry",
|
|
2740
|
+
mode: d = "owner",
|
|
2741
2741
|
currency: u = "PLN",
|
|
2742
|
-
locale:
|
|
2742
|
+
locale: f,
|
|
2743
2743
|
hideContributors: c = !1,
|
|
2744
|
-
currentUserId:
|
|
2744
|
+
currentUserId: o,
|
|
2745
2745
|
currentUserName: m,
|
|
2746
2746
|
onContribute: h,
|
|
2747
2747
|
onClaim: z,
|
|
2748
|
-
onUnclaim:
|
|
2748
|
+
onUnclaim: _,
|
|
2749
2749
|
onItemAdd: g,
|
|
2750
|
-
onItemDelete:
|
|
2750
|
+
onItemDelete: I,
|
|
2751
2751
|
onItemClick: k,
|
|
2752
2752
|
layout: T = "grid",
|
|
2753
|
-
disabled:
|
|
2753
|
+
disabled: v = !1,
|
|
2754
2754
|
readOnly: p = !1,
|
|
2755
2755
|
size: A = "md",
|
|
2756
2756
|
className: y,
|
|
2757
2757
|
style: M
|
|
2758
|
-
} = i, w = qn({ currentUserId:
|
|
2759
|
-
(
|
|
2758
|
+
} = i, w = qn({ currentUserId: o, currentUserName: m }), [N, P] = D(null), [E, F] = D(0), [X, L] = D(""), G = d === "owner", C = v || p, b = l === "wishlist", R = V(() => b ? [...t].sort(
|
|
2759
|
+
(x, B) => Number(x.isPurchased ?? !1) - Number(B.isPurchased ?? !1) || (B.priority ?? 0) - (x.priority ?? 0)
|
|
2760
2760
|
) : t, [t, b]), j = () => {
|
|
2761
|
-
|
|
2762
|
-
},
|
|
2763
|
-
!h || !w.canAct || (h(
|
|
2764
|
-
amount:
|
|
2765
|
-
quantity:
|
|
2761
|
+
P(null), F(0);
|
|
2762
|
+
}, K = (x) => {
|
|
2763
|
+
!h || !w.canAct || (h(x.id, {
|
|
2764
|
+
amount: E > 0 ? E : void 0,
|
|
2765
|
+
quantity: E > 0 ? void 0 : 1,
|
|
2766
2766
|
userName: w.actor.userName,
|
|
2767
2767
|
userId: w.actor.userId
|
|
2768
2768
|
}), j());
|
|
@@ -2770,19 +2770,19 @@ const ca = /* @__PURE__ */ te(
|
|
|
2770
2770
|
return t.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-gift-registry ${y ?? ""}`, style: M, children: /* @__PURE__ */ e(
|
|
2771
2771
|
Ne,
|
|
2772
2772
|
{
|
|
2773
|
-
icon: /* @__PURE__ */ e(
|
|
2773
|
+
icon: /* @__PURE__ */ e(Ct, { size: 28 }),
|
|
2774
2774
|
title: b ? n("giftRegistry.emptyWishlist", "Nothing on the wishlist yet") : n("giftRegistry.emptyRegistry", "No gifts on the registry yet"),
|
|
2775
|
-
description:
|
|
2775
|
+
description: G ? n("giftRegistry.emptyOwnerHint", "Add what you would like and share the link.") : n("giftRegistry.emptyGuestHint", "The host has not added anything yet.")
|
|
2776
2776
|
}
|
|
2777
2777
|
) }) : /* @__PURE__ */ s(
|
|
2778
2778
|
"div",
|
|
2779
2779
|
{
|
|
2780
2780
|
ref: r,
|
|
2781
|
-
className: `nice-gift-registry nice-gift-registry--${
|
|
2781
|
+
className: `nice-gift-registry nice-gift-registry--${l} nice-gift-registry--${T} nice-gift-registry--${A} ${y ?? ""}`,
|
|
2782
2782
|
style: M,
|
|
2783
2783
|
children: [
|
|
2784
|
-
!
|
|
2785
|
-
|
|
2784
|
+
!G && w.isAnonymous && (h || z) && /* @__PURE__ */ e(
|
|
2785
|
+
Z,
|
|
2786
2786
|
{
|
|
2787
2787
|
label: n("giftRegistry.yourName", "Your name"),
|
|
2788
2788
|
value: w.name,
|
|
@@ -2793,17 +2793,17 @@ const ca = /* @__PURE__ */ te(
|
|
|
2793
2793
|
size: A
|
|
2794
2794
|
}
|
|
2795
2795
|
),
|
|
2796
|
-
/* @__PURE__ */ e(Un, { columns: T === "list" ? 1 : void 0, minColumnWidth: 240, gap: 12, children:
|
|
2797
|
-
const { value:
|
|
2796
|
+
/* @__PURE__ */ e(Un, { columns: T === "list" ? 1 : void 0, minColumnWidth: 240, gap: 12, children: R.map((x) => {
|
|
2797
|
+
const { value: B, max: q, complete: ee } = Li(x, l), Y = x.price, ne = x.contributions ?? [];
|
|
2798
2798
|
return /* @__PURE__ */ s(
|
|
2799
2799
|
"div",
|
|
2800
2800
|
{
|
|
2801
|
-
className: `nice-gift-registry__item${
|
|
2801
|
+
className: `nice-gift-registry__item${ee ? " nice-gift-registry__item--complete" : ""}`,
|
|
2802
2802
|
children: [
|
|
2803
|
-
|
|
2803
|
+
x.imageUrl && /* @__PURE__ */ e(
|
|
2804
2804
|
"img",
|
|
2805
2805
|
{
|
|
2806
|
-
src:
|
|
2806
|
+
src: x.imageUrl,
|
|
2807
2807
|
alt: "",
|
|
2808
2808
|
className: "nice-gift-registry__image",
|
|
2809
2809
|
loading: "lazy"
|
|
@@ -2815,29 +2815,29 @@ const ca = /* @__PURE__ */ te(
|
|
|
2815
2815
|
{
|
|
2816
2816
|
type: "button",
|
|
2817
2817
|
className: "nice-gift-registry__title",
|
|
2818
|
-
onClick: () => k == null ? void 0 : k(
|
|
2818
|
+
onClick: () => k == null ? void 0 : k(x),
|
|
2819
2819
|
disabled: !k,
|
|
2820
|
-
children:
|
|
2820
|
+
children: x.title
|
|
2821
2821
|
}
|
|
2822
2822
|
),
|
|
2823
|
-
|
|
2823
|
+
x.description && /* @__PURE__ */ e("p", { className: "nice-gift-registry__description", children: x.description }),
|
|
2824
2824
|
/* @__PURE__ */ s("div", { className: "nice-gift-registry__facts", children: [
|
|
2825
|
-
|
|
2826
|
-
b && (
|
|
2827
|
-
/* @__PURE__ */ e(
|
|
2825
|
+
Y && /* @__PURE__ */ e("span", { className: "nice-gift-registry__price", children: ce(Y.amount, Y.currency || u, f) }),
|
|
2826
|
+
b && (x.priority ?? 0) > 0 && /* @__PURE__ */ s(se, { size: "xs", subtle: !0, variant: "warning", children: [
|
|
2827
|
+
/* @__PURE__ */ e(xt, { size: 11 }),
|
|
2828
2828
|
" ",
|
|
2829
|
-
|
|
2829
|
+
x.priority
|
|
2830
2830
|
] }),
|
|
2831
|
-
|
|
2832
|
-
|
|
2831
|
+
ee && /* @__PURE__ */ e(se, { size: "xs", subtle: !0, variant: "success", children: b ? n("giftRegistry.bought", "bought") : n("giftRegistry.fullyCovered", "fully covered") }),
|
|
2832
|
+
x.url && /* @__PURE__ */ s(
|
|
2833
2833
|
"a",
|
|
2834
2834
|
{
|
|
2835
2835
|
className: "nice-gift-registry__link",
|
|
2836
|
-
href:
|
|
2836
|
+
href: x.url,
|
|
2837
2837
|
target: "_blank",
|
|
2838
2838
|
rel: "noopener noreferrer",
|
|
2839
2839
|
children: [
|
|
2840
|
-
/* @__PURE__ */ e(
|
|
2840
|
+
/* @__PURE__ */ e(It, { size: 13 }),
|
|
2841
2841
|
" ",
|
|
2842
2842
|
n("giftRegistry.shop", "Shop")
|
|
2843
2843
|
]
|
|
@@ -2845,81 +2845,81 @@ const ca = /* @__PURE__ */ te(
|
|
|
2845
2845
|
)
|
|
2846
2846
|
] }),
|
|
2847
2847
|
!b && /* @__PURE__ */ e(
|
|
2848
|
-
|
|
2848
|
+
Ti,
|
|
2849
2849
|
{
|
|
2850
|
-
value:
|
|
2851
|
-
max:
|
|
2852
|
-
label: n("giftRegistry.covered", "{name}: {value} of {max} covered").replace("{name}",
|
|
2850
|
+
value: B,
|
|
2851
|
+
max: q,
|
|
2852
|
+
label: n("giftRegistry.covered", "{name}: {value} of {max} covered").replace("{name}", x.title).replace("{value}", String(B)).replace("{max}", String(q))
|
|
2853
2853
|
}
|
|
2854
2854
|
),
|
|
2855
|
-
!c &&
|
|
2856
|
-
/* @__PURE__ */ e("strong", { children:
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2855
|
+
!c && ne.length > 0 && /* @__PURE__ */ e("ul", { className: "nice-gift-registry__contributors", children: ne.map((te) => /* @__PURE__ */ s("li", { className: "nice-gift-registry__contributor", children: [
|
|
2856
|
+
/* @__PURE__ */ e("strong", { children: te.contributorName }),
|
|
2857
|
+
te.amount !== void 0 && ` — ${ce(te.amount, (Y == null ? void 0 : Y.currency) || u, f)}`,
|
|
2858
|
+
te.amount === void 0 && te.quantity ? ` — ${te.quantity}×` : "",
|
|
2859
|
+
te.message && /* @__PURE__ */ s("em", { children: [
|
|
2860
2860
|
" “",
|
|
2861
|
-
|
|
2861
|
+
te.message,
|
|
2862
2862
|
"”"
|
|
2863
2863
|
] })
|
|
2864
|
-
] },
|
|
2864
|
+
] }, te.id)) }),
|
|
2865
2865
|
/* @__PURE__ */ s("div", { className: "nice-gift-registry__actions", children: [
|
|
2866
|
-
!
|
|
2867
|
-
|
|
2866
|
+
!G && !ee && z && /* @__PURE__ */ e(
|
|
2867
|
+
U,
|
|
2868
2868
|
{
|
|
2869
2869
|
size: "sm",
|
|
2870
2870
|
variant: "primary",
|
|
2871
2871
|
disabled: C || !w.canAct,
|
|
2872
|
-
leftIcon: /* @__PURE__ */ e(
|
|
2873
|
-
onClick: () => z(
|
|
2872
|
+
leftIcon: /* @__PURE__ */ e(He, { size: 14 }),
|
|
2873
|
+
onClick: () => z(x.id, { ...w.actor, quantity: 1 }),
|
|
2874
2874
|
children: n("giftRegistry.illTakeThis", "I'll take this")
|
|
2875
2875
|
}
|
|
2876
2876
|
),
|
|
2877
|
-
!
|
|
2878
|
-
|
|
2877
|
+
!G && ee && _ && /* @__PURE__ */ e(
|
|
2878
|
+
U,
|
|
2879
2879
|
{
|
|
2880
2880
|
size: "sm",
|
|
2881
2881
|
variant: "ghost",
|
|
2882
2882
|
disabled: C,
|
|
2883
|
-
onClick: () =>
|
|
2883
|
+
onClick: () => _(x.id),
|
|
2884
2884
|
children: n("giftRegistry.release", "Release")
|
|
2885
2885
|
}
|
|
2886
2886
|
),
|
|
2887
|
-
!
|
|
2888
|
-
|
|
2887
|
+
!G && !ee && !b && h && /* @__PURE__ */ e(
|
|
2888
|
+
U,
|
|
2889
2889
|
{
|
|
2890
2890
|
size: "sm",
|
|
2891
2891
|
variant: "outline",
|
|
2892
2892
|
disabled: C || !w.canAct,
|
|
2893
|
-
onClick: () =>
|
|
2893
|
+
onClick: () => P(N === x.id ? null : x.id),
|
|
2894
2894
|
children: n("giftRegistry.chipIn", "Chip in")
|
|
2895
2895
|
}
|
|
2896
2896
|
),
|
|
2897
|
-
|
|
2898
|
-
|
|
2897
|
+
G && I && !p && /* @__PURE__ */ e(
|
|
2898
|
+
U,
|
|
2899
2899
|
{
|
|
2900
2900
|
size: "sm",
|
|
2901
2901
|
variant: "ghost",
|
|
2902
2902
|
ariaLabel: n("giftRegistry.deleteItem", "Delete {name}").replace(
|
|
2903
2903
|
"{name}",
|
|
2904
|
-
|
|
2904
|
+
x.title
|
|
2905
2905
|
),
|
|
2906
|
-
disabled:
|
|
2907
|
-
onClick: () =>
|
|
2908
|
-
children: /* @__PURE__ */ e(
|
|
2906
|
+
disabled: v,
|
|
2907
|
+
onClick: () => I(x.id),
|
|
2908
|
+
children: /* @__PURE__ */ e(Re, { size: 14 })
|
|
2909
2909
|
}
|
|
2910
2910
|
)
|
|
2911
2911
|
] }),
|
|
2912
|
-
N ===
|
|
2912
|
+
N === x.id && /* @__PURE__ */ s("div", { className: "nice-gift-registry__pledge", children: [
|
|
2913
2913
|
/* @__PURE__ */ s("label", { className: "nice-gift-registry__pledge-field", children: [
|
|
2914
2914
|
/* @__PURE__ */ e("span", { children: n("giftRegistry.amount", "Amount ({currency})").replace(
|
|
2915
2915
|
"{currency}",
|
|
2916
|
-
String((
|
|
2916
|
+
String((Y == null ? void 0 : Y.currency) || u)
|
|
2917
2917
|
) }),
|
|
2918
2918
|
/* @__PURE__ */ e(
|
|
2919
2919
|
dn,
|
|
2920
2920
|
{
|
|
2921
|
-
value:
|
|
2922
|
-
onChange: (
|
|
2921
|
+
value: E,
|
|
2922
|
+
onChange: (te) => F(Math.max(0, te ?? 0)),
|
|
2923
2923
|
min: 0,
|
|
2924
2924
|
size: "xs",
|
|
2925
2925
|
disabled: C
|
|
@@ -2927,44 +2927,44 @@ const ca = /* @__PURE__ */ te(
|
|
|
2927
2927
|
)
|
|
2928
2928
|
] }),
|
|
2929
2929
|
/* @__PURE__ */ e(
|
|
2930
|
-
|
|
2930
|
+
U,
|
|
2931
2931
|
{
|
|
2932
2932
|
size: "sm",
|
|
2933
2933
|
variant: "primary",
|
|
2934
2934
|
disabled: C || !w.canAct,
|
|
2935
|
-
onClick: () =>
|
|
2935
|
+
onClick: () => K(x),
|
|
2936
2936
|
children: n("giftRegistry.confirm", "Confirm")
|
|
2937
2937
|
}
|
|
2938
2938
|
),
|
|
2939
|
-
/* @__PURE__ */ e(
|
|
2939
|
+
/* @__PURE__ */ e(U, { size: "sm", variant: "ghost", onClick: j, children: n("giftRegistry.cancel", "Cancel") })
|
|
2940
2940
|
] })
|
|
2941
2941
|
] })
|
|
2942
2942
|
]
|
|
2943
2943
|
},
|
|
2944
|
-
|
|
2944
|
+
x.id
|
|
2945
2945
|
);
|
|
2946
2946
|
}) }),
|
|
2947
|
-
|
|
2947
|
+
G && g && !p && /* @__PURE__ */ s("div", { className: "nice-gift-registry__add", children: [
|
|
2948
2948
|
/* @__PURE__ */ e(
|
|
2949
|
-
|
|
2949
|
+
Z,
|
|
2950
2950
|
{
|
|
2951
2951
|
label: b ? n("giftRegistry.addAWish", "Add a wish") : n("giftRegistry.addAGift", "Add a gift"),
|
|
2952
|
-
value:
|
|
2953
|
-
onChange:
|
|
2952
|
+
value: X,
|
|
2953
|
+
onChange: L,
|
|
2954
2954
|
placeholder: n("giftRegistry.whatWouldYouLike", "What would you like?"),
|
|
2955
|
-
disabled:
|
|
2955
|
+
disabled: v,
|
|
2956
2956
|
size: A
|
|
2957
2957
|
}
|
|
2958
2958
|
),
|
|
2959
2959
|
/* @__PURE__ */ e(
|
|
2960
|
-
|
|
2960
|
+
U,
|
|
2961
2961
|
{
|
|
2962
2962
|
variant: "primary",
|
|
2963
2963
|
size: A,
|
|
2964
2964
|
leftIcon: /* @__PURE__ */ e(an, { size: 15 }),
|
|
2965
|
-
disabled:
|
|
2965
|
+
disabled: v || !X.trim(),
|
|
2966
2966
|
onClick: () => {
|
|
2967
|
-
g({ title:
|
|
2967
|
+
g({ title: X.trim(), quantityNeeded: 1 }), L("");
|
|
2968
2968
|
},
|
|
2969
2969
|
children: n("giftRegistry.add", "Add")
|
|
2970
2970
|
}
|
|
@@ -2975,7 +2975,7 @@ const ca = /* @__PURE__ */ te(
|
|
|
2975
2975
|
);
|
|
2976
2976
|
}
|
|
2977
2977
|
);
|
|
2978
|
-
function
|
|
2978
|
+
function $i(a) {
|
|
2979
2979
|
const i = /* @__PURE__ */ new Map();
|
|
2980
2980
|
for (const r of a) {
|
|
2981
2981
|
const n = (r.currency || "").toUpperCase(), t = i.get(n);
|
|
@@ -2983,48 +2983,48 @@ function Ti(a) {
|
|
|
2983
2983
|
}
|
|
2984
2984
|
return i;
|
|
2985
2985
|
}
|
|
2986
|
-
function
|
|
2987
|
-
var
|
|
2988
|
-
const n = new Set(i.map((c) => c.id)), t = i.map((c) => c.id),
|
|
2986
|
+
function Ri(a, i, r) {
|
|
2987
|
+
var f;
|
|
2988
|
+
const n = new Set(i.map((c) => c.id)), t = i.map((c) => c.id), l = new Map(t.map((c) => [c, 0])), d = [];
|
|
2989
2989
|
let u = 0;
|
|
2990
2990
|
if (t.length === 0)
|
|
2991
2991
|
return {
|
|
2992
|
-
balances:
|
|
2992
|
+
balances: l,
|
|
2993
2993
|
issues: a.map((c) => ({ itemId: c.id, reason: "no-participants" })),
|
|
2994
2994
|
totalMinor: 0
|
|
2995
2995
|
};
|
|
2996
2996
|
for (const c of a) {
|
|
2997
|
-
const
|
|
2998
|
-
if (!
|
|
2999
|
-
|
|
2997
|
+
const o = c.paidById;
|
|
2998
|
+
if (!o) {
|
|
2999
|
+
d.push({ itemId: c.id, reason: "no-payer" });
|
|
3000
3000
|
continue;
|
|
3001
3001
|
}
|
|
3002
|
-
if (!n.has(
|
|
3003
|
-
|
|
3002
|
+
if (!n.has(o)) {
|
|
3003
|
+
d.push({ itemId: c.id, reason: "unknown-payer" });
|
|
3004
3004
|
continue;
|
|
3005
3005
|
}
|
|
3006
|
-
let m = (
|
|
3006
|
+
let m = (f = c.splitAmong) != null && f.length ? c.splitAmong.filter((k) => n.has(k)) : t;
|
|
3007
3007
|
m.length === 0 && (m = t);
|
|
3008
3008
|
const h = pn(c.amount, r);
|
|
3009
3009
|
u += h;
|
|
3010
|
-
const z = m.length,
|
|
3010
|
+
const z = m.length, _ = Math.floor(h / z), g = h - _ * z, I = new Map(m.map((k) => [k, _]));
|
|
3011
3011
|
if (g !== 0)
|
|
3012
|
-
if (
|
|
3013
|
-
|
|
3012
|
+
if (I.has(o))
|
|
3013
|
+
I.set(o, (I.get(o) ?? 0) + g);
|
|
3014
3014
|
else {
|
|
3015
|
-
const k = [...m].sort(
|
|
3016
|
-
for (let
|
|
3017
|
-
const p = k[
|
|
3018
|
-
|
|
3015
|
+
const k = [...m].sort(Ge), T = g > 0 ? 1 : -1;
|
|
3016
|
+
for (let v = 0; v < Math.abs(g); v += 1) {
|
|
3017
|
+
const p = k[v % k.length];
|
|
3018
|
+
I.set(p, (I.get(p) ?? 0) + T);
|
|
3019
3019
|
}
|
|
3020
3020
|
}
|
|
3021
|
-
|
|
3022
|
-
for (const [k, T] of
|
|
3023
|
-
|
|
3021
|
+
l.set(o, (l.get(o) ?? 0) + h);
|
|
3022
|
+
for (const [k, T] of I)
|
|
3023
|
+
l.set(k, (l.get(k) ?? 0) - T);
|
|
3024
3024
|
}
|
|
3025
|
-
return { balances:
|
|
3025
|
+
return { balances: l, issues: d, totalMinor: u };
|
|
3026
3026
|
}
|
|
3027
|
-
function
|
|
3027
|
+
function Di(a, i, r) {
|
|
3028
3028
|
for (const n of i) {
|
|
3029
3029
|
if ((n.currency || "").toUpperCase() !== r || !a.has(n.fromId) || !a.has(n.toId))
|
|
3030
3030
|
continue;
|
|
@@ -3032,88 +3032,88 @@ function $i(a, i, r) {
|
|
|
3032
3032
|
a.set(n.fromId, (a.get(n.fromId) ?? 0) + t), a.set(n.toId, (a.get(n.toId) ?? 0) - t);
|
|
3033
3033
|
}
|
|
3034
3034
|
}
|
|
3035
|
-
function
|
|
3036
|
-
const n = new Map(i.map((c) => [c.id, c.name])), t = [...a.entries()].filter(([, c]) => c > 0).map(([c,
|
|
3037
|
-
let u = 0,
|
|
3038
|
-
for (; u <
|
|
3039
|
-
const c = Math.min(-
|
|
3040
|
-
c > 0 &&
|
|
3041
|
-
fromId:
|
|
3042
|
-
fromName: n.get(
|
|
3043
|
-
toId: t[
|
|
3044
|
-
toName: n.get(t[
|
|
3045
|
-
amount:
|
|
3035
|
+
function Ei(a, i, r) {
|
|
3036
|
+
const n = new Map(i.map((c) => [c.id, c.name])), t = [...a.entries()].filter(([, c]) => c > 0).map(([c, o]) => ({ id: c, v: o })).sort((c, o) => o.v - c.v || Ge(c.id, o.id)), l = [...a.entries()].filter(([, c]) => c < 0).map(([c, o]) => ({ id: c, v: o })).sort((c, o) => c.v - o.v || Ge(c.id, o.id)), d = [];
|
|
3037
|
+
let u = 0, f = 0;
|
|
3038
|
+
for (; u < l.length && f < t.length; ) {
|
|
3039
|
+
const c = Math.min(-l[u].v, t[f].v);
|
|
3040
|
+
c > 0 && d.push({
|
|
3041
|
+
fromId: l[u].id,
|
|
3042
|
+
fromName: n.get(l[u].id) ?? l[u].id,
|
|
3043
|
+
toId: t[f].id,
|
|
3044
|
+
toName: n.get(t[f].id) ?? t[f].id,
|
|
3045
|
+
amount: We(c, r),
|
|
3046
3046
|
currency: r
|
|
3047
|
-
}),
|
|
3047
|
+
}), l[u].v += c, t[f].v -= c, l[u].v === 0 && (u += 1), t[f].v === 0 && (f += 1);
|
|
3048
3048
|
}
|
|
3049
|
-
return
|
|
3049
|
+
return d;
|
|
3050
3050
|
}
|
|
3051
|
-
function
|
|
3052
|
-
const n = [], t = [],
|
|
3053
|
-
for (const [
|
|
3054
|
-
const
|
|
3055
|
-
t.push(...
|
|
3056
|
-
currency:
|
|
3057
|
-
total:
|
|
3051
|
+
function Oi(a, i, r = []) {
|
|
3052
|
+
const n = [], t = [], l = [...$i(a).entries()].sort(([d], [u]) => Ge(d, u));
|
|
3053
|
+
for (const [d, u] of l) {
|
|
3054
|
+
const f = Ri(u, i, d);
|
|
3055
|
+
t.push(...f.issues), Di(f.balances, r, d), n.push({
|
|
3056
|
+
currency: d,
|
|
3057
|
+
total: We(f.totalMinor, d),
|
|
3058
3058
|
balances: i.map((c) => ({
|
|
3059
3059
|
participantId: c.id,
|
|
3060
3060
|
participantName: c.name,
|
|
3061
|
-
amount:
|
|
3062
|
-
currency:
|
|
3061
|
+
amount: We(f.balances.get(c.id) ?? 0, d),
|
|
3062
|
+
currency: d
|
|
3063
3063
|
})),
|
|
3064
|
-
transfers:
|
|
3064
|
+
transfers: Ei(f.balances, i, d)
|
|
3065
3065
|
});
|
|
3066
3066
|
}
|
|
3067
3067
|
return { groups: n, issues: t };
|
|
3068
3068
|
}
|
|
3069
|
-
function
|
|
3069
|
+
function Ge(a, i) {
|
|
3070
3070
|
return a < i ? -1 : a > i ? 1 : 0;
|
|
3071
3071
|
}
|
|
3072
|
-
const
|
|
3072
|
+
const Yi = [], Bi = [], ua = /* @__PURE__ */ ie(
|
|
3073
3073
|
function(i, r) {
|
|
3074
|
-
const { t: n } =
|
|
3075
|
-
items: t =
|
|
3076
|
-
participants:
|
|
3077
|
-
settlements:
|
|
3074
|
+
const { t: n } = J(), {
|
|
3075
|
+
items: t = Yi,
|
|
3076
|
+
participants: l = Bi,
|
|
3077
|
+
settlements: d = [],
|
|
3078
3078
|
view: u,
|
|
3079
|
-
defaultView:
|
|
3079
|
+
defaultView: f = "expenses",
|
|
3080
3080
|
onViewChange: c,
|
|
3081
|
-
onSettle:
|
|
3081
|
+
onSettle: o,
|
|
3082
3082
|
onItemDelete: m,
|
|
3083
3083
|
onItemClick: h,
|
|
3084
3084
|
onValidationChange: z,
|
|
3085
|
-
sortBy:
|
|
3085
|
+
sortBy: _ = "date",
|
|
3086
3086
|
locale: g,
|
|
3087
|
-
disabled:
|
|
3087
|
+
disabled: I = !1,
|
|
3088
3088
|
readOnly: k = !1,
|
|
3089
3089
|
size: T = "md",
|
|
3090
|
-
className:
|
|
3090
|
+
className: v,
|
|
3091
3091
|
style: p
|
|
3092
|
-
} = i, [A, y] = D(
|
|
3093
|
-
() =>
|
|
3094
|
-
[
|
|
3095
|
-
),
|
|
3096
|
-
if (
|
|
3092
|
+
} = i, [A, y] = D(f), M = u ?? A, w = I || k, N = V(
|
|
3093
|
+
() => l.map((C) => ({ id: C.id, name: C.name })),
|
|
3094
|
+
[l]
|
|
3095
|
+
), P = V(() => Oi(t, N, d), [t, N, d]), E = V(() => _ === "none" ? t : t.map((C, b) => ({ item: C, index: b })).sort((C, b) => {
|
|
3096
|
+
if (_ === "amount")
|
|
3097
3097
|
return b.item.amount - C.item.amount || C.index - b.index;
|
|
3098
|
-
const
|
|
3099
|
-
return
|
|
3100
|
-
}).map((C) => C.item), [t,
|
|
3101
|
-
|
|
3102
|
-
z == null || z(
|
|
3103
|
-
}, [
|
|
3104
|
-
const
|
|
3105
|
-
() => new Map(
|
|
3106
|
-
[
|
|
3107
|
-
),
|
|
3108
|
-
() => new Map(
|
|
3109
|
-
[
|
|
3110
|
-
),
|
|
3098
|
+
const R = C.item.incurredAt, j = b.item.incurredAt;
|
|
3099
|
+
return R && j ? R.localeCompare(j) || C.index - b.index : R ? -1 : j ? 1 : C.index - b.index;
|
|
3100
|
+
}).map((C) => C.item), [t, _]), F = P.issues.map((C) => `${C.itemId}:${C.reason}`).join("|");
|
|
3101
|
+
$e.useEffect(() => {
|
|
3102
|
+
z == null || z(P.issues);
|
|
3103
|
+
}, [F]);
|
|
3104
|
+
const X = V(
|
|
3105
|
+
() => new Map(l.map((C) => [C.id, C.avatarUrl])),
|
|
3106
|
+
[l]
|
|
3107
|
+
), L = V(
|
|
3108
|
+
() => new Map(P.issues.map((C) => [C.itemId, C.reason])),
|
|
3109
|
+
[P.issues]
|
|
3110
|
+
), G = (C) => {
|
|
3111
3111
|
u === void 0 && y(C), c == null || c(C);
|
|
3112
3112
|
};
|
|
3113
|
-
return t.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-expense-split ${
|
|
3113
|
+
return t.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-expense-split ${v ?? ""}`, style: p, children: /* @__PURE__ */ e(
|
|
3114
3114
|
Ne,
|
|
3115
3115
|
{
|
|
3116
|
-
icon: /* @__PURE__ */ e(
|
|
3116
|
+
icon: /* @__PURE__ */ e(Pt, { size: 28 }),
|
|
3117
3117
|
title: n("expenseSplit.noExpensesYet", "No expenses yet"),
|
|
3118
3118
|
description: n(
|
|
3119
3119
|
"expenseSplit.addWhatPeoplePaidFor",
|
|
@@ -3124,7 +3124,7 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3124
3124
|
"div",
|
|
3125
3125
|
{
|
|
3126
3126
|
ref: r,
|
|
3127
|
-
className: `nice-expense-split nice-expense-split--${T} ${
|
|
3127
|
+
className: `nice-expense-split nice-expense-split--${T} ${v ?? ""}`,
|
|
3128
3128
|
style: p,
|
|
3129
3129
|
children: [
|
|
3130
3130
|
/* @__PURE__ */ e(
|
|
@@ -3132,7 +3132,7 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3132
3132
|
{
|
|
3133
3133
|
size: T,
|
|
3134
3134
|
value: M,
|
|
3135
|
-
onChange: (C) =>
|
|
3135
|
+
onChange: (C) => G(C),
|
|
3136
3136
|
options: [
|
|
3137
3137
|
{ value: "expenses", label: n("expenseSplit.expenses", "Expenses") },
|
|
3138
3138
|
{ value: "balances", label: n("expenseSplit.balances", "Balances") },
|
|
@@ -3140,8 +3140,8 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3140
3140
|
]
|
|
3141
3141
|
}
|
|
3142
3142
|
),
|
|
3143
|
-
M === "expenses" && /* @__PURE__ */ e("ul", { className: "nice-expense-split__items", children:
|
|
3144
|
-
const b =
|
|
3143
|
+
M === "expenses" && /* @__PURE__ */ e("ul", { className: "nice-expense-split__items", children: E.map((C) => {
|
|
3144
|
+
const b = L.get(C.id);
|
|
3145
3145
|
return /* @__PURE__ */ s(
|
|
3146
3146
|
"li",
|
|
3147
3147
|
{
|
|
@@ -3164,10 +3164,10 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3164
3164
|
}
|
|
3165
3165
|
),
|
|
3166
3166
|
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-amount", children: ce(C.amount, C.currency, g) }),
|
|
3167
|
-
C.isPaid && /* @__PURE__ */ e(
|
|
3168
|
-
b && /* @__PURE__ */ e(
|
|
3167
|
+
C.isPaid && /* @__PURE__ */ e(se, { size: "xs", subtle: !0, variant: "success", children: n("expenseSplit.paid", "paid") }),
|
|
3168
|
+
b && /* @__PURE__ */ e(se, { size: "xs", subtle: !0, variant: "warning", children: b === "no-payer" ? n("expenseSplit.noPayer", "no payer") : n("expenseSplit.unknownPayer", "unknown payer") }),
|
|
3169
3169
|
m && !k && /* @__PURE__ */ e(
|
|
3170
|
-
|
|
3170
|
+
U,
|
|
3171
3171
|
{
|
|
3172
3172
|
size: "sm",
|
|
3173
3173
|
variant: "ghost",
|
|
@@ -3175,9 +3175,9 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3175
3175
|
"{name}",
|
|
3176
3176
|
C.label
|
|
3177
3177
|
),
|
|
3178
|
-
disabled:
|
|
3178
|
+
disabled: I,
|
|
3179
3179
|
onClick: () => m(C.id),
|
|
3180
|
-
children: /* @__PURE__ */ e(
|
|
3180
|
+
children: /* @__PURE__ */ e(Re, { size: 14 })
|
|
3181
3181
|
}
|
|
3182
3182
|
)
|
|
3183
3183
|
]
|
|
@@ -3185,7 +3185,7 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3185
3185
|
C.id
|
|
3186
3186
|
);
|
|
3187
3187
|
}) }),
|
|
3188
|
-
M === "balances" &&
|
|
3188
|
+
M === "balances" && P.groups.map((C) => /* @__PURE__ */ s("section", { className: "nice-expense-split__group", children: [
|
|
3189
3189
|
/* @__PURE__ */ s("h4", { className: "nice-expense-split__group-title", children: [
|
|
3190
3190
|
C.currency,
|
|
3191
3191
|
/* @__PURE__ */ e("span", { className: "nice-expense-split__group-total", children: n("expenseSplit.total", "{amount} total").replace(
|
|
@@ -3199,7 +3199,7 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3199
3199
|
participant: {
|
|
3200
3200
|
id: b.participantId,
|
|
3201
3201
|
name: b.participantName,
|
|
3202
|
-
avatarUrl:
|
|
3202
|
+
avatarUrl: X.get(b.participantId)
|
|
3203
3203
|
},
|
|
3204
3204
|
showRole: !1,
|
|
3205
3205
|
showStatus: !1,
|
|
@@ -3225,17 +3225,17 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3225
3225
|
b.participantId
|
|
3226
3226
|
)) })
|
|
3227
3227
|
] }, C.currency)),
|
|
3228
|
-
M === "settlement" && (
|
|
3228
|
+
M === "settlement" && (P.groups.every((C) => C.transfers.length === 0) ? /* @__PURE__ */ e(
|
|
3229
3229
|
Ne,
|
|
3230
3230
|
{
|
|
3231
|
-
icon: /* @__PURE__ */ e(
|
|
3231
|
+
icon: /* @__PURE__ */ e(zt, { size: 28 }),
|
|
3232
3232
|
title: n("expenseSplit.allSettledUp", "All settled up"),
|
|
3233
3233
|
description: n(
|
|
3234
3234
|
"expenseSplit.nobodyOwesAnybodyAnything",
|
|
3235
3235
|
"Nobody owes anybody anything."
|
|
3236
3236
|
)
|
|
3237
3237
|
}
|
|
3238
|
-
) :
|
|
3238
|
+
) : P.groups.filter((C) => C.transfers.length > 0).map((C) => /* @__PURE__ */ s("section", { className: "nice-expense-split__group", children: [
|
|
3239
3239
|
/* @__PURE__ */ s("h4", { className: "nice-expense-split__group-title", children: [
|
|
3240
3240
|
C.currency,
|
|
3241
3241
|
/* @__PURE__ */ e("span", { className: "nice-expense-split__group-total", children: C.transfers.length === 1 ? n("expenseSplit.transfersOne", "{transfers} transfer").replace(
|
|
@@ -3252,16 +3252,16 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3252
3252
|
className: "nice-expense-split__transfer",
|
|
3253
3253
|
children: [
|
|
3254
3254
|
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-from", children: b.fromName }),
|
|
3255
|
-
/* @__PURE__ */ e(
|
|
3255
|
+
/* @__PURE__ */ e(At, { size: 15 }),
|
|
3256
3256
|
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-to", children: b.toName }),
|
|
3257
3257
|
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-amount", children: ce(b.amount, b.currency, g) }),
|
|
3258
|
-
|
|
3259
|
-
|
|
3258
|
+
o && !k && /* @__PURE__ */ e(
|
|
3259
|
+
U,
|
|
3260
3260
|
{
|
|
3261
3261
|
size: "sm",
|
|
3262
3262
|
variant: "outline",
|
|
3263
3263
|
disabled: w,
|
|
3264
|
-
onClick: () =>
|
|
3264
|
+
onClick: () => o(b),
|
|
3265
3265
|
children: n("expenseSplit.markPaid", "Mark paid")
|
|
3266
3266
|
}
|
|
3267
3267
|
)
|
|
@@ -3274,136 +3274,136 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3274
3274
|
}
|
|
3275
3275
|
);
|
|
3276
3276
|
}
|
|
3277
|
-
),
|
|
3277
|
+
), Ui = [], Vi = {
|
|
3278
3278
|
upcoming: En,
|
|
3279
|
-
active:
|
|
3279
|
+
active: je,
|
|
3280
3280
|
voting: cn,
|
|
3281
|
-
scored:
|
|
3282
|
-
completed:
|
|
3281
|
+
scored: Tt,
|
|
3282
|
+
completed: He,
|
|
3283
3283
|
skipped: rn
|
|
3284
|
-
},
|
|
3284
|
+
}, Fi = {
|
|
3285
3285
|
upcoming: "#9ca3af",
|
|
3286
3286
|
active: "#22c55e",
|
|
3287
3287
|
voting: "#eab308",
|
|
3288
3288
|
scored: "#3b82f6",
|
|
3289
3289
|
completed: "#6b7280",
|
|
3290
3290
|
skipped: "#d1d5db"
|
|
3291
|
-
},
|
|
3291
|
+
}, ma = /* @__PURE__ */ ie(
|
|
3292
3292
|
function(i, r) {
|
|
3293
|
-
const { t: n } =
|
|
3294
|
-
rounds: t =
|
|
3295
|
-
activeRoundId:
|
|
3296
|
-
onSelect:
|
|
3293
|
+
const { t: n } = J(), {
|
|
3294
|
+
rounds: t = Ui,
|
|
3295
|
+
activeRoundId: l,
|
|
3296
|
+
onSelect: d,
|
|
3297
3297
|
onStart: u,
|
|
3298
|
-
onEnd:
|
|
3298
|
+
onEnd: f,
|
|
3299
3299
|
onCreate: c,
|
|
3300
|
-
editable:
|
|
3300
|
+
editable: o = !1,
|
|
3301
3301
|
className: m,
|
|
3302
3302
|
style: h
|
|
3303
|
-
} = i, z = [...t].sort((
|
|
3303
|
+
} = i, z = [...t].sort((_, g) => _.order - g.order);
|
|
3304
3304
|
return /* @__PURE__ */ s("div", { ref: r, className: `nice-round-list ${m ?? ""}`, style: h, children: [
|
|
3305
3305
|
/* @__PURE__ */ s("div", { className: "nice-round-list__header", children: [
|
|
3306
3306
|
/* @__PURE__ */ e("h3", { children: n("roundList.rounds", "Rounds ({rounds})").replace("{rounds}", String(t.length)) }),
|
|
3307
|
-
|
|
3307
|
+
o && c && /* @__PURE__ */ e("button", { onClick: c, children: n("roundList.addRound", "+ Add Round") })
|
|
3308
3308
|
] }),
|
|
3309
|
-
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((
|
|
3310
|
-
const g =
|
|
3309
|
+
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((_) => {
|
|
3310
|
+
const g = _.id === l;
|
|
3311
3311
|
return /* @__PURE__ */ s(
|
|
3312
3312
|
"div",
|
|
3313
3313
|
{
|
|
3314
3314
|
onKeyDown: un,
|
|
3315
3315
|
className: `nice-round-list__item ${g ? "nice-round-list__item--active" : ""}`,
|
|
3316
|
-
onClick: () =>
|
|
3317
|
-
role:
|
|
3318
|
-
tabIndex:
|
|
3316
|
+
onClick: () => d == null ? void 0 : d(_),
|
|
3317
|
+
role: d ? "button" : void 0,
|
|
3318
|
+
tabIndex: d ? 0 : void 0,
|
|
3319
3319
|
children: [
|
|
3320
3320
|
/* @__PURE__ */ s("span", { className: "nice-round-list__order", children: [
|
|
3321
3321
|
"#",
|
|
3322
|
-
|
|
3322
|
+
_.order
|
|
3323
3323
|
] }),
|
|
3324
3324
|
/* @__PURE__ */ e(
|
|
3325
3325
|
"span",
|
|
3326
3326
|
{
|
|
3327
3327
|
className: "nice-round-list__icon",
|
|
3328
|
-
title: n(`roundCard.status.${
|
|
3329
|
-
children:
|
|
3328
|
+
title: n(`roundCard.status.${_.status}`, _.status),
|
|
3329
|
+
children: $e.createElement(Vi[_.status], { size: 16 })
|
|
3330
3330
|
}
|
|
3331
3331
|
),
|
|
3332
3332
|
/* @__PURE__ */ s("div", { className: "nice-round-list__info", children: [
|
|
3333
|
-
/* @__PURE__ */ e("strong", { className: "nice-round-list__name", children:
|
|
3334
|
-
|
|
3335
|
-
|
|
3333
|
+
/* @__PURE__ */ e("strong", { className: "nice-round-list__name", children: _.name }),
|
|
3334
|
+
_.description && /* @__PURE__ */ e("small", { children: _.description }),
|
|
3335
|
+
_.type && /* @__PURE__ */ e("span", { className: "nice-round-list__type", children: _.type })
|
|
3336
3336
|
] }),
|
|
3337
3337
|
/* @__PURE__ */ e(
|
|
3338
3338
|
"span",
|
|
3339
3339
|
{
|
|
3340
3340
|
className: "nice-round-list__status",
|
|
3341
|
-
style: { color:
|
|
3342
|
-
children: n(`roundCard.status.${
|
|
3341
|
+
style: { color: Fi[_.status] },
|
|
3342
|
+
children: n(`roundCard.status.${_.status}`, _.status)
|
|
3343
3343
|
}
|
|
3344
3344
|
),
|
|
3345
|
-
|
|
3346
|
-
|
|
3345
|
+
_.durationMinutes && /* @__PURE__ */ s("span", { className: "nice-round-list__duration", children: [
|
|
3346
|
+
_.durationMinutes,
|
|
3347
3347
|
"m"
|
|
3348
3348
|
] }),
|
|
3349
|
-
|
|
3349
|
+
_.winnerIds && _.winnerIds.length > 0 && /* @__PURE__ */ s("span", { className: "nice-round-list__winners", children: [
|
|
3350
3350
|
/* @__PURE__ */ e(ln, { size: 14 }),
|
|
3351
3351
|
" ",
|
|
3352
|
-
|
|
3352
|
+
_.winnerIds.length
|
|
3353
3353
|
] }),
|
|
3354
|
-
|
|
3354
|
+
o && /* @__PURE__ */ s(
|
|
3355
3355
|
"div",
|
|
3356
3356
|
{
|
|
3357
3357
|
role: "presentation",
|
|
3358
3358
|
className: "nice-round-list__actions",
|
|
3359
|
-
onClick: (
|
|
3359
|
+
onClick: (I) => I.stopPropagation(),
|
|
3360
3360
|
children: [
|
|
3361
|
-
|
|
3362
|
-
(
|
|
3361
|
+
_.status === "upcoming" && u && /* @__PURE__ */ e("button", { onClick: () => u(_.id), children: n("roundList.start", "Start") }),
|
|
3362
|
+
(_.status === "active" || _.status === "voting") && f && /* @__PURE__ */ e("button", { onClick: () => f(_.id), children: n("roundList.end", "End") })
|
|
3363
3363
|
]
|
|
3364
3364
|
}
|
|
3365
3365
|
)
|
|
3366
3366
|
]
|
|
3367
3367
|
},
|
|
3368
|
-
|
|
3368
|
+
_.id
|
|
3369
3369
|
);
|
|
3370
3370
|
}) })
|
|
3371
3371
|
] });
|
|
3372
3372
|
}
|
|
3373
|
-
),
|
|
3373
|
+
), Xi = [
|
|
3374
3374
|
"var(--nice-lb-gold, #facc15)",
|
|
3375
3375
|
"var(--nice-lb-silver, #cbd5e1)",
|
|
3376
3376
|
"var(--nice-lb-bronze, #d97706)"
|
|
3377
|
-
],
|
|
3377
|
+
], pa = /* @__PURE__ */ ie(
|
|
3378
3378
|
function(i, r) {
|
|
3379
|
-
const { t: n } =
|
|
3379
|
+
const { t: n } = J(), {
|
|
3380
3380
|
round: t,
|
|
3381
|
-
timerRunning:
|
|
3382
|
-
remainingSeconds:
|
|
3381
|
+
timerRunning: l = !1,
|
|
3382
|
+
remainingSeconds: d,
|
|
3383
3383
|
onSubmitScore: u,
|
|
3384
|
-
onStart:
|
|
3384
|
+
onStart: f,
|
|
3385
3385
|
onEnd: c,
|
|
3386
|
-
onSkip:
|
|
3386
|
+
onSkip: o,
|
|
3387
3387
|
editable: m = !1,
|
|
3388
3388
|
footerActions: h,
|
|
3389
3389
|
className: z,
|
|
3390
|
-
style:
|
|
3391
|
-
} = i, [g,
|
|
3390
|
+
style: _
|
|
3391
|
+
} = i, [g, I] = D({}), k = H(
|
|
3392
3392
|
(p) => {
|
|
3393
3393
|
const A = parseFloat(g[p] ?? "");
|
|
3394
|
-
isNaN(A) || !u || (u(p, A),
|
|
3394
|
+
isNaN(A) || !u || (u(p, A), I((y) => ({ ...y, [p]: "" })));
|
|
3395
3395
|
},
|
|
3396
3396
|
[g, u]
|
|
3397
3397
|
), T = (p) => {
|
|
3398
3398
|
const A = Math.floor(p / 60), y = p % 60;
|
|
3399
3399
|
return `${A}:${y.toString().padStart(2, "0")}`;
|
|
3400
|
-
},
|
|
3400
|
+
}, v = t.scores ? [...t.scores].sort((p, A) => A.score - p.score) : [];
|
|
3401
3401
|
return /* @__PURE__ */ s(
|
|
3402
3402
|
"div",
|
|
3403
3403
|
{
|
|
3404
3404
|
ref: r,
|
|
3405
3405
|
className: `nice-round-card nice-round-card--${t.status} ${z ?? ""}`,
|
|
3406
|
-
style:
|
|
3406
|
+
style: _,
|
|
3407
3407
|
children: [
|
|
3408
3408
|
/* @__PURE__ */ s("div", { className: "nice-round-card__header", children: [
|
|
3409
3409
|
/* @__PURE__ */ e("span", { className: "nice-round-card__order", children: n("roundCard.roundN", "Round #{n}").replace("{n}", String(t.order)) }),
|
|
@@ -3411,18 +3411,18 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3411
3411
|
/* @__PURE__ */ e("span", { className: "nice-round-card__status", children: n(`roundCard.status.${t.status}`, t.status) })
|
|
3412
3412
|
] }),
|
|
3413
3413
|
t.description && /* @__PURE__ */ e("p", { className: "nice-round-card__description", children: t.description }),
|
|
3414
|
-
(
|
|
3414
|
+
(l || d != null) && /* @__PURE__ */ s(
|
|
3415
3415
|
"div",
|
|
3416
3416
|
{
|
|
3417
|
-
className: `nice-round-card__timer ${
|
|
3417
|
+
className: `nice-round-card__timer ${l ? "nice-round-card__timer--running" : ""}`,
|
|
3418
3418
|
children: [
|
|
3419
3419
|
/* @__PURE__ */ e(En, { size: 14 }),
|
|
3420
3420
|
" ",
|
|
3421
|
-
|
|
3421
|
+
d != null ? T(d) : "—"
|
|
3422
3422
|
]
|
|
3423
3423
|
}
|
|
3424
3424
|
),
|
|
3425
|
-
|
|
3425
|
+
v.length > 0 && /* @__PURE__ */ s("div", { className: "nice-round-card__scoreboard", children: [
|
|
3426
3426
|
/* @__PURE__ */ e("h4", { children: n("roundCard.scoreboard", "Scoreboard") }),
|
|
3427
3427
|
/* @__PURE__ */ s("table", { className: "nice-round-card__scores-table", children: [
|
|
3428
3428
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ s("tr", { children: [
|
|
@@ -3430,20 +3430,20 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3430
3430
|
/* @__PURE__ */ e("th", { children: n("roundCard.participant", "Participant") }),
|
|
3431
3431
|
/* @__PURE__ */ e("th", { children: n("roundCard.score", "Score") })
|
|
3432
3432
|
] }) }),
|
|
3433
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
3433
|
+
/* @__PURE__ */ e("tbody", { children: v.map((p, A) => /* @__PURE__ */ s(
|
|
3434
3434
|
"tr",
|
|
3435
3435
|
{
|
|
3436
3436
|
className: A < 3 ? `nice-round-card__top-${A + 1}` : "",
|
|
3437
3437
|
children: [
|
|
3438
3438
|
/* @__PURE__ */ s("td", { children: [
|
|
3439
3439
|
p.rank ?? A + 1,
|
|
3440
|
-
A < 3 && /* @__PURE__ */ s(
|
|
3440
|
+
A < 3 && /* @__PURE__ */ s(Ke, { children: [
|
|
3441
3441
|
" ",
|
|
3442
3442
|
/* @__PURE__ */ e(
|
|
3443
3443
|
Je,
|
|
3444
3444
|
{
|
|
3445
3445
|
size: 14,
|
|
3446
|
-
primaryColor:
|
|
3446
|
+
primaryColor: Xi[A],
|
|
3447
3447
|
"aria-label": n("roundCard.placeN", "Place {n}").replace(
|
|
3448
3448
|
"{n}",
|
|
3449
3449
|
String(A + 1)
|
|
@@ -3460,16 +3460,16 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3460
3460
|
)) })
|
|
3461
3461
|
] })
|
|
3462
3462
|
] }),
|
|
3463
|
-
u && (t.status === "active" || t.status === "voting") &&
|
|
3463
|
+
u && (t.status === "active" || t.status === "voting") && v.length > 0 && /* @__PURE__ */ s("div", { className: "nice-round-card__score-input", children: [
|
|
3464
3464
|
/* @__PURE__ */ e("h4", { children: n("roundCard.submitScores", "Submit Scores") }),
|
|
3465
|
-
|
|
3465
|
+
v.map((p) => /* @__PURE__ */ s("div", { className: "nice-round-card__score-row", children: [
|
|
3466
3466
|
/* @__PURE__ */ e("span", { children: p.participantName }),
|
|
3467
3467
|
/* @__PURE__ */ e(
|
|
3468
3468
|
"input",
|
|
3469
3469
|
{
|
|
3470
3470
|
type: "number",
|
|
3471
3471
|
value: g[p.participantId] ?? "",
|
|
3472
|
-
onChange: (A) =>
|
|
3472
|
+
onChange: (A) => I((y) => ({ ...y, [p.participantId]: A.target.value })),
|
|
3473
3473
|
min: 0,
|
|
3474
3474
|
step: 1,
|
|
3475
3475
|
placeholder: n("roundCard.score", "Score")
|
|
@@ -3480,17 +3480,17 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3480
3480
|
] }),
|
|
3481
3481
|
/* @__PURE__ */ s("div", { className: "nice-round-card__footer", children: [
|
|
3482
3482
|
m && /* @__PURE__ */ s("div", { className: "nice-round-card__actions", children: [
|
|
3483
|
-
t.status === "upcoming" &&
|
|
3484
|
-
/* @__PURE__ */ e(
|
|
3483
|
+
t.status === "upcoming" && f && /* @__PURE__ */ s("button", { onClick: f, children: [
|
|
3484
|
+
/* @__PURE__ */ e(je, { size: 14 }),
|
|
3485
3485
|
" ",
|
|
3486
3486
|
n("roundCard.startRound", "Start Round")
|
|
3487
3487
|
] }),
|
|
3488
3488
|
(t.status === "active" || t.status === "voting") && c && /* @__PURE__ */ s("button", { onClick: c, children: [
|
|
3489
|
-
/* @__PURE__ */ e(
|
|
3489
|
+
/* @__PURE__ */ e(Mt, { size: 14 }),
|
|
3490
3490
|
" ",
|
|
3491
3491
|
n("roundCard.endRound", "End Round")
|
|
3492
3492
|
] }),
|
|
3493
|
-
t.status === "upcoming" &&
|
|
3493
|
+
t.status === "upcoming" && o && /* @__PURE__ */ s("button", { onClick: o, children: [
|
|
3494
3494
|
/* @__PURE__ */ e(rn, { size: 14 }),
|
|
3495
3495
|
" ",
|
|
3496
3496
|
n("roundCard.skip", "Skip")
|
|
@@ -3510,39 +3510,39 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3510
3510
|
}
|
|
3511
3511
|
);
|
|
3512
3512
|
}
|
|
3513
|
-
),
|
|
3513
|
+
), qi = [], Wi = (a) => {
|
|
3514
3514
|
if (!a)
|
|
3515
3515
|
return "";
|
|
3516
3516
|
const i = Math.floor(a / 60), r = a % 60;
|
|
3517
3517
|
return `${i}:${r.toString().padStart(2, "0")}`;
|
|
3518
|
-
},
|
|
3518
|
+
}, ha = /* @__PURE__ */ ie(
|
|
3519
3519
|
function(i, r) {
|
|
3520
3520
|
const {
|
|
3521
|
-
songs: n =
|
|
3521
|
+
songs: n = qi,
|
|
3522
3522
|
onAdd: t,
|
|
3523
|
-
onRemove:
|
|
3524
|
-
onVote:
|
|
3523
|
+
onRemove: l,
|
|
3524
|
+
onVote: d,
|
|
3525
3525
|
onSearch: u,
|
|
3526
|
-
showQueue:
|
|
3526
|
+
showQueue: f = !0,
|
|
3527
3527
|
readOnly: c = !1,
|
|
3528
|
-
className:
|
|
3528
|
+
className: o,
|
|
3529
3529
|
style: m
|
|
3530
|
-
} = i, { t: h } =
|
|
3530
|
+
} = i, { t: h } = J(), [z, _] = D(""), g = V(() => {
|
|
3531
3531
|
if (!z.trim())
|
|
3532
3532
|
return n;
|
|
3533
|
-
const
|
|
3533
|
+
const v = z.toLowerCase();
|
|
3534
3534
|
return n.filter(
|
|
3535
|
-
(p) => p.title.toLowerCase().includes(
|
|
3535
|
+
(p) => p.title.toLowerCase().includes(v) || p.artist.toLowerCase().includes(v)
|
|
3536
3536
|
);
|
|
3537
|
-
}, [n, z]),
|
|
3538
|
-
v
|
|
3537
|
+
}, [n, z]), I = V(() => n.filter((v) => v.isQueued), [n]), k = n.find((v) => v.isPlaying), T = (v) => {
|
|
3538
|
+
_(v), u == null || u(v);
|
|
3539
3539
|
};
|
|
3540
|
-
return /* @__PURE__ */ s("div", { ref: r, className: `nice-song-picker ${
|
|
3540
|
+
return /* @__PURE__ */ s("div", { ref: r, className: `nice-song-picker ${o ?? ""}`, style: m, children: [
|
|
3541
3541
|
k && /* @__PURE__ */ s("div", { className: "nice-song-picker__now-playing", children: [
|
|
3542
3542
|
k.albumArt && /* @__PURE__ */ e("img", { src: k.albumArt, alt: "", className: "nice-song-picker__album-art" }),
|
|
3543
3543
|
/* @__PURE__ */ s("div", { children: [
|
|
3544
3544
|
/* @__PURE__ */ s("div", { className: "nice-song-picker__np-label", children: [
|
|
3545
|
-
/* @__PURE__ */ e(
|
|
3545
|
+
/* @__PURE__ */ e(Se, { size: 14 }),
|
|
3546
3546
|
" ",
|
|
3547
3547
|
h("songPicker.nowPlaying", "Now playing")
|
|
3548
3548
|
] }),
|
|
@@ -3552,7 +3552,7 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3552
3552
|
] })
|
|
3553
3553
|
] }),
|
|
3554
3554
|
/* @__PURE__ */ e("div", { className: "nice-song-picker__search", children: /* @__PURE__ */ e(
|
|
3555
|
-
|
|
3555
|
+
Z,
|
|
3556
3556
|
{
|
|
3557
3557
|
size: "sm",
|
|
3558
3558
|
controlWidth: "100%",
|
|
@@ -3562,103 +3562,103 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3562
3562
|
"aria-label": h("songPicker.search", "Search songs or artists…")
|
|
3563
3563
|
}
|
|
3564
3564
|
) }),
|
|
3565
|
-
/* @__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((
|
|
3565
|
+
/* @__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((v) => /* @__PURE__ */ s(
|
|
3566
3566
|
"div",
|
|
3567
3567
|
{
|
|
3568
|
-
className: `nice-song-picker__item ${
|
|
3568
|
+
className: `nice-song-picker__item ${v.isPlaying ? "nice-song-picker__item--playing" : ""}`,
|
|
3569
3569
|
children: [
|
|
3570
|
-
|
|
3570
|
+
v.albumArt && /* @__PURE__ */ e("img", { src: v.albumArt, alt: "", className: "nice-song-picker__thumb" }),
|
|
3571
3571
|
/* @__PURE__ */ s("div", { className: "nice-song-picker__info", children: [
|
|
3572
|
-
/* @__PURE__ */ e("strong", { children:
|
|
3572
|
+
/* @__PURE__ */ e("strong", { children: v.title }),
|
|
3573
3573
|
" — ",
|
|
3574
|
-
/* @__PURE__ */ e("span", { children:
|
|
3575
|
-
|
|
3576
|
-
|
|
3574
|
+
/* @__PURE__ */ e("span", { children: v.artist }),
|
|
3575
|
+
v.duration && /* @__PURE__ */ e("span", { className: "nice-song-picker__duration", children: Wi(v.duration) }),
|
|
3576
|
+
v.addedByName && /* @__PURE__ */ e("div", { className: "nice-song-picker__added-by", children: h("songPicker.addedBy", "Added by {name}").replace(
|
|
3577
3577
|
"{name}",
|
|
3578
|
-
|
|
3578
|
+
v.addedByName
|
|
3579
3579
|
) })
|
|
3580
3580
|
] }),
|
|
3581
3581
|
!c && /* @__PURE__ */ s("div", { className: "nice-song-picker__actions", children: [
|
|
3582
|
-
|
|
3583
|
-
|
|
3582
|
+
d && /* @__PURE__ */ s(
|
|
3583
|
+
U,
|
|
3584
3584
|
{
|
|
3585
3585
|
variant: "ghost",
|
|
3586
3586
|
size: "sm",
|
|
3587
|
-
onClick: () =>
|
|
3587
|
+
onClick: () => d(v.id),
|
|
3588
3588
|
"aria-label": h("songPicker.vote", "Vote for {title}").replace(
|
|
3589
3589
|
"{title}",
|
|
3590
|
-
|
|
3590
|
+
v.title
|
|
3591
3591
|
),
|
|
3592
3592
|
children: [
|
|
3593
3593
|
/* @__PURE__ */ e(cn, { size: 14 }),
|
|
3594
3594
|
" ",
|
|
3595
|
-
|
|
3595
|
+
v.votes ?? 0
|
|
3596
3596
|
]
|
|
3597
3597
|
}
|
|
3598
3598
|
),
|
|
3599
|
-
t && !
|
|
3599
|
+
t && !v.isQueued && /* @__PURE__ */ s(U, { variant: "primary", size: "sm", onClick: () => t(v.id), children: [
|
|
3600
3600
|
/* @__PURE__ */ e(an, { size: 14 }),
|
|
3601
3601
|
" ",
|
|
3602
3602
|
h("songPicker.addToQueue", "Queue")
|
|
3603
3603
|
] }),
|
|
3604
|
-
|
|
3604
|
+
l && v.isQueued && /* @__PURE__ */ e(U, { variant: "outline", size: "sm", onClick: () => l(v.id), children: h("remove", "Remove") })
|
|
3605
3605
|
] })
|
|
3606
3606
|
]
|
|
3607
3607
|
},
|
|
3608
|
-
|
|
3608
|
+
v.id
|
|
3609
3609
|
)) }),
|
|
3610
|
-
|
|
3611
|
-
/* @__PURE__ */ e("h4", { children: h("songPicker.queue", "Queue ({count})").replace("{count}", String(
|
|
3612
|
-
|
|
3610
|
+
f && I.length > 0 && /* @__PURE__ */ s("div", { className: "nice-song-picker__queue", children: [
|
|
3611
|
+
/* @__PURE__ */ e("h4", { children: h("songPicker.queue", "Queue ({count})").replace("{count}", String(I.length)) }),
|
|
3612
|
+
I.map((v, p) => /* @__PURE__ */ s("div", { className: "nice-song-picker__queue-item", children: [
|
|
3613
3613
|
/* @__PURE__ */ s("span", { className: "nice-song-picker__queue-pos", children: [
|
|
3614
3614
|
p + 1,
|
|
3615
3615
|
"."
|
|
3616
3616
|
] }),
|
|
3617
3617
|
/* @__PURE__ */ s("span", { children: [
|
|
3618
|
-
|
|
3618
|
+
v.title,
|
|
3619
3619
|
" — ",
|
|
3620
|
-
|
|
3620
|
+
v.artist
|
|
3621
3621
|
] })
|
|
3622
|
-
] },
|
|
3622
|
+
] }, v.id))
|
|
3623
3623
|
] })
|
|
3624
3624
|
] });
|
|
3625
3625
|
}
|
|
3626
|
-
),
|
|
3626
|
+
), Gi = [], An = {
|
|
3627
3627
|
easy: "Easy",
|
|
3628
3628
|
medium: "Medium",
|
|
3629
3629
|
hard: "Hard",
|
|
3630
3630
|
expert: "Expert"
|
|
3631
|
-
},
|
|
3631
|
+
}, Ki = {
|
|
3632
3632
|
easy: "var(--nice-color-success, #16a34a)",
|
|
3633
3633
|
medium: "var(--nice-color-warning, #d97706)",
|
|
3634
3634
|
hard: "var(--nice-color-error, #dc2626)",
|
|
3635
3635
|
expert: "var(--nice-color-accent, #7c3aed)"
|
|
3636
|
-
},
|
|
3636
|
+
}, Ve = "all", ga = /* @__PURE__ */ ie(
|
|
3637
3637
|
function(i, r) {
|
|
3638
3638
|
const {
|
|
3639
|
-
songs: n =
|
|
3639
|
+
songs: n = Gi,
|
|
3640
3640
|
queue: t = [],
|
|
3641
|
-
onEnqueue:
|
|
3642
|
-
onDequeue:
|
|
3641
|
+
onEnqueue: l,
|
|
3642
|
+
onDequeue: d,
|
|
3643
3643
|
onNext: u,
|
|
3644
|
-
nowPlayingId:
|
|
3644
|
+
nowPlayingId: f,
|
|
3645
3645
|
readOnly: c = !1,
|
|
3646
|
-
className:
|
|
3646
|
+
className: o,
|
|
3647
3647
|
style: m
|
|
3648
|
-
} = i, { t: h } =
|
|
3648
|
+
} = i, { t: h } = J(), z = (y) => y in An ? h(`karaokePicker.difficulty.${y}`, An[y]) : y, [_, g] = D(""), [I, k] = D(Ve), T = n.find((y) => y.id === f), v = V(() => {
|
|
3649
3649
|
let y = n;
|
|
3650
|
-
if (
|
|
3651
|
-
const M =
|
|
3650
|
+
if (_.trim()) {
|
|
3651
|
+
const M = _.toLowerCase();
|
|
3652
3652
|
y = y.filter(
|
|
3653
3653
|
(w) => w.title.toLowerCase().includes(M) || w.artist.toLowerCase().includes(M)
|
|
3654
3654
|
);
|
|
3655
3655
|
}
|
|
3656
|
-
return
|
|
3657
|
-
}, [n,
|
|
3658
|
-
return /* @__PURE__ */ s("div", { ref: r, className: `nice-karaoke-picker ${
|
|
3656
|
+
return I !== Ve && (y = y.filter((M) => M.difficulty === I)), y;
|
|
3657
|
+
}, [n, _, I]), p = V(() => new Set(t.map((y) => y.id)), [t]), A = ["easy", "medium", "hard", "expert"];
|
|
3658
|
+
return /* @__PURE__ */ s("div", { ref: r, className: `nice-karaoke-picker ${o ?? ""}`, style: m, children: [
|
|
3659
3659
|
T && /* @__PURE__ */ s("div", { className: "nice-karaoke-picker__now-singing", children: [
|
|
3660
3660
|
/* @__PURE__ */ s("span", { className: "nice-karaoke-picker__label", children: [
|
|
3661
|
-
/* @__PURE__ */ e(
|
|
3661
|
+
/* @__PURE__ */ e(qe, { size: 14 }),
|
|
3662
3662
|
" ",
|
|
3663
3663
|
h("karaokePicker.nowSinging", "Now Singing")
|
|
3664
3664
|
] }),
|
|
@@ -3673,7 +3673,7 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3673
3673
|
")"
|
|
3674
3674
|
] })
|
|
3675
3675
|
] }),
|
|
3676
|
-
!c && u && /* @__PURE__ */ e("div", { className: "nice-karaoke-picker__next", children: /* @__PURE__ */ s(
|
|
3676
|
+
!c && u && /* @__PURE__ */ e("div", { className: "nice-karaoke-picker__next", children: /* @__PURE__ */ s(U, { variant: "secondary", size: "sm", onClick: u, children: [
|
|
3677
3677
|
h("karaokePicker.next", "Skip / Next"),
|
|
3678
3678
|
" ",
|
|
3679
3679
|
/* @__PURE__ */ e(rn, { size: 14 })
|
|
@@ -3681,31 +3681,31 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3681
3681
|
] }),
|
|
3682
3682
|
/* @__PURE__ */ s("div", { className: "nice-karaoke-picker__filters", children: [
|
|
3683
3683
|
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__search", children: /* @__PURE__ */ e(
|
|
3684
|
-
|
|
3684
|
+
Z,
|
|
3685
3685
|
{
|
|
3686
3686
|
size: "sm",
|
|
3687
3687
|
controlWidth: "100%",
|
|
3688
|
-
value:
|
|
3688
|
+
value: _,
|
|
3689
3689
|
onChange: g,
|
|
3690
3690
|
placeholder: h("karaokePicker.search", "Search songs or artists…"),
|
|
3691
3691
|
"aria-label": h("karaokePicker.search", "Search songs or artists…")
|
|
3692
3692
|
}
|
|
3693
3693
|
) }),
|
|
3694
3694
|
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__difficulty-filter", children: /* @__PURE__ */ e(
|
|
3695
|
-
|
|
3695
|
+
Ce,
|
|
3696
3696
|
{
|
|
3697
3697
|
size: "sm",
|
|
3698
3698
|
"aria-label": h("karaokePicker.allDifficulties", "All Difficulties"),
|
|
3699
|
-
value:
|
|
3700
|
-
onChange: (y) => k((Array.isArray(y) ? y[0] : y) ||
|
|
3699
|
+
value: I,
|
|
3700
|
+
onChange: (y) => k((Array.isArray(y) ? y[0] : y) || Ve),
|
|
3701
3701
|
options: [
|
|
3702
|
-
{ value:
|
|
3702
|
+
{ value: Ve, label: h("karaokePicker.allDifficulties", "All Difficulties") },
|
|
3703
3703
|
...A.map((y) => ({ value: y, label: z(y) }))
|
|
3704
3704
|
]
|
|
3705
3705
|
}
|
|
3706
3706
|
) })
|
|
3707
3707
|
] }),
|
|
3708
|
-
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__catalog", children:
|
|
3708
|
+
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__catalog", children: v.length === 0 ? /* @__PURE__ */ e("p", { children: h("karaokePicker.noMatch", "No songs match your search.") }) : v.map((y) => /* @__PURE__ */ s("div", { className: "nice-karaoke-picker__song", children: [
|
|
3709
3709
|
/* @__PURE__ */ s("div", { children: [
|
|
3710
3710
|
/* @__PURE__ */ e("strong", { children: y.title }),
|
|
3711
3711
|
" — ",
|
|
@@ -3715,7 +3715,7 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3715
3715
|
{
|
|
3716
3716
|
className: "nice-karaoke-picker__difficulty",
|
|
3717
3717
|
style: {
|
|
3718
|
-
color:
|
|
3718
|
+
color: Ki[y.difficulty] ?? "var(--nice-text-muted, #94a3b8)"
|
|
3719
3719
|
},
|
|
3720
3720
|
children: [
|
|
3721
3721
|
"[",
|
|
@@ -3730,7 +3730,7 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3730
3730
|
className: "nice-karaoke-picker__lyrics",
|
|
3731
3731
|
title: h("karaokePicker.lyrics", "Lyrics available"),
|
|
3732
3732
|
"aria-label": h("karaokePicker.lyrics", "Lyrics available"),
|
|
3733
|
-
children: /* @__PURE__ */ e(
|
|
3733
|
+
children: /* @__PURE__ */ e(Lt, { size: 12 })
|
|
3734
3734
|
}
|
|
3735
3735
|
),
|
|
3736
3736
|
y.language && /* @__PURE__ */ s("span", { className: "nice-karaoke-picker__language", children: [
|
|
@@ -3739,15 +3739,15 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3739
3739
|
")"
|
|
3740
3740
|
] })
|
|
3741
3741
|
] }),
|
|
3742
|
-
!c && /* @__PURE__ */ e("div", { children: p.has(y.id) ? /* @__PURE__ */ e(
|
|
3743
|
-
/* @__PURE__ */ e(
|
|
3742
|
+
!c && /* @__PURE__ */ e("div", { children: p.has(y.id) ? /* @__PURE__ */ e(U, { variant: "outline", size: "sm", onClick: () => d == null ? void 0 : d(y.id), children: h("remove", "Remove") }) : /* @__PURE__ */ s(U, { variant: "primary", size: "sm", onClick: () => l == null ? void 0 : l(y.id), children: [
|
|
3743
|
+
/* @__PURE__ */ e(qe, { size: 14 }),
|
|
3744
3744
|
" ",
|
|
3745
3745
|
h("karaokePicker.sing", "Sing")
|
|
3746
3746
|
] }) })
|
|
3747
3747
|
] }, y.id)) }),
|
|
3748
3748
|
t.length > 0 && /* @__PURE__ */ s("div", { className: "nice-karaoke-picker__queue", children: [
|
|
3749
3749
|
/* @__PURE__ */ s("h4", { children: [
|
|
3750
|
-
/* @__PURE__ */ e(
|
|
3750
|
+
/* @__PURE__ */ e(Se, { size: 14 }),
|
|
3751
3751
|
" ",
|
|
3752
3752
|
h("karaokePicker.queue", "Queue ({count})").replace("{count}", String(t.length))
|
|
3753
3753
|
] }),
|
|
@@ -3767,29 +3767,29 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3767
3767
|
")"
|
|
3768
3768
|
] })
|
|
3769
3769
|
] }),
|
|
3770
|
-
!c &&
|
|
3771
|
-
|
|
3770
|
+
!c && d && /* @__PURE__ */ e(
|
|
3771
|
+
U,
|
|
3772
3772
|
{
|
|
3773
3773
|
variant: "ghost",
|
|
3774
3774
|
size: "xs",
|
|
3775
|
-
onClick: () =>
|
|
3775
|
+
onClick: () => d(y.id),
|
|
3776
3776
|
"aria-label": `${h("remove", "Remove")} ${y.title}`,
|
|
3777
|
-
children: /* @__PURE__ */ e(
|
|
3777
|
+
children: /* @__PURE__ */ e($n, { size: 12 })
|
|
3778
3778
|
}
|
|
3779
3779
|
)
|
|
3780
3780
|
] }, y.id))
|
|
3781
3781
|
] })
|
|
3782
3782
|
] });
|
|
3783
3783
|
}
|
|
3784
|
-
),
|
|
3784
|
+
), ji = [], Tn = {
|
|
3785
3785
|
game: Bn,
|
|
3786
|
-
music:
|
|
3787
|
-
dance:
|
|
3786
|
+
music: Se,
|
|
3787
|
+
dance: Se,
|
|
3788
3788
|
quiz: sn,
|
|
3789
|
-
karaoke:
|
|
3789
|
+
karaoke: qe,
|
|
3790
3790
|
photo: Yn,
|
|
3791
3791
|
custom: On
|
|
3792
|
-
},
|
|
3792
|
+
}, Hi = {
|
|
3793
3793
|
game: "Games",
|
|
3794
3794
|
music: "Music",
|
|
3795
3795
|
dance: "Dance",
|
|
@@ -3797,41 +3797,41 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3797
3797
|
karaoke: "Karaoke",
|
|
3798
3798
|
photo: "Photo",
|
|
3799
3799
|
custom: "Custom"
|
|
3800
|
-
},
|
|
3801
|
-
const { t: n } =
|
|
3802
|
-
attractions: t =
|
|
3803
|
-
onSelect:
|
|
3804
|
-
onDeselect:
|
|
3800
|
+
}, va = /* @__PURE__ */ ie(function(i, r) {
|
|
3801
|
+
const { t: n } = J(), {
|
|
3802
|
+
attractions: t = ji,
|
|
3803
|
+
onSelect: l,
|
|
3804
|
+
onDeselect: d,
|
|
3805
3805
|
onVote: u,
|
|
3806
|
-
selectedIds:
|
|
3806
|
+
selectedIds: f = [],
|
|
3807
3807
|
maxSelections: c,
|
|
3808
|
-
showVotes:
|
|
3808
|
+
showVotes: o = !0,
|
|
3809
3809
|
readOnly: m = !1,
|
|
3810
3810
|
layout: h = "grid",
|
|
3811
3811
|
className: z,
|
|
3812
|
-
style:
|
|
3813
|
-
} = i, [g,
|
|
3812
|
+
style: _
|
|
3813
|
+
} = i, [g, I] = D(""), [k, T] = D(""), v = V(() => new Set(f), [f]), p = V(() => {
|
|
3814
3814
|
const w = new Set(t.map((N) => N.category));
|
|
3815
3815
|
return Array.from(w);
|
|
3816
|
-
}, [t]), A =
|
|
3816
|
+
}, [t]), A = V(() => {
|
|
3817
3817
|
let w = t;
|
|
3818
3818
|
if (g && (w = w.filter((N) => N.category === g)), k.trim()) {
|
|
3819
3819
|
const N = k.toLowerCase();
|
|
3820
3820
|
w = w.filter(
|
|
3821
|
-
(
|
|
3822
|
-
var
|
|
3823
|
-
return
|
|
3821
|
+
(P) => {
|
|
3822
|
+
var E;
|
|
3823
|
+
return P.name.toLowerCase().includes(N) || ((E = P.description) == null ? void 0 : E.toLowerCase().includes(N));
|
|
3824
3824
|
}
|
|
3825
3825
|
);
|
|
3826
3826
|
}
|
|
3827
3827
|
return w;
|
|
3828
|
-
}, [t, g, k]), y = !c ||
|
|
3829
|
-
m || (
|
|
3828
|
+
}, [t, g, k]), y = !c || v.size < c, M = (w) => {
|
|
3829
|
+
m || (v.has(w) ? d == null || d(w) : y && (l == null || l(w)));
|
|
3830
3830
|
};
|
|
3831
|
-
return /* @__PURE__ */ s("div", { ref: r, className: `nice-attraction-picker ${z ?? ""}`, style:
|
|
3831
|
+
return /* @__PURE__ */ s("div", { ref: r, className: `nice-attraction-picker ${z ?? ""}`, style: _, children: [
|
|
3832
3832
|
/* @__PURE__ */ s("div", { className: "nice-attraction-picker__header", children: [
|
|
3833
3833
|
/* @__PURE__ */ e("h3", { className: "nice-attraction-picker__title", children: n("attractionPicker.attractions", "Attractions") }),
|
|
3834
|
-
c && /* @__PURE__ */ e("span", { className: "nice-attraction-picker__count", children: n("attractionPicker.selected", "{size}/{maxSelections} selected").replace("{size}", String(
|
|
3834
|
+
c && /* @__PURE__ */ e("span", { className: "nice-attraction-picker__count", children: n("attractionPicker.selected", "{size}/{maxSelections} selected").replace("{size}", String(v.size)).replace("{maxSelections}", String(c)) })
|
|
3835
3835
|
] }),
|
|
3836
3836
|
/* @__PURE__ */ s("div", { className: "nice-attraction-picker__filters", children: [
|
|
3837
3837
|
/* @__PURE__ */ e(
|
|
@@ -3848,7 +3848,7 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3848
3848
|
"button",
|
|
3849
3849
|
{
|
|
3850
3850
|
type: "button",
|
|
3851
|
-
onClick: () =>
|
|
3851
|
+
onClick: () => I(""),
|
|
3852
3852
|
className: `nice-attraction-picker__category${g ? "" : " nice-attraction-picker__category--active"}`,
|
|
3853
3853
|
children: n("attractionPicker.all", "All")
|
|
3854
3854
|
}
|
|
@@ -3857,19 +3857,19 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3857
3857
|
"button",
|
|
3858
3858
|
{
|
|
3859
3859
|
type: "button",
|
|
3860
|
-
onClick: () =>
|
|
3860
|
+
onClick: () => I(w === g ? "" : w),
|
|
3861
3861
|
className: `nice-attraction-picker__category${w === g ? " nice-attraction-picker__category--active" : ""}`,
|
|
3862
3862
|
children: [
|
|
3863
|
-
|
|
3863
|
+
$e.createElement(Tn[w], { size: 14 }),
|
|
3864
3864
|
" ",
|
|
3865
|
-
n(`attractionPicker.category.${w}`,
|
|
3865
|
+
n(`attractionPicker.category.${w}`, Hi[w])
|
|
3866
3866
|
]
|
|
3867
3867
|
},
|
|
3868
3868
|
w
|
|
3869
3869
|
))
|
|
3870
3870
|
] }),
|
|
3871
3871
|
/* @__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) => {
|
|
3872
|
-
const N =
|
|
3872
|
+
const N = v.has(w.id);
|
|
3873
3873
|
return /* @__PURE__ */ s(
|
|
3874
3874
|
"div",
|
|
3875
3875
|
{
|
|
@@ -3882,12 +3882,12 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3882
3882
|
children: [
|
|
3883
3883
|
w.imageUrl && /* @__PURE__ */ e("img", { src: w.imageUrl, alt: w.name, className: "nice-attraction-picker__image" }),
|
|
3884
3884
|
/* @__PURE__ */ s("div", { className: "nice-attraction-picker__name", children: [
|
|
3885
|
-
/* @__PURE__ */ e("span", { className: "nice-attraction-picker__icon", children:
|
|
3885
|
+
/* @__PURE__ */ e("span", { className: "nice-attraction-picker__icon", children: $e.createElement(Tn[w.category], { size: 16 }) }),
|
|
3886
3886
|
/* @__PURE__ */ e("strong", { children: w.name })
|
|
3887
3887
|
] }),
|
|
3888
3888
|
w.description && /* @__PURE__ */ e("p", { className: "nice-attraction-picker__description", children: w.description }),
|
|
3889
3889
|
/* @__PURE__ */ s("div", { className: "nice-attraction-picker__card-footer", children: [
|
|
3890
|
-
|
|
3890
|
+
o && /* @__PURE__ */ s("span", { className: "nice-attraction-picker__votes", children: [
|
|
3891
3891
|
/* @__PURE__ */ e(cn, { size: 14 }),
|
|
3892
3892
|
" ",
|
|
3893
3893
|
w.votes ?? 0
|
|
@@ -3897,8 +3897,8 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3897
3897
|
{
|
|
3898
3898
|
type: "button",
|
|
3899
3899
|
className: "nice-attraction-picker__vote",
|
|
3900
|
-
onClick: (
|
|
3901
|
-
|
|
3900
|
+
onClick: (P) => {
|
|
3901
|
+
P.stopPropagation(), u(w.id);
|
|
3902
3902
|
},
|
|
3903
3903
|
children: n("attractionPicker.vote", "Vote")
|
|
3904
3904
|
}
|
|
@@ -3910,29 +3910,29 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3910
3910
|
);
|
|
3911
3911
|
}) })
|
|
3912
3912
|
] });
|
|
3913
|
-
}),
|
|
3913
|
+
}), Qi = [], Zi = {
|
|
3914
3914
|
game: Bn,
|
|
3915
|
-
music:
|
|
3916
|
-
dance:
|
|
3915
|
+
music: Se,
|
|
3916
|
+
dance: Se,
|
|
3917
3917
|
quiz: sn,
|
|
3918
|
-
karaoke:
|
|
3918
|
+
karaoke: qe,
|
|
3919
3919
|
photo: Yn,
|
|
3920
3920
|
custom: On
|
|
3921
|
-
},
|
|
3922
|
-
const { t: n } =
|
|
3923
|
-
attractions: t =
|
|
3924
|
-
onVote:
|
|
3925
|
-
onUnvote:
|
|
3921
|
+
}, fa = /* @__PURE__ */ ie(function(i, r) {
|
|
3922
|
+
const { t: n } = J(), {
|
|
3923
|
+
attractions: t = Qi,
|
|
3924
|
+
onVote: l,
|
|
3925
|
+
onUnvote: d,
|
|
3926
3926
|
votedIds: u = [],
|
|
3927
|
-
maxVotes:
|
|
3927
|
+
maxVotes: f,
|
|
3928
3928
|
closed: c = !1,
|
|
3929
|
-
sortBy:
|
|
3929
|
+
sortBy: o = "votes",
|
|
3930
3930
|
showResults: m = !0,
|
|
3931
3931
|
className: h,
|
|
3932
3932
|
style: z
|
|
3933
|
-
} = i,
|
|
3933
|
+
} = i, _ = V(() => new Set(u), [u]), g = f ? f - _.size : void 0, I = V(() => {
|
|
3934
3934
|
const p = [...t];
|
|
3935
|
-
switch (
|
|
3935
|
+
switch (o) {
|
|
3936
3936
|
case "votes":
|
|
3937
3937
|
p.sort((A, y) => (y.votes ?? 0) - (A.votes ?? 0));
|
|
3938
3938
|
break;
|
|
@@ -3944,12 +3944,12 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
3944
3944
|
break;
|
|
3945
3945
|
}
|
|
3946
3946
|
return p;
|
|
3947
|
-
}, [t,
|
|
3947
|
+
}, [t, o]), k = V(
|
|
3948
3948
|
() => Math.max(...t.map((p) => p.votes ?? 0), 1),
|
|
3949
3949
|
[t]
|
|
3950
3950
|
), T = (p) => {
|
|
3951
|
-
c || (
|
|
3952
|
-
},
|
|
3951
|
+
c || (_.has(p) ? d == null || d(p) : (!g || g > 0) && (l == null || l(p)));
|
|
3952
|
+
}, v = (p) => {
|
|
3953
3953
|
switch (p) {
|
|
3954
3954
|
case 0:
|
|
3955
3955
|
return /* @__PURE__ */ e(
|
|
@@ -4023,8 +4023,8 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
4023
4023
|
}
|
|
4024
4024
|
),
|
|
4025
4025
|
c && /* @__PURE__ */ e("p", { style: { color: "var(--nice-text-secondary, #64748b)", marginBottom: 12 }, children: n("attractionVoting.votingIsClosedFinalResults", "Voting is closed. Final results:") }),
|
|
4026
|
-
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children:
|
|
4027
|
-
const y =
|
|
4026
|
+
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: I.map((p, A) => {
|
|
4027
|
+
const y = _.has(p.id), M = p.votes ?? 0, w = m ? `${Math.round(M / k * 100)}%` : "0%";
|
|
4028
4028
|
return /* @__PURE__ */ s(
|
|
4029
4029
|
"div",
|
|
4030
4030
|
{
|
|
@@ -4046,8 +4046,8 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
4046
4046
|
},
|
|
4047
4047
|
onClick: () => T(p.id),
|
|
4048
4048
|
children: [
|
|
4049
|
-
m && /* @__PURE__ */ e("span", { style: { fontSize: 18, minWidth: 32, textAlign: "center" }, children:
|
|
4050
|
-
/* @__PURE__ */ e("span", { style: { display: "inline-flex", fontSize: 20 }, children:
|
|
4049
|
+
m && /* @__PURE__ */ e("span", { style: { fontSize: 18, minWidth: 32, textAlign: "center" }, children: v(A) }),
|
|
4050
|
+
/* @__PURE__ */ e("span", { style: { display: "inline-flex", fontSize: 20 }, children: $e.createElement(Zi[p.category], { size: 20 }) }),
|
|
4051
4051
|
/* @__PURE__ */ s("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4052
4052
|
/* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children: p.name }),
|
|
4053
4053
|
p.description && /* @__PURE__ */ e(
|
|
@@ -4132,20 +4132,20 @@ const Di = [], Ei = [], la = /* @__PURE__ */ te(
|
|
|
4132
4132
|
);
|
|
4133
4133
|
});
|
|
4134
4134
|
export {
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4135
|
+
va as NiceAttractionPicker,
|
|
4136
|
+
fa as NiceAttractionVoting,
|
|
4137
|
+
aa as NiceEventMedia,
|
|
4138
|
+
ra as NiceEventPlanning,
|
|
4139
|
+
ua as NiceExpenseSplit,
|
|
4140
|
+
da as NiceGiftRegistry,
|
|
4141
|
+
oa as NiceInvitationDesigner,
|
|
4142
|
+
ga as NiceKaraokePicker,
|
|
4143
|
+
sa as NiceMediaCollage,
|
|
4144
|
+
ca as NiceParticipantList,
|
|
4145
|
+
pa as NiceRoundCard,
|
|
4146
|
+
ma as NiceRoundList,
|
|
4147
4147
|
Sn as NiceRsvpControl,
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4148
|
+
la as NiceSeatPicker,
|
|
4149
|
+
wi as NiceSeatingChart,
|
|
4150
|
+
ha as NiceSongPicker
|
|
4151
4151
|
};
|