@tailor-platform/app-shell 0.24.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app-shell.js CHANGED
@@ -1,25 +1,25 @@
1
1
  import { jsx as a, jsxs as d, Fragment as B } from "react/jsx-runtime";
2
2
  import { capitalCase as A } from "change-case";
3
- import { useRouteError as Yt, isRouteErrorResponse as Xt, redirect as kt, Outlet as G, NavLink as Zt, Navigate as Jt, useRouteLoaderData as te, createMemoryRouter as ee, createBrowserRouter as ae, RouterProvider as se, useHref as re, Link as ne, useLocation as Rt, Await as Et, useMatch as oe, useNavigate as ie } from "react-router";
4
- import { Link as xs, useLocation as vs, useNavigate as ys, useParams as Ns, useRouteError as Cs, useSearchParams as Ss } from "react-router";
3
+ import { useRouteError as Yt, isRouteErrorResponse as Xt, redirect as Rt, Outlet as Y, NavLink as Zt, Navigate as Jt, useRouteLoaderData as te, createMemoryRouter as ee, createBrowserRouter as ae, RouterProvider as se, useHref as re, Link as ne, useLocation as Et, Await as Bt, useMatch as oe, useNavigate as ie } from "react-router";
4
+ import { Link as ys, useLocation as Ns, useNavigate as Cs, useParams as Ss, useRouteError as Ts, useSearchParams as ks } from "react-router";
5
5
  import { Slot as z } from "@radix-ui/react-slot";
6
- import { cva as Y } from "class-variance-authority";
6
+ import { cva as X } from "class-variance-authority";
7
7
  import { clsx as le } from "clsx";
8
8
  import { twMerge as de } from "tailwind-merge";
9
- import { AlertCircle as dt, Table as ce, XIcon as Bt, PanelLeftIcon as we, ChevronRight as Q, SunIcon as ue, SearchIcon as me, ExternalLink as he, Check as fe, Copy as ge } from "lucide-react";
9
+ import { AlertCircle as ct, Table as ce, XIcon as Dt, PanelLeftIcon as we, ChevronRight as q, SunIcon as ue, SearchIcon as me, ExternalLink as he, Check as fe, Copy as ge } from "lucide-react";
10
10
  import * as p from "react";
11
- import { createContext as W, useContext as D, useState as R, useMemo as k, useEffect as y, Suspense as Dt, useRef as pe, useCallback as ct } from "react";
12
- import { Toaster as be } from "sonner";
13
- import * as X from "@radix-ui/react-collapsible";
11
+ import { createContext as W, useContext as D, useState as R, useMemo as k, useEffect as y, Suspense as Lt, useRef as pe, useCallback as wt } from "react";
12
+ import { Toaster as be, toast as xe } from "sonner";
13
+ import * as Z from "@radix-ui/react-collapsible";
14
14
  import "@radix-ui/react-separator";
15
15
  import * as b from "@radix-ui/react-dialog";
16
16
  import * as E from "@radix-ui/react-tooltip";
17
- import { print as xe } from "graphql";
18
- import { createAuthClient as ve } from "@tailor-platform/auth-browser-client";
17
+ import { print as ve } from "graphql";
18
+ import { createAuthClient as ye } from "@tailor-platform/auth-browser-client";
19
19
  function m(...t) {
20
20
  return de(le(t));
21
21
  }
22
- const ye = Y(
22
+ const Ne = X(
23
23
  "astw:inline-flex astw:items-center astw:justify-center astw:gap-2 astw:whitespace-nowrap astw:rounded-md astw:text-sm astw:font-medium astw:transition-all astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:[&_svg]:pointer-events-none astw:[&_svg:not([class*='size-'])]:size-4 astw:shrink-0 astw:[&_svg]:shrink-0 astw:outline-none astw:focus-visible:border-ring astw:focus-visible:ring-ring/50 astw:focus-visible:ring-[3px] astw:aria-invalid:ring-destructive/20 astw:dark:aria-invalid:ring-destructive/40 astw:aria-invalid:border-destructive",
24
24
  {
25
25
  variants: {
@@ -55,12 +55,12 @@ function _({
55
55
  r ? z : "button",
56
56
  {
57
57
  "data-slot": "button",
58
- className: m(ye({ variant: e, size: s, className: t })),
58
+ className: m(Ne({ variant: e, size: s, className: t })),
59
59
  ...n
60
60
  }
61
61
  );
62
62
  }
63
- const $ = "en", Ne = () => {
63
+ const $ = "en", Ce = () => {
64
64
  try {
65
65
  if (typeof navigator > "u")
66
66
  return $;
@@ -69,16 +69,16 @@ const $ = "en", Ne = () => {
69
69
  } catch {
70
70
  return $;
71
71
  }
72
- }, Z = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, Pt = (t) => {
73
- const e = Z(t);
72
+ }, J = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, Pt = (t) => {
73
+ const e = J(t);
74
74
  return (s, r) => e(s, typeof s == "string" ? s : A(r));
75
- }, Ce = (t) => ({
75
+ }, Se = (t) => ({
76
76
  modules: t.modules,
77
77
  settingsResources: t.settingsResources ?? [],
78
78
  errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(j, {}),
79
79
  basePath: t.basePath,
80
- locale: t.locale ?? Ne()
81
- }), J = W({
80
+ locale: t.locale ?? Ce()
81
+ }), tt = W({
82
82
  configurations: {
83
83
  modules: [],
84
84
  settingsResources: [],
@@ -91,18 +91,18 @@ const $ = "en", Ne = () => {
91
91
  // always provides the context via AppShellConfigContext.Provider.
92
92
  errorBoundary: null
93
93
  }
94
- }), tt = W({
94
+ }), et = W({
95
95
  contextData: {}
96
- }), P = () => D(J), ns = () => D(tt), Se = () => {
97
- const t = D(J), e = D(tt);
96
+ }), L = () => D(tt), os = () => D(et), Te = () => {
97
+ const t = D(tt), e = D(et);
98
98
  return {
99
99
  ...t,
100
100
  ...e
101
101
  };
102
- }, Te = () => {
103
- const { configurations: t } = P(), e = Z(t.locale);
102
+ }, ke = () => {
103
+ const { configurations: t } = L(), e = J(t.locale);
104
104
  return (s, r) => e(s, r);
105
- }, ke = (t) => {
105
+ }, Re = (t) => {
106
106
  const e = (s) => (r) => t[s]?.[r] ?? t.en[r];
107
107
  return {
108
108
  /**
@@ -125,7 +125,7 @@ const $ = "en", Ne = () => {
125
125
  * ```
126
126
  */
127
127
  useT: () => {
128
- const { configurations: s } = P(), r = e(s.locale), n = ((o, ...i) => {
128
+ const { configurations: s } = L(), r = e(s.locale), n = ((o, ...i) => {
129
129
  const l = r(o);
130
130
  return typeof l == "function" ? l(i[0]) : l;
131
131
  });
@@ -161,7 +161,7 @@ const $ = "en", Ne = () => {
161
161
  return typeof o == "function" ? o(r[0]) : o;
162
162
  }
163
163
  };
164
- }, Re = ke({
164
+ }, Ee = Re({
165
165
  en: {
166
166
  error404Title: "404 Not Found",
167
167
  error404Body: "The page you requested could not be found.",
@@ -200,14 +200,14 @@ const $ = "en", Ne = () => {
200
200
  commandPaletteSearch: "ページを検索...",
201
201
  commandPaletteNoResults: "結果が見つかりません"
202
202
  }
203
- }), L = Re.useT, j = () => {
204
- const t = Yt(), e = L(), s = {
203
+ }), P = Ee.useT, j = () => {
204
+ const t = Yt(), e = P(), s = {
205
205
  role: "alert",
206
206
  "aria-label": "default-error-boundary"
207
207
  };
208
208
  if (Xt(t) && t.status === 404)
209
209
  return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
210
- /* @__PURE__ */ a(dt, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
210
+ /* @__PURE__ */ a(ct, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
211
211
  /* @__PURE__ */ d("div", { children: [
212
212
  /* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("error404Title") }),
213
213
  /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: e("error404Body") }),
@@ -225,7 +225,7 @@ const $ = "en", Ne = () => {
225
225
  ] }) });
226
226
  const r = t instanceof Error ? t.message : e("errorUnexpected");
227
227
  return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
228
- /* @__PURE__ */ a(dt, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
228
+ /* @__PURE__ */ a(ct, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
229
229
  /* @__PURE__ */ d("div", { children: [
230
230
  /* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("errorTitle") }),
231
231
  /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: r }),
@@ -242,19 +242,19 @@ const $ = "en", Ne = () => {
242
242
  ] })
243
243
  ] }) });
244
244
  };
245
- let Lt = {};
246
- const Ee = (t) => {
247
- Lt = t;
248
- }, os = () => ({ type: "pass" }), is = () => ({ type: "hidden" }), ls = (t) => ({
245
+ let Mt = {};
246
+ const Be = (t) => {
247
+ Mt = t;
248
+ }, is = () => ({ type: "pass" }), ls = () => ({ type: "hidden" }), ds = (t) => ({
249
249
  type: "redirect",
250
250
  to: t
251
- }), Mt = () => new Response("Not Found", { status: 404 }), et = async (t, e) => {
251
+ }), at = () => new Response("Not Found", { status: 404 }), K = async (t, e) => {
252
252
  if (!t || t.length === 0) return { type: "pass" };
253
253
  const s = new URL(e.request.url), r = {
254
254
  params: e.params,
255
255
  searchParams: s.searchParams,
256
256
  signal: e.request.signal,
257
- context: Lt
257
+ context: Mt
258
258
  };
259
259
  for (const n of t) {
260
260
  const o = await n(r);
@@ -263,20 +263,20 @@ const Ee = (t) => {
263
263
  }
264
264
  return { type: "pass" };
265
265
  }, It = (t, e) => async (s) => {
266
- const r = await et(t, s);
266
+ const r = await K(t, s);
267
267
  switch (r.type) {
268
268
  case "hidden":
269
- throw Mt();
269
+ throw at();
270
270
  case "redirect":
271
- return kt(r.to);
271
+ return Rt(r.to);
272
272
  case "pass":
273
273
  return e ? e(s) : null;
274
274
  }
275
275
  }, At = (t, e) => () => {
276
- const { configurations: s } = P(), { metaTitle: r, fallbackTitle: n } = t, i = Z(s.locale)(r, n);
276
+ const { configurations: s } = L(), { metaTitle: r, fallbackTitle: n } = t, i = J(s.locale)(r, n);
277
277
  return e(i);
278
278
  };
279
- function ds(t) {
279
+ function cs(t) {
280
280
  const { path: e, meta: s, component: r, resources: n, errorBoundary: o, guards: i } = t, l = s?.title ?? A(e), u = A(e), w = i && i.length > 0 ? It(i) : void 0, c = r ? At(
281
281
  { metaTitle: l, fallbackTitle: u },
282
282
  (h) => r({ title: h, resources: n })
@@ -299,7 +299,7 @@ function ds(t) {
299
299
  guards: i
300
300
  };
301
301
  }
302
- function cs(t) {
302
+ function ws(t) {
303
303
  const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, guards: i } = t, l = n?.title ?? A(e), u = A(e), w = i && i.length > 0 ? It(i) : void 0;
304
304
  return {
305
305
  _type: "resource",
@@ -320,17 +320,17 @@ function cs(t) {
320
320
  loader: w
321
321
  };
322
322
  }
323
- const Be = () => {
324
- const t = L();
323
+ const De = () => {
324
+ const t = P();
325
325
  return /* @__PURE__ */ d(B, { children: [
326
326
  /* @__PURE__ */ a("p", { className: "astw:font-semibold astw:leading-none astw:tracking-tight", children: t("welcomeTitle") }),
327
327
  /* @__PURE__ */ a("p", { className: "pt-4", children: t("welcomeBody") })
328
328
  ] });
329
- }, wt = () => /* @__PURE__ */ d(B, { children: [
330
- /* @__PURE__ */ a(G, {}),
329
+ }, ut = () => /* @__PURE__ */ d(B, { children: [
330
+ /* @__PURE__ */ a(Y, {}),
331
331
  /* @__PURE__ */ a(be, {})
332
- ] }), De = () => {
333
- const { configurations: t } = Se(), e = L(), s = Te();
332
+ ] }), Le = () => {
333
+ const { configurations: t } = Te(), e = P(), s = ke();
334
334
  return /* @__PURE__ */ d("div", { className: "astw:mx-auto astw:flex-col astw:flex astw:md:flex-row astw:max-w-5xl astw:gap-[10px] astw:w-full", children: [
335
335
  /* @__PURE__ */ a("div", { children: /* @__PURE__ */ d("nav", { className: "astw:bg-card astw:md:w-xs astw:rounded-md astw:border astw:p-3 astw:shadow-xs", children: [
336
336
  /* @__PURE__ */ a("h2", { className: "astw:text-sm astw:leading-[36px] astw:mb-2 astw:font-bold ", children: e("settings") }),
@@ -346,9 +346,9 @@ const Be = () => {
346
346
  }
347
347
  ) }) }, r.path)) })
348
348
  ] }) }),
349
- /* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(G, {}) })
349
+ /* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(Y, {}) })
350
350
  ] });
351
- }, at = (t) => () => /* @__PURE__ */ a(B, { children: t }), _t = (t, e, s) => {
351
+ }, st = (t) => () => /* @__PURE__ */ a(B, { children: t }), _t = (t, e, s) => {
352
352
  const r = t.errorBoundary || s, n = t.component ? {
353
353
  index: !0,
354
354
  Component: t.component
@@ -357,7 +357,7 @@ const Be = () => {
357
357
  path: t.path,
358
358
  ...t.loader && { loader: t.loader },
359
359
  ...t.errorBoundary && {
360
- ErrorBoundary: at(t.errorBoundary)
360
+ ErrorBoundary: st(t.errorBoundary)
361
361
  },
362
362
  ...e && e.length > 0 ? {
363
363
  children: [
@@ -373,25 +373,33 @@ const Be = () => {
373
373
  }, Pe = (t) => {
374
374
  const e = _t(t, t.resources, t.errorBoundary);
375
375
  if (!t.component && t.resources.length > 0) {
376
- const s = t.resources[0].path, r = {
376
+ const s = {
377
377
  index: !0,
378
- loader: () => kt(s)
379
- }, n = {
378
+ // Component is required to suppress React Router's warning about empty leaf routes,
379
+ // even though the loader always redirects and this component will never render.
380
+ Component: () => null,
381
+ loader: async (n) => {
382
+ for (const o of t.resources)
383
+ if ((await K(o.guards, n)).type === "pass")
384
+ return Rt(o.path);
385
+ throw at();
386
+ }
387
+ }, r = {
380
388
  path: e.path,
381
- children: [r, ...e.children ?? []],
389
+ children: [s, ...e.children ?? []],
382
390
  ...e.loader && { loader: e.loader }
383
391
  };
384
- return e.ErrorBoundary && (n.ErrorBoundary = e.ErrorBoundary), n;
392
+ return e.ErrorBoundary && (r.ErrorBoundary = e.ErrorBoundary), r;
385
393
  }
386
394
  return e;
387
- }, Le = (t) => t.map((e) => Pe(e)), Me = ({
395
+ }, Me = (t) => t.map((e) => Pe(e)), Ie = ({
388
396
  modules: t,
389
397
  settingsResources: e,
390
398
  rootComponent: s
391
399
  }) => {
392
400
  const r = {
393
401
  index: !0,
394
- Component: s ?? Be
402
+ Component: s ?? De
395
403
  }, n = e.length > 0 ? [
396
404
  {
397
405
  path: "settings",
@@ -407,12 +415,12 @@ const Be = () => {
407
415
  },
408
416
  {
409
417
  path: "settings",
410
- Component: De,
418
+ Component: Le,
411
419
  children: e.map((o) => ({
412
420
  path: o.path,
413
421
  Component: o.component,
414
422
  ...o.errorBoundary && {
415
- ErrorBoundary: at(o.errorBoundary)
423
+ ErrorBoundary: st(o.errorBoundary)
416
424
  }
417
425
  }))
418
426
  }
@@ -420,13 +428,13 @@ const Be = () => {
420
428
  return [
421
429
  r,
422
430
  {
423
- children: Le(t)
431
+ children: Me(t)
424
432
  },
425
433
  ...n,
426
434
  {
427
435
  path: "*",
428
436
  loader: () => {
429
- throw Mt();
437
+ throw at();
430
438
  },
431
439
  // Component is required to suppress React Router's warning about empty leaf routes,
432
440
  // even though the loader always throws and this component will never render.
@@ -434,14 +442,14 @@ const Be = () => {
434
442
  ErrorBoundary: j
435
443
  }
436
444
  ];
437
- }, zt = "appshell-root-nav", Ie = (t) => ({
445
+ }, zt = "appshell-root-nav", Ae = (t) => ({
438
446
  loaderID: zt,
439
- loader: async (e) => ({ navItems: Ae(t, e) })
440
- }), Ft = () => te(zt)?.navItems, Ae = async (t, e) => {
447
+ loader: async (e) => ({ navItems: _e(t, e) })
448
+ }), Ft = () => te(zt)?.navItems, _e = async (t, e) => {
441
449
  const s = Pt(t.locale);
442
450
  return (await Promise.all(
443
451
  t.modules.map(async (n) => {
444
- if (n.path.startsWith(":") || (await et(n.guards, e)).type !== "pass") return null;
452
+ if (n.path.startsWith(":") || (await K(n.guards, e)).type !== "pass") return null;
445
453
  const i = await Ot(
446
454
  n.resources,
447
455
  n.path,
@@ -458,7 +466,7 @@ const Be = () => {
458
466
  }));
459
467
  }, Ot = async (t, e, s, r) => (await Promise.all(
460
468
  t.map(async (o) => {
461
- if (o.path.startsWith(":") || (await et(o.guards, s)).type !== "pass") return null;
469
+ if (o.path.startsWith(":") || (await K(o.guards, s)).type !== "pass") return null;
462
470
  const l = `${e}/${o.path}`, u = r(o.meta.title, o.path), w = o.subResources ? await Ot(
463
471
  o.subResources,
464
472
  l,
@@ -471,12 +479,12 @@ const Be = () => {
471
479
  items: w && w.length > 0 ? w : void 0
472
480
  };
473
481
  })
474
- )).filter((o) => o !== null), _e = (t) => {
475
- const { configurations: e } = P(), { rootComponent: s, children: r } = t, n = Me({
482
+ )).filter((o) => o !== null), ze = (t) => {
483
+ const { configurations: e } = L(), { rootComponent: s, children: r } = t, n = Ie({
476
484
  modules: e.modules,
477
485
  settingsResources: e.settingsResources,
478
486
  rootComponent: s
479
- }), o = e.errorBoundary, { loaderID: i, loader: l } = Ie({
487
+ }), o = e.errorBoundary, { loaderID: i, loader: l } = Ae({
480
488
  modules: e.modules,
481
489
  locale: e.locale
482
490
  }), u = [
@@ -486,8 +494,8 @@ const Be = () => {
486
494
  element: r,
487
495
  children: o ? [
488
496
  {
489
- element: /* @__PURE__ */ a(G, {}),
490
- ErrorBoundary: at(o),
497
+ element: /* @__PURE__ */ a(Y, {}),
498
+ ErrorBoundary: st(o),
491
499
  children: n
492
500
  }
493
501
  ] : n,
@@ -504,12 +512,12 @@ const Be = () => {
504
512
  basename: w
505
513
  });
506
514
  return /* @__PURE__ */ a(se, { router: c });
507
- }, ze = {
515
+ }, Fe = {
508
516
  resolvedTheme: "light",
509
517
  theme: "system",
510
518
  setTheme: () => null
511
- }, $t = W(ze);
512
- function Fe({
519
+ }, $t = W(Fe);
520
+ function Oe({
513
521
  children: t,
514
522
  storageKey: e,
515
523
  defaultTheme: s = "system",
@@ -531,20 +539,20 @@ function Fe({
531
539
  };
532
540
  return /* @__PURE__ */ a($t.Provider, { ...r, value: l, children: t });
533
541
  }
534
- const Oe = () => {
542
+ const $e = () => {
535
543
  const t = D($t);
536
544
  if (t === void 0)
537
545
  throw new Error("useTheme must be used within a ThemeProvider");
538
546
  return t;
539
- }, ws = (t) => {
547
+ }, us = (t) => {
540
548
  const [e, s] = R(!1);
541
549
  y(function() {
542
550
  s(!0);
543
551
  }, []);
544
552
  const r = t.contextData ?? {};
545
- Ee(r);
553
+ Be(r);
546
554
  const n = k(
547
- () => Ce({
555
+ () => Se({
548
556
  modules: t.modules,
549
557
  settingsResources: t.settingsResources,
550
558
  basePath: t.basePath,
@@ -565,66 +573,66 @@ const Oe = () => {
565
573
  () => ({ contextData: t.contextData ?? {} }),
566
574
  [t.contextData]
567
575
  );
568
- return e ? /* @__PURE__ */ a(J.Provider, { value: o, children: /* @__PURE__ */ a(tt.Provider, { value: i, children: /* @__PURE__ */ a(Fe, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(_e, { rootComponent: t.rootComponent, children: t.children }) }) }) }) : null;
576
+ return e ? /* @__PURE__ */ a(tt.Provider, { value: o, children: /* @__PURE__ */ a(et.Provider, { value: i, children: /* @__PURE__ */ a(Oe, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(ze, { rootComponent: t.rootComponent, children: t.children }) }) }) }) : null;
569
577
  };
570
- function $e({
578
+ function We({
571
579
  ...t
572
580
  }) {
573
- return /* @__PURE__ */ a(X.Root, { "data-slot": "collapsible", ...t });
581
+ return /* @__PURE__ */ a(Z.Root, { "data-slot": "collapsible", ...t });
574
582
  }
575
- function ut({
583
+ function mt({
576
584
  ...t
577
585
  }) {
578
586
  return /* @__PURE__ */ a(
579
- X.CollapsibleTrigger,
587
+ Z.CollapsibleTrigger,
580
588
  {
581
589
  "data-slot": "collapsible-trigger",
582
590
  ...t
583
591
  }
584
592
  );
585
593
  }
586
- function We({
594
+ function je({
587
595
  ...t
588
596
  }) {
589
597
  return /* @__PURE__ */ a(
590
- X.CollapsibleContent,
598
+ Z.CollapsibleContent,
591
599
  {
592
600
  "data-slot": "collapsible-content",
593
601
  ...t
594
602
  }
595
603
  );
596
604
  }
597
- const V = 768;
598
- function je() {
605
+ const H = 768;
606
+ function Ke() {
599
607
  const [t, e] = p.useState(
600
608
  void 0
601
609
  );
602
610
  return p.useEffect(() => {
603
- const s = window.matchMedia(`(max-width: ${V - 1}px)`), r = () => {
604
- e(window.innerWidth < V);
611
+ const s = window.matchMedia(`(max-width: ${H - 1}px)`), r = () => {
612
+ e(window.innerWidth < H);
605
613
  };
606
- return s.addEventListener("change", r), e(window.innerWidth < V), () => s.removeEventListener("change", r);
614
+ return s.addEventListener("change", r), e(window.innerWidth < H), () => s.removeEventListener("change", r);
607
615
  }, []), !!t;
608
616
  }
609
- const H = 768, U = 1199;
610
- function Ke() {
617
+ const U = 768, Q = 1199;
618
+ function Ve() {
611
619
  const [t, e] = p.useState(
612
620
  void 0
613
621
  );
614
622
  return p.useEffect(() => {
615
623
  const s = window.matchMedia(
616
- `(min-width: ${H}px) and (max-width: ${U}px)`
624
+ `(min-width: ${U}px) and (max-width: ${Q}px)`
617
625
  ), r = () => {
618
626
  e(
619
- window.innerWidth >= H && window.innerWidth <= U
627
+ window.innerWidth >= U && window.innerWidth <= Q
620
628
  );
621
629
  };
622
630
  return s.addEventListener("change", r), e(
623
- window.innerWidth >= H && window.innerWidth <= U
631
+ window.innerWidth >= U && window.innerWidth <= Q
624
632
  ), () => s.removeEventListener("change", r);
625
633
  }, []), !!t;
626
634
  }
627
- function Ve({ className: t, type: e, ...s }) {
635
+ function He({ className: t, type: e, ...s }) {
628
636
  return /* @__PURE__ */ a(
629
637
  "input",
630
638
  {
@@ -640,15 +648,15 @@ function Ve({ className: t, type: e, ...s }) {
640
648
  }
641
649
  );
642
650
  }
643
- function mt({ ...t }) {
651
+ function ht({ ...t }) {
644
652
  return /* @__PURE__ */ a(b.Root, { "data-slot": "sheet", ...t });
645
653
  }
646
- function He({
654
+ function Ue({
647
655
  ...t
648
656
  }) {
649
657
  return /* @__PURE__ */ a(b.Portal, { "data-slot": "sheet-portal", ...t });
650
658
  }
651
- function Ue({
659
+ function Qe({
652
660
  className: t,
653
661
  ...e
654
662
  }) {
@@ -664,14 +672,14 @@ function Ue({
664
672
  }
665
673
  );
666
674
  }
667
- function ht({
675
+ function ft({
668
676
  className: t,
669
677
  children: e,
670
678
  side: s = "right",
671
679
  ...r
672
680
  }) {
673
- return /* @__PURE__ */ d(He, { children: [
674
- /* @__PURE__ */ a(Ue, {}),
681
+ return /* @__PURE__ */ d(Ue, { children: [
682
+ /* @__PURE__ */ a(Qe, {}),
675
683
  /* @__PURE__ */ d(
676
684
  b.Content,
677
685
  {
@@ -688,7 +696,7 @@ function ht({
688
696
  children: [
689
697
  e,
690
698
  /* @__PURE__ */ d(b.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-secondary astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none", children: [
691
- /* @__PURE__ */ a(Bt, { className: "astw:size-4" }),
699
+ /* @__PURE__ */ a(Dt, { className: "astw:size-4" }),
692
700
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
693
701
  ] })
694
702
  ]
@@ -696,7 +704,7 @@ function ht({
696
704
  )
697
705
  ] });
698
706
  }
699
- function ft({ className: t, ...e }) {
707
+ function gt({ className: t, ...e }) {
700
708
  return /* @__PURE__ */ a(
701
709
  "div",
702
710
  {
@@ -706,7 +714,7 @@ function ft({ className: t, ...e }) {
706
714
  }
707
715
  );
708
716
  }
709
- function gt({
717
+ function pt({
710
718
  className: t,
711
719
  ...e
712
720
  }) {
@@ -719,7 +727,7 @@ function gt({
719
727
  }
720
728
  );
721
729
  }
722
- function pt({
730
+ function bt({
723
731
  className: t,
724
732
  ...e
725
733
  }) {
@@ -732,7 +740,7 @@ function pt({
732
740
  }
733
741
  );
734
742
  }
735
- function st({
743
+ function rt({
736
744
  delayDuration: t = 0,
737
745
  ...e
738
746
  }) {
@@ -745,17 +753,17 @@ function st({
745
753
  }
746
754
  );
747
755
  }
748
- function rt({
756
+ function nt({
749
757
  ...t
750
758
  }) {
751
- return /* @__PURE__ */ a(st, { children: /* @__PURE__ */ a(E.Root, { "data-slot": "tooltip", ...t }) });
759
+ return /* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(E.Root, { "data-slot": "tooltip", ...t }) });
752
760
  }
753
- function nt({
761
+ function ot({
754
762
  ...t
755
763
  }) {
756
764
  return /* @__PURE__ */ a(E.Trigger, { "data-slot": "tooltip-trigger", ...t });
757
765
  }
758
- function ot({
766
+ function it({
759
767
  className: t,
760
768
  sideOffset: e = 0,
761
769
  children: s,
@@ -778,14 +786,14 @@ function ot({
778
786
  }
779
787
  ) });
780
788
  }
781
- const Wt = "16rem", Qe = "18rem", qe = "3rem", Ge = "b", jt = p.createContext(null);
789
+ const Wt = "16rem", qe = "18rem", Ge = "3rem", Ye = "b", jt = p.createContext(null);
782
790
  function F() {
783
791
  const t = p.useContext(jt);
784
792
  if (!t)
785
793
  throw new Error("useSidebar must be used within a SidebarProvider.");
786
794
  return t;
787
795
  }
788
- function Ye({
796
+ function Xe({
789
797
  defaultOpen: t = !0,
790
798
  open: e,
791
799
  onOpenChange: s,
@@ -794,7 +802,7 @@ function Ye({
794
802
  children: o,
795
803
  ...i
796
804
  }) {
797
- const l = je(), u = Ke(), [w, c] = p.useState(!1), [h, f] = p.useState(!1), [g, M] = p.useState(t), C = e ?? g, I = p.useCallback(
805
+ const l = Ke(), u = Ve(), [w, c] = p.useState(!1), [h, f] = p.useState(!1), [g, M] = p.useState(t), C = e ?? g, I = p.useCallback(
798
806
  (x) => {
799
807
  const T = typeof x == "function" ? x(C) : x;
800
808
  s ? s(T) : M(T);
@@ -803,13 +811,13 @@ function Ye({
803
811
  ), S = u && !l, O = p.useCallback(() => l ? c((x) => !x) : S ? f((x) => !x) : I((x) => !x), [l, S, I, c]);
804
812
  p.useEffect(() => {
805
813
  const x = (T) => {
806
- T.key === Ge && (T.metaKey || T.ctrlKey) && (T.preventDefault(), O());
814
+ T.key === Ye && (T.metaKey || T.ctrlKey) && (T.preventDefault(), O());
807
815
  };
808
816
  return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
809
817
  }, [O]);
810
- const lt = C ? "expanded" : "collapsed", Gt = p.useMemo(
818
+ const dt = C ? "expanded" : "collapsed", Gt = p.useMemo(
811
819
  () => ({
812
- state: lt,
820
+ state: dt,
813
821
  open: C,
814
822
  setOpen: I,
815
823
  isMobile: l,
@@ -820,15 +828,15 @@ function Ye({
820
828
  openIconMode: h,
821
829
  setOpenIconMode: f
822
830
  }),
823
- [lt, C, I, l, w, c, O, S, h, f]
831
+ [dt, C, I, l, w, c, O, S, h, f]
824
832
  );
825
- return /* @__PURE__ */ a(jt.Provider, { value: Gt, children: /* @__PURE__ */ a(st, { delayDuration: 0, children: /* @__PURE__ */ a(
833
+ return /* @__PURE__ */ a(jt.Provider, { value: Gt, children: /* @__PURE__ */ a(rt, { delayDuration: 0, children: /* @__PURE__ */ a(
826
834
  "div",
827
835
  {
828
836
  "data-slot": "sidebar-wrapper",
829
837
  style: {
830
838
  "--sidebar-width": Wt,
831
- "--sidebar-width-icon": qe,
839
+ "--sidebar-width-icon": Ge,
832
840
  ...n
833
841
  },
834
842
  className: m(
@@ -840,7 +848,7 @@ function Ye({
840
848
  }
841
849
  ) }) });
842
850
  }
843
- function Xe({
851
+ function Ze({
844
852
  side: t = "left",
845
853
  variant: e = "sidebar",
846
854
  collapsible: s = "offcanvas",
@@ -860,21 +868,21 @@ function Xe({
860
868
  ...o,
861
869
  children: n
862
870
  }
863
- ) : i ? /* @__PURE__ */ a(mt, { open: u, onOpenChange: w, ...o, children: /* @__PURE__ */ d(
864
- ht,
871
+ ) : i ? /* @__PURE__ */ a(ht, { open: u, onOpenChange: w, ...o, children: /* @__PURE__ */ d(
872
+ ft,
865
873
  {
866
874
  "data-sidebar": "sidebar",
867
875
  "data-slot": "sidebar",
868
876
  "data-mobile": "true",
869
877
  className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
870
878
  style: {
871
- "--sidebar-width": Qe
879
+ "--sidebar-width": qe
872
880
  },
873
881
  side: t,
874
882
  children: [
875
- /* @__PURE__ */ d(ft, { className: "astw:sr-only", children: [
876
- /* @__PURE__ */ a(gt, { children: "Sidebar" }),
877
- /* @__PURE__ */ a(pt, { children: "Displays the mobile sidebar." })
883
+ /* @__PURE__ */ d(gt, { className: "astw:sr-only", children: [
884
+ /* @__PURE__ */ a(pt, { children: "Sidebar" }),
885
+ /* @__PURE__ */ a(bt, { children: "Displays the mobile sidebar." })
878
886
  ] }),
879
887
  /* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
880
888
  ]
@@ -924,8 +932,8 @@ function Xe({
924
932
  ]
925
933
  }
926
934
  ),
927
- /* @__PURE__ */ a(mt, { open: h, onOpenChange: f, ...o, children: /* @__PURE__ */ d(
928
- ht,
935
+ /* @__PURE__ */ a(ht, { open: h, onOpenChange: f, ...o, children: /* @__PURE__ */ d(
936
+ ft,
929
937
  {
930
938
  "data-sidebar": "sidebar",
931
939
  "data-slot": "sidebar-overlay",
@@ -936,9 +944,9 @@ function Xe({
936
944
  },
937
945
  side: t,
938
946
  children: [
939
- /* @__PURE__ */ d(ft, { className: "astw:sr-only", children: [
940
- /* @__PURE__ */ a(gt, { children: "Sidebar" }),
941
- /* @__PURE__ */ a(pt, { children: "Displays the sidebar overlay." })
947
+ /* @__PURE__ */ d(gt, { className: "astw:sr-only", children: [
948
+ /* @__PURE__ */ a(pt, { children: "Sidebar" }),
949
+ /* @__PURE__ */ a(bt, { children: "Displays the sidebar overlay." })
942
950
  ] }),
943
951
  /* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
944
952
  ]
@@ -1019,7 +1027,7 @@ function Kt({
1019
1027
  }
1020
1028
  );
1021
1029
  }
1022
- function Ze({ className: t, ...e }) {
1030
+ function Je({ className: t, ...e }) {
1023
1031
  return /* @__PURE__ */ a(
1024
1032
  "main",
1025
1033
  {
@@ -1034,7 +1042,7 @@ function Ze({ className: t, ...e }) {
1034
1042
  }
1035
1043
  );
1036
1044
  }
1037
- function Je({ className: t, ...e }) {
1045
+ function ta({ className: t, ...e }) {
1038
1046
  return /* @__PURE__ */ a(
1039
1047
  "div",
1040
1048
  {
@@ -1045,7 +1053,7 @@ function Je({ className: t, ...e }) {
1045
1053
  }
1046
1054
  );
1047
1055
  }
1048
- function ta({ className: t, ...e }) {
1056
+ function ea({ className: t, ...e }) {
1049
1057
  return /* @__PURE__ */ a(
1050
1058
  "div",
1051
1059
  {
@@ -1089,7 +1097,7 @@ function Ut({ className: t, ...e }) {
1089
1097
  }
1090
1098
  );
1091
1099
  }
1092
- const ea = Y(
1100
+ const aa = X(
1093
1101
  "astw:peer/menu-button astw:flex astw:w-full astw:items-center astw:gap-2 astw:overflow-hidden astw:rounded-md astw:p-2 astw:text-left astw:text-sm astw:outline-hidden astw:ring-sidebar-ring astw:transition-[width,height,padding] astw:hover:bg-sidebar-accent astw:hover:text-sidebar-accent-foreground astw:focus-visible:ring-2 astw:active:bg-sidebar-accent astw:active:text-sidebar-accent-foreground astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:group-has-data-[sidebar=menu-action]/menu-item:pr-8 astw:aria-disabled:pointer-events-none astw:aria-disabled:opacity-50 astw:data-[active=true]:bg-sidebar-accent astw:data-[active=true]:font-medium astw:data-[active=true]:text-sidebar-accent-foreground astw:data-[state=open]:hover:bg-sidebar-accent astw:data-[state=open]:hover:text-sidebar-accent-foreground astw:group-data-[collapsible=icon]:size-8! astw:group-data-[collapsible=icon]:p-2! astw:[&>span:last-child]:truncate astw:group-data-[collapsible=icon]:[&>span:last-child]:hidden astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
1094
1102
  {
1095
1103
  variants: {
@@ -1109,7 +1117,7 @@ const ea = Y(
1109
1117
  }
1110
1118
  }
1111
1119
  );
1112
- function bt({
1120
+ function xt({
1113
1121
  asChild: t = !1,
1114
1122
  isActive: e = !1,
1115
1123
  variant: s = "default",
@@ -1125,16 +1133,16 @@ function bt({
1125
1133
  "data-sidebar": "menu-button",
1126
1134
  "data-size": r,
1127
1135
  "data-active": e,
1128
- className: m(ea({ variant: s, size: r }), o),
1136
+ className: m(aa({ variant: s, size: r }), o),
1129
1137
  ...i
1130
1138
  }
1131
1139
  );
1132
1140
  return n ? (typeof n == "string" && (n = {
1133
1141
  children: n
1134
- }), /* @__PURE__ */ d(rt, { children: [
1135
- /* @__PURE__ */ a(nt, { asChild: !0, children: c }),
1142
+ }), /* @__PURE__ */ d(nt, { children: [
1143
+ /* @__PURE__ */ a(ot, { asChild: !0, children: c }),
1136
1144
  /* @__PURE__ */ a(
1137
- ot,
1145
+ it,
1138
1146
  {
1139
1147
  side: "right",
1140
1148
  align: "center",
@@ -1144,7 +1152,7 @@ function bt({
1144
1152
  )
1145
1153
  ] })) : c;
1146
1154
  }
1147
- function xt({
1155
+ function vt({
1148
1156
  className: t,
1149
1157
  asChild: e = !1,
1150
1158
  showOnHover: s = !1,
@@ -1170,7 +1178,7 @@ function xt({
1170
1178
  }
1171
1179
  );
1172
1180
  }
1173
- function aa({ className: t, ...e }) {
1181
+ function sa({ className: t, ...e }) {
1174
1182
  return /* @__PURE__ */ a(
1175
1183
  "ul",
1176
1184
  {
@@ -1185,7 +1193,7 @@ function aa({ className: t, ...e }) {
1185
1193
  }
1186
1194
  );
1187
1195
  }
1188
- function sa({
1196
+ function ra({
1189
1197
  className: t,
1190
1198
  ...e
1191
1199
  }) {
@@ -1199,7 +1207,7 @@ function sa({
1199
1207
  }
1200
1208
  );
1201
1209
  }
1202
- function ra({
1210
+ function na({
1203
1211
  asChild: t = !1,
1204
1212
  size: e = "md",
1205
1213
  isActive: s = !1,
@@ -1225,17 +1233,17 @@ function ra({
1225
1233
  }
1226
1234
  );
1227
1235
  }
1228
- function q({ to: t, children: e, ...s }) {
1236
+ function G({ to: t, children: e, ...s }) {
1229
1237
  try {
1230
1238
  return re(t), /* @__PURE__ */ a(ne, { to: t, ...s, children: e });
1231
1239
  } catch {
1232
1240
  return /* @__PURE__ */ a("a", { href: t, ...s, children: e });
1233
1241
  }
1234
1242
  }
1235
- function vt({ ...t }) {
1243
+ function yt({ ...t }) {
1236
1244
  return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...t });
1237
1245
  }
1238
- function yt({ className: t, ...e }) {
1246
+ function Nt({ className: t, ...e }) {
1239
1247
  return /* @__PURE__ */ a(
1240
1248
  "ol",
1241
1249
  {
@@ -1248,7 +1256,7 @@ function yt({ className: t, ...e }) {
1248
1256
  }
1249
1257
  );
1250
1258
  }
1251
- function Nt({ className: t, ...e }) {
1259
+ function Ct({ className: t, ...e }) {
1252
1260
  return /* @__PURE__ */ a(
1253
1261
  "li",
1254
1262
  {
@@ -1258,14 +1266,14 @@ function Nt({ className: t, ...e }) {
1258
1266
  }
1259
1267
  );
1260
1268
  }
1261
- function Ct({
1269
+ function St({
1262
1270
  asChild: t,
1263
1271
  className: e,
1264
1272
  children: s,
1265
1273
  ...r
1266
1274
  }) {
1267
1275
  return /* @__PURE__ */ a(
1268
- t ? z : q,
1276
+ t ? z : G,
1269
1277
  {
1270
1278
  "data-slot": "breadcrumb-link",
1271
1279
  className: m("astw:hover:text-foreground astw:transition-colors", e),
@@ -1274,7 +1282,7 @@ function Ct({
1274
1282
  }
1275
1283
  );
1276
1284
  }
1277
- function na({
1285
+ function oa({
1278
1286
  children: t,
1279
1287
  className: e,
1280
1288
  ...s
@@ -1287,18 +1295,18 @@ function na({
1287
1295
  "aria-hidden": "true",
1288
1296
  className: m("astw:[&>svg]:size-3.5", e),
1289
1297
  ...s,
1290
- children: t ?? /* @__PURE__ */ a(Q, {})
1298
+ children: t ?? /* @__PURE__ */ a(q, {})
1291
1299
  }
1292
1300
  );
1293
1301
  }
1294
- function oa(t, e) {
1302
+ function ia(t, e) {
1295
1303
  if (!e.trim()) return t;
1296
1304
  const s = e.toLowerCase();
1297
1305
  return t.filter(
1298
1306
  (r) => r.title.toLowerCase().includes(s) || r.path.toLowerCase().includes(s)
1299
1307
  );
1300
1308
  }
1301
- const ia = (t, e) => {
1309
+ const la = (t, e) => {
1302
1310
  const s = Pt(e);
1303
1311
  return t.reduce(
1304
1312
  (r, n) => {
@@ -1327,8 +1335,8 @@ const ia = (t, e) => {
1327
1335
  {}
1328
1336
  );
1329
1337
  };
1330
- function la(t, e, s, r) {
1331
- const n = t.split("/").filter((u) => u !== ""), o = e && n[0] === e ? n.slice(1) : n, i = ia(s, r), l = o.map((u, w) => {
1338
+ function da(t, e, s, r) {
1339
+ const n = t.split("/").filter((u) => u !== ""), o = e && n[0] === e ? n.slice(1) : n, i = la(s, r), l = o.map((u, w) => {
1332
1340
  const c = o.slice(0, w + 1).join("/");
1333
1341
  let h = i[c];
1334
1342
  if (!h) {
@@ -1352,28 +1360,28 @@ function la(t, e, s, r) {
1352
1360
  segments: l
1353
1361
  };
1354
1362
  }
1355
- const da = () => {
1363
+ const ca = () => {
1356
1364
  const { open: t, isIconMode: e } = F();
1357
1365
  return /* @__PURE__ */ a("div", { className: t && !e ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(Kt, { className: "astw:-ml-2.5" }) });
1358
- }, us = (t) => {
1359
- const e = t.children ? t.children({ Outlet: wt }) : null, s = Oe(), r = () => {
1366
+ }, ms = (t) => {
1367
+ const e = t.children ? t.children({ Outlet: ut }) : null, s = $e(), r = () => {
1360
1368
  s.setTheme(s.theme === "dark" ? "light" : "dark");
1361
1369
  };
1362
- return /* @__PURE__ */ a(Ye, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:flex-1", children: [
1363
- t.sidebar ?? /* @__PURE__ */ a(ca, {}),
1364
- /* @__PURE__ */ d(Ze, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
1370
+ return /* @__PURE__ */ a(Xe, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:flex-1", children: [
1371
+ t.sidebar ?? /* @__PURE__ */ a(wa, {}),
1372
+ /* @__PURE__ */ d(Je, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
1365
1373
  /* @__PURE__ */ a("header", { className: "astw:flex astw:h-14 astw:shrink-0 astw:items-center astw:gap-2 astw:transition-[width,height] astw:ease-linear astw:group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:w-full astw:items-center astw:justify-between", children: [
1366
1374
  /* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
1367
- /* @__PURE__ */ a(da, {}),
1368
- /* @__PURE__ */ a(fa, {})
1375
+ /* @__PURE__ */ a(ca, {}),
1376
+ /* @__PURE__ */ a(ga, {})
1369
1377
  ] }),
1370
1378
  /* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(_, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(ue, {}) }) })
1371
1379
  ] }) }),
1372
- /* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(wt, {}) })
1380
+ /* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(ut, {}) })
1373
1381
  ] })
1374
1382
  ] }) });
1375
- }, ca = (t) => {
1376
- const { title: e, icon: s } = P(), { pathname: r } = Rt(), { isIconMode: n } = F(), o = /* @__PURE__ */ d(Je, { children: [
1383
+ }, wa = (t) => {
1384
+ const { title: e, icon: s } = L(), { pathname: r } = Et(), { isIconMode: n } = F(), o = /* @__PURE__ */ d(ta, { children: [
1377
1385
  s,
1378
1386
  /* @__PURE__ */ a(
1379
1387
  "h1",
@@ -1386,23 +1394,23 @@ const da = () => {
1386
1394
  }
1387
1395
  )
1388
1396
  ] });
1389
- return /* @__PURE__ */ d(Xe, { variant: "inset", collapsible: n ? "icon" : "offcanvas", children: [
1397
+ return /* @__PURE__ */ d(Ze, { variant: "inset", collapsible: n ? "icon" : "offcanvas", children: [
1390
1398
  !n && /* @__PURE__ */ d("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
1391
1399
  t.header ?? o,
1392
1400
  /* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(Kt, { className: "astw:-ml-1" }) })
1393
1401
  ] }),
1394
- /* @__PURE__ */ a(ta, { children: /* @__PURE__ */ a(Dt, { fallback: /* @__PURE__ */ a(ma, {}), children: /* @__PURE__ */ a(wa, { currentPath: r }) }) }),
1402
+ /* @__PURE__ */ a(ea, { children: /* @__PURE__ */ a(Lt, { fallback: /* @__PURE__ */ a(ha, {}), children: /* @__PURE__ */ a(ua, { currentPath: r }) }) }),
1395
1403
  t.footer ?? null
1396
1404
  ] });
1397
- }, wa = ({ currentPath: t }) => {
1405
+ }, ua = ({ currentPath: t }) => {
1398
1406
  const e = Ft();
1399
- return /* @__PURE__ */ a(Et, { resolve: e, children: (s) => /* @__PURE__ */ a(ua, { items: s ?? [], currentPath: t }) });
1400
- }, ua = (t) => {
1401
- const e = L();
1402
- return /* @__PURE__ */ a(Vt, { children: /* @__PURE__ */ a(Ht, { children: t.items.map((s) => /* @__PURE__ */ a($e, { asChild: !0, defaultOpen: !0, children: /* @__PURE__ */ d(Ut, { children: [
1407
+ return /* @__PURE__ */ a(Bt, { resolve: e, children: (s) => /* @__PURE__ */ a(ma, { items: s ?? [], currentPath: t }) });
1408
+ }, ma = (t) => {
1409
+ const e = P();
1410
+ return /* @__PURE__ */ a(Vt, { children: /* @__PURE__ */ a(Ht, { children: t.items.map((s) => /* @__PURE__ */ a(We, { asChild: !0, defaultOpen: !0, children: /* @__PURE__ */ d(Ut, { children: [
1403
1411
  s.url ? /* @__PURE__ */ d(B, { children: [
1404
- /* @__PURE__ */ a(bt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d(
1405
- q,
1412
+ /* @__PURE__ */ a(xt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d(
1413
+ G,
1406
1414
  {
1407
1415
  to: s.url,
1408
1416
  className: s.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
@@ -1412,29 +1420,29 @@ const da = () => {
1412
1420
  ]
1413
1421
  }
1414
1422
  ) }),
1415
- !!s.items?.length && /* @__PURE__ */ a(ut, { asChild: !0, children: /* @__PURE__ */ d(xt, { className: "astw:data-[state=open]:rotate-90", children: [
1416
- /* @__PURE__ */ a(Q, {}),
1423
+ !!s.items?.length && /* @__PURE__ */ a(mt, { asChild: !0, children: /* @__PURE__ */ d(vt, { className: "astw:data-[state=open]:rotate-90", children: [
1424
+ /* @__PURE__ */ a(q, {}),
1417
1425
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
1418
1426
  ] }) })
1419
- ] }) : /* @__PURE__ */ a(B, { children: /* @__PURE__ */ d(ut, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
1420
- /* @__PURE__ */ a(bt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d("span", { className: "astw:flex astw:w-[100%]", children: [
1427
+ ] }) : /* @__PURE__ */ a(B, { children: /* @__PURE__ */ d(mt, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
1428
+ /* @__PURE__ */ a(xt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d("span", { className: "astw:flex astw:w-[100%]", children: [
1421
1429
  s.icon,
1422
1430
  /* @__PURE__ */ a("span", { children: s.title })
1423
1431
  ] }) }),
1424
1432
  !!s.items?.length && /* @__PURE__ */ a(
1425
- xt,
1433
+ vt,
1426
1434
  {
1427
1435
  className: "astw-rotate-target",
1428
1436
  asChild: !0,
1429
1437
  children: /* @__PURE__ */ d("span", { children: [
1430
- /* @__PURE__ */ a(Q, {}),
1438
+ /* @__PURE__ */ a(q, {}),
1431
1439
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
1432
1440
  ] })
1433
1441
  }
1434
1442
  )
1435
1443
  ] }) }),
1436
- !!s.items?.length && /* @__PURE__ */ a(We, { children: /* @__PURE__ */ a(aa, { children: s.items?.map((r) => /* @__PURE__ */ a(sa, { children: /* @__PURE__ */ a(ra, { asChild: !0, children: /* @__PURE__ */ a(
1437
- q,
1444
+ !!s.items?.length && /* @__PURE__ */ a(je, { children: /* @__PURE__ */ a(sa, { children: s.items?.map((r) => /* @__PURE__ */ a(ra, { children: /* @__PURE__ */ a(na, { asChild: !0, children: /* @__PURE__ */ a(
1445
+ G,
1438
1446
  {
1439
1447
  to: r.url,
1440
1448
  className: r.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
@@ -1442,7 +1450,7 @@ const da = () => {
1442
1450
  }
1443
1451
  ) }) }, r.title)) }) })
1444
1452
  ] }) }, s.title)) }) });
1445
- }, ma = () => {
1453
+ }, ha = () => {
1446
1454
  const e = [...[112, 96, 80, 104, 88, 100, 92, 84]].sort(() => Math.random() - 0.5);
1447
1455
  return /* @__PURE__ */ a(Vt, { children: /* @__PURE__ */ a(Ht, { className: "astw:px-2", children: e.map((s, r) => /* @__PURE__ */ a(Ut, { children: /* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
1448
1456
  /* @__PURE__ */ a("div", { className: "astw:h-4 astw:w-4 astw:rounded-md astw:bg-muted" }),
@@ -1454,39 +1462,39 @@ const da = () => {
1454
1462
  }
1455
1463
  )
1456
1464
  ] }) }, r)) }) });
1457
- }, ha = () => {
1458
- const { configurations: t } = P(), e = Rt();
1459
- return la(
1465
+ }, fa = () => {
1466
+ const { configurations: t } = L(), e = Et();
1467
+ return da(
1460
1468
  e.pathname,
1461
1469
  t.basePath,
1462
1470
  t.modules,
1463
1471
  t.locale
1464
1472
  );
1465
- }, fa = () => {
1466
- const { segments: t } = ha(), e = oe("/:prefix/settings/:suffix"), s = L();
1467
- return e ? /* @__PURE__ */ a(vt, { children: /* @__PURE__ */ a(yt, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(Nt, { children: /* @__PURE__ */ a(Ct, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(vt, { children: /* @__PURE__ */ a(yt, { children: t.map((r, n) => /* @__PURE__ */ d(
1473
+ }, ga = () => {
1474
+ const { segments: t } = fa(), e = oe("/:prefix/settings/:suffix"), s = P();
1475
+ return e ? /* @__PURE__ */ a(yt, { children: /* @__PURE__ */ a(Nt, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(Ct, { children: /* @__PURE__ */ a(St, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(yt, { children: /* @__PURE__ */ a(Nt, { children: t.map((r, n) => /* @__PURE__ */ d(
1468
1476
  "div",
1469
1477
  {
1470
1478
  className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground",
1471
1479
  children: [
1472
- /* @__PURE__ */ a(Nt, { children: /* @__PURE__ */ a(Ct, { to: r.path, children: r.title }) }),
1473
- n < t.length - 1 && /* @__PURE__ */ a(na, {})
1480
+ /* @__PURE__ */ a(Ct, { children: /* @__PURE__ */ a(St, { to: r.path, children: r.title }) }),
1481
+ n < t.length - 1 && /* @__PURE__ */ a(oa, {})
1474
1482
  ]
1475
1483
  },
1476
1484
  n
1477
1485
  )) }) });
1478
1486
  };
1479
- function ga({
1487
+ function pa({
1480
1488
  ...t
1481
1489
  }) {
1482
1490
  return /* @__PURE__ */ a(b.Root, { "data-slot": "dialog", ...t });
1483
1491
  }
1484
- function pa({
1492
+ function ba({
1485
1493
  ...t
1486
1494
  }) {
1487
1495
  return /* @__PURE__ */ a(b.Portal, { "data-slot": "dialog-portal", ...t });
1488
1496
  }
1489
- function ba({
1497
+ function xa({
1490
1498
  className: t,
1491
1499
  ...e
1492
1500
  }) {
@@ -1502,13 +1510,13 @@ function ba({
1502
1510
  }
1503
1511
  );
1504
1512
  }
1505
- function xa({
1513
+ function va({
1506
1514
  className: t,
1507
1515
  children: e,
1508
1516
  ...s
1509
1517
  }) {
1510
- return /* @__PURE__ */ d(pa, { "data-slot": "dialog-portal", children: [
1511
- /* @__PURE__ */ a(ba, {}),
1518
+ return /* @__PURE__ */ d(ba, { "data-slot": "dialog-portal", children: [
1519
+ /* @__PURE__ */ a(xa, {}),
1512
1520
  /* @__PURE__ */ d(
1513
1521
  b.Content,
1514
1522
  {
@@ -1521,7 +1529,7 @@ function xa({
1521
1529
  children: [
1522
1530
  e,
1523
1531
  /* @__PURE__ */ d(b.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-accent astw:data-[state=open]:text-muted-foreground astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none astw:[&_svg]:pointer-events-none astw:[&_svg]:shrink-0 astw:[&_svg:not([class*='size-'])]:size-4", children: [
1524
- /* @__PURE__ */ a(Bt, {}),
1532
+ /* @__PURE__ */ a(Dt, {}),
1525
1533
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
1526
1534
  ] })
1527
1535
  ]
@@ -1529,7 +1537,7 @@ function xa({
1529
1537
  )
1530
1538
  ] });
1531
1539
  }
1532
- function va({
1540
+ function ya({
1533
1541
  className: t,
1534
1542
  ...e
1535
1543
  }) {
@@ -1542,7 +1550,7 @@ function va({
1542
1550
  }
1543
1551
  );
1544
1552
  }
1545
- function ya(t) {
1553
+ function Na(t) {
1546
1554
  const e = [], s = (r, n, o) => {
1547
1555
  r.forEach((i) => {
1548
1556
  const l = [...o, i.title];
@@ -1563,11 +1571,11 @@ function ya(t) {
1563
1571
  }), s(r.items, r.icon, [r.title]);
1564
1572
  }), e;
1565
1573
  }
1566
- function Na({
1574
+ function Ca({
1567
1575
  routes: t
1568
1576
  }) {
1569
1577
  const e = ie(), s = pe(null), [r, n] = R(!1), [o, i] = R(""), [l, u] = R(0), w = k(
1570
- () => oa(t, o),
1578
+ () => ia(t, o),
1571
1579
  [t, o]
1572
1580
  );
1573
1581
  y(() => {
@@ -1582,12 +1590,12 @@ function Na({
1582
1590
  }, [r]), y(() => {
1583
1591
  s.current && s.current.querySelector(`[data-index="${l}"]`)?.scrollIntoView({ block: "nearest" });
1584
1592
  }, [l]);
1585
- const c = ct(
1593
+ const c = wt(
1586
1594
  (f) => {
1587
1595
  e(f.path), n(!1), i("");
1588
1596
  },
1589
1597
  [e]
1590
- ), h = ct(
1598
+ ), h = wt(
1591
1599
  (f) => {
1592
1600
  if (!f.nativeEvent.isComposing)
1593
1601
  switch (f.key) {
@@ -1618,10 +1626,10 @@ function Na({
1618
1626
  listRef: s
1619
1627
  };
1620
1628
  }
1621
- function Ca({
1629
+ function Sa({
1622
1630
  navItems: t
1623
1631
  }) {
1624
- const e = L(), s = k(() => ya(t), [t]), {
1632
+ const e = P(), s = k(() => Na(t), [t]), {
1625
1633
  open: r,
1626
1634
  setOpen: n,
1627
1635
  search: o,
@@ -1631,19 +1639,19 @@ function Ca({
1631
1639
  handleSelect: w,
1632
1640
  handleKeyDown: c,
1633
1641
  listRef: h
1634
- } = Na({ routes: s });
1635
- return /* @__PURE__ */ a(ga, { open: r, onOpenChange: n, children: /* @__PURE__ */ d(
1636
- xa,
1642
+ } = Ca({ routes: s });
1643
+ return /* @__PURE__ */ a(pa, { open: r, onOpenChange: n, children: /* @__PURE__ */ d(
1644
+ va,
1637
1645
  {
1638
1646
  className: "astw:p-0 astw:gap-0 astw:sm:max-w-2xl astw:overflow-hidden",
1639
1647
  onKeyDown: c,
1640
1648
  "aria-describedby": void 0,
1641
1649
  children: [
1642
- /* @__PURE__ */ a(va, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
1650
+ /* @__PURE__ */ a(ya, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
1643
1651
  /* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:border-b astw:px-3 astw:py-1", children: [
1644
1652
  /* @__PURE__ */ a(me, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
1645
1653
  /* @__PURE__ */ a(
1646
- Ve,
1654
+ He,
1647
1655
  {
1648
1656
  value: o,
1649
1657
  onChange: (f) => i(f.target.value),
@@ -1683,17 +1691,17 @@ function Ca({
1683
1691
  }
1684
1692
  ) });
1685
1693
  }
1686
- function ms() {
1694
+ function hs() {
1687
1695
  const t = Ft();
1688
- return /* @__PURE__ */ a(Dt, { fallback: null, children: /* @__PURE__ */ a(Et, { resolve: t, children: (e) => /* @__PURE__ */ a(Ca, { navItems: e ?? [] }) }) });
1696
+ return /* @__PURE__ */ a(Lt, { fallback: null, children: /* @__PURE__ */ a(Bt, { resolve: t, children: (e) => /* @__PURE__ */ a(Sa, { navItems: e ?? [] }) }) });
1689
1697
  }
1690
- const Qt = W(null), hs = (t) => {
1698
+ const Qt = W(null), fs = (t) => {
1691
1699
  const e = k(
1692
- () => ve({
1700
+ () => ye({
1693
1701
  clientId: t.clientId,
1694
1702
  appUri: t.apiEndpoint,
1695
1703
  redirectUri: t.redirectUri,
1696
- meQuery: t.meQuery && (typeof t.meQuery == "string" ? t.meQuery : xe(t.meQuery))
1704
+ meQuery: t.meQuery && (typeof t.meQuery == "string" ? t.meQuery : ve(t.meQuery))
1697
1705
  }),
1698
1706
  [t.clientId, t.apiEndpoint, t.redirectUri, t.meQuery]
1699
1707
  ), [s, r] = R(
@@ -1721,12 +1729,12 @@ const Qt = W(null), hs = (t) => {
1721
1729
  children: n
1722
1730
  }
1723
1731
  );
1724
- }, fs = () => {
1732
+ }, gs = () => {
1725
1733
  const t = D(Qt);
1726
1734
  if (!t)
1727
1735
  throw new Error("useAuth must be used within an AuthProvider");
1728
1736
  return t;
1729
- }, Sa = Y(
1737
+ }, ps = () => xe, Ta = X(
1730
1738
  "astw:inline-flex astw:items-center astw:rounded-md astw:border astw:px-2 astw:py-0.5 astw:text-xs astw:font-medium astw:transition-colors astw:focus:outline-none astw:focus:ring-2 astw:focus:ring-ring astw:focus:ring-offset-2",
1731
1739
  {
1732
1740
  variants: {
@@ -1748,38 +1756,38 @@ const Qt = W(null), hs = (t) => {
1748
1756
  variant: "default"
1749
1757
  }
1750
1758
  }
1751
- ), Ta = {
1759
+ ), ka = {
1752
1760
  "outline-success": "astw:bg-green-500",
1753
1761
  "outline-warning": "astw:bg-orange-500",
1754
1762
  "outline-error": "astw:bg-red-500",
1755
1763
  "outline-info": "astw:bg-blue-500",
1756
1764
  "outline-neutral": "astw:bg-neutral-400"
1757
1765
  };
1758
- function ka({ variant: t }) {
1759
- const e = Ta[t];
1766
+ function Ra({ variant: t }) {
1767
+ const e = ka[t];
1760
1768
  return e ? /* @__PURE__ */ a("div", { className: "astw:size-3 astw:shrink-0 astw:flex astw:items-center astw:justify-center", children: /* @__PURE__ */ a("div", { className: m("astw:size-[7px] astw:rounded-full", e) }) }) : null;
1761
1769
  }
1762
- function Ra({ className: t, variant: e, children: s, ...r }) {
1770
+ function Ea({ className: t, variant: e, children: s, ...r }) {
1763
1771
  const n = e?.toString().startsWith("outline-");
1764
1772
  return /* @__PURE__ */ d(
1765
1773
  "div",
1766
1774
  {
1767
- className: m(Sa({ variant: e }), t),
1775
+ className: m(Ta({ variant: e }), t),
1768
1776
  ...r,
1769
1777
  children: [
1770
- n && /* @__PURE__ */ a(ka, { variant: e }),
1778
+ n && /* @__PURE__ */ a(Ra, { variant: e }),
1771
1779
  s
1772
1780
  ]
1773
1781
  }
1774
1782
  );
1775
1783
  }
1776
- function Ea(t) {
1784
+ function Ba(t) {
1777
1785
  return t.type === "divider";
1778
1786
  }
1779
- function Ba(t) {
1787
+ function Da(t) {
1780
1788
  return t.type !== "divider" && "key" in t;
1781
1789
  }
1782
- function K(t, e) {
1790
+ function V(t, e) {
1783
1791
  return e.split(".").reduce((s, r) => {
1784
1792
  if (s && typeof s == "object" && r in s)
1785
1793
  return s[r];
@@ -1788,7 +1796,7 @@ function K(t, e) {
1788
1796
  function v(t) {
1789
1797
  return t == null || t === "";
1790
1798
  }
1791
- function Da(t) {
1799
+ function La(t) {
1792
1800
  return t.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase());
1793
1801
  }
1794
1802
  function Pa(t, e = "medium") {
@@ -1823,7 +1831,7 @@ function Pa(t, e = "medium") {
1823
1831
  return s.toLocaleDateString();
1824
1832
  }
1825
1833
  }
1826
- function La(t, e) {
1834
+ function Ma(t, e) {
1827
1835
  if (v(t)) return "";
1828
1836
  const s = typeof t == "number" ? t : parseFloat(String(t));
1829
1837
  if (isNaN(s)) return String(t);
@@ -1836,7 +1844,7 @@ function La(t, e) {
1836
1844
  return `${e || "$"}${s.toFixed(2)}`;
1837
1845
  }
1838
1846
  }
1839
- function Ma(t) {
1847
+ function Ia(t) {
1840
1848
  if (v(t)) return [];
1841
1849
  if (typeof t == "string")
1842
1850
  return t.split(/[,\n]/).map((e) => e.trim()).filter(Boolean);
@@ -1854,8 +1862,8 @@ function Ma(t) {
1854
1862
  }
1855
1863
  function qt({ value: t }) {
1856
1864
  const [e, s] = p.useState(!1);
1857
- return /* @__PURE__ */ d(rt, { children: [
1858
- /* @__PURE__ */ a(nt, { asChild: !0, children: /* @__PURE__ */ a(
1865
+ return /* @__PURE__ */ d(nt, { children: [
1866
+ /* @__PURE__ */ a(ot, { asChild: !0, children: /* @__PURE__ */ a(
1859
1867
  "button",
1860
1868
  {
1861
1869
  onClick: async (n) => {
@@ -1869,11 +1877,11 @@ function qt({ value: t }) {
1869
1877
  children: e ? /* @__PURE__ */ a(fe, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(ge, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 })
1870
1878
  }
1871
1879
  ) }),
1872
- /* @__PURE__ */ a(ot, { side: "top", children: e ? "Copied!" : "Copy" })
1880
+ /* @__PURE__ */ a(it, { side: "top", children: e ? "Copied!" : "Copy" })
1873
1881
  ] });
1874
1882
  }
1875
1883
  const N = "–";
1876
- function Ia({ field: t }) {
1884
+ function Aa({ field: t }) {
1877
1885
  const e = v(t.value) ? N : String(t.value), s = t.meta?.copyable && !v(t.value), r = t.meta?.truncateLines, n = p.useRef(null), [o, i] = p.useState(!1);
1878
1886
  p.useEffect(() => {
1879
1887
  if (!r) {
@@ -1907,33 +1915,33 @@ function Ia({ field: t }) {
1907
1915
  ),
1908
1916
  s && /* @__PURE__ */ a(qt, { value: String(t.value) })
1909
1917
  ] });
1910
- return r && o ? /* @__PURE__ */ d(rt, { children: [
1911
- /* @__PURE__ */ a(nt, { asChild: !0, children: /* @__PURE__ */ a("span", { className: "astw:cursor-default", children: u }) }),
1912
- /* @__PURE__ */ a(ot, { side: "bottom", style: { maxWidth: 320 }, children: /* @__PURE__ */ a("p", { className: "astw:text-sm", children: e }) })
1918
+ return r && o ? /* @__PURE__ */ d(nt, { children: [
1919
+ /* @__PURE__ */ a(ot, { asChild: !0, children: /* @__PURE__ */ a("span", { className: "astw:cursor-default", children: u }) }),
1920
+ /* @__PURE__ */ a(it, { side: "bottom", style: { maxWidth: 320 }, children: /* @__PURE__ */ a("p", { className: "astw:text-sm", children: e }) })
1913
1921
  ] }) : u;
1914
1922
  }
1915
- function Aa({ field: t }) {
1923
+ function _a({ field: t }) {
1916
1924
  if (v(t.value))
1917
1925
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1918
1926
  const e = String(t.value), s = t.meta?.badgeVariantMap || {}, r = e.toLowerCase(), n = s[e] || s[r] || "outline-neutral";
1919
- return /* @__PURE__ */ a(Ra, { variant: n, className: "astw:w-fit", children: Da(e) });
1927
+ return /* @__PURE__ */ a(Ea, { variant: n, className: "astw:w-fit", children: La(e) });
1920
1928
  }
1921
- function _a({ field: t }) {
1929
+ function za({ field: t }) {
1922
1930
  if (v(t.value))
1923
1931
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1924
- const e = t.meta?.currencyKey || "currency", s = K(t.data, e), r = La(t.value, s);
1932
+ const e = t.meta?.currencyKey || "currency", s = V(t.data, e), r = Ma(t.value, s);
1925
1933
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:tabular-nums", children: r });
1926
1934
  }
1927
- function za({ field: t }) {
1935
+ function Fa({ field: t }) {
1928
1936
  if (v(t.value))
1929
1937
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1930
1938
  const e = t.meta?.dateFormat || "medium", s = Pa(t.value, e);
1931
1939
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: s });
1932
1940
  }
1933
- function Fa({ field: t }) {
1941
+ function Oa({ field: t }) {
1934
1942
  if (v(t.value))
1935
1943
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1936
- const e = t.meta?.hrefKey, s = e ? K(t.data, e) : void 0, r = t.meta?.external ?? !1, n = String(t.value);
1944
+ const e = t.meta?.hrefKey, s = e ? V(t.data, e) : void 0, r = t.meta?.external ?? !1, n = String(t.value);
1937
1945
  return s ? /* @__PURE__ */ d(
1938
1946
  "a",
1939
1947
  {
@@ -1948,10 +1956,10 @@ function Fa({ field: t }) {
1948
1956
  }
1949
1957
  ) : /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
1950
1958
  }
1951
- function Oa({ field: t }) {
1959
+ function $a({ field: t }) {
1952
1960
  if (v(t.value))
1953
1961
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1954
- const e = Ma(t.value), s = t.meta?.copyable && !v(t.value), r = e.join(`
1962
+ const e = Ia(t.value), s = t.meta?.copyable && !v(t.value), r = e.join(`
1955
1963
  `);
1956
1964
  return /* @__PURE__ */ d("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
1957
1965
  /* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((n, o) => /* @__PURE__ */ d(p.Fragment, { children: [
@@ -1961,45 +1969,45 @@ function Oa({ field: t }) {
1961
1969
  s && /* @__PURE__ */ a(qt, { value: r })
1962
1970
  ] });
1963
1971
  }
1964
- function $a({ field: t }) {
1972
+ function Wa({ field: t }) {
1965
1973
  if (v(t.value))
1966
1974
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1967
- const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, r = e ? K(t.data, e) : void 0, n = String(t.value);
1975
+ const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, r = e ? V(t.data, e) : void 0, n = String(t.value);
1968
1976
  if (!r || !s)
1969
1977
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
1970
1978
  const o = s.replace("{id}", r);
1971
1979
  return /* @__PURE__ */ a("a", { href: o, className: "astw:text-sm astw:text-primary astw:hover:underline", children: n });
1972
1980
  }
1973
- function St(t) {
1981
+ function Tt(t) {
1974
1982
  switch (t.type) {
1975
1983
  case "text":
1976
- return /* @__PURE__ */ a(Ia, { field: t });
1977
- case "badge":
1978
1984
  return /* @__PURE__ */ a(Aa, { field: t });
1979
- case "money":
1985
+ case "badge":
1980
1986
  return /* @__PURE__ */ a(_a, { field: t });
1981
- case "date":
1987
+ case "money":
1982
1988
  return /* @__PURE__ */ a(za, { field: t });
1983
- case "link":
1989
+ case "date":
1984
1990
  return /* @__PURE__ */ a(Fa, { field: t });
1985
- case "address":
1991
+ case "link":
1986
1992
  return /* @__PURE__ */ a(Oa, { field: t });
1987
- case "reference":
1993
+ case "address":
1988
1994
  return /* @__PURE__ */ a($a, { field: t });
1995
+ case "reference":
1996
+ return /* @__PURE__ */ a(Wa, { field: t });
1989
1997
  default:
1990
1998
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
1991
1999
  }
1992
2000
  }
1993
- function Wa(t) {
2001
+ function ja(t) {
1994
2002
  if (t.emptyBehavior !== "hide") return !1;
1995
2003
  const e = t.value;
1996
2004
  return e == null || e === "";
1997
2005
  }
1998
- function ja(t) {
2006
+ function Ka(t) {
1999
2007
  return !1;
2000
2008
  }
2001
- function Ka(t, e, s) {
2002
- const r = K(e, t.key);
2009
+ function Va(t, e, s) {
2010
+ const r = V(e, t.key);
2003
2011
  return {
2004
2012
  id: `${t.key}-${s}`,
2005
2013
  label: t.label,
@@ -2010,19 +2018,19 @@ function Ka(t, e, s) {
2010
2018
  data: e
2011
2019
  };
2012
2020
  }
2013
- function Va(t, e) {
2021
+ function Ha(t, e) {
2014
2022
  const s = [];
2015
2023
  let r = [], n = 0, o = 0;
2016
2024
  for (const i of t)
2017
- if (Ea(i))
2025
+ if (Ba(i))
2018
2026
  r.length > 0 && (s.push({ id: `section-${n}`, fields: r }), n++, r = []);
2019
- else if (Ba(i)) {
2020
- const l = Ka(i, e, o);
2021
- o++, Wa(l) || r.push(l);
2027
+ else if (Da(i)) {
2028
+ const l = Va(i, e, o);
2029
+ o++, ja(l) || r.push(l);
2022
2030
  }
2023
2031
  return r.length > 0 && s.push({ id: `section-${n}`, fields: r }), s;
2024
2032
  }
2025
- function Tt({ label: t, children: e, fullWidth: s }) {
2033
+ function kt({ label: t, children: e, fullWidth: s }) {
2026
2034
  return /* @__PURE__ */ d(
2027
2035
  "div",
2028
2036
  {
@@ -2037,7 +2045,7 @@ function Tt({ label: t, children: e, fullWidth: s }) {
2037
2045
  }
2038
2046
  );
2039
2047
  }
2040
- function gs({
2048
+ function bs({
2041
2049
  data: t,
2042
2050
  title: e,
2043
2051
  fields: s,
@@ -2045,7 +2053,7 @@ function gs({
2045
2053
  className: n,
2046
2054
  headerAction: o
2047
2055
  }) {
2048
- const i = Va(s, t), l = i.some((c) => c.fields.length > 0), u = m(
2056
+ const i = Ha(s, t), l = i.some((c) => c.fields.length > 0), u = m(
2049
2057
  "astw:grid astw:gap-x-6 astw:gap-y-4",
2050
2058
  // Default: 1 column
2051
2059
  "astw:grid-cols-1",
@@ -2058,13 +2066,13 @@ function gs({
2058
2066
  "astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3"
2059
2067
  )
2060
2068
  ), w = (c) => {
2061
- const h = c.fields.filter((g) => !0), f = c.fields.filter((g) => ja());
2069
+ const h = c.fields.filter((g) => !0), f = c.fields.filter((g) => Ka());
2062
2070
  return /* @__PURE__ */ d("div", { className: "astw:space-y-4", children: [
2063
- h.length > 0 && /* @__PURE__ */ a("div", { className: u, children: h.map((g) => /* @__PURE__ */ a(Tt, { label: g.label, children: St(g) }, g.id)) }),
2064
- f.length > 0 && /* @__PURE__ */ a("div", { className: u, children: f.map((g) => /* @__PURE__ */ a(Tt, { label: g.label, fullWidth: !0, children: St(g) }, g.id)) })
2071
+ h.length > 0 && /* @__PURE__ */ a("div", { className: u, children: h.map((g) => /* @__PURE__ */ a(kt, { label: g.label, children: Tt(g) }, g.id)) }),
2072
+ f.length > 0 && /* @__PURE__ */ a("div", { className: u, children: f.map((g) => /* @__PURE__ */ a(kt, { label: g.label, fullWidth: !0, children: Tt(g) }, g.id)) })
2065
2073
  ] }, c.id);
2066
2074
  };
2067
- return /* @__PURE__ */ a(st, { delayDuration: 300, children: /* @__PURE__ */ d(
2075
+ return /* @__PURE__ */ a(rt, { delayDuration: 300, children: /* @__PURE__ */ d(
2068
2076
  "div",
2069
2077
  {
2070
2078
  className: m(
@@ -2084,7 +2092,7 @@ function gs({
2084
2092
  }
2085
2093
  ) });
2086
2094
  }
2087
- const it = p.forwardRef(
2095
+ const lt = p.forwardRef(
2088
2096
  ({ className: t, children: e, ...s }, r) => /* @__PURE__ */ a(
2089
2097
  "div",
2090
2098
  {
@@ -2095,8 +2103,8 @@ const it = p.forwardRef(
2095
2103
  }
2096
2104
  )
2097
2105
  );
2098
- it.displayName = "Layout.Column";
2099
- function Ha({
2106
+ lt.displayName = "Layout.Column";
2107
+ function Ua({
2100
2108
  columns: t,
2101
2109
  className: e,
2102
2110
  gap: s = 4,
@@ -2105,7 +2113,7 @@ function Ha({
2105
2113
  children: o
2106
2114
  }) {
2107
2115
  if (process.env.NODE_ENV !== "production") {
2108
- const h = p.Children.toArray(o).reduce((f, g) => p.isValidElement(g) && g.type === it ? f + 1 : f, 0);
2116
+ const h = p.Children.toArray(o).reduce((f, g) => p.isValidElement(g) && g.type === lt ? f + 1 : f, 0);
2109
2117
  if (h !== t)
2110
2118
  throw new Error(
2111
2119
  `Layout: Expected exactly ${t} Layout.Column child${t === 1 ? "" : "ren"}, but found ${h}. Please ensure the number of <Layout.Column> children matches the \`columns={${t}}\` prop.`
@@ -2157,32 +2165,33 @@ function Ha({
2157
2165
  /* @__PURE__ */ a("div", { style: { padding: w ? "0 1.5rem 1.5rem 1.5rem" : "1.5rem" }, children: /* @__PURE__ */ a("div", { className: l, children: u }) })
2158
2166
  ] });
2159
2167
  }
2160
- Ha.Column = it;
2168
+ Ua.Column = lt;
2161
2169
  export {
2162
- ws as AppShell,
2163
- hs as AuthProvider,
2164
- Ra as Badge,
2165
- ms as CommandPalette,
2166
- ca as DefaultSidebar,
2167
- gs as DescriptionCard,
2168
- Ha as Layout,
2169
- xs as Link,
2170
- us as SidebarLayout,
2171
- Sa as badgeVariants,
2172
- ke as defineI18nLabels,
2173
- ds as defineModule,
2174
- cs as defineResource,
2175
- is as hidden,
2176
- os as pass,
2177
- ls as redirectTo,
2178
- Se as useAppShell,
2179
- P as useAppShellConfig,
2180
- ns as useAppShellData,
2181
- fs as useAuth,
2182
- vs as useLocation,
2183
- ys as useNavigate,
2184
- Ns as useParams,
2185
- Cs as useRouteError,
2186
- Ss as useSearchParams,
2187
- Oe as useTheme
2170
+ us as AppShell,
2171
+ fs as AuthProvider,
2172
+ Ea as Badge,
2173
+ hs as CommandPalette,
2174
+ wa as DefaultSidebar,
2175
+ bs as DescriptionCard,
2176
+ Ua as Layout,
2177
+ ys as Link,
2178
+ ms as SidebarLayout,
2179
+ Ta as badgeVariants,
2180
+ Re as defineI18nLabels,
2181
+ cs as defineModule,
2182
+ ws as defineResource,
2183
+ ls as hidden,
2184
+ is as pass,
2185
+ ds as redirectTo,
2186
+ Te as useAppShell,
2187
+ L as useAppShellConfig,
2188
+ os as useAppShellData,
2189
+ gs as useAuth,
2190
+ Ns as useLocation,
2191
+ Cs as useNavigate,
2192
+ Ss as useParams,
2193
+ Ts as useRouteError,
2194
+ ks as useSearchParams,
2195
+ $e as useTheme,
2196
+ ps as useToast
2188
2197
  };