fdb2 1.0.16 → 1.0.18

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 (104) hide show
  1. package/dist/package.json +139 -0
  2. package/dist/pnpm-lock.yaml +7332 -0
  3. package/dist/public/.vite/manifest.json +129 -0
  4. package/dist/public/_plugin-vue_export-helper.js +12 -0
  5. package/dist/public/bootstrap-icons.woff +0 -0
  6. package/dist/public/bootstrap-icons.woff2 +0 -0
  7. package/dist/public/bootstrap.css +14152 -0
  8. package/dist/public/bootstrap.js +4717 -0
  9. package/dist/public/explorer.css +2542 -0
  10. package/dist/public/explorer.js +59004 -0
  11. package/dist/public/favicon.ico +0 -0
  12. package/dist/public/index.css +950 -0
  13. package/dist/public/index.js +614 -0
  14. package/dist/public/layout.css +318 -0
  15. package/dist/public/layout.js +35 -0
  16. package/dist/public/modal.css +150 -0
  17. package/dist/public/modal.js +4873 -0
  18. package/dist/public/rolldown-runtime.js +38 -0
  19. package/dist/public/vconsole.min.js +10355 -0
  20. package/dist/public/vue.js +6526 -0
  21. package/dist/scripts/nw-build.js +136 -0
  22. package/dist/scripts/nw-dev.js +67 -0
  23. package/dist/scripts/preinstall.js +112 -0
  24. package/dist/server/index.d.ts +2 -0
  25. package/dist/server/index.d.ts.map +1 -0
  26. package/dist/server/index.js +607 -0
  27. package/dist/server/index.js.map +1 -0
  28. package/dist/server/index.ts +685 -0
  29. package/dist/server/model/connection.entity.d.ts +55 -0
  30. package/dist/server/model/connection.entity.d.ts.map +1 -0
  31. package/dist/server/model/connection.entity.js +59 -0
  32. package/dist/server/model/connection.entity.js.map +1 -0
  33. package/dist/server/model/connection.entity.ts +66 -0
  34. package/dist/server/model/database.entity.d.ts +203 -0
  35. package/dist/server/model/database.entity.d.ts.map +1 -0
  36. package/dist/server/model/database.entity.js +211 -0
  37. package/dist/server/model/database.entity.js.map +1 -0
  38. package/dist/server/model/database.entity.ts +246 -0
  39. package/dist/server/service/connection.service.d.ts +84 -0
  40. package/dist/server/service/connection.service.d.ts.map +1 -0
  41. package/dist/server/service/connection.service.js +369 -0
  42. package/dist/server/service/connection.service.js.map +1 -0
  43. package/dist/server/service/connection.service.ts +359 -0
  44. package/dist/server/service/database/base.service.d.ts +183 -0
  45. package/dist/server/service/database/base.service.d.ts.map +1 -0
  46. package/dist/server/service/database/base.service.js +253 -0
  47. package/dist/server/service/database/base.service.js.map +1 -0
  48. package/dist/server/service/database/base.service.ts +407 -0
  49. package/dist/server/service/database/cockroachdb.service.d.ts +116 -0
  50. package/dist/server/service/database/cockroachdb.service.d.ts.map +1 -0
  51. package/dist/server/service/database/cockroachdb.service.js +812 -0
  52. package/dist/server/service/database/cockroachdb.service.js.map +1 -0
  53. package/dist/server/service/database/cockroachdb.service.ts +871 -0
  54. package/dist/server/service/database/database.service.d.ts +495 -0
  55. package/dist/server/service/database/database.service.d.ts.map +1 -0
  56. package/dist/server/service/database/database.service.js +711 -0
  57. package/dist/server/service/database/database.service.js.map +1 -0
  58. package/dist/server/service/database/database.service.ts +776 -0
  59. package/dist/server/service/database/index.d.ts +8 -0
  60. package/dist/server/service/database/index.d.ts.map +1 -0
  61. package/dist/server/service/database/index.js +18 -0
  62. package/dist/server/service/database/index.js.map +1 -0
  63. package/dist/server/service/database/index.ts +7 -0
  64. package/dist/server/service/database/mongodb.service.d.ts +121 -0
  65. package/dist/server/service/database/mongodb.service.d.ts.map +1 -0
  66. package/dist/server/service/database/mongodb.service.js +502 -0
  67. package/dist/server/service/database/mongodb.service.js.map +1 -0
  68. package/dist/server/service/database/mongodb.service.ts +501 -0
  69. package/dist/server/service/database/mssql.service.d.ts +118 -0
  70. package/dist/server/service/database/mssql.service.d.ts.map +1 -0
  71. package/dist/server/service/database/mssql.service.js +871 -0
  72. package/dist/server/service/database/mssql.service.js.map +1 -0
  73. package/dist/server/service/database/mssql.service.ts +932 -0
  74. package/dist/server/service/database/mysql.service.d.ts +114 -0
  75. package/dist/server/service/database/mysql.service.d.ts.map +1 -0
  76. package/dist/server/service/database/mysql.service.js +960 -0
  77. package/dist/server/service/database/mysql.service.js.map +1 -0
  78. package/dist/server/service/database/mysql.service.ts +1026 -0
  79. package/dist/server/service/database/oracle.service.d.ts +126 -0
  80. package/dist/server/service/database/oracle.service.d.ts.map +1 -0
  81. package/dist/server/service/database/oracle.service.js +963 -0
  82. package/dist/server/service/database/oracle.service.js.map +1 -0
  83. package/dist/server/service/database/oracle.service.ts +1036 -0
  84. package/dist/server/service/database/postgres.service.d.ts +122 -0
  85. package/dist/server/service/database/postgres.service.d.ts.map +1 -0
  86. package/dist/server/service/database/postgres.service.js +882 -0
  87. package/dist/server/service/database/postgres.service.js.map +1 -0
  88. package/dist/server/service/database/postgres.service.ts +961 -0
  89. package/dist/server/service/database/sap.service.d.ts +115 -0
  90. package/dist/server/service/database/sap.service.d.ts.map +1 -0
  91. package/dist/server/service/database/sap.service.js +868 -0
  92. package/dist/server/service/database/sap.service.js.map +1 -0
  93. package/dist/server/service/database/sap.service.ts +922 -0
  94. package/dist/server/service/database/sqlite.service.d.ts +112 -0
  95. package/dist/server/service/database/sqlite.service.d.ts.map +1 -0
  96. package/dist/server/service/database/sqlite.service.js +723 -0
  97. package/dist/server/service/database/sqlite.service.js.map +1 -0
  98. package/dist/server/service/database/sqlite.service.ts +787 -0
  99. package/dist/server/service/session.service.ts +158 -0
  100. package/dist/view/index.html +48 -0
  101. package/package.json +3 -2
  102. package/scripts/nw-build.js +136 -0
  103. package/scripts/nw-dev.js +67 -0
  104. package/scripts/preinstall.js +112 -0
@@ -0,0 +1,614 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./layout.js","./_plugin-vue_export-helper.js","./rolldown-runtime.js","./vue.js","./layout.css","./explorer.js","./modal.js","./bootstrap.js","./bootstrap.css","./modal.css","./explorer.css","./vconsole.min.js"])))=>i.map(i=>d[i]);
2
+ import { a as __toESM, n as __esmMin, t as __commonJSMin } from "./rolldown-runtime.js";
3
+ import { E as getCurrentInstance, I as resolveComponent, N as openBlock, a as init_vue_router, c as init_vue_runtime_esm_bundler, i as createWebHistory, l as createApp, n as useTitle, r as createRouter, t as init_core, v as createBlock } from "./vue.js";
4
+ import { n as init__plugin_vue_export_helper, t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
5
+ import { C as init_SysConfig, D as init_axios, E as init_config, O as axios, S as init_pinia, T as config_default, _ as request, b as createPinia, c as init_modal, d as init_toast$2, f as setGlobalToast, g as init_base, h as toast_default$1, l as modal_default$1, m as init_toast$1, n as init_modal$1, o as dataGrid_default, r as modal_default, s as init_dataGrid, v as init_session, w as sysConfig, y as useSessionStore } from "./modal.js";
6
+ import { i as init_bootstrap, n as init_bootstrap_esm, r as init_bootstrap_icons } from "./bootstrap.js";
7
+ //#region \0vite/modulepreload-polyfill.js
8
+ (function polyfill() {
9
+ const relList = document.createElement("link").relList;
10
+ if (relList && relList.supports && relList.supports("modulepreload")) return;
11
+ for (const link of document.querySelectorAll("link[rel=\"modulepreload\"]")) processPreload(link);
12
+ new MutationObserver((mutations) => {
13
+ for (const mutation of mutations) {
14
+ if (mutation.type !== "childList") continue;
15
+ for (const node of mutation.addedNodes) if (node.tagName === "LINK" && node.rel === "modulepreload") processPreload(node);
16
+ }
17
+ }).observe(document, {
18
+ childList: true,
19
+ subtree: true
20
+ });
21
+ function getFetchOpts(link) {
22
+ const fetchOpts = {};
23
+ if (link.integrity) fetchOpts.integrity = link.integrity;
24
+ if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy;
25
+ if (link.crossOrigin === "use-credentials") fetchOpts.credentials = "include";
26
+ else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit";
27
+ else fetchOpts.credentials = "same-origin";
28
+ return fetchOpts;
29
+ }
30
+ function processPreload(link) {
31
+ if (link.ep) return;
32
+ link.ep = true;
33
+ const fetchOpts = getFetchOpts(link);
34
+ fetch(link.href, fetchOpts);
35
+ }
36
+ })();
37
+ //#endregion
38
+ //#region src/platform/App.vue
39
+ function _sfc_render(_ctx, _cache) {
40
+ const _component_router_view = resolveComponent("router-view");
41
+ return openBlock(), createBlock(_component_router_view);
42
+ }
43
+ var _sfc_main, App_default;
44
+ var init_App = __esmMin((() => {
45
+ init_vue_runtime_esm_bundler();
46
+ init__plugin_vue_export_helper();
47
+ _sfc_main = {};
48
+ App_default = /* @__PURE__ */ _plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render]]);
49
+ }));
50
+ //#endregion
51
+ //#region src/adapter/ajax.ts
52
+ /**
53
+ * 生成每个请求唯一的键
54
+ * @param {*} config
55
+ * @returns string
56
+ */
57
+ function getPendingKey(config) {
58
+ const { url, method, params } = config;
59
+ let { data } = config;
60
+ if (typeof data === "string") data = JSON.parse(data);
61
+ return [
62
+ url,
63
+ method,
64
+ JSON.stringify(params),
65
+ JSON.stringify(data)
66
+ ].join("&");
67
+ }
68
+ /**
69
+ * 储存每个请求唯一值, 也就是cancel()方法, 用于取消请求
70
+ *
71
+ * @param {*} config
72
+ */
73
+ function addPending(config) {
74
+ const pendingKey = getPendingKey(config);
75
+ const controller = new AbortController();
76
+ config.signal = controller.signal;
77
+ pendingMap.set(pendingKey, controller);
78
+ }
79
+ /**
80
+ * 删除重复的请求key
81
+ * @param {*} config
82
+ */
83
+ function removePending(config) {
84
+ const pendingKey = getPendingKey(config);
85
+ if (pendingMap.has(pendingKey)) pendingMap.delete(pendingKey);
86
+ }
87
+ /**
88
+ * 取消所有请求
89
+ * @param {*} config
90
+ */
91
+ function abortAllPending() {
92
+ for (const [key, value] of pendingMap.entries()) {
93
+ value.abort();
94
+ pendingMap.delete(key);
95
+ }
96
+ }
97
+ /**
98
+ * 处理异常
99
+ * @param {*} error
100
+ */
101
+ function getHttpErrorMsg(error) {
102
+ let message = "";
103
+ if (axios.isCancel(error)) console.error(`重复请求:${error.config.url} ${error.message}`);
104
+ if (error && error.response) switch (error.response.status) {
105
+ case 302:
106
+ message = "接口重定向了!";
107
+ break;
108
+ case 400:
109
+ message = "参数不正确!";
110
+ break;
111
+ case 401:
112
+ message = "您未登录,或者登录已经超时,请先登录!";
113
+ break;
114
+ case 403:
115
+ message = "您没有权限操作!";
116
+ break;
117
+ case 504:
118
+ message = "服务暂时无法访问,请稍后再试!";
119
+ break;
120
+ default:
121
+ message = "异常问题,请联系管理员!";
122
+ break;
123
+ }
124
+ if (error.message.includes("timeout")) message = "网络请求超时!";
125
+ if (error.message.includes("Network")) message = window.navigator.onLine ? "服务端异常!" : "您断网了!";
126
+ return message;
127
+ }
128
+ var pendingMap, service;
129
+ var init_ajax = __esmMin((() => {
130
+ init_axios();
131
+ init_config();
132
+ pendingMap = /* @__PURE__ */ new Map();
133
+ service = axios.create({
134
+ baseURL: `${config_default.baseURL}`,
135
+ timeout: 3e4
136
+ });
137
+ service.interceptors.request.use((config) => {
138
+ const pendingKey = getPendingKey(config);
139
+ if (pendingMap.has(pendingKey)) pendingMap.get(pendingKey).abort();
140
+ else addPending(config);
141
+ return config;
142
+ }, (error) => {
143
+ return Promise.reject(error);
144
+ });
145
+ service.interceptors.response.use((response) => {
146
+ removePending(response.config);
147
+ return response;
148
+ }, (error) => {
149
+ error.config && removePending(error.config);
150
+ error.message = getHttpErrorMsg(error);
151
+ return Promise.reject(error);
152
+ });
153
+ }));
154
+ //#endregion
155
+ //#region node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.mjs
156
+ /*! js-cookie v3.0.5 | MIT */
157
+ function assign(target) {
158
+ for (var i = 1; i < arguments.length; i++) {
159
+ var source = arguments[i];
160
+ for (var key in source) target[key] = source[key];
161
+ }
162
+ return target;
163
+ }
164
+ function init(converter, defaultAttributes) {
165
+ function set(name, value, attributes) {
166
+ if (typeof document === "undefined") return;
167
+ attributes = assign({}, defaultAttributes, attributes);
168
+ if (typeof attributes.expires === "number") attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
169
+ if (attributes.expires) attributes.expires = attributes.expires.toUTCString();
170
+ name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
171
+ var stringifiedAttributes = "";
172
+ for (var attributeName in attributes) {
173
+ if (!attributes[attributeName]) continue;
174
+ stringifiedAttributes += "; " + attributeName;
175
+ if (attributes[attributeName] === true) continue;
176
+ stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
177
+ }
178
+ return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes;
179
+ }
180
+ function get(name) {
181
+ if (typeof document === "undefined" || arguments.length && !name) return;
182
+ var cookies = document.cookie ? document.cookie.split("; ") : [];
183
+ var jar = {};
184
+ for (var i = 0; i < cookies.length; i++) {
185
+ var parts = cookies[i].split("=");
186
+ var value = parts.slice(1).join("=");
187
+ try {
188
+ var found = decodeURIComponent(parts[0]);
189
+ jar[found] = converter.read(value, found);
190
+ if (name === found) break;
191
+ } catch (e) {}
192
+ }
193
+ return name ? jar[name] : jar;
194
+ }
195
+ return Object.create({
196
+ set,
197
+ get,
198
+ remove: function(name, attributes) {
199
+ set(name, "", assign({}, attributes, { expires: -1 }));
200
+ },
201
+ withAttributes: function(attributes) {
202
+ return init(this.converter, assign({}, this.attributes, attributes));
203
+ },
204
+ withConverter: function(converter) {
205
+ return init(assign({}, this.converter, converter), this.attributes);
206
+ }
207
+ }, {
208
+ attributes: { value: Object.freeze(defaultAttributes) },
209
+ converter: { value: Object.freeze(converter) }
210
+ });
211
+ }
212
+ var defaultConverter, api;
213
+ var init_js_cookie = __esmMin((() => {
214
+ defaultConverter = {
215
+ read: function(value) {
216
+ if (value[0] === "\"") value = value.slice(1, -1);
217
+ return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
218
+ },
219
+ write: function(value) {
220
+ return encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);
221
+ }
222
+ };
223
+ api = init(defaultConverter, { path: "/" });
224
+ }));
225
+ //#endregion
226
+ //#region src/service/login.ts
227
+ async function getLoginSession(token) {
228
+ try {
229
+ return {
230
+ ret: 0,
231
+ msg: "获取成功",
232
+ data: await request("/api/session/getLoginSession", { token })
233
+ };
234
+ } catch (error) {
235
+ return {
236
+ ret: error.ret || -1,
237
+ msg: error.msg || "获取登录会话失败"
238
+ };
239
+ }
240
+ }
241
+ async function loginByCode(authCode) {
242
+ try {
243
+ return {
244
+ ret: 0,
245
+ msg: "登录成功",
246
+ data: await request("/api/session/loginByCode", { authCode })
247
+ };
248
+ } catch (error) {
249
+ return {
250
+ ret: error.ret || -1,
251
+ msg: error.msg || "登录失败"
252
+ };
253
+ }
254
+ }
255
+ function getLoginUrl(redirectUrl = location.href) {
256
+ return sysConfig.getLoginUrl(redirectUrl);
257
+ }
258
+ async function redirectToLogin() {
259
+ const url = getLoginUrl();
260
+ location.replace(url);
261
+ return false;
262
+ }
263
+ async function checkLogin() {
264
+ const sessionStore = useSessionStore();
265
+ console.log("Current state:", sessionStore.$state);
266
+ if (!sessionStore.isLoggedIn) return await redirectToLogin();
267
+ return sessionStore;
268
+ }
269
+ async function initLoginState(to) {
270
+ const sessionStore = useSessionStore();
271
+ if (sessionStore.isLoggedIn) return true;
272
+ try {
273
+ const token = api.get("token");
274
+ if (token) {
275
+ const res = await getLoginSession(token);
276
+ if (res.ret === 0 && res.data) sessionStore.setSession(res.data);
277
+ }
278
+ if (sessionStore.isLoggedIn) return true;
279
+ const currentUrl = new URL(window.location.href);
280
+ const authCode = currentUrl.searchParams.get("auth_code");
281
+ if (authCode) {
282
+ const res = await loginByCode(authCode);
283
+ if (res.ret === 0 && res.data) {
284
+ sessionStore.setSession(res.data);
285
+ api.set("token", res.data.id);
286
+ }
287
+ currentUrl.searchParams.delete("auth_code");
288
+ const noauthUrl = currentUrl.toString();
289
+ console.log(noauthUrl);
290
+ window.location.replace(noauthUrl);
291
+ return false;
292
+ }
293
+ } catch (e) {
294
+ console.error(e);
295
+ }
296
+ return true;
297
+ }
298
+ var init_login = __esmMin((() => {
299
+ init_SysConfig();
300
+ init_base();
301
+ init_js_cookie();
302
+ init_session();
303
+ }));
304
+ //#endregion
305
+ //#region \0vite/preload-helper.js
306
+ var scriptRel, assetsURL, seen, __vitePreload;
307
+ var init_preload_helper = __esmMin((() => {
308
+ scriptRel = "modulepreload";
309
+ assetsURL = function(dep, importerUrl) {
310
+ return new URL(dep, importerUrl).href;
311
+ };
312
+ seen = {};
313
+ __vitePreload = function preload(baseModule, deps, importerUrl) {
314
+ let promise = Promise.resolve();
315
+ if (deps && deps.length > 0) {
316
+ const links = document.getElementsByTagName("link");
317
+ const cspNonceMeta = document.querySelector("meta[property=csp-nonce]");
318
+ const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute("nonce");
319
+ function allSettled(promises) {
320
+ return Promise.all(promises.map((p) => Promise.resolve(p).then((value) => ({
321
+ status: "fulfilled",
322
+ value
323
+ }), (reason) => ({
324
+ status: "rejected",
325
+ reason
326
+ }))));
327
+ }
328
+ promise = allSettled(deps.map((dep) => {
329
+ dep = assetsURL(dep, importerUrl);
330
+ if (dep in seen) return;
331
+ seen[dep] = true;
332
+ const isCss = dep.endsWith(".css");
333
+ const cssSelector = isCss ? "[rel=\"stylesheet\"]" : "";
334
+ if (!!importerUrl) for (let i = links.length - 1; i >= 0; i--) {
335
+ const link = links[i];
336
+ if (link.href === dep && (!isCss || link.rel === "stylesheet")) return;
337
+ }
338
+ else if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) return;
339
+ const link = document.createElement("link");
340
+ link.rel = isCss ? "stylesheet" : scriptRel;
341
+ if (!isCss) link.as = "script";
342
+ link.crossOrigin = "";
343
+ link.href = dep;
344
+ if (cspNonce) link.setAttribute("nonce", cspNonce);
345
+ document.head.appendChild(link);
346
+ if (isCss) return new Promise((res, rej) => {
347
+ link.addEventListener("load", res);
348
+ link.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`)));
349
+ });
350
+ }));
351
+ }
352
+ function handlePreloadError(err) {
353
+ const e = new Event("vite:preloadError", { cancelable: true });
354
+ e.payload = err;
355
+ window.dispatchEvent(e);
356
+ if (!e.defaultPrevented) throw err;
357
+ }
358
+ return promise.then((res) => {
359
+ for (const item of res || []) {
360
+ if (item.status !== "rejected") continue;
361
+ handlePreloadError(item.reason);
362
+ }
363
+ return baseModule().catch(handlePreloadError);
364
+ });
365
+ };
366
+ }));
367
+ //#endregion
368
+ //#region src/platform/database/router.ts
369
+ var routes;
370
+ var init_router$1 = __esmMin((() => {
371
+ init_preload_helper();
372
+ routes = [{
373
+ path: "/database",
374
+ component: () => __vitePreload(() => import("./layout.js"), __vite__mapDeps([0,1,2,3,4]), import.meta.url),
375
+ redirect: "/database/index",
376
+ meta: {
377
+ title: "数据库管理",
378
+ icon: "bi-database",
379
+ needAuth: false
380
+ },
381
+ children: [{
382
+ path: "index",
383
+ name: "database-index",
384
+ component: () => __vitePreload(() => import("./explorer.js"), __vite__mapDeps([5,1,2,6,7,8,3,9,10]), import.meta.url),
385
+ meta: {
386
+ title: "数据库管理首页",
387
+ icon: "bi-house",
388
+ needAuth: false
389
+ }
390
+ }, {
391
+ path: "explorer",
392
+ name: "database-explorer",
393
+ component: () => __vitePreload(() => import("./explorer.js"), __vite__mapDeps([5,1,2,6,7,8,3,9,10]), import.meta.url),
394
+ meta: {
395
+ title: "数据库浏览器",
396
+ icon: "bi-diagram-3",
397
+ needAuth: false
398
+ }
399
+ }]
400
+ }];
401
+ }));
402
+ //#endregion
403
+ //#region src/platform/router.ts
404
+ var router;
405
+ var init_router = __esmMin((() => {
406
+ init_vue_router();
407
+ init_core();
408
+ init_ajax();
409
+ init_login();
410
+ init_router$1();
411
+ router = createRouter({
412
+ history: createWebHistory("./"),
413
+ routes: [...routes, {
414
+ path: "/:pathMatch(.*)*",
415
+ name: "not-found",
416
+ redirect: "/database/index"
417
+ }]
418
+ });
419
+ router.beforeEach(async (to, from, next) => {
420
+ abortAllPending();
421
+ if (await initLoginState(to) === false) return;
422
+ if (to.meta?.needAuth) await checkLogin();
423
+ next();
424
+ });
425
+ router.afterEach((to) => {
426
+ if (to.meta?.title) useTitle(to.meta.title);
427
+ });
428
+ }));
429
+ //#endregion
430
+ //#region node_modules/.pnpm/pinia-plugin-persistedstate@4.7.1_pinia@3.0.4_typescript@5.9.3_vue@3.5.32_typescript@5.9.3__/node_modules/pinia-plugin-persistedstate/dist/index.js
431
+ function get(obj, path) {
432
+ if (obj == null) return void 0;
433
+ let value = obj;
434
+ for (let i = 0; i < path.length; i++) {
435
+ if (value === void 0 || value[path[i]] === void 0) return void 0;
436
+ if (value === null || value[path[i]] === null) return null;
437
+ value = value[path[i]];
438
+ }
439
+ return value;
440
+ }
441
+ function set(obj, value, path) {
442
+ if (path.length === 0) return value;
443
+ const idx = path[0];
444
+ if (path.length > 1) value = set(typeof obj !== "object" || obj === null || !Object.prototype.hasOwnProperty.call(obj, idx) ? Number.isInteger(Number(path[1])) ? [] : {} : obj[idx], value, Array.prototype.slice.call(path, 1));
445
+ if (Number.isInteger(Number(idx)) && Array.isArray(obj)) return obj.slice()[idx];
446
+ return Object.assign({}, obj, { [idx]: value });
447
+ }
448
+ function unset(obj, path) {
449
+ if (obj == null || path.length === 0) return obj;
450
+ if (path.length === 1) {
451
+ if (obj == null) return obj;
452
+ if (Number.isInteger(path[0]) && Array.isArray(obj)) return Array.prototype.slice.call(obj, 0).splice(path[0], 1);
453
+ const result = {};
454
+ for (const p in obj) result[p] = obj[p];
455
+ delete result[path[0]];
456
+ return result;
457
+ }
458
+ if (obj[path[0]] == null) {
459
+ if (Number.isInteger(path[0]) && Array.isArray(obj)) return Array.prototype.concat.call([], obj);
460
+ const result = {};
461
+ for (const p in obj) result[p] = obj[p];
462
+ return result;
463
+ }
464
+ return set(obj, unset(obj[path[0]], Array.prototype.slice.call(path, 1)), [path[0]]);
465
+ }
466
+ function deepPick(obj, paths) {
467
+ return paths.map((p) => p.split(".")).map((p) => [p, get(obj, p)]).filter((t) => t[1] !== void 0).reduce((acc, cur) => set(acc, cur[1], cur[0]), {});
468
+ }
469
+ function deepOmit(obj, paths) {
470
+ return paths.map((p) => p.split(".")).reduce((acc, cur) => unset(acc, cur), obj);
471
+ }
472
+ function hydrateStore(store, { storage, serializer, key, debug, pick, omit, beforeHydrate, afterHydrate }, context, runHooks = true) {
473
+ try {
474
+ if (runHooks) beforeHydrate?.(context);
475
+ const fromStorage = storage.getItem(key);
476
+ if (fromStorage) {
477
+ const deserialized = serializer.deserialize(fromStorage);
478
+ const picked = pick ? deepPick(deserialized, pick) : deserialized;
479
+ const omitted = omit ? deepOmit(picked, omit) : picked;
480
+ store.$patch(omitted);
481
+ }
482
+ if (runHooks) afterHydrate?.(context);
483
+ } catch (error) {
484
+ if (debug) console.error("[pinia-plugin-persistedstate]", error);
485
+ }
486
+ }
487
+ function persistState(state, { storage, serializer, key, debug, pick, omit }) {
488
+ try {
489
+ const picked = pick ? deepPick(state, pick) : state;
490
+ const omitted = omit ? deepOmit(picked, omit) : picked;
491
+ const toStorage = serializer.serialize(omitted);
492
+ storage.setItem(key, toStorage);
493
+ } catch (error) {
494
+ if (debug) console.error("[pinia-plugin-persistedstate]", error);
495
+ }
496
+ }
497
+ function parsePersistKey(key, storeId) {
498
+ return typeof key === "function" ? key(storeId) : typeof key === "string" ? key : storeId;
499
+ }
500
+ function createPersistence(context, optionsParser, auto) {
501
+ const { pinia, store, options: { persist = auto } } = context;
502
+ if (!persist) return;
503
+ // v8 ignore if -- @preserve
504
+ if (!(store.$id in pinia.state.value)) {
505
+ const originalStore = pinia._s.get(store.$id.replace("__hot:", ""));
506
+ if (originalStore) Promise.resolve().then(() => originalStore.$persist());
507
+ return;
508
+ }
509
+ const persistences = (Array.isArray(persist) ? persist : persist === true ? [{}] : [persist]).map(optionsParser);
510
+ store.$hydrate = ({ runHooks = true } = {}) => {
511
+ persistences.forEach((p) => {
512
+ hydrateStore(store, p, context, runHooks);
513
+ });
514
+ };
515
+ store.$persist = () => {
516
+ persistences.forEach((p) => {
517
+ persistState(store.$state, p);
518
+ });
519
+ };
520
+ persistences.forEach((p) => {
521
+ hydrateStore(store, p, context);
522
+ store.$subscribe((_mutation, state) => persistState(state, p), { detached: true });
523
+ });
524
+ }
525
+ /**
526
+ * Create a Pinia persistence plugin.
527
+ * @see https://codeberg.org/praz/pinia-plugin-persistedstate
528
+ */
529
+ function createPersistedState(options = {}) {
530
+ return function(context) {
531
+ createPersistence(context, (p) => {
532
+ const persistKey = parsePersistKey(p.key, context.store.$id);
533
+ return {
534
+ key: (options.key ? options.key : (x) => x)(persistKey),
535
+ debug: p.debug ?? options.debug ?? false,
536
+ serializer: p.serializer ?? options.serializer ?? {
537
+ serialize: (data) => JSON.stringify(data),
538
+ deserialize: (data) => JSON.parse(data)
539
+ },
540
+ storage: p.storage ?? options.storage ?? window.localStorage,
541
+ beforeHydrate: p.beforeHydrate ?? options.beforeHydrate,
542
+ afterHydrate: p.afterHydrate ?? options.afterHydrate,
543
+ pick: p.pick,
544
+ omit: p.omit
545
+ };
546
+ }, options.auto ?? false);
547
+ };
548
+ }
549
+ var src_default;
550
+ var init_dist = __esmMin((() => {
551
+ src_default = createPersistedState();
552
+ }));
553
+ //#endregion
554
+ //#region src/assets/database.css
555
+ var init_database = __esmMin((() => {}));
556
+ //#endregion
557
+ //#region src/components/toast/index.ts
558
+ var toast_default;
559
+ var init_toast = __esmMin((() => {
560
+ init_vue_runtime_esm_bundler();
561
+ init_toast$1();
562
+ init_toast$2();
563
+ toast_default = {
564
+ install(app) {
565
+ const toastMount = document.createElement("div");
566
+ document.body.appendChild(toastMount);
567
+ const toastInstance = createApp(toast_default$1).mount(toastMount);
568
+ const toastMethods = {
569
+ show: (message, title, type, duration = 3e3) => toastInstance.addToast(title, message, type, duration),
570
+ success: (msg, title, duration = 3e3) => toastInstance.addToast(title, msg, "success", duration),
571
+ error: (msg, title, duration = 3e3) => toastInstance.addToast(title, msg, "danger", duration),
572
+ warning: (msg, title, duration = 3e3) => toastInstance.addToast(title, msg, "warning", duration),
573
+ info: (msg, title, duration = 3e3) => toastInstance.addToast(title, msg, "info", duration)
574
+ };
575
+ setGlobalToast(toastMethods);
576
+ app.config.globalProperties.$toast = toastMethods;
577
+ },
578
+ getToast() {
579
+ const instance = getCurrentInstance();
580
+ if (!instance) return null;
581
+ return instance.appContext.config?.globalProperties?.$toast;
582
+ }
583
+ };
584
+ }));
585
+ (/* @__PURE__ */ __commonJSMin((() => {
586
+ init_vue_runtime_esm_bundler();
587
+ init_App();
588
+ init_router();
589
+ init_pinia();
590
+ init_dist();
591
+ init_bootstrap();
592
+ init_bootstrap_icons();
593
+ init_database();
594
+ init_bootstrap_esm();
595
+ init_toast();
596
+ init_modal();
597
+ init_dataGrid();
598
+ init_modal$1();
599
+ init_preload_helper();
600
+ if (window.__INITIAL_STATE__?.dev) __vitePreload(() => import("./vconsole.min.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1)).then((VConsole) => {
601
+ new VConsole.default();
602
+ }), __vite__mapDeps([11,2]), import.meta.url);
603
+ var app = createApp(App_default);
604
+ var pinia = createPinia();
605
+ pinia.use(src_default);
606
+ app.use(router);
607
+ app.use(pinia);
608
+ app.use(toast_default);
609
+ app.use(modal_default);
610
+ app.component("Modal", modal_default$1);
611
+ app.component("DataGrid", dataGrid_default);
612
+ app.mount("#app");
613
+ })))();
614
+ //#endregion