@vtj/renderer 0.9.22 → 0.9.23

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,19 +1,19 @@
1
- import { Base as Ae, BUILT_IN_COMPONENTS as Ie, ProjectModel as H, HistoryModel as ue } from "@vtj/core";
2
- import { isUrl as Me, url as R, dedupArray as De, isString as j, isFunction as V, logger as x, storage as U, cookie as L, toArray as re, unRSA as oe, delay as de, createRequest as pe, jsonp as fe, merge as He, pathToRegexp as Oe, pathToRegexpMatch as Be, formDataToJson as Ne, camelCase as $, upperFirst as Ue, pick as Le, request as z, loadScript as ie, Storage as qe, mapToObject as Q } from "@vtj/utils";
3
- import * as B from "vue";
4
- import { inject as he, toRef as Je, readonly as Ve, customRef as ze, ref as F, onBeforeUnmount as Ke, getCurrentScope as We, onScopeDispose as Ge, unref as Ye, getCurrentInstance as me, watch as ge, computed as ve, onMounted as Qe, defineComponent as X, h as K, openBlock as Xe, createElementBlock as Ze, createElementVNode as E, toDisplayString as q, defineAsyncComponent as ae, watchEffect as et } from "vue";
1
+ import { Base as Ie, BUILT_IN_COMPONENTS as Me, ProjectModel as O, HistoryModel as de } from "@vtj/core";
2
+ import { isUrl as De, url as x, dedupArray as He, isString as j, isFunction as z, logger as P, storage as L, cookie as q, toArray as ie, unRSA as oe, delay as pe, createRequest as fe, jsonp as he, merge as Oe, pathToRegexp as Be, pathToRegexpMatch as Ne, formDataToJson as Ue, camelCase as $, upperFirst as Le, pick as qe, request as K, loadScript as ae, Storage as Je, mapToObject as X } from "@vtj/utils";
3
+ import * as N from "vue";
4
+ import { inject as me, toRef as Ve, readonly as ze, customRef as Ke, ref as T, onBeforeUnmount as We, getCurrentScope as Ge, onScopeDispose as Ye, unref as Qe, getCurrentInstance as ge, watch as ve, computed as ye, onMounted as Xe, defineComponent as Z, h as W, openBlock as Ze, createElementBlock as et, createElementVNode as E, toDisplayString as J, defineAsyncComponent as ce, watchEffect as tt } from "vue";
5
5
  import k from "mockjs";
6
- import { useRoute as ye } from "vue-router";
6
+ import { useRoute as _e } from "vue-router";
7
7
  /**!
8
8
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
9
9
  * @name @vtj/renderer
10
10
  * @author CHC chenhuachun1549@dingtalk.com
11
- * @version 0.9.22
11
+ * @version 0.9.23
12
12
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
13
13
  */
14
- const P = "0.9.22";
14
+ const C = "0.9.23";
15
15
  var y = /* @__PURE__ */ ((s) => (s.Runtime = "Runtime", s.Design = "Design", s.Raw = "Raw", s.VNode = "VNode", s))(y || {});
16
- const ce = [
16
+ const le = [
17
17
  "$el",
18
18
  "$emit",
19
19
  "$nextTick",
@@ -25,7 +25,7 @@ const ce = [
25
25
  "$props",
26
26
  "$options",
27
27
  "$forceUpdate"
28
- ], xn = [
28
+ ], Pn = [
29
29
  "beforeCreate",
30
30
  "created",
31
31
  "beforeMount",
@@ -39,14 +39,14 @@ const ce = [
39
39
  "renderTriggered",
40
40
  "activated",
41
41
  "deactivated"
42
- ], tt = [
42
+ ], nt = [
43
43
  "vIf",
44
44
  "vShow",
45
45
  "vModel",
46
46
  "vFor",
47
47
  "vBind",
48
48
  "vHtml"
49
- ], nt = {
49
+ ], st = {
50
50
  String,
51
51
  Number,
52
52
  Boolean,
@@ -54,80 +54,80 @@ const ce = [
54
54
  Object,
55
55
  Function,
56
56
  Date
57
- }, C = "VtjPage", D = "VtjHomepage", st = "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".split(
57
+ }, F = "VtjPage", H = "VtjHomepage", rt = "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".split(
58
58
  ","
59
- ), rt = "component,slot".split(",");
60
- function I(s, e) {
61
- return s.map((t) => Me(t) || t.startsWith("/") ? t : `${e}${t}`);
59
+ ), it = "component,slot".split(",");
60
+ function M(s, e) {
61
+ return s.map((t) => De(t) || t.startsWith("/") ? t : `${e}${t}`);
62
62
  }
63
- function Z(s) {
63
+ function ee(s) {
64
64
  return /\.css$/.test(s);
65
65
  }
66
- function ee(s) {
66
+ function te(s) {
67
67
  return /\.js$/.test(s);
68
68
  }
69
69
  function ot(s) {
70
70
  return /\.json$/.test(s);
71
71
  }
72
- function Pn(s) {
72
+ function Cn(s) {
73
73
  return s.map(
74
- (e) => `<script src="${R.append(e, { v: P })}"><\/script>`
74
+ (e) => `<script src="${x.append(e, { v: C })}"><\/script>`
75
75
  ).join("");
76
76
  }
77
- function Cn(s = []) {
77
+ function Fn(s = []) {
78
78
  return s.map(
79
- (e) => `<link rel="stylesheet" href="${R.append(e, { v: P })}" />`
79
+ (e) => `<link rel="stylesheet" href="${x.append(e, { v: C })}" />`
80
80
  ).join("");
81
81
  }
82
- function it(s, e = !1) {
82
+ function at(s, e = !1) {
83
83
  return e && s.endsWith(".prod.js") ? s.replace(".prod.js", ".js") : s;
84
84
  }
85
- function at(s, e, t = !1) {
86
- const n = s.filter((d) => !!d.enabled), r = [], o = [], a = [], i = [], c = {}, l = {}, f = [], u = {};
85
+ function ct(s, e, t = !1) {
86
+ const n = s.filter((d) => !!d.enabled), r = [], i = [], a = [], o = [], c = {}, l = {}, f = [], u = {};
87
87
  return n.forEach(
88
88
  ({ urls: d, assetsUrl: h, library: m, assetsLibrary: p, localeLibrary: w }) => {
89
89
  d?.forEach((g) => {
90
- ee(g) && r.push(it(g, t)), Z(g) && o.push(g);
91
- }), m && (i.push(m), c[m] = I(d || [], e), w && (l[m] = w)), h && a.push(h), p && f.push(p), m && p && (u[p] = m);
90
+ te(g) && r.push(at(g, t)), ee(g) && i.push(g);
91
+ }), m && (o.push(m), c[m] = M(d || [], e), w && (l[m] = w)), h && a.push(h), p && f.push(p), m && p && (u[p] = m);
92
92
  }
93
93
  ), {
94
- scripts: I(r, e),
95
- css: I(o, e),
96
- materials: I(a, e),
97
- libraryExports: i,
98
- materialExports: De(f),
94
+ scripts: M(r, e),
95
+ css: M(i, e),
96
+ materials: M(a, e),
97
+ libraryExports: o,
98
+ materialExports: He(f),
99
99
  materialMapLibrary: u,
100
100
  libraryMap: c,
101
101
  libraryLocaleMap: l
102
102
  };
103
103
  }
104
- function ct(s, e) {
104
+ function lt(s, e) {
105
105
  const { name: t, parent: n, alias: r } = s;
106
106
  return n ? e[n]?.[r || t] : e[r || t];
107
107
  }
108
- function _e(s) {
108
+ function we(s) {
109
109
  return j(s) ? s : JSON.stringify(s);
110
110
  }
111
- function we(s, e, t) {
111
+ function Se(s, e, t) {
112
112
  const n = s.CSSStyleSheet;
113
113
  if (n.prototype.replaceSync) {
114
114
  const r = new n();
115
115
  r.id = e, r.replaceSync(t);
116
- const o = s.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
116
+ const i = s.document, a = i.adoptedStyleSheets, o = Array.from(a).filter(
117
117
  (c) => c.id !== e
118
118
  );
119
- o.adoptedStyleSheets = [...i, r];
119
+ i.adoptedStyleSheets = [...o, r];
120
120
  } else {
121
121
  const r = s.document;
122
- let o = r.getElementById(e);
123
- o ? o.innerHTML = t : (o = r.createElement("style"), o.id = e, o.innerHTML = t, r.head.appendChild(o));
122
+ let i = r.getElementById(e);
123
+ i ? i.innerHTML = t : (i = r.createElement("style"), i.id = e, i.innerHTML = t, r.head.appendChild(i));
124
124
  }
125
125
  }
126
- async function lt(s, e) {
126
+ async function ut(s, e) {
127
127
  const t = await window.fetch(e).then((n) => n.text()).catch(() => "");
128
- t && we(window, s, t);
128
+ t && Se(window, s, t);
129
129
  }
130
- function ut(s, e = window) {
130
+ function dt(s, e = window) {
131
131
  const t = e.document, n = e.document.head;
132
132
  for (const r of s)
133
133
  if (!t.getElementById(r)) {
@@ -135,46 +135,46 @@ function ut(s, e = window) {
135
135
  a.rel = "stylesheet", a.id = r, a.href = r, n.appendChild(a);
136
136
  }
137
137
  }
138
- async function dt(s, e, t = window) {
138
+ async function pt(s, e, t = window) {
139
139
  const n = t.document, r = t.document.head;
140
- let o = t[e];
141
- return o ? o.default || o : new Promise((a, i) => {
140
+ let i = t[e];
141
+ return i ? i.default || i : new Promise((a, o) => {
142
142
  for (const c of s) {
143
143
  const l = n.createElement("script");
144
144
  l.src = c, l.onload = () => {
145
- o = t[e], o ? a(o.default || o) : i(null);
145
+ i = t[e], i ? a(i.default || i) : o(null);
146
146
  }, l.onerror = (f) => {
147
- i(f);
147
+ o(f);
148
148
  }, r.appendChild(l);
149
149
  }
150
150
  });
151
151
  }
152
- function pt(s) {
153
- return V(s) || V(s?.install);
154
- }
155
152
  function ft(s) {
156
- return rt.includes(s);
153
+ return z(s) || z(s?.install);
157
154
  }
158
155
  function ht(s) {
159
- return st.includes(s);
156
+ return it.includes(s);
160
157
  }
161
- function T(s, e, t = !1, n = !1) {
158
+ function mt(s) {
159
+ return rt.includes(s);
160
+ }
161
+ function A(s, e, t = !1, n = !1) {
162
162
  try {
163
163
  const r = ['"use strict";', "var __self = arguments[0];"];
164
164
  r.push("return ");
165
- let o = (s.value || "").trim();
166
- o = o.replace(/this(\W|$)/g, (i, c) => `__self${c}`), o = r.join(`
167
- `) + o;
168
- const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
165
+ let i = (s.value || "").trim();
166
+ i = i.replace(/this(\W|$)/g, (o, c) => `__self${c}`), i = r.join(`
167
+ `) + i;
168
+ const a = `with(${t ? "{}" : "$scope || {}"}) { ${i} }`;
169
169
  return new Function("$scope", a)(e);
170
170
  } catch (r) {
171
- if (x.error("parseExpression.error", r, s, e?.__self ?? e), n)
171
+ if (P.error("parseExpression.error", r, s, e?.__self ?? e), n)
172
172
  throw r;
173
173
  }
174
174
  }
175
- function W(s, e, t = !1, n = !1) {
176
- const r = T(s, e, t, n);
177
- if (typeof r != "function" && (x.error(
175
+ function G(s, e, t = !1, n = !1) {
176
+ const r = A(s, e, t, n);
177
+ if (typeof r != "function" && (P.error(
178
178
  "parseFunction.error",
179
179
  "not a function",
180
180
  s,
@@ -186,16 +186,16 @@ function W(s, e, t = !1, n = !1) {
186
186
  function _(s) {
187
187
  return s && s.type === "JSExpression";
188
188
  }
189
- function A(s) {
189
+ function I(s) {
190
190
  return typeof s == "object" && s && s.type === "JSFunction";
191
191
  }
192
- function mt(s) {
193
- return _(s) || A(s);
192
+ function gt(s) {
193
+ return _(s) || I(s);
194
194
  }
195
- function Fn(s) {
196
- return mt(s) ? s.value : JSON.stringify(s);
195
+ function Tn(s) {
196
+ return gt(s) ? s.value : JSON.stringify(s);
197
197
  }
198
- const gt = {
198
+ const vt = {
199
199
  session: !1,
200
200
  authKey: "Authorization",
201
201
  storageKey: "ACCESS_STORAGE",
@@ -207,31 +207,31 @@ const gt = {
207
207
  unauthorizedMessage: "登录已经失效,请重新登录!",
208
208
  noPermissionMessage: "无权限访问该页面",
209
209
  appName: ""
210
- }, Se = Symbol("access");
211
- class Tn {
210
+ }, be = Symbol("access");
211
+ class An {
212
212
  options;
213
213
  data = null;
214
214
  mode = y.Raw;
215
215
  constructor(e) {
216
- this.options = Object.assign({}, gt, e), this.loadData();
216
+ this.options = Object.assign({}, vt, e), this.loadData();
217
217
  }
218
218
  connect(e) {
219
219
  const { mode: t, router: n, request: r } = e;
220
220
  this.mode = t, n && this.mode === y.Raw && this.setGuard(n), r && this.setRequest(r);
221
221
  }
222
222
  login(e) {
223
- const { storageKey: t, storagePrefix: n, session: r, authKey: o } = this.options;
224
- this.setData(e), this.data && (U.save(t, e, {
223
+ const { storageKey: t, storagePrefix: n, session: r, authKey: i } = this.options;
224
+ this.setData(e), this.data && (L.save(t, e, {
225
225
  type: "local",
226
226
  prefix: n
227
- }), r && L.set(o, this.data.token));
227
+ }), r && q.set(i, this.data.token));
228
228
  }
229
229
  clear() {
230
230
  const { storageKey: e, storagePrefix: t, session: n, authKey: r } = this.options;
231
- this.data = null, U.remove(e, {
231
+ this.data = null, L.remove(e, {
232
232
  type: "local",
233
233
  prefix: t
234
- }), n && L.remove(r);
234
+ }), n && q.remove(r);
235
235
  }
236
236
  logout() {
237
237
  this.clear(), this.toLogin();
@@ -244,14 +244,14 @@ class Tn {
244
244
  }
245
245
  can(e) {
246
246
  const { appName: t } = this.options, { permissions: n = {} } = this.data || {};
247
- return typeof e == "function" ? e(n) : re(e).every((o) => n[o] || n[t + "." + o]);
247
+ return typeof e == "function" ? e(n) : ie(e).every((i) => n[i] || n[t + "." + i]);
248
248
  }
249
249
  some(e) {
250
250
  const { appName: t } = this.options, { permissions: n = {} } = this.data || {};
251
- return re(e).some((o) => n[o] || n[t + "." + o]);
251
+ return ie(e).some((i) => n[i] || n[t + "." + i]);
252
252
  }
253
253
  install(e) {
254
- e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(Se, this);
254
+ e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(be, this);
255
255
  }
256
256
  isAuthPath(e) {
257
257
  const { auth: t, isAuth: n } = this.options;
@@ -287,7 +287,7 @@ class Tn {
287
287
  this.data = e;
288
288
  }
289
289
  loadData() {
290
- const { storageKey: e, storagePrefix: t } = this.options, n = U.get(e, {
290
+ const { storageKey: e, storagePrefix: t } = this.options, n = L.get(e, {
291
291
  type: "local",
292
292
  prefix: t
293
293
  });
@@ -295,10 +295,10 @@ class Tn {
295
295
  }
296
296
  isLogined() {
297
297
  const { session: e, authKey: t } = this.options;
298
- return e && t ? !!L.get(t) : !!this.getToken();
298
+ return e && t ? !!q.get(t) : !!this.getToken();
299
299
  }
300
300
  hasRoutePermission(e) {
301
- if (e.name === C) {
301
+ if (e.name === F) {
302
302
  const t = e.params.id;
303
303
  return t && this.can(t);
304
304
  }
@@ -315,7 +315,7 @@ class Tn {
315
315
  return t();
316
316
  {
317
317
  const { noPermissionMessage: n = "无权限访问", unauthorized: r = !1 } = this.options;
318
- return await this.showTip(n), V(r) ? (r(), t(!1)) : j(r) ? t(r) : t(!1);
318
+ return await this.showTip(n), z(r) ? (r(), t(!1)) : j(r) ? t(r) : t(!1);
319
319
  }
320
320
  }
321
321
  t(!1), this.toLogin();
@@ -334,7 +334,7 @@ class Tn {
334
334
  }
335
335
  async showTip(e) {
336
336
  const { alert: t } = this.options;
337
- return t ? (await de(150), await t(e, {
337
+ return t ? (await pe(150), await t(e, {
338
338
  title: "提示",
339
339
  type: "warning"
340
340
  }).catch(() => !1)) : !1;
@@ -349,14 +349,14 @@ class Tn {
349
349
  );
350
350
  }
351
351
  }
352
- function vt() {
353
- return he(Se, null);
352
+ function yt() {
353
+ return me(be, null);
354
354
  }
355
- function An(s = {}) {
355
+ function In(s = {}) {
356
356
  const { notify: e, loading: t, settings: n = {} } = s;
357
357
  let r = null;
358
358
  return {
359
- request: pe({
359
+ request: fe({
360
360
  settings: {
361
361
  type: "form",
362
362
  validSuccess: !0,
@@ -376,12 +376,12 @@ function An(s = {}) {
376
376
  ...n
377
377
  }
378
378
  }),
379
- jsonp: fe,
379
+ jsonp: he,
380
380
  notify: e,
381
381
  loading: t
382
382
  };
383
383
  }
384
- function yt(s, e) {
384
+ function _t(s, e) {
385
385
  const { jsonp: t, request: n } = e;
386
386
  if (s.method === "jsonp")
387
387
  return (r = {}) => t(s.url, {
@@ -389,7 +389,7 @@ function yt(s, e) {
389
389
  query: r
390
390
  });
391
391
  {
392
- const r = s.headers ? T(s.headers, {}, !0) : void 0, o = {
392
+ const r = s.headers ? A(s.headers, {}, !0) : void 0, i = {
393
393
  url: s.url,
394
394
  method: s.method,
395
395
  settings: {
@@ -397,60 +397,60 @@ function yt(s, e) {
397
397
  headers: r
398
398
  }
399
399
  };
400
- return (a, i) => (delete o.data, n.send(He(o, i || {}, { data: a })));
400
+ return (a, o) => (delete i.data, n.send(Oe(i, o || {}, { data: a })));
401
401
  }
402
402
  }
403
- function _t(s, e) {
403
+ function wt(s, e) {
404
404
  const { metaQuery: t } = e;
405
405
  if (!t) return;
406
406
  const { code: n, queryCode: r } = s;
407
- return (o, a) => {
407
+ return (i, a) => {
408
408
  if (!t) {
409
409
  console.warn("adapter.metaQuery is not defined!");
410
410
  return;
411
411
  }
412
- return t(n, r, o, a);
412
+ return t(n, r, i, a);
413
413
  };
414
414
  }
415
- function wt(s = [], e = [], t) {
415
+ function St(s = [], e = [], t) {
416
416
  const n = {};
417
417
  for (const r of s)
418
- n[r.id] = yt(r, t);
419
- for (const r of e)
420
418
  n[r.id] = _t(r, t);
419
+ for (const r of e)
420
+ n[r.id] = wt(r, t);
421
421
  return n;
422
422
  }
423
- async function St(s = []) {
424
- k && (be(), s.forEach((e) => jt(k, e)));
423
+ async function bt(s = []) {
424
+ k && (je(), s.forEach((e) => $t(k, e)));
425
425
  }
426
- function bt(s) {
427
- const e = A(s.mockTemplate) && s.mockTemplate.value ? W(s.mockTemplate, {}, !0) : void 0;
426
+ function jt(s) {
427
+ const e = I(s.mockTemplate) && s.mockTemplate.value ? G(s.mockTemplate, {}, !0) : void 0;
428
428
  return async (...t) => {
429
429
  let n = {};
430
430
  if (e)
431
431
  try {
432
432
  n = await e.apply(e, t);
433
433
  } catch (r) {
434
- x.warn("模拟数据模版异常", r);
434
+ P.warn("模拟数据模版异常", r);
435
435
  }
436
436
  return k.mock(n);
437
437
  };
438
438
  }
439
- function jt(s, e) {
439
+ function $t(s, e) {
440
440
  if (!e.mock) return;
441
441
  const { url: t, mockTemplate: n } = e;
442
442
  if (t && n) {
443
- const r = Oe(`${t}(.*)`), o = Be(t, { decode: decodeURIComponent }), a = T(n, {}, !0);
444
- s.mock(r, (i) => {
445
- const c = R.parse(i.url) || {}, l = i.body instanceof FormData ? Ne(i.body) : i.body, f = o(i.url)?.params;
446
- return Object.assign(i, { data: l, params: c, query: f }), s.mock(a(i));
443
+ const r = Be(`${t}(.*)`), i = Ne(t, { decode: decodeURIComponent }), a = A(n, {}, !0);
444
+ s.mock(r, (o) => {
445
+ const c = x.parse(o.url) || {}, l = o.body instanceof FormData ? Ue(o.body) : o.body, f = i(o.url)?.params;
446
+ return Object.assign(o, { data: l, params: c, query: f }), s.mock(a(o));
447
447
  });
448
448
  }
449
449
  }
450
- function be() {
450
+ function je() {
451
451
  k && (k._mocked = {});
452
452
  }
453
- class $t {
453
+ class Et {
454
454
  __id = null;
455
455
  __mode;
456
456
  __instance = null;
@@ -479,7 +479,7 @@ class $t {
479
479
  const { mode: t, dsl: n, attrs: r } = e;
480
480
  this.__mode = t, n && (this.__id = n.id || null, this.__transform = n.transform || {}), r && Object.assign(this, r);
481
481
  }
482
- setup(e, t = B) {
482
+ setup(e, t = N) {
483
483
  const n = t.getCurrentInstance();
484
484
  if (!n) return;
485
485
  this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = n.proxy;
@@ -493,12 +493,12 @@ class $t {
493
493
  });
494
494
  }
495
495
  __proxy() {
496
- this.__instance && ce.forEach((e) => {
496
+ this.__instance && le.forEach((e) => {
497
497
  this[e] = this.__instance?.[e];
498
498
  });
499
499
  }
500
500
  __cleanup() {
501
- ce.forEach((e) => {
501
+ le.forEach((e) => {
502
502
  this[e] = null;
503
503
  }), this.__reset();
504
504
  }
@@ -509,22 +509,22 @@ class $t {
509
509
  if (e)
510
510
  if (this.__mode === y.Runtime) {
511
511
  const { id: t, type: n } = e, r = t ? this.__transform[t] ?? e.value : e.value;
512
- return W({ type: n, value: r }, this);
512
+ return G({ type: n, value: r }, this);
513
513
  } else
514
- return W(e, this);
514
+ return G(e, this);
515
515
  }
516
516
  __parseExpression(e) {
517
517
  if (e)
518
518
  if (this.__mode === y.Runtime) {
519
519
  const { id: t, type: n } = e, r = t ? this.__transform[t] ?? e.value : e.value;
520
- return T({ type: n, value: r }, this);
520
+ return A({ type: n, value: r }, this);
521
521
  } else
522
- return T(e, this);
522
+ return A(e, this);
523
523
  }
524
524
  __ref(e = null, t) {
525
525
  if (this.__mode !== y.VNode)
526
526
  return e && e !== this.__id && (this.__contextRefs[e] = this), async (n) => {
527
- await de(0);
527
+ await pe(0);
528
528
  let r = n?.$vtjEl || n?.$el || n?._?.vnode?.el || n;
529
529
  if (!r) {
530
530
  typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
@@ -536,8 +536,8 @@ class $t {
536
536
  __getRefEl(e, t, n) {
537
537
  const r = e[t];
538
538
  if (r && n !== r) {
539
- const o = new Set([].concat(r, n));
540
- return Array.from(o);
539
+ const i = new Set([].concat(r, n));
540
+ return Array.from(i);
541
541
  } else
542
542
  return n;
543
543
  }
@@ -549,35 +549,35 @@ class $t {
549
549
  return n.context.__proto__ = this.context, n.__proto__ = this, n;
550
550
  }
551
551
  }
552
- function G(s) {
552
+ function Y(s) {
553
553
  const {
554
- Vue: e = B,
554
+ Vue: e = N,
555
555
  mode: t = y.Runtime,
556
556
  components: n = {},
557
557
  libs: r = {},
558
- apis: o = {},
558
+ apis: i = {},
559
559
  loader: a
560
- } = s, i = e.computed(() => s.dsl), c = {
560
+ } = s, o = e.computed(() => s.dsl), c = {
561
561
  $components: n,
562
562
  $libs: r,
563
- $apis: o
564
- }, l = new $t({
563
+ $apis: i
564
+ }, l = new Et({
565
565
  mode: t,
566
- dsl: i.value,
566
+ dsl: o.value,
567
567
  attrs: c
568
568
  }), f = e.defineComponent({
569
- name: i.value.name,
569
+ name: o.value.name,
570
570
  props: {
571
- ...kt(i.value.props ?? [], l)
571
+ ...Rt(o.value.props ?? [], l)
572
572
  },
573
573
  setup(u) {
574
- l.$props = u, l.props = u, i.value.id && we(
574
+ l.$props = u, l.props = u, o.value.id && Se(
575
575
  s.window || window,
576
- i.value.id,
577
- i.value.css || ""
578
- ), l.state = Rt(e, i.value.state ?? {}, l);
579
- const d = xt(e, i.value.computed ?? {}, l), h = Pt(i.value.methods ?? {}, l), m = Ct(e, i.value.inject, l), p = Ft(
580
- i.value.dataSources || {},
576
+ o.value.id,
577
+ o.value.css || ""
578
+ ), l.state = xt(e, o.value.state ?? {}, l);
579
+ const d = Pt(e, o.value.computed ?? {}, l), h = Ct(o.value.methods ?? {}, l), m = Ft(e, o.value.inject, l), p = Tt(
580
+ o.value.dataSources || {},
581
581
  l
582
582
  ), w = {
583
583
  ...m,
@@ -585,29 +585,29 @@ function G(s) {
585
585
  ...h,
586
586
  ...p
587
587
  };
588
- return l.setup(w, e), Tt(e, i.value.watch ?? [], l), {
588
+ return l.setup(w, e), At(e, o.value.watch ?? [], l), {
589
589
  vtj: l
590
590
  };
591
591
  },
592
- emits: Et(i.value.emits),
592
+ emits: kt(o.value.emits),
593
593
  expose: ["vtj"],
594
594
  render() {
595
- if (!i.value.nodes) return null;
596
- const u = i.value.nodes || [];
597
- return u.length === 1 ? O(u[0], l, e, a) : u.map((d) => O(d, l, e, a));
595
+ if (!o.value.nodes) return null;
596
+ const u = o.value.nodes || [];
597
+ return u.length === 1 ? B(u[0], l, e, a) : u.map((d) => B(d, l, e, a));
598
598
  },
599
- ...At(i.value.lifeCycles ?? {}, l)
599
+ ...It(o.value.lifeCycles ?? {}, l)
600
600
  });
601
601
  return {
602
602
  renderer: e.markRaw(f),
603
603
  context: l
604
604
  };
605
605
  }
606
- function Et(s = []) {
606
+ function kt(s = []) {
607
607
  return s.map((e) => j(e) ? e : e.name);
608
608
  }
609
- function kt(s = [], e) {
610
- const t = (n) => n ? (Array.isArray(n) ? n : [n]).map((o) => nt[o]) : void 0;
609
+ function Rt(s = [], e) {
610
+ const t = (n) => n ? (Array.isArray(n) ? n : [n]).map((i) => st[i]) : void 0;
611
611
  return s.map((n) => j(n) ? {
612
612
  name: n
613
613
  } : {
@@ -624,50 +624,50 @@ function kt(s = [], e) {
624
624
  {}
625
625
  );
626
626
  }
627
- function Rt(s, e, t) {
627
+ function xt(s, e, t) {
628
628
  return s.reactive(
629
629
  Object.keys(e || {}).reduce(
630
630
  (n, r) => {
631
- let o = e[r];
632
- return _(o) ? o = t.__parseExpression(o) : A(o) && (o = t.__parseFunction(o)), n[r] = o, n;
631
+ let i = e[r];
632
+ return _(i) ? i = t.__parseExpression(i) : I(i) && (i = t.__parseFunction(i)), n[r] = i, n;
633
633
  },
634
634
  {}
635
635
  )
636
636
  );
637
637
  }
638
- function xt(s, e, t) {
638
+ function Pt(s, e, t) {
639
639
  return Object.entries(e ?? {}).reduce(
640
- (n, [r, o]) => (n[r] = s.computed(t.__parseFunction(o)), n),
640
+ (n, [r, i]) => (n[r] = s.computed(t.__parseFunction(i)), n),
641
641
  {}
642
642
  );
643
643
  }
644
- function Pt(s, e) {
644
+ function Ct(s, e) {
645
645
  return Object.entries(s ?? {}).reduce(
646
646
  (t, [n, r]) => (t[n] = e.__parseFunction(r), t),
647
647
  {}
648
648
  );
649
649
  }
650
- function Ct(s, e = [], t) {
650
+ function Ft(s, e = [], t) {
651
651
  return e.reduce(
652
652
  (n, r) => {
653
- const { name: o, from: a } = r || {};
653
+ const { name: i, from: a } = r || {};
654
654
  r.default;
655
- const i = _(a) ? t.__parseExpression(a) || o : a ?? o, c = _(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
656
- return n[o] = s.inject(i, c), n;
655
+ const o = _(a) ? t.__parseExpression(a) || i : a ?? i, c = _(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
656
+ return n[i] = s.inject(o, c), n;
657
657
  },
658
658
  {}
659
659
  );
660
660
  }
661
- function Ft(s, e) {
661
+ function Tt(s, e) {
662
662
  return Object.keys(s).reduce(
663
663
  (t, n) => {
664
664
  const r = s[n];
665
665
  if (r.type === "mock")
666
- t[n] = bt(r);
666
+ t[n] = jt(r);
667
667
  else if (r.ref) {
668
- const o = e.$apis[r.ref], a = A(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
669
- t[n] = async (...i) => {
670
- const c = await o.apply(e, i);
668
+ const i = e.$apis[r.ref], a = I(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
669
+ t[n] = async (...o) => {
670
+ const c = await i.apply(e, o);
671
671
  return a ? a(c) : c;
672
672
  };
673
673
  }
@@ -676,7 +676,7 @@ function Ft(s, e) {
676
676
  {}
677
677
  );
678
678
  }
679
- function Tt(s, e = [], t) {
679
+ function At(s, e = [], t) {
680
680
  e.forEach((n) => {
681
681
  s.watch(
682
682
  t.__parseExpression(n.source),
@@ -688,97 +688,114 @@ function Tt(s, e = [], t) {
688
688
  );
689
689
  });
690
690
  }
691
- function At(s, e) {
691
+ function It(s, e) {
692
692
  return Object.entries(s ?? {}).reduce(
693
693
  (t, [n, r]) => (t[n] = e.__parseFunction(r), t),
694
694
  {}
695
695
  );
696
696
  }
697
- let J = [];
698
- const It = (s) => s;
699
- async function je(s, e = window) {
700
- const { urls: t = [], library: n } = s, r = t.filter((i) => ee(i));
697
+ let V = [], R = {};
698
+ const Mt = (s) => s;
699
+ async function $e(s, e = window) {
700
+ const { urls: t = [], library: n } = s, r = t.filter((o) => te(o));
701
701
  if (r.length === 0 || !n) return null;
702
- const o = t.filter((i) => Z(i));
703
- return o.length && ut(o, e), await dt(r, n, e).catch(
704
- (i) => (console.warn("loadScriptUrl error", r, n, i), null)
702
+ const i = t.filter((o) => ee(o));
703
+ return i.length && dt(i, e), await pt(r, n, e).catch(
704
+ (o) => (console.warn("loadScriptUrl error", r, n, o), null)
705
705
  );
706
706
  }
707
- function Y(s) {
707
+ function Q(s) {
708
708
  const { getDsl: e, getDslByUrl: t, options: n } = s;
709
- return n.window && (J.forEach((r) => {
709
+ return n.window && (V.forEach((r) => {
710
710
  delete n.window[r];
711
- }), J = []), (r, o, a = B) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
712
- const i = await e(o.id);
713
- return i && (i.name = r), i ? G({
714
- ...n,
715
- Vue: a,
716
- dsl: i,
717
- mode: y.Runtime,
718
- loader: Y(s)
719
- }).renderer : null;
720
- }) : o.type === "UrlSchema" && o.url ? a.defineAsyncComponent(async () => {
721
- const i = await t(o.url);
722
- return i && (i.name = r), i ? G({
723
- ...n,
724
- Vue: a,
725
- dsl: i,
726
- mode: y.Runtime,
727
- loader: Y(s)
728
- }).renderer : null;
729
- }) : o.type === "Plugin" ? (o.library && J.push(o.library), a.defineAsyncComponent(async () => {
730
- const i = await je(o, n.window);
731
- return i || (console.warn("getPlugin result is null", o), null);
732
- })) : r;
733
- }
734
- function O(s, e, t = B, n = It) {
711
+ }), V = []), (r, i, a = N) => {
712
+ if (!i || typeof i == "string") return r;
713
+ if (i.type === "Schema" && i.id) {
714
+ let o = R[i.id];
715
+ return o || (o = R[i.id] = a.defineAsyncComponent(async () => {
716
+ const c = await e(i.id);
717
+ return c && (c.name = r), c ? Y({
718
+ ...n,
719
+ Vue: a,
720
+ dsl: c,
721
+ mode: y.Runtime,
722
+ loader: Q(s)
723
+ }).renderer : null;
724
+ }), o);
725
+ }
726
+ if (i.type === "UrlSchema" && i.url) {
727
+ let o = R[i.url];
728
+ return o || (o = R[i.url] = a.defineAsyncComponent(async () => {
729
+ const c = await t(i.url);
730
+ return c && (c.name = r), c ? Y({
731
+ ...n,
732
+ Vue: a,
733
+ dsl: c,
734
+ mode: y.Runtime,
735
+ loader: Q(s)
736
+ }).renderer : null;
737
+ }), o);
738
+ }
739
+ if (i.type === "Plugin") {
740
+ let o = i.library ? R[i.library] : null;
741
+ return o || (i.library && V.push(i.library), o = R[i.library || Symbol()] = a.defineAsyncComponent(
742
+ async () => {
743
+ const c = await $e(i, n.window);
744
+ return c || (console.warn("getPlugin result is null", i), null);
745
+ }
746
+ ), o);
747
+ }
748
+ return r;
749
+ };
750
+ }
751
+ function B(s, e, t = N, n = Mt) {
735
752
  if (!s || !s.name || s.invisible) return null;
736
- const r = t.getCurrentInstance()?.appContext, { id: o = null, directives: a = [] } = s, { vIf: i, vFor: c, vShow: l, vModels: f, vBind: u, vHtml: d, others: h } = Dt(a);
737
- if (i && !Ht(i, e))
753
+ const r = t.getCurrentInstance()?.appContext, { id: i = null, directives: a = [] } = s, { vIf: o, vFor: c, vShow: l, vModels: f, vBind: u, vHtml: d, others: h } = Ht(a);
754
+ if (o && !Ot(o, e))
738
755
  return null;
739
756
  const m = (p) => {
740
757
  const w = p.$components, g = (() => {
741
758
  if (s.name === "component")
742
- return Ot(p, s.props?.is);
759
+ return Bt(p, s.props?.is);
743
760
  if (s.name === "slot") return s.name;
744
761
  const b = n(s.name, s.from, t);
745
- return j(b) ? ft(b) || ht(b) ? b : w[b] ?? r?.app?.component(b) ?? b : b;
746
- })(), S = Bt(o, s.props ?? {}, p), Fe = Nt(t, s.events ?? {}, p);
762
+ return j(b) ? ht(b) || mt(b) ? b : w[b] ?? r?.app?.component(b) ?? b : b;
763
+ })(), S = Nt(i, s.props ?? {}, p), Te = Ut(t, s.events ?? {}, p);
747
764
  if (s.name === "slot")
748
- return Ut(t, s, S, p, n);
765
+ return Lt(t, s, S, p, n);
749
766
  u && Object.assign(S, p.__parseExpression(u.value)), l && (S.style = Object.assign(
750
767
  S.style ?? {},
751
- qt(l, p)
752
- )), d && Object.assign(S, Jt(d, p)), f.forEach((b) => {
753
- Object.assign(S, Vt(t, b, p));
768
+ Jt(l, p)
769
+ )), d && Object.assign(S, Vt(d, p)), f.forEach((b) => {
770
+ Object.assign(S, zt(t, b, p));
754
771
  });
755
- const Te = zt(
772
+ const Ae = Kt(
756
773
  t,
757
774
  s.children ?? [],
758
775
  p,
759
776
  n,
760
777
  s
761
778
  );
762
- let N = t.createVNode(g, { ...S, ...Fe }, Te);
763
- const se = r ? Mt(r, h, p) : [];
764
- return se.length && (N = t.withDirectives(N, se)), N;
779
+ let U = t.createVNode(g, { ...S, ...Te }, Ae);
780
+ const re = r ? Dt(r, h, p) : [];
781
+ return re.length && (U = t.withDirectives(U, re)), U;
765
782
  };
766
- return c ? Gt(c, m, e) : m(e);
783
+ return c ? Yt(c, m, e) : m(e);
767
784
  }
768
- function Mt(s, e, t) {
785
+ function Dt(s, e, t) {
769
786
  const n = s.app;
770
787
  return e.map((r) => {
771
- const o = typeof r.name == "string" ? n.directive(r.name) : t.__parseExpression(r.name);
772
- if (!o) return null;
773
- const a = [o];
788
+ const i = typeof r.name == "string" ? n.directive(r.name) : t.__parseExpression(r.name);
789
+ if (!i) return null;
790
+ const a = [i];
774
791
  return r.value && a.push(t.__parseExpression(r.value)), r.arg && a.push(r.arg), r.modifiers && a.push(r.modifiers), a;
775
792
  }).filter((r) => !!r);
776
793
  }
777
- function Dt(s = []) {
778
- const e = s.find((c) => $(c.name) === "vIf"), t = s.find((c) => $(c.name) === "vFor"), n = s.find((c) => $(c.name) === "vShow"), r = s.find((c) => $(c.name) === "vBind"), o = s.find((c) => $(c.name) === "vHtml"), a = s.filter(
794
+ function Ht(s = []) {
795
+ const e = s.find((c) => $(c.name) === "vIf"), t = s.find((c) => $(c.name) === "vFor"), n = s.find((c) => $(c.name) === "vShow"), r = s.find((c) => $(c.name) === "vBind"), i = s.find((c) => $(c.name) === "vHtml"), a = s.filter(
779
796
  (c) => $(c.name) === "vModel"
780
- ), i = s.filter(
781
- (c) => !tt.includes($(c.name))
797
+ ), o = s.filter(
798
+ (c) => !nt.includes($(c.name))
782
799
  );
783
800
  return {
784
801
  vIf: e,
@@ -786,105 +803,105 @@ function Dt(s = []) {
786
803
  vShow: n,
787
804
  vModels: a,
788
805
  vBind: r,
789
- others: i,
790
- vHtml: o
806
+ others: o,
807
+ vHtml: i
791
808
  };
792
809
  }
793
- function Ht(s, e) {
810
+ function Ot(s, e) {
794
811
  return !!e.__parseExpression(s.value);
795
812
  }
796
- function Ot(s, e) {
813
+ function Bt(s, e) {
797
814
  return e ? _(e) ? s.__parseExpression(e) : e : "div";
798
815
  }
799
- function Bt(s, e, t) {
816
+ function Nt(s, e, t) {
800
817
  const n = Object.keys(e || {}).reduce(
801
- (r, o) => {
802
- let a = e[o];
803
- return _(a) ? a = t.__parseExpression(a) : A(a) && (a = t.__parseFunction(a)), r[o] = a, r;
818
+ (r, i) => {
819
+ let a = e[i];
820
+ return _(a) ? a = t.__parseExpression(a) : I(a) && (a = t.__parseFunction(a)), r[i] = a, r;
804
821
  },
805
822
  {}
806
823
  );
807
824
  return n.ref = t.__ref(s, n.ref), n;
808
825
  }
809
- function Nt(s, e, t) {
826
+ function Ut(s, e, t) {
810
827
  const n = ["passive", "capture", "once"], r = {
811
828
  capture: "Capture",
812
829
  once: "Once",
813
830
  passive: "OnceCapture"
814
831
  };
815
832
  return Object.keys(e || {}).reduce(
816
- (o, a) => {
817
- const i = e[a], c = $e(i.modifiers), l = c.find((d) => n.includes(d)), f = "on" + Ue(a) + (l && r[l] || ""), u = t.__parseFunction(i.handler);
818
- return u && (o[f] = s.withModifiers(u, c)), o;
833
+ (i, a) => {
834
+ const o = e[a], c = Ee(o.modifiers), l = c.find((d) => n.includes(d)), f = "on" + Le(a) + (l && r[l] || ""), u = t.__parseFunction(o.handler);
835
+ return u && (i[f] = s.withModifiers(u, c)), i;
819
836
  },
820
837
  {}
821
838
  );
822
839
  }
823
- function $e(s = {}, e = !1) {
840
+ function Ee(s = {}, e = !1) {
824
841
  const t = Object.keys(s);
825
842
  return e ? t.map((n) => "." + n) : t;
826
843
  }
827
- function Ut(s, e, t, n, r) {
828
- const { children: o } = e, a = Lt(e, n), i = n.$slots?.[a.name];
829
- return i ? i(t) : o ? j(o) ? s.createTextVNode(o) : _(o) ? s.createTextVNode(
830
- _e(n.__parseExpression(o))
831
- ) : Array.isArray(o) ? o.map(
832
- (c) => O(c, n, s, r)
844
+ function Lt(s, e, t, n, r) {
845
+ const { children: i } = e, a = qt(e, n), o = n.$slots?.[a.name];
846
+ return o ? o(t) : i ? j(i) ? s.createTextVNode(i) : _(i) ? s.createTextVNode(
847
+ we(n.__parseExpression(i))
848
+ ) : Array.isArray(i) ? i.map(
849
+ (c) => B(c, n, s, r)
833
850
  ) : null : null;
834
851
  }
835
- function Lt(s, e) {
852
+ function qt(s, e) {
836
853
  const { props: t } = s, n = t?.name || "default";
837
854
  return {
838
855
  name: _(n) ? e.__parseExpression(n) : n,
839
856
  params: []
840
857
  };
841
858
  }
842
- function qt(s, e) {
859
+ function Jt(s, e) {
843
860
  return e.__parseExpression(s.value) ? {} : {
844
861
  display: "none"
845
862
  };
846
863
  }
847
- function Jt(s, e) {
864
+ function Vt(s, e) {
848
865
  return {
849
866
  innerHTML: e.__parseExpression(s.value) || ""
850
867
  };
851
868
  }
852
- function Vt(s, e, t) {
869
+ function zt(s, e, t) {
853
870
  const n = {
854
871
  type: "JSFunction",
855
872
  value: e.value?.value ? `(v) => {
856
873
  ${e.value.value} = v;
857
874
  }` : "(v) => {}"
858
- }, r = t.__parseFunction(n), o = $e(
875
+ }, r = t.__parseFunction(n), i = Ee(
859
876
  _(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
860
877
  ), a = _(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
861
878
  return {
862
879
  [a]: t.__parseExpression(e.value),
863
- [`onUpdate:${a}`]: o.length && r ? s.withModifiers(r, o) : r
880
+ [`onUpdate:${a}`]: i.length && r ? s.withModifiers(r, i) : r
864
881
  };
865
882
  }
866
- function zt(s, e, t, n, r) {
883
+ function Kt(s, e, t, n, r) {
867
884
  if (!e) return null;
868
885
  if (j(e))
869
886
  return { default: () => e };
870
887
  if (_(e))
871
888
  return {
872
- default: () => _e(t.__parseExpression(e))
889
+ default: () => we(t.__parseExpression(e))
873
890
  };
874
891
  if (Array.isArray(e) && e.length > 0) {
875
- const o = Kt(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
876
- [`scope_${r.id}`]: i
892
+ const i = Wt(e), a = (o) => !o || !r ? {} : r?.id && Object.keys(o).length ? {
893
+ [`scope_${r.id}`]: o
877
894
  } : {};
878
- return Object.entries(o).reduce((i, [c, { nodes: l, params: f }]) => (i[c] = (u) => {
879
- const d = f.length ? Le(u ?? {}, f) : a(u);
895
+ return Object.entries(i).reduce((o, [c, { nodes: l, params: f }]) => (o[c] = (u) => {
896
+ const d = f.length ? qe(u ?? {}, f) : a(u);
880
897
  return l.map(
881
- (h) => O(h, t.__clone(d), s, n)
898
+ (h) => B(h, t.__clone(d), s, n)
882
899
  );
883
- }, i), {});
900
+ }, o), {});
884
901
  }
885
902
  return null;
886
903
  }
887
- function Kt(s) {
904
+ function Wt(s) {
888
905
  const e = {
889
906
  default: {
890
907
  params: [],
@@ -892,7 +909,7 @@ function Kt(s) {
892
909
  }
893
910
  };
894
911
  for (const t of s) {
895
- const n = Wt(t.slot), r = n.name;
912
+ const n = Gt(t.slot), r = n.name;
896
913
  e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(n.params)) : e[r] = {
897
914
  nodes: [t],
898
915
  params: n.params
@@ -900,143 +917,143 @@ function Kt(s) {
900
917
  }
901
918
  return e;
902
919
  }
903
- function Wt(s = "default") {
920
+ function Gt(s = "default") {
904
921
  return j(s) ? { name: s, params: [] } : { params: [], ...s };
905
922
  }
906
- function Gt(s, e, t) {
907
- const { value: n, iterator: r } = s, { item: o = "item", index: a = "index" } = r || {};
908
- let i = t.__parseExpression(n) || [];
909
- return Number.isInteger(i) && (i = new Array(i).fill(!0).map((c, l) => l + 1)), Array.isArray(i) ? i.map((c, l) => e(t.__clone({ [o]: c, [a]: l }))) : (console.warn("[vForRender]:", `${n?.value} is not a Arrary`), []);
923
+ function Yt(s, e, t) {
924
+ const { value: n, iterator: r } = s, { item: i = "item", index: a = "index" } = r || {};
925
+ let o = t.__parseExpression(n) || [];
926
+ return Number.isInteger(o) && (o = new Array(o).fill(!0).map((c, l) => l + 1)), Array.isArray(o) ? o.map((c, l) => e(t.__clone({ [i]: c, [a]: l }))) : (console.warn("[vForRender]:", `${n?.value} is not a Arrary`), []);
910
927
  }
911
- function Yt(s) {
912
- return We() ? (Ge(s), !0) : !1;
928
+ function Qt(s) {
929
+ return Ge() ? (Ye(s), !0) : !1;
913
930
  }
914
- function te(s) {
915
- return typeof s == "function" ? s() : Ye(s);
931
+ function ne(s) {
932
+ return typeof s == "function" ? s() : Qe(s);
916
933
  }
917
- const Ee = typeof window < "u" && typeof document < "u";
934
+ const ke = typeof window < "u" && typeof document < "u";
918
935
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
919
- const Qt = (s) => s != null, Xt = () => {
936
+ const Xt = (s) => s != null, Zt = () => {
920
937
  };
921
- function Zt(s) {
922
- return me();
938
+ function en(s) {
939
+ return ge();
923
940
  }
924
- function en(...s) {
941
+ function tn(...s) {
925
942
  if (s.length !== 1)
926
- return Je(...s);
943
+ return Ve(...s);
927
944
  const e = s[0];
928
- return typeof e == "function" ? Ve(ze(() => ({ get: e, set: Xt }))) : F(e);
945
+ return typeof e == "function" ? ze(Ke(() => ({ get: e, set: Zt }))) : T(e);
929
946
  }
930
- function tn(s, e) {
931
- Zt() && Ke(s, e);
947
+ function nn(s, e) {
948
+ en() && We(s, e);
932
949
  }
933
- const nn = Ee ? window : void 0, sn = Ee ? window.document : void 0;
934
- function rn(s) {
950
+ const sn = ke ? window : void 0, rn = ke ? window.document : void 0;
951
+ function on(s) {
935
952
  var e;
936
- const t = te(s);
953
+ const t = ne(s);
937
954
  return (e = t?.$el) != null ? e : t;
938
955
  }
939
- function on() {
940
- const s = F(!1), e = me();
941
- return e && Qe(() => {
956
+ function an() {
957
+ const s = T(!1), e = ge();
958
+ return e && Xe(() => {
942
959
  s.value = !0;
943
960
  }, e), s;
944
961
  }
945
- function an(s) {
946
- const e = on();
947
- return ve(() => (e.value, !!s()));
948
- }
949
- function cn(s, e, t = {}) {
950
- const { window: n = nn, ...r } = t;
951
- let o;
952
- const a = an(() => n && "MutationObserver" in n), i = () => {
953
- o && (o.disconnect(), o = void 0);
954
- }, c = ve(() => {
955
- const d = te(s), h = (Array.isArray(d) ? d : [d]).map(rn).filter(Qt);
962
+ function cn(s) {
963
+ const e = an();
964
+ return ye(() => (e.value, !!s()));
965
+ }
966
+ function ln(s, e, t = {}) {
967
+ const { window: n = sn, ...r } = t;
968
+ let i;
969
+ const a = cn(() => n && "MutationObserver" in n), o = () => {
970
+ i && (i.disconnect(), i = void 0);
971
+ }, c = ye(() => {
972
+ const d = ne(s), h = (Array.isArray(d) ? d : [d]).map(on).filter(Xt);
956
973
  return new Set(h);
957
- }), l = ge(
974
+ }), l = ve(
958
975
  () => c.value,
959
976
  (d) => {
960
- i(), a.value && d.size && (o = new MutationObserver(e), d.forEach((h) => o.observe(h, r)));
977
+ o(), a.value && d.size && (i = new MutationObserver(e), d.forEach((h) => i.observe(h, r)));
961
978
  },
962
979
  { immediate: !0, flush: "post" }
963
- ), f = () => o?.takeRecords(), u = () => {
964
- l(), i();
980
+ ), f = () => i?.takeRecords(), u = () => {
981
+ l(), o();
965
982
  };
966
- return Yt(u), {
983
+ return Qt(u), {
967
984
  isSupported: a,
968
985
  stop: u,
969
986
  takeRecords: f
970
987
  };
971
988
  }
972
- function ln(s = null, e = {}) {
989
+ function un(s = null, e = {}) {
973
990
  var t, n, r;
974
991
  const {
975
- document: o = sn,
992
+ document: i = rn,
976
993
  restoreOnUnmount: a = (u) => u
977
- } = e, i = (t = o?.title) != null ? t : "", c = en((n = s ?? o?.title) != null ? n : null), l = s && typeof s == "function";
994
+ } = e, o = (t = i?.title) != null ? t : "", c = tn((n = s ?? i?.title) != null ? n : null), l = s && typeof s == "function";
978
995
  function f(u) {
979
996
  if (!("titleTemplate" in e))
980
997
  return u;
981
998
  const d = e.titleTemplate || "%s";
982
- return typeof d == "function" ? d(u) : te(d).replace(/%s/g, u);
999
+ return typeof d == "function" ? d(u) : ne(d).replace(/%s/g, u);
983
1000
  }
984
- return ge(
1001
+ return ve(
985
1002
  c,
986
1003
  (u, d) => {
987
- u !== d && o && (o.title = f(typeof u == "string" ? u : ""));
1004
+ u !== d && i && (i.title = f(typeof u == "string" ? u : ""));
988
1005
  },
989
1006
  { immediate: !0 }
990
- ), e.observe && !e.titleTemplate && o && !l && cn(
991
- (r = o.head) == null ? void 0 : r.querySelector("title"),
1007
+ ), e.observe && !e.titleTemplate && i && !l && ln(
1008
+ (r = i.head) == null ? void 0 : r.querySelector("title"),
992
1009
  () => {
993
- o && o.title !== c.value && (c.value = f(o.title));
1010
+ i && i.title !== c.value && (c.value = f(i.title));
994
1011
  },
995
1012
  { childList: !0 }
996
- ), tn(() => {
1013
+ ), nn(() => {
997
1014
  if (a) {
998
- const u = a(i, c.value || "");
999
- u != null && o && (o.title = u);
1015
+ const u = a(o, c.value || "");
1016
+ u != null && i && (i.title = u);
1000
1017
  }
1001
1018
  }), c;
1002
1019
  }
1003
- const le = X({
1020
+ const ue = Z({
1004
1021
  name: "VtjPageContainer",
1005
1022
  async setup() {
1006
- const s = Re(), e = ye(), t = e.params.id, n = t ? s.getPage(t) : s.getHomepage(), r = n ? await s.getRenderComponent(n.id) : null, o = F(Symbol());
1007
- return n && (Object.assign(e.meta, n.meta || {}, { cache: n.cache }), ln(n.title || "VTJ")), {
1023
+ const s = xe(), e = _e(), t = e.params.id, n = t ? s.getPage(t) : s.getHomepage(), r = n ? await s.getRenderComponent(n.id) : null, i = T(Symbol());
1024
+ return n && (Object.assign(e.meta, n.meta || {}, { cache: n.cache }), un(n.title || "VTJ")), {
1008
1025
  provider: s,
1009
1026
  component: r,
1010
1027
  file: n,
1011
1028
  query: e.query,
1012
1029
  meta: e.meta,
1013
- sid: o,
1030
+ sid: i,
1014
1031
  route: e
1015
1032
  };
1016
1033
  },
1017
1034
  render() {
1018
1035
  const { component: s, query: e, sid: t } = this;
1019
- return s ? K(s, { ...e, key: t }) : K("div", "页面不存在");
1036
+ return s ? W(s, { ...e, key: t }) : W("div", "页面不存在");
1020
1037
  },
1021
1038
  activated() {
1022
1039
  this.meta.cache === !1 && (this.sid = Symbol());
1023
1040
  }
1024
- }), un = {
1041
+ }), dn = {
1025
1042
  "data-l-h6o7ki7": "",
1026
1043
  class: "vtj-startup__wrapper"
1027
- }, dn = {
1044
+ }, pn = {
1028
1045
  "data-l-h6o7ki7": "",
1029
1046
  class: "vtj-startup"
1030
- }, pn = {
1047
+ }, fn = {
1031
1048
  "data-l-h6o7ki7": "",
1032
1049
  class: "vtj-startup__name"
1033
- }, fn = { "data-l-h6o7ki7": "" }, hn = {
1050
+ }, hn = { "data-l-h6o7ki7": "" }, mn = {
1034
1051
  "data-l-h6o7ki7": "",
1035
1052
  class: "vtj-startup__tagline"
1036
- }, mn = {
1053
+ }, gn = {
1037
1054
  "data-l-h6o7ki7": "",
1038
1055
  class: "vtj-startup__actions"
1039
- }, gn = /* @__PURE__ */ X({
1056
+ }, vn = /* @__PURE__ */ Z({
1040
1057
  __name: "Startup",
1041
1058
  props: {
1042
1059
  name: { default: "VTJ.PRO" },
@@ -1045,9 +1062,9 @@ const le = X({
1045
1062
  link: {}
1046
1063
  },
1047
1064
  setup(s) {
1048
- ((r, o) => {
1065
+ ((r, i) => {
1049
1066
  let a = document.getElementById("h6o7ki7");
1050
- a || (a = document.createElement("style"), a.id = "h6o7ki7", document.head.appendChild(a), a.innerHTML = o);
1067
+ a || (a = document.createElement("style"), a.id = "h6o7ki7", document.head.appendChild(a), a.innerHTML = i);
1051
1068
  })("h6o7ki7", `
1052
1069
  .vtj-startup[data-l-h6o7ki7]{
1053
1070
  padding: 20px;
@@ -1132,43 +1149,43 @@ const le = X({
1132
1149
  typeof t.link == "function" ? t.link() : window.location.href = t.link;
1133
1150
  return;
1134
1151
  }
1135
- let o = (window.__VTJ_LINK__ || {}).href || window.location.pathname + "__vtj__/#/";
1136
- window.location.href = o;
1152
+ let i = (window.__VTJ_LINK__ || {}).href || window.location.pathname + "__vtj__/#/";
1153
+ window.location.href = i;
1137
1154
  }
1138
1155
  };
1139
- return (r, o) => (Xe(), Ze("div", un, [
1140
- E("div", dn, [
1141
- E("h1", pn, [
1142
- E("span", fn, q(t.name), 1)
1156
+ return (r, i) => (Ze(), et("div", dn, [
1157
+ E("div", pn, [
1158
+ E("h1", fn, [
1159
+ E("span", hn, J(t.name), 1)
1143
1160
  ]),
1144
- E("div", hn, q(t.tagline), 1),
1145
- E("div", mn, [
1146
- o[0] || (o[0] = E("span", { "data-l-h6o7ki7": "" }, "设置项目主页后,将替换此页面显示", -1)),
1161
+ E("div", mn, J(t.tagline), 1),
1162
+ E("div", gn, [
1163
+ i[0] || (i[0] = E("span", { "data-l-h6o7ki7": "" }, "设置项目主页后,将替换此页面显示", -1)),
1147
1164
  E("button", {
1148
1165
  "data-l-h6o7ki7": "",
1149
1166
  onClick: n
1150
- }, q(t.actionText), 1)
1167
+ }, J(t.actionText), 1)
1151
1168
  ])
1152
1169
  ])
1153
1170
  ]));
1154
1171
  }
1155
- }), vn = X({
1172
+ }), yn = Z({
1156
1173
  name: "VtjStartupContainer",
1157
1174
  render() {
1158
- return K(gn);
1175
+ return W(vn);
1159
1176
  }
1160
- }), ke = Symbol("Provider");
1161
- var yn = /* @__PURE__ */ ((s) => (s.Production = "production", s.Development = "development", s))(yn || {});
1162
- class _n extends Ae {
1177
+ }), Re = Symbol("Provider");
1178
+ var _n = /* @__PURE__ */ ((s) => (s.Production = "production", s.Development = "development", s))(_n || {});
1179
+ class wn extends Ie {
1163
1180
  constructor(e) {
1164
1181
  super(), this.options = e;
1165
1182
  const {
1166
1183
  service: t,
1167
1184
  mode: n = y.Raw,
1168
1185
  dependencies: r,
1169
- materials: o,
1186
+ materials: i,
1170
1187
  project: a = {},
1171
- adapter: i = {},
1188
+ adapter: o = {},
1172
1189
  globals: c = {},
1173
1190
  modules: l = {},
1174
1191
  router: f = null,
@@ -1176,7 +1193,7 @@ class _n extends Ae {
1176
1193
  nodeEnv: d = "development"
1177
1194
  /* Development */
1178
1195
  } = e;
1179
- this.mode = n, this.modules = l, this.service = t, this.router = f, this.materialPath = u, this.nodeEnv = d, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, c), Object.assign(this.adapter, i);
1196
+ this.mode = n, this.modules = l, this.service = t, this.router = f, this.materialPath = u, this.nodeEnv = d, r && (this.dependencies = r), i && (this.materials = i), Object.assign(this.globals, c), Object.assign(this.adapter, o);
1180
1197
  const { access: h, request: m } = this.adapter;
1181
1198
  h && h.connect({ mode: n, router: f, request: m }), a && n !== y.Design ? this.load(a) : this.project = a, k.setup({
1182
1199
  timeout: "50-500"
@@ -1185,7 +1202,7 @@ class _n extends Ae {
1185
1202
  mode;
1186
1203
  globals = {};
1187
1204
  modules = {};
1188
- adapter = { request: z, jsonp: fe };
1205
+ adapter = { request: K, jsonp: he };
1189
1206
  apis = {};
1190
1207
  dependencies = {};
1191
1208
  materials = {};
@@ -1204,7 +1221,7 @@ class _n extends Ae {
1204
1221
  try {
1205
1222
  n = await e.apply(e, t);
1206
1223
  } catch (r) {
1207
- x.warn("模拟数据模版异常", r);
1224
+ P.warn("模拟数据模版异常", r);
1208
1225
  }
1209
1226
  return k.mock(n);
1210
1227
  };
@@ -1213,8 +1230,8 @@ class _n extends Ae {
1213
1230
  const t = this.modules[`.vtj/projects/${e.id}.json`];
1214
1231
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
1215
1232
  throw new Error("project is null");
1216
- const { apis: n = [], meta: r = [] } = this.project, o = window;
1217
- o.CKEDITOR_VERSION = void 0, this.mode === y.Raw ? await this.loadDependencies(o) : await this.loadAssets(o), this.apis = wt(n, r, this.adapter), be(), St(n), this.initRouter(), this.triggerReady();
1233
+ const { apis: n = [], meta: r = [] } = this.project, i = window;
1234
+ i.CKEDITOR_VERSION = void 0, this.mode === y.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.apis = St(n, r, this.adapter), je(), bt(n), this.initRouter(), this.triggerReady();
1218
1235
  }
1219
1236
  async loadDependencies(e) {
1220
1237
  const t = Object.entries(this.dependencies);
@@ -1222,16 +1239,16 @@ class _n extends Ae {
1222
1239
  e[n] || (e[n] = this.library[n] = await r());
1223
1240
  }
1224
1241
  async loadAssets(e) {
1225
- const { dependencies: t = [] } = this.project, { dependencies: n, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
1242
+ const { dependencies: t = [] } = this.project, { dependencies: n, library: r, components: i, materialPath: a, nodeEnv: o } = this, {
1226
1243
  libraryExports: c,
1227
1244
  libraryMap: l,
1228
1245
  materials: f,
1229
1246
  materialExports: u,
1230
1247
  materialMapLibrary: d
1231
- } = at(
1248
+ } = ct(
1232
1249
  t,
1233
1250
  a,
1234
- i === "development"
1251
+ o === "development"
1235
1252
  /* Development */
1236
1253
  );
1237
1254
  for (const h of c) {
@@ -1243,24 +1260,24 @@ class _n extends Ae {
1243
1260
  else {
1244
1261
  const w = l[h] || [];
1245
1262
  for (const g of w)
1246
- Z(g) && await lt(h, R.append(g, { v: P })), ee(g) && await ie(R.append(g, { v: P }));
1263
+ ee(g) && await ut(h, x.append(g, { v: C })), te(g) && await ae(x.append(g, { v: C }));
1247
1264
  r[h] = e[h];
1248
1265
  }
1249
1266
  }
1250
- if (i === "development") {
1267
+ if (o === "development") {
1251
1268
  for (const m of f)
1252
- await ie(R.append(m, { v: P }));
1269
+ await ae(x.append(m, { v: C }));
1253
1270
  const h = this.materials || {};
1254
1271
  for (const m of u) {
1255
- const p = e[d[m]], w = Ie[m];
1272
+ const p = e[d[m]], w = Me[m];
1256
1273
  if (w)
1257
1274
  p && w.forEach((g) => {
1258
- o[g] = p[g];
1275
+ i[g] = p[g];
1259
1276
  });
1260
1277
  else {
1261
1278
  const g = h[m] ? (await h[m]()).default : e[m];
1262
1279
  g && p && (g.components || []).forEach((S) => {
1263
- o[S.name] = ct(S, p);
1280
+ i[S.name] = lt(S, p);
1264
1281
  });
1265
1282
  }
1266
1283
  }
@@ -1269,30 +1286,30 @@ class _n extends Ae {
1269
1286
  initRouter() {
1270
1287
  const { router: e, project: t, options: n, adapter: r } = this;
1271
1288
  if (!e) return;
1272
- const { routeAppendTo: o, pageRouteName: a = "page", routeMeta: i } = n, c = o ? "" : "/", l = {
1289
+ const { routeAppendTo: i, pageRouteName: a = "page", routeMeta: o } = n, c = i ? "" : "/", l = {
1273
1290
  path: `${c}${a}/:id`,
1274
- name: C,
1275
- component: le
1291
+ name: F,
1292
+ component: ue
1276
1293
  }, f = {
1277
1294
  path: c,
1278
- name: D,
1279
- component: t?.homepage ? le : r.startupComponent || vn,
1280
- meta: i
1295
+ name: H,
1296
+ component: t?.homepage ? ue : r.startupComponent || yn,
1297
+ meta: o
1281
1298
  };
1282
- e.hasRoute(C) && e.removeRoute(C), e.hasRoute(D) && e.removeRoute(D), o ? (e.addRoute(o, l), e.addRoute(o, f)) : (e.addRoute(l), e.addRoute(f));
1299
+ e.hasRoute(F) && e.removeRoute(F), e.hasRoute(H) && e.removeRoute(H), i ? (e.addRoute(i, l), e.addRoute(i, f)) : (e.addRoute(l), e.addRoute(f));
1283
1300
  }
1284
1301
  install(e) {
1285
1302
  const t = e.config.globalProperties.installed || {};
1286
1303
  for (const [n, r] of Object.entries(this.library))
1287
- !t[n] && pt(r) && (e.use(r), t[n] = !0);
1288
- this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(ke, this), e.config.globalProperties.installed = t, this.mode === y.Design && (e.config.errorHandler = (n, r, o) => {
1289
- const a = r?.$options.name, i = typeof n == "string" ? n : n?.message || n?.msg || "未知错误", c = `[ ${a} ] ${i} ${o}`;
1304
+ !t[n] && ft(r) && (e.use(r), t[n] = !0);
1305
+ this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(Re, this), e.config.globalProperties.installed = t, this.mode === y.Design && (e.config.errorHandler = (n, r, i) => {
1306
+ const a = r?.$options.name, o = typeof n == "string" ? n : n?.message || n?.msg || "未知错误", c = `[ ${a} ] ${o} ${i}`;
1290
1307
  console.error(
1291
1308
  "[VTJ Error]:",
1292
1309
  {
1293
1310
  err: n,
1294
1311
  instance: r,
1295
- info: o
1312
+ info: i
1296
1313
  },
1297
1314
  n?.stack
1298
1315
  ), this.adapter.notify && this.adapter.notify(c, "组件渲染错误", "error");
@@ -1303,14 +1320,14 @@ class _n extends Ae {
1303
1320
  return this.getPage(e) || t.find((n) => n.id === e) || null;
1304
1321
  }
1305
1322
  getPage(e) {
1306
- const { pages: t = [] } = this.project || {}, n = (r, o = []) => {
1307
- for (const a of o) {
1323
+ const { pages: t = [] } = this.project || {}, n = (r, i = []) => {
1324
+ for (const a of i) {
1308
1325
  if (a.id === r)
1309
1326
  return a;
1310
1327
  if (a.children && a.children.length) {
1311
- const i = n(r, a.children);
1312
- if (i)
1313
- return i;
1328
+ const o = n(r, a.children);
1329
+ if (o)
1330
+ return o;
1314
1331
  }
1315
1332
  }
1316
1333
  };
@@ -1336,21 +1353,21 @@ class _n extends Ae {
1336
1353
  }).then((n) => n.data).catch(() => null));
1337
1354
  }
1338
1355
  createDslRenderer(e, t = {}) {
1339
- const { library: n, components: r, mode: o, apis: a } = this, i = {
1340
- mode: o,
1356
+ const { library: n, components: r, mode: i, apis: a } = this, o = {
1357
+ mode: i,
1341
1358
  Vue: n.Vue,
1342
1359
  components: r,
1343
1360
  libs: n,
1344
1361
  apis: a,
1345
1362
  window,
1346
1363
  ...t
1347
- }, c = Y({
1364
+ }, c = Q({
1348
1365
  getDsl: async (l) => await this.getDsl(l) || null,
1349
1366
  getDslByUrl: async (l) => await this.getDslByUrl(l) || null,
1350
- options: i
1367
+ options: o
1351
1368
  });
1352
- return G({
1353
- ...i,
1369
+ return Y({
1370
+ ...o,
1354
1371
  dsl: e,
1355
1372
  loader: c
1356
1373
  });
@@ -1358,33 +1375,33 @@ class _n extends Ae {
1358
1375
  async getRenderComponent(e, t) {
1359
1376
  const n = this.getFile(e);
1360
1377
  if (!n)
1361
- return x.warn(`Can not find file: ${e}`), null;
1378
+ return P.warn(`Can not find file: ${e}`), null;
1362
1379
  t && t(n);
1363
- const r = `.vtj/vue/${e}.vue`, o = this.modules[r];
1364
- if (o)
1365
- return (await o())?.default;
1380
+ const r = `.vtj/vue/${e}.vue`, i = this.modules[r];
1381
+ if (i)
1382
+ return (await i())?.default;
1366
1383
  const a = await this.getDsl(n.id);
1367
- return a ? this.createDslRenderer(a).renderer : (x.warn(`Can not find dsl: ${e}`), null);
1384
+ return a ? this.createDslRenderer(a).renderer : (P.warn(`Can not find dsl: ${e}`), null);
1368
1385
  }
1369
1386
  defineUrlSchemaComponent(e, t) {
1370
- return ae(async () => {
1387
+ return ce(async () => {
1371
1388
  const n = await this.getDslByUrl(e);
1372
1389
  return n ? (n.name = t || n.name, this.createDslRenderer(n).renderer) : null;
1373
1390
  });
1374
1391
  }
1375
1392
  definePluginComponent(e) {
1376
- return ae(async () => await je(e, window));
1393
+ return ce(async () => await $e(e, window));
1377
1394
  }
1378
1395
  }
1379
- function In(s) {
1380
- const e = new _n(s);
1396
+ function Mn(s) {
1397
+ const e = new wn(s);
1381
1398
  return {
1382
1399
  provider: e,
1383
1400
  onReady: (n) => e.ready(n)
1384
1401
  };
1385
1402
  }
1386
- function Re(s = {}) {
1387
- const e = he(ke);
1403
+ function xe(s = {}) {
1404
+ const e = me(Re);
1388
1405
  if (!e)
1389
1406
  throw new Error("Can not find provider");
1390
1407
  if (e.nodeEnv === "development") {
@@ -1400,13 +1417,13 @@ function Re(s = {}) {
1400
1417
  }
1401
1418
  return e;
1402
1419
  }
1403
- const xe = {
1420
+ const Pe = {
1404
1421
  type: "json",
1405
1422
  validSuccess: !0,
1406
1423
  originResponse: !1,
1407
1424
  failMessage: !0,
1408
1425
  validate: (s) => s.data?.code === 0
1409
- }, wn = (s, e = "/__vtj__/api/:type.json") => (t, n) => s.send({
1426
+ }, Sn = (s, e = "/__vtj__/api/:type.json") => (t, n) => s.send({
1410
1427
  url: e,
1411
1428
  method: "post",
1412
1429
  params: { type: t },
@@ -1414,8 +1431,8 @@ const xe = {
1414
1431
  type: t,
1415
1432
  data: n
1416
1433
  },
1417
- settings: xe
1418
- }), Sn = (s, e = "/__vtj__/api/uploader.json") => async (t, n) => await s.send({
1434
+ settings: Pe
1435
+ }), bn = (s, e = "/__vtj__/api/uploader.json") => async (t, n) => await s.send({
1419
1436
  url: e,
1420
1437
  method: "post",
1421
1438
  data: {
@@ -1423,12 +1440,12 @@ const xe = {
1423
1440
  projectId: n
1424
1441
  },
1425
1442
  settings: {
1426
- ...xe,
1443
+ ...Pe,
1427
1444
  type: "data"
1428
1445
  }
1429
1446
  }).then((r) => r && r[0] ? r[0] : null).catch(() => null);
1430
- function Mn(s) {
1431
- return pe({
1447
+ function Dn(s) {
1448
+ return fe({
1432
1449
  settings: {
1433
1450
  type: "json",
1434
1451
  validSuccess: !0,
@@ -1441,12 +1458,12 @@ function Mn(s) {
1441
1458
  }
1442
1459
  });
1443
1460
  }
1444
- class ne {
1461
+ class se {
1445
1462
  api;
1446
1463
  pluginCaches = {};
1447
1464
  uploader;
1448
- constructor(e = z) {
1449
- this.api = wn(e), this.uploader = Sn(e);
1465
+ constructor(e = K) {
1466
+ this.api = Sn(e), this.uploader = bn(e);
1450
1467
  }
1451
1468
  async getExtension() {
1452
1469
  console.log("BaseService.getExtension");
@@ -1519,38 +1536,38 @@ class ne {
1519
1536
  return await this.api("clearStaticFiles", e).catch(() => "");
1520
1537
  }
1521
1538
  async getPluginMaterial(e) {
1522
- const { urls: t = [] } = e, n = t.filter((o) => ot(o))[0];
1539
+ const { urls: t = [] } = e, n = t.filter((i) => ot(i))[0];
1523
1540
  if (!n) return null;
1524
1541
  const r = this.pluginCaches[n];
1525
- return r || (this.pluginCaches[n] = z.send({
1542
+ return r || (this.pluginCaches[n] = K.send({
1526
1543
  url: n,
1527
1544
  method: "get",
1528
1545
  settings: {
1529
1546
  validSuccess: !1,
1530
1547
  originResponse: !0
1531
1548
  }
1532
- }).then((o) => o.data).catch(() => null));
1549
+ }).then((i) => i.data).catch(() => null));
1533
1550
  }
1534
1551
  async genSource(e) {
1535
1552
  return console.log("BaseService.genSource", e), "";
1536
1553
  }
1537
1554
  }
1538
- const v = new qe({
1555
+ const v = new Je({
1539
1556
  type: "local",
1540
1557
  expired: 0,
1541
1558
  prefix: "__VTJ_"
1542
1559
  });
1543
- class Dn extends ne {
1560
+ class Hn extends se {
1544
1561
  init(e) {
1545
- const t = new H(e), n = v.get(`project_${t.id}`), r = Object.assign(t.toDsl(), n || {});
1562
+ const t = new O(e), n = v.get(`project_${t.id}`), r = Object.assign(t.toDsl(), n || {});
1546
1563
  return v.save(`project_${t.id}`, r), Promise.resolve(r);
1547
1564
  }
1548
1565
  saveProject(e) {
1549
- const t = new H(e);
1566
+ const t = new O(e);
1550
1567
  return v.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1551
1568
  }
1552
1569
  saveMaterials(e, t) {
1553
- return v.save(`materials_${e.id}`, Q(t)), Promise.resolve(!0);
1570
+ return v.save(`materials_${e.id}`, X(t)), Promise.resolve(!0);
1554
1571
  }
1555
1572
  saveFile(e) {
1556
1573
  return v.save(`file_${e.id}`, e), Promise.resolve(!0);
@@ -1568,13 +1585,13 @@ class Dn extends ne {
1568
1585
  removeHistory(e) {
1569
1586
  const t = v.get(`history_${e}`);
1570
1587
  if (t) {
1571
- const r = (t.items || []).map((o) => o.id);
1588
+ const r = (t.items || []).map((i) => i.id);
1572
1589
  this.removeHistoryItem(e, r), v.remove(`history_${e}`);
1573
1590
  }
1574
1591
  return Promise.resolve(!0);
1575
1592
  }
1576
1593
  getHistory(e) {
1577
- const t = v.get(`history_${e}`), n = new ue(t || { id: e });
1594
+ const t = v.get(`history_${e}`), n = new de(t || { id: e });
1578
1595
  return Promise.resolve(n.toDsl());
1579
1596
  }
1580
1597
  getHistoryItem(e, t) {
@@ -1590,22 +1607,22 @@ class Dn extends ne {
1590
1607
  }), Promise.resolve(!0);
1591
1608
  }
1592
1609
  }
1593
- class bn extends ne {
1610
+ class jn extends se {
1594
1611
  projects = {};
1595
1612
  materials = {};
1596
1613
  files = {};
1597
1614
  histories = {};
1598
1615
  historyItems = {};
1599
1616
  init(e) {
1600
- const t = new H(e), n = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), n);
1617
+ const t = new O(e), n = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), n);
1601
1618
  return this.projects[r.id] = r, Promise.resolve(r);
1602
1619
  }
1603
1620
  saveProject(e) {
1604
- const t = new H(e);
1621
+ const t = new O(e);
1605
1622
  return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
1606
1623
  }
1607
1624
  saveMaterials(e, t) {
1608
- return e.id && (this.materials[e.id] = Q(t)), Promise.resolve(!0);
1625
+ return e.id && (this.materials[e.id] = X(t)), Promise.resolve(!0);
1609
1626
  }
1610
1627
  saveFile(e) {
1611
1628
  return this.files[e.id] = e, Promise.resolve(!0);
@@ -1623,13 +1640,13 @@ class bn extends ne {
1623
1640
  removeHistory(e) {
1624
1641
  const t = this.histories[e];
1625
1642
  if (t) {
1626
- const r = (t.items || []).map((o) => o.id);
1643
+ const r = (t.items || []).map((i) => i.id);
1627
1644
  this.removeHistoryItem(e, r), delete this.historyItems[e];
1628
1645
  }
1629
1646
  return Promise.resolve(!0);
1630
1647
  }
1631
1648
  getHistory(e) {
1632
- const t = this.histories[e], n = new ue(t || { id: e });
1649
+ const t = this.histories[e], n = new de(t || { id: e });
1633
1650
  return Promise.resolve(n);
1634
1651
  }
1635
1652
  getHistoryItem(e, t) {
@@ -1647,11 +1664,11 @@ class bn extends ne {
1647
1664
  }), Promise.resolve(!0);
1648
1665
  }
1649
1666
  }
1650
- let M = null;
1651
- function Hn() {
1652
- return M || (M = new bn(), M);
1667
+ let D = null;
1668
+ function On() {
1669
+ return D || (D = new jn(), D);
1653
1670
  }
1654
- class On extends ne {
1671
+ class Bn extends se {
1655
1672
  getFileCaches = {};
1656
1673
  async getExtension() {
1657
1674
  return await this.api("getExtension", {}).catch(() => {
@@ -1666,7 +1683,7 @@ class On extends ne {
1666
1683
  async saveMaterials(e, t) {
1667
1684
  return !!await this.api("saveMaterials", {
1668
1685
  project: e,
1669
- materials: Q(t)
1686
+ materials: X(t)
1670
1687
  }).catch(() => !1);
1671
1688
  }
1672
1689
  async saveFile(e) {
@@ -1706,125 +1723,125 @@ class On extends ne {
1706
1723
  );
1707
1724
  }
1708
1725
  }
1709
- function Pe(s, e, t = []) {
1726
+ function Ce(s, e, t = []) {
1710
1727
  return t.map((n) => {
1711
- const { id: r, title: o, icon: a, children: i, hidden: c } = n;
1728
+ const { id: r, title: i, icon: a, children: o, hidden: c } = n;
1712
1729
  return {
1713
1730
  id: r,
1714
- title: o,
1731
+ title: i,
1715
1732
  icon: a,
1716
1733
  hidden: c,
1717
1734
  url: `${s}/${e}/${r}`,
1718
- children: i && i.length ? Pe(s, e, i) : void 0
1735
+ children: o && o.length ? Ce(s, e, o) : void 0
1719
1736
  };
1720
1737
  });
1721
1738
  }
1722
- function Ce(s, e) {
1739
+ function Fe(s, e) {
1723
1740
  if (!e) return s;
1724
1741
  let t = [];
1725
1742
  for (const n of s)
1726
1743
  if (n.children && n.children.length) {
1727
- const r = Ce(n.children, e);
1744
+ const r = Fe(n.children, e);
1728
1745
  r.length && (n.children = r, t.push(n));
1729
1746
  } else
1730
1747
  e.can(n.id.toString()) && t.push(n);
1731
1748
  return t;
1732
1749
  }
1733
- function Bn(s) {
1750
+ function Nn(s) {
1734
1751
  const {
1735
1752
  menuPathPrefix: e = "",
1736
1753
  pageRouteName: t = "page",
1737
1754
  disableMenusFilter: n = !1
1738
- } = s || {}, r = Re(), o = ye(), a = vt(), i = F(!1), c = F(!1), l = r.project;
1739
- et(() => {
1740
- const { name: d, params: h, meta: m } = o;
1741
- if (d === C) {
1755
+ } = s || {}, r = xe(), i = _e(), a = yt(), o = T(!1), c = T(!1), l = r.project;
1756
+ tt(() => {
1757
+ const { name: d, params: h, meta: m } = i;
1758
+ if (d === F) {
1742
1759
  const p = r.getPage(h.id);
1743
- i.value = !p?.mask, c.value = !!p?.pure;
1744
- } else if (d === D) {
1760
+ o.value = !p?.mask, c.value = !!p?.pure;
1761
+ } else if (d === H) {
1745
1762
  const p = r.getHomepage();
1746
- i.value = !p?.mask, c.value = !!p?.pure;
1763
+ o.value = !p?.mask, c.value = !!p?.pure;
1747
1764
  } else
1748
- i.value = !m.mask, c.value = !!m.pure;
1765
+ o.value = !m.mask, c.value = !!m.pure;
1749
1766
  });
1750
- const f = Pe(
1767
+ const f = Ce(
1751
1768
  e,
1752
1769
  t,
1753
1770
  l?.pages
1754
1771
  ), u = l?.config;
1755
1772
  return {
1756
- disabled: i,
1773
+ disabled: o,
1757
1774
  logo: u?.logo,
1758
1775
  themeSwitchable: u?.themeSwitchable,
1759
1776
  title: u?.title || l?.description || l?.name || "VTJ App",
1760
- menus: n ? f : Ce(f, a),
1777
+ menus: n ? f : Fe(f, a),
1761
1778
  pure: c
1762
1779
  };
1763
1780
  }
1764
1781
  export {
1765
- Se as ACCESS_KEY,
1766
- Tn as Access,
1767
- rt as BUILD_IN_TAGS,
1768
- tt as BUILT_IN_DIRECTIVES,
1769
- ne as BaseService,
1770
- ce as CONTEXT_HOST,
1771
- $t as Context,
1782
+ be as ACCESS_KEY,
1783
+ An as Access,
1784
+ it as BUILD_IN_TAGS,
1785
+ nt as BUILT_IN_DIRECTIVES,
1786
+ se as BaseService,
1787
+ le as CONTEXT_HOST,
1788
+ Et as Context,
1772
1789
  y as ContextMode,
1773
- nt as DATA_TYPES,
1774
- D as HOMEPAGE_ROUTE_NAME,
1775
- st as HTML_TAGS,
1776
- Fn as JSCodeToString,
1777
- xn as LIFE_CYCLES_LIST,
1778
- On as LocalService,
1779
- bn as MemoryService,
1780
- yn as NodeEnv,
1781
- C as PAGE_ROUTE_NAME,
1782
- _n as Provider,
1783
- gn as Startup,
1784
- Dn as StorageService,
1785
- P as VTJ_RENDERER_VERSION,
1786
- we as adoptedStyleSheets,
1787
- An as createAdapter,
1788
- Pn as createAssetScripts,
1789
- Cn as createAssetsCss,
1790
- Ft as createDataSources,
1791
- Y as createLoader,
1792
- Hn as createMemoryService,
1793
- _t as createMetaApi,
1794
- bt as createMock,
1795
- In as createProvider,
1796
- G as createRenderer,
1797
- yt as createSchemaApi,
1798
- wt as createSchemaApis,
1799
- Mn as createServiceRequest,
1800
- It as defaultLoader,
1801
- I as fillBasePath,
1802
- $e as getModifiers,
1803
- je as getPlugin,
1804
- ct as getRawComponent,
1805
- ft as isBuiltInTag,
1806
- Z as isCSSUrl,
1807
- mt as isJSCode,
1790
+ st as DATA_TYPES,
1791
+ H as HOMEPAGE_ROUTE_NAME,
1792
+ rt as HTML_TAGS,
1793
+ Tn as JSCodeToString,
1794
+ Pn as LIFE_CYCLES_LIST,
1795
+ Bn as LocalService,
1796
+ jn as MemoryService,
1797
+ _n as NodeEnv,
1798
+ F as PAGE_ROUTE_NAME,
1799
+ wn as Provider,
1800
+ vn as Startup,
1801
+ Hn as StorageService,
1802
+ C as VTJ_RENDERER_VERSION,
1803
+ Se as adoptedStyleSheets,
1804
+ In as createAdapter,
1805
+ Cn as createAssetScripts,
1806
+ Fn as createAssetsCss,
1807
+ Tt as createDataSources,
1808
+ Q as createLoader,
1809
+ On as createMemoryService,
1810
+ wt as createMetaApi,
1811
+ jt as createMock,
1812
+ Mn as createProvider,
1813
+ Y as createRenderer,
1814
+ _t as createSchemaApi,
1815
+ St as createSchemaApis,
1816
+ Dn as createServiceRequest,
1817
+ Mt as defaultLoader,
1818
+ M as fillBasePath,
1819
+ Ee as getModifiers,
1820
+ $e as getPlugin,
1821
+ lt as getRawComponent,
1822
+ ht as isBuiltInTag,
1823
+ ee as isCSSUrl,
1824
+ gt as isJSCode,
1808
1825
  _ as isJSExpression,
1809
- A as isJSFunction,
1826
+ I as isJSFunction,
1810
1827
  ot as isJSON,
1811
- ee as isJSUrl,
1812
- ht as isNativeTag,
1813
- pt as isVuePlugin,
1814
- lt as loadCss,
1815
- ut as loadCssUrl,
1816
- dt as loadScriptUrl,
1817
- jt as mockApi,
1818
- St as mockApis,
1819
- be as mockCleanup,
1820
- O as nodeRender,
1821
- at as parseDeps,
1822
- T as parseExpression,
1823
- W as parseFunction,
1824
- ke as providerKey,
1825
- it as removeProdFlag,
1826
- _e as toString,
1827
- vt as useAccess,
1828
- Bn as useMask,
1829
- Re as useProvider
1828
+ te as isJSUrl,
1829
+ mt as isNativeTag,
1830
+ ft as isVuePlugin,
1831
+ ut as loadCss,
1832
+ dt as loadCssUrl,
1833
+ pt as loadScriptUrl,
1834
+ $t as mockApi,
1835
+ bt as mockApis,
1836
+ je as mockCleanup,
1837
+ B as nodeRender,
1838
+ ct as parseDeps,
1839
+ A as parseExpression,
1840
+ G as parseFunction,
1841
+ Re as providerKey,
1842
+ at as removeProdFlag,
1843
+ we as toString,
1844
+ yt as useAccess,
1845
+ Nn as useMask,
1846
+ xe as useProvider
1830
1847
  };