@codebit-programando-solucoes/codebit-web-antd 1.1.5 → 1.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,1690 @@
1
+ /*! For license information please see index.cjs.LICENSE.txt */
2
+ "use strict";
3
+ var __webpack_modules__ = {
4
+ "../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.development.js": function(__unused_webpack_module, exports1, __webpack_require__) {
5
+ /**
6
+ * @license React
7
+ * react-jsx-runtime.development.js
8
+ *
9
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
10
+ *
11
+ * This source code is licensed under the MIT license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ */ "production" !== process.env.NODE_ENV && function() {
14
+ function getComponentNameFromType(type) {
15
+ if (null == type) return null;
16
+ if ("function" == typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
17
+ if ("string" == typeof type) return type;
18
+ switch(type){
19
+ case REACT_FRAGMENT_TYPE:
20
+ return "Fragment";
21
+ case REACT_PROFILER_TYPE:
22
+ return "Profiler";
23
+ case REACT_STRICT_MODE_TYPE:
24
+ return "StrictMode";
25
+ case REACT_SUSPENSE_TYPE:
26
+ return "Suspense";
27
+ case REACT_SUSPENSE_LIST_TYPE:
28
+ return "SuspenseList";
29
+ case REACT_ACTIVITY_TYPE:
30
+ return "Activity";
31
+ }
32
+ if ("object" == typeof type) switch("number" == typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof){
33
+ case REACT_PORTAL_TYPE:
34
+ return "Portal";
35
+ case REACT_CONTEXT_TYPE:
36
+ return type.displayName || "Context";
37
+ case REACT_CONSUMER_TYPE:
38
+ return (type._context.displayName || "Context") + ".Consumer";
39
+ case REACT_FORWARD_REF_TYPE:
40
+ var innerType = type.render;
41
+ type = type.displayName;
42
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
43
+ return type;
44
+ case REACT_MEMO_TYPE:
45
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
46
+ case REACT_LAZY_TYPE:
47
+ innerType = type._payload;
48
+ type = type._init;
49
+ try {
50
+ return getComponentNameFromType(type(innerType));
51
+ } catch (x) {}
52
+ }
53
+ return null;
54
+ }
55
+ function testStringCoercion(value) {
56
+ return "" + value;
57
+ }
58
+ function checkKeyStringCoercion(value) {
59
+ try {
60
+ testStringCoercion(value);
61
+ var JSCompiler_inline_result = !1;
62
+ } catch (e) {
63
+ JSCompiler_inline_result = !0;
64
+ }
65
+ if (JSCompiler_inline_result) {
66
+ JSCompiler_inline_result = console;
67
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
68
+ var JSCompiler_inline_result$jscomp$0 = "function" == typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
69
+ JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
70
+ return testStringCoercion(value);
71
+ }
72
+ }
73
+ function getTaskName(type) {
74
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
75
+ if ("object" == typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
76
+ try {
77
+ var name = getComponentNameFromType(type);
78
+ return name ? "<" + name + ">" : "<...>";
79
+ } catch (x) {
80
+ return "<...>";
81
+ }
82
+ }
83
+ function getOwner() {
84
+ var dispatcher = ReactSharedInternals.A;
85
+ return null === dispatcher ? null : dispatcher.getOwner();
86
+ }
87
+ function UnknownOwner() {
88
+ return Error("react-stack-top-frame");
89
+ }
90
+ function hasValidKey(config) {
91
+ if (hasOwnProperty.call(config, "key")) {
92
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
93
+ if (getter && getter.isReactWarning) return !1;
94
+ }
95
+ return void 0 !== config.key;
96
+ }
97
+ function defineKeyPropWarningGetter(props, displayName) {
98
+ function warnAboutAccessingKey() {
99
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
100
+ }
101
+ warnAboutAccessingKey.isReactWarning = !0;
102
+ Object.defineProperty(props, "key", {
103
+ get: warnAboutAccessingKey,
104
+ configurable: !0
105
+ });
106
+ }
107
+ function elementRefGetterWithDeprecationWarning() {
108
+ var componentName = getComponentNameFromType(this.type);
109
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
110
+ componentName = this.props.ref;
111
+ return void 0 !== componentName ? componentName : null;
112
+ }
113
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
114
+ var refProp = props.ref;
115
+ type = {
116
+ $$typeof: REACT_ELEMENT_TYPE,
117
+ type: type,
118
+ key: key,
119
+ props: props,
120
+ _owner: owner
121
+ };
122
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
123
+ enumerable: !1,
124
+ get: elementRefGetterWithDeprecationWarning
125
+ }) : Object.defineProperty(type, "ref", {
126
+ enumerable: !1,
127
+ value: null
128
+ });
129
+ type._store = {};
130
+ Object.defineProperty(type._store, "validated", {
131
+ configurable: !1,
132
+ enumerable: !1,
133
+ writable: !0,
134
+ value: 0
135
+ });
136
+ Object.defineProperty(type, "_debugInfo", {
137
+ configurable: !1,
138
+ enumerable: !1,
139
+ writable: !0,
140
+ value: null
141
+ });
142
+ Object.defineProperty(type, "_debugStack", {
143
+ configurable: !1,
144
+ enumerable: !1,
145
+ writable: !0,
146
+ value: debugStack
147
+ });
148
+ Object.defineProperty(type, "_debugTask", {
149
+ configurable: !1,
150
+ enumerable: !1,
151
+ writable: !0,
152
+ value: debugTask
153
+ });
154
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
155
+ return type;
156
+ }
157
+ function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
158
+ var children = config.children;
159
+ if (void 0 !== children) if (isStaticChildren) if (isArrayImpl(children)) {
160
+ for(isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)validateChildKeys(children[isStaticChildren]);
161
+ Object.freeze && Object.freeze(children);
162
+ } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
163
+ else validateChildKeys(children);
164
+ if (hasOwnProperty.call(config, "key")) {
165
+ children = getComponentNameFromType(type);
166
+ var keys = Object.keys(config).filter(function(k) {
167
+ return "key" !== k;
168
+ });
169
+ isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
170
+ didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = !0);
171
+ }
172
+ children = null;
173
+ void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
174
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
175
+ if ("key" in config) {
176
+ maybeKey = {};
177
+ for(var propName in config)"key" !== propName && (maybeKey[propName] = config[propName]);
178
+ } else maybeKey = config;
179
+ children && defineKeyPropWarningGetter(maybeKey, "function" == typeof type ? type.displayName || type.name || "Unknown" : type);
180
+ return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
181
+ }
182
+ function validateChildKeys(node) {
183
+ isValidElement(node) ? node._store && (node._store.validated = 1) : "object" == typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
184
+ }
185
+ function isValidElement(object) {
186
+ return "object" == typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
187
+ }
188
+ var React = __webpack_require__("react"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
189
+ return null;
190
+ };
191
+ React = {
192
+ react_stack_bottom_frame: function(callStackForError) {
193
+ return callStackForError();
194
+ }
195
+ };
196
+ var specialPropKeyWarningShown;
197
+ var didWarnAboutElementRef = {};
198
+ var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(React, UnknownOwner)();
199
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
200
+ var didWarnAboutKeySpread = {};
201
+ exports1.Fragment = REACT_FRAGMENT_TYPE;
202
+ exports1.jsx = function(type, config, maybeKey) {
203
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
204
+ return jsxDEVImpl(type, config, maybeKey, !1, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
205
+ };
206
+ exports1.jsxs = function(type, config, maybeKey) {
207
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
208
+ return jsxDEVImpl(type, config, maybeKey, !0, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
209
+ };
210
+ }();
211
+ },
212
+ "../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.production.js": function(__unused_webpack_module, exports1) {
213
+ /**
214
+ * @license React
215
+ * react-jsx-runtime.production.js
216
+ *
217
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
218
+ *
219
+ * This source code is licensed under the MIT license found in the
220
+ * LICENSE file in the root directory of this source tree.
221
+ */ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
222
+ function jsxProd(type, config, maybeKey) {
223
+ var key = null;
224
+ void 0 !== maybeKey && (key = "" + maybeKey);
225
+ void 0 !== config.key && (key = "" + config.key);
226
+ if ("key" in config) {
227
+ maybeKey = {};
228
+ for(var propName in config)"key" !== propName && (maybeKey[propName] = config[propName]);
229
+ } else maybeKey = config;
230
+ config = maybeKey.ref;
231
+ return {
232
+ $$typeof: REACT_ELEMENT_TYPE,
233
+ type: type,
234
+ key: key,
235
+ ref: void 0 !== config ? config : null,
236
+ props: maybeKey
237
+ };
238
+ }
239
+ exports1.Fragment = REACT_FRAGMENT_TYPE;
240
+ exports1.jsx = jsxProd;
241
+ exports1.jsxs = jsxProd;
242
+ },
243
+ "../../node_modules/.pnpm/react@19.2.0/node_modules/react/jsx-runtime.js": function(module, __unused_webpack_exports, __webpack_require__) {
244
+ if ('production' === process.env.NODE_ENV) module.exports = __webpack_require__("../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.production.js");
245
+ else module.exports = __webpack_require__("../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.development.js");
246
+ },
247
+ react: function(module) {
248
+ module.exports = require("react");
249
+ }
250
+ };
251
+ var __webpack_module_cache__ = {};
252
+ function __webpack_require__(moduleId) {
253
+ var cachedModule = __webpack_module_cache__[moduleId];
254
+ if (void 0 !== cachedModule) return cachedModule.exports;
255
+ var module = __webpack_module_cache__[moduleId] = {
256
+ exports: {}
257
+ };
258
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
259
+ return module.exports;
260
+ }
261
+ (()=>{
262
+ __webpack_require__.n = (module)=>{
263
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
264
+ __webpack_require__.d(getter, {
265
+ a: getter
266
+ });
267
+ return getter;
268
+ };
269
+ })();
270
+ (()=>{
271
+ __webpack_require__.d = (exports1, definition)=>{
272
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
273
+ enumerable: true,
274
+ get: definition[key]
275
+ });
276
+ };
277
+ })();
278
+ (()=>{
279
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
280
+ })();
281
+ (()=>{
282
+ __webpack_require__.r = (exports1)=>{
283
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
284
+ value: 'Module'
285
+ });
286
+ Object.defineProperty(exports1, '__esModule', {
287
+ value: true
288
+ });
289
+ };
290
+ })();
291
+ var __webpack_exports__ = {};
292
+ (()=>{
293
+ __webpack_require__.r(__webpack_exports__);
294
+ __webpack_require__.d(__webpack_exports__, {
295
+ TableContainer: ()=>TableContainer,
296
+ CssTokenBridge: ()=>CssTokenBridge,
297
+ LoggedMainContainer: ()=>LoggedMainContainer,
298
+ Login: ()=>Login,
299
+ ErrorRetry: ()=>ErrorRetry,
300
+ CodebitConfigContext: ()=>CodebitConfigContext,
301
+ ListCard: ()=>ListCard,
302
+ ForgotPassword: ()=>ForgotPassword,
303
+ LoginContainer: ()=>LoginContainer,
304
+ CodebitTheme: ()=>CodebitTheme,
305
+ LocalLoginRecoveryPasswordResult: ()=>LocalLoginRecoveryPasswordResult,
306
+ FilterContainer: ()=>FilterContainer,
307
+ HandleError: ()=>HandleError,
308
+ LocalLoginAuthenticationResult: ()=>LocalLoginAuthenticationResult,
309
+ CodebitConfigProvider: ()=>CodebitConfigProvider,
310
+ ThemeToggle: ()=>ThemeToggle
311
+ });
312
+ var jsx_runtime = __webpack_require__("../../node_modules/.pnpm/react@19.2.0/node_modules/react/jsx-runtime.js");
313
+ const icons_namespaceObject = require("@ant-design/icons");
314
+ const external_antd_namespaceObject = require("antd");
315
+ const external_prop_types_namespaceObject = require("prop-types");
316
+ var external_prop_types_default = /*#__PURE__*/ __webpack_require__.n(external_prop_types_namespaceObject);
317
+ var external_react_ = __webpack_require__("react");
318
+ const external_react_router_namespaceObject = require("react-router");
319
+ const external_i18next_namespaceObject = require("i18next");
320
+ const external_react_i18next_namespaceObject = require("react-i18next");
321
+ const pt = {
322
+ codebitWebAntd: {
323
+ LoggedMainContainer: {
324
+ theme: 'Tema',
325
+ logout: 'Sair',
326
+ version: 'Versão'
327
+ },
328
+ HandleError: {
329
+ notFoundTitle: 'Página não encontrada',
330
+ forbiddenTitle: 'Acesso negado',
331
+ internalTitle: 'Erro interno',
332
+ genericTitle: 'Erro inesperado',
333
+ notFoundMessage: 'A página que você estava procurando não existe.',
334
+ forbiddenMessage: 'Você não tem permissão para acessar esta página.',
335
+ internalMessage: 'Ocorreu um erro interno no servidor.',
336
+ genericMessage: 'Ocorreu um erro inesperado.',
337
+ backHome: 'Voltar para página inicial'
338
+ },
339
+ ErrorRetry: {
340
+ defaultError: 'Erro ao carregar',
341
+ retryButton: 'Tentar novamente',
342
+ reloadPageButton: 'Recarregar página',
343
+ networkError: 'Falha de conexão',
344
+ timeoutError: 'Servidor demorou para responder',
345
+ badRequestError: 'Requisição inválida',
346
+ forbiddenError: 'Recurso negado pelo servidor',
347
+ notFoundError: 'Recurso não encontrado pelo servidor',
348
+ internalServerError: 'Erro interno no servidor',
349
+ sessionExpiredError: 'Sessão expirada'
350
+ },
351
+ Login: {
352
+ loginTitle: 'Entrar',
353
+ googleLogin: 'Entrar com o Google',
354
+ emailLabel: 'E-mail',
355
+ passwordLabel: 'Senha',
356
+ emailPlaceholder: 'Digite seu e-mail',
357
+ passwordPlaceholder: 'Digite sua senha',
358
+ forgotPassword: 'Esqueceu sua senha?',
359
+ loginButton: 'Entrar',
360
+ emailRequired: 'Por favor, insira seu e-mail!',
361
+ emailInvalid: 'Por favor, insira um e-mail válido!',
362
+ passwordRequired: 'Por favor, insira sua senha!',
363
+ separator: 'ou',
364
+ errorTitle: 'Erro ao autenticar',
365
+ genericError: 'Ocorreu um erro. Por favor, tente novamente.',
366
+ invalidPassword: 'A senha está incorreta.',
367
+ invalidEmailOrPassword: 'O e-mail ou senha estão incorretos.',
368
+ userDisabled: 'Sua conta foi desativada. Por favor, entre em contato com o suporte.',
369
+ authenticationFailed: 'Autenticação falhou'
370
+ },
371
+ ForgotPassword: {
372
+ title: 'Redefinição de senha',
373
+ instructions: 'Informe seu e-mail para receber as instruções de recuperação de senha.',
374
+ emailRequired: 'Por favor, insira seu e-mail!',
375
+ emailInvalid: 'Por favor, insira um e-mail válido!',
376
+ emailPlaceholder: 'E-mail',
377
+ submitButton: 'Recuperar senha',
378
+ backToLogin: 'Voltar para o login',
379
+ resetSuccessMessage: 'Se o endereço informado estiver correto, enviaremos um e-mail com instruções para redefinição de senha.'
380
+ },
381
+ ChangePassword: {
382
+ title: 'Alterar senha',
383
+ passwordInstructions: 'Defina uma nova senha para realizar seu login.',
384
+ newPassword: 'Nova senha',
385
+ confirmPassword: 'Confirmar senha',
386
+ submit: 'Enviar',
387
+ backToLogin: 'Voltar para o login',
388
+ passwordRequired: 'Por favor, insira sua nova senha!',
389
+ passwordLength: '8 caracteres',
390
+ passwordUpperCase: 'uma letra maiúscula',
391
+ passwordLowerCase: 'uma letra minúscula',
392
+ passwordNumbers: 'um número',
393
+ passwordSpecialChars: 'um caractere especial (!@#$%^&*)',
394
+ passwordWeak: 'Senha fraca: Deve ter pelo menos {requirements}',
395
+ passwordsNotMatch: 'As senhas digitadas não coincidem!',
396
+ tokenInvalidTitle: 'Token inválido',
397
+ tokenInvalidOrExpired: 'O token informado é inválido ou está expirado. Inicie o processo de recuperação de senha e tente novamente.',
398
+ passwordChangedSuccess: 'A senha foi alterada com sucesso. Você será redirecionado ao login após fechar essa janela.',
399
+ tokenInvalidRecovery: 'O token informado é inválido ou está expirado. Inicie o processo de recuperação de senha novamente.'
400
+ },
401
+ LoginContainer: {
402
+ theme: 'Tema',
403
+ signIn: 'Entrar'
404
+ },
405
+ NotFound: {
406
+ pageNotFound: 'Página não encontrada',
407
+ sorryTheSearchPageDoesntExistOrRemoved: 'Desculpe, a página que você está procurando não existe ou foi removida.',
408
+ back: 'Voltar',
409
+ company: '© 2025 Codebit - Todos os direitos reservados'
410
+ },
411
+ ListCard: {
412
+ clearFilters: 'Limpar filtros'
413
+ },
414
+ Common: {
415
+ ok: 'Ok',
416
+ close: 'Fechar',
417
+ invalidEmail: 'O e-mail é inválido ou não está registrado.',
418
+ recaptchaFailed: 'Validação reCAPTCHA falhou. Por favor, tente novamente.'
419
+ }
420
+ }
421
+ };
422
+ const en = {
423
+ codebitWebAntd: {
424
+ LoggedMainContainer: {
425
+ theme: 'Theme',
426
+ logout: 'Logout',
427
+ version: 'Version'
428
+ },
429
+ HandleError: {
430
+ notFoundTitle: 'Page not found',
431
+ forbiddenTitle: 'Access denied',
432
+ internalTitle: 'Internal error',
433
+ genericTitle: 'Unexpected error',
434
+ notFoundMessage: 'The page you were looking for does not exist.',
435
+ forbiddenMessage: 'You do not have permission to access this page.',
436
+ internalMessage: 'An internal server error occurred.',
437
+ genericMessage: 'An unexpected error occurred.',
438
+ backHome: 'Back to home'
439
+ },
440
+ ErrorRetry: {
441
+ defaultError: 'Failed to load',
442
+ retryButton: 'Try again',
443
+ reloadPageButton: 'Reload page',
444
+ networkError: 'Connection failed',
445
+ timeoutError: 'Server took too long to respond',
446
+ badRequestError: 'Invalid request',
447
+ forbiddenError: 'Resource denied by server',
448
+ notFoundError: 'Resource not found by server',
449
+ internalServerError: 'Internal server error',
450
+ sessionExpiredError: 'Session expired'
451
+ },
452
+ Login: {
453
+ loginTitle: 'Login',
454
+ googleLogin: 'Login with Google',
455
+ emailLabel: 'Email',
456
+ passwordLabel: 'Password',
457
+ emailPlaceholder: 'Enter your email',
458
+ passwordPlaceholder: 'Enter your password',
459
+ forgotPassword: 'Forgot password?',
460
+ loginButton: 'Login',
461
+ emailRequired: 'Please enter your email!',
462
+ emailInvalid: 'Please enter a valid email!',
463
+ passwordRequired: 'Please enter your password!',
464
+ separator: 'or',
465
+ errorTitle: 'Login Error',
466
+ invalidPassword: 'The password is incorrect.',
467
+ invalidEmailOrPassword: 'The email or password is incorrect.',
468
+ authenticationFailed: 'Authentication failed',
469
+ userDisabled: 'Your account has been disabled. Please contact support.'
470
+ },
471
+ ForgotPassword: {
472
+ title: 'Password reset',
473
+ instructions: 'Enter your email to receive password reset instructions.',
474
+ emailRequired: 'Please enter your email!',
475
+ emailInvalid: 'Please enter a valid email!',
476
+ emailPlaceholder: 'Email',
477
+ submitButton: 'Reset password',
478
+ backToLogin: 'Back to login',
479
+ resetSuccessMessage: 'If the provided email is correct, we will send you an email with instructions to reset your password.'
480
+ },
481
+ ChangePassword: {
482
+ title: 'Change password',
483
+ passwordInstructions: 'Set a new password to log in.',
484
+ newPassword: 'New password',
485
+ confirmPassword: 'Confirm password',
486
+ submit: 'Send',
487
+ backToLogin: 'Back to login',
488
+ passwordRequired: 'Please enter your new password!',
489
+ passwordLength: '8 characters',
490
+ passwordUpperCase: 'an uppercase letter',
491
+ passwordLowerCase: 'a lowercase letter',
492
+ passwordNumbers: 'a number',
493
+ passwordSpecialChars: 'a special character (!@#$%^&*)',
494
+ passwordWeak: 'Weak password: Must have at least {requirements}',
495
+ passwordsNotMatch: 'The passwords do not match!',
496
+ tokenInvalidTitle: 'Invalid Token',
497
+ tokenInvalidOrExpired: 'The provided token is invalid or expired. Start the password recovery process and try again.',
498
+ passwordChangedSuccess: 'Your password has been changed successfully. You will be redirected to the login after closing this window.',
499
+ tokenInvalidRecovery: 'The provided token is invalid or expired. Start the password recovery process again.'
500
+ },
501
+ LoginContainer: {
502
+ theme: 'Theme',
503
+ signIn: 'Sign in'
504
+ },
505
+ NotFound: {
506
+ pageNotFound: 'Page not found',
507
+ sorryTheSearchPageDoesntExistOrRemoved: 'Sorry, the page you are looking for does not exist or has been removed.',
508
+ back: 'Back',
509
+ company: '© 2025 Codebit - All rights reserved'
510
+ },
511
+ ListCard: {
512
+ clearFilters: 'Clear filters'
513
+ },
514
+ Common: {
515
+ ok: 'Ok',
516
+ close: 'Close',
517
+ genericError: 'An error occurred. Please try again.',
518
+ invalidEmail: 'The email address is invalid or not registered.',
519
+ recaptchaFailed: 'reCAPTCHA validation failed. Please try again.'
520
+ }
521
+ }
522
+ };
523
+ const i18nLib = external_i18next_namespaceObject.createInstance();
524
+ i18nLib.use(external_react_i18next_namespaceObject.initReactI18next).init({
525
+ resources: {
526
+ pt: pt,
527
+ en: en
528
+ },
529
+ lng: 'pt',
530
+ fallbackLng: 'pt',
531
+ defaultNS: 'codebitWebAntd',
532
+ ns: [
533
+ 'codebitWebAntd'
534
+ ],
535
+ interpolation: {
536
+ escapeValue: false
537
+ }
538
+ });
539
+ const i18n = i18nLib;
540
+ const CodebitConfigContext = /*#__PURE__*/ (0, external_react_.createContext)(null);
541
+ function CodebitConfigProvider({ children, menuItems, user, onLogout, version = '1.0', showVersion = true, secondarySidebar, secondarySidebarWidth = 280, storeThemeInLocalStorage = true }) {
542
+ const getSystemTheme = ()=>globalThis.matchMedia?.('(prefers-color-scheme: dark)')?.matches ?? false;
543
+ const [isDarkMode, setIsDarkMode] = (0, external_react_.useState)(()=>{
544
+ if (storeThemeInLocalStorage) {
545
+ const savedTheme = localStorage.getItem('theme');
546
+ if (null !== savedTheme) return 'dark' === savedTheme;
547
+ }
548
+ return getSystemTheme();
549
+ });
550
+ (0, external_react_.useEffect)(()=>{
551
+ const mediaQuery = globalThis.matchMedia('(prefers-color-scheme: dark)');
552
+ const handleThemeChange = (e)=>{
553
+ if (!storeThemeInLocalStorage) return void setIsDarkMode(e.matches);
554
+ const savedTheme = localStorage.getItem('theme');
555
+ if (null === savedTheme) setIsDarkMode(e.matches);
556
+ };
557
+ mediaQuery.addEventListener('change', handleThemeChange);
558
+ return ()=>{
559
+ mediaQuery.removeEventListener('change', handleThemeChange);
560
+ };
561
+ }, [
562
+ storeThemeInLocalStorage
563
+ ]);
564
+ const toggleTheme = ()=>{
565
+ const newTheme = !isDarkMode;
566
+ setIsDarkMode(newTheme);
567
+ if (storeThemeInLocalStorage) localStorage.setItem('theme', newTheme ? 'dark' : 'light');
568
+ };
569
+ const resetToSystemTheme = ()=>{
570
+ if (storeThemeInLocalStorage) localStorage.removeItem('theme');
571
+ setIsDarkMode(getSystemTheme());
572
+ };
573
+ const contextValue = (0, external_react_.useMemo)(()=>({
574
+ menuItems,
575
+ user,
576
+ onLogout,
577
+ version,
578
+ showVersion,
579
+ i18n: i18n,
580
+ secondarySidebar,
581
+ secondarySidebarWidth,
582
+ isDarkMode,
583
+ setIsDarkMode,
584
+ toggleTheme,
585
+ resetToSystemTheme
586
+ }), [
587
+ menuItems,
588
+ user,
589
+ onLogout,
590
+ version,
591
+ showVersion,
592
+ secondarySidebar,
593
+ secondarySidebarWidth,
594
+ isDarkMode,
595
+ storeThemeInLocalStorage
596
+ ]);
597
+ return /*#__PURE__*/ (0, jsx_runtime.jsxs)(CodebitConfigContext.Provider, {
598
+ value: contextValue,
599
+ children: [
600
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(CssTokenBridge, {}),
601
+ children
602
+ ]
603
+ });
604
+ }
605
+ CodebitConfigProvider.propTypes = {
606
+ children: external_prop_types_default().node.isRequired,
607
+ menuItems: external_prop_types_default().arrayOf(external_prop_types_default().shape({
608
+ key: external_prop_types_default().string.isRequired,
609
+ icon: external_prop_types_default().node,
610
+ label: external_prop_types_default().string.isRequired,
611
+ roles: external_prop_types_default().arrayOf(external_prop_types_default().string)
612
+ })).isRequired,
613
+ user: external_prop_types_default().shape({
614
+ name: external_prop_types_default().string.isRequired,
615
+ email: external_prop_types_default().string.isRequired,
616
+ id: external_prop_types_default().string.isRequired,
617
+ roles: external_prop_types_default().arrayOf(external_prop_types_default().string).isRequired
618
+ }).isRequired,
619
+ onLogout: external_prop_types_default().func.isRequired,
620
+ version: external_prop_types_default().string,
621
+ showVersion: external_prop_types_default().bool,
622
+ secondarySidebar: external_prop_types_default().node,
623
+ secondarySidebarWidth: external_prop_types_default().number,
624
+ storeThemeInLocalStorage: external_prop_types_default().bool
625
+ };
626
+ const ThemeToggle = ()=>{
627
+ const config = (0, external_react_.useContext)(CodebitConfigContext);
628
+ if (!config) throw new Error('ThemeToggle must be used within CodebitConfigProvider');
629
+ (0, external_react_.useEffect)(()=>{
630
+ document.documentElement.style.colorScheme = config.isDarkMode ? 'dark' : 'light';
631
+ }, [
632
+ config.isDarkMode
633
+ ]);
634
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Switch, {
635
+ theme: config.isDarkMode ? 'dark' : 'light',
636
+ checked: config.isDarkMode,
637
+ onChange: config.toggleTheme,
638
+ checkedChildren: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.MoonOutlined, {}),
639
+ unCheckedChildren: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.SunOutlined, {})
640
+ });
641
+ };
642
+ const LoggedMainContainer_module = {
643
+ layout: "layout-mL5o6I",
644
+ drawer: "drawer-oj0mJX",
645
+ drawerBody: "drawerBody-YtAN37",
646
+ drawerFlex: "drawerFlex-AGTAax",
647
+ sider: "sider-BDy1Bs",
648
+ siderLayout: "siderLayout-C8H0uI",
649
+ secondarySidebar: "secondarySidebar-P6J_Xn",
650
+ menu: "menu-KMvPt7",
651
+ menuContainer: "menuContainer-ahnhBu",
652
+ menuLabel: "menuLabel-csBJTc",
653
+ menuDescription: "menuDescription-d6BFBO",
654
+ menuSpacer: "menuSpacer-RIB3II",
655
+ versionMenu: "versionMenu-NM4uyG",
656
+ logoutMenu: "logoutMenu-_RLfGo",
657
+ header: "header-vgc67L",
658
+ mobile: "mobile-mKGxb5",
659
+ headerSpace: "headerSpace-Fd_iha",
660
+ content: "content-OZHp2h"
661
+ };
662
+ const useCodebitWebAntdTranslation = ()=>(0, external_react_i18next_namespaceObject.useTranslation)('codebitWebAntd', {
663
+ i18n: i18n
664
+ });
665
+ const { Header, Sider, Content } = external_antd_namespaceObject.Layout;
666
+ const { Text } = external_antd_namespaceObject.Typography;
667
+ function LoggedMainContainer({ children }) {
668
+ const [collapsed, setCollapsed] = (0, external_react_.useState)(false);
669
+ const [isMobile, setIsMobile] = (0, external_react_.useState)(false);
670
+ const [drawerVisible, setDrawerVisible] = (0, external_react_.useState)(false);
671
+ const [secondarySidebarDrawerVisible, setSecondarySidebarDrawerVisible] = (0, external_react_.useState)(false);
672
+ const { t } = useCodebitWebAntdTranslation();
673
+ const navigate = (0, external_react_router_namespaceObject.useNavigate)();
674
+ const location = (0, external_react_router_namespaceObject.useLocation)();
675
+ const config = (0, external_react_.useContext)(CodebitConfigContext);
676
+ if (!config) throw new Error('LoggedContainer must be used within CodebitConfigProvider');
677
+ const { menuItems, user, onLogout, version, showVersion, isDarkMode, secondarySidebar, secondarySidebarWidth = 280 } = config;
678
+ const systemTheme = isDarkMode ? 'dark' : 'light';
679
+ const filteredMenuItems = (0, external_react_.useMemo)(()=>menuItems.filter((item)=>{
680
+ if (!item.roles) return true;
681
+ if (!user || !user.roles) return false;
682
+ if (item.roles) return item.roles.some((role)=>user.roles.includes(role));
683
+ return false;
684
+ }), [
685
+ menuItems,
686
+ user
687
+ ]);
688
+ (0, external_react_.useEffect)(()=>{
689
+ const checkScreenSize = ()=>{
690
+ setIsMobile(window.innerWidth < 768);
691
+ };
692
+ checkScreenSize();
693
+ window.addEventListener('resize', checkScreenSize);
694
+ return ()=>window.removeEventListener('resize', checkScreenSize);
695
+ }, []);
696
+ const handleLogout = async ()=>{
697
+ if (onLogout) await onLogout();
698
+ if (isMobile) setDrawerVisible(false);
699
+ navigate('/');
700
+ };
701
+ const handleMenuClick = (key)=>{
702
+ navigate(key);
703
+ if (isMobile) setDrawerVisible(false);
704
+ };
705
+ const getSelectedKey = ()=>{
706
+ const path = location.pathname;
707
+ const exactMatch = filteredMenuItems.find((item)=>item.key === path);
708
+ if (exactMatch) return exactMatch.key;
709
+ const prefixMatch = filteredMenuItems.find((item)=>path.startsWith(item.key) && '/' !== item.key);
710
+ if (prefixMatch) return prefixMatch.key;
711
+ return path;
712
+ };
713
+ const menuContent = /*#__PURE__*/ (0, jsx_runtime.jsxs)(jsx_runtime.Fragment, {
714
+ children: [
715
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Menu, {
716
+ theme: systemTheme,
717
+ mode: 'inline',
718
+ selectedKeys: [
719
+ getSelectedKey()
720
+ ],
721
+ onClick: ({ key })=>handleMenuClick(key),
722
+ items: filteredMenuItems,
723
+ className: LoggedMainContainer_module.menu
724
+ }),
725
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Layout.Content, {
726
+ className: LoggedMainContainer_module.menuSpacer
727
+ }),
728
+ showVersion && version && /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Menu, {
729
+ theme: systemTheme,
730
+ mode: 'horizontal',
731
+ className: LoggedMainContainer_module.versionMenu,
732
+ disabled: true,
733
+ items: [
734
+ {
735
+ icon: collapsed ? `${t('LoggedMainContainer.version')}: ${version}` : version,
736
+ title: ''
737
+ }
738
+ ]
739
+ }),
740
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Menu, {
741
+ theme: systemTheme,
742
+ mode: 'horizontal',
743
+ onClick: handleLogout,
744
+ className: LoggedMainContainer_module.logoutMenu,
745
+ items: [
746
+ {
747
+ key: 'logout',
748
+ icon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.LogoutOutlined, {}),
749
+ label: t('LoggedMainContainer.logout'),
750
+ danger: true
751
+ }
752
+ ]
753
+ })
754
+ ]
755
+ });
756
+ return /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Layout, {
757
+ className: LoggedMainContainer_module.layout,
758
+ children: [
759
+ isMobile ? /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Drawer, {
760
+ placement: 'left',
761
+ onClose: ()=>setDrawerVisible(false),
762
+ open: drawerVisible,
763
+ width: 250,
764
+ className: LoggedMainContainer_module.drawer,
765
+ classNames: {
766
+ body: LoggedMainContainer_module.drawerBody
767
+ },
768
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Flex, {
769
+ vertical: true,
770
+ className: LoggedMainContainer_module.drawerFlex,
771
+ children: menuContent
772
+ })
773
+ }) : /*#__PURE__*/ (0, jsx_runtime.jsx)(Sider, {
774
+ theme: systemTheme,
775
+ trigger: null,
776
+ collapsible: true,
777
+ collapsed: !collapsed,
778
+ breakpoint: 'lg',
779
+ collapsedWidth: 80,
780
+ className: LoggedMainContainer_module.sider,
781
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Layout, {
782
+ className: LoggedMainContainer_module.siderLayout,
783
+ children: menuContent
784
+ })
785
+ }),
786
+ secondarySidebar && !isMobile ? /*#__PURE__*/ (0, jsx_runtime.jsx)(Sider, {
787
+ theme: systemTheme,
788
+ width: secondarySidebarWidth,
789
+ className: `${LoggedMainContainer_module.secondarySidebar} ${isDarkMode ? LoggedMainContainer_module.secondarySidebarDark : ''}`,
790
+ children: secondarySidebar
791
+ }) : /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Drawer, {
792
+ placement: 'right',
793
+ onClose: ()=>setSecondarySidebarDrawerVisible(false),
794
+ open: secondarySidebarDrawerVisible,
795
+ width: 280,
796
+ className: LoggedMainContainer_module.drawer,
797
+ title: null,
798
+ closeIcon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.CloseOutlined, {}),
799
+ children: secondarySidebar
800
+ }),
801
+ /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Layout, {
802
+ children: [
803
+ /*#__PURE__*/ (0, jsx_runtime.jsxs)(Header, {
804
+ className: `${LoggedMainContainer_module.header} ${isMobile ? LoggedMainContainer_module.mobile : ''}`,
805
+ children: [
806
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Space, {
807
+ children: isMobile ? /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
808
+ type: 'text',
809
+ icon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.MenuOutlined, {}),
810
+ onClick: ()=>setDrawerVisible(true)
811
+ }) : /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
812
+ type: 'text',
813
+ icon: collapsed ? /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.MenuUnfoldOutlined, {}) : /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.MenuFoldOutlined, {}),
814
+ onClick: ()=>setCollapsed(!collapsed)
815
+ })
816
+ }),
817
+ /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Space, {
818
+ size: isMobile ? 'small' : 'middle',
819
+ className: `${LoggedMainContainer_module.headerSpace} ${isMobile ? LoggedMainContainer_module.mobile : ''}`,
820
+ children: [
821
+ secondarySidebar && isMobile && /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
822
+ type: 'text',
823
+ icon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.MenuOutlined, {}),
824
+ onClick: ()=>setSecondarySidebarDrawerVisible(true)
825
+ }),
826
+ !isMobile && /*#__PURE__*/ (0, jsx_runtime.jsx)(Text, {
827
+ children: t('LoggedMainContainer.theme')
828
+ }),
829
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(ThemeToggle, {})
830
+ ]
831
+ })
832
+ ]
833
+ }),
834
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(Content, {
835
+ className: `${LoggedMainContainer_module.content} ${isMobile ? LoggedMainContainer_module.mobile : ''}`,
836
+ children: children
837
+ })
838
+ ]
839
+ })
840
+ ]
841
+ });
842
+ }
843
+ LoggedMainContainer.propTypes = {
844
+ children: external_prop_types_default().node.isRequired
845
+ };
846
+ const codebit_web_namespaceObject = require("@codebit-programando-solucoes/codebit-web");
847
+ const react_namespaceObject = require("@sentry/react");
848
+ function ErrorRetry({ error, onRetry }) {
849
+ const { t } = useCodebitWebAntdTranslation();
850
+ if (error && error instanceof Error) {
851
+ console.error('Fail to load.', error);
852
+ react_namespaceObject.captureException(error);
853
+ }
854
+ const responseStatus = error?.response?.status || null;
855
+ let errorMessage = t('ErrorRetry.defaultError');
856
+ let retryText = t('ErrorRetry.retryButton');
857
+ let status = 'error';
858
+ if (error?.errorCode) switch(error.errorCode){
859
+ case codebit_web_namespaceObject.ErrorCode.ERR_NETWORK:
860
+ errorMessage = t('ErrorRetry.networkError');
861
+ break;
862
+ case codebit_web_namespaceObject.ErrorCode.ERR_TIMEOUT:
863
+ errorMessage = t('ErrorRetry.timeoutError');
864
+ break;
865
+ }
866
+ else if (responseStatus) switch(responseStatus){
867
+ case 400:
868
+ errorMessage = t('ErrorRetry.badRequestError');
869
+ break;
870
+ case 403:
871
+ errorMessage = t('ErrorRetry.forbiddenError');
872
+ retryText = t('ErrorRetry.reloadPageButton');
873
+ onRetry = ()=>{
874
+ globalThis.location.reload();
875
+ };
876
+ status = 403;
877
+ break;
878
+ case 404:
879
+ errorMessage = t('ErrorRetry.notFoundError');
880
+ status = 404;
881
+ break;
882
+ case 500:
883
+ errorMessage = t('ErrorRetry.internalServerError');
884
+ status = 500;
885
+ break;
886
+ case 401:
887
+ errorMessage = t('ErrorRetry.sessionExpiredError');
888
+ retryText = t('ErrorRetry.reloadPageButton');
889
+ onRetry = ()=>{
890
+ globalThis.location.reload();
891
+ };
892
+ break;
893
+ }
894
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Card, {
895
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Result, {
896
+ status: status,
897
+ title: errorMessage,
898
+ extra: [
899
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
900
+ type: 'primary',
901
+ onClick: onRetry,
902
+ icon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.ReloadOutlined, {}),
903
+ children: retryText
904
+ }, 'retry')
905
+ ]
906
+ })
907
+ });
908
+ }
909
+ ErrorRetry.propTypes = {
910
+ error: external_prop_types_default().object.isRequired,
911
+ onRetry: external_prop_types_default().func.isRequired
912
+ };
913
+ const ListCard_module = {
914
+ listCard: "listCard-ISftFd",
915
+ headerRow: "headerRow-UsZAzP",
916
+ actions: "actions-ig53s2",
917
+ filtersRow: "filtersRow-f3Xk5a",
918
+ expandArea: "expandArea-czOoFS"
919
+ };
920
+ const { Title } = external_antd_namespaceObject.Typography;
921
+ function ListCard({ title, onClearFilters, headerContainer, tableContainer, actions }) {
922
+ const { token } = external_antd_namespaceObject.theme.useToken();
923
+ const { t } = (0, external_react_i18next_namespaceObject.useTranslation)('codebitWebAntd');
924
+ const margin = token['margin'];
925
+ return /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Card, {
926
+ className: ListCard_module.listCard,
927
+ children: [
928
+ /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Row, {
929
+ gutter: margin,
930
+ align: 'middle',
931
+ className: ListCard_module.headerRow,
932
+ children: [
933
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Col, {
934
+ xs: 24,
935
+ sm: 24,
936
+ md: 12,
937
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(Title, {
938
+ level: 4,
939
+ children: title
940
+ })
941
+ }),
942
+ (!!onClearFilters || !!actions) && /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Col, {
943
+ xs: 24,
944
+ sm: 24,
945
+ md: 12,
946
+ className: ListCard_module.actions,
947
+ children: [
948
+ !!onClearFilters && /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
949
+ icon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.ClearOutlined, {}),
950
+ onClick: onClearFilters,
951
+ children: t('ListCard.clearFilters')
952
+ }),
953
+ actions
954
+ ]
955
+ })
956
+ ]
957
+ }),
958
+ !!headerContainer && /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Row, {
959
+ gutter: margin,
960
+ className: ListCard_module.filtersRow,
961
+ children: headerContainer
962
+ }),
963
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Layout, {
964
+ className: ListCard_module.expandArea,
965
+ children: tableContainer
966
+ })
967
+ ]
968
+ });
969
+ }
970
+ ListCard.propTypes = {
971
+ title: external_prop_types_default().string.isRequired,
972
+ onClearFilters: external_prop_types_default().func,
973
+ headerContainer: external_prop_types_default().node,
974
+ tableContainer: external_prop_types_default().node,
975
+ actions: external_prop_types_default().node
976
+ };
977
+ ListCard.defaultProps = {
978
+ onClearFilters: null,
979
+ headerContainer: null,
980
+ tableContainer: null,
981
+ actions: null
982
+ };
983
+ const CssTokenBridge = ()=>{
984
+ const { token } = external_antd_namespaceObject.theme.useToken();
985
+ (0, external_react_.useLayoutEffect)(()=>{
986
+ const root = document.documentElement;
987
+ root.style.setProperty('--antd-color-bg-container', token['colorBgContainer']);
988
+ root.style.setProperty('--antd-color-bg-elevated', token['colorBgElevated']);
989
+ root.style.setProperty('--antd-color-bg-layout', token['colorBgLayout']);
990
+ root.style.setProperty('--antd-color-border', token['colorBorder']);
991
+ root.style.setProperty('--antd-color-primary', token['colorPrimary']);
992
+ root.style.setProperty('--antd-color-text', token['colorText']);
993
+ root.style.setProperty('--antd-color-text-secondary', token['colorTextSecondary']);
994
+ root.style.setProperty('--antd-color-split', token['colorSplit']);
995
+ root.style.setProperty('--antd-margin-xxs', `${token['marginXXS']}px`);
996
+ root.style.setProperty('--antd-margin-xs', `${token['marginXS']}px`);
997
+ root.style.setProperty('--antd-margin-sm', `${token['marginSM']}px`);
998
+ root.style.setProperty('--antd-margin', `${token['margin']}px`);
999
+ root.style.setProperty('--antd-margin-md', `${token['marginMD']}px`);
1000
+ root.style.setProperty('--antd-margin-lg', `${token['marginLG']}px`);
1001
+ root.style.setProperty('--antd-margin-xl', `${token['marginXL']}px`);
1002
+ root.style.setProperty('--antd-margin-xxl', `${token['marginXXL']}px`);
1003
+ root.style.setProperty('--antd-padding-xxs', `${token['paddingXXS']}px`);
1004
+ root.style.setProperty('--antd-padding-xs', `${token['paddingXS']}px`);
1005
+ root.style.setProperty('--antd-padding-sm', `${token['paddingSM']}px`);
1006
+ root.style.setProperty('--antd-padding', `${token['padding']}px`);
1007
+ root.style.setProperty('--antd-padding-md', `${token['paddingMD']}px`);
1008
+ root.style.setProperty('--antd-padding-lg', `${token['paddingLG']}px`);
1009
+ root.style.setProperty('--antd-padding-xl', `${token['paddingXL']}px`);
1010
+ root.style.setProperty('--antd-font-size-sm', `${token['fontSizeSM']}px`);
1011
+ root.style.setProperty('--antd-font-size', `${token['fontSize']}px`);
1012
+ root.style.setProperty('--antd-font-size-lg', `${token['fontSizeLG']}px`);
1013
+ root.style.setProperty('--antd-font-size-xl', `${token['fontSizeXL']}px`);
1014
+ root.style.setProperty('--antd-line-height', token['lineHeight']);
1015
+ root.style.setProperty('--antd-line-height-lg', token['lineHeightLG']);
1016
+ root.style.setProperty('--antd-control-height-sm', `${token['controlHeightSM']}px`);
1017
+ root.style.setProperty('--antd-control-height', `${token['controlHeight']}px`);
1018
+ root.style.setProperty('--antd-control-height-lg', `${token['controlHeightLG']}px`);
1019
+ root.style.setProperty('--antd-border-radius-sm', `${token['borderRadiusSM']}px`);
1020
+ root.style.setProperty('--antd-border-radius', `${token['borderRadius']}px`);
1021
+ root.style.setProperty('--antd-border-radius-lg', `${token['borderRadiusLG']}px`);
1022
+ }, [
1023
+ token
1024
+ ]);
1025
+ return null;
1026
+ };
1027
+ const TableContainer_module = {
1028
+ tableContainer: "tableContainer-EhNwOm"
1029
+ };
1030
+ function isPaginationNode(node) {
1031
+ if (node.nodeType !== Node.ELEMENT_NODE) return false;
1032
+ const element = node;
1033
+ return element.classList?.contains('ant-table-pagination') || element.querySelector?.('.ant-table-pagination');
1034
+ }
1035
+ function hasPaginationInMutation(mutation) {
1036
+ return Array.from(mutation.addedNodes).some(isPaginationNode);
1037
+ }
1038
+ function TableContainer({ children }) {
1039
+ const containerRef = (0, external_react_.useRef)(null);
1040
+ const containerHeightRef = (0, external_react_.useRef)(null);
1041
+ const [scrollY, setScrollY] = (0, external_react_.useState)(void 0);
1042
+ (0, external_react_.useLayoutEffect)(()=>{
1043
+ const calculateHeights = ()=>{
1044
+ if (!containerRef.current) return;
1045
+ containerHeightRef.current = containerRef.current.offsetHeight;
1046
+ const thead = containerRef.current.querySelector('thead');
1047
+ let theadHeight = 0;
1048
+ if (thead) {
1049
+ const rect = thead.getBoundingClientRect();
1050
+ const styles = globalThis.getComputedStyle(thead);
1051
+ const marginTop = Number.parseFloat(styles.marginTop) || 0;
1052
+ const marginBottom = Number.parseFloat(styles.marginBottom) || 0;
1053
+ theadHeight = rect.height + marginTop + marginBottom;
1054
+ }
1055
+ const pagination = containerRef.current.querySelector('.ant-table-pagination');
1056
+ let paginationHeight = 0;
1057
+ if (pagination) {
1058
+ const rect = pagination.getBoundingClientRect();
1059
+ const styles = globalThis.getComputedStyle(pagination);
1060
+ const marginTop = Number.parseFloat(styles.marginTop) || 0;
1061
+ const marginBottom = Number.parseFloat(styles.marginBottom) || 0;
1062
+ paginationHeight = rect.height + marginTop + marginBottom;
1063
+ }
1064
+ const availableHeight = Math.ceil(containerHeightRef.current) - Math.ceil(theadHeight) - Math.ceil(paginationHeight) - 1;
1065
+ setScrollY(availableHeight);
1066
+ };
1067
+ calculateHeights();
1068
+ const observer = new MutationObserver((mutations)=>{
1069
+ const hasPagination = mutations.some(hasPaginationInMutation);
1070
+ if (hasPagination) calculateHeights();
1071
+ });
1072
+ if (containerRef.current) observer.observe(containerRef.current, {
1073
+ childList: true,
1074
+ subtree: true
1075
+ });
1076
+ globalThis.addEventListener('resize', calculateHeights);
1077
+ return ()=>{
1078
+ observer.disconnect();
1079
+ globalThis.removeEventListener('resize', calculateHeights);
1080
+ };
1081
+ }, []);
1082
+ const enhancedChildren = scrollY ? /*#__PURE__*/ (0, external_react_.cloneElement)(children, {
1083
+ scroll: {
1084
+ ...children.props?.scroll,
1085
+ y: scrollY,
1086
+ x: 'max-content'
1087
+ }
1088
+ }) : children;
1089
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)("div", {
1090
+ ref: containerRef,
1091
+ className: TableContainer_module.tableContainer,
1092
+ children: enhancedChildren
1093
+ });
1094
+ }
1095
+ TableContainer.propTypes = {
1096
+ children: external_prop_types_default().element.isRequired
1097
+ };
1098
+ function FilterContainer({ children, ...props }) {
1099
+ const { token } = external_antd_namespaceObject.theme.useToken();
1100
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Card, {
1101
+ styles: {
1102
+ body: {
1103
+ padding: token['paddingXS'] + 'px'
1104
+ }
1105
+ },
1106
+ ...props,
1107
+ children: children
1108
+ });
1109
+ }
1110
+ FilterContainer.propTypes = {
1111
+ children: external_prop_types_default().node.isRequired,
1112
+ ...external_antd_namespaceObject.Card.propTypes
1113
+ };
1114
+ const Login_module = {
1115
+ containerRow: "containerRow-lnjnDt",
1116
+ themeRow: "themeRow-ZhL0jS",
1117
+ loginCard: "loginCard-k07Wjb",
1118
+ dark: "dark-JBf6Fe",
1119
+ titleRow: "titleRow-XMkFzo",
1120
+ appTitle: "appTitle-tL41k9",
1121
+ divider: "divider-oJpEKR",
1122
+ loginHeader: "loginHeader-bBGO5B"
1123
+ };
1124
+ function LoginContainer({ title, children }) {
1125
+ const config = (0, external_react_.useContext)(CodebitConfigContext);
1126
+ if (!config) throw new Error('Login must be used within CodebitConfigProvider');
1127
+ const { t } = useCodebitWebAntdTranslation();
1128
+ const classList = [
1129
+ Login_module.loginCard
1130
+ ];
1131
+ if (config.isDarkMode) classList.push(Login_module.dark);
1132
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Row, {
1133
+ justify: 'center',
1134
+ align: 'middle',
1135
+ className: Login_module.containerRow,
1136
+ children: /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Col, {
1137
+ xs: 22,
1138
+ sm: 18,
1139
+ md: 14,
1140
+ lg: 10,
1141
+ xl: 8,
1142
+ children: [
1143
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Row, {
1144
+ justify: 'end',
1145
+ className: Login_module.themeRow,
1146
+ children: /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Space, {
1147
+ children: [
1148
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Typography.Text, {
1149
+ children: t('LoginContainer.theme')
1150
+ }),
1151
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(ThemeToggle, {})
1152
+ ]
1153
+ })
1154
+ }),
1155
+ /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Card, {
1156
+ className: classList.join(' '),
1157
+ children: [
1158
+ /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Row, {
1159
+ justify: 'center',
1160
+ className: Login_module.titleRow,
1161
+ children: [
1162
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Typography.Title, {
1163
+ level: 3,
1164
+ className: Login_module.appTitle,
1165
+ children: title
1166
+ }),
1167
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Divider, {
1168
+ className: Login_module.divider
1169
+ })
1170
+ ]
1171
+ }),
1172
+ children
1173
+ ]
1174
+ })
1175
+ ]
1176
+ })
1177
+ });
1178
+ }
1179
+ LoginContainer.propTypes = {
1180
+ title: external_prop_types_default().oneOfType([
1181
+ external_prop_types_default().string,
1182
+ external_prop_types_default().node
1183
+ ]).isRequired,
1184
+ children: external_prop_types_default().node
1185
+ };
1186
+ const logger = new codebit_web_namespaceObject.Logger('Login');
1187
+ const LocalLoginAuthenticationResult = Object.freeze({
1188
+ INVALID_EMAIL: 'INVALID_EMAIL',
1189
+ INVALID_PASSWORD: 'INVALID_PASSWORD',
1190
+ INVALID_EMAIL_OR_PASSWORD: 'INVALID_EMAIL_OR_PASSWORD',
1191
+ RECAPTCHA_VALIDATION_FAIL: 'RECAPTCHA_VALIDATION_FAIL',
1192
+ USER_DISABLED: 'USER_DISABLED',
1193
+ SUCCESS: 'SUCCESS'
1194
+ });
1195
+ function Login({ title, oauthCallbackUrl, navigateToForgotPassword, submitAuthenticateLocalUser }) {
1196
+ const [localLoading, setLocalLoading] = (0, external_react_.useState)(false);
1197
+ const [googleLoading, setGoogleLoading] = (0, external_react_.useState)(false);
1198
+ const [form] = external_antd_namespaceObject.Form.useForm();
1199
+ const { t } = useCodebitWebAntdTranslation();
1200
+ const { modal } = external_antd_namespaceObject.App.useApp();
1201
+ const navigate = (0, external_react_router_namespaceObject.useNavigate)();
1202
+ const context = {
1203
+ navigate
1204
+ };
1205
+ const handleGoogleLogin = ()=>{
1206
+ setGoogleLoading(true);
1207
+ setTimeout(()=>{
1208
+ globalThis.location.assign(oauthCallbackUrl);
1209
+ setGoogleLoading(false);
1210
+ }, 1000);
1211
+ };
1212
+ const handleLocalLogin = async (values)=>{
1213
+ setLocalLoading(true);
1214
+ try {
1215
+ const { email, password } = values;
1216
+ const result = await submitAuthenticateLocalUser(email, password, context);
1217
+ switch(result){
1218
+ case LocalLoginAuthenticationResult.SUCCESS:
1219
+ break;
1220
+ case LocalLoginAuthenticationResult.INVALID_EMAIL:
1221
+ form.setFields([
1222
+ {
1223
+ name: 'email',
1224
+ errors: [
1225
+ t('Common.invalidEmail')
1226
+ ]
1227
+ }
1228
+ ]);
1229
+ break;
1230
+ case LocalLoginAuthenticationResult.INVALID_PASSWORD:
1231
+ form.setFields([
1232
+ {
1233
+ name: 'password',
1234
+ errors: [
1235
+ t('Login.invalidPassword')
1236
+ ]
1237
+ }
1238
+ ]);
1239
+ break;
1240
+ case LocalLoginAuthenticationResult.INVALID_EMAIL_OR_PASSWORD:
1241
+ form.setFields([
1242
+ {
1243
+ name: 'email',
1244
+ errors: [
1245
+ t('Login.invalidEmailOrPassword')
1246
+ ]
1247
+ },
1248
+ {
1249
+ name: 'password',
1250
+ errors: [
1251
+ t('Login.invalidEmailOrPassword')
1252
+ ]
1253
+ }
1254
+ ]);
1255
+ break;
1256
+ case LocalLoginAuthenticationResult.RECAPTCHA_VALIDATION_FAIL:
1257
+ modal.error({
1258
+ title: t('Login.authenticationFailed'),
1259
+ content: t('Common.recaptchaFailed'),
1260
+ okText: t('Common.ok')
1261
+ });
1262
+ break;
1263
+ case LocalLoginAuthenticationResult.USER_DISABLED:
1264
+ modal.error({
1265
+ title: t('Login.authenticationFailed'),
1266
+ content: t('Login.userDisabled'),
1267
+ okText: t('Common.ok')
1268
+ });
1269
+ break;
1270
+ default:
1271
+ logger.warn('Unhandled authentication result:', result);
1272
+ modal.error({
1273
+ title: t('Login.authenticationFailed'),
1274
+ content: t('Common.genericError'),
1275
+ okText: t('Common.ok')
1276
+ });
1277
+ }
1278
+ } catch (error) {
1279
+ logger.error(error);
1280
+ react_namespaceObject.captureException(error);
1281
+ modal.error({
1282
+ title: t('Login.errorTitle'),
1283
+ content: t('Common.genericError'),
1284
+ okText: t('Common.ok')
1285
+ });
1286
+ } finally{
1287
+ setLocalLoading(false);
1288
+ }
1289
+ };
1290
+ const handleNavigateToForgotPassword = async ()=>{
1291
+ await navigateToForgotPassword(context);
1292
+ };
1293
+ return /*#__PURE__*/ (0, jsx_runtime.jsxs)(LoginContainer, {
1294
+ title: title || t('Login.loginTitle'),
1295
+ children: [
1296
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Typography.Title, {
1297
+ level: 4,
1298
+ className: `${Login_module.loginHeader}`,
1299
+ children: t('LoginContainer.signIn')
1300
+ }),
1301
+ /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Space, {
1302
+ direction: 'vertical',
1303
+ size: 'large',
1304
+ style: {
1305
+ width: '100%'
1306
+ },
1307
+ children: [
1308
+ submitAuthenticateLocalUser && /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Form, {
1309
+ name: 'login-form',
1310
+ layout: 'vertical',
1311
+ onFinish: handleLocalLogin,
1312
+ children: [
1313
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Form.Item, {
1314
+ name: 'email',
1315
+ label: t('Login.emailLabel'),
1316
+ rules: [
1317
+ {
1318
+ required: true,
1319
+ message: t('Login.emailRequired')
1320
+ },
1321
+ {
1322
+ type: 'email',
1323
+ message: t('Login.emailInvalid')
1324
+ }
1325
+ ],
1326
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Input, {
1327
+ prefix: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.MailOutlined, {}),
1328
+ placeholder: t('Login.emailPlaceholder'),
1329
+ size: 'large'
1330
+ })
1331
+ }),
1332
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Form.Item, {
1333
+ name: 'password',
1334
+ label: t('Login.passwordLabel'),
1335
+ rules: [
1336
+ {
1337
+ required: true,
1338
+ message: t('Login.passwordRequired')
1339
+ }
1340
+ ],
1341
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Input.Password, {
1342
+ prefix: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.LockOutlined, {}),
1343
+ placeholder: t('Login.passwordPlaceholder'),
1344
+ size: 'large'
1345
+ })
1346
+ }),
1347
+ navigateToForgotPassword && /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Form.Item, {
1348
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Row, {
1349
+ justify: 'end',
1350
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Col, {
1351
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Typography.Link, {
1352
+ onClick: handleNavigateToForgotPassword,
1353
+ children: t('Login.forgotPassword')
1354
+ })
1355
+ })
1356
+ })
1357
+ }),
1358
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Form.Item, {
1359
+ style: {
1360
+ marginBottom: 0
1361
+ },
1362
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
1363
+ type: 'primary',
1364
+ htmlType: 'submit',
1365
+ size: 'large',
1366
+ loading: localLoading,
1367
+ disabled: googleLoading,
1368
+ block: true,
1369
+ children: t('Login.loginButton')
1370
+ })
1371
+ })
1372
+ ]
1373
+ }),
1374
+ submitAuthenticateLocalUser && oauthCallbackUrl && /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Divider, {
1375
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Typography.Text, {
1376
+ type: 'secondary',
1377
+ children: t('Login.separator')
1378
+ })
1379
+ }),
1380
+ oauthCallbackUrl && /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Flex, {
1381
+ vertical: true,
1382
+ align: 'center',
1383
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
1384
+ type: 'primary',
1385
+ size: 'large',
1386
+ icon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.GoogleOutlined, {}),
1387
+ loading: googleLoading,
1388
+ onClick: handleGoogleLogin,
1389
+ disabled: localLoading,
1390
+ block: true,
1391
+ children: t('Login.googleLogin')
1392
+ })
1393
+ })
1394
+ ]
1395
+ })
1396
+ ]
1397
+ });
1398
+ }
1399
+ Login.propTypes = {
1400
+ title: external_prop_types_default().oneOfType([
1401
+ external_prop_types_default().string,
1402
+ external_prop_types_default().node
1403
+ ]),
1404
+ oauthCallbackUrl: external_prop_types_default().string,
1405
+ navigateToForgotPassword: external_prop_types_default().func,
1406
+ submitAuthenticateLocalUser: external_prop_types_default().func
1407
+ };
1408
+ const HandleError_module = {
1409
+ container: "container-A_JXAc",
1410
+ content: "content-yh3y0U",
1411
+ title: "title-rFxsxp",
1412
+ errorDetails: "errorDetails-DjtTbH",
1413
+ errorStack: "errorStack-DJzbWD"
1414
+ };
1415
+ function HandleError({ title }) {
1416
+ const error = (0, external_react_router_namespaceObject.useRouteError)();
1417
+ const navigate = (0, external_react_router_namespaceObject.useNavigate)();
1418
+ const { t } = useCodebitWebAntdTranslation();
1419
+ const handleGoHome = ()=>{
1420
+ navigate('/');
1421
+ };
1422
+ const getErrorStatus = ()=>{
1423
+ if (error && 404 === error.status) return 404;
1424
+ if (error && 403 === error.status) return 403;
1425
+ if (error && 500 === error.status) return 500;
1426
+ return 'error';
1427
+ };
1428
+ const getErrorMessage = ()=>{
1429
+ if (error && 404 === error.status) return t('HandleError.notFoundMessage');
1430
+ if (error && 403 === error.status) return t('HandleError.forbiddenMessage');
1431
+ if (error && 500 === error.status) return t('HandleError.internalMessage');
1432
+ return error && error.message || t('HandleError.genericMessage');
1433
+ };
1434
+ const getErrorTitle = ()=>{
1435
+ if (error && 404 === error.status) return t('HandleError.notFoundTitle');
1436
+ if (error && 403 === error.status) return t('HandleError.forbiddenTitle');
1437
+ if (error && 500 === error.status) return t('HandleError.internalTitle');
1438
+ return t('HandleError.genericTitle');
1439
+ };
1440
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Flex, {
1441
+ justify: 'center',
1442
+ align: 'center',
1443
+ className: HandleError_module.container,
1444
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Flex, {
1445
+ className: HandleError_module.content,
1446
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Result, {
1447
+ status: getErrorStatus(),
1448
+ title: /*#__PURE__*/ (0, jsx_runtime.jsxs)(jsx_runtime.Fragment, {
1449
+ children: [
1450
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Typography.Title, {
1451
+ level: 2,
1452
+ className: HandleError_module.title,
1453
+ children: title
1454
+ }),
1455
+ getErrorTitle()
1456
+ ]
1457
+ }),
1458
+ subTitle: getErrorMessage(),
1459
+ extra: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
1460
+ type: 'primary',
1461
+ size: 'large',
1462
+ onClick: handleGoHome,
1463
+ children: t('HandleError.backHome')
1464
+ })
1465
+ })
1466
+ })
1467
+ });
1468
+ }
1469
+ HandleError.propTypes = {
1470
+ title: external_prop_types_default().string
1471
+ };
1472
+ const ForgotPassword_logger = new codebit_web_namespaceObject.Logger('ForgotPassword');
1473
+ const LocalLoginRecoveryPasswordResult = Object.freeze({
1474
+ INVALID_EMAIL: 'INVALID_EMAIL',
1475
+ RECAPTCHA_VALIDATION_FAIL: 'RECAPTCHA_VALIDATION_FAIL',
1476
+ SUCCESS: 'SUCCESS'
1477
+ });
1478
+ const ForgotPassword = ({ navigateToLogin, submitRecoveryPassword })=>{
1479
+ const [form] = external_antd_namespaceObject.Form.useForm();
1480
+ const { modal } = external_antd_namespaceObject.App.useApp();
1481
+ const [loading, setLoading] = (0, external_react_.useState)(false);
1482
+ const { t } = useCodebitWebAntdTranslation();
1483
+ const navigate = (0, external_react_router_namespaceObject.useNavigate)();
1484
+ const context = {
1485
+ navigate
1486
+ };
1487
+ const handleNavigateToLogin = async ()=>{
1488
+ await navigateToLogin(context);
1489
+ };
1490
+ const handleRecoveryPassword = async (values)=>{
1491
+ setLoading(true);
1492
+ try {
1493
+ setLoading(true);
1494
+ const result = await submitRecoveryPassword(values.email, context);
1495
+ switch(result){
1496
+ case LocalLoginRecoveryPasswordResult.SUCCESS:
1497
+ modal.success({
1498
+ title: t('ForgotPassword.title'),
1499
+ content: t('ForgotPassword.resetSuccessMessage'),
1500
+ onOk: handleNavigateToLogin,
1501
+ okText: t('Common.ok')
1502
+ });
1503
+ break;
1504
+ case LocalLoginRecoveryPasswordResult.INVALID_EMAIL:
1505
+ form.setFields([
1506
+ {
1507
+ name: 'email',
1508
+ errors: [
1509
+ t('Common.invalidEmail')
1510
+ ]
1511
+ }
1512
+ ]);
1513
+ break;
1514
+ case LocalLoginRecoveryPasswordResult.RECAPTCHA_VALIDATION_FAIL:
1515
+ modal.error({
1516
+ title: t('ForgotPassword.title'),
1517
+ content: t('Common.recaptchaFailed'),
1518
+ okText: t('Common.ok')
1519
+ });
1520
+ break;
1521
+ }
1522
+ } catch (error) {
1523
+ ForgotPassword_logger.error(error);
1524
+ react_namespaceObject.captureException(error);
1525
+ modal.error({
1526
+ title: t('ForgotPassword.title'),
1527
+ content: t('Common.genericError'),
1528
+ okText: t('Common.ok')
1529
+ });
1530
+ } finally{
1531
+ setLoading(false);
1532
+ }
1533
+ };
1534
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)(LoginContainer, {
1535
+ title: t('ForgotPassword.title'),
1536
+ children: /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Form, {
1537
+ form: form,
1538
+ name: 'forgot-password-form',
1539
+ onFinish: handleRecoveryPassword,
1540
+ initialValues: {
1541
+ email: ''
1542
+ },
1543
+ style: {
1544
+ width: '100%'
1545
+ },
1546
+ children: [
1547
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Typography.Paragraph, {
1548
+ style: {
1549
+ textAlign: 'center'
1550
+ },
1551
+ children: t('ForgotPassword.instructions')
1552
+ }),
1553
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Form.Item, {
1554
+ name: 'email',
1555
+ rules: [
1556
+ {
1557
+ required: true,
1558
+ message: t('ForgotPassword.emailRequired')
1559
+ },
1560
+ {
1561
+ type: 'email',
1562
+ message: t('ForgotPassword.emailInvalid')
1563
+ }
1564
+ ],
1565
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Input, {
1566
+ prefix: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.MailOutlined, {}),
1567
+ placeholder: t('ForgotPassword.emailPlaceholder'),
1568
+ size: 'large'
1569
+ })
1570
+ }),
1571
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Form.Item, {
1572
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
1573
+ type: 'primary',
1574
+ htmlType: 'submit',
1575
+ size: 'large',
1576
+ loading: loading,
1577
+ style: {
1578
+ width: '100%'
1579
+ },
1580
+ children: t('ForgotPassword.submitButton')
1581
+ })
1582
+ }),
1583
+ navigateToLogin && /*#__PURE__*/ (0, jsx_runtime.jsx)("div", {
1584
+ style: {
1585
+ textAlign: 'center'
1586
+ },
1587
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Typography.Link, {
1588
+ onClick: handleNavigateToLogin,
1589
+ children: t('ForgotPassword.backToLogin')
1590
+ })
1591
+ })
1592
+ ]
1593
+ })
1594
+ });
1595
+ };
1596
+ ForgotPassword.propTypes = {
1597
+ navigateToLogin: external_prop_types_default().func,
1598
+ submitRecoveryPassword: external_prop_types_default().func.isRequired
1599
+ };
1600
+ const CodebitTheme = (props)=>{
1601
+ const { token } = external_antd_namespaceObject.theme.useToken();
1602
+ const config = (0, external_react_.useContext)(CodebitConfigContext);
1603
+ if (!config) throw new Error('CodebitTheme must be used within CodebitConfigProvider');
1604
+ const { isDarkMode } = config;
1605
+ (0, external_react_.useEffect)(()=>{
1606
+ const rootElement = document.getElementById('root');
1607
+ if (isDarkMode) {
1608
+ document.body.classList.add('dark-theme');
1609
+ rootElement.classList.add('dark-theme');
1610
+ } else {
1611
+ document.body.classList.remove('dark-theme');
1612
+ rootElement.classList.remove('dark-theme');
1613
+ }
1614
+ document.documentElement.style.setProperty('--color-primary', isDarkMode ? '#589C75' : '#29D266');
1615
+ }, [
1616
+ isDarkMode,
1617
+ token.colorBgContainer
1618
+ ]);
1619
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.ConfigProvider, {
1620
+ theme: {
1621
+ algorithm: isDarkMode ? external_antd_namespaceObject.theme.darkAlgorithm : external_antd_namespaceObject.theme.defaultAlgorithm,
1622
+ token: {
1623
+ colorPrimary: isDarkMode ? '#589C75' : '#29D266',
1624
+ colorInfo: isDarkMode ? '#589C75' : '#29D266',
1625
+ colorLink: isDarkMode ? '#589C75' : '#29D266'
1626
+ },
1627
+ components: {
1628
+ Menu: {
1629
+ itemSelectedBg: isDarkMode ? '#589C75' : '#29D266',
1630
+ itemSelectedColor: '#FAFAFA',
1631
+ darkItemSelectedBg: isDarkMode ? '#589C75' : '#29D266',
1632
+ darkItemSelectedColor: '#FAFAFA'
1633
+ },
1634
+ Button: {
1635
+ colorPrimary: isDarkMode ? '#589C75' : '#29D266',
1636
+ colorPrimaryHover: isDarkMode ? '#6DB589' : '#3FE67F',
1637
+ colorPrimaryActive: isDarkMode ? '#4A8361' : '#1FBF4D'
1638
+ },
1639
+ Layout: {
1640
+ siderBg: isDarkMode ? '#1a1a1a' : '#001529',
1641
+ triggerBg: isDarkMode ? '#589C75' : '#29D266',
1642
+ triggerColor: '#FAFAFA'
1643
+ },
1644
+ Header: {
1645
+ colorPrimary: isDarkMode ? '#589C75' : '#29D266'
1646
+ }
1647
+ }
1648
+ },
1649
+ ...props
1650
+ });
1651
+ };
1652
+ CodebitTheme.propTypes = {};
1653
+ })();
1654
+ exports.CodebitConfigContext = __webpack_exports__.CodebitConfigContext;
1655
+ exports.CodebitConfigProvider = __webpack_exports__.CodebitConfigProvider;
1656
+ exports.CodebitTheme = __webpack_exports__.CodebitTheme;
1657
+ exports.CssTokenBridge = __webpack_exports__.CssTokenBridge;
1658
+ exports.ErrorRetry = __webpack_exports__.ErrorRetry;
1659
+ exports.FilterContainer = __webpack_exports__.FilterContainer;
1660
+ exports.ForgotPassword = __webpack_exports__.ForgotPassword;
1661
+ exports.HandleError = __webpack_exports__.HandleError;
1662
+ exports.ListCard = __webpack_exports__.ListCard;
1663
+ exports.LocalLoginAuthenticationResult = __webpack_exports__.LocalLoginAuthenticationResult;
1664
+ exports.LocalLoginRecoveryPasswordResult = __webpack_exports__.LocalLoginRecoveryPasswordResult;
1665
+ exports.LoggedMainContainer = __webpack_exports__.LoggedMainContainer;
1666
+ exports.Login = __webpack_exports__.Login;
1667
+ exports.LoginContainer = __webpack_exports__.LoginContainer;
1668
+ exports.TableContainer = __webpack_exports__.TableContainer;
1669
+ exports.ThemeToggle = __webpack_exports__.ThemeToggle;
1670
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
1671
+ "CodebitConfigContext",
1672
+ "CodebitConfigProvider",
1673
+ "CodebitTheme",
1674
+ "CssTokenBridge",
1675
+ "ErrorRetry",
1676
+ "FilterContainer",
1677
+ "ForgotPassword",
1678
+ "HandleError",
1679
+ "ListCard",
1680
+ "LocalLoginAuthenticationResult",
1681
+ "LocalLoginRecoveryPasswordResult",
1682
+ "LoggedMainContainer",
1683
+ "Login",
1684
+ "LoginContainer",
1685
+ "TableContainer",
1686
+ "ThemeToggle"
1687
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
1688
+ Object.defineProperty(exports, '__esModule', {
1689
+ value: true
1690
+ });