@carlonicora/nextjs-jsonapi 1.45.3 → 1.46.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.
@@ -10765,7 +10765,7 @@ function PageContainer({ children, testId, className }) {
10765
10765
  const headerChildren = useHeaderChildren();
10766
10766
  return /* @__PURE__ */ jsxs70("div", { className: `flex h-full w-full flex-col`, "data-testid": testId, children: [
10767
10767
  /* @__PURE__ */ jsx121(Header, { children: headerChildren }),
10768
- /* @__PURE__ */ jsx121("main", { className: cn(`flex w-full flex-1 flex-col gap-y-4 pt-4 pl-4 pr-0 pb-20`, className), children })
10768
+ /* @__PURE__ */ jsx121("main", { className: cn(`flex w-full flex-1 flex-col gap-y-4 pt-4 pl-4 pr-0`, className), children })
10769
10769
  ] });
10770
10770
  }
10771
10771
  __name(PageContainer, "PageContainer");
@@ -10925,7 +10925,7 @@ __name(AllowedUsersDetails, "AllowedUsersDetails");
10925
10925
  import dynamic from "next/dynamic";
10926
10926
  import React15 from "react";
10927
10927
  import { jsx as jsx126 } from "react/jsx-runtime";
10928
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-YLP2YIAL.mjs"), {
10928
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-WBCUJKNR.mjs"), {
10929
10929
  ssr: false
10930
10930
  });
10931
10931
  var BlockNoteEditorContainer = React15.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -11054,7 +11054,11 @@ var cellDate = /* @__PURE__ */ __name((params) => {
11054
11054
  id: params.name,
11055
11055
  accessorKey: params.name,
11056
11056
  header: params.title,
11057
- cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx129("span", { className: "text-muted-foreground text-xs", children: row.getValue(params.name).toLocaleDateString("en", { dateStyle: "medium" }) }), "cell"),
11057
+ cell: /* @__PURE__ */ __name(({ row }) => {
11058
+ const date = row.getValue(params.name);
11059
+ if (!date) return null;
11060
+ return /* @__PURE__ */ jsx129("span", { className: "text-muted-foreground text-xs", children: date.toLocaleDateString("en", { dateStyle: "medium" }) });
11061
+ }, "cell"),
11058
11062
  enableSorting: false,
11059
11063
  enableHiding: false
11060
11064
  };
@@ -12059,9 +12063,9 @@ registerTableGenerator("users", useUserTableStructure);
12059
12063
  registerTableGenerator("companies", useCompanyTableStructure);
12060
12064
 
12061
12065
  // src/components/tables/ContentListTable.tsx
12062
- import { flexRender, getCoreRowModel, useReactTable } from "@tanstack/react-table";
12066
+ import { flexRender, getCoreRowModel, getExpandedRowModel, useReactTable } from "@tanstack/react-table";
12063
12067
  import { ChevronLeft, ChevronRight } from "lucide-react";
12064
- import { memo, useMemo as useMemo19 } from "react";
12068
+ import { memo, useMemo as useMemo19, useState as useState46 } from "react";
12065
12069
 
12066
12070
  // src/components/tables/ContentTableSearch.tsx
12067
12071
  import { RefreshCw, Search, X as X2 } from "lucide-react";
@@ -12158,6 +12162,7 @@ import { Fragment as Fragment19, jsx as jsx139, jsxs as jsxs80 } from "react/jsx
12158
12162
  var EMPTY_ARRAY = [];
12159
12163
  var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(props) {
12160
12164
  const { data, fields, checkedIds, toggleId, allowSearch, filters: _filters } = props;
12165
+ const [expanded, setExpanded] = useState46({});
12161
12166
  const { data: tableData, columns: tableColumns } = useTableGenerator(props.tableGeneratorType, {
12162
12167
  data: data?.data ?? EMPTY_ARRAY,
12163
12168
  fields,
@@ -12180,6 +12185,12 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
12180
12185
  data: tableData,
12181
12186
  columns: tableColumns,
12182
12187
  getCoreRowModel: getCoreRowModel(),
12188
+ ...props.expandable && {
12189
+ getExpandedRowModel: getExpandedRowModel(),
12190
+ getSubRows: props.getSubRows,
12191
+ onExpandedChange: setExpanded,
12192
+ state: { expanded }
12193
+ },
12183
12194
  initialState: {
12184
12195
  columnVisibility
12185
12196
  }
@@ -12197,10 +12208,14 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
12197
12208
  ] })
12198
12209
  ] }) }) }),
12199
12210
  table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx139(TableRow, { children: headerGroup.headers.map((header) => {
12200
- return /* @__PURE__ */ jsx139(TableHead, { children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }, header.id);
12211
+ const meta = header.column.columnDef.meta;
12212
+ return /* @__PURE__ */ jsx139(TableHead, { className: meta?.className, children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }, header.id);
12201
12213
  }) }, headerGroup.id))
12202
12214
  ] }),
12203
- /* @__PURE__ */ jsx139(TableBody, { children: rowModel && rowModel.rows?.length ? rowModel.rows.map((row) => /* @__PURE__ */ jsx139(TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx139(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) : /* @__PURE__ */ jsx139(TableRow, { children: /* @__PURE__ */ jsx139(TableCell, { colSpan: tableColumns.length, className: "h-24 text-center", children: "No results." }) }) }),
12215
+ /* @__PURE__ */ jsx139(TableBody, { children: rowModel && rowModel.rows?.length ? rowModel.rows.map((row) => /* @__PURE__ */ jsx139(TableRow, { children: row.getVisibleCells().map((cell) => {
12216
+ const meta = cell.column.columnDef.meta;
12217
+ return /* @__PURE__ */ jsx139(TableCell, { className: meta?.className, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id);
12218
+ }) }, row.id)) : /* @__PURE__ */ jsx139(TableRow, { children: /* @__PURE__ */ jsx139(TableCell, { colSpan: tableColumns.length, className: "h-24 text-center", children: "No results." }) }) }),
12204
12219
  showFooter && /* @__PURE__ */ jsx139(TableFooter, { children: /* @__PURE__ */ jsx139(TableRow, { children: /* @__PURE__ */ jsx139(TableCell, { colSpan: tableColumns.length, className: "bg-card py-4 text-right", children: /* @__PURE__ */ jsxs80("div", { className: "flex items-center justify-end space-x-2", children: [
12205
12220
  /* @__PURE__ */ jsx139(
12206
12221
  Button,
@@ -12237,7 +12252,7 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
12237
12252
  import Image9 from "next/image";
12238
12253
 
12239
12254
  // src/features/auth/contexts/AuthContext.tsx
12240
- import { createContext as createContext16, useContext as useContext17, useMemo as useMemo20, useState as useState47 } from "react";
12255
+ import { createContext as createContext16, useContext as useContext17, useMemo as useMemo20, useState as useState48 } from "react";
12241
12256
 
12242
12257
  // src/features/auth/components/forms/Register.tsx
12243
12258
  import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
@@ -12245,7 +12260,7 @@ import { Loader2 as Loader23 } from "lucide-react";
12245
12260
  import { useTranslations as useTranslations49 } from "next-intl";
12246
12261
  import Image8 from "next/image";
12247
12262
  import { useSearchParams } from "next/navigation";
12248
- import { useEffect as useEffect40, useState as useState46 } from "react";
12263
+ import { useEffect as useEffect40, useState as useState47 } from "react";
12249
12264
  import { useForm as useForm4 } from "react-hook-form";
12250
12265
  import { v4 as v44 } from "uuid";
12251
12266
  import { z as z4 } from "zod";
@@ -12316,13 +12331,13 @@ function Register() {
12316
12331
  const searchParams = useSearchParams();
12317
12332
  const inviteCode = searchParams.get("invite");
12318
12333
  const registrationMode = getRegistrationMode();
12319
- const [showConfirmation, setShowConfirmation] = useState46(false);
12320
- const [inviteValidated, setInviteValidated] = useState46(false);
12321
- const [inviteError, setInviteError] = useState46("");
12322
- const [isValidatingInvite, setIsValidatingInvite] = useState46(
12334
+ const [showConfirmation, setShowConfirmation] = useState47(false);
12335
+ const [inviteValidated, setInviteValidated] = useState47(false);
12336
+ const [inviteError, setInviteError] = useState47("");
12337
+ const [isValidatingInvite, setIsValidatingInvite] = useState47(
12323
12338
  registrationMode === "waitlist" && !!inviteCode
12324
12339
  );
12325
- const [referralCode, setReferralCode2] = useState46(null);
12340
+ const [referralCode, setReferralCode2] = useState47(null);
12326
12341
  useEffect40(() => {
12327
12342
  const code = getReferralCode();
12328
12343
  console.log("[REFERRAL] Register.tsx - cookie value on mount:", code);
@@ -12596,9 +12611,9 @@ var AuthContextProvider = /* @__PURE__ */ __name(({
12596
12611
  initialComponentType,
12597
12612
  initialParams
12598
12613
  }) => {
12599
- const [componentType, setComponentType] = useState47(initialComponentType);
12600
- const [params, setParams] = useState47(initialParams);
12601
- const [pendingTwoFactor, setPendingTwoFactor] = useState47();
12614
+ const [componentType, setComponentType] = useState48(initialComponentType);
12615
+ const [params, setParams] = useState48(initialParams);
12616
+ const [pendingTwoFactor, setPendingTwoFactor] = useState48();
12602
12617
  const activeComponent = useMemo20(() => {
12603
12618
  if (componentType === void 0) return null;
12604
12619
  switch (componentType) {
@@ -12660,20 +12675,20 @@ __name(InnerAuthContainer, "InnerAuthContainer");
12660
12675
  // src/features/auth/components/two-factor/TwoFactorSettings.tsx
12661
12676
  import { ShieldAlert, ShieldCheck } from "lucide-react";
12662
12677
  import { useTranslations as useTranslations56 } from "next-intl";
12663
- import { useCallback as useCallback22, useEffect as useEffect42, useState as useState55 } from "react";
12678
+ import { useCallback as useCallback22, useEffect as useEffect42, useState as useState56 } from "react";
12664
12679
  import { v4 as v47 } from "uuid";
12665
12680
 
12666
12681
  // src/features/auth/components/two-factor/BackupCodesDialog.tsx
12667
12682
  import { Copy, Download, RefreshCw as RefreshCw2 } from "lucide-react";
12668
12683
  import { useTranslations as useTranslations50 } from "next-intl";
12669
- import { useState as useState48 } from "react";
12684
+ import { useState as useState49 } from "react";
12670
12685
  import { jsx as jsx144, jsxs as jsxs83 } from "react/jsx-runtime";
12671
12686
  function BackupCodesDialog({ remainingCodes, onRegenerate, trigger }) {
12672
12687
  const t = useTranslations50();
12673
- const [open, setOpen] = useState48(false);
12674
- const [codes, setCodes] = useState48([]);
12675
- const [isLoading, setIsLoading] = useState48(false);
12676
- const [showCodes, setShowCodes] = useState48(false);
12688
+ const [open, setOpen] = useState49(false);
12689
+ const [codes, setCodes] = useState49([]);
12690
+ const [isLoading, setIsLoading] = useState49(false);
12691
+ const [showCodes, setShowCodes] = useState49(false);
12677
12692
  const handleGenerate = /* @__PURE__ */ __name(async () => {
12678
12693
  setIsLoading(true);
12679
12694
  try {
@@ -12768,13 +12783,13 @@ __name(BackupCodesDialog, "BackupCodesDialog");
12768
12783
 
12769
12784
  // src/features/auth/components/two-factor/DisableTwoFactorDialog.tsx
12770
12785
  import { useTranslations as useTranslations51 } from "next-intl";
12771
- import { useState as useState50 } from "react";
12786
+ import { useState as useState51 } from "react";
12772
12787
 
12773
12788
  // src/features/auth/components/two-factor/TotpInput.tsx
12774
- import { useEffect as useEffect41, useRef as useRef19, useState as useState49 } from "react";
12789
+ import { useEffect as useEffect41, useRef as useRef19, useState as useState50 } from "react";
12775
12790
  import { jsx as jsx145, jsxs as jsxs84 } from "react/jsx-runtime";
12776
12791
  function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
12777
- const [digits, setDigits] = useState49(["", "", "", "", "", ""]);
12792
+ const [digits, setDigits] = useState50(["", "", "", "", "", ""]);
12778
12793
  const inputRefs = useRef19([]);
12779
12794
  useEffect41(() => {
12780
12795
  if (autoFocus && inputRefs.current[0]) {
@@ -12838,9 +12853,9 @@ __name(TotpInput, "TotpInput");
12838
12853
  import { jsx as jsx146, jsxs as jsxs85 } from "react/jsx-runtime";
12839
12854
  function DisableTwoFactorDialog({ onSuccess, trigger }) {
12840
12855
  const t = useTranslations51();
12841
- const [open, setOpen] = useState50(false);
12842
- const [isLoading, setIsLoading] = useState50(false);
12843
- const [error, setError] = useState50();
12856
+ const [open, setOpen] = useState51(false);
12857
+ const [isLoading, setIsLoading] = useState51(false);
12858
+ const [error, setError] = useState51();
12844
12859
  const handleVerify = /* @__PURE__ */ __name(async (code) => {
12845
12860
  setIsLoading(true);
12846
12861
  setError(void 0);
@@ -12881,14 +12896,14 @@ __name(DisableTwoFactorDialog, "DisableTwoFactorDialog");
12881
12896
  // src/features/auth/components/two-factor/PasskeyList.tsx
12882
12897
  import { Edit, Key, Trash2 } from "lucide-react";
12883
12898
  import { useTranslations as useTranslations52 } from "next-intl";
12884
- import { useState as useState51 } from "react";
12899
+ import { useState as useState52 } from "react";
12885
12900
  import { Fragment as Fragment22, jsx as jsx147, jsxs as jsxs86 } from "react/jsx-runtime";
12886
12901
  function PasskeyList({ passkeys, onRefresh }) {
12887
12902
  const t = useTranslations52();
12888
- const [renameDialogOpen, setRenameDialogOpen] = useState51(false);
12889
- const [selectedPasskey, setSelectedPasskey] = useState51(null);
12890
- const [newName, setNewName] = useState51("");
12891
- const [isLoading, setIsLoading] = useState51(false);
12903
+ const [renameDialogOpen, setRenameDialogOpen] = useState52(false);
12904
+ const [selectedPasskey, setSelectedPasskey] = useState52(null);
12905
+ const [newName, setNewName] = useState52("");
12906
+ const [isLoading, setIsLoading] = useState52(false);
12892
12907
  const handleDelete = /* @__PURE__ */ __name(async (passkey) => {
12893
12908
  setIsLoading(true);
12894
12909
  try {
@@ -13002,14 +13017,14 @@ __name(PasskeyList, "PasskeyList");
13002
13017
  // src/features/auth/components/two-factor/PasskeySetupDialog.tsx
13003
13018
  import { startRegistration } from "@simplewebauthn/browser";
13004
13019
  import { useTranslations as useTranslations53 } from "next-intl";
13005
- import { useState as useState52 } from "react";
13020
+ import { useState as useState53 } from "react";
13006
13021
  import { v4 as v45 } from "uuid";
13007
13022
  import { jsx as jsx148, jsxs as jsxs87 } from "react/jsx-runtime";
13008
13023
  function PasskeySetupDialog({ open, onOpenChange, onSuccess }) {
13009
13024
  const t = useTranslations53();
13010
13025
  const { currentUser } = useCurrentUserContext();
13011
- const [name, setName] = useState52("");
13012
- const [isLoading, setIsLoading] = useState52(false);
13026
+ const [name, setName] = useState53("");
13027
+ const [isLoading, setIsLoading] = useState53(false);
13013
13028
  const handleRegister = /* @__PURE__ */ __name(async () => {
13014
13029
  if (!name.trim()) return;
13015
13030
  setIsLoading(true);
@@ -13073,11 +13088,11 @@ __name(PasskeySetupDialog, "PasskeySetupDialog");
13073
13088
  // src/features/auth/components/two-factor/TotpAuthenticatorList.tsx
13074
13089
  import { Smartphone, Trash2 as Trash22 } from "lucide-react";
13075
13090
  import { useTranslations as useTranslations54 } from "next-intl";
13076
- import { useState as useState53 } from "react";
13091
+ import { useState as useState54 } from "react";
13077
13092
  import { jsx as jsx149, jsxs as jsxs88 } from "react/jsx-runtime";
13078
13093
  function TotpAuthenticatorList({ authenticators, onDelete }) {
13079
13094
  const t = useTranslations54();
13080
- const [deletingId, setDeletingId] = useState53(null);
13095
+ const [deletingId, setDeletingId] = useState54(null);
13081
13096
  const handleDelete = /* @__PURE__ */ __name(async (id) => {
13082
13097
  setDeletingId(id);
13083
13098
  try {
@@ -13148,19 +13163,19 @@ __name(TotpAuthenticatorList, "TotpAuthenticatorList");
13148
13163
  // src/features/auth/components/two-factor/TotpSetupDialog.tsx
13149
13164
  import { useTranslations as useTranslations55 } from "next-intl";
13150
13165
  import { QRCodeSVG } from "qrcode.react";
13151
- import { useState as useState54 } from "react";
13166
+ import { useState as useState55 } from "react";
13152
13167
  import { v4 as v46 } from "uuid";
13153
13168
  import { jsx as jsx150, jsxs as jsxs89 } from "react/jsx-runtime";
13154
13169
  function TotpSetupDialog({ onSuccess, trigger }) {
13155
13170
  const t = useTranslations55();
13156
13171
  const { currentUser } = useCurrentUserContext();
13157
- const [open, setOpen] = useState54(false);
13158
- const [step, setStep] = useState54("name");
13159
- const [name, setName] = useState54("");
13160
- const [qrCodeUri, setQrCodeUri] = useState54("");
13161
- const [authenticatorId, setAuthenticatorId] = useState54("");
13162
- const [isLoading, setIsLoading] = useState54(false);
13163
- const [verifyError, setVerifyError] = useState54();
13172
+ const [open, setOpen] = useState55(false);
13173
+ const [step, setStep] = useState55("name");
13174
+ const [name, setName] = useState55("");
13175
+ const [qrCodeUri, setQrCodeUri] = useState55("");
13176
+ const [authenticatorId, setAuthenticatorId] = useState55("");
13177
+ const [isLoading, setIsLoading] = useState55(false);
13178
+ const [verifyError, setVerifyError] = useState55();
13164
13179
  const handleStartSetup = /* @__PURE__ */ __name(async () => {
13165
13180
  if (!name.trim()) return;
13166
13181
  setIsLoading(true);
@@ -13258,12 +13273,12 @@ __name(TotpSetupDialog, "TotpSetupDialog");
13258
13273
  import { Fragment as Fragment23, jsx as jsx151, jsxs as jsxs90 } from "react/jsx-runtime";
13259
13274
  function TwoFactorSettings() {
13260
13275
  const t = useTranslations56();
13261
- const [status, setStatus] = useState55(null);
13262
- const [authenticators, setAuthenticators] = useState55([]);
13263
- const [passkeys, setPasskeys] = useState55([]);
13264
- const [isLoading, setIsLoading] = useState55(true);
13265
- const [isEnabling, setIsEnabling] = useState55(false);
13266
- const [passkeyDialogOpen, setPasskeyDialogOpen] = useState55(false);
13276
+ const [status, setStatus] = useState56(null);
13277
+ const [authenticators, setAuthenticators] = useState56([]);
13278
+ const [passkeys, setPasskeys] = useState56([]);
13279
+ const [isLoading, setIsLoading] = useState56(true);
13280
+ const [isEnabling, setIsEnabling] = useState56(false);
13281
+ const [passkeyDialogOpen, setPasskeyDialogOpen] = useState56(false);
13267
13282
  const loadStatus = useCallback22(async () => {
13268
13283
  try {
13269
13284
  const [statusData, authenticatorsList, passkeysList] = await Promise.all([
@@ -13470,14 +13485,14 @@ __name(LandingComponent, "LandingComponent");
13470
13485
  import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
13471
13486
  import { useTranslations as useTranslations58 } from "next-intl";
13472
13487
  import Image11 from "next/image";
13473
- import { useEffect as useEffect43, useState as useState56 } from "react";
13488
+ import { useEffect as useEffect43, useState as useState57 } from "react";
13474
13489
  import { useForm as useForm5 } from "react-hook-form";
13475
13490
  import { z as z5 } from "zod";
13476
13491
  import { Fragment as Fragment25, jsx as jsx155, jsxs as jsxs93 } from "react/jsx-runtime";
13477
13492
  function AcceptInvitation() {
13478
13493
  const { setComponentType, params, setParams } = useAuthContext();
13479
- const [showConfirmation, setShowConfirmation] = useState56(false);
13480
- const [error, setError] = useState56(void 0);
13494
+ const [showConfirmation, setShowConfirmation] = useState57(false);
13495
+ const [error, setError] = useState57(void 0);
13481
13496
  const t = useTranslations58();
13482
13497
  useEffect43(() => {
13483
13498
  async function validateCode(code) {
@@ -13572,12 +13587,12 @@ __name(AcceptInvitation, "AcceptInvitation");
13572
13587
  // src/features/auth/components/forms/ActivateAccount.tsx
13573
13588
  import { useTranslations as useTranslations59 } from "next-intl";
13574
13589
  import Image12 from "next/image";
13575
- import { useEffect as useEffect44, useState as useState57 } from "react";
13590
+ import { useEffect as useEffect44, useState as useState58 } from "react";
13576
13591
  import { Fragment as Fragment26, jsx as jsx156, jsxs as jsxs94 } from "react/jsx-runtime";
13577
13592
  function ActivateAccount() {
13578
13593
  const { setComponentType, params, setParams } = useAuthContext();
13579
- const [showConfirmation, setShowConfirmation] = useState57(false);
13580
- const [error, setError] = useState57(void 0);
13594
+ const [showConfirmation, setShowConfirmation] = useState58(false);
13595
+ const [error, setError] = useState58(void 0);
13581
13596
  const t = useTranslations59();
13582
13597
  useEffect44(() => {
13583
13598
  async function ActivateAccount2(code) {
@@ -13620,11 +13635,11 @@ function ActivateAccount() {
13620
13635
  __name(ActivateAccount, "ActivateAccount");
13621
13636
 
13622
13637
  // src/features/auth/components/forms/Cookies.tsx
13623
- import { useEffect as useEffect45, useState as useState58 } from "react";
13638
+ import { useEffect as useEffect45, useState as useState59 } from "react";
13624
13639
  function Cookies({ dehydratedAuth, page }) {
13625
13640
  const { setUser } = useCurrentUserContext();
13626
13641
  const router = useI18nRouter();
13627
- const [hasSaved, setHasSaved] = useState58(false);
13642
+ const [hasSaved, setHasSaved] = useState59(false);
13628
13643
  useEffect45(() => {
13629
13644
  if (hasSaved) return;
13630
13645
  async function saveTokenOnServer() {
@@ -13648,14 +13663,14 @@ __name(Cookies, "Cookies");
13648
13663
  import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
13649
13664
  import { useTranslations as useTranslations60 } from "next-intl";
13650
13665
  import Image13 from "next/image";
13651
- import { useState as useState59 } from "react";
13666
+ import { useState as useState60 } from "react";
13652
13667
  import { useForm as useForm6 } from "react-hook-form";
13653
13668
  import { z as z6 } from "zod";
13654
13669
  import { Fragment as Fragment27, jsx as jsx157, jsxs as jsxs95 } from "react/jsx-runtime";
13655
13670
  function ForgotPassword() {
13656
13671
  const t = useTranslations60();
13657
13672
  const { setComponentType } = useAuthContext();
13658
- const [showConfirmation, setShowConfirmation] = useState59(false);
13673
+ const [showConfirmation, setShowConfirmation] = useState60(false);
13659
13674
  const formSchema = z6.object({
13660
13675
  email: z6.string().email({
13661
13676
  message: t(`common.errors.invalid_email`)
@@ -13720,7 +13735,7 @@ import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
13720
13735
  import { useTranslations as useTranslations61 } from "next-intl";
13721
13736
  import Image14 from "next/image";
13722
13737
  import { useRouter, useSearchParams as useSearchParams2 } from "next/navigation";
13723
- import { useEffect as useEffect46, useState as useState60 } from "react";
13738
+ import { useEffect as useEffect46, useState as useState61 } from "react";
13724
13739
  import { useForm as useForm7 } from "react-hook-form";
13725
13740
  import { z as z7 } from "zod";
13726
13741
  import { Fragment as Fragment28, jsx as jsx158, jsxs as jsxs96 } from "react/jsx-runtime";
@@ -13733,7 +13748,7 @@ function Login() {
13733
13748
  const nativeRouter = useRouter();
13734
13749
  const searchParams = useSearchParams2();
13735
13750
  const callbackUrl = searchParams.get("callbackUrl");
13736
- const [referralCode, setReferralCode2] = useState60(null);
13751
+ const [referralCode, setReferralCode2] = useState61(null);
13737
13752
  useEffect46(() => {
13738
13753
  const cookies = document.cookie.split("; ");
13739
13754
  for (const cookie of cookies) {
@@ -13916,14 +13931,14 @@ __name(RefreshUser, "RefreshUser");
13916
13931
  import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
13917
13932
  import { useTranslations as useTranslations62 } from "next-intl";
13918
13933
  import Image15 from "next/image";
13919
- import { useEffect as useEffect49, useState as useState61 } from "react";
13934
+ import { useEffect as useEffect49, useState as useState62 } from "react";
13920
13935
  import { useForm as useForm8 } from "react-hook-form";
13921
13936
  import { z as z8 } from "zod";
13922
13937
  import { Fragment as Fragment30, jsx as jsx160, jsxs as jsxs97 } from "react/jsx-runtime";
13923
13938
  function ResetPassword() {
13924
13939
  const { setComponentType, params, setParams } = useAuthContext();
13925
- const [showConfirmation, setShowConfirmation] = useState61(false);
13926
- const [error, setError] = useState61(void 0);
13940
+ const [showConfirmation, setShowConfirmation] = useState62(false);
13941
+ const [error, setError] = useState62(void 0);
13927
13942
  const t = useTranslations62();
13928
13943
  useEffect49(() => {
13929
13944
  async function validateResetPasswordCode(code) {
@@ -14002,18 +14017,18 @@ __name(ResetPassword, "ResetPassword");
14002
14017
  // src/features/auth/components/forms/TwoFactorChallenge.tsx
14003
14018
  import { useTranslations as useTranslations64 } from "next-intl";
14004
14019
  import { useRouter as useRouter2, useSearchParams as useSearchParams3 } from "next/navigation";
14005
- import { useState as useState63 } from "react";
14020
+ import { useState as useState64 } from "react";
14006
14021
  import { v4 as v49 } from "uuid";
14007
14022
 
14008
14023
  // src/features/auth/components/two-factor/PasskeyButton.tsx
14009
14024
  import { startAuthentication } from "@simplewebauthn/browser";
14010
14025
  import { useTranslations as useTranslations63 } from "next-intl";
14011
- import { useState as useState62 } from "react";
14026
+ import { useState as useState63 } from "react";
14012
14027
  import { v4 as v48 } from "uuid";
14013
14028
  import { jsx as jsx161 } from "react/jsx-runtime";
14014
14029
  function PasskeyButton({ pendingToken, onSuccess, onError, disabled = false }) {
14015
14030
  const t = useTranslations63();
14016
- const [isLoading, setIsLoading] = useState62(false);
14031
+ const [isLoading, setIsLoading] = useState63(false);
14017
14032
  const handleClick = /* @__PURE__ */ __name(async () => {
14018
14033
  setIsLoading(true);
14019
14034
  try {
@@ -14058,10 +14073,10 @@ function TwoFactorChallenge() {
14058
14073
  const nativeRouter = useRouter2();
14059
14074
  const searchParams = useSearchParams3();
14060
14075
  const callbackUrl = searchParams.get("callbackUrl");
14061
- const [isVerifying, setIsVerifying] = useState63(false);
14062
- const [totpError, setTotpError] = useState63();
14063
- const [backupCode, setBackupCode] = useState63("");
14064
- const [backupError, setBackupError] = useState63();
14076
+ const [isVerifying, setIsVerifying] = useState64(false);
14077
+ const [totpError, setTotpError] = useState64();
14078
+ const [backupCode, setBackupCode] = useState64("");
14079
+ const [backupError, setBackupError] = useState64();
14065
14080
  if (!pendingTwoFactor) {
14066
14081
  return null;
14067
14082
  }
@@ -14394,7 +14409,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
14394
14409
  // src/features/notification/components/modals/NotificationModal.tsx
14395
14410
  import { BellIcon } from "lucide-react";
14396
14411
  import { useTranslations as useTranslations70 } from "next-intl";
14397
- import { Fragment as Fragment33, useCallback as useCallback23, useEffect as useEffect50, useMemo as useMemo21, useRef as useRef20, useState as useState64 } from "react";
14412
+ import { Fragment as Fragment33, useCallback as useCallback23, useEffect as useEffect50, useMemo as useMemo21, useRef as useRef20, useState as useState65 } from "react";
14398
14413
  import { jsx as jsx169, jsxs as jsxs103 } from "react/jsx-runtime";
14399
14414
  function NotificationModalContent({ isOpen, setIsOpen }) {
14400
14415
  const _instanceId = useRef20(Math.random().toString(36).substr(2, 9));
@@ -14417,7 +14432,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
14417
14432
  } = useSocketContext();
14418
14433
  const t = useTranslations70();
14419
14434
  const generateUrl = usePageUrlGenerator();
14420
- const [newNotifications, setNewNotifications] = useState64(false);
14435
+ const [newNotifications, setNewNotifications] = useState65(false);
14421
14436
  const preventAutoClose = useRef20(false);
14422
14437
  const circuitBreakerRef = useRef20({
14423
14438
  count: 0,
@@ -14621,14 +14636,14 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
14621
14636
 
14622
14637
  // src/features/referral/components/ReferralWidget.tsx
14623
14638
  import { Copy as Copy2, Loader2 as Loader24, Mail, Users } from "lucide-react";
14624
- import { useCallback as useCallback24, useRef as useRef21, useState as useState67 } from "react";
14639
+ import { useCallback as useCallback24, useRef as useRef21, useState as useState68 } from "react";
14625
14640
 
14626
14641
  // src/features/referral/hooks/useReferralInvite.ts
14627
- import { useState as useState65 } from "react";
14642
+ import { useState as useState66 } from "react";
14628
14643
  function useReferralInvite() {
14629
- const [sending, setSending] = useState65(false);
14630
- const [error, setError] = useState65(null);
14631
- const [success, setSuccess] = useState65(false);
14644
+ const [sending, setSending] = useState66(false);
14645
+ const [error, setError] = useState66(null);
14646
+ const [success, setSuccess] = useState66(false);
14632
14647
  const sendInvite = /* @__PURE__ */ __name(async (email) => {
14633
14648
  if (!isReferralEnabled()) {
14634
14649
  return;
@@ -14650,11 +14665,11 @@ function useReferralInvite() {
14650
14665
  __name(useReferralInvite, "useReferralInvite");
14651
14666
 
14652
14667
  // src/features/referral/hooks/useReferralStats.ts
14653
- import { useEffect as useEffect52, useState as useState66 } from "react";
14668
+ import { useEffect as useEffect52, useState as useState67 } from "react";
14654
14669
  function useReferralStats() {
14655
- const [stats, setStats] = useState66(null);
14656
- const [loading, setLoading] = useState66(true);
14657
- const [error, setError] = useState66(null);
14670
+ const [stats, setStats] = useState67(null);
14671
+ const [loading, setLoading] = useState67(true);
14672
+ const [error, setError] = useState67(null);
14658
14673
  useEffect52(() => {
14659
14674
  if (!isReferralEnabled()) {
14660
14675
  setLoading(false);
@@ -14725,8 +14740,8 @@ function ReferralWidget({
14725
14740
  const t = { ...DEFAULT_TRANSLATIONS, ...translations };
14726
14741
  const { stats, loading, error } = useReferralStats();
14727
14742
  const { sendInvite, sending } = useReferralInvite();
14728
- const [email, setEmail] = useState67("");
14729
- const [copied, setCopied] = useState67(false);
14743
+ const [email, setEmail] = useState68("");
14744
+ const [copied, setCopied] = useState68(false);
14730
14745
  const linkInputRef = useRef21(null);
14731
14746
  const config = getReferralConfig();
14732
14747
  const baseUrl = config.referralUrlBase || (typeof window !== "undefined" ? window.location.origin : "");
@@ -14938,11 +14953,11 @@ __name(FormRoles, "FormRoles");
14938
14953
 
14939
14954
  // src/features/role/components/forms/RemoveUserFromRole.tsx
14940
14955
  import { useTranslations as useTranslations73 } from "next-intl";
14941
- import { useEffect as useEffect53, useState as useState68 } from "react";
14956
+ import { useEffect as useEffect53, useState as useState69 } from "react";
14942
14957
  import { Fragment as Fragment36, jsx as jsx176, jsxs as jsxs108 } from "react/jsx-runtime";
14943
14958
  function RemoveUserFromRole({ role, user, refresh }) {
14944
- const [open, setOpen] = useState68(false);
14945
- const [canRemove, setCanRemove] = useState68(false);
14959
+ const [open, setOpen] = useState69(false);
14960
+ const [canRemove, setCanRemove] = useState69(false);
14946
14961
  const t = useTranslations73();
14947
14962
  useEffect53(() => {
14948
14963
  async function checkCompanyAdminDeletability() {
@@ -15014,13 +15029,13 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
15014
15029
  // src/features/role/components/forms/UserRoleAdd.tsx
15015
15030
  import { PlusCircle as PlusCircle2 } from "lucide-react";
15016
15031
  import { useTranslations as useTranslations74 } from "next-intl";
15017
- import { useCallback as useCallback25, useEffect as useEffect54, useRef as useRef22, useState as useState69 } from "react";
15032
+ import { useCallback as useCallback25, useEffect as useEffect54, useRef as useRef22, useState as useState70 } from "react";
15018
15033
  import { Fragment as Fragment37, jsx as jsx177, jsxs as jsxs109 } from "react/jsx-runtime";
15019
15034
  function UserRoleAdd({ user, refresh }) {
15020
- const [open, setOpen] = useState69(false);
15035
+ const [open, setOpen] = useState70(false);
15021
15036
  const inputRef = useRef22(null);
15022
- const [searchTerm, setSearchTerm] = useState69("");
15023
- const [roles, setRoles] = useState69([]);
15037
+ const [searchTerm, setSearchTerm] = useState70("");
15038
+ const [roles, setRoles] = useState70([]);
15024
15039
  const t = useTranslations74();
15025
15040
  const addUserToRole = /* @__PURE__ */ __name(async (role) => {
15026
15041
  await RoleService.addUserToRole({
@@ -15326,11 +15341,11 @@ function OAuthScopeSelector({
15326
15341
  __name(OAuthScopeSelector, "OAuthScopeSelector");
15327
15342
 
15328
15343
  // src/features/oauth/components/OAuthClientSecretDisplay.tsx
15329
- import { useState as useState70, useCallback as useCallback28 } from "react";
15344
+ import { useState as useState71, useCallback as useCallback28 } from "react";
15330
15345
  import { Copy as Copy3, Check, AlertTriangle } from "lucide-react";
15331
15346
  import { jsx as jsx182, jsxs as jsxs112 } from "react/jsx-runtime";
15332
15347
  function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
15333
- const [copied, setCopied] = useState70(false);
15348
+ const [copied, setCopied] = useState71(false);
15334
15349
  const handleCopy = useCallback28(async () => {
15335
15350
  try {
15336
15351
  await navigator.clipboard.writeText(secret);
@@ -15523,18 +15538,18 @@ function OAuthClientList({
15523
15538
  __name(OAuthClientList, "OAuthClientList");
15524
15539
 
15525
15540
  // src/features/oauth/components/OAuthClientForm.tsx
15526
- import { useState as useState71, useCallback as useCallback29 } from "react";
15541
+ import { useState as useState72, useCallback as useCallback29 } from "react";
15527
15542
  import { jsx as jsx185, jsxs as jsxs115 } from "react/jsx-runtime";
15528
15543
  function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
15529
15544
  const isEditMode = !!client;
15530
- const [formState, setFormState] = useState71({
15545
+ const [formState, setFormState] = useState72({
15531
15546
  name: client?.name || "",
15532
15547
  description: client?.description || "",
15533
15548
  redirectUris: client?.redirectUris?.length ? client.redirectUris : [""],
15534
15549
  allowedScopes: client?.allowedScopes || [],
15535
15550
  isConfidential: client?.isConfidential ?? true
15536
15551
  });
15537
- const [errors, setErrors] = useState71({});
15552
+ const [errors, setErrors] = useState72({});
15538
15553
  const validate = useCallback29(() => {
15539
15554
  const newErrors = {};
15540
15555
  if (!formState.name.trim()) {
@@ -15657,7 +15672,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
15657
15672
  __name(OAuthClientForm, "OAuthClientForm");
15658
15673
 
15659
15674
  // src/features/oauth/components/OAuthClientDetail.tsx
15660
- import { useState as useState72, useCallback as useCallback30 } from "react";
15675
+ import { useState as useState73, useCallback as useCallback30 } from "react";
15661
15676
  import { format as format2 } from "date-fns";
15662
15677
  import { Copy as Copy4, Check as Check2, RefreshCw as RefreshCw3, Pencil as Pencil2, Trash2 as Trash25, ExternalLink } from "lucide-react";
15663
15678
  import { Fragment as Fragment38, jsx as jsx186, jsxs as jsxs116 } from "react/jsx-runtime";
@@ -15668,11 +15683,11 @@ function OAuthClientDetail({
15668
15683
  onDelete,
15669
15684
  onRegenerateSecret
15670
15685
  }) {
15671
- const [copiedField, setCopiedField] = useState72(null);
15672
- const [showDeleteConfirm, setShowDeleteConfirm] = useState72(false);
15673
- const [showRegenerateConfirm, setShowRegenerateConfirm] = useState72(false);
15674
- const [isDeleting, setIsDeleting] = useState72(false);
15675
- const [isRegenerating, setIsRegenerating] = useState72(false);
15686
+ const [copiedField, setCopiedField] = useState73(null);
15687
+ const [showDeleteConfirm, setShowDeleteConfirm] = useState73(false);
15688
+ const [showRegenerateConfirm, setShowRegenerateConfirm] = useState73(false);
15689
+ const [isDeleting, setIsDeleting] = useState73(false);
15690
+ const [isRegenerating, setIsRegenerating] = useState73(false);
15676
15691
  const copyToClipboard2 = useCallback30(async (text, field) => {
15677
15692
  try {
15678
15693
  await navigator.clipboard.writeText(text);
@@ -15941,7 +15956,7 @@ __name(OAuthConsentScreen, "OAuthConsentScreen");
15941
15956
  import { zodResolver as zodResolver9 } from "@hookform/resolvers/zod";
15942
15957
  import { CheckCircle, Mail as Mail2 } from "lucide-react";
15943
15958
  import { useTranslations as useTranslations77 } from "next-intl";
15944
- import { useState as useState73 } from "react";
15959
+ import { useState as useState74 } from "react";
15945
15960
  import { useForm as useForm9 } from "react-hook-form";
15946
15961
  import { v4 as v410 } from "uuid";
15947
15962
  import { z as z9 } from "zod";
@@ -16042,8 +16057,8 @@ __name(WaitlistQuestionnaireRenderer, "WaitlistQuestionnaireRenderer");
16042
16057
  import { Fragment as Fragment39, jsx as jsx192, jsxs as jsxs122 } from "react/jsx-runtime";
16043
16058
  function WaitlistForm({ onSuccess }) {
16044
16059
  const t = useTranslations77();
16045
- const [isSubmitting, setIsSubmitting] = useState73(false);
16046
- const [isSuccess, setIsSuccess] = useState73(false);
16060
+ const [isSubmitting, setIsSubmitting] = useState74(false);
16061
+ const [isSuccess, setIsSuccess] = useState74(false);
16047
16062
  const config = getWaitlistConfig();
16048
16063
  const questionnaireFields = config.questionnaire ?? [];
16049
16064
  const questionnaireSchema = questionnaireFields.reduce(
@@ -16222,12 +16237,12 @@ __name(WaitlistSuccessState, "WaitlistSuccessState");
16222
16237
  // src/features/waitlist/components/sections/WaitlistConfirmation.tsx
16223
16238
  import { CheckCircle as CheckCircle4, Loader2 as Loader26, XCircle as XCircle2 } from "lucide-react";
16224
16239
  import { useTranslations as useTranslations79 } from "next-intl";
16225
- import { useEffect as useEffect55, useState as useState74 } from "react";
16240
+ import { useEffect as useEffect55, useState as useState75 } from "react";
16226
16241
  import { jsx as jsx195, jsxs as jsxs125 } from "react/jsx-runtime";
16227
16242
  function WaitlistConfirmation({ code }) {
16228
16243
  const t = useTranslations79();
16229
- const [state, setState] = useState74("loading");
16230
- const [errorMessage, setErrorMessage] = useState74("");
16244
+ const [state, setState] = useState75("loading");
16245
+ const [errorMessage, setErrorMessage] = useState75("");
16231
16246
  useEffect55(() => {
16232
16247
  async function confirmEmail() {
16233
16248
  try {
@@ -16268,7 +16283,7 @@ __name(WaitlistConfirmation, "WaitlistConfirmation");
16268
16283
  import { flexRender as flexRender2, getCoreRowModel as getCoreRowModel2, useReactTable as useReactTable2 } from "@tanstack/react-table";
16269
16284
  import { RefreshCw as RefreshCw4, Users as Users2 } from "lucide-react";
16270
16285
  import { useTranslations as useTranslations81 } from "next-intl";
16271
- import { useCallback as useCallback31, useEffect as useEffect56, useState as useState75 } from "react";
16286
+ import { useCallback as useCallback31, useEffect as useEffect56, useState as useState76 } from "react";
16272
16287
 
16273
16288
  // src/features/waitlist/hooks/useWaitlistTableStructure.tsx
16274
16289
  import { Send } from "lucide-react";
@@ -16365,10 +16380,10 @@ __name(useWaitlistTableStructure, "useWaitlistTableStructure");
16365
16380
  import { jsx as jsx197, jsxs as jsxs127 } from "react/jsx-runtime";
16366
16381
  function WaitlistList() {
16367
16382
  const t = useTranslations81();
16368
- const [entries, setEntries] = useState75([]);
16369
- const [total, setTotal] = useState75(0);
16370
- const [isLoading, setIsLoading] = useState75(true);
16371
- const [statusFilter, setStatusFilter] = useState75("all");
16383
+ const [entries, setEntries] = useState76([]);
16384
+ const [total, setTotal] = useState76(0);
16385
+ const [isLoading, setIsLoading] = useState76(true);
16386
+ const [statusFilter, setStatusFilter] = useState76("all");
16372
16387
  const loadEntries = useCallback31(async () => {
16373
16388
  setIsLoading(true);
16374
16389
  try {
@@ -16879,4 +16894,4 @@ export {
16879
16894
  useOAuthClients,
16880
16895
  useOAuthClient
16881
16896
  };
16882
- //# sourceMappingURL=chunk-C4EJMD6X.mjs.map
16897
+ //# sourceMappingURL=chunk-YM7XSACC.mjs.map