@carlonicora/nextjs-jsonapi 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +208 -127
  2. package/dist/AuthComponent-B_Ps2Vb9.d.ts +78 -0
  3. package/dist/AuthComponent-CxnGgvoh.d.mts +78 -0
  4. package/dist/{BlockNoteEditor-U2IHUVUF.mjs → BlockNoteEditor-AIEEQM6A.mjs} +3 -5
  5. package/dist/{BlockNoteEditor-U2IHUVUF.mjs.map → BlockNoteEditor-AIEEQM6A.mjs.map} +1 -1
  6. package/dist/{BlockNoteEditor-QV6ESIQA.js → BlockNoteEditor-G6AK2NWA.js} +7 -9
  7. package/dist/BlockNoteEditor-G6AK2NWA.js.map +1 -0
  8. package/dist/{chunk-R2ONK22M.mjs → chunk-J7YDGYSW.mjs} +2654 -1307
  9. package/dist/chunk-J7YDGYSW.mjs.map +1 -0
  10. package/dist/{chunk-E2HRC2OG.js → chunk-VET55IZO.js} +1846 -499
  11. package/dist/chunk-VET55IZO.js.map +1 -0
  12. package/dist/client/index.d.mts +2 -2
  13. package/dist/client/index.d.ts +2 -2
  14. package/dist/client/index.js +2 -3
  15. package/dist/client/index.js.map +1 -1
  16. package/dist/client/index.mjs +1 -2
  17. package/dist/components/index.d.mts +6 -69
  18. package/dist/components/index.d.ts +6 -69
  19. package/dist/components/index.js +2 -3
  20. package/dist/components/index.js.map +1 -1
  21. package/dist/components/index.mjs +1 -2
  22. package/dist/{content.interface-C_PGZMuy.d.ts → content.interface-CR2aBeAW.d.ts} +1 -1
  23. package/dist/{content.interface-D_WS6CrB.d.mts → content.interface-FpLfsaRm.d.mts} +1 -1
  24. package/dist/contexts/index.d.mts +3 -3
  25. package/dist/contexts/index.d.ts +3 -3
  26. package/dist/contexts/index.js +2 -3
  27. package/dist/contexts/index.js.map +1 -1
  28. package/dist/contexts/index.mjs +1 -2
  29. package/dist/features/index.d.mts +50 -49
  30. package/dist/features/index.d.ts +50 -49
  31. package/dist/features/index.js +23 -2
  32. package/dist/features/index.js.map +1 -1
  33. package/dist/features/index.mjs +22 -1
  34. package/dist/hooks/index.d.mts +3 -3
  35. package/dist/hooks/index.d.ts +3 -3
  36. package/dist/hooks/index.js +2 -3
  37. package/dist/hooks/index.js.map +1 -1
  38. package/dist/hooks/index.mjs +1 -2
  39. package/dist/{notification.interface-BBgMUdLR.d.mts → notification.interface-B2BrLoDA.d.mts} +1 -1
  40. package/dist/{notification.interface-gyvT-Z2F.d.ts → notification.interface-DlZLnAfg.d.ts} +1 -1
  41. package/dist/scripts/generate-web-module/generator.d.ts.map +1 -1
  42. package/dist/scripts/generate-web-module/generator.js +8 -5
  43. package/dist/scripts/generate-web-module/generator.js.map +1 -1
  44. package/dist/scripts/generate-web-module/index.js +1 -1
  45. package/dist/scripts/generate-web-module/index.js.map +1 -1
  46. package/dist/scripts/generate-web-module/templates/components/editor.template.js +8 -1
  47. package/dist/scripts/generate-web-module/templates/components/editor.template.js.map +1 -1
  48. package/dist/scripts/generate-web-module/transformers/parent-detector.d.ts +4 -3
  49. package/dist/scripts/generate-web-module/transformers/parent-detector.d.ts.map +1 -1
  50. package/dist/scripts/generate-web-module/transformers/parent-detector.js +9 -3
  51. package/dist/scripts/generate-web-module/transformers/parent-detector.js.map +1 -1
  52. package/dist/scripts/generate-web-module/transformers/relationship-resolver.d.ts +11 -0
  53. package/dist/scripts/generate-web-module/transformers/relationship-resolver.d.ts.map +1 -1
  54. package/dist/scripts/generate-web-module/transformers/relationship-resolver.js +36 -9
  55. package/dist/scripts/generate-web-module/transformers/relationship-resolver.js.map +1 -1
  56. package/dist/scripts/generate-web-module/types/json-schema.interface.d.ts +2 -0
  57. package/dist/scripts/generate-web-module/types/json-schema.interface.d.ts.map +1 -1
  58. package/dist/scripts/generate-web-module/types/template-data.interface.d.ts +1 -0
  59. package/dist/scripts/generate-web-module/types/template-data.interface.d.ts.map +1 -1
  60. package/dist/scripts/generate-web-module/utils/i18n-updater.d.ts +4 -3
  61. package/dist/scripts/generate-web-module/utils/i18n-updater.d.ts.map +1 -1
  62. package/dist/scripts/generate-web-module/utils/i18n-updater.js +9 -9
  63. package/dist/scripts/generate-web-module/utils/i18n-updater.js.map +1 -1
  64. package/dist/scripts/generate-web-module/validators/json-schema-validator.js +3 -3
  65. package/dist/scripts/generate-web-module/validators/json-schema-validator.js.map +1 -1
  66. package/dist/{useSocket-DzMKRKCA.d.ts → useSocket-BV6yMdWS.d.ts} +1 -1
  67. package/dist/{useSocket-Cn7fB_B1.d.mts → useSocket-L-An7_Mr.d.mts} +1 -1
  68. package/dist/{user.interface-CAsTIbuQ.d.mts → user.interface-CooB1R79.d.mts} +13 -13
  69. package/dist/{user.interface-CbWqMaaU.d.ts → user.interface-KnIT9pVY.d.ts} +13 -13
  70. package/package.json +1 -1
  71. package/scripts/generate-web-module/generator.ts +8 -5
  72. package/scripts/generate-web-module/index.ts +1 -1
  73. package/scripts/generate-web-module/templates/components/editor.template.ts +7 -2
  74. package/scripts/generate-web-module/transformers/parent-detector.ts +10 -3
  75. package/scripts/generate-web-module/transformers/relationship-resolver.ts +36 -9
  76. package/scripts/generate-web-module/types/json-schema.interface.ts +2 -0
  77. package/scripts/generate-web-module/types/template-data.interface.ts +1 -0
  78. package/scripts/generate-web-module/utils/i18n-updater.ts +9 -9
  79. package/scripts/generate-web-module/validators/json-schema-validator.ts +3 -3
  80. package/src/features/user/index.ts +1 -0
  81. package/dist/AuthComponent-hxOPs9o8.d.mts +0 -11
  82. package/dist/AuthComponent-hxOPs9o8.d.ts +0 -11
  83. package/dist/BlockNoteEditor-QV6ESIQA.js.map +0 -1
  84. package/dist/chunk-E2HRC2OG.js.map +0 -1
  85. package/dist/chunk-HTLEKZND.mjs +0 -1375
  86. package/dist/chunk-HTLEKZND.mjs.map +0 -1
  87. package/dist/chunk-PO5Q3H5I.js +0 -1375
  88. package/dist/chunk-PO5Q3H5I.js.map +0 -1
  89. package/dist/chunk-R2ONK22M.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
2
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3;
3
3
 
4
4
 
5
5
 
@@ -105,19 +105,11 @@ var _chunkDEYKTLA3js = require('./chunk-DEYKTLA3.js');
105
105
 
106
106
 
107
107
 
108
+ var _chunkAYHKQWHHjs = require('./chunk-AYHKQWHH.js');
108
109
 
109
110
 
110
111
 
111
112
 
112
- var _chunkPO5Q3H5Ijs = require('./chunk-PO5Q3H5I.js');
113
-
114
-
115
-
116
-
117
-
118
-
119
- var _chunkAYHKQWHHjs = require('./chunk-AYHKQWHH.js');
120
-
121
113
 
122
114
 
123
115
 
@@ -135,6 +127,9 @@ var _chunk3FBCC4G3js = require('./chunk-3FBCC4G3.js');
135
127
 
136
128
 
137
129
 
130
+
131
+
132
+
138
133
  var _chunkQ4FXESVTjs = require('./chunk-Q4FXESVT.js');
139
134
 
140
135
 
@@ -999,305 +994,1304 @@ _chunk7QVYU63Ejs.__name.call(void 0, usePageTracker, "usePageTracker");
999
994
 
1000
995
  // src/hooks/usePushNotifications.ts
1001
996
 
1002
- function urlBase64ToUint8Array(base64String) {
1003
- const padding = "=".repeat((4 - base64String.length % 4) % 4);
1004
- const base64 = (base64String + padding).replace(/-/g, "+").replace(/_/g, "/");
1005
- const rawData = window.atob(base64);
1006
- const outputArray = new Uint8Array(rawData.length);
1007
- for (let i = 0; i < rawData.length; i++) {
1008
- outputArray[i] = rawData.charCodeAt(i);
1009
- }
1010
- return outputArray;
1011
- }
1012
- _chunk7QVYU63Ejs.__name.call(void 0, urlBase64ToUint8Array, "urlBase64ToUint8Array");
1013
- function usePushNotifications() {
1014
- const { currentUser, hasRole } = useCurrentUserContext();
1015
- _react.useEffect.call(void 0, () => {
1016
- const register = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
1017
- if ("serviceWorker" in navigator && "PushManager" in window) {
1018
- try {
1019
- const sessionKey = `push_registered_${_optionalChain([currentUser, 'optionalAccess', _31 => _31.id])}`;
1020
- const lastRegisteredSubscription = sessionStorage.getItem(sessionKey);
1021
- const registration = await navigator.serviceWorker.register(`${_chunkPMXG5WBCjs.getAppUrl.call(void 0, )}/sw.js`);
1022
- let permission = Notification.permission;
1023
- if (permission === "default") {
1024
- permission = await Notification.requestPermission();
1025
- }
1026
- if (permission !== "granted") {
1027
- return;
1028
- }
1029
- const vapidPublicKey = (process.env.NEXT_PUBLIC_VAPID_PUBLIC_KEY || "").trim();
1030
- const convertedKey = urlBase64ToUint8Array(vapidPublicKey);
1031
- await navigator.serviceWorker.ready;
1032
- let subscription = await registration.pushManager.getSubscription();
1033
- if (!subscription) {
1034
- const appServerKey = new Uint8Array(Array.from(convertedKey));
1035
- subscription = await registration.pushManager.subscribe({
1036
- userVisibleOnly: true,
1037
- applicationServerKey: appServerKey
1038
- });
1039
- }
1040
- const plainSubscription = {
1041
- endpoint: subscription.endpoint,
1042
- keys: subscription.toJSON().keys
1043
- };
1044
- const subscriptionHash = btoa(JSON.stringify(plainSubscription));
1045
- if (lastRegisteredSubscription !== subscriptionHash) {
1046
- await _chunkPO5Q3H5Ijs.PushService.register({ data: plainSubscription });
1047
- sessionStorage.setItem(sessionKey, subscriptionHash);
1048
- }
1049
- } catch (error) {
1050
- console.error("Error during service worker registration or push subscription:", error);
1051
- }
1052
- }
1053
- }, "register");
1054
- if (currentUser && !hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator)) register();
1055
- }, [currentUser]);
1056
- }
1057
- _chunk7QVYU63Ejs.__name.call(void 0, usePushNotifications, "usePushNotifications");
1058
997
 
1059
- // src/hooks/useSocket.ts
998
+ // src/features/auth/auth.module.ts
999
+ var AuthModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
1000
+ pageUrl: "/auth",
1001
+ name: "auth",
1002
+ model: Auth
1003
+ }), "AuthModule");
1060
1004
 
1061
- var _socketioclient = require('socket.io-client'); var _socketioclient2 = _interopRequireDefault(_socketioclient);
1062
- function useSocket({ token }) {
1063
- const _errorCount = _react.useRef.call(void 0, 0);
1064
- const shouldConnect = _react.useRef.call(void 0, true);
1065
- const _hookInstanceId = _react.useRef.call(void 0, Math.random().toString(36).substring(2, 11));
1066
- const [socket, setSocket] = _react.useState.call(void 0, null);
1067
- const [isConnected, setIsConnected] = _react.useState.call(void 0, false);
1068
- const [messages, setMessages] = _react.useState.call(void 0, []);
1069
- const [socketNotifications, setSocketNotifications] = _react.useState.call(void 0, []);
1070
- const socketRef = _react.useRef.call(void 0, null);
1071
- _react.useEffect.call(void 0, () => {
1072
- if (!token) return;
1073
- const globalSocketKey = `__socket_${_optionalChain([process, 'access', _32 => _32.env, 'access', _33 => _33.NEXT_PUBLIC_API_URL, 'optionalAccess', _34 => _34.replace, 'call', _35 => _35(/[^a-zA-Z0-9]/g, "_")])}`;
1074
- if (typeof window !== "undefined") {
1075
- const _allSocketKeys = Object.keys(window).filter((key) => key.startsWith("__socket_"));
1076
- const existingSocket = window[globalSocketKey];
1077
- if (existingSocket) {
1078
- if (existingSocket.connected) {
1079
- existingSocket.removeAllListeners();
1080
- socketRef.current = existingSocket;
1081
- setSocket(existingSocket);
1082
- setIsConnected(existingSocket.connected);
1083
- } else {
1084
- existingSocket.disconnect();
1085
- delete window[globalSocketKey];
1086
- }
1005
+ // src/features/auth/data/auth.ts
1006
+ var Auth = class extends _chunkQ4FXESVTjs.AbstractApiData {
1007
+ static {
1008
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "Auth");
1009
+ }
1010
+
1011
+
1012
+
1013
+ get token() {
1014
+ if (!this._token) throw new Error("Token is not defined");
1015
+ return this._token;
1016
+ }
1017
+ get refreshToken() {
1018
+ if (!this._refreshToken) throw new Error("Refresh token is not defined");
1019
+ return this._refreshToken;
1020
+ }
1021
+ get user() {
1022
+ if (!this._user) throw new Error("User is not defined");
1023
+ return this._user;
1024
+ }
1025
+ rehydrate(data) {
1026
+ super.rehydrate(data);
1027
+ this._token = _nullishCoalesce(data.jsonApi.attributes.token, () => ( void 0));
1028
+ this._refreshToken = _nullishCoalesce(data.jsonApi.attributes.refreshToken, () => ( void 0));
1029
+ this._user = this._readIncluded(data, "user", _chunkQ4FXESVTjs.Modules.User);
1030
+ return this;
1031
+ }
1032
+ createJsonApi(data) {
1033
+ const response = {
1034
+ data: {
1035
+ type: _chunkQ4FXESVTjs.Modules.Auth.name,
1036
+ attributes: {}
1087
1037
  }
1038
+ };
1039
+ if (data.id) response.data.id = data.id;
1040
+ if (data.email !== void 0) response.data.attributes.email = data.email;
1041
+ if (data.name !== void 0) response.data.attributes.name = data.name;
1042
+ if (data.companyName !== void 0) response.data.attributes.companyName = data.companyName;
1043
+ if (data.password !== void 0) response.data.attributes.password = data.password;
1044
+ if (data.partitaIva !== void 0) response.data.attributes.partitaIva = data.partitaIva;
1045
+ if (data.codiceFiscale !== void 0) response.data.attributes.codiceFiscale = data.codiceFiscale;
1046
+ return response;
1047
+ }
1048
+ };
1049
+
1050
+ // src/features/auth/data/auth.service.ts
1051
+ var AuthService = class extends _chunkQ4FXESVTjs.AbstractService {
1052
+ static {
1053
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "AuthService");
1054
+ }
1055
+ static async login(params) {
1056
+ const language = params.language || "en-US";
1057
+ const apiResponse = await _chunkPMXG5WBCjs.JsonApiPost.call(void 0, {
1058
+ classKey: _chunkQ4FXESVTjs.Modules.Auth,
1059
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Auth, id: "login" }).generate(),
1060
+ body: { email: params.email, password: params.password },
1061
+ language
1062
+ });
1063
+ if (!apiResponse.ok) throw new Error(apiResponse.error);
1064
+ const auth = apiResponse.data;
1065
+ const handler = _chunkAYHKQWHHjs.getTokenHandler.call(void 0, );
1066
+ if (handler) {
1067
+ await handler.updateToken({
1068
+ token: auth.token,
1069
+ refreshToken: auth.refreshToken,
1070
+ userId: auth.user.id,
1071
+ companyId: _optionalChain([auth, 'access', _31 => _31.user, 'access', _32 => _32.company, 'optionalAccess', _33 => _33.id]),
1072
+ licenseExpirationDate: _optionalChain([auth, 'access', _34 => _34.user, 'access', _35 => _35.company, 'optionalAccess', _36 => _36.licenseExpirationDate]),
1073
+ roles: auth.user.roles.map((role) => role.id),
1074
+ features: _nullishCoalesce(_optionalChain([auth, 'access', _37 => _37.user, 'access', _38 => _38.company, 'optionalAccess', _39 => _39.features, 'optionalAccess', _40 => _40.map, 'call', _41 => _41((feature) => feature.id)]), () => ( [])),
1075
+ modules: auth.user.modules.map((module) => ({
1076
+ id: module.id,
1077
+ permissions: module.permissions
1078
+ }))
1079
+ });
1088
1080
  }
1089
- let currentSocket;
1090
- const isReusing = socketRef.current && socketRef.current.connected;
1091
- if (isReusing) {
1092
- currentSocket = socketRef.current;
1093
- } else {
1094
- if (!shouldConnect.current) {
1095
- return;
1096
- }
1097
- shouldConnect.current = false;
1098
- try {
1099
- currentSocket = _socketioclient2.default.call(void 0, process.env.NEXT_PUBLIC_API_URL, {
1100
- auth: { token },
1101
- transports: ["websocket"],
1102
- timeout: 2e4
1103
- });
1104
- if (typeof window !== "undefined") {
1105
- if (currentSocket.id && currentSocket.id !== "undefined") {
1106
- window[globalSocketKey] = currentSocket;
1107
- }
1108
- }
1109
- socketRef.current = currentSocket;
1110
- setSocket(currentSocket);
1111
- } catch (e4) {
1112
- return () => {
1113
- };
1114
- }
1081
+ return auth.user;
1082
+ }
1083
+ static async logout(params) {
1084
+ const language = _optionalChain([params, 'optionalAccess', _42 => _42.language]) || "en-US";
1085
+ await _chunkPMXG5WBCjs.JsonApiDelete.call(void 0, {
1086
+ classKey: _chunkQ4FXESVTjs.Modules.Auth,
1087
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Auth }).generate(),
1088
+ language
1089
+ });
1090
+ const handler = _chunkAYHKQWHHjs.getTokenHandler.call(void 0, );
1091
+ if (handler) {
1092
+ await handler.removeToken();
1115
1093
  }
1116
- const handleConnect = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
1117
- setIsConnected(true);
1118
- }, "handleConnect");
1119
- const handleDisconnect = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
1120
- setIsConnected(false);
1121
- }, "handleDisconnect");
1122
- const handleMessage = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (data) => {
1123
- setMessages((prevMessages) => {
1124
- const newMessages = [...prevMessages, data];
1125
- return newMessages;
1094
+ }
1095
+ static async initialiseForgotPassword(params) {
1096
+ const language = params.language || "en-US";
1097
+ const response = await _chunkPMXG5WBCjs.JsonApiPost.call(void 0, {
1098
+ classKey: _chunkQ4FXESVTjs.Modules.Auth,
1099
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Auth, id: "forgot" }).generate(),
1100
+ body: { email: params.email },
1101
+ language
1102
+ });
1103
+ if (!response.ok) {
1104
+ throw new Error(response.error);
1105
+ }
1106
+ }
1107
+ static async register(params) {
1108
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Auth, id: "register" });
1109
+ await this.callApi({
1110
+ type: _chunkQ4FXESVTjs.Modules.Auth,
1111
+ method: "POST" /* POST */,
1112
+ endpoint: endpoint.generate(),
1113
+ input: params
1114
+ });
1115
+ }
1116
+ static async activate(params) {
1117
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({
1118
+ endpoint: _chunkQ4FXESVTjs.Modules.Auth,
1119
+ id: "activate",
1120
+ childEndpoint: params.activationCode
1121
+ });
1122
+ await this.callApi({ type: _chunkQ4FXESVTjs.Modules.Auth, method: "POST" /* POST */, endpoint: endpoint.generate() });
1123
+ }
1124
+ static async validateCode(params) {
1125
+ const language = params.language || "en-US";
1126
+ const apiResponse = await _chunkPMXG5WBCjs.JsonApiGet.call(void 0, {
1127
+ classKey: _chunkQ4FXESVTjs.Modules.Auth,
1128
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Auth, id: "validate", childEndpoint: params.code }).generate(),
1129
+ language
1130
+ });
1131
+ if (!apiResponse.ok) throw new Error(apiResponse.error);
1132
+ }
1133
+ static async resetPassword(params) {
1134
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Auth, id: "reset", childEndpoint: params.code });
1135
+ const input = { password: params.password };
1136
+ await this.callApi({ type: _chunkQ4FXESVTjs.Modules.Auth, method: "POST" /* POST */, endpoint: endpoint.generate(), input });
1137
+ }
1138
+ static async acceptInvitation(params) {
1139
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Auth, id: "invitation", childEndpoint: params.code });
1140
+ const input = { password: params.password };
1141
+ await this.callApi({ type: _chunkQ4FXESVTjs.Modules.Auth, method: "POST" /* POST */, endpoint: endpoint.generate(), input });
1142
+ }
1143
+ static async findToken(params) {
1144
+ return await this.callApi({
1145
+ type: _chunkQ4FXESVTjs.Modules.Auth,
1146
+ method: "POST" /* POST */,
1147
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Auth }).addAdditionalParam("code", params.tokenCode).generate()
1148
+ });
1149
+ }
1150
+ static async saveToken(params) {
1151
+ const auth = _chunkQ4FXESVTjs.rehydrate.call(void 0, _chunkQ4FXESVTjs.Modules.Auth, params.dehydratedAuth);
1152
+ const handler = _chunkAYHKQWHHjs.getTokenHandler.call(void 0, );
1153
+ if (handler) {
1154
+ await handler.updateToken({
1155
+ token: auth.token,
1156
+ refreshToken: auth.refreshToken,
1157
+ userId: auth.user.id,
1158
+ companyId: _optionalChain([auth, 'access', _43 => _43.user, 'access', _44 => _44.company, 'optionalAccess', _45 => _45.id]),
1159
+ licenseExpirationDate: _optionalChain([auth, 'access', _46 => _46.user, 'access', _47 => _47.company, 'optionalAccess', _48 => _48.licenseExpirationDate]),
1160
+ roles: auth.user.roles.map((role) => role.id),
1161
+ features: _nullishCoalesce(_optionalChain([auth, 'access', _49 => _49.user, 'access', _50 => _50.company, 'optionalAccess', _51 => _51.features, 'optionalAccess', _52 => _52.map, 'call', _53 => _53((feature) => feature.id)]), () => ( [])),
1162
+ modules: auth.user.modules.map((module) => ({
1163
+ id: module.id,
1164
+ permissions: module.permissions
1165
+ }))
1126
1166
  });
1127
- }, "handleMessage");
1128
- const handleNotification = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (data) => {
1129
- const notification = _chunkQ4FXESVTjs.rehydrate.call(void 0, _chunkQ4FXESVTjs.Modules.Notification, data);
1130
- if (notification) {
1131
- setSocketNotifications((prev) => {
1132
- const newNotifications = [...prev, notification];
1133
- return newNotifications;
1134
- });
1135
- }
1136
- }, "handleNotification");
1137
- if (currentSocket) {
1138
- currentSocket.on("connect", handleConnect);
1139
- currentSocket.on("disconnect", handleDisconnect);
1140
- currentSocket.on("message", handleMessage);
1141
- currentSocket.on("notification", handleNotification);
1142
1167
  }
1143
- return () => {
1144
- shouldConnect.current = true;
1145
- if (currentSocket) {
1146
- if (process.env.NODE_ENV === "development") {
1147
- currentSocket.off("connect", handleConnect);
1148
- currentSocket.off("disconnect", handleDisconnect);
1149
- currentSocket.off("message", handleMessage);
1150
- currentSocket.off("notification", handleNotification);
1151
- } else {
1152
- currentSocket.off("connect", handleConnect);
1153
- currentSocket.off("disconnect", handleDisconnect);
1154
- currentSocket.off("message", handleMessage);
1155
- currentSocket.off("notification", handleNotification);
1156
- currentSocket.disconnect();
1157
- if (typeof window !== "undefined") {
1158
- delete window[globalSocketKey];
1159
- }
1160
- }
1161
- }
1168
+ }
1169
+ };
1170
+
1171
+ // src/features/auth/enums/AuthComponent.ts
1172
+ var AuthComponent = /* @__PURE__ */ ((AuthComponent2) => {
1173
+ AuthComponent2[AuthComponent2["Login"] = 0] = "Login";
1174
+ AuthComponent2[AuthComponent2["ForgotPassword"] = 1] = "ForgotPassword";
1175
+ AuthComponent2[AuthComponent2["ResetPassword"] = 2] = "ResetPassword";
1176
+ AuthComponent2[AuthComponent2["ActivateAccount"] = 3] = "ActivateAccount";
1177
+ AuthComponent2[AuthComponent2["AcceptInvitation"] = 4] = "AcceptInvitation";
1178
+ AuthComponent2[AuthComponent2["Register"] = 5] = "Register";
1179
+ AuthComponent2[AuthComponent2["Landing"] = 6] = "Landing";
1180
+ return AuthComponent2;
1181
+ })(AuthComponent || {});
1182
+
1183
+ // src/features/company/company.module.ts
1184
+ var CompanyModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
1185
+ pageUrl: "/companies",
1186
+ name: "companies",
1187
+ model: Company,
1188
+ moduleId: "f9e77c8f-bfd1-4fd4-80b0-e1d891ab7113"
1189
+ }), "CompanyModule");
1190
+
1191
+ // src/features/company/data/company.ts
1192
+ var Company = class extends _chunkQ4FXESVTjs.AbstractApiData {
1193
+ static {
1194
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "Company");
1195
+ }
1196
+
1197
+
1198
+
1199
+
1200
+
1201
+
1202
+
1203
+ get name() {
1204
+ if (this._name === void 0) throw new Error("Name is not defined");
1205
+ return this._name;
1206
+ }
1207
+ get logo() {
1208
+ return this._logo;
1209
+ }
1210
+ get logoUrl() {
1211
+ return this._logoUrl;
1212
+ }
1213
+ get licenseExpirationDate() {
1214
+ return this._licenseExpirationDate;
1215
+ }
1216
+ get features() {
1217
+ return _nullishCoalesce(this._features, () => ( []));
1218
+ }
1219
+ get modules() {
1220
+ return _nullishCoalesce(this._modules, () => ( []));
1221
+ }
1222
+ get configurations() {
1223
+ return this._configurations;
1224
+ }
1225
+ rehydrate(data) {
1226
+ super.rehydrate(data);
1227
+ this._name = data.jsonApi.attributes.name;
1228
+ this._configurations = data.jsonApi.attributes.configurations ? JSON.parse(data.jsonApi.attributes.configurations) : void 0;
1229
+ this._logo = data.jsonApi.attributes.logo;
1230
+ this._logoUrl = data.jsonApi.attributes.logoUrl;
1231
+ this._licenseExpirationDate = data.jsonApi.attributes.licenseExpirationDate ? new Date(data.jsonApi.attributes.licenseExpirationDate) : void 0;
1232
+ this._features = this._readIncluded(data, "features", _chunkQ4FXESVTjs.Modules.Feature);
1233
+ this._modules = this._readIncluded(data, "modules", _chunkQ4FXESVTjs.Modules.Module);
1234
+ return this;
1235
+ }
1236
+ createJsonApi(data) {
1237
+ const response = {
1238
+ data: {
1239
+ type: _chunkQ4FXESVTjs.Modules.Company.name,
1240
+ id: data.id,
1241
+ attributes: {},
1242
+ meta: {},
1243
+ relationships: {}
1244
+ },
1245
+ included: []
1162
1246
  };
1163
- }, [token]);
1164
- const sendMessage = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (event, data) => {
1165
- if (socketRef.current && isConnected) {
1166
- socketRef.current.emit(event, data);
1247
+ if (data.name) response.data.attributes.name = data.name;
1248
+ if (data.configurations) response.data.attributes.configurations = JSON.stringify(data.configurations);
1249
+ if (data.logo) response.data.attributes.logo = data.logo;
1250
+ if (data.license) response.data.attributes.license = data.license;
1251
+ if (data.privateKey) response.data.attributes.privateKey = data.privateKey;
1252
+ if (data.featureIds && data.featureIds.length > 0) {
1253
+ response.data.relationships.features = {
1254
+ data: data.featureIds.map((featureId) => ({
1255
+ type: _chunkQ4FXESVTjs.Modules.Feature.name,
1256
+ id: featureId
1257
+ }))
1258
+ };
1167
1259
  }
1168
- }, "sendMessage");
1169
- const removeMessage = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (index) => {
1170
- setMessages((prevMessages) => {
1171
- const newMessages = [...prevMessages];
1172
- newMessages.splice(index, 1);
1173
- return newMessages;
1260
+ if (data.moduleIds && data.moduleIds.length > 0) {
1261
+ response.data.relationships.modules = {
1262
+ data: data.moduleIds.map((moduleId) => ({
1263
+ type: _chunkQ4FXESVTjs.Modules.Module.name,
1264
+ id: moduleId
1265
+ }))
1266
+ };
1267
+ }
1268
+ return response;
1269
+ }
1270
+ };
1271
+
1272
+ // src/features/company/data/company.fields.ts
1273
+ var CompanyFields = /* @__PURE__ */ ((CompanyFields2) => {
1274
+ CompanyFields2["companyId"] = "companyId";
1275
+ CompanyFields2["name"] = "name";
1276
+ CompanyFields2["createdAt"] = "createdAt";
1277
+ CompanyFields2["updatedAt"] = "updatedAt";
1278
+ return CompanyFields2;
1279
+ })(CompanyFields || {});
1280
+
1281
+ // src/features/company/data/company.service.ts
1282
+ var CompanyService = class extends _chunkQ4FXESVTjs.AbstractService {
1283
+ static {
1284
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "CompanyService");
1285
+ }
1286
+ static async findOne(params) {
1287
+ return this.callApi({
1288
+ type: _chunkQ4FXESVTjs.Modules.Company,
1289
+ method: "GET" /* GET */,
1290
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Company, id: params.companyId }).generate()
1174
1291
  });
1175
- }, "removeMessage");
1176
- const removeSocketNotification = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (index) => {
1177
- setSocketNotifications((prevNotifications) => {
1178
- const newNotifications = [...prevNotifications];
1179
- newNotifications.splice(index, 1);
1180
- return newNotifications;
1292
+ }
1293
+ static async findMany(params) {
1294
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Company });
1295
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
1296
+ return this.callApi({
1297
+ type: _chunkQ4FXESVTjs.Modules.Company,
1298
+ method: "GET" /* GET */,
1299
+ endpoint: endpoint.generate(),
1300
+ next: params.next
1181
1301
  });
1182
- }, "removeSocketNotification");
1183
- const clearMessages = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
1184
- setMessages([]);
1185
- }, "clearMessages");
1186
- const clearSocketNotifications = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
1187
- setSocketNotifications([]);
1188
- }, "clearSocketNotifications");
1189
- return {
1190
- socket,
1191
- isConnected,
1192
- messages,
1193
- socketNotifications,
1194
- sendMessage,
1195
- removeMessage,
1196
- removeSocketNotification,
1197
- clearMessages,
1198
- clearSocketNotifications
1199
- };
1200
- }
1201
- _chunk7QVYU63Ejs.__name.call(void 0, useSocket, "useSocket");
1302
+ }
1303
+ static async delete(params) {
1304
+ await this.callApi({
1305
+ type: _chunkQ4FXESVTjs.Modules.Company,
1306
+ method: "DELETE" /* DELETE */,
1307
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Company, id: params.companyId }).generate()
1308
+ });
1309
+ }
1310
+ static async create(params) {
1311
+ return this.callApi({
1312
+ type: _chunkQ4FXESVTjs.Modules.Company,
1313
+ method: "POST" /* POST */,
1314
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Company }).generate(),
1315
+ input: params
1316
+ });
1317
+ }
1318
+ static async update(params) {
1319
+ return this.callApi({
1320
+ type: _chunkQ4FXESVTjs.Modules.Company,
1321
+ method: "PUT" /* PUT */,
1322
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Company, id: params.id }).generate(),
1323
+ input: params
1324
+ });
1325
+ }
1326
+ static async updateConfigurations(params) {
1327
+ return this.callApi({
1328
+ type: _chunkQ4FXESVTjs.Modules.Company,
1329
+ method: "PUT" /* PUT */,
1330
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({
1331
+ endpoint: _chunkQ4FXESVTjs.Modules.Company,
1332
+ id: params.id,
1333
+ childEndpoint: "configurations"
1334
+ }).generate(),
1335
+ input: params
1336
+ });
1337
+ }
1338
+ static async activateLicense(params) {
1339
+ return this.callApi({
1340
+ type: _chunkQ4FXESVTjs.Modules.Company,
1341
+ method: "PUT" /* PUT */,
1342
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Company, id: params.id, childEndpoint: "license" }).generate(),
1343
+ input: params
1344
+ });
1345
+ }
1346
+ };
1202
1347
 
1203
- // src/features/user/contexts/CurrentUserContext.tsx
1204
- var _cookiesnext = require('cookies-next');
1348
+ // src/features/content/content.module.ts
1349
+ var ContentModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
1350
+ pageUrl: "/contents",
1351
+ name: "contents",
1352
+ model: Content,
1353
+ inclusions: {
1354
+ lists: {
1355
+ fields: [
1356
+ _chunkQ4FXESVTjs.createJsonApiInclusion.call(void 0, "content", [`name`, `tldr`, `abstract`, `aiStatus`, `relevance`]),
1357
+ _chunkQ4FXESVTjs.createJsonApiInclusion.call(void 0, "users", [`name`, `avatar`]),
1358
+ _chunkQ4FXESVTjs.createJsonApiInclusion.call(void 0, "topics", [`name`]),
1359
+ _chunkQ4FXESVTjs.createJsonApiInclusion.call(void 0, "expertises", [`name`])
1360
+ ]
1361
+ }
1362
+ }
1363
+ }), "ContentModule");
1205
1364
 
1206
- var _utils = require('jotai/utils');
1365
+ // src/features/content/data/content.ts
1366
+ var Content = class extends _chunkQ4FXESVTjs.AbstractApiData {
1367
+ static {
1368
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "Content");
1369
+ }
1370
+
1371
+
1372
+
1373
+
1374
+
1375
+
1376
+
1377
+
1378
+ get searchResult() {
1379
+ return _nullishCoalesce(this._name, () => ( ""));
1380
+ }
1381
+ get contentType() {
1382
+ return this._contentType;
1383
+ }
1384
+ get name() {
1385
+ if (this._name === void 0) throw new Error("JsonApi error: content name is missing");
1386
+ return this._name;
1387
+ }
1388
+ get abstract() {
1389
+ return this._abstract;
1390
+ }
1391
+ get tldr() {
1392
+ return this._tldr;
1393
+ }
1394
+ get aiStatus() {
1395
+ return _nullishCoalesce(this._aiStatus, () => ( ""));
1396
+ }
1397
+ get relevance() {
1398
+ return this._relevance;
1399
+ }
1400
+ get author() {
1401
+ if (this._author === void 0) throw new Error("JsonApi error: document author is missing");
1402
+ return this._author;
1403
+ }
1404
+ get editors() {
1405
+ return _nullishCoalesce(this._editors, () => ( []));
1406
+ }
1407
+ rehydrate(data) {
1408
+ super.rehydrate(data);
1409
+ this._contentType = data.jsonApi.meta.contentType;
1410
+ this._name = data.jsonApi.attributes.name;
1411
+ this._abstract = data.jsonApi.attributes.abstract;
1412
+ this._tldr = data.jsonApi.attributes.tldr;
1413
+ this._aiStatus = data.jsonApi.meta.aiStatus;
1414
+ this._relevance = data.jsonApi.meta.relevance;
1415
+ this._author = this._readIncluded(data, "author", _chunkQ4FXESVTjs.Modules.User);
1416
+ this._editors = this._readIncluded(data, "editors", _chunkQ4FXESVTjs.Modules.User);
1417
+ return this;
1418
+ }
1419
+ addContentInput(response, data) {
1420
+ if (data.name) response.data.attributes.name = data.name;
1421
+ if (data.authorId) {
1422
+ response.data.relationships.author = {
1423
+ data: {
1424
+ type: _chunkQ4FXESVTjs.Modules.User.name,
1425
+ id: data.authorId
1426
+ }
1427
+ };
1428
+ }
1429
+ }
1430
+ };
1207
1431
 
1432
+ // src/features/content/data/content.fields.ts
1433
+ var ContentFields = /* @__PURE__ */ ((ContentFields2) => {
1434
+ ContentFields2["contentId"] = "contentId";
1435
+ ContentFields2["name"] = "name";
1436
+ ContentFields2["relevance"] = "relevance";
1437
+ ContentFields2["authors"] = "authors";
1438
+ ContentFields2["createdAt"] = "createdAt";
1439
+ ContentFields2["updatedAt"] = "updatedAt";
1440
+ return ContentFields2;
1441
+ })(ContentFields || {});
1442
+
1443
+ // src/features/content/data/content.service.ts
1444
+ var ContentService = class extends _chunkQ4FXESVTjs.AbstractService {
1445
+ static {
1446
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "ContentService");
1447
+ }
1448
+ static async findMany(params) {
1449
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Content });
1450
+ if (params.contentIds) {
1451
+ endpoint.addAdditionalParam("contentIds", params.contentIds.join(","));
1452
+ endpoint.addAdditionalParam("fetchAll", "true");
1453
+ } else {
1454
+ if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
1455
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
1456
+ }
1457
+ if (_optionalChain([_chunkQ4FXESVTjs.Modules, 'access', _54 => _54.Content, 'access', _55 => _55.inclusions, 'optionalAccess', _56 => _56.lists, 'optionalAccess', _57 => _57.fields])) endpoint.limitToFields(_chunkQ4FXESVTjs.Modules.Content.inclusions.lists.fields);
1458
+ if (_optionalChain([_chunkQ4FXESVTjs.Modules, 'access', _58 => _58.Content, 'access', _59 => _59.inclusions, 'optionalAccess', _60 => _60.lists, 'optionalAccess', _61 => _61.types])) endpoint.limitToType(_chunkQ4FXESVTjs.Modules.Content.inclusions.lists.types);
1459
+ return this.callApi({
1460
+ type: _chunkQ4FXESVTjs.Modules.Content,
1461
+ method: "GET" /* GET */,
1462
+ endpoint: endpoint.generate(),
1463
+ next: params.next
1464
+ });
1465
+ }
1466
+ static async findRelevant(params) {
1467
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({
1468
+ endpoint: _chunkQ4FXESVTjs.Modules.Content,
1469
+ id: params.id,
1470
+ childEndpoint: "relevance"
1471
+ });
1472
+ if (_optionalChain([_chunkQ4FXESVTjs.Modules, 'access', _62 => _62.Content, 'access', _63 => _63.inclusions, 'optionalAccess', _64 => _64.lists, 'optionalAccess', _65 => _65.fields])) endpoint.limitToFields(_chunkQ4FXESVTjs.Modules.Content.inclusions.lists.fields);
1473
+ if (_optionalChain([_chunkQ4FXESVTjs.Modules, 'access', _66 => _66.Content, 'access', _67 => _67.inclusions, 'optionalAccess', _68 => _68.lists, 'optionalAccess', _69 => _69.types])) endpoint.limitToType(_chunkQ4FXESVTjs.Modules.Content.inclusions.lists.types);
1474
+ return this.callApi({
1475
+ type: _chunkQ4FXESVTjs.Modules.Content,
1476
+ method: "GET" /* GET */,
1477
+ endpoint: endpoint.generate(),
1478
+ next: params.next
1479
+ });
1480
+ }
1481
+ static async findManyByAuthor(params) {
1482
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({
1483
+ endpoint: _chunkQ4FXESVTjs.Modules.Author,
1484
+ id: params.userId,
1485
+ childEndpoint: _chunkQ4FXESVTjs.Modules.Content
1486
+ });
1487
+ if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
1488
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
1489
+ if (_optionalChain([_chunkQ4FXESVTjs.Modules, 'access', _70 => _70.Content, 'access', _71 => _71.inclusions, 'optionalAccess', _72 => _72.lists, 'optionalAccess', _73 => _73.fields])) endpoint.limitToFields(_chunkQ4FXESVTjs.Modules.Content.inclusions.lists.fields);
1490
+ if (_optionalChain([_chunkQ4FXESVTjs.Modules, 'access', _74 => _74.Content, 'access', _75 => _75.inclusions, 'optionalAccess', _76 => _76.lists, 'optionalAccess', _77 => _77.types])) endpoint.limitToType(_chunkQ4FXESVTjs.Modules.Content.inclusions.lists.types);
1491
+ return this.callApi({
1492
+ type: _chunkQ4FXESVTjs.Modules.Content,
1493
+ method: "GET" /* GET */,
1494
+ endpoint: endpoint.generate(),
1495
+ next: params.next
1496
+ });
1497
+ }
1498
+ };
1208
1499
 
1500
+ // src/features/feature/data/feature.ts
1501
+ var Feature = (_class2 = class extends _chunkQ4FXESVTjs.AbstractApiData {constructor(...args2) { super(...args2); _class2.prototype.__init2.call(this); }
1502
+ static {
1503
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "Feature");
1504
+ }
1505
+
1506
+
1507
+ __init2() {this._modules = []}
1508
+ get name() {
1509
+ return _nullishCoalesce(this._name, () => ( ""));
1510
+ }
1511
+ get isProduction() {
1512
+ return this._isProduction == true ? true : false;
1513
+ }
1514
+ get modules() {
1515
+ return this._modules;
1516
+ }
1517
+ rehydrate(data) {
1518
+ super.rehydrate(data);
1519
+ this._name = data.jsonApi.attributes.name;
1520
+ this._isProduction = _nullishCoalesce(data.jsonApi.attributes.isProduction, () => ( false));
1521
+ this._modules = this._readIncluded(data, `modules`, _chunkQ4FXESVTjs.Modules.Module);
1522
+ return this;
1523
+ }
1524
+ }, _class2);
1525
+
1526
+ // src/features/feature/feature.module.ts
1527
+ var FeatureModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
1528
+ pageUrl: "/features",
1529
+ name: "features",
1530
+ model: Feature,
1531
+ moduleId: "025fdd23-2803-4360-9fd9-eaa3612c2e23"
1532
+ }), "FeatureModule");
1533
+
1534
+ // src/features/feature/data/feature.service.ts
1535
+ var FeatureService = class extends _chunkQ4FXESVTjs.AbstractService {
1536
+ static {
1537
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "FeatureService");
1538
+ }
1539
+ static async findMany(params) {
1540
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Feature });
1541
+ if (params.companyId) endpoint.endpoint(_chunkQ4FXESVTjs.Modules.Company).id(params.companyId).childEndpoint(_chunkQ4FXESVTjs.Modules.Feature);
1542
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
1543
+ return this.callApi({
1544
+ type: _chunkQ4FXESVTjs.Modules.Feature,
1545
+ method: "GET" /* GET */,
1546
+ endpoint: endpoint.generate(),
1547
+ next: params.next
1548
+ });
1549
+ }
1550
+ };
1209
1551
 
1210
- var userAtom = _utils.atomWithStorage.call(void 0, "user", null);
1211
- var CurrentUserContext = _react.createContext.call(void 0, void 0);
1212
- var CurrentUserProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ children }) => {
1213
- const path = _navigation.usePathname.call(void 0, );
1214
- const [dehydratedUser, setDehydratedUser] = _jotai.useAtom.call(void 0, userAtom);
1215
- _react.useEffect.call(void 0, () => {
1216
- const token = _cookiesnext.getCookie.call(void 0, "token");
1217
- if (!token && dehydratedUser) setDehydratedUser(null);
1218
- }, [dehydratedUser, setDehydratedUser]);
1219
- const matchUrlToModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
1220
- const moduleKeys = Object.getOwnPropertyNames(_chunkQ4FXESVTjs.Modules).filter(
1221
- (key) => key !== "prototype" && key !== "_factory" && key !== "length" && key !== "name"
1552
+ // src/features/module/data/module.ts
1553
+ var Module = class extends _chunkQ4FXESVTjs.AbstractApiData {
1554
+ static {
1555
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "Module");
1556
+ }
1557
+
1558
+
1559
+
1560
+ get name() {
1561
+ if (!this._name) throw new Error("Name is not defined");
1562
+ return _nullishCoalesce(this._name, () => ( ""));
1563
+ }
1564
+ get isCore() {
1565
+ return _nullishCoalesce(this._isCore, () => ( false));
1566
+ }
1567
+ get permissions() {
1568
+ if (!this._permissions) throw new Error("Permissions is not defined");
1569
+ return this._permissions;
1570
+ }
1571
+ rehydrate(data) {
1572
+ super.rehydrate(data);
1573
+ this._name = data.jsonApi.attributes.name;
1574
+ this._isCore = data.jsonApi.attributes.isCore;
1575
+ this._permissions = data.jsonApi.meta.permissions;
1576
+ return this;
1577
+ }
1578
+ };
1579
+
1580
+ // src/features/module/module.module.ts
1581
+ var ModuleModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
1582
+ pageUrl: "/modules",
1583
+ name: "modules",
1584
+ model: Module,
1585
+ moduleId: "25ffd868-8341-4ca7-963b-6e1c56b03b1d"
1586
+ }), "ModuleModule");
1587
+
1588
+ // src/features/notification/data/notification.ts
1589
+ var Notification2 = class extends _chunkQ4FXESVTjs.AbstractApiData {
1590
+ static {
1591
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "Notification");
1592
+ }
1593
+
1594
+
1595
+
1596
+ get notificationType() {
1597
+ if (this._notificationType === void 0) throw new Error("notificationType is not set");
1598
+ return this._notificationType;
1599
+ }
1600
+ get isRead() {
1601
+ return this._isRead === void 0 ? false : this._isRead;
1602
+ }
1603
+ get actor() {
1604
+ return this._actor;
1605
+ }
1606
+ rehydrate(data) {
1607
+ super.rehydrate(data);
1608
+ this._notificationType = data.jsonApi.attributes.notificationType;
1609
+ this._isRead = data.jsonApi.attributes.isRead;
1610
+ this._actor = this._readIncluded(data, "actor", _chunkQ4FXESVTjs.Modules.User);
1611
+ return this;
1612
+ }
1613
+ createJsonApi(data) {
1614
+ const response = {
1615
+ data: {
1616
+ type: _chunkQ4FXESVTjs.Modules.Notification.name,
1617
+ id: data.id,
1618
+ attributes: {
1619
+ isRead: data.isRead
1620
+ },
1621
+ meta: {},
1622
+ relationships: {}
1623
+ },
1624
+ included: []
1625
+ };
1626
+ return response;
1627
+ }
1628
+ };
1629
+
1630
+ // src/features/notification/notification.module.ts
1631
+ var NotificationModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
1632
+ pageUrl: "/notifications",
1633
+ name: "notifications",
1634
+ model: Notification2,
1635
+ moduleId: "9259d704-c670-4e77-a3a1-a728ffc5be3d"
1636
+ }), "NotificationModule");
1637
+
1638
+ // src/features/notification/data/notification.fields.ts
1639
+ var NotificationFields = /* @__PURE__ */ ((NotificationFields2) => {
1640
+ NotificationFields2["notificationId"] = "notificationId";
1641
+ NotificationFields2["name"] = "name";
1642
+ NotificationFields2["createdAt"] = "createdAt";
1643
+ NotificationFields2["updatedAt"] = "updatedAt";
1644
+ return NotificationFields2;
1645
+ })(NotificationFields || {});
1646
+
1647
+ // src/features/notification/data/notification.service.ts
1648
+ var NotificationService = class extends _chunkQ4FXESVTjs.AbstractService {
1649
+ static {
1650
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "NotificationService");
1651
+ }
1652
+ static async findMany(params) {
1653
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Notification });
1654
+ if (params.isArchived) endpoint.addAdditionalParam("isArchived", "true");
1655
+ return this.callApi({
1656
+ type: _chunkQ4FXESVTjs.Modules.Notification,
1657
+ method: "GET" /* GET */,
1658
+ endpoint: endpoint.generate(),
1659
+ next: params.next
1660
+ });
1661
+ }
1662
+ static async markAsRead(params) {
1663
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Notification });
1664
+ await this.callApi({
1665
+ type: _chunkQ4FXESVTjs.Modules.Notification,
1666
+ method: "PATCH" /* PATCH */,
1667
+ endpoint: endpoint.generate(),
1668
+ input: params.data,
1669
+ overridesJsonApiCreation: true
1670
+ });
1671
+ }
1672
+ static async archive(params) {
1673
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Notification, id: params.id, childEndpoint: "archive" });
1674
+ await this.callApi({ type: _chunkQ4FXESVTjs.Modules.Notification, method: "POST" /* POST */, endpoint: endpoint.generate() });
1675
+ }
1676
+ };
1677
+
1678
+ // src/features/push/data/push.ts
1679
+ var Push = class extends _chunkQ4FXESVTjs.AbstractApiData {
1680
+ static {
1681
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "Push");
1682
+ }
1683
+ createJsonApi(data) {
1684
+ const response = {
1685
+ data: {
1686
+ type: _chunkQ4FXESVTjs.Modules.Push.name,
1687
+ attributes: {
1688
+ key: data.key
1689
+ }
1690
+ },
1691
+ included: []
1692
+ };
1693
+ return response;
1694
+ }
1695
+ };
1696
+
1697
+ // src/features/push/push.module.ts
1698
+ var PushModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
1699
+ pageUrl: "/push",
1700
+ name: "push",
1701
+ model: Push,
1702
+ moduleId: ""
1703
+ }), "PushModule");
1704
+
1705
+ // src/features/push/data/push.service.ts
1706
+ var PushService = class extends _chunkQ4FXESVTjs.AbstractService {
1707
+ static {
1708
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "PushService");
1709
+ }
1710
+ static async register(params) {
1711
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Push });
1712
+ await this.callApi({
1713
+ type: _chunkQ4FXESVTjs.Modules.Push,
1714
+ method: "POST" /* POST */,
1715
+ endpoint: endpoint.generate(),
1716
+ input: params.data,
1717
+ overridesJsonApiCreation: true
1718
+ });
1719
+ }
1720
+ };
1721
+
1722
+ // src/features/role/data/role.ts
1723
+ var Role = class extends _chunkQ4FXESVTjs.AbstractApiData {
1724
+ static {
1725
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "Role");
1726
+ }
1727
+
1728
+
1729
+
1730
+
1731
+ get name() {
1732
+ if (!this._name) throw new Error("Name is not defined");
1733
+ return this._name;
1734
+ }
1735
+ get description() {
1736
+ return _nullishCoalesce(this._description, () => ( ""));
1737
+ }
1738
+ get isSelectable() {
1739
+ return _nullishCoalesce(this._isSelectable, () => ( false));
1740
+ }
1741
+ get requiredFeature() {
1742
+ return this._requiredFeature;
1743
+ }
1744
+ rehydrate(data) {
1745
+ super.rehydrate(data);
1746
+ this._name = _nullishCoalesce(data.jsonApi.attributes.name, () => ( void 0));
1747
+ this._description = _nullishCoalesce(data.jsonApi.attributes.description, () => ( void 0));
1748
+ this._isSelectable = _nullishCoalesce(data.jsonApi.attributes.isSelectable, () => ( void 0));
1749
+ this._requiredFeature = this._readIncluded(
1750
+ data,
1751
+ "requiredFeature",
1752
+ _chunkQ4FXESVTjs.Modules.Feature
1222
1753
  );
1223
- const matchedModuleKey = moduleKeys.find((key) => {
1224
- const descriptor2 = Object.getOwnPropertyDescriptor(_chunkQ4FXESVTjs.Modules, key);
1225
- if (!_optionalChain([descriptor2, 'optionalAccess', _36 => _36.get])) return false;
1226
- const selectedModule = descriptor2.get.call(_chunkQ4FXESVTjs.Modules);
1227
- return path.toLowerCase().startsWith(_optionalChain([selectedModule, 'access', _37 => _37.pageUrl, 'optionalAccess', _38 => _38.toLowerCase, 'call', _39 => _39()]));
1754
+ return this;
1755
+ }
1756
+ createJsonApi(data) {
1757
+ const response = {
1758
+ data: {
1759
+ type: _chunkQ4FXESVTjs.Modules.Role.name,
1760
+ id: data.id,
1761
+ attributes: {
1762
+ name: data.name
1763
+ },
1764
+ meta: {}
1765
+ },
1766
+ included: []
1767
+ };
1768
+ if (data.description !== void 0) response.data.attributes.description = data.description;
1769
+ return response;
1770
+ }
1771
+ };
1772
+
1773
+ // src/features/role/data/role.fields.ts
1774
+ var RoleFields = /* @__PURE__ */ ((RoleFields2) => {
1775
+ RoleFields2["roleId"] = "roleId";
1776
+ RoleFields2["name"] = "name";
1777
+ RoleFields2["description"] = "description";
1778
+ RoleFields2["createdAt"] = "createdAt";
1779
+ RoleFields2["updatedAt"] = "updatedAt";
1780
+ return RoleFields2;
1781
+ })(RoleFields || {});
1782
+
1783
+ // src/features/role/data/role.service.ts
1784
+ var RoleService = class extends _chunkQ4FXESVTjs.AbstractService {
1785
+ static {
1786
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "RoleService");
1787
+ }
1788
+ static async findById(params) {
1789
+ return this.callApi({
1790
+ type: _chunkQ4FXESVTjs.Modules.Role,
1791
+ method: "GET" /* GET */,
1792
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Role, id: params.roleId }).generate()
1793
+ });
1794
+ }
1795
+ static async findAllRoles(params) {
1796
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Role });
1797
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
1798
+ return this.callApi({
1799
+ type: _chunkQ4FXESVTjs.Modules.Role,
1800
+ method: "GET" /* GET */,
1801
+ endpoint: endpoint.generate(),
1802
+ next: params.next
1803
+ });
1804
+ }
1805
+ static async findAllRolesByUser(params) {
1806
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.User, id: params.userId, childEndpoint: _chunkQ4FXESVTjs.Modules.Role });
1807
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
1808
+ return this.callApi({
1809
+ type: _chunkQ4FXESVTjs.Modules.Role,
1810
+ method: "GET" /* GET */,
1811
+ endpoint: endpoint.generate(),
1812
+ next: params.next
1813
+ });
1814
+ }
1815
+ static async findAllRolesUserNotIn(params) {
1816
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({
1817
+ endpoint: _chunkQ4FXESVTjs.Modules.User,
1818
+ id: params.userId,
1819
+ childEndpoint: _chunkQ4FXESVTjs.Modules.Role
1820
+ }).addAdditionalParam("userNotIn", "true");
1821
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
1822
+ return this.callApi({
1823
+ type: _chunkQ4FXESVTjs.Modules.Role,
1824
+ method: "GET" /* GET */,
1825
+ endpoint: endpoint.generate(),
1826
+ next: params.next
1827
+ });
1828
+ }
1829
+ static async addUserToRole(params) {
1830
+ this.callApi({
1831
+ type: _chunkQ4FXESVTjs.Modules.Role,
1832
+ method: "POST" /* POST */,
1833
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({
1834
+ endpoint: _chunkQ4FXESVTjs.Modules.Role,
1835
+ id: params.roleId,
1836
+ childEndpoint: _chunkQ4FXESVTjs.Modules.User,
1837
+ childId: params.userId
1838
+ }).generate()
1839
+ });
1840
+ }
1841
+ static async removeUserFromRole(params) {
1842
+ this.callApi({
1843
+ type: _chunkQ4FXESVTjs.Modules.Role,
1844
+ method: "DELETE" /* DELETE */,
1845
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({
1846
+ endpoint: _chunkQ4FXESVTjs.Modules.Role,
1847
+ id: params.roleId,
1848
+ childEndpoint: _chunkQ4FXESVTjs.Modules.User,
1849
+ childId: params.userId
1850
+ }).generate()
1851
+ });
1852
+ }
1853
+ static async create(params) {
1854
+ return this.callApi({
1855
+ type: _chunkQ4FXESVTjs.Modules.Role,
1856
+ method: "POST" /* POST */,
1857
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Role }).generate(),
1858
+ input: { id: params.roleId, name: params.name, description: params.description }
1859
+ });
1860
+ }
1861
+ static async update(params) {
1862
+ return this.callApi({
1863
+ type: _chunkQ4FXESVTjs.Modules.Role,
1864
+ method: "PUT" /* PUT */,
1865
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Role, id: params.roleId }).generate(),
1866
+ input: { id: params.roleId, name: params.name, description: params.description }
1867
+ });
1868
+ }
1869
+ static async delete(params) {
1870
+ return this.callApi({
1871
+ type: _chunkQ4FXESVTjs.Modules.Role,
1872
+ method: "DELETE" /* DELETE */,
1873
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Role, id: params.roleId }).generate()
1874
+ });
1875
+ }
1876
+ };
1877
+
1878
+ // src/features/role/role.module.ts
1879
+ var RoleModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
1880
+ pageUrl: "/roles",
1881
+ name: "roles",
1882
+ model: Role,
1883
+ moduleId: "9f6416e6-7b9b-4e1a-a99f-833191eca8a9"
1884
+ }), "RoleModule");
1885
+
1886
+ // src/features/s3/data/s3.ts
1887
+ var S3 = class extends _chunkQ4FXESVTjs.AbstractApiData {
1888
+ static {
1889
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "S3");
1890
+ }
1891
+
1892
+
1893
+
1894
+
1895
+
1896
+ get url() {
1897
+ if (!this._url) throw new Error("Image URL is not set.");
1898
+ return this._url;
1899
+ }
1900
+ get headers() {
1901
+ const headers = {};
1902
+ if (this._contentType) {
1903
+ headers["Content-Type"] = this._contentType;
1904
+ }
1905
+ if (this._blobType) {
1906
+ headers["x-ms-blob-type"] = this._blobType;
1907
+ }
1908
+ if (this._acl) {
1909
+ headers["x-amz-acl"] = this._acl;
1910
+ }
1911
+ return headers;
1912
+ }
1913
+ rehydrate(data) {
1914
+ super.rehydrate(data);
1915
+ this._url = _nullishCoalesce(data.jsonApi.attributes.url, () => ( void 0));
1916
+ this._storageType = _nullishCoalesce(data.jsonApi.attributes.storageType, () => ( void 0));
1917
+ this._contentType = _nullishCoalesce(data.jsonApi.attributes.contentType, () => ( void 0));
1918
+ this._blobType = _nullishCoalesce(data.jsonApi.attributes.blobType, () => ( void 0));
1919
+ this._acl = _nullishCoalesce(data.jsonApi.attributes.acl, () => ( void 0));
1920
+ return this;
1921
+ }
1922
+ createJsonApi(data) {
1923
+ const response = {
1924
+ data: {
1925
+ type: _chunkQ4FXESVTjs.Modules.S3.name,
1926
+ attributes: {
1927
+ key: data.key
1928
+ }
1929
+ },
1930
+ included: []
1931
+ };
1932
+ if (data.contentType) response.data.attributes.contentType = data.contentType;
1933
+ return response;
1934
+ }
1935
+ };
1936
+
1937
+ // src/features/s3/s3.module.ts
1938
+ var S3Module = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
1939
+ pageUrl: "/s3",
1940
+ name: "s3",
1941
+ model: S3,
1942
+ moduleId: "db41ba46-e171-4324-8845-99353eba8568"
1943
+ }), "S3Module");
1944
+
1945
+ // src/features/s3/data/s3.service.ts
1946
+ var S3Service = class extends _chunkQ4FXESVTjs.AbstractService {
1947
+ static {
1948
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "S3Service");
1949
+ }
1950
+ static async getPreSignedUrl(params) {
1951
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.S3 }).addAdditionalParam("key", params.key).addAdditionalParam("contentType", params.contentType);
1952
+ if (params.isPublic) endpoint.addAdditionalParam("isPublic", "true");
1953
+ return this.callApi({ type: _chunkQ4FXESVTjs.Modules.S3, method: "GET" /* GET */, endpoint: endpoint.generate() });
1954
+ }
1955
+ static async getSignedUrl(params) {
1956
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.S3, id: "sign" }).addAdditionalParam("key", params.key);
1957
+ if (params.isPublic) endpoint.addAdditionalParam("isPublic", "true");
1958
+ return this.callApi({ type: _chunkQ4FXESVTjs.Modules.S3, method: "GET" /* GET */, endpoint: endpoint.generate() });
1959
+ }
1960
+ static async deleteFile(params) {
1961
+ this.callApi({
1962
+ type: _chunkQ4FXESVTjs.Modules.S3,
1963
+ method: "DELETE" /* DELETE */,
1964
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.S3 }).addAdditionalParam("key", params.key).generate()
1965
+ });
1966
+ }
1967
+ };
1968
+
1969
+ // src/features/user/data/user.ts
1970
+ var User = (_class3 = class extends _chunkQ4FXESVTjs.AbstractApiData {constructor(...args3) { super(...args3); _class3.prototype.__init3.call(this);_class3.prototype.__init4.call(this); }
1971
+ static {
1972
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "User");
1973
+ }
1974
+
1975
+
1976
+
1977
+
1978
+
1979
+
1980
+
1981
+
1982
+
1983
+
1984
+
1985
+
1986
+ __init3() {this._roles = []}
1987
+
1988
+ __init4() {this._modules = []}
1989
+ get searchResult() {
1990
+ return _nullishCoalesce(this._name, () => ( ""));
1991
+ }
1992
+ get name() {
1993
+ return _nullishCoalesce(this._name, () => ( ""));
1994
+ }
1995
+ get email() {
1996
+ return _nullishCoalesce(this._email, () => ( ""));
1997
+ }
1998
+ get title() {
1999
+ return _nullishCoalesce(this._title, () => ( ""));
2000
+ }
2001
+ get bio() {
2002
+ return _nullishCoalesce(this._bio, () => ( ""));
2003
+ }
2004
+ get avatar() {
2005
+ return this._avatar;
2006
+ }
2007
+ get avatarUrl() {
2008
+ return this._avatarUrl;
2009
+ }
2010
+ get phone() {
2011
+ return this._phone;
2012
+ }
2013
+ get rate() {
2014
+ return this._rate;
2015
+ }
2016
+ get relevance() {
2017
+ return this._relevance;
2018
+ }
2019
+ get isActivated() {
2020
+ return _nullishCoalesce(this._isActivated, () => ( false));
2021
+ }
2022
+ get isDeleted() {
2023
+ return _nullishCoalesce(this._isDeleted, () => ( false));
2024
+ }
2025
+ get lastLogin() {
2026
+ return this._lastLogin;
2027
+ }
2028
+ get roles() {
2029
+ return this._roles;
2030
+ }
2031
+ get company() {
2032
+ return this._company;
2033
+ }
2034
+ get modules() {
2035
+ return this._modules;
2036
+ }
2037
+ rehydrate(data) {
2038
+ super.rehydrate(data);
2039
+ this._name = data.jsonApi.attributes.name;
2040
+ this._email = data.jsonApi.attributes.email;
2041
+ this._title = data.jsonApi.attributes.title;
2042
+ this._bio = data.jsonApi.attributes.bio;
2043
+ this._phone = data.jsonApi.attributes.phone;
2044
+ this._rate = data.jsonApi.attributes.rate;
2045
+ this._avatar = data.jsonApi.attributes.avatar;
2046
+ this._avatarUrl = data.jsonApi.attributes.avatarUrl;
2047
+ this._isActivated = data.jsonApi.meta.isActive;
2048
+ this._isDeleted = data.jsonApi.meta.isDeleted;
2049
+ this._lastLogin = data.jsonApi.meta.lastLogin ? new Date(data.jsonApi.meta.lastLogin) : void 0;
2050
+ this._relevance = data.jsonApi.meta.relevance;
2051
+ this._roles = this._readIncluded(data, "roles", _chunkQ4FXESVTjs.Modules.Role);
2052
+ this._company = this._readIncluded(data, "company", _chunkQ4FXESVTjs.Modules.Company);
2053
+ this._modules = this._readIncluded(data, "modules", _chunkQ4FXESVTjs.Modules.Module);
2054
+ return this;
2055
+ }
2056
+ createJsonApi(data) {
2057
+ const response = {
2058
+ data: {
2059
+ type: _chunkQ4FXESVTjs.Modules.User.name,
2060
+ id: data.id,
2061
+ attributes: {
2062
+ name: data.name
2063
+ },
2064
+ meta: {},
2065
+ relationships: {}
2066
+ },
2067
+ included: []
2068
+ };
2069
+ if (data.email !== void 0) response.data.attributes.email = data.email;
2070
+ if (data.title !== void 0) response.data.attributes.title = data.title;
2071
+ if (data.bio !== void 0) response.data.attributes.bio = data.bio;
2072
+ if (data.phone !== void 0) response.data.attributes.phone = data.phone;
2073
+ if (data.password !== void 0) response.data.attributes.password = data.password;
2074
+ if (data.sendInvitationEmail) response.data.attributes.sendInvitationEmail = true;
2075
+ if (data.adminCreated) response.data.attributes.adminCreated = true;
2076
+ if (data.avatar) response.data.attributes.avatar = data.avatar;
2077
+ if (data.rate !== void 0) response.data.attributes.rate = data.rate;
2078
+ if (data.roleIds) {
2079
+ response.data.relationships.roles = {
2080
+ data: data.roleIds.map((roleId) => ({
2081
+ type: _chunkQ4FXESVTjs.Modules.Role.name,
2082
+ id: roleId
2083
+ }))
2084
+ };
2085
+ }
2086
+ if (data.companyId) {
2087
+ response.data.relationships.company = {
2088
+ data: {
2089
+ type: _chunkQ4FXESVTjs.Modules.Company.name,
2090
+ id: data.companyId
2091
+ }
2092
+ };
2093
+ }
2094
+ return response;
2095
+ }
2096
+ }, _class3);
2097
+
2098
+ // src/features/user/data/user.fields.ts
2099
+ var UserFields = /* @__PURE__ */ ((UserFields2) => {
2100
+ UserFields2["userId"] = "userId";
2101
+ UserFields2["name"] = "name";
2102
+ UserFields2["email"] = "email";
2103
+ UserFields2["relevance"] = "relevance";
2104
+ UserFields2["createdAt"] = "createdAt";
2105
+ UserFields2["updatedAt"] = "updatedAt";
2106
+ return UserFields2;
2107
+ })(UserFields || {});
2108
+
2109
+ // src/features/user/data/user.service.ts
2110
+ var UserService = class extends _chunkQ4FXESVTjs.AbstractService {
2111
+ static {
2112
+ _chunk7QVYU63Ejs.__name.call(void 0, this, "UserService");
2113
+ }
2114
+ static async findFullUser() {
2115
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.User, id: "me", childEndpoint: "full" });
2116
+ return this.callApi({
2117
+ type: _chunkQ4FXESVTjs.Modules.User,
2118
+ method: "GET" /* GET */,
2119
+ endpoint: endpoint.generate()
2120
+ });
2121
+ }
2122
+ static async findById(params) {
2123
+ return this.callApi({
2124
+ type: _chunkQ4FXESVTjs.Modules.User,
2125
+ method: "GET" /* GET */,
2126
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.User, id: params.userId }).generate()
2127
+ });
2128
+ }
2129
+ static async findByEmail(params) {
2130
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.User, id: "email", childEndpoint: params.email });
2131
+ return this.callApi({ type: _chunkQ4FXESVTjs.Modules.User, method: "GET" /* GET */, endpoint: endpoint.generate() });
2132
+ }
2133
+ static async findMany(params) {
2134
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.User });
2135
+ if (params.roleId) endpoint.addAdditionalParam("roleId", params.roleId);
2136
+ if (params.includeDeleted) endpoint.addAdditionalParam("includeDeleted", "true");
2137
+ if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
2138
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
2139
+ return this.callApi({
2140
+ type: _chunkQ4FXESVTjs.Modules.User,
2141
+ method: "GET" /* GET */,
2142
+ endpoint: endpoint.generate(),
2143
+ next: params.next
2144
+ });
2145
+ }
2146
+ static async findManyByContentIds(params) {
2147
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.User });
2148
+ endpoint.addAdditionalParam("contentIds", params.contentIds.map((id) => id).join(","));
2149
+ endpoint.addAdditionalParam("includeDeleted", "true");
2150
+ endpoint.addAdditionalParam("fetchAll", "true");
2151
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
2152
+ return this.callApi({
2153
+ type: _chunkQ4FXESVTjs.Modules.User,
2154
+ method: "GET" /* GET */,
2155
+ endpoint: endpoint.generate(),
2156
+ next: params.next
2157
+ });
2158
+ }
2159
+ static async findRelevant(params) {
2160
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({
2161
+ endpoint: _chunkQ4FXESVTjs.Modules.Content,
2162
+ id: params.id,
2163
+ childEndpoint: "user-relevance"
2164
+ });
2165
+ if (_optionalChain([_chunkQ4FXESVTjs.Modules, 'access', _78 => _78.User, 'access', _79 => _79.inclusions, 'optionalAccess', _80 => _80.lists, 'optionalAccess', _81 => _81.fields])) endpoint.limitToFields(_chunkQ4FXESVTjs.Modules.User.inclusions.lists.fields);
2166
+ if (_optionalChain([_chunkQ4FXESVTjs.Modules, 'access', _82 => _82.User, 'access', _83 => _83.inclusions, 'optionalAccess', _84 => _84.lists, 'optionalAccess', _85 => _85.types])) endpoint.limitToType(_chunkQ4FXESVTjs.Modules.User.inclusions.lists.types);
2167
+ return this.callApi({
2168
+ type: _chunkQ4FXESVTjs.Modules.User,
2169
+ method: "GET" /* GET */,
2170
+ endpoint: endpoint.generate(),
2171
+ next: params.next
2172
+ });
2173
+ }
2174
+ static async findManyForAmin(params) {
2175
+ if (!params.companyId) return [];
2176
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({
2177
+ endpoint: _chunkQ4FXESVTjs.Modules.Company,
2178
+ id: params.companyId,
2179
+ childEndpoint: _chunkQ4FXESVTjs.Modules.User
2180
+ });
2181
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
2182
+ return this.callApi({
2183
+ type: _chunkQ4FXESVTjs.Modules.User,
2184
+ method: "GET" /* GET */,
2185
+ endpoint: endpoint.generate(),
2186
+ next: params.next,
2187
+ previous: params.prev
2188
+ });
2189
+ }
2190
+ static async findAllUsers(params) {
2191
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({
2192
+ endpoint: _chunkQ4FXESVTjs.Modules.Company,
2193
+ id: params.companyId,
2194
+ childEndpoint: _chunkQ4FXESVTjs.Modules.User
2195
+ });
2196
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
2197
+ if (params.isDeleted) endpoint.addAdditionalParam("isDeleted", "true");
2198
+ if (params.limitToRoles && params.limitToRoles.length > 0)
2199
+ endpoint.addAdditionalParam("limitToRoles", params.limitToRoles.join(","));
2200
+ return this.callApi({
2201
+ type: _chunkQ4FXESVTjs.Modules.User,
2202
+ method: "GET" /* GET */,
2203
+ endpoint: endpoint.generate(),
2204
+ next: params.next
1228
2205
  });
1229
- if (!matchedModuleKey) return void 0;
1230
- const descriptor = Object.getOwnPropertyDescriptor(_chunkQ4FXESVTjs.Modules, matchedModuleKey);
1231
- return _optionalChain([descriptor, 'optionalAccess', _40 => _40.get, 'optionalAccess', _41 => _41.call, 'call', _42 => _42(_chunkQ4FXESVTjs.Modules)]);
1232
- }, "matchUrlToModule");
1233
- const currentUser = dehydratedUser ? _chunkQ4FXESVTjs.rehydrate.call(void 0, _chunkQ4FXESVTjs.Modules.User, dehydratedUser) : null;
1234
- const company = _nullishCoalesce(_optionalChain([currentUser, 'optionalAccess', _43 => _43.company]), () => ( null));
1235
- const setUser = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (user) => {
1236
- if (user) setDehydratedUser(user.dehydrate());
1237
- else setDehydratedUser(null);
1238
- }, "setUser");
1239
- const hasRole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (roleId) => {
1240
- if (!currentUser) return false;
1241
- return !!_optionalChain([currentUser, 'access', _44 => _44.roles, 'optionalAccess', _45 => _45.some, 'call', _46 => _46((userRole) => userRole.id === roleId)]);
1242
- }, "hasRole");
1243
- const hasAccesToFeature = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (featureIdentifier) => {
1244
- if (hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator)) return true;
1245
- if (!company) return false;
1246
- return company.features.some((feature) => feature.id === featureIdentifier);
1247
- }, "hasAccesToFeature");
1248
- function hasPermissionToModule(params) {
1249
- if (!currentUser) return false;
1250
- if (!!params.module.feature && !hasAccesToFeature(params.module.feature)) return false;
1251
- return _chunk32HM6MDDjs.checkPermissions.call(void 0, { module: params.module, action: params.action, data: params.data, user: currentUser });
1252
2206
  }
1253
- _chunk7QVYU63Ejs.__name.call(void 0, hasPermissionToModule, "hasPermissionToModule");
1254
- function hasPermissionToModules(params) {
1255
- if (!currentUser) return false;
1256
- if (!params.modules.every((module) => !module.feature || hasAccesToFeature(module.feature))) return false;
1257
- return params.modules.every(
1258
- (module) => _chunk32HM6MDDjs.checkPermissions.call(void 0, { module, action: params.action, data: params.data, user: currentUser })
1259
- );
2207
+ static async findAllUsersByRole(params) {
2208
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.Role, id: params.roleId, childEndpoint: _chunkQ4FXESVTjs.Modules.User });
2209
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
2210
+ return this.callApi({
2211
+ type: _chunkQ4FXESVTjs.Modules.User,
2212
+ method: "GET" /* GET */,
2213
+ endpoint: endpoint.generate(),
2214
+ next: params.next
2215
+ });
1260
2216
  }
1261
- _chunk7QVYU63Ejs.__name.call(void 0, hasPermissionToModules, "hasPermissionToModules");
1262
- function hasPermissionToPath(path2) {
1263
- if (!currentUser) return false;
1264
- if (path2 === "#" || path2 === "/") return true;
1265
- const selectedModule = matchUrlToModule({ path: path2 });
1266
- if (!selectedModule) return true;
1267
- const response = hasPermissionToModule({ module: selectedModule, action: "read" /* Read */ });
1268
- return response;
2217
+ static async findAllUsersNotInRole(params) {
2218
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({
2219
+ endpoint: _chunkQ4FXESVTjs.Modules.Role,
2220
+ id: params.roleId,
2221
+ childEndpoint: _chunkQ4FXESVTjs.Modules.User
2222
+ }).addAdditionalParam("notInRole", "true");
2223
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
2224
+ return this.callApi({
2225
+ type: _chunkQ4FXESVTjs.Modules.User,
2226
+ method: "GET" /* GET */,
2227
+ endpoint: endpoint.generate(),
2228
+ next: params.next
2229
+ });
1269
2230
  }
1270
- _chunk7QVYU63Ejs.__name.call(void 0, hasPermissionToPath, "hasPermissionToPath");
1271
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1272
- CurrentUserContext.Provider,
1273
- {
1274
- value: {
1275
- currentUser,
1276
- company,
1277
- setUser,
1278
- hasPermissionToModule,
1279
- hasPermissionToModules,
1280
- hasPermissionToPath,
1281
- hasAccesToFeature,
1282
- matchUrlToModule,
1283
- hasRole
1284
- },
1285
- children
1286
- }
1287
- );
1288
- }, "CurrentUserProvider");
1289
- function useCurrentUserContext() {
1290
- const context = _react.useContext.call(void 0, CurrentUserContext);
1291
- if (context === void 0) {
1292
- throw new Error("useCurrentUserContext must be used within a UserProvider");
2231
+ static async create(params) {
2232
+ return this.callApi({
2233
+ type: _chunkQ4FXESVTjs.Modules.User,
2234
+ method: "POST" /* POST */,
2235
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.User }).generate(),
2236
+ companyId: params.companyId,
2237
+ input: params
2238
+ });
1293
2239
  }
1294
- return context;
1295
- }
1296
- _chunk7QVYU63Ejs.__name.call(void 0, useCurrentUserContext, "useCurrentUserContext");
1297
-
1298
- // src/features/user/contexts/UserContext.tsx
1299
-
2240
+ static async reactivate(params) {
2241
+ return this.callApi({
2242
+ type: _chunkQ4FXESVTjs.Modules.User,
2243
+ method: "PATCH" /* PATCH */,
2244
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.User, id: params.userId }).generate()
2245
+ });
2246
+ }
2247
+ static async sendInvitation(params) {
2248
+ const endpoint = new (0, _chunkQ4FXESVTjs.EndpointCreator)({
2249
+ endpoint: _chunkQ4FXESVTjs.Modules.User,
2250
+ id: params.userId,
2251
+ childEndpoint: "send-invitation-email"
2252
+ });
2253
+ if (params.companyId) endpoint.addAdditionalParam("companyId", params.companyId);
2254
+ this.callApi({
2255
+ type: _chunkQ4FXESVTjs.Modules.User,
2256
+ method: "POST" /* POST */,
2257
+ endpoint: endpoint.generate()
2258
+ });
2259
+ }
2260
+ static async update(params) {
2261
+ return this.callApi({
2262
+ type: _chunkQ4FXESVTjs.Modules.User,
2263
+ method: "PUT" /* PUT */,
2264
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.User, id: params.id }).generate(),
2265
+ companyId: params.companyId,
2266
+ input: params
2267
+ });
2268
+ }
2269
+ static async patchRate(params) {
2270
+ return this.callApi({
2271
+ type: _chunkQ4FXESVTjs.Modules.User,
2272
+ method: "PATCH" /* PATCH */,
2273
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.User, id: params.id, childEndpoint: "rates" }).generate(),
2274
+ companyId: params.companyId,
2275
+ input: params
2276
+ });
2277
+ }
2278
+ static async delete(params) {
2279
+ await this.callApi({
2280
+ type: _chunkQ4FXESVTjs.Modules.User,
2281
+ method: "DELETE" /* DELETE */,
2282
+ endpoint: new (0, _chunkQ4FXESVTjs.EndpointCreator)({ endpoint: _chunkQ4FXESVTjs.Modules.User, id: params.userId }).generate(),
2283
+ companyId: params.companyId
2284
+ });
2285
+ }
2286
+ };
1300
2287
 
2288
+ // src/features/user/author.module.ts
2289
+ var AuthorModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
2290
+ pageUrl: "/authors",
2291
+ name: "authors",
2292
+ model: User,
2293
+ moduleId: "04cfc677-0fd2-4f5e-adf4-2483a00c0277"
2294
+ }), "AuthorModule");
1301
2295
 
1302
2296
  // src/features/user/components/forms/RoleUserAdd.tsx
1303
2297
 
@@ -1625,6 +2619,170 @@ _chunk7QVYU63Ejs.__name.call(void 0, AttributeElement, "AttributeElement");
1625
2619
  // src/features/user/components/containers/UserContainer.tsx
1626
2620
 
1627
2621
 
2622
+ // src/features/user/contexts/CurrentUserContext.tsx
2623
+ var _cookiesnext = require('cookies-next');
2624
+
2625
+ var _utils = require('jotai/utils');
2626
+
2627
+
2628
+
2629
+ var userAtom = _utils.atomWithStorage.call(void 0, "user", null);
2630
+ var CurrentUserContext = _react.createContext.call(void 0, void 0);
2631
+ var CurrentUserProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ children }) => {
2632
+ const path = _navigation.usePathname.call(void 0, );
2633
+ const [dehydratedUser, setDehydratedUser] = _jotai.useAtom.call(void 0, userAtom);
2634
+ _react.useEffect.call(void 0, () => {
2635
+ const token = _cookiesnext.getCookie.call(void 0, "token");
2636
+ if (!token && dehydratedUser) setDehydratedUser(null);
2637
+ }, [dehydratedUser, setDehydratedUser]);
2638
+ const matchUrlToModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
2639
+ const moduleKeys = Object.getOwnPropertyNames(_chunkQ4FXESVTjs.Modules).filter(
2640
+ (key) => key !== "prototype" && key !== "_factory" && key !== "length" && key !== "name"
2641
+ );
2642
+ const matchedModuleKey = moduleKeys.find((key) => {
2643
+ const descriptor2 = Object.getOwnPropertyDescriptor(_chunkQ4FXESVTjs.Modules, key);
2644
+ if (!_optionalChain([descriptor2, 'optionalAccess', _86 => _86.get])) return false;
2645
+ const selectedModule = descriptor2.get.call(_chunkQ4FXESVTjs.Modules);
2646
+ return path.toLowerCase().startsWith(_optionalChain([selectedModule, 'access', _87 => _87.pageUrl, 'optionalAccess', _88 => _88.toLowerCase, 'call', _89 => _89()]));
2647
+ });
2648
+ if (!matchedModuleKey) return void 0;
2649
+ const descriptor = Object.getOwnPropertyDescriptor(_chunkQ4FXESVTjs.Modules, matchedModuleKey);
2650
+ return _optionalChain([descriptor, 'optionalAccess', _90 => _90.get, 'optionalAccess', _91 => _91.call, 'call', _92 => _92(_chunkQ4FXESVTjs.Modules)]);
2651
+ }, "matchUrlToModule");
2652
+ const currentUser = dehydratedUser ? _chunkQ4FXESVTjs.rehydrate.call(void 0, _chunkQ4FXESVTjs.Modules.User, dehydratedUser) : null;
2653
+ const company = _nullishCoalesce(_optionalChain([currentUser, 'optionalAccess', _93 => _93.company]), () => ( null));
2654
+ const setUser = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (user) => {
2655
+ if (user) setDehydratedUser(user.dehydrate());
2656
+ else setDehydratedUser(null);
2657
+ }, "setUser");
2658
+ const hasRole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (roleId) => {
2659
+ if (!currentUser) return false;
2660
+ return !!_optionalChain([currentUser, 'access', _94 => _94.roles, 'optionalAccess', _95 => _95.some, 'call', _96 => _96((userRole) => userRole.id === roleId)]);
2661
+ }, "hasRole");
2662
+ const hasAccesToFeature = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (featureIdentifier) => {
2663
+ if (hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator)) return true;
2664
+ if (!company) return false;
2665
+ return company.features.some((feature) => feature.id === featureIdentifier);
2666
+ }, "hasAccesToFeature");
2667
+ function hasPermissionToModule(params) {
2668
+ if (!currentUser) return false;
2669
+ if (!!params.module.feature && !hasAccesToFeature(params.module.feature)) return false;
2670
+ return _chunk32HM6MDDjs.checkPermissions.call(void 0, { module: params.module, action: params.action, data: params.data, user: currentUser });
2671
+ }
2672
+ _chunk7QVYU63Ejs.__name.call(void 0, hasPermissionToModule, "hasPermissionToModule");
2673
+ function hasPermissionToModules(params) {
2674
+ if (!currentUser) return false;
2675
+ if (!params.modules.every((module) => !module.feature || hasAccesToFeature(module.feature))) return false;
2676
+ return params.modules.every(
2677
+ (module) => _chunk32HM6MDDjs.checkPermissions.call(void 0, { module, action: params.action, data: params.data, user: currentUser })
2678
+ );
2679
+ }
2680
+ _chunk7QVYU63Ejs.__name.call(void 0, hasPermissionToModules, "hasPermissionToModules");
2681
+ function hasPermissionToPath(path2) {
2682
+ if (!currentUser) return false;
2683
+ if (path2 === "#" || path2 === "/") return true;
2684
+ const selectedModule = matchUrlToModule({ path: path2 });
2685
+ if (!selectedModule) return true;
2686
+ const response = hasPermissionToModule({ module: selectedModule, action: "read" /* Read */ });
2687
+ return response;
2688
+ }
2689
+ _chunk7QVYU63Ejs.__name.call(void 0, hasPermissionToPath, "hasPermissionToPath");
2690
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2691
+ CurrentUserContext.Provider,
2692
+ {
2693
+ value: {
2694
+ currentUser,
2695
+ company,
2696
+ setUser,
2697
+ hasPermissionToModule,
2698
+ hasPermissionToModules,
2699
+ hasPermissionToPath,
2700
+ hasAccesToFeature,
2701
+ matchUrlToModule,
2702
+ hasRole
2703
+ },
2704
+ children
2705
+ }
2706
+ );
2707
+ }, "CurrentUserProvider");
2708
+ function useCurrentUserContext() {
2709
+ const context = _react.useContext.call(void 0, CurrentUserContext);
2710
+ if (context === void 0) {
2711
+ throw new Error("useCurrentUserContext must be used within a UserProvider");
2712
+ }
2713
+ return context;
2714
+ }
2715
+ _chunk7QVYU63Ejs.__name.call(void 0, useCurrentUserContext, "useCurrentUserContext");
2716
+
2717
+ // src/features/user/contexts/UserContext.tsx
2718
+
2719
+
2720
+
2721
+ var UserContext = _react.createContext.call(void 0, void 0);
2722
+ var UserProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ children, dehydratedUser }) => {
2723
+ const generateUrl = usePageUrlGenerator();
2724
+ const { hasPermissionToModule } = useCurrentUserContext();
2725
+ const t = _nextintl.useTranslations.call(void 0, );
2726
+ const [user, setUser] = _react.useState.call(void 0,
2727
+ dehydratedUser ? _chunkQ4FXESVTjs.rehydrate.call(void 0, _chunkQ4FXESVTjs.Modules.User, dehydratedUser) : void 0
2728
+ );
2729
+ const breadcrumb = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
2730
+ const response = [];
2731
+ if (hasPermissionToModule({ module: _chunkQ4FXESVTjs.Modules.User, action: "update" /* Update */ })) {
2732
+ response.push({
2733
+ name: t(`generic.settings`),
2734
+ href: generateUrl({ page: `/settings` })
2735
+ });
2736
+ response.push({
2737
+ name: t(`types.users`, { count: 2 }),
2738
+ href: generateUrl({ page: `/settings`, id: _chunkQ4FXESVTjs.Modules.User.pageUrl })
2739
+ });
2740
+ }
2741
+ if (user)
2742
+ response.push({
2743
+ name: `${user.name}${user.isDeleted ? ` (${t(`foundations.user.deleted`)})` : ""}`,
2744
+ href: generateUrl({ page: _chunkQ4FXESVTjs.Modules.User, id: user.id })
2745
+ });
2746
+ return response;
2747
+ }, "breadcrumb");
2748
+ const title = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
2749
+ const response = {
2750
+ type: t(`types.users`, { count: user ? 1 : 2 })
2751
+ };
2752
+ const functions = [];
2753
+ if (user) {
2754
+ response.element = `${user.name}${user.isDeleted ? ` (${t(`foundations.user.deleted`)})` : ""}`;
2755
+ if (user.isDeleted) {
2756
+ functions.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserReactivator, { user, propagateChanges: setUser }, `UserReactivator`));
2757
+ } else {
2758
+ if (!user.isActivated)
2759
+ functions.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserResentInvitationEmail, { user }, `UserResentInvitationEmail`));
2760
+ functions.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserDeleter, { user }, `UserDeleter`));
2761
+ }
2762
+ functions.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserEditor, { user, propagateChanges: setUser }, `UserEditor`));
2763
+ }
2764
+ if (functions.length > 0) response.functions = functions;
2765
+ return response;
2766
+ }, "title");
2767
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2768
+ UserContext.Provider,
2769
+ {
2770
+ value: {
2771
+ user,
2772
+ setUser
2773
+ },
2774
+ children
2775
+ }
2776
+ ) });
2777
+ }, "UserProvider");
2778
+ var useUserContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
2779
+ const context = _react.useContext.call(void 0, UserContext);
2780
+ if (context === void 0) {
2781
+ throw new Error("useUserContext must be used within a UserProvider");
2782
+ }
2783
+ return context;
2784
+ }, "useUserContext");
2785
+
1628
2786
  // src/features/user/components/details/UserDetails.tsx
1629
2787
 
1630
2788
  var _image = require('next/image'); var _image2 = _interopRequireDefault(_image);
@@ -1673,7 +2831,7 @@ function UserAvatar({ user, className, showFull, showLink }) {
1673
2831
  }, "getInitials");
1674
2832
  const getAvatar = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
1675
2833
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "*:ring-border *:ring-1", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5IET37O4js.Avatar, { className: `h-6 w-6 ${className}`, children: [
1676
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.AvatarImage, { className: "object-cover", src: _optionalChain([user, 'optionalAccess', _47 => _47.avatar]) }),
2834
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.AvatarImage, { className: "object-cover", src: _optionalChain([user, 'optionalAccess', _97 => _97.avatar]) }),
1677
2835
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.AvatarFallback, { children: getInitials(user.name) })
1678
2836
  ] }) });
1679
2837
  }, "getAvatar");
@@ -1774,7 +2932,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, UsersListContainer, "UsersListContainer");
1774
2932
  function AdminUsersListInternal({ company }) {
1775
2933
  const t = _nextintl.useTranslations.call(void 0, );
1776
2934
  const data = useDataListRetriever({
1777
- retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkPO5Q3H5Ijs.UserService.findManyForAmin(params), "retriever"),
2935
+ retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => UserService.findManyForAmin(params), "retriever"),
1778
2936
  retrieverParams: { companyId: company.id },
1779
2937
  module: _chunkQ4FXESVTjs.Modules.User
1780
2938
  });
@@ -1806,8 +2964,8 @@ function CompanyUsersList({ isDeleted }) {
1806
2964
  const t = _nextintl.useTranslations.call(void 0, );
1807
2965
  const data = useDataListRetriever({
1808
2966
  ready: !!company,
1809
- retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkPO5Q3H5Ijs.UserService.findAllUsers(params), "retriever"),
1810
- retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _48 => _48.id]), isDeleted },
2967
+ retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => UserService.findAllUsers(params), "retriever"),
2968
+ retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _98 => _98.id]), isDeleted },
1811
2969
  module: _chunkQ4FXESVTjs.Modules.User
1812
2970
  });
1813
2971
  _react.useEffect.call(void 0, () => {
@@ -1863,7 +3021,7 @@ function RelevantUsersList({ id }) {
1863
3021
  const t = _nextintl.useTranslations.call(void 0, );
1864
3022
  const data = useDataListRetriever({
1865
3023
  module: _chunkQ4FXESVTjs.Modules.User,
1866
- retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkPO5Q3H5Ijs.UserService.findRelevant(params), "retriever"),
3024
+ retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => UserService.findRelevant(params), "retriever"),
1867
3025
  retrieverParams: { id }
1868
3026
  });
1869
3027
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -1884,7 +3042,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, RelevantUsersList, "RelevantUsersList");
1884
3042
  function RoleUsersList({ role }) {
1885
3043
  const t = _nextintl.useTranslations.call(void 0, );
1886
3044
  const data = useDataListRetriever({
1887
- retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkPO5Q3H5Ijs.UserService.findAllUsersByRole(params), "retriever"),
3045
+ retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => UserService.findAllUsersByRole(params), "retriever"),
1888
3046
  retrieverParams: { roleId: role.id },
1889
3047
  module: _chunkQ4FXESVTjs.Modules.User
1890
3048
  });
@@ -1913,11 +3071,11 @@ function UserListInAdd({ data, existingUsers, setSelectedUser, setLevelOpen }) {
1913
3071
  className: "cursor-pointer",
1914
3072
  onClick: (e) => {
1915
3073
  setSelectedUser(user);
1916
- _optionalChain([setLevelOpen, 'optionalCall', _49 => _49(true)]);
3074
+ _optionalChain([setLevelOpen, 'optionalCall', _99 => _99(true)]);
1917
3075
  },
1918
3076
  onSelect: (e) => {
1919
3077
  setSelectedUser(user);
1920
- _optionalChain([setLevelOpen, 'optionalCall', _50 => _50(true)]);
3078
+ _optionalChain([setLevelOpen, 'optionalCall', _100 => _100(true)]);
1921
3079
  },
1922
3080
  children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-row items-center justify-between px-4 py-1", children: [
1923
3081
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserAvatar, { user }),
@@ -1957,7 +3115,7 @@ function UsersListByContentIds({ contentIds }) {
1957
3115
  const t = _nextintl.useTranslations.call(void 0, );
1958
3116
  const data = useDataListRetriever({
1959
3117
  module: _chunkQ4FXESVTjs.Modules.User,
1960
- retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkPO5Q3H5Ijs.UserService.findManyByContentIds(params), "retriever"),
3118
+ retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => UserService.findManyByContentIds(params), "retriever"),
1961
3119
  retrieverParams: { contentIds }
1962
3120
  });
1963
3121
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -1987,7 +3145,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, AllowedUsersDetails, "AllowedUsersDetails")
1987
3145
  var _dynamic = require('next/dynamic'); var _dynamic2 = _interopRequireDefault(_dynamic);
1988
3146
 
1989
3147
 
1990
- var BlockNoteEditor = _dynamic2.default.call(void 0, () => Promise.resolve().then(() => _interopRequireWildcard(require("./BlockNoteEditor-QV6ESIQA.js"))), {
3148
+ var BlockNoteEditor = _dynamic2.default.call(void 0, () => Promise.resolve().then(() => _interopRequireWildcard(require("./BlockNoteEditor-G6AK2NWA.js"))), {
1991
3149
  ssr: false
1992
3150
  });
1993
3151
  var BlockNoteEditorContainer = React4.default.memo(/* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, function EditorContainer(props) {
@@ -2026,7 +3184,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, ErrorDetails, "ErrorDetails");
2026
3184
  // src/components/errors/errorToast.ts
2027
3185
  var _sonner = require('sonner');
2028
3186
  function errorToast(params) {
2029
- _sonner.toast.error(_nullishCoalesce(_optionalChain([params, 'optionalAccess', _51 => _51.title]), () => ( "Error")), {
3187
+ _sonner.toast.error(_nullishCoalesce(_optionalChain([params, 'optionalAccess', _101 => _101.title]), () => ( "Error")), {
2030
3188
  description: params.error instanceof Error ? params.error.message : String(params.error)
2031
3189
  });
2032
3190
  }
@@ -2427,7 +3585,7 @@ function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth
2427
3585
  const [open, setOpen] = _react.useState.call(void 0, false);
2428
3586
  const [prevRange, setPrevRange] = _react.useState.call(void 0, date);
2429
3587
  _react.useEffect.call(void 0, () => {
2430
- if (_optionalChain([date, 'optionalAccess', _52 => _52.from]) && _optionalChain([date, 'optionalAccess', _53 => _53.to]) && date.to > date.from && (_optionalChain([prevRange, 'optionalAccess', _54 => _54.from, 'optionalAccess', _55 => _55.getTime, 'call', _56 => _56()]) !== date.from.getTime() || _optionalChain([prevRange, 'optionalAccess', _57 => _57.to, 'optionalAccess', _58 => _58.getTime, 'call', _59 => _59()]) !== date.to.getTime())) {
3588
+ if (_optionalChain([date, 'optionalAccess', _102 => _102.from]) && _optionalChain([date, 'optionalAccess', _103 => _103.to]) && date.to > date.from && (_optionalChain([prevRange, 'optionalAccess', _104 => _104.from, 'optionalAccess', _105 => _105.getTime, 'call', _106 => _106()]) !== date.from.getTime() || _optionalChain([prevRange, 'optionalAccess', _107 => _107.to, 'optionalAccess', _108 => _108.getTime, 'call', _109 => _109()]) !== date.to.getTime())) {
2431
3589
  onDateChange(date);
2432
3590
  setPrevRange(date);
2433
3591
  setOpen(false);
@@ -2438,7 +3596,7 @@ function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth
2438
3596
  setDate(void 0);
2439
3597
  return;
2440
3598
  }
2441
- if (range.from && (!_optionalChain([date, 'optionalAccess', _60 => _60.from]) || range.from.getTime() !== date.from.getTime())) {
3599
+ if (range.from && (!_optionalChain([date, 'optionalAccess', _110 => _110.from]) || range.from.getTime() !== date.from.getTime())) {
2442
3600
  setDate({ from: range.from, to: void 0 });
2443
3601
  } else {
2444
3602
  setDate(range);
@@ -2453,7 +3611,7 @@ function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth
2453
3611
  className: _chunkDEYKTLA3js.cn.call(void 0, "w-[300px] justify-start text-left font-normal", !date && "text-muted-foreground"),
2454
3612
  children: [
2455
3613
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CalendarIcon, {}),
2456
- _optionalChain([date, 'optionalAccess', _61 => _61.from]) ? date.to ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
3614
+ _optionalChain([date, 'optionalAccess', _111 => _111.from]) ? date.to ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2457
3615
  _datefns.format.call(void 0, date.from, "LLL dd, y"),
2458
3616
  " - ",
2459
3617
  _datefns.format.call(void 0, date.to, "LLL dd, y")
@@ -2466,7 +3624,7 @@ function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth
2466
3624
  _chunk5IET37O4js.Calendar,
2467
3625
  {
2468
3626
  mode: "range",
2469
- defaultMonth: _nullishCoalesce(_optionalChain([date, 'optionalAccess', _62 => _62.from]), () => ( (showPreviousMonth ? new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth() - 1, 1) : void 0))),
3627
+ defaultMonth: _nullishCoalesce(_optionalChain([date, 'optionalAccess', _112 => _112.from]), () => ( (showPreviousMonth ? new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth() - 1, 1) : void 0))),
2470
3628
  selected: date,
2471
3629
  onSelect: handleSelect,
2472
3630
  numberOfMonths: 2
@@ -2554,7 +3712,7 @@ var FileUploader = _react.forwardRef.call(void 0,
2554
3712
  movePrev();
2555
3713
  } else if (e.key === "Enter" || e.key === "Space") {
2556
3714
  if (activeIndex === -1) {
2557
- _optionalChain([dropzoneState, 'access', _63 => _63.inputRef, 'access', _64 => _64.current, 'optionalAccess', _65 => _65.click, 'call', _66 => _66()]);
3715
+ _optionalChain([dropzoneState, 'access', _113 => _113.inputRef, 'access', _114 => _114.current, 'optionalAccess', _115 => _115.click, 'call', _116 => _116()]);
2558
3716
  }
2559
3717
  } else if (e.key === "Delete" || e.key === "Backspace") {
2560
3718
  if (activeIndex !== -1) {
@@ -2592,13 +3750,13 @@ var FileUploader = _react.forwardRef.call(void 0,
2592
3750
  onValueChange(newValues);
2593
3751
  if (rejectedFiles.length > 0) {
2594
3752
  for (let i = 0; i < rejectedFiles.length; i++) {
2595
- if (_optionalChain([rejectedFiles, 'access', _67 => _67[i], 'access', _68 => _68.errors, 'access', _69 => _69[0], 'optionalAccess', _70 => _70.code]) === "file-too-large") {
3753
+ if (_optionalChain([rejectedFiles, 'access', _117 => _117[i], 'access', _118 => _118.errors, 'access', _119 => _119[0], 'optionalAccess', _120 => _120.code]) === "file-too-large") {
2596
3754
  _sonner.toast.error(t("generic.errors.file"), {
2597
3755
  description: t(`generic.errors.file_max`, { size: maxSize / 1024 / 1024 })
2598
3756
  });
2599
3757
  break;
2600
3758
  }
2601
- if (_optionalChain([rejectedFiles, 'access', _71 => _71[i], 'access', _72 => _72.errors, 'access', _73 => _73[0], 'optionalAccess', _74 => _74.message])) {
3759
+ if (_optionalChain([rejectedFiles, 'access', _121 => _121[i], 'access', _122 => _122.errors, 'access', _123 => _123[0], 'optionalAccess', _124 => _124.message])) {
2602
3760
  _sonner.toast.error(t(`generic.errors.file`), {
2603
3761
  description: rejectedFiles[i].errors[0].message
2604
3762
  });
@@ -3407,11 +4565,11 @@ function FormPlaceAutocomplete({
3407
4565
  const data = await response.json();
3408
4566
  if (data.suggestions) {
3409
4567
  const formattedSuggestions = data.suggestions.map((suggestion) => ({
3410
- place_id: _optionalChain([suggestion, 'access', _75 => _75.placePrediction, 'optionalAccess', _76 => _76.placeId]) || "",
3411
- description: _optionalChain([suggestion, 'access', _77 => _77.placePrediction, 'optionalAccess', _78 => _78.text, 'optionalAccess', _79 => _79.text]) || "",
4568
+ place_id: _optionalChain([suggestion, 'access', _125 => _125.placePrediction, 'optionalAccess', _126 => _126.placeId]) || "",
4569
+ description: _optionalChain([suggestion, 'access', _127 => _127.placePrediction, 'optionalAccess', _128 => _128.text, 'optionalAccess', _129 => _129.text]) || "",
3412
4570
  structured_formatting: {
3413
- main_text: _optionalChain([suggestion, 'access', _80 => _80.placePrediction, 'optionalAccess', _81 => _81.structuredFormat, 'optionalAccess', _82 => _82.mainText, 'optionalAccess', _83 => _83.text]) || "",
3414
- secondary_text: _optionalChain([suggestion, 'access', _84 => _84.placePrediction, 'optionalAccess', _85 => _85.structuredFormat, 'optionalAccess', _86 => _86.secondaryText, 'optionalAccess', _87 => _87.text]) || ""
4571
+ main_text: _optionalChain([suggestion, 'access', _130 => _130.placePrediction, 'optionalAccess', _131 => _131.structuredFormat, 'optionalAccess', _132 => _132.mainText, 'optionalAccess', _133 => _133.text]) || "",
4572
+ secondary_text: _optionalChain([suggestion, 'access', _134 => _134.placePrediction, 'optionalAccess', _135 => _135.structuredFormat, 'optionalAccess', _136 => _136.secondaryText, 'optionalAccess', _137 => _137.text]) || ""
3415
4573
  }
3416
4574
  }));
3417
4575
  setSuggestions(formattedSuggestions);
@@ -3530,8 +4688,8 @@ function FormPlaceAutocomplete({
3530
4688
  className: "hover:bg-muted cursor-pointer px-3 py-2 text-sm",
3531
4689
  onClick: () => handleSuggestionSelect(suggestion),
3532
4690
  children: [
3533
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "font-medium", children: _optionalChain([suggestion, 'access', _88 => _88.structured_formatting, 'optionalAccess', _89 => _89.main_text]) }),
3534
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground", children: _optionalChain([suggestion, 'access', _90 => _90.structured_formatting, 'optionalAccess', _91 => _91.secondary_text]) })
4691
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "font-medium", children: _optionalChain([suggestion, 'access', _138 => _138.structured_formatting, 'optionalAccess', _139 => _139.main_text]) }),
4692
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground", children: _optionalChain([suggestion, 'access', _140 => _140.structured_formatting, 'optionalAccess', _141 => _141.secondary_text]) })
3535
4693
  ]
3536
4694
  },
3537
4695
  suggestion.place_id || index
@@ -3899,10 +5057,10 @@ var cellId = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
3899
5057
  cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => params.toggleId ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3900
5058
  _chunk5IET37O4js.Checkbox,
3901
5059
  {
3902
- checked: _optionalChain([params, 'access', _92 => _92.checkedIds, 'optionalAccess', _93 => _93.includes, 'call', _94 => _94(row.getValue(params.name))]) || false,
5060
+ checked: _optionalChain([params, 'access', _142 => _142.checkedIds, 'optionalAccess', _143 => _143.includes, 'call', _144 => _144(row.getValue(params.name))]) || false,
3903
5061
  onCheckedChange: (value) => {
3904
5062
  row.toggleSelected(!!value);
3905
- _optionalChain([params, 'access', _95 => _95.toggleId, 'optionalCall', _96 => _96(row.getValue(params.name))]);
5063
+ _optionalChain([params, 'access', _145 => _145.toggleId, 'optionalCall', _146 => _146(row.getValue(params.name))]);
3906
5064
  },
3907
5065
  "aria-label": "Select row"
3908
5066
  }
@@ -3977,13 +5135,13 @@ function useJsonApiGet(params) {
3977
5135
  const [response, setResponse] = _react.useState.call(void 0, null);
3978
5136
  const isMounted = _react.useRef.call(void 0, true);
3979
5137
  const fetchData = _react.useCallback.call(void 0, async () => {
3980
- if (_optionalChain([params, 'access', _97 => _97.options, 'optionalAccess', _98 => _98.enabled]) === false) return;
5138
+ if (_optionalChain([params, 'access', _147 => _147.options, 'optionalAccess', _148 => _148.enabled]) === false) return;
3981
5139
  setLoading(true);
3982
5140
  setError(null);
3983
5141
  try {
3984
- const { JsonApiGet } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-UJ7FGIVI.js")));
5142
+ const { JsonApiGet: JsonApiGet2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-UJ7FGIVI.js")));
3985
5143
  const language = navigator.language.split("-")[0] || "en";
3986
- const apiResponse = await JsonApiGet({
5144
+ const apiResponse = await JsonApiGet2({
3987
5145
  classKey: params.classKey,
3988
5146
  endpoint: params.endpoint,
3989
5147
  companyId: params.companyId,
@@ -4004,9 +5162,9 @@ function useJsonApiGet(params) {
4004
5162
  setLoading(false);
4005
5163
  }
4006
5164
  }
4007
- }, [params.classKey, params.endpoint, params.companyId, _optionalChain([params, 'access', _99 => _99.options, 'optionalAccess', _100 => _100.enabled])]);
5165
+ }, [params.classKey, params.endpoint, params.companyId, _optionalChain([params, 'access', _149 => _149.options, 'optionalAccess', _150 => _150.enabled])]);
4008
5166
  const fetchNextPage = _react.useCallback.call(void 0, async () => {
4009
- if (!_optionalChain([response, 'optionalAccess', _101 => _101.nextPage])) return;
5167
+ if (!_optionalChain([response, 'optionalAccess', _151 => _151.nextPage])) return;
4010
5168
  setLoading(true);
4011
5169
  try {
4012
5170
  const nextResponse = await response.nextPage();
@@ -4027,7 +5185,7 @@ function useJsonApiGet(params) {
4027
5185
  }
4028
5186
  }, [response]);
4029
5187
  const fetchPreviousPage = _react.useCallback.call(void 0, async () => {
4030
- if (!_optionalChain([response, 'optionalAccess', _102 => _102.prevPage])) return;
5188
+ if (!_optionalChain([response, 'optionalAccess', _152 => _152.prevPage])) return;
4031
5189
  setLoading(true);
4032
5190
  try {
4033
5191
  const prevResponse = await response.prevPage();
@@ -4053,15 +5211,15 @@ function useJsonApiGet(params) {
4053
5211
  return () => {
4054
5212
  isMounted.current = false;
4055
5213
  };
4056
- }, [fetchData, ..._optionalChain([params, 'access', _103 => _103.options, 'optionalAccess', _104 => _104.deps]) || []]);
5214
+ }, [fetchData, ..._optionalChain([params, 'access', _153 => _153.options, 'optionalAccess', _154 => _154.deps]) || []]);
4057
5215
  return {
4058
5216
  data,
4059
5217
  loading,
4060
5218
  error,
4061
5219
  response,
4062
5220
  refetch: fetchData,
4063
- hasNextPage: !!_optionalChain([response, 'optionalAccess', _105 => _105.next]),
4064
- hasPreviousPage: !!_optionalChain([response, 'optionalAccess', _106 => _106.prev]),
5221
+ hasNextPage: !!_optionalChain([response, 'optionalAccess', _155 => _155.next]),
5222
+ hasPreviousPage: !!_optionalChain([response, 'optionalAccess', _156 => _156.prev]),
4065
5223
  fetchNextPage,
4066
5224
  fetchPreviousPage
4067
5225
  };
@@ -4086,12 +5244,12 @@ function useJsonApiMutation(config) {
4086
5244
  setLoading(true);
4087
5245
  setError(null);
4088
5246
  try {
4089
- const { JsonApiPost, JsonApiPut, JsonApiPatch, JsonApiDelete } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-UJ7FGIVI.js")));
5247
+ const { JsonApiPost: JsonApiPost2, JsonApiPut, JsonApiPatch, JsonApiDelete: JsonApiDelete2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-UJ7FGIVI.js")));
4090
5248
  const language = navigator.language.split("-")[0] || "en";
4091
5249
  let apiResponse;
4092
5250
  switch (config.method) {
4093
5251
  case "POST":
4094
- apiResponse = await JsonApiPost({
5252
+ apiResponse = await JsonApiPost2({
4095
5253
  classKey: config.classKey,
4096
5254
  endpoint: params.endpoint,
4097
5255
  companyId: params.companyId,
@@ -4126,7 +5284,7 @@ function useJsonApiMutation(config) {
4126
5284
  });
4127
5285
  break;
4128
5286
  case "DELETE":
4129
- apiResponse = await JsonApiDelete({
5287
+ apiResponse = await JsonApiDelete2({
4130
5288
  classKey: config.classKey,
4131
5289
  endpoint: params.endpoint,
4132
5290
  companyId: params.companyId,
@@ -4139,17 +5297,17 @@ function useJsonApiMutation(config) {
4139
5297
  if (apiResponse.ok) {
4140
5298
  const resultData = apiResponse.data;
4141
5299
  setData(resultData);
4142
- _optionalChain([config, 'access', _107 => _107.onSuccess, 'optionalCall', _108 => _108(resultData)]);
5300
+ _optionalChain([config, 'access', _157 => _157.onSuccess, 'optionalCall', _158 => _158(resultData)]);
4143
5301
  return resultData;
4144
5302
  } else {
4145
5303
  setError(apiResponse.error);
4146
- _optionalChain([config, 'access', _109 => _109.onError, 'optionalCall', _110 => _110(apiResponse.error)]);
5304
+ _optionalChain([config, 'access', _159 => _159.onError, 'optionalCall', _160 => _160(apiResponse.error)]);
4147
5305
  return null;
4148
5306
  }
4149
5307
  } catch (err) {
4150
5308
  const errorMessage = err instanceof Error ? err.message : "Unknown error";
4151
5309
  setError(errorMessage);
4152
- _optionalChain([config, 'access', _111 => _111.onError, 'optionalCall', _112 => _112(errorMessage)]);
5310
+ _optionalChain([config, 'access', _161 => _161.onError, 'optionalCall', _162 => _162(errorMessage)]);
4153
5311
  return null;
4154
5312
  } finally {
4155
5313
  setLoading(false);
@@ -4222,7 +5380,7 @@ var useCompanyTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
4222
5380
  {
4223
5381
  href: hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator) ? generateUrl({
4224
5382
  page: "/administration",
4225
- id: _optionalChain([_chunkQ4FXESVTjs.Modules, 'access', _113 => _113.Company, 'access', _114 => _114.pageUrl, 'optionalAccess', _115 => _115.substring, 'call', _116 => _116(1)]),
5383
+ id: _optionalChain([_chunkQ4FXESVTjs.Modules, 'access', _163 => _163.Company, 'access', _164 => _164.pageUrl, 'optionalAccess', _165 => _165.substring, 'call', _166 => _166(1)]),
4226
5384
  childPage: company.id
4227
5385
  }) : generateUrl({ page: _chunkQ4FXESVTjs.Modules.Company, id: company.id }),
4228
5386
  children: row.getValue("name")
@@ -4238,7 +5396,7 @@ var useCompanyTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
4238
5396
  })
4239
5397
  };
4240
5398
  const columns = _react.useMemo.call(void 0, () => {
4241
- return params.fields.map((field) => _optionalChain([fieldColumnMap, 'access', _117 => _117[field], 'optionalCall', _118 => _118()])).filter((col) => col !== void 0);
5399
+ return params.fields.map((field) => _optionalChain([fieldColumnMap, 'access', _167 => _167[field], 'optionalCall', _168 => _168()])).filter((col) => col !== void 0);
4242
5400
  }, [params.fields, fieldColumnMap, t, generateUrl, hasRole]);
4243
5401
  return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
4244
5402
  }, "useCompanyTableStructure");
@@ -4293,7 +5451,7 @@ var useRoleTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0,
4293
5451
  })
4294
5452
  };
4295
5453
  const columns = _react.useMemo.call(void 0, () => {
4296
- return params.fields.map((field) => _optionalChain([fieldColumnMap, 'access', _119 => _119[field], 'optionalCall', _120 => _120()])).filter((col) => col !== void 0);
5454
+ return params.fields.map((field) => _optionalChain([fieldColumnMap, 'access', _169 => _169[field], 'optionalCall', _170 => _170()])).filter((col) => col !== void 0);
4297
5455
  }, [params.fields, fieldColumnMap, t, generateUrl]);
4298
5456
  return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
4299
5457
  }, "useRoleTableStructure");
@@ -4311,7 +5469,7 @@ var useUserSearch = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
4311
5469
  if (search === searchQueryRef.current && users.length > 0) return;
4312
5470
  setIsLoading(true);
4313
5471
  searchQueryRef.current = search;
4314
- const fetchedUsers = await _chunkPO5Q3H5Ijs.UserService.findMany({ search, fetchAll: true });
5472
+ const fetchedUsers = await UserService.findMany({ search, fetchAll: true });
4315
5473
  setUsers(fetchedUsers);
4316
5474
  } catch (error) {
4317
5475
  console.error("Failed to load users:", error);
@@ -4436,7 +5594,7 @@ var useUserTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0,
4436
5594
  })
4437
5595
  };
4438
5596
  const columns = _react.useMemo.call(void 0, () => {
4439
- return params.fields.map((field) => _optionalChain([fieldColumnMap, 'access', _121 => _121[field], 'optionalCall', _122 => _122()])).filter((col) => col !== void 0);
5597
+ return params.fields.map((field) => _optionalChain([fieldColumnMap, 'access', _171 => _171[field], 'optionalCall', _172 => _172()])).filter((col) => col !== void 0);
4440
5598
  }, [params.fields, fieldColumnMap, t, generateUrl]);
4441
5599
  return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
4442
5600
  }, "useUserTableStructure");
@@ -4537,11 +5695,11 @@ var useContentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
4537
5695
  return params.fields.map((field) => {
4538
5696
  const localHandler = fieldColumnMap[field];
4539
5697
  if (localHandler) return localHandler();
4540
- const customHandler = _optionalChain([params, 'access', _123 => _123.context, 'optionalAccess', _124 => _124.customCells, 'optionalAccess', _125 => _125[field]]);
5698
+ const customHandler = _optionalChain([params, 'access', _173 => _173.context, 'optionalAccess', _174 => _174.customCells, 'optionalAccess', _175 => _175[field]]);
4541
5699
  if (customHandler) return customHandler({ t });
4542
5700
  return void 0;
4543
5701
  }).filter((col) => col !== void 0);
4544
- }, [params.fields, fieldColumnMap, t, generateUrl, _optionalChain([params, 'access', _126 => _126.context, 'optionalAccess', _127 => _127.customCells])]);
5702
+ }, [params.fields, fieldColumnMap, t, generateUrl, _optionalChain([params, 'access', _176 => _176.context, 'optionalAccess', _177 => _177.customCells])]);
4545
5703
  return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
4546
5704
  }, "useContentTableStructure");
4547
5705
 
@@ -4588,7 +5746,7 @@ function ContentTableSearch({ data }) {
4588
5746
  const handleSearchIconClick = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
4589
5747
  if (!isExpanded) {
4590
5748
  setIsFocused(true);
4591
- setTimeout(() => _optionalChain([inputRef, 'access', _128 => _128.current, 'optionalAccess', _129 => _129.focus, 'call', _130 => _130()]), 50);
5749
+ setTimeout(() => _optionalChain([inputRef, 'access', _178 => _178.current, 'optionalAccess', _179 => _179.focus, 'call', _180 => _180()]), 50);
4592
5750
  }
4593
5751
  }, "handleSearchIconClick");
4594
5752
  const handleBlur = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
@@ -4651,7 +5809,7 @@ var EMPTY_ARRAY = [];
4651
5809
  var ContentListTable = _react.memo.call(void 0, /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, function ContentListTable2(props) {
4652
5810
  const { data, fields, checkedIds, toggleId, allowSearch, filters } = props;
4653
5811
  const { data: tableData, columns: tableColumns } = useTableGenerator(props.tableGeneratorType, {
4654
- data: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _131 => _131.data]), () => ( EMPTY_ARRAY)),
5812
+ data: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _181 => _181.data]), () => ( EMPTY_ARRAY)),
4655
5813
  fields,
4656
5814
  checkedIds,
4657
5815
  toggleId,
@@ -4692,7 +5850,7 @@ var ContentListTable = _react.memo.call(void 0, /* @__PURE__ */ _chunk7QVYU63Ejs
4692
5850
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.TableHead, { children: header.isPlaceholder ? null : _reacttable.flexRender.call(void 0, header.column.columnDef.header, header.getContext()) }, header.id);
4693
5851
  }) }, headerGroup.id))
4694
5852
  ] }),
4695
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.TableBody, { children: rowModel && _optionalChain([rowModel, 'access', _132 => _132.rows, 'optionalAccess', _133 => _133.length]) ? rowModel.rows.map((row) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.TableCell, { children: _reacttable.flexRender.call(void 0, cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.TableRow, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.TableCell, { colSpan: tableColumns.length, className: "h-24 text-center", children: "No results." }) }) }),
5853
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.TableBody, { children: rowModel && _optionalChain([rowModel, 'access', _182 => _182.rows, 'optionalAccess', _183 => _183.length]) ? rowModel.rows.map((row) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.TableCell, { children: _reacttable.flexRender.call(void 0, cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.TableRow, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.TableCell, { colSpan: tableColumns.length, className: "h-24 text-center", children: "No results." }) }) }),
4696
5854
  showFooter && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.TableFooter, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.TableRow, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.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: [
4697
5855
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4698
5856
  _chunk5IET37O4js.Button,
@@ -4701,7 +5859,7 @@ var ContentListTable = _react.memo.call(void 0, /* @__PURE__ */ _chunk7QVYU63Ejs
4701
5859
  size: "sm",
4702
5860
  onClick: (e) => {
4703
5861
  e.preventDefault();
4704
- _optionalChain([data, 'access', _134 => _134.previous, 'optionalCall', _135 => _135(true)]);
5862
+ _optionalChain([data, 'access', _184 => _184.previous, 'optionalCall', _185 => _185(true)]);
4705
5863
  },
4706
5864
  disabled: !data.previous,
4707
5865
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.CaretLeftIcon, { className: "h-4 w-4" })
@@ -4719,7 +5877,7 @@ var ContentListTable = _react.memo.call(void 0, /* @__PURE__ */ _chunk7QVYU63Ejs
4719
5877
  size: "sm",
4720
5878
  onClick: (e) => {
4721
5879
  e.preventDefault();
4722
- _optionalChain([data, 'access', _136 => _136.next, 'optionalCall', _137 => _137(true)]);
5880
+ _optionalChain([data, 'access', _186 => _186.next, 'optionalCall', _187 => _187(true)]);
4723
5881
  },
4724
5882
  disabled: !data.next,
4725
5883
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.CaretRightIcon, { className: "h-4 w-4" })
@@ -4780,7 +5938,7 @@ function Register() {
4780
5938
  email: values.email,
4781
5939
  password: values.password
4782
5940
  };
4783
- await _chunkPO5Q3H5Ijs.AuthService.register(payload);
5941
+ await AuthService.register(payload);
4784
5942
  setShowConfirmation(true);
4785
5943
  } catch (e) {
4786
5944
  errorToast({ error: e });
@@ -4981,7 +6139,7 @@ function AcceptInvitation() {
4981
6139
  const payload = {
4982
6140
  code
4983
6141
  };
4984
- await _chunkPO5Q3H5Ijs.AuthService.validateCode(payload);
6142
+ await AuthService.validateCode(payload);
4985
6143
  } catch (e) {
4986
6144
  setError(e instanceof Error ? e.message : String(e));
4987
6145
  errorToast({ title: t(`generic.errors.error`), error: e });
@@ -5014,12 +6172,12 @@ function AcceptInvitation() {
5014
6172
  });
5015
6173
  const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
5016
6174
  try {
5017
- if (!_optionalChain([params, 'optionalAccess', _138 => _138.code])) return;
6175
+ if (!_optionalChain([params, 'optionalAccess', _188 => _188.code])) return;
5018
6176
  const payload = {
5019
- code: _optionalChain([params, 'optionalAccess', _139 => _139.code]),
6177
+ code: _optionalChain([params, 'optionalAccess', _189 => _189.code]),
5020
6178
  password: values.password
5021
6179
  };
5022
- await _chunkPO5Q3H5Ijs.AuthService.acceptInvitation(payload);
6180
+ await AuthService.acceptInvitation(payload);
5023
6181
  setShowConfirmation(true);
5024
6182
  _sonner.toast.success(t("foundations.auth.account_activated"), {
5025
6183
  description: t("foundations.auth.account_activated_description")
@@ -5082,7 +6240,7 @@ function ActivateAccount() {
5082
6240
  const payload = {
5083
6241
  activationCode: code
5084
6242
  };
5085
- await _chunkPO5Q3H5Ijs.AuthService.activate(payload);
6243
+ await AuthService.activate(payload);
5086
6244
  setShowConfirmation(true);
5087
6245
  setParams(void 0);
5088
6246
  _sonner.toast.success(t("foundations.auth.account_activated"), {
@@ -5125,7 +6283,7 @@ function Cookies({ dehydratedAuth, page }) {
5125
6283
  _react.useEffect.call(void 0, () => {
5126
6284
  if (hasSaved) return;
5127
6285
  async function saveTokenOnServer() {
5128
- await _chunkPO5Q3H5Ijs.AuthService.saveToken({ dehydratedAuth });
6286
+ await AuthService.saveToken({ dehydratedAuth });
5129
6287
  const auth = _chunkQ4FXESVTjs.rehydrate.call(void 0, _chunkQ4FXESVTjs.Modules.Auth, dehydratedAuth);
5130
6288
  setUser(auth.user);
5131
6289
  setHasSaved(true);
@@ -5169,7 +6327,7 @@ function ForgotPassword() {
5169
6327
  const payload = {
5170
6328
  email: values.email
5171
6329
  };
5172
- await _chunkPO5Q3H5Ijs.AuthService.initialiseForgotPassword(payload);
6330
+ await AuthService.initialiseForgotPassword(payload);
5173
6331
  setShowConfirmation(true);
5174
6332
  } catch (e) {
5175
6333
  errorToast({ error: e });
@@ -5240,7 +6398,7 @@ function Login() {
5240
6398
  });
5241
6399
  const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
5242
6400
  try {
5243
- const user = await _chunkPO5Q3H5Ijs.AuthService.login({
6401
+ const user = await AuthService.login({
5244
6402
  email: values.email,
5245
6403
  password: values.password
5246
6404
  });
@@ -5319,7 +6477,7 @@ function Logout() {
5319
6477
  const generateUrl = usePageUrlGenerator();
5320
6478
  _react.useEffect.call(void 0, () => {
5321
6479
  const logOut = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
5322
- await _chunkPO5Q3H5Ijs.AuthService.logout();
6480
+ await AuthService.logout();
5323
6481
  window.location.href = generateUrl({ page: `/` });
5324
6482
  }, "logOut");
5325
6483
  logOut();
@@ -5334,20 +6492,20 @@ _chunk7QVYU63Ejs.__name.call(void 0, Logout, "Logout");
5334
6492
  function RefreshUser() {
5335
6493
  const { setUser } = useCurrentUserContext();
5336
6494
  const loadFullUser = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
5337
- const fullUser = await _chunkPO5Q3H5Ijs.UserService.findFullUser();
6495
+ const fullUser = await UserService.findFullUser();
5338
6496
  if (fullUser) {
5339
6497
  setUser(fullUser);
5340
6498
  const token = {
5341
6499
  userId: fullUser.id,
5342
- companyId: _optionalChain([fullUser, 'access', _140 => _140.company, 'optionalAccess', _141 => _141.id]),
5343
- licenseExpirationDate: _optionalChain([fullUser, 'access', _142 => _142.company, 'optionalAccess', _143 => _143.licenseExpirationDate]),
6500
+ companyId: _optionalChain([fullUser, 'access', _190 => _190.company, 'optionalAccess', _191 => _191.id]),
6501
+ licenseExpirationDate: _optionalChain([fullUser, 'access', _192 => _192.company, 'optionalAccess', _193 => _193.licenseExpirationDate]),
5344
6502
  roles: fullUser.roles.map((role) => role.id),
5345
- features: _nullishCoalesce(_optionalChain([fullUser, 'access', _144 => _144.company, 'optionalAccess', _145 => _145.features, 'optionalAccess', _146 => _146.map, 'call', _147 => _147((feature) => feature.id)]), () => ( [])),
6503
+ features: _nullishCoalesce(_optionalChain([fullUser, 'access', _194 => _194.company, 'optionalAccess', _195 => _195.features, 'optionalAccess', _196 => _196.map, 'call', _197 => _197((feature) => feature.id)]), () => ( [])),
5346
6504
  modules: fullUser.modules.map((module) => {
5347
6505
  return { id: module.id, permissions: module.permissions };
5348
6506
  })
5349
6507
  };
5350
- await _optionalChain([_chunkAYHKQWHHjs.getTokenHandler.call(void 0, ), 'optionalAccess', _148 => _148.updateToken, 'call', _149 => _149(token)]);
6508
+ await _optionalChain([_chunkAYHKQWHHjs.getTokenHandler.call(void 0, ), 'optionalAccess', _198 => _198.updateToken, 'call', _199 => _199(token)]);
5351
6509
  _cookiesnext.deleteCookie.call(void 0, "reloadData");
5352
6510
  }
5353
6511
  }, "loadFullUser");
@@ -5379,7 +6537,7 @@ function ResetPassword() {
5379
6537
  const payload = {
5380
6538
  code
5381
6539
  };
5382
- await _chunkPO5Q3H5Ijs.AuthService.validateCode(payload);
6540
+ await AuthService.validateCode(payload);
5383
6541
  } catch (e) {
5384
6542
  setError(e instanceof Error ? e.message : String(e));
5385
6543
  errorToast({ title: t(`generic.errors.error`), error: e });
@@ -5412,12 +6570,12 @@ function ResetPassword() {
5412
6570
  });
5413
6571
  const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
5414
6572
  try {
5415
- if (!_optionalChain([params, 'optionalAccess', _150 => _150.code])) return;
6573
+ if (!_optionalChain([params, 'optionalAccess', _200 => _200.code])) return;
5416
6574
  const payload = {
5417
- code: _optionalChain([params, 'optionalAccess', _151 => _151.code]),
6575
+ code: _optionalChain([params, 'optionalAccess', _201 => _201.code]),
5418
6576
  password: values.password
5419
6577
  };
5420
- await _chunkPO5Q3H5Ijs.AuthService.resetPassword(payload);
6578
+ await AuthService.resetPassword(payload);
5421
6579
  setShowConfirmation(true);
5422
6580
  _sonner.toast.success(t(`foundations.auth.reset_success`), {
5423
6581
  description: t(`foundations.auth.reset_success_description`)
@@ -5580,8 +6738,8 @@ function CompanyConfigurationEditorInternal({ company }) {
5580
6738
  const { setUser } = useCurrentUserContext();
5581
6739
  const defaultValues = _react.useMemo.call(void 0, () => {
5582
6740
  return {
5583
- isManagedKnowledge: _nullishCoalesce(_optionalChain([company, 'access', _152 => _152.configurations, 'optionalAccess', _153 => _153.isManagedKnowledge]), () => ( false)),
5584
- allowPublicBot: _nullishCoalesce(_optionalChain([company, 'access', _154 => _154.configurations, 'optionalAccess', _155 => _155.allowPublicBot]), () => ( false))
6741
+ isManagedKnowledge: _nullishCoalesce(_optionalChain([company, 'access', _202 => _202.configurations, 'optionalAccess', _203 => _203.isManagedKnowledge]), () => ( false)),
6742
+ allowPublicBot: _nullishCoalesce(_optionalChain([company, 'access', _204 => _204.configurations, 'optionalAccess', _205 => _205.allowPublicBot]), () => ( false))
5585
6743
  };
5586
6744
  }, [company.configurations]);
5587
6745
  const close = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
@@ -5600,8 +6758,8 @@ function CompanyConfigurationEditorInternal({ company }) {
5600
6758
  _react.useEffect.call(void 0, () => {
5601
6759
  if (open) {
5602
6760
  form.reset({
5603
- isManagedKnowledge: _nullishCoalesce(_optionalChain([company, 'access', _156 => _156.configurations, 'optionalAccess', _157 => _157.isManagedKnowledge]), () => ( false)),
5604
- allowPublicBot: _nullishCoalesce(_optionalChain([company, 'access', _158 => _158.configurations, 'optionalAccess', _159 => _159.allowPublicBot]), () => ( false))
6761
+ isManagedKnowledge: _nullishCoalesce(_optionalChain([company, 'access', _206 => _206.configurations, 'optionalAccess', _207 => _207.isManagedKnowledge]), () => ( false)),
6762
+ allowPublicBot: _nullishCoalesce(_optionalChain([company, 'access', _208 => _208.configurations, 'optionalAccess', _209 => _209.allowPublicBot]), () => ( false))
5605
6763
  });
5606
6764
  }
5607
6765
  }, [company, open]);
@@ -5614,8 +6772,8 @@ function CompanyConfigurationEditorInternal({ company }) {
5614
6772
  }
5615
6773
  };
5616
6774
  try {
5617
- await _chunkPO5Q3H5Ijs.CompanyService.updateConfigurations(payload);
5618
- const fullUser = await _chunkPO5Q3H5Ijs.UserService.findFullUser();
6775
+ await CompanyService.updateConfigurations(payload);
6776
+ const fullUser = await UserService.findFullUser();
5619
6777
  if (fullUser) {
5620
6778
  setUser(fullUser);
5621
6779
  }
@@ -5670,7 +6828,7 @@ function CompanyDeleterInternal({ company }) {
5670
6828
  const handleDelete = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
5671
6829
  setIsDeleting(true);
5672
6830
  try {
5673
- await _chunkPO5Q3H5Ijs.CompanyService.delete({ companyId: company.id });
6831
+ await CompanyService.delete({ companyId: company.id });
5674
6832
  router.push("/");
5675
6833
  } catch (error) {
5676
6834
  errorToast({ title: t(`generic.errors.delete`), error });
@@ -5779,16 +6937,16 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
5779
6937
  const form = _reacthookform.useForm.call(void 0, {
5780
6938
  resolver: _zod.zodResolver.call(void 0, formSchema),
5781
6939
  defaultValues: {
5782
- id: _optionalChain([company, 'optionalAccess', _160 => _160.id]) || _uuid.v4.call(void 0, ),
5783
- name: _optionalChain([company, 'optionalAccess', _161 => _161.name]) || "",
5784
- featureIds: _optionalChain([company, 'optionalAccess', _162 => _162.features, 'access', _163 => _163.map, 'call', _164 => _164((feature) => feature.id)]) || [],
5785
- moduleIds: _optionalChain([company, 'optionalAccess', _165 => _165.modules, 'access', _166 => _166.map, 'call', _167 => _167((module) => module.id)]) || [],
5786
- logo: _optionalChain([company, 'optionalAccess', _168 => _168.logo]) || ""
6940
+ id: _optionalChain([company, 'optionalAccess', _210 => _210.id]) || _uuid.v4.call(void 0, ),
6941
+ name: _optionalChain([company, 'optionalAccess', _211 => _211.name]) || "",
6942
+ featureIds: _optionalChain([company, 'optionalAccess', _212 => _212.features, 'access', _213 => _213.map, 'call', _214 => _214((feature) => feature.id)]) || [],
6943
+ moduleIds: _optionalChain([company, 'optionalAccess', _215 => _215.modules, 'access', _216 => _216.map, 'call', _217 => _217((module) => module.id)]) || [],
6944
+ logo: _optionalChain([company, 'optionalAccess', _218 => _218.logo]) || ""
5787
6945
  }
5788
6946
  });
5789
6947
  const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
5790
6948
  if (values.logo && contentType) {
5791
- const s3 = await _chunkPO5Q3H5Ijs.S3Service.getPreSignedUrl({
6949
+ const s3 = await S3Service.getPreSignedUrl({
5792
6950
  key: values.logo,
5793
6951
  contentType,
5794
6952
  isPublic: true
@@ -5800,14 +6958,14 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
5800
6958
  });
5801
6959
  }
5802
6960
  const payload = {
5803
- id: _nullishCoalesce(_optionalChain([company, 'optionalAccess', _169 => _169.id]), () => ( _uuid.v4.call(void 0, ))),
6961
+ id: _nullishCoalesce(_optionalChain([company, 'optionalAccess', _219 => _219.id]), () => ( _uuid.v4.call(void 0, ))),
5804
6962
  name: values.name,
5805
6963
  logo: files && contentType ? values.logo : void 0,
5806
6964
  featureIds: values.featureIds,
5807
6965
  moduleIds: values.moduleIds
5808
6966
  };
5809
6967
  try {
5810
- const updatedCompany = company ? await _chunkPO5Q3H5Ijs.CompanyService.update(payload) : await _chunkPO5Q3H5Ijs.CompanyService.create(payload);
6968
+ const updatedCompany = company ? await CompanyService.update(payload) : await CompanyService.create(payload);
5811
6969
  if (onRevalidate) {
5812
6970
  await onRevalidate(generateUrl({ page: _chunkQ4FXESVTjs.Modules.Company, id: updatedCompany.id, language: `[locale]` }));
5813
6971
  }
@@ -5827,7 +6985,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
5827
6985
  }, "onSubmit");
5828
6986
  _react.useEffect.call(void 0, () => {
5829
6987
  async function fetchFeatures() {
5830
- const allfeatures = await _chunkPO5Q3H5Ijs.FeatureService.findMany({});
6988
+ const allfeatures = await FeatureService.findMany({});
5831
6989
  if (hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator)) {
5832
6990
  setFeatures(allfeatures);
5833
6991
  } else {
@@ -5835,7 +6993,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
5835
6993
  }
5836
6994
  }
5837
6995
  _chunk7QVYU63Ejs.__name.call(void 0, fetchFeatures, "fetchFeatures");
5838
- if (open && features.length === 0 && (hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator) || hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).CompanyAdministrator) && _optionalChain([process, 'access', _170 => _170.env, 'access', _171 => _171.NEXT_PUBLIC_PRIVATE_INSTALLATION, 'optionalAccess', _172 => _172.toLowerCase, 'call', _173 => _173()]) === "true"))
6996
+ if (open && features.length === 0 && (hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator) || hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).CompanyAdministrator) && _optionalChain([process, 'access', _220 => _220.env, 'access', _221 => _221.NEXT_PUBLIC_PRIVATE_INSTALLATION, 'optionalAccess', _222 => _222.toLowerCase, 'call', _223 => _223()]) === "true"))
5839
6997
  fetchFeatures();
5840
6998
  }, [open, features]);
5841
6999
  _react.useEffect.call(void 0, () => {
@@ -5869,7 +7027,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
5869
7027
  "application/images": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"]
5870
7028
  }
5871
7029
  };
5872
- const canAccessFeatures = hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator) || hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).CompanyAdministrator) && _optionalChain([process, 'access', _174 => _174.env, 'access', _175 => _175.NEXT_PUBLIC_PRIVATE_INSTALLATION, 'optionalAccess', _176 => _176.toLowerCase, 'call', _177 => _177()]) === "true";
7030
+ const canAccessFeatures = hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator) || hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).CompanyAdministrator) && _optionalChain([process, 'access', _224 => _224.env, 'access', _225 => _225.NEXT_PUBLIC_PRIVATE_INSTALLATION, 'optionalAccess', _226 => _226.toLowerCase, 'call', _227 => _227()]) === "true";
5873
7031
  const isAdministrator = hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator);
5874
7032
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5IET37O4js.Dialog, { open, onOpenChange: setOpen, children: [
5875
7033
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorTrigger, { isEdit: !!company }),
@@ -5878,13 +7036,13 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
5878
7036
  {
5879
7037
  className: `flex max-h-[70vh] w-full ${isAdministrator || canAccessFeatures ? `max-w-5xl` : `max-w-4xl`} flex-col overflow-y-auto`,
5880
7038
  children: [
5881
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorHeader, { type: t(`types.companies`, { count: 1 }), name: _optionalChain([company, 'optionalAccess', _178 => _178.name]) }),
7039
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorHeader, { type: t(`types.companies`, { count: 1 }), name: _optionalChain([company, 'optionalAccess', _228 => _228.name]) }),
5882
7040
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: `flex w-full flex-col gap-y-4`, children: [
5883
7041
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full items-start justify-between gap-x-4", children: [
5884
- /* @__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', _179 => _179.logo]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7042
+ /* @__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', _229 => _229.logo]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5885
7043
  _image2.default,
5886
7044
  {
5887
- src: file ? URL.createObjectURL(file) : _optionalChain([company, 'optionalAccess', _180 => _180.logo]) || "",
7045
+ src: file ? URL.createObjectURL(file) : _optionalChain([company, 'optionalAccess', _230 => _230.logo]) || "",
5888
7046
  alt: "Company Logo",
5889
7047
  width: 200,
5890
7048
  height: 200
@@ -5941,7 +7099,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, CompanyEditor, "CompanyEditor");
5941
7099
  function CompaniesList() {
5942
7100
  const t = _nextintl.useTranslations.call(void 0, );
5943
7101
  const data = useDataListRetriever({
5944
- retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkPO5Q3H5Ijs.CompanyService.findMany(params), "retriever"),
7102
+ retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => CompanyService.findMany(params), "retriever"),
5945
7103
  retrieverParams: {},
5946
7104
  module: _chunkQ4FXESVTjs.Modules.Company
5947
7105
  });
@@ -5997,7 +7155,7 @@ function ContentsListById({ contentIds }) {
5997
7155
  const t = _nextintl.useTranslations.call(void 0, );
5998
7156
  const data = useDataListRetriever({
5999
7157
  module: _chunkQ4FXESVTjs.Modules.Content,
6000
- retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkPO5Q3H5Ijs.ContentService.findMany(params), "retriever"),
7158
+ retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => ContentService.findMany(params), "retriever"),
6001
7159
  retrieverParams: { contentIds }
6002
7160
  });
6003
7161
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -6019,7 +7177,7 @@ function RelevantContentsList({ id }) {
6019
7177
  const t = _nextintl.useTranslations.call(void 0, );
6020
7178
  const data = useDataListRetriever({
6021
7179
  module: _chunkQ4FXESVTjs.Modules.Content,
6022
- retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkPO5Q3H5Ijs.ContentService.findRelevant(params), "retriever"),
7180
+ retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => ContentService.findRelevant(params), "retriever"),
6023
7181
  retrieverParams: { id }
6024
7182
  });
6025
7183
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -6094,7 +7252,7 @@ function NotificationToast(notification, t, generateUrl, reouter) {
6094
7252
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col", children: [
6095
7253
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: t.rich(`foundations.notification.${notification.notificationType}.description`, {
6096
7254
  strong: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: chunks }), "strong"),
6097
- actor: _nullishCoalesce(_optionalChain([data, 'access', _181 => _181.actor, 'optionalAccess', _182 => _182.name]), () => ( "")),
7255
+ actor: _nullishCoalesce(_optionalChain([data, 'access', _231 => _231.actor, 'optionalAccess', _232 => _232.name]), () => ( "")),
6098
7256
  title: data.title
6099
7257
  }) }),
6100
7258
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground mt-1 w-full text-xs", children: new Date(notification.createdAt).toLocaleString() })
@@ -6122,7 +7280,7 @@ function NotificationMenuItem({ notification, closePopover }) {
6122
7280
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col", children: [
6123
7281
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: t.rich(`foundations.notification.${notification.notificationType}.description`, {
6124
7282
  strong: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: chunks }), "strong"),
6125
- actor: _nullishCoalesce(_optionalChain([data, 'access', _183 => _183.actor, 'optionalAccess', _184 => _184.name]), () => ( "")),
7283
+ actor: _nullishCoalesce(_optionalChain([data, 'access', _233 => _233.actor, 'optionalAccess', _234 => _234.name]), () => ( "")),
6126
7284
  title: data.title
6127
7285
  }) }),
6128
7286
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground mt-1 w-full text-xs", children: new Date(notification.createdAt).toLocaleString() })
@@ -6163,7 +7321,7 @@ var NotificationContextProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(v
6163
7321
  setIsLoading(true);
6164
7322
  setError(null);
6165
7323
  try {
6166
- const fetchedNotifications = await _chunkPO5Q3H5Ijs.NotificationService.findMany({});
7324
+ const fetchedNotifications = await NotificationService.findMany({});
6167
7325
  setNotifications(fetchedNotifications);
6168
7326
  setLastLoaded(Date.now());
6169
7327
  } catch (error2) {
@@ -6188,8 +7346,8 @@ var NotificationContextProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(v
6188
7346
  relationships: {}
6189
7347
  }))
6190
7348
  };
6191
- await _chunkPO5Q3H5Ijs.NotificationService.markAsRead({ data });
6192
- const allNotifications = await _chunkPO5Q3H5Ijs.NotificationService.findMany({});
7349
+ await NotificationService.markAsRead({ data });
7350
+ const allNotifications = await NotificationService.findMany({});
6193
7351
  setNotifications(allNotifications);
6194
7352
  setLastLoaded(Date.now());
6195
7353
  } catch (error2) {
@@ -6256,12 +7414,12 @@ function NotificationsList({ archived }) {
6256
7414
  const t = _nextintl.useTranslations.call(void 0, );
6257
7415
  const generateUrl = usePageUrlGenerator();
6258
7416
  const data = useDataListRetriever({
6259
- retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkPO5Q3H5Ijs.NotificationService.findMany(params), "retriever"),
7417
+ retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => NotificationService.findMany(params), "retriever"),
6260
7418
  retrieverParams: { isArchived: archived },
6261
7419
  module: _chunkQ4FXESVTjs.Modules.Notification
6262
7420
  });
6263
7421
  const archiveNotification = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (notification) => {
6264
- await _chunkPO5Q3H5Ijs.NotificationService.archive({ id: notification.id });
7422
+ await NotificationService.archive({ id: notification.id });
6265
7423
  data.removeElement(notification);
6266
7424
  }, "archiveNotification");
6267
7425
  const LoadingSkeleton = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-4", children: Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.CardContent, { className: "p-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-row items-center", children: [
@@ -6272,14 +7430,14 @@ function NotificationsList({ archived }) {
6272
7430
  ] }),
6273
7431
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.Skeleton, { className: "h-8 w-20" })
6274
7432
  ] }) }) }, i)) }), "LoadingSkeleton");
6275
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-4", children: data.isLoaded ? _optionalChain([data, 'access', _185 => _185.data, 'optionalAccess', _186 => _186.map, 'call', _187 => _187((notification) => {
7433
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-4", children: data.isLoaded ? _optionalChain([data, 'access', _235 => _235.data, 'optionalAccess', _236 => _236.map, 'call', _237 => _237((notification) => {
6276
7434
  const notificationData = generateNotificationData({ notification, generateUrl });
6277
7435
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.CardContent, { className: "p-0", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `flex w-full flex-row items-center p-2`, children: [
6278
7436
  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, _chunk5IET37O4js.Link, { href: generateUrl({ page: _chunkQ4FXESVTjs.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" }),
6279
7437
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col", children: [
6280
7438
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: t.rich(`foundations.notification.${notification.notificationType}.description`, {
6281
7439
  strong: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: chunks }), "strong"),
6282
- actor: _nullishCoalesce(_optionalChain([notificationData, 'access', _188 => _188.actor, 'optionalAccess', _189 => _189.name]), () => ( "")),
7440
+ actor: _nullishCoalesce(_optionalChain([notificationData, 'access', _238 => _238.actor, 'optionalAccess', _239 => _239.name]), () => ( "")),
6283
7441
  title: notificationData.title
6284
7442
  }) }),
6285
7443
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground mt-1 w-full text-xs", children: new Date(notification.createdAt).toLocaleString() })
@@ -6638,7 +7796,7 @@ function RemoveUserFromRole({ role, user, refresh }) {
6638
7796
  const t = _nextintl.useTranslations.call(void 0, );
6639
7797
  _react.useEffect.call(void 0, () => {
6640
7798
  async function checkCompanyAdminDeletability() {
6641
- const roleUsers = await _chunkPO5Q3H5Ijs.UserService.findAllUsersByRole({
7799
+ const roleUsers = await UserService.findAllUsersByRole({
6642
7800
  roleId: role.id
6643
7801
  });
6644
7802
  if (roleUsers.length > 1) setCanRemove(true);
@@ -6652,7 +7810,7 @@ function RemoveUserFromRole({ role, user, refresh }) {
6652
7810
  }, [role]);
6653
7811
  const remove = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
6654
7812
  try {
6655
- await _chunkPO5Q3H5Ijs.RoleService.removeUserFromRole({
7813
+ await RoleService.removeUserFromRole({
6656
7814
  roleId: role.id,
6657
7815
  userId: user.id
6658
7816
  });
@@ -6716,7 +7874,7 @@ function UserRoleAdd({ user, refresh }) {
6716
7874
  const [roles, setRoles] = _react.useState.call(void 0, []);
6717
7875
  const t = _nextintl.useTranslations.call(void 0, );
6718
7876
  const addUserToRole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (role) => {
6719
- await _chunkPO5Q3H5Ijs.RoleService.addUserToRole({
7877
+ await RoleService.addUserToRole({
6720
7878
  roleId: role.id,
6721
7879
  userId: user.id
6722
7880
  });
@@ -6740,7 +7898,7 @@ function UserRoleAdd({ user, refresh }) {
6740
7898
  const searchRoles = _react.useCallback.call(void 0,
6741
7899
  async (term) => {
6742
7900
  setRoles(
6743
- await _chunkPO5Q3H5Ijs.RoleService.findAllRolesUserNotIn({
7901
+ await RoleService.findAllRolesUserNotIn({
6744
7902
  search: term,
6745
7903
  userId: user.id
6746
7904
  })
@@ -6808,7 +7966,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, UserRoleAdd, "UserRoleAdd");
6808
7966
  function RolesList() {
6809
7967
  const t = _nextintl.useTranslations.call(void 0, );
6810
7968
  const data = useDataListRetriever({
6811
- retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkPO5Q3H5Ijs.RoleService.findAllRoles(params), "retriever"),
7969
+ retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => RoleService.findAllRoles(params), "retriever"),
6812
7970
  retrieverParams: {},
6813
7971
  module: _chunkQ4FXESVTjs.Modules.Role
6814
7972
  });
@@ -6830,7 +7988,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, RolesList, "RolesList");
6830
7988
  function UserRolesList({ user }) {
6831
7989
  const t = _nextintl.useTranslations.call(void 0, );
6832
7990
  const data = useDataListRetriever({
6833
- retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkPO5Q3H5Ijs.RoleService.findAllRolesByUser(params), "retriever"),
7991
+ retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => RoleService.findAllRolesByUser(params), "retriever"),
6834
7992
  retrieverParams: { userId: user.id },
6835
7993
  module: _chunkQ4FXESVTjs.Modules.Role
6836
7994
  });
@@ -6856,7 +8014,7 @@ function AddUserToRoleInternal({ role, refresh }) {
6856
8014
  const [existingUsers, setExistingUsers] = _react.useState.call(void 0, null);
6857
8015
  _react.useEffect.call(void 0, () => {
6858
8016
  const fetchExistingUsers = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
6859
- setExistingUsers(await _chunkPO5Q3H5Ijs.UserService.findMany({ roleId: role.id, fetchAll: true }));
8017
+ setExistingUsers(await UserService.findMany({ roleId: role.id, fetchAll: true }));
6860
8018
  }, "fetchExistingUsers");
6861
8019
  if (show) {
6862
8020
  setExistingUsers(null);
@@ -6864,7 +8022,7 @@ function AddUserToRoleInternal({ role, refresh }) {
6864
8022
  }
6865
8023
  }, [show]);
6866
8024
  const addUserToRole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (user) => {
6867
- await _chunkPO5Q3H5Ijs.RoleService.addUserToRole({
8025
+ await RoleService.addUserToRole({
6868
8026
  roleId: role.id,
6869
8027
  userId: user.id
6870
8028
  });
@@ -6880,8 +8038,8 @@ function AddUserToRoleInternal({ role, refresh }) {
6880
8038
  }, "addUserToRole");
6881
8039
  const data = useDataListRetriever({
6882
8040
  ready: !!company && show,
6883
- retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkPO5Q3H5Ijs.UserService.findAllUsers(params), "retriever"),
6884
- retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _190 => _190.id]) },
8041
+ retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => UserService.findAllUsers(params), "retriever"),
8042
+ retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _240 => _240.id]) },
6885
8043
  module: _chunkQ4FXESVTjs.Modules.User
6886
8044
  });
6887
8045
  _react.useEffect.call(void 0, () => {
@@ -6949,10 +8107,10 @@ function UserAvatarEditor({ user, file, setFile, resetImage, setResetImage }) {
6949
8107
  onValueChange: setFiles,
6950
8108
  dropzoneOptions: dropzone2,
6951
8109
  className: "h-40 w-40 rounded-full p-0",
6952
- 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', _191 => _191.avatar])) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8110
+ 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', _241 => _241.avatar])) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6953
8111
  _image2.default,
6954
8112
  {
6955
- src: file ? URL.createObjectURL(file) : _optionalChain([user, 'optionalAccess', _192 => _192.avatar]) || "",
8113
+ src: file ? URL.createObjectURL(file) : _optionalChain([user, 'optionalAccess', _242 => _242.avatar]) || "",
6956
8114
  alt: t(`generic.avatar`),
6957
8115
  width: 200,
6958
8116
  height: 200
@@ -6960,7 +8118,7 @@ function UserAvatarEditor({ user, file, setFile, resetImage, setResetImage }) {
6960
8118
  ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.UploadIcon, { className: "my-4 h-8 w-8" }) })
6961
8119
  }
6962
8120
  ),
6963
- !resetImage && (file || _optionalChain([user, 'optionalAccess', _193 => _193.avatar])) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8121
+ !resetImage && (file || _optionalChain([user, 'optionalAccess', _243 => _243.avatar])) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6964
8122
  _chunk5IET37O4js.Button,
6965
8123
  {
6966
8124
  className: "",
@@ -6988,7 +8146,7 @@ function UserDeleterInternal({ user, onDeleted, companyId }) {
6988
8146
  const router = _chunkAYHKQWHHjs.useI18nRouter.call(void 0, );
6989
8147
  const t = _nextintl.useTranslations.call(void 0, );
6990
8148
  let cId;
6991
- if (_optionalChain([currentUser, 'optionalAccess', _194 => _194.roles, 'access', _195 => _195.find, 'call', _196 => _196((role) => role.id === _chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator)]) && companyId) {
8149
+ if (_optionalChain([currentUser, 'optionalAccess', _244 => _244.roles, 'access', _245 => _245.find, 'call', _246 => _246((role) => role.id === _chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator)]) && companyId) {
6992
8150
  cId = companyId;
6993
8151
  } else {
6994
8152
  if (!company) return;
@@ -6998,7 +8156,7 @@ function UserDeleterInternal({ user, onDeleted, companyId }) {
6998
8156
  CommonDeleter,
6999
8157
  {
7000
8158
  type: `users`,
7001
- deleteFunction: () => _chunkPO5Q3H5Ijs.UserService.delete({ userId: user.id, companyId: cId }).then(
8159
+ deleteFunction: () => UserService.delete({ userId: user.id, companyId: cId }).then(
7002
8160
  () => onDeleted ? onDeleted() : router.push(generateUrl({ page: _chunkQ4FXESVTjs.Modules.User }))
7003
8161
  )
7004
8162
  }
@@ -7056,22 +8214,22 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
7056
8214
  const form = _reacthookform.useForm.call(void 0, {
7057
8215
  resolver: _zod.zodResolver.call(void 0, formSchema),
7058
8216
  defaultValues: {
7059
- id: _optionalChain([user, 'optionalAccess', _197 => _197.id]) || _uuid.v4.call(void 0, ),
7060
- name: _optionalChain([user, 'optionalAccess', _198 => _198.name]) || "",
7061
- title: _optionalChain([user, 'optionalAccess', _199 => _199.title]) || "",
7062
- bio: _optionalChain([user, 'optionalAccess', _200 => _200.bio]) || "",
7063
- email: _optionalChain([user, 'optionalAccess', _201 => _201.email]) || "",
7064
- phone: _optionalChain([user, 'optionalAccess', _202 => _202.phone]) || "",
8217
+ id: _optionalChain([user, 'optionalAccess', _247 => _247.id]) || _uuid.v4.call(void 0, ),
8218
+ name: _optionalChain([user, 'optionalAccess', _248 => _248.name]) || "",
8219
+ title: _optionalChain([user, 'optionalAccess', _249 => _249.title]) || "",
8220
+ bio: _optionalChain([user, 'optionalAccess', _250 => _250.bio]) || "",
8221
+ email: _optionalChain([user, 'optionalAccess', _251 => _251.email]) || "",
8222
+ phone: _optionalChain([user, 'optionalAccess', _252 => _252.phone]) || "",
7065
8223
  password: "",
7066
- roleIds: _optionalChain([user, 'optionalAccess', _203 => _203.roles, 'access', _204 => _204.map, 'call', _205 => _205((role) => role.id)]) || [],
8224
+ roleIds: _optionalChain([user, 'optionalAccess', _253 => _253.roles, 'access', _254 => _254.map, 'call', _255 => _255((role) => role.id)]) || [],
7067
8225
  sendInvitationEmail: false,
7068
- avatar: _optionalChain([user, 'optionalAccess', _206 => _206.avatarUrl]) || ""
8226
+ avatar: _optionalChain([user, 'optionalAccess', _256 => _256.avatarUrl]) || ""
7069
8227
  }
7070
8228
  });
7071
8229
  const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
7072
8230
  if (!user) {
7073
8231
  try {
7074
- const existingUser = await _chunkPO5Q3H5Ijs.UserService.findByEmail({ email: values.email });
8232
+ const existingUser = await UserService.findByEmail({ email: values.email });
7075
8233
  if (existingUser) {
7076
8234
  form.setError("email", {
7077
8235
  type: "manual",
@@ -7084,7 +8242,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
7084
8242
  }
7085
8243
  }
7086
8244
  if (values.avatar && contentType) {
7087
- const s3 = await _chunkPO5Q3H5Ijs.S3Service.getPreSignedUrl({
8245
+ const s3 = await S3Service.getPreSignedUrl({
7088
8246
  key: values.avatar,
7089
8247
  contentType,
7090
8248
  isPublic: true
@@ -7110,8 +8268,8 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
7110
8268
  adminCreated
7111
8269
  };
7112
8270
  try {
7113
- const updatedUser = user ? await _chunkPO5Q3H5Ijs.UserService.update(payload) : await _chunkPO5Q3H5Ijs.UserService.create(payload);
7114
- if (_optionalChain([currentUser, 'optionalAccess', _207 => _207.id]) === updatedUser.id) setUser(updatedUser);
8271
+ const updatedUser = user ? await UserService.update(payload) : await UserService.create(payload);
8272
+ if (_optionalChain([currentUser, 'optionalAccess', _257 => _257.id]) === updatedUser.id) setUser(updatedUser);
7115
8273
  if (onRevalidate) {
7116
8274
  await onRevalidate(generateUrl({ page: _chunkQ4FXESVTjs.Modules.User, id: updatedUser.id, language: `[locale]` }));
7117
8275
  }
@@ -7127,14 +8285,14 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
7127
8285
  }, "onSubmit");
7128
8286
  _react.useEffect.call(void 0, () => {
7129
8287
  async function fetchRoles() {
7130
- const roles2 = await _chunkPO5Q3H5Ijs.RoleService.findAllRoles({});
8288
+ const roles2 = await RoleService.findAllRoles({});
7131
8289
  const availableRoles = roles2.filter(
7132
- (role) => role.id !== _chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator && (role.requiredFeature === void 0 || _optionalChain([company, 'optionalAccess', _208 => _208.features, 'access', _209 => _209.some, 'call', _210 => _210((feature) => feature.id === _optionalChain([role, 'access', _211 => _211.requiredFeature, 'optionalAccess', _212 => _212.id]))]))
8290
+ (role) => role.id !== _chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator && (role.requiredFeature === void 0 || _optionalChain([company, 'optionalAccess', _258 => _258.features, 'access', _259 => _259.some, 'call', _260 => _260((feature) => feature.id === _optionalChain([role, 'access', _261 => _261.requiredFeature, 'optionalAccess', _262 => _262.id]))]))
7133
8291
  );
7134
8292
  setRoles(availableRoles);
7135
8293
  }
7136
8294
  _chunk7QVYU63Ejs.__name.call(void 0, fetchRoles, "fetchRoles");
7137
- if (open && (company || _optionalChain([currentUser, 'optionalAccess', _213 => _213.roles, 'access', _214 => _214.find, 'call', _215 => _215((role) => role.id === _chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator)])) && roles.length === 0)
8295
+ if (open && (company || _optionalChain([currentUser, 'optionalAccess', _263 => _263.roles, 'access', _264 => _264.find, 'call', _265 => _265((role) => role.id === _chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator)])) && roles.length === 0)
7138
8296
  fetchRoles();
7139
8297
  }, [company, open]);
7140
8298
  _react.useEffect.call(void 0, () => {
@@ -7155,7 +8313,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
7155
8313
  setContentType(null);
7156
8314
  }
7157
8315
  }, [file]);
7158
- const canChangeRoles = !(_optionalChain([currentUser, 'optionalAccess', _216 => _216.id]) === _optionalChain([user, 'optionalAccess', _217 => _217.id]) && hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator)) && (hasPermissionToModule({ module: _chunkQ4FXESVTjs.Modules.User, action: "update" /* Update */ }) || hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator));
8316
+ const canChangeRoles = !(_optionalChain([currentUser, 'optionalAccess', _266 => _266.id]) === _optionalChain([user, 'optionalAccess', _267 => _267.id]) && hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator)) && (hasPermissionToModule({ module: _chunkQ4FXESVTjs.Modules.User, action: "update" /* Update */ }) || hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator));
7159
8317
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5IET37O4js.Dialog, { open, onOpenChange: setOpen, children: [
7160
8318
  trigger ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.DialogTrigger, { asChild: true, children: trigger }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorTrigger, { isEdit: !!user }),
7161
8319
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
@@ -7163,7 +8321,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
7163
8321
  {
7164
8322
  className: `flex max-h-[70vh] ${canChangeRoles ? `max-w-[90vw]` : `max-w-3xl`} min-h-3xl max-h-[90vh] flex-col overflow-y-auto`,
7165
8323
  children: [
7166
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorHeader, { type: t(`types.users`, { count: 1 }), name: _optionalChain([user, 'optionalAccess', _218 => _218.name]) }),
8324
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorHeader, { type: t(`types.users`, { count: 1 }), name: _optionalChain([user, 'optionalAccess', _268 => _268.name]) }),
7167
8325
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: `flex w-full flex-col gap-y-4`, children: [
7168
8326
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `flex flex-row gap-x-4`, children: [
7169
8327
  /* @__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,
@@ -7249,10 +8407,10 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
7249
8407
  ] })
7250
8408
  ] }),
7251
8409
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-x-4", children: [
7252
- user && _optionalChain([currentUser, 'optionalAccess', _219 => _219.roles, 'access', _220 => _220.find, 'call', _221 => _221((role) => role.id === _chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator)]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8410
+ user && _optionalChain([currentUser, 'optionalAccess', _269 => _269.roles, 'access', _270 => _270.find, 'call', _271 => _271((role) => role.id === _chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator)]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7253
8411
  UserDeleter,
7254
8412
  {
7255
- companyId: _optionalChain([user, 'access', _222 => _222.company, 'optionalAccess', _223 => _223.id]),
8413
+ companyId: _optionalChain([user, 'access', _272 => _272.company, 'optionalAccess', _273 => _273.id]),
7256
8414
  user,
7257
8415
  onDeleted: () => {
7258
8416
  setOpen(false);
@@ -7311,9 +8469,9 @@ function UserMultiSelect({
7311
8469
  const data = useDataListRetriever({
7312
8470
  ready: !!company,
7313
8471
  retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
7314
- return _chunkPO5Q3H5Ijs.UserService.findAllUsers(params);
8472
+ return UserService.findAllUsers(params);
7315
8473
  }, "retriever"),
7316
- retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _224 => _224.id]) },
8474
+ retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _274 => _274.id]) },
7317
8475
  module: _chunkQ4FXESVTjs.Modules.User
7318
8476
  });
7319
8477
  _react.useEffect.call(void 0, () => {
@@ -7340,7 +8498,7 @@ function UserMultiSelect({
7340
8498
  _react.useEffect.call(void 0, () => {
7341
8499
  if (data.data && data.data.length > 0) {
7342
8500
  const users = data.data;
7343
- const filteredUsers = users.filter((user) => user.id !== _optionalChain([currentUser, 'optionalAccess', _225 => _225.id]));
8501
+ const filteredUsers = users.filter((user) => user.id !== _optionalChain([currentUser, 'optionalAccess', _275 => _275.id]));
7344
8502
  const options = filteredUsers.map((user) => ({
7345
8503
  label: user.name,
7346
8504
  value: user.id,
@@ -7371,7 +8529,7 @@ function UserMultiSelect({
7371
8529
  return existingUser;
7372
8530
  }
7373
8531
  const option = userOptions.find((option2) => option2.value === id2);
7374
- if (_optionalChain([option, 'optionalAccess', _226 => _226.userData])) {
8532
+ if (_optionalChain([option, 'optionalAccess', _276 => _276.userData])) {
7375
8533
  return {
7376
8534
  id: option.userData.id,
7377
8535
  name: option.userData.name,
@@ -7382,7 +8540,7 @@ function UserMultiSelect({
7382
8540
  });
7383
8541
  form.setValue(id, updatedSelectedUsers);
7384
8542
  if (onChange) {
7385
- const fullSelectedUsers = selectedIds.map((id2) => _optionalChain([userOptions, 'access', _227 => _227.find, 'call', _228 => _228((option) => option.value === id2), 'optionalAccess', _229 => _229.userData])).filter(Boolean);
8543
+ const fullSelectedUsers = selectedIds.map((id2) => _optionalChain([userOptions, 'access', _277 => _277.find, 'call', _278 => _278((option) => option.value === id2), 'optionalAccess', _279 => _279.userData])).filter(Boolean);
7386
8544
  onChange(fullSelectedUsers);
7387
8545
  }
7388
8546
  }, "handleValueChange");
@@ -7425,7 +8583,7 @@ function UserReactivatorInterface({ user, propagateChanges }) {
7425
8583
  const t = _nextintl.useTranslations.call(void 0, );
7426
8584
  const reactivateUser = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
7427
8585
  try {
7428
- const updatedUser = await _chunkPO5Q3H5Ijs.UserService.reactivate({ userId: user.id });
8586
+ const updatedUser = await UserService.reactivate({ userId: user.id });
7429
8587
  setOpen(false);
7430
8588
  propagateChanges(updatedUser);
7431
8589
  } catch (error) {
@@ -7479,7 +8637,7 @@ function UserResentInvitationEmailInternal({ user }) {
7479
8637
  const t = _nextintl.useTranslations.call(void 0, );
7480
8638
  const sendInvitationEmail = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
7481
8639
  try {
7482
- await _chunkPO5Q3H5Ijs.UserService.sendInvitation({ userId: user.id, companyId: user.company.id });
8640
+ await UserService.sendInvitation({ userId: user.id, companyId: user.company.id });
7483
8641
  setOpen(false);
7484
8642
  _sonner.toast.message(t(`foundations.user.resend_activation.email_sent`), {
7485
8643
  description: t(`foundations.user.resend_activation.email_sent_description`, { email: user.email })
@@ -7537,7 +8695,7 @@ function UserSelector({ id, form, label, placeholder, onChange, isRequired = fal
7537
8695
  const [isSearching, setIsSearching] = _react.useState.call(void 0, false);
7538
8696
  const data = useDataListRetriever({
7539
8697
  retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
7540
- return _chunkPO5Q3H5Ijs.UserService.findMany(params);
8698
+ return UserService.findMany(params);
7541
8699
  }, "retriever"),
7542
8700
  retrieverParams: {},
7543
8701
  module: _chunkQ4FXESVTjs.Modules.User
@@ -7587,10 +8745,10 @@ function UserSelector({ id, form, label, placeholder, onChange, isRequired = fal
7587
8745
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-row items-center justify-between", children: [
7588
8746
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.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: [
7589
8747
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "*:ring-border *:ring-1", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5IET37O4js.Avatar, { className: `mr-2 h-6 w-6`, children: [
7590
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.AvatarImage, { src: _optionalChain([field, 'access', _230 => _230.value, 'optionalAccess', _231 => _231.avatar]) }),
7591
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.AvatarFallback, { children: _optionalChain([field, 'access', _232 => _232.value, 'optionalAccess', _233 => _233.name]) ? _optionalChain([field, 'access', _234 => _234.value, 'optionalAccess', _235 => _235.name, 'access', _236 => _236.split, 'call', _237 => _237(" "), 'access', _238 => _238.map, 'call', _239 => _239((name) => name.charAt(0).toUpperCase())]) : "X" })
8748
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.AvatarImage, { src: _optionalChain([field, 'access', _280 => _280.value, 'optionalAccess', _281 => _281.avatar]) }),
8749
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5IET37O4js.AvatarFallback, { children: _optionalChain([field, 'access', _282 => _282.value, 'optionalAccess', _283 => _283.name]) ? _optionalChain([field, 'access', _284 => _284.value, 'optionalAccess', _285 => _285.name, 'access', _286 => _286.split, 'call', _287 => _287(" "), 'access', _288 => _288.map, 'call', _289 => _289((name) => name.charAt(0).toUpperCase())]) : "X" })
7592
8750
  ] }) }),
7593
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "", children: _nullishCoalesce(_optionalChain([field, 'access', _240 => _240.value, 'optionalAccess', _241 => _241.name]), () => ( "")) })
8751
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "", children: _nullishCoalesce(_optionalChain([field, 'access', _290 => _290.value, 'optionalAccess', _291 => _291.name]), () => ( "")) })
7594
8752
  ] }) }) : /* @__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(`generic.search.placeholder`, { type: t(`types.users`, { count: 1 }) }))) }) }) }),
7595
8753
  field.value && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7596
8754
  _lucidereact.CircleX,
@@ -7635,74 +8793,227 @@ function UserSelector({ id, form, label, placeholder, onChange, isRequired = fal
7635
8793
  }
7636
8794
  ) });
7637
8795
  }
7638
- _chunk7QVYU63Ejs.__name.call(void 0, UserSelector, "UserSelector");
8796
+ _chunk7QVYU63Ejs.__name.call(void 0, UserSelector, "UserSelector");
8797
+
8798
+ // src/features/user/user.module.ts
8799
+ var UserModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (factory) => factory({
8800
+ pageUrl: "/users",
8801
+ name: "users",
8802
+ model: User,
8803
+ moduleId: "04cfc677-0fd2-4f5e-adf4-2483a00c0277",
8804
+ inclusions: {
8805
+ lists: {
8806
+ fields: [
8807
+ _chunkQ4FXESVTjs.createJsonApiInclusion.call(void 0, "users", [`name`, `email`, `avatar`, `title`]),
8808
+ _chunkQ4FXESVTjs.createJsonApiInclusion.call(void 0, "usertopics", [`level`]),
8809
+ _chunkQ4FXESVTjs.createJsonApiInclusion.call(void 0, "userexpertises", [`level`]),
8810
+ _chunkQ4FXESVTjs.createJsonApiInclusion.call(void 0, "topics", [`name`])
8811
+ ]
8812
+ }
8813
+ }
8814
+ }), "UserModule");
8815
+
8816
+ // src/hooks/usePushNotifications.ts
8817
+ function urlBase64ToUint8Array(base64String) {
8818
+ const padding = "=".repeat((4 - base64String.length % 4) % 4);
8819
+ const base64 = (base64String + padding).replace(/-/g, "+").replace(/_/g, "/");
8820
+ const rawData = window.atob(base64);
8821
+ const outputArray = new Uint8Array(rawData.length);
8822
+ for (let i = 0; i < rawData.length; i++) {
8823
+ outputArray[i] = rawData.charCodeAt(i);
8824
+ }
8825
+ return outputArray;
8826
+ }
8827
+ _chunk7QVYU63Ejs.__name.call(void 0, urlBase64ToUint8Array, "urlBase64ToUint8Array");
8828
+ function usePushNotifications() {
8829
+ const { currentUser, hasRole } = useCurrentUserContext();
8830
+ _react.useEffect.call(void 0, () => {
8831
+ const register = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
8832
+ if ("serviceWorker" in navigator && "PushManager" in window) {
8833
+ try {
8834
+ const sessionKey = `push_registered_${_optionalChain([currentUser, 'optionalAccess', _292 => _292.id])}`;
8835
+ const lastRegisteredSubscription = sessionStorage.getItem(sessionKey);
8836
+ const registration = await navigator.serviceWorker.register(`${_chunkPMXG5WBCjs.getAppUrl.call(void 0, )}/sw.js`);
8837
+ let permission = Notification.permission;
8838
+ if (permission === "default") {
8839
+ permission = await Notification.requestPermission();
8840
+ }
8841
+ if (permission !== "granted") {
8842
+ return;
8843
+ }
8844
+ const vapidPublicKey = (process.env.NEXT_PUBLIC_VAPID_PUBLIC_KEY || "").trim();
8845
+ const convertedKey = urlBase64ToUint8Array(vapidPublicKey);
8846
+ await navigator.serviceWorker.ready;
8847
+ let subscription = await registration.pushManager.getSubscription();
8848
+ if (!subscription) {
8849
+ const appServerKey = new Uint8Array(Array.from(convertedKey));
8850
+ subscription = await registration.pushManager.subscribe({
8851
+ userVisibleOnly: true,
8852
+ applicationServerKey: appServerKey
8853
+ });
8854
+ }
8855
+ const plainSubscription = {
8856
+ endpoint: subscription.endpoint,
8857
+ keys: subscription.toJSON().keys
8858
+ };
8859
+ const subscriptionHash = btoa(JSON.stringify(plainSubscription));
8860
+ if (lastRegisteredSubscription !== subscriptionHash) {
8861
+ await PushService.register({ data: plainSubscription });
8862
+ sessionStorage.setItem(sessionKey, subscriptionHash);
8863
+ }
8864
+ } catch (error) {
8865
+ console.error("Error during service worker registration or push subscription:", error);
8866
+ }
8867
+ }
8868
+ }, "register");
8869
+ if (currentUser && !hasRole(_chunk3UELCPINjs.getRoleId.call(void 0, ).Administrator)) register();
8870
+ }, [currentUser]);
8871
+ }
8872
+ _chunk7QVYU63Ejs.__name.call(void 0, usePushNotifications, "usePushNotifications");
7639
8873
 
7640
- // src/features/user/contexts/UserContext.tsx
8874
+ // src/hooks/useSocket.ts
7641
8875
 
7642
- var UserContext = _react.createContext.call(void 0, void 0);
7643
- var UserProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ children, dehydratedUser }) => {
7644
- const generateUrl = usePageUrlGenerator();
7645
- const { hasPermissionToModule } = useCurrentUserContext();
7646
- const t = _nextintl.useTranslations.call(void 0, );
7647
- const [user, setUser] = _react.useState.call(void 0,
7648
- dehydratedUser ? _chunkQ4FXESVTjs.rehydrate.call(void 0, _chunkQ4FXESVTjs.Modules.User, dehydratedUser) : void 0
7649
- );
7650
- const breadcrumb = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
7651
- const response = [];
7652
- if (hasPermissionToModule({ module: _chunkQ4FXESVTjs.Modules.User, action: "update" /* Update */ })) {
7653
- response.push({
7654
- name: t(`generic.settings`),
7655
- href: generateUrl({ page: `/settings` })
7656
- });
7657
- response.push({
7658
- name: t(`types.users`, { count: 2 }),
7659
- href: generateUrl({ page: `/settings`, id: _chunkQ4FXESVTjs.Modules.User.pageUrl })
7660
- });
8876
+ var _socketioclient = require('socket.io-client'); var _socketioclient2 = _interopRequireDefault(_socketioclient);
8877
+ function useSocket({ token }) {
8878
+ const _errorCount = _react.useRef.call(void 0, 0);
8879
+ const shouldConnect = _react.useRef.call(void 0, true);
8880
+ const _hookInstanceId = _react.useRef.call(void 0, Math.random().toString(36).substring(2, 11));
8881
+ const [socket, setSocket] = _react.useState.call(void 0, null);
8882
+ const [isConnected, setIsConnected] = _react.useState.call(void 0, false);
8883
+ const [messages, setMessages] = _react.useState.call(void 0, []);
8884
+ const [socketNotifications, setSocketNotifications] = _react.useState.call(void 0, []);
8885
+ const socketRef = _react.useRef.call(void 0, null);
8886
+ _react.useEffect.call(void 0, () => {
8887
+ if (!token) return;
8888
+ const globalSocketKey = `__socket_${_optionalChain([process, 'access', _293 => _293.env, 'access', _294 => _294.NEXT_PUBLIC_API_URL, 'optionalAccess', _295 => _295.replace, 'call', _296 => _296(/[^a-zA-Z0-9]/g, "_")])}`;
8889
+ if (typeof window !== "undefined") {
8890
+ const _allSocketKeys = Object.keys(window).filter((key) => key.startsWith("__socket_"));
8891
+ const existingSocket = window[globalSocketKey];
8892
+ if (existingSocket) {
8893
+ if (existingSocket.connected) {
8894
+ existingSocket.removeAllListeners();
8895
+ socketRef.current = existingSocket;
8896
+ setSocket(existingSocket);
8897
+ setIsConnected(existingSocket.connected);
8898
+ } else {
8899
+ existingSocket.disconnect();
8900
+ delete window[globalSocketKey];
8901
+ }
8902
+ }
7661
8903
  }
7662
- if (user)
7663
- response.push({
7664
- name: `${user.name}${user.isDeleted ? ` (${t(`foundations.user.deleted`)})` : ""}`,
7665
- href: generateUrl({ page: _chunkQ4FXESVTjs.Modules.User, id: user.id })
8904
+ let currentSocket;
8905
+ const isReusing = socketRef.current && socketRef.current.connected;
8906
+ if (isReusing) {
8907
+ currentSocket = socketRef.current;
8908
+ } else {
8909
+ if (!shouldConnect.current) {
8910
+ return;
8911
+ }
8912
+ shouldConnect.current = false;
8913
+ try {
8914
+ currentSocket = _socketioclient2.default.call(void 0, process.env.NEXT_PUBLIC_API_URL, {
8915
+ auth: { token },
8916
+ transports: ["websocket"],
8917
+ timeout: 2e4
8918
+ });
8919
+ if (typeof window !== "undefined") {
8920
+ if (currentSocket.id && currentSocket.id !== "undefined") {
8921
+ window[globalSocketKey] = currentSocket;
8922
+ }
8923
+ }
8924
+ socketRef.current = currentSocket;
8925
+ setSocket(currentSocket);
8926
+ } catch (e4) {
8927
+ return () => {
8928
+ };
8929
+ }
8930
+ }
8931
+ const handleConnect = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
8932
+ setIsConnected(true);
8933
+ }, "handleConnect");
8934
+ const handleDisconnect = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
8935
+ setIsConnected(false);
8936
+ }, "handleDisconnect");
8937
+ const handleMessage = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (data) => {
8938
+ setMessages((prevMessages) => {
8939
+ const newMessages = [...prevMessages, data];
8940
+ return newMessages;
7666
8941
  });
7667
- return response;
7668
- }, "breadcrumb");
7669
- const title = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
7670
- const response = {
7671
- type: t(`types.users`, { count: user ? 1 : 2 })
7672
- };
7673
- const functions = [];
7674
- if (user) {
7675
- response.element = `${user.name}${user.isDeleted ? ` (${t(`foundations.user.deleted`)})` : ""}`;
7676
- if (user.isDeleted) {
7677
- functions.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserReactivator, { user, propagateChanges: setUser }, `UserReactivator`));
7678
- } else {
7679
- if (!user.isActivated)
7680
- functions.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserResentInvitationEmail, { user }, `UserResentInvitationEmail`));
7681
- functions.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserDeleter, { user }, `UserDeleter`));
8942
+ }, "handleMessage");
8943
+ const handleNotification = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (data) => {
8944
+ const notification = _chunkQ4FXESVTjs.rehydrate.call(void 0, _chunkQ4FXESVTjs.Modules.Notification, data);
8945
+ if (notification) {
8946
+ setSocketNotifications((prev) => {
8947
+ const newNotifications = [...prev, notification];
8948
+ return newNotifications;
8949
+ });
7682
8950
  }
7683
- functions.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserEditor, { user, propagateChanges: setUser }, `UserEditor`));
8951
+ }, "handleNotification");
8952
+ if (currentSocket) {
8953
+ currentSocket.on("connect", handleConnect);
8954
+ currentSocket.on("disconnect", handleDisconnect);
8955
+ currentSocket.on("message", handleMessage);
8956
+ currentSocket.on("notification", handleNotification);
7684
8957
  }
7685
- if (functions.length > 0) response.functions = functions;
7686
- return response;
7687
- }, "title");
7688
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7689
- UserContext.Provider,
7690
- {
7691
- value: {
7692
- user,
7693
- setUser
7694
- },
7695
- children
8958
+ return () => {
8959
+ shouldConnect.current = true;
8960
+ if (currentSocket) {
8961
+ if (process.env.NODE_ENV === "development") {
8962
+ currentSocket.off("connect", handleConnect);
8963
+ currentSocket.off("disconnect", handleDisconnect);
8964
+ currentSocket.off("message", handleMessage);
8965
+ currentSocket.off("notification", handleNotification);
8966
+ } else {
8967
+ currentSocket.off("connect", handleConnect);
8968
+ currentSocket.off("disconnect", handleDisconnect);
8969
+ currentSocket.off("message", handleMessage);
8970
+ currentSocket.off("notification", handleNotification);
8971
+ currentSocket.disconnect();
8972
+ if (typeof window !== "undefined") {
8973
+ delete window[globalSocketKey];
8974
+ }
8975
+ }
8976
+ }
8977
+ };
8978
+ }, [token]);
8979
+ const sendMessage = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (event, data) => {
8980
+ if (socketRef.current && isConnected) {
8981
+ socketRef.current.emit(event, data);
7696
8982
  }
7697
- ) });
7698
- }, "UserProvider");
7699
- var useUserContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
7700
- const context = _react.useContext.call(void 0, UserContext);
7701
- if (context === void 0) {
7702
- throw new Error("useUserContext must be used within a UserProvider");
7703
- }
7704
- return context;
7705
- }, "useUserContext");
8983
+ }, "sendMessage");
8984
+ const removeMessage = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (index) => {
8985
+ setMessages((prevMessages) => {
8986
+ const newMessages = [...prevMessages];
8987
+ newMessages.splice(index, 1);
8988
+ return newMessages;
8989
+ });
8990
+ }, "removeMessage");
8991
+ const removeSocketNotification = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (index) => {
8992
+ setSocketNotifications((prevNotifications) => {
8993
+ const newNotifications = [...prevNotifications];
8994
+ newNotifications.splice(index, 1);
8995
+ return newNotifications;
8996
+ });
8997
+ }, "removeSocketNotification");
8998
+ const clearMessages = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
8999
+ setMessages([]);
9000
+ }, "clearMessages");
9001
+ const clearSocketNotifications = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
9002
+ setSocketNotifications([]);
9003
+ }, "clearSocketNotifications");
9004
+ return {
9005
+ socket,
9006
+ isConnected,
9007
+ messages,
9008
+ socketNotifications,
9009
+ sendMessage,
9010
+ removeMessage,
9011
+ removeSocketNotification,
9012
+ clearMessages,
9013
+ clearSocketNotifications
9014
+ };
9015
+ }
9016
+ _chunk7QVYU63Ejs.__name.call(void 0, useSocket, "useSocket");
7706
9017
 
7707
9018
  // src/features/company/contexts/CompanyContext.tsx
7708
9019
 
@@ -7981,5 +9292,41 @@ var useSocketContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () =
7981
9292
 
7982
9293
 
7983
9294
 
7984
- 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.CurrentUserProvider = CurrentUserProvider; exports.useCurrentUserContext = useCurrentUserContext; exports.AddUserToRole = AddUserToRole; exports.UserAvatarEditor = UserAvatarEditor; exports.UserDeleter = UserDeleter; exports.UserEditor = UserEditor; exports.UserMultiSelect = UserMultiSelect; exports.UserReactivator = UserReactivator; exports.UserResentInvitationEmail = UserResentInvitationEmail; exports.UserAvatar = UserAvatar; exports.UserSelector = UserSelector; exports.UserProvider = UserProvider; exports.useUserContext = useUserContext; exports.UserDetails = UserDetails; 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.CompanyDetails = CompanyDetails; exports.AdminCompanyContainer = AdminCompanyContainer; exports.CompanyContainer = CompanyContainer; exports.CompanyConfigurationSecurityForm = CompanyConfigurationSecurityForm; exports.CompanyConfigurationEditor = CompanyConfigurationEditor; exports.CompanyDeleter = CompanyDeleter; exports.CompanyEditor = CompanyEditor; exports.CompaniesList = CompaniesList; exports.CompanyProvider = CompanyProvider; exports.useCompanyContext = useCompanyContext; exports.generateNotificationData = generateNotificationData; exports.NotificationToast = NotificationToast; exports.NotificationMenuItem = NotificationMenuItem; exports.NotificationContextProvider = NotificationContextProvider; exports.useNotificationContext = useNotificationContext; exports.RoleProvider = RoleProvider; exports.useRoleContext = useRoleContext; exports.SharedProvider = SharedProvider; exports.useSharedContext = useSharedContext; exports.CommonProvider = CommonProvider; exports.useCommonContext = useCommonContext; exports.SocketContext = SocketContext; exports.SocketProvider = SocketProvider; exports.useSocketContext = useSocketContext; exports.useNotificationSync = useNotificationSync; exports.usePageTracker = usePageTracker; exports.useSocket = useSocket; exports.Breadcrumb = Breadcrumb2; exports.ContentTitle = ContentTitle; exports.Header = Header; exports.ModeToggleSwitch = ModeToggleSwitch; exports.PageSection = PageSection; exports.RecentPagesNavigator = RecentPagesNavigator; exports.PageContainer = PageContainer; exports.ReactMarkdownContainer = ReactMarkdownContainer; exports.TabsContainer = TabsContainer; exports.AttributeElement = AttributeElement; 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.FormCheckbox = FormCheckbox; exports.FormContainerGeneric = FormContainerGeneric; 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.JsonApiContext = JsonApiContext; exports.useJsonApiConfig = useJsonApiConfig; exports.useJsonApiConfigOptional = useJsonApiConfigOptional; exports.JsonApiProvider = JsonApiProvider; exports.useJsonApiGet = useJsonApiGet; exports.useJsonApiMutation = useJsonApiMutation; exports.useRehydration = useRehydration; exports.useRehydrationList = useRehydrationList; exports.useRoleTableStructure = useRoleTableStructure; exports.useUserSearch = useUserSearch; exports.useUserTableStructure = useUserTableStructure; exports.useContentTableStructure = useContentTableStructure; 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.ContentsList = ContentsList; exports.ContentsListById = ContentsListById; exports.RelevantContentsList = RelevantContentsList; exports.NotificationErrorBoundary = NotificationErrorBoundary; exports.NotificationsList = NotificationsList; exports.NotificationsListContainer = NotificationsListContainer; exports.NotificationModal = NotificationModal; exports.PushNotificationProvider = PushNotificationProvider; exports.RoleDetails = RoleDetails; exports.RoleContainer = RoleContainer; exports.FormRoles = FormRoles; exports.RemoveUserFromRole = RemoveUserFromRole; exports.UserRoleAdd = UserRoleAdd; exports.RolesList = RolesList; exports.UserRolesList = UserRolesList;
7985
- //# sourceMappingURL=chunk-E2HRC2OG.js.map
9295
+
9296
+
9297
+
9298
+
9299
+
9300
+
9301
+
9302
+
9303
+
9304
+
9305
+
9306
+
9307
+
9308
+
9309
+
9310
+
9311
+
9312
+
9313
+
9314
+
9315
+
9316
+
9317
+
9318
+
9319
+
9320
+
9321
+
9322
+
9323
+
9324
+
9325
+
9326
+
9327
+
9328
+
9329
+
9330
+
9331
+ 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.CurrentUserProvider = CurrentUserProvider; exports.useCurrentUserContext = useCurrentUserContext; exports.Role = Role; exports.RoleFields = RoleFields; exports.RoleService = RoleService; exports.RoleModule = RoleModule; exports.User = User; exports.UserFields = UserFields; exports.UserService = UserService; exports.AddUserToRole = AddUserToRole; exports.UserAvatarEditor = UserAvatarEditor; exports.UserDeleter = UserDeleter; exports.S3 = S3; exports.S3Module = S3Module; exports.S3Service = S3Service; exports.UserEditor = UserEditor; exports.UserMultiSelect = UserMultiSelect; exports.UserReactivator = UserReactivator; exports.UserResentInvitationEmail = UserResentInvitationEmail; exports.UserAvatar = UserAvatar; exports.UserSelector = UserSelector; exports.UserProvider = UserProvider; exports.useUserContext = useUserContext; exports.UserDetails = UserDetails; 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.CompanyDetails = CompanyDetails; exports.AdminCompanyContainer = AdminCompanyContainer; exports.CompanyContainer = CompanyContainer; exports.AuthorModule = AuthorModule; exports.UserModule = UserModule; exports.Company = Company; exports.CompanyFields = CompanyFields; exports.CompanyService = CompanyService; exports.CompanyConfigurationSecurityForm = CompanyConfigurationSecurityForm; exports.CompanyConfigurationEditor = CompanyConfigurationEditor; exports.CompanyDeleter = CompanyDeleter; exports.Feature = Feature; exports.FeatureModule = FeatureModule; exports.FeatureService = FeatureService; exports.CompanyEditor = CompanyEditor; exports.CompaniesList = CompaniesList; exports.CompanyProvider = CompanyProvider; exports.useCompanyContext = useCompanyContext; exports.generateNotificationData = generateNotificationData; exports.NotificationToast = NotificationToast; exports.NotificationMenuItem = NotificationMenuItem; exports.Notification = Notification2; exports.NotificationFields = NotificationFields; exports.NotificationService = NotificationService; exports.NotificationContextProvider = NotificationContextProvider; exports.useNotificationContext = useNotificationContext; exports.RoleProvider = RoleProvider; exports.useRoleContext = useRoleContext; exports.SharedProvider = SharedProvider; exports.useSharedContext = useSharedContext; exports.CommonProvider = CommonProvider; exports.useCommonContext = useCommonContext; exports.SocketContext = SocketContext; exports.SocketProvider = SocketProvider; exports.useSocketContext = useSocketContext; exports.useNotificationSync = useNotificationSync; exports.usePageTracker = usePageTracker; exports.AuthModule = AuthModule; exports.Auth = Auth; exports.AuthService = AuthService; exports.AuthComponent = AuthComponent; exports.CompanyModule = CompanyModule; exports.ContentModule = ContentModule; exports.Content = Content; exports.ContentFields = ContentFields; exports.ContentService = ContentService; exports.Module = Module; exports.ModuleModule = ModuleModule; exports.NotificationModule = NotificationModule; exports.Push = Push; exports.PushModule = PushModule; exports.PushService = PushService; exports.useSocket = useSocket; exports.Breadcrumb = Breadcrumb2; exports.ContentTitle = ContentTitle; exports.Header = Header; exports.ModeToggleSwitch = ModeToggleSwitch; exports.PageSection = PageSection; exports.RecentPagesNavigator = RecentPagesNavigator; exports.PageContainer = PageContainer; exports.ReactMarkdownContainer = ReactMarkdownContainer; exports.TabsContainer = TabsContainer; exports.AttributeElement = AttributeElement; 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.FormCheckbox = FormCheckbox; exports.FormContainerGeneric = FormContainerGeneric; 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.JsonApiContext = JsonApiContext; exports.useJsonApiConfig = useJsonApiConfig; exports.useJsonApiConfigOptional = useJsonApiConfigOptional; exports.JsonApiProvider = JsonApiProvider; exports.useJsonApiGet = useJsonApiGet; exports.useJsonApiMutation = useJsonApiMutation; exports.useRehydration = useRehydration; exports.useRehydrationList = useRehydrationList; exports.useRoleTableStructure = useRoleTableStructure; exports.useUserSearch = useUserSearch; exports.useUserTableStructure = useUserTableStructure; exports.useContentTableStructure = useContentTableStructure; 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.ContentsList = ContentsList; exports.ContentsListById = ContentsListById; exports.RelevantContentsList = RelevantContentsList; exports.NotificationErrorBoundary = NotificationErrorBoundary; exports.NotificationsList = NotificationsList; exports.NotificationsListContainer = NotificationsListContainer; exports.NotificationModal = NotificationModal; exports.PushNotificationProvider = PushNotificationProvider; exports.RoleDetails = RoleDetails; exports.RoleContainer = RoleContainer; exports.FormRoles = FormRoles; exports.RemoveUserFromRole = RemoveUserFromRole; exports.UserRoleAdd = UserRoleAdd; exports.RolesList = RolesList; exports.UserRolesList = UserRolesList;
9332
+ //# sourceMappingURL=chunk-VET55IZO.js.map