astrogators-shared-ui 0.4.4 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,791 +1,805 @@
1
- var ue = Object.defineProperty;
2
- var he = (e, s, t) => s in e ? ue(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
3
- var R = (e, s, t) => he(e, typeof s != "symbol" ? s + "" : s, t);
4
- import { jsx as r, jsxs as m, Fragment as ge } from "react/jsx-runtime";
5
- import ae, { createContext as fe, useState as b, useEffect as j, useCallback as S, useContext as pe } from "react";
6
- const ye = "_container_u3o0e_1", ve = "_padding_u3o0e_7", X = {
7
- container: ye,
8
- padding: ve,
1
+ var ye = Object.defineProperty;
2
+ var pe = (e, t, s) => t in e ? ye(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
+ var j = (e, t, s) => pe(e, typeof t != "symbol" ? t + "" : t, s);
4
+ import { jsx as a, jsxs as m, Fragment as ve } from "react/jsx-runtime";
5
+ import le, { createContext as be, useState as b, useEffect as I, useCallback as S, useContext as $e } from "react";
6
+ const we = "_container_u3o0e_1", Ne = "_padding_u3o0e_7", ee = {
7
+ container: we,
8
+ padding: Ne,
9
9
  "maxWidth-sm": "_maxWidth-sm_u3o0e_12",
10
10
  "maxWidth-md": "_maxWidth-md_u3o0e_16",
11
11
  "maxWidth-lg": "_maxWidth-lg_u3o0e_20",
12
12
  "maxWidth-xl": "_maxWidth-xl_u3o0e_24",
13
13
  "maxWidth-full": "_maxWidth-full_u3o0e_28"
14
- }, vs = ({
14
+ }, Ns = ({
15
15
  children: e,
16
- maxWidth: s = "xl",
17
- padding: t = !0,
16
+ maxWidth: t = "xl",
17
+ padding: s = !0,
18
18
  className: o = "",
19
- style: d
20
- }) => /* @__PURE__ */ r(
19
+ style: c
20
+ }) => /* @__PURE__ */ a(
21
21
  "div",
22
22
  {
23
- className: `${X.container} ${X[`maxWidth-${s}`]} ${t ? X.padding : ""} ${o}`,
24
- style: d,
23
+ className: `${ee.container} ${ee[`maxWidth-${t}`]} ${s ? ee.padding : ""} ${o}`,
24
+ style: c,
25
25
  children: e
26
26
  }
27
- ), $e = "_topBar_10g3c_1", be = "_content_10g3c_13", we = "_left_10g3c_23", Ne = "_right_10g3c_30", Ae = "_logo_10g3c_36", P = {
28
- topBar: $e,
29
- content: be,
30
- left: we,
31
- right: Ne,
32
- logo: Ae
33
- }, $s = ({
27
+ ), Ae = "_topBar_10g3c_1", Se = "_content_10g3c_13", xe = "_left_10g3c_23", Te = "_right_10g3c_30", Ce = "_logo_10g3c_36", B = {
28
+ topBar: Ae,
29
+ content: Se,
30
+ left: xe,
31
+ right: Te,
32
+ logo: Ce
33
+ }, As = ({
34
34
  logo: e,
35
- leftContent: s,
36
- rightContent: t,
35
+ leftContent: t,
36
+ rightContent: s,
37
37
  className: o = ""
38
- }) => /* @__PURE__ */ r("header", { className: `${P.topBar} ${o}`, children: /* @__PURE__ */ m("div", { className: P.content, children: [
39
- /* @__PURE__ */ m("div", { className: P.left, children: [
40
- e && /* @__PURE__ */ r("div", { className: P.logo, children: e }),
41
- s
38
+ }) => /* @__PURE__ */ a("header", { className: `${B.topBar} ${o}`, children: /* @__PURE__ */ m("div", { className: B.content, children: [
39
+ /* @__PURE__ */ m("div", { className: B.left, children: [
40
+ e && /* @__PURE__ */ a("div", { className: B.logo, children: e }),
41
+ t
42
42
  ] }),
43
- /* @__PURE__ */ r("div", { className: P.right, children: t })
44
- ] }) }), Se = "_footer_zjuj8_1", xe = "_content_zjuj8_7", Te = "_defaultContent_zjuj8_13", Ce = "_copyright_zjuj8_21", ke = "_disclaimer_zjuj8_26", B = {
45
- footer: Se,
46
- content: xe,
47
- defaultContent: Te,
48
- copyright: Ce,
49
- disclaimer: ke
50
- }, bs = ({ children: e, className: s = "" }) => /* @__PURE__ */ r("footer", { className: `${B.footer} ${s}`, children: /* @__PURE__ */ r("div", { className: B.content, children: e || /* @__PURE__ */ m("div", { className: B.defaultContent, children: [
51
- /* @__PURE__ */ m("p", { className: B.copyright, children: [
43
+ /* @__PURE__ */ a("div", { className: B.right, children: s })
44
+ ] }) }), ke = "_footer_zjuj8_1", Ee = "_content_zjuj8_7", Le = "_defaultContent_zjuj8_13", We = "_copyright_zjuj8_21", Ie = "_disclaimer_zjuj8_26", U = {
45
+ footer: ke,
46
+ content: Ee,
47
+ defaultContent: Le,
48
+ copyright: We,
49
+ disclaimer: Ie
50
+ }, Ss = ({ children: e, className: t = "" }) => /* @__PURE__ */ a("footer", { className: `${U.footer} ${t}`, children: /* @__PURE__ */ a("div", { className: U.content, children: e || /* @__PURE__ */ m("div", { className: U.defaultContent, children: [
51
+ /* @__PURE__ */ m("p", { className: U.copyright, children: [
52
52
  "© ",
53
53
  (/* @__PURE__ */ new Date()).getFullYear(),
54
54
  " The Astrogator's Table. All rights reserved."
55
55
  ] }),
56
- /* @__PURE__ */ r("p", { className: B.disclaimer, children: "Star Wars: Galaxy of Heroes is a trademark of Electronic Arts Inc." })
57
- ] }) }) }), Ee = "_button_159ms_1", We = "_sm_159ms_22", Ie = "_md_159ms_28", Le = "_lg_159ms_34", qe = "_primary_159ms_41", Re = "_secondary_159ms_55", Pe = "_outline_159ms_69", Be = "_ghost_159ms_80", Ue = "_danger_159ms_89", je = "_fullWidth_159ms_100", Fe = "_loading_159ms_105", De = "_loadingSpinner_159ms_110", Oe = "_spinner_159ms_116", ze = "_spin_159ms_116", Me = "_loadingText_159ms_131", x = {
58
- button: Ee,
59
- sm: We,
60
- md: Ie,
61
- lg: Le,
62
- primary: qe,
63
- secondary: Re,
64
- outline: Pe,
65
- ghost: Be,
66
- danger: Ue,
67
- fullWidth: je,
68
- loading: Fe,
69
- loadingSpinner: De,
70
- spinner: Oe,
71
- spin: ze,
72
- loadingText: Me
73
- }, M = ({
56
+ /* @__PURE__ */ a("p", { className: U.disclaimer, children: "Star Wars: Galaxy of Heroes is a trademark of Electronic Arts Inc." })
57
+ ] }) }) }), qe = "_button_159ms_1", Re = "_sm_159ms_22", Fe = "_md_159ms_28", Pe = "_lg_159ms_34", je = "_primary_159ms_41", Be = "_secondary_159ms_55", Ue = "_outline_159ms_69", De = "_ghost_159ms_80", Oe = "_danger_159ms_89", ze = "_fullWidth_159ms_100", Me = "_loading_159ms_105", Je = "_loadingSpinner_159ms_110", He = "_spinner_159ms_116", Ye = "_spin_159ms_116", Ge = "_loadingText_159ms_131", x = {
58
+ button: qe,
59
+ sm: Re,
60
+ md: Fe,
61
+ lg: Pe,
62
+ primary: je,
63
+ secondary: Be,
64
+ outline: Ue,
65
+ ghost: De,
66
+ danger: Oe,
67
+ fullWidth: ze,
68
+ loading: Me,
69
+ loadingSpinner: Je,
70
+ spinner: He,
71
+ spin: Ye,
72
+ loadingText: Ge
73
+ }, H = ({
74
74
  children: e,
75
- variant: s = "primary",
76
- size: t = "md",
75
+ variant: t = "primary",
76
+ size: s = "md",
77
77
  fullWidth: o = !1,
78
- loading: d = !1,
78
+ loading: c = !1,
79
79
  disabled: g = !1,
80
- className: c = "",
81
- ...l
82
- }) => /* @__PURE__ */ r(
80
+ className: i = "",
81
+ ...d
82
+ }) => /* @__PURE__ */ a(
83
83
  "button",
84
84
  {
85
- className: `${x.button} ${x[s]} ${x[t]} ${o ? x.fullWidth : ""} ${d ? x.loading : ""} ${c}`,
86
- disabled: g || d,
87
- ...l,
88
- children: d ? /* @__PURE__ */ m("span", { className: x.loadingSpinner, children: [
89
- /* @__PURE__ */ r("span", { className: x.spinner }),
90
- /* @__PURE__ */ r("span", { className: x.loadingText, children: e })
85
+ className: `${x.button} ${x[t]} ${x[s]} ${o ? x.fullWidth : ""} ${c ? x.loading : ""} ${i}`,
86
+ disabled: g || c,
87
+ ...d,
88
+ children: c ? /* @__PURE__ */ m("span", { className: x.loadingSpinner, children: [
89
+ /* @__PURE__ */ a("span", { className: x.spinner }),
90
+ /* @__PURE__ */ a("span", { className: x.loadingText, children: e })
91
91
  ] }) : e
92
92
  }
93
- ), Je = "_inputWrapper_15t4g_1", He = "_fullWidth_15t4g_7", Ye = "_label_15t4g_11", Ge = "_required_15t4g_20", Ke = "_input_15t4g_1", Ve = "_error_15t4g_55", Qe = "_errorText_15t4g_63", Xe = "_helperText_15t4g_68", T = {
94
- inputWrapper: Je,
95
- fullWidth: He,
96
- label: Ye,
97
- required: Ge,
98
- input: Ke,
99
- error: Ve,
100
- errorText: Qe,
101
- helperText: Xe
102
- }, ne = ae.forwardRef(
93
+ ), Ke = "_inputWrapper_15t4g_1", Ve = "_fullWidth_15t4g_7", Qe = "_label_15t4g_11", Xe = "_required_15t4g_20", Ze = "_input_15t4g_1", et = "_error_15t4g_55", tt = "_errorText_15t4g_63", st = "_helperText_15t4g_68", T = {
94
+ inputWrapper: Ke,
95
+ fullWidth: Ve,
96
+ label: Qe,
97
+ required: Xe,
98
+ input: Ze,
99
+ error: et,
100
+ errorText: tt,
101
+ helperText: st
102
+ }, ce = le.forwardRef(
103
103
  ({
104
104
  label: e,
105
- error: s,
106
- helperText: t,
105
+ error: t,
106
+ helperText: s,
107
107
  fullWidth: o = !1,
108
- className: d = "",
108
+ className: c = "",
109
109
  id: g,
110
- ...c
111
- }, l) => {
112
- const i = g || `input-${Math.random().toString(36).substr(2, 9)}`, h = !!s;
113
- return /* @__PURE__ */ m("div", { className: `${T.inputWrapper} ${o ? T.fullWidth : ""} ${d}`, children: [
114
- e && /* @__PURE__ */ m("label", { htmlFor: i, className: T.label, children: [
110
+ ...i
111
+ }, d) => {
112
+ const l = g || `input-${Math.random().toString(36).substr(2, 9)}`, f = !!t;
113
+ return /* @__PURE__ */ m("div", { className: `${T.inputWrapper} ${o ? T.fullWidth : ""} ${c}`, children: [
114
+ e && /* @__PURE__ */ m("label", { htmlFor: l, className: T.label, children: [
115
115
  e,
116
- c.required && /* @__PURE__ */ r("span", { className: T.required, children: "*" })
116
+ i.required && /* @__PURE__ */ a("span", { className: T.required, children: "*" })
117
117
  ] }),
118
- /* @__PURE__ */ r(
118
+ /* @__PURE__ */ a(
119
119
  "input",
120
120
  {
121
- ref: l,
122
- id: i,
123
- className: `${T.input} ${h ? T.error : ""}`,
124
- ...c
121
+ ref: d,
122
+ id: l,
123
+ className: `${T.input} ${f ? T.error : ""}`,
124
+ ...i
125
125
  }
126
126
  ),
127
- s && /* @__PURE__ */ r("span", { className: T.errorText, children: s }),
128
- t && !s && /* @__PURE__ */ r("span", { className: T.helperText, children: t })
127
+ t && /* @__PURE__ */ a("span", { className: T.errorText, children: t }),
128
+ s && !t && /* @__PURE__ */ a("span", { className: T.helperText, children: s })
129
129
  ] });
130
130
  }
131
131
  );
132
- ne.displayName = "Input";
133
- const Ze = "_selectWrapper_ir4bq_1", et = "_fullWidth_ir4bq_7", tt = "_label_ir4bq_11", st = "_required_ir4bq_20", ot = "_selectContainer_ir4bq_24", rt = "_select_ir4bq_1", at = "_error_ir4bq_63", nt = "_arrow_ir4bq_71", lt = "_errorText_ir4bq_81", ct = "_helperText_ir4bq_86", w = {
134
- selectWrapper: Ze,
135
- fullWidth: et,
136
- label: tt,
137
- required: st,
138
- selectContainer: ot,
139
- select: rt,
140
- error: at,
141
- arrow: nt,
142
- errorText: lt,
143
- helperText: ct
144
- }, le = ae.forwardRef(
132
+ ce.displayName = "Input";
133
+ const ot = "_selectWrapper_ir4bq_1", rt = "_fullWidth_ir4bq_7", at = "_label_ir4bq_11", nt = "_required_ir4bq_20", lt = "_selectContainer_ir4bq_24", ct = "_select_ir4bq_1", it = "_error_ir4bq_63", dt = "_arrow_ir4bq_71", _t = "_errorText_ir4bq_81", mt = "_helperText_ir4bq_86", w = {
134
+ selectWrapper: ot,
135
+ fullWidth: rt,
136
+ label: at,
137
+ required: nt,
138
+ selectContainer: lt,
139
+ select: ct,
140
+ error: it,
141
+ arrow: dt,
142
+ errorText: _t,
143
+ helperText: mt
144
+ }, ie = le.forwardRef(
145
145
  ({
146
146
  label: e,
147
- error: s,
148
- helperText: t,
147
+ error: t,
148
+ helperText: s,
149
149
  options: o,
150
- placeholder: d,
150
+ placeholder: c,
151
151
  fullWidth: g = !1,
152
- className: c = "",
153
- id: l,
154
- ...i
155
- }, h) => {
156
- const p = l || `select-${Math.random().toString(36).substr(2, 9)}`, N = !!s;
157
- return /* @__PURE__ */ m("div", { className: `${w.selectWrapper} ${g ? w.fullWidth : ""} ${c}`, children: [
158
- e && /* @__PURE__ */ m("label", { htmlFor: p, className: w.label, children: [
152
+ className: i = "",
153
+ id: d,
154
+ ...l
155
+ }, f) => {
156
+ const h = d || `select-${Math.random().toString(36).substr(2, 9)}`, y = !!t;
157
+ return /* @__PURE__ */ m("div", { className: `${w.selectWrapper} ${g ? w.fullWidth : ""} ${i}`, children: [
158
+ e && /* @__PURE__ */ m("label", { htmlFor: h, className: w.label, children: [
159
159
  e,
160
- i.required && /* @__PURE__ */ r("span", { className: w.required, children: "*" })
160
+ l.required && /* @__PURE__ */ a("span", { className: w.required, children: "*" })
161
161
  ] }),
162
162
  /* @__PURE__ */ m("div", { className: w.selectContainer, children: [
163
163
  /* @__PURE__ */ m(
164
164
  "select",
165
165
  {
166
- ref: h,
167
- id: p,
168
- className: `${w.select} ${N ? w.error : ""}`,
169
- ...i,
166
+ ref: f,
167
+ id: h,
168
+ className: `${w.select} ${y ? w.error : ""}`,
169
+ ...l,
170
170
  children: [
171
- d && /* @__PURE__ */ r("option", { value: "", disabled: !0, children: d }),
172
- o && o.map((f) => /* @__PURE__ */ r(
171
+ c && /* @__PURE__ */ a("option", { value: "", disabled: !0, children: c }),
172
+ o && o.map((p) => /* @__PURE__ */ a(
173
173
  "option",
174
174
  {
175
- value: f.value,
176
- disabled: f.disabled,
177
- children: f.label
175
+ value: p.value,
176
+ disabled: p.disabled,
177
+ children: p.label
178
178
  },
179
- f.value
179
+ p.value
180
180
  )),
181
- !o && i.children
181
+ !o && l.children
182
182
  ]
183
183
  }
184
184
  ),
185
- /* @__PURE__ */ r("span", { className: w.arrow, children: "▼" })
185
+ /* @__PURE__ */ a("span", { className: w.arrow, children: "▼" })
186
186
  ] }),
187
- s && /* @__PURE__ */ r("span", { className: w.errorText, children: s }),
188
- t && !s && /* @__PURE__ */ r("span", { className: w.helperText, children: t })
187
+ t && /* @__PURE__ */ a("span", { className: w.errorText, children: t }),
188
+ s && !t && /* @__PURE__ */ a("span", { className: w.helperText, children: s })
189
189
  ] });
190
190
  }
191
191
  );
192
- le.displayName = "Select";
193
- const te = "astrogators_access_token", se = "astrogators_refresh_token", ce = () => localStorage.getItem(te), it = (e) => {
194
- localStorage.setItem(te, e);
195
- }, dt = () => {
196
- localStorage.removeItem(te);
197
- }, _t = () => localStorage.getItem(se), mt = (e) => {
198
- localStorage.setItem(se, e);
199
- }, ut = () => {
200
- localStorage.removeItem(se);
201
- }, ie = (e, s) => {
202
- it(e), mt(s);
203
- }, ee = () => {
204
- dt(), ut();
205
- }, ht = () => !!ce();
206
- class gt {
207
- constructor(s) {
208
- R(this, "baseURL");
209
- R(this, "onUnauthorized");
210
- R(this, "isRefreshing", !1);
211
- R(this, "refreshPromise", null);
212
- this.baseURL = s.baseURL, this.onUnauthorized = s.onUnauthorized;
192
+ ie.displayName = "Select";
193
+ const oe = "astrogators_access_token", re = "astrogators_refresh_token", de = () => localStorage.getItem(oe), ut = (e) => {
194
+ localStorage.setItem(oe, e);
195
+ }, ht = () => {
196
+ localStorage.removeItem(oe);
197
+ }, gt = () => localStorage.getItem(re), ft = (e) => {
198
+ localStorage.setItem(re, e);
199
+ }, yt = () => {
200
+ localStorage.removeItem(re);
201
+ }, _e = (e, t) => {
202
+ ut(e), ft(t);
203
+ }, se = () => {
204
+ ht(), yt();
205
+ }, pt = () => !!de();
206
+ class vt {
207
+ constructor(t) {
208
+ j(this, "baseURL");
209
+ j(this, "onUnauthorized");
210
+ j(this, "isRefreshing", !1);
211
+ j(this, "refreshPromise", null);
212
+ this.baseURL = t.baseURL, this.onUnauthorized = t.onUnauthorized;
213
213
  }
214
214
  async refreshAccessToken() {
215
- var d;
216
- const s = _t();
217
- if (!s)
215
+ var c;
216
+ const t = gt();
217
+ if (!t)
218
218
  throw new Error("No refresh token available");
219
- const t = await fetch(`${this.baseURL}/api/v1/auth/refresh-token`, {
219
+ const s = await fetch(`${this.baseURL}/api/v1/auth/refresh-token`, {
220
220
  method: "POST",
221
221
  headers: {
222
222
  "Content-Type": "application/json"
223
223
  },
224
- body: JSON.stringify({ refresh_token: s })
224
+ body: JSON.stringify({ refresh_token: t })
225
225
  });
226
- if (!t.ok)
227
- throw ee(), (d = this.onUnauthorized) == null || d.call(this), new Error("Token refresh failed");
228
- const o = await t.json();
229
- return ie(o.access_token, s), o.access_token;
226
+ if (!s.ok)
227
+ throw se(), (c = this.onUnauthorized) == null || c.call(this), new Error("Token refresh failed");
228
+ const o = await s.json();
229
+ return _e(o.access_token, t), o.access_token;
230
230
  }
231
- async request(s, t = {}) {
232
- const o = ce(), d = {
231
+ async request(t, s = {}) {
232
+ const o = de(), c = {
233
233
  "Content-Type": "application/json",
234
- ...t.headers
234
+ ...s.headers
235
235
  };
236
- o && (d.Authorization = `Bearer ${o}`);
237
- const g = `${this.baseURL}${s}`;
238
- let c = await fetch(g, {
239
- ...t,
240
- headers: d
236
+ o && (c.Authorization = `Bearer ${o}`);
237
+ const g = `${this.baseURL}${t}`;
238
+ let i = await fetch(g, {
239
+ ...s,
240
+ headers: c
241
241
  });
242
- if (c.status === 401 && o) {
242
+ if (i.status === 401 && o) {
243
243
  this.isRefreshing || (this.isRefreshing = !0, this.refreshPromise = this.refreshAccessToken().finally(() => {
244
244
  this.isRefreshing = !1, this.refreshPromise = null;
245
245
  }));
246
246
  try {
247
- const l = await this.refreshPromise;
248
- d.Authorization = `Bearer ${l}`, c = await fetch(g, {
249
- ...t,
250
- headers: d
247
+ const d = await this.refreshPromise;
248
+ c.Authorization = `Bearer ${d}`, i = await fetch(g, {
249
+ ...s,
250
+ headers: c
251
251
  });
252
252
  } catch {
253
253
  throw new Error("Authentication failed");
254
254
  }
255
255
  }
256
- if (!c.ok) {
257
- const l = {
258
- message: c.statusText,
259
- status: c.status
256
+ if (!i.ok) {
257
+ const d = {
258
+ message: i.statusText,
259
+ status: i.status
260
260
  };
261
261
  try {
262
- const i = await c.json();
263
- if (c.status === 422 && Array.isArray(i.detail)) {
264
- const h = i.detail.map((p) => p.msg || "Validation error").join(", ");
265
- l.message = h;
266
- } else typeof i.detail == "string" ? l.message = i.detail : i.message && (l.message = i.message);
267
- l.detail = i.detail;
262
+ const l = await i.json();
263
+ if (i.status === 422 && Array.isArray(l.detail)) {
264
+ const f = l.detail.map((h) => h.msg || "Validation error").join(", ");
265
+ d.message = f;
266
+ } else typeof l.detail == "string" ? d.message = l.detail : l.message && (d.message = l.message);
267
+ d.detail = l.detail;
268
268
  } catch {
269
269
  }
270
- throw l;
270
+ throw d;
271
271
  }
272
- return c.status === 204 ? {} : c.json();
272
+ return i.status === 204 ? {} : i.json();
273
273
  }
274
- async get(s, t) {
275
- return this.request(s, { ...t, method: "GET" });
274
+ async get(t, s) {
275
+ return this.request(t, { ...s, method: "GET" });
276
276
  }
277
- async post(s, t, o) {
278
- return this.request(s, {
277
+ async post(t, s, o) {
278
+ return this.request(t, {
279
279
  ...o,
280
280
  method: "POST",
281
- body: t ? JSON.stringify(t) : void 0
281
+ body: s ? JSON.stringify(s) : void 0
282
282
  });
283
283
  }
284
- async put(s, t, o) {
285
- return this.request(s, {
284
+ async put(t, s, o) {
285
+ return this.request(t, {
286
286
  ...o,
287
287
  method: "PUT",
288
- body: t ? JSON.stringify(t) : void 0
288
+ body: s ? JSON.stringify(s) : void 0
289
289
  });
290
290
  }
291
- async patch(s, t, o) {
292
- return this.request(s, {
291
+ async patch(t, s, o) {
292
+ return this.request(t, {
293
293
  ...o,
294
294
  method: "PATCH",
295
- body: t ? JSON.stringify(t) : void 0
295
+ body: s ? JSON.stringify(s) : void 0
296
296
  });
297
297
  }
298
- async delete(s, t) {
299
- return this.request(s, { ...t, method: "DELETE" });
298
+ async delete(t, s) {
299
+ return this.request(t, { ...s, method: "DELETE" });
300
300
  }
301
301
  }
302
- let y;
303
- const ft = (e) => {
304
- y = new gt(e);
305
- }, F = "astrogators_ally_codes", H = "astrogators_selected_ally_code", A = () => {
302
+ let v;
303
+ const bt = (e) => {
304
+ v = new vt(e);
305
+ }, O = "astrogators_ally_codes", G = "astrogators_selected_ally_code", A = () => {
306
306
  try {
307
- const e = localStorage.getItem(F);
307
+ const e = localStorage.getItem(O);
308
308
  return e ? JSON.parse(e) : [];
309
309
  } catch (e) {
310
310
  return console.error("Failed to read ally codes from localStorage:", e), [];
311
311
  }
312
- }, pt = (e) => {
312
+ }, $t = (e) => {
313
313
  try {
314
- const s = A();
315
- if (s.some((o) => o.ally_code === e.ally_code))
314
+ const t = A();
315
+ if (t.some((o) => o.ally_code === e.ally_code))
316
316
  return;
317
- s.push(e), localStorage.setItem(F, JSON.stringify(s));
318
- } catch (s) {
319
- console.error("Failed to save ally code to localStorage:", s);
317
+ t.push(e), localStorage.setItem(O, JSON.stringify(t));
318
+ } catch (t) {
319
+ console.error("Failed to save ally code to localStorage:", t);
320
320
  }
321
- }, yt = (e) => {
321
+ }, wt = (e) => {
322
322
  try {
323
- const t = A().filter((o) => o.ally_code !== e);
324
- localStorage.setItem(F, JSON.stringify(t));
325
- } catch (s) {
326
- console.error("Failed to remove ally code from localStorage:", s);
323
+ const s = A().filter((o) => o.ally_code !== e);
324
+ localStorage.setItem(O, JSON.stringify(s));
325
+ } catch (t) {
326
+ console.error("Failed to remove ally code from localStorage:", t);
327
327
  }
328
- }, re = (e) => {
328
+ }, ne = (e) => {
329
329
  try {
330
- const t = A().map(
330
+ const s = A().map(
331
331
  (o) => o.ally_code === e ? { ...o, last_used_at: (/* @__PURE__ */ new Date()).toISOString() } : o
332
332
  );
333
- localStorage.setItem(F, JSON.stringify(t));
334
- } catch (s) {
335
- console.error("Failed to update ally code last used:", s);
333
+ localStorage.setItem(O, JSON.stringify(s));
334
+ } catch (t) {
335
+ console.error("Failed to update ally code last used:", t);
336
336
  }
337
- }, vt = () => localStorage.getItem(H), $t = (e) => {
338
- e ? localStorage.setItem(H, e) : localStorage.removeItem(H);
339
- }, bt = () => {
340
- localStorage.removeItem(F), localStorage.removeItem(H);
341
- }, de = fe(void 0), ws = ({ children: e, apiBaseUrl: s }) => {
342
- const [t, o] = b(null), [d, g] = b(!0), [c, l] = b([]), [i, h] = b(null), [p, N] = b(!1), [f, k] = b({
337
+ }, Nt = () => localStorage.getItem(G), At = (e) => {
338
+ e ? localStorage.setItem(G, e) : localStorage.removeItem(G);
339
+ }, St = () => {
340
+ localStorage.removeItem(O), localStorage.removeItem(G);
341
+ }, me = be(void 0), xs = ({ children: e, apiBaseUrl: t }) => {
342
+ const [s, o] = b(null), [c, g] = b(!0), [i, d] = b(!0), [l, f] = b(!0), [h, y] = b([]), [p, k] = b(null), [z, L] = b(!1), [M, W] = b({
343
343
  show: !1,
344
344
  localStorageCodes: []
345
345
  });
346
- j(() => {
347
- ft({
348
- baseURL: s
346
+ I(() => {
347
+ bt({
348
+ baseURL: t
349
349
  });
350
- }, [s]);
351
- const W = S(async () => {
352
- if (!ht()) {
350
+ }, [t]), I(() => {
351
+ (async () => {
352
+ try {
353
+ const n = await v.get("/api/v1/config/features");
354
+ d(n.auth_enabled);
355
+ } catch (n) {
356
+ console.error("Failed to fetch features:", n), d(!0);
357
+ } finally {
358
+ f(!1);
359
+ }
360
+ })();
361
+ }, [t]);
362
+ const q = S(async () => {
363
+ if (!pt()) {
353
364
  o(null), g(!1);
354
365
  return;
355
366
  }
356
367
  try {
357
- const a = await y.get("/api/v1/users/me");
358
- o(a);
359
- } catch (a) {
360
- console.error("Failed to fetch user:", a), o(null), ee();
368
+ const r = await v.get("/api/v1/users/me");
369
+ o(r);
370
+ } catch (r) {
371
+ console.error("Failed to fetch user:", r), o(null), se();
361
372
  } finally {
362
373
  g(!1);
363
374
  }
364
375
  }, []);
365
- j(() => {
366
- W();
367
- }, [W]);
368
- const I = async (a) => {
376
+ I(() => {
377
+ q();
378
+ }, [q]);
379
+ const K = async (r) => {
369
380
  try {
370
- const n = await y.post("/api/v1/auth/login", a);
371
- ie(n.access_token, n.refresh_token);
372
- const u = await y.get("/api/v1/users/me");
381
+ const n = await v.post("/api/v1/auth/login", r);
382
+ _e(n.access_token, n.refresh_token);
383
+ const u = await v.get("/api/v1/users/me");
373
384
  o(u);
374
385
  } catch (n) {
375
386
  throw console.error("Login failed:", n), n;
376
387
  }
377
- }, D = async (a) => {
388
+ }, V = async (r) => {
378
389
  try {
379
- await y.post("/api/v1/auth/register", a);
390
+ await v.post("/api/v1/auth/register", r);
380
391
  } catch (n) {
381
392
  throw console.error("Registration failed:", n), n;
382
393
  }
383
- }, O = () => {
384
- ee(), o(null), l([]), h(null), k({ show: !1, localStorageCodes: [] });
385
- }, Y = async () => {
386
- await W();
387
- }, G = async (a) => {
394
+ }, Q = () => {
395
+ se(), o(null), y([]), k(null), W({ show: !1, localStorageCodes: [] });
396
+ }, _ = async () => {
397
+ await q();
398
+ }, N = async (r) => {
388
399
  try {
389
- return (await y.post(
400
+ return (await v.post(
390
401
  "/api/v1/auth/forgot-password",
391
- a
402
+ r
392
403
  )).message;
393
404
  } catch (n) {
394
405
  throw console.error("Forgot password failed:", n), n;
395
406
  }
396
- }, K = async (a) => {
407
+ }, R = async (r) => {
397
408
  try {
398
- return (await y.post(
409
+ return (await v.post(
399
410
  "/api/v1/auth/reset-password",
400
- a
411
+ r
401
412
  )).message;
402
413
  } catch (n) {
403
414
  throw console.error("Reset password failed:", n), n;
404
415
  }
405
- }, V = async (a) => {
416
+ }, ue = async (r) => {
406
417
  try {
407
- return (await y.post(
418
+ return (await v.post(
408
419
  "/api/v1/auth/resend-verification",
409
- a
420
+ r
410
421
  )).message;
411
422
  } catch (n) {
412
423
  throw console.error("Resend verification failed:", n), n;
413
424
  }
414
- }, _ = S(async () => {
415
- N(!0);
425
+ }, F = S(async () => {
426
+ L(!0);
416
427
  try {
417
- if (t) {
418
- const n = await y.get("/api/v1/users/me/ally-codes");
419
- l(n.ally_codes);
428
+ if (s) {
429
+ const n = await v.get("/api/v1/users/me/ally-codes");
430
+ y(n.ally_codes);
420
431
  const u = A();
421
- u.length > 0 && k({
432
+ u.length > 0 && W({
422
433
  show: !0,
423
- localStorageCodes: u.map((q) => q.ally_code)
434
+ localStorageCodes: u.map((P) => P.ally_code)
424
435
  });
425
436
  } else {
426
437
  const n = A();
427
- l(n);
438
+ y(n);
428
439
  }
429
- const a = vt();
430
- h(a);
431
- } catch (a) {
432
- console.error("Failed to fetch ally codes:", a), l([]);
440
+ const r = Nt();
441
+ k(r);
442
+ } catch (r) {
443
+ console.error("Failed to fetch ally codes:", r), y([]);
433
444
  } finally {
434
- N(!1);
445
+ L(!1);
435
446
  }
436
- }, [t]), v = S(async (a) => {
447
+ }, [s]), X = S(async (r) => {
437
448
  var n;
438
- if (!/^\d{9}$/.test(a))
449
+ if (!/^\d{9}$/.test(r))
439
450
  throw new Error("Ally code must be exactly 9 digits");
440
- if (t) {
441
- const u = await y.post(
451
+ if (s) {
452
+ const u = await v.post(
442
453
  "/api/v1/users/me/ally-codes",
443
- { ally_code: a }
454
+ { ally_code: r }
444
455
  );
445
- l((q) => [u, ...q]), c.length === 0 && z(a);
456
+ y((P) => [u, ...P]), h.length === 0 && J(r);
446
457
  } else {
447
- const u = await y.get(`/api/v1/player-data/player/${a}`);
458
+ const u = await v.get(`/api/v1/player-data/player/${r}`);
448
459
  if (!u)
449
460
  throw new Error("Invalid ally code - player not found");
450
- const q = {
451
- ally_code: a,
461
+ const P = {
462
+ ally_code: r,
452
463
  player_name: ((n = u == null ? void 0 : u.data) == null ? void 0 : n.name) || null,
453
464
  last_used_at: (/* @__PURE__ */ new Date()).toISOString()
454
465
  };
455
- pt(q), l(A()), c.length === 0 && z(a);
466
+ $t(P), y(A()), h.length === 0 && J(r);
456
467
  }
457
- }, [t, c.length]), L = S(async (a) => {
458
- t && typeof a == "number" ? (await y.delete(`/api/v1/users/me/ally-codes/${a}`), l((n) => n.filter((u) => "id" in u && u.id !== a))) : !t && typeof a == "string" && (yt(a), l(A()), i === a && z(null));
459
- }, [t, i]), z = S((a) => {
460
- if (h(a), $t(a), a && t) {
461
- const n = c.find((u) => "ally_code" in u && u.ally_code === a);
462
- n && "id" in n && oe(n.id);
463
- } else a && !t && re(a);
464
- }, [t, c]), oe = S(async (a) => {
465
- t && typeof a == "number" ? (await y.put(`/api/v1/users/me/ally-codes/${a}/use`, {}), await _()) : !t && typeof a == "string" && (re(a), l(A()));
466
- }, [t, _]), Q = S(() => {
467
- k({ show: !1, localStorageCodes: [] });
468
- }, []), _e = S(async () => {
469
- if (!t) return;
470
- const a = A();
471
- for (const n of a)
468
+ }, [s, h.length]), he = S(async (r) => {
469
+ s && typeof r == "number" ? (await v.delete(`/api/v1/users/me/ally-codes/${r}`), y((n) => n.filter((u) => "id" in u && u.id !== r))) : !s && typeof r == "string" && (wt(r), y(A()), p === r && J(null));
470
+ }, [s, p]), J = S((r) => {
471
+ if (k(r), At(r), r && s) {
472
+ const n = h.find((u) => "ally_code" in u && u.ally_code === r);
473
+ n && "id" in n && ae(n.id);
474
+ } else r && !s && ne(r);
475
+ }, [s, h]), ae = S(async (r) => {
476
+ s && typeof r == "number" ? (await v.put(`/api/v1/users/me/ally-codes/${r}/use`, {}), await F()) : !s && typeof r == "string" && (ne(r), y(A()));
477
+ }, [s, F]), Z = S(() => {
478
+ W({ show: !1, localStorageCodes: [] });
479
+ }, []), ge = S(async () => {
480
+ if (!s) return;
481
+ const r = A();
482
+ for (const n of r)
472
483
  try {
473
- await v(n.ally_code);
484
+ await X(n.ally_code);
474
485
  } catch (u) {
475
486
  console.error(`Failed to migrate ally code ${n.ally_code}:`, u);
476
487
  }
477
- bt(), Q();
478
- }, [t, v, Q]);
479
- j(() => {
480
- _();
481
- }, [_]);
482
- const me = {
483
- user: t,
484
- isAuthenticated: !!t,
485
- isLoading: d,
486
- login: I,
487
- register: D,
488
- logout: O,
489
- refreshUser: Y,
490
- forgotPassword: G,
491
- resetPassword: K,
492
- resendVerification: V,
488
+ St(), Z();
489
+ }, [s, X, Z]);
490
+ I(() => {
491
+ F();
492
+ }, [F]);
493
+ const fe = {
494
+ user: s,
495
+ isAuthenticated: !!s,
496
+ isLoading: c,
497
+ login: K,
498
+ register: V,
499
+ logout: Q,
500
+ refreshUser: _,
501
+ forgotPassword: N,
502
+ resetPassword: R,
503
+ resendVerification: ue,
504
+ // Feature flags
505
+ authEnabled: i,
506
+ isLoadingFeatures: l,
493
507
  // Ally code values
494
- allyCodes: c,
495
- selectedAllyCode: i,
496
- isLoadingAllyCodes: p,
497
- fetchAllyCodes: _,
498
- addAllyCode: v,
499
- removeAllyCode: L,
500
- selectAllyCode: z,
501
- updateAllyCodeLastUsed: oe,
502
- migrationPrompt: f,
503
- dismissMigrationPrompt: Q,
504
- migrateLocalStorageCodes: _e
508
+ allyCodes: h,
509
+ selectedAllyCode: p,
510
+ isLoadingAllyCodes: z,
511
+ fetchAllyCodes: F,
512
+ addAllyCode: X,
513
+ removeAllyCode: he,
514
+ selectAllyCode: J,
515
+ updateAllyCodeLastUsed: ae,
516
+ migrationPrompt: M,
517
+ dismissMigrationPrompt: Z,
518
+ migrateLocalStorageCodes: ge
505
519
  };
506
- return /* @__PURE__ */ r(de.Provider, { value: me, children: e });
507
- }, wt = () => {
508
- const e = pe(de);
520
+ return /* @__PURE__ */ a(me.Provider, { value: fe, children: e });
521
+ }, xt = () => {
522
+ const e = $e(me);
509
523
  if (e === void 0)
510
524
  throw new Error("useAuth must be used within an AuthProvider");
511
525
  return e;
512
- }, J = (e) => !e || e.length !== 9 ? e : `${e.slice(0, 3)}-${e.slice(3, 6)}-${e.slice(6, 9)}`, Ns = (e) => e.replace(/-/g, ""), Nt = "_allyCodeDropdown_1m0tw_1", At = "_select_1m0tw_8", St = "_manageButton_1m0tw_12", xt = "_managePanel_1m0tw_16", Tt = "_addSection_1m0tw_37", Ct = "_addInputGroup_1m0tw_43", kt = "_error_1m0tw_55", Et = "_success_1m0tw_61", Wt = "_codesList_1m0tw_67", It = "_codeItem_1m0tw_71", Lt = "_doneButton_1m0tw_88", $ = {
513
- allyCodeDropdown: Nt,
514
- select: At,
515
- manageButton: St,
516
- managePanel: xt,
517
- addSection: Tt,
518
- addInputGroup: Ct,
519
- error: kt,
520
- success: Et,
521
- codesList: Wt,
522
- codeItem: It,
523
- doneButton: Lt
524
- }, As = ({
526
+ }, Y = (e) => !e || e.length !== 9 ? e : `${e.slice(0, 3)}-${e.slice(3, 6)}-${e.slice(6, 9)}`, Ts = (e) => e.replace(/-/g, ""), Tt = "_allyCodeDropdown_1m0tw_1", Ct = "_select_1m0tw_8", kt = "_manageButton_1m0tw_12", Et = "_managePanel_1m0tw_16", Lt = "_addSection_1m0tw_37", Wt = "_addInputGroup_1m0tw_43", It = "_error_1m0tw_55", qt = "_success_1m0tw_61", Rt = "_codesList_1m0tw_67", Ft = "_codeItem_1m0tw_71", Pt = "_doneButton_1m0tw_88", $ = {
527
+ allyCodeDropdown: Tt,
528
+ select: Ct,
529
+ manageButton: kt,
530
+ managePanel: Et,
531
+ addSection: Lt,
532
+ addInputGroup: Wt,
533
+ error: It,
534
+ success: qt,
535
+ codesList: Rt,
536
+ codeItem: Ft,
537
+ doneButton: Pt
538
+ }, Cs = ({
525
539
  onAllyCodeSelected: e,
526
- className: s = ""
540
+ className: t = ""
527
541
  }) => {
528
542
  const {
529
- allyCodes: t,
543
+ allyCodes: s,
530
544
  selectedAllyCode: o,
531
- selectAllyCode: d,
545
+ selectAllyCode: c,
532
546
  removeAllyCode: g,
533
- addAllyCode: c,
534
- isLoadingAllyCodes: l
535
- } = wt(), [i, h] = b(!1), [p, N] = b(""), [f, k] = b(""), [W, I] = b(""), [D, O] = b(!1), Y = t.map((_) => ({
547
+ addAllyCode: i,
548
+ isLoadingAllyCodes: d
549
+ } = xt(), [l, f] = b(!1), [h, y] = b(""), [p, k] = b(""), [z, L] = b(""), [M, W] = b(!1), q = s.map((_) => ({
536
550
  value: _.ally_code,
537
- label: _.player_name ? `${_.player_name} (${J(_.ally_code)})` : J(_.ally_code)
538
- })), G = (_) => {
539
- const v = _.target.value || null;
540
- d(v), e == null || e(v);
541
- }, K = async (_) => {
542
- const v = t.find((L) => L.ally_code === _);
543
- if (v) {
544
- const L = "id" in v ? v.id : v.ally_code;
545
- await g(L);
551
+ label: _.player_name ? `${_.player_name} (${Y(_.ally_code)})` : Y(_.ally_code)
552
+ })), K = (_) => {
553
+ const N = _.target.value || null;
554
+ c(N), e == null || e(N);
555
+ }, V = async (_) => {
556
+ const N = s.find((R) => R.ally_code === _);
557
+ if (N) {
558
+ const R = "id" in N ? N.id : N.ally_code;
559
+ await g(R);
546
560
  }
547
- }, V = async () => {
548
- if (k(""), I(""), !/^\d{9}$/.test(p)) {
561
+ }, Q = async () => {
562
+ if (k(""), L(""), !/^\d{9}$/.test(h)) {
549
563
  k("Ally code must be exactly 9 digits");
550
564
  return;
551
565
  }
552
- O(!0);
566
+ W(!0);
553
567
  try {
554
- await c(p), I("Added successfully!"), N(""), setTimeout(() => I(""), 2e3);
568
+ await i(h), L("Added successfully!"), y(""), setTimeout(() => L(""), 2e3);
555
569
  } catch (_) {
556
570
  k(_.message || "Failed to add ally code");
557
571
  } finally {
558
- O(!1);
572
+ W(!1);
559
573
  }
560
574
  };
561
- return t.length === 0 ? null : /* @__PURE__ */ m("div", { className: `${$.allyCodeDropdown} ${s}`, children: [
562
- /* @__PURE__ */ r(
563
- le,
575
+ return s.length === 0 ? null : /* @__PURE__ */ m("div", { className: `${$.allyCodeDropdown} ${t}`, children: [
576
+ /* @__PURE__ */ a(
577
+ ie,
564
578
  {
565
- options: Y,
579
+ options: q,
566
580
  value: o || "",
567
- onChange: G,
581
+ onChange: K,
568
582
  placeholder: "Select ally code",
569
- disabled: l,
583
+ disabled: d,
570
584
  className: $.select
571
585
  }
572
586
  ),
573
- i && /* @__PURE__ */ m("div", { className: $.managePanel, children: [
574
- /* @__PURE__ */ r("h4", { children: "Manage Ally Codes" }),
587
+ l && /* @__PURE__ */ m("div", { className: $.managePanel, children: [
588
+ /* @__PURE__ */ a("h4", { children: "Manage Ally Codes" }),
575
589
  /* @__PURE__ */ m("div", { className: $.addSection, children: [
576
590
  /* @__PURE__ */ m("div", { className: $.addInputGroup, children: [
577
- /* @__PURE__ */ r(
578
- ne,
591
+ /* @__PURE__ */ a(
592
+ ce,
579
593
  {
580
594
  type: "text",
581
595
  placeholder: "9-digit ally code",
582
- value: p,
583
- onChange: (_) => N(_.target.value.replace(/\D/g, "").slice(0, 9)),
584
- disabled: D
596
+ value: h,
597
+ onChange: (_) => y(_.target.value.replace(/\D/g, "").slice(0, 9)),
598
+ disabled: M
585
599
  }
586
600
  ),
587
- /* @__PURE__ */ r(
588
- M,
601
+ /* @__PURE__ */ a(
602
+ H,
589
603
  {
590
604
  variant: "primary",
591
605
  size: "sm",
592
- onClick: V,
593
- loading: D,
594
- disabled: p.length !== 9,
606
+ onClick: Q,
607
+ loading: M,
608
+ disabled: h.length !== 9,
595
609
  children: "Add"
596
610
  }
597
611
  )
598
612
  ] }),
599
- f && /* @__PURE__ */ r("div", { className: $.error, children: f }),
600
- W && /* @__PURE__ */ r("div", { className: $.success, children: W })
613
+ p && /* @__PURE__ */ a("div", { className: $.error, children: p }),
614
+ z && /* @__PURE__ */ a("div", { className: $.success, children: z })
601
615
  ] }),
602
- /* @__PURE__ */ r("div", { className: $.codesList, children: t.map((_) => /* @__PURE__ */ m("div", { className: $.codeItem, children: [
603
- /* @__PURE__ */ r("span", { children: _.player_name ? `${_.player_name} (${J(_.ally_code)})` : J(_.ally_code) }),
604
- /* @__PURE__ */ r(
605
- M,
616
+ /* @__PURE__ */ a("div", { className: $.codesList, children: s.map((_) => /* @__PURE__ */ m("div", { className: $.codeItem, children: [
617
+ /* @__PURE__ */ a("span", { children: _.player_name ? `${_.player_name} (${Y(_.ally_code)})` : Y(_.ally_code) }),
618
+ /* @__PURE__ */ a(
619
+ H,
606
620
  {
607
621
  variant: "ghost",
608
622
  size: "sm",
609
- onClick: () => K(_.ally_code),
623
+ onClick: () => V(_.ally_code),
610
624
  children: "Remove"
611
625
  }
612
626
  )
613
627
  ] }, _.ally_code)) }),
614
- /* @__PURE__ */ r(
615
- M,
628
+ /* @__PURE__ */ a(
629
+ H,
616
630
  {
617
631
  variant: "secondary",
618
632
  size: "sm",
619
- onClick: () => h(!1),
633
+ onClick: () => f(!1),
620
634
  className: $.doneButton,
621
635
  children: "Done"
622
636
  }
623
637
  )
624
638
  ] }),
625
- /* @__PURE__ */ r(
626
- M,
639
+ /* @__PURE__ */ a(
640
+ H,
627
641
  {
628
642
  variant: "ghost",
629
643
  size: "sm",
630
- onClick: () => h(!i),
644
+ onClick: () => f(!l),
631
645
  className: $.manageButton,
632
646
  children: "Manage"
633
647
  }
634
648
  )
635
649
  ] });
636
- }, qt = "_card_b4471_1", Rt = "_chamfered_b4471_8", Pt = "_elevated_b4471_17", Bt = "_outline_b4471_22", Ut = "_hoverable_b4471_45", U = {
637
- card: qt,
638
- chamfered: Rt,
650
+ }, jt = "_card_b4471_1", Bt = "_chamfered_b4471_8", Ut = "_elevated_b4471_17", Dt = "_outline_b4471_22", Ot = "_hoverable_b4471_45", D = {
651
+ card: jt,
652
+ chamfered: Bt,
639
653
  default: "_default_b4471_13",
640
- elevated: Pt,
641
- outline: Bt,
654
+ elevated: Ut,
655
+ outline: Dt,
642
656
  "padding-none": "_padding-none_b4471_28",
643
657
  "padding-sm": "_padding-sm_b4471_32",
644
658
  "padding-md": "_padding-md_b4471_36",
645
659
  "padding-lg": "_padding-lg_b4471_40",
646
- hoverable: Ut
647
- }, Ss = ({
660
+ hoverable: Ot
661
+ }, ks = ({
648
662
  children: e,
649
- variant: s = "default",
650
- chamfered: t = !1,
663
+ variant: t = "default",
664
+ chamfered: s = !1,
651
665
  chamferSize: o = "md",
652
- padding: d = "md",
666
+ padding: c = "md",
653
667
  hoverable: g = !1,
654
- showDiagonalBorders: c = !1,
655
- diagonalBorderColor: l,
656
- className: i = "",
657
- onClick: h,
658
- style: p
668
+ showDiagonalBorders: i = !1,
669
+ diagonalBorderColor: d,
670
+ className: l = "",
671
+ onClick: f,
672
+ style: h
659
673
  }) => {
660
- const N = t ? o === "asymmetric" ? "chamfered-box-asymmetric" : o === "sm" ? "chamfered-box-sm" : o === "lg" ? "chamfered-box-lg" : "chamfered-box" : "", f = l ? { color: l } : void 0;
674
+ const y = s ? o === "asymmetric" ? "chamfered-box-asymmetric" : o === "sm" ? "chamfered-box-sm" : o === "lg" ? "chamfered-box-lg" : "chamfered-box" : "", p = d ? { color: d } : void 0;
661
675
  return /* @__PURE__ */ m(
662
676
  "div",
663
677
  {
664
- className: `${U.card} ${t ? U.chamfered : ""} ${U[s]} ${U[`padding-${d}`]} ${N} ${g ? U.hoverable : ""} ${i}`,
665
- onClick: h,
666
- role: h ? "button" : void 0,
667
- tabIndex: h ? 0 : void 0,
668
- style: p,
678
+ className: `${D.card} ${s ? D.chamfered : ""} ${D[t]} ${D[`padding-${c}`]} ${y} ${g ? D.hoverable : ""} ${l}`,
679
+ onClick: f,
680
+ role: f ? "button" : void 0,
681
+ tabIndex: f ? 0 : void 0,
682
+ style: h,
669
683
  children: [
670
- c && /* @__PURE__ */ m(ge, { children: [
671
- /* @__PURE__ */ r("div", { className: "chamfered-diagonal-border chamfered-diagonal-tl", style: f }),
672
- /* @__PURE__ */ r("div", { className: "chamfered-diagonal-border chamfered-diagonal-tr", style: f }),
673
- /* @__PURE__ */ r("div", { className: "chamfered-diagonal-border chamfered-diagonal-bl", style: f }),
674
- /* @__PURE__ */ r("div", { className: `chamfered-diagonal-border ${o === "asymmetric" ? "chamfered-diagonal-br-large" : "chamfered-diagonal-br"}`, style: f })
684
+ i && /* @__PURE__ */ m(ve, { children: [
685
+ /* @__PURE__ */ a("div", { className: "chamfered-diagonal-border chamfered-diagonal-tl", style: p }),
686
+ /* @__PURE__ */ a("div", { className: "chamfered-diagonal-border chamfered-diagonal-tr", style: p }),
687
+ /* @__PURE__ */ a("div", { className: "chamfered-diagonal-border chamfered-diagonal-bl", style: p }),
688
+ /* @__PURE__ */ a("div", { className: `chamfered-diagonal-border ${o === "asymmetric" ? "chamfered-diagonal-br-large" : "chamfered-diagonal-br"}`, style: p })
675
689
  ] }),
676
690
  e
677
691
  ]
678
692
  }
679
693
  );
680
- }, jt = "_badge_rk7t5_1", Ft = "_sm_rk7t5_11", Dt = "_md_rk7t5_16", Ot = "_lg_rk7t5_21", zt = "_primary_rk7t5_32", Mt = "_secondary_rk7t5_37", Jt = "_success_rk7t5_42", Ht = "_warning_rk7t5_47", Yt = "_error_rk7t5_52", Gt = "_info_rk7t5_57", Z = {
681
- badge: jt,
682
- sm: Ft,
683
- md: Dt,
684
- lg: Ot,
694
+ }, zt = "_badge_rk7t5_1", Mt = "_sm_rk7t5_11", Jt = "_md_rk7t5_16", Ht = "_lg_rk7t5_21", Yt = "_primary_rk7t5_32", Gt = "_secondary_rk7t5_37", Kt = "_success_rk7t5_42", Vt = "_warning_rk7t5_47", Qt = "_error_rk7t5_52", Xt = "_info_rk7t5_57", te = {
695
+ badge: zt,
696
+ sm: Mt,
697
+ md: Jt,
698
+ lg: Ht,
685
699
  default: "_default_rk7t5_27",
686
- primary: zt,
687
- secondary: Mt,
688
- success: Jt,
689
- warning: Ht,
690
- error: Yt,
691
- info: Gt
692
- }, xs = ({
700
+ primary: Yt,
701
+ secondary: Gt,
702
+ success: Kt,
703
+ warning: Vt,
704
+ error: Qt,
705
+ info: Xt
706
+ }, Es = ({
693
707
  children: e,
694
- variant: s = "default",
695
- size: t = "md",
708
+ variant: t = "default",
709
+ size: s = "md",
696
710
  className: o = ""
697
- }) => /* @__PURE__ */ r("span", { className: `${Z.badge} ${Z[s]} ${Z[t]} ${o}`, children: e }), Kt = "_overlay_1b3yt_1", Vt = "_fadeIn_1b3yt_1", Qt = "_modal_1b3yt_13", Xt = "_slideUp_1b3yt_1", Zt = "_sm_1b3yt_25", es = "_md_1b3yt_30", ts = "_lg_1b3yt_35", ss = "_xl_1b3yt_40", os = "_header_1b3yt_45", rs = "_title_1b3yt_53", as = "_closeButton_1b3yt_60", ns = "_content_1b3yt_78", E = {
698
- overlay: Kt,
699
- fadeIn: Vt,
700
- modal: Qt,
701
- slideUp: Xt,
702
- sm: Zt,
703
- md: es,
704
- lg: ts,
705
- xl: ss,
706
- header: os,
707
- title: rs,
708
- closeButton: as,
709
- content: ns
710
- }, Ts = ({
711
+ }) => /* @__PURE__ */ a("span", { className: `${te.badge} ${te[t]} ${te[s]} ${o}`, children: e }), Zt = "_overlay_1b3yt_1", es = "_fadeIn_1b3yt_1", ts = "_modal_1b3yt_13", ss = "_slideUp_1b3yt_1", os = "_sm_1b3yt_25", rs = "_md_1b3yt_30", as = "_lg_1b3yt_35", ns = "_xl_1b3yt_40", ls = "_header_1b3yt_45", cs = "_title_1b3yt_53", is = "_closeButton_1b3yt_60", ds = "_content_1b3yt_78", E = {
712
+ overlay: Zt,
713
+ fadeIn: es,
714
+ modal: ts,
715
+ slideUp: ss,
716
+ sm: os,
717
+ md: rs,
718
+ lg: as,
719
+ xl: ns,
720
+ header: ls,
721
+ title: cs,
722
+ closeButton: is,
723
+ content: ds
724
+ }, Ls = ({
711
725
  isOpen: e,
712
- onClose: s,
713
- title: t,
726
+ onClose: t,
727
+ title: s,
714
728
  children: o,
715
- size: d = "md",
729
+ size: c = "md",
716
730
  closeOnOverlayClick: g = !0,
717
- className: c = ""
731
+ className: i = ""
718
732
  }) => {
719
- if (j(() => (e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "unset", () => {
733
+ if (I(() => (e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "unset", () => {
720
734
  document.body.style.overflow = "unset";
721
- }), [e]), j(() => {
722
- const i = (h) => {
723
- h.key === "Escape" && e && s();
735
+ }), [e]), I(() => {
736
+ const l = (f) => {
737
+ f.key === "Escape" && e && t();
724
738
  };
725
- return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
726
- }, [e, s]), !e) return null;
727
- const l = (i) => {
728
- g && i.target === i.currentTarget && s();
739
+ return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
740
+ }, [e, t]), !e) return null;
741
+ const d = (l) => {
742
+ g && l.target === l.currentTarget && t();
729
743
  };
730
- return /* @__PURE__ */ r("div", { className: E.overlay, onClick: l, children: /* @__PURE__ */ m("div", { className: `${E.modal} ${E[d]} ${c}`, role: "dialog", "aria-modal": "true", children: [
731
- t && /* @__PURE__ */ m("div", { className: E.header, children: [
732
- /* @__PURE__ */ r("h2", { className: E.title, children: t }),
733
- /* @__PURE__ */ r("button", { className: E.closeButton, onClick: s, "aria-label": "Close modal", children: "✕" })
744
+ return /* @__PURE__ */ a("div", { className: E.overlay, onClick: d, children: /* @__PURE__ */ m("div", { className: `${E.modal} ${E[c]} ${i}`, role: "dialog", "aria-modal": "true", children: [
745
+ s && /* @__PURE__ */ m("div", { className: E.header, children: [
746
+ /* @__PURE__ */ a("h2", { className: E.title, children: s }),
747
+ /* @__PURE__ */ a("button", { className: E.closeButton, onClick: t, "aria-label": "Close modal", children: "✕" })
734
748
  ] }),
735
- /* @__PURE__ */ r("div", { className: E.content, children: o })
749
+ /* @__PURE__ */ a("div", { className: E.content, children: o })
736
750
  ] }) });
737
- }, ls = "_spinner_1uhnh_2", cs = "_spin_1uhnh_2", is = "_sm_1uhnh_9", ds = "_md_1uhnh_15", _s = "_lg_1uhnh_21", ms = "_dots_1uhnh_34", us = "_dot_1uhnh_34", hs = "_bounce_1uhnh_1", gs = "_visuallyHidden_1uhnh_91", C = {
738
- spinner: ls,
739
- spin: cs,
740
- sm: is,
741
- md: ds,
742
- lg: _s,
743
- dots: ms,
744
- dot: us,
745
- bounce: hs,
746
- visuallyHidden: gs
747
- }, Cs = ({
751
+ }, _s = "_spinner_1uhnh_2", ms = "_spin_1uhnh_2", us = "_sm_1uhnh_9", hs = "_md_1uhnh_15", gs = "_lg_1uhnh_21", fs = "_dots_1uhnh_34", ys = "_dot_1uhnh_34", ps = "_bounce_1uhnh_1", vs = "_visuallyHidden_1uhnh_91", C = {
752
+ spinner: _s,
753
+ spin: ms,
754
+ sm: us,
755
+ md: hs,
756
+ lg: gs,
757
+ dots: fs,
758
+ dot: ys,
759
+ bounce: ps,
760
+ visuallyHidden: vs
761
+ }, Ws = ({
748
762
  size: e = "md",
749
- variant: s = "spinner",
750
- className: t = ""
751
- }) => s === "dots" ? /* @__PURE__ */ m("div", { className: `${C.dots} ${C[e]} ${t}`, children: [
752
- /* @__PURE__ */ r("span", { className: C.dot }),
753
- /* @__PURE__ */ r("span", { className: C.dot }),
754
- /* @__PURE__ */ r("span", { className: C.dot })
755
- ] }) : /* @__PURE__ */ r("div", { className: `${C.spinner} ${C[e]} ${t}`, role: "status", children: /* @__PURE__ */ r("span", { className: C.visuallyHidden, children: "Loading..." }) });
763
+ variant: t = "spinner",
764
+ className: s = ""
765
+ }) => t === "dots" ? /* @__PURE__ */ m("div", { className: `${C.dots} ${C[e]} ${s}`, children: [
766
+ /* @__PURE__ */ a("span", { className: C.dot }),
767
+ /* @__PURE__ */ a("span", { className: C.dot }),
768
+ /* @__PURE__ */ a("span", { className: C.dot })
769
+ ] }) : /* @__PURE__ */ a("div", { className: `${C.spinner} ${C[e]} ${s}`, role: "status", children: /* @__PURE__ */ a("span", { className: C.visuallyHidden, children: "Loading..." }) });
756
770
  export {
757
- As as AllyCodeDropdown,
758
- gt as ApiClient,
759
- ws as AuthProvider,
760
- xs as Badge,
761
- M as Button,
762
- Ss as Card,
763
- vs as Container,
764
- bs as Footer,
765
- ne as Input,
766
- Cs as Loader,
767
- Ts as Modal,
768
- le as Select,
769
- $s as TopBar,
770
- y as apiClient,
771
- bt as clearAllyCodes,
772
- ee as clearTokens,
773
- J as formatAllyCode,
774
- ce as getAccessToken,
771
+ Cs as AllyCodeDropdown,
772
+ vt as ApiClient,
773
+ xs as AuthProvider,
774
+ Es as Badge,
775
+ H as Button,
776
+ ks as Card,
777
+ Ns as Container,
778
+ Ss as Footer,
779
+ ce as Input,
780
+ Ws as Loader,
781
+ Ls as Modal,
782
+ ie as Select,
783
+ As as TopBar,
784
+ v as apiClient,
785
+ St as clearAllyCodes,
786
+ se as clearTokens,
787
+ Y as formatAllyCode,
788
+ de as getAccessToken,
775
789
  A as getAllyCodesFromStorage,
776
- _t as getRefreshToken,
777
- vt as getSelectedAllyCode,
778
- ft as initializeApiClient,
779
- ht as isAuthenticated,
780
- dt as removeAccessToken,
781
- yt as removeAllyCodeFromStorage,
782
- ut as removeRefreshToken,
783
- pt as saveAllyCodeToStorage,
784
- it as setAccessToken,
785
- mt as setRefreshToken,
786
- $t as setSelectedAllyCode,
787
- ie as setTokens,
788
- Ns as unformatAllyCode,
789
- re as updateAllyCodeLastUsed,
790
- wt as useAuth
790
+ gt as getRefreshToken,
791
+ Nt as getSelectedAllyCode,
792
+ bt as initializeApiClient,
793
+ pt as isAuthenticated,
794
+ ht as removeAccessToken,
795
+ wt as removeAllyCodeFromStorage,
796
+ yt as removeRefreshToken,
797
+ $t as saveAllyCodeToStorage,
798
+ ut as setAccessToken,
799
+ ft as setRefreshToken,
800
+ At as setSelectedAllyCode,
801
+ _e as setTokens,
802
+ Ts as unformatAllyCode,
803
+ ne as updateAllyCodeLastUsed,
804
+ xt as useAuth
791
805
  };