@vtj/renderer 0.9.0 → 0.9.2

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 xe, BUILT_IN_COMPONENTS as ke, ProjectModel as T, HistoryModel as ue } from "@vtj/core";
2
- import { isUrl as Ce, url as P, dedupArray as Fe, isString as S, isFunction as z, logger as D, createRequest as Ae, merge as Ie, pathToRegexp as Oe, pathToRegexpMatch as Me, formDataToJson as Te, storage as L, cookie as q, toArray as ne, unRSA as re, delay as de, camelCase as $, upperFirst as De, pick as He, jsonp as Be, loadScript as oe, Request as Ne, Storage as Ue, mapToObject as Y } from "@vtj/utils";
1
+ import { Base as Ae, BUILT_IN_COMPONENTS as Te, ProjectModel as H, HistoryModel as de } from "@vtj/core";
2
+ import { isUrl as Ie, url as x, dedupArray as De, isString as j, isFunction as K, logger as M, createRequest as He, merge as Me, pathToRegexp as Oe, pathToRegexpMatch as Be, formDataToJson as Ne, storage as q, cookie as J, toArray as oe, unRSA as ie, delay as fe, camelCase as $, upperFirst as Ue, pick as Le, jsonp as qe, loadScript as ae, Request as Je, Storage as Ve, mapToObject as Q } from "@vtj/utils";
3
3
  import * as B from "vue";
4
- import { inject as pe, toRef as Le, readonly as qe, customRef as Je, ref as C, onBeforeUnmount as Ve, getCurrentScope as ze, onScopeDispose as Ke, unref as We, getCurrentInstance as fe, watch as he, computed as me, onMounted as Ge, defineComponent as Q, h as K, openBlock as Ye, createElementBlock as Qe, createElementVNode as b, toDisplayString as J, defineAsyncComponent as ie, watchEffect as Xe } from "vue";
5
- import { ElNotification as N, ElLoading as Ze } from "element-plus";
6
- import { useRoute as ge } from "vue-router";
4
+ import { inject as he, toRef as ze, readonly as Ke, customRef as We, ref as F, onBeforeUnmount as Ge, getCurrentScope as Ye, onScopeDispose as Qe, unref as Xe, getCurrentInstance as me, watch as ge, computed as ve, onMounted as Ze, defineComponent as X, h as W, openBlock as et, createElementBlock as tt, createElementVNode as E, toDisplayString as V, defineAsyncComponent as ce, watchEffect as st } from "vue";
5
+ import { ElNotification as N, ElLoading as nt } from "element-plus";
6
+ import { useRoute as ye } from "vue-router";
7
7
  /**!
8
8
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
9
9
  * @name @vtj/renderer
10
10
  * @author CHC chenhuachun1549@dingtalk.com
11
- * @version 0.9.0
11
+ * @version 0.9.2
12
12
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
13
13
  */
14
- const x = "0.9.0";
15
- var _ = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(_ || {});
16
- const ae = [
14
+ const k = "0.9.2";
15
+ var y = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(y || {});
16
+ const le = [
17
17
  "$el",
18
18
  "$emit",
19
19
  "$nextTick",
@@ -25,7 +25,7 @@ const ae = [
25
25
  "$props",
26
26
  "$options",
27
27
  "$forceUpdate"
28
- ], ws = [
28
+ ], Cs = [
29
29
  "beforeCreate",
30
30
  "created",
31
31
  "beforeMount",
@@ -39,7 +39,14 @@ const ae = [
39
39
  "renderTriggered",
40
40
  "activated",
41
41
  "deactivated"
42
- ], et = ["vIf", "vShow", "vModel", "vFor", "vBind"], tt = {
42
+ ], rt = [
43
+ "vIf",
44
+ "vShow",
45
+ "vModel",
46
+ "vFor",
47
+ "vBind",
48
+ "vHtml"
49
+ ], ot = {
43
50
  String,
44
51
  Number,
45
52
  Boolean,
@@ -47,65 +54,67 @@ const ae = [
47
54
  Object,
48
55
  Function,
49
56
  Date
50
- }, k = "VtjPage", M = "VtjHomepage";
51
- function I(n, e) {
52
- return n.map((t) => Ce(t) || t.startsWith("/") ? t : `${e}${t}`);
57
+ }, C = "VtjPage", D = "VtjHomepage", it = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot".split(
58
+ ","
59
+ ), at = "component,slot".split(",");
60
+ function T(n, e) {
61
+ return n.map((t) => Ie(t) || t.startsWith("/") ? t : `${e}${t}`);
53
62
  }
54
- function X(n) {
63
+ function Z(n) {
55
64
  return /\.css$/.test(n);
56
65
  }
57
- function Z(n) {
66
+ function ee(n) {
58
67
  return /\.js$/.test(n);
59
68
  }
60
- function st(n) {
69
+ function ct(n) {
61
70
  return /\.json$/.test(n);
62
71
  }
63
- function Ss(n) {
72
+ function Fs(n) {
64
73
  return n.map(
65
- (e) => `<script src="${P.append(e, { v: x })}"><\/script>`
74
+ (e) => `<script src="${x.append(e, { v: k })}"><\/script>`
66
75
  ).join("");
67
76
  }
68
- function js(n = []) {
77
+ function As(n = []) {
69
78
  return n.map(
70
- (e) => `<link rel="stylesheet" href="${P.append(e, { v: x })}" />`
79
+ (e) => `<link rel="stylesheet" href="${x.append(e, { v: k })}" />`
71
80
  ).join("");
72
81
  }
73
- function nt(n, e = !1) {
82
+ function lt(n, e = !1) {
74
83
  return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
75
84
  }
76
- function rt(n, e, t = !1) {
77
- const s = n.filter((p) => !!p.enabled), r = [], o = [], a = [], i = [], l = {}, c = {}, f = [], u = {};
85
+ function ut(n, e, t = !1) {
86
+ const s = n.filter((p) => !!p.enabled), r = [], o = [], a = [], i = [], c = {}, l = {}, f = [], u = {};
78
87
  return s.forEach(
79
- ({ urls: p, assetsUrl: d, library: h, assetsLibrary: m, localeLibrary: v }) => {
88
+ ({ urls: p, assetsUrl: h, library: m, assetsLibrary: d, localeLibrary: w }) => {
80
89
  p?.forEach((g) => {
81
- Z(g) && r.push(nt(g, t)), X(g) && o.push(g);
82
- }), h && (i.push(h), l[h] = I(p || [], e), v && (c[h] = v)), d && a.push(d), m && f.push(m), h && m && (u[m] = h);
90
+ ee(g) && r.push(lt(g, t)), Z(g) && o.push(g);
91
+ }), m && (i.push(m), c[m] = T(p || [], e), w && (l[m] = w)), h && a.push(h), d && f.push(d), m && d && (u[d] = m);
83
92
  }
84
93
  ), {
85
- scripts: I(r, e),
86
- css: I(o, e),
87
- materials: I(a, e),
94
+ scripts: T(r, e),
95
+ css: T(o, e),
96
+ materials: T(a, e),
88
97
  libraryExports: i,
89
- materialExports: Fe(f),
98
+ materialExports: De(f),
90
99
  materialMapLibrary: u,
91
- libraryMap: l,
92
- libraryLocaleMap: c
100
+ libraryMap: c,
101
+ libraryLocaleMap: l
93
102
  };
94
103
  }
95
- function ot(n, e) {
104
+ function pt(n, e) {
96
105
  const { name: t, parent: s, alias: r } = n;
97
106
  return s ? e[s]?.[r || t] : e[r || t];
98
107
  }
99
- function ve(n) {
100
- return S(n) ? n : JSON.stringify(n);
108
+ function _e(n) {
109
+ return j(n) ? n : JSON.stringify(n);
101
110
  }
102
- function ye(n, e, t) {
111
+ function we(n, e, t) {
103
112
  const s = n.CSSStyleSheet;
104
113
  if (s.prototype.replaceSync) {
105
114
  const r = new s();
106
115
  r.id = e, r.replaceSync(t);
107
116
  const o = n.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
108
- (l) => l.id !== e
117
+ (c) => c.id !== e
109
118
  );
110
119
  o.adoptedStyleSheets = [...i, r];
111
120
  } else {
@@ -114,11 +123,11 @@ function ye(n, e, t) {
114
123
  o ? o.innerHTML = t : (o = r.createElement("style"), o.id = e, o.innerHTML = t, r.head.appendChild(o));
115
124
  }
116
125
  }
117
- async function it(n, e) {
126
+ async function dt(n, e) {
118
127
  const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
119
- t && ye(window, n, t);
128
+ t && we(window, n, t);
120
129
  }
121
- function at(n, e = window) {
130
+ function ft(n, e = window) {
122
131
  const t = e.document, s = e.document.head;
123
132
  for (const r of n)
124
133
  if (!t.getElementById(r)) {
@@ -126,40 +135,46 @@ function at(n, e = window) {
126
135
  a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
127
136
  }
128
137
  }
129
- async function ct(n, e, t = window) {
138
+ async function ht(n, e, t = window) {
130
139
  const s = t.document, r = t.document.head;
131
140
  let o = t[e];
132
141
  return o ? o.default || o : new Promise((a, i) => {
133
- for (const l of n) {
134
- const c = s.createElement("script");
135
- c.src = l, c.onload = () => {
142
+ for (const c of n) {
143
+ const l = s.createElement("script");
144
+ l.src = c, l.onload = () => {
136
145
  o = t[e], o ? a(o.default || o) : i(null);
137
- }, c.onerror = (f) => {
146
+ }, l.onerror = (f) => {
138
147
  i(f);
139
- }, r.appendChild(c);
148
+ }, r.appendChild(l);
140
149
  }
141
150
  });
142
151
  }
143
- function lt(n) {
144
- return z(n) || z(n?.install);
152
+ function mt(n) {
153
+ return K(n) || K(n?.install);
154
+ }
155
+ function gt(n) {
156
+ return at.includes(n);
157
+ }
158
+ function vt(n) {
159
+ return it.includes(n);
145
160
  }
146
- function F(n, e, t = !1, s = !1) {
161
+ function A(n, e, t = !1, s = !1) {
147
162
  try {
148
163
  const r = ['"use strict";', "var __self = arguments[0];"];
149
164
  r.push("return ");
150
165
  let o = (n.value || "").trim();
151
- o = o.replace(/this(\W|$)/g, (i, l) => `__self${l}`), o = r.join(`
166
+ o = o.replace(/this(\W|$)/g, (i, c) => `__self${c}`), o = r.join(`
152
167
  `) + o;
153
168
  const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
154
169
  return new Function("$scope", a)(e);
155
170
  } catch (r) {
156
- if (D.error("parseExpression.error", r, n, e?.__self ?? e), s)
171
+ if (M.error("parseExpression.error", r, n, e?.__self ?? e), s)
157
172
  throw r;
158
173
  }
159
174
  }
160
- function ce(n, e, t = !1, s = !1) {
161
- const r = F(n, e, t, s);
162
- if (typeof r != "function" && (D.error(
175
+ function ue(n, e, t = !1, s = !1) {
176
+ const r = A(n, e, t, s);
177
+ if (typeof r != "function" && (M.error(
163
178
  "parseFunction.error",
164
179
  "not a function",
165
180
  n,
@@ -168,20 +183,20 @@ function ce(n, e, t = !1, s = !1) {
168
183
  throw new Error(`"${n.value}" not a function`);
169
184
  return r;
170
185
  }
171
- function w(n) {
186
+ function _(n) {
172
187
  return n && n.type === "JSExpression";
173
188
  }
174
189
  function U(n) {
175
190
  return typeof n == "object" && n && n.type === "JSFunction";
176
191
  }
177
- function ut(n) {
178
- return w(n) || U(n);
192
+ function yt(n) {
193
+ return _(n) || U(n);
179
194
  }
180
- function $s(n) {
181
- return ut(n) ? n.value : JSON.stringify(n);
195
+ function Ts(n) {
196
+ return yt(n) ? n.value : JSON.stringify(n);
182
197
  }
183
- let E = null;
184
- const dt = Ae({
198
+ let R = null;
199
+ const _t = He({
185
200
  settings: {
186
201
  type: "form",
187
202
  validSuccess: !0,
@@ -195,19 +210,19 @@ const dt = Ae({
195
210
  });
196
211
  },
197
212
  showLoading: () => {
198
- E && E.close(), E = Ze.service({
213
+ R && R.close(), R = nt.service({
199
214
  lock: !0,
200
215
  text: "Loading",
201
216
  background: "rgba(0, 0, 0, 0.05)"
202
217
  });
203
218
  },
204
219
  hideLoading: () => {
205
- E && (E.close(), E = null);
220
+ R && (R.close(), R = null);
206
221
  }
207
222
  }
208
223
  });
209
- let R;
210
- function pt(n, e) {
224
+ let P;
225
+ function wt(n, e) {
211
226
  const { jsonp: t, request: s } = e;
212
227
  if (n.method === "jsonp")
213
228
  return (r = {}) => t(n.url, {
@@ -215,7 +230,7 @@ function pt(n, e) {
215
230
  query: r
216
231
  });
217
232
  {
218
- const r = n.headers ? F(n.headers, {}, !0) : void 0, o = {
233
+ const r = n.headers ? A(n.headers, {}, !0) : void 0, o = {
219
234
  url: n.url,
220
235
  method: n.method,
221
236
  settings: {
@@ -223,10 +238,10 @@ function pt(n, e) {
223
238
  headers: r
224
239
  }
225
240
  };
226
- return (a, i) => (delete o.data, s.send(Ie(o, i || {}, { data: a })));
241
+ return (a, i) => (delete o.data, s.send(Me(o, i || {}, { data: a })));
227
242
  }
228
243
  }
229
- function ft(n, e) {
244
+ function St(n, e) {
230
245
  const { metaQuery: t } = e;
231
246
  if (!t) return;
232
247
  const { code: s, queryCode: r } = n;
@@ -238,34 +253,34 @@ function ft(n, e) {
238
253
  return t(s, r, o, a);
239
254
  };
240
255
  }
241
- function ht(n = [], e = [], t) {
256
+ function bt(n = [], e = [], t) {
242
257
  const s = {};
243
258
  for (const r of n)
244
- s[r.id] = pt(r, t);
259
+ s[r.id] = wt(r, t);
245
260
  for (const r of e)
246
- s[r.id] = ft(r, t);
261
+ s[r.id] = St(r, t);
247
262
  return s;
248
263
  }
249
- async function mt(n = []) {
250
- R = await import("mockjs").then((e) => e.default || e), R && (R.setup({
264
+ async function jt(n = []) {
265
+ P = await import("mockjs").then((e) => e.default || e), P && (P.setup({
251
266
  timeout: "50-500"
252
- }), _e(), n.forEach((e) => gt(R, e)));
267
+ }), Se(), n.forEach((e) => $t(P, e)));
253
268
  }
254
- function gt(n, e) {
269
+ function $t(n, e) {
255
270
  if (!e.mock) return;
256
271
  const { url: t, mockTemplate: s } = e;
257
272
  if (t && s) {
258
- const r = Oe(`${t}(.*)`), o = Me(t, { decode: decodeURIComponent }), a = F(s, {}, !0);
273
+ const r = Oe(`${t}(.*)`), o = Be(t, { decode: decodeURIComponent }), a = A(s, {}, !0);
259
274
  n.mock(r, (i) => {
260
- const l = P.parse(i.url) || {}, c = i.body instanceof FormData ? Te(i.body) : i.body, f = o(i.url)?.params;
261
- return Object.assign(i, { data: c, params: l, query: f }), n.mock(a(i));
275
+ const c = x.parse(i.url) || {}, l = i.body instanceof FormData ? Ne(i.body) : i.body, f = o(i.url)?.params;
276
+ return Object.assign(i, { data: l, params: c, query: f }), n.mock(a(i));
262
277
  });
263
278
  }
264
279
  }
265
- function _e() {
266
- R && (R._mocked = {});
280
+ function Se() {
281
+ P && (P._mocked = {});
267
282
  }
268
- const vt = {
283
+ const Et = {
269
284
  session: !1,
270
285
  authKey: "Authorization",
271
286
  storageKey: "ACCESS_STORAGE",
@@ -277,31 +292,31 @@ const vt = {
277
292
  unauthorizedMessage: "登录已经失效,请重新登录!",
278
293
  noPermissionMessage: "无权限访问该页面",
279
294
  appName: ""
280
- }, we = Symbol("access");
281
- class bs {
295
+ }, be = Symbol("access");
296
+ class Is {
282
297
  options;
283
298
  data = null;
284
- mode = _.Raw;
299
+ mode = y.Raw;
285
300
  constructor(e) {
286
- this.options = Object.assign({}, vt, e), this.loadData();
301
+ this.options = Object.assign({}, Et, e), this.loadData();
287
302
  }
288
303
  connect(e) {
289
304
  const { mode: t, router: s, request: r } = e;
290
- this.mode = t, s && this.mode === _.Raw && this.setGuard(s), r && this.setRequest(r);
305
+ this.mode = t, s && this.mode === y.Raw && this.setGuard(s), r && this.setRequest(r);
291
306
  }
292
307
  login(e) {
293
308
  const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
294
- this.setData(e), this.data && (L.save(t, e, {
309
+ this.setData(e), this.data && (q.save(t, e, {
295
310
  type: "local",
296
311
  prefix: s
297
- }), r && q.set(o, this.data.token));
312
+ }), r && J.set(o, this.data.token));
298
313
  }
299
314
  clear() {
300
315
  const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
301
- this.data = null, L.remove(e, {
316
+ this.data = null, q.remove(e, {
302
317
  type: "local",
303
318
  prefix: t
304
- }), s && q.remove(r);
319
+ }), s && J.remove(r);
305
320
  }
306
321
  logout() {
307
322
  this.clear(), this.toLogin();
@@ -314,14 +329,14 @@ class bs {
314
329
  }
315
330
  can(e) {
316
331
  const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
317
- return typeof e == "function" ? e(s) : ne(e).every((o) => s[o] || s[t + "." + o]);
332
+ return typeof e == "function" ? e(s) : oe(e).every((o) => s[o] || s[t + "." + o]);
318
333
  }
319
334
  some(e) {
320
335
  const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
321
- return ne(e).some((o) => s[o] || s[t + "." + o]);
336
+ return oe(e).some((o) => s[o] || s[t + "." + o]);
322
337
  }
323
338
  install(e) {
324
- e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(we, this);
339
+ e.config.globalProperties.$access || (e.config.globalProperties.$access = this), e.provide(be, this);
325
340
  }
326
341
  isAuthPath(e) {
327
342
  const { auth: t, isAuth: s } = this.options;
@@ -342,13 +357,13 @@ class bs {
342
357
  setData(e) {
343
358
  const { privateKey: t } = this.options;
344
359
  if (Array.isArray(e) && t) {
345
- const s = e.map((r) => re(r, t));
360
+ const s = e.map((r) => ie(r, t));
346
361
  this.data = JSON.parse(s.join(""));
347
362
  return;
348
363
  }
349
364
  if (typeof e == "string")
350
365
  try {
351
- const s = t ? re(e, t) : e;
366
+ const s = t ? ie(e, t) : e;
352
367
  s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
353
368
  } catch (s) {
354
369
  console.warn(s);
@@ -357,7 +372,7 @@ class bs {
357
372
  this.data = e;
358
373
  }
359
374
  loadData() {
360
- const { storageKey: e, storagePrefix: t } = this.options, s = L.get(e, {
375
+ const { storageKey: e, storagePrefix: t } = this.options, s = q.get(e, {
361
376
  type: "local",
362
377
  prefix: t
363
378
  });
@@ -365,10 +380,10 @@ class bs {
365
380
  }
366
381
  isLogined() {
367
382
  const { session: e, authKey: t } = this.options;
368
- return e && t ? !!q.get(t) : !!this.getToken();
383
+ return e && t ? !!J.get(t) : !!this.getToken();
369
384
  }
370
385
  hasRoutePermission(e) {
371
- if (e.name === k) {
386
+ if (e.name === C) {
372
387
  const t = e.params.id;
373
388
  return t && this.can(t);
374
389
  }
@@ -385,7 +400,7 @@ class bs {
385
400
  return t();
386
401
  {
387
402
  const { noPermissionMessage: s = "无权限访问", unauthorized: r = !1 } = this.options;
388
- return await this.showTip(s), z(r) ? (r(), t(!1)) : S(r) ? t(r) : t(!1);
403
+ return await this.showTip(s), K(r) ? (r(), t(!1)) : j(r) ? t(r) : t(!1);
389
404
  }
390
405
  }
391
406
  t(!1), this.toLogin();
@@ -404,7 +419,7 @@ class bs {
404
419
  }
405
420
  async showTip(e) {
406
421
  const { alert: t } = this.options;
407
- return t ? (await de(150), await t(e, {
422
+ return t ? (await fe(150), await t(e, {
408
423
  title: "提示",
409
424
  type: "warning"
410
425
  }).catch(() => !1)) : !1;
@@ -419,10 +434,10 @@ class bs {
419
434
  );
420
435
  }
421
436
  }
422
- function yt() {
423
- return pe(we, null);
437
+ function Rt() {
438
+ return he(be, null);
424
439
  }
425
- class _t {
440
+ class Pt {
426
441
  __id = null;
427
442
  __mode;
428
443
  __instance = null;
@@ -465,41 +480,41 @@ class _t {
465
480
  });
466
481
  }
467
482
  __proxy() {
468
- this.__instance && ae.forEach((e) => {
483
+ this.__instance && le.forEach((e) => {
469
484
  this[e] = this.__instance?.[e];
470
485
  });
471
486
  }
472
487
  __cleanup() {
473
- ae.forEach((e) => {
488
+ le.forEach((e) => {
474
489
  this[e] = null;
475
490
  });
476
491
  }
477
492
  __parseFunction(e) {
478
493
  if (e)
479
- if (this.__mode === _.Runtime) {
494
+ if (this.__mode === y.Runtime) {
480
495
  const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
481
- return ce({ type: s, value: r }, this);
496
+ return ue({ type: s, value: r }, this);
482
497
  } else
483
- return ce(e, this);
498
+ return ue(e, this);
484
499
  }
485
500
  __parseExpression(e) {
486
501
  if (e)
487
- if (this.__mode === _.Runtime) {
502
+ if (this.__mode === y.Runtime) {
488
503
  const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
489
- return F({ type: s, value: r }, this);
504
+ return A({ type: s, value: r }, this);
490
505
  } else
491
- return F(e, this);
506
+ return A(e, this);
492
507
  }
493
508
  __ref(e = null, t) {
494
- if (this.__mode !== _.VNode)
509
+ if (this.__mode !== y.VNode)
495
510
  return e && e !== this.__id && (this.__contextRefs[e] = this), async (s) => {
496
- await de(0);
511
+ await fe(0);
497
512
  let r = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
498
513
  if (!r) {
499
514
  typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
500
515
  return;
501
516
  }
502
- if (r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, _.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = s), typeof t == "function")
517
+ if (r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, y.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = s), typeof t == "function")
503
518
  t(s);
504
519
  else if (t) {
505
520
  const o = this.$refs[t];
@@ -520,72 +535,72 @@ class _t {
520
535
  return s.context.__proto__ = this.context, s.__proto__ = this, s;
521
536
  }
522
537
  }
523
- function W(n) {
538
+ function G(n) {
524
539
  const {
525
540
  Vue: e = B,
526
- mode: t = _.Runtime,
541
+ mode: t = y.Runtime,
527
542
  components: s = {},
528
543
  libs: r = {},
529
544
  apis: o = {},
530
545
  loader: a
531
- } = n, i = e.computed(() => n.dsl), l = {
546
+ } = n, i = e.computed(() => n.dsl), c = {
532
547
  $components: s,
533
548
  $libs: r,
534
549
  $apis: o
535
- }, c = new _t({
550
+ }, l = new Pt({
536
551
  mode: t,
537
552
  dsl: i.value,
538
- attrs: l
553
+ attrs: c
539
554
  }), f = e.defineComponent({
540
555
  name: i.value.name,
541
556
  props: {
542
- ...St(i.value.props ?? [], c)
557
+ ...kt(i.value.props ?? [], l)
543
558
  },
544
559
  setup(u) {
545
- c.$props = u, c.props = u, i.value.id && ye(
560
+ l.$props = u, l.props = u, i.value.id && we(
546
561
  n.window || window,
547
562
  i.value.id,
548
563
  i.value.css || ""
549
- ), c.state = jt(e, i.value.state ?? {}, c);
550
- const p = $t(e, i.value.computed ?? {}, c), d = bt(i.value.methods ?? {}, c), h = Et(e, i.value.inject, c), m = Rt(
564
+ ), l.state = Ct(e, i.value.state ?? {}, l);
565
+ const p = Ft(e, i.value.computed ?? {}, l), h = At(i.value.methods ?? {}, l), m = Tt(e, i.value.inject, l), d = It(
551
566
  i.value.dataSources || {},
552
- c
553
- ), v = {
554
- ...h,
567
+ l
568
+ ), w = {
569
+ ...m,
555
570
  ...p,
556
- ...d,
557
- ...m
571
+ ...h,
572
+ ...d
558
573
  };
559
- return c.setup(v, e), Pt(e, i.value.watch ?? [], c), {
560
- vtj: c
574
+ return l.setup(w, e), Dt(e, i.value.watch ?? [], l), {
575
+ vtj: l
561
576
  };
562
577
  },
563
- emits: wt(i.value.emits),
578
+ emits: xt(i.value.emits),
564
579
  expose: ["vtj"],
565
580
  render() {
566
581
  if (!i.value.nodes) return null;
567
582
  const u = i.value.nodes || [];
568
- return u.length === 1 ? H(u[0], c, e, a) : u.map((p) => H(p, c, e, a));
583
+ return u.length === 1 ? O(u[0], l, e, a) : u.map((p) => O(p, l, e, a));
569
584
  },
570
- ...xt(i.value.lifeCycles ?? {}, c)
585
+ ...Ht(i.value.lifeCycles ?? {}, l)
571
586
  });
572
587
  return {
573
588
  renderer: e.markRaw(f),
574
- context: c
589
+ context: l
575
590
  };
576
591
  }
577
- function wt(n = []) {
578
- return n.map((e) => S(e) ? e : e.name);
592
+ function xt(n = []) {
593
+ return n.map((e) => j(e) ? e : e.name);
579
594
  }
580
- function St(n = [], e) {
581
- const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => tt[o]) : void 0;
582
- return n.map((s) => S(s) ? {
595
+ function kt(n = [], e) {
596
+ const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => ot[o]) : void 0;
597
+ return n.map((s) => j(s) ? {
583
598
  name: s
584
599
  } : {
585
600
  name: s.name,
586
601
  type: s.type,
587
602
  required: s.required,
588
- default: w(s.default) ? e.__parseExpression(s.default) : s.default
603
+ default: _(s.default) ? e.__parseExpression(s.default) : s.default
589
604
  }).reduce(
590
605
  (s, r) => (s[r.name] = {
591
606
  type: t(r.type),
@@ -595,53 +610,53 @@ function St(n = [], e) {
595
610
  {}
596
611
  );
597
612
  }
598
- function jt(n, e, t) {
613
+ function Ct(n, e, t) {
599
614
  return n.reactive(
600
615
  Object.keys(e || {}).reduce(
601
616
  (s, r) => {
602
617
  let o = e[r];
603
- return w(o) ? o = t.__parseExpression(o) : U(o) && (o = t.__parseFunction(o)), s[r] = o, s;
618
+ return _(o) ? o = t.__parseExpression(o) : U(o) && (o = t.__parseFunction(o)), s[r] = o, s;
604
619
  },
605
620
  {}
606
621
  )
607
622
  );
608
623
  }
609
- function $t(n, e, t) {
624
+ function Ft(n, e, t) {
610
625
  return Object.entries(e ?? {}).reduce(
611
626
  (s, [r, o]) => (s[r] = n.computed(t.__parseFunction(o)), s),
612
627
  {}
613
628
  );
614
629
  }
615
- function bt(n, e) {
630
+ function At(n, e) {
616
631
  return Object.entries(n ?? {}).reduce(
617
632
  (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
618
633
  {}
619
634
  );
620
635
  }
621
- function Et(n, e = [], t) {
636
+ function Tt(n, e = [], t) {
622
637
  return e.reduce(
623
638
  (s, r) => {
624
639
  const { name: o, from: a } = r || {};
625
640
  r.default;
626
- const i = w(a) ? t.__parseExpression(a) || o : a ?? o, l = w(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
627
- return s[o] = n.inject(i, l), s;
641
+ const i = _(a) ? t.__parseExpression(a) || o : a ?? o, c = _(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
642
+ return s[o] = n.inject(i, c), s;
628
643
  },
629
644
  {}
630
645
  );
631
646
  }
632
- function Rt(n, e) {
647
+ function It(n, e) {
633
648
  return Object.keys(n).reduce(
634
649
  (t, s) => {
635
650
  const r = n[s], o = e.$apis[r.ref], a = U(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
636
651
  return t[s] = async (...i) => {
637
- const l = await o.apply(e, i);
638
- return a ? a(l) : l;
652
+ const c = await o.apply(e, i);
653
+ return a ? a(c) : c;
639
654
  }, t;
640
655
  },
641
656
  {}
642
657
  );
643
658
  }
644
- function Pt(n, e = [], t) {
659
+ function Dt(n, e = [], t) {
645
660
  e.forEach((s) => {
646
661
  n.watch(
647
662
  t.__parseExpression(s.source),
@@ -653,111 +668,125 @@ function Pt(n, e = [], t) {
653
668
  );
654
669
  });
655
670
  }
656
- function xt(n, e) {
671
+ function Ht(n, e) {
657
672
  return Object.entries(n ?? {}).reduce(
658
673
  (t, [s, r]) => (t[s] = e.__parseFunction(r), t),
659
674
  {}
660
675
  );
661
676
  }
662
- let V = [];
663
- const kt = (n) => n;
664
- async function Se(n, e = window) {
665
- const { urls: t = [], library: s } = n, r = t.filter((i) => Z(i));
677
+ let z = [];
678
+ const Mt = (n) => n;
679
+ async function je(n, e = window) {
680
+ const { urls: t = [], library: s } = n, r = t.filter((i) => ee(i));
666
681
  if (r.length === 0 || !s) return null;
667
- const o = t.filter((i) => X(i));
668
- return o.length && at(o, e), await ct(r, s, e).catch(
682
+ const o = t.filter((i) => Z(i));
683
+ return o.length && ft(o, e), await ht(r, s, e).catch(
669
684
  (i) => (console.warn("loadScriptUrl error", r, s, i), null)
670
685
  );
671
686
  }
672
- function G(n) {
687
+ function Y(n) {
673
688
  const { getDsl: e, getDslByUrl: t, options: s } = n;
674
- return s.window && (V.forEach((r) => {
689
+ return s.window && (z.forEach((r) => {
675
690
  delete s.window[r];
676
- }), V = []), (r, o, a = B) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
691
+ }), z = []), (r, o, a = B) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
677
692
  const i = await e(o.id);
678
- return i && (i.name = r), i ? W({
693
+ return i && (i.name = r), i ? G({
679
694
  ...s,
680
695
  Vue: a,
681
696
  dsl: i,
682
- mode: _.Runtime,
683
- loader: G(n)
697
+ mode: y.Runtime,
698
+ loader: Y(n)
684
699
  }).renderer : null;
685
700
  }) : o.type === "UrlSchema" && o.url ? a.defineAsyncComponent(async () => {
686
701
  const i = await t(o.url);
687
- return i && (i.name = r), i ? W({
702
+ return i && (i.name = r), i ? G({
688
703
  ...s,
689
704
  Vue: a,
690
705
  dsl: i,
691
- mode: _.Runtime,
692
- loader: G(n)
706
+ mode: y.Runtime,
707
+ loader: Y(n)
693
708
  }).renderer : null;
694
- }) : o.type === "Plugin" ? (o.library && V.push(o.library), a.defineAsyncComponent(async () => {
695
- const i = await Se(o, s.window);
709
+ }) : o.type === "Plugin" ? (o.library && z.push(o.library), a.defineAsyncComponent(async () => {
710
+ const i = await je(o, s.window);
696
711
  return i || (console.warn("getPlugin result is null", o), null);
697
712
  })) : r;
698
713
  }
699
- function H(n, e, t = B, s = kt) {
714
+ function O(n, e, t = B, s = Mt) {
700
715
  if (!n || !n.name || n.invisible) return null;
701
- const r = t.getCurrentInstance()?.appContext, { id: o = null, directives: a = [] } = n, { vIf: i, vFor: l, vShow: c, vModels: f, vBind: u } = Ct(a);
702
- if (i && !Ft(i, e))
716
+ const r = t.getCurrentInstance()?.appContext, { id: o = null, directives: a = [] } = n, { vIf: i, vFor: c, vShow: l, vModels: f, vBind: u, vHtml: p, others: h } = Bt(a);
717
+ if (i && !Nt(i, e))
703
718
  return null;
704
- const p = (d) => {
705
- const h = d.$components, m = (() => {
719
+ const m = (d) => {
720
+ const w = d.$components, g = (() => {
706
721
  if (n.name === "component")
707
- return At(d, n.props?.is);
722
+ return Ut(d, n.props?.is);
708
723
  if (n.name === "slot") return n.name;
709
- const j = s(n.name, n.from, t);
710
- return S(j) ? h[j] ?? r?.app?.component(j) ?? j : j;
711
- })(), v = It(o, n.props ?? {}, d), g = Ot(t, n.events ?? {}, d);
724
+ const b = s(n.name, n.from, t);
725
+ return j(b) ? gt(b) || vt(b) ? b : w[b] ?? r?.app?.component(b) ?? b : b;
726
+ })(), S = Lt(o, n.props ?? {}, d), Ce = qt(t, n.events ?? {}, d);
712
727
  if (n.name === "slot")
713
- return Mt(t, n, v, d, s);
714
- u && Object.assign(v, d.__parseExpression(u.value)), c && (v.style = Object.assign(
715
- v.style ?? {},
716
- Dt(c, d)
717
- )), f.forEach((j) => {
718
- Object.assign(v, Ht(t, j, d));
728
+ return Jt(t, n, S, d, s);
729
+ u && Object.assign(S, d.__parseExpression(u.value)), l && (S.style = Object.assign(
730
+ S.style ?? {},
731
+ zt(l, d)
732
+ )), p && Object.assign(S, Kt(p, d)), f.forEach((b) => {
733
+ Object.assign(S, Wt(t, b, d));
719
734
  });
720
- const A = Bt(
735
+ const Fe = Gt(
721
736
  t,
722
737
  n.children ?? [],
723
738
  d,
724
739
  s,
725
740
  n
726
741
  );
727
- return t.createVNode(m, { ...v, ...g }, A);
742
+ let L = t.createVNode(g, { ...S, ...Ce }, Fe);
743
+ const re = r ? Ot(r, h, d) : [];
744
+ return re.length && (L = t.withDirectives(L, re)), L;
728
745
  };
729
- return l ? Lt(l, p, e) : p(e);
746
+ return c ? Xt(c, m, e) : m(e);
730
747
  }
731
- function Ct(n = []) {
732
- const e = n.find((i) => $(i.name) === "vIf"), t = n.find((i) => $(i.name) === "vFor"), s = n.find((i) => $(i.name) === "vShow"), r = n.find((i) => $(i.name) === "vBind"), o = n.filter((i) => $(i.name) === "vModel"), a = n.filter(
733
- (i) => !et.includes($(i.name))
748
+ function Ot(n, e, t) {
749
+ const s = n.app;
750
+ return e.map((r) => {
751
+ const o = typeof r.name == "string" ? s.directive(r.name) : t.__parseExpression(r.name);
752
+ if (!o) return null;
753
+ const a = [o];
754
+ return r.value && a.push(t.__parseExpression(r.value)), r.arg && a.push(r.arg), r.modifiers && a.push(r.modifiers), a;
755
+ }).filter((r) => !!r);
756
+ }
757
+ function Bt(n = []) {
758
+ const e = n.find((c) => $(c.name) === "vIf"), t = n.find((c) => $(c.name) === "vFor"), s = n.find((c) => $(c.name) === "vShow"), r = n.find((c) => $(c.name) === "vBind"), o = n.find((c) => $(c.name) === "vHtml"), a = n.filter(
759
+ (c) => $(c.name) === "vModel"
760
+ ), i = n.filter(
761
+ (c) => !rt.includes($(c.name))
734
762
  );
735
763
  return {
736
764
  vIf: e,
737
765
  vFor: t,
738
766
  vShow: s,
739
- vModels: o,
767
+ vModels: a,
740
768
  vBind: r,
741
- others: a
769
+ others: i,
770
+ vHtml: o
742
771
  };
743
772
  }
744
- function Ft(n, e) {
773
+ function Nt(n, e) {
745
774
  return !!e.__parseExpression(n.value);
746
775
  }
747
- function At(n, e) {
748
- return e ? w(e) ? n.__parseExpression(e) : e : "div";
776
+ function Ut(n, e) {
777
+ return e ? _(e) ? n.__parseExpression(e) : e : "div";
749
778
  }
750
- function It(n, e, t) {
779
+ function Lt(n, e, t) {
751
780
  const s = Object.keys(e || {}).reduce(
752
781
  (r, o) => {
753
782
  let a = e[o];
754
- return w(a) ? a = t.__parseExpression(a) : U(a) && (a = t.__parseFunction(a)), r[o] = a, r;
783
+ return _(a) ? a = t.__parseExpression(a) : U(a) && (a = t.__parseFunction(a)), r[o] = a, r;
755
784
  },
756
785
  {}
757
786
  );
758
787
  return s.ref = t.__ref(n, s.ref), s;
759
788
  }
760
- function Ot(n, e, t) {
789
+ function qt(n, e, t) {
761
790
  const s = ["passive", "capture", "once"], r = {
762
791
  capture: "Capture",
763
792
  once: "Once",
@@ -765,70 +794,77 @@ function Ot(n, e, t) {
765
794
  };
766
795
  return Object.keys(e || {}).reduce(
767
796
  (o, a) => {
768
- const i = e[a], l = je(i.modifiers), c = l.find((p) => s.includes(p)), f = "on" + De(a) + (c && r[c] || ""), u = t.__parseFunction(i.handler);
769
- return u && (o[f] = n.withModifiers(u, l)), o;
797
+ const i = e[a], c = $e(i.modifiers), l = c.find((p) => s.includes(p)), f = "on" + Ue(a) + (l && r[l] || ""), u = t.__parseFunction(i.handler);
798
+ return u && (o[f] = n.withModifiers(u, c)), o;
770
799
  },
771
800
  {}
772
801
  );
773
802
  }
774
- function je(n = {}, e = !1) {
803
+ function $e(n = {}, e = !1) {
775
804
  const t = Object.keys(n);
776
805
  return e ? t.map((s) => "." + s) : t;
777
806
  }
778
- function Mt(n, e, t, s, r) {
779
- const { children: o } = e, a = Tt(e, s), i = s.$slots?.[a.name];
780
- return i ? i(t) : o ? S(o) ? n.createTextVNode(o) : w(o) ? n.createTextVNode(
781
- ve(s.__parseExpression(o))
807
+ function Jt(n, e, t, s, r) {
808
+ const { children: o } = e, a = Vt(e, s), i = s.$slots?.[a.name];
809
+ return i ? i(t) : o ? j(o) ? n.createTextVNode(o) : _(o) ? n.createTextVNode(
810
+ _e(s.__parseExpression(o))
782
811
  ) : Array.isArray(o) ? o.map(
783
- (l) => H(l, s, n, r)
812
+ (c) => O(c, s, n, r)
784
813
  ) : null : null;
785
814
  }
786
- function Tt(n, e) {
815
+ function Vt(n, e) {
787
816
  const { props: t } = n, s = t?.name || "default";
788
817
  return {
789
- name: w(s) ? e.__parseExpression(s) : s,
818
+ name: _(s) ? e.__parseExpression(s) : s,
790
819
  params: []
791
820
  };
792
821
  }
793
- function Dt(n, e) {
822
+ function zt(n, e) {
794
823
  return e.__parseExpression(n.value) ? {} : {
795
824
  display: "none"
796
825
  };
797
826
  }
798
- function Ht(n, e, t) {
827
+ function Kt(n, e) {
828
+ return {
829
+ innerHTML: e.__parseExpression(n.value) || ""
830
+ };
831
+ }
832
+ function Wt(n, e, t) {
799
833
  const s = {
800
834
  type: "JSFunction",
801
835
  value: e.value?.value ? `(v) => {
802
836
  ${e.value.value} = v;
803
837
  }` : "(v) => {}"
804
- }, r = t.__parseFunction(s), o = je(e.modifiers), a = w(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
838
+ }, r = t.__parseFunction(s), o = $e(
839
+ _(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
840
+ ), a = _(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
805
841
  return {
806
842
  [a]: t.__parseExpression(e.value),
807
843
  [`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
808
844
  };
809
845
  }
810
- function Bt(n, e, t, s, r) {
846
+ function Gt(n, e, t, s, r) {
811
847
  if (!e) return null;
812
- if (S(e))
848
+ if (j(e))
813
849
  return { default: () => e };
814
- if (w(e))
850
+ if (_(e))
815
851
  return {
816
- default: () => ve(t.__parseExpression(e))
852
+ default: () => _e(t.__parseExpression(e))
817
853
  };
818
854
  if (Array.isArray(e) && e.length > 0) {
819
- const o = Nt(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
855
+ const o = Yt(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
820
856
  [`scope_${r.id}`]: i
821
857
  } : {};
822
- return Object.entries(o).reduce((i, [l, { nodes: c, params: f }]) => (i[l] = (u) => {
823
- const p = f.length ? He(u ?? {}, f) : a(u);
824
- return c.map(
825
- (d) => H(d, t.__clone(p), n, s)
858
+ return Object.entries(o).reduce((i, [c, { nodes: l, params: f }]) => (i[c] = (u) => {
859
+ const p = f.length ? Le(u ?? {}, f) : a(u);
860
+ return l.map(
861
+ (h) => O(h, t.__clone(p), n, s)
826
862
  );
827
863
  }, i), {});
828
864
  }
829
865
  return null;
830
866
  }
831
- function Nt(n) {
867
+ function Yt(n) {
832
868
  const e = {
833
869
  default: {
834
870
  params: [],
@@ -836,7 +872,7 @@ function Nt(n) {
836
872
  }
837
873
  };
838
874
  for (const t of n) {
839
- const s = Ut(t.slot), r = s.name;
875
+ const s = Qt(t.slot), r = s.name;
840
876
  e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(s.params)) : e[r] = {
841
877
  nodes: [t],
842
878
  params: s.params
@@ -844,111 +880,111 @@ function Nt(n) {
844
880
  }
845
881
  return e;
846
882
  }
847
- function Ut(n = "default") {
848
- return S(n) ? { name: n, params: [] } : { params: [], ...n };
883
+ function Qt(n = "default") {
884
+ return j(n) ? { name: n, params: [] } : { params: [], ...n };
849
885
  }
850
- function Lt(n, e, t) {
886
+ function Xt(n, e, t) {
851
887
  const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
852
888
  let i = t.__parseExpression(s) || [];
853
- 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 }))) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
889
+ 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]:", `${s?.value} is not a Arrary`), []);
854
890
  }
855
- function qt(n) {
856
- return ze() ? (Ke(n), !0) : !1;
891
+ function Zt(n) {
892
+ return Ye() ? (Qe(n), !0) : !1;
857
893
  }
858
- function ee(n) {
859
- return typeof n == "function" ? n() : We(n);
894
+ function te(n) {
895
+ return typeof n == "function" ? n() : Xe(n);
860
896
  }
861
- const $e = typeof window < "u" && typeof document < "u";
897
+ const Ee = typeof window < "u" && typeof document < "u";
862
898
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
863
- const Jt = (n) => n != null, Vt = () => {
899
+ const es = (n) => n != null, ts = () => {
864
900
  };
865
- function zt(n) {
866
- return fe();
901
+ function ss(n) {
902
+ return me();
867
903
  }
868
- function Kt(...n) {
904
+ function ns(...n) {
869
905
  if (n.length !== 1)
870
- return Le(...n);
906
+ return ze(...n);
871
907
  const e = n[0];
872
- return typeof e == "function" ? qe(Je(() => ({ get: e, set: Vt }))) : C(e);
908
+ return typeof e == "function" ? Ke(We(() => ({ get: e, set: ts }))) : F(e);
873
909
  }
874
- function Wt(n, e) {
875
- zt() && Ve(n, e);
910
+ function rs(n, e) {
911
+ ss() && Ge(n, e);
876
912
  }
877
- const Gt = $e ? window : void 0, Yt = $e ? window.document : void 0;
878
- function Qt(n) {
913
+ const os = Ee ? window : void 0, is = Ee ? window.document : void 0;
914
+ function as(n) {
879
915
  var e;
880
- const t = ee(n);
916
+ const t = te(n);
881
917
  return (e = t?.$el) != null ? e : t;
882
918
  }
883
- function Xt() {
884
- const n = C(!1), e = fe();
885
- return e && Ge(() => {
919
+ function cs() {
920
+ const n = F(!1), e = me();
921
+ return e && Ze(() => {
886
922
  n.value = !0;
887
923
  }, e), n;
888
924
  }
889
- function Zt(n) {
890
- const e = Xt();
891
- return me(() => (e.value, !!n()));
925
+ function ls(n) {
926
+ const e = cs();
927
+ return ve(() => (e.value, !!n()));
892
928
  }
893
- function es(n, e, t = {}) {
894
- const { window: s = Gt, ...r } = t;
929
+ function us(n, e, t = {}) {
930
+ const { window: s = os, ...r } = t;
895
931
  let o;
896
- const a = Zt(() => s && "MutationObserver" in s), i = () => {
932
+ const a = ls(() => s && "MutationObserver" in s), i = () => {
897
933
  o && (o.disconnect(), o = void 0);
898
- }, l = me(() => {
899
- const p = ee(n), d = (Array.isArray(p) ? p : [p]).map(Qt).filter(Jt);
900
- return new Set(d);
901
- }), c = he(
902
- () => l.value,
934
+ }, c = ve(() => {
935
+ const p = te(n), h = (Array.isArray(p) ? p : [p]).map(as).filter(es);
936
+ return new Set(h);
937
+ }), l = ge(
938
+ () => c.value,
903
939
  (p) => {
904
- i(), a.value && p.size && (o = new MutationObserver(e), p.forEach((d) => o.observe(d, r)));
940
+ i(), a.value && p.size && (o = new MutationObserver(e), p.forEach((h) => o.observe(h, r)));
905
941
  },
906
942
  { immediate: !0, flush: "post" }
907
943
  ), f = () => o?.takeRecords(), u = () => {
908
- c(), i();
944
+ l(), i();
909
945
  };
910
- return qt(u), {
946
+ return Zt(u), {
911
947
  isSupported: a,
912
948
  stop: u,
913
949
  takeRecords: f
914
950
  };
915
951
  }
916
- function ts(n = null, e = {}) {
952
+ function ps(n = null, e = {}) {
917
953
  var t, s, r;
918
954
  const {
919
- document: o = Yt,
955
+ document: o = is,
920
956
  restoreOnUnmount: a = (u) => u
921
- } = e, i = (t = o?.title) != null ? t : "", l = Kt((s = n ?? o?.title) != null ? s : null), c = n && typeof n == "function";
957
+ } = e, i = (t = o?.title) != null ? t : "", c = ns((s = n ?? o?.title) != null ? s : null), l = n && typeof n == "function";
922
958
  function f(u) {
923
959
  if (!("titleTemplate" in e))
924
960
  return u;
925
961
  const p = e.titleTemplate || "%s";
926
- return typeof p == "function" ? p(u) : ee(p).replace(/%s/g, u);
962
+ return typeof p == "function" ? p(u) : te(p).replace(/%s/g, u);
927
963
  }
928
- return he(
929
- l,
964
+ return ge(
965
+ c,
930
966
  (u, p) => {
931
967
  u !== p && o && (o.title = f(typeof u == "string" ? u : ""));
932
968
  },
933
969
  { immediate: !0 }
934
- ), e.observe && !e.titleTemplate && o && !c && es(
970
+ ), e.observe && !e.titleTemplate && o && !l && us(
935
971
  (r = o.head) == null ? void 0 : r.querySelector("title"),
936
972
  () => {
937
- o && o.title !== l.value && (l.value = f(o.title));
973
+ o && o.title !== c.value && (c.value = f(o.title));
938
974
  },
939
975
  { childList: !0 }
940
- ), Wt(() => {
976
+ ), rs(() => {
941
977
  if (a) {
942
- const u = a(i, l.value || "");
978
+ const u = a(i, c.value || "");
943
979
  u != null && o && (o.title = u);
944
980
  }
945
- }), l;
981
+ }), c;
946
982
  }
947
- const le = Q({
983
+ const pe = X({
948
984
  name: "VtjPageContainer",
949
985
  async setup() {
950
- const n = Ee(), e = ge(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = C(Symbol());
951
- return s && (Object.assign(e.meta, s.meta || {}, { cache: s.cache }), ts(s.title || "VTJ")), {
986
+ const n = Pe(), e = ye(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = F(Symbol());
987
+ return s && (Object.assign(e.meta, s.meta || {}, { cache: s.cache }), ps(s.title || "VTJ")), {
952
988
  provider: n,
953
989
  component: r,
954
990
  file: s,
@@ -960,27 +996,27 @@ const le = Q({
960
996
  },
961
997
  render() {
962
998
  const { component: n, query: e, sid: t } = this;
963
- return n ? K(n, { ...e, key: t }) : K("div", "页面不存在");
999
+ return n ? W(n, { ...e, key: t }) : W("div", "页面不存在");
964
1000
  },
965
1001
  activated() {
966
1002
  this.meta.cache === !1 && (this.sid = Symbol());
967
1003
  }
968
- }), ss = {
1004
+ }), ds = {
969
1005
  "data-l-h6o7ki7": "",
970
1006
  class: "vtj-startup__wrapper"
971
- }, ns = {
1007
+ }, fs = {
972
1008
  "data-l-h6o7ki7": "",
973
1009
  class: "vtj-startup"
974
- }, rs = {
1010
+ }, hs = {
975
1011
  "data-l-h6o7ki7": "",
976
1012
  class: "vtj-startup__name"
977
- }, os = { "data-l-h6o7ki7": "" }, is = {
1013
+ }, ms = { "data-l-h6o7ki7": "" }, gs = {
978
1014
  "data-l-h6o7ki7": "",
979
1015
  class: "vtj-startup__tagline"
980
- }, as = {
1016
+ }, vs = {
981
1017
  "data-l-h6o7ki7": "",
982
1018
  class: "vtj-startup__actions"
983
- }, cs = /* @__PURE__ */ Q({
1019
+ }, ys = /* @__PURE__ */ X({
984
1020
  __name: "Startup",
985
1021
  props: {
986
1022
  name: { default: "VTJ.PRO" },
@@ -1068,53 +1104,53 @@ const le = Q({
1068
1104
  window.location.href = o;
1069
1105
  }
1070
1106
  };
1071
- return (r, o) => (Ye(), Qe("div", ss, [
1072
- b("div", ns, [
1073
- b("h1", rs, [
1074
- b("span", os, J(t.name), 1)
1107
+ return (r, o) => (et(), tt("div", ds, [
1108
+ E("div", fs, [
1109
+ E("h1", hs, [
1110
+ E("span", ms, V(t.name), 1)
1075
1111
  ]),
1076
- b("div", is, J(t.tagline), 1),
1077
- b("div", as, [
1078
- b("button", {
1112
+ E("div", gs, V(t.tagline), 1),
1113
+ E("div", vs, [
1114
+ E("button", {
1079
1115
  "data-l-h6o7ki7": "",
1080
1116
  onClick: s
1081
- }, J(t.actionText), 1)
1117
+ }, V(t.actionText), 1)
1082
1118
  ])
1083
1119
  ])
1084
1120
  ]));
1085
1121
  }
1086
- }), ls = Q({
1122
+ }), _s = X({
1087
1123
  name: "VtjStartupContainer",
1088
1124
  render() {
1089
- return K(cs);
1125
+ return W(ys);
1090
1126
  }
1091
- }), be = Symbol("Provider");
1092
- var us = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(us || {});
1093
- class ds extends xe {
1127
+ }), Re = Symbol("Provider");
1128
+ var ws = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(ws || {});
1129
+ class Ss extends Ae {
1094
1130
  constructor(e) {
1095
1131
  super(), this.options = e;
1096
1132
  const {
1097
1133
  service: t,
1098
- mode: s = _.Raw,
1134
+ mode: s = y.Raw,
1099
1135
  dependencies: r,
1100
1136
  materials: o,
1101
1137
  project: a = {},
1102
1138
  adapter: i = {},
1103
- globals: l = {},
1104
- modules: c = {},
1139
+ globals: c = {},
1140
+ modules: l = {},
1105
1141
  router: f = null,
1106
1142
  materialPath: u = "./",
1107
1143
  nodeEnv: p = "development"
1108
1144
  /* Development */
1109
1145
  } = e;
1110
- this.mode = s, this.modules = c, this.service = t, this.router = f, this.materialPath = u, this.nodeEnv = p, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, i);
1111
- const { access: d, request: h } = this.adapter;
1112
- d && d.connect({ mode: s, router: f, request: h }), a && s !== _.Design ? this.load(a) : this.project = a;
1146
+ this.mode = s, this.modules = l, this.service = t, this.router = f, this.materialPath = u, this.nodeEnv = p, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, c), Object.assign(this.adapter, i);
1147
+ const { access: h, request: m } = this.adapter;
1148
+ h && h.connect({ mode: s, router: f, request: m }), a && s !== y.Design ? this.load(a) : this.project = a;
1113
1149
  }
1114
1150
  mode;
1115
1151
  globals = {};
1116
1152
  modules = {};
1117
- adapter = { request: dt, jsonp: Be };
1153
+ adapter = { request: _t, jsonp: qe };
1118
1154
  apis = {};
1119
1155
  dependencies = {};
1120
1156
  materials = {};
@@ -1131,7 +1167,7 @@ class ds extends xe {
1131
1167
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
1132
1168
  throw new Error("project is null");
1133
1169
  const { apis: s = [], meta: r = [] } = this.project, o = window;
1134
- o.CKEDITOR_VERSION = void 0, this.mode === _.Raw ? await this.loadDependencies(o) : await this.loadAssets(o), this.apis = ht(s, r, this.adapter), _e(), this.project.config?.mock && mt(s), this.initRouter(), this.triggerReady();
1170
+ o.CKEDITOR_VERSION = void 0, this.mode === y.Raw ? await this.loadDependencies(o) : await this.loadAssets(o), this.apis = bt(s, r, this.adapter), Se(), this.project.config?.mock && jt(s), this.initRouter(), this.triggerReady();
1135
1171
  }
1136
1172
  async loadDependencies(e) {
1137
1173
  const t = Object.entries(this.dependencies);
@@ -1140,44 +1176,44 @@ class ds extends xe {
1140
1176
  }
1141
1177
  async loadAssets(e) {
1142
1178
  const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
1143
- libraryExports: l,
1144
- libraryMap: c,
1179
+ libraryExports: c,
1180
+ libraryMap: l,
1145
1181
  materials: f,
1146
1182
  materialExports: u,
1147
1183
  materialMapLibrary: p
1148
- } = rt(
1184
+ } = ut(
1149
1185
  t,
1150
1186
  a,
1151
1187
  i === "development"
1152
1188
  /* Development */
1153
1189
  );
1154
- for (const d of l) {
1155
- const h = s[d], m = e[d];
1156
- if (m)
1157
- r[d] = m;
1158
- else if (h)
1159
- e[d] = r[d] = await h();
1190
+ for (const h of c) {
1191
+ const m = s[h], d = e[h];
1192
+ if (d)
1193
+ r[h] = d;
1194
+ else if (m)
1195
+ e[h] = r[h] = await m();
1160
1196
  else {
1161
- const v = c[d] || [];
1162
- for (const g of v)
1163
- X(g) && await it(d, P.append(g, { v: x })), Z(g) && await oe(P.append(g, { v: x }));
1164
- r[d] = e[d];
1197
+ const w = l[h] || [];
1198
+ for (const g of w)
1199
+ Z(g) && await dt(h, x.append(g, { v: k })), ee(g) && await ae(x.append(g, { v: k }));
1200
+ r[h] = e[h];
1165
1201
  }
1166
1202
  }
1167
1203
  if (i === "development") {
1168
- for (const h of f)
1169
- await oe(P.append(h, { v: x }));
1170
- const d = this.materials || {};
1171
- for (const h of u) {
1172
- const m = e[p[h]], v = ke[h];
1173
- if (v)
1174
- m && v.forEach((g) => {
1175
- o[g] = m[g];
1204
+ for (const m of f)
1205
+ await ae(x.append(m, { v: k }));
1206
+ const h = this.materials || {};
1207
+ for (const m of u) {
1208
+ const d = e[p[m]], w = Te[m];
1209
+ if (w)
1210
+ d && w.forEach((g) => {
1211
+ o[g] = d[g];
1176
1212
  });
1177
1213
  else {
1178
- const g = d[h] ? (await d[h]()).default : e[h];
1179
- g && m && (g.components || []).forEach((A) => {
1180
- o[A.name] = ot(A, m);
1214
+ const g = h[m] ? (await h[m]()).default : e[m];
1215
+ g && d && (g.components || []).forEach((S) => {
1216
+ o[S.name] = pt(S, d);
1181
1217
  });
1182
1218
  }
1183
1219
  }
@@ -1186,24 +1222,24 @@ class ds extends xe {
1186
1222
  initRouter() {
1187
1223
  const { router: e, project: t, options: s, adapter: r } = this;
1188
1224
  if (!e) return;
1189
- const { routeAppendTo: o, pageRouteName: a = "page", routeMeta: i } = s, l = o ? "" : "/", c = {
1190
- path: `${l}${a}/:id`,
1191
- name: k,
1192
- component: le
1225
+ const { routeAppendTo: o, pageRouteName: a = "page", routeMeta: i } = s, c = o ? "" : "/", l = {
1226
+ path: `${c}${a}/:id`,
1227
+ name: C,
1228
+ component: pe
1193
1229
  }, f = {
1194
- path: l,
1195
- name: M,
1196
- component: t?.homepage ? le : r.startupComponent || ls,
1230
+ path: c,
1231
+ name: D,
1232
+ component: t?.homepage ? pe : r.startupComponent || _s,
1197
1233
  meta: i
1198
1234
  };
1199
- e.hasRoute(k) && e.removeRoute(k), e.hasRoute(M) && e.removeRoute(M), o ? (e.addRoute(o, c), e.addRoute(o, f)) : (e.addRoute(c), e.addRoute(f));
1235
+ 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));
1200
1236
  }
1201
1237
  install(e) {
1202
1238
  const t = e.config.globalProperties.installed || {};
1203
1239
  for (const [s, r] of Object.entries(this.library))
1204
- !t[s] && lt(r) && (e.use(r), t[s] = !0);
1205
- this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(be, this), e.config.globalProperties.installed = t, this.mode === _.Design && (e.config.errorHandler = (s, r, o) => {
1206
- const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", l = `[ ${a} ] ${i} ${o}`;
1240
+ !t[s] && mt(r) && (e.use(r), t[s] = !0);
1241
+ 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 = (s, r, o) => {
1242
+ const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", c = `[ ${a} ] ${i} ${o}`;
1207
1243
  console.error(
1208
1244
  "[VTJ Error]:",
1209
1245
  {
@@ -1214,7 +1250,7 @@ class ds extends xe {
1214
1250
  s?.stack
1215
1251
  ), N.error({
1216
1252
  title: "未处理的异常:请在控制台查看详情",
1217
- message: l
1253
+ message: c
1218
1254
  });
1219
1255
  });
1220
1256
  }
@@ -1264,47 +1300,47 @@ class ds extends xe {
1264
1300
  apis: a,
1265
1301
  window,
1266
1302
  ...t
1267
- }, l = G({
1268
- getDsl: async (c) => await this.getDsl(c) || null,
1269
- getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
1303
+ }, c = Y({
1304
+ getDsl: async (l) => await this.getDsl(l) || null,
1305
+ getDslByUrl: async (l) => await this.getDslByUrl(l) || null,
1270
1306
  options: i
1271
1307
  });
1272
- return W({
1308
+ return G({
1273
1309
  ...i,
1274
1310
  dsl: e,
1275
- loader: l
1311
+ loader: c
1276
1312
  });
1277
1313
  }
1278
1314
  async getRenderComponent(e, t) {
1279
1315
  const s = this.getFile(e);
1280
1316
  if (!s)
1281
- return D.warn(`Can not find file: ${e}`), null;
1317
+ return M.warn(`Can not find file: ${e}`), null;
1282
1318
  t && t(s);
1283
1319
  const r = `.vtj/vue/${e}.vue`, o = this.modules[r];
1284
1320
  if (o)
1285
1321
  return (await o())?.default;
1286
1322
  const a = await this.getDsl(s.id);
1287
- return a ? this.createDslRenderer(a).renderer : (D.warn(`Can not find dsl: ${e}`), null);
1323
+ return a ? this.createDslRenderer(a).renderer : (M.warn(`Can not find dsl: ${e}`), null);
1288
1324
  }
1289
1325
  defineUrlSchemaComponent(e, t) {
1290
- return ie(async () => {
1326
+ return ce(async () => {
1291
1327
  const s = await this.getDslByUrl(e);
1292
1328
  return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
1293
1329
  });
1294
1330
  }
1295
1331
  definePluginComponent(e) {
1296
- return ie(async () => await Se(e, window));
1332
+ return ce(async () => await je(e, window));
1297
1333
  }
1298
1334
  }
1299
- function Es(n) {
1300
- const e = new ds(n);
1335
+ function Ds(n) {
1336
+ const e = new Ss(n);
1301
1337
  return {
1302
1338
  provider: e,
1303
1339
  onReady: (s) => e.ready(s)
1304
1340
  };
1305
1341
  }
1306
- function Ee(n = {}) {
1307
- const e = pe(be);
1342
+ function Pe(n = {}) {
1343
+ const e = he(Re);
1308
1344
  if (!e)
1309
1345
  throw new Error("Can not find provider");
1310
1346
  if (e.nodeEnv === "development") {
@@ -1319,7 +1355,7 @@ function Ee(n = {}) {
1319
1355
  }
1320
1356
  return e;
1321
1357
  }
1322
- const te = new Ne({
1358
+ const se = new Je({
1323
1359
  settings: {
1324
1360
  type: "json",
1325
1361
  validSuccess: !0,
@@ -1332,7 +1368,7 @@ const te = new Ne({
1332
1368
  });
1333
1369
  }
1334
1370
  }
1335
- }), ps = (n = "/__vtj__/api/:type.json") => (e, t) => te.send({
1371
+ }), bs = (n = "/__vtj__/api/:type.json") => (e, t) => se.send({
1336
1372
  url: n,
1337
1373
  method: "post",
1338
1374
  params: { type: e },
@@ -1340,7 +1376,7 @@ const te = new Ne({
1340
1376
  type: e,
1341
1377
  data: t
1342
1378
  }
1343
- }), fs = (n = "/__vtj__/api/uploader.json") => async (e, t) => await te.send({
1379
+ }), js = (n = "/__vtj__/api/uploader.json") => async (e, t) => await se.send({
1344
1380
  url: n,
1345
1381
  method: "post",
1346
1382
  data: {
@@ -1351,12 +1387,12 @@ const te = new Ne({
1351
1387
  type: "data"
1352
1388
  }
1353
1389
  }).then((s) => s && s[0] ? s[0] : null).catch(() => null);
1354
- class se {
1390
+ class ne {
1355
1391
  api;
1356
1392
  pluginCaches = {};
1357
1393
  uploader;
1358
1394
  constructor() {
1359
- this.api = ps(), this.uploader = fs();
1395
+ this.api = bs(), this.uploader = js();
1360
1396
  }
1361
1397
  async getExtension() {
1362
1398
  console.log("BaseService.getExtension");
@@ -1429,10 +1465,10 @@ class se {
1429
1465
  return await this.api("clearStaticFiles", e).catch(() => "");
1430
1466
  }
1431
1467
  async getPluginMaterial(e) {
1432
- const { urls: t = [] } = e, s = t.filter((o) => st(o))[0];
1468
+ const { urls: t = [] } = e, s = t.filter((o) => ct(o))[0];
1433
1469
  if (!s) return null;
1434
1470
  const r = this.pluginCaches[s];
1435
- return r || (this.pluginCaches[s] = te.send({
1471
+ return r || (this.pluginCaches[s] = se.send({
1436
1472
  url: s,
1437
1473
  method: "get",
1438
1474
  settings: {
@@ -1445,77 +1481,77 @@ class se {
1445
1481
  return console.log("BaseService.genSource", e), "";
1446
1482
  }
1447
1483
  }
1448
- const y = new Ue({
1484
+ const v = new Ve({
1449
1485
  type: "local",
1450
1486
  expired: 0,
1451
1487
  prefix: "__VTJ_"
1452
1488
  });
1453
- class Rs extends se {
1489
+ class Hs extends ne {
1454
1490
  init(e) {
1455
- const t = new T(e), s = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1456
- return y.save(`project_${t.id}`, r), Promise.resolve(r);
1491
+ const t = new H(e), s = v.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
1492
+ return v.save(`project_${t.id}`, r), Promise.resolve(r);
1457
1493
  }
1458
1494
  saveProject(e) {
1459
- const t = new T(e);
1460
- return y.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1495
+ const t = new H(e);
1496
+ return v.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1461
1497
  }
1462
1498
  saveMaterials(e, t) {
1463
- return y.save(`materials_${e.id}`, Y(t)), Promise.resolve(!0);
1499
+ return v.save(`materials_${e.id}`, Q(t)), Promise.resolve(!0);
1464
1500
  }
1465
1501
  saveFile(e) {
1466
- return y.save(`file_${e.id}`, e), Promise.resolve(!0);
1502
+ return v.save(`file_${e.id}`, e), Promise.resolve(!0);
1467
1503
  }
1468
1504
  getFile(e) {
1469
- const t = y.get(`file_${e}`);
1505
+ const t = v.get(`file_${e}`);
1470
1506
  return t ? Promise.resolve(t) : Promise.reject(null);
1471
1507
  }
1472
1508
  removeFile(e) {
1473
- return y.remove(`file_${e}`), Promise.resolve(!0);
1509
+ return v.remove(`file_${e}`), Promise.resolve(!0);
1474
1510
  }
1475
1511
  saveHistory(e) {
1476
- return y.save(`history_${e.id}`, e), Promise.resolve(!0);
1512
+ return v.save(`history_${e.id}`, e), Promise.resolve(!0);
1477
1513
  }
1478
1514
  removeHistory(e) {
1479
- const t = y.get(`history_${e}`);
1515
+ const t = v.get(`history_${e}`);
1480
1516
  if (t) {
1481
1517
  const r = (t.items || []).map((o) => o.id);
1482
- this.removeHistoryItem(e, r), y.remove(`history_${e}`);
1518
+ this.removeHistoryItem(e, r), v.remove(`history_${e}`);
1483
1519
  }
1484
1520
  return Promise.resolve(!0);
1485
1521
  }
1486
1522
  getHistory(e) {
1487
- const t = y.get(`history_${e}`), s = new ue(t || { id: e });
1523
+ const t = v.get(`history_${e}`), s = new de(t || { id: e });
1488
1524
  return Promise.resolve(s.toDsl());
1489
1525
  }
1490
1526
  getHistoryItem(e, t) {
1491
- const s = y.get(`history_${e}_${t}`);
1527
+ const s = v.get(`history_${e}_${t}`);
1492
1528
  return Promise.resolve(s);
1493
1529
  }
1494
1530
  saveHistoryItem(e, t) {
1495
- return y.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1531
+ return v.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1496
1532
  }
1497
1533
  removeHistoryItem(e, t) {
1498
1534
  return t.forEach((s) => {
1499
- y.remove(`history_${e}_${s}`);
1535
+ v.remove(`history_${e}_${s}`);
1500
1536
  }), Promise.resolve(!0);
1501
1537
  }
1502
1538
  }
1503
- class hs extends se {
1539
+ class $s extends ne {
1504
1540
  projects = {};
1505
1541
  materials = {};
1506
1542
  files = {};
1507
1543
  histories = {};
1508
1544
  historyItems = {};
1509
1545
  init(e) {
1510
- const t = new T(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
1546
+ const t = new H(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
1511
1547
  return this.projects[r.id] = r, Promise.resolve(r);
1512
1548
  }
1513
1549
  saveProject(e) {
1514
- const t = new T(e);
1550
+ const t = new H(e);
1515
1551
  return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
1516
1552
  }
1517
1553
  saveMaterials(e, t) {
1518
- return e.id && (this.materials[e.id] = Y(t)), Promise.resolve(!0);
1554
+ return e.id && (this.materials[e.id] = Q(t)), Promise.resolve(!0);
1519
1555
  }
1520
1556
  saveFile(e) {
1521
1557
  return this.files[e.id] = e, Promise.resolve(!0);
@@ -1539,7 +1575,7 @@ class hs extends se {
1539
1575
  return Promise.resolve(!0);
1540
1576
  }
1541
1577
  getHistory(e) {
1542
- const t = this.histories[e], s = new ue(t || { id: e });
1578
+ const t = this.histories[e], s = new de(t || { id: e });
1543
1579
  return Promise.resolve(s);
1544
1580
  }
1545
1581
  getHistoryItem(e, t) {
@@ -1557,11 +1593,11 @@ class hs extends se {
1557
1593
  }), Promise.resolve(!0);
1558
1594
  }
1559
1595
  }
1560
- let O = null;
1561
- function Ps() {
1562
- return O || (O = new hs(), O);
1596
+ let I = null;
1597
+ function Ms() {
1598
+ return I || (I = new $s(), I);
1563
1599
  }
1564
- class xs extends se {
1600
+ class Os extends ne {
1565
1601
  getFileCaches = {};
1566
1602
  async getExtension() {
1567
1603
  return await this.api("getExtension", {}).catch(() => {
@@ -1576,7 +1612,7 @@ class xs extends se {
1576
1612
  async saveMaterials(e, t) {
1577
1613
  return !!await this.api("saveMaterials", {
1578
1614
  project: e,
1579
- materials: Y(t)
1615
+ materials: Q(t)
1580
1616
  }).catch(() => !1);
1581
1617
  }
1582
1618
  async saveFile(e) {
@@ -1616,118 +1652,122 @@ class xs extends se {
1616
1652
  );
1617
1653
  }
1618
1654
  }
1619
- function Re(n, e, t = []) {
1655
+ function xe(n, e, t = []) {
1620
1656
  return t.map((s) => {
1621
- const { id: r, title: o, icon: a, children: i, hidden: l } = s;
1657
+ const { id: r, title: o, icon: a, children: i, hidden: c } = s;
1622
1658
  return {
1623
1659
  id: r,
1624
1660
  title: o,
1625
1661
  icon: a,
1626
- hidden: l,
1662
+ hidden: c,
1627
1663
  url: `${n}/${e}/${r}`,
1628
- children: i && i.length ? Re(n, e, i) : void 0
1664
+ children: i && i.length ? xe(n, e, i) : void 0
1629
1665
  };
1630
1666
  });
1631
1667
  }
1632
- function Pe(n, e) {
1668
+ function ke(n, e) {
1633
1669
  if (!e) return n;
1634
1670
  let t = [];
1635
1671
  for (const s of n)
1636
1672
  if (s.children && s.children.length) {
1637
- const r = Pe(s.children, e);
1673
+ const r = ke(s.children, e);
1638
1674
  r.length && (s.children = r, t.push(s));
1639
1675
  } else
1640
1676
  e.can(s.id.toString()) && t.push(s);
1641
1677
  return t;
1642
1678
  }
1643
- function ks(n) {
1679
+ function Bs(n) {
1644
1680
  const {
1645
1681
  menuPathPrefix: e = "",
1646
1682
  pageRouteName: t = "page",
1647
1683
  disableMenusFilter: s = !1
1648
- } = n || {}, r = Ee(), o = ge(), a = yt(), i = C(!1), l = C(!1), c = r.project;
1649
- Xe(() => {
1650
- const { name: p, params: d, meta: h } = o;
1651
- if (p === k) {
1652
- const m = r.getPage(d.id);
1653
- i.value = !m?.mask, l.value = !!m?.pure;
1654
- } else if (p === M) {
1655
- const m = r.getHomepage();
1656
- i.value = !m?.mask, l.value = !!m?.pure;
1684
+ } = n || {}, r = Pe(), o = ye(), a = Rt(), i = F(!1), c = F(!1), l = r.project;
1685
+ st(() => {
1686
+ const { name: p, params: h, meta: m } = o;
1687
+ if (p === C) {
1688
+ const d = r.getPage(h.id);
1689
+ i.value = !d?.mask, c.value = !!d?.pure;
1690
+ } else if (p === D) {
1691
+ const d = r.getHomepage();
1692
+ i.value = !d?.mask, c.value = !!d?.pure;
1657
1693
  } else
1658
- i.value = !h.mask, l.value = !!h.pure;
1694
+ i.value = !m.mask, c.value = !!m.pure;
1659
1695
  });
1660
- const f = Re(
1696
+ const f = xe(
1661
1697
  e,
1662
1698
  t,
1663
- c?.pages
1664
- ), u = c?.config;
1699
+ l?.pages
1700
+ ), u = l?.config;
1665
1701
  return {
1666
1702
  disabled: i,
1667
1703
  logo: u?.logo,
1668
1704
  themeSwitchable: u?.themeSwitchable,
1669
- title: u?.title || c?.description || c?.name || "VTJ App",
1670
- menus: s ? f : Pe(f, a),
1671
- pure: l
1705
+ title: u?.title || l?.description || l?.name || "VTJ App",
1706
+ menus: s ? f : ke(f, a),
1707
+ pure: c
1672
1708
  };
1673
1709
  }
1674
1710
  export {
1675
- we as ACCESS_KEY,
1676
- bs as Access,
1677
- et as BUILT_IN_DIRECTIVES,
1678
- se as BaseService,
1679
- ae as CONTEXT_HOST,
1680
- _t as Context,
1681
- _ as ContextMode,
1682
- tt as DATA_TYPES,
1683
- M as HOMEPAGE_ROUTE_NAME,
1684
- $s as JSCodeToString,
1685
- ws as LIFE_CYCLES_LIST,
1686
- xs as LocalService,
1687
- hs as MemoryService,
1688
- us as NodeEnv,
1689
- k as PAGE_ROUTE_NAME,
1690
- ds as Provider,
1691
- cs as Startup,
1692
- Rs as StorageService,
1693
- x as VTJ_RENDERER_VERSION,
1694
- ye as adoptedStyleSheets,
1695
- Ss as createAssetScripts,
1696
- js as createAssetsCss,
1697
- Rt as createDataSources,
1698
- G as createLoader,
1699
- Ps as createMemoryService,
1700
- ft as createMetaApi,
1701
- Es as createProvider,
1702
- W as createRenderer,
1703
- pt as createSchemaApi,
1704
- ht as createSchemaApis,
1705
- kt as defaultLoader,
1706
- I as fillBasePath,
1707
- je as getModifiers,
1708
- Se as getPlugin,
1709
- ot as getRawComponent,
1710
- X as isCSSUrl,
1711
- ut as isJSCode,
1712
- w as isJSExpression,
1711
+ be as ACCESS_KEY,
1712
+ Is as Access,
1713
+ at as BUILD_IN_TAGS,
1714
+ rt as BUILT_IN_DIRECTIVES,
1715
+ ne as BaseService,
1716
+ le as CONTEXT_HOST,
1717
+ Pt as Context,
1718
+ y as ContextMode,
1719
+ ot as DATA_TYPES,
1720
+ D as HOMEPAGE_ROUTE_NAME,
1721
+ it as HTML_TAGS,
1722
+ Ts as JSCodeToString,
1723
+ Cs as LIFE_CYCLES_LIST,
1724
+ Os as LocalService,
1725
+ $s as MemoryService,
1726
+ ws as NodeEnv,
1727
+ C as PAGE_ROUTE_NAME,
1728
+ Ss as Provider,
1729
+ ys as Startup,
1730
+ Hs as StorageService,
1731
+ k as VTJ_RENDERER_VERSION,
1732
+ we as adoptedStyleSheets,
1733
+ Fs as createAssetScripts,
1734
+ As as createAssetsCss,
1735
+ It as createDataSources,
1736
+ Y as createLoader,
1737
+ Ms as createMemoryService,
1738
+ St as createMetaApi,
1739
+ Ds as createProvider,
1740
+ G as createRenderer,
1741
+ wt as createSchemaApi,
1742
+ bt as createSchemaApis,
1743
+ Mt as defaultLoader,
1744
+ T as fillBasePath,
1745
+ $e as getModifiers,
1746
+ je as getPlugin,
1747
+ pt as getRawComponent,
1748
+ gt as isBuiltInTag,
1749
+ Z as isCSSUrl,
1750
+ yt as isJSCode,
1751
+ _ as isJSExpression,
1713
1752
  U as isJSFunction,
1714
- st as isJSON,
1715
- Z as isJSUrl,
1716
- lt as isVuePlugin,
1717
- it as loadCss,
1718
- at as loadCssUrl,
1719
- ct as loadScriptUrl,
1720
- gt as mockApi,
1721
- mt as mockApis,
1722
- _e as mockCleanup,
1723
- H as nodeRender,
1724
- rt as parseDeps,
1725
- F as parseExpression,
1726
- ce as parseFunction,
1727
- be as providerKey,
1728
- nt as removeProdFlag,
1729
- ve as toString,
1730
- yt as useAccess,
1731
- ks as useMask,
1732
- Ee as useProvider
1753
+ ct as isJSON,
1754
+ ee as isJSUrl,
1755
+ vt as isNativeTag,
1756
+ mt as isVuePlugin,
1757
+ dt as loadCss,
1758
+ ft as loadCssUrl,
1759
+ ht as loadScriptUrl,
1760
+ $t as mockApi,
1761
+ jt as mockApis,
1762
+ Se as mockCleanup,
1763
+ O as nodeRender,
1764
+ ut as parseDeps,
1765
+ A as parseExpression,
1766
+ ue as parseFunction,
1767
+ Re as providerKey,
1768
+ lt as removeProdFlag,
1769
+ _e as toString,
1770
+ Rt as useAccess,
1771
+ Bs as useMask,
1772
+ Pe as useProvider
1733
1773
  };