@nice2dev/events 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/LICENSE +21 -0
- package/README.md +61 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +512 -0
- package/dist/index.mjs +1049 -0
- package/package.json +58 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,1049 @@
|
|
|
1
|
+
import { jsxs as t, jsx as e, Fragment as ue } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as P, useState as w, useRef as pe, useEffect as me, useCallback as E, useMemo as R } from "react";
|
|
3
|
+
const be = P(function(x, A) {
|
|
4
|
+
const {
|
|
5
|
+
messages: a,
|
|
6
|
+
currentUserId: y,
|
|
7
|
+
onSend: m,
|
|
8
|
+
onReact: v,
|
|
9
|
+
reactions: _ = ["๐", "โค๏ธ", "๐", "๐", "๐ฅ"],
|
|
10
|
+
readOnly: g = !1,
|
|
11
|
+
placeholder: S = "Type a messageโฆ",
|
|
12
|
+
autoScroll: N = !0,
|
|
13
|
+
className: f,
|
|
14
|
+
style: C
|
|
15
|
+
} = x, [s, u] = w(""), k = pe(null);
|
|
16
|
+
me(() => {
|
|
17
|
+
N && k.current && k.current.scrollIntoView({ behavior: "smooth" });
|
|
18
|
+
}, [a.length, N]);
|
|
19
|
+
const b = E(() => {
|
|
20
|
+
!s.trim() || !m || (m(s.trim(), "text"), u(""));
|
|
21
|
+
}, [s, m]), p = (c) => {
|
|
22
|
+
c.key === "Enter" && !c.shiftKey && (c.preventDefault(), b());
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-event-chat ${f ?? ""}`, style: C, children: [
|
|
25
|
+
/* @__PURE__ */ t("div", { className: "nice-event-chat__messages", children: [
|
|
26
|
+
a.length === 0 && /* @__PURE__ */ e("p", { className: "nice-event-chat__empty", children: "No messages yet. Start the conversation!" }),
|
|
27
|
+
a.map((c) => {
|
|
28
|
+
const n = c.senderId === y;
|
|
29
|
+
return c.type === "system" || c.type === "announcement" ? /* @__PURE__ */ t("div", { className: `nice-event-chat__system nice-event-chat__${c.type}`, children: [
|
|
30
|
+
/* @__PURE__ */ e("span", { children: c.content }),
|
|
31
|
+
/* @__PURE__ */ e("time", { children: c.timestamp })
|
|
32
|
+
] }, c.id) : /* @__PURE__ */ t(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: `nice-event-chat__bubble ${n ? "nice-event-chat__bubble--own" : ""}`,
|
|
36
|
+
children: [
|
|
37
|
+
!n && /* @__PURE__ */ t("div", { className: "nice-event-chat__sender", children: [
|
|
38
|
+
c.senderAvatarUrl && /* @__PURE__ */ e("img", { src: c.senderAvatarUrl, alt: "", className: "nice-event-chat__avatar" }),
|
|
39
|
+
/* @__PURE__ */ e("strong", { children: c.senderName })
|
|
40
|
+
] }),
|
|
41
|
+
c.type === "image" ? /* @__PURE__ */ e("img", { src: c.content, alt: "Shared image", className: "nice-event-chat__image" }) : /* @__PURE__ */ e("p", { className: "nice-event-chat__text", children: c.content }),
|
|
42
|
+
/* @__PURE__ */ t("div", { className: "nice-event-chat__meta", children: [
|
|
43
|
+
/* @__PURE__ */ e("time", { children: c.timestamp }),
|
|
44
|
+
c.reactions && Object.keys(c.reactions).length > 0 && /* @__PURE__ */ e("span", { className: "nice-event-chat__reactions", children: Object.entries(c.reactions).map(([i, h]) => /* @__PURE__ */ t(
|
|
45
|
+
"button",
|
|
46
|
+
{
|
|
47
|
+
className: "nice-event-chat__reaction",
|
|
48
|
+
onClick: () => v == null ? void 0 : v(c.id, i),
|
|
49
|
+
children: [
|
|
50
|
+
i,
|
|
51
|
+
" ",
|
|
52
|
+
h
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
i
|
|
56
|
+
)) })
|
|
57
|
+
] }),
|
|
58
|
+
v && !g && /* @__PURE__ */ e("div", { className: "nice-event-chat__react-bar", children: _.map((i) => /* @__PURE__ */ e("button", { onClick: () => v(c.id, i), title: i, children: i }, i)) })
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
c.id
|
|
62
|
+
);
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ e("div", { ref: k })
|
|
65
|
+
] }),
|
|
66
|
+
!g && /* @__PURE__ */ t("div", { className: "nice-event-chat__input-bar", children: [
|
|
67
|
+
/* @__PURE__ */ e(
|
|
68
|
+
"textarea",
|
|
69
|
+
{
|
|
70
|
+
value: s,
|
|
71
|
+
onChange: (c) => u(c.target.value),
|
|
72
|
+
onKeyDown: p,
|
|
73
|
+
placeholder: S,
|
|
74
|
+
rows: 1
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ e("button", { onClick: b, disabled: !s.trim(), children: "Send" })
|
|
78
|
+
] })
|
|
79
|
+
] });
|
|
80
|
+
}), X = {
|
|
81
|
+
invited: "#3b82f6",
|
|
82
|
+
confirmed: "#22c55e",
|
|
83
|
+
declined: "#ef4444",
|
|
84
|
+
"checked-in": "#8b5cf6",
|
|
85
|
+
"no-show": "#9ca3af"
|
|
86
|
+
}, Z = {
|
|
87
|
+
host: "๐ Host",
|
|
88
|
+
"co-host": "๐ฏ Co-Host",
|
|
89
|
+
moderator: "๐ก๏ธ Moderator",
|
|
90
|
+
participant: "๐ค Participant",
|
|
91
|
+
spectator: "๐๏ธ Spectator",
|
|
92
|
+
vip: "โญ VIP"
|
|
93
|
+
}, ke = P(function(x, A) {
|
|
94
|
+
const {
|
|
95
|
+
participants: a,
|
|
96
|
+
currentParticipantId: y,
|
|
97
|
+
onInvite: m,
|
|
98
|
+
onRemove: v,
|
|
99
|
+
onRoleChange: _,
|
|
100
|
+
onCheckIn: g,
|
|
101
|
+
onParticipantClick: S,
|
|
102
|
+
showQR: N = !1,
|
|
103
|
+
editable: f = !1,
|
|
104
|
+
maxParticipants: C,
|
|
105
|
+
className: s,
|
|
106
|
+
style: u
|
|
107
|
+
} = x, [k, b] = w(""), [p, c] = w(""), n = R(() => {
|
|
108
|
+
let h = a;
|
|
109
|
+
if (p && (h = h.filter((l) => l.status === p)), k.trim()) {
|
|
110
|
+
const l = k.toLowerCase();
|
|
111
|
+
h = h.filter((o) => o.name.toLowerCase().includes(l));
|
|
112
|
+
}
|
|
113
|
+
return h;
|
|
114
|
+
}, [a, p, k]), d = R(() => {
|
|
115
|
+
const h = /* @__PURE__ */ new Map(), l = ["host", "co-host", "moderator", "vip", "participant", "spectator"];
|
|
116
|
+
for (const o of l) h.set(o, []);
|
|
117
|
+
for (const o of n)
|
|
118
|
+
h.has(o.role) || h.set(o.role, []), h.get(o.role).push(o);
|
|
119
|
+
return Array.from(h.entries()).filter(([, o]) => o.length > 0);
|
|
120
|
+
}, [n]), i = R(() => {
|
|
121
|
+
const h = {};
|
|
122
|
+
for (const l of a)
|
|
123
|
+
h[l.status] = (h[l.status] ?? 0) + 1;
|
|
124
|
+
return h;
|
|
125
|
+
}, [a]);
|
|
126
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-event-participants ${s ?? ""}`, style: u, children: [
|
|
127
|
+
/* @__PURE__ */ t("div", { className: "nice-event-participants__header", children: [
|
|
128
|
+
/* @__PURE__ */ t("h3", { children: [
|
|
129
|
+
"Participants (",
|
|
130
|
+
a.length,
|
|
131
|
+
C ? ` / ${C}` : "",
|
|
132
|
+
")"
|
|
133
|
+
] }),
|
|
134
|
+
f && m && /* @__PURE__ */ e("button", { onClick: m, disabled: C ? a.length >= C : !1, children: "+ Invite" })
|
|
135
|
+
] }),
|
|
136
|
+
/* @__PURE__ */ e("div", { className: "nice-event-participants__summary", children: Object.entries(i).map(([h, l]) => /* @__PURE__ */ t("span", { className: "nice-event-participants__stat", children: [
|
|
137
|
+
/* @__PURE__ */ e("span", { className: "nice-event-participants__dot", style: { backgroundColor: X[h] } }),
|
|
138
|
+
h,
|
|
139
|
+
": ",
|
|
140
|
+
l
|
|
141
|
+
] }, h)) }),
|
|
142
|
+
/* @__PURE__ */ t("div", { className: "nice-event-participants__toolbar", children: [
|
|
143
|
+
/* @__PURE__ */ e(
|
|
144
|
+
"input",
|
|
145
|
+
{
|
|
146
|
+
type: "text",
|
|
147
|
+
value: k,
|
|
148
|
+
onChange: (h) => b(h.target.value),
|
|
149
|
+
placeholder: "Searchโฆ"
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
/* @__PURE__ */ t("select", { value: p, onChange: (h) => c(h.target.value), children: [
|
|
153
|
+
/* @__PURE__ */ e("option", { value: "", children: "All" }),
|
|
154
|
+
/* @__PURE__ */ e("option", { value: "invited", children: "Invited" }),
|
|
155
|
+
/* @__PURE__ */ e("option", { value: "confirmed", children: "Confirmed" }),
|
|
156
|
+
/* @__PURE__ */ e("option", { value: "declined", children: "Declined" }),
|
|
157
|
+
/* @__PURE__ */ e("option", { value: "checked-in", children: "Checked In" }),
|
|
158
|
+
/* @__PURE__ */ e("option", { value: "no-show", children: "No Show" })
|
|
159
|
+
] })
|
|
160
|
+
] }),
|
|
161
|
+
d.map(([h, l]) => /* @__PURE__ */ t("div", { className: "nice-event-participants__group", children: [
|
|
162
|
+
/* @__PURE__ */ t("h4", { className: "nice-event-participants__role-label", children: [
|
|
163
|
+
Z[h],
|
|
164
|
+
" (",
|
|
165
|
+
l.length,
|
|
166
|
+
")"
|
|
167
|
+
] }),
|
|
168
|
+
l.map((o) => /* @__PURE__ */ t(
|
|
169
|
+
"div",
|
|
170
|
+
{
|
|
171
|
+
className: `nice-event-participants__item ${o.id === y ? "nice-event-participants__item--self" : ""}`,
|
|
172
|
+
onClick: () => S == null ? void 0 : S(o),
|
|
173
|
+
children: [
|
|
174
|
+
o.avatarUrl ? /* @__PURE__ */ e("img", { src: o.avatarUrl, alt: "", className: "nice-event-participants__avatar" }) : /* @__PURE__ */ e("span", { className: "nice-event-participants__avatar-placeholder", children: o.name.charAt(0) }),
|
|
175
|
+
/* @__PURE__ */ t("div", { className: "nice-event-participants__info", children: [
|
|
176
|
+
/* @__PURE__ */ e("span", { className: "nice-event-participants__name", children: o.name }),
|
|
177
|
+
/* @__PURE__ */ e("span", { className: "nice-event-participants__status", style: { color: X[o.status] }, children: o.status }),
|
|
178
|
+
o.score != null && /* @__PURE__ */ t("span", { className: "nice-event-participants__score", children: [
|
|
179
|
+
"Score: ",
|
|
180
|
+
o.score
|
|
181
|
+
] })
|
|
182
|
+
] }),
|
|
183
|
+
N && o.qrCode && /* @__PURE__ */ e("span", { className: "nice-event-participants__qr", title: "QR Code", children: "๐ฑ" }),
|
|
184
|
+
f && /* @__PURE__ */ t("div", { className: "nice-event-participants__actions", children: [
|
|
185
|
+
_ && /* @__PURE__ */ e(
|
|
186
|
+
"select",
|
|
187
|
+
{
|
|
188
|
+
value: o.role,
|
|
189
|
+
onChange: (I) => _(o.id, I.target.value),
|
|
190
|
+
onClick: (I) => I.stopPropagation(),
|
|
191
|
+
children: Object.entries(Z).map(([I, O]) => /* @__PURE__ */ e("option", { value: I, children: O }, I))
|
|
192
|
+
}
|
|
193
|
+
),
|
|
194
|
+
g && o.status === "confirmed" && /* @__PURE__ */ e("button", { onClick: (I) => {
|
|
195
|
+
I.stopPropagation(), g(o.id);
|
|
196
|
+
}, children: "Check In" }),
|
|
197
|
+
v && o.role !== "host" && /* @__PURE__ */ e("button", { onClick: (I) => {
|
|
198
|
+
I.stopPropagation(), v(o.id);
|
|
199
|
+
}, children: "Remove" })
|
|
200
|
+
] })
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
o.id
|
|
204
|
+
))
|
|
205
|
+
] }, h))
|
|
206
|
+
] });
|
|
207
|
+
}), Ce = P(function(x, A) {
|
|
208
|
+
const {
|
|
209
|
+
items: a,
|
|
210
|
+
onUpload: y,
|
|
211
|
+
onDelete: m,
|
|
212
|
+
onLike: v,
|
|
213
|
+
onItemClick: _,
|
|
214
|
+
layout: g = "grid",
|
|
215
|
+
uploadEnabled: S = !0,
|
|
216
|
+
typeFilter: N = "all",
|
|
217
|
+
className: f,
|
|
218
|
+
style: C
|
|
219
|
+
} = x, [s, u] = w(""), k = R(() => N === "all" ? a : a.filter((p) => p.type === N), [a, N]), b = (p) => {
|
|
220
|
+
var n;
|
|
221
|
+
const c = (n = p.target.files) == null ? void 0 : n[0];
|
|
222
|
+
!c || !y || (y(c, s.trim() || void 0), u(""), p.target.value = "");
|
|
223
|
+
};
|
|
224
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-event-media nice-event-media--${g} ${f ?? ""}`, style: C, children: [
|
|
225
|
+
/* @__PURE__ */ e("div", { className: "nice-event-media__header", children: /* @__PURE__ */ t("h3", { children: [
|
|
226
|
+
"Media (",
|
|
227
|
+
k.length,
|
|
228
|
+
")"
|
|
229
|
+
] }) }),
|
|
230
|
+
S && y && /* @__PURE__ */ t("div", { className: "nice-event-media__upload", children: [
|
|
231
|
+
/* @__PURE__ */ e("input", { type: "file", accept: "image/*,video/*", onChange: b }),
|
|
232
|
+
/* @__PURE__ */ e(
|
|
233
|
+
"input",
|
|
234
|
+
{
|
|
235
|
+
type: "text",
|
|
236
|
+
value: s,
|
|
237
|
+
onChange: (p) => u(p.target.value),
|
|
238
|
+
placeholder: "Add a captionโฆ",
|
|
239
|
+
className: "nice-event-media__caption-input"
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
] }),
|
|
243
|
+
k.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-media__empty", children: "No media yet." }) : /* @__PURE__ */ e("div", { className: `nice-event-media__gallery nice-event-media__gallery--${g}`, children: k.map((p) => /* @__PURE__ */ t(
|
|
244
|
+
"div",
|
|
245
|
+
{
|
|
246
|
+
className: "nice-event-media__item",
|
|
247
|
+
onClick: () => _ == null ? void 0 : _(p),
|
|
248
|
+
role: _ ? "button" : void 0,
|
|
249
|
+
children: [
|
|
250
|
+
p.type === "photo" ? /* @__PURE__ */ e(
|
|
251
|
+
"img",
|
|
252
|
+
{
|
|
253
|
+
src: p.thumbnailUrl ?? p.url,
|
|
254
|
+
alt: p.caption ?? "",
|
|
255
|
+
className: "nice-event-media__thumb"
|
|
256
|
+
}
|
|
257
|
+
) : /* @__PURE__ */ e("div", { className: "nice-event-media__video-thumb", children: /* @__PURE__ */ e("span", { children: "โถ" }) }),
|
|
258
|
+
/* @__PURE__ */ t("div", { className: "nice-event-media__overlay", children: [
|
|
259
|
+
p.caption && /* @__PURE__ */ e("span", { className: "nice-event-media__item-caption", children: p.caption }),
|
|
260
|
+
/* @__PURE__ */ e("span", { className: "nice-event-media__uploader", children: p.uploadedByName }),
|
|
261
|
+
/* @__PURE__ */ t("div", { className: "nice-event-media__item-actions", children: [
|
|
262
|
+
v && /* @__PURE__ */ t("button", { onClick: (c) => {
|
|
263
|
+
c.stopPropagation(), v(p.id);
|
|
264
|
+
}, children: [
|
|
265
|
+
"โค๏ธ ",
|
|
266
|
+
p.likes ?? 0
|
|
267
|
+
] }),
|
|
268
|
+
m && /* @__PURE__ */ e("button", { onClick: (c) => {
|
|
269
|
+
c.stopPropagation(), m(p.id);
|
|
270
|
+
}, children: "๐๏ธ" })
|
|
271
|
+
] })
|
|
272
|
+
] })
|
|
273
|
+
]
|
|
274
|
+
},
|
|
275
|
+
p.id
|
|
276
|
+
)) })
|
|
277
|
+
] });
|
|
278
|
+
}), Se = P(function(x, A) {
|
|
279
|
+
var G, K, H, Y, J;
|
|
280
|
+
const {
|
|
281
|
+
event: a,
|
|
282
|
+
surveys: y = [],
|
|
283
|
+
billing: m = [],
|
|
284
|
+
onUpdateEvent: v,
|
|
285
|
+
onUpdateLocation: _,
|
|
286
|
+
onAddSurvey: g,
|
|
287
|
+
onSurveyRespond: S,
|
|
288
|
+
onAddBilling: N,
|
|
289
|
+
editable: f = !1,
|
|
290
|
+
className: C,
|
|
291
|
+
style: s
|
|
292
|
+
} = x, [u, k] = w("details"), [b, p] = w(a.title), [c, n] = w(a.description ?? ""), [d, i] = w(a.startDate ?? ""), [h, l] = w(a.endDate ?? ""), [o, I] = w(((G = a.location) == null ? void 0 : G.name) ?? ""), [O, te] = w(((K = a.location) == null ? void 0 : K.address) ?? ""), [z, ne] = w(((H = a.location) == null ? void 0 : H.virtualUrl) ?? ""), [B, ie] = w(((Y = a.location) == null ? void 0 : Y.isVirtual) ?? !1), [T, F] = w(""), [D, ae] = w("single"), [U, Q] = w(""), [V, W] = w(""), [q, j] = w(""), [M, ce] = w("PLN"), le = E(() => {
|
|
293
|
+
v == null || v({
|
|
294
|
+
title: b,
|
|
295
|
+
description: c || void 0,
|
|
296
|
+
startDate: d || void 0,
|
|
297
|
+
endDate: h || void 0
|
|
298
|
+
});
|
|
299
|
+
}, [b, c, d, h, v]), re = E(() => {
|
|
300
|
+
_ == null || _({
|
|
301
|
+
name: o,
|
|
302
|
+
address: O || void 0,
|
|
303
|
+
virtualUrl: z || void 0,
|
|
304
|
+
isVirtual: B
|
|
305
|
+
});
|
|
306
|
+
}, [o, O, z, B, _]), se = E(() => {
|
|
307
|
+
if (!T.trim() || !g) return;
|
|
308
|
+
const r = U.split(",").map(($) => $.trim()).filter(Boolean);
|
|
309
|
+
g(T.trim(), D, r.length > 0 ? r : void 0), F(""), Q("");
|
|
310
|
+
}, [T, D, U, g]), oe = E(() => {
|
|
311
|
+
!V.trim() || !N || (N({
|
|
312
|
+
label: V.trim(),
|
|
313
|
+
amount: parseFloat(q) || 0,
|
|
314
|
+
currency: M
|
|
315
|
+
}), W(""), j(""));
|
|
316
|
+
}, [V, q, M, N]), de = m.reduce((r, $) => r + $.amount, 0);
|
|
317
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-event-planning ${C ?? ""}`, style: s, children: [
|
|
318
|
+
/* @__PURE__ */ e("div", { className: "nice-event-planning__tabs", children: ["details", "location", "surveys", "billing"].map((r) => /* @__PURE__ */ e(
|
|
319
|
+
"button",
|
|
320
|
+
{
|
|
321
|
+
className: `nice-event-planning__tab ${u === r ? "nice-event-planning__tab--active" : ""}`,
|
|
322
|
+
onClick: () => k(r),
|
|
323
|
+
children: r.charAt(0).toUpperCase() + r.slice(1)
|
|
324
|
+
},
|
|
325
|
+
r
|
|
326
|
+
)) }),
|
|
327
|
+
u === "details" && /* @__PURE__ */ t("div", { className: "nice-event-planning__section", children: [
|
|
328
|
+
/* @__PURE__ */ t("label", { children: [
|
|
329
|
+
"Title",
|
|
330
|
+
/* @__PURE__ */ e("input", { type: "text", value: b, onChange: (r) => p(r.target.value), readOnly: !f })
|
|
331
|
+
] }),
|
|
332
|
+
/* @__PURE__ */ t("label", { children: [
|
|
333
|
+
"Description",
|
|
334
|
+
/* @__PURE__ */ e("textarea", { value: c, onChange: (r) => n(r.target.value), readOnly: !f, rows: 3 })
|
|
335
|
+
] }),
|
|
336
|
+
/* @__PURE__ */ t("label", { children: [
|
|
337
|
+
"Start",
|
|
338
|
+
/* @__PURE__ */ e("input", { type: "datetime-local", value: d, onChange: (r) => i(r.target.value), readOnly: !f })
|
|
339
|
+
] }),
|
|
340
|
+
/* @__PURE__ */ t("label", { children: [
|
|
341
|
+
"End",
|
|
342
|
+
/* @__PURE__ */ e("input", { type: "datetime-local", value: h, onChange: (r) => l(r.target.value), readOnly: !f })
|
|
343
|
+
] }),
|
|
344
|
+
/* @__PURE__ */ t("div", { className: "nice-event-planning__status", children: [
|
|
345
|
+
"Status: ",
|
|
346
|
+
/* @__PURE__ */ e("strong", { children: a.status })
|
|
347
|
+
] }),
|
|
348
|
+
f && /* @__PURE__ */ e("button", { onClick: le, children: "Save Details" })
|
|
349
|
+
] }),
|
|
350
|
+
u === "location" && /* @__PURE__ */ t("div", { className: "nice-event-planning__section", children: [
|
|
351
|
+
/* @__PURE__ */ t("label", { children: [
|
|
352
|
+
/* @__PURE__ */ e("input", { type: "checkbox", checked: B, onChange: (r) => ie(r.target.checked), disabled: !f }),
|
|
353
|
+
" Virtual event"
|
|
354
|
+
] }),
|
|
355
|
+
/* @__PURE__ */ t("label", { children: [
|
|
356
|
+
"Venue Name",
|
|
357
|
+
/* @__PURE__ */ e("input", { type: "text", value: o, onChange: (r) => I(r.target.value), readOnly: !f })
|
|
358
|
+
] }),
|
|
359
|
+
!B && /* @__PURE__ */ t("label", { children: [
|
|
360
|
+
"Address",
|
|
361
|
+
/* @__PURE__ */ e("input", { type: "text", value: O, onChange: (r) => te(r.target.value), readOnly: !f })
|
|
362
|
+
] }),
|
|
363
|
+
B && /* @__PURE__ */ t("label", { children: [
|
|
364
|
+
"Virtual URL",
|
|
365
|
+
/* @__PURE__ */ e("input", { type: "url", value: z, onChange: (r) => ne(r.target.value), readOnly: !f })
|
|
366
|
+
] }),
|
|
367
|
+
f && /* @__PURE__ */ e("button", { onClick: re, children: "Save Location" })
|
|
368
|
+
] }),
|
|
369
|
+
u === "surveys" && /* @__PURE__ */ t("div", { className: "nice-event-planning__section", children: [
|
|
370
|
+
y.length === 0 ? /* @__PURE__ */ e("p", { children: "No surveys yet." }) : y.map((r) => /* @__PURE__ */ t("div", { className: "nice-event-planning__survey", children: [
|
|
371
|
+
/* @__PURE__ */ e("strong", { children: r.question }),
|
|
372
|
+
/* @__PURE__ */ t("span", { className: "nice-event-planning__survey-type", children: [
|
|
373
|
+
"(",
|
|
374
|
+
r.type,
|
|
375
|
+
")"
|
|
376
|
+
] }),
|
|
377
|
+
r.options && /* @__PURE__ */ e("div", { className: "nice-event-planning__survey-options", children: r.options.map(($, he) => /* @__PURE__ */ e("button", { onClick: () => S == null ? void 0 : S(r.id, $), children: $ }, he)) }),
|
|
378
|
+
r.responses && /* @__PURE__ */ t("span", { children: [
|
|
379
|
+
r.responses.length,
|
|
380
|
+
" responses"
|
|
381
|
+
] })
|
|
382
|
+
] }, r.id)),
|
|
383
|
+
f && g && /* @__PURE__ */ t("div", { className: "nice-event-planning__add-survey", children: [
|
|
384
|
+
/* @__PURE__ */ e("h4", { children: "Add Survey" }),
|
|
385
|
+
/* @__PURE__ */ e("input", { type: "text", value: T, onChange: (r) => F(r.target.value), placeholder: "Question" }),
|
|
386
|
+
/* @__PURE__ */ t("select", { value: D, onChange: (r) => ae(r.target.value), children: [
|
|
387
|
+
/* @__PURE__ */ e("option", { value: "single", children: "Single choice" }),
|
|
388
|
+
/* @__PURE__ */ e("option", { value: "multiple", children: "Multiple choice" }),
|
|
389
|
+
/* @__PURE__ */ e("option", { value: "text", children: "Free text" }),
|
|
390
|
+
/* @__PURE__ */ e("option", { value: "rating", children: "Rating" })
|
|
391
|
+
] }),
|
|
392
|
+
/* @__PURE__ */ e("input", { type: "text", value: U, onChange: (r) => Q(r.target.value), placeholder: "Options (comma-separated)" }),
|
|
393
|
+
/* @__PURE__ */ e("button", { onClick: se, disabled: !T.trim(), children: "Add" })
|
|
394
|
+
] })
|
|
395
|
+
] }),
|
|
396
|
+
u === "billing" && /* @__PURE__ */ t("div", { className: "nice-event-planning__section", children: [
|
|
397
|
+
m.length === 0 ? /* @__PURE__ */ e("p", { children: "No billing items yet." }) : /* @__PURE__ */ t(ue, { children: [
|
|
398
|
+
/* @__PURE__ */ t("table", { className: "nice-event-planning__billing-table", children: [
|
|
399
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
|
|
400
|
+
/* @__PURE__ */ e("th", { children: "Item" }),
|
|
401
|
+
/* @__PURE__ */ e("th", { children: "Amount" }),
|
|
402
|
+
/* @__PURE__ */ e("th", { children: "Paid by" }),
|
|
403
|
+
/* @__PURE__ */ e("th", { children: "Status" })
|
|
404
|
+
] }) }),
|
|
405
|
+
/* @__PURE__ */ e("tbody", { children: m.map((r) => /* @__PURE__ */ t("tr", { children: [
|
|
406
|
+
/* @__PURE__ */ e("td", { children: r.label }),
|
|
407
|
+
/* @__PURE__ */ t("td", { children: [
|
|
408
|
+
r.amount.toFixed(2),
|
|
409
|
+
" ",
|
|
410
|
+
r.currency
|
|
411
|
+
] }),
|
|
412
|
+
/* @__PURE__ */ e("td", { children: r.paidByName ?? "โ" }),
|
|
413
|
+
/* @__PURE__ */ e("td", { children: r.isPaid ? "โ
Paid" : "โณ Pending" })
|
|
414
|
+
] }, r.id)) })
|
|
415
|
+
] }),
|
|
416
|
+
/* @__PURE__ */ t("div", { className: "nice-event-planning__billing-total", children: [
|
|
417
|
+
"Total: ",
|
|
418
|
+
/* @__PURE__ */ t("strong", { children: [
|
|
419
|
+
de.toFixed(2),
|
|
420
|
+
" ",
|
|
421
|
+
((J = m[0]) == null ? void 0 : J.currency) ?? ""
|
|
422
|
+
] })
|
|
423
|
+
] })
|
|
424
|
+
] }),
|
|
425
|
+
f && N && /* @__PURE__ */ t("div", { className: "nice-event-planning__add-billing", children: [
|
|
426
|
+
/* @__PURE__ */ e("input", { type: "text", value: V, onChange: (r) => W(r.target.value), placeholder: "Item" }),
|
|
427
|
+
/* @__PURE__ */ e("input", { type: "number", value: q, onChange: (r) => j(r.target.value), placeholder: "Amount", min: 0, step: 0.01 }),
|
|
428
|
+
/* @__PURE__ */ t("select", { value: M, onChange: (r) => ce(r.target.value), children: [
|
|
429
|
+
/* @__PURE__ */ e("option", { value: "PLN", children: "PLN" }),
|
|
430
|
+
/* @__PURE__ */ e("option", { value: "EUR", children: "EUR" }),
|
|
431
|
+
/* @__PURE__ */ e("option", { value: "USD", children: "USD" }),
|
|
432
|
+
/* @__PURE__ */ e("option", { value: "GBP", children: "GBP" })
|
|
433
|
+
] }),
|
|
434
|
+
/* @__PURE__ */ e("button", { onClick: oe, disabled: !V.trim(), children: "Add" })
|
|
435
|
+
] })
|
|
436
|
+
] })
|
|
437
|
+
] });
|
|
438
|
+
}), ve = {
|
|
439
|
+
upcoming: "โณ",
|
|
440
|
+
active: "โถ๏ธ",
|
|
441
|
+
voting: "๐ณ๏ธ",
|
|
442
|
+
scored: "๐",
|
|
443
|
+
completed: "โ
",
|
|
444
|
+
skipped: "โญ๏ธ"
|
|
445
|
+
}, ge = {
|
|
446
|
+
upcoming: "#9ca3af",
|
|
447
|
+
active: "#22c55e",
|
|
448
|
+
voting: "#eab308",
|
|
449
|
+
scored: "#3b82f6",
|
|
450
|
+
completed: "#6b7280",
|
|
451
|
+
skipped: "#d1d5db"
|
|
452
|
+
}, we = P(function(x, A) {
|
|
453
|
+
const {
|
|
454
|
+
rounds: a,
|
|
455
|
+
activeRoundId: y,
|
|
456
|
+
onSelect: m,
|
|
457
|
+
onStart: v,
|
|
458
|
+
onEnd: _,
|
|
459
|
+
onCreate: g,
|
|
460
|
+
editable: S = !1,
|
|
461
|
+
className: N,
|
|
462
|
+
style: f
|
|
463
|
+
} = x, C = [...a].sort((s, u) => s.order - u.order);
|
|
464
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-round-list ${N ?? ""}`, style: f, children: [
|
|
465
|
+
/* @__PURE__ */ t("div", { className: "nice-round-list__header", children: [
|
|
466
|
+
/* @__PURE__ */ t("h3", { children: [
|
|
467
|
+
"Rounds (",
|
|
468
|
+
a.length,
|
|
469
|
+
")"
|
|
470
|
+
] }),
|
|
471
|
+
S && g && /* @__PURE__ */ e("button", { onClick: g, children: "+ Add Round" })
|
|
472
|
+
] }),
|
|
473
|
+
C.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-round-list__empty", children: "No rounds yet." }) : /* @__PURE__ */ e("div", { className: "nice-round-list__items", children: C.map((s) => {
|
|
474
|
+
const u = s.id === y;
|
|
475
|
+
return /* @__PURE__ */ t(
|
|
476
|
+
"div",
|
|
477
|
+
{
|
|
478
|
+
className: `nice-round-list__item ${u ? "nice-round-list__item--active" : ""}`,
|
|
479
|
+
onClick: () => m == null ? void 0 : m(s),
|
|
480
|
+
role: m ? "button" : void 0,
|
|
481
|
+
tabIndex: m ? 0 : void 0,
|
|
482
|
+
children: [
|
|
483
|
+
/* @__PURE__ */ t("span", { className: "nice-round-list__order", children: [
|
|
484
|
+
"#",
|
|
485
|
+
s.order
|
|
486
|
+
] }),
|
|
487
|
+
/* @__PURE__ */ e("span", { className: "nice-round-list__icon", children: ve[s.status] }),
|
|
488
|
+
/* @__PURE__ */ t("div", { className: "nice-round-list__info", children: [
|
|
489
|
+
/* @__PURE__ */ e("strong", { className: "nice-round-list__name", children: s.name }),
|
|
490
|
+
s.description && /* @__PURE__ */ e("small", { children: s.description }),
|
|
491
|
+
s.type && /* @__PURE__ */ e("span", { className: "nice-round-list__type", children: s.type })
|
|
492
|
+
] }),
|
|
493
|
+
/* @__PURE__ */ e("span", { className: "nice-round-list__status", style: { color: ge[s.status] }, children: s.status }),
|
|
494
|
+
s.durationMinutes && /* @__PURE__ */ t("span", { className: "nice-round-list__duration", children: [
|
|
495
|
+
s.durationMinutes,
|
|
496
|
+
"m"
|
|
497
|
+
] }),
|
|
498
|
+
s.winnerIds && s.winnerIds.length > 0 && /* @__PURE__ */ t("span", { className: "nice-round-list__winners", children: [
|
|
499
|
+
"๐ ",
|
|
500
|
+
s.winnerIds.length
|
|
501
|
+
] }),
|
|
502
|
+
S && /* @__PURE__ */ t("div", { className: "nice-round-list__actions", onClick: (k) => k.stopPropagation(), children: [
|
|
503
|
+
s.status === "upcoming" && v && /* @__PURE__ */ e("button", { onClick: () => v(s.id), children: "Start" }),
|
|
504
|
+
(s.status === "active" || s.status === "voting") && _ && /* @__PURE__ */ e("button", { onClick: () => _(s.id), children: "End" })
|
|
505
|
+
] })
|
|
506
|
+
]
|
|
507
|
+
},
|
|
508
|
+
s.id
|
|
509
|
+
);
|
|
510
|
+
}) })
|
|
511
|
+
] });
|
|
512
|
+
}), xe = P(function(x, A) {
|
|
513
|
+
const {
|
|
514
|
+
round: a,
|
|
515
|
+
timerRunning: y = !1,
|
|
516
|
+
remainingSeconds: m,
|
|
517
|
+
onSubmitScore: v,
|
|
518
|
+
onStart: _,
|
|
519
|
+
onEnd: g,
|
|
520
|
+
onSkip: S,
|
|
521
|
+
editable: N = !1,
|
|
522
|
+
footerActions: f,
|
|
523
|
+
className: C,
|
|
524
|
+
style: s
|
|
525
|
+
} = x, [u, k] = w({}), b = E((n) => {
|
|
526
|
+
const d = parseFloat(u[n] ?? "");
|
|
527
|
+
isNaN(d) || !v || (v(n, d), k((i) => ({ ...i, [n]: "" })));
|
|
528
|
+
}, [u, v]), p = (n) => {
|
|
529
|
+
const d = Math.floor(n / 60), i = n % 60;
|
|
530
|
+
return `${d}:${i.toString().padStart(2, "0")}`;
|
|
531
|
+
}, c = a.scores ? [...a.scores].sort((n, d) => d.score - n.score) : [];
|
|
532
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-round-card nice-round-card--${a.status} ${C ?? ""}`, style: s, children: [
|
|
533
|
+
/* @__PURE__ */ t("div", { className: "nice-round-card__header", children: [
|
|
534
|
+
/* @__PURE__ */ t("span", { className: "nice-round-card__order", children: [
|
|
535
|
+
"Round #",
|
|
536
|
+
a.order
|
|
537
|
+
] }),
|
|
538
|
+
/* @__PURE__ */ e("h3", { className: "nice-round-card__name", children: a.name }),
|
|
539
|
+
/* @__PURE__ */ e("span", { className: "nice-round-card__status", children: a.status })
|
|
540
|
+
] }),
|
|
541
|
+
a.description && /* @__PURE__ */ e("p", { className: "nice-round-card__description", children: a.description }),
|
|
542
|
+
(y || m != null) && /* @__PURE__ */ t("div", { className: `nice-round-card__timer ${y ? "nice-round-card__timer--running" : ""}`, children: [
|
|
543
|
+
"โฑ๏ธ ",
|
|
544
|
+
m != null ? p(m) : "โ"
|
|
545
|
+
] }),
|
|
546
|
+
c.length > 0 && /* @__PURE__ */ t("div", { className: "nice-round-card__scoreboard", children: [
|
|
547
|
+
/* @__PURE__ */ e("h4", { children: "Scoreboard" }),
|
|
548
|
+
/* @__PURE__ */ t("table", { className: "nice-round-card__scores-table", children: [
|
|
549
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
|
|
550
|
+
/* @__PURE__ */ e("th", { children: "Rank" }),
|
|
551
|
+
/* @__PURE__ */ e("th", { children: "Participant" }),
|
|
552
|
+
/* @__PURE__ */ e("th", { children: "Score" })
|
|
553
|
+
] }) }),
|
|
554
|
+
/* @__PURE__ */ e("tbody", { children: c.map((n, d) => /* @__PURE__ */ t("tr", { className: d < 3 ? `nice-round-card__top-${d + 1}` : "", children: [
|
|
555
|
+
/* @__PURE__ */ t("td", { children: [
|
|
556
|
+
n.rank ?? d + 1,
|
|
557
|
+
d === 0 ? " ๐ฅ" : d === 1 ? " ๐ฅ" : d === 2 ? " ๐ฅ" : ""
|
|
558
|
+
] }),
|
|
559
|
+
/* @__PURE__ */ e("td", { children: n.participantName }),
|
|
560
|
+
/* @__PURE__ */ e("td", { children: n.score })
|
|
561
|
+
] }, n.participantId)) })
|
|
562
|
+
] })
|
|
563
|
+
] }),
|
|
564
|
+
v && (a.status === "active" || a.status === "voting") && c.length > 0 && /* @__PURE__ */ t("div", { className: "nice-round-card__score-input", children: [
|
|
565
|
+
/* @__PURE__ */ e("h4", { children: "Submit Scores" }),
|
|
566
|
+
c.map((n) => /* @__PURE__ */ t("div", { className: "nice-round-card__score-row", children: [
|
|
567
|
+
/* @__PURE__ */ e("span", { children: n.participantName }),
|
|
568
|
+
/* @__PURE__ */ e(
|
|
569
|
+
"input",
|
|
570
|
+
{
|
|
571
|
+
type: "number",
|
|
572
|
+
value: u[n.participantId] ?? "",
|
|
573
|
+
onChange: (d) => k((i) => ({ ...i, [n.participantId]: d.target.value })),
|
|
574
|
+
min: 0,
|
|
575
|
+
step: 1,
|
|
576
|
+
placeholder: "Score"
|
|
577
|
+
}
|
|
578
|
+
),
|
|
579
|
+
/* @__PURE__ */ e("button", { onClick: () => b(n.participantId), children: "Submit" })
|
|
580
|
+
] }, n.participantId))
|
|
581
|
+
] }),
|
|
582
|
+
/* @__PURE__ */ t("div", { className: "nice-round-card__footer", children: [
|
|
583
|
+
N && /* @__PURE__ */ t("div", { className: "nice-round-card__actions", children: [
|
|
584
|
+
a.status === "upcoming" && _ && /* @__PURE__ */ e("button", { onClick: _, children: "โถ Start Round" }),
|
|
585
|
+
(a.status === "active" || a.status === "voting") && g && /* @__PURE__ */ e("button", { onClick: g, children: "โน End Round" }),
|
|
586
|
+
a.status === "upcoming" && S && /* @__PURE__ */ e("button", { onClick: S, children: "โญ Skip" })
|
|
587
|
+
] }),
|
|
588
|
+
f
|
|
589
|
+
] }),
|
|
590
|
+
a.winnerIds && a.winnerIds.length > 0 && /* @__PURE__ */ t("div", { className: "nice-round-card__winners", children: [
|
|
591
|
+
"๐ Winners: ",
|
|
592
|
+
a.winnerIds.length
|
|
593
|
+
] })
|
|
594
|
+
] });
|
|
595
|
+
}), Ae = P(function(x, A) {
|
|
596
|
+
const {
|
|
597
|
+
songs: a,
|
|
598
|
+
onAdd: y,
|
|
599
|
+
onRemove: m,
|
|
600
|
+
onVote: v,
|
|
601
|
+
onSearch: _,
|
|
602
|
+
showQueue: g = !0,
|
|
603
|
+
readOnly: S = !1,
|
|
604
|
+
className: N,
|
|
605
|
+
style: f
|
|
606
|
+
} = x, [C, s] = w(""), u = R(() => {
|
|
607
|
+
if (!C.trim()) return a;
|
|
608
|
+
const n = C.toLowerCase();
|
|
609
|
+
return a.filter(
|
|
610
|
+
(d) => d.title.toLowerCase().includes(n) || d.artist.toLowerCase().includes(n)
|
|
611
|
+
);
|
|
612
|
+
}, [a, C]), k = R(() => a.filter((n) => n.isQueued), [a]), b = a.find((n) => n.isPlaying), p = (n) => {
|
|
613
|
+
s(n), _ == null || _(n);
|
|
614
|
+
}, c = (n) => {
|
|
615
|
+
if (!n) return "";
|
|
616
|
+
const d = Math.floor(n / 60), i = n % 60;
|
|
617
|
+
return `${d}:${i.toString().padStart(2, "0")}`;
|
|
618
|
+
};
|
|
619
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-song-picker ${N ?? ""}`, style: f, children: [
|
|
620
|
+
b && /* @__PURE__ */ t("div", { className: "nice-song-picker__now-playing", children: [
|
|
621
|
+
/* @__PURE__ */ e("span", { className: "nice-song-picker__np-label", children: "๐ต Now Playing" }),
|
|
622
|
+
b.albumArt && /* @__PURE__ */ e("img", { src: b.albumArt, alt: "", className: "nice-song-picker__album-art" }),
|
|
623
|
+
/* @__PURE__ */ e("strong", { children: b.title }),
|
|
624
|
+
/* @__PURE__ */ e("span", { children: b.artist })
|
|
625
|
+
] }),
|
|
626
|
+
/* @__PURE__ */ e(
|
|
627
|
+
"input",
|
|
628
|
+
{
|
|
629
|
+
type: "text",
|
|
630
|
+
value: C,
|
|
631
|
+
onChange: (n) => p(n.target.value),
|
|
632
|
+
placeholder: "Search songsโฆ",
|
|
633
|
+
className: "nice-song-picker__search"
|
|
634
|
+
}
|
|
635
|
+
),
|
|
636
|
+
/* @__PURE__ */ e("div", { className: "nice-song-picker__list", children: u.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-song-picker__empty", children: "No songs found." }) : u.map((n) => /* @__PURE__ */ t("div", { className: `nice-song-picker__item ${n.isPlaying ? "nice-song-picker__item--playing" : ""}`, children: [
|
|
637
|
+
n.albumArt && /* @__PURE__ */ e("img", { src: n.albumArt, alt: "", className: "nice-song-picker__thumb" }),
|
|
638
|
+
/* @__PURE__ */ t("div", { className: "nice-song-picker__info", children: [
|
|
639
|
+
/* @__PURE__ */ e("strong", { children: n.title }),
|
|
640
|
+
/* @__PURE__ */ e("span", { children: n.artist }),
|
|
641
|
+
n.duration && /* @__PURE__ */ e("span", { className: "nice-song-picker__duration", children: c(n.duration) }),
|
|
642
|
+
n.addedByName && /* @__PURE__ */ t("small", { children: [
|
|
643
|
+
"Added by ",
|
|
644
|
+
n.addedByName
|
|
645
|
+
] })
|
|
646
|
+
] }),
|
|
647
|
+
!S && /* @__PURE__ */ t("div", { className: "nice-song-picker__actions", children: [
|
|
648
|
+
v && /* @__PURE__ */ t("button", { onClick: () => v(n.id), children: [
|
|
649
|
+
"๐ ",
|
|
650
|
+
n.votes ?? 0
|
|
651
|
+
] }),
|
|
652
|
+
y && !n.isQueued && /* @__PURE__ */ e("button", { onClick: () => y(n.id), children: "+ Queue" }),
|
|
653
|
+
m && n.isQueued && /* @__PURE__ */ e("button", { onClick: () => m(n.id), children: "Remove" })
|
|
654
|
+
] })
|
|
655
|
+
] }, n.id)) }),
|
|
656
|
+
g && k.length > 0 && /* @__PURE__ */ t("div", { className: "nice-song-picker__queue", children: [
|
|
657
|
+
/* @__PURE__ */ t("h4", { children: [
|
|
658
|
+
"Queue (",
|
|
659
|
+
k.length,
|
|
660
|
+
")"
|
|
661
|
+
] }),
|
|
662
|
+
k.map((n, d) => /* @__PURE__ */ t("div", { className: "nice-song-picker__queue-item", children: [
|
|
663
|
+
/* @__PURE__ */ t("span", { className: "nice-song-picker__queue-pos", children: [
|
|
664
|
+
d + 1,
|
|
665
|
+
"."
|
|
666
|
+
] }),
|
|
667
|
+
/* @__PURE__ */ t("span", { children: [
|
|
668
|
+
n.title,
|
|
669
|
+
" โ ",
|
|
670
|
+
n.artist
|
|
671
|
+
] })
|
|
672
|
+
] }, n.id))
|
|
673
|
+
] })
|
|
674
|
+
] });
|
|
675
|
+
}), Ie = P(function(x, A) {
|
|
676
|
+
const {
|
|
677
|
+
songs: a,
|
|
678
|
+
queue: y = [],
|
|
679
|
+
onEnqueue: m,
|
|
680
|
+
onDequeue: v,
|
|
681
|
+
onNext: _,
|
|
682
|
+
nowPlayingId: g,
|
|
683
|
+
readOnly: S = !1,
|
|
684
|
+
className: N,
|
|
685
|
+
style: f
|
|
686
|
+
} = x, [C, s] = w(""), [u, k] = w(""), b = a.find((i) => i.id === g), p = R(() => {
|
|
687
|
+
let i = a;
|
|
688
|
+
if (C.trim()) {
|
|
689
|
+
const h = C.toLowerCase();
|
|
690
|
+
i = i.filter(
|
|
691
|
+
(l) => l.title.toLowerCase().includes(h) || l.artist.toLowerCase().includes(h)
|
|
692
|
+
);
|
|
693
|
+
}
|
|
694
|
+
return u && (i = i.filter((h) => h.difficulty === u)), i;
|
|
695
|
+
}, [a, C, u]), c = R(() => new Set(y.map((i) => i.id)), [y]), n = ["easy", "medium", "hard", "expert"], d = (i) => {
|
|
696
|
+
switch (i) {
|
|
697
|
+
case "easy":
|
|
698
|
+
return "#4caf50";
|
|
699
|
+
case "medium":
|
|
700
|
+
return "#ff9800";
|
|
701
|
+
case "hard":
|
|
702
|
+
return "#f44336";
|
|
703
|
+
case "expert":
|
|
704
|
+
return "#9c27b0";
|
|
705
|
+
default:
|
|
706
|
+
return "#999";
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-karaoke-picker ${N ?? ""}`, style: f, children: [
|
|
710
|
+
b && /* @__PURE__ */ t("div", { className: "nice-karaoke-picker__now-singing", style: { borderLeft: "4px solid #e91e63", padding: "12px", marginBottom: 12, background: "#fce4ec" }, children: [
|
|
711
|
+
/* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: "๐ค Now Singing" }),
|
|
712
|
+
/* @__PURE__ */ t("div", { children: [
|
|
713
|
+
/* @__PURE__ */ e("strong", { children: b.title }),
|
|
714
|
+
" โ ",
|
|
715
|
+
b.artist,
|
|
716
|
+
b.performerName && /* @__PURE__ */ t("span", { children: [
|
|
717
|
+
" (by ",
|
|
718
|
+
b.performerName,
|
|
719
|
+
")"
|
|
720
|
+
] })
|
|
721
|
+
] }),
|
|
722
|
+
!S && _ && /* @__PURE__ */ e("button", { onClick: _, style: { marginTop: 8 }, children: "Skip / Next โญ" })
|
|
723
|
+
] }),
|
|
724
|
+
/* @__PURE__ */ t("div", { className: "nice-karaoke-picker__filters", style: { display: "flex", gap: 8, marginBottom: 12 }, children: [
|
|
725
|
+
/* @__PURE__ */ e(
|
|
726
|
+
"input",
|
|
727
|
+
{
|
|
728
|
+
type: "text",
|
|
729
|
+
value: C,
|
|
730
|
+
onChange: (i) => s(i.target.value),
|
|
731
|
+
placeholder: "Search songs or artistsโฆ",
|
|
732
|
+
style: { flex: 1 }
|
|
733
|
+
}
|
|
734
|
+
),
|
|
735
|
+
/* @__PURE__ */ t("select", { value: u, onChange: (i) => k(i.target.value), children: [
|
|
736
|
+
/* @__PURE__ */ e("option", { value: "", children: "All Difficulties" }),
|
|
737
|
+
n.map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
|
|
738
|
+
] })
|
|
739
|
+
] }),
|
|
740
|
+
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__catalog", children: p.length === 0 ? /* @__PURE__ */ e("p", { children: "No songs match your search." }) : p.map((i) => /* @__PURE__ */ t("div", { className: "nice-karaoke-picker__song", style: { display: "flex", justifyContent: "space-between", alignItems: "center", padding: "8px 0", borderBottom: "1px solid #eee" }, children: [
|
|
741
|
+
/* @__PURE__ */ t("div", { children: [
|
|
742
|
+
/* @__PURE__ */ e("strong", { children: i.title }),
|
|
743
|
+
" โ ",
|
|
744
|
+
i.artist,
|
|
745
|
+
i.difficulty && /* @__PURE__ */ t("span", { style: { marginLeft: 8, fontSize: 12, color: d(i.difficulty), fontWeight: 600 }, children: [
|
|
746
|
+
"[",
|
|
747
|
+
i.difficulty,
|
|
748
|
+
"]"
|
|
749
|
+
] }),
|
|
750
|
+
i.hasLyrics && /* @__PURE__ */ e("span", { style: { marginLeft: 6, fontSize: 12 }, title: "Lyrics available", children: "๐" }),
|
|
751
|
+
i.language && /* @__PURE__ */ t("span", { style: { marginLeft: 6, fontSize: 12, color: "#666" }, children: [
|
|
752
|
+
"(",
|
|
753
|
+
i.language,
|
|
754
|
+
")"
|
|
755
|
+
] })
|
|
756
|
+
] }),
|
|
757
|
+
!S && /* @__PURE__ */ e("div", { children: c.has(i.id) ? /* @__PURE__ */ e("button", { onClick: () => v == null ? void 0 : v(i.id), style: { color: "#f44336" }, children: "Remove" }) : /* @__PURE__ */ e("button", { onClick: () => m == null ? void 0 : m(i.id), children: "๐ค Sing" }) })
|
|
758
|
+
] }, i.id)) }),
|
|
759
|
+
y.length > 0 && /* @__PURE__ */ t("div", { className: "nice-karaoke-picker__queue", style: { marginTop: 16 }, children: [
|
|
760
|
+
/* @__PURE__ */ t("h4", { children: [
|
|
761
|
+
"๐ถ Queue (",
|
|
762
|
+
y.length,
|
|
763
|
+
")"
|
|
764
|
+
] }),
|
|
765
|
+
y.map((i, h) => /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", padding: "4px 0" }, children: [
|
|
766
|
+
/* @__PURE__ */ t("span", { children: [
|
|
767
|
+
/* @__PURE__ */ t("strong", { children: [
|
|
768
|
+
h + 1,
|
|
769
|
+
"."
|
|
770
|
+
] }),
|
|
771
|
+
" ",
|
|
772
|
+
i.title,
|
|
773
|
+
" โ ",
|
|
774
|
+
i.artist,
|
|
775
|
+
i.performerName && /* @__PURE__ */ t("em", { children: [
|
|
776
|
+
" (",
|
|
777
|
+
i.performerName,
|
|
778
|
+
")"
|
|
779
|
+
] })
|
|
780
|
+
] }),
|
|
781
|
+
!S && v && /* @__PURE__ */ e("button", { onClick: () => v(i.id), style: { fontSize: 12 }, children: "โ" })
|
|
782
|
+
] }, i.id))
|
|
783
|
+
] })
|
|
784
|
+
] });
|
|
785
|
+
}), ee = {
|
|
786
|
+
game: "๐ฎ",
|
|
787
|
+
music: "๐ต",
|
|
788
|
+
dance: "๐",
|
|
789
|
+
quiz: "โ",
|
|
790
|
+
karaoke: "๐ค",
|
|
791
|
+
photo: "๐ธ",
|
|
792
|
+
custom: "โจ"
|
|
793
|
+
}, _e = {
|
|
794
|
+
game: "Games",
|
|
795
|
+
music: "Music",
|
|
796
|
+
dance: "Dance",
|
|
797
|
+
quiz: "Quiz",
|
|
798
|
+
karaoke: "Karaoke",
|
|
799
|
+
photo: "Photo",
|
|
800
|
+
custom: "Custom"
|
|
801
|
+
}, Re = P(function(x, A) {
|
|
802
|
+
const {
|
|
803
|
+
attractions: a,
|
|
804
|
+
onSelect: y,
|
|
805
|
+
onDeselect: m,
|
|
806
|
+
onVote: v,
|
|
807
|
+
selectedIds: _ = [],
|
|
808
|
+
maxSelections: g,
|
|
809
|
+
showVotes: S = !0,
|
|
810
|
+
readOnly: N = !1,
|
|
811
|
+
layout: f = "grid",
|
|
812
|
+
className: C,
|
|
813
|
+
style: s
|
|
814
|
+
} = x, [u, k] = w(""), [b, p] = w(""), c = R(() => new Set(_), [_]), n = R(() => {
|
|
815
|
+
const l = new Set(a.map((o) => o.category));
|
|
816
|
+
return Array.from(l);
|
|
817
|
+
}, [a]), d = R(() => {
|
|
818
|
+
let l = a;
|
|
819
|
+
if (u && (l = l.filter((o) => o.category === u)), b.trim()) {
|
|
820
|
+
const o = b.toLowerCase();
|
|
821
|
+
l = l.filter(
|
|
822
|
+
(I) => {
|
|
823
|
+
var O;
|
|
824
|
+
return I.name.toLowerCase().includes(o) || ((O = I.description) == null ? void 0 : O.toLowerCase().includes(o));
|
|
825
|
+
}
|
|
826
|
+
);
|
|
827
|
+
}
|
|
828
|
+
return l;
|
|
829
|
+
}, [a, u, b]), i = !g || c.size < g, h = (l) => {
|
|
830
|
+
N || (c.has(l) ? m == null || m(l) : i && (y == null || y(l)));
|
|
831
|
+
};
|
|
832
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-attraction-picker ${C ?? ""}`, style: s, children: [
|
|
833
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 12 }, children: [
|
|
834
|
+
/* @__PURE__ */ e("h3", { style: { margin: 0 }, children: "Attractions" }),
|
|
835
|
+
g && /* @__PURE__ */ t("span", { style: { color: "#666", fontSize: 14 }, children: [
|
|
836
|
+
c.size,
|
|
837
|
+
"/",
|
|
838
|
+
g,
|
|
839
|
+
" selected"
|
|
840
|
+
] })
|
|
841
|
+
] }),
|
|
842
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 8, marginBottom: 12, flexWrap: "wrap" }, children: [
|
|
843
|
+
/* @__PURE__ */ e(
|
|
844
|
+
"input",
|
|
845
|
+
{
|
|
846
|
+
type: "text",
|
|
847
|
+
value: b,
|
|
848
|
+
onChange: (l) => p(l.target.value),
|
|
849
|
+
placeholder: "Search attractionsโฆ",
|
|
850
|
+
style: { flex: 1, minWidth: 150 }
|
|
851
|
+
}
|
|
852
|
+
),
|
|
853
|
+
/* @__PURE__ */ e(
|
|
854
|
+
"button",
|
|
855
|
+
{
|
|
856
|
+
onClick: () => k(""),
|
|
857
|
+
style: { fontWeight: u ? 400 : 700 },
|
|
858
|
+
children: "All"
|
|
859
|
+
}
|
|
860
|
+
),
|
|
861
|
+
n.map((l) => /* @__PURE__ */ t(
|
|
862
|
+
"button",
|
|
863
|
+
{
|
|
864
|
+
onClick: () => k(l === u ? "" : l),
|
|
865
|
+
style: { fontWeight: l === u ? 700 : 400 },
|
|
866
|
+
children: [
|
|
867
|
+
ee[l],
|
|
868
|
+
" ",
|
|
869
|
+
_e[l]
|
|
870
|
+
]
|
|
871
|
+
},
|
|
872
|
+
l
|
|
873
|
+
))
|
|
874
|
+
] }),
|
|
875
|
+
/* @__PURE__ */ e("div", { style: {
|
|
876
|
+
display: f === "grid" ? "grid" : "flex",
|
|
877
|
+
gridTemplateColumns: f === "grid" ? "repeat(auto-fill, minmax(200px, 1fr))" : void 0,
|
|
878
|
+
gap: 12,
|
|
879
|
+
flexDirection: f === "list" ? "column" : void 0
|
|
880
|
+
}, children: d.length === 0 ? /* @__PURE__ */ e("p", { children: "No attractions found." }) : d.map((l) => {
|
|
881
|
+
const o = c.has(l.id);
|
|
882
|
+
return /* @__PURE__ */ t(
|
|
883
|
+
"div",
|
|
884
|
+
{
|
|
885
|
+
className: "nice-attraction-picker__card",
|
|
886
|
+
style: {
|
|
887
|
+
border: o ? "2px solid #1976d2" : "1px solid #ddd",
|
|
888
|
+
borderRadius: 8,
|
|
889
|
+
padding: 12,
|
|
890
|
+
cursor: N ? "default" : "pointer",
|
|
891
|
+
background: o ? "#e3f2fd" : "#fff",
|
|
892
|
+
transition: "all 0.2s"
|
|
893
|
+
},
|
|
894
|
+
onClick: () => h(l.id),
|
|
895
|
+
children: [
|
|
896
|
+
l.imageUrl && /* @__PURE__ */ e("img", { src: l.imageUrl, alt: l.name, style: { width: "100%", borderRadius: 6, marginBottom: 8, objectFit: "cover", maxHeight: 120 } }),
|
|
897
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
898
|
+
/* @__PURE__ */ e("span", { children: ee[l.category] }),
|
|
899
|
+
/* @__PURE__ */ e("strong", { children: l.name })
|
|
900
|
+
] }),
|
|
901
|
+
l.description && /* @__PURE__ */ e("p", { style: { fontSize: 13, color: "#666", margin: "6px 0" }, children: l.description }),
|
|
902
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginTop: 8 }, children: [
|
|
903
|
+
S && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: [
|
|
904
|
+
"๐ ",
|
|
905
|
+
l.votes ?? 0
|
|
906
|
+
] }),
|
|
907
|
+
!N && v && /* @__PURE__ */ e(
|
|
908
|
+
"button",
|
|
909
|
+
{
|
|
910
|
+
onClick: (I) => {
|
|
911
|
+
I.stopPropagation(), v(l.id);
|
|
912
|
+
},
|
|
913
|
+
style: { fontSize: 12 },
|
|
914
|
+
children: "Vote"
|
|
915
|
+
}
|
|
916
|
+
)
|
|
917
|
+
] })
|
|
918
|
+
]
|
|
919
|
+
},
|
|
920
|
+
l.id
|
|
921
|
+
);
|
|
922
|
+
}) })
|
|
923
|
+
] });
|
|
924
|
+
}), fe = {
|
|
925
|
+
game: "๐ฎ",
|
|
926
|
+
music: "๐ต",
|
|
927
|
+
dance: "๐",
|
|
928
|
+
quiz: "โ",
|
|
929
|
+
karaoke: "๐ค",
|
|
930
|
+
photo: "๐ธ",
|
|
931
|
+
custom: "โจ"
|
|
932
|
+
}, Pe = P(function(x, A) {
|
|
933
|
+
const {
|
|
934
|
+
attractions: a,
|
|
935
|
+
onVote: y,
|
|
936
|
+
onUnvote: m,
|
|
937
|
+
votedIds: v = [],
|
|
938
|
+
maxVotes: _,
|
|
939
|
+
closed: g = !1,
|
|
940
|
+
sortBy: S = "votes",
|
|
941
|
+
showResults: N = !0,
|
|
942
|
+
className: f,
|
|
943
|
+
style: C
|
|
944
|
+
} = x, s = R(() => new Set(v), [v]), u = _ ? _ - s.size : void 0, k = R(() => {
|
|
945
|
+
const n = [...a];
|
|
946
|
+
switch (S) {
|
|
947
|
+
case "votes":
|
|
948
|
+
n.sort((d, i) => (i.votes ?? 0) - (d.votes ?? 0));
|
|
949
|
+
break;
|
|
950
|
+
case "name":
|
|
951
|
+
n.sort((d, i) => d.name.localeCompare(i.name));
|
|
952
|
+
break;
|
|
953
|
+
case "category":
|
|
954
|
+
n.sort((d, i) => d.category.localeCompare(i.category));
|
|
955
|
+
break;
|
|
956
|
+
}
|
|
957
|
+
return n;
|
|
958
|
+
}, [a, S]), b = R(() => Math.max(...a.map((n) => n.votes ?? 0), 1), [a]), p = (n) => {
|
|
959
|
+
g || (s.has(n) ? m == null || m(n) : (!u || u > 0) && (y == null || y(n)));
|
|
960
|
+
}, c = (n) => {
|
|
961
|
+
switch (n) {
|
|
962
|
+
case 0:
|
|
963
|
+
return "๐ฅ";
|
|
964
|
+
case 1:
|
|
965
|
+
return "๐ฅ";
|
|
966
|
+
case 2:
|
|
967
|
+
return "๐ฅ";
|
|
968
|
+
default:
|
|
969
|
+
return `${n + 1}.`;
|
|
970
|
+
}
|
|
971
|
+
};
|
|
972
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-attraction-voting ${f ?? ""}`, style: C, children: [
|
|
973
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 16 }, children: [
|
|
974
|
+
/* @__PURE__ */ e("h3", { style: { margin: 0 }, children: g ? "๐ณ๏ธ Voting Results" : "๐ณ๏ธ Vote for Attractions" }),
|
|
975
|
+
!g && u !== void 0 && /* @__PURE__ */ t("span", { style: { fontSize: 14, color: u > 0 ? "#1976d2" : "#f44336" }, children: [
|
|
976
|
+
u,
|
|
977
|
+
" vote",
|
|
978
|
+
u !== 1 ? "s" : "",
|
|
979
|
+
" remaining"
|
|
980
|
+
] })
|
|
981
|
+
] }),
|
|
982
|
+
g && /* @__PURE__ */ e("p", { style: { color: "#666", marginBottom: 12 }, children: "Voting is closed. Final results:" }),
|
|
983
|
+
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: k.map((n, d) => {
|
|
984
|
+
const i = s.has(n.id), h = n.votes ?? 0, l = N ? `${Math.round(h / b * 100)}%` : "0%";
|
|
985
|
+
return /* @__PURE__ */ t(
|
|
986
|
+
"div",
|
|
987
|
+
{
|
|
988
|
+
style: {
|
|
989
|
+
display: "flex",
|
|
990
|
+
alignItems: "center",
|
|
991
|
+
gap: 12,
|
|
992
|
+
padding: "10px 14px",
|
|
993
|
+
borderRadius: 8,
|
|
994
|
+
border: i ? "2px solid #1976d2" : "1px solid #e0e0e0",
|
|
995
|
+
background: i ? "#e3f2fd" : "#fff",
|
|
996
|
+
cursor: g ? "default" : "pointer",
|
|
997
|
+
transition: "all 0.2s"
|
|
998
|
+
},
|
|
999
|
+
onClick: () => p(n.id),
|
|
1000
|
+
children: [
|
|
1001
|
+
N && /* @__PURE__ */ e("span", { style: { fontSize: 18, minWidth: 32, textAlign: "center" }, children: c(d) }),
|
|
1002
|
+
/* @__PURE__ */ e("span", { style: { fontSize: 20 }, children: fe[n.category] }),
|
|
1003
|
+
/* @__PURE__ */ t("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1004
|
+
/* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children: n.name }),
|
|
1005
|
+
n.description && /* @__PURE__ */ e("div", { style: { fontSize: 13, color: "#666", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: n.description }),
|
|
1006
|
+
N && /* @__PURE__ */ e("div", { style: { marginTop: 4, height: 6, borderRadius: 3, background: "#e0e0e0", overflow: "hidden" }, children: /* @__PURE__ */ e("div", { style: { height: "100%", width: l, background: "#1976d2", borderRadius: 3, transition: "width 0.3s" } }) })
|
|
1007
|
+
] }),
|
|
1008
|
+
N && /* @__PURE__ */ e("span", { style: { fontWeight: 600, fontSize: 16, minWidth: 40, textAlign: "right" }, children: h }),
|
|
1009
|
+
!g && /* @__PURE__ */ e(
|
|
1010
|
+
"button",
|
|
1011
|
+
{
|
|
1012
|
+
onClick: (o) => {
|
|
1013
|
+
o.stopPropagation(), p(n.id);
|
|
1014
|
+
},
|
|
1015
|
+
style: {
|
|
1016
|
+
padding: "4px 12px",
|
|
1017
|
+
borderRadius: 4,
|
|
1018
|
+
border: "none",
|
|
1019
|
+
background: i ? "#f44336" : "#1976d2",
|
|
1020
|
+
color: "#fff",
|
|
1021
|
+
cursor: "pointer",
|
|
1022
|
+
fontSize: 13
|
|
1023
|
+
},
|
|
1024
|
+
children: i ? "Unvote" : "Vote"
|
|
1025
|
+
}
|
|
1026
|
+
)
|
|
1027
|
+
]
|
|
1028
|
+
},
|
|
1029
|
+
n.id
|
|
1030
|
+
);
|
|
1031
|
+
}) }),
|
|
1032
|
+
N && /* @__PURE__ */ t("div", { style: { marginTop: 12, textAlign: "right", fontSize: 13, color: "#666" }, children: [
|
|
1033
|
+
"Total votes: ",
|
|
1034
|
+
a.reduce((n, d) => n + (d.votes ?? 0), 0)
|
|
1035
|
+
] })
|
|
1036
|
+
] });
|
|
1037
|
+
});
|
|
1038
|
+
export {
|
|
1039
|
+
Re as NiceAttractionPicker,
|
|
1040
|
+
Pe as NiceAttractionVoting,
|
|
1041
|
+
be as NiceEventChat,
|
|
1042
|
+
Ce as NiceEventMedia,
|
|
1043
|
+
ke as NiceEventParticipants,
|
|
1044
|
+
Se as NiceEventPlanning,
|
|
1045
|
+
Ie as NiceKaraokePicker,
|
|
1046
|
+
xe as NiceRoundCard,
|
|
1047
|
+
we as NiceRoundList,
|
|
1048
|
+
Ae as NiceSongPicker
|
|
1049
|
+
};
|