wcz-test 3.4.0 → 3.4.2

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,3655 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __export = (target, all) => {
12
+ for (var name in all)
13
+ __defProp(target, name, { get: all[name], enumerable: true });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from))
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
31
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
+
33
+ // node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
34
+ var require_react_is_production_min = __commonJS({
35
+ "node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js"(exports2) {
36
+ "use strict";
37
+ var b = "function" === typeof Symbol && Symbol.for;
38
+ var c = b ? Symbol.for("react.element") : 60103;
39
+ var d = b ? Symbol.for("react.portal") : 60106;
40
+ var e = b ? Symbol.for("react.fragment") : 60107;
41
+ var f = b ? Symbol.for("react.strict_mode") : 60108;
42
+ var g = b ? Symbol.for("react.profiler") : 60114;
43
+ var h = b ? Symbol.for("react.provider") : 60109;
44
+ var k = b ? Symbol.for("react.context") : 60110;
45
+ var l = b ? Symbol.for("react.async_mode") : 60111;
46
+ var m = b ? Symbol.for("react.concurrent_mode") : 60111;
47
+ var n = b ? Symbol.for("react.forward_ref") : 60112;
48
+ var p = b ? Symbol.for("react.suspense") : 60113;
49
+ var q = b ? Symbol.for("react.suspense_list") : 60120;
50
+ var r = b ? Symbol.for("react.memo") : 60115;
51
+ var t2 = b ? Symbol.for("react.lazy") : 60116;
52
+ var v = b ? Symbol.for("react.block") : 60121;
53
+ var w = b ? Symbol.for("react.fundamental") : 60117;
54
+ var x = b ? Symbol.for("react.responder") : 60118;
55
+ var y = b ? Symbol.for("react.scope") : 60119;
56
+ function z2(a) {
57
+ if ("object" === typeof a && null !== a) {
58
+ var u = a.$$typeof;
59
+ switch (u) {
60
+ case c:
61
+ switch (a = a.type, a) {
62
+ case l:
63
+ case m:
64
+ case e:
65
+ case g:
66
+ case f:
67
+ case p:
68
+ return a;
69
+ default:
70
+ switch (a = a && a.$$typeof, a) {
71
+ case k:
72
+ case n:
73
+ case t2:
74
+ case r:
75
+ case h:
76
+ return a;
77
+ default:
78
+ return u;
79
+ }
80
+ }
81
+ case d:
82
+ return u;
83
+ }
84
+ }
85
+ }
86
+ function A(a) {
87
+ return z2(a) === m;
88
+ }
89
+ exports2.AsyncMode = l;
90
+ exports2.ConcurrentMode = m;
91
+ exports2.ContextConsumer = k;
92
+ exports2.ContextProvider = h;
93
+ exports2.Element = c;
94
+ exports2.ForwardRef = n;
95
+ exports2.Fragment = e;
96
+ exports2.Lazy = t2;
97
+ exports2.Memo = r;
98
+ exports2.Portal = d;
99
+ exports2.Profiler = g;
100
+ exports2.StrictMode = f;
101
+ exports2.Suspense = p;
102
+ exports2.isAsyncMode = function(a) {
103
+ return A(a) || z2(a) === l;
104
+ };
105
+ exports2.isConcurrentMode = A;
106
+ exports2.isContextConsumer = function(a) {
107
+ return z2(a) === k;
108
+ };
109
+ exports2.isContextProvider = function(a) {
110
+ return z2(a) === h;
111
+ };
112
+ exports2.isElement = function(a) {
113
+ return "object" === typeof a && null !== a && a.$$typeof === c;
114
+ };
115
+ exports2.isForwardRef = function(a) {
116
+ return z2(a) === n;
117
+ };
118
+ exports2.isFragment = function(a) {
119
+ return z2(a) === e;
120
+ };
121
+ exports2.isLazy = function(a) {
122
+ return z2(a) === t2;
123
+ };
124
+ exports2.isMemo = function(a) {
125
+ return z2(a) === r;
126
+ };
127
+ exports2.isPortal = function(a) {
128
+ return z2(a) === d;
129
+ };
130
+ exports2.isProfiler = function(a) {
131
+ return z2(a) === g;
132
+ };
133
+ exports2.isStrictMode = function(a) {
134
+ return z2(a) === f;
135
+ };
136
+ exports2.isSuspense = function(a) {
137
+ return z2(a) === p;
138
+ };
139
+ exports2.isValidElementType = function(a) {
140
+ return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t2 || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
141
+ };
142
+ exports2.typeOf = z2;
143
+ }
144
+ });
145
+
146
+ // node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
147
+ var require_react_is_development = __commonJS({
148
+ "node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(exports2) {
149
+ "use strict";
150
+ if (process.env.NODE_ENV !== "production") {
151
+ (function() {
152
+ "use strict";
153
+ var hasSymbol = typeof Symbol === "function" && Symbol.for;
154
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
155
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
156
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
157
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
158
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
159
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
160
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
161
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
162
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
163
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
164
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
165
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
166
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
167
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
168
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
169
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
170
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
171
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
172
+ function isValidElementType(type) {
173
+ return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
174
+ type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
175
+ }
176
+ function typeOf(object) {
177
+ if (typeof object === "object" && object !== null) {
178
+ var $$typeof = object.$$typeof;
179
+ switch ($$typeof) {
180
+ case REACT_ELEMENT_TYPE:
181
+ var type = object.type;
182
+ switch (type) {
183
+ case REACT_ASYNC_MODE_TYPE:
184
+ case REACT_CONCURRENT_MODE_TYPE:
185
+ case REACT_FRAGMENT_TYPE:
186
+ case REACT_PROFILER_TYPE:
187
+ case REACT_STRICT_MODE_TYPE:
188
+ case REACT_SUSPENSE_TYPE:
189
+ return type;
190
+ default:
191
+ var $$typeofType = type && type.$$typeof;
192
+ switch ($$typeofType) {
193
+ case REACT_CONTEXT_TYPE:
194
+ case REACT_FORWARD_REF_TYPE:
195
+ case REACT_LAZY_TYPE:
196
+ case REACT_MEMO_TYPE:
197
+ case REACT_PROVIDER_TYPE:
198
+ return $$typeofType;
199
+ default:
200
+ return $$typeof;
201
+ }
202
+ }
203
+ case REACT_PORTAL_TYPE:
204
+ return $$typeof;
205
+ }
206
+ }
207
+ return void 0;
208
+ }
209
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
210
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
211
+ var ContextConsumer = REACT_CONTEXT_TYPE;
212
+ var ContextProvider = REACT_PROVIDER_TYPE;
213
+ var Element = REACT_ELEMENT_TYPE;
214
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
215
+ var Fragment7 = REACT_FRAGMENT_TYPE;
216
+ var Lazy = REACT_LAZY_TYPE;
217
+ var Memo = REACT_MEMO_TYPE;
218
+ var Portal = REACT_PORTAL_TYPE;
219
+ var Profiler = REACT_PROFILER_TYPE;
220
+ var StrictMode = REACT_STRICT_MODE_TYPE;
221
+ var Suspense = REACT_SUSPENSE_TYPE;
222
+ var hasWarnedAboutDeprecatedIsAsyncMode = false;
223
+ function isAsyncMode(object) {
224
+ {
225
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
226
+ hasWarnedAboutDeprecatedIsAsyncMode = true;
227
+ console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
228
+ }
229
+ }
230
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
231
+ }
232
+ function isConcurrentMode(object) {
233
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
234
+ }
235
+ function isContextConsumer(object) {
236
+ return typeOf(object) === REACT_CONTEXT_TYPE;
237
+ }
238
+ function isContextProvider(object) {
239
+ return typeOf(object) === REACT_PROVIDER_TYPE;
240
+ }
241
+ function isElement(object) {
242
+ return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
243
+ }
244
+ function isForwardRef(object) {
245
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
246
+ }
247
+ function isFragment(object) {
248
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
249
+ }
250
+ function isLazy(object) {
251
+ return typeOf(object) === REACT_LAZY_TYPE;
252
+ }
253
+ function isMemo(object) {
254
+ return typeOf(object) === REACT_MEMO_TYPE;
255
+ }
256
+ function isPortal(object) {
257
+ return typeOf(object) === REACT_PORTAL_TYPE;
258
+ }
259
+ function isProfiler(object) {
260
+ return typeOf(object) === REACT_PROFILER_TYPE;
261
+ }
262
+ function isStrictMode(object) {
263
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
264
+ }
265
+ function isSuspense(object) {
266
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
267
+ }
268
+ exports2.AsyncMode = AsyncMode;
269
+ exports2.ConcurrentMode = ConcurrentMode;
270
+ exports2.ContextConsumer = ContextConsumer;
271
+ exports2.ContextProvider = ContextProvider;
272
+ exports2.Element = Element;
273
+ exports2.ForwardRef = ForwardRef;
274
+ exports2.Fragment = Fragment7;
275
+ exports2.Lazy = Lazy;
276
+ exports2.Memo = Memo;
277
+ exports2.Portal = Portal;
278
+ exports2.Profiler = Profiler;
279
+ exports2.StrictMode = StrictMode;
280
+ exports2.Suspense = Suspense;
281
+ exports2.isAsyncMode = isAsyncMode;
282
+ exports2.isConcurrentMode = isConcurrentMode;
283
+ exports2.isContextConsumer = isContextConsumer;
284
+ exports2.isContextProvider = isContextProvider;
285
+ exports2.isElement = isElement;
286
+ exports2.isForwardRef = isForwardRef;
287
+ exports2.isFragment = isFragment;
288
+ exports2.isLazy = isLazy;
289
+ exports2.isMemo = isMemo;
290
+ exports2.isPortal = isPortal;
291
+ exports2.isProfiler = isProfiler;
292
+ exports2.isStrictMode = isStrictMode;
293
+ exports2.isSuspense = isSuspense;
294
+ exports2.isValidElementType = isValidElementType;
295
+ exports2.typeOf = typeOf;
296
+ })();
297
+ }
298
+ }
299
+ });
300
+
301
+ // node_modules/prop-types/node_modules/react-is/index.js
302
+ var require_react_is = __commonJS({
303
+ "node_modules/prop-types/node_modules/react-is/index.js"(exports2, module2) {
304
+ "use strict";
305
+ if (process.env.NODE_ENV === "production") {
306
+ module2.exports = require_react_is_production_min();
307
+ } else {
308
+ module2.exports = require_react_is_development();
309
+ }
310
+ }
311
+ });
312
+
313
+ // node_modules/object-assign/index.js
314
+ var require_object_assign = __commonJS({
315
+ "node_modules/object-assign/index.js"(exports2, module2) {
316
+ "use strict";
317
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
318
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
319
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
320
+ function toObject(val) {
321
+ if (val === null || val === void 0) {
322
+ throw new TypeError("Object.assign cannot be called with null or undefined");
323
+ }
324
+ return Object(val);
325
+ }
326
+ function shouldUseNative() {
327
+ try {
328
+ if (!Object.assign) {
329
+ return false;
330
+ }
331
+ var test1 = new String("abc");
332
+ test1[5] = "de";
333
+ if (Object.getOwnPropertyNames(test1)[0] === "5") {
334
+ return false;
335
+ }
336
+ var test2 = {};
337
+ for (var i = 0; i < 10; i++) {
338
+ test2["_" + String.fromCharCode(i)] = i;
339
+ }
340
+ var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
341
+ return test2[n];
342
+ });
343
+ if (order2.join("") !== "0123456789") {
344
+ return false;
345
+ }
346
+ var test3 = {};
347
+ "abcdefghijklmnopqrst".split("").forEach(function(letter) {
348
+ test3[letter] = letter;
349
+ });
350
+ if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
351
+ return false;
352
+ }
353
+ return true;
354
+ } catch (err) {
355
+ return false;
356
+ }
357
+ }
358
+ module2.exports = shouldUseNative() ? Object.assign : function(target, source) {
359
+ var from;
360
+ var to = toObject(target);
361
+ var symbols;
362
+ for (var s = 1; s < arguments.length; s++) {
363
+ from = Object(arguments[s]);
364
+ for (var key in from) {
365
+ if (hasOwnProperty.call(from, key)) {
366
+ to[key] = from[key];
367
+ }
368
+ }
369
+ if (getOwnPropertySymbols) {
370
+ symbols = getOwnPropertySymbols(from);
371
+ for (var i = 0; i < symbols.length; i++) {
372
+ if (propIsEnumerable.call(from, symbols[i])) {
373
+ to[symbols[i]] = from[symbols[i]];
374
+ }
375
+ }
376
+ }
377
+ }
378
+ return to;
379
+ };
380
+ }
381
+ });
382
+
383
+ // node_modules/prop-types/lib/ReactPropTypesSecret.js
384
+ var require_ReactPropTypesSecret = __commonJS({
385
+ "node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports2, module2) {
386
+ "use strict";
387
+ var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
388
+ module2.exports = ReactPropTypesSecret;
389
+ }
390
+ });
391
+
392
+ // node_modules/prop-types/lib/has.js
393
+ var require_has = __commonJS({
394
+ "node_modules/prop-types/lib/has.js"(exports2, module2) {
395
+ "use strict";
396
+ module2.exports = Function.call.bind(Object.prototype.hasOwnProperty);
397
+ }
398
+ });
399
+
400
+ // node_modules/prop-types/checkPropTypes.js
401
+ var require_checkPropTypes = __commonJS({
402
+ "node_modules/prop-types/checkPropTypes.js"(exports2, module2) {
403
+ "use strict";
404
+ var printWarning = function() {
405
+ };
406
+ if (process.env.NODE_ENV !== "production") {
407
+ ReactPropTypesSecret = require_ReactPropTypesSecret();
408
+ loggedTypeFailures = {};
409
+ has = require_has();
410
+ printWarning = function(text) {
411
+ var message = "Warning: " + text;
412
+ if (typeof console !== "undefined") {
413
+ console.error(message);
414
+ }
415
+ try {
416
+ throw new Error(message);
417
+ } catch (x) {
418
+ }
419
+ };
420
+ }
421
+ var ReactPropTypesSecret;
422
+ var loggedTypeFailures;
423
+ var has;
424
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
425
+ if (process.env.NODE_ENV !== "production") {
426
+ for (var typeSpecName in typeSpecs) {
427
+ if (has(typeSpecs, typeSpecName)) {
428
+ var error;
429
+ try {
430
+ if (typeof typeSpecs[typeSpecName] !== "function") {
431
+ var err = Error(
432
+ (componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
433
+ );
434
+ err.name = "Invariant Violation";
435
+ throw err;
436
+ }
437
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
438
+ } catch (ex) {
439
+ error = ex;
440
+ }
441
+ if (error && !(error instanceof Error)) {
442
+ printWarning(
443
+ (componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
444
+ );
445
+ }
446
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
447
+ loggedTypeFailures[error.message] = true;
448
+ var stack = getStack ? getStack() : "";
449
+ printWarning(
450
+ "Failed " + location + " type: " + error.message + (stack != null ? stack : "")
451
+ );
452
+ }
453
+ }
454
+ }
455
+ }
456
+ }
457
+ checkPropTypes.resetWarningCache = function() {
458
+ if (process.env.NODE_ENV !== "production") {
459
+ loggedTypeFailures = {};
460
+ }
461
+ };
462
+ module2.exports = checkPropTypes;
463
+ }
464
+ });
465
+
466
+ // node_modules/prop-types/factoryWithTypeCheckers.js
467
+ var require_factoryWithTypeCheckers = __commonJS({
468
+ "node_modules/prop-types/factoryWithTypeCheckers.js"(exports2, module2) {
469
+ "use strict";
470
+ var ReactIs = require_react_is();
471
+ var assign = require_object_assign();
472
+ var ReactPropTypesSecret = require_ReactPropTypesSecret();
473
+ var has = require_has();
474
+ var checkPropTypes = require_checkPropTypes();
475
+ var printWarning = function() {
476
+ };
477
+ if (process.env.NODE_ENV !== "production") {
478
+ printWarning = function(text) {
479
+ var message = "Warning: " + text;
480
+ if (typeof console !== "undefined") {
481
+ console.error(message);
482
+ }
483
+ try {
484
+ throw new Error(message);
485
+ } catch (x) {
486
+ }
487
+ };
488
+ }
489
+ function emptyFunctionThatReturnsNull() {
490
+ return null;
491
+ }
492
+ module2.exports = function(isValidElement, throwOnDirectAccess) {
493
+ var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
494
+ var FAUX_ITERATOR_SYMBOL = "@@iterator";
495
+ function getIteratorFn(maybeIterable) {
496
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
497
+ if (typeof iteratorFn === "function") {
498
+ return iteratorFn;
499
+ }
500
+ }
501
+ var ANONYMOUS = "<<anonymous>>";
502
+ var ReactPropTypes = {
503
+ array: createPrimitiveTypeChecker("array"),
504
+ bigint: createPrimitiveTypeChecker("bigint"),
505
+ bool: createPrimitiveTypeChecker("boolean"),
506
+ func: createPrimitiveTypeChecker("function"),
507
+ number: createPrimitiveTypeChecker("number"),
508
+ object: createPrimitiveTypeChecker("object"),
509
+ string: createPrimitiveTypeChecker("string"),
510
+ symbol: createPrimitiveTypeChecker("symbol"),
511
+ any: createAnyTypeChecker(),
512
+ arrayOf: createArrayOfTypeChecker,
513
+ element: createElementTypeChecker(),
514
+ elementType: createElementTypeTypeChecker(),
515
+ instanceOf: createInstanceTypeChecker,
516
+ node: createNodeChecker(),
517
+ objectOf: createObjectOfTypeChecker,
518
+ oneOf: createEnumTypeChecker,
519
+ oneOfType: createUnionTypeChecker,
520
+ shape: createShapeTypeChecker,
521
+ exact: createStrictShapeTypeChecker
522
+ };
523
+ function is(x, y) {
524
+ if (x === y) {
525
+ return x !== 0 || 1 / x === 1 / y;
526
+ } else {
527
+ return x !== x && y !== y;
528
+ }
529
+ }
530
+ function PropTypeError(message, data) {
531
+ this.message = message;
532
+ this.data = data && typeof data === "object" ? data : {};
533
+ this.stack = "";
534
+ }
535
+ PropTypeError.prototype = Error.prototype;
536
+ function createChainableTypeChecker(validate) {
537
+ if (process.env.NODE_ENV !== "production") {
538
+ var manualPropTypeCallCache = {};
539
+ var manualPropTypeWarningCount = 0;
540
+ }
541
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
542
+ componentName = componentName || ANONYMOUS;
543
+ propFullName = propFullName || propName;
544
+ if (secret !== ReactPropTypesSecret) {
545
+ if (throwOnDirectAccess) {
546
+ var err = new Error(
547
+ "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
548
+ );
549
+ err.name = "Invariant Violation";
550
+ throw err;
551
+ } else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
552
+ var cacheKey = componentName + ":" + propName;
553
+ if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
554
+ manualPropTypeWarningCount < 3) {
555
+ printWarning(
556
+ "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
557
+ );
558
+ manualPropTypeCallCache[cacheKey] = true;
559
+ manualPropTypeWarningCount++;
560
+ }
561
+ }
562
+ }
563
+ if (props[propName] == null) {
564
+ if (isRequired) {
565
+ if (props[propName] === null) {
566
+ return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
567
+ }
568
+ return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
569
+ }
570
+ return null;
571
+ } else {
572
+ return validate(props, propName, componentName, location, propFullName);
573
+ }
574
+ }
575
+ var chainedCheckType = checkType.bind(null, false);
576
+ chainedCheckType.isRequired = checkType.bind(null, true);
577
+ return chainedCheckType;
578
+ }
579
+ function createPrimitiveTypeChecker(expectedType) {
580
+ function validate(props, propName, componentName, location, propFullName, secret) {
581
+ var propValue = props[propName];
582
+ var propType = getPropType(propValue);
583
+ if (propType !== expectedType) {
584
+ var preciseType = getPreciseType(propValue);
585
+ return new PropTypeError(
586
+ "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
587
+ { expectedType }
588
+ );
589
+ }
590
+ return null;
591
+ }
592
+ return createChainableTypeChecker(validate);
593
+ }
594
+ function createAnyTypeChecker() {
595
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
596
+ }
597
+ function createArrayOfTypeChecker(typeChecker) {
598
+ function validate(props, propName, componentName, location, propFullName) {
599
+ if (typeof typeChecker !== "function") {
600
+ return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
601
+ }
602
+ var propValue = props[propName];
603
+ if (!Array.isArray(propValue)) {
604
+ var propType = getPropType(propValue);
605
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
606
+ }
607
+ for (var i = 0; i < propValue.length; i++) {
608
+ var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
609
+ if (error instanceof Error) {
610
+ return error;
611
+ }
612
+ }
613
+ return null;
614
+ }
615
+ return createChainableTypeChecker(validate);
616
+ }
617
+ function createElementTypeChecker() {
618
+ function validate(props, propName, componentName, location, propFullName) {
619
+ var propValue = props[propName];
620
+ if (!isValidElement(propValue)) {
621
+ var propType = getPropType(propValue);
622
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
623
+ }
624
+ return null;
625
+ }
626
+ return createChainableTypeChecker(validate);
627
+ }
628
+ function createElementTypeTypeChecker() {
629
+ function validate(props, propName, componentName, location, propFullName) {
630
+ var propValue = props[propName];
631
+ if (!ReactIs.isValidElementType(propValue)) {
632
+ var propType = getPropType(propValue);
633
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
634
+ }
635
+ return null;
636
+ }
637
+ return createChainableTypeChecker(validate);
638
+ }
639
+ function createInstanceTypeChecker(expectedClass) {
640
+ function validate(props, propName, componentName, location, propFullName) {
641
+ if (!(props[propName] instanceof expectedClass)) {
642
+ var expectedClassName = expectedClass.name || ANONYMOUS;
643
+ var actualClassName = getClassName(props[propName]);
644
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
645
+ }
646
+ return null;
647
+ }
648
+ return createChainableTypeChecker(validate);
649
+ }
650
+ function createEnumTypeChecker(expectedValues) {
651
+ if (!Array.isArray(expectedValues)) {
652
+ if (process.env.NODE_ENV !== "production") {
653
+ if (arguments.length > 1) {
654
+ printWarning(
655
+ "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
656
+ );
657
+ } else {
658
+ printWarning("Invalid argument supplied to oneOf, expected an array.");
659
+ }
660
+ }
661
+ return emptyFunctionThatReturnsNull;
662
+ }
663
+ function validate(props, propName, componentName, location, propFullName) {
664
+ var propValue = props[propName];
665
+ for (var i = 0; i < expectedValues.length; i++) {
666
+ if (is(propValue, expectedValues[i])) {
667
+ return null;
668
+ }
669
+ }
670
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
671
+ var type = getPreciseType(value);
672
+ if (type === "symbol") {
673
+ return String(value);
674
+ }
675
+ return value;
676
+ });
677
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
678
+ }
679
+ return createChainableTypeChecker(validate);
680
+ }
681
+ function createObjectOfTypeChecker(typeChecker) {
682
+ function validate(props, propName, componentName, location, propFullName) {
683
+ if (typeof typeChecker !== "function") {
684
+ return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
685
+ }
686
+ var propValue = props[propName];
687
+ var propType = getPropType(propValue);
688
+ if (propType !== "object") {
689
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
690
+ }
691
+ for (var key in propValue) {
692
+ if (has(propValue, key)) {
693
+ var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
694
+ if (error instanceof Error) {
695
+ return error;
696
+ }
697
+ }
698
+ }
699
+ return null;
700
+ }
701
+ return createChainableTypeChecker(validate);
702
+ }
703
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
704
+ if (!Array.isArray(arrayOfTypeCheckers)) {
705
+ process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
706
+ return emptyFunctionThatReturnsNull;
707
+ }
708
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
709
+ var checker = arrayOfTypeCheckers[i];
710
+ if (typeof checker !== "function") {
711
+ printWarning(
712
+ "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
713
+ );
714
+ return emptyFunctionThatReturnsNull;
715
+ }
716
+ }
717
+ function validate(props, propName, componentName, location, propFullName) {
718
+ var expectedTypes = [];
719
+ for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
720
+ var checker2 = arrayOfTypeCheckers[i2];
721
+ var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
722
+ if (checkerResult == null) {
723
+ return null;
724
+ }
725
+ if (checkerResult.data && has(checkerResult.data, "expectedType")) {
726
+ expectedTypes.push(checkerResult.data.expectedType);
727
+ }
728
+ }
729
+ var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
730
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
731
+ }
732
+ return createChainableTypeChecker(validate);
733
+ }
734
+ function createNodeChecker() {
735
+ function validate(props, propName, componentName, location, propFullName) {
736
+ if (!isNode(props[propName])) {
737
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
738
+ }
739
+ return null;
740
+ }
741
+ return createChainableTypeChecker(validate);
742
+ }
743
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
744
+ return new PropTypeError(
745
+ (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
746
+ );
747
+ }
748
+ function createShapeTypeChecker(shapeTypes) {
749
+ function validate(props, propName, componentName, location, propFullName) {
750
+ var propValue = props[propName];
751
+ var propType = getPropType(propValue);
752
+ if (propType !== "object") {
753
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
754
+ }
755
+ for (var key in shapeTypes) {
756
+ var checker = shapeTypes[key];
757
+ if (typeof checker !== "function") {
758
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
759
+ }
760
+ var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
761
+ if (error) {
762
+ return error;
763
+ }
764
+ }
765
+ return null;
766
+ }
767
+ return createChainableTypeChecker(validate);
768
+ }
769
+ function createStrictShapeTypeChecker(shapeTypes) {
770
+ function validate(props, propName, componentName, location, propFullName) {
771
+ var propValue = props[propName];
772
+ var propType = getPropType(propValue);
773
+ if (propType !== "object") {
774
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
775
+ }
776
+ var allKeys = assign({}, props[propName], shapeTypes);
777
+ for (var key in allKeys) {
778
+ var checker = shapeTypes[key];
779
+ if (has(shapeTypes, key) && typeof checker !== "function") {
780
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
781
+ }
782
+ if (!checker) {
783
+ return new PropTypeError(
784
+ "Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
785
+ );
786
+ }
787
+ var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
788
+ if (error) {
789
+ return error;
790
+ }
791
+ }
792
+ return null;
793
+ }
794
+ return createChainableTypeChecker(validate);
795
+ }
796
+ function isNode(propValue) {
797
+ switch (typeof propValue) {
798
+ case "number":
799
+ case "string":
800
+ case "undefined":
801
+ return true;
802
+ case "boolean":
803
+ return !propValue;
804
+ case "object":
805
+ if (Array.isArray(propValue)) {
806
+ return propValue.every(isNode);
807
+ }
808
+ if (propValue === null || isValidElement(propValue)) {
809
+ return true;
810
+ }
811
+ var iteratorFn = getIteratorFn(propValue);
812
+ if (iteratorFn) {
813
+ var iterator = iteratorFn.call(propValue);
814
+ var step;
815
+ if (iteratorFn !== propValue.entries) {
816
+ while (!(step = iterator.next()).done) {
817
+ if (!isNode(step.value)) {
818
+ return false;
819
+ }
820
+ }
821
+ } else {
822
+ while (!(step = iterator.next()).done) {
823
+ var entry = step.value;
824
+ if (entry) {
825
+ if (!isNode(entry[1])) {
826
+ return false;
827
+ }
828
+ }
829
+ }
830
+ }
831
+ } else {
832
+ return false;
833
+ }
834
+ return true;
835
+ default:
836
+ return false;
837
+ }
838
+ }
839
+ function isSymbol(propType, propValue) {
840
+ if (propType === "symbol") {
841
+ return true;
842
+ }
843
+ if (!propValue) {
844
+ return false;
845
+ }
846
+ if (propValue["@@toStringTag"] === "Symbol") {
847
+ return true;
848
+ }
849
+ if (typeof Symbol === "function" && propValue instanceof Symbol) {
850
+ return true;
851
+ }
852
+ return false;
853
+ }
854
+ function getPropType(propValue) {
855
+ var propType = typeof propValue;
856
+ if (Array.isArray(propValue)) {
857
+ return "array";
858
+ }
859
+ if (propValue instanceof RegExp) {
860
+ return "object";
861
+ }
862
+ if (isSymbol(propType, propValue)) {
863
+ return "symbol";
864
+ }
865
+ return propType;
866
+ }
867
+ function getPreciseType(propValue) {
868
+ if (typeof propValue === "undefined" || propValue === null) {
869
+ return "" + propValue;
870
+ }
871
+ var propType = getPropType(propValue);
872
+ if (propType === "object") {
873
+ if (propValue instanceof Date) {
874
+ return "date";
875
+ } else if (propValue instanceof RegExp) {
876
+ return "regexp";
877
+ }
878
+ }
879
+ return propType;
880
+ }
881
+ function getPostfixForTypeWarning(value) {
882
+ var type = getPreciseType(value);
883
+ switch (type) {
884
+ case "array":
885
+ case "object":
886
+ return "an " + type;
887
+ case "boolean":
888
+ case "date":
889
+ case "regexp":
890
+ return "a " + type;
891
+ default:
892
+ return type;
893
+ }
894
+ }
895
+ function getClassName(propValue) {
896
+ if (!propValue.constructor || !propValue.constructor.name) {
897
+ return ANONYMOUS;
898
+ }
899
+ return propValue.constructor.name;
900
+ }
901
+ ReactPropTypes.checkPropTypes = checkPropTypes;
902
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
903
+ ReactPropTypes.PropTypes = ReactPropTypes;
904
+ return ReactPropTypes;
905
+ };
906
+ }
907
+ });
908
+
909
+ // node_modules/prop-types/factoryWithThrowingShims.js
910
+ var require_factoryWithThrowingShims = __commonJS({
911
+ "node_modules/prop-types/factoryWithThrowingShims.js"(exports2, module2) {
912
+ "use strict";
913
+ var ReactPropTypesSecret = require_ReactPropTypesSecret();
914
+ function emptyFunction() {
915
+ }
916
+ function emptyFunctionWithReset() {
917
+ }
918
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
919
+ module2.exports = function() {
920
+ function shim(props, propName, componentName, location, propFullName, secret) {
921
+ if (secret === ReactPropTypesSecret) {
922
+ return;
923
+ }
924
+ var err = new Error(
925
+ "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
926
+ );
927
+ err.name = "Invariant Violation";
928
+ throw err;
929
+ }
930
+ ;
931
+ shim.isRequired = shim;
932
+ function getShim() {
933
+ return shim;
934
+ }
935
+ ;
936
+ var ReactPropTypes = {
937
+ array: shim,
938
+ bigint: shim,
939
+ bool: shim,
940
+ func: shim,
941
+ number: shim,
942
+ object: shim,
943
+ string: shim,
944
+ symbol: shim,
945
+ any: shim,
946
+ arrayOf: getShim,
947
+ element: shim,
948
+ elementType: shim,
949
+ instanceOf: getShim,
950
+ node: shim,
951
+ objectOf: getShim,
952
+ oneOf: getShim,
953
+ oneOfType: getShim,
954
+ shape: getShim,
955
+ exact: getShim,
956
+ checkPropTypes: emptyFunctionWithReset,
957
+ resetWarningCache: emptyFunction
958
+ };
959
+ ReactPropTypes.PropTypes = ReactPropTypes;
960
+ return ReactPropTypes;
961
+ };
962
+ }
963
+ });
964
+
965
+ // node_modules/prop-types/index.js
966
+ var require_prop_types = __commonJS({
967
+ "node_modules/prop-types/index.js"(exports2, module2) {
968
+ "use strict";
969
+ if (process.env.NODE_ENV !== "production") {
970
+ ReactIs = require_react_is();
971
+ throwOnDirectAccess = true;
972
+ module2.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
973
+ } else {
974
+ module2.exports = require_factoryWithThrowingShims()();
975
+ }
976
+ var ReactIs;
977
+ var throwOnDirectAccess;
978
+ }
979
+ });
980
+
981
+ // src/index.ts
982
+ var index_exports = {};
983
+ __export(index_exports, {
984
+ ChipInputCell: () => ChipInputCell,
985
+ Dropzone: () => Dropzone,
986
+ EditableColumnHeader: () => EditableColumnHeader,
987
+ FileViewer: () => FileViewer,
988
+ LayoutProvider: () => LayoutProvider,
989
+ PageHeader: () => PageHeader,
990
+ Platform: () => Platform,
991
+ RouterButton: () => RouterButton,
992
+ RouterError: () => RouterError,
993
+ RouterGridActionsCellItem: () => RouterGridActionsCellItem,
994
+ RouterIconButton: () => RouterIconButton,
995
+ RouterLink: () => RouterLink,
996
+ RouterListItemButton: () => RouterListItemButton,
997
+ RouterNotFound: () => RouterNotFound,
998
+ RouterTab: () => RouterTab,
999
+ TableContainer: () => TableContainer,
1000
+ TypographyWithIcon: () => TypographyWithIcon,
1001
+ rootRouteHead: () => rootRouteHead,
1002
+ t: () => import_i18next3.t,
1003
+ useDeleteFile: () => useDeleteFile,
1004
+ useDeleteFiles: () => useDeleteFiles,
1005
+ useDialogs: () => useDialogs,
1006
+ useDownloadFile: () => useDownloadFile,
1007
+ useFieldContext: () => useFieldContext,
1008
+ useFormContext: () => useFormContext,
1009
+ useGetFile: () => useGetFile,
1010
+ useGetFileMetas: () => useGetFileMetas,
1011
+ useGetFileThumbnail: () => useGetFileThumbnail,
1012
+ useLayoutForm: () => useLayoutForm,
1013
+ useLocalStorageState: () => import_use_local_storage_state2.default,
1014
+ useOpenFile: () => useOpenFile,
1015
+ useTranslation: () => import_react_i18next9.useTranslation,
1016
+ useUpdateFileMeta: () => useUpdateFileMeta,
1017
+ useUploadFile: () => useUploadFile,
1018
+ uuidv7: () => import_uuidv72.uuidv7,
1019
+ wczApiClient: () => wczApiClient,
1020
+ withLayoutForm: () => withLayoutForm
1021
+ });
1022
+ module.exports = __toCommonJS(index_exports);
1023
+
1024
+ // src/components/core/TypographyWithIcon.tsx
1025
+ var import_material = require("@mui/material");
1026
+ var import_jsx_runtime = require("react/jsx-runtime");
1027
+ var stackSxProps = [
1028
+ "margin",
1029
+ "marginTop",
1030
+ "marginRight",
1031
+ "marginBottom",
1032
+ "marginLeft",
1033
+ "m",
1034
+ "mt",
1035
+ "mr",
1036
+ "mb",
1037
+ "ml",
1038
+ "mx",
1039
+ "my",
1040
+ "padding",
1041
+ "paddingTop",
1042
+ "paddingRight",
1043
+ "paddingBottom",
1044
+ "paddingLeft",
1045
+ "p",
1046
+ "pt",
1047
+ "pr",
1048
+ "pb",
1049
+ "pl",
1050
+ "px",
1051
+ "py",
1052
+ "flexGrow",
1053
+ "flexShrink",
1054
+ "flexBasis",
1055
+ "flexDirection",
1056
+ "alignItems",
1057
+ "justifyContent",
1058
+ "position",
1059
+ "zIndex",
1060
+ "top",
1061
+ "right",
1062
+ "bottom",
1063
+ "left",
1064
+ "gridGap",
1065
+ "gridColumnGap",
1066
+ "gridRowGap",
1067
+ "gridColumn",
1068
+ "gridRow",
1069
+ "gridAutoFlow",
1070
+ "gap",
1071
+ "columnGap",
1072
+ "rowGap"
1073
+ ];
1074
+ var TypographyWithIcon = ({ startIcon, endIcon, children, sx, gutterBottom, ...props }) => {
1075
+ const sxCopy = { ...sx };
1076
+ const stackStyles = {};
1077
+ if (sxCopy) {
1078
+ for (const current of stackSxProps) {
1079
+ if (sxCopy[current]) {
1080
+ stackStyles[current] = sxCopy[current];
1081
+ delete sxCopy[current];
1082
+ }
1083
+ }
1084
+ }
1085
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { direction: "row", alignItems: "center", gap: 1, sx: stackStyles, mb: gutterBottom ? 0.7 : void 0, children: [
1086
+ startIcon,
1087
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { ...props, sx: sxCopy, children }),
1088
+ endIcon
1089
+ ] });
1090
+ };
1091
+
1092
+ // src/components/core/PageHeader.tsx
1093
+ var import_material2 = require("@mui/material");
1094
+ var import_jsx_runtime2 = require("react/jsx-runtime");
1095
+ var PageHeader = ({ title, action, sx }) => {
1096
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.CardHeader, { title: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Typography, { variant: "h4", fontWeight: 600, children: title }), action, sx: { px: 0, ...sx } });
1097
+ };
1098
+
1099
+ // src/components/core/TableContainer.tsx
1100
+ var import_material3 = require("@mui/material");
1101
+ var import_react = require("react");
1102
+ var import_jsx_runtime3 = require("react/jsx-runtime");
1103
+ var TableContainer = ({ children, sx, ...props }) => {
1104
+ const reference = (0, import_react.useRef)(null);
1105
+ const [height, setHeight] = (0, import_react.useState)();
1106
+ (0, import_react.useEffect)(() => {
1107
+ const element = reference.current;
1108
+ if (!element) return;
1109
+ const recompute = () => {
1110
+ if (!reference.current) return;
1111
+ const top = Math.ceil(reference.current.getBoundingClientRect().top);
1112
+ const avail = Math.max(0, window.innerHeight - top);
1113
+ setHeight(avail);
1114
+ };
1115
+ recompute();
1116
+ window.addEventListener("resize", recompute);
1117
+ const ro = new ResizeObserver(recompute);
1118
+ ro.observe(document.documentElement);
1119
+ ro.observe(document.body);
1120
+ ro.observe(element);
1121
+ return () => {
1122
+ window.removeEventListener("resize", recompute);
1123
+ ro.disconnect();
1124
+ };
1125
+ }, []);
1126
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1127
+ import_material3.Box,
1128
+ {
1129
+ ref: reference,
1130
+ sx: {
1131
+ display: "flex",
1132
+ flexDirection: "column",
1133
+ minHeight: 0,
1134
+ width: "100%",
1135
+ ...sx
1136
+ },
1137
+ height,
1138
+ ...props,
1139
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Box, { sx: (theme) => ({
1140
+ flex: 1,
1141
+ minHeight: 0,
1142
+ height: "100%",
1143
+ "& .MuiDataGrid-cell--editing": {
1144
+ "& .MuiInputBase-root": {
1145
+ height: "100%"
1146
+ }
1147
+ },
1148
+ "& .MuiDataGrid-columnHeaderTitle": {
1149
+ fontWeight: 600
1150
+ },
1151
+ "& .Mui-error": {
1152
+ backgroundColor: theme.palette.error.main,
1153
+ color: theme.palette.error.contrastText
1154
+ },
1155
+ "& .MuiDataGrid-booleanCell[data-value='true']": {
1156
+ color: `${theme.palette.success.main} !important`
1157
+ },
1158
+ "& .MuiDataGrid-booleanCell[data-value='false']": {
1159
+ color: `${theme.palette.error.main} !important`
1160
+ }
1161
+ }), children })
1162
+ }
1163
+ );
1164
+ };
1165
+
1166
+ // src/components/file/Dropzone.tsx
1167
+ var import_CloudUpload = __toESM(require("@mui/icons-material/CloudUpload"), 1);
1168
+ var import_material4 = require("@mui/material");
1169
+ var import_react_dropzone = require("react-dropzone");
1170
+ var import_react_i18next = require("react-i18next");
1171
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1172
+ var baseStyle = {
1173
+ flex: 1,
1174
+ display: "flex",
1175
+ flexDirection: "column",
1176
+ alignItems: "center",
1177
+ padding: "20px",
1178
+ borderWidth: 2,
1179
+ borderRadius: 2,
1180
+ borderStyle: "dashed",
1181
+ outline: "none",
1182
+ transition: "border .24s ease-in-out",
1183
+ cursor: "pointer"
1184
+ };
1185
+ var Dropzone = ({ sx, ...props }) => {
1186
+ const { getRootProps, getInputProps, isFocused, isDragAccept, isDragReject } = (0, import_react_dropzone.useDropzone)(props);
1187
+ const { t: t2 } = (0, import_react_i18next.useTranslation)();
1188
+ const theme = (0, import_material4.useTheme)();
1189
+ const style = {
1190
+ ...baseStyle,
1191
+ ...isFocused ? { borderColor: theme.palette.primary.main } : {},
1192
+ ...isDragAccept ? { borderColor: theme.palette.success.main } : {},
1193
+ ...isDragReject ? { borderColor: theme.palette.error.main } : {}
1194
+ };
1195
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_material4.Paper, { variant: "outlined", ...getRootProps({ style }), sx, children: [
1196
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("input", { ...getInputProps(), style: { display: "none" } }),
1197
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_CloudUpload.default, {}),
1198
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.Typography, { children: t2("Layout.File.DragSomeFilesHereOrClickToSelectThem") })
1199
+ ] });
1200
+ };
1201
+
1202
+ // src/components/file/FileViewer.tsx
1203
+ var import_react9 = require("react");
1204
+
1205
+ // src/contexts/FileContext.ts
1206
+ var import_react2 = require("react");
1207
+ var FileContext = (0, import_react2.createContext)(null);
1208
+ var useFile = () => {
1209
+ const context = (0, import_react2.useContext)(FileContext);
1210
+ if (!context) {
1211
+ throw new Error("FileViewer components must be used within FileViewer");
1212
+ }
1213
+ return context;
1214
+ };
1215
+
1216
+ // src/hooks/FileHooks.ts
1217
+ var import_react_query = require("@tanstack/react-query");
1218
+ var import_file_saver = __toESM(require("file-saver"), 1);
1219
+ var import_react3 = require("react");
1220
+ var import_tus_js_client = require("tus-js-client");
1221
+ var import_uuidv7 = require("uuidv7");
1222
+
1223
+ // src/components/core/AppTitle.tsx
1224
+ var import_material5 = require("@mui/material");
1225
+ var import_react_router = require("@tanstack/react-router");
1226
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1227
+ var import_meta = {};
1228
+ var AppTitle = () => {
1229
+ const title = useAppTitle();
1230
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material5.Stack, { direction: "row", alignItems: "center", spacing: 2, flexGrow: 1, children: [
1231
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("img", { src: "/favicon-32x32.png", alt: "app-logo", loading: "lazy" }),
1232
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.Typography, { variant: "h6", children: title }),
1233
+ import_meta.env.DEV && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.Chip, { size: "small", label: "TEST", color: "info" })
1234
+ ] });
1235
+ };
1236
+ var useAppTitle = () => {
1237
+ const rootRouterState = (0, import_react_router.useRouterState)({ select: (s) => s.matches[0] });
1238
+ return rootRouterState.meta?.find((meta) => meta?.title)?.title;
1239
+ };
1240
+
1241
+ // src/utils/ClientUtils.ts
1242
+ var import_axios = __toESM(require("axios"), 1);
1243
+ var Platform = class {
1244
+ static get isAndroid() {
1245
+ return /android/i.test(this.userAgent);
1246
+ }
1247
+ static get isIOS() {
1248
+ return /iPad|iPhone|iPod/.test(this.userAgent);
1249
+ }
1250
+ static get isWindows() {
1251
+ return /windows/i.test(this.userAgent);
1252
+ }
1253
+ static get isMacOS() {
1254
+ return /Macintosh|MacIntel|MacPPC|Mac68K/.test(this.userAgent);
1255
+ }
1256
+ static get userAgent() {
1257
+ return typeof navigator === "undefined" ? "" : navigator.userAgent;
1258
+ }
1259
+ };
1260
+ var rootRouteHead = ({ title }) => () => ({
1261
+ meta: [
1262
+ { charSet: "utf-8" },
1263
+ { name: "viewport", content: "width=device-width, initial-scale=1" },
1264
+ { title },
1265
+ { name: "og:type", content: "website" },
1266
+ { name: "og:title", content: title },
1267
+ { name: "og:image", content: "/favicon-32x32.png" }
1268
+ ],
1269
+ links: [
1270
+ { rel: "apple-touch-icon", sizes: "180x180", href: "/apple-touch-icon.png" },
1271
+ { rel: "icon", type: "image/png", sizes: "32x32", href: "/favicon-32x32.png" },
1272
+ { rel: "icon", type: "image/png", sizes: "16x16", href: "/favicon-16x16.png" },
1273
+ { rel: "manifest", href: "/site.webmanifest" },
1274
+ { rel: "icon", href: "/favicon.ico" }
1275
+ ]
1276
+ });
1277
+ var wczApiClient = import_axios.default.create();
1278
+
1279
+ // src/hooks/FileHooks.ts
1280
+ var import_meta2 = {};
1281
+ var BASE_URL = import_meta2.env.VITE_FILE_API_BASE_URL;
1282
+ var QUERY_KEY = "Files";
1283
+ var HOUR = 1e3 * 60 * 60;
1284
+ var useGetFileMetas = (subId, options) => {
1285
+ const appTitle = useAppTitle();
1286
+ return (0, import_react_query.useQuery)({
1287
+ ...options,
1288
+ queryKey: [QUERY_KEY, "meta", subId, appTitle],
1289
+ queryFn: ({ signal }) => wczApiClient.request({
1290
+ url: `${BASE_URL}/v1/meta?appName=${appTitle}&subId=${subId}`,
1291
+ method: "GET",
1292
+ signal
1293
+ }),
1294
+ staleTime: HOUR,
1295
+ gcTime: HOUR,
1296
+ refetchOnWindowFocus: false
1297
+ });
1298
+ };
1299
+ var useGetFileThumbnail = (meta, options) => {
1300
+ const appTitle = useAppTitle();
1301
+ return (0, import_react_query.useQuery)({
1302
+ ...options,
1303
+ queryKey: [QUERY_KEY, "thumbnail", meta?.id, appTitle],
1304
+ queryFn: ({ signal }) => wczApiClient.request({
1305
+ url: `${BASE_URL}/v1/thumbnail?appName=${appTitle}&id=${meta?.id}`,
1306
+ method: "GET",
1307
+ signal,
1308
+ responseType: "blob"
1309
+ }),
1310
+ select: (data) => URL.createObjectURL(data),
1311
+ staleTime: HOUR,
1312
+ gcTime: HOUR,
1313
+ refetchOnWindowFocus: false,
1314
+ enabled: !!meta?.id && options?.enabled
1315
+ });
1316
+ };
1317
+ var useGetFile = (meta, options) => {
1318
+ const appTitle = useAppTitle();
1319
+ return (0, import_react_query.useQuery)({
1320
+ ...options,
1321
+ queryKey: [QUERY_KEY, meta?.id, appTitle],
1322
+ queryFn: ({ signal }) => wczApiClient.request({
1323
+ url: `${BASE_URL}/v1?appName=${appTitle}&id=${meta?.id}`,
1324
+ method: "GET",
1325
+ signal,
1326
+ responseType: "blob"
1327
+ }),
1328
+ select: (data) => URL.createObjectURL(data),
1329
+ staleTime: HOUR,
1330
+ gcTime: HOUR,
1331
+ refetchOnWindowFocus: false,
1332
+ enabled: !!meta?.id && options?.enabled
1333
+ });
1334
+ };
1335
+ var useDownloadFile = (options) => {
1336
+ const appTitle = useAppTitle();
1337
+ return (0, import_react_query.useMutation)({
1338
+ ...options,
1339
+ mutationFn: (meta) => wczApiClient.request({
1340
+ url: `${BASE_URL}/v1/download?appName=${appTitle}&id=${meta.id}`,
1341
+ method: "GET",
1342
+ responseType: "blob"
1343
+ }),
1344
+ onSuccess: (data, variables) => (0, import_file_saver.default)(data, `${variables.fileName}.${variables.fileExtension}`)
1345
+ });
1346
+ };
1347
+ var useOpenFile = (options) => {
1348
+ const appTitle = useAppTitle();
1349
+ return (0, import_react_query.useMutation)({
1350
+ ...options,
1351
+ mutationFn: (meta) => wczApiClient.request({
1352
+ url: `${BASE_URL}/v1?appName=${appTitle}&id=${meta.id}`,
1353
+ method: "GET",
1354
+ responseType: "blob"
1355
+ }),
1356
+ onSuccess: (data) => {
1357
+ window.open(URL.createObjectURL(data));
1358
+ }
1359
+ });
1360
+ };
1361
+ var useUpdateFileMeta = (options) => {
1362
+ const appTitle = useAppTitle();
1363
+ const queryClient = (0, import_react_query.useQueryClient)();
1364
+ return (0, import_react_query.useMutation)({
1365
+ ...options,
1366
+ mutationFn: (meta) => wczApiClient.request({
1367
+ url: `${BASE_URL}/v1/meta?appName=${appTitle}&id=${meta.id}`,
1368
+ method: "PUT",
1369
+ data: meta
1370
+ }),
1371
+ onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, "meta"], exact: false })
1372
+ });
1373
+ };
1374
+ var useDeleteFile = (options) => {
1375
+ const appTitle = useAppTitle();
1376
+ const queryClient = (0, import_react_query.useQueryClient)();
1377
+ return (0, import_react_query.useMutation)({
1378
+ ...options,
1379
+ mutationFn: (meta) => wczApiClient.request({
1380
+ url: `${BASE_URL}/v1?appName=${appTitle}&id=${meta.id}`,
1381
+ method: "DELETE"
1382
+ }),
1383
+ onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, "meta"], exact: false })
1384
+ });
1385
+ };
1386
+ var useDeleteFiles = (options) => {
1387
+ const appTitle = useAppTitle();
1388
+ const queryClient = (0, import_react_query.useQueryClient)();
1389
+ return (0, import_react_query.useMutation)({
1390
+ ...options,
1391
+ mutationFn: (subId) => wczApiClient.request({
1392
+ url: `${BASE_URL}/v1?appName=${appTitle}&subId=${subId}`,
1393
+ method: "DELETE"
1394
+ }),
1395
+ onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, "meta"], exact: false })
1396
+ });
1397
+ };
1398
+ var useUploadFile = ({ subId, onSuccess, onError }) => {
1399
+ const appTitle = useAppTitle();
1400
+ const [progress, setProgress] = (0, import_react3.useState)(0);
1401
+ const queryClient = (0, import_react_query.useQueryClient)();
1402
+ const mutate = async (file) => {
1403
+ if (!subId) throw new Error("subId is required for file upload");
1404
+ if (!appTitle) throw new Error("appTitle is required for file upload");
1405
+ const metadata = {
1406
+ id: (0, import_uuidv7.uuidv7)(),
1407
+ appName: appTitle,
1408
+ subId,
1409
+ fileName: file.name
1410
+ };
1411
+ const upload = new import_tus_js_client.Upload(file, {
1412
+ endpoint: `${BASE_URL}/v1/upload`,
1413
+ chunkSize: 1048576,
1414
+ // 1 MB
1415
+ metadata: {
1416
+ id: metadata.id,
1417
+ appName: metadata.appName,
1418
+ subId: metadata.subId,
1419
+ fileName: metadata.fileName,
1420
+ fileExtension: file.type
1421
+ },
1422
+ //headers: { "Authorization": `Bearer ${await getToken()}` }, //TODO: implement token retrieval
1423
+ onError: (error) => {
1424
+ setProgress(0);
1425
+ onError?.(error);
1426
+ },
1427
+ onProgress: (bytesUploaded, bytesTotal) => {
1428
+ setProgress(bytesUploaded / bytesTotal * 100);
1429
+ },
1430
+ onSuccess: () => {
1431
+ setProgress(0);
1432
+ queryClient.invalidateQueries({ queryKey: [QUERY_KEY, "meta", subId, appTitle], exact: false });
1433
+ onSuccess?.(metadata);
1434
+ }
1435
+ });
1436
+ const previousUploads = await upload.findPreviousUploads();
1437
+ if (previousUploads.length > 0) {
1438
+ upload.resumeFromPreviousUpload(previousUploads[0]);
1439
+ }
1440
+ upload.start();
1441
+ };
1442
+ return { mutate, progress };
1443
+ };
1444
+
1445
+ // src/components/file/fileViewer/FileViewerGrid.tsx
1446
+ var import_MoreVert = __toESM(require("@mui/icons-material/MoreVert"), 1);
1447
+ var import_material7 = require("@mui/material");
1448
+ var import_colors = require("@mui/material/colors");
1449
+ var import_react6 = require("react");
1450
+
1451
+ // src/components/file/fileViewer/common/ActionsMenu.tsx
1452
+ var import_Delete = __toESM(require("@mui/icons-material/Delete"), 1);
1453
+ var import_FileDownload = __toESM(require("@mui/icons-material/FileDownload"), 1);
1454
+ var import_material6 = require("@mui/material");
1455
+ var import_react_i18next3 = require("react-i18next");
1456
+
1457
+ // src/hooks/DialogsHooks.tsx
1458
+ var import_Button = __toESM(require("@mui/material/Button"), 1);
1459
+ var import_Dialog = __toESM(require("@mui/material/Dialog"), 1);
1460
+ var import_DialogActions = __toESM(require("@mui/material/DialogActions"), 1);
1461
+ var import_DialogContent = __toESM(require("@mui/material/DialogContent"), 1);
1462
+ var import_DialogTitle = __toESM(require("@mui/material/DialogTitle"), 1);
1463
+
1464
+ // node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
1465
+ var React2 = __toESM(require("react"), 1);
1466
+
1467
+ // node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js
1468
+ var React = __toESM(require("react"), 1);
1469
+ var useEnhancedEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
1470
+ var useEnhancedEffect_default = useEnhancedEffect;
1471
+
1472
+ // node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
1473
+ function useEventCallback(fn) {
1474
+ const ref = React2.useRef(fn);
1475
+ useEnhancedEffect_default(() => {
1476
+ ref.current = fn;
1477
+ });
1478
+ return React2.useRef((...args) => (
1479
+ // @ts-expect-error hide `this`
1480
+ (0, ref.current)(...args)
1481
+ )).current;
1482
+ }
1483
+ var useEventCallback_default = useEventCallback;
1484
+
1485
+ // src/hooks/DialogsHooks.tsx
1486
+ var import_react5 = require("react");
1487
+ var import_react_i18next2 = require("react-i18next");
1488
+
1489
+ // src/contexts/DialogsContext.ts
1490
+ var import_react4 = require("react");
1491
+ var DialogsContext = (0, import_react4.createContext)({});
1492
+
1493
+ // src/hooks/DialogsHooks.tsx
1494
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1495
+ function AlertDialog({ open, payload, onClose }) {
1496
+ const { t: t2 } = (0, import_react_i18next2.useTranslation)();
1497
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Dialog.default, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(), children: [
1498
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogTitle.default, { children: payload.title ?? t2("Layout.Dialog.Alert") }),
1499
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogContent.default, { children: payload.message }),
1500
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogActions.default, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Button.default, { disabled: !open, onClick: () => onClose(), children: t2("Layout.Dialog.Confirm") }) })
1501
+ ] });
1502
+ }
1503
+ function ConfirmDialog({ open, payload, onClose }) {
1504
+ const { t: t2 } = (0, import_react_i18next2.useTranslation)();
1505
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_Dialog.default, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(false), children: [
1506
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogTitle.default, { children: payload.title ?? t2("Layout.Dialog.Confirm") }),
1507
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_DialogContent.default, { children: payload.message }),
1508
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_DialogActions.default, { children: [
1509
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Button.default, { autoFocus: true, disabled: !open, onClick: () => onClose(false), children: payload.cancelText ?? t2("Layout.Dialog.Cancel") }),
1510
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Button.default, { disabled: !open, onClick: () => onClose(true), children: t2("Layout.Dialog.Confirm") })
1511
+ ] })
1512
+ ] });
1513
+ }
1514
+ function useDialogs() {
1515
+ const { open, close } = (0, import_react5.useContext)(DialogsContext);
1516
+ const alert = useEventCallback_default(
1517
+ (message, { ...options } = {}) => open(AlertDialog, { ...options, message })
1518
+ );
1519
+ const confirm = useEventCallback_default(
1520
+ (message, { ...options } = {}) => open(ConfirmDialog, { ...options, message })
1521
+ );
1522
+ return (0, import_react5.useMemo)(() => ({ alert, confirm, open, close }), [alert, close, confirm, open]);
1523
+ }
1524
+
1525
+ // src/components/file/fileViewer/common/ActionsMenu.tsx
1526
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1527
+ var ActionsMenu = ({ meta, menu, setMenu }) => {
1528
+ const { t: t2 } = (0, import_react_i18next3.useTranslation)();
1529
+ const { fileMetas, onDelete, actions } = useFile();
1530
+ const { confirm } = useDialogs();
1531
+ const handleMenuClose = () => {
1532
+ setMenu(null);
1533
+ };
1534
+ const { mutate: download, isPending: isDownloading } = useDownloadFile();
1535
+ const { mutate: deleteFile, isPending: isDeleting } = useDeleteFile();
1536
+ const handleOnDownload = () => {
1537
+ handleMenuClose();
1538
+ download(meta);
1539
+ };
1540
+ const handleOnDelete = async () => {
1541
+ if (!await confirm(t2("Layout.File.AreYouSureYouWantToDelete", { fileName: meta.fileName })))
1542
+ return;
1543
+ deleteFile(meta);
1544
+ handleMenuClose();
1545
+ if (onDelete) {
1546
+ const remainingFileMetas = fileMetas.filter((m) => m.id !== meta.id);
1547
+ onDelete({ remainingFileMetas, deletedFileMeta: meta });
1548
+ }
1549
+ };
1550
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1551
+ import_material6.Menu,
1552
+ {
1553
+ open: menu !== null,
1554
+ onClose: handleMenuClose,
1555
+ anchorReference: "anchorPosition",
1556
+ variant: "menu",
1557
+ anchorPosition: menu === null ? void 0 : { top: menu.mouseY, left: menu.mouseX },
1558
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material6.List, { disablePadding: true, children: [
1559
+ actions?.download !== false && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material6.ListItemButton, { onClick: handleOnDownload, disabled: isDownloading, children: [
1560
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material6.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_FileDownload.default, {}) }),
1561
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material6.ListItemText, { children: t2("Layout.File.Download") })
1562
+ ] }),
1563
+ actions?.delete !== false && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material6.ListItemButton, { onClick: handleOnDelete, disabled: isDeleting, children: [
1564
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material6.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Delete.default, {}) }),
1565
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material6.ListItemText, { children: t2("Layout.File.Delete") })
1566
+ ] })
1567
+ ] })
1568
+ }
1569
+ );
1570
+ };
1571
+
1572
+ // src/components/file/fileViewer/FileViewerGrid.tsx
1573
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1574
+ var IMAGE_SIZE = 150;
1575
+ var FileViewerGrid = ({ sx, size, itemBar }) => {
1576
+ const { fileMetas } = useFile();
1577
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material7.Stack, { direction: "row", spacing: 1, sx: { overflow: "auto", ...sx }, children: fileMetas.map((fileMeta) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1578
+ GridFileViewerItem,
1579
+ {
1580
+ meta: fileMeta,
1581
+ size,
1582
+ itemBar
1583
+ },
1584
+ fileMeta.id
1585
+ )) });
1586
+ };
1587
+ var GridFileViewerItem = ({ meta, size, itemBar }) => {
1588
+ const { setImageId, actions } = useFile();
1589
+ const [showItemBar, setShowItemBar] = (0, import_react6.useState)(itemBar === "always");
1590
+ const [menu, setMenu] = (0, import_react6.useState)(null);
1591
+ (0, import_react6.useEffect)(() => {
1592
+ setShowItemBar(itemBar === "always");
1593
+ }, [itemBar]);
1594
+ const { data: source } = useGetFileThumbnail(meta);
1595
+ const handleOnMouseEnter = () => setShowItemBar(true);
1596
+ const handleOnMouseLeave = () => itemBar !== "always" && setShowItemBar(false);
1597
+ const openMenu = (event) => {
1598
+ setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY } : null);
1599
+ setTimeout(() => setShowItemBar(true));
1600
+ };
1601
+ const { mutate: openFile } = useOpenFile();
1602
+ const { mutate: download } = useDownloadFile();
1603
+ const onClick = () => {
1604
+ switch (meta.mediaType) {
1605
+ case "image": {
1606
+ return setImageId(meta.id);
1607
+ }
1608
+ case "application": {
1609
+ return openFile(meta);
1610
+ }
1611
+ case "video": {
1612
+ return openFile(meta);
1613
+ }
1614
+ default: {
1615
+ return download(meta);
1616
+ }
1617
+ }
1618
+ };
1619
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react6.Fragment, { children: [
1620
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material7.ImageListItem, { sx: { width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }, onMouseEnter: handleOnMouseEnter, onMouseLeave: handleOnMouseLeave, children: [
1621
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1622
+ import_material7.Box,
1623
+ {
1624
+ component: "img",
1625
+ src: source,
1626
+ loading: "lazy",
1627
+ alt: "thumbnail-" + meta.id,
1628
+ onClick,
1629
+ sx: { cursor: "pointer", objectFit: "contain", width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }
1630
+ }
1631
+ ),
1632
+ itemBar !== "hidden" && showItemBar && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1633
+ import_material7.ImageListItemBar,
1634
+ {
1635
+ title: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material7.Tooltip, { title: meta.fileName, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material7.Box, { children: meta.fileName }) }),
1636
+ actionIcon: (actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material7.IconButton, { sx: { color: import_colors.grey[100] }, onClick: openMenu, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_MoreVert.default, {}) })
1637
+ }
1638
+ )
1639
+ ] }),
1640
+ (actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ActionsMenu, { meta, menu, setMenu })
1641
+ ] });
1642
+ };
1643
+
1644
+ // src/components/file/fileViewer/FileViewerList.tsx
1645
+ var import_AttachFile = __toESM(require("@mui/icons-material/AttachFile"), 1);
1646
+ var import_Image = __toESM(require("@mui/icons-material/Image"), 1);
1647
+ var import_MoreVert2 = __toESM(require("@mui/icons-material/MoreVert"), 1);
1648
+ var import_SmartDisplay = __toESM(require("@mui/icons-material/SmartDisplay"), 1);
1649
+ var import_material8 = require("@mui/material");
1650
+ var import_react7 = require("react");
1651
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1652
+ var FileViewerList = ({ sx }) => {
1653
+ const { fileMetas } = useFile();
1654
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.List, { dense: true, sx, children: fileMetas.map(
1655
+ (fileMeta) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1656
+ ListFileViewerItem,
1657
+ {
1658
+ meta: fileMeta
1659
+ },
1660
+ fileMeta.id
1661
+ )
1662
+ ) });
1663
+ };
1664
+ var ListFileViewerItem = ({ meta }) => {
1665
+ const { setImageId, actions } = useFile();
1666
+ const [menu, setMenu] = (0, import_react7.useState)(null);
1667
+ const openMenu = (event) => {
1668
+ event.stopPropagation();
1669
+ setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY } : null);
1670
+ };
1671
+ const { mutate: openFile } = useOpenFile();
1672
+ const { mutate: download } = useDownloadFile();
1673
+ const onClick = () => {
1674
+ switch (meta.mediaType) {
1675
+ case "image": {
1676
+ return setImageId(meta.id);
1677
+ }
1678
+ case "application": {
1679
+ return openFile(meta);
1680
+ }
1681
+ case "video": {
1682
+ return openFile(meta);
1683
+ }
1684
+ default: {
1685
+ return download(meta);
1686
+ }
1687
+ }
1688
+ };
1689
+ const icon = () => {
1690
+ switch (meta.mediaType) {
1691
+ case "image": {
1692
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_Image.default, {});
1693
+ }
1694
+ case "video": {
1695
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_SmartDisplay.default, {});
1696
+ }
1697
+ default: {
1698
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_AttachFile.default, {});
1699
+ }
1700
+ }
1701
+ };
1702
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react7.Fragment, { children: [
1703
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_material8.ListItemButton, { onClick, children: [
1704
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.ListItemIcon, { children: icon() }),
1705
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.ListItemText, { primary: `${meta.fileName}.${meta.fileExtension}` }),
1706
+ (actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.IconButton, { edge: "end", onClick: openMenu, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_MoreVert2.default, {}) })
1707
+ ] }, meta.id),
1708
+ (actions?.download !== false || actions?.delete !== false) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ActionsMenu, { meta, menu, setMenu })
1709
+ ] });
1710
+ };
1711
+
1712
+ // src/components/file/fileViewer/ImageViewer.tsx
1713
+ var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
1714
+ var import_material9 = require("@mui/material");
1715
+ var import_react8 = require("react");
1716
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1717
+ var ImageViewer = ({ metaId }) => {
1718
+ const { fileMetas, setImageId } = useFile();
1719
+ const meta = fileMetas.find((m) => m.id === metaId);
1720
+ const { data: source } = useGetFile(meta);
1721
+ (0, import_react8.useEffect)(() => {
1722
+ if (globalThis.window !== void 0 && metaId)
1723
+ globalThis.addEventListener("keydown", handleOnKeydown);
1724
+ return () => {
1725
+ globalThis.removeEventListener("keydown", handleOnKeydown);
1726
+ };
1727
+ }, [metaId]);
1728
+ const handleOnKeydown = (event) => {
1729
+ const images = fileMetas.filter((m) => m.mediaType === "image");
1730
+ const imageIndex = images.findIndex((m) => m.id === metaId);
1731
+ switch (event.key) {
1732
+ case "ArrowLeft": {
1733
+ return handleOnArrowLeft(images, imageIndex);
1734
+ }
1735
+ case "ArrowRight": {
1736
+ return handleOnArrowRight(images, imageIndex);
1737
+ }
1738
+ case "Backspace":
1739
+ case "Escape": {
1740
+ event.preventDefault();
1741
+ return onClose();
1742
+ }
1743
+ }
1744
+ };
1745
+ const handleOnArrowLeft = (images, index) => {
1746
+ if (index > 0) {
1747
+ const previousFile = images[index - 1];
1748
+ setImageId(previousFile.id);
1749
+ }
1750
+ };
1751
+ const handleOnArrowRight = (images, index) => {
1752
+ if (index < images.length - 1) {
1753
+ const nextFile = images[index + 1];
1754
+ setImageId(nextFile.id);
1755
+ }
1756
+ };
1757
+ const onClose = () => setImageId("");
1758
+ if (!metaId) return null;
1759
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_material9.Dialog, { open: true, onClose, maxWidth: "xl", children: [
1760
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Box, { component: "img", src: source, alt: metaId, sx: { maxWidth: "100vw", maxHeight: { xs: "calc(100vh - 56px)", sm: "calc(100vh - 64px)" } } }),
1761
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Fab, { size: "medium", onClick: onClose, sx: { position: "fixed", top: 8, right: 8 }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_Close.default, {}) })
1762
+ ] });
1763
+ };
1764
+
1765
+ // src/components/file/FileViewer.tsx
1766
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1767
+ var FileViewer = ({ subId, onDelete, actions, children }) => {
1768
+ const { data: fileMetas = [] } = useGetFileMetas(subId, { enabled: !!subId });
1769
+ const [imageId, setImageId] = (0, import_react9.useState)("");
1770
+ const components = { Grid: FileViewerGrid, List: FileViewerList };
1771
+ if (fileMetas.length === 0) return null;
1772
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(FileContext.Provider, { value: { fileMetas, onDelete, actions, setImageId }, children: [
1773
+ children(components),
1774
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ImageViewer, { metaId: imageId })
1775
+ ] });
1776
+ };
1777
+
1778
+ // src/components/data-grid/ChipInputCell.tsx
1779
+ var import_material10 = require("@mui/material");
1780
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1781
+ var isArray = (value) => Array.isArray(value);
1782
+ var ChipInputCell = ({ params, slotProps, getLabel }) => {
1783
+ if (!params.value) return null;
1784
+ const getLabelValue = (value) => {
1785
+ if (getLabel) return getLabel(value);
1786
+ return value;
1787
+ };
1788
+ if (isArray(params.value))
1789
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material10.Stack, { direction: "row", alignItems: "center", gap: 1, sx: { overflowX: "auto", height: "100%", width: params.colDef.computedWidth }, children: params.value.map(
1790
+ (value, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material10.Chip, { label: getLabelValue(value), ...slotProps }, `${index + 1}-chip-input-cell`)
1791
+ ) });
1792
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material10.Chip, { label: getLabelValue(params.value), ...slotProps });
1793
+ };
1794
+
1795
+ // src/components/data-grid/EditableColumnHeader.tsx
1796
+ var import_Edit = __toESM(require("@mui/icons-material/Edit"), 1);
1797
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1798
+ var EditableColumnHeader = ({ colDef }) => {
1799
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TypographyWithIcon, { endIcon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_Edit.default, { color: "disabled", fontSize: "small" }), variant: "body2", className: "MuiDataGrid-columnHeaderTitle", children: colDef.headerName });
1800
+ };
1801
+
1802
+ // src/components/router/RouterButton.tsx
1803
+ var import_material11 = require("@mui/material");
1804
+ var import_react_router2 = require("@tanstack/react-router");
1805
+ var import_react10 = __toESM(require("react"), 1);
1806
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1807
+ var Component = import_react10.default.forwardRef(function ButtonComponent(props, reference) {
1808
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material11.Button, { ref: reference, component: "a", ...props });
1809
+ });
1810
+ var CreatedComponent = (0, import_react_router2.createLink)(Component);
1811
+ var RouterButton = (props) => {
1812
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CreatedComponent, { ...props });
1813
+ };
1814
+
1815
+ // src/components/router/RouterGridActionsCellItem.tsx
1816
+ var import_x_data_grid_premium = require("@mui/x-data-grid-premium");
1817
+ var import_react_router3 = require("@tanstack/react-router");
1818
+ var import_react11 = __toESM(require("react"), 1);
1819
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1820
+ var Component2 = import_react11.default.forwardRef(
1821
+ function GridActionsCellItemComponent(props, reference) {
1822
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_x_data_grid_premium.GridActionsCellItem, { ref: reference, component: "a", ...props });
1823
+ }
1824
+ );
1825
+ var CreatedComponent2 = (0, import_react_router3.createLink)(Component2);
1826
+ var RouterGridActionsCellItem = (props) => {
1827
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CreatedComponent2, { ...props });
1828
+ };
1829
+
1830
+ // src/components/router/RouterIconButton.tsx
1831
+ var import_material12 = require("@mui/material");
1832
+ var import_react_router4 = require("@tanstack/react-router");
1833
+ var import_react12 = __toESM(require("react"), 1);
1834
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1835
+ var Component3 = import_react12.default.forwardRef(function IconButtonComponent(props, reference) {
1836
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_material12.IconButton, { ref: reference, component: "a", ...props });
1837
+ });
1838
+ var CreatedComponent3 = (0, import_react_router4.createLink)(Component3);
1839
+ var RouterIconButton = (props) => {
1840
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CreatedComponent3, { ...props });
1841
+ };
1842
+
1843
+ // src/components/router/RouterLink.tsx
1844
+ var import_material13 = require("@mui/material");
1845
+ var import_react_router5 = require("@tanstack/react-router");
1846
+ var import_react13 = __toESM(require("react"), 1);
1847
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1848
+ var Component4 = import_react13.default.forwardRef(function LinkComponent(props, reference) {
1849
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_material13.Link, { ref: reference, ...props });
1850
+ });
1851
+ var CreatedComponent4 = (0, import_react_router5.createLink)(Component4);
1852
+ var RouterLink = (props) => {
1853
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CreatedComponent4, { ...props });
1854
+ };
1855
+
1856
+ // src/components/router/RouterTab.tsx
1857
+ var import_material14 = require("@mui/material");
1858
+ var import_react_router6 = require("@tanstack/react-router");
1859
+ var import_react14 = __toESM(require("react"), 1);
1860
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1861
+ var Component5 = import_react14.default.forwardRef(function TabComponent(props, reference) {
1862
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_material14.Tab, { ref: reference, component: "a", ...props });
1863
+ });
1864
+ var CreatedComponent5 = (0, import_react_router6.createLink)(Component5);
1865
+ var RouterTab = (props) => {
1866
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CreatedComponent5, { ...props });
1867
+ };
1868
+
1869
+ // src/components/router/RouterListItemButton.tsx
1870
+ var import_material15 = require("@mui/material");
1871
+ var import_react_router7 = require("@tanstack/react-router");
1872
+ var import_react15 = __toESM(require("react"), 1);
1873
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1874
+ var Component6 = import_react15.default.forwardRef(function ButtonComponent2(props, reference) {
1875
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_material15.ListItemButton, { ref: reference, component: "a", ...props });
1876
+ });
1877
+ var CreatedComponent6 = (0, import_react_router7.createLink)(Component6);
1878
+ var RouterListItemButton = (props) => {
1879
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CreatedComponent6, { ...props });
1880
+ };
1881
+
1882
+ // src/components/router/RouterNotFound.tsx
1883
+ var import_material16 = require("@mui/material");
1884
+ var import_react_i18next4 = require("react-i18next");
1885
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1886
+ function RouterNotFound() {
1887
+ const { t: t2 } = (0, import_react_i18next4.useTranslation)();
1888
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.Box, { height: "100vh", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", textAlign: "center", px: 2, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material16.Box, { display: "flex", alignItems: "center", mb: 4, children: [
1889
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.Typography, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: "404" }),
1890
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.Divider, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
1891
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.Typography, { variant: "h5", component: "span", children: t2("Layout.ThisPageCouldNotBeFound") })
1892
+ ] }) });
1893
+ }
1894
+
1895
+ // src/components/router/RouterError.tsx
1896
+ var import_material17 = require("@mui/material");
1897
+ var import_jsx_runtime21 = require("react/jsx-runtime");
1898
+ var RouterError = ({ error }) => {
1899
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.Box, { height: "100vh", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", textAlign: "center", px: 2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material17.Box, { display: "flex", alignItems: "center", mb: 4, children: [
1900
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.Typography, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: error.name || "500" }),
1901
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.Divider, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
1902
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.Typography, { variant: "h5", component: "span", children: error.message })
1903
+ ] }) });
1904
+ };
1905
+
1906
+ // node_modules/@babel/runtime/helpers/esm/extends.js
1907
+ function _extends() {
1908
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
1909
+ for (var e = 1; e < arguments.length; e++) {
1910
+ var t2 = arguments[e];
1911
+ for (var r in t2) ({}).hasOwnProperty.call(t2, r) && (n[r] = t2[r]);
1912
+ }
1913
+ return n;
1914
+ }, _extends.apply(null, arguments);
1915
+ }
1916
+
1917
+ // node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
1918
+ function _objectWithoutPropertiesLoose(r, e) {
1919
+ if (null == r) return {};
1920
+ var t2 = {};
1921
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
1922
+ if (-1 !== e.indexOf(n)) continue;
1923
+ t2[n] = r[n];
1924
+ }
1925
+ return t2;
1926
+ }
1927
+
1928
+ // node_modules/@mui/x-date-pickers/esm/LocalizationProvider/LocalizationProvider.js
1929
+ var React11 = __toESM(require("react"), 1);
1930
+ var import_prop_types = __toESM(require_prop_types(), 1);
1931
+ var import_styles = require("@mui/material/styles");
1932
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1933
+ var _excluded = ["localeText"];
1934
+ var PickerAdapterContext = /* @__PURE__ */ React11.createContext(null);
1935
+ if (process.env.NODE_ENV !== "production") PickerAdapterContext.displayName = "PickerAdapterContext";
1936
+ var LocalizationProvider = function LocalizationProvider2(inProps) {
1937
+ const {
1938
+ localeText: inLocaleText
1939
+ } = inProps, otherInProps = _objectWithoutPropertiesLoose(inProps, _excluded);
1940
+ const {
1941
+ adapter: parentAdapter,
1942
+ localeText: parentLocaleText
1943
+ } = React11.useContext(PickerAdapterContext) ?? {
1944
+ utils: void 0,
1945
+ adapter: void 0,
1946
+ localeText: void 0
1947
+ };
1948
+ const props = (0, import_styles.useThemeProps)({
1949
+ // We don't want to pass the `localeText` prop to the theme, that way it will always return the theme value,
1950
+ // We will then merge this theme value with our value manually
1951
+ props: otherInProps,
1952
+ name: "MuiLocalizationProvider"
1953
+ });
1954
+ const {
1955
+ children,
1956
+ dateAdapter: DateAdapter,
1957
+ dateFormats,
1958
+ dateLibInstance,
1959
+ adapterLocale,
1960
+ localeText: themeLocaleText
1961
+ } = props;
1962
+ const localeText = React11.useMemo(() => _extends({}, themeLocaleText, parentLocaleText, inLocaleText), [themeLocaleText, parentLocaleText, inLocaleText]);
1963
+ const adapter = React11.useMemo(() => {
1964
+ if (!DateAdapter) {
1965
+ if (parentAdapter) {
1966
+ return parentAdapter;
1967
+ }
1968
+ return null;
1969
+ }
1970
+ const dateAdapter = new DateAdapter({
1971
+ locale: adapterLocale,
1972
+ formats: dateFormats,
1973
+ instance: dateLibInstance
1974
+ });
1975
+ if (!dateAdapter.isMUIAdapter) {
1976
+ throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`", "For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`", "More information on the installation documentation: https://mui.com/x/react-date-pickers/quickstart/#installation"].join(`
1977
+ `));
1978
+ }
1979
+ return dateAdapter;
1980
+ }, [DateAdapter, adapterLocale, dateFormats, dateLibInstance, parentAdapter]);
1981
+ const defaultDates = React11.useMemo(() => {
1982
+ if (!adapter) {
1983
+ return null;
1984
+ }
1985
+ return {
1986
+ minDate: adapter.date("1900-01-01T00:00:00.000"),
1987
+ maxDate: adapter.date("2099-12-31T00:00:00.000")
1988
+ };
1989
+ }, [adapter]);
1990
+ const contextValue = React11.useMemo(() => {
1991
+ return {
1992
+ utils: adapter,
1993
+ adapter,
1994
+ defaultDates,
1995
+ localeText
1996
+ };
1997
+ }, [defaultDates, adapter, localeText]);
1998
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PickerAdapterContext.Provider, {
1999
+ value: contextValue,
2000
+ children
2001
+ });
2002
+ };
2003
+ if (process.env.NODE_ENV !== "production") LocalizationProvider.displayName = "LocalizationProvider";
2004
+ process.env.NODE_ENV !== "production" ? LocalizationProvider.propTypes = {
2005
+ // ----------------------------- Warning --------------------------------
2006
+ // | These PropTypes are generated from the TypeScript type definitions |
2007
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
2008
+ // ----------------------------------------------------------------------
2009
+ /**
2010
+ * Locale for the date library you are using
2011
+ */
2012
+ adapterLocale: import_prop_types.default.any,
2013
+ children: import_prop_types.default.node,
2014
+ /**
2015
+ * Date library adapter class function.
2016
+ * @see See the localization provider {@link https://mui.com/x/react-date-pickers/quickstart/#integrate-provider-and-adapter date adapter setup section} for more details.
2017
+ */
2018
+ dateAdapter: import_prop_types.default.func,
2019
+ /**
2020
+ * Formats that are used for any child pickers
2021
+ */
2022
+ dateFormats: import_prop_types.default.shape({
2023
+ dayOfMonth: import_prop_types.default.string,
2024
+ dayOfMonthFull: import_prop_types.default.string,
2025
+ fullDate: import_prop_types.default.string,
2026
+ fullTime12h: import_prop_types.default.string,
2027
+ fullTime24h: import_prop_types.default.string,
2028
+ hours12h: import_prop_types.default.string,
2029
+ hours24h: import_prop_types.default.string,
2030
+ keyboardDate: import_prop_types.default.string,
2031
+ keyboardDateTime12h: import_prop_types.default.string,
2032
+ keyboardDateTime24h: import_prop_types.default.string,
2033
+ meridiem: import_prop_types.default.string,
2034
+ minutes: import_prop_types.default.string,
2035
+ month: import_prop_types.default.string,
2036
+ monthShort: import_prop_types.default.string,
2037
+ normalDate: import_prop_types.default.string,
2038
+ normalDateWithWeekday: import_prop_types.default.string,
2039
+ seconds: import_prop_types.default.string,
2040
+ shortDate: import_prop_types.default.string,
2041
+ weekday: import_prop_types.default.string,
2042
+ weekdayShort: import_prop_types.default.string,
2043
+ year: import_prop_types.default.string
2044
+ }),
2045
+ /**
2046
+ * Date library instance you are using, if it has some global overrides
2047
+ * ```jsx
2048
+ * dateLibInstance={momentTimeZone}
2049
+ * ```
2050
+ */
2051
+ dateLibInstance: import_prop_types.default.any,
2052
+ /**
2053
+ * Locale for components texts
2054
+ */
2055
+ localeText: import_prop_types.default.object
2056
+ } : void 0;
2057
+
2058
+ // node_modules/@mui/x-internals/esm/warning/warning.js
2059
+ var warnedOnceCache = /* @__PURE__ */ new Set();
2060
+ function warnOnce(message, gravity = "warning") {
2061
+ if (process.env.NODE_ENV === "production") {
2062
+ return;
2063
+ }
2064
+ const cleanMessage = Array.isArray(message) ? message.join("\n") : message;
2065
+ if (!warnedOnceCache.has(cleanMessage)) {
2066
+ warnedOnceCache.add(cleanMessage);
2067
+ if (gravity === "error") {
2068
+ console.error(cleanMessage);
2069
+ } else {
2070
+ console.warn(cleanMessage);
2071
+ }
2072
+ }
2073
+ }
2074
+
2075
+ // node_modules/@mui/x-date-pickers/esm/AdapterDayjs/AdapterDayjs.js
2076
+ var import_dayjs = __toESM(require("dayjs"), 1);
2077
+ var import_weekOfYear = __toESM(require("dayjs/plugin/weekOfYear.js"), 1);
2078
+ var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat.js"), 1);
2079
+ var import_localizedFormat = __toESM(require("dayjs/plugin/localizedFormat.js"), 1);
2080
+ var import_isBetween = __toESM(require("dayjs/plugin/isBetween.js"), 1);
2081
+ var import_advancedFormat = __toESM(require("dayjs/plugin/advancedFormat.js"), 1);
2082
+ import_dayjs.default.extend(import_localizedFormat.default);
2083
+ import_dayjs.default.extend(import_weekOfYear.default);
2084
+ import_dayjs.default.extend(import_isBetween.default);
2085
+ import_dayjs.default.extend(import_advancedFormat.default);
2086
+ var formatTokenMap = {
2087
+ // Year
2088
+ YY: "year",
2089
+ YYYY: {
2090
+ sectionType: "year",
2091
+ contentType: "digit",
2092
+ maxLength: 4
2093
+ },
2094
+ // Month
2095
+ M: {
2096
+ sectionType: "month",
2097
+ contentType: "digit",
2098
+ maxLength: 2
2099
+ },
2100
+ MM: "month",
2101
+ MMM: {
2102
+ sectionType: "month",
2103
+ contentType: "letter"
2104
+ },
2105
+ MMMM: {
2106
+ sectionType: "month",
2107
+ contentType: "letter"
2108
+ },
2109
+ // Day of the month
2110
+ D: {
2111
+ sectionType: "day",
2112
+ contentType: "digit",
2113
+ maxLength: 2
2114
+ },
2115
+ DD: "day",
2116
+ Do: {
2117
+ sectionType: "day",
2118
+ contentType: "digit-with-letter"
2119
+ },
2120
+ // Day of the week
2121
+ d: {
2122
+ sectionType: "weekDay",
2123
+ contentType: "digit",
2124
+ maxLength: 2
2125
+ },
2126
+ dd: {
2127
+ sectionType: "weekDay",
2128
+ contentType: "letter"
2129
+ },
2130
+ ddd: {
2131
+ sectionType: "weekDay",
2132
+ contentType: "letter"
2133
+ },
2134
+ dddd: {
2135
+ sectionType: "weekDay",
2136
+ contentType: "letter"
2137
+ },
2138
+ // Meridiem
2139
+ A: "meridiem",
2140
+ a: "meridiem",
2141
+ // Hours
2142
+ H: {
2143
+ sectionType: "hours",
2144
+ contentType: "digit",
2145
+ maxLength: 2
2146
+ },
2147
+ HH: "hours",
2148
+ h: {
2149
+ sectionType: "hours",
2150
+ contentType: "digit",
2151
+ maxLength: 2
2152
+ },
2153
+ hh: "hours",
2154
+ // Minutes
2155
+ m: {
2156
+ sectionType: "minutes",
2157
+ contentType: "digit",
2158
+ maxLength: 2
2159
+ },
2160
+ mm: "minutes",
2161
+ // Seconds
2162
+ s: {
2163
+ sectionType: "seconds",
2164
+ contentType: "digit",
2165
+ maxLength: 2
2166
+ },
2167
+ ss: "seconds"
2168
+ };
2169
+ var defaultFormats = {
2170
+ year: "YYYY",
2171
+ month: "MMMM",
2172
+ monthShort: "MMM",
2173
+ dayOfMonth: "D",
2174
+ dayOfMonthFull: "Do",
2175
+ weekday: "dddd",
2176
+ weekdayShort: "dd",
2177
+ hours24h: "HH",
2178
+ hours12h: "hh",
2179
+ meridiem: "A",
2180
+ minutes: "mm",
2181
+ seconds: "ss",
2182
+ fullDate: "ll",
2183
+ keyboardDate: "L",
2184
+ shortDate: "MMM D",
2185
+ normalDate: "D MMMM",
2186
+ normalDateWithWeekday: "ddd, MMM D",
2187
+ fullTime12h: "hh:mm A",
2188
+ fullTime24h: "HH:mm",
2189
+ keyboardDateTime12h: "L hh:mm A",
2190
+ keyboardDateTime24h: "L HH:mm"
2191
+ };
2192
+ var MISSING_UTC_PLUGIN = ["Missing UTC plugin", "To be able to use UTC or timezones, you have to enable the `utc` plugin", "Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join("\n");
2193
+ var MISSING_TIMEZONE_PLUGIN = ["Missing timezone plugin", "To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin", "Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join("\n");
2194
+ var AdapterDayjs = class {
2195
+ isMUIAdapter = true;
2196
+ isTimezoneCompatible = true;
2197
+ lib = "dayjs";
2198
+ escapedCharacters = {
2199
+ start: "[",
2200
+ end: "]"
2201
+ };
2202
+ formatTokenMap = /* @__PURE__ */ (() => formatTokenMap)();
2203
+ constructor({
2204
+ locale,
2205
+ formats
2206
+ } = {}) {
2207
+ this.locale = locale;
2208
+ this.formats = _extends({}, defaultFormats, formats);
2209
+ import_dayjs.default.extend(import_customParseFormat.default);
2210
+ }
2211
+ setLocaleToValue = (value) => {
2212
+ const expectedLocale = this.getCurrentLocaleCode();
2213
+ if (expectedLocale === value.locale()) {
2214
+ return value;
2215
+ }
2216
+ return value.locale(expectedLocale);
2217
+ };
2218
+ hasUTCPlugin = () => typeof import_dayjs.default.utc !== "undefined";
2219
+ hasTimezonePlugin = () => typeof import_dayjs.default.tz !== "undefined";
2220
+ isSame = (value, comparing, comparisonTemplate) => {
2221
+ const comparingInValueTimezone = this.setTimezone(comparing, this.getTimezone(value));
2222
+ return value.format(comparisonTemplate) === comparingInValueTimezone.format(comparisonTemplate);
2223
+ };
2224
+ /**
2225
+ * Replaces "default" by undefined and "system" by the system timezone before passing it to `dayjs`.
2226
+ */
2227
+ cleanTimezone = (timezone) => {
2228
+ switch (timezone) {
2229
+ case "default": {
2230
+ return void 0;
2231
+ }
2232
+ case "system": {
2233
+ return import_dayjs.default.tz.guess();
2234
+ }
2235
+ default: {
2236
+ return timezone;
2237
+ }
2238
+ }
2239
+ };
2240
+ createSystemDate = (value) => {
2241
+ let date;
2242
+ if (this.hasUTCPlugin() && this.hasTimezonePlugin()) {
2243
+ const timezone = import_dayjs.default.tz.guess();
2244
+ if (timezone === "UTC") {
2245
+ date = (0, import_dayjs.default)(value);
2246
+ } else {
2247
+ date = import_dayjs.default.tz(value, timezone);
2248
+ }
2249
+ } else {
2250
+ date = (0, import_dayjs.default)(value);
2251
+ }
2252
+ return this.setLocaleToValue(date);
2253
+ };
2254
+ createUTCDate = (value) => {
2255
+ if (!this.hasUTCPlugin()) {
2256
+ throw new Error(MISSING_UTC_PLUGIN);
2257
+ }
2258
+ return this.setLocaleToValue(import_dayjs.default.utc(value));
2259
+ };
2260
+ createTZDate = (value, timezone) => {
2261
+ if (!this.hasUTCPlugin()) {
2262
+ throw new Error(MISSING_UTC_PLUGIN);
2263
+ }
2264
+ if (!this.hasTimezonePlugin()) {
2265
+ throw new Error(MISSING_TIMEZONE_PLUGIN);
2266
+ }
2267
+ const keepLocalTime = value !== void 0 && !value.endsWith("Z");
2268
+ return this.setLocaleToValue((0, import_dayjs.default)(value).tz(this.cleanTimezone(timezone), keepLocalTime));
2269
+ };
2270
+ getLocaleFormats = () => {
2271
+ const locales = import_dayjs.default.Ls;
2272
+ const locale = this.locale || "en";
2273
+ let localeObject = locales[locale];
2274
+ if (localeObject === void 0) {
2275
+ if (process.env.NODE_ENV !== "production") {
2276
+ warnOnce(["MUI X: Your locale has not been found.", "Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale.", "Or you forget to import the locale from 'dayjs/locale/{localeUsed}'", "fallback on English locale."]);
2277
+ }
2278
+ localeObject = locales.en;
2279
+ }
2280
+ return localeObject.formats;
2281
+ };
2282
+ /**
2283
+ * If the new day does not have the same offset as the old one (when switching to summer day time for example),
2284
+ * Then dayjs will not automatically adjust the offset (moment does).
2285
+ * We have to parse again the value to make sure the `fixOffset` method is applied.
2286
+ * See https://github.com/iamkun/dayjs/blob/b3624de619d6e734cd0ffdbbd3502185041c1b60/src/plugin/timezone/index.js#L72
2287
+ */
2288
+ adjustOffset = (value) => {
2289
+ if (!this.hasTimezonePlugin()) {
2290
+ return value;
2291
+ }
2292
+ const timezone = this.getTimezone(value);
2293
+ if (timezone !== "UTC") {
2294
+ const fixedValue = value.tz(this.cleanTimezone(timezone), true);
2295
+ if (fixedValue.$offset === (value.$offset ?? 0)) {
2296
+ return value;
2297
+ }
2298
+ value.$offset = fixedValue.$offset;
2299
+ }
2300
+ return value;
2301
+ };
2302
+ date = (value, timezone = "default") => {
2303
+ if (value === null) {
2304
+ return null;
2305
+ }
2306
+ if (timezone === "UTC") {
2307
+ return this.createUTCDate(value);
2308
+ }
2309
+ if (timezone === "system" || timezone === "default" && !this.hasTimezonePlugin()) {
2310
+ return this.createSystemDate(value);
2311
+ }
2312
+ return this.createTZDate(value, timezone);
2313
+ };
2314
+ getInvalidDate = () => (0, import_dayjs.default)(/* @__PURE__ */ new Date("Invalid date"));
2315
+ getTimezone = (value) => {
2316
+ if (this.hasTimezonePlugin()) {
2317
+ const zone = value.$x?.$timezone;
2318
+ if (zone) {
2319
+ return zone;
2320
+ }
2321
+ }
2322
+ if (this.hasUTCPlugin() && value.isUTC()) {
2323
+ return "UTC";
2324
+ }
2325
+ return "system";
2326
+ };
2327
+ setTimezone = (value, timezone) => {
2328
+ if (this.getTimezone(value) === timezone) {
2329
+ return value;
2330
+ }
2331
+ if (timezone === "UTC") {
2332
+ if (!this.hasUTCPlugin()) {
2333
+ throw new Error(MISSING_UTC_PLUGIN);
2334
+ }
2335
+ return value.utc();
2336
+ }
2337
+ if (timezone === "system") {
2338
+ return value.local();
2339
+ }
2340
+ if (!this.hasTimezonePlugin()) {
2341
+ if (timezone === "default") {
2342
+ return value;
2343
+ }
2344
+ throw new Error(MISSING_TIMEZONE_PLUGIN);
2345
+ }
2346
+ return this.setLocaleToValue(import_dayjs.default.tz(value, this.cleanTimezone(timezone)));
2347
+ };
2348
+ toJsDate = (value) => {
2349
+ return value.toDate();
2350
+ };
2351
+ parse = (value, format) => {
2352
+ if (value === "") {
2353
+ return null;
2354
+ }
2355
+ return (0, import_dayjs.default)(value, format, this.locale, true);
2356
+ };
2357
+ getCurrentLocaleCode = () => {
2358
+ return this.locale || "en";
2359
+ };
2360
+ is12HourCycleInCurrentLocale = () => {
2361
+ return /A|a/.test(this.getLocaleFormats().LT || "");
2362
+ };
2363
+ expandFormat = (format) => {
2364
+ const localeFormats = this.getLocaleFormats();
2365
+ const t2 = (formatBis) => formatBis.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (_, a, b) => a || b.slice(1));
2366
+ return format.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (_, a, b) => {
2367
+ const B = b && b.toUpperCase();
2368
+ return a || localeFormats[b] || t2(localeFormats[B]);
2369
+ });
2370
+ };
2371
+ isValid = (value) => {
2372
+ if (value == null) {
2373
+ return false;
2374
+ }
2375
+ return value.isValid();
2376
+ };
2377
+ format = (value, formatKey) => {
2378
+ return this.formatByString(value, this.formats[formatKey]);
2379
+ };
2380
+ formatByString = (value, formatString) => {
2381
+ return this.setLocaleToValue(value).format(formatString);
2382
+ };
2383
+ formatNumber = (numberToFormat) => {
2384
+ return numberToFormat;
2385
+ };
2386
+ isEqual = (value, comparing) => {
2387
+ if (value === null && comparing === null) {
2388
+ return true;
2389
+ }
2390
+ if (value === null || comparing === null) {
2391
+ return false;
2392
+ }
2393
+ return value.toDate().getTime() === comparing.toDate().getTime();
2394
+ };
2395
+ isSameYear = (value, comparing) => {
2396
+ return this.isSame(value, comparing, "YYYY");
2397
+ };
2398
+ isSameMonth = (value, comparing) => {
2399
+ return this.isSame(value, comparing, "YYYY-MM");
2400
+ };
2401
+ isSameDay = (value, comparing) => {
2402
+ return this.isSame(value, comparing, "YYYY-MM-DD");
2403
+ };
2404
+ isSameHour = (value, comparing) => {
2405
+ return value.isSame(comparing, "hour");
2406
+ };
2407
+ isAfter = (value, comparing) => {
2408
+ return value > comparing;
2409
+ };
2410
+ isAfterYear = (value, comparing) => {
2411
+ if (!this.hasUTCPlugin()) {
2412
+ return value.isAfter(comparing, "year");
2413
+ }
2414
+ return !this.isSameYear(value, comparing) && value.utc() > comparing.utc();
2415
+ };
2416
+ isAfterDay = (value, comparing) => {
2417
+ if (!this.hasUTCPlugin()) {
2418
+ return value.isAfter(comparing, "day");
2419
+ }
2420
+ return !this.isSameDay(value, comparing) && value.utc() > comparing.utc();
2421
+ };
2422
+ isBefore = (value, comparing) => {
2423
+ return value < comparing;
2424
+ };
2425
+ isBeforeYear = (value, comparing) => {
2426
+ if (!this.hasUTCPlugin()) {
2427
+ return value.isBefore(comparing, "year");
2428
+ }
2429
+ return !this.isSameYear(value, comparing) && value.utc() < comparing.utc();
2430
+ };
2431
+ isBeforeDay = (value, comparing) => {
2432
+ if (!this.hasUTCPlugin()) {
2433
+ return value.isBefore(comparing, "day");
2434
+ }
2435
+ return !this.isSameDay(value, comparing) && value.utc() < comparing.utc();
2436
+ };
2437
+ isWithinRange = (value, [start, end]) => {
2438
+ return value >= start && value <= end;
2439
+ };
2440
+ startOfYear = (value) => {
2441
+ return this.adjustOffset(value.startOf("year"));
2442
+ };
2443
+ startOfMonth = (value) => {
2444
+ return this.adjustOffset(value.startOf("month"));
2445
+ };
2446
+ startOfWeek = (value) => {
2447
+ return this.adjustOffset(this.setLocaleToValue(value).startOf("week"));
2448
+ };
2449
+ startOfDay = (value) => {
2450
+ return this.adjustOffset(value.startOf("day"));
2451
+ };
2452
+ endOfYear = (value) => {
2453
+ return this.adjustOffset(value.endOf("year"));
2454
+ };
2455
+ endOfMonth = (value) => {
2456
+ return this.adjustOffset(value.endOf("month"));
2457
+ };
2458
+ endOfWeek = (value) => {
2459
+ return this.adjustOffset(this.setLocaleToValue(value).endOf("week"));
2460
+ };
2461
+ endOfDay = (value) => {
2462
+ return this.adjustOffset(value.endOf("day"));
2463
+ };
2464
+ addYears = (value, amount) => {
2465
+ return this.adjustOffset(value.add(amount, "year"));
2466
+ };
2467
+ addMonths = (value, amount) => {
2468
+ return this.adjustOffset(value.add(amount, "month"));
2469
+ };
2470
+ addWeeks = (value, amount) => {
2471
+ return this.adjustOffset(value.add(amount, "week"));
2472
+ };
2473
+ addDays = (value, amount) => {
2474
+ return this.adjustOffset(value.add(amount, "day"));
2475
+ };
2476
+ addHours = (value, amount) => {
2477
+ return this.adjustOffset(value.add(amount, "hour"));
2478
+ };
2479
+ addMinutes = (value, amount) => {
2480
+ return this.adjustOffset(value.add(amount, "minute"));
2481
+ };
2482
+ addSeconds = (value, amount) => {
2483
+ return this.adjustOffset(value.add(amount, "second"));
2484
+ };
2485
+ getYear = (value) => {
2486
+ return value.year();
2487
+ };
2488
+ getMonth = (value) => {
2489
+ return value.month();
2490
+ };
2491
+ getDate = (value) => {
2492
+ return value.date();
2493
+ };
2494
+ getHours = (value) => {
2495
+ return value.hour();
2496
+ };
2497
+ getMinutes = (value) => {
2498
+ return value.minute();
2499
+ };
2500
+ getSeconds = (value) => {
2501
+ return value.second();
2502
+ };
2503
+ getMilliseconds = (value) => {
2504
+ return value.millisecond();
2505
+ };
2506
+ setYear = (value, year) => {
2507
+ return this.adjustOffset(value.set("year", year));
2508
+ };
2509
+ setMonth = (value, month) => {
2510
+ return this.adjustOffset(value.set("month", month));
2511
+ };
2512
+ setDate = (value, date) => {
2513
+ return this.adjustOffset(value.set("date", date));
2514
+ };
2515
+ setHours = (value, hours) => {
2516
+ return this.adjustOffset(value.set("hour", hours));
2517
+ };
2518
+ setMinutes = (value, minutes) => {
2519
+ return this.adjustOffset(value.set("minute", minutes));
2520
+ };
2521
+ setSeconds = (value, seconds) => {
2522
+ return this.adjustOffset(value.set("second", seconds));
2523
+ };
2524
+ setMilliseconds = (value, milliseconds) => {
2525
+ return this.adjustOffset(value.set("millisecond", milliseconds));
2526
+ };
2527
+ getDaysInMonth = (value) => {
2528
+ return value.daysInMonth();
2529
+ };
2530
+ getWeekArray = (value) => {
2531
+ const start = this.startOfWeek(this.startOfMonth(value));
2532
+ const end = this.endOfWeek(this.endOfMonth(value));
2533
+ let count = 0;
2534
+ let current = start;
2535
+ const nestedWeeks = [];
2536
+ while (current < end) {
2537
+ const weekNumber = Math.floor(count / 7);
2538
+ nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
2539
+ nestedWeeks[weekNumber].push(current);
2540
+ current = this.addDays(current, 1);
2541
+ count += 1;
2542
+ }
2543
+ return nestedWeeks;
2544
+ };
2545
+ getWeekNumber = (value) => {
2546
+ return value.week();
2547
+ };
2548
+ getDayOfWeek(value) {
2549
+ return value.day() + 1;
2550
+ }
2551
+ getYearRange = ([start, end]) => {
2552
+ const startDate = this.startOfYear(start);
2553
+ const endDate = this.endOfYear(end);
2554
+ const years = [];
2555
+ let current = startDate;
2556
+ while (this.isBefore(current, endDate)) {
2557
+ years.push(current);
2558
+ current = this.addYears(current, 1);
2559
+ }
2560
+ return years;
2561
+ };
2562
+ };
2563
+
2564
+ // src/providers/LayoutProvider.tsx
2565
+ var import_react21 = require("react");
2566
+ var import_react_i18next8 = require("react-i18next");
2567
+ var z = __toESM(require("zod"), 1);
2568
+ var import_locales3 = require("zod/locales");
2569
+
2570
+ // src/components/core/Layout.tsx
2571
+ var import_Menu = __toESM(require("@mui/icons-material/Menu"), 1);
2572
+ var import_MenuOpen = __toESM(require("@mui/icons-material/MenuOpen"), 1);
2573
+ var import_material22 = require("@mui/material");
2574
+ var import_styles4 = require("@mui/material/styles");
2575
+ var import_react_query2 = require("@tanstack/react-query");
2576
+ var import_use_local_storage_state = __toESM(require("use-local-storage-state"), 1);
2577
+
2578
+ // src/hooks/ThemeHook.ts
2579
+ var import_material18 = require("@mui/material");
2580
+ var import_colors2 = require("@mui/material/colors");
2581
+ var import_locale = require("@mui/material/locale");
2582
+ var import_locales = require("@mui/x-data-grid-premium/locales");
2583
+ var import_locales2 = require("@mui/x-date-pickers-pro/locales");
2584
+ var import_react_i18next5 = require("react-i18next");
2585
+ var WISTRON_PRIMARY_COLOR = "#00506E";
2586
+ var WISTRON_SECONDARY_COLOR = "#64DC00";
2587
+ var useGetTheme = (theme) => {
2588
+ const { i18n: i18n2 } = (0, import_react_i18next5.useTranslation)();
2589
+ return (0, import_material18.createTheme)(
2590
+ {
2591
+ cssVariables: {
2592
+ colorSchemeSelector: "data-mui-color-scheme"
2593
+ },
2594
+ colorSchemes: {
2595
+ light: {
2596
+ palette: {
2597
+ primary: { main: WISTRON_PRIMARY_COLOR },
2598
+ secondary: { main: WISTRON_SECONDARY_COLOR }
2599
+ }
2600
+ },
2601
+ dark: {
2602
+ palette: {
2603
+ primary: { main: (0, import_material18.lighten)(WISTRON_PRIMARY_COLOR, 0.5) },
2604
+ secondary: { main: (0, import_material18.darken)(WISTRON_SECONDARY_COLOR, 0.5) }
2605
+ }
2606
+ },
2607
+ ...theme?.colorSchemes
2608
+ },
2609
+ components: {
2610
+ MuiCssBaseline: {
2611
+ styleOverrides: (theme2) => {
2612
+ return {
2613
+ body: {
2614
+ "&::-webkit-scrollbar, & *::-webkit-scrollbar": {
2615
+ width: "0.7em",
2616
+ height: "0.7em"
2617
+ },
2618
+ "&::-webkit-scrollbar-track, & *::-webkit-scrollbar-track": {
2619
+ backgroundColor: theme2.palette.mode === "dark" ? import_colors2.grey[900] : import_colors2.grey[200],
2620
+ borderRadius: "5px"
2621
+ },
2622
+ "&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb": {
2623
+ backgroundColor: theme2.palette.mode === "dark" ? import_colors2.grey[800] : import_colors2.grey[400],
2624
+ borderRadius: "10px"
2625
+ },
2626
+ "&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover": {
2627
+ backgroundColor: theme2.palette.mode === "dark" ? import_colors2.grey[700] : import_colors2.grey[500]
2628
+ },
2629
+ "&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner": {
2630
+ backgroundColor: "transparent"
2631
+ }
2632
+ }
2633
+ };
2634
+ }
2635
+ },
2636
+ ...theme?.components
2637
+ }
2638
+ },
2639
+ i18n2.resolvedLanguage === "cs" ? import_locales2.csCZ : import_locales2.enUS,
2640
+ i18n2.resolvedLanguage === "cs" ? import_locales.csCZ : import_locales.enUS,
2641
+ i18n2.resolvedLanguage === "cs" ? import_locale.csCZ : import_locale.enUS
2642
+ );
2643
+ };
2644
+
2645
+ // src/components/core/navigation/NavigationRail.tsx
2646
+ var import_material20 = require("@mui/material");
2647
+ var import_Box2 = __toESM(require("@mui/material/Box"), 1);
2648
+ var import_Drawer = __toESM(require("@mui/material/Drawer"), 1);
2649
+ var import_styles3 = require("@mui/material/styles");
2650
+ var import_react_router8 = require("@tanstack/react-router");
2651
+
2652
+ // src/components/core/navigation/NavigationList.tsx
2653
+ var import_Divider = __toESM(require("@mui/material/Divider"), 1);
2654
+ var import_List = __toESM(require("@mui/material/List"), 1);
2655
+ var import_ListSubheader = __toESM(require("@mui/material/ListSubheader"), 1);
2656
+ var import_react17 = require("react");
2657
+
2658
+ // src/components/core/navigation/NavigationListItem.tsx
2659
+ var import_ExpandMore = __toESM(require("@mui/icons-material/ExpandMore"), 1);
2660
+ var import_Avatar = __toESM(require("@mui/material/Avatar"), 1);
2661
+ var import_Box = __toESM(require("@mui/material/Box"), 1);
2662
+ var import_Popper = __toESM(require("@mui/material/Popper"), 1);
2663
+ var import_ListItem = __toESM(require("@mui/material/ListItem"), 1);
2664
+ var import_ListItemButton = __toESM(require("@mui/material/ListItemButton"), 1);
2665
+ var import_ListItemIcon = __toESM(require("@mui/material/ListItemIcon"), 1);
2666
+ var import_ListItemText = __toESM(require("@mui/material/ListItemText"), 1);
2667
+ var import_Paper = __toESM(require("@mui/material/Paper"), 1);
2668
+ var import_styles2 = require("@mui/material/styles");
2669
+ var import_Typography = __toESM(require("@mui/material/Typography"), 1);
2670
+ var import_react16 = require("react");
2671
+ var import_material19 = require("@mui/material");
2672
+ var import_jsx_runtime23 = require("react/jsx-runtime");
2673
+ var ICON_SIZE = 34;
2674
+ var StyledNavButton = (0, import_styles2.styled)(import_ListItemButton.default)(({ theme }) => ({
2675
+ borderRadius: 8,
2676
+ "&.Mui-selected": {
2677
+ "& .MuiListItemIcon-root, & .MuiTypography-root, & .MuiSvgIcon-root": {
2678
+ color: (theme.vars ?? theme).palette.primary.dark
2679
+ },
2680
+ "& .MuiAvatar-root": {
2681
+ backgroundColor: (theme.vars ?? theme).palette.primary.dark
2682
+ },
2683
+ "& .MuiTouchRipple-child": {
2684
+ backgroundColor: (theme.vars ?? theme).palette.primary.dark
2685
+ }
2686
+ },
2687
+ "& .MuiSvgIcon-root": {
2688
+ color: (theme.vars ?? theme).palette.action.active
2689
+ },
2690
+ "& .MuiAvatar-root": {
2691
+ backgroundColor: (theme.vars ?? theme).palette.action.active
2692
+ }
2693
+ }));
2694
+ var StyledRouterButton = (0, import_styles2.styled)(RouterListItemButton)(({ theme }) => ({
2695
+ borderRadius: 8,
2696
+ "&.Mui-selected": {
2697
+ "& .MuiListItemIcon-root, & .MuiTypography-root, & .MuiSvgIcon-root": {
2698
+ color: (theme.vars ?? theme).palette.primary.dark
2699
+ },
2700
+ "& .MuiAvatar-root": {
2701
+ backgroundColor: (theme.vars ?? theme).palette.primary.dark
2702
+ },
2703
+ "& .MuiTouchRipple-child": {
2704
+ backgroundColor: (theme.vars ?? theme).palette.primary.dark
2705
+ }
2706
+ },
2707
+ "& .MuiSvgIcon-root": {
2708
+ color: (theme.vars ?? theme).palette.action.active
2709
+ },
2710
+ "& .MuiAvatar-root": {
2711
+ backgroundColor: (theme.vars ?? theme).palette.action.active
2712
+ }
2713
+ }));
2714
+ var IconOrAvatar = ({ item, collapsed }) => {
2715
+ if (item.icon || collapsed) {
2716
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_Box.default, { sx: collapsed ? { position: "absolute", left: "50%", top: "calc(50% - 6px)", transform: "translate(-50%, -50%)" } : {}, children: [
2717
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_ListItemIcon.default, { sx: { display: "flex", alignItems: "center", justifyContent: "center", minWidth: ICON_SIZE }, children: [
2718
+ item.icon ?? null,
2719
+ !item.icon && collapsed ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_Avatar.default, { sx: { width: ICON_SIZE - 7, height: ICON_SIZE - 7, fontSize: 12 }, children: item.title }) : null
2720
+ ] }),
2721
+ collapsed ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2722
+ import_Typography.default,
2723
+ {
2724
+ variant: "caption",
2725
+ sx: {
2726
+ position: "absolute",
2727
+ bottom: -18,
2728
+ left: "50%",
2729
+ transform: "translateX(-50%)",
2730
+ fontSize: 10,
2731
+ fontWeight: 500,
2732
+ textAlign: "center",
2733
+ whiteSpace: "nowrap",
2734
+ overflow: "hidden",
2735
+ textOverflow: "ellipsis",
2736
+ maxWidth: MINI_WIDTH - 28
2737
+ },
2738
+ children: item.title
2739
+ }
2740
+ ) : null
2741
+ ] });
2742
+ }
2743
+ return null;
2744
+ };
2745
+ var MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2746
+ import_Popper.default,
2747
+ {
2748
+ open,
2749
+ anchorEl,
2750
+ placement: "right-start",
2751
+ modifiers: [
2752
+ { name: "offset", options: { offset: [6, 0] } },
2753
+ { name: "preventOverflow", options: { padding: 8 } },
2754
+ { name: "flip", options: { fallbackPlacements: ["right-end", "left-start"] } }
2755
+ ],
2756
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2757
+ import_Paper.default,
2758
+ {
2759
+ sx: {
2760
+ pt: 0.5,
2761
+ pb: 0.5,
2762
+ maxHeight: "min(calc(100vh - 100px), 560px)",
2763
+ overflowY: "auto",
2764
+ overscrollBehavior: "contain"
2765
+ },
2766
+ children
2767
+ }
2768
+ )
2769
+ }
2770
+ );
2771
+ var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSidebarFullyExpanded = true, isSidebarFullyCollapsed, onClick, renderNested }) => {
2772
+ const [hoveredPopoverItem, setHoveredPopoverItem] = (0, import_react16.useState)(null);
2773
+ const [anchorElement, setAnchorElement] = (0, import_react16.useState)(null);
2774
+ const chevronSx = (0, import_react16.useMemo)(() => {
2775
+ if (collapsed && isSidebarFullyCollapsed && item.children) {
2776
+ return {
2777
+ fontSize: 18,
2778
+ position: "absolute",
2779
+ top: "41.5%",
2780
+ right: "2px",
2781
+ transform: "translateY(-50%) rotate(-90deg)"
2782
+ };
2783
+ }
2784
+ if (!collapsed && isSidebarFullyExpanded && item.children) {
2785
+ return {
2786
+ ml: 0.5,
2787
+ transform: `rotate(${isOpen ? 0 : -90}deg)`
2788
+ };
2789
+ }
2790
+ return { display: "none" };
2791
+ }, [collapsed, isSidebarFullyExpanded, isSidebarFullyCollapsed, isOpen, item.children]);
2792
+ const shouldJustExpand = item.children && !collapsed;
2793
+ const buttonProps = {
2794
+ selected,
2795
+ disabled,
2796
+ sx: { px: 1.4, height: collapsed ? 60 : 48 }
2797
+ };
2798
+ const buttonContent = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
2799
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IconOrAvatar, { item, collapsed }),
2800
+ !collapsed && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2801
+ import_ListItemText.default,
2802
+ {
2803
+ primary: item.title,
2804
+ slotProps: { primary: { noWrap: true, title: item.title } },
2805
+ sx: { ml: 1.2, flex: 1, minWidth: 0, "& .MuiTypography-root": { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } }
2806
+ }
2807
+ ),
2808
+ item.children ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_ExpandMore.default, { sx: chevronSx }) : null
2809
+ ] });
2810
+ const listItem = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
2811
+ import_ListItem.default,
2812
+ {
2813
+ ...item.children && collapsed ? {
2814
+ onMouseEnter: (event) => {
2815
+ setAnchorElement(event.currentTarget);
2816
+ setHoveredPopoverItem(item.title);
2817
+ },
2818
+ onMouseLeave: () => {
2819
+ setHoveredPopoverItem(null);
2820
+ }
2821
+ } : {},
2822
+ sx: { py: 0, px: 1, overflowX: "hidden" },
2823
+ children: [
2824
+ shouldJustExpand ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StyledNavButton, { ...buttonProps, onClick: () => onClick?.(item), children: buttonContent }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2825
+ StyledRouterButton,
2826
+ {
2827
+ ...buttonProps,
2828
+ to: item.to,
2829
+ href: item.href,
2830
+ params: item.params,
2831
+ search: item.search,
2832
+ children: buttonContent
2833
+ }
2834
+ ),
2835
+ item.children && collapsed ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MiniPopover, { open: item.title === hoveredPopoverItem, anchorEl: anchorElement, children: renderNested?.(item.children) }) : null
2836
+ ]
2837
+ }
2838
+ );
2839
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react16.Fragment, { children: [
2840
+ listItem,
2841
+ item.children && !collapsed ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true, children: renderNested?.(item.children) }) : null
2842
+ ] }, item.to);
2843
+ };
2844
+
2845
+ // src/components/core/navigation/NavigationList.tsx
2846
+ var import_jsx_runtime24 = require("react/jsx-runtime");
2847
+ var isPageItem = (item) => !("kind" in item);
2848
+ var isDivider = (item) => "kind" in item && item.kind === "divider";
2849
+ var isHeader = (item) => "kind" in item && item.kind === "header";
2850
+ var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSidebarFullyExpanded = true, isSidebarFullyCollapsed, expandedWidth, renderItem, activePath, onNavigate }) => {
2851
+ const [openKeys, setOpenKeys] = (0, import_react17.useState)([]);
2852
+ (0, import_react17.useEffect)(() => {
2853
+ if (collapsed) setOpenKeys([]);
2854
+ }, [collapsed]);
2855
+ const toggleKey = (key) => setOpenKeys((previous) => previous.includes(key) ? previous.filter((k) => k !== key) : [...previous, key]);
2856
+ const renderNested = (children) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2857
+ NavigationList,
2858
+ {
2859
+ subNavigation: children,
2860
+ depth: depth + 1,
2861
+ isPopover: collapsed,
2862
+ expandedWidth,
2863
+ activePath,
2864
+ onNavigate
2865
+ }
2866
+ );
2867
+ const filteredNavigation = subNavigation.filter((nav) => !nav.hidden);
2868
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2869
+ import_List.default,
2870
+ {
2871
+ sx: {
2872
+ padding: 0,
2873
+ mt: isPopover && depth === 1 ? 0.5 : 0,
2874
+ mb: depth === 0 && !isPopover ? 4 : 0.5,
2875
+ pl: (isPopover ? 1 : 2) * (isPopover ? depth - 1 : depth),
2876
+ minWidth: isPopover && depth === 1 ? EXPANDED_WIDTH : "auto",
2877
+ width: collapsed ? MINI_WIDTH : "auto"
2878
+ },
2879
+ children: filteredNavigation.map((navItem, index) => {
2880
+ if (isHeader(navItem)) {
2881
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2882
+ import_ListSubheader.default,
2883
+ {
2884
+ sx: {
2885
+ fontSize: 12,
2886
+ fontWeight: "700",
2887
+ height: collapsed ? 0 : 40,
2888
+ px: 2,
2889
+ minWidth: expandedWidth,
2890
+ overflow: "hidden",
2891
+ textOverflow: "ellipsis",
2892
+ whiteSpace: "nowrap",
2893
+ zIndex: 2,
2894
+ bgcolor: "transparent",
2895
+ position: "static"
2896
+ },
2897
+ children: navItem.title
2898
+ },
2899
+ `subheader-${depth}-${index}`
2900
+ );
2901
+ }
2902
+ if (isDivider(navItem)) {
2903
+ const nextItem = filteredNavigation[index + 1];
2904
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_Divider.default, { sx: { mx: 1, mt: 1, mb: nextItem && isHeader(nextItem) && !collapsed ? 0 : 1 } }) }, `divider-${depth}-${index}`);
2905
+ }
2906
+ if (!isPageItem(navItem)) return null;
2907
+ const key = `item-${depth}-${index}`;
2908
+ const uniqueItemKey = `${depth}-${index}-${navItem.title}`;
2909
+ if (renderItem) return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react17.Fragment, { children: renderItem(navItem, { collapsed: !!collapsed }) }, key);
2910
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2911
+ NavigationListItem,
2912
+ {
2913
+ item: navItem,
2914
+ isOpen: openKeys.includes(uniqueItemKey),
2915
+ selected: activePath === navItem.to,
2916
+ collapsed,
2917
+ isSidebarFullyExpanded,
2918
+ isSidebarFullyCollapsed,
2919
+ onClick: navItem.children && !collapsed ? () => toggleKey(uniqueItemKey) : void 0,
2920
+ renderNested
2921
+ },
2922
+ key
2923
+ );
2924
+ })
2925
+ }
2926
+ );
2927
+ };
2928
+
2929
+ // src/components/core/navigation/NavigationRail.tsx
2930
+ var import_jsx_runtime25 = require("react/jsx-runtime");
2931
+ var MINI_WIDTH = 84;
2932
+ var EXPANDED_WIDTH = 320;
2933
+ var TOOLBAR_HEIGHT = 65;
2934
+ var NavigationRail = ({ navigation, expanded, setExpanded }) => {
2935
+ const navigate = (0, import_react_router8.useNavigate)();
2936
+ const routerState = (0, import_react_router8.useRouterState)();
2937
+ const theme = (0, import_styles3.useTheme)();
2938
+ const showPermanent = (0, import_material20.useMediaQuery)(theme.breakpoints.up("sm"));
2939
+ const drawerContent = (collapsed) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2940
+ import_Box2.default,
2941
+ {
2942
+ component: "nav",
2943
+ sx: {
2944
+ height: "100%",
2945
+ display: "flex",
2946
+ flexDirection: "column",
2947
+ justifyContent: "space-between",
2948
+ overflow: "auto",
2949
+ scrollbarGutter: collapsed ? "stable" : "auto",
2950
+ overflowX: "hidden",
2951
+ pt: navigation[0] && isHeader(navigation[0]) && !collapsed ? 0 : 2
2952
+ },
2953
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2954
+ NavigationList,
2955
+ {
2956
+ subNavigation: navigation,
2957
+ collapsed,
2958
+ isSidebarFullyExpanded: expanded,
2959
+ isSidebarFullyCollapsed: !expanded,
2960
+ expandedWidth: EXPANDED_WIDTH,
2961
+ activePath: routerState.location.pathname,
2962
+ onNavigate: navigate
2963
+ }
2964
+ )
2965
+ }
2966
+ );
2967
+ if (showPermanent)
2968
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2969
+ import_Drawer.default,
2970
+ {
2971
+ variant: "permanent",
2972
+ sx: {
2973
+ width: expanded ? EXPANDED_WIDTH : MINI_WIDTH,
2974
+ ["& .MuiDrawer-paper"]: {
2975
+ position: "absolute",
2976
+ top: `${TOOLBAR_HEIGHT}px`,
2977
+ height: `calc(100% - ${TOOLBAR_HEIGHT}px)`,
2978
+ width: expanded ? EXPANDED_WIDTH : MINI_WIDTH
2979
+ }
2980
+ },
2981
+ children: drawerContent(!expanded)
2982
+ }
2983
+ );
2984
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_Drawer.default, { open: expanded, onClose: () => setExpanded(false), children: drawerContent(!expanded) });
2985
+ };
2986
+
2987
+ // src/components/core/ToolbarAccount.tsx
2988
+ var import_AccountCircle = __toESM(require("@mui/icons-material/AccountCircle"), 1);
2989
+ var import_ArrowBack = __toESM(require("@mui/icons-material/ArrowBack"), 1);
2990
+ var import_Brightness4 = __toESM(require("@mui/icons-material/Brightness4"), 1);
2991
+ var import_ChevronRight = __toESM(require("@mui/icons-material/ChevronRight"), 1);
2992
+ var import_DarkMode = __toESM(require("@mui/icons-material/DarkMode"), 1);
2993
+ var import_LightMode = __toESM(require("@mui/icons-material/LightMode"), 1);
2994
+ var import_Login = __toESM(require("@mui/icons-material/Login"), 1);
2995
+ var import_Logout = __toESM(require("@mui/icons-material/Logout"), 1);
2996
+ var import_SettingsBrightness = __toESM(require("@mui/icons-material/SettingsBrightness"), 1);
2997
+ var import_Translate = __toESM(require("@mui/icons-material/Translate"), 1);
2998
+ var import_material21 = require("@mui/material");
2999
+ var import_react18 = require("react");
3000
+ var import_react_i18next6 = require("react-i18next");
3001
+
3002
+ // src/auth-test/keycloak.ts
3003
+ var import_react_router9 = require("@tanstack/react-router");
3004
+ var import_keycloak_js = __toESM(require("keycloak-js"), 1);
3005
+ var import_meta3 = {};
3006
+ var keycloakConfig = {
3007
+ url: import_meta3.env.VITE_KEYCLOAK_URL,
3008
+ realm: import_meta3.env.VITE_KEYCLOAK_REALM,
3009
+ clientId: import_meta3.env.VITE_KEYCLOAK_CLIENT_ID,
3010
+ idpHint: import_meta3.env.VITE_KEYCLOAK_IDP_HINT,
3011
+ confidentialClientId: import_meta3.env.VITE_KEYCLOAK_CONFIDENTIAL_CLIENT_ID,
3012
+ confidentialClientSecret: import_meta3.env.VITE_KEYCLOAK_CONFIDENTIAL_CLIENT_SECRET
3013
+ };
3014
+ function useKeycloak() {
3015
+ const routerContext = (0, import_react_router9.useRouter)();
3016
+ const keycloak = routerContext.options.context.keycloak;
3017
+ return keycloak;
3018
+ }
3019
+
3020
+ // src/components/core/ToolbarAccount.tsx
3021
+ var import_jsx_runtime26 = require("react/jsx-runtime");
3022
+ var ToolbarAccount = () => {
3023
+ const [anchorElement, setAnchorElement] = (0, import_react18.useState)();
3024
+ const [tab, setTab] = (0, import_react18.useState)("settings");
3025
+ const open = Boolean(anchorElement);
3026
+ const { t: t2, i18n: i18n2 } = (0, import_react_i18next6.useTranslation)();
3027
+ const { mode, setMode } = (0, import_material21.useColorScheme)();
3028
+ const changeLanguage = (newLanguage) => () => {
3029
+ i18n2.changeLanguage(newLanguage).finally(() => closeMenu());
3030
+ };
3031
+ const changeMode = (newMode) => () => {
3032
+ setMode(newMode);
3033
+ closeMenu();
3034
+ };
3035
+ const keycloak = useKeycloak();
3036
+ const user = keycloak.user;
3037
+ const getModeText = () => {
3038
+ switch (mode) {
3039
+ case "light": {
3040
+ return t2("Layout.Light");
3041
+ }
3042
+ case "dark": {
3043
+ return t2("Layout.Dark");
3044
+ }
3045
+ default: {
3046
+ return t2("Layout.System");
3047
+ }
3048
+ }
3049
+ };
3050
+ const usernameInitials = () => {
3051
+ if (!user?.name) return "";
3052
+ const splittedName = user.name.split(" ");
3053
+ return `${splittedName[0][0]}${splittedName.length > 1 ? splittedName[1][0] : ""}`;
3054
+ };
3055
+ const openMenu = (event) => setAnchorElement(event.currentTarget);
3056
+ const closeMenu = () => {
3057
+ setAnchorElement(void 0);
3058
+ setTimeout(() => setTab("settings"), 300);
3059
+ };
3060
+ const changeTab = (newTab) => () => setTab(newTab);
3061
+ const settings = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.List, { component: "nav", subheader: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListSubheader, { sx: { backgroundColor: "transparent" }, children: t2("Layout.Settings") }), children: [
3062
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.ListItemButton, { onClick: changeTab("theme"), sx: { py: 0.3 }, children: [
3063
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_Brightness4.default, {}) }),
3064
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemText, { primary: t2("Layout.Appearance"), secondary: getModeText() }),
3065
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_ChevronRight.default, {})
3066
+ ] }),
3067
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.ListItemButton, { onClick: changeTab("language"), sx: { py: 0.3 }, children: [
3068
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_Translate.default, {}) }),
3069
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemText, { primary: t2("Layout.Language"), secondary: i18n2.resolvedLanguage === "en" ? "English" : "\u010Ce\u0161tina" }),
3070
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_ChevronRight.default, {})
3071
+ ] })
3072
+ ] });
3073
+ const theme = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.List, { subheader: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.ListSubheader, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
3074
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.IconButton, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_ArrowBack.default, { fontSize: "small" }) }),
3075
+ " ",
3076
+ t2("Layout.Appearance")
3077
+ ] }), children: [
3078
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.ListItemButton, { onClick: changeMode("light"), disabled: mode === "light", children: [
3079
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_LightMode.default, {}) }),
3080
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemText, { primary: t2("Layout.Light") })
3081
+ ] }),
3082
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.ListItemButton, { onClick: changeMode("dark"), disabled: mode === "dark", children: [
3083
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_DarkMode.default, {}) }),
3084
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemText, { primary: t2("Layout.Dark") })
3085
+ ] }),
3086
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.ListItemButton, { onClick: changeMode("system"), disabled: mode === "system", children: [
3087
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_SettingsBrightness.default, {}) }),
3088
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemText, { primary: t2("Layout.System") })
3089
+ ] })
3090
+ ] });
3091
+ const language = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.List, { subheader: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.ListSubheader, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
3092
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.IconButton, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_ArrowBack.default, { fontSize: "small" }) }),
3093
+ " ",
3094
+ t2("Layout.Language")
3095
+ ] }), children: [
3096
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemButton, { onClick: changeLanguage("en"), disabled: i18n2.resolvedLanguage === "en", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemText, { primary: "English" }) }),
3097
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemButton, { onClick: changeLanguage("cs"), disabled: i18n2.resolvedLanguage === "cs", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemText, { primary: "\u010Ce\u0161tina" }) })
3098
+ ] });
3099
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react18.Fragment, { children: [
3100
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.IconButton, { size: "small", edge: "end", onClick: openMenu, children: user?.name ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Avatar, { sx: { width: { xs: 32, sm: 40 }, height: { xs: 32, sm: 40 }, bgcolor: "primary.main" }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Typography, { variant: "subtitle2", sx: { fontWeight: "bold", lineHeight: 0 }, children: usernameInitials() }) }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_AccountCircle.default, { fontSize: "large" }) }),
3101
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Menu, { anchorEl: anchorElement, open, onClose: closeMenu, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.Box, { sx: { width: 240 }, children: [
3102
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.List, { children: user?.name ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react18.Fragment, { children: [
3103
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItem, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemText, { primary: user.name, secondary: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { children: [
3104
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: user.employeeId }),
3105
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("br", {}),
3106
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: user.department })
3107
+ ] }) }) }),
3108
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.ListItemButton, { onClick: () => keycloak.logout(), children: [
3109
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_Logout.default, { color: "error" }) }),
3110
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemText, { primary: t2("Layout.Logout") })
3111
+ ] })
3112
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.ListItemButton, { onClick: () => keycloak.login(), children: [
3113
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_Login.default, { color: "success" }) }),
3114
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.ListItemText, { primary: t2("Layout.LogIn") })
3115
+ ] }) }),
3116
+ tab === "settings" && settings,
3117
+ tab === "theme" && theme,
3118
+ tab === "language" && language
3119
+ ] }) })
3120
+ ] });
3121
+ };
3122
+
3123
+ // src/components/core/Layout.tsx
3124
+ var import_jsx_runtime27 = require("react/jsx-runtime");
3125
+ var DrawerHeader = (0, import_styles4.styled)("div")(({ theme }) => ({
3126
+ display: "flex",
3127
+ alignItems: "center",
3128
+ justifyContent: "flex-end",
3129
+ padding: theme.spacing(0, 1),
3130
+ ...theme.mixins.toolbar
3131
+ }));
3132
+ var Layout = (props) => {
3133
+ const theme = useGetTheme(props.theme);
3134
+ const [navigationOpen, setNavigationOpen] = (0, import_use_local_storage_state.default)("navigationOpen", { defaultServerValue: false });
3135
+ const isFetching = !!(0, import_react_query2.useIsFetching)();
3136
+ const isMutating = !!(0, import_react_query2.useIsMutating)();
3137
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_styles4.ThemeProvider, { theme, children: [
3138
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.InitColorSchemeScript, {}),
3139
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.CssBaseline, {}),
3140
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.Box, { sx: { display: "flex", height: "100dvh", maxHeight: "100dvh", overflow: "hidden", width: "100%" }, children: [
3141
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3142
+ import_material22.AppBar,
3143
+ {
3144
+ color: "transparent",
3145
+ position: "fixed",
3146
+ sx: {
3147
+ borderBottom: "1px solid",
3148
+ borderColor: theme.vars?.palette.divider,
3149
+ boxShadow: "none"
3150
+ },
3151
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.Toolbar, { children: [
3152
+ props.navigation && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3153
+ import_material22.IconButton,
3154
+ {
3155
+ onClick: () => setNavigationOpen((previous) => !previous),
3156
+ sx: { marginRight: 2 },
3157
+ children: navigationOpen ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_MenuOpen.default, {}) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_Menu.default, {})
3158
+ }
3159
+ ),
3160
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(AppTitle, {}),
3161
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ToolbarAccount, {})
3162
+ ] })
3163
+ }
3164
+ ),
3165
+ props.navigation && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(NavigationRail, { navigation: props.navigation, expanded: navigationOpen ?? false, setExpanded: setNavigationOpen }),
3166
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.Box, { component: "main", sx: { flexGrow: 1, display: "flex", flexDirection: "column", minWidth: 0, height: "100%", overflow: "hidden" }, children: [
3167
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DrawerHeader, {}),
3168
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Box, { sx: { flex: 1, overflow: "auto", position: "relative" }, children: props.children })
3169
+ ] })
3170
+ ] }),
3171
+ (isFetching || isMutating) && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.LinearProgress, { sx: { position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 } })
3172
+ ] });
3173
+ };
3174
+
3175
+ // src/contexts/LayoutContext.ts
3176
+ var import_react19 = require("react");
3177
+ var LayoutContext = (0, import_react19.createContext)(null);
3178
+
3179
+ // src/utils/i18n.ts
3180
+ var import_i18next = __toESM(require("i18next"), 1);
3181
+ var import_i18next_browser_languagedetector = __toESM(require("i18next-browser-languagedetector"), 1);
3182
+ var import_i18next_http_backend = __toESM(require("i18next-http-backend"), 1);
3183
+ var import_react_i18next7 = require("react-i18next");
3184
+ var import_i18next2 = __toESM(require("i18next"), 1);
3185
+ import_i18next.default.use(import_i18next_http_backend.default).use(import_i18next_browser_languagedetector.default).use(import_react_i18next7.initReactI18next).init({
3186
+ fallbackLng: "en",
3187
+ interpolation: {
3188
+ escapeValue: false
3189
+ },
3190
+ react: {
3191
+ useSuspense: false
3192
+ }
3193
+ });
3194
+
3195
+ // src/providers/DialogsProvider.tsx
3196
+ var import_react20 = require("react");
3197
+ var import_jsx_runtime28 = require("react/jsx-runtime");
3198
+ function DialogsProvider({ children, unmountAfter = 1e3 }) {
3199
+ const [stack, setStack] = (0, import_react20.useState)([]);
3200
+ const keyPrefix = (0, import_react20.useId)();
3201
+ const nextId = (0, import_react20.useRef)(0);
3202
+ const dialogMetadata = (0, import_react20.useRef)(/* @__PURE__ */ new WeakMap());
3203
+ const requestDialog = useEventCallback_default(function open(Component7, payload, options = {}) {
3204
+ const { onClose = async () => {
3205
+ } } = options;
3206
+ let resolve;
3207
+ const promise = new Promise((resolveImpl) => {
3208
+ resolve = resolveImpl;
3209
+ });
3210
+ const key = `${keyPrefix}-${nextId.current}`;
3211
+ nextId.current += 1;
3212
+ const newEntry = {
3213
+ key,
3214
+ open: true,
3215
+ promise,
3216
+ Component: Component7,
3217
+ payload,
3218
+ onClose,
3219
+ resolve
3220
+ };
3221
+ dialogMetadata.current.set(promise, newEntry);
3222
+ setStack((previousStack) => [...previousStack, newEntry]);
3223
+ return promise;
3224
+ });
3225
+ const removeDialogFromStack = (0, import_react20.useCallback)((dialog) => {
3226
+ setStack((previousStack) => previousStack.filter((entry) => entry.promise !== dialog));
3227
+ dialogMetadata.current.delete(dialog);
3228
+ }, []);
3229
+ const closeDialogUi = useEventCallback_default(function closeDialogUi2(dialog) {
3230
+ setStack(
3231
+ (previousStack) => previousStack.map((entry) => entry.promise === dialog ? { ...entry, open: false } : entry)
3232
+ );
3233
+ setTimeout(() => removeDialogFromStack(dialog), unmountAfter);
3234
+ });
3235
+ const closeDialog = useEventCallback_default(async function closeDialog2(dialog, result) {
3236
+ const entryToClose = dialogMetadata.current.get(dialog);
3237
+ if (!entryToClose) {
3238
+ throw new Error("Dialog not found in stack");
3239
+ }
3240
+ try {
3241
+ await entryToClose.onClose(result);
3242
+ } finally {
3243
+ entryToClose.resolve(result);
3244
+ closeDialogUi(dialog);
3245
+ }
3246
+ return dialog;
3247
+ });
3248
+ const contextValue = (0, import_react20.useMemo)(() => ({ open: requestDialog, close: closeDialog }), [requestDialog, closeDialog]);
3249
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(DialogsContext.Provider, { value: contextValue, children: [
3250
+ children,
3251
+ stack.map(({ key, open, Component: Component7, payload, promise }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3252
+ Component7,
3253
+ {
3254
+ payload,
3255
+ open,
3256
+ onClose: async (result) => {
3257
+ await closeDialog(promise, result);
3258
+ }
3259
+ },
3260
+ key
3261
+ ))
3262
+ ] });
3263
+ }
3264
+
3265
+ // src/providers/LayoutProvider.tsx
3266
+ var import_jsx_runtime29 = require("react/jsx-runtime");
3267
+ var LayoutProvider = (props) => {
3268
+ const [user, setUser] = (0, import_react21.useState)({ employeeId: "", name: "Unknown", department: "", company: "", category: "" });
3269
+ const { t: t2 } = (0, import_react_i18next8.useTranslation)();
3270
+ const navigation = props.getNavigation?.({ user, t: t2 });
3271
+ (0, import_react21.useEffect)(() => {
3272
+ z.config(import_i18next2.default.resolvedLanguage === "cs" ? (0, import_locales3.cs)() : (0, import_locales3.en)());
3273
+ }, []);
3274
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_i18next8.I18nextProvider, { i18n: import_i18next2.default, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: import_i18next2.default.resolvedLanguage, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(LayoutContext.Provider, { value: { user: { get: user, set: setUser } }, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Layout, { navigation, theme: props.theme, children: [
3275
+ "\xA8",
3276
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogsProvider, { children: props.children })
3277
+ ] }) }) }) });
3278
+ };
3279
+
3280
+ // src/index.ts
3281
+ var import_uuidv72 = require("uuidv7");
3282
+
3283
+ // src/hooks/FormHooks.ts
3284
+ var import_react_form = require("@tanstack/react-form");
3285
+
3286
+ // src/components/form/FormAutocomplete.tsx
3287
+ var import_material23 = require("@mui/material");
3288
+
3289
+ // src/utils/FormUtils.ts
3290
+ var getFieldStatus = (field) => {
3291
+ const { meta } = field.state;
3292
+ const isTouched = meta.isTouched;
3293
+ const hasError = !!meta.errors?.length;
3294
+ const helperText = meta.errors?.[0]?.message;
3295
+ return { isTouched, hasError, helperText };
3296
+ };
3297
+
3298
+ // src/components/form/FormAutocomplete.tsx
3299
+ var import_jsx_runtime30 = require("react/jsx-runtime");
3300
+ var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
3301
+ const field = useFieldContext();
3302
+ const { isTouched, hasError, helperText } = getFieldStatus(field);
3303
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3304
+ import_material23.Autocomplete,
3305
+ {
3306
+ value: field.state.value,
3307
+ onChange: (_, value) => !autocompleteProps.freeSolo && field.handleChange(value),
3308
+ onInputChange: (_, value, reason) => reason !== "reset" && autocompleteProps.freeSolo && field.handleChange(value),
3309
+ onBlur: field.handleBlur,
3310
+ "aria-label": field.name,
3311
+ ...autocompleteProps,
3312
+ renderInput: (parameters) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3313
+ import_material23.TextField,
3314
+ {
3315
+ ...parameters,
3316
+ name: field.name,
3317
+ error: isTouched && hasError,
3318
+ helperText: isTouched && helperText,
3319
+ ...textFieldProps
3320
+ }
3321
+ )
3322
+ }
3323
+ );
3324
+ };
3325
+
3326
+ // src/components/form/FormCheckbox.tsx
3327
+ var import_material24 = require("@mui/material");
3328
+ var import_jsx_runtime31 = require("react/jsx-runtime");
3329
+ var FormCheckbox = (props) => {
3330
+ const field = useFieldContext();
3331
+ const { isTouched, hasError, helperText } = getFieldStatus(field);
3332
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material24.FormControl, { component: "fieldset", children: [
3333
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3334
+ import_material24.FormControlLabel,
3335
+ {
3336
+ control: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3337
+ import_material24.Checkbox,
3338
+ {
3339
+ name: field.name,
3340
+ checked: Boolean(field.state.value),
3341
+ onChange: (event) => field.handleChange(event.target.checked),
3342
+ onBlur: field.handleBlur,
3343
+ "aria-label": field.name,
3344
+ ...props
3345
+ }
3346
+ ),
3347
+ label: props.label ?? ""
3348
+ }
3349
+ ),
3350
+ isTouched && hasError && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material24.FormHelperText, { error: hasError, children: helperText })
3351
+ ] });
3352
+ };
3353
+
3354
+ // src/components/form/FormDatePicker.tsx
3355
+ var import_x_date_pickers_pro = require("@mui/x-date-pickers-pro");
3356
+ var import_dayjs2 = __toESM(require("dayjs"), 1);
3357
+ var import_jsx_runtime32 = require("react/jsx-runtime");
3358
+ var FormDatePicker = (props) => {
3359
+ const field = useFieldContext();
3360
+ const { isTouched, hasError, helperText } = getFieldStatus(field);
3361
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3362
+ import_x_date_pickers_pro.DatePicker,
3363
+ {
3364
+ name: field.name,
3365
+ value: field.state.value ? (0, import_dayjs2.default)(field.state.value) : null,
3366
+ onChange: (value) => field.handleChange(value ? value.format() : null),
3367
+ slotProps: {
3368
+ textField: {
3369
+ onBlur: field.handleBlur,
3370
+ error: isTouched && hasError,
3371
+ helperText: isTouched && helperText,
3372
+ ...props.textFieldProps
3373
+ },
3374
+ ...props.slotProps
3375
+ },
3376
+ "aria-label": field.name,
3377
+ ...props
3378
+ }
3379
+ );
3380
+ };
3381
+
3382
+ // src/components/form/FormDateTimePicker.tsx
3383
+ var import_x_date_pickers_pro2 = require("@mui/x-date-pickers-pro");
3384
+ var import_dayjs3 = __toESM(require("dayjs"), 1);
3385
+ var import_jsx_runtime33 = require("react/jsx-runtime");
3386
+ var FormDateTimePicker = (props) => {
3387
+ const field = useFieldContext();
3388
+ const { isTouched, hasError, helperText } = getFieldStatus(field);
3389
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3390
+ import_x_date_pickers_pro2.DateTimePicker,
3391
+ {
3392
+ name: field.name,
3393
+ value: field.state.value ? (0, import_dayjs3.default)(field.state.value) : null,
3394
+ onChange: (value) => field.handleChange(value ? value.format() : null),
3395
+ slotProps: {
3396
+ textField: {
3397
+ onBlur: field.handleBlur,
3398
+ error: isTouched && hasError,
3399
+ helperText: isTouched && helperText,
3400
+ ...props.textFieldProps
3401
+ },
3402
+ ...props.slotProps
3403
+ },
3404
+ "aria-label": field.name,
3405
+ ...props
3406
+ }
3407
+ );
3408
+ };
3409
+
3410
+ // src/components/form/FormNumberField.tsx
3411
+ var import_material25 = require("@mui/material");
3412
+ var import_react_number_format = require("react-number-format");
3413
+ var import_jsx_runtime34 = require("react/jsx-runtime");
3414
+ var FormNumberField = ({ options, ...props }) => {
3415
+ const field = useFieldContext();
3416
+ const { isTouched, hasError, helperText } = getFieldStatus(field);
3417
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3418
+ import_react_number_format.NumericFormat,
3419
+ {
3420
+ customInput: import_material25.TextField,
3421
+ name: field.name,
3422
+ value: field.state.value ?? "",
3423
+ onValueChange: ({ floatValue }) => field.handleChange(floatValue),
3424
+ onBlur: field.handleBlur,
3425
+ error: isTouched && hasError,
3426
+ helperText: isTouched && helperText,
3427
+ "aria-label": field.name,
3428
+ ...props,
3429
+ ...options
3430
+ }
3431
+ );
3432
+ };
3433
+
3434
+ // src/components/form/FormRadioGroup.tsx
3435
+ var import_material26 = require("@mui/material");
3436
+ var import_jsx_runtime35 = require("react/jsx-runtime");
3437
+ var FormRadioGroup = ({ label, options, ...props }) => {
3438
+ const field = useFieldContext();
3439
+ const { isTouched, hasError, helperText } = getFieldStatus(field);
3440
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_material26.FormControl, { component: "fieldset", children: [
3441
+ label && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material26.FormLabel, { component: "legend", children: label }),
3442
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3443
+ import_material26.RadioGroup,
3444
+ {
3445
+ name: field.name,
3446
+ value: field.state.value ?? "",
3447
+ onChange: (event) => field.handleChange(event.target.value),
3448
+ onBlur: field.handleBlur,
3449
+ "aria-label": field.name,
3450
+ ...props,
3451
+ children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3452
+ import_material26.FormControlLabel,
3453
+ {
3454
+ value: option.value,
3455
+ control: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material26.Radio, {}),
3456
+ label: option.label
3457
+ },
3458
+ option.value
3459
+ ))
3460
+ }
3461
+ ),
3462
+ isTouched && hasError && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material26.FormHelperText, { error: hasError, children: helperText })
3463
+ ] });
3464
+ };
3465
+
3466
+ // src/components/form/FormSlider.tsx
3467
+ var import_material27 = require("@mui/material");
3468
+ var import_jsx_runtime36 = require("react/jsx-runtime");
3469
+ var FormSlider = ({ label, ...props }) => {
3470
+ const field = useFieldContext();
3471
+ const { isTouched, hasError, helperText } = getFieldStatus(field);
3472
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_material27.FormControl, { component: "fieldset", children: [
3473
+ label && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material27.FormLabel, { children: label }),
3474
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3475
+ import_material27.Slider,
3476
+ {
3477
+ name: field.name,
3478
+ value: field.state.value ?? 0,
3479
+ onChange: (_, value) => field.handleChange(Array.isArray(value) ? value[0] : value),
3480
+ onBlur: field.handleBlur,
3481
+ "aria-label": field.name,
3482
+ ...props
3483
+ }
3484
+ ),
3485
+ isTouched && hasError && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material27.FormHelperText, { error: hasError, children: helperText })
3486
+ ] });
3487
+ };
3488
+
3489
+ // src/components/form/FormSubmitButton.tsx
3490
+ var import_material28 = require("@mui/material");
3491
+ var import_jsx_runtime37 = require("react/jsx-runtime");
3492
+ var FormSubmitButton = (props) => {
3493
+ const form = useFormContext();
3494
+ const handleClick = (event) => {
3495
+ event.preventDefault();
3496
+ event.stopPropagation();
3497
+ form.handleSubmit();
3498
+ };
3499
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3500
+ import_material28.Button,
3501
+ {
3502
+ loading: isSubmitting,
3503
+ disabled: !canSubmit,
3504
+ onClick: handleClick,
3505
+ type: "submit",
3506
+ "aria-label": "submit",
3507
+ ...props
3508
+ }
3509
+ ) });
3510
+ };
3511
+
3512
+ // src/components/form/FormSwitch.tsx
3513
+ var import_material29 = require("@mui/material");
3514
+ var import_jsx_runtime38 = require("react/jsx-runtime");
3515
+ var FormSwitch = (props) => {
3516
+ const field = useFieldContext();
3517
+ const { isTouched, hasError, helperText } = getFieldStatus(field);
3518
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_material29.FormControl, { component: "fieldset", children: [
3519
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3520
+ import_material29.FormControlLabel,
3521
+ {
3522
+ control: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3523
+ import_material29.Switch,
3524
+ {
3525
+ name: field.name,
3526
+ checked: Boolean(field.state.value),
3527
+ onChange: (event) => field.handleChange(event.target.checked),
3528
+ onBlur: field.handleBlur,
3529
+ "aria-label": field.name,
3530
+ ...props
3531
+ }
3532
+ ),
3533
+ label: props.label ?? ""
3534
+ }
3535
+ ),
3536
+ isTouched && hasError && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material29.FormHelperText, { error: hasError, children: helperText })
3537
+ ] });
3538
+ };
3539
+
3540
+ // src/components/form/FormTextField.tsx
3541
+ var import_material30 = require("@mui/material");
3542
+ var import_jsx_runtime39 = require("react/jsx-runtime");
3543
+ var FormTextField = (props) => {
3544
+ const field = useFieldContext();
3545
+ const { isTouched, hasError, helperText } = getFieldStatus(field);
3546
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3547
+ import_material30.TextField,
3548
+ {
3549
+ name: field.name,
3550
+ value: field.state.value ?? "",
3551
+ onChange: (event) => field.handleChange(event.target.value),
3552
+ onBlur: field.handleBlur,
3553
+ error: isTouched && hasError,
3554
+ helperText: isTouched && helperText,
3555
+ "aria-label": field.name,
3556
+ ...props
3557
+ }
3558
+ );
3559
+ };
3560
+
3561
+ // src/hooks/FormHooks.ts
3562
+ var { fieldContext, useFieldContext, formContext, useFormContext } = (0, import_react_form.createFormHookContexts)();
3563
+ var { useAppForm: useLayoutForm, withForm: withLayoutForm } = (0, import_react_form.createFormHook)({
3564
+ fieldComponents: {
3565
+ TextField: FormTextField,
3566
+ NumberField: FormNumberField,
3567
+ Autocomplete: FormAutocomplete,
3568
+ Checkbox: FormCheckbox,
3569
+ Switch: FormSwitch,
3570
+ RadioGroup: FormRadioGroup,
3571
+ Slider: FormSlider,
3572
+ DatePicker: FormDatePicker,
3573
+ DateTimePicker: FormDateTimePicker
3574
+ },
3575
+ formComponents: {
3576
+ SubmitButton: FormSubmitButton
3577
+ },
3578
+ fieldContext,
3579
+ formContext
3580
+ });
3581
+
3582
+ // src/index.ts
3583
+ var import_use_local_storage_state2 = __toESM(require("use-local-storage-state"), 1);
3584
+ var import_react_i18next9 = require("react-i18next");
3585
+ var import_i18next3 = require("i18next");
3586
+ // Annotate the CommonJS export names for ESM import in node:
3587
+ 0 && (module.exports = {
3588
+ ChipInputCell,
3589
+ Dropzone,
3590
+ EditableColumnHeader,
3591
+ FileViewer,
3592
+ LayoutProvider,
3593
+ PageHeader,
3594
+ Platform,
3595
+ RouterButton,
3596
+ RouterError,
3597
+ RouterGridActionsCellItem,
3598
+ RouterIconButton,
3599
+ RouterLink,
3600
+ RouterListItemButton,
3601
+ RouterNotFound,
3602
+ RouterTab,
3603
+ TableContainer,
3604
+ TypographyWithIcon,
3605
+ rootRouteHead,
3606
+ t,
3607
+ useDeleteFile,
3608
+ useDeleteFiles,
3609
+ useDialogs,
3610
+ useDownloadFile,
3611
+ useFieldContext,
3612
+ useFormContext,
3613
+ useGetFile,
3614
+ useGetFileMetas,
3615
+ useGetFileThumbnail,
3616
+ useLayoutForm,
3617
+ useLocalStorageState,
3618
+ useOpenFile,
3619
+ useTranslation,
3620
+ useUpdateFileMeta,
3621
+ useUploadFile,
3622
+ uuidv7,
3623
+ wczApiClient,
3624
+ withLayoutForm
3625
+ });
3626
+ /*! Bundled license information:
3627
+
3628
+ react-is/cjs/react-is.production.min.js:
3629
+ (** @license React v16.13.1
3630
+ * react-is.production.min.js
3631
+ *
3632
+ * Copyright (c) Facebook, Inc. and its affiliates.
3633
+ *
3634
+ * This source code is licensed under the MIT license found in the
3635
+ * LICENSE file in the root directory of this source tree.
3636
+ *)
3637
+
3638
+ react-is/cjs/react-is.development.js:
3639
+ (** @license React v16.13.1
3640
+ * react-is.development.js
3641
+ *
3642
+ * Copyright (c) Facebook, Inc. and its affiliates.
3643
+ *
3644
+ * This source code is licensed under the MIT license found in the
3645
+ * LICENSE file in the root directory of this source tree.
3646
+ *)
3647
+
3648
+ object-assign/index.js:
3649
+ (*
3650
+ object-assign
3651
+ (c) Sindre Sorhus
3652
+ @license MIT
3653
+ *)
3654
+ */
3655
+ //# sourceMappingURL=index.cjs.map