xto-fronted 0.4.91 → 0.4.92

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.
Files changed (87) hide show
  1. package/dist/App.vue.d.ts +2 -0
  2. package/dist/api/auth.d.ts +8 -0
  3. package/dist/api/system.d.ts +16 -0
  4. package/dist/api/user.d.ts +13 -0
  5. package/dist/components/Layout/Footer.vue.d.ts +2 -0
  6. package/dist/components/Layout/Header.vue.d.ts +5 -0
  7. package/dist/components/Layout/MixTopMenu.vue.d.ts +5 -0
  8. package/dist/components/Layout/Sidebar.vue.d.ts +11 -0
  9. package/dist/components/Layout/SidebarMenuItem.vue.d.ts +5 -0
  10. package/dist/components/Layout/Tabs.vue.d.ts +2 -0
  11. package/dist/components/Layout/TopMenu.vue.d.ts +5 -0
  12. package/dist/components/Layout/index.vue.d.ts +2 -0
  13. package/dist/composables/useApp.d.ts +29 -0
  14. package/dist/composables/useAuth.d.ts +6 -0
  15. package/dist/composables/useForm.d.ts +20 -0
  16. package/dist/composables/useI18n.d.ts +30 -0
  17. package/dist/composables/useTable.d.ts +29 -0
  18. package/dist/directives/permission.d.ts +4 -0
  19. package/dist/enums/index.d.ts +32 -0
  20. package/dist/index--qRfsJ32.js +4267 -0
  21. package/dist/index-CsjBlLrl.js +479 -0
  22. package/dist/index-CvYIvRSW.js +515 -0
  23. package/dist/index-DAPLMrmP.js +189 -0
  24. package/dist/index-DjkSMw-x.js +641 -0
  25. package/dist/index.d.ts +59 -0
  26. package/dist/index.es.js +95 -0
  27. package/dist/index.umd.js +8 -0
  28. package/dist/main.d.ts +0 -0
  29. package/dist/router/dynamicRoutes.d.ts +30 -0
  30. package/dist/router/guards.d.ts +17 -0
  31. package/dist/router/index.d.ts +6 -0
  32. package/dist/router/layoutRoute.d.ts +22 -0
  33. package/dist/router/staticRoutes.d.ts +2 -0
  34. package/dist/stores/app.d.ts +93 -0
  35. package/dist/stores/auth.d.ts +41 -0
  36. package/dist/stores/index.d.ts +10 -0
  37. package/dist/stores/locale.d.ts +42 -0
  38. package/dist/stores/menu.d.ts +83 -0
  39. package/dist/stores/user.d.ts +92 -0
  40. package/dist/style.css +1 -0
  41. package/dist/utils/auth.d.ts +27 -0
  42. package/dist/utils/config.d.ts +30 -0
  43. package/dist/utils/permission.d.ts +17 -0
  44. package/dist/utils/request.d.ts +29 -0
  45. package/dist/utils/storage.d.ts +24 -0
  46. package/dist/views/dashboard/index.vue.d.ts +2 -0
  47. package/dist/views/error/403.vue.d.ts +2 -0
  48. package/dist/views/error/404.vue.d.ts +2 -0
  49. package/dist/views/login/index.vue.d.ts +4 -0
  50. package/dist/views/system/menu/index.vue.d.ts +4 -0
  51. package/dist/views/system/role/index.vue.d.ts +4 -0
  52. package/dist/views/system/user/index.vue.d.ts +4 -0
  53. package/package.json +1 -1
  54. package/dist/assets/404-Bq0LY5Cd.js +0 -1
  55. package/dist/assets/404-Cw_4ZCL6.css +0 -1
  56. package/dist/assets/_plugin-vue_export-helper-DlAUqK2U.js +0 -1
  57. package/dist/assets/index-7ZZxpSfk.js +0 -1
  58. package/dist/assets/index-BJUe8VUp.js +0 -1
  59. package/dist/assets/index-BRR97dc6.js +0 -1
  60. package/dist/assets/index-BlOR_ICg.js +0 -1
  61. package/dist/assets/index-BlRslYYI.css +0 -1
  62. package/dist/assets/index-BudArKxR.css +0 -1
  63. package/dist/assets/index-BzbOWBCV.js +0 -1
  64. package/dist/assets/index-CFhWBbxk.css +0 -1
  65. package/dist/assets/index-CH6aTfYg.css +0 -1
  66. package/dist/assets/index-CT5f37nN.js +0 -1
  67. package/dist/assets/index-Ce-kjtEM.js +0 -2
  68. package/dist/assets/index-Cpew6d-v.css +0 -1
  69. package/dist/assets/index-DkkuYBgT.css +0 -1
  70. package/dist/assets/index-vfvEFrCH.css +0 -1
  71. package/dist/assets/index-wVLLAoVp.js +0 -1
  72. package/dist/assets/vendor-DZmPBJ9d.js +0 -16
  73. package/dist/assets/vue-vendor-DjmFuEnG.js +0 -29
  74. package/dist/assets/xto-base-B5HYOo6i.js +0 -1
  75. package/dist/assets/xto-base-CL2NKZJJ.css +0 -1
  76. package/dist/assets/xto-business--V1F5Gwb.css +0 -1
  77. package/dist/assets/xto-core-DZYp_YAR.js +0 -1
  78. package/dist/assets/xto-data-MxZsiJgi.css +0 -1
  79. package/dist/assets/xto-data-ogck6x_i.js +0 -1
  80. package/dist/assets/xto-feedback-Bxx38c3P.css +0 -1
  81. package/dist/assets/xto-feedback-C0-6cAL6.js +0 -1
  82. package/dist/assets/xto-form-Cu6q3VLG.css +0 -1
  83. package/dist/assets/xto-form-IDg_78Vf.js +0 -1
  84. package/dist/assets/xto-layout-BDD6sSlM.css +0 -1
  85. package/dist/assets/xto-navigation-CPYLzfu7.js +0 -1
  86. package/dist/assets/xto-navigation-XfpyMpEo.css +0 -1
  87. package/dist/index.html +0 -28
@@ -0,0 +1,4267 @@
1
+ import { ref as P, computed as j, watch as Xe, defineComponent as Ae, resolveComponent as Rt, openBlock as w, createBlock as ce, unref as y, withCtx as X, createElementBlock as E, Fragment as he, renderList as ge, createElementVNode as s, toDisplayString as G, createCommentVNode as le, normalizeClass as _e, withDirectives as lt, vShow as ts, createVNode as R, createTextVNode as Fe, onMounted as wt, onUnmounted as yt, vModelText as bt, Transition as Ve, withModifiers as it, normalizeStyle as Ye, reactive as kt, createStaticVNode as nt, withKeys as ss } from "vue";
2
+ import { defineStore as Je } from "pinia";
3
+ import { useRoute as qe, useRouter as ze, createRouter as xt, createWebHistory as Ct } from "vue-router";
4
+ import { SubMenu as _t, MenuItem as He, Menu as Nt, Tabs as ns, TabPane as os } from "@xto/navigation";
5
+ import { Icon as Z, Button as je } from "@xto/base";
6
+ import { Drawer as Et, Message as Ie } from "@xto/feedback";
7
+ import { Form as rs, FormItem as mt, Input as Ut, Checkbox as as } from "@xto/form";
8
+ import ls from "axios";
9
+ import { createLocaleProvider as is, getSupportedLocales as cs, useLocale as us } from "@xto/core/locale";
10
+ const ot = P(""), rt = P(""), at = P("");
11
+ function ds(o) {
12
+ o.appId && (ot.value = o.appId), o.clientId && (rt.value = o.clientId), o.apiBaseUrl && (at.value = o.apiBaseUrl);
13
+ }
14
+ function ct() {
15
+ if (ot.value)
16
+ return ot.value;
17
+ try {
18
+ return "";
19
+ } catch {
20
+ return "";
21
+ }
22
+ }
23
+ function zt() {
24
+ if (rt.value)
25
+ return rt.value;
26
+ try {
27
+ return "";
28
+ } catch {
29
+ return "";
30
+ }
31
+ }
32
+ function fs() {
33
+ if (at.value)
34
+ return at.value;
35
+ try {
36
+ return "";
37
+ } catch {
38
+ return "";
39
+ }
40
+ }
41
+ const qa = {
42
+ appId: ot,
43
+ clientId: rt,
44
+ apiBaseUrl: at
45
+ }, Ke = "xto_", Dt = (o) => ({
46
+ get(i) {
47
+ const v = o.getItem(Ke + i);
48
+ if (!v) return null;
49
+ try {
50
+ return JSON.parse(v);
51
+ } catch {
52
+ return v;
53
+ }
54
+ },
55
+ set(i, v) {
56
+ if (v == null) {
57
+ o.removeItem(Ke + i);
58
+ return;
59
+ }
60
+ const m = typeof v == "string" ? v : JSON.stringify(v);
61
+ o.setItem(Ke + i, m);
62
+ },
63
+ remove(i) {
64
+ o.removeItem(Ke + i);
65
+ },
66
+ clear() {
67
+ Object.keys(o).forEach((v) => {
68
+ v.startsWith(Ke) && o.removeItem(v);
69
+ });
70
+ }
71
+ }), et = Dt(window.localStorage), tt = Dt(window.sessionStorage), q = {
72
+ get: et.get,
73
+ set: et.set,
74
+ remove: et.remove,
75
+ clear: et.clear
76
+ }, Ga = {
77
+ get: tt.get,
78
+ set: tt.set,
79
+ remove: tt.remove,
80
+ clear: tt.clear
81
+ }, De = Je("app", () => {
82
+ const o = P(q.get("appName") || "XTO App"), i = P(q.get("indexPath") || "/dashboard"), v = P(q.get("isDark") || !1), m = P(q.get("theme") || "light"), f = P(q.get("layout") || "sidebar"), k = P(q.get("isCollapsed") || !1), S = P(q.get("showTabs") ?? !0), g = P(q.get("showFooter") ?? !0), M = P(q.get("showBreadcrumb") ?? !0), _ = P(q.get("primaryColor") || "#409eff"), x = P([]), L = P([]), C = j(() => v.value ? "dark" : "light"), K = (D) => {
83
+ o.value = D, q.set("appName", D);
84
+ }, Q = (D) => {
85
+ i.value = D, q.set("indexPath", D);
86
+ }, O = () => {
87
+ v.value = !v.value, m.value = v.value ? "dark" : "light", V();
88
+ }, T = (D) => {
89
+ m.value = D, v.value = D === "dark", V();
90
+ }, V = () => {
91
+ const D = document.documentElement;
92
+ v.value ? D.classList.add("dark") : D.classList.remove("dark"), q.set("isDark", v.value), q.set("theme", m.value);
93
+ }, I = () => {
94
+ k.value = !k.value, q.set("isCollapsed", k.value);
95
+ }, W = (D) => {
96
+ f.value = D, q.set("layout", D);
97
+ }, Y = () => {
98
+ S.value = !S.value, q.set("showTabs", S.value);
99
+ }, oe = () => {
100
+ g.value = !g.value, q.set("showFooter", g.value);
101
+ }, U = () => {
102
+ M.value = !M.value, q.set("showBreadcrumb", M.value);
103
+ }, A = (D) => {
104
+ _.value = D, document.documentElement.style.setProperty("--color-primary", D), q.set("primaryColor", D);
105
+ }, J = (D) => {
106
+ x.value.includes(D) || x.value.push(D);
107
+ }, ee = (D) => {
108
+ const ie = x.value.indexOf(D);
109
+ ie > -1 && x.value.splice(ie, 1);
110
+ }, $ = () => {
111
+ x.value = [];
112
+ }, re = (D) => {
113
+ L.value = D;
114
+ }, te = () => {
115
+ V(), _.value !== "#409eff" && document.documentElement.style.setProperty("--color-primary", _.value);
116
+ };
117
+ return Xe(v, V), {
118
+ appName: o,
119
+ indexPath: i,
120
+ isDark: v,
121
+ theme: m,
122
+ layout: f,
123
+ isCollapsed: k,
124
+ showTabs: S,
125
+ showFooter: g,
126
+ showBreadcrumb: M,
127
+ primaryColor: _,
128
+ cachedViews: x,
129
+ mixSubMenus: L,
130
+ themeClass: C,
131
+ setAppName: K,
132
+ setIndexPath: Q,
133
+ toggleTheme: O,
134
+ toggleCollapse: I,
135
+ setTheme: T,
136
+ setLayout: W,
137
+ toggleTabs: Y,
138
+ toggleFooter: oe,
139
+ toggleBreadcrumb: U,
140
+ setPrimaryColor: A,
141
+ addCachedView: J,
142
+ removeCachedView: ee,
143
+ clearCachedViews: $,
144
+ setMixSubMenus: re,
145
+ initTheme: te
146
+ };
147
+ }), ht = "menu_list", vt = "permission_list", ps = {
148
+ menuCode: "home",
149
+ menuName: "首页",
150
+ menuUrl: "/dashboard",
151
+ icon: "home",
152
+ closable: !1,
153
+ isDefault: !1,
154
+ isOut: !1
155
+ };
156
+ function Ft(o) {
157
+ return o.filter((i) => i.type !== 1).map((i) => ({
158
+ ...i,
159
+ children: i.children ? Ft(i.children) : void 0
160
+ }));
161
+ }
162
+ function ms(o) {
163
+ const i = [];
164
+ function v(m) {
165
+ m.forEach((f) => {
166
+ f.type === 1 && f.menuCode && i.push(f.menuCode), f.children && v(f.children);
167
+ });
168
+ }
169
+ return v(o), i;
170
+ }
171
+ const Pe = Je("menu", () => {
172
+ const o = P(q.get(ht) || []), i = P(q.get(vt) || []), v = j(() => o.value.length > 0);
173
+ return {
174
+ menuList: o,
175
+ permissions: i,
176
+ hasMenu: v,
177
+ setMenuList: (S) => {
178
+ i.value = ms(S), q.set(vt, i.value);
179
+ const g = Ft(S);
180
+ o.value = [ps, ...g], q.set(ht, o.value);
181
+ },
182
+ clearMenu: () => {
183
+ o.value = [], i.value = [], q.remove(ht), q.remove(vt);
184
+ },
185
+ hasPermission: (S) => Array.isArray(S) ? S.some((g) => i.value.includes(g)) : i.value.includes(S)
186
+ };
187
+ }), St = "/vite.svg", gt = "user_info", Se = Je("user", () => {
188
+ const o = P(q.get(gt)), i = j(() => !!o.value), v = j(() => {
189
+ var L;
190
+ return ((L = o.value) == null ? void 0 : L.userId) || "";
191
+ }), m = j(() => {
192
+ var L;
193
+ return ((L = o.value) == null ? void 0 : L.userName) || "";
194
+ }), f = j(() => {
195
+ var L;
196
+ return ((L = o.value) == null ? void 0 : L.departmentName) || "";
197
+ }), k = j(() => {
198
+ var L;
199
+ return ((L = o.value) == null ? void 0 : L.email) || "";
200
+ }), S = j(() => {
201
+ var L;
202
+ return ((L = o.value) == null ? void 0 : L.mobilePhone) || "";
203
+ }), g = j(() => {
204
+ var L;
205
+ return ((L = o.value) == null ? void 0 : L.positionName) || "";
206
+ }), M = j(() => {
207
+ var L;
208
+ return ((L = o.value) == null ? void 0 : L.avatar) || "";
209
+ });
210
+ return {
211
+ userInfo: o,
212
+ isLoggedIn: i,
213
+ userId: v,
214
+ userName: m,
215
+ departmentName: f,
216
+ email: k,
217
+ mobilePhone: S,
218
+ positionName: g,
219
+ avatar: M,
220
+ setUserInfo: (L) => {
221
+ o.value = L, q.set(gt, L);
222
+ },
223
+ clearUserInfo: () => {
224
+ o.value = null, q.remove(gt);
225
+ }
226
+ };
227
+ }), $t = "token", Mt = "token_type", Lt = "refresh_token", It = "expires_time", At = "refresh_time", Tt = "code", ut = () => q.get($t), hs = (o) => {
228
+ q.set($t, o);
229
+ }, vs = () => q.get(Mt), gs = (o) => {
230
+ q.set(Mt, o);
231
+ }, Ka = () => q.get(Lt), _s = (o) => {
232
+ q.set(Lt, o);
233
+ }, ws = () => q.get(It), ys = (o) => {
234
+ q.set(It, o);
235
+ }, Ha = () => q.get(At), bs = (o) => {
236
+ q.set(At, o);
237
+ }, Wa = () => q.get(Tt), ks = (o) => {
238
+ q.set(Tt, o);
239
+ }, Vt = (o) => {
240
+ hs(o.access_token), gs(o.token_type || "Bearer"), _s(o.refresh_token), ys(o.expires_time), bs(o.refresh_time), o.code && ks(o.code);
241
+ }, We = () => {
242
+ q.remove($t), q.remove(Mt), q.remove(Lt), q.remove(It), q.remove(At), q.remove(Tt);
243
+ }, xs = () => {
244
+ const o = ws();
245
+ return o ? Date.now() > o : !0;
246
+ }, jt = () => !!ut() && !xs(), Ze = Je("auth", () => {
247
+ const o = P(ut()), i = j(() => jt()), v = P(""), m = P(""), f = P(""), k = P("/login");
248
+ return {
249
+ token: o,
250
+ isLoggedIn: i,
251
+ baseUrl: v,
252
+ appId: m,
253
+ clientId: f,
254
+ loginPath: k,
255
+ login: (C) => {
256
+ o.value = C.access_token, Vt(C);
257
+ },
258
+ logout: () => {
259
+ o.value = null, We();
260
+ },
261
+ setBaseUrl: (C) => {
262
+ v.value = C;
263
+ },
264
+ setAppId: (C) => {
265
+ m.value = C;
266
+ },
267
+ setClientId: (C) => {
268
+ f.value = C;
269
+ },
270
+ setLoginPath: (C) => {
271
+ k.value = C;
272
+ }
273
+ };
274
+ }), Cs = { class: "menu-item__content" }, Ns = { class: "menu-item__icon" }, Es = {
275
+ key: 1,
276
+ class: "menu-item__char"
277
+ }, Ss = { class: "menu-item__text" }, $s = { class: "menu-item__content" }, Ms = {
278
+ key: 0,
279
+ class: "menu-item__icon"
280
+ }, Ls = {
281
+ key: 1,
282
+ class: "menu-item__char"
283
+ }, Is = { class: "menu-item__text" }, As = /* @__PURE__ */ Ae({
284
+ __name: "SidebarMenuItem",
285
+ props: {
286
+ menu: {}
287
+ },
288
+ setup(o) {
289
+ const i = o, v = /* @__PURE__ */ new Set([
290
+ "arrow-up",
291
+ "arrow-down",
292
+ "arrow-left",
293
+ "arrow-right",
294
+ "caret-down",
295
+ "caret-right",
296
+ "plus",
297
+ "minus",
298
+ "close",
299
+ "check",
300
+ "edit",
301
+ "delete",
302
+ "copy",
303
+ "download",
304
+ "upload",
305
+ "refresh",
306
+ "search",
307
+ "filter",
308
+ "more",
309
+ "setting",
310
+ "share",
311
+ "loading",
312
+ "info",
313
+ "success",
314
+ "warning",
315
+ "error",
316
+ "question",
317
+ "user",
318
+ "user-add",
319
+ "user-group",
320
+ "logout",
321
+ "login",
322
+ "file",
323
+ "folder",
324
+ "folder-open",
325
+ "document",
326
+ "image",
327
+ "video",
328
+ "music",
329
+ "camera",
330
+ "mail",
331
+ "phone",
332
+ "chat",
333
+ "bell",
334
+ "message",
335
+ "eye",
336
+ "eye-off",
337
+ "calendar",
338
+ "clock",
339
+ "history",
340
+ "timer",
341
+ "location",
342
+ "map",
343
+ "globe",
344
+ "star",
345
+ "heart",
346
+ "thumb-up",
347
+ "link",
348
+ "external-link",
349
+ "lock",
350
+ "unlock",
351
+ "key",
352
+ "home",
353
+ "menu",
354
+ "menu-fold",
355
+ "menu-unfold",
356
+ "sidebar-fold",
357
+ "sidebar-expand",
358
+ "sidebar-left",
359
+ "dashboard",
360
+ "chart",
361
+ "chart-pie",
362
+ "chart-line",
363
+ "report",
364
+ "analytics",
365
+ "system",
366
+ "permission",
367
+ "role",
368
+ "user-manage",
369
+ "log",
370
+ "notification",
371
+ "app",
372
+ "list",
373
+ "grid",
374
+ "fullscreen",
375
+ "fullscreen-exit",
376
+ "zoom-in",
377
+ "zoom-out",
378
+ "print",
379
+ "bookmark",
380
+ "tag",
381
+ "code",
382
+ "terminal",
383
+ "database",
384
+ "server",
385
+ "cloud",
386
+ "gift",
387
+ "moon",
388
+ "sun",
389
+ "theme",
390
+ "skin"
391
+ ]), m = (g) => {
392
+ if (!g || g === "") return "";
393
+ if (g.startsWith("tineco-icon-")) {
394
+ const _ = g.replace("tineco-icon-", "");
395
+ return {
396
+ home: "home",
397
+ dashboard: "dashboard",
398
+ system: "system",
399
+ user: "user",
400
+ role: "role",
401
+ menu: "list",
402
+ setting: "setting",
403
+ file: "file",
404
+ folder: "folder",
405
+ chart: "chart",
406
+ report: "report",
407
+ analytics: "analytics"
408
+ }[_] || _;
409
+ }
410
+ return {
411
+ dashboard: "dashboard",
412
+ system: "system",
413
+ user: "user",
414
+ role: "role",
415
+ menu: "list",
416
+ setting: "setting",
417
+ home: "home",
418
+ chart: "chart",
419
+ report: "report",
420
+ analytics: "analytics",
421
+ permission: "permission",
422
+ log: "log",
423
+ notification: "notification",
424
+ app: "app",
425
+ list: "list",
426
+ grid: "grid"
427
+ }[g] || g;
428
+ }, f = (g) => g ? g.charAt(0) : "", k = (g) => v.has(g), S = j(() => i.menu.children && i.menu.children.length > 0);
429
+ return (g, M) => {
430
+ const _ = Rt("SidebarMenuItem", !0);
431
+ return S.value ? (w(), ce(y(_t), {
432
+ key: 0,
433
+ index: o.menu.menuUrl
434
+ }, {
435
+ title: X(() => [
436
+ s("span", Cs, [
437
+ s("span", Ns, [
438
+ k(m(o.menu.icon)) ? (w(), ce(y(Z), {
439
+ key: 0,
440
+ name: m(o.menu.icon),
441
+ size: 16
442
+ }, null, 8, ["name"])) : (w(), E("span", Es, G(f(o.menu.menuName)), 1))
443
+ ]),
444
+ s("span", Ss, G(o.menu.menuName), 1)
445
+ ])
446
+ ]),
447
+ default: X(() => [
448
+ (w(!0), E(he, null, ge(o.menu.children, (x) => (w(), ce(_, {
449
+ key: x.menuUrl,
450
+ menu: x
451
+ }, null, 8, ["menu"]))), 128))
452
+ ]),
453
+ _: 1
454
+ }, 8, ["index"])) : (w(), ce(y(He), {
455
+ key: 1,
456
+ index: o.menu.menuUrl
457
+ }, {
458
+ default: X(() => [
459
+ s("span", $s, [
460
+ o.menu.menuName !== "首页" ? (w(), E("span", Ms, [
461
+ k(m(o.menu.icon)) ? (w(), ce(y(Z), {
462
+ key: 0,
463
+ name: m(o.menu.icon),
464
+ size: 16
465
+ }, null, 8, ["name"])) : (w(), E("span", Ls, G(f(o.menu.menuName)), 1))
466
+ ])) : le("", !0),
467
+ s("span", Is, G(o.menu.menuName), 1)
468
+ ])
469
+ ]),
470
+ _: 1
471
+ }, 8, ["index"]));
472
+ };
473
+ }
474
+ }), $e = (o, i) => {
475
+ const v = o.__vccOpts || o;
476
+ for (const [m, f] of i)
477
+ v[m] = f;
478
+ return v;
479
+ }, Ts = /* @__PURE__ */ $e(As, [["__scopeId", "data-v-d160ae6a"]]), Os = {
480
+ key: 0,
481
+ class: "sidebar__logo"
482
+ }, Us = {
483
+ key: 1,
484
+ class: "sidebar__user"
485
+ }, Bs = { class: "sidebar__user-info" }, Ps = { class: "sidebar__user-name" }, Rs = { class: "sidebar__user-role" }, Bt = "sidebar_opened_menus", zs = /* @__PURE__ */ Ae({
486
+ __name: "Sidebar",
487
+ props: {
488
+ menuList: { default: () => [] },
489
+ showLogo: { type: Boolean, default: !0 },
490
+ showUser: { type: Boolean, default: !0 }
491
+ },
492
+ setup(o) {
493
+ const i = o, v = qe(), m = ze(), f = Pe(), k = Se(), S = Ze(), g = De(), M = j(() => i.menuList.length > 0 ? i.menuList : f.menuList), _ = j(() => g.isCollapsed), x = j(() => v.path), L = P(q.get(Bt) || []);
494
+ Xe(L, (I) => {
495
+ q.set(Bt, I);
496
+ }, { deep: !0 });
497
+ const C = (I, W, Y = []) => {
498
+ var oe;
499
+ for (const U of I) {
500
+ if (W === U.menuUrl || W.startsWith(U.menuUrl + "/"))
501
+ return [...Y, U.menuUrl];
502
+ if ((oe = U.children) != null && oe.length) {
503
+ const A = C(U.children, W, [...Y, U.menuUrl]);
504
+ if (A) return A;
505
+ }
506
+ }
507
+ return null;
508
+ };
509
+ Xe([() => v.path, M], ([I, W]) => {
510
+ if (W.length > 0) {
511
+ const Y = C(W, I);
512
+ Y ? L.value = Y.slice(0, -1) : L.value = [];
513
+ }
514
+ }, { immediate: !0 });
515
+ const K = j(() => g.isDark ? "#1d1e1f" : "#fff"), Q = j(() => g.isDark ? "#cfd3dc" : "#303133"), O = j(() => "#409eff"), T = (I) => {
516
+ I && I !== v.path && m.push(I);
517
+ }, V = () => {
518
+ S.logout(), k.clearUserInfo(), f.clearMenu(), m.push("/login");
519
+ };
520
+ return (I, W) => (w(), E("div", {
521
+ class: _e(["sidebar", { "sidebar--collapsed": _.value }])
522
+ }, [
523
+ i.showLogo ? (w(), E("div", Os, [
524
+ W[2] || (W[2] = s("img", {
525
+ src: St,
526
+ alt: "Logo",
527
+ class: "sidebar__logo-img"
528
+ }, null, -1)),
529
+ lt(s("span", { class: "sidebar__logo-text" }, G(y(g).appName), 513), [
530
+ [ts, !_.value]
531
+ ])
532
+ ])) : le("", !0),
533
+ R(y(Nt), {
534
+ modelValue: x.value,
535
+ "onUpdate:modelValue": W[0] || (W[0] = (Y) => x.value = Y),
536
+ openeds: L.value,
537
+ "onUpdate:openeds": W[1] || (W[1] = (Y) => L.value = Y),
538
+ mode: "vertical",
539
+ collapse: _.value,
540
+ "collapse-transition": !1,
541
+ "background-color": K.value,
542
+ "text-color": Q.value,
543
+ "active-text-color": O.value,
544
+ class: "sidebar__menu",
545
+ onSelect: T
546
+ }, {
547
+ default: X(() => [
548
+ (w(!0), E(he, null, ge(M.value, (Y) => (w(), ce(Ts, {
549
+ key: Y.menuUrl,
550
+ menu: Y
551
+ }, null, 8, ["menu"]))), 128))
552
+ ]),
553
+ _: 1
554
+ }, 8, ["modelValue", "openeds", "collapse", "background-color", "text-color", "active-text-color"]),
555
+ i.showUser && !_.value ? (w(), E("div", Us, [
556
+ s("div", Bs, [
557
+ s("span", Ps, G(y(k).userName), 1),
558
+ s("span", Rs, G(y(k).departmentName), 1)
559
+ ]),
560
+ R(y(je), {
561
+ type: "text",
562
+ size: "small",
563
+ onClick: V
564
+ }, {
565
+ default: X(() => [...W[3] || (W[3] = [
566
+ Fe("退出", -1)
567
+ ])]),
568
+ _: 1
569
+ })
570
+ ])) : le("", !0)
571
+ ], 2));
572
+ }
573
+ }), Pt = /* @__PURE__ */ $e(zs, [["__scopeId", "data-v-50c184da"]]), Ds = { class: "header" }, Fs = { class: "header__left" }, Vs = {
574
+ key: 0,
575
+ class: "header__breadcrumb"
576
+ }, js = {
577
+ key: 0,
578
+ class: "breadcrumb-separator"
579
+ }, qs = { class: "header__right" }, Gs = {
580
+ key: 0,
581
+ class: "header__search-dropdown"
582
+ }, Ks = {
583
+ key: 0,
584
+ class: "header__search-results"
585
+ }, Hs = ["onClick"], Ws = {
586
+ key: 0,
587
+ class: "header__search-icon"
588
+ }, Xs = {
589
+ key: 1,
590
+ class: "header__search-char"
591
+ }, Ys = { class: "header__search-item-title" }, Js = {
592
+ key: 1,
593
+ class: "header__search-item-parent"
594
+ }, Zs = {
595
+ key: 1,
596
+ class: "header__search-empty"
597
+ }, Qs = ["title"], en = { class: "header__avatar" }, tn = { class: "header__user-name" }, sn = {
598
+ key: 0,
599
+ class: "header__dropdown"
600
+ }, nn = { class: "header__dropdown-header" }, on = { class: "header__dropdown-avatar" }, rn = { class: "header__dropdown-info" }, an = { class: "header__dropdown-name" }, ln = { class: "header__dropdown-role" }, cn = { class: "header__dropdown-menu" }, un = { class: "settings-drawer" }, dn = { class: "settings-section" }, fn = { class: "settings-layout-options" }, pn = ["onClick"], mn = { class: "layout-option__preview" }, hn = {
601
+ key: 0,
602
+ class: "layout-preview-sidebar"
603
+ }, vn = {
604
+ key: 1,
605
+ class: "layout-preview-top"
606
+ }, gn = {
607
+ key: 2,
608
+ class: "layout-preview-mix"
609
+ }, _n = { class: "layout-option__label" }, wn = { class: "settings-section" }, yn = { class: "settings-color-options" }, bn = ["title", "onClick"], kn = { class: "settings-section" }, xn = { class: "settings-switch-list" }, Cn = { class: "settings-switch-item" }, Nn = { class: "settings-switch-item" }, En = /* @__PURE__ */ Ae({
610
+ __name: "Header",
611
+ setup(o) {
612
+ const i = qe(), v = ze(), m = De(), f = Se(), k = Ze(), S = Pe(), g = P(!1), M = P(!1), _ = P(null), x = P(!1), L = P(!1), C = P(""), K = P(null), Q = P(!1), O = [
613
+ { value: "sidebar", label: "左侧菜单", icon: "sidebar-left" },
614
+ { value: "top", label: "顶部菜单", icon: "menu" },
615
+ { value: "mix", label: "混合菜单", icon: "grid" }
616
+ ], T = [
617
+ { value: "#409eff", label: "默认蓝" },
618
+ { value: "#1890ff", label: "科技蓝" },
619
+ { value: "#52c41a", label: "极光绿" },
620
+ { value: "#faad14", label: "日落橙" },
621
+ { value: "#f5222d", label: "薄暮红" },
622
+ { value: "#722ed1", label: "酱紫" }
623
+ ], V = j(() => i.matched.filter((B) => B.meta && B.meta.title).map((B) => ({
624
+ title: B.meta.title,
625
+ path: B.path
626
+ }))), I = (H, B = "") => {
627
+ const t = [];
628
+ return H.forEach((e) => {
629
+ e.children && e.children.length > 0 ? t.push(...I(e.children, e.menuName)) : t.push({ ...e, parentTitle: B, title: e.menuName, path: e.menuUrl });
630
+ }), t;
631
+ }, W = /* @__PURE__ */ new Set([
632
+ "arrow-up",
633
+ "arrow-down",
634
+ "arrow-left",
635
+ "arrow-right",
636
+ "caret-down",
637
+ "caret-right",
638
+ "plus",
639
+ "minus",
640
+ "close",
641
+ "check",
642
+ "edit",
643
+ "delete",
644
+ "copy",
645
+ "download",
646
+ "upload",
647
+ "refresh",
648
+ "search",
649
+ "filter",
650
+ "more",
651
+ "setting",
652
+ "share",
653
+ "loading",
654
+ "info",
655
+ "success",
656
+ "warning",
657
+ "error",
658
+ "question",
659
+ "user",
660
+ "user-add",
661
+ "user-group",
662
+ "logout",
663
+ "login",
664
+ "file",
665
+ "folder",
666
+ "folder-open",
667
+ "document",
668
+ "image",
669
+ "video",
670
+ "music",
671
+ "camera",
672
+ "mail",
673
+ "phone",
674
+ "chat",
675
+ "bell",
676
+ "message",
677
+ "eye",
678
+ "eye-off",
679
+ "calendar",
680
+ "clock",
681
+ "history",
682
+ "timer",
683
+ "location",
684
+ "map",
685
+ "globe",
686
+ "star",
687
+ "heart",
688
+ "thumb-up",
689
+ "link",
690
+ "external-link",
691
+ "lock",
692
+ "unlock",
693
+ "key",
694
+ "home",
695
+ "menu",
696
+ "menu-fold",
697
+ "menu-unfold",
698
+ "sidebar-fold",
699
+ "sidebar-expand",
700
+ "sidebar-left",
701
+ "dashboard",
702
+ "chart",
703
+ "chart-pie",
704
+ "chart-line",
705
+ "report",
706
+ "analytics",
707
+ "system",
708
+ "permission",
709
+ "role",
710
+ "user-manage",
711
+ "log",
712
+ "notification",
713
+ "app",
714
+ "list",
715
+ "grid",
716
+ "fullscreen",
717
+ "fullscreen-exit",
718
+ "zoom-in",
719
+ "zoom-out",
720
+ "print",
721
+ "bookmark",
722
+ "tag",
723
+ "code",
724
+ "terminal",
725
+ "database",
726
+ "server",
727
+ "cloud",
728
+ "gift",
729
+ "moon",
730
+ "sun",
731
+ "theme",
732
+ "skin"
733
+ ]), Y = (H) => {
734
+ if (!H || H === "") return "";
735
+ if (H.startsWith("tineco-icon-")) {
736
+ const t = H.replace("tineco-icon-", "");
737
+ return {
738
+ home: "home",
739
+ dashboard: "dashboard",
740
+ system: "system",
741
+ user: "user",
742
+ role: "role",
743
+ menu: "list",
744
+ setting: "setting",
745
+ file: "file",
746
+ folder: "folder",
747
+ chart: "chart",
748
+ report: "report",
749
+ analytics: "analytics"
750
+ }[t] || t;
751
+ }
752
+ return {
753
+ dashboard: "dashboard",
754
+ system: "system",
755
+ user: "user",
756
+ role: "role",
757
+ menu: "list",
758
+ setting: "setting",
759
+ home: "home",
760
+ chart: "chart",
761
+ report: "report",
762
+ analytics: "analytics",
763
+ permission: "permission",
764
+ log: "log",
765
+ notification: "notification",
766
+ app: "app",
767
+ list: "list",
768
+ grid: "grid"
769
+ }[H] || H;
770
+ }, oe = (H) => H ? H.charAt(0) : "", U = (H) => W.has(H), A = j(() => C.value.trim() ? I(S.menuList).filter(
771
+ (B) => B.title.toLowerCase().includes(C.value.toLowerCase())
772
+ ) : []), J = j(() => m.layout), ee = () => {
773
+ m.toggleCollapse();
774
+ }, $ = () => {
775
+ m.toggleTheme();
776
+ }, re = () => {
777
+ M.value = !0;
778
+ }, te = (H) => {
779
+ m.setLayout(H), M.value = !1;
780
+ }, D = (H) => {
781
+ Q.value = H;
782
+ const B = document.documentElement;
783
+ H ? B.classList.add("grey-mode") : B.classList.remove("grey-mode");
784
+ }, ie = () => {
785
+ D(!Q.value), M.value = !1;
786
+ }, de = () => {
787
+ m.toggleTheme(), M.value = !1;
788
+ }, Ce = () => {
789
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
790
+ }, fe = () => {
791
+ x.value = !!document.fullscreenElement;
792
+ }, be = () => {
793
+ g.value = !g.value;
794
+ }, ke = () => {
795
+ g.value = !1;
796
+ }, we = () => {
797
+ L.value = !1, C.value = "";
798
+ }, Te = (H) => {
799
+ v.push(H), we();
800
+ }, Ne = (H) => {
801
+ m.setPrimaryColor(H), M.value = !1;
802
+ }, Oe = () => {
803
+ ke(), v.push("/profile");
804
+ }, N = () => {
805
+ ke(), v.push("/change-password");
806
+ }, Ue = () => {
807
+ ke(), k.logout(), f.clearUserInfo(), S.clearMenu(), v.push("/login");
808
+ }, Be = (H) => {
809
+ _.value && !_.value.contains(H.target) && ke(), K.value && !K.value.contains(H.target) && we();
810
+ }, Me = (H) => {
811
+ H.key === "Escape" && (we(), ke());
812
+ };
813
+ return wt(() => {
814
+ document.addEventListener("click", Be), document.addEventListener("fullscreenchange", fe), document.addEventListener("keydown", Me), m.initTheme(), Q.value = document.documentElement.classList.contains("grey-mode");
815
+ }), yt(() => {
816
+ document.removeEventListener("click", Be), document.removeEventListener("fullscreenchange", fe), document.removeEventListener("keydown", Me);
817
+ }), (H, B) => {
818
+ var t;
819
+ return w(), E("div", Ds, [
820
+ s("div", Fs, [
821
+ s("div", {
822
+ class: "header__collapse",
823
+ onClick: ee
824
+ }, [
825
+ R(y(Z), {
826
+ name: y(m).isCollapsed ? "menu-unfold" : "menu-fold",
827
+ size: 18
828
+ }, null, 8, ["name"])
829
+ ]),
830
+ y(m).showBreadcrumb ? (w(), E("div", Vs, [
831
+ (w(!0), E(he, null, ge(V.value, (e, r) => (w(), E("span", {
832
+ key: e.path
833
+ }, [
834
+ r > 0 ? (w(), E("span", js, "/")) : le("", !0),
835
+ s("span", {
836
+ class: _e({ "is-current": r === V.value.length - 1 })
837
+ }, G(e.title), 3)
838
+ ]))), 128))
839
+ ])) : le("", !0)
840
+ ]),
841
+ s("div", qs, [
842
+ s("div", {
843
+ class: "header__search",
844
+ ref_key: "searchRef",
845
+ ref: K
846
+ }, [
847
+ R(y(Z), {
848
+ name: "search",
849
+ size: 14,
850
+ class: "header__search-icon"
851
+ }),
852
+ lt(s("input", {
853
+ "onUpdate:modelValue": B[0] || (B[0] = (e) => C.value = e),
854
+ type: "text",
855
+ class: "header__search-input",
856
+ placeholder: "搜索菜单...",
857
+ onFocus: B[1] || (B[1] = (e) => L.value = !0)
858
+ }, null, 544), [
859
+ [bt, C.value]
860
+ ]),
861
+ R(Ve, { name: "search-dropdown" }, {
862
+ default: X(() => [
863
+ L.value && (A.value.length > 0 || C.value) ? (w(), E("div", Gs, [
864
+ A.value.length > 0 ? (w(), E("div", Ks, [
865
+ (w(!0), E(he, null, ge(A.value, (e) => (w(), E("div", {
866
+ key: e.path,
867
+ class: "header__search-item",
868
+ onClick: (r) => Te(e.path)
869
+ }, [
870
+ e.title !== "首页" ? (w(), E("span", Ws, [
871
+ U(Y(e.icon)) ? (w(), ce(y(Z), {
872
+ key: 0,
873
+ name: Y(e.icon),
874
+ size: 16
875
+ }, null, 8, ["name"])) : (w(), E("span", Xs, G(oe(e.title)), 1))
876
+ ])) : le("", !0),
877
+ s("span", Ys, G(e.title), 1),
878
+ e.parentTitle ? (w(), E("span", Js, G(e.parentTitle), 1)) : le("", !0)
879
+ ], 8, Hs))), 128))
880
+ ])) : (w(), E("div", Zs, " 未找到匹配的菜单 "))
881
+ ])) : le("", !0)
882
+ ]),
883
+ _: 1
884
+ })
885
+ ], 512),
886
+ s("div", {
887
+ class: "header__action",
888
+ onClick: Ce,
889
+ title: x.value ? "退出全屏" : "全屏"
890
+ }, [
891
+ R(y(Z), {
892
+ name: x.value ? "fullscreen-exit" : "fullscreen",
893
+ size: 16
894
+ }, null, 8, ["name"])
895
+ ], 8, Qs),
896
+ s("div", {
897
+ class: "header__action",
898
+ onClick: re,
899
+ title: "换肤设置"
900
+ }, [
901
+ R(y(Z), {
902
+ name: "skin",
903
+ size: 16
904
+ })
905
+ ]),
906
+ s("div", {
907
+ class: "header__action",
908
+ onClick: $,
909
+ title: "切换主题"
910
+ }, [
911
+ R(y(Z), {
912
+ name: y(m).isDark ? "sun" : "moon",
913
+ size: 16
914
+ }, null, 8, ["name"])
915
+ ]),
916
+ s("div", {
917
+ class: "header__user",
918
+ ref_key: "dropdownRef",
919
+ ref: _
920
+ }, [
921
+ s("div", {
922
+ class: "header__user-trigger",
923
+ onClick: it(be, ["stop"])
924
+ }, [
925
+ s("div", en, [
926
+ s("span", null, G(((t = y(f).userName) == null ? void 0 : t.charAt(0)) || "U"), 1)
927
+ ]),
928
+ s("span", tn, G(y(f).userName), 1),
929
+ s("span", {
930
+ class: _e(["header__user-arrow", { "is-active": g.value }])
931
+ }, "▼", 2)
932
+ ]),
933
+ R(Ve, { name: "dropdown" }, {
934
+ default: X(() => {
935
+ var e;
936
+ return [
937
+ g.value ? (w(), E("div", sn, [
938
+ s("div", nn, [
939
+ s("div", on, [
940
+ s("span", null, G(((e = y(f).userName) == null ? void 0 : e.charAt(0)) || "U"), 1)
941
+ ]),
942
+ s("div", rn, [
943
+ s("div", an, G(y(f).userName), 1),
944
+ s("div", ln, G(y(f).departmentName), 1)
945
+ ])
946
+ ]),
947
+ B[7] || (B[7] = s("div", { class: "header__dropdown-divider" }, null, -1)),
948
+ s("div", cn, [
949
+ s("div", {
950
+ class: "header__dropdown-item",
951
+ onClick: Oe
952
+ }, [
953
+ R(y(Z), {
954
+ name: "user",
955
+ size: 16
956
+ }),
957
+ B[3] || (B[3] = s("span", null, "个人信息", -1))
958
+ ]),
959
+ s("div", {
960
+ class: "header__dropdown-item",
961
+ onClick: N
962
+ }, [
963
+ R(y(Z), {
964
+ name: "lock",
965
+ size: 16
966
+ }),
967
+ B[4] || (B[4] = s("span", null, "修改密码", -1))
968
+ ]),
969
+ B[6] || (B[6] = s("div", { class: "header__dropdown-divider" }, null, -1)),
970
+ s("div", {
971
+ class: "header__dropdown-item header__dropdown-item--danger",
972
+ onClick: Ue
973
+ }, [
974
+ R(y(Z), {
975
+ name: "logout",
976
+ size: 16
977
+ }),
978
+ B[5] || (B[5] = s("span", null, "退出登录", -1))
979
+ ])
980
+ ])
981
+ ])) : le("", !0)
982
+ ];
983
+ }),
984
+ _: 1
985
+ })
986
+ ], 512)
987
+ ]),
988
+ R(y(Et), {
989
+ modelValue: M.value,
990
+ "onUpdate:modelValue": B[2] || (B[2] = (e) => M.value = e),
991
+ title: "换肤设置",
992
+ direction: "rtl",
993
+ size: "320px"
994
+ }, {
995
+ default: X(() => [
996
+ s("div", un, [
997
+ s("div", dn, [
998
+ B[11] || (B[11] = s("div", { class: "settings-title" }, "布局模式", -1)),
999
+ s("div", fn, [
1000
+ (w(), E(he, null, ge(O, (e) => s("div", {
1001
+ key: e.value,
1002
+ class: _e(["layout-option", { "is-active": J.value === e.value }]),
1003
+ onClick: (r) => te(e.value)
1004
+ }, [
1005
+ s("div", mn, [
1006
+ e.value === "sidebar" ? (w(), E("div", hn, [...B[8] || (B[8] = [
1007
+ s("div", { class: "preview-aside" }, null, -1),
1008
+ s("div", { class: "preview-main" }, [
1009
+ s("div", { class: "preview-header" }),
1010
+ s("div", { class: "preview-content" })
1011
+ ], -1)
1012
+ ])])) : e.value === "top" ? (w(), E("div", vn, [...B[9] || (B[9] = [
1013
+ s("div", { class: "preview-header-full" }, null, -1),
1014
+ s("div", { class: "preview-content-full" }, null, -1)
1015
+ ])])) : (w(), E("div", gn, [...B[10] || (B[10] = [
1016
+ s("div", { class: "preview-header-mix" }, [
1017
+ s("div", { class: "preview-mix-left" })
1018
+ ], -1),
1019
+ s("div", { class: "preview-mix-body" }, [
1020
+ s("div", { class: "preview-mix-aside" }),
1021
+ s("div", { class: "preview-mix-content" })
1022
+ ], -1)
1023
+ ])]))
1024
+ ]),
1025
+ s("span", _n, G(e.label), 1)
1026
+ ], 10, pn)), 64))
1027
+ ])
1028
+ ]),
1029
+ s("div", wn, [
1030
+ B[12] || (B[12] = s("div", { class: "settings-title" }, "主题色", -1)),
1031
+ s("div", yn, [
1032
+ (w(), E(he, null, ge(T, (e) => s("div", {
1033
+ key: e.value,
1034
+ class: _e(["color-option", { "is-active": y(m).primaryColor === e.value }]),
1035
+ style: Ye({ backgroundColor: e.value }),
1036
+ title: e.label,
1037
+ onClick: (r) => Ne(e.value)
1038
+ }, [
1039
+ y(m).primaryColor === e.value ? (w(), ce(y(Z), {
1040
+ key: 0,
1041
+ name: "check",
1042
+ size: 12,
1043
+ color: "#fff"
1044
+ })) : le("", !0)
1045
+ ], 14, bn)), 64))
1046
+ ])
1047
+ ]),
1048
+ s("div", kn, [
1049
+ B[17] || (B[17] = s("div", { class: "settings-title" }, "功能设置", -1)),
1050
+ s("div", xn, [
1051
+ s("div", Cn, [
1052
+ B[14] || (B[14] = s("span", null, "灰色模式", -1)),
1053
+ s("div", {
1054
+ class: _e(["switch-wrapper", { "is-checked": Q.value }]),
1055
+ onClick: ie
1056
+ }, [...B[13] || (B[13] = [
1057
+ s("span", { class: "switch-core" }, null, -1)
1058
+ ])], 2)
1059
+ ]),
1060
+ s("div", Nn, [
1061
+ B[16] || (B[16] = s("span", null, "暗黑模式", -1)),
1062
+ s("div", {
1063
+ class: _e(["switch-wrapper", { "is-checked": y(m).isDark }]),
1064
+ onClick: de
1065
+ }, [...B[15] || (B[15] = [
1066
+ s("span", { class: "switch-core" }, null, -1)
1067
+ ])], 2)
1068
+ ])
1069
+ ])
1070
+ ])
1071
+ ])
1072
+ ]),
1073
+ _: 1
1074
+ }, 8, ["modelValue"])
1075
+ ]);
1076
+ };
1077
+ }
1078
+ }), Sn = /* @__PURE__ */ $e(En, [["__scopeId", "data-v-89179947"]]), $n = { class: "top-menu" }, Mn = { class: "top-menu__logo" }, Ln = { class: "top-menu__logo-text" }, In = { class: "top-menu__menu-content" }, An = {
1079
+ key: 0,
1080
+ class: "top-menu__menu-icon"
1081
+ }, Tn = {
1082
+ key: 1,
1083
+ class: "top-menu__menu-char"
1084
+ }, On = { class: "top-menu__menu-text" }, Un = { class: "top-menu__menu-content" }, Bn = { class: "top-menu__menu-icon" }, Pn = {
1085
+ key: 1,
1086
+ class: "top-menu__menu-char"
1087
+ }, Rn = { class: "top-menu__menu-text" }, zn = { class: "top-menu__menu-content" }, Dn = { class: "top-menu__menu-icon" }, Fn = {
1088
+ key: 1,
1089
+ class: "top-menu__menu-char"
1090
+ }, Vn = { class: "top-menu__menu-text" }, jn = { class: "top-menu__menu-content" }, qn = { class: "top-menu__menu-icon" }, Gn = {
1091
+ key: 1,
1092
+ class: "top-menu__menu-char"
1093
+ }, Kn = { class: "top-menu__menu-text" }, Hn = { class: "top-menu__menu-content" }, Wn = {
1094
+ key: 0,
1095
+ class: "top-menu__menu-icon"
1096
+ }, Xn = {
1097
+ key: 1,
1098
+ class: "top-menu__menu-char"
1099
+ }, Yn = { class: "top-menu__menu-text" }, Jn = { class: "top-menu__actions" }, Zn = {
1100
+ key: 0,
1101
+ class: "top-menu__search-dropdown"
1102
+ }, Qn = {
1103
+ key: 0,
1104
+ class: "top-menu__search-results"
1105
+ }, eo = ["onClick"], to = {
1106
+ key: 0,
1107
+ class: "top-menu__search-icon-item"
1108
+ }, so = {
1109
+ key: 1,
1110
+ class: "top-menu__search-char"
1111
+ }, no = { class: "top-menu__search-item-title" }, oo = {
1112
+ key: 1,
1113
+ class: "top-menu__search-item-parent"
1114
+ }, ro = {
1115
+ key: 1,
1116
+ class: "top-menu__search-empty"
1117
+ }, ao = ["title"], lo = { class: "top-menu__avatar" }, io = { class: "top-menu__user-name" }, co = {
1118
+ key: 0,
1119
+ class: "top-menu__dropdown"
1120
+ }, uo = { class: "top-menu__dropdown-header" }, fo = { class: "top-menu__dropdown-avatar" }, po = { class: "top-menu__dropdown-info" }, mo = { class: "top-menu__dropdown-name" }, ho = { class: "top-menu__dropdown-role" }, vo = { class: "top-menu__dropdown-menu" }, go = { class: "settings-drawer" }, _o = { class: "settings-section" }, wo = { class: "settings-layout-options" }, yo = ["onClick"], bo = { class: "layout-option__preview" }, ko = {
1121
+ key: 0,
1122
+ class: "layout-preview-sidebar"
1123
+ }, xo = {
1124
+ key: 1,
1125
+ class: "layout-preview-top"
1126
+ }, Co = {
1127
+ key: 2,
1128
+ class: "layout-preview-mix"
1129
+ }, No = { class: "layout-option__label" }, Eo = { class: "settings-section" }, So = { class: "settings-color-options" }, $o = ["title", "onClick"], Mo = { class: "settings-section" }, Lo = { class: "settings-switch-list" }, Io = { class: "settings-switch-item" }, Ao = { class: "settings-switch-item" }, To = /* @__PURE__ */ Ae({
1130
+ __name: "TopMenu",
1131
+ setup(o) {
1132
+ const i = qe(), v = ze(), m = Pe(), f = De(), k = Se(), S = Ze(), g = j(() => i.path), M = (e, r = "") => {
1133
+ const u = [];
1134
+ return e.forEach((n) => {
1135
+ n.children && n.children.length > 0 ? u.push(...M(n.children, n.menuName)) : u.push({ ...n, parentTitle: r, title: n.menuName, path: n.menuUrl });
1136
+ }), u;
1137
+ }, _ = j(() => W.value.trim() ? M(m.menuList).filter(
1138
+ (r) => r.title.toLowerCase().includes(W.value.toLowerCase())
1139
+ ) : []), x = j(() => f.isDark ? "#1d1e1f" : "#fff"), L = j(() => f.isDark ? "#cfd3dc" : "#303133"), C = j(() => "#409eff"), K = P(!1), Q = P(null), O = P(!1), T = P(!1), V = P(!1), I = P(!1), W = P(""), Y = P(null), oe = (e) => {
1140
+ e && e !== i.path && v.push(e);
1141
+ }, U = /* @__PURE__ */ new Set([
1142
+ "arrow-up",
1143
+ "arrow-down",
1144
+ "arrow-left",
1145
+ "arrow-right",
1146
+ "caret-down",
1147
+ "caret-right",
1148
+ "plus",
1149
+ "minus",
1150
+ "close",
1151
+ "check",
1152
+ "edit",
1153
+ "delete",
1154
+ "copy",
1155
+ "download",
1156
+ "upload",
1157
+ "refresh",
1158
+ "search",
1159
+ "filter",
1160
+ "more",
1161
+ "setting",
1162
+ "share",
1163
+ "loading",
1164
+ "info",
1165
+ "success",
1166
+ "warning",
1167
+ "error",
1168
+ "question",
1169
+ "user",
1170
+ "user-add",
1171
+ "user-group",
1172
+ "logout",
1173
+ "login",
1174
+ "file",
1175
+ "folder",
1176
+ "folder-open",
1177
+ "document",
1178
+ "image",
1179
+ "video",
1180
+ "music",
1181
+ "camera",
1182
+ "mail",
1183
+ "phone",
1184
+ "chat",
1185
+ "bell",
1186
+ "message",
1187
+ "eye",
1188
+ "eye-off",
1189
+ "calendar",
1190
+ "clock",
1191
+ "history",
1192
+ "timer",
1193
+ "location",
1194
+ "map",
1195
+ "globe",
1196
+ "star",
1197
+ "heart",
1198
+ "thumb-up",
1199
+ "link",
1200
+ "external-link",
1201
+ "lock",
1202
+ "unlock",
1203
+ "key",
1204
+ "home",
1205
+ "menu",
1206
+ "menu-fold",
1207
+ "menu-unfold",
1208
+ "sidebar-fold",
1209
+ "sidebar-expand",
1210
+ "sidebar-left",
1211
+ "dashboard",
1212
+ "chart",
1213
+ "chart-pie",
1214
+ "chart-line",
1215
+ "report",
1216
+ "analytics",
1217
+ "system",
1218
+ "permission",
1219
+ "role",
1220
+ "user-manage",
1221
+ "log",
1222
+ "notification",
1223
+ "app",
1224
+ "list",
1225
+ "grid",
1226
+ "fullscreen",
1227
+ "fullscreen-exit",
1228
+ "zoom-in",
1229
+ "zoom-out",
1230
+ "print",
1231
+ "bookmark",
1232
+ "tag",
1233
+ "code",
1234
+ "terminal",
1235
+ "database",
1236
+ "server",
1237
+ "cloud",
1238
+ "gift",
1239
+ "moon",
1240
+ "sun",
1241
+ "theme",
1242
+ "skin"
1243
+ ]), A = (e) => {
1244
+ if (!e || e === "") return "";
1245
+ if (e.startsWith("tineco-icon-")) {
1246
+ const u = e.replace("tineco-icon-", "");
1247
+ return {
1248
+ home: "home",
1249
+ dashboard: "dashboard",
1250
+ system: "system",
1251
+ user: "user",
1252
+ role: "role",
1253
+ menu: "list",
1254
+ setting: "setting",
1255
+ file: "file",
1256
+ folder: "folder",
1257
+ chart: "chart",
1258
+ report: "report",
1259
+ analytics: "analytics"
1260
+ }[u] || u;
1261
+ }
1262
+ return {
1263
+ dashboard: "dashboard",
1264
+ system: "system",
1265
+ user: "user",
1266
+ role: "role",
1267
+ menu: "list",
1268
+ setting: "setting",
1269
+ home: "home",
1270
+ chart: "chart",
1271
+ report: "report",
1272
+ analytics: "analytics",
1273
+ permission: "permission",
1274
+ log: "log",
1275
+ notification: "notification",
1276
+ app: "app",
1277
+ list: "list",
1278
+ grid: "grid"
1279
+ }[e] || e;
1280
+ }, J = (e) => e ? e.charAt(0) : "", ee = (e) => U.has(e), $ = () => {
1281
+ f.toggleTheme(), T.value = !1;
1282
+ }, re = () => {
1283
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
1284
+ }, te = () => {
1285
+ O.value = !!document.fullscreenElement;
1286
+ }, D = () => {
1287
+ K.value = !K.value;
1288
+ }, ie = () => {
1289
+ K.value = !1;
1290
+ }, de = () => {
1291
+ I.value = !1, W.value = "";
1292
+ }, Ce = (e) => {
1293
+ v.push(e), de();
1294
+ }, fe = () => {
1295
+ T.value = !0;
1296
+ }, be = (e) => {
1297
+ V.value = e;
1298
+ const r = document.documentElement;
1299
+ e ? r.classList.add("grey-mode") : r.classList.remove("grey-mode");
1300
+ }, ke = () => {
1301
+ be(!V.value), T.value = !1;
1302
+ }, we = () => {
1303
+ f.toggleTheme(), T.value = !1;
1304
+ }, Te = [
1305
+ { value: "sidebar", label: "左侧菜单", icon: "sidebar-left" },
1306
+ { value: "top", label: "顶部菜单", icon: "menu" },
1307
+ { value: "mix", label: "混合菜单", icon: "grid" }
1308
+ ], Ne = j(() => f.layout), Oe = (e) => {
1309
+ f.setLayout(e), T.value = !1;
1310
+ }, N = [
1311
+ { value: "#409eff", label: "默认蓝" },
1312
+ { value: "#1890ff", label: "科技蓝" },
1313
+ { value: "#52c41a", label: "极光绿" },
1314
+ { value: "#faad14", label: "日落橙" },
1315
+ { value: "#f5222d", label: "薄暮红" },
1316
+ { value: "#722ed1", label: "酱紫" }
1317
+ ], Ue = (e) => {
1318
+ f.setPrimaryColor(e), T.value = !1;
1319
+ }, Be = () => {
1320
+ ie(), v.push("/profile");
1321
+ }, Me = () => {
1322
+ ie(), v.push("/change-password");
1323
+ }, H = () => {
1324
+ ie(), S.logout(), k.clearUserInfo(), m.clearMenu(), v.push("/login");
1325
+ }, B = (e) => {
1326
+ Q.value && !Q.value.contains(e.target) && ie(), Y.value && !Y.value.contains(e.target) && de();
1327
+ }, t = (e) => {
1328
+ e.key === "Escape" && (de(), ie());
1329
+ };
1330
+ return wt(() => {
1331
+ document.addEventListener("click", B), document.addEventListener("fullscreenchange", te), document.addEventListener("keydown", t), V.value = document.documentElement.classList.contains("grey-mode");
1332
+ }), yt(() => {
1333
+ document.removeEventListener("click", B), document.removeEventListener("fullscreenchange", te), document.removeEventListener("keydown", t);
1334
+ }), (e, r) => {
1335
+ var u;
1336
+ return w(), E("div", $n, [
1337
+ s("div", Mn, [
1338
+ r[3] || (r[3] = s("img", {
1339
+ src: St,
1340
+ alt: "Logo",
1341
+ class: "top-menu__logo-img"
1342
+ }, null, -1)),
1343
+ s("span", Ln, G(y(f).appName), 1)
1344
+ ]),
1345
+ R(y(Nt), {
1346
+ "model-value": g.value,
1347
+ mode: "horizontal",
1348
+ "background-color": x.value,
1349
+ "text-color": L.value,
1350
+ "active-text-color": C.value,
1351
+ class: "top-menu__menu",
1352
+ onSelect: oe
1353
+ }, {
1354
+ default: X(() => [
1355
+ (w(!0), E(he, null, ge(y(m).menuList, (n) => (w(), E(he, {
1356
+ key: n.menuUrl
1357
+ }, [
1358
+ n.children && n.children.length > 0 ? (w(), ce(y(_t), {
1359
+ key: 0,
1360
+ index: n.menuUrl
1361
+ }, {
1362
+ title: X(() => [
1363
+ s("span", In, [
1364
+ n.menuName !== "首页" ? (w(), E("span", An, [
1365
+ ee(A(n.icon)) ? (w(), ce(y(Z), {
1366
+ key: 0,
1367
+ name: A(n.icon),
1368
+ size: 16
1369
+ }, null, 8, ["name"])) : (w(), E("span", Tn, G(J(n.menuName)), 1))
1370
+ ])) : le("", !0),
1371
+ s("span", On, G(n.menuName), 1)
1372
+ ])
1373
+ ]),
1374
+ default: X(() => [
1375
+ (w(!0), E(he, null, ge(n.children, (a) => (w(), E(he, {
1376
+ key: a.menuUrl
1377
+ }, [
1378
+ a.children && a.children.length > 0 ? (w(), ce(y(_t), {
1379
+ key: 0,
1380
+ index: a.menuUrl
1381
+ }, {
1382
+ title: X(() => [
1383
+ s("span", Un, [
1384
+ s("span", Bn, [
1385
+ ee(A(a.icon)) ? (w(), ce(y(Z), {
1386
+ key: 0,
1387
+ name: A(a.icon),
1388
+ size: 16
1389
+ }, null, 8, ["name"])) : (w(), E("span", Pn, G(J(a.menuName)), 1))
1390
+ ]),
1391
+ s("span", Rn, G(a.menuName), 1)
1392
+ ])
1393
+ ]),
1394
+ default: X(() => [
1395
+ (w(!0), E(he, null, ge(a.children, (d) => (w(), ce(y(He), {
1396
+ key: d.menuUrl,
1397
+ index: d.menuUrl
1398
+ }, {
1399
+ default: X(() => [
1400
+ s("span", zn, [
1401
+ s("span", Dn, [
1402
+ ee(A(d.icon)) ? (w(), ce(y(Z), {
1403
+ key: 0,
1404
+ name: A(d.icon),
1405
+ size: 16
1406
+ }, null, 8, ["name"])) : (w(), E("span", Fn, G(J(d.menuName)), 1))
1407
+ ]),
1408
+ s("span", Vn, G(d.menuName), 1)
1409
+ ])
1410
+ ]),
1411
+ _: 2
1412
+ }, 1032, ["index"]))), 128))
1413
+ ]),
1414
+ _: 2
1415
+ }, 1032, ["index"])) : (w(), ce(y(He), {
1416
+ key: 1,
1417
+ index: a.menuUrl
1418
+ }, {
1419
+ default: X(() => [
1420
+ s("span", jn, [
1421
+ s("span", qn, [
1422
+ ee(A(a.icon)) ? (w(), ce(y(Z), {
1423
+ key: 0,
1424
+ name: A(a.icon),
1425
+ size: 16
1426
+ }, null, 8, ["name"])) : (w(), E("span", Gn, G(J(a.menuName)), 1))
1427
+ ]),
1428
+ s("span", Kn, G(a.menuName), 1)
1429
+ ])
1430
+ ]),
1431
+ _: 2
1432
+ }, 1032, ["index"]))
1433
+ ], 64))), 128))
1434
+ ]),
1435
+ _: 2
1436
+ }, 1032, ["index"])) : (w(), ce(y(He), {
1437
+ key: 1,
1438
+ index: n.menuUrl
1439
+ }, {
1440
+ default: X(() => [
1441
+ s("span", Hn, [
1442
+ n.menuName !== "首页" ? (w(), E("span", Wn, [
1443
+ ee(A(n.icon)) ? (w(), ce(y(Z), {
1444
+ key: 0,
1445
+ name: A(n.icon),
1446
+ size: 16
1447
+ }, null, 8, ["name"])) : (w(), E("span", Xn, G(J(n.menuName)), 1))
1448
+ ])) : le("", !0),
1449
+ s("span", Yn, G(n.menuName), 1)
1450
+ ])
1451
+ ]),
1452
+ _: 2
1453
+ }, 1032, ["index"]))
1454
+ ], 64))), 128))
1455
+ ]),
1456
+ _: 1
1457
+ }, 8, ["model-value", "background-color", "text-color", "active-text-color"]),
1458
+ s("div", Jn, [
1459
+ s("div", {
1460
+ class: "top-menu__search",
1461
+ ref_key: "searchRef",
1462
+ ref: Y
1463
+ }, [
1464
+ R(y(Z), {
1465
+ name: "search",
1466
+ size: 14,
1467
+ class: "top-menu__search-icon"
1468
+ }),
1469
+ lt(s("input", {
1470
+ "onUpdate:modelValue": r[0] || (r[0] = (n) => W.value = n),
1471
+ type: "text",
1472
+ class: "top-menu__search-input",
1473
+ placeholder: "搜索菜单...",
1474
+ onFocus: r[1] || (r[1] = (n) => I.value = !0)
1475
+ }, null, 544), [
1476
+ [bt, W.value]
1477
+ ]),
1478
+ R(Ve, { name: "search-dropdown" }, {
1479
+ default: X(() => [
1480
+ I.value && (_.value.length > 0 || W.value) ? (w(), E("div", Zn, [
1481
+ _.value.length > 0 ? (w(), E("div", Qn, [
1482
+ (w(!0), E(he, null, ge(_.value, (n) => (w(), E("div", {
1483
+ key: n.path,
1484
+ class: "top-menu__search-item",
1485
+ onClick: (a) => Ce(n.path)
1486
+ }, [
1487
+ n.title !== "首页" ? (w(), E("span", to, [
1488
+ ee(A(n.icon)) ? (w(), ce(y(Z), {
1489
+ key: 0,
1490
+ name: A(n.icon),
1491
+ size: 16
1492
+ }, null, 8, ["name"])) : (w(), E("span", so, G(J(n.title)), 1))
1493
+ ])) : le("", !0),
1494
+ s("span", no, G(n.title), 1),
1495
+ n.parentTitle ? (w(), E("span", oo, G(n.parentTitle), 1)) : le("", !0)
1496
+ ], 8, eo))), 128))
1497
+ ])) : (w(), E("div", ro, " 未找到匹配的菜单 "))
1498
+ ])) : le("", !0)
1499
+ ]),
1500
+ _: 1
1501
+ })
1502
+ ], 512),
1503
+ s("div", {
1504
+ class: "top-menu__action",
1505
+ onClick: re,
1506
+ title: O.value ? "退出全屏" : "全屏"
1507
+ }, [
1508
+ R(y(Z), {
1509
+ name: O.value ? "fullscreen-exit" : "fullscreen",
1510
+ size: 16
1511
+ }, null, 8, ["name"])
1512
+ ], 8, ao),
1513
+ s("div", {
1514
+ class: "top-menu__action",
1515
+ onClick: fe,
1516
+ title: "换肤设置"
1517
+ }, [
1518
+ R(y(Z), {
1519
+ name: "skin",
1520
+ size: 16
1521
+ })
1522
+ ]),
1523
+ s("div", {
1524
+ class: "top-menu__action",
1525
+ onClick: $,
1526
+ title: "切换主题"
1527
+ }, [
1528
+ R(y(Z), {
1529
+ name: y(f).isDark ? "sun" : "moon",
1530
+ size: 16
1531
+ }, null, 8, ["name"])
1532
+ ]),
1533
+ s("div", {
1534
+ class: "top-menu__user",
1535
+ ref_key: "dropdownRef",
1536
+ ref: Q
1537
+ }, [
1538
+ s("div", {
1539
+ class: "top-menu__user-trigger",
1540
+ onClick: it(D, ["stop"])
1541
+ }, [
1542
+ s("div", lo, [
1543
+ s("span", null, G(((u = y(k).userName) == null ? void 0 : u.charAt(0)) || "U"), 1)
1544
+ ]),
1545
+ s("span", io, G(y(k).userName), 1),
1546
+ s("span", {
1547
+ class: _e(["top-menu__user-arrow", { "is-active": K.value }])
1548
+ }, "▼", 2)
1549
+ ]),
1550
+ R(Ve, { name: "dropdown" }, {
1551
+ default: X(() => {
1552
+ var n;
1553
+ return [
1554
+ K.value ? (w(), E("div", co, [
1555
+ s("div", uo, [
1556
+ s("div", fo, [
1557
+ s("span", null, G(((n = y(k).userName) == null ? void 0 : n.charAt(0)) || "U"), 1)
1558
+ ]),
1559
+ s("div", po, [
1560
+ s("div", mo, G(y(k).userName), 1),
1561
+ s("div", ho, G(y(k).departmentName), 1)
1562
+ ])
1563
+ ]),
1564
+ r[8] || (r[8] = s("div", { class: "top-menu__dropdown-divider" }, null, -1)),
1565
+ s("div", vo, [
1566
+ s("div", {
1567
+ class: "top-menu__dropdown-item",
1568
+ onClick: Be
1569
+ }, [
1570
+ R(y(Z), {
1571
+ name: "user",
1572
+ size: 16
1573
+ }),
1574
+ r[4] || (r[4] = s("span", null, "个人信息", -1))
1575
+ ]),
1576
+ s("div", {
1577
+ class: "top-menu__dropdown-item",
1578
+ onClick: Me
1579
+ }, [
1580
+ R(y(Z), {
1581
+ name: "lock",
1582
+ size: 16
1583
+ }),
1584
+ r[5] || (r[5] = s("span", null, "修改密码", -1))
1585
+ ]),
1586
+ r[7] || (r[7] = s("div", { class: "top-menu__dropdown-divider" }, null, -1)),
1587
+ s("div", {
1588
+ class: "top-menu__dropdown-item top-menu__dropdown-item--danger",
1589
+ onClick: H
1590
+ }, [
1591
+ R(y(Z), {
1592
+ name: "logout",
1593
+ size: 16
1594
+ }),
1595
+ r[6] || (r[6] = s("span", null, "退出登录", -1))
1596
+ ])
1597
+ ])
1598
+ ])) : le("", !0)
1599
+ ];
1600
+ }),
1601
+ _: 1
1602
+ })
1603
+ ], 512)
1604
+ ]),
1605
+ R(y(Et), {
1606
+ modelValue: T.value,
1607
+ "onUpdate:modelValue": r[2] || (r[2] = (n) => T.value = n),
1608
+ title: "换肤设置",
1609
+ direction: "rtl",
1610
+ size: "320px"
1611
+ }, {
1612
+ default: X(() => [
1613
+ s("div", go, [
1614
+ s("div", _o, [
1615
+ r[12] || (r[12] = s("div", { class: "settings-title" }, "布局模式", -1)),
1616
+ s("div", wo, [
1617
+ (w(), E(he, null, ge(Te, (n) => s("div", {
1618
+ key: n.value,
1619
+ class: _e(["layout-option", { "is-active": Ne.value === n.value }]),
1620
+ onClick: (a) => Oe(n.value)
1621
+ }, [
1622
+ s("div", bo, [
1623
+ n.value === "sidebar" ? (w(), E("div", ko, [...r[9] || (r[9] = [
1624
+ s("div", { class: "preview-aside" }, null, -1),
1625
+ s("div", { class: "preview-main" }, [
1626
+ s("div", { class: "preview-header" }),
1627
+ s("div", { class: "preview-content" })
1628
+ ], -1)
1629
+ ])])) : n.value === "top" ? (w(), E("div", xo, [...r[10] || (r[10] = [
1630
+ s("div", { class: "preview-header-full" }, null, -1),
1631
+ s("div", { class: "preview-content-full" }, null, -1)
1632
+ ])])) : (w(), E("div", Co, [...r[11] || (r[11] = [
1633
+ s("div", { class: "preview-header-mix" }, [
1634
+ s("div", { class: "preview-mix-left" })
1635
+ ], -1),
1636
+ s("div", { class: "preview-mix-body" }, [
1637
+ s("div", { class: "preview-mix-aside" }),
1638
+ s("div", { class: "preview-mix-content" })
1639
+ ], -1)
1640
+ ])]))
1641
+ ]),
1642
+ s("span", No, G(n.label), 1)
1643
+ ], 10, yo)), 64))
1644
+ ])
1645
+ ]),
1646
+ s("div", Eo, [
1647
+ r[13] || (r[13] = s("div", { class: "settings-title" }, "主题色", -1)),
1648
+ s("div", So, [
1649
+ (w(), E(he, null, ge(N, (n) => s("div", {
1650
+ key: n.value,
1651
+ class: _e(["color-option", { "is-active": y(f).primaryColor === n.value }]),
1652
+ style: Ye({ backgroundColor: n.value }),
1653
+ title: n.label,
1654
+ onClick: (a) => Ue(n.value)
1655
+ }, [
1656
+ y(f).primaryColor === n.value ? (w(), ce(y(Z), {
1657
+ key: 0,
1658
+ name: "check",
1659
+ size: 12,
1660
+ color: "#fff"
1661
+ })) : le("", !0)
1662
+ ], 14, $o)), 64))
1663
+ ])
1664
+ ]),
1665
+ s("div", Mo, [
1666
+ r[18] || (r[18] = s("div", { class: "settings-title" }, "功能设置", -1)),
1667
+ s("div", Lo, [
1668
+ s("div", Io, [
1669
+ r[15] || (r[15] = s("span", null, "灰色模式", -1)),
1670
+ s("div", {
1671
+ class: _e(["switch-wrapper", { "is-checked": V.value }]),
1672
+ onClick: ke
1673
+ }, [...r[14] || (r[14] = [
1674
+ s("span", { class: "switch-core" }, null, -1)
1675
+ ])], 2)
1676
+ ]),
1677
+ s("div", Ao, [
1678
+ r[17] || (r[17] = s("span", null, "暗黑模式", -1)),
1679
+ s("div", {
1680
+ class: _e(["switch-wrapper", { "is-checked": y(f).isDark }]),
1681
+ onClick: we
1682
+ }, [...r[16] || (r[16] = [
1683
+ s("span", { class: "switch-core" }, null, -1)
1684
+ ])], 2)
1685
+ ])
1686
+ ])
1687
+ ])
1688
+ ])
1689
+ ]),
1690
+ _: 1
1691
+ }, 8, ["modelValue"])
1692
+ ]);
1693
+ };
1694
+ }
1695
+ }), Oo = /* @__PURE__ */ $e(To, [["__scopeId", "data-v-5c8f8b91"]]), Uo = { class: "mix-top-menu" }, Bo = { class: "mix-top-menu__logo" }, Po = { class: "mix-top-menu__logo-text" }, Ro = { class: "mix-top-menu__menu-content" }, zo = {
1696
+ key: 0,
1697
+ class: "mix-top-menu__menu-icon"
1698
+ }, Do = {
1699
+ key: 1,
1700
+ class: "mix-top-menu__menu-char"
1701
+ }, Fo = { class: "mix-top-menu__menu-text" }, Vo = { class: "mix-top-menu__actions" }, jo = {
1702
+ key: 0,
1703
+ class: "mix-top-menu__search-dropdown"
1704
+ }, qo = {
1705
+ key: 0,
1706
+ class: "mix-top-menu__search-results"
1707
+ }, Go = ["onClick"], Ko = {
1708
+ key: 0,
1709
+ class: "mix-top-menu__search-icon-item"
1710
+ }, Ho = {
1711
+ key: 1,
1712
+ class: "mix-top-menu__search-char"
1713
+ }, Wo = { class: "mix-top-menu__search-item-title" }, Xo = {
1714
+ key: 1,
1715
+ class: "mix-top-menu__search-item-parent"
1716
+ }, Yo = {
1717
+ key: 1,
1718
+ class: "mix-top-menu__search-empty"
1719
+ }, Jo = ["title"], Zo = { class: "mix-top-menu__avatar" }, Qo = { class: "mix-top-menu__user-name" }, er = {
1720
+ key: 0,
1721
+ class: "mix-top-menu__dropdown"
1722
+ }, tr = { class: "mix-top-menu__dropdown-header" }, sr = { class: "mix-top-menu__dropdown-avatar" }, nr = { class: "mix-top-menu__dropdown-info" }, or = { class: "mix-top-menu__dropdown-name" }, rr = { class: "mix-top-menu__dropdown-role" }, ar = { class: "mix-top-menu__dropdown-menu" }, lr = { class: "settings-drawer" }, ir = { class: "settings-section" }, cr = { class: "settings-layout-options" }, ur = ["onClick"], dr = { class: "layout-option__preview" }, fr = {
1723
+ key: 0,
1724
+ class: "layout-preview-sidebar"
1725
+ }, pr = {
1726
+ key: 1,
1727
+ class: "layout-preview-top"
1728
+ }, mr = {
1729
+ key: 2,
1730
+ class: "layout-preview-mix"
1731
+ }, hr = { class: "layout-option__label" }, vr = { class: "settings-section" }, gr = { class: "settings-color-options" }, _r = ["title", "onClick"], wr = { class: "settings-section" }, yr = { class: "settings-switch-list" }, br = { class: "settings-switch-item" }, kr = { class: "settings-switch-item" }, xr = /* @__PURE__ */ Ae({
1732
+ __name: "MixTopMenu",
1733
+ setup(o) {
1734
+ const i = qe(), v = ze(), m = Pe(), f = De(), k = Se(), S = Ze(), g = P(""), M = (n, a = "") => {
1735
+ const d = [];
1736
+ return n.forEach((l) => {
1737
+ l.children && l.children.length > 0 ? d.push(...M(l.children, l.menuName)) : d.push({ ...l, parentTitle: a, title: l.menuName, path: l.menuUrl });
1738
+ }), d;
1739
+ }, _ = j(() => A.value.trim() ? M(m.menuList).filter(
1740
+ (a) => a.title.toLowerCase().includes(A.value.toLowerCase())
1741
+ ) : []), x = j(() => {
1742
+ const n = m.menuList.find((a) => a.menuUrl === g.value);
1743
+ return (n == null ? void 0 : n.children) || [];
1744
+ }), L = j(() => m.menuList.find((n) => !!(i.path === n.menuUrl || n.children && n.children.some((a) => i.path.startsWith(a.menuUrl) || i.path === a.menuUrl)))), C = () => {
1745
+ L.value ? g.value = L.value.menuUrl : m.menuList.length > 0 && (g.value = m.menuList[0].menuUrl);
1746
+ }, K = (n) => {
1747
+ g.value = n;
1748
+ const a = m.menuList.find((d) => d.menuUrl === n);
1749
+ if (a)
1750
+ if (a.children && a.children.length > 0) {
1751
+ const d = a.children[0].menuUrl;
1752
+ i.path !== d && v.push(d);
1753
+ } else
1754
+ i.path !== n && v.push(n);
1755
+ }, Q = j(() => f.isDark ? "#1d1e1f" : "#fff"), O = j(() => f.isDark ? "#cfd3dc" : "#303133"), T = j(() => "#409eff"), V = P(!1), I = P(null), W = P(!1), Y = P(!1), oe = P(!1), U = P(!1), A = P(""), J = P(null);
1756
+ Xe(() => i.path, () => {
1757
+ C(), f.setMixSubMenus(x.value);
1758
+ }), Xe(() => m.menuList, (n) => {
1759
+ n && n.length > 0 && (C(), f.setMixSubMenus(x.value));
1760
+ }, { immediate: !0 });
1761
+ const ee = /* @__PURE__ */ new Set([
1762
+ "arrow-up",
1763
+ "arrow-down",
1764
+ "arrow-left",
1765
+ "arrow-right",
1766
+ "caret-down",
1767
+ "caret-right",
1768
+ "plus",
1769
+ "minus",
1770
+ "close",
1771
+ "check",
1772
+ "edit",
1773
+ "delete",
1774
+ "copy",
1775
+ "download",
1776
+ "upload",
1777
+ "refresh",
1778
+ "search",
1779
+ "filter",
1780
+ "more",
1781
+ "setting",
1782
+ "share",
1783
+ "loading",
1784
+ "info",
1785
+ "success",
1786
+ "warning",
1787
+ "error",
1788
+ "question",
1789
+ "user",
1790
+ "user-add",
1791
+ "user-group",
1792
+ "logout",
1793
+ "login",
1794
+ "file",
1795
+ "folder",
1796
+ "folder-open",
1797
+ "document",
1798
+ "image",
1799
+ "video",
1800
+ "music",
1801
+ "camera",
1802
+ "mail",
1803
+ "phone",
1804
+ "chat",
1805
+ "bell",
1806
+ "message",
1807
+ "eye",
1808
+ "eye-off",
1809
+ "calendar",
1810
+ "clock",
1811
+ "history",
1812
+ "timer",
1813
+ "location",
1814
+ "map",
1815
+ "globe",
1816
+ "star",
1817
+ "heart",
1818
+ "thumb-up",
1819
+ "link",
1820
+ "external-link",
1821
+ "lock",
1822
+ "unlock",
1823
+ "key",
1824
+ "home",
1825
+ "menu",
1826
+ "menu-fold",
1827
+ "menu-unfold",
1828
+ "sidebar-fold",
1829
+ "sidebar-expand",
1830
+ "sidebar-left",
1831
+ "dashboard",
1832
+ "chart",
1833
+ "chart-pie",
1834
+ "chart-line",
1835
+ "report",
1836
+ "analytics",
1837
+ "system",
1838
+ "permission",
1839
+ "role",
1840
+ "user-manage",
1841
+ "log",
1842
+ "notification",
1843
+ "app",
1844
+ "list",
1845
+ "grid",
1846
+ "fullscreen",
1847
+ "fullscreen-exit",
1848
+ "zoom-in",
1849
+ "zoom-out",
1850
+ "print",
1851
+ "bookmark",
1852
+ "tag",
1853
+ "code",
1854
+ "terminal",
1855
+ "database",
1856
+ "server",
1857
+ "cloud",
1858
+ "gift",
1859
+ "moon",
1860
+ "sun",
1861
+ "theme",
1862
+ "skin"
1863
+ ]), $ = (n) => {
1864
+ if (!n || n === "") return "";
1865
+ if (n.startsWith("tineco-icon-")) {
1866
+ const d = n.replace("tineco-icon-", "");
1867
+ return {
1868
+ home: "home",
1869
+ dashboard: "dashboard",
1870
+ system: "system",
1871
+ user: "user",
1872
+ role: "role",
1873
+ menu: "list",
1874
+ setting: "setting",
1875
+ file: "file",
1876
+ folder: "folder",
1877
+ chart: "chart",
1878
+ report: "report",
1879
+ analytics: "analytics"
1880
+ }[d] || d;
1881
+ }
1882
+ return {
1883
+ dashboard: "dashboard",
1884
+ system: "system",
1885
+ user: "user",
1886
+ role: "role",
1887
+ menu: "list",
1888
+ setting: "setting",
1889
+ home: "home",
1890
+ chart: "chart",
1891
+ report: "report",
1892
+ analytics: "analytics",
1893
+ permission: "permission",
1894
+ log: "log",
1895
+ notification: "notification",
1896
+ app: "app",
1897
+ list: "list",
1898
+ grid: "grid"
1899
+ }[n] || n;
1900
+ }, re = (n) => n ? n.charAt(0) : "", te = (n) => ee.has(n), D = () => {
1901
+ f.toggleTheme(), Y.value = !1;
1902
+ }, ie = () => {
1903
+ document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen();
1904
+ }, de = () => {
1905
+ W.value = !!document.fullscreenElement;
1906
+ }, Ce = () => {
1907
+ V.value = !V.value;
1908
+ }, fe = () => {
1909
+ V.value = !1;
1910
+ }, be = () => {
1911
+ U.value = !1, A.value = "";
1912
+ }, ke = (n) => {
1913
+ v.push(n), be();
1914
+ }, we = () => {
1915
+ Y.value = !0;
1916
+ }, Te = (n) => {
1917
+ oe.value = n;
1918
+ const a = document.documentElement;
1919
+ n ? a.classList.add("grey-mode") : a.classList.remove("grey-mode");
1920
+ }, Ne = () => {
1921
+ Te(!oe.value), Y.value = !1;
1922
+ }, Oe = () => {
1923
+ f.toggleTheme(), Y.value = !1;
1924
+ }, N = [
1925
+ { value: "sidebar", label: "左侧菜单", icon: "sidebar-left" },
1926
+ { value: "top", label: "顶部菜单", icon: "menu" },
1927
+ { value: "mix", label: "混合菜单", icon: "grid" }
1928
+ ], Ue = j(() => f.layout), Be = (n) => {
1929
+ f.setLayout(n), Y.value = !1;
1930
+ }, Me = [
1931
+ { value: "#409eff", label: "默认蓝" },
1932
+ { value: "#1890ff", label: "科技蓝" },
1933
+ { value: "#52c41a", label: "极光绿" },
1934
+ { value: "#faad14", label: "日落橙" },
1935
+ { value: "#f5222d", label: "薄暮红" },
1936
+ { value: "#722ed1", label: "酱紫" }
1937
+ ], H = (n) => {
1938
+ f.setPrimaryColor(n), Y.value = !1;
1939
+ }, B = () => {
1940
+ fe(), v.push("/profile");
1941
+ }, t = () => {
1942
+ fe(), v.push("/change-password");
1943
+ }, e = () => {
1944
+ fe(), S.logout(), k.clearUserInfo(), m.clearMenu(), v.push("/login");
1945
+ }, r = (n) => {
1946
+ I.value && !I.value.contains(n.target) && fe(), J.value && !J.value.contains(n.target) && be();
1947
+ }, u = (n) => {
1948
+ n.key === "Escape" && (be(), fe());
1949
+ };
1950
+ return wt(() => {
1951
+ document.addEventListener("click", r), document.addEventListener("fullscreenchange", de), document.addEventListener("keydown", u), oe.value = document.documentElement.classList.contains("grey-mode"), C();
1952
+ }), yt(() => {
1953
+ document.removeEventListener("click", r), document.removeEventListener("fullscreenchange", de), document.removeEventListener("keydown", u);
1954
+ }), (n, a) => {
1955
+ var d;
1956
+ return w(), E("div", Uo, [
1957
+ s("div", Bo, [
1958
+ a[3] || (a[3] = s("img", {
1959
+ src: St,
1960
+ alt: "Logo",
1961
+ class: "mix-top-menu__logo-img"
1962
+ }, null, -1)),
1963
+ s("span", Po, G(y(f).appName), 1)
1964
+ ]),
1965
+ R(y(Nt), {
1966
+ "model-value": g.value,
1967
+ mode: "horizontal",
1968
+ "background-color": Q.value,
1969
+ "text-color": O.value,
1970
+ "active-text-color": T.value,
1971
+ class: "mix-top-menu__menu",
1972
+ onSelect: K
1973
+ }, {
1974
+ default: X(() => [
1975
+ (w(!0), E(he, null, ge(y(m).menuList, (l) => (w(), ce(y(He), {
1976
+ key: l.menuUrl,
1977
+ index: l.menuUrl
1978
+ }, {
1979
+ default: X(() => [
1980
+ s("span", Ro, [
1981
+ l.menuName !== "首页" ? (w(), E("span", zo, [
1982
+ te($(l.icon)) ? (w(), ce(y(Z), {
1983
+ key: 0,
1984
+ name: $(l.icon),
1985
+ size: 16
1986
+ }, null, 8, ["name"])) : (w(), E("span", Do, G(re(l.menuName)), 1))
1987
+ ])) : le("", !0),
1988
+ s("span", Fo, G(l.menuName), 1)
1989
+ ])
1990
+ ]),
1991
+ _: 2
1992
+ }, 1032, ["index"]))), 128))
1993
+ ]),
1994
+ _: 1
1995
+ }, 8, ["model-value", "background-color", "text-color", "active-text-color"]),
1996
+ s("div", Vo, [
1997
+ s("div", {
1998
+ class: "mix-top-menu__search",
1999
+ ref_key: "searchRef",
2000
+ ref: J
2001
+ }, [
2002
+ R(y(Z), {
2003
+ name: "search",
2004
+ size: 14,
2005
+ class: "mix-top-menu__search-icon"
2006
+ }),
2007
+ lt(s("input", {
2008
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => A.value = l),
2009
+ type: "text",
2010
+ class: "mix-top-menu__search-input",
2011
+ placeholder: "搜索菜单...",
2012
+ onFocus: a[1] || (a[1] = (l) => U.value = !0)
2013
+ }, null, 544), [
2014
+ [bt, A.value]
2015
+ ]),
2016
+ R(Ve, { name: "search-dropdown" }, {
2017
+ default: X(() => [
2018
+ U.value && (_.value.length > 0 || A.value) ? (w(), E("div", jo, [
2019
+ _.value.length > 0 ? (w(), E("div", qo, [
2020
+ (w(!0), E(he, null, ge(_.value, (l) => (w(), E("div", {
2021
+ key: l.path,
2022
+ class: "mix-top-menu__search-item",
2023
+ onClick: (c) => ke(l.path)
2024
+ }, [
2025
+ l.title !== "首页" ? (w(), E("span", Ko, [
2026
+ te($(l.icon)) ? (w(), ce(y(Z), {
2027
+ key: 0,
2028
+ name: $(l.icon),
2029
+ size: 16
2030
+ }, null, 8, ["name"])) : (w(), E("span", Ho, G(re(l.title)), 1))
2031
+ ])) : le("", !0),
2032
+ s("span", Wo, G(l.title), 1),
2033
+ l.parentTitle ? (w(), E("span", Xo, G(l.parentTitle), 1)) : le("", !0)
2034
+ ], 8, Go))), 128))
2035
+ ])) : (w(), E("div", Yo, " 未找到匹配的菜单 "))
2036
+ ])) : le("", !0)
2037
+ ]),
2038
+ _: 1
2039
+ })
2040
+ ], 512),
2041
+ s("div", {
2042
+ class: "mix-top-menu__action",
2043
+ onClick: ie,
2044
+ title: W.value ? "退出全屏" : "全屏"
2045
+ }, [
2046
+ R(y(Z), {
2047
+ name: W.value ? "fullscreen-exit" : "fullscreen",
2048
+ size: 16
2049
+ }, null, 8, ["name"])
2050
+ ], 8, Jo),
2051
+ s("div", {
2052
+ class: "mix-top-menu__action",
2053
+ onClick: we,
2054
+ title: "换肤设置"
2055
+ }, [
2056
+ R(y(Z), {
2057
+ name: "skin",
2058
+ size: 16
2059
+ })
2060
+ ]),
2061
+ s("div", {
2062
+ class: "mix-top-menu__action",
2063
+ onClick: D,
2064
+ title: "切换主题"
2065
+ }, [
2066
+ R(y(Z), {
2067
+ name: y(f).isDark ? "sun" : "moon",
2068
+ size: 16
2069
+ }, null, 8, ["name"])
2070
+ ]),
2071
+ s("div", {
2072
+ class: "mix-top-menu__user",
2073
+ ref_key: "dropdownRef",
2074
+ ref: I
2075
+ }, [
2076
+ s("div", {
2077
+ class: "mix-top-menu__user-trigger",
2078
+ onClick: it(Ce, ["stop"])
2079
+ }, [
2080
+ s("div", Zo, [
2081
+ s("span", null, G(((d = y(k).userName) == null ? void 0 : d.charAt(0)) || "U"), 1)
2082
+ ]),
2083
+ s("span", Qo, G(y(k).userName), 1),
2084
+ s("span", {
2085
+ class: _e(["mix-top-menu__user-arrow", { "is-active": V.value }])
2086
+ }, "▼", 2)
2087
+ ]),
2088
+ R(Ve, { name: "dropdown" }, {
2089
+ default: X(() => {
2090
+ var l;
2091
+ return [
2092
+ V.value ? (w(), E("div", er, [
2093
+ s("div", tr, [
2094
+ s("div", sr, [
2095
+ s("span", null, G(((l = y(k).userName) == null ? void 0 : l.charAt(0)) || "U"), 1)
2096
+ ]),
2097
+ s("div", nr, [
2098
+ s("div", or, G(y(k).userName), 1),
2099
+ s("div", rr, G(y(k).departmentName), 1)
2100
+ ])
2101
+ ]),
2102
+ a[8] || (a[8] = s("div", { class: "mix-top-menu__dropdown-divider" }, null, -1)),
2103
+ s("div", ar, [
2104
+ s("div", {
2105
+ class: "mix-top-menu__dropdown-item",
2106
+ onClick: B
2107
+ }, [
2108
+ R(y(Z), {
2109
+ name: "user",
2110
+ size: 16
2111
+ }),
2112
+ a[4] || (a[4] = s("span", null, "个人信息", -1))
2113
+ ]),
2114
+ s("div", {
2115
+ class: "mix-top-menu__dropdown-item",
2116
+ onClick: t
2117
+ }, [
2118
+ R(y(Z), {
2119
+ name: "lock",
2120
+ size: 16
2121
+ }),
2122
+ a[5] || (a[5] = s("span", null, "修改密码", -1))
2123
+ ]),
2124
+ a[7] || (a[7] = s("div", { class: "mix-top-menu__dropdown-divider" }, null, -1)),
2125
+ s("div", {
2126
+ class: "mix-top-menu__dropdown-item mix-top-menu__dropdown-item--danger",
2127
+ onClick: e
2128
+ }, [
2129
+ R(y(Z), {
2130
+ name: "logout",
2131
+ size: 16
2132
+ }),
2133
+ a[6] || (a[6] = s("span", null, "退出登录", -1))
2134
+ ])
2135
+ ])
2136
+ ])) : le("", !0)
2137
+ ];
2138
+ }),
2139
+ _: 1
2140
+ })
2141
+ ], 512)
2142
+ ]),
2143
+ R(y(Et), {
2144
+ modelValue: Y.value,
2145
+ "onUpdate:modelValue": a[2] || (a[2] = (l) => Y.value = l),
2146
+ title: "换肤设置",
2147
+ direction: "rtl",
2148
+ size: "320px"
2149
+ }, {
2150
+ default: X(() => [
2151
+ s("div", lr, [
2152
+ s("div", ir, [
2153
+ a[12] || (a[12] = s("div", { class: "settings-title" }, "布局模式", -1)),
2154
+ s("div", cr, [
2155
+ (w(), E(he, null, ge(N, (l) => s("div", {
2156
+ key: l.value,
2157
+ class: _e(["layout-option", { "is-active": Ue.value === l.value }]),
2158
+ onClick: (c) => Be(l.value)
2159
+ }, [
2160
+ s("div", dr, [
2161
+ l.value === "sidebar" ? (w(), E("div", fr, [...a[9] || (a[9] = [
2162
+ s("div", { class: "preview-aside" }, null, -1),
2163
+ s("div", { class: "preview-main" }, [
2164
+ s("div", { class: "preview-header" }),
2165
+ s("div", { class: "preview-content" })
2166
+ ], -1)
2167
+ ])])) : l.value === "top" ? (w(), E("div", pr, [...a[10] || (a[10] = [
2168
+ s("div", { class: "preview-header-full" }, null, -1),
2169
+ s("div", { class: "preview-content-full" }, null, -1)
2170
+ ])])) : (w(), E("div", mr, [...a[11] || (a[11] = [
2171
+ s("div", { class: "preview-header-mix" }, [
2172
+ s("div", { class: "preview-mix-left" })
2173
+ ], -1),
2174
+ s("div", { class: "preview-mix-body" }, [
2175
+ s("div", { class: "preview-mix-aside" }),
2176
+ s("div", { class: "preview-mix-content" })
2177
+ ], -1)
2178
+ ])]))
2179
+ ]),
2180
+ s("span", hr, G(l.label), 1)
2181
+ ], 10, ur)), 64))
2182
+ ])
2183
+ ]),
2184
+ s("div", vr, [
2185
+ a[13] || (a[13] = s("div", { class: "settings-title" }, "主题色", -1)),
2186
+ s("div", gr, [
2187
+ (w(), E(he, null, ge(Me, (l) => s("div", {
2188
+ key: l.value,
2189
+ class: _e(["color-option", { "is-active": y(f).primaryColor === l.value }]),
2190
+ style: Ye({ backgroundColor: l.value }),
2191
+ title: l.label,
2192
+ onClick: (c) => H(l.value)
2193
+ }, [
2194
+ y(f).primaryColor === l.value ? (w(), ce(y(Z), {
2195
+ key: 0,
2196
+ name: "check",
2197
+ size: 12,
2198
+ color: "#fff"
2199
+ })) : le("", !0)
2200
+ ], 14, _r)), 64))
2201
+ ])
2202
+ ]),
2203
+ s("div", wr, [
2204
+ a[18] || (a[18] = s("div", { class: "settings-title" }, "功能设置", -1)),
2205
+ s("div", yr, [
2206
+ s("div", br, [
2207
+ a[15] || (a[15] = s("span", null, "灰色模式", -1)),
2208
+ s("div", {
2209
+ class: _e(["switch-wrapper", { "is-checked": oe.value }]),
2210
+ onClick: Ne
2211
+ }, [...a[14] || (a[14] = [
2212
+ s("span", { class: "switch-core" }, null, -1)
2213
+ ])], 2)
2214
+ ]),
2215
+ s("div", kr, [
2216
+ a[17] || (a[17] = s("span", null, "暗黑模式", -1)),
2217
+ s("div", {
2218
+ class: _e(["switch-wrapper", { "is-checked": y(f).isDark }]),
2219
+ onClick: Oe
2220
+ }, [...a[16] || (a[16] = [
2221
+ s("span", { class: "switch-core" }, null, -1)
2222
+ ])], 2)
2223
+ ])
2224
+ ])
2225
+ ])
2226
+ ])
2227
+ ]),
2228
+ _: 1
2229
+ }, 8, ["modelValue"])
2230
+ ]);
2231
+ };
2232
+ }
2233
+ }), Cr = /* @__PURE__ */ $e(xr, [["__scopeId", "data-v-25806305"]]), Nr = {
2234
+ key: 0,
2235
+ class: "layout layout--sidebar"
2236
+ }, Er = { class: "layout__main" }, Sr = { class: "layout__header" }, $r = { class: "layout__content" }, Mr = {
2237
+ key: 1,
2238
+ class: "layout layout--top"
2239
+ }, Lr = { class: "layout__top-menu" }, Ir = { class: "layout__main" }, Ar = { class: "layout__content" }, Tr = {
2240
+ key: 2,
2241
+ class: "layout layout--mix"
2242
+ }, Or = { class: "layout__mix-top-menu" }, Ur = { class: "layout__mix-body" }, Br = { class: "layout__content" }, Pr = /* @__PURE__ */ Ae({
2243
+ __name: "index",
2244
+ setup(o) {
2245
+ const i = De(), v = Pe(), m = j(
2246
+ () => i.isCollapsed ? "64px" : "210px"
2247
+ ), f = j(() => i.layout), k = j(() => f.value === "mix"), S = j(() => f.value === "sidebar" ? v.menuList : f.value === "mix" ? i.mixSubMenus : []), g = j(() => k.value ? S.value.length > 0 : !1);
2248
+ return (M, _) => {
2249
+ const x = Rt("router-view");
2250
+ return w(), E(he, null, [
2251
+ f.value === "sidebar" ? (w(), E("div", Nr, [
2252
+ s("aside", {
2253
+ class: "layout__aside",
2254
+ style: Ye({ width: m.value })
2255
+ }, [
2256
+ R(Pt, {
2257
+ "menu-list": S.value,
2258
+ "show-logo": !0,
2259
+ "show-user": !0
2260
+ }, null, 8, ["menu-list"])
2261
+ ], 4),
2262
+ s("div", Er, [
2263
+ s("header", Sr, [
2264
+ R(Sn)
2265
+ ]),
2266
+ s("main", $r, [
2267
+ R(x)
2268
+ ])
2269
+ ])
2270
+ ])) : le("", !0),
2271
+ f.value === "top" ? (w(), E("div", Mr, [
2272
+ s("div", Lr, [
2273
+ R(Oo)
2274
+ ]),
2275
+ s("div", Ir, [
2276
+ s("main", Ar, [
2277
+ R(x)
2278
+ ])
2279
+ ])
2280
+ ])) : le("", !0),
2281
+ f.value === "mix" ? (w(), E("div", Tr, [
2282
+ s("div", Or, [
2283
+ R(Cr)
2284
+ ]),
2285
+ s("div", Ur, [
2286
+ g.value ? (w(), E("aside", {
2287
+ key: 0,
2288
+ class: "layout__aside",
2289
+ style: Ye({ width: m.value })
2290
+ }, [
2291
+ R(Pt, {
2292
+ "menu-list": S.value,
2293
+ "show-logo": !1,
2294
+ "show-user": !1
2295
+ }, null, 8, ["menu-list"])
2296
+ ], 4)) : le("", !0),
2297
+ s("main", Br, [
2298
+ R(x)
2299
+ ])
2300
+ ])
2301
+ ])) : le("", !0)
2302
+ ], 64);
2303
+ };
2304
+ }
2305
+ }), qt = /* @__PURE__ */ $e(Pr, [["__scopeId", "data-v-24c73186"]]), Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2306
+ __proto__: null,
2307
+ default: qt
2308
+ }, Symbol.toStringTag, { value: "Module" })), zr = { class: "tabs-wrapper" }, Dr = { class: "tab-label" }, Fr = ["onClick"], Vr = /* @__PURE__ */ Ae({
2309
+ __name: "Tabs",
2310
+ setup(o) {
2311
+ const i = qe(), v = ze(), m = j(() => {
2312
+ const g = [];
2313
+ return i.matched.forEach((M) => {
2314
+ var _;
2315
+ (_ = M.meta) != null && _.affix && g.push({
2316
+ name: M.name,
2317
+ title: M.meta.title,
2318
+ path: M.path,
2319
+ affix: !0
2320
+ });
2321
+ }), g;
2322
+ }), f = j(() => i.path), k = (g) => {
2323
+ v.push(g);
2324
+ }, S = (g) => {
2325
+ const M = m.value.find((_) => _.path === g);
2326
+ if (!(M != null && M.affix) && g === f.value) {
2327
+ const _ = m.value.findIndex((L) => L.path === g), x = m.value[_ - 1] || m.value[_ + 1];
2328
+ x && v.push(x.path);
2329
+ }
2330
+ };
2331
+ return (g, M) => (w(), E("div", zr, [
2332
+ R(y(ns), {
2333
+ modelValue: f.value,
2334
+ "onUpdate:modelValue": M[0] || (M[0] = (_) => f.value = _),
2335
+ type: "card",
2336
+ onTabClick: k
2337
+ }, {
2338
+ default: X(() => [
2339
+ (w(!0), E(he, null, ge(m.value, (_) => (w(), ce(y(os), {
2340
+ key: _.path,
2341
+ name: _.path,
2342
+ label: _.title,
2343
+ closable: !_.affix
2344
+ }, {
2345
+ label: X(() => [
2346
+ s("span", Dr, [
2347
+ Fe(G(_.title) + " ", 1),
2348
+ _.affix ? le("", !0) : (w(), E("span", {
2349
+ key: 0,
2350
+ class: "tab-close",
2351
+ onClick: it((x) => S(_.path), ["stop"])
2352
+ }, " ✕ ", 8, Fr))
2353
+ ])
2354
+ ]),
2355
+ _: 2
2356
+ }, 1032, ["name", "label", "closable"]))), 128))
2357
+ ]),
2358
+ _: 1
2359
+ }, 8, ["modelValue"])
2360
+ ]));
2361
+ }
2362
+ }), Xa = /* @__PURE__ */ $e(Vr, [["__scopeId", "data-v-9156d8cd"]]), jr = {}, qr = { class: "footer" };
2363
+ function Gr(o, i) {
2364
+ return w(), E("div", qr, [...i[0] || (i[0] = [
2365
+ s("span", null, "Copyright © 2024 Xto Demo. All Rights Reserved.", -1)
2366
+ ])]);
2367
+ }
2368
+ const Ya = /* @__PURE__ */ $e(jr, [["render", Gr], ["__scopeId", "data-v-4852826a"]]);
2369
+ var Kr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2370
+ function Hr(o) {
2371
+ return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
2372
+ }
2373
+ var dt = { exports: {} }, Gt = { exports: {} }, Kt = { exports: {} };
2374
+ (function(o) {
2375
+ (function(i) {
2376
+ var v, m = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, f = Math.ceil, k = Math.floor, S = "[BigNumber Error] ", g = S + "Number primitive has more than 15 significant digits: ", M = 1e14, _ = 14, x = 9007199254740991, L = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], C = 1e7, K = 1e9;
2377
+ function Q(U) {
2378
+ var A, J, ee, $ = N.prototype = { constructor: N, toString: null, valueOf: null }, re = new N(1), te = 20, D = 4, ie = -7, de = 21, Ce = -1e7, fe = 1e7, be = !1, ke = 1, we = 0, Te = {
2379
+ prefix: "",
2380
+ groupSize: 3,
2381
+ secondaryGroupSize: 0,
2382
+ groupSeparator: ",",
2383
+ decimalSeparator: ".",
2384
+ fractionGroupSize: 0,
2385
+ fractionGroupSeparator: " ",
2386
+ // non-breaking space
2387
+ suffix: ""
2388
+ }, Ne = "0123456789abcdefghijklmnopqrstuvwxyz", Oe = !0;
2389
+ function N(t, e) {
2390
+ var r, u, n, a, d, l, c, h, p = this;
2391
+ if (!(p instanceof N)) return new N(t, e);
2392
+ if (e == null) {
2393
+ if (t && t._isBigNumber === !0) {
2394
+ p.s = t.s, !t.c || t.e > fe ? p.c = p.e = null : t.e < Ce ? p.c = [p.e = 0] : (p.e = t.e, p.c = t.c.slice());
2395
+ return;
2396
+ }
2397
+ if ((l = typeof t == "number") && t * 0 == 0) {
2398
+ if (p.s = 1 / t < 0 ? (t = -t, -1) : 1, t === ~~t) {
2399
+ for (a = 0, d = t; d >= 10; d /= 10, a++) ;
2400
+ a > fe ? p.c = p.e = null : (p.e = a, p.c = [t]);
2401
+ return;
2402
+ }
2403
+ h = String(t);
2404
+ } else {
2405
+ if (!m.test(h = String(t))) return ee(p, h, l);
2406
+ p.s = h.charCodeAt(0) == 45 ? (h = h.slice(1), -1) : 1;
2407
+ }
2408
+ (a = h.indexOf(".")) > -1 && (h = h.replace(".", "")), (d = h.search(/e/i)) > 0 ? (a < 0 && (a = d), a += +h.slice(d + 1), h = h.substring(0, d)) : a < 0 && (a = h.length);
2409
+ } else {
2410
+ if (I(e, 2, Ne.length, "Base"), e == 10 && Oe)
2411
+ return p = new N(t), H(p, te + p.e + 1, D);
2412
+ if (h = String(t), l = typeof t == "number") {
2413
+ if (t * 0 != 0) return ee(p, h, l, e);
2414
+ if (p.s = 1 / t < 0 ? (h = h.slice(1), -1) : 1, N.DEBUG && h.replace(/^0\.0*|\./, "").length > 15)
2415
+ throw Error(g + t);
2416
+ } else
2417
+ p.s = h.charCodeAt(0) === 45 ? (h = h.slice(1), -1) : 1;
2418
+ for (r = Ne.slice(0, e), a = d = 0, c = h.length; d < c; d++)
2419
+ if (r.indexOf(u = h.charAt(d)) < 0) {
2420
+ if (u == ".") {
2421
+ if (d > a) {
2422
+ a = c;
2423
+ continue;
2424
+ }
2425
+ } else if (!n && (h == h.toUpperCase() && (h = h.toLowerCase()) || h == h.toLowerCase() && (h = h.toUpperCase()))) {
2426
+ n = !0, d = -1, a = 0;
2427
+ continue;
2428
+ }
2429
+ return ee(p, String(t), l, e);
2430
+ }
2431
+ l = !1, h = J(h, e, 10, p.s), (a = h.indexOf(".")) > -1 ? h = h.replace(".", "") : a = h.length;
2432
+ }
2433
+ for (d = 0; h.charCodeAt(d) === 48; d++) ;
2434
+ for (c = h.length; h.charCodeAt(--c) === 48; ) ;
2435
+ if (h = h.slice(d, ++c)) {
2436
+ if (c -= d, l && N.DEBUG && c > 15 && (t > x || t !== k(t)))
2437
+ throw Error(g + p.s * t);
2438
+ if ((a = a - d - 1) > fe)
2439
+ p.c = p.e = null;
2440
+ else if (a < Ce)
2441
+ p.c = [p.e = 0];
2442
+ else {
2443
+ if (p.e = a, p.c = [], d = (a + 1) % _, a < 0 && (d += _), d < c) {
2444
+ for (d && p.c.push(+h.slice(0, d)), c -= _; d < c; )
2445
+ p.c.push(+h.slice(d, d += _));
2446
+ d = _ - (h = h.slice(d)).length;
2447
+ } else
2448
+ d -= c;
2449
+ for (; d--; h += "0") ;
2450
+ p.c.push(+h);
2451
+ }
2452
+ } else
2453
+ p.c = [p.e = 0];
2454
+ }
2455
+ N.clone = Q, N.ROUND_UP = 0, N.ROUND_DOWN = 1, N.ROUND_CEIL = 2, N.ROUND_FLOOR = 3, N.ROUND_HALF_UP = 4, N.ROUND_HALF_DOWN = 5, N.ROUND_HALF_EVEN = 6, N.ROUND_HALF_CEIL = 7, N.ROUND_HALF_FLOOR = 8, N.EUCLID = 9, N.config = N.set = function(t) {
2456
+ var e, r;
2457
+ if (t != null)
2458
+ if (typeof t == "object") {
2459
+ if (t.hasOwnProperty(e = "DECIMAL_PLACES") && (r = t[e], I(r, 0, K, e), te = r), t.hasOwnProperty(e = "ROUNDING_MODE") && (r = t[e], I(r, 0, 8, e), D = r), t.hasOwnProperty(e = "EXPONENTIAL_AT") && (r = t[e], r && r.pop ? (I(r[0], -K, 0, e), I(r[1], 0, K, e), ie = r[0], de = r[1]) : (I(r, -K, K, e), ie = -(de = r < 0 ? -r : r))), t.hasOwnProperty(e = "RANGE"))
2460
+ if (r = t[e], r && r.pop)
2461
+ I(r[0], -K, -1, e), I(r[1], 1, K, e), Ce = r[0], fe = r[1];
2462
+ else if (I(r, -K, K, e), r)
2463
+ Ce = -(fe = r < 0 ? -r : r);
2464
+ else
2465
+ throw Error(S + e + " cannot be zero: " + r);
2466
+ if (t.hasOwnProperty(e = "CRYPTO"))
2467
+ if (r = t[e], r === !!r)
2468
+ if (r)
2469
+ if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
2470
+ be = r;
2471
+ else
2472
+ throw be = !r, Error(S + "crypto unavailable");
2473
+ else
2474
+ be = r;
2475
+ else
2476
+ throw Error(S + e + " not true or false: " + r);
2477
+ if (t.hasOwnProperty(e = "MODULO_MODE") && (r = t[e], I(r, 0, 9, e), ke = r), t.hasOwnProperty(e = "POW_PRECISION") && (r = t[e], I(r, 0, K, e), we = r), t.hasOwnProperty(e = "FORMAT"))
2478
+ if (r = t[e], typeof r == "object") Te = r;
2479
+ else throw Error(S + e + " not an object: " + r);
2480
+ if (t.hasOwnProperty(e = "ALPHABET"))
2481
+ if (r = t[e], typeof r == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(r))
2482
+ Oe = r.slice(0, 10) == "0123456789", Ne = r;
2483
+ else
2484
+ throw Error(S + e + " invalid: " + r);
2485
+ } else
2486
+ throw Error(S + "Object expected: " + t);
2487
+ return {
2488
+ DECIMAL_PLACES: te,
2489
+ ROUNDING_MODE: D,
2490
+ EXPONENTIAL_AT: [ie, de],
2491
+ RANGE: [Ce, fe],
2492
+ CRYPTO: be,
2493
+ MODULO_MODE: ke,
2494
+ POW_PRECISION: we,
2495
+ FORMAT: Te,
2496
+ ALPHABET: Ne
2497
+ };
2498
+ }, N.isBigNumber = function(t) {
2499
+ if (!t || t._isBigNumber !== !0) return !1;
2500
+ if (!N.DEBUG) return !0;
2501
+ var e, r, u = t.c, n = t.e, a = t.s;
2502
+ e: if ({}.toString.call(u) == "[object Array]") {
2503
+ if ((a === 1 || a === -1) && n >= -K && n <= K && n === k(n)) {
2504
+ if (u[0] === 0) {
2505
+ if (n === 0 && u.length === 1) return !0;
2506
+ break e;
2507
+ }
2508
+ if (e = (n + 1) % _, e < 1 && (e += _), String(u[0]).length == e) {
2509
+ for (e = 0; e < u.length; e++)
2510
+ if (r = u[e], r < 0 || r >= M || r !== k(r)) break e;
2511
+ if (r !== 0) return !0;
2512
+ }
2513
+ }
2514
+ } else if (u === null && n === null && (a === null || a === 1 || a === -1))
2515
+ return !0;
2516
+ throw Error(S + "Invalid BigNumber: " + t);
2517
+ }, N.maximum = N.max = function() {
2518
+ return Be(arguments, -1);
2519
+ }, N.minimum = N.min = function() {
2520
+ return Be(arguments, 1);
2521
+ }, N.random = function() {
2522
+ var t = 9007199254740992, e = Math.random() * t & 2097151 ? function() {
2523
+ return k(Math.random() * t);
2524
+ } : function() {
2525
+ return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
2526
+ };
2527
+ return function(r) {
2528
+ var u, n, a, d, l, c = 0, h = [], p = new N(re);
2529
+ if (r == null ? r = te : I(r, 0, K), d = f(r / _), be)
2530
+ if (crypto.getRandomValues) {
2531
+ for (u = crypto.getRandomValues(new Uint32Array(d *= 2)); c < d; )
2532
+ l = u[c] * 131072 + (u[c + 1] >>> 11), l >= 9e15 ? (n = crypto.getRandomValues(new Uint32Array(2)), u[c] = n[0], u[c + 1] = n[1]) : (h.push(l % 1e14), c += 2);
2533
+ c = d / 2;
2534
+ } else if (crypto.randomBytes) {
2535
+ for (u = crypto.randomBytes(d *= 7); c < d; )
2536
+ l = (u[c] & 31) * 281474976710656 + u[c + 1] * 1099511627776 + u[c + 2] * 4294967296 + u[c + 3] * 16777216 + (u[c + 4] << 16) + (u[c + 5] << 8) + u[c + 6], l >= 9e15 ? crypto.randomBytes(7).copy(u, c) : (h.push(l % 1e14), c += 7);
2537
+ c = d / 7;
2538
+ } else
2539
+ throw be = !1, Error(S + "crypto unavailable");
2540
+ if (!be)
2541
+ for (; c < d; )
2542
+ l = e(), l < 9e15 && (h[c++] = l % 1e14);
2543
+ for (d = h[--c], r %= _, d && r && (l = L[_ - r], h[c] = k(d / l) * l); h[c] === 0; h.pop(), c--) ;
2544
+ if (c < 0)
2545
+ h = [a = 0];
2546
+ else {
2547
+ for (a = -1; h[0] === 0; h.splice(0, 1), a -= _) ;
2548
+ for (c = 1, l = h[0]; l >= 10; l /= 10, c++) ;
2549
+ c < _ && (a -= _ - c);
2550
+ }
2551
+ return p.e = a, p.c = h, p;
2552
+ };
2553
+ }(), N.sum = function() {
2554
+ for (var t = 1, e = arguments, r = new N(e[0]); t < e.length; ) r = r.plus(e[t++]);
2555
+ return r;
2556
+ }, J = /* @__PURE__ */ function() {
2557
+ var t = "0123456789";
2558
+ function e(r, u, n, a) {
2559
+ for (var d, l = [0], c, h = 0, p = r.length; h < p; ) {
2560
+ for (c = l.length; c--; l[c] *= u) ;
2561
+ for (l[0] += a.indexOf(r.charAt(h++)), d = 0; d < l.length; d++)
2562
+ l[d] > n - 1 && (l[d + 1] == null && (l[d + 1] = 0), l[d + 1] += l[d] / n | 0, l[d] %= n);
2563
+ }
2564
+ return l.reverse();
2565
+ }
2566
+ return function(r, u, n, a, d) {
2567
+ var l, c, h, p, b, z, F, ne, pe = r.indexOf("."), ve = te, se = D;
2568
+ for (pe >= 0 && (p = we, we = 0, r = r.replace(".", ""), ne = new N(u), z = ne.pow(r.length - pe), we = p, ne.c = e(
2569
+ oe(T(z.c), z.e, "0"),
2570
+ 10,
2571
+ n,
2572
+ t
2573
+ ), ne.e = ne.c.length), F = e(r, u, n, d ? (l = Ne, t) : (l = t, Ne)), h = p = F.length; F[--p] == 0; F.pop()) ;
2574
+ if (!F[0]) return l.charAt(0);
2575
+ if (pe < 0 ? --h : (z.c = F, z.e = h, z.s = a, z = A(z, ne, ve, se, n), F = z.c, b = z.r, h = z.e), c = h + ve + 1, pe = F[c], p = n / 2, b = b || c < 0 || F[c + 1] != null, b = se < 4 ? (pe != null || b) && (se == 0 || se == (z.s < 0 ? 3 : 2)) : pe > p || pe == p && (se == 4 || b || se == 6 && F[c - 1] & 1 || se == (z.s < 0 ? 8 : 7)), c < 1 || !F[0])
2576
+ r = b ? oe(l.charAt(1), -ve, l.charAt(0)) : l.charAt(0);
2577
+ else {
2578
+ if (F.length = c, b)
2579
+ for (--n; ++F[--c] > n; )
2580
+ F[c] = 0, c || (++h, F = [1].concat(F));
2581
+ for (p = F.length; !F[--p]; ) ;
2582
+ for (pe = 0, r = ""; pe <= p; r += l.charAt(F[pe++])) ;
2583
+ r = oe(r, h, l.charAt(0));
2584
+ }
2585
+ return r;
2586
+ };
2587
+ }(), A = /* @__PURE__ */ function() {
2588
+ function t(u, n, a) {
2589
+ var d, l, c, h, p = 0, b = u.length, z = n % C, F = n / C | 0;
2590
+ for (u = u.slice(); b--; )
2591
+ c = u[b] % C, h = u[b] / C | 0, d = F * c + h * z, l = z * c + d % C * C + p, p = (l / a | 0) + (d / C | 0) + F * h, u[b] = l % a;
2592
+ return p && (u = [p].concat(u)), u;
2593
+ }
2594
+ function e(u, n, a, d) {
2595
+ var l, c;
2596
+ if (a != d)
2597
+ c = a > d ? 1 : -1;
2598
+ else
2599
+ for (l = c = 0; l < a; l++)
2600
+ if (u[l] != n[l]) {
2601
+ c = u[l] > n[l] ? 1 : -1;
2602
+ break;
2603
+ }
2604
+ return c;
2605
+ }
2606
+ function r(u, n, a, d) {
2607
+ for (var l = 0; a--; )
2608
+ u[a] -= l, l = u[a] < n[a] ? 1 : 0, u[a] = l * d + u[a] - n[a];
2609
+ for (; !u[0] && u.length > 1; u.splice(0, 1)) ;
2610
+ }
2611
+ return function(u, n, a, d, l) {
2612
+ var c, h, p, b, z, F, ne, pe, ve, se, ae, ye, Qe, ft, pt, Le, Ge, Ee = u.s == n.s ? 1 : -1, xe = u.c, me = n.c;
2613
+ if (!xe || !xe[0] || !me || !me[0])
2614
+ return new N(
2615
+ // Return NaN if either NaN, or both Infinity or 0.
2616
+ !u.s || !n.s || (xe ? me && xe[0] == me[0] : !me) ? NaN : (
2617
+ // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
2618
+ xe && xe[0] == 0 || !me ? Ee * 0 : Ee / 0
2619
+ )
2620
+ );
2621
+ for (pe = new N(Ee), ve = pe.c = [], h = u.e - n.e, Ee = a + h + 1, l || (l = M, h = O(u.e / _) - O(n.e / _), Ee = Ee / _ | 0), p = 0; me[p] == (xe[p] || 0); p++) ;
2622
+ if (me[p] > (xe[p] || 0) && h--, Ee < 0)
2623
+ ve.push(1), b = !0;
2624
+ else {
2625
+ for (ft = xe.length, Le = me.length, p = 0, Ee += 2, z = k(l / (me[0] + 1)), z > 1 && (me = t(me, z, l), xe = t(xe, z, l), Le = me.length, ft = xe.length), Qe = Le, se = xe.slice(0, Le), ae = se.length; ae < Le; se[ae++] = 0) ;
2626
+ Ge = me.slice(), Ge = [0].concat(Ge), pt = me[0], me[1] >= l / 2 && pt++;
2627
+ do {
2628
+ if (z = 0, c = e(me, se, Le, ae), c < 0) {
2629
+ if (ye = se[0], Le != ae && (ye = ye * l + (se[1] || 0)), z = k(ye / pt), z > 1)
2630
+ for (z >= l && (z = l - 1), F = t(me, z, l), ne = F.length, ae = se.length; e(F, se, ne, ae) == 1; )
2631
+ z--, r(F, Le < ne ? Ge : me, ne, l), ne = F.length, c = 1;
2632
+ else
2633
+ z == 0 && (c = z = 1), F = me.slice(), ne = F.length;
2634
+ if (ne < ae && (F = [0].concat(F)), r(se, F, ae, l), ae = se.length, c == -1)
2635
+ for (; e(me, se, Le, ae) < 1; )
2636
+ z++, r(se, Le < ae ? Ge : me, ae, l), ae = se.length;
2637
+ } else c === 0 && (z++, se = [0]);
2638
+ ve[p++] = z, se[0] ? se[ae++] = xe[Qe] || 0 : (se = [xe[Qe]], ae = 1);
2639
+ } while ((Qe++ < ft || se[0] != null) && Ee--);
2640
+ b = se[0] != null, ve[0] || ve.splice(0, 1);
2641
+ }
2642
+ if (l == M) {
2643
+ for (p = 1, Ee = ve[0]; Ee >= 10; Ee /= 10, p++) ;
2644
+ H(pe, a + (pe.e = p + h * _ - 1) + 1, d, b);
2645
+ } else
2646
+ pe.e = h, pe.r = +b;
2647
+ return pe;
2648
+ };
2649
+ }();
2650
+ function Ue(t, e, r, u) {
2651
+ var n, a, d, l, c;
2652
+ if (r == null ? r = D : I(r, 0, 8), !t.c) return t.toString();
2653
+ if (n = t.c[0], d = t.e, e == null)
2654
+ c = T(t.c), c = u == 1 || u == 2 && (d <= ie || d >= de) ? Y(c, d) : oe(c, d, "0");
2655
+ else if (t = H(new N(t), e, r), a = t.e, c = T(t.c), l = c.length, u == 1 || u == 2 && (e <= a || a <= ie)) {
2656
+ for (; l < e; c += "0", l++) ;
2657
+ c = Y(c, a);
2658
+ } else if (e -= d + (u === 2 && a > d), c = oe(c, a, "0"), a + 1 > l) {
2659
+ if (--e > 0) for (c += "."; e--; c += "0") ;
2660
+ } else if (e += a - l, e > 0)
2661
+ for (a + 1 == l && (c += "."); e--; c += "0") ;
2662
+ return t.s < 0 && n ? "-" + c : c;
2663
+ }
2664
+ function Be(t, e) {
2665
+ for (var r, u, n = 1, a = new N(t[0]); n < t.length; n++)
2666
+ u = new N(t[n]), (!u.s || (r = V(a, u)) === e || r === 0 && a.s === e) && (a = u);
2667
+ return a;
2668
+ }
2669
+ function Me(t, e, r) {
2670
+ for (var u = 1, n = e.length; !e[--n]; e.pop()) ;
2671
+ for (n = e[0]; n >= 10; n /= 10, u++) ;
2672
+ return (r = u + r * _ - 1) > fe ? t.c = t.e = null : r < Ce ? t.c = [t.e = 0] : (t.e = r, t.c = e), t;
2673
+ }
2674
+ ee = /* @__PURE__ */ function() {
2675
+ var t = /^(-?)0([xbo])(?=\w[\w.]*$)/i, e = /^([^.]+)\.$/, r = /^\.([^.]+)$/, u = /^-?(Infinity|NaN)$/, n = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
2676
+ return function(a, d, l, c) {
2677
+ var h, p = l ? d : d.replace(n, "");
2678
+ if (u.test(p))
2679
+ a.s = isNaN(p) ? null : p < 0 ? -1 : 1;
2680
+ else {
2681
+ if (!l && (p = p.replace(t, function(b, z, F) {
2682
+ return h = (F = F.toLowerCase()) == "x" ? 16 : F == "b" ? 2 : 8, !c || c == h ? z : b;
2683
+ }), c && (h = c, p = p.replace(e, "$1").replace(r, "0.$1")), d != p))
2684
+ return new N(p, h);
2685
+ if (N.DEBUG)
2686
+ throw Error(S + "Not a" + (c ? " base " + c : "") + " number: " + d);
2687
+ a.s = null;
2688
+ }
2689
+ a.c = a.e = null;
2690
+ };
2691
+ }();
2692
+ function H(t, e, r, u) {
2693
+ var n, a, d, l, c, h, p, b = t.c, z = L;
2694
+ if (b) {
2695
+ e: {
2696
+ for (n = 1, l = b[0]; l >= 10; l /= 10, n++) ;
2697
+ if (a = e - n, a < 0)
2698
+ a += _, d = e, c = b[h = 0], p = k(c / z[n - d - 1] % 10);
2699
+ else if (h = f((a + 1) / _), h >= b.length)
2700
+ if (u) {
2701
+ for (; b.length <= h; b.push(0)) ;
2702
+ c = p = 0, n = 1, a %= _, d = a - _ + 1;
2703
+ } else
2704
+ break e;
2705
+ else {
2706
+ for (c = l = b[h], n = 1; l >= 10; l /= 10, n++) ;
2707
+ a %= _, d = a - _ + n, p = d < 0 ? 0 : k(c / z[n - d - 1] % 10);
2708
+ }
2709
+ if (u = u || e < 0 || // Are there any non-zero digits after the rounding digit?
2710
+ // The expression n % pows10[d - j - 1] returns all digits of n to the right
2711
+ // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
2712
+ b[h + 1] != null || (d < 0 ? c : c % z[n - d - 1]), u = r < 4 ? (p || u) && (r == 0 || r == (t.s < 0 ? 3 : 2)) : p > 5 || p == 5 && (r == 4 || u || r == 6 && // Check whether the digit to the left of the rounding digit is odd.
2713
+ (a > 0 ? d > 0 ? c / z[n - d] : 0 : b[h - 1]) % 10 & 1 || r == (t.s < 0 ? 8 : 7)), e < 1 || !b[0])
2714
+ return b.length = 0, u ? (e -= t.e + 1, b[0] = z[(_ - e % _) % _], t.e = -e || 0) : b[0] = t.e = 0, t;
2715
+ if (a == 0 ? (b.length = h, l = 1, h--) : (b.length = h + 1, l = z[_ - a], b[h] = d > 0 ? k(c / z[n - d] % z[d]) * l : 0), u)
2716
+ for (; ; )
2717
+ if (h == 0) {
2718
+ for (a = 1, d = b[0]; d >= 10; d /= 10, a++) ;
2719
+ for (d = b[0] += l, l = 1; d >= 10; d /= 10, l++) ;
2720
+ a != l && (t.e++, b[0] == M && (b[0] = 1));
2721
+ break;
2722
+ } else {
2723
+ if (b[h] += l, b[h] != M) break;
2724
+ b[h--] = 0, l = 1;
2725
+ }
2726
+ for (a = b.length; b[--a] === 0; b.pop()) ;
2727
+ }
2728
+ t.e > fe ? t.c = t.e = null : t.e < Ce && (t.c = [t.e = 0]);
2729
+ }
2730
+ return t;
2731
+ }
2732
+ function B(t) {
2733
+ var e, r = t.e;
2734
+ return r === null ? t.toString() : (e = T(t.c), e = r <= ie || r >= de ? Y(e, r) : oe(e, r, "0"), t.s < 0 ? "-" + e : e);
2735
+ }
2736
+ return $.absoluteValue = $.abs = function() {
2737
+ var t = new N(this);
2738
+ return t.s < 0 && (t.s = 1), t;
2739
+ }, $.comparedTo = function(t, e) {
2740
+ return V(this, new N(t, e));
2741
+ }, $.decimalPlaces = $.dp = function(t, e) {
2742
+ var r, u, n, a = this;
2743
+ if (t != null)
2744
+ return I(t, 0, K), e == null ? e = D : I(e, 0, 8), H(new N(a), t + a.e + 1, e);
2745
+ if (!(r = a.c)) return null;
2746
+ if (u = ((n = r.length - 1) - O(this.e / _)) * _, n = r[n]) for (; n % 10 == 0; n /= 10, u--) ;
2747
+ return u < 0 && (u = 0), u;
2748
+ }, $.dividedBy = $.div = function(t, e) {
2749
+ return A(this, new N(t, e), te, D);
2750
+ }, $.dividedToIntegerBy = $.idiv = function(t, e) {
2751
+ return A(this, new N(t, e), 0, 1);
2752
+ }, $.exponentiatedBy = $.pow = function(t, e) {
2753
+ var r, u, n, a, d, l, c, h, p, b = this;
2754
+ if (t = new N(t), t.c && !t.isInteger())
2755
+ throw Error(S + "Exponent not an integer: " + B(t));
2756
+ if (e != null && (e = new N(e)), l = t.e > 14, !b.c || !b.c[0] || b.c[0] == 1 && !b.e && b.c.length == 1 || !t.c || !t.c[0])
2757
+ return p = new N(Math.pow(+B(b), l ? t.s * (2 - W(t)) : +B(t))), e ? p.mod(e) : p;
2758
+ if (c = t.s < 0, e) {
2759
+ if (e.c ? !e.c[0] : !e.s) return new N(NaN);
2760
+ u = !c && b.isInteger() && e.isInteger(), u && (b = b.mod(e));
2761
+ } else {
2762
+ if (t.e > 9 && (b.e > 0 || b.e < -1 || (b.e == 0 ? b.c[0] > 1 || l && b.c[1] >= 24e7 : b.c[0] < 8e13 || l && b.c[0] <= 9999975e7)))
2763
+ return a = b.s < 0 && W(t) ? -0 : 0, b.e > -1 && (a = 1 / a), new N(c ? 1 / a : a);
2764
+ we && (a = f(we / _ + 2));
2765
+ }
2766
+ for (l ? (r = new N(0.5), c && (t.s = 1), h = W(t)) : (n = Math.abs(+B(t)), h = n % 2), p = new N(re); ; ) {
2767
+ if (h) {
2768
+ if (p = p.times(b), !p.c) break;
2769
+ a ? p.c.length > a && (p.c.length = a) : u && (p = p.mod(e));
2770
+ }
2771
+ if (n) {
2772
+ if (n = k(n / 2), n === 0) break;
2773
+ h = n % 2;
2774
+ } else if (t = t.times(r), H(t, t.e + 1, 1), t.e > 14)
2775
+ h = W(t);
2776
+ else {
2777
+ if (n = +B(t), n === 0) break;
2778
+ h = n % 2;
2779
+ }
2780
+ b = b.times(b), a ? b.c && b.c.length > a && (b.c.length = a) : u && (b = b.mod(e));
2781
+ }
2782
+ return u ? p : (c && (p = re.div(p)), e ? p.mod(e) : a ? H(p, we, D, d) : p);
2783
+ }, $.integerValue = function(t) {
2784
+ var e = new N(this);
2785
+ return t == null ? t = D : I(t, 0, 8), H(e, e.e + 1, t);
2786
+ }, $.isEqualTo = $.eq = function(t, e) {
2787
+ return V(this, new N(t, e)) === 0;
2788
+ }, $.isFinite = function() {
2789
+ return !!this.c;
2790
+ }, $.isGreaterThan = $.gt = function(t, e) {
2791
+ return V(this, new N(t, e)) > 0;
2792
+ }, $.isGreaterThanOrEqualTo = $.gte = function(t, e) {
2793
+ return (e = V(this, new N(t, e))) === 1 || e === 0;
2794
+ }, $.isInteger = function() {
2795
+ return !!this.c && O(this.e / _) > this.c.length - 2;
2796
+ }, $.isLessThan = $.lt = function(t, e) {
2797
+ return V(this, new N(t, e)) < 0;
2798
+ }, $.isLessThanOrEqualTo = $.lte = function(t, e) {
2799
+ return (e = V(this, new N(t, e))) === -1 || e === 0;
2800
+ }, $.isNaN = function() {
2801
+ return !this.s;
2802
+ }, $.isNegative = function() {
2803
+ return this.s < 0;
2804
+ }, $.isPositive = function() {
2805
+ return this.s > 0;
2806
+ }, $.isZero = function() {
2807
+ return !!this.c && this.c[0] == 0;
2808
+ }, $.minus = function(t, e) {
2809
+ var r, u, n, a, d = this, l = d.s;
2810
+ if (t = new N(t, e), e = t.s, !l || !e) return new N(NaN);
2811
+ if (l != e)
2812
+ return t.s = -e, d.plus(t);
2813
+ var c = d.e / _, h = t.e / _, p = d.c, b = t.c;
2814
+ if (!c || !h) {
2815
+ if (!p || !b) return p ? (t.s = -e, t) : new N(b ? d : NaN);
2816
+ if (!p[0] || !b[0])
2817
+ return b[0] ? (t.s = -e, t) : new N(p[0] ? d : (
2818
+ // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
2819
+ D == 3 ? -0 : 0
2820
+ ));
2821
+ }
2822
+ if (c = O(c), h = O(h), p = p.slice(), l = c - h) {
2823
+ for ((a = l < 0) ? (l = -l, n = p) : (h = c, n = b), n.reverse(), e = l; e--; n.push(0)) ;
2824
+ n.reverse();
2825
+ } else
2826
+ for (u = (a = (l = p.length) < (e = b.length)) ? l : e, l = e = 0; e < u; e++)
2827
+ if (p[e] != b[e]) {
2828
+ a = p[e] < b[e];
2829
+ break;
2830
+ }
2831
+ if (a && (n = p, p = b, b = n, t.s = -t.s), e = (u = b.length) - (r = p.length), e > 0) for (; e--; p[r++] = 0) ;
2832
+ for (e = M - 1; u > l; ) {
2833
+ if (p[--u] < b[u]) {
2834
+ for (r = u; r && !p[--r]; p[r] = e) ;
2835
+ --p[r], p[u] += M;
2836
+ }
2837
+ p[u] -= b[u];
2838
+ }
2839
+ for (; p[0] == 0; p.splice(0, 1), --h) ;
2840
+ return p[0] ? Me(t, p, h) : (t.s = D == 3 ? -1 : 1, t.c = [t.e = 0], t);
2841
+ }, $.modulo = $.mod = function(t, e) {
2842
+ var r, u, n = this;
2843
+ return t = new N(t, e), !n.c || !t.s || t.c && !t.c[0] ? new N(NaN) : !t.c || n.c && !n.c[0] ? new N(n) : (ke == 9 ? (u = t.s, t.s = 1, r = A(n, t, 0, 3), t.s = u, r.s *= u) : r = A(n, t, 0, ke), t = n.minus(r.times(t)), !t.c[0] && ke == 1 && (t.s = n.s), t);
2844
+ }, $.multipliedBy = $.times = function(t, e) {
2845
+ var r, u, n, a, d, l, c, h, p, b, z, F, ne, pe, ve, se = this, ae = se.c, ye = (t = new N(t, e)).c;
2846
+ if (!ae || !ye || !ae[0] || !ye[0])
2847
+ return !se.s || !t.s || ae && !ae[0] && !ye || ye && !ye[0] && !ae ? t.c = t.e = t.s = null : (t.s *= se.s, !ae || !ye ? t.c = t.e = null : (t.c = [0], t.e = 0)), t;
2848
+ for (u = O(se.e / _) + O(t.e / _), t.s *= se.s, c = ae.length, b = ye.length, c < b && (ne = ae, ae = ye, ye = ne, n = c, c = b, b = n), n = c + b, ne = []; n--; ne.push(0)) ;
2849
+ for (pe = M, ve = C, n = b; --n >= 0; ) {
2850
+ for (r = 0, z = ye[n] % ve, F = ye[n] / ve | 0, d = c, a = n + d; a > n; )
2851
+ h = ae[--d] % ve, p = ae[d] / ve | 0, l = F * h + p * z, h = z * h + l % ve * ve + ne[a] + r, r = (h / pe | 0) + (l / ve | 0) + F * p, ne[a--] = h % pe;
2852
+ ne[a] = r;
2853
+ }
2854
+ return r ? ++u : ne.splice(0, 1), Me(t, ne, u);
2855
+ }, $.negated = function() {
2856
+ var t = new N(this);
2857
+ return t.s = -t.s || null, t;
2858
+ }, $.plus = function(t, e) {
2859
+ var r, u = this, n = u.s;
2860
+ if (t = new N(t, e), e = t.s, !n || !e) return new N(NaN);
2861
+ if (n != e)
2862
+ return t.s = -e, u.minus(t);
2863
+ var a = u.e / _, d = t.e / _, l = u.c, c = t.c;
2864
+ if (!a || !d) {
2865
+ if (!l || !c) return new N(n / 0);
2866
+ if (!l[0] || !c[0]) return c[0] ? t : new N(l[0] ? u : n * 0);
2867
+ }
2868
+ if (a = O(a), d = O(d), l = l.slice(), n = a - d) {
2869
+ for (n > 0 ? (d = a, r = c) : (n = -n, r = l), r.reverse(); n--; r.push(0)) ;
2870
+ r.reverse();
2871
+ }
2872
+ for (n = l.length, e = c.length, n - e < 0 && (r = c, c = l, l = r, e = n), n = 0; e; )
2873
+ n = (l[--e] = l[e] + c[e] + n) / M | 0, l[e] = M === l[e] ? 0 : l[e] % M;
2874
+ return n && (l = [n].concat(l), ++d), Me(t, l, d);
2875
+ }, $.precision = $.sd = function(t, e) {
2876
+ var r, u, n, a = this;
2877
+ if (t != null && t !== !!t)
2878
+ return I(t, 1, K), e == null ? e = D : I(e, 0, 8), H(new N(a), t, e);
2879
+ if (!(r = a.c)) return null;
2880
+ if (n = r.length - 1, u = n * _ + 1, n = r[n]) {
2881
+ for (; n % 10 == 0; n /= 10, u--) ;
2882
+ for (n = r[0]; n >= 10; n /= 10, u++) ;
2883
+ }
2884
+ return t && a.e + 1 > u && (u = a.e + 1), u;
2885
+ }, $.shiftedBy = function(t) {
2886
+ return I(t, -x, x), this.times("1e" + t);
2887
+ }, $.squareRoot = $.sqrt = function() {
2888
+ var t, e, r, u, n, a = this, d = a.c, l = a.s, c = a.e, h = te + 4, p = new N("0.5");
2889
+ if (l !== 1 || !d || !d[0])
2890
+ return new N(!l || l < 0 && (!d || d[0]) ? NaN : d ? a : 1 / 0);
2891
+ if (l = Math.sqrt(+B(a)), l == 0 || l == 1 / 0 ? (e = T(d), (e.length + c) % 2 == 0 && (e += "0"), l = Math.sqrt(+e), c = O((c + 1) / 2) - (c < 0 || c % 2), l == 1 / 0 ? e = "5e" + c : (e = l.toExponential(), e = e.slice(0, e.indexOf("e") + 1) + c), r = new N(e)) : r = new N(l + ""), r.c[0]) {
2892
+ for (c = r.e, l = c + h, l < 3 && (l = 0); ; )
2893
+ if (n = r, r = p.times(n.plus(A(a, n, h, 1))), T(n.c).slice(0, l) === (e = T(r.c)).slice(0, l))
2894
+ if (r.e < c && --l, e = e.slice(l - 3, l + 1), e == "9999" || !u && e == "4999") {
2895
+ if (!u && (H(n, n.e + te + 2, 0), n.times(n).eq(a))) {
2896
+ r = n;
2897
+ break;
2898
+ }
2899
+ h += 4, l += 4, u = 1;
2900
+ } else {
2901
+ (!+e || !+e.slice(1) && e.charAt(0) == "5") && (H(r, r.e + te + 2, 1), t = !r.times(r).eq(a));
2902
+ break;
2903
+ }
2904
+ }
2905
+ return H(r, r.e + te + 1, D, t);
2906
+ }, $.toExponential = function(t, e) {
2907
+ return t != null && (I(t, 0, K), t++), Ue(this, t, e, 1);
2908
+ }, $.toFixed = function(t, e) {
2909
+ return t != null && (I(t, 0, K), t = t + this.e + 1), Ue(this, t, e);
2910
+ }, $.toFormat = function(t, e, r) {
2911
+ var u, n = this;
2912
+ if (r == null)
2913
+ t != null && e && typeof e == "object" ? (r = e, e = null) : t && typeof t == "object" ? (r = t, t = e = null) : r = Te;
2914
+ else if (typeof r != "object")
2915
+ throw Error(S + "Argument not an object: " + r);
2916
+ if (u = n.toFixed(t, e), n.c) {
2917
+ var a, d = u.split("."), l = +r.groupSize, c = +r.secondaryGroupSize, h = r.groupSeparator || "", p = d[0], b = d[1], z = n.s < 0, F = z ? p.slice(1) : p, ne = F.length;
2918
+ if (c && (a = l, l = c, c = a, ne -= a), l > 0 && ne > 0) {
2919
+ for (a = ne % l || l, p = F.substr(0, a); a < ne; a += l) p += h + F.substr(a, l);
2920
+ c > 0 && (p += h + F.slice(a)), z && (p = "-" + p);
2921
+ }
2922
+ u = b ? p + (r.decimalSeparator || "") + ((c = +r.fractionGroupSize) ? b.replace(
2923
+ new RegExp("\\d{" + c + "}\\B", "g"),
2924
+ "$&" + (r.fractionGroupSeparator || "")
2925
+ ) : b) : p;
2926
+ }
2927
+ return (r.prefix || "") + u + (r.suffix || "");
2928
+ }, $.toFraction = function(t) {
2929
+ var e, r, u, n, a, d, l, c, h, p, b, z, F = this, ne = F.c;
2930
+ if (t != null && (l = new N(t), !l.isInteger() && (l.c || l.s !== 1) || l.lt(re)))
2931
+ throw Error(S + "Argument " + (l.isInteger() ? "out of range: " : "not an integer: ") + B(l));
2932
+ if (!ne) return new N(F);
2933
+ for (e = new N(re), h = r = new N(re), u = c = new N(re), z = T(ne), a = e.e = z.length - F.e - 1, e.c[0] = L[(d = a % _) < 0 ? _ + d : d], t = !t || l.comparedTo(e) > 0 ? a > 0 ? e : h : l, d = fe, fe = 1 / 0, l = new N(z), c.c[0] = 0; p = A(l, e, 0, 1), n = r.plus(p.times(u)), n.comparedTo(t) != 1; )
2934
+ r = u, u = n, h = c.plus(p.times(n = h)), c = n, e = l.minus(p.times(n = e)), l = n;
2935
+ return n = A(t.minus(r), u, 0, 1), c = c.plus(n.times(h)), r = r.plus(n.times(u)), c.s = h.s = F.s, a = a * 2, b = A(h, u, a, D).minus(F).abs().comparedTo(
2936
+ A(c, r, a, D).minus(F).abs()
2937
+ ) < 1 ? [h, u] : [c, r], fe = d, b;
2938
+ }, $.toNumber = function() {
2939
+ return +B(this);
2940
+ }, $.toPrecision = function(t, e) {
2941
+ return t != null && I(t, 1, K), Ue(this, t, e, 2);
2942
+ }, $.toString = function(t) {
2943
+ var e, r = this, u = r.s, n = r.e;
2944
+ return n === null ? u ? (e = "Infinity", u < 0 && (e = "-" + e)) : e = "NaN" : (t == null ? e = n <= ie || n >= de ? Y(T(r.c), n) : oe(T(r.c), n, "0") : t === 10 && Oe ? (r = H(new N(r), te + n + 1, D), e = oe(T(r.c), r.e, "0")) : (I(t, 2, Ne.length, "Base"), e = J(oe(T(r.c), n, "0"), 10, t, u, !0)), u < 0 && r.c[0] && (e = "-" + e)), e;
2945
+ }, $.valueOf = $.toJSON = function() {
2946
+ return B(this);
2947
+ }, $._isBigNumber = !0, U != null && N.set(U), N;
2948
+ }
2949
+ function O(U) {
2950
+ var A = U | 0;
2951
+ return U > 0 || U === A ? A : A - 1;
2952
+ }
2953
+ function T(U) {
2954
+ for (var A, J, ee = 1, $ = U.length, re = U[0] + ""; ee < $; ) {
2955
+ for (A = U[ee++] + "", J = _ - A.length; J--; A = "0" + A) ;
2956
+ re += A;
2957
+ }
2958
+ for ($ = re.length; re.charCodeAt(--$) === 48; ) ;
2959
+ return re.slice(0, $ + 1 || 1);
2960
+ }
2961
+ function V(U, A) {
2962
+ var J, ee, $ = U.c, re = A.c, te = U.s, D = A.s, ie = U.e, de = A.e;
2963
+ if (!te || !D) return null;
2964
+ if (J = $ && !$[0], ee = re && !re[0], J || ee) return J ? ee ? 0 : -D : te;
2965
+ if (te != D) return te;
2966
+ if (J = te < 0, ee = ie == de, !$ || !re) return ee ? 0 : !$ ^ J ? 1 : -1;
2967
+ if (!ee) return ie > de ^ J ? 1 : -1;
2968
+ for (D = (ie = $.length) < (de = re.length) ? ie : de, te = 0; te < D; te++) if ($[te] != re[te]) return $[te] > re[te] ^ J ? 1 : -1;
2969
+ return ie == de ? 0 : ie > de ^ J ? 1 : -1;
2970
+ }
2971
+ function I(U, A, J, ee) {
2972
+ if (U < A || U > J || U !== k(U))
2973
+ throw Error(S + (ee || "Argument") + (typeof U == "number" ? U < A || U > J ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(U));
2974
+ }
2975
+ function W(U) {
2976
+ var A = U.c.length - 1;
2977
+ return O(U.e / _) == A && U.c[A] % 2 != 0;
2978
+ }
2979
+ function Y(U, A) {
2980
+ return (U.length > 1 ? U.charAt(0) + "." + U.slice(1) : U) + (A < 0 ? "e" : "e+") + A;
2981
+ }
2982
+ function oe(U, A, J) {
2983
+ var ee, $;
2984
+ if (A < 0) {
2985
+ for ($ = J + "."; ++A; $ += J) ;
2986
+ U = $ + U;
2987
+ } else if (ee = U.length, ++A > ee) {
2988
+ for ($ = J, A -= ee; --A; $ += J) ;
2989
+ U += $;
2990
+ } else A < ee && (U = U.slice(0, A) + "." + U.slice(A));
2991
+ return U;
2992
+ }
2993
+ v = Q(), v.default = v.BigNumber = v, o.exports ? o.exports = v : (i || (i = typeof self < "u" && self ? self : window), i.BigNumber = v);
2994
+ })(Kr);
2995
+ })(Kt);
2996
+ var Ht = Kt.exports;
2997
+ (function(o) {
2998
+ var i = Ht, v = o.exports;
2999
+ (function() {
3000
+ var m = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, f, k, S = {
3001
+ // table of character substitutions
3002
+ "\b": "\\b",
3003
+ " ": "\\t",
3004
+ "\n": "\\n",
3005
+ "\f": "\\f",
3006
+ "\r": "\\r",
3007
+ '"': '\\"',
3008
+ "\\": "\\\\"
3009
+ }, g;
3010
+ function M(x) {
3011
+ return m.lastIndex = 0, m.test(x) ? '"' + x.replace(m, function(L) {
3012
+ var C = S[L];
3013
+ return typeof C == "string" ? C : "\\u" + ("0000" + L.charCodeAt(0).toString(16)).slice(-4);
3014
+ }) + '"' : '"' + x + '"';
3015
+ }
3016
+ function _(x, L) {
3017
+ var C, K, Q, O, T = f, V, I = L[x], W = I != null && (I instanceof i || i.isBigNumber(I));
3018
+ switch (I && typeof I == "object" && typeof I.toJSON == "function" && (I = I.toJSON(x)), typeof g == "function" && (I = g.call(L, x, I)), typeof I) {
3019
+ case "string":
3020
+ return W ? I : M(I);
3021
+ case "number":
3022
+ return isFinite(I) ? String(I) : "null";
3023
+ case "boolean":
3024
+ case "null":
3025
+ case "bigint":
3026
+ return String(I);
3027
+ case "object":
3028
+ if (!I)
3029
+ return "null";
3030
+ if (f += k, V = [], Object.prototype.toString.apply(I) === "[object Array]") {
3031
+ for (O = I.length, C = 0; C < O; C += 1)
3032
+ V[C] = _(C, I) || "null";
3033
+ return Q = V.length === 0 ? "[]" : f ? `[
3034
+ ` + f + V.join(`,
3035
+ ` + f) + `
3036
+ ` + T + "]" : "[" + V.join(",") + "]", f = T, Q;
3037
+ }
3038
+ if (g && typeof g == "object")
3039
+ for (O = g.length, C = 0; C < O; C += 1)
3040
+ typeof g[C] == "string" && (K = g[C], Q = _(K, I), Q && V.push(M(K) + (f ? ": " : ":") + Q));
3041
+ else
3042
+ Object.keys(I).forEach(function(Y) {
3043
+ var oe = _(Y, I);
3044
+ oe && V.push(M(Y) + (f ? ": " : ":") + oe);
3045
+ });
3046
+ return Q = V.length === 0 ? "{}" : f ? `{
3047
+ ` + f + V.join(`,
3048
+ ` + f) + `
3049
+ ` + T + "}" : "{" + V.join(",") + "}", f = T, Q;
3050
+ }
3051
+ }
3052
+ typeof v.stringify != "function" && (v.stringify = function(x, L, C) {
3053
+ var K;
3054
+ if (f = "", k = "", typeof C == "number")
3055
+ for (K = 0; K < C; K += 1)
3056
+ k += " ";
3057
+ else typeof C == "string" && (k = C);
3058
+ if (g = L, L && typeof L != "function" && (typeof L != "object" || typeof L.length != "number"))
3059
+ throw new Error("JSON.stringify");
3060
+ return _("", { "": x });
3061
+ });
3062
+ })();
3063
+ })(Gt);
3064
+ var Wr = Gt.exports, st = null;
3065
+ const Xr = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/, Yr = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;
3066
+ var Jr = function(o) {
3067
+ var i = {
3068
+ strict: !1,
3069
+ // not being strict means do not generate syntax errors for "duplicate key"
3070
+ storeAsString: !1,
3071
+ // toggles whether the values should be stored as BigNumber (default) or a string
3072
+ alwaysParseAsBig: !1,
3073
+ // toggles whether all numbers should be Big
3074
+ useNativeBigInt: !1,
3075
+ // toggles whether to use native BigInt instead of bignumber.js
3076
+ protoAction: "error",
3077
+ constructorAction: "error"
3078
+ };
3079
+ if (o != null) {
3080
+ if (o.strict === !0 && (i.strict = !0), o.storeAsString === !0 && (i.storeAsString = !0), i.alwaysParseAsBig = o.alwaysParseAsBig === !0 ? o.alwaysParseAsBig : !1, i.useNativeBigInt = o.useNativeBigInt === !0 ? o.useNativeBigInt : !1, typeof o.constructorAction < "u")
3081
+ if (o.constructorAction === "error" || o.constructorAction === "ignore" || o.constructorAction === "preserve")
3082
+ i.constructorAction = o.constructorAction;
3083
+ else
3084
+ throw new Error(
3085
+ `Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${o.constructorAction}`
3086
+ );
3087
+ if (typeof o.protoAction < "u")
3088
+ if (o.protoAction === "error" || o.protoAction === "ignore" || o.protoAction === "preserve")
3089
+ i.protoAction = o.protoAction;
3090
+ else
3091
+ throw new Error(
3092
+ `Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${o.protoAction}`
3093
+ );
3094
+ }
3095
+ var v, m, f = {
3096
+ '"': '"',
3097
+ "\\": "\\",
3098
+ "/": "/",
3099
+ b: "\b",
3100
+ f: "\f",
3101
+ n: `
3102
+ `,
3103
+ r: "\r",
3104
+ t: " "
3105
+ }, k, S = function(O) {
3106
+ throw {
3107
+ name: "SyntaxError",
3108
+ message: O,
3109
+ at: v,
3110
+ text: k
3111
+ };
3112
+ }, g = function(O) {
3113
+ return O && O !== m && S("Expected '" + O + "' instead of '" + m + "'"), m = k.charAt(v), v += 1, m;
3114
+ }, M = function() {
3115
+ var O, T = "";
3116
+ for (m === "-" && (T = "-", g("-")); m >= "0" && m <= "9"; )
3117
+ T += m, g();
3118
+ if (m === ".")
3119
+ for (T += "."; g() && m >= "0" && m <= "9"; )
3120
+ T += m;
3121
+ if (m === "e" || m === "E")
3122
+ for (T += m, g(), (m === "-" || m === "+") && (T += m, g()); m >= "0" && m <= "9"; )
3123
+ T += m, g();
3124
+ if (O = +T, !isFinite(O))
3125
+ S("Bad number");
3126
+ else
3127
+ return st == null && (st = Ht), T.length > 15 ? i.storeAsString ? T : i.useNativeBigInt ? BigInt(T) : new st(T) : i.alwaysParseAsBig ? i.useNativeBigInt ? BigInt(O) : new st(O) : O;
3128
+ }, _ = function() {
3129
+ var O, T, V = "", I;
3130
+ if (m === '"')
3131
+ for (var W = v; g(); ) {
3132
+ if (m === '"')
3133
+ return v - 1 > W && (V += k.substring(W, v - 1)), g(), V;
3134
+ if (m === "\\") {
3135
+ if (v - 1 > W && (V += k.substring(W, v - 1)), g(), m === "u") {
3136
+ for (I = 0, T = 0; T < 4 && (O = parseInt(g(), 16), !!isFinite(O)); T += 1)
3137
+ I = I * 16 + O;
3138
+ V += String.fromCharCode(I);
3139
+ } else if (typeof f[m] == "string")
3140
+ V += f[m];
3141
+ else
3142
+ break;
3143
+ W = v;
3144
+ }
3145
+ }
3146
+ S("Bad string");
3147
+ }, x = function() {
3148
+ for (; m && m <= " "; )
3149
+ g();
3150
+ }, L = function() {
3151
+ switch (m) {
3152
+ case "t":
3153
+ return g("t"), g("r"), g("u"), g("e"), !0;
3154
+ case "f":
3155
+ return g("f"), g("a"), g("l"), g("s"), g("e"), !1;
3156
+ case "n":
3157
+ return g("n"), g("u"), g("l"), g("l"), null;
3158
+ }
3159
+ S("Unexpected '" + m + "'");
3160
+ }, C, K = function() {
3161
+ var O = [];
3162
+ if (m === "[") {
3163
+ if (g("["), x(), m === "]")
3164
+ return g("]"), O;
3165
+ for (; m; ) {
3166
+ if (O.push(C()), x(), m === "]")
3167
+ return g("]"), O;
3168
+ g(","), x();
3169
+ }
3170
+ }
3171
+ S("Bad array");
3172
+ }, Q = function() {
3173
+ var O, T = /* @__PURE__ */ Object.create(null);
3174
+ if (m === "{") {
3175
+ if (g("{"), x(), m === "}")
3176
+ return g("}"), T;
3177
+ for (; m; ) {
3178
+ if (O = _(), x(), g(":"), i.strict === !0 && Object.hasOwnProperty.call(T, O) && S('Duplicate key "' + O + '"'), Xr.test(O) === !0 ? i.protoAction === "error" ? S("Object contains forbidden prototype property") : i.protoAction === "ignore" ? C() : T[O] = C() : Yr.test(O) === !0 ? i.constructorAction === "error" ? S("Object contains forbidden constructor property") : i.constructorAction === "ignore" ? C() : T[O] = C() : T[O] = C(), x(), m === "}")
3179
+ return g("}"), T;
3180
+ g(","), x();
3181
+ }
3182
+ }
3183
+ S("Bad object");
3184
+ };
3185
+ return C = function() {
3186
+ switch (x(), m) {
3187
+ case "{":
3188
+ return Q();
3189
+ case "[":
3190
+ return K();
3191
+ case '"':
3192
+ return _();
3193
+ case "-":
3194
+ return M();
3195
+ default:
3196
+ return m >= "0" && m <= "9" ? M() : L();
3197
+ }
3198
+ }, function(O, T) {
3199
+ var V;
3200
+ return k = O + "", v = 0, m = " ", V = C(), x(), m && S("Syntax error"), typeof T == "function" ? function I(W, Y) {
3201
+ var oe, U = W[Y];
3202
+ return U && typeof U == "object" && Object.keys(U).forEach(function(A) {
3203
+ oe = I(U, A), oe !== void 0 ? U[A] = oe : delete U[A];
3204
+ }), T.call(W, Y, U);
3205
+ }({ "": V }, "") : V;
3206
+ };
3207
+ }, Zr = Jr, Wt = Wr.stringify, Xt = Zr;
3208
+ dt.exports = function(o) {
3209
+ return {
3210
+ parse: Xt(o),
3211
+ stringify: Wt
3212
+ };
3213
+ };
3214
+ dt.exports.parse = Xt();
3215
+ dt.exports.stringify = Wt;
3216
+ var Qr = dt.exports;
3217
+ const ea = /* @__PURE__ */ Hr(Qr), ta = ea({ storeAsString: !0 });
3218
+ let Yt;
3219
+ function Ja(o) {
3220
+ Yt = o, Re && (Re.defaults.baseURL = o);
3221
+ }
3222
+ const sa = () => {
3223
+ const o = ls.create({
3224
+ timeout: 3e4,
3225
+ headers: {
3226
+ "Content-Type": "application/json"
3227
+ },
3228
+ // 使用 json-bigint 解析响应数据,避免大整数精度丢失
3229
+ transformResponse: [
3230
+ (i) => {
3231
+ if (typeof i == "string")
3232
+ try {
3233
+ return ta.parse(i);
3234
+ } catch {
3235
+ return i;
3236
+ }
3237
+ return i;
3238
+ }
3239
+ ]
3240
+ });
3241
+ return o.interceptors.request.use(
3242
+ (i) => {
3243
+ const v = Yt || void 0;
3244
+ v && !i.baseURL && (i.baseURL = v);
3245
+ const m = ut(), f = vs() || "Bearer";
3246
+ return m && (i.headers.Authorization = `${f} ${m}`), i;
3247
+ },
3248
+ (i) => Promise.reject(i)
3249
+ ), o.interceptors.response.use(
3250
+ (i) => {
3251
+ const { data: v } = i;
3252
+ return v.code === 200 || v.code === 0 ? v.data : v.code === 9121 ? (Ie.error("登录已过期,请重新登录"), We(), window.location.href = "/login", Promise.reject(new Error(v.message || "EXPIRED OR INVALID TOKEN"))) : (Ie.error(v.message || "请求失败"), Promise.reject(new Error(v.message || "请求失败")));
3253
+ },
3254
+ (i) => {
3255
+ var m;
3256
+ const { response: v } = i;
3257
+ if (v) {
3258
+ const { data: f } = v;
3259
+ if ((f == null ? void 0 : f.code) === 9121)
3260
+ return Ie.error("登录已过期,请重新登录"), We(), window.location.href = "/login", Promise.reject(i);
3261
+ switch (v.status) {
3262
+ case 401:
3263
+ Ie.error("登录已过期,请重新登录"), We(), window.location.href = "/login";
3264
+ break;
3265
+ case 403:
3266
+ Ie.error("没有权限访问");
3267
+ break;
3268
+ case 404:
3269
+ Ie.error("请求资源不存在");
3270
+ break;
3271
+ case 500:
3272
+ Ie.error("服务器错误");
3273
+ break;
3274
+ default:
3275
+ Ie.error(((m = v.data) == null ? void 0 : m.message) || "请求失败");
3276
+ }
3277
+ } else
3278
+ Ie.error("网络连接失败");
3279
+ return Promise.reject(i);
3280
+ }
3281
+ ), o;
3282
+ }, Re = sa(), ue = {
3283
+ get(o, i) {
3284
+ return Re.get(o, i);
3285
+ },
3286
+ post(o, i, v) {
3287
+ return Re.post(o, i, v);
3288
+ },
3289
+ put(o, i, v) {
3290
+ return Re.put(o, i, v);
3291
+ },
3292
+ patch(o, i, v) {
3293
+ return Re.patch(o, i, v);
3294
+ },
3295
+ delete(o, i) {
3296
+ return Re.delete(o, i);
3297
+ },
3298
+ // 文件下载 - 返回 Blob 对象
3299
+ download(o, i) {
3300
+ return Re.get(o, { ...i, responseType: "blob" });
3301
+ }
3302
+ };
3303
+ function na(o) {
3304
+ return ue.post("/user/v1.0/login/by-domain", o);
3305
+ }
3306
+ function Za() {
3307
+ return ue.put("/user/v1.0/user/logout");
3308
+ }
3309
+ function oa() {
3310
+ return ue.get("/user/v1.0/user/get-me");
3311
+ }
3312
+ function Qa(o) {
3313
+ return ue.post("/user/v1.0/refresh", { refreshToken: o });
3314
+ }
3315
+ const ra = { class: "login-page" }, aa = { class: "login-form-section" }, la = { class: "form-container" }, ia = { class: "input-wrapper" }, ca = { class: "input-wrapper" }, ua = { class: "form-options" }, da = { key: 0 }, fa = { key: 1 }, pa = /* @__PURE__ */ Ae({
3316
+ __name: "index",
3317
+ setup(o) {
3318
+ const i = ze(), v = qe(), m = P(!1), f = P(!1), k = kt({
3319
+ uid: "",
3320
+ password: ""
3321
+ }), S = {
3322
+ uid: [
3323
+ { required: !0, message: "请输入用户名", trigger: "blur" }
3324
+ ],
3325
+ password: [
3326
+ { required: !0, message: "请输入密码", trigger: "blur" },
3327
+ { min: 6, message: "密码长度至少6位", trigger: "blur" }
3328
+ ]
3329
+ }, g = P(), M = async () => {
3330
+ var _;
3331
+ try {
3332
+ await ((_ = g.value) == null ? void 0 : _.validate()), m.value = !0;
3333
+ const x = await na({
3334
+ appId: ct(),
3335
+ clientId: zt(),
3336
+ uid: k.uid,
3337
+ password: k.password,
3338
+ code: !0
3339
+ });
3340
+ Vt(x), Ie.success("登录成功");
3341
+ const L = v.query.redirect || "/";
3342
+ i.push(L);
3343
+ } catch (x) {
3344
+ console.error("登录失败:", x);
3345
+ } finally {
3346
+ m.value = !1;
3347
+ }
3348
+ };
3349
+ return (_, x) => (w(), E("div", ra, [
3350
+ x[10] || (x[10] = nt('<div class="login-brand" data-v-102cb5d3><div class="brand-content" data-v-102cb5d3><div class="brand-logo" data-v-102cb5d3><div class="logo-icon" data-v-102cb5d3><svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-102cb5d3><rect width="48" height="48" rx="12" fill="currentColor" data-v-102cb5d3></rect><path d="M14 24L20 30L34 16" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" data-v-102cb5d3></path></svg></div><span class="logo-text" data-v-102cb5d3>XTO</span></div><div class="brand-slogan" data-v-102cb5d3><h1 data-v-102cb5d3>企业级后台管理解决方案</h1><p data-v-102cb5d3>开箱即用的中后台前端/设计解决方案</p></div><div class="brand-features" data-v-102cb5d3><div class="feature-item" data-v-102cb5d3><div class="feature-icon" data-v-102cb5d3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-102cb5d3><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" data-v-102cb5d3></path></svg></div><div class="feature-text" data-v-102cb5d3><h4 data-v-102cb5d3>高性能</h4><p data-v-102cb5d3>极致的渲染性能与响应速度</p></div></div><div class="feature-item" data-v-102cb5d3><div class="feature-icon" data-v-102cb5d3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-102cb5d3><rect x="3" y="3" width="18" height="18" rx="2" data-v-102cb5d3></rect><path d="M9 9h6M9 12h6M9 15h4" data-v-102cb5d3></path></svg></div><div class="feature-text" data-v-102cb5d3><h4 data-v-102cb5d3>丰富组件</h4><p data-v-102cb5d3>60+ 高质量业务组件</p></div></div><div class="feature-item" data-v-102cb5d3><div class="feature-icon" data-v-102cb5d3><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-102cb5d3><circle cx="12" cy="12" r="10" data-v-102cb5d3></circle><path d="M12 6v6l4 2" data-v-102cb5d3></path></svg></div><div class="feature-text" data-v-102cb5d3><h4 data-v-102cb5d3>持续更新</h4><p data-v-102cb5d3>活跃的社区与快速迭代</p></div></div></div><div class="brand-decoration" data-v-102cb5d3><div class="decoration-line" data-v-102cb5d3></div><div class="decoration-dots" data-v-102cb5d3><span data-v-102cb5d3></span><span data-v-102cb5d3></span><span data-v-102cb5d3></span></div></div></div><div class="brand-bg" data-v-102cb5d3><div class="bg-grid" data-v-102cb5d3></div><div class="bg-glow" data-v-102cb5d3></div><div class="bg-pattern" data-v-102cb5d3></div></div></div>', 1)),
3351
+ s("div", aa, [
3352
+ s("div", la, [
3353
+ x[7] || (x[7] = s("div", { class: "form-header" }, [
3354
+ s("h2", null, "欢迎登录"),
3355
+ s("p", null, "请输入您的账户信息")
3356
+ ], -1)),
3357
+ R(y(rs), {
3358
+ ref_key: "formRef",
3359
+ ref: g,
3360
+ model: k,
3361
+ rules: S,
3362
+ class: "login-form",
3363
+ "label-width": "0"
3364
+ }, {
3365
+ default: X(() => [
3366
+ R(y(mt), { prop: "uid" }, {
3367
+ default: X(() => [
3368
+ s("div", ia, [
3369
+ x[3] || (x[3] = s("label", { class: "input-label" }, "用户名", -1)),
3370
+ R(y(Ut), {
3371
+ modelValue: k.uid,
3372
+ "onUpdate:modelValue": x[0] || (x[0] = (L) => k.uid = L),
3373
+ placeholder: "请输入用户名",
3374
+ size: "large"
3375
+ }, {
3376
+ prefix: X(() => [
3377
+ R(y(Z), {
3378
+ name: "user",
3379
+ size: 18
3380
+ })
3381
+ ]),
3382
+ _: 1
3383
+ }, 8, ["modelValue"])
3384
+ ])
3385
+ ]),
3386
+ _: 1
3387
+ }),
3388
+ R(y(mt), { prop: "password" }, {
3389
+ default: X(() => [
3390
+ s("div", ca, [
3391
+ x[4] || (x[4] = s("label", { class: "input-label" }, "密码", -1)),
3392
+ R(y(Ut), {
3393
+ modelValue: k.password,
3394
+ "onUpdate:modelValue": x[1] || (x[1] = (L) => k.password = L),
3395
+ type: "password",
3396
+ placeholder: "请输入密码",
3397
+ size: "large",
3398
+ "show-password": "",
3399
+ onKeyup: ss(M, ["enter"])
3400
+ }, {
3401
+ prefix: X(() => [
3402
+ R(y(Z), {
3403
+ name: "lock",
3404
+ size: 18
3405
+ })
3406
+ ]),
3407
+ _: 1
3408
+ }, 8, ["modelValue"])
3409
+ ])
3410
+ ]),
3411
+ _: 1
3412
+ }),
3413
+ s("div", ua, [
3414
+ R(y(as), {
3415
+ modelValue: f.value,
3416
+ "onUpdate:modelValue": x[2] || (x[2] = (L) => f.value = L)
3417
+ }, {
3418
+ default: X(() => [...x[5] || (x[5] = [
3419
+ Fe("记住我", -1)
3420
+ ])]),
3421
+ _: 1
3422
+ }, 8, ["modelValue"]),
3423
+ x[6] || (x[6] = s("a", {
3424
+ href: "#",
3425
+ class: "forgot-link"
3426
+ }, "忘记密码?", -1))
3427
+ ]),
3428
+ R(y(mt), null, {
3429
+ default: X(() => [
3430
+ R(y(je), {
3431
+ type: "primary",
3432
+ size: "large",
3433
+ loading: m.value,
3434
+ class: "login-btn",
3435
+ onClick: M
3436
+ }, {
3437
+ default: X(() => [
3438
+ m.value ? (w(), E("span", fa, "登录中...")) : (w(), E("span", da, "登 录"))
3439
+ ]),
3440
+ _: 1
3441
+ }, 8, ["loading"])
3442
+ ]),
3443
+ _: 1
3444
+ })
3445
+ ]),
3446
+ _: 1
3447
+ }, 8, ["model"]),
3448
+ x[8] || (x[8] = nt('<div class="form-footer" data-v-102cb5d3><p data-v-102cb5d3>其他登录方式</p><div class="social-login" data-v-102cb5d3><button class="social-btn" title="企业微信" data-v-102cb5d3><svg viewBox="0 0 24 24" fill="currentColor" data-v-102cb5d3><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z" data-v-102cb5d3></path></svg></button><button class="social-btn" title="钉钉" data-v-102cb5d3><svg viewBox="0 0 24 24" fill="currentColor" data-v-102cb5d3><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.64 6.8c-.15 1.58-.8 5.42-1.13 7.19-.14.75-.42 1-.68 1.03-.58.05-1.02-.38-1.58-.75-.88-.58-1.38-.94-2.23-1.5-.99-.65-.35-1.01.22-1.59.15-.15 2.71-2.48 2.76-2.69a.2.2 0 00-.05-.18c-.06-.05-.14-.03-.21-.02-.09.02-1.49.95-4.22 2.79-.4.27-.76.41-1.08.4-.36-.01-1.04-.2-1.55-.37-.63-.2-1.12-.31-1.08-.66.02-.18.27-.36.74-.55 2.92-1.27 4.86-2.11 5.83-2.51 2.78-1.16 3.35-1.36 3.73-1.36.08 0 .27.02.39.12.1.08.13.19.14.27-.01.06.01.24 0 .38z" data-v-102cb5d3></path></svg></button><button class="social-btn" title="飞书" data-v-102cb5d3><svg viewBox="0 0 24 24" fill="currentColor" data-v-102cb5d3><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" data-v-102cb5d3></path></svg></button></div></div>', 1))
3449
+ ]),
3450
+ x[9] || (x[9] = s("div", { class: "copyright" }, [
3451
+ s("p", null, "© 2024 XTO Team. All rights reserved.")
3452
+ ], -1))
3453
+ ])
3454
+ ]));
3455
+ }
3456
+ }), ma = /* @__PURE__ */ $e(pa, [["__scopeId", "data-v-102cb5d3"]]), ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3457
+ __proto__: null,
3458
+ default: ma
3459
+ }, Symbol.toStringTag, { value: "Module" })), va = { class: "error-page" }, ga = { class: "error-container" }, _a = { class: "error-content" }, wa = { class: "error-actions" }, ya = /* @__PURE__ */ Ae({
3460
+ __name: "404",
3461
+ setup(o) {
3462
+ const i = ze(), v = () => {
3463
+ i.push("/");
3464
+ };
3465
+ return (m, f) => (w(), E("div", va, [
3466
+ s("div", ga, [
3467
+ f[7] || (f[7] = s("div", { class: "error-bg" }, [
3468
+ s("div", { class: "bg-circle circle-1" }),
3469
+ s("div", { class: "bg-circle circle-2" }),
3470
+ s("div", { class: "bg-circle circle-3" })
3471
+ ], -1)),
3472
+ s("div", _a, [
3473
+ f[5] || (f[5] = nt('<div class="error-code" data-v-1b083153><span class="code-digit" data-v-1b083153>4</span><span class="code-zero" data-v-1b083153><span class="zero-inner" data-v-1b083153>0</span></span><span class="code-digit" data-v-1b083153>4</span></div><div class="error-illustration" data-v-1b083153><svg viewBox="0 0 200 120" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-1b083153><rect x="40" y="20" width="120" height="80" rx="8" fill="var(--color-fill)" stroke="var(--color-border)" stroke-width="2" data-v-1b083153></rect><rect x="50" y="30" width="100" height="60" rx="4" fill="var(--bg-color)" data-v-1b083153></rect><line x1="60" y1="45" x2="140" y2="45" stroke="var(--color-border-light)" stroke-width="2" data-v-1b083153></line><line x1="60" y1="55" x2="120" y2="55" stroke="var(--color-border-light)" stroke-width="2" data-v-1b083153></line><line x1="60" y1="65" x2="100" y2="65" stroke="var(--color-border-light)" stroke-width="2" data-v-1b083153></line><text x="100" y="75" text-anchor="middle" fill="var(--color-primary)" font-size="24" font-weight="600" data-v-1b083153>?</text><circle cx="150" cy="35" r="12" stroke="var(--color-primary)" stroke-width="2" fill="none" data-v-1b083153></circle><line x1="158" y1="43" x2="168" y2="53" stroke="var(--color-primary)" stroke-width="2" stroke-linecap="round" data-v-1b083153></line></svg></div><h1 class="error-title" data-v-1b083153>页面不存在</h1><p class="error-desc" data-v-1b083153>抱歉,您访问的页面不存在或已被删除</p>', 4)),
3474
+ s("div", wa, [
3475
+ R(y(je), {
3476
+ type: "primary",
3477
+ size: "large",
3478
+ onClick: v
3479
+ }, {
3480
+ icon: X(() => [...f[1] || (f[1] = [
3481
+ s("svg", {
3482
+ viewBox: "0 0 24 24",
3483
+ fill: "none",
3484
+ stroke: "currentColor",
3485
+ "stroke-width": "2"
3486
+ }, [
3487
+ s("path", { d: "M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2V9z" }),
3488
+ s("polyline", { points: "9,22 9,12 15,12 15,22" })
3489
+ ], -1)
3490
+ ])]),
3491
+ default: X(() => [
3492
+ f[2] || (f[2] = Fe(" 返回首页 ", -1))
3493
+ ]),
3494
+ _: 1
3495
+ }),
3496
+ R(y(je), {
3497
+ size: "large",
3498
+ onClick: f[0] || (f[0] = (k) => y(i).go(-1))
3499
+ }, {
3500
+ icon: X(() => [...f[3] || (f[3] = [
3501
+ s("svg", {
3502
+ viewBox: "0 0 24 24",
3503
+ fill: "none",
3504
+ stroke: "currentColor",
3505
+ "stroke-width": "2"
3506
+ }, [
3507
+ s("path", { d: "M19 12H5M12 19l-7-7 7-7" })
3508
+ ], -1)
3509
+ ])]),
3510
+ default: X(() => [
3511
+ f[4] || (f[4] = Fe(" 返回上一页 ", -1))
3512
+ ]),
3513
+ _: 1
3514
+ })
3515
+ ]),
3516
+ f[6] || (f[6] = s("div", { class: "error-tip" }, [
3517
+ s("p", null, "您可以尝试:"),
3518
+ s("ul", null, [
3519
+ s("li", null, "检查您输入的网址是否正确"),
3520
+ s("li", null, "返回首页重新浏览"),
3521
+ s("li", null, "联系管理员反馈问题")
3522
+ ])
3523
+ ], -1))
3524
+ ])
3525
+ ])
3526
+ ]));
3527
+ }
3528
+ }), ba = /* @__PURE__ */ $e(ya, [["__scopeId", "data-v-1b083153"]]), Jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3529
+ __proto__: null,
3530
+ default: ba
3531
+ }, Symbol.toStringTag, { value: "Module" })), ka = { class: "error-page" }, xa = { class: "error-container" }, Ca = { class: "error-content" }, Na = { class: "error-actions" }, Ea = /* @__PURE__ */ Ae({
3532
+ __name: "403",
3533
+ setup(o) {
3534
+ const i = ze(), v = () => {
3535
+ i.push("/");
3536
+ };
3537
+ return (m, f) => (w(), E("div", ka, [
3538
+ s("div", xa, [
3539
+ f[7] || (f[7] = s("div", { class: "error-bg" }, [
3540
+ s("div", { class: "bg-circle circle-1" }),
3541
+ s("div", { class: "bg-circle circle-2" }),
3542
+ s("div", { class: "bg-circle circle-3" })
3543
+ ], -1)),
3544
+ s("div", Ca, [
3545
+ f[5] || (f[5] = nt('<div class="error-code" data-v-d167f981><span class="code-digit" data-v-d167f981>4</span><span class="code-zero warning" data-v-d167f981><span class="zero-inner" data-v-d167f981>0</span></span><span class="code-digit" data-v-d167f981>3</span></div><div class="error-illustration" data-v-d167f981><svg viewBox="0 0 200 120" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-d167f981><path d="M100 15 L150 35 L150 70 C150 95 100 110 100 110 C100 110 50 95 50 70 L50 35 Z" fill="var(--color-warning-lighter)" stroke="var(--color-warning)" stroke-width="2" data-v-d167f981></path><rect x="85" y="55" width="30" height="25" rx="4" fill="var(--color-warning)" data-v-d167f981></rect><path d="M92 55 V48 A8 8 0 0 1 108 48 V55" fill="none" stroke="var(--color-warning)" stroke-width="3" data-v-d167f981></path><circle cx="100" cy="67" r="6" fill="none" stroke="#fff" stroke-width="2" data-v-d167f981></circle><line x1="96" y1="63" x2="104" y2="71" stroke="#fff" stroke-width="2" data-v-d167f981></line></svg></div><h1 class="error-title" data-v-d167f981>无访问权限</h1><p class="error-desc" data-v-d167f981>抱歉,您没有权限访问此页面,请联系管理员获取权限</p>', 4)),
3546
+ s("div", Na, [
3547
+ R(y(je), {
3548
+ type: "primary",
3549
+ size: "large",
3550
+ onClick: v
3551
+ }, {
3552
+ icon: X(() => [...f[1] || (f[1] = [
3553
+ s("svg", {
3554
+ viewBox: "0 0 24 24",
3555
+ fill: "none",
3556
+ stroke: "currentColor",
3557
+ "stroke-width": "2"
3558
+ }, [
3559
+ s("path", { d: "M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2V9z" }),
3560
+ s("polyline", { points: "9,22 9,12 15,12 15,22" })
3561
+ ], -1)
3562
+ ])]),
3563
+ default: X(() => [
3564
+ f[2] || (f[2] = Fe(" 返回首页 ", -1))
3565
+ ]),
3566
+ _: 1
3567
+ }),
3568
+ R(y(je), {
3569
+ size: "large",
3570
+ onClick: f[0] || (f[0] = (k) => y(i).go(-1))
3571
+ }, {
3572
+ icon: X(() => [...f[3] || (f[3] = [
3573
+ s("svg", {
3574
+ viewBox: "0 0 24 24",
3575
+ fill: "none",
3576
+ stroke: "currentColor",
3577
+ "stroke-width": "2"
3578
+ }, [
3579
+ s("path", { d: "M19 12H5M12 19l-7-7 7-7" })
3580
+ ], -1)
3581
+ ])]),
3582
+ default: X(() => [
3583
+ f[4] || (f[4] = Fe(" 返回上一页 ", -1))
3584
+ ]),
3585
+ _: 1
3586
+ })
3587
+ ]),
3588
+ f[6] || (f[6] = s("div", { class: "error-tip" }, [
3589
+ s("p", null, "可能的原因:"),
3590
+ s("ul", null, [
3591
+ s("li", null, "您的账号权限不足"),
3592
+ s("li", null, "该页面需要特定角色才能访问"),
3593
+ s("li", null, "您的登录状态已过期")
3594
+ ])
3595
+ ], -1))
3596
+ ])
3597
+ ])
3598
+ ]));
3599
+ }
3600
+ }), el = /* @__PURE__ */ $e(Ea, [["__scopeId", "data-v-d167f981"]]);
3601
+ function tl() {
3602
+ const o = De(), i = Se(), v = Ze(), m = j(() => i.userName || ""), f = j(() => i.userInfo), k = j(() => o.appName), S = j(() => v.isLoggedIn), g = j(() => o.isDark), M = j(() => o.theme), _ = j(() => o.isCollapsed), x = j(() => o.layout);
3603
+ return {
3604
+ userName: m,
3605
+ userInfo: f,
3606
+ appName: k,
3607
+ isLoggedIn: S,
3608
+ isDark: g,
3609
+ theme: M,
3610
+ isCollapsed: _,
3611
+ layout: x,
3612
+ toggleTheme: () => {
3613
+ o.toggleTheme();
3614
+ },
3615
+ toggleCollapse: () => {
3616
+ o.toggleCollapse();
3617
+ }
3618
+ };
3619
+ }
3620
+ function sl() {
3621
+ const o = Se();
3622
+ return {
3623
+ isLoggedIn: j(() => o.isLoggedIn)
3624
+ };
3625
+ }
3626
+ function nl(o, i = {}) {
3627
+ const { rules: v, onSubmit: m } = i, f = P(), k = kt({ ...o }), S = P(!1), g = P(!1), M = P(!1), _ = () => {
3628
+ C(), M.value = !1, g.value = !0;
3629
+ }, x = (Q) => {
3630
+ Object.assign(k, Q), M.value = !0, g.value = !0;
3631
+ }, L = () => {
3632
+ g.value = !1, C();
3633
+ }, C = () => {
3634
+ var Q;
3635
+ Object.keys(o).forEach((O) => {
3636
+ k[O] = o[O];
3637
+ }), (Q = f.value) == null || Q.resetFields();
3638
+ };
3639
+ return {
3640
+ formRef: f,
3641
+ formData: k,
3642
+ rules: v,
3643
+ loading: S,
3644
+ visible: g,
3645
+ isEdit: M,
3646
+ openAdd: _,
3647
+ openEdit: x,
3648
+ close: L,
3649
+ resetForm: C,
3650
+ handleSubmit: async () => {
3651
+ var Q;
3652
+ try {
3653
+ await ((Q = f.value) == null ? void 0 : Q.validate()), S.value = !0, await (m == null ? void 0 : m(k)), L();
3654
+ } catch (O) {
3655
+ console.error(O);
3656
+ } finally {
3657
+ S.value = !1;
3658
+ }
3659
+ }
3660
+ };
3661
+ }
3662
+ function ol(o) {
3663
+ const { fetchData: i, defaultPageSize: v = 10 } = o, m = P(!1), f = P([]), k = P(0), S = P(1), g = P(v), M = kt({}), _ = async () => {
3664
+ m.value = !0;
3665
+ try {
3666
+ const T = {
3667
+ ...M,
3668
+ page: S.value,
3669
+ pageSize: g.value
3670
+ }, V = await i(T);
3671
+ f.value = V.list, k.value = V.total;
3672
+ } catch (T) {
3673
+ console.error(T);
3674
+ } finally {
3675
+ m.value = !1;
3676
+ }
3677
+ }, x = () => {
3678
+ S.value = 1, _();
3679
+ }, L = () => {
3680
+ Object.keys(M).forEach((T) => {
3681
+ M[T] = void 0;
3682
+ }), S.value = 1, _();
3683
+ }, C = (T) => {
3684
+ S.value = T, _();
3685
+ }, K = (T) => {
3686
+ g.value = T, S.value = 1, _();
3687
+ }, Q = () => {
3688
+ _();
3689
+ }, O = j(() => ({
3690
+ current: S.value,
3691
+ pageSize: g.value,
3692
+ total: k.value
3693
+ }));
3694
+ return {
3695
+ loading: m,
3696
+ data: f,
3697
+ total: k,
3698
+ currentPage: S,
3699
+ pageSize: g,
3700
+ searchParams: M,
3701
+ pagination: O,
3702
+ getData: _,
3703
+ handleSearch: x,
3704
+ handleReset: L,
3705
+ handlePageChange: C,
3706
+ handleSizeChange: K,
3707
+ refresh: Q
3708
+ };
3709
+ }
3710
+ const Ot = Je("locale", () => {
3711
+ const o = q.get("locale") || "zh-CN", i = is(o), v = P(o), m = cs(), { t: f, messages: k, setLocale: S, mergeMessages: g } = us(), M = j(() => {
3712
+ const C = m.find((K) => K.code === v.value);
3713
+ return (C == null ? void 0 : C.name) || v.value;
3714
+ });
3715
+ return {
3716
+ locale: v,
3717
+ localeName: M,
3718
+ locales: m,
3719
+ messages: k,
3720
+ t: f,
3721
+ changeLocale: (C) => {
3722
+ v.value = C, S(C), q.set("locale", C), i.setLocale(C);
3723
+ },
3724
+ addMessages: (C) => {
3725
+ g(C);
3726
+ },
3727
+ initLocale: () => {
3728
+ S(o);
3729
+ },
3730
+ provider: i
3731
+ };
3732
+ }), Sa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3733
+ __proto__: null,
3734
+ useLocaleStore: Ot
3735
+ }, Symbol.toStringTag, { value: "Module" }));
3736
+ function rl() {
3737
+ const o = Ot();
3738
+ return {
3739
+ /** 当前语言代码 */
3740
+ locale: o.locale,
3741
+ /** 当前语言名称 */
3742
+ localeName: o.localeName,
3743
+ /** 支持的语言列表 */
3744
+ locales: o.locales,
3745
+ /** 翻译函数 */
3746
+ t: o.t,
3747
+ /** 当前语言包 */
3748
+ messages: o.messages,
3749
+ /** 切换语言 */
3750
+ setLocale: o.changeLocale,
3751
+ /** 添加自定义翻译 */
3752
+ addMessages: o.addMessages
3753
+ };
3754
+ }
3755
+ function al() {
3756
+ return Ot().t;
3757
+ }
3758
+ function ll(o) {
3759
+ const i = Se(), v = Pe();
3760
+ return i.isLoggedIn ? v.hasPermission(o) : !1;
3761
+ }
3762
+ function il(o) {
3763
+ return Se().isLoggedIn;
3764
+ }
3765
+ function cl() {
3766
+ return !0;
3767
+ }
3768
+ const Zt = [
3769
+ {
3770
+ path: "/login",
3771
+ name: "Login",
3772
+ component: () => Promise.resolve().then(() => ha),
3773
+ meta: {
3774
+ title: "登录",
3775
+ hidden: !0
3776
+ }
3777
+ }
3778
+ ], Qt = {
3779
+ path: "/",
3780
+ name: "Layout",
3781
+ component: () => Promise.resolve().then(() => Rr),
3782
+ redirect: "/dashboard",
3783
+ children: [
3784
+ {
3785
+ path: "/dashboard",
3786
+ name: "Dashboard",
3787
+ component: () => import("./index-DAPLMrmP.js"),
3788
+ meta: {
3789
+ title: "仪表盘",
3790
+ icon: "dashboard",
3791
+ keepAlive: !0,
3792
+ affix: !0
3793
+ }
3794
+ },
3795
+ {
3796
+ path: "/system/user",
3797
+ name: "SystemUser",
3798
+ component: () => import("./index-CvYIvRSW.js"),
3799
+ meta: {
3800
+ title: "用户管理",
3801
+ icon: "user",
3802
+ keepAlive: !0
3803
+ }
3804
+ },
3805
+ {
3806
+ path: "/system/role",
3807
+ name: "SystemRole",
3808
+ component: () => import("./index-CsjBlLrl.js"),
3809
+ meta: {
3810
+ title: "角色管理",
3811
+ icon: "role",
3812
+ keepAlive: !0
3813
+ }
3814
+ },
3815
+ {
3816
+ path: "/system/menu",
3817
+ name: "SystemMenu",
3818
+ component: () => import("./index-DjkSMw-x.js"),
3819
+ meta: {
3820
+ title: "菜单管理",
3821
+ icon: "menu",
3822
+ keepAlive: !0
3823
+ }
3824
+ },
3825
+ // catch-all 路由:让 404 在 Layout 内部渲染,保持左侧菜单显示
3826
+ {
3827
+ path: "/:pathMatch(.*)*",
3828
+ name: "CatchAll",
3829
+ component: () => Promise.resolve().then(() => Jt),
3830
+ meta: {
3831
+ title: "404",
3832
+ hidden: !0
3833
+ }
3834
+ }
3835
+ ]
3836
+ }, ul = [
3837
+ {
3838
+ path: "/dashboard",
3839
+ name: "Dashboard",
3840
+ component: () => import("./index-DAPLMrmP.js"),
3841
+ meta: {
3842
+ title: "仪表盘",
3843
+ icon: "dashboard",
3844
+ keepAlive: !0,
3845
+ affix: !0
3846
+ }
3847
+ },
3848
+ {
3849
+ path: "/system",
3850
+ name: "System",
3851
+ redirect: "/system/user",
3852
+ meta: {
3853
+ title: "系统管理",
3854
+ icon: "setting"
3855
+ },
3856
+ children: [
3857
+ {
3858
+ path: "user",
3859
+ name: "SystemUser",
3860
+ component: () => import("./index-CvYIvRSW.js"),
3861
+ meta: {
3862
+ title: "用户管理",
3863
+ icon: "user",
3864
+ keepAlive: !0
3865
+ }
3866
+ },
3867
+ {
3868
+ path: "role",
3869
+ name: "SystemRole",
3870
+ component: () => import("./index-CsjBlLrl.js"),
3871
+ meta: {
3872
+ title: "角色管理",
3873
+ icon: "role",
3874
+ keepAlive: !0
3875
+ }
3876
+ },
3877
+ {
3878
+ path: "menu",
3879
+ name: "SystemMenu",
3880
+ component: () => import("./index-DjkSMw-x.js"),
3881
+ meta: {
3882
+ title: "菜单管理",
3883
+ icon: "menu",
3884
+ keepAlive: !0
3885
+ }
3886
+ }
3887
+ ]
3888
+ }
3889
+ ], $a = [
3890
+ {
3891
+ menuCode: "dashboard",
3892
+ menuName: "仪表盘",
3893
+ menuUrl: "/dashboard",
3894
+ icon: "dashboard",
3895
+ closable: !0,
3896
+ isDefault: !0,
3897
+ isOut: !1
3898
+ },
3899
+ {
3900
+ menuCode: "system",
3901
+ menuName: "系统管理",
3902
+ menuUrl: "/system",
3903
+ icon: "setting",
3904
+ closable: !1,
3905
+ isDefault: !1,
3906
+ isOut: !1,
3907
+ children: [
3908
+ {
3909
+ menuCode: "system_user",
3910
+ menuName: "用户管理",
3911
+ menuUrl: "/system/user",
3912
+ icon: "user",
3913
+ closable: !0,
3914
+ isDefault: !1,
3915
+ isOut: !1
3916
+ },
3917
+ {
3918
+ menuCode: "system_role",
3919
+ menuName: "角色管理",
3920
+ menuUrl: "/system/role",
3921
+ icon: "role",
3922
+ closable: !0,
3923
+ isDefault: !1,
3924
+ isOut: !1
3925
+ },
3926
+ {
3927
+ menuCode: "system_menu",
3928
+ menuName: "菜单管理",
3929
+ menuUrl: "/system/menu",
3930
+ icon: "menu",
3931
+ closable: !0,
3932
+ isDefault: !1,
3933
+ isOut: !1
3934
+ }
3935
+ ]
3936
+ }
3937
+ ], es = xt({
3938
+ history: Ct(),
3939
+ routes: [...Zt, Qt],
3940
+ scrollBehavior: () => ({ left: 0, top: 0 })
3941
+ }), Ma = ["/login"];
3942
+ es.beforeEach(async (o, i, v) => {
3943
+ const m = De();
3944
+ if (m.initTheme(), jt())
3945
+ if (o.path === "/login")
3946
+ v({ path: "/" });
3947
+ else {
3948
+ const f = Se();
3949
+ f.isLoggedIn || (f.setUserInfo({
3950
+ appId: ct(),
3951
+ userId: "1",
3952
+ userName: "管理员",
3953
+ departmentName: "技术部",
3954
+ email: "admin@example.com",
3955
+ mobilePhone: "13800138000",
3956
+ positionName: "管理员",
3957
+ avatar: ""
3958
+ }), Pe().setMenuList($a)), o.name && o.meta.keepAlive && m.addCachedView(o.name), v();
3959
+ }
3960
+ else
3961
+ Ma.includes(o.path) ? v() : v("/login");
3962
+ });
3963
+ function dl() {
3964
+ const o = xt({
3965
+ history: Ct(),
3966
+ routes: [...Zt, Qt]
3967
+ });
3968
+ es.matcher = o.matcher;
3969
+ }
3970
+ function fl(o, i = {}) {
3971
+ const v = i.indexPath || "/dashboard", m = {
3972
+ path: "/:pathMatch(.*)*",
3973
+ name: "CatchAll",
3974
+ component: () => Promise.resolve().then(() => Jt),
3975
+ meta: {
3976
+ title: "404"
3977
+ }
3978
+ };
3979
+ return {
3980
+ path: "/",
3981
+ name: "Layout",
3982
+ component: qt,
3983
+ redirect: v,
3984
+ children: [...o, m]
3985
+ };
3986
+ }
3987
+ function pl(o, i = {}) {
3988
+ return xt({
3989
+ history: Ct(i.base),
3990
+ routes: o,
3991
+ scrollBehavior: () => ({ left: 0, top: 0 })
3992
+ });
3993
+ }
3994
+ function ml(o) {
3995
+ return ue.get("/role/list", { params: o });
3996
+ }
3997
+ function hl(o) {
3998
+ return ue.get(`/role/${o}`);
3999
+ }
4000
+ function vl(o) {
4001
+ return ue.post("/role", o);
4002
+ }
4003
+ function gl(o, i) {
4004
+ return ue.put(`/role/${o}`, i);
4005
+ }
4006
+ function _l(o) {
4007
+ return ue.delete(`/role/${o}`);
4008
+ }
4009
+ function wl(o, i) {
4010
+ return ue.patch(`/role/${o}/status`, { status: i });
4011
+ }
4012
+ function yl() {
4013
+ return ue.get("/user/v1.0/menu/list");
4014
+ }
4015
+ function La(o) {
4016
+ const i = o || ct();
4017
+ return ue.get(`/user/v1.0/menu/get-menu?appId=${i}`);
4018
+ }
4019
+ function bl(o) {
4020
+ return ue.post("/menu", o);
4021
+ }
4022
+ function kl(o, i) {
4023
+ return ue.put(`/menu/${o}`, i);
4024
+ }
4025
+ function xl(o) {
4026
+ return ue.delete(`/menu/${o}`);
4027
+ }
4028
+ const Ia = ["/login", "/404", "/403"];
4029
+ function Cl(o, i = {}) {
4030
+ const v = i.whiteList || Ia, m = i.loginPath || "/login", f = i.homePath || "/";
4031
+ o.beforeEach(async (k, S, g) => {
4032
+ const M = De(), _ = Se(), x = Pe();
4033
+ if (M.initTheme(), ut())
4034
+ if (k.path === m)
4035
+ g({ path: f });
4036
+ else if (_.isLoggedIn)
4037
+ k.name && k.meta.keepAlive && M.addCachedView(k.name), g();
4038
+ else
4039
+ try {
4040
+ if (i.fetchUserInfo) {
4041
+ const C = await i.fetchUserInfo();
4042
+ _.setUserInfo(C);
4043
+ } else {
4044
+ const C = await oa();
4045
+ _.setUserInfo(C);
4046
+ }
4047
+ if (i.fetchMenu) {
4048
+ const C = await i.fetchMenu();
4049
+ x.setMenuList(C);
4050
+ } else {
4051
+ const C = await La(i.appId);
4052
+ x.setMenuList(C);
4053
+ }
4054
+ i.onLoginSuccess && i.onLoginSuccess(), k.name && k.meta.keepAlive && M.addCachedView(k.name), g({ ...k, replace: !0 });
4055
+ } catch (C) {
4056
+ console.error("获取用户信息失败:", C), _.clearUserInfo(), x.clearMenu(), We(), g({ path: m, query: { redirect: k.fullPath } });
4057
+ }
4058
+ else
4059
+ v.includes(k.path) ? g() : g({ path: m, query: { redirect: k.fullPath } });
4060
+ }), o.afterEach(() => {
4061
+ });
4062
+ }
4063
+ function Nl(o) {
4064
+ return ue.get("/user/list", { params: o });
4065
+ }
4066
+ function El(o) {
4067
+ return ue.get(`/user/${o}`);
4068
+ }
4069
+ function Sl(o) {
4070
+ return ue.post("/user", o);
4071
+ }
4072
+ function $l(o, i) {
4073
+ return ue.put(`/user/${o}`, i);
4074
+ }
4075
+ function Ml(o) {
4076
+ return ue.delete(`/user/${o}`);
4077
+ }
4078
+ function Ll(o) {
4079
+ return ue.post("/user/batch-delete", { ids: o });
4080
+ }
4081
+ function Il(o, i) {
4082
+ return ue.patch(`/user/${o}/status`, { status: i });
4083
+ }
4084
+ function Al(o) {
4085
+ return ue.post(`/user/${o}/reset-password`);
4086
+ }
4087
+ var Aa = /* @__PURE__ */ ((o) => (o[o.ENABLED = 1] = "ENABLED", o[o.DISABLED = 0] = "DISABLED", o))(Aa || {}), Ta = /* @__PURE__ */ ((o) => (o[o.UNKNOWN = 0] = "UNKNOWN", o[o.MALE = 1] = "MALE", o[o.FEMALE = 2] = "FEMALE", o))(Ta || {}), Oa = /* @__PURE__ */ ((o) => (o[o.DIRECTORY = 0] = "DIRECTORY", o[o.MENU = 1] = "MENU", o[o.BUTTON = 2] = "BUTTON", o))(Oa || {});
4088
+ const Tl = {
4089
+ 1: "启用",
4090
+ 0: "禁用"
4091
+ }, Ol = {
4092
+ 0: "未知",
4093
+ 1: "男",
4094
+ 2: "女"
4095
+ }, Ul = {
4096
+ 0: "目录",
4097
+ 1: "菜单",
4098
+ 2: "按钮"
4099
+ }, Bl = [
4100
+ {
4101
+ label: "启用",
4102
+ value: 1
4103
+ /* ENABLED */
4104
+ },
4105
+ {
4106
+ label: "禁用",
4107
+ value: 0
4108
+ /* DISABLED */
4109
+ }
4110
+ ], Pl = [
4111
+ {
4112
+ label: "未知",
4113
+ value: 0
4114
+ /* UNKNOWN */
4115
+ },
4116
+ {
4117
+ label: "男",
4118
+ value: 1
4119
+ /* MALE */
4120
+ },
4121
+ {
4122
+ label: "女",
4123
+ value: 2
4124
+ /* FEMALE */
4125
+ }
4126
+ ], Rl = [
4127
+ {
4128
+ label: "目录",
4129
+ value: 0
4130
+ /* DIRECTORY */
4131
+ },
4132
+ {
4133
+ label: "菜单",
4134
+ value: 1
4135
+ /* MENU */
4136
+ },
4137
+ {
4138
+ label: "按钮",
4139
+ value: 2
4140
+ /* BUTTON */
4141
+ }
4142
+ ], zl = {
4143
+ mounted(o, i) {
4144
+ var S, g;
4145
+ const v = Se(), m = Pe();
4146
+ if (!v.isLoggedIn) {
4147
+ (S = o.parentNode) == null || S.removeChild(o);
4148
+ return;
4149
+ }
4150
+ const f = i.value, k = Array.isArray(f) ? f : [f];
4151
+ m.hasPermission(k) || (g = o.parentNode) == null || g.removeChild(o);
4152
+ }
4153
+ };
4154
+ function Dl(o) {
4155
+ return ds({
4156
+ appId: o.appId,
4157
+ clientId: o.clientId,
4158
+ apiBaseUrl: o.apiBaseUrl
4159
+ }), o.locale && Promise.resolve().then(() => Sa).then(({ useLocaleStore: i }) => {
4160
+ i().changeLocale(o.locale);
4161
+ }), {
4162
+ config: {
4163
+ appName: o.appName || "XTO App",
4164
+ appId: ct(),
4165
+ clientId: zt(),
4166
+ apiBaseUrl: fs(),
4167
+ indexPath: o.indexPath || "/dashboard",
4168
+ loginPath: o.loginPath || "/login",
4169
+ locale: o.locale || "zh-CN"
4170
+ }
4171
+ };
4172
+ }
4173
+ export {
4174
+ cl as $,
4175
+ zt as A,
4176
+ Wa as B,
4177
+ yl as C,
4178
+ La as D,
4179
+ Ha as E,
4180
+ Ya as F,
4181
+ Ta as G,
4182
+ Sn as H,
4183
+ Ka as I,
4184
+ hl as J,
4185
+ ml as K,
4186
+ qt as L,
4187
+ Oa as M,
4188
+ ut as N,
4189
+ ws as O,
4190
+ vs as P,
4191
+ El as Q,
4192
+ oa as R,
4193
+ Aa as S,
4194
+ Xa as T,
4195
+ Nl as U,
4196
+ ll as V,
4197
+ il as W,
4198
+ jt as X,
4199
+ ue as Y,
4200
+ ds as Z,
4201
+ $e as _,
4202
+ Bl as a,
4203
+ xs as a0,
4204
+ Qt as a1,
4205
+ q as a2,
4206
+ et as a3,
4207
+ na as a4,
4208
+ Za as a5,
4209
+ $a as a6,
4210
+ zl as a7,
4211
+ Qa as a8,
4212
+ Al as a9,
4213
+ Pe as aA,
4214
+ ol as aB,
4215
+ Se as aC,
4216
+ dl as aa,
4217
+ es as ab,
4218
+ Ga as ac,
4219
+ tt as ad,
4220
+ Ja as ae,
4221
+ ks as af,
4222
+ bs as ag,
4223
+ _s as ah,
4224
+ hs as ai,
4225
+ ys as aj,
4226
+ Vt as ak,
4227
+ gs as al,
4228
+ Cl as am,
4229
+ Zt as an,
4230
+ kl as ao,
4231
+ gl as ap,
4232
+ wl as aq,
4233
+ $l as ar,
4234
+ Il as as,
4235
+ tl as at,
4236
+ De as au,
4237
+ sl as av,
4238
+ Ze as aw,
4239
+ nl as ax,
4240
+ rl as ay,
4241
+ Ot as az,
4242
+ Rl as b,
4243
+ el as c,
4244
+ Pl as d,
4245
+ Ol as e,
4246
+ Ul as f,
4247
+ ba as g,
4248
+ Pt as h,
4249
+ ma as i,
4250
+ Tl as j,
4251
+ qa as k,
4252
+ Ll as l,
4253
+ We as m,
4254
+ fl as n,
4255
+ bl as o,
4256
+ vl as p,
4257
+ pl as q,
4258
+ al as r,
4259
+ Sl as s,
4260
+ Dl as t,
4261
+ ul as u,
4262
+ xl as v,
4263
+ _l as w,
4264
+ Ml as x,
4265
+ fs as y,
4266
+ ct as z
4267
+ };