@tailor-platform/app-shell 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app-shell.js CHANGED
@@ -1,25 +1,25 @@
1
- import { jsx as a, jsxs as l, Fragment as L } from "react/jsx-runtime";
2
- import * as g from "react";
3
- import { createContext as q, useContext as G, useState as R, useMemo as $, useEffect as y, Suspense as Tt, useRef as Gt, useCallback as lt } from "react";
4
- import { useRouteError as Yt, isRouteErrorResponse as Xt, Outlet as Y, NavLink as Zt, redirect as kt, Navigate as Jt, useRouteLoaderData as te, createMemoryRouter as ee, createBrowserRouter as ae, RouterProvider as se, useHref as re, Link as ne, useLocation as Rt, useMatch as oe, Await as Et, useNavigate as ie } from "react-router";
5
- import { Link as us, useLocation as ms, useNavigate as hs, useParams as fs, useRouteError as ps, useSearchParams as gs } from "react-router";
6
- import { Slot as A } from "@radix-ui/react-slot";
1
+ import { jsx as a, jsxs as d, Fragment as B } from "react/jsx-runtime";
2
+ import { capitalCase as A } from "change-case";
3
+ import { useRouteError as Yt, isRouteErrorResponse as Xt, redirect as Rt, Outlet as Y, NavLink as Zt, Navigate as Jt, useRouteLoaderData as te, createMemoryRouter as ee, createBrowserRouter as ae, RouterProvider as se, useHref as re, Link as ne, useLocation as Et, Await as Bt, useMatch as oe, useNavigate as ie } from "react-router";
4
+ import { Link as ys, useLocation as Ns, useNavigate as Cs, useParams as Ss, useRouteError as Ts, useSearchParams as ks } from "react-router";
5
+ import { Slot as z } from "@radix-ui/react-slot";
7
6
  import { cva as X } from "class-variance-authority";
8
7
  import { clsx as le } from "clsx";
9
8
  import { twMerge as de } from "tailwind-merge";
10
- import { AlertCircle as dt, Table as ce, XIcon as Lt, PanelLeftIcon as we, ChevronRight as H, SunIcon as ue, SearchIcon as me, ExternalLink as he, Check as fe, Copy as pe } from "lucide-react";
11
- import { capitalCase as M } from "change-case";
12
- import { Toaster as ge } from "sonner";
9
+ import { AlertCircle as ct, Table as ce, XIcon as Dt, PanelLeftIcon as we, ChevronRight as q, SunIcon as ue, SearchIcon as me, ExternalLink as he, Check as fe, Copy as ge } from "lucide-react";
10
+ import * as p from "react";
11
+ import { createContext as W, useContext as D, useState as R, useMemo as k, useEffect as y, Suspense as Lt, useRef as pe, useCallback as wt } from "react";
12
+ import { Toaster as be, toast as xe } from "sonner";
13
13
  import * as Z from "@radix-ui/react-collapsible";
14
14
  import "@radix-ui/react-separator";
15
15
  import * as b from "@radix-ui/react-dialog";
16
16
  import * as E from "@radix-ui/react-tooltip";
17
- import { print as be } from "graphql";
18
- import { createAuthClient as xe } from "@tailor-platform/auth-browser-client";
17
+ import { print as ve } from "graphql";
18
+ import { createAuthClient as ye } from "@tailor-platform/auth-browser-client";
19
19
  function m(...t) {
20
20
  return de(le(t));
21
21
  }
22
- const ve = X(
22
+ const Ne = X(
23
23
  "astw:inline-flex astw:items-center astw:justify-center astw:gap-2 astw:whitespace-nowrap astw:rounded-md astw:text-sm astw:font-medium astw:transition-all astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:[&_svg]:pointer-events-none astw:[&_svg:not([class*='size-'])]:size-4 astw:shrink-0 astw:[&_svg]:shrink-0 astw:outline-none astw:focus-visible:border-ring astw:focus-visible:ring-ring/50 astw:focus-visible:ring-[3px] astw:aria-invalid:ring-destructive/20 astw:dark:aria-invalid:ring-destructive/40 astw:aria-invalid:border-destructive",
24
24
  {
25
25
  variants: {
@@ -44,7 +44,7 @@ const ve = X(
44
44
  }
45
45
  }
46
46
  );
47
- function I({
47
+ function _({
48
48
  className: t,
49
49
  variant: e,
50
50
  size: s,
@@ -52,30 +52,57 @@ function I({
52
52
  ...n
53
53
  }) {
54
54
  return /* @__PURE__ */ a(
55
- r ? A : "button",
55
+ r ? z : "button",
56
56
  {
57
57
  "data-slot": "button",
58
- className: m(ve({ variant: e, size: s, className: t })),
58
+ className: m(Ne({ variant: e, size: s, className: t })),
59
59
  ...n
60
60
  }
61
61
  );
62
62
  }
63
- const O = "en", ye = () => {
63
+ const $ = "en", Ce = () => {
64
64
  try {
65
65
  if (typeof navigator > "u")
66
- return O;
66
+ return $;
67
67
  const t = navigator.languages?.[0] ?? navigator.language;
68
- return t ? new Intl.Locale(t).language : O;
68
+ return t ? new Intl.Locale(t).language : $;
69
69
  } catch {
70
- return O;
70
+ return $;
71
71
  }
72
- }, J = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, Bt = (t) => {
72
+ }, J = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, Pt = (t) => {
73
73
  const e = J(t);
74
- return (s, r) => e(s, typeof s == "string" ? s : M(r));
75
- }, Ne = () => {
76
- const { configurations: t } = k(), e = J(t.locale);
74
+ return (s, r) => e(s, typeof s == "string" ? s : A(r));
75
+ }, Se = (t) => ({
76
+ modules: t.modules,
77
+ settingsResources: t.settingsResources ?? [],
78
+ errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(j, {}),
79
+ basePath: t.basePath,
80
+ locale: t.locale ?? Ce()
81
+ }), tt = W({
82
+ configurations: {
83
+ modules: [],
84
+ settingsResources: [],
85
+ locale: $,
86
+ // Using null! to avoid circular dependency issues.
87
+ // DefaultErrorBoundary imports useT from i18n-labels, which imports
88
+ // defineI18nLabels from hooks/i18n, which imports useAppShellConfig
89
+ // from this file - creating a circular reference.
90
+ // This default value is never used in practice because AppShell
91
+ // always provides the context via AppShellConfigContext.Provider.
92
+ errorBoundary: null
93
+ }
94
+ }), et = W({
95
+ contextData: {}
96
+ }), L = () => D(tt), os = () => D(et), Te = () => {
97
+ const t = D(tt), e = D(et);
98
+ return {
99
+ ...t,
100
+ ...e
101
+ };
102
+ }, ke = () => {
103
+ const { configurations: t } = L(), e = J(t.locale);
77
104
  return (s, r) => e(s, r);
78
- }, Ce = (t) => {
105
+ }, Re = (t) => {
79
106
  const e = (s) => (r) => t[s]?.[r] ?? t.en[r];
80
107
  return {
81
108
  /**
@@ -98,11 +125,14 @@ const O = "en", ye = () => {
98
125
  * ```
99
126
  */
100
127
  useT: () => {
101
- const { configurations: s } = k(), r = e(s.locale);
102
- return ((n, ...o) => {
103
- const i = r(n);
104
- return typeof i == "function" ? i(o[0]) : i;
128
+ const { configurations: s } = L(), r = e(s.locale), n = ((o, ...i) => {
129
+ const l = r(o);
130
+ return typeof l == "function" ? l(i[0]) : l;
105
131
  });
132
+ return n.dynamic = (o, i) => {
133
+ const l = t[s.locale]?.[o] ?? t.en[o];
134
+ return l === void 0 || typeof l == "function" ? i : l;
135
+ }, n;
106
136
  },
107
137
  /**
108
138
  * A function to get the translater for a specific label key.
@@ -131,7 +161,7 @@ const O = "en", ye = () => {
131
161
  return typeof o == "function" ? o(r[0]) : o;
132
162
  }
133
163
  };
134
- }, Se = Ce({
164
+ }, Ee = Re({
135
165
  en: {
136
166
  error404Title: "404 Not Found",
137
167
  error404Body: "The page you requested could not be found.",
@@ -170,19 +200,19 @@ const O = "en", ye = () => {
170
200
  commandPaletteSearch: "ページを検索...",
171
201
  commandPaletteNoResults: "結果が見つかりません"
172
202
  }
173
- }), B = Se.useT, z = () => {
174
- const t = Yt(), e = B(), s = {
203
+ }), P = Ee.useT, j = () => {
204
+ const t = Yt(), e = P(), s = {
175
205
  role: "alert",
176
206
  "aria-label": "default-error-boundary"
177
207
  };
178
208
  if (Xt(t) && t.status === 404)
179
- return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
180
- /* @__PURE__ */ a(dt, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
181
- /* @__PURE__ */ l("div", { children: [
209
+ return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
210
+ /* @__PURE__ */ a(ct, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
211
+ /* @__PURE__ */ d("div", { children: [
182
212
  /* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("error404Title") }),
183
213
  /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: e("error404Body") }),
184
214
  /* @__PURE__ */ a(
185
- I,
215
+ _,
186
216
  {
187
217
  variant: "outline",
188
218
  size: "sm",
@@ -194,13 +224,13 @@ const O = "en", ye = () => {
194
224
  ] })
195
225
  ] }) });
196
226
  const r = t instanceof Error ? t.message : e("errorUnexpected");
197
- return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
198
- /* @__PURE__ */ a(dt, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
199
- /* @__PURE__ */ l("div", { children: [
227
+ return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
228
+ /* @__PURE__ */ a(ct, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
229
+ /* @__PURE__ */ d("div", { children: [
200
230
  /* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("errorTitle") }),
201
231
  /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: r }),
202
232
  /* @__PURE__ */ a(
203
- I,
233
+ _,
204
234
  {
205
235
  variant: "outline",
206
236
  size: "sm",
@@ -211,162 +241,165 @@ const O = "en", ye = () => {
211
241
  )
212
242
  ] })
213
243
  ] }) });
214
- }, Te = (t) => ({
215
- modules: t.modules,
216
- settingsResources: t.settingsResources ?? [],
217
- errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(z, {}),
218
- basePath: t.basePath,
219
- locale: t.locale ?? ye()
220
- }), Pt = q({
221
- configurations: {
222
- modules: [],
223
- settingsResources: [],
224
- errorBoundary: /* @__PURE__ */ a(z, {}),
225
- locale: O
226
- }
227
- }), k = () => G(Pt), ke = () => {
228
- const t = B();
229
- return /* @__PURE__ */ l(L, { children: [
230
- /* @__PURE__ */ a("p", { className: "astw:font-semibold astw:leading-none astw:tracking-tight", children: t("welcomeTitle") }),
231
- /* @__PURE__ */ a("p", { className: "pt-4", children: t("welcomeBody") })
232
- ] });
233
- }, ct = () => /* @__PURE__ */ l(L, { children: [
234
- /* @__PURE__ */ a(Y, {}),
235
- /* @__PURE__ */ a(ge, {})
236
- ] }), Re = () => {
237
- const { configurations: t } = k(), e = B(), s = Ne();
238
- return /* @__PURE__ */ l("div", { className: "astw:mx-auto astw:flex-col astw:flex astw:md:flex-row astw:max-w-5xl astw:gap-[10px] astw:w-full", children: [
239
- /* @__PURE__ */ a("div", { children: /* @__PURE__ */ l("nav", { className: "astw:bg-card astw:md:w-xs astw:rounded-md astw:border astw:p-3 astw:shadow-xs", children: [
240
- /* @__PURE__ */ a("h2", { className: "astw:text-sm astw:leading-[36px] astw:mb-2 astw:font-bold ", children: e("settings") }),
241
- /* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(Zt, { to: `./${r.path}`, children: ({ isActive: n }) => /* @__PURE__ */ l(
242
- I,
243
- {
244
- variant: n ? "secondary" : "ghost",
245
- className: "astw:w-full astw:justify-start",
246
- children: [
247
- r.meta.icon,
248
- s(r.meta.title, r.path)
249
- ]
250
- }
251
- ) }) }, r.path)) })
252
- ] }) }),
253
- /* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(Y, {}) })
254
- ] });
255
- }, Dt = () => new Response("Not Found", { status: 404 }), tt = async (t, e) => {
256
- if (!t) return { state: "visible" };
257
- const s = new URL(e.request.url);
258
- return await t({
244
+ };
245
+ let Mt = {};
246
+ const Be = (t) => {
247
+ Mt = t;
248
+ }, is = () => ({ type: "pass" }), ls = () => ({ type: "hidden" }), ds = (t) => ({
249
+ type: "redirect",
250
+ to: t
251
+ }), at = () => new Response("Not Found", { status: 404 }), K = async (t, e) => {
252
+ if (!t || t.length === 0) return { type: "pass" };
253
+ const s = new URL(e.request.url), r = {
259
254
  params: e.params,
260
255
  searchParams: s.searchParams,
261
- signal: e.request.signal
262
- }) ?? { state: "visible" };
263
- }, Mt = (t, e) => async (s) => {
264
- switch ((await tt(t, s)).state) {
256
+ signal: e.request.signal,
257
+ context: Mt
258
+ };
259
+ for (const n of t) {
260
+ const o = await n(r);
261
+ if (o.type !== "pass")
262
+ return o;
263
+ }
264
+ return { type: "pass" };
265
+ }, It = (t, e) => async (s) => {
266
+ const r = await K(t, s);
267
+ switch (r.type) {
265
268
  case "hidden":
266
- throw Dt();
267
- case "visible":
269
+ throw at();
270
+ case "redirect":
271
+ return Rt(r.to);
272
+ case "pass":
268
273
  return e ? e(s) : null;
269
274
  }
270
- };
271
- function es(t) {
272
- return {
273
- redirectTo: t
274
- };
275
- }
276
- function U(t) {
277
- return typeof t == "object" && t !== null && "redirectTo" in t;
278
- }
279
- const It = (t, e) => () => {
280
- const { configurations: s } = k(), { metaTitle: r, fallbackTitle: n } = t, i = J(s.locale)(r, n);
275
+ }, At = (t, e) => () => {
276
+ const { configurations: s } = L(), { metaTitle: r, fallbackTitle: n } = t, i = J(s.locale)(r, n);
281
277
  return e(i);
282
278
  };
283
- function as(t) {
284
- const { path: e, meta: s, component: r, resources: n, errorBoundary: o, accessControl: i } = t, c = s?.title ?? M(e), u = M(e), w = U(r) ? {
285
- // Use loader for redirects
286
- component: () => null,
287
- baseLoader: () => kt(r.redirectTo)
288
- } : {
289
- // Regular component with locale-aware title
290
- component: It(
291
- { metaTitle: c, fallbackTitle: u },
292
- (h) => r({ title: h, resources: n })
293
- ),
294
- baseLoader: void 0
295
- }, d = i || w.baseLoader ? Mt(i, w.baseLoader) : void 0;
279
+ function cs(t) {
280
+ const { path: e, meta: s, component: r, resources: n, errorBoundary: o, guards: i } = t, l = s?.title ?? A(e), u = A(e), w = i && i.length > 0 ? It(i) : void 0, c = r ? At(
281
+ { metaTitle: l, fallbackTitle: u },
282
+ (h) => r({ title: h, resources: n })
283
+ ) : void 0;
296
284
  return {
297
285
  path: e,
298
286
  type: "component",
299
287
  _type: "module",
300
- component: w.component,
301
- loader: d,
288
+ component: c,
289
+ loader: w,
302
290
  meta: {
303
- title: c,
291
+ title: l,
304
292
  ...s?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: s.breadcrumbTitle } : {},
305
293
  ...s,
306
- menuItemClickable: !U(r),
294
+ menuItemClickable: r !== void 0,
307
295
  icon: t.meta?.icon
308
296
  },
309
297
  resources: n,
310
- errorBoundary: o || /* @__PURE__ */ a(z, {}),
311
- accessControl: i
298
+ errorBoundary: o || /* @__PURE__ */ a(j, {}),
299
+ guards: i
312
300
  };
313
301
  }
314
- function ss(t) {
315
- const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, accessControl: i } = t, c = n?.title ?? M(e), u = M(e), w = i ? Mt(i) : void 0;
302
+ function ws(t) {
303
+ const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, guards: i } = t, l = n?.title ?? A(e), u = A(e), w = i && i.length > 0 ? It(i) : void 0;
316
304
  return {
317
305
  _type: "resource",
318
306
  type: "component",
319
307
  path: e,
320
308
  meta: {
321
- title: c,
309
+ title: l,
322
310
  icon: n?.icon,
323
311
  ...n?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: n.breadcrumbTitle } : {}
324
312
  },
325
- component: It(
326
- { metaTitle: c, fallbackTitle: u },
327
- (d) => s({ title: d, resources: r })
313
+ component: At(
314
+ { metaTitle: l, fallbackTitle: u },
315
+ (c) => s({ title: c, resources: r })
328
316
  ),
329
317
  subResources: r,
330
- errorBoundary: o ?? /* @__PURE__ */ a(z, {}),
331
- accessControl: i,
318
+ errorBoundary: o ?? /* @__PURE__ */ a(j, {}),
319
+ guards: i,
332
320
  loader: w
333
321
  };
334
322
  }
335
- const et = (t) => () => /* @__PURE__ */ a(L, { children: t }), At = (t, e, s) => {
336
- const r = t.errorBoundary || s, n = {
323
+ const De = () => {
324
+ const t = P();
325
+ return /* @__PURE__ */ d(B, { children: [
326
+ /* @__PURE__ */ a("p", { className: "astw:font-semibold astw:leading-none astw:tracking-tight", children: t("welcomeTitle") }),
327
+ /* @__PURE__ */ a("p", { className: "pt-4", children: t("welcomeBody") })
328
+ ] });
329
+ }, ut = () => /* @__PURE__ */ d(B, { children: [
330
+ /* @__PURE__ */ a(Y, {}),
331
+ /* @__PURE__ */ a(be, {})
332
+ ] }), Le = () => {
333
+ const { configurations: t } = Te(), e = P(), s = ke();
334
+ return /* @__PURE__ */ d("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: [
335
+ /* @__PURE__ */ a("div", { children: /* @__PURE__ */ d("nav", { className: "astw:bg-card astw:md:w-xs astw:rounded-md astw:border astw:p-3 astw:shadow-xs", children: [
336
+ /* @__PURE__ */ a("h2", { className: "astw:text-sm astw:leading-[36px] astw:mb-2 astw:font-bold ", children: e("settings") }),
337
+ /* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(Zt, { to: `./${r.path}`, children: ({ isActive: n }) => /* @__PURE__ */ d(
338
+ _,
339
+ {
340
+ variant: n ? "secondary" : "ghost",
341
+ className: "astw:w-full astw:justify-start",
342
+ children: [
343
+ r.meta.icon,
344
+ s(r.meta.title, r.path)
345
+ ]
346
+ }
347
+ ) }) }, r.path)) })
348
+ ] }) }),
349
+ /* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(Y, {}) })
350
+ ] });
351
+ }, st = (t) => () => /* @__PURE__ */ a(B, { children: t }), _t = (t, e, s) => {
352
+ const r = t.errorBoundary || s, n = t.component ? {
337
353
  index: !0,
338
- Component: t.component,
339
- ...t.loader && { loader: t.loader }
340
- };
354
+ Component: t.component
355
+ } : void 0;
341
356
  return {
342
357
  path: t.path,
358
+ ...t.loader && { loader: t.loader },
343
359
  ...t.errorBoundary && {
344
- ErrorBoundary: et(t.errorBoundary)
360
+ ErrorBoundary: st(t.errorBoundary)
345
361
  },
346
362
  ...e && e.length > 0 ? {
347
363
  children: [
348
- n,
364
+ ...n ? [n] : [],
349
365
  ...e.map(
350
- (o) => At(o, o.subResources, r)
366
+ (o) => _t(o, o.subResources, r)
351
367
  )
352
368
  ]
353
- } : {
369
+ } : n ? {
354
370
  children: [n]
355
- }
371
+ } : {}
356
372
  };
357
- }, Ee = (t) => t.map(
358
- (e) => At(e, e.resources, e.errorBoundary)
359
- ), Le = ({
373
+ }, Pe = (t) => {
374
+ const e = _t(t, t.resources, t.errorBoundary);
375
+ if (!t.component && t.resources.length > 0) {
376
+ const s = {
377
+ index: !0,
378
+ // Component is required to suppress React Router's warning about empty leaf routes,
379
+ // even though the loader always redirects and this component will never render.
380
+ Component: () => null,
381
+ loader: async (n) => {
382
+ for (const o of t.resources)
383
+ if ((await K(o.guards, n)).type === "pass")
384
+ return Rt(o.path);
385
+ throw at();
386
+ }
387
+ }, r = {
388
+ path: e.path,
389
+ children: [s, ...e.children ?? []],
390
+ ...e.loader && { loader: e.loader }
391
+ };
392
+ return e.ErrorBoundary && (r.ErrorBoundary = e.ErrorBoundary), r;
393
+ }
394
+ return e;
395
+ }, Me = (t) => t.map((e) => Pe(e)), Ie = ({
360
396
  modules: t,
361
397
  settingsResources: e,
362
398
  rootComponent: s
363
399
  }) => {
364
- const r = U(s) ? {
400
+ const r = {
365
401
  index: !0,
366
- loader: () => kt(s.redirectTo)
367
- } : {
368
- index: !0,
369
- Component: s ?? ke
402
+ Component: s ?? De
370
403
  }, n = e.length > 0 ? [
371
404
  {
372
405
  path: "settings",
@@ -382,12 +415,12 @@ const et = (t) => () => /* @__PURE__ */ a(L, { children: t }), At = (t, e, s) =>
382
415
  },
383
416
  {
384
417
  path: "settings",
385
- Component: Re,
418
+ Component: Le,
386
419
  children: e.map((o) => ({
387
420
  path: o.path,
388
421
  Component: o.component,
389
422
  ...o.errorBoundary && {
390
- ErrorBoundary: et(o.errorBoundary)
423
+ ErrorBoundary: st(o.errorBoundary)
391
424
  }
392
425
  }))
393
426
  }
@@ -395,29 +428,29 @@ const et = (t) => () => /* @__PURE__ */ a(L, { children: t }), At = (t, e, s) =>
395
428
  return [
396
429
  r,
397
430
  {
398
- children: Ee(t)
431
+ children: Me(t)
399
432
  },
400
433
  ...n,
401
434
  {
402
435
  path: "*",
403
436
  loader: () => {
404
- throw Dt();
437
+ throw at();
405
438
  },
406
439
  // Component is required to suppress React Router's warning about empty leaf routes,
407
440
  // even though the loader always throws and this component will never render.
408
441
  Component: () => null,
409
- ErrorBoundary: z
442
+ ErrorBoundary: j
410
443
  }
411
444
  ];
412
- }, zt = "appshell-root-nav", Be = (t) => ({
445
+ }, zt = "appshell-root-nav", Ae = (t) => ({
413
446
  loaderID: zt,
414
- loader: async (e) => ({ navItems: Pe(t, e) })
415
- }), _t = () => te(zt)?.navItems, Pe = async (t, e) => {
416
- const s = Bt(t.locale);
447
+ loader: async (e) => ({ navItems: _e(t, e) })
448
+ }), Ft = () => te(zt)?.navItems, _e = async (t, e) => {
449
+ const s = Pt(t.locale);
417
450
  return (await Promise.all(
418
451
  t.modules.map(async (n) => {
419
- if (n.path.startsWith(":") || (await tt(n.accessControl, e)).state !== "visible") return null;
420
- const i = await Ft(
452
+ if (n.path.startsWith(":") || (await K(n.guards, e)).type !== "pass") return null;
453
+ const i = await Ot(
421
454
  n.resources,
422
455
  n.path,
423
456
  e,
@@ -431,38 +464,38 @@ const et = (t) => () => /* @__PURE__ */ a(L, { children: t }), At = (t, e, s) =>
431
464
  icon: n.meta.icon || /* @__PURE__ */ a(ce, {}),
432
465
  items: o
433
466
  }));
434
- }, Ft = async (t, e, s, r) => (await Promise.all(
467
+ }, Ot = async (t, e, s, r) => (await Promise.all(
435
468
  t.map(async (o) => {
436
- if (o.path.startsWith(":") || (await tt(o.accessControl, s)).state !== "visible") return null;
437
- const c = `${e}/${o.path}`, u = r(o.meta.title, o.path), w = o.subResources ? await Ft(
469
+ if (o.path.startsWith(":") || (await K(o.guards, s)).type !== "pass") return null;
470
+ const l = `${e}/${o.path}`, u = r(o.meta.title, o.path), w = o.subResources ? await Ot(
438
471
  o.subResources,
439
- c,
472
+ l,
440
473
  s,
441
474
  r
442
475
  ) : void 0;
443
476
  return {
444
477
  title: u,
445
- url: c,
478
+ url: l,
446
479
  items: w && w.length > 0 ? w : void 0
447
480
  };
448
481
  })
449
- )).filter((o) => o !== null), De = (t) => {
450
- const { configurations: e } = k(), { rootComponent: s, children: r } = t, n = Le({
482
+ )).filter((o) => o !== null), ze = (t) => {
483
+ const { configurations: e } = L(), { rootComponent: s, children: r } = t, n = Ie({
451
484
  modules: e.modules,
452
485
  settingsResources: e.settingsResources,
453
486
  rootComponent: s
454
- }), o = e.errorBoundary, { loaderID: i, loader: c } = Be({
487
+ }), o = e.errorBoundary, { loaderID: i, loader: l } = Ae({
455
488
  modules: e.modules,
456
489
  locale: e.locale
457
490
  }), u = [
458
491
  {
459
492
  id: i,
460
- loader: c,
493
+ loader: l,
461
494
  element: r,
462
495
  children: o ? [
463
496
  {
464
497
  element: /* @__PURE__ */ a(Y, {}),
465
- ErrorBoundary: et(o),
498
+ ErrorBoundary: st(o),
466
499
  children: n
467
500
  }
468
501
  ] : n,
@@ -472,19 +505,19 @@ const et = (t) => () => /* @__PURE__ */ a(L, { children: t }), At = (t, e, s) =>
472
505
  */
473
506
  HydrateFallback: () => null
474
507
  }
475
- ], w = e.basePath ? "/" + e.basePath : void 0, d = t.memory ? ee(u, {
508
+ ], w = e.basePath ? "/" + e.basePath : void 0, c = t.memory ? ee(u, {
476
509
  basename: w,
477
510
  ...t.initialEntries ? { initialEntries: t.initialEntries } : {}
478
511
  }) : ae(u, {
479
512
  basename: w
480
513
  });
481
- return /* @__PURE__ */ a(se, { router: d });
482
- }, Me = {
514
+ return /* @__PURE__ */ a(se, { router: c });
515
+ }, Fe = {
483
516
  resolvedTheme: "light",
484
517
  theme: "system",
485
518
  setTheme: () => null
486
- }, Ot = q(Me);
487
- function Ie({
519
+ }, $t = W(Fe);
520
+ function Oe({
488
521
  children: t,
489
522
  storageKey: e,
490
523
  defaultTheme: s = "system",
@@ -492,47 +525,62 @@ function Ie({
492
525
  }) {
493
526
  const [n, o] = R(
494
527
  () => localStorage.getItem(e) || s
495
- ), i = $(() => n !== "system" ? n : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [n]);
528
+ ), i = k(() => n !== "system" ? n : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [n]);
496
529
  y(() => {
497
530
  const u = window.document.documentElement;
498
531
  u.classList.remove("light", "dark"), u.classList.add(i);
499
532
  }, [i]);
500
- const c = {
533
+ const l = {
501
534
  resolvedTheme: i,
502
535
  theme: n,
503
536
  setTheme: (u) => {
504
537
  localStorage.setItem(e, u), o(u);
505
538
  }
506
539
  };
507
- return /* @__PURE__ */ a(Ot.Provider, { ...r, value: c, children: t });
540
+ return /* @__PURE__ */ a($t.Provider, { ...r, value: l, children: t });
508
541
  }
509
- const Ae = () => {
510
- const t = G(Ot);
542
+ const $e = () => {
543
+ const t = D($t);
511
544
  if (t === void 0)
512
545
  throw new Error("useTheme must be used within a ThemeProvider");
513
546
  return t;
514
- }, rs = (t) => {
547
+ }, us = (t) => {
515
548
  const [e, s] = R(!1);
516
- return y(function() {
549
+ y(function() {
517
550
  s(!0);
518
- }, []), e ? /* @__PURE__ */ a(
519
- Pt.Provider,
520
- {
521
- value: {
522
- title: t.title,
523
- icon: t.icon,
524
- configurations: Te(t)
525
- },
526
- children: /* @__PURE__ */ a(Ie, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(De, { rootComponent: t.rootComponent, children: t.children }) })
527
- }
528
- ) : null;
551
+ }, []);
552
+ const r = t.contextData ?? {};
553
+ Be(r);
554
+ const n = k(
555
+ () => Se({
556
+ modules: t.modules,
557
+ settingsResources: t.settingsResources,
558
+ basePath: t.basePath,
559
+ errorBoundary: t.errorBoundary,
560
+ locale: t.locale
561
+ }),
562
+ [
563
+ t.modules,
564
+ t.settingsResources,
565
+ t.basePath,
566
+ t.errorBoundary,
567
+ t.locale
568
+ ]
569
+ ), o = k(
570
+ () => ({ title: t.title, icon: t.icon, configurations: n }),
571
+ [t.title, t.icon, n]
572
+ ), i = k(
573
+ () => ({ contextData: t.contextData ?? {} }),
574
+ [t.contextData]
575
+ );
576
+ return e ? /* @__PURE__ */ a(tt.Provider, { value: o, children: /* @__PURE__ */ a(et.Provider, { value: i, children: /* @__PURE__ */ a(Oe, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(ze, { rootComponent: t.rootComponent, children: t.children }) }) }) }) : null;
529
577
  };
530
- function ze({
578
+ function We({
531
579
  ...t
532
580
  }) {
533
581
  return /* @__PURE__ */ a(Z.Root, { "data-slot": "collapsible", ...t });
534
582
  }
535
- function wt({
583
+ function mt({
536
584
  ...t
537
585
  }) {
538
586
  return /* @__PURE__ */ a(
@@ -543,7 +591,7 @@ function wt({
543
591
  }
544
592
  );
545
593
  }
546
- function _e({
594
+ function je({
547
595
  ...t
548
596
  }) {
549
597
  return /* @__PURE__ */ a(
@@ -554,37 +602,37 @@ function _e({
554
602
  }
555
603
  );
556
604
  }
557
- const j = 768;
558
- function Fe() {
559
- const [t, e] = g.useState(
605
+ const H = 768;
606
+ function Ke() {
607
+ const [t, e] = p.useState(
560
608
  void 0
561
609
  );
562
- return g.useEffect(() => {
563
- const s = window.matchMedia(`(max-width: ${j - 1}px)`), r = () => {
564
- e(window.innerWidth < j);
610
+ return p.useEffect(() => {
611
+ const s = window.matchMedia(`(max-width: ${H - 1}px)`), r = () => {
612
+ e(window.innerWidth < H);
565
613
  };
566
- return s.addEventListener("change", r), e(window.innerWidth < j), () => s.removeEventListener("change", r);
614
+ return s.addEventListener("change", r), e(window.innerWidth < H), () => s.removeEventListener("change", r);
567
615
  }, []), !!t;
568
616
  }
569
- const K = 768, V = 1199;
570
- function Oe() {
571
- const [t, e] = g.useState(
617
+ const U = 768, Q = 1199;
618
+ function Ve() {
619
+ const [t, e] = p.useState(
572
620
  void 0
573
621
  );
574
- return g.useEffect(() => {
622
+ return p.useEffect(() => {
575
623
  const s = window.matchMedia(
576
- `(min-width: ${K}px) and (max-width: ${V}px)`
624
+ `(min-width: ${U}px) and (max-width: ${Q}px)`
577
625
  ), r = () => {
578
626
  e(
579
- window.innerWidth >= K && window.innerWidth <= V
627
+ window.innerWidth >= U && window.innerWidth <= Q
580
628
  );
581
629
  };
582
630
  return s.addEventListener("change", r), e(
583
- window.innerWidth >= K && window.innerWidth <= V
631
+ window.innerWidth >= U && window.innerWidth <= Q
584
632
  ), () => s.removeEventListener("change", r);
585
633
  }, []), !!t;
586
634
  }
587
- function $e({ className: t, type: e, ...s }) {
635
+ function He({ className: t, type: e, ...s }) {
588
636
  return /* @__PURE__ */ a(
589
637
  "input",
590
638
  {
@@ -600,15 +648,15 @@ function $e({ className: t, type: e, ...s }) {
600
648
  }
601
649
  );
602
650
  }
603
- function ut({ ...t }) {
651
+ function ht({ ...t }) {
604
652
  return /* @__PURE__ */ a(b.Root, { "data-slot": "sheet", ...t });
605
653
  }
606
- function We({
654
+ function Ue({
607
655
  ...t
608
656
  }) {
609
657
  return /* @__PURE__ */ a(b.Portal, { "data-slot": "sheet-portal", ...t });
610
658
  }
611
- function je({
659
+ function Qe({
612
660
  className: t,
613
661
  ...e
614
662
  }) {
@@ -624,15 +672,15 @@ function je({
624
672
  }
625
673
  );
626
674
  }
627
- function mt({
675
+ function ft({
628
676
  className: t,
629
677
  children: e,
630
678
  side: s = "right",
631
679
  ...r
632
680
  }) {
633
- return /* @__PURE__ */ l(We, { children: [
634
- /* @__PURE__ */ a(je, {}),
635
- /* @__PURE__ */ l(
681
+ return /* @__PURE__ */ d(Ue, { children: [
682
+ /* @__PURE__ */ a(Qe, {}),
683
+ /* @__PURE__ */ d(
636
684
  b.Content,
637
685
  {
638
686
  "data-slot": "sheet-content",
@@ -647,8 +695,8 @@ function mt({
647
695
  ...r,
648
696
  children: [
649
697
  e,
650
- /* @__PURE__ */ l(b.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-secondary astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none", children: [
651
- /* @__PURE__ */ a(Lt, { className: "astw:size-4" }),
698
+ /* @__PURE__ */ d(b.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-secondary astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none", children: [
699
+ /* @__PURE__ */ a(Dt, { className: "astw:size-4" }),
652
700
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
653
701
  ] })
654
702
  ]
@@ -656,7 +704,7 @@ function mt({
656
704
  )
657
705
  ] });
658
706
  }
659
- function ht({ className: t, ...e }) {
707
+ function gt({ className: t, ...e }) {
660
708
  return /* @__PURE__ */ a(
661
709
  "div",
662
710
  {
@@ -666,7 +714,7 @@ function ht({ className: t, ...e }) {
666
714
  }
667
715
  );
668
716
  }
669
- function ft({
717
+ function pt({
670
718
  className: t,
671
719
  ...e
672
720
  }) {
@@ -679,7 +727,7 @@ function ft({
679
727
  }
680
728
  );
681
729
  }
682
- function pt({
730
+ function bt({
683
731
  className: t,
684
732
  ...e
685
733
  }) {
@@ -692,7 +740,7 @@ function pt({
692
740
  }
693
741
  );
694
742
  }
695
- function at({
743
+ function rt({
696
744
  delayDuration: t = 0,
697
745
  ...e
698
746
  }) {
@@ -705,23 +753,23 @@ function at({
705
753
  }
706
754
  );
707
755
  }
708
- function st({
756
+ function nt({
709
757
  ...t
710
758
  }) {
711
- return /* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(E.Root, { "data-slot": "tooltip", ...t }) });
759
+ return /* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(E.Root, { "data-slot": "tooltip", ...t }) });
712
760
  }
713
- function rt({
761
+ function ot({
714
762
  ...t
715
763
  }) {
716
764
  return /* @__PURE__ */ a(E.Trigger, { "data-slot": "tooltip-trigger", ...t });
717
765
  }
718
- function nt({
766
+ function it({
719
767
  className: t,
720
768
  sideOffset: e = 0,
721
769
  children: s,
722
770
  ...r
723
771
  }) {
724
- return /* @__PURE__ */ a(E.Portal, { children: /* @__PURE__ */ l(
772
+ return /* @__PURE__ */ a(E.Portal, { children: /* @__PURE__ */ d(
725
773
  E.Content,
726
774
  {
727
775
  "data-slot": "tooltip-content",
@@ -738,14 +786,14 @@ function nt({
738
786
  }
739
787
  ) });
740
788
  }
741
- const $t = "16rem", Ke = "18rem", Ve = "3rem", He = "b", Wt = g.createContext(null);
742
- function _() {
743
- const t = g.useContext(Wt);
789
+ const Wt = "16rem", qe = "18rem", Ge = "3rem", Ye = "b", jt = p.createContext(null);
790
+ function F() {
791
+ const t = p.useContext(jt);
744
792
  if (!t)
745
793
  throw new Error("useSidebar must be used within a SidebarProvider.");
746
794
  return t;
747
795
  }
748
- function Ue({
796
+ function Xe({
749
797
  defaultOpen: t = !0,
750
798
  open: e,
751
799
  onOpenChange: s,
@@ -754,41 +802,41 @@ function Ue({
754
802
  children: o,
755
803
  ...i
756
804
  }) {
757
- const c = Fe(), u = Oe(), [w, d] = g.useState(!1), [h, f] = g.useState(!1), [p, P] = g.useState(t), C = e ?? p, D = g.useCallback(
805
+ const l = Ke(), u = Ve(), [w, c] = p.useState(!1), [h, f] = p.useState(!1), [g, M] = p.useState(t), C = e ?? g, I = p.useCallback(
758
806
  (x) => {
759
807
  const T = typeof x == "function" ? x(C) : x;
760
- s ? s(T) : P(T);
808
+ s ? s(T) : M(T);
761
809
  },
762
810
  [s, C]
763
- ), S = u && !c, F = g.useCallback(() => c ? d((x) => !x) : S ? f((x) => !x) : D((x) => !x), [c, S, D, d]);
764
- g.useEffect(() => {
811
+ ), S = u && !l, O = p.useCallback(() => l ? c((x) => !x) : S ? f((x) => !x) : I((x) => !x), [l, S, I, c]);
812
+ p.useEffect(() => {
765
813
  const x = (T) => {
766
- T.key === He && (T.metaKey || T.ctrlKey) && (T.preventDefault(), F());
814
+ T.key === Ye && (T.metaKey || T.ctrlKey) && (T.preventDefault(), O());
767
815
  };
768
816
  return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
769
- }, [F]);
770
- const it = C ? "expanded" : "collapsed", qt = g.useMemo(
817
+ }, [O]);
818
+ const dt = C ? "expanded" : "collapsed", Gt = p.useMemo(
771
819
  () => ({
772
- state: it,
820
+ state: dt,
773
821
  open: C,
774
- setOpen: D,
775
- isMobile: c,
822
+ setOpen: I,
823
+ isMobile: l,
776
824
  openMobile: w,
777
- setOpenMobile: d,
778
- toggleSidebar: F,
825
+ setOpenMobile: c,
826
+ toggleSidebar: O,
779
827
  isIconMode: S,
780
828
  openIconMode: h,
781
829
  setOpenIconMode: f
782
830
  }),
783
- [it, C, D, c, w, d, F, S, h, f]
831
+ [dt, C, I, l, w, c, O, S, h, f]
784
832
  );
785
- return /* @__PURE__ */ a(Wt.Provider, { value: qt, children: /* @__PURE__ */ a(at, { delayDuration: 0, children: /* @__PURE__ */ a(
833
+ return /* @__PURE__ */ a(jt.Provider, { value: Gt, children: /* @__PURE__ */ a(rt, { delayDuration: 0, children: /* @__PURE__ */ a(
786
834
  "div",
787
835
  {
788
836
  "data-slot": "sidebar-wrapper",
789
837
  style: {
790
- "--sidebar-width": $t,
791
- "--sidebar-width-icon": Ve,
838
+ "--sidebar-width": Wt,
839
+ "--sidebar-width-icon": Ge,
792
840
  ...n
793
841
  },
794
842
  className: m(
@@ -800,7 +848,7 @@ function Ue({
800
848
  }
801
849
  ) }) });
802
850
  }
803
- function Qe({
851
+ function Ze({
804
852
  side: t = "left",
805
853
  variant: e = "sidebar",
806
854
  collapsible: s = "offcanvas",
@@ -808,7 +856,7 @@ function Qe({
808
856
  children: n,
809
857
  ...o
810
858
  }) {
811
- const { isMobile: i, state: c, openMobile: u, setOpenMobile: w, isIconMode: d, openIconMode: h, setOpenIconMode: f } = _();
859
+ const { isMobile: i, state: l, openMobile: u, setOpenMobile: w, isIconMode: c, openIconMode: h, setOpenIconMode: f } = F();
812
860
  return s === "none" ? /* @__PURE__ */ a(
813
861
  "div",
814
862
  {
@@ -820,27 +868,27 @@ function Qe({
820
868
  ...o,
821
869
  children: n
822
870
  }
823
- ) : i ? /* @__PURE__ */ a(ut, { open: u, onOpenChange: w, ...o, children: /* @__PURE__ */ l(
824
- mt,
871
+ ) : i ? /* @__PURE__ */ a(ht, { open: u, onOpenChange: w, ...o, children: /* @__PURE__ */ d(
872
+ ft,
825
873
  {
826
874
  "data-sidebar": "sidebar",
827
875
  "data-slot": "sidebar",
828
876
  "data-mobile": "true",
829
877
  className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
830
878
  style: {
831
- "--sidebar-width": Ke
879
+ "--sidebar-width": qe
832
880
  },
833
881
  side: t,
834
882
  children: [
835
- /* @__PURE__ */ l(ht, { className: "astw:sr-only", children: [
836
- /* @__PURE__ */ a(ft, { children: "Sidebar" }),
837
- /* @__PURE__ */ a(pt, { children: "Displays the mobile sidebar." })
883
+ /* @__PURE__ */ d(gt, { className: "astw:sr-only", children: [
884
+ /* @__PURE__ */ a(pt, { children: "Sidebar" }),
885
+ /* @__PURE__ */ a(bt, { children: "Displays the mobile sidebar." })
838
886
  ] }),
839
887
  /* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
840
888
  ]
841
889
  }
842
- ) }) : d && s === "icon" ? /* @__PURE__ */ l(L, { children: [
843
- /* @__PURE__ */ l(
890
+ ) }) : c && s === "icon" ? /* @__PURE__ */ d(B, { children: [
891
+ /* @__PURE__ */ d(
844
892
  "div",
845
893
  {
846
894
  className: "astw:group astw:peer astw:text-sidebar-foreground astw:hidden astw:md:block",
@@ -884,32 +932,32 @@ function Qe({
884
932
  ]
885
933
  }
886
934
  ),
887
- /* @__PURE__ */ a(ut, { open: h, onOpenChange: f, ...o, children: /* @__PURE__ */ l(
888
- mt,
935
+ /* @__PURE__ */ a(ht, { open: h, onOpenChange: f, ...o, children: /* @__PURE__ */ d(
936
+ ft,
889
937
  {
890
938
  "data-sidebar": "sidebar",
891
939
  "data-slot": "sidebar-overlay",
892
940
  "data-icon-mode": "true",
893
941
  className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
894
942
  style: {
895
- "--sidebar-width": $t
943
+ "--sidebar-width": Wt
896
944
  },
897
945
  side: t,
898
946
  children: [
899
- /* @__PURE__ */ l(ht, { className: "astw:sr-only", children: [
900
- /* @__PURE__ */ a(ft, { children: "Sidebar" }),
901
- /* @__PURE__ */ a(pt, { children: "Displays the sidebar overlay." })
947
+ /* @__PURE__ */ d(gt, { className: "astw:sr-only", children: [
948
+ /* @__PURE__ */ a(pt, { children: "Sidebar" }),
949
+ /* @__PURE__ */ a(bt, { children: "Displays the sidebar overlay." })
902
950
  ] }),
903
951
  /* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
904
952
  ]
905
953
  }
906
954
  ) })
907
- ] }) : /* @__PURE__ */ l(
955
+ ] }) : /* @__PURE__ */ d(
908
956
  "div",
909
957
  {
910
958
  className: "astw:group astw:peer astw:text-sidebar-foreground astw:hidden astw:md:block",
911
- "data-state": c,
912
- "data-collapsible": c === "collapsed" ? s : "",
959
+ "data-state": l,
960
+ "data-collapsible": l === "collapsed" ? s : "",
913
961
  "data-variant": e,
914
962
  "data-side": t,
915
963
  "data-slot": "sidebar",
@@ -954,14 +1002,14 @@ function Qe({
954
1002
  }
955
1003
  );
956
1004
  }
957
- function jt({
1005
+ function Kt({
958
1006
  className: t,
959
1007
  onClick: e,
960
1008
  ...s
961
1009
  }) {
962
- const { toggleSidebar: r } = _();
963
- return /* @__PURE__ */ l(
964
- I,
1010
+ const { toggleSidebar: r } = F();
1011
+ return /* @__PURE__ */ d(
1012
+ _,
965
1013
  {
966
1014
  "data-sidebar": "trigger",
967
1015
  "data-slot": "sidebar-trigger",
@@ -979,7 +1027,7 @@ function jt({
979
1027
  }
980
1028
  );
981
1029
  }
982
- function qe({ className: t, ...e }) {
1030
+ function Je({ className: t, ...e }) {
983
1031
  return /* @__PURE__ */ a(
984
1032
  "main",
985
1033
  {
@@ -994,7 +1042,7 @@ function qe({ className: t, ...e }) {
994
1042
  }
995
1043
  );
996
1044
  }
997
- function Ge({ className: t, ...e }) {
1045
+ function ta({ className: t, ...e }) {
998
1046
  return /* @__PURE__ */ a(
999
1047
  "div",
1000
1048
  {
@@ -1005,7 +1053,7 @@ function Ge({ className: t, ...e }) {
1005
1053
  }
1006
1054
  );
1007
1055
  }
1008
- function Ye({ className: t, ...e }) {
1056
+ function ea({ className: t, ...e }) {
1009
1057
  return /* @__PURE__ */ a(
1010
1058
  "div",
1011
1059
  {
@@ -1016,7 +1064,7 @@ function Ye({ className: t, ...e }) {
1016
1064
  }
1017
1065
  );
1018
1066
  }
1019
- function Kt({ className: t, ...e }) {
1067
+ function Vt({ className: t, ...e }) {
1020
1068
  return /* @__PURE__ */ a(
1021
1069
  "div",
1022
1070
  {
@@ -1027,7 +1075,7 @@ function Kt({ className: t, ...e }) {
1027
1075
  }
1028
1076
  );
1029
1077
  }
1030
- function Vt({ className: t, ...e }) {
1078
+ function Ht({ className: t, ...e }) {
1031
1079
  return /* @__PURE__ */ a(
1032
1080
  "ul",
1033
1081
  {
@@ -1038,7 +1086,7 @@ function Vt({ className: t, ...e }) {
1038
1086
  }
1039
1087
  );
1040
1088
  }
1041
- function Ht({ className: t, ...e }) {
1089
+ function Ut({ className: t, ...e }) {
1042
1090
  return /* @__PURE__ */ a(
1043
1091
  "li",
1044
1092
  {
@@ -1049,7 +1097,7 @@ function Ht({ className: t, ...e }) {
1049
1097
  }
1050
1098
  );
1051
1099
  }
1052
- const Xe = X(
1100
+ const aa = X(
1053
1101
  "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",
1054
1102
  {
1055
1103
  variants: {
@@ -1069,7 +1117,7 @@ const Xe = X(
1069
1117
  }
1070
1118
  }
1071
1119
  );
1072
- function gt({
1120
+ function xt({
1073
1121
  asChild: t = !1,
1074
1122
  isActive: e = !1,
1075
1123
  variant: s = "default",
@@ -1078,23 +1126,23 @@ function gt({
1078
1126
  className: o,
1079
1127
  ...i
1080
1128
  }) {
1081
- const c = t ? A : "button", { isMobile: u, state: w } = _(), d = /* @__PURE__ */ a(
1082
- c,
1129
+ const l = t ? z : "button", { isMobile: u, state: w } = F(), c = /* @__PURE__ */ a(
1130
+ l,
1083
1131
  {
1084
1132
  "data-slot": "sidebar-menu-button",
1085
1133
  "data-sidebar": "menu-button",
1086
1134
  "data-size": r,
1087
1135
  "data-active": e,
1088
- className: m(Xe({ variant: s, size: r }), o),
1136
+ className: m(aa({ variant: s, size: r }), o),
1089
1137
  ...i
1090
1138
  }
1091
1139
  );
1092
1140
  return n ? (typeof n == "string" && (n = {
1093
1141
  children: n
1094
- }), /* @__PURE__ */ l(st, { children: [
1095
- /* @__PURE__ */ a(rt, { asChild: !0, children: d }),
1142
+ }), /* @__PURE__ */ d(nt, { children: [
1143
+ /* @__PURE__ */ a(ot, { asChild: !0, children: c }),
1096
1144
  /* @__PURE__ */ a(
1097
- nt,
1145
+ it,
1098
1146
  {
1099
1147
  side: "right",
1100
1148
  align: "center",
@@ -1102,16 +1150,16 @@ function gt({
1102
1150
  ...n
1103
1151
  }
1104
1152
  )
1105
- ] })) : d;
1153
+ ] })) : c;
1106
1154
  }
1107
- function bt({
1155
+ function vt({
1108
1156
  className: t,
1109
1157
  asChild: e = !1,
1110
1158
  showOnHover: s = !1,
1111
1159
  ...r
1112
1160
  }) {
1113
1161
  return /* @__PURE__ */ a(
1114
- e ? A : "button",
1162
+ e ? z : "button",
1115
1163
  {
1116
1164
  "data-slot": "sidebar-menu-action",
1117
1165
  "data-sidebar": "menu-action",
@@ -1130,7 +1178,7 @@ function bt({
1130
1178
  }
1131
1179
  );
1132
1180
  }
1133
- function Ze({ className: t, ...e }) {
1181
+ function sa({ className: t, ...e }) {
1134
1182
  return /* @__PURE__ */ a(
1135
1183
  "ul",
1136
1184
  {
@@ -1145,7 +1193,7 @@ function Ze({ className: t, ...e }) {
1145
1193
  }
1146
1194
  );
1147
1195
  }
1148
- function Je({
1196
+ function ra({
1149
1197
  className: t,
1150
1198
  ...e
1151
1199
  }) {
@@ -1159,7 +1207,7 @@ function Je({
1159
1207
  }
1160
1208
  );
1161
1209
  }
1162
- function ta({
1210
+ function na({
1163
1211
  asChild: t = !1,
1164
1212
  size: e = "md",
1165
1213
  isActive: s = !1,
@@ -1167,7 +1215,7 @@ function ta({
1167
1215
  ...n
1168
1216
  }) {
1169
1217
  return /* @__PURE__ */ a(
1170
- t ? A : "a",
1218
+ t ? z : "a",
1171
1219
  {
1172
1220
  "data-slot": "sidebar-menu-sub-button",
1173
1221
  "data-sidebar": "menu-sub-button",
@@ -1185,17 +1233,17 @@ function ta({
1185
1233
  }
1186
1234
  );
1187
1235
  }
1188
- function Q({ to: t, children: e, ...s }) {
1236
+ function G({ to: t, children: e, ...s }) {
1189
1237
  try {
1190
1238
  return re(t), /* @__PURE__ */ a(ne, { to: t, ...s, children: e });
1191
1239
  } catch {
1192
1240
  return /* @__PURE__ */ a("a", { href: t, ...s, children: e });
1193
1241
  }
1194
1242
  }
1195
- function xt({ ...t }) {
1243
+ function yt({ ...t }) {
1196
1244
  return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...t });
1197
1245
  }
1198
- function vt({ className: t, ...e }) {
1246
+ function Nt({ className: t, ...e }) {
1199
1247
  return /* @__PURE__ */ a(
1200
1248
  "ol",
1201
1249
  {
@@ -1208,7 +1256,7 @@ function vt({ className: t, ...e }) {
1208
1256
  }
1209
1257
  );
1210
1258
  }
1211
- function yt({ className: t, ...e }) {
1259
+ function Ct({ className: t, ...e }) {
1212
1260
  return /* @__PURE__ */ a(
1213
1261
  "li",
1214
1262
  {
@@ -1218,14 +1266,14 @@ function yt({ className: t, ...e }) {
1218
1266
  }
1219
1267
  );
1220
1268
  }
1221
- function Nt({
1269
+ function St({
1222
1270
  asChild: t,
1223
1271
  className: e,
1224
1272
  children: s,
1225
1273
  ...r
1226
1274
  }) {
1227
1275
  return /* @__PURE__ */ a(
1228
- t ? A : Q,
1276
+ t ? z : G,
1229
1277
  {
1230
1278
  "data-slot": "breadcrumb-link",
1231
1279
  className: m("astw:hover:text-foreground astw:transition-colors", e),
@@ -1234,7 +1282,7 @@ function Nt({
1234
1282
  }
1235
1283
  );
1236
1284
  }
1237
- function ea({
1285
+ function oa({
1238
1286
  children: t,
1239
1287
  className: e,
1240
1288
  ...s
@@ -1247,19 +1295,19 @@ function ea({
1247
1295
  "aria-hidden": "true",
1248
1296
  className: m("astw:[&>svg]:size-3.5", e),
1249
1297
  ...s,
1250
- children: t ?? /* @__PURE__ */ a(H, {})
1298
+ children: t ?? /* @__PURE__ */ a(q, {})
1251
1299
  }
1252
1300
  );
1253
1301
  }
1254
- function aa(t, e) {
1302
+ function ia(t, e) {
1255
1303
  if (!e.trim()) return t;
1256
1304
  const s = e.toLowerCase();
1257
1305
  return t.filter(
1258
1306
  (r) => r.title.toLowerCase().includes(s) || r.path.toLowerCase().includes(s)
1259
1307
  );
1260
1308
  }
1261
- const sa = (t, e) => {
1262
- const s = Bt(e);
1309
+ const la = (t, e) => {
1310
+ const s = Pt(e);
1263
1311
  return t.reduce(
1264
1312
  (r, n) => {
1265
1313
  const o = s(n.meta.title, n.path);
@@ -1267,18 +1315,18 @@ const sa = (t, e) => {
1267
1315
  title: o,
1268
1316
  breadcrumbTitle: n.meta.breadcrumbTitle
1269
1317
  };
1270
- const i = (c, u) => {
1271
- !c || c.length === 0 || c.forEach((w) => {
1272
- const d = `${u}/${w.path}`, h = s(
1318
+ const i = (l, u) => {
1319
+ !l || l.length === 0 || l.forEach((w) => {
1320
+ const c = `${u}/${w.path}`, h = s(
1273
1321
  w.meta.title,
1274
1322
  w.path
1275
1323
  );
1276
- r[d] = {
1324
+ r[c] = {
1277
1325
  title: h,
1278
1326
  breadcrumbTitle: w.meta.breadcrumbTitle
1279
1327
  }, w.subResources && w.subResources.length > 0 && i(
1280
1328
  w.subResources,
1281
- d
1329
+ c
1282
1330
  );
1283
1331
  });
1284
1332
  };
@@ -1287,53 +1335,53 @@ const sa = (t, e) => {
1287
1335
  {}
1288
1336
  );
1289
1337
  };
1290
- function ra(t, e, s, r) {
1291
- const n = t.split("/").filter((u) => u !== ""), o = e && n[0] === e ? n.slice(1) : n, i = sa(s, r), c = o.map((u, w) => {
1292
- const d = o.slice(0, w + 1).join("/");
1293
- let h = i[d];
1338
+ function da(t, e, s, r) {
1339
+ const n = t.split("/").filter((u) => u !== ""), o = e && n[0] === e ? n.slice(1) : n, i = la(s, r), l = o.map((u, w) => {
1340
+ const c = o.slice(0, w + 1).join("/");
1341
+ let h = i[c];
1294
1342
  if (!h) {
1295
- const p = Object.entries(i).find(
1296
- ([P]) => {
1297
- const C = P.split("/").map((S) => S.startsWith(":") ? "[^/]+" : S).join("/");
1298
- return new RegExp(`^${C}$`).test(d);
1343
+ const g = Object.entries(i).find(
1344
+ ([M]) => {
1345
+ const C = M.split("/").map((S) => S.startsWith(":") ? "[^/]+" : S).join("/");
1346
+ return new RegExp(`^${C}$`).test(c);
1299
1347
  }
1300
1348
  )?.[1];
1301
- p && (h = p);
1349
+ g && (h = g);
1302
1350
  }
1303
1351
  let f;
1304
1352
  return h ? typeof h.breadcrumbTitle == "function" ? f = h.breadcrumbTitle(u) : typeof h.breadcrumbTitle == "string" ? f = h.breadcrumbTitle : f = h.title : f = decodeURIComponent(u), {
1305
1353
  segment: u,
1306
- path: d,
1354
+ path: c,
1307
1355
  title: f
1308
1356
  };
1309
1357
  });
1310
1358
  return {
1311
1359
  basePath: e || null,
1312
- segments: c
1360
+ segments: l
1313
1361
  };
1314
1362
  }
1315
- const na = () => {
1316
- const { open: t, isIconMode: e } = _();
1317
- return /* @__PURE__ */ a("div", { className: t && !e ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(jt, { className: "astw:-ml-2.5" }) });
1318
- }, ns = (t) => {
1319
- const e = t.children ? t.children({ Outlet: ct }) : null, s = Ae(), r = () => {
1363
+ const ca = () => {
1364
+ const { open: t, isIconMode: e } = F();
1365
+ return /* @__PURE__ */ a("div", { className: t && !e ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(Kt, { className: "astw:-ml-2.5" }) });
1366
+ }, ms = (t) => {
1367
+ const e = t.children ? t.children({ Outlet: ut }) : null, s = $e(), r = () => {
1320
1368
  s.setTheme(s.theme === "dark" ? "light" : "dark");
1321
1369
  };
1322
- return /* @__PURE__ */ a(Ue, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:flex-1", children: [
1323
- t.sidebar ?? /* @__PURE__ */ a(oa, {}),
1324
- /* @__PURE__ */ l(qe, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
1325
- /* @__PURE__ */ a("header", { className: "astw:flex astw:h-14 astw:shrink-0 astw:items-center astw:gap-2 astw:transition-[width,height] astw:ease-linear astw:group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:w-full astw:items-center astw:justify-between", children: [
1326
- /* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
1327
- /* @__PURE__ */ a(na, {}),
1328
- /* @__PURE__ */ a(wa, {})
1370
+ return /* @__PURE__ */ a(Xe, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:flex-1", children: [
1371
+ t.sidebar ?? /* @__PURE__ */ a(wa, {}),
1372
+ /* @__PURE__ */ d(Je, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
1373
+ /* @__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__ */ d("div", { className: "astw:flex astw:w-full astw:items-center astw:justify-between", children: [
1374
+ /* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
1375
+ /* @__PURE__ */ a(ca, {}),
1376
+ /* @__PURE__ */ a(ga, {})
1329
1377
  ] }),
1330
- /* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(I, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(ue, {}) }) })
1378
+ /* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(_, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(ue, {}) }) })
1331
1379
  ] }) }),
1332
- /* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(ct, {}) })
1380
+ /* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(ut, {}) })
1333
1381
  ] })
1334
1382
  ] }) });
1335
- }, oa = (t) => {
1336
- const { title: e, icon: s } = k(), { pathname: r } = Rt(), { isIconMode: n } = _(), o = /* @__PURE__ */ l(Ge, { children: [
1383
+ }, wa = (t) => {
1384
+ const { title: e, icon: s } = L(), { pathname: r } = Et(), { isIconMode: n } = F(), o = /* @__PURE__ */ d(ta, { children: [
1337
1385
  s,
1338
1386
  /* @__PURE__ */ a(
1339
1387
  "h1",
@@ -1346,23 +1394,23 @@ const na = () => {
1346
1394
  }
1347
1395
  )
1348
1396
  ] });
1349
- return /* @__PURE__ */ l(Qe, { variant: "inset", collapsible: n ? "icon" : "offcanvas", children: [
1350
- !n && /* @__PURE__ */ l("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
1397
+ return /* @__PURE__ */ d(Ze, { variant: "inset", collapsible: n ? "icon" : "offcanvas", children: [
1398
+ !n && /* @__PURE__ */ d("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
1351
1399
  t.header ?? o,
1352
- /* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(jt, { className: "astw:-ml-1" }) })
1400
+ /* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(Kt, { className: "astw:-ml-1" }) })
1353
1401
  ] }),
1354
- /* @__PURE__ */ a(Ye, { children: /* @__PURE__ */ a(Tt, { fallback: /* @__PURE__ */ a(da, {}), children: /* @__PURE__ */ a(ia, { currentPath: r }) }) }),
1402
+ /* @__PURE__ */ a(ea, { children: /* @__PURE__ */ a(Lt, { fallback: /* @__PURE__ */ a(ha, {}), children: /* @__PURE__ */ a(ua, { currentPath: r }) }) }),
1355
1403
  t.footer ?? null
1356
1404
  ] });
1357
- }, ia = ({ currentPath: t }) => {
1358
- const e = _t();
1359
- return /* @__PURE__ */ a(Et, { resolve: e, children: (s) => /* @__PURE__ */ a(la, { items: s ?? [], currentPath: t }) });
1360
- }, la = (t) => {
1361
- const e = B();
1362
- return /* @__PURE__ */ a(Kt, { children: /* @__PURE__ */ a(Vt, { children: t.items.map((s) => /* @__PURE__ */ a(ze, { asChild: !0, defaultOpen: !0, children: /* @__PURE__ */ l(Ht, { children: [
1363
- s.url ? /* @__PURE__ */ l(L, { children: [
1364
- /* @__PURE__ */ a(gt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ l(
1365
- Q,
1405
+ }, ua = ({ currentPath: t }) => {
1406
+ const e = Ft();
1407
+ return /* @__PURE__ */ a(Bt, { resolve: e, children: (s) => /* @__PURE__ */ a(ma, { items: s ?? [], currentPath: t }) });
1408
+ }, ma = (t) => {
1409
+ const e = P();
1410
+ return /* @__PURE__ */ a(Vt, { children: /* @__PURE__ */ a(Ht, { children: t.items.map((s) => /* @__PURE__ */ a(We, { asChild: !0, defaultOpen: !0, children: /* @__PURE__ */ d(Ut, { children: [
1411
+ s.url ? /* @__PURE__ */ d(B, { children: [
1412
+ /* @__PURE__ */ a(xt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d(
1413
+ G,
1366
1414
  {
1367
1415
  to: s.url,
1368
1416
  className: s.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
@@ -1372,29 +1420,29 @@ const na = () => {
1372
1420
  ]
1373
1421
  }
1374
1422
  ) }),
1375
- !!s.items?.length && /* @__PURE__ */ a(wt, { asChild: !0, children: /* @__PURE__ */ l(bt, { className: "astw:data-[state=open]:rotate-90", children: [
1376
- /* @__PURE__ */ a(H, {}),
1423
+ !!s.items?.length && /* @__PURE__ */ a(mt, { asChild: !0, children: /* @__PURE__ */ d(vt, { className: "astw:data-[state=open]:rotate-90", children: [
1424
+ /* @__PURE__ */ a(q, {}),
1377
1425
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
1378
1426
  ] }) })
1379
- ] }) : /* @__PURE__ */ a(L, { children: /* @__PURE__ */ l(wt, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
1380
- /* @__PURE__ */ a(gt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ l("span", { className: "astw:flex astw:w-[100%]", children: [
1427
+ ] }) : /* @__PURE__ */ a(B, { children: /* @__PURE__ */ d(mt, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
1428
+ /* @__PURE__ */ a(xt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d("span", { className: "astw:flex astw:w-[100%]", children: [
1381
1429
  s.icon,
1382
1430
  /* @__PURE__ */ a("span", { children: s.title })
1383
1431
  ] }) }),
1384
1432
  !!s.items?.length && /* @__PURE__ */ a(
1385
- bt,
1433
+ vt,
1386
1434
  {
1387
1435
  className: "astw-rotate-target",
1388
1436
  asChild: !0,
1389
- children: /* @__PURE__ */ l("span", { children: [
1390
- /* @__PURE__ */ a(H, {}),
1437
+ children: /* @__PURE__ */ d("span", { children: [
1438
+ /* @__PURE__ */ a(q, {}),
1391
1439
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
1392
1440
  ] })
1393
1441
  }
1394
1442
  )
1395
1443
  ] }) }),
1396
- !!s.items?.length && /* @__PURE__ */ a(_e, { children: /* @__PURE__ */ a(Ze, { children: s.items?.map((r) => /* @__PURE__ */ a(Je, { children: /* @__PURE__ */ a(ta, { asChild: !0, children: /* @__PURE__ */ a(
1397
- Q,
1444
+ !!s.items?.length && /* @__PURE__ */ a(je, { children: /* @__PURE__ */ a(sa, { children: s.items?.map((r) => /* @__PURE__ */ a(ra, { children: /* @__PURE__ */ a(na, { asChild: !0, children: /* @__PURE__ */ a(
1445
+ G,
1398
1446
  {
1399
1447
  to: r.url,
1400
1448
  className: r.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
@@ -1402,9 +1450,9 @@ const na = () => {
1402
1450
  }
1403
1451
  ) }) }, r.title)) }) })
1404
1452
  ] }) }, s.title)) }) });
1405
- }, da = () => {
1453
+ }, ha = () => {
1406
1454
  const e = [...[112, 96, 80, 104, 88, 100, 92, 84]].sort(() => Math.random() - 0.5);
1407
- return /* @__PURE__ */ a(Kt, { children: /* @__PURE__ */ a(Vt, { className: "astw:px-2", children: e.map((s, r) => /* @__PURE__ */ a(Ht, { children: /* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
1455
+ return /* @__PURE__ */ a(Vt, { children: /* @__PURE__ */ a(Ht, { className: "astw:px-2", children: e.map((s, r) => /* @__PURE__ */ a(Ut, { children: /* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
1408
1456
  /* @__PURE__ */ a("div", { className: "astw:h-4 astw:w-4 astw:rounded-md astw:bg-muted" }),
1409
1457
  /* @__PURE__ */ a(
1410
1458
  "div",
@@ -1414,39 +1462,39 @@ const na = () => {
1414
1462
  }
1415
1463
  )
1416
1464
  ] }) }, r)) }) });
1417
- }, ca = () => {
1418
- const { configurations: t } = k(), e = Rt();
1419
- return ra(
1465
+ }, fa = () => {
1466
+ const { configurations: t } = L(), e = Et();
1467
+ return da(
1420
1468
  e.pathname,
1421
1469
  t.basePath,
1422
1470
  t.modules,
1423
1471
  t.locale
1424
1472
  );
1425
- }, wa = () => {
1426
- const { segments: t } = ca(), e = oe("/:prefix/settings/:suffix"), s = B();
1427
- return e ? /* @__PURE__ */ a(xt, { children: /* @__PURE__ */ a(vt, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(yt, { children: /* @__PURE__ */ a(Nt, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(xt, { children: /* @__PURE__ */ a(vt, { children: t.map((r, n) => /* @__PURE__ */ l(
1473
+ }, ga = () => {
1474
+ const { segments: t } = fa(), e = oe("/:prefix/settings/:suffix"), s = P();
1475
+ return e ? /* @__PURE__ */ a(yt, { children: /* @__PURE__ */ a(Nt, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(Ct, { children: /* @__PURE__ */ a(St, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(yt, { children: /* @__PURE__ */ a(Nt, { children: t.map((r, n) => /* @__PURE__ */ d(
1428
1476
  "div",
1429
1477
  {
1430
1478
  className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground",
1431
1479
  children: [
1432
- /* @__PURE__ */ a(yt, { children: /* @__PURE__ */ a(Nt, { to: r.path, children: r.title }) }),
1433
- n < t.length - 1 && /* @__PURE__ */ a(ea, {})
1480
+ /* @__PURE__ */ a(Ct, { children: /* @__PURE__ */ a(St, { to: r.path, children: r.title }) }),
1481
+ n < t.length - 1 && /* @__PURE__ */ a(oa, {})
1434
1482
  ]
1435
1483
  },
1436
1484
  n
1437
1485
  )) }) });
1438
1486
  };
1439
- function ua({
1487
+ function pa({
1440
1488
  ...t
1441
1489
  }) {
1442
1490
  return /* @__PURE__ */ a(b.Root, { "data-slot": "dialog", ...t });
1443
1491
  }
1444
- function ma({
1492
+ function ba({
1445
1493
  ...t
1446
1494
  }) {
1447
1495
  return /* @__PURE__ */ a(b.Portal, { "data-slot": "dialog-portal", ...t });
1448
1496
  }
1449
- function ha({
1497
+ function xa({
1450
1498
  className: t,
1451
1499
  ...e
1452
1500
  }) {
@@ -1462,14 +1510,14 @@ function ha({
1462
1510
  }
1463
1511
  );
1464
1512
  }
1465
- function fa({
1513
+ function va({
1466
1514
  className: t,
1467
1515
  children: e,
1468
1516
  ...s
1469
1517
  }) {
1470
- return /* @__PURE__ */ l(ma, { "data-slot": "dialog-portal", children: [
1471
- /* @__PURE__ */ a(ha, {}),
1472
- /* @__PURE__ */ l(
1518
+ return /* @__PURE__ */ d(ba, { "data-slot": "dialog-portal", children: [
1519
+ /* @__PURE__ */ a(xa, {}),
1520
+ /* @__PURE__ */ d(
1473
1521
  b.Content,
1474
1522
  {
1475
1523
  "data-slot": "dialog-content",
@@ -1480,8 +1528,8 @@ function fa({
1480
1528
  ...s,
1481
1529
  children: [
1482
1530
  e,
1483
- /* @__PURE__ */ l(b.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-accent astw:data-[state=open]:text-muted-foreground astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none astw:[&_svg]:pointer-events-none astw:[&_svg]:shrink-0 astw:[&_svg:not([class*='size-'])]:size-4", children: [
1484
- /* @__PURE__ */ a(Lt, {}),
1531
+ /* @__PURE__ */ d(b.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-accent astw:data-[state=open]:text-muted-foreground astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none astw:[&_svg]:pointer-events-none astw:[&_svg]:shrink-0 astw:[&_svg:not([class*='size-'])]:size-4", children: [
1532
+ /* @__PURE__ */ a(Dt, {}),
1485
1533
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
1486
1534
  ] })
1487
1535
  ]
@@ -1489,7 +1537,7 @@ function fa({
1489
1537
  )
1490
1538
  ] });
1491
1539
  }
1492
- function pa({
1540
+ function ya({
1493
1541
  className: t,
1494
1542
  ...e
1495
1543
  }) {
@@ -1502,16 +1550,16 @@ function pa({
1502
1550
  }
1503
1551
  );
1504
1552
  }
1505
- function ga(t) {
1553
+ function Na(t) {
1506
1554
  const e = [], s = (r, n, o) => {
1507
1555
  r.forEach((i) => {
1508
- const c = [...o, i.title];
1556
+ const l = [...o, i.title];
1509
1557
  e.push({
1510
1558
  path: i.url,
1511
1559
  title: i.title,
1512
1560
  icon: n,
1513
- breadcrumb: c
1514
- }), i.items && i.items.length > 0 && s(i.items, n, c);
1561
+ breadcrumb: l
1562
+ }), i.items && i.items.length > 0 && s(i.items, n, l);
1515
1563
  });
1516
1564
  };
1517
1565
  return t.forEach((r) => {
@@ -1523,16 +1571,16 @@ function ga(t) {
1523
1571
  }), s(r.items, r.icon, [r.title]);
1524
1572
  }), e;
1525
1573
  }
1526
- function ba({
1574
+ function Ca({
1527
1575
  routes: t
1528
1576
  }) {
1529
- const e = ie(), s = Gt(null), [r, n] = R(!1), [o, i] = R(""), [c, u] = R(0), w = $(
1530
- () => aa(t, o),
1577
+ const e = ie(), s = pe(null), [r, n] = R(!1), [o, i] = R(""), [l, u] = R(0), w = k(
1578
+ () => ia(t, o),
1531
1579
  [t, o]
1532
1580
  );
1533
1581
  y(() => {
1534
- const f = (p) => {
1535
- (p.metaKey || p.ctrlKey) && p.key === "k" && (p.preventDefault(), n((P) => !P));
1582
+ const f = (g) => {
1583
+ (g.metaKey || g.ctrlKey) && g.key === "k" && (g.preventDefault(), n((M) => !M));
1536
1584
  };
1537
1585
  return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
1538
1586
  }, []), y(() => {
@@ -1540,70 +1588,70 @@ function ba({
1540
1588
  }, [w]), y(() => {
1541
1589
  r || (i(""), u(0));
1542
1590
  }, [r]), y(() => {
1543
- s.current && s.current.querySelector(`[data-index="${c}"]`)?.scrollIntoView({ block: "nearest" });
1544
- }, [c]);
1545
- const d = lt(
1591
+ s.current && s.current.querySelector(`[data-index="${l}"]`)?.scrollIntoView({ block: "nearest" });
1592
+ }, [l]);
1593
+ const c = wt(
1546
1594
  (f) => {
1547
1595
  e(f.path), n(!1), i("");
1548
1596
  },
1549
1597
  [e]
1550
- ), h = lt(
1598
+ ), h = wt(
1551
1599
  (f) => {
1552
1600
  if (!f.nativeEvent.isComposing)
1553
1601
  switch (f.key) {
1554
1602
  case "ArrowDown":
1555
1603
  f.preventDefault(), u(
1556
- (p) => p < w.length - 1 ? p + 1 : p
1604
+ (g) => g < w.length - 1 ? g + 1 : g
1557
1605
  );
1558
1606
  break;
1559
1607
  case "ArrowUp":
1560
- f.preventDefault(), u((p) => p > 0 ? p - 1 : p);
1608
+ f.preventDefault(), u((g) => g > 0 ? g - 1 : g);
1561
1609
  break;
1562
1610
  case "Enter":
1563
- f.preventDefault(), w[c] && d(w[c]);
1611
+ f.preventDefault(), w[l] && c(w[l]);
1564
1612
  break;
1565
1613
  }
1566
1614
  },
1567
- [w, c, d]
1615
+ [w, l, c]
1568
1616
  );
1569
1617
  return {
1570
1618
  open: r,
1571
1619
  setOpen: n,
1572
1620
  search: o,
1573
1621
  setSearch: i,
1574
- selectedIndex: c,
1622
+ selectedIndex: l,
1575
1623
  filteredRoutes: w,
1576
- handleSelect: d,
1624
+ handleSelect: c,
1577
1625
  handleKeyDown: h,
1578
1626
  listRef: s
1579
1627
  };
1580
1628
  }
1581
- function xa({
1629
+ function Sa({
1582
1630
  navItems: t
1583
1631
  }) {
1584
- const e = B(), s = $(() => ga(t), [t]), {
1632
+ const e = P(), s = k(() => Na(t), [t]), {
1585
1633
  open: r,
1586
1634
  setOpen: n,
1587
1635
  search: o,
1588
1636
  setSearch: i,
1589
- selectedIndex: c,
1637
+ selectedIndex: l,
1590
1638
  filteredRoutes: u,
1591
1639
  handleSelect: w,
1592
- handleKeyDown: d,
1640
+ handleKeyDown: c,
1593
1641
  listRef: h
1594
- } = ba({ routes: s });
1595
- return /* @__PURE__ */ a(ua, { open: r, onOpenChange: n, children: /* @__PURE__ */ l(
1596
- fa,
1642
+ } = Ca({ routes: s });
1643
+ return /* @__PURE__ */ a(pa, { open: r, onOpenChange: n, children: /* @__PURE__ */ d(
1644
+ va,
1597
1645
  {
1598
1646
  className: "astw:p-0 astw:gap-0 astw:sm:max-w-2xl astw:overflow-hidden",
1599
- onKeyDown: d,
1647
+ onKeyDown: c,
1600
1648
  "aria-describedby": void 0,
1601
1649
  children: [
1602
- /* @__PURE__ */ a(pa, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
1603
- /* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:border-b astw:px-3 astw:py-1", children: [
1650
+ /* @__PURE__ */ a(ya, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
1651
+ /* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:border-b astw:px-3 astw:py-1", children: [
1604
1652
  /* @__PURE__ */ a(me, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
1605
1653
  /* @__PURE__ */ a(
1606
- $e,
1654
+ He,
1607
1655
  {
1608
1656
  value: o,
1609
1657
  onChange: (f) => i(f.target.value),
@@ -1618,18 +1666,18 @@ function xa({
1618
1666
  {
1619
1667
  ref: h,
1620
1668
  className: "astw:max-h-[300px] astw:overflow-y-auto astw:overflow-x-hidden",
1621
- 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, p) => /* @__PURE__ */ l(
1669
+ 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, g) => /* @__PURE__ */ d(
1622
1670
  "button",
1623
1671
  {
1624
- "data-index": p,
1672
+ "data-index": g,
1625
1673
  onClick: () => w(f),
1626
1674
  className: m(
1627
1675
  "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",
1628
- p === c ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
1676
+ g === l ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
1629
1677
  ),
1630
1678
  children: [
1631
1679
  /* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: f.breadcrumb.join(" > ") }),
1632
- /* @__PURE__ */ l("span", { className: "astw:text-[11px] astw:text-muted-foreground astw:truncate astw:w-full astw:text-left", children: [
1680
+ /* @__PURE__ */ d("span", { className: "astw:text-[11px] astw:text-muted-foreground astw:truncate astw:w-full astw:text-left", children: [
1633
1681
  "/",
1634
1682
  f.path
1635
1683
  ] })
@@ -1643,17 +1691,17 @@ function xa({
1643
1691
  }
1644
1692
  ) });
1645
1693
  }
1646
- function os() {
1647
- const t = _t();
1648
- return /* @__PURE__ */ a(Tt, { fallback: null, children: /* @__PURE__ */ a(Et, { resolve: t, children: (e) => /* @__PURE__ */ a(xa, { navItems: e ?? [] }) }) });
1694
+ function hs() {
1695
+ const t = Ft();
1696
+ return /* @__PURE__ */ a(Lt, { fallback: null, children: /* @__PURE__ */ a(Bt, { resolve: t, children: (e) => /* @__PURE__ */ a(Sa, { navItems: e ?? [] }) }) });
1649
1697
  }
1650
- const Ut = q(null), is = (t) => {
1651
- const e = $(
1652
- () => xe({
1698
+ const Qt = W(null), fs = (t) => {
1699
+ const e = k(
1700
+ () => ye({
1653
1701
  clientId: t.clientId,
1654
1702
  appUri: t.apiEndpoint,
1655
1703
  redirectUri: t.redirectUri,
1656
- meQuery: t.meQuery && (typeof t.meQuery == "string" ? t.meQuery : be(t.meQuery))
1704
+ meQuery: t.meQuery && (typeof t.meQuery == "string" ? t.meQuery : ve(t.meQuery))
1657
1705
  }),
1658
1706
  [t.clientId, t.apiEndpoint, t.redirectUri, t.meQuery]
1659
1707
  ), [s, r] = R(
@@ -1669,7 +1717,7 @@ const Ut = q(null), is = (t) => {
1669
1717
  );
1670
1718
  const n = t.guardComponent && (s.isLoading || !s.isAuthenticated) ? /* @__PURE__ */ a(t.guardComponent, {}) : t.children;
1671
1719
  return /* @__PURE__ */ a(
1672
- Ut.Provider,
1720
+ Qt.Provider,
1673
1721
  {
1674
1722
  value: {
1675
1723
  authState: s,
@@ -1681,12 +1729,12 @@ const Ut = q(null), is = (t) => {
1681
1729
  children: n
1682
1730
  }
1683
1731
  );
1684
- }, ls = () => {
1685
- const t = G(Ut);
1732
+ }, gs = () => {
1733
+ const t = D(Qt);
1686
1734
  if (!t)
1687
1735
  throw new Error("useAuth must be used within an AuthProvider");
1688
1736
  return t;
1689
- }, va = X(
1737
+ }, ps = () => xe, Ta = X(
1690
1738
  "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",
1691
1739
  {
1692
1740
  variants: {
@@ -1708,38 +1756,38 @@ const Ut = q(null), is = (t) => {
1708
1756
  variant: "default"
1709
1757
  }
1710
1758
  }
1711
- ), ya = {
1759
+ ), ka = {
1712
1760
  "outline-success": "astw:bg-green-500",
1713
1761
  "outline-warning": "astw:bg-orange-500",
1714
1762
  "outline-error": "astw:bg-red-500",
1715
1763
  "outline-info": "astw:bg-blue-500",
1716
1764
  "outline-neutral": "astw:bg-neutral-400"
1717
1765
  };
1718
- function Na({ variant: t }) {
1719
- const e = ya[t];
1766
+ function Ra({ variant: t }) {
1767
+ const e = ka[t];
1720
1768
  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;
1721
1769
  }
1722
- function Ca({ className: t, variant: e, children: s, ...r }) {
1770
+ function Ea({ className: t, variant: e, children: s, ...r }) {
1723
1771
  const n = e?.toString().startsWith("outline-");
1724
- return /* @__PURE__ */ l(
1772
+ return /* @__PURE__ */ d(
1725
1773
  "div",
1726
1774
  {
1727
- className: m(va({ variant: e }), t),
1775
+ className: m(Ta({ variant: e }), t),
1728
1776
  ...r,
1729
1777
  children: [
1730
- n && /* @__PURE__ */ a(Na, { variant: e }),
1778
+ n && /* @__PURE__ */ a(Ra, { variant: e }),
1731
1779
  s
1732
1780
  ]
1733
1781
  }
1734
1782
  );
1735
1783
  }
1736
- function Sa(t) {
1784
+ function Ba(t) {
1737
1785
  return t.type === "divider";
1738
1786
  }
1739
- function Ta(t) {
1787
+ function Da(t) {
1740
1788
  return t.type !== "divider" && "key" in t;
1741
1789
  }
1742
- function W(t, e) {
1790
+ function V(t, e) {
1743
1791
  return e.split(".").reduce((s, r) => {
1744
1792
  if (s && typeof s == "object" && r in s)
1745
1793
  return s[r];
@@ -1748,10 +1796,10 @@ function W(t, e) {
1748
1796
  function v(t) {
1749
1797
  return t == null || t === "";
1750
1798
  }
1751
- function ka(t) {
1799
+ function La(t) {
1752
1800
  return t.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase());
1753
1801
  }
1754
- function Ra(t, e = "medium") {
1802
+ function Pa(t, e = "medium") {
1755
1803
  if (v(t)) return "";
1756
1804
  const s = t instanceof Date ? t : new Date(String(t));
1757
1805
  if (isNaN(s.getTime())) return String(t);
@@ -1783,7 +1831,7 @@ function Ra(t, e = "medium") {
1783
1831
  return s.toLocaleDateString();
1784
1832
  }
1785
1833
  }
1786
- function Ea(t, e) {
1834
+ function Ma(t, e) {
1787
1835
  if (v(t)) return "";
1788
1836
  const s = typeof t == "number" ? t : parseFloat(String(t));
1789
1837
  if (isNaN(s)) return String(t);
@@ -1796,7 +1844,7 @@ function Ea(t, e) {
1796
1844
  return `${e || "$"}${s.toFixed(2)}`;
1797
1845
  }
1798
1846
  }
1799
- function La(t) {
1847
+ function Ia(t) {
1800
1848
  if (v(t)) return [];
1801
1849
  if (typeof t == "string")
1802
1850
  return t.split(/[,\n]/).map((e) => e.trim()).filter(Boolean);
@@ -1812,10 +1860,10 @@ function La(t) {
1812
1860
  }
1813
1861
  return [String(t)];
1814
1862
  }
1815
- function Qt({ value: t }) {
1816
- const [e, s] = g.useState(!1);
1817
- return /* @__PURE__ */ l(st, { children: [
1818
- /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ a(
1863
+ function qt({ value: t }) {
1864
+ const [e, s] = p.useState(!1);
1865
+ return /* @__PURE__ */ d(nt, { children: [
1866
+ /* @__PURE__ */ a(ot, { asChild: !0, children: /* @__PURE__ */ a(
1819
1867
  "button",
1820
1868
  {
1821
1869
  onClick: async (n) => {
@@ -1826,16 +1874,16 @@ function Qt({ value: t }) {
1826
1874
  }
1827
1875
  },
1828
1876
  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",
1829
- children: e ? /* @__PURE__ */ a(fe, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(pe, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 })
1877
+ children: e ? /* @__PURE__ */ a(fe, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(ge, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 })
1830
1878
  }
1831
1879
  ) }),
1832
- /* @__PURE__ */ a(nt, { side: "top", children: e ? "Copied!" : "Copy" })
1880
+ /* @__PURE__ */ a(it, { side: "top", children: e ? "Copied!" : "Copy" })
1833
1881
  ] });
1834
1882
  }
1835
1883
  const N = "–";
1836
- function Ba({ field: t }) {
1837
- const e = v(t.value) ? N : String(t.value), s = t.meta?.copyable && !v(t.value), r = t.meta?.truncateLines, n = g.useRef(null), [o, i] = g.useState(!1);
1838
- g.useEffect(() => {
1884
+ function Aa({ field: t }) {
1885
+ const e = v(t.value) ? N : String(t.value), s = t.meta?.copyable && !v(t.value), r = t.meta?.truncateLines, n = p.useRef(null), [o, i] = p.useState(!1);
1886
+ p.useEffect(() => {
1839
1887
  if (!r) {
1840
1888
  i(!1);
1841
1889
  return;
@@ -1845,56 +1893,56 @@ function Ba({ field: t }) {
1845
1893
  const h = n.current;
1846
1894
  i(h.scrollHeight > h.clientHeight + 1);
1847
1895
  }
1848
- }, d = setTimeout(w, 50);
1896
+ }, c = setTimeout(w, 50);
1849
1897
  return window.addEventListener("resize", w), () => {
1850
- clearTimeout(d), window.removeEventListener("resize", w);
1898
+ clearTimeout(c), window.removeEventListener("resize", w);
1851
1899
  };
1852
1900
  }, [e, r]);
1853
- const c = r && r > 0 ? {
1901
+ const l = r && r > 0 ? {
1854
1902
  display: "-webkit-box",
1855
1903
  WebkitLineClamp: r,
1856
1904
  WebkitBoxOrient: "vertical",
1857
1905
  overflow: "hidden"
1858
- } : void 0, u = /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
1906
+ } : void 0, u = /* @__PURE__ */ d("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
1859
1907
  /* @__PURE__ */ a(
1860
1908
  "p",
1861
1909
  {
1862
1910
  ref: n,
1863
1911
  className: "astw:text-sm astw:font-medium astw:text-foreground astw:break-words astw:m-0",
1864
- style: c,
1912
+ style: l,
1865
1913
  children: e
1866
1914
  }
1867
1915
  ),
1868
- s && /* @__PURE__ */ a(Qt, { value: String(t.value) })
1916
+ s && /* @__PURE__ */ a(qt, { value: String(t.value) })
1869
1917
  ] });
1870
- return r && o ? /* @__PURE__ */ l(st, { children: [
1871
- /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ a("span", { className: "astw:cursor-default", children: u }) }),
1872
- /* @__PURE__ */ a(nt, { side: "bottom", style: { maxWidth: 320 }, children: /* @__PURE__ */ a("p", { className: "astw:text-sm", children: e }) })
1918
+ return r && o ? /* @__PURE__ */ d(nt, { children: [
1919
+ /* @__PURE__ */ a(ot, { asChild: !0, children: /* @__PURE__ */ a("span", { className: "astw:cursor-default", children: u }) }),
1920
+ /* @__PURE__ */ a(it, { side: "bottom", style: { maxWidth: 320 }, children: /* @__PURE__ */ a("p", { className: "astw:text-sm", children: e }) })
1873
1921
  ] }) : u;
1874
1922
  }
1875
- function Pa({ field: t }) {
1923
+ function _a({ field: t }) {
1876
1924
  if (v(t.value))
1877
1925
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1878
1926
  const e = String(t.value), s = t.meta?.badgeVariantMap || {}, r = e.toLowerCase(), n = s[e] || s[r] || "outline-neutral";
1879
- return /* @__PURE__ */ a(Ca, { variant: n, className: "astw:w-fit", children: ka(e) });
1927
+ return /* @__PURE__ */ a(Ea, { variant: n, className: "astw:w-fit", children: La(e) });
1880
1928
  }
1881
- function Da({ field: t }) {
1929
+ function za({ field: t }) {
1882
1930
  if (v(t.value))
1883
1931
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1884
- const e = t.meta?.currencyKey || "currency", s = W(t.data, e), r = Ea(t.value, s);
1932
+ const e = t.meta?.currencyKey || "currency", s = V(t.data, e), r = Ma(t.value, s);
1885
1933
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:tabular-nums", children: r });
1886
1934
  }
1887
- function Ma({ field: t }) {
1935
+ function Fa({ field: t }) {
1888
1936
  if (v(t.value))
1889
1937
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1890
- const e = t.meta?.dateFormat || "medium", s = Ra(t.value, e);
1938
+ const e = t.meta?.dateFormat || "medium", s = Pa(t.value, e);
1891
1939
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: s });
1892
1940
  }
1893
- function Ia({ field: t }) {
1941
+ function Oa({ field: t }) {
1894
1942
  if (v(t.value))
1895
1943
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1896
- const e = t.meta?.hrefKey, s = e ? W(t.data, e) : void 0, r = t.meta?.external ?? !1, n = String(t.value);
1897
- return s ? /* @__PURE__ */ l(
1944
+ const e = t.meta?.hrefKey, s = e ? V(t.data, e) : void 0, r = t.meta?.external ?? !1, n = String(t.value);
1945
+ return s ? /* @__PURE__ */ d(
1898
1946
  "a",
1899
1947
  {
1900
1948
  href: s,
@@ -1908,58 +1956,58 @@ function Ia({ field: t }) {
1908
1956
  }
1909
1957
  ) : /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
1910
1958
  }
1911
- function Aa({ field: t }) {
1959
+ function $a({ field: t }) {
1912
1960
  if (v(t.value))
1913
1961
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1914
- const e = La(t.value), s = t.meta?.copyable && !v(t.value), r = e.join(`
1962
+ const e = Ia(t.value), s = t.meta?.copyable && !v(t.value), r = e.join(`
1915
1963
  `);
1916
- return /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
1917
- /* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((n, o) => /* @__PURE__ */ l(g.Fragment, { children: [
1964
+ return /* @__PURE__ */ d("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
1965
+ /* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((n, o) => /* @__PURE__ */ d(p.Fragment, { children: [
1918
1966
  n,
1919
1967
  o < e.length - 1 && /* @__PURE__ */ a("br", {})
1920
1968
  ] }, o)) }),
1921
- s && /* @__PURE__ */ a(Qt, { value: r })
1969
+ s && /* @__PURE__ */ a(qt, { value: r })
1922
1970
  ] });
1923
1971
  }
1924
- function za({ field: t }) {
1972
+ function Wa({ field: t }) {
1925
1973
  if (v(t.value))
1926
1974
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1927
- const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, r = e ? W(t.data, e) : void 0, n = String(t.value);
1975
+ const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, r = e ? V(t.data, e) : void 0, n = String(t.value);
1928
1976
  if (!r || !s)
1929
1977
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
1930
1978
  const o = s.replace("{id}", r);
1931
1979
  return /* @__PURE__ */ a("a", { href: o, className: "astw:text-sm astw:text-primary astw:hover:underline", children: n });
1932
1980
  }
1933
- function Ct(t) {
1981
+ function Tt(t) {
1934
1982
  switch (t.type) {
1935
1983
  case "text":
1936
- return /* @__PURE__ */ a(Ba, { field: t });
1984
+ return /* @__PURE__ */ a(Aa, { field: t });
1937
1985
  case "badge":
1938
- return /* @__PURE__ */ a(Pa, { field: t });
1986
+ return /* @__PURE__ */ a(_a, { field: t });
1939
1987
  case "money":
1940
- return /* @__PURE__ */ a(Da, { field: t });
1988
+ return /* @__PURE__ */ a(za, { field: t });
1941
1989
  case "date":
1942
- return /* @__PURE__ */ a(Ma, { field: t });
1990
+ return /* @__PURE__ */ a(Fa, { field: t });
1943
1991
  case "link":
1944
- return /* @__PURE__ */ a(Ia, { field: t });
1992
+ return /* @__PURE__ */ a(Oa, { field: t });
1945
1993
  case "address":
1946
- return /* @__PURE__ */ a(Aa, { field: t });
1994
+ return /* @__PURE__ */ a($a, { field: t });
1947
1995
  case "reference":
1948
- return /* @__PURE__ */ a(za, { field: t });
1996
+ return /* @__PURE__ */ a(Wa, { field: t });
1949
1997
  default:
1950
1998
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1951
1999
  }
1952
2000
  }
1953
- function _a(t) {
2001
+ function ja(t) {
1954
2002
  if (t.emptyBehavior !== "hide") return !1;
1955
2003
  const e = t.value;
1956
2004
  return e == null || e === "";
1957
2005
  }
1958
- function Fa(t) {
2006
+ function Ka(t) {
1959
2007
  return !1;
1960
2008
  }
1961
- function Oa(t, e, s) {
1962
- const r = W(e, t.key);
2009
+ function Va(t, e, s) {
2010
+ const r = V(e, t.key);
1963
2011
  return {
1964
2012
  id: `${t.key}-${s}`,
1965
2013
  label: t.label,
@@ -1970,20 +2018,20 @@ function Oa(t, e, s) {
1970
2018
  data: e
1971
2019
  };
1972
2020
  }
1973
- function $a(t, e) {
2021
+ function Ha(t, e) {
1974
2022
  const s = [];
1975
2023
  let r = [], n = 0, o = 0;
1976
2024
  for (const i of t)
1977
- if (Sa(i))
2025
+ if (Ba(i))
1978
2026
  r.length > 0 && (s.push({ id: `section-${n}`, fields: r }), n++, r = []);
1979
- else if (Ta(i)) {
1980
- const c = Oa(i, e, o);
1981
- o++, _a(c) || r.push(c);
2027
+ else if (Da(i)) {
2028
+ const l = Va(i, e, o);
2029
+ o++, ja(l) || r.push(l);
1982
2030
  }
1983
2031
  return r.length > 0 && s.push({ id: `section-${n}`, fields: r }), s;
1984
2032
  }
1985
- function St({ label: t, children: e, fullWidth: s }) {
1986
- return /* @__PURE__ */ l(
2033
+ function kt({ label: t, children: e, fullWidth: s }) {
2034
+ return /* @__PURE__ */ d(
1987
2035
  "div",
1988
2036
  {
1989
2037
  className: m(
@@ -1997,7 +2045,7 @@ function St({ label: t, children: e, fullWidth: s }) {
1997
2045
  }
1998
2046
  );
1999
2047
  }
2000
- function ds({
2048
+ function bs({
2001
2049
  data: t,
2002
2050
  title: e,
2003
2051
  fields: s,
@@ -2005,7 +2053,7 @@ function ds({
2005
2053
  className: n,
2006
2054
  headerAction: o
2007
2055
  }) {
2008
- const i = $a(s, t), c = i.some((d) => d.fields.length > 0), u = m(
2056
+ const i = Ha(s, t), l = i.some((c) => c.fields.length > 0), u = m(
2009
2057
  "astw:grid astw:gap-x-6 astw:gap-y-4",
2010
2058
  // Default: 1 column
2011
2059
  "astw:grid-cols-1",
@@ -2017,14 +2065,14 @@ function ds({
2017
2065
  // 3-column mode: 1 → 2 → 3 columns
2018
2066
  "astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3"
2019
2067
  )
2020
- ), w = (d) => {
2021
- const h = d.fields.filter((p) => !0), f = d.fields.filter((p) => Fa());
2022
- return /* @__PURE__ */ l("div", { className: "astw:space-y-4", children: [
2023
- h.length > 0 && /* @__PURE__ */ a("div", { className: u, children: h.map((p) => /* @__PURE__ */ a(St, { label: p.label, children: Ct(p) }, p.id)) }),
2024
- f.length > 0 && /* @__PURE__ */ a("div", { className: u, children: f.map((p) => /* @__PURE__ */ a(St, { label: p.label, fullWidth: !0, children: Ct(p) }, p.id)) })
2025
- ] }, d.id);
2068
+ ), w = (c) => {
2069
+ const h = c.fields.filter((g) => !0), f = c.fields.filter((g) => Ka());
2070
+ return /* @__PURE__ */ d("div", { className: "astw:space-y-4", children: [
2071
+ h.length > 0 && /* @__PURE__ */ a("div", { className: u, children: h.map((g) => /* @__PURE__ */ a(kt, { label: g.label, children: Tt(g) }, g.id)) }),
2072
+ f.length > 0 && /* @__PURE__ */ a("div", { className: u, children: f.map((g) => /* @__PURE__ */ a(kt, { label: g.label, fullWidth: !0, children: Tt(g) }, g.id)) })
2073
+ ] }, c.id);
2026
2074
  };
2027
- return /* @__PURE__ */ a(at, { delayDuration: 300, children: /* @__PURE__ */ l(
2075
+ return /* @__PURE__ */ a(rt, { delayDuration: 300, children: /* @__PURE__ */ d(
2028
2076
  "div",
2029
2077
  {
2030
2078
  className: m(
@@ -2032,19 +2080,19 @@ function ds({
2032
2080
  n
2033
2081
  ),
2034
2082
  children: [
2035
- /* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:justify-between astw:px-6 astw:py-6", children: [
2083
+ /* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:justify-between astw:px-6 astw:py-6", children: [
2036
2084
  /* @__PURE__ */ a("h3", { className: "astw:text-lg astw:font-semibold astw:leading-none", children: e }),
2037
2085
  o && /* @__PURE__ */ a("div", { children: o })
2038
2086
  ] }),
2039
- /* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: c ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((d, h) => /* @__PURE__ */ l(g.Fragment, { children: [
2087
+ /* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: l ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((c, h) => /* @__PURE__ */ d(p.Fragment, { children: [
2040
2088
  h > 0 && /* @__PURE__ */ a("div", { className: "astw:h-px astw:bg-border", role: "separator" }),
2041
- w(d)
2042
- ] }, d.id)) }) : /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: "No information available" }) })
2089
+ w(c)
2090
+ ] }, c.id)) }) : /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: "No information available" }) })
2043
2091
  ]
2044
2092
  }
2045
2093
  ) });
2046
2094
  }
2047
- const ot = g.forwardRef(
2095
+ const lt = p.forwardRef(
2048
2096
  ({ className: t, children: e, ...s }, r) => /* @__PURE__ */ a(
2049
2097
  "div",
2050
2098
  {
@@ -2055,8 +2103,8 @@ const ot = g.forwardRef(
2055
2103
  }
2056
2104
  )
2057
2105
  );
2058
- ot.displayName = "Layout.Column";
2059
- function Wa({
2106
+ lt.displayName = "Layout.Column";
2107
+ function Ua({
2060
2108
  columns: t,
2061
2109
  className: e,
2062
2110
  gap: s = 4,
@@ -2065,13 +2113,13 @@ function Wa({
2065
2113
  children: o
2066
2114
  }) {
2067
2115
  if (process.env.NODE_ENV !== "production") {
2068
- const h = g.Children.toArray(o).reduce((f, p) => g.isValidElement(p) && p.type === ot ? f + 1 : f, 0);
2116
+ const h = p.Children.toArray(o).reduce((f, g) => p.isValidElement(g) && g.type === lt ? f + 1 : f, 0);
2069
2117
  if (h !== t)
2070
2118
  throw new Error(
2071
2119
  `Layout: Expected exactly ${t} Layout.Column child${t === 1 ? "" : "ren"}, but found ${h}. Please ensure the number of <Layout.Column> children matches the \`columns={${t}}\` prop.`
2072
2120
  );
2073
2121
  }
2074
- const c = m(
2122
+ const l = m(
2075
2123
  "astw:flex astw:w-full",
2076
2124
  s === 4 ? "astw:gap-4" : s === 6 ? "astw:gap-6" : s === 8 ? "astw:gap-8" : "astw:gap-4",
2077
2125
  // 1 column: Always stack vertically
@@ -2089,56 +2137,61 @@ function Wa({
2089
2137
  "astw:xl:flex-row"
2090
2138
  ],
2091
2139
  e
2092
- ), u = g.useMemo(() => t === 1 ? g.Children.map(o, (d) => d) : t === 2 ? g.Children.map(o, (d, h) => g.isValidElement(d) ? g.cloneElement(d, {
2140
+ ), u = p.useMemo(() => t === 1 ? p.Children.map(o, (c) => c) : t === 2 ? p.Children.map(o, (c, h) => p.isValidElement(c) ? p.cloneElement(c, {
2093
2141
  className: m(
2094
- d.props.className,
2142
+ c.props.className,
2095
2143
  h === 0 ? "astw:lg:flex-1" : "astw:lg:min-w-[280px]"
2096
2144
  // Second column: fixed 280px
2097
2145
  )
2098
- }) : d) : t === 3 ? g.Children.map(o, (d, h) => g.isValidElement(d) ? g.cloneElement(d, {
2146
+ }) : c) : t === 3 ? p.Children.map(o, (c, h) => p.isValidElement(c) ? p.cloneElement(c, {
2099
2147
  className: m(
2100
- d.props.className,
2148
+ c.props.className,
2101
2149
  h === 0 ? "astw:xl:min-w-[320px]" : h === 2 ? "astw:xl:min-w-[280px]" : "astw:xl:flex-1"
2102
2150
  // Middle column: flexible
2103
2151
  )
2104
- }) : d) : o, [o, t]), w = r || n && n.length > 0;
2105
- return /* @__PURE__ */ l("div", { className: "astw:flex astw:flex-col", children: [
2106
- w && /* @__PURE__ */ l(
2152
+ }) : c) : o, [o, t]), w = r || n && n.length > 0;
2153
+ return /* @__PURE__ */ d("div", { className: "astw:flex astw:flex-col", children: [
2154
+ w && /* @__PURE__ */ d(
2107
2155
  "header",
2108
2156
  {
2109
2157
  className: "astw:w-full astw:flex astw:justify-between astw:items-center",
2110
2158
  style: { padding: "1.5rem", paddingBottom: "1rem" },
2111
2159
  children: [
2112
2160
  r && /* @__PURE__ */ a("h1", { style: { fontSize: "1.5rem", fontWeight: "bold" }, children: r }),
2113
- n && n.length > 0 && /* @__PURE__ */ a("div", { className: "astw:flex astw:gap-2 astw:items-center", children: n.map((d, h) => /* @__PURE__ */ a(g.Fragment, { children: d }, h)) })
2161
+ n && n.length > 0 && /* @__PURE__ */ a("div", { className: "astw:flex astw:gap-2 astw:items-center", children: n.map((c, h) => /* @__PURE__ */ a(p.Fragment, { children: c }, h)) })
2114
2162
  ]
2115
2163
  }
2116
2164
  ),
2117
- /* @__PURE__ */ a("div", { style: { padding: w ? "0 1.5rem 1.5rem 1.5rem" : "1.5rem" }, children: /* @__PURE__ */ a("div", { className: c, children: u }) })
2165
+ /* @__PURE__ */ a("div", { style: { padding: w ? "0 1.5rem 1.5rem 1.5rem" : "1.5rem" }, children: /* @__PURE__ */ a("div", { className: l, children: u }) })
2118
2166
  ] });
2119
2167
  }
2120
- Wa.Column = ot;
2168
+ Ua.Column = lt;
2121
2169
  export {
2122
- rs as AppShell,
2123
- is as AuthProvider,
2124
- Ca as Badge,
2125
- os as CommandPalette,
2126
- oa as DefaultSidebar,
2127
- ds as DescriptionCard,
2128
- Wa as Layout,
2129
- us as Link,
2130
- ns as SidebarLayout,
2131
- va as badgeVariants,
2132
- Ce as defineI18nLabels,
2133
- as as defineModule,
2134
- ss as defineResource,
2135
- es as redirectToResource,
2136
- k as useAppShell,
2137
- ls as useAuth,
2138
- ms as useLocation,
2139
- hs as useNavigate,
2140
- fs as useParams,
2141
- ps as useRouteError,
2142
- gs as useSearchParams,
2143
- Ae as useTheme
2170
+ us as AppShell,
2171
+ fs as AuthProvider,
2172
+ Ea as Badge,
2173
+ hs as CommandPalette,
2174
+ wa as DefaultSidebar,
2175
+ bs as DescriptionCard,
2176
+ Ua as Layout,
2177
+ ys as Link,
2178
+ ms as SidebarLayout,
2179
+ Ta as badgeVariants,
2180
+ Re as defineI18nLabels,
2181
+ cs as defineModule,
2182
+ ws as defineResource,
2183
+ ls as hidden,
2184
+ is as pass,
2185
+ ds as redirectTo,
2186
+ Te as useAppShell,
2187
+ L as useAppShellConfig,
2188
+ os as useAppShellData,
2189
+ gs as useAuth,
2190
+ Ns as useLocation,
2191
+ Cs as useNavigate,
2192
+ Ss as useParams,
2193
+ Ts as useRouteError,
2194
+ ks as useSearchParams,
2195
+ $e as useTheme,
2196
+ ps as useToast
2144
2197
  };