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