labull-framework 0.1.31 → 0.1.33

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