@vtj/renderer 0.8.163 → 0.8.165

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,20 +1,20 @@
1
- import { Base as he, BUILT_IN_COMPONENTS as ve, ProjectModel as x, HistoryModel as ee } from "@vtj/core";
2
- import { isUrl as ye, url as P, dedupArray as ge, isString as $, isFunction as K, logger as H, createRequest as _e, merge as we, pathToRegexp as Se, pathToRegexpMatch as $e, formDataToJson as je, delay as Ee, camelCase as j, upperFirst as be, pick as Pe, jsonp as Ce, loadScript as Q, Request as Re, Storage as Fe, mapToObject as N } from "@vtj/utils";
3
- import * as M from "vue";
4
- import { toRef as Ie, readonly as xe, customRef as He, ref as q, onBeforeUnmount as Oe, getCurrentScope as Me, onScopeDispose as De, unref as Te, getCurrentInstance as te, watch as ne, computed as re, onMounted as ke, defineComponent as se, h as A, inject as Ae, defineAsyncComponent as X, watchEffect as Be } from "vue";
5
- import { useRoute as oe } from "vue-router";
6
- import { ElNotification as D, ElLoading as Ue } from "element-plus";
7
- import { XStartup as Ne } from "@vtj/ui";
1
+ import { Base as we, BUILT_IN_COMPONENTS as Se, ProjectModel as I, HistoryModel as se } from "@vtj/core";
2
+ import { isUrl as $e, url as b, dedupArray as je, isString as $, isFunction as Y, logger as A, createRequest as Ee, merge as Pe, pathToRegexp as be, pathToRegexpMatch as Ce, formDataToJson as Re, storage as k, cookie as T, toArray as Q, delay as Fe, camelCase as j, upperFirst as xe, pick as Ie, jsonp as Ae, loadScript as X, Request as He, Storage as Oe, mapToObject as q } from "@vtj/utils";
3
+ import * as O from "vue";
4
+ import { inject as re, toRef as De, readonly as Me, customRef as ke, ref as J, onBeforeUnmount as Te, getCurrentScope as Be, onScopeDispose as Ue, unref as Ne, getCurrentInstance as oe, watch as ie, computed as ae, onMounted as Le, defineComponent as ce, h as U, defineAsyncComponent as Z, watchEffect as qe } from "vue";
5
+ import { useRoute as ue } from "vue-router";
6
+ import { ElNotification as D, ElLoading as Je } from "element-plus";
7
+ import { XStartup as Ve } from "@vtj/ui";
8
8
  /**!
9
9
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
10
10
  * @name @vtj/renderer
11
11
  * @author CHC chenhuachun1549@dingtalk.com
12
- * @version 0.8.163
12
+ * @version 0.8.165
13
13
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
14
14
  */
15
- const C = "0.8.163";
16
- var S = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(S || {});
17
- const Y = [
15
+ const C = "0.8.165";
16
+ var w = /* @__PURE__ */ ((s) => (s.Runtime = "Runtime", s.Design = "Design", s.Raw = "Raw", s.VNode = "VNode", s))(w || {});
17
+ const ee = [
18
18
  "$el",
19
19
  "$emit",
20
20
  "$nextTick",
@@ -26,7 +26,7 @@ const Y = [
26
26
  "$props",
27
27
  "$options",
28
28
  "$forceUpdate"
29
- ], en = [
29
+ ], on = [
30
30
  "beforeCreate",
31
31
  "created",
32
32
  "beforeMount",
@@ -40,7 +40,7 @@ const Y = [
40
40
  "renderTriggered",
41
41
  "activated",
42
42
  "deactivated"
43
- ], qe = ["vIf", "vShow", "vModel", "vFor", "vBind"], Je = {
43
+ ], ze = ["vIf", "vShow", "vModel", "vFor", "vBind"], Ke = {
44
44
  String,
45
45
  Number,
46
46
  Boolean,
@@ -49,154 +49,154 @@ const Y = [
49
49
  Function,
50
50
  Date
51
51
  };
52
- function F(n, e) {
53
- return n.map((t) => ye(t) || t.startsWith("/") ? t : `${e}${t}`);
52
+ function F(s, e) {
53
+ return s.map((t) => $e(t) || t.startsWith("/") ? t : `${e}${t}`);
54
54
  }
55
- function J(n) {
56
- return /\.css$/.test(n);
55
+ function V(s) {
56
+ return /\.css$/.test(s);
57
57
  }
58
- function L(n) {
59
- return /\.js$/.test(n);
58
+ function z(s) {
59
+ return /\.js$/.test(s);
60
60
  }
61
- function Le(n) {
62
- return /\.json$/.test(n);
61
+ function We(s) {
62
+ return /\.json$/.test(s);
63
63
  }
64
- function tn(n) {
65
- return n.map(
66
- (e) => `<script src="${P.append(e, { v: C })}"><\/script>`
64
+ function an(s) {
65
+ return s.map(
66
+ (e) => `<script src="${b.append(e, { v: C })}"><\/script>`
67
67
  ).join("");
68
68
  }
69
- function nn(n = []) {
70
- return n.map(
71
- (e) => `<link rel="stylesheet" href="${P.append(e, { v: C })}" />`
69
+ function cn(s = []) {
70
+ return s.map(
71
+ (e) => `<link rel="stylesheet" href="${b.append(e, { v: C })}" />`
72
72
  ).join("");
73
73
  }
74
- function Ve(n, e = !1) {
75
- return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
74
+ function Ge(s, e = !1) {
75
+ return e && s.endsWith(".prod.js") ? s.replace(".prod.js", ".js") : s;
76
76
  }
77
- function We(n, e, t = !1) {
78
- const r = n.filter((u) => !!u.enabled), s = [], o = [], a = [], i = [], l = {}, c = {}, d = [], f = {};
79
- return r.forEach(
80
- ({ urls: u, assetsUrl: h, library: p, assetsLibrary: m, localeLibrary: _ }) => {
81
- u?.forEach((v) => {
82
- L(v) && s.push(Ve(v, t)), J(v) && o.push(v);
83
- }), p && (i.push(p), l[p] = F(u || [], e), _ && (c[p] = _)), h && a.push(h), m && d.push(m), p && m && (f[m] = p);
77
+ function Ye(s, e, t = !1) {
78
+ const n = s.filter((l) => !!l.enabled), r = [], o = [], a = [], i = [], u = {}, c = {}, p = [], f = {};
79
+ return n.forEach(
80
+ ({ urls: l, assetsUrl: m, library: d, assetsLibrary: h, localeLibrary: _ }) => {
81
+ l?.forEach((v) => {
82
+ z(v) && r.push(Ge(v, t)), V(v) && o.push(v);
83
+ }), d && (i.push(d), u[d] = F(l || [], e), _ && (c[d] = _)), m && a.push(m), h && p.push(h), d && h && (f[h] = d);
84
84
  }
85
85
  ), {
86
- scripts: F(s, e),
86
+ scripts: F(r, e),
87
87
  css: F(o, e),
88
88
  materials: F(a, e),
89
89
  libraryExports: i,
90
- materialExports: ge(d),
90
+ materialExports: je(p),
91
91
  materialMapLibrary: f,
92
- libraryMap: l,
92
+ libraryMap: u,
93
93
  libraryLocaleMap: c
94
94
  };
95
95
  }
96
- function Ge(n, e) {
97
- const { name: t, parent: r, alias: s } = n;
98
- return r ? e[r]?.[s || t] : e[s || t];
96
+ function Qe(s, e) {
97
+ const { name: t, parent: n, alias: r } = s;
98
+ return n ? e[n]?.[r || t] : e[r || t];
99
99
  }
100
- function ie(n) {
101
- return $(n) ? n : JSON.stringify(n);
100
+ function le(s) {
101
+ return $(s) ? s : JSON.stringify(s);
102
102
  }
103
- function ae(n, e, t) {
104
- const r = n.CSSStyleSheet;
105
- if (r.prototype.replaceSync) {
106
- const s = new r();
107
- s.id = e, s.replaceSync(t);
108
- const o = n.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
109
- (l) => l.id !== e
103
+ function fe(s, e, t) {
104
+ const n = s.CSSStyleSheet;
105
+ if (n.prototype.replaceSync) {
106
+ const r = new n();
107
+ r.id = e, r.replaceSync(t);
108
+ const o = s.document, a = o.adoptedStyleSheets, i = Array.from(a).filter(
109
+ (u) => u.id !== e
110
110
  );
111
- o.adoptedStyleSheets = [...i, s];
111
+ o.adoptedStyleSheets = [...i, r];
112
112
  } else {
113
- const s = n.document;
114
- let o = s.getElementById(e);
115
- o ? o.innerHTML = t : (o = s.createElement("style"), o.id = e, o.innerHTML = t, s.head.appendChild(o));
113
+ const r = s.document;
114
+ let o = r.getElementById(e);
115
+ o ? o.innerHTML = t : (o = r.createElement("style"), o.id = e, o.innerHTML = t, r.head.appendChild(o));
116
116
  }
117
117
  }
118
- async function Ke(n, e) {
119
- const t = await window.fetch(e).then((r) => r.text()).catch(() => "");
120
- t && ae(window, n, t);
118
+ async function Xe(s, e) {
119
+ const t = await window.fetch(e).then((n) => n.text()).catch(() => "");
120
+ t && fe(window, s, t);
121
121
  }
122
- function Qe(n, e = window) {
123
- const t = e.document, r = e.document.head;
124
- for (const s of n)
125
- if (!t.getElementById(s)) {
122
+ function Ze(s, e = window) {
123
+ const t = e.document, n = e.document.head;
124
+ for (const r of s)
125
+ if (!t.getElementById(r)) {
126
126
  const a = t.createElement("link");
127
- a.rel = "stylesheet", a.id = s, a.href = s, r.appendChild(a);
127
+ a.rel = "stylesheet", a.id = r, a.href = r, n.appendChild(a);
128
128
  }
129
129
  }
130
- async function Xe(n, e, t = window) {
131
- const r = t.document, s = t.document.head;
130
+ async function et(s, e, t = window) {
131
+ const n = t.document, r = t.document.head;
132
132
  let o = t[e];
133
133
  return o ? o.default || o : new Promise((a, i) => {
134
- for (const l of n) {
135
- const c = r.createElement("script");
136
- c.src = l, c.onload = () => {
134
+ for (const u of s) {
135
+ const c = n.createElement("script");
136
+ c.src = u, c.onload = () => {
137
137
  o = t[e], o ? a(o.default || o) : i(null);
138
- }, c.onerror = (d) => {
139
- i(d);
140
- }, s.appendChild(c);
138
+ }, c.onerror = (p) => {
139
+ i(p);
140
+ }, r.appendChild(c);
141
141
  }
142
142
  });
143
143
  }
144
- function Ye(n) {
145
- return K(n) || K(n?.install);
144
+ function tt(s) {
145
+ return Y(s) || Y(s?.install);
146
146
  }
147
- function R(n, e, t = !1, r = !1) {
147
+ function R(s, e, t = !1, n = !1) {
148
148
  try {
149
- const s = ['"use strict";', "var __self = arguments[0];"];
150
- s.push("return ");
151
- let o = (n.value || "").trim();
152
- o = o.replace(/this(\W|$)/g, (i, l) => `__self${l}`), o = s.join(`
149
+ const r = ['"use strict";', "var __self = arguments[0];"];
150
+ r.push("return ");
151
+ let o = (s.value || "").trim();
152
+ o = o.replace(/this(\W|$)/g, (i, u) => `__self${u}`), o = r.join(`
153
153
  `) + o;
154
154
  const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
155
155
  return new Function("$scope", a)(e);
156
- } catch (s) {
157
- if (H.error("parseExpression.error", s, n, e?.__self ?? e), r)
158
- throw s;
156
+ } catch (r) {
157
+ if (A.error("parseExpression.error", r, s, e?.__self ?? e), n)
158
+ throw r;
159
159
  }
160
160
  }
161
- function z(n, e, t = !1, r = !1) {
162
- const s = R(n, e, t, r);
163
- if (typeof s != "function" && (H.error(
161
+ function te(s, e, t = !1, n = !1) {
162
+ const r = R(s, e, t, n);
163
+ if (typeof r != "function" && (A.error(
164
164
  "parseFunction.error",
165
165
  "not a function",
166
- n,
166
+ s,
167
167
  e?.__self ?? e
168
- ), r))
169
- throw new Error(`"${n.value}" not a function`);
170
- return s;
168
+ ), n))
169
+ throw new Error(`"${s.value}" not a function`);
170
+ return r;
171
171
  }
172
- function w(n) {
173
- return n && n.type === "JSExpression";
172
+ function S(s) {
173
+ return s && s.type === "JSExpression";
174
174
  }
175
- function T(n) {
176
- return typeof n == "object" && n && n.type === "JSFunction";
175
+ function M(s) {
176
+ return typeof s == "object" && s && s.type === "JSFunction";
177
177
  }
178
- function ze(n) {
179
- return w(n) || T(n);
178
+ function nt(s) {
179
+ return S(s) || M(s);
180
180
  }
181
- function rn(n) {
182
- return ze(n) ? n.value : JSON.stringify(n);
181
+ function un(s) {
182
+ return nt(s) ? s.value : JSON.stringify(s);
183
183
  }
184
184
  let E = null;
185
- const Ze = _e({
185
+ const st = Ee({
186
186
  settings: {
187
187
  type: "form",
188
188
  validSuccess: !0,
189
189
  originResponse: !1,
190
190
  loading: !0,
191
- validate: (n) => n.data?.code === 0 || !!n.data?.success,
191
+ validate: (s) => s.data?.code === 0 || !!s.data?.success,
192
192
  failMessage: !0,
193
- showError: (n) => {
193
+ showError: (s) => {
194
194
  D.error({
195
- message: n || "未知错误"
195
+ message: s || "未知错误"
196
196
  });
197
197
  },
198
198
  showLoading: () => {
199
- E && E.close(), E = Ue.service({
199
+ E && E.close(), E = Je.service({
200
200
  lock: !0,
201
201
  text: "Loading",
202
202
  background: "rgba(0, 0, 0, 0.05)"
@@ -207,66 +207,179 @@ const Ze = _e({
207
207
  }
208
208
  }
209
209
  });
210
- let b;
211
- function et(n, e) {
212
- const { jsonp: t, request: r } = e;
213
- if (n.method === "jsonp")
214
- return (s = {}) => t(n.url, {
215
- ...n.jsonpOptions,
216
- query: s
210
+ let P;
211
+ function rt(s, e) {
212
+ const { jsonp: t, request: n } = e;
213
+ if (s.method === "jsonp")
214
+ return (r = {}) => t(s.url, {
215
+ ...s.jsonpOptions,
216
+ query: r
217
217
  });
218
218
  {
219
- const s = n.headers ? R(n.headers, {}, !0) : void 0, o = {
220
- url: n.url,
221
- method: n.method,
219
+ const r = s.headers ? R(s.headers, {}, !0) : void 0, o = {
220
+ url: s.url,
221
+ method: s.method,
222
222
  settings: {
223
- ...n.settings,
224
- headers: s
223
+ ...s.settings,
224
+ headers: r
225
225
  }
226
226
  };
227
- return (a, i) => (delete o.data, r.send(we(o, i || {}, { data: a })));
227
+ return (a, i) => (delete o.data, n.send(Pe(o, i || {}, { data: a })));
228
228
  }
229
229
  }
230
- function tt(n, e) {
230
+ function ot(s, e) {
231
231
  const { metaQuery: t } = e;
232
232
  if (!t) return;
233
- const { code: r, queryCode: s } = n;
233
+ const { code: n, queryCode: r } = s;
234
234
  return (o, a) => {
235
235
  if (!t) {
236
236
  console.warn("adapter.metaQuery is not defined!");
237
237
  return;
238
238
  }
239
- return t(r, s, o, a);
239
+ return t(n, r, o, a);
240
240
  };
241
241
  }
242
- function nt(n = [], e = [], t) {
243
- const r = {};
244
- for (const s of n)
245
- r[s.id] = et(s, t);
246
- for (const s of e)
247
- r[s.id] = tt(s, t);
248
- return r;
242
+ function it(s = [], e = [], t) {
243
+ const n = {};
244
+ for (const r of s)
245
+ n[r.id] = rt(r, t);
246
+ for (const r of e)
247
+ n[r.id] = ot(r, t);
248
+ return n;
249
249
  }
250
- async function rt(n = []) {
251
- b = await import("mockjs").then((e) => e.default || e), b && (b.setup({
250
+ async function at(s = []) {
251
+ P = await import("mockjs").then((e) => e.default || e), P && (P.setup({
252
252
  timeout: "50-500"
253
- }), ce(), n.forEach((e) => st(b, e)));
253
+ }), de(), s.forEach((e) => ct(P, e)));
254
254
  }
255
- function st(n, e) {
255
+ function ct(s, e) {
256
256
  if (!e.mock) return;
257
- const { url: t, mockTemplate: r } = e;
258
- if (t && r) {
259
- const s = Se(`${t}(.*)`), o = $e(t, { decode: decodeURIComponent }), a = R(r, {}, !0);
260
- n.mock(s, (i) => {
261
- const l = P.parse(i.url) || {}, c = i.body instanceof FormData ? je(i.body) : i.body, d = o(i.url)?.params;
262
- return Object.assign(i, { data: c, params: l, query: d }), n.mock(a(i));
257
+ const { url: t, mockTemplate: n } = e;
258
+ if (t && n) {
259
+ const r = be(`${t}(.*)`), o = Ce(t, { decode: decodeURIComponent }), a = R(n, {}, !0);
260
+ s.mock(r, (i) => {
261
+ const u = b.parse(i.url) || {}, c = i.body instanceof FormData ? Re(i.body) : i.body, p = o(i.url)?.params;
262
+ return Object.assign(i, { data: c, params: u, query: p }), s.mock(a(i));
263
+ });
264
+ }
265
+ }
266
+ function de() {
267
+ P && (P._mocked = {});
268
+ }
269
+ const ut = {
270
+ session: !1,
271
+ authKey: "Authorization",
272
+ storageKey: "ACCESS_STORAGE",
273
+ storagePrefix: "__VTJ__",
274
+ unauthorized: "/unauthorized",
275
+ auth: "/#/login",
276
+ redirectParam: "r",
277
+ unauthorizedCode: 401,
278
+ unauthorizedMessage: "登录已经失效,请重新登录!"
279
+ }, pe = Symbol("access");
280
+ class ln {
281
+ options;
282
+ data = null;
283
+ constructor(e) {
284
+ this.options = Object.assign({}, ut, e), this.loadData();
285
+ }
286
+ connect(e) {
287
+ const { mode: t, router: n, request: r } = e;
288
+ n && t === w.Raw && this.setGuard(n), r && this.setRequest(r);
289
+ }
290
+ login(e) {
291
+ const { storageKey: t, storagePrefix: n, session: r, authKey: o } = this.options;
292
+ this.data = e, k.save(t, e, {
293
+ type: "local",
294
+ prefix: n
295
+ }), r && T.set(o, e.token);
296
+ }
297
+ clear() {
298
+ const { storageKey: e, storagePrefix: t, session: n, authKey: r } = this.options;
299
+ this.data = null, k.remove(e, {
300
+ type: "local",
301
+ prefix: t
302
+ }), n && T.remove(r);
303
+ }
304
+ logout() {
305
+ this.clear(), this.toLogin();
306
+ }
307
+ getData() {
308
+ return this.data;
309
+ }
310
+ can(e) {
311
+ const { permissions: t = {} } = this.data || {};
312
+ return Q(e).every((r) => t[r]);
313
+ }
314
+ some(e) {
315
+ const { permissions: t = {} } = this.data || {};
316
+ return Q(e).some((r) => t[r]);
317
+ }
318
+ install(e) {
319
+ e.config.globalProperties.$access = this, e.provide(pe, this);
320
+ }
321
+ isAuthPath(e) {
322
+ const { auth: t, isAuth: n } = this.options;
323
+ if (n)
324
+ return n(e);
325
+ if (e.path && typeof t == "string") {
326
+ const r = t.split("#")[1] || t;
327
+ return e.path === r;
328
+ }
329
+ return !1;
330
+ }
331
+ toLogin() {
332
+ const { auth: e, redirectParam: t } = this.options;
333
+ if (!e) return;
334
+ const n = t ? `?${t}=${encodeURIComponent(location.href)}` : "";
335
+ typeof e == "function" ? e(n) : location.href = t ? `${e}${n}` : e;
336
+ }
337
+ loadData() {
338
+ const { storageKey: e, storagePrefix: t } = this.options;
339
+ this.data = k.get(e, {
340
+ type: "local",
341
+ prefix: t
263
342
  });
264
343
  }
344
+ isLogined() {
345
+ const { session: e, authKey: t } = this.options;
346
+ return e && t ? !!T.get(t) : !!this.data;
347
+ }
348
+ setGuard(e) {
349
+ e.beforeEach((t, n, r) => this.guard(t, r));
350
+ }
351
+ guard(e, t) {
352
+ if (this.isWhiteList(e) || this.isLogined() || this.isAuthPath(e))
353
+ return t();
354
+ t(!1), this.toLogin();
355
+ }
356
+ isWhiteList(e) {
357
+ const { whiteList: t } = this.options;
358
+ return t ? Array.isArray(t) ? t.some((n) => e.fullPath.startsWith(n)) : t(e) : !1;
359
+ }
360
+ isUnauthorized(e) {
361
+ const { unauthorizedCode: t = 401 } = this.options;
362
+ return e.status === t || e.data.code === t;
363
+ }
364
+ async showUnauthorizedAlert(e) {
365
+ const { alert: t, unauthorizedMessage: n = "登录已失效" } = this.options;
366
+ this.isUnauthorized(e) && t && (await t(n, { title: "提示", type: "warning" }).catch((r) => r), this.toLogin());
367
+ }
368
+ setRequest(e) {
369
+ e.useRequest((t) => (t.headers.Authorization = this.data?.token, t)), e.useResponse(
370
+ async (t) => (await this.showUnauthorizedAlert(t), t),
371
+ async (t) => {
372
+ const n = t.response || t || {};
373
+ return await this.showUnauthorizedAlert(n), Promise.reject(t);
374
+ }
375
+ );
376
+ }
265
377
  }
266
- function ce() {
267
- b && (b._mocked = {});
378
+ function fn() {
379
+ const s = re(pe, null);
380
+ return s || console.warn("access is null"), s;
268
381
  }
269
- class ot {
382
+ class lt {
270
383
  __id = null;
271
384
  __mode;
272
385
  __instance = null;
@@ -292,15 +405,15 @@ class ot {
292
405
  $apis = {};
293
406
  __transform = {};
294
407
  constructor(e) {
295
- const { mode: t, dsl: r, attrs: s } = e;
296
- this.__mode = t, r && (this.__id = r.id || null, this.__transform = r.transform || {}), s && Object.assign(this, s);
297
- }
298
- setup(e, t = M) {
299
- const r = t.getCurrentInstance();
300
- if (!r) return;
301
- this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = r.proxy;
302
- const s = r.appContext.config.globalProperties;
303
- Object.assign(this, s), Object.assign(this, e || {}), this.__proxy(), t.onMounted(() => {
408
+ const { mode: t, dsl: n, attrs: r } = e;
409
+ this.__mode = t, n && (this.__id = n.id || null, this.__transform = n.transform || {}), r && Object.assign(this, r);
410
+ }
411
+ setup(e, t = O) {
412
+ const n = t.getCurrentInstance();
413
+ if (!n) return;
414
+ this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = n.proxy;
415
+ const r = n.appContext.config.globalProperties;
416
+ Object.assign(this, r), Object.assign(this, e || {}), this.__proxy(), t.onMounted(() => {
304
417
  this.__proxy();
305
418
  }), t.onUnmounted(() => {
306
419
  this.__cleanup();
@@ -309,529 +422,531 @@ class ot {
309
422
  });
310
423
  }
311
424
  __proxy() {
312
- this.__instance && Y.forEach((e) => {
425
+ this.__instance && ee.forEach((e) => {
313
426
  this[e] = this.__instance?.[e];
314
427
  });
315
428
  }
316
429
  __cleanup() {
317
- Y.forEach((e) => {
430
+ ee.forEach((e) => {
318
431
  this[e] = null;
319
432
  });
320
433
  }
321
434
  __parseFunction(e) {
322
435
  if (e)
323
- if (this.__mode === S.Runtime) {
324
- const { id: t, type: r } = e, s = t ? this.__transform[t] ?? e.value : e.value;
325
- return z({ type: r, value: s }, this);
436
+ if (this.__mode === w.Runtime) {
437
+ const { id: t, type: n } = e, r = t ? this.__transform[t] ?? e.value : e.value;
438
+ return te({ type: n, value: r }, this);
326
439
  } else
327
- return z(e, this);
440
+ return te(e, this);
328
441
  }
329
442
  __parseExpression(e) {
330
443
  if (e)
331
- if (this.__mode === S.Runtime) {
332
- const { id: t, type: r } = e, s = t ? this.__transform[t] ?? e.value : e.value;
333
- return R({ type: r, value: s }, this);
444
+ if (this.__mode === w.Runtime) {
445
+ const { id: t, type: n } = e, r = t ? this.__transform[t] ?? e.value : e.value;
446
+ return R({ type: n, value: r }, this);
334
447
  } else
335
448
  return R(e, this);
336
449
  }
337
450
  __ref(e = null, t) {
338
- if (this.__mode !== S.VNode)
339
- return e && e !== this.__id && (this.__contextRefs[e] = this), async (r) => {
340
- await Ee(0);
341
- let s = r?.$vtjEl || r?.$el || r?._?.vnode?.el || r;
342
- if (!s) {
451
+ if (this.__mode !== w.VNode)
452
+ return e && e !== this.__id && (this.__contextRefs[e] = this), async (n) => {
453
+ await Fe(0);
454
+ let r = n?.$vtjEl || n?.$el || n?._?.vnode?.el || n;
455
+ if (!r) {
343
456
  typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
344
457
  return;
345
458
  }
346
- if (s.nodeType === 3 && s.nextSibling && (s = s.nextSibling), s.__vtj__ = e, S.Design === this.__mode && (s.__context__ = this, s.draggable = !0), e && (this.__refs[e] = r), typeof t == "function")
347
- t(r);
459
+ if (r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e, w.Design === this.__mode && (r.__context__ = this, r.draggable = !0), e && (this.__refs[e] = n), typeof t == "function")
460
+ t(n);
348
461
  else if (t) {
349
462
  const o = this.$refs[t];
350
- if (o && r !== o) {
351
- const a = new Set([].concat(o, r));
463
+ if (o && n !== o) {
464
+ const a = new Set([].concat(o, n));
352
465
  this.$refs[t] = Array.from(a);
353
466
  } else
354
- this.$refs[t] = r;
467
+ this.$refs[t] = n;
355
468
  }
356
- return r;
469
+ return n;
357
470
  };
358
471
  }
359
472
  __clone(e = {}) {
360
- const t = { ...this.context, ...e }, r = {
473
+ const t = { ...this.context, ...e }, n = {
361
474
  ...t,
362
475
  context: t
363
476
  };
364
- return r.context.__proto__ = this.context, r.__proto__ = this, r;
477
+ return n.context.__proto__ = this.context, n.__proto__ = this, n;
365
478
  }
366
479
  }
367
- function B(n) {
480
+ function N(s) {
368
481
  const {
369
- Vue: e = M,
370
- mode: t = S.Runtime,
371
- components: r = {},
372
- libs: s = {},
482
+ Vue: e = O,
483
+ mode: t = w.Runtime,
484
+ components: n = {},
485
+ libs: r = {},
373
486
  apis: o = {},
374
487
  loader: a
375
- } = n, i = e.computed(() => n.dsl), l = {
376
- $components: r,
377
- $libs: s,
488
+ } = s, i = e.computed(() => s.dsl), u = {
489
+ $components: n,
490
+ $libs: r,
378
491
  $apis: o
379
- }, c = new ot({
492
+ }, c = new lt({
380
493
  mode: t,
381
494
  dsl: i.value,
382
- attrs: l
383
- }), d = e.defineComponent({
495
+ attrs: u
496
+ }), p = e.defineComponent({
384
497
  name: i.value.name,
385
498
  props: {
386
- ...at(i.value.props ?? [], c)
499
+ ...dt(i.value.props ?? [], c)
387
500
  },
388
501
  setup(f) {
389
- c.$props = f, c.props = f, i.value.id && ae(
390
- n.window || window,
502
+ c.$props = f, c.props = f, i.value.id && fe(
503
+ s.window || window,
391
504
  i.value.id,
392
505
  i.value.css || ""
393
- ), c.state = ct(e, i.value.state ?? {}, c);
394
- const u = lt(e, i.value.computed ?? {}, c), h = ut(i.value.methods ?? {}, c), p = ft(e, i.value.inject, c), m = pt(
506
+ ), c.state = pt(e, i.value.state ?? {}, c);
507
+ const l = ht(e, i.value.computed ?? {}, c), m = mt(i.value.methods ?? {}, c), d = vt(e, i.value.inject, c), h = gt(
395
508
  i.value.dataSources || {},
396
509
  c
397
510
  ), _ = {
398
- ...p,
399
- ...u,
400
- ...h,
401
- ...m
511
+ ...d,
512
+ ...l,
513
+ ...m,
514
+ ...h
402
515
  };
403
- return c.setup(_, e), dt(e, i.value.watch ?? [], c), {
516
+ return c.setup(_, e), yt(e, i.value.watch ?? [], c), {
404
517
  vtj: c
405
518
  };
406
519
  },
407
- emits: it(i.value.emits),
520
+ emits: ft(i.value.emits),
408
521
  expose: ["vtj"],
409
522
  render() {
410
523
  if (!i.value.nodes) return null;
411
524
  const f = i.value.nodes || [];
412
- return f.length === 1 ? O(f[0], c, e, a) : f.map((u) => O(u, c, e, a));
525
+ return f.length === 1 ? H(f[0], c, e, a) : f.map((l) => H(l, c, e, a));
413
526
  },
414
- ...mt(i.value.lifeCycles ?? {}, c)
527
+ ..._t(i.value.lifeCycles ?? {}, c)
415
528
  });
416
529
  return {
417
- renderer: e.markRaw(d),
530
+ renderer: e.markRaw(p),
418
531
  context: c
419
532
  };
420
533
  }
421
- function it(n = []) {
422
- return n.map((e) => $(e) ? e : e.name);
534
+ function ft(s = []) {
535
+ return s.map((e) => $(e) ? e : e.name);
423
536
  }
424
- function at(n = [], e) {
425
- const t = (r) => r ? (Array.isArray(r) ? r : [r]).map((o) => Je[o]) : void 0;
426
- return n.map((r) => $(r) ? {
427
- name: r
537
+ function dt(s = [], e) {
538
+ const t = (n) => n ? (Array.isArray(n) ? n : [n]).map((o) => Ke[o]) : void 0;
539
+ return s.map((n) => $(n) ? {
540
+ name: n
428
541
  } : {
429
- name: r.name,
430
- type: r.type,
431
- required: r.required,
432
- default: w(r.default) ? e.__parseExpression(r.default) : r.default
542
+ name: n.name,
543
+ type: n.type,
544
+ required: n.required,
545
+ default: S(n.default) ? e.__parseExpression(n.default) : n.default
433
546
  }).reduce(
434
- (r, s) => (r[s.name] = {
435
- type: t(s.type),
436
- required: s.required,
437
- default: s.default
438
- }, r),
547
+ (n, r) => (n[r.name] = {
548
+ type: t(r.type),
549
+ required: r.required,
550
+ default: r.default
551
+ }, n),
439
552
  {}
440
553
  );
441
554
  }
442
- function ct(n, e, t) {
443
- return n.reactive(
555
+ function pt(s, e, t) {
556
+ return s.reactive(
444
557
  Object.keys(e || {}).reduce(
445
- (r, s) => {
446
- let o = e[s];
447
- return w(o) ? o = t.__parseExpression(o) : T(o) && (o = t.__parseFunction(o)), r[s] = o, r;
558
+ (n, r) => {
559
+ let o = e[r];
560
+ return S(o) ? o = t.__parseExpression(o) : M(o) && (o = t.__parseFunction(o)), n[r] = o, n;
448
561
  },
449
562
  {}
450
563
  )
451
564
  );
452
565
  }
453
- function lt(n, e, t) {
566
+ function ht(s, e, t) {
454
567
  return Object.entries(e ?? {}).reduce(
455
- (r, [s, o]) => (r[s] = n.computed(t.__parseFunction(o)), r),
568
+ (n, [r, o]) => (n[r] = s.computed(t.__parseFunction(o)), n),
456
569
  {}
457
570
  );
458
571
  }
459
- function ut(n, e) {
460
- return Object.entries(n ?? {}).reduce(
461
- (t, [r, s]) => (t[r] = e.__parseFunction(s), t),
572
+ function mt(s, e) {
573
+ return Object.entries(s ?? {}).reduce(
574
+ (t, [n, r]) => (t[n] = e.__parseFunction(r), t),
462
575
  {}
463
576
  );
464
577
  }
465
- function ft(n, e = [], t) {
578
+ function vt(s, e = [], t) {
466
579
  return e.reduce(
467
- (r, s) => {
468
- const { name: o, from: a } = s || {};
469
- s.default;
470
- const i = w(a) ? t.__parseExpression(a) || o : a ?? o, l = w(s.default) ? t.__parseExpression(s.default) : s.default ?? null;
471
- return r[o] = n.inject(i, l), r;
580
+ (n, r) => {
581
+ const { name: o, from: a } = r || {};
582
+ r.default;
583
+ const i = S(a) ? t.__parseExpression(a) || o : a ?? o, u = S(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
584
+ return n[o] = s.inject(i, u), n;
472
585
  },
473
586
  {}
474
587
  );
475
588
  }
476
- function pt(n, e) {
477
- return Object.keys(n).reduce(
478
- (t, r) => {
479
- const s = n[r], o = e.$apis[s.ref], a = T(s.transform) ? s.transform.value ? e.__parseFunction(s.transform) : void 0 : s.transform;
480
- return t[r] = async (...i) => {
481
- const l = await o.apply(e, i);
482
- return a ? a(l) : l;
589
+ function gt(s, e) {
590
+ return Object.keys(s).reduce(
591
+ (t, n) => {
592
+ const r = s[n], o = e.$apis[r.ref], a = M(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
593
+ return t[n] = async (...i) => {
594
+ const u = await o.apply(e, i);
595
+ return a ? a(u) : u;
483
596
  }, t;
484
597
  },
485
598
  {}
486
599
  );
487
600
  }
488
- function dt(n, e = [], t) {
489
- e.forEach((r) => {
490
- n.watch(
491
- t.__parseExpression(r.source),
492
- t.__parseFunction(r.handler),
601
+ function yt(s, e = [], t) {
602
+ e.forEach((n) => {
603
+ s.watch(
604
+ t.__parseExpression(n.source),
605
+ t.__parseFunction(n.handler),
493
606
  {
494
- deep: r.deep,
495
- immediate: r.immediate
607
+ deep: n.deep,
608
+ immediate: n.immediate
496
609
  }
497
610
  );
498
611
  });
499
612
  }
500
- function mt(n, e) {
501
- return Object.entries(n ?? {}).reduce(
502
- (t, [r, s]) => (t[r] = e.__parseFunction(s), t),
613
+ function _t(s, e) {
614
+ return Object.entries(s ?? {}).reduce(
615
+ (t, [n, r]) => (t[n] = e.__parseFunction(r), t),
503
616
  {}
504
617
  );
505
618
  }
506
- let k = [];
507
- const ht = (n) => n;
508
- async function le(n, e = window) {
509
- const { urls: t = [], library: r } = n, s = t.filter((i) => L(i));
510
- if (s.length === 0 || !r) return null;
511
- const o = t.filter((i) => J(i));
512
- return o.length && Qe(o, e), await Xe(s, r, e).catch(
513
- (i) => (console.warn("loadScriptUrl error", s, r, i), null)
619
+ let B = [];
620
+ const wt = (s) => s;
621
+ async function he(s, e = window) {
622
+ const { urls: t = [], library: n } = s, r = t.filter((i) => z(i));
623
+ if (r.length === 0 || !n) return null;
624
+ const o = t.filter((i) => V(i));
625
+ return o.length && Ze(o, e), await et(r, n, e).catch(
626
+ (i) => (console.warn("loadScriptUrl error", r, n, i), null)
514
627
  );
515
628
  }
516
- function U(n) {
517
- const { getDsl: e, getDslByUrl: t, options: r } = n;
518
- return r.window && (k.forEach((s) => {
519
- delete r.window[s];
520
- }), k = []), (s, o, a = M) => !o || typeof o == "string" ? s : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
629
+ function L(s) {
630
+ const { getDsl: e, getDslByUrl: t, options: n } = s;
631
+ return n.window && (B.forEach((r) => {
632
+ delete n.window[r];
633
+ }), B = []), (r, o, a = O) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
521
634
  const i = await e(o.id);
522
- return i && (i.name = s), i ? B({
523
- ...r,
635
+ return i && (i.name = r), i ? N({
636
+ ...n,
524
637
  Vue: a,
525
638
  dsl: i,
526
- mode: S.Runtime,
527
- loader: U(n)
639
+ mode: w.Runtime,
640
+ loader: L(s)
528
641
  }).renderer : null;
529
642
  }) : o.type === "UrlSchema" && o.url ? a.defineAsyncComponent(async () => {
530
643
  const i = await t(o.url);
531
- return i && (i.name = s), i ? B({
532
- ...r,
644
+ return i && (i.name = r), i ? N({
645
+ ...n,
533
646
  Vue: a,
534
647
  dsl: i,
535
- mode: S.Runtime,
536
- loader: U(n)
648
+ mode: w.Runtime,
649
+ loader: L(s)
537
650
  }).renderer : null;
538
- }) : o.type === "Plugin" ? (o.library && k.push(o.library), a.defineAsyncComponent(async () => {
539
- const i = await le(o, r.window);
651
+ }) : o.type === "Plugin" ? (o.library && B.push(o.library), a.defineAsyncComponent(async () => {
652
+ const i = await he(o, n.window);
540
653
  return i || (console.warn("getPlugin result is null", o), null);
541
- })) : s;
654
+ })) : r;
542
655
  }
543
- function O(n, e, t = M, r = ht) {
544
- if (!n || !n.name || n.invisible) return null;
545
- const { id: s = null, directives: o = [] } = n, { vIf: a, vFor: i, vShow: l, vModels: c, vBind: d } = vt(o);
546
- if (a && !yt(a, e))
656
+ function H(s, e, t = O, n = wt) {
657
+ if (!s || !s.name || s.invisible) return null;
658
+ const { id: r = null, directives: o = [] } = s, { vIf: a, vFor: i, vShow: u, vModels: c, vBind: p } = St(o);
659
+ if (a && !$t(a, e))
547
660
  return null;
548
- const f = (u) => {
549
- const h = u.$components, p = (() => {
550
- if (n.name === "component")
551
- return gt(u, n.props?.is);
552
- if (n.name === "slot") return n.name;
553
- const y = r(n.name, n.from, t);
554
- return $(y) ? h[y] ?? y : y;
555
- })(), m = _t(s, n.props ?? {}, u), _ = wt(t, n.events ?? {}, u);
556
- if (n.name === "slot")
557
- return St(t, n, m, u, r);
558
- d && Object.assign(m, u.__parseExpression(d.value)), l && (m.style = Object.assign(
559
- m.style ?? {},
560
- jt(l, u)
561
- )), c.forEach((y) => {
562
- Object.assign(m, Et(t, y, u));
661
+ const f = (l) => {
662
+ const m = l.$components, d = (() => {
663
+ if (s.name === "component")
664
+ return jt(l, s.props?.is);
665
+ if (s.name === "slot") return s.name;
666
+ const g = n(s.name, s.from, t);
667
+ return $(g) ? m[g] ?? g : g;
668
+ })(), h = Et(r, s.props ?? {}, l), _ = Pt(t, s.events ?? {}, l);
669
+ if (s.name === "slot")
670
+ return bt(t, s, h, l, n);
671
+ p && Object.assign(h, l.__parseExpression(p.value)), u && (h.style = Object.assign(
672
+ h.style ?? {},
673
+ Rt(u, l)
674
+ )), c.forEach((g) => {
675
+ Object.assign(h, Ft(t, g, l));
563
676
  });
564
- const v = bt(
677
+ const v = xt(
565
678
  t,
566
- n.children ?? [],
567
- u,
568
- r,
569
- n
679
+ s.children ?? [],
680
+ l,
681
+ n,
682
+ s
570
683
  );
571
- return t.createVNode(p, { ...m, ..._ }, v);
684
+ return t.createVNode(d, { ...h, ..._ }, v);
572
685
  };
573
- return i ? Rt(i, f, e) : f(e);
686
+ return i ? Ht(i, f, e) : f(e);
574
687
  }
575
- function vt(n = []) {
576
- const e = n.find((i) => j(i.name) === "vIf"), t = n.find((i) => j(i.name) === "vFor"), r = n.find((i) => j(i.name) === "vShow"), s = n.find((i) => j(i.name) === "vBind"), o = n.filter((i) => j(i.name) === "vModel"), a = n.filter(
577
- (i) => !qe.includes(j(i.name))
688
+ function St(s = []) {
689
+ const e = s.find((i) => j(i.name) === "vIf"), t = s.find((i) => j(i.name) === "vFor"), n = s.find((i) => j(i.name) === "vShow"), r = s.find((i) => j(i.name) === "vBind"), o = s.filter((i) => j(i.name) === "vModel"), a = s.filter(
690
+ (i) => !ze.includes(j(i.name))
578
691
  );
579
692
  return {
580
693
  vIf: e,
581
694
  vFor: t,
582
- vShow: r,
695
+ vShow: n,
583
696
  vModels: o,
584
- vBind: s,
697
+ vBind: r,
585
698
  others: a
586
699
  };
587
700
  }
588
- function yt(n, e) {
589
- return !!e.__parseExpression(n.value);
701
+ function $t(s, e) {
702
+ return !!e.__parseExpression(s.value);
590
703
  }
591
- function gt(n, e) {
592
- return e ? w(e) ? n.__parseExpression(e) : e : "div";
704
+ function jt(s, e) {
705
+ return e ? S(e) ? s.__parseExpression(e) : e : "div";
593
706
  }
594
- function _t(n, e, t) {
595
- const r = Object.keys(e || {}).reduce(
596
- (s, o) => {
707
+ function Et(s, e, t) {
708
+ const n = Object.keys(e || {}).reduce(
709
+ (r, o) => {
597
710
  let a = e[o];
598
- return w(a) ? a = t.__parseExpression(a) : T(a) && (a = t.__parseFunction(a)), s[o] = a, s;
711
+ return S(a) ? a = t.__parseExpression(a) : M(a) && (a = t.__parseFunction(a)), r[o] = a, r;
599
712
  },
600
713
  {}
601
714
  );
602
- return r.ref = t.__ref(n, r.ref), r;
715
+ return n.ref = t.__ref(s, n.ref), n;
603
716
  }
604
- function wt(n, e, t) {
605
- const r = ["passive", "capture", "once"], s = {
717
+ function Pt(s, e, t) {
718
+ const n = ["passive", "capture", "once"], r = {
606
719
  capture: "Capture",
607
720
  once: "Once",
608
721
  passive: "OnceCapture"
609
722
  };
610
723
  return Object.keys(e || {}).reduce(
611
724
  (o, a) => {
612
- const i = e[a], l = ue(i.modifiers), c = l.find((u) => r.includes(u)), d = "on" + be(a) + (c && s[c] || ""), f = t.__parseFunction(i.handler);
613
- return f && (o[d] = n.withModifiers(f, l)), o;
725
+ const i = e[a], u = me(i.modifiers), c = u.find((l) => n.includes(l)), p = "on" + xe(a) + (c && r[c] || ""), f = t.__parseFunction(i.handler);
726
+ return f && (o[p] = s.withModifiers(f, u)), o;
614
727
  },
615
728
  {}
616
729
  );
617
730
  }
618
- function ue(n = {}, e = !1) {
619
- const t = Object.keys(n);
620
- return e ? t.map((r) => "." + r) : t;
731
+ function me(s = {}, e = !1) {
732
+ const t = Object.keys(s);
733
+ return e ? t.map((n) => "." + n) : t;
621
734
  }
622
- function St(n, e, t, r, s) {
623
- const { children: o } = e, a = $t(e, r), i = r.$slots?.[a.name];
624
- return i ? i(t) : o ? $(o) ? n.createTextVNode(o) : w(o) ? n.createTextVNode(
625
- ie(r.__parseExpression(o))
735
+ function bt(s, e, t, n, r) {
736
+ const { children: o } = e, a = Ct(e, n), i = n.$slots?.[a.name];
737
+ return i ? i(t) : o ? $(o) ? s.createTextVNode(o) : S(o) ? s.createTextVNode(
738
+ le(n.__parseExpression(o))
626
739
  ) : Array.isArray(o) ? o.map(
627
- (l) => O(l, r, n, s)
740
+ (u) => H(u, n, s, r)
628
741
  ) : null : null;
629
742
  }
630
- function $t(n, e) {
631
- const { props: t } = n, r = t?.name || "default";
743
+ function Ct(s, e) {
744
+ const { props: t } = s, n = t?.name || "default";
632
745
  return {
633
- name: w(r) ? e.__parseExpression(r) : r,
746
+ name: S(n) ? e.__parseExpression(n) : n,
634
747
  params: []
635
748
  };
636
749
  }
637
- function jt(n, e) {
638
- return e.__parseExpression(n.value) ? {} : {
750
+ function Rt(s, e) {
751
+ return e.__parseExpression(s.value) ? {} : {
639
752
  display: "none"
640
753
  };
641
754
  }
642
- function Et(n, e, t) {
643
- const r = {
755
+ function Ft(s, e, t) {
756
+ const n = {
644
757
  type: "JSFunction",
645
758
  value: e.value?.value ? `(v) => {
646
759
  ${e.value.value} = v;
647
760
  }` : "(v) => {}"
648
- }, s = t.__parseFunction(r), o = ue(e.modifiers), a = w(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
761
+ }, r = t.__parseFunction(n), o = me(e.modifiers), a = S(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
649
762
  return {
650
763
  [a]: t.__parseExpression(e.value),
651
- [`onUpdate:${a}`]: o.length && s ? n.withModifiers(s, o) : s
764
+ [`onUpdate:${a}`]: o.length && r ? s.withModifiers(r, o) : r
652
765
  };
653
766
  }
654
- function bt(n, e, t, r, s) {
767
+ function xt(s, e, t, n, r) {
655
768
  if (!e) return null;
656
769
  if ($(e))
657
770
  return { default: () => e };
658
- if (w(e))
771
+ if (S(e))
659
772
  return {
660
- default: () => ie(t.__parseExpression(e))
773
+ default: () => le(t.__parseExpression(e))
661
774
  };
662
775
  if (Array.isArray(e) && e.length > 0) {
663
- const o = Pt(e), a = (i) => !i || !s ? {} : s?.id && Object.keys(i).length ? {
664
- [`scope_${s.id}`]: i
776
+ const o = It(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
777
+ [`scope_${r.id}`]: i
665
778
  } : {};
666
- return Object.entries(o).reduce((i, [l, { nodes: c, params: d }]) => (i[l] = (f) => {
667
- const u = d.length ? Pe(f ?? {}, d) : a(f);
779
+ return Object.entries(o).reduce((i, [u, { nodes: c, params: p }]) => (i[u] = (f) => {
780
+ const l = p.length ? Ie(f ?? {}, p) : a(f);
668
781
  return c.map(
669
- (h) => O(h, t.__clone(u), n, r)
782
+ (m) => H(m, t.__clone(l), s, n)
670
783
  );
671
784
  }, i), {});
672
785
  }
673
786
  return null;
674
787
  }
675
- function Pt(n) {
788
+ function It(s) {
676
789
  const e = {
677
790
  default: {
678
791
  params: [],
679
792
  nodes: []
680
793
  }
681
794
  };
682
- for (const t of n) {
683
- const r = Ct(t.slot), s = r.name;
684
- e[s] ? (e[s].nodes.push(t), e[s].params = e[s].params.concat(r.params)) : e[s] = {
795
+ for (const t of s) {
796
+ const n = At(t.slot), r = n.name;
797
+ e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(n.params)) : e[r] = {
685
798
  nodes: [t],
686
- params: r.params
799
+ params: n.params
687
800
  };
688
801
  }
689
802
  return e;
690
803
  }
691
- function Ct(n = "default") {
692
- return $(n) ? { name: n, params: [] } : { params: [], ...n };
804
+ function At(s = "default") {
805
+ return $(s) ? { name: s, params: [] } : { params: [], ...s };
693
806
  }
694
- function Rt(n, e, t) {
695
- const { value: r, iterator: s } = n, { item: o = "item", index: a = "index" } = s || {};
696
- let i = t.__parseExpression(r) || [];
697
- 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]:", `${r?.value} is not a Arrary`), []);
807
+ function Ht(s, e, t) {
808
+ const { value: n, iterator: r } = s, { item: o = "item", index: a = "index" } = r || {};
809
+ let i = t.__parseExpression(n) || [];
810
+ return Number.isInteger(i) && (i = new Array(i).fill(!0).map((u, c) => c + 1)), Array.isArray(i) ? i.map((u, c) => e(t.__clone({ [o]: u, [a]: c }))) : (console.warn("[vForRender]:", `${n?.value} is not a Arrary`), []);
698
811
  }
699
- function Ft(n) {
700
- return Me() ? (De(n), !0) : !1;
812
+ function Ot(s) {
813
+ return Be() ? (Ue(s), !0) : !1;
701
814
  }
702
- function V(n) {
703
- return typeof n == "function" ? n() : Te(n);
815
+ function K(s) {
816
+ return typeof s == "function" ? s() : Ne(s);
704
817
  }
705
- const fe = typeof window < "u" && typeof document < "u";
818
+ const ve = typeof window < "u" && typeof document < "u";
706
819
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
707
- const It = (n) => n != null, xt = () => {
820
+ const Dt = (s) => s != null, Mt = () => {
708
821
  };
709
- function Ht(n) {
710
- return te();
822
+ function kt(s) {
823
+ return oe();
711
824
  }
712
- function Ot(...n) {
713
- if (n.length !== 1)
714
- return Ie(...n);
715
- const e = n[0];
716
- return typeof e == "function" ? xe(He(() => ({ get: e, set: xt }))) : q(e);
825
+ function Tt(...s) {
826
+ if (s.length !== 1)
827
+ return De(...s);
828
+ const e = s[0];
829
+ return typeof e == "function" ? Me(ke(() => ({ get: e, set: Mt }))) : J(e);
717
830
  }
718
- function Mt(n, e) {
719
- Ht() && Oe(n, e);
831
+ function Bt(s, e) {
832
+ kt() && Te(s, e);
720
833
  }
721
- const Dt = fe ? window : void 0, Tt = fe ? window.document : void 0;
722
- function kt(n) {
834
+ const Ut = ve ? window : void 0, Nt = ve ? window.document : void 0;
835
+ function Lt(s) {
723
836
  var e;
724
- const t = V(n);
837
+ const t = K(s);
725
838
  return (e = t?.$el) != null ? e : t;
726
839
  }
727
- function At() {
728
- const n = q(!1), e = te();
729
- return e && ke(() => {
730
- n.value = !0;
731
- }, e), n;
840
+ function qt() {
841
+ const s = J(!1), e = oe();
842
+ return e && Le(() => {
843
+ s.value = !0;
844
+ }, e), s;
732
845
  }
733
- function Bt(n) {
734
- const e = At();
735
- return re(() => (e.value, !!n()));
846
+ function Jt(s) {
847
+ const e = qt();
848
+ return ae(() => (e.value, !!s()));
736
849
  }
737
- function Ut(n, e, t = {}) {
738
- const { window: r = Dt, ...s } = t;
850
+ function Vt(s, e, t = {}) {
851
+ const { window: n = Ut, ...r } = t;
739
852
  let o;
740
- const a = Bt(() => r && "MutationObserver" in r), i = () => {
853
+ const a = Jt(() => n && "MutationObserver" in n), i = () => {
741
854
  o && (o.disconnect(), o = void 0);
742
- }, l = re(() => {
743
- const u = V(n), h = (Array.isArray(u) ? u : [u]).map(kt).filter(It);
744
- return new Set(h);
745
- }), c = ne(
746
- () => l.value,
747
- (u) => {
748
- i(), a.value && u.size && (o = new MutationObserver(e), u.forEach((h) => o.observe(h, s)));
855
+ }, u = ae(() => {
856
+ const l = K(s), m = (Array.isArray(l) ? l : [l]).map(Lt).filter(Dt);
857
+ return new Set(m);
858
+ }), c = ie(
859
+ () => u.value,
860
+ (l) => {
861
+ i(), a.value && l.size && (o = new MutationObserver(e), l.forEach((m) => o.observe(m, r)));
749
862
  },
750
863
  { immediate: !0, flush: "post" }
751
- ), d = () => o?.takeRecords(), f = () => {
864
+ ), p = () => o?.takeRecords(), f = () => {
752
865
  c(), i();
753
866
  };
754
- return Ft(f), {
867
+ return Ot(f), {
755
868
  isSupported: a,
756
869
  stop: f,
757
- takeRecords: d
870
+ takeRecords: p
758
871
  };
759
872
  }
760
- function Nt(n = null, e = {}) {
761
- var t, r, s;
873
+ function zt(s = null, e = {}) {
874
+ var t, n, r;
762
875
  const {
763
- document: o = Tt,
876
+ document: o = Nt,
764
877
  restoreOnUnmount: a = (f) => f
765
- } = e, i = (t = o?.title) != null ? t : "", l = Ot((r = n ?? o?.title) != null ? r : null), c = n && typeof n == "function";
766
- function d(f) {
878
+ } = e, i = (t = o?.title) != null ? t : "", u = Tt((n = s ?? o?.title) != null ? n : null), c = s && typeof s == "function";
879
+ function p(f) {
767
880
  if (!("titleTemplate" in e))
768
881
  return f;
769
- const u = e.titleTemplate || "%s";
770
- return typeof u == "function" ? u(f) : V(u).replace(/%s/g, f);
882
+ const l = e.titleTemplate || "%s";
883
+ return typeof l == "function" ? l(f) : K(l).replace(/%s/g, f);
771
884
  }
772
- return ne(
773
- l,
774
- (f, u) => {
775
- f !== u && o && (o.title = d(typeof f == "string" ? f : ""));
885
+ return ie(
886
+ u,
887
+ (f, l) => {
888
+ f !== l && o && (o.title = p(typeof f == "string" ? f : ""));
776
889
  },
777
890
  { immediate: !0 }
778
- ), e.observe && !e.titleTemplate && o && !c && Ut(
779
- (s = o.head) == null ? void 0 : s.querySelector("title"),
891
+ ), e.observe && !e.titleTemplate && o && !c && Vt(
892
+ (r = o.head) == null ? void 0 : r.querySelector("title"),
780
893
  () => {
781
- o && o.title !== l.value && (l.value = d(o.title));
894
+ o && o.title !== u.value && (u.value = p(o.title));
782
895
  },
783
896
  { childList: !0 }
784
- ), Mt(() => {
897
+ ), Bt(() => {
785
898
  if (a) {
786
- const f = a(i, l.value || "");
899
+ const f = a(i, u.value || "");
787
900
  f != null && o && (o.title = f);
788
901
  }
789
- }), l;
902
+ }), u;
790
903
  }
791
- const Z = se({
904
+ const ne = ce({
792
905
  name: "VtjPageContainer",
793
906
  async setup() {
794
- const n = de(), e = oe(), t = e.params.id, r = t ? n.getPage(t) : n.getHomepage(), s = r ? await n.getRenderComponent(r.id) : null;
795
- return r && Nt(r.title || "VTJ"), {
796
- provider: n,
797
- component: s,
798
- file: r,
907
+ const s = ye(), e = ue(), t = e.params.id, n = t ? s.getPage(t) : s.getHomepage(), r = n ? await s.getRenderComponent(n.id) : null;
908
+ return n && zt(n.title || "VTJ"), {
909
+ provider: s,
910
+ component: r,
911
+ file: n,
799
912
  query: e.query
800
913
  };
801
914
  },
802
915
  render() {
803
- return this.component ? A(this.component, this.query) : A("div", "页面不存在");
916
+ return this.component ? U(this.component, this.query) : U("div", "页面不存在");
804
917
  }
805
- }), qt = se({
918
+ }), Kt = ce({
806
919
  name: "VtjStartupContainer",
807
920
  render() {
808
- return A(Ne);
921
+ return U(Ve);
809
922
  }
810
- }), pe = Symbol("Provider");
811
- var Jt = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(Jt || {});
812
- class Lt extends he {
923
+ }), ge = Symbol("Provider");
924
+ var Wt = /* @__PURE__ */ ((s) => (s.Production = "production", s.Development = "development", s))(Wt || {});
925
+ class Gt extends we {
813
926
  constructor(e) {
814
927
  super(), this.options = e;
815
928
  const {
816
929
  service: t,
817
- mode: r = S.Raw,
818
- dependencies: s,
930
+ mode: n = w.Raw,
931
+ dependencies: r,
819
932
  materials: o,
820
933
  project: a = {},
821
934
  adapter: i = {},
822
- globals: l = {},
935
+ globals: u = {},
823
936
  modules: c = {},
824
- router: d = null,
937
+ router: p = null,
825
938
  materialPath: f = "./",
826
- nodeEnv: u = "development"
939
+ nodeEnv: l = "development"
827
940
  /* Development */
828
941
  } = e;
829
- this.mode = r, this.modules = c, this.service = t, this.router = d, this.materialPath = f, this.nodeEnv = u, s && (this.dependencies = s), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, i), r !== S.Design && this.load(a);
942
+ this.mode = n, this.modules = c, this.service = t, this.router = p, this.materialPath = f, this.nodeEnv = l, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, u), Object.assign(this.adapter, i);
943
+ const { access: m, request: d } = this.adapter;
944
+ m && m.connect({ mode: n, router: p, request: d }), n !== w.Design && this.load(a);
830
945
  }
831
946
  mode;
832
947
  globals = {};
833
948
  modules = {};
834
- adapter = { request: Ze, jsonp: Ce };
949
+ adapter = { request: st, jsonp: Ae };
835
950
  apis = {};
836
951
  dependencies = {};
837
952
  materials = {};
@@ -847,53 +962,53 @@ class Lt extends he {
847
962
  const t = this.modules[`.vtj/projects/${e.id}.json`];
848
963
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
849
964
  throw new Error("project is null");
850
- const { apis: r = [], meta: s = [] } = this.project, o = window;
851
- o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis = nt(r, s, this.adapter), ce(), this.project.config?.mock && rt(r), this.initRouter(), this.triggerReady();
965
+ const { apis: n = [], meta: r = [] } = this.project, o = window;
966
+ o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis = it(n, r, this.adapter), de(), this.project.config?.mock && at(n), this.initRouter(), this.triggerReady();
852
967
  }
853
968
  async loadDependencies(e) {
854
969
  const t = Object.entries(this.dependencies);
855
- for (const [r, s] of t)
856
- e[r] || (e[r] = await s());
970
+ for (const [n, r] of t)
971
+ e[n] || (e[n] = await r());
857
972
  }
858
973
  async loadAssets(e) {
859
- const { dependencies: t = [] } = this.project, { dependencies: r, library: s, components: o, materialPath: a, nodeEnv: i } = this, {
860
- libraryExports: l,
974
+ const { dependencies: t = [] } = this.project, { dependencies: n, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
975
+ libraryExports: u,
861
976
  libraryMap: c,
862
- materials: d,
977
+ materials: p,
863
978
  materialExports: f,
864
- materialMapLibrary: u
865
- } = We(
979
+ materialMapLibrary: l
980
+ } = Ye(
866
981
  t,
867
982
  a,
868
983
  i === "development"
869
984
  /* Development */
870
985
  );
871
- for (const p of l) {
872
- const m = r[p], _ = e[p];
986
+ for (const d of u) {
987
+ const h = n[d], _ = e[d];
873
988
  if (_)
874
- s[p] = _;
875
- else if (m)
876
- e[p] = s[p] = await m();
989
+ r[d] = _;
990
+ else if (h)
991
+ e[d] = r[d] = await h();
877
992
  else {
878
- const v = c[p] || [];
879
- for (const y of v)
880
- J(y) && await Ke(p, P.append(y, { v: C })), L(y) && await Q(P.append(y, { v: C }));
881
- s[p] = e[p];
993
+ const v = c[d] || [];
994
+ for (const g of v)
995
+ V(g) && await Xe(d, b.append(g, { v: C })), z(g) && await X(b.append(g, { v: C }));
996
+ r[d] = e[d];
882
997
  }
883
998
  }
884
- for (const p of d)
885
- await Q(P.append(p, { v: C }));
886
- const h = this.materials || {};
887
- for (const p of f) {
888
- const m = e[u[p]], _ = ve[p];
999
+ for (const d of p)
1000
+ await X(b.append(d, { v: C }));
1001
+ const m = this.materials || {};
1002
+ for (const d of f) {
1003
+ const h = e[l[d]], _ = Se[d];
889
1004
  if (_)
890
- m && _.forEach((v) => {
891
- o[v] = m[v];
1005
+ h && _.forEach((v) => {
1006
+ o[v] = h[v];
892
1007
  });
893
1008
  else {
894
- const v = h[p] ? (await h[p]()).default : e[p];
895
- v && m && (v.components || []).forEach((y) => {
896
- o[y.name] = Ge(y, m);
1009
+ const v = m[d] ? (await m[d]()).default : e[d];
1010
+ v && h && (v.components || []).forEach((g) => {
1011
+ o[g.name] = Qe(g, h);
897
1012
  });
898
1013
  }
899
1014
  }
@@ -903,50 +1018,50 @@ class Lt extends he {
903
1018
  e && (e.addRoute({
904
1019
  path: "/page/:id",
905
1020
  name: "VtjPage",
906
- component: Z
1021
+ component: ne
907
1022
  }), e.addRoute({
908
1023
  path: "/",
909
1024
  name: "VtjHomepage",
910
- component: t?.homepage ? Z : qt
1025
+ component: t?.homepage ? ne : Kt
911
1026
  }));
912
1027
  }
913
1028
  install(e) {
914
1029
  const t = e.config.globalProperties.installed || {};
915
- for (const [r, s] of Object.entries(this.library))
916
- !t[r] && Ye(s) && (e.use(s), t[r] = !0);
917
- this.options.install && e.use(this.options.install), e.provide(pe, this), e.config.globalProperties.installed = t, this.nodeEnv === "development" && (e.config.errorHandler = (r, s, o) => {
918
- const a = s?.$options.name, i = r?.message || r?.msg || "未知错误", l = `[ ${a} ] ${i}`;
1030
+ for (const [n, r] of Object.entries(this.library))
1031
+ !t[n] && tt(r) && (e.use(r), t[n] = !0);
1032
+ this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(ge, this), e.config.globalProperties.installed = t, this.nodeEnv === "development" && (e.config.errorHandler = (n, r, o) => {
1033
+ const a = r?.$options.name, i = typeof n == "string" ? n : n?.message || n?.msg || "未知错误", u = `[ ${a} ] ${i} ${o}`;
919
1034
  console.error(
920
1035
  "[VTJ Error]:",
921
1036
  {
922
- err: r,
923
- instance: s,
1037
+ err: n,
1038
+ instance: r,
924
1039
  info: o
925
1040
  },
926
- r?.stack
1041
+ n?.stack
927
1042
  ), D.error({
928
1043
  title: "运行时错误:请在控制台查看详情",
929
- message: l
1044
+ message: u
930
1045
  });
931
1046
  });
932
1047
  }
933
1048
  getFile(e) {
934
1049
  const { blocks: t = [] } = this.project || {};
935
- return this.getPage(e) || t.find((r) => r.id === e) || null;
1050
+ return this.getPage(e) || t.find((n) => n.id === e) || null;
936
1051
  }
937
1052
  getPage(e) {
938
- const { pages: t = [] } = this.project || {}, r = (s, o = []) => {
1053
+ const { pages: t = [] } = this.project || {}, n = (r, o = []) => {
939
1054
  for (const a of o) {
940
- if (a.id === s)
1055
+ if (a.id === r)
941
1056
  return a;
942
1057
  if (a.children && a.children.length) {
943
- const i = r(s, a.children);
1058
+ const i = n(r, a.children);
944
1059
  if (i)
945
1060
  return i;
946
1061
  }
947
1062
  }
948
1063
  };
949
- return r(e, t) || null;
1064
+ return n(e, t) || null;
950
1065
  }
951
1066
  getHomepage() {
952
1067
  const { homepage: e } = this.project || {};
@@ -965,94 +1080,94 @@ class Lt extends he {
965
1080
  validSuccess: !1,
966
1081
  originResponse: !0
967
1082
  }
968
- }).then((r) => r.data).catch(() => null));
1083
+ }).then((n) => n.data).catch(() => null));
969
1084
  }
970
1085
  createDslRenderer(e, t = {}) {
971
- const { library: r, components: s, mode: o, apis: a } = this, i = {
1086
+ const { library: n, components: r, mode: o, apis: a } = this, i = {
972
1087
  mode: o,
973
- Vue: r.Vue,
974
- components: s,
975
- libs: r,
1088
+ Vue: n.Vue,
1089
+ components: r,
1090
+ libs: n,
976
1091
  apis: a,
977
1092
  window,
978
1093
  ...t
979
- }, l = U({
1094
+ }, u = L({
980
1095
  getDsl: async (c) => await this.getDsl(c) || null,
981
1096
  getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
982
1097
  options: i
983
1098
  });
984
- return B({
1099
+ return N({
985
1100
  ...i,
986
1101
  dsl: e,
987
- loader: l
1102
+ loader: u
988
1103
  });
989
1104
  }
990
1105
  async getRenderComponent(e) {
991
1106
  const t = this.getFile(e);
992
1107
  if (!t)
993
- return H.warn(`Can not find file: ${e}`), null;
994
- const r = `.vtj/vue/${e}.vue`, s = this.modules[r];
995
- if (s)
996
- return (await s())?.default;
1108
+ return A.warn(`Can not find file: ${e}`), null;
1109
+ const n = `.vtj/vue/${e}.vue`, r = this.modules[n];
1110
+ if (r)
1111
+ return (await r())?.default;
997
1112
  const o = await this.getDsl(t.id);
998
- return o ? this.createDslRenderer(o).renderer : (H.warn(`Can not find dsl: ${e}`), null);
1113
+ return o ? this.createDslRenderer(o).renderer : (A.warn(`Can not find dsl: ${e}`), null);
999
1114
  }
1000
1115
  defineUrlSchemaComponent(e, t) {
1001
- return X(async () => {
1002
- const r = await this.getDslByUrl(e);
1003
- return r ? (r.name = t || r.name, this.createDslRenderer(r).renderer) : null;
1116
+ return Z(async () => {
1117
+ const n = await this.getDslByUrl(e);
1118
+ return n ? (n.name = t || n.name, this.createDslRenderer(n).renderer) : null;
1004
1119
  });
1005
1120
  }
1006
1121
  definePluginComponent(e) {
1007
- return X(async () => await le(e, window));
1122
+ return Z(async () => await he(e, window));
1008
1123
  }
1009
1124
  }
1010
- function sn(n) {
1011
- const e = new Lt(n);
1125
+ function dn(s) {
1126
+ const e = new Gt(s);
1012
1127
  return {
1013
1128
  provider: e,
1014
- onReady: (r) => e.ready(r)
1129
+ onReady: (n) => e.ready(n)
1015
1130
  };
1016
1131
  }
1017
- function de(n = {}) {
1018
- const e = Ae(pe);
1132
+ function ye(s = {}) {
1133
+ const e = re(ge);
1019
1134
  if (!e)
1020
1135
  throw new Error("Can not find provider");
1021
1136
  if (e.nodeEnv === "development") {
1022
- const { id: t, version: r } = n;
1023
- t && r && (async () => {
1024
- const s = await e.getDsl(t);
1025
- s?.__VERSION__ !== r && D.warning({
1026
- title: s?.name,
1137
+ const { id: t, version: n } = s;
1138
+ t && n && (async () => {
1139
+ const r = await e.getDsl(t);
1140
+ r?.__VERSION__ !== n && D.warning({
1141
+ title: r?.name,
1027
1142
  message: "当前组件源码版本与运行时版本不一致,请重新发布组件"
1028
1143
  });
1029
1144
  })();
1030
1145
  }
1031
1146
  return e;
1032
1147
  }
1033
- const W = new Re({
1148
+ const W = new He({
1034
1149
  settings: {
1035
1150
  type: "json",
1036
1151
  validSuccess: !0,
1037
1152
  originResponse: !1,
1038
1153
  failMessage: !0,
1039
- validate: (n) => n.data?.code === 0,
1040
- showError: (n) => {
1154
+ validate: (s) => s.data?.code === 0,
1155
+ showError: (s) => {
1041
1156
  D.error({
1042
- message: n || "未知错误"
1157
+ message: s || "未知错误"
1043
1158
  });
1044
1159
  }
1045
1160
  }
1046
- }), Vt = (n = "/__vtj__/api/:type.json") => (e, t) => W.send({
1047
- url: n,
1161
+ }), Yt = (s = "/__vtj__/api/:type.json") => (e, t) => W.send({
1162
+ url: s,
1048
1163
  method: "post",
1049
1164
  params: { type: e },
1050
1165
  data: {
1051
1166
  type: e,
1052
1167
  data: t
1053
1168
  }
1054
- }), Wt = (n = "/__vtj__/api/uploader.json") => async (e, t) => await W.send({
1055
- url: n,
1169
+ }), Qt = (s = "/__vtj__/api/uploader.json") => async (e, t) => await W.send({
1170
+ url: s,
1056
1171
  method: "post",
1057
1172
  data: {
1058
1173
  files: e,
@@ -1061,13 +1176,13 @@ const W = new Re({
1061
1176
  settings: {
1062
1177
  type: "data"
1063
1178
  }
1064
- }).then((r) => r && r[0] ? r[0] : null).catch(() => null);
1179
+ }).then((n) => n && n[0] ? n[0] : null).catch(() => null);
1065
1180
  class G {
1066
1181
  api;
1067
1182
  pluginCaches = {};
1068
1183
  uploader;
1069
1184
  constructor() {
1070
- this.api = Vt(), this.uploader = Wt();
1185
+ this.api = Yt(), this.uploader = Qt();
1071
1186
  }
1072
1187
  async getExtension() {
1073
1188
  console.log("BaseService.getExtension");
@@ -1140,11 +1255,11 @@ class G {
1140
1255
  return await this.api("clearStaticFiles", e).catch(() => "");
1141
1256
  }
1142
1257
  async getPluginMaterial(e) {
1143
- const { urls: t = [] } = e, r = t.filter((o) => Le(o))[0];
1144
- if (!r) return null;
1145
- const s = this.pluginCaches[r];
1146
- return s || (this.pluginCaches[r] = W.send({
1147
- url: r,
1258
+ const { urls: t = [] } = e, n = t.filter((o) => We(o))[0];
1259
+ if (!n) return null;
1260
+ const r = this.pluginCaches[n];
1261
+ return r || (this.pluginCaches[n] = W.send({
1262
+ url: n,
1148
1263
  method: "get",
1149
1264
  settings: {
1150
1265
  validSuccess: !1,
@@ -1153,77 +1268,77 @@ class G {
1153
1268
  }).then((o) => o.data).catch(() => null));
1154
1269
  }
1155
1270
  }
1156
- const g = new Fe({
1271
+ const y = new Oe({
1157
1272
  type: "local",
1158
1273
  expired: 0,
1159
1274
  prefix: "__VTJ_"
1160
1275
  });
1161
- class on extends G {
1276
+ class pn extends G {
1162
1277
  init(e) {
1163
- const t = new x(e), r = g.get(`project_${t.id}`), s = Object.assign(t.toDsl(), r || {});
1164
- return g.save(`project_${t.id}`, s), Promise.resolve(s);
1278
+ const t = new I(e), n = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), n || {});
1279
+ return y.save(`project_${t.id}`, r), Promise.resolve(r);
1165
1280
  }
1166
1281
  saveProject(e) {
1167
- const t = new x(e);
1168
- return g.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1282
+ const t = new I(e);
1283
+ return y.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1169
1284
  }
1170
1285
  saveMaterials(e, t) {
1171
- return g.save(`materials_${e.id}`, N(t)), Promise.resolve(!0);
1286
+ return y.save(`materials_${e.id}`, q(t)), Promise.resolve(!0);
1172
1287
  }
1173
1288
  saveFile(e) {
1174
- return g.save(`file_${e.id}`, e), Promise.resolve(!0);
1289
+ return y.save(`file_${e.id}`, e), Promise.resolve(!0);
1175
1290
  }
1176
1291
  getFile(e) {
1177
- const t = g.get(`file_${e}`);
1292
+ const t = y.get(`file_${e}`);
1178
1293
  return t ? Promise.resolve(t) : Promise.reject(null);
1179
1294
  }
1180
1295
  removeFile(e) {
1181
- return g.remove(`file_${e}`), Promise.resolve(!0);
1296
+ return y.remove(`file_${e}`), Promise.resolve(!0);
1182
1297
  }
1183
1298
  saveHistory(e) {
1184
- return g.save(`history_${e.id}`, e), Promise.resolve(!0);
1299
+ return y.save(`history_${e.id}`, e), Promise.resolve(!0);
1185
1300
  }
1186
1301
  removeHistory(e) {
1187
- const t = g.get(`history_${e}`);
1302
+ const t = y.get(`history_${e}`);
1188
1303
  if (t) {
1189
- const s = (t.items || []).map((o) => o.id);
1190
- this.removeHistoryItem(e, s), g.remove(`history_${e}`);
1304
+ const r = (t.items || []).map((o) => o.id);
1305
+ this.removeHistoryItem(e, r), y.remove(`history_${e}`);
1191
1306
  }
1192
1307
  return Promise.resolve(!0);
1193
1308
  }
1194
1309
  getHistory(e) {
1195
- const t = g.get(`history_${e}`), r = new ee(t || { id: e });
1196
- return Promise.resolve(r.toDsl());
1310
+ const t = y.get(`history_${e}`), n = new se(t || { id: e });
1311
+ return Promise.resolve(n.toDsl());
1197
1312
  }
1198
1313
  getHistoryItem(e, t) {
1199
- const r = g.get(`history_${e}_${t}`);
1200
- return Promise.resolve(r);
1314
+ const n = y.get(`history_${e}_${t}`);
1315
+ return Promise.resolve(n);
1201
1316
  }
1202
1317
  saveHistoryItem(e, t) {
1203
- return g.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1318
+ return y.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1204
1319
  }
1205
1320
  removeHistoryItem(e, t) {
1206
- return t.forEach((r) => {
1207
- g.remove(`history_${e}_${r}`);
1321
+ return t.forEach((n) => {
1322
+ y.remove(`history_${e}_${n}`);
1208
1323
  }), Promise.resolve(!0);
1209
1324
  }
1210
1325
  }
1211
- class Gt extends G {
1326
+ class Xt extends G {
1212
1327
  projects = {};
1213
1328
  materials = {};
1214
1329
  files = {};
1215
1330
  histories = {};
1216
1331
  historyItems = {};
1217
1332
  init(e) {
1218
- const t = new x(e), r = this.projects[t.id] || {}, s = Object.assign(t.toDsl(), r);
1219
- return this.projects[s.id] = s, Promise.resolve(s);
1333
+ const t = new I(e), n = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), n);
1334
+ return this.projects[r.id] = r, Promise.resolve(r);
1220
1335
  }
1221
1336
  saveProject(e) {
1222
- const t = new x(e);
1337
+ const t = new I(e);
1223
1338
  return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
1224
1339
  }
1225
1340
  saveMaterials(e, t) {
1226
- return e.id && (this.materials[e.id] = N(t)), Promise.resolve(!0);
1341
+ return e.id && (this.materials[e.id] = q(t)), Promise.resolve(!0);
1227
1342
  }
1228
1343
  saveFile(e) {
1229
1344
  return this.files[e.id] = e, Promise.resolve(!0);
@@ -1241,35 +1356,35 @@ class Gt extends G {
1241
1356
  removeHistory(e) {
1242
1357
  const t = this.histories[e];
1243
1358
  if (t) {
1244
- const s = (t.items || []).map((o) => o.id);
1245
- this.removeHistoryItem(e, s), delete this.historyItems[e];
1359
+ const r = (t.items || []).map((o) => o.id);
1360
+ this.removeHistoryItem(e, r), delete this.historyItems[e];
1246
1361
  }
1247
1362
  return Promise.resolve(!0);
1248
1363
  }
1249
1364
  getHistory(e) {
1250
- const t = this.histories[e], r = new ee(t || { id: e });
1251
- return Promise.resolve(r);
1365
+ const t = this.histories[e], n = new se(t || { id: e });
1366
+ return Promise.resolve(n);
1252
1367
  }
1253
1368
  getHistoryItem(e, t) {
1254
- const r = `${e}_${t}`, s = this.historyItems[r] || {};
1255
- return Promise.resolve(s);
1369
+ const n = `${e}_${t}`, r = this.historyItems[n] || {};
1370
+ return Promise.resolve(r);
1256
1371
  }
1257
1372
  saveHistoryItem(e, t) {
1258
- const r = `${e}_${t.id}`;
1259
- return this.historyItems[r] = t, Promise.resolve(!0);
1373
+ const n = `${e}_${t.id}`;
1374
+ return this.historyItems[n] = t, Promise.resolve(!0);
1260
1375
  }
1261
1376
  removeHistoryItem(e, t) {
1262
- return t.forEach((r) => {
1263
- const s = `${e}_${r}`;
1264
- delete this.historyItems[s];
1377
+ return t.forEach((n) => {
1378
+ const r = `${e}_${n}`;
1379
+ delete this.historyItems[r];
1265
1380
  }), Promise.resolve(!0);
1266
1381
  }
1267
1382
  }
1268
- let I = null;
1269
- function an() {
1270
- return I || (I = new Gt(), I);
1383
+ let x = null;
1384
+ function hn() {
1385
+ return x || (x = new Xt(), x);
1271
1386
  }
1272
- class cn extends G {
1387
+ class mn extends G {
1273
1388
  getFileCaches = {};
1274
1389
  async getExtension() {
1275
1390
  return await this.api("getExtension", {}).catch(() => {
@@ -1284,7 +1399,7 @@ class cn extends G {
1284
1399
  async saveMaterials(e, t) {
1285
1400
  return !!await this.api("saveMaterials", {
1286
1401
  project: e,
1287
- materials: N(t)
1402
+ materials: q(t)
1288
1403
  }).catch(() => !1);
1289
1404
  }
1290
1405
  async saveFile(e) {
@@ -1324,92 +1439,95 @@ class cn extends G {
1324
1439
  );
1325
1440
  }
1326
1441
  }
1327
- function me(n = []) {
1328
- return n.map((e) => {
1329
- const { id: t, title: r, icon: s, children: o, hidden: a } = e;
1442
+ function _e(s = []) {
1443
+ return s.map((e) => {
1444
+ const { id: t, title: n, icon: r, children: o, hidden: a } = e;
1330
1445
  return {
1331
1446
  id: t,
1332
- title: r,
1333
- icon: s,
1447
+ title: n,
1448
+ icon: r,
1334
1449
  hidden: a,
1335
1450
  url: `/page/${t}`,
1336
- children: o && o.length ? me(o) : void 0
1451
+ children: o && o.length ? _e(o) : void 0
1337
1452
  };
1338
1453
  });
1339
1454
  }
1340
- function ln() {
1341
- const n = de(), e = oe(), t = q(!1), r = n.project;
1342
- Be(() => {
1343
- const { name: a, params: i, meta: l } = e;
1455
+ function vn() {
1456
+ const s = ye(), e = ue(), t = J(!1), n = s.project;
1457
+ qe(() => {
1458
+ const { name: a, params: i, meta: u } = e;
1344
1459
  if (a === "VtjPage") {
1345
- const c = n.getPage(i.id);
1460
+ const c = s.getPage(i.id);
1346
1461
  t.value = !c?.mask;
1347
1462
  } else if (a === "VtjHomepage") {
1348
- const c = n.getHomepage();
1463
+ const c = s.getHomepage();
1349
1464
  t.value = !c?.mask;
1350
1465
  } else
1351
- t.value = !l.mask;
1466
+ t.value = !u.mask;
1352
1467
  });
1353
- const s = me(r?.pages), o = r?.config;
1468
+ const r = _e(n?.pages), o = n?.config;
1354
1469
  return {
1355
1470
  disabled: t,
1356
1471
  logo: o?.logo,
1357
1472
  themeSwitchable: o?.themeSwitchable,
1358
- title: o?.title || r?.description || r?.name || "VTJ App",
1359
- menus: s
1473
+ title: o?.title || n?.description || n?.name || "VTJ App",
1474
+ menus: r
1360
1475
  };
1361
1476
  }
1362
1477
  export {
1363
- qe as BUILT_IN_DIRECTIVES,
1478
+ pe as ACCESS_KEY,
1479
+ ln as Access,
1480
+ ze as BUILT_IN_DIRECTIVES,
1364
1481
  G as BaseService,
1365
- Y as CONTEXT_HOST,
1366
- ot as Context,
1367
- S as ContextMode,
1368
- Je as DATA_TYPES,
1369
- rn as JSCodeToString,
1370
- en as LIFE_CYCLES_LIST,
1371
- cn as LocalService,
1372
- Gt as MemoryService,
1373
- Jt as NodeEnv,
1374
- Lt as Provider,
1375
- on as StorageService,
1482
+ ee as CONTEXT_HOST,
1483
+ lt as Context,
1484
+ w as ContextMode,
1485
+ Ke as DATA_TYPES,
1486
+ un as JSCodeToString,
1487
+ on as LIFE_CYCLES_LIST,
1488
+ mn as LocalService,
1489
+ Xt as MemoryService,
1490
+ Wt as NodeEnv,
1491
+ Gt as Provider,
1492
+ pn as StorageService,
1376
1493
  C as VTJ_RENDERER_VERSION,
1377
- ae as adoptedStyleSheets,
1378
- tn as createAssetScripts,
1379
- nn as createAssetsCss,
1380
- pt as createDataSources,
1381
- U as createLoader,
1382
- an as createMemoryService,
1383
- tt as createMetaApi,
1384
- sn as createProvider,
1385
- B as createRenderer,
1386
- et as createSchemaApi,
1387
- nt as createSchemaApis,
1388
- ht as defaultLoader,
1494
+ fe as adoptedStyleSheets,
1495
+ an as createAssetScripts,
1496
+ cn as createAssetsCss,
1497
+ gt as createDataSources,
1498
+ L as createLoader,
1499
+ hn as createMemoryService,
1500
+ ot as createMetaApi,
1501
+ dn as createProvider,
1502
+ N as createRenderer,
1503
+ rt as createSchemaApi,
1504
+ it as createSchemaApis,
1505
+ wt as defaultLoader,
1389
1506
  F as fillBasePath,
1390
- ue as getModifiers,
1391
- le as getPlugin,
1392
- Ge as getRawComponent,
1393
- J as isCSSUrl,
1394
- ze as isJSCode,
1395
- w as isJSExpression,
1396
- T as isJSFunction,
1397
- Le as isJSON,
1398
- L as isJSUrl,
1399
- Ye as isVuePlugin,
1400
- Ke as loadCss,
1401
- Qe as loadCssUrl,
1402
- Xe as loadScriptUrl,
1403
- st as mockApi,
1404
- rt as mockApis,
1405
- ce as mockCleanup,
1406
- O as nodeRender,
1407
- We as parseDeps,
1507
+ me as getModifiers,
1508
+ he as getPlugin,
1509
+ Qe as getRawComponent,
1510
+ V as isCSSUrl,
1511
+ nt as isJSCode,
1512
+ S as isJSExpression,
1513
+ M as isJSFunction,
1514
+ We as isJSON,
1515
+ z as isJSUrl,
1516
+ tt as isVuePlugin,
1517
+ Xe as loadCss,
1518
+ Ze as loadCssUrl,
1519
+ et as loadScriptUrl,
1520
+ ct as mockApi,
1521
+ at as mockApis,
1522
+ de as mockCleanup,
1523
+ H as nodeRender,
1524
+ Ye as parseDeps,
1408
1525
  R as parseExpression,
1409
- z as parseFunction,
1410
- pe as providerKey,
1411
- Ve as removeProdFlag,
1412
- ie as toString,
1413
- ln as useMask,
1414
- de as useProvider
1526
+ te as parseFunction,
1527
+ ge as providerKey,
1528
+ Ge as removeProdFlag,
1529
+ le as toString,
1530
+ fn as useAccess,
1531
+ vn as useMask,
1532
+ ye as useProvider
1415
1533
  };