sera-components 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/basic/Menu.d.ts +28 -29
- package/dist/basic/index.d.ts +0 -1
- package/dist/data/display/index.d.ts +4 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1030 -1020
- package/dist/index.umd.cjs +5 -5
- package/package.json +3 -2
- package/dist/basic/ExternalComponent.d.ts +0 -16
- package/dist/types.d.ts +0 -5
package/dist/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import { Paper as
|
|
7
|
-
import { IconCheck as
|
|
8
|
-
import { observer as
|
|
9
|
-
import { isObjectProperty as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
1
|
+
var on = Object.defineProperty;
|
|
2
|
+
var ln = (e, n, t) => n in e ? on(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var X = (e, n, t) => ln(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import * as f from "react";
|
|
5
|
+
import sn, { createContext as un, useContext as ke, useMemo as k, useState as _, useEffect as Te } from "react";
|
|
6
|
+
import { Paper as re, Image as cn, Text as E, Menu as ie, Button as q, Container as dn, Alert as qe, Stack as ge, Flex as B, Loader as Re, NavLink as it, Checkbox as me, Group as D, Input as W, useCombobox as St, Combobox as F, Grid as A, InputBase as fn, PasswordInput as hn, CloseButton as mn, Divider as gn, Tooltip as Ct, Fieldset as pn, Table as Rt, rem as ce, Pagination as xn, MenuTarget as vn, MenuDropdown as yn, MenuItem as bn, Tabs as ve } from "@mantine/core";
|
|
7
|
+
import { IconCheck as wn, IconInfoCircle as We, IconChevronRight as jn, IconSearch as Et, IconHelpOctagonFilled as kt, IconPlus as Sn, IconPencil as Cn, IconReload as Rn, IconDatabaseImport as En, IconDownload as kn, IconSelector as Tn } from "@tabler/icons-react";
|
|
8
|
+
import { observer as ee } from "mobx-react-lite";
|
|
9
|
+
import { isObjectProperty as se, isDraftRecord as Tt } from "sera-db";
|
|
10
|
+
import { InternalLink as Nt } from "sera-route";
|
|
11
|
+
import { IMaskInput as Nn } from "react-imask";
|
|
12
|
+
import { flexRender as lt, useReactTable as Pt, getCoreRowModel as It, getPaginationRowModel as Pn } from "@tanstack/react-table";
|
|
13
|
+
var ye = { exports: {} }, de = {};
|
|
13
14
|
/**
|
|
14
15
|
* @license React
|
|
15
16
|
* react-jsx-runtime.production.js
|
|
@@ -19,10 +20,10 @@ var be = { exports: {} }, fe = {};
|
|
|
19
20
|
* This source code is licensed under the MIT license found in the
|
|
20
21
|
* LICENSE file in the root directory of this source tree.
|
|
21
22
|
*/
|
|
22
|
-
var
|
|
23
|
-
function
|
|
24
|
-
if (
|
|
25
|
-
|
|
23
|
+
var st;
|
|
24
|
+
function In() {
|
|
25
|
+
if (st) return de;
|
|
26
|
+
st = 1;
|
|
26
27
|
var e = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
27
28
|
function t(a, r, o) {
|
|
28
29
|
var l = null;
|
|
@@ -39,9 +40,9 @@ function Ln() {
|
|
|
39
40
|
props: o
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
|
-
return
|
|
43
|
+
return de.Fragment = n, de.jsx = t, de.jsxs = t, de;
|
|
43
44
|
}
|
|
44
|
-
var
|
|
45
|
+
var fe = {};
|
|
45
46
|
/**
|
|
46
47
|
* @license React
|
|
47
48
|
* react-jsx-runtime.development.js
|
|
@@ -51,152 +52,152 @@ var he = {};
|
|
|
51
52
|
* This source code is licensed under the MIT license found in the
|
|
52
53
|
* LICENSE file in the root directory of this source tree.
|
|
53
54
|
*/
|
|
54
|
-
var
|
|
55
|
-
function
|
|
56
|
-
return
|
|
57
|
-
function e(
|
|
58
|
-
if (
|
|
59
|
-
if (typeof
|
|
60
|
-
return
|
|
61
|
-
if (typeof
|
|
62
|
-
switch (
|
|
63
|
-
case
|
|
55
|
+
var ut;
|
|
56
|
+
function Ln() {
|
|
57
|
+
return ut || (ut = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
58
|
+
function e(h) {
|
|
59
|
+
if (h == null) return null;
|
|
60
|
+
if (typeof h == "function")
|
|
61
|
+
return h.$$typeof === G ? null : h.displayName || h.name || null;
|
|
62
|
+
if (typeof h == "string") return h;
|
|
63
|
+
switch (h) {
|
|
64
|
+
case p:
|
|
64
65
|
return "Fragment";
|
|
65
|
-
case
|
|
66
|
+
case S:
|
|
66
67
|
return "Profiler";
|
|
67
|
-
case
|
|
68
|
+
case w:
|
|
68
69
|
return "StrictMode";
|
|
69
|
-
case
|
|
70
|
+
case R:
|
|
70
71
|
return "Suspense";
|
|
71
|
-
case
|
|
72
|
+
case U:
|
|
72
73
|
return "SuspenseList";
|
|
73
|
-
case
|
|
74
|
+
case $:
|
|
74
75
|
return "Activity";
|
|
75
76
|
}
|
|
76
|
-
if (typeof
|
|
77
|
-
switch (typeof
|
|
77
|
+
if (typeof h == "object")
|
|
78
|
+
switch (typeof h.tag == "number" && console.error(
|
|
78
79
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
79
|
-
),
|
|
80
|
-
case x:
|
|
81
|
-
return "Portal";
|
|
80
|
+
), h.$$typeof) {
|
|
82
81
|
case v:
|
|
83
|
-
return
|
|
82
|
+
return "Portal";
|
|
84
83
|
case y:
|
|
85
|
-
return (
|
|
86
|
-
case
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return
|
|
91
|
-
case
|
|
92
|
-
|
|
84
|
+
return (h.displayName || "Context") + ".Provider";
|
|
85
|
+
case b:
|
|
86
|
+
return (h._context.displayName || "Context") + ".Consumer";
|
|
87
|
+
case j:
|
|
88
|
+
var C = h.render;
|
|
89
|
+
return h = h.displayName, h || (h = C.displayName || C.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
|
|
90
|
+
case M:
|
|
91
|
+
return C = h.displayName || null, C !== null ? C : e(h.type) || "Memo";
|
|
92
|
+
case ne:
|
|
93
|
+
C = h._payload, h = h._init;
|
|
93
94
|
try {
|
|
94
|
-
return e(
|
|
95
|
+
return e(h(C));
|
|
95
96
|
} catch {
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
return null;
|
|
99
100
|
}
|
|
100
|
-
function n(
|
|
101
|
-
return "" +
|
|
101
|
+
function n(h) {
|
|
102
|
+
return "" + h;
|
|
102
103
|
}
|
|
103
|
-
function t(
|
|
104
|
+
function t(h) {
|
|
104
105
|
try {
|
|
105
|
-
n(
|
|
106
|
-
var
|
|
106
|
+
n(h);
|
|
107
|
+
var C = !1;
|
|
107
108
|
} catch {
|
|
108
|
-
|
|
109
|
+
C = !0;
|
|
109
110
|
}
|
|
110
|
-
if (
|
|
111
|
-
|
|
112
|
-
var
|
|
113
|
-
return
|
|
114
|
-
|
|
111
|
+
if (C) {
|
|
112
|
+
C = console;
|
|
113
|
+
var T = C.error, I = typeof Symbol == "function" && Symbol.toStringTag && h[Symbol.toStringTag] || h.constructor.name || "Object";
|
|
114
|
+
return T.call(
|
|
115
|
+
C,
|
|
115
116
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
116
117
|
I
|
|
117
|
-
), n(
|
|
118
|
+
), n(h);
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
|
-
function a(
|
|
121
|
-
if (
|
|
122
|
-
if (typeof
|
|
121
|
+
function a(h) {
|
|
122
|
+
if (h === p) return "<>";
|
|
123
|
+
if (typeof h == "object" && h !== null && h.$$typeof === ne)
|
|
123
124
|
return "<...>";
|
|
124
125
|
try {
|
|
125
|
-
var
|
|
126
|
-
return
|
|
126
|
+
var C = e(h);
|
|
127
|
+
return C ? "<" + C + ">" : "<...>";
|
|
127
128
|
} catch {
|
|
128
129
|
return "<...>";
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
function r() {
|
|
132
|
-
var
|
|
133
|
-
return
|
|
133
|
+
var h = ae.A;
|
|
134
|
+
return h === null ? null : h.getOwner();
|
|
134
135
|
}
|
|
135
136
|
function o() {
|
|
136
137
|
return Error("react-stack-top-frame");
|
|
137
138
|
}
|
|
138
|
-
function l(
|
|
139
|
-
if (
|
|
140
|
-
var
|
|
141
|
-
if (
|
|
139
|
+
function l(h) {
|
|
140
|
+
if (et.call(h, "key")) {
|
|
141
|
+
var C = Object.getOwnPropertyDescriptor(h, "key").get;
|
|
142
|
+
if (C && C.isReactWarning) return !1;
|
|
142
143
|
}
|
|
143
|
-
return
|
|
144
|
+
return h.key !== void 0;
|
|
144
145
|
}
|
|
145
|
-
function s(
|
|
146
|
-
function
|
|
147
|
-
|
|
146
|
+
function s(h, C) {
|
|
147
|
+
function T() {
|
|
148
|
+
tt || (tt = !0, console.error(
|
|
148
149
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
149
|
-
|
|
150
|
+
C
|
|
150
151
|
));
|
|
151
152
|
}
|
|
152
|
-
|
|
153
|
-
get:
|
|
153
|
+
T.isReactWarning = !0, Object.defineProperty(h, "key", {
|
|
154
|
+
get: T,
|
|
154
155
|
configurable: !0
|
|
155
156
|
});
|
|
156
157
|
}
|
|
157
158
|
function u() {
|
|
158
|
-
var
|
|
159
|
-
return
|
|
159
|
+
var h = e(this.type);
|
|
160
|
+
return nt[h] || (nt[h] = !0, console.error(
|
|
160
161
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
161
|
-
)),
|
|
162
|
+
)), h = this.props.ref, h !== void 0 ? h : null;
|
|
162
163
|
}
|
|
163
|
-
function c(
|
|
164
|
-
return
|
|
165
|
-
$$typeof:
|
|
166
|
-
type:
|
|
167
|
-
key:
|
|
168
|
-
props:
|
|
169
|
-
_owner:
|
|
170
|
-
}, (
|
|
164
|
+
function c(h, C, T, I, J, z, _e, $e) {
|
|
165
|
+
return T = z.ref, h = {
|
|
166
|
+
$$typeof: m,
|
|
167
|
+
type: h,
|
|
168
|
+
key: C,
|
|
169
|
+
props: z,
|
|
170
|
+
_owner: J
|
|
171
|
+
}, (T !== void 0 ? T : null) !== null ? Object.defineProperty(h, "ref", {
|
|
171
172
|
enumerable: !1,
|
|
172
173
|
get: u
|
|
173
|
-
}) : Object.defineProperty(
|
|
174
|
+
}) : Object.defineProperty(h, "ref", { enumerable: !1, value: null }), h._store = {}, Object.defineProperty(h._store, "validated", {
|
|
174
175
|
configurable: !1,
|
|
175
176
|
enumerable: !1,
|
|
176
177
|
writable: !0,
|
|
177
178
|
value: 0
|
|
178
|
-
}), Object.defineProperty(
|
|
179
|
+
}), Object.defineProperty(h, "_debugInfo", {
|
|
179
180
|
configurable: !1,
|
|
180
181
|
enumerable: !1,
|
|
181
182
|
writable: !0,
|
|
182
183
|
value: null
|
|
183
|
-
}), Object.defineProperty(
|
|
184
|
+
}), Object.defineProperty(h, "_debugStack", {
|
|
184
185
|
configurable: !1,
|
|
185
186
|
enumerable: !1,
|
|
186
187
|
writable: !0,
|
|
187
|
-
value:
|
|
188
|
-
}), Object.defineProperty(
|
|
188
|
+
value: _e
|
|
189
|
+
}), Object.defineProperty(h, "_debugTask", {
|
|
189
190
|
configurable: !1,
|
|
190
191
|
enumerable: !1,
|
|
191
192
|
writable: !0,
|
|
192
|
-
value:
|
|
193
|
-
}), Object.freeze && (Object.freeze(
|
|
193
|
+
value: $e
|
|
194
|
+
}), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
|
|
194
195
|
}
|
|
195
|
-
function d(
|
|
196
|
-
var L =
|
|
196
|
+
function d(h, C, T, I, J, z, _e, $e) {
|
|
197
|
+
var L = C.children;
|
|
197
198
|
if (L !== void 0)
|
|
198
199
|
if (I)
|
|
199
|
-
if (
|
|
200
|
+
if (rn(L)) {
|
|
200
201
|
for (I = 0; I < L.length; I++)
|
|
201
202
|
g(L[I]);
|
|
202
203
|
Object.freeze && Object.freeze(L);
|
|
@@ -205,12 +206,12 @@ function Fn() {
|
|
|
205
206
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
206
207
|
);
|
|
207
208
|
else g(L);
|
|
208
|
-
if (
|
|
209
|
-
L = e(
|
|
210
|
-
var oe = Object.keys(
|
|
211
|
-
return
|
|
209
|
+
if (et.call(C, "key")) {
|
|
210
|
+
L = e(h);
|
|
211
|
+
var oe = Object.keys(C).filter(function(an) {
|
|
212
|
+
return an !== "key";
|
|
212
213
|
});
|
|
213
|
-
I = 0 < oe.length ? "{key: someKey, " + oe.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
214
|
+
I = 0 < oe.length ? "{key: someKey, " + oe.join(": ..., ") + ": ...}" : "{key: someKey}", ot[L + I] || (oe = 0 < oe.length ? "{" + oe.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
214
215
|
`A props object containing a "key" prop is being spread into JSX:
|
|
215
216
|
let props = %s;
|
|
216
217
|
<%s {...props} />
|
|
@@ -221,74 +222,74 @@ React keys must be passed directly to JSX without using spread:
|
|
|
221
222
|
L,
|
|
222
223
|
oe,
|
|
223
224
|
L
|
|
224
|
-
),
|
|
225
|
+
), ot[L + I] = !0);
|
|
225
226
|
}
|
|
226
|
-
if (L = null,
|
|
227
|
-
|
|
228
|
-
for (var Oe in
|
|
229
|
-
Oe !== "key" && (
|
|
230
|
-
} else
|
|
227
|
+
if (L = null, T !== void 0 && (t(T), L = "" + T), l(C) && (t(C.key), L = "" + C.key), "key" in C) {
|
|
228
|
+
T = {};
|
|
229
|
+
for (var Oe in C)
|
|
230
|
+
Oe !== "key" && (T[Oe] = C[Oe]);
|
|
231
|
+
} else T = C;
|
|
231
232
|
return L && s(
|
|
232
|
-
|
|
233
|
-
typeof
|
|
233
|
+
T,
|
|
234
|
+
typeof h == "function" ? h.displayName || h.name || "Unknown" : h
|
|
234
235
|
), c(
|
|
235
|
-
|
|
236
|
+
h,
|
|
236
237
|
L,
|
|
237
|
-
|
|
238
|
-
|
|
238
|
+
z,
|
|
239
|
+
J,
|
|
239
240
|
r(),
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
T,
|
|
242
|
+
_e,
|
|
243
|
+
$e
|
|
243
244
|
);
|
|
244
245
|
}
|
|
245
|
-
function g(
|
|
246
|
-
typeof
|
|
246
|
+
function g(h) {
|
|
247
|
+
typeof h == "object" && h !== null && h.$$typeof === m && h._store && (h._store.validated = 1);
|
|
247
248
|
}
|
|
248
|
-
var
|
|
249
|
+
var x = sn, m = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), y = Symbol.for("react.context"), j = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), U = Symbol.for("react.suspense_list"), M = Symbol.for("react.memo"), ne = Symbol.for("react.lazy"), $ = Symbol.for("react.activity"), G = Symbol.for("react.client.reference"), ae = x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, et = Object.prototype.hasOwnProperty, rn = Array.isArray, Ae = console.createTask ? console.createTask : function() {
|
|
249
250
|
return null;
|
|
250
251
|
};
|
|
251
|
-
|
|
252
|
-
react_stack_bottom_frame: function(
|
|
253
|
-
return
|
|
252
|
+
x = {
|
|
253
|
+
react_stack_bottom_frame: function(h) {
|
|
254
|
+
return h();
|
|
254
255
|
}
|
|
255
256
|
};
|
|
256
|
-
var
|
|
257
|
-
|
|
257
|
+
var tt, nt = {}, rt = x.react_stack_bottom_frame.bind(
|
|
258
|
+
x,
|
|
258
259
|
o
|
|
259
|
-
)(),
|
|
260
|
-
|
|
261
|
-
var
|
|
260
|
+
)(), at = Ae(a(o)), ot = {};
|
|
261
|
+
fe.Fragment = p, fe.jsx = function(h, C, T, I, J) {
|
|
262
|
+
var z = 1e4 > ae.recentlyCreatedOwnerStacks++;
|
|
262
263
|
return d(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
h,
|
|
265
|
+
C,
|
|
266
|
+
T,
|
|
266
267
|
!1,
|
|
267
268
|
I,
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
J,
|
|
270
|
+
z ? Error("react-stack-top-frame") : rt,
|
|
271
|
+
z ? Ae(a(h)) : at
|
|
271
272
|
);
|
|
272
|
-
},
|
|
273
|
-
var
|
|
273
|
+
}, fe.jsxs = function(h, C, T, I, J) {
|
|
274
|
+
var z = 1e4 > ae.recentlyCreatedOwnerStacks++;
|
|
274
275
|
return d(
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
h,
|
|
277
|
+
C,
|
|
278
|
+
T,
|
|
278
279
|
!0,
|
|
279
280
|
I,
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
J,
|
|
282
|
+
z ? Error("react-stack-top-frame") : rt,
|
|
283
|
+
z ? Ae(a(h)) : at
|
|
283
284
|
);
|
|
284
285
|
};
|
|
285
|
-
})()),
|
|
286
|
+
})()), fe;
|
|
286
287
|
}
|
|
287
|
-
var
|
|
288
|
-
function
|
|
289
|
-
return
|
|
288
|
+
var ct;
|
|
289
|
+
function Fn() {
|
|
290
|
+
return ct || (ct = 1, process.env.NODE_ENV === "production" ? ye.exports = In() : ye.exports = Ln()), ye.exports;
|
|
290
291
|
}
|
|
291
|
-
var i =
|
|
292
|
+
var i = Fn();
|
|
292
293
|
const N = {
|
|
293
294
|
UK: {
|
|
294
295
|
svgFlag: "https://flagcdn.com/gb.svg",
|
|
@@ -350,24 +351,24 @@ const N = {
|
|
|
350
351
|
svgFlag: "https://flagcdn.com/in.svg",
|
|
351
352
|
emojiFlag: "🇮🇳"
|
|
352
353
|
}
|
|
353
|
-
},
|
|
354
|
-
|
|
354
|
+
}, An = ({ flag: e }) => /* @__PURE__ */ i.jsx(re, { shadow: "xs", w: 20, h: 14, children: /* @__PURE__ */ i.jsx(cn, { src: e.svgFlag, w: 20, h: 14, fit: "cover" }) }), _n = ({ flag: e }) => /* @__PURE__ */ i.jsx(
|
|
355
|
+
E,
|
|
355
356
|
{
|
|
356
357
|
component: "span",
|
|
357
358
|
style: (n) => ({ textShadow: n.shadows.xs }),
|
|
358
359
|
children: e.emojiFlag
|
|
359
360
|
}
|
|
360
|
-
), Be = navigator.userAgent.includes("Windows") ?
|
|
361
|
+
), Be = navigator.userAgent.includes("Windows") ? An : _n, pe = un(new Intl.Locale("en-US")), Xa = ee(
|
|
361
362
|
({
|
|
362
363
|
value: e,
|
|
363
364
|
children: n
|
|
364
|
-
}) => /* @__PURE__ */ i.jsx(
|
|
365
|
-
),
|
|
365
|
+
}) => /* @__PURE__ */ i.jsx(pe.Provider, { value: e.locale, children: n })
|
|
366
|
+
), $n = {
|
|
366
367
|
lang2value: {
|
|
367
368
|
en: "Choose Language",
|
|
368
369
|
vi: "Chọn ngôn ngữ"
|
|
369
370
|
}
|
|
370
|
-
},
|
|
371
|
+
}, be = {
|
|
371
372
|
en: {
|
|
372
373
|
name: "English",
|
|
373
374
|
flag: N.US,
|
|
@@ -378,39 +379,39 @@ const N = {
|
|
|
378
379
|
flag: N.VN,
|
|
379
380
|
locale: new Intl.Locale("vi-VN")
|
|
380
381
|
}
|
|
381
|
-
},
|
|
382
|
+
}, Za = ({
|
|
382
383
|
locale: e,
|
|
383
384
|
setLocale: n
|
|
384
385
|
}) => {
|
|
385
|
-
const t =
|
|
386
|
+
const t = k(() => Object.entries(be).map(
|
|
386
387
|
([a, { flag: r, name: o, locale: l }]) => /* @__PURE__ */ i.jsx(
|
|
387
388
|
ie.Item,
|
|
388
389
|
{
|
|
389
390
|
onClick: () => n(l),
|
|
390
391
|
leftSection: /* @__PURE__ */ i.jsx(Be, { flag: r }),
|
|
391
|
-
rightSection: e.language === a && /* @__PURE__ */ i.jsx(
|
|
392
|
-
children: /* @__PURE__ */ i.jsx(
|
|
392
|
+
rightSection: e.language === a && /* @__PURE__ */ i.jsx(wn, { size: "15", color: "#2986cc", stroke: 2 }),
|
|
393
|
+
children: /* @__PURE__ */ i.jsx(E, { size: "sm", children: o })
|
|
393
394
|
},
|
|
394
395
|
a
|
|
395
396
|
)
|
|
396
|
-
), [
|
|
397
|
+
), [be, e]);
|
|
397
398
|
return /* @__PURE__ */ i.jsxs(ie, { width: 170, children: [
|
|
398
399
|
/* @__PURE__ */ i.jsx(ie.Target, { children: /* @__PURE__ */ i.jsx(
|
|
399
|
-
|
|
400
|
+
q,
|
|
400
401
|
{
|
|
401
402
|
variant: "subtle",
|
|
402
403
|
size: "sm",
|
|
403
|
-
leftSection: /* @__PURE__ */ i.jsx(Be, { flag:
|
|
404
|
-
children: /* @__PURE__ */ i.jsx(
|
|
404
|
+
leftSection: /* @__PURE__ */ i.jsx(Be, { flag: be[e.language].flag }),
|
|
405
|
+
children: /* @__PURE__ */ i.jsx(E, { size: "sm", children: be[e.language].name })
|
|
405
406
|
}
|
|
406
407
|
) }),
|
|
407
408
|
/* @__PURE__ */ i.jsxs(ie.Dropdown, { children: [
|
|
408
|
-
/* @__PURE__ */ i.jsx(ie.Label, { children: /* @__PURE__ */ i.jsx(
|
|
409
|
+
/* @__PURE__ */ i.jsx(ie.Label, { children: /* @__PURE__ */ i.jsx(E, { size: "sm", children: $n.lang2value[e.language] }) }),
|
|
409
410
|
t
|
|
410
411
|
] })
|
|
411
412
|
] });
|
|
412
413
|
}, O = ({ value: e }) => {
|
|
413
|
-
const n =
|
|
414
|
+
const n = ke(pe);
|
|
414
415
|
return e.lang2value[n.language] || e.lang2value[e.lang];
|
|
415
416
|
};
|
|
416
417
|
/**
|
|
@@ -427,7 +428,7 @@ function P(e, n) {
|
|
|
427
428
|
if (e === !1 || e === null || typeof e > "u")
|
|
428
429
|
throw new Error(n);
|
|
429
430
|
}
|
|
430
|
-
function
|
|
431
|
+
function V(e, n) {
|
|
431
432
|
if (!e) {
|
|
432
433
|
typeof console < "u" && console.warn(n);
|
|
433
434
|
try {
|
|
@@ -443,7 +444,7 @@ function Ue({
|
|
|
443
444
|
}) {
|
|
444
445
|
return n && n !== "?" && (e += n.charAt(0) === "?" ? n : "?" + n), t && t !== "#" && (e += t.charAt(0) === "#" ? t : "#" + t), e;
|
|
445
446
|
}
|
|
446
|
-
function
|
|
447
|
+
function Ke(e) {
|
|
447
448
|
let n = {};
|
|
448
449
|
if (e) {
|
|
449
450
|
let t = e.indexOf("#");
|
|
@@ -453,19 +454,19 @@ function Ve(e) {
|
|
|
453
454
|
}
|
|
454
455
|
return n;
|
|
455
456
|
}
|
|
456
|
-
function
|
|
457
|
-
return
|
|
457
|
+
function Lt(e, n, t = "/") {
|
|
458
|
+
return On(e, n, t, !1);
|
|
458
459
|
}
|
|
459
|
-
function
|
|
460
|
-
let r = typeof n == "string" ?
|
|
460
|
+
function On(e, n, t, a) {
|
|
461
|
+
let r = typeof n == "string" ? Ke(n) : n, o = Z(r.pathname || "/", t);
|
|
461
462
|
if (o == null)
|
|
462
463
|
return null;
|
|
463
|
-
let l =
|
|
464
|
-
|
|
464
|
+
let l = Ft(e);
|
|
465
|
+
Dn(l);
|
|
465
466
|
let s = null;
|
|
466
467
|
for (let u = 0; s == null && u < l.length; ++u) {
|
|
467
|
-
let c =
|
|
468
|
-
s =
|
|
468
|
+
let c = Gn(o);
|
|
469
|
+
s = Hn(
|
|
469
470
|
l[u],
|
|
470
471
|
c,
|
|
471
472
|
a
|
|
@@ -473,7 +474,7 @@ function Dn(e, n, t, a) {
|
|
|
473
474
|
}
|
|
474
475
|
return s;
|
|
475
476
|
}
|
|
476
|
-
function
|
|
477
|
+
function Ft(e, n = [], t = [], a = "", r = !1) {
|
|
477
478
|
let o = (l, s, u = r, c) => {
|
|
478
479
|
let d = {
|
|
479
480
|
relativePath: c === void 0 ? l.path || "" : c,
|
|
@@ -489,22 +490,22 @@ function _t(e, n = [], t = [], a = "", r = !1) {
|
|
|
489
490
|
`Absolute route path "${d.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
|
|
490
491
|
), d.relativePath = d.relativePath.slice(a.length);
|
|
491
492
|
}
|
|
492
|
-
let g =
|
|
493
|
+
let g = K([a, d.relativePath]), x = t.concat(d);
|
|
493
494
|
l.children && l.children.length > 0 && (P(
|
|
494
495
|
// Our types know better, but runtime JS may not!
|
|
495
496
|
// @ts-expect-error
|
|
496
497
|
l.index !== !0,
|
|
497
498
|
`Index routes must not have child routes. Please remove all child routes from route path "${g}".`
|
|
498
|
-
),
|
|
499
|
+
), Ft(
|
|
499
500
|
l.children,
|
|
500
501
|
n,
|
|
501
|
-
|
|
502
|
+
x,
|
|
502
503
|
g,
|
|
503
504
|
u
|
|
504
505
|
)), !(l.path == null && !l.index) && n.push({
|
|
505
506
|
path: g,
|
|
506
|
-
score:
|
|
507
|
-
routesMeta:
|
|
507
|
+
score: Kn(g, l.index),
|
|
508
|
+
routesMeta: x
|
|
508
509
|
});
|
|
509
510
|
};
|
|
510
511
|
return e.forEach((l, s) => {
|
|
@@ -512,17 +513,17 @@ function _t(e, n = [], t = [], a = "", r = !1) {
|
|
|
512
513
|
if (l.path === "" || !((u = l.path) != null && u.includes("?")))
|
|
513
514
|
o(l, s);
|
|
514
515
|
else
|
|
515
|
-
for (let c of
|
|
516
|
+
for (let c of At(l.path))
|
|
516
517
|
o(l, s, !0, c);
|
|
517
518
|
}), n;
|
|
518
519
|
}
|
|
519
|
-
function
|
|
520
|
+
function At(e) {
|
|
520
521
|
let n = e.split("/");
|
|
521
522
|
if (n.length === 0) return [];
|
|
522
523
|
let [t, ...a] = n, r = t.endsWith("?"), o = t.replace(/\?$/, "");
|
|
523
524
|
if (a.length === 0)
|
|
524
525
|
return r ? [o, ""] : [o];
|
|
525
|
-
let l =
|
|
526
|
+
let l = At(a.join("/")), s = [];
|
|
526
527
|
return s.push(
|
|
527
528
|
...l.map(
|
|
528
529
|
(u) => u === "" ? o : [o, u].join("/")
|
|
@@ -531,23 +532,23 @@ function $t(e) {
|
|
|
531
532
|
(u) => e.startsWith("/") && u === "" ? "/" : u
|
|
532
533
|
);
|
|
533
534
|
}
|
|
534
|
-
function
|
|
535
|
+
function Dn(e) {
|
|
535
536
|
e.sort(
|
|
536
|
-
(n, t) => n.score !== t.score ? t.score - n.score :
|
|
537
|
+
(n, t) => n.score !== t.score ? t.score - n.score : Vn(
|
|
537
538
|
n.routesMeta.map((a) => a.childrenIndex),
|
|
538
539
|
t.routesMeta.map((a) => a.childrenIndex)
|
|
539
540
|
)
|
|
540
541
|
);
|
|
541
542
|
}
|
|
542
|
-
var
|
|
543
|
-
function
|
|
543
|
+
var Mn = /^:[\w-]+$/, zn = 3, Bn = 2, Un = 1, qn = 10, Wn = -2, dt = (e) => e === "*";
|
|
544
|
+
function Kn(e, n) {
|
|
544
545
|
let t = e.split("/"), a = t.length;
|
|
545
|
-
return t.some(
|
|
546
|
-
(r, o) => r + (
|
|
546
|
+
return t.some(dt) && (a += Wn), n && (a += Bn), t.filter((r) => !dt(r)).reduce(
|
|
547
|
+
(r, o) => r + (Mn.test(o) ? zn : o === "" ? Un : qn),
|
|
547
548
|
a
|
|
548
549
|
);
|
|
549
550
|
}
|
|
550
|
-
function
|
|
551
|
+
function Vn(e, n) {
|
|
551
552
|
return e.length === n.length && e.slice(0, -1).every((a, r) => a === n[r]) ? (
|
|
552
553
|
// If two routes are siblings, we should try to match the earlier sibling
|
|
553
554
|
// first. This allows people to have fine-grained control over the matching
|
|
@@ -560,14 +561,14 @@ function Hn(e, n) {
|
|
|
560
561
|
0
|
|
561
562
|
);
|
|
562
563
|
}
|
|
563
|
-
function
|
|
564
|
+
function Hn(e, n, t = !1) {
|
|
564
565
|
let { routesMeta: a } = e, r = {}, o = "/", l = [];
|
|
565
566
|
for (let s = 0; s < a.length; ++s) {
|
|
566
|
-
let u = a[s], c = s === a.length - 1, d = o === "/" ? n : n.slice(o.length) || "/", g =
|
|
567
|
+
let u = a[s], c = s === a.length - 1, d = o === "/" ? n : n.slice(o.length) || "/", g = Ee(
|
|
567
568
|
{ path: u.relativePath, caseSensitive: u.caseSensitive, end: c },
|
|
568
569
|
d
|
|
569
|
-
),
|
|
570
|
-
if (!g && c && t && !a[a.length - 1].route.index && (g =
|
|
570
|
+
), x = u.route;
|
|
571
|
+
if (!g && c && t && !a[a.length - 1].route.index && (g = Ee(
|
|
571
572
|
{
|
|
572
573
|
path: u.relativePath,
|
|
573
574
|
caseSensitive: u.caseSensitive,
|
|
@@ -579,18 +580,18 @@ function Yn(e, n, t = !1) {
|
|
|
579
580
|
Object.assign(r, g.params), l.push({
|
|
580
581
|
// TODO: Can this as be avoided?
|
|
581
582
|
params: r,
|
|
582
|
-
pathname:
|
|
583
|
-
pathnameBase:
|
|
584
|
-
|
|
583
|
+
pathname: K([o, g.pathname]),
|
|
584
|
+
pathnameBase: Qn(
|
|
585
|
+
K([o, g.pathnameBase])
|
|
585
586
|
),
|
|
586
|
-
route:
|
|
587
|
-
}), g.pathnameBase !== "/" && (o =
|
|
587
|
+
route: x
|
|
588
|
+
}), g.pathnameBase !== "/" && (o = K([o, g.pathnameBase]));
|
|
588
589
|
}
|
|
589
590
|
return l;
|
|
590
591
|
}
|
|
591
|
-
function
|
|
592
|
+
function Ee(e, n) {
|
|
592
593
|
typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
|
|
593
|
-
let [t, a] =
|
|
594
|
+
let [t, a] = Yn(
|
|
594
595
|
e.path,
|
|
595
596
|
e.caseSensitive,
|
|
596
597
|
e.end
|
|
@@ -599,13 +600,13 @@ function ke(e, n) {
|
|
|
599
600
|
let o = r[0], l = o.replace(/(.)\/+$/, "$1"), s = r.slice(1);
|
|
600
601
|
return {
|
|
601
602
|
params: a.reduce(
|
|
602
|
-
(c, { paramName: d, isOptional: g },
|
|
603
|
+
(c, { paramName: d, isOptional: g }, x) => {
|
|
603
604
|
if (d === "*") {
|
|
604
|
-
let
|
|
605
|
-
l = o.slice(0, o.length -
|
|
605
|
+
let v = s[x] || "";
|
|
606
|
+
l = o.slice(0, o.length - v.length).replace(/(.)\/+$/, "$1");
|
|
606
607
|
}
|
|
607
|
-
const
|
|
608
|
-
return g && !
|
|
608
|
+
const m = s[x];
|
|
609
|
+
return g && !m ? c[d] = void 0 : c[d] = (m || "").replace(/%2F/g, "/"), c;
|
|
609
610
|
},
|
|
610
611
|
{}
|
|
611
612
|
),
|
|
@@ -614,8 +615,8 @@ function ke(e, n) {
|
|
|
614
615
|
pattern: e
|
|
615
616
|
};
|
|
616
617
|
}
|
|
617
|
-
function
|
|
618
|
-
|
|
618
|
+
function Yn(e, n = !1, t = !0) {
|
|
619
|
+
V(
|
|
619
620
|
e === "*" || !e.endsWith("*") || e.endsWith("/*"),
|
|
620
621
|
`Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`
|
|
621
622
|
);
|
|
@@ -625,36 +626,36 @@ function Gn(e, n = !1, t = !0) {
|
|
|
625
626
|
).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
|
|
626
627
|
return e.endsWith("*") ? (a.push({ paramName: "*" }), r += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : t ? r += "\\/*$" : e !== "" && e !== "/" && (r += "(?:(?=\\/|$))"), [new RegExp(r, n ? void 0 : "i"), a];
|
|
627
628
|
}
|
|
628
|
-
function
|
|
629
|
+
function Gn(e) {
|
|
629
630
|
try {
|
|
630
631
|
return e.split("/").map((n) => decodeURIComponent(n).replace(/\//g, "%2F")).join("/");
|
|
631
632
|
} catch (n) {
|
|
632
|
-
return
|
|
633
|
+
return V(
|
|
633
634
|
!1,
|
|
634
635
|
`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`
|
|
635
636
|
), e;
|
|
636
637
|
}
|
|
637
638
|
}
|
|
638
|
-
function
|
|
639
|
+
function Z(e, n) {
|
|
639
640
|
if (n === "/") return e;
|
|
640
641
|
if (!e.toLowerCase().startsWith(n.toLowerCase()))
|
|
641
642
|
return null;
|
|
642
643
|
let t = n.endsWith("/") ? n.length - 1 : n.length, a = e.charAt(t);
|
|
643
644
|
return a && a !== "/" ? null : e.slice(t) || "/";
|
|
644
645
|
}
|
|
645
|
-
function
|
|
646
|
+
function Jn(e, n = "/") {
|
|
646
647
|
let {
|
|
647
648
|
pathname: t,
|
|
648
649
|
search: a = "",
|
|
649
650
|
hash: r = ""
|
|
650
|
-
} = typeof e == "string" ?
|
|
651
|
+
} = typeof e == "string" ? Ke(e) : e;
|
|
651
652
|
return {
|
|
652
|
-
pathname: t ? t.startsWith("/") ? t :
|
|
653
|
-
search:
|
|
654
|
-
hash:
|
|
653
|
+
pathname: t ? t.startsWith("/") ? t : Xn(t, n) : n,
|
|
654
|
+
search: er(a),
|
|
655
|
+
hash: tr(r)
|
|
655
656
|
};
|
|
656
657
|
}
|
|
657
|
-
function
|
|
658
|
+
function Xn(e, n) {
|
|
658
659
|
let t = n.replace(/\/+$/, "").split("/");
|
|
659
660
|
return e.split("/").forEach((r) => {
|
|
660
661
|
r === ".." ? t.length > 1 && t.pop() : r !== "." && t.push(r);
|
|
@@ -665,20 +666,20 @@ function De(e, n, t, a) {
|
|
|
665
666
|
a
|
|
666
667
|
)}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
|
|
667
668
|
}
|
|
668
|
-
function
|
|
669
|
+
function Zn(e) {
|
|
669
670
|
return e.filter(
|
|
670
671
|
(n, t) => t === 0 || n.route.path && n.route.path.length > 0
|
|
671
672
|
);
|
|
672
673
|
}
|
|
673
|
-
function
|
|
674
|
-
let n =
|
|
674
|
+
function _t(e) {
|
|
675
|
+
let n = Zn(e);
|
|
675
676
|
return n.map(
|
|
676
677
|
(t, a) => a === n.length - 1 ? t.pathname : t.pathnameBase
|
|
677
678
|
);
|
|
678
679
|
}
|
|
679
|
-
function
|
|
680
|
+
function $t(e, n, t, a = !1) {
|
|
680
681
|
let r;
|
|
681
|
-
typeof e == "string" ? r =
|
|
682
|
+
typeof e == "string" ? r = Ke(e) : (r = { ...e }, P(
|
|
682
683
|
!r.pathname || !r.pathname.includes("?"),
|
|
683
684
|
De("?", "pathname", "search", r)
|
|
684
685
|
), P(
|
|
@@ -694,118 +695,118 @@ function Ot(e, n, t, a = !1) {
|
|
|
694
695
|
else {
|
|
695
696
|
let g = n.length - 1;
|
|
696
697
|
if (!a && l.startsWith("..")) {
|
|
697
|
-
let
|
|
698
|
-
for (;
|
|
699
|
-
|
|
700
|
-
r.pathname =
|
|
698
|
+
let x = l.split("/");
|
|
699
|
+
for (; x[0] === ".."; )
|
|
700
|
+
x.shift(), g -= 1;
|
|
701
|
+
r.pathname = x.join("/");
|
|
701
702
|
}
|
|
702
703
|
s = g >= 0 ? n[g] : "/";
|
|
703
704
|
}
|
|
704
|
-
let u =
|
|
705
|
+
let u = Jn(r, s), c = l && l !== "/" && l.endsWith("/"), d = (o || l === ".") && t.endsWith("/");
|
|
705
706
|
return !u.pathname.endsWith("/") && (c || d) && (u.pathname += "/"), u;
|
|
706
707
|
}
|
|
707
|
-
var
|
|
708
|
-
function
|
|
708
|
+
var K = (e) => e.join("/").replace(/\/\/+/g, "/"), Qn = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), er = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, tr = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
|
|
709
|
+
function nr(e) {
|
|
709
710
|
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
710
711
|
}
|
|
711
|
-
var
|
|
712
|
+
var Ot = [
|
|
712
713
|
"POST",
|
|
713
714
|
"PUT",
|
|
714
715
|
"PATCH",
|
|
715
716
|
"DELETE"
|
|
716
717
|
];
|
|
717
718
|
new Set(
|
|
718
|
-
|
|
719
|
+
Ot
|
|
719
720
|
);
|
|
720
|
-
var
|
|
721
|
+
var rr = [
|
|
721
722
|
"GET",
|
|
722
|
-
...
|
|
723
|
+
...Ot
|
|
723
724
|
];
|
|
724
|
-
new Set(
|
|
725
|
-
var
|
|
726
|
-
|
|
727
|
-
var Ne =
|
|
725
|
+
new Set(rr);
|
|
726
|
+
var ue = f.createContext(null);
|
|
727
|
+
ue.displayName = "DataRouter";
|
|
728
|
+
var Ne = f.createContext(null);
|
|
728
729
|
Ne.displayName = "DataRouterState";
|
|
729
|
-
|
|
730
|
-
var
|
|
730
|
+
f.createContext(!1);
|
|
731
|
+
var Dt = f.createContext({
|
|
731
732
|
isTransitioning: !1
|
|
732
733
|
});
|
|
733
|
-
|
|
734
|
-
var
|
|
734
|
+
Dt.displayName = "ViewTransition";
|
|
735
|
+
var ar = f.createContext(
|
|
735
736
|
/* @__PURE__ */ new Map()
|
|
736
737
|
);
|
|
737
|
-
|
|
738
|
-
var
|
|
739
|
-
|
|
740
|
-
var
|
|
738
|
+
ar.displayName = "Fetchers";
|
|
739
|
+
var or = f.createContext(null);
|
|
740
|
+
or.displayName = "Await";
|
|
741
|
+
var H = f.createContext(
|
|
741
742
|
null
|
|
742
743
|
);
|
|
743
|
-
|
|
744
|
-
var
|
|
744
|
+
H.displayName = "Navigation";
|
|
745
|
+
var Ve = f.createContext(
|
|
745
746
|
null
|
|
746
747
|
);
|
|
747
|
-
|
|
748
|
-
var
|
|
748
|
+
Ve.displayName = "Location";
|
|
749
|
+
var Y = f.createContext({
|
|
749
750
|
outlet: null,
|
|
750
751
|
matches: [],
|
|
751
752
|
isDataRoute: !1
|
|
752
753
|
});
|
|
753
|
-
|
|
754
|
-
var
|
|
755
|
-
|
|
756
|
-
function
|
|
754
|
+
Y.displayName = "Route";
|
|
755
|
+
var He = f.createContext(null);
|
|
756
|
+
He.displayName = "RouteError";
|
|
757
|
+
function ir(e, { relative: n } = {}) {
|
|
757
758
|
P(
|
|
758
759
|
Pe(),
|
|
759
760
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
760
761
|
// router loaded. We can help them understand how to avoid that.
|
|
761
762
|
"useHref() may be used only in the context of a <Router> component."
|
|
762
763
|
);
|
|
763
|
-
let { basename: t, navigator: a } =
|
|
764
|
-
return t !== "/" && (s = o === "/" ? t :
|
|
764
|
+
let { basename: t, navigator: a } = f.useContext(H), { hash: r, pathname: o, search: l } = xe(e, { relative: n }), s = o;
|
|
765
|
+
return t !== "/" && (s = o === "/" ? t : K([t, o])), a.createHref({ pathname: s, search: l, hash: r });
|
|
765
766
|
}
|
|
766
767
|
function Pe() {
|
|
767
|
-
return
|
|
768
|
+
return f.useContext(Ve) != null;
|
|
768
769
|
}
|
|
769
|
-
function
|
|
770
|
+
function te() {
|
|
770
771
|
return P(
|
|
771
772
|
Pe(),
|
|
772
773
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
773
774
|
// router loaded. We can help them understand how to avoid that.
|
|
774
775
|
"useLocation() may be used only in the context of a <Router> component."
|
|
775
|
-
),
|
|
776
|
+
), f.useContext(Ve).location;
|
|
776
777
|
}
|
|
777
|
-
var
|
|
778
|
-
function
|
|
779
|
-
|
|
778
|
+
var Mt = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
779
|
+
function zt(e) {
|
|
780
|
+
f.useContext(H).static || f.useLayoutEffect(e);
|
|
780
781
|
}
|
|
781
|
-
function
|
|
782
|
-
let { isDataRoute: e } =
|
|
783
|
-
return e ?
|
|
782
|
+
function Ye() {
|
|
783
|
+
let { isDataRoute: e } = f.useContext(Y);
|
|
784
|
+
return e ? yr() : lr();
|
|
784
785
|
}
|
|
785
|
-
function
|
|
786
|
+
function lr() {
|
|
786
787
|
P(
|
|
787
788
|
Pe(),
|
|
788
789
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
789
790
|
// router loaded. We can help them understand how to avoid that.
|
|
790
791
|
"useNavigate() may be used only in the context of a <Router> component."
|
|
791
792
|
);
|
|
792
|
-
let e =
|
|
793
|
-
return
|
|
793
|
+
let e = f.useContext(ue), { basename: n, navigator: t } = f.useContext(H), { matches: a } = f.useContext(Y), { pathname: r } = te(), o = JSON.stringify(_t(a)), l = f.useRef(!1);
|
|
794
|
+
return zt(() => {
|
|
794
795
|
l.current = !0;
|
|
795
|
-
}),
|
|
796
|
+
}), f.useCallback(
|
|
796
797
|
(u, c = {}) => {
|
|
797
|
-
if (
|
|
798
|
+
if (V(l.current, Mt), !l.current) return;
|
|
798
799
|
if (typeof u == "number") {
|
|
799
800
|
t.go(u);
|
|
800
801
|
return;
|
|
801
802
|
}
|
|
802
|
-
let d =
|
|
803
|
+
let d = $t(
|
|
803
804
|
u,
|
|
804
805
|
JSON.parse(o),
|
|
805
806
|
r,
|
|
806
807
|
c.relative === "path"
|
|
807
808
|
);
|
|
808
|
-
e == null && n !== "/" && (d.pathname = d.pathname === "/" ? n :
|
|
809
|
+
e == null && n !== "/" && (d.pathname = d.pathname === "/" ? n : K([n, d.pathname])), (c.replace ? t.replace : t.push)(
|
|
809
810
|
d,
|
|
810
811
|
c.state,
|
|
811
812
|
c
|
|
@@ -820,11 +821,11 @@ function sr() {
|
|
|
820
821
|
]
|
|
821
822
|
);
|
|
822
823
|
}
|
|
823
|
-
|
|
824
|
-
function
|
|
825
|
-
let { matches: t } =
|
|
826
|
-
return
|
|
827
|
-
() =>
|
|
824
|
+
f.createContext(null);
|
|
825
|
+
function xe(e, { relative: n } = {}) {
|
|
826
|
+
let { matches: t } = f.useContext(Y), { pathname: a } = te(), r = JSON.stringify(_t(t));
|
|
827
|
+
return f.useMemo(
|
|
828
|
+
() => $t(
|
|
828
829
|
e,
|
|
829
830
|
JSON.parse(r),
|
|
830
831
|
a,
|
|
@@ -833,51 +834,51 @@ function ve(e, { relative: n } = {}) {
|
|
|
833
834
|
[e, r, a, n]
|
|
834
835
|
);
|
|
835
836
|
}
|
|
836
|
-
function
|
|
837
|
+
function sr(e, n, t, a, r) {
|
|
837
838
|
P(
|
|
838
839
|
Pe(),
|
|
839
840
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
840
841
|
// router loaded. We can help them understand how to avoid that.
|
|
841
842
|
"useRoutes() may be used only in the context of a <Router> component."
|
|
842
843
|
);
|
|
843
|
-
let { navigator: o } =
|
|
844
|
+
let { navigator: o } = f.useContext(H), { matches: l } = f.useContext(Y), s = l[l.length - 1], u = s ? s.params : {}, c = s ? s.pathname : "/", d = s ? s.pathnameBase : "/", g = s && s.route;
|
|
844
845
|
{
|
|
845
|
-
let
|
|
846
|
-
|
|
846
|
+
let b = g && g.path || "";
|
|
847
|
+
Bt(
|
|
847
848
|
c,
|
|
848
|
-
!g ||
|
|
849
|
-
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${
|
|
849
|
+
!g || b.endsWith("*") || b.endsWith("*?"),
|
|
850
|
+
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${b}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
850
851
|
|
|
851
|
-
Please change the parent <Route path="${
|
|
852
|
+
Please change the parent <Route path="${b}"> to <Route path="${b === "/" ? "*" : `${b}/*`}">.`
|
|
852
853
|
);
|
|
853
854
|
}
|
|
854
|
-
let
|
|
855
|
-
|
|
856
|
-
let
|
|
855
|
+
let x = te(), m;
|
|
856
|
+
m = x;
|
|
857
|
+
let v = m.pathname || "/", p = v;
|
|
857
858
|
if (d !== "/") {
|
|
858
|
-
let
|
|
859
|
-
|
|
859
|
+
let b = d.replace(/^\//, "").split("/");
|
|
860
|
+
p = "/" + v.replace(/^\//, "").split("/").slice(b.length).join("/");
|
|
860
861
|
}
|
|
861
|
-
let
|
|
862
|
-
return
|
|
863
|
-
g ||
|
|
864
|
-
`No routes matched location "${
|
|
865
|
-
),
|
|
866
|
-
|
|
867
|
-
`Matched leaf route at location "${
|
|
868
|
-
),
|
|
869
|
-
|
|
870
|
-
(
|
|
871
|
-
params: Object.assign({}, u,
|
|
872
|
-
pathname:
|
|
862
|
+
let w = Lt(e, { pathname: p });
|
|
863
|
+
return V(
|
|
864
|
+
g || w != null,
|
|
865
|
+
`No routes matched location "${m.pathname}${m.search}${m.hash}" `
|
|
866
|
+
), V(
|
|
867
|
+
w == null || w[w.length - 1].route.element !== void 0 || w[w.length - 1].route.Component !== void 0 || w[w.length - 1].route.lazy !== void 0,
|
|
868
|
+
`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
|
|
869
|
+
), hr(
|
|
870
|
+
w && w.map(
|
|
871
|
+
(b) => Object.assign({}, b, {
|
|
872
|
+
params: Object.assign({}, u, b.params),
|
|
873
|
+
pathname: K([
|
|
873
874
|
d,
|
|
874
875
|
// Re-encode pathnames that were decoded inside matchRoutes
|
|
875
|
-
o.encodeLocation ? o.encodeLocation(
|
|
876
|
+
o.encodeLocation ? o.encodeLocation(b.pathname).pathname : b.pathname
|
|
876
877
|
]),
|
|
877
|
-
pathnameBase:
|
|
878
|
+
pathnameBase: b.pathnameBase === "/" ? d : K([
|
|
878
879
|
d,
|
|
879
880
|
// Re-encode pathnames that were decoded inside matchRoutes
|
|
880
|
-
o.encodeLocation ? o.encodeLocation(
|
|
881
|
+
o.encodeLocation ? o.encodeLocation(b.pathnameBase).pathname : b.pathnameBase
|
|
881
882
|
])
|
|
882
883
|
})
|
|
883
884
|
),
|
|
@@ -887,14 +888,14 @@ Please change the parent <Route path="${y}"> to <Route path="${y === "/" ? "*" :
|
|
|
887
888
|
r
|
|
888
889
|
);
|
|
889
890
|
}
|
|
890
|
-
function
|
|
891
|
-
let e =
|
|
891
|
+
function ur() {
|
|
892
|
+
let e = vr(), n = nr(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), t = e instanceof Error ? e.stack : null, a = "rgba(200,200,200, 0.5)", r = { padding: "0.5rem", backgroundColor: a }, o = { padding: "2px 4px", backgroundColor: a }, l = null;
|
|
892
893
|
return console.error(
|
|
893
894
|
"Error handled by React Router default ErrorBoundary:",
|
|
894
895
|
e
|
|
895
|
-
), l = /* @__PURE__ */
|
|
896
|
+
), l = /* @__PURE__ */ f.createElement(f.Fragment, null, /* @__PURE__ */ f.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ f.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ f.createElement("code", { style: o }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ f.createElement("code", { style: o }, "errorElement"), " prop on your route.")), /* @__PURE__ */ f.createElement(f.Fragment, null, /* @__PURE__ */ f.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ f.createElement("h3", { style: { fontStyle: "italic" } }, n), t ? /* @__PURE__ */ f.createElement("pre", { style: r }, t) : null, l);
|
|
896
897
|
}
|
|
897
|
-
var
|
|
898
|
+
var cr = /* @__PURE__ */ f.createElement(ur, null), dr = class extends f.Component {
|
|
898
899
|
constructor(e) {
|
|
899
900
|
super(e), this.state = {
|
|
900
901
|
location: e.location,
|
|
@@ -923,8 +924,8 @@ var dr = /* @__PURE__ */ h.createElement(cr, null), fr = class extends h.Compone
|
|
|
923
924
|
);
|
|
924
925
|
}
|
|
925
926
|
render() {
|
|
926
|
-
return this.state.error !== void 0 ? /* @__PURE__ */
|
|
927
|
-
|
|
927
|
+
return this.state.error !== void 0 ? /* @__PURE__ */ f.createElement(Y.Provider, { value: this.props.routeContext }, /* @__PURE__ */ f.createElement(
|
|
928
|
+
He.Provider,
|
|
928
929
|
{
|
|
929
930
|
value: this.state.error,
|
|
930
931
|
children: this.props.component
|
|
@@ -932,11 +933,11 @@ var dr = /* @__PURE__ */ h.createElement(cr, null), fr = class extends h.Compone
|
|
|
932
933
|
)) : this.props.children;
|
|
933
934
|
}
|
|
934
935
|
};
|
|
935
|
-
function
|
|
936
|
-
let a =
|
|
937
|
-
return a && a.static && a.staticContext && (n.route.errorElement || n.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = n.route.id), /* @__PURE__ */
|
|
936
|
+
function fr({ routeContext: e, match: n, children: t }) {
|
|
937
|
+
let a = f.useContext(ue);
|
|
938
|
+
return a && a.static && a.staticContext && (n.route.errorElement || n.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = n.route.id), /* @__PURE__ */ f.createElement(Y.Provider, { value: e }, t);
|
|
938
939
|
}
|
|
939
|
-
function
|
|
940
|
+
function hr(e, n = [], t = null, a = null, r = null) {
|
|
940
941
|
if (e == null) {
|
|
941
942
|
if (!t)
|
|
942
943
|
return null;
|
|
@@ -967,8 +968,8 @@ function mr(e, n = [], t = null, a = null, r = null) {
|
|
|
967
968
|
for (let c = 0; c < o.length; c++) {
|
|
968
969
|
let d = o[c];
|
|
969
970
|
if ((d.route.HydrateFallback || d.route.hydrateFallbackElement) && (u = c), d.route.id) {
|
|
970
|
-
let { loaderData: g, errors:
|
|
971
|
-
if (d.route.lazy ||
|
|
971
|
+
let { loaderData: g, errors: x } = t, m = d.route.loader && !g.hasOwnProperty(d.route.id) && (!x || x[d.route.id] === void 0);
|
|
972
|
+
if (d.route.lazy || m) {
|
|
972
973
|
s = !0, u >= 0 ? o = o.slice(0, u + 1) : o = [o[0]];
|
|
973
974
|
break;
|
|
974
975
|
}
|
|
@@ -976,39 +977,39 @@ function mr(e, n = [], t = null, a = null, r = null) {
|
|
|
976
977
|
}
|
|
977
978
|
return o.reduceRight(
|
|
978
979
|
(c, d, g) => {
|
|
979
|
-
let
|
|
980
|
-
t && (
|
|
980
|
+
let x, m = !1, v = null, p = null;
|
|
981
|
+
t && (x = l && d.route.id ? l[d.route.id] : void 0, v = d.route.errorElement || cr, s && (u < 0 && g === 0 ? (Bt(
|
|
981
982
|
"route-fallback",
|
|
982
983
|
!1,
|
|
983
984
|
"No `HydrateFallback` element provided to render during initial hydration"
|
|
984
|
-
),
|
|
985
|
-
let
|
|
986
|
-
let
|
|
987
|
-
return
|
|
988
|
-
|
|
985
|
+
), m = !0, p = null) : u === g && (m = !0, p = d.route.hydrateFallbackElement || null)));
|
|
986
|
+
let w = n.concat(o.slice(0, g + 1)), S = () => {
|
|
987
|
+
let b;
|
|
988
|
+
return x ? b = v : m ? b = p : d.route.Component ? b = /* @__PURE__ */ f.createElement(d.route.Component, null) : d.route.element ? b = d.route.element : b = c, /* @__PURE__ */ f.createElement(
|
|
989
|
+
fr,
|
|
989
990
|
{
|
|
990
991
|
match: d,
|
|
991
992
|
routeContext: {
|
|
992
993
|
outlet: c,
|
|
993
|
-
matches:
|
|
994
|
+
matches: w,
|
|
994
995
|
isDataRoute: t != null
|
|
995
996
|
},
|
|
996
|
-
children:
|
|
997
|
+
children: b
|
|
997
998
|
}
|
|
998
999
|
);
|
|
999
1000
|
};
|
|
1000
|
-
return t && (d.route.ErrorBoundary || d.route.errorElement || g === 0) ? /* @__PURE__ */
|
|
1001
|
-
|
|
1001
|
+
return t && (d.route.ErrorBoundary || d.route.errorElement || g === 0) ? /* @__PURE__ */ f.createElement(
|
|
1002
|
+
dr,
|
|
1002
1003
|
{
|
|
1003
1004
|
location: t.location,
|
|
1004
1005
|
revalidation: t.revalidation,
|
|
1005
|
-
component:
|
|
1006
|
-
error:
|
|
1007
|
-
children:
|
|
1008
|
-
routeContext: { outlet: null, matches:
|
|
1006
|
+
component: v,
|
|
1007
|
+
error: x,
|
|
1008
|
+
children: S(),
|
|
1009
|
+
routeContext: { outlet: null, matches: w, isDataRoute: !0 },
|
|
1009
1010
|
unstable_onError: a
|
|
1010
1011
|
}
|
|
1011
|
-
) :
|
|
1012
|
+
) : S();
|
|
1012
1013
|
},
|
|
1013
1014
|
null
|
|
1014
1015
|
);
|
|
@@ -1016,34 +1017,34 @@ function mr(e, n = [], t = null, a = null, r = null) {
|
|
|
1016
1017
|
function Ge(e) {
|
|
1017
1018
|
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1018
1019
|
}
|
|
1019
|
-
function
|
|
1020
|
-
let n =
|
|
1020
|
+
function mr(e) {
|
|
1021
|
+
let n = f.useContext(ue);
|
|
1021
1022
|
return P(n, Ge(e)), n;
|
|
1022
1023
|
}
|
|
1023
|
-
function
|
|
1024
|
-
let n =
|
|
1024
|
+
function gr(e) {
|
|
1025
|
+
let n = f.useContext(Ne);
|
|
1025
1026
|
return P(n, Ge(e)), n;
|
|
1026
1027
|
}
|
|
1027
|
-
function
|
|
1028
|
-
let n =
|
|
1028
|
+
function pr(e) {
|
|
1029
|
+
let n = f.useContext(Y);
|
|
1029
1030
|
return P(n, Ge(e)), n;
|
|
1030
1031
|
}
|
|
1031
1032
|
function Je(e) {
|
|
1032
|
-
let n =
|
|
1033
|
+
let n = pr(e), t = n.matches[n.matches.length - 1];
|
|
1033
1034
|
return P(
|
|
1034
1035
|
t.route.id,
|
|
1035
1036
|
`${e} can only be used on routes that contain a unique "id"`
|
|
1036
1037
|
), t.route.id;
|
|
1037
1038
|
}
|
|
1038
|
-
function
|
|
1039
|
+
function xr() {
|
|
1039
1040
|
return Je(
|
|
1040
1041
|
"useRouteId"
|
|
1041
1042
|
/* UseRouteId */
|
|
1042
1043
|
);
|
|
1043
1044
|
}
|
|
1044
|
-
function
|
|
1045
|
+
function vr() {
|
|
1045
1046
|
var a;
|
|
1046
|
-
let e =
|
|
1047
|
+
let e = f.useContext(He), n = gr(
|
|
1047
1048
|
"useRouteError"
|
|
1048
1049
|
/* UseRouteError */
|
|
1049
1050
|
), t = Je(
|
|
@@ -1052,99 +1053,99 @@ function yr() {
|
|
|
1052
1053
|
);
|
|
1053
1054
|
return e !== void 0 ? e : (a = n.errors) == null ? void 0 : a[t];
|
|
1054
1055
|
}
|
|
1055
|
-
function
|
|
1056
|
-
let { router: e } =
|
|
1056
|
+
function yr() {
|
|
1057
|
+
let { router: e } = mr(
|
|
1057
1058
|
"useNavigate"
|
|
1058
1059
|
/* UseNavigateStable */
|
|
1059
1060
|
), n = Je(
|
|
1060
1061
|
"useNavigate"
|
|
1061
1062
|
/* UseNavigateStable */
|
|
1062
|
-
), t =
|
|
1063
|
-
return
|
|
1063
|
+
), t = f.useRef(!1);
|
|
1064
|
+
return zt(() => {
|
|
1064
1065
|
t.current = !0;
|
|
1065
|
-
}),
|
|
1066
|
+
}), f.useCallback(
|
|
1066
1067
|
async (r, o = {}) => {
|
|
1067
|
-
|
|
1068
|
+
V(t.current, Mt), t.current && (typeof r == "number" ? e.navigate(r) : await e.navigate(r, { fromRouteId: n, ...o }));
|
|
1068
1069
|
},
|
|
1069
1070
|
[e, n]
|
|
1070
1071
|
);
|
|
1071
1072
|
}
|
|
1072
|
-
var
|
|
1073
|
-
function
|
|
1074
|
-
!n && !
|
|
1073
|
+
var ft = {};
|
|
1074
|
+
function Bt(e, n, t) {
|
|
1075
|
+
!n && !ft[e] && (ft[e] = !0, V(!1, t));
|
|
1075
1076
|
}
|
|
1076
|
-
|
|
1077
|
-
function
|
|
1077
|
+
f.memo(br);
|
|
1078
|
+
function br({
|
|
1078
1079
|
routes: e,
|
|
1079
1080
|
future: n,
|
|
1080
1081
|
state: t,
|
|
1081
1082
|
unstable_onError: a
|
|
1082
1083
|
}) {
|
|
1083
|
-
return
|
|
1084
|
+
return sr(e, void 0, t, a, n);
|
|
1084
1085
|
}
|
|
1085
|
-
var
|
|
1086
|
+
var Se = "get", Ce = "application/x-www-form-urlencoded";
|
|
1086
1087
|
function Ie(e) {
|
|
1087
1088
|
return e != null && typeof e.tagName == "string";
|
|
1088
1089
|
}
|
|
1089
|
-
function
|
|
1090
|
+
function wr(e) {
|
|
1090
1091
|
return Ie(e) && e.tagName.toLowerCase() === "button";
|
|
1091
1092
|
}
|
|
1092
|
-
function
|
|
1093
|
+
function jr(e) {
|
|
1093
1094
|
return Ie(e) && e.tagName.toLowerCase() === "form";
|
|
1094
1095
|
}
|
|
1095
|
-
function
|
|
1096
|
+
function Sr(e) {
|
|
1096
1097
|
return Ie(e) && e.tagName.toLowerCase() === "input";
|
|
1097
1098
|
}
|
|
1098
|
-
function
|
|
1099
|
+
function Cr(e) {
|
|
1099
1100
|
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
1100
1101
|
}
|
|
1101
|
-
function
|
|
1102
|
+
function Rr(e, n) {
|
|
1102
1103
|
return e.button === 0 && // Ignore everything but left clicks
|
|
1103
1104
|
(!n || n === "_self") && // Let browser handle "target=_blank" etc.
|
|
1104
|
-
!
|
|
1105
|
+
!Cr(e);
|
|
1105
1106
|
}
|
|
1106
|
-
var
|
|
1107
|
-
function
|
|
1108
|
-
if (
|
|
1107
|
+
var we = null;
|
|
1108
|
+
function Er() {
|
|
1109
|
+
if (we === null)
|
|
1109
1110
|
try {
|
|
1110
1111
|
new FormData(
|
|
1111
1112
|
document.createElement("form"),
|
|
1112
1113
|
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
1113
1114
|
0
|
|
1114
|
-
),
|
|
1115
|
+
), we = !1;
|
|
1115
1116
|
} catch {
|
|
1116
|
-
|
|
1117
|
+
we = !0;
|
|
1117
1118
|
}
|
|
1118
|
-
return
|
|
1119
|
+
return we;
|
|
1119
1120
|
}
|
|
1120
|
-
var
|
|
1121
|
+
var kr = /* @__PURE__ */ new Set([
|
|
1121
1122
|
"application/x-www-form-urlencoded",
|
|
1122
1123
|
"multipart/form-data",
|
|
1123
1124
|
"text/plain"
|
|
1124
1125
|
]);
|
|
1125
1126
|
function Me(e) {
|
|
1126
|
-
return e != null && !
|
|
1127
|
+
return e != null && !kr.has(e) ? (V(
|
|
1127
1128
|
!1,
|
|
1128
|
-
`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${
|
|
1129
|
+
`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ce}"`
|
|
1129
1130
|
), null) : e;
|
|
1130
1131
|
}
|
|
1131
|
-
function
|
|
1132
|
+
function Tr(e, n) {
|
|
1132
1133
|
let t, a, r, o, l;
|
|
1133
|
-
if (
|
|
1134
|
+
if (jr(e)) {
|
|
1134
1135
|
let s = e.getAttribute("action");
|
|
1135
|
-
a = s ?
|
|
1136
|
-
} else if (
|
|
1136
|
+
a = s ? Z(s, n) : null, t = e.getAttribute("method") || Se, r = Me(e.getAttribute("enctype")) || Ce, o = new FormData(e);
|
|
1137
|
+
} else if (wr(e) || Sr(e) && (e.type === "submit" || e.type === "image")) {
|
|
1137
1138
|
let s = e.form;
|
|
1138
1139
|
if (s == null)
|
|
1139
1140
|
throw new Error(
|
|
1140
1141
|
'Cannot submit a <button> or <input type="submit"> without a <form>'
|
|
1141
1142
|
);
|
|
1142
1143
|
let u = e.getAttribute("formaction") || s.getAttribute("action");
|
|
1143
|
-
if (a = u ?
|
|
1144
|
+
if (a = u ? Z(u, n) : null, t = e.getAttribute("formmethod") || s.getAttribute("method") || Se, r = Me(e.getAttribute("formenctype")) || Me(s.getAttribute("enctype")) || Ce, o = new FormData(s, e), !Er()) {
|
|
1144
1145
|
let { name: c, type: d, value: g } = e;
|
|
1145
1146
|
if (d === "image") {
|
|
1146
|
-
let
|
|
1147
|
-
o.append(`${
|
|
1147
|
+
let x = c ? `${c}.` : "";
|
|
1148
|
+
o.append(`${x}x`, "0"), o.append(`${x}y`, "0");
|
|
1148
1149
|
} else c && o.append(c, g);
|
|
1149
1150
|
}
|
|
1150
1151
|
} else {
|
|
@@ -1152,7 +1153,7 @@ function Nr(e, n) {
|
|
|
1152
1153
|
throw new Error(
|
|
1153
1154
|
'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
|
|
1154
1155
|
);
|
|
1155
|
-
t =
|
|
1156
|
+
t = Se, a = null, r = Ce, l = e;
|
|
1156
1157
|
}
|
|
1157
1158
|
return o && r === "text/plain" && (l = o, o = void 0), { action: a, method: t.toLowerCase(), encType: r, formData: o, body: l };
|
|
1158
1159
|
}
|
|
@@ -1161,16 +1162,16 @@ function Xe(e, n) {
|
|
|
1161
1162
|
if (e === !1 || e === null || typeof e > "u")
|
|
1162
1163
|
throw new Error(n);
|
|
1163
1164
|
}
|
|
1164
|
-
function
|
|
1165
|
+
function Nr(e, n, t) {
|
|
1165
1166
|
let a = typeof e == "string" ? new URL(
|
|
1166
1167
|
e,
|
|
1167
1168
|
// This can be called during the SSR flow via PrefetchPageLinksImpl so
|
|
1168
1169
|
// don't assume window is available
|
|
1169
1170
|
typeof window > "u" ? "server://singlefetch/" : window.location.origin
|
|
1170
1171
|
) : e;
|
|
1171
|
-
return a.pathname === "/" ? a.pathname = `_root.${t}` : n &&
|
|
1172
|
+
return a.pathname === "/" ? a.pathname = `_root.${t}` : n && Z(a.pathname, n) === "/" ? a.pathname = `${n.replace(/\/$/, "")}/_root.${t}` : a.pathname = `${a.pathname.replace(/\/$/, "")}.${t}`, a;
|
|
1172
1173
|
}
|
|
1173
|
-
async function
|
|
1174
|
+
async function Pr(e, n) {
|
|
1174
1175
|
if (e.id in n)
|
|
1175
1176
|
return n[e.id];
|
|
1176
1177
|
try {
|
|
@@ -1187,27 +1188,27 @@ async function Ir(e, n) {
|
|
|
1187
1188
|
});
|
|
1188
1189
|
}
|
|
1189
1190
|
}
|
|
1190
|
-
function
|
|
1191
|
+
function Ir(e) {
|
|
1191
1192
|
return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
|
|
1192
1193
|
}
|
|
1193
|
-
async function
|
|
1194
|
+
async function Lr(e, n, t) {
|
|
1194
1195
|
let a = await Promise.all(
|
|
1195
1196
|
e.map(async (r) => {
|
|
1196
1197
|
let o = n.routes[r.route.id];
|
|
1197
1198
|
if (o) {
|
|
1198
|
-
let l = await
|
|
1199
|
+
let l = await Pr(o, t);
|
|
1199
1200
|
return l.links ? l.links() : [];
|
|
1200
1201
|
}
|
|
1201
1202
|
return [];
|
|
1202
1203
|
})
|
|
1203
1204
|
);
|
|
1204
|
-
return
|
|
1205
|
-
a.flat(1).filter(
|
|
1205
|
+
return $r(
|
|
1206
|
+
a.flat(1).filter(Ir).filter((r) => r.rel === "stylesheet" || r.rel === "preload").map(
|
|
1206
1207
|
(r) => r.rel === "stylesheet" ? { ...r, rel: "prefetch", as: "style" } : { ...r, rel: "prefetch" }
|
|
1207
1208
|
)
|
|
1208
1209
|
);
|
|
1209
1210
|
}
|
|
1210
|
-
function
|
|
1211
|
+
function ht(e, n, t, a, r, o) {
|
|
1211
1212
|
let l = (u, c) => t[c] ? u.route.id !== t[c].route.id : !0, s = (u, c) => {
|
|
1212
1213
|
var d;
|
|
1213
1214
|
return (
|
|
@@ -1227,7 +1228,7 @@ function mt(e, n, t, a, r, o) {
|
|
|
1227
1228
|
if (l(u, c) || s(u, c))
|
|
1228
1229
|
return !0;
|
|
1229
1230
|
if (u.route.shouldRevalidate) {
|
|
1230
|
-
let
|
|
1231
|
+
let x = u.route.shouldRevalidate({
|
|
1231
1232
|
currentUrl: new URL(
|
|
1232
1233
|
r.pathname + r.search + r.hash,
|
|
1233
1234
|
window.origin
|
|
@@ -1237,14 +1238,14 @@ function mt(e, n, t, a, r, o) {
|
|
|
1237
1238
|
nextParams: u.params,
|
|
1238
1239
|
defaultShouldRevalidate: !0
|
|
1239
1240
|
});
|
|
1240
|
-
if (typeof
|
|
1241
|
-
return
|
|
1241
|
+
if (typeof x == "boolean")
|
|
1242
|
+
return x;
|
|
1242
1243
|
}
|
|
1243
1244
|
return !0;
|
|
1244
1245
|
}) : [];
|
|
1245
1246
|
}
|
|
1246
|
-
function
|
|
1247
|
-
return
|
|
1247
|
+
function Fr(e, n, { includeHydrateFallback: t } = {}) {
|
|
1248
|
+
return Ar(
|
|
1248
1249
|
e.map((a) => {
|
|
1249
1250
|
let r = n.routes[a.route.id];
|
|
1250
1251
|
if (!r) return [];
|
|
@@ -1253,102 +1254,102 @@ function _r(e, n, { includeHydrateFallback: t } = {}) {
|
|
|
1253
1254
|
}).flat(1)
|
|
1254
1255
|
);
|
|
1255
1256
|
}
|
|
1256
|
-
function
|
|
1257
|
+
function Ar(e) {
|
|
1257
1258
|
return [...new Set(e)];
|
|
1258
1259
|
}
|
|
1259
|
-
function
|
|
1260
|
+
function _r(e) {
|
|
1260
1261
|
let n = {}, t = Object.keys(e).sort();
|
|
1261
1262
|
for (let a of t)
|
|
1262
1263
|
n[a] = e[a];
|
|
1263
1264
|
return n;
|
|
1264
1265
|
}
|
|
1265
|
-
function
|
|
1266
|
+
function $r(e, n) {
|
|
1266
1267
|
let t = /* @__PURE__ */ new Set();
|
|
1267
1268
|
return new Set(n), e.reduce((a, r) => {
|
|
1268
|
-
let o = JSON.stringify(
|
|
1269
|
+
let o = JSON.stringify(_r(r));
|
|
1269
1270
|
return t.has(o) || (t.add(o), a.push({ key: o, link: r })), a;
|
|
1270
1271
|
}, []);
|
|
1271
1272
|
}
|
|
1272
|
-
function
|
|
1273
|
-
let e =
|
|
1273
|
+
function Ut() {
|
|
1274
|
+
let e = f.useContext(ue);
|
|
1274
1275
|
return Xe(
|
|
1275
1276
|
e,
|
|
1276
1277
|
"You must render this element inside a <DataRouterContext.Provider> element"
|
|
1277
1278
|
), e;
|
|
1278
1279
|
}
|
|
1279
|
-
function
|
|
1280
|
-
let e =
|
|
1280
|
+
function Or() {
|
|
1281
|
+
let e = f.useContext(Ne);
|
|
1281
1282
|
return Xe(
|
|
1282
1283
|
e,
|
|
1283
1284
|
"You must render this element inside a <DataRouterStateContext.Provider> element"
|
|
1284
1285
|
), e;
|
|
1285
1286
|
}
|
|
1286
|
-
var Ze =
|
|
1287
|
+
var Ze = f.createContext(void 0);
|
|
1287
1288
|
Ze.displayName = "FrameworkContext";
|
|
1288
|
-
function
|
|
1289
|
-
let e =
|
|
1289
|
+
function qt() {
|
|
1290
|
+
let e = f.useContext(Ze);
|
|
1290
1291
|
return Xe(
|
|
1291
1292
|
e,
|
|
1292
1293
|
"You must render this element inside a <HydratedRouter> element"
|
|
1293
1294
|
), e;
|
|
1294
1295
|
}
|
|
1295
|
-
function
|
|
1296
|
-
let t =
|
|
1297
|
-
|
|
1296
|
+
function Dr(e, n) {
|
|
1297
|
+
let t = f.useContext(Ze), [a, r] = f.useState(!1), [o, l] = f.useState(!1), { onFocus: s, onBlur: u, onMouseEnter: c, onMouseLeave: d, onTouchStart: g } = n, x = f.useRef(null);
|
|
1298
|
+
f.useEffect(() => {
|
|
1298
1299
|
if (e === "render" && l(!0), e === "viewport") {
|
|
1299
|
-
let
|
|
1300
|
-
|
|
1301
|
-
l(
|
|
1300
|
+
let p = (S) => {
|
|
1301
|
+
S.forEach((b) => {
|
|
1302
|
+
l(b.isIntersecting);
|
|
1302
1303
|
});
|
|
1303
|
-
},
|
|
1304
|
-
return
|
|
1305
|
-
|
|
1304
|
+
}, w = new IntersectionObserver(p, { threshold: 0.5 });
|
|
1305
|
+
return x.current && w.observe(x.current), () => {
|
|
1306
|
+
w.disconnect();
|
|
1306
1307
|
};
|
|
1307
1308
|
}
|
|
1308
|
-
}, [e]),
|
|
1309
|
+
}, [e]), f.useEffect(() => {
|
|
1309
1310
|
if (a) {
|
|
1310
|
-
let
|
|
1311
|
+
let p = setTimeout(() => {
|
|
1311
1312
|
l(!0);
|
|
1312
1313
|
}, 100);
|
|
1313
1314
|
return () => {
|
|
1314
|
-
clearTimeout(
|
|
1315
|
+
clearTimeout(p);
|
|
1315
1316
|
};
|
|
1316
1317
|
}
|
|
1317
1318
|
}, [a]);
|
|
1318
|
-
let
|
|
1319
|
+
let m = () => {
|
|
1319
1320
|
r(!0);
|
|
1320
|
-
},
|
|
1321
|
+
}, v = () => {
|
|
1321
1322
|
r(!1), l(!1);
|
|
1322
1323
|
};
|
|
1323
|
-
return t ? e !== "intent" ? [o,
|
|
1324
|
+
return t ? e !== "intent" ? [o, x, {}] : [
|
|
1324
1325
|
o,
|
|
1325
|
-
|
|
1326
|
+
x,
|
|
1326
1327
|
{
|
|
1327
|
-
onFocus:
|
|
1328
|
-
onBlur:
|
|
1329
|
-
onMouseEnter:
|
|
1330
|
-
onMouseLeave:
|
|
1331
|
-
onTouchStart:
|
|
1328
|
+
onFocus: he(s, m),
|
|
1329
|
+
onBlur: he(u, v),
|
|
1330
|
+
onMouseEnter: he(c, m),
|
|
1331
|
+
onMouseLeave: he(d, v),
|
|
1332
|
+
onTouchStart: he(g, m)
|
|
1332
1333
|
}
|
|
1333
|
-
] : [!1,
|
|
1334
|
+
] : [!1, x, {}];
|
|
1334
1335
|
}
|
|
1335
|
-
function
|
|
1336
|
+
function he(e, n) {
|
|
1336
1337
|
return (t) => {
|
|
1337
1338
|
e && e(t), t.defaultPrevented || n(t);
|
|
1338
1339
|
};
|
|
1339
1340
|
}
|
|
1340
|
-
function
|
|
1341
|
-
let { router: t } =
|
|
1342
|
-
() =>
|
|
1341
|
+
function Mr({ page: e, ...n }) {
|
|
1342
|
+
let { router: t } = Ut(), a = f.useMemo(
|
|
1343
|
+
() => Lt(t.routes, e, t.basename),
|
|
1343
1344
|
[t.routes, e, t.basename]
|
|
1344
1345
|
);
|
|
1345
|
-
return a ? /* @__PURE__ */
|
|
1346
|
+
return a ? /* @__PURE__ */ f.createElement(Br, { page: e, matches: a, ...n }) : null;
|
|
1346
1347
|
}
|
|
1347
|
-
function
|
|
1348
|
-
let { manifest: n, routeModules: t } =
|
|
1349
|
-
return
|
|
1348
|
+
function zr(e) {
|
|
1349
|
+
let { manifest: n, routeModules: t } = qt(), [a, r] = f.useState([]);
|
|
1350
|
+
return f.useEffect(() => {
|
|
1350
1351
|
let o = !1;
|
|
1351
|
-
return
|
|
1352
|
+
return Lr(e, n, t).then(
|
|
1352
1353
|
(l) => {
|
|
1353
1354
|
o || r(l);
|
|
1354
1355
|
}
|
|
@@ -1357,13 +1358,13 @@ function Br(e) {
|
|
|
1357
1358
|
};
|
|
1358
1359
|
}, [e, n, t]), a;
|
|
1359
1360
|
}
|
|
1360
|
-
function
|
|
1361
|
+
function Br({
|
|
1361
1362
|
page: e,
|
|
1362
1363
|
matches: n,
|
|
1363
1364
|
...t
|
|
1364
1365
|
}) {
|
|
1365
|
-
let a =
|
|
1366
|
-
() =>
|
|
1366
|
+
let a = te(), { manifest: r, routeModules: o } = qt(), { basename: l } = Ut(), { loaderData: s, matches: u } = Or(), c = f.useMemo(
|
|
1367
|
+
() => ht(
|
|
1367
1368
|
e,
|
|
1368
1369
|
n,
|
|
1369
1370
|
u,
|
|
@@ -1372,8 +1373,8 @@ function Ur({
|
|
|
1372
1373
|
"data"
|
|
1373
1374
|
),
|
|
1374
1375
|
[e, n, u, r, a]
|
|
1375
|
-
), d =
|
|
1376
|
-
() =>
|
|
1376
|
+
), d = f.useMemo(
|
|
1377
|
+
() => ht(
|
|
1377
1378
|
e,
|
|
1378
1379
|
n,
|
|
1379
1380
|
u,
|
|
@@ -1382,21 +1383,21 @@ function Ur({
|
|
|
1382
1383
|
"assets"
|
|
1383
1384
|
),
|
|
1384
1385
|
[e, n, u, r, a]
|
|
1385
|
-
), g =
|
|
1386
|
+
), g = f.useMemo(() => {
|
|
1386
1387
|
if (e === a.pathname + a.search + a.hash)
|
|
1387
1388
|
return [];
|
|
1388
|
-
let
|
|
1389
|
-
if (n.forEach((
|
|
1390
|
-
var
|
|
1391
|
-
let
|
|
1392
|
-
!
|
|
1393
|
-
}),
|
|
1389
|
+
let v = /* @__PURE__ */ new Set(), p = !1;
|
|
1390
|
+
if (n.forEach((S) => {
|
|
1391
|
+
var y;
|
|
1392
|
+
let b = r.routes[S.route.id];
|
|
1393
|
+
!b || !b.hasLoader || (!c.some((j) => j.route.id === S.route.id) && S.route.id in s && ((y = o[S.route.id]) != null && y.shouldRevalidate) || b.hasClientLoader ? p = !0 : v.add(S.route.id));
|
|
1394
|
+
}), v.size === 0)
|
|
1394
1395
|
return [];
|
|
1395
|
-
let
|
|
1396
|
-
return
|
|
1396
|
+
let w = Nr(e, l, "data");
|
|
1397
|
+
return p && v.size > 0 && w.searchParams.set(
|
|
1397
1398
|
"_routes",
|
|
1398
|
-
n.filter((
|
|
1399
|
-
), [
|
|
1399
|
+
n.filter((S) => v.has(S.route.id)).map((S) => S.route.id).join(",")
|
|
1400
|
+
), [w.pathname + w.search];
|
|
1400
1401
|
}, [
|
|
1401
1402
|
l,
|
|
1402
1403
|
s,
|
|
@@ -1406,30 +1407,30 @@ function Ur({
|
|
|
1406
1407
|
n,
|
|
1407
1408
|
e,
|
|
1408
1409
|
o
|
|
1409
|
-
]),
|
|
1410
|
-
() =>
|
|
1410
|
+
]), x = f.useMemo(
|
|
1411
|
+
() => Fr(d, r),
|
|
1411
1412
|
[d, r]
|
|
1412
|
-
),
|
|
1413
|
-
return /* @__PURE__ */
|
|
1413
|
+
), m = zr(d);
|
|
1414
|
+
return /* @__PURE__ */ f.createElement(f.Fragment, null, g.map((v) => /* @__PURE__ */ f.createElement("link", { key: v, rel: "prefetch", as: "fetch", href: v, ...t })), x.map((v) => /* @__PURE__ */ f.createElement("link", { key: v, rel: "modulepreload", href: v, ...t })), m.map(({ key: v, link: p }) => (
|
|
1414
1415
|
// these don't spread `linkProps` because they are full link descriptors
|
|
1415
1416
|
// already with their own props
|
|
1416
|
-
/* @__PURE__ */
|
|
1417
|
+
/* @__PURE__ */ f.createElement("link", { key: v, nonce: t.nonce, ...p })
|
|
1417
1418
|
)));
|
|
1418
1419
|
}
|
|
1419
|
-
function
|
|
1420
|
+
function Ur(...e) {
|
|
1420
1421
|
return (n) => {
|
|
1421
1422
|
e.forEach((t) => {
|
|
1422
1423
|
typeof t == "function" ? t(n) : t != null && (t.current = n);
|
|
1423
1424
|
});
|
|
1424
1425
|
};
|
|
1425
1426
|
}
|
|
1426
|
-
var
|
|
1427
|
+
var Wt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
1427
1428
|
try {
|
|
1428
|
-
|
|
1429
|
+
Wt && (window.__reactRouterVersion = // @ts-expect-error
|
|
1429
1430
|
"7.8.2");
|
|
1430
1431
|
} catch {
|
|
1431
1432
|
}
|
|
1432
|
-
var
|
|
1433
|
+
var Kt = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Vt = f.forwardRef(
|
|
1433
1434
|
function({
|
|
1434
1435
|
onClick: n,
|
|
1435
1436
|
discover: t = "render",
|
|
@@ -1442,23 +1443,23 @@ var Ht = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Yt = h.forwardRef(
|
|
|
1442
1443
|
to: c,
|
|
1443
1444
|
preventScrollReset: d,
|
|
1444
1445
|
viewTransition: g,
|
|
1445
|
-
...
|
|
1446
|
-
},
|
|
1447
|
-
let { basename:
|
|
1448
|
-
if (typeof c == "string" &&
|
|
1446
|
+
...x
|
|
1447
|
+
}, m) {
|
|
1448
|
+
let { basename: v } = f.useContext(H), p = typeof c == "string" && Kt.test(c), w, S = !1;
|
|
1449
|
+
if (typeof c == "string" && p && (w = c, Wt))
|
|
1449
1450
|
try {
|
|
1450
|
-
let
|
|
1451
|
-
|
|
1451
|
+
let $ = new URL(window.location.href), G = c.startsWith("//") ? new URL($.protocol + c) : new URL(c), ae = Z(G.pathname, v);
|
|
1452
|
+
G.origin === $.origin && ae != null ? c = ae + G.search + G.hash : S = !0;
|
|
1452
1453
|
} catch {
|
|
1453
|
-
|
|
1454
|
+
V(
|
|
1454
1455
|
!1,
|
|
1455
1456
|
`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
1456
1457
|
);
|
|
1457
1458
|
}
|
|
1458
|
-
let
|
|
1459
|
+
let b = ir(c, { relative: r }), [y, j, R] = Dr(
|
|
1459
1460
|
a,
|
|
1460
|
-
|
|
1461
|
-
),
|
|
1461
|
+
x
|
|
1462
|
+
), U = Vr(c, {
|
|
1462
1463
|
replace: l,
|
|
1463
1464
|
state: s,
|
|
1464
1465
|
target: u,
|
|
@@ -1466,29 +1467,29 @@ var Ht = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Yt = h.forwardRef(
|
|
|
1466
1467
|
relative: r,
|
|
1467
1468
|
viewTransition: g
|
|
1468
1469
|
});
|
|
1469
|
-
function
|
|
1470
|
-
n && n(
|
|
1470
|
+
function M($) {
|
|
1471
|
+
n && n($), $.defaultPrevented || U($);
|
|
1471
1472
|
}
|
|
1472
|
-
let
|
|
1473
|
+
let ne = (
|
|
1473
1474
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
1474
|
-
/* @__PURE__ */
|
|
1475
|
+
/* @__PURE__ */ f.createElement(
|
|
1475
1476
|
"a",
|
|
1476
1477
|
{
|
|
1477
|
-
...
|
|
1478
|
-
...
|
|
1479
|
-
href:
|
|
1480
|
-
onClick:
|
|
1481
|
-
ref:
|
|
1478
|
+
...x,
|
|
1479
|
+
...R,
|
|
1480
|
+
href: w || b,
|
|
1481
|
+
onClick: S || o ? n : M,
|
|
1482
|
+
ref: Ur(m, j),
|
|
1482
1483
|
target: u,
|
|
1483
|
-
"data-discover": !
|
|
1484
|
+
"data-discover": !p && t === "render" ? "true" : void 0
|
|
1484
1485
|
}
|
|
1485
1486
|
)
|
|
1486
1487
|
);
|
|
1487
|
-
return
|
|
1488
|
+
return y && !p ? /* @__PURE__ */ f.createElement(f.Fragment, null, ne, /* @__PURE__ */ f.createElement(Mr, { page: b })) : ne;
|
|
1488
1489
|
}
|
|
1489
1490
|
);
|
|
1490
|
-
|
|
1491
|
-
var qr =
|
|
1491
|
+
Vt.displayName = "Link";
|
|
1492
|
+
var qr = f.forwardRef(
|
|
1492
1493
|
function({
|
|
1493
1494
|
"aria-current": n = "page",
|
|
1494
1495
|
caseSensitive: t = !1,
|
|
@@ -1500,40 +1501,40 @@ var qr = h.forwardRef(
|
|
|
1500
1501
|
children: u,
|
|
1501
1502
|
...c
|
|
1502
1503
|
}, d) {
|
|
1503
|
-
let g =
|
|
1504
|
+
let g = xe(l, { relative: c.relative }), x = te(), m = f.useContext(Ne), { navigator: v, basename: p } = f.useContext(H), w = m != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1504
1505
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1505
|
-
|
|
1506
|
-
t || (
|
|
1507
|
-
const
|
|
1508
|
-
let
|
|
1509
|
-
isActive:
|
|
1510
|
-
isPending:
|
|
1511
|
-
isTransitioning:
|
|
1512
|
-
},
|
|
1513
|
-
typeof a == "function" ?
|
|
1506
|
+
Xr(g) && s === !0, S = v.encodeLocation ? v.encodeLocation(g).pathname : g.pathname, b = x.pathname, y = m && m.navigation && m.navigation.location ? m.navigation.location.pathname : null;
|
|
1507
|
+
t || (b = b.toLowerCase(), y = y ? y.toLowerCase() : null, S = S.toLowerCase()), y && p && (y = Z(y, p) || y);
|
|
1508
|
+
const j = S !== "/" && S.endsWith("/") ? S.length - 1 : S.length;
|
|
1509
|
+
let R = b === S || !r && b.startsWith(S) && b.charAt(j) === "/", U = y != null && (y === S || !r && y.startsWith(S) && y.charAt(S.length) === "/"), M = {
|
|
1510
|
+
isActive: R,
|
|
1511
|
+
isPending: U,
|
|
1512
|
+
isTransitioning: w
|
|
1513
|
+
}, ne = R ? n : void 0, $;
|
|
1514
|
+
typeof a == "function" ? $ = a(M) : $ = [
|
|
1514
1515
|
a,
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1516
|
+
R ? "active" : null,
|
|
1517
|
+
U ? "pending" : null,
|
|
1518
|
+
w ? "transitioning" : null
|
|
1518
1519
|
].filter(Boolean).join(" ");
|
|
1519
|
-
let
|
|
1520
|
-
return /* @__PURE__ */
|
|
1521
|
-
|
|
1520
|
+
let G = typeof o == "function" ? o(M) : o;
|
|
1521
|
+
return /* @__PURE__ */ f.createElement(
|
|
1522
|
+
Vt,
|
|
1522
1523
|
{
|
|
1523
1524
|
...c,
|
|
1524
|
-
"aria-current":
|
|
1525
|
-
className:
|
|
1525
|
+
"aria-current": ne,
|
|
1526
|
+
className: $,
|
|
1526
1527
|
ref: d,
|
|
1527
|
-
style:
|
|
1528
|
+
style: G,
|
|
1528
1529
|
to: l,
|
|
1529
1530
|
viewTransition: s
|
|
1530
1531
|
},
|
|
1531
|
-
typeof u == "function" ? u(
|
|
1532
|
+
typeof u == "function" ? u(M) : u
|
|
1532
1533
|
);
|
|
1533
1534
|
}
|
|
1534
1535
|
);
|
|
1535
1536
|
qr.displayName = "NavLink";
|
|
1536
|
-
var
|
|
1537
|
+
var Wr = f.forwardRef(
|
|
1537
1538
|
({
|
|
1538
1539
|
discover: e = "render",
|
|
1539
1540
|
fetcherKey: n,
|
|
@@ -1541,21 +1542,21 @@ var Kr = h.forwardRef(
|
|
|
1541
1542
|
reloadDocument: a,
|
|
1542
1543
|
replace: r,
|
|
1543
1544
|
state: o,
|
|
1544
|
-
method: l =
|
|
1545
|
+
method: l = Se,
|
|
1545
1546
|
action: s,
|
|
1546
1547
|
onSubmit: u,
|
|
1547
1548
|
relative: c,
|
|
1548
1549
|
preventScrollReset: d,
|
|
1549
1550
|
viewTransition: g,
|
|
1550
|
-
...
|
|
1551
|
-
},
|
|
1552
|
-
let
|
|
1553
|
-
if (u && u(
|
|
1554
|
-
|
|
1555
|
-
let
|
|
1556
|
-
|
|
1551
|
+
...x
|
|
1552
|
+
}, m) => {
|
|
1553
|
+
let v = Gr(), p = Jr(s, { relative: c }), w = l.toLowerCase() === "get" ? "get" : "post", S = typeof s == "string" && Kt.test(s), b = (y) => {
|
|
1554
|
+
if (u && u(y), y.defaultPrevented) return;
|
|
1555
|
+
y.preventDefault();
|
|
1556
|
+
let j = y.nativeEvent.submitter, R = (j == null ? void 0 : j.getAttribute("formmethod")) || l;
|
|
1557
|
+
v(j || y.currentTarget, {
|
|
1557
1558
|
fetcherKey: n,
|
|
1558
|
-
method:
|
|
1559
|
+
method: R,
|
|
1559
1560
|
navigate: t,
|
|
1560
1561
|
replace: r,
|
|
1561
1562
|
state: o,
|
|
@@ -1564,28 +1565,28 @@ var Kr = h.forwardRef(
|
|
|
1564
1565
|
viewTransition: g
|
|
1565
1566
|
});
|
|
1566
1567
|
};
|
|
1567
|
-
return /* @__PURE__ */
|
|
1568
|
+
return /* @__PURE__ */ f.createElement(
|
|
1568
1569
|
"form",
|
|
1569
1570
|
{
|
|
1570
|
-
ref:
|
|
1571
|
-
method:
|
|
1572
|
-
action:
|
|
1573
|
-
onSubmit: a ? u :
|
|
1574
|
-
...
|
|
1575
|
-
"data-discover": !
|
|
1571
|
+
ref: m,
|
|
1572
|
+
method: w,
|
|
1573
|
+
action: p,
|
|
1574
|
+
onSubmit: a ? u : b,
|
|
1575
|
+
...x,
|
|
1576
|
+
"data-discover": !S && e === "render" ? "true" : void 0
|
|
1576
1577
|
}
|
|
1577
1578
|
);
|
|
1578
1579
|
}
|
|
1579
1580
|
);
|
|
1580
|
-
|
|
1581
|
-
function
|
|
1581
|
+
Wr.displayName = "Form";
|
|
1582
|
+
function Kr(e) {
|
|
1582
1583
|
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1583
1584
|
}
|
|
1584
|
-
function
|
|
1585
|
-
let n =
|
|
1586
|
-
return P(n,
|
|
1585
|
+
function Ht(e) {
|
|
1586
|
+
let n = f.useContext(ue);
|
|
1587
|
+
return P(n, Kr(e)), n;
|
|
1587
1588
|
}
|
|
1588
|
-
function
|
|
1589
|
+
function Vr(e, {
|
|
1589
1590
|
target: n,
|
|
1590
1591
|
replace: t,
|
|
1591
1592
|
state: a,
|
|
@@ -1593,10 +1594,10 @@ function Hr(e, {
|
|
|
1593
1594
|
relative: o,
|
|
1594
1595
|
viewTransition: l
|
|
1595
1596
|
} = {}) {
|
|
1596
|
-
let s =
|
|
1597
|
-
return
|
|
1597
|
+
let s = Ye(), u = te(), c = xe(e, { relative: o });
|
|
1598
|
+
return f.useCallback(
|
|
1598
1599
|
(d) => {
|
|
1599
|
-
if (
|
|
1600
|
+
if (Rr(d, n)) {
|
|
1600
1601
|
d.preventDefault();
|
|
1601
1602
|
let g = t !== void 0 ? t : Ue(u) === Ue(c);
|
|
1602
1603
|
s(e, {
|
|
@@ -1622,20 +1623,20 @@ function Hr(e, {
|
|
|
1622
1623
|
]
|
|
1623
1624
|
);
|
|
1624
1625
|
}
|
|
1625
|
-
var
|
|
1626
|
-
function
|
|
1627
|
-
let { router: e } =
|
|
1626
|
+
var Hr = 0, Yr = () => `__${String(++Hr)}__`;
|
|
1627
|
+
function Gr() {
|
|
1628
|
+
let { router: e } = Ht(
|
|
1628
1629
|
"useSubmit"
|
|
1629
1630
|
/* UseSubmit */
|
|
1630
|
-
), { basename: n } =
|
|
1631
|
-
return
|
|
1631
|
+
), { basename: n } = f.useContext(H), t = xr();
|
|
1632
|
+
return f.useCallback(
|
|
1632
1633
|
async (a, r = {}) => {
|
|
1633
|
-
let { action: o, method: l, encType: s, formData: u, body: c } =
|
|
1634
|
+
let { action: o, method: l, encType: s, formData: u, body: c } = Tr(
|
|
1634
1635
|
a,
|
|
1635
1636
|
n
|
|
1636
1637
|
);
|
|
1637
1638
|
if (r.navigate === !1) {
|
|
1638
|
-
let d = r.fetcherKey ||
|
|
1639
|
+
let d = r.fetcherKey || Yr();
|
|
1639
1640
|
await e.fetch(d, t, r.action || o, {
|
|
1640
1641
|
preventScrollReset: r.preventScrollReset,
|
|
1641
1642
|
formData: u,
|
|
@@ -1661,10 +1662,10 @@ function Jr() {
|
|
|
1661
1662
|
[e, n, t]
|
|
1662
1663
|
);
|
|
1663
1664
|
}
|
|
1664
|
-
function
|
|
1665
|
-
let { basename: t } =
|
|
1665
|
+
function Jr(e, { relative: n } = {}) {
|
|
1666
|
+
let { basename: t } = f.useContext(H), a = f.useContext(Y);
|
|
1666
1667
|
P(a, "useFormAction must be used inside a RouteContext");
|
|
1667
|
-
let [r] = a.matches.slice(-1), o = { ...
|
|
1668
|
+
let [r] = a.matches.slice(-1), o = { ...xe(e || ".", { relative: n }) }, l = te();
|
|
1668
1669
|
if (e == null) {
|
|
1669
1670
|
o.search = l.search;
|
|
1670
1671
|
let s = new URLSearchParams(o.search), u = s.getAll("index");
|
|
@@ -1674,27 +1675,27 @@ function Xr(e, { relative: n } = {}) {
|
|
|
1674
1675
|
o.search = d ? `?${d}` : "";
|
|
1675
1676
|
}
|
|
1676
1677
|
}
|
|
1677
|
-
return (!e || e === ".") && r.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), t !== "/" && (o.pathname = o.pathname === "/" ? t :
|
|
1678
|
+
return (!e || e === ".") && r.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), t !== "/" && (o.pathname = o.pathname === "/" ? t : K([t, o.pathname])), Ue(o);
|
|
1678
1679
|
}
|
|
1679
|
-
function
|
|
1680
|
-
let t =
|
|
1680
|
+
function Xr(e, { relative: n } = {}) {
|
|
1681
|
+
let t = f.useContext(Dt);
|
|
1681
1682
|
P(
|
|
1682
1683
|
t != null,
|
|
1683
1684
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1684
1685
|
);
|
|
1685
|
-
let { basename: a } =
|
|
1686
|
+
let { basename: a } = Ht(
|
|
1686
1687
|
"useViewTransitionState"
|
|
1687
1688
|
/* useViewTransitionState */
|
|
1688
|
-
), r =
|
|
1689
|
+
), r = xe(e, { relative: n });
|
|
1689
1690
|
if (!t.isTransitioning)
|
|
1690
1691
|
return !1;
|
|
1691
|
-
let o =
|
|
1692
|
-
return
|
|
1692
|
+
let o = Z(t.currentLocation.pathname, a) || t.currentLocation.pathname, l = Z(t.nextLocation.pathname, a) || t.nextLocation.pathname;
|
|
1693
|
+
return Ee(r.pathname, l) != null || Ee(r.pathname, o) != null;
|
|
1693
1694
|
}
|
|
1694
|
-
const
|
|
1695
|
-
const n =
|
|
1695
|
+
const Qa = ({ message: e }) => {
|
|
1696
|
+
const n = Ye();
|
|
1696
1697
|
return /* @__PURE__ */ i.jsx(
|
|
1697
|
-
|
|
1698
|
+
dn,
|
|
1698
1699
|
{
|
|
1699
1700
|
size: "xs",
|
|
1700
1701
|
style: {
|
|
@@ -1709,26 +1710,26 @@ const Za = ({ message: e }) => {
|
|
|
1709
1710
|
color: "red",
|
|
1710
1711
|
title: "Not Found",
|
|
1711
1712
|
variant: "404 - Not Found",
|
|
1712
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
1713
|
-
children: /* @__PURE__ */ i.jsxs(
|
|
1713
|
+
icon: /* @__PURE__ */ i.jsx(We, { size: 12, stroke: 1.5 }),
|
|
1714
|
+
children: /* @__PURE__ */ i.jsxs(ge, { align: "flex-start", children: [
|
|
1714
1715
|
e || "Sorry, the page you are looking for does not exist.",
|
|
1715
|
-
/* @__PURE__ */ i.jsx(
|
|
1716
|
+
/* @__PURE__ */ i.jsx(q, { variant: "filled", onClick: () => n("/"), size: "xs", children: "Back Home" })
|
|
1716
1717
|
] })
|
|
1717
1718
|
}
|
|
1718
1719
|
)
|
|
1719
1720
|
}
|
|
1720
1721
|
);
|
|
1721
|
-
},
|
|
1722
|
+
}, eo = ({ message: e }) => /* @__PURE__ */ i.jsx(
|
|
1722
1723
|
qe,
|
|
1723
1724
|
{
|
|
1724
1725
|
color: "red",
|
|
1725
1726
|
title: "Not Found",
|
|
1726
1727
|
variant: "404 - Not Found",
|
|
1727
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
1728
|
+
icon: /* @__PURE__ */ i.jsx(We, { size: 12, stroke: 1.5 }),
|
|
1728
1729
|
children: e || "Sorry, the page you are looking for does not exist."
|
|
1729
1730
|
}
|
|
1730
|
-
),
|
|
1731
|
-
|
|
1731
|
+
), Yt = ({ message: e }) => /* @__PURE__ */ i.jsx(E, { c: "red", size: "sm", children: e || "Not Found" }), to = ({ tip: e }) => e === void 0 ? /* @__PURE__ */ i.jsx(B, { justify: "center", align: "center", children: /* @__PURE__ */ i.jsx(Re, { color: "blue", size: "md" }) }) : /* @__PURE__ */ i.jsxs(
|
|
1732
|
+
B,
|
|
1732
1733
|
{
|
|
1733
1734
|
gap: "md",
|
|
1734
1735
|
direction: "column",
|
|
@@ -1736,30 +1737,30 @@ const Za = ({ message: e }) => {
|
|
|
1736
1737
|
align: "center",
|
|
1737
1738
|
style: { height: "100%" },
|
|
1738
1739
|
children: [
|
|
1739
|
-
/* @__PURE__ */ i.jsx(
|
|
1740
|
+
/* @__PURE__ */ i.jsx(Re, { color: "blue", size: "md" }),
|
|
1740
1741
|
e
|
|
1741
1742
|
]
|
|
1742
1743
|
}
|
|
1743
|
-
),
|
|
1744
|
-
/* @__PURE__ */ i.jsx(
|
|
1744
|
+
), no = ({ tip: e }) => e === void 0 ? /* @__PURE__ */ i.jsx(Re, { color: "blue", size: "xs" }) : /* @__PURE__ */ i.jsxs(B, { gap: "md", direction: "column", justify: "center", align: "center", children: [
|
|
1745
|
+
/* @__PURE__ */ i.jsx(Re, { color: "blue", size: "xs" }),
|
|
1745
1746
|
e
|
|
1746
|
-
] }),
|
|
1747
|
+
] }), ro = ({ message: e }) => /* @__PURE__ */ i.jsx(
|
|
1747
1748
|
qe,
|
|
1748
1749
|
{
|
|
1749
1750
|
color: "red",
|
|
1750
1751
|
title: "Not Found",
|
|
1751
1752
|
variant: "403 - Not Authorized",
|
|
1752
|
-
icon: /* @__PURE__ */ i.jsx(
|
|
1753
|
+
icon: /* @__PURE__ */ i.jsx(We, { size: 12, stroke: 1.5 }),
|
|
1753
1754
|
children: e || "Sorry, you are not authorized to access this page."
|
|
1754
1755
|
}
|
|
1755
1756
|
);
|
|
1756
|
-
function
|
|
1757
|
+
function ao(e, n) {
|
|
1757
1758
|
return e.reduce((t, a) => {
|
|
1758
1759
|
const r = n(a);
|
|
1759
1760
|
return t[r] || (t[r] = []), t[r].push(a), t;
|
|
1760
1761
|
}, {});
|
|
1761
1762
|
}
|
|
1762
|
-
function
|
|
1763
|
+
function oo(e, n) {
|
|
1763
1764
|
const t = [];
|
|
1764
1765
|
let a;
|
|
1765
1766
|
return e.reduce((r, o) => {
|
|
@@ -1767,17 +1768,17 @@ function ao(e, n) {
|
|
|
1767
1768
|
return l === void 0 ? (a === void 0 && (a = t.length, t.push([])), t[a].push(o)) : (r[l] === void 0 && (r[l] = t.length, t.push([])), t[r[l]].push(o)), r;
|
|
1768
1769
|
}, {}), t;
|
|
1769
1770
|
}
|
|
1770
|
-
function
|
|
1771
|
+
function io(e, n) {
|
|
1771
1772
|
const t = /* @__PURE__ */ new Set();
|
|
1772
1773
|
return e.filter((a) => {
|
|
1773
1774
|
const r = n(a);
|
|
1774
1775
|
return t.has(r) ? !1 : (t.add(r), !0);
|
|
1775
1776
|
});
|
|
1776
1777
|
}
|
|
1777
|
-
class
|
|
1778
|
+
class lo {
|
|
1778
1779
|
constructor() {
|
|
1779
|
-
|
|
1780
|
-
|
|
1780
|
+
X(this, "items", []);
|
|
1781
|
+
X(this, "seen", /* @__PURE__ */ new Set());
|
|
1781
1782
|
}
|
|
1782
1783
|
add(n, t) {
|
|
1783
1784
|
const a = t(n);
|
|
@@ -1787,16 +1788,16 @@ class io {
|
|
|
1787
1788
|
return this.items;
|
|
1788
1789
|
}
|
|
1789
1790
|
}
|
|
1790
|
-
class
|
|
1791
|
+
class mt {
|
|
1791
1792
|
constructor() {
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1793
|
+
X(this, "children", /* @__PURE__ */ new Map());
|
|
1794
|
+
X(this, "isEndOfWord", !1);
|
|
1795
|
+
X(this, "value", "");
|
|
1795
1796
|
}
|
|
1796
1797
|
}
|
|
1797
|
-
class
|
|
1798
|
+
class Gt {
|
|
1798
1799
|
constructor() {
|
|
1799
|
-
|
|
1800
|
+
X(this, "root", new mt());
|
|
1800
1801
|
}
|
|
1801
1802
|
/**
|
|
1802
1803
|
* Inserts a word into the trie structure.
|
|
@@ -1808,7 +1809,7 @@ class Xt {
|
|
|
1808
1809
|
let t = this.root;
|
|
1809
1810
|
for (const a of n) {
|
|
1810
1811
|
let r = t.children.get(a);
|
|
1811
|
-
r === void 0 && (r = new
|
|
1812
|
+
r === void 0 && (r = new mt(), t.children.set(a, r)), t = r;
|
|
1812
1813
|
}
|
|
1813
1814
|
t.isEndOfWord = !0, t.value = n;
|
|
1814
1815
|
}
|
|
@@ -1833,8 +1834,44 @@ class Xt {
|
|
|
1833
1834
|
return a;
|
|
1834
1835
|
}
|
|
1835
1836
|
}
|
|
1836
|
-
var
|
|
1837
|
-
|
|
1837
|
+
var Zr = /* @__PURE__ */ ((e) => (e[e.Allow = 0] = "Allow", e[e.Denied = 1] = "Denied", e[e.Pending = 2] = "Pending", e))(Zr || {});
|
|
1838
|
+
class Qr extends Gt {
|
|
1839
|
+
constructor() {
|
|
1840
|
+
super(...arguments);
|
|
1841
|
+
X(this, "pathToKey", /* @__PURE__ */ new Map());
|
|
1842
|
+
}
|
|
1843
|
+
/**
|
|
1844
|
+
* Normalizes a URL path by removing trailing slashes
|
|
1845
|
+
*
|
|
1846
|
+
* @param path - The path which is an URL string to normalize
|
|
1847
|
+
* @returns The normalized path without trailing slash, except for root "/"
|
|
1848
|
+
*/
|
|
1849
|
+
normalizePath(t) {
|
|
1850
|
+
return t === "/" ? "/" : t.replace(/\/$/, "");
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Inserts an url path into the trie and associates it with a menu key.
|
|
1854
|
+
*
|
|
1855
|
+
* @param path - The URL path to store (e.g., "/admin/users")
|
|
1856
|
+
* @param menuKey - The menu key to associate with this path
|
|
1857
|
+
*/
|
|
1858
|
+
insertRoute(t, a) {
|
|
1859
|
+
const r = this.normalizePath(t);
|
|
1860
|
+
this.insert(r), this.pathToKey.set(r, a);
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Finds the menu key associated with the longest matching route prefix
|
|
1864
|
+
*
|
|
1865
|
+
* @param route - The URL to match against stored menu url paths
|
|
1866
|
+
* @returns The menu key if a valid prefix match is found, undefined otherwise
|
|
1867
|
+
*/
|
|
1868
|
+
findMatchingKey(t) {
|
|
1869
|
+
const a = this.normalizePath(t), r = this.findLongestPrefix(a);
|
|
1870
|
+
if (r.match && this.pathToKey.has(r.match) && (a === r.match || r.remaining.startsWith("/") || r.remaining === ""))
|
|
1871
|
+
return this.pathToKey.get(r.match);
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
function ea(e) {
|
|
1838
1875
|
const n = {}, t = {}, a = {}, r = (o, l = []) => {
|
|
1839
1876
|
o.forEach((s) => {
|
|
1840
1877
|
const u = [...l, s.key];
|
|
@@ -1843,175 +1880,140 @@ function Qr(e) {
|
|
|
1843
1880
|
};
|
|
1844
1881
|
return r(e), { key2item: n, key2fullpath: t, key2route: a };
|
|
1845
1882
|
}
|
|
1846
|
-
function
|
|
1847
|
-
const n = new
|
|
1883
|
+
function ta(e) {
|
|
1884
|
+
const n = new Qr(), t = (a) => {
|
|
1848
1885
|
a.forEach((r) => {
|
|
1849
|
-
|
|
1886
|
+
if (r.route !== void 0) {
|
|
1887
|
+
const o = r.route.path.getURL();
|
|
1888
|
+
n.insertRoute(o, r.key);
|
|
1889
|
+
}
|
|
1890
|
+
r.children !== void 0 && r.children.length > 0 && t(r.children);
|
|
1850
1891
|
});
|
|
1851
1892
|
};
|
|
1852
1893
|
return t(e), n;
|
|
1853
1894
|
}
|
|
1854
|
-
function
|
|
1895
|
+
function na(e, n) {
|
|
1855
1896
|
return e.map((t) => {
|
|
1856
1897
|
if (t.route !== void 0)
|
|
1857
|
-
return n(t.route.role) ===
|
|
1898
|
+
return n(t.route.role) === 0 ? t : null;
|
|
1858
1899
|
if (t.children !== void 0) {
|
|
1859
|
-
const a = t.children.filter((r) => r.route !== void 0 ? n(r.route.role) ===
|
|
1900
|
+
const a = t.children.filter((r) => r.route !== void 0 ? n(r.route.role) === 0 : !0);
|
|
1860
1901
|
return a.length > 0 ? { ...t, children: a } : null;
|
|
1861
1902
|
}
|
|
1862
1903
|
return t;
|
|
1863
1904
|
}).filter((t) => t !== null);
|
|
1864
1905
|
}
|
|
1865
|
-
const
|
|
1866
|
-
const
|
|
1867
|
-
() =>
|
|
1868
|
-
[
|
|
1906
|
+
const so = (e) => {
|
|
1907
|
+
const n = Ye(), t = te(), [a, r] = _(/* @__PURE__ */ new Set()), [o, l] = _(/* @__PURE__ */ new Set()), [s, u] = _(), c = k(() => na(e.items, e.checkPermission), [e.items, e.checkPermission]), d = k(() => ta(e.items), [e.items]), { key2fullpath: g, key2route: x } = k(
|
|
1908
|
+
() => ea(c),
|
|
1909
|
+
[c]
|
|
1869
1910
|
);
|
|
1870
1911
|
Te(() => {
|
|
1871
|
-
const
|
|
1872
|
-
|
|
1873
|
-
}, [
|
|
1874
|
-
const
|
|
1875
|
-
function p
|
|
1876
|
-
var
|
|
1877
|
-
const
|
|
1878
|
-
return
|
|
1912
|
+
const v = t.pathname, p = d.findMatchingKey(v);
|
|
1913
|
+
p !== void 0 && (l(new Set(g[p])), u(p));
|
|
1914
|
+
}, [t, x]);
|
|
1915
|
+
const m = k(() => {
|
|
1916
|
+
function v(p, w) {
|
|
1917
|
+
var b, y;
|
|
1918
|
+
const S = p.children !== void 0 && p.children.length > 0;
|
|
1919
|
+
return S ? /* @__PURE__ */ i.jsxs(
|
|
1879
1920
|
"div",
|
|
1880
1921
|
{
|
|
1881
1922
|
onMouseEnter: () => {
|
|
1882
|
-
|
|
1883
|
-
const
|
|
1884
|
-
return
|
|
1923
|
+
o.has(p.key) || r((j) => {
|
|
1924
|
+
const R = new Set(j);
|
|
1925
|
+
return R.add(p.key), R;
|
|
1885
1926
|
});
|
|
1886
1927
|
},
|
|
1887
1928
|
onMouseLeave: () => {
|
|
1888
|
-
|
|
1889
|
-
const
|
|
1890
|
-
return
|
|
1929
|
+
o.has(p.key) || r((j) => {
|
|
1930
|
+
const R = new Set(j);
|
|
1931
|
+
return R.delete(p.key), R;
|
|
1891
1932
|
});
|
|
1892
1933
|
},
|
|
1893
1934
|
children: [
|
|
1894
1935
|
/* @__PURE__ */ i.jsx(
|
|
1895
|
-
|
|
1936
|
+
it,
|
|
1896
1937
|
{
|
|
1897
|
-
active:
|
|
1898
|
-
|
|
1899
|
-
|
|
1938
|
+
active: s === p.key,
|
|
1939
|
+
href: (b = p.route) == null ? void 0 : b.path.getURL(),
|
|
1940
|
+
label: p.label,
|
|
1941
|
+
leftSection: p.icon,
|
|
1900
1942
|
styles: {
|
|
1901
1943
|
label: { fontSize: "md" },
|
|
1902
1944
|
root: {
|
|
1903
1945
|
borderRadius: "var(--mantine-radius-sm)"
|
|
1904
1946
|
}
|
|
1905
1947
|
},
|
|
1906
|
-
ml:
|
|
1948
|
+
ml: w === 0 ? void 0 : w === 1 ? "md" : `calc(var(--mantine-spacing-md) * ${w})`,
|
|
1907
1949
|
w: "unset",
|
|
1908
|
-
rightSection:
|
|
1909
|
-
|
|
1950
|
+
rightSection: S ? /* @__PURE__ */ i.jsx(
|
|
1951
|
+
jn,
|
|
1910
1952
|
{
|
|
1911
1953
|
size: 12,
|
|
1912
1954
|
stroke: 1.5,
|
|
1913
1955
|
className: "mantine-rotate-rtl"
|
|
1914
1956
|
}
|
|
1915
1957
|
) : void 0,
|
|
1916
|
-
opened:
|
|
1917
|
-
onClick: (
|
|
1918
|
-
|
|
1919
|
-
const
|
|
1920
|
-
return
|
|
1921
|
-
});
|
|
1958
|
+
opened: a.has(p.key) || o.has(p.key),
|
|
1959
|
+
onClick: (j) => {
|
|
1960
|
+
j.ctrlKey || j.metaKey || (j.preventDefault(), l((U) => {
|
|
1961
|
+
const M = new Set(U);
|
|
1962
|
+
return U.has(p.key) ? M.delete(p.key) : M.add(p.key), M;
|
|
1963
|
+
}));
|
|
1922
1964
|
}
|
|
1923
1965
|
},
|
|
1924
|
-
|
|
1966
|
+
p.key
|
|
1925
1967
|
),
|
|
1926
|
-
(
|
|
1968
|
+
(o.has(p.key) || a.has(p.key)) && p.children.map((j) => v(j, w + 1))
|
|
1927
1969
|
]
|
|
1928
1970
|
},
|
|
1929
|
-
`container-${
|
|
1971
|
+
`container-${p.key}`
|
|
1930
1972
|
) : /* @__PURE__ */ i.jsx(
|
|
1931
|
-
|
|
1973
|
+
it,
|
|
1932
1974
|
{
|
|
1933
|
-
active:
|
|
1934
|
-
href: (
|
|
1935
|
-
label:
|
|
1936
|
-
leftSection:
|
|
1975
|
+
active: s === p.key,
|
|
1976
|
+
href: (y = p.route) == null ? void 0 : y.path.getURL(),
|
|
1977
|
+
label: p.label,
|
|
1978
|
+
leftSection: p.icon,
|
|
1937
1979
|
styles: {
|
|
1938
1980
|
label: { fontSize: "md" },
|
|
1939
1981
|
root: {
|
|
1940
1982
|
borderRadius: "var(--mantine-radius-sm)"
|
|
1941
1983
|
}
|
|
1942
1984
|
},
|
|
1943
|
-
ml:
|
|
1985
|
+
ml: w === 0 ? void 0 : w === 1 ? "md" : `calc(var(--mantine-spacing-md) * ${w})`,
|
|
1944
1986
|
w: "unset",
|
|
1945
|
-
onClick: (
|
|
1946
|
-
|
|
1987
|
+
onClick: (j) => {
|
|
1988
|
+
j.ctrlKey || j.metaKey || (j.preventDefault(), p.route != null && p.route.path.path().open(n));
|
|
1947
1989
|
}
|
|
1948
1990
|
},
|
|
1949
|
-
|
|
1991
|
+
p.key
|
|
1950
1992
|
);
|
|
1951
1993
|
}
|
|
1952
|
-
return
|
|
1953
|
-
}, [s, o, a, n]);
|
|
1954
|
-
return /* @__PURE__ */ i.jsx(i.Fragment, { children:
|
|
1955
|
-
};
|
|
1956
|
-
|
|
1957
|
-
constructor() {
|
|
1958
|
-
super(...arguments);
|
|
1959
|
-
G(this, "pathToKey", /* @__PURE__ */ new Map());
|
|
1960
|
-
}
|
|
1961
|
-
/**
|
|
1962
|
-
* Normalizes a URL path by removing trailing slashes
|
|
1963
|
-
*
|
|
1964
|
-
* @param path - The path which is an URL string to normalize
|
|
1965
|
-
* @returns The normalized path without trailing slash, except for root "/"
|
|
1966
|
-
*/
|
|
1967
|
-
normalizePath(t) {
|
|
1968
|
-
return t === "/" ? "/" : t.replace(/\/$/, "");
|
|
1969
|
-
}
|
|
1970
|
-
/**
|
|
1971
|
-
* Inserts an url path into the trie and associates it with a menu key.
|
|
1972
|
-
*
|
|
1973
|
-
* @param path - The URL path to store (e.g., "/admin/users")
|
|
1974
|
-
* @param menuKey - The menu key to associate with this path
|
|
1975
|
-
*/
|
|
1976
|
-
insertRoute(t, a) {
|
|
1977
|
-
const r = this.normalizePath(t);
|
|
1978
|
-
this.insert(r), this.pathToKey.set(r, a);
|
|
1979
|
-
}
|
|
1980
|
-
/**
|
|
1981
|
-
* Finds the menu key associated with the longest matching route prefix
|
|
1982
|
-
*
|
|
1983
|
-
* @param route - The URL to match against stored menu url paths
|
|
1984
|
-
* @returns The menu key if a valid prefix match is found, undefined otherwise
|
|
1985
|
-
*/
|
|
1986
|
-
findMatchingKey(t) {
|
|
1987
|
-
const a = this.normalizePath(t), r = this.findLongestPrefix(a);
|
|
1988
|
-
if (r.match && this.pathToKey.has(r.match) && (a === r.match || r.remaining.startsWith("/") || r.remaining === ""))
|
|
1989
|
-
return this.pathToKey.get(r.match);
|
|
1990
|
-
}
|
|
1991
|
-
}
|
|
1992
|
-
const Qe = Ct({ link: () => null }), so = ({
|
|
1993
|
-
link: e,
|
|
1994
|
-
children: n
|
|
1995
|
-
}) => /* @__PURE__ */ i.jsx(Qe.Provider, { value: { link: e }, children: n }), Se = ({ value: e }) => /* @__PURE__ */ i.jsx(R, { size: "sm", children: e });
|
|
1996
|
-
function et(e, n) {
|
|
1994
|
+
return c.map((p) => v(p, 0));
|
|
1995
|
+
}, [c, s, o, a, n]);
|
|
1996
|
+
return /* @__PURE__ */ i.jsx(i.Fragment, { children: m });
|
|
1997
|
+
}, je = ({ value: e }) => /* @__PURE__ */ i.jsx(E, { size: "sm", children: e });
|
|
1998
|
+
function Qe(e, n) {
|
|
1997
1999
|
const t = n.getDate().toString().padStart(2, "0"), a = (n.getMonth() + 1).toString().padStart(2, "0"), r = n.getFullYear();
|
|
1998
2000
|
return e.baseName === "en-US" ? `${a}/${t}/${r}` : e.baseName === "vi-VN" ? `${t}/${a}/${r}` : `${a}/${t}/${r}`;
|
|
1999
2001
|
}
|
|
2000
2002
|
const ra = ({ value: e }) => {
|
|
2001
|
-
const n =
|
|
2003
|
+
const n = ke(pe), t = k(() => {
|
|
2002
2004
|
const a = e.getHours().toString().padStart(2, "0"), r = e.getMinutes().toString().padStart(2, "0"), o = e.getSeconds().toString().padStart(2, "0");
|
|
2003
|
-
return
|
|
2005
|
+
return Qe(n, e) + `${a}:${r}:${o}`;
|
|
2004
2006
|
}, [n, e]);
|
|
2005
|
-
return /* @__PURE__ */ i.jsx(
|
|
2007
|
+
return /* @__PURE__ */ i.jsx(E, { size: "sm", children: t });
|
|
2006
2008
|
}, aa = ({ value: e }) => {
|
|
2007
|
-
const n =
|
|
2008
|
-
return /* @__PURE__ */ i.jsx(
|
|
2009
|
+
const n = ke(pe), t = k(() => Qe(n, e), [n, e]);
|
|
2010
|
+
return /* @__PURE__ */ i.jsx(E, { size: "sm", children: t });
|
|
2009
2011
|
}, uo = ({ value: e }) => {
|
|
2010
|
-
const n =
|
|
2011
|
-
const r =
|
|
2012
|
+
const n = ke(pe), [t, a] = k(() => {
|
|
2013
|
+
const r = Qe(n, e), o = e.getHours().toString().padStart(2, "0"), l = e.getMinutes().toString().padStart(2, "0"), s = e.getSeconds().toString().padStart(2, "0");
|
|
2012
2014
|
return [r, `${o}:${l}:${s}`];
|
|
2013
2015
|
}, [n, e]);
|
|
2014
|
-
return /* @__PURE__ */ i.jsx(
|
|
2016
|
+
return /* @__PURE__ */ i.jsx(E, { size: "sm", title: a, children: t });
|
|
2015
2017
|
}, oa = {
|
|
2016
2018
|
yes: {
|
|
2017
2019
|
lang2value: {
|
|
@@ -2028,7 +2030,7 @@ const ra = ({ value: e }) => {
|
|
|
2028
2030
|
lang: "en"
|
|
2029
2031
|
}
|
|
2030
2032
|
}, ia = ({ value: e }) => /* @__PURE__ */ i.jsx(
|
|
2031
|
-
|
|
2033
|
+
me,
|
|
2032
2034
|
{
|
|
2033
2035
|
checked: e,
|
|
2034
2036
|
label: /* @__PURE__ */ i.jsx(O, { value: oa[e ? "yes" : "no"] }),
|
|
@@ -2040,13 +2042,13 @@ const ra = ({ value: e }) => {
|
|
|
2040
2042
|
value: t
|
|
2041
2043
|
}) => {
|
|
2042
2044
|
const a = e || n;
|
|
2043
|
-
if (
|
|
2045
|
+
if (se(a) || a.enumType === void 0)
|
|
2044
2046
|
throw new Error(
|
|
2045
2047
|
"Invalid usage of EnumDisplay. Expect a property of type enum"
|
|
2046
2048
|
);
|
|
2047
|
-
return /* @__PURE__ */ i.jsx(
|
|
2049
|
+
return /* @__PURE__ */ i.jsx(E, { size: "sm", children: /* @__PURE__ */ i.jsx(O, { value: a.enumType.label[t] }) });
|
|
2048
2050
|
};
|
|
2049
|
-
function
|
|
2051
|
+
function Jt(e, n, t, a) {
|
|
2050
2052
|
const r = e.getByName(n.targetClass), o = a[n.targetClass];
|
|
2051
2053
|
Te(() => {
|
|
2052
2054
|
r.fetchByIds(t);
|
|
@@ -2056,59 +2058,69 @@ function Zt(e, n, t, a) {
|
|
|
2056
2058
|
l[s] = r.get(s);
|
|
2057
2059
|
return [l, o];
|
|
2058
2060
|
}
|
|
2059
|
-
const Le =
|
|
2061
|
+
const Le = ee(
|
|
2060
2062
|
({
|
|
2061
2063
|
db: e,
|
|
2062
2064
|
property: n,
|
|
2063
2065
|
value: t,
|
|
2064
2066
|
entityRoutes: a
|
|
2065
2067
|
}) => {
|
|
2066
|
-
const
|
|
2068
|
+
const r = k(() => [t], [t]), [o, l] = Jt(
|
|
2067
2069
|
e,
|
|
2068
2070
|
n,
|
|
2069
|
-
|
|
2071
|
+
r,
|
|
2070
2072
|
a
|
|
2071
|
-
),
|
|
2072
|
-
return
|
|
2073
|
+
), s = o[t];
|
|
2074
|
+
return s === void 0 ? /* @__PURE__ */ i.jsx(E, { size: "sm", children: t }) : s === null ? /* @__PURE__ */ i.jsx(Yt, {}) : l === void 0 ? /* @__PURE__ */ i.jsx(E, { size: "sm", children: s.name }) : /* @__PURE__ */ i.jsx(
|
|
2075
|
+
Nt,
|
|
2076
|
+
{
|
|
2077
|
+
path: l,
|
|
2078
|
+
openInNewPage: !1,
|
|
2079
|
+
urlArgs: { id: s.id },
|
|
2080
|
+
queryArgs: {},
|
|
2081
|
+
children: s.name
|
|
2082
|
+
}
|
|
2083
|
+
);
|
|
2073
2084
|
}
|
|
2074
|
-
), Fe =
|
|
2085
|
+
), Fe = ee(
|
|
2075
2086
|
({
|
|
2076
2087
|
db: e,
|
|
2077
2088
|
property: n,
|
|
2078
2089
|
value: t,
|
|
2079
2090
|
entityRoutes: a
|
|
2080
2091
|
}) => {
|
|
2081
|
-
const
|
|
2092
|
+
const [r, o] = Jt(
|
|
2082
2093
|
e,
|
|
2083
2094
|
n,
|
|
2084
2095
|
t,
|
|
2085
2096
|
a
|
|
2086
2097
|
);
|
|
2087
|
-
return /* @__PURE__ */ i.jsx(D, { gap: "xs", children: t.map((
|
|
2088
|
-
const
|
|
2089
|
-
return
|
|
2090
|
-
|
|
2098
|
+
return /* @__PURE__ */ i.jsx(D, { gap: "xs", children: t.map((l, s) => {
|
|
2099
|
+
const u = r[l];
|
|
2100
|
+
return u === void 0 ? /* @__PURE__ */ i.jsx(E, { size: "sm", children: t }, l) : u === null ? /* @__PURE__ */ i.jsx(Yt, {}, l) : o === void 0 ? /* @__PURE__ */ i.jsx(E, { size: "sm", children: u.name }, s) : /* @__PURE__ */ i.jsx(
|
|
2101
|
+
Nt,
|
|
2091
2102
|
{
|
|
2092
|
-
|
|
2103
|
+
path: o,
|
|
2093
2104
|
openInNewPage: !1,
|
|
2094
|
-
|
|
2095
|
-
|
|
2105
|
+
urlArgs: { id: u.id },
|
|
2106
|
+
queryArgs: {},
|
|
2107
|
+
children: u.name
|
|
2096
2108
|
},
|
|
2097
|
-
|
|
2109
|
+
s
|
|
2098
2110
|
);
|
|
2099
2111
|
}) });
|
|
2100
2112
|
}
|
|
2101
|
-
),
|
|
2102
|
-
string:
|
|
2103
|
-
integer:
|
|
2104
|
-
float:
|
|
2113
|
+
), Q = {
|
|
2114
|
+
string: je,
|
|
2115
|
+
integer: je,
|
|
2116
|
+
float: je,
|
|
2105
2117
|
boolean: ia,
|
|
2106
|
-
"string[]":
|
|
2118
|
+
"string[]": je,
|
|
2107
2119
|
enum: la,
|
|
2108
2120
|
datetime: ra,
|
|
2109
2121
|
date: aa
|
|
2110
2122
|
}, sa = ({ property: e, value: n, onChange: t }) => /* @__PURE__ */ i.jsx(
|
|
2111
|
-
|
|
2123
|
+
W,
|
|
2112
2124
|
{
|
|
2113
2125
|
id: e.name,
|
|
2114
2126
|
type: "checkbox",
|
|
@@ -2118,12 +2130,12 @@ const Le = Z(
|
|
|
2118
2130
|
t(r);
|
|
2119
2131
|
}
|
|
2120
2132
|
}
|
|
2121
|
-
),
|
|
2133
|
+
), gt = ({
|
|
2122
2134
|
property: e,
|
|
2123
2135
|
value: n,
|
|
2124
2136
|
onChange: t
|
|
2125
2137
|
}) => /* @__PURE__ */ i.jsx(
|
|
2126
|
-
|
|
2138
|
+
W,
|
|
2127
2139
|
{
|
|
2128
2140
|
id: e.name,
|
|
2129
2141
|
type: "number",
|
|
@@ -2209,11 +2221,11 @@ const Le = Z(
|
|
|
2209
2221
|
if (a.match === "")
|
|
2210
2222
|
throw new Error(`No valid country code found for phone number: ${e}`);
|
|
2211
2223
|
return a;
|
|
2212
|
-
},
|
|
2224
|
+
}, pt = ({ value: e }) => {
|
|
2213
2225
|
const n = le[e];
|
|
2214
2226
|
if (n !== void 0)
|
|
2215
2227
|
return /* @__PURE__ */ i.jsxs(D, { gap: "sm", wrap: "nowrap", align: "center", children: [
|
|
2216
|
-
/* @__PURE__ */ i.jsxs(
|
|
2228
|
+
/* @__PURE__ */ i.jsxs(E, { size: "sm", children: [
|
|
2217
2229
|
"+",
|
|
2218
2230
|
e
|
|
2219
2231
|
] }),
|
|
@@ -2225,109 +2237,109 @@ const Le = Z(
|
|
|
2225
2237
|
error: t,
|
|
2226
2238
|
id: a
|
|
2227
2239
|
}) => {
|
|
2228
|
-
const [r, o] =
|
|
2229
|
-
const
|
|
2230
|
-
return Object.keys(le).forEach((
|
|
2231
|
-
|
|
2232
|
-
}),
|
|
2233
|
-
}, [le]), { rawInput:
|
|
2240
|
+
const [r, o] = _(""), [l, s] = _(!1), [u, c] = _(""), [d, g] = _(!1), x = k(() => {
|
|
2241
|
+
const y = new Gt();
|
|
2242
|
+
return Object.keys(le).forEach((j) => {
|
|
2243
|
+
y.insert(j);
|
|
2244
|
+
}), y;
|
|
2245
|
+
}, [le]), { rawInput: m } = k(() => {
|
|
2234
2246
|
try {
|
|
2235
|
-
const { match:
|
|
2247
|
+
const { match: y, remaining: j } = da(
|
|
2236
2248
|
e,
|
|
2237
|
-
|
|
2249
|
+
x
|
|
2238
2250
|
);
|
|
2239
|
-
return c(
|
|
2240
|
-
rawInput:
|
|
2251
|
+
return c(y), g(!1), {
|
|
2252
|
+
rawInput: j
|
|
2241
2253
|
};
|
|
2242
2254
|
} catch {
|
|
2243
2255
|
return g(!0), c(""), {
|
|
2244
2256
|
rawInput: e
|
|
2245
2257
|
};
|
|
2246
2258
|
}
|
|
2247
|
-
}, [e]),
|
|
2259
|
+
}, [e]), v = St({
|
|
2248
2260
|
onDropdownClose: () => {
|
|
2249
|
-
|
|
2261
|
+
v.resetSelectedOption(), o("");
|
|
2250
2262
|
},
|
|
2251
2263
|
onDropdownOpen: () => {
|
|
2252
|
-
|
|
2264
|
+
v.updateSelectedOptionIndex("active");
|
|
2253
2265
|
}
|
|
2254
|
-
}),
|
|
2255
|
-
const
|
|
2256
|
-
return
|
|
2257
|
-
},
|
|
2266
|
+
}), p = k(() => Object.keys(le), [le]), w = (y, j) => {
|
|
2267
|
+
const R = y.replace(/[^\d]/g, "");
|
|
2268
|
+
return R.length === 0 ? `+${j}` : R.startsWith("0") ? (s(!0), `+${j}${R}`) : (s(!1), `+${j}${R}`);
|
|
2269
|
+
}, S = k(() => p.filter((y) => le[y].name.toLowerCase().includes(r.toLowerCase()) || y.includes(r)), [r, p]), b = k(() => S.map((y, j) => /* @__PURE__ */ i.jsx(F.Option, { value: y, children: /* @__PURE__ */ i.jsx(pt, { value: y }) }, j)), [S]);
|
|
2258
2270
|
return /* @__PURE__ */ i.jsxs("div", { children: [
|
|
2259
|
-
/* @__PURE__ */ i.jsx(
|
|
2271
|
+
/* @__PURE__ */ i.jsx(A, { gutter: "xs", children: /* @__PURE__ */ i.jsx(A.Col, { children: /* @__PURE__ */ i.jsxs(D, { gap: 5, children: [
|
|
2260
2272
|
/* @__PURE__ */ i.jsxs(
|
|
2261
2273
|
F,
|
|
2262
2274
|
{
|
|
2263
|
-
store:
|
|
2275
|
+
store: v,
|
|
2264
2276
|
position: "top-start",
|
|
2265
|
-
onOptionSubmit: (
|
|
2266
|
-
o(""),
|
|
2267
|
-
target: { value:
|
|
2277
|
+
onOptionSubmit: (y) => {
|
|
2278
|
+
o(""), v.closeDropdown(), n({
|
|
2279
|
+
target: { value: w(m, y) }
|
|
2268
2280
|
});
|
|
2269
2281
|
},
|
|
2270
2282
|
children: [
|
|
2271
2283
|
/* @__PURE__ */ i.jsx(F.Target, { children: /* @__PURE__ */ i.jsx(
|
|
2272
|
-
|
|
2284
|
+
fn,
|
|
2273
2285
|
{
|
|
2274
2286
|
component: "button",
|
|
2275
2287
|
type: "button",
|
|
2276
2288
|
pointer: !0,
|
|
2277
2289
|
rightSection: /* @__PURE__ */ i.jsx(F.Chevron, {}),
|
|
2278
|
-
onClick: () =>
|
|
2290
|
+
onClick: () => v.toggleDropdown(),
|
|
2279
2291
|
rightSectionPointerEvents: "none",
|
|
2280
2292
|
w: 110,
|
|
2281
|
-
children: /* @__PURE__ */ i.jsx(
|
|
2293
|
+
children: /* @__PURE__ */ i.jsx(pt, { value: u })
|
|
2282
2294
|
}
|
|
2283
2295
|
) }),
|
|
2284
2296
|
/* @__PURE__ */ i.jsxs(F.Dropdown, { children: [
|
|
2285
2297
|
/* @__PURE__ */ i.jsx(
|
|
2286
2298
|
F.Search,
|
|
2287
2299
|
{
|
|
2288
|
-
leftSection: /* @__PURE__ */ i.jsx(
|
|
2300
|
+
leftSection: /* @__PURE__ */ i.jsx(Et, { size: 14, stroke: 1.5 }),
|
|
2289
2301
|
placeholder: ".....",
|
|
2290
2302
|
value: r,
|
|
2291
|
-
onChange: (
|
|
2303
|
+
onChange: (y) => o(y.currentTarget.value)
|
|
2292
2304
|
}
|
|
2293
2305
|
),
|
|
2294
|
-
/* @__PURE__ */ i.jsx(F.Options, { children:
|
|
2306
|
+
/* @__PURE__ */ i.jsx(F.Options, { children: b.length > 0 ? b : /* @__PURE__ */ i.jsx(F.Empty, { children: /* @__PURE__ */ i.jsx(E, { size: "sm", children: "Nothing found" }) }) })
|
|
2295
2307
|
] })
|
|
2296
2308
|
]
|
|
2297
2309
|
}
|
|
2298
2310
|
),
|
|
2299
2311
|
u === "" ? /* @__PURE__ */ i.jsx(
|
|
2300
|
-
|
|
2312
|
+
W,
|
|
2301
2313
|
{
|
|
2302
2314
|
id: a,
|
|
2303
|
-
value:
|
|
2315
|
+
value: m,
|
|
2304
2316
|
type: "phone_number",
|
|
2305
|
-
onChange: (
|
|
2306
|
-
n({ target: { value:
|
|
2317
|
+
onChange: (y) => {
|
|
2318
|
+
n({ target: { value: y.target.value } });
|
|
2307
2319
|
},
|
|
2308
2320
|
error: t,
|
|
2309
2321
|
flex: 1
|
|
2310
2322
|
}
|
|
2311
2323
|
) : /* @__PURE__ */ i.jsx(
|
|
2312
|
-
|
|
2324
|
+
W,
|
|
2313
2325
|
{
|
|
2314
2326
|
id: a,
|
|
2315
|
-
value:
|
|
2327
|
+
value: m,
|
|
2316
2328
|
type: "phone_number",
|
|
2317
|
-
onAccept: (
|
|
2318
|
-
const
|
|
2329
|
+
onAccept: (y) => {
|
|
2330
|
+
const j = y.replace(/[^\d]/g, "");
|
|
2319
2331
|
n({
|
|
2320
|
-
target: { value: j
|
|
2332
|
+
target: { value: w(j, u) }
|
|
2321
2333
|
});
|
|
2322
2334
|
},
|
|
2323
|
-
component:
|
|
2335
|
+
component: Nn,
|
|
2324
2336
|
mask: "000-000-0000",
|
|
2325
2337
|
error: t,
|
|
2326
2338
|
flex: 1
|
|
2327
2339
|
}
|
|
2328
2340
|
)
|
|
2329
2341
|
] }) }) }),
|
|
2330
|
-
(l || d || t && typeof t == "string") && /* @__PURE__ */ i.jsx(
|
|
2342
|
+
(l || d || t && typeof t == "string") && /* @__PURE__ */ i.jsx(A, { gutter: "xs", children: /* @__PURE__ */ i.jsx(A.Col, { children: /* @__PURE__ */ i.jsx(W.Error, { children: l ? /* @__PURE__ */ i.jsx(O, { value: ua }) : d ? /* @__PURE__ */ i.jsx(O, { value: ca }) : t }) }) })
|
|
2331
2343
|
] });
|
|
2332
2344
|
}, ze = ({
|
|
2333
2345
|
property: e,
|
|
@@ -2335,7 +2347,7 @@ const Le = Z(
|
|
|
2335
2347
|
value: t,
|
|
2336
2348
|
onChange: a
|
|
2337
2349
|
}) => {
|
|
2338
|
-
const [r, o] =
|
|
2350
|
+
const [r, o] = k(() => e.constraints.includes("password") ? ["password", hn] : e.constraints.includes("phone_number") ? ["phone_number", fa] : [e.constraints.includes("email") ? "email" : e.constraints.includes("url") ? "url" : "text", W], [e.constraints]);
|
|
2339
2351
|
return /* @__PURE__ */ i.jsx(
|
|
2340
2352
|
o,
|
|
2341
2353
|
{
|
|
@@ -2346,16 +2358,16 @@ const Le = Z(
|
|
|
2346
2358
|
error: n
|
|
2347
2359
|
}
|
|
2348
2360
|
);
|
|
2349
|
-
},
|
|
2350
|
-
integer:
|
|
2351
|
-
float:
|
|
2361
|
+
}, xt = {
|
|
2362
|
+
integer: gt,
|
|
2363
|
+
float: gt,
|
|
2352
2364
|
string: ze,
|
|
2353
2365
|
boolean: sa,
|
|
2354
2366
|
"string[]": ze,
|
|
2355
2367
|
enum: ze
|
|
2356
2368
|
};
|
|
2357
2369
|
function ha(e, n) {
|
|
2358
|
-
const [t, a] =
|
|
2370
|
+
const [t, a] = _(""), [r, o] = _([]);
|
|
2359
2371
|
return Te(() => {
|
|
2360
2372
|
e.getByName(n.targetClass).fetch({ limit: 100, offset: 0 }).then((s) => o(s.records));
|
|
2361
2373
|
}, [n.name]), {
|
|
@@ -2373,9 +2385,9 @@ function ha(e, n) {
|
|
|
2373
2385
|
table: e.getByName(n.targetClass)
|
|
2374
2386
|
};
|
|
2375
2387
|
}
|
|
2376
|
-
const ma = (e) => e.name, ga = (e) => /* @__PURE__ */ i.jsx(
|
|
2388
|
+
const ma = (e) => e.name, ga = (e) => /* @__PURE__ */ i.jsx(E, { size: "sm", children: e.name }), pa = ee(
|
|
2377
2389
|
(e) => /* @__PURE__ */ i.jsx("h1", { children: "SingleForeignKey" })
|
|
2378
|
-
), xa =
|
|
2390
|
+
), xa = ee(
|
|
2379
2391
|
({
|
|
2380
2392
|
db: e,
|
|
2381
2393
|
property: n,
|
|
@@ -2386,7 +2398,7 @@ const ma = (e) => e.name, ga = (e) => /* @__PURE__ */ i.jsx(R, { size: "sm", chi
|
|
|
2386
2398
|
e,
|
|
2387
2399
|
n
|
|
2388
2400
|
);
|
|
2389
|
-
return /* @__PURE__ */ i.jsxs(
|
|
2401
|
+
return /* @__PURE__ */ i.jsxs(ge, { gap: "sm", children: [
|
|
2390
2402
|
/* @__PURE__ */ i.jsx(
|
|
2391
2403
|
va,
|
|
2392
2404
|
{
|
|
@@ -2422,9 +2434,9 @@ const ma = (e) => e.name, ga = (e) => /* @__PURE__ */ i.jsx(R, { size: "sm", chi
|
|
|
2422
2434
|
query: o,
|
|
2423
2435
|
setQuery: l
|
|
2424
2436
|
}) => {
|
|
2425
|
-
const s =
|
|
2437
|
+
const s = St({
|
|
2426
2438
|
onDropdownClose: () => s.resetSelectedOption()
|
|
2427
|
-
}), u =
|
|
2439
|
+
}), u = k(() => n.map((c) => (
|
|
2428
2440
|
// value has to be a string
|
|
2429
2441
|
/* @__PURE__ */ i.jsx(F.Option, { value: c.id.toString(), children: a(c) }, c.id)
|
|
2430
2442
|
)), [n]);
|
|
@@ -2439,11 +2451,11 @@ const ma = (e) => e.name, ga = (e) => /* @__PURE__ */ i.jsx(R, { size: "sm", chi
|
|
|
2439
2451
|
shadow: "sm",
|
|
2440
2452
|
children: [
|
|
2441
2453
|
/* @__PURE__ */ i.jsx(F.Target, { children: /* @__PURE__ */ i.jsx(
|
|
2442
|
-
|
|
2454
|
+
W,
|
|
2443
2455
|
{
|
|
2444
2456
|
id: e,
|
|
2445
2457
|
pointer: !0,
|
|
2446
|
-
rightSection: /* @__PURE__ */ i.jsx(
|
|
2458
|
+
rightSection: /* @__PURE__ */ i.jsx(Et, { size: 16, stroke: 1.5 }),
|
|
2447
2459
|
rightSectionPointerEvents: "none",
|
|
2448
2460
|
onClick: () => s.toggleDropdown(),
|
|
2449
2461
|
placeholder: "Type to search...",
|
|
@@ -2462,22 +2474,22 @@ const ma = (e) => e.name, ga = (e) => /* @__PURE__ */ i.jsx(R, { size: "sm", chi
|
|
|
2462
2474
|
onDelete: n,
|
|
2463
2475
|
render: t
|
|
2464
2476
|
}) => {
|
|
2465
|
-
const a =
|
|
2477
|
+
const a = k(() => {
|
|
2466
2478
|
const r = [];
|
|
2467
2479
|
for (let o = 0; o < e.length; o++) {
|
|
2468
2480
|
const l = e[o];
|
|
2469
2481
|
r.push(
|
|
2470
2482
|
/* @__PURE__ */ i.jsxs(D, { justify: "space-between", p: "sm", children: [
|
|
2471
2483
|
t(l),
|
|
2472
|
-
/* @__PURE__ */ i.jsx(
|
|
2484
|
+
/* @__PURE__ */ i.jsx(mn, { size: "sm", onClick: () => n(l) })
|
|
2473
2485
|
] }, o)
|
|
2474
|
-
), o < e.length - 1 && r.push(/* @__PURE__ */ i.jsx(
|
|
2486
|
+
), o < e.length - 1 && r.push(/* @__PURE__ */ i.jsx(gn, {}, `divider-${o}`));
|
|
2475
2487
|
}
|
|
2476
2488
|
return r;
|
|
2477
2489
|
}, [e]);
|
|
2478
2490
|
if (a.length !== 0)
|
|
2479
|
-
return /* @__PURE__ */ i.jsx(
|
|
2480
|
-
}, ba = "_requiredLabelLeft_l5p83_1", wa = "_requiredLabelRight_l5p83_11",
|
|
2491
|
+
return /* @__PURE__ */ i.jsx(re, { bd: "1px solid #ddd", children: a });
|
|
2492
|
+
}, ba = "_requiredLabelLeft_l5p83_1", wa = "_requiredLabelRight_l5p83_11", vt = {
|
|
2481
2493
|
requiredLabelLeft: ba,
|
|
2482
2494
|
requiredLabelRight: wa
|
|
2483
2495
|
}, ja = ({
|
|
@@ -2488,11 +2500,11 @@ const ma = (e) => e.name, ga = (e) => /* @__PURE__ */ i.jsx(R, { size: "sm", chi
|
|
|
2488
2500
|
style: r,
|
|
2489
2501
|
align: o = "left"
|
|
2490
2502
|
}) => {
|
|
2491
|
-
const l = t ? o === "left" ?
|
|
2492
|
-
return /* @__PURE__ */ i.jsx(
|
|
2493
|
-
/* @__PURE__ */ i.jsx(
|
|
2494
|
-
a !== void 0 && /* @__PURE__ */ i.jsx(
|
|
2495
|
-
|
|
2503
|
+
const l = t ? o === "left" ? vt.requiredLabelRight : vt.requiredLabelLeft : "";
|
|
2504
|
+
return /* @__PURE__ */ i.jsx(B, { align: "center", h: 36, children: /* @__PURE__ */ i.jsx("label", { htmlFor: n, style: r, children: /* @__PURE__ */ i.jsxs(D, { gap: 4, children: [
|
|
2505
|
+
/* @__PURE__ */ i.jsx(E, { size: "sm", className: l, children: e }),
|
|
2506
|
+
a !== void 0 && /* @__PURE__ */ i.jsx(Ct, { label: a, withArrow: !0, children: /* @__PURE__ */ i.jsx(
|
|
2507
|
+
kt,
|
|
2496
2508
|
{
|
|
2497
2509
|
size: 16,
|
|
2498
2510
|
stroke: 1.5,
|
|
@@ -2503,7 +2515,7 @@ const ma = (e) => e.name, ga = (e) => /* @__PURE__ */ i.jsx(R, { size: "sm", chi
|
|
|
2503
2515
|
}, Sa = {
|
|
2504
2516
|
type: "vertical",
|
|
2505
2517
|
helpAlwaysVisible: !1
|
|
2506
|
-
}, Ca =
|
|
2518
|
+
}, Ca = ee(
|
|
2507
2519
|
({
|
|
2508
2520
|
store: e,
|
|
2509
2521
|
record: n,
|
|
@@ -2512,24 +2524,24 @@ const ma = (e) => e.name, ga = (e) => /* @__PURE__ */ i.jsx(R, { size: "sm", chi
|
|
|
2512
2524
|
InputComponent: r,
|
|
2513
2525
|
validator: o
|
|
2514
2526
|
}) => {
|
|
2515
|
-
const [l, s] =
|
|
2516
|
-
var
|
|
2517
|
-
if (
|
|
2527
|
+
const [l, s] = _(void 0), u = n[t.tsName], c = (g) => {
|
|
2528
|
+
var m;
|
|
2529
|
+
if (Tt(n))
|
|
2518
2530
|
n[t.updateFuncName](g);
|
|
2519
2531
|
else {
|
|
2520
|
-
const
|
|
2521
|
-
|
|
2532
|
+
const v = n.toDraft();
|
|
2533
|
+
v[t.updateFuncName](g), e.setDraft(v);
|
|
2522
2534
|
}
|
|
2523
|
-
const
|
|
2524
|
-
|
|
2525
|
-
(
|
|
2535
|
+
const x = o(g);
|
|
2536
|
+
x.isValid ? s(void 0) : s(
|
|
2537
|
+
(m = x.errorMessage) == null ? void 0 : m.t({ args: { name: t.label } })
|
|
2526
2538
|
);
|
|
2527
2539
|
};
|
|
2528
2540
|
if (Ra(a))
|
|
2529
|
-
return /* @__PURE__ */ i.jsxs(
|
|
2530
|
-
/* @__PURE__ */ i.jsxs(
|
|
2541
|
+
return /* @__PURE__ */ i.jsxs(ge, { gap: 5, children: [
|
|
2542
|
+
/* @__PURE__ */ i.jsxs(A, { gutter: "sm", children: [
|
|
2531
2543
|
/* @__PURE__ */ i.jsx(
|
|
2532
|
-
|
|
2544
|
+
A.Col,
|
|
2533
2545
|
{
|
|
2534
2546
|
span: a.labelCol,
|
|
2535
2547
|
style: {
|
|
@@ -2548,7 +2560,7 @@ const ma = (e) => e.name, ga = (e) => /* @__PURE__ */ i.jsx(R, { size: "sm", chi
|
|
|
2548
2560
|
)
|
|
2549
2561
|
}
|
|
2550
2562
|
),
|
|
2551
|
-
/* @__PURE__ */ i.jsx(
|
|
2563
|
+
/* @__PURE__ */ i.jsx(A.Col, { span: a.itemCol, children: /* @__PURE__ */ i.jsx(
|
|
2552
2564
|
r,
|
|
2553
2565
|
{
|
|
2554
2566
|
db: e.db,
|
|
@@ -2559,21 +2571,21 @@ const ma = (e) => e.name, ga = (e) => /* @__PURE__ */ i.jsx(R, { size: "sm", chi
|
|
|
2559
2571
|
}
|
|
2560
2572
|
) })
|
|
2561
2573
|
] }),
|
|
2562
|
-
l !== void 0 && /* @__PURE__ */ i.jsxs(
|
|
2563
|
-
/* @__PURE__ */ i.jsx(
|
|
2564
|
-
/* @__PURE__ */ i.jsx(
|
|
2574
|
+
l !== void 0 && /* @__PURE__ */ i.jsxs(A, { gutter: "sm", children: [
|
|
2575
|
+
/* @__PURE__ */ i.jsx(A.Col, { span: a.labelCol }),
|
|
2576
|
+
/* @__PURE__ */ i.jsx(A.Col, { span: a.itemCol, children: /* @__PURE__ */ i.jsx(W.Error, { children: l }) })
|
|
2565
2577
|
] })
|
|
2566
2578
|
] });
|
|
2567
2579
|
let d = /* @__PURE__ */ i.jsx(O, { value: t.label });
|
|
2568
2580
|
return !a.helpAlwaysVisible && t.description !== void 0 && (d = /* @__PURE__ */ i.jsxs(D, { gap: 4, style: { display: "inline-flex" }, children: [
|
|
2569
2581
|
d,
|
|
2570
2582
|
/* @__PURE__ */ i.jsx(
|
|
2571
|
-
|
|
2583
|
+
Ct,
|
|
2572
2584
|
{
|
|
2573
2585
|
label: /* @__PURE__ */ i.jsx(O, { value: t.description }),
|
|
2574
2586
|
withArrow: !0,
|
|
2575
2587
|
children: /* @__PURE__ */ i.jsx(
|
|
2576
|
-
|
|
2588
|
+
kt,
|
|
2577
2589
|
{
|
|
2578
2590
|
size: 16,
|
|
2579
2591
|
stroke: 1.5,
|
|
@@ -2583,7 +2595,7 @@ const ma = (e) => e.name, ga = (e) => /* @__PURE__ */ i.jsx(R, { size: "sm", chi
|
|
|
2583
2595
|
}
|
|
2584
2596
|
)
|
|
2585
2597
|
] })), /* @__PURE__ */ i.jsx(
|
|
2586
|
-
|
|
2598
|
+
W.Wrapper,
|
|
2587
2599
|
{
|
|
2588
2600
|
label: d,
|
|
2589
2601
|
description: a.helpAlwaysVisible && t.description !== void 0 ? /* @__PURE__ */ i.jsx(O, { value: t.description }) : void 0,
|
|
@@ -2605,8 +2617,8 @@ const ma = (e) => e.name, ga = (e) => /* @__PURE__ */ i.jsx(R, { size: "sm", chi
|
|
|
2605
2617
|
function Ra(e) {
|
|
2606
2618
|
return e.type === "horizontal";
|
|
2607
2619
|
}
|
|
2608
|
-
const
|
|
2609
|
-
const n = e.schema, t =
|
|
2620
|
+
const yt = 12, co = (e) => {
|
|
2621
|
+
const n = e.schema, t = k(() => {
|
|
2610
2622
|
const a = Math.max(
|
|
2611
2623
|
...e.fieldGroups.map((r) => Math.max(...r.fields.map((o) => o.length)))
|
|
2612
2624
|
);
|
|
@@ -2624,12 +2636,12 @@ const bt = 12, co = (e) => {
|
|
|
2624
2636
|
"form",
|
|
2625
2637
|
{
|
|
2626
2638
|
onSubmit: e.onSubmit === void 0 ? void 0 : (a) => {
|
|
2627
|
-
a.preventDefault(), e.onSubmit !== void 0 &&
|
|
2639
|
+
a.preventDefault(), e.onSubmit !== void 0 && Tt(e.record) && e.onSubmit(e.record);
|
|
2628
2640
|
},
|
|
2629
|
-
children: /* @__PURE__ */ i.jsxs(
|
|
2641
|
+
children: /* @__PURE__ */ i.jsxs(ge, { gap: "sm", className: e.className, style: e.styles, children: [
|
|
2630
2642
|
t,
|
|
2631
2643
|
/* @__PURE__ */ i.jsx(D, { gap: "sm", children: e.actions.map((a, r) => /* @__PURE__ */ i.jsx(
|
|
2632
|
-
|
|
2644
|
+
q,
|
|
2633
2645
|
{
|
|
2634
2646
|
variant: a.variant,
|
|
2635
2647
|
onClick: () => {
|
|
@@ -2647,11 +2659,11 @@ const bt = 12, co = (e) => {
|
|
|
2647
2659
|
function Ea(e, n, t, a, r, o, l) {
|
|
2648
2660
|
const s = r.fields, u = [];
|
|
2649
2661
|
for (let d = 0; d < s.length; d++) {
|
|
2650
|
-
const g =
|
|
2662
|
+
const g = yt / s[d].length;
|
|
2651
2663
|
if (!Number.isInteger(g))
|
|
2652
2664
|
throw new Error(`Span must be an integer, but got ${g} for row ${d}`);
|
|
2653
|
-
let
|
|
2654
|
-
l !== void 0 && typeof l == "object" && l.type === "horizontal" ?
|
|
2665
|
+
let x;
|
|
2666
|
+
l !== void 0 && typeof l == "object" && l.type === "horizontal" ? x = {
|
|
2655
2667
|
...l,
|
|
2656
2668
|
// the size of labelCol must match the minimum size of labelCol across different groups
|
|
2657
2669
|
// and rows -- if the result isn't a whole number, we may see unaligned labels
|
|
@@ -2659,58 +2671,58 @@ function Ea(e, n, t, a, r, o, l) {
|
|
|
2659
2671
|
labelCol: Math.floor(
|
|
2660
2672
|
l.labelCol * s[d].length / o
|
|
2661
2673
|
),
|
|
2662
|
-
itemCol:
|
|
2663
|
-
} :
|
|
2664
|
-
for (let
|
|
2665
|
-
const
|
|
2666
|
-
let
|
|
2667
|
-
if (
|
|
2668
|
-
|
|
2674
|
+
itemCol: yt - Math.floor(l.labelCol * s[d].length / o)
|
|
2675
|
+
} : x = l;
|
|
2676
|
+
for (let m = 0; m < s[d].length; m++) {
|
|
2677
|
+
const v = s[d][m], p = e.allProperties[v];
|
|
2678
|
+
let w;
|
|
2679
|
+
if (se(p))
|
|
2680
|
+
w = p.cardinality === "N:N" || p.cardinality === "1:N" ? xa : pa;
|
|
2669
2681
|
else {
|
|
2670
|
-
if (
|
|
2682
|
+
if (xt[p.datatype] === void 0)
|
|
2671
2683
|
throw new Error(
|
|
2672
|
-
`No input component found for datatype ${
|
|
2684
|
+
`No input component found for datatype ${p.datatype}`
|
|
2673
2685
|
);
|
|
2674
|
-
|
|
2686
|
+
w = xt[p.datatype];
|
|
2675
2687
|
}
|
|
2676
2688
|
u.push(
|
|
2677
|
-
/* @__PURE__ */ i.jsx(
|
|
2689
|
+
/* @__PURE__ */ i.jsx(A.Col, { span: g, children: /* @__PURE__ */ i.jsx(
|
|
2678
2690
|
Ca,
|
|
2679
2691
|
{
|
|
2680
2692
|
store: n,
|
|
2681
2693
|
record: t,
|
|
2682
|
-
property:
|
|
2683
|
-
layout:
|
|
2684
|
-
InputComponent:
|
|
2685
|
-
validator: e.validators[
|
|
2694
|
+
property: p,
|
|
2695
|
+
layout: x,
|
|
2696
|
+
InputComponent: w,
|
|
2697
|
+
validator: e.validators[v]
|
|
2686
2698
|
}
|
|
2687
|
-
) }, `${d}-${
|
|
2699
|
+
) }, `${d}-${m}`)
|
|
2688
2700
|
);
|
|
2689
2701
|
}
|
|
2690
2702
|
}
|
|
2691
|
-
const c = /* @__PURE__ */ i.jsx(
|
|
2692
|
-
return r.name !== void 0 ? /* @__PURE__ */ i.jsx(
|
|
2703
|
+
const c = /* @__PURE__ */ i.jsx(A, { gutter: "sm", children: u }, a);
|
|
2704
|
+
return r.name !== void 0 ? /* @__PURE__ */ i.jsx(pn, { legend: r.name, children: c }, a) : c;
|
|
2693
2705
|
}
|
|
2694
|
-
const
|
|
2706
|
+
const Xt = ({
|
|
2695
2707
|
actions: e,
|
|
2696
2708
|
reloadData: n,
|
|
2697
2709
|
selectedRowKeys: t,
|
|
2698
2710
|
size: a = "xs"
|
|
2699
2711
|
}) => /* @__PURE__ */ i.jsxs(D, { gap: a, children: [
|
|
2700
2712
|
(e == null ? void 0 : e.add) && /* @__PURE__ */ i.jsx(
|
|
2701
|
-
|
|
2713
|
+
q,
|
|
2702
2714
|
{
|
|
2703
2715
|
variant: "light",
|
|
2704
|
-
leftSection: /* @__PURE__ */ i.jsx(
|
|
2716
|
+
leftSection: /* @__PURE__ */ i.jsx(Sn, { size: 16, stroke: 1.5 }),
|
|
2705
2717
|
size: a,
|
|
2706
2718
|
onClick: e.add,
|
|
2707
2719
|
children: "Add"
|
|
2708
2720
|
}
|
|
2709
2721
|
),
|
|
2710
2722
|
(e == null ? void 0 : e.edit) && /* @__PURE__ */ i.jsx(
|
|
2711
|
-
|
|
2723
|
+
q,
|
|
2712
2724
|
{
|
|
2713
|
-
leftSection: /* @__PURE__ */ i.jsx(
|
|
2725
|
+
leftSection: /* @__PURE__ */ i.jsx(Cn, { size: 16, stroke: 1.5 }),
|
|
2714
2726
|
size: a,
|
|
2715
2727
|
variant: "light",
|
|
2716
2728
|
onClick: () => e.edit !== void 0 && e.edit(t[0]),
|
|
@@ -2719,9 +2731,9 @@ const Qt = ({
|
|
|
2719
2731
|
}
|
|
2720
2732
|
),
|
|
2721
2733
|
(e == null ? void 0 : e.reload) && /* @__PURE__ */ i.jsx(
|
|
2722
|
-
|
|
2734
|
+
q,
|
|
2723
2735
|
{
|
|
2724
|
-
leftSection: /* @__PURE__ */ i.jsx(
|
|
2736
|
+
leftSection: /* @__PURE__ */ i.jsx(Rn, { size: 16, stroke: 1.5 }),
|
|
2725
2737
|
size: a,
|
|
2726
2738
|
onClick: n,
|
|
2727
2739
|
variant: "light",
|
|
@@ -2729,9 +2741,9 @@ const Qt = ({
|
|
|
2729
2741
|
}
|
|
2730
2742
|
),
|
|
2731
2743
|
(e == null ? void 0 : e.import) && /* @__PURE__ */ i.jsx(
|
|
2732
|
-
|
|
2744
|
+
q,
|
|
2733
2745
|
{
|
|
2734
|
-
leftSection: /* @__PURE__ */ i.jsx(
|
|
2746
|
+
leftSection: /* @__PURE__ */ i.jsx(En, { size: 16, stroke: 1.5 }),
|
|
2735
2747
|
size: a,
|
|
2736
2748
|
variant: "light",
|
|
2737
2749
|
onClick: e.import,
|
|
@@ -2739,29 +2751,29 @@ const Qt = ({
|
|
|
2739
2751
|
}
|
|
2740
2752
|
),
|
|
2741
2753
|
(e == null ? void 0 : e.export) && /* @__PURE__ */ i.jsx(
|
|
2742
|
-
|
|
2754
|
+
q,
|
|
2743
2755
|
{
|
|
2744
|
-
leftSection: /* @__PURE__ */ i.jsx(
|
|
2756
|
+
leftSection: /* @__PURE__ */ i.jsx(kn, { size: 16, stroke: 1.5 }),
|
|
2745
2757
|
size: a,
|
|
2746
2758
|
variant: "light",
|
|
2747
2759
|
onClick: e.export,
|
|
2748
2760
|
children: "Export"
|
|
2749
2761
|
}
|
|
2750
2762
|
)
|
|
2751
|
-
] }),
|
|
2763
|
+
] }), Zt = (e) => e !== void 0 && (e.add !== void 0 || e.edit !== void 0 || e.delete !== void 0 || e.export !== void 0 || e.reload === !0 || e.import !== void 0), ka = "__selectcol__", { Thead: Ta, Tr: bt, Th: Na, Tbody: Pa, Td: Ia } = Rt, Qt = (e) => {
|
|
2752
2764
|
const n = /* @__PURE__ */ i.jsxs(
|
|
2753
|
-
|
|
2765
|
+
Rt,
|
|
2754
2766
|
{
|
|
2755
2767
|
striped: !0,
|
|
2756
2768
|
highlightOnHover: !0,
|
|
2757
2769
|
verticalSpacing: "xs",
|
|
2758
2770
|
tabularNums: !0,
|
|
2759
2771
|
children: [
|
|
2760
|
-
/* @__PURE__ */ i.jsx(Ta, { children: e.table.getHeaderGroups().map((a) => /* @__PURE__ */ i.jsx(
|
|
2772
|
+
/* @__PURE__ */ i.jsx(Ta, { children: e.table.getHeaderGroups().map((a) => /* @__PURE__ */ i.jsx(bt, { children: a.headers.map((r) => /* @__PURE__ */ i.jsx(
|
|
2761
2773
|
Na,
|
|
2762
2774
|
{
|
|
2763
2775
|
w: r.id === ka ? "1%" : void 0,
|
|
2764
|
-
children: r.isPlaceholder ? null :
|
|
2776
|
+
children: r.isPlaceholder ? null : lt(
|
|
2765
2777
|
r.column.columnDef.header,
|
|
2766
2778
|
r.getContext()
|
|
2767
2779
|
)
|
|
@@ -2769,10 +2781,10 @@ const Qt = ({
|
|
|
2769
2781
|
r.id
|
|
2770
2782
|
)) }, a.id)) }),
|
|
2771
2783
|
/* @__PURE__ */ i.jsx(Pa, { pos: "relative", children: e.table.getRowModel().rows.map((a) => /* @__PURE__ */ i.jsx(
|
|
2772
|
-
|
|
2784
|
+
bt,
|
|
2773
2785
|
{
|
|
2774
2786
|
bg: e.selectedRowKeys[a.id] ? "var(--mantine-color-blue-light)" : void 0,
|
|
2775
|
-
children: a.getVisibleCells().map((r) => /* @__PURE__ */ i.jsx(Ia, { children:
|
|
2787
|
+
children: a.getVisibleCells().map((r) => /* @__PURE__ */ i.jsx(Ia, { children: lt(r.column.columnDef.cell, r.getContext()) }, r.id))
|
|
2776
2788
|
},
|
|
2777
2789
|
a.id
|
|
2778
2790
|
)) })
|
|
@@ -2781,10 +2793,10 @@ const Qt = ({
|
|
|
2781
2793
|
);
|
|
2782
2794
|
if (!e.bordered) return n;
|
|
2783
2795
|
const t = {};
|
|
2784
|
-
return e.hasTopSection && (t.borderTopLeftRadius = 0, t.borderTopRightRadius = 0), e.hasBottomSection && (t.borderBottomLeftRadius = 0, t.borderBottomRightRadius = 0), /* @__PURE__ */ i.jsx(
|
|
2796
|
+
return e.hasTopSection && (t.borderTopLeftRadius = 0, t.borderTopRightRadius = 0), e.hasBottomSection && (t.borderBottomLeftRadius = 0, t.borderBottomRightRadius = 0), /* @__PURE__ */ i.jsx(re, { withBorder: !0, p: 0, style: t, children: n });
|
|
2785
2797
|
}, La = "_pageSizeSelectorActive_1wv6j_1", Fa = {
|
|
2786
2798
|
pageSizeSelectorActive: La
|
|
2787
|
-
},
|
|
2799
|
+
}, en = ({
|
|
2788
2800
|
total: e,
|
|
2789
2801
|
pageIndex: n,
|
|
2790
2802
|
pageSize: t,
|
|
@@ -2792,7 +2804,7 @@ const Qt = ({
|
|
|
2792
2804
|
onUpdatePagination: r
|
|
2793
2805
|
}) => {
|
|
2794
2806
|
const o = /* @__PURE__ */ i.jsx(
|
|
2795
|
-
|
|
2807
|
+
xn,
|
|
2796
2808
|
{
|
|
2797
2809
|
size: "sm",
|
|
2798
2810
|
total: e,
|
|
@@ -2802,9 +2814,9 @@ const Qt = ({
|
|
|
2802
2814
|
);
|
|
2803
2815
|
return a ? /* @__PURE__ */ i.jsxs(D, { gap: "sm", children: [
|
|
2804
2816
|
/* @__PURE__ */ i.jsxs("div", { children: [
|
|
2805
|
-
/* @__PURE__ */ i.jsx(
|
|
2817
|
+
/* @__PURE__ */ i.jsx(E, { size: "sm", component: "span", pr: "xs", c: "dimmed", children: "Records per page" }),
|
|
2806
2818
|
/* @__PURE__ */ i.jsx(
|
|
2807
|
-
|
|
2819
|
+
Aa,
|
|
2808
2820
|
{
|
|
2809
2821
|
size: "sm",
|
|
2810
2822
|
values: ["10", "20", "50", "100"],
|
|
@@ -2817,30 +2829,30 @@ const Qt = ({
|
|
|
2817
2829
|
] }),
|
|
2818
2830
|
o
|
|
2819
2831
|
] }) : o;
|
|
2820
|
-
},
|
|
2821
|
-
xs:
|
|
2822
|
-
sm:
|
|
2823
|
-
md:
|
|
2824
|
-
lg:
|
|
2825
|
-
xl:
|
|
2832
|
+
}, wt = {
|
|
2833
|
+
xs: ce(22),
|
|
2834
|
+
sm: ce(26),
|
|
2835
|
+
md: ce(32),
|
|
2836
|
+
lg: ce(38),
|
|
2837
|
+
xl: ce(44)
|
|
2826
2838
|
};
|
|
2827
|
-
function
|
|
2839
|
+
function Aa({
|
|
2828
2840
|
size: e,
|
|
2829
2841
|
values: n,
|
|
2830
2842
|
value: t,
|
|
2831
2843
|
onChange: a
|
|
2832
2844
|
}) {
|
|
2833
2845
|
return /* @__PURE__ */ i.jsxs(ie, { withinPortal: !0, withArrow: !0, offset: 2, children: [
|
|
2834
|
-
/* @__PURE__ */ i.jsx(
|
|
2835
|
-
|
|
2846
|
+
/* @__PURE__ */ i.jsx(vn, { children: /* @__PURE__ */ i.jsx(
|
|
2847
|
+
q,
|
|
2836
2848
|
{
|
|
2837
2849
|
size: e,
|
|
2838
2850
|
variant: "default",
|
|
2839
|
-
rightSection: /* @__PURE__ */ i.jsx(
|
|
2851
|
+
rightSection: /* @__PURE__ */ i.jsx(Tn, { size: 16, stroke: 1.5 }),
|
|
2840
2852
|
style: [
|
|
2841
2853
|
{ fontWeight: "normal" },
|
|
2842
2854
|
(r) => ({
|
|
2843
|
-
height:
|
|
2855
|
+
height: wt[e],
|
|
2844
2856
|
paddingLeft: r.spacing[e],
|
|
2845
2857
|
paddingRight: r.spacing[e]
|
|
2846
2858
|
})
|
|
@@ -2853,14 +2865,14 @@ function _a({
|
|
|
2853
2865
|
children: t
|
|
2854
2866
|
}
|
|
2855
2867
|
) }),
|
|
2856
|
-
/* @__PURE__ */ i.jsx(
|
|
2868
|
+
/* @__PURE__ */ i.jsx(yn, { children: n.map((r) => {
|
|
2857
2869
|
const o = r === t;
|
|
2858
2870
|
return /* @__PURE__ */ i.jsx(
|
|
2859
|
-
|
|
2871
|
+
bn,
|
|
2860
2872
|
{
|
|
2861
2873
|
className: o ? Fa.pageSizeSelectorActive : void 0,
|
|
2862
2874
|
style: [
|
|
2863
|
-
{ height:
|
|
2875
|
+
{ height: wt[e] }
|
|
2864
2876
|
// isCurrent
|
|
2865
2877
|
// ? {
|
|
2866
2878
|
// color: "var(--mantine-color-text)",
|
|
@@ -2871,66 +2883,66 @@ function _a({
|
|
|
2871
2883
|
],
|
|
2872
2884
|
disabled: o,
|
|
2873
2885
|
onClick: () => a(r),
|
|
2874
|
-
children: /* @__PURE__ */ i.jsx(
|
|
2886
|
+
children: /* @__PURE__ */ i.jsx(E, { component: "div", size: e, children: r })
|
|
2875
2887
|
},
|
|
2876
2888
|
r
|
|
2877
2889
|
);
|
|
2878
2890
|
}) })
|
|
2879
2891
|
] });
|
|
2880
2892
|
}
|
|
2881
|
-
const
|
|
2882
|
-
var
|
|
2883
|
-
const [n, t] =
|
|
2893
|
+
const _a = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), fo = (e) => {
|
|
2894
|
+
var S, b;
|
|
2895
|
+
const [n, t] = _({
|
|
2884
2896
|
records: [],
|
|
2885
2897
|
total: 0
|
|
2886
|
-
}), [a, r] =
|
|
2898
|
+
}), [a, r] = _(!1), [o, l] = _(
|
|
2887
2899
|
{}
|
|
2888
|
-
), s = (
|
|
2889
|
-
r(!0), e.getData(
|
|
2890
|
-
t(
|
|
2900
|
+
), s = (y) => {
|
|
2901
|
+
r(!0), e.getData(y).then((j) => {
|
|
2902
|
+
t(j), r(!1);
|
|
2891
2903
|
});
|
|
2892
|
-
}, u = (
|
|
2893
|
-
const
|
|
2904
|
+
}, u = (y, j) => {
|
|
2905
|
+
const R = {
|
|
2894
2906
|
...e.query.query,
|
|
2895
|
-
limit:
|
|
2896
|
-
offset:
|
|
2907
|
+
limit: j,
|
|
2908
|
+
offset: y * j
|
|
2897
2909
|
};
|
|
2898
|
-
e.query.update(
|
|
2899
|
-
}, [c, d, g] =
|
|
2900
|
-
const
|
|
2910
|
+
e.query.update(R);
|
|
2911
|
+
}, [c, d, g] = k(() => {
|
|
2912
|
+
const y = e.query.query.limit, j = Math.floor(
|
|
2901
2913
|
(e.query.query.offset || 0) / e.query.query.limit
|
|
2902
|
-
),
|
|
2903
|
-
return [
|
|
2914
|
+
), R = Math.ceil(n.total / e.query.query.limit);
|
|
2915
|
+
return [y, j, R];
|
|
2904
2916
|
}, [e.query.query.limit, e.query.query.offset, n.total]);
|
|
2905
2917
|
Te(() => (n.total == 0 && s(e.query.query), e.query.subscribe(s)), [e.query]);
|
|
2906
|
-
const
|
|
2907
|
-
let
|
|
2908
|
-
|
|
2909
|
-
|
|
2918
|
+
const x = k(() => Object.keys(o).filter((y) => o[y]).map((y) => e.normalizeRowId(y)), [o]);
|
|
2919
|
+
let m, v;
|
|
2920
|
+
Zt(e.actions) && (m = /* @__PURE__ */ i.jsx(
|
|
2921
|
+
Xt,
|
|
2910
2922
|
{
|
|
2911
2923
|
actions: e.actions,
|
|
2912
2924
|
reloadData: () => s(e.query.query),
|
|
2913
|
-
selectedRowKeys:
|
|
2925
|
+
selectedRowKeys: x
|
|
2914
2926
|
}
|
|
2915
2927
|
));
|
|
2916
|
-
const
|
|
2917
|
-
if (
|
|
2918
|
-
const
|
|
2919
|
-
|
|
2928
|
+
const p = ((S = e.pagination) == null ? void 0 : S.positions) || _a;
|
|
2929
|
+
if (p.size > 0) {
|
|
2930
|
+
const y = /* @__PURE__ */ i.jsx(
|
|
2931
|
+
en,
|
|
2920
2932
|
{
|
|
2921
2933
|
total: g,
|
|
2922
2934
|
pageIndex: d,
|
|
2923
2935
|
pageSize: c,
|
|
2924
2936
|
onUpdatePagination: u,
|
|
2925
|
-
allowPageSizeChange: (
|
|
2937
|
+
allowPageSizeChange: (b = e.pagination) == null ? void 0 : b.showSizeChanger
|
|
2926
2938
|
}
|
|
2927
2939
|
);
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
] }) :
|
|
2932
|
-
|
|
2933
|
-
/* @__PURE__ */ i.jsxs(
|
|
2940
|
+
p.has("topRight") && (m !== void 0 ? m = /* @__PURE__ */ i.jsxs(D, { justify: "space-between", gap: "sm", children: [
|
|
2941
|
+
m,
|
|
2942
|
+
y
|
|
2943
|
+
] }) : m = /* @__PURE__ */ i.jsx(B, { justify: "flex-end", children: y })), (p.has("bottomRight") || p.has("bottomLeft") || p.has("bottomCenter")) && (p.has("bottomLeft") ? v = /* @__PURE__ */ i.jsxs(B, { justify: "space-between", align: "center", children: [
|
|
2944
|
+
y,
|
|
2945
|
+
/* @__PURE__ */ i.jsxs(E, { size: "sm", c: "dimmed", children: [
|
|
2934
2946
|
"Showing ",
|
|
2935
2947
|
d * c + 1,
|
|
2936
2948
|
" to",
|
|
@@ -2941,8 +2953,8 @@ const $a = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), fo = (e) => {
|
|
|
2941
2953
|
" ",
|
|
2942
2954
|
"records"
|
|
2943
2955
|
] })
|
|
2944
|
-
] }) :
|
|
2945
|
-
/* @__PURE__ */ i.jsxs(
|
|
2956
|
+
] }) : v = /* @__PURE__ */ i.jsxs(B, { justify: "space-between", align: "center", children: [
|
|
2957
|
+
/* @__PURE__ */ i.jsxs(E, { size: "sm", c: "dimmed", children: [
|
|
2946
2958
|
"Showing ",
|
|
2947
2959
|
d * c + 1,
|
|
2948
2960
|
" to",
|
|
@@ -2953,11 +2965,11 @@ const $a = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), fo = (e) => {
|
|
|
2953
2965
|
" ",
|
|
2954
2966
|
"records"
|
|
2955
2967
|
] }),
|
|
2956
|
-
|
|
2968
|
+
y
|
|
2957
2969
|
] }));
|
|
2958
2970
|
}
|
|
2959
|
-
const
|
|
2960
|
-
|
|
2971
|
+
const w = k(() => /* @__PURE__ */ i.jsx(
|
|
2972
|
+
$a,
|
|
2961
2973
|
{
|
|
2962
2974
|
data: n,
|
|
2963
2975
|
loading: a,
|
|
@@ -2965,8 +2977,8 @@ const $a = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), fo = (e) => {
|
|
|
2965
2977
|
getRowId: e.getRowId,
|
|
2966
2978
|
selectedRowKeys: o,
|
|
2967
2979
|
setSelectedRowKeys: l,
|
|
2968
|
-
hasTopSection:
|
|
2969
|
-
hasBottomSection:
|
|
2980
|
+
hasTopSection: m !== void 0,
|
|
2981
|
+
hasBottomSection: v !== void 0
|
|
2970
2982
|
}
|
|
2971
2983
|
), [
|
|
2972
2984
|
n,
|
|
@@ -2975,12 +2987,12 @@ const $a = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), fo = (e) => {
|
|
|
2975
2987
|
e.getRowId,
|
|
2976
2988
|
o,
|
|
2977
2989
|
l,
|
|
2978
|
-
|
|
2979
|
-
|
|
2990
|
+
m !== void 0,
|
|
2991
|
+
v !== void 0
|
|
2980
2992
|
]);
|
|
2981
|
-
return
|
|
2982
|
-
|
|
2983
|
-
|
|
2993
|
+
return m === void 0 || v === void 0 ? w : /* @__PURE__ */ i.jsxs("div", { children: [
|
|
2994
|
+
m !== void 0 && /* @__PURE__ */ i.jsx(
|
|
2995
|
+
re,
|
|
2984
2996
|
{
|
|
2985
2997
|
withBorder: !0,
|
|
2986
2998
|
p: "xs",
|
|
@@ -2989,12 +3001,12 @@ const $a = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), fo = (e) => {
|
|
|
2989
3001
|
borderBottomRightRadius: 0,
|
|
2990
3002
|
borderBottom: "none"
|
|
2991
3003
|
},
|
|
2992
|
-
children:
|
|
3004
|
+
children: m
|
|
2993
3005
|
}
|
|
2994
3006
|
),
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
3007
|
+
w,
|
|
3008
|
+
v !== void 0 && /* @__PURE__ */ i.jsx(
|
|
3009
|
+
re,
|
|
2998
3010
|
{
|
|
2999
3011
|
withBorder: !0,
|
|
3000
3012
|
p: "xs",
|
|
@@ -3003,17 +3015,17 @@ const $a = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), fo = (e) => {
|
|
|
3003
3015
|
borderTopRightRadius: 0,
|
|
3004
3016
|
borderTop: "none"
|
|
3005
3017
|
},
|
|
3006
|
-
children:
|
|
3018
|
+
children: v
|
|
3007
3019
|
}
|
|
3008
3020
|
)
|
|
3009
3021
|
] });
|
|
3010
|
-
},
|
|
3011
|
-
const n =
|
|
3022
|
+
}, $a = (e) => {
|
|
3023
|
+
const n = k(() => {
|
|
3012
3024
|
const a = [
|
|
3013
3025
|
{
|
|
3014
3026
|
id: "selection",
|
|
3015
3027
|
header: ({ table: r }) => /* @__PURE__ */ i.jsx(
|
|
3016
|
-
|
|
3028
|
+
me,
|
|
3017
3029
|
{
|
|
3018
3030
|
checked: r.getIsAllRowsSelected(),
|
|
3019
3031
|
indeterminate: r.getIsSomeRowsSelected(),
|
|
@@ -3021,7 +3033,7 @@ const $a = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), fo = (e) => {
|
|
|
3021
3033
|
}
|
|
3022
3034
|
),
|
|
3023
3035
|
cell: ({ row: r }) => /* @__PURE__ */ i.jsx(
|
|
3024
|
-
|
|
3036
|
+
me,
|
|
3025
3037
|
{
|
|
3026
3038
|
checked: r.getIsSelected(),
|
|
3027
3039
|
disabled: !r.getCanSelect(),
|
|
@@ -3038,10 +3050,10 @@ const $a = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), fo = (e) => {
|
|
|
3038
3050
|
cell: ({ row: o }) => r.render(o.original)
|
|
3039
3051
|
});
|
|
3040
3052
|
}), a;
|
|
3041
|
-
}, [e.columns]), t =
|
|
3053
|
+
}, [e.columns]), t = Pt({
|
|
3042
3054
|
data: e.data.records,
|
|
3043
3055
|
columns: n,
|
|
3044
|
-
getCoreRowModel:
|
|
3056
|
+
getCoreRowModel: It(),
|
|
3045
3057
|
// convert to string, but we actually can get away with number
|
|
3046
3058
|
getRowId: (a) => e.getRowId(a).toString(),
|
|
3047
3059
|
state: {
|
|
@@ -3051,7 +3063,7 @@ const $a = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), fo = (e) => {
|
|
|
3051
3063
|
manualPagination: !0
|
|
3052
3064
|
});
|
|
3053
3065
|
return /* @__PURE__ */ i.jsx(
|
|
3054
|
-
|
|
3066
|
+
Qt,
|
|
3055
3067
|
{
|
|
3056
3068
|
table: t,
|
|
3057
3069
|
selectedRowKeys: e.selectedRowKeys,
|
|
@@ -3061,7 +3073,7 @@ const $a = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), fo = (e) => {
|
|
|
3061
3073
|
}
|
|
3062
3074
|
);
|
|
3063
3075
|
};
|
|
3064
|
-
function
|
|
3076
|
+
function tn(e, n, t, {
|
|
3065
3077
|
title: a,
|
|
3066
3078
|
nestedKey: r,
|
|
3067
3079
|
component: o
|
|
@@ -3069,14 +3081,14 @@ function rn(e, n, t, {
|
|
|
3069
3081
|
let l;
|
|
3070
3082
|
if (o !== void 0)
|
|
3071
3083
|
l = o;
|
|
3072
|
-
else if (
|
|
3084
|
+
else if (se(t))
|
|
3073
3085
|
t.cardinality === "1:N" || t.cardinality === "N:N" ? l = Fe : l = Le;
|
|
3074
3086
|
else {
|
|
3075
|
-
if (
|
|
3087
|
+
if (Q[t.datatype] === void 0)
|
|
3076
3088
|
throw new Error(
|
|
3077
3089
|
`No display component found for datatype ${t.datatype}`
|
|
3078
3090
|
);
|
|
3079
|
-
l =
|
|
3091
|
+
l = Q[t.datatype];
|
|
3080
3092
|
}
|
|
3081
3093
|
const s = {
|
|
3082
3094
|
key: t.name,
|
|
@@ -3116,14 +3128,14 @@ function ho(e, n, t, a, {
|
|
|
3116
3128
|
let s;
|
|
3117
3129
|
if (l !== void 0)
|
|
3118
3130
|
s = l;
|
|
3119
|
-
else if (
|
|
3131
|
+
else if (se(a))
|
|
3120
3132
|
a.cardinality === "1:N" || a.cardinality === "N:N" ? s = Fe : s = Le;
|
|
3121
3133
|
else {
|
|
3122
|
-
if (
|
|
3134
|
+
if (Q[a.datatype] === void 0)
|
|
3123
3135
|
throw new Error(
|
|
3124
3136
|
`No display component found for datatype ${a.datatype}`
|
|
3125
3137
|
);
|
|
3126
|
-
s =
|
|
3138
|
+
s = Q[a.datatype];
|
|
3127
3139
|
}
|
|
3128
3140
|
const u = {
|
|
3129
3141
|
key: t + "." + a.name,
|
|
@@ -3156,7 +3168,7 @@ function ho(e, n, t, a, {
|
|
|
3156
3168
|
}), u;
|
|
3157
3169
|
}
|
|
3158
3170
|
function mo(e, n, t, a, r = {}) {
|
|
3159
|
-
return a.map((o) =>
|
|
3171
|
+
return a.map((o) => nn(o) ? o : tn(
|
|
3160
3172
|
e,
|
|
3161
3173
|
t,
|
|
3162
3174
|
n.publicProperties[o],
|
|
@@ -3164,63 +3176,63 @@ function mo(e, n, t, a, r = {}) {
|
|
|
3164
3176
|
));
|
|
3165
3177
|
}
|
|
3166
3178
|
function go(e, n, t, a = [], r = {}) {
|
|
3167
|
-
return a.map((o) =>
|
|
3179
|
+
return a.map((o) => nn(o) ? o : tn(
|
|
3168
3180
|
e,
|
|
3169
3181
|
t,
|
|
3170
3182
|
n.publicProperties[o],
|
|
3171
3183
|
r
|
|
3172
3184
|
));
|
|
3173
3185
|
}
|
|
3174
|
-
function
|
|
3186
|
+
function nn(e) {
|
|
3175
3187
|
return typeof e == "object" && "key" in e && "title" in e;
|
|
3176
3188
|
}
|
|
3177
3189
|
const Oa = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), po = (e) => {
|
|
3178
3190
|
var d, g;
|
|
3179
|
-
const [n, t] =
|
|
3191
|
+
const [n, t] = _(
|
|
3180
3192
|
{}
|
|
3181
|
-
), a =
|
|
3182
|
-
const
|
|
3193
|
+
), a = k(() => {
|
|
3194
|
+
const x = [
|
|
3183
3195
|
{
|
|
3184
3196
|
id: "selection",
|
|
3185
|
-
header: ({ table:
|
|
3186
|
-
|
|
3197
|
+
header: ({ table: m }) => /* @__PURE__ */ i.jsx(
|
|
3198
|
+
me,
|
|
3187
3199
|
{
|
|
3188
|
-
checked:
|
|
3189
|
-
indeterminate:
|
|
3190
|
-
onChange:
|
|
3200
|
+
checked: m.getIsAllRowsSelected(),
|
|
3201
|
+
indeterminate: m.getIsSomeRowsSelected(),
|
|
3202
|
+
onChange: m.getToggleAllRowsSelectedHandler()
|
|
3191
3203
|
}
|
|
3192
3204
|
),
|
|
3193
|
-
cell: ({ row:
|
|
3194
|
-
|
|
3205
|
+
cell: ({ row: m }) => /* @__PURE__ */ i.jsx(
|
|
3206
|
+
me,
|
|
3195
3207
|
{
|
|
3196
|
-
checked:
|
|
3197
|
-
disabled: !
|
|
3198
|
-
onChange:
|
|
3208
|
+
checked: m.getIsSelected(),
|
|
3209
|
+
disabled: !m.getCanSelect(),
|
|
3210
|
+
onChange: m.getToggleSelectedHandler()
|
|
3199
3211
|
}
|
|
3200
3212
|
)
|
|
3201
3213
|
}
|
|
3202
3214
|
];
|
|
3203
|
-
return e.columns.forEach((
|
|
3204
|
-
|
|
3205
|
-
id:
|
|
3206
|
-
header:
|
|
3207
|
-
accessorFn:
|
|
3208
|
-
cell: ({ row:
|
|
3215
|
+
return e.columns.forEach((m) => {
|
|
3216
|
+
x.push({
|
|
3217
|
+
id: m.key,
|
|
3218
|
+
header: m.title,
|
|
3219
|
+
accessorFn: m.render,
|
|
3220
|
+
cell: ({ row: v }) => m.render(v.original)
|
|
3209
3221
|
});
|
|
3210
|
-
}),
|
|
3211
|
-
}, [e.columns]), r =
|
|
3222
|
+
}), x;
|
|
3223
|
+
}, [e.columns]), r = Pt({
|
|
3212
3224
|
data: e.data,
|
|
3213
3225
|
columns: a,
|
|
3214
|
-
getCoreRowModel:
|
|
3215
|
-
getPaginationRowModel:
|
|
3226
|
+
getCoreRowModel: It(),
|
|
3227
|
+
getPaginationRowModel: Pn(),
|
|
3216
3228
|
state: {
|
|
3217
3229
|
rowSelection: n
|
|
3218
3230
|
},
|
|
3219
3231
|
onRowSelectionChange: t
|
|
3220
|
-
}), o =
|
|
3232
|
+
}), o = k(() => Object.keys(n).filter((x) => n[x]).map(Number), [n]);
|
|
3221
3233
|
let l, s;
|
|
3222
|
-
|
|
3223
|
-
|
|
3234
|
+
Zt(e.actions) && (l = /* @__PURE__ */ i.jsx(
|
|
3235
|
+
Xt,
|
|
3224
3236
|
{
|
|
3225
3237
|
actions: e.actions,
|
|
3226
3238
|
selectedRowKeys: o
|
|
@@ -3228,28 +3240,28 @@ const Oa = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), po = (e) => {
|
|
|
3228
3240
|
));
|
|
3229
3241
|
const u = ((d = e.pagination) == null ? void 0 : d.positions) || Oa;
|
|
3230
3242
|
if (u.size > 0) {
|
|
3231
|
-
const
|
|
3232
|
-
|
|
3243
|
+
const x = r.getState().pagination, m = /* @__PURE__ */ i.jsx(
|
|
3244
|
+
en,
|
|
3233
3245
|
{
|
|
3234
3246
|
total: r.getPageCount(),
|
|
3235
|
-
pageIndex:
|
|
3236
|
-
pageSize:
|
|
3237
|
-
onUpdatePagination: (
|
|
3247
|
+
pageIndex: x.pageIndex,
|
|
3248
|
+
pageSize: x.pageSize,
|
|
3249
|
+
onUpdatePagination: (v, p) => r.setPagination({ pageIndex: v, pageSize: p }),
|
|
3238
3250
|
allowPageSizeChange: (g = e.pagination) == null ? void 0 : g.showSizeChanger
|
|
3239
3251
|
}
|
|
3240
3252
|
);
|
|
3241
3253
|
u.has("topRight") && (l !== void 0 ? l = /* @__PURE__ */ i.jsxs(D, { justify: "space-between", gap: "sm", children: [
|
|
3242
3254
|
l,
|
|
3243
|
-
|
|
3244
|
-
] }) : l = /* @__PURE__ */ i.jsx(
|
|
3245
|
-
|
|
3246
|
-
/* @__PURE__ */ i.jsxs(
|
|
3255
|
+
m
|
|
3256
|
+
] }) : l = /* @__PURE__ */ i.jsx(B, { justify: "flex-end", children: m })), (u.has("bottomRight") || u.has("bottomLeft") || u.has("bottomCenter")) && (u.has("bottomLeft") ? s = /* @__PURE__ */ i.jsxs(B, { justify: "space-between", align: "center", children: [
|
|
3257
|
+
m,
|
|
3258
|
+
/* @__PURE__ */ i.jsxs(E, { size: "sm", c: "dimmed", children: [
|
|
3247
3259
|
"Showing ",
|
|
3248
|
-
|
|
3260
|
+
x.pageIndex * x.pageSize + 1,
|
|
3249
3261
|
" to",
|
|
3250
3262
|
" ",
|
|
3251
3263
|
Math.min(
|
|
3252
|
-
(
|
|
3264
|
+
(x.pageIndex + 1) * x.pageSize,
|
|
3253
3265
|
e.data.length
|
|
3254
3266
|
),
|
|
3255
3267
|
" ",
|
|
@@ -3257,14 +3269,14 @@ const Oa = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), po = (e) => {
|
|
|
3257
3269
|
e.data.length,
|
|
3258
3270
|
" records"
|
|
3259
3271
|
] })
|
|
3260
|
-
] }) : s = /* @__PURE__ */ i.jsxs(
|
|
3261
|
-
/* @__PURE__ */ i.jsxs(
|
|
3272
|
+
] }) : s = /* @__PURE__ */ i.jsxs(B, { justify: "space-between", align: "center", children: [
|
|
3273
|
+
/* @__PURE__ */ i.jsxs(E, { size: "sm", c: "dimmed", children: [
|
|
3262
3274
|
"Showing ",
|
|
3263
|
-
|
|
3275
|
+
x.pageIndex * x.pageSize + 1,
|
|
3264
3276
|
" to",
|
|
3265
3277
|
" ",
|
|
3266
3278
|
Math.min(
|
|
3267
|
-
(
|
|
3279
|
+
(x.pageIndex + 1) * x.pageSize,
|
|
3268
3280
|
e.data.length
|
|
3269
3281
|
),
|
|
3270
3282
|
" ",
|
|
@@ -3272,11 +3284,11 @@ const Oa = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), po = (e) => {
|
|
|
3272
3284
|
e.data.length,
|
|
3273
3285
|
" records"
|
|
3274
3286
|
] }),
|
|
3275
|
-
|
|
3287
|
+
m
|
|
3276
3288
|
] }));
|
|
3277
3289
|
}
|
|
3278
3290
|
const c = /* @__PURE__ */ i.jsx(
|
|
3279
|
-
|
|
3291
|
+
Qt,
|
|
3280
3292
|
{
|
|
3281
3293
|
selectedRowKeys: n,
|
|
3282
3294
|
table: r,
|
|
@@ -3287,7 +3299,7 @@ const Oa = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), po = (e) => {
|
|
|
3287
3299
|
);
|
|
3288
3300
|
return l === void 0 && s === void 0 ? c : /* @__PURE__ */ i.jsxs("div", { children: [
|
|
3289
3301
|
l !== void 0 && /* @__PURE__ */ i.jsx(
|
|
3290
|
-
|
|
3302
|
+
re,
|
|
3291
3303
|
{
|
|
3292
3304
|
withBorder: !0,
|
|
3293
3305
|
p: "xs",
|
|
@@ -3301,7 +3313,7 @@ const Oa = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), po = (e) => {
|
|
|
3301
3313
|
),
|
|
3302
3314
|
c,
|
|
3303
3315
|
s !== void 0 && /* @__PURE__ */ i.jsx(
|
|
3304
|
-
|
|
3316
|
+
re,
|
|
3305
3317
|
{
|
|
3306
3318
|
withBorder: !0,
|
|
3307
3319
|
p: "xs",
|
|
@@ -3314,7 +3326,7 @@ const Oa = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), po = (e) => {
|
|
|
3314
3326
|
}
|
|
3315
3327
|
)
|
|
3316
3328
|
] });
|
|
3317
|
-
},
|
|
3329
|
+
}, jt = ee(
|
|
3318
3330
|
({
|
|
3319
3331
|
store: e,
|
|
3320
3332
|
record: n,
|
|
@@ -3324,7 +3336,7 @@ const Oa = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), po = (e) => {
|
|
|
3324
3336
|
}) => {
|
|
3325
3337
|
const o = n[t.tsName];
|
|
3326
3338
|
return /* @__PURE__ */ i.jsxs("div", { children: [
|
|
3327
|
-
/* @__PURE__ */ i.jsx(
|
|
3339
|
+
/* @__PURE__ */ i.jsx(E, { size: "sm", fw: 550, children: /* @__PURE__ */ i.jsx(O, { value: t.label }) }),
|
|
3328
3340
|
/* @__PURE__ */ i.jsx(
|
|
3329
3341
|
a,
|
|
3330
3342
|
{
|
|
@@ -3336,7 +3348,7 @@ const Oa = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), po = (e) => {
|
|
|
3336
3348
|
)
|
|
3337
3349
|
] });
|
|
3338
3350
|
}
|
|
3339
|
-
), Da =
|
|
3351
|
+
), Da = ee(
|
|
3340
3352
|
({
|
|
3341
3353
|
store: e,
|
|
3342
3354
|
record: n,
|
|
@@ -3349,7 +3361,7 @@ const Oa = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), po = (e) => {
|
|
|
3349
3361
|
return s[u.tsName];
|
|
3350
3362
|
}, n);
|
|
3351
3363
|
return /* @__PURE__ */ i.jsxs("div", { children: [
|
|
3352
|
-
/* @__PURE__ */ i.jsx(
|
|
3364
|
+
/* @__PURE__ */ i.jsx(E, { size: "sm", fw: 550, children: /* @__PURE__ */ i.jsx(O, { value: o.label }) }),
|
|
3353
3365
|
l !== void 0 && /* @__PURE__ */ i.jsx(
|
|
3354
3366
|
a,
|
|
3355
3367
|
{
|
|
@@ -3362,7 +3374,7 @@ const Oa = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), po = (e) => {
|
|
|
3362
3374
|
] });
|
|
3363
3375
|
}
|
|
3364
3376
|
), Ma = 12, za = (e) => {
|
|
3365
|
-
const n = e.schema, t =
|
|
3377
|
+
const n = e.schema, t = k(() => e.fieldGroups.map((a, r) => Ba(
|
|
3366
3378
|
n,
|
|
3367
3379
|
e.store,
|
|
3368
3380
|
e.record,
|
|
@@ -3370,7 +3382,7 @@ const Oa = /* @__PURE__ */ new Set(["topRight", "bottomRight"]), po = (e) => {
|
|
|
3370
3382
|
a,
|
|
3371
3383
|
e.entityRoutes
|
|
3372
3384
|
)), [n, e.store, e.record, e.fieldGroups]);
|
|
3373
|
-
return /* @__PURE__ */ i.jsx(
|
|
3385
|
+
return /* @__PURE__ */ i.jsx(ge, { gap: "sm", className: e.className, style: e.styles, children: t });
|
|
3374
3386
|
};
|
|
3375
3387
|
function Ba(e, n, t, a, r, o) {
|
|
3376
3388
|
const l = r.fields, s = [];
|
|
@@ -3380,64 +3392,64 @@ function Ba(e, n, t, a, r, o) {
|
|
|
3380
3392
|
throw new Error(`Span must be an integer, but got ${c} for row ${u}`);
|
|
3381
3393
|
for (let d = 0; d < l[u].length; d++) {
|
|
3382
3394
|
const g = l[u][d];
|
|
3383
|
-
let
|
|
3395
|
+
let x;
|
|
3384
3396
|
if (typeof g == "function")
|
|
3385
|
-
|
|
3397
|
+
x = g(n, t);
|
|
3386
3398
|
else if (typeof g == "object" && "prop" in g) {
|
|
3387
|
-
const
|
|
3388
|
-
|
|
3389
|
-
|
|
3399
|
+
const m = e.allProperties[g.prop], v = g.display;
|
|
3400
|
+
x = /* @__PURE__ */ i.jsx(
|
|
3401
|
+
jt,
|
|
3390
3402
|
{
|
|
3391
3403
|
store: n,
|
|
3392
3404
|
record: t,
|
|
3393
|
-
property:
|
|
3394
|
-
DisplayComponent:
|
|
3405
|
+
property: m,
|
|
3406
|
+
DisplayComponent: v,
|
|
3395
3407
|
entityRoutes: o
|
|
3396
3408
|
}
|
|
3397
3409
|
);
|
|
3398
3410
|
} else {
|
|
3399
|
-
const
|
|
3400
|
-
let
|
|
3401
|
-
if (
|
|
3402
|
-
|
|
3411
|
+
const m = e.allProperties[g];
|
|
3412
|
+
let v;
|
|
3413
|
+
if (se(m))
|
|
3414
|
+
v = m.cardinality === "N:N" || m.cardinality === "1:N" ? Fe : Le;
|
|
3403
3415
|
else {
|
|
3404
|
-
if (
|
|
3416
|
+
if (Q[m.datatype] === void 0)
|
|
3405
3417
|
throw new Error(
|
|
3406
|
-
`No display component found for datatype ${
|
|
3418
|
+
`No display component found for datatype ${m.datatype}`
|
|
3407
3419
|
);
|
|
3408
|
-
|
|
3420
|
+
v = Q[m.datatype];
|
|
3409
3421
|
}
|
|
3410
|
-
|
|
3411
|
-
|
|
3422
|
+
x = /* @__PURE__ */ i.jsx(
|
|
3423
|
+
jt,
|
|
3412
3424
|
{
|
|
3413
3425
|
store: n,
|
|
3414
3426
|
record: t,
|
|
3415
|
-
property:
|
|
3416
|
-
DisplayComponent:
|
|
3427
|
+
property: m,
|
|
3428
|
+
DisplayComponent: v,
|
|
3417
3429
|
entityRoutes: o
|
|
3418
3430
|
}
|
|
3419
3431
|
);
|
|
3420
3432
|
}
|
|
3421
3433
|
s.push(
|
|
3422
|
-
/* @__PURE__ */ i.jsx(
|
|
3434
|
+
/* @__PURE__ */ i.jsx(A.Col, { span: c, children: x }, `${u}-${d}`)
|
|
3423
3435
|
);
|
|
3424
3436
|
}
|
|
3425
3437
|
}
|
|
3426
|
-
return /* @__PURE__ */ i.jsx(
|
|
3438
|
+
return /* @__PURE__ */ i.jsx(A, { gutter: "sm", children: s }, a);
|
|
3427
3439
|
}
|
|
3428
3440
|
function xo(e, n, t) {
|
|
3429
3441
|
const a = e[e.length - 1];
|
|
3430
3442
|
let r;
|
|
3431
3443
|
if (t !== void 0)
|
|
3432
3444
|
r = t;
|
|
3433
|
-
else if (
|
|
3445
|
+
else if (se(a))
|
|
3434
3446
|
r = a.cardinality === "N:N" || a.cardinality === "1:N" ? Fe : Le;
|
|
3435
3447
|
else {
|
|
3436
|
-
if (
|
|
3448
|
+
if (Q[a.datatype] === void 0)
|
|
3437
3449
|
throw new Error(
|
|
3438
3450
|
`No display component found for datatype ${a.datatype}`
|
|
3439
3451
|
);
|
|
3440
|
-
r =
|
|
3452
|
+
r = Q[a.datatype];
|
|
3441
3453
|
}
|
|
3442
3454
|
return (o, l) => /* @__PURE__ */ i.jsx(
|
|
3443
3455
|
Da,
|
|
@@ -3450,9 +3462,9 @@ function xo(e, n, t) {
|
|
|
3450
3462
|
}
|
|
3451
3463
|
);
|
|
3452
3464
|
}
|
|
3453
|
-
const vo = (e) => /* @__PURE__ */ i.jsxs(
|
|
3454
|
-
/* @__PURE__ */ i.jsx(
|
|
3455
|
-
e.fieldTabs.map((n, t) => /* @__PURE__ */ i.jsx(
|
|
3465
|
+
const vo = (e) => /* @__PURE__ */ i.jsxs(ve, { defaultValue: e.fieldTabs[0].tabName, children: [
|
|
3466
|
+
/* @__PURE__ */ i.jsx(ve.List, { children: e.fieldTabs.map((n, t) => /* @__PURE__ */ i.jsx(ve.Tab, { value: n.tabName, children: n.tabName }, t)) }),
|
|
3467
|
+
e.fieldTabs.map((n, t) => /* @__PURE__ */ i.jsx(ve.Panel, { value: n.tabName, pt: "sm", children: /* @__PURE__ */ i.jsx(
|
|
3456
3468
|
za,
|
|
3457
3469
|
{
|
|
3458
3470
|
schema: e.schema,
|
|
@@ -3467,51 +3479,49 @@ const vo = (e) => /* @__PURE__ */ i.jsxs(ye, { defaultValue: e.fieldTabs[0].tabN
|
|
|
3467
3479
|
] });
|
|
3468
3480
|
export {
|
|
3469
3481
|
Be as CountryFlagComponent,
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3482
|
+
_a as DEFAULT_PAGINATION_POSITIONS,
|
|
3483
|
+
xt as DataType2Component,
|
|
3484
|
+
Q as DataType2DisplayComponent,
|
|
3473
3485
|
aa as DateDisplay,
|
|
3474
3486
|
ra as DateTimeDisplay,
|
|
3475
3487
|
uo as DateTimeHideTimeDisplay,
|
|
3476
|
-
|
|
3477
|
-
Qe as ExternalComponentContext,
|
|
3478
|
-
so as ExternalComponentProvider,
|
|
3488
|
+
_n as EmojiCountryFlag,
|
|
3479
3489
|
Ca as FormItem,
|
|
3480
3490
|
ja as FormItemLabel,
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3491
|
+
Za as LanguageSelector,
|
|
3492
|
+
to as Loading,
|
|
3493
|
+
no as LoadingInline,
|
|
3494
|
+
pe as LocaleContext,
|
|
3495
|
+
Xa as LocaleProvider,
|
|
3496
|
+
Qr as MenuTrie,
|
|
3487
3497
|
Fe as MultiForeignKeyDisplay,
|
|
3488
3498
|
O as MultiLingualString,
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3499
|
+
ro as NotAuthorized,
|
|
3500
|
+
Qa as NotFound,
|
|
3501
|
+
Yt as NotFoundInline,
|
|
3502
|
+
eo as NotFoundSubPage,
|
|
3503
|
+
lo as OrderedUniqueList,
|
|
3504
|
+
Zr as Permission,
|
|
3505
|
+
An as SVGCountryFlag,
|
|
3496
3506
|
po as SeraEmbeddedTable,
|
|
3497
3507
|
co as SeraForm,
|
|
3498
3508
|
fo as SeraTable,
|
|
3499
|
-
|
|
3509
|
+
so as SeraVerticalMenu,
|
|
3500
3510
|
za as SeraView,
|
|
3501
3511
|
vo as SeraViewTab,
|
|
3502
3512
|
Le as SingleForeignKeyDisplay,
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3513
|
+
Gt as Trie,
|
|
3514
|
+
mt as TrieNode,
|
|
3515
|
+
ea as buildMenuItemIndex,
|
|
3506
3516
|
N as countryFlags,
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3517
|
+
na as filterAllowedItems,
|
|
3518
|
+
ao as groupBy,
|
|
3519
|
+
oo as groupByAsList,
|
|
3520
|
+
nn as isSeraColumn,
|
|
3511
3521
|
go as makeEmbeddedTableColumns,
|
|
3512
3522
|
xo as makeFieldDisplay,
|
|
3513
|
-
|
|
3523
|
+
tn as makeTableColumn,
|
|
3514
3524
|
ho as makeTableColumnFromNestedProperty,
|
|
3515
3525
|
mo as makeTableColumns,
|
|
3516
|
-
|
|
3526
|
+
io as uniqueList
|
|
3517
3527
|
};
|