labull-framework 0.1.28 → 0.1.30

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.
@@ -1,8 +1,9 @@
1
- import { defineComponent as Pe, ref as x, computed as j, watch as Pt, nextTick as Qe, onMounted as rn, onBeforeUnmount as dn, openBlock as d, createElementBlock as p, normalizeStyle as pn, normalizeClass as K, unref as it, createElementVNode as l, toDisplayString as b, createCommentVNode as k, Fragment as M, renderList as N, withModifiers as Ee, createBlock as cs, createTextVNode as $, withDirectives as vt, vModelCheckbox as rs, vModelText as Xt, withKeys as ds, vShow as Qt } from "vue";
2
- import { useRouter as bn, useRoute as ps } from "vue-router";
3
- import { A as bs, b as at, c as ne, u as fn } from "./chunk-index-BWpDbB19.js";
4
- import { u as fs, o as Te, b as mn, _ as vn, d as ms } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_06035587_lang-BpRKKThg.js";
5
- const bt = "__mb", hn = "call", Be = "reply", _n = "host-ready", gn = "height", vs = "html, body { overflow: hidden !important; }", hs = `
1
+ import { defineComponent as je, ref as x, computed as j, watch as Pt, nextTick as tn, onMounted as dn, onBeforeUnmount as pn, openBlock as d, createElementBlock as p, normalizeStyle as fn, normalizeClass as K, unref as it, createElementVNode as a, toDisplayString as b, createCommentVNode as k, Fragment as M, renderList as N, withModifiers as Ee, getCurrentInstance as fs, createBlock as bs, createTextVNode as $, withDirectives as vt, vModelCheckbox as ms, vModelText as Xt, withKeys as vs, vShow as Qt } from "vue";
2
+ import { useRouter as bn, useRoute as hs } from "vue-router";
3
+ import { b as at, c as ne, A as Te, u as mn } from "./chunk-index-BVIJeFeJ.js";
4
+ import { s as yu } from "./chunk-index-BVIJeFeJ.js";
5
+ import { u as gs, o as Be, b as vn, _ as hn, d as _s } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_06035587_lang-Fky1ghd2.js";
6
+ const ft = "__mb", gn = "call", Me = "reply", _n = "host-ready", yn = "height", ys = "html, body { overflow: hidden !important; }", ks = `
6
7
  (function () {
7
8
  var seq = 0, waiting = {}, queue = [], ready = false, last = -1;
8
9
  function call(method, args) {
@@ -10,16 +11,16 @@ const bt = "__mb", hn = "call", Be = "reply", _n = "host-ready", gn = "height",
10
11
  function run() {
11
12
  var id = ++seq;
12
13
  waiting[id] = { resolve: resolve, reject: reject };
13
- parent.postMessage({ '${bt}': '${hn}', id: id, method: method, args: args }, '*');
14
+ parent.postMessage({ '${ft}': '${gn}', id: id, method: method, args: args }, '*');
14
15
  }
15
16
  if (ready) run(); else queue.push(run);
16
17
  });
17
18
  }
18
19
  window.addEventListener('message', function (event) {
19
20
  var data = event.data, pending;
20
- if (!data || data['${bt}'] === undefined) return;
21
- if (data['${bt}'] === '${_n}') { ready = true; queue.splice(0).forEach(function (run) { run(); }); return; }
22
- if (data['${bt}'] !== '${Be}') return;
21
+ if (!data || data['${ft}'] === undefined) return;
22
+ if (data['${ft}'] === '${_n}') { ready = true; queue.splice(0).forEach(function (run) { run(); }); return; }
23
+ if (data['${ft}'] !== '${Me}') return;
23
24
  if (!(pending = waiting[data.id])) return;
24
25
  delete waiting[data.id];
25
26
  if (data.ok) pending.resolve(data.value); else pending.reject(new Error(data.error || '调用失败'));
@@ -60,7 +61,7 @@ const bt = "__mb", hn = "call", Be = "reply", _n = "host-ready", gn = "height",
60
61
  if (height > 0) height += 1;
61
62
  if (height === last) return; /* 一样高就不再发:否则「宿主改高度 → 触发观察 → 又发一次」会转个不停 */
62
63
  last = height;
63
- parent.postMessage({ '${bt}': '${gn}', height: height }, '*');
64
+ parent.postMessage({ '${ft}': '${yn}', height: height }, '*');
64
65
  }
65
66
  function start() {
66
67
  report();
@@ -69,48 +70,48 @@ const bt = "__mb", hn = "call", Be = "reply", _n = "host-ready", gn = "height",
69
70
  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start();
70
71
  setInterval(report, 500);
71
72
  })();
72
- `, _s = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/;
73
- function yn(o) {
73
+ `, $s = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/;
74
+ function kn(o) {
74
75
  const s = typeof window > "u" ? "http://localhost" : window.location.href;
75
- return new URL(`${bs}${o}`, s);
76
+ return new URL(`${Te}${o}`, s);
76
77
  }
77
- const tn = (() => {
78
+ function ws() {
78
79
  try {
79
- return yn("").origin;
80
+ return kn("").origin;
80
81
  } catch {
81
82
  return typeof window > "u" ? "" : window.location.origin;
82
83
  }
83
- })();
84
- async function gs(o, s, a) {
85
- if (!_s.test(s)) throw new Error(`路由名不合法:${s}(要写成 类名.方法名,例如 Customer.create)`);
86
- const i = yn(`/bx/${o}/${s}`);
87
- if (i.origin !== tn) throw new Error(`后端地址必须是本应用的(${tn}):${i.origin}`);
88
- const u = a instanceof Blob ? a : null, m = await fetch(i.toString(), {
84
+ }
85
+ async function xs(o, s, l) {
86
+ if (!$s.test(s)) throw new Error(`路由名不合法:${s}(要写成 类名.方法名,例如 Customer.create)`);
87
+ const i = kn(`/bx/${o}/${s}`), u = ws();
88
+ if (i.origin !== u) throw new Error(`后端地址必须是本应用的(${u}):${i.origin}`);
89
+ const m = l instanceof Blob ? l : null, f = await fetch(i.toString(), {
89
90
  method: "POST",
90
91
  credentials: "include",
91
92
  // 带上 HttpOnly 会话 cookie;authHeaders('POST') 给 CSRF 头(缺了 403)
92
- headers: u ? { "Content-Type": u.type || "application/octet-stream", ...ne("POST") } : { "Content-Type": "application/json", ...ne("POST") },
93
- body: u ?? JSON.stringify(a ?? {})
94
- }), f = await m.text().catch(() => "");
95
- if (m.ok) {
96
- if (!f) return null;
93
+ headers: m ? { "Content-Type": m.type || "application/octet-stream", ...ne("POST") } : { "Content-Type": "application/json", ...ne("POST") },
94
+ body: m ?? JSON.stringify(l ?? {})
95
+ }), c = await f.text().catch(() => "");
96
+ if (f.ok) {
97
+ if (!c) return null;
97
98
  try {
98
- return JSON.parse(f);
99
+ return JSON.parse(c);
99
100
  } catch {
100
- return f;
101
+ return c;
101
102
  }
102
103
  }
103
- let c = f;
104
+ let h = c;
104
105
  try {
105
- const h = JSON.parse(f);
106
- typeof h?.message == "string" && (c = h.message);
106
+ const v = JSON.parse(c);
107
+ typeof v?.message == "string" && (h = v.message);
107
108
  } catch {
108
- c = f;
109
+ h = c;
109
110
  }
110
- throw new Error(c ? `${s} 调用失败:${c.slice(0, 300)}` : `${s} 调用失败(${m.status})`);
111
+ throw new Error(h ? `${s} 调用失败:${h.slice(0, 300)}` : `${s} 调用失败(${f.status})`);
111
112
  }
112
- function ys(o, s) {
113
- const a = (f) => {
113
+ function Cs(o, s) {
114
+ const l = (f) => {
114
115
  try {
115
116
  o.contentWindow?.postMessage(f, "*");
116
117
  } catch (c) {
@@ -134,7 +135,7 @@ function ys(o, s) {
134
135
  const h = typeof c[0] == "string" ? c[0].trim() : "", v = c[1];
135
136
  if (!h) throw new Error("后端调用的路由名是空的:要写成 magicBackendApi.类名.方法名(参数)");
136
137
  if (!v || typeof v != "object" || Array.isArray(v)) throw new Error(`magicBackendApi.${h}(params) 的参数要么是一个对象,要么是一个文件(File / Blob)`);
137
- return await gs(s.uuid, h, v);
138
+ return await xs(s.uuid, h, v);
138
139
  }
139
140
  throw new Error(`不认识的方法:${String(f)}(这块桥只有 getMe / navigateTab / context / setTabTitle / backend 五个)`);
140
141
  }
@@ -142,38 +143,38 @@ function ys(o, s) {
142
143
  if (f.source !== o.contentWindow) return;
143
144
  const c = f.data;
144
145
  if (!c) return;
145
- if (c[bt] === gn) {
146
+ if (c[ft] === yn) {
146
147
  const v = typeof c.height == "number" ? c.height : NaN;
147
148
  Number.isFinite(v) && v > 0 && s.onHeight?.(v);
148
149
  return;
149
150
  }
150
- if (c[bt] !== hn) return;
151
+ if (c[ft] !== gn) return;
151
152
  const h = c.id;
152
153
  (async () => {
153
154
  try {
154
- a({ [bt]: Be, id: h, ok: !0, value: await i(String(c.method), c.args ?? []) });
155
+ l({ [ft]: Me, id: h, ok: !0, value: await i(String(c.method), c.args ?? []) });
155
156
  } catch (v) {
156
- a({ [bt]: Be, id: h, ok: !1, error: v instanceof Error ? v.message : String(v) });
157
+ l({ [ft]: Me, id: h, ok: !1, error: v instanceof Error ? v.message : String(v) });
157
158
  }
158
159
  })();
159
160
  };
160
161
  window.addEventListener("message", u);
161
- const m = () => a({ [bt]: _n });
162
+ const m = () => l({ [ft]: _n });
162
163
  return m(), o.addEventListener("load", m), () => {
163
164
  window.removeEventListener("message", u), o.removeEventListener("load", m);
164
165
  };
165
166
  }
166
- const Ht = "index.open.html", ye = "magic-block.open.yaml", ke = ["id", "module", "name", "brief", "detail"], en = ["id", "module", "name", "brief"], je = 40, ks = /^(?![A-Za-z]:)(?!\/)[A-Za-z0-9._\-/]+$/, $s = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, ws = /^[a-z][a-z0-9]*$/, xs = /^[A-Za-z_][A-Za-z0-9_]*$/, Cs = /^([|>])([-+]?)$/, Ss = "_";
167
+ const Ht = "index.open.html", ye = "magic-block.open.yaml", ke = ["id", "module", "name", "brief", "detail"], en = ["id", "module", "name", "brief"], Le = 40, Ss = /^(?![A-Za-z]:)(?!\/)[A-Za-z0-9._\-/]+$/, Es = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, Ts = /^[a-z][a-z0-9]*$/, Bs = /^[A-Za-z_][A-Za-z0-9_]*$/, Ms = /^([|>])([-+]?)$/, As = "_";
167
168
  function nn(o) {
168
- return String(o ?? "").split("/").some((s) => s.startsWith(Ss));
169
+ return String(o ?? "").split("/").some((s) => s.startsWith(As));
169
170
  }
170
- function Es(o) {
171
- return o.length > 0 && o.length <= je && !/[\u0000-\u001f\u007f]/.test(o);
171
+ function Os(o) {
172
+ return o.length > 0 && o.length <= Le && !/[\u0000-\u001f\u007f]/.test(o);
172
173
  }
173
- const Ts = {
174
+ const Rs = {
174
175
  id: "块的 uuid,必须与页面里挂载它时写死的那个 uuid 逐字一致",
175
176
  module: "模块名(小写字母与数字,必须以字母开头),例如 home",
176
- name: `可读名:可以用中文,不超过 ${je} 个字符`,
177
+ name: `可读名:可以用中文,不超过 ${Le} 个字符`,
177
178
  brief: "一句话说明这个块解决什么问题",
178
179
  // 可选键:这一句不会出现在"缺少 xxx"的报文里(它不在 MANIFEST_REQUIRED 里),
179
180
  // 留着是为了让这份 Map 与 MANIFEST_KEYS 一一对上(少一个键 `tsc` 就会报)。
@@ -183,73 +184,73 @@ function sn(o) {
183
184
  const s = Object.keys(o);
184
185
  return s.length > 0 ? `现在包里有:${s.join(" / ")}` : "现在这个包是空的";
185
186
  }
186
- function Bs(o) {
187
+ function Ps(o) {
187
188
  let s = "";
188
- for (let a = 0; a < o.length; a += 1) {
189
- const i = o[a];
189
+ for (let l = 0; l < o.length; l += 1) {
190
+ const i = o[l];
190
191
  if (s)
191
192
  i === s && (s = "");
192
193
  else if (i === '"' || i === "'") s = i;
193
- else if (i === "#") return o.slice(0, a);
194
+ else if (i === "#") return o.slice(0, l);
194
195
  }
195
196
  return o;
196
197
  }
197
- function Ms(o) {
198
+ function js(o) {
198
199
  let s = "";
199
- for (let a = 0; a < o.length; a += 1) {
200
- const i = o[a];
200
+ for (let l = 0; l < o.length; l += 1) {
201
+ const i = o[l];
201
202
  if (s)
202
203
  i === s && (s = "");
203
204
  else if (i === '"' || i === "'") s = i;
204
- else if (i === ":") return a;
205
+ else if (i === ":") return l;
205
206
  }
206
207
  return -1;
207
208
  }
208
- function As(o) {
209
+ function Ls(o) {
209
210
  return !o || o[0] !== '"' && o[0] !== "'" ? o : o.length >= 2 && o[o.length - 1] === o[0] ? o.slice(1, -1).trim() : o;
210
211
  }
211
- function Rs(o) {
212
+ function Is(o) {
212
213
  const s = [...o];
213
214
  for (; s.length > 0 && !s[0].trim(); ) s.shift();
214
215
  for (; s.length > 0 && !s[s.length - 1].trim(); ) s.pop();
215
- const a = s.filter((u) => u.trim()).map((u) => u.length - u.trimStart().length), i = a.length > 0 ? Math.min(...a) : 0;
216
+ const l = s.filter((u) => u.trim()).map((u) => u.length - u.trimStart().length), i = l.length > 0 ? Math.min(...l) : 0;
216
217
  return s.map((u) => u.trim() ? u.slice(i) : "").join(`
217
218
  `);
218
219
  }
219
- function Os(o) {
220
- const s = [], a = {}, i = {}, u = o.split(/\r?\n/);
220
+ function Ds(o) {
221
+ const s = [], l = {}, i = {}, u = o.split(/\r?\n/);
221
222
  let m = 0;
222
223
  for (; m < u.length; ) {
223
224
  const f = u[m], c = m + 1;
224
225
  m += 1;
225
- const h = Bs(f).trim();
226
+ const h = Ps(f).trim();
226
227
  if (!h) continue;
227
228
  if (h.startsWith("-")) {
228
229
  s.push(`第 ${c} 行是列表写法(${h}):清单只认「键: 值」,每个键各占一行 —— 例如 name: 客户档案(长文本用 detail: | 起一个块,块里想写几行就写几行)`);
229
230
  continue;
230
231
  }
231
- const v = Ms(h);
232
+ const v = js(h);
232
233
  if (v < 0) {
233
234
  s.push(`第 ${c} 行不是「键: 值」(${h}):清单只认「键: 值」与 # 注释 —— 要么删掉这一行,要么照 name: 客户档案 写(长文本用 detail: | 起一个块,块的正文是**缩进**的几行)`);
234
235
  continue;
235
236
  }
236
- const g = h.slice(0, v).trim();
237
- if (!xs.test(g)) {
238
- s.push(`第 ${c} 行的键名不合法(${g}):键名只许字母或下划线开头,认得的键只有 ${ke.join(" / ")}`);
237
+ const _ = h.slice(0, v).trim();
238
+ if (!Bs.test(_)) {
239
+ s.push(`第 ${c} 行的键名不合法(${_}):键名只许字母或下划线开头,认得的键只有 ${ke.join(" / ")}`);
239
240
  continue;
240
241
  }
241
- if (!ke.includes(g)) {
242
+ if (!ke.includes(_)) {
242
243
  s.push(
243
- `第 ${c} 行的键不认识(${g}):清单只有 ${ke.join(" / ")} 这几个键(其中 ${en.join(" / ")} 必填,detail 可以不写)`
244
+ `第 ${c} 行的键不认识(${_}):清单只有 ${ke.join(" / ")} 这几个键(其中 ${en.join(" / ")} 必填,detail 可以不写)`
244
245
  );
245
246
  continue;
246
247
  }
247
- if (g in i) {
248
- s.push(`第 ${c} 行重复写了 ${g}(第 ${i[g]} 行已经写过):一个键只许出现一次`);
248
+ if (_ in i) {
249
+ s.push(`第 ${c} 行重复写了 ${_}(第 ${i[_]} 行已经写过):一个键只许出现一次`);
249
250
  continue;
250
251
  }
251
- i[g] = c;
252
- const _ = h.slice(v + 1).trim(), y = Cs.exec(_);
252
+ i[_] = c;
253
+ const g = h.slice(v + 1).trim(), y = Ms.exec(g);
253
254
  if (y) {
254
255
  const E = [];
255
256
  for (; m < u.length; ) {
@@ -257,31 +258,31 @@ function Os(o) {
257
258
  if (C.trim() && !/^\s/.test(C)) break;
258
259
  E.push(C), m += 1;
259
260
  }
260
- let A = Rs(E);
261
+ let A = Is(E);
261
262
  y[1] === ">" && (A = A.split(`
262
- `).map((C) => C.trim()).filter(Boolean).join(" ")), a[g] = A;
263
+ `).map((C) => C.trim()).filter(Boolean).join(" ")), l[_] = A;
263
264
  continue;
264
265
  }
265
- a[g] = As(_);
266
+ l[_] = Ls(g);
266
267
  }
267
268
  for (const f of en) {
268
- const c = a[f] ?? "";
269
+ const c = l[f] ?? "";
269
270
  if (c === "") {
270
- s.push(`清单里缺少 ${f}(或者是空的):${Ts[f]}`);
271
+ s.push(`清单里缺少 ${f}(或者是空的):${Rs[f]}`);
271
272
  continue;
272
273
  }
273
- f === "id" && !$s.test(c) ? s.push(`清单里的 id 不是 uuid:${c} —— 要 8-4-4-4-12 那种十六进制`) : f === "module" && !ws.test(c) ? s.push(
274
+ f === "id" && !Es.test(c) ? s.push(`清单里的 id 不是 uuid:${c} —— 要 8-4-4-4-12 那种十六进制`) : f === "module" && !Ts.test(c) ? s.push(
274
275
  `清单里的 module 不合法:${c} —— 它同时是 Django 的 app label,所以只许小写字母与数字、必须以字母开头(不能有横线与下划线),例如 home / orders`
275
- ) : f === "name" && !Es(c) && s.push(`清单里的 name 不合法:${c} —— 不能超过 ${je} 个字符、不能含控制字符(中文可以)`);
276
+ ) : f === "name" && !Os(c) && s.push(`清单里的 name 不合法:${c} —— 不能超过 ${Le} 个字符、不能含控制字符(中文可以)`);
276
277
  }
277
- return [a, s];
278
+ return [l, s];
278
279
  }
279
- function Ps(o) {
280
- return ks.test(o) && !o.split("/").includes("..");
280
+ function Ns(o) {
281
+ return Ss.test(o) && !o.split("/").includes("..");
281
282
  }
282
- function js(o) {
283
- const s = [], a = o[Ht];
284
- a === void 0 ? s.push(`包里缺入口:必须有 ${Ht}(${sn(o)})`) : a.trim() || s.push(`${Ht} 不能是空文件`);
283
+ function Fs(o) {
284
+ const s = [], l = o[Ht];
285
+ l === void 0 ? s.push(`包里缺入口:必须有 ${Ht}(${sn(o)})`) : l.trim() || s.push(`${Ht} 不能是空文件`);
285
286
  const i = o[ye];
286
287
  let u = {};
287
288
  if (i === void 0)
@@ -289,123 +290,123 @@ function js(o) {
289
290
  else if (!i.trim())
290
291
  s.push(`${ye} 不能是空文件`);
291
292
  else {
292
- const [m, f] = Os(i);
293
+ const [m, f] = Ds(i);
293
294
  u = m, s.push(...f);
294
295
  }
295
296
  for (const m of Object.keys(o))
296
- Ps(m) || s.push(`文件名不合法:${m}(只许字母数字与 . _ - /,且不许 .. 与绝对路径)`);
297
+ Ns(m) || s.push(`文件名不合法:${m}(只许字母数字与 . _ - /,且不许 .. 与绝对路径)`);
297
298
  return { manifest: u, issues: s };
298
299
  }
299
- function Ls(o) {
300
+ function Us(o) {
300
301
  const s = [];
301
302
  if (o.length === 0)
302
303
  return s.push("一个块都没勾:请在「读回改动」的结果里勾上要保存的块"), { selected: 0, issues: s };
303
- for (const a of o) {
304
- const i = a.name?.trim() || "(没有名字的块)";
305
- for (const u of js(a.files ?? {}).issues) s.push(`${i}:${u}`);
304
+ for (const l of o) {
305
+ const i = l.name?.trim() || "(没有名字的块)";
306
+ for (const u of Fs(l.files ?? {}).issues) s.push(`${i}:${u}`);
306
307
  }
307
308
  return { selected: o.length, issues: s };
308
309
  }
309
- const Ds = "backend_open.py", Is = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
310
+ const zs = "backend_open.py", Hs = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
310
311
  function on(o, s) {
311
- if (Is.test(o)) return;
312
- const a = (o.split(/[?#]/)[0] ?? "").replace(/^\.\//, "").replace(/^\/+/, "");
313
- if (a in s) return nn(a) ? void 0 : a;
314
- const i = a.split("/").pop() ?? "";
312
+ if (Hs.test(o)) return;
313
+ const l = (o.split(/[?#]/)[0] ?? "").replace(/^\.\//, "").replace(/^\/+/, "");
314
+ if (l in s) return nn(l) ? void 0 : l;
315
+ const i = l.split("/").pop() ?? "";
315
316
  return i ? Object.keys(s).find((u) => !nn(u) && (u.split("/").pop() ?? "") === i) : void 0;
316
317
  }
317
- const kn = "\0mb:";
318
- function Ns(o) {
319
- return `${kn}${o}\0`;
320
- }
321
- const Fs = /<script\b([^>]*?)\bsrc\s*=\s*(["'])(.*?)\2([^>]*)>\s*<\/script\s*>/gi, zs = /<link\b([^>]*?)\bhref\s*=\s*(["'])(.*?)\2([^>]*?)\/?>/gi;
322
- function Us(o, s) {
323
- const a = [], i = (f) => (a.push(f), Ns(a.length - 1));
324
- return { html: o.replace(Fs, (f, c, h, v, g) => {
325
- const _ = on(v, s);
326
- return _ === void 0 ? f : i(`<script${c}${g}>
327
- ${$n(s[_] ?? "")}
318
+ const $n = "\0mb:";
319
+ function Ks(o) {
320
+ return `${$n}${o}\0`;
321
+ }
322
+ const qs = /<script\b([^>]*?)\bsrc\s*=\s*(["'])(.*?)\2([^>]*)>\s*<\/script\s*>/gi, Vs = /<link\b([^>]*?)\bhref\s*=\s*(["'])(.*?)\2([^>]*?)\/?>/gi;
323
+ function Js(o, s) {
324
+ const l = [], i = (f) => (l.push(f), Ks(l.length - 1));
325
+ return { html: o.replace(qs, (f, c, h, v, _) => {
326
+ const g = on(v, s);
327
+ return g === void 0 ? f : i(`<script${c}${_}>
328
+ ${wn(s[g] ?? "")}
328
329
  <\/script>`);
329
- }).replace(zs, (f, c, h, v, g) => {
330
- if (!/\brel\s*=\s*(?:"|')?stylesheet/i.test(`${c}${g}`)) return f;
331
- const _ = on(v, s);
332
- return _ === void 0 ? f : i(`<style>
333
- ${s[_]}
330
+ }).replace(Vs, (f, c, h, v, _) => {
331
+ if (!/\brel\s*=\s*(?:"|')?stylesheet/i.test(`${c}${_}`)) return f;
332
+ const g = on(v, s);
333
+ return g === void 0 ? f : i(`<style>
334
+ ${s[g]}
334
335
  </style>`);
335
- }), slots: a };
336
+ }), slots: l };
336
337
  }
337
- function $n(o) {
338
+ function wn(o) {
338
339
  return o.replace(/<\/(script)/gi, "<\\/$1");
339
340
  }
340
- function wn(o, s) {
341
- const a = /<\/head\s*>/i.exec(o);
342
- return a ? `${o.slice(0, a.index)}${s}${o.slice(a.index)}` : `${s}${o}`;
341
+ function xn(o, s) {
342
+ const l = /<\/head\s*>/i.exec(o);
343
+ return l ? `${o.slice(0, l.index)}${s}${o.slice(l.index)}` : `${s}${o}`;
343
344
  }
344
- function Hs(o, s) {
345
- return s ? wn(o, `<script>
346
- ${$n(s)}
345
+ function Ws(o, s) {
346
+ return s ? xn(o, `<script>
347
+ ${wn(s)}
347
348
  <\/script>
348
349
  `) : o;
349
350
  }
350
351
  function ln(o, s) {
351
- return s ? wn(o, `<style data-magic-block="host">
352
+ return s ? xn(o, `<style data-magic-block="host">
352
353
  ${s}
353
354
  </style>
354
355
  `) : o;
355
356
  }
356
- function Ks(o, s = {}) {
357
- const a = s.bootstrap ?? "", i = s.css ?? "", u = s.themeCss ?? "", m = o[Ht];
357
+ function Gs(o, s = {}) {
358
+ const l = s.bootstrap ?? "", i = s.css ?? "", u = s.themeCss ?? "", m = o[Ht];
358
359
  if (m === void 0) return "";
359
- const { html: f, slots: c } = Us(m, o), h = Hs(ln(ln(f, u), i), a), v = h.split(kn);
360
+ const { html: f, slots: c } = Js(m, o), h = Ws(ln(ln(f, u), i), l), v = h.split($n);
360
361
  if (v.length === 1) return h;
361
- let g = v[0] ?? "";
362
- for (let _ = 1; _ < v.length; _ += 1) {
363
- const y = v[_] ?? "", E = y.indexOf("\0"), A = Number(y.slice(0, E));
364
- g += (c[A] ?? "") + y.slice(E + 1);
362
+ let _ = v[0] ?? "";
363
+ for (let g = 1; g < v.length; g += 1) {
364
+ const y = v[g] ?? "", E = y.indexOf("\0"), A = Number(y.slice(0, E));
365
+ _ += (c[A] ?? "") + y.slice(E + 1);
365
366
  }
366
- return g;
367
+ return _;
367
368
  }
368
- const Ut = /* @__PURE__ */ new Map();
369
+ const zt = /* @__PURE__ */ new Map();
369
370
  let jt = null;
370
- const Me = /* @__PURE__ */ new Set();
371
- function qs(o) {
372
- return Me.add(o), () => {
373
- Me.delete(o);
371
+ const Ae = /* @__PURE__ */ new Set();
372
+ function Ys(o) {
373
+ return Ae.add(o), () => {
374
+ Ae.delete(o);
374
375
  };
375
376
  }
376
- function Vs() {
377
- Ut.clear(), jt = null;
378
- for (const o of Me) o();
377
+ function Zs() {
378
+ zt.clear(), jt = null;
379
+ for (const o of Ae) o();
379
380
  }
380
- async function Js(o) {
381
+ async function Xs(o) {
381
382
  const s = [...new Set(o)].filter(Boolean);
382
- if (s.some((a) => !Ut.has(a))) {
383
+ if (s.some((l) => !zt.has(l))) {
383
384
  jt && await jt.catch(() => {
384
385
  });
385
- const a = s.filter((i) => !Ut.has(i));
386
- a.length > 0 && (jt = at(`/magic-blocks/render?ids=${a.map(encodeURIComponent).join(",")}`).then((i) => {
387
- for (const u of i) u?.id && Ut.set(u.id, u);
386
+ const l = s.filter((i) => !zt.has(i));
387
+ l.length > 0 && (jt = at(`/magic-blocks/render?ids=${l.map(encodeURIComponent).join(",")}`).then((i) => {
388
+ for (const u of i) u?.id && zt.set(u.id, u);
388
389
  return i;
389
390
  }).catch(() => []).finally(() => {
390
391
  jt = null;
391
392
  }), await jt.catch(() => {
392
393
  }));
393
394
  }
394
- return s.map((a) => Ut.get(a)).filter((a) => !!a);
395
+ return s.map((l) => zt.get(l)).filter((l) => !!l);
395
396
  }
396
397
  const Bt = "labull.css", ee = "CONTROLS.lock.html";
397
- function Gs(o, s) {
398
- const a = String(s || "");
399
- if (/@font-face|@keyframes/i.test(a)) return !0;
398
+ function Qs(o, s) {
399
+ const l = String(s || "");
400
+ if (/@font-face|@keyframes/i.test(l)) return !0;
400
401
  const i = String(o || "");
401
- return /(^|[\s,>+~])(\.p-|\.pi(?![a-z])|\.pi-|\.labull-|:root|html(?![a-z-])|body(?![a-z-])|\*|:where\()/.test(i) ? !0 : /--(?:sp|surface|primary|text-color|content|highlight|focus-ring|p-)/.test(a);
402
+ return /(^|[\s,>+~])(\.p-|\.pi(?![a-z])|\.pi-|\.labull-|:root|html(?![a-z-])|body(?![a-z-])|\*|:where\()/.test(i) ? !0 : /--(?:sp|surface|primary|text-color|content|highlight|focus-ring|p-)/.test(l);
402
403
  }
403
- function xn(o, s, a) {
404
+ function Cn(o, s, l) {
404
405
  for (let i = 0; i < o.length; i += 1) {
405
406
  const u = o[i], m = String(u.cssText || ""), f = String(u.selectorText || "");
406
407
  if (u.cssRules && u.cssRules.length > 0) {
407
408
  const c = [];
408
- if (xn(u.cssRules, c, a), c.length === 0) continue;
409
+ if (Cn(u.cssRules, c, l), c.length === 0) continue;
409
410
  const h = m.slice(0, m.indexOf("{")).trim();
410
411
  s.push(`${h} {
411
412
  ${c.map((v) => " " + v).join(`
@@ -413,11 +414,11 @@ ${c.map((v) => " " + v).join(`
413
414
  }`);
414
415
  continue;
415
416
  }
416
- Gs(f, m) && (s.push(m), a.n += 1);
417
+ Qs(f, m) && (s.push(m), l.n += 1);
417
418
  }
418
419
  }
419
- function Cn() {
420
- const o = [], s = [], a = { n: 0 };
420
+ function Sn() {
421
+ const o = [], s = [], l = { n: 0 };
421
422
  let i = 0;
422
423
  const u = typeof document > "u" ? [] : Array.from(document.styleSheets);
423
424
  for (const f of u) {
@@ -431,13 +432,13 @@ function Cn() {
431
432
  }
432
433
  if (!h || h.length === 0) continue;
433
434
  const v = [];
434
- xn(h, v, a), v.length !== 0 && (i += 1, o.push(`/* ── ${c} ── */`, ...v));
435
+ Cn(h, v, l), v.length !== 0 && (i += 1, o.push(`/* ── ${c} ── */`, ...v));
435
436
  }
436
437
  return { css: [
437
438
  "/* 生成物:每次导出都会重写,别手改。",
438
439
  " *",
439
440
  " * 这是这个应用此刻真正在用的 **labull 主题 + 控件样式**(token / PrimeVue 控件 / 结构类 / 图标)。",
440
- ` * 收自 ${i} 张样式表、${a.n} 条规则。`,
441
+ ` * 收自 ${i} 张样式表、${l.n} 条规则。`,
441
442
  s.length > 0 ? ` * ⚠️ 有 ${s.length} 张样式表读不到规则(跨源,浏览器不让读):${s.join(" / ")} —— 需要的话手动补一份。` : " * (没有读不到的样式表:收全了。)",
442
443
  " *",
443
444
  " * 怎么用(块里):**什么都不用加** —— 宿主会把这一份注入每个块的 iframe(`MagicBlockHost` 的 `theme` prop),",
@@ -451,17 +452,17 @@ function Cn() {
451
452
  ].join(`
452
453
  `) + o.join(`
453
454
  `) + `
454
- `, sheets: i, skipped: s, rules: a.n };
455
+ `, sheets: i, skipped: s, rules: l.n };
455
456
  }
456
- function Ws() {
457
+ function to() {
457
458
  const o = '<button class="p-button" type="button">主要按钮</button>', s = (f, c, h) => ` <li class="labull-step${f ? ` ${f}` : ""}">
458
459
  <span class="labull-step-node"></span>
459
460
  <span class="labull-step-label">${c}</span>
460
461
  <span class="labull-step-desc">${h}</span>
461
- </li>`, a = (f, c = "") => `<ol class="labull-steps${c ? ` ${c}` : ""}">
462
- ` + f.map(([h, v, g]) => s(h, v, g)).join(`
462
+ </li>`, l = (f, c = "") => `<ol class="labull-steps${c ? ` ${c}` : ""}">
463
+ ` + f.map(([h, v, _]) => s(h, v, _)).join(`
463
464
  `) + `
464
- </ol>`, i = a([
465
+ </ol>`, i = l([
465
466
  ["is-done", "草稿", "需求已创建"],
466
467
  ["is-current", "待审批", "等管理员审批"],
467
468
  ["", "审批通过", "待处理"],
@@ -485,19 +486,19 @@ function Ws() {
485
486
  /* 🔴 流程链条:**纯 CSS**(没有 JS),状态加在 `<li>` 上;桌面横向、手机自动转纵向。
486
487
  * 三行分别是:默认那条链 / 强制纵向那个参数 / 四个状态各长什么样。 */
487
488
  ["流程链条(工作流步骤条):桌面横向、手机自动纵向;节点空着会自动编号,已完成自动显示 ✓", i],
488
- ["流程链条 · 参数 <code>labull-steps--vertical</code>(强制纵向:手机那一套,侧栏那种窄容器也用它)", a([
489
+ ["流程链条 · 参数 <code>labull-steps--vertical</code>(强制纵向:手机那一套,侧栏那种窄容器也用它)", l([
489
490
  ["is-done", "草稿", "需求已创建"],
490
491
  ["is-current", "待审批", "等管理员审批"],
491
492
  ["", "审批通过", "待处理"],
492
493
  ["", "开发完成", "待处理"],
493
494
  ["", "验收完成", "待处理"]
494
495
  ], "labull-steps--vertical")],
495
- ["流程链条 · 参数 <code>labull-steps--horizontal</code>(强制横向:在手机上也横着排;⚠️ 手机上只适合 2-4 步,5 步以上用默认或 --vertical)", a([
496
+ ["流程链条 · 参数 <code>labull-steps--horizontal</code>(强制横向:在手机上也横着排;⚠️ 手机上只适合 2-4 步,5 步以上用默认或 --vertical)", l([
496
497
  ["is-done", "提交", "10-05"],
497
498
  ["is-current", "审批", "进行中"],
498
499
  ["", "完成", "待处理"]
499
500
  ], "labull-steps--horizontal")],
500
- ["流程链条 · 状态:<code>is-done</code> / <code>is-current</code> / 不写(待处理)/ <code>is-danger</code>(退回 · 终止)", a([
501
+ ["流程链条 · 状态:<code>is-done</code> / <code>is-current</code> / 不写(待处理)/ <code>is-danger</code>(退回 · 终止)", l([
501
502
  ["is-done", "已修复", "张三 10-05"],
502
503
  ["is-current", "待验收", "等提出人确认"],
503
504
  ["is-danger", "被退回", "原因:信息不全"],
@@ -548,60 +549,60 @@ ${m}
548
549
  </html>
549
550
  `;
550
551
  }
551
- const Mt = /* @__PURE__ */ new Map(), Ae = /* @__PURE__ */ new Set(), Ys = 4e3;
552
+ const Mt = /* @__PURE__ */ new Map(), Oe = /* @__PURE__ */ new Set(), eo = 4e3;
552
553
  let Re = "", te = null;
553
554
  function an() {
554
- for (const o of Ae) o();
555
+ for (const o of Oe) o();
555
556
  }
556
- function Zs(o) {
557
- return Ae.add(o), () => {
558
- Ae.delete(o);
557
+ function no(o) {
558
+ return Oe.add(o), () => {
559
+ Oe.delete(o);
559
560
  };
560
561
  }
561
562
  function $e() {
562
563
  return Re;
563
564
  }
564
- function Xs(o, s) {
565
- const a = String(o || "").trim(), i = String(s || "").trim();
566
- if (!a || !i) return () => {
565
+ function so(o, s) {
566
+ const l = String(o || "").trim(), i = String(s || "").trim();
567
+ if (!l || !i) return () => {
567
568
  };
568
- let u = Mt.get(a);
569
- return u || (u = /* @__PURE__ */ new Set(), Mt.set(a, u)), u.add(i), () => {
570
- const m = Mt.get(a);
571
- m && (m.delete(i), m.size === 0 && Mt.delete(a));
569
+ let u = Mt.get(l);
570
+ return u || (u = /* @__PURE__ */ new Set(), Mt.set(l, u)), u.add(i), () => {
571
+ const m = Mt.get(l);
572
+ m && (m.delete(i), m.size === 0 && Mt.delete(l));
572
573
  };
573
574
  }
574
- function Oe(o, s, a) {
575
+ function Pe(o, s, l) {
575
576
  const i = Mt.get(String(o || ""));
576
577
  if (!i) return null;
577
578
  for (const u of i)
578
- if (u !== s && !(a && !a(u)))
579
+ if (u !== s && !(l && !l(u)))
579
580
  return u;
580
581
  return null;
581
582
  }
582
- function Qs(o) {
583
+ function oo(o) {
583
584
  return [...Mt.get(String(o || "")) ?? []];
584
585
  }
585
- function to(o, s, a) {
586
+ function lo(o, s, l) {
586
587
  const i = Mt.get(String(o || ""));
587
- return !i || i.size === 0 || i.has(s) ? null : Oe(o, s, a);
588
+ return !i || i.size === 0 || i.has(s) ? null : Pe(o, s, l);
588
589
  }
589
- function Sn(o, s = Ys) {
590
+ function En(o, s = eo) {
590
591
  Re = String(o || ""), te !== null && clearTimeout(te), te = setTimeout(() => {
591
592
  te = null, Re = "", an();
592
593
  }, Math.max(1, s)), an();
593
594
  }
594
- const eo = ["data-magic-block", "data-magic-module"], no = ["srcdoc", "title"], so = { class: "mb__state" }, oo = { class: "mb__brief" }, lo = {
595
+ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"], uo = { class: "mb__state" }, co = { class: "mb__brief" }, ro = {
595
596
  key: 0,
596
597
  class: "mb__reason"
597
- }, ao = {
598
+ }, po = {
598
599
  key: 1,
599
600
  class: "mb__issues"
600
- }, io = {
601
+ }, fo = {
601
602
  key: 2,
602
603
  class: "mb__ring",
603
604
  "aria-hidden": "true"
604
- }, uo = ["title", "aria-label"], co = ["title", "aria-label"], ro = ["title", "aria-label"], po = ["title", "aria-label"], bo = /* @__PURE__ */ Pe({
605
+ }, bo = ["title", "aria-label"], mo = ["title", "aria-label"], vo = ["title", "aria-label"], ho = ["title", "aria-label"], go = /* @__PURE__ */ je({
605
606
  __name: "MagicBlockHost",
606
607
  props: {
607
608
  uuid: {},
@@ -610,44 +611,44 @@ const eo = ["data-magic-block", "data-magic-module"], no = ["srcdoc", "title"],
610
611
  theme: { type: Boolean, default: !0 }
611
612
  },
612
613
  setup(o) {
613
- const s = o, a = fs(), i = bn(), { isStaff: u } = fn(), m = x(null), f = x(null), c = x(null), h = x(!1), v = x(0), g = x(0);
614
- let _ = null, y = null, E = null, A = null, C = null, R = null;
615
- const P = j(() => s.name.trim() || s.uuid), z = j(() => c.value?.state ?? ""), Z = j(() => z.value === "invalid" ? "校验不通过" : z.value === "draft" ? "未开发" : P.value), X = j(() => (c.value?.brief ?? "").trim() || (c.value?.name ?? "").trim() || P.value), yt = j(() => (c.value?.reason ?? "").trim()), kt = j(() => c.value?.issues ?? []), S = j(() => Math.max(g.value, v.value, 1)), Dt = j(() => ({ height: `${S.value}px` })), ut = j(() => {
614
+ const s = o, l = gs(), i = bn(), { isStaff: u } = mn(), m = x(null), f = x(null), c = x(null), h = x(!1), v = x(0), _ = x(0);
615
+ let g = null, y = null, E = null, A = null, C = null, O = null;
616
+ const P = j(() => s.name.trim() || s.uuid), U = j(() => c.value?.state ?? ""), Z = j(() => U.value === "invalid" ? "校验不通过" : U.value === "draft" ? "未开发" : P.value), X = j(() => (c.value?.brief ?? "").trim() || (c.value?.name ?? "").trim() || P.value), yt = j(() => (c.value?.reason ?? "").trim()), kt = j(() => c.value?.issues ?? []), S = j(() => Math.max(_.value, v.value, 1)), It = j(() => ({ height: `${S.value}px` })), ut = j(() => {
616
617
  const w = {};
617
- for (const [T, D] of Object.entries(c.value?.files ?? {})) T !== Ds && (w[T] = D);
618
+ for (const [T, I] of Object.entries(c.value?.files ?? {})) T !== zs && (w[T] = I);
618
619
  return w;
619
- }), $t = j(() => z.value === "ok" && typeof ut.value[Ht] == "string");
620
+ }), $t = j(() => U.value === "ok" && typeof ut.value[Ht] == "string");
620
621
  let st = null;
621
622
  function q() {
622
623
  if (!s.theme) return "";
623
624
  if (st !== null || (st = "", typeof document > "u")) return st;
624
625
  try {
625
- st = Cn().css;
626
+ st = Sn().css;
626
627
  } catch {
627
628
  st = "";
628
629
  }
629
630
  return st;
630
631
  }
631
- const U = j(() => {
632
+ const z = j(() => {
632
633
  if (!$t.value) return "";
633
- const w = { bootstrap: hs, css: vs }, T = q();
634
- return T && (w.themeCss = T), Ks(ut.value, w);
634
+ const w = { bootstrap: ks, css: ys }, T = q();
635
+ return T && (w.themeCss = T), Gs(ut.value, w);
635
636
  });
636
637
  function Q() {
637
- return { key: a.key, path: a.path, params: a.params, query: a.query };
638
+ return { key: l.key, path: l.path, params: l.params, query: l.query };
638
639
  }
639
640
  async function wt(w) {
640
641
  const T = i.resolve(w);
641
642
  if (T.matched.length === 0) {
642
- const D = i.getRoutes().map((rt) => rt.path);
643
- throw new Error(`这个应用里没有页面 ${w}。能跳的页面只有:${D.length > 0 ? D.join(" / ") : "(还没有配路由)"}`);
643
+ const I = i.getRoutes().map((rt) => rt.path);
644
+ throw new Error(`这个应用里没有页面 ${w}。能跳的页面只有:${I.length > 0 ? I.join(" / ") : "(还没有配路由)"}`);
644
645
  }
645
- return Te(w) || T.fullPath;
646
+ return Be(w) || T.fullPath;
646
647
  }
647
- function ft() {
648
+ function bt() {
648
649
  E?.(), E = null;
649
650
  const w = f.value;
650
- w && (E = ys(w, {
651
+ w && (E = Cs(w, {
651
652
  uuid: s.uuid,
652
653
  onHeight: (T) => {
653
654
  v.value = T;
@@ -656,28 +657,28 @@ const eo = ["data-magic-block", "data-magic-module"], no = ["srcdoc", "title"],
656
657
  context: Q,
657
658
  /* 🔴 块给**自己所属那条标签**起名:整页就是一个块时(`MagicBlockPage`),标签栏上那条
658
659
  * 默认只有路由的 `meta.title`("订单详情"),而"订单 SO-42"只有块自己知道。 */
659
- onTabTitle: (T, D) => a.setTitle(T, D)
660
+ onTabTitle: (T, I) => l.setTitle(T, I)
660
661
  }));
661
662
  }
662
663
  async function xt() {
663
- const w = s.uuid, T = await Js([w]);
664
- w === s.uuid && (c.value = T.find((D) => D.id === w) ?? null);
664
+ const w = s.uuid, T = await Xs([w]);
665
+ w === s.uuid && (c.value = T.find((I) => I.id === w) ?? null);
665
666
  }
666
667
  function Kt() {
667
668
  window.dispatchEvent(new CustomEvent("magic-block:open-console", { detail: { uuid: s.uuid } }));
668
669
  }
669
670
  function qt(w = !1) {
670
- w && C?.(), C = Xs(s.uuid, a.key);
671
+ w && C?.(), C = so(s.uuid, l.key);
671
672
  }
672
- const tt = (w) => !mn(w, i), V = j(() => {
673
+ const tt = (w) => !vn(w, i), V = j(() => {
673
674
  if (!u.value) return "";
674
- const w = Oe(s.uuid, a.key, tt);
675
+ const w = Pe(s.uuid, l.key, tt);
675
676
  return w ? `管理员:切到还挂着这个块的标签 ${w}(点一下这一块会亮红框)` : "管理员:这个块只在这一条标签里挂着 —— 点一下会亮几秒红框";
676
677
  });
677
- function O() {
678
+ function R() {
678
679
  if (!u.value) return;
679
- const w = Oe(s.uuid, a.key, tt);
680
- Sn(s.uuid), w && Te(w);
680
+ const w = Pe(s.uuid, l.key, tt);
681
+ En(s.uuid), w && Be(w);
681
682
  }
682
683
  function ct(w) {
683
684
  let T = w.parentElement;
@@ -687,45 +688,45 @@ const eo = ["data-magic-block", "data-magic-module"], no = ["srcdoc", "title"],
687
688
  }
688
689
  return document.documentElement;
689
690
  }
690
- function W() {
691
+ function G() {
691
692
  const w = m.value;
692
693
  if (!w) return 0;
693
- const T = ct(w), D = getComputedStyle(T), rt = parseFloat(D.paddingTop) || 0, It = parseFloat(D.paddingBottom) || 0, H = parseFloat(D.borderTopWidth) || 0, Nt = T === document.documentElement, oe = Nt ? Math.max(0, window.innerHeight - rt - It) : Math.max(0, T.clientHeight - rt - It), le = Nt ? rt : T.getBoundingClientRect().top + H + rt, ae = Nt ? window.scrollY || 0 : T.scrollTop, J = w.getBoundingClientRect().top - le + ae;
694
+ const T = ct(w), I = getComputedStyle(T), rt = parseFloat(I.paddingTop) || 0, Dt = parseFloat(I.paddingBottom) || 0, H = parseFloat(I.borderTopWidth) || 0, Nt = T === document.documentElement, oe = Nt ? Math.max(0, window.innerHeight - rt - Dt) : Math.max(0, T.clientHeight - rt - Dt), le = Nt ? rt : T.getBoundingClientRect().top + H + rt, ae = Nt ? window.scrollY || 0 : T.scrollTop, J = w.getBoundingClientRect().top - le + ae;
694
695
  return Math.max(0, Math.floor(oe - J));
695
696
  }
696
697
  function Y() {
697
- if (!a.active.value || !m.value) return;
698
- const w = W();
699
- w > 0 && Math.abs(w - g.value) > 1 && (g.value = w);
698
+ if (!l.active.value || !m.value) return;
699
+ const w = G();
700
+ w > 0 && Math.abs(w - _.value) > 1 && (_.value = w);
700
701
  }
701
702
  function ot() {
702
703
  if (!m.value) return;
703
704
  const w = ct(m.value);
704
- _ !== w && (_ = w, y?.disconnect(), y = null), Y(), !(y || typeof ResizeObserver > "u") && (y = new ResizeObserver(() => Y()), y.observe(w));
705
+ g !== w && (g = w, y?.disconnect(), y = null), Y(), !(y || typeof ResizeObserver > "u") && (y = new ResizeObserver(() => Y()), y.observe(w));
705
706
  }
706
- return Pt(f, () => ft()), Pt(U, () => {
707
- v.value = 0, g.value = 0, ot();
707
+ return Pt(f, () => bt()), Pt(z, () => {
708
+ v.value = 0, _.value = 0, ot();
708
709
  }, { flush: "post" }), Pt(() => s.uuid, () => {
709
- Qe().then(() => ot());
710
- }), Pt(() => a.active.value, (w) => {
711
- w && Qe().then(() => {
710
+ tn().then(() => ot());
711
+ }), Pt(() => l.active.value, (w) => {
712
+ w && tn().then(() => {
712
713
  ot();
713
714
  const T = m.value;
714
715
  !T || !T.isConnected || T.offsetParent === null || h.value && T.scrollIntoView({ behavior: "smooth", block: "center" });
715
716
  });
716
717
  }), Pt(() => s.uuid, () => {
717
718
  v.value = 0, c.value = null, qt(!0), h.value = $e() === s.uuid, xt();
718
- }), rn(() => {
719
- A = qs(() => void xt()), R = Zs(() => {
719
+ }), dn(() => {
720
+ A = Ys(() => void xt()), O = no(() => {
720
721
  h.value = $e() === s.uuid;
721
722
  }), h.value = $e() === s.uuid, qt(), ot(), xt();
722
- }), dn(() => {
723
- y?.disconnect(), y = null, A?.(), A = null, R?.(), R = null, C?.(), C = null, E?.(), E = null;
723
+ }), pn(() => {
724
+ y?.disconnect(), y = null, A?.(), A = null, O?.(), O = null, C?.(), C = null, E?.(), E = null;
724
725
  }), (w, T) => (d(), p("div", {
725
726
  ref_key: "el",
726
727
  ref: m,
727
728
  class: K(["mb", { "mb--admin": it(u), "mb--lit": it(u) && h.value }]),
728
- style: pn(Dt.value),
729
+ style: fn(It.value),
729
730
  "data-magic-block": o.uuid,
730
731
  "data-magic-module": o.module
731
732
  }, [
@@ -734,64 +735,128 @@ const eo = ["data-magic-block", "data-magic-module"], no = ["srcdoc", "title"],
734
735
  ref_key: "frame",
735
736
  ref: f,
736
737
  class: "mb__frame",
737
- srcdoc: U.value,
738
+ srcdoc: z.value,
738
739
  title: P.value,
739
740
  scrolling: "no",
740
741
  sandbox: "allow-scripts allow-forms allow-modals allow-popups allow-downloads"
741
- }, null, 8, no)) : (d(), p("div", {
742
+ }, null, 8, io)) : (d(), p("div", {
742
743
  key: 1,
743
- class: K(["mb__empty", { "mb__empty--off": z.value === "invalid", "mb__empty--draft": z.value === "draft" }]),
744
- onClick: O
744
+ class: K(["mb__empty", { "mb__empty--off": U.value === "invalid", "mb__empty--draft": U.value === "draft" }]),
745
+ onClick: R
745
746
  }, [
746
- l("p", so, b(Z.value), 1),
747
- l("p", oo, b(X.value), 1),
748
- z.value === "invalid" && yt.value ? (d(), p("p", lo, b(yt.value), 1)) : k("", !0),
749
- z.value === "invalid" && kt.value.length > 0 ? (d(), p("ul", ao, [
750
- (d(!0), p(M, null, N(kt.value, (D, rt) => (d(), p("li", {
747
+ a("p", uo, b(Z.value), 1),
748
+ a("p", co, b(X.value), 1),
749
+ U.value === "invalid" && yt.value ? (d(), p("p", ro, b(yt.value), 1)) : k("", !0),
750
+ U.value === "invalid" && kt.value.length > 0 ? (d(), p("ul", po, [
751
+ (d(!0), p(M, null, N(kt.value, (I, rt) => (d(), p("li", {
751
752
  key: rt,
752
753
  class: "mb__issue"
753
- }, b(D.message), 1))), 128))
754
+ }, b(I.message), 1))), 128))
754
755
  ])) : k("", !0),
755
- l("button", {
756
+ a("button", {
756
757
  class: "mb__go",
757
758
  type: "button",
758
759
  onClick: Ee(Kt, ["stop"])
759
760
  }, "去控制台")
760
761
  ], 2)),
761
- it(u) ? (d(), p("span", io)) : k("", !0),
762
+ it(u) ? (d(), p("span", fo)) : k("", !0),
762
763
  it(u) && $t.value ? (d(), p(M, { key: 3 }, [
763
- l("button", {
764
+ a("button", {
764
765
  class: "mb__grab mb__grab--top",
765
766
  type: "button",
766
767
  title: V.value,
767
768
  "aria-label": V.value,
768
- onClick: O
769
- }, null, 8, uo),
770
- l("button", {
769
+ onClick: R
770
+ }, null, 8, bo),
771
+ a("button", {
771
772
  class: "mb__grab mb__grab--right",
772
773
  type: "button",
773
774
  title: V.value,
774
775
  "aria-label": V.value,
775
- onClick: O
776
- }, null, 8, co),
777
- l("button", {
776
+ onClick: R
777
+ }, null, 8, mo),
778
+ a("button", {
778
779
  class: "mb__grab mb__grab--bottom",
779
780
  type: "button",
780
781
  title: V.value,
781
782
  "aria-label": V.value,
782
- onClick: O
783
- }, null, 8, ro),
784
- l("button", {
783
+ onClick: R
784
+ }, null, 8, vo),
785
+ a("button", {
785
786
  class: "mb__grab mb__grab--left",
786
787
  type: "button",
787
788
  title: V.value,
788
789
  "aria-label": V.value,
789
- onClick: O
790
- }, null, 8, po)
790
+ onClick: R
791
+ }, null, 8, ho)
791
792
  ], 64)) : k("", !0)
792
- ], 14, eo));
793
+ ], 14, ao));
793
794
  }
794
- }), fo = /* @__PURE__ */ vn(bo, [["__scopeId", "data-v-8e1e849f"]]), mo = /* @__PURE__ */ Pe({
795
+ }), _o = /* @__PURE__ */ hn(go, [["__scopeId", "data-v-8e1e849f"]]);
796
+ function ht(o) {
797
+ return typeof o == "string" ? o.trim() : "";
798
+ }
799
+ function Tn(o) {
800
+ const s = ht(o?.meta?.blockUuid);
801
+ if (s) return s;
802
+ const l = o?.props;
803
+ if (!l || typeof l != "object" || Array.isArray(l)) return "";
804
+ const i = l.default;
805
+ return !i || typeof i != "object" || Array.isArray(i) ? "" : ht(i.uuid);
806
+ }
807
+ function yo(o, s) {
808
+ const l = [], i = /* @__PURE__ */ new Set();
809
+ for (const u of o ?? []) {
810
+ if (!u || u.redirect || u.components?.default !== s) continue;
811
+ const m = Tn(u);
812
+ if (!m || i.has(m)) continue;
813
+ i.add(m);
814
+ const f = ht(u.path), c = ht(u.meta?.title) || ht(u.meta?.sub) || f;
815
+ l.push({ uuid: m, path: f, title: c, module: ht(u.meta?.module), brief: ht(u.meta?.brief) });
816
+ }
817
+ return l;
818
+ }
819
+ function ko(o, s, l) {
820
+ const i = /* @__PURE__ */ new Set();
821
+ for (const u of l ?? []) i.add(ht(u));
822
+ return yo(o, s).filter((u) => !i.has(u.uuid));
823
+ }
824
+ const Bn = "__labullBlockPage";
825
+ function $o(o) {
826
+ return typeof o == "object" && o !== null && o[Bn] === !0;
827
+ }
828
+ const un = '块标签里的东西(标题 / 按钮 / 参数展示 / 第二块区域)全部写进块自己的 index.open.html:页面这一层只回答"哪条地址是哪个块"。';
829
+ function wo(o, s) {
830
+ const l = o?.components?.default;
831
+ return l == null ? !1 : $o(l) ? !0 : s != null && l === s;
832
+ }
833
+ function xo(o, s) {
834
+ const l = [];
835
+ if (!o || o.length === 0) return l;
836
+ const i = o[o.length - 1], u = ht(i?.path);
837
+ if (o.findIndex((c) => wo(c, s)) !== o.length - 1)
838
+ return l.push({
839
+ code: "wrapped",
840
+ path: u,
841
+ message: `这条路由(${u || "拿不到路径"})渲染的不是块页本身:块页被包在别的组件里(包装页 / 渲染函数),或者被当成了某一层的布局。${un}`
842
+ }), l;
843
+ o.length > 1 && l.push({
844
+ code: "nested",
845
+ path: u,
846
+ message: `块路由(${u})挂在别的路由下面:父级 template 里除了 <RouterView> 还有别的东西。块路由必须是顶层那一条。`
847
+ });
848
+ const f = Object.keys(i?.components ?? {}).filter((c) => c !== "default");
849
+ return f.length > 0 && l.push({
850
+ code: "extra-views",
851
+ path: u,
852
+ message: `这条路由(${u})除了默认视图还挂了具名视图(${f.join(" / ")})—— 那正是"在块旁边摆第二块内容"。${un}`
853
+ }), Tn(i) || l.push({
854
+ code: "no-uuid",
855
+ path: u,
856
+ message: `这条路由(${u})挂了块页却没说这是哪个块:写 meta.blockUuid(推荐)或 props: { uuid },否则这一页渲染出来是"未开发"。`
857
+ }), l;
858
+ }
859
+ const Mn = /* @__PURE__ */ je({
795
860
  __name: "MagicBlockPage",
796
861
  props: {
797
862
  uuid: { default: "" },
@@ -800,11 +865,16 @@ const eo = ["data-magic-block", "data-magic-module"], no = ["srcdoc", "title"],
800
865
  theme: { type: Boolean, default: !0 }
801
866
  },
802
867
  setup(o) {
803
- const s = o, a = ps(), i = j(() => {
804
- const u = a.meta?.blockUuid;
805
- return typeof u == "string" && u.trim() ? u.trim() : s.uuid;
806
- });
807
- return (u, m) => (d(), cs(fo, {
868
+ const s = o, l = hs(), i = j(() => {
869
+ const f = l.meta?.blockUuid;
870
+ return typeof f == "string" && f.trim() ? f.trim() : s.uuid;
871
+ }), u = fs()?.type, m = xo(l.matched, u);
872
+ if (m.length > 0) {
873
+ const f = m.map((c) => `[labull] ${c.message}`).join(`
874
+ `);
875
+ console.error(f);
876
+ }
877
+ return (f, c) => (d(), bs(_o, {
808
878
  uuid: i.value,
809
879
  name: o.name,
810
880
  module: o.module,
@@ -815,63 +885,63 @@ const eo = ["data-magic-block", "data-magic-module"], no = ["srcdoc", "title"],
815
885
  function _t(o) {
816
886
  return String(o ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
817
887
  }
818
- function vo(o) {
888
+ function Co(o) {
819
889
  return /^(https?:\/\/|mailto:|\/(?!\/))/i.test(String(o ?? "").trim());
820
890
  }
821
891
  function Lt(o) {
822
892
  const s = String(o ?? "");
823
- let a = "", i = 0;
893
+ let l = "", i = 0;
824
894
  for (; i < s.length; ) {
825
895
  const u = s.slice(i), m = /^`([^`]+)`/.exec(u);
826
896
  if (m) {
827
- a += `<code>${_t(m[1])}</code>`, i += m[0].length;
897
+ l += `<code>${_t(m[1])}</code>`, i += m[0].length;
828
898
  continue;
829
899
  }
830
900
  const f = /^!\[[^\]]*\]\([^)\s]*\)/.exec(u);
831
901
  if (f) {
832
- a += _t(f[0]), i += f[0].length;
902
+ l += _t(f[0]), i += f[0].length;
833
903
  continue;
834
904
  }
835
905
  const c = /^\[([^\]]*)\]\(([^)\s]*)\)/.exec(u);
836
- if (c && vo(c[2])) {
837
- a += `<a href="${_t(c[2])}" target="_blank" rel="noopener noreferrer">${Lt(c[1])}</a>`, i += c[0].length;
906
+ if (c && Co(c[2])) {
907
+ l += `<a href="${_t(c[2])}" target="_blank" rel="noopener noreferrer">${Lt(c[1])}</a>`, i += c[0].length;
838
908
  continue;
839
909
  }
840
910
  const h = /^\*\*([^*]+)\*\*/.exec(u);
841
911
  if (h) {
842
- a += `<strong>${_t(h[1])}</strong>`, i += h[0].length;
912
+ l += `<strong>${_t(h[1])}</strong>`, i += h[0].length;
843
913
  continue;
844
914
  }
845
915
  const v = /^\*([^*\n]+)\*/.exec(u) ?? /^_([^_\n]+)_/.exec(u);
846
916
  if (v) {
847
- a += `<em>${_t(v[1])}</em>`, i += v[0].length;
917
+ l += `<em>${_t(v[1])}</em>`, i += v[0].length;
848
918
  continue;
849
919
  }
850
- a += _t(s[i]), i += 1;
920
+ l += _t(s[i]), i += 1;
851
921
  }
852
- return a;
922
+ return l;
853
923
  }
854
- function ho(o) {
924
+ function So(o) {
855
925
  const s = String(o ?? "").replace(/\r\n?/g, `
856
926
  `).split(`
857
- `), a = [];
927
+ `), l = [];
858
928
  let i = "", u = [], m = [], f = !1, c = [];
859
929
  const h = () => {
860
- u.length > 0 && (a.push(`<p>${u.map((E) => Lt(E)).join("<br>")}</p>`), u = []);
930
+ u.length > 0 && (l.push(`<p>${u.map((E) => Lt(E)).join("<br>")}</p>`), u = []);
861
931
  }, v = () => {
862
- m.length > 0 && (a.push(`<blockquote>${m.map((E) => Lt(E)).join("<br>")}</blockquote>`), m = []);
863
- }, g = () => {
864
- i && (a.push(`</${i}>`), i = "");
932
+ m.length > 0 && (l.push(`<blockquote>${m.map((E) => Lt(E)).join("<br>")}</blockquote>`), m = []);
865
933
  }, _ = () => {
866
- h(), v(), g();
934
+ i && (l.push(`</${i}>`), i = "");
935
+ }, g = () => {
936
+ h(), v(), _();
867
937
  }, y = (E) => {
868
- i !== E && (g(), a.push(`<${E}>`), i = E);
938
+ i !== E && (_(), l.push(`<${E}>`), i = E);
869
939
  };
870
940
  for (const E of s) {
871
941
  const A = E.replace(/\s+$/, "");
872
942
  if (/^\s*```/.test(A)) {
873
- f ? (a.push(`<pre><code>${_t(c.join(`
874
- `))}</code></pre>`), c = [], f = !1) : (_(), f = !0);
943
+ f ? (l.push(`<pre><code>${_t(c.join(`
944
+ `))}</code></pre>`), c = [], f = !1) : (g(), f = !0);
875
945
  continue;
876
946
  }
877
947
  if (f) {
@@ -879,95 +949,67 @@ function ho(o) {
879
949
  continue;
880
950
  }
881
951
  if (!A.trim()) {
882
- _();
952
+ g();
883
953
  continue;
884
954
  }
885
955
  const C = /^(#{1,6})\s+(.*)$/.exec(A);
886
956
  if (C) {
887
- _();
957
+ g();
888
958
  const Z = C[1].length;
889
- a.push(`<h${Z}>${Lt(C[2])}</h${Z}>`);
959
+ l.push(`<h${Z}>${Lt(C[2])}</h${Z}>`);
890
960
  continue;
891
961
  }
892
962
  if (/^\s*(-{3,}|\*{3,}|_{3,})\s*$/.test(A)) {
893
- _(), a.push("<hr>");
963
+ g(), l.push("<hr>");
894
964
  continue;
895
965
  }
896
- const R = /^\s*[-*+]\s+(.*)$/.exec(A);
897
- if (R) {
898
- h(), v(), y("ul"), a.push(`<li>${Lt(R[1])}</li>`);
966
+ const O = /^\s*[-*+]\s+(.*)$/.exec(A);
967
+ if (O) {
968
+ h(), v(), y("ul"), l.push(`<li>${Lt(O[1])}</li>`);
899
969
  continue;
900
970
  }
901
971
  const P = /^\s*\d+[.)]\s+(.*)$/.exec(A);
902
972
  if (P) {
903
- h(), v(), y("ol"), a.push(`<li>${Lt(P[1])}</li>`);
973
+ h(), v(), y("ol"), l.push(`<li>${Lt(P[1])}</li>`);
904
974
  continue;
905
975
  }
906
- const z = /^\s*>\s?(.*)$/.exec(A);
907
- if (z) {
908
- h(), g(), m.push(z[1]);
976
+ const U = /^\s*>\s?(.*)$/.exec(A);
977
+ if (U) {
978
+ h(), _(), m.push(U[1]);
909
979
  continue;
910
980
  }
911
- v(), g(), u.push(A);
981
+ v(), _(), u.push(A);
912
982
  }
913
- return f && a.push(`<pre><code>${_t(c.join(`
914
- `))}</code></pre>`), _(), a.join("");
983
+ return f && l.push(`<pre><code>${_t(c.join(`
984
+ `))}</code></pre>`), g(), l.join("");
915
985
  }
916
- function un(o, s = 120) {
986
+ function cn(o, s = 120) {
917
987
  const i = (String(o ?? "").replace(/\r\n?/g, `
918
988
  `).split(`
919
989
  `).map((u) => u.trim()).find((u) => u.length > 0) ?? "").replace(/^#{1,6}\s+/, "").replace(/^\s*[-*+]\s+/, "").replace(/^\s*\d+[.)]\s+/, "").replace(/^>\s?/, "").replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/_([^_]+)_/g, "$1").replace(/\s+/g, " ").trim();
920
990
  return i.length > s ? `${i.slice(0, s)}…` : i;
921
991
  }
922
- function gt(o) {
923
- return typeof o == "string" ? o.trim() : "";
924
- }
925
- function _o(o) {
926
- const s = gt(o?.meta?.blockUuid);
927
- if (s) return s;
928
- const a = o?.props;
929
- if (!a || typeof a != "object" || Array.isArray(a)) return "";
930
- const i = a.default;
931
- return !i || typeof i != "object" || Array.isArray(i) ? "" : gt(i.uuid);
932
- }
933
- function go(o, s) {
934
- const a = [], i = /* @__PURE__ */ new Set();
935
- for (const u of o ?? []) {
936
- if (!u || u.redirect || u.components?.default !== s) continue;
937
- const m = _o(u);
938
- if (!m || i.has(m)) continue;
939
- i.add(m);
940
- const f = gt(u.path), c = gt(u.meta?.title) || gt(u.meta?.sub) || f;
941
- a.push({ uuid: m, path: f, title: c, module: gt(u.meta?.module), brief: gt(u.meta?.brief) });
942
- }
943
- return a;
944
- }
945
- function yo(o, s, a) {
946
- const i = /* @__PURE__ */ new Set();
947
- for (const u of a ?? []) i.add(gt(u));
948
- return go(o, s).filter((u) => !i.has(u.uuid));
949
- }
950
992
  const we = "pages.lock.ts";
951
- function ko(o, s) {
952
- const a = String(o || "").split(/[^A-Za-z0-9]+/).filter(Boolean);
953
- if (a.length === 0) return `Page${s + 1}`;
954
- const i = a.map((u) => u[0].toUpperCase() + u.slice(1)).join("");
993
+ function Eo(o, s) {
994
+ const l = String(o || "").split(/[^A-Za-z0-9]+/).filter(Boolean);
995
+ if (l.length === 0) return `Page${s + 1}`;
996
+ const i = l.map((u) => u[0].toUpperCase() + u.slice(1)).join("");
955
997
  return /^[0-9]/.test(i) ? `P${i}` : i;
956
998
  }
957
- function $o(o, s) {
999
+ function To(o, s) {
958
1000
  if (!s.has(o))
959
1001
  return s.add(o), o;
960
- let a = 2;
961
- for (; s.has(`${o}${a}`); ) a += 1;
962
- const i = `${o}${a}`;
1002
+ let l = 2;
1003
+ for (; s.has(`${o}${l}`); ) l += 1;
1004
+ const i = `${o}${l}`;
963
1005
  return s.add(i), i;
964
1006
  }
965
- function wo(o) {
966
- const s = (o ?? []).filter((m) => m && typeof m.path == "string" && m.path.trim() !== ""), a = /* @__PURE__ */ new Set(), i = [];
1007
+ function Bo(o) {
1008
+ const s = (o ?? []).filter((m) => m && typeof m.path == "string" && m.path.trim() !== ""), l = /* @__PURE__ */ new Set(), i = [];
967
1009
  s.forEach((m, f) => {
968
1010
  const c = m.group?.trim() || "(没写 meta.group)";
969
1011
  let h = i.find((v) => v.title === c);
970
- h || (h = { title: c, rows: [] }, i.push(h)), h.rows.push({ key: $o(ko(m.path, f), a), row: m });
1012
+ h || (h = { title: c, rows: [] }, i.push(h)), h.rows.push({ key: To(Eo(m.path, f), l), row: m });
971
1013
  });
972
1014
  const u = [
973
1015
  "/* 生成物:**每次导出都会重写**,别手改 —— 改了下次导出就没了。",
@@ -1060,12 +1102,12 @@ function wo(o) {
1060
1102
  ), u.join(`
1061
1103
  `);
1062
1104
  }
1063
- function En() {
1105
+ function An() {
1064
1106
  return typeof window < "u" && typeof window.showDirectoryPicker == "function";
1065
1107
  }
1066
- const xo = "这个浏览器没法直接写你本机的文件夹(少了 File System Access API):请用 Chrome / Edge,并且从 https 或 http://localhost 打开这个页面(内网 http 会更少 API)。";
1108
+ const Mo = "这个浏览器没法直接写你本机的文件夹(少了 File System Access API):请用 Chrome / Edge,并且从 https 或 http://localhost 打开这个页面(内网 http 会更少 API)。";
1067
1109
  async function xe() {
1068
- if (!En()) throw new Error(xo);
1110
+ if (!An()) throw new Error(Mo);
1069
1111
  try {
1070
1112
  const o = await window.showDirectoryPicker({ mode: "readwrite", id: "labull-magic-block" });
1071
1113
  return { name: o.name, handle: o };
@@ -1077,156 +1119,156 @@ async function xe() {
1077
1119
  function se(o) {
1078
1120
  return (o instanceof Error ? o.message.trim() : String(o)) || "没有说原因";
1079
1121
  }
1080
- function Le(o) {
1122
+ function Ie(o) {
1081
1123
  const s = String(o ?? "").split("/");
1082
- for (const a of s)
1083
- if (!a || a === "." || a === ".." || a.includes("\\") || /^[A-Za-z]:/.test(a))
1124
+ for (const l of s)
1125
+ if (!l || l === "." || l === ".." || l.includes("\\") || /^[A-Za-z]:/.test(l))
1084
1126
  throw new Error(`路径不合法:${o}(要相对路径,不许 .. / 盘符 / 反斜杠)`);
1085
1127
  return s;
1086
1128
  }
1087
- function Co(o) {
1129
+ function Ao(o) {
1088
1130
  const s = String(o ?? "");
1089
- let a = 3735928559, i = 1103547991;
1131
+ let l = 3735928559, i = 1103547991;
1090
1132
  for (let u = 0; u < s.length; u += 1) {
1091
1133
  const m = s.charCodeAt(u);
1092
- a = Math.imul(a ^ m, 2654435761), i = Math.imul(i ^ m, 1597334677);
1134
+ l = Math.imul(l ^ m, 2654435761), i = Math.imul(i ^ m, 1597334677);
1093
1135
  }
1094
- return a = Math.imul(a ^ a >>> 16, 2246822507) ^ Math.imul(i ^ i >>> 13, 3266489909), i = Math.imul(i ^ i >>> 16, 2246822507) ^ Math.imul(a ^ a >>> 13, 3266489909), `${(4294967296 * (2097151 & i) + (a >>> 0)).toString(36)}:${s.length}`;
1136
+ return l = Math.imul(l ^ l >>> 16, 2246822507) ^ Math.imul(i ^ i >>> 13, 3266489909), i = Math.imul(i ^ i >>> 16, 2246822507) ^ Math.imul(l ^ l >>> 13, 3266489909), `${(4294967296 * (2097151 & i) + (l >>> 0)).toString(36)}:${s.length}`;
1095
1137
  }
1096
- const So = 8;
1097
- async function ht(o, s) {
1098
- let a = 0;
1138
+ const Oo = 8;
1139
+ async function gt(o, s) {
1140
+ let l = 0;
1099
1141
  const i = async () => {
1100
1142
  for (; ; ) {
1101
- const u = a;
1102
- if (a += 1, u >= o.length) return;
1143
+ const u = l;
1144
+ if (l += 1, u >= o.length) return;
1103
1145
  await s(o[u], u);
1104
1146
  }
1105
1147
  };
1106
- await Promise.all(Array.from({ length: Math.max(1, Math.min(So, o.length)) }, () => i()));
1148
+ await Promise.all(Array.from({ length: Math.max(1, Math.min(Oo, o.length)) }, () => i()));
1107
1149
  }
1108
- function Eo(o) {
1150
+ function Ro(o) {
1109
1151
  const s = /* @__PURE__ */ new Map();
1110
- return (a) => {
1111
- const i = a.join("\0"), u = s.get(i);
1152
+ return (l) => {
1153
+ const i = l.join("\0"), u = s.get(i);
1112
1154
  if (u) return u;
1113
1155
  let m = Promise.resolve(o);
1114
- for (let f = 0; f < a.length; f += 1) {
1115
- const c = a[f], h = a.slice(0, f + 1).join("\0"), v = s.get(h);
1116
- m = v ?? m.then((g) => g.getDirectoryHandle(c, { create: !0 })), v || s.set(h, m);
1156
+ for (let f = 0; f < l.length; f += 1) {
1157
+ const c = l[f], h = l.slice(0, f + 1).join("\0"), v = s.get(h);
1158
+ m = v ?? m.then((_) => _.getDirectoryHandle(c, { create: !0 })), v || s.set(h, m);
1117
1159
  }
1118
1160
  return m;
1119
1161
  };
1120
1162
  }
1121
- async function To(o, s, a) {
1163
+ async function Po(o, s, l) {
1122
1164
  try {
1123
- return await (await (await o.getFileHandle(s)).getFile()).text() === a;
1165
+ return await (await (await o.getFileHandle(s)).getFile()).text() === l;
1124
1166
  } catch {
1125
1167
  return !1;
1126
1168
  }
1127
1169
  }
1128
- async function Bo(o, s, a, i = {}) {
1129
- const u = Object.entries(s ?? {}).map(([C, R]) => {
1130
- const P = String(R ?? "");
1131
- return { path: C, parts: Le(C), body: P, digest: Co(P) };
1132
- }), m = u.length, f = [], c = Eo(o.handle), h = i.verify === !0, v = i.trust, g = i.existing, _ = /* @__PURE__ */ new Map();
1170
+ async function jo(o, s, l, i = {}) {
1171
+ const u = Object.entries(s ?? {}).map(([C, O]) => {
1172
+ const P = String(O ?? "");
1173
+ return { path: C, parts: Ie(C), body: P, digest: Ao(P) };
1174
+ }), m = u.length, f = [], c = Ro(o.handle), h = i.verify === !0, v = i.trust, _ = i.existing, g = /* @__PURE__ */ new Map();
1133
1175
  let y = 0, E = 0, A = 0;
1134
- return a?.(0, m), await ht(u, async (C) => {
1176
+ return l?.(0, m), await gt(u, async (C) => {
1135
1177
  try {
1136
- if (v?.get(C.path) === C.digest && (g?.has(C.path) ?? !1))
1137
- A += 1, _.set(C.path, C.digest);
1178
+ if (v?.get(C.path) === C.digest && (_?.has(C.path) ?? !1))
1179
+ A += 1, g.set(C.path, C.digest);
1138
1180
  else {
1139
- const R = await c(C.parts.slice(0, -1)), P = C.parts[C.parts.length - 1];
1140
- if (h && await To(R, P, C.body))
1141
- E += 1, _.set(C.path, C.digest);
1181
+ const O = await c(C.parts.slice(0, -1)), P = C.parts[C.parts.length - 1];
1182
+ if (h && await Po(O, P, C.body))
1183
+ E += 1, g.set(C.path, C.digest);
1142
1184
  else {
1143
- const Z = await (await R.getFileHandle(P, { create: !0 })).createWritable();
1185
+ const Z = await (await O.getFileHandle(P, { create: !0 })).createWritable();
1144
1186
  try {
1145
1187
  await Z.write(C.body);
1146
1188
  } finally {
1147
1189
  await Z.close();
1148
1190
  }
1149
- y += 1, _.set(C.path, C.digest);
1191
+ y += 1, g.set(C.path, C.digest);
1150
1192
  }
1151
1193
  }
1152
- } catch (R) {
1153
- f.push({ path: C.path, message: se(R) });
1194
+ } catch (O) {
1195
+ f.push({ path: C.path, message: se(O) });
1154
1196
  }
1155
- a?.(y + E + A + f.length, m);
1156
- }), f.sort((C, R) => C.path < R.path ? -1 : C.path > R.path ? 1 : 0), { written: y, failed: f, total: m, skipped: E, trusted: A, fingerprints: _ };
1197
+ l?.(y + E + A + f.length, m);
1198
+ }), f.sort((C, O) => C.path < O.path ? -1 : C.path > O.path ? 1 : 0), { written: y, failed: f, total: m, skipped: E, trusted: A, fingerprints: g };
1157
1199
  }
1158
1200
  async function Ce(o, s) {
1159
- const a = { items: [], topCount: 0, files: 0, dirs: 0 }, i = async (f, c) => {
1201
+ const l = { items: [], topCount: 0, files: 0, dirs: 0 }, i = async (f, c) => {
1160
1202
  const h = [];
1161
1203
  for (const v of await At(f)) {
1162
1204
  if (v.kind === "file") {
1163
- a.files += 1;
1205
+ l.files += 1;
1164
1206
  continue;
1165
1207
  }
1166
- a.dirs += 1, !(c >= s.maxDepth) && (s.skipDirs.includes(v.name) || h.push(v));
1208
+ l.dirs += 1, !(c >= s.maxDepth) && (s.skipDirs.includes(v.name) || h.push(v));
1167
1209
  }
1168
- await ht(h, (v) => i(v, c + 1));
1210
+ await gt(h, (v) => i(v, c + 1));
1169
1211
  }, u = await At(o.handle), m = [];
1170
1212
  for (const f of u)
1171
- if (a.items.push({ name: f.name, dir: f.kind === "directory" }), f.kind === "file") a.files += 1;
1213
+ if (l.items.push({ name: f.name, dir: f.kind === "directory" }), f.kind === "file") l.files += 1;
1172
1214
  else {
1173
- if (a.dirs += 1, s.skipDirs.includes(f.name) || s.maxDepth <= 0) continue;
1215
+ if (l.dirs += 1, s.skipDirs.includes(f.name) || s.maxDepth <= 0) continue;
1174
1216
  m.push(f);
1175
1217
  }
1176
- return await ht(m, (f) => i(f, 1)), a.topCount = a.items.length, a;
1218
+ return await gt(m, (f) => i(f, 1)), l.topCount = l.items.length, l;
1177
1219
  }
1178
- async function Mo(o) {
1220
+ async function Lo(o) {
1179
1221
  const s = [];
1180
1222
  for (const i of await At(o.handle)) s.push(i.name);
1181
- let a = 0;
1182
- return await ht(s, async (i) => {
1183
- await o.handle.removeEntry(i, { recursive: !0 }), a += 1;
1184
- }), a;
1223
+ let l = 0;
1224
+ return await gt(s, async (i) => {
1225
+ await o.handle.removeEntry(i, { recursive: !0 }), l += 1;
1226
+ }), l;
1185
1227
  }
1186
- async function Ao(o, s) {
1187
- const { wantedFiles: a, wantedDirs: i } = Tn(s), u = /* @__PURE__ */ new Set();
1228
+ async function Io(o, s) {
1229
+ const { wantedFiles: l, wantedDirs: i } = On(s), u = /* @__PURE__ */ new Set();
1188
1230
  let m = 0;
1189
1231
  const f = async (c, h) => {
1190
- const v = [], g = [];
1191
- for (const _ of await At(c)) {
1192
- const y = h ? `${h}/${_.name}` : _.name;
1193
- if (_.kind === "file") {
1194
- a.has(y) ? u.add(y) : v.push(_.name);
1232
+ const v = [], _ = [];
1233
+ for (const g of await At(c)) {
1234
+ const y = h ? `${h}/${g.name}` : g.name;
1235
+ if (g.kind === "file") {
1236
+ l.has(y) ? u.add(y) : v.push(g.name);
1195
1237
  continue;
1196
1238
  }
1197
- i.has(y) ? g.push([y, _]) : v.push(_.name);
1239
+ i.has(y) ? _.push([y, g]) : v.push(g.name);
1198
1240
  }
1199
- await ht(v, async (_) => {
1200
- await c.removeEntry(_, { recursive: !0 }), m += 1;
1201
- }), await ht(g, ([_, y]) => f(y, _));
1241
+ await gt(v, async (g) => {
1242
+ await c.removeEntry(g, { recursive: !0 }), m += 1;
1243
+ }), await gt(_, ([g, y]) => f(y, g));
1202
1244
  };
1203
1245
  return await f(o.handle, ""), { removed: m, existing: u };
1204
1246
  }
1205
- function Tn(o) {
1206
- const s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
1247
+ function On(o) {
1248
+ const s = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
1207
1249
  for (const i of Object.keys(o ?? {})) {
1208
- const u = Le(i);
1250
+ const u = Ie(i);
1209
1251
  s.add(u.join("/"));
1210
- for (let m = 1; m < u.length; m += 1) a.add(u.slice(0, m).join("/"));
1252
+ for (let m = 1; m < u.length; m += 1) l.add(u.slice(0, m).join("/"));
1211
1253
  }
1212
- return { wantedFiles: s, wantedDirs: a };
1254
+ return { wantedFiles: s, wantedDirs: l };
1213
1255
  }
1214
- async function Ro(o, s) {
1215
- const { wantedFiles: a, wantedDirs: i } = Tn(s), u = /* @__PURE__ */ new Set(), m = async (f, c) => {
1256
+ async function Do(o, s) {
1257
+ const { wantedFiles: l, wantedDirs: i } = On(s), u = /* @__PURE__ */ new Set(), m = async (f, c) => {
1216
1258
  const h = [];
1217
1259
  for (const v of await At(f)) {
1218
- const g = c ? `${c}/${v.name}` : v.name;
1260
+ const _ = c ? `${c}/${v.name}` : v.name;
1219
1261
  if (v.kind === "file") {
1220
- a.has(g) && u.add(g);
1262
+ l.has(_) && u.add(_);
1221
1263
  continue;
1222
1264
  }
1223
- i.has(g) && h.push([g, v]);
1265
+ i.has(_) && h.push([_, v]);
1224
1266
  }
1225
- await ht(h, ([v, g]) => m(g, v));
1267
+ await gt(h, ([v, _]) => m(_, v));
1226
1268
  };
1227
1269
  return await m(o.handle, ""), u;
1228
1270
  }
1229
- function Oo(o, s) {
1271
+ function No(o, s) {
1230
1272
  if (o.name === s.blocksDir)
1231
1273
  throw new Error(
1232
1274
  `你选中的是「${s.blocksDir}」这一层(它就是放代码的那一层):导出会铺成 ${s.blocksDir}/${s.blocksDir}/…。请选它**上面**那一层 —— 也就是开发目录本身。`
@@ -1234,51 +1276,51 @@ function Oo(o, s) {
1234
1276
  }
1235
1277
  async function At(o) {
1236
1278
  const s = [];
1237
- for await (const a of o.values()) s.push(a);
1238
- return s.sort((a, i) => a.name < i.name ? -1 : a.name > i.name ? 1 : 0), s;
1279
+ for await (const l of o.values()) s.push(l);
1280
+ return s.sort((l, i) => l.name < i.name ? -1 : l.name > i.name ? 1 : 0), s;
1239
1281
  }
1240
- function Po(o) {
1282
+ function Fo(o) {
1241
1283
  return o.charCodeAt(0) === 65279 ? o.slice(1) : o;
1242
1284
  }
1243
- function jo(o) {
1285
+ function Uo(o) {
1244
1286
  const s = o.lastIndexOf(".");
1245
1287
  return s <= 0 ? "" : o.slice(s).toLowerCase();
1246
1288
  }
1247
- const Lo = { folders: [], failures: [], truncated: !1 };
1248
- async function Bn(o, s, a) {
1289
+ const zo = { folders: [], failures: [], truncated: !1 };
1290
+ async function Rn(o, s, l) {
1249
1291
  const i = await At(o), u = new Array(i.length);
1250
- await ht(i, async (c, h) => {
1251
- const v = s ? `${s}/${c.name}` : c.name, g = { files: {}, failures: [] };
1252
- if (u[h] = g, c.kind === "directory") {
1253
- if (a.skipDirs.includes(c.name)) return;
1254
- const y = await Bn(c, v, a);
1292
+ await gt(i, async (c, h) => {
1293
+ const v = s ? `${s}/${c.name}` : c.name, _ = { files: {}, failures: [] };
1294
+ if (u[h] = _, c.kind === "directory") {
1295
+ if (l.skipDirs.includes(c.name)) return;
1296
+ const y = await Rn(c, v, l);
1255
1297
  for (const [E, A] of Object.entries(y.files))
1256
- g.files[`${c.name}/${E}`] = A;
1257
- g.failures.push(...y.failures);
1298
+ _.files[`${c.name}/${E}`] = A;
1299
+ _.failures.push(...y.failures);
1258
1300
  return;
1259
1301
  }
1260
- if (!a.platformFiles.includes(c.name)) {
1261
- if (!a.textExt.includes(jo(c.name))) {
1262
- g.failures.push({
1302
+ if (!l.platformFiles.includes(c.name)) {
1303
+ if (!l.textExt.includes(Uo(c.name))) {
1304
+ _.failures.push({
1263
1305
  kind: "file",
1264
1306
  where: v,
1265
- message: `不是文本文件(认得的扩展名:${a.textExt.join(" ")}),已跳过`
1307
+ message: `不是文本文件(认得的扩展名:${l.textExt.join(" ")}),已跳过`
1266
1308
  });
1267
1309
  return;
1268
1310
  }
1269
1311
  try {
1270
- const _ = await c.getFile();
1271
- if (_.size > a.maxFileBytes) {
1272
- g.failures.push({
1312
+ const g = await c.getFile();
1313
+ if (g.size > l.maxFileBytes) {
1314
+ _.failures.push({
1273
1315
  kind: "file",
1274
1316
  where: v,
1275
- message: `文件 ${Math.round(_.size / 1024)} KB 超过上限 ${Math.floor(a.maxFileBytes / 1024)} KB,已跳过`
1317
+ message: `文件 ${Math.round(g.size / 1024)} KB 超过上限 ${Math.floor(l.maxFileBytes / 1024)} KB,已跳过`
1276
1318
  });
1277
1319
  return;
1278
1320
  }
1279
- g.files[c.name] = Po(await _.text());
1280
- } catch (_) {
1281
- g.failures.push({ kind: "file", where: v, message: `读不了这个文件:${se(_)}` });
1321
+ _.files[c.name] = Fo(await g.text());
1322
+ } catch (g) {
1323
+ _.failures.push({ kind: "file", where: v, message: `读不了这个文件:${se(g)}` });
1282
1324
  }
1283
1325
  }
1284
1326
  });
@@ -1287,186 +1329,186 @@ async function Bn(o, s, a) {
1287
1329
  c && (Object.assign(m, c.files), f.push(...c.failures));
1288
1330
  return { files: m, failures: f };
1289
1331
  }
1290
- async function Mn(o, s, a, i) {
1291
- const u = await At(o), m = u.filter((_) => _.kind === "directory"), f = u.filter((_) => _.kind === "file"), c = s.join("/"), h = { folders: [], failures: [], truncated: !1 };
1292
- if (m.length === 0 || f.some((_) => _.name === i.entry)) {
1293
- const _ = await Bn(o, c, i);
1294
- return h.folders.push({ where: c, files: _.files }), h.failures.push(..._.failures), h;
1332
+ async function Pn(o, s, l, i) {
1333
+ const u = await At(o), m = u.filter((g) => g.kind === "directory"), f = u.filter((g) => g.kind === "file"), c = s.join("/"), h = { folders: [], failures: [], truncated: !1 };
1334
+ if (m.length === 0 || f.some((g) => g.name === i.entry)) {
1335
+ const g = await Rn(o, c, i);
1336
+ return h.folders.push({ where: c, files: g.files }), h.failures.push(...g.failures), h;
1295
1337
  }
1296
- for (const _ of f)
1297
- s.length === 0 && i.rootSkipFiles.includes(_.name.toLowerCase()) || h.failures.push({
1338
+ for (const g of f)
1339
+ s.length === 0 && i.rootSkipFiles.includes(g.name.toLowerCase()) || h.failures.push({
1298
1340
  kind: "file",
1299
- where: [...s, _.name].join("/"),
1341
+ where: [...s, g.name].join("/"),
1300
1342
  message: `这一层直接放着一份文件,但它自己不是块文件夹、也没有 ${i.entry},文件没有归属`
1301
1343
  });
1302
- const v = m.map((_) => async () => i.skipDirs.includes(_.name) ? Lo : a >= i.maxDepth ? {
1344
+ const v = m.map((g) => async () => i.skipDirs.includes(g.name) ? zo : l >= i.maxDepth ? {
1303
1345
  folders: [],
1304
1346
  failures: [{
1305
1347
  kind: "dir",
1306
- where: [...s, _.name].join("/"),
1348
+ where: [...s, g.name].join("/"),
1307
1349
  message: `超过最大层数 ${i.maxDepth} 层还没见到 ${i.entry},没有继续往下找`
1308
1350
  }],
1309
1351
  truncated: !0
1310
- } : Mn(_, [...s, _.name], a + 1, i)), g = new Array(v.length);
1311
- await ht(v, async (_, y) => {
1312
- g[y] = await _();
1352
+ } : Pn(g, [...s, g.name], l + 1, i)), _ = new Array(v.length);
1353
+ await gt(v, async (g, y) => {
1354
+ _[y] = await g();
1313
1355
  });
1314
- for (const _ of g)
1315
- _ && (h.folders.push(..._.folders), h.failures.push(..._.failures), _.truncated && (h.truncated = !0));
1356
+ for (const g of _)
1357
+ g && (h.folders.push(...g.folders), h.failures.push(...g.failures), g.truncated && (h.truncated = !0));
1316
1358
  return h;
1317
1359
  }
1318
- function cn(o) {
1360
+ function rn(o) {
1319
1361
  return o >= 1024 * 1024 ? `${(o / 1024 / 1024).toFixed(1)} MB` : `${Math.max(1, Math.round(o / 1024))} KB`;
1320
1362
  }
1321
- async function Do(o, s) {
1322
- const a = await Mn(o.handle, [], 0, s), i = {
1363
+ async function Ho(o, s) {
1364
+ const l = await Pn(o.handle, [], 0, s), i = {
1323
1365
  root: o.name,
1324
- folders: a.folders,
1325
- failures: a.failures,
1326
- truncated: a.truncated
1366
+ folders: l.folders,
1367
+ failures: l.failures,
1368
+ truncated: l.truncated
1327
1369
  }, u = i.folders.reduce(
1328
1370
  (m, f) => m + Object.values(f.files).reduce((c, h) => c + h.length, 0),
1329
1371
  0
1330
1372
  );
1331
1373
  if (u > s.maxBodyBytes)
1332
1374
  throw new Error(
1333
- `这个目录读到的正文有 ${cn(u)},超过一次读回的上限 ${cn(s.maxBodyBytes)}:请先只留要改的那几个块,或者把大文件挪走。`
1375
+ `这个目录读到的正文有 ${rn(u)},超过一次读回的上限 ${rn(s.maxBodyBytes)}:请先只留要改的那几个块,或者把大文件挪走。`
1334
1376
  );
1335
1377
  return i;
1336
1378
  }
1337
- const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1379
+ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1338
1380
  class: "mbc__tabs",
1339
1381
  role: "tablist"
1340
- }, Uo = ["aria-selected"], Ho = { class: "mbc__count" }, Ko = ["title"], qo = ["aria-selected"], Vo = ["title"], Jo = {
1382
+ }, Wo = ["aria-selected"], Go = { class: "mbc__count" }, Yo = ["title"], Zo = ["aria-selected"], Xo = ["title"], Qo = {
1341
1383
  key: 1,
1342
1384
  class: "mbc__chip is-ok"
1343
- }, Go = { class: "mbc__body" }, Wo = {
1385
+ }, tl = { class: "mbc__body" }, el = {
1344
1386
  key: 0,
1345
1387
  class: "mbc__running"
1346
- }, Yo = ["aria-valuenow"], Zo = {
1388
+ }, nl = ["aria-valuenow"], sl = {
1347
1389
  key: 1,
1348
1390
  class: "mbc__confirm"
1349
- }, Xo = { class: "mbc__confirm-title" }, Qo = { class: "mbc__confirm-body" }, tl = {
1391
+ }, ol = { class: "mbc__confirm-title" }, ll = { class: "mbc__confirm-body" }, al = {
1350
1392
  key: 0,
1351
1393
  class: "mbc__mono"
1352
- }, el = { class: "mbc__confirm-check" }, nl = { class: "mbc__actions" }, sl = ["disabled"], ol = ["disabled"], ll = ["disabled"], al = {
1394
+ }, il = { class: "mbc__confirm-check" }, ul = { class: "mbc__actions" }, cl = ["disabled"], rl = ["disabled"], dl = ["disabled"], pl = {
1353
1395
  key: 2,
1354
1396
  class: "mbc__confirm"
1355
- }, il = { class: "mbc__confirm-title" }, ul = { class: "mbc__confirm-body" }, cl = { class: "mbc__mono" }, rl = { class: "mbc__actions" }, dl = ["disabled"], pl = ["disabled"], bl = { class: "mbc__panel mbc__panel--blocks" }, fl = { class: "mbc__title" }, ml = { class: "mbc__count" }, vl = {
1397
+ }, fl = { class: "mbc__confirm-title" }, bl = { class: "mbc__confirm-body" }, ml = { class: "mbc__mono" }, vl = { class: "mbc__actions" }, hl = ["disabled"], gl = ["disabled"], _l = { class: "mbc__panel mbc__panel--blocks" }, yl = { class: "mbc__title" }, kl = { class: "mbc__count" }, $l = {
1356
1398
  key: 0,
1357
1399
  class: "mbc__count mbc__count--tag"
1358
- }, hl = {
1400
+ }, wl = {
1359
1401
  key: 0,
1360
1402
  class: "mbc__tagbar"
1361
- }, _l = ["title", "onClick"], gl = { class: "mbc__list" }, yl = ["title", "onClick"], kl = { class: "mbc__module" }, $l = { class: "mbc__name" }, wl = ["title"], xl = {
1403
+ }, xl = ["title", "onClick"], Cl = { class: "mbc__list" }, Sl = ["title", "onClick"], El = { class: "mbc__module" }, Tl = { class: "mbc__name" }, Bl = ["title"], Ml = {
1362
1404
  key: 0,
1363
1405
  class: "mbc__where"
1364
- }, Cl = ["title"], Sl = {
1406
+ }, Al = ["title"], Ol = {
1365
1407
  key: 0,
1366
1408
  class: "mbc__detail"
1367
- }, El = {
1409
+ }, Rl = {
1368
1410
  key: 0,
1369
1411
  class: "mbc__hint"
1370
- }, Tl = { class: "mbc__meta" }, Bl = ["innerHTML"], Ml = {
1412
+ }, Pl = { class: "mbc__meta" }, jl = ["innerHTML"], Ll = {
1371
1413
  key: 1,
1372
1414
  class: "mbc__hint"
1373
- }, Al = ["disabled", "onClick"], Rl = ["disabled", "onClick"], Ol = ["disabled"], Pl = { class: "mbc__hint" }, jl = {
1415
+ }, Il = ["disabled", "onClick"], Dl = ["disabled", "onClick"], Nl = ["disabled"], Fl = { class: "mbc__hint" }, Ul = {
1374
1416
  key: 0,
1375
1417
  class: "mbc__hint"
1376
- }, Ll = ["disabled", "onClick"], Dl = ["onKeyup"], Il = ["disabled", "onClick"], Nl = ["disabled"], Fl = {
1418
+ }, zl = ["disabled", "onClick"], Hl = ["onKeyup"], Kl = ["disabled", "onClick"], ql = ["disabled"], Vl = {
1377
1419
  key: 0,
1378
1420
  class: "mbc__tagbar"
1379
- }, zl = ["title", "onClick"], Ul = {
1421
+ }, Jl = ["title", "onClick"], Wl = {
1380
1422
  key: 1,
1381
1423
  class: "mbc__tagbar"
1382
- }, Hl = ["title", "onClick"], Kl = { class: "mbc__mono" }, ql = { class: "mbc__actions mbc__actions--row" }, Vl = ["disabled", "onClick"], Jl = { class: "mbc__versions" }, Gl = { class: "mbc__versions-head" }, Wl = ["disabled", "onClick"], Yl = {
1424
+ }, Gl = ["title", "onClick"], Yl = { class: "mbc__mono" }, Zl = { class: "mbc__actions mbc__actions--row" }, Xl = ["disabled", "onClick"], Ql = { class: "mbc__versions" }, ta = { class: "mbc__versions-head" }, ea = ["disabled", "onClick"], na = {
1383
1425
  key: 0,
1384
1426
  class: "mbc__hint"
1385
- }, Zl = {
1427
+ }, sa = {
1386
1428
  key: 1,
1387
1429
  class: "mbc__versions-list"
1388
- }, Xl = { class: "mbc__mono" }, Ql = { class: "mbc__hint" }, ta = { class: "mbc__actions" }, ea = ["disabled", "onClick", "title"], na = ["disabled", "onClick", "title"], sa = ["disabled", "onClick", "title"], oa = ["disabled", "onClick", "title"], la = {
1430
+ }, oa = { class: "mbc__mono" }, la = { class: "mbc__hint" }, aa = { class: "mbc__actions" }, ia = ["disabled", "onClick", "title"], ua = ["disabled", "onClick", "title"], ca = ["disabled", "onClick", "title"], ra = ["disabled", "onClick", "title"], da = {
1389
1431
  key: 2,
1390
1432
  class: "mbc__hint"
1391
- }, aa = {
1433
+ }, pa = {
1392
1434
  key: 3,
1393
1435
  class: "mbc__viewer"
1394
- }, ia = { class: "mbc__versions-head" }, ua = { class: "mbc__mono" }, ca = { class: "mbc__viewer-body" }, ra = { class: "mbc__panel mbc__panel--export" }, da = { class: "mbc__field" }, pa = ["disabled"], ba = { class: "mbc__field" }, fa = { class: "mbc__radio" }, ma = ["checked"], va = { class: "mbc__radio" }, ha = ["checked"], _a = ["value", "disabled"], ga = {
1436
+ }, fa = { class: "mbc__versions-head" }, ba = { class: "mbc__mono" }, ma = { class: "mbc__viewer-body" }, va = { class: "mbc__panel mbc__panel--export" }, ha = { class: "mbc__field" }, ga = ["disabled"], _a = { class: "mbc__field" }, ya = { class: "mbc__radio" }, ka = ["checked"], $a = { class: "mbc__radio" }, wa = ["checked"], xa = ["value", "disabled"], Ca = {
1395
1437
  key: 0,
1396
1438
  value: ""
1397
- }, ya = ["value"], ka = { class: "mbc__field" }, $a = ["value"], wa = ["disabled"], xa = ["disabled", "title"], Ca = { class: "mbc__hint" }, Sa = {
1439
+ }, Sa = ["value"], Ea = { class: "mbc__field" }, Ta = ["value"], Ba = ["disabled"], Ma = ["disabled", "title"], Aa = { class: "mbc__hint" }, Oa = {
1398
1440
  key: 0,
1399
1441
  class: "mbc__hint"
1400
- }, Ea = { class: "mbc__panel mbc__panel--read" }, Ta = { class: "mbc__field" }, Ba = ["value"], Ma = ["disabled"], Aa = ["disabled"], Ra = {
1442
+ }, Ra = { class: "mbc__panel mbc__panel--read" }, Pa = { class: "mbc__field" }, ja = ["value"], La = ["disabled"], Ia = ["disabled"], Da = {
1401
1443
  key: 0,
1402
1444
  class: "mbc__hint"
1403
- }, Oa = {
1445
+ }, Na = {
1404
1446
  key: 1,
1405
1447
  class: "mbc__hint"
1406
- }, Pa = {
1448
+ }, Fa = {
1407
1449
  key: 0,
1408
1450
  class: "mbc__hint"
1409
- }, ja = { class: "mbc__ok-text" }, La = ["disabled"], Da = ["disabled"], Ia = {
1451
+ }, Ua = { class: "mbc__ok-text" }, za = ["disabled"], Ha = ["disabled"], Ka = {
1410
1452
  key: 1,
1411
1453
  class: "mbc__scan"
1412
- }, Na = { class: "mbc__pick" }, Fa = ["disabled", "checked", "onChange"], za = { class: "mbc__name" }, Ua = { class: "mbc__module" }, Ha = { class: "mbc__hint" }, Ka = { class: "mbc__mono" }, qa = {
1454
+ }, qa = { class: "mbc__pick" }, Va = ["disabled", "checked", "onChange"], Ja = { class: "mbc__name" }, Wa = { class: "mbc__module" }, Ga = { class: "mbc__hint" }, Ya = { class: "mbc__mono" }, Za = {
1413
1455
  key: 0,
1414
1456
  class: "mbc__problem"
1415
- }, Va = { class: "mbc__hint mbc__mono" }, Ja = {
1457
+ }, Xa = { class: "mbc__hint mbc__mono" }, Qa = {
1416
1458
  key: 2,
1417
1459
  class: "mbc__hint"
1418
- }, Ga = { class: "mbc__field" }, Wa = ["title"], Ya = {
1460
+ }, ti = { class: "mbc__field" }, ei = ["title"], ni = {
1419
1461
  key: 1,
1420
1462
  class: "mbc__chip is-ok"
1421
- }, Za = ["title"], Xa = {
1463
+ }, si = ["title"], oi = {
1422
1464
  key: 3,
1423
1465
  class: "mbc__hint"
1424
- }, Qa = { class: "mbc__field mbc__field--end" }, ti = ["disabled"], ei = { class: "mbc__panel mbc__panel--declared" }, ni = { class: "mbc__title" }, si = { class: "p-tag p-tag-info" }, oi = { class: "mbc__count" }, li = {
1466
+ }, li = { class: "mbc__field mbc__field--end" }, ai = ["disabled"], ii = { class: "mbc__panel mbc__panel--declared" }, ui = { class: "mbc__title" }, ci = { class: "p-tag p-tag-info" }, ri = { class: "mbc__count" }, di = {
1425
1467
  key: 0,
1426
1468
  class: "mbc__hint"
1427
- }, ai = { class: "mbc__hint" }, ii = { class: "mbc__scan" }, ui = { class: "mbc__pick" }, ci = { class: "mbc__name" }, ri = { class: "p-tag p-tag-info" }, di = { class: "mbc__module" }, pi = { class: "mbc__hint" }, bi = { class: "mbc__mono" }, fi = { class: "mbc__hint mbc__mono" }, mi = {
1469
+ }, pi = { class: "mbc__hint" }, fi = { class: "mbc__scan" }, bi = { class: "mbc__pick" }, mi = { class: "mbc__name" }, vi = { class: "p-tag p-tag-info" }, hi = { class: "mbc__module" }, gi = { class: "mbc__hint" }, _i = { class: "mbc__mono" }, yi = { class: "mbc__hint mbc__mono" }, ki = {
1428
1470
  key: 3,
1429
1471
  class: "mbc__panel mbc__panel--result"
1430
- }, vi = { class: "mbc__summary" }, hi = { class: "mbc__chip is-ok" }, _i = {
1472
+ }, $i = { class: "mbc__summary" }, wi = { class: "mbc__chip is-ok" }, xi = {
1431
1473
  key: 0,
1432
1474
  class: "mbc__chip is-bad"
1433
- }, gi = {
1475
+ }, Ci = {
1434
1476
  key: 1,
1435
1477
  class: "mbc__chip is-bad"
1436
- }, yi = {
1478
+ }, Si = {
1437
1479
  key: 2,
1438
1480
  class: "mbc__hint"
1439
- }, ki = { class: "mbc__actions" }, $i = { class: "mbc__foot" }, wi = ["title"], xi = {
1481
+ }, Ei = { class: "mbc__actions" }, Ti = { class: "mbc__foot" }, Bi = ["title"], Mi = {
1440
1482
  key: 1,
1441
1483
  class: "mbc__error"
1442
- }, Ci = {
1484
+ }, Ai = {
1443
1485
  key: 2,
1444
1486
  class: "mbc__notice"
1445
- }, Si = {
1487
+ }, Oi = {
1446
1488
  key: 3,
1447
1489
  class: "mbc__hint mbc__foot-idle"
1448
- }, Ei = { class: "mbc__modal-box" }, Ti = { class: "mbc__modal-head" }, Bi = { class: "mbc__modal-body" }, Mi = {
1490
+ }, Ri = { class: "mbc__modal-box" }, Pi = { class: "mbc__modal-head" }, ji = { class: "mbc__modal-body" }, Li = {
1449
1491
  key: 0,
1450
1492
  class: "mbc__issues-group"
1451
- }, Ai = { class: "mbc__title" }, Ri = { class: "mbc__failures" }, Oi = {
1493
+ }, Ii = { class: "mbc__title" }, Di = { class: "mbc__failures" }, Ni = {
1452
1494
  key: 1,
1453
1495
  class: "mbc__issues-group"
1454
- }, Pi = { class: "mbc__title" }, ji = { class: "mbc__failures" }, Li = { class: "mbc__kind" }, Di = { class: "mbc__mono" }, Ii = {
1496
+ }, Fi = { class: "mbc__title" }, Ui = { class: "mbc__failures" }, zi = { class: "mbc__kind" }, Hi = { class: "mbc__mono" }, Ki = {
1455
1497
  key: 2,
1456
1498
  class: "mbc__issues-group"
1457
- }, Ni = { class: "mbc__title" }, Fi = { class: "mbc__failures" }, zi = { class: "mbc__mono" }, Ui = {
1499
+ }, qi = { class: "mbc__title" }, Vi = { class: "mbc__failures" }, Ji = { class: "mbc__mono" }, Wi = {
1458
1500
  key: 3,
1459
1501
  class: "mbc__issues-group"
1460
- }, Hi = { class: "mbc__title" }, Ki = { class: "mbc__failures" }, qi = { key: 0 }, Vi = {
1502
+ }, Gi = { class: "mbc__title" }, Yi = { class: "mbc__failures" }, Zi = { key: 0 }, Xi = {
1461
1503
  key: 1,
1462
1504
  class: "mbc__failures mbc__failures--nested"
1463
- }, Ji = {
1505
+ }, Qi = {
1464
1506
  key: 4,
1465
1507
  class: "mbc__hint"
1466
- }, Gi = { class: "mbc__modal-foot" }, Wi = { class: "mbc__modal-box" }, Yi = { class: "mbc__modal-head" }, Zi = { class: "mbc__modal-body" }, Xi = { class: "mbc__reports" }, Qi = { class: "mbc__report-head" }, tu = { class: "mbc__mono" }, eu = { class: "mbc__report-text" }, nu = {
1508
+ }, tu = { class: "mbc__modal-foot" }, eu = { class: "mbc__modal-box" }, nu = { class: "mbc__modal-head" }, su = { class: "mbc__modal-body" }, ou = { class: "mbc__reports" }, lu = { class: "mbc__report-head" }, au = { class: "mbc__mono" }, iu = { class: "mbc__report-text" }, uu = {
1467
1509
  key: 0,
1468
1510
  class: "mbc__hint"
1469
- }, su = { class: "mbc__modal-foot" }, Se = 2, ou = 100, lu = 250, au = /* @__PURE__ */ Pe({
1511
+ }, cu = { class: "mbc__modal-foot" }, Se = 2, ru = 100, du = 250, pu = /* @__PURE__ */ je({
1470
1512
  __name: "MagicBlockConsole",
1471
1513
  setup(o) {
1472
1514
  const s = {
@@ -1477,7 +1519,7 @@ const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1477
1519
  两种情形共用它(前端声明了、手里却还没有那个文件夹 / 手里那个文件夹的清单 id 库里没有)
1478
1520
  —— 对用户是同一件事:这个块不在库里。 */
1479
1521
  "not-in-db": "不在数据库"
1480
- }, a = s["not-in-db"], { isStaff: i } = fn(), u = bn(), { active: m } = ms(), f = (n) => !mn(n, u), c = x(!1), h = x(""), v = x([]), g = x(""), _ = x(""), y = x(""), E = x([]), A = x(!1), C = x(!1), R = x("blocks"), P = x(""), z = x([]), Z = x(""), X = x(""), yt = x(""), kt = x(""), S = x(!1), Dt = x(!1), ut = x(!1), $t = x(!1), st = x(!1), q = x(null), U = x(null), Q = x("one"), wt = x(qt()), ft = j(() => v.value.find((n) => n.id === wt.value) ?? null), xt = () => Q.value === "all" ? {} : { blocks: [wt.value] };
1522
+ }, l = s["not-in-db"], { isStaff: i } = mn(), u = bn(), { active: m } = _s(), f = (n) => !vn(n, u), c = x(!1), h = x(""), v = x([]), _ = x(""), g = x(""), y = x(""), E = x([]), A = x(!1), C = x(!1), O = x("blocks"), P = x(""), U = x([]), Z = x(""), X = x(""), yt = x(""), kt = x(""), S = x(!1), It = x(!1), ut = x(!1), $t = x(!1), st = x(!1), q = x(null), z = x(null), Q = x("one"), wt = x(qt()), bt = j(() => v.value.find((n) => n.id === wt.value) ?? null), xt = () => Q.value === "all" ? {} : { blocks: [wt.value] };
1481
1523
  function Kt(n) {
1482
1524
  wt.value = n;
1483
1525
  try {
@@ -1495,14 +1537,14 @@ const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1495
1537
  Pt(v, (n) => {
1496
1538
  n.length !== 0 && (n.some((t) => t.id === wt.value) || Kt(n[0].id));
1497
1539
  });
1498
- const tt = x(null), V = x(""), O = x(null), ct = x({}), W = x([]), Y = x([]), ot = x({}), w = x(""), T = x(null);
1499
- async function D(n) {
1540
+ const tt = x(null), V = x(""), R = x(null), ct = x({}), G = x([]), Y = x([]), ot = x({}), w = x(""), T = x(null);
1541
+ async function I(n) {
1500
1542
  w.value = n;
1501
1543
  try {
1502
1544
  const t = await at(`/magic-blocks/${encodeURIComponent(n)}/versions`);
1503
1545
  ot.value = { ...ot.value, [n]: t.versions ?? [] };
1504
1546
  } catch (t) {
1505
- zt(t, "读版本列表");
1547
+ Ut(t, "读版本列表");
1506
1548
  } finally {
1507
1549
  w.value = "";
1508
1550
  }
@@ -1511,35 +1553,35 @@ const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1511
1553
  const t = [n.current ? "当前" : "", n.empty ? "空包(代码被删过)" : ""].filter(Boolean).join("、");
1512
1554
  return `v${n.number}${t ? ` · ${t}` : ""}`;
1513
1555
  }
1514
- function It(n) {
1556
+ function Dt(n) {
1515
1557
  return n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${Math.round(n / 1024)} KB` : `${(n / 1024 / 1024).toFixed(1)} MB`;
1516
1558
  }
1517
1559
  const H = x(null);
1518
1560
  function Nt(n, t) {
1519
1561
  return `${String(t || "").replace(/[\\/:*?"<>|]/g, "").trim() || "block"}-${n}`;
1520
1562
  }
1521
- const oe = (n) => G(async () => {
1563
+ const oe = (n) => W(async () => {
1522
1564
  const t = Nt(n.id, n.name || n.module);
1523
1565
  let e = q.value, r = null;
1524
1566
  if (e)
1525
1567
  try {
1526
- r = await Ce(e, tt.value ?? await fe());
1568
+ r = await Ce(e, tt.value ?? await be());
1527
1569
  } catch {
1528
1570
  e = null, r = null;
1529
1571
  }
1530
1572
  H.value = { row: n, target: e, folder: t, inventory: r };
1531
- }, S), le = () => G(async () => {
1573
+ }, S), le = () => W(async () => {
1532
1574
  const n = H.value;
1533
1575
  if (H.value = null, !n) return;
1534
1576
  const t = `「${n.row.module} / ${n.row.name || n.row.id}」`;
1535
- Ie(), F.value = { active: !0, percent: 0, stage: "清本机那个文件夹…", failed: !1 };
1577
+ Ne(), F.value = { active: !0, percent: 0, stage: "清本机那个文件夹…", failed: !1 };
1536
1578
  let e = "";
1537
1579
  if (n.target)
1538
1580
  try {
1539
- const r = await ae(n.target, n.folder), B = await Mo(r);
1581
+ const r = await ae(n.target, n.folder), B = await Lo(r);
1540
1582
  e = `清掉了本机「${n.target.name}/${n.folder}」里的 ${B} 项`;
1541
1583
  } catch (r) {
1542
- e = `本机那份没清成(${Ot(r)})`;
1584
+ e = `本机那份没清成(${Rt(r)})`;
1543
1585
  }
1544
1586
  else
1545
1587
  e = "没选开发目录 ⇒ 本机那份没动";
@@ -1547,23 +1589,23 @@ const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1547
1589
  try {
1548
1590
  await at(`/magic-blocks/${n.row.id}`, { method: "DELETE" });
1549
1591
  } catch (r) {
1550
- throw Ct(!1, "本机清了,但库里那份代码没清成"), new Error(`${e};但**库里那份代码没清成**(${Ot(r)})—— 再点一次「删除代码文件」`);
1592
+ throw Ct(!1, "本机清了,但库里那份代码没清成"), new Error(`${e};但**库里那份代码没清成**(${Rt(r)})—— 再点一次「删除代码文件」`);
1551
1593
  }
1552
1594
  await Et(), V.value = `${t}的代码文件已删除:${e};库里那一份也清空了 ——**块还在**(页面上会显示成占位框)。想找回来:上面「块」那一屏点开这一块 → 版本史 → 对上一版点「切回」`, y.value = `删掉了${t}的代码文件(块本身还在)`, Ct(!0, "完成");
1553
1595
  }, S);
1554
1596
  async function ae(n, t) {
1555
1597
  let e = n.handle;
1556
- for (const r of Le(t))
1598
+ for (const r of Ie(t))
1557
1599
  e = await e.getDirectoryHandle(r, { create: !0 });
1558
1600
  return { handle: e, name: `${n.name}/${t}` };
1559
1601
  }
1560
- const J = x(null), Vt = x(!1), F = x({ active: !1, percent: 0, stage: "", failed: !1 }), An = j(() => ({
1602
+ const J = x(null), Vt = x(!1), F = x({ active: !1, percent: 0, stage: "", failed: !1 }), jn = j(() => ({
1561
1603
  width: `${Math.max(0, Math.min(100, F.value.percent))}%`,
1562
1604
  background: F.value.failed ? "var(--sp-color-danger)" : "var(--sp-color-primary, var(--primary-color))"
1563
1605
  }));
1564
1606
  let ie = [], De = 0;
1565
1607
  function ue(n = !1) {
1566
- if (!(!n && performance.now() - De < lu)) {
1608
+ if (!(!n && performance.now() - De < du)) {
1567
1609
  De = performance.now();
1568
1610
  try {
1569
1611
  window.localStorage.setItem("mb:progress", JSON.stringify(ie));
@@ -1577,14 +1619,14 @@ const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1577
1619
  function Ct(n, t) {
1578
1620
  lt(n ? 100 : F.value.percent, t), F.value = { active: !n, percent: n ? 100 : F.value.percent, stage: t, failed: !n }, ue(!0);
1579
1621
  }
1580
- function Ie() {
1622
+ function Ne() {
1581
1623
  ie = [], ue(!0);
1582
1624
  }
1583
- const Ne = (n) => (n.disabledReason ?? "").trim(), ce = (n) => (n.issues ?? []).map((t) => String(t?.message ?? "")).filter(Boolean), Jt = (n) => Qs(n.id);
1584
- function Rn(n) {
1585
- g.value = g.value === n.id ? "" : n.id, g.value === n.id && D(n.id);
1625
+ const Fe = (n) => (n.disabledReason ?? "").trim(), ce = (n) => (n.issues ?? []).map((t) => String(t?.message ?? "")).filter(Boolean), Jt = (n) => oo(n.id);
1626
+ function Ln(n) {
1627
+ _.value = _.value === n.id ? "" : n.id, _.value === n.id && I(n.id);
1586
1628
  const t = m.value;
1587
- Sn(n.id);
1629
+ En(n.id);
1588
1630
  const e = n.name || n.id, r = Jt(n);
1589
1631
  if (r.length === 0) {
1590
1632
  y.value = `「${e}」这次会话里还没在哪条标签上露过面:先打开挂着它的那一页,再点一次`;
@@ -1594,97 +1636,97 @@ const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1594
1636
  y.value = `「${e}」就在这一条标签上(${r.join(" / ")}):已经把它标红`;
1595
1637
  return;
1596
1638
  }
1597
- const B = to(n.id, t, f);
1639
+ const B = lo(n.id, t, f);
1598
1640
  if (B) {
1599
- y.value = `「${e}」不在这一条标签上:正在切到 ${B} 那条标签`, Te(B);
1641
+ y.value = `「${e}」不在这一条标签上:正在切到 ${B} 那条标签`, Be(B);
1600
1642
  return;
1601
1643
  }
1602
1644
  y.value = `「${e}」只挂在带参数的实例标签上(${r.join(" / ")}):不替你挑一单 —— 自己打开要看的那一页再点`;
1603
1645
  }
1604
- const On = (n, t) => G(async () => {
1646
+ const In = (n, t) => W(async () => {
1605
1647
  const e = await at(
1606
1648
  `/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`
1607
1649
  );
1608
1650
  T.value = { id: n.id, number: t, files: e.files ?? {} }, y.value = `正在看「${n.name || n.id}」的 v${t}(只读:不会改库里任何东西)`;
1609
- }, S), Pn = (n, t) => G(async () => {
1651
+ }, S), Dn = (n, t) => W(async () => {
1610
1652
  window.confirm(`把「${n.name || n.id}」切回 v${t}?
1611
1653
 
1612
- 这会把那一版的代码变成**当前版**,并且记成一个**新版本**(号继续 +1):历史只追加,旧版本一个都不会没。`) && (await St(`/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`, { updatedBy: "" }), y.value = `「${n.name || n.id}」已切回 v${t}(并记成了一个新版本)`, await Et(), await D(n.id));
1613
- }, S), jn = (n, t) => G(async () => {
1654
+ 这会把那一版的代码变成**当前版**,并且记成一个**新版本**(号继续 +1):历史只追加,旧版本一个都不会没。`) && (await St(`/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`, { updatedBy: "" }), y.value = `「${n.name || n.id}」已切回 v${t}(并记成了一个新版本)`, await Et(), await I(n.id));
1655
+ }, S), Nn = (n, t) => W(async () => {
1614
1656
  window.confirm(`删掉「${n.name || n.id}」的 v${t}?
1615
1657
 
1616
- 这一版的代码就找不回来了(别的版本不受影响)。`) && (await at(`/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`, { method: "DELETE" }), y.value = `删掉了「${n.name || n.id}」的 v${t}`, await D(n.id));
1617
- }, S), Ln = (n, t) => G(async () => {
1658
+ 这一版的代码就找不回来了(别的版本不受影响)。`) && (await at(`/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`, { method: "DELETE" }), y.value = `删掉了「${n.name || n.id}」的 v${t}`, await I(n.id));
1659
+ }, S), Fn = (n, t) => W(async () => {
1618
1660
  const e = await fetch(
1619
- `http://localhost:3000/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}?download=1`,
1661
+ `${Te}/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}?download=1`,
1620
1662
  { credentials: "include", headers: ne("GET", !1) }
1621
1663
  );
1622
1664
  if (!e.ok) throw new Error(`下载失败(HTTP ${e.status})`);
1623
1665
  const r = await e.blob(), B = URL.createObjectURL(r);
1624
1666
  try {
1625
- const I = document.createElement("a");
1626
- I.href = B, I.download = `magic-block-${n.name || n.id}-v${t}.zip`, document.body.appendChild(I), I.click(), I.remove();
1667
+ const D = document.createElement("a");
1668
+ D.href = B, D.download = `magic-block-${n.name || n.id}-v${t}.zip`, document.body.appendChild(D), D.click(), D.remove();
1627
1669
  } finally {
1628
1670
  setTimeout(() => URL.revokeObjectURL(B), 0);
1629
1671
  }
1630
1672
  y.value = `已下载「${n.name || n.id}」的 v${t}`;
1631
1673
  }, S);
1632
- function Dn(n) {
1674
+ function Un(n) {
1633
1675
  Z.value = n.id, X.value = (n.tags ?? []).join(", ");
1634
1676
  }
1635
- const Fe = (n) => G(async () => {
1677
+ const Ue = (n) => W(async () => {
1636
1678
  const t = X.value.split(/[,,\s]+/).map((r) => r.trim()).filter(Boolean), e = await St(`/magic-blocks/${encodeURIComponent(n.id)}/tags`, { tags: t });
1637
1679
  Z.value = "", y.value = `「${n.name || n.id}」的标签已存:${(e.tags ?? []).join(" / ") || "(一个都不剩)"}`, await Et();
1638
- }, S, "存标签"), In = (n) => G(async () => {
1680
+ }, S, "存标签"), zn = (n) => W(async () => {
1639
1681
  const t = await St(`/magic-blocks/${encodeURIComponent(n.id)}/detail`, { detail: kt.value });
1640
1682
  yt.value = "", y.value = `「${n.name || n.id}」的详情已存${(t.detail ?? "").trim() ? "" : "(清掉了)"};下次导出会写进它的 magic-block.open.yaml`, await Et();
1641
1683
  }, S, "存详情");
1642
- function Nn(n) {
1684
+ function Hn(n) {
1643
1685
  yt.value = n.id, kt.value = (n.detail ?? "").trim();
1644
1686
  }
1645
- function Fn(n) {
1687
+ function Kn(n) {
1646
1688
  const t = X.value.split(/[,,\s]+/).map((e) => e.trim()).filter(Boolean);
1647
1689
  t.some((e) => e.toLowerCase() === n.toLowerCase()) || t.push(n), X.value = t.join(", ");
1648
1690
  }
1649
- function zn(n) {
1691
+ function qn(n) {
1650
1692
  X.value = X.value.split(/[,,\s]+/).map((t) => t.trim()).filter((t) => t && t.toLowerCase() !== n.toLowerCase()).join(", ");
1651
1693
  }
1652
- function Un(n) {
1694
+ function Vn(n) {
1653
1695
  const t = P.value.trim().toLowerCase();
1654
1696
  return t ? (n.tags ?? []).some((e) => e.toLowerCase().includes(t)) : !0;
1655
1697
  }
1656
- function Hn(n) {
1657
- const t = Jt(n), e = t.length === 0 ? "点一下:这次会话里它还没在哪条标签上露过面" : `点一下:把「${n.name || n.id}」标红,并在需要时切到挂着它的标签(${t.join(" / ")})`, r = Ne(n);
1698
+ function Jn(n) {
1699
+ const t = Jt(n), e = t.length === 0 ? "点一下:这次会话里它还没在哪条标签上露过面" : `点一下:把「${n.name || n.id}」标红,并在需要时切到挂着它的标签(${t.join(" / ")})`, r = Fe(n);
1658
1700
  return r ? `${r}
1659
1701
  ${e}` : e;
1660
1702
  }
1661
1703
  const ze = j(() => {
1662
1704
  const n = h.value.trim().toLowerCase();
1663
- return v.value.filter((t) => Un(t) ? n ? `${t.module} ${t.name} ${t.brief} ${t.detail ?? ""} ${t.id} v${t.version ?? ""} ${(t.tags ?? []).join(" ")}`.toLowerCase().includes(n) : !0 : !1);
1664
- }), Gt = j(() => (O.value?.blocks ?? []).filter((n) => n.canApply)), Wt = j(() => Gt.value.filter((n) => ct.value[n.id] === !0)), Rt = x(!1), dt = j(() => W.value.length + (O.value?.failures ?? []).length + Y.value.filter((n) => !n.ok).length), Ft = j(() => Y.value.filter((n) => !n.ok)), re = j(() => Y.value.filter((n) => n.ok).length), de = j(() => v.value.filter((n) => n.enabled === !1).length);
1665
- function Kn() {
1705
+ return v.value.filter((t) => Vn(t) ? n ? `${t.module} ${t.name} ${t.brief} ${t.detail ?? ""} ${t.id} v${t.version ?? ""} ${(t.tags ?? []).join(" ")}`.toLowerCase().includes(n) : !0 : !1);
1706
+ }), Wt = j(() => (R.value?.blocks ?? []).filter((n) => n.canApply)), Gt = j(() => Wt.value.filter((n) => ct.value[n.id] === !0)), Ot = x(!1), dt = j(() => G.value.length + (R.value?.failures ?? []).length + Y.value.filter((n) => !n.ok).length), Ft = j(() => Y.value.filter((n) => !n.ok)), re = j(() => Y.value.filter((n) => n.ok).length), de = j(() => v.value.filter((n) => n.enabled === !1).length);
1707
+ function Wn() {
1666
1708
  const n = /* @__PURE__ */ new Set(), t = [];
1667
- for (const e of Ue()) {
1709
+ for (const e of He()) {
1668
1710
  const r = typeof e?.path == "string" ? e.path.trim() : "";
1669
1711
  if (!r || n.has(r) || r.includes(":") || r.includes("*") || e.redirect || !e.components?.default || e.meta?.tab === !1) continue;
1670
1712
  n.add(r);
1671
- const B = e.meta?.title ?? e.meta?.sub, I = e.meta?.group;
1713
+ const B = e.meta?.title ?? e.meta?.sub, D = e.meta?.group;
1672
1714
  t.push({
1673
1715
  path: r,
1674
1716
  title: typeof B == "string" && B.trim() ? B.trim() : r,
1675
- group: typeof I == "string" ? I.trim() : ""
1717
+ group: typeof D == "string" ? D.trim() : ""
1676
1718
  });
1677
1719
  }
1678
1720
  return t;
1679
1721
  }
1680
- function Ue() {
1722
+ function He() {
1681
1723
  return u?.getRoutes?.() ?? [];
1682
1724
  }
1683
- const pe = j(() => yo(Ue(), mo, v.value.map((n) => n.id)));
1684
- function Ot(n) {
1725
+ const pe = j(() => ko(He(), Mn, v.value.map((n) => n.id)));
1726
+ function Rt(n) {
1685
1727
  return (n instanceof Error ? n.message.trim() : String(n)) || "请求没有到达后端(网络或登录态的问题),请重试";
1686
1728
  }
1687
- function qn(n) {
1729
+ function Gn(n) {
1688
1730
  const t = n?.issues;
1689
1731
  return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : String(e?.message ?? "")).filter(Boolean) : [];
1690
1732
  }
@@ -1693,18 +1735,18 @@ ${e}` : e;
1693
1735
  try {
1694
1736
  return await at(n, { method: "POST", body: e });
1695
1737
  } catch (r) {
1696
- const B = Ot(r), I = await fetch(`http://localhost:3000${n}`, {
1738
+ const B = Rt(r), D = await fetch(`${Te}${n}`, {
1697
1739
  method: "POST",
1698
1740
  credentials: "include",
1699
1741
  headers: { "Content-Type": "application/json", ...ne("POST", !0) },
1700
1742
  body: e
1701
- }).then((mt) => mt.json()).catch(() => null), L = qn(I);
1702
- throw L.length === 0 ? new Error(B) : new Error(`${String(I?.message ?? B)}
1743
+ }).then((mt) => mt.json()).catch(() => null), L = Gn(D);
1744
+ throw L.length === 0 ? new Error(B) : new Error(`${String(D?.message ?? B)}
1703
1745
  - ${L.join(`
1704
1746
  - `)}`);
1705
1747
  }
1706
1748
  }
1707
- async function Vn() {
1749
+ async function Yn() {
1708
1750
  const n = E.value.map((t) => `[${t.at}] ${t.where}
1709
1751
  ${t.text}`).join(`
1710
1752
 
@@ -1712,13 +1754,13 @@ ${t.text}`).join(`
1712
1754
  try {
1713
1755
  await navigator.clipboard.writeText(n), y.value = `已复制 ${E.value.length} 条报错`;
1714
1756
  } catch (t) {
1715
- zt(t, "复制报错");
1757
+ Ut(t, "复制报错");
1716
1758
  }
1717
1759
  }
1718
- function Jn() {
1760
+ function Zn() {
1719
1761
  const n = [];
1720
- W.value.length > 0 && n.push("【前端校验拦下的】", ...W.value.map((t) => `- ${t}`), "");
1721
- for (const t of O.value?.failures ?? [])
1762
+ G.value.length > 0 && n.push("【前端校验拦下的】", ...G.value.map((t) => `- ${t}`), "");
1763
+ for (const t of R.value?.failures ?? [])
1722
1764
  n.push(`【读回:${t.kind || "问题"}】${t.where || ""}`, `- ${t.message || ""}`, "");
1723
1765
  for (const t of Ft.value)
1724
1766
  n.push(
@@ -1730,67 +1772,67 @@ ${t.text}`).join(`
1730
1772
  return n.join(`
1731
1773
  `).trim() || "这一趟没有问题。";
1732
1774
  }
1733
- async function Gn() {
1775
+ async function Xn() {
1734
1776
  try {
1735
- await navigator.clipboard.writeText(Jn()), y.value = `已复制这一趟的 ${dt.value} 条问题`;
1777
+ await navigator.clipboard.writeText(Zn()), y.value = `已复制这一趟的 ${dt.value} 条问题`;
1736
1778
  } catch (n) {
1737
- zt(n, "复制问题");
1779
+ Ut(n, "复制问题");
1738
1780
  }
1739
1781
  }
1740
- function zt(n, t) {
1741
- const e = Ot(n);
1742
- _.value = e, E.value = [...E.value, { at: (/* @__PURE__ */ new Date()).toLocaleTimeString(), where: t, text: e }];
1782
+ function Ut(n, t) {
1783
+ const e = Rt(n);
1784
+ g.value = e, E.value = [...E.value, { at: (/* @__PURE__ */ new Date()).toLocaleTimeString(), where: t, text: e }];
1743
1785
  }
1744
- function be() {
1745
- _.value = "", E.value = [];
1786
+ function fe() {
1787
+ g.value = "", E.value = [];
1746
1788
  }
1747
1789
  async function Et() {
1748
1790
  try {
1749
1791
  const n = await at("/magic-blocks/index");
1750
- v.value = n.blocks ?? [], z.value = n.tags ?? [];
1792
+ v.value = n.blocks ?? [], U.value = n.tags ?? [];
1751
1793
  } catch (n) {
1752
- zt(n, "读块清单");
1794
+ Ut(n, "读块清单");
1753
1795
  }
1754
1796
  }
1755
- async function G(n, t, e = "") {
1756
- t.value = !0, be();
1797
+ async function W(n, t, e = "") {
1798
+ t.value = !0, fe();
1757
1799
  try {
1758
- await n(), Vs();
1800
+ await n(), Zs();
1759
1801
  } catch (r) {
1760
- zt(r, e || "这个动作");
1802
+ Ut(r, e || "这个动作");
1761
1803
  } finally {
1762
1804
  t.value = !1;
1763
1805
  }
1764
1806
  }
1765
- const Wn = () => G(async () => {
1766
- Dt.value = !0;
1807
+ const Qn = () => W(async () => {
1808
+ It.value = !0;
1767
1809
  try {
1768
1810
  await at("/magic-blocks/check", { method: "POST", body: JSON.stringify({}) }), y.value = "全部魔法块重新校验完了", await Et();
1769
1811
  } finally {
1770
- Dt.value = !1;
1812
+ It.value = !1;
1771
1813
  }
1772
- }, S), He = (n) => G(async () => {
1814
+ }, S), Ke = (n) => W(async () => {
1773
1815
  const t = await xe();
1774
- n === "export" ? (q.value = t, U.value || (U.value = t)) : (U.value = t, q.value || (q.value = t)), y.value = n === "export" ? `导出目录:${t.name}${U.value === t ? "(读回目录也填成它了)" : ""}` : `读回目录:${t.name}`;
1816
+ n === "export" ? (q.value = t, z.value || (z.value = t)) : (z.value = t, q.value || (q.value = t)), y.value = n === "export" ? `导出目录:${t.name}${z.value === t ? "(读回目录也填成它了)" : ""}` : `读回目录:${t.name}`;
1775
1817
  }, S);
1776
- async function fe() {
1818
+ async function be() {
1777
1819
  if (tt.value) return tt.value;
1778
1820
  const n = await at("/magic-blocks/rules");
1779
1821
  return tt.value = n.rules, n.rules;
1780
1822
  }
1781
- const Yn = () => G(async () => {
1782
- if (!En()) throw new Error("这个浏览器没法直接写你本机的文件夹:请用 Chrome / Edge,并从 https 或 localhost 打开");
1783
- if (Q.value === "one" && !ft.value)
1823
+ const ts = () => W(async () => {
1824
+ if (!An()) throw new Error("这个浏览器没法直接写你本机的文件夹:请用 Chrome / Edge,并从 https 或 localhost 打开");
1825
+ if (Q.value === "one" && !bt.value)
1784
1826
  throw new Error("还没挑块:上面选「仅这一个块」时要先在下拉里挑一个块(或者把范围改成「全部块」)");
1785
- ut.value = !0, y.value = "", V.value = "", be(), Ie(), Yt.length = 0, F.value = { active: !0, percent: 0, stage: "准备…", failed: !1 };
1827
+ ut.value = !0, y.value = "", V.value = "", fe(), Ne(), Yt.length = 0, F.value = { active: !0, percent: 0, stage: "准备…", failed: !1 };
1786
1828
  try {
1787
1829
  const n = q.value ?? await xe();
1788
- q.value = n, U.value || (U.value = n);
1830
+ q.value = n, z.value || (z.value = n);
1789
1831
  const t = St("/magic-blocks/export", xt()), e = me(), r = tt.value ? Ce(n, tt.value) : null, B = await Tt("取包", t);
1790
- tt.value = B.rules, Oo(n, B.rules);
1791
- const I = r ? await Tt("数目录", r) : await Tt("数目录", Ce(n, B.rules));
1792
- if (I.topCount > 0) {
1793
- lt(5, "等你确认要不要先清空"), J.value = { target: n, inventory: I };
1832
+ tt.value = B.rules, No(n, B.rules);
1833
+ const D = r ? await Tt("数目录", r) : await Tt("数目录", Ce(n, B.rules));
1834
+ if (D.topCount > 0) {
1835
+ lt(5, "等你确认要不要先清空"), J.value = { target: n, inventory: D };
1794
1836
  return;
1795
1837
  }
1796
1838
  await ve(n, B, { clean: !1, verify: !1, front: e });
@@ -1799,8 +1841,8 @@ ${t.text}`).join(`
1799
1841
  } finally {
1800
1842
  ut.value = !1;
1801
1843
  }
1802
- }, S), Ke = /* @__PURE__ */ new WeakMap(), Yt = [];
1803
- function qe(n, t) {
1844
+ }, S), qe = /* @__PURE__ */ new WeakMap(), Yt = [];
1845
+ function Ve(n, t) {
1804
1846
  Yt.push([n, Math.round(performance.now() - t)]);
1805
1847
  }
1806
1848
  async function Tt(n, t) {
@@ -1808,63 +1850,63 @@ ${t.text}`).join(`
1808
1850
  try {
1809
1851
  return await t;
1810
1852
  } finally {
1811
- qe(n, e);
1853
+ Ve(n, e);
1812
1854
  }
1813
1855
  }
1814
- function Zn() {
1856
+ function es() {
1815
1857
  return Yt.length > 0 ? `;耗时:${Yt.map(([n, t]) => `${n} ${t}ms`).join(" · ")}` : "";
1816
1858
  }
1817
1859
  function me() {
1818
1860
  try {
1819
- const n = Cn();
1861
+ const n = Sn();
1820
1862
  return {
1821
1863
  css: n.css,
1822
- controls: Ws(),
1864
+ controls: to(),
1823
1865
  note: n.skipped.length > 0 ? `;⚠️ 有 ${n.skipped.length} 张样式表读不到规则(跨源):${n.skipped.join(" / ")}` : ""
1824
1866
  };
1825
1867
  } catch (n) {
1826
- return { css: "", controls: "", note: `;主题 CSS 没收成(${Ot(n)}):${Bt} 没写,其余照旧` };
1868
+ return { css: "", controls: "", note: `;主题 CSS 没收成(${Rt(n)}):${Bt} 没写,其余照旧` };
1827
1869
  }
1828
1870
  }
1829
1871
  async function ve(n, t, e) {
1830
- const { clean: r, verify: B, thorough: I, front: L } = e;
1872
+ const { clean: r, verify: B, thorough: D, front: L } = e;
1831
1873
  try {
1832
1874
  lt(20, "准备写盘…");
1833
- const mt = wo(Kn()), pt = { ...t.files };
1875
+ const mt = Bo(Wn()), pt = { ...t.files };
1834
1876
  pt[we] = mt, L.css && (pt[Bt] = L.css), L.controls && (pt[ee] = L.controls), t.exampleDir && (pt[`${t.exampleDir}/${we}`] = mt, L.css && (pt[`${t.exampleDir}/${Bt}`] = L.css), L.controls && (pt[`${t.exampleDir}/${ee}`] = L.controls));
1835
- const ss = L.note;
1877
+ const is = L.note;
1836
1878
  await new Promise((nt) => {
1837
1879
  setTimeout(nt, 0);
1838
1880
  });
1839
- let Ye = "", he;
1881
+ let Ze = "", he;
1840
1882
  if (r) {
1841
1883
  lt(35, "清掉这一包不要的东西…");
1842
- const nt = await Tt("清多余", Ao(n, pt));
1843
- he = nt.existing, Ye = nt.removed > 0 ? `,先清掉了 ${nt.removed} 项` : ",没有多余的东西要清";
1884
+ const nt = await Tt("清多余", Io(n, pt));
1885
+ he = nt.existing, Ze = nt.removed > 0 ? `,先清掉了 ${nt.removed} 项` : ",没有多余的东西要清";
1844
1886
  } else
1845
- lt(35, "看一眼目录里有什么…"), he = await Tt("看目录", Ro(n, pt));
1846
- const os = Ke.get(n.handle), ls = Object.keys(pt).length, _e = r ? 45 : 30;
1847
- lt(_e, `写文件 0/${ls}…`);
1848
- let Ze = 0;
1849
- const as = performance.now(), et = await Bo(n, pt, (nt, ge) => {
1850
- const Xe = Date.now();
1851
- nt < ge && Xe - Ze < ou || (Ze = Xe, lt(_e + Math.round(nt / Math.max(1, ge) * (95 - _e)), `写文件 ${nt}/${ge}…`));
1887
+ lt(35, "看一眼目录里有什么…"), he = await Tt("看目录", Do(n, pt));
1888
+ const us = qe.get(n.handle), cs = Object.keys(pt).length, ge = r ? 45 : 30;
1889
+ lt(ge, `写文件 0/${cs}…`);
1890
+ let Xe = 0;
1891
+ const rs = performance.now(), et = await jo(n, pt, (nt, _e) => {
1892
+ const Qe = Date.now();
1893
+ nt < _e && Qe - Xe < ru || (Xe = Qe, lt(ge + Math.round(nt / Math.max(1, _e) * (95 - ge)), `写文件 ${nt}/${_e}…`));
1852
1894
  }, {
1853
1895
  verify: B,
1854
1896
  // 🔴 账本:勾了「逐个核对磁盘」就不给它 —— 那样连上一趟铺过的也重新核对一遍。
1855
- trust: I ? void 0 : os,
1897
+ trust: D ? void 0 : us,
1856
1898
  existing: he
1857
1899
  });
1858
- qe("写盘", as), Ke.set(n.handle, et.fingerprints), lt(98, "收尾…");
1859
- const is = et.failed.length > 0 ? `;⚠️ ${et.failed.length} 个文件没写成:${et.failed.slice(0, 3).map((nt) => `${nt.path}(${nt.message})`).join("、")}` + (et.failed.length > 3 ? ` 等 ${et.failed.length} 条` : "") : "", Zt = [];
1900
+ Ve("写盘", rs), qe.set(n.handle, et.fingerprints), lt(98, "收尾…");
1901
+ const ds = et.failed.length > 0 ? `;⚠️ ${et.failed.length} 个文件没写成:${et.failed.slice(0, 3).map((nt) => `${nt.path}(${nt.message})`).join("、")}` + (et.failed.length > 3 ? ` 等 ${et.failed.length} 条` : "") : "", Zt = [];
1860
1902
  et.skipped > 0 && Zt.push(`${et.skipped} 个与库里一字不差(逐字节比过)`), et.trusted > 0 && Zt.push(`${et.trusted} 个按上一趟的账本跳过(没再碰磁盘)`);
1861
- const us = Zt.length > 0 ? `,跳过 ${Zt.join(" / ")}` : "";
1862
- V.value = `铺到「${n.name}」:${t.blocks} 个块、写了 ${et.written} 个文件${us}(含 ${we} / ${Bt} / ${ee})${Ye}${is}${ss}${Zn()}`, y.value = et.failed.length > 0 ? "导出完了,但有文件没写成(见下面那句)" : "导出完了:用你自己的编辑器改,改完回这里「读回改动」", Ct(!0, "完成");
1903
+ const ps = Zt.length > 0 ? `,跳过 ${Zt.join(" / ")}` : "";
1904
+ V.value = `铺到「${n.name}」:${t.blocks} 个块、写了 ${et.written} 个文件${ps}(含 ${we} / ${Bt} / ${ee})${Ze}${ds}${is}${es()}`, y.value = et.failed.length > 0 ? "导出完了,但有文件没写成(见下面那句)" : "导出完了:用你自己的编辑器改,改完回这里「读回改动」", Ct(!0, "完成");
1863
1905
  } catch (mt) {
1864
1906
  throw Ct(!1, "导出中途失败(已经铺进去的文件不会自己删掉)"), mt;
1865
1907
  }
1866
1908
  }
1867
- const Xn = () => G(async () => {
1909
+ const ns = () => W(async () => {
1868
1910
  const n = J.value;
1869
1911
  if (J.value = null, !!n) {
1870
1912
  ut.value = !0;
@@ -1878,7 +1920,7 @@ ${t.text}`).join(`
1878
1920
  ut.value = !1;
1879
1921
  }
1880
1922
  }
1881
- }, S), Qn = () => G(async () => {
1923
+ }, S), ss = () => W(async () => {
1882
1924
  const n = J.value;
1883
1925
  if (J.value = null, !!n) {
1884
1926
  ut.value = !0;
@@ -1893,31 +1935,31 @@ ${t.text}`).join(`
1893
1935
  }
1894
1936
  }
1895
1937
  }, S);
1896
- function ts() {
1938
+ function os() {
1897
1939
  J.value = null, F.value = { active: !1, percent: 0, stage: "", failed: !1 }, y.value = "这次没有导出(目录里的东西一个字节都没动)", V.value = "";
1898
1940
  }
1899
- const Ve = () => G(async () => {
1900
- const n = U.value ?? await xe();
1901
- U.value = n, q.value || (q.value = n), $t.value = !0, y.value = "", W.value = [], Y.value = [];
1941
+ const Je = () => W(async () => {
1942
+ const n = z.value ?? await xe();
1943
+ z.value = n, q.value || (q.value = n), $t.value = !0, y.value = "", G.value = [], Y.value = [];
1902
1944
  try {
1903
- const t = await fe().catch((L) => {
1904
- throw new Error(`取不到扫描规则(GET /magic-blocks/rules):${Ot(L)}`);
1905
- }), e = await Do(n, t), r = await at("/magic-blocks/read", {
1945
+ const t = await be().catch((L) => {
1946
+ throw new Error(`取不到扫描规则(GET /magic-blocks/rules):${Rt(L)}`);
1947
+ }), e = await Ho(n, t), r = await at("/magic-blocks/read", {
1906
1948
  method: "POST",
1907
1949
  body: JSON.stringify({ ...e, includeMissing: !1 })
1908
1950
  });
1909
- O.value = r;
1951
+ R.value = r;
1910
1952
  const B = {};
1911
1953
  for (const L of r.blocks ?? []) B[L.id] = L.status === "modified" && L.canApply;
1912
1954
  ct.value = B;
1913
- const I = (r.blocks ?? []).reduce((L, mt) => ({ ...L, [mt.status]: (L[mt.status] ?? 0) + 1 }), {});
1914
- y.value = `扫到 ${r.folders} 个文件夹、${r.files} 个文件:有改动 ${I.modified ?? 0} / 没改动 ${I.unchanged ?? 0}` + (r.complete ? "" : "(层数到了上限,没走完,可能还有块没扫到)");
1955
+ const D = (r.blocks ?? []).reduce((L, mt) => ({ ...L, [mt.status]: (L[mt.status] ?? 0) + 1 }), {});
1956
+ y.value = `扫到 ${r.folders} 个文件夹、${r.files} 个文件:有改动 ${D.modified ?? 0} / 没改动 ${D.unchanged ?? 0}` + (r.complete ? "" : "(层数到了上限,没走完,可能还有块没扫到)");
1915
1957
  } finally {
1916
1958
  $t.value = !1;
1917
1959
  }
1918
- }, S), es = () => G(async () => {
1919
- const n = Wt.value, t = Ls(n);
1920
- if (W.value = t.issues, Y.value = [], t.issues.length > 0)
1960
+ }, S), ls = () => W(async () => {
1961
+ const n = Gt.value, t = Us(n);
1962
+ if (G.value = t.issues, Y.value = [], t.issues.length > 0)
1921
1963
  throw y.value = "", new Error(`前端校验没过(${t.issues.length} 条),没有发请求:
1922
1964
  - ${t.issues.join(`
1923
1965
  - `)}`);
@@ -1926,37 +1968,37 @@ ${t.text}`).join(`
1926
1968
  const e = await St("/magic-blocks/import", { updatedBy: "", blocks: n });
1927
1969
  Y.value = e.results ?? [], y.value = `保存:成功 ${e.saved} 个、失败 ${e.failed} 个`, await Et();
1928
1970
  const r = y.value;
1929
- await Ve(), y.value = `${r};已重新读回该目录`;
1971
+ await Je(), y.value = `${r};已重新读回该目录`;
1930
1972
  } finally {
1931
1973
  st.value = !1;
1932
1974
  }
1933
1975
  }, S);
1934
- function ns(n, t) {
1976
+ function as(n, t) {
1935
1977
  const e = t.target;
1936
1978
  ct.value[n] = e?.checked === !0;
1937
1979
  }
1938
- function Je(n) {
1980
+ function We(n) {
1939
1981
  const t = { ...ct.value };
1940
- for (const e of Gt.value) t[e.id] = n;
1982
+ for (const e of Wt.value) t[e.id] = n;
1941
1983
  ct.value = t;
1942
1984
  }
1943
1985
  function Ge(n) {
1944
1986
  const t = n.detail?.uuid ?? "";
1945
- c.value = !0, g.value = t;
1987
+ c.value = !0, _.value = t;
1946
1988
  }
1947
- function We(n) {
1989
+ function Ye(n) {
1948
1990
  n.key === "Escape" && c.value && (c.value = !1);
1949
1991
  }
1950
- return rn(() => {
1951
- window.addEventListener("magic-block:open-console", Ge), window.addEventListener("keydown", We), Et(), fe().catch(() => {
1992
+ return dn(() => {
1993
+ window.addEventListener("magic-block:open-console", Ge), window.addEventListener("keydown", Ye), Et(), be().catch(() => {
1952
1994
  });
1953
- }), dn(() => {
1954
- window.removeEventListener("magic-block:open-console", Ge), window.removeEventListener("keydown", We);
1995
+ }), pn(() => {
1996
+ window.removeEventListener("magic-block:open-console", Ge), window.removeEventListener("keydown", Ye);
1955
1997
  }), (n, t) => it(i) ? (d(), p("div", {
1956
1998
  key: 0,
1957
1999
  class: K(["mbc__shell", { "is-wide": C.value }])
1958
2000
  }, [
1959
- l("button", {
2001
+ a("button", {
1960
2002
  class: "fab",
1961
2003
  type: "button",
1962
2004
  title: "magic block 控制台",
@@ -1966,169 +2008,169 @@ ${t.text}`).join(`
1966
2008
  key: 0,
1967
2009
  class: K(["mbc", { "is-wide": C.value }])
1968
2010
  }, [
1969
- l("header", Io, [
1970
- t[43] || (t[43] = l("strong", { class: "mbc__brand" }, "magic block", -1)),
1971
- l("span", {
2011
+ a("header", Ko, [
2012
+ t[43] || (t[43] = a("strong", { class: "mbc__brand" }, "magic block", -1)),
2013
+ a("span", {
1972
2014
  class: "mbc__count",
1973
2015
  title: `库里一共 ${v.value.length} 个块`
1974
- }, b(v.value.length) + " 个块", 9, No),
1975
- t[44] || (t[44] = l("span", { class: "mbc__grow" }, null, -1)),
1976
- l("button", {
2016
+ }, b(v.value.length) + " 个块", 9, qo),
2017
+ t[44] || (t[44] = a("span", { class: "mbc__grow" }, null, -1)),
2018
+ a("button", {
1977
2019
  class: "p-button p-button-sm p-button-text",
1978
2020
  type: "button",
1979
2021
  title: C.value ? "收起(回到右侧那条窄抽屉)" : "展开:整屏(块 / 工作区两个页签)",
1980
2022
  onClick: t[1] || (t[1] = (e) => C.value = !C.value)
1981
- }, b(C.value ? "收起" : "展开全屏"), 9, Fo),
1982
- l("button", {
2023
+ }, b(C.value ? "收起" : "展开全屏"), 9, Vo),
2024
+ a("button", {
1983
2025
  class: "p-button p-button-sm p-button-text",
1984
2026
  type: "button",
1985
2027
  onClick: t[2] || (t[2] = (e) => c.value = !1)
1986
2028
  }, "关闭")
1987
2029
  ]),
1988
- l("div", zo, [
1989
- l("button", {
1990
- class: K(["mbc__tab", { "is-on": R.value === "blocks" }]),
2030
+ a("div", Jo, [
2031
+ a("button", {
2032
+ class: K(["mbc__tab", { "is-on": O.value === "blocks" }]),
1991
2033
  type: "button",
1992
2034
  role: "tab",
1993
- "aria-selected": R.value === "blocks",
1994
- onClick: t[3] || (t[3] = (e) => R.value = "blocks")
2035
+ "aria-selected": O.value === "blocks",
2036
+ onClick: t[3] || (t[3] = (e) => O.value = "blocks")
1995
2037
  }, [
1996
2038
  t[45] || (t[45] = $(" 块 ", -1)),
1997
- l("span", Ho, b(v.value.length), 1),
2039
+ a("span", Go, b(v.value.length), 1),
1998
2040
  de.value > 0 ? (d(), p("span", {
1999
2041
  key: 0,
2000
2042
  class: "mbc__chip is-bad",
2001
2043
  title: `${de.value} 个块被停用(体检没过)`
2002
- }, b(de.value) + " 停用", 9, Ko)) : k("", !0)
2003
- ], 10, Uo),
2004
- l("button", {
2005
- class: K(["mbc__tab", { "is-on": R.value === "workspace" }]),
2044
+ }, b(de.value) + " 停用", 9, Yo)) : k("", !0)
2045
+ ], 10, Wo),
2046
+ a("button", {
2047
+ class: K(["mbc__tab", { "is-on": O.value === "workspace" }]),
2006
2048
  type: "button",
2007
2049
  role: "tab",
2008
- "aria-selected": R.value === "workspace",
2009
- onClick: t[4] || (t[4] = (e) => R.value = "workspace")
2050
+ "aria-selected": O.value === "workspace",
2051
+ onClick: t[4] || (t[4] = (e) => O.value = "workspace")
2010
2052
  }, [
2011
2053
  t[46] || (t[46] = $(" 工作区(导出 / 读回 / 校验) ", -1)),
2012
2054
  dt.value > 0 ? (d(), p("span", {
2013
2055
  key: 0,
2014
2056
  class: "mbc__chip is-bad",
2015
2057
  title: `这一趟有 ${dt.value} 条问题`
2016
- }, b(dt.value), 9, Vo)) : Y.value.length > 0 ? (d(), p("span", Jo, b(re.value) + " 存成", 1)) : k("", !0)
2017
- ], 10, qo)
2058
+ }, b(dt.value), 9, Xo)) : Y.value.length > 0 ? (d(), p("span", Qo, b(re.value) + " 存成", 1)) : k("", !0)
2059
+ ], 10, Zo)
2018
2060
  ]),
2019
- l("div", Go, [
2020
- F.value.active ? (d(), p("div", Wo, [
2021
- l("div", {
2061
+ a("div", tl, [
2062
+ F.value.active ? (d(), p("div", el, [
2063
+ a("div", {
2022
2064
  class: K(["mbc__progress", { "is-failed": F.value.failed }]),
2023
2065
  role: "progressbar",
2024
2066
  "aria-valuenow": F.value.percent,
2025
2067
  "aria-valuemin": "0",
2026
2068
  "aria-valuemax": "100"
2027
2069
  }, [
2028
- l("div", {
2070
+ a("div", {
2029
2071
  class: "mbc__progress-bar",
2030
- style: pn(An.value)
2072
+ style: fn(jn.value)
2031
2073
  }, null, 4)
2032
- ], 10, Yo),
2033
- l("p", {
2074
+ ], 10, nl),
2075
+ a("p", {
2034
2076
  class: K(["mbc__hint", { "mbc__progress-note": F.value.failed }])
2035
2077
  }, b(F.value.failed ? "✗" : "") + " " + b(F.value.percent) + "% · " + b(F.value.stage), 3)
2036
2078
  ])) : k("", !0),
2037
- J.value ? (d(), p("div", Zo, [
2038
- l("p", Xo, "「" + b(J.value.target.name) + "」里现在有 " + b(J.value.inventory.dirs) + " 个文件夹 / " + b(J.value.inventory.files) + " 个文件", 1),
2039
- l("p", Qo, [
2040
- t[47] || (t[47] = l("b", null, "只覆盖", -1)),
2079
+ J.value ? (d(), p("div", sl, [
2080
+ a("p", ol, "「" + b(J.value.target.name) + "」里现在有 " + b(J.value.inventory.dirs) + " 个文件夹 / " + b(J.value.inventory.files) + " 个文件", 1),
2081
+ a("p", ll, [
2082
+ t[47] || (t[47] = a("b", null, "只覆盖", -1)),
2041
2083
  t[48] || (t[48] = $("(天天用这个):只把库里", -1)),
2042
- t[49] || (t[49] = l("b", null, "改过 / 缺了", -1)),
2084
+ t[49] || (t[49] = a("b", null, "改过 / 缺了", -1)),
2043
2085
  t[50] || (t[50] = $("的那些写下去 —— 上一趟铺过、 这一趟一字没变的**一概不碰**(所以很快;代价是你自己在编辑器里改过、还没读回库的那些 ", -1)),
2044
- t[51] || (t[51] = l("b", null, "会留着", -1)),
2086
+ t[51] || (t[51] = a("b", null, "会留着", -1)),
2045
2087
  t[52] || (t[52] = $(")。 ", -1)),
2046
- t[53] || (t[53] = l("b", null, "清空并导出", -1)),
2088
+ t[53] || (t[53] = a("b", null, "清空并导出", -1)),
2047
2089
  t[54] || (t[54] = $(":先删掉这一包没有的东西,其余同上。 两种都只动这个目录", -1)),
2048
- t[55] || (t[55] = l("b", null, "里面", -1)),
2090
+ t[55] || (t[55] = a("b", null, "里面", -1)),
2049
2091
  t[56] || (t[56] = $("的子项:目录本身、以及它外面的任何东西都不会被碰。", -1)),
2050
- J.value.inventory.items.length > 0 ? (d(), p("span", tl, "(" + b(J.value.inventory.items.slice(0, 6).map((e) => e.name).join(" / ")) + b(J.value.inventory.items.length > 6 ? " …" : "") + ")", 1)) : k("", !0)
2092
+ J.value.inventory.items.length > 0 ? (d(), p("span", al, "(" + b(J.value.inventory.items.slice(0, 6).map((e) => e.name).join(" / ")) + b(J.value.inventory.items.length > 6 ? " …" : "") + ")", 1)) : k("", !0)
2051
2093
  ]),
2052
- l("label", el, [
2053
- vt(l("input", {
2094
+ a("label", il, [
2095
+ vt(a("input", {
2054
2096
  "onUpdate:modelValue": t[5] || (t[5] = (e) => Vt.value = e),
2055
2097
  type: "checkbox"
2056
2098
  }, null, 512), [
2057
- [rs, Vt.value]
2099
+ [ms, Vt.value]
2058
2100
  ]),
2059
- t[57] || (t[57] = l("span", null, [
2101
+ t[57] || (t[57] = a("span", null, [
2060
2102
  $("逐个核对磁盘(慢):把上一趟铺过的也重新读一遍比对,"),
2061
- l("b", null, "你在编辑器里改过、还没读回库的那些会被库里的那份盖掉")
2103
+ a("b", null, "你在编辑器里改过、还没读回库的那些会被库里的那份盖掉")
2062
2104
  ], -1))
2063
2105
  ]),
2064
- l("div", nl, [
2065
- l("button", {
2106
+ a("div", ul, [
2107
+ a("button", {
2066
2108
  class: "p-button p-button-sm",
2067
2109
  type: "button",
2068
2110
  disabled: S.value,
2069
- onClick: t[6] || (t[6] = (e) => Xn())
2070
- }, "清空并导出", 8, sl),
2071
- l("button", {
2111
+ onClick: t[6] || (t[6] = (e) => ns())
2112
+ }, "清空并导出", 8, cl),
2113
+ a("button", {
2072
2114
  class: "p-button p-button-sm p-button-outlined",
2073
2115
  type: "button",
2074
2116
  disabled: S.value,
2075
- onClick: t[7] || (t[7] = (e) => Qn())
2076
- }, "只覆盖", 8, ol),
2077
- l("button", {
2117
+ onClick: t[7] || (t[7] = (e) => ss())
2118
+ }, "只覆盖", 8, rl),
2119
+ a("button", {
2078
2120
  class: "p-button p-button-sm p-button-text",
2079
2121
  type: "button",
2080
2122
  disabled: S.value,
2081
- onClick: t[8] || (t[8] = (e) => ts())
2082
- }, "取消", 8, ll)
2123
+ onClick: t[8] || (t[8] = (e) => os())
2124
+ }, "取消", 8, dl)
2083
2125
  ])
2084
2126
  ])) : k("", !0),
2085
- H.value ? (d(), p("div", al, [
2086
- l("p", il, "删掉「" + b(H.value.row.module) + " / " + b(H.value.row.name || H.value.row.id) + "」的代码文件", 1),
2087
- l("p", ul, [
2088
- t[66] || (t[66] = l("b", null, "库里那一份代码正文会被清空", -1)),
2127
+ H.value ? (d(), p("div", pl, [
2128
+ a("p", fl, "删掉「" + b(H.value.row.module) + " / " + b(H.value.row.name || H.value.row.id) + "」的代码文件", 1),
2129
+ a("p", bl, [
2130
+ t[66] || (t[66] = a("b", null, "库里那一份代码正文会被清空", -1)),
2089
2131
  t[67] || (t[67] = $("(入口 / 清单 / 后端一起); ", -1)),
2090
2132
  H.value.target ? (d(), p(M, { key: 0 }, [
2091
2133
  t[58] || (t[58] = $(" 同时清掉你本机那个块文件夹 ", -1)),
2092
- l("span", cl, b(H.value.target.name) + "/" + b(H.value.folder), 1),
2134
+ a("span", ml, b(H.value.target.name) + "/" + b(H.value.folder), 1),
2093
2135
  H.value.inventory && H.value.inventory.items.some((e) => e.name === H.value?.folder) ? (d(), p(M, { key: 0 }, [
2094
2136
  $(" (它现在在顶层,里面有东西:本次会先清空)。 ")
2095
2137
  ], 64)) : k("", !0),
2096
- t[59] || (t[59] = l("b", null, "只动这一个块的文件夹", -1)),
2138
+ t[59] || (t[59] = a("b", null, "只动这一个块的文件夹", -1)),
2097
2139
  t[60] || (t[60] = $(":别的块、", -1)),
2098
- t[61] || (t[61] = l("span", { class: "mbc__mono" }, "example/", -1)),
2140
+ t[61] || (t[61] = a("span", { class: "mbc__mono" }, "example/", -1)),
2099
2141
  t[62] || (t[62] = $("、以及目录外面的一切都不会被碰。 ", -1))
2100
2142
  ], 64)) : (d(), p(M, { key: 1 }, [
2101
2143
  t[63] || (t[63] = $(" 现在没有选中开发目录 / 或者读不到它,所以", -1)),
2102
- t[64] || (t[64] = l("b", null, "本机那份不动", -1)),
2144
+ t[64] || (t[64] = a("b", null, "本机那份不动", -1)),
2103
2145
  t[65] || (t[65] = $(",只清库里那份。 ", -1))
2104
2146
  ], 64)),
2105
- t[68] || (t[68] = l("br", null, null, -1)),
2147
+ t[68] || (t[68] = a("br", null, null, -1)),
2106
2148
  t[69] || (t[69] = $(" 🔴 ", -1)),
2107
- t[70] || (t[70] = l("b", null, "块本身留着", -1)),
2149
+ t[70] || (t[70] = a("b", null, "块本身留着", -1)),
2108
2150
  t[71] || (t[71] = $('(这一行不动):页面上那块会显示成占位框,而不是"库里没有这个块"; 删错了也能救回来:展开这一块 → 版本史 → 「切回」删之前那一版。 ', -1))
2109
2151
  ]),
2110
- l("div", rl, [
2111
- l("button", {
2152
+ a("div", vl, [
2153
+ a("button", {
2112
2154
  class: "p-button p-button-sm",
2113
2155
  type: "button",
2114
2156
  disabled: S.value,
2115
2157
  onClick: t[9] || (t[9] = (e) => le())
2116
- }, "确认删除代码文件", 8, dl),
2117
- l("button", {
2158
+ }, "确认删除代码文件", 8, hl),
2159
+ a("button", {
2118
2160
  class: "p-button p-button-sm p-button-text",
2119
2161
  type: "button",
2120
2162
  disabled: S.value,
2121
2163
  onClick: t[10] || (t[10] = (e) => H.value = null)
2122
- }, "取消", 8, pl)
2164
+ }, "取消", 8, gl)
2123
2165
  ])
2124
2166
  ])) : k("", !0),
2125
- vt(l("section", bl, [
2126
- l("h3", fl, [
2167
+ vt(a("section", _l, [
2168
+ a("h3", yl, [
2127
2169
  t[72] || (t[72] = $(" 库里的块 ", -1)),
2128
- l("span", ml, b(ze.value.length) + " / " + b(v.value.length), 1),
2129
- P.value.trim() ? (d(), p("span", vl, "标签:" + b(P.value), 1)) : k("", !0)
2170
+ a("span", kl, b(ze.value.length) + " / " + b(v.value.length), 1),
2171
+ P.value.trim() ? (d(), p("span", $l, "标签:" + b(P.value), 1)) : k("", !0)
2130
2172
  ]),
2131
- vt(l("input", {
2173
+ vt(a("input", {
2132
2174
  "onUpdate:modelValue": t[11] || (t[11] = (e) => h.value = e),
2133
2175
  class: "p-inputtext p-component mbc__search",
2134
2176
  type: "search",
@@ -2136,9 +2178,9 @@ ${t.text}`).join(`
2136
2178
  }, null, 512), [
2137
2179
  [Xt, h.value]
2138
2180
  ]),
2139
- z.value.length > 0 ? (d(), p("div", hl, [
2140
- t[73] || (t[73] = l("span", { class: "mbc__label" }, "标签", -1)),
2141
- vt(l("input", {
2181
+ U.value.length > 0 ? (d(), p("div", wl, [
2182
+ t[73] || (t[73] = a("span", { class: "mbc__label" }, "标签", -1)),
2183
+ vt(a("input", {
2142
2184
  "onUpdate:modelValue": t[12] || (t[12] = (e) => P.value = e),
2143
2185
  class: "p-inputtext p-component mbc__tagfilter",
2144
2186
  type: "search",
@@ -2146,13 +2188,13 @@ ${t.text}`).join(`
2146
2188
  }, null, 512), [
2147
2189
  [Xt, P.value]
2148
2190
  ]),
2149
- (d(!0), p(M, null, N(z.value.slice(0, 24), (e) => (d(), p("button", {
2191
+ (d(!0), p(M, null, N(U.value.slice(0, 24), (e) => (d(), p("button", {
2150
2192
  key: e.tag,
2151
2193
  class: K(["p-tag mbc__tag", { "is-on": P.value.trim().toLowerCase() === e.tag.toLowerCase() }]),
2152
2194
  type: "button",
2153
2195
  title: `只看贴了「${e.tag}」的块(${e.count} 个)`,
2154
2196
  onClick: (r) => P.value = P.value.trim().toLowerCase() === e.tag.toLowerCase() ? "" : e.tag
2155
- }, b(e.tag) + " " + b(e.count), 11, _l))), 128)),
2197
+ }, b(e.tag) + " " + b(e.count), 11, xl))), 128)),
2156
2198
  P.value ? (d(), p("button", {
2157
2199
  key: 0,
2158
2200
  class: "p-button p-button-sm p-button-text",
@@ -2160,19 +2202,19 @@ ${t.text}`).join(`
2160
2202
  onClick: t[13] || (t[13] = (e) => P.value = "")
2161
2203
  }, "清掉标签筛选")) : k("", !0)
2162
2204
  ])) : k("", !0),
2163
- l("ul", gl, [
2205
+ a("ul", Cl, [
2164
2206
  (d(!0), p(M, null, N(ze.value, (e) => (d(), p("li", {
2165
2207
  key: e.id
2166
2208
  }, [
2167
- l("button", {
2209
+ a("button", {
2168
2210
  type: "button",
2169
- class: K(["mbc__row", { "is-active": e.id === g.value, "is-off": e.enabled === !1 }]),
2170
- title: Hn(e),
2171
- onClick: (r) => Rn(e)
2211
+ class: K(["mbc__row", { "is-active": e.id === _.value, "is-off": e.enabled === !1 }]),
2212
+ title: Jn(e),
2213
+ onClick: (r) => Ln(e)
2172
2214
  }, [
2173
- l("span", kl, b(e.module || "unassigned"), 1),
2174
- l("span", $l, b(e.name || e.id), 1),
2175
- l("span", {
2215
+ a("span", El, b(e.module || "unassigned"), 1),
2216
+ a("span", Tl, b(e.name || e.id), 1),
2217
+ a("span", {
2176
2218
  class: "mbc__version-badge",
2177
2219
  title: `当前是第 ${e.version || 1} 版,一共留着 ${e.versionCount ?? 1} 版`
2178
2220
  }, [
@@ -2180,44 +2222,44 @@ ${t.text}`).join(`
2180
2222
  (e.versionCount ?? 1) > 1 ? (d(), p(M, { key: 0 }, [
2181
2223
  $("/" + b(e.versionCount), 1)
2182
2224
  ], 64)) : k("", !0)
2183
- ], 8, wl),
2225
+ ], 8, Bl),
2184
2226
  (d(!0), p(M, null, N(e.tags ?? [], (r) => (d(), p("span", {
2185
2227
  key: r,
2186
2228
  class: "p-tag mbc__tag mbc__tag--on-row"
2187
2229
  }, b(r), 1))), 128)),
2188
- Jt(e).length > 0 ? (d(), p("span", xl, b(Jt(e).join(" / ")), 1)) : k("", !0),
2189
- l("em", {
2230
+ Jt(e).length > 0 ? (d(), p("span", Ml, b(Jt(e).join(" / ")), 1)) : k("", !0),
2231
+ a("em", {
2190
2232
  class: K({ "is-off": e.enabled === !1 })
2191
- }, b(e.enabled === !1 ? Ne(e) || "校验失败已停用" : "可用"), 3),
2233
+ }, b(e.enabled === !1 ? Fe(e) || "校验失败已停用" : "可用"), 3),
2192
2234
  (e.detail ?? "").trim() ? (d(), p("span", {
2193
2235
  key: 1,
2194
2236
  class: "mbc__detail-line",
2195
- title: it(un)(e.detail ?? "", 240)
2196
- }, b(it(un)(e.detail ?? "")), 9, Cl)) : k("", !0)
2197
- ], 10, yl),
2198
- g.value === e.id ? (d(), p("div", Sl, [
2237
+ title: it(cn)(e.detail ?? "", 240)
2238
+ }, b(it(cn)(e.detail ?? "")), 9, Al)) : k("", !0)
2239
+ ], 10, Sl),
2240
+ _.value === e.id ? (d(), p("div", Ol, [
2199
2241
  (d(!0), p(M, null, N(ce(e).slice(0, Se), (r, B) => (d(), p("p", {
2200
2242
  key: B,
2201
2243
  class: "mbc__problem"
2202
2244
  }, b(r), 1))), 128)),
2203
- ce(e).length > Se ? (d(), p("p", El, "还有 " + b(ce(e).length - Se) + " 条问题没显示出来:点上面的「校验全部魔法块」重算一遍(这几条是上次校验的结论)", 1)) : k("", !0),
2204
- l("dl", Tl, [
2205
- t[76] || (t[76] = l("dt", null, "详情", -1)),
2206
- l("dd", null, [
2245
+ ce(e).length > Se ? (d(), p("p", Rl, "还有 " + b(ce(e).length - Se) + " 条问题没显示出来:点上面的「校验全部魔法块」重算一遍(这几条是上次校验的结论)", 1)) : k("", !0),
2246
+ a("dl", Pl, [
2247
+ t[76] || (t[76] = a("dt", null, "详情", -1)),
2248
+ a("dd", null, [
2207
2249
  yt.value !== e.id ? (d(), p(M, { key: 0 }, [
2208
2250
  (e.detail ?? "").trim() ? (d(), p("div", {
2209
2251
  key: 0,
2210
2252
  class: "mbc__blockdetail",
2211
- innerHTML: it(ho)(e.detail ?? "")
2212
- }, null, 8, Bl)) : (d(), p("span", Ml, "(这一块没写详情 —— 点右边「写详情」写一段**业务功能说明**:谁能用、什么场景、解决什么、输入输出是什么业务含义;用 Markdown 写,**别写路由 / 字段 / 实现方式**)")),
2213
- l("button", {
2253
+ innerHTML: it(So)(e.detail ?? "")
2254
+ }, null, 8, jl)) : (d(), p("span", Ll, "(这一块没写详情 —— 点右边「写详情」写一段**业务功能说明**:谁能用、什么场景、解决什么、输入输出是什么业务含义;用 Markdown 写,**别写路由 / 字段 / 实现方式**)")),
2255
+ a("button", {
2214
2256
  class: "p-button p-button-sm p-button-text",
2215
2257
  type: "button",
2216
2258
  disabled: S.value,
2217
- onClick: (r) => Nn(e)
2218
- }, b((e.detail ?? "").trim() ? "改详情" : "写详情"), 9, Al)
2259
+ onClick: (r) => Hn(e)
2260
+ }, b((e.detail ?? "").trim() ? "改详情" : "写详情"), 9, Il)
2219
2261
  ], 64)) : (d(), p(M, { key: 1 }, [
2220
- vt(l("textarea", {
2262
+ vt(a("textarea", {
2221
2263
  "onUpdate:modelValue": t[14] || (t[14] = (r) => kt.value = r),
2222
2264
  class: "p-inputtext p-component mbc__detailinput",
2223
2265
  rows: "6",
@@ -2232,158 +2274,158 @@ ${t.text}`).join(`
2232
2274
  }, null, 512), [
2233
2275
  [Xt, kt.value]
2234
2276
  ]),
2235
- l("button", {
2277
+ a("button", {
2236
2278
  class: "p-button p-button-sm",
2237
2279
  type: "button",
2238
2280
  disabled: S.value,
2239
- onClick: (r) => In(e)
2240
- }, "存详情", 8, Rl),
2241
- l("button", {
2281
+ onClick: (r) => zn(e)
2282
+ }, "存详情", 8, Dl),
2283
+ a("button", {
2242
2284
  class: "p-button p-button-sm p-button-text",
2243
2285
  type: "button",
2244
2286
  disabled: S.value,
2245
2287
  onClick: t[15] || (t[15] = (r) => yt.value = "")
2246
- }, "取消", 8, Ol)
2288
+ }, "取消", 8, Nl)
2247
2289
  ], 64))
2248
2290
  ]),
2249
- t[77] || (t[77] = l("dt", null, "文件", -1)),
2250
- l("dd", null, b((e.fileNames || []).join(" / ") || "(没有文件)"), 1),
2251
- t[78] || (t[78] = l("dt", null, "版本", -1)),
2252
- l("dd", null, [
2291
+ t[77] || (t[77] = a("dt", null, "文件", -1)),
2292
+ a("dd", null, b((e.fileNames || []).join(" / ") || "(没有文件)"), 1),
2293
+ t[78] || (t[78] = a("dt", null, "版本", -1)),
2294
+ a("dd", null, [
2253
2295
  $("v" + b(e.version || 1), 1),
2254
- l("span", Pl, "(一共留着 " + b(e.versionCount ?? ot.value[e.id]?.length ?? 1) + " 版)", 1)
2296
+ a("span", Fl, "(一共留着 " + b(e.versionCount ?? ot.value[e.id]?.length ?? 1) + " 版)", 1)
2255
2297
  ]),
2256
- t[79] || (t[79] = l("dt", null, "标签", -1)),
2257
- l("dd", null, [
2298
+ t[79] || (t[79] = a("dt", null, "标签", -1)),
2299
+ a("dd", null, [
2258
2300
  Z.value !== e.id ? (d(), p(M, { key: 0 }, [
2259
2301
  (d(!0), p(M, null, N(e.tags ?? [], (r) => (d(), p("span", {
2260
2302
  key: r,
2261
2303
  class: "p-tag mbc__tag"
2262
2304
  }, b(r), 1))), 128)),
2263
- (e.tags ?? []).length === 0 ? (d(), p("span", jl, "(没贴标签)")) : k("", !0),
2264
- l("button", {
2305
+ (e.tags ?? []).length === 0 ? (d(), p("span", Ul, "(没贴标签)")) : k("", !0),
2306
+ a("button", {
2265
2307
  class: "p-button p-button-sm p-button-text",
2266
2308
  type: "button",
2267
2309
  disabled: S.value,
2268
- onClick: (r) => Dn(e)
2269
- }, "改标签", 8, Ll)
2310
+ onClick: (r) => Un(e)
2311
+ }, "改标签", 8, zl)
2270
2312
  ], 64)) : (d(), p(M, { key: 1 }, [
2271
- vt(l("input", {
2313
+ vt(a("input", {
2272
2314
  "onUpdate:modelValue": t[16] || (t[16] = (r) => X.value = r),
2273
2315
  class: "p-inputtext p-component mbc__taginput",
2274
2316
  type: "text",
2275
2317
  placeholder: "逗号分隔,例如:订单, 报表",
2276
- onKeyup: ds((r) => Fe(e), ["enter"])
2277
- }, null, 40, Dl), [
2318
+ onKeyup: vs((r) => Ue(e), ["enter"])
2319
+ }, null, 40, Hl), [
2278
2320
  [Xt, X.value]
2279
2321
  ]),
2280
- l("button", {
2322
+ a("button", {
2281
2323
  class: "p-button p-button-sm",
2282
2324
  type: "button",
2283
2325
  disabled: S.value,
2284
- onClick: (r) => Fe(e)
2285
- }, "存标签", 8, Il),
2286
- l("button", {
2326
+ onClick: (r) => Ue(e)
2327
+ }, "存标签", 8, Kl),
2328
+ a("button", {
2287
2329
  class: "p-button p-button-sm p-button-text",
2288
2330
  type: "button",
2289
2331
  disabled: S.value,
2290
2332
  onClick: t[17] || (t[17] = (r) => Z.value = "")
2291
- }, "取消", 8, Nl),
2292
- z.value.length > 0 ? (d(), p("div", Fl, [
2293
- t[74] || (t[74] = l("span", { class: "mbc__hint" }, "点现成的加进去:", -1)),
2294
- (d(!0), p(M, null, N(z.value.slice(0, 16), (r) => (d(), p("button", {
2333
+ }, "取消", 8, ql),
2334
+ U.value.length > 0 ? (d(), p("div", Vl, [
2335
+ t[74] || (t[74] = a("span", { class: "mbc__hint" }, "点现成的加进去:", -1)),
2336
+ (d(!0), p(M, null, N(U.value.slice(0, 16), (r) => (d(), p("button", {
2295
2337
  key: r.tag,
2296
2338
  class: "p-tag mbc__tag",
2297
2339
  type: "button",
2298
2340
  title: `把「${r.tag}」加进去`,
2299
- onClick: (B) => Fn(r.tag)
2300
- }, b(r.tag), 9, zl))), 128))
2341
+ onClick: (B) => Kn(r.tag)
2342
+ }, b(r.tag), 9, Jl))), 128))
2301
2343
  ])) : k("", !0),
2302
- X.value.trim() ? (d(), p("div", Ul, [
2303
- t[75] || (t[75] = l("span", { class: "mbc__hint" }, "这一块会贴:", -1)),
2344
+ X.value.trim() ? (d(), p("div", Wl, [
2345
+ t[75] || (t[75] = a("span", { class: "mbc__hint" }, "这一块会贴:", -1)),
2304
2346
  (d(!0), p(M, null, N(X.value.split(/[,,\s]+/).filter(Boolean), (r) => (d(), p("button", {
2305
2347
  key: r,
2306
2348
  class: "p-tag mbc__tag",
2307
2349
  type: "button",
2308
2350
  title: `从这一块上摘掉「${r}」`,
2309
- onClick: (B) => zn(r)
2310
- }, b(r) + " ×", 9, Hl))), 128))
2351
+ onClick: (B) => qn(r)
2352
+ }, b(r) + " ×", 9, Gl))), 128))
2311
2353
  ])) : k("", !0)
2312
2354
  ], 64))
2313
2355
  ]),
2314
- t[80] || (t[80] = l("dt", null, "更新", -1)),
2315
- l("dd", null, b(e.updatedAt || "—"), 1),
2316
- t[81] || (t[81] = l("dt", null, "id", -1)),
2317
- l("dd", Kl, b(e.id), 1)
2356
+ t[80] || (t[80] = a("dt", null, "更新", -1)),
2357
+ a("dd", null, b(e.updatedAt || "—"), 1),
2358
+ t[81] || (t[81] = a("dt", null, "id", -1)),
2359
+ a("dd", Yl, b(e.id), 1)
2318
2360
  ]),
2319
- l("div", ql, [
2320
- l("button", {
2361
+ a("div", Zl, [
2362
+ a("button", {
2321
2363
  class: "p-button p-button-sm p-button-outlined",
2322
2364
  type: "button",
2323
2365
  disabled: S.value,
2324
2366
  onClick: (r) => oe(e),
2325
2367
  title: "删掉这一块的代码文件:本机的文件夹 + 库里那份代码正文(点下去会先问你确认)。块本身留着,页面上会显示成占位框"
2326
- }, "删除代码文件", 8, Vl)
2368
+ }, "删除代码文件", 8, Xl)
2327
2369
  ]),
2328
- l("div", Jl, [
2329
- l("div", Gl, [
2330
- t[82] || (t[82] = l("strong", null, "版本(每次上传 +1,旧的都留着)", -1)),
2331
- l("button", {
2370
+ a("div", Ql, [
2371
+ a("div", ta, [
2372
+ t[82] || (t[82] = a("strong", null, "版本(每次上传 +1,旧的都留着)", -1)),
2373
+ a("button", {
2332
2374
  class: "p-button p-button-sm p-button-text",
2333
2375
  type: "button",
2334
2376
  disabled: S.value,
2335
- onClick: (r) => D(e.id)
2336
- }, b(w.value === e.id ? "读版本中…" : "刷新版本"), 9, Wl)
2377
+ onClick: (r) => I(e.id)
2378
+ }, b(w.value === e.id ? "读版本中…" : "刷新版本"), 9, ea)
2337
2379
  ]),
2338
- ot.value[e.id] ? ot.value[e.id].length > 0 ? (d(), p("ul", Zl, [
2380
+ ot.value[e.id] ? ot.value[e.id].length > 0 ? (d(), p("ul", sa, [
2339
2381
  (d(!0), p(M, null, N(ot.value[e.id], (r) => (d(), p("li", {
2340
2382
  key: r.number,
2341
2383
  class: K({ "is-current": r.current })
2342
2384
  }, [
2343
- l("span", Xl, b(rt(r)), 1),
2344
- l("span", Ql, [
2345
- $(b(r.fileCount) + " 个文件 · " + b(It(r.sizeBytes)), 1),
2385
+ a("span", oa, b(rt(r)), 1),
2386
+ a("span", la, [
2387
+ $(b(r.fileCount) + " 个文件 · " + b(Dt(r.sizeBytes)), 1),
2346
2388
  r.createdBy ? (d(), p(M, { key: 0 }, [
2347
2389
  $(" · " + b(r.createdBy), 1)
2348
2390
  ], 64)) : k("", !0),
2349
2391
  $(" · " + b(r.createdAt || "—"), 1)
2350
2392
  ]),
2351
- l("span", ta, [
2352
- l("button", {
2393
+ a("span", aa, [
2394
+ a("button", {
2353
2395
  class: "p-button p-button-sm p-button-text",
2354
2396
  type: "button",
2355
2397
  disabled: S.value || r.empty,
2356
- onClick: (B) => On(e, r.number),
2398
+ onClick: (B) => In(e, r.number),
2357
2399
  title: r.empty ? "这一版是空包(代码被删过),没有正文可看" : "看这一版的正文(只读)"
2358
- }, "查看", 8, ea),
2359
- l("button", {
2400
+ }, "查看", 8, ia),
2401
+ a("button", {
2360
2402
  class: "p-button p-button-sm p-button-text",
2361
2403
  type: "button",
2362
2404
  disabled: S.value || r.current || r.empty,
2363
- onClick: (B) => Pn(e, r.number),
2405
+ onClick: (B) => Dn(e, r.number),
2364
2406
  title: r.current ? "这一版正在跑" : "把这一版变成当前版(会记成一个新版本)"
2365
- }, "切回", 8, na),
2366
- l("button", {
2407
+ }, "切回", 8, ua),
2408
+ a("button", {
2367
2409
  class: "p-button p-button-sm p-button-text",
2368
2410
  type: "button",
2369
2411
  disabled: S.value || r.empty,
2370
- onClick: (B) => Ln(e, r.number),
2412
+ onClick: (B) => Fn(e, r.number),
2371
2413
  title: r.empty ? "空包没什么可下的" : "下载这一版(一个 zip)"
2372
- }, "下载", 8, sa),
2373
- l("button", {
2414
+ }, "下载", 8, ca),
2415
+ a("button", {
2374
2416
  class: "p-button p-button-sm p-button-text",
2375
2417
  type: "button",
2376
2418
  disabled: S.value || r.current,
2377
- onClick: (B) => jn(e, r.number),
2419
+ onClick: (B) => Nn(e, r.number),
2378
2420
  title: r.current ? "当前那一版不许删:先切到别的版本" : "删掉这一版(别的版本不受影响)"
2379
- }, "删", 8, oa)
2421
+ }, "删", 8, ra)
2380
2422
  ])
2381
2423
  ], 2))), 128))
2382
- ])) : (d(), p("p", la, "这个块还没有版本记录(它从没被保存过)。")) : (d(), p("p", Yl, "正在读版本…(没读到时点「刷新版本」)")),
2383
- T.value && T.value.id === e.id ? (d(), p("div", aa, [
2384
- l("div", ia, [
2385
- l("strong", null, "看 v" + b(T.value.number) + " 的正文(只读)", 1),
2386
- l("button", {
2424
+ ])) : (d(), p("p", da, "这个块还没有版本记录(它从没被保存过)。")) : (d(), p("p", na, "正在读版本…(没读到时点「刷新版本」)")),
2425
+ T.value && T.value.id === e.id ? (d(), p("div", pa, [
2426
+ a("div", fa, [
2427
+ a("strong", null, "看 v" + b(T.value.number) + " 的正文(只读)", 1),
2428
+ a("button", {
2387
2429
  class: "p-button p-button-sm p-button-text",
2388
2430
  type: "button",
2389
2431
  onClick: t[18] || (t[18] = (r) => T.value = null)
@@ -2393,8 +2435,8 @@ ${t.text}`).join(`
2393
2435
  key: B,
2394
2436
  class: "mbc__viewer-file"
2395
2437
  }, [
2396
- l("summary", ua, b(B) + "(" + b(It(r.length)) + ")", 1),
2397
- l("pre", ca, b(r), 1)
2438
+ a("summary", ba, b(B) + "(" + b(Dt(r.length)) + ")", 1),
2439
+ a("pre", ma, b(r), 1)
2398
2440
  ]))), 128))
2399
2441
  ])) : k("", !0)
2400
2442
  ])
@@ -2402,41 +2444,41 @@ ${t.text}`).join(`
2402
2444
  ]))), 128))
2403
2445
  ])
2404
2446
  ], 512), [
2405
- [Qt, R.value === "blocks"]
2447
+ [Qt, O.value === "blocks"]
2406
2448
  ]),
2407
- vt(l("section", ra, [
2408
- t[92] || (t[92] = l("h3", { class: "mbc__title" }, "导出去改(用你自己的编辑器)", -1)),
2409
- l("div", da, [
2410
- t[83] || (t[83] = l("span", { class: "mbc__label" }, "体检", -1)),
2411
- l("button", {
2449
+ vt(a("section", va, [
2450
+ t[92] || (t[92] = a("h3", { class: "mbc__title" }, "导出去改(用你自己的编辑器)", -1)),
2451
+ a("div", ha, [
2452
+ t[83] || (t[83] = a("span", { class: "mbc__label" }, "体检", -1)),
2453
+ a("button", {
2412
2454
  class: "p-button p-button-sm",
2413
2455
  type: "button",
2414
2456
  disabled: S.value,
2415
- onClick: t[19] || (t[19] = (e) => Wn())
2416
- }, b(Dt.value ? "校验中…" : "校验全部魔法块"), 9, pa),
2417
- t[84] || (t[84] = l("span", { class: "mbc__hint" }, "重新跑一遍逐块判据(试加载 + 引用深检),过不了的整块停用;改好再点一次就恢复。", -1))
2457
+ onClick: t[19] || (t[19] = (e) => Qn())
2458
+ }, b(It.value ? "校验中…" : "校验全部魔法块"), 9, ga),
2459
+ t[84] || (t[84] = a("span", { class: "mbc__hint" }, "重新跑一遍逐块判据(试加载 + 引用深检),过不了的整块停用;改好再点一次就恢复。", -1))
2418
2460
  ]),
2419
- t[93] || (t[93] = l("hr", { class: "mbc__rule" }, null, -1)),
2420
- l("div", ba, [
2421
- t[86] || (t[86] = l("span", { class: "mbc__label" }, "导出范围", -1)),
2422
- l("label", fa, [
2423
- l("input", {
2461
+ t[93] || (t[93] = a("hr", { class: "mbc__rule" }, null, -1)),
2462
+ a("div", _a, [
2463
+ t[86] || (t[86] = a("span", { class: "mbc__label" }, "导出范围", -1)),
2464
+ a("label", ya, [
2465
+ a("input", {
2424
2466
  type: "radio",
2425
2467
  name: "mbc-scope",
2426
2468
  value: "one",
2427
2469
  checked: Q.value === "one",
2428
2470
  onChange: t[20] || (t[20] = (e) => Q.value = "one")
2429
- }, null, 40, ma),
2471
+ }, null, 40, ka),
2430
2472
  t[85] || (t[85] = $(" 仅这一个块 ", -1))
2431
2473
  ]),
2432
- l("label", va, [
2433
- l("input", {
2474
+ a("label", $a, [
2475
+ a("input", {
2434
2476
  type: "radio",
2435
2477
  name: "mbc-scope",
2436
2478
  value: "all",
2437
2479
  checked: Q.value === "all",
2438
2480
  onChange: t[21] || (t[21] = (e) => Q.value = "all")
2439
- }, null, 40, ha),
2481
+ }, null, 40, wa),
2440
2482
  $(" 全部块(" + b(v.value.length) + " 个) ", 1)
2441
2483
  ]),
2442
2484
  Q.value === "one" ? (d(), p("select", {
@@ -2446,311 +2488,311 @@ ${t.text}`).join(`
2446
2488
  disabled: S.value || v.value.length === 0,
2447
2489
  onChange: t[22] || (t[22] = (e) => Kt(e.target.value))
2448
2490
  }, [
2449
- v.value.length === 0 ? (d(), p("option", ga, "(库里还没有块)")) : k("", !0),
2491
+ v.value.length === 0 ? (d(), p("option", Ca, "(库里还没有块)")) : k("", !0),
2450
2492
  (d(!0), p(M, null, N(v.value, (e) => (d(), p("option", {
2451
2493
  key: e.id,
2452
2494
  value: e.id
2453
- }, b(e.module) + " / " + b(e.name || e.id), 9, ya))), 128))
2454
- ], 40, _a)) : k("", !0)
2495
+ }, b(e.module) + " / " + b(e.name || e.id), 9, Sa))), 128))
2496
+ ], 40, xa)) : k("", !0)
2455
2497
  ]),
2456
- l("div", ka, [
2457
- t[87] || (t[87] = l("label", { for: "mbc-dir" }, "导出目录", -1)),
2458
- l("input", {
2498
+ a("div", Ea, [
2499
+ t[87] || (t[87] = a("label", { for: "mbc-dir" }, "导出目录", -1)),
2500
+ a("input", {
2459
2501
  id: "mbc-dir",
2460
2502
  class: "p-inputtext p-component mbc__grow mbc__mono",
2461
2503
  type: "text",
2462
2504
  readonly: "",
2463
2505
  value: q.value ? q.value.name : "(还没选:点右边那个按钮选一个文件夹)"
2464
- }, null, 8, $a),
2465
- l("button", {
2506
+ }, null, 8, Ta),
2507
+ a("button", {
2466
2508
  class: "p-button p-button-sm p-button-outlined",
2467
2509
  type: "button",
2468
2510
  disabled: S.value,
2469
- onClick: t[23] || (t[23] = (e) => He("export"))
2470
- }, "选择文件夹", 8, wa),
2471
- l("button", {
2511
+ onClick: t[23] || (t[23] = (e) => Ke("export"))
2512
+ }, "选择文件夹", 8, Ba),
2513
+ a("button", {
2472
2514
  class: "p-button p-button-sm mbc__act-export",
2473
2515
  type: "button",
2474
- disabled: S.value || Q.value === "one" && !ft.value,
2475
- title: Q.value === "one" && !ft.value ? "先在左边挑一个块(或者把范围改成「全部块」)" : "把库里的块铺到你选的文件夹",
2476
- onClick: t[24] || (t[24] = (e) => Yn())
2477
- }, b(ut.value ? "导出中…" : "导出"), 9, xa)
2516
+ disabled: S.value || Q.value === "one" && !bt.value,
2517
+ title: Q.value === "one" && !bt.value ? "先在左边挑一个块(或者把范围改成「全部块」)" : "把库里的块铺到你选的文件夹",
2518
+ onClick: t[24] || (t[24] = (e) => ts())
2519
+ }, b(ut.value ? "导出中…" : "导出"), 9, Ma)
2478
2520
  ]),
2479
- l("p", Ca, [
2480
- $(b(Q.value === "all" ? `这一趟铺全部 ${v.value.length} 个块` : ft.value ? `这一趟只铺「${ft.value.module} / ${ft.value.name || ft.value.id}」` : "先挑一个块") + " ⇒ ", 1),
2481
- t[88] || (t[88] = l("span", { class: "mbc__mono" }, "workspace/<可读名>-<块 uuid>/", -1)),
2521
+ a("p", Aa, [
2522
+ $(b(Q.value === "all" ? `这一趟铺全部 ${v.value.length} 个块` : bt.value ? `这一趟只铺「${bt.value.module} / ${bt.value.name || bt.value.id}」` : "先挑一个块") + " ⇒ ", 1),
2523
+ t[88] || (t[88] = a("span", { class: "mbc__mono" }, "workspace/<可读名>-<块 uuid>/", -1)),
2482
2524
  t[89] || (t[89] = $(",顶层另附开发说明与 ", -1)),
2483
- t[90] || (t[90] = l("span", { class: "mbc__mono" }, "example/", -1)),
2525
+ t[90] || (t[90] = a("span", { class: "mbc__mono" }, "example/", -1)),
2484
2526
  t[91] || (t[91] = $("。 ", -1))
2485
2527
  ]),
2486
- V.value ? (d(), p("p", Sa, b(V.value), 1)) : k("", !0)
2528
+ V.value ? (d(), p("p", Oa, b(V.value), 1)) : k("", !0)
2487
2529
  ], 512), [
2488
- [Qt, R.value === "workspace"]
2530
+ [Qt, O.value === "workspace"]
2489
2531
  ]),
2490
- vt(l("section", Ea, [
2491
- t[102] || (t[102] = l("h3", { class: "mbc__title" }, "读回改动", -1)),
2492
- l("div", Ta, [
2493
- t[94] || (t[94] = l("label", { for: "mbc-read-dir" }, "读回目录", -1)),
2494
- l("input", {
2532
+ vt(a("section", Ra, [
2533
+ t[102] || (t[102] = a("h3", { class: "mbc__title" }, "读回改动", -1)),
2534
+ a("div", Pa, [
2535
+ t[94] || (t[94] = a("label", { for: "mbc-read-dir" }, "读回目录", -1)),
2536
+ a("input", {
2495
2537
  id: "mbc-read-dir",
2496
2538
  class: "p-inputtext p-component mbc__grow mbc__mono",
2497
2539
  type: "text",
2498
2540
  readonly: "",
2499
- value: U.value ? U.value.name : "(还没选:导出会自动填上,也可以自己选一个)"
2500
- }, null, 8, Ba),
2501
- l("button", {
2541
+ value: z.value ? z.value.name : "(还没选:导出会自动填上,也可以自己选一个)"
2542
+ }, null, 8, ja),
2543
+ a("button", {
2502
2544
  class: "p-button p-button-sm p-button-outlined",
2503
2545
  type: "button",
2504
2546
  disabled: S.value,
2505
- onClick: t[25] || (t[25] = (e) => He("read"))
2506
- }, "选择文件夹", 8, Ma),
2507
- l("button", {
2547
+ onClick: t[25] || (t[25] = (e) => Ke("read"))
2548
+ }, "选择文件夹", 8, La),
2549
+ a("button", {
2508
2550
  class: "p-button p-button-sm p-button-outlined",
2509
2551
  type: "button",
2510
2552
  disabled: S.value,
2511
- onClick: t[26] || (t[26] = (e) => Ve())
2512
- }, b($t.value ? "读回中…" : "读回改动"), 9, Aa)
2553
+ onClick: t[26] || (t[26] = (e) => Je())
2554
+ }, b($t.value ? "读回中…" : "读回改动"), 9, Ia)
2513
2555
  ]),
2514
- U.value && q.value && U.value.name !== q.value.name ? (d(), p("p", Ra, " 读回的是「" + b(U.value.name) + "」(与导出目录「" + b(q.value.name) + "」不是同一个 —— 想同步就再选一次)。 ", 1)) : (d(), p("p", Oa, "读回目录默认跟着导出目录;要读别的文件夹就点「选择文件夹」单独选一个。")),
2515
- O.value ? (d(), p(M, { key: 2 }, [
2516
- Gt.value.length > 0 ? (d(), p("p", Pa, [
2556
+ z.value && q.value && z.value.name !== q.value.name ? (d(), p("p", Da, " 读回的是「" + b(z.value.name) + "」(与导出目录「" + b(q.value.name) + "」不是同一个 —— 想同步就再选一次)。 ", 1)) : (d(), p("p", Na, "读回目录默认跟着导出目录;要读别的文件夹就点「选择文件夹」单独选一个。")),
2557
+ R.value ? (d(), p(M, { key: 2 }, [
2558
+ Wt.value.length > 0 ? (d(), p("p", Fa, [
2517
2559
  t[95] || (t[95] = $(" 扫到 ", -1)),
2518
- l("b", null, b(O.value.blocks.length), 1),
2560
+ a("b", null, b(R.value.blocks.length), 1),
2519
2561
  t[96] || (t[96] = $(" 个块,其中 ", -1)),
2520
- l("b", ja, b(Gt.value.length), 1),
2562
+ a("b", Ua, b(Wt.value.length), 1),
2521
2563
  t[97] || (t[97] = $(" 个可以存;已经勾了 ", -1)),
2522
- l("b", null, b(Wt.value.length), 1),
2564
+ a("b", null, b(Gt.value.length), 1),
2523
2565
  t[98] || (t[98] = $(" 个。 ", -1)),
2524
- l("button", {
2566
+ a("button", {
2525
2567
  class: "p-button p-button-sm p-button-text",
2526
2568
  type: "button",
2527
2569
  disabled: S.value,
2528
- onClick: t[27] || (t[27] = (e) => Je(!0))
2529
- }, "全选可存的", 8, La),
2530
- l("button", {
2570
+ onClick: t[27] || (t[27] = (e) => We(!0))
2571
+ }, "全选可存的", 8, za),
2572
+ a("button", {
2531
2573
  class: "p-button p-button-sm p-button-text",
2532
2574
  type: "button",
2533
- disabled: S.value || Wt.value.length === 0,
2534
- onClick: t[28] || (t[28] = (e) => Je(!1))
2535
- }, "全不选", 8, Da)
2575
+ disabled: S.value || Gt.value.length === 0,
2576
+ onClick: t[28] || (t[28] = (e) => We(!1))
2577
+ }, "全不选", 8, Ha)
2536
2578
  ])) : k("", !0),
2537
- O.value.blocks.length > 0 ? (d(), p("ul", Ia, [
2538
- (d(!0), p(M, null, N(O.value.blocks, (e) => (d(), p("li", {
2579
+ R.value.blocks.length > 0 ? (d(), p("ul", Ka, [
2580
+ (d(!0), p(M, null, N(R.value.blocks, (e) => (d(), p("li", {
2539
2581
  key: e.id,
2540
2582
  class: K(["mbc__block", { "is-picked": ct.value[e.id] === !0, "is-blocked": !e.canApply }])
2541
2583
  }, [
2542
- l("label", Na, [
2543
- l("span", {
2584
+ a("label", qa, [
2585
+ a("span", {
2544
2586
  class: K(["p-checkbox p-component", { "p-disabled": !e.canApply }])
2545
2587
  }, [
2546
- l("input", {
2588
+ a("input", {
2547
2589
  class: "p-checkbox-input",
2548
2590
  type: "checkbox",
2549
2591
  disabled: !e.canApply,
2550
2592
  checked: ct.value[e.id] === !0,
2551
- onChange: (r) => ns(e.id, r)
2552
- }, null, 40, Fa),
2553
- t[99] || (t[99] = l("span", { class: "p-checkbox-box" }, null, -1))
2593
+ onChange: (r) => as(e.id, r)
2594
+ }, null, 40, Va),
2595
+ t[99] || (t[99] = a("span", { class: "p-checkbox-box" }, null, -1))
2554
2596
  ], 2),
2555
- l("span", za, b(e.name || e.id), 1),
2556
- l("span", {
2597
+ a("span", Ja, b(e.name || e.id), 1),
2598
+ a("span", {
2557
2599
  class: K(["p-tag", e.status === "modified" ? "p-tag-success" : e.status === "missing" ? "p-tag-warning" : e.status === "not-in-db" ? "p-tag-info" : ""])
2558
2600
  }, b(s[e.status]), 3),
2559
- l("span", Ua, b(e.module || "—"), 1)
2601
+ a("span", Wa, b(e.module || "—"), 1)
2560
2602
  ]),
2561
- l("p", Ha, [
2603
+ a("p", Ga, [
2562
2604
  e.status === "missing" ? (d(), p(M, { key: 0 }, [
2563
2605
  $("目录里没有这一块,勾不上")
2564
2606
  ], 64)) : e.status === "not-in-db" ? (d(), p(M, { key: 1 }, [
2565
2607
  $("库里还没有这一块 —— 勾上它保存,就是按这一包新建")
2566
2608
  ], 64)) : e.changedFiles.length > 0 ? (d(), p(M, { key: 2 }, [
2567
2609
  t[100] || (t[100] = $("改了:", -1)),
2568
- l("span", Ka, b(e.changedFiles.join(" / ")), 1)
2610
+ a("span", Ya, b(e.changedFiles.join(" / ")), 1)
2569
2611
  ], 64)) : (d(), p(M, { key: 3 }, [
2570
2612
  $("内容与库里一致")
2571
2613
  ], 64))
2572
2614
  ]),
2573
- e.blockedWhy ? (d(), p("p", qa, "不能存:" + b(e.blockedWhy), 1)) : k("", !0),
2574
- l("p", Va, b(e.folder || e.where), 1)
2615
+ e.blockedWhy ? (d(), p("p", Za, "不能存:" + b(e.blockedWhy), 1)) : k("", !0),
2616
+ a("p", Xa, b(e.folder || e.where), 1)
2575
2617
  ], 2))), 128))
2576
- ])) : (d(), p("p", Ja, "这个目录里没有认出任何块(点上面那个按钮再扫一次,或者确认文件夹名里有那个块的 uuid)。")),
2577
- l("div", Ga, [
2618
+ ])) : (d(), p("p", Qa, "这个目录里没有认出任何块(点上面那个按钮再扫一次,或者确认文件夹名里有那个块的 uuid)。")),
2619
+ a("div", ti, [
2578
2620
  dt.value > 0 ? (d(), p("button", {
2579
2621
  key: 0,
2580
2622
  class: "p-button p-button-sm mbc__report-btn",
2581
2623
  type: "button",
2582
2624
  title: "点开看这一趟的全部问题(" + dt.value + " 条)",
2583
- onClick: t[29] || (t[29] = (e) => Rt.value = !0)
2584
- }, "查看问题(" + b(dt.value) + ")⚠", 9, Wa)) : (d(), p("span", Ya, "这一趟没有问题")),
2585
- O.value.unmatched.length > 0 ? (d(), p("span", {
2625
+ onClick: t[29] || (t[29] = (e) => Ot.value = !0)
2626
+ }, "查看问题(" + b(dt.value) + ")⚠", 9, ei)) : (d(), p("span", ni, "这一趟没有问题")),
2627
+ R.value.unmatched.length > 0 ? (d(), p("span", {
2586
2628
  key: 2,
2587
2629
  class: "mbc__chip is-bad",
2588
- title: O.value.unmatched.join(" / ")
2589
- }, "认不出归属的文件夹 " + b(O.value.unmatched.length), 9, Za)) : k("", !0)
2630
+ title: R.value.unmatched.join(" / ")
2631
+ }, "认不出归属的文件夹 " + b(R.value.unmatched.length), 9, si)) : k("", !0)
2590
2632
  ]),
2591
- (O.value.skipped ?? []).length > 0 ? (d(), p("p", Xa, [
2592
- $(" 忽略了 " + b((O.value.skipped ?? []).length) + " 个文件夹(名字里没有 uuid,当测试文件处理 —— 与忽略 ", 1),
2593
- t[101] || (t[101] = l("span", { class: "mbc__mono" }, "example/", -1)),
2594
- $(" 同一个规矩):" + b((O.value.skipped ?? []).join(" / ")), 1)
2633
+ (R.value.skipped ?? []).length > 0 ? (d(), p("p", oi, [
2634
+ $(" 忽略了 " + b((R.value.skipped ?? []).length) + " 个文件夹(名字里没有 uuid,当测试文件处理 —— 与忽略 ", 1),
2635
+ t[101] || (t[101] = a("span", { class: "mbc__mono" }, "example/", -1)),
2636
+ $(" 同一个规矩):" + b((R.value.skipped ?? []).join(" / ")), 1)
2595
2637
  ])) : k("", !0),
2596
- l("div", Qa, [
2597
- l("button", {
2638
+ a("div", li, [
2639
+ a("button", {
2598
2640
  class: "p-button p-button-sm mbc__act-import",
2599
2641
  type: "button",
2600
2642
  disabled: S.value,
2601
- onClick: t[30] || (t[30] = (e) => es())
2602
- }, b(st.value ? "保存中…" : `保存选中的块(${Wt.value.length})`), 9, ti)
2643
+ onClick: t[30] || (t[30] = (e) => ls())
2644
+ }, b(st.value ? "保存中…" : `保存选中的块(${Gt.value.length})`), 9, ai)
2603
2645
  ])
2604
2646
  ], 64)) : k("", !0)
2605
2647
  ], 512), [
2606
- [Qt, R.value === "workspace"]
2648
+ [Qt, O.value === "workspace"]
2607
2649
  ]),
2608
- vt(l("section", ei, [
2609
- l("h3", ni, [
2650
+ vt(a("section", ii, [
2651
+ a("h3", ui, [
2610
2652
  t[103] || (t[103] = $(" 不在数据库 ", -1)),
2611
- l("span", si, b(it(a)), 1),
2612
- l("span", oi, b(pe.value.length), 1)
2653
+ a("span", ci, b(it(l)), 1),
2654
+ a("span", ri, b(pe.value.length), 1)
2613
2655
  ]),
2614
- pe.value.length === 0 ? (d(), p("p", li, "路由表里声明的块,库里都有那一行。")) : (d(), p(M, { key: 1 }, [
2615
- l("p", ai, [
2656
+ pe.value.length === 0 ? (d(), p("p", di, "路由表里声明的块,库里都有那一行。")) : (d(), p(M, { key: 1 }, [
2657
+ a("p", pi, [
2616
2658
  t[104] || (t[104] = $(" 这些页面的路由(", -1)),
2617
- t[105] || (t[105] = l("span", { class: "mbc__mono" }, "component: MagicBlockPage", -1)),
2659
+ t[105] || (t[105] = a("span", { class: "mbc__mono" }, "component: MagicBlockPage", -1)),
2618
2660
  t[106] || (t[106] = $(")声明了块的 uuid, ", -1)),
2619
- t[107] || (t[107] = l("span", { class: "mbc__mono" }, "/magic-blocks/index", -1)),
2661
+ t[107] || (t[107] = a("span", { class: "mbc__mono" }, "/magic-blocks/index", -1)),
2620
2662
  t[108] || (t[108] = $(" 里却没有这一行 —— 页面上那一块现在是占位框。 ", -1)),
2621
- t[109] || (t[109] = l("b", null, "要建进库", -1)),
2622
- $(":在上面「读回改动」里选中放这一块的文件夹(文件夹名里有 uuid), 扫出来就是一条标签写着「" + b(it(a)) + "」、能勾能存的条目。 ", 1)
2663
+ t[109] || (t[109] = a("b", null, "要建进库", -1)),
2664
+ $(":在上面「读回改动」里选中放这一块的文件夹(文件夹名里有 uuid), 扫出来就是一条标签写着「" + b(it(l)) + "」、能勾能存的条目。 ", 1)
2623
2665
  ]),
2624
- l("ul", ii, [
2666
+ a("ul", fi, [
2625
2667
  (d(!0), p(M, null, N(pe.value, (e) => (d(), p("li", {
2626
2668
  key: e.uuid,
2627
2669
  class: "mbc__block is-blocked"
2628
2670
  }, [
2629
- l("label", ui, [
2630
- t[110] || (t[110] = l("span", { class: "p-checkbox p-component p-disabled" }, [
2631
- l("input", {
2671
+ a("label", bi, [
2672
+ t[110] || (t[110] = a("span", { class: "p-checkbox p-component p-disabled" }, [
2673
+ a("input", {
2632
2674
  class: "p-checkbox-input",
2633
2675
  type: "checkbox",
2634
2676
  disabled: ""
2635
2677
  }),
2636
- l("span", { class: "p-checkbox-box" })
2678
+ a("span", { class: "p-checkbox-box" })
2637
2679
  ], -1)),
2638
- l("span", ci, b(e.title || e.uuid), 1),
2639
- l("span", ri, b(it(a)), 1),
2640
- l("span", di, b(e.module || "—"), 1)
2680
+ a("span", mi, b(e.title || e.uuid), 1),
2681
+ a("span", vi, b(it(l)), 1),
2682
+ a("span", hi, b(e.module || "—"), 1)
2641
2683
  ]),
2642
- l("p", pi, [
2684
+ a("p", gi, [
2643
2685
  t[111] || (t[111] = $(" 路由 ", -1)),
2644
- l("span", bi, b(e.path), 1),
2686
+ a("span", _i, b(e.path), 1),
2645
2687
  t[112] || (t[112] = $(" 声明了它,库里没有这个块 —— 手里还没有放这个块的文件夹,所以这里勾不上(勾上了也没有正文可存)。 ", -1))
2646
2688
  ]),
2647
- l("p", fi, b(e.uuid), 1)
2689
+ a("p", yi, b(e.uuid), 1)
2648
2690
  ]))), 128))
2649
2691
  ])
2650
2692
  ], 64))
2651
2693
  ], 512), [
2652
- [Qt, R.value === "workspace"]
2694
+ [Qt, O.value === "workspace"]
2653
2695
  ]),
2654
- R.value === "workspace" && (W.value.length > 0 || Y.value.length > 0) ? (d(), p("section", mi, [
2655
- t[113] || (t[113] = l("h3", { class: "mbc__title" }, "保存结果", -1)),
2656
- l("p", vi, [
2657
- l("span", hi, "存成 " + b(re.value), 1),
2658
- Ft.value.length > 0 ? (d(), p("span", _i, "没存成 " + b(Ft.value.length), 1)) : k("", !0),
2659
- W.value.length > 0 ? (d(), p("span", gi, "前端拦下 " + b(W.value.length), 1)) : k("", !0),
2660
- Ft.value.length === 0 && W.value.length === 0 ? (d(), p("span", yi, "明细在下面那个「查看问题」里(没问题时是空的)。")) : k("", !0)
2696
+ O.value === "workspace" && (G.value.length > 0 || Y.value.length > 0) ? (d(), p("section", ki, [
2697
+ t[113] || (t[113] = a("h3", { class: "mbc__title" }, "保存结果", -1)),
2698
+ a("p", $i, [
2699
+ a("span", wi, "存成 " + b(re.value), 1),
2700
+ Ft.value.length > 0 ? (d(), p("span", xi, "没存成 " + b(Ft.value.length), 1)) : k("", !0),
2701
+ G.value.length > 0 ? (d(), p("span", Ci, "前端拦下 " + b(G.value.length), 1)) : k("", !0),
2702
+ Ft.value.length === 0 && G.value.length === 0 ? (d(), p("span", Si, "明细在下面那个「查看问题」里(没问题时是空的)。")) : k("", !0)
2661
2703
  ]),
2662
- l("div", ki, [
2663
- l("button", {
2704
+ a("div", Ei, [
2705
+ a("button", {
2664
2706
  class: "p-button p-button-sm mbc__report-btn",
2665
2707
  type: "button",
2666
- onClick: t[31] || (t[31] = (e) => Rt.value = !0)
2708
+ onClick: t[31] || (t[31] = (e) => Ot.value = !0)
2667
2709
  }, "查看问题(" + b(dt.value) + ")⚠", 1)
2668
2710
  ])
2669
2711
  ])) : k("", !0),
2670
- t[114] || (t[114] = l("div", {
2712
+ t[114] || (t[114] = a("div", {
2671
2713
  class: "mbc__tailspace",
2672
2714
  "aria-hidden": "true"
2673
2715
  }, null, -1))
2674
2716
  ]),
2675
- l("footer", $i, [
2717
+ a("footer", Ti, [
2676
2718
  E.value.length > 0 ? (d(), p("button", {
2677
2719
  key: 0,
2678
2720
  class: "p-button p-button-sm mbc__report-btn",
2679
2721
  type: "button",
2680
2722
  title: "点开看全部报错(" + E.value.length + " 条)",
2681
2723
  onClick: t[32] || (t[32] = (e) => A.value = !0)
2682
- }, "查看报错(" + b(E.value.length) + " 条)⚠", 9, wi)) : k("", !0),
2683
- _.value ? (d(), p("p", xi, b(_.value), 1)) : y.value ? (d(), p("p", Ci, b(y.value), 1)) : (d(), p("p", Si, "—"))
2724
+ }, "查看报错(" + b(E.value.length) + " 条)⚠", 9, Bi)) : k("", !0),
2725
+ g.value ? (d(), p("p", Mi, b(g.value), 1)) : y.value ? (d(), p("p", Ai, b(y.value), 1)) : (d(), p("p", Oi, "—"))
2684
2726
  ])
2685
2727
  ], 2)) : k("", !0),
2686
- c.value && Rt.value ? (d(), p("div", {
2728
+ c.value && Ot.value ? (d(), p("div", {
2687
2729
  key: 1,
2688
2730
  class: "mbc__modal",
2689
2731
  role: "dialog",
2690
2732
  "aria-modal": "true",
2691
- onClick: t[36] || (t[36] = Ee((e) => Rt.value = !1, ["self"]))
2733
+ onClick: t[36] || (t[36] = Ee((e) => Ot.value = !1, ["self"]))
2692
2734
  }, [
2693
- l("div", Ei, [
2694
- l("header", Ti, [
2695
- l("strong", null, "读回 / 保存的问题(" + b(dt.value) + " 条)", 1),
2696
- l("button", {
2735
+ a("div", Ri, [
2736
+ a("header", Pi, [
2737
+ a("strong", null, "读回 / 保存的问题(" + b(dt.value) + " 条)", 1),
2738
+ a("button", {
2697
2739
  class: "p-button p-button-sm p-button-text",
2698
2740
  type: "button",
2699
- onClick: t[33] || (t[33] = (e) => Rt.value = !1)
2741
+ onClick: t[33] || (t[33] = (e) => Ot.value = !1)
2700
2742
  }, "收起")
2701
2743
  ]),
2702
- l("div", Bi, [
2703
- W.value.length > 0 ? (d(), p("section", Mi, [
2704
- l("h4", Ai, "前端校验拦下的(" + b(W.value.length) + ")", 1),
2705
- l("ul", Ri, [
2706
- (d(!0), p(M, null, N(W.value, (e, r) => (d(), p("li", { key: r }, b(e), 1))), 128))
2744
+ a("div", ji, [
2745
+ G.value.length > 0 ? (d(), p("section", Li, [
2746
+ a("h4", Ii, "前端校验拦下的(" + b(G.value.length) + ")", 1),
2747
+ a("ul", Di, [
2748
+ (d(!0), p(M, null, N(G.value, (e, r) => (d(), p("li", { key: r }, b(e), 1))), 128))
2707
2749
  ])
2708
2750
  ])) : k("", !0),
2709
- (O.value?.failures ?? []).length > 0 ? (d(), p("section", Oi, [
2710
- l("h4", Pi, "读回时逐条回的(" + b((O.value?.failures ?? []).length) + ")", 1),
2711
- l("ul", ji, [
2712
- (d(!0), p(M, null, N(O.value?.failures ?? [], (e, r) => (d(), p("li", { key: r }, [
2713
- l("span", Li, b(e.kind || "问题"), 1),
2714
- l("span", Di, b(e.where), 1),
2751
+ (R.value?.failures ?? []).length > 0 ? (d(), p("section", Ni, [
2752
+ a("h4", Fi, "读回时逐条回的(" + b((R.value?.failures ?? []).length) + ")", 1),
2753
+ a("ul", Ui, [
2754
+ (d(!0), p(M, null, N(R.value?.failures ?? [], (e, r) => (d(), p("li", { key: r }, [
2755
+ a("span", zi, b(e.kind || "问题"), 1),
2756
+ a("span", Hi, b(e.where), 1),
2715
2757
  $(" " + b(e.message), 1)
2716
2758
  ]))), 128))
2717
2759
  ])
2718
2760
  ])) : k("", !0),
2719
- (O.value?.unmatched ?? []).length > 0 ? (d(), p("section", Ii, [
2720
- l("h4", Ni, "认不出归属的文件夹(" + b((O.value?.unmatched ?? []).length) + ")", 1),
2721
- l("ul", Fi, [
2722
- (d(!0), p(M, null, N(O.value?.unmatched ?? [], (e, r) => (d(), p("li", { key: r }, [
2723
- l("span", zi, b(e), 1)
2761
+ (R.value?.unmatched ?? []).length > 0 ? (d(), p("section", Ki, [
2762
+ a("h4", qi, "认不出归属的文件夹(" + b((R.value?.unmatched ?? []).length) + ")", 1),
2763
+ a("ul", Vi, [
2764
+ (d(!0), p(M, null, N(R.value?.unmatched ?? [], (e, r) => (d(), p("li", { key: r }, [
2765
+ a("span", Ji, b(e), 1)
2724
2766
  ]))), 128))
2725
2767
  ])
2726
2768
  ])) : k("", !0),
2727
- Y.value.length > 0 ? (d(), p("section", Ui, [
2728
- l("h4", Hi, "保存结果(" + b(Y.value.length) + ":存成 " + b(re.value) + ",没存成 " + b(Ft.value.length) + ")", 1),
2729
- l("ul", Ki, [
2769
+ Y.value.length > 0 ? (d(), p("section", Wi, [
2770
+ a("h4", Gi, "保存结果(" + b(Y.value.length) + ":存成 " + b(re.value) + ",没存成 " + b(Ft.value.length) + ")", 1),
2771
+ a("ul", Yi, [
2730
2772
  (d(!0), p(M, null, N(Y.value, (e) => (d(), p("li", {
2731
2773
  key: e.id,
2732
2774
  class: K({ "is-ok": e.ok })
2733
2775
  }, [
2734
- l("strong", null, b(e.name || e.id) + ":" + b(e.ok ? "已保存" : "没保存"), 1),
2735
- !e.ok && e.error ? (d(), p("span", qi, b(e.error), 1)) : k("", !0),
2736
- !e.ok && (e.issues ?? []).length > 0 ? (d(), p("ul", Vi, [
2776
+ a("strong", null, b(e.name || e.id) + ":" + b(e.ok ? "已保存" : "没保存"), 1),
2777
+ !e.ok && e.error ? (d(), p("span", Zi, b(e.error), 1)) : k("", !0),
2778
+ !e.ok && (e.issues ?? []).length > 0 ? (d(), p("ul", Xi, [
2737
2779
  (d(!0), p(M, null, N(e.issues, (r, B) => (d(), p("li", { key: B }, b(r), 1))), 128))
2738
2780
  ])) : k("", !0)
2739
2781
  ], 2))), 128))
2740
2782
  ])
2741
2783
  ])) : k("", !0),
2742
- dt.value === 0 ? (d(), p("p", Ji, "这一趟没有问题。")) : k("", !0)
2784
+ dt.value === 0 ? (d(), p("p", Qi, "这一趟没有问题。")) : k("", !0)
2743
2785
  ]),
2744
- l("footer", Gi, [
2745
- l("button", {
2786
+ a("footer", tu, [
2787
+ a("button", {
2746
2788
  class: "p-button p-button-sm p-button-outlined",
2747
2789
  type: "button",
2748
- onClick: t[34] || (t[34] = (e) => Gn())
2790
+ onClick: t[34] || (t[34] = (e) => Xn())
2749
2791
  }, "复制全部"),
2750
- l("button", {
2792
+ a("button", {
2751
2793
  class: "p-button p-button-sm",
2752
2794
  type: "button",
2753
- onClick: t[35] || (t[35] = (e) => Rt.value = !1)
2795
+ onClick: t[35] || (t[35] = (e) => Ot.value = !1)
2754
2796
  }, "知道了")
2755
2797
  ])
2756
2798
  ])
@@ -2762,39 +2804,39 @@ ${t.text}`).join(`
2762
2804
  "aria-modal": "true",
2763
2805
  onClick: t[41] || (t[41] = Ee((e) => A.value = !1, ["self"]))
2764
2806
  }, [
2765
- l("div", Wi, [
2766
- l("header", Yi, [
2767
- l("strong", null, "报错(" + b(E.value.length) + " 条)", 1),
2768
- l("button", {
2807
+ a("div", eu, [
2808
+ a("header", nu, [
2809
+ a("strong", null, "报错(" + b(E.value.length) + " 条)", 1),
2810
+ a("button", {
2769
2811
  class: "p-button p-button-sm p-button-text",
2770
2812
  type: "button",
2771
2813
  onClick: t[37] || (t[37] = (e) => A.value = !1)
2772
2814
  }, "收起")
2773
2815
  ]),
2774
- l("div", Zi, [
2775
- l("ol", Xi, [
2816
+ a("div", su, [
2817
+ a("ol", ou, [
2776
2818
  (d(!0), p(M, null, N(E.value, (e, r) => (d(), p("li", { key: r }, [
2777
- l("div", Qi, [
2778
- l("span", tu, b(e.at), 1),
2819
+ a("div", lu, [
2820
+ a("span", au, b(e.at), 1),
2779
2821
  $(" · " + b(e.where), 1)
2780
2822
  ]),
2781
- l("pre", eu, b(e.text), 1)
2823
+ a("pre", iu, b(e.text), 1)
2782
2824
  ]))), 128))
2783
2825
  ]),
2784
- E.value.length === 0 ? (d(), p("p", nu, "这一轮没有报错。")) : k("", !0)
2826
+ E.value.length === 0 ? (d(), p("p", uu, "这一轮没有报错。")) : k("", !0)
2785
2827
  ]),
2786
- l("footer", su, [
2787
- l("button", {
2828
+ a("footer", cu, [
2829
+ a("button", {
2788
2830
  class: "p-button p-button-sm p-button-outlined",
2789
2831
  type: "button",
2790
- onClick: t[38] || (t[38] = (e) => Vn())
2832
+ onClick: t[38] || (t[38] = (e) => Yn())
2791
2833
  }, "复制全部"),
2792
- l("button", {
2834
+ a("button", {
2793
2835
  class: "p-button p-button-sm p-button-text",
2794
2836
  type: "button",
2795
- onClick: t[39] || (t[39] = (e) => be())
2837
+ onClick: t[39] || (t[39] = (e) => fe())
2796
2838
  }, "清空报错"),
2797
- l("button", {
2839
+ a("button", {
2798
2840
  class: "p-button p-button-sm",
2799
2841
  type: "button",
2800
2842
  onClick: t[40] || (t[40] = (e) => A.value = !1)
@@ -2811,29 +2853,34 @@ ${t.text}`).join(`
2811
2853
  }, "×")) : k("", !0)
2812
2854
  ], 2)) : k("", !0);
2813
2855
  }
2814
- }), du = /* @__PURE__ */ vn(au, [["__scopeId", "data-v-98b797e3"]]);
2856
+ }), hu = /* @__PURE__ */ hn(pu, [["__scopeId", "data-v-d5b8cd2e"]]);
2857
+ Object.assign(Mn, { [Bn]: !0 });
2815
2858
  export {
2816
- bs as API_BASE,
2817
- Ds as BLOCK_BACKEND_FILE,
2859
+ Te as API_BASE,
2860
+ zs as BLOCK_BACKEND_FILE,
2818
2861
  Ht as BLOCK_ENTRY,
2819
2862
  ye as BLOCK_MANIFEST,
2820
- hs as CLIENT_SOURCE,
2863
+ Bn as BLOCK_PAGE_MARK,
2864
+ ks as CLIENT_SOURCE,
2821
2865
  ke as MANIFEST_KEYS,
2822
2866
  en as MANIFEST_REQUIRED,
2823
- du as MagicBlockConsole,
2824
- mo as MagicBlockPage,
2825
- je as NAME_MAX,
2826
- Ks as buildPreview,
2827
- Ls as checkSelection,
2828
- yo as declaredMissing,
2829
- _o as declaredUuidOf,
2830
- go as declaredUuidsOf,
2831
- ys as installBridge,
2832
- Js as loadBlockRender,
2833
- qs as onBlockRenderRefresh,
2834
- Os as parseManifest,
2835
- Vs as refreshBlockRender,
2836
- Ps as validFileName,
2837
- Es as validName,
2838
- js as validateBlock
2867
+ hu as MagicBlockConsole,
2868
+ Mn as MagicBlockPage,
2869
+ Le as NAME_MAX,
2870
+ xo as blockPlacementProblems,
2871
+ Gs as buildPreview,
2872
+ Us as checkSelection,
2873
+ ko as declaredMissing,
2874
+ Tn as declaredUuidOf,
2875
+ yo as declaredUuidsOf,
2876
+ Cs as installBridge,
2877
+ $o as isBlockPage,
2878
+ Xs as loadBlockRender,
2879
+ Ys as onBlockRenderRefresh,
2880
+ Ds as parseManifest,
2881
+ Zs as refreshBlockRender,
2882
+ yu as setApiBase,
2883
+ Ns as validFileName,
2884
+ Os as validName,
2885
+ Fs as validateBlock
2839
2886
  };