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