@carlonicora/nextjs-jsonapi 4.0.6 → 4.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BlockNoteEditor-6CTF5DEV.mjs → BlockNoteEditor-A2E4VUYB.mjs} +2 -2
- package/dist/{BlockNoteEditor-JJ3S5COJ.js → BlockNoteEditor-MCYQBKT5.js} +9 -9
- package/dist/{BlockNoteEditor-JJ3S5COJ.js.map → BlockNoteEditor-MCYQBKT5.js.map} +1 -1
- package/dist/billing/index.js +335 -335
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-Y2AWOWWH.mjs → chunk-DJRTJBSZ.mjs} +384 -330
- package/dist/chunk-DJRTJBSZ.mjs.map +1 -0
- package/dist/{chunk-XUUHPYMM.js → chunk-PL2FHXHR.js} +82 -28
- package/dist/chunk-PL2FHXHR.js.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.d.mts +10 -1
- package/dist/components/index.d.ts +10 -1
- package/dist/components/index.js +4 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +3 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/dist/features/analytics/index.js +88 -88
- package/dist/features/analytics/index.mjs +1 -1
- package/dist/features/help/index.js +31 -31
- package/dist/features/help/index.mjs +1 -1
- package/dist/features/tokenusage/index.js +75 -75
- package/dist/features/tokenusage/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/navigations/RecentPagesNavigator.tsx +11 -1
- package/src/components/navigations/__tests__/RecentPagesNavigator.spec.tsx +19 -0
- package/src/features/company/hooks/useSubscriptionStatus.test.ts +76 -10
- package/src/features/company/hooks/useSubscriptionStatus.ts +9 -9
- package/src/features/how-to/components/containers/HowToCommand.spec.tsx +79 -6
- package/src/features/how-to/components/containers/HowToCommand.tsx +12 -2
- package/src/features/how-to/components/forms/HowToSelector.spec.tsx +85 -0
- package/src/features/how-to/components/forms/HowToSelector.tsx +1 -0
- package/src/features/role/components/forms/UserRoleAdd.spec.tsx +71 -0
- package/src/features/role/components/forms/UserRoleAdd.tsx +1 -0
- package/src/features/user/components/forms/UserSelector.spec.tsx +85 -0
- package/src/features/user/components/forms/UserSelector.tsx +1 -0
- package/src/features/user/components/lists/UserListInAdd.spec.tsx +84 -0
- package/src/features/user/components/lists/UserListInAdd.tsx +1 -0
- package/src/features/user/components/widgets/UserSearchPopover.spec.tsx +68 -0
- package/src/features/user/components/widgets/UserSearchPopover.tsx +1 -0
- package/src/shadcnui/custom/multi-select.spec.tsx +70 -0
- package/src/shadcnui/custom/multi-select.tsx +26 -2
- package/src/shadcnui/custom/multiple-selector.spec.tsx +111 -0
- package/src/shadcnui/custom/multiple-selector.tsx +33 -10
- package/src/shadcnui/ui/command.spec.ts +26 -0
- package/src/shadcnui/ui/command.tsx +13 -1
- package/dist/chunk-XUUHPYMM.js.map +0 -1
- package/dist/chunk-Y2AWOWWH.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-6CTF5DEV.mjs.map → BlockNoteEditor-A2E4VUYB.mjs.map} +0 -0
|
@@ -1763,7 +1763,7 @@ function useComboboxAnchor() {
|
|
|
1763
1763
|
__name(useComboboxAnchor, "useComboboxAnchor");
|
|
1764
1764
|
|
|
1765
1765
|
// src/shadcnui/ui/command.tsx
|
|
1766
|
-
import { Command as CommandPrimitive } from "cmdk";
|
|
1766
|
+
import { Command as CommandPrimitive, defaultFilter } from "cmdk";
|
|
1767
1767
|
|
|
1768
1768
|
// src/shadcnui/ui/dialog.tsx
|
|
1769
1769
|
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
@@ -2012,6 +2012,7 @@ function CommandShortcut({ className, ...props }) {
|
|
|
2012
2012
|
);
|
|
2013
2013
|
}
|
|
2014
2014
|
__name(CommandShortcut, "CommandShortcut");
|
|
2015
|
+
var commandFilterByKeywords = /* @__PURE__ */ __name((value, search, keywords) => defaultFilter(keywords && keywords.length > 0 ? keywords.join(" ") : value, search), "commandFilterByKeywords");
|
|
2015
2016
|
|
|
2016
2017
|
// src/shadcnui/ui/confirm-dialog.tsx
|
|
2017
2018
|
import * as React6 from "react";
|
|
@@ -5547,6 +5548,9 @@ var multiSelectVariants = cva11(
|
|
|
5547
5548
|
}
|
|
5548
5549
|
}
|
|
5549
5550
|
);
|
|
5551
|
+
var SELECT_ALL_VALUE = "__multi-select:select-all__";
|
|
5552
|
+
var CLEAR_VALUE = "__multi-select:clear__";
|
|
5553
|
+
var CLOSE_VALUE = "__multi-select:close__";
|
|
5550
5554
|
var MultiSelect = React12.forwardRef(
|
|
5551
5555
|
({
|
|
5552
5556
|
options,
|
|
@@ -5737,7 +5741,7 @@ var MultiSelect = React12.forwardRef(
|
|
|
5737
5741
|
className: "w-auto p-0",
|
|
5738
5742
|
style: { minWidth: triggerWidth > 0 ? triggerWidth : void 0 },
|
|
5739
5743
|
align: "start",
|
|
5740
|
-
children: /* @__PURE__ */ jsxs24(Command, { children: [
|
|
5744
|
+
children: /* @__PURE__ */ jsxs24(Command, { filter: commandFilterByKeywords, children: [
|
|
5741
5745
|
/* @__PURE__ */ jsx50(
|
|
5742
5746
|
CommandInput,
|
|
5743
5747
|
{
|
|
@@ -5754,6 +5758,8 @@ var MultiSelect = React12.forwardRef(
|
|
|
5754
5758
|
!hideSelectAll && /* @__PURE__ */ jsxs24(
|
|
5755
5759
|
CommandItem,
|
|
5756
5760
|
{
|
|
5761
|
+
value: SELECT_ALL_VALUE,
|
|
5762
|
+
keywords: ["(Select All)"],
|
|
5757
5763
|
onSelect: toggleAll,
|
|
5758
5764
|
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
5759
5765
|
children: [
|
|
@@ -5777,6 +5783,8 @@ var MultiSelect = React12.forwardRef(
|
|
|
5777
5783
|
return /* @__PURE__ */ jsxs24(
|
|
5778
5784
|
CommandItem,
|
|
5779
5785
|
{
|
|
5786
|
+
value: option.value,
|
|
5787
|
+
keywords: [option.label],
|
|
5780
5788
|
onSelect: () => toggleOption(option.value),
|
|
5781
5789
|
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
5782
5790
|
children: [
|
|
@@ -5801,12 +5809,23 @@ var MultiSelect = React12.forwardRef(
|
|
|
5801
5809
|
/* @__PURE__ */ jsx50(CommandSeparator, {}),
|
|
5802
5810
|
/* @__PURE__ */ jsx50(CommandGroup, { children: /* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between", children: [
|
|
5803
5811
|
selectedValues.length > 0 && /* @__PURE__ */ jsxs24(Fragment3, { children: [
|
|
5804
|
-
/* @__PURE__ */ jsx50(
|
|
5812
|
+
/* @__PURE__ */ jsx50(
|
|
5813
|
+
CommandItem,
|
|
5814
|
+
{
|
|
5815
|
+
value: CLEAR_VALUE,
|
|
5816
|
+
keywords: ["Clear"],
|
|
5817
|
+
onSelect: handleClear,
|
|
5818
|
+
className: "flex-1 cursor-pointer justify-center",
|
|
5819
|
+
children: "Clear"
|
|
5820
|
+
}
|
|
5821
|
+
),
|
|
5805
5822
|
/* @__PURE__ */ jsx50(Separator, { orientation: "vertical", className: "flex h-full min-h-6" })
|
|
5806
5823
|
] }),
|
|
5807
5824
|
/* @__PURE__ */ jsx50(
|
|
5808
5825
|
CommandItem,
|
|
5809
5826
|
{
|
|
5827
|
+
value: CLOSE_VALUE,
|
|
5828
|
+
keywords: ["Close"],
|
|
5810
5829
|
onSelect: () => setIsPopoverOpen(false),
|
|
5811
5830
|
className: "max-w-full flex-1 cursor-pointer justify-center hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
5812
5831
|
children: "Close"
|
|
@@ -5878,6 +5897,8 @@ function removePickedOption(groupOption, picked) {
|
|
|
5878
5897
|
return cloneOption;
|
|
5879
5898
|
}
|
|
5880
5899
|
__name(removePickedOption, "removePickedOption");
|
|
5900
|
+
var CREATE_VALUE = "__multiple-selector:create__";
|
|
5901
|
+
var rowText = /* @__PURE__ */ __name((value, keywords) => keywords && keywords.length > 0 ? keywords.join(" ") : value, "rowText");
|
|
5881
5902
|
function isOptionsExist(groupOption, targetOption) {
|
|
5882
5903
|
for (const [, value] of Object.entries(groupOption)) {
|
|
5883
5904
|
if (value.some((option) => targetOption.find((p) => p.value === option.value))) {
|
|
@@ -6086,17 +6107,19 @@ var MultipleSelector = React13.forwardRef(
|
|
|
6086
6107
|
const Item = /* @__PURE__ */ jsx51(
|
|
6087
6108
|
CommandItem,
|
|
6088
6109
|
{
|
|
6089
|
-
value: inputValue
|
|
6110
|
+
value: `${CREATE_VALUE}${inputValue}`,
|
|
6111
|
+
keywords: [inputValue],
|
|
6090
6112
|
className: "cursor-pointer",
|
|
6091
6113
|
onMouseDown: (e) => {
|
|
6092
6114
|
e.preventDefault();
|
|
6093
6115
|
e.stopPropagation();
|
|
6094
6116
|
},
|
|
6095
|
-
onSelect: (
|
|
6117
|
+
onSelect: () => {
|
|
6096
6118
|
if (selected.length >= maxSelected) {
|
|
6097
6119
|
onMaxSelected?.(selected.length);
|
|
6098
6120
|
return;
|
|
6099
6121
|
}
|
|
6122
|
+
const value2 = inputValue.trim();
|
|
6100
6123
|
setInputValue("");
|
|
6101
6124
|
const newOptions = [...selected, { value: value2, label: value2 }];
|
|
6102
6125
|
setSelected(newOptions);
|
|
@@ -6122,15 +6145,16 @@ var MultipleSelector = React13.forwardRef(
|
|
|
6122
6145
|
}, [creatable, emptyIndicator, onSearch, options]);
|
|
6123
6146
|
const selectables = React13.useMemo(() => removePickedOption(options, selected), [options, selected]);
|
|
6124
6147
|
const commandFilter = React13.useCallback(() => {
|
|
6125
|
-
|
|
6126
|
-
|
|
6148
|
+
const customFilter = commandProps?.filter;
|
|
6149
|
+
if (customFilter) {
|
|
6150
|
+
return (value2, search, keywords) => customFilter(rowText(value2, keywords), search, []);
|
|
6127
6151
|
}
|
|
6128
6152
|
if (creatable) {
|
|
6129
|
-
return (value2, search) => {
|
|
6130
|
-
return value2.toLowerCase().includes(search.toLowerCase()) ? 1 : -1;
|
|
6153
|
+
return (value2, search, keywords) => {
|
|
6154
|
+
return rowText(value2, keywords).toLowerCase().includes(search.toLowerCase()) ? 1 : -1;
|
|
6131
6155
|
};
|
|
6132
6156
|
}
|
|
6133
|
-
return
|
|
6157
|
+
return commandFilterByKeywords;
|
|
6134
6158
|
}, [creatable, commandProps?.filter]);
|
|
6135
6159
|
const displayedBadges = maxDisplayCount ? selected.slice(0, maxDisplayCount) : selected;
|
|
6136
6160
|
const hiddenCount = maxDisplayCount ? Math.max(0, selected.length - maxDisplayCount) : 0;
|
|
@@ -6285,7 +6309,8 @@ var MultipleSelector = React13.forwardRef(
|
|
|
6285
6309
|
return /* @__PURE__ */ jsx51(
|
|
6286
6310
|
CommandItem,
|
|
6287
6311
|
{
|
|
6288
|
-
value: option.
|
|
6312
|
+
value: option.value,
|
|
6313
|
+
keywords: [option.label],
|
|
6289
6314
|
disabled: option.disable,
|
|
6290
6315
|
onMouseDown: (e) => {
|
|
6291
6316
|
e.preventDefault();
|
|
@@ -6350,7 +6375,8 @@ var MultipleSelector = React13.forwardRef(
|
|
|
6350
6375
|
return /* @__PURE__ */ jsx51(
|
|
6351
6376
|
CommandItem,
|
|
6352
6377
|
{
|
|
6353
|
-
value: option.
|
|
6378
|
+
value: option.value,
|
|
6379
|
+
keywords: [option.label],
|
|
6354
6380
|
disabled: option.disable,
|
|
6355
6381
|
onMouseDown: (e) => {
|
|
6356
6382
|
e.preventDefault();
|
|
@@ -10561,7 +10587,7 @@ import { useRef as useRef18 } from "react";
|
|
|
10561
10587
|
import dynamic from "next/dynamic";
|
|
10562
10588
|
import React18 from "react";
|
|
10563
10589
|
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
10564
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
10590
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-A2E4VUYB.mjs"), {
|
|
10565
10591
|
ssr: false
|
|
10566
10592
|
});
|
|
10567
10593
|
var BlockNoteEditorContainer = React18.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -11997,6 +12023,7 @@ var UserSearchPopover = /* @__PURE__ */ __name(({ children, onSelect, align = "s
|
|
|
11997
12023
|
/* @__PURE__ */ jsx109(CommandList, { children: users.length > 0 ? users.map((user) => /* @__PURE__ */ jsxs65(
|
|
11998
12024
|
CommandItem,
|
|
11999
12025
|
{
|
|
12026
|
+
value: user.id,
|
|
12000
12027
|
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
12001
12028
|
onSelect: () => handleSelectUser(user.id),
|
|
12002
12029
|
children: [
|
|
@@ -12101,6 +12128,7 @@ function UserSelector({ id, form, label, placeholder, onChange, isRequired = fal
|
|
|
12101
12128
|
CommandItem,
|
|
12102
12129
|
{
|
|
12103
12130
|
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
12131
|
+
value: user.id,
|
|
12104
12132
|
onSelect: () => setUser(user),
|
|
12105
12133
|
children: [
|
|
12106
12134
|
/* @__PURE__ */ jsx110(UserAvatar, { user, className: `me-2 h-4 w-4` }),
|
|
@@ -12533,6 +12561,7 @@ function UserListInAdd({ data, existingUsers, setSelectedUser, setLevelOpen }) {
|
|
|
12533
12561
|
CommandItem,
|
|
12534
12562
|
{
|
|
12535
12563
|
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
12564
|
+
value: user.id,
|
|
12536
12565
|
onClick: (_e) => {
|
|
12537
12566
|
setSelectedUser(user);
|
|
12538
12567
|
setLevelOpen?.(true);
|
|
@@ -15552,15 +15581,20 @@ import { useAtomValue } from "jotai";
|
|
|
15552
15581
|
import { HistoryIcon } from "lucide-react";
|
|
15553
15582
|
import { useTranslations as useTranslations52 } from "next-intl";
|
|
15554
15583
|
import { usePathname as usePathname3 } from "next/navigation";
|
|
15584
|
+
import { useEffect as useEffect41, useState as useState51 } from "react";
|
|
15555
15585
|
import { jsx as jsx166, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
15556
15586
|
function RecentPagesNavigator() {
|
|
15557
15587
|
const recentPages = useAtomValue(recentPagesAtom);
|
|
15558
15588
|
const t = useTranslations52();
|
|
15559
15589
|
const { isMobile } = useSidebar();
|
|
15560
15590
|
const pathname = usePathname3();
|
|
15591
|
+
const [mounted, setMounted] = useState51(false);
|
|
15592
|
+
useEffect41(() => {
|
|
15593
|
+
setMounted(true);
|
|
15594
|
+
}, []);
|
|
15561
15595
|
const isCurrentPage = /* @__PURE__ */ __name((url) => !!pathname && (pathname === url || pathname.startsWith(`${url}/`)), "isCurrentPage");
|
|
15562
15596
|
const pages = recentPages.filter((page) => !isCurrentPage(page.url));
|
|
15563
|
-
if (pages.length === 0) return null;
|
|
15597
|
+
if (!mounted || pages.length === 0) return null;
|
|
15564
15598
|
return /* @__PURE__ */ jsx166(SidebarMenuItem, { children: /* @__PURE__ */ jsxs91(DropdownMenu, { children: [
|
|
15565
15599
|
/* @__PURE__ */ jsxs91(
|
|
15566
15600
|
DropdownMenuTrigger,
|
|
@@ -15640,14 +15674,14 @@ __name(partitionTabs, "partitionTabs");
|
|
|
15640
15674
|
|
|
15641
15675
|
// src/components/containers/MermaidDiagram.tsx
|
|
15642
15676
|
import { useTheme as useTheme3 } from "next-themes";
|
|
15643
|
-
import { useEffect as
|
|
15677
|
+
import { useEffect as useEffect42, useId as useId4, useState as useState52 } from "react";
|
|
15644
15678
|
import { jsx as jsx168 } from "react/jsx-runtime";
|
|
15645
15679
|
function MermaidDiagram({ chart }) {
|
|
15646
15680
|
const reactId = useId4();
|
|
15647
15681
|
const { resolvedTheme } = useTheme3();
|
|
15648
|
-
const [svg, setSvg] =
|
|
15649
|
-
const [failed, setFailed] =
|
|
15650
|
-
|
|
15682
|
+
const [svg, setSvg] = useState52(void 0);
|
|
15683
|
+
const [failed, setFailed] = useState52(false);
|
|
15684
|
+
useEffect42(() => {
|
|
15651
15685
|
let cancelled = false;
|
|
15652
15686
|
const draw = /* @__PURE__ */ __name(async () => {
|
|
15653
15687
|
try {
|
|
@@ -15709,7 +15743,7 @@ __name(MermaidDiagram, "MermaidDiagram");
|
|
|
15709
15743
|
// src/components/containers/ReactMarkdownContainer.tsx
|
|
15710
15744
|
import { ChevronDown as ChevronDown2, ChevronUp } from "lucide-react";
|
|
15711
15745
|
import { useTranslations as useTranslations53 } from "next-intl";
|
|
15712
|
-
import { useEffect as
|
|
15746
|
+
import { useEffect as useEffect43, useRef as useRef28, useState as useState53 } from "react";
|
|
15713
15747
|
import ReactMarkdown from "react-markdown";
|
|
15714
15748
|
import rehypeSlug from "rehype-slug";
|
|
15715
15749
|
import remarkGfm from "remark-gfm";
|
|
@@ -15732,10 +15766,10 @@ function ReactMarkdownContainer({
|
|
|
15732
15766
|
size = "normal"
|
|
15733
15767
|
}) {
|
|
15734
15768
|
const t = useTranslations53("ui.buttons");
|
|
15735
|
-
const [isExpanded, setIsExpanded] =
|
|
15736
|
-
const [showExpandButton, setShowExpandButton] =
|
|
15769
|
+
const [isExpanded, setIsExpanded] = useState53(false);
|
|
15770
|
+
const [showExpandButton, setShowExpandButton] = useState53(false);
|
|
15737
15771
|
const contentRef = useRef28(null);
|
|
15738
|
-
|
|
15772
|
+
useEffect43(() => {
|
|
15739
15773
|
if (collapsible && contentRef.current && !isExpanded) {
|
|
15740
15774
|
const isOverflowing = contentRef.current.scrollHeight > contentRef.current.clientHeight;
|
|
15741
15775
|
setShowExpandButton(isOverflowing);
|
|
@@ -15957,7 +15991,7 @@ __name(RoundPageContainerTitle, "RoundPageContainerTitle");
|
|
|
15957
15991
|
|
|
15958
15992
|
// src/components/containers/RoundPageContainer.tsx
|
|
15959
15993
|
import { useSearchParams } from "next/navigation";
|
|
15960
|
-
import { Fragment as Fragment25, useCallback as useCallback27, useEffect as
|
|
15994
|
+
import { Fragment as Fragment25, useCallback as useCallback27, useEffect as useEffect44, useMemo as useMemo23, useRef as useRef29, useState as useState54 } from "react";
|
|
15961
15995
|
import { Fragment as Fragment26, jsx as jsx171, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
15962
15996
|
var DETAILS_COOKIE_NAME = "round_page_details_state";
|
|
15963
15997
|
var DETAILS_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
@@ -15997,22 +16031,22 @@ function RoundPageContainer({
|
|
|
15997
16031
|
const headerLeftContent = useHeaderLeftContent();
|
|
15998
16032
|
const headerLogo = useHeaderLogo();
|
|
15999
16033
|
const headerMobileChildren = useHeaderMobileChildren();
|
|
16000
|
-
const [showDetails, setShowDetailsState] =
|
|
16001
|
-
const [showDetailsMobile, setShowDetailsMobile] =
|
|
16034
|
+
const [showDetails, setShowDetailsState] = useState54(defaultDetailsOpen);
|
|
16035
|
+
const [showDetailsMobile, setShowDetailsMobile] = useState54(false);
|
|
16002
16036
|
const isMobile = useIsMobile();
|
|
16003
16037
|
const hasMobileNavigation = useMobileNavigationItems().length > 0;
|
|
16004
16038
|
const hasSidebar = useOptionalSidebar() !== null;
|
|
16005
|
-
const [mounted, setMounted] =
|
|
16006
|
-
|
|
16039
|
+
const [mounted, setMounted] = useState54(false);
|
|
16040
|
+
useEffect44(() => {
|
|
16007
16041
|
const match = document.cookie.split("; ").find((row) => row.startsWith(`${detailsCookieName}=`));
|
|
16008
16042
|
const stored = match?.split("=")[1];
|
|
16009
16043
|
if (stored === "true") setShowDetailsState(true);
|
|
16010
16044
|
else if (stored === "false") setShowDetailsState(false);
|
|
16011
16045
|
}, []);
|
|
16012
|
-
|
|
16046
|
+
useEffect44(() => {
|
|
16013
16047
|
setMounted(true);
|
|
16014
16048
|
}, []);
|
|
16015
|
-
|
|
16049
|
+
useEffect44(() => {
|
|
16016
16050
|
document.documentElement.dataset.scrollMode = scroll;
|
|
16017
16051
|
}, [scroll]);
|
|
16018
16052
|
const isFixed = scroll === "fixed";
|
|
@@ -16032,9 +16066,9 @@ function RoundPageContainer({
|
|
|
16032
16066
|
const section = searchParams.get("section");
|
|
16033
16067
|
const rewriteUrl = useUrlRewriter();
|
|
16034
16068
|
const initialValue = tabs ? (section && tabs.find((i) => tabValue(i) === section) ? section : null) || tabValue(tabs[0]) : void 0;
|
|
16035
|
-
const [activeTab, setActiveTab] =
|
|
16069
|
+
const [activeTab, setActiveTab] = useState54(initialValue);
|
|
16036
16070
|
const previousSection = useRef29(section);
|
|
16037
|
-
|
|
16071
|
+
useEffect44(() => {
|
|
16038
16072
|
if (tabs && section) {
|
|
16039
16073
|
const tab = tabs.find((i) => tabValue(i) === section);
|
|
16040
16074
|
if (tab) {
|
|
@@ -16441,14 +16475,14 @@ function AllowedUsersDetails({ showTitle, content }) {
|
|
|
16441
16475
|
__name(AllowedUsersDetails, "AllowedUsersDetails");
|
|
16442
16476
|
|
|
16443
16477
|
// src/components/editors/BlockNoteEditorMentionHoverCard.tsx
|
|
16444
|
-
import { useCallback as useCallback28, useEffect as
|
|
16478
|
+
import { useCallback as useCallback28, useEffect as useEffect45, useRef as useRef30, useState as useState55 } from "react";
|
|
16445
16479
|
import { createPortal as createPortal3 } from "react-dom";
|
|
16446
16480
|
import { jsx as jsx174 } from "react/jsx-runtime";
|
|
16447
16481
|
function BlockNoteEditorMentionHoverCard({
|
|
16448
16482
|
containerRef,
|
|
16449
16483
|
mentionResolveFn
|
|
16450
16484
|
}) {
|
|
16451
|
-
const [hovered, setHovered] =
|
|
16485
|
+
const [hovered, setHovered] = useState55(null);
|
|
16452
16486
|
const closeTimeoutRef = useRef30(null);
|
|
16453
16487
|
const scheduleClose = useCallback28(() => {
|
|
16454
16488
|
closeTimeoutRef.current = setTimeout(() => setHovered(null), 200);
|
|
@@ -16459,7 +16493,7 @@ function BlockNoteEditorMentionHoverCard({
|
|
|
16459
16493
|
closeTimeoutRef.current = null;
|
|
16460
16494
|
}
|
|
16461
16495
|
}, []);
|
|
16462
|
-
|
|
16496
|
+
useEffect45(() => {
|
|
16463
16497
|
const container = containerRef.current;
|
|
16464
16498
|
if (!container || !mentionResolveFn) return;
|
|
16465
16499
|
const handleMouseOver = /* @__PURE__ */ __name((e) => {
|
|
@@ -16709,13 +16743,13 @@ var BlockNoteViewerContainer = React29.memo(/* @__PURE__ */ __name(function View
|
|
|
16709
16743
|
}, "ViewerContainer"));
|
|
16710
16744
|
|
|
16711
16745
|
// src/components/pages/PageContainerContentDetails.tsx
|
|
16712
|
-
import { useEffect as
|
|
16746
|
+
import { useEffect as useEffect46, useRef as useRef31, useState as useState56 } from "react";
|
|
16713
16747
|
import { jsx as jsx178, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
16714
16748
|
function PageContainerContentDetails({ items, section, module, id }) {
|
|
16715
16749
|
const rewriteUrl = useUrlRewriter();
|
|
16716
|
-
const [isScrolled, setIsScrolled] =
|
|
16750
|
+
const [isScrolled, setIsScrolled] = useState56(false);
|
|
16717
16751
|
const sentinelRef = useRef31(null);
|
|
16718
|
-
|
|
16752
|
+
useEffect46(() => {
|
|
16719
16753
|
const sentinel = sentinelRef.current;
|
|
16720
16754
|
if (!sentinel) return;
|
|
16721
16755
|
const observer = new IntersectionObserver(
|
|
@@ -16748,13 +16782,13 @@ function PageContainerContentDetails({ items, section, module, id }) {
|
|
|
16748
16782
|
__name(PageContainerContentDetails, "PageContainerContentDetails");
|
|
16749
16783
|
|
|
16750
16784
|
// src/components/pages/PageContentContainer.tsx
|
|
16751
|
-
import { useEffect as
|
|
16785
|
+
import { useEffect as useEffect47, useState as useState57 } from "react";
|
|
16752
16786
|
import { useDefaultLayout } from "react-resizable-panels";
|
|
16753
16787
|
import { jsx as jsx179, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
16754
16788
|
function PageContentContainer({ header, details, footer, content, fullBleed }) {
|
|
16755
|
-
const [mounted, setMounted] =
|
|
16789
|
+
const [mounted, setMounted] = useState57(false);
|
|
16756
16790
|
const isMobile = useIsMobile();
|
|
16757
|
-
|
|
16791
|
+
useEffect47(() => {
|
|
16758
16792
|
setMounted(true);
|
|
16759
16793
|
}, []);
|
|
16760
16794
|
const isReady = mounted;
|
|
@@ -16918,10 +16952,10 @@ var cellUrl = /* @__PURE__ */ __name((params) => {
|
|
|
16918
16952
|
}, "cellUrl");
|
|
16919
16953
|
|
|
16920
16954
|
// src/client/context/JsonApiProvider.tsx
|
|
16921
|
-
import { useEffect as
|
|
16955
|
+
import { useEffect as useEffect48, useMemo as useMemo25 } from "react";
|
|
16922
16956
|
import { jsx as jsx185 } from "react/jsx-runtime";
|
|
16923
16957
|
function JsonApiProvider({ config, children }) {
|
|
16924
|
-
|
|
16958
|
+
useEffect48(() => {
|
|
16925
16959
|
if (config.bootstrapper) {
|
|
16926
16960
|
config.bootstrapper();
|
|
16927
16961
|
}
|
|
@@ -16932,12 +16966,12 @@ function JsonApiProvider({ config, children }) {
|
|
|
16932
16966
|
__name(JsonApiProvider, "JsonApiProvider");
|
|
16933
16967
|
|
|
16934
16968
|
// src/client/hooks/useJsonApiGet.ts
|
|
16935
|
-
import { useState as
|
|
16969
|
+
import { useState as useState58, useEffect as useEffect49, useCallback as useCallback30, useRef as useRef32 } from "react";
|
|
16936
16970
|
function useJsonApiGet(params) {
|
|
16937
|
-
const [data, setData] =
|
|
16938
|
-
const [loading, setLoading] =
|
|
16939
|
-
const [error, setError] =
|
|
16940
|
-
const [response, setResponse] =
|
|
16971
|
+
const [data, setData] = useState58(null);
|
|
16972
|
+
const [loading, setLoading] = useState58(false);
|
|
16973
|
+
const [error, setError] = useState58(null);
|
|
16974
|
+
const [response, setResponse] = useState58(null);
|
|
16941
16975
|
const isMounted = useRef32(true);
|
|
16942
16976
|
const fetchData = useCallback30(async () => {
|
|
16943
16977
|
if (params.options?.enabled === false) return;
|
|
@@ -17010,7 +17044,7 @@ function useJsonApiGet(params) {
|
|
|
17010
17044
|
}
|
|
17011
17045
|
}
|
|
17012
17046
|
}, [response]);
|
|
17013
|
-
|
|
17047
|
+
useEffect49(() => {
|
|
17014
17048
|
isMounted.current = true;
|
|
17015
17049
|
fetchData();
|
|
17016
17050
|
return () => {
|
|
@@ -17032,12 +17066,12 @@ function useJsonApiGet(params) {
|
|
|
17032
17066
|
__name(useJsonApiGet, "useJsonApiGet");
|
|
17033
17067
|
|
|
17034
17068
|
// src/client/hooks/useJsonApiMutation.ts
|
|
17035
|
-
import { useState as
|
|
17069
|
+
import { useState as useState59, useCallback as useCallback31 } from "react";
|
|
17036
17070
|
function useJsonApiMutation(config) {
|
|
17037
|
-
const [data, setData] =
|
|
17038
|
-
const [loading, setLoading] =
|
|
17039
|
-
const [error, setError] =
|
|
17040
|
-
const [response, setResponse] =
|
|
17071
|
+
const [data, setData] = useState59(null);
|
|
17072
|
+
const [loading, setLoading] = useState59(false);
|
|
17073
|
+
const [error, setError] = useState59(null);
|
|
17074
|
+
const [response, setResponse] = useState59(null);
|
|
17041
17075
|
const reset = useCallback31(() => {
|
|
17042
17076
|
setData(null);
|
|
17043
17077
|
setLoading(false);
|
|
@@ -17210,6 +17244,7 @@ var useCompanyTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
17210
17244
|
import { useMemo as useMemo28 } from "react";
|
|
17211
17245
|
var TRIAL_DAYS = 14;
|
|
17212
17246
|
var GRACE_DAYS = 3;
|
|
17247
|
+
var DAY_MS = 1e3 * 60 * 60 * 24;
|
|
17213
17248
|
var isAdministrator = /* @__PURE__ */ __name((currentUser) => {
|
|
17214
17249
|
if (!currentUser || !isRolesConfigured()) return false;
|
|
17215
17250
|
const adminRoleId = getRoleId().Administrator;
|
|
@@ -17264,12 +17299,10 @@ function useSubscriptionStatus() {
|
|
|
17264
17299
|
};
|
|
17265
17300
|
}
|
|
17266
17301
|
const createdAt = new Date(company.createdAt);
|
|
17267
|
-
const trialEndsAt = new Date(createdAt);
|
|
17268
|
-
trialEndsAt.setDate(trialEndsAt.getDate() + TRIAL_DAYS);
|
|
17302
|
+
const trialEndsAt = new Date(createdAt.getTime() + TRIAL_DAYS * DAY_MS);
|
|
17269
17303
|
const now = /* @__PURE__ */ new Date();
|
|
17270
|
-
const
|
|
17271
|
-
const
|
|
17272
|
-
const daysRemaining = Math.ceil(msRemaining / (1e3 * 60 * 60 * 24));
|
|
17304
|
+
const msRemaining = trialEndsAt.getTime() - now.getTime();
|
|
17305
|
+
const daysRemaining = Math.ceil(msRemaining / DAY_MS);
|
|
17273
17306
|
const trialElapsed = daysRemaining <= 0;
|
|
17274
17307
|
return {
|
|
17275
17308
|
status: trialElapsed ? "expired" : "trial",
|
|
@@ -17782,7 +17815,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
17782
17815
|
|
|
17783
17816
|
// src/features/oauth/hooks/useOAuthClients.ts
|
|
17784
17817
|
import { useAtom as useAtom3, useSetAtom } from "jotai";
|
|
17785
|
-
import { useCallback as useCallback32, useEffect as
|
|
17818
|
+
import { useCallback as useCallback32, useEffect as useEffect50 } from "react";
|
|
17786
17819
|
|
|
17787
17820
|
// src/features/oauth/atoms/oauth.atoms.ts
|
|
17788
17821
|
import { atom } from "jotai";
|
|
@@ -17857,7 +17890,7 @@ function useOAuthClients() {
|
|
|
17857
17890
|
setIsLoading(false);
|
|
17858
17891
|
}
|
|
17859
17892
|
}, [setClients, setIsLoading, setError]);
|
|
17860
|
-
|
|
17893
|
+
useEffect50(() => {
|
|
17861
17894
|
fetchClients();
|
|
17862
17895
|
}, [fetchClients]);
|
|
17863
17896
|
const createClient = useCallback32(
|
|
@@ -17897,15 +17930,15 @@ __name(useOAuthClients, "useOAuthClients");
|
|
|
17897
17930
|
|
|
17898
17931
|
// src/features/oauth/hooks/useOAuthClient.ts
|
|
17899
17932
|
import { useAtomValue as useAtomValue2, useSetAtom as useSetAtom2 } from "jotai";
|
|
17900
|
-
import { useCallback as useCallback33, useEffect as
|
|
17933
|
+
import { useCallback as useCallback33, useEffect as useEffect51, useState as useState60 } from "react";
|
|
17901
17934
|
function useOAuthClient(clientId) {
|
|
17902
17935
|
const storedClient = useAtomValue2(oauthClientByIdAtom(clientId));
|
|
17903
17936
|
const updateClientInStore = useSetAtom2(updateOAuthClientAtom);
|
|
17904
17937
|
const removeClientFromStore = useSetAtom2(removeOAuthClientAtom);
|
|
17905
17938
|
const setNewClientSecret = useSetAtom2(setNewClientSecretAtom);
|
|
17906
|
-
const [fetchedClient, setFetchedClient] =
|
|
17907
|
-
const [isLoading, setIsLoading] =
|
|
17908
|
-
const [error, setError] =
|
|
17939
|
+
const [fetchedClient, setFetchedClient] = useState60(null);
|
|
17940
|
+
const [isLoading, setIsLoading] = useState60(false);
|
|
17941
|
+
const [error, setError] = useState60(null);
|
|
17909
17942
|
const client = storedClient || fetchedClient;
|
|
17910
17943
|
const fetchClient = useCallback33(async () => {
|
|
17911
17944
|
if (!clientId) return;
|
|
@@ -17921,7 +17954,7 @@ function useOAuthClient(clientId) {
|
|
|
17921
17954
|
setIsLoading(false);
|
|
17922
17955
|
}
|
|
17923
17956
|
}, [clientId]);
|
|
17924
|
-
|
|
17957
|
+
useEffect51(() => {
|
|
17925
17958
|
if (!storedClient && clientId) {
|
|
17926
17959
|
fetchClient();
|
|
17927
17960
|
}
|
|
@@ -17995,23 +18028,23 @@ function useOAuthClient(clientId) {
|
|
|
17995
18028
|
__name(useOAuthClient, "useOAuthClient");
|
|
17996
18029
|
|
|
17997
18030
|
// src/features/oauth/hooks/useOAuthConsent.ts
|
|
17998
|
-
import { useCallback as useCallback34, useEffect as
|
|
18031
|
+
import { useCallback as useCallback34, useEffect as useEffect52, useState as useState61 } from "react";
|
|
17999
18032
|
function useOAuthConsent(params, options) {
|
|
18000
|
-
const [clientInfo, setClientInfo] =
|
|
18001
|
-
const [isLoading, setIsLoading] =
|
|
18002
|
-
const [error, setError] =
|
|
18003
|
-
const [isSubmitting, setIsSubmitting] =
|
|
18004
|
-
const [companyId, setCompanyId] =
|
|
18033
|
+
const [clientInfo, setClientInfo] = useState61(null);
|
|
18034
|
+
const [isLoading, setIsLoading] = useState61(true);
|
|
18035
|
+
const [error, setError] = useState61(null);
|
|
18036
|
+
const [isSubmitting, setIsSubmitting] = useState61(false);
|
|
18037
|
+
const [companyId, setCompanyId] = useState61(void 0);
|
|
18005
18038
|
const contextCompanyId = useCurrentUserContextOptional()?.company?.id;
|
|
18006
18039
|
const currentCompanyId = options?.defaultCompanyId ?? contextCompanyId;
|
|
18007
|
-
|
|
18040
|
+
useEffect52(() => {
|
|
18008
18041
|
const companies = clientInfo?.companies ?? [];
|
|
18009
18042
|
if (companies.length === 0) return;
|
|
18010
18043
|
if (companyId && companies.some((company) => company.id === companyId)) return;
|
|
18011
18044
|
const current = currentCompanyId ? companies.find((company) => company.id === currentCompanyId) : void 0;
|
|
18012
18045
|
setCompanyId(current?.id ?? companies[0]?.id);
|
|
18013
18046
|
}, [clientInfo, currentCompanyId, companyId]);
|
|
18014
|
-
|
|
18047
|
+
useEffect52(() => {
|
|
18015
18048
|
const fetchInfo = /* @__PURE__ */ __name(async () => {
|
|
18016
18049
|
if (!params.clientId || !params.redirectUri) {
|
|
18017
18050
|
setError(new Error("Missing required authorization parameters"));
|
|
@@ -18092,20 +18125,20 @@ registerTableGenerator("waitlists", useWaitlistTableStructure);
|
|
|
18092
18125
|
import { flexRender, getCoreRowModel, getExpandedRowModel, useReactTable } from "@tanstack/react-table";
|
|
18093
18126
|
import { ChevronLeft, ChevronRight, Loader2 as Loader23 } from "lucide-react";
|
|
18094
18127
|
import { useTranslations as useTranslations62 } from "next-intl";
|
|
18095
|
-
import React31, { memo, useMemo as useMemo34, useState as
|
|
18128
|
+
import React31, { memo, useMemo as useMemo34, useState as useState63 } from "react";
|
|
18096
18129
|
|
|
18097
18130
|
// src/components/tables/ContentTableSearch.tsx
|
|
18098
18131
|
import { RefreshCw, Search, X as X3 } from "lucide-react";
|
|
18099
18132
|
import { useTranslations as useTranslations61 } from "next-intl";
|
|
18100
|
-
import { useCallback as useCallback35, useEffect as
|
|
18133
|
+
import { useCallback as useCallback35, useEffect as useEffect53, useRef as useRef33, useState as useState62 } from "react";
|
|
18101
18134
|
import { jsx as jsx192, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
18102
18135
|
function ContentTableSearch({ data }) {
|
|
18103
18136
|
const t = useTranslations61();
|
|
18104
18137
|
const searchTermRef = useRef33("");
|
|
18105
18138
|
const inputRef = useRef33(null);
|
|
18106
|
-
const [searchTerm, setSearchTerm] =
|
|
18107
|
-
const [isFocused, setIsFocused] =
|
|
18108
|
-
const [isSearching, setIsSearching] =
|
|
18139
|
+
const [searchTerm, setSearchTerm] = useState62("");
|
|
18140
|
+
const [isFocused, setIsFocused] = useState62(false);
|
|
18141
|
+
const [isSearching, setIsSearching] = useState62(false);
|
|
18109
18142
|
const isExpanded = isFocused || searchTerm.length > 0;
|
|
18110
18143
|
const search = useCallback35(
|
|
18111
18144
|
async (searchedTerm) => {
|
|
@@ -18120,7 +18153,7 @@ function ContentTableSearch({ data }) {
|
|
|
18120
18153
|
[searchTermRef, data]
|
|
18121
18154
|
);
|
|
18122
18155
|
const updateSearchTerm = useDebounce2(search, 500);
|
|
18123
|
-
|
|
18156
|
+
useEffect53(() => {
|
|
18124
18157
|
setIsSearching(true);
|
|
18125
18158
|
updateSearchTerm(searchTerm);
|
|
18126
18159
|
}, [updateSearchTerm, searchTerm]);
|
|
@@ -18229,10 +18262,10 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
18229
18262
|
const { data, fields, checkedIds, toggleId, allowSearch, filters: _filters, fullWidth, onRowClick } = props;
|
|
18230
18263
|
const t = useTranslations62();
|
|
18231
18264
|
const isMobile = useIsMobile();
|
|
18232
|
-
const [expanded, setExpanded] =
|
|
18265
|
+
const [expanded, setExpanded] = useState63(
|
|
18233
18266
|
props.defaultExpanded === true ? true : typeof props.defaultExpanded === "object" ? props.defaultExpanded : {}
|
|
18234
18267
|
);
|
|
18235
|
-
const [pendingDirection, setPendingDirection] =
|
|
18268
|
+
const [pendingDirection, setPendingDirection] = useState63(null);
|
|
18236
18269
|
React31.useEffect(() => {
|
|
18237
18270
|
if (data.isLoaded) setPendingDirection(null);
|
|
18238
18271
|
}, [data.isLoaded]);
|
|
@@ -18426,13 +18459,13 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
18426
18459
|
}, "ContentListTable"));
|
|
18427
18460
|
|
|
18428
18461
|
// src/components/grids/ContentListGrid.tsx
|
|
18429
|
-
import { useEffect as
|
|
18462
|
+
import { useEffect as useEffect54, useRef as useRef34 } from "react";
|
|
18430
18463
|
import { Fragment as Fragment31, jsx as jsx194, jsxs as jsxs106 } from "react/jsx-runtime";
|
|
18431
18464
|
var DEFAULT_GRID_CLASSES = "grid grid-cols-2 gap-4 p-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5";
|
|
18432
18465
|
function ContentListGrid(props) {
|
|
18433
18466
|
const { data, ItemComponent, allowSearch, fullWidth, gridClassName } = props;
|
|
18434
18467
|
const sentinelRef = useRef34(null);
|
|
18435
|
-
|
|
18468
|
+
useEffect54(() => {
|
|
18436
18469
|
if (!data.next || !sentinelRef.current) return;
|
|
18437
18470
|
const observer = new IntersectionObserver(
|
|
18438
18471
|
(entries) => {
|
|
@@ -18475,15 +18508,15 @@ __name(ContentListGrid, "ContentListGrid");
|
|
|
18475
18508
|
|
|
18476
18509
|
// src/components/fiscal/ItalianFiscalData.tsx
|
|
18477
18510
|
import { useTranslations as useTranslations63 } from "next-intl";
|
|
18478
|
-
import { forwardRef as forwardRef8, useCallback as useCallback36, useImperativeHandle as useImperativeHandle2, useRef as useRef35, useState as
|
|
18511
|
+
import { forwardRef as forwardRef8, useCallback as useCallback36, useImperativeHandle as useImperativeHandle2, useRef as useRef35, useState as useState64 } from "react";
|
|
18479
18512
|
import { z as z4 } from "zod";
|
|
18480
18513
|
import { jsx as jsx195, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
18481
18514
|
var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFiscalData2({ initialData }, ref) {
|
|
18482
18515
|
const t = useTranslations63();
|
|
18483
18516
|
const initialRef = useRef35(initialData);
|
|
18484
|
-
const [fiscalData, setFiscalData] =
|
|
18517
|
+
const [fiscalData, setFiscalData] = useState64(initialData);
|
|
18485
18518
|
const fiscalDataRef = useRef35(initialData);
|
|
18486
|
-
const [fiscalErrors, setFiscalErrors] =
|
|
18519
|
+
const [fiscalErrors, setFiscalErrors] = useState64({});
|
|
18487
18520
|
const updateFiscalField = useCallback36((key, value) => {
|
|
18488
18521
|
setFiscalData((prev) => {
|
|
18489
18522
|
const next = { ...prev, [key]: value };
|
|
@@ -18676,7 +18709,7 @@ __name(EntitySection, "EntitySection");
|
|
|
18676
18709
|
import Image8 from "next/image";
|
|
18677
18710
|
|
|
18678
18711
|
// src/features/auth/contexts/AuthContext.tsx
|
|
18679
|
-
import { createContext as createContext28, useContext as useContext28, useMemo as useMemo35, useState as
|
|
18712
|
+
import { createContext as createContext28, useContext as useContext28, useMemo as useMemo35, useState as useState66 } from "react";
|
|
18680
18713
|
|
|
18681
18714
|
// src/features/auth/components/forms/Register.tsx
|
|
18682
18715
|
import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
|
|
@@ -18684,7 +18717,7 @@ import { Loader2 as Loader24 } from "lucide-react";
|
|
|
18684
18717
|
import { useTranslations as useTranslations65 } from "next-intl";
|
|
18685
18718
|
import Image7 from "next/image";
|
|
18686
18719
|
import { useSearchParams as useSearchParams2 } from "next/navigation";
|
|
18687
|
-
import { useEffect as
|
|
18720
|
+
import { useEffect as useEffect55, useState as useState65 } from "react";
|
|
18688
18721
|
import { useForm as useForm5 } from "react-hook-form";
|
|
18689
18722
|
import { v4 as v45 } from "uuid";
|
|
18690
18723
|
import { z as z5 } from "zod";
|
|
@@ -18755,14 +18788,14 @@ function Register() {
|
|
|
18755
18788
|
const searchParams = useSearchParams2();
|
|
18756
18789
|
const inviteCode = searchParams.get("invite");
|
|
18757
18790
|
const registrationMode = getRegistrationMode();
|
|
18758
|
-
const [showConfirmation, setShowConfirmation] =
|
|
18759
|
-
const [inviteValidated, setInviteValidated] =
|
|
18760
|
-
const [inviteError, setInviteError] =
|
|
18761
|
-
const [isValidatingInvite, setIsValidatingInvite] =
|
|
18791
|
+
const [showConfirmation, setShowConfirmation] = useState65(false);
|
|
18792
|
+
const [inviteValidated, setInviteValidated] = useState65(false);
|
|
18793
|
+
const [inviteError, setInviteError] = useState65("");
|
|
18794
|
+
const [isValidatingInvite, setIsValidatingInvite] = useState65(
|
|
18762
18795
|
registrationMode === "waitlist" && !!inviteCode
|
|
18763
18796
|
);
|
|
18764
|
-
const [referralCode, setReferralCode2] =
|
|
18765
|
-
|
|
18797
|
+
const [referralCode, setReferralCode2] = useState65(null);
|
|
18798
|
+
useEffect55(() => {
|
|
18766
18799
|
const code = getReferralCode();
|
|
18767
18800
|
setReferralCode2(code);
|
|
18768
18801
|
}, []);
|
|
@@ -18795,7 +18828,7 @@ function Register() {
|
|
|
18795
18828
|
marketingConsent: false
|
|
18796
18829
|
}
|
|
18797
18830
|
});
|
|
18798
|
-
|
|
18831
|
+
useEffect55(() => {
|
|
18799
18832
|
async function validateInvite() {
|
|
18800
18833
|
if (registrationMode !== "waitlist" || !inviteCode) {
|
|
18801
18834
|
return;
|
|
@@ -19032,9 +19065,9 @@ var AuthContextProvider = /* @__PURE__ */ __name(({
|
|
|
19032
19065
|
initialComponentType,
|
|
19033
19066
|
initialParams
|
|
19034
19067
|
}) => {
|
|
19035
|
-
const [componentType, setComponentType] =
|
|
19036
|
-
const [params, setParams] =
|
|
19037
|
-
const [pendingTwoFactor, setPendingTwoFactor] =
|
|
19068
|
+
const [componentType, setComponentType] = useState66(initialComponentType);
|
|
19069
|
+
const [params, setParams] = useState66(initialParams);
|
|
19070
|
+
const [pendingTwoFactor, setPendingTwoFactor] = useState66();
|
|
19038
19071
|
const activeComponent = useMemo35(() => {
|
|
19039
19072
|
if (componentType === void 0) return null;
|
|
19040
19073
|
switch (componentType) {
|
|
@@ -19096,20 +19129,20 @@ __name(InnerAuthContainer, "InnerAuthContainer");
|
|
|
19096
19129
|
// src/features/auth/components/two-factor/TwoFactorSettings.tsx
|
|
19097
19130
|
import { ShieldAlert, ShieldCheck } from "lucide-react";
|
|
19098
19131
|
import { useTranslations as useTranslations72 } from "next-intl";
|
|
19099
|
-
import { useCallback as useCallback37, useEffect as
|
|
19132
|
+
import { useCallback as useCallback37, useEffect as useEffect57, useState as useState74 } from "react";
|
|
19100
19133
|
import { v4 as v48 } from "uuid";
|
|
19101
19134
|
|
|
19102
19135
|
// src/features/auth/components/two-factor/BackupCodesDialog.tsx
|
|
19103
19136
|
import { Copy, Download, RefreshCw as RefreshCw2 } from "lucide-react";
|
|
19104
19137
|
import { useTranslations as useTranslations66 } from "next-intl";
|
|
19105
|
-
import { useState as
|
|
19138
|
+
import { useState as useState67 } from "react";
|
|
19106
19139
|
import { jsx as jsx205, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
19107
19140
|
function BackupCodesDialog({ remainingCodes, onRegenerate, trigger }) {
|
|
19108
19141
|
const t = useTranslations66();
|
|
19109
|
-
const [open, setOpen] =
|
|
19110
|
-
const [codes, setCodes] =
|
|
19111
|
-
const [isLoading, setIsLoading] =
|
|
19112
|
-
const [showCodes, setShowCodes] =
|
|
19142
|
+
const [open, setOpen] = useState67(false);
|
|
19143
|
+
const [codes, setCodes] = useState67([]);
|
|
19144
|
+
const [isLoading, setIsLoading] = useState67(false);
|
|
19145
|
+
const [showCodes, setShowCodes] = useState67(false);
|
|
19113
19146
|
const handleGenerate = /* @__PURE__ */ __name(async () => {
|
|
19114
19147
|
setIsLoading(true);
|
|
19115
19148
|
try {
|
|
@@ -19204,15 +19237,15 @@ __name(BackupCodesDialog, "BackupCodesDialog");
|
|
|
19204
19237
|
|
|
19205
19238
|
// src/features/auth/components/two-factor/DisableTwoFactorDialog.tsx
|
|
19206
19239
|
import { useTranslations as useTranslations67 } from "next-intl";
|
|
19207
|
-
import { useState as
|
|
19240
|
+
import { useState as useState69 } from "react";
|
|
19208
19241
|
|
|
19209
19242
|
// src/features/auth/components/two-factor/TotpInput.tsx
|
|
19210
|
-
import { useEffect as
|
|
19243
|
+
import { useEffect as useEffect56, useRef as useRef36, useState as useState68 } from "react";
|
|
19211
19244
|
import { jsx as jsx206, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
19212
19245
|
function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
|
|
19213
|
-
const [digits, setDigits] =
|
|
19246
|
+
const [digits, setDigits] = useState68(["", "", "", "", "", ""]);
|
|
19214
19247
|
const inputRefs = useRef36([]);
|
|
19215
|
-
|
|
19248
|
+
useEffect56(() => {
|
|
19216
19249
|
if (autoFocus && inputRefs.current[0]) {
|
|
19217
19250
|
inputRefs.current[0].focus();
|
|
19218
19251
|
}
|
|
@@ -19274,9 +19307,9 @@ __name(TotpInput, "TotpInput");
|
|
|
19274
19307
|
import { jsx as jsx207, jsxs as jsxs115 } from "react/jsx-runtime";
|
|
19275
19308
|
function DisableTwoFactorDialog({ onSuccess, trigger }) {
|
|
19276
19309
|
const t = useTranslations67();
|
|
19277
|
-
const [open, setOpen] =
|
|
19278
|
-
const [isLoading, setIsLoading] =
|
|
19279
|
-
const [error, setError] =
|
|
19310
|
+
const [open, setOpen] = useState69(false);
|
|
19311
|
+
const [isLoading, setIsLoading] = useState69(false);
|
|
19312
|
+
const [error, setError] = useState69();
|
|
19280
19313
|
const handleVerify = /* @__PURE__ */ __name(async (code) => {
|
|
19281
19314
|
setIsLoading(true);
|
|
19282
19315
|
setError(void 0);
|
|
@@ -19317,15 +19350,15 @@ __name(DisableTwoFactorDialog, "DisableTwoFactorDialog");
|
|
|
19317
19350
|
// src/features/auth/components/two-factor/PasskeyList.tsx
|
|
19318
19351
|
import { Edit, Key, Trash2 } from "lucide-react";
|
|
19319
19352
|
import { useTranslations as useTranslations68 } from "next-intl";
|
|
19320
|
-
import { useState as
|
|
19353
|
+
import { useState as useState70 } from "react";
|
|
19321
19354
|
import { Fragment as Fragment34, jsx as jsx208, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
19322
19355
|
function PasskeyList({ passkeys, onRefresh }) {
|
|
19323
19356
|
const t = useTranslations68();
|
|
19324
19357
|
const locale = useI18nLocale();
|
|
19325
|
-
const [renameDialogOpen, setRenameDialogOpen] =
|
|
19326
|
-
const [selectedPasskey, setSelectedPasskey] =
|
|
19327
|
-
const [newName, setNewName] =
|
|
19328
|
-
const [isLoading, setIsLoading] =
|
|
19358
|
+
const [renameDialogOpen, setRenameDialogOpen] = useState70(false);
|
|
19359
|
+
const [selectedPasskey, setSelectedPasskey] = useState70(null);
|
|
19360
|
+
const [newName, setNewName] = useState70("");
|
|
19361
|
+
const [isLoading, setIsLoading] = useState70(false);
|
|
19329
19362
|
const handleDelete = /* @__PURE__ */ __name(async (passkey) => {
|
|
19330
19363
|
setIsLoading(true);
|
|
19331
19364
|
try {
|
|
@@ -19439,14 +19472,14 @@ __name(PasskeyList, "PasskeyList");
|
|
|
19439
19472
|
// src/features/auth/components/two-factor/PasskeySetupDialog.tsx
|
|
19440
19473
|
import { startRegistration } from "@simplewebauthn/browser";
|
|
19441
19474
|
import { useTranslations as useTranslations69 } from "next-intl";
|
|
19442
|
-
import { useState as
|
|
19475
|
+
import { useState as useState71 } from "react";
|
|
19443
19476
|
import { v4 as v46 } from "uuid";
|
|
19444
19477
|
import { jsx as jsx209, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
19445
19478
|
function PasskeySetupDialog({ open, onOpenChange, onSuccess }) {
|
|
19446
19479
|
const t = useTranslations69();
|
|
19447
19480
|
const { currentUser } = useCurrentUserContext();
|
|
19448
|
-
const [name, setName] =
|
|
19449
|
-
const [isLoading, setIsLoading] =
|
|
19481
|
+
const [name, setName] = useState71("");
|
|
19482
|
+
const [isLoading, setIsLoading] = useState71(false);
|
|
19450
19483
|
const handleRegister = /* @__PURE__ */ __name(async () => {
|
|
19451
19484
|
if (!name.trim()) return;
|
|
19452
19485
|
setIsLoading(true);
|
|
@@ -19510,12 +19543,12 @@ __name(PasskeySetupDialog, "PasskeySetupDialog");
|
|
|
19510
19543
|
// src/features/auth/components/two-factor/TotpAuthenticatorList.tsx
|
|
19511
19544
|
import { Smartphone, Trash2 as Trash22 } from "lucide-react";
|
|
19512
19545
|
import { useTranslations as useTranslations70 } from "next-intl";
|
|
19513
|
-
import { useState as
|
|
19546
|
+
import { useState as useState72 } from "react";
|
|
19514
19547
|
import { jsx as jsx210, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
19515
19548
|
function TotpAuthenticatorList({ authenticators, onDelete }) {
|
|
19516
19549
|
const t = useTranslations70();
|
|
19517
19550
|
const locale = useI18nLocale();
|
|
19518
|
-
const [deletingId, setDeletingId] =
|
|
19551
|
+
const [deletingId, setDeletingId] = useState72(null);
|
|
19519
19552
|
const handleDelete = /* @__PURE__ */ __name(async (id) => {
|
|
19520
19553
|
setDeletingId(id);
|
|
19521
19554
|
try {
|
|
@@ -19586,19 +19619,19 @@ __name(TotpAuthenticatorList, "TotpAuthenticatorList");
|
|
|
19586
19619
|
// src/features/auth/components/two-factor/TotpSetupDialog.tsx
|
|
19587
19620
|
import { useTranslations as useTranslations71 } from "next-intl";
|
|
19588
19621
|
import { QRCodeSVG } from "qrcode.react";
|
|
19589
|
-
import { useState as
|
|
19622
|
+
import { useState as useState73 } from "react";
|
|
19590
19623
|
import { v4 as v47 } from "uuid";
|
|
19591
19624
|
import { jsx as jsx211, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
19592
19625
|
function TotpSetupDialog({ onSuccess, trigger }) {
|
|
19593
19626
|
const t = useTranslations71();
|
|
19594
19627
|
const { currentUser } = useCurrentUserContext();
|
|
19595
|
-
const [open, setOpen] =
|
|
19596
|
-
const [step, setStep] =
|
|
19597
|
-
const [name, setName] =
|
|
19598
|
-
const [qrCodeUri, setQrCodeUri] =
|
|
19599
|
-
const [authenticatorId, setAuthenticatorId] =
|
|
19600
|
-
const [isLoading, setIsLoading] =
|
|
19601
|
-
const [verifyError, setVerifyError] =
|
|
19628
|
+
const [open, setOpen] = useState73(false);
|
|
19629
|
+
const [step, setStep] = useState73("name");
|
|
19630
|
+
const [name, setName] = useState73("");
|
|
19631
|
+
const [qrCodeUri, setQrCodeUri] = useState73("");
|
|
19632
|
+
const [authenticatorId, setAuthenticatorId] = useState73("");
|
|
19633
|
+
const [isLoading, setIsLoading] = useState73(false);
|
|
19634
|
+
const [verifyError, setVerifyError] = useState73();
|
|
19602
19635
|
const handleStartSetup = /* @__PURE__ */ __name(async () => {
|
|
19603
19636
|
if (!name.trim()) return;
|
|
19604
19637
|
setIsLoading(true);
|
|
@@ -19696,12 +19729,12 @@ __name(TotpSetupDialog, "TotpSetupDialog");
|
|
|
19696
19729
|
import { Fragment as Fragment35, jsx as jsx212, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
19697
19730
|
function TwoFactorSettings() {
|
|
19698
19731
|
const t = useTranslations72();
|
|
19699
|
-
const [status, setStatus] =
|
|
19700
|
-
const [authenticators, setAuthenticators] =
|
|
19701
|
-
const [passkeys, setPasskeys] =
|
|
19702
|
-
const [isLoading, setIsLoading] =
|
|
19703
|
-
const [isEnabling, setIsEnabling] =
|
|
19704
|
-
const [passkeyDialogOpen, setPasskeyDialogOpen] =
|
|
19732
|
+
const [status, setStatus] = useState74(null);
|
|
19733
|
+
const [authenticators, setAuthenticators] = useState74([]);
|
|
19734
|
+
const [passkeys, setPasskeys] = useState74([]);
|
|
19735
|
+
const [isLoading, setIsLoading] = useState74(true);
|
|
19736
|
+
const [isEnabling, setIsEnabling] = useState74(false);
|
|
19737
|
+
const [passkeyDialogOpen, setPasskeyDialogOpen] = useState74(false);
|
|
19705
19738
|
const loadStatus = useCallback37(async () => {
|
|
19706
19739
|
try {
|
|
19707
19740
|
const [statusData, authenticatorsList, passkeysList] = await Promise.all([
|
|
@@ -19718,7 +19751,7 @@ function TwoFactorSettings() {
|
|
|
19718
19751
|
setIsLoading(false);
|
|
19719
19752
|
}
|
|
19720
19753
|
}, [t]);
|
|
19721
|
-
|
|
19754
|
+
useEffect57(() => {
|
|
19722
19755
|
loadStatus();
|
|
19723
19756
|
}, [loadStatus]);
|
|
19724
19757
|
const handleRefresh = /* @__PURE__ */ __name(() => {
|
|
@@ -19908,16 +19941,16 @@ __name(LandingComponent, "LandingComponent");
|
|
|
19908
19941
|
import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
|
|
19909
19942
|
import { useTranslations as useTranslations74 } from "next-intl";
|
|
19910
19943
|
import Image10 from "next/image";
|
|
19911
|
-
import { useEffect as
|
|
19944
|
+
import { useEffect as useEffect58, useState as useState75 } from "react";
|
|
19912
19945
|
import { useForm as useForm6 } from "react-hook-form";
|
|
19913
19946
|
import { z as z6 } from "zod";
|
|
19914
19947
|
import { Fragment as Fragment37, jsx as jsx216, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
19915
19948
|
function AcceptInvitation() {
|
|
19916
19949
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
19917
|
-
const [showConfirmation, setShowConfirmation] =
|
|
19918
|
-
const [error, setError] =
|
|
19950
|
+
const [showConfirmation, setShowConfirmation] = useState75(false);
|
|
19951
|
+
const [error, setError] = useState75(void 0);
|
|
19919
19952
|
const t = useTranslations74();
|
|
19920
|
-
|
|
19953
|
+
useEffect58(() => {
|
|
19921
19954
|
async function validateCode(code) {
|
|
19922
19955
|
try {
|
|
19923
19956
|
const payload = {
|
|
@@ -20010,14 +20043,14 @@ __name(AcceptInvitation, "AcceptInvitation");
|
|
|
20010
20043
|
// src/features/auth/components/forms/ActivateAccount.tsx
|
|
20011
20044
|
import { useTranslations as useTranslations75 } from "next-intl";
|
|
20012
20045
|
import Image11 from "next/image";
|
|
20013
|
-
import { useEffect as
|
|
20046
|
+
import { useEffect as useEffect59, useState as useState76 } from "react";
|
|
20014
20047
|
import { Fragment as Fragment38, jsx as jsx217, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
20015
20048
|
function ActivateAccount() {
|
|
20016
20049
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
20017
|
-
const [showConfirmation, setShowConfirmation] =
|
|
20018
|
-
const [error, setError] =
|
|
20050
|
+
const [showConfirmation, setShowConfirmation] = useState76(false);
|
|
20051
|
+
const [error, setError] = useState76(void 0);
|
|
20019
20052
|
const t = useTranslations75();
|
|
20020
|
-
|
|
20053
|
+
useEffect59(() => {
|
|
20021
20054
|
async function ActivateAccount2(code) {
|
|
20022
20055
|
try {
|
|
20023
20056
|
const payload = {
|
|
@@ -20058,12 +20091,12 @@ function ActivateAccount() {
|
|
|
20058
20091
|
__name(ActivateAccount, "ActivateAccount");
|
|
20059
20092
|
|
|
20060
20093
|
// src/features/auth/components/forms/Cookies.tsx
|
|
20061
|
-
import { useEffect as
|
|
20094
|
+
import { useEffect as useEffect60, useState as useState77 } from "react";
|
|
20062
20095
|
function Cookies({ dehydratedAuth, page }) {
|
|
20063
20096
|
const { setUser } = useCurrentUserContext();
|
|
20064
20097
|
const router = useI18nRouter();
|
|
20065
|
-
const [hasSaved, setHasSaved] =
|
|
20066
|
-
|
|
20098
|
+
const [hasSaved, setHasSaved] = useState77(false);
|
|
20099
|
+
useEffect60(() => {
|
|
20067
20100
|
if (hasSaved) return;
|
|
20068
20101
|
async function saveTokenOnServer() {
|
|
20069
20102
|
await AuthService.saveToken({ dehydratedAuth });
|
|
@@ -20086,14 +20119,14 @@ __name(Cookies, "Cookies");
|
|
|
20086
20119
|
import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
|
|
20087
20120
|
import { useTranslations as useTranslations76 } from "next-intl";
|
|
20088
20121
|
import Image12 from "next/image";
|
|
20089
|
-
import { useState as
|
|
20122
|
+
import { useState as useState78 } from "react";
|
|
20090
20123
|
import { useForm as useForm7 } from "react-hook-form";
|
|
20091
20124
|
import { z as z7 } from "zod";
|
|
20092
20125
|
import { Fragment as Fragment39, jsx as jsx218, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
20093
20126
|
function ForgotPassword() {
|
|
20094
20127
|
const t = useTranslations76();
|
|
20095
20128
|
const { setComponentType } = useAuthContext();
|
|
20096
|
-
const [showConfirmation, setShowConfirmation] =
|
|
20129
|
+
const [showConfirmation, setShowConfirmation] = useState78(false);
|
|
20097
20130
|
const formSchema = z7.object({
|
|
20098
20131
|
email: z7.string().email({
|
|
20099
20132
|
message: t(`common.errors.invalid_email`)
|
|
@@ -20158,7 +20191,7 @@ import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
|
|
|
20158
20191
|
import { useTranslations as useTranslations77 } from "next-intl";
|
|
20159
20192
|
import Image13 from "next/image";
|
|
20160
20193
|
import { useRouter, useSearchParams as useSearchParams3 } from "next/navigation";
|
|
20161
|
-
import { useEffect as
|
|
20194
|
+
import { useEffect as useEffect61, useState as useState79 } from "react";
|
|
20162
20195
|
import { useForm as useForm8 } from "react-hook-form";
|
|
20163
20196
|
import { z as z8 } from "zod";
|
|
20164
20197
|
import { Fragment as Fragment40, jsx as jsx219, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
@@ -20171,8 +20204,8 @@ function Login() {
|
|
|
20171
20204
|
const nativeRouter = useRouter();
|
|
20172
20205
|
const searchParams = useSearchParams3();
|
|
20173
20206
|
const callbackUrl = searchParams.get("callbackUrl");
|
|
20174
|
-
const [referralCode, setReferralCode2] =
|
|
20175
|
-
|
|
20207
|
+
const [referralCode, setReferralCode2] = useState79(null);
|
|
20208
|
+
useEffect61(() => {
|
|
20176
20209
|
const cookies = document.cookie.split("; ");
|
|
20177
20210
|
for (const cookie of cookies) {
|
|
20178
20211
|
const [name, value] = cookie.split("=");
|
|
@@ -20291,7 +20324,7 @@ function Login() {
|
|
|
20291
20324
|
__name(Login, "Login");
|
|
20292
20325
|
|
|
20293
20326
|
// src/features/auth/components/forms/Logout.tsx
|
|
20294
|
-
import { useEffect as
|
|
20327
|
+
import { useEffect as useEffect62 } from "react";
|
|
20295
20328
|
|
|
20296
20329
|
// src/features/auth/utils/clearClientStorage.ts
|
|
20297
20330
|
function clearClientStorage(keys) {
|
|
@@ -20306,7 +20339,7 @@ __name(clearClientStorage, "clearClientStorage");
|
|
|
20306
20339
|
import { Fragment as Fragment41, jsx as jsx220 } from "react/jsx-runtime";
|
|
20307
20340
|
function Logout({ storageKeys }) {
|
|
20308
20341
|
const generateUrl = usePageUrlGenerator();
|
|
20309
|
-
|
|
20342
|
+
useEffect62(() => {
|
|
20310
20343
|
const logOut = /* @__PURE__ */ __name(async () => {
|
|
20311
20344
|
clearClientStorage([CURRENT_USER_STORAGE_KEY, ...storageKeys ?? []]);
|
|
20312
20345
|
await AuthService.logout();
|
|
@@ -20320,7 +20353,7 @@ __name(Logout, "Logout");
|
|
|
20320
20353
|
|
|
20321
20354
|
// src/features/auth/components/forms/RefreshUser.tsx
|
|
20322
20355
|
import { deleteCookie, getCookie as getCookie2 } from "cookies-next";
|
|
20323
|
-
import { useEffect as
|
|
20356
|
+
import { useEffect as useEffect63 } from "react";
|
|
20324
20357
|
function RefreshUser() {
|
|
20325
20358
|
const { setUser } = useCurrentUserContext();
|
|
20326
20359
|
const loadFullUser = /* @__PURE__ */ __name(async () => {
|
|
@@ -20340,7 +20373,7 @@ function RefreshUser() {
|
|
|
20340
20373
|
deleteCookie("reloadData");
|
|
20341
20374
|
}
|
|
20342
20375
|
}, "loadFullUser");
|
|
20343
|
-
|
|
20376
|
+
useEffect63(() => {
|
|
20344
20377
|
const reloadData = getCookie2("reloadData");
|
|
20345
20378
|
if (reloadData !== void 0) loadFullUser();
|
|
20346
20379
|
}, []);
|
|
@@ -20352,16 +20385,16 @@ __name(RefreshUser, "RefreshUser");
|
|
|
20352
20385
|
import { zodResolver as zodResolver9 } from "@hookform/resolvers/zod";
|
|
20353
20386
|
import { useTranslations as useTranslations78 } from "next-intl";
|
|
20354
20387
|
import Image14 from "next/image";
|
|
20355
|
-
import { useEffect as
|
|
20388
|
+
import { useEffect as useEffect64, useState as useState80 } from "react";
|
|
20356
20389
|
import { useForm as useForm9 } from "react-hook-form";
|
|
20357
20390
|
import { z as z9 } from "zod";
|
|
20358
20391
|
import { Fragment as Fragment42, jsx as jsx221, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
20359
20392
|
function ResetPassword() {
|
|
20360
20393
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
20361
|
-
const [showConfirmation, setShowConfirmation] =
|
|
20362
|
-
const [error, setError] =
|
|
20394
|
+
const [showConfirmation, setShowConfirmation] = useState80(false);
|
|
20395
|
+
const [error, setError] = useState80(void 0);
|
|
20363
20396
|
const t = useTranslations78();
|
|
20364
|
-
|
|
20397
|
+
useEffect64(() => {
|
|
20365
20398
|
async function validateResetPasswordCode(code) {
|
|
20366
20399
|
try {
|
|
20367
20400
|
const payload = {
|
|
@@ -20438,18 +20471,18 @@ __name(ResetPassword, "ResetPassword");
|
|
|
20438
20471
|
// src/features/auth/components/forms/TwoFactorChallenge.tsx
|
|
20439
20472
|
import { useTranslations as useTranslations80 } from "next-intl";
|
|
20440
20473
|
import { useRouter as useRouter2, useSearchParams as useSearchParams4 } from "next/navigation";
|
|
20441
|
-
import { useState as
|
|
20474
|
+
import { useState as useState82 } from "react";
|
|
20442
20475
|
import { v4 as v410 } from "uuid";
|
|
20443
20476
|
|
|
20444
20477
|
// src/features/auth/components/two-factor/PasskeyButton.tsx
|
|
20445
20478
|
import { startAuthentication } from "@simplewebauthn/browser";
|
|
20446
20479
|
import { useTranslations as useTranslations79 } from "next-intl";
|
|
20447
|
-
import { useState as
|
|
20480
|
+
import { useState as useState81 } from "react";
|
|
20448
20481
|
import { v4 as v49 } from "uuid";
|
|
20449
20482
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
20450
20483
|
function PasskeyButton({ pendingToken, onSuccess, onError, disabled = false }) {
|
|
20451
20484
|
const t = useTranslations79();
|
|
20452
|
-
const [isLoading, setIsLoading] =
|
|
20485
|
+
const [isLoading, setIsLoading] = useState81(false);
|
|
20453
20486
|
const handleClick = /* @__PURE__ */ __name(async () => {
|
|
20454
20487
|
setIsLoading(true);
|
|
20455
20488
|
try {
|
|
@@ -20494,10 +20527,10 @@ function TwoFactorChallenge() {
|
|
|
20494
20527
|
const nativeRouter = useRouter2();
|
|
20495
20528
|
const searchParams = useSearchParams4();
|
|
20496
20529
|
const callbackUrl = searchParams.get("callbackUrl");
|
|
20497
|
-
const [isVerifying, setIsVerifying] =
|
|
20498
|
-
const [totpError, setTotpError] =
|
|
20499
|
-
const [backupCode, setBackupCode] =
|
|
20500
|
-
const [backupError, setBackupError] =
|
|
20530
|
+
const [isVerifying, setIsVerifying] = useState82(false);
|
|
20531
|
+
const [totpError, setTotpError] = useState82();
|
|
20532
|
+
const [backupCode, setBackupCode] = useState82("");
|
|
20533
|
+
const [backupError, setBackupError] = useState82();
|
|
20501
20534
|
if (!pendingTwoFactor) {
|
|
20502
20535
|
return null;
|
|
20503
20536
|
}
|
|
@@ -20792,7 +20825,7 @@ var AI_CONNECTIONS_I18N_KEYS = [
|
|
|
20792
20825
|
|
|
20793
20826
|
// src/features/ai-connection/contexts/AiConnectionsContext.tsx
|
|
20794
20827
|
import { useTranslations as useTranslations82 } from "next-intl";
|
|
20795
|
-
import { createContext as createContext29, useCallback as useCallback38, useContext as useContext29, useEffect as
|
|
20828
|
+
import { createContext as createContext29, useCallback as useCallback38, useContext as useContext29, useEffect as useEffect65, useMemo as useMemo36, useState as useState83 } from "react";
|
|
20796
20829
|
import { jsx as jsx225 } from "react/jsx-runtime";
|
|
20797
20830
|
var AI_CONNECTIONS_ADMIN_PAGE_URL = "/administration/ai-connections";
|
|
20798
20831
|
var defaultContextValue3 = {
|
|
@@ -20810,11 +20843,11 @@ var AiConnectionsContext = createContext29(void 0);
|
|
|
20810
20843
|
var AiConnectionsProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
20811
20844
|
const t = useTranslations82();
|
|
20812
20845
|
const generateUrl = usePageUrlGenerator();
|
|
20813
|
-
const [connections, setConnections] =
|
|
20814
|
-
const [providerRegistry, setProviderRegistry] =
|
|
20815
|
-
const [envDefaults, setEnvDefaults] =
|
|
20816
|
-
const [scopeCompanyId, setScopeCompanyId] =
|
|
20817
|
-
const [isLoading, setIsLoading] =
|
|
20846
|
+
const [connections, setConnections] = useState83([]);
|
|
20847
|
+
const [providerRegistry, setProviderRegistry] = useState83({});
|
|
20848
|
+
const [envDefaults, setEnvDefaults] = useState83({});
|
|
20849
|
+
const [scopeCompanyId, setScopeCompanyId] = useState83(null);
|
|
20850
|
+
const [isLoading, setIsLoading] = useState83(true);
|
|
20818
20851
|
const refresh = useCallback38(async () => {
|
|
20819
20852
|
setIsLoading(true);
|
|
20820
20853
|
try {
|
|
@@ -20826,7 +20859,7 @@ var AiConnectionsProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
|
20826
20859
|
setIsLoading(false);
|
|
20827
20860
|
}
|
|
20828
20861
|
}, []);
|
|
20829
|
-
|
|
20862
|
+
useEffect65(() => {
|
|
20830
20863
|
void refresh();
|
|
20831
20864
|
}, [refresh]);
|
|
20832
20865
|
const value = useMemo36(
|
|
@@ -20853,7 +20886,7 @@ var useAiConnections = /* @__PURE__ */ __name(() => useContext29(AiConnectionsCo
|
|
|
20853
20886
|
|
|
20854
20887
|
// src/features/ai-connection/components/containers/AiConnectionsContainer.tsx
|
|
20855
20888
|
import { useTranslations as useTranslations86 } from "next-intl";
|
|
20856
|
-
import { useEffect as
|
|
20889
|
+
import { useEffect as useEffect67, useMemo as useMemo39, useState as useState85 } from "react";
|
|
20857
20890
|
|
|
20858
20891
|
// src/features/ai-connection/components/lists/AiConnectionTypeCard.tsx
|
|
20859
20892
|
import { ChevronDownIcon as ChevronDownIcon10, ChevronUpIcon as ChevronUpIcon3, PlusIcon as PlusIcon2 } from "lucide-react";
|
|
@@ -20863,12 +20896,12 @@ import { useMemo as useMemo38 } from "react";
|
|
|
20863
20896
|
// src/features/ai-connection/components/forms/AiConnectionDeleter.tsx
|
|
20864
20897
|
import { TrashIcon } from "lucide-react";
|
|
20865
20898
|
import { useTranslations as useTranslations83 } from "next-intl";
|
|
20866
|
-
import { useState as
|
|
20899
|
+
import { useState as useState84 } from "react";
|
|
20867
20900
|
import { Fragment as Fragment44, jsx as jsx226, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
20868
20901
|
function AiConnectionDeleter({ connection }) {
|
|
20869
20902
|
const t = useTranslations83();
|
|
20870
20903
|
const { refresh } = useAiConnections();
|
|
20871
|
-
const [open, setOpen] =
|
|
20904
|
+
const [open, setOpen] = useState84(false);
|
|
20872
20905
|
return /* @__PURE__ */ jsxs130(Fragment44, { children: [
|
|
20873
20906
|
/* @__PURE__ */ jsx226(
|
|
20874
20907
|
Button,
|
|
@@ -20909,7 +20942,7 @@ __name(AiConnectionDeleter, "AiConnectionDeleter");
|
|
|
20909
20942
|
// src/features/ai-connection/components/forms/AiConnectionEditor.tsx
|
|
20910
20943
|
import { zodResolver as zodResolver10 } from "@hookform/resolvers/zod";
|
|
20911
20944
|
import { useTranslations as useTranslations84 } from "next-intl";
|
|
20912
|
-
import { useCallback as useCallback39, useEffect as
|
|
20945
|
+
import { useCallback as useCallback39, useEffect as useEffect66, useMemo as useMemo37 } from "react";
|
|
20913
20946
|
import { useForm as useForm10 } from "react-hook-form";
|
|
20914
20947
|
import { v4 as v411 } from "uuid";
|
|
20915
20948
|
import { z as z10 } from "zod";
|
|
@@ -21006,7 +21039,7 @@ function AiConnectionEditor({
|
|
|
21006
21039
|
resolver: zodResolver10(formSchema),
|
|
21007
21040
|
defaultValues: getDefaultValues()
|
|
21008
21041
|
});
|
|
21009
|
-
|
|
21042
|
+
useEffect66(() => {
|
|
21010
21043
|
if (registryRows.length === 0) return;
|
|
21011
21044
|
const currentProvider = form.getValues("provider");
|
|
21012
21045
|
const provider = currentProvider || connection?.provider || providers[0] || "";
|
|
@@ -21347,8 +21380,8 @@ __name(AiConnectionsContainer, "AiConnectionsContainer");
|
|
|
21347
21380
|
function AiConnectionsBody() {
|
|
21348
21381
|
const t = useTranslations86();
|
|
21349
21382
|
const { scopeCompanyId, setScopeCompanyId } = useAiConnections();
|
|
21350
|
-
const [companies, setCompanies] =
|
|
21351
|
-
|
|
21383
|
+
const [companies, setCompanies] = useState85([]);
|
|
21384
|
+
useEffect67(() => {
|
|
21352
21385
|
let active = true;
|
|
21353
21386
|
CompanyService.findMany({}).then((response) => {
|
|
21354
21387
|
if (active) setCompanies(response ?? []);
|
|
@@ -21465,7 +21498,7 @@ __name(RelevantContentsList, "RelevantContentsList");
|
|
|
21465
21498
|
// src/features/how-to/components/containers/HowToCommand.tsx
|
|
21466
21499
|
import { ArrowRight, LifeBuoyIcon } from "lucide-react";
|
|
21467
21500
|
import { useTranslations as useTranslations91 } from "next-intl";
|
|
21468
|
-
import { useCallback as useCallback40, useEffect as
|
|
21501
|
+
import { useCallback as useCallback40, useEffect as useEffect68, useMemo as useMemo41, useRef as useRef37, useState as useState86 } from "react";
|
|
21469
21502
|
|
|
21470
21503
|
// src/features/how-to/components/containers/HowToCommandViewer.tsx
|
|
21471
21504
|
import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
|
|
@@ -21591,10 +21624,10 @@ function matchPage(pathname, pattern) {
|
|
|
21591
21624
|
__name(matchPage, "matchPage");
|
|
21592
21625
|
function HowToCommand({ pathname, contextKeys, extraGroups, onStartChat }) {
|
|
21593
21626
|
const t = useTranslations91();
|
|
21594
|
-
const [dialogOpen, setDialogOpen] =
|
|
21595
|
-
const [selectedHowTo, setSelectedHowTo] =
|
|
21627
|
+
const [dialogOpen, setDialogOpen] = useState86(false);
|
|
21628
|
+
const [selectedHowTo, setSelectedHowTo] = useState86(null);
|
|
21596
21629
|
const searchTermRef = useRef37("");
|
|
21597
|
-
const [searchTerm, setSearchTerm] =
|
|
21630
|
+
const [searchTerm, setSearchTerm] = useState86("");
|
|
21598
21631
|
const data = useDataListRetriever({
|
|
21599
21632
|
retriever: /* @__PURE__ */ __name((params) => {
|
|
21600
21633
|
return HowToService.findMany(params);
|
|
@@ -21625,16 +21658,16 @@ function HowToCommand({ pathname, contextKeys, extraGroups, onStartChat }) {
|
|
|
21625
21658
|
[searchTermRef, data]
|
|
21626
21659
|
);
|
|
21627
21660
|
const updateSearchTerm = useDebounce2(search, 500);
|
|
21628
|
-
|
|
21661
|
+
useEffect68(() => {
|
|
21629
21662
|
updateSearchTerm(searchTerm);
|
|
21630
21663
|
}, [updateSearchTerm, searchTerm]);
|
|
21631
|
-
|
|
21664
|
+
useEffect68(() => {
|
|
21632
21665
|
if (!dialogOpen) {
|
|
21633
21666
|
setSearchTerm("");
|
|
21634
21667
|
searchTermRef.current = "";
|
|
21635
21668
|
}
|
|
21636
21669
|
}, [dialogOpen]);
|
|
21637
|
-
|
|
21670
|
+
useEffect68(() => {
|
|
21638
21671
|
const down = /* @__PURE__ */ __name((e) => {
|
|
21639
21672
|
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
21640
21673
|
e.preventDefault();
|
|
@@ -21710,14 +21743,32 @@ function HowToCommand({ pathname, contextKeys, extraGroups, onStartChat }) {
|
|
|
21710
21743
|
/* @__PURE__ */ jsxs136(CommandList, { className: "max-h-[60vh] overflow-y-auto", children: [
|
|
21711
21744
|
/* @__PURE__ */ jsx234(CommandEmpty, { children: t(`howto.command.empty`) }),
|
|
21712
21745
|
!searchTerm && extraGroups,
|
|
21713
|
-
relevantHowTos.length > 0 && /* @__PURE__ */ jsx234(CommandGroup, { heading: t(`howto.command.relevant`), children: relevantHowTos.map((howTo) => /* @__PURE__ */ jsxs136(
|
|
21714
|
-
|
|
21715
|
-
|
|
21716
|
-
|
|
21717
|
-
|
|
21718
|
-
|
|
21719
|
-
|
|
21720
|
-
|
|
21746
|
+
relevantHowTos.length > 0 && /* @__PURE__ */ jsx234(CommandGroup, { heading: t(`howto.command.relevant`), children: relevantHowTos.map((howTo) => /* @__PURE__ */ jsxs136(
|
|
21747
|
+
CommandItem,
|
|
21748
|
+
{
|
|
21749
|
+
value: howTo.id,
|
|
21750
|
+
onSelect: () => setSelectedHowTo(howTo),
|
|
21751
|
+
className: "cursor-pointer",
|
|
21752
|
+
children: [
|
|
21753
|
+
/* @__PURE__ */ jsx234(ArrowRight, { className: "h-4 w-4 rtl:rotate-180" }),
|
|
21754
|
+
/* @__PURE__ */ jsx234("span", { children: howTo.name })
|
|
21755
|
+
]
|
|
21756
|
+
},
|
|
21757
|
+
howTo.id
|
|
21758
|
+
)) }),
|
|
21759
|
+
otherHowTos.length > 0 && /* @__PURE__ */ jsx234(CommandGroup, { heading: searchTerm ? void 0 : t(`howto.command.all`), children: otherHowTos.map((howTo) => /* @__PURE__ */ jsxs136(
|
|
21760
|
+
CommandItem,
|
|
21761
|
+
{
|
|
21762
|
+
value: howTo.id,
|
|
21763
|
+
onSelect: () => setSelectedHowTo(howTo),
|
|
21764
|
+
className: "cursor-pointer",
|
|
21765
|
+
children: [
|
|
21766
|
+
/* @__PURE__ */ jsx234(ArrowRight, { className: "h-4 w-4 rtl:rotate-180" }),
|
|
21767
|
+
/* @__PURE__ */ jsx234("span", { children: howTo.name })
|
|
21768
|
+
]
|
|
21769
|
+
},
|
|
21770
|
+
howTo.id
|
|
21771
|
+
)) })
|
|
21721
21772
|
] }),
|
|
21722
21773
|
/* @__PURE__ */ jsxs136("div", { className: "text-muted-foreground flex items-center justify-center gap-4 border-t px-3 py-2 text-xs", children: [
|
|
21723
21774
|
/* @__PURE__ */ jsxs136("span", { className: "flex items-center gap-1", children: [
|
|
@@ -21866,11 +21917,11 @@ registerTableGenerator("howtos", useHowToTableStructure);
|
|
|
21866
21917
|
|
|
21867
21918
|
// src/features/how-to/components/forms/HowToReindexButton.tsx
|
|
21868
21919
|
import { useTranslations as useTranslations94 } from "next-intl";
|
|
21869
|
-
import { useState as
|
|
21920
|
+
import { useState as useState87 } from "react";
|
|
21870
21921
|
import { jsx as jsx239 } from "react/jsx-runtime";
|
|
21871
21922
|
function HowToReindexButton({ refresh }) {
|
|
21872
21923
|
const t = useTranslations94();
|
|
21873
|
-
const [isReindexing, setIsReindexing] =
|
|
21924
|
+
const [isReindexing, setIsReindexing] = useState87(false);
|
|
21874
21925
|
const onReindex = /* @__PURE__ */ __name(async () => {
|
|
21875
21926
|
setIsReindexing(true);
|
|
21876
21927
|
try {
|
|
@@ -21929,7 +21980,7 @@ __name(HowToListContainer, "HowToListContainer");
|
|
|
21929
21980
|
// src/features/how-to/components/forms/HowToSelector.tsx
|
|
21930
21981
|
import { CircleX as CircleX3, RefreshCwIcon as RefreshCwIcon4, SearchIcon as SearchIcon7, XIcon as XIcon11 } from "lucide-react";
|
|
21931
21982
|
import { useTranslations as useTranslations96 } from "next-intl";
|
|
21932
|
-
import { useCallback as useCallback41, useEffect as
|
|
21983
|
+
import { useCallback as useCallback41, useEffect as useEffect69, useRef as useRef38, useState as useState88 } from "react";
|
|
21933
21984
|
import { Fragment as Fragment48, jsx as jsx242, jsxs as jsxs138 } from "react/jsx-runtime";
|
|
21934
21985
|
function HowToSelector({
|
|
21935
21986
|
id,
|
|
@@ -21940,10 +21991,10 @@ function HowToSelector({
|
|
|
21940
21991
|
isRequired = false
|
|
21941
21992
|
}) {
|
|
21942
21993
|
const t = useTranslations96();
|
|
21943
|
-
const [open, setOpen] =
|
|
21994
|
+
const [open, setOpen] = useState88(false);
|
|
21944
21995
|
const searchTermRef = useRef38("");
|
|
21945
|
-
const [searchTerm, setSearchTerm] =
|
|
21946
|
-
const [isSearching, setIsSearching] =
|
|
21996
|
+
const [searchTerm, setSearchTerm] = useState88("");
|
|
21997
|
+
const [isSearching, setIsSearching] = useState88(false);
|
|
21947
21998
|
const data = useDataListRetriever({
|
|
21948
21999
|
retriever: /* @__PURE__ */ __name((params) => {
|
|
21949
22000
|
return HowToService.findMany(params);
|
|
@@ -21965,7 +22016,7 @@ function HowToSelector({
|
|
|
21965
22016
|
[searchTermRef, data]
|
|
21966
22017
|
);
|
|
21967
22018
|
const updateSearchTerm = useDebounce2(search, 500);
|
|
21968
|
-
|
|
22019
|
+
useEffect69(() => {
|
|
21969
22020
|
setIsSearching(true);
|
|
21970
22021
|
updateSearchTerm(searchTerm);
|
|
21971
22022
|
}, [updateSearchTerm, searchTerm]);
|
|
@@ -22021,6 +22072,7 @@ function HowToSelector({
|
|
|
22021
22072
|
CommandItem,
|
|
22022
22073
|
{
|
|
22023
22074
|
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
22075
|
+
value: howTo.id,
|
|
22024
22076
|
onSelect: () => setHowTo(howTo),
|
|
22025
22077
|
children: howTo.name
|
|
22026
22078
|
},
|
|
@@ -22033,7 +22085,7 @@ __name(HowToSelector, "HowToSelector");
|
|
|
22033
22085
|
|
|
22034
22086
|
// src/features/handbook/components/lists/HandbookContents.tsx
|
|
22035
22087
|
import { useTranslations as useTranslations111 } from "next-intl";
|
|
22036
|
-
import { useCallback as useCallback45, useEffect as
|
|
22088
|
+
import { useCallback as useCallback45, useEffect as useEffect73, useMemo as useMemo48, useState as useState96 } from "react";
|
|
22037
22089
|
|
|
22038
22090
|
// src/features/handbook/contexts/HandbookContext.tsx
|
|
22039
22091
|
import { useTranslations as useTranslations97 } from "next-intl";
|
|
@@ -22088,10 +22140,10 @@ var HandbookProvider = /* @__PURE__ */ __name(({ children, page, section, functi
|
|
|
22088
22140
|
import { MessagesSquareIcon, Sparkles as Sparkles2 } from "lucide-react";
|
|
22089
22141
|
import { useTranslations as useTranslations108 } from "next-intl";
|
|
22090
22142
|
import Link5 from "next/link";
|
|
22091
|
-
import { useCallback as useCallback44, useState as
|
|
22143
|
+
import { useCallback as useCallback44, useState as useState94 } from "react";
|
|
22092
22144
|
|
|
22093
22145
|
// src/features/assistant/components/parts/AssistantComposer.tsx
|
|
22094
|
-
import { useState as
|
|
22146
|
+
import { useState as useState89 } from "react";
|
|
22095
22147
|
import { useTranslations as useTranslations98 } from "next-intl";
|
|
22096
22148
|
import { ArrowUp } from "lucide-react";
|
|
22097
22149
|
import { jsx as jsx244, jsxs as jsxs139 } from "react/jsx-runtime";
|
|
@@ -22105,7 +22157,7 @@ function AssistantComposer({
|
|
|
22105
22157
|
leading
|
|
22106
22158
|
}) {
|
|
22107
22159
|
const t = useTranslations98();
|
|
22108
|
-
const [internal, setInternal] =
|
|
22160
|
+
const [internal, setInternal] = useState89("");
|
|
22109
22161
|
const value = controlled ?? internal;
|
|
22110
22162
|
const setValue = onValueChange ?? setInternal;
|
|
22111
22163
|
const canSend = value.trim().length > 0 && !disabled;
|
|
@@ -22155,7 +22207,7 @@ function AssistantComposer({
|
|
|
22155
22207
|
__name(AssistantComposer, "AssistantComposer");
|
|
22156
22208
|
|
|
22157
22209
|
// src/features/assistant/components/parts/AssistantThread.tsx
|
|
22158
|
-
import { useEffect as
|
|
22210
|
+
import { useEffect as useEffect71, useRef as useRef39 } from "react";
|
|
22159
22211
|
|
|
22160
22212
|
// src/features/assistant-message/components/MessageItem.tsx
|
|
22161
22213
|
import { useTranslations as useTranslations105 } from "next-intl";
|
|
@@ -22165,10 +22217,10 @@ import ReactMarkdown3, { defaultUrlTransform } from "react-markdown";
|
|
|
22165
22217
|
import remarkGfm3 from "remark-gfm";
|
|
22166
22218
|
|
|
22167
22219
|
// src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
|
|
22168
|
-
import { useEffect as
|
|
22220
|
+
import { useEffect as useEffect70, useMemo as useMemo44, useState as useState92 } from "react";
|
|
22169
22221
|
|
|
22170
22222
|
// src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
|
|
22171
|
-
import { useMemo as useMemo43, useState as
|
|
22223
|
+
import { useMemo as useMemo43, useState as useState91 } from "react";
|
|
22172
22224
|
import { useTranslations as useTranslations104 } from "next-intl";
|
|
22173
22225
|
import { ChevronDown as ChevronDown4, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
22174
22226
|
|
|
@@ -22227,7 +22279,7 @@ function ReferencesTab({ references }) {
|
|
|
22227
22279
|
__name(ReferencesTab, "ReferencesTab");
|
|
22228
22280
|
|
|
22229
22281
|
// src/features/assistant-message/components/parts/tabs/CitationsTab.tsx
|
|
22230
|
-
import { Fragment as Fragment49, useState as
|
|
22282
|
+
import { Fragment as Fragment49, useState as useState90 } from "react";
|
|
22231
22283
|
import { useTranslations as useTranslations101 } from "next-intl";
|
|
22232
22284
|
import { ChevronDown as ChevronDown3, HelpCircle } from "lucide-react";
|
|
22233
22285
|
import ReactMarkdown2 from "react-markdown";
|
|
@@ -22268,7 +22320,7 @@ function CitationsTab({ citations, sources }) {
|
|
|
22268
22320
|
const t = useTranslations101();
|
|
22269
22321
|
const entityLabel = useEntityLabel();
|
|
22270
22322
|
const isMobile = useIsMobile();
|
|
22271
|
-
const [expanded, setExpanded] =
|
|
22323
|
+
const [expanded, setExpanded] = useState90(/* @__PURE__ */ new Set());
|
|
22272
22324
|
if (citations.length === 0) return null;
|
|
22273
22325
|
const sorted = [...citations].sort((a, b) => (b.relevance ?? 0) - (a.relevance ?? 0));
|
|
22274
22326
|
const toggle = /* @__PURE__ */ __name((id) => {
|
|
@@ -22535,8 +22587,8 @@ function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sou
|
|
|
22535
22587
|
if (usersCount > 0) visibleTabs.push("users");
|
|
22536
22588
|
const autoOpen = isLatestAssistant && suggestionsCount > 0;
|
|
22537
22589
|
const initialTab = autoOpen ? "suggested" : visibleTabs[0];
|
|
22538
|
-
const [open, setOpen] =
|
|
22539
|
-
const [active, setActive] =
|
|
22590
|
+
const [open, setOpen] = useState91(autoOpen);
|
|
22591
|
+
const [active, setActive] = useState91(initialTab);
|
|
22540
22592
|
if (total === 0) return null;
|
|
22541
22593
|
const panelId = `sources-panel-${message.id}`;
|
|
22542
22594
|
return /* @__PURE__ */ jsxs145("div", { className: "mt-2 w-full min-w-0", children: [
|
|
@@ -22618,8 +22670,8 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
|
|
|
22618
22670
|
}
|
|
22619
22671
|
return parts.sort().join("|");
|
|
22620
22672
|
}, [groups]);
|
|
22621
|
-
const [resolved, setResolved] =
|
|
22622
|
-
|
|
22673
|
+
const [resolved, setResolved] = useState92([]);
|
|
22674
|
+
useEffect70(() => {
|
|
22623
22675
|
if (groups.size === 0) {
|
|
22624
22676
|
setResolved((current) => current.length === 0 ? current : []);
|
|
22625
22677
|
return;
|
|
@@ -22810,7 +22862,7 @@ function AssistantThread({
|
|
|
22810
22862
|
renderMention
|
|
22811
22863
|
}) {
|
|
22812
22864
|
const lastMessageRef = useRef39(null);
|
|
22813
|
-
|
|
22865
|
+
useEffect71(() => {
|
|
22814
22866
|
lastMessageRef.current?.scrollIntoView({ block: "start", behavior: "smooth" });
|
|
22815
22867
|
}, [messages.length, sending]);
|
|
22816
22868
|
return /* @__PURE__ */ jsxs148("div", { className: "flex-1 min-w-0 overflow-x-hidden overflow-y-auto px-6 py-5", children: [
|
|
@@ -22833,7 +22885,7 @@ __name(AssistantThread, "AssistantThread");
|
|
|
22833
22885
|
|
|
22834
22886
|
// src/features/handbook/hooks/useHandbookAsk.ts
|
|
22835
22887
|
import { useTranslations as useTranslations107 } from "next-intl";
|
|
22836
|
-
import { useCallback as useCallback43, useEffect as
|
|
22888
|
+
import { useCallback as useCallback43, useEffect as useEffect72, useState as useState93 } from "react";
|
|
22837
22889
|
import { v4 as v412 } from "uuid";
|
|
22838
22890
|
function withSources(messages, label) {
|
|
22839
22891
|
return messages.map((message) => withSourcesInContent(message, label));
|
|
@@ -22861,12 +22913,12 @@ function useHandbookAsk(params) {
|
|
|
22861
22913
|
const generateUrl = usePageUrlGenerator();
|
|
22862
22914
|
const shouldSyncUrl = params?.syncUrl ?? true;
|
|
22863
22915
|
const handbookThreadId = params?.handbookThreadId;
|
|
22864
|
-
const [threads, setThreads] =
|
|
22865
|
-
const [thread, setThread] =
|
|
22866
|
-
const [messages, setMessages] =
|
|
22867
|
-
const [sending, setSending] =
|
|
22916
|
+
const [threads, setThreads] = useState93([]);
|
|
22917
|
+
const [thread, setThread] = useState93(void 0);
|
|
22918
|
+
const [messages, setMessages] = useState93([]);
|
|
22919
|
+
const [sending, setSending] = useState93(false);
|
|
22868
22920
|
const sourcesLabel = t("handbook.chat.sources");
|
|
22869
|
-
|
|
22921
|
+
useEffect72(() => {
|
|
22870
22922
|
let cancelled = false;
|
|
22871
22923
|
(async () => {
|
|
22872
22924
|
const loaded = await HandbookThreadService.findMany();
|
|
@@ -22876,7 +22928,7 @@ function useHandbookAsk(params) {
|
|
|
22876
22928
|
cancelled = true;
|
|
22877
22929
|
};
|
|
22878
22930
|
}, []);
|
|
22879
|
-
|
|
22931
|
+
useEffect72(() => {
|
|
22880
22932
|
if (!handbookThreadId) return;
|
|
22881
22933
|
let cancelled = false;
|
|
22882
22934
|
(async () => {
|
|
@@ -22969,7 +23021,7 @@ function HandbookAskSheet({ handbookPageId } = {}) {
|
|
|
22969
23021
|
const t = useTranslations108();
|
|
22970
23022
|
const generateUrl = usePageUrlGenerator();
|
|
22971
23023
|
const { threads, thread, messages, sending, ask, selectThread } = useHandbookAsk({ syncUrl: false });
|
|
22972
|
-
const [scoped, setScoped] =
|
|
23024
|
+
const [scoped, setScoped] = useState94(false);
|
|
22973
23025
|
const chatUrl = `${generateUrl({ page: Modules.HandbookPage })}/chat`;
|
|
22974
23026
|
const showThread = !!thread || sending || messages.length > 0;
|
|
22975
23027
|
const send = useCallback44(
|
|
@@ -23030,11 +23082,11 @@ __name(HandbookAskSheet, "HandbookAskSheet");
|
|
|
23030
23082
|
|
|
23031
23083
|
// src/features/handbook/components/forms/HandbookSyncButton.tsx
|
|
23032
23084
|
import { useTranslations as useTranslations109 } from "next-intl";
|
|
23033
|
-
import { useState as
|
|
23085
|
+
import { useState as useState95 } from "react";
|
|
23034
23086
|
import { jsx as jsx258 } from "react/jsx-runtime";
|
|
23035
23087
|
function HandbookSyncButton({ refresh }) {
|
|
23036
23088
|
const t = useTranslations109();
|
|
23037
|
-
const [isSyncing, setIsSyncing] =
|
|
23089
|
+
const [isSyncing, setIsSyncing] = useState95(false);
|
|
23038
23090
|
const onSync = /* @__PURE__ */ __name(async () => {
|
|
23039
23091
|
setIsSyncing(true);
|
|
23040
23092
|
try {
|
|
@@ -23151,11 +23203,11 @@ __name(splitByNesting, "splitByNesting");
|
|
|
23151
23203
|
import { Fragment as Fragment51, jsx as jsx261, jsxs as jsxs152 } from "react/jsx-runtime";
|
|
23152
23204
|
function HandbookContents() {
|
|
23153
23205
|
const t = useTranslations111();
|
|
23154
|
-
const [pages, setPages] =
|
|
23155
|
-
const [sections, setSections] =
|
|
23156
|
-
const [isLoading, setIsLoading] =
|
|
23157
|
-
const [reloadToken, setReloadToken] =
|
|
23158
|
-
|
|
23206
|
+
const [pages, setPages] = useState96([]);
|
|
23207
|
+
const [sections, setSections] = useState96([]);
|
|
23208
|
+
const [isLoading, setIsLoading] = useState96(true);
|
|
23209
|
+
const [reloadToken, setReloadToken] = useState96(0);
|
|
23210
|
+
useEffect73(() => {
|
|
23159
23211
|
let cancelled = false;
|
|
23160
23212
|
const load = /* @__PURE__ */ __name(async () => {
|
|
23161
23213
|
setIsLoading(true);
|
|
@@ -23245,7 +23297,7 @@ __name(HandbookAdminContainer, "HandbookAdminContainer");
|
|
|
23245
23297
|
|
|
23246
23298
|
// src/features/handbook/components/containers/HandbookPageContainer.tsx
|
|
23247
23299
|
import { useTranslations as useTranslations115 } from "next-intl";
|
|
23248
|
-
import { useEffect as
|
|
23300
|
+
import { useEffect as useEffect76, useMemo as useMemo51, useState as useState98 } from "react";
|
|
23249
23301
|
|
|
23250
23302
|
// src/features/handbook/components/details/HandbookPageDetails.tsx
|
|
23251
23303
|
import { jsx as jsx263 } from "react/jsx-runtime";
|
|
@@ -23301,14 +23353,14 @@ __name(HandbookPageNeighbours, "HandbookPageNeighbours");
|
|
|
23301
23353
|
// src/features/handbook/components/details/HandbookPageToc.tsx
|
|
23302
23354
|
import { List } from "lucide-react";
|
|
23303
23355
|
import { useTranslations as useTranslations113 } from "next-intl";
|
|
23304
|
-
import { useCallback as useCallback46, useEffect as
|
|
23356
|
+
import { useCallback as useCallback46, useEffect as useEffect74, useState as useState97 } from "react";
|
|
23305
23357
|
import { jsx as jsx265, jsxs as jsxs154 } from "react/jsx-runtime";
|
|
23306
23358
|
function HandbookPageToc({ containerId }) {
|
|
23307
23359
|
const t = useTranslations113();
|
|
23308
|
-
const [activeId, setActiveId] =
|
|
23309
|
-
const [headings, setHeadings] =
|
|
23310
|
-
const [headingsWithIds, setHeadingsWithIds] =
|
|
23311
|
-
|
|
23360
|
+
const [activeId, setActiveId] = useState97(null);
|
|
23361
|
+
const [headings, setHeadings] = useState97([]);
|
|
23362
|
+
const [headingsWithIds, setHeadingsWithIds] = useState97(/* @__PURE__ */ new Map());
|
|
23363
|
+
useEffect74(() => {
|
|
23312
23364
|
const contentPanel = document.getElementById(containerId);
|
|
23313
23365
|
if (!contentPanel) return;
|
|
23314
23366
|
const collect = /* @__PURE__ */ __name(() => {
|
|
@@ -23332,7 +23384,7 @@ function HandbookPageToc({ containerId }) {
|
|
|
23332
23384
|
observer.observe(contentPanel, { childList: true, subtree: true });
|
|
23333
23385
|
return () => observer.disconnect();
|
|
23334
23386
|
}, [containerId]);
|
|
23335
|
-
|
|
23387
|
+
useEffect74(() => {
|
|
23336
23388
|
if (headingsWithIds.size === 0) return;
|
|
23337
23389
|
const observer = new IntersectionObserver(
|
|
23338
23390
|
(entries) => {
|
|
@@ -23398,7 +23450,7 @@ __name(HandbookPageToc, "HandbookPageToc");
|
|
|
23398
23450
|
// src/features/handbook/components/parts/HandbookPageNavigator.tsx
|
|
23399
23451
|
import { BookOpenIcon } from "lucide-react";
|
|
23400
23452
|
import { useTranslations as useTranslations114 } from "next-intl";
|
|
23401
|
-
import { useEffect as
|
|
23453
|
+
import { useEffect as useEffect75, useMemo as useMemo50, useRef as useRef40 } from "react";
|
|
23402
23454
|
import { jsx as jsx266, jsxs as jsxs155 } from "react/jsx-runtime";
|
|
23403
23455
|
function HandbookPageNavigator({ pages, sections, currentId }) {
|
|
23404
23456
|
const t = useTranslations114();
|
|
@@ -23430,7 +23482,7 @@ function HandbookPageNavigator({ pages, sections, currentId }) {
|
|
|
23430
23482
|
return ordered;
|
|
23431
23483
|
}, [pages, sections, t]);
|
|
23432
23484
|
const currentRef = useRef40(null);
|
|
23433
|
-
|
|
23485
|
+
useEffect75(() => {
|
|
23434
23486
|
const link = currentRef.current;
|
|
23435
23487
|
if (!link) return;
|
|
23436
23488
|
const rail = link.closest(".overflow-y-auto");
|
|
@@ -23472,11 +23524,11 @@ import { jsx as jsx267, jsxs as jsxs156 } from "react/jsx-runtime";
|
|
|
23472
23524
|
var CONTENT_CONTAINER_ID = "handbook-page-content";
|
|
23473
23525
|
function HandbookPageContainer({ handbookPageId }) {
|
|
23474
23526
|
const t = useTranslations115();
|
|
23475
|
-
const [handbookPage, setHandbookPage] =
|
|
23476
|
-
const [pages, setPages] =
|
|
23477
|
-
const [sections, setSections] =
|
|
23478
|
-
const [isLoading, setIsLoading] =
|
|
23479
|
-
|
|
23527
|
+
const [handbookPage, setHandbookPage] = useState98(void 0);
|
|
23528
|
+
const [pages, setPages] = useState98([]);
|
|
23529
|
+
const [sections, setSections] = useState98([]);
|
|
23530
|
+
const [isLoading, setIsLoading] = useState98(true);
|
|
23531
|
+
useEffect76(() => {
|
|
23480
23532
|
let cancelled = false;
|
|
23481
23533
|
const load = /* @__PURE__ */ __name(async () => {
|
|
23482
23534
|
setIsLoading(true);
|
|
@@ -23492,7 +23544,7 @@ function HandbookPageContainer({ handbookPageId }) {
|
|
|
23492
23544
|
cancelled = true;
|
|
23493
23545
|
};
|
|
23494
23546
|
}, [handbookPageId]);
|
|
23495
|
-
|
|
23547
|
+
useEffect76(() => {
|
|
23496
23548
|
let cancelled = false;
|
|
23497
23549
|
const loadPages = /* @__PURE__ */ __name(async () => {
|
|
23498
23550
|
const allPages = await HandbookPageService.findMany({ fetchAll: true });
|
|
@@ -23717,14 +23769,14 @@ __name(EntityMentionLinkView, "EntityMentionLinkView");
|
|
|
23717
23769
|
var EntityMentionLink = /* @__PURE__ */ __name((p) => /* @__PURE__ */ jsx270(EntityMentionLinkView, { ...p }), "EntityMentionLink");
|
|
23718
23770
|
|
|
23719
23771
|
// src/features/assistant/components/parts/AssistantEmptyState.tsx
|
|
23720
|
-
import { useState as
|
|
23772
|
+
import { useState as useState99 } from "react";
|
|
23721
23773
|
import { useTranslations as useTranslations118 } from "next-intl";
|
|
23722
23774
|
import { Sparkles as Sparkles4 } from "lucide-react";
|
|
23723
23775
|
import { jsx as jsx271, jsxs as jsxs159 } from "react/jsx-runtime";
|
|
23724
23776
|
var STARTER_KEYS = ["a", "b", "c", "d"];
|
|
23725
23777
|
function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChange, composerLeading }) {
|
|
23726
23778
|
const t = useTranslations118();
|
|
23727
|
-
const [draft, setDraft] =
|
|
23779
|
+
const [draft, setDraft] = useState99("");
|
|
23728
23780
|
return /* @__PURE__ */ jsx271("div", { className: "flex h-full w-full items-center justify-center p-10", children: /* @__PURE__ */ jsxs159("div", { className: "flex w-full max-w-2xl flex-col gap-6", children: [
|
|
23729
23781
|
/* @__PURE__ */ jsxs159("div", { className: "text-center", children: [
|
|
23730
23782
|
/* @__PURE__ */ jsx271("div", { className: "mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-gradient-to-br from-blue-400 to-violet-500 text-white", children: /* @__PURE__ */ jsx271(Sparkles4, { className: "h-5 w-5" }) }),
|
|
@@ -23762,14 +23814,14 @@ function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChang
|
|
|
23762
23814
|
__name(AssistantEmptyState, "AssistantEmptyState");
|
|
23763
23815
|
|
|
23764
23816
|
// src/features/assistant/components/parts/AssistantThreadHeader.tsx
|
|
23765
|
-
import { useState as
|
|
23817
|
+
import { useState as useState100 } from "react";
|
|
23766
23818
|
import { useTranslations as useTranslations119 } from "next-intl";
|
|
23767
23819
|
import { jsx as jsx272, jsxs as jsxs160 } from "react/jsx-runtime";
|
|
23768
23820
|
function AssistantThreadHeader({ assistant, onRename, onDelete, renamePlaceholder, deleteConfirmLabel }) {
|
|
23769
23821
|
const t = useTranslations119();
|
|
23770
|
-
const [renameValue, setRenameValue] =
|
|
23771
|
-
const [renameOpen, setRenameOpen] =
|
|
23772
|
-
const [deleteOpen, setDeleteOpen] =
|
|
23822
|
+
const [renameValue, setRenameValue] = useState100(assistant.title);
|
|
23823
|
+
const [renameOpen, setRenameOpen] = useState100(false);
|
|
23824
|
+
const [deleteOpen, setDeleteOpen] = useState100(false);
|
|
23773
23825
|
const handleRename = /* @__PURE__ */ __name(async () => {
|
|
23774
23826
|
const trimmed = renameValue.trim() || assistant.title;
|
|
23775
23827
|
await onRename(trimmed);
|
|
@@ -23921,7 +23973,7 @@ import { useTranslations as useTranslations122 } from "next-intl";
|
|
|
23921
23973
|
// src/features/assistant/components/parts/AssistantBlockNoteComposer.tsx
|
|
23922
23974
|
import { ArrowUp as ArrowUp2 } from "lucide-react";
|
|
23923
23975
|
import { useTranslations as useTranslations121 } from "next-intl";
|
|
23924
|
-
import { useCallback as useCallback47, useId as useId5, useState as
|
|
23976
|
+
import { useCallback as useCallback47, useId as useId5, useState as useState101 } from "react";
|
|
23925
23977
|
import { jsx as jsx274, jsxs as jsxs162 } from "react/jsx-runtime";
|
|
23926
23978
|
function flattenBlocks(blocks) {
|
|
23927
23979
|
const lines = [];
|
|
@@ -23959,9 +24011,9 @@ function AssistantBlockNoteComposer({
|
|
|
23959
24011
|
}) {
|
|
23960
24012
|
const t = useTranslations121();
|
|
23961
24013
|
const editorId = useId5().replace(/[^a-zA-Z0-9]/g, "");
|
|
23962
|
-
const [blocks, setBlocks] =
|
|
23963
|
-
const [isEmpty, setIsEmpty] =
|
|
23964
|
-
const [resetKey, setResetKey] =
|
|
24014
|
+
const [blocks, setBlocks] = useState101([]);
|
|
24015
|
+
const [isEmpty, setIsEmpty] = useState101(true);
|
|
24016
|
+
const [resetKey, setResetKey] = useState101(0);
|
|
23965
24017
|
const canSend = !isEmpty && !disabled;
|
|
23966
24018
|
const submit = useCallback47(async () => {
|
|
23967
24019
|
if (isEmpty || disabled) return;
|
|
@@ -24099,7 +24151,7 @@ __name(AssistantPageContainer, "AssistantPageContainer");
|
|
|
24099
24151
|
// src/features/assistant-action/components/ApprovalActionCard.tsx
|
|
24100
24152
|
import { ShieldAlert as ShieldAlert2 } from "lucide-react";
|
|
24101
24153
|
import { useTranslations as useTranslations123 } from "next-intl";
|
|
24102
|
-
import { Fragment as Fragment57, useEffect as
|
|
24154
|
+
import { Fragment as Fragment57, useEffect as useEffect77, useMemo as useMemo54, useState as useState102 } from "react";
|
|
24103
24155
|
import { jsx as jsx276, jsxs as jsxs164 } from "react/jsx-runtime";
|
|
24104
24156
|
var STATUS_VARIANT = {
|
|
24105
24157
|
pending: "softBlue",
|
|
@@ -24254,14 +24306,14 @@ function parseLegacyProposal(toolArgs) {
|
|
|
24254
24306
|
__name(parseLegacyProposal, "parseLegacyProposal");
|
|
24255
24307
|
function ApprovalActionCard({ actionId, summary, onResolved, hiddenRelationshipKeys }) {
|
|
24256
24308
|
const t = useTranslations123();
|
|
24257
|
-
const [status, setStatus] =
|
|
24258
|
-
const [actionSummary, setActionSummary] =
|
|
24259
|
-
const [toolName, setToolName] =
|
|
24260
|
-
const [toolArgs, setToolArgs] =
|
|
24261
|
-
const [actionProposal, setActionProposal] =
|
|
24262
|
-
const [busy, setBusy] =
|
|
24263
|
-
const [failed, setFailed] =
|
|
24264
|
-
|
|
24309
|
+
const [status, setStatus] = useState102(void 0);
|
|
24310
|
+
const [actionSummary, setActionSummary] = useState102(void 0);
|
|
24311
|
+
const [toolName, setToolName] = useState102(void 0);
|
|
24312
|
+
const [toolArgs, setToolArgs] = useState102(void 0);
|
|
24313
|
+
const [actionProposal, setActionProposal] = useState102(void 0);
|
|
24314
|
+
const [busy, setBusy] = useState102(false);
|
|
24315
|
+
const [failed, setFailed] = useState102(false);
|
|
24316
|
+
useEffect77(() => {
|
|
24265
24317
|
let cancelled = false;
|
|
24266
24318
|
(async () => {
|
|
24267
24319
|
try {
|
|
@@ -24422,7 +24474,7 @@ var NotificationErrorBoundary = class extends Component {
|
|
|
24422
24474
|
|
|
24423
24475
|
// src/features/notification/components/containers/NotificationsListContainer.tsx
|
|
24424
24476
|
import { useSearchParams as useSearchParams5 } from "next/navigation";
|
|
24425
|
-
import { useState as
|
|
24477
|
+
import { useState as useState103 } from "react";
|
|
24426
24478
|
|
|
24427
24479
|
// src/features/notification/components/filters/NotificationViewSwitcher.tsx
|
|
24428
24480
|
import { useTranslations as useTranslations124 } from "next-intl";
|
|
@@ -24452,7 +24504,7 @@ __name(NotificationViewSwitcher, "NotificationViewSwitcher");
|
|
|
24452
24504
|
|
|
24453
24505
|
// src/features/notification/components/lists/NotificationsList.tsx
|
|
24454
24506
|
import { useTranslations as useTranslations126 } from "next-intl";
|
|
24455
|
-
import { useEffect as
|
|
24507
|
+
import { useEffect as useEffect78, useRef as useRef41 } from "react";
|
|
24456
24508
|
|
|
24457
24509
|
// src/features/notification/hooks/useNotificationTableStructure.tsx
|
|
24458
24510
|
import { ArchiveIcon as ArchiveIcon2 } from "lucide-react";
|
|
@@ -24580,7 +24632,7 @@ function NotificationsList({ archived, headerControl, fullWidth }) {
|
|
|
24580
24632
|
retrieverParams: { isArchived: archived }
|
|
24581
24633
|
});
|
|
24582
24634
|
const markedRef = useRef41(/* @__PURE__ */ new Set());
|
|
24583
|
-
|
|
24635
|
+
useEffect78(() => {
|
|
24584
24636
|
if (!data.isLoaded || !data.data) return;
|
|
24585
24637
|
const unreadIds = data.data.filter((notification) => !notification.isRead && !markedRef.current.has(notification.id)).map((notification) => notification.id);
|
|
24586
24638
|
if (unreadIds.length === 0) return;
|
|
@@ -24620,7 +24672,7 @@ function NotificationsListContainerContent() {
|
|
|
24620
24672
|
const searchParams = useSearchParams5();
|
|
24621
24673
|
const { error } = useNotificationContext();
|
|
24622
24674
|
const tabParam = searchParams.get("tab");
|
|
24623
|
-
const [mode, setMode] =
|
|
24675
|
+
const [mode, setMode] = useState103(tabParam === "archived" ? "archived" : "inbox");
|
|
24624
24676
|
if (error) {
|
|
24625
24677
|
return /* @__PURE__ */ jsx282("div", { className: "flex items-center justify-center p-8 text-center", children: /* @__PURE__ */ jsxs167("div", { className: "text-destructive text-xs/relaxed", children: [
|
|
24626
24678
|
/* @__PURE__ */ jsxs167("p", { children: [
|
|
@@ -24660,7 +24712,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
|
|
|
24660
24712
|
// src/features/notification/components/modals/NotificationModal.tsx
|
|
24661
24713
|
import { BellIcon as BellIcon2, ExternalLinkIcon } from "lucide-react";
|
|
24662
24714
|
import { useTranslations as useTranslations127 } from "next-intl";
|
|
24663
|
-
import { Fragment as Fragment58, useCallback as useCallback48, useEffect as
|
|
24715
|
+
import { Fragment as Fragment58, useCallback as useCallback48, useEffect as useEffect79, useMemo as useMemo56, useRef as useRef42, useState as useState104 } from "react";
|
|
24664
24716
|
import { jsx as jsx283, jsxs as jsxs168 } from "react/jsx-runtime";
|
|
24665
24717
|
function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
24666
24718
|
const _instanceId = useRef42(Math.random().toString(36).substr(2, 9));
|
|
@@ -24682,7 +24734,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
24682
24734
|
} = useSocketContext();
|
|
24683
24735
|
const t = useTranslations127();
|
|
24684
24736
|
const generateUrl = usePageUrlGenerator();
|
|
24685
|
-
const [newNotifications, setNewNotifications] =
|
|
24737
|
+
const [newNotifications, setNewNotifications] = useState104(false);
|
|
24686
24738
|
const preventAutoClose = useRef42(false);
|
|
24687
24739
|
const circuitBreakerRef = useRef42({
|
|
24688
24740
|
count: 0,
|
|
@@ -24711,7 +24763,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
24711
24763
|
unreadIds: unreadNotifications2.map((notif) => notif.id)
|
|
24712
24764
|
};
|
|
24713
24765
|
}, [notifications]);
|
|
24714
|
-
|
|
24766
|
+
useEffect79(() => {
|
|
24715
24767
|
setNewNotifications(unreadCount > 0);
|
|
24716
24768
|
}, [unreadCount]);
|
|
24717
24769
|
const processSocketNotifications = useCallback48(() => {
|
|
@@ -24756,7 +24808,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
24756
24808
|
generateUrl,
|
|
24757
24809
|
checkCircuitBreaker
|
|
24758
24810
|
]);
|
|
24759
|
-
|
|
24811
|
+
useEffect79(() => {
|
|
24760
24812
|
processSocketNotifications();
|
|
24761
24813
|
}, [processSocketNotifications]);
|
|
24762
24814
|
const handleOpenChange = /* @__PURE__ */ __name((newlyRequestedOpenState) => {
|
|
@@ -24869,7 +24921,7 @@ __name(PushNotificationProvider, "PushNotificationProvider");
|
|
|
24869
24921
|
|
|
24870
24922
|
// src/features/referral/components/ReferralCodeCapture.tsx
|
|
24871
24923
|
import { useSearchParams as useSearchParams6 } from "next/navigation";
|
|
24872
|
-
import { useEffect as
|
|
24924
|
+
import { useEffect as useEffect80 } from "react";
|
|
24873
24925
|
|
|
24874
24926
|
// src/features/referral/utils/referral-cookie.ts
|
|
24875
24927
|
function setReferralCode(code) {
|
|
@@ -24894,7 +24946,7 @@ __name(getReferralCode2, "getReferralCode");
|
|
|
24894
24946
|
// src/features/referral/components/ReferralCodeCapture.tsx
|
|
24895
24947
|
function ReferralCodeCapture() {
|
|
24896
24948
|
const searchParams = useSearchParams6();
|
|
24897
|
-
|
|
24949
|
+
useEffect80(() => {
|
|
24898
24950
|
if (!isReferralEnabled()) {
|
|
24899
24951
|
return;
|
|
24900
24952
|
}
|
|
@@ -24913,14 +24965,14 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
|
|
|
24913
24965
|
|
|
24914
24966
|
// src/features/referral/components/ReferralWidget.tsx
|
|
24915
24967
|
import { Copy as Copy2, Loader2 as Loader26, Mail, Users } from "lucide-react";
|
|
24916
|
-
import { useCallback as useCallback49, useRef as useRef43, useState as
|
|
24968
|
+
import { useCallback as useCallback49, useRef as useRef43, useState as useState107 } from "react";
|
|
24917
24969
|
|
|
24918
24970
|
// src/features/referral/hooks/useReferralInvite.ts
|
|
24919
|
-
import { useState as
|
|
24971
|
+
import { useState as useState105 } from "react";
|
|
24920
24972
|
function useReferralInvite() {
|
|
24921
|
-
const [sending, setSending] =
|
|
24922
|
-
const [error, setError] =
|
|
24923
|
-
const [success, setSuccess] =
|
|
24973
|
+
const [sending, setSending] = useState105(false);
|
|
24974
|
+
const [error, setError] = useState105(null);
|
|
24975
|
+
const [success, setSuccess] = useState105(false);
|
|
24924
24976
|
const sendInvite = /* @__PURE__ */ __name(async (email) => {
|
|
24925
24977
|
if (!isReferralEnabled()) {
|
|
24926
24978
|
return;
|
|
@@ -24942,12 +24994,12 @@ function useReferralInvite() {
|
|
|
24942
24994
|
__name(useReferralInvite, "useReferralInvite");
|
|
24943
24995
|
|
|
24944
24996
|
// src/features/referral/hooks/useReferralStats.ts
|
|
24945
|
-
import { useEffect as
|
|
24997
|
+
import { useEffect as useEffect81, useState as useState106 } from "react";
|
|
24946
24998
|
function useReferralStats() {
|
|
24947
|
-
const [stats, setStats] =
|
|
24948
|
-
const [loading, setLoading] =
|
|
24949
|
-
const [error, setError] =
|
|
24950
|
-
|
|
24999
|
+
const [stats, setStats] = useState106(null);
|
|
25000
|
+
const [loading, setLoading] = useState106(true);
|
|
25001
|
+
const [error, setError] = useState106(null);
|
|
25002
|
+
useEffect81(() => {
|
|
24951
25003
|
if (!isReferralEnabled()) {
|
|
24952
25004
|
setLoading(false);
|
|
24953
25005
|
return;
|
|
@@ -25017,8 +25069,8 @@ function ReferralWidget({
|
|
|
25017
25069
|
const t = { ...DEFAULT_TRANSLATIONS, ...translations };
|
|
25018
25070
|
const { stats, loading, error } = useReferralStats();
|
|
25019
25071
|
const { sendInvite, sending } = useReferralInvite();
|
|
25020
|
-
const [email, setEmail] =
|
|
25021
|
-
const [copied, setCopied] =
|
|
25072
|
+
const [email, setEmail] = useState107("");
|
|
25073
|
+
const [copied, setCopied] = useState107(false);
|
|
25022
25074
|
const linkInputRef = useRef43(null);
|
|
25023
25075
|
const config = getReferralConfig();
|
|
25024
25076
|
const baseUrl = config.referralUrlBase || (typeof window !== "undefined" ? window.location.origin : "");
|
|
@@ -25231,13 +25283,13 @@ __name(FormRoles, "FormRoles");
|
|
|
25231
25283
|
|
|
25232
25284
|
// src/features/role/components/forms/RemoveUserFromRole.tsx
|
|
25233
25285
|
import { useTranslations as useTranslations130 } from "next-intl";
|
|
25234
|
-
import { useEffect as
|
|
25286
|
+
import { useEffect as useEffect82, useState as useState108 } from "react";
|
|
25235
25287
|
import { Fragment as Fragment61, jsx as jsx290, jsxs as jsxs173 } from "react/jsx-runtime";
|
|
25236
25288
|
function RemoveUserFromRole({ role, user, refresh }) {
|
|
25237
|
-
const [open, setOpen] =
|
|
25238
|
-
const [canRemove, setCanRemove] =
|
|
25289
|
+
const [open, setOpen] = useState108(false);
|
|
25290
|
+
const [canRemove, setCanRemove] = useState108(false);
|
|
25239
25291
|
const t = useTranslations130();
|
|
25240
|
-
|
|
25292
|
+
useEffect82(() => {
|
|
25241
25293
|
async function checkCompanyAdminDeletability() {
|
|
25242
25294
|
const roleUsers = await UserService.findAllUsersByRole({
|
|
25243
25295
|
roleId: role.id
|
|
@@ -25307,13 +25359,13 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
|
|
|
25307
25359
|
// src/features/role/components/forms/UserRoleAdd.tsx
|
|
25308
25360
|
import { PlusCircle as PlusCircle2 } from "lucide-react";
|
|
25309
25361
|
import { useTranslations as useTranslations131 } from "next-intl";
|
|
25310
|
-
import { useCallback as useCallback50, useEffect as
|
|
25362
|
+
import { useCallback as useCallback50, useEffect as useEffect83, useRef as useRef44, useState as useState109 } from "react";
|
|
25311
25363
|
import { Fragment as Fragment62, jsx as jsx291, jsxs as jsxs174 } from "react/jsx-runtime";
|
|
25312
25364
|
function UserRoleAdd({ user, refresh }) {
|
|
25313
|
-
const [open, setOpen] =
|
|
25365
|
+
const [open, setOpen] = useState109(false);
|
|
25314
25366
|
const inputRef = useRef44(null);
|
|
25315
|
-
const [searchTerm, setSearchTerm] =
|
|
25316
|
-
const [roles, setRoles] =
|
|
25367
|
+
const [searchTerm, setSearchTerm] = useState109("");
|
|
25368
|
+
const [roles, setRoles] = useState109([]);
|
|
25317
25369
|
const t = useTranslations131();
|
|
25318
25370
|
const addUserToRole = /* @__PURE__ */ __name(async (role) => {
|
|
25319
25371
|
await RoleService.addUserToRole({
|
|
@@ -25349,10 +25401,10 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
25349
25401
|
[searchTerm, user]
|
|
25350
25402
|
);
|
|
25351
25403
|
const updateSearchTerm = useDebounce2(searchRoles, 500);
|
|
25352
|
-
|
|
25404
|
+
useEffect83(() => {
|
|
25353
25405
|
if (open) updateSearchTerm(searchTerm);
|
|
25354
25406
|
}, [open, searchTerm]);
|
|
25355
|
-
|
|
25407
|
+
useEffect83(() => {
|
|
25356
25408
|
if (open) searchRoles("");
|
|
25357
25409
|
}, [open]);
|
|
25358
25410
|
return /* @__PURE__ */ jsxs174(Fragment62, { children: [
|
|
@@ -25389,6 +25441,7 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
25389
25441
|
CommandItem,
|
|
25390
25442
|
{
|
|
25391
25443
|
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
25444
|
+
value: role.id,
|
|
25392
25445
|
onSelect: () => addUserToRole(role),
|
|
25393
25446
|
onClick: () => addUserToRole(role),
|
|
25394
25447
|
children: t(`role.roles`, { role: role.id.replaceAll(`-`, ``) })
|
|
@@ -25619,11 +25672,11 @@ function OAuthScopeSelector({
|
|
|
25619
25672
|
__name(OAuthScopeSelector, "OAuthScopeSelector");
|
|
25620
25673
|
|
|
25621
25674
|
// src/features/oauth/components/OAuthClientSecretDisplay.tsx
|
|
25622
|
-
import { useState as
|
|
25675
|
+
import { useState as useState110, useCallback as useCallback53 } from "react";
|
|
25623
25676
|
import { Copy as Copy3, Check, AlertTriangle } from "lucide-react";
|
|
25624
25677
|
import { jsx as jsx296, jsxs as jsxs177 } from "react/jsx-runtime";
|
|
25625
25678
|
function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
|
|
25626
|
-
const [copied, setCopied] =
|
|
25679
|
+
const [copied, setCopied] = useState110(false);
|
|
25627
25680
|
const handleCopy = useCallback53(async () => {
|
|
25628
25681
|
try {
|
|
25629
25682
|
await navigator.clipboard.writeText(secret);
|
|
@@ -25816,7 +25869,7 @@ function OAuthClientList({
|
|
|
25816
25869
|
__name(OAuthClientList, "OAuthClientList");
|
|
25817
25870
|
|
|
25818
25871
|
// src/features/oauth/components/OAuthClientForm.tsx
|
|
25819
|
-
import { useState as
|
|
25872
|
+
import { useState as useState111, useCallback as useCallback54 } from "react";
|
|
25820
25873
|
import { jsx as jsx299, jsxs as jsxs180 } from "react/jsx-runtime";
|
|
25821
25874
|
function OAuthClientForm({
|
|
25822
25875
|
client,
|
|
@@ -25827,14 +25880,14 @@ function OAuthClientForm({
|
|
|
25827
25880
|
defaultScopes = []
|
|
25828
25881
|
}) {
|
|
25829
25882
|
const isEditMode = !!client;
|
|
25830
|
-
const [formState, setFormState] =
|
|
25883
|
+
const [formState, setFormState] = useState111({
|
|
25831
25884
|
name: client?.name || "",
|
|
25832
25885
|
description: client?.description || "",
|
|
25833
25886
|
redirectUris: client?.redirectUris?.length ? client.redirectUris : [""],
|
|
25834
25887
|
allowedScopes: client ? client.allowedScopes || [] : defaultScopes,
|
|
25835
25888
|
isConfidential: client?.isConfidential ?? true
|
|
25836
25889
|
});
|
|
25837
|
-
const [errors, setErrors] =
|
|
25890
|
+
const [errors, setErrors] = useState111({});
|
|
25838
25891
|
const validate = useCallback54(() => {
|
|
25839
25892
|
const newErrors = {};
|
|
25840
25893
|
if (!formState.name.trim()) {
|
|
@@ -25958,7 +26011,7 @@ function OAuthClientForm({
|
|
|
25958
26011
|
__name(OAuthClientForm, "OAuthClientForm");
|
|
25959
26012
|
|
|
25960
26013
|
// src/features/oauth/components/OAuthClientDetail.tsx
|
|
25961
|
-
import { useState as
|
|
26014
|
+
import { useState as useState112, useCallback as useCallback55 } from "react";
|
|
25962
26015
|
import { format as format2 } from "date-fns";
|
|
25963
26016
|
import { Copy as Copy4, Check as Check2, RefreshCw as RefreshCw3, Pencil as Pencil2, Trash2 as Trash25, ExternalLink } from "lucide-react";
|
|
25964
26017
|
import { Fragment as Fragment63, jsx as jsx300, jsxs as jsxs181 } from "react/jsx-runtime";
|
|
@@ -25969,11 +26022,11 @@ function OAuthClientDetail({
|
|
|
25969
26022
|
onDelete,
|
|
25970
26023
|
onRegenerateSecret
|
|
25971
26024
|
}) {
|
|
25972
|
-
const [copiedField, setCopiedField] =
|
|
25973
|
-
const [showDeleteConfirm, setShowDeleteConfirm] =
|
|
25974
|
-
const [showRegenerateConfirm, setShowRegenerateConfirm] =
|
|
25975
|
-
const [isDeleting, setIsDeleting] =
|
|
25976
|
-
const [isRegenerating, setIsRegenerating] =
|
|
26025
|
+
const [copiedField, setCopiedField] = useState112(null);
|
|
26026
|
+
const [showDeleteConfirm, setShowDeleteConfirm] = useState112(false);
|
|
26027
|
+
const [showRegenerateConfirm, setShowRegenerateConfirm] = useState112(false);
|
|
26028
|
+
const [isDeleting, setIsDeleting] = useState112(false);
|
|
26029
|
+
const [isRegenerating, setIsRegenerating] = useState112(false);
|
|
25977
26030
|
const copyToClipboard2 = useCallback55(async (text, field) => {
|
|
25978
26031
|
try {
|
|
25979
26032
|
await navigator.clipboard.writeText(text);
|
|
@@ -26284,7 +26337,7 @@ __name(OAuthConsentScreen, "OAuthConsentScreen");
|
|
|
26284
26337
|
import { zodResolver as zodResolver11 } from "@hookform/resolvers/zod";
|
|
26285
26338
|
import { CheckCircle, Mail as Mail2 } from "lucide-react";
|
|
26286
26339
|
import { useTranslations as useTranslations139 } from "next-intl";
|
|
26287
|
-
import { useState as
|
|
26340
|
+
import { useState as useState113 } from "react";
|
|
26288
26341
|
import { useForm as useForm11 } from "react-hook-form";
|
|
26289
26342
|
import { v4 as v413 } from "uuid";
|
|
26290
26343
|
import { z as z11 } from "zod";
|
|
@@ -26385,8 +26438,8 @@ __name(WaitlistQuestionnaireRenderer, "WaitlistQuestionnaireRenderer");
|
|
|
26385
26438
|
import { Fragment as Fragment65, jsx as jsx307, jsxs as jsxs188 } from "react/jsx-runtime";
|
|
26386
26439
|
function WaitlistForm({ onSuccess }) {
|
|
26387
26440
|
const t = useTranslations139();
|
|
26388
|
-
const [isSubmitting, setIsSubmitting] =
|
|
26389
|
-
const [isSuccess, setIsSuccess] =
|
|
26441
|
+
const [isSubmitting, setIsSubmitting] = useState113(false);
|
|
26442
|
+
const [isSuccess, setIsSuccess] = useState113(false);
|
|
26390
26443
|
const config = getWaitlistConfig();
|
|
26391
26444
|
const questionnaireFields = config.questionnaire ?? [];
|
|
26392
26445
|
const questionnaireSchema = questionnaireFields.reduce(
|
|
@@ -26565,13 +26618,13 @@ __name(WaitlistSuccessState, "WaitlistSuccessState");
|
|
|
26565
26618
|
// src/features/waitlist/components/sections/WaitlistConfirmation.tsx
|
|
26566
26619
|
import { CheckCircle as CheckCircle4, Loader2 as Loader28, XCircle as XCircle2 } from "lucide-react";
|
|
26567
26620
|
import { useTranslations as useTranslations141 } from "next-intl";
|
|
26568
|
-
import { useEffect as
|
|
26621
|
+
import { useEffect as useEffect84, useState as useState114 } from "react";
|
|
26569
26622
|
import { jsx as jsx310, jsxs as jsxs191 } from "react/jsx-runtime";
|
|
26570
26623
|
function WaitlistConfirmation({ code }) {
|
|
26571
26624
|
const t = useTranslations141();
|
|
26572
|
-
const [state, setState] =
|
|
26573
|
-
const [errorMessage, setErrorMessage] =
|
|
26574
|
-
|
|
26625
|
+
const [state, setState] = useState114("loading");
|
|
26626
|
+
const [errorMessage, setErrorMessage] = useState114("");
|
|
26627
|
+
useEffect84(() => {
|
|
26575
26628
|
async function confirmEmail() {
|
|
26576
26629
|
try {
|
|
26577
26630
|
await WaitlistService.confirm(code);
|
|
@@ -26610,11 +26663,11 @@ __name(WaitlistConfirmation, "WaitlistConfirmation");
|
|
|
26610
26663
|
// src/features/waitlist/components/lists/WaitlistList.tsx
|
|
26611
26664
|
import { RefreshCw as RefreshCw4 } from "lucide-react";
|
|
26612
26665
|
import { useTranslations as useTranslations142 } from "next-intl";
|
|
26613
|
-
import { useMemo as useMemo58, useState as
|
|
26666
|
+
import { useMemo as useMemo58, useState as useState115 } from "react";
|
|
26614
26667
|
import { jsx as jsx311, jsxs as jsxs192 } from "react/jsx-runtime";
|
|
26615
26668
|
function WaitlistList({ fullWidth } = {}) {
|
|
26616
26669
|
const t = useTranslations142();
|
|
26617
|
-
const [statusFilter, setStatusFilter] =
|
|
26670
|
+
const [statusFilter, setStatusFilter] = useState115("all");
|
|
26618
26671
|
const data = useDataListRetriever({
|
|
26619
26672
|
retriever: /* @__PURE__ */ __name((params) => WaitlistService.findMany(params), "retriever"),
|
|
26620
26673
|
retrieverParams: {},
|
|
@@ -26683,7 +26736,7 @@ __name(WaitlistList, "WaitlistList");
|
|
|
26683
26736
|
// src/features/rbac/components/RbacContainer.tsx
|
|
26684
26737
|
import { Loader2Icon as Loader2Icon4 } from "lucide-react";
|
|
26685
26738
|
import { useTranslations as useTranslations144 } from "next-intl";
|
|
26686
|
-
import { memo as memo2, useCallback as useCallback57, useEffect as
|
|
26739
|
+
import { memo as memo2, useCallback as useCallback57, useEffect as useEffect86, useMemo as useMemo59, useRef as useRef45, useState as useState117 } from "react";
|
|
26687
26740
|
|
|
26688
26741
|
// src/features/rbac/components/RbacPermissionCell.tsx
|
|
26689
26742
|
import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon12 } from "lucide-react";
|
|
@@ -26764,7 +26817,7 @@ __name(RbacPermissionCell, "RbacPermissionCell");
|
|
|
26764
26817
|
import { Popover as PopoverPrimitive2 } from "@base-ui/react/popover";
|
|
26765
26818
|
import { CheckIcon as CheckIcon10, MinusIcon as MinusIcon3, XIcon as XIcon13 } from "lucide-react";
|
|
26766
26819
|
import { useTranslations as useTranslations143 } from "next-intl";
|
|
26767
|
-
import { useCallback as useCallback56, useEffect as
|
|
26820
|
+
import { useCallback as useCallback56, useEffect as useEffect85, useState as useState116 } from "react";
|
|
26768
26821
|
import { Fragment as Fragment66, jsx as jsx313, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
26769
26822
|
function RbacPermissionPicker({
|
|
26770
26823
|
open,
|
|
@@ -26777,8 +26830,8 @@ function RbacPermissionPicker({
|
|
|
26777
26830
|
onClose
|
|
26778
26831
|
}) {
|
|
26779
26832
|
const t = useTranslations143();
|
|
26780
|
-
const [customSegment, setCustomSegment] =
|
|
26781
|
-
|
|
26833
|
+
const [customSegment, setCustomSegment] = useState116("");
|
|
26834
|
+
useEffect85(() => {
|
|
26782
26835
|
if (!open) setCustomSegment("");
|
|
26783
26836
|
}, [open]);
|
|
26784
26837
|
const currentSegments = typeof value === "string" ? value.split("|").filter(Boolean) : [];
|
|
@@ -27026,8 +27079,8 @@ var ModuleEditor = memo2(/* @__PURE__ */ __name(function ModuleEditor2({
|
|
|
27026
27079
|
function RbacContainer() {
|
|
27027
27080
|
const t = useTranslations144();
|
|
27028
27081
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
27029
|
-
const [selectedModuleId, setSelectedModuleId] =
|
|
27030
|
-
const [activePicker, setActivePicker] =
|
|
27082
|
+
const [selectedModuleId, setSelectedModuleId] = useState117(null);
|
|
27083
|
+
const [activePicker, setActivePicker] = useState117(null);
|
|
27031
27084
|
const openPicker = useCallback57((picker) => {
|
|
27032
27085
|
setActivePicker(picker);
|
|
27033
27086
|
}, []);
|
|
@@ -27055,7 +27108,7 @@ function RbacContainer() {
|
|
|
27055
27108
|
}
|
|
27056
27109
|
return Array.from(set).sort();
|
|
27057
27110
|
}, [matrix, roleNames]);
|
|
27058
|
-
|
|
27111
|
+
useEffect86(() => {
|
|
27059
27112
|
if (!selectedModuleId && sortedModuleIds.length > 0) {
|
|
27060
27113
|
setSelectedModuleId(sortedModuleIds[0]);
|
|
27061
27114
|
}
|
|
@@ -27138,7 +27191,7 @@ __name(RbacContainer, "RbacContainer");
|
|
|
27138
27191
|
// src/features/rbac/components/RbacByRoleContainer.tsx
|
|
27139
27192
|
import { Loader2Icon as Loader2Icon5 } from "lucide-react";
|
|
27140
27193
|
import { useTranslations as useTranslations145 } from "next-intl";
|
|
27141
|
-
import { Fragment as Fragment67, memo as memo3, useCallback as useCallback58, useEffect as
|
|
27194
|
+
import { Fragment as Fragment67, memo as memo3, useCallback as useCallback58, useEffect as useEffect87, useMemo as useMemo60, useRef as useRef46, useState as useState118 } from "react";
|
|
27142
27195
|
import { jsx as jsx315, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
27143
27196
|
function findToken2(tokens, action) {
|
|
27144
27197
|
if (!tokens) return void 0;
|
|
@@ -27176,8 +27229,8 @@ var ACTION_LABELS2 = {
|
|
|
27176
27229
|
function RbacByRoleContainer() {
|
|
27177
27230
|
const t = useTranslations145();
|
|
27178
27231
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
27179
|
-
const [selectedRoleId, setSelectedRoleId] =
|
|
27180
|
-
const [activePicker, setActivePicker] =
|
|
27232
|
+
const [selectedRoleId, setSelectedRoleId] = useState118(null);
|
|
27233
|
+
const [activePicker, setActivePicker] = useState118(null);
|
|
27181
27234
|
const openPicker = useCallback58((picker) => {
|
|
27182
27235
|
setActivePicker(picker);
|
|
27183
27236
|
}, []);
|
|
@@ -27196,7 +27249,7 @@ function RbacByRoleContainer() {
|
|
|
27196
27249
|
if (!matrix) return [];
|
|
27197
27250
|
return Object.keys(matrix).sort((a, b) => (moduleNames?.[a] ?? a).localeCompare(moduleNames?.[b] ?? b));
|
|
27198
27251
|
}, [matrix, moduleNames]);
|
|
27199
|
-
|
|
27252
|
+
useEffect87(() => {
|
|
27200
27253
|
if (!selectedRoleId && sortedRoleIds.length > 0) {
|
|
27201
27254
|
setSelectedRoleId(sortedRoleIds[0]);
|
|
27202
27255
|
}
|
|
@@ -27446,6 +27499,7 @@ export {
|
|
|
27446
27499
|
CommandSeparator,
|
|
27447
27500
|
CommandItem,
|
|
27448
27501
|
CommandShortcut,
|
|
27502
|
+
commandFilterByKeywords,
|
|
27449
27503
|
ConfirmDialog,
|
|
27450
27504
|
ContextMenu,
|
|
27451
27505
|
ContextMenuPortal,
|
|
@@ -27917,4 +27971,4 @@ export {
|
|
|
27917
27971
|
useOAuthClients,
|
|
27918
27972
|
useOAuthClient
|
|
27919
27973
|
};
|
|
27920
|
-
//# sourceMappingURL=chunk-
|
|
27974
|
+
//# sourceMappingURL=chunk-DJRTJBSZ.mjs.map
|