@carlonicora/nextjs-jsonapi 1.131.1 → 1.132.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.
Files changed (79) hide show
  1. package/dist/{BlockNoteEditor-BR3IRGJW.js → BlockNoteEditor-JAELO23S.js} +19 -19
  2. package/dist/{BlockNoteEditor-BR3IRGJW.js.map → BlockNoteEditor-JAELO23S.js.map} +1 -1
  3. package/dist/{BlockNoteEditor-PVBZYPMF.mjs → BlockNoteEditor-WZFEJS2B.mjs} +4 -4
  4. package/dist/billing/index.js +357 -357
  5. package/dist/billing/index.mjs +3 -3
  6. package/dist/{chunk-LBMNRFCY.js → chunk-5IE6DZ2D.js} +153 -77
  7. package/dist/chunk-5IE6DZ2D.js.map +1 -0
  8. package/dist/{chunk-MDXT47V4.mjs → chunk-67LIVKYU.mjs} +198 -203
  9. package/dist/chunk-67LIVKYU.mjs.map +1 -0
  10. package/dist/{chunk-5MNE72ZE.mjs → chunk-DZL2G7NB.mjs} +77 -1
  11. package/dist/chunk-DZL2G7NB.mjs.map +1 -0
  12. package/dist/{chunk-XTLTQQ7X.js → chunk-F6KBHC2X.js} +7 -7
  13. package/dist/{chunk-XTLTQQ7X.js.map → chunk-F6KBHC2X.js.map} +1 -1
  14. package/dist/{chunk-5SQFK35K.js → chunk-MP5VURBB.js} +1028 -1033
  15. package/dist/chunk-MP5VURBB.js.map +1 -0
  16. package/dist/{chunk-NATPK5ME.mjs → chunk-VSAAVVHY.mjs} +2 -2
  17. package/dist/client/index.js +4 -4
  18. package/dist/client/index.mjs +3 -3
  19. package/dist/components/index.d.mts +3 -2
  20. package/dist/components/index.d.ts +3 -2
  21. package/dist/components/index.js +4 -4
  22. package/dist/components/index.mjs +3 -3
  23. package/dist/contexts/index.d.mts +9 -2
  24. package/dist/contexts/index.d.ts +9 -2
  25. package/dist/contexts/index.js +6 -4
  26. package/dist/contexts/index.js.map +1 -1
  27. package/dist/contexts/index.mjs +5 -3
  28. package/dist/core/index.d.mts +11 -1
  29. package/dist/core/index.d.ts +11 -1
  30. package/dist/core/index.js +12 -2
  31. package/dist/core/index.js.map +1 -1
  32. package/dist/core/index.mjs +13 -3
  33. package/dist/features/help/index.js +39 -39
  34. package/dist/features/help/index.js.map +1 -1
  35. package/dist/features/help/index.mjs +5 -5
  36. package/dist/features/help/index.mjs.map +1 -1
  37. package/dist/index.d.mts +1 -1
  38. package/dist/index.d.ts +1 -1
  39. package/dist/index.js +13 -3
  40. package/dist/index.js.map +1 -1
  41. package/dist/index.mjs +14 -4
  42. package/dist/server/index.js +3 -3
  43. package/dist/server/index.mjs +1 -1
  44. package/package.json +1 -1
  45. package/src/components/containers/ReactMarkdownContainer.tsx +1 -1
  46. package/src/components/containers/RoundPageContainer.tsx +7 -0
  47. package/src/components/forms/EditorSheet.tsx +24 -1
  48. package/src/components/forms/FormDateTime.tsx +5 -0
  49. package/src/components/navigations/Breadcrumb.tsx +13 -11
  50. package/src/components/navigations/Header.tsx +3 -1
  51. package/src/contexts/HeaderChildrenContext.tsx +17 -2
  52. package/src/features/assistant-message/components/MessageItem.tsx +1 -1
  53. package/src/features/auth/components/GdprConsentSection.tsx +2 -2
  54. package/src/features/auth/components/forms/Register.tsx +2 -2
  55. package/src/features/help/components/HelpArticleBody.tsx +2 -2
  56. package/src/features/notification/components/common/NotificationErrorBoundary.tsx +1 -4
  57. package/src/features/notification/contexts/__tests__/NotificationContext.spec.tsx +34 -8
  58. package/src/features/oauth/components/consent/OAuthConsentScreen.tsx +2 -2
  59. package/src/features/user/contexts/CurrentUserContext.tsx +43 -9
  60. package/src/features/user/contexts/__tests__/CurrentUserContext.spec.tsx +149 -6
  61. package/src/features/waitlist/components/forms/WaitlistForm.tsx +2 -2
  62. package/src/features/waitlist/components/lists/WaitlistList.tsx +13 -2
  63. package/src/shadcnui/custom/link.tsx +1 -1
  64. package/src/shadcnui/ui/accordion.tsx +1 -1
  65. package/src/shadcnui/ui/alert-dialog.tsx +1 -1
  66. package/src/shadcnui/ui/alert.tsx +2 -5
  67. package/src/shadcnui/ui/badge.tsx +1 -1
  68. package/src/shadcnui/ui/button.tsx +1 -1
  69. package/src/shadcnui/ui/dialog.tsx +1 -4
  70. package/src/shadcnui/ui/field.tsx +1 -1
  71. package/src/utils/__tests__/italian-validators.test.ts +63 -0
  72. package/src/utils/index.ts +8 -0
  73. package/src/utils/italian-validators.ts +18 -5
  74. package/dist/chunk-5MNE72ZE.mjs.map +0 -1
  75. package/dist/chunk-5SQFK35K.js.map +0 -1
  76. package/dist/chunk-LBMNRFCY.js.map +0 -1
  77. package/dist/chunk-MDXT47V4.mjs.map +0 -1
  78. /package/dist/{BlockNoteEditor-PVBZYPMF.mjs.map → BlockNoteEditor-WZFEJS2B.mjs.map} +0 -0
  79. /package/dist/{chunk-NATPK5ME.mjs.map → chunk-VSAAVVHY.mjs.map} +0 -0
@@ -20,7 +20,7 @@ import {
20
20
  useI18nLocale,
21
21
  useI18nRouter,
22
22
  useI18nTranslations
23
- } from "./chunk-NATPK5ME.mjs";
23
+ } from "./chunk-VSAAVVHY.mjs";
24
24
  import {
25
25
  AVAILABLE_OAUTH_SCOPES,
26
26
  AssistantMessage,
@@ -59,8 +59,10 @@ import {
59
59
  showError,
60
60
  showToast,
61
61
  useComposedRefs,
62
- useIsMobile
63
- } from "./chunk-5MNE72ZE.mjs";
62
+ useIsMobile,
63
+ validateItalianTaxCode,
64
+ validatePartitaIva
65
+ } from "./chunk-DZL2G7NB.mjs";
64
66
  import {
65
67
  JsonApiContext
66
68
  } from "./chunk-VOXD3ZLY.mjs";
@@ -136,7 +138,7 @@ function AccordionContent({ className, children, ...props }) {
136
138
  "div",
137
139
  {
138
140
  className: cn(
139
- "pt-0 pb-4 [&_a]:hover:text-foreground h-(--accordion-panel-height) data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_p:not(:last-child)]:mb-4",
141
+ "pt-0 pb-4 [&_a]:hover:text-foreground h-(--accordion-panel-height) data-ending-style:h-0 data-starting-style:h-0 [&_p:not(:last-child)]:mb-4",
140
142
  className
141
143
  ),
142
144
  children
@@ -173,10 +175,7 @@ function AlertTitle({ className, ...props }) {
173
175
  "div",
174
176
  {
175
177
  "data-slot": "alert-title",
176
- className: cn(
177
- "text-sm font-medium group-has-[>svg]/alert:col-start-2 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3",
178
- className
179
- ),
178
+ className: cn("text-sm font-medium group-has-[>svg]/alert:col-start-2 [&_a]:hover:text-foreground", className),
180
179
  ...props
181
180
  }
182
181
  );
@@ -188,7 +187,7 @@ function AlertDescription({ className, ...props }) {
188
187
  {
189
188
  "data-slot": "alert-description",
190
189
  className: cn(
191
- "text-muted-foreground text-xs/relaxed text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3",
190
+ "text-muted-foreground text-xs/relaxed text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:hover:text-foreground",
192
191
  className
193
192
  ),
194
193
  ...props
@@ -218,7 +217,7 @@ var buttonVariants = cva2(
218
217
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
219
218
  ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",
220
219
  destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",
221
- link: "text-primary underline-offset-4 hover:underline"
220
+ link: "text-primary"
222
221
  },
223
222
  size: {
224
223
  default: "h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
@@ -362,7 +361,7 @@ function AlertDialogDescription({
362
361
  {
363
362
  "data-slot": "alert-dialog-description",
364
363
  className: cn(
365
- "text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",
364
+ "text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed text-balance md:text-pretty",
366
365
  className
367
366
  ),
368
367
  ...props
@@ -499,7 +498,7 @@ var badgeVariants = cva3(
499
498
  destructive: "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",
500
499
  outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/20 dark:bg-input/30",
501
500
  ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
502
- link: "text-primary underline-offset-4 hover:underline",
501
+ link: "text-primary",
503
502
  warning: "bg-warning text-warning-foreground [a]:hover:bg-warning/80",
504
503
  softGreen: "bg-green-500/10 text-green-700 dark:bg-green-500/15 dark:text-green-400",
505
504
  softRed: "bg-red-500/10 text-red-700 dark:bg-red-500/15 dark:text-red-400",
@@ -1807,10 +1806,7 @@ function DialogDescription({ className, ...props }) {
1807
1806
  DialogPrimitive.Description,
1808
1807
  {
1809
1808
  "data-slot": "dialog-description",
1810
- className: cn(
1811
- "text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed *:[a]:underline *:[a]:underline-offset-3",
1812
- className
1813
- ),
1809
+ className: cn("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed", className),
1814
1810
  ...props
1815
1811
  }
1816
1812
  );
@@ -2689,7 +2685,7 @@ function FieldDescription({ className, ...props }) {
2689
2685
  className: cn(
2690
2686
  "text-muted-foreground text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
2691
2687
  "last:mt-0 nth-last-2:-mt-1",
2692
- "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
2688
+ "[&>a:hover]:text-primary",
2693
2689
  className
2694
2690
  ),
2695
2691
  ...props
@@ -5309,7 +5305,7 @@ var Link = React10.forwardRef(({ className, href, children, ...props }, ref) =>
5309
5305
  prefetch: false,
5310
5306
  ref,
5311
5307
  href,
5312
- className: cn("text-primary font-medium hover:underline", className),
5308
+ className: cn("text-primary font-medium", className),
5313
5309
  ...props,
5314
5310
  children
5315
5311
  }
@@ -6356,10 +6352,11 @@ __name(TableCellAvatar, "TableCellAvatar");
6356
6352
  import { createContext as createContext6, useContext as useContext7 } from "react";
6357
6353
  import { jsx as jsx54 } from "react/jsx-runtime";
6358
6354
  var HeaderChildrenContext = createContext6({
6359
- headerChildren: null
6355
+ headerChildren: null,
6356
+ headerRootLabel: null
6360
6357
  });
6361
- function HeaderChildrenProvider({ children, content }) {
6362
- return /* @__PURE__ */ jsx54(HeaderChildrenContext.Provider, { value: { headerChildren: content }, children });
6358
+ function HeaderChildrenProvider({ children, content, rootLabel }) {
6359
+ return /* @__PURE__ */ jsx54(HeaderChildrenContext.Provider, { value: { headerChildren: content, headerRootLabel: rootLabel ?? null }, children });
6363
6360
  }
6364
6361
  __name(HeaderChildrenProvider, "HeaderChildrenProvider");
6365
6362
  function useHeaderChildren() {
@@ -6367,6 +6364,11 @@ function useHeaderChildren() {
6367
6364
  return context.headerChildren;
6368
6365
  }
6369
6366
  __name(useHeaderChildren, "useHeaderChildren");
6367
+ function useHeaderRootLabel() {
6368
+ const context = useContext7(HeaderChildrenContext);
6369
+ return context.headerRootLabel;
6370
+ }
6371
+ __name(useHeaderRootLabel, "useHeaderRootLabel");
6370
6372
 
6371
6373
  // src/contexts/HeaderLeftContentContext.tsx
6372
6374
  import { createContext as createContext7, useContext as useContext8 } from "react";
@@ -7490,7 +7492,7 @@ import { Fragment as Fragment19, createContext as createContext12, useContext as
7490
7492
  import { useAtom } from "jotai";
7491
7493
  import { atomWithStorage } from "jotai/utils";
7492
7494
  import { usePathname } from "next/navigation";
7493
- import { createContext as createContext9, useCallback as useCallback11, useContext as useContext10, useEffect as useEffect9, useRef as useRef10, useState as useState10 } from "react";
7495
+ import { createContext as createContext9, useCallback as useCallback11, useContext as useContext10, useEffect as useEffect9, useMemo as useMemo9, useRef as useRef10, useState as useState10 } from "react";
7494
7496
 
7495
7497
  // src/contexts/SocketContext.tsx
7496
7498
  import { createContext as createContext8, useContext as useContext9 } from "react";
@@ -7557,11 +7559,23 @@ var CurrentUserProvider = /* @__PURE__ */ __name(({ children }) => {
7557
7559
  const descriptor = Object.getOwnPropertyDescriptor(Modules, matchedModuleKey);
7558
7560
  return descriptor?.get?.call(Modules);
7559
7561
  }, "matchUrlToModule");
7560
- const currentUser = dehydratedUser ? rehydrate(Modules.User, dehydratedUser) : null;
7561
- const company = currentUser?.company ?? null;
7562
+ const currentUser = useMemo9(
7563
+ () => dehydratedUser ? rehydrate(Modules.User, dehydratedUser) : null,
7564
+ [dehydratedUser]
7565
+ );
7566
+ const [tokenOverride, setTokenOverride] = useState10(null);
7567
+ const company = useMemo9(() => {
7568
+ const c = currentUser?.company ?? null;
7569
+ if (!c || !tokenOverride) return c;
7570
+ return Object.assign(Object.create(Object.getPrototypeOf(c)), c, {
7571
+ _availableMonthlyTokens: tokenOverride.availableMonthlyTokens,
7572
+ _availableExtraTokens: tokenOverride.availableExtraTokens
7573
+ });
7574
+ }, [currentUser, tokenOverride]);
7562
7575
  const setUser = /* @__PURE__ */ __name((user) => {
7563
7576
  if (user) setDehydratedUser(user.dehydrate());
7564
7577
  else setDehydratedUser(null);
7578
+ setTokenOverride(null);
7565
7579
  }, "setUser");
7566
7580
  const hasRole = /* @__PURE__ */ __name((roleId) => {
7567
7581
  if (!currentUser) return false;
@@ -7618,6 +7632,7 @@ var CurrentUserProvider = /* @__PURE__ */ __name(({ children }) => {
7618
7632
  });
7619
7633
  }
7620
7634
  setDehydratedUser(fullUser.dehydrate());
7635
+ setTokenOverride(null);
7621
7636
  }
7622
7637
  } catch (error) {
7623
7638
  console.error("Failed to refresh user data:", error);
@@ -7635,19 +7650,26 @@ var CurrentUserProvider = /* @__PURE__ */ __name(({ children }) => {
7635
7650
  if (!socket || !isConnected || !currentUser?.company?.id) {
7636
7651
  return;
7637
7652
  }
7638
- const handleCompanyUpdate = /* @__PURE__ */ __name((data) => {
7653
+ const handleTokensUpdated = /* @__PURE__ */ __name((data) => {
7654
+ if (data.companyId !== currentUser.company?.id) return;
7655
+ setTokenOverride({
7656
+ availableMonthlyTokens: data.availableMonthlyTokens,
7657
+ availableExtraTokens: data.availableExtraTokens
7658
+ });
7659
+ }, "handleTokensUpdated");
7660
+ const handleSubscriptionUpdated = /* @__PURE__ */ __name((data) => {
7639
7661
  if (data.companyId === currentUser.company?.id && !isRefreshingRef.current) {
7640
7662
  isRefreshingRef.current = true;
7641
7663
  refreshUserRef.current({ skipCookieUpdate: true }).finally(() => {
7642
7664
  isRefreshingRef.current = false;
7643
7665
  });
7644
7666
  }
7645
- }, "handleCompanyUpdate");
7646
- socket.on("company:tokens_updated", handleCompanyUpdate);
7647
- socket.on("company:subscription_updated", handleCompanyUpdate);
7667
+ }, "handleSubscriptionUpdated");
7668
+ socket.on("company:tokens_updated", handleTokensUpdated);
7669
+ socket.on("company:subscription_updated", handleSubscriptionUpdated);
7648
7670
  return () => {
7649
- socket.off("company:tokens_updated", handleCompanyUpdate);
7650
- socket.off("company:subscription_updated", handleCompanyUpdate);
7671
+ socket.off("company:tokens_updated", handleTokensUpdated);
7672
+ socket.off("company:subscription_updated", handleSubscriptionUpdated);
7651
7673
  };
7652
7674
  }, [socket, isConnected, currentUser?.company?.id]);
7653
7675
  return /* @__PURE__ */ jsx58(
@@ -7854,7 +7876,7 @@ __name(UserDeleter, "UserDeleter");
7854
7876
  // src/features/user/components/forms/UserEditor.tsx
7855
7877
  import { zodResolver } from "@hookform/resolvers/zod";
7856
7878
  import { useTranslations as useTranslations5 } from "next-intl";
7857
- import { useCallback as useCallback12, useEffect as useEffect12, useMemo as useMemo9, useState as useState13 } from "react";
7879
+ import { useCallback as useCallback12, useEffect as useEffect12, useMemo as useMemo10, useState as useState13 } from "react";
7858
7880
  import { useForm } from "react-hook-form";
7859
7881
  import { v4 } from "uuid";
7860
7882
  import { z } from "zod";
@@ -7918,7 +7940,7 @@ function UserEditorInternal({
7918
7940
  setContentType(null);
7919
7941
  }
7920
7942
  }, [file, company]);
7921
- const formSchema = useMemo9(
7943
+ const formSchema = useMemo10(
7922
7944
  () => z.object({
7923
7945
  id: z.uuidv4(),
7924
7946
  name: z.string().min(1, { message: t(`user.fields.name.error`) }),
@@ -8126,7 +8148,7 @@ __name(UserEditor, "UserEditor");
8126
8148
  import { useTranslations as useTranslations6 } from "next-intl";
8127
8149
 
8128
8150
  // src/components/forms/EntityMultiSelector.tsx
8129
- import { useCallback as useCallback13, useEffect as useEffect13, useMemo as useMemo10, useRef as useRef11, useState as useState14 } from "react";
8151
+ import { useCallback as useCallback13, useEffect as useEffect13, useMemo as useMemo11, useRef as useRef11, useState as useState14 } from "react";
8130
8152
  import { useWatch } from "react-hook-form";
8131
8153
  import { CheckIcon as CheckIcon8, ChevronDownIcon as ChevronDownIcon7, SearchIcon as SearchIcon2, XIcon as XIcon5 } from "lucide-react";
8132
8154
 
@@ -8217,7 +8239,7 @@ function EntityMultiSelector({
8217
8239
  return fn ? fn(entity) : { id: entity.id, name: getLabelRef.current(entity) };
8218
8240
  }, []);
8219
8241
  const selectedValues = useWatch({ control: form.control, name: id }) || [];
8220
- const selectedIds = useMemo10(() => new Set(selectedValues.map((v) => v.id)), [selectedValues]);
8242
+ const selectedIds = useMemo11(() => new Set(selectedValues.map((v) => v.id)), [selectedValues]);
8221
8243
  const data = useDataListRetriever({
8222
8244
  retriever: /* @__PURE__ */ __name((params) => retriever(params), "retriever"),
8223
8245
  retrieverParams,
@@ -8299,7 +8321,7 @@ function EntityMultiSelector({
8299
8321
  },
8300
8322
  [form, id, options]
8301
8323
  );
8302
- const sortedOptions = useMemo10(() => {
8324
+ const sortedOptions = useMemo11(() => {
8303
8325
  const filtered = searchTerm.trim() ? options.filter((o) => o.label.toLowerCase().includes(searchTerm.trim().toLowerCase())) : options;
8304
8326
  return [...filtered].sort((a, b) => {
8305
8327
  const aSelected = selectedIds.has(a.id) ? 0 : 1;
@@ -8307,7 +8329,7 @@ function EntityMultiSelector({
8307
8329
  return aSelected - bSelected;
8308
8330
  });
8309
8331
  }, [options, selectedIds, searchTerm]);
8310
- const triggerSummary = useMemo10(() => {
8332
+ const triggerSummary = useMemo11(() => {
8311
8333
  if (selectedValues.length === 0) return null;
8312
8334
  return selectedValues.map((v) => stableGetFormValueLabel(v)).join(", ");
8313
8335
  }, [selectedValues, stableGetFormValueLabel]);
@@ -9060,7 +9082,7 @@ __name(CurrencyInput, "CurrencyInput");
9060
9082
  // src/components/forms/DatePickerPopover.tsx
9061
9083
  import { isValid, parse } from "date-fns";
9062
9084
  import { Calendar as CalendarIcon, CircleXIcon } from "lucide-react";
9063
- import { useMemo as useMemo11, useState as useState20 } from "react";
9085
+ import { useMemo as useMemo12, useState as useState20 } from "react";
9064
9086
  import { jsx as jsx80, jsxs as jsxs46 } from "react/jsx-runtime";
9065
9087
  var DatePickerPopover = /* @__PURE__ */ __name(({
9066
9088
  children,
@@ -9074,12 +9096,12 @@ var DatePickerPopover = /* @__PURE__ */ __name(({
9074
9096
  const dateFnsLocale = useI18nDateFnsLocale();
9075
9097
  const [isOpen, setIsOpen] = useState20(false);
9076
9098
  const [displayMonth, setDisplayMonth] = useState20(() => value || /* @__PURE__ */ new Date());
9077
- const dateFormatter = useMemo11(
9099
+ const dateFormatter = useMemo12(
9078
9100
  () => new Intl.DateTimeFormat(locale, { day: "2-digit", month: "2-digit", year: "numeric" }),
9079
9101
  [locale]
9080
9102
  );
9081
9103
  const formatDate = /* @__PURE__ */ __name((date) => dateFormatter.format(date), "formatDate");
9082
- const datePlaceholder = useMemo11(() => {
9104
+ const datePlaceholder = useMemo12(() => {
9083
9105
  const parts = dateFormatter.formatToParts(new Date(2e3, 0, 1));
9084
9106
  return parts.map((part) => {
9085
9107
  if (part.type === "day") return "dd";
@@ -9088,7 +9110,7 @@ var DatePickerPopover = /* @__PURE__ */ __name(({
9088
9110
  return part.value;
9089
9111
  }).join("");
9090
9112
  }, [dateFormatter]);
9091
- const dateFormatPattern = useMemo11(() => {
9113
+ const dateFormatPattern = useMemo12(() => {
9092
9114
  const parts = dateFormatter.formatToParts(new Date(2e3, 0, 1));
9093
9115
  return parts.map((part) => {
9094
9116
  if (part.type === "day") return "dd";
@@ -9100,7 +9122,7 @@ var DatePickerPopover = /* @__PURE__ */ __name(({
9100
9122
  const [inputValue, setInputValue] = useState20(() => value ? formatDate(value) : "");
9101
9123
  const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
9102
9124
  const yearOptions = Array.from({ length: currentYear - 1900 + 11 }, (_, i) => 1900 + i);
9103
- const monthNames = useMemo11(() => {
9125
+ const monthNames = useMemo12(() => {
9104
9126
  const formatter = new Intl.DateTimeFormat(locale, { month: "long" });
9105
9127
  return Array.from({ length: 12 }, (_, i) => {
9106
9128
  const monthName = formatter.format(new Date(2e3, i, 1));
@@ -9459,11 +9481,19 @@ function EditorSheet({
9459
9481
  { dialogOpen, onDialogOpenChange, forceShow }
9460
9482
  );
9461
9483
  const hasBeenOpen = useRef14(false);
9484
+ const seeded = useRef14(void 0);
9462
9485
  useEffect17(() => {
9463
9486
  if (open) {
9464
9487
  hasBeenOpen.current = true;
9488
+ if (!isEdit) return;
9489
+ const next = onReset();
9490
+ const fingerprint = JSON.stringify(next);
9491
+ if (seeded.current !== void 0 && seeded.current !== fingerprint) form.reset(next);
9492
+ seeded.current = fingerprint;
9465
9493
  } else if (hasBeenOpen.current) {
9466
- form.reset(onReset());
9494
+ const next = onReset();
9495
+ form.reset(next);
9496
+ if (isEdit) seeded.current = JSON.stringify(next);
9467
9497
  onClose?.();
9468
9498
  }
9469
9499
  }, [open]);
@@ -9757,7 +9787,7 @@ import {
9757
9787
  useCallback as useCallback18,
9758
9788
  useContext as useContext11,
9759
9789
  useEffect as useEffect19,
9760
- useMemo as useMemo12,
9790
+ useMemo as useMemo13,
9761
9791
  useRef as useRef16,
9762
9792
  useState as useState24
9763
9793
  } from "react";
@@ -9981,7 +10011,7 @@ var FileInput = forwardRef6(
9981
10011
  const t = useTranslations16();
9982
10012
  const rootProps = isLOF ? {} : dropzoneState.getRootProps();
9983
10013
  const { isDragActive: parentIsDragActive } = dropzoneState;
9984
- const acceptedLabels = useMemo12(() => {
10014
+ const acceptedLabels = useMemo13(() => {
9985
10015
  if (!accept) return null;
9986
10016
  const extensions = /* @__PURE__ */ new Set();
9987
10017
  let hasWildcardImages = false;
@@ -10050,7 +10080,7 @@ import { useRef as useRef17 } from "react";
10050
10080
  import dynamic from "next/dynamic";
10051
10081
  import React17 from "react";
10052
10082
  import { jsx as jsx85 } from "react/jsx-runtime";
10053
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-PVBZYPMF.mjs"), {
10083
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-WZFEJS2B.mjs"), {
10054
10084
  ssr: false
10055
10085
  });
10056
10086
  var BlockNoteEditorContainer = React17.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -10168,7 +10198,7 @@ __name(FormCheckbox, "FormCheckbox");
10168
10198
  // src/components/forms/FormDate.tsx
10169
10199
  import { isValid as isValid2, parse as parse2 } from "date-fns";
10170
10200
  import { Calendar as CalendarIcon3, CircleXIcon as CircleXIcon2 } from "lucide-react";
10171
- import { useMemo as useMemo13, useState as useState25 } from "react";
10201
+ import { useMemo as useMemo14, useState as useState25 } from "react";
10172
10202
  import { jsx as jsx88, jsxs as jsxs52 } from "react/jsx-runtime";
10173
10203
  function FormDate({
10174
10204
  form,
@@ -10190,12 +10220,12 @@ function FormDate({
10190
10220
  const currentValue = form.getValues(id);
10191
10221
  return currentValue || defaultMonth || /* @__PURE__ */ new Date();
10192
10222
  });
10193
- const dateFormatter = useMemo13(
10223
+ const dateFormatter = useMemo14(
10194
10224
  () => new Intl.DateTimeFormat(locale, { day: "2-digit", month: "2-digit", year: "numeric" }),
10195
10225
  [locale]
10196
10226
  );
10197
10227
  const formatDate = /* @__PURE__ */ __name((date) => dateFormatter.format(date), "formatDate");
10198
- const datePlaceholder = useMemo13(() => {
10228
+ const datePlaceholder = useMemo14(() => {
10199
10229
  const parts = dateFormatter.formatToParts(new Date(2e3, 0, 1));
10200
10230
  return parts.map((part) => {
10201
10231
  if (part.type === "day") return "dd";
@@ -10204,7 +10234,7 @@ function FormDate({
10204
10234
  return part.value;
10205
10235
  }).join("");
10206
10236
  }, [dateFormatter]);
10207
- const dateFormatPattern = useMemo13(() => {
10237
+ const dateFormatPattern = useMemo14(() => {
10208
10238
  const parts = dateFormatter.formatToParts(new Date(2e3, 0, 1));
10209
10239
  return parts.map((part) => {
10210
10240
  if (part.type === "day") return "dd";
@@ -10309,7 +10339,7 @@ __name(FormDate, "FormDate");
10309
10339
 
10310
10340
  // src/components/forms/FormDateTime.tsx
10311
10341
  import { Calendar as CalendarIcon4, CircleXIcon as CircleXIcon3 } from "lucide-react";
10312
- import { useMemo as useMemo14, useState as useState26 } from "react";
10342
+ import { useMemo as useMemo15, useState as useState26 } from "react";
10313
10343
  import { jsx as jsx89, jsxs as jsxs53 } from "react/jsx-runtime";
10314
10344
  function FormDateTime({
10315
10345
  form,
@@ -10331,7 +10361,7 @@ function FormDateTime({
10331
10361
  const currentValue = form.getValues(id);
10332
10362
  return currentValue || defaultMonth || /* @__PURE__ */ new Date();
10333
10363
  });
10334
- const dateTimeFormatter = useMemo14(
10364
+ const dateTimeFormatter = useMemo15(
10335
10365
  () => new Intl.DateTimeFormat(locale, {
10336
10366
  year: "numeric",
10337
10367
  month: "long",
@@ -10359,6 +10389,8 @@ function FormDateTime({
10359
10389
  label: minute.toString().padStart(2, "0")
10360
10390
  };
10361
10391
  });
10392
+ const hoursItems = Object.fromEntries(hoursOptions.map((option) => [String(option.value), option.label]));
10393
+ const minutesItems = Object.fromEntries(minutesOptions.map((option) => [String(option.value), option.label]));
10362
10394
  function roundToNearestFiveMinutes(minutes) {
10363
10395
  return Math.round(minutes / 5) * 5 % 60;
10364
10396
  }
@@ -10440,6 +10472,7 @@ function FormDateTime({
10440
10472
  /* @__PURE__ */ jsxs53(
10441
10473
  Select,
10442
10474
  {
10475
+ items: hoursItems,
10443
10476
  value: String(field.value ? new Date(field.value).getHours() : selectedHours),
10444
10477
  onValueChange: (value) => {
10445
10478
  if (!value) return;
@@ -10463,6 +10496,7 @@ function FormDateTime({
10463
10496
  /* @__PURE__ */ jsxs53(
10464
10497
  Select,
10465
10498
  {
10499
+ items: minutesItems,
10466
10500
  value: String(
10467
10501
  field.value ? roundToNearestFiveMinutes(new Date(field.value).getMinutes()) : selectedMinutes
10468
10502
  ),
@@ -11231,12 +11265,12 @@ var useUserSearch = /* @__PURE__ */ __name(() => {
11231
11265
 
11232
11266
  // src/features/user/hooks/useUserTableStructure.tsx
11233
11267
  import { useTranslations as useTranslations19 } from "next-intl";
11234
- import { useMemo as useMemo15 } from "react";
11268
+ import { useMemo as useMemo16 } from "react";
11235
11269
  import { Fragment as Fragment11, jsx as jsx103, jsxs as jsxs64 } from "react/jsx-runtime";
11236
11270
  var useUserTableStructure = /* @__PURE__ */ __name((params) => {
11237
11271
  const t = useTranslations19();
11238
11272
  const generateUrl = usePageUrlGenerator();
11239
- const tableData = useMemo15(() => {
11273
+ const tableData = useMemo16(() => {
11240
11274
  return params.data.map((user) => {
11241
11275
  const entry = {
11242
11276
  jsonApiData: user
@@ -11321,10 +11355,10 @@ var useUserTableStructure = /* @__PURE__ */ __name((params) => {
11321
11355
  title: t(`common.date.create`)
11322
11356
  })
11323
11357
  };
11324
- const columns = useMemo15(() => {
11358
+ const columns = useMemo16(() => {
11325
11359
  return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== void 0);
11326
11360
  }, [params.fields, fieldColumnMap, t, generateUrl]);
11327
- return useMemo15(() => ({ data: tableData, columns }), [tableData, columns]);
11361
+ return useMemo16(() => ({ data: tableData, columns }), [tableData, columns]);
11328
11362
  }, "useUserTableStructure");
11329
11363
 
11330
11364
  // src/features/user/components/widgets/UserSearchPopover.tsx
@@ -12408,7 +12442,7 @@ import { zodResolver as zodResolver3 } from "@hookform/resolvers/zod";
12408
12442
  import { UploadIcon as UploadIcon3 } from "lucide-react";
12409
12443
  import { useTranslations as useTranslations37 } from "next-intl";
12410
12444
  import Image6 from "next/image";
12411
- import { useCallback as useCallback21, useEffect as useEffect26, useMemo as useMemo16, useRef as useRef21, useState as useState35 } from "react";
12445
+ import { useCallback as useCallback21, useEffect as useEffect26, useMemo as useMemo17, useRef as useRef21, useState as useState35 } from "react";
12412
12446
  import { useForm as useForm3 } from "react-hook-form";
12413
12447
  import { v4 as v42 } from "uuid";
12414
12448
  import { z as z2 } from "zod";
@@ -12477,7 +12511,7 @@ function CompanyEditorInternal({
12477
12511
  setContentType(null);
12478
12512
  }
12479
12513
  }, [file]);
12480
- const formSchema = useMemo16(
12514
+ const formSchema = useMemo17(
12481
12515
  () => z2.object({
12482
12516
  id: z2.uuidv4(),
12483
12517
  name: z2.string().min(1, {
@@ -13221,7 +13255,7 @@ __name(HowToDeleter, "HowToDeleter");
13221
13255
  import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
13222
13256
  import { PlusIcon, SearchIcon as SearchIcon6, XIcon as XIcon10 } from "lucide-react";
13223
13257
  import { useTranslations as useTranslations45 } from "next-intl";
13224
- import { useCallback as useCallback24, useEffect as useEffect30, useMemo as useMemo17, useRef as useRef24, useState as useState41 } from "react";
13258
+ import { useCallback as useCallback24, useEffect as useEffect30, useMemo as useMemo18, useRef as useRef24, useState as useState41 } from "react";
13225
13259
  import { useForm as useForm4 } from "react-hook-form";
13226
13260
  import { v4 as v43 } from "uuid";
13227
13261
  import { z as z3 } from "zod";
@@ -13273,7 +13307,7 @@ function PageSelector({
13273
13307
  const [open, setOpen] = useState41(false);
13274
13308
  const [search, setSearch] = useState41("");
13275
13309
  const selectedLabel = value ? allPageUrls.find((opt) => opt.id === value) : void 0;
13276
- const filteredOptions = useMemo17(() => {
13310
+ const filteredOptions = useMemo18(() => {
13277
13311
  const available = allPageUrls.filter((opt) => opt.id === value || !selectedPages.includes(opt.id));
13278
13312
  if (!search) return available;
13279
13313
  const term = search.toLowerCase();
@@ -13340,7 +13374,7 @@ function HowToEditorInternal({
13340
13374
  }) {
13341
13375
  const router = useI18nRouter();
13342
13376
  const t = useTranslations45();
13343
- const formSchema = useMemo17(
13377
+ const formSchema = useMemo18(
13344
13378
  () => z3.object({
13345
13379
  id: z3.string().uuid(),
13346
13380
  name: z3.string().min(1, { message: t(`howto.fields.name.error`) }),
@@ -13402,7 +13436,7 @@ function HowToEditorInternal({
13402
13436
  },
13403
13437
  [form]
13404
13438
  );
13405
- const allPageUrls = useMemo17(() => ModuleRegistry.getAllPageUrls(), []);
13439
+ const allPageUrls = useMemo18(() => ModuleRegistry.getAllPageUrls(), []);
13406
13440
  const pages = form.watch("pages");
13407
13441
  const addPage = /* @__PURE__ */ __name(() => {
13408
13442
  form.setValue("pages", [...pages, ""], { shouldDirty: true });
@@ -13649,7 +13683,7 @@ var useHowToContext = /* @__PURE__ */ __name(() => {
13649
13683
  // src/features/rbac/contexts/RbacContext.tsx
13650
13684
  import { DownloadIcon, Loader2Icon as Loader2Icon3 } from "lucide-react";
13651
13685
  import { useTranslations as useTranslations47 } from "next-intl";
13652
- import { createContext as createContext18, useCallback as useCallback25, useContext as useContext19, useEffect as useEffect31, useMemo as useMemo18, useState as useState43 } from "react";
13686
+ import { createContext as createContext18, useCallback as useCallback25, useContext as useContext19, useEffect as useEffect31, useMemo as useMemo19, useState as useState43 } from "react";
13653
13687
  import { jsx as jsx145, jsxs as jsxs84 } from "react/jsx-runtime";
13654
13688
  var DEFAULT_OUTPUT_PATH = "apps/api/src/rbac/permissions.ts";
13655
13689
  function upsertToken(tokens, action, scope) {
@@ -13758,7 +13792,7 @@ var RbacProvider = /* @__PURE__ */ __name(({
13758
13792
  if (functions.length > 0) response.functions = functions;
13759
13793
  return response;
13760
13794
  }, "title");
13761
- const contextValue = useMemo18(
13795
+ const contextValue = useMemo19(
13762
13796
  () => ({
13763
13797
  matrix,
13764
13798
  modulePaths,
@@ -13784,7 +13818,7 @@ var useRbacContext = /* @__PURE__ */ __name(() => {
13784
13818
 
13785
13819
  // src/features/assistant/contexts/AssistantContext.tsx
13786
13820
  import { useTranslations as useTranslations48 } from "next-intl";
13787
- import { createContext as createContext19, useCallback as useCallback26, useContext as useContext20, useEffect as useEffect32, useMemo as useMemo19, useState as useState44 } from "react";
13821
+ import { createContext as createContext19, useCallback as useCallback26, useContext as useContext20, useEffect as useEffect32, useMemo as useMemo20, useState as useState44 } from "react";
13788
13822
  import { jsx as jsx146 } from "react/jsx-runtime";
13789
13823
  var AssistantContext = createContext19(void 0);
13790
13824
  function stripOptimistic(list) {
@@ -13955,7 +13989,7 @@ function AssistantProvider({ children, dehydratedAssistant, dehydratedMessages,
13955
13989
  cancelled = true;
13956
13990
  };
13957
13991
  }, []);
13958
- const value = useMemo19(
13992
+ const value = useMemo20(
13959
13993
  () => ({
13960
13994
  assistant,
13961
13995
  messages,
@@ -14325,11 +14359,11 @@ var ITEMS_TO_DISPLAY = 4;
14325
14359
  function BreadcrumbDesktop({
14326
14360
  items,
14327
14361
  generateUrl,
14328
- t
14362
+ rootLabel
14329
14363
  }) {
14330
14364
  const [open, setOpen] = useState46(false);
14331
14365
  return /* @__PURE__ */ jsx148(Breadcrumb, { children: /* @__PURE__ */ jsxs85(BreadcrumbList, { children: [
14332
- /* @__PURE__ */ jsx148(BreadcrumbItem, { children: /* @__PURE__ */ jsx148(Link, { href: generateUrl({ page: `/` }), children: t(`common.home`) }) }),
14366
+ /* @__PURE__ */ jsx148(BreadcrumbItem, { children: /* @__PURE__ */ jsx148(Link, { href: generateUrl({ page: `/` }), children: rootLabel }) }),
14333
14367
  items.length > 0 && /* @__PURE__ */ jsx148(BreadcrumbSeparator, {}),
14334
14368
  items.length > ITEMS_TO_DISPLAY ? /* @__PURE__ */ jsxs85(Fragment21, { children: [
14335
14369
  /* @__PURE__ */ jsx148(BreadcrumbItem, { children: items[0].href ? /* @__PURE__ */ jsx148(Link, { href: items[0].href, onClick: items[0].onClick, children: items[0].name }) : /* @__PURE__ */ jsx148(Fragment21, { children: items[0].name }) }),
@@ -14353,13 +14387,13 @@ __name(BreadcrumbDesktop, "BreadcrumbDesktop");
14353
14387
  function BreadcrumbMobile({
14354
14388
  items,
14355
14389
  generateUrl,
14356
- t
14390
+ rootLabel
14357
14391
  }) {
14358
14392
  const [open, setOpen] = useState46(false);
14359
14393
  const lastItem = items[items.length - 1];
14360
- const allItems = [{ name: t(`common.home`), href: generateUrl({ page: `/` }) }, ...items];
14394
+ const allItems = [{ name: rootLabel, href: generateUrl({ page: `/` }) }, ...items];
14361
14395
  if (!lastItem && items.length === 0) {
14362
- return /* @__PURE__ */ jsx148(Breadcrumb, { children: /* @__PURE__ */ jsx148(BreadcrumbList, { children: /* @__PURE__ */ jsx148(BreadcrumbItem, { children: /* @__PURE__ */ jsx148(Link, { href: generateUrl({ page: `/` }), children: t(`common.home`) }) }) }) });
14396
+ return /* @__PURE__ */ jsx148(Breadcrumb, { children: /* @__PURE__ */ jsx148(BreadcrumbList, { children: /* @__PURE__ */ jsx148(BreadcrumbItem, { children: /* @__PURE__ */ jsx148(Link, { href: generateUrl({ page: `/` }), children: rootLabel }) }) }) });
14363
14397
  }
14364
14398
  return /* @__PURE__ */ jsxs85(DropdownMenu, { open, onOpenChange: setOpen, children: [
14365
14399
  /* @__PURE__ */ jsxs85(DropdownMenuTrigger, { className: "text-foreground text-xs/relaxed font-normal hover:bg-accent flex items-center gap-1 rounded-md px-1.5 py-0.5 transition-colors outline-none", children: [
@@ -14370,14 +14404,15 @@ function BreadcrumbMobile({
14370
14404
  ] });
14371
14405
  }
14372
14406
  __name(BreadcrumbMobile, "BreadcrumbMobile");
14373
- function BreadcrumbNavigation({ items }) {
14407
+ function BreadcrumbNavigation({ items, rootLabel }) {
14374
14408
  const generateUrl = usePageUrlGenerator();
14375
14409
  const t = useTranslations50();
14376
14410
  const isMobile = useIsMobile();
14411
+ const root = rootLabel?.trim() ? rootLabel : t(`common.home`);
14377
14412
  if (isMobile) {
14378
- return /* @__PURE__ */ jsx148(BreadcrumbMobile, { items, generateUrl, t });
14413
+ return /* @__PURE__ */ jsx148(BreadcrumbMobile, { items, generateUrl, rootLabel: root });
14379
14414
  }
14380
- return /* @__PURE__ */ jsx148(BreadcrumbDesktop, { items, generateUrl, t });
14415
+ return /* @__PURE__ */ jsx148(BreadcrumbDesktop, { items, generateUrl, rootLabel: root });
14381
14416
  }
14382
14417
  __name(BreadcrumbNavigation, "BreadcrumbNavigation");
14383
14418
 
@@ -14418,11 +14453,12 @@ __name(ContentTitle, "ContentTitle");
14418
14453
  import { jsx as jsx150, jsxs as jsxs87 } from "react/jsx-runtime";
14419
14454
  function Header({ children, leftContent, className }) {
14420
14455
  const { breadcrumbs } = useSharedContext();
14456
+ const rootLabel = useHeaderRootLabel();
14421
14457
  const isMobile = useIsMobile();
14422
14458
  return /* @__PURE__ */ jsx150("header", { className: `sticky top-0 z-10 flex h-12 flex-col items-center justify-start gap-x-4 ${className ?? ""}`, children: /* @__PURE__ */ jsxs87("div", { className: "bg-sidebar flex h-12 w-full flex-row items-center justify-between pl-2 pr-4", children: [
14423
14459
  /* @__PURE__ */ jsx150(SidebarTrigger, { "aria-label": "Toggle sidebar", id: "sidebar-trigger" }),
14424
14460
  leftContent,
14425
- /* @__PURE__ */ jsx150("div", { className: "flex w-full flex-row items-center justify-start", children: /* @__PURE__ */ jsx150(BreadcrumbNavigation, { items: breadcrumbs }) }),
14461
+ /* @__PURE__ */ jsx150("div", { className: "flex w-full flex-row items-center justify-start", children: /* @__PURE__ */ jsx150(BreadcrumbNavigation, { items: breadcrumbs, rootLabel: rootLabel ?? void 0 }) }),
14426
14462
  !isMobile && children && /* @__PURE__ */ jsx150("div", { className: "flex w-64 flex-row items-center justify-end gap-x-4 whitespace-nowrap", children: /* @__PURE__ */ jsx150("div", { className: "flex flex-row items-center justify-end gap-x-4 whitespace-nowrap", children }) })
14427
14463
  ] }) });
14428
14464
  }
@@ -14620,7 +14656,7 @@ function ReactMarkdownContainer({
14620
14656
  "button",
14621
14657
  {
14622
14658
  onClick: handleToggle,
14623
- className: "text-primary flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium transition-colors hover:bg-gray-100 hover:underline",
14659
+ className: "text-primary flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium transition-colors hover:bg-gray-100",
14624
14660
  "aria-label": isExpanded ? t("show_less") : t("show_more"),
14625
14661
  children: [
14626
14662
  /* @__PURE__ */ jsx155("span", { children: isExpanded ? t("show_less") : t("show_more") }),
@@ -14682,7 +14718,7 @@ __name(RoundPageContainerTitle, "RoundPageContainerTitle");
14682
14718
 
14683
14719
  // src/components/containers/RoundPageContainer.tsx
14684
14720
  import { useSearchParams } from "next/navigation";
14685
- import { Fragment as Fragment22, useCallback as useCallback27, useEffect as useEffect40, useMemo as useMemo20, useState as useState50 } from "react";
14721
+ import { Fragment as Fragment22, useCallback as useCallback27, useEffect as useEffect40, useMemo as useMemo21, useState as useState50 } from "react";
14686
14722
  import { Fragment as Fragment23, jsx as jsx157, jsxs as jsxs93 } from "react/jsx-runtime";
14687
14723
  var DETAILS_COOKIE_NAME = "round_page_details_state";
14688
14724
  var DETAILS_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
@@ -14748,7 +14784,11 @@ function RoundPageContainer({
14748
14784
  [module, id, rewriteUrl, onSectionChange]
14749
14785
  );
14750
14786
  const activeFillHeight = tabs?.find((t) => tabValue(t) === activeTab)?.fillHeight === true;
14751
- const { ungrouped, groups } = useMemo20(() => partitionTabs(tabs ?? []), [tabs]);
14787
+ const { ungrouped, groups } = useMemo21(() => partitionTabs(tabs ?? []), [tabs]);
14788
+ const tabItems = useMemo21(
14789
+ () => Object.fromEntries((tabs ?? []).map((tab) => [tabValue(tab), tab.contentLabel ?? tab.label])),
14790
+ [tabs]
14791
+ );
14752
14792
  const isReady = mounted && isMobile !== void 0;
14753
14793
  if (!isReady) {
14754
14794
  return /* @__PURE__ */ jsxs93(Fragment23, { children: [
@@ -14807,6 +14847,7 @@ function RoundPageContainer({
14807
14847
  /* @__PURE__ */ jsx157("div", { "data-testid": "round-page-rail-select", className: "p-2 md:hidden", children: /* @__PURE__ */ jsxs93(
14808
14848
  Select,
14809
14849
  {
14850
+ items: tabItems,
14810
14851
  value: activeTab,
14811
14852
  onValueChange: (value) => {
14812
14853
  if (value) handleTabChange(value);
@@ -14887,6 +14928,7 @@ function RoundPageContainer({
14887
14928
  isMobile ? /* @__PURE__ */ jsx157("div", { className: "p-0", children: /* @__PURE__ */ jsxs93(
14888
14929
  Select,
14889
14930
  {
14931
+ items: tabItems,
14890
14932
  value: activeTab,
14891
14933
  onValueChange: (value) => {
14892
14934
  if (value) handleTabChange(value);
@@ -15172,7 +15214,7 @@ var createMentionInlineContentSpec = /* @__PURE__ */ __name((resolveFn, disableM
15172
15214
  // src/components/editors/BlockNoteEditorSuggestionMenuController.tsx
15173
15215
  import { SuggestionMenuController } from "@blocknote/react";
15174
15216
  import { autoUpdate, flip, shift } from "@floating-ui/react";
15175
- import React25, { useCallback as useCallback29, useMemo as useMemo21 } from "react";
15217
+ import React25, { useCallback as useCallback29, useMemo as useMemo22 } from "react";
15176
15218
  import { jsx as jsx162 } from "react/jsx-runtime";
15177
15219
  var MentionInsertContext = React25.createContext(null);
15178
15220
  var useMentionInsert = /* @__PURE__ */ __name(() => React25.useContext(MentionInsertContext), "useMentionInsert");
@@ -15224,7 +15266,7 @@ function BlockNoteEditorMentionSuggestionMenu({
15224
15266
  },
15225
15267
  [editor, mentionSearchFn, mentionSearchParams]
15226
15268
  );
15227
- const wrappedSuggestionMenuComponent = useMemo21(() => {
15269
+ const wrappedSuggestionMenuComponent = useMemo22(() => {
15228
15270
  if (!suggestionMenuComponent) return void 0;
15229
15271
  const Component2 = suggestionMenuComponent;
15230
15272
  const Wrapped = /* @__PURE__ */ __name((props) => {
@@ -15471,7 +15513,7 @@ var cellUrl = /* @__PURE__ */ __name((params) => {
15471
15513
  }, "cellUrl");
15472
15514
 
15473
15515
  // src/client/context/JsonApiProvider.tsx
15474
- import { useEffect as useEffect44, useMemo as useMemo22 } from "react";
15516
+ import { useEffect as useEffect44, useMemo as useMemo23 } from "react";
15475
15517
  import { jsx as jsx171 } from "react/jsx-runtime";
15476
15518
  function JsonApiProvider({ config, children }) {
15477
15519
  useEffect44(() => {
@@ -15479,7 +15521,7 @@ function JsonApiProvider({ config, children }) {
15479
15521
  config.bootstrapper();
15480
15522
  }
15481
15523
  }, [config.bootstrapper]);
15482
- const memoizedConfig = useMemo22(() => config, [config]);
15524
+ const memoizedConfig = useMemo23(() => config, [config]);
15483
15525
  return /* @__PURE__ */ jsx171(JsonApiContext.Provider, { value: memoizedConfig, children });
15484
15526
  }
15485
15527
  __name(JsonApiProvider, "JsonApiProvider");
@@ -15685,16 +15727,16 @@ function useJsonApiMutation(config) {
15685
15727
  __name(useJsonApiMutation, "useJsonApiMutation");
15686
15728
 
15687
15729
  // src/client/hooks/useRehydration.ts
15688
- import { useMemo as useMemo23 } from "react";
15730
+ import { useMemo as useMemo24 } from "react";
15689
15731
  function useRehydration(classKey, data) {
15690
- return useMemo23(() => {
15732
+ return useMemo24(() => {
15691
15733
  if (!data) return null;
15692
15734
  return RehydrationFactory.rehydrate(classKey, data);
15693
15735
  }, [classKey, data]);
15694
15736
  }
15695
15737
  __name(useRehydration, "useRehydration");
15696
15738
  function useRehydrationList(classKey, data) {
15697
- return useMemo23(() => {
15739
+ return useMemo24(() => {
15698
15740
  if (!data || data.length === 0) return [];
15699
15741
  return RehydrationFactory.rehydrateList(classKey, data);
15700
15742
  }, [classKey, data]);
@@ -15703,13 +15745,13 @@ __name(useRehydrationList, "useRehydrationList");
15703
15745
 
15704
15746
  // src/features/company/hooks/useCompanyTableStructure.tsx
15705
15747
  import { useTranslations as useTranslations54 } from "next-intl";
15706
- import { useMemo as useMemo24 } from "react";
15748
+ import { useMemo as useMemo25 } from "react";
15707
15749
  import { jsx as jsx172 } from "react/jsx-runtime";
15708
15750
  var useCompanyTableStructure = /* @__PURE__ */ __name((params) => {
15709
15751
  const t = useTranslations54();
15710
15752
  const generateUrl = usePageUrlGenerator();
15711
15753
  const { hasRole } = useCurrentUserContext();
15712
- const tableData = useMemo24(() => {
15754
+ const tableData = useMemo25(() => {
15713
15755
  return params.data.map((company) => {
15714
15756
  const entry = {
15715
15757
  jsonApiData: company
@@ -15753,14 +15795,14 @@ var useCompanyTableStructure = /* @__PURE__ */ __name((params) => {
15753
15795
  title: t(`common.date.create`)
15754
15796
  })
15755
15797
  };
15756
- const columns = useMemo24(() => {
15798
+ const columns = useMemo25(() => {
15757
15799
  return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== void 0);
15758
15800
  }, [params.fields, fieldColumnMap, t, generateUrl, hasRole]);
15759
- return useMemo24(() => ({ data: tableData, columns }), [tableData, columns]);
15801
+ return useMemo25(() => ({ data: tableData, columns }), [tableData, columns]);
15760
15802
  }, "useCompanyTableStructure");
15761
15803
 
15762
15804
  // src/features/company/hooks/useSubscriptionStatus.ts
15763
- import { useMemo as useMemo25 } from "react";
15805
+ import { useMemo as useMemo26 } from "react";
15764
15806
  var TRIAL_DAYS = 14;
15765
15807
  var GRACE_DAYS = 3;
15766
15808
  var isAdministrator = /* @__PURE__ */ __name((currentUser) => {
@@ -15770,7 +15812,7 @@ var isAdministrator = /* @__PURE__ */ __name((currentUser) => {
15770
15812
  }, "isAdministrator");
15771
15813
  function useSubscriptionStatus() {
15772
15814
  const { company, currentUser } = useCurrentUserContext();
15773
- return useMemo25(() => {
15815
+ return useMemo26(() => {
15774
15816
  if (currentUser === null) {
15775
15817
  return {
15776
15818
  status: "loading",
@@ -15835,12 +15877,12 @@ __name(useSubscriptionStatus, "useSubscriptionStatus");
15835
15877
 
15836
15878
  // src/features/role/hooks/useRoleTableStructure.tsx
15837
15879
  import { useTranslations as useTranslations55 } from "next-intl";
15838
- import { useMemo as useMemo26 } from "react";
15880
+ import { useMemo as useMemo27 } from "react";
15839
15881
  import { Fragment as Fragment25, jsx as jsx173 } from "react/jsx-runtime";
15840
15882
  var useRoleTableStructure = /* @__PURE__ */ __name((params) => {
15841
15883
  const t = useTranslations55();
15842
15884
  const generateUrl = usePageUrlGenerator();
15843
- const tableData = useMemo26(() => {
15885
+ const tableData = useMemo27(() => {
15844
15886
  return params.data.map((role) => {
15845
15887
  const entry = {
15846
15888
  jsonApiData: role
@@ -15882,20 +15924,20 @@ var useRoleTableStructure = /* @__PURE__ */ __name((params) => {
15882
15924
  title: t(`common.date.create`)
15883
15925
  })
15884
15926
  };
15885
- const columns = useMemo26(() => {
15927
+ const columns = useMemo27(() => {
15886
15928
  return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== void 0);
15887
15929
  }, [params.fields, fieldColumnMap, t, generateUrl]);
15888
- return useMemo26(() => ({ data: tableData, columns }), [tableData, columns]);
15930
+ return useMemo27(() => ({ data: tableData, columns }), [tableData, columns]);
15889
15931
  }, "useRoleTableStructure");
15890
15932
 
15891
15933
  // src/features/content/hooks/useContentTableStructure.tsx
15892
15934
  import { useTranslations as useTranslations56 } from "next-intl";
15893
- import { useMemo as useMemo27 } from "react";
15935
+ import { useMemo as useMemo28 } from "react";
15894
15936
  import { Fragment as Fragment26, jsx as jsx174, jsxs as jsxs99 } from "react/jsx-runtime";
15895
15937
  var useContentTableStructure = /* @__PURE__ */ __name((params) => {
15896
15938
  const t = useTranslations56();
15897
15939
  const generateUrl = usePageUrlGenerator();
15898
- const tableData = useMemo27(() => {
15940
+ const tableData = useMemo28(() => {
15899
15941
  return params.data.map((content) => {
15900
15942
  const entry = {
15901
15943
  jsonApiData: content
@@ -15980,7 +16022,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
15980
16022
  title: t(`common.date.update`)
15981
16023
  })
15982
16024
  };
15983
- const columns = useMemo27(() => {
16025
+ const columns = useMemo28(() => {
15984
16026
  return params.fields.map((field) => {
15985
16027
  const localHandler = fieldColumnMap[field];
15986
16028
  if (localHandler) return localHandler();
@@ -15989,7 +16031,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
15989
16031
  return void 0;
15990
16032
  }).filter((col) => col !== void 0);
15991
16033
  }, [params.fields, fieldColumnMap, t, generateUrl, params.context?.customCells]);
15992
- return useMemo27(() => ({ data: tableData, columns }), [tableData, columns]);
16034
+ return useMemo28(() => ({ data: tableData, columns }), [tableData, columns]);
15993
16035
  }, "useContentTableStructure");
15994
16036
 
15995
16037
  // src/features/oauth/hooks/useOAuthClients.ts
@@ -16289,7 +16331,7 @@ registerTableGenerator("companies", useCompanyTableStructure);
16289
16331
  import { flexRender, getCoreRowModel, getExpandedRowModel, useReactTable } from "@tanstack/react-table";
16290
16332
  import { ChevronLeft, ChevronRight } from "lucide-react";
16291
16333
  import { useTranslations as useTranslations58 } from "next-intl";
16292
- import React28, { memo, useMemo as useMemo28, useState as useState59 } from "react";
16334
+ import React28, { memo, useMemo as useMemo29, useState as useState59 } from "react";
16293
16335
 
16294
16336
  // src/components/tables/ContentTableSearch.tsx
16295
16337
  import { RefreshCw, Search, X as X3 } from "lucide-react";
@@ -16411,7 +16453,7 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
16411
16453
  dataRetriever: data,
16412
16454
  context: props.context
16413
16455
  });
16414
- const columnVisibility = useMemo28(
16456
+ const columnVisibility = useMemo29(
16415
16457
  () => fields.reduce(
16416
16458
  (acc, columnId) => {
16417
16459
  acc[columnId] = true;
@@ -16436,7 +16478,7 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
16436
16478
  }
16437
16479
  });
16438
16480
  const rowModel = tableData ? table.getRowModel() : null;
16439
- const groupedRows = useMemo28(() => {
16481
+ const groupedRows = useMemo29(() => {
16440
16482
  if (!props.groupBy || !rowModel?.rows?.length) return null;
16441
16483
  const groupMap = /* @__PURE__ */ new Map();
16442
16484
  for (const row of rowModel.rows) {
@@ -16610,57 +16652,6 @@ function ContentListGrid(props) {
16610
16652
  }
16611
16653
  __name(ContentListGrid, "ContentListGrid");
16612
16654
 
16613
- // src/utils/italian-validators.ts
16614
- import CodiceFiscale from "codice-fiscale-js";
16615
- function validatePartitaIva(partitaIva) {
16616
- if (!partitaIva || typeof partitaIva !== "string") {
16617
- return false;
16618
- }
16619
- const cleaned = partitaIva.replace(/\s/g, "");
16620
- if (!/^\d{11}$/.test(cleaned)) {
16621
- return false;
16622
- }
16623
- const digits = cleaned.split("").map(Number);
16624
- const oddSum = digits[0] + digits[2] + digits[4] + digits[6] + digits[8] + digits[10];
16625
- let evenSum = 0;
16626
- for (let i = 1; i < 10; i += 2) {
16627
- let doubled = digits[i] * 2;
16628
- if (doubled > 9) {
16629
- doubled -= 9;
16630
- }
16631
- evenSum += doubled;
16632
- }
16633
- const totalSum = oddSum + evenSum;
16634
- return totalSum % 10 === 0;
16635
- }
16636
- __name(validatePartitaIva, "validatePartitaIva");
16637
- function validateCodiceFiscale(codiceFiscale) {
16638
- if (!codiceFiscale || typeof codiceFiscale !== "string") {
16639
- return false;
16640
- }
16641
- const cleaned = codiceFiscale.replace(/\s/g, "").toUpperCase();
16642
- try {
16643
- return CodiceFiscale.check(cleaned);
16644
- } catch (error) {
16645
- return false;
16646
- }
16647
- }
16648
- __name(validateCodiceFiscale, "validateCodiceFiscale");
16649
- function validateItalianTaxCode(value, type) {
16650
- if (!value || typeof value !== "string") {
16651
- return false;
16652
- }
16653
- switch (type) {
16654
- case "partitaIva":
16655
- return validatePartitaIva(value);
16656
- case "codiceFiscale":
16657
- return validateCodiceFiscale(value);
16658
- default:
16659
- return false;
16660
- }
16661
- }
16662
- __name(validateItalianTaxCode, "validateItalianTaxCode");
16663
-
16664
16655
  // src/components/fiscal/ItalianFiscalData.tsx
16665
16656
  import { useTranslations as useTranslations59 } from "next-intl";
16666
16657
  import { forwardRef as forwardRef8, useCallback as useCallback36, useImperativeHandle as useImperativeHandle2, useRef as useRef32, useState as useState60 } from "react";
@@ -16864,7 +16855,7 @@ __name(EntitySection, "EntitySection");
16864
16855
  import Image8 from "next/image";
16865
16856
 
16866
16857
  // src/features/auth/contexts/AuthContext.tsx
16867
- import { createContext as createContext21, useContext as useContext22, useMemo as useMemo29, useState as useState62 } from "react";
16858
+ import { createContext as createContext21, useContext as useContext22, useMemo as useMemo30, useState as useState62 } from "react";
16868
16859
 
16869
16860
  // src/features/auth/components/forms/Register.tsx
16870
16861
  import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
@@ -16889,11 +16880,11 @@ function GdprConsentSection({
16889
16880
  const termsLabel = /* @__PURE__ */ jsxs107(Fragment29, { children: [
16890
16881
  t("terms_prefix"),
16891
16882
  " ",
16892
- /* @__PURE__ */ jsx184(Link, { href: "/terms", target: "_blank", rel: "noopener", className: "underline", children: t("terms_of_service") }),
16883
+ /* @__PURE__ */ jsx184(Link, { href: "/terms", target: "_blank", rel: "noopener", children: t("terms_of_service") }),
16893
16884
  " ",
16894
16885
  t("and"),
16895
16886
  " ",
16896
- /* @__PURE__ */ jsx184(Link, { href: "/privacy", target: "_blank", rel: "noopener", className: "underline", children: t("privacy_policy") })
16887
+ /* @__PURE__ */ jsx184(Link, { href: "/privacy", target: "_blank", rel: "noopener", children: t("privacy_policy") })
16897
16888
  ] });
16898
16889
  return /* @__PURE__ */ jsxs107("div", { className: "space-y-4 py-4", children: [
16899
16890
  /* @__PURE__ */ jsx184(GdprConsentCheckbox, { form, id: termsCheckboxId, label: termsLabel, required: true }),
@@ -17049,7 +17040,7 @@ function Register() {
17049
17040
  /* @__PURE__ */ jsxs108(CardContent, { className: "text-center", children: [
17050
17041
  /* @__PURE__ */ jsx185("p", { className: "text-destructive mb-4", children: inviteError }),
17051
17042
  /* @__PURE__ */ jsx185("p", { className: "mb-4", children: t("waitlist.invite.join_prompt") }),
17052
- /* @__PURE__ */ jsx185(Link, { href: "/waitlist", className: "text-primary underline", children: t("waitlist.invite.join_link") })
17043
+ /* @__PURE__ */ jsx185(Link, { href: "/waitlist", className: "text-primary", children: t("waitlist.invite.join_link") })
17053
17044
  ] })
17054
17045
  ] });
17055
17046
  }
@@ -17062,7 +17053,7 @@ function Register() {
17062
17053
  /* @__PURE__ */ jsxs108(CardContent, { className: "text-center", children: [
17063
17054
  /* @__PURE__ */ jsx185("p", { className: "mb-4", children: t("waitlist.invite.registration_description") }),
17064
17055
  /* @__PURE__ */ jsx185("p", { className: "mb-4", children: t("waitlist.invite.registration_hint") }),
17065
- /* @__PURE__ */ jsx185(Link, { href: "/waitlist", className: "text-primary underline", children: t("waitlist.invite.join_link") })
17056
+ /* @__PURE__ */ jsx185(Link, { href: "/waitlist", className: "text-primary", children: t("waitlist.invite.join_link") })
17066
17057
  ] }),
17067
17058
  /* @__PURE__ */ jsx185(CardFooter, { className: "flex w-full flex-row justify-between", children: /* @__PURE__ */ jsx185(Link, { href: "#", className: "flex w-full justify-start", onClick: () => setComponentType(0 /* Login */), children: t("auth.buttons.login") }) })
17068
17059
  ] });
@@ -17223,7 +17214,7 @@ var AuthContextProvider = /* @__PURE__ */ __name(({
17223
17214
  const [componentType, setComponentType] = useState62(initialComponentType);
17224
17215
  const [params, setParams] = useState62(initialParams);
17225
17216
  const [pendingTwoFactor, setPendingTwoFactor] = useState62();
17226
- const activeComponent = useMemo29(() => {
17217
+ const activeComponent = useMemo30(() => {
17227
17218
  if (componentType === void 0) return null;
17228
17219
  switch (componentType) {
17229
17220
  case 0 /* Login */:
@@ -18888,12 +18879,12 @@ __name(RelevantContentsList, "RelevantContentsList");
18888
18879
  // src/features/how-to/components/containers/HowToCommand.tsx
18889
18880
  import { ArrowRight, LifeBuoyIcon } from "lucide-react";
18890
18881
  import { useTranslations as useTranslations81 } from "next-intl";
18891
- import { useCallback as useCallback38, useEffect as useEffect61, useMemo as useMemo31, useRef as useRef34, useState as useState79 } from "react";
18882
+ import { useCallback as useCallback38, useEffect as useEffect61, useMemo as useMemo32, useRef as useRef34, useState as useState79 } from "react";
18892
18883
 
18893
18884
  // src/features/how-to/components/containers/HowToCommandViewer.tsx
18894
18885
  import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
18895
18886
  import { useTranslations as useTranslations80 } from "next-intl";
18896
- import { useMemo as useMemo30 } from "react";
18887
+ import { useMemo as useMemo31 } from "react";
18897
18888
 
18898
18889
  // src/features/how-to/utils/blocknote.ts
18899
18890
  function extractTextFromContent(content) {
@@ -18965,8 +18956,8 @@ __name(extractHeadings, "extractHeadings");
18965
18956
  import { jsx as jsx210, jsxs as jsxs126 } from "react/jsx-runtime";
18966
18957
  function HowToCommandViewer({ howTo, onBack, onStartChat }) {
18967
18958
  const t = useTranslations80();
18968
- const readingTime = useMemo30(() => calculateReadingTime(howTo.description), [howTo.description]);
18969
- const headings = useMemo30(() => extractHeadings(howTo.description), [howTo.description]);
18959
+ const readingTime = useMemo31(() => calculateReadingTime(howTo.description), [howTo.description]);
18960
+ const headings = useMemo31(() => extractHeadings(howTo.description), [howTo.description]);
18970
18961
  return /* @__PURE__ */ jsxs126("div", { className: "flex h-full flex-col", children: [
18971
18962
  /* @__PURE__ */ jsxs126("div", { className: "flex items-center gap-3 border-b px-4 py-3", children: [
18972
18963
  /* @__PURE__ */ jsxs126(Button, { variant: "ghost", size: "sm", onClick: onBack, className: "h-8 px-2", children: [
@@ -19025,7 +19016,7 @@ function HowToCommand({ pathname, extraGroups, onStartChat }) {
19025
19016
  retrieverParams: {},
19026
19017
  module: Modules.HowTo
19027
19018
  });
19028
- const { relevantHowTos, otherHowTos } = useMemo31(() => {
19019
+ const { relevantHowTos, otherHowTos } = useMemo32(() => {
19029
19020
  if (!data.data) return { relevantHowTos: [], otherHowTos: [] };
19030
19021
  const relevant = [];
19031
19022
  const other = [];
@@ -19222,12 +19213,12 @@ import { useTranslations as useTranslations84 } from "next-intl";
19222
19213
 
19223
19214
  // src/features/how-to/hooks/useHowToTableStructure.tsx
19224
19215
  import { useTranslations as useTranslations83 } from "next-intl";
19225
- import { useMemo as useMemo32 } from "react";
19216
+ import { useMemo as useMemo33 } from "react";
19226
19217
  import { Fragment as Fragment42, jsx as jsx215 } from "react/jsx-runtime";
19227
19218
  var useHowToTableStructure = /* @__PURE__ */ __name((params) => {
19228
19219
  const t = useTranslations83();
19229
19220
  const generateUrl = usePageUrlGenerator();
19230
- const tableData = useMemo32(() => {
19221
+ const tableData = useMemo33(() => {
19231
19222
  return params.data.map((howTo) => {
19232
19223
  const entry = {
19233
19224
  jsonApiData: howTo
@@ -19281,10 +19272,10 @@ var useHowToTableStructure = /* @__PURE__ */ __name((params) => {
19281
19272
  title: t(`common.date.update`)
19282
19273
  })
19283
19274
  };
19284
- const columns = useMemo32(() => {
19275
+ const columns = useMemo33(() => {
19285
19276
  return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== void 0);
19286
19277
  }, [params.fields, fieldColumnMap, t, generateUrl]);
19287
- return useMemo32(() => ({ data: tableData, columns }), [tableData, columns]);
19278
+ return useMemo33(() => ({ data: tableData, columns }), [tableData, columns]);
19288
19279
  }, "useHowToTableStructure");
19289
19280
  registerTableGenerator("howtos", useHowToTableStructure);
19290
19281
 
@@ -19653,10 +19644,10 @@ import ReactMarkdown3 from "react-markdown";
19653
19644
  import remarkGfm3 from "remark-gfm";
19654
19645
 
19655
19646
  // src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
19656
- import { useEffect as useEffect63, useMemo as useMemo34, useState as useState86 } from "react";
19647
+ import { useEffect as useEffect63, useMemo as useMemo35, useState as useState86 } from "react";
19657
19648
 
19658
19649
  // src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
19659
- import { useMemo as useMemo33, useState as useState85 } from "react";
19650
+ import { useMemo as useMemo34, useState as useState85 } from "react";
19660
19651
  import { useTranslations as useTranslations94 } from "next-intl";
19661
19652
  import { ChevronDown as ChevronDown4, ChevronRight as ChevronRight2 } from "lucide-react";
19662
19653
 
@@ -19949,7 +19940,7 @@ __name(SuggestedQuestionsTab, "SuggestedQuestionsTab");
19949
19940
  import { jsx as jsx229, jsxs as jsxs139 } from "react/jsx-runtime";
19950
19941
  function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sources, users }) {
19951
19942
  const t = useTranslations94();
19952
- const visibleReferences = useMemo33(
19943
+ const visibleReferences = useMemo34(
19953
19944
  () => message.references.filter((ref) => {
19954
19945
  try {
19955
19946
  return !!ModuleRegistry.findByName(ref.type).pageUrl;
@@ -19962,7 +19953,7 @@ function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sou
19962
19953
  const refsCount = visibleReferences.length;
19963
19954
  const citationsCount = message.citations.length;
19964
19955
  const suggestionsCount = isLatestAssistant ? message.suggestedQuestions.length : 0;
19965
- const contentsCount = useMemo33(() => {
19956
+ const contentsCount = useMemo34(() => {
19966
19957
  const ids = /* @__PURE__ */ new Set();
19967
19958
  for (const c of message.citations) {
19968
19959
  if (!c.nodeId) continue;
@@ -20041,7 +20032,7 @@ var SourcesFetcher = class extends ClientAbstractService {
20041
20032
  }
20042
20033
  };
20043
20034
  function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp }) {
20044
- const groups = useMemo34(() => {
20035
+ const groups = useMemo35(() => {
20045
20036
  const map = /* @__PURE__ */ new Map();
20046
20037
  for (const chunk of message.citations) {
20047
20038
  if (!chunk.nodeType || !chunk.nodeId) continue;
@@ -20054,7 +20045,7 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
20054
20045
  }
20055
20046
  return map;
20056
20047
  }, [message.citations]);
20057
- const groupsKey = useMemo34(() => {
20048
+ const groupsKey = useMemo35(() => {
20058
20049
  const parts = [];
20059
20050
  for (const [nodeType, ids] of groups) {
20060
20051
  parts.push(`${nodeType}:${Array.from(ids).sort().join(",")}`);
@@ -20096,12 +20087,12 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
20096
20087
  cancelled = true;
20097
20088
  };
20098
20089
  }, [groupsKey, groups]);
20099
- const sources = useMemo34(() => {
20090
+ const sources = useMemo35(() => {
20100
20091
  const map = /* @__PURE__ */ new Map();
20101
20092
  for (const entity of resolved) map.set(entity.id, entity);
20102
20093
  return map;
20103
20094
  }, [resolved]);
20104
- const users = useMemo34(() => {
20095
+ const users = useMemo35(() => {
20105
20096
  const userMap = /* @__PURE__ */ new Map();
20106
20097
  for (const entity of resolved) {
20107
20098
  const author = entity._author ?? (() => {
@@ -20147,7 +20138,7 @@ function MessageItem({
20147
20138
  isFailed && /* @__PURE__ */ jsxs140("div", { className: "text-destructive flex items-center gap-2 text-xs", children: [
20148
20139
  /* @__PURE__ */ jsx231(AlertCircle, { className: "h-3.5 w-3.5" }),
20149
20140
  /* @__PURE__ */ jsx231("span", { children: t("features.assistant.send_failed") }),
20150
- /* @__PURE__ */ jsx231("button", { type: "button", className: "underline", onClick: () => onRetry?.(message.id), children: t("features.assistant.retry") })
20141
+ /* @__PURE__ */ jsx231("button", { type: "button", onClick: () => onRetry?.(message.id), children: t("features.assistant.retry") })
20151
20142
  ] })
20152
20143
  ] });
20153
20144
  }
@@ -20312,14 +20303,7 @@ var NotificationErrorBoundary = class extends Component {
20312
20303
  if (this.state.hasError) {
20313
20304
  return this.props.fallback || /* @__PURE__ */ jsx236("div", { className: "flex items-center justify-center p-4 text-center", children: /* @__PURE__ */ jsxs144("div", { className: "text-muted-foreground text-sm", children: [
20314
20305
  /* @__PURE__ */ jsx236("p", { children: "Something went wrong with notifications." }),
20315
- /* @__PURE__ */ jsx236(
20316
- "button",
20317
- {
20318
- onClick: () => this.setState({ hasError: false }),
20319
- className: "text-primary mt-2 underline hover:no-underline",
20320
- children: "Try again"
20321
- }
20322
- )
20306
+ /* @__PURE__ */ jsx236("button", { onClick: () => this.setState({ hasError: false }), className: "text-primary mt-2", children: "Try again" })
20323
20307
  ] }) });
20324
20308
  }
20325
20309
  return this.props.children;
@@ -20424,7 +20408,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
20424
20408
  // src/features/notification/components/modals/NotificationModal.tsx
20425
20409
  import { BellIcon } from "lucide-react";
20426
20410
  import { useTranslations as useTranslations99 } from "next-intl";
20427
- import { Fragment as Fragment48, useCallback as useCallback40, useEffect as useEffect65, useMemo as useMemo35, useRef as useRef37, useState as useState87 } from "react";
20411
+ import { Fragment as Fragment48, useCallback as useCallback40, useEffect as useEffect65, useMemo as useMemo36, useRef as useRef37, useState as useState87 } from "react";
20428
20412
  import { jsx as jsx239, jsxs as jsxs147 } from "react/jsx-runtime";
20429
20413
  function NotificationModalContent({ isOpen, setIsOpen }) {
20430
20414
  const _instanceId = useRef37(Math.random().toString(36).substr(2, 9));
@@ -20468,7 +20452,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
20468
20452
  }
20469
20453
  return !breaker.isOpen;
20470
20454
  }, []);
20471
- const { unreadCount, unreadIds } = useMemo35(() => {
20455
+ const { unreadCount, unreadIds } = useMemo36(() => {
20472
20456
  const unreadNotifications2 = notifications.filter((notif) => !notif.isRead);
20473
20457
  return {
20474
20458
  unreadCount: unreadNotifications2.length,
@@ -21945,11 +21929,11 @@ function OAuthConsentScreen({
21945
21929
  /* @__PURE__ */ jsx260(CardFooter, { className: "justify-center", children: /* @__PURE__ */ jsxs164("p", { className: "text-xs text-center text-muted-foreground", children: [
21946
21930
  "By authorizing, you agree to the app's",
21947
21931
  " ",
21948
- /* @__PURE__ */ jsx260("a", { href: termsUrl, className: "underline hover:text-foreground", target: "_blank", rel: "noopener", children: "Terms of Service" }),
21932
+ /* @__PURE__ */ jsx260("a", { href: termsUrl, className: "hover:text-foreground", target: "_blank", rel: "noopener", children: "Terms of Service" }),
21949
21933
  " ",
21950
21934
  "and",
21951
21935
  " ",
21952
- /* @__PURE__ */ jsx260("a", { href: privacyUrl, className: "underline hover:text-foreground", target: "_blank", rel: "noopener", children: "Privacy Policy" }),
21936
+ /* @__PURE__ */ jsx260("a", { href: privacyUrl, className: "hover:text-foreground", target: "_blank", rel: "noopener", children: "Privacy Policy" }),
21953
21937
  "."
21954
21938
  ] }) })
21955
21939
  ] }) });
@@ -22179,9 +22163,9 @@ function WaitlistForm({ onSuccess }) {
22179
22163
  id: "gdprConsent",
22180
22164
  label: /* @__PURE__ */ jsxs166(Fragment54, { children: [
22181
22165
  t("auth.gdpr.terms_prefix"),
22182
- /* @__PURE__ */ jsx262(Link, { href: "/terms", target: "_blank", rel: "noopener", className: "underline", children: t("auth.gdpr.terms_of_service") }),
22166
+ /* @__PURE__ */ jsx262(Link, { href: "/terms", target: "_blank", rel: "noopener", children: t("auth.gdpr.terms_of_service") }),
22183
22167
  t("auth.gdpr.and"),
22184
- /* @__PURE__ */ jsx262(Link, { href: "/privacy", target: "_blank", rel: "noopener", className: "underline", children: t("auth.gdpr.privacy_policy") })
22168
+ /* @__PURE__ */ jsx262(Link, { href: "/privacy", target: "_blank", rel: "noopener", children: t("auth.gdpr.privacy_policy") })
22185
22169
  ] }),
22186
22170
  required: true
22187
22171
  }
@@ -22287,7 +22271,7 @@ __name(WaitlistConfirmation, "WaitlistConfirmation");
22287
22271
  import { flexRender as flexRender2, getCoreRowModel as getCoreRowModel2, useReactTable as useReactTable2 } from "@tanstack/react-table";
22288
22272
  import { RefreshCw as RefreshCw4, Users as Users2 } from "lucide-react";
22289
22273
  import { useTranslations as useTranslations110 } from "next-intl";
22290
- import { useCallback as useCallback48, useEffect as useEffect71, useState as useState98 } from "react";
22274
+ import { useCallback as useCallback48, useEffect as useEffect71, useMemo as useMemo37, useState as useState98 } from "react";
22291
22275
 
22292
22276
  // src/features/waitlist/hooks/useWaitlistTableStructure.tsx
22293
22277
  import { Send } from "lucide-react";
@@ -22416,6 +22400,16 @@ function WaitlistList() {
22416
22400
  }
22417
22401
  }, "handleInvite");
22418
22402
  const columns = useWaitlistTableStructure({ onInvite: handleInvite });
22403
+ const statusItems = useMemo37(
22404
+ () => ({
22405
+ all: t("waitlist.admin.all_statuses"),
22406
+ pending: t("waitlist.admin.status.pending"),
22407
+ confirmed: t("waitlist.admin.status.confirmed"),
22408
+ invited: t("waitlist.admin.status.invited"),
22409
+ registered: t("waitlist.admin.status.registered")
22410
+ }),
22411
+ [t]
22412
+ );
22419
22413
  const table = useReactTable2({
22420
22414
  data: entries,
22421
22415
  columns,
@@ -22433,7 +22427,7 @@ function WaitlistList() {
22433
22427
  ] })
22434
22428
  ] }),
22435
22429
  /* @__PURE__ */ jsxs171("div", { className: "flex items-center gap-4", children: [
22436
- /* @__PURE__ */ jsxs171(Select, { value: statusFilter, onValueChange: (value) => setStatusFilter(value ?? "all"), children: [
22430
+ /* @__PURE__ */ jsxs171(Select, { items: statusItems, value: statusFilter, onValueChange: (value) => setStatusFilter(value ?? "all"), children: [
22437
22431
  /* @__PURE__ */ jsx267(SelectTrigger, { className: "w-40", children: /* @__PURE__ */ jsx267(SelectValue, { placeholder: t("waitlist.admin.filter_placeholder") }) }),
22438
22432
  /* @__PURE__ */ jsxs171(SelectContent, { children: [
22439
22433
  /* @__PURE__ */ jsx267(SelectItem, { value: "all", children: t("waitlist.admin.all_statuses") }),
@@ -22457,7 +22451,7 @@ __name(WaitlistList, "WaitlistList");
22457
22451
  // src/features/rbac/components/RbacContainer.tsx
22458
22452
  import { Loader2Icon as Loader2Icon4 } from "lucide-react";
22459
22453
  import { useTranslations as useTranslations112 } from "next-intl";
22460
- import { memo as memo2, useCallback as useCallback50, useEffect as useEffect73, useMemo as useMemo36, useRef as useRef40, useState as useState100 } from "react";
22454
+ import { memo as memo2, useCallback as useCallback50, useEffect as useEffect73, useMemo as useMemo38, useRef as useRef40, useState as useState100 } from "react";
22461
22455
 
22462
22456
  // src/features/rbac/components/RbacPermissionCell.tsx
22463
22457
  import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon12 } from "lucide-react";
@@ -22812,11 +22806,11 @@ function RbacContainer() {
22812
22806
  setSelectedModuleId(id);
22813
22807
  setActivePicker(null);
22814
22808
  }, []);
22815
- const sortedModuleIds = useMemo36(() => {
22809
+ const sortedModuleIds = useMemo38(() => {
22816
22810
  if (!matrix) return [];
22817
22811
  return Object.keys(matrix).sort((a, b) => (moduleNames?.[a] ?? a).localeCompare(moduleNames?.[b] ?? b));
22818
22812
  }, [matrix, moduleNames]);
22819
- const roleIds = useMemo36(() => {
22813
+ const roleIds = useMemo38(() => {
22820
22814
  if (roleNames) {
22821
22815
  return Object.keys(roleNames).sort((a, b) => (roleNames[a] ?? a).localeCompare(roleNames[b] ?? b));
22822
22816
  }
@@ -22834,14 +22828,14 @@ function RbacContainer() {
22834
22828
  setSelectedModuleId(sortedModuleIds[0]);
22835
22829
  }
22836
22830
  }, [selectedModuleId, sortedModuleIds]);
22837
- const activeValue = useMemo36(() => {
22831
+ const activeValue = useMemo38(() => {
22838
22832
  if (!activePicker || !matrix) return void 0;
22839
22833
  const block = matrix[activePicker.moduleId];
22840
22834
  if (!block) return void 0;
22841
22835
  const tokens = activePicker.rowKey === "default" ? block.default : block[activePicker.rowKey];
22842
22836
  return cellValue(tokens, activePicker.action);
22843
22837
  }, [activePicker, matrix]);
22844
- const activeSegments = useMemo36(() => {
22838
+ const activeSegments = useMemo38(() => {
22845
22839
  if (!activePicker) return [];
22846
22840
  return modulePaths[activePicker.moduleId] ?? [];
22847
22841
  }, [activePicker, modulePaths]);
@@ -22912,7 +22906,7 @@ __name(RbacContainer, "RbacContainer");
22912
22906
  // src/features/rbac/components/RbacByRoleContainer.tsx
22913
22907
  import { Loader2Icon as Loader2Icon5 } from "lucide-react";
22914
22908
  import { useTranslations as useTranslations113 } from "next-intl";
22915
- import { Fragment as Fragment56, memo as memo3, useCallback as useCallback51, useEffect as useEffect74, useMemo as useMemo37, useRef as useRef41, useState as useState101 } from "react";
22909
+ import { Fragment as Fragment56, memo as memo3, useCallback as useCallback51, useEffect as useEffect74, useMemo as useMemo39, useRef as useRef41, useState as useState101 } from "react";
22916
22910
  import { jsx as jsx271, jsxs as jsxs175 } from "react/jsx-runtime";
22917
22911
  function findToken2(tokens, action) {
22918
22912
  if (!tokens) return void 0;
@@ -22962,11 +22956,11 @@ function RbacByRoleContainer() {
22962
22956
  setSelectedRoleId(id);
22963
22957
  setActivePicker(null);
22964
22958
  }, []);
22965
- const sortedRoleIds = useMemo37(() => {
22959
+ const sortedRoleIds = useMemo39(() => {
22966
22960
  if (!roleNames) return [];
22967
22961
  return Object.keys(roleNames).sort((a, b) => (roleNames[a] ?? a).localeCompare(roleNames[b] ?? b));
22968
22962
  }, [roleNames]);
22969
- const sortedModuleIds = useMemo37(() => {
22963
+ const sortedModuleIds = useMemo39(() => {
22970
22964
  if (!matrix) return [];
22971
22965
  return Object.keys(matrix).sort((a, b) => (moduleNames?.[a] ?? a).localeCompare(moduleNames?.[b] ?? b));
22972
22966
  }, [matrix, moduleNames]);
@@ -22975,14 +22969,14 @@ function RbacByRoleContainer() {
22975
22969
  setSelectedRoleId(sortedRoleIds[0]);
22976
22970
  }
22977
22971
  }, [selectedRoleId, sortedRoleIds]);
22978
- const activeValue = useMemo37(() => {
22972
+ const activeValue = useMemo39(() => {
22979
22973
  if (!activePicker || !matrix) return void 0;
22980
22974
  const block = matrix[activePicker.moduleId];
22981
22975
  if (!block) return void 0;
22982
22976
  const tokens = activePicker.rowKey === "default" ? block.default : block[activePicker.rowKey];
22983
22977
  return cellValue2(tokens, activePicker.action);
22984
22978
  }, [activePicker, matrix]);
22985
- const activeSegments = useMemo37(() => {
22979
+ const activeSegments = useMemo39(() => {
22986
22980
  if (!activePicker) return [];
22987
22981
  return modulePaths[activePicker.moduleId] ?? [];
22988
22982
  }, [activePicker, modulePaths]);
@@ -23386,6 +23380,7 @@ export {
23386
23380
  TableCellAvatar,
23387
23381
  HeaderChildrenProvider,
23388
23382
  useHeaderChildren,
23383
+ useHeaderRootLabel,
23389
23384
  HeaderLeftContentProvider,
23390
23385
  useHeaderLeftContent,
23391
23386
  BreadcrumbNavigation,
@@ -23626,4 +23621,4 @@ export {
23626
23621
  useOAuthClients,
23627
23622
  useOAuthClient
23628
23623
  };
23629
- //# sourceMappingURL=chunk-MDXT47V4.mjs.map
23624
+ //# sourceMappingURL=chunk-67LIVKYU.mjs.map