@vtj/renderer 0.8.163 → 0.8.164

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 G, logger as H, createRequest as Ee, merge as Pe, pathToRegexp as be, pathToRegexpMatch as Ce, formDataToJson as Re, storage as k, cookie as Y, toArray as Q, delay as Fe, camelCase as j, upperFirst as xe, pick as Ie, jsonp as He, loadScript as X, Request as Oe, Storage as Ae, mapToObject as L } from "@vtj/utils";
3
+ import * as A from "vue";
4
+ import { inject as re, toRef as De, readonly as Me, customRef as ke, ref as q, 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 B, 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.164
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.164";
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"], We = {
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 J(s) {
56
+ return /\.css$/.test(s);
57
57
  }
58
- function L(n) {
59
- return /\.js$/.test(n);
58
+ function V(s) {
59
+ return /\.js$/.test(s);
60
60
  }
61
- function Le(n) {
62
- return /\.json$/.test(n);
61
+ function Ke(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
+ V(v) && r.push(Ge(v, t)), J(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 G(s) || G(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 (H.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" && (H.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,165 @@ 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
263
  });
264
264
  }
265
265
  }
266
- function ce() {
267
- b && (b._mocked = {});
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 && Y.set(o, e.token);
296
+ }
297
+ logout() {
298
+ const { storageKey: e, storagePrefix: t } = this.options;
299
+ this.data = null, k.remove(e, {
300
+ type: "local",
301
+ prefix: t
302
+ }), this.toLogin();
303
+ }
304
+ getData() {
305
+ return this.data;
306
+ }
307
+ can(e) {
308
+ const { permissions: t = {} } = this.data || {};
309
+ return Q(e).every((r) => t[r]);
310
+ }
311
+ some(e) {
312
+ const { permissions: t = {} } = this.data || {};
313
+ return Q(e).some((r) => t[r]);
314
+ }
315
+ install(e) {
316
+ e.config.globalProperties.$access = this, e.provide(pe, this);
317
+ }
318
+ isAuthPath(e) {
319
+ const { auth: t, isAuth: n } = this.options;
320
+ return n ? n(e) : e.path && typeof t == "string" ? t.includes(e.path) : !1;
321
+ }
322
+ toLogin() {
323
+ const { auth: e, redirectParam: t } = this.options;
324
+ e && (typeof e == "function" ? e() : location.href = t ? `${e}?${t}=${encodeURIComponent(location.href)}` : e);
325
+ }
326
+ loadData() {
327
+ const { storageKey: e, storagePrefix: t } = this.options;
328
+ this.data = k.get(e, {
329
+ type: "local",
330
+ prefix: t
331
+ });
332
+ }
333
+ isLogined() {
334
+ const { session: e, authKey: t } = this.options;
335
+ return e && t ? !!Y.get(t) : !!this.data;
336
+ }
337
+ setGuard(e) {
338
+ e.beforeEach((t, n, r) => this.guard(t, r));
339
+ }
340
+ guard(e, t) {
341
+ if (this.isWhiteList(e) || this.isLogined() || this.isAuthPath(e))
342
+ return t();
343
+ t(!1), this.toLogin();
344
+ }
345
+ isWhiteList(e) {
346
+ const { whiteList: t } = this.options;
347
+ return t ? Array.isArray(t) ? t.some((n) => e.fullPath.startsWith(n)) : t(e) : !1;
348
+ }
349
+ isUnauthorized(e) {
350
+ const { unauthorizedCode: t = 401 } = this.options;
351
+ return e.status === t || e.data.code === t;
352
+ }
353
+ setRequest(e) {
354
+ const { alert: t, unauthorizedMessage: n = "登录已失效" } = this.options;
355
+ e.useRequest((r) => (r.headers.Authorization = this.data?.token, r)), e.useResponse(
356
+ (r) => (this.isUnauthorized(r) && t && t(n), r),
357
+ (r) => {
358
+ const o = r.response || r || {};
359
+ return this.isUnauthorized(o) && t && t(n), r;
360
+ }
361
+ );
362
+ }
363
+ }
364
+ function fn() {
365
+ const s = re(pe, null);
366
+ return s || console.warn("access is null"), s;
268
367
  }
269
- class ot {
368
+ class lt {
270
369
  __id = null;
271
370
  __mode;
272
371
  __instance = null;
@@ -292,15 +391,15 @@ class ot {
292
391
  $apis = {};
293
392
  __transform = {};
294
393
  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(() => {
394
+ const { mode: t, dsl: n, attrs: r } = e;
395
+ this.__mode = t, n && (this.__id = n.id || null, this.__transform = n.transform || {}), r && Object.assign(this, r);
396
+ }
397
+ setup(e, t = A) {
398
+ const n = t.getCurrentInstance();
399
+ if (!n) return;
400
+ this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = n.proxy;
401
+ const r = n.appContext.config.globalProperties;
402
+ Object.assign(this, r), Object.assign(this, e || {}), this.__proxy(), t.onMounted(() => {
304
403
  this.__proxy();
305
404
  }), t.onUnmounted(() => {
306
405
  this.__cleanup();
@@ -309,529 +408,531 @@ class ot {
309
408
  });
310
409
  }
311
410
  __proxy() {
312
- this.__instance && Y.forEach((e) => {
411
+ this.__instance && ee.forEach((e) => {
313
412
  this[e] = this.__instance?.[e];
314
413
  });
315
414
  }
316
415
  __cleanup() {
317
- Y.forEach((e) => {
416
+ ee.forEach((e) => {
318
417
  this[e] = null;
319
418
  });
320
419
  }
321
420
  __parseFunction(e) {
322
421
  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);
422
+ if (this.__mode === w.Runtime) {
423
+ const { id: t, type: n } = e, r = t ? this.__transform[t] ?? e.value : e.value;
424
+ return te({ type: n, value: r }, this);
326
425
  } else
327
- return z(e, this);
426
+ return te(e, this);
328
427
  }
329
428
  __parseExpression(e) {
330
429
  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);
430
+ if (this.__mode === w.Runtime) {
431
+ const { id: t, type: n } = e, r = t ? this.__transform[t] ?? e.value : e.value;
432
+ return R({ type: n, value: r }, this);
334
433
  } else
335
434
  return R(e, this);
336
435
  }
337
436
  __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) {
437
+ if (this.__mode !== w.VNode)
438
+ return e && e !== this.__id && (this.__contextRefs[e] = this), async (n) => {
439
+ await Fe(0);
440
+ let r = n?.$vtjEl || n?.$el || n?._?.vnode?.el || n;
441
+ if (!r) {
343
442
  typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
344
443
  return;
345
444
  }
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);
445
+ 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")
446
+ t(n);
348
447
  else if (t) {
349
448
  const o = this.$refs[t];
350
- if (o && r !== o) {
351
- const a = new Set([].concat(o, r));
449
+ if (o && n !== o) {
450
+ const a = new Set([].concat(o, n));
352
451
  this.$refs[t] = Array.from(a);
353
452
  } else
354
- this.$refs[t] = r;
453
+ this.$refs[t] = n;
355
454
  }
356
- return r;
455
+ return n;
357
456
  };
358
457
  }
359
458
  __clone(e = {}) {
360
- const t = { ...this.context, ...e }, r = {
459
+ const t = { ...this.context, ...e }, n = {
361
460
  ...t,
362
461
  context: t
363
462
  };
364
- return r.context.__proto__ = this.context, r.__proto__ = this, r;
463
+ return n.context.__proto__ = this.context, n.__proto__ = this, n;
365
464
  }
366
465
  }
367
- function B(n) {
466
+ function U(s) {
368
467
  const {
369
- Vue: e = M,
370
- mode: t = S.Runtime,
371
- components: r = {},
372
- libs: s = {},
468
+ Vue: e = A,
469
+ mode: t = w.Runtime,
470
+ components: n = {},
471
+ libs: r = {},
373
472
  apis: o = {},
374
473
  loader: a
375
- } = n, i = e.computed(() => n.dsl), l = {
376
- $components: r,
377
- $libs: s,
474
+ } = s, i = e.computed(() => s.dsl), u = {
475
+ $components: n,
476
+ $libs: r,
378
477
  $apis: o
379
- }, c = new ot({
478
+ }, c = new lt({
380
479
  mode: t,
381
480
  dsl: i.value,
382
- attrs: l
383
- }), d = e.defineComponent({
481
+ attrs: u
482
+ }), p = e.defineComponent({
384
483
  name: i.value.name,
385
484
  props: {
386
- ...at(i.value.props ?? [], c)
485
+ ...dt(i.value.props ?? [], c)
387
486
  },
388
487
  setup(f) {
389
- c.$props = f, c.props = f, i.value.id && ae(
390
- n.window || window,
488
+ c.$props = f, c.props = f, i.value.id && fe(
489
+ s.window || window,
391
490
  i.value.id,
392
491
  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(
492
+ ), c.state = pt(e, i.value.state ?? {}, c);
493
+ const l = ht(e, i.value.computed ?? {}, c), m = mt(i.value.methods ?? {}, c), d = vt(e, i.value.inject, c), h = gt(
395
494
  i.value.dataSources || {},
396
495
  c
397
496
  ), _ = {
398
- ...p,
399
- ...u,
400
- ...h,
401
- ...m
497
+ ...d,
498
+ ...l,
499
+ ...m,
500
+ ...h
402
501
  };
403
- return c.setup(_, e), dt(e, i.value.watch ?? [], c), {
502
+ return c.setup(_, e), yt(e, i.value.watch ?? [], c), {
404
503
  vtj: c
405
504
  };
406
505
  },
407
- emits: it(i.value.emits),
506
+ emits: ft(i.value.emits),
408
507
  expose: ["vtj"],
409
508
  render() {
410
509
  if (!i.value.nodes) return null;
411
510
  const f = i.value.nodes || [];
412
- return f.length === 1 ? O(f[0], c, e, a) : f.map((u) => O(u, c, e, a));
511
+ return f.length === 1 ? O(f[0], c, e, a) : f.map((l) => O(l, c, e, a));
413
512
  },
414
- ...mt(i.value.lifeCycles ?? {}, c)
513
+ ..._t(i.value.lifeCycles ?? {}, c)
415
514
  });
416
515
  return {
417
- renderer: e.markRaw(d),
516
+ renderer: e.markRaw(p),
418
517
  context: c
419
518
  };
420
519
  }
421
- function it(n = []) {
422
- return n.map((e) => $(e) ? e : e.name);
520
+ function ft(s = []) {
521
+ return s.map((e) => $(e) ? e : e.name);
423
522
  }
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
523
+ function dt(s = [], e) {
524
+ const t = (n) => n ? (Array.isArray(n) ? n : [n]).map((o) => We[o]) : void 0;
525
+ return s.map((n) => $(n) ? {
526
+ name: n
428
527
  } : {
429
- name: r.name,
430
- type: r.type,
431
- required: r.required,
432
- default: w(r.default) ? e.__parseExpression(r.default) : r.default
528
+ name: n.name,
529
+ type: n.type,
530
+ required: n.required,
531
+ default: S(n.default) ? e.__parseExpression(n.default) : n.default
433
532
  }).reduce(
434
- (r, s) => (r[s.name] = {
435
- type: t(s.type),
436
- required: s.required,
437
- default: s.default
438
- }, r),
533
+ (n, r) => (n[r.name] = {
534
+ type: t(r.type),
535
+ required: r.required,
536
+ default: r.default
537
+ }, n),
439
538
  {}
440
539
  );
441
540
  }
442
- function ct(n, e, t) {
443
- return n.reactive(
541
+ function pt(s, e, t) {
542
+ return s.reactive(
444
543
  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;
544
+ (n, r) => {
545
+ let o = e[r];
546
+ return S(o) ? o = t.__parseExpression(o) : M(o) && (o = t.__parseFunction(o)), n[r] = o, n;
448
547
  },
449
548
  {}
450
549
  )
451
550
  );
452
551
  }
453
- function lt(n, e, t) {
552
+ function ht(s, e, t) {
454
553
  return Object.entries(e ?? {}).reduce(
455
- (r, [s, o]) => (r[s] = n.computed(t.__parseFunction(o)), r),
554
+ (n, [r, o]) => (n[r] = s.computed(t.__parseFunction(o)), n),
456
555
  {}
457
556
  );
458
557
  }
459
- function ut(n, e) {
460
- return Object.entries(n ?? {}).reduce(
461
- (t, [r, s]) => (t[r] = e.__parseFunction(s), t),
558
+ function mt(s, e) {
559
+ return Object.entries(s ?? {}).reduce(
560
+ (t, [n, r]) => (t[n] = e.__parseFunction(r), t),
462
561
  {}
463
562
  );
464
563
  }
465
- function ft(n, e = [], t) {
564
+ function vt(s, e = [], t) {
466
565
  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;
566
+ (n, r) => {
567
+ const { name: o, from: a } = r || {};
568
+ r.default;
569
+ const i = S(a) ? t.__parseExpression(a) || o : a ?? o, u = S(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
570
+ return n[o] = s.inject(i, u), n;
472
571
  },
473
572
  {}
474
573
  );
475
574
  }
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;
575
+ function gt(s, e) {
576
+ return Object.keys(s).reduce(
577
+ (t, n) => {
578
+ const r = s[n], o = e.$apis[r.ref], a = M(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
579
+ return t[n] = async (...i) => {
580
+ const u = await o.apply(e, i);
581
+ return a ? a(u) : u;
483
582
  }, t;
484
583
  },
485
584
  {}
486
585
  );
487
586
  }
488
- function dt(n, e = [], t) {
489
- e.forEach((r) => {
490
- n.watch(
491
- t.__parseExpression(r.source),
492
- t.__parseFunction(r.handler),
587
+ function yt(s, e = [], t) {
588
+ e.forEach((n) => {
589
+ s.watch(
590
+ t.__parseExpression(n.source),
591
+ t.__parseFunction(n.handler),
493
592
  {
494
- deep: r.deep,
495
- immediate: r.immediate
593
+ deep: n.deep,
594
+ immediate: n.immediate
496
595
  }
497
596
  );
498
597
  });
499
598
  }
500
- function mt(n, e) {
501
- return Object.entries(n ?? {}).reduce(
502
- (t, [r, s]) => (t[r] = e.__parseFunction(s), t),
599
+ function _t(s, e) {
600
+ return Object.entries(s ?? {}).reduce(
601
+ (t, [n, r]) => (t[n] = e.__parseFunction(r), t),
503
602
  {}
504
603
  );
505
604
  }
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;
605
+ let T = [];
606
+ const wt = (s) => s;
607
+ async function he(s, e = window) {
608
+ const { urls: t = [], library: n } = s, r = t.filter((i) => V(i));
609
+ if (r.length === 0 || !n) return null;
511
610
  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)
611
+ return o.length && Ze(o, e), await et(r, n, e).catch(
612
+ (i) => (console.warn("loadScriptUrl error", r, n, i), null)
514
613
  );
515
614
  }
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 () => {
615
+ function N(s) {
616
+ const { getDsl: e, getDslByUrl: t, options: n } = s;
617
+ return n.window && (T.forEach((r) => {
618
+ delete n.window[r];
619
+ }), T = []), (r, o, a = A) => !o || typeof o == "string" ? r : o.type === "Schema" && o.id ? a.defineAsyncComponent(async () => {
521
620
  const i = await e(o.id);
522
- return i && (i.name = s), i ? B({
523
- ...r,
621
+ return i && (i.name = r), i ? U({
622
+ ...n,
524
623
  Vue: a,
525
624
  dsl: i,
526
- mode: S.Runtime,
527
- loader: U(n)
625
+ mode: w.Runtime,
626
+ loader: N(s)
528
627
  }).renderer : null;
529
628
  }) : o.type === "UrlSchema" && o.url ? a.defineAsyncComponent(async () => {
530
629
  const i = await t(o.url);
531
- return i && (i.name = s), i ? B({
532
- ...r,
630
+ return i && (i.name = r), i ? U({
631
+ ...n,
533
632
  Vue: a,
534
633
  dsl: i,
535
- mode: S.Runtime,
536
- loader: U(n)
634
+ mode: w.Runtime,
635
+ loader: N(s)
537
636
  }).renderer : null;
538
- }) : o.type === "Plugin" ? (o.library && k.push(o.library), a.defineAsyncComponent(async () => {
539
- const i = await le(o, r.window);
637
+ }) : o.type === "Plugin" ? (o.library && T.push(o.library), a.defineAsyncComponent(async () => {
638
+ const i = await he(o, n.window);
540
639
  return i || (console.warn("getPlugin result is null", o), null);
541
- })) : s;
640
+ })) : r;
542
641
  }
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))
642
+ function O(s, e, t = A, n = wt) {
643
+ if (!s || !s.name || s.invisible) return null;
644
+ const { id: r = null, directives: o = [] } = s, { vIf: a, vFor: i, vShow: u, vModels: c, vBind: p } = St(o);
645
+ if (a && !$t(a, e))
547
646
  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));
647
+ const f = (l) => {
648
+ const m = l.$components, d = (() => {
649
+ if (s.name === "component")
650
+ return jt(l, s.props?.is);
651
+ if (s.name === "slot") return s.name;
652
+ const g = n(s.name, s.from, t);
653
+ return $(g) ? m[g] ?? g : g;
654
+ })(), h = Et(r, s.props ?? {}, l), _ = Pt(t, s.events ?? {}, l);
655
+ if (s.name === "slot")
656
+ return bt(t, s, h, l, n);
657
+ p && Object.assign(h, l.__parseExpression(p.value)), u && (h.style = Object.assign(
658
+ h.style ?? {},
659
+ Rt(u, l)
660
+ )), c.forEach((g) => {
661
+ Object.assign(h, Ft(t, g, l));
563
662
  });
564
- const v = bt(
663
+ const v = xt(
565
664
  t,
566
- n.children ?? [],
567
- u,
568
- r,
569
- n
665
+ s.children ?? [],
666
+ l,
667
+ n,
668
+ s
570
669
  );
571
- return t.createVNode(p, { ...m, ..._ }, v);
670
+ return t.createVNode(d, { ...h, ..._ }, v);
572
671
  };
573
- return i ? Rt(i, f, e) : f(e);
672
+ return i ? Ot(i, f, e) : f(e);
574
673
  }
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))
674
+ function St(s = []) {
675
+ 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(
676
+ (i) => !ze.includes(j(i.name))
578
677
  );
579
678
  return {
580
679
  vIf: e,
581
680
  vFor: t,
582
- vShow: r,
681
+ vShow: n,
583
682
  vModels: o,
584
- vBind: s,
683
+ vBind: r,
585
684
  others: a
586
685
  };
587
686
  }
588
- function yt(n, e) {
589
- return !!e.__parseExpression(n.value);
687
+ function $t(s, e) {
688
+ return !!e.__parseExpression(s.value);
590
689
  }
591
- function gt(n, e) {
592
- return e ? w(e) ? n.__parseExpression(e) : e : "div";
690
+ function jt(s, e) {
691
+ return e ? S(e) ? s.__parseExpression(e) : e : "div";
593
692
  }
594
- function _t(n, e, t) {
595
- const r = Object.keys(e || {}).reduce(
596
- (s, o) => {
693
+ function Et(s, e, t) {
694
+ const n = Object.keys(e || {}).reduce(
695
+ (r, o) => {
597
696
  let a = e[o];
598
- return w(a) ? a = t.__parseExpression(a) : T(a) && (a = t.__parseFunction(a)), s[o] = a, s;
697
+ return S(a) ? a = t.__parseExpression(a) : M(a) && (a = t.__parseFunction(a)), r[o] = a, r;
599
698
  },
600
699
  {}
601
700
  );
602
- return r.ref = t.__ref(n, r.ref), r;
701
+ return n.ref = t.__ref(s, n.ref), n;
603
702
  }
604
- function wt(n, e, t) {
605
- const r = ["passive", "capture", "once"], s = {
703
+ function Pt(s, e, t) {
704
+ const n = ["passive", "capture", "once"], r = {
606
705
  capture: "Capture",
607
706
  once: "Once",
608
707
  passive: "OnceCapture"
609
708
  };
610
709
  return Object.keys(e || {}).reduce(
611
710
  (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;
711
+ 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);
712
+ return f && (o[p] = s.withModifiers(f, u)), o;
614
713
  },
615
714
  {}
616
715
  );
617
716
  }
618
- function ue(n = {}, e = !1) {
619
- const t = Object.keys(n);
620
- return e ? t.map((r) => "." + r) : t;
717
+ function me(s = {}, e = !1) {
718
+ const t = Object.keys(s);
719
+ return e ? t.map((n) => "." + n) : t;
621
720
  }
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))
721
+ function bt(s, e, t, n, r) {
722
+ const { children: o } = e, a = Ct(e, n), i = n.$slots?.[a.name];
723
+ return i ? i(t) : o ? $(o) ? s.createTextVNode(o) : S(o) ? s.createTextVNode(
724
+ le(n.__parseExpression(o))
626
725
  ) : Array.isArray(o) ? o.map(
627
- (l) => O(l, r, n, s)
726
+ (u) => O(u, n, s, r)
628
727
  ) : null : null;
629
728
  }
630
- function $t(n, e) {
631
- const { props: t } = n, r = t?.name || "default";
729
+ function Ct(s, e) {
730
+ const { props: t } = s, n = t?.name || "default";
632
731
  return {
633
- name: w(r) ? e.__parseExpression(r) : r,
732
+ name: S(n) ? e.__parseExpression(n) : n,
634
733
  params: []
635
734
  };
636
735
  }
637
- function jt(n, e) {
638
- return e.__parseExpression(n.value) ? {} : {
736
+ function Rt(s, e) {
737
+ return e.__parseExpression(s.value) ? {} : {
639
738
  display: "none"
640
739
  };
641
740
  }
642
- function Et(n, e, t) {
643
- const r = {
741
+ function Ft(s, e, t) {
742
+ const n = {
644
743
  type: "JSFunction",
645
744
  value: e.value?.value ? `(v) => {
646
745
  ${e.value.value} = v;
647
746
  }` : "(v) => {}"
648
- }, s = t.__parseFunction(r), o = ue(e.modifiers), a = w(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
747
+ }, r = t.__parseFunction(n), o = me(e.modifiers), a = S(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
649
748
  return {
650
749
  [a]: t.__parseExpression(e.value),
651
- [`onUpdate:${a}`]: o.length && s ? n.withModifiers(s, o) : s
750
+ [`onUpdate:${a}`]: o.length && r ? s.withModifiers(r, o) : r
652
751
  };
653
752
  }
654
- function bt(n, e, t, r, s) {
753
+ function xt(s, e, t, n, r) {
655
754
  if (!e) return null;
656
755
  if ($(e))
657
756
  return { default: () => e };
658
- if (w(e))
757
+ if (S(e))
659
758
  return {
660
- default: () => ie(t.__parseExpression(e))
759
+ default: () => le(t.__parseExpression(e))
661
760
  };
662
761
  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
762
+ const o = It(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
763
+ [`scope_${r.id}`]: i
665
764
  } : {};
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);
765
+ return Object.entries(o).reduce((i, [u, { nodes: c, params: p }]) => (i[u] = (f) => {
766
+ const l = p.length ? Ie(f ?? {}, p) : a(f);
668
767
  return c.map(
669
- (h) => O(h, t.__clone(u), n, r)
768
+ (m) => O(m, t.__clone(l), s, n)
670
769
  );
671
770
  }, i), {});
672
771
  }
673
772
  return null;
674
773
  }
675
- function Pt(n) {
774
+ function It(s) {
676
775
  const e = {
677
776
  default: {
678
777
  params: [],
679
778
  nodes: []
680
779
  }
681
780
  };
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] = {
781
+ for (const t of s) {
782
+ const n = Ht(t.slot), r = n.name;
783
+ e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(n.params)) : e[r] = {
685
784
  nodes: [t],
686
- params: r.params
785
+ params: n.params
687
786
  };
688
787
  }
689
788
  return e;
690
789
  }
691
- function Ct(n = "default") {
692
- return $(n) ? { name: n, params: [] } : { params: [], ...n };
790
+ function Ht(s = "default") {
791
+ return $(s) ? { name: s, params: [] } : { params: [], ...s };
693
792
  }
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`), []);
793
+ function Ot(s, e, t) {
794
+ const { value: n, iterator: r } = s, { item: o = "item", index: a = "index" } = r || {};
795
+ let i = t.__parseExpression(n) || [];
796
+ 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
797
  }
699
- function Ft(n) {
700
- return Me() ? (De(n), !0) : !1;
798
+ function At(s) {
799
+ return Be() ? (Ue(s), !0) : !1;
701
800
  }
702
- function V(n) {
703
- return typeof n == "function" ? n() : Te(n);
801
+ function z(s) {
802
+ return typeof s == "function" ? s() : Ne(s);
704
803
  }
705
- const fe = typeof window < "u" && typeof document < "u";
804
+ const ve = typeof window < "u" && typeof document < "u";
706
805
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
707
- const It = (n) => n != null, xt = () => {
806
+ const Dt = (s) => s != null, Mt = () => {
708
807
  };
709
- function Ht(n) {
710
- return te();
808
+ function kt(s) {
809
+ return oe();
711
810
  }
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);
811
+ function Tt(...s) {
812
+ if (s.length !== 1)
813
+ return De(...s);
814
+ const e = s[0];
815
+ return typeof e == "function" ? Me(ke(() => ({ get: e, set: Mt }))) : q(e);
717
816
  }
718
- function Mt(n, e) {
719
- Ht() && Oe(n, e);
817
+ function Bt(s, e) {
818
+ kt() && Te(s, e);
720
819
  }
721
- const Dt = fe ? window : void 0, Tt = fe ? window.document : void 0;
722
- function kt(n) {
820
+ const Ut = ve ? window : void 0, Nt = ve ? window.document : void 0;
821
+ function Lt(s) {
723
822
  var e;
724
- const t = V(n);
823
+ const t = z(s);
725
824
  return (e = t?.$el) != null ? e : t;
726
825
  }
727
- function At() {
728
- const n = q(!1), e = te();
729
- return e && ke(() => {
730
- n.value = !0;
731
- }, e), n;
826
+ function qt() {
827
+ const s = q(!1), e = oe();
828
+ return e && Le(() => {
829
+ s.value = !0;
830
+ }, e), s;
732
831
  }
733
- function Bt(n) {
734
- const e = At();
735
- return re(() => (e.value, !!n()));
832
+ function Jt(s) {
833
+ const e = qt();
834
+ return ae(() => (e.value, !!s()));
736
835
  }
737
- function Ut(n, e, t = {}) {
738
- const { window: r = Dt, ...s } = t;
836
+ function Vt(s, e, t = {}) {
837
+ const { window: n = Ut, ...r } = t;
739
838
  let o;
740
- const a = Bt(() => r && "MutationObserver" in r), i = () => {
839
+ const a = Jt(() => n && "MutationObserver" in n), i = () => {
741
840
  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)));
841
+ }, u = ae(() => {
842
+ const l = z(s), m = (Array.isArray(l) ? l : [l]).map(Lt).filter(Dt);
843
+ return new Set(m);
844
+ }), c = ie(
845
+ () => u.value,
846
+ (l) => {
847
+ i(), a.value && l.size && (o = new MutationObserver(e), l.forEach((m) => o.observe(m, r)));
749
848
  },
750
849
  { immediate: !0, flush: "post" }
751
- ), d = () => o?.takeRecords(), f = () => {
850
+ ), p = () => o?.takeRecords(), f = () => {
752
851
  c(), i();
753
852
  };
754
- return Ft(f), {
853
+ return At(f), {
755
854
  isSupported: a,
756
855
  stop: f,
757
- takeRecords: d
856
+ takeRecords: p
758
857
  };
759
858
  }
760
- function Nt(n = null, e = {}) {
761
- var t, r, s;
859
+ function zt(s = null, e = {}) {
860
+ var t, n, r;
762
861
  const {
763
- document: o = Tt,
862
+ document: o = Nt,
764
863
  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) {
864
+ } = e, i = (t = o?.title) != null ? t : "", u = Tt((n = s ?? o?.title) != null ? n : null), c = s && typeof s == "function";
865
+ function p(f) {
767
866
  if (!("titleTemplate" in e))
768
867
  return f;
769
- const u = e.titleTemplate || "%s";
770
- return typeof u == "function" ? u(f) : V(u).replace(/%s/g, f);
868
+ const l = e.titleTemplate || "%s";
869
+ return typeof l == "function" ? l(f) : z(l).replace(/%s/g, f);
771
870
  }
772
- return ne(
773
- l,
774
- (f, u) => {
775
- f !== u && o && (o.title = d(typeof f == "string" ? f : ""));
871
+ return ie(
872
+ u,
873
+ (f, l) => {
874
+ f !== l && o && (o.title = p(typeof f == "string" ? f : ""));
776
875
  },
777
876
  { immediate: !0 }
778
- ), e.observe && !e.titleTemplate && o && !c && Ut(
779
- (s = o.head) == null ? void 0 : s.querySelector("title"),
877
+ ), e.observe && !e.titleTemplate && o && !c && Vt(
878
+ (r = o.head) == null ? void 0 : r.querySelector("title"),
780
879
  () => {
781
- o && o.title !== l.value && (l.value = d(o.title));
880
+ o && o.title !== u.value && (u.value = p(o.title));
782
881
  },
783
882
  { childList: !0 }
784
- ), Mt(() => {
883
+ ), Bt(() => {
785
884
  if (a) {
786
- const f = a(i, l.value || "");
885
+ const f = a(i, u.value || "");
787
886
  f != null && o && (o.title = f);
788
887
  }
789
- }), l;
888
+ }), u;
790
889
  }
791
- const Z = se({
890
+ const ne = ce({
792
891
  name: "VtjPageContainer",
793
892
  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,
893
+ const s = ye(), e = ue(), t = e.params.id, n = t ? s.getPage(t) : s.getHomepage(), r = n ? await s.getRenderComponent(n.id) : null;
894
+ return n && zt(n.title || "VTJ"), {
895
+ provider: s,
896
+ component: r,
897
+ file: n,
799
898
  query: e.query
800
899
  };
801
900
  },
802
901
  render() {
803
- return this.component ? A(this.component, this.query) : A("div", "页面不存在");
902
+ return this.component ? B(this.component, this.query) : B("div", "页面不存在");
804
903
  }
805
- }), qt = se({
904
+ }), Wt = ce({
806
905
  name: "VtjStartupContainer",
807
906
  render() {
808
- return A(Ne);
907
+ return B(Ve);
809
908
  }
810
- }), pe = Symbol("Provider");
811
- var Jt = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(Jt || {});
812
- class Lt extends he {
909
+ }), ge = Symbol("Provider");
910
+ var Kt = /* @__PURE__ */ ((s) => (s.Production = "production", s.Development = "development", s))(Kt || {});
911
+ class Gt extends we {
813
912
  constructor(e) {
814
913
  super(), this.options = e;
815
914
  const {
816
915
  service: t,
817
- mode: r = S.Raw,
818
- dependencies: s,
916
+ mode: n = w.Raw,
917
+ dependencies: r,
819
918
  materials: o,
820
919
  project: a = {},
821
920
  adapter: i = {},
822
- globals: l = {},
921
+ globals: u = {},
823
922
  modules: c = {},
824
- router: d = null,
923
+ router: p = null,
825
924
  materialPath: f = "./",
826
- nodeEnv: u = "development"
925
+ nodeEnv: l = "development"
827
926
  /* Development */
828
927
  } = 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);
928
+ 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);
929
+ const { access: m, request: d } = this.adapter;
930
+ m && m.connect({ mode: n, router: p, request: d }), n !== w.Design && this.load(a);
830
931
  }
831
932
  mode;
832
933
  globals = {};
833
934
  modules = {};
834
- adapter = { request: Ze, jsonp: Ce };
935
+ adapter = { request: st, jsonp: He };
835
936
  apis = {};
836
937
  dependencies = {};
837
938
  materials = {};
@@ -847,53 +948,53 @@ class Lt extends he {
847
948
  const t = this.modules[`.vtj/projects/${e.id}.json`];
848
949
  if (this.project = t ? await t() : await this.service.init(e), !this.project)
849
950
  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();
951
+ const { apis: n = [], meta: r = [] } = this.project, o = window;
952
+ 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
953
  }
853
954
  async loadDependencies(e) {
854
955
  const t = Object.entries(this.dependencies);
855
- for (const [r, s] of t)
856
- e[r] || (e[r] = await s());
956
+ for (const [n, r] of t)
957
+ e[n] || (e[n] = await r());
857
958
  }
858
959
  async loadAssets(e) {
859
- const { dependencies: t = [] } = this.project, { dependencies: r, library: s, components: o, materialPath: a, nodeEnv: i } = this, {
860
- libraryExports: l,
960
+ const { dependencies: t = [] } = this.project, { dependencies: n, library: r, components: o, materialPath: a, nodeEnv: i } = this, {
961
+ libraryExports: u,
861
962
  libraryMap: c,
862
- materials: d,
963
+ materials: p,
863
964
  materialExports: f,
864
- materialMapLibrary: u
865
- } = We(
965
+ materialMapLibrary: l
966
+ } = Ye(
866
967
  t,
867
968
  a,
868
969
  i === "development"
869
970
  /* Development */
870
971
  );
871
- for (const p of l) {
872
- const m = r[p], _ = e[p];
972
+ for (const d of u) {
973
+ const h = n[d], _ = e[d];
873
974
  if (_)
874
- s[p] = _;
875
- else if (m)
876
- e[p] = s[p] = await m();
975
+ r[d] = _;
976
+ else if (h)
977
+ e[d] = r[d] = await h();
877
978
  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];
979
+ const v = c[d] || [];
980
+ for (const g of v)
981
+ J(g) && await Xe(d, b.append(g, { v: C })), V(g) && await X(b.append(g, { v: C }));
982
+ r[d] = e[d];
882
983
  }
883
984
  }
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];
985
+ for (const d of p)
986
+ await X(b.append(d, { v: C }));
987
+ const m = this.materials || {};
988
+ for (const d of f) {
989
+ const h = e[l[d]], _ = Se[d];
889
990
  if (_)
890
- m && _.forEach((v) => {
891
- o[v] = m[v];
991
+ h && _.forEach((v) => {
992
+ o[v] = h[v];
892
993
  });
893
994
  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);
995
+ const v = m[d] ? (await m[d]()).default : e[d];
996
+ v && h && (v.components || []).forEach((g) => {
997
+ o[g.name] = Qe(g, h);
897
998
  });
898
999
  }
899
1000
  }
@@ -903,50 +1004,50 @@ class Lt extends he {
903
1004
  e && (e.addRoute({
904
1005
  path: "/page/:id",
905
1006
  name: "VtjPage",
906
- component: Z
1007
+ component: ne
907
1008
  }), e.addRoute({
908
1009
  path: "/",
909
1010
  name: "VtjHomepage",
910
- component: t?.homepage ? Z : qt
1011
+ component: t?.homepage ? ne : Wt
911
1012
  }));
912
1013
  }
913
1014
  install(e) {
914
1015
  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}`;
1016
+ for (const [n, r] of Object.entries(this.library))
1017
+ !t[n] && tt(r) && (e.use(r), t[n] = !0);
1018
+ 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) => {
1019
+ const a = r?.$options.name, i = typeof n == "string" ? n : n?.message || n?.msg || "未知错误", u = `[ ${a} ] ${i} ${o}`;
919
1020
  console.error(
920
1021
  "[VTJ Error]:",
921
1022
  {
922
- err: r,
923
- instance: s,
1023
+ err: n,
1024
+ instance: r,
924
1025
  info: o
925
1026
  },
926
- r?.stack
1027
+ n?.stack
927
1028
  ), D.error({
928
1029
  title: "运行时错误:请在控制台查看详情",
929
- message: l
1030
+ message: u
930
1031
  });
931
1032
  });
932
1033
  }
933
1034
  getFile(e) {
934
1035
  const { blocks: t = [] } = this.project || {};
935
- return this.getPage(e) || t.find((r) => r.id === e) || null;
1036
+ return this.getPage(e) || t.find((n) => n.id === e) || null;
936
1037
  }
937
1038
  getPage(e) {
938
- const { pages: t = [] } = this.project || {}, r = (s, o = []) => {
1039
+ const { pages: t = [] } = this.project || {}, n = (r, o = []) => {
939
1040
  for (const a of o) {
940
- if (a.id === s)
1041
+ if (a.id === r)
941
1042
  return a;
942
1043
  if (a.children && a.children.length) {
943
- const i = r(s, a.children);
1044
+ const i = n(r, a.children);
944
1045
  if (i)
945
1046
  return i;
946
1047
  }
947
1048
  }
948
1049
  };
949
- return r(e, t) || null;
1050
+ return n(e, t) || null;
950
1051
  }
951
1052
  getHomepage() {
952
1053
  const { homepage: e } = this.project || {};
@@ -965,94 +1066,94 @@ class Lt extends he {
965
1066
  validSuccess: !1,
966
1067
  originResponse: !0
967
1068
  }
968
- }).then((r) => r.data).catch(() => null));
1069
+ }).then((n) => n.data).catch(() => null));
969
1070
  }
970
1071
  createDslRenderer(e, t = {}) {
971
- const { library: r, components: s, mode: o, apis: a } = this, i = {
1072
+ const { library: n, components: r, mode: o, apis: a } = this, i = {
972
1073
  mode: o,
973
- Vue: r.Vue,
974
- components: s,
975
- libs: r,
1074
+ Vue: n.Vue,
1075
+ components: r,
1076
+ libs: n,
976
1077
  apis: a,
977
1078
  window,
978
1079
  ...t
979
- }, l = U({
1080
+ }, u = N({
980
1081
  getDsl: async (c) => await this.getDsl(c) || null,
981
1082
  getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
982
1083
  options: i
983
1084
  });
984
- return B({
1085
+ return U({
985
1086
  ...i,
986
1087
  dsl: e,
987
- loader: l
1088
+ loader: u
988
1089
  });
989
1090
  }
990
1091
  async getRenderComponent(e) {
991
1092
  const t = this.getFile(e);
992
1093
  if (!t)
993
1094
  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;
1095
+ const n = `.vtj/vue/${e}.vue`, r = this.modules[n];
1096
+ if (r)
1097
+ return (await r())?.default;
997
1098
  const o = await this.getDsl(t.id);
998
1099
  return o ? this.createDslRenderer(o).renderer : (H.warn(`Can not find dsl: ${e}`), null);
999
1100
  }
1000
1101
  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;
1102
+ return Z(async () => {
1103
+ const n = await this.getDslByUrl(e);
1104
+ return n ? (n.name = t || n.name, this.createDslRenderer(n).renderer) : null;
1004
1105
  });
1005
1106
  }
1006
1107
  definePluginComponent(e) {
1007
- return X(async () => await le(e, window));
1108
+ return Z(async () => await he(e, window));
1008
1109
  }
1009
1110
  }
1010
- function sn(n) {
1011
- const e = new Lt(n);
1111
+ function dn(s) {
1112
+ const e = new Gt(s);
1012
1113
  return {
1013
1114
  provider: e,
1014
- onReady: (r) => e.ready(r)
1115
+ onReady: (n) => e.ready(n)
1015
1116
  };
1016
1117
  }
1017
- function de(n = {}) {
1018
- const e = Ae(pe);
1118
+ function ye(s = {}) {
1119
+ const e = re(ge);
1019
1120
  if (!e)
1020
1121
  throw new Error("Can not find provider");
1021
1122
  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,
1123
+ const { id: t, version: n } = s;
1124
+ t && n && (async () => {
1125
+ const r = await e.getDsl(t);
1126
+ r?.__VERSION__ !== n && D.warning({
1127
+ title: r?.name,
1027
1128
  message: "当前组件源码版本与运行时版本不一致,请重新发布组件"
1028
1129
  });
1029
1130
  })();
1030
1131
  }
1031
1132
  return e;
1032
1133
  }
1033
- const W = new Re({
1134
+ const W = new Oe({
1034
1135
  settings: {
1035
1136
  type: "json",
1036
1137
  validSuccess: !0,
1037
1138
  originResponse: !1,
1038
1139
  failMessage: !0,
1039
- validate: (n) => n.data?.code === 0,
1040
- showError: (n) => {
1140
+ validate: (s) => s.data?.code === 0,
1141
+ showError: (s) => {
1041
1142
  D.error({
1042
- message: n || "未知错误"
1143
+ message: s || "未知错误"
1043
1144
  });
1044
1145
  }
1045
1146
  }
1046
- }), Vt = (n = "/__vtj__/api/:type.json") => (e, t) => W.send({
1047
- url: n,
1147
+ }), Yt = (s = "/__vtj__/api/:type.json") => (e, t) => W.send({
1148
+ url: s,
1048
1149
  method: "post",
1049
1150
  params: { type: e },
1050
1151
  data: {
1051
1152
  type: e,
1052
1153
  data: t
1053
1154
  }
1054
- }), Wt = (n = "/__vtj__/api/uploader.json") => async (e, t) => await W.send({
1055
- url: n,
1155
+ }), Qt = (s = "/__vtj__/api/uploader.json") => async (e, t) => await W.send({
1156
+ url: s,
1056
1157
  method: "post",
1057
1158
  data: {
1058
1159
  files: e,
@@ -1061,13 +1162,13 @@ const W = new Re({
1061
1162
  settings: {
1062
1163
  type: "data"
1063
1164
  }
1064
- }).then((r) => r && r[0] ? r[0] : null).catch(() => null);
1065
- class G {
1165
+ }).then((n) => n && n[0] ? n[0] : null).catch(() => null);
1166
+ class K {
1066
1167
  api;
1067
1168
  pluginCaches = {};
1068
1169
  uploader;
1069
1170
  constructor() {
1070
- this.api = Vt(), this.uploader = Wt();
1171
+ this.api = Yt(), this.uploader = Qt();
1071
1172
  }
1072
1173
  async getExtension() {
1073
1174
  console.log("BaseService.getExtension");
@@ -1140,11 +1241,11 @@ class G {
1140
1241
  return await this.api("clearStaticFiles", e).catch(() => "");
1141
1242
  }
1142
1243
  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,
1244
+ const { urls: t = [] } = e, n = t.filter((o) => Ke(o))[0];
1245
+ if (!n) return null;
1246
+ const r = this.pluginCaches[n];
1247
+ return r || (this.pluginCaches[n] = W.send({
1248
+ url: n,
1148
1249
  method: "get",
1149
1250
  settings: {
1150
1251
  validSuccess: !1,
@@ -1153,77 +1254,77 @@ class G {
1153
1254
  }).then((o) => o.data).catch(() => null));
1154
1255
  }
1155
1256
  }
1156
- const g = new Fe({
1257
+ const y = new Ae({
1157
1258
  type: "local",
1158
1259
  expired: 0,
1159
1260
  prefix: "__VTJ_"
1160
1261
  });
1161
- class on extends G {
1262
+ class pn extends K {
1162
1263
  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);
1264
+ const t = new I(e), n = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), n || {});
1265
+ return y.save(`project_${t.id}`, r), Promise.resolve(r);
1165
1266
  }
1166
1267
  saveProject(e) {
1167
- const t = new x(e);
1168
- return g.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1268
+ const t = new I(e);
1269
+ return y.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
1169
1270
  }
1170
1271
  saveMaterials(e, t) {
1171
- return g.save(`materials_${e.id}`, N(t)), Promise.resolve(!0);
1272
+ return y.save(`materials_${e.id}`, L(t)), Promise.resolve(!0);
1172
1273
  }
1173
1274
  saveFile(e) {
1174
- return g.save(`file_${e.id}`, e), Promise.resolve(!0);
1275
+ return y.save(`file_${e.id}`, e), Promise.resolve(!0);
1175
1276
  }
1176
1277
  getFile(e) {
1177
- const t = g.get(`file_${e}`);
1278
+ const t = y.get(`file_${e}`);
1178
1279
  return t ? Promise.resolve(t) : Promise.reject(null);
1179
1280
  }
1180
1281
  removeFile(e) {
1181
- return g.remove(`file_${e}`), Promise.resolve(!0);
1282
+ return y.remove(`file_${e}`), Promise.resolve(!0);
1182
1283
  }
1183
1284
  saveHistory(e) {
1184
- return g.save(`history_${e.id}`, e), Promise.resolve(!0);
1285
+ return y.save(`history_${e.id}`, e), Promise.resolve(!0);
1185
1286
  }
1186
1287
  removeHistory(e) {
1187
- const t = g.get(`history_${e}`);
1288
+ const t = y.get(`history_${e}`);
1188
1289
  if (t) {
1189
- const s = (t.items || []).map((o) => o.id);
1190
- this.removeHistoryItem(e, s), g.remove(`history_${e}`);
1290
+ const r = (t.items || []).map((o) => o.id);
1291
+ this.removeHistoryItem(e, r), y.remove(`history_${e}`);
1191
1292
  }
1192
1293
  return Promise.resolve(!0);
1193
1294
  }
1194
1295
  getHistory(e) {
1195
- const t = g.get(`history_${e}`), r = new ee(t || { id: e });
1196
- return Promise.resolve(r.toDsl());
1296
+ const t = y.get(`history_${e}`), n = new se(t || { id: e });
1297
+ return Promise.resolve(n.toDsl());
1197
1298
  }
1198
1299
  getHistoryItem(e, t) {
1199
- const r = g.get(`history_${e}_${t}`);
1200
- return Promise.resolve(r);
1300
+ const n = y.get(`history_${e}_${t}`);
1301
+ return Promise.resolve(n);
1201
1302
  }
1202
1303
  saveHistoryItem(e, t) {
1203
- return g.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1304
+ return y.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
1204
1305
  }
1205
1306
  removeHistoryItem(e, t) {
1206
- return t.forEach((r) => {
1207
- g.remove(`history_${e}_${r}`);
1307
+ return t.forEach((n) => {
1308
+ y.remove(`history_${e}_${n}`);
1208
1309
  }), Promise.resolve(!0);
1209
1310
  }
1210
1311
  }
1211
- class Gt extends G {
1312
+ class Xt extends K {
1212
1313
  projects = {};
1213
1314
  materials = {};
1214
1315
  files = {};
1215
1316
  histories = {};
1216
1317
  historyItems = {};
1217
1318
  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);
1319
+ const t = new I(e), n = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), n);
1320
+ return this.projects[r.id] = r, Promise.resolve(r);
1220
1321
  }
1221
1322
  saveProject(e) {
1222
- const t = new x(e);
1323
+ const t = new I(e);
1223
1324
  return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
1224
1325
  }
1225
1326
  saveMaterials(e, t) {
1226
- return e.id && (this.materials[e.id] = N(t)), Promise.resolve(!0);
1327
+ return e.id && (this.materials[e.id] = L(t)), Promise.resolve(!0);
1227
1328
  }
1228
1329
  saveFile(e) {
1229
1330
  return this.files[e.id] = e, Promise.resolve(!0);
@@ -1241,35 +1342,35 @@ class Gt extends G {
1241
1342
  removeHistory(e) {
1242
1343
  const t = this.histories[e];
1243
1344
  if (t) {
1244
- const s = (t.items || []).map((o) => o.id);
1245
- this.removeHistoryItem(e, s), delete this.historyItems[e];
1345
+ const r = (t.items || []).map((o) => o.id);
1346
+ this.removeHistoryItem(e, r), delete this.historyItems[e];
1246
1347
  }
1247
1348
  return Promise.resolve(!0);
1248
1349
  }
1249
1350
  getHistory(e) {
1250
- const t = this.histories[e], r = new ee(t || { id: e });
1251
- return Promise.resolve(r);
1351
+ const t = this.histories[e], n = new se(t || { id: e });
1352
+ return Promise.resolve(n);
1252
1353
  }
1253
1354
  getHistoryItem(e, t) {
1254
- const r = `${e}_${t}`, s = this.historyItems[r] || {};
1255
- return Promise.resolve(s);
1355
+ const n = `${e}_${t}`, r = this.historyItems[n] || {};
1356
+ return Promise.resolve(r);
1256
1357
  }
1257
1358
  saveHistoryItem(e, t) {
1258
- const r = `${e}_${t.id}`;
1259
- return this.historyItems[r] = t, Promise.resolve(!0);
1359
+ const n = `${e}_${t.id}`;
1360
+ return this.historyItems[n] = t, Promise.resolve(!0);
1260
1361
  }
1261
1362
  removeHistoryItem(e, t) {
1262
- return t.forEach((r) => {
1263
- const s = `${e}_${r}`;
1264
- delete this.historyItems[s];
1363
+ return t.forEach((n) => {
1364
+ const r = `${e}_${n}`;
1365
+ delete this.historyItems[r];
1265
1366
  }), Promise.resolve(!0);
1266
1367
  }
1267
1368
  }
1268
- let I = null;
1269
- function an() {
1270
- return I || (I = new Gt(), I);
1369
+ let x = null;
1370
+ function hn() {
1371
+ return x || (x = new Xt(), x);
1271
1372
  }
1272
- class cn extends G {
1373
+ class mn extends K {
1273
1374
  getFileCaches = {};
1274
1375
  async getExtension() {
1275
1376
  return await this.api("getExtension", {}).catch(() => {
@@ -1284,7 +1385,7 @@ class cn extends G {
1284
1385
  async saveMaterials(e, t) {
1285
1386
  return !!await this.api("saveMaterials", {
1286
1387
  project: e,
1287
- materials: N(t)
1388
+ materials: L(t)
1288
1389
  }).catch(() => !1);
1289
1390
  }
1290
1391
  async saveFile(e) {
@@ -1324,92 +1425,95 @@ class cn extends G {
1324
1425
  );
1325
1426
  }
1326
1427
  }
1327
- function me(n = []) {
1328
- return n.map((e) => {
1329
- const { id: t, title: r, icon: s, children: o, hidden: a } = e;
1428
+ function _e(s = []) {
1429
+ return s.map((e) => {
1430
+ const { id: t, title: n, icon: r, children: o, hidden: a } = e;
1330
1431
  return {
1331
1432
  id: t,
1332
- title: r,
1333
- icon: s,
1433
+ title: n,
1434
+ icon: r,
1334
1435
  hidden: a,
1335
1436
  url: `/page/${t}`,
1336
- children: o && o.length ? me(o) : void 0
1437
+ children: o && o.length ? _e(o) : void 0
1337
1438
  };
1338
1439
  });
1339
1440
  }
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;
1441
+ function vn() {
1442
+ const s = ye(), e = ue(), t = q(!1), n = s.project;
1443
+ qe(() => {
1444
+ const { name: a, params: i, meta: u } = e;
1344
1445
  if (a === "VtjPage") {
1345
- const c = n.getPage(i.id);
1446
+ const c = s.getPage(i.id);
1346
1447
  t.value = !c?.mask;
1347
1448
  } else if (a === "VtjHomepage") {
1348
- const c = n.getHomepage();
1449
+ const c = s.getHomepage();
1349
1450
  t.value = !c?.mask;
1350
1451
  } else
1351
- t.value = !l.mask;
1452
+ t.value = !u.mask;
1352
1453
  });
1353
- const s = me(r?.pages), o = r?.config;
1454
+ const r = _e(n?.pages), o = n?.config;
1354
1455
  return {
1355
1456
  disabled: t,
1356
1457
  logo: o?.logo,
1357
1458
  themeSwitchable: o?.themeSwitchable,
1358
- title: o?.title || r?.description || r?.name || "VTJ App",
1359
- menus: s
1459
+ title: o?.title || n?.description || n?.name || "VTJ App",
1460
+ menus: r
1360
1461
  };
1361
1462
  }
1362
1463
  export {
1363
- qe as BUILT_IN_DIRECTIVES,
1364
- 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,
1464
+ pe as ACCESS_KEY,
1465
+ ln as Access,
1466
+ ze as BUILT_IN_DIRECTIVES,
1467
+ K as BaseService,
1468
+ ee as CONTEXT_HOST,
1469
+ lt as Context,
1470
+ w as ContextMode,
1471
+ We as DATA_TYPES,
1472
+ un as JSCodeToString,
1473
+ on as LIFE_CYCLES_LIST,
1474
+ mn as LocalService,
1475
+ Xt as MemoryService,
1476
+ Kt as NodeEnv,
1477
+ Gt as Provider,
1478
+ pn as StorageService,
1376
1479
  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,
1480
+ fe as adoptedStyleSheets,
1481
+ an as createAssetScripts,
1482
+ cn as createAssetsCss,
1483
+ gt as createDataSources,
1484
+ N as createLoader,
1485
+ hn as createMemoryService,
1486
+ ot as createMetaApi,
1487
+ dn as createProvider,
1488
+ U as createRenderer,
1489
+ rt as createSchemaApi,
1490
+ it as createSchemaApis,
1491
+ wt as defaultLoader,
1389
1492
  F as fillBasePath,
1390
- ue as getModifiers,
1391
- le as getPlugin,
1392
- Ge as getRawComponent,
1493
+ me as getModifiers,
1494
+ he as getPlugin,
1495
+ Qe as getRawComponent,
1393
1496
  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,
1497
+ nt as isJSCode,
1498
+ S as isJSExpression,
1499
+ M as isJSFunction,
1500
+ Ke as isJSON,
1501
+ V as isJSUrl,
1502
+ tt as isVuePlugin,
1503
+ Xe as loadCss,
1504
+ Ze as loadCssUrl,
1505
+ et as loadScriptUrl,
1506
+ ct as mockApi,
1507
+ at as mockApis,
1508
+ de as mockCleanup,
1406
1509
  O as nodeRender,
1407
- We as parseDeps,
1510
+ Ye as parseDeps,
1408
1511
  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
1512
+ te as parseFunction,
1513
+ ge as providerKey,
1514
+ Ge as removeProdFlag,
1515
+ le as toString,
1516
+ fn as useAccess,
1517
+ vn as useMask,
1518
+ ye as useProvider
1415
1519
  };