@carlonicora/nextjs-jsonapi 1.29.3 → 1.29.5
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-CJWHJRG3.js → BlockNoteEditor-6U5KIP4Q.js} +6 -6
- package/dist/{BlockNoteEditor-CJWHJRG3.js.map → BlockNoteEditor-6U5KIP4Q.js.map} +1 -1
- package/dist/{BlockNoteEditor-ZET7ANBC.mjs → BlockNoteEditor-C25QYFYD.mjs} +2 -2
- package/dist/billing/index.js +291 -291
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-6HQ6CPVL.js → chunk-CYZZ3E33.js} +197 -172
- package/dist/chunk-CYZZ3E33.js.map +1 -0
- package/dist/{chunk-3HGZMKT4.mjs → chunk-QFN6RG6A.mjs} +82 -57
- package/dist/chunk-QFN6RG6A.mjs.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/package.json +1 -1
- package/src/features/notification/contexts/NotificationContext.tsx +27 -1
- package/src/hooks/useDataListRetriever.ts +12 -0
- package/dist/chunk-3HGZMKT4.mjs.map +0 -1
- package/dist/chunk-6HQ6CPVL.js.map +0 -1
- /package/dist/{BlockNoteEditor-ZET7ANBC.mjs.map → BlockNoteEditor-C25QYFYD.mjs.map} +0 -0
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
|
|
14
15
|
var _chunkEW6QPMN3js = require('./chunk-EW6QPMN3.js');
|
|
15
16
|
|
|
16
17
|
|
|
@@ -180,6 +181,7 @@ function useDataListRetriever(params) {
|
|
|
180
181
|
const requestIdRef = _react.useRef.call(void 0, 0);
|
|
181
182
|
const abortControllerRef = _react.useRef.call(void 0, null);
|
|
182
183
|
const isFetchingRef = _react.useRef.call(void 0, false);
|
|
184
|
+
const isPaginatingRef = _react.useRef.call(void 0, false);
|
|
183
185
|
const resolvedType = params.module;
|
|
184
186
|
const resolvedService = _chunkUYBCHXXLjs.ClientAbstractService;
|
|
185
187
|
const parsePageParams = _react.useCallback.call(void 0, (url) => {
|
|
@@ -235,13 +237,19 @@ function useDataListRetriever(params) {
|
|
|
235
237
|
const fetchData = _react.useCallback.call(void 0,
|
|
236
238
|
async (fetchParams) => {
|
|
237
239
|
if (ready === false) return;
|
|
238
|
-
if (
|
|
240
|
+
if ((_optionalChain([fetchParams, 'optionalAccess', _2 => _2.callNext]) || _optionalChain([fetchParams, 'optionalAccess', _3 => _3.callPrevious])) && isPaginatingRef.current) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
if (isFetchingRef.current && !_optionalChain([fetchParams, 'optionalAccess', _4 => _4.callNext]) && !_optionalChain([fetchParams, 'optionalAccess', _5 => _5.callPrevious])) return;
|
|
244
|
+
if (_optionalChain([fetchParams, 'optionalAccess', _6 => _6.callNext]) || _optionalChain([fetchParams, 'optionalAccess', _7 => _7.callPrevious])) {
|
|
245
|
+
isPaginatingRef.current = true;
|
|
246
|
+
}
|
|
239
247
|
const thisRequestId = ++requestIdRef.current;
|
|
240
248
|
isFetchingRef.current = true;
|
|
241
|
-
if (stableParams.requiresSearch === true && _optionalChain([fetchParams, 'optionalAccess',
|
|
249
|
+
if (stableParams.requiresSearch === true && _optionalChain([fetchParams, 'optionalAccess', _8 => _8.isRefine]) !== true && _optionalChain([fetchParams, 'optionalAccess', _9 => _9.isRefresh]) !== true) {
|
|
242
250
|
return;
|
|
243
251
|
}
|
|
244
|
-
if (!nextPage && !previousPage && isLoaded && _optionalChain([fetchParams, 'optionalAccess',
|
|
252
|
+
if (!nextPage && !previousPage && isLoaded && _optionalChain([fetchParams, 'optionalAccess', _10 => _10.callNext]) !== true && _optionalChain([fetchParams, 'optionalAccess', _11 => _11.callPrevious]) !== true && params.search === searchTermRef.current) {
|
|
245
253
|
return;
|
|
246
254
|
}
|
|
247
255
|
const currentSearchTerm = searchTermRef.current;
|
|
@@ -251,7 +259,7 @@ function useDataListRetriever(params) {
|
|
|
251
259
|
const nextRef = { next: void 0 };
|
|
252
260
|
const previousRef = { previous: void 0 };
|
|
253
261
|
const selfRef = { self: void 0 };
|
|
254
|
-
if (nextPage && _optionalChain([fetchParams, 'optionalAccess',
|
|
262
|
+
if (nextPage && _optionalChain([fetchParams, 'optionalAccess', _12 => _12.callNext]) && _optionalChain([fetchParams, 'optionalAccess', _13 => _13.isRefine]) !== true) {
|
|
255
263
|
const ServiceClass = stableParams.service;
|
|
256
264
|
response = await ServiceClass.next({
|
|
257
265
|
type: stableParams.type,
|
|
@@ -260,7 +268,7 @@ function useDataListRetriever(params) {
|
|
|
260
268
|
previous: previousRef,
|
|
261
269
|
self: selfRef
|
|
262
270
|
});
|
|
263
|
-
} else if (previousPage && _optionalChain([fetchParams, 'optionalAccess',
|
|
271
|
+
} else if (previousPage && _optionalChain([fetchParams, 'optionalAccess', _14 => _14.callPrevious]) && _optionalChain([fetchParams, 'optionalAccess', _15 => _15.isRefine]) !== true) {
|
|
264
272
|
const ServiceClass = stableParams.service;
|
|
265
273
|
response = await ServiceClass.previous({
|
|
266
274
|
type: stableParams.type,
|
|
@@ -281,8 +289,8 @@ function useDataListRetriever(params) {
|
|
|
281
289
|
retrieverParams.self = selfRef;
|
|
282
290
|
response = await stableParams.retriever(retrieverParams);
|
|
283
291
|
}
|
|
284
|
-
if (thisRequestId === requestIdRef.current && !_optionalChain([abortControllerRef, 'access',
|
|
285
|
-
if (_optionalChain([fetchParams, 'optionalAccess',
|
|
292
|
+
if (thisRequestId === requestIdRef.current && !_optionalChain([abortControllerRef, 'access', _16 => _16.current, 'optionalAccess', _17 => _17.signal, 'access', _18 => _18.aborted])) {
|
|
293
|
+
if (_optionalChain([fetchParams, 'optionalAccess', _19 => _19.isRefresh]) === true) {
|
|
286
294
|
setData(response);
|
|
287
295
|
} else {
|
|
288
296
|
setData((prevData) => [...prevData ? prevData : [], ...response]);
|
|
@@ -299,6 +307,7 @@ function useDataListRetriever(params) {
|
|
|
299
307
|
} finally {
|
|
300
308
|
if (thisRequestId === requestIdRef.current) {
|
|
301
309
|
isFetchingRef.current = false;
|
|
310
|
+
isPaginatingRef.current = false;
|
|
302
311
|
}
|
|
303
312
|
}
|
|
304
313
|
},
|
|
@@ -525,7 +534,7 @@ function useCustomD3Graph(nodes, links, onNodeClick, visibleNodeIds, loadingNode
|
|
|
525
534
|
});
|
|
526
535
|
const typeColorMap = /* @__PURE__ */ new Map();
|
|
527
536
|
Array.from(groupTypes).forEach((type, index) => {
|
|
528
|
-
if (type === _optionalChain([nodes, 'access',
|
|
537
|
+
if (type === _optionalChain([nodes, 'access', _20 => _20[0], 'optionalAccess', _21 => _21.instanceType])) {
|
|
529
538
|
typeColorMap.set(type, accentColor);
|
|
530
539
|
} else if (type === "documents" || type === "articles" || type === "hyperlinks") {
|
|
531
540
|
typeColorMap.set(type, contentColor);
|
|
@@ -568,7 +577,7 @@ function useCustomD3Graph(nodes, links, onNodeClick, visibleNodeIds, loadingNode
|
|
|
568
577
|
});
|
|
569
578
|
const svg = d3.select(svgRef.current);
|
|
570
579
|
svg.selectAll("*").remove();
|
|
571
|
-
const container = _optionalChain([svgRef, 'access',
|
|
580
|
+
const container = _optionalChain([svgRef, 'access', _22 => _22.current, 'optionalAccess', _23 => _23.parentElement]);
|
|
572
581
|
if (!container) return;
|
|
573
582
|
const width = container.clientWidth;
|
|
574
583
|
const height = container.clientHeight;
|
|
@@ -611,7 +620,7 @@ function useCustomD3Graph(nodes, links, onNodeClick, visibleNodeIds, loadingNode
|
|
|
611
620
|
sourceNode.children.push(targetId);
|
|
612
621
|
}
|
|
613
622
|
});
|
|
614
|
-
const rootChildren = _optionalChain([nodeHierarchy, 'access',
|
|
623
|
+
const rootChildren = _optionalChain([nodeHierarchy, 'access', _24 => _24.get, 'call', _25 => _25(centralNodeId), 'optionalAccess', _26 => _26.children]) || [];
|
|
615
624
|
const childAngleStep = 2 * Math.PI / Math.max(rootChildren.length, 1);
|
|
616
625
|
rootChildren.forEach((childId, index) => {
|
|
617
626
|
const childNode = nodeHierarchy.get(childId);
|
|
@@ -727,7 +736,7 @@ function useCustomD3Graph(nodes, links, onNodeClick, visibleNodeIds, loadingNode
|
|
|
727
736
|
if (d.instanceType === "root") return;
|
|
728
737
|
const currentNode = d3.select(this);
|
|
729
738
|
currentNode.raise();
|
|
730
|
-
const currentZoom = _optionalChain([zoomRef, 'access',
|
|
739
|
+
const currentZoom = _optionalChain([zoomRef, 'access', _27 => _27.current, 'optionalAccess', _28 => _28.k]) || 1;
|
|
731
740
|
const targetScreenFontSize = 20;
|
|
732
741
|
const baseFontSize = 12;
|
|
733
742
|
const textScale = targetScreenFontSize / (baseFontSize * currentZoom);
|
|
@@ -934,23 +943,23 @@ var CurrentUserProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (
|
|
|
934
943
|
);
|
|
935
944
|
const matchedModuleKey = moduleKeys.find((key) => {
|
|
936
945
|
const descriptor2 = Object.getOwnPropertyDescriptor(_chunkUYBCHXXLjs.Modules, key);
|
|
937
|
-
if (!_optionalChain([descriptor2, 'optionalAccess',
|
|
946
|
+
if (!_optionalChain([descriptor2, 'optionalAccess', _29 => _29.get])) return false;
|
|
938
947
|
const selectedModule = descriptor2.get.call(_chunkUYBCHXXLjs.Modules);
|
|
939
|
-
return path.toLowerCase().startsWith(_optionalChain([selectedModule, 'access',
|
|
948
|
+
return path.toLowerCase().startsWith(_optionalChain([selectedModule, 'access', _30 => _30.pageUrl, 'optionalAccess', _31 => _31.toLowerCase, 'call', _32 => _32()]));
|
|
940
949
|
});
|
|
941
950
|
if (!matchedModuleKey) return void 0;
|
|
942
951
|
const descriptor = Object.getOwnPropertyDescriptor(_chunkUYBCHXXLjs.Modules, matchedModuleKey);
|
|
943
|
-
return _optionalChain([descriptor, 'optionalAccess',
|
|
952
|
+
return _optionalChain([descriptor, 'optionalAccess', _33 => _33.get, 'optionalAccess', _34 => _34.call, 'call', _35 => _35(_chunkUYBCHXXLjs.Modules)]);
|
|
944
953
|
}, "matchUrlToModule");
|
|
945
954
|
const currentUser = dehydratedUser ? _chunkUYBCHXXLjs.rehydrate.call(void 0, _chunkUYBCHXXLjs.Modules.User, dehydratedUser) : null;
|
|
946
|
-
const company = _nullishCoalesce(_optionalChain([currentUser, 'optionalAccess',
|
|
955
|
+
const company = _nullishCoalesce(_optionalChain([currentUser, 'optionalAccess', _36 => _36.company]), () => ( null));
|
|
947
956
|
const setUser = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (user) => {
|
|
948
957
|
if (user) setDehydratedUser(user.dehydrate());
|
|
949
958
|
else setDehydratedUser(null);
|
|
950
959
|
}, "setUser");
|
|
951
960
|
const hasRole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (roleId) => {
|
|
952
961
|
if (!currentUser) return false;
|
|
953
|
-
return !!_optionalChain([currentUser, 'access',
|
|
962
|
+
return !!_optionalChain([currentUser, 'access', _37 => _37.roles, 'optionalAccess', _38 => _38.some, 'call', _39 => _39((userRole) => userRole.id === roleId)]);
|
|
954
963
|
}, "hasRole");
|
|
955
964
|
const hasAccesToFeature = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (featureIdentifier) => {
|
|
956
965
|
if (hasRole(_chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator)) return true;
|
|
@@ -1000,9 +1009,9 @@ var CurrentUserProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (
|
|
|
1000
1009
|
refreshUserRef.current = refreshUser;
|
|
1001
1010
|
const isRefreshingRef = _react.useRef.call(void 0, false);
|
|
1002
1011
|
_react.useEffect.call(void 0, () => {
|
|
1003
|
-
if (!socket || !isConnected || !_optionalChain([currentUser, 'optionalAccess',
|
|
1012
|
+
if (!socket || !isConnected || !_optionalChain([currentUser, 'optionalAccess', _40 => _40.company, 'optionalAccess', _41 => _41.id])) return;
|
|
1004
1013
|
const handleTokensUpdated = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (data) => {
|
|
1005
|
-
if (data.companyId === _optionalChain([currentUser, 'access',
|
|
1014
|
+
if (data.companyId === _optionalChain([currentUser, 'access', _42 => _42.company, 'optionalAccess', _43 => _43.id]) && !isRefreshingRef.current) {
|
|
1006
1015
|
isRefreshingRef.current = true;
|
|
1007
1016
|
refreshUserRef.current().finally(() => {
|
|
1008
1017
|
isRefreshingRef.current = false;
|
|
@@ -1013,7 +1022,7 @@ var CurrentUserProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (
|
|
|
1013
1022
|
return () => {
|
|
1014
1023
|
socket.off("company:tokens_updated", handleTokensUpdated);
|
|
1015
1024
|
};
|
|
1016
|
-
}, [socket, isConnected, _optionalChain([currentUser, 'optionalAccess',
|
|
1025
|
+
}, [socket, isConnected, _optionalChain([currentUser, 'optionalAccess', _44 => _44.company, 'optionalAccess', _45 => _45.id])]);
|
|
1017
1026
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1018
1027
|
CurrentUserContext.Provider,
|
|
1019
1028
|
{
|
|
@@ -1084,7 +1093,7 @@ function AddUserToRoleInternal({ role, refresh }) {
|
|
|
1084
1093
|
const data = useDataListRetriever({
|
|
1085
1094
|
ready: !!company && show,
|
|
1086
1095
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkUYBCHXXLjs.UserService.findAllUsers(params), "retriever"),
|
|
1087
|
-
retrieverParams: { companyId: _optionalChain([company, 'optionalAccess',
|
|
1096
|
+
retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _46 => _46.id]) },
|
|
1088
1097
|
module: _chunkUYBCHXXLjs.Modules.User
|
|
1089
1098
|
});
|
|
1090
1099
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1915,7 +1924,7 @@ function CalendarDayButton({
|
|
|
1915
1924
|
const defaultClassNames = _reactdaypicker.getDefaultClassNames.call(void 0, );
|
|
1916
1925
|
const ref = React3.useRef(null);
|
|
1917
1926
|
React3.useEffect(() => {
|
|
1918
|
-
if (modifiers.focused) _optionalChain([ref, 'access',
|
|
1927
|
+
if (modifiers.focused) _optionalChain([ref, 'access', _47 => _47.current, 'optionalAccess', _48 => _48.focus, 'call', _49 => _49()]);
|
|
1919
1928
|
}, [modifiers.focused]);
|
|
1920
1929
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1921
1930
|
Button,
|
|
@@ -2067,10 +2076,10 @@ function Carousel({
|
|
|
2067
2076
|
setCanScrollNext(api2.canScrollNext());
|
|
2068
2077
|
}, []);
|
|
2069
2078
|
const scrollPrev = React4.useCallback(() => {
|
|
2070
|
-
_optionalChain([api, 'optionalAccess',
|
|
2079
|
+
_optionalChain([api, 'optionalAccess', _50 => _50.scrollPrev, 'call', _51 => _51()]);
|
|
2071
2080
|
}, [api]);
|
|
2072
2081
|
const scrollNext = React4.useCallback(() => {
|
|
2073
|
-
_optionalChain([api, 'optionalAccess',
|
|
2082
|
+
_optionalChain([api, 'optionalAccess', _52 => _52.scrollNext, 'call', _53 => _53()]);
|
|
2074
2083
|
}, [api]);
|
|
2075
2084
|
const handleKeyDown = React4.useCallback(
|
|
2076
2085
|
(event) => {
|
|
@@ -2094,7 +2103,7 @@ function Carousel({
|
|
|
2094
2103
|
api.on("reInit", onSelect);
|
|
2095
2104
|
api.on("select", onSelect);
|
|
2096
2105
|
return () => {
|
|
2097
|
-
_optionalChain([api, 'optionalAccess',
|
|
2106
|
+
_optionalChain([api, 'optionalAccess', _54 => _54.off, 'call', _55 => _55("select", onSelect)]);
|
|
2098
2107
|
};
|
|
2099
2108
|
}, [api, onSelect]);
|
|
2100
2109
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2104,7 +2113,7 @@ function Carousel({
|
|
|
2104
2113
|
carouselRef,
|
|
2105
2114
|
api,
|
|
2106
2115
|
opts,
|
|
2107
|
-
orientation: orientation || (_optionalChain([opts, 'optionalAccess',
|
|
2116
|
+
orientation: orientation || (_optionalChain([opts, 'optionalAccess', _56 => _56.axis]) === "y" ? "vertical" : "horizontal"),
|
|
2108
2117
|
scrollPrev,
|
|
2109
2118
|
scrollNext,
|
|
2110
2119
|
canScrollPrev,
|
|
@@ -2288,7 +2297,7 @@ var ChartStyle = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ id, con
|
|
|
2288
2297
|
([theme, prefix]) => `
|
|
2289
2298
|
${prefix} [data-chart=${id}] {
|
|
2290
2299
|
${colorConfig.map(([key, itemConfig]) => {
|
|
2291
|
-
const color = _optionalChain([itemConfig, 'access',
|
|
2300
|
+
const color = _optionalChain([itemConfig, 'access', _57 => _57.theme, 'optionalAccess', _58 => _58[theme]]) || itemConfig.color;
|
|
2292
2301
|
return color ? ` --color-${key}: ${color};` : null;
|
|
2293
2302
|
}).join("\n")}
|
|
2294
2303
|
}
|
|
@@ -2316,13 +2325,13 @@ function ChartTooltipContent({
|
|
|
2316
2325
|
}) {
|
|
2317
2326
|
const { config } = useChart();
|
|
2318
2327
|
const tooltipLabel = React5.useMemo(() => {
|
|
2319
|
-
if (hideLabel || !_optionalChain([payload, 'optionalAccess',
|
|
2328
|
+
if (hideLabel || !_optionalChain([payload, 'optionalAccess', _59 => _59.length])) {
|
|
2320
2329
|
return null;
|
|
2321
2330
|
}
|
|
2322
2331
|
const [item] = payload;
|
|
2323
|
-
const key = `${labelKey || _optionalChain([item, 'optionalAccess',
|
|
2332
|
+
const key = `${labelKey || _optionalChain([item, 'optionalAccess', _60 => _60.dataKey]) || _optionalChain([item, 'optionalAccess', _61 => _61.name]) || "value"}`;
|
|
2324
2333
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
2325
|
-
const value = !labelKey && typeof label === "string" ? _optionalChain([config, 'access',
|
|
2334
|
+
const value = !labelKey && typeof label === "string" ? _optionalChain([config, 'access', _62 => _62[label], 'optionalAccess', _63 => _63.label]) || label : _optionalChain([itemConfig, 'optionalAccess', _64 => _64.label]);
|
|
2326
2335
|
if (labelFormatter) {
|
|
2327
2336
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkUYBCHXXLjs.cn.call(void 0, "font-medium", labelClassName), children: labelFormatter(value, payload) });
|
|
2328
2337
|
}
|
|
@@ -2339,7 +2348,7 @@ function ChartTooltipContent({
|
|
|
2339
2348
|
config,
|
|
2340
2349
|
labelKey
|
|
2341
2350
|
]);
|
|
2342
|
-
if (!active || !_optionalChain([payload, 'optionalAccess',
|
|
2351
|
+
if (!active || !_optionalChain([payload, 'optionalAccess', _65 => _65.length])) {
|
|
2343
2352
|
return null;
|
|
2344
2353
|
}
|
|
2345
2354
|
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
@@ -2355,7 +2364,7 @@ function ChartTooltipContent({
|
|
|
2355
2364
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "grid gap-1.5", children: payload.filter((item) => item.type !== "none").map((item, index) => {
|
|
2356
2365
|
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
2357
2366
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
2358
|
-
const indicatorColor = color || _optionalChain([item, 'access',
|
|
2367
|
+
const indicatorColor = color || _optionalChain([item, 'access', _66 => _66.payload, 'optionalAccess', _67 => _67.fill]) || item.color;
|
|
2359
2368
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2360
2369
|
"div",
|
|
2361
2370
|
{
|
|
@@ -2363,8 +2372,8 @@ function ChartTooltipContent({
|
|
|
2363
2372
|
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
|
|
2364
2373
|
indicator === "dot" && "items-center"
|
|
2365
2374
|
),
|
|
2366
|
-
children: formatter && _optionalChain([item, 'optionalAccess',
|
|
2367
|
-
_optionalChain([itemConfig, 'optionalAccess',
|
|
2375
|
+
children: formatter && _optionalChain([item, 'optionalAccess', _68 => _68.value]) !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2376
|
+
_optionalChain([itemConfig, 'optionalAccess', _69 => _69.icon]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2368
2377
|
"div",
|
|
2369
2378
|
{
|
|
2370
2379
|
className: _chunkUYBCHXXLjs.cn.call(void 0,
|
|
@@ -2392,7 +2401,7 @@ function ChartTooltipContent({
|
|
|
2392
2401
|
children: [
|
|
2393
2402
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-1.5", children: [
|
|
2394
2403
|
nestLabel ? tooltipLabel : null,
|
|
2395
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: _optionalChain([itemConfig, 'optionalAccess',
|
|
2404
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: _optionalChain([itemConfig, 'optionalAccess', _70 => _70.label]) || item.name })
|
|
2396
2405
|
] }),
|
|
2397
2406
|
item.value && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground font-mono font-medium tabular-nums", children: item.value.toLocaleString() })
|
|
2398
2407
|
]
|
|
@@ -2417,7 +2426,7 @@ function ChartLegendContent({
|
|
|
2417
2426
|
nameKey
|
|
2418
2427
|
}) {
|
|
2419
2428
|
const { config } = useChart();
|
|
2420
|
-
if (!_optionalChain([payload, 'optionalAccess',
|
|
2429
|
+
if (!_optionalChain([payload, 'optionalAccess', _71 => _71.length])) {
|
|
2421
2430
|
return null;
|
|
2422
2431
|
}
|
|
2423
2432
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2438,7 +2447,7 @@ function ChartLegendContent({
|
|
|
2438
2447
|
"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
|
|
2439
2448
|
),
|
|
2440
2449
|
children: [
|
|
2441
|
-
_optionalChain([itemConfig, 'optionalAccess',
|
|
2450
|
+
_optionalChain([itemConfig, 'optionalAccess', _72 => _72.icon]) && !hideIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, itemConfig.icon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2442
2451
|
"div",
|
|
2443
2452
|
{
|
|
2444
2453
|
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
@@ -2447,7 +2456,7 @@ function ChartLegendContent({
|
|
|
2447
2456
|
}
|
|
2448
2457
|
}
|
|
2449
2458
|
),
|
|
2450
|
-
_optionalChain([itemConfig, 'optionalAccess',
|
|
2459
|
+
_optionalChain([itemConfig, 'optionalAccess', _73 => _73.label])
|
|
2451
2460
|
]
|
|
2452
2461
|
},
|
|
2453
2462
|
item.value
|
|
@@ -2749,7 +2758,7 @@ function InputGroupAddon({
|
|
|
2749
2758
|
if (e.target.closest("button")) {
|
|
2750
2759
|
return;
|
|
2751
2760
|
}
|
|
2752
|
-
_optionalChain([e, 'access',
|
|
2761
|
+
_optionalChain([e, 'access', _74 => _74.currentTarget, 'access', _75 => _75.parentElement, 'optionalAccess', _76 => _76.querySelector, 'call', _77 => _77("input"), 'optionalAccess', _78 => _78.focus, 'call', _79 => _79()]);
|
|
2753
2762
|
},
|
|
2754
2763
|
...props
|
|
2755
2764
|
}
|
|
@@ -3795,17 +3804,17 @@ function FieldError({
|
|
|
3795
3804
|
if (children) {
|
|
3796
3805
|
return children;
|
|
3797
3806
|
}
|
|
3798
|
-
if (!_optionalChain([errors, 'optionalAccess',
|
|
3807
|
+
if (!_optionalChain([errors, 'optionalAccess', _80 => _80.length])) {
|
|
3799
3808
|
return null;
|
|
3800
3809
|
}
|
|
3801
3810
|
const uniqueErrors = [
|
|
3802
|
-
...new Map(errors.map((error) => [_optionalChain([error, 'optionalAccess',
|
|
3811
|
+
...new Map(errors.map((error) => [_optionalChain([error, 'optionalAccess', _81 => _81.message]), error])).values()
|
|
3803
3812
|
];
|
|
3804
|
-
if (_optionalChain([uniqueErrors, 'optionalAccess',
|
|
3805
|
-
return _optionalChain([uniqueErrors, 'access',
|
|
3813
|
+
if (_optionalChain([uniqueErrors, 'optionalAccess', _82 => _82.length]) == 1) {
|
|
3814
|
+
return _optionalChain([uniqueErrors, 'access', _83 => _83[0], 'optionalAccess', _84 => _84.message]);
|
|
3806
3815
|
}
|
|
3807
3816
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map(
|
|
3808
|
-
(error, index) => _optionalChain([error, 'optionalAccess',
|
|
3817
|
+
(error, index) => _optionalChain([error, 'optionalAccess', _85 => _85.message]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { children: error.message }, index)
|
|
3809
3818
|
) });
|
|
3810
3819
|
}, [children, errors]);
|
|
3811
3820
|
if (!content) {
|
|
@@ -3916,7 +3925,7 @@ function InputOTPSlot({
|
|
|
3916
3925
|
...props
|
|
3917
3926
|
}) {
|
|
3918
3927
|
const inputOTPContext = React6.useContext(_inputotp.OTPInputContext);
|
|
3919
|
-
const { char, hasFakeCaret, isActive } = _nullishCoalesce(_optionalChain([inputOTPContext, 'optionalAccess',
|
|
3928
|
+
const { char, hasFakeCaret, isActive } = _nullishCoalesce(_optionalChain([inputOTPContext, 'optionalAccess', _86 => _86.slots, 'access', _87 => _87[index]]), () => ( {}));
|
|
3920
3929
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3921
3930
|
"div",
|
|
3922
3931
|
{
|
|
@@ -4994,7 +5003,7 @@ function SidebarTrigger({
|
|
|
4994
5003
|
size: "icon-sm",
|
|
4995
5004
|
className: _chunkUYBCHXXLjs.cn.call(void 0, className),
|
|
4996
5005
|
onClick: (event) => {
|
|
4997
|
-
_optionalChain([onClick, 'optionalCall',
|
|
5006
|
+
_optionalChain([onClick, 'optionalCall', _88 => _88(event)]);
|
|
4998
5007
|
toggleSidebar();
|
|
4999
5008
|
},
|
|
5000
5009
|
...props,
|
|
@@ -5816,14 +5825,14 @@ var coordinateGetter = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (eve
|
|
|
5816
5825
|
if (!active || !collisionRect) return;
|
|
5817
5826
|
const filteredContainers = [];
|
|
5818
5827
|
for (const entry of droppableContainers.getEnabled()) {
|
|
5819
|
-
if (!entry || _optionalChain([entry, 'optionalAccess',
|
|
5828
|
+
if (!entry || _optionalChain([entry, 'optionalAccess', _89 => _89.disabled])) return;
|
|
5820
5829
|
const rect = droppableRects.get(entry.id);
|
|
5821
5830
|
if (!rect) return;
|
|
5822
5831
|
const data = entry.data.current;
|
|
5823
5832
|
if (data) {
|
|
5824
5833
|
const { type, children } = data;
|
|
5825
|
-
if (type === "container" && _optionalChain([children, 'optionalAccess',
|
|
5826
|
-
if (_optionalChain([active, 'access',
|
|
5834
|
+
if (type === "container" && _optionalChain([children, 'optionalAccess', _90 => _90.length]) > 0) {
|
|
5835
|
+
if (_optionalChain([active, 'access', _91 => _91.data, 'access', _92 => _92.current, 'optionalAccess', _93 => _93.type]) !== "container") {
|
|
5827
5836
|
return;
|
|
5828
5837
|
}
|
|
5829
5838
|
}
|
|
@@ -5861,8 +5870,8 @@ var coordinateGetter = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (eve
|
|
|
5861
5870
|
const closestId = _core.getFirstCollision.call(void 0, collisions, "id");
|
|
5862
5871
|
if (closestId != null) {
|
|
5863
5872
|
const newDroppable = droppableContainers.get(closestId);
|
|
5864
|
-
const newNode = _optionalChain([newDroppable, 'optionalAccess',
|
|
5865
|
-
const newRect = _optionalChain([newDroppable, 'optionalAccess',
|
|
5873
|
+
const newNode = _optionalChain([newDroppable, 'optionalAccess', _94 => _94.node, 'access', _95 => _95.current]);
|
|
5874
|
+
const newRect = _optionalChain([newDroppable, 'optionalAccess', _96 => _96.rect, 'access', _97 => _97.current]);
|
|
5866
5875
|
if (newNode && newRect) {
|
|
5867
5876
|
if (newDroppable.id === "placeholder") {
|
|
5868
5877
|
return {
|
|
@@ -5870,7 +5879,7 @@ var coordinateGetter = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (eve
|
|
|
5870
5879
|
y: newRect.top + (newRect.height - collisionRect.height) / 2
|
|
5871
5880
|
};
|
|
5872
5881
|
}
|
|
5873
|
-
if (_optionalChain([newDroppable, 'access',
|
|
5882
|
+
if (_optionalChain([newDroppable, 'access', _98 => _98.data, 'access', _99 => _99.current, 'optionalAccess', _100 => _100.type]) === "container") {
|
|
5874
5883
|
return {
|
|
5875
5884
|
x: newRect.left + 20,
|
|
5876
5885
|
y: newRect.top + 74
|
|
@@ -5974,7 +5983,7 @@ function KanbanRoot(props) {
|
|
|
5974
5983
|
)
|
|
5975
5984
|
});
|
|
5976
5985
|
if (closestItem.length > 0) {
|
|
5977
|
-
overId = _nullishCoalesce(_optionalChain([closestItem, 'access',
|
|
5986
|
+
overId = _nullishCoalesce(_optionalChain([closestItem, 'access', _101 => _101[0], 'optionalAccess', _102 => _102.id]), () => ( overId));
|
|
5978
5987
|
}
|
|
5979
5988
|
}
|
|
5980
5989
|
}
|
|
@@ -5985,7 +5994,7 @@ function KanbanRoot(props) {
|
|
|
5985
5994
|
);
|
|
5986
5995
|
const onDragStart = React9.useCallback(
|
|
5987
5996
|
(event) => {
|
|
5988
|
-
_optionalChain([kanbanProps, 'access',
|
|
5997
|
+
_optionalChain([kanbanProps, 'access', _103 => _103.onDragStart, 'optionalCall', _104 => _104(event)]);
|
|
5989
5998
|
if (event.activatorEvent.defaultPrevented) return;
|
|
5990
5999
|
setActiveId(event.active.id);
|
|
5991
6000
|
},
|
|
@@ -5993,7 +6002,7 @@ function KanbanRoot(props) {
|
|
|
5993
6002
|
);
|
|
5994
6003
|
const onDragOver = React9.useCallback(
|
|
5995
6004
|
(event) => {
|
|
5996
|
-
_optionalChain([kanbanProps, 'access',
|
|
6005
|
+
_optionalChain([kanbanProps, 'access', _105 => _105.onDragOver, 'optionalCall', _106 => _106(event)]);
|
|
5997
6006
|
if (event.activatorEvent.defaultPrevented) return;
|
|
5998
6007
|
const { active, over } = event;
|
|
5999
6008
|
if (!over) return;
|
|
@@ -6008,7 +6017,7 @@ function KanbanRoot(props) {
|
|
|
6008
6017
|
if (activeIndex !== overIndex) {
|
|
6009
6018
|
const newColumns = { ...value };
|
|
6010
6019
|
newColumns[activeColumn] = _sortable.arrayMove.call(void 0, items, activeIndex, overIndex);
|
|
6011
|
-
_optionalChain([onValueChange, 'optionalCall',
|
|
6020
|
+
_optionalChain([onValueChange, 'optionalCall', _107 => _107(newColumns)]);
|
|
6012
6021
|
}
|
|
6013
6022
|
} else {
|
|
6014
6023
|
const activeItems = value[activeColumn];
|
|
@@ -6023,7 +6032,7 @@ function KanbanRoot(props) {
|
|
|
6023
6032
|
[activeColumn]: activeItems.filter((item) => getItemValue(item) !== active.id),
|
|
6024
6033
|
[overColumn]: [...overItems, activeItem]
|
|
6025
6034
|
};
|
|
6026
|
-
_optionalChain([onValueChange, 'optionalCall',
|
|
6035
|
+
_optionalChain([onValueChange, 'optionalCall', _108 => _108(updatedItems)]);
|
|
6027
6036
|
hasMovedRef.current = true;
|
|
6028
6037
|
}
|
|
6029
6038
|
},
|
|
@@ -6031,7 +6040,7 @@ function KanbanRoot(props) {
|
|
|
6031
6040
|
);
|
|
6032
6041
|
const onDragEnd = React9.useCallback(
|
|
6033
6042
|
(event) => {
|
|
6034
|
-
_optionalChain([kanbanProps, 'access',
|
|
6043
|
+
_optionalChain([kanbanProps, 'access', _109 => _109.onDragEnd, 'optionalCall', _110 => _110(event)]);
|
|
6035
6044
|
if (event.activatorEvent.defaultPrevented) return;
|
|
6036
6045
|
const { active, over } = event;
|
|
6037
6046
|
if (!over) {
|
|
@@ -6054,7 +6063,7 @@ function KanbanRoot(props) {
|
|
|
6054
6063
|
if (onMove) {
|
|
6055
6064
|
onMove({ ...event, activeIndex, overIndex });
|
|
6056
6065
|
} else {
|
|
6057
|
-
_optionalChain([onValueChange, 'optionalCall',
|
|
6066
|
+
_optionalChain([onValueChange, 'optionalCall', _111 => _111(newColumns)]);
|
|
6058
6067
|
}
|
|
6059
6068
|
}
|
|
6060
6069
|
} else {
|
|
@@ -6082,7 +6091,7 @@ function KanbanRoot(props) {
|
|
|
6082
6091
|
overIndex
|
|
6083
6092
|
});
|
|
6084
6093
|
} else {
|
|
6085
|
-
_optionalChain([onValueChange, 'optionalCall',
|
|
6094
|
+
_optionalChain([onValueChange, 'optionalCall', _112 => _112(newColumns)]);
|
|
6086
6095
|
}
|
|
6087
6096
|
}
|
|
6088
6097
|
}
|
|
@@ -6094,7 +6103,7 @@ function KanbanRoot(props) {
|
|
|
6094
6103
|
);
|
|
6095
6104
|
const onDragCancel = React9.useCallback(
|
|
6096
6105
|
(event) => {
|
|
6097
|
-
_optionalChain([kanbanProps, 'access',
|
|
6106
|
+
_optionalChain([kanbanProps, 'access', _113 => _113.onDragCancel, 'optionalCall', _114 => _114(event)]);
|
|
6098
6107
|
if (event.activatorEvent.defaultPrevented) return;
|
|
6099
6108
|
setActiveId(null);
|
|
6100
6109
|
hasMovedRef.current = false;
|
|
@@ -6113,7 +6122,7 @@ function KanbanRoot(props) {
|
|
|
6113
6122
|
})();
|
|
6114
6123
|
const total = isColumn ? Object.keys(value).length : (() => {
|
|
6115
6124
|
const column = getColumn(active.id);
|
|
6116
|
-
return column ? _nullishCoalesce(_optionalChain([value, 'access',
|
|
6125
|
+
return column ? _nullishCoalesce(_optionalChain([value, 'access', _115 => _115[column], 'optionalAccess', _116 => _116.length]), () => ( 0)) : 0;
|
|
6117
6126
|
})();
|
|
6118
6127
|
return `Picked up ${itemType} at position ${position} of ${total}`;
|
|
6119
6128
|
},
|
|
@@ -6128,7 +6137,7 @@ function KanbanRoot(props) {
|
|
|
6128
6137
|
})();
|
|
6129
6138
|
const total = isColumn ? Object.keys(value).length : (() => {
|
|
6130
6139
|
const column = getColumn(over.id);
|
|
6131
|
-
return column ? _nullishCoalesce(_optionalChain([value, 'access',
|
|
6140
|
+
return column ? _nullishCoalesce(_optionalChain([value, 'access', _117 => _117[column], 'optionalAccess', _118 => _118.length]), () => ( 0)) : 0;
|
|
6132
6141
|
})();
|
|
6133
6142
|
const overColumn = getColumn(over.id);
|
|
6134
6143
|
const activeColumn = getColumn(active.id);
|
|
@@ -6151,7 +6160,7 @@ function KanbanRoot(props) {
|
|
|
6151
6160
|
})();
|
|
6152
6161
|
const total = isColumn ? Object.keys(value).length : (() => {
|
|
6153
6162
|
const column = getColumn(over.id);
|
|
6154
|
-
return column ? _nullishCoalesce(_optionalChain([value, 'access',
|
|
6163
|
+
return column ? _nullishCoalesce(_optionalChain([value, 'access', _119 => _119[column], 'optionalAccess', _120 => _120.length]), () => ( 0)) : 0;
|
|
6155
6164
|
})();
|
|
6156
6165
|
const overColumn = getColumn(over.id);
|
|
6157
6166
|
const activeColumn = getColumn(active.id);
|
|
@@ -6497,7 +6506,7 @@ function KanbanOverlay(props) {
|
|
|
6497
6506
|
const context = useKanbanContext(OVERLAY_NAME);
|
|
6498
6507
|
const [mounted, setMounted] = React9.useState(false);
|
|
6499
6508
|
React9.useLayoutEffect(() => setMounted(true), []);
|
|
6500
|
-
const container = _nullishCoalesce(containerProp, () => ( (mounted ? _optionalChain([globalThis, 'access',
|
|
6509
|
+
const container = _nullishCoalesce(containerProp, () => ( (mounted ? _optionalChain([globalThis, 'access', _121 => _121.document, 'optionalAccess', _122 => _122.body]) : null)));
|
|
6501
6510
|
if (!container) return null;
|
|
6502
6511
|
const variant = context.activeId && context.activeId in context.items ? "column" : "item";
|
|
6503
6512
|
return ReactDOM.createPortal(
|
|
@@ -6629,7 +6638,7 @@ var MultiSelect = React11.forwardRef(
|
|
|
6629
6638
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap items-center", children: [
|
|
6630
6639
|
selectedValues.slice(0, maxCount).map((value2) => {
|
|
6631
6640
|
const option = options.find((o) => o.value === value2);
|
|
6632
|
-
const IconComponent = _optionalChain([option, 'optionalAccess',
|
|
6641
|
+
const IconComponent = _optionalChain([option, 'optionalAccess', _123 => _123.icon]);
|
|
6633
6642
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6634
6643
|
Badge,
|
|
6635
6644
|
{
|
|
@@ -6637,7 +6646,7 @@ var MultiSelect = React11.forwardRef(
|
|
|
6637
6646
|
style: { animationDuration: `${animation}s` },
|
|
6638
6647
|
children: [
|
|
6639
6648
|
IconComponent && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, IconComponent, { className: "mr-2 h-4 w-4" }),
|
|
6640
|
-
_optionalChain([option, 'optionalAccess',
|
|
6649
|
+
_optionalChain([option, 'optionalAccess', _124 => _124.label]),
|
|
6641
6650
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6642
6651
|
_lucidereact.XCircle,
|
|
6643
6652
|
{
|
|
@@ -6817,10 +6826,10 @@ function UserAvatarEditor({ user, file, setFile, resetImage, setResetImage }) {
|
|
|
6817
6826
|
onValueChange: setFiles,
|
|
6818
6827
|
dropzoneOptions: dropzone2,
|
|
6819
6828
|
className: "h-40 w-40 rounded-full p-0",
|
|
6820
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FileInput, { className: "bg-muted text-muted-foreground flex h-full w-full flex-col items-center justify-center", children: !resetImage && (file || _optionalChain([user, 'optionalAccess',
|
|
6829
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FileInput, { className: "bg-muted text-muted-foreground flex h-full w-full flex-col items-center justify-center", children: !resetImage && (file || _optionalChain([user, 'optionalAccess', _125 => _125.avatar])) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6821
6830
|
_image2.default,
|
|
6822
6831
|
{
|
|
6823
|
-
src: file ? URL.createObjectURL(file) : _optionalChain([user, 'optionalAccess',
|
|
6832
|
+
src: file ? URL.createObjectURL(file) : _optionalChain([user, 'optionalAccess', _126 => _126.avatar]) || "",
|
|
6824
6833
|
alt: t(`common.avatar`),
|
|
6825
6834
|
width: 200,
|
|
6826
6835
|
height: 200
|
|
@@ -6828,7 +6837,7 @@ function UserAvatarEditor({ user, file, setFile, resetImage, setResetImage }) {
|
|
|
6828
6837
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.UploadIcon, { className: "my-4 h-8 w-8" }) })
|
|
6829
6838
|
}
|
|
6830
6839
|
),
|
|
6831
|
-
!resetImage && (file || _optionalChain([user, 'optionalAccess',
|
|
6840
|
+
!resetImage && (file || _optionalChain([user, 'optionalAccess', _127 => _127.avatar])) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6832
6841
|
Button,
|
|
6833
6842
|
{
|
|
6834
6843
|
className: "",
|
|
@@ -6856,7 +6865,7 @@ function UserDeleterInternal({ user, onDeleted, companyId }) {
|
|
|
6856
6865
|
const router = _chunkEW6QPMN3js.useI18nRouter.call(void 0, );
|
|
6857
6866
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6858
6867
|
let cId;
|
|
6859
|
-
if (_optionalChain([currentUser, 'optionalAccess',
|
|
6868
|
+
if (_optionalChain([currentUser, 'optionalAccess', _128 => _128.roles, 'access', _129 => _129.find, 'call', _130 => _130((role) => role.id === _chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator)]) && companyId) {
|
|
6860
6869
|
cId = companyId;
|
|
6861
6870
|
} else {
|
|
6862
6871
|
if (!company) return;
|
|
@@ -6924,16 +6933,16 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
6924
6933
|
const form = _reacthookform.useForm.call(void 0, {
|
|
6925
6934
|
resolver: _zod.zodResolver.call(void 0, formSchema),
|
|
6926
6935
|
defaultValues: {
|
|
6927
|
-
id: _optionalChain([user, 'optionalAccess',
|
|
6928
|
-
name: _optionalChain([user, 'optionalAccess',
|
|
6929
|
-
title: _optionalChain([user, 'optionalAccess',
|
|
6930
|
-
bio: _optionalChain([user, 'optionalAccess',
|
|
6931
|
-
email: _optionalChain([user, 'optionalAccess',
|
|
6932
|
-
phone: _optionalChain([user, 'optionalAccess',
|
|
6936
|
+
id: _optionalChain([user, 'optionalAccess', _131 => _131.id]) || _uuid.v4.call(void 0, ),
|
|
6937
|
+
name: _optionalChain([user, 'optionalAccess', _132 => _132.name]) || "",
|
|
6938
|
+
title: _optionalChain([user, 'optionalAccess', _133 => _133.title]) || "",
|
|
6939
|
+
bio: _optionalChain([user, 'optionalAccess', _134 => _134.bio]) || "",
|
|
6940
|
+
email: _optionalChain([user, 'optionalAccess', _135 => _135.email]) || "",
|
|
6941
|
+
phone: _optionalChain([user, 'optionalAccess', _136 => _136.phone]) || "",
|
|
6933
6942
|
password: "",
|
|
6934
|
-
roleIds: _optionalChain([user, 'optionalAccess',
|
|
6943
|
+
roleIds: _optionalChain([user, 'optionalAccess', _137 => _137.roles, 'access', _138 => _138.map, 'call', _139 => _139((role) => role.id)]) || [],
|
|
6935
6944
|
sendInvitationEmail: false,
|
|
6936
|
-
avatar: _optionalChain([user, 'optionalAccess',
|
|
6945
|
+
avatar: _optionalChain([user, 'optionalAccess', _140 => _140.avatarUrl]) || ""
|
|
6937
6946
|
}
|
|
6938
6947
|
});
|
|
6939
6948
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
|
|
@@ -6979,7 +6988,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
6979
6988
|
};
|
|
6980
6989
|
try {
|
|
6981
6990
|
const updatedUser = user ? await _chunkUYBCHXXLjs.UserService.update(payload) : await _chunkUYBCHXXLjs.UserService.create(payload);
|
|
6982
|
-
if (_optionalChain([currentUser, 'optionalAccess',
|
|
6991
|
+
if (_optionalChain([currentUser, 'optionalAccess', _141 => _141.id]) === updatedUser.id) setUser(updatedUser);
|
|
6983
6992
|
if (onRevalidate) {
|
|
6984
6993
|
await onRevalidate(generateUrl({ page: _chunkUYBCHXXLjs.Modules.User, id: updatedUser.id, language: `[locale]` }));
|
|
6985
6994
|
}
|
|
@@ -6997,12 +7006,12 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
6997
7006
|
async function fetchRoles() {
|
|
6998
7007
|
const roles2 = await _chunkUYBCHXXLjs.RoleService.findAllRoles({});
|
|
6999
7008
|
const availableRoles = roles2.filter(
|
|
7000
|
-
(role) => role.id !== _chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator && (role.requiredFeature === void 0 || _optionalChain([company, 'optionalAccess',
|
|
7009
|
+
(role) => role.id !== _chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator && (role.requiredFeature === void 0 || _optionalChain([company, 'optionalAccess', _142 => _142.features, 'access', _143 => _143.some, 'call', _144 => _144((feature) => feature.id === _optionalChain([role, 'access', _145 => _145.requiredFeature, 'optionalAccess', _146 => _146.id]))]))
|
|
7001
7010
|
);
|
|
7002
7011
|
setRoles(availableRoles);
|
|
7003
7012
|
}
|
|
7004
7013
|
_chunk7QVYU63Ejs.__name.call(void 0, fetchRoles, "fetchRoles");
|
|
7005
|
-
if (open && (company || _optionalChain([currentUser, 'optionalAccess',
|
|
7014
|
+
if (open && (company || _optionalChain([currentUser, 'optionalAccess', _147 => _147.roles, 'access', _148 => _148.find, 'call', _149 => _149((role) => role.id === _chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator)])) && roles.length === 0)
|
|
7006
7015
|
fetchRoles();
|
|
7007
7016
|
}, [company, open]);
|
|
7008
7017
|
_react.useEffect.call(void 0, () => {
|
|
@@ -7023,7 +7032,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7023
7032
|
setContentType(null);
|
|
7024
7033
|
}
|
|
7025
7034
|
}, [file]);
|
|
7026
|
-
const canChangeRoles = !(_optionalChain([currentUser, 'optionalAccess',
|
|
7035
|
+
const canChangeRoles = !(_optionalChain([currentUser, 'optionalAccess', _150 => _150.id]) === _optionalChain([user, 'optionalAccess', _151 => _151.id]) && hasRole(_chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator)) && (hasPermissionToModule({ module: _chunkUYBCHXXLjs.Modules.User, action: "update" /* Update */ }) || hasRole(_chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator));
|
|
7027
7036
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Dialog, { open, onOpenChange: setOpen, children: [
|
|
7028
7037
|
trigger ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DialogTrigger, { children: trigger }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorTrigger, { isEdit: !!user }),
|
|
7029
7038
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -7031,7 +7040,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7031
7040
|
{
|
|
7032
7041
|
className: `flex max-h-[70vh] ${canChangeRoles ? `max-w-[90vw]` : `max-w-3xl`} min-h-3xl max-h-[90vh] flex-col overflow-y-auto`,
|
|
7033
7042
|
children: [
|
|
7034
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorHeader, { type: t(`entities.users`, { count: 1 }), name: _optionalChain([user, 'optionalAccess',
|
|
7043
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorHeader, { type: t(`entities.users`, { count: 1 }), name: _optionalChain([user, 'optionalAccess', _152 => _152.name]) }),
|
|
7035
7044
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: `flex w-full flex-col gap-y-4`, children: [
|
|
7036
7045
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `flex flex-row gap-x-4`, children: [
|
|
7037
7046
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `flex w-40 flex-col justify-start gap-y-2`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7110,10 +7119,10 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7110
7119
|
] })
|
|
7111
7120
|
] }),
|
|
7112
7121
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-x-4", children: [
|
|
7113
|
-
user && _optionalChain([currentUser, 'optionalAccess',
|
|
7122
|
+
user && _optionalChain([currentUser, 'optionalAccess', _153 => _153.roles, 'access', _154 => _154.find, 'call', _155 => _155((role) => role.id === _chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator)]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7114
7123
|
UserDeleter,
|
|
7115
7124
|
{
|
|
7116
|
-
companyId: _optionalChain([user, 'access',
|
|
7125
|
+
companyId: _optionalChain([user, 'access', _156 => _156.company, 'optionalAccess', _157 => _157.id]),
|
|
7117
7126
|
user,
|
|
7118
7127
|
onDeleted: () => {
|
|
7119
7128
|
setOpen(false);
|
|
@@ -7290,7 +7299,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ErrorDetails, "ErrorDetails");
|
|
|
7290
7299
|
// src/components/errors/errorToast.ts
|
|
7291
7300
|
|
|
7292
7301
|
function errorToast(params) {
|
|
7293
|
-
_sonner.toast.error(_nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
7302
|
+
_sonner.toast.error(_nullishCoalesce(_optionalChain([params, 'optionalAccess', _158 => _158.title]), () => ( "Error")), {
|
|
7294
7303
|
description: params.error instanceof Error ? params.error.message : String(params.error)
|
|
7295
7304
|
});
|
|
7296
7305
|
}
|
|
@@ -7593,7 +7602,7 @@ function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth
|
|
|
7593
7602
|
const [open, setOpen] = _react.useState.call(void 0, false);
|
|
7594
7603
|
const [prevRange, setPrevRange] = _react.useState.call(void 0, date);
|
|
7595
7604
|
_react.useEffect.call(void 0, () => {
|
|
7596
|
-
if (_optionalChain([date, 'optionalAccess',
|
|
7605
|
+
if (_optionalChain([date, 'optionalAccess', _159 => _159.from]) && _optionalChain([date, 'optionalAccess', _160 => _160.to]) && date.to > date.from && (_optionalChain([prevRange, 'optionalAccess', _161 => _161.from, 'optionalAccess', _162 => _162.getTime, 'call', _163 => _163()]) !== date.from.getTime() || _optionalChain([prevRange, 'optionalAccess', _164 => _164.to, 'optionalAccess', _165 => _165.getTime, 'call', _166 => _166()]) !== date.to.getTime())) {
|
|
7597
7606
|
onDateChange(date);
|
|
7598
7607
|
setPrevRange(date);
|
|
7599
7608
|
setOpen(false);
|
|
@@ -7604,7 +7613,7 @@ function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth
|
|
|
7604
7613
|
setDate(void 0);
|
|
7605
7614
|
return;
|
|
7606
7615
|
}
|
|
7607
|
-
if (range.from && (!_optionalChain([date, 'optionalAccess',
|
|
7616
|
+
if (range.from && (!_optionalChain([date, 'optionalAccess', _167 => _167.from]) || range.from.getTime() !== date.from.getTime())) {
|
|
7608
7617
|
setDate({ from: range.from, to: void 0 });
|
|
7609
7618
|
} else {
|
|
7610
7619
|
setDate(range);
|
|
@@ -7619,7 +7628,7 @@ function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth
|
|
|
7619
7628
|
className: _chunkUYBCHXXLjs.cn.call(void 0, "w-[300px] justify-start text-left font-normal", !date && "text-muted-foreground"),
|
|
7620
7629
|
children: [
|
|
7621
7630
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CalendarIcon, {}),
|
|
7622
|
-
_optionalChain([date, 'optionalAccess',
|
|
7631
|
+
_optionalChain([date, 'optionalAccess', _168 => _168.from]) ? date.to ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
7623
7632
|
_datefns.format.call(void 0, date.from, "LLL dd, y"),
|
|
7624
7633
|
" - ",
|
|
7625
7634
|
_datefns.format.call(void 0, date.to, "LLL dd, y")
|
|
@@ -7632,7 +7641,7 @@ function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth
|
|
|
7632
7641
|
Calendar,
|
|
7633
7642
|
{
|
|
7634
7643
|
mode: "range",
|
|
7635
|
-
defaultMonth: _nullishCoalesce(_optionalChain([date, 'optionalAccess',
|
|
7644
|
+
defaultMonth: _nullishCoalesce(_optionalChain([date, 'optionalAccess', _169 => _169.from]), () => ( (showPreviousMonth ? new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth() - 1, 1) : void 0))),
|
|
7636
7645
|
selected: date,
|
|
7637
7646
|
onSelect: handleSelect,
|
|
7638
7647
|
numberOfMonths: 2
|
|
@@ -7720,7 +7729,7 @@ var FileUploader = _react.forwardRef.call(void 0,
|
|
|
7720
7729
|
movePrev();
|
|
7721
7730
|
} else if (e.key === "Enter" || e.key === "Space") {
|
|
7722
7731
|
if (activeIndex === -1) {
|
|
7723
|
-
_optionalChain([dropzoneState, 'access',
|
|
7732
|
+
_optionalChain([dropzoneState, 'access', _170 => _170.inputRef, 'access', _171 => _171.current, 'optionalAccess', _172 => _172.click, 'call', _173 => _173()]);
|
|
7724
7733
|
}
|
|
7725
7734
|
} else if (e.key === "Delete" || e.key === "Backspace") {
|
|
7726
7735
|
if (activeIndex !== -1) {
|
|
@@ -7758,13 +7767,13 @@ var FileUploader = _react.forwardRef.call(void 0,
|
|
|
7758
7767
|
onValueChange(newValues);
|
|
7759
7768
|
if (rejectedFiles.length > 0) {
|
|
7760
7769
|
for (let i = 0; i < rejectedFiles.length; i++) {
|
|
7761
|
-
if (_optionalChain([rejectedFiles, 'access',
|
|
7770
|
+
if (_optionalChain([rejectedFiles, 'access', _174 => _174[i], 'access', _175 => _175.errors, 'access', _176 => _176[0], 'optionalAccess', _177 => _177.code]) === "file-too-large") {
|
|
7762
7771
|
_sonner.toast.error(t("common.errors.file"), {
|
|
7763
7772
|
description: t(`common.errors.file_max`, { size: maxSize / 1024 / 1024 })
|
|
7764
7773
|
});
|
|
7765
7774
|
break;
|
|
7766
7775
|
}
|
|
7767
|
-
if (_optionalChain([rejectedFiles, 'access',
|
|
7776
|
+
if (_optionalChain([rejectedFiles, 'access', _178 => _178[i], 'access', _179 => _179.errors, 'access', _180 => _180[0], 'optionalAccess', _181 => _181.message])) {
|
|
7768
7777
|
_sonner.toast.error(t(`common.errors.file`), {
|
|
7769
7778
|
description: rejectedFiles[i].errors[0].message
|
|
7770
7779
|
});
|
|
@@ -8546,11 +8555,11 @@ function FormPlaceAutocomplete({
|
|
|
8546
8555
|
const data = await response.json();
|
|
8547
8556
|
if (data.suggestions) {
|
|
8548
8557
|
const formattedSuggestions = data.suggestions.map((suggestion) => ({
|
|
8549
|
-
place_id: _optionalChain([suggestion, 'access',
|
|
8550
|
-
description: _optionalChain([suggestion, 'access',
|
|
8558
|
+
place_id: _optionalChain([suggestion, 'access', _182 => _182.placePrediction, 'optionalAccess', _183 => _183.placeId]) || "",
|
|
8559
|
+
description: _optionalChain([suggestion, 'access', _184 => _184.placePrediction, 'optionalAccess', _185 => _185.text, 'optionalAccess', _186 => _186.text]) || "",
|
|
8551
8560
|
structured_formatting: {
|
|
8552
|
-
main_text: _optionalChain([suggestion, 'access',
|
|
8553
|
-
secondary_text: _optionalChain([suggestion, 'access',
|
|
8561
|
+
main_text: _optionalChain([suggestion, 'access', _187 => _187.placePrediction, 'optionalAccess', _188 => _188.structuredFormat, 'optionalAccess', _189 => _189.mainText, 'optionalAccess', _190 => _190.text]) || "",
|
|
8562
|
+
secondary_text: _optionalChain([suggestion, 'access', _191 => _191.placePrediction, 'optionalAccess', _192 => _192.structuredFormat, 'optionalAccess', _193 => _193.secondaryText, 'optionalAccess', _194 => _194.text]) || ""
|
|
8554
8563
|
}
|
|
8555
8564
|
}));
|
|
8556
8565
|
setSuggestions(formattedSuggestions);
|
|
@@ -8645,8 +8654,8 @@ function FormPlaceAutocomplete({
|
|
|
8645
8654
|
className: "hover:bg-muted cursor-pointer px-3 py-2 text-sm",
|
|
8646
8655
|
onClick: () => handleSuggestionSelect(suggestion),
|
|
8647
8656
|
children: [
|
|
8648
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "font-medium", children: _optionalChain([suggestion, 'access',
|
|
8649
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground", children: _optionalChain([suggestion, 'access',
|
|
8657
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "font-medium", children: _optionalChain([suggestion, 'access', _195 => _195.structured_formatting, 'optionalAccess', _196 => _196.main_text]) }),
|
|
8658
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground", children: _optionalChain([suggestion, 'access', _197 => _197.structured_formatting, 'optionalAccess', _198 => _198.secondary_text]) })
|
|
8650
8659
|
]
|
|
8651
8660
|
},
|
|
8652
8661
|
suggestion.place_id || index
|
|
@@ -8855,7 +8864,7 @@ function UserMultiSelect({
|
|
|
8855
8864
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
8856
8865
|
return _chunkUYBCHXXLjs.UserService.findAllUsers(params);
|
|
8857
8866
|
}, "retriever"),
|
|
8858
|
-
retrieverParams: { companyId: _optionalChain([company, 'optionalAccess',
|
|
8867
|
+
retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _199 => _199.id]) },
|
|
8859
8868
|
module: _chunkUYBCHXXLjs.Modules.User
|
|
8860
8869
|
});
|
|
8861
8870
|
_react.useEffect.call(void 0, () => {
|
|
@@ -8882,7 +8891,7 @@ function UserMultiSelect({
|
|
|
8882
8891
|
_react.useEffect.call(void 0, () => {
|
|
8883
8892
|
if (data.data && data.data.length > 0) {
|
|
8884
8893
|
const users = data.data;
|
|
8885
|
-
const filteredUsers = users.filter((user) => user.id !== _optionalChain([currentUser, 'optionalAccess',
|
|
8894
|
+
const filteredUsers = users.filter((user) => user.id !== _optionalChain([currentUser, 'optionalAccess', _200 => _200.id]));
|
|
8886
8895
|
const options = filteredUsers.map((user) => ({
|
|
8887
8896
|
label: user.name,
|
|
8888
8897
|
value: user.id,
|
|
@@ -8913,7 +8922,7 @@ function UserMultiSelect({
|
|
|
8913
8922
|
return existingUser;
|
|
8914
8923
|
}
|
|
8915
8924
|
const option = userOptions.find((option2) => option2.value === id2);
|
|
8916
|
-
if (_optionalChain([option, 'optionalAccess',
|
|
8925
|
+
if (_optionalChain([option, 'optionalAccess', _201 => _201.userData])) {
|
|
8917
8926
|
return {
|
|
8918
8927
|
id: option.userData.id,
|
|
8919
8928
|
name: option.userData.name,
|
|
@@ -8924,7 +8933,7 @@ function UserMultiSelect({
|
|
|
8924
8933
|
});
|
|
8925
8934
|
form.setValue(id, updatedSelectedUsers);
|
|
8926
8935
|
if (onChange) {
|
|
8927
|
-
const fullSelectedUsers = selectedIds.map((id2) => _optionalChain([userOptions, 'access',
|
|
8936
|
+
const fullSelectedUsers = selectedIds.map((id2) => _optionalChain([userOptions, 'access', _202 => _202.find, 'call', _203 => _203((option) => option.value === id2), 'optionalAccess', _204 => _204.userData])).filter(Boolean);
|
|
8928
8937
|
onChange(fullSelectedUsers);
|
|
8929
8938
|
}
|
|
8930
8939
|
}, "handleValueChange");
|
|
@@ -9072,7 +9081,7 @@ function UserAvatar({ user, className, showFull, showLink, showTooltip = true })
|
|
|
9072
9081
|
}, "getInitials");
|
|
9073
9082
|
const getAvatar = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
9074
9083
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "*:ring-border *:ring-1", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Avatar, { className: `h-6 w-6 ${className}`, children: [
|
|
9075
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarImage, { className: "object-cover", src: _optionalChain([user, 'optionalAccess',
|
|
9084
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarImage, { className: "object-cover", src: _optionalChain([user, 'optionalAccess', _205 => _205.avatar]) }),
|
|
9076
9085
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarFallback, { children: getInitials(user.name) })
|
|
9077
9086
|
] }) });
|
|
9078
9087
|
}, "getAvatar");
|
|
@@ -9154,10 +9163,10 @@ function UserSelector({ id, form, label, placeholder, onChange, isRequired = fal
|
|
|
9154
9163
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-row items-center justify-between", children: [
|
|
9155
9164
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PopoverTrigger, { className: "w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-row items-center justify-start rounded-md", children: field.value ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-row items-center justify-start rounded-md border p-2", children: [
|
|
9156
9165
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "*:ring-border *:ring-1", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Avatar, { className: `mr-2 h-6 w-6`, children: [
|
|
9157
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarImage, { src: _optionalChain([field, 'access',
|
|
9158
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarFallback, { children: _optionalChain([field, 'access',
|
|
9166
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarImage, { src: _optionalChain([field, 'access', _206 => _206.value, 'optionalAccess', _207 => _207.avatar]) }),
|
|
9167
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarFallback, { children: _optionalChain([field, 'access', _208 => _208.value, 'optionalAccess', _209 => _209.name]) ? _optionalChain([field, 'access', _210 => _210.value, 'optionalAccess', _211 => _211.name, 'access', _212 => _212.split, 'call', _213 => _213(" "), 'access', _214 => _214.map, 'call', _215 => _215((name) => name.charAt(0).toUpperCase())]) : "X" })
|
|
9159
9168
|
] }) }),
|
|
9160
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "", children: _nullishCoalesce(_optionalChain([field, 'access',
|
|
9169
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "", children: _nullishCoalesce(_optionalChain([field, 'access', _216 => _216.value, 'optionalAccess', _217 => _217.name]), () => ( "")) })
|
|
9161
9170
|
] }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground mr-7 flex h-10 w-full flex-row items-center justify-start rounded-md border p-2 text-sm", children: _nullishCoalesce(placeholder, () => ( t(`ui.search.placeholder`, { type: t(`entities.users`, { count: 1 }) }))) }) }) }),
|
|
9162
9171
|
field.value && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9163
9172
|
_lucidereact.CircleX,
|
|
@@ -9417,7 +9426,7 @@ function CompanyUsersList({ isDeleted }) {
|
|
|
9417
9426
|
const data = useDataListRetriever({
|
|
9418
9427
|
ready: !!company,
|
|
9419
9428
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkUYBCHXXLjs.UserService.findAllUsers(params), "retriever"),
|
|
9420
|
-
retrieverParams: { companyId: _optionalChain([company, 'optionalAccess',
|
|
9429
|
+
retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _218 => _218.id]), isDeleted },
|
|
9421
9430
|
module: _chunkUYBCHXXLjs.Modules.User
|
|
9422
9431
|
});
|
|
9423
9432
|
_react.useEffect.call(void 0, () => {
|
|
@@ -9523,11 +9532,11 @@ function UserListInAdd({ data, existingUsers, setSelectedUser, setLevelOpen }) {
|
|
|
9523
9532
|
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
9524
9533
|
onClick: (e) => {
|
|
9525
9534
|
setSelectedUser(user);
|
|
9526
|
-
_optionalChain([setLevelOpen, 'optionalCall',
|
|
9535
|
+
_optionalChain([setLevelOpen, 'optionalCall', _219 => _219(true)]);
|
|
9527
9536
|
},
|
|
9528
9537
|
onSelect: (e) => {
|
|
9529
9538
|
setSelectedUser(user);
|
|
9530
|
-
_optionalChain([setLevelOpen, 'optionalCall',
|
|
9539
|
+
_optionalChain([setLevelOpen, 'optionalCall', _220 => _220(true)]);
|
|
9531
9540
|
},
|
|
9532
9541
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-row items-center justify-between px-4 py-1", children: [
|
|
9533
9542
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserAvatar, { user }),
|
|
@@ -9809,8 +9818,8 @@ function CompanyConfigurationEditorInternal({ company }) {
|
|
|
9809
9818
|
const { setUser } = useCurrentUserContext();
|
|
9810
9819
|
const defaultValues = _react.useMemo.call(void 0, () => {
|
|
9811
9820
|
return {
|
|
9812
|
-
isManagedKnowledge: _nullishCoalesce(_optionalChain([company, 'access',
|
|
9813
|
-
allowPublicBot: _nullishCoalesce(_optionalChain([company, 'access',
|
|
9821
|
+
isManagedKnowledge: _nullishCoalesce(_optionalChain([company, 'access', _221 => _221.configurations, 'optionalAccess', _222 => _222.isManagedKnowledge]), () => ( false)),
|
|
9822
|
+
allowPublicBot: _nullishCoalesce(_optionalChain([company, 'access', _223 => _223.configurations, 'optionalAccess', _224 => _224.allowPublicBot]), () => ( false))
|
|
9814
9823
|
};
|
|
9815
9824
|
}, [company.configurations]);
|
|
9816
9825
|
const close = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
@@ -9829,8 +9838,8 @@ function CompanyConfigurationEditorInternal({ company }) {
|
|
|
9829
9838
|
_react.useEffect.call(void 0, () => {
|
|
9830
9839
|
if (open) {
|
|
9831
9840
|
form.reset({
|
|
9832
|
-
isManagedKnowledge: _nullishCoalesce(_optionalChain([company, 'access',
|
|
9833
|
-
allowPublicBot: _nullishCoalesce(_optionalChain([company, 'access',
|
|
9841
|
+
isManagedKnowledge: _nullishCoalesce(_optionalChain([company, 'access', _225 => _225.configurations, 'optionalAccess', _226 => _226.isManagedKnowledge]), () => ( false)),
|
|
9842
|
+
allowPublicBot: _nullishCoalesce(_optionalChain([company, 'access', _227 => _227.configurations, 'optionalAccess', _228 => _228.allowPublicBot]), () => ( false))
|
|
9834
9843
|
});
|
|
9835
9844
|
}
|
|
9836
9845
|
}, [company, open]);
|
|
@@ -10008,11 +10017,11 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
10008
10017
|
const form = _reacthookform.useForm.call(void 0, {
|
|
10009
10018
|
resolver: _zod.zodResolver.call(void 0, formSchema),
|
|
10010
10019
|
defaultValues: {
|
|
10011
|
-
id: _optionalChain([company, 'optionalAccess',
|
|
10012
|
-
name: _optionalChain([company, 'optionalAccess',
|
|
10013
|
-
featureIds: _optionalChain([company, 'optionalAccess',
|
|
10014
|
-
moduleIds: _optionalChain([company, 'optionalAccess',
|
|
10015
|
-
logo: _optionalChain([company, 'optionalAccess',
|
|
10020
|
+
id: _optionalChain([company, 'optionalAccess', _229 => _229.id]) || _uuid.v4.call(void 0, ),
|
|
10021
|
+
name: _optionalChain([company, 'optionalAccess', _230 => _230.name]) || "",
|
|
10022
|
+
featureIds: _optionalChain([company, 'optionalAccess', _231 => _231.features, 'access', _232 => _232.map, 'call', _233 => _233((feature) => feature.id)]) || [],
|
|
10023
|
+
moduleIds: _optionalChain([company, 'optionalAccess', _234 => _234.modules, 'access', _235 => _235.map, 'call', _236 => _236((module) => module.id)]) || [],
|
|
10024
|
+
logo: _optionalChain([company, 'optionalAccess', _237 => _237.logo]) || ""
|
|
10016
10025
|
}
|
|
10017
10026
|
});
|
|
10018
10027
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
|
|
@@ -10029,7 +10038,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
10029
10038
|
});
|
|
10030
10039
|
}
|
|
10031
10040
|
const payload = {
|
|
10032
|
-
id: _nullishCoalesce(_optionalChain([company, 'optionalAccess',
|
|
10041
|
+
id: _nullishCoalesce(_optionalChain([company, 'optionalAccess', _238 => _238.id]), () => ( _uuid.v4.call(void 0, ))),
|
|
10033
10042
|
name: values.name,
|
|
10034
10043
|
logo: files && contentType ? values.logo : void 0,
|
|
10035
10044
|
featureIds: values.featureIds,
|
|
@@ -10064,7 +10073,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
10064
10073
|
}
|
|
10065
10074
|
}
|
|
10066
10075
|
_chunk7QVYU63Ejs.__name.call(void 0, fetchFeatures, "fetchFeatures");
|
|
10067
|
-
if (open && features.length === 0 && (hasRole(_chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator) || hasRole(_chunkEW6QPMN3js.getRoleId.call(void 0, ).CompanyAdministrator) && _optionalChain([process, 'access',
|
|
10076
|
+
if (open && features.length === 0 && (hasRole(_chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator) || hasRole(_chunkEW6QPMN3js.getRoleId.call(void 0, ).CompanyAdministrator) && _optionalChain([process, 'access', _239 => _239.env, 'access', _240 => _240.NEXT_PUBLIC_PRIVATE_INSTALLATION, 'optionalAccess', _241 => _241.toLowerCase, 'call', _242 => _242()]) === "true"))
|
|
10068
10077
|
fetchFeatures();
|
|
10069
10078
|
}, [open, features]);
|
|
10070
10079
|
_react.useEffect.call(void 0, () => {
|
|
@@ -10098,7 +10107,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
10098
10107
|
"application/images": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"]
|
|
10099
10108
|
}
|
|
10100
10109
|
};
|
|
10101
|
-
const canAccessFeatures = hasRole(_chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator) || hasRole(_chunkEW6QPMN3js.getRoleId.call(void 0, ).CompanyAdministrator) && _optionalChain([process, 'access',
|
|
10110
|
+
const canAccessFeatures = hasRole(_chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator) || hasRole(_chunkEW6QPMN3js.getRoleId.call(void 0, ).CompanyAdministrator) && _optionalChain([process, 'access', _243 => _243.env, 'access', _244 => _244.NEXT_PUBLIC_PRIVATE_INSTALLATION, 'optionalAccess', _245 => _245.toLowerCase, 'call', _246 => _246()]) === "true";
|
|
10102
10111
|
const isAdministrator = hasRole(_chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator);
|
|
10103
10112
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Dialog, { open, onOpenChange: setOpen, children: [
|
|
10104
10113
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorTrigger, { isEdit: !!company }),
|
|
@@ -10107,13 +10116,13 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
10107
10116
|
{
|
|
10108
10117
|
className: `flex max-h-[70vh] w-full ${isAdministrator || canAccessFeatures ? `max-w-5xl` : `max-w-4xl`} flex-col overflow-y-auto`,
|
|
10109
10118
|
children: [
|
|
10110
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorHeader, { type: t(`entities.companies`, { count: 1 }), name: _optionalChain([company, 'optionalAccess',
|
|
10119
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorHeader, { type: t(`entities.companies`, { count: 1 }), name: _optionalChain([company, 'optionalAccess', _247 => _247.name]) }),
|
|
10111
10120
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: `flex w-full flex-col gap-y-4`, children: [
|
|
10112
10121
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full items-start justify-between gap-x-4", children: [
|
|
10113
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `flex w-96 flex-col justify-start gap-y-4`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FileUploader, { value: files, onValueChange: setFiles, dropzoneOptions: dropzone2, className: "w-full p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FileInput, { className: "text-neutral-300 outline-dashed", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col items-center justify-center pt-3 pb-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col items-center justify-center pt-3 pb-4", children: file || _optionalChain([company, 'optionalAccess',
|
|
10122
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `flex w-96 flex-col justify-start gap-y-4`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FileUploader, { value: files, onValueChange: setFiles, dropzoneOptions: dropzone2, className: "w-full p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FileInput, { className: "text-neutral-300 outline-dashed", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col items-center justify-center pt-3 pb-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col items-center justify-center pt-3 pb-4", children: file || _optionalChain([company, 'optionalAccess', _248 => _248.logo]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10114
10123
|
_image2.default,
|
|
10115
10124
|
{
|
|
10116
|
-
src: file ? URL.createObjectURL(file) : _optionalChain([company, 'optionalAccess',
|
|
10125
|
+
src: file ? URL.createObjectURL(file) : _optionalChain([company, 'optionalAccess', _249 => _249.logo]) || "",
|
|
10117
10126
|
alt: "Company Logo",
|
|
10118
10127
|
width: 200,
|
|
10119
10128
|
height: 200
|
|
@@ -10248,7 +10257,7 @@ function NotificationToast(notification, t, generateUrl, reouter) {
|
|
|
10248
10257
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col", children: [
|
|
10249
10258
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: t.rich(`notification.${notification.notificationType}.description`, {
|
|
10250
10259
|
strong: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: chunks }), "strong"),
|
|
10251
|
-
actor: _nullishCoalesce(_optionalChain([data, 'access',
|
|
10260
|
+
actor: _nullishCoalesce(_optionalChain([data, 'access', _250 => _250.actor, 'optionalAccess', _251 => _251.name]), () => ( "")),
|
|
10252
10261
|
title: data.title,
|
|
10253
10262
|
message: _nullishCoalesce(notification.message, () => ( ""))
|
|
10254
10263
|
}) }),
|
|
@@ -10277,7 +10286,7 @@ function NotificationMenuItem({ notification, closePopover }) {
|
|
|
10277
10286
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col", children: [
|
|
10278
10287
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: t.rich(`notification.${notification.notificationType}.description`, {
|
|
10279
10288
|
strong: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: chunks }), "strong"),
|
|
10280
|
-
actor: _nullishCoalesce(_optionalChain([data, 'access',
|
|
10289
|
+
actor: _nullishCoalesce(_optionalChain([data, 'access', _252 => _252.actor, 'optionalAccess', _253 => _253.name]), () => ( "")),
|
|
10281
10290
|
title: data.title,
|
|
10282
10291
|
message: _nullishCoalesce(notification.message, () => ( ""))
|
|
10283
10292
|
}) }),
|
|
@@ -10299,6 +10308,8 @@ var NotificationContextProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(v
|
|
|
10299
10308
|
const [isLoading, setIsLoading] = _react.useState.call(void 0, false);
|
|
10300
10309
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
10301
10310
|
const [lastLoaded, setLastLoaded] = _react.useState.call(void 0, 0);
|
|
10311
|
+
const [hasInitiallyLoaded, setHasInitiallyLoaded] = _react.useState.call(void 0, false);
|
|
10312
|
+
const { currentUser } = useCurrentUserContext();
|
|
10302
10313
|
const shouldRefresh = Date.now() - lastLoaded > 5 * 60 * 1e3;
|
|
10303
10314
|
const addNotification = _react.useCallback.call(void 0, (notification) => {
|
|
10304
10315
|
setNotifications((prev) => {
|
|
@@ -10329,6 +10340,20 @@ var NotificationContextProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(v
|
|
|
10329
10340
|
setIsLoading(false);
|
|
10330
10341
|
}
|
|
10331
10342
|
}, []);
|
|
10343
|
+
_react.useEffect.call(void 0, () => {
|
|
10344
|
+
if (hasInitiallyLoaded || !currentUser) return;
|
|
10345
|
+
if (_chunkEW6QPMN3js.isRolesConfigured.call(void 0, )) {
|
|
10346
|
+
const isAdmin = _optionalChain([currentUser, 'access', _254 => _254.roles, 'optionalAccess', _255 => _255.some, 'call', _256 => _256(
|
|
10347
|
+
(role) => role.id === _chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator
|
|
10348
|
+
)]);
|
|
10349
|
+
if (isAdmin) {
|
|
10350
|
+
setHasInitiallyLoaded(true);
|
|
10351
|
+
return;
|
|
10352
|
+
}
|
|
10353
|
+
}
|
|
10354
|
+
loadNotifications();
|
|
10355
|
+
setHasInitiallyLoaded(true);
|
|
10356
|
+
}, [currentUser, hasInitiallyLoaded, loadNotifications]);
|
|
10332
10357
|
const markNotificationsAsRead = _react.useCallback.call(void 0, async (ids) => {
|
|
10333
10358
|
setIsLoading(true);
|
|
10334
10359
|
setError(null);
|
|
@@ -10551,7 +10576,7 @@ function usePageTracker() {
|
|
|
10551
10576
|
if (typeof document !== "undefined") {
|
|
10552
10577
|
const titleParts = document.title.split("]");
|
|
10553
10578
|
if (titleParts[1]) {
|
|
10554
|
-
const cleanTitle = _optionalChain([titleParts, 'access',
|
|
10579
|
+
const cleanTitle = _optionalChain([titleParts, 'access', _257 => _257[1], 'access', _258 => _258.split, 'call', _259 => _259("|"), 'access', _260 => _260[0], 'optionalAccess', _261 => _261.trim, 'call', _262 => _262()]);
|
|
10555
10580
|
pageTitle = cleanTitle || foundModule.name;
|
|
10556
10581
|
}
|
|
10557
10582
|
}
|
|
@@ -10588,7 +10613,7 @@ function usePushNotifications() {
|
|
|
10588
10613
|
const register = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
10589
10614
|
if ("serviceWorker" in navigator && "PushManager" in window) {
|
|
10590
10615
|
try {
|
|
10591
|
-
const sessionKey = `push_registered_${_optionalChain([currentUser, 'optionalAccess',
|
|
10616
|
+
const sessionKey = `push_registered_${_optionalChain([currentUser, 'optionalAccess', _263 => _263.id])}`;
|
|
10592
10617
|
const lastRegisteredSubscription = sessionStorage.getItem(sessionKey);
|
|
10593
10618
|
const registration = await navigator.serviceWorker.register(`${_chunkEW6QPMN3js.getAppUrl.call(void 0, )}/sw.js`);
|
|
10594
10619
|
let permission = Notification.permission;
|
|
@@ -10642,7 +10667,7 @@ function useSocket({ token }) {
|
|
|
10642
10667
|
const socketRef = _react.useRef.call(void 0, null);
|
|
10643
10668
|
_react.useEffect.call(void 0, () => {
|
|
10644
10669
|
if (!token) return;
|
|
10645
|
-
const globalSocketKey = `__socket_${_optionalChain([process, 'access',
|
|
10670
|
+
const globalSocketKey = `__socket_${_optionalChain([process, 'access', _264 => _264.env, 'access', _265 => _265.NEXT_PUBLIC_API_URL, 'optionalAccess', _266 => _266.replace, 'call', _267 => _267(/[^a-zA-Z0-9]/g, "_")])}`;
|
|
10646
10671
|
if (typeof window !== "undefined") {
|
|
10647
10672
|
const _allSocketKeys = Object.keys(window).filter((key) => key.startsWith("__socket_"));
|
|
10648
10673
|
const existingSocket = window[globalSocketKey];
|
|
@@ -11121,7 +11146,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, AllowedUsersDetails, "AllowedUsersDetails")
|
|
|
11121
11146
|
var _dynamic = require('next/dynamic'); var _dynamic2 = _interopRequireDefault(_dynamic);
|
|
11122
11147
|
|
|
11123
11148
|
|
|
11124
|
-
var BlockNoteEditor = _dynamic2.default.call(void 0, () => Promise.resolve().then(() => _interopRequireWildcard(require("./BlockNoteEditor-
|
|
11149
|
+
var BlockNoteEditor = _dynamic2.default.call(void 0, () => Promise.resolve().then(() => _interopRequireWildcard(require("./BlockNoteEditor-6U5KIP4Q.js"))), {
|
|
11125
11150
|
ssr: false
|
|
11126
11151
|
});
|
|
11127
11152
|
var BlockNoteEditorContainer = React3.default.memo(/* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, function EditorContainer(props) {
|
|
@@ -11246,10 +11271,10 @@ var cellId = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
|
11246
11271
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => params.toggleId ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
11247
11272
|
Checkbox,
|
|
11248
11273
|
{
|
|
11249
|
-
checked: _optionalChain([params, 'access',
|
|
11274
|
+
checked: _optionalChain([params, 'access', _268 => _268.checkedIds, 'optionalAccess', _269 => _269.includes, 'call', _270 => _270(row.getValue(params.name))]) || false,
|
|
11250
11275
|
onCheckedChange: (value) => {
|
|
11251
11276
|
row.toggleSelected(!!value);
|
|
11252
|
-
_optionalChain([params, 'access',
|
|
11277
|
+
_optionalChain([params, 'access', _271 => _271.toggleId, 'optionalCall', _272 => _272(row.getValue(params.name))]);
|
|
11253
11278
|
},
|
|
11254
11279
|
"aria-label": "Select row"
|
|
11255
11280
|
}
|
|
@@ -11308,7 +11333,7 @@ function useJsonApiGet(params) {
|
|
|
11308
11333
|
const [response, setResponse] = _react.useState.call(void 0, null);
|
|
11309
11334
|
const isMounted = _react.useRef.call(void 0, true);
|
|
11310
11335
|
const fetchData = _react.useCallback.call(void 0, async () => {
|
|
11311
|
-
if (_optionalChain([params, 'access',
|
|
11336
|
+
if (_optionalChain([params, 'access', _273 => _273.options, 'optionalAccess', _274 => _274.enabled]) === false) return;
|
|
11312
11337
|
setLoading(true);
|
|
11313
11338
|
setError(null);
|
|
11314
11339
|
try {
|
|
@@ -11335,9 +11360,9 @@ function useJsonApiGet(params) {
|
|
|
11335
11360
|
setLoading(false);
|
|
11336
11361
|
}
|
|
11337
11362
|
}
|
|
11338
|
-
}, [params.classKey, params.endpoint, params.companyId, _optionalChain([params, 'access',
|
|
11363
|
+
}, [params.classKey, params.endpoint, params.companyId, _optionalChain([params, 'access', _275 => _275.options, 'optionalAccess', _276 => _276.enabled])]);
|
|
11339
11364
|
const fetchNextPage = _react.useCallback.call(void 0, async () => {
|
|
11340
|
-
if (!_optionalChain([response, 'optionalAccess',
|
|
11365
|
+
if (!_optionalChain([response, 'optionalAccess', _277 => _277.nextPage])) return;
|
|
11341
11366
|
setLoading(true);
|
|
11342
11367
|
try {
|
|
11343
11368
|
const nextResponse = await response.nextPage();
|
|
@@ -11358,7 +11383,7 @@ function useJsonApiGet(params) {
|
|
|
11358
11383
|
}
|
|
11359
11384
|
}, [response]);
|
|
11360
11385
|
const fetchPreviousPage = _react.useCallback.call(void 0, async () => {
|
|
11361
|
-
if (!_optionalChain([response, 'optionalAccess',
|
|
11386
|
+
if (!_optionalChain([response, 'optionalAccess', _278 => _278.prevPage])) return;
|
|
11362
11387
|
setLoading(true);
|
|
11363
11388
|
try {
|
|
11364
11389
|
const prevResponse = await response.prevPage();
|
|
@@ -11384,15 +11409,15 @@ function useJsonApiGet(params) {
|
|
|
11384
11409
|
return () => {
|
|
11385
11410
|
isMounted.current = false;
|
|
11386
11411
|
};
|
|
11387
|
-
}, [fetchData, ..._optionalChain([params, 'access',
|
|
11412
|
+
}, [fetchData, ..._optionalChain([params, 'access', _279 => _279.options, 'optionalAccess', _280 => _280.deps]) || []]);
|
|
11388
11413
|
return {
|
|
11389
11414
|
data,
|
|
11390
11415
|
loading,
|
|
11391
11416
|
error,
|
|
11392
11417
|
response,
|
|
11393
11418
|
refetch: fetchData,
|
|
11394
|
-
hasNextPage: !!_optionalChain([response, 'optionalAccess',
|
|
11395
|
-
hasPreviousPage: !!_optionalChain([response, 'optionalAccess',
|
|
11419
|
+
hasNextPage: !!_optionalChain([response, 'optionalAccess', _281 => _281.next]),
|
|
11420
|
+
hasPreviousPage: !!_optionalChain([response, 'optionalAccess', _282 => _282.prev]),
|
|
11396
11421
|
fetchNextPage,
|
|
11397
11422
|
fetchPreviousPage
|
|
11398
11423
|
};
|
|
@@ -11470,17 +11495,17 @@ function useJsonApiMutation(config) {
|
|
|
11470
11495
|
if (apiResponse.ok) {
|
|
11471
11496
|
const resultData = apiResponse.data;
|
|
11472
11497
|
setData(resultData);
|
|
11473
|
-
_optionalChain([config, 'access',
|
|
11498
|
+
_optionalChain([config, 'access', _283 => _283.onSuccess, 'optionalCall', _284 => _284(resultData)]);
|
|
11474
11499
|
return resultData;
|
|
11475
11500
|
} else {
|
|
11476
11501
|
setError(apiResponse.error);
|
|
11477
|
-
_optionalChain([config, 'access',
|
|
11502
|
+
_optionalChain([config, 'access', _285 => _285.onError, 'optionalCall', _286 => _286(apiResponse.error)]);
|
|
11478
11503
|
return null;
|
|
11479
11504
|
}
|
|
11480
11505
|
} catch (err) {
|
|
11481
11506
|
const errorMessage = err instanceof Error ? err.message : "Unknown error";
|
|
11482
11507
|
setError(errorMessage);
|
|
11483
|
-
_optionalChain([config, 'access',
|
|
11508
|
+
_optionalChain([config, 'access', _287 => _287.onError, 'optionalCall', _288 => _288(errorMessage)]);
|
|
11484
11509
|
return null;
|
|
11485
11510
|
} finally {
|
|
11486
11511
|
setLoading(false);
|
|
@@ -11553,7 +11578,7 @@ var useCompanyTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
11553
11578
|
{
|
|
11554
11579
|
href: hasRole(_chunkEW6QPMN3js.getRoleId.call(void 0, ).Administrator) ? generateUrl({
|
|
11555
11580
|
page: "/administration",
|
|
11556
|
-
id: _optionalChain([_chunkUYBCHXXLjs.Modules, 'access',
|
|
11581
|
+
id: _optionalChain([_chunkUYBCHXXLjs.Modules, 'access', _289 => _289.Company, 'access', _290 => _290.pageUrl, 'optionalAccess', _291 => _291.substring, 'call', _292 => _292(1)]),
|
|
11557
11582
|
childPage: company.id
|
|
11558
11583
|
}) : generateUrl({ page: _chunkUYBCHXXLjs.Modules.Company, id: company.id }),
|
|
11559
11584
|
children: row.getValue("name")
|
|
@@ -11569,7 +11594,7 @@ var useCompanyTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
11569
11594
|
})
|
|
11570
11595
|
};
|
|
11571
11596
|
const columns = _react.useMemo.call(void 0, () => {
|
|
11572
|
-
return params.fields.map((field) => _optionalChain([fieldColumnMap, 'access',
|
|
11597
|
+
return params.fields.map((field) => _optionalChain([fieldColumnMap, 'access', _293 => _293[field], 'optionalCall', _294 => _294()])).filter((col) => col !== void 0);
|
|
11573
11598
|
}, [params.fields, fieldColumnMap, t, generateUrl, hasRole]);
|
|
11574
11599
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
11575
11600
|
}, "useCompanyTableStructure");
|
|
@@ -11675,7 +11700,7 @@ var useRoleTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0,
|
|
|
11675
11700
|
})
|
|
11676
11701
|
};
|
|
11677
11702
|
const columns = _react.useMemo.call(void 0, () => {
|
|
11678
|
-
return params.fields.map((field) => _optionalChain([fieldColumnMap, 'access',
|
|
11703
|
+
return params.fields.map((field) => _optionalChain([fieldColumnMap, 'access', _295 => _295[field], 'optionalCall', _296 => _296()])).filter((col) => col !== void 0);
|
|
11679
11704
|
}, [params.fields, fieldColumnMap, t, generateUrl]);
|
|
11680
11705
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
11681
11706
|
}, "useRoleTableStructure");
|
|
@@ -11818,7 +11843,7 @@ var useUserTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0,
|
|
|
11818
11843
|
})
|
|
11819
11844
|
};
|
|
11820
11845
|
const columns = _react.useMemo.call(void 0, () => {
|
|
11821
|
-
return params.fields.map((field) => _optionalChain([fieldColumnMap, 'access',
|
|
11846
|
+
return params.fields.map((field) => _optionalChain([fieldColumnMap, 'access', _297 => _297[field], 'optionalCall', _298 => _298()])).filter((col) => col !== void 0);
|
|
11822
11847
|
}, [params.fields, fieldColumnMap, t, generateUrl]);
|
|
11823
11848
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
11824
11849
|
}, "useUserTableStructure");
|
|
@@ -11919,11 +11944,11 @@ var useContentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
11919
11944
|
return params.fields.map((field) => {
|
|
11920
11945
|
const localHandler = fieldColumnMap[field];
|
|
11921
11946
|
if (localHandler) return localHandler();
|
|
11922
|
-
const customHandler = _optionalChain([params, 'access',
|
|
11947
|
+
const customHandler = _optionalChain([params, 'access', _299 => _299.context, 'optionalAccess', _300 => _300.customCells, 'optionalAccess', _301 => _301[field]]);
|
|
11923
11948
|
if (customHandler) return customHandler({ t });
|
|
11924
11949
|
return void 0;
|
|
11925
11950
|
}).filter((col) => col !== void 0);
|
|
11926
|
-
}, [params.fields, fieldColumnMap, t, generateUrl, _optionalChain([params, 'access',
|
|
11951
|
+
}, [params.fields, fieldColumnMap, t, generateUrl, _optionalChain([params, 'access', _302 => _302.context, 'optionalAccess', _303 => _303.customCells])]);
|
|
11927
11952
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
11928
11953
|
}, "useContentTableStructure");
|
|
11929
11954
|
|
|
@@ -12258,7 +12283,7 @@ function ContentTableSearch({ data }) {
|
|
|
12258
12283
|
const handleSearchIconClick = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
12259
12284
|
if (!isExpanded) {
|
|
12260
12285
|
setIsFocused(true);
|
|
12261
|
-
setTimeout(() => _optionalChain([inputRef, 'access',
|
|
12286
|
+
setTimeout(() => _optionalChain([inputRef, 'access', _304 => _304.current, 'optionalAccess', _305 => _305.focus, 'call', _306 => _306()]), 50);
|
|
12262
12287
|
}
|
|
12263
12288
|
}, "handleSearchIconClick");
|
|
12264
12289
|
const handleBlur = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
@@ -12321,7 +12346,7 @@ var EMPTY_ARRAY = [];
|
|
|
12321
12346
|
var ContentListTable = _react.memo.call(void 0, /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, function ContentListTable2(props) {
|
|
12322
12347
|
const { data, fields, checkedIds, toggleId, allowSearch, filters } = props;
|
|
12323
12348
|
const { data: tableData, columns: tableColumns } = useTableGenerator(props.tableGeneratorType, {
|
|
12324
|
-
data: _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
12349
|
+
data: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _307 => _307.data]), () => ( EMPTY_ARRAY)),
|
|
12325
12350
|
fields,
|
|
12326
12351
|
checkedIds,
|
|
12327
12352
|
toggleId,
|
|
@@ -12362,7 +12387,7 @@ var ContentListTable = _react.memo.call(void 0, /* @__PURE__ */ _chunk7QVYU63Ejs
|
|
|
12362
12387
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TableHead, { children: header.isPlaceholder ? null : _reacttable.flexRender.call(void 0, header.column.columnDef.header, header.getContext()) }, header.id);
|
|
12363
12388
|
}) }, headerGroup.id))
|
|
12364
12389
|
] }),
|
|
12365
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TableBody, { children: rowModel && _optionalChain([rowModel, 'access',
|
|
12390
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TableBody, { children: rowModel && _optionalChain([rowModel, 'access', _308 => _308.rows, 'optionalAccess', _309 => _309.length]) ? rowModel.rows.map((row) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TableCell, { children: _reacttable.flexRender.call(void 0, cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TableRow, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TableCell, { colSpan: tableColumns.length, className: "h-24 text-center", children: "No results." }) }) }),
|
|
12366
12391
|
showFooter && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TableFooter, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TableRow, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TableCell, { colSpan: tableColumns.length, className: "bg-card py-4 text-right", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-end space-x-2", children: [
|
|
12367
12392
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
12368
12393
|
Button,
|
|
@@ -12371,7 +12396,7 @@ var ContentListTable = _react.memo.call(void 0, /* @__PURE__ */ _chunk7QVYU63Ejs
|
|
|
12371
12396
|
size: "sm",
|
|
12372
12397
|
onClick: (e) => {
|
|
12373
12398
|
e.preventDefault();
|
|
12374
|
-
_optionalChain([data, 'access',
|
|
12399
|
+
_optionalChain([data, 'access', _310 => _310.previous, 'optionalCall', _311 => _311(true)]);
|
|
12375
12400
|
},
|
|
12376
12401
|
disabled: !data.previous,
|
|
12377
12402
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronLeft, { className: "h-4 w-4" })
|
|
@@ -12389,7 +12414,7 @@ var ContentListTable = _react.memo.call(void 0, /* @__PURE__ */ _chunk7QVYU63Ejs
|
|
|
12389
12414
|
size: "sm",
|
|
12390
12415
|
onClick: (e) => {
|
|
12391
12416
|
e.preventDefault();
|
|
12392
|
-
_optionalChain([data, 'access',
|
|
12417
|
+
_optionalChain([data, 'access', _312 => _312.next, 'optionalCall', _313 => _313(true)]);
|
|
12393
12418
|
},
|
|
12394
12419
|
disabled: !data.next,
|
|
12395
12420
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronRight, { className: "h-4 w-4" })
|
|
@@ -12684,9 +12709,9 @@ function AcceptInvitation() {
|
|
|
12684
12709
|
});
|
|
12685
12710
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
|
|
12686
12711
|
try {
|
|
12687
|
-
if (!_optionalChain([params, 'optionalAccess',
|
|
12712
|
+
if (!_optionalChain([params, 'optionalAccess', _314 => _314.code])) return;
|
|
12688
12713
|
const payload = {
|
|
12689
|
-
code: _optionalChain([params, 'optionalAccess',
|
|
12714
|
+
code: _optionalChain([params, 'optionalAccess', _315 => _315.code]),
|
|
12690
12715
|
password: values.password
|
|
12691
12716
|
};
|
|
12692
12717
|
await _chunkUYBCHXXLjs.AuthService.acceptInvitation(payload);
|
|
@@ -13012,14 +13037,14 @@ function RefreshUser() {
|
|
|
13012
13037
|
setUser(fullUser);
|
|
13013
13038
|
const token = {
|
|
13014
13039
|
userId: fullUser.id,
|
|
13015
|
-
companyId: _optionalChain([fullUser, 'access',
|
|
13040
|
+
companyId: _optionalChain([fullUser, 'access', _316 => _316.company, 'optionalAccess', _317 => _317.id]),
|
|
13016
13041
|
roles: fullUser.roles.map((role) => role.id),
|
|
13017
|
-
features: _nullishCoalesce(_optionalChain([fullUser, 'access',
|
|
13042
|
+
features: _nullishCoalesce(_optionalChain([fullUser, 'access', _318 => _318.company, 'optionalAccess', _319 => _319.features, 'optionalAccess', _320 => _320.map, 'call', _321 => _321((feature) => feature.id)]), () => ( [])),
|
|
13018
13043
|
modules: fullUser.modules.map((module) => {
|
|
13019
13044
|
return { id: module.id, permissions: module.permissions };
|
|
13020
13045
|
})
|
|
13021
13046
|
};
|
|
13022
|
-
await _optionalChain([_chunkUYBCHXXLjs.getTokenHandler.call(void 0, ), 'optionalAccess',
|
|
13047
|
+
await _optionalChain([_chunkUYBCHXXLjs.getTokenHandler.call(void 0, ), 'optionalAccess', _322 => _322.updateToken, 'call', _323 => _323(token)]);
|
|
13023
13048
|
_cookiesnext.deleteCookie.call(void 0, "reloadData");
|
|
13024
13049
|
}
|
|
13025
13050
|
}, "loadFullUser");
|
|
@@ -13084,9 +13109,9 @@ function ResetPassword() {
|
|
|
13084
13109
|
});
|
|
13085
13110
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
|
|
13086
13111
|
try {
|
|
13087
|
-
if (!_optionalChain([params, 'optionalAccess',
|
|
13112
|
+
if (!_optionalChain([params, 'optionalAccess', _324 => _324.code])) return;
|
|
13088
13113
|
const payload = {
|
|
13089
|
-
code: _optionalChain([params, 'optionalAccess',
|
|
13114
|
+
code: _optionalChain([params, 'optionalAccess', _325 => _325.code]),
|
|
13090
13115
|
password: values.password
|
|
13091
13116
|
};
|
|
13092
13117
|
await _chunkUYBCHXXLjs.AuthService.resetPassword(payload);
|
|
@@ -13256,14 +13281,14 @@ function NotificationsList({ archived }) {
|
|
|
13256
13281
|
] }),
|
|
13257
13282
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Skeleton, { className: "h-8 w-20" })
|
|
13258
13283
|
] }) }) }, i)) }), "LoadingSkeleton");
|
|
13259
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-4", children: data.isLoaded ? _optionalChain([data, 'access',
|
|
13284
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-4", children: data.isLoaded ? _optionalChain([data, 'access', _326 => _326.data, 'optionalAccess', _327 => _327.map, 'call', _328 => _328((notification) => {
|
|
13260
13285
|
const notificationData = generateNotificationData({ notification, generateUrl });
|
|
13261
13286
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CardContent, { className: "p-0", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `flex w-full flex-row items-center p-2`, children: [
|
|
13262
13287
|
notificationData.actor ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-12 max-w-12 px-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Link, { href: generateUrl({ page: _chunkUYBCHXXLjs.Modules.User, id: notificationData.actor.id }), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserAvatar, { user: notificationData.actor, className: "h-8 w-8" }) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-14 max-w-14 px-2" }),
|
|
13263
13288
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col", children: [
|
|
13264
13289
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: t.rich(`notification.${notification.notificationType}.description`, {
|
|
13265
13290
|
strong: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: chunks }), "strong"),
|
|
13266
|
-
actor: _nullishCoalesce(_optionalChain([notificationData, 'access',
|
|
13291
|
+
actor: _nullishCoalesce(_optionalChain([notificationData, 'access', _329 => _329.actor, 'optionalAccess', _330 => _330.name]), () => ( "")),
|
|
13267
13292
|
title: notificationData.title
|
|
13268
13293
|
}) }),
|
|
13269
13294
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground mt-1 w-full text-xs", children: new Date(notification.createdAt).toLocaleString() })
|
|
@@ -14158,7 +14183,7 @@ function OAuthClientList({
|
|
|
14158
14183
|
OAuthClientCard,
|
|
14159
14184
|
{
|
|
14160
14185
|
client,
|
|
14161
|
-
onClick: () => _optionalChain([onClientClick, 'optionalCall',
|
|
14186
|
+
onClick: () => _optionalChain([onClientClick, 'optionalCall', _331 => _331(client)]),
|
|
14162
14187
|
onEdit: onEditClick ? () => onEditClick(client) : void 0,
|
|
14163
14188
|
onDelete: onDeleteClick ? () => onDeleteClick(client) : void 0
|
|
14164
14189
|
},
|
|
@@ -14179,11 +14204,11 @@ function OAuthClientForm({
|
|
|
14179
14204
|
}) {
|
|
14180
14205
|
const isEditMode = !!client;
|
|
14181
14206
|
const [formState, setFormState] = _react.useState.call(void 0, {
|
|
14182
|
-
name: _optionalChain([client, 'optionalAccess',
|
|
14183
|
-
description: _optionalChain([client, 'optionalAccess',
|
|
14184
|
-
redirectUris: _optionalChain([client, 'optionalAccess',
|
|
14185
|
-
allowedScopes: _optionalChain([client, 'optionalAccess',
|
|
14186
|
-
isConfidential: _nullishCoalesce(_optionalChain([client, 'optionalAccess',
|
|
14207
|
+
name: _optionalChain([client, 'optionalAccess', _332 => _332.name]) || "",
|
|
14208
|
+
description: _optionalChain([client, 'optionalAccess', _333 => _333.description]) || "",
|
|
14209
|
+
redirectUris: _optionalChain([client, 'optionalAccess', _334 => _334.redirectUris, 'optionalAccess', _335 => _335.length]) ? client.redirectUris : [""],
|
|
14210
|
+
allowedScopes: _optionalChain([client, 'optionalAccess', _336 => _336.allowedScopes]) || [],
|
|
14211
|
+
isConfidential: _nullishCoalesce(_optionalChain([client, 'optionalAccess', _337 => _337.isConfidential]), () => ( true))
|
|
14187
14212
|
});
|
|
14188
14213
|
const [errors, setErrors] = _react.useState.call(void 0, {});
|
|
14189
14214
|
const validate = _react.useCallback.call(void 0, () => {
|
|
@@ -14411,7 +14436,7 @@ function OAuthClientDetail({
|
|
|
14411
14436
|
] }),
|
|
14412
14437
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
14413
14438
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Label, { children: "Allowed Scopes" }),
|
|
14414
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap gap-2", children: client.allowedScopes.map((scope) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Badge, { variant: "secondary", children: _optionalChain([_chunkUYBCHXXLjs.OAUTH_SCOPE_DISPLAY, 'access',
|
|
14439
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap gap-2", children: client.allowedScopes.map((scope) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Badge, { variant: "secondary", children: _optionalChain([_chunkUYBCHXXLjs.OAUTH_SCOPE_DISPLAY, 'access', _338 => _338[scope], 'optionalAccess', _339 => _339.name]) || scope }, scope)) })
|
|
14415
14440
|
] }),
|
|
14416
14441
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
14417
14442
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Label, { children: "Grant Types" }),
|
|
@@ -14612,7 +14637,7 @@ function OAuthConsentScreen({
|
|
|
14612
14637
|
if (error || !clientInfo) {
|
|
14613
14638
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "min-h-screen flex items-center justify-center p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Card, { className: "w-full max-w-md", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CardContent, { className: "py-8", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Alert, { variant: "destructive", children: [
|
|
14614
14639
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AlertTriangle, { className: "h-4 w-4" }),
|
|
14615
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AlertDescription, { children: _optionalChain([error, 'optionalAccess',
|
|
14640
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AlertDescription, { children: _optionalChain([error, 'optionalAccess', _340 => _340.message]) || "Invalid authorization request. Please try again." })
|
|
14616
14641
|
] }) }) }) });
|
|
14617
14642
|
}
|
|
14618
14643
|
const { client, scopes } = clientInfo;
|
|
@@ -15076,4 +15101,4 @@ _chunk7QVYU63Ejs.__name.call(void 0, OAuthConsentScreen, "OAuthConsentScreen");
|
|
|
15076
15101
|
|
|
15077
15102
|
|
|
15078
15103
|
exports.JsonApiProvider = JsonApiProvider; exports.useJsonApiGet = useJsonApiGet; exports.useJsonApiMutation = useJsonApiMutation; exports.useRehydration = useRehydration; exports.useRehydrationList = useRehydrationList; exports.TableGeneratorRegistry = TableGeneratorRegistry; exports.tableGeneratorRegistry = tableGeneratorRegistry; exports.usePageUrlGenerator = usePageUrlGenerator; exports.useUrlRewriter = useUrlRewriter; exports.useDataListRetriever = useDataListRetriever; exports.useDebounce = useDebounce; exports.registerTableGenerator = registerTableGenerator; exports.useTableGenerator = useTableGenerator; exports.useCustomD3Graph = useCustomD3Graph; exports.SocketContext = SocketContext; exports.SocketProvider = SocketProvider; exports.useSocketContext = useSocketContext; exports.CurrentUserProvider = CurrentUserProvider; exports.useCurrentUserContext = useCurrentUserContext; exports.HeaderChildrenProvider = HeaderChildrenProvider; exports.useHeaderChildren = useHeaderChildren; exports.Accordion = Accordion; exports.AccordionItem = AccordionItem; exports.AccordionTrigger = AccordionTrigger; exports.AccordionContent = AccordionContent; exports.Alert = Alert; exports.AlertTitle = AlertTitle; exports.AlertDescription = AlertDescription; exports.AlertAction = AlertAction; exports.buttonVariants = buttonVariants; exports.Button = Button; exports.AlertDialog = AlertDialog; exports.AlertDialogTrigger = AlertDialogTrigger; exports.AlertDialogPortal = AlertDialogPortal; exports.AlertDialogOverlay = AlertDialogOverlay; exports.AlertDialogContent = AlertDialogContent; exports.AlertDialogHeader = AlertDialogHeader; exports.AlertDialogFooter = AlertDialogFooter; exports.AlertDialogMedia = AlertDialogMedia; exports.AlertDialogTitle = AlertDialogTitle; exports.AlertDialogDescription = AlertDialogDescription; exports.AlertDialogAction = AlertDialogAction; exports.AlertDialogCancel = AlertDialogCancel; exports.Avatar = Avatar; exports.AvatarImage = AvatarImage; exports.AvatarFallback = AvatarFallback; exports.AvatarBadge = AvatarBadge; exports.AvatarGroup = AvatarGroup; exports.AvatarGroupCount = AvatarGroupCount; exports.badgeVariants = badgeVariants; exports.Badge = Badge; exports.Breadcrumb = Breadcrumb; exports.BreadcrumbList = BreadcrumbList; exports.BreadcrumbItem = BreadcrumbItem; exports.BreadcrumbLink = BreadcrumbLink; exports.BreadcrumbPage = BreadcrumbPage; exports.BreadcrumbSeparator = BreadcrumbSeparator; exports.BreadcrumbEllipsis = BreadcrumbEllipsis; exports.Calendar = Calendar; exports.CalendarDayButton = CalendarDayButton; exports.Card = Card; exports.CardHeader = CardHeader; exports.CardTitle = CardTitle; exports.CardDescription = CardDescription; exports.CardAction = CardAction; exports.CardContent = CardContent; exports.CardFooter = CardFooter; exports.useCarousel = useCarousel; exports.Carousel = Carousel; exports.CarouselContent = CarouselContent; exports.CarouselItem = CarouselItem; exports.CarouselPrevious = CarouselPrevious; exports.CarouselNext = CarouselNext; exports.ChartContainer = ChartContainer; exports.ChartStyle = ChartStyle; exports.ChartTooltip = ChartTooltip; exports.ChartTooltipContent = ChartTooltipContent; exports.ChartLegend = ChartLegend; exports.ChartLegendContent = ChartLegendContent; exports.Checkbox = Checkbox; exports.Collapsible = Collapsible; exports.CollapsibleTrigger = CollapsibleTrigger; exports.CollapsibleContent = CollapsibleContent; exports.Dialog = Dialog; exports.DialogTrigger = DialogTrigger; exports.DialogPortal = DialogPortal; exports.DialogClose = DialogClose; exports.DialogOverlay = DialogOverlay; exports.DialogContent = DialogContent; exports.DialogHeader = DialogHeader; exports.DialogFooter = DialogFooter; exports.DialogTitle = DialogTitle; exports.DialogDescription = DialogDescription; exports.Input = Input; exports.Textarea = Textarea; exports.InputGroup = InputGroup; exports.InputGroupAddon = InputGroupAddon; exports.InputGroupButton = InputGroupButton; exports.InputGroupText = InputGroupText; exports.InputGroupInput = InputGroupInput; exports.InputGroupTextarea = InputGroupTextarea; exports.Command = Command; exports.CommandDialog = CommandDialog; exports.CommandInput = CommandInput; exports.CommandList = CommandList; exports.CommandEmpty = CommandEmpty; exports.CommandGroup = CommandGroup; exports.CommandSeparator = CommandSeparator; exports.CommandItem = CommandItem; exports.CommandShortcut = CommandShortcut; exports.ContextMenu = ContextMenu; exports.ContextMenuPortal = ContextMenuPortal; exports.ContextMenuTrigger = ContextMenuTrigger; exports.ContextMenuContent = ContextMenuContent; exports.ContextMenuGroup = ContextMenuGroup; exports.ContextMenuLabel = ContextMenuLabel; exports.ContextMenuItem = ContextMenuItem; exports.ContextMenuSub = ContextMenuSub; exports.ContextMenuSubTrigger = ContextMenuSubTrigger; exports.ContextMenuSubContent = ContextMenuSubContent; exports.ContextMenuCheckboxItem = ContextMenuCheckboxItem; exports.ContextMenuRadioGroup = ContextMenuRadioGroup; exports.ContextMenuRadioItem = ContextMenuRadioItem; exports.ContextMenuSeparator = ContextMenuSeparator; exports.ContextMenuShortcut = ContextMenuShortcut; exports.Drawer = Drawer; exports.DrawerTrigger = DrawerTrigger; exports.DrawerPortal = DrawerPortal; exports.DrawerClose = DrawerClose; exports.DrawerOverlay = DrawerOverlay; exports.DrawerContent = DrawerContent; exports.DrawerHeader = DrawerHeader; exports.DrawerFooter = DrawerFooter; exports.DrawerTitle = DrawerTitle; exports.DrawerDescription = DrawerDescription; exports.DropdownMenu = DropdownMenu; exports.DropdownMenuPortal = DropdownMenuPortal; exports.DropdownMenuTrigger = DropdownMenuTrigger; exports.DropdownMenuContent = DropdownMenuContent; exports.DropdownMenuGroup = DropdownMenuGroup; exports.DropdownMenuLabel = DropdownMenuLabel; exports.DropdownMenuItem = DropdownMenuItem; exports.DropdownMenuSub = DropdownMenuSub; exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger; exports.DropdownMenuSubContent = DropdownMenuSubContent; exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem; exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup; exports.DropdownMenuRadioItem = DropdownMenuRadioItem; exports.DropdownMenuSeparator = DropdownMenuSeparator; exports.DropdownMenuShortcut = DropdownMenuShortcut; exports.Label = Label; exports.Separator = Separator; exports.FieldSet = FieldSet; exports.FieldLegend = FieldLegend; exports.FieldGroup = FieldGroup; exports.Field = Field; exports.FieldContent = FieldContent; exports.FieldLabel = FieldLabel; exports.FieldTitle = FieldTitle; exports.FieldDescription = FieldDescription; exports.FieldSeparator = FieldSeparator; exports.FieldError = FieldError; exports.Form = Form; exports.HoverCard = HoverCard; exports.HoverCardTrigger = HoverCardTrigger; exports.HoverCardContent = HoverCardContent; exports.InputOTP = InputOTP; exports.InputOTPGroup = InputOTPGroup; exports.InputOTPSlot = InputOTPSlot; exports.InputOTPSeparator = InputOTPSeparator; exports.NavigationMenu = NavigationMenu; exports.NavigationMenuList = NavigationMenuList; exports.NavigationMenuItem = NavigationMenuItem; exports.navigationMenuTriggerStyle = navigationMenuTriggerStyle; exports.NavigationMenuTrigger = NavigationMenuTrigger; exports.NavigationMenuContent = NavigationMenuContent; exports.NavigationMenuPositioner = NavigationMenuPositioner; exports.NavigationMenuLink = NavigationMenuLink; exports.NavigationMenuIndicator = NavigationMenuIndicator; exports.Popover = Popover; exports.PopoverTrigger = PopoverTrigger; exports.PopoverContent = PopoverContent; exports.PopoverHeader = PopoverHeader; exports.PopoverTitle = PopoverTitle; exports.PopoverDescription = PopoverDescription; exports.Progress = Progress; exports.ProgressTrack = ProgressTrack; exports.ProgressIndicator = ProgressIndicator; exports.ProgressLabel = ProgressLabel; exports.ProgressValue = ProgressValue; exports.RadioGroup = RadioGroup; exports.RadioGroupItem = RadioGroupItem; exports.ResizablePanelGroup = ResizablePanelGroup; exports.ResizablePanel = ResizablePanel; exports.ResizableHandle = ResizableHandle; exports.ScrollArea = ScrollArea; exports.ScrollBar = ScrollBar; exports.Select = Select; exports.SelectGroup = SelectGroup; exports.SelectValue = SelectValue; exports.SelectTrigger = SelectTrigger; exports.SelectContent = SelectContent; exports.SelectLabel = SelectLabel; exports.SelectItem = SelectItem; exports.SelectSeparator = SelectSeparator; exports.SelectScrollUpButton = SelectScrollUpButton; exports.SelectScrollDownButton = SelectScrollDownButton; exports.Sheet = Sheet; exports.SheetTrigger = SheetTrigger; exports.SheetClose = SheetClose; exports.SheetContent = SheetContent; exports.SheetHeader = SheetHeader; exports.SheetFooter = SheetFooter; exports.SheetTitle = SheetTitle; exports.SheetDescription = SheetDescription; exports.Skeleton = Skeleton; exports.TooltipProvider = TooltipProvider; exports.Tooltip = Tooltip2; exports.TooltipTrigger = TooltipTrigger; exports.TooltipContent = TooltipContent; exports.useSidebar = useSidebar; exports.SidebarProvider = SidebarProvider; exports.Sidebar = Sidebar; exports.SidebarTrigger = SidebarTrigger; exports.SidebarRail = SidebarRail; exports.SidebarInset = SidebarInset; exports.SidebarInput = SidebarInput; exports.SidebarHeader = SidebarHeader; exports.SidebarFooter = SidebarFooter; exports.SidebarSeparator = SidebarSeparator; exports.SidebarContent = SidebarContent; exports.SidebarGroup = SidebarGroup; exports.SidebarGroupLabel = SidebarGroupLabel; exports.SidebarGroupAction = SidebarGroupAction; exports.SidebarGroupContent = SidebarGroupContent; exports.SidebarMenu = SidebarMenu; exports.SidebarMenuItem = SidebarMenuItem; exports.SidebarMenuButton = SidebarMenuButton; exports.SidebarMenuAction = SidebarMenuAction; exports.SidebarMenuBadge = SidebarMenuBadge; exports.SidebarMenuSkeleton = SidebarMenuSkeleton; exports.SidebarMenuSub = SidebarMenuSub; exports.SidebarMenuSubItem = SidebarMenuSubItem; exports.SidebarMenuSubButton = SidebarMenuSubButton; exports.Slider = Slider; exports.Toaster = Toaster; exports.Switch = Switch; exports.Table = Table; exports.TableHeader = TableHeader; exports.TableBody = TableBody; exports.TableFooter = TableFooter; exports.TableRow = TableRow; exports.TableHead = TableHead; exports.TableCell = TableCell; exports.TableCaption = TableCaption; exports.Tabs = Tabs; exports.tabsListVariants = tabsListVariants; exports.TabsList = TabsList; exports.TabsTrigger = TabsTrigger; exports.TabsContent = TabsContent; exports.toggleVariants = toggleVariants; exports.Toggle = Toggle; exports.KanbanRoot = KanbanRoot; exports.KanbanBoard = KanbanBoard; exports.KanbanColumn = KanbanColumn; exports.KanbanColumnHandle = KanbanColumnHandle; exports.KanbanItem = KanbanItem; exports.KanbanItemHandle = KanbanItemHandle; exports.KanbanOverlay = KanbanOverlay; exports.Link = Link; exports.MultiSelect = MultiSelect; exports.BreadcrumbNavigation = BreadcrumbNavigation; exports.ContentTitle = ContentTitle; exports.SharedProvider = SharedProvider; exports.useSharedContext = useSharedContext; exports.CompanyDetails = CompanyDetails; exports.TokenStatusIndicator = TokenStatusIndicator; exports.Header = Header; exports.ModeToggleSwitch = ModeToggleSwitch; exports.PageSection = PageSection; exports.recentPagesAtom = recentPagesAtom; exports.RecentPagesNavigator = RecentPagesNavigator; exports.PageContainer = PageContainer; exports.ReactMarkdownContainer = ReactMarkdownContainer; exports.TabsContainer = TabsContainer; exports.AttributeElement = AttributeElement; exports.UserDetails = UserDetails; exports.UserAvatar = UserAvatar; exports.UserIndexDetails = UserIndexDetails; exports.UserContainer = UserContainer; exports.UserIndexContainer = UserIndexContainer; exports.UsersListContainer = UsersListContainer; exports.AdminUsersList = AdminUsersList; exports.CompanyUsersList = CompanyUsersList; exports.ContributorsList = ContributorsList; exports.RelevantUsersList = RelevantUsersList; exports.RoleUsersList = RoleUsersList; exports.UserListInAdd = UserListInAdd; exports.UsersList = UsersList; exports.UsersListByContentIds = UsersListByContentIds; exports.AllowedUsersDetails = AllowedUsersDetails; exports.ErrorDetails = ErrorDetails; exports.errorToast = errorToast; exports.BlockNoteEditorContainer = BlockNoteEditorContainer; exports.CommonAssociationTrigger = CommonAssociationTrigger; exports.CommonAssociationCommandDialog = CommonAssociationCommandDialog; exports.triggerAssociationToast = triggerAssociationToast; exports.CommonDeleter = CommonDeleter; exports.CommonEditorButtons = CommonEditorButtons; exports.CommonEditorHeader = CommonEditorHeader; exports.CommonEditorTrigger = CommonEditorTrigger; exports.DatePickerPopover = DatePickerPopover; exports.DateRangeSelector = DateRangeSelector; exports.useFileUpload = useFileUpload; exports.FileUploader = FileUploader; exports.FileUploaderContent = FileUploaderContent; exports.FileUploaderItem = FileUploaderItem; exports.FileInput = FileInput; exports.FormFieldWrapper = FormFieldWrapper; exports.FormCheckbox = FormCheckbox; exports.FormDate = FormDate; exports.FormDateTime = FormDateTime; exports.FormInput = FormInput; exports.PasswordInput = PasswordInput; exports.FormPassword = FormPassword; exports.FormPlaceAutocomplete = FormPlaceAutocomplete; exports.FormSelect = FormSelect; exports.FormSlider = FormSlider; exports.FormSwitch = FormSwitch; exports.FormTextarea = FormTextarea; exports.FormFeatures = FormFeatures; exports.PageContainerContentDetails = PageContainerContentDetails; exports.PageContentContainer = PageContentContainer; exports.cellComponent = cellComponent; exports.cellDate = cellDate; exports.cellId = cellId; exports.cellLink = cellLink; exports.cellUrl = cellUrl; exports.ContentTableSearch = ContentTableSearch; exports.ContentListTable = ContentListTable; exports.AuthContainer = AuthContainer; exports.LandingComponent = LandingComponent; exports.AcceptInvitation = AcceptInvitation; exports.ActivateAccount = ActivateAccount; exports.Cookies = Cookies; exports.ForgotPassword = ForgotPassword; exports.Login = Login; exports.Logout = Logout; exports.RefreshUser = RefreshUser; exports.ResetPassword = ResetPassword; exports.AdminCompanyContainer = AdminCompanyContainer; exports.CompanyContainer = CompanyContainer; exports.CompanyConfigurationSecurityForm = CompanyConfigurationSecurityForm; exports.CompanyConfigurationEditor = CompanyConfigurationEditor; exports.CompanyDeleter = CompanyDeleter; exports.CompanyEditor = CompanyEditor; exports.CompaniesList = CompaniesList; exports.ContentsList = ContentsList; exports.ContentsListById = ContentsListById; exports.RelevantContentsList = RelevantContentsList; exports.NotificationErrorBoundary = NotificationErrorBoundary; exports.generateNotificationData = generateNotificationData; exports.NotificationToast = NotificationToast; exports.NotificationMenuItem = NotificationMenuItem; exports.NotificationContextProvider = NotificationContextProvider; exports.useNotificationContext = useNotificationContext; exports.NotificationsList = NotificationsList; exports.NotificationsListContainer = NotificationsListContainer; exports.NotificationModal = NotificationModal; exports.PushNotificationProvider = PushNotificationProvider; exports.RoleProvider = RoleProvider; exports.useRoleContext = useRoleContext; exports.RoleDetails = RoleDetails; exports.RoleContainer = RoleContainer; exports.FormRoles = FormRoles; exports.RemoveUserFromRole = RemoveUserFromRole; exports.UserRoleAdd = UserRoleAdd; exports.useRoleTableStructure = useRoleTableStructure; exports.RolesList = RolesList; exports.UserRolesList = UserRolesList; exports.OAuthRedirectUriInput = OAuthRedirectUriInput; exports.OAuthScopeSelector = OAuthScopeSelector; exports.OAuthClientSecretDisplay = OAuthClientSecretDisplay; exports.OAuthClientCard = OAuthClientCard; exports.OAuthClientList = OAuthClientList; exports.OAuthClientForm = OAuthClientForm; exports.OAuthClientDetail = OAuthClientDetail; exports.OAuthConsentHeader = OAuthConsentHeader; exports.OAuthScopeList = OAuthScopeList; exports.OAuthConsentActions = OAuthConsentActions; exports.useOAuthConsent = useOAuthConsent; exports.OAuthConsentScreen = OAuthConsentScreen; exports.AddUserToRole = AddUserToRole; exports.UserAvatarEditor = UserAvatarEditor; exports.UserDeleter = UserDeleter; exports.UserEditor = UserEditor; exports.UserMultiSelect = UserMultiSelect; exports.UserReactivator = UserReactivator; exports.UserResentInvitationEmail = UserResentInvitationEmail; exports.UserSelector = UserSelector; exports.UserProvider = UserProvider; exports.useUserContext = useUserContext; exports.CompanyProvider = CompanyProvider; exports.useCompanyContext = useCompanyContext; exports.CommonProvider = CommonProvider; exports.useCommonContext = useCommonContext; exports.useNotificationSync = useNotificationSync; exports.usePageTracker = usePageTracker; exports.useSocket = useSocket; exports.useSubscriptionStatus = useSubscriptionStatus; exports.useUserSearch = useUserSearch; exports.useUserTableStructure = useUserTableStructure; exports.useContentTableStructure = useContentTableStructure; exports.useOAuthClients = useOAuthClients; exports.useOAuthClient = useOAuthClient;
|
|
15079
|
-
//# sourceMappingURL=chunk-
|
|
15104
|
+
//# sourceMappingURL=chunk-CYZZ3E33.js.map
|