md-editor-v3 6.4.2 → 6.5.0

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,7 +1,7 @@
1
- import { useId as Fe, provide as T, computed as A, reactive as re, watch as E, onMounted as H, ref as G, inject as w, nextTick as U, shallowRef as ee, onBeforeUnmount as te, toRef as Ae, defineComponent as ce, createVNode as j, Fragment as Re, h as He } from "vue";
1
+ import { useId as Fe, provide as I, computed as A, reactive as re, watch as E, onMounted as H, ref as G, inject as C, nextTick as U, shallowRef as ee, onBeforeUnmount as te, toRef as Ae, defineComponent as ce, createVNode as j, Fragment as Re, h as He } from "vue";
2
2
  import { deepMerge as Me, deepClone as Pe, randomId as le, debounce as Le } from "@vavt/util";
3
3
  import { p as f, g as P, f as ue, s as me, b as Oe, a as _e } from "./config.mjs";
4
- import { b as y, U as Be, C as Ee, B as X, O as ke, E as Q, P as fe, F as he, f as pe, g as ge, H as ve, h as ye, R as ie, e as je, i as de, d as Ne, j as oe, k as De, T as Ve } from "./event-bus.mjs";
4
+ import { b as v, U as Be, C as Ee, B as X, O as ke, E as Q, P as fe, F as he, f as pe, g as ge, H as ve, h as ye, R as ie, e as je, i as de, d as Ne, j as oe, k as De, T as Ve } from "./event-bus.mjs";
5
5
  import { a as O, u as Ge, S as Ue, c as ze, z as We } from "./dom.mjs";
6
6
  import qe from "@vavt/copy2clipboard";
7
7
  import Ke from "markdown-it";
@@ -36,28 +36,28 @@ const M = {
36
36
  o.buildFinished = !1;
37
37
  }
38
38
  ), H(() => {
39
- y.on(n, {
39
+ v.on(n, {
40
40
  name: X,
41
- callback(u) {
42
- o.buildFinished = !0, o.html = u;
41
+ callback(m) {
42
+ o.buildFinished = !0, o.html = m;
43
43
  }
44
- }), y.on(n, {
44
+ }), v.on(n, {
45
45
  name: ke,
46
46
  callback() {
47
- const u = new Promise((c) => {
47
+ const m = new Promise((d) => {
48
48
  if (o.buildFinished)
49
- c(o.html);
49
+ d(o.html);
50
50
  else {
51
- const m = (s) => {
52
- c(s), y.remove(n, X, m);
51
+ const u = (s) => {
52
+ d(s), v.remove(n, X, u);
53
53
  };
54
- y.on(n, {
54
+ v.on(n, {
55
55
  name: X,
56
- callback: m
56
+ callback: u
57
57
  });
58
58
  }
59
59
  });
60
- e.onSave ? e.onSave(e.modelValue, u) : t.emit("onSave", e.modelValue, u);
60
+ e.onSave ? e.onSave(e.modelValue, m) : t.emit("onSave", e.modelValue, m);
61
61
  }
62
62
  });
63
63
  });
@@ -66,49 +66,49 @@ const M = {
66
66
  rootRef: r,
67
67
  setting: n
68
68
  }) => {
69
- const o = P.editorExtensions.highlight, u = P.editorExtensionsAttrs.highlight;
70
- T("editorId", t), T("rootRef", r), T(
69
+ const o = P.editorExtensions.highlight, m = P.editorExtensionsAttrs.highlight;
70
+ I("editorId", t), I("rootRef", r), I(
71
71
  "theme",
72
72
  A(() => e.theme)
73
- ), T(
73
+ ), I(
74
74
  "language",
75
75
  A(() => e.language)
76
- ), T(
76
+ ), I(
77
77
  "highlight",
78
78
  A(() => {
79
- const { js: m } = o, s = {
79
+ const { js: u } = o, s = {
80
80
  ...ue,
81
81
  ...o.css
82
- }, { js: l, css: i = {} } = u || {}, a = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme, d = s[e.codeTheme] ? s[e.codeTheme][a] : ue.atom[a], $ = s[e.codeTheme] && i[e.codeTheme] ? i[e.codeTheme][a] : i.atom ? i.atom[a] : {};
82
+ }, { js: l, css: i = {} } = m || {}, a = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme, c = s[e.codeTheme] ? s[e.codeTheme][a] : ue.atom[a], $ = s[e.codeTheme] && i[e.codeTheme] ? i[e.codeTheme][a] : i.atom ? i.atom[a] : {};
83
83
  return {
84
84
  js: {
85
- src: m,
85
+ src: u,
86
86
  ...l
87
87
  },
88
88
  css: {
89
- href: d,
89
+ href: c,
90
90
  ...$
91
91
  }
92
92
  };
93
93
  })
94
- ), T("showCodeRowNumber", e.showCodeRowNumber);
95
- const c = A(() => {
96
- const m = {
94
+ ), I("showCodeRowNumber", e.showCodeRowNumber);
95
+ const d = A(() => {
96
+ const u = {
97
97
  ...me,
98
98
  ...P.editorConfig.languageUserDefined
99
99
  };
100
100
  return Me(
101
101
  Pe(me["en-US"]),
102
- m[e.language] || {}
102
+ u[e.language] || {}
103
103
  );
104
104
  });
105
- return T("usedLanguageText", c), T(
105
+ return I("usedLanguageText", d), I(
106
106
  "previewTheme",
107
107
  A(() => e.previewTheme)
108
- ), T(
108
+ ), I(
109
109
  "customIcon",
110
110
  A(() => e.customIcon)
111
- ), T(
111
+ ), I(
112
112
  "setting",
113
113
  A(() => n ? {
114
114
  // setting是reactive,不转化是可以直接赋值的
@@ -121,28 +121,28 @@ const M = {
121
121
  fullscreen: !1
122
122
  })
123
123
  ), { editorId: t };
124
- }, Jt = (e, t) => (T("tabWidth", e.tabWidth), T(
124
+ }, Jt = (e, t) => (I("tabWidth", e.tabWidth), I(
125
125
  "disabled",
126
126
  A(() => e.disabled)
127
- ), T(
127
+ ), I(
128
128
  "showToolbarName",
129
129
  A(() => e.showToolbarName)
130
- ), T("noUploadImg", e.noUploadImg), T(
130
+ ), I("noUploadImg", e.noUploadImg), I(
131
131
  "tableShape",
132
132
  A(() => e.tableShape)
133
- ), T("noPrettier", e.noPrettier), T(
133
+ ), I("noPrettier", e.noPrettier), I(
134
134
  "codeTheme",
135
135
  A(() => e.codeTheme)
136
- ), T("updateSetting", t.updateSetting), T(
136
+ ), I("updateSetting", t.updateSetting), I(
137
137
  "catalogVisible",
138
138
  A(() => t.catalogVisible.value)
139
- ), T("defToolbars", t.defToolbars), T(
139
+ ), I("defToolbars", t.defToolbars), I(
140
140
  "floatingToolbars",
141
141
  A(() => e.floatingToolbars)
142
142
  ), Te(e, t)), Xt = (e) => {
143
- const { noPrettier: t, noUploadImg: r } = e, { editorExtensions: n, editorExtensionsAttrs: o } = P, u = t || n.prettier.prettierInstance, c = t || n.prettier.parserMarkdownInstance, m = r || n.cropper.instance;
143
+ const { noPrettier: t, noUploadImg: r } = e, { editorExtensions: n, editorExtensionsAttrs: o } = P, m = t || n.prettier.prettierInstance, d = t || n.prettier.parserMarkdownInstance, u = r || n.cropper.instance;
144
144
  H(() => {
145
- if (!m) {
145
+ if (!u) {
146
146
  const { js: s = {}, css: l = {} } = o.cropper || {};
147
147
  O("link", {
148
148
  ...l,
@@ -155,7 +155,7 @@ const M = {
155
155
  id: M.cropperjs
156
156
  });
157
157
  }
158
- if (!u) {
158
+ if (!m) {
159
159
  const { standaloneJs: s = {} } = o.prettier || {};
160
160
  O("script", {
161
161
  ...s,
@@ -163,7 +163,7 @@ const M = {
163
163
  id: M.prettier
164
164
  });
165
165
  }
166
- if (!c) {
166
+ if (!d) {
167
167
  const { parserMarkdownJs: s = {} } = o.prettier || {};
168
168
  O("script", {
169
169
  ...s,
@@ -175,7 +175,7 @@ const M = {
175
175
  }, Yt = (e, t, r) => {
176
176
  const { editorId: n } = r;
177
177
  H(() => {
178
- y.on(n, {
178
+ v.on(n, {
179
179
  name: Q,
180
180
  callback: (o) => {
181
181
  e.onError?.(o), t.emit("onError", o);
@@ -189,7 +189,7 @@ const M = {
189
189
  preview: e.preview,
190
190
  htmlPreview: e.preview ? !1 : e.htmlPreview,
191
191
  previewOnly: !1
192
- }), u = re({ ...o }), c = (l, i) => {
192
+ }), m = re({ ...o }), d = (l, i) => {
193
193
  const a = i === void 0 ? !o[l] : i;
194
194
  switch (l) {
195
195
  case "preview": {
@@ -201,34 +201,34 @@ const M = {
201
201
  break;
202
202
  }
203
203
  case "previewOnly": {
204
- a ? !o.preview && !o.htmlPreview && (o.preview = !0) : (u.preview || (o.preview = !1), u.htmlPreview || (o.htmlPreview = !1));
204
+ a ? !o.preview && !o.htmlPreview && (o.preview = !0) : (m.preview || (o.preview = !1), m.htmlPreview || (o.htmlPreview = !1));
205
205
  break;
206
206
  }
207
207
  }
208
- u[l] = a, o[l] = a;
208
+ m[l] = a, o[l] = a;
209
209
  };
210
- let m = "";
210
+ let u = "";
211
211
  const s = () => {
212
- o.pageFullscreen || o.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = m;
212
+ o.pageFullscreen || o.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = u;
213
213
  };
214
214
  return E(() => [o.pageFullscreen, o.fullscreen], s), H(() => {
215
- y.on(n, {
215
+ v.on(n, {
216
216
  name: Be,
217
217
  callback(l, i) {
218
- const a = (d) => {
219
- y.emit(n, ie, "image", {
218
+ const a = (c) => {
219
+ v.emit(n, ie, "image", {
220
220
  desc: "",
221
- urls: d
221
+ urls: c
222
222
  }), i?.();
223
223
  };
224
224
  e.onUploadImg ? e.onUploadImg(l, a) : t.emit("onUploadImg", l, a);
225
225
  }
226
- }), m = document.body.style.overflow, s();
227
- }), [o, c];
226
+ }), u = document.body.style.overflow, s();
227
+ }), [o, d];
228
228
  }, en = (e, t) => {
229
229
  const { editorId: r } = t, n = G(!1);
230
230
  return H(() => {
231
- y.on(r, {
231
+ v.on(r, {
232
232
  name: Ee,
233
233
  callback: (o) => {
234
234
  o === void 0 ? n.value = !n.value : n.value = o;
@@ -236,40 +236,40 @@ const M = {
236
236
  });
237
237
  }), n;
238
238
  }, tn = (e, t, r) => {
239
- const { editorId: n, catalogVisible: o, setting: u, updateSetting: c, codeRef: m } = r;
239
+ const { editorId: n, catalogVisible: o, setting: m, updateSetting: d, codeRef: u } = r;
240
240
  E(
241
- () => u.pageFullscreen,
241
+ () => m.pageFullscreen,
242
242
  (l) => {
243
- y.emit(n, fe, l);
243
+ v.emit(n, fe, l);
244
244
  }
245
245
  ), E(
246
- () => u.fullscreen,
246
+ () => m.fullscreen,
247
247
  (l) => {
248
- y.emit(n, he, l);
248
+ v.emit(n, he, l);
249
249
  }
250
250
  ), E(
251
- () => u.preview,
251
+ () => m.preview,
252
252
  (l) => {
253
- y.emit(n, pe, l);
253
+ v.emit(n, pe, l);
254
254
  }
255
255
  ), E(
256
- () => u.previewOnly,
256
+ () => m.previewOnly,
257
257
  (l) => {
258
- y.emit(n, ge, l);
258
+ v.emit(n, ge, l);
259
259
  }
260
260
  ), E(
261
- () => u.htmlPreview,
261
+ () => m.htmlPreview,
262
262
  (l) => {
263
- y.emit(n, ve, l);
263
+ v.emit(n, ve, l);
264
264
  }
265
265
  ), E(o, (l) => {
266
- y.emit(n, ye, l);
266
+ v.emit(n, ye, l);
267
267
  });
268
268
  const s = {
269
269
  on(l, i) {
270
270
  switch (l) {
271
271
  case "pageFullscreen": {
272
- y.on(n, {
272
+ v.on(n, {
273
273
  name: fe,
274
274
  callback(a) {
275
275
  i(a);
@@ -278,7 +278,7 @@ const M = {
278
278
  break;
279
279
  }
280
280
  case "fullscreen": {
281
- y.on(n, {
281
+ v.on(n, {
282
282
  name: he,
283
283
  callback(a) {
284
284
  i(a);
@@ -287,7 +287,7 @@ const M = {
287
287
  break;
288
288
  }
289
289
  case "preview": {
290
- y.on(n, {
290
+ v.on(n, {
291
291
  name: pe,
292
292
  callback(a) {
293
293
  i(a);
@@ -296,7 +296,7 @@ const M = {
296
296
  break;
297
297
  }
298
298
  case "previewOnly": {
299
- y.on(n, {
299
+ v.on(n, {
300
300
  name: ge,
301
301
  callback(a) {
302
302
  i(a);
@@ -305,7 +305,7 @@ const M = {
305
305
  break;
306
306
  }
307
307
  case "htmlPreview": {
308
- y.on(n, {
308
+ v.on(n, {
309
309
  name: ve,
310
310
  callback(a) {
311
311
  i(a);
@@ -314,7 +314,7 @@ const M = {
314
314
  break;
315
315
  }
316
316
  case "catalog": {
317
- y.on(n, {
317
+ v.on(n, {
318
318
  name: ye,
319
319
  callback(a) {
320
320
  i(a);
@@ -325,49 +325,49 @@ const M = {
325
325
  }
326
326
  },
327
327
  togglePageFullscreen(l) {
328
- c("pageFullscreen", l);
328
+ d("pageFullscreen", l);
329
329
  },
330
330
  toggleFullscreen(l) {
331
- y.emit(n, Ne, l);
331
+ v.emit(n, Ne, l);
332
332
  },
333
333
  togglePreview(l) {
334
- c("preview", l);
334
+ d("preview", l);
335
335
  },
336
336
  togglePreviewOnly(l) {
337
- c("previewOnly", l);
337
+ d("previewOnly", l);
338
338
  },
339
339
  toggleHtmlPreview(l) {
340
- c("htmlPreview", l);
340
+ d("htmlPreview", l);
341
341
  },
342
342
  toggleCatalog(l) {
343
- y.emit(n, Ee, l);
343
+ v.emit(n, Ee, l);
344
344
  },
345
345
  triggerSave() {
346
- y.emit(n, ke);
346
+ v.emit(n, ke);
347
347
  },
348
348
  insert(l) {
349
- y.emit(n, ie, "universal", { generate: l });
349
+ v.emit(n, ie, "universal", { generate: l });
350
350
  },
351
351
  focus(l) {
352
- m.value?.focus(l);
352
+ u.value?.focus(l);
353
353
  },
354
354
  rerender() {
355
- y.emit(n, de);
355
+ v.emit(n, de);
356
356
  },
357
357
  getSelectedText() {
358
- return m.value?.getSelectedText();
358
+ return u.value?.getSelectedText();
359
359
  },
360
360
  resetHistory() {
361
- m.value?.resetHistory();
361
+ u.value?.resetHistory();
362
362
  },
363
363
  domEventHandlers(l) {
364
- y.emit(n, je, l);
364
+ v.emit(n, je, l);
365
365
  },
366
366
  execCommand(l) {
367
- y.emit(n, ie, l);
367
+ v.emit(n, ie, l);
368
368
  },
369
369
  getEditorView() {
370
- return m.value?.getEditorView();
370
+ return u.value?.getEditorView();
371
371
  }
372
372
  };
373
373
  t.expose(s);
@@ -375,107 +375,110 @@ const M = {
375
375
  const t = Fe();
376
376
  return e.id || e.editorId || `${f}-${t}`;
377
377
  }, tt = (e, t, r) => {
378
- const n = w("editorId"), o = w("rootRef"), u = w("usedLanguageText"), c = w("setting"), m = () => {
378
+ const n = C("editorId"), o = C("rootRef"), m = C("usedLanguageText"), d = C("setting"), u = () => {
379
379
  o.value.querySelectorAll(`#${n} .${f}-preview .${f}-code`).forEach((i) => {
380
380
  let a = -1;
381
- const d = i.querySelector(
381
+ const c = i.querySelector(
382
382
  `.${f}-copy-button:not([data-processed])`
383
383
  );
384
- d && (d.onclick = ($) => {
384
+ c && (c.onclick = ($) => {
385
385
  $.preventDefault(), clearTimeout(a);
386
- const p = (i.querySelector("input:checked + pre code") || i.querySelector("pre code")).textContent, { text: g, successTips: x, failTips: v } = u.value.copyCode;
387
- let C = x;
388
- qe(e.formatCopiedText(p || "")).catch(() => {
389
- C = v;
386
+ const g = (i.querySelector("input:checked + pre code") || i.querySelector("pre code")).textContent, { text: h, successTips: T, failTips: y } = m.value.copyCode;
387
+ let b = T;
388
+ qe(e.formatCopiedText(g || "")).catch(() => {
389
+ b = y;
390
390
  }).finally(() => {
391
- d.dataset.isIcon ? d.dataset.tips = C : d.innerHTML = C, a = window.setTimeout(() => {
392
- d.dataset.isIcon ? d.dataset.tips = g : d.innerHTML = g;
391
+ c.dataset.isIcon ? c.dataset.tips = b : c.innerHTML = b, a = window.setTimeout(() => {
392
+ c.dataset.isIcon ? c.dataset.tips = h : c.innerHTML = h;
393
393
  }, 1500);
394
394
  });
395
- }, d.setAttribute("data-processed", "true"));
395
+ }, c.setAttribute("data-processed", "true"));
396
396
  });
397
397
  }, s = () => {
398
- U(m);
398
+ U(u);
399
399
  }, l = (i) => {
400
- i && U(m);
400
+ i && U(u);
401
401
  };
402
- E([t, r], s), E(() => c.value.preview, l), E(() => c.value.htmlPreview, l), H(m);
402
+ E([t, r], s), E(() => d.value.preview, l), E(() => d.value.htmlPreview, l), H(u);
403
403
  }, nt = (e) => {
404
- const t = w("editorId"), r = w("theme"), n = w("rootRef"), { editorExtensions: o, editorExtensionsAttrs: u } = P;
405
- let c = o.echarts.instance;
406
- const m = ee(-1), s = () => {
407
- !e.noEcharts && c && (m.value = m.value + 1);
404
+ const t = C("editorId"), r = C("theme"), n = C("rootRef"), { editorExtensions: o, editorExtensionsAttrs: m, echartsConfig: d } = P;
405
+ let u = o.echarts.instance;
406
+ const s = ee(-1), l = () => {
407
+ !e.noEcharts && u && (s.value = s.value + 1);
408
408
  };
409
409
  E(
410
410
  () => r.value,
411
411
  () => {
412
- s();
412
+ l();
413
413
  }
414
414
  ), H(() => {
415
- if (e.noEcharts || c)
415
+ if (e.noEcharts || u)
416
416
  return;
417
- const h = o.echarts.js;
417
+ const g = o.echarts.js;
418
418
  O(
419
419
  "script",
420
420
  {
421
- ...u.echarts?.js,
422
- src: h,
421
+ ...m.echarts?.js,
422
+ src: g,
423
423
  id: M.echarts,
424
424
  onload() {
425
- c = window.echarts, s();
425
+ u = window.echarts, l();
426
426
  }
427
427
  },
428
428
  "echarts"
429
429
  );
430
430
  });
431
- let l = [], i = [], a = [];
432
- const d = (h = !1) => {
433
- if (!l.length) {
434
- h && (i.forEach((v) => {
435
- v.dispose?.();
436
- }), a.forEach((v) => {
437
- v.disconnect?.();
438
- }), i = [], a = []);
431
+ let i = [], a = [], c = [];
432
+ const $ = (g = !1) => {
433
+ if (!i.length) {
434
+ g && (a.forEach((b) => {
435
+ b.dispose?.();
436
+ }), c.forEach((b) => {
437
+ b.disconnect?.();
438
+ }), a = [], c = []);
439
439
  return;
440
440
  }
441
- const p = [], g = [], x = [];
442
- l.forEach((v, C) => {
443
- const S = i[C], b = a[C];
444
- if (h || !v || !v.isConnected || (n?.value ? !n.value.contains(v) : !1)) {
445
- S?.dispose?.(), b?.disconnect?.();
441
+ const h = [], T = [], y = [];
442
+ i.forEach((b, S) => {
443
+ const w = a[S], F = c[S];
444
+ if (g || !b || !b.isConnected || (n?.value ? !n.value.contains(b) : !1)) {
445
+ w?.dispose?.(), F?.disconnect?.();
446
446
  return;
447
447
  }
448
- p.push(v), S && g.push(S), b && x.push(b);
449
- }), l = p, i = g, a = x;
450
- }, $ = () => {
451
- d(), !e.noEcharts && c && Array.from(
448
+ h.push(b), w && T.push(w), F && y.push(F);
449
+ }), i = h, a = T, c = y;
450
+ }, p = () => {
451
+ $(), !e.noEcharts && u && Array.from(
452
452
  n.value.querySelectorAll(
453
453
  `#${t} div.${f}-echarts:not([data-processed])`
454
454
  )
455
- ).forEach((p) => {
456
- if (p.dataset.closed === "false")
455
+ ).forEach((h) => {
456
+ if (h.dataset.closed === "false")
457
457
  return !1;
458
458
  try {
459
- const g = new Function(`return ${p.innerText}`)(), x = c.init(p, r.value);
460
- x.setOption(g), p.setAttribute("data-processed", ""), l.push(p), i.push(x);
461
- const v = new ResizeObserver(() => {
462
- x.resize();
459
+ const T = o.echarts.parseOption(h.innerText, {
460
+ editorId: t,
461
+ element: h
462
+ }), y = d(T), b = u.init(h, r.value);
463
+ b.setOption(y), h.setAttribute("data-processed", ""), i.push(h), a.push(b);
464
+ const S = new ResizeObserver(() => {
465
+ b.resize();
463
466
  });
464
- v.observe(p), a.push(v);
465
- } catch (g) {
466
- y.emit(t, Q, {
467
+ S.observe(h), c.push(S);
468
+ } catch (T) {
469
+ v.emit(t, Q, {
467
470
  name: "echarts",
468
- message: g?.message,
469
- error: g
471
+ message: T?.message,
472
+ error: T
470
473
  });
471
474
  }
472
475
  });
473
476
  };
474
477
  return te(() => {
475
- d(!0);
476
- }), { reRenderEcharts: m, replaceEcharts: $ };
478
+ $(!0);
479
+ }), { reRenderEcharts: s, replaceEcharts: p };
477
480
  }, ot = (e) => {
478
- const t = w("highlight"), r = ee(P.editorExtensions.highlight.instance);
481
+ const t = C("highlight"), r = ee(P.editorExtensions.highlight.instance);
479
482
  return H(() => {
480
483
  e.noHighlight || r.value || (O("link", {
481
484
  ...t.value.css,
@@ -570,10 +573,10 @@ const Y = new rt({
570
573
  // 缓存10分钟
571
574
  ttl: 6e5
572
575
  }), lt = (e) => {
573
- const t = w("editorId"), r = w("theme"), n = w("rootRef"), { editorExtensions: o, editorExtensionsAttrs: u, mermaidConfig: c } = P;
574
- let m = o.mermaid.instance;
576
+ const t = C("editorId"), r = C("theme"), n = C("rootRef"), { editorExtensions: o, editorExtensionsAttrs: m, mermaidConfig: d } = P;
577
+ let u = o.mermaid.instance;
575
578
  const s = ee(-1), l = () => {
576
- if (!e.noMermaid && m) {
579
+ if (!e.noMermaid && u) {
577
580
  const a = r.value === "dark" ? {
578
581
  startOnLoad: !1,
579
582
  theme: "dark"
@@ -593,7 +596,7 @@ const Y = new rt({
593
596
  clusterBorder: "#b7c0cc"
594
597
  }
595
598
  };
596
- m.initialize(c(a)), s.value = s.value + 1;
599
+ u.initialize(d(a)), s.value = s.value + 1;
597
600
  }
598
601
  };
599
602
  return E(
@@ -602,11 +605,11 @@ const Y = new rt({
602
605
  Y.clear(), l();
603
606
  }
604
607
  ), H(() => {
605
- if (e.noMermaid || m)
608
+ if (e.noMermaid || u)
606
609
  return;
607
610
  const a = o.mermaid.js;
608
611
  /\.mjs/.test(a) ? (O("link", {
609
- ...u.mermaid?.js,
612
+ ...m.mermaid?.js,
610
613
  rel: "modulepreload",
611
614
  href: a,
612
615
  id: M.mermaidM
@@ -614,100 +617,100 @@ const Y = new rt({
614
617
  /* @vite-ignore */
615
618
  /* webpackIgnore: true */
616
619
  a
617
- ).then((d) => {
618
- m = d.default, l();
619
- }).catch((d) => {
620
- y.emit(t, Q, {
620
+ ).then((c) => {
621
+ u = c.default, l();
622
+ }).catch((c) => {
623
+ v.emit(t, Q, {
621
624
  name: "mermaid",
622
- message: `Failed to load mermaid module: ${d.message}`,
623
- error: d
625
+ message: `Failed to load mermaid module: ${c.message}`,
626
+ error: c
624
627
  });
625
628
  })) : O(
626
629
  "script",
627
630
  {
628
- ...u.mermaid?.js,
631
+ ...m.mermaid?.js,
629
632
  src: a,
630
633
  id: M.mermaid,
631
634
  onload() {
632
- m = window.mermaid, l();
635
+ u = window.mermaid, l();
633
636
  }
634
637
  },
635
638
  "mermaid"
636
639
  );
637
640
  }), { reRenderRef: s, replaceMermaid: async () => {
638
- if (!e.noMermaid && m) {
641
+ if (!e.noMermaid && u) {
639
642
  const a = n.value.querySelectorAll(
640
643
  `div.${f}-mermaid`
641
- ), d = document.createElement("div"), $ = document.body.offsetWidth > 1366 ? document.body.offsetWidth : 1366, h = document.body.offsetHeight > 768 ? document.body.offsetHeight : 768;
642
- d.style.width = $ + "px", d.style.height = h + "px", d.style.position = "fixed", d.style.zIndex = "-10000", d.style.top = "-10000";
643
- let p = a.length;
644
- p > 0 && document.body.appendChild(d), await Promise.allSettled(
645
- Array.from(a).map((g) => (async (v) => {
646
- if (v.dataset.closed === "false")
644
+ ), c = document.createElement("div"), $ = document.body.offsetWidth > 1366 ? document.body.offsetWidth : 1366, p = document.body.offsetHeight > 768 ? document.body.offsetHeight : 768;
645
+ c.style.width = $ + "px", c.style.height = p + "px", c.style.position = "fixed", c.style.zIndex = "-10000", c.style.top = "-10000";
646
+ let g = a.length;
647
+ g > 0 && document.body.appendChild(c), await Promise.allSettled(
648
+ Array.from(a).map((h) => (async (y) => {
649
+ if (y.dataset.closed === "false")
647
650
  return !1;
648
- const C = v.innerText;
649
- let S = Y.get(C);
651
+ const b = y.innerText;
652
+ let S = Y.get(b);
650
653
  if (!S) {
651
- const b = le();
654
+ const w = le();
652
655
  let F = { svg: "" };
653
656
  try {
654
- F = await m.render(b, C, d), S = await e.sanitizeMermaid(F.svg);
655
- const I = document.createElement("p");
656
- I.className = `${f}-mermaid`, I.setAttribute("data-processed", ""), I.setAttribute("data-content", C), I.innerHTML = S, I.children[0]?.removeAttribute("height"), Y.set(C, I.innerHTML), v.dataset.line !== void 0 && (I.dataset.line = v.dataset.line), v.replaceWith(I);
657
- } catch (I) {
658
- y.emit(t, Q, {
657
+ F = await u.render(w, b, c), S = await e.sanitizeMermaid(F.svg);
658
+ const x = document.createElement("p");
659
+ x.className = `${f}-mermaid`, x.setAttribute("data-processed", ""), x.setAttribute("data-content", b), x.innerHTML = S, x.children[0]?.removeAttribute("height"), Y.set(b, x.innerHTML), y.dataset.line !== void 0 && (x.dataset.line = y.dataset.line), y.replaceWith(x);
660
+ } catch (x) {
661
+ v.emit(t, Q, {
659
662
  name: "mermaid",
660
- message: I.message,
661
- error: I
663
+ message: x.message,
664
+ error: x
662
665
  });
663
666
  }
664
- --p === 0 && d.remove();
667
+ --g === 0 && c.remove();
665
668
  }
666
- })(g))
669
+ })(h))
667
670
  );
668
671
  }
669
672
  } };
670
673
  }, it = (e, t) => {
671
674
  t = t || {};
672
- const r = 3, n = t.marker || "!", o = n.charCodeAt(0), u = n.length;
673
- let c = "", m = "";
674
- const s = (i, a, d, $, h) => {
675
- const p = i[a];
676
- return p.type === "admonition_open" ? i[a].attrPush([
675
+ const r = 3, n = t.marker || "!", o = n.charCodeAt(0), m = n.length;
676
+ let d = "", u = "";
677
+ const s = (i, a, c, $, p) => {
678
+ const g = i[a];
679
+ return g.type === "admonition_open" ? i[a].attrPush([
677
680
  "class",
678
- `${f}-admonition ${f}-admonition-${p.info}`
679
- ]) : p.type === "admonition_title_open" && i[a].attrPush(["class", `${f}-admonition-title`]), h.renderToken(i, a, d);
681
+ `${f}-admonition ${f}-admonition-${g.info}`
682
+ ]) : g.type === "admonition_title_open" && i[a].attrPush(["class", `${f}-admonition-title`]), p.renderToken(i, a, c);
680
683
  }, l = (i) => {
681
684
  const a = i.trim().split(" ", 2);
682
- m = "", c = a[0], a.length > 1 && (m = i.substring(c.length + 2));
685
+ u = "", d = a[0], a.length > 1 && (u = i.substring(d.length + 2));
683
686
  };
684
687
  e.block.ruler.before(
685
688
  "code",
686
689
  "admonition",
687
- (i, a, d, $) => {
688
- let h, p, g, x = !1, v = i.bMarks[a] + i.tShift[a], C = i.eMarks[a];
689
- if (o !== i.src.charCodeAt(v))
690
+ (i, a, c, $) => {
691
+ let p, g, h, T = !1, y = i.bMarks[a] + i.tShift[a], b = i.eMarks[a];
692
+ if (o !== i.src.charCodeAt(y))
690
693
  return !1;
691
- for (h = v + 1; h <= C && n[(h - v) % u] === i.src[h]; h++)
694
+ for (p = y + 1; p <= b && n[(p - y) % m] === i.src[p]; p++)
692
695
  ;
693
- const S = Math.floor((h - v) / u);
696
+ const S = Math.floor((p - y) / m);
694
697
  if (S !== r)
695
698
  return !1;
696
- h -= (h - v) % u;
697
- const b = i.src.slice(v, h), F = i.src.slice(h, C);
699
+ p -= (p - y) % m;
700
+ const w = i.src.slice(y, p), F = i.src.slice(p, b);
698
701
  if (l(F), $)
699
702
  return !0;
700
- for (p = a; p++, !(p >= d || (v = i.bMarks[p] + i.tShift[p], C = i.eMarks[p], v < C && i.sCount[p] < i.blkIndent)); )
701
- if (o === i.src.charCodeAt(v) && !(i.sCount[p] - i.blkIndent >= 4)) {
702
- for (h = v + 1; h <= C && n[(h - v) % u] === i.src[h]; h++)
703
+ for (g = a; g++, !(g >= c || (y = i.bMarks[g] + i.tShift[g], b = i.eMarks[g], y < b && i.sCount[g] < i.blkIndent)); )
704
+ if (o === i.src.charCodeAt(y) && !(i.sCount[g] - i.blkIndent >= 4)) {
705
+ for (p = y + 1; p <= b && n[(p - y) % m] === i.src[p]; p++)
703
706
  ;
704
- if (!(Math.floor((h - v) / u) < S) && (h -= (h - v) % u, h = i.skipSpaces(h), !(h < C))) {
705
- x = !0;
707
+ if (!(Math.floor((p - y) / m) < S) && (p -= (p - y) % m, p = i.skipSpaces(p), !(p < b))) {
708
+ T = !0;
706
709
  break;
707
710
  }
708
711
  }
709
- const I = i.parentType, L = i.lineMax;
710
- return i.parentType = "root", i.lineMax = p, g = i.push("admonition_open", "div", 1), g.markup = b, g.block = !0, g.info = c, g.map = [a, p], m && (g = i.push("admonition_title_open", "p", 1), g.markup = b + " " + c, g.map = [a, p], g = i.push("inline", "", 0), g.content = m, g.map = [a, i.line - 1], g.children = [], g = i.push("admonition_title_close", "p", -1), g.markup = b + " " + c), i.md.block.tokenize(i, a + 1, p), g = i.push("admonition_close", "div", -1), g.markup = i.src.slice(v, h), g.block = !0, i.parentType = I, i.lineMax = L, i.line = p + (x ? 1 : 0), !0;
712
+ const x = i.parentType, L = i.lineMax;
713
+ return i.parentType = "root", i.lineMax = g, h = i.push("admonition_open", "div", 1), h.markup = w, h.block = !0, h.info = d, h.map = [a, g], u && (h = i.push("admonition_title_open", "p", 1), h.markup = w + " " + d, h.map = [a, g], h = i.push("inline", "", 0), h.content = u, h.map = [a, i.line - 1], h.children = [], h = i.push("admonition_title_close", "p", -1), h.markup = w + " " + d), i.md.block.tokenize(i, a + 1, g), h = i.push("admonition_close", "div", -1), h.markup = i.src.slice(y, p), h.block = !0, i.parentType = x, i.lineMax = L, i.line = g + (T ? 1 : 0), !0;
711
714
  },
712
715
  {
713
716
  alt: ["paragraph", "reference", "blockquote", "list"]
@@ -720,96 +723,96 @@ const Y = new rt({
720
723
  o < 0 ? r.push(n) : (r[o] = r[o].slice(), r[o][1] += ` ${n[1]}`);
721
724
  }), r;
722
725
  }, st = (e, t) => {
723
- const r = e.renderer.rules.fence, n = e.utils.unescapeAll, o = /\[(\w*)(?::([\w ]*))?\]/, u = /::(open|close)/, c = (a) => a.info ? n(a.info).trim() : "", m = (a) => {
724
- const d = c(a), [$ = null, h = ""] = (o.exec(d) || []).slice(1);
725
- return [$, h];
726
+ const r = e.renderer.rules.fence, n = e.utils.unescapeAll, o = /\[(\w*)(?::([\w ]*))?\]/, m = /::(open|close)/, d = (a) => a.info ? n(a.info).trim() : "", u = (a) => {
727
+ const c = d(a), [$ = null, p = ""] = (o.exec(c) || []).slice(1);
728
+ return [$, p];
726
729
  }, s = (a) => {
727
- const d = c(a);
728
- return d ? d.split(/(\s+)/g)[0] : "";
730
+ const c = d(a);
731
+ return c ? c.split(/(\s+)/g)[0] : "";
729
732
  }, l = (a) => {
730
- const d = a.info.match(u) || [], $ = d[1] === "open" || d[1] !== "close" && t.codeFoldable && a.content.trim().split(`
731
- `).length < t.autoFoldThreshold, h = d[1] || t.codeFoldable ? "details" : "div", p = d[1] || t.codeFoldable ? "summary" : "div";
732
- return { open: $, tagContainer: h, tagHeader: p };
733
- }, i = (a, d, $, h, p) => {
734
- if (a[d].hidden)
733
+ const c = a.info.match(m) || [], $ = c[1] === "open" || c[1] !== "close" && t.codeFoldable && a.content.trim().split(`
734
+ `).length < t.autoFoldThreshold, p = c[1] || t.codeFoldable ? "details" : "div", g = c[1] || t.codeFoldable ? "summary" : "div";
735
+ return { open: $, tagContainer: p, tagHeader: g };
736
+ }, i = (a, c, $, p, g) => {
737
+ if (a[c].hidden)
735
738
  return "";
736
- const g = t.usedLanguageTextRef.value?.copyCode.text, x = t.customIconRef.value.copy || g, v = !!t.customIconRef.value.copy, C = `<span class="${f}-collapse-tips">${Ue("collapse-tips", t.customIconRef.value)}</span>`, [S] = m(a[d]);
739
+ const h = t.usedLanguageTextRef.value?.copyCode.text, T = t.customIconRef.value.copy || h, y = !!t.customIconRef.value.copy, b = `<span class="${f}-collapse-tips">${Ue("collapse-tips", t.customIconRef.value)}</span>`, [S] = u(a[c]);
737
740
  if (S === null) {
738
- const { open: k, tagContainer: R, tagHeader: J } = l(a[d]), B = [["class", `${f}-code`]];
741
+ const { open: k, tagContainer: R, tagHeader: J } = l(a[c]), B = [["class", `${f}-code`]];
739
742
  k && B.push(["open", ""]);
740
743
  const ne = {
741
- attrs: se(a[d], B)
744
+ attrs: se(a[c], B)
742
745
  };
743
- a[d].info = a[d].info.replace(u, "");
744
- const W = r(a, d, $, h, p);
746
+ a[c].info = a[c].info.replace(m, "");
747
+ const W = r(a, c, $, p, g);
745
748
  return `
746
- <${R} ${p.renderAttrs(ne)}>
749
+ <${R} ${g.renderAttrs(ne)}>
747
750
  <${J} class="${f}-code-head">
748
751
  <div class="${f}-code-flag"><span></span><span></span><span></span></div>
749
752
  <div class="${f}-code-action">
750
- <span class="${f}-code-lang">${e.utils.escapeHtml(a[d].info.trim())}</span>
751
- <span class="${f}-copy-button" data-tips="${g}"${v ? " data-is-icon=true" : ""}>${x}</span>
752
- ${t.extraTools instanceof Function ? t.extraTools({ lang: a[d].info.trim() }) : t.extraTools || ""}
753
- ${R === "details" ? C : ""}
753
+ <span class="${f}-code-lang">${e.utils.escapeHtml(a[c].info.trim())}</span>
754
+ <span class="${f}-copy-button" data-tips="${h}"${y ? " data-is-icon=true" : ""}>${T}</span>
755
+ ${t.extraTools instanceof Function ? t.extraTools({ lang: a[c].info.trim() }) : t.extraTools || ""}
756
+ ${R === "details" ? b : ""}
754
757
  </div>
755
758
  </${J}>
756
759
  ${W}
757
760
  </${R}>
758
761
  `;
759
762
  }
760
- let b, F, I, L, _ = "", N = "", D = "";
761
- const { open: q, tagContainer: V, tagHeader: z } = l(a[d]), K = [["class", `${f}-code`]];
763
+ let w, F, x, L, _ = "", N = "", D = "";
764
+ const { open: q, tagContainer: V, tagHeader: z } = l(a[c]), K = [["class", `${f}-code`]];
762
765
  q && K.push(["open", ""]);
763
766
  const Z = {
764
- attrs: se(a[d], K)
767
+ attrs: se(a[c], K)
765
768
  };
766
- for (let k = d; k < a.length && (b = a[k], [F, I] = m(b), F === S); k++) {
767
- b.info = b.info.replace(o, "").replace(u, ""), b.hidden = !0;
768
- const R = `${f}-codetab-${t.editorId}-${d}-${k - d}`;
769
- L = k - d > 0 ? "" : "checked", _ += `
769
+ for (let k = c; k < a.length && (w = a[k], [F, x] = u(w), F === S); k++) {
770
+ w.info = w.info.replace(o, "").replace(m, ""), w.hidden = !0;
771
+ const R = `${f}-codetab-${t.editorId}-${c}-${k - c}`;
772
+ L = k - c > 0 ? "" : "checked", _ += `
770
773
  <li>
771
774
  <input
772
775
  type="radio"
773
- id="label-${f}-codetab-label-1-${t.editorId}-${d}-${k - d}"
774
- name="${f}-codetab-label-${t.editorId}-${d}"
776
+ id="label-${f}-codetab-label-1-${t.editorId}-${c}-${k - c}"
777
+ name="${f}-codetab-label-${t.editorId}-${c}"
775
778
  class="${R}"
776
779
  ${L}
777
780
  >
778
781
  <label
779
- for="label-${f}-codetab-label-1-${t.editorId}-${d}-${k - d}"
782
+ for="label-${f}-codetab-label-1-${t.editorId}-${c}-${k - c}"
780
783
  onclick="this.getRootNode().querySelectorAll('.${R}').forEach(e => e.click())"
781
784
  >
782
- ${e.utils.escapeHtml(I || s(b))}
785
+ ${e.utils.escapeHtml(x || s(w))}
783
786
  </label>
784
787
  </li>`, N += `
785
788
  <div role="tabpanel">
786
789
  <input
787
790
  type="radio"
788
- name="${f}-codetab-pre-${t.editorId}-${d}"
791
+ name="${f}-codetab-pre-${t.editorId}-${c}"
789
792
  class="${R}"
790
793
  ${L}
791
794
  role="presentation">
792
- ${r(a, k, $, h, p)}
795
+ ${r(a, k, $, p, g)}
793
796
  </div>`, D += `
794
797
  <input
795
798
  type="radio"
796
- name="${f}-codetab-lang-${t.editorId}-${d}"
799
+ name="${f}-codetab-lang-${t.editorId}-${c}"
797
800
  class="${R}"
798
801
  ${L}
799
802
  role="presentation">
800
- <span class=${f}-code-lang role="note">${e.utils.escapeHtml(s(b))}</span>`;
803
+ <span class=${f}-code-lang role="note">${e.utils.escapeHtml(s(w))}</span>`;
801
804
  }
802
805
  return `
803
- <${V} ${p.renderAttrs(Z)}>
806
+ <${V} ${g.renderAttrs(Z)}>
804
807
  <${z} class="${f}-code-head">
805
808
  <div class="${f}-code-flag">
806
809
  <ul class="${f}-codetab-label" role="tablist">${_}</ul>
807
810
  </div>
808
811
  <div class="${f}-code-action">
809
812
  <span class="${f}-codetab-lang">${D}</span>
810
- <span class="${f}-copy-button" data-tips="${g}"${v ? " data-is-icon=true" : ""}>${x}</span>
811
- ${t.extraTools instanceof Function ? t.extraTools({ lang: a[d].info.trim() }) : t.extraTools || ""}
812
- ${V === "details" ? C : ""}
813
+ <span class="${f}-copy-button" data-tips="${h}"${y ? " data-is-icon=true" : ""}>${T}</span>
814
+ ${t.extraTools instanceof Function ? t.extraTools({ lang: a[c].info.trim() }) : t.extraTools || ""}
815
+ ${V === "details" ? b : ""}
813
816
  </div>
814
817
  </${z}>
815
818
  ${N}
@@ -819,37 +822,37 @@ const Y = new rt({
819
822
  e.renderer.rules.fence = i, e.renderer.rules.code_block = i;
820
823
  }, ct = (e, t) => {
821
824
  const r = e.renderer.rules.fence.bind(e.renderer.rules);
822
- e.renderer.rules.fence = (n, o, u, c, m) => {
825
+ e.renderer.rules.fence = (n, o, m, d, u) => {
823
826
  const s = n[o], l = s.content.trim();
824
827
  if (s.info === "echarts") {
825
828
  if (s.attrSet("class", `${f}-echarts`), s.attrSet("data-echarts-theme", t.themeRef.value), s.map && s.level === 0) {
826
- const i = s.map[1] - 1, d = !!c.srcLines[i]?.trim()?.startsWith("```");
827
- s.attrSet("data-closed", `${d}`), s.attrSet("data-line", String(s.map[0]));
829
+ const i = s.map[1] - 1, c = !!d.srcLines[i]?.trim()?.startsWith("```");
830
+ s.attrSet("data-closed", `${c}`), s.attrSet("data-line", String(s.map[0]));
828
831
  }
829
- return `<div ${m.renderAttrs(s)} style="width: 100%; aspect-ratio: 4 / 3;">${e.utils.escapeHtml(l)}</div>`;
832
+ return `<div ${u.renderAttrs(s)} style="width: 100%; aspect-ratio: 4 / 3;">${e.utils.escapeHtml(l)}</div>`;
830
833
  }
831
- return r(n, o, u, c, m);
834
+ return r(n, o, m, d, u);
832
835
  };
833
836
  }, dt = (e, t) => {
834
837
  e.renderer.rules.heading_open = (r, n) => {
835
- const o = r[n], u = r[n + 1].children?.reduce((m, s) => m + (["text", "code_inline", "math_inline"].includes(s.type) && s.content || ""), "") || "", c = o.markup.length;
838
+ const o = r[n], m = r[n + 1].children?.reduce((u, s) => u + (["text", "code_inline", "math_inline"].includes(s.type) && s.content || ""), "") || "", d = o.markup.length;
836
839
  return t.headsRef.value.push({
837
- text: u,
838
- level: c,
840
+ text: m,
841
+ level: d,
839
842
  line: o.map[0],
840
843
  currentToken: o,
841
844
  nextToken: r[n + 1]
842
845
  }), o.map && o.level === 0 && o.attrSet(
843
846
  "id",
844
847
  t.mdHeadingId({
845
- text: u,
846
- level: c,
848
+ text: m,
849
+ level: d,
847
850
  index: t.headsRef.value.length,
848
851
  currentToken: o,
849
852
  nextToken: r[n + 1]
850
853
  })
851
854
  ), e.renderer.renderToken(r, n, t);
852
- }, e.renderer.rules.heading_close = (r, n, o, u, c) => c.renderToken(r, n, o);
855
+ }, e.renderer.rules.heading_close = (r, n, o, m, d) => d.renderToken(r, n, o);
853
856
  }, be = {
854
857
  block: [
855
858
  { open: "$$", close: "$$" },
@@ -866,81 +869,81 @@ const Y = new rt({
866
869
  for (const o of n) {
867
870
  if (!t.src.startsWith(o.open, t.pos))
868
871
  continue;
869
- const u = t.pos + o.open.length;
870
- let c = u;
871
- for (; (c = t.src.indexOf(o.close, c)) !== -1; ) {
872
- let m = 0, s = c - 1;
872
+ const m = t.pos + o.open.length;
873
+ let d = m;
874
+ for (; (d = t.src.indexOf(o.close, d)) !== -1; ) {
875
+ let u = 0, s = d - 1;
873
876
  for (; s >= 0 && t.src[s] === "\\"; )
874
- m++, s--;
875
- if (m % 2 === 0)
877
+ u++, s--;
878
+ if (u % 2 === 0)
876
879
  break;
877
- c += o.close.length;
880
+ d += o.close.length;
878
881
  }
879
- if (c !== -1) {
880
- if (c - u === 0)
881
- return r || (t.pending += o.open + o.close), t.pos = c + o.close.length, !0;
882
+ if (d !== -1) {
883
+ if (d - m === 0)
884
+ return r || (t.pending += o.open + o.close), t.pos = d + o.close.length, !0;
882
885
  if (!r) {
883
- const m = t.push("math_inline", "math", 0);
884
- m.markup = o.open, m.content = t.src.slice(u, c);
886
+ const u = t.push("math_inline", "math", 0);
887
+ u.markup = o.open, u.content = t.src.slice(m, d);
885
888
  }
886
- return t.pos = c + o.close.length, !0;
889
+ return t.pos = d + o.close.length, !0;
887
890
  }
888
891
  }
889
892
  return !1;
890
893
  }, mt = (e) => (t, r, n, o) => {
891
- const u = e.delimiters, c = t.bMarks[r] + t.tShift[r], m = t.eMarks[r], s = (l, i, a) => {
894
+ const m = e.delimiters, d = t.bMarks[r] + t.tShift[r], u = t.eMarks[r], s = (l, i, a) => {
892
895
  t.line = i;
893
- const d = t.push("math_block", "math", 0);
894
- return d.block = !0, d.content = l, d.map = [r, t.line], d.markup = a, !0;
896
+ const c = t.push("math_block", "math", 0);
897
+ return c.block = !0, c.content = l, c.map = [r, t.line], c.markup = a, !0;
895
898
  };
896
- for (const l of u) {
897
- const i = c;
899
+ for (const l of m) {
900
+ const i = d;
898
901
  if (t.src.slice(i, i + l.open.length) !== l.open)
899
902
  continue;
900
- const a = i + l.open.length, d = t.src.slice(a, m).trim(), $ = d === "", h = d === l.close, p = d.endsWith(l.close);
901
- if (!$ && !h && !p)
903
+ const a = i + l.open.length, c = t.src.slice(a, u).trim(), $ = c === "", p = c === l.close, g = c.endsWith(l.close);
904
+ if (!$ && !p && !g)
902
905
  continue;
903
906
  if (o)
904
907
  return !0;
905
- if (h)
908
+ if (p)
906
909
  return s("", r + 1, l.open);
907
- if (!$ && p) {
908
- const b = d.slice(0, -l.close.length);
909
- return s(b, r + 1, l.open);
910
+ if (!$ && g) {
911
+ const w = c.slice(0, -l.close.length);
912
+ return s(w, r + 1, l.open);
910
913
  }
911
- let g = r + 1, x = !1, v = "";
912
- for (; g < n; g++) {
913
- const b = t.bMarks[g] + t.tShift[g], F = t.eMarks[g];
914
- if (b < F && t.tShift[g] < t.blkIndent)
914
+ let h = r + 1, T = !1, y = "";
915
+ for (; h < n; h++) {
916
+ const w = t.bMarks[h] + t.tShift[h], F = t.eMarks[h];
917
+ if (w < F && t.tShift[h] < t.blkIndent)
915
918
  break;
916
- if (t.src.slice(b, F).trim().endsWith(l.close)) {
919
+ if (t.src.slice(w, F).trim().endsWith(l.close)) {
917
920
  const L = t.src.slice(0, F).lastIndexOf(l.close);
918
- v = t.src.slice(b, L), x = !0;
921
+ y = t.src.slice(w, L), T = !0;
919
922
  break;
920
923
  }
921
924
  }
922
- if (!x)
925
+ if (!T)
923
926
  continue;
924
- const S = t.getLines(r + 1, g, t.tShift[r], !0) + (v.trim() ? v : "");
925
- return s(S, g + 1, l.open);
927
+ const S = t.getLines(r + 1, h, t.tShift[r], !0) + (y.trim() ? y : "");
928
+ return s(S, h + 1, l.open);
926
929
  }
927
930
  return !1;
928
931
  }, ft = (e, { katexRef: t, inlineDelimiters: r, blockDelimiters: n }) => {
929
- const o = (m, s, l, i, a = !1) => {
930
- const d = {
931
- attrs: se(m, [["class", s]])
932
- }, $ = i.renderAttrs(d);
932
+ const o = (u, s, l, i, a = !1) => {
933
+ const c = {
934
+ attrs: se(u, [["class", s]])
935
+ }, $ = i.renderAttrs(c);
933
936
  if (!t.value)
934
- return `<${l} ${$}>${m.content}</${l}>`;
935
- const h = t.value.renderToString(
936
- m.content,
937
+ return `<${l} ${$}>${u.content}</${l}>`;
938
+ const p = t.value.renderToString(
939
+ u.content,
937
940
  P.katexConfig({
938
941
  throwOnError: !1,
939
942
  displayMode: a
940
943
  })
941
944
  );
942
- return `<${l} ${$} data-processed>${h}</${l}>`;
943
- }, u = (m, s, l, i, a) => o(m[s], `${f}-katex-inline`, "span", a), c = (m, s, l, i, a) => o(m[s], `${f}-katex-block`, "p", a, !0);
945
+ return `<${l} ${$} data-processed>${p}</${l}>`;
946
+ }, m = (u, s, l, i, a) => o(u[s], `${f}-katex-inline`, "span", a), d = (u, s, l, i, a) => o(u[s], `${f}-katex-block`, "p", a, !0);
944
947
  e.inline.ruler.before(
945
948
  "escape",
946
949
  "math_inline",
@@ -956,20 +959,20 @@ const Y = new rt({
956
959
  {
957
960
  alt: ["paragraph", "reference", "blockquote", "list"]
958
961
  }
959
- ), e.renderer.rules.math_inline = u, e.renderer.rules.math_block = c;
962
+ ), e.renderer.rules.math_inline = m, e.renderer.rules.math_block = d;
960
963
  }, ht = (e, t) => {
961
964
  const r = e.renderer.rules.fence.bind(e.renderer.rules);
962
- e.renderer.rules.fence = (n, o, u, c, m) => {
965
+ e.renderer.rules.fence = (n, o, m, d, u) => {
963
966
  const s = n[o], l = s.content.trim();
964
967
  if (s.info === "mermaid") {
965
968
  if (s.attrSet("class", `${f}-mermaid`), s.attrSet("data-mermaid-theme", t.themeRef.value), s.map && s.level === 0) {
966
- const a = s.map[1] - 1, $ = !!c.srcLines[a]?.trim()?.startsWith("```");
969
+ const a = s.map[1] - 1, $ = !!d.srcLines[a]?.trim()?.startsWith("```");
967
970
  s.attrSet("data-closed", `${$}`), s.attrSet("data-line", String(s.map[0]));
968
971
  }
969
972
  const i = Y.get(l);
970
- return i ? (s.attrSet("data-processed", ""), s.attrSet("data-content", l), `<p ${m.renderAttrs(s)}>${i}</p>`) : `<div ${m.renderAttrs(s)}>${e.utils.escapeHtml(l)}</div>`;
973
+ return i ? (s.attrSet("data-processed", ""), s.attrSet("data-content", l), `<p ${u.renderAttrs(s)}>${i}</p>`) : `<div ${u.renderAttrs(s)}>${e.utils.escapeHtml(l)}</div>`;
971
974
  }
972
- return r(n, o, u, c, m);
975
+ return r(n, o, m, d, u);
973
976
  };
974
977
  }, $e = (e, t, r) => {
975
978
  const n = e.attrIndex(t), o = [t, r];
@@ -1015,15 +1018,15 @@ const Y = new rt({
1015
1018
  r.map && (r.attrs || (r.attrs = []), r.attrs.push(["data-line", r.map[0].toString()]));
1016
1019
  }), !0));
1017
1020
  }, St = (e, t) => {
1018
- const { editorConfig: r, markdownItConfig: n, markdownItPlugins: o, editorExtensions: u } = P, c = w("editorId"), m = w("language"), s = w(
1021
+ const { editorConfig: r, markdownItConfig: n, markdownItPlugins: o, editorExtensions: m } = P, d = C("editorId"), u = C("language"), s = C(
1019
1022
  "usedLanguageText"
1020
- ), l = w("showCodeRowNumber"), i = w("theme"), a = w("customIcon"), d = w("rootRef"), $ = w("setting"), h = G([]), p = ot(e), g = at(e), { reRenderRef: x, replaceMermaid: v } = lt(e), { reRenderEcharts: C, replaceEcharts: S } = nt(e), b = Ke({
1023
+ ), l = C("showCodeRowNumber"), i = C("theme"), a = C("customIcon"), c = C("rootRef"), $ = C("setting"), p = G([]), g = ot(e), h = at(e), { reRenderRef: T, replaceMermaid: y } = lt(e), { reRenderEcharts: b, replaceEcharts: S } = nt(e), w = Ke({
1021
1024
  html: !0,
1022
1025
  breaks: !0,
1023
1026
  linkify: !0
1024
1027
  });
1025
- n(b, {
1026
- editorId: c
1028
+ n(w, {
1029
+ editorId: d
1027
1030
  });
1028
1031
  const F = [
1029
1032
  {
@@ -1044,13 +1047,13 @@ const Y = new rt({
1044
1047
  {
1045
1048
  type: "heading",
1046
1049
  plugin: dt,
1047
- options: { mdHeadingId: e.mdHeadingId, headsRef: h }
1050
+ options: { mdHeadingId: e.mdHeadingId, headsRef: p }
1048
1051
  },
1049
1052
  {
1050
1053
  type: "code",
1051
1054
  plugin: st,
1052
1055
  options: {
1053
- editorId: c,
1056
+ editorId: d,
1054
1057
  usedLanguageTextRef: s,
1055
1058
  // showCodeRowNumber,
1056
1059
  codeFoldable: e.codeFoldable,
@@ -1072,7 +1075,7 @@ const Y = new rt({
1072
1075
  e.noKatex || F.push({
1073
1076
  type: "katex",
1074
1077
  plugin: ft,
1075
- options: { katexRef: g }
1078
+ options: { katexRef: h }
1076
1079
  }), e.noMermaid || F.push({
1077
1080
  type: "mermaid",
1078
1081
  plugin: ht,
@@ -1082,33 +1085,33 @@ const Y = new rt({
1082
1085
  plugin: ct,
1083
1086
  options: { themeRef: i }
1084
1087
  }), o(F, {
1085
- editorId: c
1088
+ editorId: d
1086
1089
  }).forEach((k) => {
1087
- b.use(k.plugin, k.options);
1090
+ w.use(k.plugin, k.options);
1088
1091
  });
1089
- const I = b.options.highlight;
1090
- b.set({
1092
+ const x = w.options.highlight;
1093
+ w.set({
1091
1094
  highlight: (k, R, J) => {
1092
- if (I) {
1093
- const W = I(k, R, J);
1095
+ if (x) {
1096
+ const W = x(k, R, J);
1094
1097
  if (W)
1095
1098
  return W;
1096
1099
  }
1097
1100
  let B;
1098
- !e.noHighlight && p.value ? p.value.getLanguage(R) ? B = p.value.highlight(k, {
1101
+ !e.noHighlight && g.value ? g.value.getLanguage(R) ? B = g.value.highlight(k, {
1099
1102
  language: R,
1100
1103
  ignoreIllegals: !0
1101
- }).value : B = p.value.highlightAuto(k).value : B = b.utils.escapeHtml(k);
1104
+ }).value : B = g.value.highlightAuto(k).value : B = w.utils.escapeHtml(k);
1102
1105
  const ne = l ? Ye(
1103
1106
  B.replace(/^\n+|\n+$/g, ""),
1104
1107
  k.replace(/^\n+|\n+$/g, "")
1105
1108
  ) : `<span class="${f}-code-block">${B.replace(/^\n+|\n+$/g, "")}</span>`;
1106
1109
  return `<pre><code class="language-${R}" language=${R}>${ne}</code></pre>`;
1107
1110
  }
1108
- }), It(b);
1111
+ }), It(w);
1109
1112
  const L = G(`_article-key_${le()}`), _ = G(
1110
1113
  e.sanitize(
1111
- b.render(e.modelValue, {
1114
+ w.render(e.modelValue, {
1112
1115
  srcLines: e.modelValue.split(`
1113
1116
  `)
1114
1117
  })
@@ -1118,28 +1121,28 @@ const Y = new rt({
1118
1121
  }, D = () => {
1119
1122
  };
1120
1123
  const q = () => {
1121
- const k = d.value?.querySelectorAll(
1122
- `#${c} p.${f}-mermaid:not([data-closed=false])`
1124
+ const k = c.value?.querySelectorAll(
1125
+ `#${d} p.${f}-mermaid:not([data-closed=false])`
1123
1126
  );
1124
1127
  D(), D = ze(k, {
1125
1128
  customIcon: a.value
1126
- }), u.mermaid?.enableZoom && (N(), N = We(k, {
1129
+ }), m.mermaid?.enableZoom && (N(), N = We(k, {
1127
1130
  customIcon: a.value
1128
1131
  }));
1129
1132
  }, V = () => {
1130
- y.emit(c, X, _.value), e.onHtmlChanged(_.value), e.onGetCatalog(h.value), y.emit(c, oe, h.value), U(() => {
1131
- v().then(q), S();
1133
+ v.emit(d, X, _.value), e.onHtmlChanged(_.value), e.onGetCatalog(p.value), v.emit(d, oe, p.value), U(() => {
1134
+ y().then(q), S();
1132
1135
  });
1133
1136
  }, z = () => {
1134
- h.value = [], _.value = e.sanitize(
1135
- b.render(e.modelValue, {
1137
+ p.value = [], _.value = e.sanitize(
1138
+ w.render(e.modelValue, {
1136
1139
  srcLines: e.modelValue.split(`
1137
1140
  `)
1138
1141
  })
1139
1142
  );
1140
- }, K = A(() => (e.noKatex || !!g.value) && (e.noHighlight || !!p.value));
1143
+ }, K = A(() => (e.noKatex || !!h.value) && (e.noHighlight || !!g.value));
1141
1144
  let Z = -1;
1142
- return E([Ae(e, "modelValue"), K, x, m], () => {
1145
+ return E([Ae(e, "modelValue"), K, T, u], () => {
1143
1146
  Z = window.setTimeout(
1144
1147
  () => {
1145
1148
  z();
@@ -1150,18 +1153,18 @@ const Y = new rt({
1150
1153
  () => $.value.preview,
1151
1154
  () => {
1152
1155
  $.value.preview && U(() => {
1153
- v().then(q), S(), y.emit(c, oe, h.value);
1156
+ y().then(q), S(), v.emit(d, oe, p.value);
1154
1157
  });
1155
1158
  }
1156
- ), E([_, C], () => {
1159
+ ), E([_, b], () => {
1157
1160
  V();
1158
1161
  }), H(V), H(() => {
1159
- y.on(c, {
1162
+ v.on(d, {
1160
1163
  name: De,
1161
1164
  callback() {
1162
- y.emit(c, oe, h.value);
1165
+ v.emit(d, oe, p.value);
1163
1166
  }
1164
- }), y.on(c, {
1167
+ }), v.on(d, {
1165
1168
  name: de,
1166
1169
  callback: () => {
1167
1170
  L.value = `_article-key_${le()}`, z();
@@ -1171,18 +1174,18 @@ const Y = new rt({
1171
1174
  N(), D(), clearTimeout(Z);
1172
1175
  }), { html: _, key: L };
1173
1176
  }, Ft = (e, t) => {
1174
- const r = w("editorId"), n = w("setting"), { noImgZoomIn: o } = e, u = Le(() => {
1175
- const c = document.querySelectorAll(
1177
+ const r = C("editorId"), n = C("setting"), { noImgZoomIn: o } = e, m = Le(() => {
1178
+ const d = document.querySelectorAll(
1176
1179
  `#${r}-preview img:not(.not-zoom):not(.medium-zoom-image)`
1177
1180
  );
1178
- c.length !== 0 && Qe(c, {
1181
+ d.length !== 0 && Qe(d, {
1179
1182
  background: "#00000073"
1180
1183
  });
1181
1184
  });
1182
1185
  H(async () => {
1183
- !o && n.value.preview && await u();
1186
+ !o && n.value.preview && await m();
1184
1187
  }), E([t, () => n.value.preview], async () => {
1185
- !o && n.value.preview && await u();
1188
+ !o && n.value.preview && await m();
1186
1189
  });
1187
1190
  }, we = {
1188
1191
  checked: {
@@ -1194,30 +1197,30 @@ const Y = new rt({
1194
1197
  value: "- [x]"
1195
1198
  }
1196
1199
  }, At = (e, t) => {
1197
- const r = w("editorId"), n = w("rootRef");
1200
+ const r = C("editorId"), n = C("rootRef");
1198
1201
  let o = () => {
1199
1202
  };
1200
- const u = () => {
1203
+ const m = () => {
1201
1204
  if (!n.value)
1202
1205
  return !1;
1203
- const c = n.value.querySelectorAll(".task-list-item.enabled"), m = (s) => {
1206
+ const d = n.value.querySelectorAll(".task-list-item.enabled"), u = (s) => {
1204
1207
  s.preventDefault();
1205
1208
  const l = s.target.checked ? "unChecked" : "checked", i = s.target.parentElement?.dataset.line;
1206
1209
  if (!i)
1207
1210
  return;
1208
- const a = Number(i), d = e.modelValue.split(`
1209
- `), $ = d[Number(a)].replace(
1211
+ const a = Number(i), c = e.modelValue.split(`
1212
+ `), $ = c[Number(a)].replace(
1210
1213
  we[l].regexp,
1211
1214
  we[l].value
1212
1215
  );
1213
- e.previewOnly ? (d[Number(a)] = $, e.onChange(d.join(`
1214
- `))) : y.emit(r, Ve, a + 1, $);
1216
+ e.previewOnly ? (c[Number(a)] = $, e.onChange(c.join(`
1217
+ `))) : v.emit(r, Ve, a + 1, $);
1215
1218
  };
1216
- c.forEach((s) => {
1217
- s.addEventListener("click", m);
1219
+ d.forEach((s) => {
1220
+ s.addEventListener("click", u);
1218
1221
  }), o = () => {
1219
- c.forEach((s) => {
1220
- s.removeEventListener("click", m);
1222
+ d.forEach((s) => {
1223
+ s.removeEventListener("click", u);
1221
1224
  });
1222
1225
  };
1223
1226
  };
@@ -1226,21 +1229,21 @@ const Y = new rt({
1226
1229
  }), E(
1227
1230
  [t],
1228
1231
  () => {
1229
- o(), U(u);
1232
+ o(), U(m);
1230
1233
  },
1231
1234
  {
1232
1235
  immediate: !0
1233
1236
  }
1234
1237
  );
1235
1238
  }, Rt = (e, t, r) => {
1236
- const n = w("setting"), o = () => {
1239
+ const n = C("setting"), o = () => {
1237
1240
  U(() => {
1238
1241
  e.onRemount?.();
1239
1242
  });
1240
- }, u = (c) => {
1241
- c && o();
1243
+ }, m = (d) => {
1244
+ d && o();
1242
1245
  };
1243
- E([t, r], o), E(() => n.value.preview, u), E(() => n.value.htmlPreview, u), H(o);
1246
+ E([t, r], o), E(() => n.value.preview, m), E(() => n.value.htmlPreview, m), H(o);
1244
1247
  }, xe = {
1245
1248
  modelValue: {
1246
1249
  type: String,
@@ -1401,31 +1404,31 @@ const Y = new rt({
1401
1404
  }
1402
1405
  },
1403
1406
  setup(e) {
1404
- const t = G(), r = e.html, n = (o, u) => {
1407
+ const t = G(), r = e.html, n = (o, m) => {
1405
1408
  if (!t.value) return;
1406
- const c = t.value, m = Array.from(c.childNodes), s = Math.min(o.length, u.length);
1409
+ const d = t.value, u = Array.from(d.childNodes), s = Math.min(o.length, m.length);
1407
1410
  let l = -1;
1408
1411
  for (let a = 0; a < s; a++)
1409
- if (!Ht(o[a], u[a])) {
1412
+ if (!Ht(o[a], m[a])) {
1410
1413
  l = a;
1411
1414
  break;
1412
1415
  }
1413
1416
  if (l === -1)
1414
- if (u.length > o.length)
1417
+ if (m.length > o.length)
1415
1418
  l = o.length;
1416
- else if (o.length > u.length)
1417
- l = u.length;
1419
+ else if (o.length > m.length)
1420
+ l = m.length;
1418
1421
  else
1419
1422
  return;
1420
- const i = Math.min(l, m.length);
1421
- for (let a = m.length - 1; a >= i; a--)
1422
- m[a].remove();
1423
+ const i = Math.min(l, u.length);
1424
+ for (let a = u.length - 1; a >= i; a--)
1425
+ u[a].remove();
1423
1426
  for (let a = l; a < o.length; a++)
1424
- c.appendChild(o[a].cloneNode(!0));
1427
+ d.appendChild(o[a].cloneNode(!0));
1425
1428
  };
1426
- return E(() => e.html, (o, u) => {
1427
- const c = Ce(o), m = Ce(u || "");
1428
- n(c, m);
1429
+ return E(() => e.html, (o, m) => {
1430
+ const d = Ce(o), u = Ce(m || "");
1431
+ n(d, u);
1429
1432
  }), () => j("div", {
1430
1433
  id: e.id,
1431
1434
  class: e.class,
@@ -1437,23 +1440,23 @@ const Y = new rt({
1437
1440
  name: "ContentPreview",
1438
1441
  props: xe,
1439
1442
  setup(e) {
1440
- const t = w("editorId"), r = w("setting"), n = w("previewTheme"), o = w("showCodeRowNumber"), {
1441
- html: u,
1442
- key: c
1443
+ const t = C("editorId"), r = C("setting"), n = C("previewTheme"), o = C("showCodeRowNumber"), {
1444
+ html: m,
1445
+ key: d
1443
1446
  } = St(e, e.previewOnly);
1444
- tt(e, u, c), Ft(e, u), At(e, u), Rt(e, u, c);
1445
- const m = A(() => [`${f}-preview`, `${n?.value}-theme`, o && `${f}-scrn`].filter(Boolean)), s = () => {
1447
+ tt(e, m, d), Ft(e, m), At(e, m), Rt(e, m, d);
1448
+ const u = A(() => [`${f}-preview`, `${n?.value}-theme`, o && `${f}-scrn`].filter(Boolean)), s = () => {
1446
1449
  const l = `${t}-preview`;
1447
1450
  return e.previewComponent ? He(e.previewComponent, {
1448
- key: c.value,
1449
- html: u.value,
1451
+ key: d.value,
1452
+ html: m.value,
1450
1453
  id: l,
1451
- class: m.value
1454
+ class: u.value
1452
1455
  }) : j(Mt, {
1453
- key: c.value,
1454
- html: u.value,
1456
+ key: d.value,
1457
+ html: m.value,
1455
1458
  id: l,
1456
- class: m.value
1459
+ class: u.value
1457
1460
  }, null);
1458
1461
  };
1459
1462
  return () => j(Re, null, [r.value.preview && (e.previewOnly ? s() : j("div", {
@@ -1466,7 +1469,7 @@ const Y = new rt({
1466
1469
  key: "html-preview-wrapper"
1467
1470
  }, [j("div", {
1468
1471
  class: `${f}-html`
1469
- }, [u.value])])]);
1472
+ }, [m.value])])]);
1470
1473
  }
1471
1474
  }), Lt = ({ text: e }) => e, Ie = {
1472
1475
  /**
@@ -2031,7 +2034,7 @@ const Y = new rt({
2031
2034
  ], Ot = (e, t, r) => {
2032
2035
  const { editorId: n } = r, o = {
2033
2036
  rerender() {
2034
- y.emit(n, de);
2037
+ v.emit(n, de);
2035
2038
  }
2036
2039
  };
2037
2040
  t.expose(o);
@@ -2044,16 +2047,16 @@ const Y = new rt({
2044
2047
  noKatex: r,
2045
2048
  noMermaid: n,
2046
2049
  noHighlight: o
2047
- } = e, u = G(), c = et(e);
2050
+ } = e, m = G(), d = et(e);
2048
2051
  Te(e, {
2049
- rootRef: u,
2050
- editorId: c
2052
+ rootRef: m,
2053
+ editorId: d
2051
2054
  }), Ot(e, t, {
2052
- editorId: c
2055
+ editorId: d
2053
2056
  }), te(() => {
2054
- y.clear(c);
2057
+ v.clear(d);
2055
2058
  });
2056
- const m = (a) => {
2059
+ const u = (a) => {
2057
2060
  e.onChange?.(a), t.emit("onChange", a), t.emit("update:modelValue", a);
2058
2061
  }, s = (a) => {
2059
2062
  e.onHtmlChanged?.(a), t.emit("onHtmlChanged", a);
@@ -2063,13 +2066,13 @@ const Y = new rt({
2063
2066
  e.onRemount?.(), t.emit("onRemount");
2064
2067
  };
2065
2068
  return () => j("div", {
2066
- id: c,
2069
+ id: d,
2067
2070
  class: [f, e.class, e.theme === "dark" && `${f}-dark`, `${f}-previewOnly`],
2068
2071
  style: e.style,
2069
- ref: u
2072
+ ref: m
2070
2073
  }, [j(Pt, {
2071
2074
  modelValue: e.modelValue,
2072
- onChange: m,
2075
+ onChange: u,
2073
2076
  onHtmlChanged: s,
2074
2077
  onGetCatalog: l,
2075
2078
  mdHeadingId: e.mdHeadingId,