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