@mbpockets/shared-ui 0.2.0 → 0.2.5

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.
Files changed (205) hide show
  1. package/dist/EventPage/editMode/index.cjs.map +1 -1
  2. package/dist/EventPage/editMode/index.d.cts +1 -1
  3. package/dist/EventPage/editMode/index.d.ts +1 -1
  4. package/dist/EventPage/editMode/index.mjs.map +1 -1
  5. package/dist/EventPage/editMode.cjs.map +1 -1
  6. package/dist/EventPage/editMode.d.cts +1 -1
  7. package/dist/EventPage/editMode.d.ts +1 -1
  8. package/dist/EventPage/editMode.mjs.map +1 -1
  9. package/dist/EventPage/index.cjs +121 -63
  10. package/dist/EventPage/index.cjs.map +1 -1
  11. package/dist/EventPage/index.d.cts +1 -1
  12. package/dist/EventPage/index.d.ts +1 -1
  13. package/dist/EventPage/index.mjs +121 -63
  14. package/dist/EventPage/index.mjs.map +1 -1
  15. package/dist/EventPage.cjs +121 -63
  16. package/dist/EventPage.cjs.map +1 -1
  17. package/dist/EventPage.d.cts +4 -4
  18. package/dist/EventPage.d.ts +4 -4
  19. package/dist/EventPage.mjs +121 -63
  20. package/dist/EventPage.mjs.map +1 -1
  21. package/dist/PlayerPage/index.cjs +12 -8
  22. package/dist/PlayerPage/index.cjs.map +1 -1
  23. package/dist/PlayerPage/index.mjs +12 -8
  24. package/dist/PlayerPage/index.mjs.map +1 -1
  25. package/dist/PlayerPage.cjs +12 -8
  26. package/dist/PlayerPage.cjs.map +1 -1
  27. package/dist/PlayerPage.mjs +12 -8
  28. package/dist/PlayerPage.mjs.map +1 -1
  29. package/dist/ProfilePage/index.cjs +12 -8
  30. package/dist/ProfilePage/index.cjs.map +1 -1
  31. package/dist/ProfilePage/index.mjs +12 -8
  32. package/dist/ProfilePage/index.mjs.map +1 -1
  33. package/dist/ProfilePage.cjs +12 -8
  34. package/dist/ProfilePage.cjs.map +1 -1
  35. package/dist/ProfilePage.mjs +12 -8
  36. package/dist/ProfilePage.mjs.map +1 -1
  37. package/dist/SearchPage/Filters/index.cjs +38 -18
  38. package/dist/SearchPage/Filters/index.cjs.map +1 -1
  39. package/dist/SearchPage/Filters/index.d.cts +2 -1
  40. package/dist/SearchPage/Filters/index.d.ts +2 -1
  41. package/dist/SearchPage/Filters/index.mjs +34 -17
  42. package/dist/SearchPage/Filters/index.mjs.map +1 -1
  43. package/dist/SearchPage/Filters.cjs +38 -18
  44. package/dist/SearchPage/Filters.cjs.map +1 -1
  45. package/dist/SearchPage/Filters.d.cts +13 -1
  46. package/dist/SearchPage/Filters.d.ts +13 -1
  47. package/dist/SearchPage/Filters.mjs +34 -17
  48. package/dist/SearchPage/Filters.mjs.map +1 -1
  49. package/dist/SearchPage/Results/index.cjs +87 -48
  50. package/dist/SearchPage/Results/index.cjs.map +1 -1
  51. package/dist/SearchPage/Results/index.mjs +87 -48
  52. package/dist/SearchPage/Results/index.mjs.map +1 -1
  53. package/dist/SearchPage/Results.cjs +87 -48
  54. package/dist/SearchPage/Results.cjs.map +1 -1
  55. package/dist/SearchPage/Results.d.cts +10 -3
  56. package/dist/SearchPage/Results.d.ts +10 -3
  57. package/dist/SearchPage/Results.mjs +87 -48
  58. package/dist/SearchPage/Results.mjs.map +1 -1
  59. package/dist/SearchPage/index.cjs +207 -99
  60. package/dist/SearchPage/index.cjs.map +1 -1
  61. package/dist/SearchPage/index.d.cts +2 -2
  62. package/dist/SearchPage/index.d.ts +2 -2
  63. package/dist/SearchPage/index.mjs +203 -98
  64. package/dist/SearchPage/index.mjs.map +1 -1
  65. package/dist/SearchPage.cjs +207 -99
  66. package/dist/SearchPage.cjs.map +1 -1
  67. package/dist/SearchPage.d.cts +25 -3
  68. package/dist/SearchPage.d.ts +25 -3
  69. package/dist/SearchPage.mjs +203 -98
  70. package/dist/SearchPage.mjs.map +1 -1
  71. package/dist/TablePage/EditComponents/index.cjs +296 -0
  72. package/dist/TablePage/EditComponents/index.cjs.map +1 -0
  73. package/dist/TablePage/EditComponents/index.d.cts +3 -0
  74. package/dist/TablePage/EditComponents/index.d.ts +3 -0
  75. package/dist/TablePage/EditComponents/index.mjs +286 -0
  76. package/dist/TablePage/EditComponents/index.mjs.map +1 -0
  77. package/dist/TablePage/EditComponents.cjs +296 -0
  78. package/dist/TablePage/EditComponents.cjs.map +1 -0
  79. package/dist/TablePage/EditComponents.d.cts +21 -0
  80. package/dist/TablePage/EditComponents.d.ts +21 -0
  81. package/dist/TablePage/EditComponents.mjs +286 -0
  82. package/dist/TablePage/EditComponents.mjs.map +1 -0
  83. package/dist/TablePage/ModalProvider/index.cjs +59 -58
  84. package/dist/TablePage/ModalProvider/index.cjs.map +1 -1
  85. package/dist/TablePage/ModalProvider/index.d.cts +1 -1
  86. package/dist/TablePage/ModalProvider/index.d.ts +1 -1
  87. package/dist/TablePage/ModalProvider/index.mjs +50 -59
  88. package/dist/TablePage/ModalProvider/index.mjs.map +1 -1
  89. package/dist/TablePage/ModalProvider.cjs +59 -58
  90. package/dist/TablePage/ModalProvider.cjs.map +1 -1
  91. package/dist/TablePage/ModalProvider.d.cts +7 -2
  92. package/dist/TablePage/ModalProvider.d.ts +7 -2
  93. package/dist/TablePage/ModalProvider.mjs +50 -59
  94. package/dist/TablePage/ModalProvider.mjs.map +1 -1
  95. package/dist/TablePage/index.cjs +555 -331
  96. package/dist/TablePage/index.cjs.map +1 -1
  97. package/dist/TablePage/index.d.cts +3 -2
  98. package/dist/TablePage/index.d.ts +3 -2
  99. package/dist/TablePage/index.mjs +539 -320
  100. package/dist/TablePage/index.mjs.map +1 -1
  101. package/dist/TablePage/players/index.cjs +24 -4
  102. package/dist/TablePage/players/index.cjs.map +1 -1
  103. package/dist/TablePage/players/index.mjs +24 -4
  104. package/dist/TablePage/players/index.mjs.map +1 -1
  105. package/dist/TablePage/players.cjs +24 -4
  106. package/dist/TablePage/players.cjs.map +1 -1
  107. package/dist/TablePage/players.mjs +24 -4
  108. package/dist/TablePage/players.mjs.map +1 -1
  109. package/dist/TablePage.cjs +555 -331
  110. package/dist/TablePage.cjs.map +1 -1
  111. package/dist/TablePage.d.cts +4 -1
  112. package/dist/TablePage.d.ts +4 -1
  113. package/dist/TablePage.mjs +539 -320
  114. package/dist/TablePage.mjs.map +1 -1
  115. package/dist/{index-D7WHhl3Q.d.ts → index-B23RQop0.d.ts} +12 -12
  116. package/dist/{index-DC0kK3aC.d.cts → index-Csj8S4A4.d.cts} +12 -12
  117. package/dist/index.cjs +889 -424
  118. package/dist/index.cjs.map +1 -1
  119. package/dist/index.d.cts +5 -4
  120. package/dist/index.d.ts +5 -4
  121. package/dist/index.mjs +870 -421
  122. package/dist/index.mjs.map +1 -1
  123. package/dist/mocks/{EventDB.cjs → EventDetails.cjs} +203 -3
  124. package/dist/mocks/EventDetails.cjs.map +1 -0
  125. package/dist/mocks/EventDetails.d.cts +6 -0
  126. package/dist/mocks/EventDetails.d.ts +6 -0
  127. package/dist/mocks/{EventDB.mjs → EventDetails.mjs} +203 -3
  128. package/dist/mocks/EventDetails.mjs.map +1 -0
  129. package/dist/mocks/Tables.cjs +1 -1
  130. package/dist/mocks/Tables.cjs.map +1 -1
  131. package/dist/mocks/Tables.mjs +1 -1
  132. package/dist/mocks/Tables.mjs.map +1 -1
  133. package/dist/mocks/Tags.cjs +200 -0
  134. package/dist/mocks/Tags.cjs.map +1 -1
  135. package/dist/mocks/Tags.mjs +200 -0
  136. package/dist/mocks/Tags.mjs.map +1 -1
  137. package/dist/mocks/index.cjs +202 -2
  138. package/dist/mocks/index.cjs.map +1 -1
  139. package/dist/mocks/index.d.cts +1 -1
  140. package/dist/mocks/index.d.ts +1 -1
  141. package/dist/mocks/index.mjs +202 -2
  142. package/dist/mocks/index.mjs.map +1 -1
  143. package/dist/mocks.cjs +202 -2
  144. package/dist/mocks.cjs.map +1 -1
  145. package/dist/mocks.d.cts +1 -1
  146. package/dist/mocks.d.ts +1 -1
  147. package/dist/mocks.mjs +202 -2
  148. package/dist/mocks.mjs.map +1 -1
  149. package/dist/shared/index.cjs +327 -64
  150. package/dist/shared/index.cjs.map +1 -1
  151. package/dist/shared/index.d.cts +1 -1
  152. package/dist/shared/index.d.ts +1 -1
  153. package/dist/shared/index.mjs +324 -64
  154. package/dist/shared/index.mjs.map +1 -1
  155. package/dist/shared.cjs +327 -64
  156. package/dist/shared.cjs.map +1 -1
  157. package/dist/shared.d.cts +25 -2
  158. package/dist/shared.d.ts +25 -2
  159. package/dist/shared.mjs +324 -64
  160. package/dist/shared.mjs.map +1 -1
  161. package/dist/types/event.d.cts +2 -3
  162. package/dist/types/event.d.ts +2 -3
  163. package/dist/types/index.d.cts +2 -2
  164. package/dist/types/index.d.ts +2 -2
  165. package/dist/types/search.d.cts +7 -1
  166. package/dist/types/search.d.ts +7 -1
  167. package/dist/types/tables.d.cts +1 -0
  168. package/dist/types/tables.d.ts +1 -0
  169. package/dist/types.d.cts +2 -2
  170. package/dist/types.d.ts +2 -2
  171. package/package.json +9 -2
  172. package/dist/TablePage/ModalProvider/index.css +0 -49
  173. package/dist/TablePage/ModalProvider/index.css.map +0 -1
  174. package/dist/TablePage/ModalProvider.css +0 -49
  175. package/dist/TablePage/ModalProvider.css.map +0 -1
  176. package/dist/TablePage/index.css +0 -49
  177. package/dist/TablePage/index.css.map +0 -1
  178. package/dist/TablePage.css +0 -49
  179. package/dist/TablePage.css.map +0 -1
  180. package/dist/index.css +0 -49
  181. package/dist/index.css.map +0 -1
  182. package/dist/mocks/EventDB.cjs.map +0 -1
  183. package/dist/mocks/EventDB.d.cts +0 -6
  184. package/dist/mocks/EventDB.d.ts +0 -6
  185. package/dist/mocks/EventDB.mjs.map +0 -1
  186. package/dist/shared/Modal/index.cjs +0 -64
  187. package/dist/shared/Modal/index.cjs.map +0 -1
  188. package/dist/shared/Modal/index.css +0 -49
  189. package/dist/shared/Modal/index.css.map +0 -1
  190. package/dist/shared/Modal/index.d.cts +0 -2
  191. package/dist/shared/Modal/index.d.ts +0 -2
  192. package/dist/shared/Modal/index.mjs +0 -62
  193. package/dist/shared/Modal/index.mjs.map +0 -1
  194. package/dist/shared/Modal.cjs +0 -64
  195. package/dist/shared/Modal.cjs.map +0 -1
  196. package/dist/shared/Modal.css +0 -49
  197. package/dist/shared/Modal.css.map +0 -1
  198. package/dist/shared/Modal.d.cts +0 -9
  199. package/dist/shared/Modal.d.ts +0 -9
  200. package/dist/shared/Modal.mjs +0 -62
  201. package/dist/shared/Modal.mjs.map +0 -1
  202. package/dist/shared/index.css +0 -49
  203. package/dist/shared/index.css.map +0 -1
  204. package/dist/shared.css +0 -49
  205. package/dist/shared.css.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
  import React7, { createContext, useState, useEffect, useContext, useMemo, useRef } from 'react';
3
3
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
4
- import { Box, Grid, TextField, Tooltip, IconButton, Button, CircularProgress, Dialog, DialogTitle, DialogContent, DialogActions, Card, CardContent, Typography, FormControl, InputLabel, Select, MenuItem, CardMedia, CardHeader, useTheme, useMediaQuery, NoSsr } from '@mui/material';
4
+ import { Box, Grid, TextField, Tooltip, IconButton, Button, CircularProgress, Dialog, DialogTitle, DialogContent, DialogActions, Card, CardContent, Typography, FormControl, InputLabel, Select, MenuItem, CardMedia, CardHeader, useTheme, useMediaQuery, NoSsr, Link, FormControlLabel as FormControlLabel$1, Checkbox as Checkbox$1 } from '@mui/material';
5
5
  import DeleteIcon from '@mui/icons-material/Delete';
6
- import EditIcon from '@mui/icons-material/Edit';
6
+ import EditIcon3 from '@mui/icons-material/Edit';
7
7
  import AddIcon from '@mui/icons-material/Add';
8
8
  import ColorizeIcon from '@mui/icons-material/Colorize';
9
9
  import CancelIcon from '@mui/icons-material/Cancel';
10
10
  import CheckCircleIcon from '@mui/icons-material/CheckCircle';
11
11
  import Box2 from '@mui/material/Box';
12
- import Grid8 from '@mui/material/Grid';
12
+ import Grid10 from '@mui/material/Grid';
13
13
  import Card10 from '@mui/material/Card';
14
14
  import CardContent10 from '@mui/material/CardContent';
15
15
  import CardHeader4 from '@mui/material/CardHeader';
@@ -17,6 +17,7 @@ import Divider3 from '@mui/material/Divider';
17
17
  import Typography4 from '@mui/material/Typography';
18
18
  import Pagination from '@mui/material/Pagination';
19
19
  import Avatar from '@mui/material/Avatar';
20
+ import { useRouter } from 'next/navigation';
20
21
  import Chip2 from '@mui/material/Chip';
21
22
  import LinearProgress from '@mui/material/LinearProgress';
22
23
  import PersonIcon from '@mui/icons-material/Person';
@@ -27,19 +28,29 @@ import LocationOnIcon from '@mui/icons-material/LocationOn';
27
28
  import EventIcon from '@mui/icons-material/Event';
28
29
  import Autocomplete from '@mui/material/Autocomplete';
29
30
  import Popper from '@mui/material/Popper';
31
+ import FormControl2 from '@mui/material/FormControl';
32
+ import Select2 from '@mui/material/Select';
33
+ import MenuItem2 from '@mui/material/MenuItem';
30
34
  import FormControlLabel from '@mui/material/FormControlLabel';
31
35
  import Checkbox from '@mui/material/Checkbox';
32
- import FormControl2 from '@mui/material/FormControl';
33
36
  import RadioGroup from '@mui/material/RadioGroup';
34
37
  import Radio from '@mui/material/Radio';
35
- import TextField4 from '@mui/material/TextField';
38
+ import TextField7 from '@mui/material/TextField';
36
39
  import FormGroup from '@mui/material/FormGroup';
37
- import Button7 from '@mui/material/Button';
40
+ import Button8 from '@mui/material/Button';
38
41
  import SearchIcon from '@mui/icons-material/Search';
39
42
  import CircularProgress3 from '@mui/material/CircularProgress';
43
+ import CasinoIcon from '@mui/icons-material/Casino';
44
+ import Dialog3 from '@mui/material/Dialog';
45
+ import DialogContent3 from '@mui/material/DialogContent';
46
+ import DialogActions3 from '@mui/material/DialogActions';
47
+ import IconButton3 from '@mui/material/IconButton';
48
+ import CloseIcon from '@mui/icons-material/Close';
49
+ import ReactMarkdown from 'react-markdown';
40
50
  import Image2 from 'next/image';
41
51
  import ListIcon from '@mui/icons-material/List';
42
52
  import SaveIcon from '@mui/icons-material/Save';
53
+ import DialogTitle3 from '@mui/material/DialogTitle';
43
54
 
44
55
  // src/components/EventPage/editMode/EventBannerEdit.tsx
45
56
  var defaultValue = {
@@ -128,12 +139,29 @@ function Chip({ tag, removeCallback }) {
128
139
  function generateTagsDisplay(tag) {
129
140
  return /* @__PURE__ */ jsx(Chip, { tag }, tag.id);
130
141
  }
131
- function renderTagsFromIds(ids, legalTags) {
142
+ function renderTagsFromIds(ids, legalTags, options = {}) {
132
143
  if (!ids || !legalTags || legalTags.length === 0) {
133
144
  return /* @__PURE__ */ jsx(Fragment, {});
134
145
  }
146
+ const { showEventTag = false, eventTagId } = options;
135
147
  const validTags = ids.map((id) => legalTags.find((tag) => tag.id === id)).filter((tag) => Boolean(tag));
136
- return validTags.map((tag) => generateTagsDisplay(tag));
148
+ const sortedTags = [...validTags].sort((a, b) => {
149
+ if (showEventTag && eventTagId !== void 0) {
150
+ if (a.id === eventTagId && b.id === eventTagId) return 0;
151
+ if (a.id === eventTagId) return -1;
152
+ if (b.id === eventTagId) return 1;
153
+ }
154
+ const priorityOrder = ["Organizer Run", "Display Only"];
155
+ const aIndex = priorityOrder.indexOf(a.label);
156
+ const bIndex = priorityOrder.indexOf(b.label);
157
+ if (aIndex !== -1 && bIndex !== -1) {
158
+ return aIndex - bIndex;
159
+ }
160
+ if (aIndex !== -1) return -1;
161
+ if (bIndex !== -1) return 1;
162
+ return 0;
163
+ });
164
+ return sortedTags.map((tag) => generateTagsDisplay(tag));
137
165
  }
138
166
  function EventBannerEdit({
139
167
  initialValue,
@@ -357,7 +385,7 @@ function EventBannerEdit({
357
385
  children: [
358
386
  link.text,
359
387
  /* @__PURE__ */ jsxs(Box, { sx: { ml: 1, display: "flex" }, children: [
360
- /* @__PURE__ */ jsx(Tooltip, { title: "Edit Link", children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => openEditLink(index), sx: { color: "white", p: 0.2 }, children: /* @__PURE__ */ jsx(EditIcon, { fontSize: "inherit" }) }) }),
388
+ /* @__PURE__ */ jsx(Tooltip, { title: "Edit Link", children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => openEditLink(index), sx: { color: "white", p: 0.2 }, children: /* @__PURE__ */ jsx(EditIcon3, { fontSize: "inherit" }) }) }),
361
389
  /* @__PURE__ */ jsx(Tooltip, { title: "Remove Link", children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => removeLink(index), sx: { color: "error.light", p: 0.2 }, children: /* @__PURE__ */ jsx(DeleteIcon, { fontSize: "inherit" }) }) })
362
390
  ] })
363
391
  ]
@@ -484,7 +512,7 @@ function EventBasicInfo(props) {
484
512
  );
485
513
  }
486
514
  function EventBasicInfoView({ description, locationId, startingDate, endingDate, timeInfo, timezone, isOwner, onEdit }) {
487
- return /* @__PURE__ */ jsx(Grid8, { sx: { position: "relative" }, children: /* @__PURE__ */ jsx(Card, { style: {
515
+ return /* @__PURE__ */ jsx(Grid10, { sx: { position: "relative" }, children: /* @__PURE__ */ jsx(Card, { style: {
488
516
  boxShadow: "0px 4px 10px rgba(0, 0, 0, 0.1)",
489
517
  background: "linear-gradient(135deg, rgba(225, 225, 225, 1), rgba(250, 250, 250, 1))"
490
518
  }, children: /* @__PURE__ */ jsxs(CardContent, { children: [
@@ -768,7 +796,7 @@ function EventBannerView({
768
796
  }) {
769
797
  const backgroundColor = bannerColor || "linear-gradient(135deg, rgba(25,118,210,0.8), rgba(25,118,210,1))";
770
798
  return /* @__PURE__ */ jsxs(
771
- Grid8,
799
+ Grid10,
772
800
  {
773
801
  sx: {
774
802
  background: backgroundColor,
@@ -776,7 +804,7 @@ function EventBannerView({
776
804
  position: "relative"
777
805
  },
778
806
  children: [
779
- /* @__PURE__ */ jsxs(Grid8, { children: [
807
+ /* @__PURE__ */ jsxs(Grid10, { children: [
780
808
  /* @__PURE__ */ jsxs(
781
809
  Box,
782
810
  {
@@ -835,7 +863,7 @@ function EventBannerView({
835
863
  }
836
864
  ),
837
865
  /* @__PURE__ */ jsxs(
838
- Grid8,
866
+ Grid10,
839
867
  {
840
868
  display: "flex",
841
869
  justifyContent: "center",
@@ -943,6 +971,11 @@ var generateLink = function(link) {
943
971
  link.text
944
972
  );
945
973
  };
974
+
975
+ // src/data/values.tsx
976
+ var DEFAULT_PROFILE_PIC = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2IiB2aWV3Qm94PSIwIDAgMjU2IDI1NiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnIHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiAxMDsgZmlsbDogbm9uZTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMS40MDY1OTM0MDY1OTM0MDE2IDEuNDA2NTkzNDA2NTkzNDAxNikgc2NhbGUoMi44MSAyLjgxKSI+Cgk8cGF0aCBkPSJNIDQ1IDg4IGMgLTExLjA0OSAwIC0yMS4xOCAtMi4wMDMgLTI5LjAyMSAtOC42MzQgQyA2LjIxMiA3MS4xMDUgMCA1OC43NjQgMCA0NSBDIDAgMjAuMTg3IDIwLjE4NyAwIDQ1IDAgYyAyNC44MTMgMCA0NSAyMC4xODcgNDUgNDUgYyAwIDEzLjc2NSAtNi4yMTIgMjYuMTA1IC0xNS45NzkgMzQuMzY2IEMgNjYuMTgxIDg1Ljk5OCA1Ni4wNDkgODggNDUgODggeiIgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDEwOyBmaWxsOiByZ2IoMjE0LDIxNCwyMTQpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB0cmFuc2Zvcm09IiBtYXRyaXgoMSAwIDAgMSAwIDApICIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+Cgk8cGF0aCBkPSJNIDQ1IDYwLjcxIGMgLTExLjQ3OSAwIC0yMC44MTggLTkuMzM5IC0yMC44MTggLTIwLjgxNyBjIDAgLTExLjQ3OSA5LjMzOSAtMjAuODE4IDIwLjgxOCAtMjAuODE4IGMgMTEuNDc5IDAgMjAuODE3IDkuMzM5IDIwLjgxNyAyMC44MTggQyA2NS44MTcgNTEuMzcxIDU2LjQ3OSA2MC43MSA0NSA2MC43MSB6IiBzdHlsZT0ic3Ryb2tlOiBub25lOyBzdHJva2Utd2lkdGg6IDE7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogMTA7IGZpbGw6IHJnYigxNjUsMTY0LDE2NCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHRyYW5zZm9ybT0iIG1hdHJpeCgxIDAgMCAxIDAgMCkgIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KCTxwYXRoIGQ9Ik0gNDUgOTAgYyAtMTAuNjEzIDAgLTIwLjkyMiAtMy43NzMgLTI5LjAyOCAtMTAuNjI1IGMgLTAuNjQ4IC0wLjU0OCAtMC44OCAtMS40NDQgLTAuNTc5IC0yLjIzNyBDIDIwLjAzNCA2NC45MTkgMzEuOTMzIDU2LjcxIDQ1IDU2LjcxIHMgMjQuOTY2IDguMjA5IDI5LjYwNyAyMC40MjggYyAwLjMwMSAwLjc5MyAwLjA2OSAxLjY4OSAtMC41NzkgMi4yMzcgQyA2NS45MjIgODYuMjI3IDU1LjYxMyA5MCA0NSA5MCB6IiBzdHlsZT0ic3Ryb2tlOiBub25lOyBzdHJva2Utd2lkdGg6IDE7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogMTA7IGZpbGw6IHJnYigxNjUsMTY0LDE2NCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHRyYW5zZm9ybT0iIG1hdHJpeCgxIDAgMCAxIDAgMCkgIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KPC9nPgo8L3N2Zz4=";
977
+ var ProfilePictureSettings = {
978
+ aspectRatio: 4 / 5};
946
979
  var NextGameLabel = ({ nextGameTime }) => {
947
980
  const date = typeof nextGameTime === "string" ? new Date(nextGameTime) : nextGameTime;
948
981
  return /* @__PURE__ */ jsxs(Typography, { variant: "caption", sx: { display: "block", mb: 1, color: "primary.main", fontWeight: "bold" }, children: [
@@ -956,17 +989,22 @@ var BaseSearchResultCard = ({
956
989
  onClick,
957
990
  children,
958
991
  icon,
959
- tags
992
+ tags,
993
+ showEventTag,
994
+ eventTagId
960
995
  }) => {
996
+ const router = useRouter();
961
997
  const handleClick = (e) => {
998
+ const url = `/${result.type}/${result.id}`;
999
+ if (e.ctrlKey || e.metaKey || e.shiftKey) {
1000
+ e.stopPropagation();
1001
+ window.open(url, "_blank");
1002
+ return;
1003
+ }
962
1004
  if (onClick) {
963
- if (e.ctrlKey || e.metaKey || e.shiftKey) {
964
- e.stopPropagation();
965
- const url = `/${result.type}/${result.id}`;
966
- window.open(url, "_blank");
967
- } else {
968
- onClick(result.id);
969
- }
1005
+ onClick(result.id);
1006
+ } else {
1007
+ router.push(url);
970
1008
  }
971
1009
  };
972
1010
  return /* @__PURE__ */ jsx(
@@ -975,7 +1013,7 @@ var BaseSearchResultCard = ({
975
1013
  elevation: 6,
976
1014
  sx: {
977
1015
  width: "100%",
978
- cursor: onClick ? "pointer" : "default",
1016
+ cursor: "pointer",
979
1017
  boxShadow: "0px 8px 24px rgba(0, 0, 0, 0.15)",
980
1018
  transition: "box-shadow 0.3s ease-in-out",
981
1019
  "&:hover": {
@@ -997,7 +1035,7 @@ var BaseSearchResultCard = ({
997
1035
  const text = full || "";
998
1036
  return text.length > 200 ? `${text.slice(0, 200).trimEnd()}...` : text;
999
1037
  })() }) : /* @__PURE__ */ jsx(Typography4, { variant: "body1", children: result.description }),
1000
- result.tags && result.tags.length > 0 && /* @__PURE__ */ jsx(Box2, { sx: { mt: 1, display: "flex", flexWrap: "wrap", gap: 1 }, children: renderTagsFromIds(result.tags, tags) })
1038
+ result.tags && result.tags.length > 0 && /* @__PURE__ */ jsx(Box2, { sx: { mt: 1, display: "flex", flexWrap: "wrap", gap: 1 }, children: renderTagsFromIds(result.tags, tags, { showEventTag, eventTagId }) })
1001
1039
  ] })
1002
1040
  ] })
1003
1041
  }
@@ -1039,7 +1077,7 @@ var PlayerResultCard = ({
1039
1077
  const playerIcon = /* @__PURE__ */ jsx(
1040
1078
  Avatar,
1041
1079
  {
1042
- src: result.imageUrl,
1080
+ src: result.imageUrl || DEFAULT_PROFILE_PIC,
1043
1081
  alt: result.title,
1044
1082
  sx: {
1045
1083
  width: 40,
@@ -1055,7 +1093,9 @@ var PlayerResultCard_default = PlayerResultCard;
1055
1093
  var TableResultCard = ({
1056
1094
  result,
1057
1095
  onClick,
1058
- tags
1096
+ tags,
1097
+ showEventTag,
1098
+ eventTagId
1059
1099
  }) => {
1060
1100
  const rawCapacity = result.capacity;
1061
1101
  const hasDefinedCapacity = typeof rawCapacity === "number" && Number.isFinite(rawCapacity) && rawCapacity > 0;
@@ -1073,40 +1113,51 @@ var TableResultCard = ({
1073
1113
  }
1074
1114
  }
1075
1115
  );
1076
- return /* @__PURE__ */ jsx(BaseSearchResultCard_default, { result, onClick, icon: tableIcon, tags, children: /* @__PURE__ */ jsxs(Box2, { sx: { mb: 2 }, children: [
1077
- /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 1 }, children: [
1078
- /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1079
- /* @__PURE__ */ jsx("strong", { children: "Players:" }),
1080
- " ",
1081
- hasDefinedCapacity ? `${activePlayers}/${capacity}` : activePlayers
1082
- ] }),
1083
- typeof hasDM === "boolean" && /* @__PURE__ */ jsx(
1084
- Chip2,
1085
- {
1086
- icon: hasDM ? /* @__PURE__ */ jsx(SupervisorAccountIcon, {}) : /* @__PURE__ */ jsx(PersonIcon, {}),
1087
- label: hasDM ? "DM Present" : "No DM",
1088
- color: hasDM ? "success" : "warning",
1089
- size: "small"
1090
- }
1091
- )
1092
- ] }),
1093
- /* @__PURE__ */ jsx(
1094
- LinearProgress,
1095
- {
1096
- variant: "determinate",
1097
- value: occupancyPercentage,
1098
- sx: {
1099
- height: 10,
1100
- borderRadius: 5,
1101
- backgroundColor: "#e0e0e0",
1102
- "& .MuiLinearProgress-bar": {
1103
- backgroundColor: hasDefinedCapacity ? availableSlots > 0 ? "#4caf50" : "#f44336" : "#2196f3"
1116
+ return /* @__PURE__ */ jsx(
1117
+ BaseSearchResultCard_default,
1118
+ {
1119
+ result,
1120
+ onClick,
1121
+ icon: tableIcon,
1122
+ tags,
1123
+ showEventTag,
1124
+ eventTagId,
1125
+ children: /* @__PURE__ */ jsxs(Box2, { sx: { mb: 2 }, children: [
1126
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 1 }, children: [
1127
+ /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1128
+ /* @__PURE__ */ jsx("strong", { children: "Players:" }),
1129
+ " ",
1130
+ hasDefinedCapacity ? `${activePlayers}/${capacity}` : activePlayers
1131
+ ] }),
1132
+ typeof hasDM === "boolean" && /* @__PURE__ */ jsx(
1133
+ Chip2,
1134
+ {
1135
+ icon: hasDM ? /* @__PURE__ */ jsx(SupervisorAccountIcon, {}) : /* @__PURE__ */ jsx(PersonIcon, {}),
1136
+ label: hasDM ? "DM Present" : "No DM",
1137
+ color: hasDM ? "success" : "warning",
1138
+ size: "small"
1139
+ }
1140
+ )
1141
+ ] }),
1142
+ /* @__PURE__ */ jsx(
1143
+ LinearProgress,
1144
+ {
1145
+ variant: "determinate",
1146
+ value: occupancyPercentage,
1147
+ sx: {
1148
+ height: 10,
1149
+ borderRadius: 5,
1150
+ backgroundColor: "#e0e0e0",
1151
+ "& .MuiLinearProgress-bar": {
1152
+ backgroundColor: hasDefinedCapacity ? availableSlots > 0 ? "#4caf50" : "#f44336" : "#2196f3"
1153
+ }
1154
+ }
1104
1155
  }
1105
- }
1106
- }
1107
- ),
1108
- hasDefinedCapacity && /* @__PURE__ */ jsx(Typography4, { variant: "body2", sx: { mt: 0.5, textAlign: "right" }, children: availableSlots > 0 ? `${availableSlots} slot${availableSlots !== 1 ? "s" : ""} available` : "Table full" })
1109
- ] }) });
1156
+ ),
1157
+ hasDefinedCapacity && /* @__PURE__ */ jsx(Typography4, { variant: "body2", sx: { mt: 0.5, textAlign: "right" }, children: availableSlots > 0 ? `${availableSlots} slot${availableSlots !== 1 ? "s" : ""} available` : "Table full" })
1158
+ ] })
1159
+ }
1160
+ );
1110
1161
  };
1111
1162
  var TableResultCard_default = TableResultCard;
1112
1163
  var EventResultCard = ({
@@ -1124,7 +1175,7 @@ var EventResultCard = ({
1124
1175
  try {
1125
1176
  const date = new Date(dateString);
1126
1177
  return date.toLocaleDateString("en-US", options);
1127
- } catch (error) {
1178
+ } catch (__) {
1128
1179
  return dateString;
1129
1180
  }
1130
1181
  };
@@ -1169,20 +1220,22 @@ var ResultsContainer = ({
1169
1220
  onResultClick,
1170
1221
  tags,
1171
1222
  pagination,
1172
- onPacketChange
1223
+ onPacketChange,
1224
+ showEventTag,
1225
+ eventTagId
1173
1226
  }) => {
1174
1227
  if (!results || results.length === 0 || !results.map) {
1175
1228
  return /* @__PURE__ */ jsx(Box2, { sx: { textAlign: "center", py: 4 }, children: "No results found. Try adjusting your filters." });
1176
1229
  }
1177
- const onPlayerClick = (id) => {
1178
- onResultClick == null ? void 0 : onResultClick(id, "player");
1179
- };
1180
- const onTableClick = (id) => {
1181
- onResultClick == null ? void 0 : onResultClick(id, "table");
1182
- };
1183
- const onEventClick = (id) => {
1184
- onResultClick == null ? void 0 : onResultClick(id, "event");
1185
- };
1230
+ const onPlayerClick = onResultClick ? (id) => {
1231
+ onResultClick(id, "player");
1232
+ } : void 0;
1233
+ const onTableClick = onResultClick ? (id) => {
1234
+ onResultClick(id, "table");
1235
+ } : void 0;
1236
+ const onEventClick = onResultClick ? (id) => {
1237
+ onResultClick(id, "event");
1238
+ } : void 0;
1186
1239
  const handlePacketChange = (_event, packet) => {
1187
1240
  onPacketChange == null ? void 0 : onPacketChange(packet);
1188
1241
  };
@@ -1216,7 +1269,9 @@ var ResultsContainer = ({
1216
1269
  {
1217
1270
  result,
1218
1271
  onClick: onTableClick,
1219
- tags
1272
+ tags,
1273
+ showEventTag,
1274
+ eventTagId
1220
1275
  },
1221
1276
  result.id
1222
1277
  );
@@ -1252,17 +1307,30 @@ var ScrollableResultsList = ({
1252
1307
  tags,
1253
1308
  maxHeight = 400,
1254
1309
  onResultClick,
1255
- emptyText
1310
+ emptyText,
1311
+ showEventTag,
1312
+ eventTagId
1256
1313
  }) => {
1257
1314
  const hasResults = Array.isArray(results) && results.length > 0;
1258
- return /* @__PURE__ */ jsx(Box2, { sx: { maxHeight, overflowY: "auto", pr: 1 }, children: hasResults ? /* @__PURE__ */ jsx(ResultsContainer_default, { results, onResultClick, tags }) : /* @__PURE__ */ jsx(Box2, { sx: { textAlign: "center", py: 2 }, children: emptyText || "No results to display." }) });
1315
+ return /* @__PURE__ */ jsx(Box2, { sx: { maxHeight, overflowY: "auto", pr: 1 }, children: hasResults ? /* @__PURE__ */ jsx(
1316
+ ResultsContainer_default,
1317
+ {
1318
+ results,
1319
+ onResultClick,
1320
+ tags,
1321
+ showEventTag,
1322
+ eventTagId
1323
+ }
1324
+ ) : /* @__PURE__ */ jsx(Box2, { sx: { textAlign: "center", py: 2 }, children: emptyText || "No results to display." }) });
1259
1325
  };
1260
1326
  var ScrollableResultsList_default = ScrollableResultsList;
1261
1327
  var TablesScrollableList = ({
1262
1328
  results,
1263
1329
  tags,
1264
1330
  maxHeight,
1265
- onResultClick
1331
+ onResultClick,
1332
+ showEventTag,
1333
+ eventTagId
1266
1334
  }) => {
1267
1335
  const tables = (results || []).filter((r) => (r == null ? void 0 : r.type) === "table");
1268
1336
  const handleClick = (id) => onResultClick == null ? void 0 : onResultClick(id);
@@ -1274,7 +1342,9 @@ var TablesScrollableList = ({
1274
1342
  maxHeight,
1275
1343
  onResultClick: (id, type) => {
1276
1344
  if (type === "table") handleClick(id);
1277
- }
1345
+ },
1346
+ showEventTag,
1347
+ eventTagId
1278
1348
  }
1279
1349
  );
1280
1350
  };
@@ -1302,24 +1372,24 @@ function EventPageLayout({
1302
1372
  tables,
1303
1373
  allTags
1304
1374
  }) {
1305
- return /* @__PURE__ */ jsx(Grid8, { container: true, flexDirection: "column", children: /* @__PURE__ */ jsxs(EventEditProvider, { initialEvent: mergedEvent, value: { isOwner, updateEvent, updateImages }, children: [
1306
- /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(
1375
+ return /* @__PURE__ */ jsx(Grid10, { container: true, flexDirection: "column", children: /* @__PURE__ */ jsxs(EventEditProvider, { initialEvent: mergedEvent, value: { isOwner, updateEvent, updateImages }, children: [
1376
+ /* @__PURE__ */ jsx(Grid10, { children: /* @__PURE__ */ jsx(
1307
1377
  EventBanner,
1308
1378
  {
1309
1379
  attendees,
1310
1380
  numGames
1311
1381
  }
1312
1382
  ) }),
1313
- /* @__PURE__ */ jsxs(Grid8, { container: true, flexDirection: "row", spacing: 3, size: { xs: 12, md: 12 }, children: [
1314
- /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 4 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(
1383
+ /* @__PURE__ */ jsxs(Grid10, { container: true, flexDirection: "row", spacing: 3, size: { xs: 12, md: 12 }, children: [
1384
+ /* @__PURE__ */ jsx(Grid10, { size: { xs: 12, md: 4 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(
1315
1385
  EventBasicInfo,
1316
1386
  {
1317
1387
  locationId: mergedEvent.location || "0"
1318
1388
  }
1319
1389
  ) }),
1320
- /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 8 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(EventTablesCard_default, { tables, tags: allTags }) })
1390
+ /* @__PURE__ */ jsx(Grid10, { size: { xs: 12, md: 8 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(EventTablesCard_default, { tables, tags: allTags }) })
1321
1391
  ] }),
1322
- /* @__PURE__ */ jsx(Grid8, {})
1392
+ /* @__PURE__ */ jsx(Grid10, {})
1323
1393
  ] }) });
1324
1394
  }
1325
1395
  var PlayerDetailsCard = ({
@@ -1478,19 +1548,18 @@ var PlayerDetailsCard = ({
1478
1548
  );
1479
1549
  };
1480
1550
  var PlayerDetailsCard_default = PlayerDetailsCard;
1481
-
1482
- // src/data/values.tsx
1483
- var ProfilePictureSettings = {
1484
- aspectRatio: 4 / 5};
1485
- var PlayerDisplayCard = ({ profilePicture, username, bio, preferredPronouns }) => {
1486
- const defaultImg = "/man-walking-silhouette-clipart.jpg";
1487
- const [imageSrc, setImageSrc] = useState(defaultImg);
1488
- const { aspectRatio } = ProfilePictureSettings;
1551
+ var PlayerDisplayCard = ({
1552
+ profilePicture,
1553
+ username,
1554
+ bio,
1555
+ preferredPronouns
1556
+ }) => {
1557
+ const [imageSrc, setImageSrc] = useState(DEFAULT_PROFILE_PIC);
1489
1558
  useEffect(() => {
1490
1559
  async function validateImage() {
1491
- const newImage = profilePicture || defaultImg;
1560
+ const newImage = profilePicture || DEFAULT_PROFILE_PIC;
1492
1561
  if (!profilePicture) {
1493
- setImageSrc(defaultImg);
1562
+ setImageSrc(DEFAULT_PROFILE_PIC);
1494
1563
  return;
1495
1564
  }
1496
1565
  const img = new Image();
@@ -1499,7 +1568,7 @@ var PlayerDisplayCard = ({ profilePicture, username, bio, preferredPronouns }) =
1499
1568
  setImageSrc(newImage);
1500
1569
  };
1501
1570
  img.onerror = () => {
1502
- setImageSrc(defaultImg);
1571
+ setImageSrc(DEFAULT_PROFILE_PIC);
1503
1572
  };
1504
1573
  }
1505
1574
  validateImage();
@@ -1529,7 +1598,7 @@ var PlayerDisplayCard = ({ profilePicture, username, bio, preferredPronouns }) =
1529
1598
  image: imageSrc,
1530
1599
  alt: `${username}'s Profile Picture`,
1531
1600
  sx: {
1532
- aspectRatio,
1601
+ aspectRatio: ProfilePictureSettings.aspectRatio,
1533
1602
  height: "auto",
1534
1603
  // Updates to maintain aspect ratio and fill space nicely
1535
1604
  width: "100%",
@@ -1848,6 +1917,24 @@ function PlayerPageLayout({
1848
1917
  ] }) })
1849
1918
  ] }) }) });
1850
1919
  }
1920
+ var DistanceFilter = ({ distances, selectedDistance, onChange }) => {
1921
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1922
+ /* @__PURE__ */ jsx(Typography4, { variant: "h6", gutterBottom: true, children: "Distance" }),
1923
+ /* @__PURE__ */ jsx(FormControl2, { fullWidth: true, size: "small", children: /* @__PURE__ */ jsxs(
1924
+ Select2,
1925
+ {
1926
+ value: selectedDistance !== void 0 ? selectedDistance : "",
1927
+ onChange: (e) => onChange(Number(e.target.value)),
1928
+ displayEmpty: true,
1929
+ children: [
1930
+ /* @__PURE__ */ jsx(MenuItem2, { value: "", children: /* @__PURE__ */ jsx("em", { children: "Any Distance" }) }),
1931
+ distances.map((option) => /* @__PURE__ */ jsx(MenuItem2, { value: option.value, children: option.display }, option.value))
1932
+ ]
1933
+ }
1934
+ ) })
1935
+ ] });
1936
+ };
1937
+ var DistanceFilter_default = DistanceFilter;
1851
1938
  var ExpiredTablesFilter = ({
1852
1939
  includeExpiredTables,
1853
1940
  onChange
@@ -1916,13 +2003,13 @@ var TagsFilter = ({
1916
2003
  shouldHaveAtLeastOne: ""
1917
2004
  });
1918
2005
  const tagOptions = React7.useMemo(() => {
2006
+ var _a;
1919
2007
  console.log("available tags: " + JSON.stringify(Tags));
1920
2008
  console.log(!Tags);
1921
- if (!Tags || Tags.length === 0 || !Tags.map) return [];
1922
- return Tags.map((tag) => ({
2009
+ return (_a = Tags == null ? void 0 : Tags.map((tag) => ({
1923
2010
  value: tag.id,
1924
2011
  label: tag.label
1925
- }));
2012
+ }))) != null ? _a : [];
1926
2013
  }, [Tags]);
1927
2014
  const handleTagChange = (tagId, category) => {
1928
2015
  let newTags = [];
@@ -1950,8 +2037,7 @@ var TagsFilter = ({
1950
2037
  };
1951
2038
  const renderSelectedTags = (selectedTags, category) => {
1952
2039
  const tagValues = [];
1953
- if (!Tags || Tags.length === 0 || !Tags.map) return null;
1954
- Tags.forEach((tag) => {
2040
+ Tags == null ? void 0 : Tags.forEach((tag) => {
1955
2041
  if (selectedTags.includes(tag.id)) {
1956
2042
  tagValues.push(tag);
1957
2043
  }
@@ -2017,7 +2103,7 @@ var TagsFilter = ({
2017
2103
  });
2018
2104
  },
2019
2105
  slots: { popper: CustomPopper2 },
2020
- renderInput: (params) => /* @__PURE__ */ jsx(TextField4, { ...params, label: `Select ${label}` })
2106
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField7, { ...params, label: `Select ${label}` })
2021
2107
  },
2022
2108
  `${category}-${selectedTags.join("-")}`
2023
2109
  )
@@ -2089,7 +2175,7 @@ var TextSearchCard = ({ onChange, selectedTypes, initialTextSearch }) => {
2089
2175
  /* @__PURE__ */ jsx(Typography4, { variant: "h6", gutterBottom: true, children: "Text Search" }),
2090
2176
  /* @__PURE__ */ jsxs(Box2, { sx: { mb: 2 }, children: [
2091
2177
  /* @__PURE__ */ jsx(
2092
- TextField4,
2178
+ TextField7,
2093
2179
  {
2094
2180
  fullWidth: true,
2095
2181
  label: "Search in title and description",
@@ -2138,9 +2224,7 @@ var TypeFilter = ({ types, initialSelectedTypes = [], onChange }) => {
2138
2224
  Checkbox,
2139
2225
  {
2140
2226
  checked: selectedTypes.includes(type.id),
2141
- onChange: () => handleTypeChange(type.id),
2142
- disabled: type.id === "event",
2143
- title: type.id === "event" ? "Coming soon! Currently only player and table search are supported." : ""
2227
+ onChange: () => handleTypeChange(type.id)
2144
2228
  }
2145
2229
  ),
2146
2230
  label: type.label
@@ -2155,10 +2239,13 @@ var FiltersContainer = ({
2155
2239
  initialSelectedTags,
2156
2240
  initialTextSearch,
2157
2241
  includeExpiredTables = false,
2242
+ distance,
2243
+ distances,
2158
2244
  onTypeChange,
2159
2245
  onTagChange,
2160
2246
  onTextSearchChange,
2161
2247
  onIncludeExpiredTablesChange,
2248
+ onDistanceChange,
2162
2249
  onSubmit,
2163
2250
  tags,
2164
2251
  searchTypes
@@ -2173,7 +2260,10 @@ var FiltersContainer = ({
2173
2260
  onTypeChange(types);
2174
2261
  }
2175
2262
  };
2176
- return /* @__PURE__ */ jsxs(Box2, { children: [
2263
+ return /* @__PURE__ */ jsxs(Box2, { component: "form", onSubmit: (e) => {
2264
+ e.preventDefault();
2265
+ if (onSubmit) onSubmit();
2266
+ }, children: [
2177
2267
  /* @__PURE__ */ jsx(
2178
2268
  TypeFilter_default,
2179
2269
  {
@@ -2183,6 +2273,16 @@ var FiltersContainer = ({
2183
2273
  }
2184
2274
  ),
2185
2275
  /* @__PURE__ */ jsx(Divider3, { sx: { my: 2 } }),
2276
+ /* @__PURE__ */ jsx(
2277
+ DistanceFilter_default,
2278
+ {
2279
+ distances,
2280
+ selectedDistance: distance,
2281
+ onChange: onDistanceChange || (() => {
2282
+ })
2283
+ }
2284
+ ),
2285
+ /* @__PURE__ */ jsx(Divider3, { sx: { my: 2 } }),
2186
2286
  /* @__PURE__ */ jsx(
2187
2287
  TextSearchCard_default,
2188
2288
  {
@@ -2213,13 +2313,13 @@ var FiltersContainer = ({
2213
2313
  /* @__PURE__ */ jsx(Divider3, { sx: { my: 2 } })
2214
2314
  ] }),
2215
2315
  /* @__PURE__ */ jsx(Box2, { sx: { display: "flex", justifyContent: "center", mt: 2 }, children: /* @__PURE__ */ jsx(
2216
- Button7,
2316
+ Button8,
2217
2317
  {
2318
+ type: "submit",
2218
2319
  variant: "contained",
2219
2320
  color: "primary",
2220
2321
  size: "large",
2221
2322
  startIcon: /* @__PURE__ */ jsx(SearchIcon, {}),
2222
- onClick: onSubmit,
2223
2323
  sx: {
2224
2324
  width: "100%",
2225
2325
  py: 1.5,
@@ -2279,11 +2379,13 @@ function SearchPageLayout({
2279
2379
  query: "",
2280
2380
  titleOnly: false
2281
2381
  },
2282
- includeExpiredTables: initialIncludeExpiredTables = false,
2382
+ initialDistance,
2383
+ distances,
2283
2384
  onTypeChange,
2284
2385
  onTagChange,
2285
2386
  onTextSearchChange,
2286
2387
  onIncludeExpiredTablesChange,
2388
+ onDistanceChange,
2287
2389
  onSubmit,
2288
2390
  onResultClick,
2289
2391
  onPacketChange,
@@ -2291,14 +2393,16 @@ function SearchPageLayout({
2291
2393
  validTags,
2292
2394
  allTags,
2293
2395
  searchTypes,
2294
- isLoading = false
2396
+ isLoading = false,
2397
+ eventTagId
2295
2398
  }) {
2296
2399
  const theme = useTheme();
2297
2400
  const isMobile = useMediaQuery(theme.breakpoints.down("md"));
2298
2401
  const [selectedTypes, setSelectedTypes] = useState(initialSelectedTypes);
2299
2402
  const [selectedTags, setSelectedTags] = useState(initialSelectedTags);
2300
2403
  const [textSearch, setTextSearch] = useState(initialTextSearch);
2301
- const [includeExpiredTables, setIncludeExpiredTables] = useState(initialIncludeExpiredTables);
2404
+ const [includeExpiredTables, setIncludeExpiredTables] = useState(false);
2405
+ const [distance, setDistance] = useState(initialDistance);
2302
2406
  useEffect(() => {
2303
2407
  setSelectedTypes(initialSelectedTypes);
2304
2408
  }, [initialSelectedTypes]);
@@ -2309,8 +2413,8 @@ function SearchPageLayout({
2309
2413
  setTextSearch(initialTextSearch);
2310
2414
  }, [initialTextSearch]);
2311
2415
  useEffect(() => {
2312
- setIncludeExpiredTables(initialIncludeExpiredTables);
2313
- }, [initialIncludeExpiredTables]);
2416
+ setDistance(initialDistance);
2417
+ }, [initialDistance]);
2314
2418
  const handleTypeChange = (types) => {
2315
2419
  setSelectedTypes(types);
2316
2420
  if (onTypeChange) onTypeChange(types);
@@ -2327,12 +2431,17 @@ function SearchPageLayout({
2327
2431
  setIncludeExpiredTables(include);
2328
2432
  if (onIncludeExpiredTablesChange) onIncludeExpiredTablesChange(include);
2329
2433
  };
2434
+ const handleDistanceChange = (dist) => {
2435
+ setDistance(dist);
2436
+ if (onDistanceChange) onDistanceChange(dist);
2437
+ };
2330
2438
  const handleSubmit = () => {
2331
2439
  const currentCriteria = {
2332
2440
  selectedTypes,
2333
2441
  selectedTags,
2334
2442
  textSearch,
2335
- includeExpiredTables
2443
+ includeExpiredTables,
2444
+ distance
2336
2445
  };
2337
2446
  if (onSubmit) {
2338
2447
  onSubmit(currentCriteria);
@@ -2351,8 +2460,8 @@ function SearchPageLayout({
2351
2460
  }
2352
2461
  }
2353
2462
  ) }),
2354
- /* @__PURE__ */ jsxs(Grid8, { container: true, spacing: 2, children: [
2355
- /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 3 }, children: /* @__PURE__ */ jsxs(Card10, { sx: { marginBottom: isMobile ? 2 : 0 }, children: [
2463
+ /* @__PURE__ */ jsxs(Grid10, { container: true, spacing: 2, children: [
2464
+ /* @__PURE__ */ jsx(Grid10, { size: { xs: 12, md: 3 }, children: /* @__PURE__ */ jsxs(Card10, { sx: { marginBottom: isMobile ? 2 : 0 }, children: [
2356
2465
  /* @__PURE__ */ jsx(
2357
2466
  CardHeader4,
2358
2467
  {
@@ -2372,17 +2481,20 @@ function SearchPageLayout({
2372
2481
  initialSelectedTags: selectedTags,
2373
2482
  initialTextSearch: textSearch,
2374
2483
  includeExpiredTables,
2484
+ distance,
2485
+ distances,
2375
2486
  onTypeChange: handleTypeChange,
2376
2487
  onTagChange: handleTagChange,
2377
2488
  onTextSearchChange: handleTextSearchChange,
2378
2489
  onIncludeExpiredTablesChange: handleIncludeExpiredTablesChange,
2490
+ onDistanceChange: handleDistanceChange,
2379
2491
  onSubmit: handleSubmit,
2380
2492
  tags: validTags,
2381
2493
  searchTypes
2382
2494
  }
2383
2495
  ) })
2384
2496
  ] }) }),
2385
- /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 9 }, children: /* @__PURE__ */ jsxs(Card10, { children: [
2497
+ /* @__PURE__ */ jsx(Grid10, { size: { xs: 12, md: 9 }, children: /* @__PURE__ */ jsxs(Card10, { children: [
2386
2498
  /* @__PURE__ */ jsx(
2387
2499
  CardHeader4,
2388
2500
  {
@@ -2402,13 +2514,255 @@ function SearchPageLayout({
2402
2514
  pagination,
2403
2515
  onPacketChange,
2404
2516
  onResultClick,
2405
- tags: allTags
2517
+ tags: allTags,
2518
+ showEventTag: true,
2519
+ eventTagId
2406
2520
  }
2407
2521
  ) })
2408
2522
  ] }) })
2409
2523
  ] })
2410
2524
  ] });
2411
2525
  }
2526
+
2527
+ // src/components/shared/NameGenerator.ts
2528
+ var getRandomTitle = () => {
2529
+ const randomPrefix = titlePrefixes[Math.random() * titlePrefixes.length | 0];
2530
+ const randomMiddle = tileMiddle[Math.random() * tileMiddle.length | 0];
2531
+ const randomSuffix = titleSuffixes[Math.random() * titleSuffixes.length | 0];
2532
+ return `${randomPrefix} ${randomMiddle} ${randomSuffix}`;
2533
+ };
2534
+ var getRandomTagline = () => taglines[Math.random() * taglines.length | 0];
2535
+ var titlePrefixes = [
2536
+ "The Knights of The",
2537
+ "The Fellowship of The",
2538
+ "The Order of The",
2539
+ "The Infamous",
2540
+ "The Legendary",
2541
+ "The Dubious",
2542
+ "The Sworn Guardians of The",
2543
+ "The Ancient Guild of The",
2544
+ "The Unstoppable",
2545
+ "The Misfit",
2546
+ "The Chaotic",
2547
+ "The Brave",
2548
+ "The Forgotten",
2549
+ "The Wandering",
2550
+ "The Noble Council of The",
2551
+ "The Dread Pirates of The",
2552
+ "The Honorable Society of The",
2553
+ "The Cursed",
2554
+ "The Unlikely Heroes of The",
2555
+ "The Elders of The",
2556
+ "The Seekers of The",
2557
+ "The Champions of The",
2558
+ "The Heralds of The",
2559
+ "The Disciples of The",
2560
+ "The Ragtag Band of The",
2561
+ "The Cult of The"
2562
+ ];
2563
+ var tileMiddle = [
2564
+ "Round",
2565
+ "Kitchen",
2566
+ "Deepest",
2567
+ "Sorcery",
2568
+ "Munchkin",
2569
+ "Shenanigan",
2570
+ "Secret",
2571
+ "Dungeon",
2572
+ "Fireside",
2573
+ "Tabletop",
2574
+ "Midnight",
2575
+ "Tavern",
2576
+ "Goblin",
2577
+ "Dragon",
2578
+ "Critical",
2579
+ "Natural Twenty",
2580
+ "Counterspell",
2581
+ "Nat One",
2582
+ "Cardboard",
2583
+ "Dice Tower",
2584
+ "Campaign",
2585
+ "Lore",
2586
+ "Awkward",
2587
+ "Unhinged",
2588
+ "Chaotic Neutral",
2589
+ "Homebrew",
2590
+ "Side Quest"
2591
+ ];
2592
+ var titleSuffixes = [
2593
+ "Table",
2594
+ "Dungeon",
2595
+ "Cave",
2596
+ "Crew",
2597
+ "Team",
2598
+ "League",
2599
+ "Horde",
2600
+ "Party",
2601
+ "Conclave",
2602
+ "Collective",
2603
+ "Alliance",
2604
+ "Syndicate",
2605
+ "Guild",
2606
+ "Cabal",
2607
+ "Council",
2608
+ "Expedition",
2609
+ "Enclave",
2610
+ "Consortium",
2611
+ "Troupe",
2612
+ "Vanguard",
2613
+ "Cohort",
2614
+ "Brotherhood",
2615
+ "Sisterhood",
2616
+ "Pantheon",
2617
+ "Assembly",
2618
+ "Coven"
2619
+ ];
2620
+ var taglines = [
2621
+ "Everyone is welcome!",
2622
+ "Looking for serious players.",
2623
+ "Get in nerds, we're gaming!",
2624
+ "If you aren't there, you're square.",
2625
+ "It will be legendary!",
2626
+ "Beginners welcome \u2014 we were all level 1 once.",
2627
+ "No experience necessary. Snacks encouraged.",
2628
+ "Roleplayers, board gamers, and chaos gremlins welcome.",
2629
+ "We don't metagame. Much.",
2630
+ "All alignments accepted. True Neutral gets the snacks.",
2631
+ "Where every session is a one-shot... until it isn't.",
2632
+ "Homebrew rules may apply.",
2633
+ "Warning: may contain excessive lore.",
2634
+ "Critical failures celebrated as much as critical hits.",
2635
+ "No powergamers. Okay, maybe one powergamer.",
2636
+ "We finish campaigns. (Eventually.)",
2637
+ "Veteran players seeking worthy companions.",
2638
+ "Casuals only \u2014 we're here for the vibes.",
2639
+ "Serious about fun, not about rules.",
2640
+ "Min-maxers need not apply.",
2641
+ "For those who read the rulebook... and those who definitely didn't.",
2642
+ "Roll for initiative. Arrive on time.",
2643
+ "Side quests are the main quest here.",
2644
+ "Chaotic good energy required.",
2645
+ "If you bring snacks, you can name the first NPC.",
2646
+ "We read the rulebook so you don't have to.",
2647
+ "Wargamers only \u2014 no take-backs, no mercy.",
2648
+ "Everyone welcome. Meeple provided.",
2649
+ "We always play the longest game on the shelf.",
2650
+ "Worker placement. Resource management. Existential dread.",
2651
+ "No phones at the table! We're here for the game.",
2652
+ "Someone always flips the table. Metaphorically. Usually.",
2653
+ "We have a designated rules lawyer. It's fine.",
2654
+ "Cooperative games only \u2014 we can't handle another Monopoly incident.",
2655
+ "Teaching time is half the fun!"
2656
+ ];
2657
+ function TagSelector({ initialTagIDs, allTags, onTagChange }) {
2658
+ const [tagList, updateTagList] = useState(initialTagIDs);
2659
+ const [inputValue, setInputValue] = useState("");
2660
+ const toggleTag = (id) => tagList.find((t) => t === id) ? removeTag(id) : addTag(id);
2661
+ const addTag = (id) => {
2662
+ const newList = [...tagList, id];
2663
+ updateTagList(newList);
2664
+ onTagChange(newList);
2665
+ };
2666
+ const removeTag = (id) => {
2667
+ const newList = tagList.filter((t) => t !== id);
2668
+ updateTagList(newList);
2669
+ onTagChange(newList);
2670
+ };
2671
+ const selectedTags = useMemo(() => allTags.filter((tag) => tagList.includes(tag.id)), [allTags, tagList]);
2672
+ const options = useMemo(
2673
+ () => allTags.map((tag) => ({ value: tag.id, label: tag.label })),
2674
+ [allTags]
2675
+ );
2676
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2677
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: selectedTags.map((tag) => /* @__PURE__ */ jsx(
2678
+ Chip,
2679
+ {
2680
+ tag,
2681
+ removeCallback: () => toggleTag(tag.id)
2682
+ },
2683
+ tag.id
2684
+ )) }),
2685
+ /* @__PURE__ */ jsx(Grid10, { container: true, spacing: 3, children: /* @__PURE__ */ jsx(Grid10, { sx: { marginTop: 3, width: "100%", minWidth: "550px" }, children: /* @__PURE__ */ jsx(
2686
+ Autocomplete,
2687
+ {
2688
+ options,
2689
+ filterOptions: (availableOptions, state) => availableOptions.filter(
2690
+ (option) => !tagList.includes(option.value) && option.label.toLowerCase().includes(state.inputValue.toLowerCase())
2691
+ ),
2692
+ value: null,
2693
+ inputValue,
2694
+ onInputChange: (event, newInputValue) => {
2695
+ if (event && event.type === "change") {
2696
+ setInputValue(newInputValue);
2697
+ }
2698
+ },
2699
+ onChange: (event, newValue) => {
2700
+ if (newValue) {
2701
+ toggleTag(newValue.value);
2702
+ }
2703
+ setInputValue("");
2704
+ },
2705
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField7, { ...params, label: "Select Tags" })
2706
+ },
2707
+ tagList.join("-")
2708
+ ) }) })
2709
+ ] });
2710
+ }
2711
+ function EditTableDetailsForm({ initialTitle, initialSubtitle, onTitleChange, onSubtitleChange, allowEditingTitles, initialTagIDs, allTags, onTagChange }) {
2712
+ const [title, setTitle] = useState(initialTitle);
2713
+ const [subtitle, setSubtitle] = useState(initialSubtitle);
2714
+ const handleTitleChange = (newTitle) => {
2715
+ setTitle(newTitle);
2716
+ onTitleChange(newTitle);
2717
+ };
2718
+ const handleSubtitleChange = (newSubtitle) => {
2719
+ setSubtitle(newSubtitle);
2720
+ onSubtitleChange(newSubtitle);
2721
+ };
2722
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2723
+ allowEditingTitles && /* @__PURE__ */ jsxs(Box, { className: "flex flex-col gap-4 mb-8", children: [
2724
+ /* @__PURE__ */ jsxs(Box, { className: "inline-flex", children: [
2725
+ /* @__PURE__ */ jsx(
2726
+ TextField7,
2727
+ {
2728
+ sx: { minWidth: "400px" },
2729
+ label: "Title",
2730
+ onChange: (e) => handleTitleChange(e.target.value),
2731
+ variant: "filled",
2732
+ value: title
2733
+ }
2734
+ ),
2735
+ /* @__PURE__ */ jsx(Tooltip, { title: "Randomize", children: /* @__PURE__ */ jsx(
2736
+ CasinoIcon,
2737
+ {
2738
+ sx: { cursor: "pointer", alignSelf: "center", ml: 1 },
2739
+ onClick: () => handleTitleChange(getRandomTitle())
2740
+ }
2741
+ ) })
2742
+ ] }),
2743
+ /* @__PURE__ */ jsxs(Box, { className: "inline-flex min-w-96", children: [
2744
+ /* @__PURE__ */ jsx(
2745
+ TextField7,
2746
+ {
2747
+ sx: { minWidth: "400px" },
2748
+ label: "Short Description or Tagline",
2749
+ onChange: (e) => handleSubtitleChange(e.target.value),
2750
+ variant: "filled",
2751
+ value: subtitle
2752
+ }
2753
+ ),
2754
+ /* @__PURE__ */ jsx(Tooltip, { title: "Randomize", children: /* @__PURE__ */ jsx(
2755
+ CasinoIcon,
2756
+ {
2757
+ sx: { cursor: "pointer", alignSelf: "center", ml: 1 },
2758
+ onClick: () => handleSubtitleChange(getRandomTagline())
2759
+ }
2760
+ ) })
2761
+ ] })
2762
+ ] }),
2763
+ /* @__PURE__ */ jsx(TagSelector, { initialTagIDs, allTags, onTagChange })
2764
+ ] });
2765
+ }
2412
2766
  var GameTableContext = React7.createContext(void 0);
2413
2767
  function GameTableProvider(props) {
2414
2768
  return /* @__PURE__ */ jsx(Fragment, { children: props.children });
@@ -2421,76 +2775,206 @@ function useGameTableContext() {
2421
2775
  throw new Error("useGameTableContext is deprecated in the package build. Pass table data through props instead.");
2422
2776
  }
2423
2777
  var ModalContext = createContext({
2424
- showModal: (content) => {
2778
+ showModal: () => {
2425
2779
  },
2426
2780
  hideModal: () => {
2427
2781
  }
2428
2782
  });
2429
2783
  var useModal = () => useContext(ModalContext);
2430
- var Modal = ({ onClose, children }) => {
2431
- const modalRef = useRef(null);
2432
- const previouslyFocusedElement = useRef(null);
2784
+ var AutoResizingTextarea = (props) => {
2785
+ const { isInEditMode, onChange, textareaRef, value } = props;
2433
2786
  useEffect(() => {
2434
- var _a;
2435
- if (children) {
2436
- previouslyFocusedElement.current = document.activeElement;
2437
- (_a = modalRef.current) == null ? void 0 : _a.focus();
2787
+ if (isInEditMode && textareaRef.current) {
2788
+ const textarea = textareaRef.current;
2789
+ textarea.style.height = "auto";
2790
+ textarea.style.height = `${textarea.scrollHeight}px`;
2438
2791
  }
2439
- return () => {
2440
- var _a2;
2441
- (_a2 = previouslyFocusedElement.current) == null ? void 0 : _a2.focus();
2442
- };
2443
- }, [children]);
2444
- const handleOnClose = () => {
2445
- onClose();
2446
- };
2447
- const handleKeyDown = (e) => {
2448
- var _a;
2449
- if (e.key !== "Tab") return;
2450
- const focusableElements = (_a = modalRef.current) == null ? void 0 : _a.querySelectorAll(
2451
- 'button, [tabindex]:not([tabindex="-1"])'
2452
- );
2453
- if (!focusableElements || focusableElements.length === 0) return;
2454
- const first = focusableElements[0];
2455
- const last = focusableElements[focusableElements.length - 1];
2456
- if (e.shiftKey) {
2457
- if (document.activeElement === first) {
2458
- e.preventDefault();
2459
- last.focus();
2792
+ }, [isInEditMode, textareaRef, value]);
2793
+ return /* @__PURE__ */ jsx(
2794
+ "textarea",
2795
+ {
2796
+ ref: textareaRef,
2797
+ value,
2798
+ onChange: (e) => onChange(e.target.value),
2799
+ style: {
2800
+ backgroundColor: "#fffbea",
2801
+ overflow: "hidden",
2802
+ resize: "none",
2803
+ width: "100%"
2460
2804
  }
2461
- } else {
2462
- if (document.activeElement === last) {
2463
- e.preventDefault();
2464
- first.focus();
2805
+ }
2806
+ );
2807
+ };
2808
+ var AutoResizingTextarea_default = AutoResizingTextarea;
2809
+ var NextGameCountdown = ({ nextGameTime }) => {
2810
+ const [timeLeft, setTimeLeft] = useState("");
2811
+ useEffect(() => {
2812
+ if (!nextGameTime) return;
2813
+ const timer = setInterval(() => {
2814
+ const now = (/* @__PURE__ */ new Date()).getTime();
2815
+ const distance = new Date(nextGameTime).getTime() - now;
2816
+ if (distance < 0) {
2817
+ clearInterval(timer);
2818
+ setTimeLeft("Started");
2819
+ return;
2465
2820
  }
2821
+ const days = Math.floor(distance / (1e3 * 60 * 60 * 24));
2822
+ const hours = Math.floor(distance % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60));
2823
+ const minutes = Math.floor(distance % (1e3 * 60 * 60) / (1e3 * 60));
2824
+ const seconds = Math.floor(distance % (1e3 * 60) / 1e3);
2825
+ let timeString = "";
2826
+ if (days > 0) timeString += `${days}d `;
2827
+ if (hours > 0 || days > 0) timeString += `${hours}h `;
2828
+ timeString += `${minutes}m ${seconds}s`;
2829
+ setTimeLeft(timeString);
2830
+ }, 1e3);
2831
+ return () => clearInterval(timer);
2832
+ }, [nextGameTime]);
2833
+ if (!nextGameTime) return null;
2834
+ return /* @__PURE__ */ jsxs(Typography, { variant: "body2", color: "primary", sx: { fontWeight: "bold" }, children: [
2835
+ "Next Game: ",
2836
+ timeLeft
2837
+ ] });
2838
+ };
2839
+ function TagEditor({
2840
+ title,
2841
+ selectedTags,
2842
+ possibleTags,
2843
+ onToggleTag
2844
+ }) {
2845
+ const selectedIds = useMemo(() => selectedTags.map((tag) => tag.id), [selectedTags]);
2846
+ const onTagChange = (newSelectedIds) => {
2847
+ const addedTags = newSelectedIds.filter((id) => !selectedIds.includes(id));
2848
+ const removedTags = selectedIds.filter((id) => !newSelectedIds.includes(id));
2849
+ addedTags.forEach((id) => onToggleTag(id));
2850
+ removedTags.forEach((id) => onToggleTag(id));
2851
+ };
2852
+ return /* @__PURE__ */ jsx(Grid10, { container: true, children: /* @__PURE__ */ jsx(Grid10, { size: { xs: 12 }, children: /* @__PURE__ */ jsxs(Card10, { children: [
2853
+ title ? /* @__PURE__ */ jsx(
2854
+ CardHeader4,
2855
+ {
2856
+ title,
2857
+ style: {
2858
+ background: "linear-gradient(135deg, rgba(25, 118, 210, 0.8), rgba(25, 118, 210, 1))",
2859
+ color: "#FFFFFF",
2860
+ fontSize: "1.5rem",
2861
+ textShadow: "0px 3px 6px rgba(0, 0, 0, 0.5)"
2862
+ }
2863
+ }
2864
+ ) : "",
2865
+ /* @__PURE__ */ jsx(CardContent10, { children: /* @__PURE__ */ jsx(TagSelector, { initialTagIDs: selectedIds, allTags: possibleTags, onTagChange }) })
2866
+ ] }) }) });
2867
+ }
2868
+ var UserAgreementModal = ({
2869
+ open,
2870
+ onClose,
2871
+ markdownContent,
2872
+ requirements,
2873
+ onAccept,
2874
+ title = "User Agreement",
2875
+ forceAgreement = false
2876
+ }) => {
2877
+ const [checkedState, setCheckedState] = useState(
2878
+ new Array(requirements.length).fill(false)
2879
+ );
2880
+ const handleCheckboxChange = (index) => {
2881
+ const updatedCheckedState = checkedState.map(
2882
+ (item, i) => i === index ? !item : item
2883
+ );
2884
+ setCheckedState(updatedCheckedState);
2885
+ };
2886
+ const isAllRequiredChecked = requirements.every((req, index) => {
2887
+ if (req.required) {
2888
+ return checkedState[index];
2889
+ }
2890
+ return true;
2891
+ });
2892
+ const handleAccept = () => {
2893
+ if (isAllRequiredChecked) {
2894
+ onAccept();
2466
2895
  }
2467
2896
  };
2468
- return /* @__PURE__ */ jsx(
2469
- "div",
2897
+ const handleClose = (event, reason) => {
2898
+ if (forceAgreement) return;
2899
+ if (onClose) onClose();
2900
+ };
2901
+ return /* @__PURE__ */ jsxs(
2902
+ Dialog,
2470
2903
  {
2471
- className: "modal-overlay",
2472
- onKeyDown: handleKeyDown,
2473
- ref: modalRef,
2474
- role: "dialog",
2475
- tabIndex: -1,
2476
- children: /* @__PURE__ */ jsxs("div", { className: "modal-container", children: [
2477
- /* @__PURE__ */ jsx("div", { className: "modal-control-strip", children: /* @__PURE__ */ jsx("button", { onClick: handleOnClose, children: "X" }) }),
2478
- /* @__PURE__ */ jsx("div", { className: "modal-content", children })
2479
- ] })
2904
+ open,
2905
+ onClose: handleClose,
2906
+ maxWidth: "md",
2907
+ fullWidth: true,
2908
+ disableEscapeKeyDown: forceAgreement,
2909
+ children: [
2910
+ /* @__PURE__ */ jsx(DialogTitle, { children: title }),
2911
+ /* @__PURE__ */ jsxs(DialogContent, { dividers: true, children: [
2912
+ /* @__PURE__ */ jsx(Box, { sx: { mb: 3 }, children: /* @__PURE__ */ jsx(
2913
+ ReactMarkdown,
2914
+ {
2915
+ components: {
2916
+ h1: ({ node, ...props }) => /* @__PURE__ */ jsx(Typography, { variant: "h4", gutterBottom: true, ...props }),
2917
+ h2: ({ node, ...props }) => /* @__PURE__ */ jsx(Typography, { variant: "h5", gutterBottom: true, ...props }),
2918
+ h3: ({ node, ...props }) => /* @__PURE__ */ jsx(Typography, { variant: "h6", gutterBottom: true, ...props }),
2919
+ h4: ({ node, ...props }) => /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", gutterBottom: true, ...props }),
2920
+ h5: ({ node, ...props }) => /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", gutterBottom: true, ...props }),
2921
+ h6: ({ node, ...props }) => /* @__PURE__ */ jsx(Typography, { variant: "caption", gutterBottom: true, ...props }),
2922
+ p: ({ node, ...props }) => /* @__PURE__ */ jsx(Typography, { variant: "body1", gutterBottom: true, ...props }),
2923
+ li: ({ node, ...props }) => /* @__PURE__ */ jsx(Box, { component: "li", sx: { mb: 1, ml: 2 }, ...props }),
2924
+ ul: ({ node, ...props }) => /* @__PURE__ */ jsx(Box, { component: "ul", sx: { mb: 2 }, ...props }),
2925
+ ol: ({ node, ...props }) => /* @__PURE__ */ jsx(Box, { component: "ol", sx: { mb: 2 }, ...props }),
2926
+ a: ({ node, ...props }) => /* @__PURE__ */ jsx(Link, { ...props, target: "_blank", rel: "noopener" })
2927
+ },
2928
+ children: markdownContent
2929
+ }
2930
+ ) }),
2931
+ /* @__PURE__ */ jsx(Box, { sx: { display: "flex", flexDirection: "column", gap: 1 }, children: requirements.map((req, index) => /* @__PURE__ */ jsx(Box, { sx: { display: "flex", alignItems: "flex-start" }, children: /* @__PURE__ */ jsx(
2932
+ FormControlLabel$1,
2933
+ {
2934
+ control: /* @__PURE__ */ jsx(
2935
+ Checkbox$1,
2936
+ {
2937
+ checked: checkedState[index],
2938
+ onChange: () => handleCheckboxChange(index)
2939
+ }
2940
+ ),
2941
+ label: /* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
2942
+ req.statement,
2943
+ req.link && req.linkText && /* @__PURE__ */ jsxs(Fragment, { children: [
2944
+ " ",
2945
+ /* @__PURE__ */ jsx(Link, { href: req.link, target: "_blank", rel: "noopener", children: req.linkText })
2946
+ ] }),
2947
+ req.required && /* @__PURE__ */ jsx(
2948
+ Typography,
2949
+ {
2950
+ component: "span",
2951
+ color: "error",
2952
+ sx: { ml: 0.5 },
2953
+ children: "*"
2954
+ }
2955
+ )
2956
+ ] })
2957
+ }
2958
+ ) }, index)) })
2959
+ ] }),
2960
+ /* @__PURE__ */ jsxs(DialogActions, { children: [
2961
+ !forceAgreement && /* @__PURE__ */ jsx(Button, { onClick: onClose, color: "inherit", children: "Cancel" }),
2962
+ /* @__PURE__ */ jsx(
2963
+ Button,
2964
+ {
2965
+ onClick: handleAccept,
2966
+ variant: "contained",
2967
+ disabled: !isAllRequiredChecked,
2968
+ fullWidth: forceAgreement,
2969
+ children: "Accept"
2970
+ }
2971
+ )
2972
+ ] })
2973
+ ]
2480
2974
  }
2481
2975
  );
2482
2976
  };
2483
- var Modal_default = Modal;
2484
- var ModalProvider = ({ children }) => {
2485
- const [modalContent, setModalContent] = useState(null);
2486
- const showModal = (content) => setModalContent(content);
2487
- const hideModal = () => setModalContent(null);
2488
- return /* @__PURE__ */ jsxs(ModalContext.Provider, { value: { showModal, hideModal }, children: [
2489
- children,
2490
- modalContent && /* @__PURE__ */ jsx(Modal_default, { onClose: hideModal, children: modalContent })
2491
- ] });
2492
- };
2493
- var ModalProvider_default = ModalProvider;
2977
+ var UserAgreementModal_default = UserAgreementModal;
2494
2978
  var PlayerHighlightsCard = function(props) {
2495
2979
  const {
2496
2980
  allTags,
@@ -2502,16 +2986,16 @@ var PlayerHighlightsCard = function(props) {
2502
2986
  removeFromTable
2503
2987
  } = props;
2504
2988
  return /* @__PURE__ */ jsx(Card, { elevation: 3, sx: { backgroundColor: canEdit ? "#fffbea" : "#f5f9fa", marginBottom: "6px" }, children: /* @__PURE__ */ jsxs(CardContent, { children: [
2505
- /* @__PURE__ */ jsxs(Grid8, { container: true, spacing: 2, direction: "column", children: [
2506
- /* @__PURE__ */ jsxs(Grid8, { container: true, direction: "row", children: [
2507
- /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(Image2, { alt: player.username + "'s profile pic", height: 64, src: player.miniPic || "", width: 64 }) }),
2508
- /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: player.username }) })
2989
+ /* @__PURE__ */ jsxs(Grid10, { container: true, spacing: 2, direction: "column", children: [
2990
+ /* @__PURE__ */ jsxs(Grid10, { container: true, direction: "row", children: [
2991
+ /* @__PURE__ */ jsx(Grid10, { children: /* @__PURE__ */ jsx(Image2, { alt: player.username + "'s profile pic", height: 64, src: player.miniPic || DEFAULT_PROFILE_PIC, width: 64 }) }),
2992
+ /* @__PURE__ */ jsx(Grid10, { children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: player.username }) })
2509
2993
  ] }),
2510
- /* @__PURE__ */ jsx(Grid8, { children: renderTagsFromIds(player.tags, allTags) })
2994
+ /* @__PURE__ */ jsx(Grid10, { children: renderTagsFromIds(player.tags, allTags) })
2511
2995
  ] }),
2512
- canEdit && /* @__PURE__ */ jsxs(Grid8, { children: [
2513
- /* @__PURE__ */ jsx(Button7, { onClick: () => removeFromTable(player), children: isWaitList ? /* @__PURE__ */ jsx("p", { children: "Deny Player" }) : /* @__PURE__ */ jsx("p", { children: "Remove Player" }) }),
2514
- canChangeDungeonMaster && /* @__PURE__ */ jsx(Button7, { onClick: () => {
2996
+ canEdit && /* @__PURE__ */ jsxs(Grid10, { children: [
2997
+ /* @__PURE__ */ jsx(Button8, { onClick: () => removeFromTable(player), children: isWaitList ? /* @__PURE__ */ jsx("p", { children: "Deny Player" }) : /* @__PURE__ */ jsx("p", { children: "Remove Player" }) }),
2998
+ canChangeDungeonMaster && /* @__PURE__ */ jsx(Button8, { onClick: () => {
2515
2999
  handleAssignToDungeonMaster(player);
2516
3000
  removeFromTable(player);
2517
3001
  }, children: /* @__PURE__ */ jsx("p", { children: "Assign to DungeonMaster" }) })
@@ -2521,11 +3005,11 @@ var PlayerHighlightsCard = function(props) {
2521
3005
  var DMHighlightsCard = function({ canEdit, player, allTags }) {
2522
3006
  return /* @__PURE__ */ jsxs(Card, { elevation: 3, sx: { backgroundColor: "#f5f9fa", marginBottom: "6px" }, children: [
2523
3007
  /* @__PURE__ */ jsx(CardHeader, { slotProps: { title: { variant: "h4" } }, title: "Game Master" }),
2524
- /* @__PURE__ */ jsx(CardContent, { sx: { backgroundColor: canEdit ? "#fffbea" : "inherit" }, children: /* @__PURE__ */ jsxs(Grid8, { container: true, spacing: 2, direction: "column", children: [
2525
- /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: player.username }) }),
2526
- /* @__PURE__ */ jsxs(Grid8, { container: true, direction: "row", children: [
2527
- /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(Image2, { alt: player.username + "'s profile pic", height: 120, src: player.imageUrl ? player.imageUrl : "", width: 256 }) }),
2528
- /* @__PURE__ */ jsx(Grid8, { children: renderTagsFromIds(player.tags, allTags) }),
3008
+ /* @__PURE__ */ jsx(CardContent, { sx: { backgroundColor: canEdit ? "#fffbea" : "inherit" }, children: /* @__PURE__ */ jsxs(Grid10, { container: true, spacing: 2, direction: "column", children: [
3009
+ /* @__PURE__ */ jsx(Grid10, { children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: player.username }) }),
3010
+ /* @__PURE__ */ jsxs(Grid10, { container: true, direction: "row", children: [
3011
+ /* @__PURE__ */ jsx(Grid10, { children: /* @__PURE__ */ jsx(Image2, { alt: player.username + "'s profile pic", height: 120, src: player.imageUrl || DEFAULT_PROFILE_PIC, width: 256 }) }),
3012
+ /* @__PURE__ */ jsx(Grid10, { children: renderTagsFromIds(player.tags, allTags) }),
2529
3013
  /* @__PURE__ */ jsx(Typography, { children: player.description })
2530
3014
  ] })
2531
3015
  ] }) })
@@ -2554,12 +3038,11 @@ function TableActionsBar(props) {
2554
3038
  if (waitlistPlayers.length === 0) {
2555
3039
  return /* @__PURE__ */ jsx("p", { children: "Waitlist is empty!" });
2556
3040
  }
2557
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
2558
- /* @__PURE__ */ jsx(CardHeader4, { slotProps: { title: { variant: "h4" } }, title: "Waitlist Players: " }),
2559
- /* @__PURE__ */ jsx("ul", { className: "gap-8", children: waitlistPlayers.map((player) => /* @__PURE__ */ jsxs(
3041
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3042
+ /* @__PURE__ */ jsx("ul", { className: "gap-8 px-6", children: waitlistPlayers.map((player) => /* @__PURE__ */ jsxs(
2560
3043
  "li",
2561
3044
  {
2562
- className: `${canMovePlayersToTable ? "bg-amber-100 cursor-pointer" : "bg-gray-200"} mb-8 flex flex-row flex-start space-between justify-center items-center gap-3 p-2 rounded`,
3045
+ className: `${canMovePlayersToTable ? "bg-amber-100 cursor-pointer" : "bg-gray-200"} mb-8 flex flex-row flex-start space-between items-center gap-3 p-2 rounded`,
2563
3046
  onClick: () => canMovePlayersToTable ? onPromoteWaitlistPlayer == null ? void 0 : onPromoteWaitlistPlayer(player.id) : void 0,
2564
3047
  tabIndex: 0,
2565
3048
  children: [
@@ -2568,7 +3051,7 @@ function TableActionsBar(props) {
2568
3051
  {
2569
3052
  alt: player.username + "'s profile pic",
2570
3053
  height: 64,
2571
- src: player.miniPic || "",
3054
+ src: player.miniPic || DEFAULT_PROFILE_PIC,
2572
3055
  width: 64
2573
3056
  }
2574
3057
  ),
@@ -2577,7 +3060,7 @@ function TableActionsBar(props) {
2577
3060
  },
2578
3061
  player.id
2579
3062
  )) }),
2580
- /* @__PURE__ */ jsx("button", { onClick: () => hideModal(), children: "close modal" })
3063
+ /* @__PURE__ */ jsx(DialogActions3, { children: /* @__PURE__ */ jsx(Button8, { onClick: () => hideModal(), children: "Close" }) })
2581
3064
  ] });
2582
3065
  };
2583
3066
  return /* @__PURE__ */ jsxs(Grid, { container: true, direction: "column", spacing: 1, children: [
@@ -2588,33 +3071,45 @@ function TableActionsBar(props) {
2588
3071
  slots
2589
3072
  ] }) }),
2590
3073
  /* @__PURE__ */ jsxs(Grid, { container: true, direction: "row", children: [
2591
- !isOwner && !isPlayer && !isDM && !onWaitlist && /* @__PURE__ */ jsx(Button7, { onClick: () => onJoinWaitlist == null ? void 0 : onJoinWaitlist(), sx: buttonStyle, children: "Join Waitlist" }),
2592
- !isOwner && (isPlayer || onWaitlist) && /* @__PURE__ */ jsx(Button7, { onClick: () => onLeaveTable == null ? void 0 : onLeaveTable(), sx: buttonStyle, children: onWaitlist ? "Leave Waitlist" : "Leave Table" }),
3074
+ !isOwner && !isPlayer && !isDM && !onWaitlist && /* @__PURE__ */ jsx(Button8, { onClick: () => onJoinWaitlist == null ? void 0 : onJoinWaitlist(), sx: buttonStyle, children: "Join Waitlist" }),
3075
+ !isOwner && (isPlayer || onWaitlist) && /* @__PURE__ */ jsx(Button8, { onClick: () => onLeaveTable == null ? void 0 : onLeaveTable(), sx: buttonStyle, children: onWaitlist ? "Leave Waitlist" : "Leave Table" }),
2593
3076
  canEditTable ? /* @__PURE__ */ jsxs(Fragment, { children: [
2594
- /* @__PURE__ */ jsx(Button7, { onClick: () => onEditModeChange(true), sx: buttonStyle, endIcon: /* @__PURE__ */ jsx(EditIcon, {}), children: "Edit" }),
3077
+ /* @__PURE__ */ jsx(Button8, { onClick: () => onEditModeChange(true), sx: buttonStyle, endIcon: /* @__PURE__ */ jsx(EditIcon3, {}), children: "Edit" }),
2595
3078
  canViewWaitlist ? /* @__PURE__ */ jsx(
2596
- Button7,
3079
+ Button8,
2597
3080
  {
2598
3081
  endIcon: /* @__PURE__ */ jsx(ListIcon, {}),
2599
- onClick: () => showModal(renderPlayerWaitlistModalContent(false)),
3082
+ onClick: () => showModal(renderPlayerWaitlistModalContent(false), "Waitlist Players:"),
2600
3083
  sx: buttonStyle,
2601
3084
  children: "View Waitlist"
2602
3085
  }
2603
3086
  ) : null
2604
3087
  ] }) : canSaveTable ? /* @__PURE__ */ jsxs(Fragment, { children: [
2605
- /* @__PURE__ */ jsx(Button7, { onClick: onSave, sx: buttonStyle, endIcon: /* @__PURE__ */ jsx(SaveIcon, {}), children: "Save" }),
2606
- /* @__PURE__ */ jsx(Button7, { onClick: () => onEditModeChange(false), sx: buttonStyle, children: "Cancel" }),
3088
+ /* @__PURE__ */ jsx(Button8, { onClick: onSave, sx: buttonStyle, endIcon: /* @__PURE__ */ jsx(SaveIcon, {}), children: "Save" }),
3089
+ /* @__PURE__ */ jsx(Button8, { onClick: () => onEditModeChange(false), sx: buttonStyle, children: "Cancel" }),
2607
3090
  /* @__PURE__ */ jsx(
2608
- Button7,
3091
+ Button8,
2609
3092
  {
2610
3093
  endIcon: /* @__PURE__ */ jsx(ListIcon, {}),
2611
- onClick: () => showModal(renderPlayerWaitlistModalContent(true)),
3094
+ onClick: () => showModal(renderPlayerWaitlistModalContent(true), "Waitlist Players:"),
2612
3095
  sx: buttonStyle,
2613
3096
  children: "Edit Waitlist"
2614
3097
  }
2615
3098
  )
2616
3099
  ] }) : null,
2617
- isOwner && /* @__PURE__ */ jsx(Button7, { onClick: () => onDeleteTable == null ? void 0 : onDeleteTable(), sx: buttonStyle, endIcon: /* @__PURE__ */ jsx(DeleteIcon, {}), children: "Delete Table" })
3100
+ isOwner && /* @__PURE__ */ jsx(
3101
+ Button8,
3102
+ {
3103
+ onClick: () => showModal(
3104
+ /* @__PURE__ */ jsx(Typography, { children: "Are you sure you want to delete this table? This action cannot be undone." }),
3105
+ "Delete Table",
3106
+ { acceptText: "Delete", onAccept: () => onDeleteTable == null ? void 0 : onDeleteTable() }
3107
+ ),
3108
+ sx: buttonStyle,
3109
+ endIcon: /* @__PURE__ */ jsx(DeleteIcon, {}),
3110
+ children: "Delete Table"
3111
+ }
3112
+ )
2618
3113
  ] })
2619
3114
  ] });
2620
3115
  }
@@ -2624,165 +3119,82 @@ var buttonStyle = {
2624
3119
  color: "white",
2625
3120
  borderRadius: "5px"
2626
3121
  };
2627
- var AutoResizingTextarea = (props) => {
2628
- const { isInEditMode, onChange, textareaRef, value } = props;
2629
- useEffect(() => {
2630
- if (isInEditMode && textareaRef.current) {
2631
- const textarea = textareaRef.current;
2632
- textarea.style.height = "auto";
2633
- textarea.style.height = `${textarea.scrollHeight}px`;
2634
- }
2635
- }, [isInEditMode, textareaRef, value]);
2636
- return /* @__PURE__ */ jsx(
2637
- "textarea",
2638
- {
2639
- ref: textareaRef,
2640
- value,
2641
- onChange: (e) => onChange(e.target.value),
2642
- style: {
2643
- backgroundColor: "#fffbea",
2644
- overflow: "hidden",
2645
- resize: "none",
2646
- width: "100%"
2647
- }
2648
- }
2649
- );
2650
- };
2651
- var AutoResizingTextarea_default = AutoResizingTextarea;
2652
- var NextGameCountdown = ({ nextGameTime }) => {
2653
- const [timeLeft, setTimeLeft] = useState("");
2654
- useEffect(() => {
2655
- if (!nextGameTime) return;
2656
- const timer = setInterval(() => {
2657
- const now = (/* @__PURE__ */ new Date()).getTime();
2658
- const distance = new Date(nextGameTime).getTime() - now;
2659
- if (distance < 0) {
2660
- clearInterval(timer);
2661
- setTimeLeft("Started");
2662
- return;
2663
- }
2664
- const days = Math.floor(distance / (1e3 * 60 * 60 * 24));
2665
- const hours = Math.floor(distance % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60));
2666
- const minutes = Math.floor(distance % (1e3 * 60 * 60) / (1e3 * 60));
2667
- const seconds = Math.floor(distance % (1e3 * 60) / 1e3);
2668
- let timeString = "";
2669
- if (days > 0) timeString += `${days}d `;
2670
- if (hours > 0 || days > 0) timeString += `${hours}h `;
2671
- timeString += `${minutes}m ${seconds}s`;
2672
- setTimeLeft(timeString);
2673
- }, 1e3);
2674
- return () => clearInterval(timer);
2675
- }, [nextGameTime]);
2676
- if (!nextGameTime) return null;
2677
- return /* @__PURE__ */ jsxs(Typography, { variant: "body2", color: "primary", sx: { fontWeight: "bold" }, children: [
2678
- "Next Game: ",
2679
- timeLeft
2680
- ] });
2681
- };
2682
- function TagEditor({
2683
- title = "Tags",
2684
- selectedTags,
2685
- possibleTags,
2686
- onToggleTag
2687
- }) {
2688
- const [inputValue, setInputValue] = useState("");
2689
- const selectedIds = useMemo(() => selectedTags.map((tag) => tag.id), [selectedTags]);
2690
- const options = useMemo(
2691
- () => possibleTags.map((tag) => ({ value: tag.id, label: tag.label })),
2692
- [possibleTags]
2693
- );
2694
- return /* @__PURE__ */ jsx(Grid8, { container: true, children: /* @__PURE__ */ jsx(Grid8, { size: { xs: 12 }, children: /* @__PURE__ */ jsxs(Card10, { children: [
2695
- /* @__PURE__ */ jsx(
2696
- CardHeader4,
2697
- {
2698
- title,
2699
- style: {
2700
- background: "linear-gradient(135deg, rgba(25, 118, 210, 0.8), rgba(25, 118, 210, 1))",
2701
- color: "#FFFFFF",
2702
- fontSize: "1.5rem",
2703
- textShadow: "0px 3px 6px rgba(0, 0, 0, 0.5)"
2704
- }
2705
- }
2706
- ),
2707
- /* @__PURE__ */ jsxs(CardContent10, { children: [
2708
- /* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: selectedTags.map((tag) => /* @__PURE__ */ jsx(
2709
- Chip,
2710
- {
2711
- tag,
2712
- removeCallback: () => onToggleTag(tag.id)
2713
- },
2714
- tag.id
2715
- )) }),
2716
- /* @__PURE__ */ jsx(Grid8, { container: true, spacing: 3, children: /* @__PURE__ */ jsx(Grid8, { sx: { marginTop: 3, width: "100%" }, children: /* @__PURE__ */ jsx(
2717
- Autocomplete,
2718
- {
2719
- options,
2720
- filterOptions: (availableOptions, state) => availableOptions.filter(
2721
- (option) => !selectedIds.includes(option.value) && option.label.toLowerCase().includes(state.inputValue.toLowerCase())
2722
- ).slice(0, 3),
2723
- value: null,
2724
- inputValue,
2725
- onInputChange: (event, newInputValue) => {
2726
- if (event && event.type === "change") {
2727
- setInputValue(newInputValue);
2728
- }
2729
- },
2730
- onChange: (event, newValue) => {
2731
- if (newValue) {
2732
- onToggleTag(newValue.value);
2733
- }
2734
- setInputValue("");
2735
- },
2736
- slots: { popper: CustomPopper3 },
2737
- renderInput: (params) => /* @__PURE__ */ jsx(TextField4, { ...params, label: "Select Tags" })
2738
- },
2739
- selectedIds.join("-")
2740
- ) }) })
2741
- ] })
2742
- ] }) }) });
2743
- }
2744
- var CustomPopper3 = (props) => {
2745
- return /* @__PURE__ */ jsx(
2746
- Popper,
2747
- {
2748
- ...props,
2749
- modifiers: [
2750
- {
2751
- name: "preventOverflow",
2752
- options: { boundary: "viewport" }
2753
- },
2754
- {
2755
- name: "offset",
2756
- options: { offset: [0, -10] }
2757
- }
2758
- ],
2759
- placement: "top-start"
2760
- }
2761
- );
2762
- };
2763
3122
  function TablePageLayout(props) {
2764
3123
  var _a;
2765
- const { allTags, dungeonMaster, onDeleteTable, onJoinWaitlist, onLeaveTable, onSaveDraft, players, table, tableStatus, waitlistPlayers } = props;
3124
+ const { hideModal, showModal } = useModal();
3125
+ const { allTags, dungeonMaster, onDeleteTable, onJoinWaitlist, onLeaveTable, onSaveDraft, players, table, tableStatus, waitlistPlayers, startWithEditTitle, eventTagId } = props;
3126
+ const canEdit = tableStatus.isOwner;
2766
3127
  const textAreaRef = useRef(null);
2767
3128
  const [isTableInEditMode, setIsTableInEditMode] = useState(false);
3129
+ const [currentTitle, setCurrentTitle] = useState(table.title);
3130
+ const [currentSubtitle, setCurrentSubtitle] = useState(table.shortDescription);
2768
3131
  const [currentDescription, setCurrentDescription] = useState(table.description);
2769
3132
  const [currentDungeonMaster, setCurrentDungeonMaster] = useState(dungeonMaster);
2770
3133
  const [currentPlayers, setCurrentPlayers] = useState(players);
2771
- const [currentShortDescription, setCurrentShortDescription] = useState(table.shortDescription);
2772
- const [currentTitle, setCurrentTitle] = useState(table.title);
2773
3134
  const [currentWaitlistPlayers, setCurrentWaitlistPlayers] = useState(waitlistPlayers);
2774
3135
  const [currentTagIds, setCurrentTagIds] = useState((_a = table.tags) != null ? _a : []);
3136
+ const pendingEdits = useRef({ title: currentTitle, subtitle: currentSubtitle, tags: currentTagIds });
3137
+ const handleSaveTable = (tableData = {}) => {
3138
+ const nextDraft = {
3139
+ ...table,
3140
+ description: currentDescription,
3141
+ dungeonMaster: String(currentDungeonMaster.id),
3142
+ players: currentPlayers.map((player) => player.id),
3143
+ shortDescription: currentSubtitle,
3144
+ tags: currentTagIds,
3145
+ title: currentTitle,
3146
+ waitlist: currentWaitlistPlayers.map((player) => player.id),
3147
+ ...tableData
3148
+ };
3149
+ void (onSaveDraft == null ? void 0 : onSaveDraft(nextDraft));
3150
+ setIsTableInEditMode(false);
3151
+ };
3152
+ const clean = (text) => text.replaceAll(
3153
+ /\b(n[i1!]g+(er|a|e)s?|f[a@]g|f[a@]g+[o0]ts?|k[i1!]k[e3]s?|ch[i1!]nks?|w[e3]tb[a@]cks?|r[a@]gh[e3][a@]ds?|t[o0]w[e3]lh[e3][a@]ds?|r[e3]t[a@]rd(ed|s)?|c[o0][o0]ns?|tr[a@]nn(y|i[e3]s?)|g[o0][o0]ks?)\b/gi,
3154
+ "dudes"
3155
+ );
3156
+ const editTableDetails = () => {
3157
+ if (!canEdit) {
3158
+ return;
3159
+ }
3160
+ pendingEdits.current = {
3161
+ title: currentTitle,
3162
+ subtitle: currentSubtitle,
3163
+ tags: currentTagIds
3164
+ };
3165
+ const editContent = /* @__PURE__ */ jsx(
3166
+ EditTableDetailsForm,
3167
+ {
3168
+ initialTitle: currentTitle,
3169
+ initialSubtitle: currentSubtitle,
3170
+ onTitleChange: (t) => pendingEdits.current.title = t,
3171
+ onSubtitleChange: (s) => pendingEdits.current.subtitle = s,
3172
+ onTagChange: (t) => pendingEdits.current.tags = t,
3173
+ initialTagIDs: currentTagIds,
3174
+ allTags: allTags.filter((t) => t.appliesTo.tables),
3175
+ allowEditingTitles: true
3176
+ }
3177
+ );
3178
+ showModal(editContent, "Edit Table Details", {
3179
+ acceptText: "Save",
3180
+ onAccept: () => {
3181
+ setCurrentTitle(clean(pendingEdits.current.title));
3182
+ setCurrentSubtitle(clean(pendingEdits.current.subtitle));
3183
+ setCurrentTagIds(pendingEdits.current.tags);
3184
+ handleSaveTable({
3185
+ title: clean(pendingEdits.current.title),
3186
+ shortDescription: clean(pendingEdits.current.subtitle),
3187
+ tags: pendingEdits.current.tags
3188
+ });
3189
+ }
3190
+ });
3191
+ };
2775
3192
  useEffect(() => {
2776
- var _a2;
2777
- setCurrentDescription(table.description);
2778
- setCurrentDungeonMaster(dungeonMaster);
2779
- setCurrentPlayers(players);
2780
- setCurrentShortDescription(table.shortDescription);
2781
- setCurrentTitle(table.title);
2782
- setCurrentWaitlistPlayers(waitlistPlayers);
2783
- setCurrentTagIds((_a2 = table.tags) != null ? _a2 : []);
2784
- }, [dungeonMaster, players, table, waitlistPlayers]);
2785
- const currentTags = useMemo(
3193
+ if (startWithEditTitle) {
3194
+ editTableDetails();
3195
+ }
3196
+ });
3197
+ useMemo(
2786
3198
  () => allTags.filter((tag) => currentTagIds.includes(tag.id)),
2787
3199
  [allTags, currentTagIds]
2788
3200
  );
@@ -2802,37 +3214,17 @@ function TablePageLayout(props) {
2802
3214
  return prevWaitlist.filter((player) => player.id !== playerIdToPromote);
2803
3215
  });
2804
3216
  };
2805
- const handleToggleTag = (tagId) => {
2806
- setCurrentTagIds(
2807
- (prevState) => prevState.includes(tagId) ? prevState.filter((id) => id !== tagId) : [...prevState, tagId]
2808
- );
2809
- };
2810
- const handleSaveTable = () => {
2811
- const nextDraft = {
2812
- ...table,
2813
- description: currentDescription,
2814
- dungeonMaster: String(currentDungeonMaster.id),
2815
- players: currentPlayers.map((player) => player.id),
2816
- shortDescription: currentShortDescription,
2817
- tags: currentTagIds,
2818
- title: currentTitle,
2819
- waitlist: currentWaitlistPlayers.map((player) => player.id)
2820
- };
2821
- void (onSaveDraft == null ? void 0 : onSaveDraft(nextDraft));
2822
- setIsTableInEditMode(false);
2823
- };
2824
3217
  return /* @__PURE__ */ jsx(
2825
3218
  Card,
2826
3219
  {
2827
3220
  sx: {
2828
3221
  backgroundColor: isTableInEditMode ? "lightsalmon" : "white",
2829
- borderRadius: "5%",
2830
3222
  p: 2,
2831
3223
  boxShadow: "0px 8px 15px rgba(25, 118, 210, 0.3)"
2832
3224
  },
2833
- children: /* @__PURE__ */ jsxs(Grid8, { container: true, direction: "column", children: [
3225
+ children: /* @__PURE__ */ jsxs(Grid10, { container: true, direction: "column", children: [
2834
3226
  /* @__PURE__ */ jsxs(
2835
- Grid8,
3227
+ Grid10,
2836
3228
  {
2837
3229
  container: true,
2838
3230
  direction: "column",
@@ -2845,39 +3237,49 @@ function TablePageLayout(props) {
2845
3237
  textShadow: "4px 4px 6px rgba(0, 0, 0, 0.5)"
2846
3238
  },
2847
3239
  children: [
2848
- /* @__PURE__ */ jsx(Box, { children: isTableInEditMode ? /* @__PURE__ */ jsx(
2849
- "input",
2850
- {
2851
- onChange: (e) => setCurrentTitle(e.target.value),
2852
- style: { backgroundColor: "#fffbea" },
2853
- tabIndex: 0,
2854
- type: "text",
2855
- value: currentTitle
2856
- }
2857
- ) : /* @__PURE__ */ jsx(
2858
- CardHeader,
3240
+ /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(
3241
+ Box,
2859
3242
  {
2860
- title: currentTitle,
2861
- sx: {
2862
- p: 0,
2863
- "& .MuiCardHeader-title": {
2864
- color: "white",
2865
- fontWeight: 700
2866
- }
2867
- }
3243
+ className: `flex items-center gap-1 ${canEdit ? "cursor-pointer" : ""}`,
3244
+ sx: { "&:hover .edit-icon": { opacity: 1 } },
3245
+ onClick: editTableDetails,
3246
+ children: [
3247
+ /* @__PURE__ */ jsx(
3248
+ CardHeader,
3249
+ {
3250
+ title: currentTitle,
3251
+ sx: {
3252
+ p: 0,
3253
+ "& .MuiCardHeader-title": {
3254
+ color: "white",
3255
+ fontWeight: 700
3256
+ }
3257
+ }
3258
+ }
3259
+ ),
3260
+ canEdit ? /* @__PURE__ */ jsx(EditIcon3, { className: "edit-icon text-white", sx: { opacity: 0, transition: "opacity 0.2s" } }) : ""
3261
+ ]
2868
3262
  }
2869
3263
  ) }),
2870
- isTableInEditMode ? /* @__PURE__ */ jsx(
2871
- "input",
3264
+ /* @__PURE__ */ jsxs(
3265
+ Box,
2872
3266
  {
2873
- onChange: (e) => setCurrentShortDescription(e.target.value),
2874
- style: { backgroundColor: "#fffbea" },
2875
- tabIndex: 0,
2876
- type: "text",
2877
- value: currentShortDescription
3267
+ className: `flex items-center gap-1 ${canEdit ? "cursor-pointer" : ""}`,
3268
+ sx: { "&:hover .edit-icon": { opacity: 1 } },
3269
+ onClick: editTableDetails,
3270
+ children: [
3271
+ /* @__PURE__ */ jsx(
3272
+ Typography,
3273
+ {
3274
+ sx: { color: "white", opacity: 0.95 },
3275
+ children: currentSubtitle
3276
+ }
3277
+ ),
3278
+ canEdit ? /* @__PURE__ */ jsx(EditIcon3, { className: "edit-icon text-white", sx: { opacity: 0, transition: "opacity 0.2s", fontSize: "medium" } }) : ""
3279
+ ]
2878
3280
  }
2879
- ) : /* @__PURE__ */ jsx(Typography, { sx: { color: "white", opacity: 0.95 }, children: currentShortDescription }),
2880
- /* @__PURE__ */ jsx(Grid8, { container: true, children: isTableInEditMode ? renderEditableTags(currentTags, allTags, handleToggleTag) : renderTags(currentTagIds, allTags) }),
3281
+ ),
3282
+ /* @__PURE__ */ jsx(Grid10, { container: true, onClick: editTableDetails, className: `${canEdit ? "cursor-pointer" : ""}`, children: renderTags(currentTagIds, allTags, canEdit, table.eventTagId || eventTagId) }),
2881
3283
  /* @__PURE__ */ jsx(
2882
3284
  TableActionsBar,
2883
3285
  {
@@ -2897,8 +3299,8 @@ function TablePageLayout(props) {
2897
3299
  ]
2898
3300
  }
2899
3301
  ),
2900
- /* @__PURE__ */ jsxs(Grid8, { container: true, spacing: 2, sx: { mt: 2 }, children: [
2901
- /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 8 }, children: /* @__PURE__ */ jsx(Card, { sx: { height: "100%" }, children: /* @__PURE__ */ jsx(CardContent, { children: isTableInEditMode ? /* @__PURE__ */ jsx(
3302
+ /* @__PURE__ */ jsxs(Grid10, { container: true, spacing: 2, sx: { mt: 2 }, children: [
3303
+ /* @__PURE__ */ jsx(Grid10, { size: { xs: 12, md: 8 }, children: /* @__PURE__ */ jsx(Card, { sx: { height: "100%" }, children: /* @__PURE__ */ jsx(CardContent, { children: isTableInEditMode ? /* @__PURE__ */ jsx(
2902
3304
  AutoResizingTextarea_default,
2903
3305
  {
2904
3306
  isInEditMode: isTableInEditMode,
@@ -2907,7 +3309,7 @@ function TablePageLayout(props) {
2907
3309
  value: currentDescription
2908
3310
  }
2909
3311
  ) : /* @__PURE__ */ jsx(Typography, { sx: { whiteSpace: "pre-wrap" }, children: currentDescription }) }) }) }),
2910
- /* @__PURE__ */ jsxs(Grid8, { size: { xs: 12, md: 4 }, children: [
3312
+ /* @__PURE__ */ jsxs(Grid10, { size: { xs: 12, md: 4 }, children: [
2911
3313
  /* @__PURE__ */ jsx(DMHighlightsCard, { canEdit: isTableInEditMode, player: currentDungeonMaster, allTags }),
2912
3314
  /* @__PURE__ */ jsxs(Card, { sx: { height: "100%" }, children: [
2913
3315
  /* @__PURE__ */ jsx(CardHeader, { slotProps: { title: { variant: "h4" } }, title: "Players: " }),
@@ -2930,31 +3332,78 @@ function TablePageLayout(props) {
2930
3332
  }
2931
3333
  );
2932
3334
  }
2933
- var renderTags = function(tags, allTags) {
3335
+ var renderTags = function(tags, allTags, canEdit, eventTagId) {
2934
3336
  if (!tags || !allTags) {
2935
3337
  return /* @__PURE__ */ jsx(Fragment, {});
2936
3338
  }
2937
- return /* @__PURE__ */ jsx(Grid8, { container: true, spacing: 1, sx: { pb: 1.5 }, children: tags.map((tagId) => {
2938
- const tag = allTags.find((potentialTag) => tagId === potentialTag.id);
2939
- return tag ? generateTagsDisplay(tag) : /* @__PURE__ */ jsx(Fragment, {});
2940
- }) });
2941
- };
2942
- var renderEditableTags = function(selectedTags, allTags, onToggleTag) {
2943
- return /* @__PURE__ */ jsx(Grid8, { size: { xs: 12 }, sx: { pb: 1.5 }, children: /* @__PURE__ */ jsx(
2944
- TagEditor,
2945
- {
2946
- title: "Table Tags",
2947
- possibleTags: allTags.filter((tag) => {
2948
- var _a;
2949
- return (_a = tag.appliesTo) == null ? void 0 : _a.tables;
2950
- }),
2951
- selectedTags,
2952
- onToggleTag
2953
- }
2954
- ) });
3339
+ return /* @__PURE__ */ jsxs(Grid10, { container: true, spacing: 1, sx: { pb: 1.5 }, children: [
3340
+ renderTagsFromIds(tags, allTags, { showEventTag: true, eventTagId }),
3341
+ canEdit ? /* @__PURE__ */ jsx(
3342
+ Button,
3343
+ {
3344
+ variant: "text",
3345
+ className: "inline-block text-sm px-3 py-1font-outlined m-0.5 font-stretch-105% font-sans",
3346
+ sx: {
3347
+ color: "white",
3348
+ textShadow: "black 1.5px 1px 1.5px",
3349
+ "&:hover": {
3350
+ background: "#889"
3351
+ }
3352
+ },
3353
+ children: "Edit Tags..."
3354
+ }
3355
+ ) : ""
3356
+ ] });
2955
3357
  };
2956
3358
  var TablePageLayout_default = TablePageLayout;
3359
+ var ModalProvider = ({ children }) => {
3360
+ var _a;
3361
+ const [modalContent, setModalContent] = useState(null);
3362
+ const [displayModal, setDisplayModal] = useState(false);
3363
+ const [title, setTitle] = useState("");
3364
+ const [options, setOptions] = useState({});
3365
+ const showModal = (content, title2, opts) => {
3366
+ setModalContent(content);
3367
+ setTitle(title2);
3368
+ setOptions(opts != null ? opts : {});
3369
+ setDisplayModal(true);
3370
+ };
3371
+ const hideModal = () => {
3372
+ setDisplayModal(false);
3373
+ };
3374
+ return /* @__PURE__ */ jsxs(ModalContext.Provider, { value: { showModal, hideModal }, children: [
3375
+ children,
3376
+ /* @__PURE__ */ jsxs(Dialog3, { open: displayModal, onClose: hideModal, sx: { height: "85%" }, children: [
3377
+ /* @__PURE__ */ jsxs(Box, { children: [
3378
+ /* @__PURE__ */ jsx(DialogTitle3, { sx: { marginRight: "20px", minWidth: "400px" }, children: title }),
3379
+ /* @__PURE__ */ jsx(
3380
+ IconButton3,
3381
+ {
3382
+ "aria-label": "close",
3383
+ onClick: hideModal,
3384
+ sx: { position: "absolute", right: 8, top: 8 },
3385
+ children: /* @__PURE__ */ jsx(CloseIcon, {})
3386
+ }
3387
+ )
3388
+ ] }),
3389
+ /* @__PURE__ */ jsx(DialogContent3, { sx: { paddingTop: 0 }, children: modalContent }),
3390
+ (options.acceptText || options.onAccept) && /* @__PURE__ */ jsxs(DialogActions3, { children: [
3391
+ /* @__PURE__ */ jsx(Button8, { variant: "contained", onClick: () => {
3392
+ var _a2;
3393
+ hideModal();
3394
+ (_a2 = options.onAccept) == null ? void 0 : _a2.call(options);
3395
+ }, children: (_a = options.acceptText) != null ? _a : "OK" }),
3396
+ /* @__PURE__ */ jsx(Button8, { onClick: () => {
3397
+ var _a2;
3398
+ hideModal();
3399
+ (_a2 = options.onCancel) == null ? void 0 : _a2.call(options);
3400
+ }, children: "Cancel" })
3401
+ ] })
3402
+ ] })
3403
+ ] });
3404
+ };
3405
+ var ModalProvider_default = ModalProvider;
2957
3406
 
2958
- export { AutoResizingTextarea_default as AutoResizingTextarea, BaseSearchResultCard_default as BaseSearchResultCard, CANDIDATE_TIMEZONES, Chip, DMHighlightsCard, EventBanner, EventBannerEdit, EventBasicInfo, EventBasicInfoEdit, EventEditProvider, EventPageLayout, EventResultCard_default as EventResultCard, EventTablesCard_default as EventTablesCard, ExpiredTablesFilter_default as ExpiredTablesFilter, FiltersContainer_default as FiltersContainer, GameTableProvider, ModalContext, ModalProvider_default as ModalProvider, NextGameCountdown, NextGameLabel_default as NextGameLabel, PlayerDetailsCard_default as PlayerDetailsCard, PlayerDisplayCard_default as PlayerDisplayCard, PlayerHighlightsCard, PlayerPageLayout, PlayerPromptCard_default as PlayerPromptCard, PlayerResultCard_default as PlayerResultCard, PlayerTagsCard_default as PlayerTagsCard, PlayerTagsEdit_default as PlayerTagsEdit, PlayersScrollableList_default as PlayersScrollableList, ResultsContainer_default as ResultsContainer, ScrollableResultsList_default as ScrollableResultsList, SearchPageLayout, SearchResultCard_default as SearchResultCard, SortOptions_default as SortOptions, TableActionsBar, TablePageLayout_default as TablePageLayout, TableResultCard_default as TableResultCard, TablesScrollableList_default as TablesScrollableList, TagEditor, TagsFilter_default as TagsFilter, TextSearchCard_default as TextSearchCard, TypeFilter_default as TypeFilter, generateTagsDisplay, renderTagsFromIds, useEventEdit, useGameTableContext, useModal };
3407
+ export { AutoResizingTextarea_default as AutoResizingTextarea, BaseSearchResultCard_default as BaseSearchResultCard, CANDIDATE_TIMEZONES, Chip, DMHighlightsCard, DistanceFilter_default as DistanceFilter, EditTableDetailsForm, EventBanner, EventBannerEdit, EventBasicInfo, EventBasicInfoEdit, EventEditProvider, EventPageLayout, EventResultCard_default as EventResultCard, EventTablesCard_default as EventTablesCard, ExpiredTablesFilter_default as ExpiredTablesFilter, FiltersContainer_default as FiltersContainer, GameTableProvider, ModalContext, ModalProvider_default as ModalProvider, NextGameCountdown, NextGameLabel_default as NextGameLabel, PlayerDetailsCard_default as PlayerDetailsCard, PlayerDisplayCard_default as PlayerDisplayCard, PlayerHighlightsCard, PlayerPageLayout, PlayerPromptCard_default as PlayerPromptCard, PlayerResultCard_default as PlayerResultCard, PlayerTagsCard_default as PlayerTagsCard, PlayerTagsEdit_default as PlayerTagsEdit, PlayersScrollableList_default as PlayersScrollableList, ResultsContainer_default as ResultsContainer, ScrollableResultsList_default as ScrollableResultsList, SearchPageLayout, SearchResultCard_default as SearchResultCard, SortOptions_default as SortOptions, TableActionsBar, TablePageLayout_default as TablePageLayout, TableResultCard_default as TableResultCard, TablesScrollableList_default as TablesScrollableList, TagEditor, TagSelector, TagsFilter_default as TagsFilter, TextSearchCard_default as TextSearchCard, TypeFilter_default as TypeFilter, UserAgreementModal_default as UserAgreementModal, generateTagsDisplay, getRandomTagline, getRandomTitle, renderTagsFromIds, useEventEdit, useGameTableContext, useModal };
2959
3408
  //# sourceMappingURL=index.mjs.map
2960
3409
  //# sourceMappingURL=index.mjs.map