md-editor-v3 4.10.0 → 4.11.0-beta.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,40 +1,40 @@
1
- var Ft = Object.defineProperty;
2
- var Rt = (e, o, l) => o in e ? Ft(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
3
- var _ = (e, o, l) => (Rt(e, typeof o != "symbol" ? o + "" : o, l), l);
4
- import { defineComponent as P, createVNode as t, inject as A, ref as z, onMounted as Y, reactive as G, computed as we, watch as H, nextTick as ve, Fragment as Lt, cloneVNode as gt, toRef as te, shallowRef as Pt, onBeforeUnmount as It } from "vue";
5
- import { p as n, e as Q, n as Wt, b as zt, M as ge, d as Ut } from "./chunks/config.mjs";
6
- import { draggingScroll as _t, linkTo as qt, debounce as Gt, createSmoothScroll as Kt, throttle as jt } from "@vavt/util";
7
- import { a as se, D as Zt } from "./chunks/index2.mjs";
8
- import { b as v, h as Xt, E as le, U as xe, i as Yt, j as Te, R as x, c as Jt, O as Dt, k as Et, l as Ht, T as Qt } from "./chunks/index4.mjs";
1
+ var Rt = Object.defineProperty;
2
+ var Pt = (e, o, l) => o in e ? Rt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
3
+ var U = (e, o, l) => (Pt(e, typeof o != "symbol" ? o + "" : o, l), l);
4
+ import { defineComponent as W, createVNode as t, inject as I, ref as P, onMounted as Q, reactive as G, computed as we, watch as H, nextTick as ve, Fragment as It, cloneVNode as gt, toRef as te, shallowRef as Wt, onBeforeUnmount as Dt } from "vue";
5
+ import { p as n, e as J, n as zt, b as qt, M as fe, d as Ut } from "./chunks/config.mjs";
6
+ import { draggingScroll as _t, linkTo as Gt, debounce as Kt, createSmoothScroll as jt, throttle as Zt } from "@vavt/util";
7
+ import { a as se, D as Xt } from "./chunks/index2.mjs";
8
+ import { b, i as Yt, E as le, U as xe, j as Jt, k as Te, h as x, c as Qt, O as Et, l as Ht, m as Nt } from "./chunks/index4.mjs";
9
9
  import { a as el } from "./chunks/dom.mjs";
10
- import { M as Nt, I as y } from "./chunks/index3.mjs";
11
- import { minimalSetup as tl, EditorView as fe } from "codemirror";
12
- import { EditorView as Se, placeholder as ll, keymap as ol } from "@codemirror/view";
13
- import { languages as al } from "@codemirror/language-data";
14
- import { markdown as nl } from "@codemirror/lang-markdown";
15
- import { EditorSelection as q, EditorState as Ce, Compartment as be, StateEffect as il } from "@codemirror/state";
16
- import { deleteLine as rl, indentWithTab as sl, undo as cl, redo as ul } from "@codemirror/commands";
17
- import { HighlightStyle as Bt, syntaxHighlighting as Ot, indentUnit as dl } from "@codemirror/language";
10
+ import { M as Bt, I as T } from "./chunks/index3.mjs";
11
+ import { EditorView as he } from "codemirror";
12
+ import { EditorView as Se, placeholder as tl, keymap as ll } from "@codemirror/view";
13
+ import { languages as ol } from "@codemirror/language-data";
14
+ import { markdown as al } from "@codemirror/lang-markdown";
15
+ import { EditorSelection as _, EditorState as Ce, Compartment as ce, StateEffect as nl } from "@codemirror/state";
16
+ import { deleteLine as il, defaultKeymap as rl, historyKeymap as sl, indentWithTab as cl, history as ft, undo as ul, redo as dl } from "@codemirror/commands";
17
+ import { HighlightStyle as Ot, syntaxHighlighting as Vt, indentUnit as ml } from "@codemirror/language";
18
18
  import { tags as c } from "@lezer/highlight";
19
- import { autocompletion as ml } from "@codemirror/autocomplete";
20
- import { c as gl, C as fl, e as hl, a as bl, u as vl, b as kl, d as Cl, f as $l, g as pl, h as yl, i as Tl, M as wl } from "./chunks/index.mjs";
21
- import Vt from "./MdCatalog.mjs";
22
- import { g as ft } from "./chunks/vue-tsx.mjs";
23
- import xl from "./NormalToolbar.mjs";
24
- import Sl from "./ModalToolbar.mjs";
19
+ import { autocompletion as gl } from "@codemirror/autocomplete";
20
+ import { c as fl, C as hl, e as bl, a as vl, u as kl, b as Cl, d as $l, f as pl, g as yl, h as Tl, i as wl, M as xl } from "./chunks/index.mjs";
21
+ import Ft from "./MdCatalog.mjs";
22
+ import { g as ht } from "./chunks/vue-tsx.mjs";
23
+ import Sl from "./NormalToolbar.mjs";
24
+ import Ml from "./ModalToolbar.mjs";
25
25
  import "medium-zoom";
26
26
  import "copy-to-clipboard";
27
27
  import "markdown-it";
28
28
  import "markdown-it-image-figures";
29
29
  import "markdown-it-task-lists";
30
30
  import "lru-cache";
31
- const Al = /* @__PURE__ */ P({
31
+ const Al = /* @__PURE__ */ W({
32
32
  setup() {
33
33
  return () => t("div", {
34
34
  class: `${n}-divider`
35
35
  }, null);
36
36
  }
37
- }), Ml = {
37
+ }), Ll = {
38
38
  noPrettier: {
39
39
  type: Boolean
40
40
  },
@@ -83,38 +83,38 @@ const Al = /* @__PURE__ */ P({
83
83
  showToolbarName: {
84
84
  type: Boolean
85
85
  }
86
- }, Ll = (e) => {
87
- var u, s, h, w;
88
- const o = A("editorId");
89
- let l = (s = (u = Q.editorExtensions) == null ? void 0 : u.screenfull) == null ? void 0 : s.instance;
90
- const a = (w = (h = Q.editorExtensions) == null ? void 0 : h.screenfull) == null ? void 0 : w.js, i = z(!1), r = (C) => {
86
+ }, Il = (e) => {
87
+ var d, s, g, p;
88
+ const o = I("editorId");
89
+ let l = (s = (d = J.editorExtensions) == null ? void 0 : d.screenfull) == null ? void 0 : s.instance;
90
+ const a = (p = (g = J.editorExtensions) == null ? void 0 : g.screenfull) == null ? void 0 : p.js, r = P(!1), i = (k) => {
91
91
  if (!l) {
92
- v.emit(o, le, {
92
+ b.emit(o, le, {
93
93
  name: "fullscreen",
94
94
  message: "fullscreen is undefined"
95
95
  });
96
96
  return;
97
97
  }
98
- l.isEnabled ? (i.value = !0, (C === void 0 ? !l.isFullscreen : C) ? l.request() : l.exit()) : console.error("browser does not support screenfull!");
99
- }, m = () => {
98
+ l.isEnabled ? (r.value = !0, (k === void 0 ? !l.isFullscreen : k) ? l.request() : l.exit()) : console.error("browser does not support screenfull!");
99
+ }, h = () => {
100
100
  l && l.isEnabled && l.on("change", () => {
101
- (i.value || e.setting.fullscreen) && (i.value = !1, e.updateSetting("fullscreen"));
101
+ (r.value || e.setting.fullscreen) && (r.value = !1, e.updateSetting("fullscreen"));
102
102
  });
103
- }, g = () => {
104
- l = window.screenfull, m();
103
+ }, f = () => {
104
+ l = window.screenfull, h();
105
105
  };
106
- return Y(() => {
107
- if (m(), !l) {
108
- const C = document.createElement("script");
109
- C.src = a || Wt, C.onload = g, C.id = `${n}-screenfull`, el(C, "screenfull");
106
+ return Q(() => {
107
+ if (h(), !l) {
108
+ const k = document.createElement("script");
109
+ k.src = a || zt, k.onload = f, k.id = `${n}-screenfull`, el(k, "screenfull");
110
110
  }
111
- }), Y(() => {
112
- v.on(o, {
113
- name: Xt,
114
- callback: r
111
+ }), Q(() => {
112
+ b.on(o, {
113
+ name: Yt,
114
+ callback: i
115
115
  });
116
- }), { fullscreenHandler: r };
117
- }, Il = {
116
+ }), { fullscreenHandler: i };
117
+ }, Dl = {
118
118
  tableShape: {
119
119
  type: Array,
120
120
  default: () => [6, 4]
@@ -124,9 +124,9 @@ const Al = /* @__PURE__ */ P({
124
124
  default: () => {
125
125
  }
126
126
  }
127
- }, Dl = /* @__PURE__ */ P({
127
+ }, El = /* @__PURE__ */ W({
128
128
  name: "TableShape",
129
- props: Il,
129
+ props: Dl,
130
130
  setup(e) {
131
131
  const o = G({
132
132
  x: -1,
@@ -140,20 +140,20 @@ const Al = /* @__PURE__ */ P({
140
140
  }, [new Array(e.tableShape[1]).fill("").map((l, a) => t("div", {
141
141
  class: `${n}-table-shape-row`,
142
142
  key: `table-shape-row-${a}`
143
- }, [new Array(e.tableShape[0]).fill("").map((i, r) => t("div", {
143
+ }, [new Array(e.tableShape[0]).fill("").map((r, i) => t("div", {
144
144
  class: `${n}-table-shape-col`,
145
- key: `table-shape-col-${r}`,
145
+ key: `table-shape-col-${i}`,
146
146
  onMouseenter: () => {
147
- o.x = a, o.y = r;
147
+ o.x = a, o.y = i;
148
148
  },
149
149
  onClick: () => {
150
150
  e.onSelected(o);
151
151
  }
152
152
  }, [t("div", {
153
- class: [`${n}-table-shape-col-default`, a <= o.x && r <= o.y && `${n}-table-shape-col-include`]
153
+ class: [`${n}-table-shape-col-default`, a <= o.x && i <= o.y && `${n}-table-shape-col-include`]
154
154
  }, null)]))]))]);
155
155
  }
156
- }), El = Dl, Hl = {
156
+ }), Hl = El, Nl = {
157
157
  type: {
158
158
  type: String,
159
159
  default: "link"
@@ -172,47 +172,47 @@ const Al = /* @__PURE__ */ P({
172
172
  default: () => {
173
173
  }
174
174
  }
175
- }, Nl = /* @__PURE__ */ P({
176
- props: Hl,
175
+ }, Bl = /* @__PURE__ */ W({
176
+ props: Nl,
177
177
  setup(e) {
178
- const o = A("usedLanguageText"), l = A("editorId"), a = we(() => {
179
- var r, m;
178
+ const o = I("usedLanguageText"), l = I("editorId"), a = we(() => {
179
+ var i, h;
180
180
  switch (e.type) {
181
181
  case "link":
182
- return (r = o.value.linkModalTips) == null ? void 0 : r.linkTitle;
182
+ return (i = o.value.linkModalTips) == null ? void 0 : i.linkTitle;
183
183
  case "image":
184
- return (m = o.value.linkModalTips) == null ? void 0 : m.imageTitle;
184
+ return (h = o.value.linkModalTips) == null ? void 0 : h.imageTitle;
185
185
  default:
186
186
  return "";
187
187
  }
188
- }), i = G({
188
+ }), r = G({
189
189
  desc: "",
190
190
  url: ""
191
191
  });
192
- return H(() => e.visible, (r) => {
193
- r || setTimeout(() => {
194
- i.desc = "", i.url = "";
192
+ return H(() => e.visible, (i) => {
193
+ i || setTimeout(() => {
194
+ r.desc = "", r.url = "";
195
195
  }, 200);
196
- }), () => t(Nt, {
196
+ }), () => t(Bt, {
197
197
  title: a.value,
198
198
  visible: e.visible,
199
199
  onClose: e.onCancel
200
200
  }, {
201
201
  default: () => {
202
- var r, m, g, u, s;
202
+ var i, h, f, d, s;
203
203
  return [t("div", {
204
204
  class: `${n}-form-item`
205
205
  }, [t("label", {
206
206
  class: `${n}-label`,
207
207
  for: `link-desc-${l}`
208
- }, [(r = o.value.linkModalTips) == null ? void 0 : r.descLabel]), t("input", {
209
- placeholder: (m = o.value.linkModalTips) == null ? void 0 : m.descLabelPlaceHolder,
208
+ }, [(i = o.value.linkModalTips) == null ? void 0 : i.descLabel]), t("input", {
209
+ placeholder: (h = o.value.linkModalTips) == null ? void 0 : h.descLabelPlaceHolder,
210
210
  class: `${n}-input`,
211
211
  id: `link-desc-${l}`,
212
212
  type: "text",
213
- value: i.desc,
214
- onChange: (h) => {
215
- i.desc = h.target.value;
213
+ value: r.desc,
214
+ onChange: (g) => {
215
+ r.desc = g.target.value;
216
216
  },
217
217
  autocomplete: "off"
218
218
  }, null)]), t("div", {
@@ -220,14 +220,14 @@ const Al = /* @__PURE__ */ P({
220
220
  }, [t("label", {
221
221
  class: `${n}-label`,
222
222
  for: `link-url-${l}`
223
- }, [(g = o.value.linkModalTips) == null ? void 0 : g.urlLabel]), t("input", {
224
- placeholder: (u = o.value.linkModalTips) == null ? void 0 : u.urlLabelPlaceHolder,
223
+ }, [(f = o.value.linkModalTips) == null ? void 0 : f.urlLabel]), t("input", {
224
+ placeholder: (d = o.value.linkModalTips) == null ? void 0 : d.urlLabelPlaceHolder,
225
225
  class: `${n}-input`,
226
226
  id: `link-url-${l}`,
227
227
  type: "text",
228
- value: i.url,
229
- onChange: (h) => {
230
- i.url = h.target.value;
228
+ value: r.url,
229
+ onChange: (g) => {
230
+ r.url = g.target.value;
231
231
  },
232
232
  autocomplete: "off"
233
233
  }, null)]), t("div", {
@@ -236,13 +236,13 @@ const Al = /* @__PURE__ */ P({
236
236
  class: [`${n}-btn`, `${n}-btn-row`],
237
237
  type: "button",
238
238
  onClick: () => {
239
- e.onOk(i), i.desc = "", i.url = "";
239
+ e.onOk(r), r.desc = "", r.url = "";
240
240
  }
241
241
  }, [(s = o.value.linkModalTips) == null ? void 0 : s.buttonOK])])];
242
242
  }
243
243
  });
244
244
  }
245
- }), Bl = {
245
+ }), Ol = {
246
246
  visible: {
247
247
  type: Boolean,
248
248
  default: !1
@@ -257,48 +257,48 @@ const Al = /* @__PURE__ */ P({
257
257
  default: () => {
258
258
  }
259
259
  }
260
- }, Ol = /* @__PURE__ */ P({
261
- props: Bl,
260
+ }, Vl = /* @__PURE__ */ W({
261
+ props: Ol,
262
262
  setup(e) {
263
- var h, w, C;
264
- const o = A("usedLanguageText"), l = A("editorId");
265
- let a = (C = (w = (h = Q) == null ? void 0 : h.editorExtensions) == null ? void 0 : w.cropper) == null ? void 0 : C.instance;
266
- const i = z(), r = z(), m = z(), g = G({
263
+ var g, p, k;
264
+ const o = I("usedLanguageText"), l = I("editorId");
265
+ let a = (k = (p = (g = J) == null ? void 0 : g.editorExtensions) == null ? void 0 : p.cropper) == null ? void 0 : k.instance;
266
+ const r = P(), i = P(), h = P(), f = G({
267
267
  cropperInited: !1,
268
268
  imgSelected: !1,
269
269
  imgSrc: "",
270
270
  // 是否全屏
271
271
  isFullscreen: !1
272
272
  });
273
- let u = null;
273
+ let d = null;
274
274
  H(() => e.visible, () => {
275
- e.visible && !g.cropperInited && (a = a || window.Cropper, i.value.onchange = () => {
275
+ e.visible && !f.cropperInited && (a = a || window.Cropper, r.value.onchange = () => {
276
276
  if (!a) {
277
- v.emit(l, le, {
277
+ b.emit(l, le, {
278
278
  name: "Cropper",
279
279
  message: "Cropper is undefined"
280
280
  });
281
281
  return;
282
282
  }
283
- const d = i.value.files || [];
284
- if (g.imgSelected = !0, (d == null ? void 0 : d.length) > 0) {
285
- const k = new FileReader();
286
- k.onload = (f) => {
287
- g.imgSrc = f.target.result, ve(() => {
288
- u = new a(r.value, {
283
+ const $ = r.value.files || [];
284
+ if (f.imgSelected = !0, ($ == null ? void 0 : $.length) > 0) {
285
+ const m = new FileReader();
286
+ m.onload = (v) => {
287
+ f.imgSrc = v.target.result, ve(() => {
288
+ d = new a(i.value, {
289
289
  viewMode: 2,
290
290
  preview: `.${n}-clip-preview-target`
291
291
  // aspectRatio: 16 / 9,
292
292
  });
293
293
  });
294
- }, k.readAsDataURL(d[0]);
294
+ }, m.readAsDataURL($[0]);
295
295
  }
296
296
  });
297
- }), H(() => [g.imgSelected], () => {
298
- m.value.style = "";
299
- }), H(() => g.isFullscreen, () => {
297
+ }), H(() => [f.imgSelected], () => {
298
+ h.value.style = "";
299
+ }), H(() => f.isFullscreen, () => {
300
300
  ve(() => {
301
- u == null || u.destroy(), m.value.style = "", r.value && (u = new a(r.value, {
301
+ d == null || d.destroy(), h.value.style = "", i.value && (d = new a(i.value, {
302
302
  viewMode: 2,
303
303
  preview: `.${n}-clip-preview-target`
304
304
  // aspectRatio: 16 / 9,
@@ -306,34 +306,34 @@ const Al = /* @__PURE__ */ P({
306
306
  });
307
307
  });
308
308
  const s = () => {
309
- u.clear(), u.destroy(), u = null, i.value.value = "", g.imgSelected = !1;
309
+ d.clear(), d.destroy(), d = null, r.value.value = "", f.imgSelected = !1;
310
310
  };
311
311
  return () => {
312
- var d;
313
- return t(Nt, {
312
+ var $;
313
+ return t(Bt, {
314
314
  class: `${n}-modal-clip`,
315
- title: (d = o.value.clipModalTips) == null ? void 0 : d.title,
315
+ title: ($ = o.value.clipModalTips) == null ? void 0 : $.title,
316
316
  visible: e.visible,
317
317
  onClose: e.onCancel,
318
318
  showAdjust: !0,
319
- isFullscreen: g.isFullscreen,
320
- onAdjust: (k) => {
321
- g.isFullscreen = k;
319
+ isFullscreen: f.isFullscreen,
320
+ onAdjust: (m) => {
321
+ f.isFullscreen = m;
322
322
  },
323
323
  width: "668px",
324
324
  height: "421px"
325
325
  }, {
326
326
  default: () => {
327
- var k, f;
327
+ var m, v;
328
328
  return [t("div", {
329
329
  class: `${n}-form-item ${n}-clip`
330
330
  }, [t("div", {
331
331
  class: `${n}-clip-main`
332
- }, [g.imgSelected ? t("div", {
332
+ }, [f.imgSelected ? t("div", {
333
333
  class: `${n}-clip-cropper`
334
334
  }, [t("img", {
335
- src: g.imgSrc,
336
- ref: r,
335
+ src: f.imgSrc,
336
+ ref: i,
337
337
  style: {
338
338
  display: "none"
339
339
  },
@@ -341,33 +341,33 @@ const Al = /* @__PURE__ */ P({
341
341
  }, null), t("div", {
342
342
  class: `${n}-clip-delete`,
343
343
  onClick: s
344
- }, [t(y, {
344
+ }, [t(T, {
345
345
  name: "delete"
346
346
  }, null)])]) : t("div", {
347
347
  class: `${n}-clip-upload`,
348
348
  onClick: () => {
349
- i.value.click();
349
+ r.value.click();
350
350
  }
351
- }, [t(y, {
351
+ }, [t(T, {
352
352
  name: "upload"
353
353
  }, null)])]), t("div", {
354
354
  class: `${n}-clip-preview`
355
355
  }, [t("div", {
356
356
  class: `${n}-clip-preview-target`,
357
- ref: m
357
+ ref: h
358
358
  }, null)])]), t("div", {
359
359
  class: `${n}-form-item`
360
360
  }, [t("button", {
361
361
  class: `${n}-btn`,
362
362
  type: "button",
363
363
  onClick: () => {
364
- if (u) {
365
- const b = u.getCroppedCanvas();
366
- v.emit(l, xe, [Yt(b.toDataURL("image/png"))], e.onOk), s();
364
+ if (d) {
365
+ const u = d.getCroppedCanvas();
366
+ b.emit(l, xe, [Jt(u.toDataURL("image/png"))], e.onOk), s();
367
367
  }
368
368
  }
369
- }, [((k = o.value.clipModalTips) == null ? void 0 : k.buttonUpload) || ((f = o.value.linkModalTips) == null ? void 0 : f.buttonOK)])]), t("input", {
370
- ref: i,
369
+ }, [((m = o.value.clipModalTips) == null ? void 0 : m.buttonUpload) || ((v = o.value.linkModalTips) == null ? void 0 : v.buttonOK)])]), t("input", {
370
+ ref: r,
371
371
  accept: "image/*",
372
372
  type: "file",
373
373
  multiple: !1,
@@ -379,7 +379,7 @@ const Al = /* @__PURE__ */ P({
379
379
  });
380
380
  };
381
381
  }
382
- }), Vl = {
382
+ }), Fl = {
383
383
  type: {
384
384
  type: String,
385
385
  default: "link"
@@ -402,27 +402,27 @@ const Al = /* @__PURE__ */ P({
402
402
  default: () => {
403
403
  }
404
404
  }
405
- }, Fl = /* @__PURE__ */ P({
406
- props: Vl,
405
+ }, Rl = /* @__PURE__ */ W({
406
+ props: Fl,
407
407
  setup(e) {
408
- return () => t(Lt, null, [t(Nl, {
408
+ return () => t(It, null, [t(Bl, {
409
409
  type: e.type,
410
410
  visible: e.linkVisible,
411
411
  onOk: e.onOk,
412
412
  onCancel: e.onCancel
413
- }, null), t(Ol, {
413
+ }, null), t(Vl, {
414
414
  visible: e.clipVisible,
415
415
  onOk: e.onOk,
416
416
  onCancel: e.onCancel
417
417
  }, null)]);
418
418
  }
419
- }), Rl = /* @__PURE__ */ P({
419
+ }), Pl = /* @__PURE__ */ W({
420
420
  name: "MDEditorToolbar",
421
- props: Ml,
421
+ props: Ll,
422
422
  setup(e) {
423
- const o = A("editorId"), l = A("usedLanguageText"), a = A("theme"), i = A("language"), {
424
- fullscreenHandler: r
425
- } = Ll(e), m = `${o}-toolbar-wrapper`, g = z(), u = G({
423
+ const o = I("editorId"), l = I("usedLanguageText"), a = I("theme"), r = I("language"), {
424
+ fullscreenHandler: i
425
+ } = Il(e), h = `${o}-toolbar-wrapper`, f = P(), d = G({
426
426
  title: !1,
427
427
  catalog: !1,
428
428
  // 图片上传下拉
@@ -432,48 +432,48 @@ const Al = /* @__PURE__ */ P({
432
432
  // mermaid
433
433
  mermaid: !1,
434
434
  katex: !1
435
- }), s = (b, $) => {
436
- v.emit(o, x, b, $);
437
- }, h = G({
435
+ }), s = (u, C) => {
436
+ b.emit(o, x, u, C);
437
+ }, g = G({
438
438
  type: "link",
439
439
  linkVisible: !1,
440
440
  clipVisible: !1
441
- }), w = z();
442
- Y(() => {
443
- v.on(o, {
441
+ }), p = P();
442
+ Q(() => {
443
+ b.on(o, {
444
444
  name: Te,
445
- callback(b) {
446
- h.type = b, h.linkVisible = !0;
445
+ callback(u) {
446
+ g.type = u, g.linkVisible = !0;
447
447
  }
448
448
  });
449
449
  });
450
- const C = we(() => {
451
- const b = e.toolbars.filter((I) => !e.toolbarsExclude.includes(I)), $ = b.indexOf("="), T = $ === -1 ? b : b.slice(0, $ + 1), S = $ === -1 ? [] : b.slice($, Number.MAX_SAFE_INTEGER);
452
- return [T, S];
453
- }), d = z(), k = () => {
454
- v.emit(o, xe, Array.from(d.value.files || [])), d.value.value = "";
450
+ const k = we(() => {
451
+ const u = e.toolbars.filter((M) => !e.toolbarsExclude.includes(M)), C = u.indexOf("="), w = C === -1 ? u : u.slice(0, C + 1), S = C === -1 ? [] : u.slice(C, Number.MAX_SAFE_INTEGER);
452
+ return [w, S];
453
+ }), $ = P(), m = () => {
454
+ b.emit(o, xe, Array.from($.value.files || [])), $.value.value = "";
455
455
  };
456
- Y(() => {
457
- d.value.addEventListener("change", k);
456
+ Q(() => {
457
+ $.value.addEventListener("change", m);
458
458
  });
459
- const f = (b) => {
460
- var $, T, S, I, D, oe, ae, M, L, U, W, O, N, B, V, K, j, de, ne, J, Z, ie, X, F, R, re, me, Ae, Me, Le, Ie, De, Ee, He, Ne, Be, Oe, Ve, Fe, Re, Pe, We, ze, Ue, _e, qe, Ge, Ke, je, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, it, rt, st, ct, ut, dt, mt;
461
- if (zt.includes(b))
462
- switch (b) {
459
+ const v = (u) => {
460
+ var C, w, S, M, D, oe, ae, A, L, q, z, O, N, B, V, K, j, me, ne, Y, Z, ie, X, F, R, re, ge, Me, Ae, Le, Ie, De, Ee, He, Ne, Be, Oe, Ve, Fe, Re, Pe, We, ze, qe, Ue, _e, Ge, Ke, je, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, it, rt, st, ct, ut, dt, mt;
461
+ if (qt.includes(u))
462
+ switch (u) {
463
463
  case "-":
464
464
  return t(Al, null, null);
465
465
  case "bold":
466
466
  return t("div", {
467
467
  class: `${n}-toolbar-item`,
468
- title: ($ = l.value.toolbarTips) == null ? void 0 : $.bold,
468
+ title: (C = l.value.toolbarTips) == null ? void 0 : C.bold,
469
469
  onClick: () => {
470
470
  s("bold");
471
471
  }
472
- }, [t(y, {
472
+ }, [t(T, {
473
473
  name: "bold"
474
474
  }, null), e.showToolbarName && t("div", {
475
475
  class: `${n}-toolbar-item-name`
476
- }, [(T = l.value.toolbarTips) == null ? void 0 : T.bold])]);
476
+ }, [(w = l.value.toolbarTips) == null ? void 0 : w.bold])]);
477
477
  case "underline":
478
478
  return t("div", {
479
479
  class: `${n}-toolbar-item`,
@@ -481,11 +481,11 @@ const Al = /* @__PURE__ */ P({
481
481
  onClick: () => {
482
482
  s("underline");
483
483
  }
484
- }, [t(y, {
484
+ }, [t(T, {
485
485
  name: "underline"
486
486
  }, null), e.showToolbarName && t("div", {
487
487
  class: `${n}-toolbar-item-name`
488
- }, [(I = l.value.toolbarTips) == null ? void 0 : I.underline])]);
488
+ }, [(M = l.value.toolbarTips) == null ? void 0 : M.underline])]);
489
489
  case "italic":
490
490
  return t("div", {
491
491
  class: `${n}-toolbar-item`,
@@ -493,7 +493,7 @@ const Al = /* @__PURE__ */ P({
493
493
  onClick: () => {
494
494
  s("italic");
495
495
  }
496
- }, [t(y, {
496
+ }, [t(T, {
497
497
  name: "italic"
498
498
  }, null), e.showToolbarName && t("div", {
499
499
  class: `${n}-toolbar-item-name`
@@ -505,22 +505,22 @@ const Al = /* @__PURE__ */ P({
505
505
  onClick: () => {
506
506
  s("strikeThrough");
507
507
  }
508
- }, [t(y, {
508
+ }, [t(T, {
509
509
  name: "strike-through"
510
510
  }, null), e.showToolbarName && t("div", {
511
511
  class: `${n}-toolbar-item-name`
512
- }, [(M = l.value.toolbarTips) == null ? void 0 : M.strikeThrough])]);
512
+ }, [(A = l.value.toolbarTips) == null ? void 0 : A.strikeThrough])]);
513
513
  case "title":
514
514
  return t(se, {
515
- relative: `#${m}`,
516
- visible: u.title,
517
- onChange: (p) => {
518
- u.title = p;
515
+ relative: `#${h}`,
516
+ visible: d.title,
517
+ onChange: (y) => {
518
+ d.title = y;
519
519
  },
520
520
  overlay: t("ul", {
521
521
  class: `${n}-menu`,
522
522
  onClick: () => {
523
- u.title = !1;
523
+ d.title = !1;
524
524
  }
525
525
  }, [t("li", {
526
526
  class: `${n}-menu-item ${n}-menu-item-title`,
@@ -532,12 +532,12 @@ const Al = /* @__PURE__ */ P({
532
532
  onClick: () => {
533
533
  s("h2");
534
534
  }
535
- }, [(U = l.value.titleItem) == null ? void 0 : U.h2]), t("li", {
535
+ }, [(q = l.value.titleItem) == null ? void 0 : q.h2]), t("li", {
536
536
  class: `${n}-menu-item ${n}-menu-item-title`,
537
537
  onClick: () => {
538
538
  s("h3");
539
539
  }
540
- }, [(W = l.value.titleItem) == null ? void 0 : W.h3]), t("li", {
540
+ }, [(z = l.value.titleItem) == null ? void 0 : z.h3]), t("li", {
541
541
  class: `${n}-menu-item ${n}-menu-item-title`,
542
542
  onClick: () => {
543
543
  s("h4");
@@ -555,11 +555,11 @@ const Al = /* @__PURE__ */ P({
555
555
  }, [(B = l.value.titleItem) == null ? void 0 : B.h6])])
556
556
  }, {
557
557
  default: () => {
558
- var p, E;
558
+ var y, E;
559
559
  return [t("div", {
560
560
  class: `${n}-toolbar-item`,
561
- title: (p = l.value.toolbarTips) == null ? void 0 : p.title
562
- }, [t(y, {
561
+ title: (y = l.value.toolbarTips) == null ? void 0 : y.title
562
+ }, [t(T, {
563
563
  name: "title"
564
564
  }, null), e.showToolbarName && t("div", {
565
565
  class: `${n}-toolbar-item-name`
@@ -573,7 +573,7 @@ const Al = /* @__PURE__ */ P({
573
573
  onClick: () => {
574
574
  s("sub");
575
575
  }
576
- }, [t(y, {
576
+ }, [t(T, {
577
577
  name: "sub"
578
578
  }, null), e.showToolbarName && t("div", {
579
579
  class: `${n}-toolbar-item-name`
@@ -585,11 +585,11 @@ const Al = /* @__PURE__ */ P({
585
585
  onClick: () => {
586
586
  s("sup");
587
587
  }
588
- }, [t(y, {
588
+ }, [t(T, {
589
589
  name: "sup"
590
590
  }, null), e.showToolbarName && t("div", {
591
591
  class: `${n}-toolbar-item-name`
592
- }, [(de = l.value.toolbarTips) == null ? void 0 : de.sup])]);
592
+ }, [(me = l.value.toolbarTips) == null ? void 0 : me.sup])]);
593
593
  case "quote":
594
594
  return t("div", {
595
595
  class: `${n}-toolbar-item`,
@@ -597,11 +597,11 @@ const Al = /* @__PURE__ */ P({
597
597
  onClick: () => {
598
598
  s("quote");
599
599
  }
600
- }, [t(y, {
600
+ }, [t(T, {
601
601
  name: "quote"
602
602
  }, null), e.showToolbarName && t("div", {
603
603
  class: `${n}-toolbar-item-name`
604
- }, [(J = l.value.toolbarTips) == null ? void 0 : J.quote])]);
604
+ }, [(Y = l.value.toolbarTips) == null ? void 0 : Y.quote])]);
605
605
  case "unorderedList":
606
606
  return t("div", {
607
607
  class: `${n}-toolbar-item`,
@@ -609,7 +609,7 @@ const Al = /* @__PURE__ */ P({
609
609
  onClick: () => {
610
610
  s("unorderedList");
611
611
  }
612
- }, [t(y, {
612
+ }, [t(T, {
613
613
  name: "unordered-list"
614
614
  }, null), e.showToolbarName && t("div", {
615
615
  class: `${n}-toolbar-item-name`
@@ -621,7 +621,7 @@ const Al = /* @__PURE__ */ P({
621
621
  onClick: () => {
622
622
  s("orderedList");
623
623
  }
624
- }, [t(y, {
624
+ }, [t(T, {
625
625
  name: "ordered-list"
626
626
  }, null), e.showToolbarName && t("div", {
627
627
  class: `${n}-toolbar-item-name`
@@ -633,7 +633,7 @@ const Al = /* @__PURE__ */ P({
633
633
  onClick: () => {
634
634
  s("task");
635
635
  }
636
- }, [t(y, {
636
+ }, [t(T, {
637
637
  name: "task"
638
638
  }, null), e.showToolbarName && t("div", {
639
639
  class: `${n}-toolbar-item-name`
@@ -641,23 +641,23 @@ const Al = /* @__PURE__ */ P({
641
641
  case "codeRow":
642
642
  return t("div", {
643
643
  class: `${n}-toolbar-item`,
644
- title: (me = l.value.toolbarTips) == null ? void 0 : me.codeRow,
644
+ title: (ge = l.value.toolbarTips) == null ? void 0 : ge.codeRow,
645
645
  onClick: () => {
646
646
  s("codeRow");
647
647
  }
648
- }, [t(y, {
648
+ }, [t(T, {
649
649
  name: "code-row"
650
650
  }, null), e.showToolbarName && t("div", {
651
651
  class: `${n}-toolbar-item-name`
652
- }, [(Ae = l.value.toolbarTips) == null ? void 0 : Ae.codeRow])]);
652
+ }, [(Me = l.value.toolbarTips) == null ? void 0 : Me.codeRow])]);
653
653
  case "code":
654
654
  return t("div", {
655
655
  class: `${n}-toolbar-item`,
656
- title: (Me = l.value.toolbarTips) == null ? void 0 : Me.code,
656
+ title: (Ae = l.value.toolbarTips) == null ? void 0 : Ae.code,
657
657
  onClick: () => {
658
658
  s("code");
659
659
  }
660
- }, [t(y, {
660
+ }, [t(T, {
661
661
  name: "code"
662
662
  }, null), e.showToolbarName && t("div", {
663
663
  class: `${n}-toolbar-item-name`
@@ -667,9 +667,9 @@ const Al = /* @__PURE__ */ P({
667
667
  class: `${n}-toolbar-item`,
668
668
  title: (Ie = l.value.toolbarTips) == null ? void 0 : Ie.link,
669
669
  onClick: () => {
670
- h.type = "link", h.linkVisible = !0;
670
+ g.type = "link", g.linkVisible = !0;
671
671
  }
672
- }, [t(y, {
672
+ }, [t(T, {
673
673
  name: "link"
674
674
  }, null), e.showToolbarName && t("div", {
675
675
  class: `${n}-toolbar-item-name`
@@ -679,46 +679,46 @@ const Al = /* @__PURE__ */ P({
679
679
  class: `${n}-toolbar-item`,
680
680
  title: (Ee = l.value.toolbarTips) == null ? void 0 : Ee.image,
681
681
  onClick: () => {
682
- h.type = "image", h.linkVisible = !0;
682
+ g.type = "image", g.linkVisible = !0;
683
683
  }
684
- }, [t(y, {
684
+ }, [t(T, {
685
685
  name: "image"
686
686
  }, null), e.showToolbarName && t("div", {
687
687
  class: `${n}-toolbar-item-name`
688
688
  }, [(He = l.value.toolbarTips) == null ? void 0 : He.image])]) : t(se, {
689
- relative: `#${m}`,
690
- visible: u.image,
691
- onChange: (p) => {
692
- u.image = p;
689
+ relative: `#${h}`,
690
+ visible: d.image,
691
+ onChange: (y) => {
692
+ d.image = y;
693
693
  },
694
694
  overlay: t("ul", {
695
695
  class: `${n}-menu`,
696
696
  onClick: () => {
697
- u.title = !1;
697
+ d.title = !1;
698
698
  }
699
699
  }, [t("li", {
700
700
  class: `${n}-menu-item ${n}-menu-item-image`,
701
701
  onClick: () => {
702
- h.type = "image", h.linkVisible = !0;
702
+ g.type = "image", g.linkVisible = !0;
703
703
  }
704
704
  }, [(Ne = l.value.imgTitleItem) == null ? void 0 : Ne.link]), t("li", {
705
705
  class: `${n}-menu-item ${n}-menu-item-image`,
706
706
  onClick: () => {
707
- d.value.click();
707
+ $.value.click();
708
708
  }
709
709
  }, [(Be = l.value.imgTitleItem) == null ? void 0 : Be.upload]), t("li", {
710
710
  class: `${n}-menu-item ${n}-menu-item-image`,
711
711
  onClick: () => {
712
- h.clipVisible = !0;
712
+ g.clipVisible = !0;
713
713
  }
714
714
  }, [(Oe = l.value.imgTitleItem) == null ? void 0 : Oe.clip2upload])])
715
715
  }, {
716
716
  default: () => {
717
- var p, E;
717
+ var y, E;
718
718
  return [t("div", {
719
719
  class: `${n}-toolbar-item`,
720
- title: (p = l.value.toolbarTips) == null ? void 0 : p.image
721
- }, [t(y, {
720
+ title: (y = l.value.toolbarTips) == null ? void 0 : y.image
721
+ }, [t(T, {
722
722
  name: "image"
723
723
  }, null), e.showToolbarName && t("div", {
724
724
  class: `${n}-toolbar-item-name`
@@ -727,27 +727,27 @@ const Al = /* @__PURE__ */ P({
727
727
  });
728
728
  case "table":
729
729
  return t(se, {
730
- relative: `#${m}`,
731
- visible: u.table,
732
- onChange: (p) => {
733
- u.table = p;
730
+ relative: `#${h}`,
731
+ visible: d.table,
732
+ onChange: (y) => {
733
+ d.table = y;
734
734
  },
735
735
  key: "bar-table",
736
- overlay: t(El, {
736
+ overlay: t(Hl, {
737
737
  tableShape: e.tableShape,
738
- onSelected: (p) => {
738
+ onSelected: (y) => {
739
739
  s("table", {
740
- selectedShape: p
740
+ selectedShape: y
741
741
  });
742
742
  }
743
743
  }, null)
744
744
  }, {
745
745
  default: () => {
746
- var p, E;
746
+ var y, E;
747
747
  return [t("div", {
748
748
  class: `${n}-toolbar-item`,
749
- title: (p = l.value.toolbarTips) == null ? void 0 : p.table
750
- }, [t(y, {
749
+ title: (y = l.value.toolbarTips) == null ? void 0 : y.table
750
+ }, [t(T, {
751
751
  name: "table"
752
752
  }, null), e.showToolbarName && t("div", {
753
753
  class: `${n}-toolbar-item-name`
@@ -759,9 +759,9 @@ const Al = /* @__PURE__ */ P({
759
759
  class: `${n}-toolbar-item`,
760
760
  title: (Ve = l.value.toolbarTips) == null ? void 0 : Ve.revoke,
761
761
  onClick: () => {
762
- v.emit(o, Ht);
762
+ b.emit(o, Nt);
763
763
  }
764
- }, [t(y, {
764
+ }, [t(T, {
765
765
  name: "revoke"
766
766
  }, null), e.showToolbarName && t("div", {
767
767
  class: `${n}-toolbar-item-name`
@@ -771,9 +771,9 @@ const Al = /* @__PURE__ */ P({
771
771
  class: `${n}-toolbar-item`,
772
772
  title: (Re = l.value.toolbarTips) == null ? void 0 : Re.next,
773
773
  onClick: () => {
774
- v.emit(o, Et);
774
+ b.emit(o, Ht);
775
775
  }
776
- }, [t(y, {
776
+ }, [t(T, {
777
777
  name: "next"
778
778
  }, null), e.showToolbarName && t("div", {
779
779
  class: `${n}-toolbar-item-name`
@@ -783,9 +783,9 @@ const Al = /* @__PURE__ */ P({
783
783
  class: `${n}-toolbar-item`,
784
784
  title: (We = l.value.toolbarTips) == null ? void 0 : We.save,
785
785
  onClick: () => {
786
- v.emit(o, Dt);
786
+ b.emit(o, Et);
787
787
  }
788
- }, [t(y, {
788
+ }, [t(T, {
789
789
  name: "baocun"
790
790
  }, null), e.showToolbarName && t("div", {
791
791
  class: `${n}-toolbar-item-name`
@@ -793,23 +793,23 @@ const Al = /* @__PURE__ */ P({
793
793
  case "prettier":
794
794
  return e.noPrettier ? "" : t("div", {
795
795
  class: `${n}-toolbar-item`,
796
- title: (Ue = l.value.toolbarTips) == null ? void 0 : Ue.prettier,
796
+ title: (qe = l.value.toolbarTips) == null ? void 0 : qe.prettier,
797
797
  onClick: () => {
798
798
  s("prettier");
799
799
  }
800
- }, [t(y, {
800
+ }, [t(T, {
801
801
  name: "prettier"
802
802
  }, null), e.showToolbarName && t("div", {
803
803
  class: `${n}-toolbar-item-name`
804
- }, [(_e = l.value.toolbarTips) == null ? void 0 : _e.prettier])]);
804
+ }, [(Ue = l.value.toolbarTips) == null ? void 0 : Ue.prettier])]);
805
805
  case "pageFullscreen":
806
806
  return !e.setting.fullscreen && t("div", {
807
807
  class: `${n}-toolbar-item`,
808
- title: (qe = l.value.toolbarTips) == null ? void 0 : qe.pageFullscreen,
808
+ title: (_e = l.value.toolbarTips) == null ? void 0 : _e.pageFullscreen,
809
809
  onClick: () => {
810
810
  e.updateSetting("pageFullscreen");
811
811
  }
812
- }, [t(y, {
812
+ }, [t(T, {
813
813
  name: e.setting.pageFullscreen ? "suoxiao" : "fangda"
814
814
  }, null), e.showToolbarName && t("div", {
815
815
  class: `${n}-toolbar-item-name`
@@ -819,9 +819,9 @@ const Al = /* @__PURE__ */ P({
819
819
  class: `${n}-toolbar-item`,
820
820
  title: (Ke = l.value.toolbarTips) == null ? void 0 : Ke.fullscreen,
821
821
  onClick: () => {
822
- r();
822
+ i();
823
823
  }
824
- }, [t(y, {
824
+ }, [t(T, {
825
825
  name: e.setting.fullscreen ? "fullscreen-exit" : "fullscreen"
826
826
  }, null), e.showToolbarName && t("div", {
827
827
  class: `${n}-toolbar-item-name`
@@ -833,7 +833,7 @@ const Al = /* @__PURE__ */ P({
833
833
  onClick: () => {
834
834
  e.updateSetting("preview");
835
835
  }
836
- }, [t(y, {
836
+ }, [t(T, {
837
837
  name: "preview"
838
838
  }, null), e.showToolbarName && t("div", {
839
839
  class: `${n}-toolbar-item-name`
@@ -845,7 +845,7 @@ const Al = /* @__PURE__ */ P({
845
845
  onClick: () => {
846
846
  e.updateSetting("htmlPreview");
847
847
  }
848
- }, [t(y, {
848
+ }, [t(T, {
849
849
  name: "coding"
850
850
  }, null), e.showToolbarName && t("div", {
851
851
  class: `${n}-toolbar-item-name`
@@ -855,10 +855,10 @@ const Al = /* @__PURE__ */ P({
855
855
  class: `${n}-toolbar-item`,
856
856
  title: (Qe = l.value.toolbarTips) == null ? void 0 : Qe.catalog,
857
857
  onClick: () => {
858
- v.emit(o, Jt);
858
+ b.emit(o, Qt);
859
859
  },
860
860
  key: "bar-catalog"
861
- }, [t(y, {
861
+ }, [t(T, {
862
862
  name: "catalog"
863
863
  }, null), e.showToolbarName && t("div", {
864
864
  class: `${n}-toolbar-item-name`
@@ -867,23 +867,23 @@ const Al = /* @__PURE__ */ P({
867
867
  return t("div", {
868
868
  class: `${n}-toolbar-item`,
869
869
  title: (tt = l.value.toolbarTips) == null ? void 0 : tt.github,
870
- onClick: () => qt("https://github.com/imzbf/md-editor-v3")
871
- }, [t(y, {
870
+ onClick: () => Gt("https://github.com/imzbf/md-editor-v3")
871
+ }, [t(T, {
872
872
  name: "github"
873
873
  }, null), e.showToolbarName && t("div", {
874
874
  class: `${n}-toolbar-item-name`
875
875
  }, [(lt = l.value.toolbarTips) == null ? void 0 : lt.github])]);
876
876
  case "mermaid":
877
877
  return t(se, {
878
- relative: `#${m}`,
879
- visible: u.mermaid,
880
- onChange: (p) => {
881
- u.mermaid = p;
878
+ relative: `#${h}`,
879
+ visible: d.mermaid,
880
+ onChange: (y) => {
881
+ d.mermaid = y;
882
882
  },
883
883
  overlay: t("ul", {
884
884
  class: `${n}-menu`,
885
885
  onClick: () => {
886
- u.mermaid = !1;
886
+ d.mermaid = !1;
887
887
  }
888
888
  }, [t("li", {
889
889
  class: `${n}-menu-item ${n}-menu-item-mermaid`,
@@ -929,11 +929,11 @@ const Al = /* @__PURE__ */ P({
929
929
  key: "bar-mermaid"
930
930
  }, {
931
931
  default: () => {
932
- var p, E;
932
+ var y, E;
933
933
  return [t("div", {
934
934
  class: `${n}-toolbar-item`,
935
- title: (p = l.value.toolbarTips) == null ? void 0 : p.mermaid
936
- }, [t(y, {
935
+ title: (y = l.value.toolbarTips) == null ? void 0 : y.mermaid
936
+ }, [t(T, {
937
937
  name: "mermaid"
938
938
  }, null), e.showToolbarName && t("div", {
939
939
  class: `${n}-toolbar-item-name`
@@ -942,15 +942,15 @@ const Al = /* @__PURE__ */ P({
942
942
  });
943
943
  case "katex":
944
944
  return t(se, {
945
- relative: `#${m}`,
946
- visible: u.katex,
947
- onChange: (p) => {
948
- u.katex = p;
945
+ relative: `#${h}`,
946
+ visible: d.katex,
947
+ onChange: (y) => {
948
+ d.katex = y;
949
949
  },
950
950
  overlay: t("ul", {
951
951
  class: `${n}-menu`,
952
952
  onClick: () => {
953
- u.katex = !1;
953
+ d.katex = !1;
954
954
  }
955
955
  }, [t("li", {
956
956
  class: `${n}-menu-item ${n}-menu-item-katex`,
@@ -966,11 +966,11 @@ const Al = /* @__PURE__ */ P({
966
966
  key: "bar-katex"
967
967
  }, {
968
968
  default: () => {
969
- var p, E;
969
+ var y, E;
970
970
  return [t("div", {
971
971
  class: `${n}-toolbar-item`,
972
- title: (p = l.value.toolbarTips) == null ? void 0 : p.katex
973
- }, [t(y, {
972
+ title: (y = l.value.toolbarTips) == null ? void 0 : y.katex
973
+ }, [t(T, {
974
974
  name: "formula"
975
975
  }, null), e.showToolbarName && t("div", {
976
976
  class: `${n}-toolbar-item-name`
@@ -979,23 +979,23 @@ const Al = /* @__PURE__ */ P({
979
979
  });
980
980
  }
981
981
  else if (e.defToolbars instanceof Array) {
982
- const p = e.defToolbars[b];
983
- return p ? gt(p, {
982
+ const y = e.defToolbars[u];
983
+ return y ? gt(y, {
984
984
  theme: a.value,
985
- language: i.value,
985
+ language: r.value,
986
986
  insert(ke) {
987
- v.emit(o, x, "universal", {
987
+ b.emit(o, x, "universal", {
988
988
  generate: ke
989
989
  });
990
990
  }
991
991
  }) : "";
992
992
  } else if (e.defToolbars && e.defToolbars.children instanceof Array) {
993
- const p = e.defToolbars.children[b];
994
- return p ? gt(p, {
993
+ const y = e.defToolbars.children[u];
994
+ return y ? gt(y, {
995
995
  theme: a.value,
996
- language: i.value,
996
+ language: r.value,
997
997
  insert(ke) {
998
- v.emit(o, x, "universal", {
998
+ b.emit(o, x, "universal", {
999
999
  generate: ke
1000
1000
  });
1001
1001
  }
@@ -1005,53 +1005,53 @@ const Al = /* @__PURE__ */ P({
1005
1005
  };
1006
1006
  return H(() => e.toolbars, () => {
1007
1007
  ve(() => {
1008
- g.value && _t(g.value);
1008
+ f.value && _t(f.value);
1009
1009
  });
1010
1010
  }, {
1011
1011
  immediate: !0
1012
1012
  }), () => {
1013
- const b = C.value[0].map((T) => f(T)), $ = C.value[1].map((T) => f(T));
1014
- return t(Lt, null, [e.toolbars.length > 0 && t("div", {
1013
+ const u = k.value[0].map((w) => v(w)), C = k.value[1].map((w) => v(w));
1014
+ return t(It, null, [e.toolbars.length > 0 && t("div", {
1015
1015
  class: `${n}-toolbar-wrapper`,
1016
- ref: g,
1017
- id: m
1016
+ ref: f,
1017
+ id: h
1018
1018
  }, [t("div", {
1019
1019
  class: [`${n}-toolbar`, e.showToolbarName && `${n}-stn`]
1020
1020
  }, [t("div", {
1021
1021
  class: `${n}-toolbar-left`,
1022
- ref: w
1023
- }, [b]), t("div", {
1022
+ ref: p
1023
+ }, [u]), t("div", {
1024
1024
  class: `${n}-toolbar-right`
1025
- }, [$])])]), t("input", {
1026
- ref: d,
1025
+ }, [C])])]), t("input", {
1026
+ ref: $,
1027
1027
  accept: "image/*",
1028
1028
  type: "file",
1029
1029
  multiple: !0,
1030
1030
  style: {
1031
1031
  display: "none"
1032
1032
  }
1033
- }, null), t(Fl, {
1034
- linkVisible: h.linkVisible,
1035
- clipVisible: h.clipVisible,
1036
- type: h.type,
1033
+ }, null), t(Rl, {
1034
+ linkVisible: g.linkVisible,
1035
+ clipVisible: g.clipVisible,
1036
+ type: g.type,
1037
1037
  onCancel: () => {
1038
- h.linkVisible = !1, h.clipVisible = !1;
1038
+ g.linkVisible = !1, g.clipVisible = !1;
1039
1039
  },
1040
- onOk: (T) => {
1041
- T && s(h.type, {
1042
- desc: T.desc,
1043
- url: T.url
1044
- }), h.linkVisible = !1, h.clipVisible = !1;
1040
+ onOk: (w) => {
1041
+ w && s(g.type, {
1042
+ desc: w.desc,
1043
+ url: w.url
1044
+ }), g.linkVisible = !1, g.clipVisible = !1;
1045
1045
  }
1046
1046
  }, null)]);
1047
1047
  };
1048
1048
  }
1049
- }), Pl = (e, o) => {
1050
- const l = Gt(() => {
1049
+ }), Wl = (e, o) => {
1050
+ const l = Kt(() => {
1051
1051
  e.removeEventListener("scroll", a), e.addEventListener("scroll", a), o.removeEventListener("scroll", a), o.addEventListener("scroll", a);
1052
- }, 50), a = (i) => {
1053
- const r = e.clientHeight, m = o.clientHeight, g = e.scrollHeight, u = o.scrollHeight, s = (g - r) / (u - m);
1054
- i.target === e ? (o.removeEventListener("scroll", a), o.scrollTo({
1052
+ }, 50), a = (r) => {
1053
+ const i = e.clientHeight, h = o.clientHeight, f = e.scrollHeight, d = o.scrollHeight, s = (f - i) / (d - h);
1054
+ r.target === e ? (o.removeEventListener("scroll", a), o.scrollTo({
1055
1055
  top: e.scrollTop / s
1056
1056
  // behavior: 'smooth'
1057
1057
  }), l()) : (e.removeEventListener("scroll", a), e.scrollTo({
@@ -1069,67 +1069,67 @@ const Al = /* @__PURE__ */ P({
1069
1069
  e.removeEventListener("scroll", a), o.removeEventListener("scroll", a);
1070
1070
  }
1071
1071
  ];
1072
- }, Wl = (e, o, l) => {
1073
- const { view: a } = l, i = Kt(), r = (C) => a.lineBlockAt(a.state.doc.line(C).from).top, m = (C) => a.lineBlockAt(a.state.doc.line(C).from).height;
1074
- let g = [];
1075
- const u = () => {
1076
- g = [];
1077
- const C = Array.from(o.querySelectorAll("[data-line]")).map(
1078
- (b) => Number(b.dataset.line) + 1
1079
- ), { lines: d } = a.state.doc;
1080
- let k = 1, f = C.shift() ?? d;
1081
- for (let b = 1; b <= d; b++)
1082
- b === f && (k = b, f = C.shift() || d + 1), g.push({
1083
- start: k,
1084
- end: f - 1
1072
+ }, zl = (e, o, l) => {
1073
+ const { view: a } = l, r = jt(), i = (k) => a.lineBlockAt(a.state.doc.line(k).from).top, h = (k) => a.lineBlockAt(a.state.doc.line(k).from).height;
1074
+ let f = [];
1075
+ const d = () => {
1076
+ f = [];
1077
+ const k = Array.from(o.querySelectorAll("[data-line]")).map(
1078
+ (u) => Number(u.dataset.line) + 1
1079
+ ), { lines: $ } = a.state.doc;
1080
+ let m = 1, v = k.shift() ?? $;
1081
+ for (let u = 1; u <= $; u++)
1082
+ u === v && (m = u, v = k.shift() || $ + 1), f.push({
1083
+ start: m,
1084
+ end: v - 1
1085
1085
  });
1086
1086
  };
1087
- let s = 0, h = 0;
1088
- const w = jt((C) => {
1089
- var $, T, S, I, D, oe, ae;
1090
- if (!(($ = o.firstElementChild) != null && $.firstElementChild))
1087
+ let s = 0, g = 0;
1088
+ const p = Zt((k) => {
1089
+ var C, w, S, M, D, oe, ae;
1090
+ if (!((C = o.firstElementChild) != null && C.firstElementChild))
1091
1091
  return;
1092
- const d = a.lineBlockAtHeight(a.scrollDOM.scrollTop), { number: k } = a.state.doc.lineAt(d.from);
1093
- if (k > g.length || a.state.doc.lines < g[g.length - 1].end)
1092
+ const $ = a.lineBlockAtHeight(a.scrollDOM.scrollTop), { number: m } = a.state.doc.lineAt($.from);
1093
+ if (m > f.length || a.state.doc.lines < f[f.length - 1].end)
1094
1094
  return;
1095
- let f = +getComputedStyle(o).paddingTop.replace("px", "");
1096
- const b = +getComputedStyle(o).paddingBottom.replace("px", "");
1097
- if (C.target === e) {
1098
- if (h !== 0)
1095
+ let v = +getComputedStyle(o).paddingTop.replace("px", "");
1096
+ const u = +getComputedStyle(o).paddingBottom.replace("px", "");
1097
+ if (k.target === e) {
1098
+ if (g !== 0)
1099
1099
  return;
1100
1100
  s++;
1101
- const M = g[k - 1];
1102
- let L = r(M.end) + m(M.end), U = 0;
1103
- const W = r(M.start), O = o.querySelector(`[data-line="${M.start - 1}"]`) || ((T = o.firstElementChild) == null ? void 0 : T.firstElementChild), N = o.querySelector(`[data-line="${M.end}"]`) || ((S = o.lastElementChild) == null ? void 0 : S.lastElementChild);
1101
+ const A = f[m - 1];
1102
+ let L = i(A.end) + h(A.end), q = 0;
1103
+ const z = i(A.start), O = o.querySelector(`[data-line="${A.start - 1}"]`) || ((w = o.firstElementChild) == null ? void 0 : w.firstElementChild), N = o.querySelector(`[data-line="${A.end}"]`) || ((S = o.lastElementChild) == null ? void 0 : S.lastElementChild);
1104
1104
  let B = 0, V = 0;
1105
- W === 0 ? O === N ? (f = 0, L = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight, U = a.scrollDOM.scrollTop / L, B = N.offsetTop + N.offsetHeight - o.clientHeight) : (U = a.scrollDOM.scrollTop / L, B = N.offsetTop) : L > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (U = (a.scrollDOM.scrollTop - W) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - W), V = O.offsetTop, B = o.scrollHeight - o.clientHeight - V + 10) : (U = (a.scrollDOM.scrollTop - W) / (L - W), V = O.offsetTop, B = N.offsetTop - V);
1106
- const K = V - f + B * U;
1107
- i(o, K, () => {
1105
+ z === 0 ? O === N ? (v = 0, L = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight, q = a.scrollDOM.scrollTop / L, B = N.offsetTop + N.offsetHeight - o.clientHeight) : (q = a.scrollDOM.scrollTop / L, B = N.offsetTop) : L > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (q = (a.scrollDOM.scrollTop - z) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - z), V = O.offsetTop, B = o.scrollHeight - o.clientHeight - V + 10) : (q = (a.scrollDOM.scrollTop - z) / (L - z), V = O.offsetTop, B = N.offsetTop - V);
1106
+ const K = V - v + B * q;
1107
+ r(o, K, () => {
1108
1108
  s--;
1109
1109
  });
1110
1110
  } else {
1111
1111
  if (s !== 0)
1112
1112
  return;
1113
- h++;
1114
- const M = Array.from(
1113
+ g++;
1114
+ const A = Array.from(
1115
1115
  o.querySelectorAll("[data-line]")
1116
- ), L = o.scrollTop, U = o.scrollHeight;
1117
- let W = M.length === 0 ? 1 : Math.ceil(
1118
- Number(M[M.length - 1].dataset.line) * (L / U)
1119
- ), O = (I = o.firstElementChild) == null ? void 0 : I.firstElementChild;
1120
- for (let F = W; F >= 0; F--) {
1116
+ ), L = o.scrollTop, q = o.scrollHeight;
1117
+ let z = A.length === 0 ? 1 : Math.ceil(
1118
+ Number(A[A.length - 1].dataset.line) * (L / q)
1119
+ ), O = (M = o.firstElementChild) == null ? void 0 : M.firstElementChild;
1120
+ for (let F = z; F >= 0; F--) {
1121
1121
  const R = o.querySelector(`[data-line="${F}"]`);
1122
1122
  if (R && R.offsetTop <= L) {
1123
- O = R, W = F;
1123
+ O = R, z = F;
1124
1124
  break;
1125
1125
  }
1126
1126
  }
1127
1127
  let N = (D = o.firstElementChild) == null ? void 0 : D.firstElementChild, B = (oe = o.firstElementChild) == null ? void 0 : oe.lastElementChild;
1128
- for (; M.length > 0; ) {
1129
- const F = M.indexOf(O);
1130
- if (F + 1 >= M.length)
1128
+ for (; A.length > 0; ) {
1129
+ const F = A.indexOf(O);
1130
+ if (F + 1 >= A.length)
1131
1131
  break;
1132
- const R = M[F + 1];
1132
+ const R = A[F + 1];
1133
1133
  if (F === -1) {
1134
1134
  B = R;
1135
1135
  break;
@@ -1140,11 +1140,11 @@ const Al = /* @__PURE__ */ P({
1140
1140
  N = O, B = R;
1141
1141
  break;
1142
1142
  }
1143
- O = M[F - 1];
1143
+ O = A[F - 1];
1144
1144
  continue;
1145
1145
  }
1146
- const me = R.offsetTop;
1147
- if (re <= L && me > L) {
1146
+ const ge = R.offsetTop;
1147
+ if (re <= L && ge > L) {
1148
1148
  N = O, B = R;
1149
1149
  break;
1150
1150
  }
@@ -1152,48 +1152,48 @@ const Al = /* @__PURE__ */ P({
1152
1152
  }
1153
1153
  const V = N.offsetTop;
1154
1154
  let K = B.offsetTop, j = 0;
1155
- const { start: de, end: ne } = g[Number(N.dataset.line || 0)], J = r(de);
1156
- let Z = r(ne);
1157
- const ie = m(ne);
1155
+ const { start: me, end: ne } = f[Number(N.dataset.line || 0)], Y = i(me);
1156
+ let Z = i(ne);
1157
+ const ie = h(ne);
1158
1158
  let X = 0;
1159
- N === ((ae = o.firstElementChild) == null ? void 0 : ae.firstElementChild) ? (N === B ? (K = B.offsetHeight - o.offsetHeight + f + b, X = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight) : X = Z + ie - J, j = Math.max(L / K, 0)) : Z > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (j = Math.max(
1159
+ N === ((ae = o.firstElementChild) == null ? void 0 : ae.firstElementChild) ? (N === B ? (K = B.offsetHeight - o.offsetHeight + v + u, X = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight) : X = Z + ie - Y, j = Math.max(L / K, 0)) : Z > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (j = Math.max(
1160
1160
  (L - V) / (o.scrollHeight - V - o.clientHeight),
1161
1161
  0
1162
- ), Z = r(a.state.doc.lines) + m(a.state.doc.lines), X = 8 + Z - J - e.clientHeight) : (j = Math.max(
1162
+ ), Z = i(a.state.doc.lines) + h(a.state.doc.lines), X = 8 + Z - Y - e.clientHeight) : (j = Math.max(
1163
1163
  (L - V) / (K - V),
1164
1164
  0
1165
- ), X = Z + ie - J), i(e, J + X * j, () => {
1166
- h--;
1165
+ ), X = Z + ie - Y), r(e, Y + X * j, () => {
1166
+ g--;
1167
1167
  });
1168
1168
  }
1169
1169
  }, 10);
1170
1170
  return [
1171
1171
  () => {
1172
- u(), e.addEventListener("scroll", w), o.addEventListener("scroll", w), e.dispatchEvent(new Event("scroll"));
1172
+ d(), e.addEventListener("scroll", p), o.addEventListener("scroll", p), e.dispatchEvent(new Event("scroll"));
1173
1173
  },
1174
1174
  () => {
1175
- g = [], e.removeEventListener("scroll", w), o.removeEventListener("scroll", w);
1175
+ f = [], e.removeEventListener("scroll", p), o.removeEventListener("scroll", p);
1176
1176
  }
1177
1177
  ];
1178
- }, zl = (e, o, l) => {
1179
- const a = A("editorId");
1180
- let i = () => {
1181
- }, r = () => {
1178
+ }, ql = (e, o, l) => {
1179
+ const a = I("editorId");
1180
+ let r = () => {
1181
+ }, i = () => {
1182
1182
  };
1183
- const m = () => {
1184
- i();
1185
- const g = document.querySelector(
1183
+ const h = () => {
1184
+ r();
1185
+ const f = document.querySelector(
1186
1186
  `#${a} .cm-scroller`
1187
- ), u = document.querySelector(
1187
+ ), d = document.querySelector(
1188
1188
  `[id="${a}-preview-wrapper"][data-show="true"]`
1189
1189
  ), s = document.querySelector(
1190
1190
  `[id="${a}-html-wrapper"][data-show="true"]`
1191
1191
  );
1192
- (u || s) && ([r, i] = (u ? Wl : Pl)(
1193
- g,
1194
- u || s,
1192
+ (d || s) && ([i, r] = (d ? zl : Wl)(
1193
+ f,
1194
+ d || s,
1195
1195
  l.value
1196
- )), e.scrollAuto && r();
1196
+ )), e.scrollAuto && i();
1197
1197
  };
1198
1198
  H(
1199
1199
  [
@@ -1204,114 +1204,114 @@ const Al = /* @__PURE__ */ P({
1204
1204
  te(e.setting, "pageFullscreen")
1205
1205
  ],
1206
1206
  () => {
1207
- ve(m);
1207
+ ve(h);
1208
1208
  }
1209
1209
  ), H(
1210
1210
  () => e.scrollAuto,
1211
- (g) => {
1212
- g ? r() : i();
1211
+ (f) => {
1212
+ f ? i() : r();
1213
1213
  }
1214
- ), Y(m);
1215
- }, Ul = zl, _l = (e, o, l) => {
1216
- var h, w, C, d, k, f;
1217
- let a = "", i = 0, r = 0, m = !0, g = !1;
1218
- const u = o.getSelectedText(), s = (h = Q.editorConfig) == null ? void 0 : h.mermaidTemplate;
1214
+ ), Q(h);
1215
+ }, Ul = ql, _l = (e, o, l) => {
1216
+ var g, p, k, $, m, v;
1217
+ let a = "", r = 0, i = 0, h = !0, f = !1;
1218
+ const d = o.getSelectedText(), s = (g = J.editorConfig) == null ? void 0 : g.mermaidTemplate;
1219
1219
  if (/^h[1-6]{1}$/.test(e)) {
1220
- const b = e.replace(/^h(\d)/, ($, T) => new Array(Number(T)).fill("#", 0, T).join(""));
1221
- a = `${b} ${u}`, i = b.length + 1;
1220
+ const u = e.replace(/^h(\d)/, (C, w) => new Array(Number(w)).fill("#", 0, w).join(""));
1221
+ a = `${u} ${d}`, r = u.length + 1;
1222
1222
  } else if (e === "prettier") {
1223
- const b = window.prettier || ((C = (w = Q.editorExtensions) == null ? void 0 : w.prettier) == null ? void 0 : C.prettierInstance), $ = [
1224
- ((d = window.prettierPlugins) == null ? void 0 : d.markdown) || ((f = (k = Q.editorExtensions) == null ? void 0 : k.prettier) == null ? void 0 : f.parserMarkdownInstance)
1223
+ const u = window.prettier || ((k = (p = J.editorExtensions) == null ? void 0 : p.prettier) == null ? void 0 : k.prettierInstance), C = [
1224
+ (($ = window.prettierPlugins) == null ? void 0 : $.markdown) || ((v = (m = J.editorExtensions) == null ? void 0 : m.prettier) == null ? void 0 : v.parserMarkdownInstance)
1225
1225
  ];
1226
- !b || $[0] === void 0 ? (v.emit(l.editorId, le, {
1226
+ !u || C[0] === void 0 ? (b.emit(l.editorId, le, {
1227
1227
  name: "prettier",
1228
1228
  message: "prettier is undefined"
1229
- }), a = o.getValue()) : a = b.format(o.getValue(), {
1229
+ }), a = o.getValue()) : a = u.format(o.getValue(), {
1230
1230
  parser: "markdown",
1231
- plugins: $
1232
- }), m = !1, g = !0;
1231
+ plugins: C
1232
+ }), h = !1, f = !0;
1233
1233
  } else
1234
1234
  switch (e) {
1235
1235
  case "bold": {
1236
- a = `**${u}**`, i = 2, r = -2;
1236
+ a = `**${d}**`, r = 2, i = -2;
1237
1237
  break;
1238
1238
  }
1239
1239
  case "underline": {
1240
- a = `<u>${u}</u>`, i = 3, r = -4;
1240
+ a = `<u>${d}</u>`, r = 3, i = -4;
1241
1241
  break;
1242
1242
  }
1243
1243
  case "italic": {
1244
- a = `*${u}*`, i = 1, r = -1;
1244
+ a = `*${d}*`, r = 1, i = -1;
1245
1245
  break;
1246
1246
  }
1247
1247
  case "strikeThrough": {
1248
- a = `~~${u}~~`, i = 2, r = -2;
1248
+ a = `~~${d}~~`, r = 2, i = -2;
1249
1249
  break;
1250
1250
  }
1251
1251
  case "sub": {
1252
- a = `<sub>${u}</sub>`, i = 5, r = -6;
1252
+ a = `<sub>${d}</sub>`, r = 5, i = -6;
1253
1253
  break;
1254
1254
  }
1255
1255
  case "sup": {
1256
- a = `<sup>${u}</sup>`, i = 5, r = -6;
1256
+ a = `<sup>${d}</sup>`, r = 5, i = -6;
1257
1257
  break;
1258
1258
  }
1259
1259
  case "codeRow": {
1260
- a = "`" + u + "`", i = 1, r = -1;
1260
+ a = "`" + d + "`", r = 1, i = -1;
1261
1261
  break;
1262
1262
  }
1263
1263
  case "quote": {
1264
- a = `> ${u}`, i = 2;
1264
+ a = `> ${d}`, r = 2;
1265
1265
  break;
1266
1266
  }
1267
1267
  case "orderedList": {
1268
- a = `1. ${u}`, i = 3;
1268
+ a = `1. ${d}`, r = 3;
1269
1269
  break;
1270
1270
  }
1271
1271
  case "unorderedList": {
1272
- a = `- ${u}`, i = 2;
1272
+ a = `- ${d}`, r = 2;
1273
1273
  break;
1274
1274
  }
1275
1275
  case "task": {
1276
- a = `- [ ] ${u}`, i = 6;
1276
+ a = `- [ ] ${d}`, r = 6;
1277
1277
  break;
1278
1278
  }
1279
1279
  case "code": {
1280
- const b = l.text || u || "", $ = l.mode || "language";
1281
- a = `\`\`\`${$}
1282
- ${b}
1280
+ const u = l.text || d || "", C = l.mode || "language";
1281
+ a = `\`\`\`${C}
1282
+ ${u}
1283
1283
  \`\`\`
1284
- `, i = 3, r = 3 + $.length - a.length;
1284
+ `, r = 3, i = 3 + C.length - a.length;
1285
1285
  break;
1286
1286
  }
1287
1287
  case "table": {
1288
1288
  a = "|";
1289
- const { selectedShape: b = { x: 1, y: 1 } } = l, { x: $, y: T } = b;
1290
- for (let S = 0; S <= T; S++)
1289
+ const { selectedShape: u = { x: 1, y: 1 } } = l, { x: C, y: w } = u;
1290
+ for (let S = 0; S <= w; S++)
1291
1291
  a += " col |";
1292
1292
  a += `
1293
1293
  |`;
1294
- for (let S = 0; S <= T; S++)
1294
+ for (let S = 0; S <= w; S++)
1295
1295
  a += " - |";
1296
- for (let S = 0; S <= $; S++) {
1296
+ for (let S = 0; S <= C; S++) {
1297
1297
  a += `
1298
1298
  |`;
1299
- for (let I = 0; I <= T; I++)
1299
+ for (let M = 0; M <= w; M++)
1300
1300
  a += " content |";
1301
1301
  }
1302
- i = 2, r = 5 - a.length;
1302
+ r = 2, i = 5 - a.length;
1303
1303
  break;
1304
1304
  }
1305
1305
  case "link": {
1306
- const { desc: b, url: $ } = l;
1307
- a = `[${b}](${$})`, m = !1;
1306
+ const { desc: u, url: C } = l;
1307
+ a = `[${u}](${C})`, h = !1;
1308
1308
  break;
1309
1309
  }
1310
1310
  case "image": {
1311
- const { desc: b, url: $, urls: T } = l;
1312
- T instanceof Array ? a = T.reduce((S, I) => S + `![${b}](${I})
1313
- `, "") : a = `![${b}](${$})
1314
- `, m = !1;
1311
+ const { desc: u, url: C, urls: w } = l;
1312
+ w instanceof Array ? a = w.reduce((S, M) => S + `![${u}](${M})
1313
+ `, "") : a = `![${u}](${C})
1314
+ `, h = !1;
1315
1315
  break;
1316
1316
  }
1317
1317
  case "flow": {
@@ -1319,7 +1319,7 @@ ${b}
1319
1319
  ${(s == null ? void 0 : s.flow) || `flowchart TD
1320
1320
  Start --> Stop`}
1321
1321
  \`\`\`
1322
- `, i = 3, r = 10 - a.length;
1322
+ `, r = 3, i = 10 - a.length;
1323
1323
  break;
1324
1324
  }
1325
1325
  case "sequence": {
@@ -1329,7 +1329,7 @@ ${(s == null ? void 0 : s.sequence) || `sequenceDiagram
1329
1329
  B-->>A: hi!
1330
1330
  A-)B: bye!`}
1331
1331
  \`\`\`
1332
- `, i = 3, r = 10 - a.length;
1332
+ `, r = 3, i = 10 - a.length;
1333
1333
  break;
1334
1334
  }
1335
1335
  case "gantt": {
@@ -1341,7 +1341,7 @@ section Section
1341
1341
  A task :a1, 2014-01-01, 30d
1342
1342
  Another task :after a1, 20d`}
1343
1343
  \`\`\`
1344
- `, i = 3, r = 10 - a.length;
1344
+ `, r = 3, i = 10 - a.length;
1345
1345
  break;
1346
1346
  }
1347
1347
  case "class": {
@@ -1350,7 +1350,7 @@ ${(s == null ? void 0 : s.class) || `classDiagram
1350
1350
  class Animal
1351
1351
  Vehicle <|-- Car`}
1352
1352
  \`\`\`
1353
- `, i = 3, r = 10 - a.length;
1353
+ `, r = 3, i = 10 - a.length;
1354
1354
  break;
1355
1355
  }
1356
1356
  case "state": {
@@ -1358,7 +1358,7 @@ ${(s == null ? void 0 : s.class) || `classDiagram
1358
1358
  ${(s == null ? void 0 : s.state) || `stateDiagram-v2
1359
1359
  s1 --> s2`}
1360
1360
  \`\`\`
1361
- `, i = 3, r = 10 - a.length;
1361
+ `, r = 3, i = 10 - a.length;
1362
1362
  break;
1363
1363
  }
1364
1364
  case "pie": {
@@ -1368,7 +1368,7 @@ ${(s == null ? void 0 : s.pie) || `pie title Pets adopted by volunteers
1368
1368
  "Cats" : 85
1369
1369
  "Rats" : 15`}
1370
1370
  \`\`\`
1371
- `, i = 3, r = 10 - a.length;
1371
+ `, r = 3, i = 10 - a.length;
1372
1372
  break;
1373
1373
  }
1374
1374
  case "relationship": {
@@ -1377,7 +1377,7 @@ ${(s == null ? void 0 : s.relationship) || `erDiagram
1377
1377
  CAR ||--o{ NAMED-DRIVER : allows
1378
1378
  PERSON ||--o{ NAMED-DRIVER : is`}
1379
1379
  \`\`\`
1380
- `, i = 3, r = 10 - a.length;
1380
+ `, r = 3, i = 10 - a.length;
1381
1381
  break;
1382
1382
  }
1383
1383
  case "journey": {
@@ -1392,50 +1392,50 @@ ${(s == null ? void 0 : s.journey) || `journey
1392
1392
  Go downstairs: 5: Me
1393
1393
  Sit down: 5: Me`}
1394
1394
  \`\`\`
1395
- `, i = 3, r = 10 - a.length;
1395
+ `, r = 3, i = 10 - a.length;
1396
1396
  break;
1397
1397
  }
1398
1398
  case "katexInline": {
1399
- a = "$$", i = 1, r = -1;
1399
+ a = "$$", r = 1, i = -1;
1400
1400
  break;
1401
1401
  }
1402
1402
  case "katexBlock": {
1403
1403
  a = `$$
1404
1404
 
1405
1405
  $$
1406
- `, i = 3, r = -4;
1406
+ `, r = 3, i = -4;
1407
1407
  break;
1408
1408
  }
1409
1409
  case "universal": {
1410
- const { generate: b } = l, $ = b(u);
1411
- a = $.targetValue, m = $.select || !0, i = $.deviationStart || 0, r = $.deviationEnd || 0;
1410
+ const { generate: u } = l, C = u(d);
1411
+ a = C.targetValue, h = C.select ?? !0, r = C.deviationStart || 0, i = C.deviationEnd || 0;
1412
1412
  }
1413
1413
  }
1414
1414
  return {
1415
1415
  text: a,
1416
1416
  options: {
1417
1417
  // 是否选中
1418
- select: m,
1418
+ select: h,
1419
1419
  // 选中时,开始位置的偏移量
1420
- deviationStart: i,
1420
+ deviationStart: r,
1421
1421
  // 结束的偏移量
1422
- deviationEnd: r,
1422
+ deviationEnd: i,
1423
1423
  // 是否整个替换
1424
- replaceAll: g
1424
+ replaceAll: f
1425
1425
  }
1426
1426
  };
1427
- }, ql = "#e5c07b", ht = "var(--md-color)", Gl = "#56b6c2", Kl = "#ffffff", ce = "var(--md-color)", bt = "#e5c07b", jl = "#e5c07b", Zl = "var(--md-color)", vt = "#d19a66", Xl = "#c678dd", Yl = "#21252b", Jl = "#2c313a", kt = "var(--md-bk-color)", $e = "var(--md-bk-color)", Ql = "#ceedfa33", Ct = "#528bff", eo = Se.theme(
1427
+ }, Gl = "#e5c07b", bt = "var(--md-color)", Kl = "#56b6c2", jl = "#ffffff", ue = "var(--md-color)", vt = "#e5c07b", Zl = "#e5c07b", Xl = "var(--md-color)", kt = "#d19a66", Yl = "#c678dd", Jl = "#21252b", Ql = "#2c313a", Ct = "var(--md-bk-color)", $e = "var(--md-bk-color)", eo = "#ceedfa33", $t = "#528bff", to = Se.theme(
1428
1428
  {
1429
1429
  "&": {
1430
- color: ce,
1431
- backgroundColor: kt
1430
+ color: ue,
1431
+ backgroundColor: Ct
1432
1432
  },
1433
1433
  ".cm-content": {
1434
- caretColor: Ct
1434
+ caretColor: $t
1435
1435
  },
1436
- ".cm-cursor, .cm-dropCursor": { borderLeftColor: Ct },
1437
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Ql },
1438
- ".cm-panels": { backgroundColor: Yl, color: ce },
1436
+ ".cm-cursor, .cm-dropCursor": { borderLeftColor: $t },
1437
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: eo },
1438
+ ".cm-panels": { backgroundColor: Jl, color: ue },
1439
1439
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1440
1440
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1441
1441
  ".cm-searchMatch": {
@@ -1451,13 +1451,13 @@ $$
1451
1451
  backgroundColor: "#bad0f847"
1452
1452
  },
1453
1453
  ".cm-gutters": {
1454
- backgroundColor: kt,
1455
- color: ce,
1454
+ backgroundColor: Ct,
1455
+ color: ue,
1456
1456
  borderRight: "1px solid",
1457
1457
  borderColor: "var(--md-border-color)"
1458
1458
  },
1459
1459
  ".cm-activeLineGutter": {
1460
- backgroundColor: Jl
1460
+ backgroundColor: Ql
1461
1461
  },
1462
1462
  ".cm-foldPlaceholder": {
1463
1463
  backgroundColor: "transparent",
@@ -1478,17 +1478,17 @@ $$
1478
1478
  },
1479
1479
  ".cm-tooltip-autocomplete": {
1480
1480
  "& > ul > li[aria-selected]": {
1481
- color: ce
1481
+ color: ue
1482
1482
  }
1483
1483
  }
1484
1484
  },
1485
1485
  { dark: !0 }
1486
- ), to = Bt.define([
1487
- { tag: c.keyword, color: Xl },
1488
- { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: ht },
1489
- { tag: [c.function(c.variableName), c.labelName], color: jl },
1490
- { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: vt },
1491
- { tag: [c.definition(c.name), c.separator], color: ce },
1486
+ ), lo = Ot.define([
1487
+ { tag: c.keyword, color: Yl },
1488
+ { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: bt },
1489
+ { tag: [c.function(c.variableName), c.labelName], color: Zl },
1490
+ { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: kt },
1491
+ { tag: [c.definition(c.name), c.separator], color: ue },
1492
1492
  {
1493
1493
  tag: [
1494
1494
  c.typeName,
@@ -1500,7 +1500,7 @@ $$
1500
1500
  c.self,
1501
1501
  c.namespace
1502
1502
  ],
1503
- color: ql
1503
+ color: Gl
1504
1504
  },
1505
1505
  {
1506
1506
  tag: [
@@ -1512,32 +1512,32 @@ $$
1512
1512
  c.link,
1513
1513
  c.special(c.string)
1514
1514
  ],
1515
- color: Gl
1515
+ color: Kl
1516
1516
  },
1517
- { tag: [c.meta, c.comment], color: bt },
1517
+ { tag: [c.meta, c.comment], color: vt },
1518
1518
  { tag: c.strong, fontWeight: "bold" },
1519
1519
  { tag: c.emphasis, fontStyle: "italic" },
1520
1520
  { tag: c.strikethrough, textDecoration: "line-through" },
1521
- { tag: c.link, color: bt, textDecoration: "underline" },
1522
- { tag: c.heading, fontWeight: "bold", color: ht },
1523
- { tag: [c.atom, c.bool, c.special(c.variableName)], color: vt },
1524
- { tag: [c.processingInstruction, c.string, c.inserted], color: Zl },
1525
- { tag: c.invalid, color: Kl }
1526
- ]), $t = [
1527
- eo,
1528
- Ot(to)
1529
- ], lo = "#e5c07b", pt = "#3f4a54", oo = "#56b6c2", ao = "#fff", ue = "#3f4a54", yt = "#2d8cf0", no = "#2d8cf0", io = "#3f4a54", Tt = "#d19a66", ro = "#c678dd", so = "#21252b", co = "#ceedfa33", wt = "var(--md-bk-color)", pe = "var(--md-bk-color)", uo = "#bad5fa", xt = "#3f4a54", mo = Se.theme(
1521
+ { tag: c.link, color: vt, textDecoration: "underline" },
1522
+ { tag: c.heading, fontWeight: "bold", color: bt },
1523
+ { tag: [c.atom, c.bool, c.special(c.variableName)], color: kt },
1524
+ { tag: [c.processingInstruction, c.string, c.inserted], color: Xl },
1525
+ { tag: c.invalid, color: jl }
1526
+ ]), pt = [
1527
+ to,
1528
+ Vt(lo)
1529
+ ], oo = "#e5c07b", yt = "#3f4a54", ao = "#56b6c2", no = "#fff", de = "#3f4a54", Tt = "#2d8cf0", io = "#2d8cf0", ro = "#3f4a54", wt = "#d19a66", so = "#c678dd", co = "#21252b", uo = "#ceedfa33", xt = "var(--md-bk-color)", pe = "var(--md-bk-color)", mo = "#bad5fa", St = "#3f4a54", go = Se.theme(
1530
1530
  {
1531
1531
  "&": {
1532
- color: ue,
1533
- backgroundColor: wt
1532
+ color: de,
1533
+ backgroundColor: xt
1534
1534
  },
1535
1535
  ".cm-content": {
1536
- caretColor: xt
1536
+ caretColor: St
1537
1537
  },
1538
- ".cm-cursor, .cm-dropCursor": { borderLeftColor: xt },
1539
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: uo },
1540
- ".cm-panels": { backgroundColor: so, color: ue },
1538
+ ".cm-cursor, .cm-dropCursor": { borderLeftColor: St },
1539
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: mo },
1540
+ ".cm-panels": { backgroundColor: co, color: de },
1541
1541
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1542
1542
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1543
1543
  ".cm-searchMatch": {
@@ -1553,13 +1553,13 @@ $$
1553
1553
  backgroundColor: "#bad0f847"
1554
1554
  },
1555
1555
  ".cm-gutters": {
1556
- backgroundColor: wt,
1557
- color: ue,
1556
+ backgroundColor: xt,
1557
+ color: de,
1558
1558
  borderRight: "1px solid",
1559
1559
  borderColor: "var(--md-border-color)"
1560
1560
  },
1561
1561
  ".cm-activeLineGutter": {
1562
- backgroundColor: co
1562
+ backgroundColor: uo
1563
1563
  },
1564
1564
  ".cm-foldPlaceholder": {
1565
1565
  backgroundColor: "transparent",
@@ -1580,17 +1580,17 @@ $$
1580
1580
  },
1581
1581
  ".cm-tooltip-autocomplete": {
1582
1582
  "& > ul > li[aria-selected]": {
1583
- color: ue
1583
+ color: de
1584
1584
  }
1585
1585
  }
1586
1586
  }
1587
1587
  // { dark: true }
1588
- ), go = Bt.define([
1589
- { tag: c.keyword, color: ro },
1590
- { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: pt },
1591
- { tag: [c.function(c.variableName), c.labelName], color: no },
1592
- { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: Tt },
1593
- { tag: [c.definition(c.name), c.separator], color: ue },
1588
+ ), fo = Ot.define([
1589
+ { tag: c.keyword, color: so },
1590
+ { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: yt },
1591
+ { tag: [c.function(c.variableName), c.labelName], color: io },
1592
+ { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: wt },
1593
+ { tag: [c.definition(c.name), c.separator], color: de },
1594
1594
  {
1595
1595
  tag: [
1596
1596
  c.typeName,
@@ -1602,7 +1602,7 @@ $$
1602
1602
  c.self,
1603
1603
  c.namespace
1604
1604
  ],
1605
- color: lo
1605
+ color: oo
1606
1606
  },
1607
1607
  {
1608
1608
  tag: [
@@ -1614,40 +1614,40 @@ $$
1614
1614
  c.link,
1615
1615
  c.special(c.string)
1616
1616
  ],
1617
- color: oo
1617
+ color: ao
1618
1618
  },
1619
- { tag: [c.meta, c.comment], color: yt },
1619
+ { tag: [c.meta, c.comment], color: Tt },
1620
1620
  { tag: c.strong, fontWeight: "bold" },
1621
1621
  { tag: c.emphasis, fontStyle: "italic" },
1622
1622
  { tag: c.strikethrough, textDecoration: "line-through" },
1623
- { tag: c.link, color: yt, textDecoration: "underline" },
1624
- { tag: c.heading, fontWeight: "bold", color: pt },
1625
- { tag: [c.atom, c.bool, c.special(c.variableName)], color: Tt },
1626
- { tag: [c.processingInstruction, c.string, c.inserted], color: io },
1627
- { tag: c.invalid, color: ao }
1628
- ]), St = [
1629
- mo,
1630
- Ot(go)
1631
- ], he = (e, o, l, a, i) => (r, m, g, u) => {
1632
- const s = `${e}${o}`.slice(u - g);
1633
- r.dispatch(r.state.replaceSelection(`${s}${l}${a}`));
1634
- const h = g + m.label.length + (i === "title" ? l.length : 0);
1635
- r.dispatch({
1636
- selection: q.create(
1623
+ { tag: c.link, color: Tt, textDecoration: "underline" },
1624
+ { tag: c.heading, fontWeight: "bold", color: yt },
1625
+ { tag: [c.atom, c.bool, c.special(c.variableName)], color: wt },
1626
+ { tag: [c.processingInstruction, c.string, c.inserted], color: ro },
1627
+ { tag: c.invalid, color: no }
1628
+ ]), Mt = [
1629
+ go,
1630
+ Vt(fo)
1631
+ ], be = (e, o, l, a, r) => (i, h, f, d) => {
1632
+ const s = `${e}${o}`.slice(d - f);
1633
+ i.dispatch(i.state.replaceSelection(`${s}${l}${a}`));
1634
+ const g = f + h.label.length + (r === "title" ? l.length : 0);
1635
+ i.dispatch({
1636
+ selection: _.create(
1637
1637
  [
1638
- q.range(
1639
- g + m.label.length + (i === "title" ? 1 : -o.length),
1640
- h
1638
+ _.range(
1639
+ f + h.label.length + (r === "title" ? 1 : -o.length),
1640
+ g
1641
1641
  ),
1642
- q.cursor(h)
1642
+ _.cursor(g)
1643
1643
  ],
1644
1644
  1
1645
1645
  )
1646
- }), r.focus();
1647
- }, At = (e) => (o, l, a, i) => {
1648
- const r = e.slice(i - a);
1649
- o.dispatch(o.state.replaceSelection(`${r} `));
1650
- }, fo = (e) => {
1646
+ }), i.focus();
1647
+ }, At = (e) => (o, l, a, r) => {
1648
+ const i = e.slice(r - a);
1649
+ o.dispatch(o.state.replaceSelection(`${i} `));
1650
+ }, ho = (e) => {
1651
1651
  const o = (l) => {
1652
1652
  const a = l.matchBefore(
1653
1653
  /^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|^\$\$?|!+\s*\w*/
@@ -1656,21 +1656,21 @@ $$
1656
1656
  from: a.from,
1657
1657
  options: [
1658
1658
  // 标题
1659
- ...["h1", "h2", "h3", "h4", "h5", "h6"].map((i, r) => {
1660
- const m = new Array(r + 1).fill("#").join("");
1659
+ ...["h1", "h2", "h3", "h4", "h5", "h6"].map((r, i) => {
1660
+ const h = new Array(i + 1).fill("#").join("");
1661
1661
  return {
1662
- label: m,
1662
+ label: h,
1663
1663
  type: "text",
1664
- apply: At(m)
1664
+ apply: At(h)
1665
1665
  };
1666
1666
  }),
1667
1667
  // 任务列表
1668
- ...["unchecked", "checked"].map((i) => {
1669
- const r = i === "checked" ? "- [x]" : "- [ ]";
1668
+ ...["unchecked", "checked"].map((r) => {
1669
+ const i = r === "checked" ? "- [x]" : "- [ ]";
1670
1670
  return {
1671
- label: r,
1671
+ label: i,
1672
1672
  type: "text",
1673
- apply: At(r)
1673
+ apply: At(i)
1674
1674
  };
1675
1675
  }),
1676
1676
  // 代码
@@ -1678,10 +1678,10 @@ $$
1678
1678
  ["`", ""],
1679
1679
  ["```", "language"],
1680
1680
  ["```mermaid\n", ""]
1681
- ].map((i) => ({
1682
- label: `${i[0]}${i[1]}`,
1681
+ ].map((r) => ({
1682
+ label: `${r[0]}${r[1]}`,
1683
1683
  type: "text",
1684
- apply: he(i[0], i[1], "", i[0] === "`" ? "`" : "\n```", "type")
1684
+ apply: be(r[0], r[1], "", r[0] === "`" ? "`" : "\n```", "type")
1685
1685
  })),
1686
1686
  // 链接
1687
1687
  {
@@ -1706,12 +1706,12 @@ $$
1706
1706
  {
1707
1707
  label: "$",
1708
1708
  type: "text",
1709
- apply: he("$", "", "", "$", "type")
1709
+ apply: be("$", "", "", "$", "type")
1710
1710
  },
1711
1711
  {
1712
1712
  label: "$$",
1713
1713
  type: "text",
1714
- apply: he("$$", "", `
1714
+ apply: be("$$", "", `
1715
1715
  `, `
1716
1716
  $$`, "title")
1717
1717
  },
@@ -1733,39 +1733,39 @@ $$`, "title")
1733
1733
  "caution",
1734
1734
  "error",
1735
1735
  "attention"
1736
- ].map((i) => ({
1737
- label: `!!! ${i}`,
1736
+ ].map((r) => ({
1737
+ label: `!!! ${r}`,
1738
1738
  type: "text",
1739
- apply: he("!!!", ` ${i}`, " Title", `
1739
+ apply: be("!!!", ` ${r}`, " Title", `
1740
1740
 
1741
1741
  !!!`, "title")
1742
1742
  }))
1743
1743
  ]
1744
1744
  };
1745
1745
  };
1746
- return ml({
1746
+ return gl({
1747
1747
  override: e ? [o, ...e] : [o]
1748
1748
  });
1749
- }, Mt = fo, ee = (e) => {
1750
- const o = new be();
1749
+ }, Lt = ho, ee = (e) => {
1750
+ const o = new ce();
1751
1751
  return (a) => (o.get(e.state) ? e.dispatch({ effects: o.reconfigure(a) }) : e.dispatch({
1752
- effects: il.appendConfig.of(o.of(a))
1752
+ effects: nl.appendConfig.of(o.of(a))
1753
1753
  }), !0);
1754
1754
  };
1755
- class ho {
1755
+ class bo {
1756
1756
  constructor(o) {
1757
- _(this, "view");
1758
- _(this, "maxLength", Number.MAX_SAFE_INTEGER);
1757
+ U(this, "view");
1758
+ U(this, "maxLength", Number.MAX_SAFE_INTEGER);
1759
1759
  // 切换tabSize的执行方法。切换时,Compartment实例需要相同
1760
- _(this, "toggleTabSize");
1761
- _(this, "togglePlaceholder");
1760
+ U(this, "toggleTabSize");
1761
+ U(this, "togglePlaceholder");
1762
1762
  /**
1763
1763
  * 设置全部的扩展
1764
1764
  */
1765
- _(this, "setExtensions");
1766
- _(this, "toggleDisabled");
1767
- _(this, "toggleReadOnly");
1768
- _(this, "toggleMaxlength");
1765
+ U(this, "setExtensions");
1766
+ U(this, "toggleDisabled");
1767
+ U(this, "toggleReadOnly");
1768
+ U(this, "toggleMaxlength");
1769
1769
  this.view = o, this.toggleTabSize = ee(this.view), this.togglePlaceholder = ee(this.view), this.setExtensions = ee(this.view), this.toggleDisabled = ee(this.view), this.toggleReadOnly = ee(this.view), this.toggleMaxlength = ee(this.view);
1770
1770
  }
1771
1771
  getValue() {
@@ -1818,29 +1818,29 @@ class ho {
1818
1818
  }
1819
1819
  if (this.view.state.doc.length - this.getSelectedText().length + o.length > this.maxLength)
1820
1820
  throw new Error("The input text is too long");
1821
- const { from: i } = this.view.state.selection.main;
1821
+ const { from: r } = this.view.state.selection.main;
1822
1822
  if (this.view.dispatch(this.view.state.replaceSelection(o)), l.select) {
1823
- const r = i + o.length + l.deviationEnd;
1823
+ const i = r + o.length + l.deviationEnd;
1824
1824
  this.view.dispatch({
1825
- selection: q.create(
1825
+ selection: _.create(
1826
1826
  [
1827
- q.range(i + l.deviationStart, r),
1828
- q.cursor(r)
1827
+ _.range(r + l.deviationStart, i),
1828
+ _.cursor(i)
1829
1829
  ],
1830
1830
  1
1831
1831
  )
1832
1832
  });
1833
1833
  }
1834
1834
  this.view.focus();
1835
- } catch (i) {
1836
- if (i.message === "The input text is too long")
1837
- v.emit(a, le, {
1835
+ } catch (r) {
1836
+ if (r.message === "The input text is too long")
1837
+ b.emit(a, le, {
1838
1838
  name: "overlength",
1839
- message: i.message,
1839
+ message: r.message,
1840
1840
  data: o
1841
1841
  });
1842
1842
  else
1843
- throw i;
1843
+ throw r;
1844
1844
  }
1845
1845
  }
1846
1846
  /**
@@ -1851,7 +1851,7 @@ class ho {
1851
1851
  setTabSize(o) {
1852
1852
  this.toggleTabSize([
1853
1853
  Ce.tabSize.of(o),
1854
- dl.of(" ".repeat(o))
1854
+ ml.of(" ".repeat(o))
1855
1855
  ]);
1856
1856
  }
1857
1857
  /**
@@ -1860,26 +1860,26 @@ class ho {
1860
1860
  * @param t 目标内容
1861
1861
  */
1862
1862
  setPlaceholder(o) {
1863
- this.togglePlaceholder(ll(o));
1863
+ this.togglePlaceholder(tl(o));
1864
1864
  }
1865
1865
  focus(o) {
1866
1866
  if (this.view.focus(), !o)
1867
1867
  return;
1868
- let l = 0, a = 0, i = 0;
1868
+ let l = 0, a = 0, r = 0;
1869
1869
  switch (o) {
1870
1870
  case "start":
1871
1871
  break;
1872
1872
  case "end": {
1873
- l = a = i = this.getValue().length;
1873
+ l = a = r = this.getValue().length;
1874
1874
  break;
1875
1875
  }
1876
1876
  default:
1877
- l = o.rangeAnchor || o.cursorPos, a = o.rangeHead || o.cursorPos, i = o.cursorPos;
1877
+ l = o.rangeAnchor || o.cursorPos, a = o.rangeHead || o.cursorPos, r = o.cursorPos;
1878
1878
  }
1879
1879
  this.view.dispatch({
1880
1880
  scrollIntoView: !0,
1881
- selection: q.create(
1882
- [q.range(l, a), q.cursor(i)],
1881
+ selection: _.create(
1882
+ [_.range(l, a), _.cursor(r)],
1883
1883
  1
1884
1884
  )
1885
1885
  });
@@ -1896,209 +1896,198 @@ class ho {
1896
1896
  ]);
1897
1897
  }
1898
1898
  }
1899
- const bo = (e) => {
1900
- const o = A("editorId");
1899
+ const vo = (e) => {
1900
+ const o = I("editorId");
1901
1901
  return (a) => {
1902
1902
  if (!a.clipboardData)
1903
1903
  return;
1904
1904
  if (a.clipboardData.files.length > 0) {
1905
- const { files: r } = a.clipboardData;
1906
- v.emit(
1905
+ const { files: i } = a.clipboardData;
1906
+ b.emit(
1907
1907
  o,
1908
1908
  xe,
1909
- Array.from(r).filter((m) => /image\/.*/.test(m.type))
1909
+ Array.from(i).filter((h) => /image\/.*/.test(h.type))
1910
1910
  ), a.preventDefault();
1911
1911
  return;
1912
1912
  }
1913
1913
  if (e.autoDetectCode && a.clipboardData.types.includes("vscode-editor-data")) {
1914
- const r = JSON.parse(a.clipboardData.getData("vscode-editor-data"));
1915
- v.emit(o, x, "code", {
1916
- mode: r.mode,
1914
+ const i = JSON.parse(a.clipboardData.getData("vscode-editor-data"));
1915
+ b.emit(o, x, "code", {
1916
+ mode: i.mode,
1917
1917
  text: a.clipboardData.getData("text/plain")
1918
1918
  }), a.preventDefault();
1919
1919
  return;
1920
1920
  }
1921
- const i = a.clipboardData.getData("text/plain");
1922
- e.maxlength && i.length + e.modelValue.length > e.maxlength && v.emit(o, le, {
1921
+ const r = a.clipboardData.getData("text/plain");
1922
+ e.maxlength && r.length + e.modelValue.length > e.maxlength && b.emit(o, le, {
1923
1923
  name: "overlength",
1924
1924
  message: "The input text is too long",
1925
- data: i
1925
+ data: r
1926
1926
  });
1927
1927
  };
1928
- }, vo = bo, ko = (e) => {
1929
- const o = A("editorId");
1930
- Y(() => {
1931
- v.on(o, {
1932
- name: Qt,
1933
- callback(l) {
1934
- var a;
1935
- (a = e.value) == null || a.focus(l);
1936
- }
1937
- });
1938
- });
1939
- }, Co = ko, $o = (e, o) => [
1928
+ }, ko = vo, Co = (e, o) => [
1940
1929
  {
1941
1930
  key: "Ctrl-b",
1942
1931
  mac: "Cmd-b",
1943
- run: () => (v.emit(e, x, "bold"), !0)
1932
+ run: () => (b.emit(e, x, "bold"), !0)
1944
1933
  },
1945
1934
  {
1946
1935
  key: "Ctrl-d",
1947
1936
  mac: "Cmd-d",
1948
- run: rl,
1937
+ run: il,
1949
1938
  preventDefault: !0
1950
1939
  },
1951
1940
  {
1952
1941
  key: "Ctrl-s",
1953
1942
  mac: "Cmd-s",
1954
- run: (I) => (v.emit(e, Dt, I.state.doc.toString()), !0),
1955
- shift: () => (v.emit(e, x, "strikeThrough"), !0)
1943
+ run: (M) => (b.emit(e, Et, M.state.doc.toString()), !0),
1944
+ shift: () => (b.emit(e, x, "strikeThrough"), !0)
1956
1945
  },
1957
1946
  {
1958
1947
  key: "Ctrl-u",
1959
1948
  mac: "Cmd-u",
1960
- run: () => (v.emit(e, x, "underline"), !0),
1961
- shift: () => (v.emit(e, x, "unorderedList"), !0)
1949
+ run: () => (b.emit(e, x, "underline"), !0),
1950
+ shift: () => (b.emit(e, x, "unorderedList"), !0)
1962
1951
  },
1963
1952
  {
1964
1953
  key: "Ctrl-i",
1965
1954
  mac: "Cmd-i",
1966
- run: () => (v.emit(e, x, "italic"), !0),
1967
- shift: () => (v.emit(e, Te, "image"), !0)
1955
+ run: () => (b.emit(e, x, "italic"), !0),
1956
+ shift: () => (b.emit(e, Te, "image"), !0)
1968
1957
  },
1969
1958
  {
1970
1959
  key: "Ctrl-1",
1971
1960
  mac: "Cmd-1",
1972
- run: () => (v.emit(e, x, "h1"), !0)
1961
+ run: () => (b.emit(e, x, "h1"), !0)
1973
1962
  },
1974
1963
  {
1975
1964
  key: "Ctrl-2",
1976
1965
  mac: "Cmd-2",
1977
- run: () => (v.emit(e, x, "h2"), !0)
1966
+ run: () => (b.emit(e, x, "h2"), !0)
1978
1967
  },
1979
1968
  {
1980
1969
  key: "Ctrl-3",
1981
1970
  mac: "Cmd-3",
1982
- run: () => (v.emit(e, x, "h3"), !0)
1971
+ run: () => (b.emit(e, x, "h3"), !0)
1983
1972
  },
1984
1973
  {
1985
1974
  key: "Ctrl-4",
1986
1975
  mac: "Cmd-4",
1987
- run: () => (v.emit(e, x, "h4"), !0)
1976
+ run: () => (b.emit(e, x, "h4"), !0)
1988
1977
  },
1989
1978
  {
1990
1979
  key: "Ctrl-5",
1991
1980
  mac: "Cmd-5",
1992
- run: () => (v.emit(e, x, "h5"), !0)
1981
+ run: () => (b.emit(e, x, "h5"), !0)
1993
1982
  },
1994
1983
  {
1995
1984
  key: "Ctrl-6",
1996
1985
  mac: "Cmd-6",
1997
- run: () => (v.emit(e, x, "h6"), !0)
1986
+ run: () => (b.emit(e, x, "h6"), !0)
1998
1987
  },
1999
1988
  {
2000
1989
  key: "Ctrl-ArrowUp",
2001
1990
  mac: "Cmd-ArrowUp",
2002
- run: () => (v.emit(e, x, "sup"), !0)
1991
+ run: () => (b.emit(e, x, "sup"), !0)
2003
1992
  },
2004
1993
  {
2005
1994
  key: "Ctrl-ArrowDown",
2006
1995
  mac: "Cmd-ArrowDown",
2007
- run: () => (v.emit(e, x, "sub"), !0)
1996
+ run: () => (b.emit(e, x, "sub"), !0)
2008
1997
  },
2009
1998
  {
2010
1999
  key: "Ctrl-o",
2011
2000
  mac: "Cmd-o",
2012
- run: () => (v.emit(e, x, "orderedList"), !0)
2001
+ run: () => (b.emit(e, x, "orderedList"), !0)
2013
2002
  },
2014
2003
  {
2015
2004
  key: "Ctrl-c",
2016
2005
  mac: "Cmd-c",
2017
- shift: () => (v.emit(e, x, "code"), !0),
2018
- any(I, D) {
2019
- return (D.ctrlKey || D.metaKey) && D.altKey && D.code === "KeyC" ? (v.emit(e, x, "codeRow"), !0) : !1;
2006
+ shift: () => (b.emit(e, x, "code"), !0),
2007
+ any(M, D) {
2008
+ return (D.ctrlKey || D.metaKey) && D.altKey && D.code === "KeyC" ? (b.emit(e, x, "codeRow"), !0) : !1;
2020
2009
  }
2021
2010
  },
2022
2011
  {
2023
2012
  key: "Ctrl-l",
2024
2013
  mac: "Cmd-l",
2025
- run: () => (v.emit(e, Te, "link"), !0)
2014
+ run: () => (b.emit(e, Te, "link"), !0)
2026
2015
  },
2027
2016
  {
2028
2017
  key: "Ctrl-f",
2029
2018
  mac: "Cmd-f",
2030
- shift: () => o.noPrettier ? !1 : (v.emit(e, x, "prettier"), !0)
2019
+ shift: () => o.noPrettier ? !1 : (b.emit(e, x, "prettier"), !0)
2031
2020
  },
2032
2021
  {
2033
- any: (I, D) => (D.ctrlKey || D.metaKey) && D.altKey && D.shiftKey && D.code === "KeyT" ? (v.emit(e, x, "table"), !0) : !1
2022
+ any: (M, D) => (D.ctrlKey || D.metaKey) && D.altKey && D.shiftKey && D.code === "KeyT" ? (b.emit(e, x, "table"), !0) : !1
2034
2023
  }
2035
- ], po = $o, yo = (e) => {
2036
- const o = A("tabWidth"), l = A("editorId"), a = A("theme"), i = z(), r = Pt(), m = new be(), g = new be(), u = new be(), s = po(l, e), h = vo(e), w = [
2037
- ol.of([...s, sl]),
2038
- tl,
2039
- m.of(nl({ codeLanguages: al })),
2024
+ ], $o = Co, po = (e) => {
2025
+ const o = I("tabWidth"), l = I("editorId"), a = I("theme"), r = P(), i = Wt(), h = new ce(), f = new ce(), d = new ce(), s = new ce(), g = $o(l, e), p = ko(e), k = [
2026
+ ll.of([...rl, ...sl, ...g, cl]),
2027
+ s.of(ft()),
2028
+ h.of(al({ codeLanguages: ol })),
2040
2029
  // 横向换行
2041
- fe.lineWrapping,
2042
- fe.updateListener.of((d) => {
2043
- d.docChanged && e.onChange(d.state.doc.toString());
2030
+ he.lineWrapping,
2031
+ he.updateListener.of((m) => {
2032
+ m.docChanged && e.onChange(m.state.doc.toString());
2044
2033
  }),
2045
- fe.domEventHandlers({
2046
- paste: h,
2034
+ he.domEventHandlers({
2035
+ paste: p,
2047
2036
  blur: e.onBlur,
2048
2037
  focus: e.onFocus,
2049
2038
  drop: e.onDrop,
2050
- input: (d) => {
2051
- e.onInput && e.onInput(d);
2052
- const { data: k } = d;
2053
- e.maxlength && e.modelValue.length + k.length > e.maxlength && v.emit(l, le, {
2039
+ input: (m) => {
2040
+ e.onInput && e.onInput(m);
2041
+ const { data: v } = m;
2042
+ e.maxlength && e.modelValue.length + v.length > e.maxlength && b.emit(l, le, {
2054
2043
  name: "overlength",
2055
2044
  message: "The input text is too long",
2056
- data: k
2045
+ data: v
2057
2046
  });
2058
2047
  }
2059
2048
  })
2060
- ], C = () => {
2061
- const d = [
2062
- ...w,
2063
- g.of(a.value === "light" ? St : $t),
2064
- u.of(Mt(e.completions))
2049
+ ], $ = () => {
2050
+ const m = [
2051
+ ...k,
2052
+ f.of(a.value === "light" ? Mt : pt),
2053
+ d.of(Lt(e.completions))
2065
2054
  ];
2066
- return Q.codeMirrorExtensions(a.value, d, [
2067
- ...s
2055
+ return J.codeMirrorExtensions(a.value, m, [
2056
+ ...g
2068
2057
  ]);
2069
2058
  };
2070
- return Y(() => {
2071
- const d = new fe({
2059
+ return Q(() => {
2060
+ const m = new he({
2072
2061
  doc: e.modelValue,
2073
- parent: i.value,
2074
- extensions: [C()]
2075
- }), k = new ho(d);
2076
- r.value = k, setTimeout(() => {
2077
- k.setTabSize(o), k.setDisabled(e.disabled), k.setReadOnly(e.readonly), e.placeholder && k.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && k.setMaxLength(e.maxlength), e.autofocus && d.focus();
2078
- }, 0), v.on(l, {
2079
- name: Ht,
2062
+ parent: r.value,
2063
+ extensions: [$()]
2064
+ }), v = new bo(m);
2065
+ i.value = v, setTimeout(() => {
2066
+ v.setTabSize(o), v.setDisabled(e.disabled), v.setReadOnly(e.readonly), e.placeholder && v.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && v.setMaxLength(e.maxlength), e.autofocus && m.focus();
2067
+ }, 0), b.on(l, {
2068
+ name: Nt,
2080
2069
  callback() {
2081
- cl(d);
2070
+ ul(m);
2082
2071
  }
2083
- }), v.on(l, {
2084
- name: Et,
2072
+ }), b.on(l, {
2073
+ name: Ht,
2085
2074
  callback() {
2086
- ul(d);
2075
+ dl(m);
2087
2076
  }
2088
- }), v.on(l, {
2077
+ }), b.on(l, {
2089
2078
  name: x,
2090
- callback(f, b = {}) {
2091
- var S;
2092
- const { text: $, options: T } = _l(f, r.value, b);
2093
- (S = r.value) == null || S.replaceSelectedText($, T, l);
2079
+ callback(u, C = {}) {
2080
+ var M;
2081
+ const { text: w, options: S } = _l(u, i.value, C);
2082
+ (M = i.value) == null || M.replaceSelectedText(w, S, l);
2094
2083
  }
2095
2084
  });
2096
2085
  }), H(
2097
2086
  a,
2098
2087
  () => {
2099
- var d;
2100
- (d = r.value) == null || d.view.dispatch({
2101
- effects: g.reconfigure(a.value === "light" ? St : $t)
2088
+ var m;
2089
+ (m = i.value) == null || m.view.dispatch({
2090
+ effects: f.reconfigure(a.value === "light" ? Mt : pt)
2102
2091
  });
2103
2092
  },
2104
2093
  {
@@ -2107,9 +2096,9 @@ const bo = (e) => {
2107
2096
  ), H(
2108
2097
  () => e.completions,
2109
2098
  () => {
2110
- var d;
2111
- (d = r.value) == null || d.view.dispatch({
2112
- effects: u.reconfigure(Mt(e.completions))
2099
+ var m;
2100
+ (m = i.value) == null || m.view.dispatch({
2101
+ effects: d.reconfigure(Lt(e.completions))
2113
2102
  });
2114
2103
  },
2115
2104
  {
@@ -2118,104 +2107,123 @@ const bo = (e) => {
2118
2107
  ), H(
2119
2108
  () => e.modelValue,
2120
2109
  () => {
2121
- var d, k;
2122
- ((d = r.value) == null ? void 0 : d.getValue()) !== e.modelValue && ((k = r.value) == null || k.setValue(e.modelValue));
2110
+ var m, v;
2111
+ ((m = i.value) == null ? void 0 : m.getValue()) !== e.modelValue && ((v = i.value) == null || v.setValue(e.modelValue));
2123
2112
  }
2124
2113
  ), H(
2125
2114
  () => e.placeholder,
2126
2115
  () => {
2127
- var d;
2128
- (d = r.value) == null || d.setPlaceholder(e.placeholder);
2116
+ var m;
2117
+ (m = i.value) == null || m.setPlaceholder(e.placeholder);
2129
2118
  }
2130
2119
  ), H(
2131
2120
  () => e.disabled,
2132
2121
  () => {
2133
- var d;
2134
- (d = r.value) == null || d.setDisabled(e.disabled);
2122
+ var m;
2123
+ (m = i.value) == null || m.setDisabled(e.disabled);
2135
2124
  }
2136
2125
  ), H(
2137
2126
  () => e.readonly,
2138
2127
  () => {
2139
- var d;
2140
- (d = r.value) == null || d.setDisabled(e.readonly);
2128
+ var m;
2129
+ (m = i.value) == null || m.setDisabled(e.readonly);
2141
2130
  }
2142
2131
  ), H(
2143
2132
  () => e.maxlength,
2144
2133
  () => {
2145
- var d;
2146
- e.maxlength && ((d = r.value) == null || d.setMaxLength(e.maxlength));
2134
+ var m;
2135
+ e.maxlength && ((m = i.value) == null || m.setMaxLength(e.maxlength));
2136
+ }
2137
+ ), {
2138
+ inputWrapperRef: r,
2139
+ codeMirrorUt: i,
2140
+ resetHistory() {
2141
+ var m, v;
2142
+ (m = i.value) == null || m.view.dispatch({
2143
+ effects: s.reconfigure([])
2144
+ }), (v = i.value) == null || v.view.dispatch({
2145
+ effects: s.reconfigure(ft())
2146
+ });
2147
2147
  }
2148
- ), Co(r), {
2149
- inputWrapperRef: i,
2150
- codeMirrorUt: r
2151
2148
  };
2152
- }, To = yo, wo = (e, o, l) => {
2149
+ }, yo = po, To = (e, o, l) => {
2153
2150
  const a = G({
2154
2151
  resizedWidth: e.inputBoxWitdh
2155
- }), i = G({
2156
- width: e.inputBoxWitdh
2157
2152
  }), r = G({
2153
+ width: e.inputBoxWitdh
2154
+ }), i = G({
2158
2155
  left: e.inputBoxWitdh,
2159
2156
  display: "initial"
2160
- }), m = (s) => {
2161
- var k, f, b;
2162
- const h = ((k = o.value) == null ? void 0 : k.offsetWidth) || 0, w = ((f = o.value) == null ? void 0 : f.getBoundingClientRect().x) || 0;
2163
- let C = s.x - w;
2164
- C < ge ? C = ge : C > h - ge && (C = h - ge);
2165
- const d = `${C}px`;
2166
- i.width = d, r.left = d, a.resizedWidth = d, (b = e.onInputBoxWitdhChange) == null || b.call(e, d);
2167
- }, g = () => {
2168
- document.addEventListener("mousemove", m);
2169
- }, u = () => {
2170
- document.removeEventListener("mousemove", m);
2157
+ }), h = (s) => {
2158
+ var m, v, u;
2159
+ const g = ((m = o.value) == null ? void 0 : m.offsetWidth) || 0, p = ((v = o.value) == null ? void 0 : v.getBoundingClientRect().x) || 0;
2160
+ let k = s.x - p;
2161
+ k < fe ? k = fe : k > g - fe && (k = g - fe);
2162
+ const $ = `${k}px`;
2163
+ r.width = $, i.left = $, a.resizedWidth = $, (u = e.onInputBoxWitdhChange) == null || u.call(e, $);
2164
+ }, f = () => {
2165
+ document.addEventListener("mousemove", h);
2166
+ }, d = () => {
2167
+ document.removeEventListener("mousemove", h);
2171
2168
  };
2172
- return Y(() => {
2169
+ return Q(() => {
2173
2170
  var s;
2174
- (s = l.value) == null || s.addEventListener("mousedown", g), document.addEventListener("mouseup", u);
2175
- }), It(() => {
2176
- var s, h;
2177
- (s = l.value) == null || s.removeEventListener("mousedown", g), (h = l.value) == null || h.removeEventListener("mouseup", u);
2171
+ (s = l.value) == null || s.addEventListener("mousedown", f), document.addEventListener("mouseup", d);
2172
+ }), Dt(() => {
2173
+ var s, g;
2174
+ (s = l.value) == null || s.removeEventListener("mousedown", f), (g = l.value) == null || g.removeEventListener("mouseup", d);
2178
2175
  }), H(
2179
2176
  () => e.inputBoxWitdh,
2180
2177
  (s) => {
2181
- s && (i.width = s, r.left = s);
2178
+ s && (r.width = s, i.left = s);
2182
2179
  }
2183
2180
  ), H(
2184
2181
  [te(e.setting, "htmlPreview"), te(e.setting, "preview")],
2185
2182
  () => {
2186
- !e.setting.htmlPreview && !e.setting.preview ? (i.width = "100%", r.display = "none") : (i.width = a.resizedWidth, r.display = "initial");
2183
+ !e.setting.htmlPreview && !e.setting.preview ? (r.width = "100%", i.display = "none") : (r.width = a.resizedWidth, i.display = "initial");
2187
2184
  },
2188
2185
  {
2189
2186
  immediate: !0
2190
2187
  }
2191
- ), { inputWrapperStyle: i, resizeOperateStyle: r };
2192
- }, xo = wo, So = /* @__PURE__ */ P({
2188
+ ), { inputWrapperStyle: r, resizeOperateStyle: i };
2189
+ }, wo = To, xo = /* @__PURE__ */ W({
2193
2190
  name: "MDEditorContent",
2194
- props: gl,
2195
- setup(e) {
2196
- const o = A("editorId"), l = z(""), a = z(), i = z(), {
2197
- inputWrapperRef: r,
2198
- codeMirrorUt: m
2199
- } = To(e), {
2200
- inputWrapperStyle: g,
2201
- resizeOperateStyle: u
2202
- } = xo(e, a, i);
2203
- return Ul(e, l, m), () => t("div", {
2191
+ props: fl,
2192
+ setup(e, o) {
2193
+ const l = I("editorId"), a = P(""), r = P(), i = P(), {
2194
+ inputWrapperRef: h,
2195
+ codeMirrorUt: f,
2196
+ resetHistory: d
2197
+ } = yo(e), {
2198
+ inputWrapperStyle: s,
2199
+ resizeOperateStyle: g
2200
+ } = wo(e, r, i);
2201
+ return Ul(e, a, f), o.expose({
2202
+ getSelectedText() {
2203
+ var p;
2204
+ return (p = f.value) == null ? void 0 : p.getSelectedText();
2205
+ },
2206
+ focus(p) {
2207
+ var k;
2208
+ (k = f.value) == null || k.focus(p);
2209
+ },
2210
+ resetHistory: d
2211
+ }), () => t("div", {
2204
2212
  class: `${n}-content${e.setting.htmlPreview || e.setting.preview ? " has-preview" : ""}`,
2205
- ref: a
2213
+ ref: r
2206
2214
  }, [t("div", {
2207
2215
  class: `${n}-input-wrapper`,
2208
- style: g,
2209
- ref: r
2216
+ style: s,
2217
+ ref: h
2210
2218
  }, null), (e.setting.htmlPreview || e.setting.preview) && t("div", {
2211
2219
  class: `${n}-resize-operate`,
2212
- style: u,
2220
+ style: g,
2213
2221
  ref: i
2214
- }, null), t(fl, {
2222
+ }, null), t(hl, {
2215
2223
  modelValue: e.modelValue,
2216
2224
  setting: e.setting,
2217
- onHtmlChanged: (s) => {
2218
- l.value = s, e.onHtmlChanged(s);
2225
+ onHtmlChanged: (p) => {
2226
+ a.value = p, e.onHtmlChanged(p);
2219
2227
  },
2220
2228
  onGetCatalog: e.onGetCatalog,
2221
2229
  mdHeadingId: e.mdHeadingId,
@@ -2226,15 +2234,15 @@ const bo = (e) => {
2226
2234
  noHighlight: e.noHighlight,
2227
2235
  noImgZoomIn: e.noImgZoomIn,
2228
2236
  sanitizeMermaid: e.sanitizeMermaid
2229
- }, null), e.catalogVisible && t(Vt, {
2237
+ }, null), e.catalogVisible && t(Ft, {
2230
2238
  theme: e.theme,
2231
2239
  class: `${n}-catalog-editor`,
2232
- editorId: o,
2240
+ editorId: l,
2233
2241
  mdHeadingId: e.mdHeadingId,
2234
2242
  key: "internal-catalog"
2235
2243
  }, null)]);
2236
2244
  }
2237
- }), Ao = /* @__PURE__ */ P({
2245
+ }), So = /* @__PURE__ */ W({
2238
2246
  props: {
2239
2247
  modelValue: {
2240
2248
  type: String,
@@ -2242,7 +2250,7 @@ const bo = (e) => {
2242
2250
  }
2243
2251
  },
2244
2252
  setup(e) {
2245
- const o = A("usedLanguageText");
2253
+ const o = I("usedLanguageText");
2246
2254
  return () => {
2247
2255
  var l, a;
2248
2256
  return t("div", {
@@ -2262,7 +2270,7 @@ const bo = (e) => {
2262
2270
  default: () => {
2263
2271
  }
2264
2272
  }
2265
- }, Lo = /* @__PURE__ */ P({
2273
+ }, Ao = /* @__PURE__ */ W({
2266
2274
  props: Mo,
2267
2275
  setup(e) {
2268
2276
  return () => t("div", {
@@ -2272,7 +2280,7 @@ const bo = (e) => {
2272
2280
  }
2273
2281
  }, null);
2274
2282
  }
2275
- }), Io = {
2283
+ }), Lo = {
2276
2284
  scrollAuto: {
2277
2285
  type: Boolean
2278
2286
  },
@@ -2281,10 +2289,10 @@ const bo = (e) => {
2281
2289
  default: () => {
2282
2290
  }
2283
2291
  }
2284
- }, Do = /* @__PURE__ */ P({
2285
- props: Io,
2292
+ }, Io = /* @__PURE__ */ W({
2293
+ props: Lo,
2286
2294
  setup(e) {
2287
- const o = A("usedLanguageText");
2295
+ const o = I("usedLanguageText");
2288
2296
  return () => {
2289
2297
  var l;
2290
2298
  return t("div", {
@@ -2294,13 +2302,13 @@ const bo = (e) => {
2294
2302
  onClick: () => {
2295
2303
  e.onScrollAutoChange(!e.scrollAuto);
2296
2304
  }
2297
- }, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(Lo, {
2305
+ }, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(Ao, {
2298
2306
  checked: e.scrollAuto,
2299
2307
  onChange: e.onScrollAutoChange
2300
2308
  }, null)]);
2301
2309
  };
2302
2310
  }
2303
- }), Eo = {
2311
+ }), Do = {
2304
2312
  modelValue: {
2305
2313
  type: String,
2306
2314
  default: ""
@@ -2320,22 +2328,22 @@ const bo = (e) => {
2320
2328
  defFooters: {
2321
2329
  type: Object
2322
2330
  }
2323
- }, Ho = /* @__PURE__ */ P({
2331
+ }, Eo = /* @__PURE__ */ W({
2324
2332
  name: "MDEditorFooter",
2325
- props: Eo,
2333
+ props: Do,
2326
2334
  setup(e) {
2327
2335
  const o = we(() => {
2328
- const a = e.footers.indexOf("="), i = a === -1 ? e.footers : e.footers.slice(0, a), r = a === -1 ? [] : e.footers.slice(a, Number.MAX_SAFE_INTEGER);
2329
- return [i, r];
2336
+ const a = e.footers.indexOf("="), r = a === -1 ? e.footers : e.footers.slice(0, a), i = a === -1 ? [] : e.footers.slice(a, Number.MAX_SAFE_INTEGER);
2337
+ return [r, i];
2330
2338
  }), l = (a) => {
2331
2339
  if (Ut.includes(a))
2332
2340
  switch (a) {
2333
2341
  case "markdownTotal":
2334
- return t(Ao, {
2342
+ return t(So, {
2335
2343
  modelValue: e.modelValue
2336
2344
  }, null);
2337
2345
  case "scrollSwitch":
2338
- return t(Do, {
2346
+ return t(Io, {
2339
2347
  scrollAuto: e.scrollAuto,
2340
2348
  onScrollAutoChange: e.onScrollAutoChange
2341
2349
  }, null);
@@ -2344,116 +2352,117 @@ const bo = (e) => {
2344
2352
  return e.defFooters instanceof Array ? e.defFooters[a] || "" : e.defFooters && e.defFooters.children instanceof Array && e.defFooters.children[a] || "";
2345
2353
  };
2346
2354
  return () => {
2347
- const a = o.value[0].map((r) => l(r)), i = o.value[1].map((r) => l(r));
2355
+ const a = o.value[0].map((i) => l(i)), r = o.value[1].map((i) => l(i));
2348
2356
  return t("div", {
2349
2357
  class: `${n}-footer`
2350
2358
  }, [t("div", {
2351
2359
  class: `${n}-footer-left`
2352
2360
  }, [a]), t("div", {
2353
2361
  class: `${n}-footer-right`
2354
- }, [i])]);
2362
+ }, [r])]);
2355
2363
  };
2356
2364
  }
2357
- }), No = /* @__PURE__ */ P({
2365
+ }), Ho = /* @__PURE__ */ W({
2358
2366
  name: "MdEditorV3",
2359
- props: hl,
2360
- emits: bl,
2367
+ props: bl,
2368
+ emits: vl,
2361
2369
  setup(e, o) {
2362
2370
  const {
2363
2371
  editorId: l,
2364
2372
  noKatex: a,
2365
- noMermaid: i,
2366
- noPrettier: r,
2367
- noUploadImg: m,
2368
- noHighlight: g
2369
- } = e, u = G({
2373
+ noMermaid: r,
2374
+ noPrettier: i,
2375
+ noUploadImg: h,
2376
+ noHighlight: f
2377
+ } = e, d = G({
2370
2378
  scrollAuto: e.scrollAuto
2371
- });
2372
- vl(e, o), kl(e), Cl(e), $l(e, o);
2373
- const [s, h] = pl(e, o), w = yl(e);
2374
- return It(() => {
2375
- v.clear(l);
2376
- }), Tl(e, o, w, s, h), () => {
2377
- var k;
2378
- const C = ft({
2379
+ }), s = P();
2380
+ kl(e, o), Cl(e), $l(e), pl(e, o);
2381
+ const [g, p] = yl(e, o), k = Tl(e);
2382
+ return Dt(() => {
2383
+ b.clear(l);
2384
+ }), wl(e, o, k, g, p, s), () => {
2385
+ var v;
2386
+ const $ = ht({
2379
2387
  props: e,
2380
2388
  ctx: o
2381
- }, "defToolbars"), d = ft({
2389
+ }, "defToolbars"), m = ht({
2382
2390
  props: e,
2383
2391
  ctx: o
2384
2392
  }, "defFooters");
2385
2393
  return t("div", {
2386
2394
  id: l,
2387
- class: [n, e.class, e.theme === "dark" && `${n}-dark`, s.fullscreen || s.pageFullscreen ? `${n}-fullscreen` : ""],
2395
+ class: [n, e.class, e.theme === "dark" && `${n}-dark`, g.fullscreen || g.pageFullscreen ? `${n}-fullscreen` : ""],
2388
2396
  style: e.style
2389
- }, [t(Rl, {
2390
- noPrettier: r,
2397
+ }, [t(Pl, {
2398
+ noPrettier: i,
2391
2399
  toolbars: e.toolbars,
2392
2400
  toolbarsExclude: e.toolbarsExclude,
2393
- setting: s,
2394
- updateSetting: h,
2401
+ setting: g,
2402
+ updateSetting: p,
2395
2403
  tableShape: e.tableShape,
2396
- defToolbars: C,
2397
- noUploadImg: m,
2404
+ defToolbars: $,
2405
+ noUploadImg: h,
2398
2406
  showToolbarName: e.showToolbarName
2399
- }, null), t(So, {
2407
+ }, null), t(xo, {
2408
+ ref: s,
2400
2409
  modelValue: e.modelValue,
2401
- setting: s,
2410
+ setting: g,
2402
2411
  mdHeadingId: e.mdHeadingId,
2403
- noMermaid: i,
2404
- noPrettier: r,
2412
+ noMermaid: r,
2413
+ noPrettier: i,
2405
2414
  sanitize: e.sanitize,
2406
2415
  placeholder: e.placeholder,
2407
2416
  noKatex: a,
2408
- scrollAuto: u.scrollAuto,
2417
+ scrollAuto: d.scrollAuto,
2409
2418
  formatCopiedText: e.formatCopiedText,
2410
2419
  autofocus: e.autoFocus,
2411
2420
  disabled: e.disabled,
2412
2421
  readonly: e.readOnly,
2413
2422
  maxlength: e.maxLength,
2414
2423
  autoDetectCode: e.autoDetectCode,
2415
- noHighlight: g,
2416
- onChange: (f) => {
2417
- e.onChange ? e.onChange(f) : (o.emit("update:modelValue", f), o.emit("onChange", f));
2424
+ noHighlight: f,
2425
+ onChange: (u) => {
2426
+ e.onChange && e.onChange(u), o.emit("update:modelValue", u), o.emit("onChange", u);
2418
2427
  },
2419
- onHtmlChanged: (f) => {
2420
- e.onHtmlChanged ? e.onHtmlChanged(f) : o.emit("onHtmlChanged", f);
2428
+ onHtmlChanged: (u) => {
2429
+ e.onHtmlChanged && e.onHtmlChanged(u), o.emit("onHtmlChanged", u);
2421
2430
  },
2422
- onGetCatalog: (f) => {
2423
- e.onGetCatalog ? e.onGetCatalog(f) : o.emit("onGetCatalog", f);
2431
+ onGetCatalog: (u) => {
2432
+ e.onGetCatalog && e.onGetCatalog(u), o.emit("onGetCatalog", u);
2424
2433
  },
2425
- onBlur: (f) => {
2426
- e.onBlur ? e.onBlur(f) : o.emit("onBlur", f);
2434
+ onBlur: (u) => {
2435
+ e.onBlur && e.onBlur(u), o.emit("onBlur", u);
2427
2436
  },
2428
- onFocus: (f) => {
2429
- e.onFocus ? e.onFocus(f) : o.emit("onFocus", f);
2437
+ onFocus: (u) => {
2438
+ e.onFocus && e.onFocus(u), o.emit("onFocus", u);
2430
2439
  },
2431
- onInput: (f) => {
2432
- e.onInput ? e.onInput(f) : o.emit("onInput", f);
2440
+ onInput: (u) => {
2441
+ e.onInput && e.onInput(u), o.emit("onInput", u);
2433
2442
  },
2434
2443
  completions: e.completions,
2435
- catalogVisible: w.value,
2444
+ catalogVisible: k.value,
2436
2445
  theme: e.theme,
2437
2446
  noImgZoomIn: e.noImgZoomIn,
2438
- onDrop: (f) => {
2439
- e.onDrop ? e.onDrop(f) : o.emit("onDrop", f);
2447
+ onDrop: (u) => {
2448
+ e.onDrop && e.onDrop(u), o.emit("onDrop", u);
2440
2449
  },
2441
2450
  inputBoxWitdh: e.inputBoxWitdh,
2442
- onInputBoxWitdhChange: (f) => {
2443
- e.onInputBoxWitdhChange ? e.onInputBoxWitdhChange(f) : o.emit("onInputBoxWitdhChange", f);
2451
+ onInputBoxWitdhChange: (u) => {
2452
+ e.onInputBoxWitdhChange && e.onInputBoxWitdhChange(u), o.emit("onInputBoxWitdhChange", u);
2444
2453
  },
2445
2454
  sanitizeMermaid: e.sanitizeMermaid
2446
- }, null), ((k = e.footers) == null ? void 0 : k.length) > 0 && t(Ho, {
2455
+ }, null), ((v = e.footers) == null ? void 0 : v.length) > 0 && t(Eo, {
2447
2456
  modelValue: e.modelValue,
2448
2457
  footers: e.footers,
2449
- defFooters: d,
2450
- scrollAuto: u.scrollAuto,
2451
- onScrollAutoChange: (f) => u.scrollAuto = f
2458
+ defFooters: m,
2459
+ scrollAuto: d.scrollAuto,
2460
+ onScrollAutoChange: (u) => d.scrollAuto = u
2452
2461
  }, null)]);
2453
2462
  };
2454
2463
  }
2455
- }), ye = No;
2456
- ye.install = (e) => (e.component(ye.name, ye), e.use(xl).use(Zt).use(Sl).use(Vt).use(wl), e);
2464
+ }), ye = Ho;
2465
+ ye.install = (e) => (e.component(ye.name, ye), e.use(Sl).use(Xt).use(Ml).use(Ft).use(xl), e);
2457
2466
  export {
2458
2467
  ye as default
2459
2468
  };