@mathwiz/ui-components 0.1.2 → 0.1.4
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/README.md +637 -67
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/index.cjs +27 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4249 -41
- package/dist/index.mjs.map +1 -1
- package/dist/mocks/handlers.d.ts.map +1 -1
- package/dist/pages/GradeUnitBrowserPage/GradeUnitBrowserContext.d.ts.map +1 -1
- package/package.json +6 -13
- package/dist/index-B6Xq3xq4.js +0 -11909
- package/dist/index-B6Xq3xq4.js.map +0 -1
- package/dist/index-ts2rjY-1.js +0 -2596
- package/dist/index-ts2rjY-1.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,44 +1,4252 @@
|
|
|
1
|
-
import
|
|
1
|
+
import V, { forwardRef as rn, createElement as lt, useEffect as qe, createContext as is, useState as ae, useCallback as st, useContext as as } from "react";
|
|
2
|
+
import { Progress as ls } from "@heroui/progress";
|
|
3
|
+
import { Card as cs, CardBody as us, CardFooter as ds } from "@heroui/card";
|
|
4
|
+
import { Progress as fs, Avatar as ms, Card as ps, CardBody as hs, Button as gs } from "@heroui/react";
|
|
5
|
+
var Ie = { exports: {} }, ve = {};
|
|
6
|
+
/**
|
|
7
|
+
* @license React
|
|
8
|
+
* react-jsx-runtime.production.min.js
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
var Ut;
|
|
16
|
+
function bs() {
|
|
17
|
+
if (Ut) return ve;
|
|
18
|
+
Ut = 1;
|
|
19
|
+
var e = V, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, r = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
20
|
+
function o(l, m, f) {
|
|
21
|
+
var u, h = {}, x = null, j = null;
|
|
22
|
+
f !== void 0 && (x = "" + f), m.key !== void 0 && (x = "" + m.key), m.ref !== void 0 && (j = m.ref);
|
|
23
|
+
for (u in m) s.call(m, u) && !i.hasOwnProperty(u) && (h[u] = m[u]);
|
|
24
|
+
if (l && l.defaultProps) for (u in m = l.defaultProps, m) h[u] === void 0 && (h[u] = m[u]);
|
|
25
|
+
return { $$typeof: t, type: l, key: x, ref: j, props: h, _owner: r.current };
|
|
26
|
+
}
|
|
27
|
+
return ve.Fragment = n, ve.jsx = o, ve.jsxs = o, ve;
|
|
28
|
+
}
|
|
29
|
+
var Ee = {};
|
|
30
|
+
/**
|
|
31
|
+
* @license React
|
|
32
|
+
* react-jsx-runtime.development.js
|
|
33
|
+
*
|
|
34
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the MIT license found in the
|
|
37
|
+
* LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/
|
|
39
|
+
var Pt;
|
|
40
|
+
function _s() {
|
|
41
|
+
return Pt || (Pt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
42
|
+
var e = V, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), l = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), j = Symbol.for("react.offscreen"), p = Symbol.iterator, y = "@@iterator";
|
|
43
|
+
function g(a) {
|
|
44
|
+
if (a === null || typeof a != "object")
|
|
45
|
+
return null;
|
|
46
|
+
var b = p && a[p] || a[y];
|
|
47
|
+
return typeof b == "function" ? b : null;
|
|
48
|
+
}
|
|
49
|
+
var v = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
50
|
+
function A(a) {
|
|
51
|
+
{
|
|
52
|
+
for (var b = arguments.length, _ = new Array(b > 1 ? b - 1 : 0), E = 1; E < b; E++)
|
|
53
|
+
_[E - 1] = arguments[E];
|
|
54
|
+
C("error", a, _);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function C(a, b, _) {
|
|
58
|
+
{
|
|
59
|
+
var E = v.ReactDebugCurrentFrame, O = E.getStackAddendum();
|
|
60
|
+
O !== "" && (b += "%s", _ = _.concat([O]));
|
|
61
|
+
var P = _.map(function(N) {
|
|
62
|
+
return String(N);
|
|
63
|
+
});
|
|
64
|
+
P.unshift("Warning: " + b), Function.prototype.apply.call(console[a], console, P);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
var T = !1, R = !1, U = !1, w = !1, D = !1, $;
|
|
68
|
+
$ = Symbol.for("react.module.reference");
|
|
69
|
+
function Q(a) {
|
|
70
|
+
return !!(typeof a == "string" || typeof a == "function" || a === s || a === i || D || a === r || a === f || a === u || w || a === j || T || R || U || typeof a == "object" && a !== null && (a.$$typeof === x || a.$$typeof === h || a.$$typeof === o || a.$$typeof === l || a.$$typeof === m || // This needs to include all possible module reference object
|
|
71
|
+
// types supported by any Flight configuration anywhere since
|
|
72
|
+
// we don't know which Flight build this will end up being used
|
|
73
|
+
// with.
|
|
74
|
+
a.$$typeof === $ || a.getModuleId !== void 0));
|
|
75
|
+
}
|
|
76
|
+
function B(a, b, _) {
|
|
77
|
+
var E = a.displayName;
|
|
78
|
+
if (E)
|
|
79
|
+
return E;
|
|
80
|
+
var O = b.displayName || b.name || "";
|
|
81
|
+
return O !== "" ? _ + "(" + O + ")" : _;
|
|
82
|
+
}
|
|
83
|
+
function L(a) {
|
|
84
|
+
return a.displayName || "Context";
|
|
85
|
+
}
|
|
86
|
+
function q(a) {
|
|
87
|
+
if (a == null)
|
|
88
|
+
return null;
|
|
89
|
+
if (typeof a.tag == "number" && A("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof a == "function")
|
|
90
|
+
return a.displayName || a.name || null;
|
|
91
|
+
if (typeof a == "string")
|
|
92
|
+
return a;
|
|
93
|
+
switch (a) {
|
|
94
|
+
case s:
|
|
95
|
+
return "Fragment";
|
|
96
|
+
case n:
|
|
97
|
+
return "Portal";
|
|
98
|
+
case i:
|
|
99
|
+
return "Profiler";
|
|
100
|
+
case r:
|
|
101
|
+
return "StrictMode";
|
|
102
|
+
case f:
|
|
103
|
+
return "Suspense";
|
|
104
|
+
case u:
|
|
105
|
+
return "SuspenseList";
|
|
106
|
+
}
|
|
107
|
+
if (typeof a == "object")
|
|
108
|
+
switch (a.$$typeof) {
|
|
109
|
+
case l:
|
|
110
|
+
var b = a;
|
|
111
|
+
return L(b) + ".Consumer";
|
|
112
|
+
case o:
|
|
113
|
+
var _ = a;
|
|
114
|
+
return L(_._context) + ".Provider";
|
|
115
|
+
case m:
|
|
116
|
+
return B(a, a.render, "ForwardRef");
|
|
117
|
+
case h:
|
|
118
|
+
var E = a.displayName || null;
|
|
119
|
+
return E !== null ? E : q(a.type) || "Memo";
|
|
120
|
+
case x: {
|
|
121
|
+
var O = a, P = O._payload, N = O._init;
|
|
122
|
+
try {
|
|
123
|
+
return q(N(P));
|
|
124
|
+
} catch {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
var z = Object.assign, ie = 0, X, ye, ee, xe, Ne, te, oe;
|
|
132
|
+
function fe() {
|
|
133
|
+
}
|
|
134
|
+
fe.__reactDisabledLog = !0;
|
|
135
|
+
function me() {
|
|
136
|
+
{
|
|
137
|
+
if (ie === 0) {
|
|
138
|
+
X = console.log, ye = console.info, ee = console.warn, xe = console.error, Ne = console.group, te = console.groupCollapsed, oe = console.groupEnd;
|
|
139
|
+
var a = {
|
|
140
|
+
configurable: !0,
|
|
141
|
+
enumerable: !0,
|
|
142
|
+
value: fe,
|
|
143
|
+
writable: !0
|
|
144
|
+
};
|
|
145
|
+
Object.defineProperties(console, {
|
|
146
|
+
info: a,
|
|
147
|
+
log: a,
|
|
148
|
+
warn: a,
|
|
149
|
+
error: a,
|
|
150
|
+
group: a,
|
|
151
|
+
groupCollapsed: a,
|
|
152
|
+
groupEnd: a
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
ie++;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function Oe() {
|
|
159
|
+
{
|
|
160
|
+
if (ie--, ie === 0) {
|
|
161
|
+
var a = {
|
|
162
|
+
configurable: !0,
|
|
163
|
+
enumerable: !0,
|
|
164
|
+
writable: !0
|
|
165
|
+
};
|
|
166
|
+
Object.defineProperties(console, {
|
|
167
|
+
log: z({}, a, {
|
|
168
|
+
value: X
|
|
169
|
+
}),
|
|
170
|
+
info: z({}, a, {
|
|
171
|
+
value: ye
|
|
172
|
+
}),
|
|
173
|
+
warn: z({}, a, {
|
|
174
|
+
value: ee
|
|
175
|
+
}),
|
|
176
|
+
error: z({}, a, {
|
|
177
|
+
value: xe
|
|
178
|
+
}),
|
|
179
|
+
group: z({}, a, {
|
|
180
|
+
value: Ne
|
|
181
|
+
}),
|
|
182
|
+
groupCollapsed: z({}, a, {
|
|
183
|
+
value: te
|
|
184
|
+
}),
|
|
185
|
+
groupEnd: z({}, a, {
|
|
186
|
+
value: oe
|
|
187
|
+
})
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
ie < 0 && A("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
var Ge = v.ReactCurrentDispatcher, Ye;
|
|
194
|
+
function Te(a, b, _) {
|
|
195
|
+
{
|
|
196
|
+
if (Ye === void 0)
|
|
197
|
+
try {
|
|
198
|
+
throw Error();
|
|
199
|
+
} catch (O) {
|
|
200
|
+
var E = O.stack.trim().match(/\n( *(at )?)/);
|
|
201
|
+
Ye = E && E[1] || "";
|
|
202
|
+
}
|
|
203
|
+
return `
|
|
204
|
+
` + Ye + a;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
var Xe = !1, Ue;
|
|
208
|
+
{
|
|
209
|
+
var Ln = typeof WeakMap == "function" ? WeakMap : Map;
|
|
210
|
+
Ue = new Ln();
|
|
211
|
+
}
|
|
212
|
+
function _t(a, b) {
|
|
213
|
+
if (!a || Xe)
|
|
214
|
+
return "";
|
|
215
|
+
{
|
|
216
|
+
var _ = Ue.get(a);
|
|
217
|
+
if (_ !== void 0)
|
|
218
|
+
return _;
|
|
219
|
+
}
|
|
220
|
+
var E;
|
|
221
|
+
Xe = !0;
|
|
222
|
+
var O = Error.prepareStackTrace;
|
|
223
|
+
Error.prepareStackTrace = void 0;
|
|
224
|
+
var P;
|
|
225
|
+
P = Ge.current, Ge.current = null, me();
|
|
226
|
+
try {
|
|
227
|
+
if (b) {
|
|
228
|
+
var N = function() {
|
|
229
|
+
throw Error();
|
|
230
|
+
};
|
|
231
|
+
if (Object.defineProperty(N.prototype, "props", {
|
|
232
|
+
set: function() {
|
|
233
|
+
throw Error();
|
|
234
|
+
}
|
|
235
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
236
|
+
try {
|
|
237
|
+
Reflect.construct(N, []);
|
|
238
|
+
} catch (K) {
|
|
239
|
+
E = K;
|
|
240
|
+
}
|
|
241
|
+
Reflect.construct(a, [], N);
|
|
242
|
+
} else {
|
|
243
|
+
try {
|
|
244
|
+
N.call();
|
|
245
|
+
} catch (K) {
|
|
246
|
+
E = K;
|
|
247
|
+
}
|
|
248
|
+
a.call(N.prototype);
|
|
249
|
+
}
|
|
250
|
+
} else {
|
|
251
|
+
try {
|
|
252
|
+
throw Error();
|
|
253
|
+
} catch (K) {
|
|
254
|
+
E = K;
|
|
255
|
+
}
|
|
256
|
+
a();
|
|
257
|
+
}
|
|
258
|
+
} catch (K) {
|
|
259
|
+
if (K && E && typeof K.stack == "string") {
|
|
260
|
+
for (var k = K.stack.split(`
|
|
261
|
+
`), J = E.stack.split(`
|
|
262
|
+
`), M = k.length - 1, F = J.length - 1; M >= 1 && F >= 0 && k[M] !== J[F]; )
|
|
263
|
+
F--;
|
|
264
|
+
for (; M >= 1 && F >= 0; M--, F--)
|
|
265
|
+
if (k[M] !== J[F]) {
|
|
266
|
+
if (M !== 1 || F !== 1)
|
|
267
|
+
do
|
|
268
|
+
if (M--, F--, F < 0 || k[M] !== J[F]) {
|
|
269
|
+
var Z = `
|
|
270
|
+
` + k[M].replace(" at new ", " at ");
|
|
271
|
+
return a.displayName && Z.includes("<anonymous>") && (Z = Z.replace("<anonymous>", a.displayName)), typeof a == "function" && Ue.set(a, Z), Z;
|
|
272
|
+
}
|
|
273
|
+
while (M >= 1 && F >= 0);
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
} finally {
|
|
278
|
+
Xe = !1, Ge.current = P, Oe(), Error.prepareStackTrace = O;
|
|
279
|
+
}
|
|
280
|
+
var he = a ? a.displayName || a.name : "", le = he ? Te(he) : "";
|
|
281
|
+
return typeof a == "function" && Ue.set(a, le), le;
|
|
282
|
+
}
|
|
283
|
+
function In(a, b, _) {
|
|
284
|
+
return _t(a, !1);
|
|
285
|
+
}
|
|
286
|
+
function Dn(a) {
|
|
287
|
+
var b = a.prototype;
|
|
288
|
+
return !!(b && b.isReactComponent);
|
|
289
|
+
}
|
|
290
|
+
function Pe(a, b, _) {
|
|
291
|
+
if (a == null)
|
|
292
|
+
return "";
|
|
293
|
+
if (typeof a == "function")
|
|
294
|
+
return _t(a, Dn(a));
|
|
295
|
+
if (typeof a == "string")
|
|
296
|
+
return Te(a);
|
|
297
|
+
switch (a) {
|
|
298
|
+
case f:
|
|
299
|
+
return Te("Suspense");
|
|
300
|
+
case u:
|
|
301
|
+
return Te("SuspenseList");
|
|
302
|
+
}
|
|
303
|
+
if (typeof a == "object")
|
|
304
|
+
switch (a.$$typeof) {
|
|
305
|
+
case m:
|
|
306
|
+
return In(a.render);
|
|
307
|
+
case h:
|
|
308
|
+
return Pe(a.type, b, _);
|
|
309
|
+
case x: {
|
|
310
|
+
var E = a, O = E._payload, P = E._init;
|
|
311
|
+
try {
|
|
312
|
+
return Pe(P(O), b, _);
|
|
313
|
+
} catch {
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return "";
|
|
318
|
+
}
|
|
319
|
+
var we = Object.prototype.hasOwnProperty, yt = {}, xt = v.ReactDebugCurrentFrame;
|
|
320
|
+
function Le(a) {
|
|
321
|
+
if (a) {
|
|
322
|
+
var b = a._owner, _ = Pe(a.type, a._source, b ? b.type : null);
|
|
323
|
+
xt.setExtraStackFrame(_);
|
|
324
|
+
} else
|
|
325
|
+
xt.setExtraStackFrame(null);
|
|
326
|
+
}
|
|
327
|
+
function Mn(a, b, _, E, O) {
|
|
328
|
+
{
|
|
329
|
+
var P = Function.call.bind(we);
|
|
330
|
+
for (var N in a)
|
|
331
|
+
if (P(a, N)) {
|
|
332
|
+
var k = void 0;
|
|
333
|
+
try {
|
|
334
|
+
if (typeof a[N] != "function") {
|
|
335
|
+
var J = Error((E || "React class") + ": " + _ + " type `" + N + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[N] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
336
|
+
throw J.name = "Invariant Violation", J;
|
|
337
|
+
}
|
|
338
|
+
k = a[N](b, N, E, _, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
339
|
+
} catch (M) {
|
|
340
|
+
k = M;
|
|
341
|
+
}
|
|
342
|
+
k && !(k instanceof Error) && (Le(O), A("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", E || "React class", _, N, typeof k), Le(null)), k instanceof Error && !(k.message in yt) && (yt[k.message] = !0, Le(O), A("Failed %s type: %s", _, k.message), Le(null));
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
var Fn = Array.isArray;
|
|
347
|
+
function Ze(a) {
|
|
348
|
+
return Fn(a);
|
|
349
|
+
}
|
|
350
|
+
function $n(a) {
|
|
351
|
+
{
|
|
352
|
+
var b = typeof Symbol == "function" && Symbol.toStringTag, _ = b && a[Symbol.toStringTag] || a.constructor.name || "Object";
|
|
353
|
+
return _;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
function Bn(a) {
|
|
357
|
+
try {
|
|
358
|
+
return wt(a), !1;
|
|
359
|
+
} catch {
|
|
360
|
+
return !0;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
function wt(a) {
|
|
364
|
+
return "" + a;
|
|
365
|
+
}
|
|
366
|
+
function vt(a) {
|
|
367
|
+
if (Bn(a))
|
|
368
|
+
return A("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", $n(a)), wt(a);
|
|
369
|
+
}
|
|
370
|
+
var Et = v.ReactCurrentOwner, qn = {
|
|
371
|
+
key: !0,
|
|
372
|
+
ref: !0,
|
|
373
|
+
__self: !0,
|
|
374
|
+
__source: !0
|
|
375
|
+
}, Rt, St;
|
|
376
|
+
function Wn(a) {
|
|
377
|
+
if (we.call(a, "ref")) {
|
|
378
|
+
var b = Object.getOwnPropertyDescriptor(a, "ref").get;
|
|
379
|
+
if (b && b.isReactWarning)
|
|
380
|
+
return !1;
|
|
381
|
+
}
|
|
382
|
+
return a.ref !== void 0;
|
|
383
|
+
}
|
|
384
|
+
function Hn(a) {
|
|
385
|
+
if (we.call(a, "key")) {
|
|
386
|
+
var b = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
387
|
+
if (b && b.isReactWarning)
|
|
388
|
+
return !1;
|
|
389
|
+
}
|
|
390
|
+
return a.key !== void 0;
|
|
391
|
+
}
|
|
392
|
+
function zn(a, b) {
|
|
393
|
+
typeof a.ref == "string" && Et.current;
|
|
394
|
+
}
|
|
395
|
+
function Jn(a, b) {
|
|
396
|
+
{
|
|
397
|
+
var _ = function() {
|
|
398
|
+
Rt || (Rt = !0, A("%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://reactjs.org/link/special-props)", b));
|
|
399
|
+
};
|
|
400
|
+
_.isReactWarning = !0, Object.defineProperty(a, "key", {
|
|
401
|
+
get: _,
|
|
402
|
+
configurable: !0
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
function Vn(a, b) {
|
|
407
|
+
{
|
|
408
|
+
var _ = function() {
|
|
409
|
+
St || (St = !0, A("%s: `ref` 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://reactjs.org/link/special-props)", b));
|
|
410
|
+
};
|
|
411
|
+
_.isReactWarning = !0, Object.defineProperty(a, "ref", {
|
|
412
|
+
get: _,
|
|
413
|
+
configurable: !0
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
var Kn = function(a, b, _, E, O, P, N) {
|
|
418
|
+
var k = {
|
|
419
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
420
|
+
$$typeof: t,
|
|
421
|
+
// Built-in properties that belong on the element
|
|
422
|
+
type: a,
|
|
423
|
+
key: b,
|
|
424
|
+
ref: _,
|
|
425
|
+
props: N,
|
|
426
|
+
// Record the component responsible for creating this element.
|
|
427
|
+
_owner: P
|
|
428
|
+
};
|
|
429
|
+
return k._store = {}, Object.defineProperty(k._store, "validated", {
|
|
430
|
+
configurable: !1,
|
|
431
|
+
enumerable: !1,
|
|
432
|
+
writable: !0,
|
|
433
|
+
value: !1
|
|
434
|
+
}), Object.defineProperty(k, "_self", {
|
|
435
|
+
configurable: !1,
|
|
436
|
+
enumerable: !1,
|
|
437
|
+
writable: !1,
|
|
438
|
+
value: E
|
|
439
|
+
}), Object.defineProperty(k, "_source", {
|
|
440
|
+
configurable: !1,
|
|
441
|
+
enumerable: !1,
|
|
442
|
+
writable: !1,
|
|
443
|
+
value: O
|
|
444
|
+
}), Object.freeze && (Object.freeze(k.props), Object.freeze(k)), k;
|
|
445
|
+
};
|
|
446
|
+
function Gn(a, b, _, E, O) {
|
|
447
|
+
{
|
|
448
|
+
var P, N = {}, k = null, J = null;
|
|
449
|
+
_ !== void 0 && (vt(_), k = "" + _), Hn(b) && (vt(b.key), k = "" + b.key), Wn(b) && (J = b.ref, zn(b, O));
|
|
450
|
+
for (P in b)
|
|
451
|
+
we.call(b, P) && !qn.hasOwnProperty(P) && (N[P] = b[P]);
|
|
452
|
+
if (a && a.defaultProps) {
|
|
453
|
+
var M = a.defaultProps;
|
|
454
|
+
for (P in M)
|
|
455
|
+
N[P] === void 0 && (N[P] = M[P]);
|
|
456
|
+
}
|
|
457
|
+
if (k || J) {
|
|
458
|
+
var F = typeof a == "function" ? a.displayName || a.name || "Unknown" : a;
|
|
459
|
+
k && Jn(N, F), J && Vn(N, F);
|
|
460
|
+
}
|
|
461
|
+
return Kn(a, k, J, O, E, Et.current, N);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
var Qe = v.ReactCurrentOwner, At = v.ReactDebugCurrentFrame;
|
|
465
|
+
function pe(a) {
|
|
466
|
+
if (a) {
|
|
467
|
+
var b = a._owner, _ = Pe(a.type, a._source, b ? b.type : null);
|
|
468
|
+
At.setExtraStackFrame(_);
|
|
469
|
+
} else
|
|
470
|
+
At.setExtraStackFrame(null);
|
|
471
|
+
}
|
|
472
|
+
var et;
|
|
473
|
+
et = !1;
|
|
474
|
+
function tt(a) {
|
|
475
|
+
return typeof a == "object" && a !== null && a.$$typeof === t;
|
|
476
|
+
}
|
|
477
|
+
function Ct() {
|
|
478
|
+
{
|
|
479
|
+
if (Qe.current) {
|
|
480
|
+
var a = q(Qe.current.type);
|
|
481
|
+
if (a)
|
|
482
|
+
return `
|
|
483
|
+
|
|
484
|
+
Check the render method of \`` + a + "`.";
|
|
485
|
+
}
|
|
486
|
+
return "";
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
function Yn(a) {
|
|
490
|
+
return "";
|
|
491
|
+
}
|
|
492
|
+
var kt = {};
|
|
493
|
+
function Xn(a) {
|
|
494
|
+
{
|
|
495
|
+
var b = Ct();
|
|
496
|
+
if (!b) {
|
|
497
|
+
var _ = typeof a == "string" ? a : a.displayName || a.name;
|
|
498
|
+
_ && (b = `
|
|
499
|
+
|
|
500
|
+
Check the top-level render call using <` + _ + ">.");
|
|
501
|
+
}
|
|
502
|
+
return b;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
function jt(a, b) {
|
|
506
|
+
{
|
|
507
|
+
if (!a._store || a._store.validated || a.key != null)
|
|
508
|
+
return;
|
|
509
|
+
a._store.validated = !0;
|
|
510
|
+
var _ = Xn(b);
|
|
511
|
+
if (kt[_])
|
|
512
|
+
return;
|
|
513
|
+
kt[_] = !0;
|
|
514
|
+
var E = "";
|
|
515
|
+
a && a._owner && a._owner !== Qe.current && (E = " It was passed a child from " + q(a._owner.type) + "."), pe(a), A('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', _, E), pe(null);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
function Nt(a, b) {
|
|
519
|
+
{
|
|
520
|
+
if (typeof a != "object")
|
|
521
|
+
return;
|
|
522
|
+
if (Ze(a))
|
|
523
|
+
for (var _ = 0; _ < a.length; _++) {
|
|
524
|
+
var E = a[_];
|
|
525
|
+
tt(E) && jt(E, b);
|
|
526
|
+
}
|
|
527
|
+
else if (tt(a))
|
|
528
|
+
a._store && (a._store.validated = !0);
|
|
529
|
+
else if (a) {
|
|
530
|
+
var O = g(a);
|
|
531
|
+
if (typeof O == "function" && O !== a.entries)
|
|
532
|
+
for (var P = O.call(a), N; !(N = P.next()).done; )
|
|
533
|
+
tt(N.value) && jt(N.value, b);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
function Zn(a) {
|
|
538
|
+
{
|
|
539
|
+
var b = a.type;
|
|
540
|
+
if (b == null || typeof b == "string")
|
|
541
|
+
return;
|
|
542
|
+
var _;
|
|
543
|
+
if (typeof b == "function")
|
|
544
|
+
_ = b.propTypes;
|
|
545
|
+
else if (typeof b == "object" && (b.$$typeof === m || // Note: Memo only checks outer props here.
|
|
546
|
+
// Inner props are checked in the reconciler.
|
|
547
|
+
b.$$typeof === h))
|
|
548
|
+
_ = b.propTypes;
|
|
549
|
+
else
|
|
550
|
+
return;
|
|
551
|
+
if (_) {
|
|
552
|
+
var E = q(b);
|
|
553
|
+
Mn(_, a.props, "prop", E, a);
|
|
554
|
+
} else if (b.PropTypes !== void 0 && !et) {
|
|
555
|
+
et = !0;
|
|
556
|
+
var O = q(b);
|
|
557
|
+
A("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", O || "Unknown");
|
|
558
|
+
}
|
|
559
|
+
typeof b.getDefaultProps == "function" && !b.getDefaultProps.isReactClassApproved && A("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
function Qn(a) {
|
|
563
|
+
{
|
|
564
|
+
for (var b = Object.keys(a.props), _ = 0; _ < b.length; _++) {
|
|
565
|
+
var E = b[_];
|
|
566
|
+
if (E !== "children" && E !== "key") {
|
|
567
|
+
pe(a), A("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", E), pe(null);
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
a.ref !== null && (pe(a), A("Invalid attribute `ref` supplied to `React.Fragment`."), pe(null));
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
var Ot = {};
|
|
575
|
+
function Tt(a, b, _, E, O, P) {
|
|
576
|
+
{
|
|
577
|
+
var N = Q(a);
|
|
578
|
+
if (!N) {
|
|
579
|
+
var k = "";
|
|
580
|
+
(a === void 0 || typeof a == "object" && a !== null && Object.keys(a).length === 0) && (k += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
581
|
+
var J = Yn();
|
|
582
|
+
J ? k += J : k += Ct();
|
|
583
|
+
var M;
|
|
584
|
+
a === null ? M = "null" : Ze(a) ? M = "array" : a !== void 0 && a.$$typeof === t ? (M = "<" + (q(a.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : M = typeof a, A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", M, k);
|
|
585
|
+
}
|
|
586
|
+
var F = Gn(a, b, _, O, P);
|
|
587
|
+
if (F == null)
|
|
588
|
+
return F;
|
|
589
|
+
if (N) {
|
|
590
|
+
var Z = b.children;
|
|
591
|
+
if (Z !== void 0)
|
|
592
|
+
if (E)
|
|
593
|
+
if (Ze(Z)) {
|
|
594
|
+
for (var he = 0; he < Z.length; he++)
|
|
595
|
+
Nt(Z[he], a);
|
|
596
|
+
Object.freeze && Object.freeze(Z);
|
|
597
|
+
} else
|
|
598
|
+
A("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
599
|
+
else
|
|
600
|
+
Nt(Z, a);
|
|
601
|
+
}
|
|
602
|
+
if (we.call(b, "key")) {
|
|
603
|
+
var le = q(a), K = Object.keys(b).filter(function(os) {
|
|
604
|
+
return os !== "key";
|
|
605
|
+
}), nt = K.length > 0 ? "{key: someKey, " + K.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
606
|
+
if (!Ot[le + nt]) {
|
|
607
|
+
var rs = K.length > 0 ? "{" + K.join(": ..., ") + ": ...}" : "{}";
|
|
608
|
+
A(`A props object containing a "key" prop is being spread into JSX:
|
|
609
|
+
let props = %s;
|
|
610
|
+
<%s {...props} />
|
|
611
|
+
React keys must be passed directly to JSX without using spread:
|
|
612
|
+
let props = %s;
|
|
613
|
+
<%s key={someKey} {...props} />`, nt, le, rs, le), Ot[le + nt] = !0;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return a === s ? Qn(F) : Zn(F), F;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
function es(a, b, _) {
|
|
620
|
+
return Tt(a, b, _, !0);
|
|
621
|
+
}
|
|
622
|
+
function ts(a, b, _) {
|
|
623
|
+
return Tt(a, b, _, !1);
|
|
624
|
+
}
|
|
625
|
+
var ns = ts, ss = es;
|
|
626
|
+
Ee.Fragment = s, Ee.jsx = ns, Ee.jsxs = ss;
|
|
627
|
+
})()), Ee;
|
|
628
|
+
}
|
|
629
|
+
var Lt;
|
|
630
|
+
function ys() {
|
|
631
|
+
return Lt || (Lt = 1, process.env.NODE_ENV === "production" ? Ie.exports = bs() : Ie.exports = _s()), Ie.exports;
|
|
632
|
+
}
|
|
633
|
+
var c = ys();
|
|
634
|
+
const xs = ({
|
|
635
|
+
progress: e,
|
|
636
|
+
variant: t = "solid",
|
|
637
|
+
size: n = "md",
|
|
638
|
+
radius: s = "md",
|
|
639
|
+
children: r,
|
|
640
|
+
className: i = "",
|
|
641
|
+
loading: o,
|
|
642
|
+
...l
|
|
643
|
+
}) => {
|
|
644
|
+
const f = e !== void 0 ? ((h) => h === 0 ? "button--primary" : h === 100 ? "button--success" : "button--secondary")(e) : "button--primary", u = [
|
|
645
|
+
"button",
|
|
646
|
+
`button--${n}`,
|
|
647
|
+
`button--${t}`,
|
|
648
|
+
`button--radius-${s}`,
|
|
649
|
+
f,
|
|
650
|
+
o && "button--loading",
|
|
651
|
+
i
|
|
652
|
+
].filter(Boolean).join(" ");
|
|
653
|
+
return /* @__PURE__ */ c.jsx(
|
|
654
|
+
"button",
|
|
655
|
+
{
|
|
656
|
+
type: "button",
|
|
657
|
+
className: u,
|
|
658
|
+
"data-progress": e,
|
|
659
|
+
disabled: o || l.disabled,
|
|
660
|
+
...l,
|
|
661
|
+
children: o ? "加载中..." : r
|
|
662
|
+
}
|
|
663
|
+
);
|
|
664
|
+
};
|
|
665
|
+
/**
|
|
666
|
+
* @license lucide-react v0.541.0 - ISC
|
|
667
|
+
*
|
|
668
|
+
* This source code is licensed under the ISC license.
|
|
669
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
670
|
+
*/
|
|
671
|
+
const ws = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), vs = (e) => e.replace(
|
|
672
|
+
/^([A-Z])|[\s-_]+(\w)/g,
|
|
673
|
+
(t, n, s) => s ? s.toUpperCase() : n.toLowerCase()
|
|
674
|
+
), It = (e) => {
|
|
675
|
+
const t = vs(e);
|
|
676
|
+
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
677
|
+
}, on = (...e) => e.filter((t, n, s) => !!t && t.trim() !== "" && s.indexOf(t) === n).join(" ").trim(), Es = (e) => {
|
|
678
|
+
for (const t in e)
|
|
679
|
+
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
680
|
+
return !0;
|
|
681
|
+
};
|
|
682
|
+
/**
|
|
683
|
+
* @license lucide-react v0.541.0 - ISC
|
|
684
|
+
*
|
|
685
|
+
* This source code is licensed under the ISC license.
|
|
686
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
687
|
+
*/
|
|
688
|
+
var Rs = {
|
|
689
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
690
|
+
width: 24,
|
|
691
|
+
height: 24,
|
|
692
|
+
viewBox: "0 0 24 24",
|
|
693
|
+
fill: "none",
|
|
694
|
+
stroke: "currentColor",
|
|
695
|
+
strokeWidth: 2,
|
|
696
|
+
strokeLinecap: "round",
|
|
697
|
+
strokeLinejoin: "round"
|
|
698
|
+
};
|
|
699
|
+
/**
|
|
700
|
+
* @license lucide-react v0.541.0 - ISC
|
|
701
|
+
*
|
|
702
|
+
* This source code is licensed under the ISC license.
|
|
703
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
704
|
+
*/
|
|
705
|
+
const Ss = rn(
|
|
706
|
+
({
|
|
707
|
+
color: e = "currentColor",
|
|
708
|
+
size: t = 24,
|
|
709
|
+
strokeWidth: n = 2,
|
|
710
|
+
absoluteStrokeWidth: s,
|
|
711
|
+
className: r = "",
|
|
712
|
+
children: i,
|
|
713
|
+
iconNode: o,
|
|
714
|
+
...l
|
|
715
|
+
}, m) => lt(
|
|
716
|
+
"svg",
|
|
717
|
+
{
|
|
718
|
+
ref: m,
|
|
719
|
+
...Rs,
|
|
720
|
+
width: t,
|
|
721
|
+
height: t,
|
|
722
|
+
stroke: e,
|
|
723
|
+
strokeWidth: s ? Number(n) * 24 / Number(t) : n,
|
|
724
|
+
className: on("lucide", r),
|
|
725
|
+
...!i && !Es(l) && { "aria-hidden": "true" },
|
|
726
|
+
...l
|
|
727
|
+
},
|
|
728
|
+
[
|
|
729
|
+
...o.map(([f, u]) => lt(f, u)),
|
|
730
|
+
...Array.isArray(i) ? i : [i]
|
|
731
|
+
]
|
|
732
|
+
)
|
|
733
|
+
);
|
|
734
|
+
/**
|
|
735
|
+
* @license lucide-react v0.541.0 - ISC
|
|
736
|
+
*
|
|
737
|
+
* This source code is licensed under the ISC license.
|
|
738
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
739
|
+
*/
|
|
740
|
+
const pt = (e, t) => {
|
|
741
|
+
const n = rn(
|
|
742
|
+
({ className: s, ...r }, i) => lt(Ss, {
|
|
743
|
+
ref: i,
|
|
744
|
+
iconNode: t,
|
|
745
|
+
className: on(
|
|
746
|
+
`lucide-${ws(It(e))}`,
|
|
747
|
+
`lucide-${e}`,
|
|
748
|
+
s
|
|
749
|
+
),
|
|
750
|
+
...r
|
|
751
|
+
})
|
|
752
|
+
);
|
|
753
|
+
return n.displayName = It(e), n;
|
|
754
|
+
};
|
|
755
|
+
/**
|
|
756
|
+
* @license lucide-react v0.541.0 - ISC
|
|
757
|
+
*
|
|
758
|
+
* This source code is licensed under the ISC license.
|
|
759
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
760
|
+
*/
|
|
761
|
+
const As = [
|
|
762
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
763
|
+
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
764
|
+
], Cs = pt("arrow-right", As);
|
|
765
|
+
/**
|
|
766
|
+
* @license lucide-react v0.541.0 - ISC
|
|
767
|
+
*
|
|
768
|
+
* This source code is licensed under the ISC license.
|
|
769
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
770
|
+
*/
|
|
771
|
+
const ks = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], js = pt("chevron-down", ks);
|
|
772
|
+
/**
|
|
773
|
+
* @license lucide-react v0.541.0 - ISC
|
|
774
|
+
*
|
|
775
|
+
* This source code is licensed under the ISC license.
|
|
776
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
777
|
+
*/
|
|
778
|
+
const Ns = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Os = pt("chevron-right", Ns), Dt = (e) => e === 0 ? "开始学习" : e === 100 ? "复习" : "继续学习", Ts = (e) => {
|
|
779
|
+
if (e.length === 0) return 0;
|
|
780
|
+
const t = e.reduce((n, s) => n + s.progress, 0);
|
|
781
|
+
return Math.round(t / e.length);
|
|
782
|
+
}, Us = ({ knowledgeItem: e, onLearnAction: t }) => {
|
|
783
|
+
const n = () => {
|
|
784
|
+
t(e);
|
|
785
|
+
};
|
|
786
|
+
return console.log("KnowledgeCard render:", {
|
|
787
|
+
progress: e.progress,
|
|
788
|
+
text: Dt(e.progress)
|
|
789
|
+
}), /* @__PURE__ */ c.jsxs(cs, { className: "content-accordion__knowledge-card", children: [
|
|
790
|
+
/* @__PURE__ */ c.jsxs(us, { children: [
|
|
791
|
+
/* @__PURE__ */ c.jsx("h3", { className: "content-accordion__knowledge-title", children: e.title }),
|
|
792
|
+
/* @__PURE__ */ c.jsx("p", { className: "content-accordion__knowledge-description", children: e.description })
|
|
793
|
+
] }),
|
|
794
|
+
/* @__PURE__ */ c.jsxs(ds, { className: "content-accordion__knowledge-actions", children: [
|
|
795
|
+
/* @__PURE__ */ c.jsxs("div", { className: "content-accordion__progress-container", children: [
|
|
796
|
+
/* @__PURE__ */ c.jsx(
|
|
797
|
+
ls,
|
|
798
|
+
{
|
|
799
|
+
value: e.progress,
|
|
800
|
+
size: "sm",
|
|
801
|
+
"aria-label": `${e.title} 进度`,
|
|
802
|
+
className: "content-accordion__progress-bar"
|
|
803
|
+
}
|
|
804
|
+
),
|
|
805
|
+
/* @__PURE__ */ c.jsxs("span", { className: "content-accordion__progress-text", children: [
|
|
806
|
+
e.progress,
|
|
807
|
+
"%"
|
|
808
|
+
] })
|
|
809
|
+
] }),
|
|
810
|
+
/* @__PURE__ */ c.jsx(
|
|
811
|
+
xs,
|
|
812
|
+
{
|
|
813
|
+
size: "sm",
|
|
814
|
+
radius: "md",
|
|
815
|
+
onClick: n,
|
|
816
|
+
progress: e.progress,
|
|
817
|
+
variant: e.progress === 100 ? "light" : e.progress === 0 ? "solid" : "bordered",
|
|
818
|
+
className: "content-accordion__learn-button",
|
|
819
|
+
children: Dt(e.progress)
|
|
820
|
+
}
|
|
821
|
+
)
|
|
822
|
+
] })
|
|
823
|
+
] });
|
|
824
|
+
}, Ps = ({ lesson: e, isExpanded: t, onToggle: n, onLearnAction: s }) => {
|
|
825
|
+
const r = () => {
|
|
826
|
+
n(e.id);
|
|
827
|
+
}, i = Ts(e.knowledgeItems);
|
|
828
|
+
return /* @__PURE__ */ c.jsxs("div", { className: `content-accordion__lesson-item ${t ? "content-accordion__lesson-item--expanded" : ""}`, children: [
|
|
829
|
+
/* @__PURE__ */ c.jsxs(
|
|
830
|
+
"div",
|
|
831
|
+
{
|
|
832
|
+
className: "content-accordion__lesson-header",
|
|
833
|
+
onClick: r,
|
|
834
|
+
role: "button",
|
|
835
|
+
tabIndex: 0,
|
|
836
|
+
"aria-expanded": t,
|
|
837
|
+
"aria-label": `${e.title},点击${t ? "收起" : "展开"}`,
|
|
838
|
+
children: [
|
|
839
|
+
/* @__PURE__ */ c.jsxs("div", { className: "content-accordion__lesson-header-content", children: [
|
|
840
|
+
/* @__PURE__ */ c.jsx("h2", { className: "content-accordion__lesson-title", children: e.title }),
|
|
841
|
+
/* @__PURE__ */ c.jsxs("span", { className: "content-accordion__lesson-duration", children: [
|
|
842
|
+
"约 ",
|
|
843
|
+
e.duration,
|
|
844
|
+
" 分钟"
|
|
845
|
+
] })
|
|
846
|
+
] }),
|
|
847
|
+
/* @__PURE__ */ c.jsxs("div", { className: "content-accordion__lesson-actions", children: [
|
|
848
|
+
/* @__PURE__ */ c.jsxs("span", { className: "content-accordion__lesson-progress", children: [
|
|
849
|
+
i,
|
|
850
|
+
"%"
|
|
851
|
+
] }),
|
|
852
|
+
t ? /* @__PURE__ */ c.jsx(js, { className: "content-accordion__lesson-icon" }) : /* @__PURE__ */ c.jsx(Os, { className: "content-accordion__lesson-icon" })
|
|
853
|
+
] })
|
|
854
|
+
]
|
|
855
|
+
}
|
|
856
|
+
),
|
|
857
|
+
t && /* @__PURE__ */ c.jsx("div", { className: "content-accordion__knowledge-list", children: e.knowledgeItems.map((o) => /* @__PURE__ */ c.jsx(
|
|
858
|
+
Us,
|
|
859
|
+
{
|
|
860
|
+
knowledgeItem: o,
|
|
861
|
+
onLearnAction: s
|
|
862
|
+
},
|
|
863
|
+
o.id
|
|
864
|
+
)) })
|
|
865
|
+
] });
|
|
866
|
+
}, Ls = ({
|
|
867
|
+
unit: e,
|
|
868
|
+
activeLessonIds: t,
|
|
869
|
+
onToggleLesson: n,
|
|
870
|
+
onLearnAction: s,
|
|
871
|
+
loading: r = !1,
|
|
872
|
+
className: i = "",
|
|
873
|
+
emptyState: o
|
|
874
|
+
}) => r ? /* @__PURE__ */ c.jsx("div", { className: "content-accordion content-accordion--loading", children: /* @__PURE__ */ c.jsx("div", { className: "content-accordion__loading", children: "加载中..." }) }) : e ? /* @__PURE__ */ c.jsxs("div", { className: `content-accordion ${i}`, children: [
|
|
875
|
+
/* @__PURE__ */ c.jsxs("header", { className: "content-accordion__header", children: [
|
|
876
|
+
/* @__PURE__ */ c.jsx("h1", { className: "content-accordion__unit-title", children: e.title }),
|
|
877
|
+
/* @__PURE__ */ c.jsx("p", { className: "content-accordion__unit-description", children: e.description }),
|
|
878
|
+
/* @__PURE__ */ c.jsxs("div", { className: "content-accordion__unit-meta", children: [
|
|
879
|
+
/* @__PURE__ */ c.jsxs("span", { children: [
|
|
880
|
+
"总共 ",
|
|
881
|
+
e.totalLessons,
|
|
882
|
+
" 节课"
|
|
883
|
+
] }),
|
|
884
|
+
/* @__PURE__ */ c.jsx("span", { children: "•" }),
|
|
885
|
+
/* @__PURE__ */ c.jsxs("span", { children: [
|
|
886
|
+
"预计学习 ",
|
|
887
|
+
e.estimatedDuration
|
|
888
|
+
] })
|
|
889
|
+
] })
|
|
890
|
+
] }),
|
|
891
|
+
/* @__PURE__ */ c.jsx("div", { className: "content-accordion__lessons", children: e.lessons.map((l) => /* @__PURE__ */ c.jsx(
|
|
892
|
+
Ps,
|
|
893
|
+
{
|
|
894
|
+
lesson: l,
|
|
895
|
+
isExpanded: t.includes(l.id),
|
|
896
|
+
onToggle: n,
|
|
897
|
+
onLearnAction: s
|
|
898
|
+
},
|
|
899
|
+
l.id
|
|
900
|
+
)) })
|
|
901
|
+
] }) : /* @__PURE__ */ c.jsx("div", { className: "content-accordion content-accordion--empty", children: o || /* @__PURE__ */ c.jsx("div", { className: "content-accordion__empty", children: "暂无学习内容" }) }), Is = (e) => {
|
|
902
|
+
switch (e) {
|
|
903
|
+
case "completed":
|
|
904
|
+
return "success";
|
|
905
|
+
case "in-progress":
|
|
906
|
+
return "primary";
|
|
907
|
+
case "not-started":
|
|
908
|
+
default:
|
|
909
|
+
return "default";
|
|
910
|
+
}
|
|
911
|
+
}, Ds = ({
|
|
912
|
+
data: e,
|
|
913
|
+
loading: t = !1,
|
|
914
|
+
error: n = null,
|
|
915
|
+
collapsed: s = !1,
|
|
916
|
+
onToggleCollapse: r,
|
|
917
|
+
activeUnitId: i = null,
|
|
918
|
+
onUnitSelect: o,
|
|
919
|
+
renderUnitItem: l,
|
|
920
|
+
className: m = "",
|
|
921
|
+
unitItemClassName: f = "",
|
|
922
|
+
style: u = {},
|
|
923
|
+
unitItemStyle: h = {}
|
|
924
|
+
}) => {
|
|
925
|
+
const x = (g, v) => {
|
|
926
|
+
v.preventDefault(), o?.(g);
|
|
927
|
+
}, j = () => {
|
|
928
|
+
r?.();
|
|
929
|
+
}, p = (g) => /* @__PURE__ */ c.jsxs(
|
|
930
|
+
"div",
|
|
931
|
+
{
|
|
932
|
+
className: `sidebar__unit-item ${f} ${i === g.unitId ? "sidebar__unit-item--active" : ""} ${g.status ? `sidebar__unit-item--${g.status}` : ""}`,
|
|
933
|
+
style: h,
|
|
934
|
+
onClick: (v) => x(g.unitId, v),
|
|
935
|
+
role: "button",
|
|
936
|
+
tabIndex: 0,
|
|
937
|
+
"aria-label": `${g.title},进度 ${g.progressPercentage}%`,
|
|
938
|
+
children: [
|
|
939
|
+
/* @__PURE__ */ c.jsxs("div", { className: "sidebar__unit-item__content", children: [
|
|
940
|
+
g.icon && /* @__PURE__ */ c.jsx("span", { className: "sidebar__unit-item__icon", children: g.icon }),
|
|
941
|
+
!s && /* @__PURE__ */ c.jsx("span", { className: "sidebar__unit-item__title", children: g.title })
|
|
942
|
+
] }),
|
|
943
|
+
!s && g.progressPercentage !== void 0 && /* @__PURE__ */ c.jsxs("div", { className: "sidebar__unit-item__progress", children: [
|
|
944
|
+
/* @__PURE__ */ c.jsx(
|
|
945
|
+
fs,
|
|
946
|
+
{
|
|
947
|
+
value: g.progressPercentage,
|
|
948
|
+
size: "sm",
|
|
949
|
+
color: Is(g.status),
|
|
950
|
+
"aria-label": `${g.title} 进度`
|
|
951
|
+
}
|
|
952
|
+
),
|
|
953
|
+
/* @__PURE__ */ c.jsxs("span", { className: "progress-percentage", children: [
|
|
954
|
+
g.progressPercentage,
|
|
955
|
+
"%"
|
|
956
|
+
] })
|
|
957
|
+
] })
|
|
958
|
+
]
|
|
959
|
+
},
|
|
960
|
+
g.unitId
|
|
961
|
+
), y = () => t ? /* @__PURE__ */ c.jsx("div", { className: "sidebar__loading", children: "加载中..." }) : n ? /* @__PURE__ */ c.jsxs("div", { className: "sidebar__error", children: [
|
|
962
|
+
"加载失败: ",
|
|
963
|
+
n.message
|
|
964
|
+
] }) : e ? /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
965
|
+
/* @__PURE__ */ c.jsxs("div", { className: "sidebar__header", children: [
|
|
966
|
+
/* @__PURE__ */ c.jsx(
|
|
967
|
+
"button",
|
|
968
|
+
{
|
|
969
|
+
className: "sidebar__toggle-btn",
|
|
970
|
+
onClick: j,
|
|
971
|
+
"aria-label": "切换侧边栏折叠状态",
|
|
972
|
+
children: s ? "→" : "←"
|
|
973
|
+
}
|
|
974
|
+
),
|
|
975
|
+
!s && /* @__PURE__ */ c.jsxs("div", { className: "sidebar__course-info", children: [
|
|
976
|
+
/* @__PURE__ */ c.jsx("h3", { className: "sidebar__course-title", children: e.courseTitle }),
|
|
977
|
+
/* @__PURE__ */ c.jsxs("span", { className: "sidebar__course-level", children: [
|
|
978
|
+
e.courseLevel,
|
|
979
|
+
"年级"
|
|
980
|
+
] })
|
|
981
|
+
] })
|
|
982
|
+
] }),
|
|
983
|
+
/* @__PURE__ */ c.jsx("nav", { className: "sidebar__content", children: /* @__PURE__ */ c.jsx("ul", { className: "sidebar__unit-list", children: e.units && e.units.length > 0 ? e.units.map((g) => /* @__PURE__ */ c.jsx("li", { children: l ? l(g, g) : p(g) }, g.unitId)) : /* @__PURE__ */ c.jsx("div", { className: "sidebar__empty", children: "暂无单元数据" }) }) })
|
|
984
|
+
] }) : /* @__PURE__ */ c.jsx("div", { className: "sidebar__empty", children: "暂无课程数据" });
|
|
985
|
+
return /* @__PURE__ */ c.jsx(
|
|
986
|
+
"aside",
|
|
987
|
+
{
|
|
988
|
+
className: `sidebar ${m} ${s ? "sidebar--collapsed" : ""} ${t ? "sidebar--loading" : ""} ${n ? "sidebar--error" : ""}`,
|
|
989
|
+
style: u,
|
|
990
|
+
"aria-label": "课程导航侧边栏",
|
|
991
|
+
role: "complementary",
|
|
992
|
+
children: y()
|
|
993
|
+
}
|
|
994
|
+
);
|
|
995
|
+
}, an = ({
|
|
996
|
+
trigger: e,
|
|
997
|
+
items: t,
|
|
998
|
+
position: n = "bottom",
|
|
999
|
+
alignment: s = "start",
|
|
1000
|
+
openDelay: r = 300,
|
|
1001
|
+
closeDelay: i = 100,
|
|
1002
|
+
onOpen: o,
|
|
1003
|
+
onClose: l,
|
|
1004
|
+
renderItem: m,
|
|
1005
|
+
itemConfig: f = {},
|
|
1006
|
+
className: u,
|
|
1007
|
+
menuClassName: h,
|
|
1008
|
+
itemClassName: x
|
|
1009
|
+
// activeItemClassName is available for custom styling but not used in default implementation
|
|
1010
|
+
}) => {
|
|
1011
|
+
const [j, p] = V.useState(!1), y = V.useRef(null), g = V.useRef(null), v = () => {
|
|
1012
|
+
y.current && clearTimeout(y.current), g.current && clearTimeout(g.current);
|
|
1013
|
+
}, A = () => {
|
|
1014
|
+
v(), y.current = setTimeout(() => {
|
|
1015
|
+
p(!0), o?.();
|
|
1016
|
+
}, r);
|
|
1017
|
+
}, C = () => {
|
|
1018
|
+
v(), g.current = setTimeout(() => {
|
|
1019
|
+
p(!1), l?.();
|
|
1020
|
+
}, i);
|
|
1021
|
+
}, T = (w) => {
|
|
1022
|
+
!w.disabled && w.onClick && w.onClick(w);
|
|
1023
|
+
};
|
|
1024
|
+
V.useEffect(() => () => v(), []);
|
|
1025
|
+
const R = (w) => /* @__PURE__ */ c.jsxs(
|
|
1026
|
+
"div",
|
|
1027
|
+
{
|
|
1028
|
+
className: `submenu-item ${w.disabled ? "is-disabled" : ""} ${x || ""}`,
|
|
1029
|
+
onClick: () => T(w),
|
|
1030
|
+
children: [
|
|
1031
|
+
w.icon && /* @__PURE__ */ c.jsx("span", { className: "submenu-item-icon", children: w.icon }),
|
|
1032
|
+
/* @__PURE__ */ c.jsx("span", { children: w.label })
|
|
1033
|
+
]
|
|
1034
|
+
},
|
|
1035
|
+
w.id
|
|
1036
|
+
), U = () => {
|
|
1037
|
+
const w = ["submenu-panel"];
|
|
1038
|
+
return h && w.push(h), w.push(`position-${n}`), s !== "start" && w.push(`alignment-${s}`), j && w.push("is-open"), w.join(" ");
|
|
1039
|
+
};
|
|
1040
|
+
return /* @__PURE__ */ c.jsxs(
|
|
1041
|
+
"div",
|
|
1042
|
+
{
|
|
1043
|
+
className: `submenu-container ${u || ""}`,
|
|
1044
|
+
onMouseEnter: A,
|
|
1045
|
+
onMouseLeave: C,
|
|
1046
|
+
children: [
|
|
1047
|
+
/* @__PURE__ */ c.jsx("div", { className: "submenu-trigger", children: e }),
|
|
1048
|
+
/* @__PURE__ */ c.jsx("div", { className: U(), children: t.map(
|
|
1049
|
+
(w) => m ? m(w, f) : R(w)
|
|
1050
|
+
) })
|
|
1051
|
+
]
|
|
1052
|
+
}
|
|
1053
|
+
);
|
|
1054
|
+
};
|
|
1055
|
+
function ln(e, t) {
|
|
1056
|
+
return function() {
|
|
1057
|
+
return e.apply(t, arguments);
|
|
1058
|
+
};
|
|
1059
|
+
}
|
|
1060
|
+
const { toString: Ms } = Object.prototype, { getPrototypeOf: ht } = Object, { iterator: He, toStringTag: cn } = Symbol, ze = /* @__PURE__ */ ((e) => (t) => {
|
|
1061
|
+
const n = Ms.call(t);
|
|
1062
|
+
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
1063
|
+
})(/* @__PURE__ */ Object.create(null)), ne = (e) => (e = e.toLowerCase(), (t) => ze(t) === e), Je = (e) => (t) => typeof t === e, { isArray: be } = Array, ge = Je("undefined");
|
|
1064
|
+
function Se(e) {
|
|
1065
|
+
return e !== null && !ge(e) && e.constructor !== null && !ge(e.constructor) && G(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
1066
|
+
}
|
|
1067
|
+
const un = ne("ArrayBuffer");
|
|
1068
|
+
function Fs(e) {
|
|
1069
|
+
let t;
|
|
1070
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && un(e.buffer), t;
|
|
1071
|
+
}
|
|
1072
|
+
const $s = Je("string"), G = Je("function"), dn = Je("number"), Ae = (e) => e !== null && typeof e == "object", Bs = (e) => e === !0 || e === !1, Fe = (e) => {
|
|
1073
|
+
if (ze(e) !== "object")
|
|
1074
|
+
return !1;
|
|
1075
|
+
const t = ht(e);
|
|
1076
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(cn in e) && !(He in e);
|
|
1077
|
+
}, qs = (e) => {
|
|
1078
|
+
if (!Ae(e) || Se(e))
|
|
1079
|
+
return !1;
|
|
1080
|
+
try {
|
|
1081
|
+
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
|
|
1082
|
+
} catch {
|
|
1083
|
+
return !1;
|
|
1084
|
+
}
|
|
1085
|
+
}, Ws = ne("Date"), Hs = ne("File"), zs = ne("Blob"), Js = ne("FileList"), Vs = (e) => Ae(e) && G(e.pipe), Ks = (e) => {
|
|
1086
|
+
let t;
|
|
1087
|
+
return e && (typeof FormData == "function" && e instanceof FormData || G(e.append) && ((t = ze(e)) === "formdata" || // detect form-data instance
|
|
1088
|
+
t === "object" && G(e.toString) && e.toString() === "[object FormData]"));
|
|
1089
|
+
}, Gs = ne("URLSearchParams"), [Ys, Xs, Zs, Qs] = ["ReadableStream", "Request", "Response", "Headers"].map(ne), er = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
1090
|
+
function Ce(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
1091
|
+
if (e === null || typeof e > "u")
|
|
1092
|
+
return;
|
|
1093
|
+
let s, r;
|
|
1094
|
+
if (typeof e != "object" && (e = [e]), be(e))
|
|
1095
|
+
for (s = 0, r = e.length; s < r; s++)
|
|
1096
|
+
t.call(null, e[s], s, e);
|
|
1097
|
+
else {
|
|
1098
|
+
if (Se(e))
|
|
1099
|
+
return;
|
|
1100
|
+
const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), o = i.length;
|
|
1101
|
+
let l;
|
|
1102
|
+
for (s = 0; s < o; s++)
|
|
1103
|
+
l = i[s], t.call(null, e[l], l, e);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
function fn(e, t) {
|
|
1107
|
+
if (Se(e))
|
|
1108
|
+
return null;
|
|
1109
|
+
t = t.toLowerCase();
|
|
1110
|
+
const n = Object.keys(e);
|
|
1111
|
+
let s = n.length, r;
|
|
1112
|
+
for (; s-- > 0; )
|
|
1113
|
+
if (r = n[s], t === r.toLowerCase())
|
|
1114
|
+
return r;
|
|
1115
|
+
return null;
|
|
1116
|
+
}
|
|
1117
|
+
const ce = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, mn = (e) => !ge(e) && e !== ce;
|
|
1118
|
+
function ct() {
|
|
1119
|
+
const { caseless: e, skipUndefined: t } = mn(this) && this || {}, n = {}, s = (r, i) => {
|
|
1120
|
+
const o = e && fn(n, i) || i;
|
|
1121
|
+
Fe(n[o]) && Fe(r) ? n[o] = ct(n[o], r) : Fe(r) ? n[o] = ct({}, r) : be(r) ? n[o] = r.slice() : (!t || !ge(r)) && (n[o] = r);
|
|
1122
|
+
};
|
|
1123
|
+
for (let r = 0, i = arguments.length; r < i; r++)
|
|
1124
|
+
arguments[r] && Ce(arguments[r], s);
|
|
1125
|
+
return n;
|
|
1126
|
+
}
|
|
1127
|
+
const tr = (e, t, n, { allOwnKeys: s } = {}) => (Ce(t, (r, i) => {
|
|
1128
|
+
n && G(r) ? e[i] = ln(r, n) : e[i] = r;
|
|
1129
|
+
}, { allOwnKeys: s }), e), nr = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), sr = (e, t, n, s) => {
|
|
1130
|
+
e.prototype = Object.create(t.prototype, s), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
1131
|
+
value: t.prototype
|
|
1132
|
+
}), n && Object.assign(e.prototype, n);
|
|
1133
|
+
}, rr = (e, t, n, s) => {
|
|
1134
|
+
let r, i, o;
|
|
1135
|
+
const l = {};
|
|
1136
|
+
if (t = t || {}, e == null) return t;
|
|
1137
|
+
do {
|
|
1138
|
+
for (r = Object.getOwnPropertyNames(e), i = r.length; i-- > 0; )
|
|
1139
|
+
o = r[i], (!s || s(o, e, t)) && !l[o] && (t[o] = e[o], l[o] = !0);
|
|
1140
|
+
e = n !== !1 && ht(e);
|
|
1141
|
+
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
1142
|
+
return t;
|
|
1143
|
+
}, or = (e, t, n) => {
|
|
1144
|
+
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
1145
|
+
const s = e.indexOf(t, n);
|
|
1146
|
+
return s !== -1 && s === n;
|
|
1147
|
+
}, ir = (e) => {
|
|
1148
|
+
if (!e) return null;
|
|
1149
|
+
if (be(e)) return e;
|
|
1150
|
+
let t = e.length;
|
|
1151
|
+
if (!dn(t)) return null;
|
|
1152
|
+
const n = new Array(t);
|
|
1153
|
+
for (; t-- > 0; )
|
|
1154
|
+
n[t] = e[t];
|
|
1155
|
+
return n;
|
|
1156
|
+
}, ar = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ht(Uint8Array)), lr = (e, t) => {
|
|
1157
|
+
const s = (e && e[He]).call(e);
|
|
1158
|
+
let r;
|
|
1159
|
+
for (; (r = s.next()) && !r.done; ) {
|
|
1160
|
+
const i = r.value;
|
|
1161
|
+
t.call(e, i[0], i[1]);
|
|
1162
|
+
}
|
|
1163
|
+
}, cr = (e, t) => {
|
|
1164
|
+
let n;
|
|
1165
|
+
const s = [];
|
|
1166
|
+
for (; (n = e.exec(t)) !== null; )
|
|
1167
|
+
s.push(n);
|
|
1168
|
+
return s;
|
|
1169
|
+
}, ur = ne("HTMLFormElement"), dr = (e) => e.toLowerCase().replace(
|
|
1170
|
+
/[-_\s]([a-z\d])(\w*)/g,
|
|
1171
|
+
function(n, s, r) {
|
|
1172
|
+
return s.toUpperCase() + r;
|
|
1173
|
+
}
|
|
1174
|
+
), Mt = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), fr = ne("RegExp"), pn = (e, t) => {
|
|
1175
|
+
const n = Object.getOwnPropertyDescriptors(e), s = {};
|
|
1176
|
+
Ce(n, (r, i) => {
|
|
1177
|
+
let o;
|
|
1178
|
+
(o = t(r, i, e)) !== !1 && (s[i] = o || r);
|
|
1179
|
+
}), Object.defineProperties(e, s);
|
|
1180
|
+
}, mr = (e) => {
|
|
1181
|
+
pn(e, (t, n) => {
|
|
1182
|
+
if (G(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
1183
|
+
return !1;
|
|
1184
|
+
const s = e[n];
|
|
1185
|
+
if (G(s)) {
|
|
1186
|
+
if (t.enumerable = !1, "writable" in t) {
|
|
1187
|
+
t.writable = !1;
|
|
1188
|
+
return;
|
|
1189
|
+
}
|
|
1190
|
+
t.set || (t.set = () => {
|
|
1191
|
+
throw Error("Can not rewrite read-only method '" + n + "'");
|
|
1192
|
+
});
|
|
1193
|
+
}
|
|
1194
|
+
});
|
|
1195
|
+
}, pr = (e, t) => {
|
|
1196
|
+
const n = {}, s = (r) => {
|
|
1197
|
+
r.forEach((i) => {
|
|
1198
|
+
n[i] = !0;
|
|
1199
|
+
});
|
|
1200
|
+
};
|
|
1201
|
+
return be(e) ? s(e) : s(String(e).split(t)), n;
|
|
1202
|
+
}, hr = () => {
|
|
1203
|
+
}, gr = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
1204
|
+
function br(e) {
|
|
1205
|
+
return !!(e && G(e.append) && e[cn] === "FormData" && e[He]);
|
|
1206
|
+
}
|
|
1207
|
+
const _r = (e) => {
|
|
1208
|
+
const t = new Array(10), n = (s, r) => {
|
|
1209
|
+
if (Ae(s)) {
|
|
1210
|
+
if (t.indexOf(s) >= 0)
|
|
1211
|
+
return;
|
|
1212
|
+
if (Se(s))
|
|
1213
|
+
return s;
|
|
1214
|
+
if (!("toJSON" in s)) {
|
|
1215
|
+
t[r] = s;
|
|
1216
|
+
const i = be(s) ? [] : {};
|
|
1217
|
+
return Ce(s, (o, l) => {
|
|
1218
|
+
const m = n(o, r + 1);
|
|
1219
|
+
!ge(m) && (i[l] = m);
|
|
1220
|
+
}), t[r] = void 0, i;
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
return s;
|
|
1224
|
+
};
|
|
1225
|
+
return n(e, 0);
|
|
1226
|
+
}, yr = ne("AsyncFunction"), xr = (e) => e && (Ae(e) || G(e)) && G(e.then) && G(e.catch), hn = ((e, t) => e ? setImmediate : t ? ((n, s) => (ce.addEventListener("message", ({ source: r, data: i }) => {
|
|
1227
|
+
r === ce && i === n && s.length && s.shift()();
|
|
1228
|
+
}, !1), (r) => {
|
|
1229
|
+
s.push(r), ce.postMessage(n, "*");
|
|
1230
|
+
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
1231
|
+
typeof setImmediate == "function",
|
|
1232
|
+
G(ce.postMessage)
|
|
1233
|
+
), wr = typeof queueMicrotask < "u" ? queueMicrotask.bind(ce) : typeof process < "u" && process.nextTick || hn, vr = (e) => e != null && G(e[He]), d = {
|
|
1234
|
+
isArray: be,
|
|
1235
|
+
isArrayBuffer: un,
|
|
1236
|
+
isBuffer: Se,
|
|
1237
|
+
isFormData: Ks,
|
|
1238
|
+
isArrayBufferView: Fs,
|
|
1239
|
+
isString: $s,
|
|
1240
|
+
isNumber: dn,
|
|
1241
|
+
isBoolean: Bs,
|
|
1242
|
+
isObject: Ae,
|
|
1243
|
+
isPlainObject: Fe,
|
|
1244
|
+
isEmptyObject: qs,
|
|
1245
|
+
isReadableStream: Ys,
|
|
1246
|
+
isRequest: Xs,
|
|
1247
|
+
isResponse: Zs,
|
|
1248
|
+
isHeaders: Qs,
|
|
1249
|
+
isUndefined: ge,
|
|
1250
|
+
isDate: Ws,
|
|
1251
|
+
isFile: Hs,
|
|
1252
|
+
isBlob: zs,
|
|
1253
|
+
isRegExp: fr,
|
|
1254
|
+
isFunction: G,
|
|
1255
|
+
isStream: Vs,
|
|
1256
|
+
isURLSearchParams: Gs,
|
|
1257
|
+
isTypedArray: ar,
|
|
1258
|
+
isFileList: Js,
|
|
1259
|
+
forEach: Ce,
|
|
1260
|
+
merge: ct,
|
|
1261
|
+
extend: tr,
|
|
1262
|
+
trim: er,
|
|
1263
|
+
stripBOM: nr,
|
|
1264
|
+
inherits: sr,
|
|
1265
|
+
toFlatObject: rr,
|
|
1266
|
+
kindOf: ze,
|
|
1267
|
+
kindOfTest: ne,
|
|
1268
|
+
endsWith: or,
|
|
1269
|
+
toArray: ir,
|
|
1270
|
+
forEachEntry: lr,
|
|
1271
|
+
matchAll: cr,
|
|
1272
|
+
isHTMLForm: ur,
|
|
1273
|
+
hasOwnProperty: Mt,
|
|
1274
|
+
hasOwnProp: Mt,
|
|
1275
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
1276
|
+
reduceDescriptors: pn,
|
|
1277
|
+
freezeMethods: mr,
|
|
1278
|
+
toObjectSet: pr,
|
|
1279
|
+
toCamelCase: dr,
|
|
1280
|
+
noop: hr,
|
|
1281
|
+
toFiniteNumber: gr,
|
|
1282
|
+
findKey: fn,
|
|
1283
|
+
global: ce,
|
|
1284
|
+
isContextDefined: mn,
|
|
1285
|
+
isSpecCompliantForm: br,
|
|
1286
|
+
toJSONObject: _r,
|
|
1287
|
+
isAsyncFn: yr,
|
|
1288
|
+
isThenable: xr,
|
|
1289
|
+
setImmediate: hn,
|
|
1290
|
+
asap: wr,
|
|
1291
|
+
isIterable: vr
|
|
1292
|
+
};
|
|
1293
|
+
function S(e, t, n, s, r) {
|
|
1294
|
+
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), s && (this.request = s), r && (this.response = r, this.status = r.status ? r.status : null);
|
|
1295
|
+
}
|
|
1296
|
+
d.inherits(S, Error, {
|
|
1297
|
+
toJSON: function() {
|
|
1298
|
+
return {
|
|
1299
|
+
// Standard
|
|
1300
|
+
message: this.message,
|
|
1301
|
+
name: this.name,
|
|
1302
|
+
// Microsoft
|
|
1303
|
+
description: this.description,
|
|
1304
|
+
number: this.number,
|
|
1305
|
+
// Mozilla
|
|
1306
|
+
fileName: this.fileName,
|
|
1307
|
+
lineNumber: this.lineNumber,
|
|
1308
|
+
columnNumber: this.columnNumber,
|
|
1309
|
+
stack: this.stack,
|
|
1310
|
+
// Axios
|
|
1311
|
+
config: d.toJSONObject(this.config),
|
|
1312
|
+
code: this.code,
|
|
1313
|
+
status: this.status
|
|
1314
|
+
};
|
|
1315
|
+
}
|
|
1316
|
+
});
|
|
1317
|
+
const gn = S.prototype, bn = {};
|
|
1318
|
+
[
|
|
1319
|
+
"ERR_BAD_OPTION_VALUE",
|
|
1320
|
+
"ERR_BAD_OPTION",
|
|
1321
|
+
"ECONNABORTED",
|
|
1322
|
+
"ETIMEDOUT",
|
|
1323
|
+
"ERR_NETWORK",
|
|
1324
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
1325
|
+
"ERR_DEPRECATED",
|
|
1326
|
+
"ERR_BAD_RESPONSE",
|
|
1327
|
+
"ERR_BAD_REQUEST",
|
|
1328
|
+
"ERR_CANCELED",
|
|
1329
|
+
"ERR_NOT_SUPPORT",
|
|
1330
|
+
"ERR_INVALID_URL"
|
|
1331
|
+
// eslint-disable-next-line func-names
|
|
1332
|
+
].forEach((e) => {
|
|
1333
|
+
bn[e] = { value: e };
|
|
1334
|
+
});
|
|
1335
|
+
Object.defineProperties(S, bn);
|
|
1336
|
+
Object.defineProperty(gn, "isAxiosError", { value: !0 });
|
|
1337
|
+
S.from = (e, t, n, s, r, i) => {
|
|
1338
|
+
const o = Object.create(gn);
|
|
1339
|
+
d.toFlatObject(e, o, function(u) {
|
|
1340
|
+
return u !== Error.prototype;
|
|
1341
|
+
}, (f) => f !== "isAxiosError");
|
|
1342
|
+
const l = e && e.message ? e.message : "Error", m = t == null && e ? e.code : t;
|
|
1343
|
+
return S.call(o, l, m, n, s, r), e && o.cause == null && Object.defineProperty(o, "cause", { value: e, configurable: !0 }), o.name = e && e.name || "Error", i && Object.assign(o, i), o;
|
|
1344
|
+
};
|
|
1345
|
+
const Er = null;
|
|
1346
|
+
function ut(e) {
|
|
1347
|
+
return d.isPlainObject(e) || d.isArray(e);
|
|
1348
|
+
}
|
|
1349
|
+
function _n(e) {
|
|
1350
|
+
return d.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
1351
|
+
}
|
|
1352
|
+
function Ft(e, t, n) {
|
|
1353
|
+
return e ? e.concat(t).map(function(r, i) {
|
|
1354
|
+
return r = _n(r), !n && i ? "[" + r + "]" : r;
|
|
1355
|
+
}).join(n ? "." : "") : t;
|
|
1356
|
+
}
|
|
1357
|
+
function Rr(e) {
|
|
1358
|
+
return d.isArray(e) && !e.some(ut);
|
|
1359
|
+
}
|
|
1360
|
+
const Sr = d.toFlatObject(d, {}, null, function(t) {
|
|
1361
|
+
return /^is[A-Z]/.test(t);
|
|
1362
|
+
});
|
|
1363
|
+
function Ve(e, t, n) {
|
|
1364
|
+
if (!d.isObject(e))
|
|
1365
|
+
throw new TypeError("target must be an object");
|
|
1366
|
+
t = t || new FormData(), n = d.toFlatObject(n, {
|
|
1367
|
+
metaTokens: !0,
|
|
1368
|
+
dots: !1,
|
|
1369
|
+
indexes: !1
|
|
1370
|
+
}, !1, function(y, g) {
|
|
1371
|
+
return !d.isUndefined(g[y]);
|
|
1372
|
+
});
|
|
1373
|
+
const s = n.metaTokens, r = n.visitor || u, i = n.dots, o = n.indexes, m = (n.Blob || typeof Blob < "u" && Blob) && d.isSpecCompliantForm(t);
|
|
1374
|
+
if (!d.isFunction(r))
|
|
1375
|
+
throw new TypeError("visitor must be a function");
|
|
1376
|
+
function f(p) {
|
|
1377
|
+
if (p === null) return "";
|
|
1378
|
+
if (d.isDate(p))
|
|
1379
|
+
return p.toISOString();
|
|
1380
|
+
if (d.isBoolean(p))
|
|
1381
|
+
return p.toString();
|
|
1382
|
+
if (!m && d.isBlob(p))
|
|
1383
|
+
throw new S("Blob is not supported. Use a Buffer instead.");
|
|
1384
|
+
return d.isArrayBuffer(p) || d.isTypedArray(p) ? m && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
|
|
1385
|
+
}
|
|
1386
|
+
function u(p, y, g) {
|
|
1387
|
+
let v = p;
|
|
1388
|
+
if (p && !g && typeof p == "object") {
|
|
1389
|
+
if (d.endsWith(y, "{}"))
|
|
1390
|
+
y = s ? y : y.slice(0, -2), p = JSON.stringify(p);
|
|
1391
|
+
else if (d.isArray(p) && Rr(p) || (d.isFileList(p) || d.endsWith(y, "[]")) && (v = d.toArray(p)))
|
|
1392
|
+
return y = _n(y), v.forEach(function(C, T) {
|
|
1393
|
+
!(d.isUndefined(C) || C === null) && t.append(
|
|
1394
|
+
// eslint-disable-next-line no-nested-ternary
|
|
1395
|
+
o === !0 ? Ft([y], T, i) : o === null ? y : y + "[]",
|
|
1396
|
+
f(C)
|
|
1397
|
+
);
|
|
1398
|
+
}), !1;
|
|
1399
|
+
}
|
|
1400
|
+
return ut(p) ? !0 : (t.append(Ft(g, y, i), f(p)), !1);
|
|
1401
|
+
}
|
|
1402
|
+
const h = [], x = Object.assign(Sr, {
|
|
1403
|
+
defaultVisitor: u,
|
|
1404
|
+
convertValue: f,
|
|
1405
|
+
isVisitable: ut
|
|
1406
|
+
});
|
|
1407
|
+
function j(p, y) {
|
|
1408
|
+
if (!d.isUndefined(p)) {
|
|
1409
|
+
if (h.indexOf(p) !== -1)
|
|
1410
|
+
throw Error("Circular reference detected in " + y.join("."));
|
|
1411
|
+
h.push(p), d.forEach(p, function(v, A) {
|
|
1412
|
+
(!(d.isUndefined(v) || v === null) && r.call(
|
|
1413
|
+
t,
|
|
1414
|
+
v,
|
|
1415
|
+
d.isString(A) ? A.trim() : A,
|
|
1416
|
+
y,
|
|
1417
|
+
x
|
|
1418
|
+
)) === !0 && j(v, y ? y.concat(A) : [A]);
|
|
1419
|
+
}), h.pop();
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
if (!d.isObject(e))
|
|
1423
|
+
throw new TypeError("data must be an object");
|
|
1424
|
+
return j(e), t;
|
|
1425
|
+
}
|
|
1426
|
+
function $t(e) {
|
|
1427
|
+
const t = {
|
|
1428
|
+
"!": "%21",
|
|
1429
|
+
"'": "%27",
|
|
1430
|
+
"(": "%28",
|
|
1431
|
+
")": "%29",
|
|
1432
|
+
"~": "%7E",
|
|
1433
|
+
"%20": "+",
|
|
1434
|
+
"%00": "\0"
|
|
1435
|
+
};
|
|
1436
|
+
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(s) {
|
|
1437
|
+
return t[s];
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
function gt(e, t) {
|
|
1441
|
+
this._pairs = [], e && Ve(e, this, t);
|
|
1442
|
+
}
|
|
1443
|
+
const yn = gt.prototype;
|
|
1444
|
+
yn.append = function(t, n) {
|
|
1445
|
+
this._pairs.push([t, n]);
|
|
1446
|
+
};
|
|
1447
|
+
yn.toString = function(t) {
|
|
1448
|
+
const n = t ? function(s) {
|
|
1449
|
+
return t.call(this, s, $t);
|
|
1450
|
+
} : $t;
|
|
1451
|
+
return this._pairs.map(function(r) {
|
|
1452
|
+
return n(r[0]) + "=" + n(r[1]);
|
|
1453
|
+
}, "").join("&");
|
|
1454
|
+
};
|
|
1455
|
+
function Ar(e) {
|
|
1456
|
+
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
1457
|
+
}
|
|
1458
|
+
function xn(e, t, n) {
|
|
1459
|
+
if (!t)
|
|
1460
|
+
return e;
|
|
1461
|
+
const s = n && n.encode || Ar;
|
|
1462
|
+
d.isFunction(n) && (n = {
|
|
1463
|
+
serialize: n
|
|
1464
|
+
});
|
|
1465
|
+
const r = n && n.serialize;
|
|
1466
|
+
let i;
|
|
1467
|
+
if (r ? i = r(t, n) : i = d.isURLSearchParams(t) ? t.toString() : new gt(t, n).toString(s), i) {
|
|
1468
|
+
const o = e.indexOf("#");
|
|
1469
|
+
o !== -1 && (e = e.slice(0, o)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
|
|
1470
|
+
}
|
|
1471
|
+
return e;
|
|
1472
|
+
}
|
|
1473
|
+
class Bt {
|
|
1474
|
+
constructor() {
|
|
1475
|
+
this.handlers = [];
|
|
1476
|
+
}
|
|
1477
|
+
/**
|
|
1478
|
+
* Add a new interceptor to the stack
|
|
1479
|
+
*
|
|
1480
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
1481
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
1482
|
+
*
|
|
1483
|
+
* @return {Number} An ID used to remove interceptor later
|
|
1484
|
+
*/
|
|
1485
|
+
use(t, n, s) {
|
|
1486
|
+
return this.handlers.push({
|
|
1487
|
+
fulfilled: t,
|
|
1488
|
+
rejected: n,
|
|
1489
|
+
synchronous: s ? s.synchronous : !1,
|
|
1490
|
+
runWhen: s ? s.runWhen : null
|
|
1491
|
+
}), this.handlers.length - 1;
|
|
1492
|
+
}
|
|
1493
|
+
/**
|
|
1494
|
+
* Remove an interceptor from the stack
|
|
1495
|
+
*
|
|
1496
|
+
* @param {Number} id The ID that was returned by `use`
|
|
1497
|
+
*
|
|
1498
|
+
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
|
|
1499
|
+
*/
|
|
1500
|
+
eject(t) {
|
|
1501
|
+
this.handlers[t] && (this.handlers[t] = null);
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* Clear all interceptors from the stack
|
|
1505
|
+
*
|
|
1506
|
+
* @returns {void}
|
|
1507
|
+
*/
|
|
1508
|
+
clear() {
|
|
1509
|
+
this.handlers && (this.handlers = []);
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Iterate over all the registered interceptors
|
|
1513
|
+
*
|
|
1514
|
+
* This method is particularly useful for skipping over any
|
|
1515
|
+
* interceptors that may have become `null` calling `eject`.
|
|
1516
|
+
*
|
|
1517
|
+
* @param {Function} fn The function to call for each interceptor
|
|
1518
|
+
*
|
|
1519
|
+
* @returns {void}
|
|
1520
|
+
*/
|
|
1521
|
+
forEach(t) {
|
|
1522
|
+
d.forEach(this.handlers, function(s) {
|
|
1523
|
+
s !== null && t(s);
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
const wn = {
|
|
1528
|
+
silentJSONParsing: !0,
|
|
1529
|
+
forcedJSONParsing: !0,
|
|
1530
|
+
clarifyTimeoutError: !1
|
|
1531
|
+
}, Cr = typeof URLSearchParams < "u" ? URLSearchParams : gt, kr = typeof FormData < "u" ? FormData : null, jr = typeof Blob < "u" ? Blob : null, Nr = {
|
|
1532
|
+
isBrowser: !0,
|
|
1533
|
+
classes: {
|
|
1534
|
+
URLSearchParams: Cr,
|
|
1535
|
+
FormData: kr,
|
|
1536
|
+
Blob: jr
|
|
1537
|
+
},
|
|
1538
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
1539
|
+
}, bt = typeof window < "u" && typeof document < "u", dt = typeof navigator == "object" && navigator || void 0, Or = bt && (!dt || ["ReactNative", "NativeScript", "NS"].indexOf(dt.product) < 0), Tr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
1540
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Ur = bt && window.location.href || "http://localhost", Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1541
|
+
__proto__: null,
|
|
1542
|
+
hasBrowserEnv: bt,
|
|
1543
|
+
hasStandardBrowserEnv: Or,
|
|
1544
|
+
hasStandardBrowserWebWorkerEnv: Tr,
|
|
1545
|
+
navigator: dt,
|
|
1546
|
+
origin: Ur
|
|
1547
|
+
}, Symbol.toStringTag, { value: "Module" })), W = {
|
|
1548
|
+
...Pr,
|
|
1549
|
+
...Nr
|
|
1550
|
+
};
|
|
1551
|
+
function Lr(e, t) {
|
|
1552
|
+
return Ve(e, new W.classes.URLSearchParams(), {
|
|
1553
|
+
visitor: function(n, s, r, i) {
|
|
1554
|
+
return W.isNode && d.isBuffer(n) ? (this.append(s, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
1555
|
+
},
|
|
1556
|
+
...t
|
|
1557
|
+
});
|
|
1558
|
+
}
|
|
1559
|
+
function Ir(e) {
|
|
1560
|
+
return d.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
1561
|
+
}
|
|
1562
|
+
function Dr(e) {
|
|
1563
|
+
const t = {}, n = Object.keys(e);
|
|
1564
|
+
let s;
|
|
1565
|
+
const r = n.length;
|
|
1566
|
+
let i;
|
|
1567
|
+
for (s = 0; s < r; s++)
|
|
1568
|
+
i = n[s], t[i] = e[i];
|
|
1569
|
+
return t;
|
|
1570
|
+
}
|
|
1571
|
+
function vn(e) {
|
|
1572
|
+
function t(n, s, r, i) {
|
|
1573
|
+
let o = n[i++];
|
|
1574
|
+
if (o === "__proto__") return !0;
|
|
1575
|
+
const l = Number.isFinite(+o), m = i >= n.length;
|
|
1576
|
+
return o = !o && d.isArray(r) ? r.length : o, m ? (d.hasOwnProp(r, o) ? r[o] = [r[o], s] : r[o] = s, !l) : ((!r[o] || !d.isObject(r[o])) && (r[o] = []), t(n, s, r[o], i) && d.isArray(r[o]) && (r[o] = Dr(r[o])), !l);
|
|
1577
|
+
}
|
|
1578
|
+
if (d.isFormData(e) && d.isFunction(e.entries)) {
|
|
1579
|
+
const n = {};
|
|
1580
|
+
return d.forEachEntry(e, (s, r) => {
|
|
1581
|
+
t(Ir(s), r, n, 0);
|
|
1582
|
+
}), n;
|
|
1583
|
+
}
|
|
1584
|
+
return null;
|
|
1585
|
+
}
|
|
1586
|
+
function Mr(e, t, n) {
|
|
1587
|
+
if (d.isString(e))
|
|
1588
|
+
try {
|
|
1589
|
+
return (t || JSON.parse)(e), d.trim(e);
|
|
1590
|
+
} catch (s) {
|
|
1591
|
+
if (s.name !== "SyntaxError")
|
|
1592
|
+
throw s;
|
|
1593
|
+
}
|
|
1594
|
+
return (n || JSON.stringify)(e);
|
|
1595
|
+
}
|
|
1596
|
+
const ke = {
|
|
1597
|
+
transitional: wn,
|
|
1598
|
+
adapter: ["xhr", "http", "fetch"],
|
|
1599
|
+
transformRequest: [function(t, n) {
|
|
1600
|
+
const s = n.getContentType() || "", r = s.indexOf("application/json") > -1, i = d.isObject(t);
|
|
1601
|
+
if (i && d.isHTMLForm(t) && (t = new FormData(t)), d.isFormData(t))
|
|
1602
|
+
return r ? JSON.stringify(vn(t)) : t;
|
|
1603
|
+
if (d.isArrayBuffer(t) || d.isBuffer(t) || d.isStream(t) || d.isFile(t) || d.isBlob(t) || d.isReadableStream(t))
|
|
1604
|
+
return t;
|
|
1605
|
+
if (d.isArrayBufferView(t))
|
|
1606
|
+
return t.buffer;
|
|
1607
|
+
if (d.isURLSearchParams(t))
|
|
1608
|
+
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
1609
|
+
let l;
|
|
1610
|
+
if (i) {
|
|
1611
|
+
if (s.indexOf("application/x-www-form-urlencoded") > -1)
|
|
1612
|
+
return Lr(t, this.formSerializer).toString();
|
|
1613
|
+
if ((l = d.isFileList(t)) || s.indexOf("multipart/form-data") > -1) {
|
|
1614
|
+
const m = this.env && this.env.FormData;
|
|
1615
|
+
return Ve(
|
|
1616
|
+
l ? { "files[]": t } : t,
|
|
1617
|
+
m && new m(),
|
|
1618
|
+
this.formSerializer
|
|
1619
|
+
);
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
return i || r ? (n.setContentType("application/json", !1), Mr(t)) : t;
|
|
1623
|
+
}],
|
|
1624
|
+
transformResponse: [function(t) {
|
|
1625
|
+
const n = this.transitional || ke.transitional, s = n && n.forcedJSONParsing, r = this.responseType === "json";
|
|
1626
|
+
if (d.isResponse(t) || d.isReadableStream(t))
|
|
1627
|
+
return t;
|
|
1628
|
+
if (t && d.isString(t) && (s && !this.responseType || r)) {
|
|
1629
|
+
const o = !(n && n.silentJSONParsing) && r;
|
|
1630
|
+
try {
|
|
1631
|
+
return JSON.parse(t, this.parseReviver);
|
|
1632
|
+
} catch (l) {
|
|
1633
|
+
if (o)
|
|
1634
|
+
throw l.name === "SyntaxError" ? S.from(l, S.ERR_BAD_RESPONSE, this, null, this.response) : l;
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
return t;
|
|
1638
|
+
}],
|
|
1639
|
+
/**
|
|
1640
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
1641
|
+
* timeout is not created.
|
|
1642
|
+
*/
|
|
1643
|
+
timeout: 0,
|
|
1644
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
1645
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
1646
|
+
maxContentLength: -1,
|
|
1647
|
+
maxBodyLength: -1,
|
|
1648
|
+
env: {
|
|
1649
|
+
FormData: W.classes.FormData,
|
|
1650
|
+
Blob: W.classes.Blob
|
|
1651
|
+
},
|
|
1652
|
+
validateStatus: function(t) {
|
|
1653
|
+
return t >= 200 && t < 300;
|
|
1654
|
+
},
|
|
1655
|
+
headers: {
|
|
1656
|
+
common: {
|
|
1657
|
+
Accept: "application/json, text/plain, */*",
|
|
1658
|
+
"Content-Type": void 0
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
};
|
|
1662
|
+
d.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
1663
|
+
ke.headers[e] = {};
|
|
1664
|
+
});
|
|
1665
|
+
const Fr = d.toObjectSet([
|
|
1666
|
+
"age",
|
|
1667
|
+
"authorization",
|
|
1668
|
+
"content-length",
|
|
1669
|
+
"content-type",
|
|
1670
|
+
"etag",
|
|
1671
|
+
"expires",
|
|
1672
|
+
"from",
|
|
1673
|
+
"host",
|
|
1674
|
+
"if-modified-since",
|
|
1675
|
+
"if-unmodified-since",
|
|
1676
|
+
"last-modified",
|
|
1677
|
+
"location",
|
|
1678
|
+
"max-forwards",
|
|
1679
|
+
"proxy-authorization",
|
|
1680
|
+
"referer",
|
|
1681
|
+
"retry-after",
|
|
1682
|
+
"user-agent"
|
|
1683
|
+
]), $r = (e) => {
|
|
1684
|
+
const t = {};
|
|
1685
|
+
let n, s, r;
|
|
1686
|
+
return e && e.split(`
|
|
1687
|
+
`).forEach(function(o) {
|
|
1688
|
+
r = o.indexOf(":"), n = o.substring(0, r).trim().toLowerCase(), s = o.substring(r + 1).trim(), !(!n || t[n] && Fr[n]) && (n === "set-cookie" ? t[n] ? t[n].push(s) : t[n] = [s] : t[n] = t[n] ? t[n] + ", " + s : s);
|
|
1689
|
+
}), t;
|
|
1690
|
+
}, qt = Symbol("internals");
|
|
1691
|
+
function Re(e) {
|
|
1692
|
+
return e && String(e).trim().toLowerCase();
|
|
1693
|
+
}
|
|
1694
|
+
function $e(e) {
|
|
1695
|
+
return e === !1 || e == null ? e : d.isArray(e) ? e.map($e) : String(e);
|
|
1696
|
+
}
|
|
1697
|
+
function Br(e) {
|
|
1698
|
+
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
1699
|
+
let s;
|
|
1700
|
+
for (; s = n.exec(e); )
|
|
1701
|
+
t[s[1]] = s[2];
|
|
1702
|
+
return t;
|
|
1703
|
+
}
|
|
1704
|
+
const qr = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
1705
|
+
function rt(e, t, n, s, r) {
|
|
1706
|
+
if (d.isFunction(s))
|
|
1707
|
+
return s.call(this, t, n);
|
|
1708
|
+
if (r && (t = n), !!d.isString(t)) {
|
|
1709
|
+
if (d.isString(s))
|
|
1710
|
+
return t.indexOf(s) !== -1;
|
|
1711
|
+
if (d.isRegExp(s))
|
|
1712
|
+
return s.test(t);
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
function Wr(e) {
|
|
1716
|
+
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, s) => n.toUpperCase() + s);
|
|
1717
|
+
}
|
|
1718
|
+
function Hr(e, t) {
|
|
1719
|
+
const n = d.toCamelCase(" " + t);
|
|
1720
|
+
["get", "set", "has"].forEach((s) => {
|
|
1721
|
+
Object.defineProperty(e, s + n, {
|
|
1722
|
+
value: function(r, i, o) {
|
|
1723
|
+
return this[s].call(this, t, r, i, o);
|
|
1724
|
+
},
|
|
1725
|
+
configurable: !0
|
|
1726
|
+
});
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1729
|
+
let Y = class {
|
|
1730
|
+
constructor(t) {
|
|
1731
|
+
t && this.set(t);
|
|
1732
|
+
}
|
|
1733
|
+
set(t, n, s) {
|
|
1734
|
+
const r = this;
|
|
1735
|
+
function i(l, m, f) {
|
|
1736
|
+
const u = Re(m);
|
|
1737
|
+
if (!u)
|
|
1738
|
+
throw new Error("header name must be a non-empty string");
|
|
1739
|
+
const h = d.findKey(r, u);
|
|
1740
|
+
(!h || r[h] === void 0 || f === !0 || f === void 0 && r[h] !== !1) && (r[h || m] = $e(l));
|
|
1741
|
+
}
|
|
1742
|
+
const o = (l, m) => d.forEach(l, (f, u) => i(f, u, m));
|
|
1743
|
+
if (d.isPlainObject(t) || t instanceof this.constructor)
|
|
1744
|
+
o(t, n);
|
|
1745
|
+
else if (d.isString(t) && (t = t.trim()) && !qr(t))
|
|
1746
|
+
o($r(t), n);
|
|
1747
|
+
else if (d.isObject(t) && d.isIterable(t)) {
|
|
1748
|
+
let l = {}, m, f;
|
|
1749
|
+
for (const u of t) {
|
|
1750
|
+
if (!d.isArray(u))
|
|
1751
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
1752
|
+
l[f = u[0]] = (m = l[f]) ? d.isArray(m) ? [...m, u[1]] : [m, u[1]] : u[1];
|
|
1753
|
+
}
|
|
1754
|
+
o(l, n);
|
|
1755
|
+
} else
|
|
1756
|
+
t != null && i(n, t, s);
|
|
1757
|
+
return this;
|
|
1758
|
+
}
|
|
1759
|
+
get(t, n) {
|
|
1760
|
+
if (t = Re(t), t) {
|
|
1761
|
+
const s = d.findKey(this, t);
|
|
1762
|
+
if (s) {
|
|
1763
|
+
const r = this[s];
|
|
1764
|
+
if (!n)
|
|
1765
|
+
return r;
|
|
1766
|
+
if (n === !0)
|
|
1767
|
+
return Br(r);
|
|
1768
|
+
if (d.isFunction(n))
|
|
1769
|
+
return n.call(this, r, s);
|
|
1770
|
+
if (d.isRegExp(n))
|
|
1771
|
+
return n.exec(r);
|
|
1772
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
has(t, n) {
|
|
1777
|
+
if (t = Re(t), t) {
|
|
1778
|
+
const s = d.findKey(this, t);
|
|
1779
|
+
return !!(s && this[s] !== void 0 && (!n || rt(this, this[s], s, n)));
|
|
1780
|
+
}
|
|
1781
|
+
return !1;
|
|
1782
|
+
}
|
|
1783
|
+
delete(t, n) {
|
|
1784
|
+
const s = this;
|
|
1785
|
+
let r = !1;
|
|
1786
|
+
function i(o) {
|
|
1787
|
+
if (o = Re(o), o) {
|
|
1788
|
+
const l = d.findKey(s, o);
|
|
1789
|
+
l && (!n || rt(s, s[l], l, n)) && (delete s[l], r = !0);
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
return d.isArray(t) ? t.forEach(i) : i(t), r;
|
|
1793
|
+
}
|
|
1794
|
+
clear(t) {
|
|
1795
|
+
const n = Object.keys(this);
|
|
1796
|
+
let s = n.length, r = !1;
|
|
1797
|
+
for (; s--; ) {
|
|
1798
|
+
const i = n[s];
|
|
1799
|
+
(!t || rt(this, this[i], i, t, !0)) && (delete this[i], r = !0);
|
|
1800
|
+
}
|
|
1801
|
+
return r;
|
|
1802
|
+
}
|
|
1803
|
+
normalize(t) {
|
|
1804
|
+
const n = this, s = {};
|
|
1805
|
+
return d.forEach(this, (r, i) => {
|
|
1806
|
+
const o = d.findKey(s, i);
|
|
1807
|
+
if (o) {
|
|
1808
|
+
n[o] = $e(r), delete n[i];
|
|
1809
|
+
return;
|
|
1810
|
+
}
|
|
1811
|
+
const l = t ? Wr(i) : String(i).trim();
|
|
1812
|
+
l !== i && delete n[i], n[l] = $e(r), s[l] = !0;
|
|
1813
|
+
}), this;
|
|
1814
|
+
}
|
|
1815
|
+
concat(...t) {
|
|
1816
|
+
return this.constructor.concat(this, ...t);
|
|
1817
|
+
}
|
|
1818
|
+
toJSON(t) {
|
|
1819
|
+
const n = /* @__PURE__ */ Object.create(null);
|
|
1820
|
+
return d.forEach(this, (s, r) => {
|
|
1821
|
+
s != null && s !== !1 && (n[r] = t && d.isArray(s) ? s.join(", ") : s);
|
|
1822
|
+
}), n;
|
|
1823
|
+
}
|
|
1824
|
+
[Symbol.iterator]() {
|
|
1825
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
1826
|
+
}
|
|
1827
|
+
toString() {
|
|
1828
|
+
return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
|
|
1829
|
+
`);
|
|
1830
|
+
}
|
|
1831
|
+
getSetCookie() {
|
|
1832
|
+
return this.get("set-cookie") || [];
|
|
1833
|
+
}
|
|
1834
|
+
get [Symbol.toStringTag]() {
|
|
1835
|
+
return "AxiosHeaders";
|
|
1836
|
+
}
|
|
1837
|
+
static from(t) {
|
|
1838
|
+
return t instanceof this ? t : new this(t);
|
|
1839
|
+
}
|
|
1840
|
+
static concat(t, ...n) {
|
|
1841
|
+
const s = new this(t);
|
|
1842
|
+
return n.forEach((r) => s.set(r)), s;
|
|
1843
|
+
}
|
|
1844
|
+
static accessor(t) {
|
|
1845
|
+
const s = (this[qt] = this[qt] = {
|
|
1846
|
+
accessors: {}
|
|
1847
|
+
}).accessors, r = this.prototype;
|
|
1848
|
+
function i(o) {
|
|
1849
|
+
const l = Re(o);
|
|
1850
|
+
s[l] || (Hr(r, o), s[l] = !0);
|
|
1851
|
+
}
|
|
1852
|
+
return d.isArray(t) ? t.forEach(i) : i(t), this;
|
|
1853
|
+
}
|
|
1854
|
+
};
|
|
1855
|
+
Y.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
1856
|
+
d.reduceDescriptors(Y.prototype, ({ value: e }, t) => {
|
|
1857
|
+
let n = t[0].toUpperCase() + t.slice(1);
|
|
1858
|
+
return {
|
|
1859
|
+
get: () => e,
|
|
1860
|
+
set(s) {
|
|
1861
|
+
this[n] = s;
|
|
1862
|
+
}
|
|
1863
|
+
};
|
|
1864
|
+
});
|
|
1865
|
+
d.freezeMethods(Y);
|
|
1866
|
+
function ot(e, t) {
|
|
1867
|
+
const n = this || ke, s = t || n, r = Y.from(s.headers);
|
|
1868
|
+
let i = s.data;
|
|
1869
|
+
return d.forEach(e, function(l) {
|
|
1870
|
+
i = l.call(n, i, r.normalize(), t ? t.status : void 0);
|
|
1871
|
+
}), r.normalize(), i;
|
|
1872
|
+
}
|
|
1873
|
+
function En(e) {
|
|
1874
|
+
return !!(e && e.__CANCEL__);
|
|
1875
|
+
}
|
|
1876
|
+
function _e(e, t, n) {
|
|
1877
|
+
S.call(this, e ?? "canceled", S.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
1878
|
+
}
|
|
1879
|
+
d.inherits(_e, S, {
|
|
1880
|
+
__CANCEL__: !0
|
|
1881
|
+
});
|
|
1882
|
+
function Rn(e, t, n) {
|
|
1883
|
+
const s = n.config.validateStatus;
|
|
1884
|
+
!n.status || !s || s(n.status) ? e(n) : t(new S(
|
|
1885
|
+
"Request failed with status code " + n.status,
|
|
1886
|
+
[S.ERR_BAD_REQUEST, S.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
|
|
1887
|
+
n.config,
|
|
1888
|
+
n.request,
|
|
1889
|
+
n
|
|
1890
|
+
));
|
|
1891
|
+
}
|
|
1892
|
+
function zr(e) {
|
|
1893
|
+
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
1894
|
+
return t && t[1] || "";
|
|
1895
|
+
}
|
|
1896
|
+
function Jr(e, t) {
|
|
1897
|
+
e = e || 10;
|
|
1898
|
+
const n = new Array(e), s = new Array(e);
|
|
1899
|
+
let r = 0, i = 0, o;
|
|
1900
|
+
return t = t !== void 0 ? t : 1e3, function(m) {
|
|
1901
|
+
const f = Date.now(), u = s[i];
|
|
1902
|
+
o || (o = f), n[r] = m, s[r] = f;
|
|
1903
|
+
let h = i, x = 0;
|
|
1904
|
+
for (; h !== r; )
|
|
1905
|
+
x += n[h++], h = h % e;
|
|
1906
|
+
if (r = (r + 1) % e, r === i && (i = (i + 1) % e), f - o < t)
|
|
1907
|
+
return;
|
|
1908
|
+
const j = u && f - u;
|
|
1909
|
+
return j ? Math.round(x * 1e3 / j) : void 0;
|
|
1910
|
+
};
|
|
1911
|
+
}
|
|
1912
|
+
function Vr(e, t) {
|
|
1913
|
+
let n = 0, s = 1e3 / t, r, i;
|
|
1914
|
+
const o = (f, u = Date.now()) => {
|
|
1915
|
+
n = u, r = null, i && (clearTimeout(i), i = null), e(...f);
|
|
1916
|
+
};
|
|
1917
|
+
return [(...f) => {
|
|
1918
|
+
const u = Date.now(), h = u - n;
|
|
1919
|
+
h >= s ? o(f, u) : (r = f, i || (i = setTimeout(() => {
|
|
1920
|
+
i = null, o(r);
|
|
1921
|
+
}, s - h)));
|
|
1922
|
+
}, () => r && o(r)];
|
|
1923
|
+
}
|
|
1924
|
+
const We = (e, t, n = 3) => {
|
|
1925
|
+
let s = 0;
|
|
1926
|
+
const r = Jr(50, 250);
|
|
1927
|
+
return Vr((i) => {
|
|
1928
|
+
const o = i.loaded, l = i.lengthComputable ? i.total : void 0, m = o - s, f = r(m), u = o <= l;
|
|
1929
|
+
s = o;
|
|
1930
|
+
const h = {
|
|
1931
|
+
loaded: o,
|
|
1932
|
+
total: l,
|
|
1933
|
+
progress: l ? o / l : void 0,
|
|
1934
|
+
bytes: m,
|
|
1935
|
+
rate: f || void 0,
|
|
1936
|
+
estimated: f && l && u ? (l - o) / f : void 0,
|
|
1937
|
+
event: i,
|
|
1938
|
+
lengthComputable: l != null,
|
|
1939
|
+
[t ? "download" : "upload"]: !0
|
|
1940
|
+
};
|
|
1941
|
+
e(h);
|
|
1942
|
+
}, n);
|
|
1943
|
+
}, Wt = (e, t) => {
|
|
1944
|
+
const n = e != null;
|
|
1945
|
+
return [(s) => t[0]({
|
|
1946
|
+
lengthComputable: n,
|
|
1947
|
+
total: e,
|
|
1948
|
+
loaded: s
|
|
1949
|
+
}), t[1]];
|
|
1950
|
+
}, Ht = (e) => (...t) => d.asap(() => e(...t)), Kr = W.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, W.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
1951
|
+
new URL(W.origin),
|
|
1952
|
+
W.navigator && /(msie|trident)/i.test(W.navigator.userAgent)
|
|
1953
|
+
) : () => !0, Gr = W.hasStandardBrowserEnv ? (
|
|
1954
|
+
// Standard browser envs support document.cookie
|
|
1955
|
+
{
|
|
1956
|
+
write(e, t, n, s, r, i) {
|
|
1957
|
+
const o = [e + "=" + encodeURIComponent(t)];
|
|
1958
|
+
d.isNumber(n) && o.push("expires=" + new Date(n).toGMTString()), d.isString(s) && o.push("path=" + s), d.isString(r) && o.push("domain=" + r), i === !0 && o.push("secure"), document.cookie = o.join("; ");
|
|
1959
|
+
},
|
|
1960
|
+
read(e) {
|
|
1961
|
+
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
1962
|
+
return t ? decodeURIComponent(t[3]) : null;
|
|
1963
|
+
},
|
|
1964
|
+
remove(e) {
|
|
1965
|
+
this.write(e, "", Date.now() - 864e5);
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
) : (
|
|
1969
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
1970
|
+
{
|
|
1971
|
+
write() {
|
|
1972
|
+
},
|
|
1973
|
+
read() {
|
|
1974
|
+
return null;
|
|
1975
|
+
},
|
|
1976
|
+
remove() {
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
);
|
|
1980
|
+
function Yr(e) {
|
|
1981
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
1982
|
+
}
|
|
1983
|
+
function Xr(e, t) {
|
|
1984
|
+
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1985
|
+
}
|
|
1986
|
+
function Sn(e, t, n) {
|
|
1987
|
+
let s = !Yr(t);
|
|
1988
|
+
return e && (s || n == !1) ? Xr(e, t) : t;
|
|
1989
|
+
}
|
|
1990
|
+
const zt = (e) => e instanceof Y ? { ...e } : e;
|
|
1991
|
+
function de(e, t) {
|
|
1992
|
+
t = t || {};
|
|
1993
|
+
const n = {};
|
|
1994
|
+
function s(f, u, h, x) {
|
|
1995
|
+
return d.isPlainObject(f) && d.isPlainObject(u) ? d.merge.call({ caseless: x }, f, u) : d.isPlainObject(u) ? d.merge({}, u) : d.isArray(u) ? u.slice() : u;
|
|
1996
|
+
}
|
|
1997
|
+
function r(f, u, h, x) {
|
|
1998
|
+
if (d.isUndefined(u)) {
|
|
1999
|
+
if (!d.isUndefined(f))
|
|
2000
|
+
return s(void 0, f, h, x);
|
|
2001
|
+
} else return s(f, u, h, x);
|
|
2002
|
+
}
|
|
2003
|
+
function i(f, u) {
|
|
2004
|
+
if (!d.isUndefined(u))
|
|
2005
|
+
return s(void 0, u);
|
|
2006
|
+
}
|
|
2007
|
+
function o(f, u) {
|
|
2008
|
+
if (d.isUndefined(u)) {
|
|
2009
|
+
if (!d.isUndefined(f))
|
|
2010
|
+
return s(void 0, f);
|
|
2011
|
+
} else return s(void 0, u);
|
|
2012
|
+
}
|
|
2013
|
+
function l(f, u, h) {
|
|
2014
|
+
if (h in t)
|
|
2015
|
+
return s(f, u);
|
|
2016
|
+
if (h in e)
|
|
2017
|
+
return s(void 0, f);
|
|
2018
|
+
}
|
|
2019
|
+
const m = {
|
|
2020
|
+
url: i,
|
|
2021
|
+
method: i,
|
|
2022
|
+
data: i,
|
|
2023
|
+
baseURL: o,
|
|
2024
|
+
transformRequest: o,
|
|
2025
|
+
transformResponse: o,
|
|
2026
|
+
paramsSerializer: o,
|
|
2027
|
+
timeout: o,
|
|
2028
|
+
timeoutMessage: o,
|
|
2029
|
+
withCredentials: o,
|
|
2030
|
+
withXSRFToken: o,
|
|
2031
|
+
adapter: o,
|
|
2032
|
+
responseType: o,
|
|
2033
|
+
xsrfCookieName: o,
|
|
2034
|
+
xsrfHeaderName: o,
|
|
2035
|
+
onUploadProgress: o,
|
|
2036
|
+
onDownloadProgress: o,
|
|
2037
|
+
decompress: o,
|
|
2038
|
+
maxContentLength: o,
|
|
2039
|
+
maxBodyLength: o,
|
|
2040
|
+
beforeRedirect: o,
|
|
2041
|
+
transport: o,
|
|
2042
|
+
httpAgent: o,
|
|
2043
|
+
httpsAgent: o,
|
|
2044
|
+
cancelToken: o,
|
|
2045
|
+
socketPath: o,
|
|
2046
|
+
responseEncoding: o,
|
|
2047
|
+
validateStatus: l,
|
|
2048
|
+
headers: (f, u, h) => r(zt(f), zt(u), h, !0)
|
|
2049
|
+
};
|
|
2050
|
+
return d.forEach(Object.keys({ ...e, ...t }), function(u) {
|
|
2051
|
+
const h = m[u] || r, x = h(e[u], t[u], u);
|
|
2052
|
+
d.isUndefined(x) && h !== l || (n[u] = x);
|
|
2053
|
+
}), n;
|
|
2054
|
+
}
|
|
2055
|
+
const An = (e) => {
|
|
2056
|
+
const t = de({}, e);
|
|
2057
|
+
let { data: n, withXSRFToken: s, xsrfHeaderName: r, xsrfCookieName: i, headers: o, auth: l } = t;
|
|
2058
|
+
if (t.headers = o = Y.from(o), t.url = xn(Sn(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), l && o.set(
|
|
2059
|
+
"Authorization",
|
|
2060
|
+
"Basic " + btoa((l.username || "") + ":" + (l.password ? unescape(encodeURIComponent(l.password)) : ""))
|
|
2061
|
+
), d.isFormData(n)) {
|
|
2062
|
+
if (W.hasStandardBrowserEnv || W.hasStandardBrowserWebWorkerEnv)
|
|
2063
|
+
o.setContentType(void 0);
|
|
2064
|
+
else if (d.isFunction(n.getHeaders)) {
|
|
2065
|
+
const m = n.getHeaders(), f = ["content-type", "content-length"];
|
|
2066
|
+
Object.entries(m).forEach(([u, h]) => {
|
|
2067
|
+
f.includes(u.toLowerCase()) && o.set(u, h);
|
|
2068
|
+
});
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
if (W.hasStandardBrowserEnv && (s && d.isFunction(s) && (s = s(t)), s || s !== !1 && Kr(t.url))) {
|
|
2072
|
+
const m = r && i && Gr.read(i);
|
|
2073
|
+
m && o.set(r, m);
|
|
2074
|
+
}
|
|
2075
|
+
return t;
|
|
2076
|
+
}, Zr = typeof XMLHttpRequest < "u", Qr = Zr && function(e) {
|
|
2077
|
+
return new Promise(function(n, s) {
|
|
2078
|
+
const r = An(e);
|
|
2079
|
+
let i = r.data;
|
|
2080
|
+
const o = Y.from(r.headers).normalize();
|
|
2081
|
+
let { responseType: l, onUploadProgress: m, onDownloadProgress: f } = r, u, h, x, j, p;
|
|
2082
|
+
function y() {
|
|
2083
|
+
j && j(), p && p(), r.cancelToken && r.cancelToken.unsubscribe(u), r.signal && r.signal.removeEventListener("abort", u);
|
|
2084
|
+
}
|
|
2085
|
+
let g = new XMLHttpRequest();
|
|
2086
|
+
g.open(r.method.toUpperCase(), r.url, !0), g.timeout = r.timeout;
|
|
2087
|
+
function v() {
|
|
2088
|
+
if (!g)
|
|
2089
|
+
return;
|
|
2090
|
+
const C = Y.from(
|
|
2091
|
+
"getAllResponseHeaders" in g && g.getAllResponseHeaders()
|
|
2092
|
+
), R = {
|
|
2093
|
+
data: !l || l === "text" || l === "json" ? g.responseText : g.response,
|
|
2094
|
+
status: g.status,
|
|
2095
|
+
statusText: g.statusText,
|
|
2096
|
+
headers: C,
|
|
2097
|
+
config: e,
|
|
2098
|
+
request: g
|
|
2099
|
+
};
|
|
2100
|
+
Rn(function(w) {
|
|
2101
|
+
n(w), y();
|
|
2102
|
+
}, function(w) {
|
|
2103
|
+
s(w), y();
|
|
2104
|
+
}, R), g = null;
|
|
2105
|
+
}
|
|
2106
|
+
"onloadend" in g ? g.onloadend = v : g.onreadystatechange = function() {
|
|
2107
|
+
!g || g.readyState !== 4 || g.status === 0 && !(g.responseURL && g.responseURL.indexOf("file:") === 0) || setTimeout(v);
|
|
2108
|
+
}, g.onabort = function() {
|
|
2109
|
+
g && (s(new S("Request aborted", S.ECONNABORTED, e, g)), g = null);
|
|
2110
|
+
}, g.onerror = function(T) {
|
|
2111
|
+
const R = T && T.message ? T.message : "Network Error", U = new S(R, S.ERR_NETWORK, e, g);
|
|
2112
|
+
U.event = T || null, s(U), g = null;
|
|
2113
|
+
}, g.ontimeout = function() {
|
|
2114
|
+
let T = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
|
|
2115
|
+
const R = r.transitional || wn;
|
|
2116
|
+
r.timeoutErrorMessage && (T = r.timeoutErrorMessage), s(new S(
|
|
2117
|
+
T,
|
|
2118
|
+
R.clarifyTimeoutError ? S.ETIMEDOUT : S.ECONNABORTED,
|
|
2119
|
+
e,
|
|
2120
|
+
g
|
|
2121
|
+
)), g = null;
|
|
2122
|
+
}, i === void 0 && o.setContentType(null), "setRequestHeader" in g && d.forEach(o.toJSON(), function(T, R) {
|
|
2123
|
+
g.setRequestHeader(R, T);
|
|
2124
|
+
}), d.isUndefined(r.withCredentials) || (g.withCredentials = !!r.withCredentials), l && l !== "json" && (g.responseType = r.responseType), f && ([x, p] = We(f, !0), g.addEventListener("progress", x)), m && g.upload && ([h, j] = We(m), g.upload.addEventListener("progress", h), g.upload.addEventListener("loadend", j)), (r.cancelToken || r.signal) && (u = (C) => {
|
|
2125
|
+
g && (s(!C || C.type ? new _e(null, e, g) : C), g.abort(), g = null);
|
|
2126
|
+
}, r.cancelToken && r.cancelToken.subscribe(u), r.signal && (r.signal.aborted ? u() : r.signal.addEventListener("abort", u)));
|
|
2127
|
+
const A = zr(r.url);
|
|
2128
|
+
if (A && W.protocols.indexOf(A) === -1) {
|
|
2129
|
+
s(new S("Unsupported protocol " + A + ":", S.ERR_BAD_REQUEST, e));
|
|
2130
|
+
return;
|
|
2131
|
+
}
|
|
2132
|
+
g.send(i || null);
|
|
2133
|
+
});
|
|
2134
|
+
}, eo = (e, t) => {
|
|
2135
|
+
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
2136
|
+
if (t || n) {
|
|
2137
|
+
let s = new AbortController(), r;
|
|
2138
|
+
const i = function(f) {
|
|
2139
|
+
if (!r) {
|
|
2140
|
+
r = !0, l();
|
|
2141
|
+
const u = f instanceof Error ? f : this.reason;
|
|
2142
|
+
s.abort(u instanceof S ? u : new _e(u instanceof Error ? u.message : u));
|
|
2143
|
+
}
|
|
2144
|
+
};
|
|
2145
|
+
let o = t && setTimeout(() => {
|
|
2146
|
+
o = null, i(new S(`timeout ${t} of ms exceeded`, S.ETIMEDOUT));
|
|
2147
|
+
}, t);
|
|
2148
|
+
const l = () => {
|
|
2149
|
+
e && (o && clearTimeout(o), o = null, e.forEach((f) => {
|
|
2150
|
+
f.unsubscribe ? f.unsubscribe(i) : f.removeEventListener("abort", i);
|
|
2151
|
+
}), e = null);
|
|
2152
|
+
};
|
|
2153
|
+
e.forEach((f) => f.addEventListener("abort", i));
|
|
2154
|
+
const { signal: m } = s;
|
|
2155
|
+
return m.unsubscribe = () => d.asap(l), m;
|
|
2156
|
+
}
|
|
2157
|
+
}, to = function* (e, t) {
|
|
2158
|
+
let n = e.byteLength;
|
|
2159
|
+
if (n < t) {
|
|
2160
|
+
yield e;
|
|
2161
|
+
return;
|
|
2162
|
+
}
|
|
2163
|
+
let s = 0, r;
|
|
2164
|
+
for (; s < n; )
|
|
2165
|
+
r = s + t, yield e.slice(s, r), s = r;
|
|
2166
|
+
}, no = async function* (e, t) {
|
|
2167
|
+
for await (const n of so(e))
|
|
2168
|
+
yield* to(n, t);
|
|
2169
|
+
}, so = async function* (e) {
|
|
2170
|
+
if (e[Symbol.asyncIterator]) {
|
|
2171
|
+
yield* e;
|
|
2172
|
+
return;
|
|
2173
|
+
}
|
|
2174
|
+
const t = e.getReader();
|
|
2175
|
+
try {
|
|
2176
|
+
for (; ; ) {
|
|
2177
|
+
const { done: n, value: s } = await t.read();
|
|
2178
|
+
if (n)
|
|
2179
|
+
break;
|
|
2180
|
+
yield s;
|
|
2181
|
+
}
|
|
2182
|
+
} finally {
|
|
2183
|
+
await t.cancel();
|
|
2184
|
+
}
|
|
2185
|
+
}, Jt = (e, t, n, s) => {
|
|
2186
|
+
const r = no(e, t);
|
|
2187
|
+
let i = 0, o, l = (m) => {
|
|
2188
|
+
o || (o = !0, s && s(m));
|
|
2189
|
+
};
|
|
2190
|
+
return new ReadableStream({
|
|
2191
|
+
async pull(m) {
|
|
2192
|
+
try {
|
|
2193
|
+
const { done: f, value: u } = await r.next();
|
|
2194
|
+
if (f) {
|
|
2195
|
+
l(), m.close();
|
|
2196
|
+
return;
|
|
2197
|
+
}
|
|
2198
|
+
let h = u.byteLength;
|
|
2199
|
+
if (n) {
|
|
2200
|
+
let x = i += h;
|
|
2201
|
+
n(x);
|
|
2202
|
+
}
|
|
2203
|
+
m.enqueue(new Uint8Array(u));
|
|
2204
|
+
} catch (f) {
|
|
2205
|
+
throw l(f), f;
|
|
2206
|
+
}
|
|
2207
|
+
},
|
|
2208
|
+
cancel(m) {
|
|
2209
|
+
return l(m), r.return();
|
|
2210
|
+
}
|
|
2211
|
+
}, {
|
|
2212
|
+
highWaterMark: 2
|
|
2213
|
+
});
|
|
2214
|
+
}, Vt = 64 * 1024, { isFunction: De } = d, ro = (({ Request: e, Response: t }) => ({
|
|
2215
|
+
Request: e,
|
|
2216
|
+
Response: t
|
|
2217
|
+
}))(d.global), {
|
|
2218
|
+
ReadableStream: Kt,
|
|
2219
|
+
TextEncoder: Gt
|
|
2220
|
+
} = d.global, Yt = (e, ...t) => {
|
|
2221
|
+
try {
|
|
2222
|
+
return !!e(...t);
|
|
2223
|
+
} catch {
|
|
2224
|
+
return !1;
|
|
2225
|
+
}
|
|
2226
|
+
}, oo = (e) => {
|
|
2227
|
+
e = d.merge.call({
|
|
2228
|
+
skipUndefined: !0
|
|
2229
|
+
}, ro, e);
|
|
2230
|
+
const { fetch: t, Request: n, Response: s } = e, r = t ? De(t) : typeof fetch == "function", i = De(n), o = De(s);
|
|
2231
|
+
if (!r)
|
|
2232
|
+
return !1;
|
|
2233
|
+
const l = r && De(Kt), m = r && (typeof Gt == "function" ? /* @__PURE__ */ ((p) => (y) => p.encode(y))(new Gt()) : async (p) => new Uint8Array(await new n(p).arrayBuffer())), f = i && l && Yt(() => {
|
|
2234
|
+
let p = !1;
|
|
2235
|
+
const y = new n(W.origin, {
|
|
2236
|
+
body: new Kt(),
|
|
2237
|
+
method: "POST",
|
|
2238
|
+
get duplex() {
|
|
2239
|
+
return p = !0, "half";
|
|
2240
|
+
}
|
|
2241
|
+
}).headers.has("Content-Type");
|
|
2242
|
+
return p && !y;
|
|
2243
|
+
}), u = o && l && Yt(() => d.isReadableStream(new s("").body)), h = {
|
|
2244
|
+
stream: u && ((p) => p.body)
|
|
2245
|
+
};
|
|
2246
|
+
r && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((p) => {
|
|
2247
|
+
!h[p] && (h[p] = (y, g) => {
|
|
2248
|
+
let v = y && y[p];
|
|
2249
|
+
if (v)
|
|
2250
|
+
return v.call(y);
|
|
2251
|
+
throw new S(`Response type '${p}' is not supported`, S.ERR_NOT_SUPPORT, g);
|
|
2252
|
+
});
|
|
2253
|
+
});
|
|
2254
|
+
const x = async (p) => {
|
|
2255
|
+
if (p == null)
|
|
2256
|
+
return 0;
|
|
2257
|
+
if (d.isBlob(p))
|
|
2258
|
+
return p.size;
|
|
2259
|
+
if (d.isSpecCompliantForm(p))
|
|
2260
|
+
return (await new n(W.origin, {
|
|
2261
|
+
method: "POST",
|
|
2262
|
+
body: p
|
|
2263
|
+
}).arrayBuffer()).byteLength;
|
|
2264
|
+
if (d.isArrayBufferView(p) || d.isArrayBuffer(p))
|
|
2265
|
+
return p.byteLength;
|
|
2266
|
+
if (d.isURLSearchParams(p) && (p = p + ""), d.isString(p))
|
|
2267
|
+
return (await m(p)).byteLength;
|
|
2268
|
+
}, j = async (p, y) => {
|
|
2269
|
+
const g = d.toFiniteNumber(p.getContentLength());
|
|
2270
|
+
return g ?? x(y);
|
|
2271
|
+
};
|
|
2272
|
+
return async (p) => {
|
|
2273
|
+
let {
|
|
2274
|
+
url: y,
|
|
2275
|
+
method: g,
|
|
2276
|
+
data: v,
|
|
2277
|
+
signal: A,
|
|
2278
|
+
cancelToken: C,
|
|
2279
|
+
timeout: T,
|
|
2280
|
+
onDownloadProgress: R,
|
|
2281
|
+
onUploadProgress: U,
|
|
2282
|
+
responseType: w,
|
|
2283
|
+
headers: D,
|
|
2284
|
+
withCredentials: $ = "same-origin",
|
|
2285
|
+
fetchOptions: Q
|
|
2286
|
+
} = An(p), B = t || fetch;
|
|
2287
|
+
w = w ? (w + "").toLowerCase() : "text";
|
|
2288
|
+
let L = eo([A, C && C.toAbortSignal()], T), q = null;
|
|
2289
|
+
const z = L && L.unsubscribe && (() => {
|
|
2290
|
+
L.unsubscribe();
|
|
2291
|
+
});
|
|
2292
|
+
let ie;
|
|
2293
|
+
try {
|
|
2294
|
+
if (U && f && g !== "get" && g !== "head" && (ie = await j(D, v)) !== 0) {
|
|
2295
|
+
let te = new n(y, {
|
|
2296
|
+
method: "POST",
|
|
2297
|
+
body: v,
|
|
2298
|
+
duplex: "half"
|
|
2299
|
+
}), oe;
|
|
2300
|
+
if (d.isFormData(v) && (oe = te.headers.get("content-type")) && D.setContentType(oe), te.body) {
|
|
2301
|
+
const [fe, me] = Wt(
|
|
2302
|
+
ie,
|
|
2303
|
+
We(Ht(U))
|
|
2304
|
+
);
|
|
2305
|
+
v = Jt(te.body, Vt, fe, me);
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
d.isString($) || ($ = $ ? "include" : "omit");
|
|
2309
|
+
const X = i && "credentials" in n.prototype, ye = {
|
|
2310
|
+
...Q,
|
|
2311
|
+
signal: L,
|
|
2312
|
+
method: g.toUpperCase(),
|
|
2313
|
+
headers: D.normalize().toJSON(),
|
|
2314
|
+
body: v,
|
|
2315
|
+
duplex: "half",
|
|
2316
|
+
credentials: X ? $ : void 0
|
|
2317
|
+
};
|
|
2318
|
+
q = i && new n(y, ye);
|
|
2319
|
+
let ee = await (i ? B(q, Q) : B(y, ye));
|
|
2320
|
+
const xe = u && (w === "stream" || w === "response");
|
|
2321
|
+
if (u && (R || xe && z)) {
|
|
2322
|
+
const te = {};
|
|
2323
|
+
["status", "statusText", "headers"].forEach((Oe) => {
|
|
2324
|
+
te[Oe] = ee[Oe];
|
|
2325
|
+
});
|
|
2326
|
+
const oe = d.toFiniteNumber(ee.headers.get("content-length")), [fe, me] = R && Wt(
|
|
2327
|
+
oe,
|
|
2328
|
+
We(Ht(R), !0)
|
|
2329
|
+
) || [];
|
|
2330
|
+
ee = new s(
|
|
2331
|
+
Jt(ee.body, Vt, fe, () => {
|
|
2332
|
+
me && me(), z && z();
|
|
2333
|
+
}),
|
|
2334
|
+
te
|
|
2335
|
+
);
|
|
2336
|
+
}
|
|
2337
|
+
w = w || "text";
|
|
2338
|
+
let Ne = await h[d.findKey(h, w) || "text"](ee, p);
|
|
2339
|
+
return !xe && z && z(), await new Promise((te, oe) => {
|
|
2340
|
+
Rn(te, oe, {
|
|
2341
|
+
data: Ne,
|
|
2342
|
+
headers: Y.from(ee.headers),
|
|
2343
|
+
status: ee.status,
|
|
2344
|
+
statusText: ee.statusText,
|
|
2345
|
+
config: p,
|
|
2346
|
+
request: q
|
|
2347
|
+
});
|
|
2348
|
+
});
|
|
2349
|
+
} catch (X) {
|
|
2350
|
+
throw z && z(), X && X.name === "TypeError" && /Load failed|fetch/i.test(X.message) ? Object.assign(
|
|
2351
|
+
new S("Network Error", S.ERR_NETWORK, p, q),
|
|
2352
|
+
{
|
|
2353
|
+
cause: X.cause || X
|
|
2354
|
+
}
|
|
2355
|
+
) : S.from(X, X && X.code, p, q);
|
|
2356
|
+
}
|
|
2357
|
+
};
|
|
2358
|
+
}, io = /* @__PURE__ */ new Map(), Cn = (e) => {
|
|
2359
|
+
let t = e ? e.env : {};
|
|
2360
|
+
const { fetch: n, Request: s, Response: r } = t, i = [
|
|
2361
|
+
s,
|
|
2362
|
+
r,
|
|
2363
|
+
n
|
|
2364
|
+
];
|
|
2365
|
+
let o = i.length, l = o, m, f, u = io;
|
|
2366
|
+
for (; l--; )
|
|
2367
|
+
m = i[l], f = u.get(m), f === void 0 && u.set(m, f = l ? /* @__PURE__ */ new Map() : oo(t)), u = f;
|
|
2368
|
+
return f;
|
|
2369
|
+
};
|
|
2370
|
+
Cn();
|
|
2371
|
+
const ft = {
|
|
2372
|
+
http: Er,
|
|
2373
|
+
xhr: Qr,
|
|
2374
|
+
fetch: {
|
|
2375
|
+
get: Cn
|
|
2376
|
+
}
|
|
2377
|
+
};
|
|
2378
|
+
d.forEach(ft, (e, t) => {
|
|
2379
|
+
if (e) {
|
|
2380
|
+
try {
|
|
2381
|
+
Object.defineProperty(e, "name", { value: t });
|
|
2382
|
+
} catch {
|
|
2383
|
+
}
|
|
2384
|
+
Object.defineProperty(e, "adapterName", { value: t });
|
|
2385
|
+
}
|
|
2386
|
+
});
|
|
2387
|
+
const Xt = (e) => `- ${e}`, ao = (e) => d.isFunction(e) || e === null || e === !1, kn = {
|
|
2388
|
+
getAdapter: (e, t) => {
|
|
2389
|
+
e = d.isArray(e) ? e : [e];
|
|
2390
|
+
const { length: n } = e;
|
|
2391
|
+
let s, r;
|
|
2392
|
+
const i = {};
|
|
2393
|
+
for (let o = 0; o < n; o++) {
|
|
2394
|
+
s = e[o];
|
|
2395
|
+
let l;
|
|
2396
|
+
if (r = s, !ao(s) && (r = ft[(l = String(s)).toLowerCase()], r === void 0))
|
|
2397
|
+
throw new S(`Unknown adapter '${l}'`);
|
|
2398
|
+
if (r && (d.isFunction(r) || (r = r.get(t))))
|
|
2399
|
+
break;
|
|
2400
|
+
i[l || "#" + o] = r;
|
|
2401
|
+
}
|
|
2402
|
+
if (!r) {
|
|
2403
|
+
const o = Object.entries(i).map(
|
|
2404
|
+
([m, f]) => `adapter ${m} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
2405
|
+
);
|
|
2406
|
+
let l = n ? o.length > 1 ? `since :
|
|
2407
|
+
` + o.map(Xt).join(`
|
|
2408
|
+
`) : " " + Xt(o[0]) : "as no adapter specified";
|
|
2409
|
+
throw new S(
|
|
2410
|
+
"There is no suitable adapter to dispatch the request " + l,
|
|
2411
|
+
"ERR_NOT_SUPPORT"
|
|
2412
|
+
);
|
|
2413
|
+
}
|
|
2414
|
+
return r;
|
|
2415
|
+
},
|
|
2416
|
+
adapters: ft
|
|
2417
|
+
};
|
|
2418
|
+
function it(e) {
|
|
2419
|
+
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
2420
|
+
throw new _e(null, e);
|
|
2421
|
+
}
|
|
2422
|
+
function Zt(e) {
|
|
2423
|
+
return it(e), e.headers = Y.from(e.headers), e.data = ot.call(
|
|
2424
|
+
e,
|
|
2425
|
+
e.transformRequest
|
|
2426
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), kn.getAdapter(e.adapter || ke.adapter, e)(e).then(function(s) {
|
|
2427
|
+
return it(e), s.data = ot.call(
|
|
2428
|
+
e,
|
|
2429
|
+
e.transformResponse,
|
|
2430
|
+
s
|
|
2431
|
+
), s.headers = Y.from(s.headers), s;
|
|
2432
|
+
}, function(s) {
|
|
2433
|
+
return En(s) || (it(e), s && s.response && (s.response.data = ot.call(
|
|
2434
|
+
e,
|
|
2435
|
+
e.transformResponse,
|
|
2436
|
+
s.response
|
|
2437
|
+
), s.response.headers = Y.from(s.response.headers))), Promise.reject(s);
|
|
2438
|
+
});
|
|
2439
|
+
}
|
|
2440
|
+
const jn = "1.12.2", Ke = {};
|
|
2441
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
2442
|
+
Ke[e] = function(s) {
|
|
2443
|
+
return typeof s === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
2444
|
+
};
|
|
2445
|
+
});
|
|
2446
|
+
const Qt = {};
|
|
2447
|
+
Ke.transitional = function(t, n, s) {
|
|
2448
|
+
function r(i, o) {
|
|
2449
|
+
return "[Axios v" + jn + "] Transitional option '" + i + "'" + o + (s ? ". " + s : "");
|
|
2450
|
+
}
|
|
2451
|
+
return (i, o, l) => {
|
|
2452
|
+
if (t === !1)
|
|
2453
|
+
throw new S(
|
|
2454
|
+
r(o, " has been removed" + (n ? " in " + n : "")),
|
|
2455
|
+
S.ERR_DEPRECATED
|
|
2456
|
+
);
|
|
2457
|
+
return n && !Qt[o] && (Qt[o] = !0, console.warn(
|
|
2458
|
+
r(
|
|
2459
|
+
o,
|
|
2460
|
+
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
2461
|
+
)
|
|
2462
|
+
)), t ? t(i, o, l) : !0;
|
|
2463
|
+
};
|
|
2464
|
+
};
|
|
2465
|
+
Ke.spelling = function(t) {
|
|
2466
|
+
return (n, s) => (console.warn(`${s} is likely a misspelling of ${t}`), !0);
|
|
2467
|
+
};
|
|
2468
|
+
function lo(e, t, n) {
|
|
2469
|
+
if (typeof e != "object")
|
|
2470
|
+
throw new S("options must be an object", S.ERR_BAD_OPTION_VALUE);
|
|
2471
|
+
const s = Object.keys(e);
|
|
2472
|
+
let r = s.length;
|
|
2473
|
+
for (; r-- > 0; ) {
|
|
2474
|
+
const i = s[r], o = t[i];
|
|
2475
|
+
if (o) {
|
|
2476
|
+
const l = e[i], m = l === void 0 || o(l, i, e);
|
|
2477
|
+
if (m !== !0)
|
|
2478
|
+
throw new S("option " + i + " must be " + m, S.ERR_BAD_OPTION_VALUE);
|
|
2479
|
+
continue;
|
|
2480
|
+
}
|
|
2481
|
+
if (n !== !0)
|
|
2482
|
+
throw new S("Unknown option " + i, S.ERR_BAD_OPTION);
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
const Be = {
|
|
2486
|
+
assertOptions: lo,
|
|
2487
|
+
validators: Ke
|
|
2488
|
+
}, se = Be.validators;
|
|
2489
|
+
let ue = class {
|
|
2490
|
+
constructor(t) {
|
|
2491
|
+
this.defaults = t || {}, this.interceptors = {
|
|
2492
|
+
request: new Bt(),
|
|
2493
|
+
response: new Bt()
|
|
2494
|
+
};
|
|
2495
|
+
}
|
|
2496
|
+
/**
|
|
2497
|
+
* Dispatch a request
|
|
2498
|
+
*
|
|
2499
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
2500
|
+
* @param {?Object} config
|
|
2501
|
+
*
|
|
2502
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
2503
|
+
*/
|
|
2504
|
+
async request(t, n) {
|
|
2505
|
+
try {
|
|
2506
|
+
return await this._request(t, n);
|
|
2507
|
+
} catch (s) {
|
|
2508
|
+
if (s instanceof Error) {
|
|
2509
|
+
let r = {};
|
|
2510
|
+
Error.captureStackTrace ? Error.captureStackTrace(r) : r = new Error();
|
|
2511
|
+
const i = r.stack ? r.stack.replace(/^.+\n/, "") : "";
|
|
2512
|
+
try {
|
|
2513
|
+
s.stack ? i && !String(s.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (s.stack += `
|
|
2514
|
+
` + i) : s.stack = i;
|
|
2515
|
+
} catch {
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2518
|
+
throw s;
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
_request(t, n) {
|
|
2522
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = de(this.defaults, n);
|
|
2523
|
+
const { transitional: s, paramsSerializer: r, headers: i } = n;
|
|
2524
|
+
s !== void 0 && Be.assertOptions(s, {
|
|
2525
|
+
silentJSONParsing: se.transitional(se.boolean),
|
|
2526
|
+
forcedJSONParsing: se.transitional(se.boolean),
|
|
2527
|
+
clarifyTimeoutError: se.transitional(se.boolean)
|
|
2528
|
+
}, !1), r != null && (d.isFunction(r) ? n.paramsSerializer = {
|
|
2529
|
+
serialize: r
|
|
2530
|
+
} : Be.assertOptions(r, {
|
|
2531
|
+
encode: se.function,
|
|
2532
|
+
serialize: se.function
|
|
2533
|
+
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), Be.assertOptions(n, {
|
|
2534
|
+
baseUrl: se.spelling("baseURL"),
|
|
2535
|
+
withXsrfToken: se.spelling("withXSRFToken")
|
|
2536
|
+
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
2537
|
+
let o = i && d.merge(
|
|
2538
|
+
i.common,
|
|
2539
|
+
i[n.method]
|
|
2540
|
+
);
|
|
2541
|
+
i && d.forEach(
|
|
2542
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
2543
|
+
(p) => {
|
|
2544
|
+
delete i[p];
|
|
2545
|
+
}
|
|
2546
|
+
), n.headers = Y.concat(o, i);
|
|
2547
|
+
const l = [];
|
|
2548
|
+
let m = !0;
|
|
2549
|
+
this.interceptors.request.forEach(function(y) {
|
|
2550
|
+
typeof y.runWhen == "function" && y.runWhen(n) === !1 || (m = m && y.synchronous, l.unshift(y.fulfilled, y.rejected));
|
|
2551
|
+
});
|
|
2552
|
+
const f = [];
|
|
2553
|
+
this.interceptors.response.forEach(function(y) {
|
|
2554
|
+
f.push(y.fulfilled, y.rejected);
|
|
2555
|
+
});
|
|
2556
|
+
let u, h = 0, x;
|
|
2557
|
+
if (!m) {
|
|
2558
|
+
const p = [Zt.bind(this), void 0];
|
|
2559
|
+
for (p.unshift(...l), p.push(...f), x = p.length, u = Promise.resolve(n); h < x; )
|
|
2560
|
+
u = u.then(p[h++], p[h++]);
|
|
2561
|
+
return u;
|
|
2562
|
+
}
|
|
2563
|
+
x = l.length;
|
|
2564
|
+
let j = n;
|
|
2565
|
+
for (; h < x; ) {
|
|
2566
|
+
const p = l[h++], y = l[h++];
|
|
2567
|
+
try {
|
|
2568
|
+
j = p(j);
|
|
2569
|
+
} catch (g) {
|
|
2570
|
+
y.call(this, g);
|
|
2571
|
+
break;
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
try {
|
|
2575
|
+
u = Zt.call(this, j);
|
|
2576
|
+
} catch (p) {
|
|
2577
|
+
return Promise.reject(p);
|
|
2578
|
+
}
|
|
2579
|
+
for (h = 0, x = f.length; h < x; )
|
|
2580
|
+
u = u.then(f[h++], f[h++]);
|
|
2581
|
+
return u;
|
|
2582
|
+
}
|
|
2583
|
+
getUri(t) {
|
|
2584
|
+
t = de(this.defaults, t);
|
|
2585
|
+
const n = Sn(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
2586
|
+
return xn(n, t.params, t.paramsSerializer);
|
|
2587
|
+
}
|
|
2588
|
+
};
|
|
2589
|
+
d.forEach(["delete", "get", "head", "options"], function(t) {
|
|
2590
|
+
ue.prototype[t] = function(n, s) {
|
|
2591
|
+
return this.request(de(s || {}, {
|
|
2592
|
+
method: t,
|
|
2593
|
+
url: n,
|
|
2594
|
+
data: (s || {}).data
|
|
2595
|
+
}));
|
|
2596
|
+
};
|
|
2597
|
+
});
|
|
2598
|
+
d.forEach(["post", "put", "patch"], function(t) {
|
|
2599
|
+
function n(s) {
|
|
2600
|
+
return function(i, o, l) {
|
|
2601
|
+
return this.request(de(l || {}, {
|
|
2602
|
+
method: t,
|
|
2603
|
+
headers: s ? {
|
|
2604
|
+
"Content-Type": "multipart/form-data"
|
|
2605
|
+
} : {},
|
|
2606
|
+
url: i,
|
|
2607
|
+
data: o
|
|
2608
|
+
}));
|
|
2609
|
+
};
|
|
2610
|
+
}
|
|
2611
|
+
ue.prototype[t] = n(), ue.prototype[t + "Form"] = n(!0);
|
|
2612
|
+
});
|
|
2613
|
+
let co = class Nn {
|
|
2614
|
+
constructor(t) {
|
|
2615
|
+
if (typeof t != "function")
|
|
2616
|
+
throw new TypeError("executor must be a function.");
|
|
2617
|
+
let n;
|
|
2618
|
+
this.promise = new Promise(function(i) {
|
|
2619
|
+
n = i;
|
|
2620
|
+
});
|
|
2621
|
+
const s = this;
|
|
2622
|
+
this.promise.then((r) => {
|
|
2623
|
+
if (!s._listeners) return;
|
|
2624
|
+
let i = s._listeners.length;
|
|
2625
|
+
for (; i-- > 0; )
|
|
2626
|
+
s._listeners[i](r);
|
|
2627
|
+
s._listeners = null;
|
|
2628
|
+
}), this.promise.then = (r) => {
|
|
2629
|
+
let i;
|
|
2630
|
+
const o = new Promise((l) => {
|
|
2631
|
+
s.subscribe(l), i = l;
|
|
2632
|
+
}).then(r);
|
|
2633
|
+
return o.cancel = function() {
|
|
2634
|
+
s.unsubscribe(i);
|
|
2635
|
+
}, o;
|
|
2636
|
+
}, t(function(i, o, l) {
|
|
2637
|
+
s.reason || (s.reason = new _e(i, o, l), n(s.reason));
|
|
2638
|
+
});
|
|
2639
|
+
}
|
|
2640
|
+
/**
|
|
2641
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
2642
|
+
*/
|
|
2643
|
+
throwIfRequested() {
|
|
2644
|
+
if (this.reason)
|
|
2645
|
+
throw this.reason;
|
|
2646
|
+
}
|
|
2647
|
+
/**
|
|
2648
|
+
* Subscribe to the cancel signal
|
|
2649
|
+
*/
|
|
2650
|
+
subscribe(t) {
|
|
2651
|
+
if (this.reason) {
|
|
2652
|
+
t(this.reason);
|
|
2653
|
+
return;
|
|
2654
|
+
}
|
|
2655
|
+
this._listeners ? this._listeners.push(t) : this._listeners = [t];
|
|
2656
|
+
}
|
|
2657
|
+
/**
|
|
2658
|
+
* Unsubscribe from the cancel signal
|
|
2659
|
+
*/
|
|
2660
|
+
unsubscribe(t) {
|
|
2661
|
+
if (!this._listeners)
|
|
2662
|
+
return;
|
|
2663
|
+
const n = this._listeners.indexOf(t);
|
|
2664
|
+
n !== -1 && this._listeners.splice(n, 1);
|
|
2665
|
+
}
|
|
2666
|
+
toAbortSignal() {
|
|
2667
|
+
const t = new AbortController(), n = (s) => {
|
|
2668
|
+
t.abort(s);
|
|
2669
|
+
};
|
|
2670
|
+
return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
|
|
2671
|
+
}
|
|
2672
|
+
/**
|
|
2673
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
2674
|
+
* cancels the `CancelToken`.
|
|
2675
|
+
*/
|
|
2676
|
+
static source() {
|
|
2677
|
+
let t;
|
|
2678
|
+
return {
|
|
2679
|
+
token: new Nn(function(r) {
|
|
2680
|
+
t = r;
|
|
2681
|
+
}),
|
|
2682
|
+
cancel: t
|
|
2683
|
+
};
|
|
2684
|
+
}
|
|
2685
|
+
};
|
|
2686
|
+
function uo(e) {
|
|
2687
|
+
return function(n) {
|
|
2688
|
+
return e.apply(null, n);
|
|
2689
|
+
};
|
|
2690
|
+
}
|
|
2691
|
+
function fo(e) {
|
|
2692
|
+
return d.isObject(e) && e.isAxiosError === !0;
|
|
2693
|
+
}
|
|
2694
|
+
const mt = {
|
|
2695
|
+
Continue: 100,
|
|
2696
|
+
SwitchingProtocols: 101,
|
|
2697
|
+
Processing: 102,
|
|
2698
|
+
EarlyHints: 103,
|
|
2699
|
+
Ok: 200,
|
|
2700
|
+
Created: 201,
|
|
2701
|
+
Accepted: 202,
|
|
2702
|
+
NonAuthoritativeInformation: 203,
|
|
2703
|
+
NoContent: 204,
|
|
2704
|
+
ResetContent: 205,
|
|
2705
|
+
PartialContent: 206,
|
|
2706
|
+
MultiStatus: 207,
|
|
2707
|
+
AlreadyReported: 208,
|
|
2708
|
+
ImUsed: 226,
|
|
2709
|
+
MultipleChoices: 300,
|
|
2710
|
+
MovedPermanently: 301,
|
|
2711
|
+
Found: 302,
|
|
2712
|
+
SeeOther: 303,
|
|
2713
|
+
NotModified: 304,
|
|
2714
|
+
UseProxy: 305,
|
|
2715
|
+
Unused: 306,
|
|
2716
|
+
TemporaryRedirect: 307,
|
|
2717
|
+
PermanentRedirect: 308,
|
|
2718
|
+
BadRequest: 400,
|
|
2719
|
+
Unauthorized: 401,
|
|
2720
|
+
PaymentRequired: 402,
|
|
2721
|
+
Forbidden: 403,
|
|
2722
|
+
NotFound: 404,
|
|
2723
|
+
MethodNotAllowed: 405,
|
|
2724
|
+
NotAcceptable: 406,
|
|
2725
|
+
ProxyAuthenticationRequired: 407,
|
|
2726
|
+
RequestTimeout: 408,
|
|
2727
|
+
Conflict: 409,
|
|
2728
|
+
Gone: 410,
|
|
2729
|
+
LengthRequired: 411,
|
|
2730
|
+
PreconditionFailed: 412,
|
|
2731
|
+
PayloadTooLarge: 413,
|
|
2732
|
+
UriTooLong: 414,
|
|
2733
|
+
UnsupportedMediaType: 415,
|
|
2734
|
+
RangeNotSatisfiable: 416,
|
|
2735
|
+
ExpectationFailed: 417,
|
|
2736
|
+
ImATeapot: 418,
|
|
2737
|
+
MisdirectedRequest: 421,
|
|
2738
|
+
UnprocessableEntity: 422,
|
|
2739
|
+
Locked: 423,
|
|
2740
|
+
FailedDependency: 424,
|
|
2741
|
+
TooEarly: 425,
|
|
2742
|
+
UpgradeRequired: 426,
|
|
2743
|
+
PreconditionRequired: 428,
|
|
2744
|
+
TooManyRequests: 429,
|
|
2745
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
2746
|
+
UnavailableForLegalReasons: 451,
|
|
2747
|
+
InternalServerError: 500,
|
|
2748
|
+
NotImplemented: 501,
|
|
2749
|
+
BadGateway: 502,
|
|
2750
|
+
ServiceUnavailable: 503,
|
|
2751
|
+
GatewayTimeout: 504,
|
|
2752
|
+
HttpVersionNotSupported: 505,
|
|
2753
|
+
VariantAlsoNegotiates: 506,
|
|
2754
|
+
InsufficientStorage: 507,
|
|
2755
|
+
LoopDetected: 508,
|
|
2756
|
+
NotExtended: 510,
|
|
2757
|
+
NetworkAuthenticationRequired: 511
|
|
2758
|
+
};
|
|
2759
|
+
Object.entries(mt).forEach(([e, t]) => {
|
|
2760
|
+
mt[t] = e;
|
|
2761
|
+
});
|
|
2762
|
+
function On(e) {
|
|
2763
|
+
const t = new ue(e), n = ln(ue.prototype.request, t);
|
|
2764
|
+
return d.extend(n, ue.prototype, t, { allOwnKeys: !0 }), d.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(r) {
|
|
2765
|
+
return On(de(e, r));
|
|
2766
|
+
}, n;
|
|
2767
|
+
}
|
|
2768
|
+
const I = On(ke);
|
|
2769
|
+
I.Axios = ue;
|
|
2770
|
+
I.CanceledError = _e;
|
|
2771
|
+
I.CancelToken = co;
|
|
2772
|
+
I.isCancel = En;
|
|
2773
|
+
I.VERSION = jn;
|
|
2774
|
+
I.toFormData = Ve;
|
|
2775
|
+
I.AxiosError = S;
|
|
2776
|
+
I.Cancel = I.CanceledError;
|
|
2777
|
+
I.all = function(t) {
|
|
2778
|
+
return Promise.all(t);
|
|
2779
|
+
};
|
|
2780
|
+
I.spread = uo;
|
|
2781
|
+
I.isAxiosError = fo;
|
|
2782
|
+
I.mergeConfig = de;
|
|
2783
|
+
I.AxiosHeaders = Y;
|
|
2784
|
+
I.formToJSON = (e) => vn(d.isHTMLForm(e) ? new FormData(e) : e);
|
|
2785
|
+
I.getAdapter = kn.getAdapter;
|
|
2786
|
+
I.HttpStatusCode = mt;
|
|
2787
|
+
I.default = I;
|
|
2788
|
+
const {
|
|
2789
|
+
Axios: Yo,
|
|
2790
|
+
AxiosError: Xo,
|
|
2791
|
+
CanceledError: Zo,
|
|
2792
|
+
isCancel: Qo,
|
|
2793
|
+
CancelToken: ei,
|
|
2794
|
+
VERSION: ti,
|
|
2795
|
+
all: ni,
|
|
2796
|
+
Cancel: si,
|
|
2797
|
+
isAxiosError: ri,
|
|
2798
|
+
spread: oi,
|
|
2799
|
+
toFormData: ii,
|
|
2800
|
+
AxiosHeaders: ai,
|
|
2801
|
+
HttpStatusCode: li,
|
|
2802
|
+
formToJSON: ci,
|
|
2803
|
+
getAdapter: ui,
|
|
2804
|
+
mergeConfig: di
|
|
2805
|
+
} = I, mo = () => /* @__PURE__ */ c.jsx("span", { style: { marginRight: 8, fontSize: "1.2em" }, children: "👤" }), po = () => /* @__PURE__ */ c.jsx("span", { style: { marginRight: 8, fontSize: "1.2em" }, children: "⚙️" }), ho = () => /* @__PURE__ */ c.jsx("span", { style: { marginRight: 8, fontSize: "1.2em" }, children: "❓" }), go = () => /* @__PURE__ */ c.jsx("span", { style: { marginRight: 8, fontSize: "1.2em" }, children: "🚪" }), bo = [
|
|
2806
|
+
{ id: "profile", label: "个人主页", icon: /* @__PURE__ */ c.jsx(mo, {}) },
|
|
2807
|
+
{ id: "settings", label: "设置", icon: /* @__PURE__ */ c.jsx(po, {}) },
|
|
2808
|
+
{ id: "help", label: "帮助", icon: /* @__PURE__ */ c.jsx(ho, {}) },
|
|
2809
|
+
{ id: "logout", label: "退出", icon: /* @__PURE__ */ c.jsx(go, {}) }
|
|
2810
|
+
], _o = ({
|
|
2811
|
+
userId: e,
|
|
2812
|
+
userName: t,
|
|
2813
|
+
userAvatar: n,
|
|
2814
|
+
apiConfig: s,
|
|
2815
|
+
menuItems: r = bo,
|
|
2816
|
+
avatarSize: i = "md",
|
|
2817
|
+
isLoading: o = !1,
|
|
2818
|
+
error: l = null,
|
|
2819
|
+
avatarClassName: m,
|
|
2820
|
+
userNameClassName: f,
|
|
2821
|
+
containerClassName: u,
|
|
2822
|
+
onMenuOpen: h,
|
|
2823
|
+
onMenuClose: x,
|
|
2824
|
+
onMenuItemClick: j,
|
|
2825
|
+
onLogout: p,
|
|
2826
|
+
renderMenuItem: y,
|
|
2827
|
+
renderUserInfo: g
|
|
2828
|
+
}) => {
|
|
2829
|
+
const [v, A] = V.useState({
|
|
2830
|
+
id: e || "",
|
|
2831
|
+
name: t || "",
|
|
2832
|
+
avatar: n || "",
|
|
2833
|
+
level: 0,
|
|
2834
|
+
badges: []
|
|
2835
|
+
}), [C, T] = V.useState(o), [R, U] = V.useState(l);
|
|
2836
|
+
V.useEffect(() => {
|
|
2837
|
+
e && s && !t && !n && w();
|
|
2838
|
+
}, [e, s, t, n]);
|
|
2839
|
+
const w = async () => {
|
|
2840
|
+
T(!0), U(null);
|
|
2841
|
+
try {
|
|
2842
|
+
const L = s.endpoints.userProfile.replace(":userId", e), q = await I.get(`${s.baseURL}${L}`, {
|
|
2843
|
+
headers: s.headers
|
|
2844
|
+
});
|
|
2845
|
+
A(q.data);
|
|
2846
|
+
} catch (L) {
|
|
2847
|
+
U(L);
|
|
2848
|
+
} finally {
|
|
2849
|
+
T(!1);
|
|
2850
|
+
}
|
|
2851
|
+
}, D = (L) => {
|
|
2852
|
+
j?.(L.id), L.id === "logout" && p?.();
|
|
2853
|
+
}, $ = () => {
|
|
2854
|
+
h?.();
|
|
2855
|
+
}, Q = () => {
|
|
2856
|
+
x?.();
|
|
2857
|
+
}, B = () => /* @__PURE__ */ c.jsxs("div", { className: "user-profile-trigger", children: [
|
|
2858
|
+
/* @__PURE__ */ c.jsx(
|
|
2859
|
+
ms,
|
|
2860
|
+
{
|
|
2861
|
+
src: v.avatar,
|
|
2862
|
+
size: i,
|
|
2863
|
+
className: m,
|
|
2864
|
+
alt: "用户头像"
|
|
2865
|
+
}
|
|
2866
|
+
),
|
|
2867
|
+
/* @__PURE__ */ c.jsx("span", { className: `user-name ${f || ""}`, children: v.name })
|
|
2868
|
+
] });
|
|
2869
|
+
return C ? /* @__PURE__ */ c.jsx("div", { className: `user-profile-container ${u || ""} is-loading`, children: /* @__PURE__ */ c.jsx("div", { className: "user-profile-loading", children: "加载中..." }) }) : R ? /* @__PURE__ */ c.jsx("div", { className: `user-profile-container ${u || ""} has-error`, children: /* @__PURE__ */ c.jsxs("div", { className: "user-profile-error", children: [
|
|
2870
|
+
"错误: ",
|
|
2871
|
+
R.message
|
|
2872
|
+
] }) }) : v.name ? /* @__PURE__ */ c.jsx("div", { className: `user-profile-container ${u || ""}`, children: /* @__PURE__ */ c.jsx(
|
|
2873
|
+
an,
|
|
2874
|
+
{
|
|
2875
|
+
trigger: g ? g(v) : B(),
|
|
2876
|
+
items: r.map((L) => ({
|
|
2877
|
+
...L,
|
|
2878
|
+
onClick: () => D(L)
|
|
2879
|
+
})),
|
|
2880
|
+
position: "bottom",
|
|
2881
|
+
alignment: "end",
|
|
2882
|
+
onOpen: $,
|
|
2883
|
+
onClose: Q,
|
|
2884
|
+
renderItem: y ? (L) => y(L, v) : void 0
|
|
2885
|
+
}
|
|
2886
|
+
) }) : /* @__PURE__ */ c.jsx("div", { className: `user-profile-container ${u || ""}`, children: /* @__PURE__ */ c.jsx("div", { className: "user-profile-loading", children: "未登录" }) });
|
|
2887
|
+
}, yo = (e) => /* @__PURE__ */ c.jsxs(
|
|
2888
|
+
"div",
|
|
2889
|
+
{
|
|
2890
|
+
className: "explore-menu-item",
|
|
2891
|
+
onClick: () => e.onClick?.(e),
|
|
2892
|
+
children: [
|
|
2893
|
+
/* @__PURE__ */ c.jsx("span", { className: "explore-item-label", children: e.label }),
|
|
2894
|
+
e.status && /* @__PURE__ */ c.jsx("span", { className: `explore-item-status status-${e.status.toLowerCase().replace("%", "").replace(" ", "-")}`, children: e.status })
|
|
2895
|
+
]
|
|
2896
|
+
},
|
|
2897
|
+
e.id
|
|
2898
|
+
), xo = () => /* @__PURE__ */ c.jsxs("button", { className: "explore-button", "aria-label": "探索数学课程", children: [
|
|
2899
|
+
/* @__PURE__ */ c.jsx("span", { className: "explore-icon", children: "🌍" }),
|
|
2900
|
+
/* @__PURE__ */ c.jsx("span", { className: "explore-text", children: "探索" })
|
|
2901
|
+
] }), wo = ({
|
|
2902
|
+
// 通用Props
|
|
2903
|
+
className: e = "",
|
|
2904
|
+
style: t,
|
|
2905
|
+
logoHref: n = "/",
|
|
2906
|
+
logoText: s = "MathWiz",
|
|
2907
|
+
onLogoClick: r,
|
|
2908
|
+
// 探索菜单Props
|
|
2909
|
+
exploreItems: i = [],
|
|
2910
|
+
exploreMenuOpen: o = !1,
|
|
2911
|
+
onExploreMenuToggle: l,
|
|
2912
|
+
onExploreItemClick: m,
|
|
2913
|
+
renderExploreItem: f = yo,
|
|
2914
|
+
// 用户资料Props
|
|
2915
|
+
userData: u,
|
|
2916
|
+
userMenuItems: h,
|
|
2917
|
+
onUserMenuItemClick: x,
|
|
2918
|
+
onLogout: j,
|
|
2919
|
+
// 状态控制Props
|
|
2920
|
+
isLoading: p = !1,
|
|
2921
|
+
error: y = null,
|
|
2922
|
+
// 样式定制Props
|
|
2923
|
+
headerClassName: g = "",
|
|
2924
|
+
logoClassName: v = "",
|
|
2925
|
+
exploreClassName: A = "",
|
|
2926
|
+
userProfileClassName: C = "",
|
|
2927
|
+
// 无障碍访问Props
|
|
2928
|
+
"aria-label": T,
|
|
2929
|
+
"aria-labelledby": R,
|
|
2930
|
+
...U
|
|
2931
|
+
}) => {
|
|
2932
|
+
const w = i.map((D) => ({
|
|
2933
|
+
id: D.id,
|
|
2934
|
+
label: f(D),
|
|
2935
|
+
onClick: () => m?.(D)
|
|
2936
|
+
}));
|
|
2937
|
+
return /* @__PURE__ */ c.jsx(
|
|
2938
|
+
"header",
|
|
2939
|
+
{
|
|
2940
|
+
className: `mathwiz-header site-header ${g} ${e}`,
|
|
2941
|
+
style: t,
|
|
2942
|
+
"aria-label": T,
|
|
2943
|
+
"aria-labelledby": R,
|
|
2944
|
+
role: "banner",
|
|
2945
|
+
...U,
|
|
2946
|
+
children: /* @__PURE__ */ c.jsxs("div", { className: "header-content", children: [
|
|
2947
|
+
/* @__PURE__ */ c.jsx("div", { className: "header-section left", children: /* @__PURE__ */ c.jsx(
|
|
2948
|
+
an,
|
|
2949
|
+
{
|
|
2950
|
+
trigger: /* @__PURE__ */ c.jsx(xo, {}),
|
|
2951
|
+
items: w,
|
|
2952
|
+
position: "bottom",
|
|
2953
|
+
alignment: "start",
|
|
2954
|
+
openDelay: 300,
|
|
2955
|
+
closeDelay: 100,
|
|
2956
|
+
onOpen: () => l?.(!0),
|
|
2957
|
+
onClose: () => l?.(!1),
|
|
2958
|
+
className: `explore-submenu ${A}`,
|
|
2959
|
+
menuClassName: "explore-panel"
|
|
2960
|
+
}
|
|
2961
|
+
) }),
|
|
2962
|
+
/* @__PURE__ */ c.jsx("div", { className: "header-section center", children: /* @__PURE__ */ c.jsx(
|
|
2963
|
+
"a",
|
|
2964
|
+
{
|
|
2965
|
+
href: n,
|
|
2966
|
+
className: `logo ${v}`,
|
|
2967
|
+
onClick: r,
|
|
2968
|
+
"aria-label": "MathWiz 首页",
|
|
2969
|
+
children: s
|
|
2970
|
+
}
|
|
2971
|
+
) }),
|
|
2972
|
+
/* @__PURE__ */ c.jsx("div", { className: "header-section right", children: /* @__PURE__ */ c.jsx(
|
|
2973
|
+
_o,
|
|
2974
|
+
{
|
|
2975
|
+
userName: u?.name,
|
|
2976
|
+
userAvatar: u?.avatar,
|
|
2977
|
+
menuItems: h,
|
|
2978
|
+
onMenuItemClick: x,
|
|
2979
|
+
onLogout: j,
|
|
2980
|
+
containerClassName: C,
|
|
2981
|
+
isLoading: p,
|
|
2982
|
+
error: y
|
|
2983
|
+
}
|
|
2984
|
+
) })
|
|
2985
|
+
] })
|
|
2986
|
+
}
|
|
2987
|
+
);
|
|
2988
|
+
}, vo = V.memo(wo, (e, t) => e.logoText === t.logoText && e.logoHref === t.logoHref && e.className === t.className && e.headerClassName === t.headerClassName && e.logoClassName === t.logoClassName && e.exploreClassName === t.exploreClassName && e.userProfileClassName === t.userProfileClassName && e["aria-label"] === t["aria-label"] && e["aria-labelledby"] === t["aria-labelledby"] && e.isLoading === t.isLoading && e.error === t.error && // 深度比较数组
|
|
2989
|
+
JSON.stringify(e.exploreItems) === JSON.stringify(t.exploreItems) && // 深度比较对象
|
|
2990
|
+
JSON.stringify(e.userData) === JSON.stringify(t.userData) && JSON.stringify(e.userMenuItems) === JSON.stringify(t.userMenuItems)), Eo = ({
|
|
2991
|
+
abilities: e,
|
|
2992
|
+
width: t = 400,
|
|
2993
|
+
height: n = 400
|
|
2994
|
+
}) => {
|
|
2995
|
+
const s = () => e.length === 0 ? "" : e.map((o) => {
|
|
2996
|
+
if (o.svgPoint)
|
|
2997
|
+
return `${o.svgPoint.x},${o.svgPoint.y}`;
|
|
2998
|
+
const l = Math.PI * 2 * e.indexOf(o) / e.length, m = o.score / o.maxScore * 40 + 10, f = 50 + m * Math.sin(l), u = 50 - m * Math.cos(l);
|
|
2999
|
+
return `${f},${u}`;
|
|
3000
|
+
}).join(" "), r = (o) => {
|
|
3001
|
+
const l = Math.PI * 2 * o / Math.max(e.length, 1), m = 50 + 40 * Math.sin(l), f = 50 - 40 * Math.cos(l);
|
|
3002
|
+
return { x2: m, y2: f };
|
|
3003
|
+
}, i = (o) => {
|
|
3004
|
+
const l = Math.PI * 2 * o / Math.max(e.length, 1), m = 50 + 45 * Math.sin(l), f = 50 - 45 * Math.cos(l);
|
|
3005
|
+
let u = "middle";
|
|
3006
|
+
return l > Math.PI * 0.25 && l < Math.PI * 0.75 && (u = "start"), l > Math.PI * 1.25 && l < Math.PI * 1.75 && (u = "end"), { x: m, y: f, textAnchor: u };
|
|
3007
|
+
};
|
|
3008
|
+
return /* @__PURE__ */ c.jsxs(
|
|
3009
|
+
"svg",
|
|
3010
|
+
{
|
|
3011
|
+
"data-testid": "radar-chart",
|
|
3012
|
+
width: t,
|
|
3013
|
+
height: n,
|
|
3014
|
+
viewBox: "0 0 100 100",
|
|
3015
|
+
className: "w-full h-full",
|
|
3016
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
3017
|
+
children: [
|
|
3018
|
+
/* @__PURE__ */ c.jsx(
|
|
3019
|
+
"circle",
|
|
3020
|
+
{
|
|
3021
|
+
"data-testid": "center-point",
|
|
3022
|
+
cx: "50",
|
|
3023
|
+
cy: "50",
|
|
3024
|
+
r: "1",
|
|
3025
|
+
fill: "#4A90E2"
|
|
3026
|
+
}
|
|
3027
|
+
),
|
|
3028
|
+
e.map((o, l) => {
|
|
3029
|
+
const { x2: m, y2: f } = r(l);
|
|
3030
|
+
return /* @__PURE__ */ c.jsx(
|
|
3031
|
+
"line",
|
|
3032
|
+
{
|
|
3033
|
+
"data-testid": "axis-line",
|
|
3034
|
+
x1: "50",
|
|
3035
|
+
y1: "50",
|
|
3036
|
+
x2: m,
|
|
3037
|
+
y2: f,
|
|
3038
|
+
stroke: "#E2E8F0",
|
|
3039
|
+
strokeWidth: "0.5"
|
|
3040
|
+
},
|
|
3041
|
+
`axis-${l}`
|
|
3042
|
+
);
|
|
3043
|
+
}),
|
|
3044
|
+
e.length > 2 && /* @__PURE__ */ c.jsx(
|
|
3045
|
+
"polygon",
|
|
3046
|
+
{
|
|
3047
|
+
"data-testid": "radar-polygon",
|
|
3048
|
+
points: s(),
|
|
3049
|
+
fill: "rgba(74, 144, 226, 0.2)",
|
|
3050
|
+
stroke: "rgb(74, 144, 226)",
|
|
3051
|
+
strokeWidth: "1",
|
|
3052
|
+
fillRule: "evenodd"
|
|
3053
|
+
}
|
|
3054
|
+
),
|
|
3055
|
+
e.map((o, l) => {
|
|
3056
|
+
let m, f;
|
|
3057
|
+
if (o.svgPoint)
|
|
3058
|
+
m = o.svgPoint.x, f = o.svgPoint.y;
|
|
3059
|
+
else {
|
|
3060
|
+
const u = Math.PI * 2 * l / e.length, h = o.score / o.maxScore * 40 + 10;
|
|
3061
|
+
m = 50 + h * Math.sin(u), f = 50 - h * Math.cos(u);
|
|
3062
|
+
}
|
|
3063
|
+
return /* @__PURE__ */ c.jsx(
|
|
3064
|
+
"circle",
|
|
3065
|
+
{
|
|
3066
|
+
"data-testid": "data-point",
|
|
3067
|
+
cx: m,
|
|
3068
|
+
cy: f,
|
|
3069
|
+
r: "2",
|
|
3070
|
+
fill: o.progressBarColor === "bg-orange-400" ? "#FBBF24" : "#4A90E2"
|
|
3071
|
+
},
|
|
3072
|
+
`point-${o.name}`
|
|
3073
|
+
);
|
|
3074
|
+
}),
|
|
3075
|
+
e.map((o, l) => {
|
|
3076
|
+
const { x: m, y: f, textAnchor: u } = i(l);
|
|
3077
|
+
return /* @__PURE__ */ c.jsx(
|
|
3078
|
+
"text",
|
|
3079
|
+
{
|
|
3080
|
+
x: m,
|
|
3081
|
+
y: f,
|
|
3082
|
+
textAnchor: u,
|
|
3083
|
+
fontSize: "5",
|
|
3084
|
+
fill: "#334155",
|
|
3085
|
+
className: "text-xs",
|
|
3086
|
+
children: o.name
|
|
3087
|
+
},
|
|
3088
|
+
`label-${o.name}`
|
|
3089
|
+
);
|
|
3090
|
+
})
|
|
3091
|
+
]
|
|
3092
|
+
}
|
|
3093
|
+
);
|
|
3094
|
+
}, en = (e) => {
|
|
3095
|
+
let t;
|
|
3096
|
+
const n = /* @__PURE__ */ new Set(), s = (f, u) => {
|
|
3097
|
+
const h = typeof f == "function" ? f(t) : f;
|
|
3098
|
+
if (!Object.is(h, t)) {
|
|
3099
|
+
const x = t;
|
|
3100
|
+
t = u ?? (typeof h != "object" || h === null) ? h : Object.assign({}, t, h), n.forEach((j) => j(t, x));
|
|
3101
|
+
}
|
|
3102
|
+
}, r = () => t, l = { setState: s, getState: r, getInitialState: () => m, subscribe: (f) => (n.add(f), () => n.delete(f)) }, m = t = e(s, r, l);
|
|
3103
|
+
return l;
|
|
3104
|
+
}, Ro = ((e) => e ? en(e) : en), So = (e) => e;
|
|
3105
|
+
function Ao(e, t = So) {
|
|
3106
|
+
const n = V.useSyncExternalStore(
|
|
3107
|
+
e.subscribe,
|
|
3108
|
+
V.useCallback(() => t(e.getState()), [e, t]),
|
|
3109
|
+
V.useCallback(() => t(e.getInitialState()), [e, t])
|
|
3110
|
+
);
|
|
3111
|
+
return V.useDebugValue(n), n;
|
|
3112
|
+
}
|
|
3113
|
+
const tn = (e) => {
|
|
3114
|
+
const t = Ro(e), n = (s) => Ao(t, s);
|
|
3115
|
+
return Object.assign(n, t), n;
|
|
3116
|
+
}, Co = ((e) => e ? tn(e) : tn), nn = {
|
|
3117
|
+
overallRating: "优秀",
|
|
3118
|
+
generalRecommendation: "你的空间想象力和逻辑推理能力非常出色!若能进一步提升在复杂图形下的专注力,你将所向披靡。建议尝试我们‘专注力挑战’系列游戏。",
|
|
3119
|
+
abilities: [
|
|
3120
|
+
{
|
|
3121
|
+
name: "空间想象力",
|
|
3122
|
+
score: 7.5,
|
|
3123
|
+
maxScore: 10,
|
|
3124
|
+
progressBarColor: "bg-blue-500",
|
|
3125
|
+
svgPoint: { x: 50, y: 17.5 },
|
|
3126
|
+
recommendation: "通过观察三维物体在不同角度的投影,或尝试构建复杂结构的游戏,能有效提升空间想象力。",
|
|
3127
|
+
recommendationLink: "#spatial-challenges"
|
|
3128
|
+
},
|
|
3129
|
+
{
|
|
3130
|
+
name: "逻辑推理",
|
|
3131
|
+
score: 8,
|
|
3132
|
+
maxScore: 10,
|
|
3133
|
+
progressBarColor: "bg-blue-500",
|
|
3134
|
+
svgPoint: { x: 82, y: 35 },
|
|
3135
|
+
recommendation: "解决数独、迷宫或逻辑谜题,能够持续锻炼你的逻辑思维,尝试挑战更高难度的推理游戏。",
|
|
3136
|
+
recommendationLink: "#logic-puzzles"
|
|
3137
|
+
},
|
|
3138
|
+
{
|
|
3139
|
+
name: "图形辨识",
|
|
3140
|
+
score: 9,
|
|
3141
|
+
maxScore: 10,
|
|
3142
|
+
progressBarColor: "bg-blue-500",
|
|
3143
|
+
svgPoint: { x: 85, y: 65 },
|
|
3144
|
+
recommendation: "你在这方面表现出色!可以尝试在更复杂、干扰因素更多的图形中进行辨识训练,保持敏锐。",
|
|
3145
|
+
recommendationLink: "#graphic-training"
|
|
3146
|
+
},
|
|
3147
|
+
{
|
|
3148
|
+
name: "专注力",
|
|
3149
|
+
score: 7,
|
|
3150
|
+
maxScore: 10,
|
|
3151
|
+
progressBarColor: "bg-orange-400",
|
|
3152
|
+
svgPoint: { x: 50, y: 80 },
|
|
3153
|
+
recommendation: "在长时间的游戏中保持专注对你来说是一个挑战,建议尝试我们‘专注力挑战’系列游戏,逐渐延长专注时间。",
|
|
3154
|
+
recommendationLink: "#focus-challenges"
|
|
3155
|
+
},
|
|
3156
|
+
{
|
|
3157
|
+
name: "观察力",
|
|
3158
|
+
score: 8.5,
|
|
3159
|
+
maxScore: 10,
|
|
3160
|
+
progressBarColor: "bg-blue-500",
|
|
3161
|
+
svgPoint: { x: 15, y: 65 },
|
|
3162
|
+
recommendation: "你的观察力非常敏锐,在细节发现上尤为突出。尝试在限时模式下进行观察力训练,提高反应速度。",
|
|
3163
|
+
recommendationLink: "#observation-drills"
|
|
3164
|
+
},
|
|
3165
|
+
{
|
|
3166
|
+
name: "抗压性",
|
|
3167
|
+
score: 7.8,
|
|
3168
|
+
maxScore: 10,
|
|
3169
|
+
progressBarColor: "bg-blue-500",
|
|
3170
|
+
svgPoint: { x: 18, y: 35 },
|
|
3171
|
+
recommendation: "面对高压挑战时,保持冷静是关键。通过模拟竞赛或限时任务来提升抗压能力,逐步适应压力。",
|
|
3172
|
+
recommendationLink: "#stress-games"
|
|
3173
|
+
}
|
|
3174
|
+
]
|
|
3175
|
+
};
|
|
3176
|
+
class ko {
|
|
3177
|
+
static API_BASE_URL = "/api/radar-ability";
|
|
3178
|
+
static async fetchRadarAbilityData() {
|
|
3179
|
+
try {
|
|
3180
|
+
return process.env.NODE_ENV === "test" ? (await new Promise((t) => setTimeout(t, 100)), nn) : (await I.get(`${this.API_BASE_URL}/assessment`)).data;
|
|
3181
|
+
} catch (t) {
|
|
3182
|
+
if (console.error("Failed to fetch radar ability data:", t), process.env.NODE_ENV === "test")
|
|
3183
|
+
throw new Error("获取能力评估数据失败");
|
|
3184
|
+
return nn;
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3187
|
+
static async submitFeedback(t) {
|
|
3188
|
+
try {
|
|
3189
|
+
await I.post(`${this.API_BASE_URL}/feedback`, t);
|
|
3190
|
+
} catch (n) {
|
|
3191
|
+
throw console.error("Failed to submit feedback:", n), new Error("提交反馈失败");
|
|
3192
|
+
}
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
const jo = Co((e, t) => ({
|
|
3196
|
+
data: null,
|
|
3197
|
+
loading: !1,
|
|
3198
|
+
error: null,
|
|
3199
|
+
fetchData: async () => {
|
|
3200
|
+
if (!t().loading) {
|
|
3201
|
+
e({ loading: !0, error: null });
|
|
3202
|
+
try {
|
|
3203
|
+
const n = await ko.fetchRadarAbilityData();
|
|
3204
|
+
e({ data: n, loading: !1 });
|
|
3205
|
+
} catch (n) {
|
|
3206
|
+
const s = n instanceof Error ? n.message : "获取数据失败";
|
|
3207
|
+
e({ error: s, loading: !1 });
|
|
3208
|
+
}
|
|
3209
|
+
}
|
|
3210
|
+
},
|
|
3211
|
+
setData: (n) => {
|
|
3212
|
+
e({ data: n, error: null, loading: !1 });
|
|
3213
|
+
},
|
|
3214
|
+
setError: (n) => {
|
|
3215
|
+
e({ error: n, loading: !1 });
|
|
3216
|
+
},
|
|
3217
|
+
reset: () => {
|
|
3218
|
+
e({ data: null, loading: !1, error: null });
|
|
3219
|
+
}
|
|
3220
|
+
})), No = ({ ability: e }) => {
|
|
3221
|
+
const t = e.score / e.maxScore * 100;
|
|
3222
|
+
return /* @__PURE__ */ c.jsxs(
|
|
3223
|
+
"div",
|
|
3224
|
+
{
|
|
3225
|
+
className: "ability-progress-bar-item",
|
|
3226
|
+
"data-ability": e.name,
|
|
3227
|
+
"data-testid": "progress-bar-container",
|
|
3228
|
+
children: [
|
|
3229
|
+
/* @__PURE__ */ c.jsxs("div", { className: "flex justify-between text-sm mb-1", children: [
|
|
3230
|
+
/* @__PURE__ */ c.jsx("span", { className: "text-gray-700 font-medium", children: e.name }),
|
|
3231
|
+
/* @__PURE__ */ c.jsxs("span", { className: "text-gray-600", children: [
|
|
3232
|
+
e.score,
|
|
3233
|
+
"/",
|
|
3234
|
+
e.maxScore
|
|
3235
|
+
] })
|
|
3236
|
+
] }),
|
|
3237
|
+
/* @__PURE__ */ c.jsx(
|
|
3238
|
+
"div",
|
|
3239
|
+
{
|
|
3240
|
+
className: "w-full bg-gray-200 rounded-full h-2.5",
|
|
3241
|
+
"data-testid": "progress-bar-outer",
|
|
3242
|
+
children: /* @__PURE__ */ c.jsx(
|
|
3243
|
+
"div",
|
|
3244
|
+
{
|
|
3245
|
+
className: `${e.progressBarColor} h-2.5 rounded-full transition-all duration-300`,
|
|
3246
|
+
style: { width: `${t}%` },
|
|
3247
|
+
"data-testid": "progress-bar-inner",
|
|
3248
|
+
role: "progressbar",
|
|
3249
|
+
"aria-valuenow": e.score,
|
|
3250
|
+
"aria-valuemin": 0,
|
|
3251
|
+
"aria-valuemax": e.maxScore,
|
|
3252
|
+
"aria-label": `${e.name} progress: ${e.score} out of ${e.maxScore}`
|
|
3253
|
+
}
|
|
3254
|
+
)
|
|
3255
|
+
}
|
|
3256
|
+
)
|
|
3257
|
+
]
|
|
3258
|
+
}
|
|
3259
|
+
);
|
|
3260
|
+
}, Oo = ({
|
|
3261
|
+
generalRecommendation: e
|
|
3262
|
+
}) => /* @__PURE__ */ c.jsx(
|
|
3263
|
+
"div",
|
|
3264
|
+
{
|
|
3265
|
+
className: "bg-blue-50 border border-blue-200 rounded-lg p-4",
|
|
3266
|
+
"data-testid": "advice-panel",
|
|
3267
|
+
role: "region",
|
|
3268
|
+
"aria-label": "个性化建议",
|
|
3269
|
+
children: /* @__PURE__ */ c.jsxs("div", { className: "flex items-start", children: [
|
|
3270
|
+
/* @__PURE__ */ c.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ c.jsx(
|
|
3271
|
+
"i",
|
|
3272
|
+
{
|
|
3273
|
+
className: "material-icons text-blue-500",
|
|
3274
|
+
"data-testid": "lightbulb-icon",
|
|
3275
|
+
"aria-hidden": "true",
|
|
3276
|
+
children: "lightbulb"
|
|
3277
|
+
}
|
|
3278
|
+
) }),
|
|
3279
|
+
/* @__PURE__ */ c.jsxs("div", { className: "ml-3", children: [
|
|
3280
|
+
/* @__PURE__ */ c.jsx(
|
|
3281
|
+
"h3",
|
|
3282
|
+
{
|
|
3283
|
+
className: "text-md font-semibold text-blue-800",
|
|
3284
|
+
"aria-level": 3,
|
|
3285
|
+
children: "个性化建议"
|
|
3286
|
+
}
|
|
3287
|
+
),
|
|
3288
|
+
/* @__PURE__ */ c.jsx(
|
|
3289
|
+
"p",
|
|
3290
|
+
{
|
|
3291
|
+
className: "text-sm text-blue-700 mt-1",
|
|
3292
|
+
"data-testid": "recommendation-text",
|
|
3293
|
+
children: e
|
|
3294
|
+
}
|
|
3295
|
+
)
|
|
3296
|
+
] })
|
|
3297
|
+
] })
|
|
3298
|
+
}
|
|
3299
|
+
), To = ({ ability: e, customLinkTexts: t = {} }) => {
|
|
3300
|
+
const n = (s) => {
|
|
3301
|
+
const r = {
|
|
3302
|
+
空间想象力: "探索空间挑战",
|
|
3303
|
+
逻辑推理: "深入逻辑谜题",
|
|
3304
|
+
图形辨识: "精进图形训练",
|
|
3305
|
+
专注力: "挑战专注极限",
|
|
3306
|
+
观察力: "提升观察速度",
|
|
3307
|
+
抗压性: "磨砺抗压意志"
|
|
3308
|
+
};
|
|
3309
|
+
return t[s] || r[s] || "开始挑战";
|
|
3310
|
+
};
|
|
3311
|
+
return /* @__PURE__ */ c.jsx(
|
|
3312
|
+
ps,
|
|
3313
|
+
{
|
|
3314
|
+
className: "recommendation-card w-full max-w-sm hover:shadow-lg transition-all duration-300",
|
|
3315
|
+
"data-ability": e.name,
|
|
3316
|
+
"data-testid": "recommendation-card",
|
|
3317
|
+
isHoverable: !0,
|
|
3318
|
+
isPressable: !0,
|
|
3319
|
+
children: /* @__PURE__ */ c.jsx(hs, { className: "p-5", children: /* @__PURE__ */ c.jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
3320
|
+
/* @__PURE__ */ c.jsxs(
|
|
3321
|
+
"h4",
|
|
3322
|
+
{
|
|
3323
|
+
className: "text-lg font-semibold text-foreground",
|
|
3324
|
+
"aria-level": 4,
|
|
3325
|
+
children: [
|
|
3326
|
+
e.name,
|
|
3327
|
+
": 专项提高"
|
|
3328
|
+
]
|
|
3329
|
+
}
|
|
3330
|
+
),
|
|
3331
|
+
/* @__PURE__ */ c.jsx(
|
|
3332
|
+
"p",
|
|
3333
|
+
{
|
|
3334
|
+
className: "text-sm text-default-600 leading-relaxed",
|
|
3335
|
+
"data-testid": "recommendation-description",
|
|
3336
|
+
children: e.recommendation
|
|
3337
|
+
}
|
|
3338
|
+
),
|
|
3339
|
+
/* @__PURE__ */ c.jsx(
|
|
3340
|
+
gs,
|
|
3341
|
+
{
|
|
3342
|
+
as: "a",
|
|
3343
|
+
href: e.recommendationLink,
|
|
3344
|
+
className: "mt-2 w-fit",
|
|
3345
|
+
size: "sm",
|
|
3346
|
+
variant: "flat",
|
|
3347
|
+
color: "primary",
|
|
3348
|
+
endContent: /* @__PURE__ */ c.jsx(Cs, { className: "w-4 h-4" }),
|
|
3349
|
+
"data-testid": "recommendation-link",
|
|
3350
|
+
"aria-label": `前往${e.name}专项提高页面`,
|
|
3351
|
+
children: n(e.name)
|
|
3352
|
+
}
|
|
3353
|
+
)
|
|
3354
|
+
] }) })
|
|
3355
|
+
}
|
|
3356
|
+
);
|
|
3357
|
+
}, Uo = "_dashboardLayout_10wqn_5", Po = "_upperSection_10wqn_19", Lo = "_lowerSection_10wqn_33", Io = "_radarChartArea_10wqn_51", Me = {
|
|
3358
|
+
dashboardLayout: Uo,
|
|
3359
|
+
upperSection: Po,
|
|
3360
|
+
lowerSection: Lo,
|
|
3361
|
+
radarChartArea: Io
|
|
3362
|
+
}, fi = () => {
|
|
3363
|
+
const { data: e, loading: t, error: n, fetchData: s } = jo();
|
|
3364
|
+
return qe(() => {
|
|
3365
|
+
s();
|
|
3366
|
+
}, [s]), t ? /* @__PURE__ */ c.jsxs(
|
|
3367
|
+
"div",
|
|
3368
|
+
{
|
|
3369
|
+
className: "card max-w-4xl mx-auto p-6 md:p-8 flex items-center justify-center",
|
|
3370
|
+
"data-testid": "loading-spinner",
|
|
3371
|
+
children: [
|
|
3372
|
+
/* @__PURE__ */ c.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500" }),
|
|
3373
|
+
/* @__PURE__ */ c.jsx("span", { className: "ml-3 text-gray-600", children: "加载中..." })
|
|
3374
|
+
]
|
|
3375
|
+
}
|
|
3376
|
+
) : n ? /* @__PURE__ */ c.jsxs(
|
|
3377
|
+
"div",
|
|
3378
|
+
{
|
|
3379
|
+
className: "card max-w-4xl mx-auto p-6 md:p-8 text-center",
|
|
3380
|
+
role: "alert",
|
|
3381
|
+
"aria-live": "assertive",
|
|
3382
|
+
children: [
|
|
3383
|
+
/* @__PURE__ */ c.jsx("div", { className: "text-red-500 mb-4", children: /* @__PURE__ */ c.jsx(
|
|
3384
|
+
"i",
|
|
3385
|
+
{
|
|
3386
|
+
className: "material-icons text-4xl",
|
|
3387
|
+
"aria-hidden": "true",
|
|
3388
|
+
children: "error_outline"
|
|
3389
|
+
}
|
|
3390
|
+
) }),
|
|
3391
|
+
/* @__PURE__ */ c.jsx("h3", { className: "text-lg font-semibold text-gray-800 mb-2", children: "加载失败" }),
|
|
3392
|
+
/* @__PURE__ */ c.jsx("p", { className: "text-gray-600 mb-4", children: n }),
|
|
3393
|
+
/* @__PURE__ */ c.jsx(
|
|
3394
|
+
"button",
|
|
3395
|
+
{
|
|
3396
|
+
onClick: s,
|
|
3397
|
+
className: "bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",
|
|
3398
|
+
"aria-label": "重试加载数据",
|
|
3399
|
+
children: "重试"
|
|
3400
|
+
}
|
|
3401
|
+
)
|
|
3402
|
+
]
|
|
3403
|
+
}
|
|
3404
|
+
) : e ? /* @__PURE__ */ c.jsxs(
|
|
3405
|
+
"div",
|
|
3406
|
+
{
|
|
3407
|
+
className: "card max-w-4xl mx-auto p-6 md:p-8 animate-fade-in",
|
|
3408
|
+
"data-component": "AbilityAssessmentDashboard",
|
|
3409
|
+
role: "main",
|
|
3410
|
+
"aria-label": "能力评估雷达图展示",
|
|
3411
|
+
children: [
|
|
3412
|
+
/* @__PURE__ */ c.jsxs("div", { className: "flex justify-between items-center mb-6", children: [
|
|
3413
|
+
/* @__PURE__ */ c.jsx("h2", { className: "text-xl font-bold text-gray-800", children: "能力评估雷达图" }),
|
|
3414
|
+
/* @__PURE__ */ c.jsxs(
|
|
3415
|
+
"span",
|
|
3416
|
+
{
|
|
3417
|
+
className: "bg-blue-100 text-blue-800 text-sm font-semibold px-2.5 py-0.5 rounded-full",
|
|
3418
|
+
"aria-label": `综合评级: ${e.overallRating}`,
|
|
3419
|
+
children: [
|
|
3420
|
+
"综合评级: ",
|
|
3421
|
+
e.overallRating
|
|
3422
|
+
]
|
|
3423
|
+
}
|
|
3424
|
+
)
|
|
3425
|
+
] }),
|
|
3426
|
+
/* @__PURE__ */ c.jsxs("div", { className: Me.dashboardLayout, children: [
|
|
3427
|
+
/* @__PURE__ */ c.jsxs("div", { className: Me.upperSection, children: [
|
|
3428
|
+
/* @__PURE__ */ c.jsx("div", { className: Me.radarChartArea, children: /* @__PURE__ */ c.jsx(Eo, { abilities: e.abilities }) }),
|
|
3429
|
+
/* @__PURE__ */ c.jsx("div", { className: "space-y-4 flex flex-col justify-around py-2", children: e.abilities.map((r) => /* @__PURE__ */ c.jsx(
|
|
3430
|
+
No,
|
|
3431
|
+
{
|
|
3432
|
+
ability: r
|
|
3433
|
+
},
|
|
3434
|
+
r.name
|
|
3435
|
+
)) })
|
|
3436
|
+
] }),
|
|
3437
|
+
/* @__PURE__ */ c.jsxs("div", { className: Me.lowerSection, children: [
|
|
3438
|
+
/* @__PURE__ */ c.jsx(
|
|
3439
|
+
Oo,
|
|
3440
|
+
{
|
|
3441
|
+
generalRecommendation: e.generalRecommendation
|
|
3442
|
+
}
|
|
3443
|
+
),
|
|
3444
|
+
/* @__PURE__ */ c.jsx("h3", { className: "text-lg font-bold text-gray-800 mb-4 mt-6", children: "专项提升建议" }),
|
|
3445
|
+
/* @__PURE__ */ c.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: e.abilities.map((r) => /* @__PURE__ */ c.jsx(
|
|
3446
|
+
To,
|
|
3447
|
+
{
|
|
3448
|
+
ability: r
|
|
3449
|
+
},
|
|
3450
|
+
r.name
|
|
3451
|
+
)) })
|
|
3452
|
+
] })
|
|
3453
|
+
] })
|
|
3454
|
+
]
|
|
3455
|
+
}
|
|
3456
|
+
) : /* @__PURE__ */ c.jsx(
|
|
3457
|
+
"div",
|
|
3458
|
+
{
|
|
3459
|
+
className: "card max-w-4xl mx-auto p-6 md:p-8 text-center",
|
|
3460
|
+
role: "status",
|
|
3461
|
+
"aria-live": "polite",
|
|
3462
|
+
children: /* @__PURE__ */ c.jsx("p", { className: "text-gray-600", children: "暂无数据" })
|
|
3463
|
+
}
|
|
3464
|
+
);
|
|
3465
|
+
}, sn = {
|
|
3466
|
+
"Arithmetic and Algebra": "🔢",
|
|
3467
|
+
"Graphics and Geometry": "📐",
|
|
3468
|
+
"Probability and Statistics": "📊",
|
|
3469
|
+
Default: "📚"
|
|
3470
|
+
}, mi = {
|
|
3471
|
+
mastered: "已掌握",
|
|
3472
|
+
proficient: "熟练",
|
|
3473
|
+
familiar: "熟悉",
|
|
3474
|
+
attempted: "已尝试",
|
|
3475
|
+
"not-started": "未开始"
|
|
3476
|
+
}, pi = {
|
|
3477
|
+
mastered: "#10b981",
|
|
3478
|
+
proficient: "#3b82f6",
|
|
3479
|
+
familiar: "#f59e0b",
|
|
3480
|
+
attempted: "#8b5cf6",
|
|
3481
|
+
"not-started": "#6b7280"
|
|
3482
|
+
}, je = {
|
|
3483
|
+
id: "user-001",
|
|
3484
|
+
name: "小明",
|
|
3485
|
+
level: 5,
|
|
3486
|
+
avatar: "https://i.pravatar.cc/40?u=student1",
|
|
3487
|
+
logIn: !0,
|
|
3488
|
+
badges: ["🏆", "🏅", "🌟"]
|
|
3489
|
+
}, Do = [
|
|
3490
|
+
{ id: "g3", label: "三年级", status: "new", onClick: () => console.log("三年级 clicked") },
|
|
3491
|
+
{ id: "g4", label: "四年级", status: "2%", onClick: () => console.log("四年级 clicked") },
|
|
3492
|
+
{ id: "g5", label: "五年级", status: "进行中", onClick: () => console.log("五年级 clicked") },
|
|
3493
|
+
{ id: "g6", label: "六年级", status: "new", onClick: () => console.log("六年级 clicked") },
|
|
3494
|
+
{ id: "g7", label: "七年级", status: "new", onClick: () => console.log("七年级 clicked") },
|
|
3495
|
+
{ id: "g8", label: "八年级", status: "new", onClick: () => console.log("八年级 clicked") },
|
|
3496
|
+
{ id: "alg_topic", label: "代数专题", status: "new", onClick: () => console.log("代数专题 clicked") },
|
|
3497
|
+
{ id: "calc_topic", label: "计算专题", status: "new", onClick: () => console.log("计算专题 clicked") },
|
|
3498
|
+
{ id: "geo_topic", label: "几何专题", status: "new", onClick: () => console.log("几何专题 clicked") },
|
|
3499
|
+
{ id: "olym_topic", label: "奥数专题", status: "new", onClick: () => console.log("奥数专题 clicked") }
|
|
3500
|
+
], Mo = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c2VyLTAwMSIsIm5hbWUiOiLlsI_mmI4iLCJsZXZlbCI6NSwiYXZhdGFyIjoiaHR0cHM6Ly9pLnByYXZhdGFyLmNjLzQwP3U9c3R1ZGVudDEiLCJiYWRnZXMiOlsi8J-SoiIsIvCfjZUiLCLwn5KbIl0sImlhdCI6MTY5MTYwMDAwMCwiZXhwIjoxNzIzMTM2MDAwfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
|
|
3501
|
+
class Fo {
|
|
3502
|
+
baseURL;
|
|
3503
|
+
token;
|
|
3504
|
+
constructor(t = "/api", n = Mo) {
|
|
3505
|
+
this.baseURL = t, this.token = n;
|
|
3506
|
+
}
|
|
3507
|
+
getAuthHeaders() {
|
|
3508
|
+
return {
|
|
3509
|
+
Authorization: `Bearer ${this.token}`,
|
|
3510
|
+
"Content-Type": "application/json"
|
|
3511
|
+
};
|
|
3512
|
+
}
|
|
3513
|
+
async fetchWithAuth(t, n = {}) {
|
|
3514
|
+
const s = await fetch(t, {
|
|
3515
|
+
...n,
|
|
3516
|
+
headers: {
|
|
3517
|
+
...this.getAuthHeaders(),
|
|
3518
|
+
...n.headers
|
|
3519
|
+
}
|
|
3520
|
+
});
|
|
3521
|
+
if (!s.ok)
|
|
3522
|
+
throw new Error(`HTTP error! status: ${s.status}`);
|
|
3523
|
+
return s;
|
|
3524
|
+
}
|
|
3525
|
+
// 获取课程数据
|
|
3526
|
+
async getCourseData(t) {
|
|
3527
|
+
return (await this.fetchWithAuth(`${this.baseURL}/courses/${t}`)).json();
|
|
3528
|
+
}
|
|
3529
|
+
// 获取用户年级单元导航数据(包含所有单元进度)
|
|
3530
|
+
async getUserGradeUnitsNav(t) {
|
|
3531
|
+
const n = t ? `${this.baseURL}/user/grade/units/nav?gradeId=${encodeURIComponent(t)}` : `${this.baseURL}/user/grade/units/nav`;
|
|
3532
|
+
return (await this.fetchWithAuth(n)).json();
|
|
3533
|
+
}
|
|
3534
|
+
// 获取单元进度
|
|
3535
|
+
async getUnitProgress(t, n) {
|
|
3536
|
+
const s = n ? `${this.baseURL}/courses/${t}/units/${n}/progress` : `${this.baseURL}/courses/${t}/progress`;
|
|
3537
|
+
return (await this.fetchWithAuth(s)).json();
|
|
3538
|
+
}
|
|
3539
|
+
// 批量更新单元课时进度
|
|
3540
|
+
async batchUpdateLessonProgress(t, n) {
|
|
3541
|
+
return (await this.fetchWithAuth(
|
|
3542
|
+
`${this.baseURL}/user/units/${t}/progress/batch`,
|
|
3543
|
+
{
|
|
3544
|
+
method: "POST",
|
|
3545
|
+
body: JSON.stringify(n)
|
|
3546
|
+
}
|
|
3547
|
+
)).json();
|
|
3548
|
+
}
|
|
3549
|
+
// 更新学习进度(单个课时)
|
|
3550
|
+
async updateLessonProgress(t, n, s, r) {
|
|
3551
|
+
await this.fetchWithAuth(
|
|
3552
|
+
`${this.baseURL}/courses/${t}/units/${n}/lessons/${s}/progress`,
|
|
3553
|
+
{
|
|
3554
|
+
method: "POST",
|
|
3555
|
+
body: JSON.stringify({ status: r })
|
|
3556
|
+
}
|
|
3557
|
+
);
|
|
3558
|
+
}
|
|
3559
|
+
// 设置认证token
|
|
3560
|
+
setToken(t) {
|
|
3561
|
+
this.token = t;
|
|
3562
|
+
}
|
|
3563
|
+
// 获取当前token
|
|
3564
|
+
getToken() {
|
|
3565
|
+
return this.token;
|
|
3566
|
+
}
|
|
3567
|
+
}
|
|
3568
|
+
const at = new Fo(), H = {
|
|
3569
|
+
id: "g5",
|
|
3570
|
+
title: "小学数学五年级",
|
|
3571
|
+
level: 5,
|
|
3572
|
+
subject: "数学",
|
|
3573
|
+
units: [
|
|
3574
|
+
{
|
|
3575
|
+
id: "unit_1",
|
|
3576
|
+
title: "小数乘法",
|
|
3577
|
+
description: "学习小数乘法的计算方法及应用",
|
|
3578
|
+
estimatedDuration: "3周",
|
|
3579
|
+
totalLessons: 10,
|
|
3580
|
+
moduleCategory: "Arithmetic and Algebra",
|
|
3581
|
+
lessons: [
|
|
3582
|
+
{ id: "unit1_lesson1", title: "小数乘整数", duration: 40, knowledgeItems: [{ id: "unit1_lesson1_k1", title: "小数乘整数的意义", description: "理解小数乘整数的意义与整数乘法相同", progress: 0, contentUrl: "" }, { id: "unit1_lesson1_k2", title: "小数乘整数的计算方法", description: "掌握小数乘整数的计算方法:先按整数乘法计算,再看因数中有几位小数,就从积的右边起数出几位点上小数点", progress: 0, contentUrl: "" }] },
|
|
3583
|
+
{ id: "unit1_lesson2", title: "小数乘小数", duration: 40, knowledgeItems: [{ id: "unit1_lesson2_k1", title: "小数乘小数的计算方法", description: "掌握小数乘小数的计算方法:先按整数乘法算出积,再给积点上小数点", progress: 0, contentUrl: "" }, { id: "unit1_lesson2_k2", title: "积的小数位数确定", description: "理解积的小数位数等于两个因数的小数位数之和", progress: 0, contentUrl: "" }] },
|
|
3584
|
+
{ id: "unit1_lesson3", title: "积的近似数", duration: 40, knowledgeItems: [{ id: "unit1_lesson3_k1", title: '用"四舍五入"法求积的近似数', description: '掌握用"四舍五入"法求积的近似数的方法', progress: 0, contentUrl: "" }] },
|
|
3585
|
+
{ id: "unit1_lesson4", title: "整数乘法运算定律推广到小数", duration: 40, knowledgeItems: [{ id: "unit1_lesson4_k1", title: "乘法运算定律在小数中的适用性", description: "理解整数乘法运算定律对于小数乘法同样适用", progress: 0, contentUrl: "" }, { id: "unit1_lesson4_k2", title: "运用运算定律进行简便计算", description: "能运用乘法运算定律进行小数乘法的简便计算", progress: 0, contentUrl: "" }] },
|
|
3586
|
+
{ id: "unit1_lesson5", title: "解决问题", duration: 40, knowledgeItems: [{ id: "unit1_lesson5_k1", title: "用小数乘法解决实际问题", description: "能运用小数乘法解决购物、面积计算等实际问题", progress: 0, contentUrl: "" }] }
|
|
3587
|
+
]
|
|
3588
|
+
},
|
|
3589
|
+
{
|
|
3590
|
+
id: "unit_2",
|
|
3591
|
+
title: "小数除法",
|
|
3592
|
+
description: "学习小数除法的计算方法及应用",
|
|
3593
|
+
estimatedDuration: "3周",
|
|
3594
|
+
totalLessons: 12,
|
|
3595
|
+
moduleCategory: "Arithmetic and Algebra",
|
|
3596
|
+
lessons: [
|
|
3597
|
+
{ id: "unit2_lesson1", title: "小数除以整数", duration: 40, knowledgeItems: [{ id: "unit2_lesson1_k1", title: "小数除以整数的计算方法", description: "掌握小数除以整数的计算方法:按照整数除法的方法计算,商的小数点要与被除数的小数点对齐", progress: 0, contentUrl: "" }] },
|
|
3598
|
+
{ id: "unit2_lesson2", title: "一个数除以小数", duration: 40, knowledgeItems: [{ id: "unit2_lesson2_k1", title: "除数是小数的除法计算方法", description: "掌握除数是小数的除法计算方法:利用商不变的性质,将除数转化为整数", progress: 0, contentUrl: "" }] },
|
|
3599
|
+
{ id: "unit2_lesson3", title: "商的近似数", duration: 40, knowledgeItems: [{ id: "unit2_lesson3_k1", title: '用"四舍五入"法求商的近似数', description: '掌握用"四舍五入"法求商的近似数的方法', progress: 0, contentUrl: "" }] },
|
|
3600
|
+
{ id: "unit2_lesson4", title: "循环小数", duration: 40, knowledgeItems: [{ id: "unit2_lesson4_k1", title: "循环小数的概念", description: "理解循环小数的概念,认识循环节", progress: 0, contentUrl: "" }, { id: "unit2_lesson4_k2", title: "循环小数的表示方法", description: "掌握循环小数的简便表示方法", progress: 0, contentUrl: "" }] },
|
|
3601
|
+
{ id: "unit2_lesson5", title: "用计算器探索规律", duration: 40, knowledgeItems: [{ id: "unit2_lesson5_k1", title: "用计算器计算小数除法", description: "会用计算器计算较复杂的小数除法", progress: 0, contentUrl: "" }, { id: "unit2_lesson5_k2", title: "发现商的变化规律", description: "能借助计算器发现商的变化规律", progress: 0, contentUrl: "" }] },
|
|
3602
|
+
{ id: "unit2_lesson6", title: "解决问题", duration: 40, knowledgeItems: [{ id: "unit2_lesson6_k1", title: "用小数除法解决实际问题", description: "能运用小数除法解决购物、分配等实际问题", progress: 0, contentUrl: "" }] }
|
|
3603
|
+
]
|
|
3604
|
+
},
|
|
3605
|
+
{
|
|
3606
|
+
id: "unit_3",
|
|
3607
|
+
title: "简易方程",
|
|
3608
|
+
description: "学习用字母表示数和解简易方程",
|
|
3609
|
+
estimatedDuration: "4周",
|
|
3610
|
+
totalLessons: 14,
|
|
3611
|
+
moduleCategory: "Arithmetic and Algebra",
|
|
3612
|
+
lessons: [
|
|
3613
|
+
{ id: "unit3_lesson1", title: "用字母表示数", duration: 40, knowledgeItems: [{ id: "unit3_lesson1_k1", title: "用字母表示数", description: "初步理解用字母表示数的意义和作用", progress: 0, contentUrl: "" }, { id: "unit3_lesson1_k2", title: "用字母表示运算定律和计算公式", description: "会用字母表示运算定律和计算公式", progress: 0, contentUrl: "" }] },
|
|
3614
|
+
{ id: "unit3_lesson2", title: "方程的意义", duration: 40, knowledgeItems: [{ id: "unit3_lesson2_k1", title: "方程的概念", description: "理解方程的意义,知道方程与等式的区别和联系", progress: 0, contentUrl: "" }] },
|
|
3615
|
+
{ id: "unit3_lesson3", title: "等式的性质", duration: 40, knowledgeItems: [{ id: "unit3_lesson3_k1", title: "等式的性质1", description: "理解等式的性质1:等式两边加上或减去同一个数,左右两边仍然相等", progress: 0, contentUrl: "" }, { id: "unit3_lesson3_k2", title: "等式的性质2", description: "理解等式的性质2:等式两边乘同一个数,或除以同一个不为0的数,左右两边仍然相等", progress: 0, contentUrl: "" }] },
|
|
3616
|
+
{ id: "unit3_lesson4", title: "解简易方程", duration: 40, knowledgeItems: [{ id: "unit3_lesson4_k1", title: "利用等式的性质解方程", description: "会利用等式的性质解形如x±a=b、ax=b、x÷a=b、a-x=b、a÷x=b的方程", progress: 0, contentUrl: "" }] },
|
|
3617
|
+
{ id: "unit3_lesson5", title: "实际问题与方程", duration: 40, knowledgeItems: [{ id: "unit3_lesson5_k1", title: "列方程解决实际问题", description: "初步学会列方程解决一些简单的实际问题", progress: 0, contentUrl: "" }] }
|
|
3618
|
+
]
|
|
3619
|
+
},
|
|
3620
|
+
{
|
|
3621
|
+
id: "unit_4",
|
|
3622
|
+
title: "多边形的面积",
|
|
3623
|
+
description: "学习平行四边形、三角形、梯形和组合图形的面积计算",
|
|
3624
|
+
estimatedDuration: "3周",
|
|
3625
|
+
totalLessons: 12,
|
|
3626
|
+
moduleCategory: "Graphics and Geometry",
|
|
3627
|
+
lessons: [
|
|
3628
|
+
{ id: "unit4_lesson1", title: "平行四边形的面积", duration: 40, knowledgeItems: [{ id: "unit4_lesson1_k1", title: "平行四边形面积公式的推导", description: "通过割补法理解平行四边形面积公式的推导过程", progress: 0, contentUrl: "" }, { id: "unit4_lesson1_k2", title: "平行四边形面积的计算", description: "掌握平行四边形面积计算公式:S=ah,并能正确运用", progress: 0, contentUrl: "" }] },
|
|
3629
|
+
{ id: "unit4_lesson2", title: "三角形的面积", duration: 40, knowledgeItems: [{ id: "unit4_lesson2_k1", title: "三角形面积公式的推导", description: "通过拼摆法理解三角形面积公式的推导过程", progress: 0, contentUrl: "" }, { id: "unit4_lesson2_k2", title: "三角形面积的计算", description: "掌握三角形面积计算公式:S=ah÷2,并能正确运用", progress: 0, contentUrl: "" }] },
|
|
3630
|
+
{ id: "unit4_lesson3", title: "梯形的面积", duration: 40, knowledgeItems: [{ id: "unit4_lesson3_k1", title: "梯形面积公式的推导", description: "通过拼摆法理解梯形面积公式的推导过程", progress: 0, contentUrl: "" }, { id: "unit4_lesson3_k2", title: "梯形面积的计算", description: "掌握梯形面积计算公式:S=(a+b)h÷2,并能正确运用", progress: 0, contentUrl: "" }] },
|
|
3631
|
+
{ id: "unit4_lesson4", title: "组合图形的面积", duration: 40, knowledgeItems: [{ id: "unit4_lesson4_k1", title: "认识组合图形", description: "认识组合图形,会把组合图形分解成已学过的平面图形", progress: 0, contentUrl: "" }, { id: "unit4_lesson4_k2", title: "计算组合图形的面积", description: "掌握计算组合图形面积的多种方法", progress: 0, contentUrl: "" }] }
|
|
3632
|
+
]
|
|
3633
|
+
},
|
|
3634
|
+
{
|
|
3635
|
+
id: "unit_5",
|
|
3636
|
+
title: "因数与倍数",
|
|
3637
|
+
description: "学习因数、倍数、质数、合数等概念",
|
|
3638
|
+
estimatedDuration: "3周",
|
|
3639
|
+
totalLessons: 10,
|
|
3640
|
+
moduleCategory: "Arithmetic and Algebra",
|
|
3641
|
+
lessons: [
|
|
3642
|
+
{ id: "unit5_lesson1", title: "因数和倍数", duration: 40, knowledgeItems: [{ id: "unit5_lesson1_k1", title: "因数和倍数的意义", description: "理解因数和倍数的意义,掌握找一个数的因数和倍数的方法", progress: 0, contentUrl: "" }, { id: "unit5_lesson1_k2", title: "因数和倍数的特征", description: "了解一个数的因数的个数是有限的,倍数的个数是无限的", progress: 0, contentUrl: "" }] },
|
|
3643
|
+
{ id: "unit5_lesson2", title: "2、5、3的倍数的特征", duration: 40, knowledgeItems: [{ id: "unit5_lesson2_k1", title: "2、5的倍数的特征", description: "掌握2、5的倍数的特征,理解奇数和偶数的意义", progress: 0, contentUrl: "" }, { id: "unit5_lesson2_k2", title: "3的倍数的特征", description: "掌握3的倍数的特征,能判断一个数是不是3的倍数", progress: 0, contentUrl: "" }] },
|
|
3644
|
+
{ id: "unit5_lesson3", title: "质数和合数", duration: 40, knowledgeItems: [{ id: "unit5_lesson3_k1", title: "质数和合数的意义", description: "理解质数和合数的意义,能判断一个数是质数还是合数", progress: 0, contentUrl: "" }, { id: "unit5_lesson3_k2", title: "制作100以内的质数表", description: "会制作100以内的质数表,熟记20以内的质数", progress: 0, contentUrl: "" }] }
|
|
3645
|
+
]
|
|
3646
|
+
},
|
|
3647
|
+
{
|
|
3648
|
+
id: "unit_6",
|
|
3649
|
+
title: "长方体和正方体",
|
|
3650
|
+
description: "学习长方体和正方体的特征、表面积和体积计算",
|
|
3651
|
+
estimatedDuration: "4周",
|
|
3652
|
+
totalLessons: 14,
|
|
3653
|
+
moduleCategory: "Graphics and Geometry",
|
|
3654
|
+
lessons: [
|
|
3655
|
+
{ id: "unit6_lesson1", title: "长方体和正方体的认识", duration: 40, knowledgeItems: [{ id: "unit6_lesson1_k1", title: "长方体的特征", description: "认识长方体的特征,了解长方体的长、宽、高", progress: 0, contentUrl: "" }, { id: "unit6_lesson1_k2", title: "正方体的特征", description: "认识正方体的特征,理解正方体是特殊的长方体", progress: 0, contentUrl: "" }] },
|
|
3656
|
+
{ id: "unit6_lesson2", title: "长方体和正方体的表面积", duration: 40, knowledgeItems: [{ id: "unit6_lesson2_k1", title: "表面积的意义", description: "理解表面积的意义,掌握长方体和正方体表面积的计算方法", progress: 0, contentUrl: "" }, { id: "unit6_lesson2_k2", title: "表面积的实际应用", description: "能运用表面积知识解决一些实际问题", progress: 0, contentUrl: "" }] },
|
|
3657
|
+
{ id: "unit6_lesson3", title: "长方体和正方体的体积", duration: 40, knowledgeItems: [{ id: "unit6_lesson3_k1", title: "体积和体积单位", description: "理解体积的意义,认识常用的体积单位", progress: 0, contentUrl: "" }, { id: "unit6_lesson3_k2", title: "长方体和正方体体积的计算", description: "掌握长方体和正方体体积的计算公式", progress: 0, contentUrl: "" }, { id: "unit6_lesson3_k3", title: "体积单位间的进率", description: "掌握体积单位之间的进率和换算", progress: 0, contentUrl: "" }] },
|
|
3658
|
+
{ id: "unit6_lesson4", title: "容积和容积单位", duration: 40, knowledgeItems: [{ id: "unit6_lesson4_k1", title: "容积和容积单位", description: "理解容积的意义,认识常用的容积单位", progress: 0, contentUrl: "" }, { id: "unit6_lesson4_k2", title: "容积和体积的关系", description: "掌握容积和体积之间的关系", progress: 0, contentUrl: "" }] }
|
|
3659
|
+
]
|
|
3660
|
+
},
|
|
3661
|
+
{
|
|
3662
|
+
id: "unit_7",
|
|
3663
|
+
title: "分数的意义和性质",
|
|
3664
|
+
description: "学习分数的意义、性质和约分、通分等方法",
|
|
3665
|
+
estimatedDuration: "4周",
|
|
3666
|
+
totalLessons: 16,
|
|
3667
|
+
moduleCategory: "Arithmetic and Algebra",
|
|
3668
|
+
lessons: [
|
|
3669
|
+
{ id: "unit7_lesson1", title: "分数的意义", duration: 40, knowledgeItems: [{ id: "unit7_lesson1_k1", title: "分数的产生和意义", description: "理解分数的产生和意义,明确分数与除法的关系", progress: 0, contentUrl: "" }, { id: "unit7_lesson1_k2", title: "分数单位", description: "认识分数单位,能说出一个分数中有几个这样的分数单位", progress: 0, contentUrl: "" }] },
|
|
3670
|
+
{ id: "unit7_lesson2", title: "分数与除法", duration: 40, knowledgeItems: [{ id: "unit7_lesson2_k1", title: "分数与除法的关系", description: "理解分数与除法的关系,会用分数表示两个数相除的商", progress: 0, contentUrl: "" }] },
|
|
3671
|
+
{ id: "unit7_lesson3", title: "真分数和假分数", duration: 40, knowledgeItems: [{ id: "unit7_lesson3_k1", title: "真分数和假分数的意义", description: "理解真分数和假分数的意义和特征", progress: 0, contentUrl: "" }, { id: "unit7_lesson3_k2", title: "带分数", description: "认识带分数,会进行假分数与整数、带分数的互化", progress: 0, contentUrl: "" }] },
|
|
3672
|
+
{ id: "unit7_lesson4", title: "分数的基本性质", duration: 40, knowledgeItems: [{ id: "unit7_lesson4_k1", title: "分数的基本性质", description: "理解分数的基本性质,能运用分数的基本性质进行分数的变形", progress: 0, contentUrl: "" }] },
|
|
3673
|
+
{ id: "unit7_lesson5", title: "约分", duration: 40, knowledgeItems: [{ id: "unit7_lesson5_k1", title: "最大公因数", description: "理解公因数和最大公因数的意义,掌握求两个数的最大公因数的方法", progress: 0, contentUrl: "" }, { id: "unit7_lesson5_k2", title: "约分的方法", description: "掌握约分的方法,能正确地进行约分", progress: 0, contentUrl: "" }] },
|
|
3674
|
+
{ id: "unit7_lesson6", title: "通分", duration: 40, knowledgeItems: [{ id: "unit7_lesson6_k1", title: "最小公倍数", description: "理解公倍数和最小公倍数的意义,掌握求两个数的最小公倍数的方法", progress: 0, contentUrl: "" }, { id: "unit7_lesson6_k2", title: "通分的方法", description: "掌握通分的方法,能正确地进行通分", progress: 0, contentUrl: "" }] },
|
|
3675
|
+
{ id: "unit7_lesson7", title: "分数和小数的互化", duration: 40, knowledgeItems: [{ id: "unit7_lesson7_k1", title: "分数化成小数", description: "掌握分数化成小数的方法", progress: 0, contentUrl: "" }, { id: "unit7_lesson7_k2", title: "小数化成分数", description: "掌握小数化成分数的方法", progress: 0, contentUrl: "" }] }
|
|
3676
|
+
]
|
|
3677
|
+
},
|
|
3678
|
+
{
|
|
3679
|
+
id: "unit_8",
|
|
3680
|
+
title: "分数的加法和减法",
|
|
3681
|
+
description: "学习同分母分数、异分母分数的加法和减法",
|
|
3682
|
+
estimatedDuration: "3周",
|
|
3683
|
+
totalLessons: 12,
|
|
3684
|
+
moduleCategory: "Arithmetic and Algebra",
|
|
3685
|
+
lessons: [
|
|
3686
|
+
{ id: "unit8_lesson1", title: "同分母分数加、减法", duration: 40, knowledgeItems: [{ id: "unit8_lesson1_k1", title: "同分母分数加法的计算方法", description: "掌握同分母分数加法的计算方法", progress: 0, contentUrl: "" }, { id: "unit8_lesson1_k2", title: "同分母分数减法的计算方法", description: "掌握同分母分数减法的计算方法", progress: 0, contentUrl: "" }] },
|
|
3687
|
+
{ id: "unit8_lesson2", title: "异分母分数加、减法", duration: 40, knowledgeItems: [{ id: "unit8_lesson2_k1", title: "异分母分数加法的计算方法", description: "掌握异分母分数加法的计算方法:先通分,然后按照同分母分数加法进行计算", progress: 0, contentUrl: "" }, { id: "unit8_lesson2_k2", title: "异分母分数减法的计算方法", description: "掌握异分母分数减法的计算方法:先通分,然后按照同分母分数减法进行计算", progress: 0, contentUrl: "" }] },
|
|
3688
|
+
{ id: "unit8_lesson3", title: "分数加减混合运算", duration: 40, knowledgeItems: [{ id: "unit8_lesson3_k1", title: "分数加减混合运算的顺序", description: "掌握分数加减混合运算的运算顺序", progress: 0, contentUrl: "" }, { id: "unit8_lesson3_k2", title: "整数加法运算定律推广到分数加法", description: "理解整数加法运算定律对于分数加法同样适用,能运用运算定律进行简便计算", progress: 0, contentUrl: "" }] }
|
|
3689
|
+
]
|
|
3690
|
+
},
|
|
3691
|
+
{
|
|
3692
|
+
id: "unit_9",
|
|
3693
|
+
title: "折线统计图",
|
|
3694
|
+
description: "学习单式折线统计图和复式折线统计图的认识和制作",
|
|
3695
|
+
estimatedDuration: "2周",
|
|
3696
|
+
totalLessons: 6,
|
|
3697
|
+
moduleCategory: "Probability and Statistics",
|
|
3698
|
+
lessons: [
|
|
3699
|
+
{ id: "unit9_lesson1", title: "单式折线统计图", duration: 40, knowledgeItems: [{ id: "unit9_lesson1_k1", title: "单式折线统计图的特点", description: "认识单式折线统计图,了解其特点和作用", progress: 0, contentUrl: "" }, { id: "unit9_lesson1_k2", title: "绘制单式折线统计图", description: "能根据数据绘制单式折线统计图", progress: 0, contentUrl: "" }] },
|
|
3700
|
+
{ id: "unit9_lesson2", title: "复式折线统计图", duration: 40, knowledgeItems: [{ id: "unit9_lesson2_k1", title: "复式折线统计图的特点", description: "认识复式折线统计图,了解其特点和作用", progress: 0, contentUrl: "" }, { id: "unit9_lesson2_k2", title: "绘制复式折线统计图", description: "能根据数据绘制复式折线统计图", progress: 0, contentUrl: "" }] },
|
|
3701
|
+
{ id: "unit9_lesson3", title: "数据分析", duration: 40, knowledgeItems: [{ id: "unit9_lesson3_k1", title: "根据统计图进行数据分析", description: "能根据折线统计图进行简单的数据分析,作出合理的判断和预测", progress: 0, contentUrl: "" }] }
|
|
3702
|
+
]
|
|
3703
|
+
}
|
|
3704
|
+
]
|
|
3705
|
+
}, hi = Do, gi = je, Tn = is(null), $o = () => {
|
|
3706
|
+
const e = as(Tn);
|
|
3707
|
+
if (!e)
|
|
3708
|
+
throw new Error("useGradeUnitBrowser must be used within GradeUnitBrowserProvider");
|
|
3709
|
+
return e;
|
|
3710
|
+
}, bi = ({ children: e }) => {
|
|
3711
|
+
const [t, n] = ae(null), [s, r] = ae([]), [i, o] = ae(null), [l, m] = ae({}), [f, u] = ae(!1), [h, x] = ae(null), [j, p] = ae(null), [y, g] = ae([]), v = st(async (R, U) => {
|
|
3712
|
+
u(!0), x(null);
|
|
3713
|
+
try {
|
|
3714
|
+
await new Promise((D) => setTimeout(D, 100));
|
|
3715
|
+
try {
|
|
3716
|
+
console.log("Attempting to fetch units data from API..."), console.log("API URL will be:", `/api/user/grade/units/nav?gradeId=${R}`), console.log("Using token:", at.getToken());
|
|
3717
|
+
const D = await at.getUserGradeUnitsNav(R);
|
|
3718
|
+
console.log("API call successful, units data:", D), o(D), console.log("unitsData:", D);
|
|
3719
|
+
} catch (D) {
|
|
3720
|
+
const $ = D;
|
|
3721
|
+
console.error("🚨 MSW API 请求失败 - 详细调试信息:"), console.error("📡 请求 URL:", `/api/user/grade/units/nav?gradeId=${R}`), console.error("🔑 使用 Token:", at.getToken()), console.error("❌ 错误信息:", $.message), console.error("📝 错误类型:", $.name), console.error("🔍 错误堆栈:", $.stack), x(`MSW API 请求失败: ${$.message} - 请检查浏览器控制台获取详细信息`);
|
|
3722
|
+
const Q = {
|
|
3723
|
+
userId: U,
|
|
3724
|
+
courseId: "g5",
|
|
3725
|
+
courseTitle: "小学数学五年级",
|
|
3726
|
+
courseLevel: 5,
|
|
3727
|
+
totalUnits: H.units.length,
|
|
3728
|
+
completedUnits: 2,
|
|
3729
|
+
overallProgress: 22,
|
|
3730
|
+
status: "in-progress",
|
|
3731
|
+
lastAccessed: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3732
|
+
units: H.units.map((B, L) => ({
|
|
3733
|
+
unitId: B.id,
|
|
3734
|
+
title: B.title,
|
|
3735
|
+
description: B.description,
|
|
3736
|
+
moduleCategory: B.moduleCategory,
|
|
3737
|
+
estimatedDuration: B.estimatedDuration,
|
|
3738
|
+
totalLessons: B.lessons.length,
|
|
3739
|
+
completedLessons: L < 2 ? Math.floor(B.lessons.length * 0.5) : 0,
|
|
3740
|
+
progressPercentage: L < 2 ? 50 : 0,
|
|
3741
|
+
status: L < 2 ? "in-progress" : "not-started",
|
|
3742
|
+
lastAccessed: L < 2 ? (/* @__PURE__ */ new Date()).toISOString() : void 0,
|
|
3743
|
+
isActive: L === 0,
|
|
3744
|
+
route: `/math/grade-5/unit/${B.id}`,
|
|
3745
|
+
icon: sn[B.moduleCategory] || sn.Default
|
|
3746
|
+
}))
|
|
3747
|
+
};
|
|
3748
|
+
o(Q), console.log("Using courseData.ts as fallback:", Q);
|
|
3749
|
+
}
|
|
3750
|
+
const w = {};
|
|
3751
|
+
H.units.forEach((D) => {
|
|
3752
|
+
w[D.id] = D.lessons.map(($) => ({
|
|
3753
|
+
id: $.id,
|
|
3754
|
+
title: $.title,
|
|
3755
|
+
duration: $.duration,
|
|
3756
|
+
knowledgeItems: $.knowledgeItems.map((Q) => ({
|
|
3757
|
+
...Q,
|
|
3758
|
+
progress: 0
|
|
3759
|
+
// 添加默认进度值
|
|
3760
|
+
}))
|
|
3761
|
+
}));
|
|
3762
|
+
}), console.log("Lessons data loaded:", w), m(w), console.log("unitsData:", i), console.log("unitsData.units:", i?.units), console.log("First unit isActive:", i?.units?.[0]?.isActive), console.log("First unit unitId:", i?.units?.[0]?.unitId), console.log("Lessons data keys:", Object.keys(w)), console.log("Lessons for unit_1:", w.unit_1), n({
|
|
3763
|
+
id: U,
|
|
3764
|
+
name: "学生用户",
|
|
3765
|
+
level: 5,
|
|
3766
|
+
avatar: "https://i.pravatar.cc/40",
|
|
3767
|
+
badges: ["🏆"]
|
|
3768
|
+
}), r([
|
|
3769
|
+
{ id: "g5", label: "五年级", status: "进行中" },
|
|
3770
|
+
{ id: "g6", label: "六年级", status: "new" }
|
|
3771
|
+
]);
|
|
3772
|
+
} catch (w) {
|
|
3773
|
+
x(w instanceof Error ? w.message : "数据加载失败"), console.error("数据加载错误:", w), console.error("API call error details:", w), console.log("gradeId parameter:", R);
|
|
3774
|
+
} finally {
|
|
3775
|
+
u(!1);
|
|
3776
|
+
}
|
|
3777
|
+
}, []), A = st((R) => {
|
|
3778
|
+
g(
|
|
3779
|
+
(U) => U.includes(R) ? U.filter((w) => w !== R) : [...U, R]
|
|
3780
|
+
);
|
|
3781
|
+
}, []), C = st((R) => {
|
|
3782
|
+
p(R);
|
|
3783
|
+
}, []);
|
|
3784
|
+
qe(() => {
|
|
3785
|
+
if (console.log("unitsData state updated:", i), i && i.units.length > 0) {
|
|
3786
|
+
const R = i.units.find((U) => U.isActive)?.unitId || i.units[0].unitId;
|
|
3787
|
+
p(R), console.log("Default active unit set after state update:", R);
|
|
3788
|
+
}
|
|
3789
|
+
}, [i]);
|
|
3790
|
+
const T = {
|
|
3791
|
+
// 数据状态
|
|
3792
|
+
userInfo: t,
|
|
3793
|
+
exploreMenu: s,
|
|
3794
|
+
unitsData: i,
|
|
3795
|
+
lessons: l,
|
|
3796
|
+
// UI状态
|
|
3797
|
+
loading: f,
|
|
3798
|
+
error: h,
|
|
3799
|
+
activeUnitId: j,
|
|
3800
|
+
activeLessonIds: y,
|
|
3801
|
+
// Actions
|
|
3802
|
+
setLoading: u,
|
|
3803
|
+
setError: x,
|
|
3804
|
+
setActiveUnit: C,
|
|
3805
|
+
toggleLesson: A,
|
|
3806
|
+
loadPageData: v
|
|
3807
|
+
};
|
|
3808
|
+
return /* @__PURE__ */ c.jsx(Tn.Provider, { value: T, children: e });
|
|
3809
|
+
}, _i = ({
|
|
3810
|
+
gradeId: e,
|
|
3811
|
+
userId: t,
|
|
3812
|
+
onLearnAction: n,
|
|
3813
|
+
className: s,
|
|
3814
|
+
userInfo: r,
|
|
3815
|
+
exploreMenu: i
|
|
3816
|
+
}) => {
|
|
3817
|
+
const {
|
|
3818
|
+
userInfo: o,
|
|
3819
|
+
exploreMenu: l,
|
|
3820
|
+
unitsData: m,
|
|
3821
|
+
lessons: f,
|
|
3822
|
+
loading: u,
|
|
3823
|
+
error: h,
|
|
3824
|
+
activeUnitId: x,
|
|
3825
|
+
activeLessonIds: j,
|
|
3826
|
+
setActiveUnit: p,
|
|
3827
|
+
toggleLesson: y,
|
|
3828
|
+
loadPageData: g
|
|
3829
|
+
} = $o(), v = r ?? o, A = i ?? l;
|
|
3830
|
+
qe(() => {
|
|
3831
|
+
g(e, t);
|
|
3832
|
+
}, [e, t, g]), qe(() => {
|
|
3833
|
+
console.log("activeUnitId from context:", x), console.log("lessons from context:", f);
|
|
3834
|
+
const R = m?.units?.find((w) => w.unitId === x) || null, U = R && x && f[x] ? {
|
|
3835
|
+
id: R.unitId,
|
|
3836
|
+
title: R.title,
|
|
3837
|
+
description: R.description,
|
|
3838
|
+
estimatedDuration: R.estimatedDuration,
|
|
3839
|
+
totalLessons: R.totalLessons,
|
|
3840
|
+
moduleCategory: R.moduleCategory,
|
|
3841
|
+
lessons: f[x]
|
|
3842
|
+
} : null;
|
|
3843
|
+
console.log("activeUnit computed:", U);
|
|
3844
|
+
}, [x, f, m]);
|
|
3845
|
+
const C = m?.units?.find((R) => R.unitId === x) || null, T = C && x && f[x] ? {
|
|
3846
|
+
id: C.unitId,
|
|
3847
|
+
title: C.title,
|
|
3848
|
+
description: C.description,
|
|
3849
|
+
estimatedDuration: C.estimatedDuration,
|
|
3850
|
+
totalLessons: C.totalLessons,
|
|
3851
|
+
moduleCategory: C.moduleCategory,
|
|
3852
|
+
lessons: f[x]
|
|
3853
|
+
} : null;
|
|
3854
|
+
return u ? /* @__PURE__ */ c.jsx("div", { className: "grade-unit-browser-page loading", "data-testid": "grade-unit-browser-page", children: /* @__PURE__ */ c.jsx("div", { className: "loading-spinner", "data-testid": "loading-spinner", children: "加载中..." }) }) : h ? /* @__PURE__ */ c.jsxs("div", { className: "grade-unit-browser-page error", "data-testid": "grade-unit-browser-page", children: [
|
|
3855
|
+
/* @__PURE__ */ c.jsx("div", { className: "error-message", "data-testid": "error-message", children: h }),
|
|
3856
|
+
/* @__PURE__ */ c.jsx(
|
|
3857
|
+
"button",
|
|
3858
|
+
{
|
|
3859
|
+
onClick: () => g(e, t),
|
|
3860
|
+
className: "retry-button",
|
|
3861
|
+
children: "重试"
|
|
3862
|
+
}
|
|
3863
|
+
)
|
|
3864
|
+
] }) : /* @__PURE__ */ c.jsxs(
|
|
3865
|
+
"div",
|
|
3866
|
+
{
|
|
3867
|
+
className: `grade-unit-browser-page ${s || ""}`,
|
|
3868
|
+
"data-testid": "grade-unit-browser-page",
|
|
3869
|
+
children: [
|
|
3870
|
+
/* @__PURE__ */ c.jsx("div", { className: "header-area", children: /* @__PURE__ */ c.jsx(
|
|
3871
|
+
vo,
|
|
3872
|
+
{
|
|
3873
|
+
userData: v || void 0,
|
|
3874
|
+
exploreItems: A
|
|
3875
|
+
}
|
|
3876
|
+
) }),
|
|
3877
|
+
/* @__PURE__ */ c.jsx("div", { className: "sidebar-area", children: /* @__PURE__ */ c.jsx(
|
|
3878
|
+
Ds,
|
|
3879
|
+
{
|
|
3880
|
+
data: m,
|
|
3881
|
+
activeUnitId: x,
|
|
3882
|
+
onUnitSelect: p,
|
|
3883
|
+
loading: u
|
|
3884
|
+
}
|
|
3885
|
+
) }),
|
|
3886
|
+
/* @__PURE__ */ c.jsx("div", { className: "content-area", children: /* @__PURE__ */ c.jsx(
|
|
3887
|
+
Ls,
|
|
3888
|
+
{
|
|
3889
|
+
unit: T,
|
|
3890
|
+
activeLessonIds: j,
|
|
3891
|
+
onToggleLesson: y,
|
|
3892
|
+
onLearnAction: n || (() => {
|
|
3893
|
+
}),
|
|
3894
|
+
loading: u
|
|
3895
|
+
}
|
|
3896
|
+
) })
|
|
3897
|
+
]
|
|
3898
|
+
}
|
|
3899
|
+
);
|
|
3900
|
+
}, re = (e, t, n) => ({
|
|
3901
|
+
x: e.x + (t.x - e.x) * n,
|
|
3902
|
+
y: e.y + (t.y - e.y) * n
|
|
3903
|
+
}), yi = () => {
|
|
3904
|
+
const e = { x: 0.5, y: 0.1, name: "A" }, t = { x: 0.1, y: 0.75, name: "B" }, n = { x: 0.9, y: 0.75, name: "C" }, s = { ...re(e, t, 1 / 3), name: "D" }, r = { ...re(e, n, 1 / 3), name: "E" }, i = { ...re(e, t, 2 / 3), name: "M" }, o = { ...re(e, n, 2 / 3), name: "N" }, l = { ...re(t, n, 1 / 3), name: "P" }, m = { ...re(t, n, 2 / 3), name: "Q" }, f = { ...re(s, r, 1 / 3), name: "U" }, u = { ...re(s, r, 2 / 3), name: "S" }, h = { ...re(i, o, 1 / 3), name: "K" }, x = { ...re(i, o, 2 / 3), name: "L" };
|
|
3905
|
+
return { A: e, B: t, C: n, D: s, E: r, M: i, N: o, P: l, Q: m, U: f, S: u, K: h, L: x };
|
|
3906
|
+
}, xi = (e, t, n) => {
|
|
3907
|
+
const s = {};
|
|
3908
|
+
for (const [r, i] of Object.entries(e))
|
|
3909
|
+
s[r] = {
|
|
3910
|
+
...i,
|
|
3911
|
+
x: i.x * t,
|
|
3912
|
+
y: i.y * n
|
|
3913
|
+
};
|
|
3914
|
+
return s;
|
|
3915
|
+
}, wi = (e, t) => {
|
|
3916
|
+
const [n, s, r] = t, { x: i, y: o } = e, l = (s.y - r.y) * (n.x - r.x) + (r.x - s.x) * (n.y - r.y);
|
|
3917
|
+
if (Math.abs(l) < 1e-4) return !1;
|
|
3918
|
+
const m = ((s.y - r.y) * (i - r.x) + (r.x - s.x) * (o - r.y)) / l, f = ((r.y - n.y) * (i - r.x) + (n.x - r.x) * (o - r.y)) / l, u = 1 - m - f;
|
|
3919
|
+
return m >= -1e-3 && f >= -1e-3 && u >= -1e-3;
|
|
3920
|
+
}, vi = (e, t) => {
|
|
3921
|
+
if (!e || !t || e.length !== 3 || t.length !== 3) return !1;
|
|
3922
|
+
const n = e.map((r) => r.name).sort(), s = t.map((r) => r.name).sort();
|
|
3923
|
+
return n.every((r, i) => r === s[i]);
|
|
3924
|
+
}, Ei = (e, t) => {
|
|
3925
|
+
if (!e || !t || e.length !== t.length)
|
|
3926
|
+
return !1;
|
|
3927
|
+
const n = e.map((r) => r.name).sort(), s = t.map((r) => r.name).sort();
|
|
3928
|
+
return n.join("") === s.join("");
|
|
3929
|
+
}, Ri = () => [
|
|
3930
|
+
// 大三角形边
|
|
3931
|
+
{ from: "A", to: "B" },
|
|
3932
|
+
{ from: "A", to: "C" },
|
|
3933
|
+
{ from: "B", to: "C" },
|
|
3934
|
+
// 第一层分割线
|
|
3935
|
+
{ from: "D", to: "E" },
|
|
3936
|
+
// 第二层分割线
|
|
3937
|
+
{ from: "M", to: "N" },
|
|
3938
|
+
// 底边分割线
|
|
3939
|
+
{ from: "P", to: "Q" },
|
|
3940
|
+
// 连接到顶点的线段
|
|
3941
|
+
{ from: "A", to: "D" },
|
|
3942
|
+
{ from: "A", to: "E" },
|
|
3943
|
+
{ from: "A", to: "M" },
|
|
3944
|
+
{ from: "A", to: "N" },
|
|
3945
|
+
{ from: "A", to: "P" },
|
|
3946
|
+
{ from: "A", to: "Q" },
|
|
3947
|
+
// 内部连接线段
|
|
3948
|
+
{ from: "D", to: "U" },
|
|
3949
|
+
{ from: "U", to: "S" },
|
|
3950
|
+
{ from: "S", to: "E" },
|
|
3951
|
+
{ from: "M", to: "K" },
|
|
3952
|
+
{ from: "K", to: "L" },
|
|
3953
|
+
{ from: "L", to: "N" },
|
|
3954
|
+
// 到底边的连接
|
|
3955
|
+
{ from: "B", to: "P" },
|
|
3956
|
+
{ from: "P", to: "Q" },
|
|
3957
|
+
{ from: "Q", to: "C" }
|
|
3958
|
+
], Si = () => [
|
|
3959
|
+
// 大三角形系列(3个)
|
|
3960
|
+
{ id: "gem_1", vertices: ["A", "B", "P"], points: 10, category: "basic" },
|
|
3961
|
+
{ id: "gem_2", vertices: ["A", "P", "Q"], points: 10, category: "basic" },
|
|
3962
|
+
{ id: "gem_3", vertices: ["A", "Q", "C"], points: 10, category: "basic" },
|
|
3963
|
+
// 中等三角形系列(3个)
|
|
3964
|
+
{ id: "gem_4", vertices: ["A", "B", "Q"], points: 15, category: "medium" },
|
|
3965
|
+
{ id: "gem_5", vertices: ["A", "P", "C"], points: 15, category: "medium" },
|
|
3966
|
+
{ id: "gem_6", vertices: ["A", "B", "C"], points: 20, category: "large" },
|
|
3967
|
+
// ADE区域系列(6个)
|
|
3968
|
+
{ id: "gem_7", vertices: ["A", "D", "U"], points: 12, category: "ade_small" },
|
|
3969
|
+
{ id: "gem_8", vertices: ["A", "U", "S"], points: 12, category: "ade_small" },
|
|
3970
|
+
{ id: "gem_9", vertices: ["A", "S", "E"], points: 12, category: "ade_small" },
|
|
3971
|
+
{ id: "gem_10", vertices: ["A", "D", "S"], points: 18, category: "ade_medium" },
|
|
3972
|
+
{ id: "gem_11", vertices: ["A", "U", "E"], points: 18, category: "ade_medium" },
|
|
3973
|
+
{ id: "gem_12", vertices: ["A", "D", "E"], points: 25, category: "ade_large" },
|
|
3974
|
+
// AMN区域系列(6个)
|
|
3975
|
+
{ id: "gem_13", vertices: ["A", "M", "K"], points: 14, category: "amn_small" },
|
|
3976
|
+
{ id: "gem_14", vertices: ["A", "K", "L"], points: 14, category: "amn_small" },
|
|
3977
|
+
{ id: "gem_15", vertices: ["A", "L", "N"], points: 14, category: "amn_small" },
|
|
3978
|
+
{ id: "gem_16", vertices: ["A", "M", "L"], points: 20, category: "amn_medium" },
|
|
3979
|
+
{ id: "gem_17", vertices: ["A", "K", "N"], points: 20, category: "amn_medium" },
|
|
3980
|
+
{ id: "gem_18", vertices: ["A", "M", "N"], points: 30, category: "amn_large" }
|
|
3981
|
+
], Ai = {
|
|
3982
|
+
TOTAL_GEMS: 18,
|
|
3983
|
+
CANVAS_RATIO: 4 / 3,
|
|
3984
|
+
DEFAULT_VIEWBOX: { width: 700, height: 600 },
|
|
3985
|
+
POINT_RADIUS: { default: 6, selected: 9 },
|
|
3986
|
+
TOLERANCE: 1e-3,
|
|
3987
|
+
// 新增:几何计算相关常量
|
|
3988
|
+
MIN_TRIANGLE_AREA: 1e-3,
|
|
3989
|
+
COORDINATE_PRECISION: 1e-4,
|
|
3990
|
+
BARYCENTRIC_TOLERANCE: -1e-3
|
|
3991
|
+
}, Bo = (e = je.id) => {
|
|
3992
|
+
const t = H.units.map((r, i) => {
|
|
3993
|
+
const o = Math.min(100, Math.max(0, i * 15 + Math.random() * 20)), l = Math.floor(r.lessons.length * o / 100), m = r.lessons.map((f, u) => {
|
|
3994
|
+
const h = Math.min(100, Math.max(0, o - u * 10 + Math.random() * 30));
|
|
3995
|
+
return {
|
|
3996
|
+
lessonId: f.id,
|
|
3997
|
+
status: h >= 100 ? "completed" : h > 0 ? "in-progress" : "not-started",
|
|
3998
|
+
progressPercentage: Math.round(h),
|
|
3999
|
+
lastAccessed: h > 0 ? new Date(Date.now() - Math.random() * 7 * 24 * 60 * 60 * 1e3).toISOString() : void 0,
|
|
4000
|
+
timeSpent: h > 0 ? Math.floor(Math.random() * 120 + 10) : void 0,
|
|
4001
|
+
score: h >= 100 ? Math.floor(Math.random() * 21 + 80) : void 0,
|
|
4002
|
+
attempts: h > 0 ? Math.floor(Math.random() * 3 + 1) : void 0
|
|
4003
|
+
};
|
|
4004
|
+
});
|
|
4005
|
+
return {
|
|
4006
|
+
unitId: r.id,
|
|
4007
|
+
userId: e,
|
|
4008
|
+
totalLessons: r.lessons.length,
|
|
4009
|
+
completedLessons: l,
|
|
4010
|
+
progressPercentage: Math.round(o),
|
|
4011
|
+
status: o >= 100 ? "completed" : o > 0 ? "in-progress" : "not-started",
|
|
4012
|
+
lastAccessed: o > 0 ? new Date(Date.now() - Math.random() * 14 * 24 * 60 * 60 * 1e3).toISOString() : void 0,
|
|
4013
|
+
lessons: m
|
|
4014
|
+
};
|
|
4015
|
+
}), n = t.reduce((r, i) => r + i.progressPercentage, 0) / t.length, s = t.filter((r) => r.status === "completed").length;
|
|
4016
|
+
return {
|
|
4017
|
+
courseId: H.id,
|
|
4018
|
+
userId: e,
|
|
4019
|
+
totalUnits: t.length,
|
|
4020
|
+
completedUnits: s,
|
|
4021
|
+
progressPercentage: Math.round(n),
|
|
4022
|
+
status: n >= 100 ? "completed" : n > 0 ? "in-progress" : "not-started",
|
|
4023
|
+
lastAccessed: new Date(Date.now() - Math.random() * 3 * 24 * 60 * 60 * 1e3).toISOString(),
|
|
4024
|
+
units: t
|
|
4025
|
+
};
|
|
4026
|
+
}, qo = Bo(), Un = (e, t) => e === je.id && t === H.id ? qo : null, Wo = (e, t, n) => {
|
|
4027
|
+
const s = Un(e, t);
|
|
4028
|
+
return s && s.units.find((r) => r.unitId === n) || null;
|
|
4029
|
+
}, Ci = (e, t, n, s) => {
|
|
4030
|
+
const r = Wo(e, t, n);
|
|
4031
|
+
return r && r.lessons.find((i) => i.lessonId === s) || null;
|
|
4032
|
+
}, ki = (e, t, n, s, r) => (console.log("Updating lesson progress:", { userId: e, courseId: t, unitId: n, lessonId: s, progress: r }), !0), Pn = (e, t) => {
|
|
4033
|
+
const n = Un(e, t);
|
|
4034
|
+
if (!n) return null;
|
|
4035
|
+
const s = H.units.map((r, i) => {
|
|
4036
|
+
const o = n.units.find((l) => l.unitId === r.id);
|
|
4037
|
+
return {
|
|
4038
|
+
unitId: r.id,
|
|
4039
|
+
title: r.title,
|
|
4040
|
+
description: r.description,
|
|
4041
|
+
moduleCategory: r.moduleCategory,
|
|
4042
|
+
estimatedDuration: r.estimatedDuration,
|
|
4043
|
+
totalLessons: r.lessons.length,
|
|
4044
|
+
completedLessons: o?.completedLessons || 0,
|
|
4045
|
+
progressPercentage: o?.progressPercentage || 0,
|
|
4046
|
+
status: o?.status || "not-started",
|
|
4047
|
+
lastAccessed: o?.lastAccessed,
|
|
4048
|
+
isActive: i === 0,
|
|
4049
|
+
// 默认第一个单元为活跃状态
|
|
4050
|
+
route: `/math/grade-${H.level}/unit/${r.id}`
|
|
4051
|
+
};
|
|
4052
|
+
});
|
|
4053
|
+
return {
|
|
4054
|
+
userId: e,
|
|
4055
|
+
courseId: H.id,
|
|
4056
|
+
courseTitle: H.title,
|
|
4057
|
+
courseLevel: H.level,
|
|
4058
|
+
totalUnits: s.length,
|
|
4059
|
+
completedUnits: s.filter((r) => r.status === "completed").length,
|
|
4060
|
+
overallProgress: n.progressPercentage,
|
|
4061
|
+
status: n.status,
|
|
4062
|
+
lastAccessed: n.lastAccessed,
|
|
4063
|
+
units: s
|
|
4064
|
+
};
|
|
4065
|
+
}, ji = (e, t, n) => {
|
|
4066
|
+
const s = Pn(e, t);
|
|
4067
|
+
return s && s.units.find((r) => r.unitId === n) || null;
|
|
4068
|
+
}, Ni = (e, t, n, s) => (console.log("Updating unit active status:", { userId: e, courseId: t, unitId: n, isActive: s }), !0), Oi = Pn(je.id, H.id), Ti = {
|
|
4069
|
+
userId: je.id,
|
|
4070
|
+
courseId: H.id,
|
|
4071
|
+
courseTitle: H.title,
|
|
4072
|
+
courseLevel: H.level,
|
|
4073
|
+
totalUnits: H.units.length,
|
|
4074
|
+
completedUnits: 3,
|
|
4075
|
+
overallProgress: 45,
|
|
4076
|
+
status: "in-progress",
|
|
4077
|
+
lastAccessed: "2024-01-15T10:30:00Z",
|
|
4078
|
+
units: [
|
|
4079
|
+
{
|
|
4080
|
+
unitId: "unit_1",
|
|
4081
|
+
title: "小数乘法",
|
|
4082
|
+
description: "学习小数乘法的计算方法及应用",
|
|
4083
|
+
moduleCategory: "Arithmetic and Algebra",
|
|
4084
|
+
estimatedDuration: "3周",
|
|
4085
|
+
totalLessons: 10,
|
|
4086
|
+
completedLessons: 8,
|
|
4087
|
+
progressPercentage: 80,
|
|
4088
|
+
status: "completed",
|
|
4089
|
+
lastAccessed: "2024-01-10T14:20:00Z",
|
|
4090
|
+
isActive: !1,
|
|
4091
|
+
route: "/math/grade-5/unit/unit_1",
|
|
4092
|
+
icon: "🔢"
|
|
4093
|
+
},
|
|
4094
|
+
{
|
|
4095
|
+
unitId: "unit_2",
|
|
4096
|
+
title: "小数除法",
|
|
4097
|
+
description: "学习小数除法的计算方法及应用",
|
|
4098
|
+
moduleCategory: "Arithmetic and Algebra",
|
|
4099
|
+
estimatedDuration: "3周",
|
|
4100
|
+
totalLessons: 12,
|
|
4101
|
+
completedLessons: 6,
|
|
4102
|
+
progressPercentage: 50,
|
|
4103
|
+
status: "in-progress",
|
|
4104
|
+
lastAccessed: "2024-01-15T10:30:00Z",
|
|
4105
|
+
isActive: !0,
|
|
4106
|
+
route: "/math/grade-5/unit/unit_2",
|
|
4107
|
+
icon: "➗"
|
|
4108
|
+
},
|
|
4109
|
+
{
|
|
4110
|
+
unitId: "unit_3",
|
|
4111
|
+
title: "简易方程",
|
|
4112
|
+
description: "学习用字母表示数和解简易方程",
|
|
4113
|
+
moduleCategory: "Arithmetic and Algebra",
|
|
4114
|
+
estimatedDuration: "4周",
|
|
4115
|
+
totalLessons: 14,
|
|
4116
|
+
completedLessons: 2,
|
|
4117
|
+
progressPercentage: 14,
|
|
4118
|
+
status: "in-progress",
|
|
4119
|
+
lastAccessed: "2024-01-12T16:45:00Z",
|
|
4120
|
+
isActive: !1,
|
|
4121
|
+
route: "/math/grade-5/unit/unit_3",
|
|
4122
|
+
icon: "📝"
|
|
4123
|
+
},
|
|
4124
|
+
{
|
|
4125
|
+
unitId: "unit_4",
|
|
4126
|
+
title: "多边形的面积",
|
|
4127
|
+
description: "学习平行四边形、三角形、梯形和组合图形的面积计算",
|
|
4128
|
+
moduleCategory: "Graphics and Geometry",
|
|
4129
|
+
estimatedDuration: "3周",
|
|
4130
|
+
totalLessons: 12,
|
|
4131
|
+
completedLessons: 0,
|
|
4132
|
+
progressPercentage: 0,
|
|
4133
|
+
status: "not-started",
|
|
4134
|
+
isActive: !1,
|
|
4135
|
+
route: "/math/grade-5/unit/unit_4",
|
|
4136
|
+
icon: "📐"
|
|
4137
|
+
},
|
|
4138
|
+
{
|
|
4139
|
+
unitId: "unit_5",
|
|
4140
|
+
title: "因数与倍数",
|
|
4141
|
+
description: "学习因数、倍数、质数、合数等概念",
|
|
4142
|
+
moduleCategory: "Arithmetic and Algebra",
|
|
4143
|
+
estimatedDuration: "3周",
|
|
4144
|
+
totalLessons: 10,
|
|
4145
|
+
completedLessons: 0,
|
|
4146
|
+
progressPercentage: 0,
|
|
4147
|
+
status: "not-started",
|
|
4148
|
+
isActive: !1,
|
|
4149
|
+
route: "/math/grade-5/unit/unit_5",
|
|
4150
|
+
icon: "🔢"
|
|
4151
|
+
},
|
|
4152
|
+
{
|
|
4153
|
+
unitId: "unit_6",
|
|
4154
|
+
title: "长方体和正方体",
|
|
4155
|
+
description: "学习长方体和正方体的特征、表面积和体积计算",
|
|
4156
|
+
moduleCategory: "Graphics and Geometry",
|
|
4157
|
+
estimatedDuration: "4周",
|
|
4158
|
+
totalLessons: 14,
|
|
4159
|
+
completedLessons: 0,
|
|
4160
|
+
progressPercentage: 0,
|
|
4161
|
+
status: "not-started",
|
|
4162
|
+
isActive: !1,
|
|
4163
|
+
route: "/math/grade-5/unit/unit_6",
|
|
4164
|
+
icon: "📦"
|
|
4165
|
+
},
|
|
4166
|
+
{
|
|
4167
|
+
unitId: "unit_7",
|
|
4168
|
+
title: "分数的意义和性质",
|
|
4169
|
+
description: "学习分数的意义、性质和约分、通分等方法",
|
|
4170
|
+
moduleCategory: "Arithmetic and Algebra",
|
|
4171
|
+
estimatedDuration: "4周",
|
|
4172
|
+
totalLessons: 16,
|
|
4173
|
+
completedLessons: 0,
|
|
4174
|
+
progressPercentage: 0,
|
|
4175
|
+
status: "not-started",
|
|
4176
|
+
isActive: !1,
|
|
4177
|
+
route: "/math/grade-5/unit/unit_7",
|
|
4178
|
+
icon: "½"
|
|
4179
|
+
},
|
|
4180
|
+
{
|
|
4181
|
+
unitId: "unit_8",
|
|
4182
|
+
title: "分数的加法和减法",
|
|
4183
|
+
description: "学习同分母分数、异分母分数的加法和减法",
|
|
4184
|
+
moduleCategory: "Arithmetic and Algebra",
|
|
4185
|
+
estimatedDuration: "3周",
|
|
4186
|
+
totalLessons: 12,
|
|
4187
|
+
completedLessons: 0,
|
|
4188
|
+
progressPercentage: 0,
|
|
4189
|
+
status: "not-started",
|
|
4190
|
+
isActive: !1,
|
|
4191
|
+
route: "/math/grade-5/unit/unit_8",
|
|
4192
|
+
icon: "➕"
|
|
4193
|
+
},
|
|
4194
|
+
{
|
|
4195
|
+
unitId: "unit_9",
|
|
4196
|
+
title: "折线统计图",
|
|
4197
|
+
description: "学习单式折线统计图和复式折线统计图的认识和制作",
|
|
4198
|
+
moduleCategory: "Probability and Statistics",
|
|
4199
|
+
estimatedDuration: "2周",
|
|
4200
|
+
totalLessons: 6,
|
|
4201
|
+
completedLessons: 0,
|
|
4202
|
+
progressPercentage: 0,
|
|
4203
|
+
status: "not-started",
|
|
4204
|
+
isActive: !1,
|
|
4205
|
+
route: "/math/grade-5/unit/unit_9",
|
|
4206
|
+
icon: "📊"
|
|
4207
|
+
}
|
|
4208
|
+
]
|
|
4209
|
+
};
|
|
2
4210
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
4211
|
+
fi as AbilityAssessmentDashboard,
|
|
4212
|
+
No as AbilityProgressBar,
|
|
4213
|
+
xs as Button,
|
|
4214
|
+
Ls as ContentAccordion,
|
|
4215
|
+
Ai as GEOMETRY_CONFIG,
|
|
4216
|
+
_i as GradeUnitBrowserPage,
|
|
4217
|
+
bi as GradeUnitBrowserProvider,
|
|
4218
|
+
qo as MOCK_USER_COURSE_PROGRESS,
|
|
4219
|
+
Oi as MOCK_USER_GRADE_UNITS_NAV,
|
|
4220
|
+
Ti as MOCK_USER_GRADE_UNITS_PROGRESS,
|
|
4221
|
+
vo as MathWizHeader,
|
|
4222
|
+
Oo as PersonalizedAdvicePanel,
|
|
4223
|
+
Eo as RadarChart,
|
|
4224
|
+
To as RecommendationCard,
|
|
4225
|
+
Ds as Sidebar,
|
|
4226
|
+
an as Submenu,
|
|
4227
|
+
_o as UserProfile,
|
|
4228
|
+
yi as calculateGamePoints,
|
|
4229
|
+
sn as categoryIcons,
|
|
4230
|
+
Ei as comparePointArrays,
|
|
4231
|
+
H as courseData,
|
|
4232
|
+
hi as exploreItems,
|
|
4233
|
+
Bo as generateMockUserCourseProgress,
|
|
4234
|
+
Si as getBasicGemDefinitions,
|
|
4235
|
+
Ri as getBasicLineDefinitions,
|
|
4236
|
+
ji as getUnitNavItem,
|
|
4237
|
+
Un as getUserCourseProgress,
|
|
4238
|
+
Pn as getUserGradeUnitsNav,
|
|
4239
|
+
Ci as getUserLessonProgress,
|
|
4240
|
+
Wo as getUserUnitProgress,
|
|
4241
|
+
wi as isPointInTriangle,
|
|
4242
|
+
re as pointOnLine,
|
|
4243
|
+
pi as statusColors,
|
|
4244
|
+
mi as statusMapping,
|
|
4245
|
+
xi as toPixelCoordinates,
|
|
4246
|
+
vi as trianglesMatch,
|
|
4247
|
+
Ni as updateUnitActiveStatus,
|
|
4248
|
+
ki as updateUserLessonProgress,
|
|
4249
|
+
$o as useGradeUnitBrowser,
|
|
4250
|
+
gi as userData
|
|
43
4251
|
};
|
|
44
4252
|
//# sourceMappingURL=index.mjs.map
|