@tailor-platform/app-shell 0.20.1 → 0.21.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/app-shell.css +1 -1
- package/dist/app-shell.js +569 -523
- package/dist/index.d.ts +44 -15
- package/package.json +1 -1
package/dist/app-shell.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { capitalCase as
|
|
12
|
-
import { Toaster as
|
|
13
|
-
import * as
|
|
1
|
+
import { jsx as a, jsxs as l, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import * as v from "react";
|
|
3
|
+
import { createContext as j, useContext as K, useState as S, useMemo as I, useEffect as N, Suspense as rt, useRef as Rt, useCallback as q } from "react";
|
|
4
|
+
import { useRouteError as Et, isRouteErrorResponse as Pt, Outlet as U, NavLink as Bt, redirect as nt, Navigate as Lt, useRouteLoaderData as At, createMemoryRouter as Dt, createBrowserRouter as It, RouterProvider as Mt, useHref as _t, Link as zt, useLocation as ot, useMatch as Ot, Await as it, useNavigate as $t } from "react-router";
|
|
5
|
+
import { Link as Ea, useLocation as Pa, useNavigate as Ba, useParams as La, useRouteError as Aa, useSearchParams as Da } from "react-router";
|
|
6
|
+
import { Slot as B } from "@radix-ui/react-slot";
|
|
7
|
+
import { cva as lt } from "class-variance-authority";
|
|
8
|
+
import { clsx as jt } from "clsx";
|
|
9
|
+
import { twMerge as Kt } from "tailwind-merge";
|
|
10
|
+
import { AlertCircle as G, Table as Ut, XIcon as dt, PanelLeftIcon as Ft, ChevronRight as z, SunIcon as Wt, SearchIcon as Ht } from "lucide-react";
|
|
11
|
+
import { capitalCase as E } from "change-case";
|
|
12
|
+
import { Toaster as Qt } from "sonner";
|
|
13
|
+
import * as F from "@radix-ui/react-collapsible";
|
|
14
14
|
import "@radix-ui/react-separator";
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
17
|
-
import { print as
|
|
18
|
-
import { createAuthClient as
|
|
15
|
+
import * as p from "@radix-ui/react-dialog";
|
|
16
|
+
import * as T from "@radix-ui/react-tooltip";
|
|
17
|
+
import { print as Vt } from "graphql";
|
|
18
|
+
import { createAuthClient as qt } from "@tailor-platform/auth-browser-client";
|
|
19
19
|
function u(...t) {
|
|
20
|
-
return
|
|
20
|
+
return Kt(jt(t));
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const Gt = lt(
|
|
23
23
|
"astw:inline-flex astw:items-center astw:justify-center astw:gap-2 astw:whitespace-nowrap astw:rounded-md astw:text-sm astw:font-medium astw:transition-all astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:[&_svg]:pointer-events-none astw:[&_svg:not([class*='size-'])]:size-4 astw:shrink-0 astw:[&_svg]:shrink-0 astw:outline-none astw:focus-visible:border-ring astw:focus-visible:ring-ring/50 astw:focus-visible:ring-[3px] astw:aria-invalid:ring-destructive/20 astw:dark:aria-invalid:ring-destructive/40 astw:aria-invalid:border-destructive",
|
|
24
24
|
{
|
|
25
25
|
variants: {
|
|
@@ -44,7 +44,7 @@ const zt = it(
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
|
-
function
|
|
47
|
+
function P({
|
|
48
48
|
className: t,
|
|
49
49
|
variant: e,
|
|
50
50
|
size: s,
|
|
@@ -52,31 +52,31 @@ function L({
|
|
|
52
52
|
...n
|
|
53
53
|
}) {
|
|
54
54
|
return /* @__PURE__ */ a(
|
|
55
|
-
r ?
|
|
55
|
+
r ? B : "button",
|
|
56
56
|
{
|
|
57
57
|
"data-slot": "button",
|
|
58
|
-
className: u(
|
|
58
|
+
className: u(Gt({ variant: e, size: s, className: t })),
|
|
59
59
|
...n
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const D = "en", Xt = () => {
|
|
64
64
|
try {
|
|
65
65
|
if (typeof navigator > "u")
|
|
66
|
-
return
|
|
66
|
+
return D;
|
|
67
67
|
const t = navigator.languages?.[0] ?? navigator.language;
|
|
68
|
-
return t ? new Intl.Locale(t).language :
|
|
68
|
+
return t ? new Intl.Locale(t).language : D;
|
|
69
69
|
} catch {
|
|
70
|
-
return
|
|
70
|
+
return D;
|
|
71
71
|
}
|
|
72
|
-
},
|
|
73
|
-
const e =
|
|
74
|
-
return (s, r) => e(s, typeof s == "string" ? s :
|
|
75
|
-
},
|
|
76
|
-
const { configurations: t } =
|
|
72
|
+
}, W = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, ct = (t) => {
|
|
73
|
+
const e = W(t);
|
|
74
|
+
return (s, r) => e(s, typeof s == "string" ? s : E(r));
|
|
75
|
+
}, Yt = () => {
|
|
76
|
+
const { configurations: t } = C(), e = W(t.locale);
|
|
77
77
|
return (s, r) => e(s, r);
|
|
78
|
-
},
|
|
79
|
-
const e = (s) => (r) => t[s
|
|
78
|
+
}, Jt = (t) => {
|
|
79
|
+
const e = (s) => (r) => t[s]?.[r] ?? t.en[r];
|
|
80
80
|
return {
|
|
81
81
|
/**
|
|
82
82
|
* Hook to get the translated label resolver function.
|
|
@@ -98,10 +98,10 @@ const E = "en", Ot = () => {
|
|
|
98
98
|
* ```
|
|
99
99
|
*/
|
|
100
100
|
useT: () => {
|
|
101
|
-
const { configurations: s } =
|
|
101
|
+
const { configurations: s } = C(), r = e(s.locale);
|
|
102
102
|
return ((n, ...o) => {
|
|
103
|
-
const
|
|
104
|
-
return typeof
|
|
103
|
+
const i = r(n);
|
|
104
|
+
return typeof i == "function" ? i(o[0]) : i;
|
|
105
105
|
});
|
|
106
106
|
},
|
|
107
107
|
/**
|
|
@@ -131,7 +131,7 @@ const E = "en", Ot = () => {
|
|
|
131
131
|
return typeof o == "function" ? o(r[0]) : o;
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
|
-
},
|
|
134
|
+
}, Zt = Jt({
|
|
135
135
|
en: {
|
|
136
136
|
error404Title: "404 Not Found",
|
|
137
137
|
error404Body: "The page you requested could not be found.",
|
|
@@ -170,19 +170,19 @@ const E = "en", Ot = () => {
|
|
|
170
170
|
commandPaletteSearch: "ページを検索...",
|
|
171
171
|
commandPaletteNoResults: "結果が見つかりません"
|
|
172
172
|
}
|
|
173
|
-
}),
|
|
174
|
-
const t =
|
|
173
|
+
}), k = Zt.useT, L = () => {
|
|
174
|
+
const t = Et(), e = k(), s = {
|
|
175
175
|
role: "alert",
|
|
176
176
|
"aria-label": "default-error-boundary"
|
|
177
177
|
};
|
|
178
|
-
if (
|
|
179
|
-
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */ a(
|
|
181
|
-
/* @__PURE__ */
|
|
178
|
+
if (Pt(t) && t.status === 404)
|
|
179
|
+
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
180
|
+
/* @__PURE__ */ a(G, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
181
|
+
/* @__PURE__ */ l("div", { children: [
|
|
182
182
|
/* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("error404Title") }),
|
|
183
183
|
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: e("error404Body") }),
|
|
184
184
|
/* @__PURE__ */ a(
|
|
185
|
-
|
|
185
|
+
P,
|
|
186
186
|
{
|
|
187
187
|
variant: "outline",
|
|
188
188
|
size: "sm",
|
|
@@ -194,13 +194,13 @@ const E = "en", Ot = () => {
|
|
|
194
194
|
] })
|
|
195
195
|
] }) });
|
|
196
196
|
const r = t instanceof Error ? t.message : e("errorUnexpected");
|
|
197
|
-
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */
|
|
198
|
-
/* @__PURE__ */ a(
|
|
199
|
-
/* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
198
|
+
/* @__PURE__ */ a(G, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
199
|
+
/* @__PURE__ */ l("div", { children: [
|
|
200
200
|
/* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("errorTitle") }),
|
|
201
201
|
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: r }),
|
|
202
202
|
/* @__PURE__ */ a(
|
|
203
|
-
|
|
203
|
+
P,
|
|
204
204
|
{
|
|
205
205
|
variant: "outline",
|
|
206
206
|
size: "sm",
|
|
@@ -211,36 +211,35 @@ const E = "en", Ot = () => {
|
|
|
211
211
|
)
|
|
212
212
|
] })
|
|
213
213
|
] }) });
|
|
214
|
-
},
|
|
214
|
+
}, te = (t) => ({
|
|
215
215
|
modules: t.modules,
|
|
216
216
|
settingsResources: t.settingsResources ?? [],
|
|
217
|
-
errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(
|
|
217
|
+
errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(L, {}),
|
|
218
218
|
basePath: t.basePath,
|
|
219
|
-
locale: t.locale ??
|
|
220
|
-
}),
|
|
221
|
-
navItems: [],
|
|
219
|
+
locale: t.locale ?? Xt()
|
|
220
|
+
}), wt = j({
|
|
222
221
|
configurations: {
|
|
223
222
|
modules: [],
|
|
224
223
|
settingsResources: [],
|
|
225
|
-
errorBoundary: /* @__PURE__ */ a(
|
|
226
|
-
locale:
|
|
224
|
+
errorBoundary: /* @__PURE__ */ a(L, {}),
|
|
225
|
+
locale: D
|
|
227
226
|
}
|
|
228
|
-
}),
|
|
229
|
-
const t =
|
|
230
|
-
return /* @__PURE__ */
|
|
227
|
+
}), C = () => K(wt), ee = () => {
|
|
228
|
+
const t = k();
|
|
229
|
+
return /* @__PURE__ */ l(R, { children: [
|
|
231
230
|
/* @__PURE__ */ a("p", { className: "astw:font-semibold astw:leading-none astw:tracking-tight", children: t("welcomeTitle") }),
|
|
232
231
|
/* @__PURE__ */ a("p", { className: "pt-4", children: t("welcomeBody") })
|
|
233
232
|
] });
|
|
234
|
-
}, X = () => /* @__PURE__ */
|
|
235
|
-
/* @__PURE__ */ a(
|
|
236
|
-
/* @__PURE__ */ a(
|
|
237
|
-
] }),
|
|
238
|
-
const { configurations: t } =
|
|
239
|
-
return /* @__PURE__ */
|
|
240
|
-
/* @__PURE__ */ a("div", { children: /* @__PURE__ */
|
|
233
|
+
}, X = () => /* @__PURE__ */ l(R, { children: [
|
|
234
|
+
/* @__PURE__ */ a(U, {}),
|
|
235
|
+
/* @__PURE__ */ a(Qt, {})
|
|
236
|
+
] }), ae = () => {
|
|
237
|
+
const { configurations: t } = C(), e = k(), s = Yt();
|
|
238
|
+
return /* @__PURE__ */ l("div", { className: "astw:mx-auto astw:flex-col astw:flex astw:md:flex-row astw:max-w-5xl astw:gap-[10px] astw:w-full", children: [
|
|
239
|
+
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ l("nav", { className: "astw:bg-card astw:md:w-xs astw:rounded-md astw:border astw:p-3 astw:shadow-xs", children: [
|
|
241
240
|
/* @__PURE__ */ a("h2", { className: "astw:text-sm astw:leading-[36px] astw:mb-2 astw:font-bold ", children: e("settings") }),
|
|
242
|
-
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
|
|
243
|
-
|
|
241
|
+
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(Bt, { to: `./${r.path}`, children: ({ isActive: n }) => /* @__PURE__ */ l(
|
|
242
|
+
P,
|
|
244
243
|
{
|
|
245
244
|
variant: n ? "secondary" : "ghost",
|
|
246
245
|
className: "astw:w-full astw:justify-start",
|
|
@@ -251,69 +250,89 @@ const E = "en", Ot = () => {
|
|
|
251
250
|
}
|
|
252
251
|
) }) }, r.path)) })
|
|
253
252
|
] }) }),
|
|
254
|
-
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(
|
|
253
|
+
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(U, {}) })
|
|
255
254
|
] });
|
|
255
|
+
}, ut = () => new Response("Not Found", { status: 404 }), H = async (t, e) => {
|
|
256
|
+
if (!t) return { state: "visible" };
|
|
257
|
+
const s = new URL(e.request.url);
|
|
258
|
+
return await t({
|
|
259
|
+
params: e.params,
|
|
260
|
+
searchParams: s.searchParams,
|
|
261
|
+
signal: e.request.signal
|
|
262
|
+
}) ?? { state: "visible" };
|
|
263
|
+
}, mt = (t, e) => async (s) => {
|
|
264
|
+
switch ((await H(t, s)).state) {
|
|
265
|
+
case "hidden":
|
|
266
|
+
throw ut();
|
|
267
|
+
case "visible":
|
|
268
|
+
return e ? e(s) : null;
|
|
269
|
+
}
|
|
256
270
|
};
|
|
257
|
-
function
|
|
271
|
+
function pa(t) {
|
|
258
272
|
return {
|
|
259
273
|
redirectTo: t
|
|
260
274
|
};
|
|
261
275
|
}
|
|
262
|
-
function
|
|
276
|
+
function O(t) {
|
|
263
277
|
return typeof t == "object" && t !== null && "redirectTo" in t;
|
|
264
278
|
}
|
|
265
|
-
const
|
|
266
|
-
const { configurations: s } =
|
|
267
|
-
return e(
|
|
279
|
+
const ht = (t, e) => () => {
|
|
280
|
+
const { configurations: s } = C(), { metaTitle: r, fallbackTitle: n } = t, i = W(s.locale)(r, n);
|
|
281
|
+
return e(i);
|
|
268
282
|
};
|
|
269
|
-
function
|
|
270
|
-
const { path: e, meta: s, component: r, resources: n, errorBoundary: o } = t,
|
|
283
|
+
function va(t) {
|
|
284
|
+
const { path: e, meta: s, component: r, resources: n, errorBoundary: o, accessControl: i } = t, d = s?.title ?? E(e), w = E(e), c = O(r) ? {
|
|
271
285
|
// Use loader for redirects
|
|
272
286
|
component: () => null,
|
|
273
|
-
|
|
287
|
+
baseLoader: () => nt(r.redirectTo)
|
|
274
288
|
} : {
|
|
275
289
|
// Regular component with locale-aware title
|
|
276
|
-
component:
|
|
277
|
-
{ metaTitle:
|
|
278
|
-
(
|
|
279
|
-
)
|
|
280
|
-
|
|
290
|
+
component: ht(
|
|
291
|
+
{ metaTitle: d, fallbackTitle: w },
|
|
292
|
+
(b) => r({ title: b, resources: n })
|
|
293
|
+
),
|
|
294
|
+
baseLoader: void 0
|
|
295
|
+
}, h = i || c.baseLoader ? mt(i, c.baseLoader) : void 0;
|
|
281
296
|
return {
|
|
282
297
|
path: e,
|
|
283
298
|
type: "component",
|
|
284
299
|
_type: "module",
|
|
285
|
-
|
|
300
|
+
component: c.component,
|
|
301
|
+
loader: h,
|
|
286
302
|
meta: {
|
|
287
|
-
title:
|
|
303
|
+
title: d,
|
|
288
304
|
...s?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: s.breadcrumbTitle } : {},
|
|
289
305
|
...s,
|
|
290
|
-
menuItemClickable:
|
|
306
|
+
menuItemClickable: !O(r),
|
|
291
307
|
icon: t.meta?.icon
|
|
292
308
|
},
|
|
293
309
|
resources: n,
|
|
294
|
-
errorBoundary: o || /* @__PURE__ */ a(
|
|
310
|
+
errorBoundary: o || /* @__PURE__ */ a(L, {}),
|
|
311
|
+
accessControl: i
|
|
295
312
|
};
|
|
296
313
|
}
|
|
297
|
-
function
|
|
298
|
-
const { path: e, component: s, subResources: r, meta: n, errorBoundary: o } = t,
|
|
314
|
+
function xa(t) {
|
|
315
|
+
const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, accessControl: i } = t, d = n?.title ?? E(e), w = E(e), c = i ? mt(i) : void 0;
|
|
299
316
|
return {
|
|
300
317
|
_type: "resource",
|
|
301
318
|
type: "component",
|
|
302
319
|
path: e,
|
|
303
320
|
meta: {
|
|
304
|
-
title:
|
|
321
|
+
title: d,
|
|
305
322
|
icon: n?.icon,
|
|
306
323
|
...n?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: n.breadcrumbTitle } : {}
|
|
307
324
|
},
|
|
308
|
-
component:
|
|
309
|
-
{ metaTitle:
|
|
310
|
-
(
|
|
325
|
+
component: ht(
|
|
326
|
+
{ metaTitle: d, fallbackTitle: w },
|
|
327
|
+
(h) => s({ title: h, resources: r })
|
|
311
328
|
),
|
|
312
329
|
subResources: r,
|
|
313
|
-
errorBoundary: o ?? /* @__PURE__ */ a(
|
|
330
|
+
errorBoundary: o ?? /* @__PURE__ */ a(L, {}),
|
|
331
|
+
accessControl: i,
|
|
332
|
+
loader: c
|
|
314
333
|
};
|
|
315
334
|
}
|
|
316
|
-
const
|
|
335
|
+
const Q = (t) => () => /* @__PURE__ */ a(R, { children: t }), ft = (t, e, s) => {
|
|
317
336
|
const r = t.errorBoundary || s, n = {
|
|
318
337
|
index: !0,
|
|
319
338
|
Component: t.component,
|
|
@@ -322,38 +341,38 @@ const G = (t) => () => /* @__PURE__ */ a(B, { children: t }), ct = (t, e, s) =>
|
|
|
322
341
|
return {
|
|
323
342
|
path: t.path,
|
|
324
343
|
...t.errorBoundary && {
|
|
325
|
-
ErrorBoundary:
|
|
344
|
+
ErrorBoundary: Q(t.errorBoundary)
|
|
326
345
|
},
|
|
327
346
|
...e && e.length > 0 ? {
|
|
328
347
|
children: [
|
|
329
348
|
n,
|
|
330
349
|
...e.map(
|
|
331
|
-
(o) =>
|
|
350
|
+
(o) => ft(o, o.subResources, r)
|
|
332
351
|
)
|
|
333
352
|
]
|
|
334
353
|
} : {
|
|
335
354
|
children: [n]
|
|
336
355
|
}
|
|
337
356
|
};
|
|
338
|
-
},
|
|
339
|
-
(e) =>
|
|
340
|
-
),
|
|
357
|
+
}, se = (t) => t.map(
|
|
358
|
+
(e) => ft(e, e.resources, e.errorBoundary)
|
|
359
|
+
), re = ({
|
|
341
360
|
modules: t,
|
|
342
361
|
settingsResources: e,
|
|
343
362
|
rootComponent: s
|
|
344
363
|
}) => {
|
|
345
|
-
const r =
|
|
364
|
+
const r = O(s) ? {
|
|
346
365
|
index: !0,
|
|
347
366
|
loader: () => nt(s.redirectTo)
|
|
348
367
|
} : {
|
|
349
368
|
index: !0,
|
|
350
|
-
Component: s ??
|
|
369
|
+
Component: s ?? ee
|
|
351
370
|
}, n = e.length > 0 ? [
|
|
352
371
|
{
|
|
353
372
|
path: "settings",
|
|
354
373
|
index: !0,
|
|
355
374
|
Component: () => /* @__PURE__ */ a(
|
|
356
|
-
|
|
375
|
+
Lt,
|
|
357
376
|
{
|
|
358
377
|
to: e[0].path,
|
|
359
378
|
relative: "path",
|
|
@@ -363,12 +382,12 @@ const G = (t) => () => /* @__PURE__ */ a(B, { children: t }), ct = (t, e, s) =>
|
|
|
363
382
|
},
|
|
364
383
|
{
|
|
365
384
|
path: "settings",
|
|
366
|
-
Component:
|
|
385
|
+
Component: ae,
|
|
367
386
|
children: e.map((o) => ({
|
|
368
387
|
path: o.path,
|
|
369
388
|
Component: o.component,
|
|
370
389
|
...o.errorBoundary && {
|
|
371
|
-
ErrorBoundary:
|
|
390
|
+
ErrorBoundary: Q(o.errorBoundary)
|
|
372
391
|
}
|
|
373
392
|
}))
|
|
374
393
|
}
|
|
@@ -376,146 +395,178 @@ const G = (t) => () => /* @__PURE__ */ a(B, { children: t }), ct = (t, e, s) =>
|
|
|
376
395
|
return [
|
|
377
396
|
r,
|
|
378
397
|
{
|
|
379
|
-
children:
|
|
398
|
+
children: se(t)
|
|
380
399
|
},
|
|
381
400
|
...n,
|
|
382
401
|
{
|
|
383
402
|
path: "*",
|
|
384
403
|
loader: () => {
|
|
385
|
-
throw
|
|
386
|
-
}
|
|
404
|
+
throw ut();
|
|
405
|
+
},
|
|
406
|
+
// Component is required to suppress React Router's warning about empty leaf routes,
|
|
407
|
+
// even though the loader always throws and this component will never render.
|
|
408
|
+
Component: () => null,
|
|
409
|
+
ErrorBoundary: L
|
|
387
410
|
}
|
|
388
411
|
];
|
|
389
|
-
},
|
|
390
|
-
|
|
412
|
+
}, bt = "appshell-root-nav", ne = (t) => ({
|
|
413
|
+
loaderID: bt,
|
|
414
|
+
loader: async (e) => ({ navItems: oe(t, e) })
|
|
415
|
+
}), gt = () => At(bt)?.navItems, oe = async (t, e) => {
|
|
416
|
+
const s = ct(t.locale);
|
|
417
|
+
return (await Promise.all(
|
|
418
|
+
t.modules.map(async (n) => {
|
|
419
|
+
if (n.path.startsWith(":") || (await H(n.accessControl, e)).state !== "visible") return null;
|
|
420
|
+
const i = await pt(
|
|
421
|
+
n.resources,
|
|
422
|
+
n.path,
|
|
423
|
+
e,
|
|
424
|
+
s
|
|
425
|
+
);
|
|
426
|
+
return i.length === 0 ? null : { module: n, resources: i };
|
|
427
|
+
})
|
|
428
|
+
)).filter((n) => n !== null).map(({ module: n, resources: o }) => ({
|
|
429
|
+
title: s(n.meta.title, n.path),
|
|
430
|
+
url: n.meta.menuItemClickable ? n.path : void 0,
|
|
431
|
+
icon: n.meta.icon || /* @__PURE__ */ a(Ut, {}),
|
|
432
|
+
items: o
|
|
433
|
+
}));
|
|
434
|
+
}, pt = async (t, e, s, r) => (await Promise.all(
|
|
435
|
+
t.map(async (o) => {
|
|
436
|
+
if (o.path.startsWith(":") || (await H(o.accessControl, s)).state !== "visible") return null;
|
|
437
|
+
const d = `${e}/${o.path}`, w = r(o.meta.title, o.path), c = o.subResources ? await pt(
|
|
438
|
+
o.subResources,
|
|
439
|
+
d,
|
|
440
|
+
s,
|
|
441
|
+
r
|
|
442
|
+
) : void 0;
|
|
443
|
+
return {
|
|
444
|
+
title: w,
|
|
445
|
+
url: d,
|
|
446
|
+
items: c && c.length > 0 ? c : void 0
|
|
447
|
+
};
|
|
448
|
+
})
|
|
449
|
+
)).filter((o) => o !== null), ie = (t) => {
|
|
450
|
+
const { configurations: e } = C(), { rootComponent: s, children: r } = t, n = re({
|
|
391
451
|
modules: e.modules,
|
|
392
452
|
settingsResources: e.settingsResources,
|
|
393
453
|
rootComponent: s
|
|
394
|
-
}), o = e.errorBoundary,
|
|
454
|
+
}), o = e.errorBoundary, { loaderID: i, loader: d } = ne({
|
|
455
|
+
modules: e.modules,
|
|
456
|
+
locale: e.locale
|
|
457
|
+
}), w = [
|
|
395
458
|
{
|
|
459
|
+
id: i,
|
|
460
|
+
loader: d,
|
|
396
461
|
element: r,
|
|
397
462
|
children: o ? [
|
|
398
463
|
{
|
|
399
|
-
element: /* @__PURE__ */ a(
|
|
400
|
-
ErrorBoundary:
|
|
464
|
+
element: /* @__PURE__ */ a(U, {}),
|
|
465
|
+
ErrorBoundary: Q(o),
|
|
401
466
|
children: n
|
|
402
467
|
}
|
|
403
|
-
] : n
|
|
468
|
+
] : n,
|
|
469
|
+
/*
|
|
470
|
+
* Hydration fallback is unused in CSR-only usage of AppShell.
|
|
471
|
+
* return null to silence hydration warnings.
|
|
472
|
+
*/
|
|
473
|
+
HydrateFallback: () => null
|
|
404
474
|
}
|
|
405
|
-
],
|
|
406
|
-
basename:
|
|
475
|
+
], c = e.basePath ? "/" + e.basePath : void 0, h = t.memory ? Dt(w, {
|
|
476
|
+
basename: c,
|
|
407
477
|
...t.initialEntries ? { initialEntries: t.initialEntries } : {}
|
|
408
|
-
}) :
|
|
409
|
-
basename:
|
|
478
|
+
}) : It(w, {
|
|
479
|
+
basename: c
|
|
410
480
|
});
|
|
411
|
-
return /* @__PURE__ */ a(
|
|
412
|
-
},
|
|
481
|
+
return /* @__PURE__ */ a(Mt, { router: h });
|
|
482
|
+
}, le = {
|
|
413
483
|
resolvedTheme: "light",
|
|
414
484
|
theme: "system",
|
|
415
485
|
setTheme: () => null
|
|
416
|
-
},
|
|
417
|
-
function
|
|
486
|
+
}, vt = j(le);
|
|
487
|
+
function de({
|
|
418
488
|
children: t,
|
|
419
489
|
storageKey: e,
|
|
420
490
|
defaultTheme: s = "system",
|
|
421
491
|
...r
|
|
422
492
|
}) {
|
|
423
|
-
const [n, o] =
|
|
493
|
+
const [n, o] = S(
|
|
424
494
|
() => localStorage.getItem(e) || s
|
|
425
|
-
),
|
|
426
|
-
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
}, [
|
|
495
|
+
), i = I(() => n !== "system" ? n : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [n]);
|
|
496
|
+
N(() => {
|
|
497
|
+
const w = window.document.documentElement;
|
|
498
|
+
w.classList.remove("light", "dark"), w.classList.add(i);
|
|
499
|
+
}, [i]);
|
|
430
500
|
const d = {
|
|
431
|
-
resolvedTheme:
|
|
501
|
+
resolvedTheme: i,
|
|
432
502
|
theme: n,
|
|
433
|
-
setTheme: (
|
|
434
|
-
localStorage.setItem(e,
|
|
503
|
+
setTheme: (w) => {
|
|
504
|
+
localStorage.setItem(e, w), o(w);
|
|
435
505
|
}
|
|
436
506
|
};
|
|
437
|
-
return /* @__PURE__ */ a(
|
|
507
|
+
return /* @__PURE__ */ a(vt.Provider, { ...r, value: d, children: t });
|
|
438
508
|
}
|
|
439
|
-
const
|
|
440
|
-
const t =
|
|
509
|
+
const ce = () => {
|
|
510
|
+
const t = K(vt);
|
|
441
511
|
if (t === void 0)
|
|
442
512
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
443
513
|
return t;
|
|
444
|
-
},
|
|
445
|
-
const [e, s] =
|
|
446
|
-
|
|
514
|
+
}, ya = (t) => {
|
|
515
|
+
const [e, s] = S(!1);
|
|
516
|
+
return N(function() {
|
|
447
517
|
s(!0);
|
|
448
|
-
}, [])
|
|
449
|
-
|
|
450
|
-
const o = t.modules, l = Q(r.locale);
|
|
451
|
-
return o.map((d) => {
|
|
452
|
-
const i = l(d.meta.title, d.path), w = d.resources.map((m) => ({
|
|
453
|
-
title: l(m.meta.title, m.path),
|
|
454
|
-
url: `${d.path}/${m.path}`
|
|
455
|
-
}));
|
|
456
|
-
return {
|
|
457
|
-
title: i,
|
|
458
|
-
url: d.meta.menuItemClickable ? d.path : void 0,
|
|
459
|
-
clickable: d.component,
|
|
460
|
-
icon: d.meta.icon || /* @__PURE__ */ a(bt, {}),
|
|
461
|
-
isActive: !0,
|
|
462
|
-
items: w
|
|
463
|
-
};
|
|
464
|
-
});
|
|
465
|
-
}, [t.modules, r.locale]);
|
|
466
|
-
return e ? /* @__PURE__ */ a(
|
|
467
|
-
lt.Provider,
|
|
518
|
+
}, []), e ? /* @__PURE__ */ a(
|
|
519
|
+
wt.Provider,
|
|
468
520
|
{
|
|
469
521
|
value: {
|
|
470
522
|
title: t.title,
|
|
471
523
|
icon: t.icon,
|
|
472
|
-
configurations:
|
|
473
|
-
navItems: n
|
|
524
|
+
configurations: te(t)
|
|
474
525
|
},
|
|
475
|
-
children: /* @__PURE__ */ a(
|
|
526
|
+
children: /* @__PURE__ */ a(de, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(ie, { rootComponent: t.rootComponent, children: t.children }) })
|
|
476
527
|
}
|
|
477
528
|
) : null;
|
|
478
529
|
};
|
|
479
|
-
function
|
|
530
|
+
function we({
|
|
480
531
|
...t
|
|
481
532
|
}) {
|
|
482
|
-
return /* @__PURE__ */ a(
|
|
533
|
+
return /* @__PURE__ */ a(F.Root, { "data-slot": "collapsible", ...t });
|
|
483
534
|
}
|
|
484
535
|
function Y({
|
|
485
536
|
...t
|
|
486
537
|
}) {
|
|
487
538
|
return /* @__PURE__ */ a(
|
|
488
|
-
|
|
539
|
+
F.CollapsibleTrigger,
|
|
489
540
|
{
|
|
490
541
|
"data-slot": "collapsible-trigger",
|
|
491
542
|
...t
|
|
492
543
|
}
|
|
493
544
|
);
|
|
494
545
|
}
|
|
495
|
-
function
|
|
546
|
+
function ue({
|
|
496
547
|
...t
|
|
497
548
|
}) {
|
|
498
549
|
return /* @__PURE__ */ a(
|
|
499
|
-
|
|
550
|
+
F.CollapsibleContent,
|
|
500
551
|
{
|
|
501
552
|
"data-slot": "collapsible-content",
|
|
502
553
|
...t
|
|
503
554
|
}
|
|
504
555
|
);
|
|
505
556
|
}
|
|
506
|
-
const
|
|
507
|
-
function
|
|
508
|
-
const [t, e] =
|
|
557
|
+
const _ = 768;
|
|
558
|
+
function me() {
|
|
559
|
+
const [t, e] = v.useState(
|
|
509
560
|
void 0
|
|
510
561
|
);
|
|
511
|
-
return
|
|
512
|
-
const s = window.matchMedia(`(max-width: ${
|
|
513
|
-
e(window.innerWidth <
|
|
562
|
+
return v.useEffect(() => {
|
|
563
|
+
const s = window.matchMedia(`(max-width: ${_ - 1}px)`), r = () => {
|
|
564
|
+
e(window.innerWidth < _);
|
|
514
565
|
};
|
|
515
|
-
return s.addEventListener("change", r), e(window.innerWidth <
|
|
566
|
+
return s.addEventListener("change", r), e(window.innerWidth < _), () => s.removeEventListener("change", r);
|
|
516
567
|
}, []), !!t;
|
|
517
568
|
}
|
|
518
|
-
function
|
|
569
|
+
function he({ className: t, type: e, ...s }) {
|
|
519
570
|
return /* @__PURE__ */ a(
|
|
520
571
|
"input",
|
|
521
572
|
{
|
|
@@ -531,20 +582,20 @@ function te({ className: t, type: e, ...s }) {
|
|
|
531
582
|
}
|
|
532
583
|
);
|
|
533
584
|
}
|
|
534
|
-
function
|
|
535
|
-
return /* @__PURE__ */ a(
|
|
585
|
+
function fe({ ...t }) {
|
|
586
|
+
return /* @__PURE__ */ a(p.Root, { "data-slot": "sheet", ...t });
|
|
536
587
|
}
|
|
537
|
-
function
|
|
588
|
+
function be({
|
|
538
589
|
...t
|
|
539
590
|
}) {
|
|
540
|
-
return /* @__PURE__ */ a(
|
|
591
|
+
return /* @__PURE__ */ a(p.Portal, { "data-slot": "sheet-portal", ...t });
|
|
541
592
|
}
|
|
542
|
-
function
|
|
593
|
+
function ge({
|
|
543
594
|
className: t,
|
|
544
595
|
...e
|
|
545
596
|
}) {
|
|
546
597
|
return /* @__PURE__ */ a(
|
|
547
|
-
|
|
598
|
+
p.Overlay,
|
|
548
599
|
{
|
|
549
600
|
"data-slot": "sheet-overlay",
|
|
550
601
|
className: u(
|
|
@@ -555,16 +606,16 @@ function se({
|
|
|
555
606
|
}
|
|
556
607
|
);
|
|
557
608
|
}
|
|
558
|
-
function
|
|
609
|
+
function pe({
|
|
559
610
|
className: t,
|
|
560
611
|
children: e,
|
|
561
612
|
side: s = "right",
|
|
562
613
|
...r
|
|
563
614
|
}) {
|
|
564
|
-
return /* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */ a(
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
-
|
|
615
|
+
return /* @__PURE__ */ l(be, { children: [
|
|
616
|
+
/* @__PURE__ */ a(ge, {}),
|
|
617
|
+
/* @__PURE__ */ l(
|
|
618
|
+
p.Content,
|
|
568
619
|
{
|
|
569
620
|
"data-slot": "sheet-content",
|
|
570
621
|
className: u(
|
|
@@ -578,8 +629,8 @@ function re({
|
|
|
578
629
|
...r,
|
|
579
630
|
children: [
|
|
580
631
|
e,
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
/* @__PURE__ */ a(
|
|
632
|
+
/* @__PURE__ */ l(p.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-secondary astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none", children: [
|
|
633
|
+
/* @__PURE__ */ a(dt, { className: "astw:size-4" }),
|
|
583
634
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
584
635
|
] })
|
|
585
636
|
]
|
|
@@ -587,7 +638,7 @@ function re({
|
|
|
587
638
|
)
|
|
588
639
|
] });
|
|
589
640
|
}
|
|
590
|
-
function
|
|
641
|
+
function ve({ className: t, ...e }) {
|
|
591
642
|
return /* @__PURE__ */ a(
|
|
592
643
|
"div",
|
|
593
644
|
{
|
|
@@ -597,12 +648,12 @@ function ne({ className: t, ...e }) {
|
|
|
597
648
|
}
|
|
598
649
|
);
|
|
599
650
|
}
|
|
600
|
-
function
|
|
651
|
+
function xe({
|
|
601
652
|
className: t,
|
|
602
653
|
...e
|
|
603
654
|
}) {
|
|
604
655
|
return /* @__PURE__ */ a(
|
|
605
|
-
|
|
656
|
+
p.Title,
|
|
606
657
|
{
|
|
607
658
|
"data-slot": "sheet-title",
|
|
608
659
|
className: u("astw:text-foreground astw:font-semibold", t),
|
|
@@ -610,12 +661,12 @@ function oe({
|
|
|
610
661
|
}
|
|
611
662
|
);
|
|
612
663
|
}
|
|
613
|
-
function
|
|
664
|
+
function ye({
|
|
614
665
|
className: t,
|
|
615
666
|
...e
|
|
616
667
|
}) {
|
|
617
668
|
return /* @__PURE__ */ a(
|
|
618
|
-
|
|
669
|
+
p.Description,
|
|
619
670
|
{
|
|
620
671
|
"data-slot": "sheet-description",
|
|
621
672
|
className: u("astw:text-muted-foreground astw:text-sm", t),
|
|
@@ -623,12 +674,12 @@ function ie({
|
|
|
623
674
|
}
|
|
624
675
|
);
|
|
625
676
|
}
|
|
626
|
-
function
|
|
677
|
+
function xt({
|
|
627
678
|
delayDuration: t = 0,
|
|
628
679
|
...e
|
|
629
680
|
}) {
|
|
630
681
|
return /* @__PURE__ */ a(
|
|
631
|
-
|
|
682
|
+
T.Provider,
|
|
632
683
|
{
|
|
633
684
|
"data-slot": "tooltip-provider",
|
|
634
685
|
delayDuration: t,
|
|
@@ -636,24 +687,24 @@ function ut({
|
|
|
636
687
|
}
|
|
637
688
|
);
|
|
638
689
|
}
|
|
639
|
-
function
|
|
690
|
+
function Ne({
|
|
640
691
|
...t
|
|
641
692
|
}) {
|
|
642
|
-
return /* @__PURE__ */ a(
|
|
693
|
+
return /* @__PURE__ */ a(xt, { children: /* @__PURE__ */ a(T.Root, { "data-slot": "tooltip", ...t }) });
|
|
643
694
|
}
|
|
644
|
-
function
|
|
695
|
+
function Ce({
|
|
645
696
|
...t
|
|
646
697
|
}) {
|
|
647
|
-
return /* @__PURE__ */ a(
|
|
698
|
+
return /* @__PURE__ */ a(T.Trigger, { "data-slot": "tooltip-trigger", ...t });
|
|
648
699
|
}
|
|
649
|
-
function
|
|
700
|
+
function Se({
|
|
650
701
|
className: t,
|
|
651
702
|
sideOffset: e = 0,
|
|
652
703
|
children: s,
|
|
653
704
|
...r
|
|
654
705
|
}) {
|
|
655
|
-
return /* @__PURE__ */ a(
|
|
656
|
-
|
|
706
|
+
return /* @__PURE__ */ a(T.Portal, { children: /* @__PURE__ */ l(
|
|
707
|
+
T.Content,
|
|
657
708
|
{
|
|
658
709
|
"data-slot": "tooltip-content",
|
|
659
710
|
sideOffset: e,
|
|
@@ -664,71 +715,71 @@ function ce({
|
|
|
664
715
|
...r,
|
|
665
716
|
children: [
|
|
666
717
|
s,
|
|
667
|
-
/* @__PURE__ */ a(
|
|
718
|
+
/* @__PURE__ */ a(T.Arrow, { className: "astw:bg-primary astw:fill-primary astw:z-50 astw:size-2.5 astw:translate-y-[calc(-50%_-_2px)] astw:rotate-45 astw:rounded-[2px]" })
|
|
668
719
|
]
|
|
669
720
|
}
|
|
670
721
|
) });
|
|
671
722
|
}
|
|
672
|
-
const
|
|
673
|
-
function
|
|
674
|
-
const t =
|
|
723
|
+
const Te = "sidebar_state", ke = 3600 * 24 * 7, Re = "16rem", Ee = "18rem", Pe = "3rem", Be = "b", yt = v.createContext(null);
|
|
724
|
+
function M() {
|
|
725
|
+
const t = v.useContext(yt);
|
|
675
726
|
if (!t)
|
|
676
727
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
677
728
|
return t;
|
|
678
729
|
}
|
|
679
|
-
function
|
|
730
|
+
function Le({
|
|
680
731
|
defaultOpen: t = !0,
|
|
681
732
|
open: e,
|
|
682
733
|
onOpenChange: s,
|
|
683
734
|
className: r,
|
|
684
735
|
style: n,
|
|
685
736
|
children: o,
|
|
686
|
-
...
|
|
737
|
+
...i
|
|
687
738
|
}) {
|
|
688
|
-
const d =
|
|
689
|
-
(
|
|
690
|
-
const
|
|
691
|
-
s ? s(
|
|
739
|
+
const d = me(), [w, c] = v.useState(!1), [h, b] = v.useState(t), m = e ?? h, f = v.useCallback(
|
|
740
|
+
(g) => {
|
|
741
|
+
const y = typeof g == "function" ? g(m) : g;
|
|
742
|
+
s ? s(y) : b(y), document.cookie = `${Te}=${y}; path=/; max-age=${ke}`;
|
|
692
743
|
},
|
|
693
|
-
[s,
|
|
694
|
-
),
|
|
695
|
-
|
|
696
|
-
const
|
|
697
|
-
|
|
744
|
+
[s, m]
|
|
745
|
+
), x = v.useCallback(() => d ? c((g) => !g) : f((g) => !g), [d, f, c]);
|
|
746
|
+
v.useEffect(() => {
|
|
747
|
+
const g = (y) => {
|
|
748
|
+
y.key === Be && (y.metaKey || y.ctrlKey) && (y.preventDefault(), x());
|
|
698
749
|
};
|
|
699
|
-
return window.addEventListener("keydown",
|
|
700
|
-
}, [
|
|
701
|
-
const
|
|
750
|
+
return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
|
|
751
|
+
}, [x]);
|
|
752
|
+
const A = m ? "expanded" : "collapsed", V = v.useMemo(
|
|
702
753
|
() => ({
|
|
703
|
-
state:
|
|
704
|
-
open:
|
|
705
|
-
setOpen:
|
|
754
|
+
state: A,
|
|
755
|
+
open: m,
|
|
756
|
+
setOpen: f,
|
|
706
757
|
isMobile: d,
|
|
707
|
-
openMobile:
|
|
708
|
-
setOpenMobile:
|
|
709
|
-
toggleSidebar:
|
|
758
|
+
openMobile: w,
|
|
759
|
+
setOpenMobile: c,
|
|
760
|
+
toggleSidebar: x
|
|
710
761
|
}),
|
|
711
|
-
[
|
|
762
|
+
[A, m, f, d, w, c, x]
|
|
712
763
|
);
|
|
713
|
-
return /* @__PURE__ */ a(
|
|
764
|
+
return /* @__PURE__ */ a(yt.Provider, { value: V, children: /* @__PURE__ */ a(xt, { delayDuration: 0, children: /* @__PURE__ */ a(
|
|
714
765
|
"div",
|
|
715
766
|
{
|
|
716
767
|
"data-slot": "sidebar-wrapper",
|
|
717
768
|
style: {
|
|
718
|
-
"--sidebar-width":
|
|
719
|
-
"--sidebar-width-icon":
|
|
769
|
+
"--sidebar-width": Re,
|
|
770
|
+
"--sidebar-width-icon": Pe,
|
|
720
771
|
...n
|
|
721
772
|
},
|
|
722
773
|
className: u(
|
|
723
774
|
"astw:group/sidebar-wrapper astw:has-data-[variant=inset]:bg-sidebar astw:flex astw:min-h-svh astw:w-full",
|
|
724
775
|
r
|
|
725
776
|
),
|
|
726
|
-
...
|
|
777
|
+
...i,
|
|
727
778
|
children: o
|
|
728
779
|
}
|
|
729
780
|
) }) });
|
|
730
781
|
}
|
|
731
|
-
function
|
|
782
|
+
function Ae({
|
|
732
783
|
side: t = "left",
|
|
733
784
|
variant: e = "sidebar",
|
|
734
785
|
collapsible: s = "offcanvas",
|
|
@@ -736,7 +787,7 @@ function pe({
|
|
|
736
787
|
children: n,
|
|
737
788
|
...o
|
|
738
789
|
}) {
|
|
739
|
-
const { isMobile:
|
|
790
|
+
const { isMobile: i, state: d, openMobile: w, setOpenMobile: c } = M();
|
|
740
791
|
return s === "none" ? /* @__PURE__ */ a(
|
|
741
792
|
"div",
|
|
742
793
|
{
|
|
@@ -748,26 +799,26 @@ function pe({
|
|
|
748
799
|
...o,
|
|
749
800
|
children: n
|
|
750
801
|
}
|
|
751
|
-
) :
|
|
752
|
-
|
|
802
|
+
) : i ? /* @__PURE__ */ a(fe, { open: w, onOpenChange: c, ...o, children: /* @__PURE__ */ l(
|
|
803
|
+
pe,
|
|
753
804
|
{
|
|
754
805
|
"data-sidebar": "sidebar",
|
|
755
806
|
"data-slot": "sidebar",
|
|
756
807
|
"data-mobile": "true",
|
|
757
808
|
className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
|
|
758
809
|
style: {
|
|
759
|
-
"--sidebar-width":
|
|
810
|
+
"--sidebar-width": Ee
|
|
760
811
|
},
|
|
761
812
|
side: t,
|
|
762
813
|
children: [
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
/* @__PURE__ */ a(
|
|
765
|
-
/* @__PURE__ */ a(
|
|
814
|
+
/* @__PURE__ */ l(ve, { className: "astw:sr-only", children: [
|
|
815
|
+
/* @__PURE__ */ a(xe, { children: "Sidebar" }),
|
|
816
|
+
/* @__PURE__ */ a(ye, { children: "Displays the mobile sidebar." })
|
|
766
817
|
] }),
|
|
767
818
|
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
|
|
768
819
|
]
|
|
769
820
|
}
|
|
770
|
-
) }) : /* @__PURE__ */
|
|
821
|
+
) }) : /* @__PURE__ */ l(
|
|
771
822
|
"div",
|
|
772
823
|
{
|
|
773
824
|
className: "astw:group astw:peer astw:text-sidebar-foreground astw:hidden astw:md:block",
|
|
@@ -817,14 +868,14 @@ function pe({
|
|
|
817
868
|
}
|
|
818
869
|
);
|
|
819
870
|
}
|
|
820
|
-
function
|
|
871
|
+
function Nt({
|
|
821
872
|
className: t,
|
|
822
873
|
onClick: e,
|
|
823
874
|
...s
|
|
824
875
|
}) {
|
|
825
|
-
const { toggleSidebar: r } =
|
|
826
|
-
return /* @__PURE__ */
|
|
827
|
-
|
|
876
|
+
const { toggleSidebar: r } = M();
|
|
877
|
+
return /* @__PURE__ */ l(
|
|
878
|
+
P,
|
|
828
879
|
{
|
|
829
880
|
"data-sidebar": "trigger",
|
|
830
881
|
"data-slot": "sidebar-trigger",
|
|
@@ -836,13 +887,13 @@ function ht({
|
|
|
836
887
|
},
|
|
837
888
|
...s,
|
|
838
889
|
children: [
|
|
839
|
-
/* @__PURE__ */ a(
|
|
890
|
+
/* @__PURE__ */ a(Ft, { className: "astw:size-4.5" }),
|
|
840
891
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Toggle Sidebar" })
|
|
841
892
|
]
|
|
842
893
|
}
|
|
843
894
|
);
|
|
844
895
|
}
|
|
845
|
-
function
|
|
896
|
+
function De({ className: t, ...e }) {
|
|
846
897
|
return /* @__PURE__ */ a(
|
|
847
898
|
"main",
|
|
848
899
|
{
|
|
@@ -857,7 +908,7 @@ function ve({ className: t, ...e }) {
|
|
|
857
908
|
}
|
|
858
909
|
);
|
|
859
910
|
}
|
|
860
|
-
function
|
|
911
|
+
function Ie({ className: t, ...e }) {
|
|
861
912
|
return /* @__PURE__ */ a(
|
|
862
913
|
"div",
|
|
863
914
|
{
|
|
@@ -868,7 +919,7 @@ function xe({ className: t, ...e }) {
|
|
|
868
919
|
}
|
|
869
920
|
);
|
|
870
921
|
}
|
|
871
|
-
function
|
|
922
|
+
function Me({ className: t, ...e }) {
|
|
872
923
|
return /* @__PURE__ */ a(
|
|
873
924
|
"div",
|
|
874
925
|
{
|
|
@@ -882,7 +933,7 @@ function ye({ className: t, ...e }) {
|
|
|
882
933
|
}
|
|
883
934
|
);
|
|
884
935
|
}
|
|
885
|
-
function
|
|
936
|
+
function Ct({ className: t, ...e }) {
|
|
886
937
|
return /* @__PURE__ */ a(
|
|
887
938
|
"div",
|
|
888
939
|
{
|
|
@@ -893,7 +944,7 @@ function Ne({ className: t, ...e }) {
|
|
|
893
944
|
}
|
|
894
945
|
);
|
|
895
946
|
}
|
|
896
|
-
function
|
|
947
|
+
function St({ className: t, ...e }) {
|
|
897
948
|
return /* @__PURE__ */ a(
|
|
898
949
|
"ul",
|
|
899
950
|
{
|
|
@@ -904,7 +955,7 @@ function Ce({ className: t, ...e }) {
|
|
|
904
955
|
}
|
|
905
956
|
);
|
|
906
957
|
}
|
|
907
|
-
function
|
|
958
|
+
function Tt({ className: t, ...e }) {
|
|
908
959
|
return /* @__PURE__ */ a(
|
|
909
960
|
"li",
|
|
910
961
|
{
|
|
@@ -915,7 +966,7 @@ function Se({ className: t, ...e }) {
|
|
|
915
966
|
}
|
|
916
967
|
);
|
|
917
968
|
}
|
|
918
|
-
const
|
|
969
|
+
const _e = lt(
|
|
919
970
|
"astw:peer/menu-button astw:flex astw:w-full astw:items-center astw:gap-2 astw:overflow-hidden astw:rounded-md astw:p-2 astw:text-left astw:text-sm astw:outline-hidden astw:ring-sidebar-ring astw:transition-[width,height,padding] astw:hover:bg-sidebar-accent astw:hover:text-sidebar-accent-foreground astw:focus-visible:ring-2 astw:active:bg-sidebar-accent astw:active:text-sidebar-accent-foreground astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:group-has-data-[sidebar=menu-action]/menu-item:pr-8 astw:aria-disabled:pointer-events-none astw:aria-disabled:opacity-50 astw:data-[active=true]:bg-sidebar-accent astw:data-[active=true]:font-medium astw:data-[active=true]:text-sidebar-accent-foreground astw:data-[state=open]:hover:bg-sidebar-accent astw:data-[state=open]:hover:text-sidebar-accent-foreground astw:group-data-[collapsible=icon]:size-8! astw:group-data-[collapsible=icon]:p-2! astw:[&>span:last-child]:truncate astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
|
|
920
971
|
{
|
|
921
972
|
variants: {
|
|
@@ -942,33 +993,33 @@ function J({
|
|
|
942
993
|
size: r = "default",
|
|
943
994
|
tooltip: n,
|
|
944
995
|
className: o,
|
|
945
|
-
...
|
|
996
|
+
...i
|
|
946
997
|
}) {
|
|
947
|
-
const d = t ?
|
|
998
|
+
const d = t ? B : "button", { isMobile: w, state: c } = M(), h = /* @__PURE__ */ a(
|
|
948
999
|
d,
|
|
949
1000
|
{
|
|
950
1001
|
"data-slot": "sidebar-menu-button",
|
|
951
1002
|
"data-sidebar": "menu-button",
|
|
952
1003
|
"data-size": r,
|
|
953
1004
|
"data-active": e,
|
|
954
|
-
className: u(
|
|
955
|
-
...
|
|
1005
|
+
className: u(_e({ variant: s, size: r }), o),
|
|
1006
|
+
...i
|
|
956
1007
|
}
|
|
957
1008
|
);
|
|
958
1009
|
return n ? (typeof n == "string" && (n = {
|
|
959
1010
|
children: n
|
|
960
|
-
}), /* @__PURE__ */
|
|
961
|
-
/* @__PURE__ */ a(
|
|
1011
|
+
}), /* @__PURE__ */ l(Ne, { children: [
|
|
1012
|
+
/* @__PURE__ */ a(Ce, { asChild: !0, children: h }),
|
|
962
1013
|
/* @__PURE__ */ a(
|
|
963
|
-
|
|
1014
|
+
Se,
|
|
964
1015
|
{
|
|
965
1016
|
side: "right",
|
|
966
1017
|
align: "center",
|
|
967
|
-
hidden:
|
|
1018
|
+
hidden: c !== "collapsed" || w,
|
|
968
1019
|
...n
|
|
969
1020
|
}
|
|
970
1021
|
)
|
|
971
|
-
] })) :
|
|
1022
|
+
] })) : h;
|
|
972
1023
|
}
|
|
973
1024
|
function Z({
|
|
974
1025
|
className: t,
|
|
@@ -977,7 +1028,7 @@ function Z({
|
|
|
977
1028
|
...r
|
|
978
1029
|
}) {
|
|
979
1030
|
return /* @__PURE__ */ a(
|
|
980
|
-
e ?
|
|
1031
|
+
e ? B : "button",
|
|
981
1032
|
{
|
|
982
1033
|
"data-slot": "sidebar-menu-action",
|
|
983
1034
|
"data-sidebar": "menu-action",
|
|
@@ -996,7 +1047,7 @@ function Z({
|
|
|
996
1047
|
}
|
|
997
1048
|
);
|
|
998
1049
|
}
|
|
999
|
-
function
|
|
1050
|
+
function ze({ className: t, ...e }) {
|
|
1000
1051
|
return /* @__PURE__ */ a(
|
|
1001
1052
|
"ul",
|
|
1002
1053
|
{
|
|
@@ -1011,7 +1062,7 @@ function ke({ className: t, ...e }) {
|
|
|
1011
1062
|
}
|
|
1012
1063
|
);
|
|
1013
1064
|
}
|
|
1014
|
-
function
|
|
1065
|
+
function Oe({
|
|
1015
1066
|
className: t,
|
|
1016
1067
|
...e
|
|
1017
1068
|
}) {
|
|
@@ -1025,7 +1076,7 @@ function Re({
|
|
|
1025
1076
|
}
|
|
1026
1077
|
);
|
|
1027
1078
|
}
|
|
1028
|
-
function
|
|
1079
|
+
function $e({
|
|
1029
1080
|
asChild: t = !1,
|
|
1030
1081
|
size: e = "md",
|
|
1031
1082
|
isActive: s = !1,
|
|
@@ -1033,7 +1084,7 @@ function Ee({
|
|
|
1033
1084
|
...n
|
|
1034
1085
|
}) {
|
|
1035
1086
|
return /* @__PURE__ */ a(
|
|
1036
|
-
t ?
|
|
1087
|
+
t ? B : "a",
|
|
1037
1088
|
{
|
|
1038
1089
|
"data-slot": "sidebar-menu-sub-button",
|
|
1039
1090
|
"data-sidebar": "menu-sub-button",
|
|
@@ -1051,9 +1102,9 @@ function Ee({
|
|
|
1051
1102
|
}
|
|
1052
1103
|
);
|
|
1053
1104
|
}
|
|
1054
|
-
function
|
|
1105
|
+
function $({ to: t, children: e, ...s }) {
|
|
1055
1106
|
try {
|
|
1056
|
-
return
|
|
1107
|
+
return _t(t), /* @__PURE__ */ a(zt, { to: t, ...s, children: e });
|
|
1057
1108
|
} catch {
|
|
1058
1109
|
return /* @__PURE__ */ a("a", { href: t, ...s, children: e });
|
|
1059
1110
|
}
|
|
@@ -1091,7 +1142,7 @@ function st({
|
|
|
1091
1142
|
...r
|
|
1092
1143
|
}) {
|
|
1093
1144
|
return /* @__PURE__ */ a(
|
|
1094
|
-
t ?
|
|
1145
|
+
t ? B : $,
|
|
1095
1146
|
{
|
|
1096
1147
|
"data-slot": "breadcrumb-link",
|
|
1097
1148
|
className: u("astw:hover:text-foreground astw:transition-colors", e),
|
|
@@ -1100,7 +1151,7 @@ function st({
|
|
|
1100
1151
|
}
|
|
1101
1152
|
);
|
|
1102
1153
|
}
|
|
1103
|
-
function
|
|
1154
|
+
function je({
|
|
1104
1155
|
children: t,
|
|
1105
1156
|
className: e,
|
|
1106
1157
|
...s
|
|
@@ -1117,41 +1168,15 @@ function Be({
|
|
|
1117
1168
|
}
|
|
1118
1169
|
);
|
|
1119
1170
|
}
|
|
1120
|
-
function
|
|
1121
|
-
const s = Q(e), r = [], n = (o, l, d) => {
|
|
1122
|
-
if (o.path.startsWith(":")) return;
|
|
1123
|
-
const i = `${l}/${o.path}`, w = s(o.meta.title, o.path), m = [...d, w];
|
|
1124
|
-
r.push({
|
|
1125
|
-
path: i,
|
|
1126
|
-
title: w,
|
|
1127
|
-
icon: o.meta.icon,
|
|
1128
|
-
breadcrumb: m
|
|
1129
|
-
}), o.subResources && o.subResources.forEach(
|
|
1130
|
-
(f) => n(f, i, m)
|
|
1131
|
-
);
|
|
1132
|
-
};
|
|
1133
|
-
return t.forEach((o) => {
|
|
1134
|
-
if (o.path.startsWith(":")) return;
|
|
1135
|
-
const l = s(o.meta.title, o.path), d = [l];
|
|
1136
|
-
o.meta.menuItemClickable && r.push({
|
|
1137
|
-
path: o.path,
|
|
1138
|
-
title: l,
|
|
1139
|
-
icon: o.meta.icon,
|
|
1140
|
-
breadcrumb: d
|
|
1141
|
-
}), o.resources.forEach(
|
|
1142
|
-
(i) => n(i, o.path, d)
|
|
1143
|
-
);
|
|
1144
|
-
}), r;
|
|
1145
|
-
}
|
|
1146
|
-
function Pe(t, e) {
|
|
1171
|
+
function Ke(t, e) {
|
|
1147
1172
|
if (!e.trim()) return t;
|
|
1148
1173
|
const s = e.toLowerCase();
|
|
1149
1174
|
return t.filter(
|
|
1150
1175
|
(r) => r.title.toLowerCase().includes(s) || r.path.toLowerCase().includes(s)
|
|
1151
1176
|
);
|
|
1152
1177
|
}
|
|
1153
|
-
const
|
|
1154
|
-
const s =
|
|
1178
|
+
const Ue = (t, e) => {
|
|
1179
|
+
const s = ct(e);
|
|
1155
1180
|
return t.reduce(
|
|
1156
1181
|
(r, n) => {
|
|
1157
1182
|
const o = s(n.meta.title, n.path);
|
|
@@ -1159,44 +1184,44 @@ const Le = (t, e) => {
|
|
|
1159
1184
|
title: o,
|
|
1160
1185
|
breadcrumbTitle: n.meta.breadcrumbTitle
|
|
1161
1186
|
};
|
|
1162
|
-
const
|
|
1163
|
-
!d || d.length === 0 || d.forEach((
|
|
1164
|
-
const
|
|
1165
|
-
|
|
1166
|
-
|
|
1187
|
+
const i = (d, w) => {
|
|
1188
|
+
!d || d.length === 0 || d.forEach((c) => {
|
|
1189
|
+
const h = `${w}/${c.path}`, b = s(
|
|
1190
|
+
c.meta.title,
|
|
1191
|
+
c.path
|
|
1167
1192
|
);
|
|
1168
|
-
r[
|
|
1169
|
-
title:
|
|
1170
|
-
breadcrumbTitle:
|
|
1171
|
-
},
|
|
1172
|
-
|
|
1173
|
-
|
|
1193
|
+
r[h] = {
|
|
1194
|
+
title: b,
|
|
1195
|
+
breadcrumbTitle: c.meta.breadcrumbTitle
|
|
1196
|
+
}, c.subResources && c.subResources.length > 0 && i(
|
|
1197
|
+
c.subResources,
|
|
1198
|
+
h
|
|
1174
1199
|
);
|
|
1175
1200
|
});
|
|
1176
1201
|
};
|
|
1177
|
-
return n.resources && n.resources.length > 0 &&
|
|
1202
|
+
return n.resources && n.resources.length > 0 && i(n.resources, n.path), r;
|
|
1178
1203
|
},
|
|
1179
1204
|
{}
|
|
1180
1205
|
);
|
|
1181
1206
|
};
|
|
1182
|
-
function
|
|
1183
|
-
const n = t.split("/").filter((
|
|
1184
|
-
const
|
|
1185
|
-
let
|
|
1186
|
-
if (!
|
|
1187
|
-
const
|
|
1188
|
-
([
|
|
1189
|
-
const
|
|
1190
|
-
return new RegExp(`^${
|
|
1207
|
+
function Fe(t, e, s, r) {
|
|
1208
|
+
const n = t.split("/").filter((w) => w !== ""), o = e && n[0] === e ? n.slice(1) : n, i = Ue(s, r), d = o.map((w, c) => {
|
|
1209
|
+
const h = o.slice(0, c + 1).join("/");
|
|
1210
|
+
let b = i[h];
|
|
1211
|
+
if (!b) {
|
|
1212
|
+
const f = Object.entries(i).find(
|
|
1213
|
+
([x]) => {
|
|
1214
|
+
const A = x.split("/").map((g) => g.startsWith(":") ? "[^/]+" : g).join("/");
|
|
1215
|
+
return new RegExp(`^${A}$`).test(h);
|
|
1191
1216
|
}
|
|
1192
1217
|
)?.[1];
|
|
1193
|
-
|
|
1218
|
+
f && (b = f);
|
|
1194
1219
|
}
|
|
1195
|
-
let
|
|
1196
|
-
return
|
|
1197
|
-
segment:
|
|
1198
|
-
path:
|
|
1199
|
-
title:
|
|
1220
|
+
let m;
|
|
1221
|
+
return b ? typeof b.breadcrumbTitle == "function" ? m = b.breadcrumbTitle(w) : typeof b.breadcrumbTitle == "string" ? m = b.breadcrumbTitle : m = b.title : m = decodeURIComponent(w), {
|
|
1222
|
+
segment: w,
|
|
1223
|
+
path: h,
|
|
1224
|
+
title: m
|
|
1200
1225
|
};
|
|
1201
1226
|
});
|
|
1202
1227
|
return {
|
|
@@ -1204,127 +1229,137 @@ function De(t, e, s, r) {
|
|
|
1204
1229
|
segments: d
|
|
1205
1230
|
};
|
|
1206
1231
|
}
|
|
1207
|
-
const
|
|
1208
|
-
const { open: t } =
|
|
1209
|
-
return /* @__PURE__ */ a("div", { className: t ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(
|
|
1210
|
-
},
|
|
1211
|
-
const e = t.children ? t.children({ Outlet: X }) : null, s =
|
|
1232
|
+
const We = () => {
|
|
1233
|
+
const { open: t } = M();
|
|
1234
|
+
return /* @__PURE__ */ a("div", { className: t ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(Nt, { className: "astw:-ml-2.5" }) });
|
|
1235
|
+
}, Na = (t) => {
|
|
1236
|
+
const e = t.children ? t.children({ Outlet: X }) : null, s = ce(), r = () => {
|
|
1212
1237
|
s.setTheme(s.theme === "dark" ? "light" : "dark");
|
|
1213
1238
|
};
|
|
1214
|
-
return /* @__PURE__ */ a(
|
|
1215
|
-
t.sidebar ?? /* @__PURE__ */ a(
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */ a("header", { className: "astw:flex astw:h-14 astw:shrink-0 astw:items-center astw:gap-2 astw:transition-[width,height] astw:ease-linear astw:group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */
|
|
1218
|
-
/* @__PURE__ */
|
|
1219
|
-
/* @__PURE__ */ a(
|
|
1220
|
-
/* @__PURE__ */ a(
|
|
1239
|
+
return /* @__PURE__ */ a(Le, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:flex-1", children: [
|
|
1240
|
+
t.sidebar ?? /* @__PURE__ */ a(He, {}),
|
|
1241
|
+
/* @__PURE__ */ l(De, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
|
|
1242
|
+
/* @__PURE__ */ a("header", { className: "astw:flex astw:h-14 astw:shrink-0 astw:items-center astw:gap-2 astw:transition-[width,height] astw:ease-linear astw:group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:w-full astw:items-center astw:justify-between", children: [
|
|
1243
|
+
/* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
|
|
1244
|
+
/* @__PURE__ */ a(We, {}),
|
|
1245
|
+
/* @__PURE__ */ a(Xe, {})
|
|
1221
1246
|
] }),
|
|
1222
|
-
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(
|
|
1247
|
+
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(P, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(Wt, {}) }) })
|
|
1223
1248
|
] }) }),
|
|
1224
1249
|
/* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(X, {}) })
|
|
1225
1250
|
] })
|
|
1226
1251
|
] }) });
|
|
1227
|
-
},
|
|
1228
|
-
const { title: e, icon: s
|
|
1252
|
+
}, He = (t) => {
|
|
1253
|
+
const { title: e, icon: s } = C(), { pathname: r } = ot(), n = /* @__PURE__ */ l(Ie, { children: [
|
|
1229
1254
|
s,
|
|
1230
1255
|
/* @__PURE__ */ a("h1", { className: "astw:text-sm astw:mb-2 astw:mt-2 astw:px-2", children: e })
|
|
1231
1256
|
] });
|
|
1232
|
-
return /* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
t.header ??
|
|
1235
|
-
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(
|
|
1257
|
+
return /* @__PURE__ */ l(Ae, { variant: "inset", children: [
|
|
1258
|
+
/* @__PURE__ */ l("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
|
|
1259
|
+
t.header ?? n,
|
|
1260
|
+
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(Nt, { className: "astw:-ml-1" }) })
|
|
1236
1261
|
] }),
|
|
1237
|
-
/* @__PURE__ */ a(
|
|
1238
|
-
Yt,
|
|
1239
|
-
{
|
|
1240
|
-
asChild: !0,
|
|
1241
|
-
defaultOpen: i.isActive,
|
|
1242
|
-
children: /* @__PURE__ */ c(Se, { children: [
|
|
1243
|
-
i.url ? /* @__PURE__ */ c(B, { children: [
|
|
1244
|
-
/* @__PURE__ */ a(J, { asChild: !0, tooltip: i.title, children: /* @__PURE__ */ c(
|
|
1245
|
-
K,
|
|
1246
|
-
{
|
|
1247
|
-
to: i.url,
|
|
1248
|
-
className: i.url === n ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
1249
|
-
children: [
|
|
1250
|
-
i.icon,
|
|
1251
|
-
/* @__PURE__ */ a("span", { children: i.title })
|
|
1252
|
-
]
|
|
1253
|
-
}
|
|
1254
|
-
) }),
|
|
1255
|
-
!!i.items?.length && /* @__PURE__ */ a(Y, { asChild: !0, children: /* @__PURE__ */ c(Z, { className: "astw:data-[state=open]:rotate-90", children: [
|
|
1256
|
-
/* @__PURE__ */ a(z, {}),
|
|
1257
|
-
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: o("toggle") })
|
|
1258
|
-
] }) })
|
|
1259
|
-
] }) : /* @__PURE__ */ a(B, { children: /* @__PURE__ */ c(Y, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
|
|
1260
|
-
/* @__PURE__ */ a(J, { asChild: !0, tooltip: i.title, children: /* @__PURE__ */ c("span", { className: "astw:flex astw:w-[100%]", children: [
|
|
1261
|
-
i.icon,
|
|
1262
|
-
/* @__PURE__ */ a("span", { children: i.title })
|
|
1263
|
-
] }) }),
|
|
1264
|
-
!!i.items?.length && /* @__PURE__ */ a(
|
|
1265
|
-
Z,
|
|
1266
|
-
{
|
|
1267
|
-
className: "astw-rotate-target",
|
|
1268
|
-
asChild: !0,
|
|
1269
|
-
children: /* @__PURE__ */ c("span", { children: [
|
|
1270
|
-
/* @__PURE__ */ a(z, {}),
|
|
1271
|
-
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: o("toggle") })
|
|
1272
|
-
] })
|
|
1273
|
-
}
|
|
1274
|
-
)
|
|
1275
|
-
] }) }),
|
|
1276
|
-
!!i.items?.length && /* @__PURE__ */ a(Jt, { children: /* @__PURE__ */ a(ke, { children: i.items?.map((w) => /* @__PURE__ */ a(Re, { children: /* @__PURE__ */ a(Ee, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1277
|
-
K,
|
|
1278
|
-
{
|
|
1279
|
-
to: w.url,
|
|
1280
|
-
className: w.url === n ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
1281
|
-
children: /* @__PURE__ */ a("span", { children: w.title })
|
|
1282
|
-
}
|
|
1283
|
-
) }) }, w.title)) }) })
|
|
1284
|
-
] })
|
|
1285
|
-
},
|
|
1286
|
-
i.title
|
|
1287
|
-
)) }) }) }),
|
|
1262
|
+
/* @__PURE__ */ a(Me, { children: /* @__PURE__ */ a(rt, { fallback: /* @__PURE__ */ a(qe, {}), children: /* @__PURE__ */ a(Qe, { currentPath: r }) }) }),
|
|
1288
1263
|
t.footer ?? null
|
|
1289
1264
|
] });
|
|
1290
|
-
},
|
|
1291
|
-
const
|
|
1292
|
-
return
|
|
1265
|
+
}, Qe = ({ currentPath: t }) => {
|
|
1266
|
+
const e = gt();
|
|
1267
|
+
return /* @__PURE__ */ a(it, { resolve: e, children: (s) => /* @__PURE__ */ a(Ve, { items: s ?? [], currentPath: t }) });
|
|
1268
|
+
}, Ve = (t) => {
|
|
1269
|
+
const e = k();
|
|
1270
|
+
return /* @__PURE__ */ a(Ct, { children: /* @__PURE__ */ a(St, { children: t.items.map((s) => /* @__PURE__ */ a(we, { asChild: !0, defaultOpen: !0, children: /* @__PURE__ */ l(Tt, { children: [
|
|
1271
|
+
s.url ? /* @__PURE__ */ l(R, { children: [
|
|
1272
|
+
/* @__PURE__ */ a(J, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ l(
|
|
1273
|
+
$,
|
|
1274
|
+
{
|
|
1275
|
+
to: s.url,
|
|
1276
|
+
className: s.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
1277
|
+
children: [
|
|
1278
|
+
s.icon,
|
|
1279
|
+
/* @__PURE__ */ a("span", { children: s.title })
|
|
1280
|
+
]
|
|
1281
|
+
}
|
|
1282
|
+
) }),
|
|
1283
|
+
!!s.items?.length && /* @__PURE__ */ a(Y, { asChild: !0, children: /* @__PURE__ */ l(Z, { className: "astw:data-[state=open]:rotate-90", children: [
|
|
1284
|
+
/* @__PURE__ */ a(z, {}),
|
|
1285
|
+
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1286
|
+
] }) })
|
|
1287
|
+
] }) : /* @__PURE__ */ a(R, { children: /* @__PURE__ */ l(Y, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
|
|
1288
|
+
/* @__PURE__ */ a(J, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ l("span", { className: "astw:flex astw:w-[100%]", children: [
|
|
1289
|
+
s.icon,
|
|
1290
|
+
/* @__PURE__ */ a("span", { children: s.title })
|
|
1291
|
+
] }) }),
|
|
1292
|
+
!!s.items?.length && /* @__PURE__ */ a(
|
|
1293
|
+
Z,
|
|
1294
|
+
{
|
|
1295
|
+
className: "astw-rotate-target",
|
|
1296
|
+
asChild: !0,
|
|
1297
|
+
children: /* @__PURE__ */ l("span", { children: [
|
|
1298
|
+
/* @__PURE__ */ a(z, {}),
|
|
1299
|
+
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1300
|
+
] })
|
|
1301
|
+
}
|
|
1302
|
+
)
|
|
1303
|
+
] }) }),
|
|
1304
|
+
!!s.items?.length && /* @__PURE__ */ a(ue, { children: /* @__PURE__ */ a(ze, { children: s.items?.map((r) => /* @__PURE__ */ a(Oe, { children: /* @__PURE__ */ a($e, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1305
|
+
$,
|
|
1306
|
+
{
|
|
1307
|
+
to: r.url,
|
|
1308
|
+
className: r.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
1309
|
+
children: /* @__PURE__ */ a("span", { children: r.title })
|
|
1310
|
+
}
|
|
1311
|
+
) }) }, r.title)) }) })
|
|
1312
|
+
] }) }, s.title)) }) });
|
|
1313
|
+
}, qe = () => {
|
|
1314
|
+
const e = [...[112, 96, 80, 104, 88, 100, 92, 84]].sort(() => Math.random() - 0.5);
|
|
1315
|
+
return /* @__PURE__ */ a(Ct, { children: /* @__PURE__ */ a(St, { className: "astw:px-2", children: e.map((s, r) => /* @__PURE__ */ a(Tt, { children: /* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
|
|
1316
|
+
/* @__PURE__ */ a("div", { className: "astw:h-4 astw:w-4 astw:rounded-md astw:bg-muted" }),
|
|
1317
|
+
/* @__PURE__ */ a(
|
|
1318
|
+
"div",
|
|
1319
|
+
{
|
|
1320
|
+
className: "astw:h-4 astw:rounded astw:bg-muted",
|
|
1321
|
+
style: { width: `${s}px` }
|
|
1322
|
+
}
|
|
1323
|
+
)
|
|
1324
|
+
] }) }, r)) }) });
|
|
1325
|
+
}, Ge = () => {
|
|
1326
|
+
const { configurations: t } = C(), e = ot();
|
|
1327
|
+
return Fe(
|
|
1293
1328
|
e.pathname,
|
|
1294
1329
|
t.basePath,
|
|
1295
1330
|
t.modules,
|
|
1296
1331
|
t.locale
|
|
1297
1332
|
);
|
|
1298
|
-
},
|
|
1299
|
-
const { segments: t } =
|
|
1300
|
-
return e ? /* @__PURE__ */ a(tt, { children: /* @__PURE__ */ a(et, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(st, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(tt, { children: /* @__PURE__ */ a(et, { children: t.map((r, n) => /* @__PURE__ */
|
|
1333
|
+
}, Xe = () => {
|
|
1334
|
+
const { segments: t } = Ge(), e = Ot("/:prefix/settings/:suffix"), s = k();
|
|
1335
|
+
return e ? /* @__PURE__ */ a(tt, { children: /* @__PURE__ */ a(et, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(st, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(tt, { children: /* @__PURE__ */ a(et, { children: t.map((r, n) => /* @__PURE__ */ l(
|
|
1301
1336
|
"div",
|
|
1302
1337
|
{
|
|
1303
1338
|
className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground",
|
|
1304
1339
|
children: [
|
|
1305
1340
|
/* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(st, { to: r.path, children: r.title }) }),
|
|
1306
|
-
n < t.length - 1 && /* @__PURE__ */ a(
|
|
1341
|
+
n < t.length - 1 && /* @__PURE__ */ a(je, {})
|
|
1307
1342
|
]
|
|
1308
1343
|
},
|
|
1309
1344
|
n
|
|
1310
1345
|
)) }) });
|
|
1311
1346
|
};
|
|
1312
|
-
function
|
|
1347
|
+
function Ye({
|
|
1313
1348
|
...t
|
|
1314
1349
|
}) {
|
|
1315
|
-
return /* @__PURE__ */ a(
|
|
1350
|
+
return /* @__PURE__ */ a(p.Root, { "data-slot": "dialog", ...t });
|
|
1316
1351
|
}
|
|
1317
|
-
function
|
|
1352
|
+
function Je({
|
|
1318
1353
|
...t
|
|
1319
1354
|
}) {
|
|
1320
|
-
return /* @__PURE__ */ a(
|
|
1355
|
+
return /* @__PURE__ */ a(p.Portal, { "data-slot": "dialog-portal", ...t });
|
|
1321
1356
|
}
|
|
1322
|
-
function
|
|
1357
|
+
function Ze({
|
|
1323
1358
|
className: t,
|
|
1324
1359
|
...e
|
|
1325
1360
|
}) {
|
|
1326
1361
|
return /* @__PURE__ */ a(
|
|
1327
|
-
|
|
1362
|
+
p.Overlay,
|
|
1328
1363
|
{
|
|
1329
1364
|
"data-slot": "dialog-overlay",
|
|
1330
1365
|
className: u(
|
|
@@ -1335,15 +1370,15 @@ function Ke({
|
|
|
1335
1370
|
}
|
|
1336
1371
|
);
|
|
1337
1372
|
}
|
|
1338
|
-
function
|
|
1373
|
+
function ta({
|
|
1339
1374
|
className: t,
|
|
1340
1375
|
children: e,
|
|
1341
1376
|
...s
|
|
1342
1377
|
}) {
|
|
1343
|
-
return /* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */ a(
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
|
|
1378
|
+
return /* @__PURE__ */ l(Je, { "data-slot": "dialog-portal", children: [
|
|
1379
|
+
/* @__PURE__ */ a(Ze, {}),
|
|
1380
|
+
/* @__PURE__ */ l(
|
|
1381
|
+
p.Content,
|
|
1347
1382
|
{
|
|
1348
1383
|
"data-slot": "dialog-content",
|
|
1349
1384
|
className: u(
|
|
@@ -1353,8 +1388,8 @@ function je({
|
|
|
1353
1388
|
...s,
|
|
1354
1389
|
children: [
|
|
1355
1390
|
e,
|
|
1356
|
-
/* @__PURE__ */
|
|
1357
|
-
/* @__PURE__ */ a(
|
|
1391
|
+
/* @__PURE__ */ l(p.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-accent astw:data-[state=open]:text-muted-foreground astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none astw:[&_svg]:pointer-events-none astw:[&_svg]:shrink-0 astw:[&_svg:not([class*='size-'])]:size-4", children: [
|
|
1392
|
+
/* @__PURE__ */ a(dt, {}),
|
|
1358
1393
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
1359
1394
|
] })
|
|
1360
1395
|
]
|
|
@@ -1362,12 +1397,12 @@ function je({
|
|
|
1362
1397
|
)
|
|
1363
1398
|
] });
|
|
1364
1399
|
}
|
|
1365
|
-
function
|
|
1400
|
+
function ea({
|
|
1366
1401
|
className: t,
|
|
1367
1402
|
...e
|
|
1368
1403
|
}) {
|
|
1369
1404
|
return /* @__PURE__ */ a(
|
|
1370
|
-
|
|
1405
|
+
p.Title,
|
|
1371
1406
|
{
|
|
1372
1407
|
"data-slot": "dialog-title",
|
|
1373
1408
|
className: u("astw:text-lg astw:leading-none astw:font-semibold", t),
|
|
@@ -1375,105 +1410,112 @@ function Ue({
|
|
|
1375
1410
|
}
|
|
1376
1411
|
);
|
|
1377
1412
|
}
|
|
1378
|
-
function
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1413
|
+
function aa(t) {
|
|
1414
|
+
const e = [], s = (r, n, o) => {
|
|
1415
|
+
r.forEach((i) => {
|
|
1416
|
+
const d = [...o, i.title];
|
|
1417
|
+
e.push({
|
|
1418
|
+
path: i.url,
|
|
1419
|
+
title: i.title,
|
|
1420
|
+
icon: n,
|
|
1421
|
+
breadcrumb: d
|
|
1422
|
+
}), i.items && i.items.length > 0 && s(i.items, n, d);
|
|
1423
|
+
});
|
|
1424
|
+
};
|
|
1425
|
+
return t.forEach((r) => {
|
|
1426
|
+
r.url && e.push({
|
|
1427
|
+
path: r.url,
|
|
1428
|
+
title: r.title,
|
|
1429
|
+
icon: r.icon,
|
|
1430
|
+
breadcrumb: [r.title]
|
|
1431
|
+
}), s(r.items, r.icon, [r.title]);
|
|
1432
|
+
}), e;
|
|
1433
|
+
}
|
|
1434
|
+
function sa({
|
|
1435
|
+
routes: t
|
|
1382
1436
|
}) {
|
|
1383
|
-
const [r, n] =
|
|
1384
|
-
() =>
|
|
1385
|
-
[t,
|
|
1386
|
-
), m = A(
|
|
1387
|
-
() => Pe(w, o),
|
|
1388
|
-
[w, o]
|
|
1437
|
+
const e = $t(), s = Rt(null), [r, n] = S(!1), [o, i] = S(""), [d, w] = S(0), c = I(
|
|
1438
|
+
() => Ke(t, o),
|
|
1439
|
+
[t, o]
|
|
1389
1440
|
);
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
(
|
|
1397
|
-
|
|
1441
|
+
N(() => {
|
|
1442
|
+
const m = (f) => {
|
|
1443
|
+
(f.metaKey || f.ctrlKey) && f.key === "k" && (f.preventDefault(), n((x) => !x));
|
|
1444
|
+
};
|
|
1445
|
+
return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
|
|
1446
|
+
}, []), N(() => {
|
|
1447
|
+
w(0);
|
|
1448
|
+
}, [c]), N(() => {
|
|
1449
|
+
r || (i(""), w(0));
|
|
1450
|
+
}, [r]), N(() => {
|
|
1451
|
+
s.current && s.current.querySelector(`[data-index="${d}"]`)?.scrollIntoView({ block: "nearest" });
|
|
1452
|
+
}, [d]);
|
|
1453
|
+
const h = q(
|
|
1454
|
+
(m) => {
|
|
1455
|
+
e(m.path), n(!1), i("");
|
|
1398
1456
|
},
|
|
1399
|
-
[
|
|
1400
|
-
),
|
|
1401
|
-
(
|
|
1402
|
-
if (!
|
|
1403
|
-
switch (
|
|
1457
|
+
[e]
|
|
1458
|
+
), b = q(
|
|
1459
|
+
(m) => {
|
|
1460
|
+
if (!m.nativeEvent.isComposing)
|
|
1461
|
+
switch (m.key) {
|
|
1404
1462
|
case "ArrowDown":
|
|
1405
|
-
|
|
1406
|
-
(
|
|
1463
|
+
m.preventDefault(), w(
|
|
1464
|
+
(f) => f < c.length - 1 ? f + 1 : f
|
|
1407
1465
|
);
|
|
1408
1466
|
break;
|
|
1409
1467
|
case "ArrowUp":
|
|
1410
|
-
|
|
1468
|
+
m.preventDefault(), w((f) => f > 0 ? f - 1 : f);
|
|
1411
1469
|
break;
|
|
1412
1470
|
case "Enter":
|
|
1413
|
-
m[d] &&
|
|
1471
|
+
m.preventDefault(), c[d] && h(c[d]);
|
|
1414
1472
|
break;
|
|
1415
1473
|
}
|
|
1416
1474
|
},
|
|
1417
|
-
[
|
|
1475
|
+
[c, d, h]
|
|
1418
1476
|
);
|
|
1419
1477
|
return {
|
|
1420
1478
|
open: r,
|
|
1421
1479
|
setOpen: n,
|
|
1422
1480
|
search: o,
|
|
1423
|
-
setSearch:
|
|
1481
|
+
setSearch: i,
|
|
1424
1482
|
selectedIndex: d,
|
|
1425
|
-
filteredRoutes:
|
|
1426
|
-
handleSelect:
|
|
1427
|
-
handleKeyDown:
|
|
1483
|
+
filteredRoutes: c,
|
|
1484
|
+
handleSelect: h,
|
|
1485
|
+
handleKeyDown: b,
|
|
1486
|
+
listRef: s
|
|
1428
1487
|
};
|
|
1429
1488
|
}
|
|
1430
|
-
function
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1489
|
+
function ra({
|
|
1490
|
+
navItems: t
|
|
1491
|
+
}) {
|
|
1492
|
+
const e = k(), s = I(() => aa(t), [t]), {
|
|
1493
|
+
open: r,
|
|
1494
|
+
setOpen: n,
|
|
1495
|
+
search: o,
|
|
1496
|
+
setSearch: i,
|
|
1497
|
+
selectedIndex: d,
|
|
1437
1498
|
filteredRoutes: w,
|
|
1438
|
-
handleSelect:
|
|
1439
|
-
handleKeyDown:
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
});
|
|
1445
|
-
C(() => {
|
|
1446
|
-
t.current && t.current.querySelector(
|
|
1447
|
-
`[data-index="${i}"]`
|
|
1448
|
-
)?.scrollIntoView({ block: "nearest" });
|
|
1449
|
-
}, [i]);
|
|
1450
|
-
const g = O(
|
|
1451
|
-
(h) => {
|
|
1452
|
-
["ArrowDown", "ArrowUp", "Enter"].includes(h.key) && h.preventDefault(), f(h.key, h.nativeEvent.isComposing);
|
|
1453
|
-
},
|
|
1454
|
-
[f]
|
|
1455
|
-
);
|
|
1456
|
-
return C(() => {
|
|
1457
|
-
const h = (b) => {
|
|
1458
|
-
(b.metaKey || b.ctrlKey) && b.key === "k" && (b.preventDefault(), o(!n));
|
|
1459
|
-
};
|
|
1460
|
-
return document.addEventListener("keydown", h), () => document.removeEventListener("keydown", h);
|
|
1461
|
-
}, [n, o]), /* @__PURE__ */ a(Oe, { open: n, onOpenChange: o, children: /* @__PURE__ */ c(
|
|
1462
|
-
je,
|
|
1499
|
+
handleSelect: c,
|
|
1500
|
+
handleKeyDown: h,
|
|
1501
|
+
listRef: b
|
|
1502
|
+
} = sa({ routes: s });
|
|
1503
|
+
return /* @__PURE__ */ a(Ye, { open: r, onOpenChange: n, children: /* @__PURE__ */ l(
|
|
1504
|
+
ta,
|
|
1463
1505
|
{
|
|
1464
1506
|
className: "astw:p-0 astw:gap-0 astw:sm:max-w-2xl astw:overflow-hidden",
|
|
1465
|
-
onKeyDown:
|
|
1507
|
+
onKeyDown: h,
|
|
1466
1508
|
"aria-describedby": void 0,
|
|
1467
1509
|
children: [
|
|
1468
|
-
/* @__PURE__ */ a(
|
|
1469
|
-
/* @__PURE__ */
|
|
1470
|
-
/* @__PURE__ */ a(
|
|
1510
|
+
/* @__PURE__ */ a(ea, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
|
|
1511
|
+
/* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:border-b astw:px-3 astw:py-1", children: [
|
|
1512
|
+
/* @__PURE__ */ a(Ht, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
|
|
1471
1513
|
/* @__PURE__ */ a(
|
|
1472
|
-
|
|
1514
|
+
he,
|
|
1473
1515
|
{
|
|
1474
|
-
value:
|
|
1475
|
-
onChange: (
|
|
1476
|
-
placeholder:
|
|
1516
|
+
value: o,
|
|
1517
|
+
onChange: (m) => i(m.target.value),
|
|
1518
|
+
placeholder: e("commandPaletteSearch"),
|
|
1477
1519
|
className: "astw:flex astw:h-10 astw:w-full astw:rounded-md astw:bg-transparent astw:py-3 astw:text-sm astw:outline-none astw:border-0 astw:shadow-none astw:focus-visible:ring-0 astw:placeholder:text-muted-foreground astw:disabled:cursor-not-allowed astw:disabled:opacity-50",
|
|
1478
1520
|
autoFocus: !0
|
|
1479
1521
|
}
|
|
@@ -1482,26 +1524,26 @@ function la() {
|
|
|
1482
1524
|
/* @__PURE__ */ a(
|
|
1483
1525
|
"div",
|
|
1484
1526
|
{
|
|
1485
|
-
ref:
|
|
1527
|
+
ref: b,
|
|
1486
1528
|
className: "astw:max-h-[300px] astw:overflow-y-auto astw:overflow-x-hidden",
|
|
1487
|
-
children: w.length === 0 ? /* @__PURE__ */ a("div", { className: "astw:py-6 astw:text-center astw:text-sm astw:text-muted-foreground", children:
|
|
1529
|
+
children: w.length === 0 ? /* @__PURE__ */ a("div", { className: "astw:py-6 astw:text-center astw:text-sm astw:text-muted-foreground", children: e("commandPaletteNoResults") }) : /* @__PURE__ */ a("div", { className: "astw:p-1", children: w.map((m, f) => /* @__PURE__ */ l(
|
|
1488
1530
|
"button",
|
|
1489
1531
|
{
|
|
1490
|
-
"data-index":
|
|
1491
|
-
onClick: () => m
|
|
1532
|
+
"data-index": f,
|
|
1533
|
+
onClick: () => c(m),
|
|
1492
1534
|
className: u(
|
|
1493
1535
|
"astw:relative astw:flex astw:flex-col astw:w-full astw:cursor-pointer astw:select-none astw:items-start astw:rounded-sm astw:px-2 astw:py-2 astw:text-sm astw:outline-none astw:text-left",
|
|
1494
|
-
|
|
1536
|
+
f === d ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
|
|
1495
1537
|
),
|
|
1496
1538
|
children: [
|
|
1497
|
-
/* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children:
|
|
1498
|
-
/* @__PURE__ */
|
|
1539
|
+
/* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: m.breadcrumb.join(" > ") }),
|
|
1540
|
+
/* @__PURE__ */ l("span", { className: "astw:text-[11px] astw:text-muted-foreground astw:truncate astw:w-full astw:text-left", children: [
|
|
1499
1541
|
"/",
|
|
1500
|
-
|
|
1542
|
+
m.path
|
|
1501
1543
|
] })
|
|
1502
1544
|
]
|
|
1503
1545
|
},
|
|
1504
|
-
|
|
1546
|
+
m.path
|
|
1505
1547
|
)) })
|
|
1506
1548
|
}
|
|
1507
1549
|
)
|
|
@@ -1509,21 +1551,25 @@ function la() {
|
|
|
1509
1551
|
}
|
|
1510
1552
|
) });
|
|
1511
1553
|
}
|
|
1512
|
-
|
|
1513
|
-
const
|
|
1514
|
-
|
|
1554
|
+
function Ca() {
|
|
1555
|
+
const t = gt();
|
|
1556
|
+
return /* @__PURE__ */ a(rt, { fallback: null, children: /* @__PURE__ */ a(it, { resolve: t, children: (e) => /* @__PURE__ */ a(ra, { navItems: e ?? [] }) }) });
|
|
1557
|
+
}
|
|
1558
|
+
const kt = j(null), Sa = (t) => {
|
|
1559
|
+
const e = I(
|
|
1560
|
+
() => qt({
|
|
1515
1561
|
clientId: t.clientId,
|
|
1516
1562
|
appUri: t.apiEndpoint,
|
|
1517
1563
|
redirectUri: t.redirectUri,
|
|
1518
|
-
meQuery: t.meQuery && (typeof t.meQuery == "string" ? t.meQuery :
|
|
1564
|
+
meQuery: t.meQuery && (typeof t.meQuery == "string" ? t.meQuery : Vt(t.meQuery))
|
|
1519
1565
|
}),
|
|
1520
1566
|
[t.clientId, t.apiEndpoint, t.redirectUri, t.meQuery]
|
|
1521
|
-
), [s, r] =
|
|
1567
|
+
), [s, r] = S(
|
|
1522
1568
|
() => e.getState()
|
|
1523
1569
|
);
|
|
1524
|
-
|
|
1570
|
+
N(() => {
|
|
1525
1571
|
t.autoLogin && (s.isLoading || s.isAuthenticated || (async () => await e.login())());
|
|
1526
|
-
}, [s.isLoading, s.isAuthenticated, t.autoLogin]),
|
|
1572
|
+
}, [s.isLoading, s.isAuthenticated, t.autoLogin]), N(
|
|
1527
1573
|
() => e.addEventListener((o) => {
|
|
1528
1574
|
o.type === "auth_state_changed" && r(o.data);
|
|
1529
1575
|
}),
|
|
@@ -1531,7 +1577,7 @@ const ft = j(null), da = (t) => {
|
|
|
1531
1577
|
);
|
|
1532
1578
|
const n = t.guardComponent && (s.isLoading || !s.isAuthenticated) ? /* @__PURE__ */ a(t.guardComponent, {}) : t.children;
|
|
1533
1579
|
return /* @__PURE__ */ a(
|
|
1534
|
-
|
|
1580
|
+
kt.Provider,
|
|
1535
1581
|
{
|
|
1536
1582
|
value: {
|
|
1537
1583
|
authState: s,
|
|
@@ -1543,29 +1589,29 @@ const ft = j(null), da = (t) => {
|
|
|
1543
1589
|
children: n
|
|
1544
1590
|
}
|
|
1545
1591
|
);
|
|
1546
|
-
},
|
|
1547
|
-
const t =
|
|
1592
|
+
}, Ta = () => {
|
|
1593
|
+
const t = K(kt);
|
|
1548
1594
|
if (!t)
|
|
1549
1595
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
1550
1596
|
return t;
|
|
1551
1597
|
};
|
|
1552
1598
|
export {
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1599
|
+
ya as AppShell,
|
|
1600
|
+
Sa as AuthProvider,
|
|
1601
|
+
Ca as CommandPalette,
|
|
1602
|
+
He as DefaultSidebar,
|
|
1603
|
+
Ea as Link,
|
|
1604
|
+
Na as SidebarLayout,
|
|
1605
|
+
Jt as defineI18nLabels,
|
|
1606
|
+
va as defineModule,
|
|
1607
|
+
xa as defineResource,
|
|
1608
|
+
pa as redirectToResource,
|
|
1609
|
+
C as useAppShell,
|
|
1610
|
+
Ta as useAuth,
|
|
1611
|
+
Pa as useLocation,
|
|
1612
|
+
Ba as useNavigate,
|
|
1613
|
+
La as useParams,
|
|
1614
|
+
Aa as useRouteError,
|
|
1615
|
+
Da as useSearchParams,
|
|
1616
|
+
ce as useTheme
|
|
1571
1617
|
};
|