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