@articles-media/articles-dev-box 1.0.31 → 1.0.32

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 (51) hide show
  1. package/README.md +11 -3
  2. package/dist/Ad-BsG4C_lR.js +668 -0
  3. package/dist/Ad.js +2 -2
  4. package/dist/AdConfirmExitModal-heFPJNdX.js +55 -0
  5. package/dist/AdDetailsModal-D2-4lh9e.js +107 -0
  6. package/dist/ArticlesAd.js +15 -10
  7. package/dist/Button-DvEZjsVV.js +32 -0
  8. package/dist/CreditsModal.js +51 -35
  9. package/dist/DarkModeHandler.js +21 -13
  10. package/dist/FriendsList.js +49 -47
  11. package/dist/GameMenu-BD1HSDJ-.js +84 -0
  12. package/dist/GameMenu.js +2 -0
  13. package/dist/GameScoreboard-DVoXXDnM.js +174 -0
  14. package/dist/GameScoreboard.js +2 -2
  15. package/dist/GlobalBody.js +58 -23
  16. package/dist/GlobalHead.js +5 -5
  17. package/dist/Link-CguWJy6y.js +16 -0
  18. package/dist/ReturnToLauncherButton.js +26 -22
  19. package/dist/SessionButton.js +62 -38
  20. package/dist/SettingsModal-yU_TsVYh.js +430 -0
  21. package/dist/SettingsModal.js +2 -2
  22. package/dist/SignInButton.js +21 -17
  23. package/dist/SocketServerUrlHandler.js +14 -10
  24. package/dist/StatusModal-BXRbJQ10.js +84 -0
  25. package/dist/ToontownModeHandler.js +13 -10
  26. package/dist/ViewUserModal-Dgo1C4sR.js +1798 -0
  27. package/dist/ViewUserModal.js +2 -2
  28. package/dist/articles-dev-box.css +498 -2
  29. package/dist/classnames-No-mjhw1.js +66 -0
  30. package/dist/index.js +23 -22
  31. package/dist/numberWithCommas-B0B9bjWC.js +2198 -0
  32. package/dist/typicalZustandStoreExcludes.js +4 -3
  33. package/dist/typicalZustandStoreStateSlice.js +53 -49
  34. package/dist/useAuthSiteStatus-ZK1GbPBV.js +34 -0
  35. package/dist/useFullscreen.js +38 -18
  36. package/dist/useUserDetails.js +17 -16
  37. package/dist/useUserFriends.js +23 -21
  38. package/dist/useUserToken.js +12 -11
  39. package/package.json +2 -1
  40. package/dist/Ad-CFuDgQYL.js +0 -504
  41. package/dist/AdConfirmExitModal-skW9lp88.js +0 -55
  42. package/dist/AdDetailsModal-CdTR2Y9l.js +0 -107
  43. package/dist/Button-sSB4xpOw.js +0 -31
  44. package/dist/GameScoreboard-9GYlLx72.js +0 -165
  45. package/dist/Link-8nSDV4sI.js +0 -16
  46. package/dist/SettingsModal-CiLvMoLW.js +0 -303
  47. package/dist/StatusModal-PG3i9NKf.js +0 -75
  48. package/dist/ViewUserModal-C5gjfuJ5.js +0 -1549
  49. package/dist/classnames-DCsil9eG.js +0 -39
  50. package/dist/numberWithCommas-DSRplpBy.js +0 -1170
  51. package/dist/useAuthSiteStatus-Cj9IjMj7.js +0 -29
@@ -0,0 +1,430 @@
1
+ import { t as ArticlesButton } from "./Button-DvEZjsVV.js";
2
+ import { useState } from "react";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { Form, Modal } from "react-bootstrap";
5
+ //#region src/components/Games/Settings/GraphicsTab.jsx
6
+ function GraphicsTab({ useStore, config }) {
7
+ const darkMode = useStore((state) => state?.darkMode);
8
+ const setDarkMode = useStore((state) => state?.setDarkMode);
9
+ const graphicsQuality = useStore((state) => state?.graphicsQuality);
10
+ const setGraphicsQuality = useStore((state) => state?.setGraphicsQuality);
11
+ const landingAnimation = useStore((state) => state?.landingAnimation);
12
+ const setLandingAnimation = useStore((state) => state?.setLandingAnimation);
13
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
14
+ /* @__PURE__ */ jsx("div", { children: "Dark Mode" }),
15
+ /* @__PURE__ */ jsx("div", {
16
+ className: "mb-3",
17
+ children: [false, true].map((level, i) => /* @__PURE__ */ jsx(ArticlesButton, {
18
+ active: darkMode === level,
19
+ onClick: () => {
20
+ setDarkMode(level);
21
+ },
22
+ children: level ? "On" : "Off"
23
+ }, i))
24
+ }),
25
+ /* @__PURE__ */ jsx("div", { children: "Graphics Quality" }),
26
+ /* @__PURE__ */ jsx("div", {
27
+ className: "mb-3",
28
+ children: [
29
+ "Low",
30
+ "Medium",
31
+ "High"
32
+ ].map((level) => /* @__PURE__ */ jsx(ArticlesButton, {
33
+ active: graphicsQuality === level,
34
+ onClick: () => {
35
+ setGraphicsQuality(level);
36
+ },
37
+ children: level
38
+ }, level))
39
+ }),
40
+ /* @__PURE__ */ jsx("div", { children: "Landing Animation" }),
41
+ /* @__PURE__ */ jsxs("div", {
42
+ className: "mb-3",
43
+ children: [/* @__PURE__ */ jsx(ArticlesButton, {
44
+ active: landingAnimation === false,
45
+ onClick: () => {
46
+ setLandingAnimation(false);
47
+ },
48
+ children: "Disabled"
49
+ }), /* @__PURE__ */ jsx(ArticlesButton, {
50
+ active: landingAnimation === true,
51
+ onClick: () => {
52
+ setLandingAnimation(true);
53
+ },
54
+ children: "Enabled"
55
+ })]
56
+ }),
57
+ config?.tabs?.Graphics?.children
58
+ ] });
59
+ }
60
+ //#endregion
61
+ //#region src/components/Games/Settings/AudioTab.jsx
62
+ function AudioTab({ useAudioStore, config }) {
63
+ const audioSettings = useAudioStore((state) => state?.audioSettings);
64
+ const setAudioSettings = useAudioStore((state) => state?.setAudioSettings);
65
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
66
+ /* @__PURE__ */ jsx("div", { children: "Sound" }),
67
+ /* @__PURE__ */ jsxs("div", {
68
+ className: "mb-3",
69
+ children: [/* @__PURE__ */ jsx(ArticlesButton, {
70
+ active: !audioSettings?.enabled,
71
+ onClick: () => {
72
+ setAudioSettings({
73
+ ...audioSettings,
74
+ enabled: false
75
+ });
76
+ },
77
+ children: "Disabled"
78
+ }), /* @__PURE__ */ jsx(ArticlesButton, {
79
+ active: audioSettings?.enabled,
80
+ onClick: () => {
81
+ setAudioSettings({
82
+ ...audioSettings,
83
+ enabled: true
84
+ });
85
+ },
86
+ children: "Enabled"
87
+ })]
88
+ }),
89
+ /* @__PURE__ */ jsx("div", {
90
+ className: "border mb-3 p-2",
91
+ children: config?.tabs?.Audio?.sliders?.map((slider_obj) => {
92
+ return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Form.Label, {
93
+ className: "mb-0",
94
+ children: slider_obj.label
95
+ }), /* @__PURE__ */ jsx(Form.Range, {
96
+ value: audioSettings?.[slider_obj.key],
97
+ onChange: (value) => {
98
+ setAudioSettings({
99
+ ...audioSettings,
100
+ [slider_obj.key]: value.target.value
101
+ });
102
+ }
103
+ })] }, slider_obj.key);
104
+ })
105
+ }),
106
+ config?.tabs?.Controls?.children
107
+ ] });
108
+ }
109
+ //#endregion
110
+ //#region src/components/Games/Settings/MultiplayerTab.jsx
111
+ function MultiplayerTab({ useStore, config }) {
112
+ return /* @__PURE__ */ jsxs("div", {
113
+ className: "",
114
+ children: [useStore && /* @__PURE__ */ jsx(SocketSettings, { useStore }), config?.tabs?.Multiplayer?.children]
115
+ });
116
+ }
117
+ function SocketSettings({ useStore }) {
118
+ const serverUrl = useStore((state) => state.serverUrl);
119
+ const setServerUrl = useStore((state) => state.setServerUrl);
120
+ const connected = useStore((state) => state.connected);
121
+ const connectSocket = useStore((state) => state.connectSocket);
122
+ const disconnectSocket = useStore((state) => state.disconnectSocket);
123
+ return /* @__PURE__ */ jsxs("div", {
124
+ className: "mb-3",
125
+ children: [
126
+ /* @__PURE__ */ jsxs(Form.Label, {
127
+ className: "mb-0",
128
+ children: [/* @__PURE__ */ jsxs("div", { children: ["Status: ", /* @__PURE__ */ jsx("span", {
129
+ className: `badge ${connected ? "bg-success" : "bg-danger"}`,
130
+ children: connected ? "Online" : "Offline"
131
+ })] }), "Socket Server Host"]
132
+ }),
133
+ /* @__PURE__ */ jsx(Form.Control, {
134
+ type: "text",
135
+ value: serverUrl,
136
+ onChange: (e) => setServerUrl(e.target.value)
137
+ }),
138
+ /* @__PURE__ */ jsx(Form.Label, {
139
+ className: "mb-0",
140
+ children: "Edit this to connect to a different multiplayer host!"
141
+ }),
142
+ /* @__PURE__ */ jsx("div", {
143
+ className: "mt-3",
144
+ children: connected ? /* @__PURE__ */ jsx(ArticlesButton, {
145
+ className: "",
146
+ onClick: () => {
147
+ disconnectSocket();
148
+ },
149
+ children: "Disconnect"
150
+ }) : /* @__PURE__ */ jsx(ArticlesButton, {
151
+ className: "",
152
+ onClick: () => {
153
+ connectSocket();
154
+ },
155
+ children: "Connect"
156
+ })
157
+ })
158
+ ]
159
+ });
160
+ }
161
+ //#endregion
162
+ //#region src/components/Games/Settings/ControlsTab.jsx
163
+ function ControlsTab({ useTouchControlsStore, config }) {
164
+ return /* @__PURE__ */ jsxs("div", {
165
+ className: "",
166
+ children: [useTouchControlsStore && /* @__PURE__ */ jsx(TouchControls, { useTouchControlsStore }), config?.tabs?.Controls?.children]
167
+ });
168
+ }
169
+ function TouchControls({ useTouchControlsStore }) {
170
+ const enabled = useTouchControlsStore((state) => state?.enabled);
171
+ const setEnabled = useTouchControlsStore((state) => state?.setEnabled);
172
+ return /* @__PURE__ */ jsxs("div", {
173
+ className: "mb-3",
174
+ children: [
175
+ /* @__PURE__ */ jsx("div", { children: "Touch Controls" }),
176
+ /* @__PURE__ */ jsx("div", {
177
+ className: "small mb-1",
178
+ children: "Adds on screen controls for touch devices."
179
+ }),
180
+ /* @__PURE__ */ jsx("div", {
181
+ className: "mb-3",
182
+ children: [false, true].map((level, i) => /* @__PURE__ */ jsx(ArticlesButton, {
183
+ active: enabled === level,
184
+ onClick: () => {
185
+ setEnabled(level);
186
+ },
187
+ children: level ? "On" : "Off"
188
+ }, i))
189
+ })
190
+ ]
191
+ });
192
+ }
193
+ //#endregion
194
+ //#region src/components/Games/Settings/OtherTab.jsx
195
+ function OtherTab({ useStore, config }) {
196
+ const debug = useStore((state) => state?.debug);
197
+ const setDebug = useStore((state) => state?.setDebug);
198
+ const toontownMode = useStore((state) => state?.toontownMode);
199
+ const setToontownMode = useStore((state) => state?.setToontownMode);
200
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
201
+ /* @__PURE__ */ jsx("div", { children: "Debug Mode" }),
202
+ /* @__PURE__ */ jsx("div", {
203
+ className: "mb-3",
204
+ children: [false, true].map((level, i) => /* @__PURE__ */ jsx(ArticlesButton, {
205
+ active: debug === level,
206
+ onClick: () => {
207
+ setDebug(level);
208
+ },
209
+ children: level ? "On" : "Off"
210
+ }, i))
211
+ }),
212
+ config?.tabs?.Other?.toontownMode && /* @__PURE__ */ jsxs(Fragment, { children: [
213
+ /* @__PURE__ */ jsx("div", { children: "Toontown Mode" }),
214
+ /* @__PURE__ */ jsx("div", {
215
+ className: "small mb-1",
216
+ children: "Mimics Toontown Online graphics."
217
+ }),
218
+ /* @__PURE__ */ jsx("div", {
219
+ className: "mb-3",
220
+ children: [false, true].map((level, i) => /* @__PURE__ */ jsx(ArticlesButton, {
221
+ active: toontownMode === level,
222
+ onClick: () => {
223
+ setToontownMode(level);
224
+ },
225
+ children: level ? "On" : "Off"
226
+ }, i))
227
+ })
228
+ ] }),
229
+ config?.tabs?.Other?.children
230
+ ] });
231
+ }
232
+ var package_default = {
233
+ name: "@articles-media/articles-dev-box",
234
+ description: "Shared code, functions, and components for different Articles Media projects.",
235
+ version: "1.0.32",
236
+ type: "module",
237
+ imports: { "#root/src/*": "./src/*" },
238
+ main: "./dist/index.js",
239
+ module: "./dist/index.js",
240
+ files: ["dist"],
241
+ repository: {
242
+ "type": "git",
243
+ "url": "git+https://github.com/Articles-Joey/articles-dev-box.git"
244
+ },
245
+ exports: {
246
+ ".": "./dist/index.js",
247
+ "./Ad": "./dist/Ad.js",
248
+ "./GameMenu": "./dist/GameMenu.js",
249
+ "./ArticlesAd": "./dist/ArticlesAd.js",
250
+ "./GameScoreboard": "./dist/GameScoreboard.js",
251
+ "./ReturnToLauncherButton": "./dist/ReturnToLauncherButton.js",
252
+ "./SignInButton": "./dist/SignInButton.js",
253
+ "./SessionButton": "./dist/SessionButton.js",
254
+ "./GlobalHead": "./dist/GlobalHead.js",
255
+ "./GlobalBody": "./dist/GlobalBody.js",
256
+ "./ViewUserModal": "./dist/ViewUserModal.js",
257
+ "./SettingsModal": "./dist/SettingsModal.js",
258
+ "./CreditsModal": "./dist/CreditsModal.js",
259
+ "./DarkModeHandler": "./dist/DarkModeHandler.js",
260
+ "./ToontownModeHandler": "./dist/ToontownModeHandler.js",
261
+ "./SocketServerUrlHandler": "./dist/SocketServerUrlHandler.js",
262
+ "./FriendsList": "./dist/FriendsList.js",
263
+ "./useUserDetails": "./dist/useUserDetails.js",
264
+ "./useUserToken": "./dist/useUserToken.js",
265
+ "./useUserFriends": "./dist/useUserFriends.js",
266
+ "./useFullscreen": "./dist/useFullscreen.js",
267
+ "./typicalZustandStoreExcludes": "./dist/typicalZustandStoreExcludes.js",
268
+ "./typicalZustandStoreStateSlice": "./dist/typicalZustandStoreStateSlice.js",
269
+ "./dist/style.css": "./dist/articles-dev-box.css",
270
+ "./dist/articles-dev-box.css": "./dist/articles-dev-box.css"
271
+ },
272
+ scripts: {
273
+ "dev-unknown": "vite dev",
274
+ "dev": "nodemon --watch src --ext js,ts,css,scss,jsx,json --ignore dist --exec \"npm run build\"",
275
+ "build": "vite build",
276
+ "preview": "vite preview",
277
+ "test": "echo \"Error: no test specified\" && exit 1"
278
+ },
279
+ keywords: [],
280
+ author: "Articles Media",
281
+ license: "ISC",
282
+ peerDependencies: {
283
+ "react": ">=19.2.3",
284
+ "react-dom": ">=19.2.3",
285
+ "swr": "^2.4.1",
286
+ "date-fns": "^4.0.0",
287
+ "react-intersection-observer": "^10.0.0",
288
+ "react-bootstrap": "^2.0.0"
289
+ },
290
+ devDependencies: {
291
+ "@vitejs/plugin-react": "^6.0.1",
292
+ "classnames": "^2.5.1",
293
+ "nodemon": "^3.1.11",
294
+ "react-bootstrap": "^2.10.10",
295
+ "sass": "^1.97.2",
296
+ "vite": "^8.0.3"
297
+ },
298
+ dependencies: {}
299
+ };
300
+ //#endregion
301
+ //#region src/components/Games/Settings/DebugTab.jsx
302
+ function DebugTab({ useStore, config }) {
303
+ useStore((state) => state?.debug);
304
+ useStore((state) => state?.setDebug);
305
+ useStore((state) => state?.toontownMode);
306
+ useStore((state) => state?.setToontownMode);
307
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
308
+ /* @__PURE__ */ jsxs("div", {
309
+ className: "mb-3",
310
+ children: ["dev-box version: ", package_default.version]
311
+ }),
312
+ /* @__PURE__ */ jsx("div", { children: "Future Thing" }),
313
+ /* @__PURE__ */ jsx("div", {
314
+ className: "mb-3",
315
+ children: [false, true].map((level, i) => /* @__PURE__ */ jsx(ArticlesButton, {
316
+ onClick: () => {},
317
+ children: "Placeholder"
318
+ }, i))
319
+ }),
320
+ config?.tabs?.Debug?.children
321
+ ] });
322
+ }
323
+ //#endregion
324
+ //#region src/components/Games/Settings/SettingsModal.jsx
325
+ function SettingsModal({ show, setShow, store, useAudioStore, useTouchControlsStore, useSocketStore, config }) {
326
+ const [showModal, setShowModal] = useState(false);
327
+ return /* @__PURE__ */ jsx(Modal, {
328
+ className: "articles-modal articles-settings-modal",
329
+ size: "md",
330
+ show,
331
+ centered: true,
332
+ scrollable: true,
333
+ onExited: () => {},
334
+ onHide: () => {
335
+ setShow(false);
336
+ },
337
+ children: store && /* @__PURE__ */ jsx(ModalContent, {
338
+ useStore: store,
339
+ useAudioStore,
340
+ useTouchControlsStore,
341
+ useSocketStore,
342
+ config
343
+ })
344
+ });
345
+ }
346
+ function ModalContent({ useStore, useAudioStore, useTouchControlsStore, useSocketStore, config }) {
347
+ const [tab, setTab] = useState(localStorage.getItem("articles_settings_tab") || "Graphics");
348
+ const handleTabChange = (newTab) => {
349
+ setTab(newTab);
350
+ localStorage.setItem("articles_settings_tab", newTab);
351
+ };
352
+ const debug = useStore((state) => state.debug);
353
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
354
+ /* @__PURE__ */ jsx(Modal.Header, {
355
+ closeButton: true,
356
+ children: /* @__PURE__ */ jsx(Modal.Title, { children: "Game Settings" })
357
+ }),
358
+ /* @__PURE__ */ jsxs(Modal.Body, {
359
+ className: "flex-column p-0",
360
+ children: [
361
+ /* @__PURE__ */ jsx("div", {
362
+ className: "p-2",
363
+ children: [
364
+ "Graphics",
365
+ "Controls",
366
+ "Audio",
367
+ "Multiplayer",
368
+ "Other",
369
+ ...debug ? ["Debug"] : []
370
+ ].map((item) => /* @__PURE__ */ jsx(ArticlesButton, {
371
+ active: tab == item,
372
+ onClick: () => {
373
+ handleTabChange(item);
374
+ },
375
+ children: item
376
+ }, item))
377
+ }),
378
+ /* @__PURE__ */ jsx("hr", { className: "my-0" }),
379
+ /* @__PURE__ */ jsxs("div", {
380
+ className: "p-3",
381
+ children: [
382
+ tab == "Controls" && /* @__PURE__ */ jsx(ControlsTab, {
383
+ useStore,
384
+ useTouchControlsStore,
385
+ config
386
+ }),
387
+ tab == "Graphics" && /* @__PURE__ */ jsx(GraphicsTab, {
388
+ useStore,
389
+ config
390
+ }),
391
+ tab == "Audio" && /* @__PURE__ */ jsx(AudioTab, {
392
+ useAudioStore,
393
+ config
394
+ }),
395
+ tab == "Multiplayer" && /* @__PURE__ */ jsx(MultiplayerTab, {
396
+ useStore: useSocketStore,
397
+ config
398
+ }),
399
+ tab == "Other" && /* @__PURE__ */ jsx(OtherTab, {
400
+ useStore,
401
+ config
402
+ }),
403
+ tab == "Debug" && /* @__PURE__ */ jsx(DebugTab, {
404
+ useStore,
405
+ config
406
+ })
407
+ ]
408
+ })
409
+ ]
410
+ }),
411
+ /* @__PURE__ */ jsx(Modal.Footer, {
412
+ className: "justify-content-between",
413
+ children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(ArticlesButton, {
414
+ variant: "outline-dark",
415
+ onClick: () => {
416
+ setShow(false);
417
+ },
418
+ children: "Close"
419
+ }), /* @__PURE__ */ jsx(ArticlesButton, {
420
+ variant: "outline-danger ms-3",
421
+ onClick: () => {
422
+ reset();
423
+ },
424
+ children: "Reset"
425
+ })] })
426
+ })
427
+ ] });
428
+ }
429
+ //#endregion
430
+ export { SettingsModal as t };
@@ -1,2 +1,2 @@
1
- import { t as e } from "./SettingsModal-CiLvMoLW.js";
2
- export { e as default };
1
+ import { t as SettingsModal } from "./SettingsModal-yU_TsVYh.js";
2
+ export { SettingsModal as default };
@@ -1,29 +1,33 @@
1
1
  "use client";
2
- import { t as e } from "./Button-sSB4xpOw.js";
3
- import { useEffect as t, useState as n } from "react";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { t as ArticlesButton } from "./Button-DvEZjsVV.js";
3
+ import { useEffect, useState } from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/components/User/SignInButton.jsx
6
- function a({ className: a, id: o, text: s }) {
7
- let [c, l] = n(!1), u = process.env.NODE_ENV === "development" ? "http://localhost:3012" : "https://accounts.articles.media", [d, f] = n(`${u}/login`);
8
- return t(() => {
9
- l(!0);
10
- let e = window.location.pathname, t = window.location.search;
11
- f(`${u}/login?redirect=${encodeURIComponent(window.location.origin + e + t)}&type=subdomain`);
12
- }, [u]), /* @__PURE__ */ r("a", {
13
- href: d,
6
+ function SignInButton({ className, id, text }) {
7
+ const [isMounted, setIsMounted] = useState(false);
8
+ const baseLink = process.env.NODE_ENV === "development" ? "http://localhost:3012" : "https://accounts.articles.media";
9
+ const [finalLink, setFinalLink] = useState(`${baseLink}/login`);
10
+ useEffect(() => {
11
+ setIsMounted(true);
12
+ const currentPath = window.location.pathname;
13
+ const searchParams = window.location.search;
14
+ setFinalLink(`${baseLink}/login?redirect=${encodeURIComponent(window.location.origin + currentPath + searchParams)}&type=subdomain`);
15
+ }, [baseLink]);
16
+ return /* @__PURE__ */ jsx("a", {
17
+ href: finalLink,
14
18
  rel: "noopener noreferrer",
15
- children: /* @__PURE__ */ i(e, {
16
- className: `${a} w-100`,
17
- id: o,
18
- small: !0,
19
+ children: /* @__PURE__ */ jsxs(ArticlesButton, {
20
+ className: `${className} w-100`,
21
+ id,
22
+ small: true,
19
23
  style: {
20
24
  zIndex: 10,
21
25
  position: "relative"
22
26
  },
23
27
  onClick: () => {},
24
- children: [/* @__PURE__ */ r("i", { className: "fad fa-user" }), s || "Sign In"]
28
+ children: [/* @__PURE__ */ jsx("i", { className: "fad fa-user" }), text || "Sign In"]
25
29
  })
26
30
  });
27
31
  }
28
32
  //#endregion
29
- export { a as default };
33
+ export { SignInButton as default };
@@ -1,14 +1,18 @@
1
- import { useEffect as e } from "react";
1
+ import { useEffect } from "react";
2
2
  //#region src/components/Games/SocketServerUrlHandler.jsx
3
- function t({ useStore: t }) {
4
- return e(() => {
5
- let e = t.getState()?.setSocketServerUrl, n = new URLSearchParams(window.location.search), r = n.get("socketServerUrl");
6
- if (r) {
7
- e(r), n.delete("socketServerUrl");
8
- let t = window.location.pathname + (n.toString() ? `?${n.toString()}` : "") + window.location.hash;
9
- window.history.replaceState({}, "", t);
3
+ function SocketServerUrlHandler({ useStore }) {
4
+ useEffect(() => {
5
+ const setSocketServerUrl = useStore.getState()?.setSocketServerUrl;
6
+ const urlParams = new URLSearchParams(window.location.search);
7
+ const socketServerUrlParam = urlParams.get("socketServerUrl");
8
+ if (socketServerUrlParam) {
9
+ setSocketServerUrl(socketServerUrlParam);
10
+ urlParams.delete("socketServerUrl");
11
+ const newUrl = window.location.pathname + (urlParams.toString() ? `?${urlParams.toString()}` : "") + window.location.hash;
12
+ window.history.replaceState({}, "", newUrl);
10
13
  }
11
- }, []), null;
14
+ }, []);
15
+ return null;
12
16
  }
13
17
  //#endregion
14
- export { t as default };
18
+ export { SocketServerUrlHandler as default };
@@ -0,0 +1,84 @@
1
+ import { t as ArticlesButton } from "./Button-DvEZjsVV.js";
2
+ import { n as useMainSiteStatus, t as useAuthSiteStatus } from "./useAuthSiteStatus-ZK1GbPBV.js";
3
+ import { useState } from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Modal } from "react-bootstrap";
6
+ //#region src/components/Global/StatusModal.jsx
7
+ function StatusModal({ show, setShow }) {
8
+ const [showMainDetails, setShowMainDetails] = useState(false);
9
+ const [showAuthDetails, setShowAuthDetails] = useState(false);
10
+ const getStatusCode = (data, error, loading) => {
11
+ if (loading) return "...";
12
+ if (error) return error.response?.status || "Error";
13
+ if (data) return "200";
14
+ return "-";
15
+ };
16
+ const { data: mainSiteStatus, error: mainSiteStatusError, isLoading: mainSiteStatusLoading, mutate: mainSiteStatusMutate } = useMainSiteStatus({ disable: process.env.NODE_ENV !== "development" });
17
+ const { data: authSiteStatus, error: authSiteStatusError, isLoading: authSiteStatusLoading, mutate: authSiteStatusMutate } = useAuthSiteStatus({ disable: process.env.NODE_ENV !== "development" });
18
+ return /* @__PURE__ */ jsxs(Modal, {
19
+ show,
20
+ size: "md",
21
+ className: "articles-modal",
22
+ centered: true,
23
+ onHide: () => setShow(false),
24
+ children: [
25
+ /* @__PURE__ */ jsx(Modal.Header, { children: /* @__PURE__ */ jsx(Modal.Title, { children: "Status Details" }) }),
26
+ /* @__PURE__ */ jsxs(Modal.Body, { children: [
27
+ /* @__PURE__ */ jsxs("div", {
28
+ className: "d-flex align-items-center mb-2",
29
+ children: [/* @__PURE__ */ jsxs("h5", {
30
+ className: "mb-0 me-2",
31
+ children: ["Main Site Status: ", /* @__PURE__ */ jsx("span", {
32
+ className: `badge ${mainSiteStatus ? "bg-success" : "bg-danger"}`,
33
+ children: getStatusCode(mainSiteStatus, mainSiteStatusError, mainSiteStatusLoading)
34
+ })]
35
+ }), /* @__PURE__ */ jsxs(ArticlesButton, {
36
+ variant: "link",
37
+ size: "sm",
38
+ className: "p-0",
39
+ onClick: () => setShowMainDetails(!showMainDetails),
40
+ children: [showMainDetails ? "Hide" : "View", " More"]
41
+ })]
42
+ }),
43
+ showMainDetails && /* @__PURE__ */ jsxs("pre", { children: [
44
+ mainSiteStatusLoading && "Loading...",
45
+ mainSiteStatusError && `Error: ${mainSiteStatusError.message}`,
46
+ mainSiteStatus && JSON.stringify(mainSiteStatus, null, 2)
47
+ ] }),
48
+ /* @__PURE__ */ jsxs("div", {
49
+ className: "d-flex align-items-center mb-2",
50
+ children: [/* @__PURE__ */ jsxs("h5", {
51
+ className: "mb-0 me-2",
52
+ children: ["Auth Site Status: ", /* @__PURE__ */ jsx("span", {
53
+ className: `badge ${authSiteStatus ? "bg-success" : "bg-danger"}`,
54
+ children: getStatusCode(authSiteStatus, authSiteStatusError, authSiteStatusLoading)
55
+ })]
56
+ }), /* @__PURE__ */ jsxs(ArticlesButton, {
57
+ variant: "link",
58
+ size: "sm",
59
+ className: "p-0",
60
+ onClick: () => setShowAuthDetails(!showAuthDetails),
61
+ children: [showAuthDetails ? "Hide" : "View", " More"]
62
+ })]
63
+ }),
64
+ showAuthDetails && /* @__PURE__ */ jsxs("pre", { children: [
65
+ authSiteStatusLoading && "Loading...",
66
+ authSiteStatusError && `Error: ${authSiteStatusError.message}`,
67
+ authSiteStatus && JSON.stringify(authSiteStatus, null, 2)
68
+ ] })
69
+ ] }),
70
+ /* @__PURE__ */ jsx(Modal.Footer, {
71
+ className: "justify-content-between",
72
+ children: /* @__PURE__ */ jsx(ArticlesButton, {
73
+ variant: "articles",
74
+ onClick: () => {
75
+ setShow(false);
76
+ },
77
+ children: "Close"
78
+ })
79
+ })
80
+ ]
81
+ });
82
+ }
83
+ //#endregion
84
+ export { StatusModal as default };
@@ -1,14 +1,17 @@
1
- import { useEffect as e } from "react";
1
+ import { useEffect } from "react";
2
2
  //#region src/components/Games/ToontownModeHandler.jsx
3
- function t({ useStore: t }) {
4
- return e(() => {
5
- let e = t.getState()?.setToontownMode, n = new URLSearchParams(window.location.search);
6
- if (n.get("toontownMode")) {
7
- e(!0), n.delete("toontownMode");
8
- let t = window.location.pathname + (n.toString() ? `?${n.toString()}` : "") + window.location.hash;
9
- window.history.replaceState({}, "", t);
3
+ function ToontownModeHandler({ useStore }) {
4
+ useEffect(() => {
5
+ const setToontownMode = useStore.getState()?.setToontownMode;
6
+ const urlParams = new URLSearchParams(window.location.search);
7
+ if (urlParams.get("toontownMode")) {
8
+ setToontownMode(true);
9
+ urlParams.delete("toontownMode");
10
+ const newUrl = window.location.pathname + (urlParams.toString() ? `?${urlParams.toString()}` : "") + window.location.hash;
11
+ window.history.replaceState({}, "", newUrl);
10
12
  }
11
- }, []), null;
13
+ }, []);
14
+ return null;
12
15
  }
13
16
  //#endregion
14
- export { t as default };
17
+ export { ToontownModeHandler as default };