@tailor-platform/app-shell 0.28.0 → 0.29.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/README.md +1 -1
- package/dist/app-shell.css +1 -1
- package/dist/app-shell.d.ts +241 -54
- package/dist/app-shell.js +937 -853
- package/package.json +1 -1
package/dist/app-shell.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { jsx as a, jsxs as c, Fragment as S } from "react/jsx-runtime";
|
|
2
|
-
import { capitalCase as
|
|
3
|
-
import { useRouteError as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { cva as
|
|
2
|
+
import { capitalCase as E } from "change-case";
|
|
3
|
+
import { useRouteError as me, isRouteErrorResponse as he, redirect as pe, Outlet as ot, NavLink as fe, Navigate as ge, useRouteLoaderData as be, createMemoryRouter as ve, createBrowserRouter as xe, RouterProvider as ye, useLocation as X, Link as $, Await as $t, useMatch as Ne, useNavigate as Se } from "react-router";
|
|
4
|
+
import { Link as mn, useLocation as hn, useNavigate as pn, useParams as fn, useRouteError as gn, useSearchParams as bn } from "react-router";
|
|
5
|
+
import { cva as it } from "class-variance-authority";
|
|
6
6
|
import { useRender as j } from "@base-ui/react/use-render";
|
|
7
|
-
import { clsx as
|
|
8
|
-
import { twMerge as
|
|
9
|
-
import { AlertCircle as
|
|
10
|
-
import * as
|
|
11
|
-
import { createContext as
|
|
12
|
-
import { Toaster as
|
|
13
|
-
import { parsePath as
|
|
14
|
-
import { Dialog as
|
|
15
|
-
import { Tooltip as
|
|
16
|
-
import { Collapsible as
|
|
17
|
-
import { createAuthClient as
|
|
7
|
+
import { clsx as Ce } from "clsx";
|
|
8
|
+
import { twMerge as Te } from "tailwind-merge";
|
|
9
|
+
import { AlertCircle as St, Table as ke, XIcon as Wt, PanelLeftIcon as Re, ExternalLink as Ft, ChevronRight as W, SunIcon as Pe, SearchIcon as Ae, Check as Be, Copy as De } from "lucide-react";
|
|
10
|
+
import * as g from "react";
|
|
11
|
+
import { createContext as Z, useContext as I, useState as V, useMemo as M, useEffect as F, useSyncExternalStore as Ot, Suspense as lt, useRef as jt, useCallback as D } from "react";
|
|
12
|
+
import { Toaster as Me, toast as Ee } from "sonner";
|
|
13
|
+
import { parsePath as Ie } from "@tailor-platform/app-shell-vite-plugin/parser";
|
|
14
|
+
import { Dialog as x } from "@base-ui/react/dialog";
|
|
15
|
+
import { Tooltip as A } from "@base-ui/react/tooltip";
|
|
16
|
+
import { Collapsible as ct } from "@base-ui/react/collapsible";
|
|
17
|
+
import { createAuthClient as Le } from "@tailor-platform/auth-public-client";
|
|
18
18
|
function m(...t) {
|
|
19
|
-
return
|
|
19
|
+
return Te(Ce(t));
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const _e = it(
|
|
22
22
|
"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
23
|
{
|
|
24
24
|
variants: {
|
|
@@ -47,22 +47,22 @@ function O({
|
|
|
47
47
|
className: t,
|
|
48
48
|
variant: e,
|
|
49
49
|
size: s,
|
|
50
|
-
render:
|
|
51
|
-
children:
|
|
50
|
+
render: n,
|
|
51
|
+
children: r,
|
|
52
52
|
...o
|
|
53
53
|
}) {
|
|
54
54
|
return j({
|
|
55
55
|
defaultTagName: "button",
|
|
56
|
-
render:
|
|
56
|
+
render: n,
|
|
57
57
|
props: {
|
|
58
58
|
"data-slot": "button",
|
|
59
|
-
className: m(
|
|
60
|
-
children:
|
|
59
|
+
className: m(_e({ variant: e, size: s, className: t })),
|
|
60
|
+
children: r,
|
|
61
61
|
...o
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
const G = "en",
|
|
65
|
+
const G = "en", ze = () => {
|
|
66
66
|
try {
|
|
67
67
|
if (typeof navigator > "u")
|
|
68
68
|
return G;
|
|
@@ -71,16 +71,16 @@ const G = "en", Ie = () => {
|
|
|
71
71
|
} catch {
|
|
72
72
|
return G;
|
|
73
73
|
}
|
|
74
|
-
}, U = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s,
|
|
74
|
+
}, U = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, Ut = (t) => {
|
|
75
75
|
const e = U(t);
|
|
76
|
-
return (s,
|
|
77
|
-
},
|
|
76
|
+
return (s, n) => e(s, typeof s == "string" ? s : E(n));
|
|
77
|
+
}, $e = (t) => ({
|
|
78
78
|
modules: t.modules,
|
|
79
79
|
settingsResources: t.settingsResources ?? [],
|
|
80
|
-
errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(
|
|
80
|
+
errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(z, {}),
|
|
81
81
|
basePath: t.basePath,
|
|
82
|
-
locale: t.locale ??
|
|
83
|
-
}),
|
|
82
|
+
locale: t.locale ?? ze()
|
|
83
|
+
}), dt = Z({
|
|
84
84
|
configurations: {
|
|
85
85
|
modules: [],
|
|
86
86
|
settingsResources: [],
|
|
@@ -93,19 +93,19 @@ const G = "en", Ie = () => {
|
|
|
93
93
|
// always provides the context via AppShellConfigContext.Provider.
|
|
94
94
|
errorBoundary: null
|
|
95
95
|
}
|
|
96
|
-
}),
|
|
96
|
+
}), ut = Z({
|
|
97
97
|
contextData: {}
|
|
98
|
-
}), C = () =>
|
|
99
|
-
const t =
|
|
98
|
+
}), C = () => I(dt), Hs = () => I(ut), Ht = () => {
|
|
99
|
+
const t = I(dt), e = I(ut);
|
|
100
100
|
return {
|
|
101
101
|
...t,
|
|
102
102
|
...e
|
|
103
103
|
};
|
|
104
|
-
},
|
|
104
|
+
}, We = () => {
|
|
105
105
|
const { configurations: t } = C(), e = U(t.locale);
|
|
106
|
-
return (s,
|
|
107
|
-
},
|
|
108
|
-
const e = (s) => (
|
|
106
|
+
return (s, n) => e(s, n);
|
|
107
|
+
}, Fe = (t) => {
|
|
108
|
+
const e = (s) => (n) => t[s]?.[n] ?? t.en[n];
|
|
109
109
|
return {
|
|
110
110
|
/**
|
|
111
111
|
* Hook to get the translated label resolver function.
|
|
@@ -127,14 +127,14 @@ const G = "en", Ie = () => {
|
|
|
127
127
|
* ```
|
|
128
128
|
*/
|
|
129
129
|
useT: () => {
|
|
130
|
-
const { configurations: s } = C(),
|
|
131
|
-
const l =
|
|
130
|
+
const { configurations: s } = C(), n = e(s.locale), r = ((o, ...i) => {
|
|
131
|
+
const l = n(o);
|
|
132
132
|
return typeof l == "function" ? l(i[0]) : l;
|
|
133
133
|
});
|
|
134
|
-
return
|
|
134
|
+
return r.dynamic = (o, i) => {
|
|
135
135
|
const l = t[s.locale]?.[o] ?? t.en[o];
|
|
136
136
|
return l === void 0 || typeof l == "function" ? i : l;
|
|
137
|
-
},
|
|
137
|
+
}, r;
|
|
138
138
|
},
|
|
139
139
|
/**
|
|
140
140
|
* A function to get the translater for a specific label key.
|
|
@@ -158,12 +158,12 @@ const G = "en", Ie = () => {
|
|
|
158
158
|
* });
|
|
159
159
|
* ```
|
|
160
160
|
*/
|
|
161
|
-
t: (s, ...
|
|
162
|
-
const o = e(
|
|
163
|
-
return typeof o == "function" ? o(
|
|
161
|
+
t: (s, ...n) => (r) => {
|
|
162
|
+
const o = e(r)(s);
|
|
163
|
+
return typeof o == "function" ? o(n[0]) : o;
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
|
-
},
|
|
166
|
+
}, Oe = Fe({
|
|
167
167
|
en: {
|
|
168
168
|
error404Title: "404 Not Found",
|
|
169
169
|
error404Body: "The page you requested could not be found.",
|
|
@@ -202,14 +202,14 @@ const G = "en", Ie = () => {
|
|
|
202
202
|
commandPaletteSearch: "ページを検索...",
|
|
203
203
|
commandPaletteNoResults: "結果が見つかりません"
|
|
204
204
|
}
|
|
205
|
-
}),
|
|
206
|
-
const t =
|
|
205
|
+
}), B = Oe.useT, z = () => {
|
|
206
|
+
const t = me(), e = B(), s = {
|
|
207
207
|
role: "alert",
|
|
208
208
|
"aria-label": "default-error-boundary"
|
|
209
209
|
};
|
|
210
|
-
if (
|
|
210
|
+
if (he(t) && t.status === 404)
|
|
211
211
|
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
212
|
-
/* @__PURE__ */ a(
|
|
212
|
+
/* @__PURE__ */ a(St, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
213
213
|
/* @__PURE__ */ c("div", { children: [
|
|
214
214
|
/* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("error404Title") }),
|
|
215
215
|
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: e("error404Body") }),
|
|
@@ -225,12 +225,12 @@ const G = "en", Ie = () => {
|
|
|
225
225
|
)
|
|
226
226
|
] })
|
|
227
227
|
] }) });
|
|
228
|
-
const
|
|
228
|
+
const n = t instanceof Error ? t.message : e("errorUnexpected");
|
|
229
229
|
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
230
|
-
/* @__PURE__ */ a(
|
|
230
|
+
/* @__PURE__ */ a(St, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
231
231
|
/* @__PURE__ */ c("div", { children: [
|
|
232
232
|
/* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("errorTitle") }),
|
|
233
|
-
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children:
|
|
233
|
+
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: n }),
|
|
234
234
|
/* @__PURE__ */ a(
|
|
235
235
|
O,
|
|
236
236
|
{
|
|
@@ -244,277 +244,286 @@ const G = "en", Ie = () => {
|
|
|
244
244
|
] })
|
|
245
245
|
] }) });
|
|
246
246
|
};
|
|
247
|
-
let
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
},
|
|
247
|
+
let Kt = {};
|
|
248
|
+
const je = (t) => {
|
|
249
|
+
Kt = t;
|
|
250
|
+
}, Ks = () => ({ type: "pass" }), Vs = () => ({ type: "hidden" }), Gs = (t) => ({
|
|
251
251
|
type: "redirect",
|
|
252
252
|
to: t
|
|
253
|
-
}),
|
|
253
|
+
}), q = () => new Response("Not Found", { status: 404 }), wt = async (t) => {
|
|
254
254
|
if (!t || t.length === 0) return { type: "pass" };
|
|
255
255
|
const e = {
|
|
256
|
-
context:
|
|
256
|
+
context: Kt
|
|
257
257
|
};
|
|
258
258
|
for (const s of t) {
|
|
259
|
-
const
|
|
260
|
-
if (
|
|
261
|
-
return
|
|
259
|
+
const n = await s(e);
|
|
260
|
+
if (n.type !== "pass")
|
|
261
|
+
return n;
|
|
262
262
|
}
|
|
263
263
|
return { type: "pass" };
|
|
264
264
|
}, Vt = (t, e) => async (s) => {
|
|
265
|
-
const
|
|
266
|
-
switch (
|
|
265
|
+
const n = await wt(t);
|
|
266
|
+
switch (n.type) {
|
|
267
267
|
case "hidden":
|
|
268
|
-
throw
|
|
268
|
+
throw q();
|
|
269
269
|
case "redirect":
|
|
270
|
-
return
|
|
270
|
+
return pe(n.to);
|
|
271
271
|
case "pass":
|
|
272
272
|
return e ? e(s) : null;
|
|
273
273
|
}
|
|
274
|
-
},
|
|
275
|
-
const { configurations: s } = C(), { metaTitle:
|
|
274
|
+
}, Gt = (t, e) => () => {
|
|
275
|
+
const { configurations: s } = C(), { metaTitle: n, fallbackTitle: r } = t, i = U(s.locale)(n, r);
|
|
276
276
|
return e(i);
|
|
277
277
|
};
|
|
278
|
-
function
|
|
279
|
-
const { path: e, meta: s, component:
|
|
280
|
-
if (!r && (!i || i.length === 0))
|
|
281
|
-
throw new Error(
|
|
282
|
-
`Module "${e}" has no component. Either provide a \`component\` or use \`guards\` with \`redirectTo()\` or \`hidden()\` to control access. A guard that only returns \`pass()\` without a component will result in a blank page.`
|
|
283
|
-
);
|
|
284
|
-
const w = i && i.length > 0 ? Vt(i) : void 0, d = r ? Ht({ metaTitle: l, fallbackTitle: u }, (h) => r({ title: h, resources: n })) : void 0;
|
|
278
|
+
function qs(t) {
|
|
279
|
+
const { path: e, meta: s, component: n, resources: r, errorBoundary: o, guards: i } = t, l = s?.title ?? E(e), u = E(e), d = i && i.length > 0 ? Vt(i) : void 0, w = n ? Gt({ metaTitle: l, fallbackTitle: u }, (h) => n({ title: h, resources: r })) : void 0;
|
|
285
280
|
return {
|
|
286
281
|
path: e,
|
|
287
282
|
type: "component",
|
|
288
283
|
_type: "module",
|
|
289
|
-
component:
|
|
290
|
-
loader:
|
|
284
|
+
component: w,
|
|
285
|
+
loader: d,
|
|
291
286
|
meta: {
|
|
292
287
|
title: l,
|
|
293
288
|
...s?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: s.breadcrumbTitle } : {},
|
|
294
289
|
...s,
|
|
295
|
-
menuItemClickable:
|
|
290
|
+
menuItemClickable: n !== void 0,
|
|
296
291
|
icon: t.meta?.icon
|
|
297
292
|
},
|
|
298
|
-
resources:
|
|
299
|
-
errorBoundary: o || /* @__PURE__ */ a(
|
|
293
|
+
resources: r,
|
|
294
|
+
errorBoundary: o || /* @__PURE__ */ a(z, {}),
|
|
300
295
|
guards: i
|
|
301
296
|
};
|
|
302
297
|
}
|
|
303
|
-
function
|
|
304
|
-
const { path: e, component: s, subResources:
|
|
298
|
+
function Ys(t) {
|
|
299
|
+
const { path: e, component: s, subResources: n, meta: r, errorBoundary: o, guards: i } = t, l = r?.title ?? E(e), u = E(e), d = i && i.length > 0 ? Vt(i) : void 0, w = s ? Gt(
|
|
300
|
+
{ metaTitle: l, fallbackTitle: u },
|
|
301
|
+
(h) => s({ title: h, resources: n })
|
|
302
|
+
) : void 0;
|
|
305
303
|
return {
|
|
306
304
|
_type: "resource",
|
|
307
305
|
type: "component",
|
|
308
306
|
path: e,
|
|
309
307
|
meta: {
|
|
310
308
|
title: l,
|
|
311
|
-
icon:
|
|
312
|
-
...
|
|
309
|
+
icon: r?.icon,
|
|
310
|
+
...r?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: r.breadcrumbTitle } : {}
|
|
313
311
|
},
|
|
314
|
-
component:
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
),
|
|
318
|
-
subResources: r,
|
|
319
|
-
errorBoundary: o ?? /* @__PURE__ */ a(_, {}),
|
|
312
|
+
component: w,
|
|
313
|
+
subResources: n,
|
|
314
|
+
errorBoundary: o ?? /* @__PURE__ */ a(z, {}),
|
|
320
315
|
guards: i,
|
|
321
|
-
loader:
|
|
316
|
+
loader: d
|
|
322
317
|
};
|
|
323
318
|
}
|
|
324
|
-
const
|
|
325
|
-
const t =
|
|
319
|
+
const Ue = () => {
|
|
320
|
+
const t = B();
|
|
326
321
|
return /* @__PURE__ */ c(S, { children: [
|
|
327
322
|
/* @__PURE__ */ a("p", { className: "astw:font-semibold astw:leading-none astw:tracking-tight", children: t("welcomeTitle") }),
|
|
328
323
|
/* @__PURE__ */ a("p", { className: "pt-4", children: t("welcomeBody") })
|
|
329
324
|
] });
|
|
330
|
-
},
|
|
331
|
-
/* @__PURE__ */ a(
|
|
332
|
-
/* @__PURE__ */ a(
|
|
333
|
-
] }),
|
|
334
|
-
const { configurations: t } =
|
|
325
|
+
}, Ct = () => /* @__PURE__ */ c(S, { children: [
|
|
326
|
+
/* @__PURE__ */ a(ot, {}),
|
|
327
|
+
/* @__PURE__ */ a(Me, {})
|
|
328
|
+
] }), He = () => {
|
|
329
|
+
const { configurations: t } = Ht(), e = B(), s = We();
|
|
335
330
|
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: [
|
|
336
331
|
/* @__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: [
|
|
337
332
|
/* @__PURE__ */ a("h2", { className: "astw:text-sm astw:leading-[36px] astw:mb-2 astw:font-bold ", children: e("settings") }),
|
|
338
|
-
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((
|
|
333
|
+
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((n) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(fe, { to: `./${n.path}`, children: ({ isActive: r }) => /* @__PURE__ */ c(
|
|
339
334
|
O,
|
|
340
335
|
{
|
|
341
|
-
variant:
|
|
336
|
+
variant: r ? "secondary" : "ghost",
|
|
342
337
|
className: "astw:w-full astw:justify-start",
|
|
343
338
|
children: [
|
|
344
|
-
|
|
345
|
-
s(
|
|
339
|
+
n.meta.icon,
|
|
340
|
+
s(n.meta.title, n.path)
|
|
346
341
|
]
|
|
347
342
|
}
|
|
348
|
-
) }) },
|
|
343
|
+
) }) }, n.path)) })
|
|
349
344
|
] }) }),
|
|
350
|
-
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(
|
|
345
|
+
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(ot, {}) })
|
|
351
346
|
] });
|
|
352
|
-
},
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
347
|
+
}, mt = (t) => () => /* @__PURE__ */ a(S, { children: t }), Ke = (t) => t.component ? {
|
|
348
|
+
index: !0,
|
|
349
|
+
Component: t.component,
|
|
350
|
+
...t.loader && { loader: t.loader }
|
|
351
|
+
} : t.loader ? {
|
|
352
|
+
index: !0,
|
|
353
|
+
// No-op component to suppress React Router's warning about a matched
|
|
354
|
+
// leaf route without an element. The loader always throws (404) or
|
|
355
|
+
// returns a redirect Response, so this component never actually renders.
|
|
356
|
+
Component: () => null,
|
|
357
|
+
loader: async (e) => {
|
|
358
|
+
const s = await t.loader(e);
|
|
359
|
+
if (s instanceof Response) return s;
|
|
360
|
+
throw q();
|
|
361
|
+
}
|
|
362
|
+
} : {
|
|
363
|
+
index: !0,
|
|
364
|
+
Component: () => null,
|
|
365
|
+
loader: () => {
|
|
366
|
+
throw q();
|
|
367
|
+
}
|
|
368
|
+
}, qt = (t, e, s) => {
|
|
369
|
+
const n = t.errorBoundary || s, r = (e ?? []).map(
|
|
370
|
+
(l) => qt(l, l.subResources, n)
|
|
371
|
+
), i = [Ke(t), ...r];
|
|
358
372
|
return {
|
|
359
373
|
path: t.path,
|
|
360
374
|
...t.errorBoundary && {
|
|
361
|
-
ErrorBoundary:
|
|
375
|
+
ErrorBoundary: mt(t.errorBoundary)
|
|
362
376
|
},
|
|
363
|
-
...
|
|
364
|
-
children: [
|
|
365
|
-
...n ? [n] : [],
|
|
366
|
-
...e.map(
|
|
367
|
-
(o) => Gt(o, o.subResources, r)
|
|
368
|
-
)
|
|
369
|
-
]
|
|
370
|
-
} : n ? {
|
|
371
|
-
children: [n]
|
|
372
|
-
} : {}
|
|
377
|
+
...i.length > 0 ? { children: i } : {}
|
|
373
378
|
};
|
|
374
|
-
},
|
|
379
|
+
}, Ve = (t) => t.map((e) => qt(e, e.resources, e.errorBoundary)), Ge = ({
|
|
375
380
|
modules: t,
|
|
376
381
|
settingsResources: e,
|
|
377
382
|
rootComponent: s
|
|
378
383
|
}) => {
|
|
379
|
-
const
|
|
384
|
+
const n = {
|
|
380
385
|
index: !0,
|
|
381
|
-
Component: s ??
|
|
382
|
-
},
|
|
386
|
+
Component: s ?? Ue
|
|
387
|
+
}, r = e.length > 0 ? [
|
|
383
388
|
{
|
|
384
389
|
path: "settings",
|
|
385
390
|
index: !0,
|
|
386
|
-
Component: () => /* @__PURE__ */ a(
|
|
391
|
+
Component: () => /* @__PURE__ */ a(ge, { to: e[0].path, relative: "path", replace: !0 })
|
|
387
392
|
},
|
|
388
393
|
{
|
|
389
394
|
path: "settings",
|
|
390
|
-
Component:
|
|
391
|
-
children: e.map((o) =>
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
395
|
+
Component: He,
|
|
396
|
+
children: e.map((o) => {
|
|
397
|
+
if (!o.component)
|
|
398
|
+
throw new Error(`Settings resource "${o.path}" must have a component.`);
|
|
399
|
+
return {
|
|
400
|
+
path: o.path,
|
|
401
|
+
Component: o.component,
|
|
402
|
+
...o.errorBoundary && {
|
|
403
|
+
ErrorBoundary: mt(o.errorBoundary)
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
})
|
|
398
407
|
}
|
|
399
408
|
] : [];
|
|
400
409
|
return [
|
|
401
|
-
|
|
410
|
+
n,
|
|
402
411
|
{
|
|
403
|
-
children:
|
|
412
|
+
children: Ve(t)
|
|
404
413
|
},
|
|
405
|
-
...
|
|
414
|
+
...r,
|
|
406
415
|
{
|
|
407
416
|
path: "*",
|
|
408
417
|
loader: () => {
|
|
409
|
-
throw
|
|
418
|
+
throw q();
|
|
410
419
|
},
|
|
411
420
|
// Component is required to suppress React Router's warning about empty leaf routes,
|
|
412
421
|
// even though the loader always throws and this component will never render.
|
|
413
422
|
Component: () => null,
|
|
414
|
-
ErrorBoundary:
|
|
423
|
+
ErrorBoundary: z
|
|
415
424
|
}
|
|
416
425
|
];
|
|
417
|
-
},
|
|
418
|
-
loaderID:
|
|
419
|
-
loader: async () => ({ navItems:
|
|
420
|
-
}),
|
|
421
|
-
const e =
|
|
426
|
+
}, Yt = "appshell-root-nav", qe = (t) => ({
|
|
427
|
+
loaderID: Yt,
|
|
428
|
+
loader: async () => ({ navItems: Ye(t) })
|
|
429
|
+
}), Qt = () => be(Yt)?.navItems, Ye = async (t) => {
|
|
430
|
+
const e = Ut(t.locale);
|
|
422
431
|
return (await Promise.all(
|
|
423
|
-
t.modules.map(async (
|
|
424
|
-
if (
|
|
425
|
-
const o = await
|
|
426
|
-
|
|
427
|
-
|
|
432
|
+
t.modules.map(async (n) => {
|
|
433
|
+
if (n.path.startsWith(":") || (await wt(n.guards)).type !== "pass") return null;
|
|
434
|
+
const o = await Xt(
|
|
435
|
+
n.resources,
|
|
436
|
+
n.path,
|
|
428
437
|
e
|
|
429
438
|
);
|
|
430
|
-
return o.length === 0 ? null : { module:
|
|
439
|
+
return o.length === 0 ? null : { module: n, resources: o };
|
|
431
440
|
})
|
|
432
|
-
)).filter((
|
|
433
|
-
title: e(
|
|
434
|
-
url:
|
|
435
|
-
icon:
|
|
436
|
-
items:
|
|
441
|
+
)).filter((n) => n !== null).map(({ module: n, resources: r }) => ({
|
|
442
|
+
title: e(n.meta.title, n.path),
|
|
443
|
+
url: n.meta.menuItemClickable ? n.path : void 0,
|
|
444
|
+
icon: n.meta.icon || /* @__PURE__ */ a(ke, {}),
|
|
445
|
+
items: r
|
|
437
446
|
}));
|
|
438
|
-
},
|
|
439
|
-
t.map(async (
|
|
440
|
-
if (
|
|
441
|
-
const i = `${e}/${
|
|
442
|
-
return {
|
|
447
|
+
}, Xt = async (t, e, s) => (await Promise.all(
|
|
448
|
+
t.map(async (r) => {
|
|
449
|
+
if (r.path.startsWith(":") || (await wt(r.guards)).type !== "pass") return null;
|
|
450
|
+
const i = `${e}/${r.path}`, l = s(r.meta.title, r.path), u = r.component !== void 0, d = r.subResources ? await Xt(r.subResources, i, s) : void 0, w = d && d.length > 0;
|
|
451
|
+
return !u && !w ? null : {
|
|
443
452
|
title: l,
|
|
444
|
-
url: i,
|
|
445
|
-
items:
|
|
453
|
+
url: u ? i : void 0,
|
|
454
|
+
items: w ? d : void 0
|
|
446
455
|
};
|
|
447
456
|
})
|
|
448
|
-
)).filter((
|
|
449
|
-
const { configurations: e } = C(), { rootComponent: s, children:
|
|
457
|
+
)).filter((r) => r !== null), Qe = (t) => {
|
|
458
|
+
const { configurations: e } = C(), { rootComponent: s, children: n } = t, r = Ge({
|
|
450
459
|
modules: e.modules,
|
|
451
460
|
settingsResources: e.settingsResources,
|
|
452
461
|
rootComponent: s
|
|
453
|
-
}), o = e.errorBoundary, { loaderID: i, loader: l } =
|
|
462
|
+
}), o = e.errorBoundary, { loaderID: i, loader: l } = qe({
|
|
454
463
|
modules: e.modules,
|
|
455
464
|
locale: e.locale
|
|
456
465
|
}), u = [
|
|
457
466
|
{
|
|
458
467
|
id: i,
|
|
459
468
|
loader: l,
|
|
460
|
-
element:
|
|
469
|
+
element: n,
|
|
461
470
|
children: o ? [
|
|
462
471
|
{
|
|
463
|
-
element: /* @__PURE__ */ a(
|
|
464
|
-
ErrorBoundary:
|
|
465
|
-
children:
|
|
472
|
+
element: /* @__PURE__ */ a(ot, {}),
|
|
473
|
+
ErrorBoundary: mt(o),
|
|
474
|
+
children: r
|
|
466
475
|
}
|
|
467
|
-
] :
|
|
476
|
+
] : r,
|
|
468
477
|
/*
|
|
469
478
|
* Hydration fallback is unused in CSR-only usage of AppShell.
|
|
470
479
|
* return null to silence hydration warnings.
|
|
471
480
|
*/
|
|
472
481
|
HydrateFallback: () => null
|
|
473
482
|
}
|
|
474
|
-
],
|
|
475
|
-
basename:
|
|
483
|
+
], d = e.basePath ? "/" + e.basePath : void 0, w = t.memory ? ve(u, {
|
|
484
|
+
basename: d,
|
|
476
485
|
...t.initialEntries ? { initialEntries: t.initialEntries } : {}
|
|
477
|
-
}) :
|
|
478
|
-
basename:
|
|
486
|
+
}) : xe(u, {
|
|
487
|
+
basename: d
|
|
479
488
|
});
|
|
480
|
-
return /* @__PURE__ */ a(
|
|
481
|
-
},
|
|
489
|
+
return /* @__PURE__ */ a(ye, { router: w });
|
|
490
|
+
}, Xe = {
|
|
482
491
|
resolvedTheme: "light",
|
|
483
492
|
theme: "system",
|
|
484
493
|
setTheme: () => null
|
|
485
|
-
},
|
|
486
|
-
function
|
|
494
|
+
}, Zt = Z(Xe);
|
|
495
|
+
function Ze({
|
|
487
496
|
children: t,
|
|
488
497
|
storageKey: e,
|
|
489
498
|
defaultTheme: s = "system",
|
|
490
|
-
...
|
|
499
|
+
...n
|
|
491
500
|
}) {
|
|
492
|
-
const [
|
|
501
|
+
const [r, o] = V(
|
|
493
502
|
() => localStorage.getItem(e) || s
|
|
494
|
-
), i =
|
|
503
|
+
), i = M(() => r !== "system" ? r : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [r]);
|
|
495
504
|
F(() => {
|
|
496
505
|
const u = window.document.documentElement;
|
|
497
506
|
u.classList.remove("light", "dark"), u.classList.add(i);
|
|
498
507
|
}, [i]);
|
|
499
508
|
const l = {
|
|
500
509
|
resolvedTheme: i,
|
|
501
|
-
theme:
|
|
510
|
+
theme: r,
|
|
502
511
|
setTheme: (u) => {
|
|
503
512
|
localStorage.setItem(e, u), o(u);
|
|
504
513
|
}
|
|
505
514
|
};
|
|
506
|
-
return /* @__PURE__ */ a(
|
|
515
|
+
return /* @__PURE__ */ a(Zt.Provider, { ...n, value: l, children: t });
|
|
507
516
|
}
|
|
508
|
-
const
|
|
509
|
-
const t =
|
|
517
|
+
const Je = () => {
|
|
518
|
+
const t = I(Zt);
|
|
510
519
|
if (t === void 0) throw new Error("useTheme must be used within a ThemeProvider");
|
|
511
520
|
return t;
|
|
512
|
-
},
|
|
513
|
-
},
|
|
514
|
-
function
|
|
515
|
-
return
|
|
521
|
+
}, ta = () => () => {
|
|
522
|
+
}, ea = () => !0, aa = () => !1;
|
|
523
|
+
function sa() {
|
|
524
|
+
return Ot(ta, ea, aa);
|
|
516
525
|
}
|
|
517
|
-
function
|
|
526
|
+
function na(t) {
|
|
518
527
|
const e = {
|
|
519
528
|
path: "",
|
|
520
529
|
fullPath: "",
|
|
@@ -522,150 +531,145 @@ function ea(t) {
|
|
|
522
531
|
children: /* @__PURE__ */ new Map()
|
|
523
532
|
};
|
|
524
533
|
for (const s of t) {
|
|
525
|
-
const
|
|
526
|
-
let
|
|
527
|
-
for (const i of
|
|
528
|
-
i.type !== "group" && (o = o ? `${o}/${i.converted}` : i.converted,
|
|
534
|
+
const n = Ie(s.path);
|
|
535
|
+
let r = e, o = "";
|
|
536
|
+
for (const i of n)
|
|
537
|
+
i.type !== "group" && (o = o ? `${o}/${i.converted}` : i.converted, r.children.has(i.converted) || r.children.set(i.converted, {
|
|
529
538
|
path: i.converted,
|
|
530
539
|
fullPath: o,
|
|
531
540
|
guards: [],
|
|
532
541
|
children: /* @__PURE__ */ new Map()
|
|
533
|
-
}),
|
|
534
|
-
|
|
542
|
+
}), r = r.children.get(i.converted));
|
|
543
|
+
r.component = s.component, r.guards = s.component.appShellPageProps?.guards ?? [];
|
|
535
544
|
}
|
|
536
545
|
return e;
|
|
537
546
|
}
|
|
538
|
-
function
|
|
539
|
-
return t?.appShellPageProps?.meta?.title ??
|
|
547
|
+
function Jt(t, e) {
|
|
548
|
+
return t?.appShellPageProps?.meta?.title ?? E(e || "home");
|
|
540
549
|
}
|
|
541
|
-
function
|
|
542
|
-
const e = t.component, s =
|
|
550
|
+
function te(t) {
|
|
551
|
+
const e = t.component, s = Jt(e, t.path), n = e?.appShellPageProps?.meta?.icon, r = e?.appShellPageProps?.loader, o = [];
|
|
543
552
|
for (const i of t.children.values())
|
|
544
|
-
o.push(
|
|
553
|
+
o.push(te(i));
|
|
545
554
|
return {
|
|
546
555
|
_type: "resource",
|
|
547
556
|
type: "component",
|
|
548
557
|
path: t.path,
|
|
549
558
|
meta: {
|
|
550
559
|
title: s,
|
|
551
|
-
icon:
|
|
560
|
+
icon: n
|
|
552
561
|
},
|
|
553
|
-
component: e ? () => /* @__PURE__ */ a(e, {}) :
|
|
562
|
+
component: e ? () => /* @__PURE__ */ a(e, {}) : void 0,
|
|
554
563
|
subResources: o.length > 0 ? o : void 0,
|
|
555
|
-
errorBoundary: /* @__PURE__ */ a(
|
|
564
|
+
errorBoundary: /* @__PURE__ */ a(z, {}),
|
|
556
565
|
guards: t.guards,
|
|
557
|
-
loader:
|
|
566
|
+
loader: r
|
|
558
567
|
};
|
|
559
568
|
}
|
|
560
|
-
function
|
|
561
|
-
const e = t.component;
|
|
562
|
-
if (!e)
|
|
563
|
-
throw new Error(
|
|
564
|
-
`Module "${t.path}" must have a component. Add a page file (e.g., page.tsx) to the module directory.`
|
|
565
|
-
);
|
|
566
|
-
const s = Zt(e, t.path), r = e.appShellPageProps?.meta?.icon, n = e.appShellPageProps?.loader, o = [];
|
|
569
|
+
function Tt(t) {
|
|
570
|
+
const e = t.component, s = Jt(e, t.path), n = e?.appShellPageProps?.meta?.icon, r = e?.appShellPageProps?.loader, o = [];
|
|
567
571
|
for (const i of t.children.values())
|
|
568
|
-
o.push(
|
|
572
|
+
o.push(te(i));
|
|
569
573
|
return {
|
|
570
574
|
_type: "module",
|
|
571
575
|
type: "component",
|
|
572
576
|
path: t.path,
|
|
573
577
|
meta: {
|
|
574
578
|
title: s,
|
|
575
|
-
icon:
|
|
579
|
+
icon: n,
|
|
576
580
|
menuItemClickable: e !== void 0
|
|
577
581
|
},
|
|
578
|
-
component: () => /* @__PURE__ */ a(e, {}),
|
|
582
|
+
component: e ? () => /* @__PURE__ */ a(e, {}) : void 0,
|
|
579
583
|
resources: o,
|
|
580
|
-
errorBoundary: /* @__PURE__ */ a(
|
|
584
|
+
errorBoundary: /* @__PURE__ */ a(z, {}),
|
|
581
585
|
guards: t.guards,
|
|
582
|
-
loader:
|
|
586
|
+
loader: r
|
|
583
587
|
};
|
|
584
588
|
}
|
|
585
|
-
function
|
|
589
|
+
function ra(t) {
|
|
586
590
|
if (t.length === 0)
|
|
587
591
|
return [];
|
|
588
|
-
const e =
|
|
592
|
+
const e = na(t), s = [];
|
|
589
593
|
if (e.component) {
|
|
590
|
-
const
|
|
594
|
+
const n = Tt({
|
|
591
595
|
...e,
|
|
592
596
|
path: "",
|
|
593
597
|
children: /* @__PURE__ */ new Map()
|
|
594
598
|
// Root module doesn't include children as resources
|
|
595
599
|
});
|
|
596
|
-
s.push(
|
|
600
|
+
s.push(n);
|
|
597
601
|
}
|
|
598
|
-
for (const
|
|
599
|
-
s.push(
|
|
602
|
+
for (const n of e.children.values())
|
|
603
|
+
s.push(Tt(n));
|
|
600
604
|
return s;
|
|
601
605
|
}
|
|
602
|
-
const
|
|
603
|
-
const e =
|
|
604
|
-
|
|
605
|
-
const
|
|
606
|
-
() =>
|
|
607
|
-
modules:
|
|
606
|
+
const ee = (t) => {
|
|
607
|
+
const e = sa(), s = t.contextData ?? {};
|
|
608
|
+
je(s);
|
|
609
|
+
const n = t.modules, r = M(
|
|
610
|
+
() => n ? $e({
|
|
611
|
+
modules: n,
|
|
608
612
|
settingsResources: t.settingsResources,
|
|
609
613
|
basePath: t.basePath,
|
|
610
614
|
errorBoundary: t.errorBoundary,
|
|
611
615
|
locale: t.locale
|
|
612
616
|
}) : null,
|
|
613
|
-
[
|
|
614
|
-
), o =
|
|
615
|
-
() =>
|
|
616
|
-
[t.title, t.icon,
|
|
617
|
-
), i =
|
|
617
|
+
[n, t.settingsResources, t.basePath, t.errorBoundary, t.locale]
|
|
618
|
+
), o = M(
|
|
619
|
+
() => r ? { title: t.title, icon: t.icon, configurations: r } : null,
|
|
620
|
+
[t.title, t.icon, r]
|
|
621
|
+
), i = M(
|
|
618
622
|
() => ({ contextData: t.contextData ?? {} }),
|
|
619
623
|
[t.contextData]
|
|
620
624
|
);
|
|
621
|
-
if (!
|
|
625
|
+
if (!n || !o) {
|
|
622
626
|
const l = "[AppShell] No routes configured. Either use the appShellRoutes() vite-plugin for automatic page configuration, or pass the 'modules' prop for manual configuration.";
|
|
623
627
|
return console.error(l), /* @__PURE__ */ a("div", { className: "astw:flex astw:min-h-screen astw:items-center astw:justify-center astw:bg-background astw:p-4", children: /* @__PURE__ */ c("div", { className: "astw:max-w-md astw:rounded-lg astw:border astw:border-destructive/50 astw:bg-destructive/10 astw:p-6 astw:text-center", children: [
|
|
624
628
|
/* @__PURE__ */ a("h1", { className: "astw:mb-2 astw:text-lg astw:font-semibold astw:text-destructive", children: "Configuration Error" }),
|
|
625
629
|
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: l })
|
|
626
630
|
] }) });
|
|
627
631
|
}
|
|
628
|
-
return e ? /* @__PURE__ */ a(
|
|
632
|
+
return e ? /* @__PURE__ */ a(dt.Provider, { value: o, children: /* @__PURE__ */ a(ut.Provider, { value: i, children: /* @__PURE__ */ a(Ze, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(Qe, { rootComponent: t.rootComponent, children: t.children }) }) }) }) : null;
|
|
629
633
|
};
|
|
630
|
-
function
|
|
631
|
-
const e =
|
|
634
|
+
function oa(t) {
|
|
635
|
+
const e = ra(t), s = e.find((o) => o.path === ""), n = e.filter((o) => o.path !== "");
|
|
632
636
|
return (o) => /* @__PURE__ */ a(
|
|
633
|
-
|
|
637
|
+
ee,
|
|
634
638
|
{
|
|
635
639
|
...o,
|
|
636
|
-
modules:
|
|
640
|
+
modules: n,
|
|
637
641
|
rootComponent: o.rootComponent ?? s?.component
|
|
638
642
|
}
|
|
639
643
|
);
|
|
640
644
|
}
|
|
641
|
-
|
|
642
|
-
const
|
|
643
|
-
function
|
|
644
|
-
const [t, e] =
|
|
645
|
-
return
|
|
646
|
-
const s = window.matchMedia(`(max-width: ${
|
|
647
|
-
e(window.innerWidth <
|
|
645
|
+
ee.WithPages = oa;
|
|
646
|
+
const tt = 768;
|
|
647
|
+
function ia() {
|
|
648
|
+
const [t, e] = g.useState(void 0);
|
|
649
|
+
return g.useEffect(() => {
|
|
650
|
+
const s = window.matchMedia(`(max-width: ${tt - 1}px)`), n = () => {
|
|
651
|
+
e(window.innerWidth < tt);
|
|
648
652
|
};
|
|
649
|
-
return s.addEventListener("change",
|
|
653
|
+
return s.addEventListener("change", n), e(window.innerWidth < tt), () => s.removeEventListener("change", n);
|
|
650
654
|
}, []), !!t;
|
|
651
655
|
}
|
|
652
|
-
const
|
|
653
|
-
function
|
|
654
|
-
const [t, e] =
|
|
655
|
-
return
|
|
656
|
+
const et = 768, at = 1199;
|
|
657
|
+
function la() {
|
|
658
|
+
const [t, e] = g.useState(void 0);
|
|
659
|
+
return g.useEffect(() => {
|
|
656
660
|
const s = window.matchMedia(
|
|
657
|
-
`(min-width: ${
|
|
658
|
-
),
|
|
661
|
+
`(min-width: ${et}px) and (max-width: ${at}px)`
|
|
662
|
+
), n = () => {
|
|
659
663
|
e(
|
|
660
|
-
window.innerWidth >=
|
|
664
|
+
window.innerWidth >= et && window.innerWidth <= at
|
|
661
665
|
);
|
|
662
666
|
};
|
|
663
|
-
return s.addEventListener("change",
|
|
664
|
-
window.innerWidth >=
|
|
665
|
-
), () => s.removeEventListener("change",
|
|
667
|
+
return s.addEventListener("change", n), e(
|
|
668
|
+
window.innerWidth >= et && window.innerWidth <= at
|
|
669
|
+
), () => s.removeEventListener("change", n);
|
|
666
670
|
}, []), !!t;
|
|
667
671
|
}
|
|
668
|
-
function
|
|
672
|
+
function ca({ className: t, type: e, ...s }) {
|
|
669
673
|
return /* @__PURE__ */ a(
|
|
670
674
|
"input",
|
|
671
675
|
{
|
|
@@ -681,11 +685,11 @@ function oa({ className: t, type: e, ...s }) {
|
|
|
681
685
|
}
|
|
682
686
|
);
|
|
683
687
|
}
|
|
684
|
-
function
|
|
688
|
+
function da({
|
|
685
689
|
className: t,
|
|
686
690
|
orientation: e = "horizontal",
|
|
687
691
|
decorative: s = !0,
|
|
688
|
-
...
|
|
692
|
+
...n
|
|
689
693
|
}) {
|
|
690
694
|
return /* @__PURE__ */ a(
|
|
691
695
|
"div",
|
|
@@ -699,19 +703,19 @@ function ia({
|
|
|
699
703
|
e === "horizontal" ? "astw:h-px astw:w-full" : "astw:h-full astw:w-px",
|
|
700
704
|
t
|
|
701
705
|
),
|
|
702
|
-
...
|
|
706
|
+
...n
|
|
703
707
|
}
|
|
704
708
|
);
|
|
705
709
|
}
|
|
706
|
-
function
|
|
707
|
-
return /* @__PURE__ */ a(
|
|
710
|
+
function kt({ ...t }) {
|
|
711
|
+
return /* @__PURE__ */ a(x.Root, { "data-slot": "sheet", ...t });
|
|
708
712
|
}
|
|
709
|
-
function
|
|
710
|
-
return /* @__PURE__ */ a(
|
|
713
|
+
function ua({ ...t }) {
|
|
714
|
+
return /* @__PURE__ */ a(x.Portal, { "data-slot": "sheet-portal", ...t });
|
|
711
715
|
}
|
|
712
|
-
function
|
|
716
|
+
function wa({ className: t, ...e }) {
|
|
713
717
|
return /* @__PURE__ */ a(
|
|
714
|
-
|
|
718
|
+
x.Backdrop,
|
|
715
719
|
{
|
|
716
720
|
"data-slot": "sheet-overlay",
|
|
717
721
|
className: m(
|
|
@@ -722,16 +726,16 @@ function ca({ className: t, ...e }) {
|
|
|
722
726
|
}
|
|
723
727
|
);
|
|
724
728
|
}
|
|
725
|
-
function
|
|
729
|
+
function Rt({
|
|
726
730
|
className: t,
|
|
727
731
|
children: e,
|
|
728
732
|
side: s = "right",
|
|
729
|
-
...
|
|
733
|
+
...n
|
|
730
734
|
}) {
|
|
731
|
-
return /* @__PURE__ */ c(
|
|
732
|
-
/* @__PURE__ */ a(
|
|
735
|
+
return /* @__PURE__ */ c(ua, { children: [
|
|
736
|
+
/* @__PURE__ */ a(wa, {}),
|
|
733
737
|
/* @__PURE__ */ c(
|
|
734
|
-
|
|
738
|
+
x.Popup,
|
|
735
739
|
{
|
|
736
740
|
"data-slot": "sheet-content",
|
|
737
741
|
className: m(
|
|
@@ -742,11 +746,11 @@ function Tt({
|
|
|
742
746
|
s === "bottom" && "astw:data-ending-style:slide-out-to-bottom astw:data-open:slide-in-from-bottom astw:inset-x-0 astw:bottom-0 astw:h-auto astw:border-t",
|
|
743
747
|
t
|
|
744
748
|
),
|
|
745
|
-
...
|
|
749
|
+
...n,
|
|
746
750
|
children: [
|
|
747
751
|
e,
|
|
748
|
-
/* @__PURE__ */ c(
|
|
749
|
-
/* @__PURE__ */ a(
|
|
752
|
+
/* @__PURE__ */ c(x.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-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: [
|
|
753
|
+
/* @__PURE__ */ a(Wt, { className: "astw:size-4" }),
|
|
750
754
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
751
755
|
] })
|
|
752
756
|
]
|
|
@@ -754,7 +758,7 @@ function Tt({
|
|
|
754
758
|
)
|
|
755
759
|
] });
|
|
756
760
|
}
|
|
757
|
-
function
|
|
761
|
+
function Pt({ className: t, ...e }) {
|
|
758
762
|
return /* @__PURE__ */ a(
|
|
759
763
|
"div",
|
|
760
764
|
{
|
|
@@ -764,9 +768,9 @@ function kt({ className: t, ...e }) {
|
|
|
764
768
|
}
|
|
765
769
|
);
|
|
766
770
|
}
|
|
767
|
-
function
|
|
771
|
+
function At({ className: t, ...e }) {
|
|
768
772
|
return /* @__PURE__ */ a(
|
|
769
|
-
|
|
773
|
+
x.Title,
|
|
770
774
|
{
|
|
771
775
|
"data-slot": "sheet-title",
|
|
772
776
|
className: m("astw:text-foreground astw:font-semibold", t),
|
|
@@ -774,12 +778,12 @@ function Rt({ className: t, ...e }) {
|
|
|
774
778
|
}
|
|
775
779
|
);
|
|
776
780
|
}
|
|
777
|
-
function
|
|
781
|
+
function Bt({
|
|
778
782
|
className: t,
|
|
779
783
|
...e
|
|
780
784
|
}) {
|
|
781
785
|
return /* @__PURE__ */ a(
|
|
782
|
-
|
|
786
|
+
x.Description,
|
|
783
787
|
{
|
|
784
788
|
"data-slot": "sheet-description",
|
|
785
789
|
className: m("astw:text-muted-foreground astw:text-sm", t),
|
|
@@ -787,29 +791,29 @@ function Pt({
|
|
|
787
791
|
}
|
|
788
792
|
);
|
|
789
793
|
}
|
|
790
|
-
function
|
|
794
|
+
function ht({
|
|
791
795
|
delayDuration: t = 0,
|
|
792
796
|
children: e,
|
|
793
797
|
...s
|
|
794
798
|
}) {
|
|
795
|
-
return /* @__PURE__ */ a(
|
|
799
|
+
return /* @__PURE__ */ a(A.Provider, { "data-slot": "tooltip-provider", delay: t, ...s, children: e });
|
|
796
800
|
}
|
|
797
|
-
function
|
|
798
|
-
return /* @__PURE__ */ a(
|
|
801
|
+
function pt({ children: t, ...e }) {
|
|
802
|
+
return /* @__PURE__ */ a(ht, { children: /* @__PURE__ */ a(A.Root, { "data-slot": "tooltip", ...e, children: t }) });
|
|
799
803
|
}
|
|
800
|
-
function
|
|
801
|
-
return /* @__PURE__ */ a(
|
|
804
|
+
function ft({ ...t }) {
|
|
805
|
+
return /* @__PURE__ */ a(A.Trigger, { "data-slot": "tooltip-trigger", ...t });
|
|
802
806
|
}
|
|
803
|
-
function
|
|
807
|
+
function gt({
|
|
804
808
|
className: t,
|
|
805
809
|
sideOffset: e = 0,
|
|
806
810
|
side: s = "top",
|
|
807
|
-
align:
|
|
808
|
-
children:
|
|
811
|
+
align: n = "center",
|
|
812
|
+
children: r,
|
|
809
813
|
...o
|
|
810
814
|
}) {
|
|
811
|
-
return /* @__PURE__ */ a(
|
|
812
|
-
|
|
815
|
+
return /* @__PURE__ */ a(A.Portal, { children: /* @__PURE__ */ a(A.Positioner, { sideOffset: e, side: s, align: n, children: /* @__PURE__ */ c(
|
|
816
|
+
A.Popup,
|
|
813
817
|
{
|
|
814
818
|
"data-slot": "tooltip-content",
|
|
815
819
|
className: m(
|
|
@@ -818,125 +822,125 @@ function ft({
|
|
|
818
822
|
),
|
|
819
823
|
...o,
|
|
820
824
|
children: [
|
|
821
|
-
|
|
822
|
-
/* @__PURE__ */ a(
|
|
825
|
+
r,
|
|
826
|
+
/* @__PURE__ */ a(A.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]" })
|
|
823
827
|
]
|
|
824
828
|
}
|
|
825
829
|
) }) });
|
|
826
830
|
}
|
|
827
|
-
const
|
|
828
|
-
function
|
|
829
|
-
const t =
|
|
831
|
+
const ae = "16rem", ma = "18rem", ha = "3rem", pa = "b", se = g.createContext(null);
|
|
832
|
+
function H() {
|
|
833
|
+
const t = g.useContext(se);
|
|
830
834
|
if (!t)
|
|
831
835
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
832
836
|
return t;
|
|
833
837
|
}
|
|
834
|
-
function
|
|
838
|
+
function fa({
|
|
835
839
|
defaultOpen: t = !0,
|
|
836
840
|
open: e,
|
|
837
841
|
onOpenChange: s,
|
|
838
|
-
className:
|
|
839
|
-
style:
|
|
842
|
+
className: n,
|
|
843
|
+
style: r,
|
|
840
844
|
children: o,
|
|
841
845
|
...i
|
|
842
846
|
}) {
|
|
843
|
-
const l =
|
|
847
|
+
const l = ia(), u = la(), [d, w] = g.useState(!1), [h, f] = g.useState(!1), [b, p] = g.useState(t), v = e ?? b, k = g.useCallback(
|
|
844
848
|
(y) => {
|
|
845
|
-
const P = typeof y == "function" ? y(
|
|
846
|
-
s ? s(P) :
|
|
849
|
+
const P = typeof y == "function" ? y(v) : y;
|
|
850
|
+
s ? s(P) : p(P);
|
|
847
851
|
},
|
|
848
|
-
[s,
|
|
849
|
-
), R = u && !l,
|
|
850
|
-
|
|
852
|
+
[s, v]
|
|
853
|
+
), R = u && !l, K = g.useCallback(() => l ? w((y) => !y) : R ? f((y) => !y) : k((y) => !y), [l, R, k, w]);
|
|
854
|
+
g.useEffect(() => {
|
|
851
855
|
const y = (P) => {
|
|
852
|
-
P.key ===
|
|
856
|
+
P.key === pa && (P.metaKey || P.ctrlKey) && (P.preventDefault(), K());
|
|
853
857
|
};
|
|
854
858
|
return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
|
|
855
|
-
}, [
|
|
856
|
-
const
|
|
859
|
+
}, [K]);
|
|
860
|
+
const Nt = v ? "expanded" : "collapsed", we = g.useMemo(
|
|
857
861
|
() => ({
|
|
858
|
-
state:
|
|
859
|
-
open:
|
|
862
|
+
state: Nt,
|
|
863
|
+
open: v,
|
|
860
864
|
setOpen: k,
|
|
861
865
|
isMobile: l,
|
|
862
|
-
openMobile:
|
|
863
|
-
setOpenMobile:
|
|
864
|
-
toggleSidebar:
|
|
866
|
+
openMobile: d,
|
|
867
|
+
setOpenMobile: w,
|
|
868
|
+
toggleSidebar: K,
|
|
865
869
|
isIconMode: R,
|
|
866
870
|
openIconMode: h,
|
|
867
|
-
setOpenIconMode:
|
|
871
|
+
setOpenIconMode: f
|
|
868
872
|
}),
|
|
869
873
|
[
|
|
870
|
-
|
|
871
|
-
|
|
874
|
+
Nt,
|
|
875
|
+
v,
|
|
872
876
|
k,
|
|
873
877
|
l,
|
|
874
|
-
w,
|
|
875
878
|
d,
|
|
876
|
-
|
|
879
|
+
w,
|
|
880
|
+
K,
|
|
877
881
|
R,
|
|
878
882
|
h,
|
|
879
|
-
|
|
883
|
+
f
|
|
880
884
|
]
|
|
881
885
|
);
|
|
882
|
-
return /* @__PURE__ */ a(
|
|
886
|
+
return /* @__PURE__ */ a(se.Provider, { value: we, children: /* @__PURE__ */ a(ht, { delayDuration: 0, children: /* @__PURE__ */ a(
|
|
883
887
|
"div",
|
|
884
888
|
{
|
|
885
889
|
"data-slot": "sidebar-wrapper",
|
|
886
890
|
style: {
|
|
887
|
-
"--sidebar-width":
|
|
888
|
-
"--sidebar-width-icon":
|
|
889
|
-
...
|
|
891
|
+
"--sidebar-width": ae,
|
|
892
|
+
"--sidebar-width-icon": ha,
|
|
893
|
+
...r
|
|
890
894
|
},
|
|
891
895
|
className: m(
|
|
892
896
|
"astw:group/sidebar-wrapper astw:has-data-[variant=inset]:bg-sidebar astw:flex astw:min-h-svh astw:w-full astw:overflow-hidden",
|
|
893
|
-
|
|
897
|
+
n
|
|
894
898
|
),
|
|
895
899
|
...i,
|
|
896
900
|
children: o
|
|
897
901
|
}
|
|
898
902
|
) }) });
|
|
899
903
|
}
|
|
900
|
-
function
|
|
904
|
+
function ga({
|
|
901
905
|
side: t = "left",
|
|
902
906
|
variant: e = "sidebar",
|
|
903
907
|
collapsible: s = "offcanvas",
|
|
904
|
-
className:
|
|
905
|
-
children:
|
|
908
|
+
className: n,
|
|
909
|
+
children: r,
|
|
906
910
|
...o
|
|
907
911
|
}) {
|
|
908
|
-
const { isMobile: i, state: l, openMobile: u, setOpenMobile:
|
|
912
|
+
const { isMobile: i, state: l, openMobile: u, setOpenMobile: d, isIconMode: w, openIconMode: h, setOpenIconMode: f } = H();
|
|
909
913
|
return s === "none" ? /* @__PURE__ */ a(
|
|
910
914
|
"div",
|
|
911
915
|
{
|
|
912
916
|
"data-slot": "sidebar",
|
|
913
917
|
className: m(
|
|
914
918
|
"astw:bg-sidebar astw:text-sidebar-foreground astw:flex astw:h-full astw:w-(--sidebar-width) astw:flex-col",
|
|
915
|
-
|
|
919
|
+
n
|
|
916
920
|
),
|
|
917
921
|
...o,
|
|
918
|
-
children:
|
|
922
|
+
children: r
|
|
919
923
|
}
|
|
920
|
-
) : i ? /* @__PURE__ */ a(
|
|
921
|
-
|
|
924
|
+
) : i ? /* @__PURE__ */ a(kt, { open: u, onOpenChange: d, ...o, children: /* @__PURE__ */ c(
|
|
925
|
+
Rt,
|
|
922
926
|
{
|
|
923
927
|
"data-sidebar": "sidebar",
|
|
924
928
|
"data-slot": "sidebar",
|
|
925
929
|
"data-mobile": "true",
|
|
926
930
|
className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
|
|
927
931
|
style: {
|
|
928
|
-
"--sidebar-width":
|
|
932
|
+
"--sidebar-width": ma
|
|
929
933
|
},
|
|
930
934
|
side: t,
|
|
931
935
|
children: [
|
|
932
|
-
/* @__PURE__ */ c(
|
|
933
|
-
/* @__PURE__ */ a(
|
|
934
|
-
/* @__PURE__ */ a(
|
|
936
|
+
/* @__PURE__ */ c(Pt, { className: "astw:sr-only", children: [
|
|
937
|
+
/* @__PURE__ */ a(At, { children: "Sidebar" }),
|
|
938
|
+
/* @__PURE__ */ a(Bt, { children: "Displays the mobile sidebar." })
|
|
935
939
|
] }),
|
|
936
|
-
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children:
|
|
940
|
+
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: r })
|
|
937
941
|
]
|
|
938
942
|
}
|
|
939
|
-
) }) :
|
|
943
|
+
) }) : w && s === "icon" ? /* @__PURE__ */ c(S, { children: [
|
|
940
944
|
/* @__PURE__ */ c(
|
|
941
945
|
"div",
|
|
942
946
|
{
|
|
@@ -973,7 +977,7 @@ function ha({
|
|
|
973
977
|
"data-sidebar": "sidebar",
|
|
974
978
|
"data-slot": "sidebar-inner",
|
|
975
979
|
className: "astw:bg-sidebar astw:group-data-[variant=floating]:border-sidebar-border astw:flex astw:h-full astw:w-full astw:flex-col astw:overflow-hidden astw:group-data-[variant=floating]:rounded-lg astw:group-data-[variant=floating]:border astw:group-data-[variant=floating]:shadow-sm",
|
|
976
|
-
children:
|
|
980
|
+
children: r
|
|
977
981
|
}
|
|
978
982
|
)
|
|
979
983
|
}
|
|
@@ -981,23 +985,23 @@ function ha({
|
|
|
981
985
|
]
|
|
982
986
|
}
|
|
983
987
|
),
|
|
984
|
-
/* @__PURE__ */ a(
|
|
985
|
-
|
|
988
|
+
/* @__PURE__ */ a(kt, { open: h, onOpenChange: f, ...o, children: /* @__PURE__ */ c(
|
|
989
|
+
Rt,
|
|
986
990
|
{
|
|
987
991
|
"data-sidebar": "sidebar",
|
|
988
992
|
"data-slot": "sidebar-overlay",
|
|
989
993
|
"data-icon-mode": "true",
|
|
990
994
|
className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
|
|
991
995
|
style: {
|
|
992
|
-
"--sidebar-width":
|
|
996
|
+
"--sidebar-width": ae
|
|
993
997
|
},
|
|
994
998
|
side: t,
|
|
995
999
|
children: [
|
|
996
|
-
/* @__PURE__ */ c(
|
|
997
|
-
/* @__PURE__ */ a(
|
|
998
|
-
/* @__PURE__ */ a(
|
|
1000
|
+
/* @__PURE__ */ c(Pt, { className: "astw:sr-only", children: [
|
|
1001
|
+
/* @__PURE__ */ a(At, { children: "Sidebar" }),
|
|
1002
|
+
/* @__PURE__ */ a(Bt, { children: "Displays the sidebar overlay." })
|
|
999
1003
|
] }),
|
|
1000
|
-
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children:
|
|
1004
|
+
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: r })
|
|
1001
1005
|
]
|
|
1002
1006
|
}
|
|
1003
1007
|
) })
|
|
@@ -1033,7 +1037,7 @@ function ha({
|
|
|
1033
1037
|
// Adjust the padding for floating and inset variants.
|
|
1034
1038
|
e === "floating" || e === "inset" ? "astw:p-2 astw:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "astw:group-data-[collapsible=icon]:w-(--sidebar-width-icon) astw:group-data-[side=left]:border-r astw:group-data-[side=right]:border-l",
|
|
1035
1039
|
e === "inset" && "astw:border-x astw:border-x-border",
|
|
1036
|
-
|
|
1040
|
+
n
|
|
1037
1041
|
),
|
|
1038
1042
|
...o,
|
|
1039
1043
|
children: /* @__PURE__ */ a(
|
|
@@ -1042,7 +1046,7 @@ function ha({
|
|
|
1042
1046
|
"data-sidebar": "sidebar",
|
|
1043
1047
|
"data-slot": "sidebar-inner",
|
|
1044
1048
|
className: "astw:bg-sidebar astw:group-data-[variant=floating]:border-sidebar-border astw:flex astw:h-full astw:w-full astw:flex-col astw:group-data-[variant=floating]:rounded-lg astw:group-data-[variant=floating]:border astw:group-data-[variant=floating]:shadow-sm",
|
|
1045
|
-
children:
|
|
1049
|
+
children: r
|
|
1046
1050
|
}
|
|
1047
1051
|
)
|
|
1048
1052
|
}
|
|
@@ -1051,8 +1055,8 @@ function ha({
|
|
|
1051
1055
|
}
|
|
1052
1056
|
);
|
|
1053
1057
|
}
|
|
1054
|
-
function
|
|
1055
|
-
const { toggleSidebar:
|
|
1058
|
+
function ne({ className: t, onClick: e, ...s }) {
|
|
1059
|
+
const { toggleSidebar: n } = H();
|
|
1056
1060
|
return /* @__PURE__ */ c(
|
|
1057
1061
|
O,
|
|
1058
1062
|
{
|
|
@@ -1061,18 +1065,18 @@ function se({ className: t, onClick: e, ...s }) {
|
|
|
1061
1065
|
variant: "ghost",
|
|
1062
1066
|
size: "icon",
|
|
1063
1067
|
className: m("astw:text-muted-foreground", t),
|
|
1064
|
-
onClick: (
|
|
1065
|
-
e?.(
|
|
1068
|
+
onClick: (r) => {
|
|
1069
|
+
e?.(r), n();
|
|
1066
1070
|
},
|
|
1067
1071
|
...s,
|
|
1068
1072
|
children: [
|
|
1069
|
-
/* @__PURE__ */ a(
|
|
1073
|
+
/* @__PURE__ */ a(Re, { className: "astw:size-4.5" }),
|
|
1070
1074
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Toggle Sidebar" })
|
|
1071
1075
|
]
|
|
1072
1076
|
}
|
|
1073
1077
|
);
|
|
1074
1078
|
}
|
|
1075
|
-
function
|
|
1079
|
+
function ba({ className: t, ...e }) {
|
|
1076
1080
|
return /* @__PURE__ */ a(
|
|
1077
1081
|
"main",
|
|
1078
1082
|
{
|
|
@@ -1087,7 +1091,7 @@ function pa({ className: t, ...e }) {
|
|
|
1087
1091
|
}
|
|
1088
1092
|
);
|
|
1089
1093
|
}
|
|
1090
|
-
function
|
|
1094
|
+
function va({ className: t, ...e }) {
|
|
1091
1095
|
return /* @__PURE__ */ a(
|
|
1092
1096
|
"div",
|
|
1093
1097
|
{
|
|
@@ -1098,9 +1102,9 @@ function fa({ className: t, ...e }) {
|
|
|
1098
1102
|
}
|
|
1099
1103
|
);
|
|
1100
1104
|
}
|
|
1101
|
-
function
|
|
1105
|
+
function xa({ className: t, ...e }) {
|
|
1102
1106
|
return /* @__PURE__ */ a(
|
|
1103
|
-
|
|
1107
|
+
da,
|
|
1104
1108
|
{
|
|
1105
1109
|
"data-slot": "sidebar-separator",
|
|
1106
1110
|
"data-sidebar": "separator",
|
|
@@ -1109,7 +1113,7 @@ function ga({ className: t, ...e }) {
|
|
|
1109
1113
|
}
|
|
1110
1114
|
);
|
|
1111
1115
|
}
|
|
1112
|
-
function
|
|
1116
|
+
function ya({ className: t, ...e }) {
|
|
1113
1117
|
return /* @__PURE__ */ a(
|
|
1114
1118
|
"div",
|
|
1115
1119
|
{
|
|
@@ -1123,7 +1127,7 @@ function ba({ className: t, ...e }) {
|
|
|
1123
1127
|
}
|
|
1124
1128
|
);
|
|
1125
1129
|
}
|
|
1126
|
-
function
|
|
1130
|
+
function bt({ className: t, ...e }) {
|
|
1127
1131
|
return /* @__PURE__ */ a(
|
|
1128
1132
|
"div",
|
|
1129
1133
|
{
|
|
@@ -1137,7 +1141,7 @@ function gt({ className: t, ...e }) {
|
|
|
1137
1141
|
}
|
|
1138
1142
|
);
|
|
1139
1143
|
}
|
|
1140
|
-
function
|
|
1144
|
+
function vt({ className: t, ...e }) {
|
|
1141
1145
|
return /* @__PURE__ */ a(
|
|
1142
1146
|
"ul",
|
|
1143
1147
|
{
|
|
@@ -1148,7 +1152,7 @@ function bt({ className: t, ...e }) {
|
|
|
1148
1152
|
}
|
|
1149
1153
|
);
|
|
1150
1154
|
}
|
|
1151
|
-
function
|
|
1155
|
+
function L({ className: t, ...e }) {
|
|
1152
1156
|
return /* @__PURE__ */ a(
|
|
1153
1157
|
"li",
|
|
1154
1158
|
{
|
|
@@ -1159,7 +1163,7 @@ function I({ className: t, ...e }) {
|
|
|
1159
1163
|
}
|
|
1160
1164
|
);
|
|
1161
1165
|
}
|
|
1162
|
-
const
|
|
1166
|
+
const Na = it(
|
|
1163
1167
|
"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:group-data-[collapsible=icon]:[&>span:last-child]:hidden astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
|
|
1164
1168
|
{
|
|
1165
1169
|
variants: {
|
|
@@ -1179,50 +1183,50 @@ const xa = ot(
|
|
|
1179
1183
|
}
|
|
1180
1184
|
}
|
|
1181
1185
|
);
|
|
1182
|
-
function
|
|
1186
|
+
function _({
|
|
1183
1187
|
render: t,
|
|
1184
1188
|
isActive: e = !1,
|
|
1185
1189
|
variant: s = "default",
|
|
1186
|
-
size:
|
|
1187
|
-
tooltip:
|
|
1190
|
+
size: n = "default",
|
|
1191
|
+
tooltip: r,
|
|
1188
1192
|
className: o,
|
|
1189
1193
|
children: i,
|
|
1190
1194
|
...l
|
|
1191
1195
|
}) {
|
|
1192
|
-
const { isMobile: u, state:
|
|
1196
|
+
const { isMobile: u, state: d } = H(), w = j({
|
|
1193
1197
|
defaultTagName: "button",
|
|
1194
1198
|
render: t,
|
|
1195
1199
|
props: {
|
|
1196
1200
|
"data-slot": "sidebar-menu-button",
|
|
1197
1201
|
"data-sidebar": "menu-button",
|
|
1198
|
-
"data-size":
|
|
1202
|
+
"data-size": n,
|
|
1199
1203
|
"data-active": e,
|
|
1200
|
-
className: m(
|
|
1204
|
+
className: m(Na({ variant: s, size: n }), o),
|
|
1201
1205
|
children: i,
|
|
1202
1206
|
...l
|
|
1203
1207
|
}
|
|
1204
1208
|
});
|
|
1205
|
-
return
|
|
1206
|
-
children:
|
|
1207
|
-
}), /* @__PURE__ */ c(
|
|
1208
|
-
/* @__PURE__ */ a(
|
|
1209
|
+
return r ? (typeof r == "string" && (r = {
|
|
1210
|
+
children: r
|
|
1211
|
+
}), /* @__PURE__ */ c(pt, { children: [
|
|
1212
|
+
/* @__PURE__ */ a(ft, { render: w }),
|
|
1209
1213
|
/* @__PURE__ */ a(
|
|
1210
|
-
|
|
1214
|
+
gt,
|
|
1211
1215
|
{
|
|
1212
1216
|
side: "right",
|
|
1213
1217
|
align: "center",
|
|
1214
|
-
hidden:
|
|
1215
|
-
...
|
|
1218
|
+
hidden: d !== "collapsed" || u,
|
|
1219
|
+
...r
|
|
1216
1220
|
}
|
|
1217
1221
|
)
|
|
1218
|
-
] })) :
|
|
1222
|
+
] })) : w;
|
|
1219
1223
|
}
|
|
1220
|
-
function
|
|
1224
|
+
function Y({
|
|
1221
1225
|
className: t,
|
|
1222
1226
|
render: e,
|
|
1223
1227
|
showOnHover: s = !1,
|
|
1224
|
-
children:
|
|
1225
|
-
...
|
|
1228
|
+
children: n,
|
|
1229
|
+
...r
|
|
1226
1230
|
}) {
|
|
1227
1231
|
return j({
|
|
1228
1232
|
defaultTagName: "button",
|
|
@@ -1241,12 +1245,12 @@ function q({
|
|
|
1241
1245
|
s && "astw:peer-data-[active=true]/menu-button:text-sidebar-accent-foreground astw:group-focus-within/menu-item:opacity-100 astw:group-hover/menu-item:opacity-100 astw:data-[state=open]:opacity-100 astw:md:opacity-0",
|
|
1242
1246
|
t
|
|
1243
1247
|
),
|
|
1244
|
-
children:
|
|
1245
|
-
...
|
|
1248
|
+
children: n,
|
|
1249
|
+
...r
|
|
1246
1250
|
}
|
|
1247
1251
|
});
|
|
1248
1252
|
}
|
|
1249
|
-
function
|
|
1253
|
+
function st({ className: t, ...e }) {
|
|
1250
1254
|
return /* @__PURE__ */ a(
|
|
1251
1255
|
"ul",
|
|
1252
1256
|
{
|
|
@@ -1261,7 +1265,7 @@ function at({ className: t, ...e }) {
|
|
|
1261
1265
|
}
|
|
1262
1266
|
);
|
|
1263
1267
|
}
|
|
1264
|
-
function
|
|
1268
|
+
function Sa({ className: t, ...e }) {
|
|
1265
1269
|
return /* @__PURE__ */ a(
|
|
1266
1270
|
"li",
|
|
1267
1271
|
{
|
|
@@ -1272,12 +1276,12 @@ function va({ className: t, ...e }) {
|
|
|
1272
1276
|
}
|
|
1273
1277
|
);
|
|
1274
1278
|
}
|
|
1275
|
-
function
|
|
1279
|
+
function Ca({
|
|
1276
1280
|
render: t,
|
|
1277
1281
|
size: e = "md",
|
|
1278
1282
|
isActive: s = !1,
|
|
1279
|
-
className:
|
|
1280
|
-
children:
|
|
1283
|
+
className: n,
|
|
1284
|
+
children: r,
|
|
1281
1285
|
...o
|
|
1282
1286
|
}) {
|
|
1283
1287
|
return j({
|
|
@@ -1294,68 +1298,68 @@ function ya({
|
|
|
1294
1298
|
e === "sm" && "astw:text-xs",
|
|
1295
1299
|
e === "md" && "astw:text-sm",
|
|
1296
1300
|
"astw:group-data-[collapsible=icon]:hidden",
|
|
1297
|
-
|
|
1301
|
+
n
|
|
1298
1302
|
),
|
|
1299
|
-
children:
|
|
1303
|
+
children: r,
|
|
1300
1304
|
...o
|
|
1301
1305
|
}
|
|
1302
1306
|
});
|
|
1303
1307
|
}
|
|
1304
|
-
const
|
|
1305
|
-
const { configurations: e } = C(), { modules: s, locale:
|
|
1306
|
-
return
|
|
1307
|
-
},
|
|
1308
|
-
const
|
|
1308
|
+
const Ta = (t) => {
|
|
1309
|
+
const { configurations: e } = C(), { modules: s, locale: n } = e;
|
|
1310
|
+
return ka(t) ? null : Ra(t, s, n);
|
|
1311
|
+
}, ka = (t) => t.startsWith("http://") || t.startsWith("https://"), Ra = (t, e, s) => {
|
|
1312
|
+
const n = U(s), r = Dt(t);
|
|
1309
1313
|
for (const o of e) {
|
|
1310
|
-
const i =
|
|
1311
|
-
if (re(
|
|
1314
|
+
const i = Dt(o.path);
|
|
1315
|
+
if (re(r, i))
|
|
1312
1316
|
return {
|
|
1313
|
-
title:
|
|
1317
|
+
title: n(o.meta.title, o.path),
|
|
1314
1318
|
icon: o.meta.icon
|
|
1315
1319
|
};
|
|
1316
|
-
const l =
|
|
1320
|
+
const l = oe(r, i, o.resources, n);
|
|
1317
1321
|
if (l)
|
|
1318
1322
|
return l;
|
|
1319
1323
|
}
|
|
1320
1324
|
return null;
|
|
1321
1325
|
}, re = (t, e) => {
|
|
1322
1326
|
if (t === e) return !0;
|
|
1323
|
-
const s = t.split("/"),
|
|
1324
|
-
return s.length !==
|
|
1325
|
-
},
|
|
1327
|
+
const s = t.split("/"), n = e.split("/");
|
|
1328
|
+
return s.length !== n.length ? !1 : n.every((r, o) => r.startsWith(":") || r === s[o]);
|
|
1329
|
+
}, Dt = (t) => {
|
|
1326
1330
|
let e = t;
|
|
1327
1331
|
return e.startsWith("/") || (e = `/${e}`), e.length > 1 && e.endsWith("/") && (e = e.slice(0, -1)), e;
|
|
1328
|
-
},
|
|
1329
|
-
for (const
|
|
1330
|
-
const o = `${e}/${
|
|
1332
|
+
}, oe = (t, e, s, n) => {
|
|
1333
|
+
for (const r of s) {
|
|
1334
|
+
const o = `${e}/${r.path}`;
|
|
1331
1335
|
if (re(t, o))
|
|
1332
1336
|
return {
|
|
1333
|
-
title: r
|
|
1334
|
-
icon:
|
|
1337
|
+
title: n(r.meta.title, r.path),
|
|
1338
|
+
icon: r.meta.icon
|
|
1335
1339
|
};
|
|
1336
|
-
if (
|
|
1337
|
-
const i =
|
|
1340
|
+
if (r.subResources) {
|
|
1341
|
+
const i = oe(t, o, r.subResources, n);
|
|
1338
1342
|
if (i)
|
|
1339
1343
|
return i;
|
|
1340
1344
|
}
|
|
1341
1345
|
}
|
|
1342
1346
|
return null;
|
|
1343
|
-
},
|
|
1347
|
+
}, Qs = (t) => {
|
|
1344
1348
|
const {
|
|
1345
1349
|
to: e,
|
|
1346
1350
|
external: s,
|
|
1347
|
-
render:
|
|
1348
|
-
activeMatch:
|
|
1351
|
+
render: n,
|
|
1352
|
+
activeMatch: r = "prefix",
|
|
1349
1353
|
title: o,
|
|
1350
1354
|
icon: i
|
|
1351
|
-
} = t, { pathname: l } =
|
|
1352
|
-
title:
|
|
1355
|
+
} = t, { pathname: l } = X(), u = Ta(e), d = r === "exact" ? l === e : l === e || l.startsWith(`${e}/`), w = o ?? u?.title ?? Pa(e), h = i ?? u?.icon, f = {
|
|
1356
|
+
title: w,
|
|
1353
1357
|
url: e,
|
|
1354
1358
|
icon: h,
|
|
1355
|
-
isActive:
|
|
1359
|
+
isActive: d
|
|
1356
1360
|
};
|
|
1357
|
-
return s ||
|
|
1358
|
-
|
|
1361
|
+
return s || ie(e) ? /* @__PURE__ */ a(L, { children: /* @__PURE__ */ a(
|
|
1362
|
+
_,
|
|
1359
1363
|
{
|
|
1360
1364
|
render: (
|
|
1361
1365
|
// oxlint-disable-next-line jsx-a11y/anchor-has-content -- content is provided by SidebarMenuButton's children
|
|
@@ -1365,131 +1369,131 @@ const Na = (t) => {
|
|
|
1365
1369
|
href: e,
|
|
1366
1370
|
target: "_blank",
|
|
1367
1371
|
rel: "noopener noreferrer",
|
|
1368
|
-
className:
|
|
1372
|
+
className: d ? "astw:bg-sidebar-accent astw:font-medium" : void 0
|
|
1369
1373
|
}
|
|
1370
1374
|
)
|
|
1371
1375
|
),
|
|
1372
|
-
tooltip:
|
|
1373
|
-
children:
|
|
1374
|
-
h ?? /* @__PURE__ */ a(
|
|
1375
|
-
/* @__PURE__ */ a("span", { children:
|
|
1376
|
+
tooltip: w,
|
|
1377
|
+
children: n ? n(f) : /* @__PURE__ */ c(S, { children: [
|
|
1378
|
+
h ?? /* @__PURE__ */ a(Ft, { className: "astw:size-4" }),
|
|
1379
|
+
/* @__PURE__ */ a("span", { children: w })
|
|
1376
1380
|
] })
|
|
1377
1381
|
}
|
|
1378
|
-
) }) : /* @__PURE__ */ a(
|
|
1379
|
-
|
|
1382
|
+
) }) : /* @__PURE__ */ a(L, { children: /* @__PURE__ */ a(
|
|
1383
|
+
_,
|
|
1380
1384
|
{
|
|
1381
1385
|
render: /* @__PURE__ */ a(
|
|
1382
1386
|
$,
|
|
1383
1387
|
{
|
|
1384
1388
|
to: e,
|
|
1385
|
-
className:
|
|
1389
|
+
className: d ? "astw:bg-sidebar-accent astw:font-medium" : void 0
|
|
1386
1390
|
}
|
|
1387
1391
|
),
|
|
1388
|
-
tooltip:
|
|
1389
|
-
children:
|
|
1392
|
+
tooltip: w,
|
|
1393
|
+
children: n ? n(f) : /* @__PURE__ */ c(S, { children: [
|
|
1390
1394
|
h,
|
|
1391
|
-
/* @__PURE__ */ a("span", { children:
|
|
1395
|
+
/* @__PURE__ */ a("span", { children: w })
|
|
1392
1396
|
] })
|
|
1393
1397
|
}
|
|
1394
1398
|
) });
|
|
1395
|
-
},
|
|
1396
|
-
if (
|
|
1399
|
+
}, ie = (t) => t.startsWith("http://") || t.startsWith("https://"), Pa = (t) => {
|
|
1400
|
+
if (ie(t))
|
|
1397
1401
|
try {
|
|
1398
1402
|
return new URL(t).hostname;
|
|
1399
1403
|
} catch {
|
|
1400
1404
|
return t;
|
|
1401
1405
|
}
|
|
1402
1406
|
const e = t.split("/").filter(Boolean);
|
|
1403
|
-
return (e[e.length - 1] ?? t).split("-").map((
|
|
1407
|
+
return (e[e.length - 1] ?? t).split("-").map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join(" ");
|
|
1404
1408
|
};
|
|
1405
|
-
function
|
|
1406
|
-
return /* @__PURE__ */ a(
|
|
1409
|
+
function nt({ ...t }) {
|
|
1410
|
+
return /* @__PURE__ */ a(ct.Root, { "data-slot": "collapsible", ...t });
|
|
1407
1411
|
}
|
|
1408
|
-
function
|
|
1409
|
-
return /* @__PURE__ */ a(
|
|
1412
|
+
function Q({ ...t }) {
|
|
1413
|
+
return /* @__PURE__ */ a(ct.Trigger, { "data-slot": "collapsible-trigger", ...t });
|
|
1410
1414
|
}
|
|
1411
1415
|
function rt({ ...t }) {
|
|
1412
|
-
return /* @__PURE__ */ a(
|
|
1416
|
+
return /* @__PURE__ */ a(ct.Panel, { "data-slot": "collapsible-content", ...t });
|
|
1413
1417
|
}
|
|
1414
|
-
const
|
|
1415
|
-
const { title: e, icon: s, to:
|
|
1416
|
-
return
|
|
1418
|
+
const Xs = (t) => {
|
|
1419
|
+
const { title: e, icon: s, to: n, defaultOpen: r = !0, children: o } = t, { pathname: i } = X(), { configurations: l } = C(), u = U(l.locale), d = B(), w = u(e, typeof e == "string" ? e : ""), h = n ? i === n : !1;
|
|
1420
|
+
return n ? /* @__PURE__ */ c(nt, { render: /* @__PURE__ */ a(L, {}), defaultOpen: r, children: [
|
|
1417
1421
|
/* @__PURE__ */ c(
|
|
1418
|
-
|
|
1422
|
+
_,
|
|
1419
1423
|
{
|
|
1420
1424
|
render: /* @__PURE__ */ a(
|
|
1421
1425
|
$,
|
|
1422
1426
|
{
|
|
1423
|
-
to:
|
|
1427
|
+
to: n,
|
|
1424
1428
|
className: h ? "astw:bg-sidebar-accent astw:font-medium" : void 0
|
|
1425
1429
|
}
|
|
1426
1430
|
),
|
|
1427
|
-
tooltip:
|
|
1431
|
+
tooltip: w,
|
|
1428
1432
|
children: [
|
|
1429
1433
|
s,
|
|
1430
|
-
/* @__PURE__ */ a("span", { children:
|
|
1434
|
+
/* @__PURE__ */ a("span", { children: w })
|
|
1431
1435
|
]
|
|
1432
1436
|
}
|
|
1433
1437
|
),
|
|
1434
1438
|
/* @__PURE__ */ c(
|
|
1435
|
-
|
|
1439
|
+
Q,
|
|
1436
1440
|
{
|
|
1437
|
-
render: /* @__PURE__ */ a(
|
|
1441
|
+
render: /* @__PURE__ */ a(Y, { className: "astw:data-panel-open:rotate-90" }),
|
|
1438
1442
|
children: [
|
|
1439
1443
|
/* @__PURE__ */ a(W, {}),
|
|
1440
|
-
/* @__PURE__ */ a("span", { className: "astw:sr-only", children:
|
|
1444
|
+
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: d("toggle") })
|
|
1441
1445
|
]
|
|
1442
1446
|
}
|
|
1443
1447
|
),
|
|
1444
|
-
/* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(
|
|
1445
|
-
] }) : /* @__PURE__ */ c(
|
|
1446
|
-
/* @__PURE__ */ c(
|
|
1448
|
+
/* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(st, { children: o }) })
|
|
1449
|
+
] }) : /* @__PURE__ */ c(nt, { render: /* @__PURE__ */ a(L, {}), defaultOpen: r, children: [
|
|
1450
|
+
/* @__PURE__ */ c(Q, { className: "astw:flex astw:w-full astw:[&[data-panel-open]_.astw-rotate-target]:rotate-90", children: [
|
|
1447
1451
|
/* @__PURE__ */ c(
|
|
1448
|
-
|
|
1452
|
+
_,
|
|
1449
1453
|
{
|
|
1450
1454
|
render: /* @__PURE__ */ a("span", { className: "astw:flex astw:w-full" }),
|
|
1451
|
-
tooltip:
|
|
1455
|
+
tooltip: w,
|
|
1452
1456
|
children: [
|
|
1453
1457
|
s,
|
|
1454
|
-
/* @__PURE__ */ a("span", { children:
|
|
1458
|
+
/* @__PURE__ */ a("span", { children: w })
|
|
1455
1459
|
]
|
|
1456
1460
|
}
|
|
1457
1461
|
),
|
|
1458
|
-
/* @__PURE__ */ c(
|
|
1462
|
+
/* @__PURE__ */ c(Y, { className: "astw-rotate-target", render: /* @__PURE__ */ a("span", {}), children: [
|
|
1459
1463
|
/* @__PURE__ */ a(W, {}),
|
|
1460
|
-
/* @__PURE__ */ a("span", { className: "astw:sr-only", children:
|
|
1464
|
+
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: d("toggle") })
|
|
1461
1465
|
] })
|
|
1462
1466
|
] }),
|
|
1463
|
-
/* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(
|
|
1467
|
+
/* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(st, { children: o }) })
|
|
1464
1468
|
] });
|
|
1465
|
-
},
|
|
1466
|
-
const { title: e, icon: s } = C(), { pathname:
|
|
1469
|
+
}, Zs = () => /* @__PURE__ */ a(xa, {}), Aa = (t) => {
|
|
1470
|
+
const { title: e, icon: s } = C(), { pathname: n } = X(), { isIconMode: r } = H(), o = /* @__PURE__ */ c(va, { children: [
|
|
1467
1471
|
s,
|
|
1468
|
-
/* @__PURE__ */ a("h1", { className: m("astw:text-sm astw:mb-2 astw:mt-2 astw:px-2",
|
|
1472
|
+
/* @__PURE__ */ a("h1", { className: m("astw:text-sm astw:mb-2 astw:mt-2 astw:px-2", r && "astw:hidden"), children: e })
|
|
1469
1473
|
] });
|
|
1470
|
-
return /* @__PURE__ */ c(
|
|
1471
|
-
!
|
|
1474
|
+
return /* @__PURE__ */ c(ga, { variant: "inset", collapsible: r ? "icon" : "offcanvas", children: [
|
|
1475
|
+
!r && /* @__PURE__ */ c("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
|
|
1472
1476
|
t.header ?? o,
|
|
1473
|
-
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(
|
|
1477
|
+
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(ne, { className: "astw:-ml-1" }) })
|
|
1474
1478
|
] }),
|
|
1475
|
-
/* @__PURE__ */ a(
|
|
1479
|
+
/* @__PURE__ */ a(ya, { children: t.children ? (
|
|
1476
1480
|
// New API: children-based explicit definition
|
|
1477
|
-
/* @__PURE__ */ a(
|
|
1481
|
+
/* @__PURE__ */ a(bt, { children: /* @__PURE__ */ a(vt, { children: t.children }) })
|
|
1478
1482
|
) : (
|
|
1479
1483
|
// Existing behavior: auto-generation from resources
|
|
1480
|
-
/* @__PURE__ */ a(
|
|
1484
|
+
/* @__PURE__ */ a(lt, { fallback: /* @__PURE__ */ a(Ea, {}), children: /* @__PURE__ */ a(Ba, { currentPath: n }) })
|
|
1481
1485
|
) }),
|
|
1482
1486
|
t.footer ?? null
|
|
1483
1487
|
] });
|
|
1484
|
-
},
|
|
1485
|
-
const e =
|
|
1486
|
-
return /* @__PURE__ */ a(
|
|
1487
|
-
},
|
|
1488
|
-
const e =
|
|
1489
|
-
return /* @__PURE__ */ a(
|
|
1488
|
+
}, Ba = ({ currentPath: t }) => {
|
|
1489
|
+
const e = Qt();
|
|
1490
|
+
return /* @__PURE__ */ a($t, { resolve: e, children: (s) => /* @__PURE__ */ a(Da, { items: s ?? [], currentPath: t }) });
|
|
1491
|
+
}, Da = (t) => {
|
|
1492
|
+
const e = B();
|
|
1493
|
+
return /* @__PURE__ */ a(bt, { children: /* @__PURE__ */ a(vt, { children: t.items.map((s) => /* @__PURE__ */ c(nt, { render: /* @__PURE__ */ a(L, {}), defaultOpen: !0, children: [
|
|
1490
1494
|
s.url ? /* @__PURE__ */ c(S, { children: [
|
|
1491
1495
|
/* @__PURE__ */ c(
|
|
1492
|
-
|
|
1496
|
+
_,
|
|
1493
1497
|
{
|
|
1494
1498
|
render: /* @__PURE__ */ a(
|
|
1495
1499
|
$,
|
|
@@ -1506,18 +1510,18 @@ const Os = (t) => {
|
|
|
1506
1510
|
}
|
|
1507
1511
|
),
|
|
1508
1512
|
!!s.items?.length && /* @__PURE__ */ c(
|
|
1509
|
-
|
|
1513
|
+
Q,
|
|
1510
1514
|
{
|
|
1511
|
-
render: /* @__PURE__ */ a(
|
|
1515
|
+
render: /* @__PURE__ */ a(Y, { className: "astw:data-panel-open:rotate-90" }),
|
|
1512
1516
|
children: [
|
|
1513
1517
|
/* @__PURE__ */ a(W, {}),
|
|
1514
1518
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1515
1519
|
]
|
|
1516
1520
|
}
|
|
1517
1521
|
)
|
|
1518
|
-
] }) : /* @__PURE__ */ a(S, { children: /* @__PURE__ */ c(
|
|
1522
|
+
] }) : /* @__PURE__ */ a(S, { children: /* @__PURE__ */ c(Q, { className: "astw:flex astw:w-full astw:[&[data-panel-open]_.astw-rotate-target]:rotate-90", children: [
|
|
1519
1523
|
/* @__PURE__ */ c(
|
|
1520
|
-
|
|
1524
|
+
_,
|
|
1521
1525
|
{
|
|
1522
1526
|
render: /* @__PURE__ */ a("span", { className: "astw:flex astw:w-full" }),
|
|
1523
1527
|
tooltip: s.title,
|
|
@@ -1527,26 +1531,26 @@ const Os = (t) => {
|
|
|
1527
1531
|
]
|
|
1528
1532
|
}
|
|
1529
1533
|
),
|
|
1530
|
-
!!s.items?.length && /* @__PURE__ */ c(
|
|
1534
|
+
!!s.items?.length && /* @__PURE__ */ c(Y, { className: "astw-rotate-target", render: /* @__PURE__ */ a("span", {}), children: [
|
|
1531
1535
|
/* @__PURE__ */ a(W, {}),
|
|
1532
1536
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1533
1537
|
] })
|
|
1534
1538
|
] }) }),
|
|
1535
|
-
!!s.items?.length && /* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(
|
|
1536
|
-
|
|
1539
|
+
!!s.items?.length && /* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(st, { children: s.items?.filter((n) => n.url).map((n) => /* @__PURE__ */ a(Sa, { children: /* @__PURE__ */ a(
|
|
1540
|
+
Ca,
|
|
1537
1541
|
{
|
|
1538
1542
|
render: /* @__PURE__ */ a(
|
|
1539
1543
|
$,
|
|
1540
1544
|
{
|
|
1541
|
-
to:
|
|
1542
|
-
className:
|
|
1545
|
+
to: n.url,
|
|
1546
|
+
className: n.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0
|
|
1543
1547
|
}
|
|
1544
1548
|
),
|
|
1545
|
-
children: /* @__PURE__ */ a("span", { children:
|
|
1549
|
+
children: /* @__PURE__ */ a("span", { children: n.title })
|
|
1546
1550
|
}
|
|
1547
|
-
) },
|
|
1551
|
+
) }, n.title)) }) })
|
|
1548
1552
|
] }, s.title)) }) });
|
|
1549
|
-
},
|
|
1553
|
+
}, Ma = [104, 80, 112, 88, 96, 100, 84, 92], Ea = () => /* @__PURE__ */ a(bt, { children: /* @__PURE__ */ a(vt, { className: "astw:px-2", children: Ma.map((t, e) => /* @__PURE__ */ a(L, { children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
|
|
1550
1554
|
/* @__PURE__ */ a("div", { className: "astw:h-4 astw:w-4 astw:rounded-md astw:bg-muted" }),
|
|
1551
1555
|
/* @__PURE__ */ a(
|
|
1552
1556
|
"div",
|
|
@@ -1556,10 +1560,10 @@ const Os = (t) => {
|
|
|
1556
1560
|
}
|
|
1557
1561
|
)
|
|
1558
1562
|
] }) }, e)) }) });
|
|
1559
|
-
function
|
|
1563
|
+
function Mt({ ...t }) {
|
|
1560
1564
|
return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...t });
|
|
1561
1565
|
}
|
|
1562
|
-
function
|
|
1566
|
+
function Et({ className: t, ...e }) {
|
|
1563
1567
|
return /* @__PURE__ */ a(
|
|
1564
1568
|
"ol",
|
|
1565
1569
|
{
|
|
@@ -1572,7 +1576,7 @@ function Mt({ className: t, ...e }) {
|
|
|
1572
1576
|
}
|
|
1573
1577
|
);
|
|
1574
1578
|
}
|
|
1575
|
-
function
|
|
1579
|
+
function It({ className: t, ...e }) {
|
|
1576
1580
|
return /* @__PURE__ */ a(
|
|
1577
1581
|
"li",
|
|
1578
1582
|
{
|
|
@@ -1582,26 +1586,26 @@ function Bt({ className: t, ...e }) {
|
|
|
1582
1586
|
}
|
|
1583
1587
|
);
|
|
1584
1588
|
}
|
|
1585
|
-
function
|
|
1589
|
+
function Lt({
|
|
1586
1590
|
render: t,
|
|
1587
1591
|
className: e,
|
|
1588
1592
|
children: s,
|
|
1589
|
-
to:
|
|
1590
|
-
...
|
|
1593
|
+
to: n,
|
|
1594
|
+
...r
|
|
1591
1595
|
}) {
|
|
1592
1596
|
const o = m("astw:hover:text-foreground astw:transition-colors", e);
|
|
1593
1597
|
return j({
|
|
1594
1598
|
defaultTagName: "a",
|
|
1595
|
-
render: t ?? /* @__PURE__ */ a($, { to:
|
|
1599
|
+
render: t ?? /* @__PURE__ */ a($, { to: n }),
|
|
1596
1600
|
props: {
|
|
1597
1601
|
"data-slot": "breadcrumb-link",
|
|
1598
1602
|
className: o,
|
|
1599
1603
|
children: s,
|
|
1600
|
-
...t ?
|
|
1604
|
+
...t ? r : { to: n, ...r }
|
|
1601
1605
|
}
|
|
1602
1606
|
});
|
|
1603
1607
|
}
|
|
1604
|
-
function
|
|
1608
|
+
function Ia({ children: t, className: e, ...s }) {
|
|
1605
1609
|
return /* @__PURE__ */ a(
|
|
1606
1610
|
"li",
|
|
1607
1611
|
{
|
|
@@ -1614,54 +1618,54 @@ function Ma({ children: t, className: e, ...s }) {
|
|
|
1614
1618
|
}
|
|
1615
1619
|
);
|
|
1616
1620
|
}
|
|
1617
|
-
function
|
|
1621
|
+
function La(t, e) {
|
|
1618
1622
|
if (!e.trim()) return t;
|
|
1619
1623
|
const s = e.toLowerCase();
|
|
1620
1624
|
return t.filter(
|
|
1621
|
-
(
|
|
1625
|
+
(n) => n.title.toLowerCase().includes(s) || n.path.toLowerCase().includes(s)
|
|
1622
1626
|
);
|
|
1623
1627
|
}
|
|
1624
|
-
const
|
|
1625
|
-
const s =
|
|
1628
|
+
const _a = (t, e) => {
|
|
1629
|
+
const s = Ut(e);
|
|
1626
1630
|
return t.reduce(
|
|
1627
|
-
(
|
|
1628
|
-
const o = s(
|
|
1629
|
-
r
|
|
1631
|
+
(n, r) => {
|
|
1632
|
+
const o = s(r.meta.title, r.path);
|
|
1633
|
+
n[r.path] = {
|
|
1630
1634
|
title: o,
|
|
1631
1635
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- breadcrumbTitle exists at runtime but not in CommonPageResource type
|
|
1632
|
-
breadcrumbTitle:
|
|
1636
|
+
breadcrumbTitle: r.meta.breadcrumbTitle
|
|
1633
1637
|
};
|
|
1634
1638
|
const i = (l, u) => {
|
|
1635
|
-
!l || l.length === 0 || l.forEach((
|
|
1636
|
-
const
|
|
1637
|
-
|
|
1639
|
+
!l || l.length === 0 || l.forEach((d) => {
|
|
1640
|
+
const w = `${u}/${d.path}`, h = s(d.meta.title, d.path);
|
|
1641
|
+
n[w] = {
|
|
1638
1642
|
title: h,
|
|
1639
1643
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- breadcrumbTitle exists at runtime but not in CommonPageResource type
|
|
1640
|
-
breadcrumbTitle:
|
|
1641
|
-
},
|
|
1644
|
+
breadcrumbTitle: d.meta.breadcrumbTitle
|
|
1645
|
+
}, d.subResources && d.subResources.length > 0 && i(d.subResources, w);
|
|
1642
1646
|
});
|
|
1643
1647
|
};
|
|
1644
|
-
return
|
|
1648
|
+
return r.resources && r.resources.length > 0 && i(r.resources, r.path), n;
|
|
1645
1649
|
},
|
|
1646
1650
|
{}
|
|
1647
1651
|
);
|
|
1648
1652
|
};
|
|
1649
|
-
function
|
|
1650
|
-
const
|
|
1651
|
-
const
|
|
1652
|
-
let h = i[
|
|
1653
|
+
function za(t, e, s, n) {
|
|
1654
|
+
const r = t.split("/").filter((u) => u !== ""), o = e && r[0] === e ? r.slice(1) : r, i = _a(s, n), l = o.map((u, d) => {
|
|
1655
|
+
const w = o.slice(0, d + 1).join("/");
|
|
1656
|
+
let h = i[w];
|
|
1653
1657
|
if (!h) {
|
|
1654
|
-
const
|
|
1655
|
-
const
|
|
1656
|
-
return new RegExp(`^${
|
|
1658
|
+
const b = Object.entries(i).find(([p]) => {
|
|
1659
|
+
const v = p.split("/").map((R) => R.startsWith(":") ? "[^/]+" : R).join("/");
|
|
1660
|
+
return new RegExp(`^${v}$`).test(w);
|
|
1657
1661
|
})?.[1];
|
|
1658
|
-
|
|
1662
|
+
b && (h = b);
|
|
1659
1663
|
}
|
|
1660
|
-
let
|
|
1661
|
-
return h ? typeof h.breadcrumbTitle == "function" ?
|
|
1664
|
+
let f;
|
|
1665
|
+
return h ? typeof h.breadcrumbTitle == "function" ? f = h.breadcrumbTitle(u) : typeof h.breadcrumbTitle == "string" ? f = h.breadcrumbTitle : f = h.title : f = decodeURIComponent(u), {
|
|
1662
1666
|
segment: u,
|
|
1663
|
-
path:
|
|
1664
|
-
title:
|
|
1667
|
+
path: w,
|
|
1668
|
+
title: f
|
|
1665
1669
|
};
|
|
1666
1670
|
});
|
|
1667
1671
|
return {
|
|
@@ -1669,57 +1673,57 @@ function La(t, e, s, r) {
|
|
|
1669
1673
|
segments: l
|
|
1670
1674
|
};
|
|
1671
1675
|
}
|
|
1672
|
-
const
|
|
1673
|
-
const { configurations: t } = C(), e =
|
|
1674
|
-
return
|
|
1676
|
+
const $a = () => {
|
|
1677
|
+
const { configurations: t } = C(), e = X();
|
|
1678
|
+
return za(
|
|
1675
1679
|
e.pathname,
|
|
1676
1680
|
t.basePath,
|
|
1677
1681
|
t.modules,
|
|
1678
1682
|
t.locale
|
|
1679
1683
|
);
|
|
1680
|
-
},
|
|
1681
|
-
const { segments: t } =
|
|
1682
|
-
return e ? /* @__PURE__ */ a(
|
|
1684
|
+
}, Wa = () => {
|
|
1685
|
+
const { segments: t } = $a(), e = Ne("/:prefix/settings/:suffix"), s = B();
|
|
1686
|
+
return e ? /* @__PURE__ */ a(Mt, { 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(It, { children: /* @__PURE__ */ a(Lt, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(Mt, { children: /* @__PURE__ */ a(Et, { children: t.map((n, r) => /* @__PURE__ */ c(
|
|
1683
1687
|
"div",
|
|
1684
1688
|
{
|
|
1685
1689
|
className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground",
|
|
1686
1690
|
children: [
|
|
1687
|
-
/* @__PURE__ */ a(
|
|
1688
|
-
|
|
1691
|
+
/* @__PURE__ */ a(It, { children: /* @__PURE__ */ a(Lt, { to: n.path, children: n.title }) }),
|
|
1692
|
+
r < t.length - 1 && /* @__PURE__ */ a(Ia, {})
|
|
1689
1693
|
]
|
|
1690
1694
|
},
|
|
1691
|
-
|
|
1695
|
+
r
|
|
1692
1696
|
)) }) });
|
|
1693
|
-
},
|
|
1694
|
-
const { open: t, isIconMode: e } =
|
|
1695
|
-
return /* @__PURE__ */ a("div", { className: t && !e ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(
|
|
1696
|
-
},
|
|
1697
|
-
const e = t.children ? t.children({ Outlet:
|
|
1697
|
+
}, Fa = () => {
|
|
1698
|
+
const { open: t, isIconMode: e } = H();
|
|
1699
|
+
return /* @__PURE__ */ a("div", { className: t && !e ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(ne, { className: "astw:-ml-2.5" }) });
|
|
1700
|
+
}, Js = (t) => {
|
|
1701
|
+
const e = t.children ? t.children({ Outlet: Ct }) : null, s = Je(), n = () => {
|
|
1698
1702
|
s.setTheme(s.theme === "dark" ? "light" : "dark");
|
|
1699
1703
|
};
|
|
1700
|
-
return /* @__PURE__ */ a(
|
|
1701
|
-
t.sidebar ?? /* @__PURE__ */ a(
|
|
1702
|
-
/* @__PURE__ */ c(
|
|
1704
|
+
return /* @__PURE__ */ a(fa, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:flex-1", children: [
|
|
1705
|
+
t.sidebar ?? /* @__PURE__ */ a(Aa, {}),
|
|
1706
|
+
/* @__PURE__ */ c(ba, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
|
|
1703
1707
|
/* @__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: [
|
|
1704
1708
|
/* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
|
|
1705
|
-
/* @__PURE__ */ a(
|
|
1706
|
-
/* @__PURE__ */ a(
|
|
1709
|
+
/* @__PURE__ */ a(Fa, {}),
|
|
1710
|
+
/* @__PURE__ */ a(Wa, {})
|
|
1707
1711
|
] }),
|
|
1708
|
-
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(O, { variant: "outline", size: "icon", onClick:
|
|
1712
|
+
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(O, { variant: "outline", size: "icon", onClick: n, children: /* @__PURE__ */ a(Pe, {}) }) })
|
|
1709
1713
|
] }) }),
|
|
1710
|
-
/* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4 astw:flex-1 astw:min-h-0", children: e ?? /* @__PURE__ */ a(
|
|
1714
|
+
/* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4 astw:flex-1 astw:min-h-0", children: e ?? /* @__PURE__ */ a(Ct, {}) })
|
|
1711
1715
|
] })
|
|
1712
1716
|
] }) });
|
|
1713
1717
|
};
|
|
1714
|
-
function
|
|
1715
|
-
return /* @__PURE__ */ a(
|
|
1718
|
+
function Oa({ ...t }) {
|
|
1719
|
+
return /* @__PURE__ */ a(x.Root, { "data-slot": "dialog", ...t });
|
|
1716
1720
|
}
|
|
1717
|
-
function
|
|
1718
|
-
return /* @__PURE__ */ a(
|
|
1721
|
+
function ja({ ...t }) {
|
|
1722
|
+
return /* @__PURE__ */ a(x.Portal, { "data-slot": "dialog-portal", ...t });
|
|
1719
1723
|
}
|
|
1720
|
-
function
|
|
1724
|
+
function Ua({ className: t, ...e }) {
|
|
1721
1725
|
return /* @__PURE__ */ a(
|
|
1722
|
-
|
|
1726
|
+
x.Backdrop,
|
|
1723
1727
|
{
|
|
1724
1728
|
"data-slot": "dialog-overlay",
|
|
1725
1729
|
className: m(
|
|
@@ -1730,15 +1734,15 @@ function Fa({ className: t, ...e }) {
|
|
|
1730
1734
|
}
|
|
1731
1735
|
);
|
|
1732
1736
|
}
|
|
1733
|
-
function
|
|
1737
|
+
function Ha({
|
|
1734
1738
|
className: t,
|
|
1735
1739
|
children: e,
|
|
1736
1740
|
...s
|
|
1737
1741
|
}) {
|
|
1738
|
-
return /* @__PURE__ */ c(
|
|
1739
|
-
/* @__PURE__ */ a(
|
|
1742
|
+
return /* @__PURE__ */ c(ja, { "data-slot": "dialog-portal", children: [
|
|
1743
|
+
/* @__PURE__ */ a(Ua, {}),
|
|
1740
1744
|
/* @__PURE__ */ c(
|
|
1741
|
-
|
|
1745
|
+
x.Popup,
|
|
1742
1746
|
{
|
|
1743
1747
|
"data-slot": "dialog-content",
|
|
1744
1748
|
className: m(
|
|
@@ -1748,8 +1752,8 @@ function Oa({
|
|
|
1748
1752
|
...s,
|
|
1749
1753
|
children: [
|
|
1750
1754
|
e,
|
|
1751
|
-
/* @__PURE__ */ c(
|
|
1752
|
-
/* @__PURE__ */ a(
|
|
1755
|
+
/* @__PURE__ */ c(x.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-open:bg-accent astw:data-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: [
|
|
1756
|
+
/* @__PURE__ */ a(Wt, {}),
|
|
1753
1757
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
1754
1758
|
] })
|
|
1755
1759
|
]
|
|
@@ -1757,9 +1761,9 @@ function Oa({
|
|
|
1757
1761
|
)
|
|
1758
1762
|
] });
|
|
1759
1763
|
}
|
|
1760
|
-
function
|
|
1764
|
+
function Ka({ className: t, ...e }) {
|
|
1761
1765
|
return /* @__PURE__ */ a(
|
|
1762
|
-
|
|
1766
|
+
x.Title,
|
|
1763
1767
|
{
|
|
1764
1768
|
"data-slot": "dialog-title",
|
|
1765
1769
|
className: m("astw:text-lg astw:leading-none astw:font-semibold", t),
|
|
@@ -1767,157 +1771,157 @@ function ja({ className: t, ...e }) {
|
|
|
1767
1771
|
}
|
|
1768
1772
|
);
|
|
1769
1773
|
}
|
|
1770
|
-
function
|
|
1771
|
-
const e = [], s = (
|
|
1772
|
-
|
|
1774
|
+
function Va(t) {
|
|
1775
|
+
const e = [], s = (n, r, o) => {
|
|
1776
|
+
n.forEach((i) => {
|
|
1773
1777
|
const l = [...o, i.title];
|
|
1774
|
-
e.push({
|
|
1778
|
+
i.url && e.push({
|
|
1775
1779
|
path: i.url,
|
|
1776
1780
|
title: i.title,
|
|
1777
|
-
icon:
|
|
1781
|
+
icon: r,
|
|
1778
1782
|
breadcrumb: l
|
|
1779
|
-
}), i.items && i.items.length > 0 && s(i.items,
|
|
1783
|
+
}), i.items && i.items.length > 0 && s(i.items, r, l);
|
|
1780
1784
|
});
|
|
1781
1785
|
};
|
|
1782
|
-
return t.forEach((
|
|
1783
|
-
|
|
1784
|
-
path:
|
|
1785
|
-
title:
|
|
1786
|
-
icon:
|
|
1787
|
-
breadcrumb: [
|
|
1788
|
-
}), s(
|
|
1786
|
+
return t.forEach((n) => {
|
|
1787
|
+
n.url && e.push({
|
|
1788
|
+
path: n.url,
|
|
1789
|
+
title: n.title,
|
|
1790
|
+
icon: n.icon,
|
|
1791
|
+
breadcrumb: [n.title]
|
|
1792
|
+
}), s(n.items, n.icon, [n.title]);
|
|
1789
1793
|
}), e;
|
|
1790
1794
|
}
|
|
1791
|
-
function
|
|
1792
|
-
const e =
|
|
1793
|
-
i(
|
|
1795
|
+
function Ga({ routes: t }) {
|
|
1796
|
+
const e = Se(), s = jt(null), [n, r] = V(!1), [o, i] = V(""), [l, u] = V(0), d = M(() => La(t, o), [t, o]), w = D((p) => {
|
|
1797
|
+
i(p), u(0);
|
|
1794
1798
|
}, []);
|
|
1795
1799
|
F(() => {
|
|
1796
|
-
const
|
|
1797
|
-
(
|
|
1800
|
+
const p = (v) => {
|
|
1801
|
+
(v.metaKey || v.ctrlKey) && v.key === "k" && (v.preventDefault(), r((k) => !k));
|
|
1798
1802
|
};
|
|
1799
|
-
return document.addEventListener("keydown",
|
|
1803
|
+
return document.addEventListener("keydown", p), () => document.removeEventListener("keydown", p);
|
|
1800
1804
|
}, []);
|
|
1801
|
-
const h =
|
|
1802
|
-
|
|
1805
|
+
const h = D((p) => {
|
|
1806
|
+
r(p), p || (i(""), u(0));
|
|
1803
1807
|
}, []);
|
|
1804
1808
|
F(() => {
|
|
1805
1809
|
s.current && s.current.querySelector(`[data-index="${l}"]`)?.scrollIntoView({ block: "nearest" });
|
|
1806
1810
|
}, [l]);
|
|
1807
|
-
const
|
|
1808
|
-
(
|
|
1809
|
-
e(
|
|
1811
|
+
const f = D(
|
|
1812
|
+
(p) => {
|
|
1813
|
+
e(p.path), r(!1), i("");
|
|
1810
1814
|
},
|
|
1811
1815
|
[e]
|
|
1812
|
-
),
|
|
1813
|
-
(
|
|
1814
|
-
if (!
|
|
1815
|
-
switch (
|
|
1816
|
+
), b = D(
|
|
1817
|
+
(p) => {
|
|
1818
|
+
if (!p.nativeEvent.isComposing)
|
|
1819
|
+
switch (p.key) {
|
|
1816
1820
|
case "ArrowDown":
|
|
1817
|
-
|
|
1821
|
+
p.preventDefault(), u((v) => v < d.length - 1 ? v + 1 : v);
|
|
1818
1822
|
break;
|
|
1819
1823
|
case "ArrowUp":
|
|
1820
|
-
|
|
1824
|
+
p.preventDefault(), u((v) => v > 0 ? v - 1 : v);
|
|
1821
1825
|
break;
|
|
1822
1826
|
case "Enter":
|
|
1823
|
-
|
|
1827
|
+
p.preventDefault(), d[l] && f(d[l]);
|
|
1824
1828
|
break;
|
|
1825
1829
|
}
|
|
1826
1830
|
},
|
|
1827
|
-
[
|
|
1831
|
+
[d, l, f]
|
|
1828
1832
|
);
|
|
1829
1833
|
return {
|
|
1830
|
-
open:
|
|
1834
|
+
open: n,
|
|
1831
1835
|
handleOpenChange: h,
|
|
1832
1836
|
search: o,
|
|
1833
|
-
setSearch:
|
|
1837
|
+
setSearch: w,
|
|
1834
1838
|
selectedIndex: l,
|
|
1835
|
-
filteredRoutes:
|
|
1836
|
-
handleSelect:
|
|
1837
|
-
handleKeyDown:
|
|
1839
|
+
filteredRoutes: d,
|
|
1840
|
+
handleSelect: f,
|
|
1841
|
+
handleKeyDown: b,
|
|
1838
1842
|
listRef: s
|
|
1839
1843
|
};
|
|
1840
1844
|
}
|
|
1841
|
-
function
|
|
1842
|
-
const e =
|
|
1843
|
-
open:
|
|
1844
|
-
handleOpenChange:
|
|
1845
|
+
function qa({ navItems: t }) {
|
|
1846
|
+
const e = B(), s = M(() => Va(t), [t]), {
|
|
1847
|
+
open: n,
|
|
1848
|
+
handleOpenChange: r,
|
|
1845
1849
|
search: o,
|
|
1846
1850
|
setSearch: i,
|
|
1847
1851
|
selectedIndex: l,
|
|
1848
1852
|
filteredRoutes: u,
|
|
1849
|
-
handleSelect:
|
|
1850
|
-
handleKeyDown:
|
|
1853
|
+
handleSelect: d,
|
|
1854
|
+
handleKeyDown: w,
|
|
1851
1855
|
listRef: h
|
|
1852
|
-
} =
|
|
1853
|
-
return /* @__PURE__ */ a(
|
|
1854
|
-
|
|
1856
|
+
} = Ga({ routes: s });
|
|
1857
|
+
return /* @__PURE__ */ a(Oa, { open: n, onOpenChange: r, children: /* @__PURE__ */ c(
|
|
1858
|
+
Ha,
|
|
1855
1859
|
{
|
|
1856
1860
|
className: "astw:p-0 astw:gap-0 astw:sm:max-w-2xl astw:overflow-hidden",
|
|
1857
|
-
onKeyDown:
|
|
1861
|
+
onKeyDown: w,
|
|
1858
1862
|
"aria-describedby": void 0,
|
|
1859
1863
|
children: [
|
|
1860
|
-
/* @__PURE__ */ a(
|
|
1864
|
+
/* @__PURE__ */ a(Ka, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
|
|
1861
1865
|
/* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:border-b astw:px-3 astw:py-1", children: [
|
|
1862
|
-
/* @__PURE__ */ a(
|
|
1866
|
+
/* @__PURE__ */ a(Ae, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
|
|
1863
1867
|
/* @__PURE__ */ a(
|
|
1864
|
-
|
|
1868
|
+
ca,
|
|
1865
1869
|
{
|
|
1866
1870
|
value: o,
|
|
1867
|
-
onChange: (
|
|
1871
|
+
onChange: (f) => i(f.target.value),
|
|
1868
1872
|
placeholder: e("commandPaletteSearch"),
|
|
1869
1873
|
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",
|
|
1870
1874
|
autoFocus: !0
|
|
1871
1875
|
}
|
|
1872
1876
|
)
|
|
1873
1877
|
] }),
|
|
1874
|
-
/* @__PURE__ */ a("div", { ref: h, className: "astw:max-h-75 astw:overflow-y-auto astw:overflow-x-hidden", children: u.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: u.map((
|
|
1878
|
+
/* @__PURE__ */ a("div", { ref: h, className: "astw:max-h-75 astw:overflow-y-auto astw:overflow-x-hidden", children: u.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: u.map((f, b) => /* @__PURE__ */ c(
|
|
1875
1879
|
"button",
|
|
1876
1880
|
{
|
|
1877
|
-
"data-index":
|
|
1878
|
-
onClick: () =>
|
|
1881
|
+
"data-index": b,
|
|
1882
|
+
onClick: () => d(f),
|
|
1879
1883
|
className: m(
|
|
1880
1884
|
"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",
|
|
1881
|
-
|
|
1885
|
+
b === l ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
|
|
1882
1886
|
),
|
|
1883
1887
|
children: [
|
|
1884
|
-
/* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children:
|
|
1888
|
+
/* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: f.breadcrumb.join(" > ") }),
|
|
1885
1889
|
/* @__PURE__ */ c("span", { className: "astw:text-[11px] astw:text-muted-foreground astw:truncate astw:w-full astw:text-left", children: [
|
|
1886
1890
|
"/",
|
|
1887
|
-
|
|
1891
|
+
f.path
|
|
1888
1892
|
] })
|
|
1889
1893
|
]
|
|
1890
1894
|
},
|
|
1891
|
-
|
|
1895
|
+
f.path
|
|
1892
1896
|
)) }) })
|
|
1893
1897
|
]
|
|
1894
1898
|
}
|
|
1895
1899
|
) });
|
|
1896
1900
|
}
|
|
1897
|
-
function
|
|
1898
|
-
const t =
|
|
1899
|
-
return /* @__PURE__ */ a(
|
|
1901
|
+
function tn() {
|
|
1902
|
+
const t = Qt();
|
|
1903
|
+
return /* @__PURE__ */ a(lt, { fallback: null, children: /* @__PURE__ */ a($t, { resolve: t, children: (e) => /* @__PURE__ */ a(qa, { navItems: e ?? [] }) }) });
|
|
1900
1904
|
}
|
|
1901
|
-
function
|
|
1905
|
+
function Ya(t, e, s) {
|
|
1902
1906
|
if (s.current === null || s.current.contextData !== e || s.current.guards !== t) {
|
|
1903
|
-
const
|
|
1907
|
+
const n = Za(t, e), r = {
|
|
1904
1908
|
contextData: e,
|
|
1905
1909
|
guards: t,
|
|
1906
|
-
promise:
|
|
1907
|
-
state: { status: "pending", promise:
|
|
1910
|
+
promise: n,
|
|
1911
|
+
state: { status: "pending", promise: n }
|
|
1908
1912
|
};
|
|
1909
|
-
|
|
1913
|
+
n.then(
|
|
1910
1914
|
(o) => {
|
|
1911
|
-
|
|
1915
|
+
r.state = { status: "fulfilled", value: o };
|
|
1912
1916
|
},
|
|
1913
1917
|
(o) => {
|
|
1914
|
-
|
|
1918
|
+
r.state = { status: "rejected", error: o };
|
|
1915
1919
|
}
|
|
1916
|
-
), s.current =
|
|
1920
|
+
), s.current = r;
|
|
1917
1921
|
}
|
|
1918
1922
|
return s.current;
|
|
1919
1923
|
}
|
|
1920
|
-
function
|
|
1924
|
+
function Qa(t) {
|
|
1921
1925
|
const { state: e } = t;
|
|
1922
1926
|
switch (e.status) {
|
|
1923
1927
|
case "fulfilled":
|
|
@@ -1928,20 +1932,20 @@ function Ga(t) {
|
|
|
1928
1932
|
throw e.promise;
|
|
1929
1933
|
}
|
|
1930
1934
|
}
|
|
1931
|
-
const
|
|
1932
|
-
const { guards: e, children: s, fallback:
|
|
1933
|
-
return /* @__PURE__ */ a(
|
|
1934
|
-
},
|
|
1935
|
+
const en = (t) => {
|
|
1936
|
+
const { guards: e, children: s, fallback: n = null, loading: r = null } = t, { contextData: o } = Ht(), i = jt(null), l = Ya(e, o, i);
|
|
1937
|
+
return /* @__PURE__ */ a(lt, { fallback: r, children: /* @__PURE__ */ a(Xa, { cache: l, fallback: n, children: s }) });
|
|
1938
|
+
}, Xa = (t) => Qa(t.cache).type === "pass" ? /* @__PURE__ */ a(S, { children: t.children }) : /* @__PURE__ */ a(S, { children: t.fallback }), Za = async (t, e) => {
|
|
1935
1939
|
const s = { context: e };
|
|
1936
|
-
for (const
|
|
1937
|
-
const
|
|
1938
|
-
if (
|
|
1939
|
-
return
|
|
1940
|
+
for (const n of t) {
|
|
1941
|
+
const r = await n(s);
|
|
1942
|
+
if (r.type !== "pass")
|
|
1943
|
+
return r;
|
|
1940
1944
|
}
|
|
1941
1945
|
return { type: "pass" };
|
|
1942
1946
|
};
|
|
1943
|
-
function
|
|
1944
|
-
const e =
|
|
1947
|
+
function an(t) {
|
|
1948
|
+
const e = Le(t), { appUri: s } = t;
|
|
1945
1949
|
return {
|
|
1946
1950
|
...e,
|
|
1947
1951
|
getAppUri() {
|
|
@@ -1949,41 +1953,41 @@ function Hs(t) {
|
|
|
1949
1953
|
}
|
|
1950
1954
|
};
|
|
1951
1955
|
}
|
|
1952
|
-
function
|
|
1956
|
+
function Ja(t) {
|
|
1953
1957
|
const e = new URLSearchParams(t.search);
|
|
1954
1958
|
e.delete("code"), e.delete("state");
|
|
1955
1959
|
const s = e.toString();
|
|
1956
1960
|
return t.pathname + (s ? `?${s}` : "") + t.hash;
|
|
1957
1961
|
}
|
|
1958
|
-
const
|
|
1959
|
-
const e = t.client, s =
|
|
1962
|
+
const le = Z(null), sn = (t) => {
|
|
1963
|
+
const e = t.client, s = D(
|
|
1960
1964
|
(l) => e.addEventListener((u) => {
|
|
1961
1965
|
u.type === "auth_state_changed" && l();
|
|
1962
1966
|
}),
|
|
1963
1967
|
[e]
|
|
1964
|
-
),
|
|
1968
|
+
), n = D(() => e.getState(), [e]), r = Ot(s, n);
|
|
1965
1969
|
F(() => {
|
|
1966
1970
|
(async () => {
|
|
1967
1971
|
if (new URLSearchParams(window.location.search).has("code"))
|
|
1968
1972
|
try {
|
|
1969
1973
|
await e.handleCallback();
|
|
1970
|
-
const
|
|
1971
|
-
window.history.replaceState({}, "",
|
|
1972
|
-
} catch (
|
|
1973
|
-
console.error("Failed to handle callback:",
|
|
1974
|
+
const d = Ja(new URL(window.location.href));
|
|
1975
|
+
window.history.replaceState({}, "", d);
|
|
1976
|
+
} catch (d) {
|
|
1977
|
+
console.error("Failed to handle callback:", d);
|
|
1974
1978
|
}
|
|
1975
1979
|
else
|
|
1976
1980
|
await e.checkAuthStatus();
|
|
1977
1981
|
})();
|
|
1978
1982
|
}, [e]), F(() => {
|
|
1979
|
-
t.autoLogin && (!
|
|
1980
|
-
}, [
|
|
1981
|
-
const o =
|
|
1983
|
+
t.autoLogin && (!r.isReady || r.isAuthenticated || e.login());
|
|
1984
|
+
}, [r.isReady, r.isAuthenticated, t.autoLogin, e]);
|
|
1985
|
+
const o = r.isAuthenticated, i = t.guardComponent && (!r.isReady || !o) ? /* @__PURE__ */ a(t.guardComponent, {}) : t.children;
|
|
1982
1986
|
return /* @__PURE__ */ a(
|
|
1983
|
-
|
|
1987
|
+
le.Provider,
|
|
1984
1988
|
{
|
|
1985
1989
|
value: {
|
|
1986
|
-
authState:
|
|
1990
|
+
authState: r,
|
|
1987
1991
|
login: () => e.login(),
|
|
1988
1992
|
logout: () => e.logout(),
|
|
1989
1993
|
checkAuthStatus: () => e.checkAuthStatus(),
|
|
@@ -1992,23 +1996,23 @@ const ie = X(null), Gs = (t) => {
|
|
|
1992
1996
|
children: i
|
|
1993
1997
|
}
|
|
1994
1998
|
);
|
|
1995
|
-
},
|
|
1996
|
-
const t =
|
|
1999
|
+
}, ce = () => {
|
|
2000
|
+
const t = I(le);
|
|
1997
2001
|
if (!t)
|
|
1998
2002
|
throw new Error("useAuth/useAuthSuspense must be used within an AuthProvider");
|
|
1999
2003
|
return t;
|
|
2000
|
-
},
|
|
2001
|
-
const t =
|
|
2004
|
+
}, nn = () => {
|
|
2005
|
+
const t = ce(), { isAuthenticated: e, error: s, isReady: n } = t.authState;
|
|
2002
2006
|
return {
|
|
2003
2007
|
error: s,
|
|
2004
2008
|
isAuthenticated: e,
|
|
2005
|
-
isReady:
|
|
2009
|
+
isReady: n,
|
|
2006
2010
|
login: t.login,
|
|
2007
2011
|
logout: t.logout,
|
|
2008
2012
|
checkAuthStatus: t.checkAuthStatus
|
|
2009
2013
|
};
|
|
2010
|
-
},
|
|
2011
|
-
const t =
|
|
2014
|
+
}, rn = () => {
|
|
2015
|
+
const t = ce();
|
|
2012
2016
|
if (!t.authState.isReady)
|
|
2013
2017
|
throw t.ready();
|
|
2014
2018
|
const { isAuthenticated: e, error: s } = t.authState;
|
|
@@ -2019,7 +2023,7 @@ const ie = X(null), Gs = (t) => {
|
|
|
2019
2023
|
logout: t.logout,
|
|
2020
2024
|
checkAuthStatus: t.checkAuthStatus
|
|
2021
2025
|
};
|
|
2022
|
-
},
|
|
2026
|
+
}, on = () => Ee, ts = it(
|
|
2023
2027
|
"astw:inline-flex astw:items-center astw:rounded-md astw:border astw:px-2 astw:py-0.5 astw:text-xs astw:font-medium astw:transition-colors astw:focus:outline-none astw:focus:ring-2 astw:focus:ring-ring astw:focus:ring-offset-2",
|
|
2024
2028
|
{
|
|
2025
2029
|
variants: {
|
|
@@ -2041,43 +2045,43 @@ const ie = X(null), Gs = (t) => {
|
|
|
2041
2045
|
variant: "default"
|
|
2042
2046
|
}
|
|
2043
2047
|
}
|
|
2044
|
-
),
|
|
2048
|
+
), es = {
|
|
2045
2049
|
"outline-success": "astw:bg-green-500",
|
|
2046
2050
|
"outline-warning": "astw:bg-orange-500",
|
|
2047
2051
|
"outline-error": "astw:bg-red-500",
|
|
2048
2052
|
"outline-info": "astw:bg-blue-500",
|
|
2049
2053
|
"outline-neutral": "astw:bg-neutral-400"
|
|
2050
2054
|
};
|
|
2051
|
-
function
|
|
2052
|
-
const e =
|
|
2055
|
+
function as({ variant: t }) {
|
|
2056
|
+
const e = es[t];
|
|
2053
2057
|
return e ? /* @__PURE__ */ a("div", { className: "astw:size-3 astw:shrink-0 astw:flex astw:items-center astw:justify-center", children: /* @__PURE__ */ a("div", { className: m("astw:size-[7px] astw:rounded-full", e) }) }) : null;
|
|
2054
2058
|
}
|
|
2055
|
-
function
|
|
2056
|
-
const
|
|
2057
|
-
return /* @__PURE__ */ c("div", { className: m(
|
|
2058
|
-
|
|
2059
|
+
function ss({ className: t, variant: e, children: s, ...n }) {
|
|
2060
|
+
const r = e?.toString().startsWith("outline-");
|
|
2061
|
+
return /* @__PURE__ */ c("div", { className: m(ts({ variant: e }), t), ...n, children: [
|
|
2062
|
+
r && /* @__PURE__ */ a(as, { variant: e }),
|
|
2059
2063
|
s
|
|
2060
2064
|
] });
|
|
2061
2065
|
}
|
|
2062
|
-
function
|
|
2066
|
+
function ns(t) {
|
|
2063
2067
|
return t.type === "divider";
|
|
2064
2068
|
}
|
|
2065
|
-
function
|
|
2069
|
+
function rs(t) {
|
|
2066
2070
|
return t.type !== "divider" && "key" in t;
|
|
2067
2071
|
}
|
|
2068
|
-
function
|
|
2069
|
-
return e.split(".").reduce((s,
|
|
2070
|
-
if (s && typeof s == "object" &&
|
|
2071
|
-
return s[
|
|
2072
|
+
function J(t, e) {
|
|
2073
|
+
return e.split(".").reduce((s, n) => {
|
|
2074
|
+
if (s && typeof s == "object" && n in s)
|
|
2075
|
+
return s[n];
|
|
2072
2076
|
}, t);
|
|
2073
2077
|
}
|
|
2074
2078
|
function N(t) {
|
|
2075
2079
|
return t == null || t === "";
|
|
2076
2080
|
}
|
|
2077
|
-
function
|
|
2081
|
+
function os(t) {
|
|
2078
2082
|
return t.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase());
|
|
2079
2083
|
}
|
|
2080
|
-
function
|
|
2084
|
+
function is(t, e = "medium") {
|
|
2081
2085
|
if (N(t)) return "";
|
|
2082
2086
|
const s = t instanceof Date ? t : new Date(String(t));
|
|
2083
2087
|
if (isNaN(s.getTime())) return String(t);
|
|
@@ -2102,14 +2106,14 @@ function rs(t, e = "medium") {
|
|
|
2102
2106
|
year: "numeric"
|
|
2103
2107
|
});
|
|
2104
2108
|
case "relative": {
|
|
2105
|
-
const
|
|
2109
|
+
const r = (/* @__PURE__ */ new Date()).getTime() - s.getTime(), o = Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
2106
2110
|
return o === 0 ? "Today" : o === 1 ? "Yesterday" : o < 7 ? `${o} days ago` : o < 30 ? `${Math.floor(o / 7)} weeks ago` : o < 365 ? `${Math.floor(o / 30)} months ago` : `${Math.floor(o / 365)} years ago`;
|
|
2107
2111
|
}
|
|
2108
2112
|
default:
|
|
2109
2113
|
return s.toLocaleDateString();
|
|
2110
2114
|
}
|
|
2111
2115
|
}
|
|
2112
|
-
function
|
|
2116
|
+
function ls(t, e) {
|
|
2113
2117
|
if (N(t)) return "";
|
|
2114
2118
|
const s = typeof t == "number" ? t : parseFloat(String(t));
|
|
2115
2119
|
if (isNaN(s)) return String(t);
|
|
@@ -2122,29 +2126,29 @@ function ns(t, e) {
|
|
|
2122
2126
|
return `${e || "$"}${s.toFixed(2)}`;
|
|
2123
2127
|
}
|
|
2124
2128
|
}
|
|
2125
|
-
function
|
|
2129
|
+
function cs(t) {
|
|
2126
2130
|
if (N(t)) return [];
|
|
2127
2131
|
if (typeof t == "string")
|
|
2128
2132
|
return t.split(/[,\n]/).map((e) => e.trim()).filter(Boolean);
|
|
2129
2133
|
if (typeof t == "object" && t !== null) {
|
|
2130
2134
|
const e = t, s = [];
|
|
2131
2135
|
e.line1 && s.push(String(e.line1)), e.line2 && s.push(String(e.line2));
|
|
2132
|
-
const
|
|
2133
|
-
return
|
|
2136
|
+
const n = [e.city, e.state || e.province, e.zip || e.postalCode].filter(Boolean).join(", ");
|
|
2137
|
+
return n && s.push(n), e.country && s.push(String(e.country)), s;
|
|
2134
2138
|
}
|
|
2135
2139
|
return [String(t)];
|
|
2136
2140
|
}
|
|
2137
|
-
function
|
|
2138
|
-
const [e, s] =
|
|
2139
|
-
return /* @__PURE__ */ c(
|
|
2141
|
+
function de({ value: t }) {
|
|
2142
|
+
const [e, s] = g.useState(!1);
|
|
2143
|
+
return /* @__PURE__ */ c(pt, { children: [
|
|
2140
2144
|
/* @__PURE__ */ a(
|
|
2141
|
-
|
|
2145
|
+
ft,
|
|
2142
2146
|
{
|
|
2143
2147
|
render: /* @__PURE__ */ a(
|
|
2144
2148
|
"button",
|
|
2145
2149
|
{
|
|
2146
|
-
onClick: async (
|
|
2147
|
-
|
|
2150
|
+
onClick: async (r) => {
|
|
2151
|
+
r.stopPropagation();
|
|
2148
2152
|
try {
|
|
2149
2153
|
await navigator.clipboard.writeText(t), s(!0), setTimeout(() => s(!1), 2e3);
|
|
2150
2154
|
} catch {
|
|
@@ -2153,166 +2157,166 @@ function ce({ value: t }) {
|
|
|
2153
2157
|
className: "astw:ml-0.5 astw:inline-flex astw:items-center astw:justify-center astw:p-1 astw:rounded astw:hover:bg-muted astw:transition-colors astw:text-muted-foreground astw:hover:text-foreground"
|
|
2154
2158
|
}
|
|
2155
2159
|
),
|
|
2156
|
-
children: e ? /* @__PURE__ */ a(
|
|
2160
|
+
children: e ? /* @__PURE__ */ a(Be, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(De, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 })
|
|
2157
2161
|
}
|
|
2158
2162
|
),
|
|
2159
|
-
/* @__PURE__ */ a(
|
|
2163
|
+
/* @__PURE__ */ a(gt, { side: "top", children: e ? "Copied!" : "Copy" })
|
|
2160
2164
|
] });
|
|
2161
2165
|
}
|
|
2162
2166
|
const T = "–";
|
|
2163
|
-
function
|
|
2164
|
-
const e = N(t.value) ? T : String(t.value), s = t.meta?.copyable && !N(t.value),
|
|
2165
|
-
|
|
2166
|
-
if (!
|
|
2167
|
+
function ds({ field: t }) {
|
|
2168
|
+
const e = N(t.value) ? T : String(t.value), s = t.meta?.copyable && !N(t.value), n = t.meta?.truncateLines, r = g.useRef(null), [o, i] = g.useState(!1);
|
|
2169
|
+
g.useEffect(() => {
|
|
2170
|
+
if (!n) {
|
|
2167
2171
|
i(!1);
|
|
2168
2172
|
return;
|
|
2169
2173
|
}
|
|
2170
|
-
const
|
|
2171
|
-
if (
|
|
2172
|
-
const h =
|
|
2174
|
+
const d = () => {
|
|
2175
|
+
if (r.current) {
|
|
2176
|
+
const h = r.current;
|
|
2173
2177
|
i(h.scrollHeight > h.clientHeight + 1);
|
|
2174
2178
|
}
|
|
2175
|
-
},
|
|
2176
|
-
return window.addEventListener("resize",
|
|
2177
|
-
clearTimeout(
|
|
2179
|
+
}, w = setTimeout(d, 50);
|
|
2180
|
+
return window.addEventListener("resize", d), () => {
|
|
2181
|
+
clearTimeout(w), window.removeEventListener("resize", d);
|
|
2178
2182
|
};
|
|
2179
|
-
}, [e,
|
|
2180
|
-
const l =
|
|
2183
|
+
}, [e, n]);
|
|
2184
|
+
const l = n && n > 0 ? {
|
|
2181
2185
|
display: "-webkit-box",
|
|
2182
|
-
WebkitLineClamp:
|
|
2186
|
+
WebkitLineClamp: n,
|
|
2183
2187
|
WebkitBoxOrient: "vertical",
|
|
2184
2188
|
overflow: "hidden"
|
|
2185
2189
|
} : void 0, u = /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
|
|
2186
2190
|
/* @__PURE__ */ a(
|
|
2187
2191
|
"p",
|
|
2188
2192
|
{
|
|
2189
|
-
ref:
|
|
2193
|
+
ref: r,
|
|
2190
2194
|
className: "astw:text-sm astw:font-medium astw:text-foreground astw:wrap-break-word astw:m-0",
|
|
2191
2195
|
style: l,
|
|
2192
2196
|
children: e
|
|
2193
2197
|
}
|
|
2194
2198
|
),
|
|
2195
|
-
s && /* @__PURE__ */ a(
|
|
2199
|
+
s && /* @__PURE__ */ a(de, { value: String(t.value) })
|
|
2196
2200
|
] });
|
|
2197
|
-
return
|
|
2198
|
-
/* @__PURE__ */ a(
|
|
2199
|
-
/* @__PURE__ */ a(
|
|
2201
|
+
return n && o ? /* @__PURE__ */ c(pt, { children: [
|
|
2202
|
+
/* @__PURE__ */ a(ft, { render: /* @__PURE__ */ a("span", { className: "astw:cursor-default" }), children: u }),
|
|
2203
|
+
/* @__PURE__ */ a(gt, { side: "bottom", style: { maxWidth: 320 }, children: /* @__PURE__ */ a("p", { className: "astw:text-sm", children: e }) })
|
|
2200
2204
|
] }) : u;
|
|
2201
2205
|
}
|
|
2202
|
-
function
|
|
2206
|
+
function us({ field: t }) {
|
|
2203
2207
|
if (N(t.value))
|
|
2204
2208
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
|
|
2205
|
-
const e = String(t.value), s = t.meta?.badgeVariantMap || {},
|
|
2206
|
-
return /* @__PURE__ */ a(
|
|
2209
|
+
const e = String(t.value), s = t.meta?.badgeVariantMap || {}, n = e.toLowerCase(), r = s[e] || s[n] || "outline-neutral";
|
|
2210
|
+
return /* @__PURE__ */ a(ss, { variant: r, className: "astw:w-fit", children: os(e) });
|
|
2207
2211
|
}
|
|
2208
|
-
function
|
|
2212
|
+
function ws({ field: t }) {
|
|
2209
2213
|
if (N(t.value))
|
|
2210
2214
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
|
|
2211
|
-
const e = t.meta?.currencyKey || "currency", s =
|
|
2212
|
-
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:tabular-nums", children:
|
|
2215
|
+
const e = t.meta?.currencyKey || "currency", s = J(t.data, e), n = ls(t.value, s);
|
|
2216
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:tabular-nums", children: n });
|
|
2213
2217
|
}
|
|
2214
|
-
function
|
|
2218
|
+
function ms({ field: t }) {
|
|
2215
2219
|
if (N(t.value))
|
|
2216
2220
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
|
|
2217
|
-
const e = t.meta?.dateFormat || "medium", s =
|
|
2221
|
+
const e = t.meta?.dateFormat || "medium", s = is(t.value, e);
|
|
2218
2222
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: s });
|
|
2219
2223
|
}
|
|
2220
|
-
function
|
|
2224
|
+
function hs({ field: t }) {
|
|
2221
2225
|
if (N(t.value))
|
|
2222
2226
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
|
|
2223
|
-
const e = t.meta?.hrefKey, s = e ?
|
|
2227
|
+
const e = t.meta?.hrefKey, s = e ? J(t.data, e) : void 0, n = t.meta?.external ?? !1, r = String(t.value);
|
|
2224
2228
|
return s ? /* @__PURE__ */ c(
|
|
2225
2229
|
"a",
|
|
2226
2230
|
{
|
|
2227
2231
|
href: s,
|
|
2228
|
-
target:
|
|
2229
|
-
rel:
|
|
2232
|
+
target: n ? "_blank" : void 0,
|
|
2233
|
+
rel: n ? "noopener noreferrer" : void 0,
|
|
2230
2234
|
className: "astw:inline-flex astw:items-center astw:gap-1 astw:text-sm astw:text-primary astw:hover:underline",
|
|
2231
2235
|
children: [
|
|
2232
|
-
|
|
2233
|
-
|
|
2236
|
+
r,
|
|
2237
|
+
n && /* @__PURE__ */ a(Ft, { className: "astw:h-3 astw:w-3" })
|
|
2234
2238
|
]
|
|
2235
2239
|
}
|
|
2236
|
-
) : /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children:
|
|
2240
|
+
) : /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: r });
|
|
2237
2241
|
}
|
|
2238
|
-
function
|
|
2242
|
+
function ps({ field: t }) {
|
|
2239
2243
|
if (N(t.value))
|
|
2240
2244
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
|
|
2241
|
-
const e =
|
|
2245
|
+
const e = cs(t.value), s = t.meta?.copyable && !N(t.value), n = e.join(`
|
|
2242
2246
|
`);
|
|
2243
2247
|
return /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
|
|
2244
|
-
/* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((
|
|
2245
|
-
|
|
2248
|
+
/* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((r, o) => /* @__PURE__ */ c(g.Fragment, { children: [
|
|
2249
|
+
r,
|
|
2246
2250
|
o < e.length - 1 && /* @__PURE__ */ a("br", {})
|
|
2247
2251
|
] }, o)) }),
|
|
2248
|
-
s && /* @__PURE__ */ a(
|
|
2252
|
+
s && /* @__PURE__ */ a(de, { value: n })
|
|
2249
2253
|
] });
|
|
2250
2254
|
}
|
|
2251
|
-
function
|
|
2255
|
+
function fs({ field: t }) {
|
|
2252
2256
|
if (N(t.value))
|
|
2253
2257
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
|
|
2254
|
-
const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern,
|
|
2255
|
-
if (!
|
|
2256
|
-
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children:
|
|
2257
|
-
const o = s.replace("{id}",
|
|
2258
|
-
return /* @__PURE__ */ a("a", { href: o, className: "astw:text-sm astw:text-primary astw:hover:underline", children:
|
|
2258
|
+
const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, n = e ? J(t.data, e) : void 0, r = String(t.value);
|
|
2259
|
+
if (!n || !s)
|
|
2260
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: r });
|
|
2261
|
+
const o = s.replace("{id}", n);
|
|
2262
|
+
return /* @__PURE__ */ a("a", { href: o, className: "astw:text-sm astw:text-primary astw:hover:underline", children: r });
|
|
2259
2263
|
}
|
|
2260
|
-
function
|
|
2264
|
+
function _t(t) {
|
|
2261
2265
|
switch (t.type) {
|
|
2262
2266
|
case "text":
|
|
2263
|
-
return /* @__PURE__ */ a(
|
|
2267
|
+
return /* @__PURE__ */ a(ds, { field: t });
|
|
2264
2268
|
case "badge":
|
|
2265
|
-
return /* @__PURE__ */ a(
|
|
2269
|
+
return /* @__PURE__ */ a(us, { field: t });
|
|
2266
2270
|
case "money":
|
|
2267
|
-
return /* @__PURE__ */ a(
|
|
2271
|
+
return /* @__PURE__ */ a(ws, { field: t });
|
|
2268
2272
|
case "date":
|
|
2269
|
-
return /* @__PURE__ */ a(
|
|
2273
|
+
return /* @__PURE__ */ a(ms, { field: t });
|
|
2270
2274
|
case "link":
|
|
2271
|
-
return /* @__PURE__ */ a(
|
|
2275
|
+
return /* @__PURE__ */ a(hs, { field: t });
|
|
2272
2276
|
case "address":
|
|
2273
|
-
return /* @__PURE__ */ a(
|
|
2277
|
+
return /* @__PURE__ */ a(ps, { field: t });
|
|
2274
2278
|
case "reference":
|
|
2275
|
-
return /* @__PURE__ */ a(
|
|
2279
|
+
return /* @__PURE__ */ a(fs, { field: t });
|
|
2276
2280
|
default:
|
|
2277
2281
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
|
|
2278
2282
|
}
|
|
2279
2283
|
}
|
|
2280
|
-
function
|
|
2284
|
+
function gs(t) {
|
|
2281
2285
|
if (t.emptyBehavior !== "hide") return !1;
|
|
2282
2286
|
const e = t.value;
|
|
2283
2287
|
return e == null || e === "";
|
|
2284
2288
|
}
|
|
2285
|
-
function
|
|
2289
|
+
function bs(t) {
|
|
2286
2290
|
return !1;
|
|
2287
2291
|
}
|
|
2288
|
-
function
|
|
2289
|
-
const
|
|
2292
|
+
function vs(t, e, s) {
|
|
2293
|
+
const n = J(e, t.key);
|
|
2290
2294
|
return {
|
|
2291
2295
|
id: `${t.key}-${s}`,
|
|
2292
2296
|
label: t.label,
|
|
2293
2297
|
type: t.type ?? "text",
|
|
2294
|
-
value:
|
|
2298
|
+
value: n,
|
|
2295
2299
|
emptyBehavior: t.emptyBehavior ?? "dash",
|
|
2296
2300
|
meta: t.meta,
|
|
2297
2301
|
data: e
|
|
2298
2302
|
};
|
|
2299
2303
|
}
|
|
2300
|
-
function
|
|
2304
|
+
function xs(t, e) {
|
|
2301
2305
|
const s = [];
|
|
2302
|
-
let
|
|
2306
|
+
let n = [], r = 0, o = 0;
|
|
2303
2307
|
for (const i of t)
|
|
2304
|
-
if (
|
|
2305
|
-
|
|
2306
|
-
id: `section-${
|
|
2307
|
-
fields:
|
|
2308
|
-
}),
|
|
2309
|
-
else if (
|
|
2310
|
-
const l =
|
|
2311
|
-
o++,
|
|
2308
|
+
if (ns(i))
|
|
2309
|
+
n.length > 0 && (s.push({
|
|
2310
|
+
id: `section-${r}`,
|
|
2311
|
+
fields: n
|
|
2312
|
+
}), r++, n = []);
|
|
2313
|
+
else if (rs(i)) {
|
|
2314
|
+
const l = vs(i, e, o);
|
|
2315
|
+
o++, gs(l) || n.push(l);
|
|
2312
2316
|
}
|
|
2313
|
-
return
|
|
2317
|
+
return n.length > 0 && s.push({ id: `section-${r}`, fields: n }), s;
|
|
2314
2318
|
}
|
|
2315
|
-
function
|
|
2319
|
+
function zt({ label: t, children: e, fullWidth: s }) {
|
|
2316
2320
|
return /* @__PURE__ */ c(
|
|
2317
2321
|
"div",
|
|
2318
2322
|
{
|
|
@@ -2327,160 +2331,240 @@ function It({ label: t, children: e, fullWidth: s }) {
|
|
|
2327
2331
|
}
|
|
2328
2332
|
);
|
|
2329
2333
|
}
|
|
2330
|
-
function
|
|
2334
|
+
function ln({
|
|
2331
2335
|
data: t,
|
|
2332
2336
|
title: e,
|
|
2333
2337
|
fields: s,
|
|
2334
|
-
columns:
|
|
2335
|
-
className:
|
|
2338
|
+
columns: n = 3,
|
|
2339
|
+
className: r,
|
|
2336
2340
|
headerAction: o
|
|
2337
2341
|
}) {
|
|
2338
|
-
const i =
|
|
2342
|
+
const i = xs(s, t), l = i.some((w) => w.fields.length > 0), u = m(
|
|
2339
2343
|
"astw:grid astw:gap-x-6 astw:gap-y-4",
|
|
2340
2344
|
// Default: 1 column
|
|
2341
2345
|
"astw:grid-cols-1",
|
|
2342
2346
|
// Container queries for responsive columns
|
|
2343
|
-
|
|
2347
|
+
n === 4 ? (
|
|
2344
2348
|
// 4-column mode: 1 → 2 → 3 → 4 columns
|
|
2345
2349
|
"astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3 astw:@[800px]:grid-cols-4"
|
|
2346
2350
|
) : (
|
|
2347
2351
|
// 3-column mode: 1 → 2 → 3 columns
|
|
2348
2352
|
"astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3"
|
|
2349
2353
|
)
|
|
2350
|
-
),
|
|
2351
|
-
const h =
|
|
2354
|
+
), d = (w) => {
|
|
2355
|
+
const h = w.fields.filter((b) => !0), f = w.fields.filter((b) => bs());
|
|
2352
2356
|
return /* @__PURE__ */ c("div", { className: "astw:space-y-4", children: [
|
|
2353
|
-
h.length > 0 && /* @__PURE__ */ a("div", { className: u, children: h.map((
|
|
2354
|
-
|
|
2355
|
-
] },
|
|
2357
|
+
h.length > 0 && /* @__PURE__ */ a("div", { className: u, children: h.map((b) => /* @__PURE__ */ a(zt, { label: b.label, children: _t(b) }, b.id)) }),
|
|
2358
|
+
f.length > 0 && /* @__PURE__ */ a("div", { className: u, children: f.map((b) => /* @__PURE__ */ a(zt, { label: b.label, fullWidth: !0, children: _t(b) }, b.id)) })
|
|
2359
|
+
] }, w.id);
|
|
2356
2360
|
};
|
|
2357
|
-
return /* @__PURE__ */ a(
|
|
2361
|
+
return /* @__PURE__ */ a(ht, { delayDuration: 300, children: /* @__PURE__ */ c(
|
|
2358
2362
|
"div",
|
|
2359
2363
|
{
|
|
2360
2364
|
className: m(
|
|
2361
2365
|
"astw:@container astw:bg-card astw:text-card-foreground astw:rounded-xl astw:border",
|
|
2362
|
-
|
|
2366
|
+
r
|
|
2363
2367
|
),
|
|
2364
2368
|
children: [
|
|
2365
2369
|
/* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:justify-between astw:px-6 astw:py-6", children: [
|
|
2366
2370
|
/* @__PURE__ */ a("h3", { className: "astw:text-lg astw:font-semibold astw:leading-none", children: e }),
|
|
2367
2371
|
o && /* @__PURE__ */ a("div", { children: o })
|
|
2368
2372
|
] }),
|
|
2369
|
-
/* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: l ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((
|
|
2373
|
+
/* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: l ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((w, h) => /* @__PURE__ */ c(g.Fragment, { children: [
|
|
2370
2374
|
h > 0 && /* @__PURE__ */ a("div", { className: "astw:h-px astw:bg-border", role: "separator" }),
|
|
2371
|
-
w
|
|
2372
|
-
] },
|
|
2375
|
+
d(w)
|
|
2376
|
+
] }, w.id)) }) : /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: "No information available" }) })
|
|
2373
2377
|
]
|
|
2374
2378
|
}
|
|
2375
2379
|
) });
|
|
2376
2380
|
}
|
|
2377
|
-
const
|
|
2378
|
-
|
|
2381
|
+
const ys = "astw:flex astw:size-4 astw:items-center astw:justify-center", Ns = () => /* @__PURE__ */ a(
|
|
2382
|
+
"svg",
|
|
2383
|
+
{
|
|
2384
|
+
className: "astw:size-4 astw:animate-spin",
|
|
2385
|
+
viewBox: "0 0 16 16",
|
|
2386
|
+
fill: "none",
|
|
2387
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2388
|
+
"data-testid": "action-panel-spinner",
|
|
2389
|
+
children: /* @__PURE__ */ a(
|
|
2390
|
+
"circle",
|
|
2391
|
+
{
|
|
2392
|
+
cx: "8",
|
|
2393
|
+
cy: "8",
|
|
2394
|
+
r: "6",
|
|
2395
|
+
stroke: "currentColor",
|
|
2396
|
+
strokeWidth: "2",
|
|
2397
|
+
strokeLinecap: "round",
|
|
2398
|
+
strokeDasharray: "24 24",
|
|
2399
|
+
strokeDashoffset: "8"
|
|
2400
|
+
}
|
|
2401
|
+
)
|
|
2402
|
+
}
|
|
2403
|
+
), Ss = m(
|
|
2404
|
+
"astw:flex astw:items-center astw:gap-2 astw:w-full astw:rounded-md astw:px-3 astw:py-2",
|
|
2405
|
+
"astw:text-sm astw:font-medium astw:transition-colors astw:border astw:border-transparent",
|
|
2406
|
+
"astw:bg-transparent astw:text-left astw:cursor-pointer astw:[&_svg]:size-4 astw:[&_svg]:shrink-0"
|
|
2407
|
+
), Cs = "astw:hover:bg-accent astw:hover:text-accent-foreground astw:outline-none astw:focus-visible:ring-2 astw:focus-visible:ring-ring astw:focus-visible:ring-offset-2", Ts = "astw:pointer-events-none astw:opacity-50";
|
|
2408
|
+
function ks({ action: t }) {
|
|
2409
|
+
const { key: e, label: s, icon: n, onClick: r, disabled: o, loading: i } = t, l = !!o || !!i, u = /* @__PURE__ */ c(S, { children: [
|
|
2410
|
+
/* @__PURE__ */ a("span", { className: ys, "aria-hidden": !0, children: i ? /* @__PURE__ */ a(Ns, {}) : n }),
|
|
2411
|
+
/* @__PURE__ */ a("span", { className: "astw:min-w-0 astw:truncate", children: s })
|
|
2412
|
+
] }), d = m(
|
|
2413
|
+
Ss,
|
|
2414
|
+
l ? Ts : Cs
|
|
2415
|
+
);
|
|
2416
|
+
return /* @__PURE__ */ a(
|
|
2417
|
+
"button",
|
|
2418
|
+
{
|
|
2419
|
+
type: "button",
|
|
2420
|
+
className: d,
|
|
2421
|
+
onClick: l ? void 0 : r,
|
|
2422
|
+
disabled: l,
|
|
2423
|
+
"aria-disabled": l,
|
|
2424
|
+
"aria-busy": i,
|
|
2425
|
+
"data-slot": "action-panel-item",
|
|
2426
|
+
"data-key": e,
|
|
2427
|
+
children: u
|
|
2428
|
+
}
|
|
2429
|
+
);
|
|
2430
|
+
}
|
|
2431
|
+
function cn({ title: t, actions: e, className: s }) {
|
|
2432
|
+
return /* @__PURE__ */ c(
|
|
2433
|
+
"div",
|
|
2434
|
+
{
|
|
2435
|
+
className: m(
|
|
2436
|
+
"astw:min-w-[278px] astw:w-full astw:bg-card astw:text-card-foreground astw:rounded-xl astw:border astw:shadow-xs",
|
|
2437
|
+
s
|
|
2438
|
+
),
|
|
2439
|
+
children: [
|
|
2440
|
+
/* @__PURE__ */ a("div", { className: "astw:px-4 astw:pt-6 astw:pb-4", children: /* @__PURE__ */ a("h3", { className: "astw:text-lg astw:font-semibold astw:leading-none astw:pl-3", children: t }) }),
|
|
2441
|
+
/* @__PURE__ */ a("div", { className: "astw:px-4 astw:pb-4", children: e.length === 0 ? /* @__PURE__ */ a("p", { className: "astw:py-2 astw:pl-3 astw:text-sm astw:text-muted-foreground", children: "No actions available" }) : /* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-0", role: "list", children: e.map((n) => /* @__PURE__ */ a("div", { role: "listitem", children: /* @__PURE__ */ a(ks, { action: n }) }, n.key)) }) })
|
|
2442
|
+
]
|
|
2443
|
+
}
|
|
2444
|
+
);
|
|
2445
|
+
}
|
|
2446
|
+
const xt = g.forwardRef(
|
|
2447
|
+
({ className: t, children: e, area: s, ...n }, r) => /* @__PURE__ */ a(
|
|
2379
2448
|
"div",
|
|
2380
2449
|
{
|
|
2381
2450
|
ref: r,
|
|
2451
|
+
"data-layout-column": "",
|
|
2452
|
+
...s ? { "data-area": s } : {},
|
|
2382
2453
|
className: m("astw:min-w-0 astw:flex astw:flex-col astw:gap-4", t),
|
|
2383
|
-
...
|
|
2454
|
+
...n,
|
|
2384
2455
|
children: e
|
|
2385
2456
|
}
|
|
2386
2457
|
)
|
|
2387
2458
|
);
|
|
2388
2459
|
xt.displayName = "Layout.Column";
|
|
2389
|
-
function
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
const l = m(
|
|
2398
|
-
"astw:flex astw:w-full",
|
|
2399
|
-
s === 4 ? "astw:gap-4" : s === 6 ? "astw:gap-6" : s === 8 ? "astw:gap-8" : "astw:gap-4",
|
|
2400
|
-
// 1 column: Always stack vertically
|
|
2401
|
-
t === 1 && "astw:flex-col",
|
|
2402
|
-
// 2 columns: Stack on mobile, side-by-side on desktop (lg: ≥1024px)
|
|
2403
|
-
// Main column flexible, side column fixed 360px
|
|
2404
|
-
t === 2 && ["astw:flex-col", "astw:lg:flex-row"],
|
|
2405
|
-
// 3 columns: Stack on mobile, 3 columns side-by-side on desktop (xl: ≥1280px)
|
|
2406
|
-
// Outer columns fixed 360px, middle column flexible
|
|
2407
|
-
t === 3 && ["astw:flex-col", "astw:xl:flex-row"],
|
|
2408
|
-
e
|
|
2409
|
-
), u = f.useMemo(() => t === 1 ? f.Children.map(o, (d) => d) : t === 2 ? f.Children.map(o, (d, h) => f.isValidElement(d) ? f.cloneElement(d, {
|
|
2410
|
-
className: m(
|
|
2411
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- React child props type is not known
|
|
2412
|
-
d.props.className,
|
|
2413
|
-
h === 0 ? "astw:lg:flex-1" : "astw:lg:min-w-[280px]"
|
|
2414
|
-
// Second column: fixed 280px
|
|
2415
|
-
)
|
|
2416
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- React.cloneElement requires type assertion
|
|
2417
|
-
}) : d) : t === 3 ? f.Children.map(o, (d, h) => f.isValidElement(d) ? f.cloneElement(d, {
|
|
2418
|
-
className: m(
|
|
2419
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- React child props type is not known
|
|
2420
|
-
d.props.className,
|
|
2421
|
-
h === 0 ? "astw:xl:min-w-[320px]" : h === 2 ? "astw:xl:min-w-[280px]" : "astw:xl:flex-1"
|
|
2422
|
-
// Middle column: flexible
|
|
2423
|
-
)
|
|
2424
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- React.cloneElement requires type assertion
|
|
2425
|
-
}) : d) : o, [o, t]), w = r || n && n.length > 0;
|
|
2426
|
-
return /* @__PURE__ */ c("div", { className: "astw:flex astw:flex-col", children: [
|
|
2427
|
-
w && /* @__PURE__ */ c(
|
|
2428
|
-
"header",
|
|
2429
|
-
{
|
|
2430
|
-
className: "astw:w-full astw:flex astw:justify-between astw:items-center",
|
|
2431
|
-
style: { paddingTop: "1rem", paddingBottom: "1rem" },
|
|
2432
|
-
children: [
|
|
2433
|
-
r && /* @__PURE__ */ a("h1", { style: { fontSize: "1.5rem", fontWeight: "bold" }, children: r }),
|
|
2434
|
-
n && n.length > 0 && /* @__PURE__ */ a("div", { className: "astw:flex astw:gap-2 astw:items-center", children: n.map((d, h) => /* @__PURE__ */ a(f.Fragment, { children: d }, h)) })
|
|
2435
|
-
]
|
|
2436
|
-
}
|
|
2437
|
-
),
|
|
2438
|
-
/* @__PURE__ */ a("div", { style: { padding: w ? "0 0 1rem 0" : "1rem 0 1rem 0" }, children: /* @__PURE__ */ a("div", { className: l, children: u }) })
|
|
2460
|
+
function yt({ title: t, actions: e, children: s }) {
|
|
2461
|
+
const n = t || e != null && e.length > 0;
|
|
2462
|
+
return /* @__PURE__ */ c("header", { "data-layout-header": "", className: "astw:flex astw:w-full astw:flex-col", children: [
|
|
2463
|
+
n && /* @__PURE__ */ c("div", { className: "astw:flex astw:w-full astw:flex-1 astw:items-center astw:justify-between astw:pt-4", children: [
|
|
2464
|
+
t && /* @__PURE__ */ a("h1", { className: "astw:text-2xl astw:font-bold astw:tracking-tight", children: t }),
|
|
2465
|
+
e != null && e.length > 0 && /* @__PURE__ */ a("div", { className: "astw:ml-auto astw:flex astw:gap-2 astw:items-center", children: e.map((r, o) => /* @__PURE__ */ a(g.Fragment, { children: r }, o)) })
|
|
2466
|
+
] }),
|
|
2467
|
+
s != null && s !== !1 && /* @__PURE__ */ a("div", { className: "astw:w-full", children: s })
|
|
2439
2468
|
] });
|
|
2440
2469
|
}
|
|
2441
|
-
|
|
2442
|
-
|
|
2470
|
+
yt.displayName = "Layout.Header";
|
|
2471
|
+
const Rs = {
|
|
2472
|
+
left: "320px",
|
|
2473
|
+
main: "1fr",
|
|
2474
|
+
right: "280px"
|
|
2475
|
+
}, Ps = {
|
|
2476
|
+
2: "1fr 280px",
|
|
2477
|
+
3: "320px 1fr 280px"
|
|
2478
|
+
};
|
|
2479
|
+
function ue({ columns: t, className: e, gap: s, title: n, actions: r, children: o }) {
|
|
2480
|
+
const i = [];
|
|
2481
|
+
let l = !1;
|
|
2482
|
+
g.Children.forEach(o, (p) => {
|
|
2483
|
+
g.isValidElement(p) && (p.type === yt ? l = !0 : p.type === xt && i.push(p.props.area));
|
|
2484
|
+
});
|
|
2485
|
+
const u = i.length, d = t ?? u;
|
|
2486
|
+
t !== void 0 && t !== u && console.warn(
|
|
2487
|
+
`Layout: \`columns\` prop (${t}) does not match Layout.Column child count (${u}). The \`columns\` prop is deprecated; remove it to use auto-detection.`
|
|
2488
|
+
);
|
|
2489
|
+
const w = i.some((p) => p != null);
|
|
2490
|
+
let h;
|
|
2491
|
+
d >= 2 && (w ? h = i.map((p) => p ? Rs[p] : "1fr").join(" ") : h = Ps[d] ?? `repeat(${d}, 1fr)`);
|
|
2492
|
+
const f = s === void 0 || s === 4 ? "astw:gap-4" : s === 6 ? "astw:gap-6" : s === 8 ? "astw:gap-8" : "astw:gap-4", b = !l && (n || r != null && r.length > 0);
|
|
2493
|
+
return /* @__PURE__ */ c(
|
|
2494
|
+
"div",
|
|
2495
|
+
{
|
|
2496
|
+
className: m(
|
|
2497
|
+
"astw:grid astw:grid-cols-1 astw:w-full",
|
|
2498
|
+
l || b ? "astw:pb-4" : "astw:py-4",
|
|
2499
|
+
f,
|
|
2500
|
+
"astw:[&>[data-layout-header]]:col-span-full",
|
|
2501
|
+
d === 2 && h && "astw:lg:grid-cols-[var(--layout-cols)]",
|
|
2502
|
+
d >= 3 && h && "astw:xl:grid-cols-[var(--layout-cols)]",
|
|
2503
|
+
e
|
|
2504
|
+
),
|
|
2505
|
+
style: h ? { "--layout-cols": h } : void 0,
|
|
2506
|
+
children: [
|
|
2507
|
+
b && /* @__PURE__ */ c(
|
|
2508
|
+
"header",
|
|
2509
|
+
{
|
|
2510
|
+
"data-layout-header": "",
|
|
2511
|
+
className: "astw:w-full astw:flex astw:justify-between astw:items-center astw:pt-4",
|
|
2512
|
+
children: [
|
|
2513
|
+
n && /* @__PURE__ */ a("h1", { className: "astw:text-2xl astw:font-bold astw:tracking-tight", children: n }),
|
|
2514
|
+
r != null && r.length > 0 && /* @__PURE__ */ a("div", { className: "astw:flex astw:gap-2 astw:items-center", children: r.map((p, v) => /* @__PURE__ */ a(g.Fragment, { children: p }, v)) })
|
|
2515
|
+
]
|
|
2516
|
+
}
|
|
2517
|
+
),
|
|
2518
|
+
o
|
|
2519
|
+
]
|
|
2520
|
+
}
|
|
2521
|
+
);
|
|
2522
|
+
}
|
|
2523
|
+
ue.Column = xt;
|
|
2524
|
+
ue.Header = yt;
|
|
2525
|
+
function dn() {
|
|
2443
2526
|
return {
|
|
2444
2527
|
for(t, ...e) {
|
|
2445
2528
|
const s = e[0];
|
|
2446
|
-
return s ? t.replace(/:([^/?]+)|\*([^/?]+)/g, (
|
|
2529
|
+
return s ? t.replace(/:([^/?]+)|\*([^/?]+)/g, (n, r, o) => r ? encodeURIComponent(s[r] ?? "") : (s[o] ?? "").split("/").map((l) => encodeURIComponent(l)).join("/")) : t;
|
|
2447
2530
|
}
|
|
2448
2531
|
};
|
|
2449
2532
|
}
|
|
2450
2533
|
export {
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2534
|
+
cn as ActionPanel,
|
|
2535
|
+
ee as AppShell,
|
|
2536
|
+
sn as AuthProvider,
|
|
2537
|
+
ss as Badge,
|
|
2538
|
+
tn as CommandPalette,
|
|
2539
|
+
Aa as DefaultSidebar,
|
|
2540
|
+
ln as DescriptionCard,
|
|
2541
|
+
ue as Layout,
|
|
2542
|
+
mn as Link,
|
|
2543
|
+
Xs as SidebarGroup,
|
|
2544
|
+
Qs as SidebarItem,
|
|
2545
|
+
Js as SidebarLayout,
|
|
2546
|
+
Zs as SidebarSeparator,
|
|
2547
|
+
en as WithGuard,
|
|
2548
|
+
ts as badgeVariants,
|
|
2549
|
+
an as createAuthClient,
|
|
2550
|
+
dn as createTypedPaths,
|
|
2551
|
+
Fe as defineI18nLabels,
|
|
2552
|
+
qs as defineModule,
|
|
2553
|
+
Ys as defineResource,
|
|
2554
|
+
Vs as hidden,
|
|
2555
|
+
Ks as pass,
|
|
2556
|
+
Gs as redirectTo,
|
|
2557
|
+
Ht as useAppShell,
|
|
2474
2558
|
C as useAppShellConfig,
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2559
|
+
Hs as useAppShellData,
|
|
2560
|
+
nn as useAuth,
|
|
2561
|
+
rn as useAuthSuspense,
|
|
2562
|
+
hn as useLocation,
|
|
2563
|
+
pn as useNavigate,
|
|
2564
|
+
Ta as usePageMeta,
|
|
2565
|
+
fn as useParams,
|
|
2566
|
+
gn as useRouteError,
|
|
2567
|
+
bn as useSearchParams,
|
|
2568
|
+
Je as useTheme,
|
|
2569
|
+
on as useToast
|
|
2486
2570
|
};
|