labull-framework 0.1.23 → 0.1.24

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