@vtj/renderer 0.12.66 → 0.12.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,18 +1,18 @@
1
- import { Base as Je, BUILT_IN_COMPONENTS as qe, ProjectModel as U, HistoryModel as _e } from "@vtj/core";
2
- import { isUrl as Ke, url as A, dedupArray as ze, isString as R, isFunction as L, logger as I, storage as V, cookie as W, toArray as fe, unRSA as de, delay as ne, createRequest as we, jsonp as Se, merge as Ge, pathToRegexp as Ve, pathToRegexpMatch as We, formDataToJson as Qe, Queue as Xe, cloneDeep as he, camelCase as b, isObject as Ye, upperFirst as Ze, pick as et, request as X, loadScript as me, Storage as tt, mapToObject as ie } from "@vtj/utils";
3
- import * as J from "vue";
4
- import { inject as $e, defineComponent as Ee, h as Y, ref as Z, watchEffect as st, defineAsyncComponent as ge } from "vue";
5
- import { useRoute as je } from "vue-router";
1
+ import { Base as Ke, BUILT_IN_COMPONENTS as ze, ProjectModel as U, HistoryModel as Se } from "@vtj/core";
2
+ import { isUrl as Ge, url as A, dedupArray as Ve, isString as b, isFunction as L, logger as I, storage as W, cookie as Q, toArray as me, unRSA as ge, delay as ce, createRequest as $e, jsonp as je, merge as We, pathToRegexp as Qe, pathToRegexpMatch as Xe, formDataToJson as Ye, Queue as Ze, cloneDeep as ve, camelCase as R, isObject as et, upperFirst as tt, pick as st, request as ee, loadScript as ye, Storage as nt, mapToObject as le } from "@vtj/utils";
3
+ import * as q from "vue";
4
+ import { inject as Ee, defineComponent as Re, h as te, ref as se, watchEffect as rt, defineAsyncComponent as _e } from "vue";
5
+ import { useRoute as be } from "vue-router";
6
6
  /**!
7
7
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
8
8
  * @name @vtj/renderer
9
9
  * @author CHC chenhuachun1549@dingtalk.com
10
- * @version 0.12.66
10
+ * @version 0.12.68
11
11
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
12
12
  */
13
- const k = "0.12.66";
14
- var w = /* @__PURE__ */ ((r) => (r.Runtime = "Runtime", r.Design = "Design", r.Raw = "Raw", r.VNode = "VNode", r))(w || {});
15
- const ve = [
13
+ const k = "0.12.68";
14
+ var w = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(w || {});
15
+ const we = [
16
16
  "$el",
17
17
  "$emit",
18
18
  "$nextTick",
@@ -24,7 +24,7 @@ const ve = [
24
24
  "$props",
25
25
  "$options",
26
26
  "$forceUpdate"
27
- ], cs = [
27
+ ], us = [
28
28
  "beforeCreate",
29
29
  "created",
30
30
  "beforeMount",
@@ -38,7 +38,7 @@ const ve = [
38
38
  "renderTriggered",
39
39
  "activated",
40
40
  "deactivated"
41
- ], rt = [
41
+ ], ot = [
42
42
  "vIf",
43
43
  "vElseIf",
44
44
  "vElse",
@@ -47,7 +47,7 @@ const ve = [
47
47
  "vFor",
48
48
  "vBind",
49
49
  "vHtml"
50
- ], nt = {
50
+ ], it = {
51
51
  String,
52
52
  Number,
53
53
  Boolean,
@@ -55,9 +55,9 @@ const ve = [
55
55
  Object,
56
56
  Function,
57
57
  Date
58
- }, M = "VtjPage", N = "VtjHomepage", it = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot,svg".split(
58
+ }, M = "VtjPage", N = "VtjHomepage", at = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot,svg".split(
59
59
  ","
60
- ), ot = "component,slot".split(","), ls = [
60
+ ), ct = "component,slot".split(","), ps = [
61
61
  "h",
62
62
  "t",
63
63
  "t",
@@ -78,7 +78,7 @@ const ve = [
78
78
  "p",
79
79
  "r",
80
80
  "o"
81
- ].join(""), us = {
81
+ ].join(""), fs = {
82
82
  auth: [
83
83
  "h",
84
84
  "t",
@@ -139,62 +139,62 @@ const ve = [
139
139
  ].join(""),
140
140
  privateKey: "MIIBOgIBAAJBAKoIzmn1FYQ1YOhOBw9EhABxZ+PySAIaydI+zdhoKflrdgJ4A5E4/5gbQmRpk09hPWG8nvX7h+l/QLU8kXxAIBECAwEAAQJAAlgpxQY6sByLsXqzJcthC8LSGsLf2JEJkHwlnpwFqlEV8UCkoINpuZ2Wzl+aftURu5rIfAzRCQBvHmeOTW9/zQIhAO5ufWDmnSLyfAAsNo5JRNpVuLFCFodR8Xm+ulDlosR/AiEAtpAltyP9wmCABKG/v/hrtTr3mcvFNGCjoGa9bUAok28CIHbrVs9w1ijrBlvTsXYwJw46uP539uKRRT4ymZzlm9QjAiB+1KH/G9f9pEEL9rtaSOG7JF5D0JcOjlze4MGVFs+ZrQIhALKOUFBNr2zEsyJIjw2PlvEucdlG77UniszjXTROHSPd"
141
141
  };
142
- function x(r, e) {
143
- return r.map((t) => Ke(t) || t.startsWith("/") ? t : `${e}${t}`);
142
+ function x(n, e) {
143
+ return n.map((t) => Ge(t) || t.startsWith("/") ? t : `${e}${t}`);
144
144
  }
145
- function q(r) {
146
- return /\.css$/.test(r);
145
+ function K(n) {
146
+ return /\.css$/.test(n);
147
147
  }
148
- function K(r) {
149
- return /\.js$/.test(r);
148
+ function z(n) {
149
+ return /\.js$/.test(n);
150
150
  }
151
- function at(r) {
152
- return /\.json$/.test(r);
151
+ function lt(n) {
152
+ return /\.json$/.test(n);
153
153
  }
154
- function ps(r) {
155
- return r.map(
154
+ function ds(n) {
155
+ return n.map(
156
156
  (e) => `<script src="${A.append(e, { v: k })}"><\/script>`
157
157
  ).join("");
158
158
  }
159
- function fs(r = []) {
160
- return r.map(
159
+ function hs(n = []) {
160
+ return n.map(
161
161
  (e) => `<link rel="stylesheet" href="${A.append(e, { v: k })}" />`
162
162
  ).join("");
163
163
  }
164
- function ct(r, e = !1) {
165
- return e && r.endsWith(".prod.js") ? r.replace(".prod.js", ".js") : r;
164
+ function ut(n, e = !1) {
165
+ return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
166
166
  }
167
- function lt(r, e, t = !1) {
168
- const s = r.filter((h) => !!h.enabled), n = [], i = [], a = [], o = [], p = {}, c = {}, l = [], u = {};
167
+ function pt(n, e, t = !1) {
168
+ const s = n.filter((h) => !!h.enabled), r = [], o = [], a = [], i = [], p = {}, c = {}, l = [], u = {};
169
169
  return s.forEach(
170
- ({ urls: h, assetsUrl: d, library: f, assetsLibrary: g, localeLibrary: y }) => {
170
+ ({ urls: h, assetsUrl: f, library: d, assetsLibrary: v, localeLibrary: g }) => {
171
171
  h?.forEach((m) => {
172
- K(m) && n.push(ct(m, t)), q(m) && i.push(m);
173
- }), f && (o.push(f), p[f] = x(h || [], e), y && (c[f] = y)), d && a.push(d), g && l.push(g), f && g && (u[g] = f);
172
+ z(m) && r.push(ut(m, t)), K(m) && o.push(m);
173
+ }), d && (i.push(d), p[d] = x(h || [], e), g && (c[d] = g)), f && a.push(f), v && l.push(v), d && v && (u[v] = d);
174
174
  }
175
175
  ), {
176
- scripts: x(n, e),
177
- css: x(i, e),
176
+ scripts: x(r, e),
177
+ css: x(o, e),
178
178
  materials: x(a, e),
179
- libraryExports: o,
180
- materialExports: ze(l),
179
+ libraryExports: i,
180
+ materialExports: Ve(l),
181
181
  materialMapLibrary: u,
182
182
  libraryMap: p,
183
183
  libraryLocaleMap: c
184
184
  };
185
185
  }
186
- function ut(r, e) {
187
- const { name: t, parent: s, alias: n } = r;
188
- return s ? e[s]?.[n || t] : e[n || t];
186
+ function ft(n, e) {
187
+ const { name: t, parent: s, alias: r } = n;
188
+ return s ? e[s]?.[r || t] : e[r || t];
189
189
  }
190
- function pt(r = []) {
191
- const e = r.filter((s) => q(s)), t = r.filter((s) => K(s));
190
+ function dt(n = []) {
191
+ const e = n.filter((s) => K(s)), t = n.filter((s) => z(s));
192
192
  return {
193
193
  css: e,
194
194
  js: t
195
195
  };
196
196
  }
197
- function ft(r, e) {
197
+ function ht(n, e) {
198
198
  const t = (c) => {
199
199
  const l = [];
200
200
  let u = 0;
@@ -214,7 +214,7 @@ function ft(r, e) {
214
214
  const m = u;
215
215
  for (; u < c.length && c[u] !== "{" && c[u] !== ";"; )
216
216
  u++;
217
- const E = c.substring(m, u).trim(), v = E.includes("@keyframes");
217
+ const j = c.substring(m, u).trim(), y = j.includes("@keyframes");
218
218
  if (c[u] === ";")
219
219
  l.push({
220
220
  type: "simple-at-rule",
@@ -225,12 +225,12 @@ function ft(r, e) {
225
225
  let P = 1;
226
226
  for (u++; u < c.length && P > 0; )
227
227
  c[u] === "{" ? P++ : c[u] === "}" && P--, u++;
228
- const z = c.substring(m, u), j = c.substring(H, u - 1);
228
+ const G = c.substring(m, u), E = c.substring(H, u - 1);
229
229
  l.push({
230
- type: v ? "keyframes" : "at-rule",
231
- rule: E,
232
- content: z,
233
- inner: j
230
+ type: y ? "keyframes" : "at-rule",
231
+ rule: j,
232
+ content: G,
233
+ inner: E
234
234
  });
235
235
  }
236
236
  continue;
@@ -239,40 +239,40 @@ function ft(r, e) {
239
239
  for (; u < c.length && c[u] !== "{"; )
240
240
  u++;
241
241
  if (u >= c.length) break;
242
- const d = c.substring(h, u).trim();
243
- if (!d) {
242
+ const f = c.substring(h, u).trim();
243
+ if (!f) {
244
244
  u++;
245
245
  continue;
246
246
  }
247
- const f = u + 1;
248
- let g = 1;
249
- for (u++; u < c.length && g > 0; )
250
- c[u] === "{" ? g++ : c[u] === "}" && g--, u++;
251
- const y = c.substring(f, u - 1);
247
+ const d = u + 1;
248
+ let v = 1;
249
+ for (u++; u < c.length && v > 0; )
250
+ c[u] === "{" ? v++ : c[u] === "}" && v--, u++;
251
+ const g = c.substring(d, u - 1);
252
252
  l.push({
253
253
  type: "rule",
254
- selector: d,
255
- content: y.trim()
254
+ selector: f,
255
+ content: g.trim()
256
256
  });
257
257
  }
258
258
  return l;
259
259
  }, s = (c) => {
260
260
  const l = c.trim();
261
261
  return /^(from|to|\d+(\.\d+)?%)$/.test(l);
262
- }, n = (c) => c.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (l, u, h) => {
263
- const d = u.trim(), f = h.trim();
264
- return d ? `${d}[${e}] ${f}` : f;
265
- }), i = (c) => {
262
+ }, r = (c) => c.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (l, u, h) => {
263
+ const f = u.trim(), d = h.trim();
264
+ return f ? `${f}[${e}] ${d}` : d;
265
+ }), o = (c) => {
266
266
  const l = c.trim();
267
267
  if (!l || l.includes(`[${e}]`) || /^(:root|:host|html|body)(\s|$|:|\.|\#|\[)/.test(l) || s(l))
268
268
  return l;
269
269
  const u = l.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/);
270
270
  if (u) {
271
- const [, h, d = ""] = u, f = h.trim();
272
- return f ? `${f}[${e}]${d}` : l;
271
+ const [, h, f = ""] = u, d = h.trim();
272
+ return d ? `${d}[${e}]${f}` : l;
273
273
  }
274
274
  return `${l}[${e}]`;
275
- }, a = (c) => n(c).split(",").map((u) => i(u)).filter((u) => u.trim()).join(", "), o = (c) => c.map((l) => {
275
+ }, a = (c) => r(c).split(",").map((u) => o(u)).filter((u) => u.trim()).join(", "), i = (c) => c.map((l) => {
276
276
  switch (l.type) {
277
277
  case "simple-at-rule":
278
278
  return l.content;
@@ -280,8 +280,8 @@ function ft(r, e) {
280
280
  return l.content;
281
281
  case "at-rule":
282
282
  try {
283
- const h = t(l.inner), d = o(h);
284
- return `${l.rule} { ${d} }`;
283
+ const h = t(l.inner), f = i(h);
284
+ return `${l.rule} { ${f} }`;
285
285
  } catch {
286
286
  return l.content;
287
287
  }
@@ -295,11 +295,11 @@ function ft(r, e) {
295
295
  }
296
296
  }).filter((l) => l.trim()).join(" "), p = (c) => c.replace(/\s*{\s*/g, " { ").replace(/\s*}\s*/g, " } ").replace(/\s*;\s*/g, "; ").replace(/\s*,\s*/g, ", ").replace(/\s+/g, " ").replace(/^\s+|\s+$/g, "").replace(/\s*}\s*}/g, " } }").trim();
297
297
  try {
298
- const c = r.replace(/\/\*(?!\s*!)[\s\S]*?\*\//g, "").replace(/^\s+|\s+$/gm, "").replace(/\n\s*\n/g, `
299
- `), l = t(c), u = o(l);
298
+ const c = n.replace(/\/\*(?!\s*!)[\s\S]*?\*\//g, "").replace(/^\s+|\s+$/gm, "").replace(/\n\s*\n/g, `
299
+ `), l = t(c), u = i(l);
300
300
  return p(u);
301
301
  } catch (c) {
302
- return console.error("CSS scoping failed:", c), console.error("Input CSS:", r), r.replace(/\/\*[\s\S]*?\*\//g, "").replace(
302
+ return console.error("CSS scoping failed:", c), console.error("Input CSS:", n), n.replace(/\/\*[\s\S]*?\*\//g, "").replace(
303
303
  /(@keyframes\s+[^{]+\s*{[^{}]*(?:{[^}]*}[^{}]*)*})/g,
304
304
  (l) => l
305
305
  ).replace(/([^{}@]+)(?=\s*{)/g, (l) => {
@@ -308,109 +308,109 @@ function ft(r, e) {
308
308
  });
309
309
  }
310
310
  }
311
- function be(r) {
312
- return R(r) ? r : JSON.stringify(r);
311
+ function Pe(n) {
312
+ return b(n) ? n : JSON.stringify(n);
313
313
  }
314
- function Re(r, e, t, s = !1) {
315
- const n = r.CSSStyleSheet, i = s ? `data-v-${e}` : e, a = s ? ft(t, i) : t;
316
- if (n.prototype.replaceSync) {
317
- const o = new n();
318
- o.id = e, o.replaceSync(a);
319
- const p = r.document, c = p.adoptedStyleSheets, l = Array.from(c).filter(
314
+ function Ce(n, e, t, s = !1) {
315
+ const r = n.CSSStyleSheet, o = s ? `data-v-${e}` : e, a = s ? ht(t, o) : t;
316
+ if (r.prototype.replaceSync) {
317
+ const i = new r();
318
+ i.id = e, i.replaceSync(a);
319
+ const p = n.document, c = p.adoptedStyleSheets, l = Array.from(c).filter(
320
320
  (u) => u.id !== e
321
321
  );
322
- p.adoptedStyleSheets = [...l, o];
322
+ p.adoptedStyleSheets = [...l, i];
323
323
  } else {
324
- const o = r.document;
325
- let p = o.getElementById(e);
326
- p ? p.innerHTML = a : (p = o.createElement("style"), p.id = e, p.innerHTML = a, o.head.appendChild(p));
324
+ const i = n.document;
325
+ let p = i.getElementById(e);
326
+ p ? p.innerHTML = a : (p = i.createElement("style"), p.id = e, p.innerHTML = a, i.head.appendChild(p));
327
327
  }
328
328
  }
329
- async function dt(r, e) {
329
+ async function mt(n, e) {
330
330
  const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
331
- t && Re(window, r, t);
331
+ t && Ce(window, n, t);
332
332
  }
333
- function Pe(r, e = window) {
333
+ function Ae(n, e = window) {
334
334
  const t = e.document, s = e.document.head;
335
- for (const n of r)
336
- if (!t.getElementById(n)) {
335
+ for (const r of n)
336
+ if (!t.getElementById(r)) {
337
337
  const a = t.createElement("link");
338
- a.rel = "stylesheet", a.id = n, a.href = n, s.appendChild(a);
338
+ a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
339
339
  }
340
340
  }
341
- async function Ce(r, e, t = window) {
342
- const s = t.document, n = t.document.head;
343
- let i = t[e];
344
- return i ? i.default || i : new Promise((a, o) => {
345
- for (const p of r) {
341
+ async function Ie(n, e, t = window) {
342
+ const s = t.document, r = t.document.head;
343
+ let o = t[e];
344
+ return o ? o.default || o : new Promise((a, i) => {
345
+ for (const p of n) {
346
346
  const c = s.createElement("script");
347
347
  c.src = p, c.onload = () => {
348
- i = t[e], i ? a(i.default || i) : o(null);
348
+ o = t[e], o ? a(o.default || o) : i(null);
349
349
  }, c.onerror = (l) => {
350
- o(l);
351
- }, n.appendChild(c);
350
+ i(l);
351
+ }, r.appendChild(c);
352
352
  }
353
353
  });
354
354
  }
355
- function ht(r) {
356
- return L(r) || L(r?.install);
355
+ function gt(n) {
356
+ return L(n) || L(n?.install);
357
357
  }
358
- function mt(r) {
359
- return ot.includes(r);
358
+ function vt(n) {
359
+ return ct.includes(n);
360
360
  }
361
- function gt(r) {
362
- return it.includes(r);
361
+ function yt(n) {
362
+ return at.includes(n);
363
363
  }
364
- function O(r = window) {
364
+ function O(n = window) {
365
365
  const e = window?.Mock;
366
366
  if (e) return e;
367
- const t = r?.Mock;
367
+ const t = n?.Mock;
368
368
  if (t && window)
369
369
  return window.Mock = t, t;
370
370
  }
371
- function ds(r, e, t) {
371
+ function ms(n, e, t) {
372
372
  Object.assign(e.meta, t.meta);
373
- const s = r?._container;
373
+ const s = n?._container;
374
374
  t?.type === "page" && s.classList.add("is-page"), t?.pure && s.classList.add("is-pure");
375
375
  }
376
- function T(r, e, t = !1, s = !1) {
376
+ function D(n, e, t = !1, s = !1) {
377
377
  try {
378
- const n = ['"use strict";', "var __self = arguments[0];"];
379
- n.push("return ");
380
- let i = (r.value || "").trim();
381
- i = i.replace(/this(\W|$)/g, (o, p) => `__self${p}`), i = n.join(`
382
- `) + i;
383
- const a = `with(${t ? "{}" : "$scope || {}"}) { ${i} }`;
378
+ const r = ['"use strict";', "var __self = arguments[0];"];
379
+ r.push("return ");
380
+ let o = (n.value || "").trim();
381
+ o = o.replace(/this(\W|$)/g, (i, p) => `__self${p}`), o = r.join(`
382
+ `) + o;
383
+ const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
384
384
  return new Function("$scope", a)(e);
385
- } catch (n) {
386
- if (I.error("parseExpression.error", n, r, e?.__self ?? e), s)
387
- throw n;
385
+ } catch (r) {
386
+ if (I.error("parseExpression.error", r, n, e?.__self ?? e), s)
387
+ throw r;
388
388
  }
389
389
  }
390
- function ee(r, e, t = !1, s = !1) {
391
- const n = T(r, e, t, s);
392
- if (typeof n != "function" && (I.error(
390
+ function ne(n, e, t = !1, s = !1) {
391
+ const r = D(n, e, t, s);
392
+ if (typeof r != "function" && (I.error(
393
393
  "parseFunction.error",
394
394
  "not a function",
395
- r,
395
+ n,
396
396
  e?.__self ?? e
397
397
  ), s))
398
- throw new Error(`"${r.value}" not a function`);
399
- return n;
398
+ throw new Error(`"${n.value}" not a function`);
399
+ return r;
400
400
  }
401
- function $(r) {
402
- return r && r.type === "JSExpression";
401
+ function $(n) {
402
+ return n && n.type === "JSExpression";
403
403
  }
404
- function D(r) {
405
- return typeof r == "object" && r && r.type === "JSFunction";
404
+ function T(n) {
405
+ return typeof n == "object" && n && n.type === "JSFunction";
406
406
  }
407
- function vt(r) {
408
- return $(r) || D(r);
407
+ function _t(n) {
408
+ return $(n) || T(n);
409
409
  }
410
- function hs(r) {
411
- return vt(r) ? r.value : JSON.stringify(r);
410
+ function gs(n) {
411
+ return _t(n) ? n.value : JSON.stringify(n);
412
412
  }
413
- const yt = {
413
+ const wt = {
414
414
  session: !1,
415
415
  authKey: "Authorization",
416
416
  storageKey: "ACCESS_STORAGE",
@@ -423,14 +423,14 @@ const yt = {
423
423
  noPermissionMessage: "无权限访问该页面",
424
424
  appName: "",
425
425
  statusKey: "code"
426
- }, Ae = Symbol("access");
427
- class Ie {
426
+ }, Fe = Symbol("access");
427
+ class ke {
428
428
  options;
429
429
  data = null;
430
430
  mode = w.Raw;
431
431
  interceptResponse = !0;
432
432
  constructor(e) {
433
- this.options = Object.assign({}, yt, e), this.loadData();
433
+ this.options = Object.assign({}, wt, e), this.loadData();
434
434
  }
435
435
  enableIntercept() {
436
436
  this.interceptResponse = !0;
@@ -439,22 +439,22 @@ class Ie {
439
439
  this.interceptResponse = !1;
440
440
  }
441
441
  connect(e) {
442
- const { mode: t, router: s, request: n } = e;
443
- this.mode = t, s && this.mode === w.Raw && this.setGuard(s), n && this.setRequest(n);
442
+ const { mode: t, router: s, request: r } = e;
443
+ this.mode = t, s && this.mode === w.Raw && this.setGuard(s), r && this.setRequest(r);
444
444
  }
445
445
  login(e) {
446
- const { storageKey: t, storagePrefix: s, session: n, authKey: i } = this.options;
447
- this.setData(e), this.data && (V.save(t, e, {
446
+ const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
447
+ this.setData(e), this.data && (W.save(t, e, {
448
448
  type: "local",
449
449
  prefix: s
450
- }), n && W.set(i, this.data.token));
450
+ }), r && Q.set(o, this.data.token));
451
451
  }
452
452
  clear() {
453
- const { storageKey: e, storagePrefix: t, session: s, authKey: n } = this.options;
454
- this.data = null, V.remove(e, {
453
+ const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
454
+ this.data = null, W.remove(e, {
455
455
  type: "local",
456
456
  prefix: t
457
- }), s && W.remove(n);
457
+ }), s && Q.remove(r);
458
458
  }
459
459
  logout() {
460
460
  this.clear(), this.toLogin();
@@ -467,22 +467,22 @@ class Ie {
467
467
  }
468
468
  can(e) {
469
469
  const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
470
- return typeof e == "function" ? e(s) : fe(e).every((i) => s[i] || s[t + "." + i]);
470
+ return typeof e == "function" ? e(s) : me(e).every((o) => s[o] || s[t + "." + o]);
471
471
  }
472
472
  some(e) {
473
473
  const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
474
- return fe(e).some((i) => s[i] || s[t + "." + i]);
474
+ return me(e).some((o) => s[o] || s[t + "." + o]);
475
475
  }
476
476
  install(e) {
477
- e.config.globalProperties.$access = this, e.provide(Ae, this);
477
+ e.config.globalProperties.$access = this, e.provide(Fe, this);
478
478
  }
479
479
  isAuthPath(e) {
480
480
  const { auth: t, isAuth: s } = this.options;
481
481
  if (s)
482
482
  return s(e);
483
483
  if (e.path && typeof t == "string") {
484
- const n = t.split("#")[1] || t;
485
- return e.path === n;
484
+ const r = t.split("#")[1] || t;
485
+ return e.path === r;
486
486
  }
487
487
  return !1;
488
488
  }
@@ -495,17 +495,17 @@ class Ie {
495
495
  setData(e) {
496
496
  const { privateKey: t } = this.options;
497
497
  if (Array.isArray(e) && t) {
498
- const s = e.map((n) => de(n, t));
498
+ const s = e.map((r) => ge(r, t));
499
499
  try {
500
500
  this.data = JSON.parse(s.join(""));
501
- } catch (n) {
502
- console.warn(n);
501
+ } catch (r) {
502
+ console.warn(r);
503
503
  }
504
504
  return;
505
505
  }
506
506
  if (typeof e == "string")
507
507
  try {
508
- const s = t ? de(e, t) : e;
508
+ const s = t ? ge(e, t) : e;
509
509
  s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
510
510
  } catch (s) {
511
511
  console.warn(s);
@@ -514,7 +514,7 @@ class Ie {
514
514
  this.data = e;
515
515
  }
516
516
  loadData() {
517
- const { storageKey: e, storagePrefix: t } = this.options, s = V.get(e, {
517
+ const { storageKey: e, storagePrefix: t } = this.options, s = W.get(e, {
518
518
  type: "local",
519
519
  prefix: t
520
520
  });
@@ -522,7 +522,7 @@ class Ie {
522
522
  }
523
523
  isLogined() {
524
524
  const { session: e, authKey: t } = this.options;
525
- return e && t ? !!W.get(t) : !!this.getToken();
525
+ return e && t ? !!Q.get(t) : !!this.getToken();
526
526
  }
527
527
  hasRoutePermission(e) {
528
528
  if (e.name === M) {
@@ -532,7 +532,7 @@ class Ie {
532
532
  return !0;
533
533
  }
534
534
  setGuard(e) {
535
- e.beforeEach((t, s, n) => this.guard(t, n));
535
+ e.beforeEach((t, s, r) => this.guard(t, r));
536
536
  }
537
537
  async guard(e, t) {
538
538
  if (this.isWhiteList(e) || this.isAuthPath(e))
@@ -541,8 +541,8 @@ class Ie {
541
541
  if (this.hasRoutePermission(e))
542
542
  return t();
543
543
  {
544
- const { noPermissionMessage: s = "无权限访问", unauthorized: n = !1 } = this.options;
545
- return await this.showTip(s), L(n) ? (n(), t(!1)) : R(n) ? t(n) : t(!1);
544
+ const { noPermissionMessage: s = "无权限访问", unauthorized: r = !1 } = this.options;
545
+ return await this.showTip(s), L(r) ? (r(), t(!1)) : b(r) ? t(r) : t(!1);
546
546
  }
547
547
  }
548
548
  t(!1), this.toLogin();
@@ -561,7 +561,7 @@ class Ie {
561
561
  }
562
562
  async showTip(e) {
563
563
  const { alert: t } = this.options;
564
- return t ? (await ne(150), await t(e, {
564
+ return t ? (await ce(150), await t(e, {
565
565
  title: "提示",
566
566
  type: "warning"
567
567
  })?.catch(() => !1)) : !1;
@@ -577,22 +577,22 @@ class Ie {
577
577
  );
578
578
  }
579
579
  }
580
- function _t() {
581
- return $e(Ae, null);
580
+ function St() {
581
+ return Ee(Fe, null);
582
582
  }
583
- function ms(r = {}) {
583
+ function vs(n = {}) {
584
584
  const {
585
585
  notify: e,
586
586
  loading: t,
587
587
  settings: s = {},
588
- Startup: n,
589
- access: i,
588
+ Startup: r,
589
+ access: o,
590
590
  useTitle: a,
591
- alert: o
592
- } = r;
591
+ alert: i
592
+ } = n;
593
593
  let p = null;
594
594
  return {
595
- request: we({
595
+ request: $e({
596
596
  settings: {
597
597
  type: "form",
598
598
  validSuccess: !0,
@@ -612,89 +612,89 @@ function ms(r = {}) {
612
612
  ...s
613
613
  }
614
614
  }),
615
- jsonp: Se,
615
+ jsonp: je,
616
616
  notify: e,
617
617
  loading: t,
618
618
  useTitle: a,
619
- startupComponent: n,
620
- access: i ? new Ie({ alert: o, ...i }) : void 0
619
+ startupComponent: r,
620
+ access: o ? new ke({ alert: i, ...o }) : void 0
621
621
  };
622
622
  }
623
- function gs(r = {}) {
624
- return new Ie(r);
623
+ function ys(n = {}) {
624
+ return new ke(n);
625
625
  }
626
- function wt(r, e) {
626
+ function $t(n, e) {
627
627
  const { jsonp: t, request: s } = e;
628
- if (r.method === "jsonp")
629
- return (n = {}) => t(r.url, {
630
- ...r.jsonpOptions,
631
- query: n
628
+ if (n.method === "jsonp")
629
+ return (r = {}) => t(n.url, {
630
+ ...n.jsonpOptions,
631
+ query: r
632
632
  });
633
633
  {
634
- const n = r.headers ? T(r.headers, {}, !0) : void 0, i = {
635
- url: r.url,
636
- method: r.method,
634
+ const r = n.headers ? D(n.headers, {}, !0) : void 0, o = {
635
+ url: n.url,
636
+ method: n.method,
637
637
  settings: {
638
- ...r.settings,
639
- headers: n
638
+ ...n.settings,
639
+ headers: r
640
640
  }
641
641
  };
642
- return (a, o) => (delete i.data, s.send(Ge(i, o || {}, { data: a })));
642
+ return (a, i) => (delete o.data, s.send(We(o, i || {}, { data: a })));
643
643
  }
644
644
  }
645
- function St(r, e) {
645
+ function jt(n, e) {
646
646
  const { metaQuery: t } = e;
647
647
  if (!t) return;
648
- const { code: s, queryCode: n } = r;
649
- return (i, a) => {
648
+ const { code: s, queryCode: r } = n;
649
+ return (o, a) => {
650
650
  if (!t) {
651
651
  console.warn("adapter.metaQuery is not defined!");
652
652
  return;
653
653
  }
654
- return t(s, n, i, a);
654
+ return t(s, r, o, a);
655
655
  };
656
656
  }
657
- function $t(r = [], e = [], t) {
657
+ function Et(n = [], e = [], t) {
658
658
  const s = {};
659
- for (const n of r)
660
- s[n.id] = wt(n, t);
661
- for (const n of e)
662
- s[n.id] = St(n, t);
659
+ for (const r of n)
660
+ s[r.id] = $t(r, t);
661
+ for (const r of e)
662
+ s[r.id] = jt(r, t);
663
663
  return s;
664
664
  }
665
- async function Et(r = [], e = window) {
665
+ async function Rt(n = [], e = window) {
666
666
  const t = O(e);
667
- t && (Fe(e), r.forEach((s) => bt(t, s)));
667
+ t && (Me(e), n.forEach((s) => Pt(t, s)));
668
668
  }
669
- function jt(r, e = window) {
670
- const t = D(r.mockTemplate) && r.mockTemplate.value ? ee(r.mockTemplate, {}, !0) : void 0, s = O(e);
671
- return async (...n) => {
672
- let i = {};
669
+ function bt(n, e = window) {
670
+ const t = T(n.mockTemplate) && n.mockTemplate.value ? ne(n.mockTemplate, {}, !0) : void 0, s = O(e);
671
+ return async (...r) => {
672
+ let o = {};
673
673
  if (t)
674
674
  try {
675
- i = await t.apply(t, n);
675
+ o = await t.apply(t, r);
676
676
  } catch (a) {
677
677
  I.warn("模拟数据模版异常", a);
678
678
  }
679
- return s?.mock(i);
679
+ return s?.mock(o);
680
680
  };
681
681
  }
682
- function bt(r, e) {
682
+ function Pt(n, e) {
683
683
  if (!e.mock) return;
684
684
  const { url: t, mockTemplate: s } = e;
685
685
  if (t && s) {
686
- const n = Ve(`${t}(.*)`), i = We(t, { decode: decodeURIComponent }), a = T(s, {}, !0);
687
- r.mock(n, (o) => {
688
- const p = A.parse(o.url) || {}, c = o.body instanceof FormData ? Qe(o.body) : o.body, l = i(o.url)?.params;
689
- return Object.assign(o, { data: c, params: p, query: l }), r.mock(a(o));
686
+ const r = Qe(`${t}(.*)`), o = Xe(t, { decode: decodeURIComponent }), a = D(s, {}, !0);
687
+ n.mock(r, (i) => {
688
+ const p = A.parse(i.url) || {}, c = i.body instanceof FormData ? Ye(i.body) : i.body, l = o(i.url)?.params;
689
+ return Object.assign(i, { data: c, params: p, query: l }), n.mock(a(i));
690
690
  });
691
691
  }
692
692
  }
693
- function Fe(r = window) {
694
- const e = O(r);
693
+ function Me(n = window) {
694
+ const e = O(n);
695
695
  e && (e._mocked = {});
696
696
  }
697
- class Rt {
697
+ class Ct {
698
698
  __id = null;
699
699
  __mode;
700
700
  __instance = null;
@@ -720,15 +720,15 @@ class Rt {
720
720
  $apis = {};
721
721
  __transform = {};
722
722
  constructor(e) {
723
- const { mode: t, dsl: s, attrs: n } = e;
724
- this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), n && Object.assign(this, n);
723
+ const { mode: t, dsl: s, attrs: r } = e;
724
+ this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), r && Object.assign(this, r);
725
725
  }
726
- setup(e, t = J) {
726
+ setup(e, t = q) {
727
727
  const s = t.getCurrentInstance();
728
728
  if (!s) return;
729
729
  this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = s.proxy;
730
- const n = s.appContext.config.globalProperties;
731
- Object.assign(this, n), Object.assign(this, e || {}), this.__proxy(), t.onMounted(() => {
730
+ const r = s.appContext.config.globalProperties;
731
+ Object.assign(this, r), Object.assign(this, e || {}), this.__proxy(), t.onMounted(() => {
732
732
  this.__proxy();
733
733
  }), t.onUnmounted(() => {
734
734
  this.__cleanup();
@@ -737,12 +737,12 @@ class Rt {
737
737
  });
738
738
  }
739
739
  __proxy() {
740
- this.__instance && ve.forEach((e) => {
740
+ this.__instance && we.forEach((e) => {
741
741
  this[e] = this.__instance?.[e];
742
742
  });
743
743
  }
744
744
  __cleanup() {
745
- ve.forEach((e) => {
745
+ we.forEach((e) => {
746
746
  this[e] = null;
747
747
  }), this.__reset();
748
748
  }
@@ -752,36 +752,36 @@ class Rt {
752
752
  __parseFunction(e) {
753
753
  if (e)
754
754
  if (this.__mode === w.Runtime) {
755
- const { id: t, type: s } = e, n = t ? this.__transform[t] ?? e.value : e.value;
756
- return ee({ type: s, value: n }, this);
755
+ const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
756
+ return ne({ type: s, value: r }, this);
757
757
  } else
758
- return ee(e, this);
758
+ return ne(e, this);
759
759
  }
760
760
  __parseExpression(e) {
761
761
  if (e)
762
762
  if (this.__mode === w.Runtime) {
763
- const { id: t, type: s } = e, n = t ? this.__transform[t] ?? e.value : e.value;
764
- return T({ type: s, value: n }, this);
763
+ const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
764
+ return D({ type: s, value: r }, this);
765
765
  } else
766
- return T(e, this);
766
+ return D(e, this);
767
767
  }
768
768
  __ref(e = null, t) {
769
769
  if (this.__mode !== w.VNode)
770
770
  return e && e !== this.__id && (this.__contextRefs[e] = this), async (s) => {
771
- await ne(0);
772
- let n = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
773
- if (!n) {
771
+ await ce(0);
772
+ let r = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
773
+ if (!r) {
774
774
  typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
775
775
  return;
776
776
  }
777
- return n.nodeType === 3 && n.nextSibling && (n = n.nextSibling), n.__vtj__ = e, w.Design === this.__mode && (n.__context__ = this, n.draggable = !0), e && (this.__refs[e] = this.__getRefEl(this.__refs, e, s)), typeof t == "function" ? t(s) : t && (this.$refs[t] = this.__getRefEl(this.$refs, t, s)), s;
777
+ return r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, w.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = this.__getRefEl(this.__refs, e, s)), typeof t == "function" ? t(s) : t && (this.$refs[t] = this.__getRefEl(this.$refs, t, s)), s;
778
778
  };
779
779
  }
780
780
  __getRefEl(e, t, s) {
781
- const n = e[t];
782
- if (n && s !== n) {
783
- const i = new Set([].concat(n, s));
784
- return Array.from(i);
781
+ const r = e[t];
782
+ if (r && s !== r) {
783
+ const o = new Set([].concat(r, s));
784
+ return Array.from(o);
785
785
  } else
786
786
  return s;
787
787
  }
@@ -793,73 +793,73 @@ class Rt {
793
793
  return s.context.__proto__ = this.context, s.__proto__ = this, s;
794
794
  }
795
795
  }
796
- function te(r) {
796
+ function re(n) {
797
797
  const {
798
- Vue: e = J,
798
+ Vue: e = q,
799
799
  mode: t = w.Runtime,
800
800
  components: s = {},
801
- libs: n = {},
802
- apis: i = {},
801
+ libs: r = {},
802
+ apis: o = {},
803
803
  loader: a
804
- } = r, o = e.computed(() => r.dsl), p = {
804
+ } = n, i = e.computed(() => n.dsl), p = {
805
805
  $components: s,
806
- $libs: n,
807
- $apis: i
808
- }, c = new Rt({
806
+ $libs: r,
807
+ $apis: o
808
+ }, c = new Ct({
809
809
  mode: t,
810
- dsl: o.value,
810
+ dsl: i.value,
811
811
  attrs: p
812
812
  }), l = e.defineComponent({
813
- name: o.value.name,
814
- __scopeId: o.value.id ? `data-v-${o.value.id}` : void 0,
813
+ name: i.value.name,
814
+ __scopeId: i.value.id ? `data-v-${i.value.id}` : void 0,
815
815
  props: {
816
- ...Ct(o.value.props ?? [], c)
816
+ ...It(i.value.props ?? [], c)
817
817
  },
818
818
  setup(u) {
819
- c.$props = u, c.props = u, o.value.id && Re(
820
- r.window || window,
821
- o.value.id,
822
- o.value.css || "",
819
+ c.$props = u, c.props = u, i.value.id && Ce(
820
+ n.window || window,
821
+ i.value.id,
822
+ i.value.css || "",
823
823
  !0
824
- ), c.state = At(e, o.value.state ?? {}, c);
825
- const h = It(e, o.value.computed ?? {}, c), d = Ft(o.value.methods ?? {}, c), f = kt(e, o.value.inject, c);
826
- for (const [m, E] of Object.entries(f || {}))
827
- f[m] = e.inject(m, E);
828
- const g = Mt(
829
- o.value.dataSources || {},
824
+ ), c.state = Ft(e, i.value.state ?? {}, c);
825
+ const h = kt(e, i.value.computed ?? {}, c), f = Mt(i.value.methods ?? {}, c), d = Ot(e, i.value.inject, c);
826
+ for (const [m, j] of Object.entries(d || {}))
827
+ d[m] = e.inject(m, j);
828
+ const v = Dt(
829
+ i.value.dataSources || {},
830
830
  c
831
- ), y = {
832
- ...f,
833
- ...h,
831
+ ), g = {
834
832
  ...d,
835
- ...g
833
+ ...h,
834
+ ...f,
835
+ ...v
836
836
  };
837
- return c.setup(y, e), Ot(e, o.value.watch ?? [], c), {
837
+ return c.setup(g, e), Tt(e, i.value.watch ?? [], c), {
838
838
  vtj: c
839
839
  };
840
840
  },
841
- emits: Pt(o.value.emits),
841
+ emits: At(i.value.emits),
842
842
  expose: ["vtj"],
843
843
  render() {
844
- if (!o.value.nodes) return null;
845
- const u = o.value.nodes || [];
844
+ if (!i.value.nodes) return null;
845
+ const u = i.value.nodes || [];
846
846
  return u.length === 1 ? F(u[0], c, e, a, u) : u.map(
847
847
  (h) => F(h, c, e, a, u)
848
848
  );
849
849
  },
850
- ...Tt(o.value.lifeCycles ?? {}, c)
850
+ ...Ht(i.value.lifeCycles ?? {}, c)
851
851
  });
852
852
  return {
853
853
  renderer: e.markRaw(l),
854
854
  context: c
855
855
  };
856
856
  }
857
- function Pt(r = []) {
858
- return r.map((e) => R(e) ? e : e.name);
857
+ function At(n = []) {
858
+ return n.map((e) => b(e) ? e : e.name);
859
859
  }
860
- function Ct(r = [], e) {
861
- const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((i) => nt[i]) : void 0;
862
- return r.map((s) => R(s) ? {
860
+ function It(n = [], e) {
861
+ const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => it[o]) : void 0;
862
+ return n.map((s) => b(s) ? {
863
863
  name: s
864
864
  } : {
865
865
  name: s.name,
@@ -867,58 +867,58 @@ function Ct(r = [], e) {
867
867
  required: s.required,
868
868
  default: $(s.default) ? e.__parseExpression(s.default) : s.default
869
869
  }).reduce(
870
- (s, n) => (s[n.name] = {
871
- type: t(n.type),
872
- required: n.required,
873
- default: n.default
870
+ (s, r) => (s[r.name] = {
871
+ type: t(r.type),
872
+ required: r.required,
873
+ default: r.default
874
874
  }, s),
875
875
  {}
876
876
  );
877
877
  }
878
- function At(r, e, t) {
879
- return r.reactive(
878
+ function Ft(n, e, t) {
879
+ return n.reactive(
880
880
  Object.keys(e || {}).reduce(
881
- (s, n) => {
882
- let i = e[n];
883
- return $(i) ? i = t.__parseExpression(i) : D(i) && (i = t.__parseFunction(i)), s[n] = i, s;
881
+ (s, r) => {
882
+ let o = e[r];
883
+ return $(o) ? o = t.__parseExpression(o) : T(o) && (o = t.__parseFunction(o)), s[r] = o, s;
884
884
  },
885
885
  {}
886
886
  )
887
887
  );
888
888
  }
889
- function It(r, e, t) {
889
+ function kt(n, e, t) {
890
890
  return Object.entries(e ?? {}).reduce(
891
- (s, [n, i]) => (s[n] = r.computed(t.__parseFunction(i)), s),
891
+ (s, [r, o]) => (s[r] = n.computed(t.__parseFunction(o)), s),
892
892
  {}
893
893
  );
894
894
  }
895
- function Ft(r, e) {
896
- return Object.entries(r ?? {}).reduce(
897
- (t, [s, n]) => (t[s] = e.__parseFunction(n), t),
895
+ function Mt(n, e) {
896
+ return Object.entries(n ?? {}).reduce(
897
+ (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
898
898
  {}
899
899
  );
900
900
  }
901
- function kt(r, e = [], t) {
901
+ function Ot(n, e = [], t) {
902
902
  return e.reduce(
903
- (s, n) => {
904
- const { name: i, from: a } = n || {};
905
- n.default;
906
- const o = $(a) ? t.__parseExpression(a) || i : a ?? i, p = $(n.default) ? t.__parseExpression(n.default) : n.default ?? null;
907
- return s[i] = r.inject(o, p), s;
903
+ (s, r) => {
904
+ const { name: o, from: a } = r || {};
905
+ r.default;
906
+ const i = $(a) ? t.__parseExpression(a) || o : a ?? o, p = $(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
907
+ return s[o] = n.inject(i, p), s;
908
908
  },
909
909
  {}
910
910
  );
911
911
  }
912
- function Mt(r, e) {
913
- return Object.keys(r).reduce(
912
+ function Dt(n, e) {
913
+ return Object.keys(n).reduce(
914
914
  (t, s) => {
915
- const n = r[s];
916
- if (n.type === "mock")
917
- t[s] = jt(n);
918
- else if (n.ref) {
919
- const i = e.$apis[n.ref], a = D(n.transform) ? n.transform.value ? e.__parseFunction(n.transform) : void 0 : n.transform;
920
- t[s] = async (...o) => {
921
- const p = await i.apply(e, o);
915
+ const r = n[s];
916
+ if (r.type === "mock")
917
+ t[s] = bt(r);
918
+ else if (r.ref) {
919
+ const o = e.$apis[r.ref], a = T(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
920
+ t[s] = async (...i) => {
921
+ const p = await o.apply(e, i);
922
922
  return a ? a(p) : p;
923
923
  };
924
924
  }
@@ -927,9 +927,9 @@ function Mt(r, e) {
927
927
  {}
928
928
  );
929
929
  }
930
- function Ot(r, e = [], t) {
930
+ function Tt(n, e = [], t) {
931
931
  e.forEach((s) => {
932
- r.watch(
932
+ n.watch(
933
933
  t.__parseExpression(s.source),
934
934
  t.__parseFunction(s.handler),
935
935
  {
@@ -939,270 +939,270 @@ function Ot(r, e = [], t) {
939
939
  );
940
940
  });
941
941
  }
942
- function Tt(r, e) {
943
- return Object.entries(r ?? {}).reduce(
944
- (t, [s, n]) => {
945
- const i = e.__parseFunction(n);
942
+ function Ht(n, e) {
943
+ return Object.entries(n ?? {}).reduce(
944
+ (t, [s, r]) => {
945
+ const o = e.__parseFunction(r);
946
946
  return t[s] = async () => {
947
- await ne(0), L(i) && i();
947
+ await ce(0), L(o) && o();
948
948
  }, t;
949
949
  },
950
950
  {}
951
951
  );
952
952
  }
953
- const ke = new Xe();
954
- let Q = [], C = {};
955
- const Dt = (r) => r;
956
- async function Me(r, e = window) {
957
- const { urls: t = [], library: s } = r, n = t.filter((o) => K(o));
958
- if (n.length === 0 || !s) return null;
959
- const i = t.filter((o) => q(o));
960
- return i.length && Pe(i, e), await Ce(n, s, e).catch(
961
- (o) => (console.warn("loadScriptUrl error", n, s, o), null)
953
+ const Oe = new Ze();
954
+ let X = [], C = {};
955
+ const xt = (n) => n;
956
+ async function De(n, e = window) {
957
+ const { urls: t = [], library: s } = n, r = t.filter((i) => z(i));
958
+ if (r.length === 0 || !s) return null;
959
+ const o = t.filter((i) => K(i));
960
+ return o.length && Ae(o, e), await Ie(r, s, e).catch(
961
+ (i) => (console.warn("loadScriptUrl error", r, s, i), null)
962
962
  );
963
963
  }
964
- function se(r) {
965
- const { getDsl: e, getDslByUrl: t, options: s } = r;
966
- return s.window && (Q.forEach((n) => {
967
- delete s.window[n];
968
- }), Q = []), (n, i, a = J) => {
969
- if (!i || typeof i == "string") return n;
970
- if (i.type === "Schema" && i.id)
964
+ function oe(n) {
965
+ const { getDsl: e, getDslByUrl: t, options: s } = n;
966
+ return s.window && (X.forEach((r) => {
967
+ delete s.window[r];
968
+ }), X = []), (r, o, a = q) => {
969
+ if (!o || typeof o == "string") return r;
970
+ if (o.type === "Schema" && o.id)
971
971
  return a.defineAsyncComponent(async () => {
972
- const o = C[i.id] || await ke.add(
973
- i.id,
974
- () => e(i.id)
972
+ const i = C[o.id] || await Oe.add(
973
+ o.id,
974
+ () => e(o.id)
975
975
  );
976
- return o && (o.name = n, C[i.id] = o), o ? te({
976
+ return i && (i.name = r, C[o.id] = i), i ? re({
977
977
  ...s,
978
978
  Vue: a,
979
- dsl: he(o),
979
+ dsl: ve(i),
980
980
  mode: w.Runtime,
981
- loader: se(r)
981
+ loader: oe(n)
982
982
  }).renderer : null;
983
983
  });
984
- if (i.type === "UrlSchema" && i.url)
984
+ if (o.type === "UrlSchema" && o.url)
985
985
  return a.defineAsyncComponent(async () => {
986
- const o = C[i.url] || await t(i.url);
987
- return o && (o.name = n, C[i.url] = o), o ? te({
986
+ const i = C[o.url] || await t(o.url);
987
+ return i && (i.name = r, C[o.url] = i), i ? re({
988
988
  ...s,
989
989
  Vue: a,
990
- dsl: he(o),
990
+ dsl: ve(i),
991
991
  mode: w.Runtime,
992
- loader: se(r)
992
+ loader: oe(n)
993
993
  }).renderer : null;
994
994
  });
995
- if (i.type === "Plugin") {
996
- let o = i.library ? C[i.library] : null;
997
- return o || (i.library && Q.push(i.library), o = C[i.library || Symbol()] = a.defineAsyncComponent(
995
+ if (o.type === "Plugin") {
996
+ let i = o.library ? C[o.library] : null;
997
+ return i || (o.library && X.push(o.library), i = C[o.library || Symbol()] = a.defineAsyncComponent(
998
998
  async () => {
999
- const p = await Me(i, s.window);
1000
- return p || (console.warn("getPlugin result is null", i), null);
999
+ const p = await De(o, s.window);
1000
+ return p || (console.warn("getPlugin result is null", o), null);
1001
1001
  }
1002
- ), o);
1002
+ ), i);
1003
1003
  }
1004
- return n;
1004
+ return r;
1005
1005
  };
1006
1006
  }
1007
- function vs() {
1008
- C = {}, ke.clearAllCache();
1007
+ function _s() {
1008
+ C = {}, Oe.clearAllCache();
1009
1009
  }
1010
- function F(r, e, t = J, s = Dt, n = [], i = !1) {
1011
- if (!r || !r.name || r.invisible) return null;
1012
- const a = t.getCurrentInstance()?.appContext, { id: o = null, directives: p = [] } = r, { vIf: c, vElseIf: l, vElse: u, vFor: h, vShow: d, vModels: f, vBind: g, vHtml: y, others: m } = Oe(p);
1013
- if (!i && (l || u))
1010
+ function F(n, e, t = q, s = xt, r = [], o = !1) {
1011
+ if (!n || !n.name || n.invisible) return null;
1012
+ const a = t.getCurrentInstance()?.appContext, { id: i = null, directives: p = [] } = n, { vIf: c, vElseIf: l, vElse: u, vFor: h, vShow: f, vModels: d, vBind: v, vHtml: g, others: m } = Te(p);
1013
+ if (!o && (l || u))
1014
1014
  return null;
1015
- if (c && !xt(c, e))
1016
- return Lt(r, e, t, s, n);
1017
- const E = (v, H = 0) => {
1018
- const P = v.$components, z = (() => {
1019
- if (r.name === "component")
1020
- return Bt(v, r.props?.is);
1021
- if (r.name === "slot") return r.name;
1022
- const S = s(r.name, r.from, t);
1023
- if (R(S))
1024
- return mt(S) || gt(S) ? S : P[S] ?? a?.app?.component(S) ?? S;
1025
- if (Ye(S) && r.id) {
1026
- const ue = `Loader${r.id}_${H}`, pe = P[ue];
1027
- return pe || (P[ue] = S);
1015
+ if (c && !Nt(c, e))
1016
+ return qt(n, e, t, s, r);
1017
+ const j = (y, H = 0) => {
1018
+ const P = y.$components, G = (() => {
1019
+ if (n.name === "component")
1020
+ return Ut(y, n.props?.is);
1021
+ if (n.name === "slot") return n.name;
1022
+ const S = s(n.name, n.from, t);
1023
+ if (b(S))
1024
+ return vt(S) || yt(S) ? S : P[S] ?? a?.app?.component(S) ?? S;
1025
+ if (et(S) && n.id) {
1026
+ const de = `Loader${n.id}_${H}`, he = P[de];
1027
+ return he || (P[de] = S);
1028
1028
  }
1029
1029
  return S;
1030
- })(), j = Nt(o, r.props ?? {}, v), Ne = Ut(t, r.events ?? {}, v);
1031
- if (r.name === "slot")
1032
- return Jt(t, r, j, v, s);
1033
- g && Object.assign(j, v.__parseExpression(g.value)), d && (j.style = Object.assign(
1034
- j.style ?? {},
1035
- Kt(d, v)
1036
- )), y && Object.assign(j, zt(y, v)), f.forEach((S) => {
1037
- Object.assign(j, Gt(t, S, v));
1030
+ })(), E = Lt(i, n.props ?? {}, y), Le = Jt(t, n.events ?? {}, y);
1031
+ if (n.name === "slot")
1032
+ return Kt(t, n, E, y, s);
1033
+ v && Object.assign(E, y.__parseExpression(v.value)), f && (E.style = Object.assign(
1034
+ E.style ?? {},
1035
+ Gt(f, y)
1036
+ )), g && Object.assign(E, Vt(g, y)), d.forEach((S) => {
1037
+ Object.assign(E, Wt(t, S, y));
1038
1038
  });
1039
- const Ue = Vt(
1039
+ const Je = Qt(
1040
1040
  t,
1041
- r.children ?? [],
1042
- v,
1041
+ n.children ?? [],
1042
+ y,
1043
1043
  s,
1044
- r
1045
- ), ce = v?.__id ? `data-v-${v.__id}` : void 0, Le = ce ? { [ce]: "" } : {};
1046
- let G = t.createVNode(
1047
- z,
1048
- { key: `${o}_${H}`, ...Le, ...j, ...Ne },
1049
- Ue
1044
+ n
1045
+ ), pe = y?.__id ? `data-v-${y.__id}` : void 0, qe = pe ? { [pe]: "" } : {};
1046
+ let V = t.createVNode(
1047
+ G,
1048
+ { key: `${i}_${H}`, ...qe, ...E, ...Le },
1049
+ Je
1050
1050
  );
1051
- const le = a ? Ht(a, m, v) : [];
1052
- return le.length && (G = t.withDirectives(G, le)), G;
1051
+ const fe = a ? Bt(a, m, y) : [];
1052
+ return fe.length && (V = t.withDirectives(V, fe)), V;
1053
1053
  };
1054
- return h ? Xt(h, E, e) : E(e);
1055
- }
1056
- function Ht(r, e, t) {
1057
- const s = r.app;
1058
- return e.map((n) => {
1059
- const i = typeof n.name == "string" ? s.directive(n.name) : t.__parseExpression(n.name);
1060
- if (!i) return null;
1061
- const a = [i];
1062
- return n.value && a.push(t.__parseExpression(n.value)), n.arg && a.push(n.arg), n.modifiers && a.push(n.modifiers), a;
1063
- }).filter((n) => !!n);
1064
- }
1065
- function Oe(r = []) {
1066
- const e = r.find((l) => b(l.name) === "vIf"), t = r.find(
1067
- (l) => b(l.name) === "vElseIf"
1068
- ), s = r.find((l) => b(l.name) === "vElse"), n = r.find((l) => b(l.name) === "vFor"), i = r.find((l) => b(l.name) === "vShow"), a = r.find((l) => b(l.name) === "vBind"), o = r.find((l) => b(l.name) === "vHtml"), p = r.filter(
1069
- (l) => b(l.name) === "vModel"
1070
- ), c = r.filter(
1071
- (l) => !rt.includes(b(l.name))
1054
+ return h ? Zt(h, j, e) : j(e);
1055
+ }
1056
+ function Bt(n, e, t) {
1057
+ const s = n.app;
1058
+ return e.map((r) => {
1059
+ const o = typeof r.name == "string" ? s.directive(r.name) : t.__parseExpression(r.name);
1060
+ if (!o) return null;
1061
+ const a = [o];
1062
+ return r.value && a.push(t.__parseExpression(r.value)), r.arg && a.push(r.arg), r.modifiers && a.push(r.modifiers), a;
1063
+ }).filter((r) => !!r);
1064
+ }
1065
+ function Te(n = []) {
1066
+ const e = n.find((l) => R(l.name) === "vIf"), t = n.find(
1067
+ (l) => R(l.name) === "vElseIf"
1068
+ ), s = n.find((l) => R(l.name) === "vElse"), r = n.find((l) => R(l.name) === "vFor"), o = n.find((l) => R(l.name) === "vShow"), a = n.find((l) => R(l.name) === "vBind"), i = n.find((l) => R(l.name) === "vHtml"), p = n.filter(
1069
+ (l) => R(l.name) === "vModel"
1070
+ ), c = n.filter(
1071
+ (l) => !ot.includes(R(l.name))
1072
1072
  );
1073
1073
  return {
1074
1074
  vIf: e,
1075
1075
  vElseIf: t,
1076
1076
  vElse: s,
1077
- vFor: n,
1078
- vShow: i,
1077
+ vFor: r,
1078
+ vShow: o,
1079
1079
  vModels: p,
1080
1080
  vBind: a,
1081
1081
  others: c,
1082
- vHtml: o
1082
+ vHtml: i
1083
1083
  };
1084
1084
  }
1085
- function xt(r, e) {
1086
- return !!e.__parseExpression(r.value);
1085
+ function Nt(n, e) {
1086
+ return !!e.__parseExpression(n.value);
1087
1087
  }
1088
- function Bt(r, e) {
1089
- return e ? $(e) ? r.__parseExpression(e) : e : "div";
1088
+ function Ut(n, e) {
1089
+ return e ? $(e) ? n.__parseExpression(e) : e : "div";
1090
1090
  }
1091
- function Nt(r, e, t) {
1092
- const s = re(e, t);
1093
- return s.ref = t.__ref(r, s.ref), s;
1091
+ function Lt(n, e, t) {
1092
+ const s = ie(e, t);
1093
+ return s.ref = t.__ref(n, s.ref), s;
1094
1094
  }
1095
- function re(r, e) {
1096
- return $(r) ? e.__parseExpression(r) : D(r) ? e.__parseFunction(r) : Array.isArray(r) ? r.map((t) => re(t, e)) : typeof r == "object" ? Object.keys(r || {}).reduce(
1095
+ function ie(n, e) {
1096
+ return $(n) ? e.__parseExpression(n) : T(n) ? e.__parseFunction(n) : Array.isArray(n) ? n.map((t) => ie(t, e)) : typeof n == "object" ? Object.keys(n || {}).reduce(
1097
1097
  (t, s) => {
1098
- let n = r[s];
1099
- return t[s] = re(n, e), t;
1098
+ let r = n[s];
1099
+ return t[s] = ie(r, e), t;
1100
1100
  },
1101
1101
  {}
1102
- ) : r;
1102
+ ) : n;
1103
1103
  }
1104
- function Ut(r, e, t) {
1105
- const s = ["passive", "capture", "once"], n = {
1104
+ function Jt(n, e, t) {
1105
+ const s = ["passive", "capture", "once"], r = {
1106
1106
  capture: "Capture",
1107
1107
  once: "Once",
1108
1108
  passive: "OnceCapture"
1109
1109
  };
1110
1110
  return Object.keys(e || {}).reduce(
1111
- (i, a) => {
1112
- const o = e[a], p = Te(o.modifiers), c = p.find((h) => s.includes(h)), l = "on" + Ze(a) + (c && n[c] || ""), u = t.__parseFunction(o.handler);
1113
- return u && (i[l] = r.withModifiers(u, p)), i;
1111
+ (o, a) => {
1112
+ const i = e[a], p = He(i.modifiers), c = p.find((h) => s.includes(h)), l = "on" + tt(a) + (c && r[c] || ""), u = t.__parseFunction(i.handler);
1113
+ return u && (o[l] = n.withModifiers(u, p)), o;
1114
1114
  },
1115
1115
  {}
1116
1116
  );
1117
1117
  }
1118
- function Lt(r, e, t, s, n = []) {
1119
- let i = n.findIndex((a) => a.id === r.id);
1120
- for (let a = ++i; a < n.length; a++) {
1121
- const { directives: o = [] } = n[a], { vElseIf: p, vElse: c } = Oe(o);
1118
+ function qt(n, e, t, s, r = []) {
1119
+ let o = r.findIndex((a) => a.id === n.id);
1120
+ for (let a = ++o; a < r.length; a++) {
1121
+ const { directives: i = [] } = r[a], { vElseIf: p, vElse: c } = Te(i);
1122
1122
  if (p) {
1123
1123
  if (e.__parseExpression(p.value))
1124
- return F(n[a], e, t, s, n, !0);
1124
+ return F(r[a], e, t, s, r, !0);
1125
1125
  continue;
1126
1126
  }
1127
1127
  if (c)
1128
- return F(n[a], e, t, s, n, !0);
1128
+ return F(r[a], e, t, s, r, !0);
1129
1129
  }
1130
1130
  return null;
1131
1131
  }
1132
- function Te(r = {}, e = !1) {
1133
- const t = Object.keys(r);
1132
+ function He(n = {}, e = !1) {
1133
+ const t = Object.keys(n);
1134
1134
  return e ? t.map((s) => "." + s) : t;
1135
1135
  }
1136
- function Jt(r, e, t, s, n) {
1137
- const { children: i } = e, a = qt(e, s), o = s.$slots?.[a.name];
1138
- return o ? o(t) : i ? R(i) ? r.createTextVNode(i) : $(i) ? r.createTextVNode(
1139
- be(s.__parseExpression(i))
1140
- ) : Array.isArray(i) ? i.map(
1141
- (p) => F(p, s, r, n, i)
1136
+ function Kt(n, e, t, s, r) {
1137
+ const { children: o } = e, a = zt(e, s), i = s.$slots?.[a.name];
1138
+ return i ? i(t) : o ? b(o) ? n.createTextVNode(o) : $(o) ? n.createTextVNode(
1139
+ Pe(s.__parseExpression(o))
1140
+ ) : Array.isArray(o) ? o.map(
1141
+ (p) => F(p, s, n, r, o)
1142
1142
  ) : null : null;
1143
1143
  }
1144
- function qt(r, e) {
1145
- const { props: t } = r, s = t?.name || "default";
1144
+ function zt(n, e) {
1145
+ const { props: t } = n, s = t?.name || "default";
1146
1146
  return {
1147
1147
  name: $(s) ? e.__parseExpression(s) : s,
1148
1148
  params: []
1149
1149
  };
1150
1150
  }
1151
- function Kt(r, e) {
1152
- return e.__parseExpression(r.value) ? {} : {
1151
+ function Gt(n, e) {
1152
+ return e.__parseExpression(n.value) ? {} : {
1153
1153
  display: "none"
1154
1154
  };
1155
1155
  }
1156
- function zt(r, e) {
1156
+ function Vt(n, e) {
1157
1157
  return {
1158
- innerHTML: e.__parseExpression(r.value) || ""
1158
+ innerHTML: e.__parseExpression(n.value) || ""
1159
1159
  };
1160
1160
  }
1161
- function Gt(r, e, t) {
1161
+ function Wt(n, e, t) {
1162
1162
  const s = {
1163
1163
  type: "JSFunction",
1164
1164
  value: e.value?.value ? `(v) => {
1165
1165
  ${e.value.value} = v;
1166
1166
  }` : "(v) => {}"
1167
- }, n = t.__parseFunction(s), i = Te(
1167
+ }, r = t.__parseFunction(s), o = He(
1168
1168
  $(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
1169
1169
  ), a = $(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
1170
1170
  return {
1171
1171
  [a]: t.__parseExpression(e.value),
1172
- [`onUpdate:${a}`]: i.length && n ? r.withModifiers(n, i) : n
1172
+ [`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
1173
1173
  };
1174
1174
  }
1175
- function Vt(r, e, t, s, n) {
1175
+ function Qt(n, e, t, s, r) {
1176
1176
  if (!e) return null;
1177
- if (R(e))
1177
+ if (b(e))
1178
1178
  return { default: () => e };
1179
1179
  if ($(e))
1180
1180
  return {
1181
- default: () => be(t.__parseExpression(e))
1181
+ default: () => Pe(t.__parseExpression(e))
1182
1182
  };
1183
1183
  if (Array.isArray(e) && e.length > 0) {
1184
- const i = Wt(e), a = (o, p) => !o || !n ? {} : n?.id && Object.keys(o).length ? p ? {
1185
- [p]: o
1184
+ const o = Xt(e), a = (i, p) => !i || !r ? {} : r?.id && Object.keys(i).length ? p ? {
1185
+ [p]: i
1186
1186
  } : {
1187
- [`scope_${n.id}`]: o
1187
+ [`scope_${r.id}`]: i
1188
1188
  } : p ? { [p]: /* @__PURE__ */ Object.create(null) } : {};
1189
- return Object.entries(i).reduce(
1190
- (o, [p, { nodes: c, params: l, scope: u }]) => (o[p] = (h) => {
1191
- const d = l.length ? et(h ?? {}, l) : a(h, u);
1189
+ return Object.entries(o).reduce(
1190
+ (i, [p, { nodes: c, params: l, scope: u }]) => (i[p] = (h) => {
1191
+ const f = l.length ? st(h ?? {}, l) : a(h, u);
1192
1192
  return c.map(
1193
- (f) => F(f, t.__clone(d), r, s, c)
1193
+ (d) => F(d, t.__clone(f), n, s, c)
1194
1194
  );
1195
- }, o),
1195
+ }, i),
1196
1196
  {}
1197
1197
  );
1198
1198
  }
1199
1199
  return null;
1200
1200
  }
1201
- function Wt(r) {
1201
+ function Xt(n) {
1202
1202
  const e = {};
1203
- for (const t of r) {
1204
- const s = Qt(t.slot), n = s.name;
1205
- e[n] ? (e[n].nodes.push(t), e[n].params = e[n].params.concat(s.params), e[n].scope = s.scope || "") : e[n] = {
1203
+ for (const t of n) {
1204
+ const s = Yt(t.slot), r = s.name;
1205
+ e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(s.params), e[r].scope = s.scope || "") : e[r] = {
1206
1206
  nodes: [t],
1207
1207
  params: s.params,
1208
1208
  scope: s.scope || ""
@@ -1210,104 +1210,186 @@ function Wt(r) {
1210
1210
  }
1211
1211
  return e;
1212
1212
  }
1213
- function Qt(r = "default") {
1214
- return R(r) ? { name: r, params: [], scope: "" } : { params: [], scope: "", ...r };
1213
+ function Yt(n = "default") {
1214
+ return b(n) ? { name: n, params: [], scope: "" } : { params: [], scope: "", ...n };
1215
1215
  }
1216
- function Xt(r, e, t) {
1217
- const { value: s, iterator: n } = r, { item: i = "item", index: a = "index" } = n || {};
1218
- let o = t.__parseExpression(s) || [];
1219
- return Number.isInteger(o) && (o = new Array(o).fill(!0).map((p, c) => c + 1)), Array.isArray(o) ? o.map((p, c) => e(t.__clone({ [i]: p, [a]: c }), c)) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
1216
+ function Zt(n, e, t) {
1217
+ const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
1218
+ let i = t.__parseExpression(s) || [];
1219
+ return Number.isInteger(i) && (i = new Array(i).fill(!0).map((p, c) => c + 1)), Array.isArray(i) ? i.map((p, c) => e(t.__clone({ [o]: p, [a]: c }), c)) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
1220
1220
  }
1221
- const ye = Ee({
1221
+ const Y = Re({
1222
1222
  name: "VtjPageContainer",
1223
1223
  async setup() {
1224
- const r = xe(), e = je(), t = e.params.id, s = t ? r.getPage(t) : r.getHomepage(), n = s ? await r.getRenderComponent(s.id) : null, i = Z(Symbol());
1224
+ const n = Ne(), e = be(), t = e.meta.__vtj__ || e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = se(Symbol());
1225
1225
  if (s) {
1226
1226
  Object.assign(e.meta, s.meta || {}, { cache: s.cache });
1227
- const { useTitle: a } = r?.adapter;
1227
+ const { useTitle: a } = n?.adapter;
1228
1228
  a && a(s.title || "VTJ");
1229
1229
  }
1230
1230
  return {
1231
- provider: r,
1232
- component: n,
1231
+ provider: n,
1232
+ component: r,
1233
1233
  file: s,
1234
1234
  query: e.query,
1235
1235
  meta: e.meta,
1236
- sid: i,
1236
+ sid: o,
1237
1237
  route: e
1238
1238
  };
1239
1239
  },
1240
1240
  render() {
1241
- const { component: r, query: e, sid: t } = this;
1242
- return r ? Y(r, { ...e, key: t }) : Y("div", "页面不存在");
1241
+ const { component: n, query: e, sid: t } = this;
1242
+ return n ? te(n, { ...e, key: t }) : te("div", "页面不存在");
1243
1243
  },
1244
1244
  activated() {
1245
1245
  this.meta.cache === !1 && (this.sid = Symbol());
1246
1246
  }
1247
- }), Yt = Ee({
1247
+ }), es = Re({
1248
1248
  name: "VtjStartupContainer",
1249
1249
  render() {
1250
- return Y("div", "page not found!");
1250
+ return te("div", "page not found!");
1251
1251
  }
1252
1252
  });
1253
- function oe(r, e, t = []) {
1254
- return t.map((s) => {
1255
- const { id: n, title: i, icon: a, children: o, hidden: p } = s;
1256
- return {
1257
- id: n,
1258
- title: i,
1259
- icon: a,
1260
- hidden: p,
1261
- url: `${r}/${e}/${n}`,
1262
- children: o && o.length ? oe(r, e, o) : void 0
1263
- };
1264
- });
1253
+ function J(n, e, t = []) {
1254
+ const s = [];
1255
+ for (const r of t) {
1256
+ const { id: o, title: a, icon: i, children: p, hidden: c, layout: l } = r;
1257
+ if (l) {
1258
+ const u = J(n, e, p || []);
1259
+ s.push(...u);
1260
+ } else {
1261
+ const u = {
1262
+ id: o,
1263
+ title: a,
1264
+ icon: i,
1265
+ hidden: c,
1266
+ url: `${n}/${e}/${o}`,
1267
+ children: p && p.length ? J(n, e, p) : void 0
1268
+ };
1269
+ s.push(u);
1270
+ }
1271
+ }
1272
+ return s;
1265
1273
  }
1266
- function De(r, e) {
1267
- if (!e) return r;
1274
+ function xe(n, e) {
1275
+ if (!e) return n;
1268
1276
  let t = [];
1269
- for (const s of r)
1277
+ for (const s of n)
1270
1278
  if (s.children && s.children.length) {
1271
- const n = De(s.children, e);
1272
- n.length && (s.children = n, t.push(s));
1279
+ const r = xe(s.children, e);
1280
+ r.length && (s.children = r, t.push(s));
1273
1281
  } else
1274
1282
  e.can(s.id.toString()) && t.push(s);
1275
1283
  return t;
1276
1284
  }
1277
- function ys(r) {
1285
+ function ws(n) {
1278
1286
  const {
1279
1287
  menuPathPrefix: e = "",
1280
1288
  pageRouteName: t = "page",
1281
1289
  disableMenusFilter: s = !1
1282
- } = r || {}, n = xe(), i = je(), a = _t(), o = Z(!1), p = Z(!1), c = n.project;
1283
- st(() => {
1284
- const { name: h, params: d, meta: f } = i;
1285
- if (h === M) {
1286
- const g = n.getPage(d.id);
1287
- o.value = !g?.mask, p.value = !!g?.pure;
1288
- } else if (h === N) {
1289
- const g = n.getHomepage();
1290
- o.value = !g?.mask, p.value = !!g?.pure;
1291
- } else
1292
- o.value = !f.mask, p.value = !!f.pure;
1290
+ } = n || {}, r = Ne(), o = be(), a = St(), i = se(!1), p = se(!1), c = r.project, l = (f) => {
1291
+ i.value = !f?.mask, p.value = !!f?.pure;
1292
+ };
1293
+ rt(() => {
1294
+ const { name: f, params: d, meta: v } = o;
1295
+ if (f === M) {
1296
+ const g = r.getPage(d.id);
1297
+ l(g);
1298
+ } else if (f === N) {
1299
+ const g = r.getHomepage();
1300
+ l(g);
1301
+ } else {
1302
+ const g = v.__vtj__;
1303
+ if (g) {
1304
+ const m = r.getPage(g);
1305
+ l(m);
1306
+ } else
1307
+ i.value = !v.mask, p.value = !!v.pure;
1308
+ }
1293
1309
  });
1294
- const l = oe(
1310
+ const u = J(
1295
1311
  e,
1296
1312
  t,
1297
1313
  c?.pages
1298
- ), u = c?.config;
1314
+ ), h = c?.config;
1299
1315
  return {
1300
- disabled: o,
1301
- logo: u?.logo,
1302
- themeSwitchable: u?.themeSwitchable,
1303
- title: u?.title || c?.description || c?.name || "VTJ App",
1304
- menus: s ? l : De(l, a),
1316
+ disabled: i,
1317
+ logo: h?.logo,
1318
+ themeSwitchable: h?.themeSwitchable,
1319
+ title: h?.title || c?.description || c?.name || "VTJ App",
1320
+ menus: s ? u : xe(u, a),
1305
1321
  pure: p
1306
1322
  };
1307
1323
  }
1308
- const He = Symbol("Provider");
1309
- var Zt = /* @__PURE__ */ ((r) => (r.Production = "production", r.Development = "development", r))(Zt || {});
1310
- class es extends Je {
1324
+ function Z(n, e) {
1325
+ const { id: t, title: s, meta: r } = n, { name: o = "page", prefix: a = "", component: i, routeMeta: p } = e;
1326
+ return {
1327
+ name: t,
1328
+ path: `${a}${o}/${t}`,
1329
+ component: i,
1330
+ meta: {
1331
+ title: s,
1332
+ ...p,
1333
+ ...r,
1334
+ __vtj__: t
1335
+ }
1336
+ };
1337
+ }
1338
+ function ae(n) {
1339
+ const {
1340
+ name: e = "page",
1341
+ prefix: t = "",
1342
+ pages: s = [],
1343
+ component: r,
1344
+ loader: o,
1345
+ routeMeta: a,
1346
+ homepage: i
1347
+ } = n, p = [];
1348
+ for (const c of s) {
1349
+ const { id: l, title: u, dir: h, layout: f, children: d, meta: v } = c;
1350
+ if (h) {
1351
+ const g = ae({
1352
+ name: e,
1353
+ prefix: t,
1354
+ component: r,
1355
+ routeMeta: a,
1356
+ homepage: i,
1357
+ loader: o,
1358
+ pages: d || []
1359
+ });
1360
+ p.push(...g);
1361
+ } else if (f) {
1362
+ const g = ae({
1363
+ name: e,
1364
+ prefix: t,
1365
+ component: r,
1366
+ routeMeta: a,
1367
+ homepage: i,
1368
+ loader: o,
1369
+ pages: d || []
1370
+ }), m = {
1371
+ name: `layout_${l}`,
1372
+ path: t,
1373
+ component: () => o(l),
1374
+ meta: {
1375
+ title: u,
1376
+ ...a,
1377
+ ...v,
1378
+ __vtj__: l
1379
+ },
1380
+ children: g
1381
+ };
1382
+ p.push(m), p.push(Z(c, n));
1383
+ } else if (p.push(Z(c, n)), i === l) {
1384
+ const g = Z(c, n);
1385
+ g.path = "", g.name = `home_${l}`, p.push(g);
1386
+ }
1387
+ }
1388
+ return p;
1389
+ }
1390
+ const Be = Symbol("Provider");
1391
+ var ts = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(ts || {});
1392
+ class ss extends Ke {
1311
1393
  // DSL缓存
1312
1394
  /**
1313
1395
  * 创建Provider实例
@@ -1318,10 +1400,10 @@ class es extends Je {
1318
1400
  const {
1319
1401
  service: t,
1320
1402
  mode: s = w.Raw,
1321
- dependencies: n,
1322
- materials: i,
1403
+ dependencies: r,
1404
+ materials: o,
1323
1405
  project: a = {},
1324
- adapter: o = {},
1406
+ adapter: i = {},
1325
1407
  globals: p = {},
1326
1408
  modules: c = {},
1327
1409
  router: l = null,
@@ -1329,9 +1411,9 @@ class es extends Je {
1329
1411
  nodeEnv: h = "development"
1330
1412
  /* Development */
1331
1413
  } = e;
1332
- this.mode = s, this.modules = c, this.service = t, this.router = l, this.materialPath = u, this.nodeEnv = h, n && (this.dependencies = n), i && (this.materials = i), Object.assign(this.globals, p), Object.assign(this.adapter, o);
1333
- const { access: d, request: f } = this.adapter;
1334
- d && d.connect({ mode: s, router: l, request: f }), a && s !== w.Design ? this.load(a) : this.project = a;
1414
+ this.mode = s, this.modules = c, this.service = t, this.router = l, this.materialPath = u, this.nodeEnv = h, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, p), Object.assign(this.adapter, i);
1415
+ const { access: f, request: d } = this.adapter;
1416
+ f && f.connect({ mode: s, router: l, request: d }), a && s !== w.Design ? this.load(a) : this.project = a;
1335
1417
  }
1336
1418
  mode;
1337
1419
  // 当前运行模式(设计/源码/预览等)
@@ -1339,7 +1421,7 @@ class es extends Je {
1339
1421
  // 全局变量
1340
1422
  modules = {};
1341
1423
  // 异步模块加载器
1342
- adapter = { request: X, jsonp: Se };
1424
+ adapter = { request: ee, jsonp: je };
1343
1425
  // 适配器接口
1344
1426
  apis = {};
1345
1427
  // API集合
@@ -1368,8 +1450,8 @@ class es extends Je {
1368
1450
  if (e)
1369
1451
  try {
1370
1452
  s = await e.apply(e, t);
1371
- } catch (i) {
1372
- I.warn("模拟数据模版异常", i);
1453
+ } catch (o) {
1454
+ I.warn("模拟数据模版异常", o);
1373
1455
  }
1374
1456
  return O()?.mock(s);
1375
1457
  };
@@ -1384,11 +1466,11 @@ class es extends Je {
1384
1466
  * @param project 项目配置
1385
1467
  */
1386
1468
  async load(e) {
1387
- const t = this.modules[`.vtj/projects/${e.id}.json`] || this.modules[`/src/.vtj/projects/${e.id}.json`];
1388
- if (this.project = t ? await t() : await this.service.init(e), !this.project)
1469
+ const { vtjDir: t = ".vtj" } = this.options, s = this.modules[`${t}/projects/${e.id}.json`] || this.modules[`/src/${t}/projects/${e.id}.json`];
1470
+ if (this.project = s ? await s() : await this.service.init(e), !this.project)
1389
1471
  throw new Error("project is null");
1390
- const { apis: s = [], meta: n = [] } = this.project, i = window;
1391
- i && (i.CKEDITOR_VERSION = void 0), this.mode === w.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.initMock(i), this.apis = $t(s, n, this.adapter), Fe(i), Et(s, i), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
1472
+ const { apis: r = [], meta: o = [] } = this.project, a = window;
1473
+ a && (a.CKEDITOR_VERSION = void 0), this.mode === w.Raw ? await this.loadDependencies(a) : await this.loadAssets(a), this.initMock(a), this.apis = Et(r, o, this.adapter), Me(a), Rt(r, a), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
1392
1474
  }
1393
1475
  initMock(e) {
1394
1476
  const t = O(e);
@@ -1398,72 +1480,85 @@ class es extends Je {
1398
1480
  }
1399
1481
  async loadDependencies(e) {
1400
1482
  const t = Object.entries(this.dependencies);
1401
- for (const [s, n] of t)
1402
- e[s] || (e[s] = this.library[s] = await n());
1483
+ for (const [s, r] of t)
1484
+ e[s] || (e[s] = this.library[s] = await r());
1403
1485
  }
1404
1486
  async loadAssets(e) {
1405
- const { dependencies: t = [] } = this.project, { dependencies: s, library: n, components: i, materialPath: a, nodeEnv: o } = this, {
1487
+ const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
1406
1488
  libraryExports: p,
1407
1489
  libraryMap: c,
1408
1490
  materials: l,
1409
1491
  materialExports: u,
1410
1492
  materialMapLibrary: h
1411
- } = lt(
1493
+ } = pt(
1412
1494
  t,
1413
1495
  a,
1414
- o === "development"
1496
+ i === "development"
1415
1497
  /* Development */
1416
1498
  );
1417
- for (const d of p) {
1418
- const f = s[d], g = e[d];
1419
- if (g)
1420
- n[d] = g;
1421
- else if (f)
1422
- e[d] = n[d] = await f();
1499
+ for (const f of p) {
1500
+ const d = s[f], v = e[f];
1501
+ if (v)
1502
+ r[f] = v;
1503
+ else if (d)
1504
+ e[f] = r[f] = await d();
1423
1505
  else {
1424
- const y = c[d] || [];
1425
- for (const m of y)
1426
- q(m) && await dt(m, A.append(m, { v: k })), K(m) && await me(A.append(m, { v: k }));
1427
- n[d] = e[d];
1506
+ const g = c[f] || [];
1507
+ for (const m of g)
1508
+ K(m) && await mt(m, A.append(m, { v: k })), z(m) && await ye(A.append(m, { v: k }));
1509
+ r[f] = e[f];
1428
1510
  }
1429
1511
  }
1430
- if (o === "development") {
1431
- for (const f of l)
1432
- await me(A.append(f, { v: k }));
1433
- const d = this.materials || {};
1434
- for (const f of u) {
1435
- const g = e[h[f]], y = qe[f];
1436
- if (y)
1437
- g && y.forEach((m) => {
1438
- i[m] = g[m];
1512
+ if (i === "development") {
1513
+ for (const d of l)
1514
+ await ye(A.append(d, { v: k }));
1515
+ const f = this.materials || {};
1516
+ for (const d of u) {
1517
+ const v = e[h[d]], g = ze[d];
1518
+ if (g)
1519
+ v && g.forEach((m) => {
1520
+ o[m] = v[m];
1439
1521
  });
1440
1522
  else {
1441
- const m = d[f] ? (await d[f]()).default : e[f];
1442
- m && g && (m.components || []).forEach((E) => {
1443
- i[E.name] = ut(E, g);
1523
+ const m = f[d] ? (await f[d]()).default : e[d];
1524
+ m && v && (m.components || []).forEach((j) => {
1525
+ o[j.name] = ft(j, v);
1444
1526
  });
1445
1527
  }
1446
1528
  }
1447
1529
  }
1448
1530
  }
1449
1531
  initRouter() {
1450
- const { router: e, project: t, options: s, adapter: n } = this;
1532
+ const { router: e, project: t, options: s, adapter: r } = this;
1451
1533
  if (!e) return;
1452
- const i = t?.platform === "uniapp" ? "pages" : "page", {
1534
+ const o = t?.platform === "uniapp" ? "pages" : "page", {
1453
1535
  routeAppendTo: a,
1454
- pageRouteName: o = i,
1536
+ pageRouteName: i = o,
1455
1537
  routeMeta: p
1456
1538
  } = s, c = a ? "" : "/", l = {
1457
- path: `${c}${o}/:id`,
1539
+ path: `${c}${i}/:id`,
1458
1540
  name: M,
1459
- component: ye
1541
+ component: Y
1460
1542
  }, u = {
1461
1543
  path: c,
1462
1544
  name: N,
1463
- component: t?.homepage ? ye : n.startupComponent || Yt,
1545
+ component: t?.homepage ? Y : r.startupComponent || es,
1464
1546
  meta: p
1465
1547
  };
1466
- e.hasRoute(M) && e.removeRoute(M), e.hasRoute(N) && e.removeRoute(N), a ? (e.addRoute(a, l), e.addRoute(a, u)) : (e.addRoute(l), e.addRoute(u));
1548
+ if (e.hasRoute(M) && e.removeRoute(M), e.hasRoute(N) && e.removeRoute(N), s.enableStaticRoute) {
1549
+ const h = t?.pages || [];
1550
+ ae({
1551
+ name: i,
1552
+ prefix: c,
1553
+ pages: h,
1554
+ component: Y,
1555
+ loader: this.getRenderComponent.bind(this),
1556
+ homepage: t?.homepage
1557
+ }).forEach((d) => {
1558
+ a ? e.addRoute(a, d) : e.addRoute(d);
1559
+ }), t?.homepage || (a ? e.addRoute(a, u) : e.addRoute(u));
1560
+ } else
1561
+ a ? (e.addRoute(a, l), e.addRoute(a, u)) : (e.addRoute(l), e.addRoute(u));
1467
1562
  }
1468
1563
  /**
1469
1564
  * Vue 插件安装方法
@@ -1477,16 +1572,16 @@ class es extends Je {
1477
1572
  */
1478
1573
  install(e) {
1479
1574
  const t = e.config.globalProperties.installed || {};
1480
- for (const [s, n] of Object.entries(this.library))
1481
- !t[s] && ht(n) && (e.use(n), t[s] = !0);
1482
- this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(He, this), e.config.globalProperties.$provider = this, e.config.globalProperties.installed = t, this.mode === w.Design && (e.config.errorHandler = (s, n, i) => {
1483
- const a = n?.$options.name, o = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", p = `[ ${a} ] ${o} ${i}`;
1575
+ for (const [s, r] of Object.entries(this.library))
1576
+ !t[s] && gt(r) && (e.use(r), t[s] = !0);
1577
+ this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(Be, this), e.config.globalProperties.$provider = this, e.config.globalProperties.installed = t, this.mode === w.Design && (e.config.errorHandler = (s, r, o) => {
1578
+ const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", p = `[ ${a} ] ${i} ${o}`;
1484
1579
  console.error(
1485
1580
  "[VTJ Error]:",
1486
1581
  {
1487
1582
  err: s,
1488
- instance: n,
1489
- info: i
1583
+ instance: r,
1584
+ info: o
1490
1585
  },
1491
1586
  s?.stack
1492
1587
  ), this.adapter.notify && this.adapter.notify(p, "组件渲染错误", "error");
@@ -1497,29 +1592,29 @@ class es extends Je {
1497
1592
  return this.getPage(e) || t.find((s) => s.id === e) || null;
1498
1593
  }
1499
1594
  getPage(e) {
1500
- const { pages: t = [] } = this.project || {}, s = (n, i = []) => {
1501
- for (const a of i) {
1502
- if (a.id === n)
1595
+ const { pages: t = [] } = this.project || {}, s = (r, o = []) => {
1596
+ for (const a of o) {
1597
+ if (a.id === r)
1503
1598
  return a;
1504
1599
  if (a.children && a.children.length) {
1505
- const o = s(n, a.children);
1506
- if (o)
1507
- return o;
1600
+ const i = s(r, a.children);
1601
+ if (i)
1602
+ return i;
1508
1603
  }
1509
1604
  }
1510
1605
  };
1511
1606
  return s(e, t) || null;
1512
1607
  }
1513
1608
  getMenus(e = "page", t = "") {
1514
- return oe(t, e, this.project?.pages || []);
1609
+ return J(t, e, this.project?.pages || []);
1515
1610
  }
1516
1611
  getHomepage() {
1517
1612
  const { homepage: e } = this.project || {};
1518
1613
  return e ? this.getPage(e) : null;
1519
1614
  }
1520
1615
  async getDsl(e) {
1521
- const t = this.modules[`.vtj/files/${e}.json`] || this.modules[`/src/.vtj/files/${e}.json`];
1522
- return t ? await t() : this.service.getFile(e, this.project || void 0).catch(() => null);
1616
+ const { vtjDir: t = ".vtj" } = this.options, s = this.modules[`${t}/files/${e}.json`] || this.modules[`/src/${t}/files/${e}.json`];
1617
+ return s ? await s() : this.service.getFile(e, this.project || void 0).catch(() => null);
1523
1618
  }
1524
1619
  async getDslByUrl(e) {
1525
1620
  const t = this.urlDslCaches[e];
@@ -1542,21 +1637,21 @@ class es extends Je {
1542
1637
  * @returns 渲染器实例
1543
1638
  */
1544
1639
  createDslRenderer(e, t = {}) {
1545
- const { library: s, components: n, mode: i, apis: a } = this, o = {
1546
- mode: i,
1640
+ const { library: s, components: r, mode: o, apis: a } = this, i = {
1641
+ mode: o,
1547
1642
  Vue: s.Vue,
1548
- components: n,
1643
+ components: r,
1549
1644
  libs: s,
1550
1645
  apis: a,
1551
1646
  window,
1552
1647
  ...t
1553
- }, p = se({
1648
+ }, p = oe({
1554
1649
  getDsl: async (c) => await this.getDsl(c) || null,
1555
1650
  getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
1556
- options: o
1651
+ options: i
1557
1652
  });
1558
- return te({
1559
- ...o,
1653
+ return re({
1654
+ ...i,
1560
1655
  dsl: e,
1561
1656
  loader: p
1562
1657
  });
@@ -1576,11 +1671,11 @@ class es extends Je {
1576
1671
  if (!s)
1577
1672
  return I.warn(`Can not find file: ${e}`), null;
1578
1673
  t && t(s);
1579
- const n = `.vtj/vue/${e}.vue`, i = this.modules[n] || this.modules[`/src/pages/${e}.vue`];
1580
- if (i)
1581
- return (await i())?.default;
1582
- const a = await this.getDsl(s.id);
1583
- return a ? this.createDslRenderer(a).renderer : (I.warn(`Can not find dsl: ${e}`), null);
1674
+ const { vtjRawDir: r = ".vtj/vue" } = this.options, o = `${r}/${e}.vue`, a = this.modules[o] || this.modules[`/src/pages/${e}.vue`];
1675
+ if (a)
1676
+ return (await a())?.default;
1677
+ const i = await this.getDsl(s.id);
1678
+ return i ? this.createDslRenderer(i).renderer : (I.warn(`Can not find dsl: ${e}`), null);
1584
1679
  }
1585
1680
  /**
1586
1681
  * 定义基于URL的异步组件
@@ -1592,7 +1687,7 @@ class es extends Je {
1592
1687
  * @returns Vue异步组件
1593
1688
  */
1594
1689
  defineUrlSchemaComponent(e, t) {
1595
- return ge(async () => {
1690
+ return _e(async () => {
1596
1691
  const s = await this.getDslByUrl(e);
1597
1692
  return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
1598
1693
  });
@@ -1605,26 +1700,26 @@ class es extends Je {
1605
1700
  * @returns Vue异步组件
1606
1701
  */
1607
1702
  definePluginComponent(e) {
1608
- return ge(async () => await Me(e, window));
1703
+ return _e(async () => await De(e, window));
1609
1704
  }
1610
1705
  }
1611
- function _s(r) {
1612
- const e = new es(r);
1706
+ function Ss(n) {
1707
+ const e = new ss(n);
1613
1708
  return {
1614
1709
  provider: e,
1615
1710
  onReady: (s) => e.ready(s)
1616
1711
  };
1617
1712
  }
1618
- function xe(r = {}) {
1619
- const e = $e(He, null);
1713
+ function Ne(n = {}) {
1714
+ const e = Ee(Be, null);
1620
1715
  if (!e)
1621
1716
  throw new Error("Can not find provider");
1622
1717
  if (e.nodeEnv === "development") {
1623
- const { id: t, version: s } = r;
1718
+ const { id: t, version: s } = n;
1624
1719
  t && s && (async () => {
1625
- const n = await e.getDsl(t);
1626
- n?.__VERSION__ !== s && e.adapter.notify && e.adapter.notify(
1627
- `[ ${n?.name} ] 组件源码版本与运行时版本不一致,请重新发布组件`,
1720
+ const r = await e.getDsl(t);
1721
+ r?.__VERSION__ !== s && e.adapter.notify && e.adapter.notify(
1722
+ `[ ${r?.name} ] 组件源码版本与运行时版本不一致,请重新发布组件`,
1628
1723
  "版本不一致",
1629
1724
  "warning"
1630
1725
  );
@@ -1632,31 +1727,31 @@ function xe(r = {}) {
1632
1727
  }
1633
1728
  return e;
1634
1729
  }
1635
- async function ws(r, e = "") {
1636
- const { name: t, urls: s = [] } = r || {}, n = s.map((o) => e + o), { css: i, js: a } = pt(n);
1637
- if (i.length && Pe(i), a.length)
1638
- return await Ce(a, t).catch(
1730
+ async function $s(n, e = "") {
1731
+ const { name: t, urls: s = [] } = n || {}, r = s.map((i) => e + i), { css: o, js: a } = dt(r);
1732
+ if (o.length && Ae(o), a.length)
1733
+ return await Ie(a, t).catch(
1639
1734
  () => {
1640
1735
  }
1641
1736
  );
1642
1737
  }
1643
- const Be = {
1738
+ const Ue = {
1644
1739
  type: "json",
1645
1740
  validSuccess: !0,
1646
1741
  originResponse: !1,
1647
1742
  failMessage: !0,
1648
- validate: (r) => r.data?.code === 0
1649
- }, ts = (r, e = "/__vtj__/api/:type.json") => (t, s, n) => r.send({
1743
+ validate: (n) => n.data?.code === 0
1744
+ }, ns = (n, e = "/__vtj__/api/:type.json") => (t, s, r) => n.send({
1650
1745
  url: e,
1651
1746
  method: "post",
1652
1747
  params: { type: t },
1653
- query: n,
1748
+ query: r,
1654
1749
  data: {
1655
1750
  type: t,
1656
1751
  data: s
1657
1752
  },
1658
- settings: Be
1659
- }), ss = (r, e = "/__vtj__/api/uploader.json") => async (t, s) => await r.send({
1753
+ settings: Ue
1754
+ }), rs = (n, e = "/__vtj__/api/uploader.json") => async (t, s) => await n.send({
1660
1755
  url: e,
1661
1756
  method: "post",
1662
1757
  data: {
@@ -1664,12 +1759,12 @@ const Be = {
1664
1759
  projectId: s
1665
1760
  },
1666
1761
  settings: {
1667
- ...Be,
1762
+ ...Ue,
1668
1763
  type: "data"
1669
1764
  }
1670
- }).then((n) => n && n[0] ? n[0] : null).catch(() => null);
1671
- function Ss(r) {
1672
- return we({
1765
+ }).then((r) => r && r[0] ? r[0] : null).catch(() => null);
1766
+ function js(n) {
1767
+ return $e({
1673
1768
  settings: {
1674
1769
  type: "json",
1675
1770
  validSuccess: !0,
@@ -1677,14 +1772,14 @@ function Ss(r) {
1677
1772
  failMessage: !0,
1678
1773
  validate: (e) => e.data?.code === 0,
1679
1774
  showError: (e) => {
1680
- r && r(e || "未知错误");
1775
+ n && n(e || "未知错误");
1681
1776
  }
1682
1777
  }
1683
1778
  });
1684
1779
  }
1685
- class ae {
1686
- constructor(e = X) {
1687
- this.req = e, this.api = ts(e), this.uploader = ss(e);
1780
+ class ue {
1781
+ constructor(e = ee) {
1782
+ this.req = e, this.api = ns(e), this.uploader = rs(e);
1688
1783
  }
1689
1784
  api;
1690
1785
  pluginCaches = {};
@@ -1768,38 +1863,38 @@ class ae {
1768
1863
  return await this.api("clearStaticFiles", e).catch(() => "");
1769
1864
  }
1770
1865
  async getPluginMaterial(e) {
1771
- const { urls: t = [] } = e, s = t.filter((i) => at(i))[0];
1866
+ const { urls: t = [] } = e, s = t.filter((o) => lt(o))[0];
1772
1867
  if (!s) return null;
1773
- const n = this.pluginCaches[s];
1774
- return n || (this.pluginCaches[s] = X.send({
1868
+ const r = this.pluginCaches[s];
1869
+ return r || (this.pluginCaches[s] = ee.send({
1775
1870
  url: s,
1776
1871
  method: "get",
1777
1872
  settings: {
1778
1873
  validSuccess: !1,
1779
1874
  originResponse: !0
1780
1875
  }
1781
- }).then((i) => i.data).catch(() => null));
1876
+ }).then((o) => o.data).catch(() => null));
1782
1877
  }
1783
1878
  async genSource(e) {
1784
1879
  return console.log("BaseService.genSource", e), "";
1785
1880
  }
1786
1881
  }
1787
- const _ = new tt({
1882
+ const _ = new nt({
1788
1883
  type: "local",
1789
1884
  expired: 0,
1790
1885
  prefix: "__VTJ_"
1791
1886
  });
1792
- class $s extends ae {
1887
+ class Es extends ue {
1793
1888
  init(e) {
1794
- const t = new U(e), s = _.get(`project_${t.id}`), n = Object.assign(t.toDsl(), s || {});
1795
- return _.save(`project_${t.id}`, n), Promise.resolve(n);
1889
+ const t = new U(e), s = _.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1890
+ return _.save(`project_${t.id}`, r), Promise.resolve(r);
1796
1891
  }
1797
1892
  saveProject(e) {
1798
1893
  const t = new U(e);
1799
1894
  return _.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1800
1895
  }
1801
1896
  saveMaterials(e, t) {
1802
- return _.save(`materials_${e.id}`, ie(t)), Promise.resolve(!0);
1897
+ return _.save(`materials_${e.id}`, le(t)), Promise.resolve(!0);
1803
1898
  }
1804
1899
  saveFile(e) {
1805
1900
  return _.save(`file_${e.id}`, e), Promise.resolve(!0);
@@ -1817,13 +1912,13 @@ class $s extends ae {
1817
1912
  removeHistory(e) {
1818
1913
  const t = _.get(`history_${e}`);
1819
1914
  if (t) {
1820
- const n = (t.items || []).map((i) => i.id);
1821
- this.removeHistoryItem(e, n), _.remove(`history_${e}`);
1915
+ const r = (t.items || []).map((o) => o.id);
1916
+ this.removeHistoryItem(e, r), _.remove(`history_${e}`);
1822
1917
  }
1823
1918
  return Promise.resolve(!0);
1824
1919
  }
1825
1920
  getHistory(e) {
1826
- const t = _.get(`history_${e}`), s = new _e(t || { id: e });
1921
+ const t = _.get(`history_${e}`), s = new Se(t || { id: e });
1827
1922
  return Promise.resolve(s.toDsl());
1828
1923
  }
1829
1924
  getHistoryItem(e, t) {
@@ -1839,22 +1934,22 @@ class $s extends ae {
1839
1934
  }), Promise.resolve(!0);
1840
1935
  }
1841
1936
  }
1842
- class rs extends ae {
1937
+ class os extends ue {
1843
1938
  projects = {};
1844
1939
  materials = {};
1845
1940
  files = {};
1846
1941
  histories = {};
1847
1942
  historyItems = {};
1848
1943
  init(e) {
1849
- const t = new U(e), s = this.projects[t.id] || {}, n = Object.assign(t.toDsl(), s);
1850
- return this.projects[n.id] = n, Promise.resolve(n);
1944
+ const t = new U(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
1945
+ return this.projects[r.id] = r, Promise.resolve(r);
1851
1946
  }
1852
1947
  saveProject(e) {
1853
1948
  const t = new U(e);
1854
1949
  return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
1855
1950
  }
1856
1951
  saveMaterials(e, t) {
1857
- return e.id && (this.materials[e.id] = ie(t)), Promise.resolve(!0);
1952
+ return e.id && (this.materials[e.id] = le(t)), Promise.resolve(!0);
1858
1953
  }
1859
1954
  saveFile(e) {
1860
1955
  return this.files[e.id] = e, Promise.resolve(!0);
@@ -1872,18 +1967,18 @@ class rs extends ae {
1872
1967
  removeHistory(e) {
1873
1968
  const t = this.histories[e];
1874
1969
  if (t) {
1875
- const n = (t.items || []).map((i) => i.id);
1876
- this.removeHistoryItem(e, n), delete this.historyItems[e];
1970
+ const r = (t.items || []).map((o) => o.id);
1971
+ this.removeHistoryItem(e, r), delete this.historyItems[e];
1877
1972
  }
1878
1973
  return Promise.resolve(!0);
1879
1974
  }
1880
1975
  getHistory(e) {
1881
- const t = this.histories[e], s = new _e(t || { id: e });
1976
+ const t = this.histories[e], s = new Se(t || { id: e });
1882
1977
  return Promise.resolve(s);
1883
1978
  }
1884
1979
  getHistoryItem(e, t) {
1885
- const s = `${e}_${t}`, n = this.historyItems[s] || {};
1886
- return Promise.resolve(n);
1980
+ const s = `${e}_${t}`, r = this.historyItems[s] || {};
1981
+ return Promise.resolve(r);
1887
1982
  }
1888
1983
  saveHistoryItem(e, t) {
1889
1984
  const s = `${e}_${t.id}`;
@@ -1891,16 +1986,16 @@ class rs extends ae {
1891
1986
  }
1892
1987
  removeHistoryItem(e, t) {
1893
1988
  return t.forEach((s) => {
1894
- const n = `${e}_${s}`;
1895
- delete this.historyItems[n];
1989
+ const r = `${e}_${s}`;
1990
+ delete this.historyItems[r];
1896
1991
  }), Promise.resolve(!0);
1897
1992
  }
1898
1993
  }
1899
1994
  let B = null;
1900
- function Es() {
1901
- return B || (B = new rs(), B);
1995
+ function Rs() {
1996
+ return B || (B = new os(), B);
1902
1997
  }
1903
- class js extends ae {
1998
+ class bs extends ue {
1904
1999
  getFileCaches = {};
1905
2000
  async getExtension() {
1906
2001
  return await this.api("getExtension", {}).catch(() => {
@@ -1917,7 +2012,7 @@ class js extends ae {
1917
2012
  async saveMaterials(e, t) {
1918
2013
  return !!await this.api("saveMaterials", {
1919
2014
  project: e,
1920
- materials: ie(t)
2015
+ materials: le(t)
1921
2016
  }).catch(() => !1);
1922
2017
  }
1923
2018
  async saveFile(e) {
@@ -1958,79 +2053,79 @@ class js extends ae {
1958
2053
  }
1959
2054
  }
1960
2055
  export {
1961
- us as ACCESS,
1962
- Ae as ACCESS_KEY,
1963
- Ie as Access,
1964
- ot as BUILD_IN_TAGS,
1965
- rt as BUILT_IN_DIRECTIVES,
1966
- ae as BaseService,
1967
- ve as CONTEXT_HOST,
1968
- Rt as Context,
2056
+ fs as ACCESS,
2057
+ Fe as ACCESS_KEY,
2058
+ ke as Access,
2059
+ ct as BUILD_IN_TAGS,
2060
+ ot as BUILT_IN_DIRECTIVES,
2061
+ ue as BaseService,
2062
+ we as CONTEXT_HOST,
2063
+ Ct as Context,
1969
2064
  w as ContextMode,
1970
- nt as DATA_TYPES,
2065
+ it as DATA_TYPES,
1971
2066
  N as HOMEPAGE_ROUTE_NAME,
1972
- it as HTML_TAGS,
1973
- hs as JSCodeToString,
1974
- cs as LIFE_CYCLES_LIST,
1975
- js as LocalService,
1976
- rs as MemoryService,
1977
- Zt as NodeEnv,
2067
+ at as HTML_TAGS,
2068
+ gs as JSCodeToString,
2069
+ us as LIFE_CYCLES_LIST,
2070
+ bs as LocalService,
2071
+ os as MemoryService,
2072
+ ts as NodeEnv,
1978
2073
  M as PAGE_ROUTE_NAME,
1979
- es as Provider,
1980
- ls as REMOTE,
1981
- $s as StorageService,
2074
+ ss as Provider,
2075
+ ps as REMOTE,
2076
+ Es as StorageService,
1982
2077
  k as VTJ_RENDERER_VERSION,
1983
- Re as adoptedStyleSheets,
1984
- vs as clearLoaderCache,
1985
- ft as compileScopedCSS,
1986
- gs as createAccess,
1987
- ms as createAdapter,
1988
- ps as createAssetScripts,
1989
- fs as createAssetsCss,
1990
- Mt as createDataSources,
1991
- se as createLoader,
1992
- Es as createMemoryService,
1993
- oe as createMenus,
1994
- St as createMetaApi,
1995
- jt as createMock,
1996
- _s as createProvider,
1997
- te as createRenderer,
1998
- wt as createSchemaApi,
1999
- $t as createSchemaApis,
2000
- Ss as createServiceRequest,
2001
- Dt as defaultLoader,
2078
+ Ce as adoptedStyleSheets,
2079
+ _s as clearLoaderCache,
2080
+ ht as compileScopedCSS,
2081
+ ys as createAccess,
2082
+ vs as createAdapter,
2083
+ ds as createAssetScripts,
2084
+ hs as createAssetsCss,
2085
+ Dt as createDataSources,
2086
+ oe as createLoader,
2087
+ Rs as createMemoryService,
2088
+ J as createMenus,
2089
+ jt as createMetaApi,
2090
+ bt as createMock,
2091
+ Ss as createProvider,
2092
+ re as createRenderer,
2093
+ $t as createSchemaApi,
2094
+ Et as createSchemaApis,
2095
+ js as createServiceRequest,
2096
+ xt as defaultLoader,
2002
2097
  x as fillBasePath,
2003
2098
  O as getMock,
2004
- Te as getModifiers,
2005
- Me as getPlugin,
2006
- ut as getRawComponent,
2007
- mt as isBuiltInTag,
2008
- q as isCSSUrl,
2009
- vt as isJSCode,
2099
+ He as getModifiers,
2100
+ De as getPlugin,
2101
+ ft as getRawComponent,
2102
+ vt as isBuiltInTag,
2103
+ K as isCSSUrl,
2104
+ _t as isJSCode,
2010
2105
  $ as isJSExpression,
2011
- D as isJSFunction,
2012
- at as isJSON,
2013
- K as isJSUrl,
2014
- gt as isNativeTag,
2015
- ht as isVuePlugin,
2016
- dt as loadCss,
2017
- Pe as loadCssUrl,
2018
- ws as loadEnhance,
2019
- Ce as loadScriptUrl,
2020
- De as menusFilter,
2021
- bt as mockApi,
2022
- Et as mockApis,
2023
- Fe as mockCleanup,
2106
+ T as isJSFunction,
2107
+ lt as isJSON,
2108
+ z as isJSUrl,
2109
+ yt as isNativeTag,
2110
+ gt as isVuePlugin,
2111
+ mt as loadCss,
2112
+ Ae as loadCssUrl,
2113
+ $s as loadEnhance,
2114
+ Ie as loadScriptUrl,
2115
+ xe as menusFilter,
2116
+ Pt as mockApi,
2117
+ Rt as mockApis,
2118
+ Me as mockCleanup,
2024
2119
  F as nodeRender,
2025
- lt as parseDeps,
2026
- T as parseExpression,
2027
- ee as parseFunction,
2028
- pt as parseUrls,
2029
- He as providerKey,
2030
- ct as removeProdFlag,
2031
- ds as setupPageSetting,
2032
- be as toString,
2033
- _t as useAccess,
2034
- ys as useMask,
2035
- xe as useProvider
2120
+ pt as parseDeps,
2121
+ D as parseExpression,
2122
+ ne as parseFunction,
2123
+ dt as parseUrls,
2124
+ Be as providerKey,
2125
+ ut as removeProdFlag,
2126
+ ms as setupPageSetting,
2127
+ Pe as toString,
2128
+ St as useAccess,
2129
+ ws as useMask,
2130
+ Ne as useProvider
2036
2131
  };