labull-framework 0.1.29 → 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 dn, onBeforeUnmount as pn, openBlock as p, createElementBlock as f, 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 Se, 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";
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
2
  import { useRouter as bn, useRoute as hs } from "vue-router";
3
- import { A as gs, b as at, c as ne, u as mn } from "./chunk-index-BWpDbB19.js";
4
- import { u as _s, o as Te, b as vn, _ as hn, d as ys } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_06035587_lang-Fky1ghd2.js";
5
- const ft = "__mb", gn = "call", Be = "reply", _n = "host-ready", yn = "height", ks = "html, body { overflow: hidden !important; }", $s = `
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) {
@@ -19,7 +20,7 @@ const ft = "__mb", gn = "call", Be = "reply", _n = "host-ready", yn = "height",
19
20
  var data = event.data, pending;
20
21
  if (!data || data['${ft}'] === undefined) return;
21
22
  if (data['${ft}'] === '${_n}') { ready = true; queue.splice(0).forEach(function (run) { run(); }); return; }
22
- if (data['${ft}'] !== '${Be}') 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 || '调用失败'));
@@ -69,78 +70,78 @@ const ft = "__mb", gn = "call", Be = "reply", _n = "host-ready", yn = "height",
69
70
  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start();
70
71
  setInterval(report, 500);
71
72
  })();
72
- `, ws = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/;
73
+ `, $s = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/;
73
74
  function kn(o) {
74
75
  const s = typeof window > "u" ? "http://localhost" : window.location.href;
75
- return new URL(`${gs}${o}`, s);
76
+ return new URL(`${Te}${o}`, s);
76
77
  }
77
- const tn = (() => {
78
+ function ws() {
78
79
  try {
79
80
  return kn("").origin;
80
81
  } catch {
81
82
  return typeof window > "u" ? "" : window.location.origin;
82
83
  }
83
- })();
84
+ }
84
85
  async function xs(o, s, l) {
85
- if (!ws.test(s)) throw new Error(`路由名不合法:${s}(要写成 类名.方法名,例如 Customer.create)`);
86
- const i = kn(`/bx/${o}/${s}`);
87
- if (i.origin !== tn) throw new Error(`后端地址必须是本应用的(${tn}):${i.origin}`);
88
- const u = l instanceof Blob ? l : null, m = await fetch(i.toString(), {
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(l ?? {})
94
- }), d = await m.text().catch(() => "");
95
- if (m.ok) {
96
- if (!d) 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(d);
99
+ return JSON.parse(c);
99
100
  } catch {
100
- return d;
101
+ return c;
101
102
  }
102
103
  }
103
- let c = d;
104
+ let h = c;
104
105
  try {
105
- const h = JSON.parse(d);
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 = d;
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
113
  function Cs(o, s) {
113
- const l = (d) => {
114
+ const l = (f) => {
114
115
  try {
115
- o.contentWindow?.postMessage(d, "*");
116
+ o.contentWindow?.postMessage(f, "*");
116
117
  } catch (c) {
117
118
  console.warn("[magic-block] 有一条宿主消息没能发给块(协议继续走):", c);
118
119
  }
119
120
  };
120
- async function i(d, c) {
121
- if (d === "getMe") return await at("/auth/me");
122
- if (d === "navigateTab") {
121
+ async function i(f, c) {
122
+ if (f === "getMe") return await at("/auth/me");
123
+ if (f === "navigateTab") {
123
124
  const h = typeof c[0] == "string" ? c[0].trim() : "";
124
125
  if (!h || !s.onNavigateTab) throw new Error(`跳不了 ${h || "(空地址)"}:这个页面没有把宿主接到路由上`);
125
126
  return await s.onNavigateTab(h);
126
127
  }
127
- if (d === "context") return s.context ? s.context() : {};
128
- if (d === "setTabTitle") {
128
+ if (f === "context") return s.context ? s.context() : {};
129
+ if (f === "setTabTitle") {
129
130
  const h = typeof c[0] == "string" ? c[0].trim() : "", v = typeof c[1] == "string" ? c[1].trim() : "";
130
131
  if (!h) throw new Error("setTabTitle 要给一个非空的名字");
131
132
  return s.onTabTitle?.(h, v || void 0), !0;
132
133
  }
133
- if (d === "backend") {
134
+ if (f === "backend") {
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
138
  return await xs(s.uuid, h, v);
138
139
  }
139
- throw new Error(`不认识的方法:${String(d)}(这块桥只有 getMe / navigateTab / context / setTabTitle / backend 五个)`);
140
+ throw new Error(`不认识的方法:${String(f)}(这块桥只有 getMe / navigateTab / context / setTabTitle / backend 五个)`);
140
141
  }
141
- const u = (d) => {
142
- if (d.source !== o.contentWindow) return;
143
- const c = d.data;
142
+ const u = (f) => {
143
+ if (f.source !== o.contentWindow) return;
144
+ const c = f.data;
144
145
  if (!c) return;
145
146
  if (c[ft] === yn) {
146
147
  const v = typeof c.height == "number" ? c.height : NaN;
@@ -151,9 +152,9 @@ function Cs(o, s) {
151
152
  const h = c.id;
152
153
  (async () => {
153
154
  try {
154
- l({ [ft]: 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
- l({ [ft]: 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
  };
@@ -163,17 +164,17 @@ function Cs(o, s) {
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, Es = /^(?![A-Za-z]:)(?!\/)[A-Za-z0-9._\-/]+$/, Ss = /^[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
+ 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
169
  return String(o ?? "").split("/").some((s) => s.startsWith(As));
169
170
  }
170
- function Rs(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 Os = {
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` 就会报)。
@@ -220,9 +221,9 @@ function Ds(o) {
220
221
  const s = [], l = {}, i = {}, u = o.split(/\r?\n/);
221
222
  let m = 0;
222
223
  for (; m < u.length; ) {
223
- const d = u[m], c = m + 1;
224
+ const f = u[m], c = m + 1;
224
225
  m += 1;
225
- const h = Ps(d).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: | 起一个块,块里想写几行就写几行)`);
@@ -251,33 +252,33 @@ function Ds(o) {
251
252
  i[_] = c;
252
253
  const g = h.slice(v + 1).trim(), y = Ms.exec(g);
253
254
  if (y) {
254
- const S = [];
255
+ const E = [];
255
256
  for (; m < u.length; ) {
256
257
  const C = u[m];
257
258
  if (C.trim() && !/^\s/.test(C)) break;
258
- S.push(C), m += 1;
259
+ E.push(C), m += 1;
259
260
  }
260
- let A = Is(S);
261
+ let A = Is(E);
261
262
  y[1] === ">" && (A = A.split(`
262
263
  `).map((C) => C.trim()).filter(Boolean).join(" ")), l[_] = A;
263
264
  continue;
264
265
  }
265
266
  l[_] = Ls(g);
266
267
  }
267
- for (const d of en) {
268
- const c = l[d] ?? "";
268
+ for (const f of en) {
269
+ const c = l[f] ?? "";
269
270
  if (c === "") {
270
- s.push(`清单里缺少 ${d}(或者是空的):${Os[d]}`);
271
+ s.push(`清单里缺少 ${f}(或者是空的):${Rs[f]}`);
271
272
  continue;
272
273
  }
273
- d === "id" && !Ss.test(c) ? s.push(`清单里的 id 不是 uuid:${c} —— 要 8-4-4-4-12 那种十六进制`) : d === "module" && !Ts.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
- ) : d === "name" && !Rs(c) && s.push(`清单里的 name 不合法:${c} —— 不能超过 ${je} 个字符、不能含控制字符(中文可以)`);
276
+ ) : f === "name" && !Os(c) && s.push(`清单里的 name 不合法:${c} —— 不能超过 ${Le} 个字符、不能含控制字符(中文可以)`);
276
277
  }
277
278
  return [l, s];
278
279
  }
279
280
  function Ns(o) {
280
- return Es.test(o) && !o.split("/").includes("..");
281
+ return Ss.test(o) && !o.split("/").includes("..");
281
282
  }
282
283
  function Fs(o) {
283
284
  const s = [], l = o[Ht];
@@ -289,8 +290,8 @@ function Fs(o) {
289
290
  else if (!i.trim())
290
291
  s.push(`${ye} 不能是空文件`);
291
292
  else {
292
- const [m, d] = Ds(i);
293
- u = m, s.push(...d);
293
+ const [m, f] = Ds(i);
294
+ u = m, s.push(...f);
294
295
  }
295
296
  for (const m of Object.keys(o))
296
297
  Ns(m) || s.push(`文件名不合法:${m}(只许字母数字与 . _ - /,且不许 .. 与绝对路径)`);
@@ -320,16 +321,16 @@ function Ks(o) {
320
321
  }
321
322
  const qs = /<script\b([^>]*?)\bsrc\s*=\s*(["'])(.*?)\2([^>]*)>\s*<\/script\s*>/gi, Vs = /<link\b([^>]*?)\bhref\s*=\s*(["'])(.*?)\2([^>]*?)\/?>/gi;
322
323
  function Js(o, s) {
323
- const l = [], i = (d) => (l.push(d), Ks(l.length - 1));
324
- return { html: o.replace(qs, (d, c, h, v, _) => {
324
+ const l = [], i = (f) => (l.push(f), Ks(l.length - 1));
325
+ return { html: o.replace(qs, (f, c, h, v, _) => {
325
326
  const g = on(v, s);
326
- return g === void 0 ? d : i(`<script${c}${_}>
327
+ return g === void 0 ? f : i(`<script${c}${_}>
327
328
  ${wn(s[g] ?? "")}
328
329
  <\/script>`);
329
- }).replace(Vs, (d, c, h, v, _) => {
330
- if (!/\brel\s*=\s*(?:"|')?stylesheet/i.test(`${c}${_}`)) return d;
330
+ }).replace(Vs, (f, c, h, v, _) => {
331
+ if (!/\brel\s*=\s*(?:"|')?stylesheet/i.test(`${c}${_}`)) return f;
331
332
  const g = on(v, s);
332
- return g === void 0 ? d : i(`<style>
333
+ return g === void 0 ? f : i(`<style>
333
334
  ${s[g]}
334
335
  </style>`);
335
336
  }), slots: l };
@@ -341,7 +342,7 @@ function xn(o, s) {
341
342
  const l = /<\/head\s*>/i.exec(o);
342
343
  return l ? `${o.slice(0, l.index)}${s}${o.slice(l.index)}` : `${s}${o}`;
343
344
  }
344
- function Gs(o, s) {
345
+ function Ws(o, s) {
345
346
  return s ? xn(o, `<script>
346
347
  ${wn(s)}
347
348
  <\/script>
@@ -353,29 +354,29 @@ ${s}
353
354
  </style>
354
355
  `) : o;
355
356
  }
356
- function Ws(o, s = {}) {
357
+ function Gs(o, s = {}) {
357
358
  const l = s.bootstrap ?? "", i = s.css ?? "", u = s.themeCss ?? "", m = o[Ht];
358
359
  if (m === void 0) return "";
359
- const { html: d, slots: c } = Js(m, o), h = Gs(ln(ln(d, u), i), l), v = h.split($n);
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
362
  let _ = v[0] ?? "";
362
363
  for (let g = 1; g < v.length; g += 1) {
363
- const y = v[g] ?? "", S = y.indexOf("\0"), A = Number(y.slice(0, S));
364
- _ += (c[A] ?? "") + y.slice(S + 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
367
  return _;
367
368
  }
368
369
  const zt = /* @__PURE__ */ new Map();
369
370
  let jt = null;
370
- const Me = /* @__PURE__ */ new Set();
371
+ const Ae = /* @__PURE__ */ new Set();
371
372
  function Ys(o) {
372
- return Me.add(o), () => {
373
- Me.delete(o);
373
+ return Ae.add(o), () => {
374
+ Ae.delete(o);
374
375
  };
375
376
  }
376
377
  function Zs() {
377
378
  zt.clear(), jt = null;
378
- for (const o of Me) o();
379
+ for (const o of Ae) o();
379
380
  }
380
381
  async function Xs(o) {
381
382
  const s = [...new Set(o)].filter(Boolean);
@@ -402,7 +403,7 @@ function Qs(o, s) {
402
403
  }
403
404
  function Cn(o, s, l) {
404
405
  for (let i = 0; i < o.length; i += 1) {
405
- const u = o[i], m = String(u.cssText || ""), d = String(u.selectorText || "");
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
409
  if (Cn(u.cssRules, c, l), c.length === 0) continue;
@@ -413,18 +414,18 @@ ${c.map((v) => " " + v).join(`
413
414
  }`);
414
415
  continue;
415
416
  }
416
- Qs(d, m) && (s.push(m), l.n += 1);
417
+ Qs(f, m) && (s.push(m), l.n += 1);
417
418
  }
418
419
  }
419
- function En() {
420
+ function Sn() {
420
421
  const o = [], s = [], l = { n: 0 };
421
422
  let i = 0;
422
423
  const u = typeof document > "u" ? [] : Array.from(document.styleSheets);
423
- for (const d of u) {
424
- const c = d.href || "(内联 <style>)";
424
+ for (const f of u) {
425
+ const c = f.href || "(内联 <style>)";
425
426
  let h = null;
426
427
  try {
427
- h = d.cssRules;
428
+ h = f.cssRules;
428
429
  } catch {
429
430
  s.push(c);
430
431
  continue;
@@ -454,12 +455,12 @@ function En() {
454
455
  `, sheets: i, skipped: s, rules: l.n };
455
456
  }
456
457
  function to() {
457
- const o = '<button class="p-button" type="button">主要按钮</button>', s = (d, c, h) => ` <li class="labull-step${d ? ` ${d}` : ""}">
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>`, l = (d, c = "") => `<ol class="labull-steps${c ? ` ${c}` : ""}">
462
- ` + d.map(([h, v, _]) => s(h, v, _)).join(`
462
+ </li>`, l = (f, c = "") => `<ol class="labull-steps${c ? ` ${c}` : ""}">
463
+ ` + f.map(([h, v, _]) => s(h, v, _)).join(`
463
464
  `) + `
464
465
  </ol>`, i = l([
465
466
  ["is-done", "草稿", "需求已创建"],
@@ -505,8 +506,8 @@ function to() {
505
506
  ])],
506
507
  ["表格", "<table><thead><tr><th>列 A</th><th>列 B</th></tr></thead><tbody><tr><td>值</td><td>值</td></tr></tbody></table>"]
507
508
  ].map(
508
- ([d, c]) => ` <section>
509
- <h3>${d}</h3>
509
+ ([f, c]) => ` <section>
510
+ <h3>${f}</h3>
510
511
  <div class="demo">${c}</div>
511
512
  <pre>${c.replace(/&/g, "&amp;").replace(/</g, "&lt;")}</pre>
512
513
  </section>`
@@ -548,14 +549,14 @@ ${m}
548
549
  </html>
549
550
  `;
550
551
  }
551
- const Mt = /* @__PURE__ */ new Map(), Ae = /* @__PURE__ */ new Set(), eo = 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
557
  function no(o) {
557
- return Ae.add(o), () => {
558
- Ae.delete(o);
558
+ return Oe.add(o), () => {
559
+ Oe.delete(o);
559
560
  };
560
561
  }
561
562
  function $e() {
@@ -571,7 +572,7 @@ function so(o, s) {
571
572
  m && (m.delete(i), m.size === 0 && Mt.delete(l));
572
573
  };
573
574
  }
574
- function Oe(o, s, l) {
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)
@@ -584,9 +585,9 @@ function oo(o) {
584
585
  }
585
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, l);
588
+ return !i || i.size === 0 || i.has(s) ? null : Pe(o, s, l);
588
589
  }
589
- function Sn(o, s = eo) {
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();
@@ -601,7 +602,7 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
601
602
  key: 2,
602
603
  class: "mb__ring",
603
604
  "aria-hidden": "true"
604
- }, bo = ["title", "aria-label"], mo = ["title", "aria-label"], vo = ["title", "aria-label"], ho = ["title", "aria-label"], go = /* @__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,9 +611,9 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
610
611
  theme: { type: Boolean, default: !0 }
611
612
  },
612
613
  setup(o) {
613
- const s = o, l = _s(), i = bn(), { isStaff: u } = mn(), m = x(null), d = x(null), c = x(null), h = x(!1), v = x(0), _ = x(0);
614
- let g = null, y = null, S = null, A = null, C = null, R = null;
615
- 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 ?? []), E = j(() => Math.max(_.value, v.value, 1)), It = j(() => ({ height: `${E.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
618
  for (const [T, I] of Object.entries(c.value?.files ?? {})) T !== zs && (w[T] = I);
618
619
  return w;
@@ -622,7 +623,7 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
622
623
  if (!s.theme) return "";
623
624
  if (st !== null || (st = "", typeof document > "u")) return st;
624
625
  try {
625
- st = En().css;
626
+ st = Sn().css;
626
627
  } catch {
627
628
  st = "";
628
629
  }
@@ -630,8 +631,8 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
630
631
  }
631
632
  const z = j(() => {
632
633
  if (!$t.value) return "";
633
- const w = { bootstrap: $s, css: ks }, T = q();
634
- return T && (w.themeCss = T), Ws(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
638
  return { key: l.key, path: l.path, params: l.params, query: l.query };
@@ -642,12 +643,12 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
642
643
  const I = i.getRoutes().map((rt) => rt.path);
643
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
648
  function bt() {
648
- S?.(), S = null;
649
- const w = d.value;
650
- w && (S = Cs(w, {
649
+ E?.(), E = null;
650
+ const w = f.value;
651
+ w && (E = Cs(w, {
651
652
  uuid: s.uuid,
652
653
  onHeight: (T) => {
653
654
  v.value = T;
@@ -671,13 +672,13 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
671
672
  }
672
673
  const tt = (w) => !vn(w, i), V = j(() => {
673
674
  if (!u.value) return "";
674
- const w = Oe(s.uuid, l.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, l.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,7 +688,7 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["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
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;
@@ -695,7 +696,7 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
695
696
  }
696
697
  function Y() {
697
698
  if (!l.active.value || !m.value) return;
698
- const w = W();
699
+ const w = G();
699
700
  w > 0 && Math.abs(w - _.value) > 1 && (_.value = w);
700
701
  }
701
702
  function ot() {
@@ -703,12 +704,12 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
703
704
  const w = ct(m.value);
704
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(d, () => bt()), Pt(z, () => {
707
+ return Pt(f, () => bt()), Pt(z, () => {
707
708
  v.value = 0, _.value = 0, ot();
708
709
  }, { flush: "post" }), Pt(() => s.uuid, () => {
709
- Qe().then(() => ot());
710
+ tn().then(() => ot());
710
711
  }), Pt(() => l.active.value, (w) => {
711
- w && Qe().then(() => {
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" });
@@ -716,12 +717,12 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
716
717
  }), Pt(() => s.uuid, () => {
717
718
  v.value = 0, c.value = null, qt(!0), h.value = $e() === s.uuid, xt();
718
719
  }), dn(() => {
719
- A = Ys(() => void xt()), R = no(() => {
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
723
  }), pn(() => {
723
- y?.disconnect(), y = null, A?.(), A = null, R?.(), R = null, C?.(), C = null, S?.(), S = null;
724
- }), (w, T) => (p(), f("div", {
724
+ y?.disconnect(), y = null, A?.(), A = null, O?.(), O = null, C?.(), C = null, E?.(), E = null;
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 }]),
@@ -729,25 +730,25 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
729
730
  "data-magic-block": o.uuid,
730
731
  "data-magic-module": o.module
731
732
  }, [
732
- $t.value ? (p(), f("iframe", {
733
+ $t.value ? (d(), p("iframe", {
733
734
  key: 0,
734
735
  ref_key: "frame",
735
- ref: d,
736
+ ref: f,
736
737
  class: "mb__frame",
737
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, io)) : (p(), f("div", {
742
+ }, null, 8, io)) : (d(), p("div", {
742
743
  key: 1,
743
744
  class: K(["mb__empty", { "mb__empty--off": U.value === "invalid", "mb__empty--draft": U.value === "draft" }]),
744
- onClick: O
745
+ onClick: R
745
746
  }, [
746
747
  a("p", uo, b(Z.value), 1),
747
748
  a("p", co, b(X.value), 1),
748
- U.value === "invalid" && yt.value ? (p(), f("p", ro, b(yt.value), 1)) : k("", !0),
749
- U.value === "invalid" && kt.value.length > 0 ? (p(), f("ul", po, [
750
- (p(!0), f(M, null, N(kt.value, (I, rt) => (p(), f("li", {
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
754
  }, b(I.message), 1))), 128))
@@ -755,38 +756,38 @@ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"],
755
756
  a("button", {
756
757
  class: "mb__go",
757
758
  type: "button",
758
- onClick: Se(Kt, ["stop"])
759
+ onClick: Ee(Kt, ["stop"])
759
760
  }, "去控制台")
760
761
  ], 2)),
761
- it(u) ? (p(), f("span", fo)) : k("", !0),
762
- it(u) && $t.value ? (p(), f(M, { key: 3 }, [
762
+ it(u) ? (d(), p("span", fo)) : k("", !0),
763
+ it(u) && $t.value ? (d(), p(M, { key: 3 }, [
763
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
+ onClick: R
769
770
  }, null, 8, bo),
770
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
+ onClick: R
776
777
  }, null, 8, mo),
777
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
+ onClick: R
783
784
  }, null, 8, vo),
784
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
+ onClick: R
790
791
  }, null, 8, ho)
791
792
  ], 64)) : k("", !0)
792
793
  ], 14, ao));
@@ -810,8 +811,8 @@ function yo(o, s) {
810
811
  const m = Tn(u);
811
812
  if (!m || i.has(m)) continue;
812
813
  i.add(m);
813
- const d = ht(u.path), c = ht(u.meta?.title) || ht(u.meta?.sub) || d;
814
- l.push({ uuid: m, path: d, title: c, module: ht(u.meta?.module), brief: ht(u.meta?.brief) });
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) });
815
816
  }
816
817
  return l;
817
818
  }
@@ -844,18 +845,18 @@ function xo(o, s) {
844
845
  path: u,
845
846
  message: `块路由(${u})挂在别的路由下面:父级 template 里除了 <RouterView> 还有别的东西。块路由必须是顶层那一条。`
846
847
  });
847
- const d = Object.keys(i?.components ?? {}).filter((c) => c !== "default");
848
- return d.length > 0 && l.push({
848
+ const f = Object.keys(i?.components ?? {}).filter((c) => c !== "default");
849
+ return f.length > 0 && l.push({
849
850
  code: "extra-views",
850
851
  path: u,
851
- message: `这条路由(${u})除了默认视图还挂了具名视图(${d.join(" / ")})—— 那正是"在块旁边摆第二块内容"。${un}`
852
+ message: `这条路由(${u})除了默认视图还挂了具名视图(${f.join(" / ")})—— 那正是"在块旁边摆第二块内容"。${un}`
852
853
  }), Tn(i) || l.push({
853
854
  code: "no-uuid",
854
855
  path: u,
855
856
  message: `这条路由(${u})挂了块页却没说这是哪个块:写 meta.blockUuid(推荐)或 props: { uuid },否则这一页渲染出来是"未开发"。`
856
857
  }), l;
857
858
  }
858
- const Mn = /* @__PURE__ */ Pe({
859
+ const Mn = /* @__PURE__ */ je({
859
860
  __name: "MagicBlockPage",
860
861
  props: {
861
862
  uuid: { default: "" },
@@ -865,15 +866,15 @@ const Mn = /* @__PURE__ */ Pe({
865
866
  },
866
867
  setup(o) {
867
868
  const s = o, l = hs(), i = j(() => {
868
- const d = l.meta?.blockUuid;
869
- return typeof d == "string" && d.trim() ? d.trim() : s.uuid;
869
+ const f = l.meta?.blockUuid;
870
+ return typeof f == "string" && f.trim() ? f.trim() : s.uuid;
870
871
  }), u = fs()?.type, m = xo(l.matched, u);
871
872
  if (m.length > 0) {
872
- const d = m.map((c) => `[labull] ${c.message}`).join(`
873
+ const f = m.map((c) => `[labull] ${c.message}`).join(`
873
874
  `);
874
- console.error(d);
875
+ console.error(f);
875
876
  }
876
- return (d, c) => (p(), bs(_o, {
877
+ return (f, c) => (d(), bs(_o, {
877
878
  uuid: i.value,
878
879
  name: o.name,
879
880
  module: o.module,
@@ -896,9 +897,9 @@ function Lt(o) {
896
897
  l += `<code>${_t(m[1])}</code>`, i += m[0].length;
897
898
  continue;
898
899
  }
899
- const d = /^!\[[^\]]*\]\([^)\s]*\)/.exec(u);
900
- if (d) {
901
- l += _t(d[0]), i += d[0].length;
900
+ const f = /^!\[[^\]]*\]\([^)\s]*\)/.exec(u);
901
+ if (f) {
902
+ l += _t(f[0]), i += f[0].length;
902
903
  continue;
903
904
  }
904
905
  const c = /^\[([^\]]*)\]\(([^)\s]*)\)/.exec(u);
@@ -920,31 +921,31 @@ function Lt(o) {
920
921
  }
921
922
  return l;
922
923
  }
923
- function Eo(o) {
924
+ function So(o) {
924
925
  const s = String(o ?? "").replace(/\r\n?/g, `
925
926
  `).split(`
926
927
  `), l = [];
927
- let i = "", u = [], m = [], d = !1, c = [];
928
+ let i = "", u = [], m = [], f = !1, c = [];
928
929
  const h = () => {
929
- u.length > 0 && (l.push(`<p>${u.map((S) => Lt(S)).join("<br>")}</p>`), u = []);
930
+ u.length > 0 && (l.push(`<p>${u.map((E) => Lt(E)).join("<br>")}</p>`), u = []);
930
931
  }, v = () => {
931
- m.length > 0 && (l.push(`<blockquote>${m.map((S) => Lt(S)).join("<br>")}</blockquote>`), m = []);
932
+ m.length > 0 && (l.push(`<blockquote>${m.map((E) => Lt(E)).join("<br>")}</blockquote>`), m = []);
932
933
  }, _ = () => {
933
934
  i && (l.push(`</${i}>`), i = "");
934
935
  }, g = () => {
935
936
  h(), v(), _();
936
- }, y = (S) => {
937
- i !== S && (_(), l.push(`<${S}>`), i = S);
937
+ }, y = (E) => {
938
+ i !== E && (_(), l.push(`<${E}>`), i = E);
938
939
  };
939
- for (const S of s) {
940
- const A = S.replace(/\s+$/, "");
940
+ for (const E of s) {
941
+ const A = E.replace(/\s+$/, "");
941
942
  if (/^\s*```/.test(A)) {
942
- d ? (l.push(`<pre><code>${_t(c.join(`
943
- `))}</code></pre>`), c = [], d = !1) : (g(), d = !0);
943
+ f ? (l.push(`<pre><code>${_t(c.join(`
944
+ `))}</code></pre>`), c = [], f = !1) : (g(), f = !0);
944
945
  continue;
945
946
  }
946
- if (d) {
947
- c.push(S);
947
+ if (f) {
948
+ c.push(E);
948
949
  continue;
949
950
  }
950
951
  if (!A.trim()) {
@@ -962,9 +963,9 @@ function Eo(o) {
962
963
  g(), l.push("<hr>");
963
964
  continue;
964
965
  }
965
- const R = /^\s*[-*+]\s+(.*)$/.exec(A);
966
- if (R) {
967
- h(), v(), y("ul"), l.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>`);
968
969
  continue;
969
970
  }
970
971
  const P = /^\s*\d+[.)]\s+(.*)$/.exec(A);
@@ -979,7 +980,7 @@ function Eo(o) {
979
980
  }
980
981
  v(), _(), u.push(A);
981
982
  }
982
- return d && l.push(`<pre><code>${_t(c.join(`
983
+ return f && l.push(`<pre><code>${_t(c.join(`
983
984
  `))}</code></pre>`), g(), l.join("");
984
985
  }
985
986
  function cn(o, s = 120) {
@@ -989,7 +990,7 @@ function cn(o, s = 120) {
989
990
  return i.length > s ? `${i.slice(0, s)}…` : i;
990
991
  }
991
992
  const we = "pages.lock.ts";
992
- function So(o, s) {
993
+ function Eo(o, s) {
993
994
  const l = String(o || "").split(/[^A-Za-z0-9]+/).filter(Boolean);
994
995
  if (l.length === 0) return `Page${s + 1}`;
995
996
  const i = l.map((u) => u[0].toUpperCase() + u.slice(1)).join("");
@@ -1005,10 +1006,10 @@ function To(o, s) {
1005
1006
  }
1006
1007
  function Bo(o) {
1007
1008
  const s = (o ?? []).filter((m) => m && typeof m.path == "string" && m.path.trim() !== ""), l = /* @__PURE__ */ new Set(), i = [];
1008
- s.forEach((m, d) => {
1009
+ s.forEach((m, f) => {
1009
1010
  const c = m.group?.trim() || "(没写 meta.group)";
1010
1011
  let h = i.find((v) => v.title === c);
1011
- h || (h = { title: c, rows: [] }, i.push(h)), h.rows.push({ key: To(So(m.path, d), l), row: m });
1012
+ h || (h = { title: c, rows: [] }, i.push(h)), h.rows.push({ key: To(Eo(m.path, f), l), row: m });
1012
1013
  });
1013
1014
  const u = [
1014
1015
  "/* 生成物:**每次导出都会重写**,别手改 —— 改了下次导出就没了。",
@@ -1041,8 +1042,8 @@ function Bo(o) {
1041
1042
  u.push("export const Page = {");
1042
1043
  for (const m of i) {
1043
1044
  u.push(` // ── ${m.title} ──`);
1044
- for (const d of m.rows)
1045
- u.push(` /** ${d.row.title?.trim() || d.row.path}(${d.row.path}) */`), u.push(` ${d.key}: '${d.row.path}',`);
1045
+ for (const f of m.rows)
1046
+ u.push(` /** ${f.row.title?.trim() || f.row.path}(${f.row.path}) */`), u.push(` ${f.key}: '${f.row.path}',`);
1046
1047
  }
1047
1048
  u.push("} as const", "");
1048
1049
  }
@@ -1118,7 +1119,7 @@ async function xe() {
1118
1119
  function se(o) {
1119
1120
  return (o instanceof Error ? o.message.trim() : String(o)) || "没有说原因";
1120
1121
  }
1121
- function Le(o) {
1122
+ function Ie(o) {
1122
1123
  const s = String(o ?? "").split("/");
1123
1124
  for (const l of s)
1124
1125
  if (!l || l === "." || l === ".." || l.includes("\\") || /^[A-Za-z]:/.test(l))
@@ -1134,7 +1135,7 @@ function Ao(o) {
1134
1135
  }
1135
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}`;
1136
1137
  }
1137
- const Ro = 8;
1138
+ const Oo = 8;
1138
1139
  async function gt(o, s) {
1139
1140
  let l = 0;
1140
1141
  const i = async () => {
@@ -1144,16 +1145,16 @@ async function gt(o, s) {
1144
1145
  await s(o[u], u);
1145
1146
  }
1146
1147
  };
1147
- await Promise.all(Array.from({ length: Math.max(1, Math.min(Ro, o.length)) }, () => i()));
1148
+ await Promise.all(Array.from({ length: Math.max(1, Math.min(Oo, o.length)) }, () => i()));
1148
1149
  }
1149
- function Oo(o) {
1150
+ function Ro(o) {
1150
1151
  const s = /* @__PURE__ */ new Map();
1151
1152
  return (l) => {
1152
1153
  const i = l.join("\0"), u = s.get(i);
1153
1154
  if (u) return u;
1154
1155
  let m = Promise.resolve(o);
1155
- for (let d = 0; d < l.length; d += 1) {
1156
- const c = l[d], h = l.slice(0, d + 1).join("\0"), v = s.get(h);
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);
1157
1158
  m = v ?? m.then((_) => _.getDirectoryHandle(c, { create: !0 })), v || s.set(h, m);
1158
1159
  }
1159
1160
  return m;
@@ -1167,21 +1168,21 @@ async function Po(o, s, l) {
1167
1168
  }
1168
1169
  }
1169
1170
  async function jo(o, s, l, i = {}) {
1170
- const u = Object.entries(s ?? {}).map(([C, R]) => {
1171
- const P = String(R ?? "");
1172
- return { path: C, parts: Le(C), body: P, digest: Ao(P) };
1173
- }), m = u.length, d = [], c = Oo(o.handle), h = i.verify === !0, v = i.trust, _ = i.existing, g = /* @__PURE__ */ new Map();
1174
- let y = 0, S = 0, A = 0;
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();
1175
+ let y = 0, E = 0, A = 0;
1175
1176
  return l?.(0, m), await gt(u, async (C) => {
1176
1177
  try {
1177
1178
  if (v?.get(C.path) === C.digest && (_?.has(C.path) ?? !1))
1178
1179
  A += 1, g.set(C.path, C.digest);
1179
1180
  else {
1180
- const R = await c(C.parts.slice(0, -1)), P = C.parts[C.parts.length - 1];
1181
- if (h && await Po(R, P, C.body))
1182
- S += 1, g.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);
1183
1184
  else {
1184
- const Z = await (await R.getFileHandle(P, { create: !0 })).createWritable();
1185
+ const Z = await (await O.getFileHandle(P, { create: !0 })).createWritable();
1185
1186
  try {
1186
1187
  await Z.write(C.body);
1187
1188
  } finally {
@@ -1190,16 +1191,16 @@ async function jo(o, s, l, i = {}) {
1190
1191
  y += 1, g.set(C.path, C.digest);
1191
1192
  }
1192
1193
  }
1193
- } catch (R) {
1194
- d.push({ path: C.path, message: se(R) });
1194
+ } catch (O) {
1195
+ f.push({ path: C.path, message: se(O) });
1195
1196
  }
1196
- l?.(y + S + A + d.length, m);
1197
- }), d.sort((C, R) => C.path < R.path ? -1 : C.path > R.path ? 1 : 0), { written: y, failed: d, total: m, skipped: S, trusted: A, fingerprints: g };
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 };
1198
1199
  }
1199
1200
  async function Ce(o, s) {
1200
- const l = { items: [], topCount: 0, files: 0, dirs: 0 }, i = async (d, c) => {
1201
+ const l = { items: [], topCount: 0, files: 0, dirs: 0 }, i = async (f, c) => {
1201
1202
  const h = [];
1202
- for (const v of await At(d)) {
1203
+ for (const v of await At(f)) {
1203
1204
  if (v.kind === "file") {
1204
1205
  l.files += 1;
1205
1206
  continue;
@@ -1208,13 +1209,13 @@ async function Ce(o, s) {
1208
1209
  }
1209
1210
  await gt(h, (v) => i(v, c + 1));
1210
1211
  }, u = await At(o.handle), m = [];
1211
- for (const d of u)
1212
- if (l.items.push({ name: d.name, dir: d.kind === "directory" }), d.kind === "file") l.files += 1;
1212
+ for (const f of u)
1213
+ if (l.items.push({ name: f.name, dir: f.kind === "directory" }), f.kind === "file") l.files += 1;
1213
1214
  else {
1214
- if (l.dirs += 1, s.skipDirs.includes(d.name) || s.maxDepth <= 0) continue;
1215
- m.push(d);
1215
+ if (l.dirs += 1, s.skipDirs.includes(f.name) || s.maxDepth <= 0) continue;
1216
+ m.push(f);
1216
1217
  }
1217
- return await gt(m, (d) => i(d, 1)), l.topCount = l.items.length, l;
1218
+ return await gt(m, (f) => i(f, 1)), l.topCount = l.items.length, l;
1218
1219
  }
1219
1220
  async function Lo(o) {
1220
1221
  const s = [];
@@ -1225,9 +1226,9 @@ async function Lo(o) {
1225
1226
  }), l;
1226
1227
  }
1227
1228
  async function Io(o, s) {
1228
- const { wantedFiles: l, wantedDirs: i } = Rn(s), u = /* @__PURE__ */ new Set();
1229
+ const { wantedFiles: l, wantedDirs: i } = On(s), u = /* @__PURE__ */ new Set();
1229
1230
  let m = 0;
1230
- const d = async (c, h) => {
1231
+ const f = async (c, h) => {
1231
1232
  const v = [], _ = [];
1232
1233
  for (const g of await At(c)) {
1233
1234
  const y = h ? `${h}/${g.name}` : g.name;
@@ -1239,23 +1240,23 @@ async function Io(o, s) {
1239
1240
  }
1240
1241
  await gt(v, async (g) => {
1241
1242
  await c.removeEntry(g, { recursive: !0 }), m += 1;
1242
- }), await gt(_, ([g, y]) => d(y, g));
1243
+ }), await gt(_, ([g, y]) => f(y, g));
1243
1244
  };
1244
- return await d(o.handle, ""), { removed: m, existing: u };
1245
+ return await f(o.handle, ""), { removed: m, existing: u };
1245
1246
  }
1246
- function Rn(o) {
1247
+ function On(o) {
1247
1248
  const s = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
1248
1249
  for (const i of Object.keys(o ?? {})) {
1249
- const u = Le(i);
1250
+ const u = Ie(i);
1250
1251
  s.add(u.join("/"));
1251
1252
  for (let m = 1; m < u.length; m += 1) l.add(u.slice(0, m).join("/"));
1252
1253
  }
1253
1254
  return { wantedFiles: s, wantedDirs: l };
1254
1255
  }
1255
1256
  async function Do(o, s) {
1256
- const { wantedFiles: l, wantedDirs: i } = Rn(s), u = /* @__PURE__ */ new Set(), m = async (d, c) => {
1257
+ const { wantedFiles: l, wantedDirs: i } = On(s), u = /* @__PURE__ */ new Set(), m = async (f, c) => {
1257
1258
  const h = [];
1258
- for (const v of await At(d)) {
1259
+ for (const v of await At(f)) {
1259
1260
  const _ = c ? `${c}/${v.name}` : v.name;
1260
1261
  if (v.kind === "file") {
1261
1262
  l.has(_) && u.add(_);
@@ -1286,15 +1287,15 @@ function Uo(o) {
1286
1287
  return s <= 0 ? "" : o.slice(s).toLowerCase();
1287
1288
  }
1288
1289
  const zo = { folders: [], failures: [], truncated: !1 };
1289
- async function On(o, s, l) {
1290
+ async function Rn(o, s, l) {
1290
1291
  const i = await At(o), u = new Array(i.length);
1291
1292
  await gt(i, async (c, h) => {
1292
1293
  const v = s ? `${s}/${c.name}` : c.name, _ = { files: {}, failures: [] };
1293
1294
  if (u[h] = _, c.kind === "directory") {
1294
1295
  if (l.skipDirs.includes(c.name)) return;
1295
- const y = await On(c, v, l);
1296
- for (const [S, A] of Object.entries(y.files))
1297
- _.files[`${c.name}/${S}`] = A;
1296
+ const y = await Rn(c, v, l);
1297
+ for (const [E, A] of Object.entries(y.files))
1298
+ _.files[`${c.name}/${E}`] = A;
1298
1299
  _.failures.push(...y.failures);
1299
1300
  return;
1300
1301
  }
@@ -1323,18 +1324,18 @@ async function On(o, s, l) {
1323
1324
  }
1324
1325
  }
1325
1326
  });
1326
- const m = {}, d = [];
1327
+ const m = {}, f = [];
1327
1328
  for (const c of u)
1328
- c && (Object.assign(m, c.files), d.push(...c.failures));
1329
- return { files: m, failures: d };
1329
+ c && (Object.assign(m, c.files), f.push(...c.failures));
1330
+ return { files: m, failures: f };
1330
1331
  }
1331
1332
  async function Pn(o, s, l, i) {
1332
- const u = await At(o), m = u.filter((g) => g.kind === "directory"), d = u.filter((g) => g.kind === "file"), c = s.join("/"), h = { folders: [], failures: [], truncated: !1 };
1333
- if (m.length === 0 || d.some((g) => g.name === i.entry)) {
1334
- const g = await On(o, c, 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);
1335
1336
  return h.folders.push({ where: c, files: g.files }), h.failures.push(...g.failures), h;
1336
1337
  }
1337
- for (const g of d)
1338
+ for (const g of f)
1338
1339
  s.length === 0 && i.rootSkipFiles.includes(g.name.toLowerCase()) || h.failures.push({
1339
1340
  kind: "file",
1340
1341
  where: [...s, g.name].join("/"),
@@ -1366,7 +1367,7 @@ async function Ho(o, s) {
1366
1367
  failures: l.failures,
1367
1368
  truncated: l.truncated
1368
1369
  }, u = i.folders.reduce(
1369
- (m, d) => m + Object.values(d.files).reduce((c, h) => c + h.length, 0),
1370
+ (m, f) => m + Object.values(f.files).reduce((c, h) => c + h.length, 0),
1370
1371
  0
1371
1372
  );
1372
1373
  if (u > s.maxBodyBytes)
@@ -1378,7 +1379,7 @@ async function Ho(o, s) {
1378
1379
  const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1379
1380
  class: "mbc__tabs",
1380
1381
  role: "tablist"
1381
- }, Go = ["aria-selected"], Wo = { class: "mbc__count" }, Yo = ["title"], Zo = ["aria-selected"], Xo = ["title"], Qo = {
1382
+ }, Wo = ["aria-selected"], Go = { class: "mbc__count" }, Yo = ["title"], Zo = ["aria-selected"], Xo = ["title"], Qo = {
1382
1383
  key: 1,
1383
1384
  class: "mbc__chip is-ok"
1384
1385
  }, tl = { class: "mbc__body" }, el = {
@@ -1399,13 +1400,13 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1399
1400
  }, wl = {
1400
1401
  key: 0,
1401
1402
  class: "mbc__tagbar"
1402
- }, xl = ["title", "onClick"], Cl = { class: "mbc__list" }, El = ["title", "onClick"], Sl = { class: "mbc__module" }, Tl = { class: "mbc__name" }, Bl = ["title"], Ml = {
1403
+ }, xl = ["title", "onClick"], Cl = { class: "mbc__list" }, Sl = ["title", "onClick"], El = { class: "mbc__module" }, Tl = { class: "mbc__name" }, Bl = ["title"], Ml = {
1403
1404
  key: 0,
1404
1405
  class: "mbc__where"
1405
- }, Al = ["title"], Rl = {
1406
+ }, Al = ["title"], Ol = {
1406
1407
  key: 0,
1407
1408
  class: "mbc__detail"
1408
- }, Ol = {
1409
+ }, Rl = {
1409
1410
  key: 0,
1410
1411
  class: "mbc__hint"
1411
1412
  }, Pl = { class: "mbc__meta" }, jl = ["innerHTML"], Ll = {
@@ -1417,10 +1418,10 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1417
1418
  }, zl = ["disabled", "onClick"], Hl = ["onKeyup"], Kl = ["disabled", "onClick"], ql = ["disabled"], Vl = {
1418
1419
  key: 0,
1419
1420
  class: "mbc__tagbar"
1420
- }, Jl = ["title", "onClick"], Gl = {
1421
+ }, Jl = ["title", "onClick"], Wl = {
1421
1422
  key: 1,
1422
1423
  class: "mbc__tagbar"
1423
- }, Wl = ["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 = {
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 = {
1424
1425
  key: 0,
1425
1426
  class: "mbc__hint"
1426
1427
  }, sa = {
@@ -1435,10 +1436,10 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1435
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 = {
1436
1437
  key: 0,
1437
1438
  value: ""
1438
- }, Ea = ["value"], Sa = { class: "mbc__field" }, Ta = ["value"], Ba = ["disabled"], Ma = ["disabled", "title"], Aa = { class: "mbc__hint" }, Ra = {
1439
+ }, Sa = ["value"], Ea = { class: "mbc__field" }, Ta = ["value"], Ba = ["disabled"], Ma = ["disabled", "title"], Aa = { class: "mbc__hint" }, Oa = {
1439
1440
  key: 0,
1440
1441
  class: "mbc__hint"
1441
- }, Oa = { class: "mbc__panel mbc__panel--read" }, Pa = { class: "mbc__field" }, ja = ["value"], La = ["disabled"], Ia = ["disabled"], Da = {
1442
+ }, Ra = { class: "mbc__panel mbc__panel--read" }, Pa = { class: "mbc__field" }, ja = ["value"], La = ["disabled"], Ia = ["disabled"], Da = {
1442
1443
  key: 0,
1443
1444
  class: "mbc__hint"
1444
1445
  }, Na = {
@@ -1450,7 +1451,7 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1450
1451
  }, Ua = { class: "mbc__ok-text" }, za = ["disabled"], Ha = ["disabled"], Ka = {
1451
1452
  key: 1,
1452
1453
  class: "mbc__scan"
1453
- }, qa = { class: "mbc__pick" }, Va = ["disabled", "checked", "onChange"], Ja = { class: "mbc__name" }, Ga = { class: "mbc__module" }, Wa = { class: "mbc__hint" }, Ya = { class: "mbc__mono" }, Za = {
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 = {
1454
1455
  key: 0,
1455
1456
  class: "mbc__problem"
1456
1457
  }, Xa = { class: "mbc__hint mbc__mono" }, Qa = {
@@ -1474,19 +1475,19 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1474
1475
  }, Ci = {
1475
1476
  key: 1,
1476
1477
  class: "mbc__chip is-bad"
1477
- }, Ei = {
1478
+ }, Si = {
1478
1479
  key: 2,
1479
1480
  class: "mbc__hint"
1480
- }, Si = { class: "mbc__actions" }, Ti = { class: "mbc__foot" }, Bi = ["title"], Mi = {
1481
+ }, Ei = { class: "mbc__actions" }, Ti = { class: "mbc__foot" }, Bi = ["title"], Mi = {
1481
1482
  key: 1,
1482
1483
  class: "mbc__error"
1483
1484
  }, Ai = {
1484
1485
  key: 2,
1485
1486
  class: "mbc__notice"
1486
- }, Ri = {
1487
+ }, Oi = {
1487
1488
  key: 3,
1488
1489
  class: "mbc__hint mbc__foot-idle"
1489
- }, Oi = { class: "mbc__modal-box" }, Pi = { class: "mbc__modal-head" }, ji = { class: "mbc__modal-body" }, Li = {
1490
+ }, Ri = { class: "mbc__modal-box" }, Pi = { class: "mbc__modal-head" }, ji = { class: "mbc__modal-body" }, Li = {
1490
1491
  key: 0,
1491
1492
  class: "mbc__issues-group"
1492
1493
  }, Ii = { class: "mbc__title" }, Di = { class: "mbc__failures" }, Ni = {
@@ -1495,10 +1496,10 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1495
1496
  }, Fi = { class: "mbc__title" }, Ui = { class: "mbc__failures" }, zi = { class: "mbc__kind" }, Hi = { class: "mbc__mono" }, Ki = {
1496
1497
  key: 2,
1497
1498
  class: "mbc__issues-group"
1498
- }, qi = { class: "mbc__title" }, Vi = { class: "mbc__failures" }, Ji = { class: "mbc__mono" }, Gi = {
1499
+ }, qi = { class: "mbc__title" }, Vi = { class: "mbc__failures" }, Ji = { class: "mbc__mono" }, Wi = {
1499
1500
  key: 3,
1500
1501
  class: "mbc__issues-group"
1501
- }, Wi = { class: "mbc__title" }, Yi = { class: "mbc__failures" }, Zi = { key: 0 }, Xi = {
1502
+ }, Gi = { class: "mbc__title" }, Yi = { class: "mbc__failures" }, Zi = { key: 0 }, Xi = {
1502
1503
  key: 1,
1503
1504
  class: "mbc__failures mbc__failures--nested"
1504
1505
  }, Qi = {
@@ -1507,7 +1508,7 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1507
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 = {
1508
1509
  key: 0,
1509
1510
  class: "mbc__hint"
1510
- }, cu = { class: "mbc__modal-foot" }, Ee = 2, ru = 100, du = 250, pu = /* @__PURE__ */ Pe({
1511
+ }, cu = { class: "mbc__modal-foot" }, Se = 2, ru = 100, du = 250, pu = /* @__PURE__ */ je({
1511
1512
  __name: "MagicBlockConsole",
1512
1513
  setup(o) {
1513
1514
  const s = {
@@ -1518,7 +1519,7 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1518
1519
  两种情形共用它(前端声明了、手里却还没有那个文件夹 / 手里那个文件夹的清单 id 库里没有)
1519
1520
  —— 对用户是同一件事:这个块不在库里。 */
1520
1521
  "not-in-db": "不在数据库"
1521
- }, l = s["not-in-db"], { isStaff: i } = mn(), u = bn(), { active: m } = ys(), d = (n) => !vn(n, u), c = x(!1), h = x(""), v = x([]), _ = x(""), g = x(""), y = x(""), S = x([]), A = x(!1), C = x(!1), R = x("blocks"), P = x(""), U = x([]), Z = x(""), X = x(""), yt = x(""), kt = x(""), E = 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] };
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] };
1522
1523
  function Kt(n) {
1523
1524
  wt.value = n;
1524
1525
  try {
@@ -1536,7 +1537,7 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1536
1537
  Pt(v, (n) => {
1537
1538
  n.length !== 0 && (n.some((t) => t.id === wt.value) || Kt(n[0].id));
1538
1539
  });
1539
- const tt = x(null), V = x(""), O = x(null), ct = x({}), W = x([]), Y = x([]), ot = x({}), w = x(""), T = x(null);
1540
+ const tt = x(null), V = x(""), R = x(null), ct = x({}), G = x([]), Y = x([]), ot = x({}), w = x(""), T = x(null);
1540
1541
  async function I(n) {
1541
1542
  w.value = n;
1542
1543
  try {
@@ -1559,7 +1560,7 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1559
1560
  function Nt(n, t) {
1560
1561
  return `${String(t || "").replace(/[\\/:*?"<>|]/g, "").trim() || "block"}-${n}`;
1561
1562
  }
1562
- const oe = (n) => G(async () => {
1563
+ const oe = (n) => W(async () => {
1563
1564
  const t = Nt(n.id, n.name || n.module);
1564
1565
  let e = q.value, r = null;
1565
1566
  if (e)
@@ -1569,18 +1570,18 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1569
1570
  e = null, r = null;
1570
1571
  }
1571
1572
  H.value = { row: n, target: e, folder: t, inventory: r };
1572
- }, E), le = () => G(async () => {
1573
+ }, S), le = () => W(async () => {
1573
1574
  const n = H.value;
1574
1575
  if (H.value = null, !n) return;
1575
1576
  const t = `「${n.row.module} / ${n.row.name || n.row.id}」`;
1576
- De(), F.value = { active: !0, percent: 0, stage: "清本机那个文件夹…", failed: !1 };
1577
+ Ne(), F.value = { active: !0, percent: 0, stage: "清本机那个文件夹…", failed: !1 };
1577
1578
  let e = "";
1578
1579
  if (n.target)
1579
1580
  try {
1580
1581
  const r = await ae(n.target, n.folder), B = await Lo(r);
1581
1582
  e = `清掉了本机「${n.target.name}/${n.folder}」里的 ${B} 项`;
1582
1583
  } catch (r) {
1583
- e = `本机那份没清成(${Ot(r)})`;
1584
+ e = `本机那份没清成(${Rt(r)})`;
1584
1585
  }
1585
1586
  else
1586
1587
  e = "没选开发目录 ⇒ 本机那份没动";
@@ -1588,13 +1589,13 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1588
1589
  try {
1589
1590
  await at(`/magic-blocks/${n.row.id}`, { method: "DELETE" });
1590
1591
  } catch (r) {
1591
- throw Ct(!1, "本机清了,但库里那份代码没清成"), new Error(`${e};但**库里那份代码没清成**(${Ot(r)})—— 再点一次「删除代码文件」`);
1592
+ throw Ct(!1, "本机清了,但库里那份代码没清成"), new Error(`${e};但**库里那份代码没清成**(${Rt(r)})—— 再点一次「删除代码文件」`);
1592
1593
  }
1593
- await St(), V.value = `${t}的代码文件已删除:${e};库里那一份也清空了 ——**块还在**(页面上会显示成占位框)。想找回来:上面「块」那一屏点开这一块 → 版本史 → 对上一版点「切回」`, y.value = `删掉了${t}的代码文件(块本身还在)`, Ct(!0, "完成");
1594
- }, E);
1594
+ await Et(), V.value = `${t}的代码文件已删除:${e};库里那一份也清空了 ——**块还在**(页面上会显示成占位框)。想找回来:上面「块」那一屏点开这一块 → 版本史 → 对上一版点「切回」`, y.value = `删掉了${t}的代码文件(块本身还在)`, Ct(!0, "完成");
1595
+ }, S);
1595
1596
  async function ae(n, t) {
1596
1597
  let e = n.handle;
1597
- for (const r of Le(t))
1598
+ for (const r of Ie(t))
1598
1599
  e = await e.getDirectoryHandle(r, { create: !0 });
1599
1600
  return { handle: e, name: `${n.name}/${t}` };
1600
1601
  }
@@ -1602,10 +1603,10 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1602
1603
  width: `${Math.max(0, Math.min(100, F.value.percent))}%`,
1603
1604
  background: F.value.failed ? "var(--sp-color-danger)" : "var(--sp-color-primary, var(--primary-color))"
1604
1605
  }));
1605
- let ie = [], Ie = 0;
1606
+ let ie = [], De = 0;
1606
1607
  function ue(n = !1) {
1607
- if (!(!n && performance.now() - Ie < du)) {
1608
- Ie = performance.now();
1608
+ if (!(!n && performance.now() - De < du)) {
1609
+ De = performance.now();
1609
1610
  try {
1610
1611
  window.localStorage.setItem("mb:progress", JSON.stringify(ie));
1611
1612
  } catch {
@@ -1618,14 +1619,14 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1618
1619
  function Ct(n, t) {
1619
1620
  lt(n ? 100 : F.value.percent, t), F.value = { active: !n, percent: n ? 100 : F.value.percent, stage: t, failed: !n }, ue(!0);
1620
1621
  }
1621
- function De() {
1622
+ function Ne() {
1622
1623
  ie = [], ue(!0);
1623
1624
  }
1624
- const Ne = (n) => (n.disabledReason ?? "").trim(), ce = (n) => (n.issues ?? []).map((t) => String(t?.message ?? "")).filter(Boolean), Jt = (n) => oo(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);
1625
1626
  function Ln(n) {
1626
1627
  _.value = _.value === n.id ? "" : n.id, _.value === n.id && I(n.id);
1627
1628
  const t = m.value;
1628
- Sn(n.id);
1629
+ En(n.id);
1629
1630
  const e = n.name || n.id, r = Jt(n);
1630
1631
  if (r.length === 0) {
1631
1632
  y.value = `「${e}」这次会话里还没在哪条标签上露过面:先打开挂着它的那一页,再点一次`;
@@ -1635,29 +1636,29 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1635
1636
  y.value = `「${e}」就在这一条标签上(${r.join(" / ")}):已经把它标红`;
1636
1637
  return;
1637
1638
  }
1638
- const B = lo(n.id, t, d);
1639
+ const B = lo(n.id, t, f);
1639
1640
  if (B) {
1640
- y.value = `「${e}」不在这一条标签上:正在切到 ${B} 那条标签`, Te(B);
1641
+ y.value = `「${e}」不在这一条标签上:正在切到 ${B} 那条标签`, Be(B);
1641
1642
  return;
1642
1643
  }
1643
1644
  y.value = `「${e}」只挂在带参数的实例标签上(${r.join(" / ")}):不替你挑一单 —— 自己打开要看的那一页再点`;
1644
1645
  }
1645
- const In = (n, t) => G(async () => {
1646
+ const In = (n, t) => W(async () => {
1646
1647
  const e = await at(
1647
1648
  `/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`
1648
1649
  );
1649
1650
  T.value = { id: n.id, number: t, files: e.files ?? {} }, y.value = `正在看「${n.name || n.id}」的 v${t}(只读:不会改库里任何东西)`;
1650
- }, E), Dn = (n, t) => G(async () => {
1651
+ }, S), Dn = (n, t) => W(async () => {
1651
1652
  window.confirm(`把「${n.name || n.id}」切回 v${t}?
1652
1653
 
1653
- 这会把那一版的代码变成**当前版**,并且记成一个**新版本**(号继续 +1):历史只追加,旧版本一个都不会没。`) && (await Et(`/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`, { updatedBy: "" }), y.value = `「${n.name || n.id}」已切回 v${t}(并记成了一个新版本)`, await St(), await I(n.id));
1654
- }, E), Nn = (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 () => {
1655
1656
  window.confirm(`删掉「${n.name || n.id}」的 v${t}?
1656
1657
 
1657
1658
  这一版的代码就找不回来了(别的版本不受影响)。`) && (await at(`/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`, { method: "DELETE" }), y.value = `删掉了「${n.name || n.id}」的 v${t}`, await I(n.id));
1658
- }, E), Fn = (n, t) => G(async () => {
1659
+ }, S), Fn = (n, t) => W(async () => {
1659
1660
  const e = await fetch(
1660
- `http://localhost:3000/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}?download=1`,
1661
+ `${Te}/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}?download=1`,
1661
1662
  { credentials: "include", headers: ne("GET", !1) }
1662
1663
  );
1663
1664
  if (!e.ok) throw new Error(`下载失败(HTTP ${e.status})`);
@@ -1669,17 +1670,17 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1669
1670
  setTimeout(() => URL.revokeObjectURL(B), 0);
1670
1671
  }
1671
1672
  y.value = `已下载「${n.name || n.id}」的 v${t}`;
1672
- }, E);
1673
+ }, S);
1673
1674
  function Un(n) {
1674
1675
  Z.value = n.id, X.value = (n.tags ?? []).join(", ");
1675
1676
  }
1676
- const Fe = (n) => G(async () => {
1677
- const t = X.value.split(/[,,\s]+/).map((r) => r.trim()).filter(Boolean), e = await Et(`/magic-blocks/${encodeURIComponent(n.id)}/tags`, { tags: t });
1678
- Z.value = "", y.value = `「${n.name || n.id}」的标签已存:${(e.tags ?? []).join(" / ") || "(一个都不剩)"}`, await St();
1679
- }, E, "存标签"), zn = (n) => G(async () => {
1680
- const t = await Et(`/magic-blocks/${encodeURIComponent(n.id)}/detail`, { detail: kt.value });
1681
- yt.value = "", y.value = `「${n.name || n.id}」的详情已存${(t.detail ?? "").trim() ? "" : "(清掉了)"};下次导出会写进它的 magic-block.open.yaml`, await St();
1682
- }, E, "存详情");
1677
+ const Ue = (n) => W(async () => {
1678
+ const t = X.value.split(/[,,\s]+/).map((r) => r.trim()).filter(Boolean), e = await St(`/magic-blocks/${encodeURIComponent(n.id)}/tags`, { tags: t });
1679
+ Z.value = "", y.value = `「${n.name || n.id}」的标签已存:${(e.tags ?? []).join(" / ") || "(一个都不剩)"}`, await Et();
1680
+ }, S, "存标签"), zn = (n) => W(async () => {
1681
+ const t = await St(`/magic-blocks/${encodeURIComponent(n.id)}/detail`, { detail: kt.value });
1682
+ yt.value = "", y.value = `「${n.name || n.id}」的详情已存${(t.detail ?? "").trim() ? "" : "(清掉了)"};下次导出会写进它的 magic-block.open.yaml`, await Et();
1683
+ }, S, "存详情");
1683
1684
  function Hn(n) {
1684
1685
  yt.value = n.id, kt.value = (n.detail ?? "").trim();
1685
1686
  }
@@ -1695,17 +1696,17 @@ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1695
1696
  return t ? (n.tags ?? []).some((e) => e.toLowerCase().includes(t)) : !0;
1696
1697
  }
1697
1698
  function Jn(n) {
1698
- const t = Jt(n), e = t.length === 0 ? "点一下:这次会话里它还没在哪条标签上露过面" : `点一下:把「${n.name || n.id}」标红,并在需要时切到挂着它的标签(${t.join(" / ")})`, r = Ne(n);
1699
+ const t = Jt(n), e = t.length === 0 ? "点一下:这次会话里它还没在哪条标签上露过面" : `点一下:把「${n.name || n.id}」标红,并在需要时切到挂着它的标签(${t.join(" / ")})`, r = Fe(n);
1699
1700
  return r ? `${r}
1700
1701
  ${e}` : e;
1701
1702
  }
1702
- const Ue = j(() => {
1703
+ const ze = j(() => {
1703
1704
  const n = h.value.trim().toLowerCase();
1704
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);
1705
- }), 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);
1706
- function Gn() {
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() {
1707
1708
  const n = /* @__PURE__ */ new Set(), t = [];
1708
- for (const e of ze()) {
1709
+ for (const e of He()) {
1709
1710
  const r = typeof e?.path == "string" ? e.path.trim() : "";
1710
1711
  if (!r || n.has(r) || r.includes(":") || r.includes("*") || e.redirect || !e.components?.default || e.meta?.tab === !1) continue;
1711
1712
  n.add(r);
@@ -1718,48 +1719,48 @@ ${e}` : e;
1718
1719
  }
1719
1720
  return t;
1720
1721
  }
1721
- function ze() {
1722
+ function He() {
1722
1723
  return u?.getRoutes?.() ?? [];
1723
1724
  }
1724
- const pe = j(() => ko(ze(), Mn, v.value.map((n) => n.id)));
1725
- function Ot(n) {
1725
+ const pe = j(() => ko(He(), Mn, v.value.map((n) => n.id)));
1726
+ function Rt(n) {
1726
1727
  return (n instanceof Error ? n.message.trim() : String(n)) || "请求没有到达后端(网络或登录态的问题),请重试";
1727
1728
  }
1728
- function Wn(n) {
1729
+ function Gn(n) {
1729
1730
  const t = n?.issues;
1730
1731
  return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : String(e?.message ?? "")).filter(Boolean) : [];
1731
1732
  }
1732
- async function Et(n, t) {
1733
+ async function St(n, t) {
1733
1734
  const e = JSON.stringify(t);
1734
1735
  try {
1735
1736
  return await at(n, { method: "POST", body: e });
1736
1737
  } catch (r) {
1737
- const B = Ot(r), D = await fetch(`http://localhost:3000${n}`, {
1738
+ const B = Rt(r), D = await fetch(`${Te}${n}`, {
1738
1739
  method: "POST",
1739
1740
  credentials: "include",
1740
1741
  headers: { "Content-Type": "application/json", ...ne("POST", !0) },
1741
1742
  body: e
1742
- }).then((mt) => mt.json()).catch(() => null), L = Wn(D);
1743
+ }).then((mt) => mt.json()).catch(() => null), L = Gn(D);
1743
1744
  throw L.length === 0 ? new Error(B) : new Error(`${String(D?.message ?? B)}
1744
1745
  - ${L.join(`
1745
1746
  - `)}`);
1746
1747
  }
1747
1748
  }
1748
1749
  async function Yn() {
1749
- const n = S.value.map((t) => `[${t.at}] ${t.where}
1750
+ const n = E.value.map((t) => `[${t.at}] ${t.where}
1750
1751
  ${t.text}`).join(`
1751
1752
 
1752
1753
  `);
1753
1754
  try {
1754
- await navigator.clipboard.writeText(n), y.value = `已复制 ${S.value.length} 条报错`;
1755
+ await navigator.clipboard.writeText(n), y.value = `已复制 ${E.value.length} 条报错`;
1755
1756
  } catch (t) {
1756
1757
  Ut(t, "复制报错");
1757
1758
  }
1758
1759
  }
1759
1760
  function Zn() {
1760
1761
  const n = [];
1761
- W.value.length > 0 && n.push("【前端校验拦下的】", ...W.value.map((t) => `- ${t}`), "");
1762
- 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 ?? [])
1763
1764
  n.push(`【读回:${t.kind || "问题"}】${t.where || ""}`, `- ${t.message || ""}`, "");
1764
1765
  for (const t of Ft.value)
1765
1766
  n.push(
@@ -1779,13 +1780,13 @@ ${t.text}`).join(`
1779
1780
  }
1780
1781
  }
1781
1782
  function Ut(n, t) {
1782
- const e = Ot(n);
1783
- g.value = e, S.value = [...S.value, { at: (/* @__PURE__ */ new Date()).toLocaleTimeString(), where: t, text: e }];
1783
+ const e = Rt(n);
1784
+ g.value = e, E.value = [...E.value, { at: (/* @__PURE__ */ new Date()).toLocaleTimeString(), where: t, text: e }];
1784
1785
  }
1785
1786
  function fe() {
1786
- g.value = "", S.value = [];
1787
+ g.value = "", E.value = [];
1787
1788
  }
1788
- async function St() {
1789
+ async function Et() {
1789
1790
  try {
1790
1791
  const n = await at("/magic-blocks/index");
1791
1792
  v.value = n.blocks ?? [], U.value = n.tags ?? [];
@@ -1793,7 +1794,7 @@ ${t.text}`).join(`
1793
1794
  Ut(n, "读块清单");
1794
1795
  }
1795
1796
  }
1796
- async function G(n, t, e = "") {
1797
+ async function W(n, t, e = "") {
1797
1798
  t.value = !0, fe();
1798
1799
  try {
1799
1800
  await n(), Zs();
@@ -1803,31 +1804,31 @@ ${t.text}`).join(`
1803
1804
  t.value = !1;
1804
1805
  }
1805
1806
  }
1806
- const Qn = () => G(async () => {
1807
+ const Qn = () => W(async () => {
1807
1808
  It.value = !0;
1808
1809
  try {
1809
- await at("/magic-blocks/check", { method: "POST", body: JSON.stringify({}) }), y.value = "全部魔法块重新校验完了", await St();
1810
+ await at("/magic-blocks/check", { method: "POST", body: JSON.stringify({}) }), y.value = "全部魔法块重新校验完了", await Et();
1810
1811
  } finally {
1811
1812
  It.value = !1;
1812
1813
  }
1813
- }, E), He = (n) => G(async () => {
1814
+ }, S), Ke = (n) => W(async () => {
1814
1815
  const t = await xe();
1815
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}`;
1816
- }, E);
1817
+ }, S);
1817
1818
  async function be() {
1818
1819
  if (tt.value) return tt.value;
1819
1820
  const n = await at("/magic-blocks/rules");
1820
1821
  return tt.value = n.rules, n.rules;
1821
1822
  }
1822
- const ts = () => G(async () => {
1823
+ const ts = () => W(async () => {
1823
1824
  if (!An()) throw new Error("这个浏览器没法直接写你本机的文件夹:请用 Chrome / Edge,并从 https 或 localhost 打开");
1824
1825
  if (Q.value === "one" && !bt.value)
1825
1826
  throw new Error("还没挑块:上面选「仅这一个块」时要先在下拉里挑一个块(或者把范围改成「全部块」)");
1826
- ut.value = !0, y.value = "", V.value = "", fe(), De(), 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 };
1827
1828
  try {
1828
1829
  const n = q.value ?? await xe();
1829
1830
  q.value = n, z.value || (z.value = n);
1830
- const t = Et("/magic-blocks/export", xt()), e = me(), r = tt.value ? Ce(n, tt.value) : null, B = await Tt("取包", t);
1831
+ const t = St("/magic-blocks/export", xt()), e = me(), r = tt.value ? Ce(n, tt.value) : null, B = await Tt("取包", t);
1831
1832
  tt.value = B.rules, No(n, B.rules);
1832
1833
  const D = r ? await Tt("数目录", r) : await Tt("数目录", Ce(n, B.rules));
1833
1834
  if (D.topCount > 0) {
@@ -1840,8 +1841,8 @@ ${t.text}`).join(`
1840
1841
  } finally {
1841
1842
  ut.value = !1;
1842
1843
  }
1843
- }, E), Ke = /* @__PURE__ */ new WeakMap(), Yt = [];
1844
- function qe(n, t) {
1844
+ }, S), qe = /* @__PURE__ */ new WeakMap(), Yt = [];
1845
+ function Ve(n, t) {
1845
1846
  Yt.push([n, Math.round(performance.now() - t)]);
1846
1847
  }
1847
1848
  async function Tt(n, t) {
@@ -1849,7 +1850,7 @@ ${t.text}`).join(`
1849
1850
  try {
1850
1851
  return await t;
1851
1852
  } finally {
1852
- qe(n, e);
1853
+ Ve(n, e);
1853
1854
  }
1854
1855
  }
1855
1856
  function es() {
@@ -1857,61 +1858,61 @@ ${t.text}`).join(`
1857
1858
  }
1858
1859
  function me() {
1859
1860
  try {
1860
- const n = En();
1861
+ const n = Sn();
1861
1862
  return {
1862
1863
  css: n.css,
1863
1864
  controls: to(),
1864
1865
  note: n.skipped.length > 0 ? `;⚠️ 有 ${n.skipped.length} 张样式表读不到规则(跨源):${n.skipped.join(" / ")}` : ""
1865
1866
  };
1866
1867
  } catch (n) {
1867
- return { css: "", controls: "", note: `;主题 CSS 没收成(${Ot(n)}):${Bt} 没写,其余照旧` };
1868
+ return { css: "", controls: "", note: `;主题 CSS 没收成(${Rt(n)}):${Bt} 没写,其余照旧` };
1868
1869
  }
1869
1870
  }
1870
1871
  async function ve(n, t, e) {
1871
1872
  const { clean: r, verify: B, thorough: D, front: L } = e;
1872
1873
  try {
1873
1874
  lt(20, "准备写盘…");
1874
- const mt = Bo(Gn()), pt = { ...t.files };
1875
+ const mt = Bo(Wn()), pt = { ...t.files };
1875
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));
1876
1877
  const is = L.note;
1877
1878
  await new Promise((nt) => {
1878
1879
  setTimeout(nt, 0);
1879
1880
  });
1880
- let Ye = "", he;
1881
+ let Ze = "", he;
1881
1882
  if (r) {
1882
1883
  lt(35, "清掉这一包不要的东西…");
1883
1884
  const nt = await Tt("清多余", Io(n, pt));
1884
- he = nt.existing, Ye = nt.removed > 0 ? `,先清掉了 ${nt.removed} 项` : ",没有多余的东西要清";
1885
+ he = nt.existing, Ze = nt.removed > 0 ? `,先清掉了 ${nt.removed} 项` : ",没有多余的东西要清";
1885
1886
  } else
1886
1887
  lt(35, "看一眼目录里有什么…"), he = await Tt("看目录", Do(n, pt));
1887
- const us = Ke.get(n.handle), cs = Object.keys(pt).length, ge = r ? 45 : 30;
1888
+ const us = qe.get(n.handle), cs = Object.keys(pt).length, ge = r ? 45 : 30;
1888
1889
  lt(ge, `写文件 0/${cs}…`);
1889
- let Ze = 0;
1890
+ let Xe = 0;
1890
1891
  const rs = performance.now(), et = await jo(n, pt, (nt, _e) => {
1891
- const Xe = Date.now();
1892
- nt < _e && Xe - Ze < ru || (Ze = Xe, lt(ge + Math.round(nt / Math.max(1, _e) * (95 - ge)), `写文件 ${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}…`));
1893
1894
  }, {
1894
1895
  verify: B,
1895
1896
  // 🔴 账本:勾了「逐个核对磁盘」就不给它 —— 那样连上一趟铺过的也重新核对一遍。
1896
1897
  trust: D ? void 0 : us,
1897
1898
  existing: he
1898
1899
  });
1899
- qe("写盘", rs), Ke.set(n.handle, et.fingerprints), lt(98, "收尾…");
1900
+ Ve("写盘", rs), qe.set(n.handle, et.fingerprints), lt(98, "收尾…");
1900
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 = [];
1901
1902
  et.skipped > 0 && Zt.push(`${et.skipped} 个与库里一字不差(逐字节比过)`), et.trusted > 0 && Zt.push(`${et.trusted} 个按上一趟的账本跳过(没再碰磁盘)`);
1902
1903
  const ps = Zt.length > 0 ? `,跳过 ${Zt.join(" / ")}` : "";
1903
- V.value = `铺到「${n.name}」:${t.blocks} 个块、写了 ${et.written} 个文件${ps}(含 ${we} / ${Bt} / ${ee})${Ye}${ds}${is}${es()}`, y.value = et.failed.length > 0 ? "导出完了,但有文件没写成(见下面那句)" : "导出完了:用你自己的编辑器改,改完回这里「读回改动」", Ct(!0, "完成");
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, "完成");
1904
1905
  } catch (mt) {
1905
1906
  throw Ct(!1, "导出中途失败(已经铺进去的文件不会自己删掉)"), mt;
1906
1907
  }
1907
1908
  }
1908
- const ns = () => G(async () => {
1909
+ const ns = () => W(async () => {
1909
1910
  const n = J.value;
1910
1911
  if (J.value = null, !!n) {
1911
1912
  ut.value = !0;
1912
1913
  try {
1913
1914
  lt(15, "重新取一份开发包…");
1914
- const t = Et("/magic-blocks/export", xt()), e = me(), r = await Tt("取包", t);
1915
+ const t = St("/magic-blocks/export", xt()), e = me(), r = await Tt("取包", t);
1915
1916
  tt.value = r.rules, await ve(n.target, r, { clean: !0, verify: !0, thorough: Vt.value, front: e });
1916
1917
  } catch (t) {
1917
1918
  throw Ct(!1, "导出失败"), t;
@@ -1919,13 +1920,13 @@ ${t.text}`).join(`
1919
1920
  ut.value = !1;
1920
1921
  }
1921
1922
  }
1922
- }, E), ss = () => G(async () => {
1923
+ }, S), ss = () => W(async () => {
1923
1924
  const n = J.value;
1924
1925
  if (J.value = null, !!n) {
1925
1926
  ut.value = !0;
1926
1927
  try {
1927
1928
  lt(15, "重新取一份开发包…");
1928
- const t = Et("/magic-blocks/export", xt()), e = me(), r = await Tt("取包", t);
1929
+ const t = St("/magic-blocks/export", xt()), e = me(), r = await Tt("取包", t);
1929
1930
  tt.value = r.rules, await ve(n.target, r, { clean: !1, verify: !0, thorough: Vt.value, front: e });
1930
1931
  } catch (t) {
1931
1932
  throw Ct(!1, "导出失败"), t;
@@ -1933,21 +1934,21 @@ ${t.text}`).join(`
1933
1934
  ut.value = !1;
1934
1935
  }
1935
1936
  }
1936
- }, E);
1937
+ }, S);
1937
1938
  function os() {
1938
1939
  J.value = null, F.value = { active: !1, percent: 0, stage: "", failed: !1 }, y.value = "这次没有导出(目录里的东西一个字节都没动)", V.value = "";
1939
1940
  }
1940
- const Ve = () => G(async () => {
1941
+ const Je = () => W(async () => {
1941
1942
  const n = z.value ?? await xe();
1942
- z.value = n, q.value || (q.value = n), $t.value = !0, y.value = "", W.value = [], Y.value = [];
1943
+ z.value = n, q.value || (q.value = n), $t.value = !0, y.value = "", G.value = [], Y.value = [];
1943
1944
  try {
1944
1945
  const t = await be().catch((L) => {
1945
- throw new Error(`取不到扫描规则(GET /magic-blocks/rules):${Ot(L)}`);
1946
+ throw new Error(`取不到扫描规则(GET /magic-blocks/rules):${Rt(L)}`);
1946
1947
  }), e = await Ho(n, t), r = await at("/magic-blocks/read", {
1947
1948
  method: "POST",
1948
1949
  body: JSON.stringify({ ...e, includeMissing: !1 })
1949
1950
  });
1950
- O.value = r;
1951
+ R.value = r;
1951
1952
  const B = {};
1952
1953
  for (const L of r.blocks ?? []) B[L.id] = L.status === "modified" && L.canApply;
1953
1954
  ct.value = B;
@@ -1956,44 +1957,44 @@ ${t.text}`).join(`
1956
1957
  } finally {
1957
1958
  $t.value = !1;
1958
1959
  }
1959
- }, E), ls = () => G(async () => {
1960
- const n = Wt.value, t = Us(n);
1961
- 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)
1962
1963
  throw y.value = "", new Error(`前端校验没过(${t.issues.length} 条),没有发请求:
1963
1964
  - ${t.issues.join(`
1964
1965
  - `)}`);
1965
1966
  st.value = !0, y.value = "";
1966
1967
  try {
1967
- const e = await Et("/magic-blocks/import", { updatedBy: "", blocks: n });
1968
- Y.value = e.results ?? [], y.value = `保存:成功 ${e.saved} 个、失败 ${e.failed} 个`, await St();
1968
+ const e = await St("/magic-blocks/import", { updatedBy: "", blocks: n });
1969
+ Y.value = e.results ?? [], y.value = `保存:成功 ${e.saved} 个、失败 ${e.failed} 个`, await Et();
1969
1970
  const r = y.value;
1970
- await Ve(), y.value = `${r};已重新读回该目录`;
1971
+ await Je(), y.value = `${r};已重新读回该目录`;
1971
1972
  } finally {
1972
1973
  st.value = !1;
1973
1974
  }
1974
- }, E);
1975
+ }, S);
1975
1976
  function as(n, t) {
1976
1977
  const e = t.target;
1977
1978
  ct.value[n] = e?.checked === !0;
1978
1979
  }
1979
- function Je(n) {
1980
+ function We(n) {
1980
1981
  const t = { ...ct.value };
1981
- for (const e of Gt.value) t[e.id] = n;
1982
+ for (const e of Wt.value) t[e.id] = n;
1982
1983
  ct.value = t;
1983
1984
  }
1984
1985
  function Ge(n) {
1985
1986
  const t = n.detail?.uuid ?? "";
1986
1987
  c.value = !0, _.value = t;
1987
1988
  }
1988
- function We(n) {
1989
+ function Ye(n) {
1989
1990
  n.key === "Escape" && c.value && (c.value = !1);
1990
1991
  }
1991
1992
  return dn(() => {
1992
- window.addEventListener("magic-block:open-console", Ge), window.addEventListener("keydown", We), St(), be().catch(() => {
1993
+ window.addEventListener("magic-block:open-console", Ge), window.addEventListener("keydown", Ye), Et(), be().catch(() => {
1993
1994
  });
1994
1995
  }), pn(() => {
1995
- window.removeEventListener("magic-block:open-console", Ge), window.removeEventListener("keydown", We);
1996
- }), (n, t) => it(i) ? (p(), f("div", {
1996
+ window.removeEventListener("magic-block:open-console", Ge), window.removeEventListener("keydown", Ye);
1997
+ }), (n, t) => it(i) ? (d(), p("div", {
1997
1998
  key: 0,
1998
1999
  class: K(["mbc__shell", { "is-wide": C.value }])
1999
2000
  }, [
@@ -2003,7 +2004,7 @@ ${t.text}`).join(`
2003
2004
  title: "magic block 控制台",
2004
2005
  onClick: t[0] || (t[0] = (e) => c.value = !0)
2005
2006
  }, "块"),
2006
- c.value ? (p(), f("aside", {
2007
+ c.value ? (d(), p("aside", {
2007
2008
  key: 0,
2008
2009
  class: K(["mbc", { "is-wide": C.value }])
2009
2010
  }, [
@@ -2028,37 +2029,37 @@ ${t.text}`).join(`
2028
2029
  ]),
2029
2030
  a("div", Jo, [
2030
2031
  a("button", {
2031
- class: K(["mbc__tab", { "is-on": R.value === "blocks" }]),
2032
+ class: K(["mbc__tab", { "is-on": O.value === "blocks" }]),
2032
2033
  type: "button",
2033
2034
  role: "tab",
2034
- "aria-selected": R.value === "blocks",
2035
- 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")
2036
2037
  }, [
2037
2038
  t[45] || (t[45] = $(" 块 ", -1)),
2038
- a("span", Wo, b(v.value.length), 1),
2039
- de.value > 0 ? (p(), f("span", {
2039
+ a("span", Go, b(v.value.length), 1),
2040
+ de.value > 0 ? (d(), p("span", {
2040
2041
  key: 0,
2041
2042
  class: "mbc__chip is-bad",
2042
2043
  title: `${de.value} 个块被停用(体检没过)`
2043
2044
  }, b(de.value) + " 停用", 9, Yo)) : k("", !0)
2044
- ], 10, Go),
2045
+ ], 10, Wo),
2045
2046
  a("button", {
2046
- class: K(["mbc__tab", { "is-on": R.value === "workspace" }]),
2047
+ class: K(["mbc__tab", { "is-on": O.value === "workspace" }]),
2047
2048
  type: "button",
2048
2049
  role: "tab",
2049
- "aria-selected": R.value === "workspace",
2050
- 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")
2051
2052
  }, [
2052
2053
  t[46] || (t[46] = $(" 工作区(导出 / 读回 / 校验) ", -1)),
2053
- dt.value > 0 ? (p(), f("span", {
2054
+ dt.value > 0 ? (d(), p("span", {
2054
2055
  key: 0,
2055
2056
  class: "mbc__chip is-bad",
2056
2057
  title: `这一趟有 ${dt.value} 条问题`
2057
- }, b(dt.value), 9, Xo)) : Y.value.length > 0 ? (p(), f("span", Qo, b(re.value) + " 存成", 1)) : k("", !0)
2058
+ }, b(dt.value), 9, Xo)) : Y.value.length > 0 ? (d(), p("span", Qo, b(re.value) + " 存成", 1)) : k("", !0)
2058
2059
  ], 10, Zo)
2059
2060
  ]),
2060
2061
  a("div", tl, [
2061
- F.value.active ? (p(), f("div", el, [
2062
+ F.value.active ? (d(), p("div", el, [
2062
2063
  a("div", {
2063
2064
  class: K(["mbc__progress", { "is-failed": F.value.failed }]),
2064
2065
  role: "progressbar",
@@ -2075,7 +2076,7 @@ ${t.text}`).join(`
2075
2076
  class: K(["mbc__hint", { "mbc__progress-note": F.value.failed }])
2076
2077
  }, b(F.value.failed ? "✗" : "") + " " + b(F.value.percent) + "% · " + b(F.value.stage), 3)
2077
2078
  ])) : k("", !0),
2078
- J.value ? (p(), f("div", sl, [
2079
+ J.value ? (d(), p("div", sl, [
2079
2080
  a("p", ol, "「" + b(J.value.target.name) + "」里现在有 " + b(J.value.inventory.dirs) + " 个文件夹 / " + b(J.value.inventory.files) + " 个文件", 1),
2080
2081
  a("p", ll, [
2081
2082
  t[47] || (t[47] = a("b", null, "只覆盖", -1)),
@@ -2088,7 +2089,7 @@ ${t.text}`).join(`
2088
2089
  t[54] || (t[54] = $(":先删掉这一包没有的东西,其余同上。 两种都只动这个目录", -1)),
2089
2090
  t[55] || (t[55] = a("b", null, "里面", -1)),
2090
2091
  t[56] || (t[56] = $("的子项:目录本身、以及它外面的任何东西都不会被碰。", -1)),
2091
- J.value.inventory.items.length > 0 ? (p(), f("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)
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)
2092
2093
  ]),
2093
2094
  a("label", il, [
2094
2095
  vt(a("input", {
@@ -2106,39 +2107,39 @@ ${t.text}`).join(`
2106
2107
  a("button", {
2107
2108
  class: "p-button p-button-sm",
2108
2109
  type: "button",
2109
- disabled: E.value,
2110
+ disabled: S.value,
2110
2111
  onClick: t[6] || (t[6] = (e) => ns())
2111
2112
  }, "清空并导出", 8, cl),
2112
2113
  a("button", {
2113
2114
  class: "p-button p-button-sm p-button-outlined",
2114
2115
  type: "button",
2115
- disabled: E.value,
2116
+ disabled: S.value,
2116
2117
  onClick: t[7] || (t[7] = (e) => ss())
2117
2118
  }, "只覆盖", 8, rl),
2118
2119
  a("button", {
2119
2120
  class: "p-button p-button-sm p-button-text",
2120
2121
  type: "button",
2121
- disabled: E.value,
2122
+ disabled: S.value,
2122
2123
  onClick: t[8] || (t[8] = (e) => os())
2123
2124
  }, "取消", 8, dl)
2124
2125
  ])
2125
2126
  ])) : k("", !0),
2126
- H.value ? (p(), f("div", pl, [
2127
+ H.value ? (d(), p("div", pl, [
2127
2128
  a("p", fl, "删掉「" + b(H.value.row.module) + " / " + b(H.value.row.name || H.value.row.id) + "」的代码文件", 1),
2128
2129
  a("p", bl, [
2129
2130
  t[66] || (t[66] = a("b", null, "库里那一份代码正文会被清空", -1)),
2130
2131
  t[67] || (t[67] = $("(入口 / 清单 / 后端一起); ", -1)),
2131
- H.value.target ? (p(), f(M, { key: 0 }, [
2132
+ H.value.target ? (d(), p(M, { key: 0 }, [
2132
2133
  t[58] || (t[58] = $(" 同时清掉你本机那个块文件夹 ", -1)),
2133
2134
  a("span", ml, b(H.value.target.name) + "/" + b(H.value.folder), 1),
2134
- H.value.inventory && H.value.inventory.items.some((e) => e.name === H.value?.folder) ? (p(), f(M, { key: 0 }, [
2135
+ H.value.inventory && H.value.inventory.items.some((e) => e.name === H.value?.folder) ? (d(), p(M, { key: 0 }, [
2135
2136
  $(" (它现在在顶层,里面有东西:本次会先清空)。 ")
2136
2137
  ], 64)) : k("", !0),
2137
2138
  t[59] || (t[59] = a("b", null, "只动这一个块的文件夹", -1)),
2138
2139
  t[60] || (t[60] = $(":别的块、", -1)),
2139
2140
  t[61] || (t[61] = a("span", { class: "mbc__mono" }, "example/", -1)),
2140
2141
  t[62] || (t[62] = $("、以及目录外面的一切都不会被碰。 ", -1))
2141
- ], 64)) : (p(), f(M, { key: 1 }, [
2142
+ ], 64)) : (d(), p(M, { key: 1 }, [
2142
2143
  t[63] || (t[63] = $(" 现在没有选中开发目录 / 或者读不到它,所以", -1)),
2143
2144
  t[64] || (t[64] = a("b", null, "本机那份不动", -1)),
2144
2145
  t[65] || (t[65] = $(",只清库里那份。 ", -1))
@@ -2152,13 +2153,13 @@ ${t.text}`).join(`
2152
2153
  a("button", {
2153
2154
  class: "p-button p-button-sm",
2154
2155
  type: "button",
2155
- disabled: E.value,
2156
+ disabled: S.value,
2156
2157
  onClick: t[9] || (t[9] = (e) => le())
2157
2158
  }, "确认删除代码文件", 8, hl),
2158
2159
  a("button", {
2159
2160
  class: "p-button p-button-sm p-button-text",
2160
2161
  type: "button",
2161
- disabled: E.value,
2162
+ disabled: S.value,
2162
2163
  onClick: t[10] || (t[10] = (e) => H.value = null)
2163
2164
  }, "取消", 8, gl)
2164
2165
  ])
@@ -2166,8 +2167,8 @@ ${t.text}`).join(`
2166
2167
  vt(a("section", _l, [
2167
2168
  a("h3", yl, [
2168
2169
  t[72] || (t[72] = $(" 库里的块 ", -1)),
2169
- a("span", kl, b(Ue.value.length) + " / " + b(v.value.length), 1),
2170
- P.value.trim() ? (p(), f("span", $l, "标签:" + 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)
2171
2172
  ]),
2172
2173
  vt(a("input", {
2173
2174
  "onUpdate:modelValue": t[11] || (t[11] = (e) => h.value = e),
@@ -2177,7 +2178,7 @@ ${t.text}`).join(`
2177
2178
  }, null, 512), [
2178
2179
  [Xt, h.value]
2179
2180
  ]),
2180
- U.value.length > 0 ? (p(), f("div", wl, [
2181
+ U.value.length > 0 ? (d(), p("div", wl, [
2181
2182
  t[73] || (t[73] = a("span", { class: "mbc__label" }, "标签", -1)),
2182
2183
  vt(a("input", {
2183
2184
  "onUpdate:modelValue": t[12] || (t[12] = (e) => P.value = e),
@@ -2187,14 +2188,14 @@ ${t.text}`).join(`
2187
2188
  }, null, 512), [
2188
2189
  [Xt, P.value]
2189
2190
  ]),
2190
- (p(!0), f(M, null, N(U.value.slice(0, 24), (e) => (p(), f("button", {
2191
+ (d(!0), p(M, null, N(U.value.slice(0, 24), (e) => (d(), p("button", {
2191
2192
  key: e.tag,
2192
2193
  class: K(["p-tag mbc__tag", { "is-on": P.value.trim().toLowerCase() === e.tag.toLowerCase() }]),
2193
2194
  type: "button",
2194
2195
  title: `只看贴了「${e.tag}」的块(${e.count} 个)`,
2195
2196
  onClick: (r) => P.value = P.value.trim().toLowerCase() === e.tag.toLowerCase() ? "" : e.tag
2196
2197
  }, b(e.tag) + " " + b(e.count), 11, xl))), 128)),
2197
- P.value ? (p(), f("button", {
2198
+ P.value ? (d(), p("button", {
2198
2199
  key: 0,
2199
2200
  class: "p-button p-button-sm p-button-text",
2200
2201
  type: "button",
@@ -2202,7 +2203,7 @@ ${t.text}`).join(`
2202
2203
  }, "清掉标签筛选")) : k("", !0)
2203
2204
  ])) : k("", !0),
2204
2205
  a("ul", Cl, [
2205
- (p(!0), f(M, null, N(Ue.value, (e) => (p(), f("li", {
2206
+ (d(!0), p(M, null, N(ze.value, (e) => (d(), p("li", {
2206
2207
  key: e.id
2207
2208
  }, [
2208
2209
  a("button", {
@@ -2211,53 +2212,53 @@ ${t.text}`).join(`
2211
2212
  title: Jn(e),
2212
2213
  onClick: (r) => Ln(e)
2213
2214
  }, [
2214
- a("span", Sl, b(e.module || "unassigned"), 1),
2215
+ a("span", El, b(e.module || "unassigned"), 1),
2215
2216
  a("span", Tl, b(e.name || e.id), 1),
2216
2217
  a("span", {
2217
2218
  class: "mbc__version-badge",
2218
2219
  title: `当前是第 ${e.version || 1} 版,一共留着 ${e.versionCount ?? 1} 版`
2219
2220
  }, [
2220
2221
  $("v" + b(e.version || 1), 1),
2221
- (e.versionCount ?? 1) > 1 ? (p(), f(M, { key: 0 }, [
2222
+ (e.versionCount ?? 1) > 1 ? (d(), p(M, { key: 0 }, [
2222
2223
  $("/" + b(e.versionCount), 1)
2223
2224
  ], 64)) : k("", !0)
2224
2225
  ], 8, Bl),
2225
- (p(!0), f(M, null, N(e.tags ?? [], (r) => (p(), f("span", {
2226
+ (d(!0), p(M, null, N(e.tags ?? [], (r) => (d(), p("span", {
2226
2227
  key: r,
2227
2228
  class: "p-tag mbc__tag mbc__tag--on-row"
2228
2229
  }, b(r), 1))), 128)),
2229
- Jt(e).length > 0 ? (p(), f("span", Ml, b(Jt(e).join(" / ")), 1)) : k("", !0),
2230
+ Jt(e).length > 0 ? (d(), p("span", Ml, b(Jt(e).join(" / ")), 1)) : k("", !0),
2230
2231
  a("em", {
2231
2232
  class: K({ "is-off": e.enabled === !1 })
2232
- }, b(e.enabled === !1 ? Ne(e) || "校验失败已停用" : "可用"), 3),
2233
- (e.detail ?? "").trim() ? (p(), f("span", {
2233
+ }, b(e.enabled === !1 ? Fe(e) || "校验失败已停用" : "可用"), 3),
2234
+ (e.detail ?? "").trim() ? (d(), p("span", {
2234
2235
  key: 1,
2235
2236
  class: "mbc__detail-line",
2236
2237
  title: it(cn)(e.detail ?? "", 240)
2237
2238
  }, b(it(cn)(e.detail ?? "")), 9, Al)) : k("", !0)
2238
- ], 10, El),
2239
- _.value === e.id ? (p(), f("div", Rl, [
2240
- (p(!0), f(M, null, N(ce(e).slice(0, Ee), (r, B) => (p(), f("p", {
2239
+ ], 10, Sl),
2240
+ _.value === e.id ? (d(), p("div", Ol, [
2241
+ (d(!0), p(M, null, N(ce(e).slice(0, Se), (r, B) => (d(), p("p", {
2241
2242
  key: B,
2242
2243
  class: "mbc__problem"
2243
2244
  }, b(r), 1))), 128)),
2244
- ce(e).length > Ee ? (p(), f("p", Ol, "还有 " + b(ce(e).length - Ee) + " 条问题没显示出来:点上面的「校验全部魔法块」重算一遍(这几条是上次校验的结论)", 1)) : k("", !0),
2245
+ ce(e).length > Se ? (d(), p("p", Rl, "还有 " + b(ce(e).length - Se) + " 条问题没显示出来:点上面的「校验全部魔法块」重算一遍(这几条是上次校验的结论)", 1)) : k("", !0),
2245
2246
  a("dl", Pl, [
2246
2247
  t[76] || (t[76] = a("dt", null, "详情", -1)),
2247
2248
  a("dd", null, [
2248
- yt.value !== e.id ? (p(), f(M, { key: 0 }, [
2249
- (e.detail ?? "").trim() ? (p(), f("div", {
2249
+ yt.value !== e.id ? (d(), p(M, { key: 0 }, [
2250
+ (e.detail ?? "").trim() ? (d(), p("div", {
2250
2251
  key: 0,
2251
2252
  class: "mbc__blockdetail",
2252
- innerHTML: it(Eo)(e.detail ?? "")
2253
- }, null, 8, jl)) : (p(), f("span", Ll, "(这一块没写详情 —— 点右边「写详情」写一段**业务功能说明**:谁能用、什么场景、解决什么、输入输出是什么业务含义;用 Markdown 写,**别写路由 / 字段 / 实现方式**)")),
2253
+ innerHTML: it(So)(e.detail ?? "")
2254
+ }, null, 8, jl)) : (d(), p("span", Ll, "(这一块没写详情 —— 点右边「写详情」写一段**业务功能说明**:谁能用、什么场景、解决什么、输入输出是什么业务含义;用 Markdown 写,**别写路由 / 字段 / 实现方式**)")),
2254
2255
  a("button", {
2255
2256
  class: "p-button p-button-sm p-button-text",
2256
2257
  type: "button",
2257
- disabled: E.value,
2258
+ disabled: S.value,
2258
2259
  onClick: (r) => Hn(e)
2259
2260
  }, b((e.detail ?? "").trim() ? "改详情" : "写详情"), 9, Il)
2260
- ], 64)) : (p(), f(M, { key: 1 }, [
2261
+ ], 64)) : (d(), p(M, { key: 1 }, [
2261
2262
  vt(a("textarea", {
2262
2263
  "onUpdate:modelValue": t[14] || (t[14] = (r) => kt.value = r),
2263
2264
  class: "p-inputtext p-component mbc__detailinput",
@@ -2276,13 +2277,13 @@ ${t.text}`).join(`
2276
2277
  a("button", {
2277
2278
  class: "p-button p-button-sm",
2278
2279
  type: "button",
2279
- disabled: E.value,
2280
+ disabled: S.value,
2280
2281
  onClick: (r) => zn(e)
2281
2282
  }, "存详情", 8, Dl),
2282
2283
  a("button", {
2283
2284
  class: "p-button p-button-sm p-button-text",
2284
2285
  type: "button",
2285
- disabled: E.value,
2286
+ disabled: S.value,
2286
2287
  onClick: t[15] || (t[15] = (r) => yt.value = "")
2287
2288
  }, "取消", 8, Nl)
2288
2289
  ], 64))
@@ -2296,43 +2297,43 @@ ${t.text}`).join(`
2296
2297
  ]),
2297
2298
  t[79] || (t[79] = a("dt", null, "标签", -1)),
2298
2299
  a("dd", null, [
2299
- Z.value !== e.id ? (p(), f(M, { key: 0 }, [
2300
- (p(!0), f(M, null, N(e.tags ?? [], (r) => (p(), f("span", {
2300
+ Z.value !== e.id ? (d(), p(M, { key: 0 }, [
2301
+ (d(!0), p(M, null, N(e.tags ?? [], (r) => (d(), p("span", {
2301
2302
  key: r,
2302
2303
  class: "p-tag mbc__tag"
2303
2304
  }, b(r), 1))), 128)),
2304
- (e.tags ?? []).length === 0 ? (p(), f("span", Ul, "(没贴标签)")) : k("", !0),
2305
+ (e.tags ?? []).length === 0 ? (d(), p("span", Ul, "(没贴标签)")) : k("", !0),
2305
2306
  a("button", {
2306
2307
  class: "p-button p-button-sm p-button-text",
2307
2308
  type: "button",
2308
- disabled: E.value,
2309
+ disabled: S.value,
2309
2310
  onClick: (r) => Un(e)
2310
2311
  }, "改标签", 8, zl)
2311
- ], 64)) : (p(), f(M, { key: 1 }, [
2312
+ ], 64)) : (d(), p(M, { key: 1 }, [
2312
2313
  vt(a("input", {
2313
2314
  "onUpdate:modelValue": t[16] || (t[16] = (r) => X.value = r),
2314
2315
  class: "p-inputtext p-component mbc__taginput",
2315
2316
  type: "text",
2316
2317
  placeholder: "逗号分隔,例如:订单, 报表",
2317
- onKeyup: vs((r) => Fe(e), ["enter"])
2318
+ onKeyup: vs((r) => Ue(e), ["enter"])
2318
2319
  }, null, 40, Hl), [
2319
2320
  [Xt, X.value]
2320
2321
  ]),
2321
2322
  a("button", {
2322
2323
  class: "p-button p-button-sm",
2323
2324
  type: "button",
2324
- disabled: E.value,
2325
- onClick: (r) => Fe(e)
2325
+ disabled: S.value,
2326
+ onClick: (r) => Ue(e)
2326
2327
  }, "存标签", 8, Kl),
2327
2328
  a("button", {
2328
2329
  class: "p-button p-button-sm p-button-text",
2329
2330
  type: "button",
2330
- disabled: E.value,
2331
+ disabled: S.value,
2331
2332
  onClick: t[17] || (t[17] = (r) => Z.value = "")
2332
2333
  }, "取消", 8, ql),
2333
- U.value.length > 0 ? (p(), f("div", Vl, [
2334
+ U.value.length > 0 ? (d(), p("div", Vl, [
2334
2335
  t[74] || (t[74] = a("span", { class: "mbc__hint" }, "点现成的加进去:", -1)),
2335
- (p(!0), f(M, null, N(U.value.slice(0, 16), (r) => (p(), f("button", {
2336
+ (d(!0), p(M, null, N(U.value.slice(0, 16), (r) => (d(), p("button", {
2336
2337
  key: r.tag,
2337
2338
  class: "p-tag mbc__tag",
2338
2339
  type: "button",
@@ -2340,15 +2341,15 @@ ${t.text}`).join(`
2340
2341
  onClick: (B) => Kn(r.tag)
2341
2342
  }, b(r.tag), 9, Jl))), 128))
2342
2343
  ])) : k("", !0),
2343
- X.value.trim() ? (p(), f("div", Gl, [
2344
+ X.value.trim() ? (d(), p("div", Wl, [
2344
2345
  t[75] || (t[75] = a("span", { class: "mbc__hint" }, "这一块会贴:", -1)),
2345
- (p(!0), f(M, null, N(X.value.split(/[,,\s]+/).filter(Boolean), (r) => (p(), f("button", {
2346
+ (d(!0), p(M, null, N(X.value.split(/[,,\s]+/).filter(Boolean), (r) => (d(), p("button", {
2346
2347
  key: r,
2347
2348
  class: "p-tag mbc__tag",
2348
2349
  type: "button",
2349
2350
  title: `从这一块上摘掉「${r}」`,
2350
2351
  onClick: (B) => qn(r)
2351
- }, b(r) + " ×", 9, Wl))), 128))
2352
+ }, b(r) + " ×", 9, Gl))), 128))
2352
2353
  ])) : k("", !0)
2353
2354
  ], 64))
2354
2355
  ]),
@@ -2361,7 +2362,7 @@ ${t.text}`).join(`
2361
2362
  a("button", {
2362
2363
  class: "p-button p-button-sm p-button-outlined",
2363
2364
  type: "button",
2364
- disabled: E.value,
2365
+ disabled: S.value,
2365
2366
  onClick: (r) => oe(e),
2366
2367
  title: "删掉这一块的代码文件:本机的文件夹 + 库里那份代码正文(点下去会先问你确认)。块本身留着,页面上会显示成占位框"
2367
2368
  }, "删除代码文件", 8, Xl)
@@ -2372,19 +2373,19 @@ ${t.text}`).join(`
2372
2373
  a("button", {
2373
2374
  class: "p-button p-button-sm p-button-text",
2374
2375
  type: "button",
2375
- disabled: E.value,
2376
+ disabled: S.value,
2376
2377
  onClick: (r) => I(e.id)
2377
2378
  }, b(w.value === e.id ? "读版本中…" : "刷新版本"), 9, ea)
2378
2379
  ]),
2379
- ot.value[e.id] ? ot.value[e.id].length > 0 ? (p(), f("ul", sa, [
2380
- (p(!0), f(M, null, N(ot.value[e.id], (r) => (p(), f("li", {
2380
+ ot.value[e.id] ? ot.value[e.id].length > 0 ? (d(), p("ul", sa, [
2381
+ (d(!0), p(M, null, N(ot.value[e.id], (r) => (d(), p("li", {
2381
2382
  key: r.number,
2382
2383
  class: K({ "is-current": r.current })
2383
2384
  }, [
2384
2385
  a("span", oa, b(rt(r)), 1),
2385
2386
  a("span", la, [
2386
2387
  $(b(r.fileCount) + " 个文件 · " + b(Dt(r.sizeBytes)), 1),
2387
- r.createdBy ? (p(), f(M, { key: 0 }, [
2388
+ r.createdBy ? (d(), p(M, { key: 0 }, [
2388
2389
  $(" · " + b(r.createdBy), 1)
2389
2390
  ], 64)) : k("", !0),
2390
2391
  $(" · " + b(r.createdAt || "—"), 1)
@@ -2393,35 +2394,35 @@ ${t.text}`).join(`
2393
2394
  a("button", {
2394
2395
  class: "p-button p-button-sm p-button-text",
2395
2396
  type: "button",
2396
- disabled: E.value || r.empty,
2397
+ disabled: S.value || r.empty,
2397
2398
  onClick: (B) => In(e, r.number),
2398
2399
  title: r.empty ? "这一版是空包(代码被删过),没有正文可看" : "看这一版的正文(只读)"
2399
2400
  }, "查看", 8, ia),
2400
2401
  a("button", {
2401
2402
  class: "p-button p-button-sm p-button-text",
2402
2403
  type: "button",
2403
- disabled: E.value || r.current || r.empty,
2404
+ disabled: S.value || r.current || r.empty,
2404
2405
  onClick: (B) => Dn(e, r.number),
2405
2406
  title: r.current ? "这一版正在跑" : "把这一版变成当前版(会记成一个新版本)"
2406
2407
  }, "切回", 8, ua),
2407
2408
  a("button", {
2408
2409
  class: "p-button p-button-sm p-button-text",
2409
2410
  type: "button",
2410
- disabled: E.value || r.empty,
2411
+ disabled: S.value || r.empty,
2411
2412
  onClick: (B) => Fn(e, r.number),
2412
2413
  title: r.empty ? "空包没什么可下的" : "下载这一版(一个 zip)"
2413
2414
  }, "下载", 8, ca),
2414
2415
  a("button", {
2415
2416
  class: "p-button p-button-sm p-button-text",
2416
2417
  type: "button",
2417
- disabled: E.value || r.current,
2418
+ disabled: S.value || r.current,
2418
2419
  onClick: (B) => Nn(e, r.number),
2419
2420
  title: r.current ? "当前那一版不许删:先切到别的版本" : "删掉这一版(别的版本不受影响)"
2420
2421
  }, "删", 8, ra)
2421
2422
  ])
2422
2423
  ], 2))), 128))
2423
- ])) : (p(), f("p", da, "这个块还没有版本记录(它从没被保存过)。")) : (p(), f("p", na, "正在读版本…(没读到时点「刷新版本」)")),
2424
- T.value && T.value.id === e.id ? (p(), f("div", pa, [
2424
+ ])) : (d(), p("p", da, "这个块还没有版本记录(它从没被保存过)。")) : (d(), p("p", na, "正在读版本…(没读到时点「刷新版本」)")),
2425
+ T.value && T.value.id === e.id ? (d(), p("div", pa, [
2425
2426
  a("div", fa, [
2426
2427
  a("strong", null, "看 v" + b(T.value.number) + " 的正文(只读)", 1),
2427
2428
  a("button", {
@@ -2430,7 +2431,7 @@ ${t.text}`).join(`
2430
2431
  onClick: t[18] || (t[18] = (r) => T.value = null)
2431
2432
  }, "收起")
2432
2433
  ]),
2433
- (p(!0), f(M, null, N(T.value.files, (r, B) => (p(), f("details", {
2434
+ (d(!0), p(M, null, N(T.value.files, (r, B) => (d(), p("details", {
2434
2435
  key: B,
2435
2436
  class: "mbc__viewer-file"
2436
2437
  }, [
@@ -2443,7 +2444,7 @@ ${t.text}`).join(`
2443
2444
  ]))), 128))
2444
2445
  ])
2445
2446
  ], 512), [
2446
- [Qt, R.value === "blocks"]
2447
+ [Qt, O.value === "blocks"]
2447
2448
  ]),
2448
2449
  vt(a("section", va, [
2449
2450
  t[92] || (t[92] = a("h3", { class: "mbc__title" }, "导出去改(用你自己的编辑器)", -1)),
@@ -2452,7 +2453,7 @@ ${t.text}`).join(`
2452
2453
  a("button", {
2453
2454
  class: "p-button p-button-sm",
2454
2455
  type: "button",
2455
- disabled: E.value,
2456
+ disabled: S.value,
2456
2457
  onClick: t[19] || (t[19] = (e) => Qn())
2457
2458
  }, b(It.value ? "校验中…" : "校验全部魔法块"), 9, ga),
2458
2459
  t[84] || (t[84] = a("span", { class: "mbc__hint" }, "重新跑一遍逐块判据(试加载 + 引用深检),过不了的整块停用;改好再点一次就恢复。", -1))
@@ -2480,21 +2481,21 @@ ${t.text}`).join(`
2480
2481
  }, null, 40, wa),
2481
2482
  $(" 全部块(" + b(v.value.length) + " 个) ", 1)
2482
2483
  ]),
2483
- Q.value === "one" ? (p(), f("select", {
2484
+ Q.value === "one" ? (d(), p("select", {
2484
2485
  key: 0,
2485
2486
  class: "p-inputtext p-component mbc__grow",
2486
2487
  value: wt.value,
2487
- disabled: E.value || v.value.length === 0,
2488
+ disabled: S.value || v.value.length === 0,
2488
2489
  onChange: t[22] || (t[22] = (e) => Kt(e.target.value))
2489
2490
  }, [
2490
- v.value.length === 0 ? (p(), f("option", Ca, "(库里还没有块)")) : k("", !0),
2491
- (p(!0), f(M, null, N(v.value, (e) => (p(), f("option", {
2491
+ v.value.length === 0 ? (d(), p("option", Ca, "(库里还没有块)")) : k("", !0),
2492
+ (d(!0), p(M, null, N(v.value, (e) => (d(), p("option", {
2492
2493
  key: e.id,
2493
2494
  value: e.id
2494
- }, b(e.module) + " / " + b(e.name || e.id), 9, Ea))), 128))
2495
+ }, b(e.module) + " / " + b(e.name || e.id), 9, Sa))), 128))
2495
2496
  ], 40, xa)) : k("", !0)
2496
2497
  ]),
2497
- a("div", Sa, [
2498
+ a("div", Ea, [
2498
2499
  t[87] || (t[87] = a("label", { for: "mbc-dir" }, "导出目录", -1)),
2499
2500
  a("input", {
2500
2501
  id: "mbc-dir",
@@ -2506,13 +2507,13 @@ ${t.text}`).join(`
2506
2507
  a("button", {
2507
2508
  class: "p-button p-button-sm p-button-outlined",
2508
2509
  type: "button",
2509
- disabled: E.value,
2510
- onClick: t[23] || (t[23] = (e) => He("export"))
2510
+ disabled: S.value,
2511
+ onClick: t[23] || (t[23] = (e) => Ke("export"))
2511
2512
  }, "选择文件夹", 8, Ba),
2512
2513
  a("button", {
2513
2514
  class: "p-button p-button-sm mbc__act-export",
2514
2515
  type: "button",
2515
- disabled: E.value || Q.value === "one" && !bt.value,
2516
+ disabled: S.value || Q.value === "one" && !bt.value,
2516
2517
  title: Q.value === "one" && !bt.value ? "先在左边挑一个块(或者把范围改成「全部块」)" : "把库里的块铺到你选的文件夹",
2517
2518
  onClick: t[24] || (t[24] = (e) => ts())
2518
2519
  }, b(ut.value ? "导出中…" : "导出"), 9, Ma)
@@ -2524,11 +2525,11 @@ ${t.text}`).join(`
2524
2525
  t[90] || (t[90] = a("span", { class: "mbc__mono" }, "example/", -1)),
2525
2526
  t[91] || (t[91] = $("。 ", -1))
2526
2527
  ]),
2527
- V.value ? (p(), f("p", Ra, b(V.value), 1)) : k("", !0)
2528
+ V.value ? (d(), p("p", Oa, b(V.value), 1)) : k("", !0)
2528
2529
  ], 512), [
2529
- [Qt, R.value === "workspace"]
2530
+ [Qt, O.value === "workspace"]
2530
2531
  ]),
2531
- vt(a("section", Oa, [
2532
+ vt(a("section", Ra, [
2532
2533
  t[102] || (t[102] = a("h3", { class: "mbc__title" }, "读回改动", -1)),
2533
2534
  a("div", Pa, [
2534
2535
  t[94] || (t[94] = a("label", { for: "mbc-read-dir" }, "读回目录", -1)),
@@ -2542,41 +2543,41 @@ ${t.text}`).join(`
2542
2543
  a("button", {
2543
2544
  class: "p-button p-button-sm p-button-outlined",
2544
2545
  type: "button",
2545
- disabled: E.value,
2546
- onClick: t[25] || (t[25] = (e) => He("read"))
2546
+ disabled: S.value,
2547
+ onClick: t[25] || (t[25] = (e) => Ke("read"))
2547
2548
  }, "选择文件夹", 8, La),
2548
2549
  a("button", {
2549
2550
  class: "p-button p-button-sm p-button-outlined",
2550
2551
  type: "button",
2551
- disabled: E.value,
2552
- onClick: t[26] || (t[26] = (e) => Ve())
2552
+ disabled: S.value,
2553
+ onClick: t[26] || (t[26] = (e) => Je())
2553
2554
  }, b($t.value ? "读回中…" : "读回改动"), 9, Ia)
2554
2555
  ]),
2555
- z.value && q.value && z.value.name !== q.value.name ? (p(), f("p", Da, " 读回的是「" + b(z.value.name) + "」(与导出目录「" + b(q.value.name) + "」不是同一个 —— 想同步就再选一次)。 ", 1)) : (p(), f("p", Na, "读回目录默认跟着导出目录;要读别的文件夹就点「选择文件夹」单独选一个。")),
2556
- O.value ? (p(), f(M, { key: 2 }, [
2557
- Gt.value.length > 0 ? (p(), f("p", Fa, [
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, [
2558
2559
  t[95] || (t[95] = $(" 扫到 ", -1)),
2559
- a("b", null, b(O.value.blocks.length), 1),
2560
+ a("b", null, b(R.value.blocks.length), 1),
2560
2561
  t[96] || (t[96] = $(" 个块,其中 ", -1)),
2561
- a("b", Ua, b(Gt.value.length), 1),
2562
+ a("b", Ua, b(Wt.value.length), 1),
2562
2563
  t[97] || (t[97] = $(" 个可以存;已经勾了 ", -1)),
2563
- a("b", null, b(Wt.value.length), 1),
2564
+ a("b", null, b(Gt.value.length), 1),
2564
2565
  t[98] || (t[98] = $(" 个。 ", -1)),
2565
2566
  a("button", {
2566
2567
  class: "p-button p-button-sm p-button-text",
2567
2568
  type: "button",
2568
- disabled: E.value,
2569
- onClick: t[27] || (t[27] = (e) => Je(!0))
2569
+ disabled: S.value,
2570
+ onClick: t[27] || (t[27] = (e) => We(!0))
2570
2571
  }, "全选可存的", 8, za),
2571
2572
  a("button", {
2572
2573
  class: "p-button p-button-sm p-button-text",
2573
2574
  type: "button",
2574
- disabled: E.value || Wt.value.length === 0,
2575
- onClick: t[28] || (t[28] = (e) => Je(!1))
2575
+ disabled: S.value || Gt.value.length === 0,
2576
+ onClick: t[28] || (t[28] = (e) => We(!1))
2576
2577
  }, "全不选", 8, Ha)
2577
2578
  ])) : k("", !0),
2578
- O.value.blocks.length > 0 ? (p(), f("ul", Ka, [
2579
- (p(!0), f(M, null, N(O.value.blocks, (e) => (p(), f("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", {
2580
2581
  key: e.id,
2581
2582
  class: K(["mbc__block", { "is-picked": ct.value[e.id] === !0, "is-blocked": !e.canApply }])
2582
2583
  }, [
@@ -2597,54 +2598,54 @@ ${t.text}`).join(`
2597
2598
  a("span", {
2598
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" : ""])
2599
2600
  }, b(s[e.status]), 3),
2600
- a("span", Ga, b(e.module || "—"), 1)
2601
+ a("span", Wa, b(e.module || "—"), 1)
2601
2602
  ]),
2602
- a("p", Wa, [
2603
- e.status === "missing" ? (p(), f(M, { key: 0 }, [
2603
+ a("p", Ga, [
2604
+ e.status === "missing" ? (d(), p(M, { key: 0 }, [
2604
2605
  $("目录里没有这一块,勾不上")
2605
- ], 64)) : e.status === "not-in-db" ? (p(), f(M, { key: 1 }, [
2606
+ ], 64)) : e.status === "not-in-db" ? (d(), p(M, { key: 1 }, [
2606
2607
  $("库里还没有这一块 —— 勾上它保存,就是按这一包新建")
2607
- ], 64)) : e.changedFiles.length > 0 ? (p(), f(M, { key: 2 }, [
2608
+ ], 64)) : e.changedFiles.length > 0 ? (d(), p(M, { key: 2 }, [
2608
2609
  t[100] || (t[100] = $("改了:", -1)),
2609
2610
  a("span", Ya, b(e.changedFiles.join(" / ")), 1)
2610
- ], 64)) : (p(), f(M, { key: 3 }, [
2611
+ ], 64)) : (d(), p(M, { key: 3 }, [
2611
2612
  $("内容与库里一致")
2612
2613
  ], 64))
2613
2614
  ]),
2614
- e.blockedWhy ? (p(), f("p", Za, "不能存:" + b(e.blockedWhy), 1)) : k("", !0),
2615
+ e.blockedWhy ? (d(), p("p", Za, "不能存:" + b(e.blockedWhy), 1)) : k("", !0),
2615
2616
  a("p", Xa, b(e.folder || e.where), 1)
2616
2617
  ], 2))), 128))
2617
- ])) : (p(), f("p", Qa, "这个目录里没有认出任何块(点上面那个按钮再扫一次,或者确认文件夹名里有那个块的 uuid)。")),
2618
+ ])) : (d(), p("p", Qa, "这个目录里没有认出任何块(点上面那个按钮再扫一次,或者确认文件夹名里有那个块的 uuid)。")),
2618
2619
  a("div", ti, [
2619
- dt.value > 0 ? (p(), f("button", {
2620
+ dt.value > 0 ? (d(), p("button", {
2620
2621
  key: 0,
2621
2622
  class: "p-button p-button-sm mbc__report-btn",
2622
2623
  type: "button",
2623
2624
  title: "点开看这一趟的全部问题(" + dt.value + " 条)",
2624
- onClick: t[29] || (t[29] = (e) => Rt.value = !0)
2625
- }, "查看问题(" + b(dt.value) + ")⚠", 9, ei)) : (p(), f("span", ni, "这一趟没有问题")),
2626
- O.value.unmatched.length > 0 ? (p(), f("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", {
2627
2628
  key: 2,
2628
2629
  class: "mbc__chip is-bad",
2629
- title: O.value.unmatched.join(" / ")
2630
- }, "认不出归属的文件夹 " + b(O.value.unmatched.length), 9, si)) : k("", !0)
2630
+ title: R.value.unmatched.join(" / ")
2631
+ }, "认不出归属的文件夹 " + b(R.value.unmatched.length), 9, si)) : k("", !0)
2631
2632
  ]),
2632
- (O.value.skipped ?? []).length > 0 ? (p(), f("p", oi, [
2633
- $(" 忽略了 " + b((O.value.skipped ?? []).length) + " 个文件夹(名字里没有 uuid,当测试文件处理 —— 与忽略 ", 1),
2633
+ (R.value.skipped ?? []).length > 0 ? (d(), p("p", oi, [
2634
+ $(" 忽略了 " + b((R.value.skipped ?? []).length) + " 个文件夹(名字里没有 uuid,当测试文件处理 —— 与忽略 ", 1),
2634
2635
  t[101] || (t[101] = a("span", { class: "mbc__mono" }, "example/", -1)),
2635
- $(" 同一个规矩):" + b((O.value.skipped ?? []).join(" / ")), 1)
2636
+ $(" 同一个规矩):" + b((R.value.skipped ?? []).join(" / ")), 1)
2636
2637
  ])) : k("", !0),
2637
2638
  a("div", li, [
2638
2639
  a("button", {
2639
2640
  class: "p-button p-button-sm mbc__act-import",
2640
2641
  type: "button",
2641
- disabled: E.value,
2642
+ disabled: S.value,
2642
2643
  onClick: t[30] || (t[30] = (e) => ls())
2643
- }, b(st.value ? "保存中…" : `保存选中的块(${Wt.value.length})`), 9, ai)
2644
+ }, b(st.value ? "保存中…" : `保存选中的块(${Gt.value.length})`), 9, ai)
2644
2645
  ])
2645
2646
  ], 64)) : k("", !0)
2646
2647
  ], 512), [
2647
- [Qt, R.value === "workspace"]
2648
+ [Qt, O.value === "workspace"]
2648
2649
  ]),
2649
2650
  vt(a("section", ii, [
2650
2651
  a("h3", ui, [
@@ -2652,7 +2653,7 @@ ${t.text}`).join(`
2652
2653
  a("span", ci, b(it(l)), 1),
2653
2654
  a("span", ri, b(pe.value.length), 1)
2654
2655
  ]),
2655
- pe.value.length === 0 ? (p(), f("p", di, "路由表里声明的块,库里都有那一行。")) : (p(), f(M, { key: 1 }, [
2656
+ pe.value.length === 0 ? (d(), p("p", di, "路由表里声明的块,库里都有那一行。")) : (d(), p(M, { key: 1 }, [
2656
2657
  a("p", pi, [
2657
2658
  t[104] || (t[104] = $(" 这些页面的路由(", -1)),
2658
2659
  t[105] || (t[105] = a("span", { class: "mbc__mono" }, "component: MagicBlockPage", -1)),
@@ -2663,7 +2664,7 @@ ${t.text}`).join(`
2663
2664
  $(":在上面「读回改动」里选中放这一块的文件夹(文件夹名里有 uuid), 扫出来就是一条标签写着「" + b(it(l)) + "」、能勾能存的条目。 ", 1)
2664
2665
  ]),
2665
2666
  a("ul", fi, [
2666
- (p(!0), f(M, null, N(pe.value, (e) => (p(), f("li", {
2667
+ (d(!0), p(M, null, N(pe.value, (e) => (d(), p("li", {
2667
2668
  key: e.uuid,
2668
2669
  class: "mbc__block is-blocked"
2669
2670
  }, [
@@ -2690,21 +2691,21 @@ ${t.text}`).join(`
2690
2691
  ])
2691
2692
  ], 64))
2692
2693
  ], 512), [
2693
- [Qt, R.value === "workspace"]
2694
+ [Qt, O.value === "workspace"]
2694
2695
  ]),
2695
- R.value === "workspace" && (W.value.length > 0 || Y.value.length > 0) ? (p(), f("section", ki, [
2696
+ O.value === "workspace" && (G.value.length > 0 || Y.value.length > 0) ? (d(), p("section", ki, [
2696
2697
  t[113] || (t[113] = a("h3", { class: "mbc__title" }, "保存结果", -1)),
2697
2698
  a("p", $i, [
2698
2699
  a("span", wi, "存成 " + b(re.value), 1),
2699
- Ft.value.length > 0 ? (p(), f("span", xi, "没存成 " + b(Ft.value.length), 1)) : k("", !0),
2700
- W.value.length > 0 ? (p(), f("span", Ci, "前端拦下 " + b(W.value.length), 1)) : k("", !0),
2701
- Ft.value.length === 0 && W.value.length === 0 ? (p(), f("span", Ei, "明细在下面那个「查看问题」里(没问题时是空的)。")) : k("", !0)
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)
2702
2703
  ]),
2703
- a("div", Si, [
2704
+ a("div", Ei, [
2704
2705
  a("button", {
2705
2706
  class: "p-button p-button-sm mbc__report-btn",
2706
2707
  type: "button",
2707
- onClick: t[31] || (t[31] = (e) => Rt.value = !0)
2708
+ onClick: t[31] || (t[31] = (e) => Ot.value = !0)
2708
2709
  }, "查看问题(" + b(dt.value) + ")⚠", 1)
2709
2710
  ])
2710
2711
  ])) : k("", !0),
@@ -2714,73 +2715,73 @@ ${t.text}`).join(`
2714
2715
  }, null, -1))
2715
2716
  ]),
2716
2717
  a("footer", Ti, [
2717
- S.value.length > 0 ? (p(), f("button", {
2718
+ E.value.length > 0 ? (d(), p("button", {
2718
2719
  key: 0,
2719
2720
  class: "p-button p-button-sm mbc__report-btn",
2720
2721
  type: "button",
2721
- title: "点开看全部报错(" + S.value.length + " 条)",
2722
+ title: "点开看全部报错(" + E.value.length + " 条)",
2722
2723
  onClick: t[32] || (t[32] = (e) => A.value = !0)
2723
- }, "查看报错(" + b(S.value.length) + " 条)⚠", 9, Bi)) : k("", !0),
2724
- g.value ? (p(), f("p", Mi, b(g.value), 1)) : y.value ? (p(), f("p", Ai, b(y.value), 1)) : (p(), f("p", Ri, "—"))
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, "—"))
2725
2726
  ])
2726
2727
  ], 2)) : k("", !0),
2727
- c.value && Rt.value ? (p(), f("div", {
2728
+ c.value && Ot.value ? (d(), p("div", {
2728
2729
  key: 1,
2729
2730
  class: "mbc__modal",
2730
2731
  role: "dialog",
2731
2732
  "aria-modal": "true",
2732
- onClick: t[36] || (t[36] = Se((e) => Rt.value = !1, ["self"]))
2733
+ onClick: t[36] || (t[36] = Ee((e) => Ot.value = !1, ["self"]))
2733
2734
  }, [
2734
- a("div", Oi, [
2735
+ a("div", Ri, [
2735
2736
  a("header", Pi, [
2736
2737
  a("strong", null, "读回 / 保存的问题(" + b(dt.value) + " 条)", 1),
2737
2738
  a("button", {
2738
2739
  class: "p-button p-button-sm p-button-text",
2739
2740
  type: "button",
2740
- onClick: t[33] || (t[33] = (e) => Rt.value = !1)
2741
+ onClick: t[33] || (t[33] = (e) => Ot.value = !1)
2741
2742
  }, "收起")
2742
2743
  ]),
2743
2744
  a("div", ji, [
2744
- W.value.length > 0 ? (p(), f("section", Li, [
2745
- a("h4", Ii, "前端校验拦下的(" + b(W.value.length) + ")", 1),
2745
+ G.value.length > 0 ? (d(), p("section", Li, [
2746
+ a("h4", Ii, "前端校验拦下的(" + b(G.value.length) + ")", 1),
2746
2747
  a("ul", Di, [
2747
- (p(!0), f(M, null, N(W.value, (e, r) => (p(), f("li", { key: r }, b(e), 1))), 128))
2748
+ (d(!0), p(M, null, N(G.value, (e, r) => (d(), p("li", { key: r }, b(e), 1))), 128))
2748
2749
  ])
2749
2750
  ])) : k("", !0),
2750
- (O.value?.failures ?? []).length > 0 ? (p(), f("section", Ni, [
2751
- a("h4", Fi, "读回时逐条回的(" + b((O.value?.failures ?? []).length) + ")", 1),
2751
+ (R.value?.failures ?? []).length > 0 ? (d(), p("section", Ni, [
2752
+ a("h4", Fi, "读回时逐条回的(" + b((R.value?.failures ?? []).length) + ")", 1),
2752
2753
  a("ul", Ui, [
2753
- (p(!0), f(M, null, N(O.value?.failures ?? [], (e, r) => (p(), f("li", { key: r }, [
2754
+ (d(!0), p(M, null, N(R.value?.failures ?? [], (e, r) => (d(), p("li", { key: r }, [
2754
2755
  a("span", zi, b(e.kind || "问题"), 1),
2755
2756
  a("span", Hi, b(e.where), 1),
2756
2757
  $(" " + b(e.message), 1)
2757
2758
  ]))), 128))
2758
2759
  ])
2759
2760
  ])) : k("", !0),
2760
- (O.value?.unmatched ?? []).length > 0 ? (p(), f("section", Ki, [
2761
- a("h4", qi, "认不出归属的文件夹(" + b((O.value?.unmatched ?? []).length) + ")", 1),
2761
+ (R.value?.unmatched ?? []).length > 0 ? (d(), p("section", Ki, [
2762
+ a("h4", qi, "认不出归属的文件夹(" + b((R.value?.unmatched ?? []).length) + ")", 1),
2762
2763
  a("ul", Vi, [
2763
- (p(!0), f(M, null, N(O.value?.unmatched ?? [], (e, r) => (p(), f("li", { key: r }, [
2764
+ (d(!0), p(M, null, N(R.value?.unmatched ?? [], (e, r) => (d(), p("li", { key: r }, [
2764
2765
  a("span", Ji, b(e), 1)
2765
2766
  ]))), 128))
2766
2767
  ])
2767
2768
  ])) : k("", !0),
2768
- Y.value.length > 0 ? (p(), f("section", Gi, [
2769
- a("h4", Wi, "保存结果(" + b(Y.value.length) + ":存成 " + b(re.value) + ",没存成 " + b(Ft.value.length) + ")", 1),
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),
2770
2771
  a("ul", Yi, [
2771
- (p(!0), f(M, null, N(Y.value, (e) => (p(), f("li", {
2772
+ (d(!0), p(M, null, N(Y.value, (e) => (d(), p("li", {
2772
2773
  key: e.id,
2773
2774
  class: K({ "is-ok": e.ok })
2774
2775
  }, [
2775
2776
  a("strong", null, b(e.name || e.id) + ":" + b(e.ok ? "已保存" : "没保存"), 1),
2776
- !e.ok && e.error ? (p(), f("span", Zi, b(e.error), 1)) : k("", !0),
2777
- !e.ok && (e.issues ?? []).length > 0 ? (p(), f("ul", Xi, [
2778
- (p(!0), f(M, null, N(e.issues, (r, B) => (p(), f("li", { key: B }, b(r), 1))), 128))
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, [
2779
+ (d(!0), p(M, null, N(e.issues, (r, B) => (d(), p("li", { key: B }, b(r), 1))), 128))
2779
2780
  ])) : k("", !0)
2780
2781
  ], 2))), 128))
2781
2782
  ])
2782
2783
  ])) : k("", !0),
2783
- dt.value === 0 ? (p(), f("p", Qi, "这一趟没有问题。")) : k("", !0)
2784
+ dt.value === 0 ? (d(), p("p", Qi, "这一趟没有问题。")) : k("", !0)
2784
2785
  ]),
2785
2786
  a("footer", tu, [
2786
2787
  a("button", {
@@ -2791,21 +2792,21 @@ ${t.text}`).join(`
2791
2792
  a("button", {
2792
2793
  class: "p-button p-button-sm",
2793
2794
  type: "button",
2794
- onClick: t[35] || (t[35] = (e) => Rt.value = !1)
2795
+ onClick: t[35] || (t[35] = (e) => Ot.value = !1)
2795
2796
  }, "知道了")
2796
2797
  ])
2797
2798
  ])
2798
2799
  ])) : k("", !0),
2799
- c.value && A.value ? (p(), f("div", {
2800
+ c.value && A.value ? (d(), p("div", {
2800
2801
  key: 2,
2801
2802
  class: "mbc__modal",
2802
2803
  role: "dialog",
2803
2804
  "aria-modal": "true",
2804
- onClick: t[41] || (t[41] = Se((e) => A.value = !1, ["self"]))
2805
+ onClick: t[41] || (t[41] = Ee((e) => A.value = !1, ["self"]))
2805
2806
  }, [
2806
2807
  a("div", eu, [
2807
2808
  a("header", nu, [
2808
- a("strong", null, "报错(" + b(S.value.length) + " 条)", 1),
2809
+ a("strong", null, "报错(" + b(E.value.length) + " 条)", 1),
2809
2810
  a("button", {
2810
2811
  class: "p-button p-button-sm p-button-text",
2811
2812
  type: "button",
@@ -2814,7 +2815,7 @@ ${t.text}`).join(`
2814
2815
  ]),
2815
2816
  a("div", su, [
2816
2817
  a("ol", ou, [
2817
- (p(!0), f(M, null, N(S.value, (e, r) => (p(), f("li", { key: r }, [
2818
+ (d(!0), p(M, null, N(E.value, (e, r) => (d(), p("li", { key: r }, [
2818
2819
  a("div", lu, [
2819
2820
  a("span", au, b(e.at), 1),
2820
2821
  $(" · " + b(e.where), 1)
@@ -2822,7 +2823,7 @@ ${t.text}`).join(`
2822
2823
  a("pre", iu, b(e.text), 1)
2823
2824
  ]))), 128))
2824
2825
  ]),
2825
- S.value.length === 0 ? (p(), f("p", uu, "这一轮没有报错。")) : k("", !0)
2826
+ E.value.length === 0 ? (d(), p("p", uu, "这一轮没有报错。")) : k("", !0)
2826
2827
  ]),
2827
2828
  a("footer", cu, [
2828
2829
  a("button", {
@@ -2843,7 +2844,7 @@ ${t.text}`).join(`
2843
2844
  ])
2844
2845
  ])
2845
2846
  ])) : k("", !0),
2846
- c.value ? (p(), f("button", {
2847
+ c.value ? (d(), p("button", {
2847
2848
  key: 3,
2848
2849
  class: "mbc__close",
2849
2850
  type: "button",
@@ -2852,22 +2853,22 @@ ${t.text}`).join(`
2852
2853
  }, "×")) : k("", !0)
2853
2854
  ], 2)) : k("", !0);
2854
2855
  }
2855
- }), hu = /* @__PURE__ */ hn(pu, [["__scopeId", "data-v-98b797e3"]]);
2856
+ }), hu = /* @__PURE__ */ hn(pu, [["__scopeId", "data-v-d5b8cd2e"]]);
2856
2857
  Object.assign(Mn, { [Bn]: !0 });
2857
2858
  export {
2858
- gs as API_BASE,
2859
+ Te as API_BASE,
2859
2860
  zs as BLOCK_BACKEND_FILE,
2860
2861
  Ht as BLOCK_ENTRY,
2861
2862
  ye as BLOCK_MANIFEST,
2862
2863
  Bn as BLOCK_PAGE_MARK,
2863
- $s as CLIENT_SOURCE,
2864
+ ks as CLIENT_SOURCE,
2864
2865
  ke as MANIFEST_KEYS,
2865
2866
  en as MANIFEST_REQUIRED,
2866
2867
  hu as MagicBlockConsole,
2867
2868
  Mn as MagicBlockPage,
2868
- je as NAME_MAX,
2869
+ Le as NAME_MAX,
2869
2870
  xo as blockPlacementProblems,
2870
- Ws as buildPreview,
2871
+ Gs as buildPreview,
2871
2872
  Us as checkSelection,
2872
2873
  ko as declaredMissing,
2873
2874
  Tn as declaredUuidOf,
@@ -2878,7 +2879,8 @@ export {
2878
2879
  Ys as onBlockRenderRefresh,
2879
2880
  Ds as parseManifest,
2880
2881
  Zs as refreshBlockRender,
2882
+ yu as setApiBase,
2881
2883
  Ns as validFileName,
2882
- Rs as validName,
2884
+ Os as validName,
2883
2885
  Fs as validateBlock
2884
2886
  };