@vtj/renderer 0.13.15 → 0.13.16

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,5 +1,5 @@
1
- import { Base as ze, BUILT_IN_COMPONENTS as Ge, ProjectModel as L, HistoryModel as Ee } from "@vtj/core";
2
- import { isUrl as se, url as k, dedupArray as Ve, isString as C, isFunction as q, logger as F, storage as X, cookie as Y, toArray as ye, unRSA as _e, delay as J, createRequest as be, jsonp as Re, merge as Qe, pathToRegexp as We, pathToRegexpMatch as Xe, formDataToJson as Ye, Queue as Ze, cloneDeep as we, camelCase as P, isObject as et, upperFirst as tt, pick as st, request as ne, loadScript as Se, Storage as nt, mapToObject as ue } from "@vtj/utils";
1
+ import { Base as ze, BUILT_IN_COMPONENTS as Ge, ProjectModel as q, HistoryModel as Ee } from "@vtj/core";
2
+ import { isUrl as se, url as k, dedupArray as Ve, isString as C, isFunction as L, logger as F, storage as X, cookie as Y, toArray as ye, unRSA as _e, delay as J, createRequest as Re, jsonp as be, merge as Qe, pathToRegexp as We, pathToRegexpMatch as Xe, formDataToJson as Ye, Queue as Ze, cloneDeep as we, camelCase as P, isObject as et, upperFirst as tt, pick as st, request as ne, loadScript as Se, Storage as nt, mapToObject as ue } from "@vtj/utils";
3
3
  import * as z from "vue";
4
4
  import { inject as Pe, defineComponent as Ce, h as re, ref as oe, watchEffect as rt, defineAsyncComponent as $e } from "vue";
5
5
  import { useRoute as Ae } from "vue-router";
@@ -7,10 +7,10 @@ import { useRoute as Ae } from "vue-router";
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.13.15
10
+ * @version 0.13.16
11
11
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
12
12
  */
13
- const O = "0.13.15";
13
+ const O = "0.13.16";
14
14
  var y = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(y || {});
15
15
  const je = [
16
16
  "$el",
@@ -165,21 +165,21 @@ function ut(n, e = !1) {
165
165
  return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
166
166
  }
167
167
  function ft(n, e, t = !1) {
168
- const s = n.filter((h) => !!h.enabled), r = [], o = [], i = [], a = [], u = {}, c = {}, f = [], l = {};
168
+ const s = n.filter((h) => !!h.enabled), r = [], o = [], a = [], i = [], l = {}, c = {}, f = [], u = {};
169
169
  return s.forEach(
170
170
  ({ urls: h, assetsUrl: p, library: d, assetsLibrary: g, localeLibrary: v }) => {
171
171
  h?.forEach((m) => {
172
172
  V(m) && r.push(ut(m, t)), G(m) && o.push(m);
173
- }), d && (a.push(d), u[d] = B(h || [], e), v && (c[d] = v)), p && i.push(p), g && f.push(g), d && g && (l[g] = d);
173
+ }), d && (i.push(d), l[d] = B(h || [], e), v && (c[d] = v)), p && a.push(p), g && f.push(g), d && g && (u[g] = d);
174
174
  }
175
175
  ), {
176
176
  scripts: B(r, e),
177
177
  css: B(o, e),
178
- materials: B(i, e),
179
- libraryExports: a,
178
+ materials: B(a, e),
179
+ libraryExports: i,
180
180
  materialExports: Ve(f),
181
- materialMapLibrary: l,
182
- libraryMap: u,
181
+ materialMapLibrary: u,
182
+ libraryMap: l,
183
183
  libraryLocaleMap: c
184
184
  };
185
185
  }
@@ -197,58 +197,58 @@ function dt(n = []) {
197
197
  function ht(n, e) {
198
198
  const t = (c) => {
199
199
  const f = [];
200
- let l = 0;
201
- for (; l < c.length; ) {
202
- if (/\s/.test(c[l])) {
203
- l++;
200
+ let u = 0;
201
+ for (; u < c.length; ) {
202
+ if (/\s/.test(c[u])) {
203
+ u++;
204
204
  continue;
205
205
  }
206
- if (c.substring(l, l + 2) === "/*") {
207
- const m = c.indexOf("*/", l + 2);
206
+ if (c.substring(u, u + 2) === "/*") {
207
+ const m = c.indexOf("*/", u + 2);
208
208
  if (m !== -1) {
209
- l = m + 2;
209
+ u = m + 2;
210
210
  continue;
211
211
  }
212
212
  }
213
- if (c[l] === "@") {
214
- const m = l;
215
- for (; l < c.length && c[l] !== "{" && c[l] !== ";"; )
216
- l++;
217
- const b = c.substring(m, l).trim(), _ = b.includes("@keyframes");
218
- if (c[l] === ";")
213
+ if (c[u] === "@") {
214
+ const m = u;
215
+ for (; u < c.length && c[u] !== "{" && c[u] !== ";"; )
216
+ u++;
217
+ const R = c.substring(m, u).trim(), _ = R.includes("@keyframes");
218
+ if (c[u] === ";")
219
219
  f.push({
220
220
  type: "simple-at-rule",
221
- content: c.substring(m, l + 1)
222
- }), l++;
223
- else if (c[l] === "{") {
224
- const x = l + 1;
221
+ content: c.substring(m, u + 1)
222
+ }), u++;
223
+ else if (c[u] === "{") {
224
+ const x = u + 1;
225
225
  let A = 1;
226
- for (l++; l < c.length && A > 0; )
227
- c[l] === "{" ? A++ : c[l] === "}" && A--, l++;
228
- const Q = c.substring(m, l), R = c.substring(x, l - 1);
226
+ for (u++; u < c.length && A > 0; )
227
+ c[u] === "{" ? A++ : c[u] === "}" && A--, u++;
228
+ const Q = c.substring(m, u), b = c.substring(x, u - 1);
229
229
  f.push({
230
230
  type: _ ? "keyframes" : "at-rule",
231
- rule: b,
231
+ rule: R,
232
232
  content: Q,
233
- inner: R
233
+ inner: b
234
234
  });
235
235
  }
236
236
  continue;
237
237
  }
238
- const h = l;
239
- for (; l < c.length && c[l] !== "{"; )
240
- l++;
241
- if (l >= c.length) break;
242
- const p = c.substring(h, l).trim();
238
+ const h = u;
239
+ for (; u < c.length && c[u] !== "{"; )
240
+ u++;
241
+ if (u >= c.length) break;
242
+ const p = c.substring(h, u).trim();
243
243
  if (!p) {
244
- l++;
244
+ u++;
245
245
  continue;
246
246
  }
247
- const d = l + 1;
247
+ const d = u + 1;
248
248
  let g = 1;
249
- for (l++; l < c.length && g > 0; )
250
- c[l] === "{" ? g++ : c[l] === "}" && g--, l++;
251
- const v = c.substring(d, l - 1);
249
+ for (u++; u < c.length && g > 0; )
250
+ c[u] === "{" ? g++ : c[u] === "}" && g--, u++;
251
+ const v = c.substring(d, u - 1);
252
252
  f.push({
253
253
  type: "rule",
254
254
  selector: p,
@@ -259,20 +259,20 @@ function ht(n, e) {
259
259
  }, s = (c) => {
260
260
  const f = c.trim();
261
261
  return /^(from|to|\d+(\.\d+)?%)$/.test(f);
262
- }, r = (c) => c.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (f, l, h) => {
263
- const p = l.trim(), d = h.trim();
262
+ }, r = (c) => c.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (f, u, h) => {
263
+ const p = u.trim(), d = h.trim();
264
264
  return p ? `${p}[${e}] ${d}` : d;
265
265
  }), o = (c) => {
266
266
  const f = c.trim();
267
267
  if (!f || f.includes(`[${e}]`) || /^(:root|:host|html|body)(\s|$|:|\.|\#|\[)/.test(f) || s(f))
268
268
  return f;
269
- const l = f.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/);
270
- if (l) {
271
- const [, h, p = ""] = l, d = h.trim();
269
+ const u = f.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/);
270
+ if (u) {
271
+ const [, h, p = ""] = u, d = h.trim();
272
272
  return d ? `${d}[${e}]${p}` : f;
273
273
  }
274
274
  return `${f}[${e}]`;
275
- }, i = (c) => r(c).split(",").map((l) => o(l)).filter((l) => l.trim()).join(", "), a = (c) => c.map((f) => {
275
+ }, a = (c) => r(c).split(",").map((u) => o(u)).filter((u) => u.trim()).join(", "), i = (c) => c.map((f) => {
276
276
  switch (f.type) {
277
277
  case "simple-at-rule":
278
278
  return f.content;
@@ -280,7 +280,7 @@ function ht(n, e) {
280
280
  return f.content;
281
281
  case "at-rule":
282
282
  try {
283
- const h = t(f.inner), p = a(h);
283
+ const h = t(f.inner), p = i(h);
284
284
  return `${f.rule} { ${p} }`;
285
285
  } catch {
286
286
  return f.content;
@@ -288,23 +288,23 @@ function ht(n, e) {
288
288
  case "rule":
289
289
  if (!f.selector || !f.content)
290
290
  return "";
291
- const l = i(f.selector);
292
- return l.trim() ? `${l} { ${f.content} }` : "";
291
+ const u = a(f.selector);
292
+ return u.trim() ? `${u} { ${f.content} }` : "";
293
293
  default:
294
294
  return "";
295
295
  }
296
- }).filter((f) => f.trim()).join(" "), u = (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();
296
+ }).filter((f) => f.trim()).join(" "), l = (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
298
  const c = n.replace(/\/\*(?!\s*!)[\s\S]*?\*\//g, "").replace(/^\s+|\s+$/gm, "").replace(/\n\s*\n/g, `
299
- `), f = t(c), l = a(f);
300
- return u(l);
299
+ `), f = t(c), u = i(f);
300
+ return l(u);
301
301
  } catch (c) {
302
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
  (f) => f
305
305
  ).replace(/([^{}@]+)(?=\s*{)/g, (f) => {
306
- const l = f.trim();
307
- return !l || l.startsWith("@") || l.includes(`[${e}]`) || s(l) ? f : `${l}[${e}]`;
306
+ const u = f.trim();
307
+ return !u || u.startsWith("@") || u.includes(`[${e}]`) || s(u) ? f : `${u}[${e}]`;
308
308
  });
309
309
  }
310
310
  }
@@ -312,18 +312,18 @@ function Ie(n) {
312
312
  return C(n) ? n : JSON.stringify(n);
313
313
  }
314
314
  function fe(n, e, t, s = !1) {
315
- const r = n.CSSStyleSheet, o = s ? `data-v-${e}` : e, i = s ? ht(t, o) : t;
315
+ const r = n.CSSStyleSheet, o = s ? `data-v-${e}` : e, a = s ? ht(t, o) : t;
316
316
  if (r.prototype.replaceSync) {
317
- const a = new r();
318
- a.id = e, a.replaceSync(i);
319
- const u = n.document, c = u.adoptedStyleSheets, f = Array.from(c).filter(
320
- (l) => l.id !== e
317
+ const i = new r();
318
+ i.id = e, i.replaceSync(a);
319
+ const l = n.document, c = l.adoptedStyleSheets, f = Array.from(c).filter(
320
+ (u) => u.id !== e
321
321
  );
322
- u.adoptedStyleSheets = [...f, a];
322
+ l.adoptedStyleSheets = [...f, i];
323
323
  } else {
324
- const a = n.document;
325
- let u = a.getElementById(e);
326
- u ? u.innerHTML = i : (u = a.createElement("style"), u.id = e, u.innerHTML = i, a.head.appendChild(u));
324
+ const i = n.document;
325
+ let l = i.getElementById(e);
326
+ l ? l.innerHTML = a : (l = i.createElement("style"), l.id = e, l.innerHTML = a, i.head.appendChild(l));
327
327
  }
328
328
  }
329
329
  async function mt(n, e) {
@@ -334,26 +334,26 @@ function ke(n, e = window) {
334
334
  const t = e.document, s = e.document.head;
335
335
  for (const r of n)
336
336
  if (!t.getElementById(r)) {
337
- const i = t.createElement("link");
338
- i.rel = "stylesheet", i.id = r, i.href = r, s.appendChild(i);
337
+ const a = t.createElement("link");
338
+ a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
339
339
  }
340
340
  }
341
341
  async function Fe(n, e, t = window) {
342
342
  const s = t.document, r = t.document.head;
343
343
  let o = t[e];
344
- return o ? o.default || o : new Promise((i, a) => {
345
- for (const u of n) {
344
+ return o ? o.default || o : new Promise((a, i) => {
345
+ for (const l of n) {
346
346
  const c = s.createElement("script");
347
- c.src = u, c.onload = () => {
348
- o = t[e], o ? i(o.default || o) : a(null);
347
+ c.src = l, c.onload = () => {
348
+ o = t[e], o ? a(o.default || o) : i(null);
349
349
  }, c.onerror = (f) => {
350
- a(f);
350
+ i(f);
351
351
  }, r.appendChild(c);
352
352
  }
353
353
  });
354
354
  }
355
355
  function gt(n) {
356
- return q(n) || q(n?.install);
356
+ return L(n) || L(n?.install);
357
357
  }
358
358
  function vt(n) {
359
359
  return ct.includes(n);
@@ -377,13 +377,13 @@ function H(n, e, t = !1, s = !1, r = !1) {
377
377
  try {
378
378
  const o = ['"use strict";', "var __self = arguments[0];"];
379
379
  o.push("return ");
380
- let i = (n.value || "").trim();
381
- r || (i = i.replace(/this(\W|$)/g, (u, c) => `__self${c}`)), i = o.join(`
382
- `) + i;
383
- const a = r ? `
384
- ${i}
385
- ` : `with(${t ? "{}" : "$scope || {}"}) { ${i} }`;
386
- return new Function("$scope", a)(e);
380
+ let a = (n.value || "").trim();
381
+ r || (a = a.replace(/this(\W|$)/g, (l, c) => `__self${c}`)), a = o.join(`
382
+ `) + a;
383
+ const i = r ? `
384
+ ${a}
385
+ ` : `with(${t ? "{}" : "$scope || {}"}) { ${a} }`;
386
+ return new Function("$scope", i)(e);
387
387
  } catch (o) {
388
388
  if (F.error("parseExpression.error", o, n, e?.__self ?? e), s)
389
389
  throw o;
@@ -544,7 +544,7 @@ class pe {
544
544
  return t();
545
545
  {
546
546
  const { noPermissionMessage: s = "无权限访问", unauthorized: r = !1 } = this.options;
547
- return await this.showTip(s), q(r) ? (r(), t(!1)) : C(r) ? t(r) : t(!1);
547
+ return await this.showTip(s), L(r) ? (r(), t(!1)) : C(r) ? t(r) : t(!1);
548
548
  }
549
549
  }
550
550
  t(!1), await J(0), this.toLogin();
@@ -589,12 +589,12 @@ function Es(n = {}) {
589
589
  settings: s = {},
590
590
  Startup: r,
591
591
  access: o,
592
- useTitle: i,
593
- alert: a
592
+ useTitle: a,
593
+ alert: i
594
594
  } = n;
595
- let u = null;
595
+ let l = null;
596
596
  return {
597
- request: be({
597
+ request: Re({
598
598
  settings: {
599
599
  type: "form",
600
600
  validSuccess: !0,
@@ -606,24 +606,24 @@ function Es(n = {}) {
606
606
  e && e(f || "未知错误");
607
607
  },
608
608
  showLoading: () => {
609
- u && u.close(), t && (u = t());
609
+ l && l.close(), t && (l = t());
610
610
  },
611
611
  hideLoading: () => {
612
- u && (u.close(), u = null);
612
+ l && (l.close(), l = null);
613
613
  },
614
614
  ...s
615
615
  }
616
616
  }),
617
- jsonp: Re,
617
+ jsonp: be,
618
618
  notify: e,
619
619
  loading: t,
620
- useTitle: i,
621
- alert: a,
620
+ useTitle: a,
621
+ alert: i,
622
622
  startupComponent: r,
623
- access: o ? new pe({ alert: a, ...o }) : void 0
623
+ access: o ? new pe({ alert: i, ...o }) : void 0
624
624
  };
625
625
  }
626
- function bs(n = {}) {
626
+ function Rs(n = {}) {
627
627
  return new pe(n);
628
628
  }
629
629
  function $t(n, e) {
@@ -642,19 +642,19 @@ function $t(n, e) {
642
642
  headers: r
643
643
  }
644
644
  };
645
- return (i, a) => (delete o.data, s.send(Qe(o, a || {}, { data: i })));
645
+ return (a, i) => (delete o.data, s.send(Qe(o, i || {}, { data: a })));
646
646
  }
647
647
  }
648
648
  function jt(n, e) {
649
649
  const { metaQuery: t } = e;
650
650
  if (!t) return;
651
651
  const { code: s, queryCode: r } = n;
652
- return (o, i) => {
652
+ return (o, a) => {
653
653
  if (!t) {
654
654
  console.warn("adapter.metaQuery is not defined!");
655
655
  return;
656
656
  }
657
- return t(s, r, o, i);
657
+ return t(s, r, o, a);
658
658
  };
659
659
  }
660
660
  function Et(n = [], e = [], t) {
@@ -665,19 +665,19 @@ function Et(n = [], e = [], t) {
665
665
  s[r.id] = jt(r, t);
666
666
  return s;
667
667
  }
668
- async function bt(n = [], e = window) {
668
+ async function Rt(n = [], e = window) {
669
669
  const t = T(e);
670
670
  t && (Oe(e), n.forEach((s) => Pt(t, s)));
671
671
  }
672
- function Rt(n, e = window) {
672
+ function bt(n, e = window) {
673
673
  const t = S(n.mockTemplate) && n.mockTemplate.value ? E(n.mockTemplate, {}, !0) : void 0, s = T(e);
674
674
  return async (...r) => {
675
675
  let o = {};
676
676
  if (t)
677
677
  try {
678
678
  o = await t.apply(t, r);
679
- } catch (i) {
680
- F.warn("模拟数据模版异常", i);
679
+ } catch (a) {
680
+ F.warn("模拟数据模版异常", a);
681
681
  }
682
682
  return s?.mock(o);
683
683
  };
@@ -687,14 +687,14 @@ function Pt(n, e) {
687
687
  const { url: t, mockTemplate: s } = e;
688
688
  if (t && s)
689
689
  try {
690
- const r = se(t) ? new URL(t).pathname : t, o = We(`(.*)${r}(.*)`), i = Xe(r, { decode: decodeURIComponent }), a = H(s, {}, !0);
691
- n.mock(o, (u) => {
692
- const c = k.parse(u.url) || {}, f = u.body instanceof FormData ? Ye(u.body) : u.body, l = se(u.url) ? new URL(u.url).pathname : u.url.split("?")[0], h = i(l)?.params;
693
- Object.assign(u, { data: f, params: h, query: c });
690
+ const r = se(t) ? new URL(t).pathname : t, o = We(`(.*)${r}(.*)`), a = Xe(r, { decode: decodeURIComponent }), i = H(s, {}, !0);
691
+ n.mock(o, (l) => {
692
+ const c = k.parse(l.url) || {}, f = l.body instanceof FormData ? Ye(l.body) : l.body, u = se(l.url) ? new URL(l.url).pathname : l.url.split("?")[0], h = a(u)?.params;
693
+ Object.assign(l, { data: f, params: h, query: c });
694
694
  try {
695
- return n.mock(a(u));
695
+ return n.mock(i(l));
696
696
  } catch (p) {
697
- return console.warn("[mockApi]", o, u, p), null;
697
+ return console.warn("[mockApi]", o, l, p), null;
698
698
  }
699
699
  });
700
700
  } catch (r) {
@@ -811,33 +811,33 @@ function ie(n) {
811
811
  components: s = {},
812
812
  libs: r = {},
813
813
  apis: o = {},
814
- loader: i
815
- } = n, a = e.computed(() => n.dsl), u = {
814
+ loader: a
815
+ } = n, i = e.computed(() => n.dsl), l = {
816
816
  $components: s,
817
817
  $libs: r,
818
818
  $apis: o
819
819
  }, c = new Ct({
820
820
  mode: t,
821
- dsl: a.value,
822
- attrs: u
821
+ dsl: i.value,
822
+ attrs: l
823
823
  }), f = e.defineComponent({
824
- name: a.value.name,
825
- __scopeId: a.value.id ? `data-v-${a.value.id}` : void 0,
824
+ name: i.value.name,
825
+ __scopeId: i.value.id ? `data-v-${i.value.id}` : void 0,
826
826
  props: {
827
- ...It(a.value.props ?? [], c)
827
+ ...It(i.value.props ?? [], c)
828
828
  },
829
- setup(l) {
830
- c.$props = l, c.props = l, a.value.id && fe(
829
+ setup(u) {
830
+ c.$props = u, c.props = u, i.value.id && fe(
831
831
  n.window || window,
832
- a.value.id,
833
- a.value.css || "",
832
+ i.value.id,
833
+ i.value.css || "",
834
834
  !0
835
- ), c.state = kt(e, a.value.state ?? {}, c);
836
- const h = Ft(e, a.value.computed ?? {}, c), p = Mt(a.value.methods ?? {}, c), d = Ot(e, a.value.inject, c);
837
- for (const [m, b] of Object.entries(d || {}))
838
- d[m] = e.inject(m, b);
835
+ ), c.state = kt(e, i.value.state ?? {}, c);
836
+ const h = Ft(e, i.value.computed ?? {}, c), p = Mt(i.value.methods ?? {}, c), d = Ot(e, i.value.inject, c);
837
+ for (const [m, R] of Object.entries(d || {}))
838
+ d[m] = e.inject(m, R);
839
839
  const g = Dt(
840
- a.value.dataSources || {},
840
+ i.value.dataSources || {},
841
841
  c
842
842
  ), v = {
843
843
  ...d,
@@ -845,20 +845,20 @@ function ie(n) {
845
845
  ...p,
846
846
  ...g
847
847
  };
848
- return c.setup(v, e), Tt(e, a.value.watch ?? [], c), {
848
+ return c.setup(v, e), Tt(e, i.value.watch ?? [], c), {
849
849
  vtj: c
850
850
  };
851
851
  },
852
- emits: At(a.value.emits),
852
+ emits: At(i.value.emits),
853
853
  expose: ["vtj"],
854
854
  render() {
855
- if (!a.value.nodes) return null;
856
- const l = a.value.nodes || [];
857
- return l.length === 1 ? M(l[0], c, e, i, l) : l.map(
858
- (h) => M(h, c, e, i, l)
855
+ if (!i.value.nodes) return null;
856
+ const u = i.value.nodes || [];
857
+ return u.length === 1 ? M(u[0], c, e, a, u) : u.map(
858
+ (h) => M(h, c, e, a, u)
859
859
  );
860
860
  },
861
- ...Ht(a.value.lifeCycles ?? {}, c)
861
+ ...Ht(i.value.lifeCycles ?? {}, c)
862
862
  });
863
863
  return {
864
864
  renderer: e.markRaw(f),
@@ -912,10 +912,10 @@ function Mt(n, e) {
912
912
  function Ot(n, e = [], t) {
913
913
  return e.reduce(
914
914
  (s, r) => {
915
- const { name: o, from: i } = r || {};
915
+ const { name: o, from: a } = r || {};
916
916
  r.default;
917
- const a = j(i) ? t.__parseExpression(i) || o : i ?? o, u = j(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
918
- return s[o] = n.inject(a, u), s;
917
+ const i = j(a) ? t.__parseExpression(a) || o : a ?? o, l = j(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
918
+ return s[o] = n.inject(i, l), s;
919
919
  },
920
920
  {}
921
921
  );
@@ -925,12 +925,12 @@ function Dt(n, e) {
925
925
  (t, s) => {
926
926
  const r = n[s];
927
927
  if (r.type === "mock")
928
- t[s] = Rt(r);
928
+ t[s] = bt(r);
929
929
  else if (r.ref) {
930
- const o = e.$apis[r.ref], i = S(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
931
- t[s] = async (...a) => {
932
- const u = await o.apply(e, a);
933
- return i ? i(u) : u;
930
+ const o = e.$apis[r.ref], a = S(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
931
+ t[s] = async (...i) => {
932
+ const l = await o.apply(e, i);
933
+ return a ? a(l) : l;
934
934
  };
935
935
  }
936
936
  return t;
@@ -955,7 +955,7 @@ function Ht(n, e) {
955
955
  (t, [s, r]) => {
956
956
  const o = e.__parseFunction(r);
957
957
  return t[s] = async () => {
958
- await J(0), q(o) && o();
958
+ await J(0), L(o) && o();
959
959
  }, t;
960
960
  },
961
961
  {}
@@ -965,87 +965,87 @@ const De = new Ze();
965
965
  let Z = [], I = {};
966
966
  const xt = (n) => n;
967
967
  async function Te(n, e = window) {
968
- const { urls: t = [], library: s } = n, r = t.filter((a) => V(a));
968
+ const { urls: t = [], library: s } = n, r = t.filter((i) => V(i));
969
969
  if (r.length === 0 || !s) return null;
970
- const o = t.filter((a) => G(a));
970
+ const o = t.filter((i) => G(i));
971
971
  return o.length && ke(o, e), await Fe(r, s, e).catch(
972
- (a) => (console.warn("loadScriptUrl error", r, s, a), null)
972
+ (i) => (console.warn("loadScriptUrl error", r, s, i), null)
973
973
  );
974
974
  }
975
975
  function ae(n) {
976
976
  const { getDsl: e, getDslByUrl: t, options: s } = n;
977
977
  return s.window && (Z.forEach((r) => {
978
978
  delete s.window[r];
979
- }), Z = []), (r, o, i = z) => {
979
+ }), Z = []), (r, o, a = z) => {
980
980
  if (!o || typeof o == "string") return r;
981
981
  if (o.type === "Schema" && o.id)
982
- return i.defineAsyncComponent(async () => {
983
- const a = I[o.id] || await De.add(
982
+ return a.defineAsyncComponent(async () => {
983
+ const i = I[o.id] || await De.add(
984
984
  o.id,
985
985
  () => e(o.id)
986
986
  );
987
- return a && (a.name = r, I[o.id] = a), a ? ie({
987
+ return i && (i.name = r, I[o.id] = i), i ? ie({
988
988
  ...s,
989
- Vue: i,
990
- dsl: we(a),
989
+ Vue: a,
990
+ dsl: we(i),
991
991
  mode: y.Runtime,
992
992
  loader: ae(n)
993
993
  }).renderer : null;
994
994
  });
995
995
  if (o.type === "UrlSchema" && o.url)
996
- return i.defineAsyncComponent(async () => {
997
- const a = I[o.url] || await t(o.url);
998
- return a && (a.name = r, I[o.url] = a), a ? ie({
996
+ return a.defineAsyncComponent(async () => {
997
+ const i = I[o.url] || await t(o.url);
998
+ return i && (i.name = r, I[o.url] = i), i ? ie({
999
999
  ...s,
1000
- Vue: i,
1001
- dsl: we(a),
1000
+ Vue: a,
1001
+ dsl: we(i),
1002
1002
  mode: y.Runtime,
1003
1003
  loader: ae(n)
1004
1004
  }).renderer : null;
1005
1005
  });
1006
1006
  if (o.type === "Plugin") {
1007
- let a = o.library ? I[o.library] : null;
1008
- return a || (o.library && Z.push(o.library), a = I[o.library || Symbol()] = i.defineAsyncComponent(
1007
+ let i = o.library ? I[o.library] : null;
1008
+ return i || (o.library && Z.push(o.library), i = I[o.library || Symbol()] = a.defineAsyncComponent(
1009
1009
  async () => {
1010
- const u = await Te(o, s.window);
1011
- return u || (console.warn("getPlugin result is null", o), null);
1010
+ const l = await Te(o, s.window);
1011
+ return l || (console.warn("getPlugin result is null", o), null);
1012
1012
  }
1013
- ), a);
1013
+ ), i);
1014
1014
  }
1015
1015
  return r;
1016
1016
  };
1017
1017
  }
1018
- function Rs() {
1018
+ function bs() {
1019
1019
  I = {}, De.clearAllCache();
1020
1020
  }
1021
1021
  function M(n, e, t = z, s = xt, r = [], o = !1) {
1022
1022
  if (!n || !n.name || n.invisible) return null;
1023
- const i = t.getCurrentInstance()?.appContext, { id: a = null, directives: u = [] } = n, { vIf: c, vElseIf: f, vElse: l, vFor: h, vShow: p, vModels: d, vBind: g, vHtml: v, others: m } = He(u);
1024
- if (!o && (f || l))
1023
+ const a = t.getCurrentInstance()?.appContext, { id: i = null, directives: l = [] } = n, { vIf: c, vElseIf: f, vElse: u, vFor: h, vShow: p, vModels: d, vBind: g, vHtml: v, others: m } = He(l);
1024
+ if (!o && (f || u))
1025
1025
  return null;
1026
1026
  if (c && !Ut(c, e))
1027
1027
  return Jt(n, e, t, s, r);
1028
- const b = (_, x = 0) => {
1028
+ const R = (_, x = 0) => {
1029
1029
  const A = _.$components, Q = (() => {
1030
1030
  if (n.name === "component")
1031
1031
  return Nt(_, n.props?.is);
1032
1032
  if (n.name === "slot") return n.name;
1033
1033
  const $ = s(n.name, n.from, t);
1034
1034
  if (C($))
1035
- return vt($) || yt($) ? $ : A[$] ?? i?.app?.component($) ?? $;
1035
+ return vt($) || yt($) ? $ : A[$] ?? a?.app?.component($) ?? $;
1036
1036
  if (et($) && n.id) {
1037
1037
  const ge = `Loader${n.id}_${x}`, ve = A[ge];
1038
1038
  return ve || (A[ge] = $);
1039
1039
  }
1040
1040
  return $;
1041
- })(), R = Lt(a, n.props ?? {}, _), qe = qt(t, n.events ?? {}, _);
1041
+ })(), b = qt(i, n.props ?? {}, _), Le = Lt(t, n.events ?? {}, _);
1042
1042
  if (n.name === "slot")
1043
- return Kt(t, n, R, _, s);
1044
- g && Object.assign(R, _.__parseExpression(g.value)), p && (R.style = Object.assign(
1045
- R.style ?? {},
1043
+ return Kt(t, n, b, _, s);
1044
+ g && Object.assign(b, _.__parseExpression(g.value)), p && (b.style = Object.assign(
1045
+ b.style ?? {},
1046
1046
  Gt(p, _)
1047
- )), v && Object.assign(R, Vt(v, _)), d.forEach(($) => {
1048
- Object.assign(R, Qt(t, $, _));
1047
+ )), v && Object.assign(b, Vt(v, _)), d.forEach(($) => {
1048
+ Object.assign(b, Qt(t, $, _));
1049
1049
  });
1050
1050
  const Je = Wt(
1051
1051
  t,
@@ -1056,27 +1056,27 @@ function M(n, e, t = z, s = xt, r = [], o = !1) {
1056
1056
  ), he = _?.__id ? `data-v-${_.__id}` : void 0, Ke = he ? { [he]: "" } : {};
1057
1057
  let W = t.createVNode(
1058
1058
  Q,
1059
- { key: `${a}_${x}`, ...Ke, ...R, ...qe },
1059
+ { key: `${i}_${x}`, ...Ke, ...b, ...Le },
1060
1060
  Je
1061
1061
  );
1062
- const me = i ? Bt(i, m, _) : [];
1062
+ const me = a ? Bt(a, m, _) : [];
1063
1063
  return me.length && (W = t.withDirectives(W, me)), W;
1064
1064
  };
1065
- return h ? Zt(h, b, e) : b(e);
1065
+ return h ? Zt(h, R, e) : R(e);
1066
1066
  }
1067
1067
  function Bt(n, e, t) {
1068
1068
  const s = n.app;
1069
1069
  return e.map((r) => {
1070
1070
  const o = typeof r.name == "string" ? s.directive(r.name) : t.__parseExpression(r.name);
1071
1071
  if (!o) return null;
1072
- const i = [o];
1073
- return r.value && i.push(t.__parseExpression(r.value)), r.arg && i.push(r.arg), r.modifiers && i.push(r.modifiers), i;
1072
+ const a = [o];
1073
+ return r.value && a.push(t.__parseExpression(r.value)), r.arg && a.push(r.arg), r.modifiers && a.push(r.modifiers), a;
1074
1074
  }).filter((r) => !!r);
1075
1075
  }
1076
1076
  function He(n = []) {
1077
1077
  const e = n.find((f) => P(f.name) === "vIf"), t = n.find(
1078
1078
  (f) => P(f.name) === "vElseIf"
1079
- ), s = n.find((f) => P(f.name) === "vElse"), r = n.find((f) => P(f.name) === "vFor"), o = n.find((f) => P(f.name) === "vShow"), i = n.find((f) => P(f.name) === "vBind"), a = n.find((f) => P(f.name) === "vHtml"), u = n.filter(
1079
+ ), s = n.find((f) => P(f.name) === "vElse"), r = n.find((f) => P(f.name) === "vFor"), o = n.find((f) => P(f.name) === "vShow"), a = n.find((f) => P(f.name) === "vBind"), i = n.find((f) => P(f.name) === "vHtml"), l = n.filter(
1080
1080
  (f) => P(f.name) === "vModel"
1081
1081
  ), c = n.filter(
1082
1082
  (f) => !ot.includes(P(f.name))
@@ -1087,10 +1087,10 @@ function He(n = []) {
1087
1087
  vElse: s,
1088
1088
  vFor: r,
1089
1089
  vShow: o,
1090
- vModels: u,
1091
- vBind: i,
1090
+ vModels: l,
1091
+ vBind: a,
1092
1092
  others: c,
1093
- vHtml: a
1093
+ vHtml: i
1094
1094
  };
1095
1095
  }
1096
1096
  function Ut(n, e) {
@@ -1099,7 +1099,7 @@ function Ut(n, e) {
1099
1099
  function Nt(n, e) {
1100
1100
  return e ? j(e) ? n.__parseExpression(e) : e : "div";
1101
1101
  }
1102
- function Lt(n, e, t) {
1102
+ function qt(n, e, t) {
1103
1103
  const s = ce(e, t);
1104
1104
  return s.ref = t.__ref(n, s.ref), s;
1105
1105
  }
@@ -1112,31 +1112,31 @@ function ce(n, e) {
1112
1112
  {}
1113
1113
  ) : n;
1114
1114
  }
1115
- function qt(n, e, t) {
1115
+ function Lt(n, e, t) {
1116
1116
  const s = ["passive", "capture", "once"], r = {
1117
1117
  capture: "Capture",
1118
1118
  once: "Once",
1119
1119
  passive: "OnceCapture"
1120
1120
  };
1121
1121
  return Object.keys(e || {}).reduce(
1122
- (o, i) => {
1123
- const a = e[i], u = xe(a.modifiers), c = u.find((h) => s.includes(h)), f = "on" + tt(i) + (c && r[c] || ""), l = t.__parseFunction(a.handler);
1124
- return l && (o[f] = n.withModifiers(l, u)), o;
1122
+ (o, a) => {
1123
+ const i = e[a], l = xe(i.modifiers), c = l.find((h) => s.includes(h)), f = "on" + tt(a) + (c && r[c] || ""), u = t.__parseFunction(i.handler);
1124
+ return u && (o[f] = n.withModifiers(u, l)), o;
1125
1125
  },
1126
1126
  {}
1127
1127
  );
1128
1128
  }
1129
1129
  function Jt(n, e, t, s, r = []) {
1130
- let o = r.findIndex((i) => i.id === n.id);
1131
- for (let i = ++o; i < r.length; i++) {
1132
- const { directives: a = [] } = r[i], { vElseIf: u, vElse: c } = He(a);
1133
- if (u) {
1134
- if (e.__parseExpression(u.value))
1135
- return M(r[i], e, t, s, r, !0);
1130
+ let o = r.findIndex((a) => a.id === n.id);
1131
+ for (let a = ++o; a < r.length; a++) {
1132
+ const { directives: i = [] } = r[a], { vElseIf: l, vElse: c } = He(i);
1133
+ if (l) {
1134
+ if (e.__parseExpression(l.value))
1135
+ return M(r[a], e, t, s, r, !0);
1136
1136
  continue;
1137
1137
  }
1138
1138
  if (c)
1139
- return M(r[i], e, t, s, r, !0);
1139
+ return M(r[a], e, t, s, r, !0);
1140
1140
  }
1141
1141
  return null;
1142
1142
  }
@@ -1145,11 +1145,11 @@ function xe(n = {}, e = !1) {
1145
1145
  return e ? t.map((s) => "." + s) : t;
1146
1146
  }
1147
1147
  function Kt(n, e, t, s, r) {
1148
- const { children: o } = e, i = zt(e, s), a = s.$slots?.[i.name];
1149
- return a ? a(t) : o ? C(o) ? n.createTextVNode(o) : j(o) ? n.createTextVNode(
1148
+ const { children: o } = e, a = zt(e, s), i = s.$slots?.[a.name];
1149
+ return i ? i(t) : o ? C(o) ? n.createTextVNode(o) : j(o) ? n.createTextVNode(
1150
1150
  Ie(s.__parseExpression(o))
1151
1151
  ) : Array.isArray(o) ? o.map(
1152
- (u) => M(u, s, n, r, o)
1152
+ (l) => M(l, s, n, r, o)
1153
1153
  ) : null : null;
1154
1154
  }
1155
1155
  function zt(n, e) {
@@ -1177,10 +1177,10 @@ function Qt(n, e, t) {
1177
1177
  }` : "(v) => {}"
1178
1178
  }, r = t.__parseFunction(s), o = xe(
1179
1179
  j(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
1180
- ), i = j(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
1180
+ ), a = j(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
1181
1181
  return {
1182
- [i]: t.__parseExpression(e.value),
1183
- [`onUpdate:${i}`]: o.length && r ? n.withModifiers(r, o) : r
1182
+ [a]: t.__parseExpression(e.value),
1183
+ [`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
1184
1184
  };
1185
1185
  }
1186
1186
  function Wt(n, e, t, s, r) {
@@ -1192,18 +1192,18 @@ function Wt(n, e, t, s, r) {
1192
1192
  default: () => Ie(t.__parseExpression(e))
1193
1193
  };
1194
1194
  if (Array.isArray(e) && e.length > 0) {
1195
- const o = Xt(e), i = (a, u) => !a || !r ? {} : r?.id && Object.keys(a).length ? u ? {
1196
- [u]: a
1195
+ const o = Xt(e), a = (i, l) => !i || !r ? {} : r?.id && Object.keys(i).length ? l ? {
1196
+ [l]: i
1197
1197
  } : {
1198
- [`scope_${r.id}`]: a
1199
- } : u ? { [u]: /* @__PURE__ */ Object.create(null) } : {};
1198
+ [`scope_${r.id}`]: i
1199
+ } : l ? { [l]: /* @__PURE__ */ Object.create(null) } : {};
1200
1200
  return Object.entries(o).reduce(
1201
- (a, [u, { nodes: c, params: f, scope: l }]) => (a[u] = (h) => {
1202
- const p = f.length ? st(h ?? {}, f) : i(h, l);
1201
+ (i, [l, { nodes: c, params: f, scope: u }]) => (i[l] = (h) => {
1202
+ const p = f.length ? st(h ?? {}, f) : a(h, u);
1203
1203
  return c.map(
1204
1204
  (d) => M(d, t.__clone(p), n, s, c)
1205
1205
  );
1206
- }, a),
1206
+ }, i),
1207
1207
  {}
1208
1208
  );
1209
1209
  }
@@ -1225,9 +1225,9 @@ function Yt(n = "default") {
1225
1225
  return C(n) ? { name: n, params: [], scope: "" } : { params: [], scope: "", ...n };
1226
1226
  }
1227
1227
  function Zt(n, e, t) {
1228
- const { value: s, iterator: r } = n, { item: o = "item", index: i = "index" } = r || {};
1229
- let a = t.__parseExpression(s) || [];
1230
- return Number.isInteger(a) && (a = new Array(a).fill(!0).map((u, c) => c + 1)), Array.isArray(a) ? a.map((u, c) => e(t.__clone({ [o]: u, [i]: c }), c)) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
1228
+ const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
1229
+ let i = t.__parseExpression(s) || [];
1230
+ return Number.isInteger(i) && (i = new Array(i).fill(!0).map((l, c) => c + 1)), Array.isArray(i) ? i.map((l, c) => e(t.__clone({ [o]: l, [a]: c }), c)) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
1231
1231
  }
1232
1232
  const ee = Ce({
1233
1233
  name: "VtjPageContainer",
@@ -1235,8 +1235,8 @@ const ee = Ce({
1235
1235
  const n = Ne(), e = Ae(), t = e.meta.__vtj__ || e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = oe(Symbol());
1236
1236
  if (s) {
1237
1237
  Object.assign(e.meta, s.meta || {}, { cache: s.cache });
1238
- const { useTitle: i } = n?.adapter;
1239
- i && i(s.title || "VTJ");
1238
+ const { useTitle: a } = n?.adapter;
1239
+ a && a(s.title || "VTJ");
1240
1240
  }
1241
1241
  return {
1242
1242
  provider: n,
@@ -1264,20 +1264,20 @@ const ee = Ce({
1264
1264
  function K(n, e, t = []) {
1265
1265
  const s = [];
1266
1266
  for (const r of t) {
1267
- const { id: o, title: i, icon: a, children: u, hidden: c, layout: f } = r;
1267
+ const { id: o, title: a, icon: i, children: l, hidden: c, layout: f } = r;
1268
1268
  if (f) {
1269
- const l = K(n, e, u || []);
1270
- s.push(...l);
1269
+ const u = K(n, e, l || []);
1270
+ s.push(...u);
1271
1271
  } else {
1272
- const l = {
1272
+ const u = {
1273
1273
  id: o,
1274
- title: i,
1275
- icon: a,
1274
+ title: a,
1275
+ icon: i,
1276
1276
  hidden: c,
1277
1277
  url: `${n}/${e}/${o}`,
1278
- children: u && u.length ? K(n, e, u) : void 0
1278
+ children: l && l.length ? K(n, e, l) : void 0
1279
1279
  };
1280
- s.push(l);
1280
+ s.push(u);
1281
1281
  }
1282
1282
  }
1283
1283
  return s;
@@ -1298,8 +1298,8 @@ function Ps(n) {
1298
1298
  menuPathPrefix: e = "",
1299
1299
  pageRouteName: t = "page",
1300
1300
  disableMenusFilter: s = !1
1301
- } = n || {}, r = Ne(), o = Ae(), i = St(), a = oe(!1), u = oe(!1), c = r.project, f = (p, d) => {
1302
- a.value = !p?.mask, u.value = d?.pure ?? !!p?.pure;
1301
+ } = n || {}, r = Ne(), o = Ae(), a = St(), i = oe(!1), l = oe(!1), c = r.project, f = (p, d) => {
1302
+ i.value = !p?.mask, l.value = d?.pure ?? !!p?.pure;
1303
1303
  };
1304
1304
  rt(() => {
1305
1305
  const { name: p, params: d, meta: g } = o;
@@ -1315,32 +1315,32 @@ function Ps(n) {
1315
1315
  const m = r.getPage(v);
1316
1316
  f(m, g);
1317
1317
  } else
1318
- a.value = !g.mask, u.value = !!g.pure;
1318
+ i.value = !g.mask, l.value = !!g.pure;
1319
1319
  }
1320
1320
  });
1321
- const l = K(
1321
+ const u = K(
1322
1322
  e,
1323
1323
  t,
1324
1324
  c?.pages
1325
1325
  ), h = c?.config;
1326
1326
  return {
1327
- disabled: a,
1327
+ disabled: i,
1328
1328
  logo: h?.logo,
1329
1329
  themeSwitchable: h?.themeSwitchable,
1330
1330
  title: h?.title || c?.description || c?.name || "VTJ App",
1331
- menus: s ? l : Be(l, i),
1332
- pure: u
1331
+ menus: s ? u : Be(u, a),
1332
+ pure: l
1333
1333
  };
1334
1334
  }
1335
1335
  function te(n, e) {
1336
- const { id: t, title: s, meta: r } = n, { name: o = "page", prefix: i = "", component: a, routeMeta: u } = e;
1336
+ const { id: t, title: s, meta: r } = n, { name: o = "page", prefix: a = "", component: i, routeMeta: l } = e;
1337
1337
  return {
1338
1338
  name: t,
1339
- path: `${i}${o}/${t}`,
1340
- component: a,
1339
+ path: `${a}${o}/${t}`,
1340
+ component: i,
1341
1341
  meta: {
1342
1342
  title: s,
1343
- ...u,
1343
+ ...l,
1344
1344
  ...r,
1345
1345
  __vtj__: t
1346
1346
  }
@@ -1353,29 +1353,29 @@ function le(n) {
1353
1353
  pages: s = [],
1354
1354
  component: r,
1355
1355
  loader: o,
1356
- routeMeta: i,
1357
- homepage: a
1358
- } = n, u = [];
1356
+ routeMeta: a,
1357
+ homepage: i
1358
+ } = n, l = [];
1359
1359
  for (const c of s) {
1360
- const { id: f, title: l, dir: h, layout: p, children: d, meta: g } = c;
1360
+ const { id: f, title: u, dir: h, layout: p, children: d, meta: g } = c;
1361
1361
  if (h) {
1362
1362
  const v = le({
1363
1363
  name: e,
1364
1364
  prefix: t,
1365
1365
  component: r,
1366
- routeMeta: i,
1367
- homepage: a,
1366
+ routeMeta: a,
1367
+ homepage: i,
1368
1368
  loader: o,
1369
1369
  pages: d || []
1370
1370
  });
1371
- u.push(...v);
1371
+ l.push(...v);
1372
1372
  } else if (p) {
1373
1373
  const v = le({
1374
1374
  name: e,
1375
1375
  prefix: t,
1376
1376
  component: r,
1377
- routeMeta: i,
1378
- homepage: a,
1377
+ routeMeta: a,
1378
+ homepage: i,
1379
1379
  loader: o,
1380
1380
  pages: d || []
1381
1381
  }), m = {
@@ -1383,24 +1383,24 @@ function le(n) {
1383
1383
  path: t,
1384
1384
  component: () => o(f),
1385
1385
  meta: {
1386
- title: l,
1387
- ...i,
1386
+ title: u,
1387
+ ...a,
1388
1388
  ...g,
1389
1389
  __vtj__: f
1390
1390
  },
1391
1391
  children: v
1392
1392
  };
1393
- u.push(m), u.push(te(c, n));
1394
- } else if (u.push(te(c, n)), a === f) {
1393
+ l.push(m), l.push(te(c, n));
1394
+ } else if (l.push(te(c, n)), i === f) {
1395
1395
  const v = te(c, n);
1396
- v.path = "", v.name = `home_${f}`, u.push(v);
1396
+ v.path = "", v.name = `home_${f}`, l.push(v);
1397
1397
  }
1398
1398
  }
1399
- return u;
1399
+ return l;
1400
1400
  }
1401
1401
  function ts(n = {}, e) {
1402
- const { css: t, store: s, enhance: r } = n, { window: o, app: i, library: a = {}, adapter: u, mode: c } = e, { Pinia: f } = a;
1403
- fe(o, "global-css", t || ""), f && s && ss(s, i, f), rs(i, u, n), !u.access && n.access && ns(n.access, i, c, u), os(i, n), r && is(r, i, a);
1402
+ const { css: t, store: s, enhance: r } = n, { window: o, app: a, library: i = {}, adapter: l, mode: c } = e, { Pinia: f } = i;
1403
+ a.config.globalProperties.$libs = i, fe(o, "global-css", t || ""), f && s && ss(s, a, f), rs(a, l, n), !l.access && n.access && ns(n.access, a, c, l), os(a, n), r && is(r, a, i);
1404
1404
  }
1405
1405
  function ss(n, e, t) {
1406
1406
  const s = t.createPinia();
@@ -1411,39 +1411,39 @@ function ss(n, e, t) {
1411
1411
  }
1412
1412
  function ns(n, e, t, s) {
1413
1413
  if (S(n) && n.value) {
1414
- const r = E(n, {}, !1, !1, !0), { alert: o, request: i } = s, a = new pe({
1414
+ const r = E(n, {}, !1, !1, !0), { alert: o, request: a } = s, i = new pe({
1415
1415
  alert: o,
1416
1416
  storagePrefix: "__VTJ_APP_",
1417
1417
  ...r(e)
1418
- }), u = e.config.globalProperties.$router;
1419
- a.connect({ mode: t, router: u, request: i }), e.use(a);
1418
+ }), l = e.config.globalProperties.$router;
1419
+ i.connect({ mode: t, router: l, request: a }), e.use(i);
1420
1420
  }
1421
1421
  }
1422
1422
  function rs(n, e, t) {
1423
1423
  if (!e.request) return;
1424
1424
  const { axios: s, request: r, response: o } = t;
1425
1425
  if (s && S(s) && s.value) {
1426
- const i = E(s, {}, !1, !1, !0);
1427
- e.request.setConfig(i(n));
1426
+ const a = E(s, {}, !1, !1, !0);
1427
+ e.request.setConfig(a(n));
1428
1428
  }
1429
1429
  if (r && S(r) && r.value) {
1430
- const i = E(r, {}, !1, !1, !0);
1431
- e.request.useRequest((a) => i(a, n));
1430
+ const a = E(r, {}, !1, !1, !0), i = e.request;
1431
+ i.__unReq && i.__unReq(), i.__unReq = e.request.useRequest((l) => a(l, n));
1432
1432
  }
1433
1433
  if (o && S(o) && o.value) {
1434
- const i = E(o, {}, !1, !1, !0);
1435
- e.request.useResponse((a) => i(a, n));
1434
+ const a = E(o, {}, !1, !1, !0), i = e.request;
1435
+ i.__unRes && i.__unRes(), i.__unRes = e.request.useResponse((l) => a(l, n));
1436
1436
  }
1437
1437
  }
1438
1438
  function os(n, e) {
1439
1439
  const { beforeEach: t, afterEach: s } = e, r = n.config.globalProperties.$router;
1440
1440
  if (t && S(t) && t.value) {
1441
1441
  const o = E(t, {}, !1, !1, !0);
1442
- r && r.beforeEach((i, a, u) => o(i, a, u, n));
1442
+ r && r.beforeEach((a, i, l) => o(a, i, l, n));
1443
1443
  }
1444
1444
  if (s && S(s) && s.value) {
1445
1445
  const o = E(s, {}, !1, !1, !0);
1446
- r && r.afterEach((i, a, u) => o(i, a, u, n));
1446
+ r && r.afterEach((a, i, l) => o(a, i, l, n));
1447
1447
  }
1448
1448
  }
1449
1449
  function is(n, e, t = {}) {
@@ -1453,19 +1453,19 @@ function as(n, e, t) {
1453
1453
  if (!n || !e || !t) return;
1454
1454
  const { VueI18n: s } = e;
1455
1455
  if (s) {
1456
- const { locale: r, fallbackLocale: o, messages: i = [] } = t, a = {};
1457
- for (let c of i) {
1458
- const f = Object.keys(c).filter((l) => l !== "key");
1459
- for (const l of f)
1460
- a[l] || (a[l] = {}), a[l][c.key] = c[l];
1456
+ const { locale: r, fallbackLocale: o, messages: a = [] } = t, i = {};
1457
+ for (let c of a) {
1458
+ const f = Object.keys(c).filter((u) => u !== "key");
1459
+ for (const u of f)
1460
+ i[u] || (i[u] = {}), i[u][c.key] = c[u];
1461
1461
  }
1462
- const u = s.createI18n({
1462
+ const l = s.createI18n({
1463
1463
  legacy: !1,
1464
1464
  locale: r,
1465
1465
  fallbackLocale: o,
1466
- messages: a
1466
+ messages: i
1467
1467
  });
1468
- n.use(u);
1468
+ n.use(l);
1469
1469
  }
1470
1470
  }
1471
1471
  const Ue = Symbol("Provider");
@@ -1483,18 +1483,18 @@ class ls extends ze {
1483
1483
  mode: s = y.Raw,
1484
1484
  dependencies: r,
1485
1485
  materials: o,
1486
- project: i = {},
1487
- adapter: a = {},
1488
- globals: u = {},
1486
+ project: a = {},
1487
+ adapter: i = {},
1488
+ globals: l = {},
1489
1489
  modules: c = {},
1490
1490
  router: f = null,
1491
- materialPath: l = "./",
1491
+ materialPath: u = "./",
1492
1492
  nodeEnv: h = "development"
1493
1493
  /* Development */
1494
1494
  } = e;
1495
- this.mode = s, this.modules = c, this.service = t, this.router = f, this.materialPath = l, this.nodeEnv = h, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, u), Object.assign(this.adapter, a);
1495
+ this.mode = s, this.modules = c, this.service = t, this.router = f, this.materialPath = u, this.nodeEnv = h, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, i);
1496
1496
  const { access: p, request: d } = this.adapter;
1497
- p && p.connect({ mode: s, router: f, request: d }), i && s !== y.Design ? this.load(i) : this.project = i;
1497
+ p && p.connect({ mode: s, router: f, request: d }), a && s !== y.Design ? this.load(a) : this.project = a;
1498
1498
  }
1499
1499
  mode;
1500
1500
  // 当前运行模式(设计/源码/预览等)
@@ -1502,7 +1502,7 @@ class ls extends ze {
1502
1502
  // 全局变量
1503
1503
  modules = {};
1504
1504
  // 异步模块加载器
1505
- adapter = { request: ne, jsonp: Re };
1505
+ adapter = { request: ne, jsonp: be };
1506
1506
  // 适配器接口
1507
1507
  apis = {};
1508
1508
  // API集合
@@ -1550,8 +1550,8 @@ class ls extends ze {
1550
1550
  const { vtjDir: t = ".vtj" } = this.options, s = this.modules[`${t}/projects/${e.id}.json`] || this.modules[`/src/${t}/projects/${e.id}.json`];
1551
1551
  if (this.project = s ? await s() : await this.service.init(e), !this.project)
1552
1552
  throw new Error("project is null");
1553
- const { apis: r = [], meta: o = [] } = this.project, i = window;
1554
- i && (i.CKEDITOR_VERSION = void 0), this.mode === y.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.initMock(i), this.apis = Et(r, o, this.adapter), Oe(i), bt(r, i), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
1553
+ const { apis: r = [], meta: o = [] } = this.project, a = window;
1554
+ a && (a.CKEDITOR_VERSION = void 0), this.mode === y.Raw ? await this.loadDependencies(a) : await this.loadAssets(a), this.initMock(a), this.apis = Et(r, o, this.adapter), Oe(a), Rt(r, a), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
1555
1555
  }
1556
1556
  initMock(e) {
1557
1557
  const t = T(e);
@@ -1565,19 +1565,19 @@ class ls extends ze {
1565
1565
  e[s] || (e[s] = this.library[s] = await r());
1566
1566
  }
1567
1567
  async loadAssets(e) {
1568
- const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath: i, nodeEnv: a } = this, {
1569
- libraryExports: u,
1568
+ const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
1569
+ libraryExports: l,
1570
1570
  libraryMap: c,
1571
1571
  materials: f,
1572
- materialExports: l,
1572
+ materialExports: u,
1573
1573
  materialMapLibrary: h
1574
1574
  } = ft(
1575
1575
  t,
1576
- i,
1577
- a === "development"
1576
+ a,
1577
+ i === "development"
1578
1578
  /* Development */
1579
1579
  );
1580
- for (const p of u) {
1580
+ for (const p of l) {
1581
1581
  const d = s[p], g = e[p];
1582
1582
  if (g)
1583
1583
  r[p] = g;
@@ -1590,11 +1590,11 @@ class ls extends ze {
1590
1590
  r[p] = e[p];
1591
1591
  }
1592
1592
  }
1593
- if (a === "development") {
1593
+ if (i === "development") {
1594
1594
  for (const d of f)
1595
1595
  await Se(k.append(d, { v: O }));
1596
1596
  const p = this.materials || {};
1597
- for (const d of l) {
1597
+ for (const d of u) {
1598
1598
  const g = e[h[d]], v = Ge[d];
1599
1599
  if (v)
1600
1600
  g && v.forEach((m) => {
@@ -1602,8 +1602,8 @@ class ls extends ze {
1602
1602
  });
1603
1603
  else {
1604
1604
  const m = p[d] ? (await p[d]()).default : e[d];
1605
- m && g && (m.components || []).forEach((b) => {
1606
- o[b.name] = pt(b, g);
1605
+ m && g && (m.components || []).forEach((R) => {
1606
+ o[R.name] = pt(R, g);
1607
1607
  });
1608
1608
  }
1609
1609
  }
@@ -1613,33 +1613,33 @@ class ls extends ze {
1613
1613
  const { router: e, project: t, options: s, adapter: r } = this;
1614
1614
  if (!e) return;
1615
1615
  const o = t?.platform === "uniapp" ? "pages" : "page", {
1616
- routeAppendTo: i,
1617
- pageRouteName: a = o,
1618
- routeMeta: u
1619
- } = s, c = i ? "" : "/", f = {
1620
- path: `${c}${a}/:id`,
1616
+ routeAppendTo: a,
1617
+ pageRouteName: i = o,
1618
+ routeMeta: l
1619
+ } = s, c = a ? "" : "/", f = {
1620
+ path: `${c}${i}/:id`,
1621
1621
  name: D,
1622
1622
  component: ee
1623
- }, l = {
1623
+ }, u = {
1624
1624
  path: c,
1625
1625
  name: N,
1626
1626
  component: t?.homepage ? ee : r.startupComponent || es,
1627
- meta: u
1627
+ meta: l
1628
1628
  };
1629
1629
  if (e.hasRoute(D) && e.removeRoute(D), e.hasRoute(N) && e.removeRoute(N), s.enableStaticRoute) {
1630
1630
  const h = t?.pages || [];
1631
1631
  le({
1632
- name: a,
1632
+ name: i,
1633
1633
  prefix: c,
1634
1634
  pages: h,
1635
1635
  component: ee,
1636
1636
  loader: this.getRenderComponent.bind(this),
1637
1637
  homepage: t?.homepage
1638
1638
  }).forEach((d) => {
1639
- i ? e.addRoute(i, d) : e.addRoute(d);
1640
- }), t?.homepage || (i ? e.addRoute(i, l) : e.addRoute(l));
1639
+ a ? e.addRoute(a, d) : e.addRoute(d);
1640
+ }), t?.homepage || (a ? e.addRoute(a, u) : e.addRoute(u));
1641
1641
  } else
1642
- i ? (e.addRoute(i, f), e.addRoute(i, l)) : (e.addRoute(f), e.addRoute(l));
1642
+ a ? (e.addRoute(a, f), e.addRoute(a, u)) : (e.addRoute(f), e.addRoute(u));
1643
1643
  }
1644
1644
  /**
1645
1645
  * Vue 插件安装方法
@@ -1662,7 +1662,7 @@ class ls extends ze {
1662
1662
  library: this.library,
1663
1663
  mode: this.mode
1664
1664
  }), this.mode !== y.Design && this.project?.i18n && this.initI18n(e, this.library, this.project.i18n), e.provide(Ue, this), e.config.globalProperties.$provider = this, this.options.enhance && e.use(this.options.enhance, this), this.mode === y.Design && (e.config.errorHandler = (s, r, o) => {
1665
- const i = r?.$options.name, a = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", u = `[ ${i} ] ${a} ${o}`;
1665
+ const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", l = `[ ${a} ] ${i} ${o}`;
1666
1666
  console.error(
1667
1667
  "[VTJ Error]:",
1668
1668
  {
@@ -1671,7 +1671,7 @@ class ls extends ze {
1671
1671
  info: o
1672
1672
  },
1673
1673
  s?.stack
1674
- ), this.adapter.notify && this.adapter.notify(u, "组件渲染错误", "error");
1674
+ ), this.adapter.notify && this.adapter.notify(l, "组件渲染错误", "error");
1675
1675
  }), e.config.globalProperties.installed = t;
1676
1676
  }
1677
1677
  getFile(e) {
@@ -1680,13 +1680,13 @@ class ls extends ze {
1680
1680
  }
1681
1681
  getPage(e) {
1682
1682
  const { pages: t = [] } = this.project || {}, s = (r, o = []) => {
1683
- for (const i of o) {
1684
- if (i.id === r)
1685
- return i;
1686
- if (i.children && i.children.length) {
1687
- const a = s(r, i.children);
1688
- if (a)
1689
- return a;
1683
+ for (const a of o) {
1684
+ if (a.id === r)
1685
+ return a;
1686
+ if (a.children && a.children.length) {
1687
+ const i = s(r, a.children);
1688
+ if (i)
1689
+ return i;
1690
1690
  }
1691
1691
  }
1692
1692
  };
@@ -1724,23 +1724,23 @@ class ls extends ze {
1724
1724
  * @returns 渲染器实例
1725
1725
  */
1726
1726
  createDslRenderer(e, t = {}) {
1727
- const { library: s, components: r, mode: o, apis: i } = this, a = {
1727
+ const { library: s, components: r, mode: o, apis: a } = this, i = {
1728
1728
  mode: o,
1729
1729
  Vue: s.Vue,
1730
1730
  components: r,
1731
1731
  libs: s,
1732
- apis: i,
1732
+ apis: a,
1733
1733
  window,
1734
1734
  ...t
1735
- }, u = ae({
1735
+ }, l = ae({
1736
1736
  getDsl: async (c) => await this.getDsl(c) || null,
1737
1737
  getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
1738
- options: a
1738
+ options: i
1739
1739
  });
1740
1740
  return ie({
1741
- ...a,
1741
+ ...i,
1742
1742
  dsl: e,
1743
- loader: u
1743
+ loader: l
1744
1744
  });
1745
1745
  }
1746
1746
  /**
@@ -1758,8 +1758,8 @@ class ls extends ze {
1758
1758
  if (!s)
1759
1759
  return F.warn(`Can not find file: ${e}`), null;
1760
1760
  if (t && t(s), this.mode === y.Raw) {
1761
- const { vtjRawDir: o = ".vtj/vue" } = this.options, i = `${o}/${e}.vue`, a = this.modules[i] || this.modules[`/src/pages/${e}.vue`];
1762
- return a ? (await a())?.default : this.nodeEnv === "development" && this.adapter.startupComponent || null;
1761
+ const { vtjRawDir: o = ".vtj/vue" } = this.options, a = `${o}/${e}.vue`, i = this.modules[a] || this.modules[`/src/pages/${e}.vue`];
1762
+ return i ? (await i())?.default : this.nodeEnv === "development" && this.adapter.startupComponent || null;
1763
1763
  }
1764
1764
  const r = await this.getDsl(s.id);
1765
1765
  return r ? this.createDslRenderer(r).renderer : (F.warn(`Can not find dsl: ${e}`), null);
@@ -1833,14 +1833,14 @@ function Ne(n = {}) {
1833
1833
  return e;
1834
1834
  }
1835
1835
  async function As(n, e = "") {
1836
- const { name: t, urls: s = [] } = n || {}, r = s.map((a) => e + a), { css: o, js: i } = dt(r);
1837
- if (o.length && ke(o), i.length)
1838
- return await Fe(i, t).catch(
1836
+ const { name: t, urls: s = [] } = n || {}, r = s.map((i) => e + i), { css: o, js: a } = dt(r);
1837
+ if (o.length && ke(o), a.length)
1838
+ return await Fe(a, t).catch(
1839
1839
  () => {
1840
1840
  }
1841
1841
  );
1842
1842
  }
1843
- const Le = {
1843
+ const qe = {
1844
1844
  type: "json",
1845
1845
  validSuccess: !0,
1846
1846
  originResponse: !1,
@@ -1855,7 +1855,7 @@ const Le = {
1855
1855
  type: t,
1856
1856
  data: s
1857
1857
  },
1858
- settings: Le
1858
+ settings: qe
1859
1859
  }), fs = (n, e = "/__vtj__/api/uploader.json") => async (t, s) => await n.send({
1860
1860
  url: e,
1861
1861
  method: "post",
@@ -1864,12 +1864,12 @@ const Le = {
1864
1864
  projectId: s
1865
1865
  },
1866
1866
  settings: {
1867
- ...Le,
1867
+ ...qe,
1868
1868
  type: "data"
1869
1869
  }
1870
1870
  }).then((r) => r && r[0] ? r[0] : null).catch(() => null);
1871
1871
  function Is(n) {
1872
- return be({
1872
+ return Re({
1873
1873
  settings: {
1874
1874
  type: "json",
1875
1875
  validSuccess: !0,
@@ -1991,11 +1991,11 @@ const w = new nt({
1991
1991
  });
1992
1992
  class ks extends de {
1993
1993
  init(e) {
1994
- const t = new L(e), s = w.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1994
+ const t = new q(e), s = w.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1995
1995
  return w.save(`project_${t.id}`, r), Promise.resolve(r);
1996
1996
  }
1997
1997
  saveProject(e) {
1998
- const t = new L(e);
1998
+ const t = new q(e);
1999
1999
  return w.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
2000
2000
  }
2001
2001
  saveMaterials(e, t) {
@@ -2046,11 +2046,11 @@ class ps extends de {
2046
2046
  histories = {};
2047
2047
  historyItems = {};
2048
2048
  init(e) {
2049
- const t = new L(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
2049
+ const t = new q(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
2050
2050
  return this.projects[r.id] = r, Promise.resolve(r);
2051
2051
  }
2052
2052
  saveProject(e) {
2053
- const t = new L(e);
2053
+ const t = new q(e);
2054
2054
  return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
2055
2055
  }
2056
2056
  saveMaterials(e, t) {
@@ -2181,9 +2181,9 @@ export {
2181
2181
  ks as StorageService,
2182
2182
  O as VTJ_RENDERER_VERSION,
2183
2183
  fe as adoptedStyleSheets,
2184
- Rs as clearLoaderCache,
2184
+ bs as clearLoaderCache,
2185
2185
  ht as compileScopedCSS,
2186
- bs as createAccess,
2186
+ Rs as createAccess,
2187
2187
  Es as createAdapter,
2188
2188
  ws as createAssetScripts,
2189
2189
  Ss as createAssetsCss,
@@ -2192,7 +2192,7 @@ export {
2192
2192
  Fs as createMemoryService,
2193
2193
  K as createMenus,
2194
2194
  jt as createMetaApi,
2195
- Rt as createMock,
2195
+ bt as createMock,
2196
2196
  Cs as createProvider,
2197
2197
  ie as createRenderer,
2198
2198
  $t as createSchemaApi,
@@ -2219,7 +2219,7 @@ export {
2219
2219
  Fe as loadScriptUrl,
2220
2220
  Be as menusFilter,
2221
2221
  Pt as mockApi,
2222
- bt as mockApis,
2222
+ Rt as mockApis,
2223
2223
  Oe as mockCleanup,
2224
2224
  M as nodeRender,
2225
2225
  ft as parseDeps,