md-editor-v3 2.11.0 → 2.11.2
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.
- package/lib/md-editor-v3.cjs +33 -33
- package/lib/md-editor-v3.mjs +924 -930
- package/lib/md-editor-v3.umd.js +33 -33
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/lib/md-editor-v3.mjs
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
var Yn = Object.defineProperty;
|
|
2
2
|
var Jn = (s, e, t) => e in s ? Yn(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
-
var le = (s, e, t) => (Jn(s, typeof e != "symbol" ? e + "" : e, t), t),
|
|
3
|
+
var le = (s, e, t) => (Jn(s, typeof e != "symbol" ? e + "" : e, t), t), Gt = (s, e, t) => {
|
|
4
4
|
if (!e.has(s))
|
|
5
5
|
throw TypeError("Cannot " + t);
|
|
6
6
|
};
|
|
7
|
-
var a = (s, e, t) => (
|
|
7
|
+
var a = (s, e, t) => (Gt(s, e, "read from private field"), t ? t.call(s) : e.get(s)), P = (s, e, t) => {
|
|
8
8
|
if (e.has(s))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
e instanceof WeakSet ? e.add(s) : e.set(s, t);
|
|
11
|
-
},
|
|
11
|
+
}, O = (s, e, t, n) => (Gt(s, e, "write to private field"), n ? n.call(s, t) : e.set(s, t), t), Lt = (s, e, t, n) => ({
|
|
12
12
|
set _(i) {
|
|
13
|
-
|
|
13
|
+
O(s, e, i, t);
|
|
14
14
|
},
|
|
15
15
|
get _() {
|
|
16
16
|
return a(s, e, n);
|
|
17
17
|
}
|
|
18
|
-
}),
|
|
19
|
-
import { reactive as
|
|
20
|
-
const d = "md-editor", ii = "md-editor-v3", si = "https://at.alicdn.com/t/c/font_2605852_u82y61ve02.js",
|
|
21
|
-
main: `${
|
|
22
|
-
markdown: `${
|
|
23
|
-
},
|
|
24
|
-
css: `${
|
|
25
|
-
js: `${
|
|
26
|
-
}, oi = `${
|
|
18
|
+
}), F = (s, e, t) => (Gt(s, e, "access private method"), t);
|
|
19
|
+
import { reactive as ke, watch as W, onMounted as ie, onBeforeUnmount as $t, provide as Re, computed as Te, ref as ne, defineComponent as ae, createVNode as u, cloneVNode as ei, nextTick as ut, inject as N, Fragment as Wt, toRef as Bt, mergeProps as ti, isVNode as ni } from "vue";
|
|
20
|
+
const d = "md-editor", ii = "md-editor-v3", si = "https://at.alicdn.com/t/c/font_2605852_u82y61ve02.js", Y = "https://cdnjs.cloudflare.com/ajax/libs", li = `${Y}/highlight.js/11.7.0/highlight.min.js`, fn = {
|
|
21
|
+
main: `${Y}/prettier/2.8.0/standalone.js`,
|
|
22
|
+
markdown: `${Y}/prettier/2.8.0/parser-markdown.js`
|
|
23
|
+
}, mn = {
|
|
24
|
+
css: `${Y}/cropperjs/1.5.13/cropper.min.css`,
|
|
25
|
+
js: `${Y}/cropperjs/1.5.13/cropper.min.js`
|
|
26
|
+
}, oi = `${Y}/screenfull.js/5.2.0/screenfull.min.js`, Dn = [
|
|
27
27
|
"bold",
|
|
28
28
|
"underline",
|
|
29
29
|
"italic",
|
|
@@ -56,7 +56,7 @@ const d = "md-editor", ii = "md-editor-v3", si = "https://at.alicdn.com/t/c/font
|
|
|
56
56
|
"htmlPreview",
|
|
57
57
|
"catalog",
|
|
58
58
|
"github"
|
|
59
|
-
], Hn = ["markdownTotal", "=", "scrollSwitch"],
|
|
59
|
+
], Hn = ["markdownTotal", "=", "scrollSwitch"], gn = {
|
|
60
60
|
"zh-CN": {
|
|
61
61
|
toolbarTips: {
|
|
62
62
|
bold: "加粗",
|
|
@@ -219,41 +219,41 @@ const d = "md-editor", ii = "md-editor-v3", si = "https://at.alicdn.com/t/c/font
|
|
|
219
219
|
scrollAuto: "Scroll Auto"
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
}, ri = `${
|
|
223
|
-
js: `${
|
|
224
|
-
css: `${
|
|
222
|
+
}, ri = `${Y}/mermaid/9.4.0/mermaid.min.js`, pn = {
|
|
223
|
+
js: `${Y}/KaTeX/0.16.3/katex.min.js`,
|
|
224
|
+
css: `${Y}/KaTeX/0.16.3/katex.min.css`
|
|
225
225
|
}, vn = {
|
|
226
226
|
a11y: {
|
|
227
|
-
light: `${
|
|
228
|
-
dark: `${
|
|
227
|
+
light: `${Y}/highlight.js/11.7.0/styles/a11y-light.min.css`,
|
|
228
|
+
dark: `${Y}/highlight.js/11.7.0/styles/a11y-dark.min.css`
|
|
229
229
|
},
|
|
230
230
|
atom: {
|
|
231
|
-
light: `${
|
|
232
|
-
dark: `${
|
|
231
|
+
light: `${Y}/highlight.js/11.7.0/styles/atom-one-light.min.css`,
|
|
232
|
+
dark: `${Y}/highlight.js/11.7.0/styles/atom-one-dark.min.css`
|
|
233
233
|
},
|
|
234
234
|
github: {
|
|
235
|
-
light: `${
|
|
236
|
-
dark: `${
|
|
235
|
+
light: `${Y}/highlight.js/11.7.0/styles/github.min.css`,
|
|
236
|
+
dark: `${Y}/highlight.js/11.7.0/styles/github-dark.min.css`
|
|
237
237
|
},
|
|
238
238
|
gradient: {
|
|
239
|
-
light: `${
|
|
240
|
-
dark: `${
|
|
239
|
+
light: `${Y}/highlight.js/11.7.0/styles/gradient-light.min.css`,
|
|
240
|
+
dark: `${Y}/highlight.js/11.7.0/styles/gradient-dark.min.css`
|
|
241
241
|
},
|
|
242
242
|
kimbie: {
|
|
243
|
-
light: `${
|
|
244
|
-
dark: `${
|
|
243
|
+
light: `${Y}/highlight.js/11.7.0/styles/kimbie-light.min.css`,
|
|
244
|
+
dark: `${Y}/highlight.js/11.7.0/styles/kimbie-dark.min.css`
|
|
245
245
|
},
|
|
246
246
|
paraiso: {
|
|
247
|
-
light: `${
|
|
248
|
-
dark: `${
|
|
247
|
+
light: `${Y}/highlight.js/11.7.0/styles/paraiso-light.min.css`,
|
|
248
|
+
dark: `${Y}/highlight.js/11.7.0/styles/paraiso-dark.min.css`
|
|
249
249
|
},
|
|
250
250
|
qtcreator: {
|
|
251
|
-
light: `${
|
|
252
|
-
dark: `${
|
|
251
|
+
light: `${Y}/highlight.js/11.7.0/styles/qtcreator-light.min.css`,
|
|
252
|
+
dark: `${Y}/highlight.js/11.7.0/styles/qtcreator-dark.min.css`
|
|
253
253
|
},
|
|
254
254
|
stackoverflow: {
|
|
255
|
-
light: `${
|
|
256
|
-
dark: `${
|
|
255
|
+
light: `${Y}/highlight.js/11.7.0/styles/stackoverflow-light.min.css`,
|
|
256
|
+
dark: `${Y}/highlight.js/11.7.0/styles/stackoverflow-dark.min.css`
|
|
257
257
|
}
|
|
258
258
|
}, te = {
|
|
259
259
|
markedRenderer: (s) => s,
|
|
@@ -299,11 +299,11 @@ class ci {
|
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
const x = new ci(),
|
|
302
|
+
const x = new ci(), Oe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
303
303
|
s.setSelectionRange ? setTimeout(() => {
|
|
304
304
|
s.setSelectionRange(e, t), s.focus(), n(!0);
|
|
305
305
|
}, 0) : (console.error("Can not reset position!"), i());
|
|
306
|
-
}),
|
|
306
|
+
}), Xt = (s, e, t) => {
|
|
307
307
|
const { deviationStart: n = 0, deviationEnd: i = 0, direct: l = !1, select: r = !1 } = t;
|
|
308
308
|
let o = "";
|
|
309
309
|
if (s.selectionStart || s.selectionStart === 0) {
|
|
@@ -311,7 +311,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
311
311
|
prefixVal: h = s.value.substring(0, c),
|
|
312
312
|
subfixVal: m = s.value.substring(f, s.value.length)
|
|
313
313
|
} = t;
|
|
314
|
-
o = h + e + m,
|
|
314
|
+
o = h + e + m, Oe(
|
|
315
315
|
s,
|
|
316
316
|
// 选中值开始位置为设定开始,否者为结束位置
|
|
317
317
|
r ? c + n : c + e.length + i,
|
|
@@ -328,7 +328,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
328
328
|
const t = document.createElement("a");
|
|
329
329
|
t.href = s, t.style.display = "none", e.newWindow && (t.target = "_blank"), e.nofollow && (t.rel = "noopener noreferrer"), document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
|
330
330
|
}, bn = (s, e) => {
|
|
331
|
-
const t =
|
|
331
|
+
const t = Kt(() => {
|
|
332
332
|
s.removeEventListener("scroll", n), s.addEventListener("scroll", n), e.removeEventListener("scroll", n), e.addEventListener("scroll", n);
|
|
333
333
|
}, 50), n = (i) => {
|
|
334
334
|
const l = s.clientHeight, r = e.clientHeight, o = s.scrollHeight, c = e.scrollHeight, f = (o - l) / (c - r);
|
|
@@ -362,14 +362,14 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
362
362
|
}
|
|
363
363
|
return null;
|
|
364
364
|
}, kn = (s) => {
|
|
365
|
-
if (!s
|
|
365
|
+
if (!s)
|
|
366
366
|
return s;
|
|
367
367
|
const e = s.split(`
|
|
368
368
|
`), t = ['<span rn-wrapper aria-hidden="true">'];
|
|
369
369
|
return e.forEach(() => {
|
|
370
370
|
t.push("<span></span>");
|
|
371
371
|
}), t.push("</span>"), `<span class="code-block">${s}</span>${t.join("")}`;
|
|
372
|
-
},
|
|
372
|
+
}, Kt = (s, e = 200) => {
|
|
373
373
|
let t = 0;
|
|
374
374
|
return (...n) => new Promise((i) => {
|
|
375
375
|
t && (clearTimeout(t), i("cancel")), t = window.setTimeout(() => {
|
|
@@ -424,16 +424,18 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
424
424
|
return s.addEventListener("mousedown", t), () => {
|
|
425
425
|
s.removeEventListener("mousedown", t);
|
|
426
426
|
};
|
|
427
|
-
},
|
|
428
|
-
const t = document.getElementById(s.id), n =
|
|
429
|
-
|
|
427
|
+
}, Ce = (s, e = "") => {
|
|
428
|
+
const t = document.getElementById(s.id), n = s.onload;
|
|
429
|
+
s.onload = null;
|
|
430
|
+
const i = function(l) {
|
|
431
|
+
typeof n == "function" && n.bind(this)(l), s.removeEventListener("load", i);
|
|
430
432
|
};
|
|
431
|
-
t ? e !== "" &&
|
|
432
|
-
}, vi =
|
|
433
|
+
t ? e !== "" && (t.addEventListener("load", i), Reflect.get(window, e) && t.dispatchEvent(new Event("load"))) : (s.addEventListener("load", i), document.head.appendChild(s));
|
|
434
|
+
}, vi = Kt((s, e, t) => {
|
|
433
435
|
const n = document.getElementById(s);
|
|
434
436
|
n && n.setAttribute(e, t);
|
|
435
|
-
}, 10),
|
|
436
|
-
const { editorId: t, noPrettier: n, previewOnly: i } = s, l =
|
|
437
|
+
}, 10), Nt = "onSave", on = "changeCatalogVisible", jn = "changeFullscreen", xn = "pageFullscreenChanged", $n = "fullscreenChanged", Qt = "previewChanged", Sn = "htmlPreviewChanged", Cn = "catalogVisibleChanged", Pn = "textareaFocus", bi = (s, e) => {
|
|
438
|
+
const { editorId: t, noPrettier: n, previewOnly: i } = s, l = ke({
|
|
437
439
|
// 是否已编译成html
|
|
438
440
|
buildFinished: !1,
|
|
439
441
|
// 存储当前最新的html
|
|
@@ -443,7 +445,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
443
445
|
if (x.emit(t, "selectTextChange"), o.ctrlKey || o.metaKey)
|
|
444
446
|
switch (o.code) {
|
|
445
447
|
case "KeyS": {
|
|
446
|
-
o.shiftKey ? x.emit(t, "replace", "strikeThrough") : (x.emit(t,
|
|
448
|
+
o.shiftKey ? x.emit(t, "replace", "strikeThrough") : (x.emit(t, Nt, s.modelValue), o.preventDefault());
|
|
447
449
|
break;
|
|
448
450
|
}
|
|
449
451
|
case "KeyB": {
|
|
@@ -555,7 +557,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
555
557
|
else
|
|
556
558
|
o.code === "Tab" && (o.preventDefault(), o.shiftKey ? x.emit(t, "replace", "shiftTab") : x.emit(t, "replace", "tab"));
|
|
557
559
|
};
|
|
558
|
-
|
|
560
|
+
W(
|
|
559
561
|
() => s.modelValue,
|
|
560
562
|
() => {
|
|
561
563
|
l.buildFinished = !1;
|
|
@@ -567,7 +569,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
567
569
|
l.buildFinished = !0, l.html = o;
|
|
568
570
|
}
|
|
569
571
|
}), x.on(t, {
|
|
570
|
-
name:
|
|
572
|
+
name: Nt,
|
|
571
573
|
callback() {
|
|
572
574
|
const o = new Promise((c) => {
|
|
573
575
|
if (l.buildFinished)
|
|
@@ -585,18 +587,18 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
585
587
|
s.onSave ? s.onSave(s.modelValue, o) : e.emit("onSave", s.modelValue, o);
|
|
586
588
|
}
|
|
587
589
|
}));
|
|
588
|
-
}),
|
|
590
|
+
}), $t(() => {
|
|
589
591
|
i || window.removeEventListener("keydown", r);
|
|
590
592
|
});
|
|
591
593
|
}, ki = (s) => {
|
|
592
594
|
var l;
|
|
593
595
|
const { editorId: e, previewOnly: t } = s, n = (l = te == null ? void 0 : te.editorExtensions) == null ? void 0 : l.highlight;
|
|
594
|
-
|
|
596
|
+
Re("editorId", e), Re("tabWidth", s.tabWidth), Re(
|
|
595
597
|
"theme",
|
|
596
|
-
|
|
597
|
-
),
|
|
598
|
+
Te(() => s.theme)
|
|
599
|
+
), Re(
|
|
598
600
|
"highlight",
|
|
599
|
-
|
|
601
|
+
Te(() => {
|
|
600
602
|
const r = {
|
|
601
603
|
...vn,
|
|
602
604
|
...n == null ? void 0 : n.css
|
|
@@ -606,35 +608,35 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
606
608
|
css: r[s.codeTheme] ? r[s.codeTheme][o] : vn.atom[o]
|
|
607
609
|
};
|
|
608
610
|
})
|
|
609
|
-
),
|
|
610
|
-
const i =
|
|
611
|
+
), Re("historyLength", s.historyLength), Re("previewOnly", t), Re("showCodeRowNumber", s.showCodeRowNumber);
|
|
612
|
+
const i = Te(() => {
|
|
611
613
|
var o;
|
|
612
614
|
const r = {
|
|
613
|
-
...
|
|
615
|
+
...gn,
|
|
614
616
|
...(o = te == null ? void 0 : te.editorConfig) == null ? void 0 : o.languageUserDefined
|
|
615
617
|
};
|
|
616
|
-
return r[s.language] ? r[s.language] :
|
|
618
|
+
return r[s.language] ? r[s.language] : gn["zh-CN"];
|
|
617
619
|
});
|
|
618
|
-
|
|
620
|
+
Re("usedLanguageText", i), Re(
|
|
619
621
|
"previewTheme",
|
|
620
|
-
|
|
622
|
+
Te(() => s.previewTheme)
|
|
621
623
|
);
|
|
622
624
|
}, yi = (s) => {
|
|
623
625
|
var f, h, m, v, g, $;
|
|
624
626
|
const { noPrettier: e, previewOnly: t, noIconfont: n, noUploadImg: i } = s, { editorExtensions: l } = te, r = e || !!((h = (f = te.editorExtensions) == null ? void 0 : f.prettier) != null && h.prettierInstance), o = e || !!((v = (m = te.editorExtensions) == null ? void 0 : m.prettier) != null && v.parserMarkdownInstance), c = i || !!(($ = (g = te.editorExtensions) == null ? void 0 : g.cropper) != null && $.instance);
|
|
625
627
|
ie(() => {
|
|
626
|
-
var
|
|
628
|
+
var T, z, M, A;
|
|
627
629
|
const b = document.createElement("script");
|
|
628
630
|
b.src = (l == null ? void 0 : l.iconfont) || si, b.id = `${d}-icon`;
|
|
629
|
-
const
|
|
630
|
-
|
|
631
|
+
const y = document.createElement("script"), p = document.createElement("script");
|
|
632
|
+
y.src = ((T = l == null ? void 0 : l.prettier) == null ? void 0 : T.standaloneJs) || fn.main, y.id = `${d}-prettier`, p.src = ((z = l == null ? void 0 : l.prettier) == null ? void 0 : z.parserMarkdownJs) || fn.markdown, p.id = `${d}-prettierMD`;
|
|
631
633
|
const w = document.createElement("link");
|
|
632
|
-
w.rel = "stylesheet", w.href = ((M = l == null ? void 0 : l.cropper) == null ? void 0 : M.css) ||
|
|
634
|
+
w.rel = "stylesheet", w.href = ((M = l == null ? void 0 : l.cropper) == null ? void 0 : M.css) || mn.css, w.id = `${d}-cropperCss`;
|
|
633
635
|
const S = document.createElement("script");
|
|
634
|
-
S.src = ((
|
|
636
|
+
S.src = ((A = l == null ? void 0 : l.cropper) == null ? void 0 : A.js) || mn.js, S.id = `${d}-cropper`, n || Ce(b), t || (c || (Ce(w), Ce(S)), r || Ce(y), o || Ce(p));
|
|
635
637
|
});
|
|
636
638
|
}, wi = (s, e) => {
|
|
637
|
-
const { editorId: t, previewOnly: n } = s, i =
|
|
639
|
+
const { editorId: t, previewOnly: n } = s, i = ke({
|
|
638
640
|
pageFullscreen: s.pageFullscreen,
|
|
639
641
|
fullscreen: !1,
|
|
640
642
|
preview: s.preview,
|
|
@@ -646,7 +648,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
646
648
|
const o = () => {
|
|
647
649
|
i.pageFullscreen || i.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = r;
|
|
648
650
|
};
|
|
649
|
-
return
|
|
651
|
+
return W(() => [i.pageFullscreen, i.fullscreen], o), ie(() => {
|
|
650
652
|
n || x.on(t, {
|
|
651
653
|
name: "uploadImage",
|
|
652
654
|
callback(c, f) {
|
|
@@ -664,37 +666,37 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
664
666
|
const { editorId: e } = s, t = ne(!1);
|
|
665
667
|
ie(() => {
|
|
666
668
|
x.on(e, {
|
|
667
|
-
name:
|
|
669
|
+
name: on,
|
|
668
670
|
callback: (i) => {
|
|
669
671
|
i === void 0 ? t.value = !t.value : t.value = i;
|
|
670
672
|
}
|
|
671
673
|
});
|
|
672
674
|
});
|
|
673
|
-
const n =
|
|
675
|
+
const n = Te(() => !s.toolbarsExclude.includes("catalog") && s.toolbars.includes("catalog"));
|
|
674
676
|
return [t, n];
|
|
675
677
|
}, $i = (s, e, t, n, i) => {
|
|
676
678
|
const { editorId: l } = s;
|
|
677
|
-
|
|
679
|
+
W(
|
|
678
680
|
() => n.pageFullscreen,
|
|
679
681
|
(o) => {
|
|
680
682
|
x.emit(l, xn, o);
|
|
681
683
|
}
|
|
682
|
-
),
|
|
684
|
+
), W(
|
|
683
685
|
() => n.fullscreen,
|
|
684
686
|
(o) => {
|
|
685
687
|
x.emit(l, $n, o);
|
|
686
688
|
}
|
|
687
|
-
),
|
|
689
|
+
), W(
|
|
688
690
|
() => n.preview,
|
|
689
691
|
(o) => {
|
|
690
|
-
x.emit(l,
|
|
692
|
+
x.emit(l, Qt, o);
|
|
691
693
|
}
|
|
692
|
-
),
|
|
694
|
+
), W(
|
|
693
695
|
() => n.htmlPreview,
|
|
694
696
|
(o) => {
|
|
695
697
|
x.emit(l, Sn, o);
|
|
696
698
|
}
|
|
697
|
-
),
|
|
699
|
+
), W(t, (o) => {
|
|
698
700
|
x.emit(l, Cn, o);
|
|
699
701
|
});
|
|
700
702
|
const r = {
|
|
@@ -720,7 +722,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
720
722
|
}
|
|
721
723
|
case "preview": {
|
|
722
724
|
x.on(l, {
|
|
723
|
-
name:
|
|
725
|
+
name: Qt,
|
|
724
726
|
callback(f) {
|
|
725
727
|
c(f);
|
|
726
728
|
}
|
|
@@ -760,10 +762,10 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
760
762
|
i("htmlPreview", o);
|
|
761
763
|
},
|
|
762
764
|
toggleCatalog(o) {
|
|
763
|
-
x.emit(l,
|
|
765
|
+
x.emit(l, on, o);
|
|
764
766
|
},
|
|
765
767
|
triggerSave() {
|
|
766
|
-
x.emit(l,
|
|
768
|
+
x.emit(l, Nt);
|
|
767
769
|
},
|
|
768
770
|
insert(o) {
|
|
769
771
|
x.emit(l, "replace", "universal", { generate: o });
|
|
@@ -780,7 +782,7 @@ const Si = /* @__PURE__ */ ae({
|
|
|
780
782
|
class: `${d}-divider`
|
|
781
783
|
}, null);
|
|
782
784
|
}
|
|
783
|
-
}),
|
|
785
|
+
}), Ee = ({
|
|
784
786
|
instance: s,
|
|
785
787
|
ctx: e,
|
|
786
788
|
props: t = {}
|
|
@@ -811,10 +813,10 @@ const Ci = () => ({
|
|
|
811
813
|
type: String,
|
|
812
814
|
default: "html"
|
|
813
815
|
}
|
|
814
|
-
}),
|
|
816
|
+
}), it = /* @__PURE__ */ ae({
|
|
815
817
|
props: Ci(),
|
|
816
818
|
setup(s, e) {
|
|
817
|
-
const t = `${d}-dropdown-hidden`, n =
|
|
819
|
+
const t = `${d}-dropdown-hidden`, n = ke({
|
|
818
820
|
overlayClass: [t],
|
|
819
821
|
overlayStyle: {},
|
|
820
822
|
triggerHover: !1,
|
|
@@ -822,16 +824,16 @@ const Ci = () => ({
|
|
|
822
824
|
}), i = ne(), l = ne(), r = () => {
|
|
823
825
|
var S;
|
|
824
826
|
s.trigger === "hover" && (n.triggerHover = !0);
|
|
825
|
-
const m = i.value, v = l.value, g = m.getBoundingClientRect(), $ = m.offsetTop, b = m.offsetLeft,
|
|
827
|
+
const m = i.value, v = l.value, g = m.getBoundingClientRect(), $ = m.offsetTop, b = m.offsetLeft, y = g.height, p = g.width, w = ((S = document.querySelector(s.relative)) == null ? void 0 : S.scrollLeft) || 0;
|
|
826
828
|
n.overlayStyle = {
|
|
827
829
|
...n.overlayStyle,
|
|
828
|
-
top: $ +
|
|
830
|
+
top: $ + y + "px",
|
|
829
831
|
left: b - v.offsetWidth / 2 + p / 2 - w + "px"
|
|
830
832
|
}, s.onChange(!0);
|
|
831
833
|
}, o = () => {
|
|
832
834
|
n.overlayHover = !0;
|
|
833
835
|
};
|
|
834
|
-
|
|
836
|
+
W(() => s.visible, (m) => {
|
|
835
837
|
m ? n.overlayClass = n.overlayClass.filter((v) => v !== t) : n.overlayClass.push(t);
|
|
836
838
|
});
|
|
837
839
|
const c = (m) => {
|
|
@@ -846,12 +848,12 @@ const Ci = () => ({
|
|
|
846
848
|
};
|
|
847
849
|
return ie(() => {
|
|
848
850
|
s.trigger === "click" ? (i.value.addEventListener("click", r), document.addEventListener("click", c)) : (i.value.addEventListener("mouseenter", r), i.value.addEventListener("mouseleave", h), l.value.addEventListener("mouseenter", o), l.value.addEventListener("mouseleave", h));
|
|
849
|
-
}),
|
|
851
|
+
}), $t(() => {
|
|
850
852
|
s.trigger === "click" ? (i.value.removeEventListener("click", r), document.removeEventListener("click", c)) : (i.value.removeEventListener("mouseenter", r), i.value.removeEventListener("mouseleave", h), l.value.removeEventListener("mouseenter", o), l.value.removeEventListener("mouseleave", h));
|
|
851
853
|
}), () => {
|
|
852
|
-
const m =
|
|
854
|
+
const m = Ee({
|
|
853
855
|
ctx: e
|
|
854
|
-
}), v =
|
|
856
|
+
}), v = Ee({
|
|
855
857
|
props: s,
|
|
856
858
|
ctx: e
|
|
857
859
|
}, "overlay"), g = ei(m instanceof Array ? m[0] : m, {
|
|
@@ -905,13 +907,13 @@ const Ti = () => ({
|
|
|
905
907
|
class: {
|
|
906
908
|
type: String
|
|
907
909
|
}
|
|
908
|
-
}),
|
|
910
|
+
}), rn = /* @__PURE__ */ ae({
|
|
909
911
|
props: Ti(),
|
|
910
912
|
setup(s, e) {
|
|
911
913
|
const t = ne(s.visible), n = ne([`${d}-modal`]), i = ne(), l = ne();
|
|
912
914
|
let r = () => {
|
|
913
915
|
};
|
|
914
|
-
const o =
|
|
916
|
+
const o = ke({
|
|
915
917
|
initPos: {
|
|
916
918
|
left: "0px",
|
|
917
919
|
top: "0px"
|
|
@@ -920,7 +922,7 @@ const Ti = () => ({
|
|
|
920
922
|
left: "0px",
|
|
921
923
|
top: "0px"
|
|
922
924
|
}
|
|
923
|
-
}), c =
|
|
925
|
+
}), c = Te(() => s.isFullscreen ? {
|
|
924
926
|
width: "100%",
|
|
925
927
|
height: "100%"
|
|
926
928
|
} : {
|
|
@@ -931,14 +933,14 @@ const Ti = () => ({
|
|
|
931
933
|
r = wn(l.value, (f, h) => {
|
|
932
934
|
o.initPos.left = f + "px", o.initPos.top = h + "px";
|
|
933
935
|
});
|
|
934
|
-
}),
|
|
936
|
+
}), $t(() => {
|
|
935
937
|
r();
|
|
936
|
-
}),
|
|
938
|
+
}), W(() => s.isFullscreen, (f) => {
|
|
937
939
|
f ? r() : r = wn(l.value, (h, m) => {
|
|
938
940
|
o.initPos.left = h + "px", o.initPos.top = m + "px";
|
|
939
941
|
});
|
|
940
|
-
}),
|
|
941
|
-
f ? (n.value.push("zoom-in"), t.value = f,
|
|
942
|
+
}), W(() => s.visible, (f) => {
|
|
943
|
+
f ? (n.value.push("zoom-in"), t.value = f, ut(() => {
|
|
942
944
|
const h = i.value.offsetWidth / 2, m = i.value.offsetHeight / 2, v = document.documentElement.clientWidth / 2, g = document.documentElement.clientHeight / 2;
|
|
943
945
|
o.initPos.left = v - h + "px", o.initPos.top = g - m + "px";
|
|
944
946
|
}), setTimeout(() => {
|
|
@@ -947,9 +949,9 @@ const Ti = () => ({
|
|
|
947
949
|
n.value = n.value.filter((h) => h !== "zoom-out"), t.value = f;
|
|
948
950
|
}, 130));
|
|
949
951
|
}), () => {
|
|
950
|
-
const f =
|
|
952
|
+
const f = Ee({
|
|
951
953
|
ctx: e
|
|
952
|
-
}), h =
|
|
954
|
+
}), h = Ee({
|
|
953
955
|
props: s,
|
|
954
956
|
ctx: e
|
|
955
957
|
}, "title");
|
|
@@ -1023,7 +1025,7 @@ const Ti = () => ({
|
|
|
1023
1025
|
}), zi = /* @__PURE__ */ ae({
|
|
1024
1026
|
props: Ei(),
|
|
1025
1027
|
setup(s) {
|
|
1026
|
-
const e =
|
|
1028
|
+
const e = N("usedLanguageText"), t = N("editorId"), n = Te(() => {
|
|
1027
1029
|
var l, r;
|
|
1028
1030
|
switch (s.type) {
|
|
1029
1031
|
case "link":
|
|
@@ -1033,15 +1035,15 @@ const Ti = () => ({
|
|
|
1033
1035
|
default:
|
|
1034
1036
|
return "";
|
|
1035
1037
|
}
|
|
1036
|
-
}), i =
|
|
1038
|
+
}), i = ke({
|
|
1037
1039
|
desc: "",
|
|
1038
1040
|
url: ""
|
|
1039
1041
|
});
|
|
1040
|
-
return
|
|
1042
|
+
return W(() => s.visible, (l) => {
|
|
1041
1043
|
l || setTimeout(() => {
|
|
1042
1044
|
i.desc = "", i.url = "";
|
|
1043
1045
|
}, 200);
|
|
1044
|
-
}), () => u(
|
|
1046
|
+
}), () => u(rn, {
|
|
1045
1047
|
title: n.value,
|
|
1046
1048
|
visible: s.visible,
|
|
1047
1049
|
onClose: s.onCancel
|
|
@@ -1110,9 +1112,9 @@ const _i = () => ({
|
|
|
1110
1112
|
props: _i(),
|
|
1111
1113
|
setup(s) {
|
|
1112
1114
|
var h, m;
|
|
1113
|
-
const e =
|
|
1115
|
+
const e = N("usedLanguageText"), t = N("editorId");
|
|
1114
1116
|
let n = (m = (h = te == null ? void 0 : te.editorExtensions) == null ? void 0 : h.cropper) == null ? void 0 : m.instance;
|
|
1115
|
-
const i = ne(), l = ne(), r = ne(), o =
|
|
1117
|
+
const i = ne(), l = ne(), r = ne(), o = ke({
|
|
1116
1118
|
cropperInited: !1,
|
|
1117
1119
|
imgSelected: !1,
|
|
1118
1120
|
imgSrc: "",
|
|
@@ -1120,7 +1122,7 @@ const _i = () => ({
|
|
|
1120
1122
|
isFullscreen: !1
|
|
1121
1123
|
});
|
|
1122
1124
|
let c = null;
|
|
1123
|
-
|
|
1125
|
+
W(() => s.visible, () => {
|
|
1124
1126
|
s.visible && !o.cropperInited && (n = n || window.Cropper, i.value.onchange = () => {
|
|
1125
1127
|
if (!n) {
|
|
1126
1128
|
x.emit(t, "errorCatcher", {
|
|
@@ -1133,7 +1135,7 @@ const _i = () => ({
|
|
|
1133
1135
|
if (o.imgSelected = !0, (v == null ? void 0 : v.length) > 0) {
|
|
1134
1136
|
const g = new FileReader();
|
|
1135
1137
|
g.onload = ($) => {
|
|
1136
|
-
o.imgSrc = $.target.result,
|
|
1138
|
+
o.imgSrc = $.target.result, ut(() => {
|
|
1137
1139
|
c = new n(l.value, {
|
|
1138
1140
|
viewMode: 2,
|
|
1139
1141
|
preview: `.${d}-clip-preview-target`
|
|
@@ -1143,10 +1145,10 @@ const _i = () => ({
|
|
|
1143
1145
|
}, g.readAsDataURL(v[0]);
|
|
1144
1146
|
}
|
|
1145
1147
|
});
|
|
1146
|
-
}),
|
|
1148
|
+
}), W(() => [o.imgSelected], () => {
|
|
1147
1149
|
r.value.style = "";
|
|
1148
|
-
}),
|
|
1149
|
-
|
|
1150
|
+
}), W(() => o.isFullscreen, () => {
|
|
1151
|
+
ut(() => {
|
|
1150
1152
|
c == null || c.destroy(), r.value.style = "", l.value && (c = new n(l.value, {
|
|
1151
1153
|
viewMode: 2,
|
|
1152
1154
|
preview: `.${d}-clip-preview-target`
|
|
@@ -1159,7 +1161,7 @@ const _i = () => ({
|
|
|
1159
1161
|
};
|
|
1160
1162
|
return () => {
|
|
1161
1163
|
var v;
|
|
1162
|
-
return u(
|
|
1164
|
+
return u(rn, {
|
|
1163
1165
|
class: `${d}-modal-clip`,
|
|
1164
1166
|
title: (v = e.value.clipModalTips) == null ? void 0 : v.title,
|
|
1165
1167
|
visible: s.visible,
|
|
@@ -1260,7 +1262,7 @@ const _i = () => ({
|
|
|
1260
1262
|
}), Li = /* @__PURE__ */ ae({
|
|
1261
1263
|
props: Ii(),
|
|
1262
1264
|
setup(s) {
|
|
1263
|
-
return () => u(
|
|
1265
|
+
return () => u(Wt, null, [u(zi, {
|
|
1264
1266
|
type: s.type,
|
|
1265
1267
|
visible: s.linkVisible,
|
|
1266
1268
|
onOk: s.onOk,
|
|
@@ -1273,7 +1275,7 @@ const _i = () => ({
|
|
|
1273
1275
|
}
|
|
1274
1276
|
}), Fi = (s) => {
|
|
1275
1277
|
var c, f, h, m;
|
|
1276
|
-
const e =
|
|
1278
|
+
const e = N("editorId");
|
|
1277
1279
|
let t = (f = (c = te.editorExtensions) == null ? void 0 : c.screenfull) == null ? void 0 : f.instance;
|
|
1278
1280
|
const n = (m = (h = te.editorExtensions) == null ? void 0 : h.screenfull) == null ? void 0 : m.js, i = ne(!1), l = (v) => {
|
|
1279
1281
|
if (!t) {
|
|
@@ -1294,7 +1296,7 @@ const _i = () => ({
|
|
|
1294
1296
|
return ie(() => {
|
|
1295
1297
|
if (r(), !t) {
|
|
1296
1298
|
const v = document.createElement("script");
|
|
1297
|
-
v.src = n || oi, v.onload = o, v.id = `${d}-screenfull`,
|
|
1299
|
+
v.src = n || oi, v.onload = o, v.id = `${d}-screenfull`, Ce(v, "screenfull");
|
|
1298
1300
|
}
|
|
1299
1301
|
}), ie(() => {
|
|
1300
1302
|
x.on(e, {
|
|
@@ -1316,7 +1318,7 @@ const _i = () => ({
|
|
|
1316
1318
|
name: "TableShape",
|
|
1317
1319
|
props: Ri(),
|
|
1318
1320
|
setup(s) {
|
|
1319
|
-
const e =
|
|
1321
|
+
const e = ke({
|
|
1320
1322
|
x: -1,
|
|
1321
1323
|
y: -1
|
|
1322
1324
|
});
|
|
@@ -1386,9 +1388,9 @@ const _i = () => ({
|
|
|
1386
1388
|
name: "MDEditorToolbar",
|
|
1387
1389
|
props: Di(),
|
|
1388
1390
|
setup(s) {
|
|
1389
|
-
const e =
|
|
1391
|
+
const e = N("editorId"), t = N("usedLanguageText"), {
|
|
1390
1392
|
fullscreenHandler: n
|
|
1391
|
-
} = Fi(s), i = `${e}-toolbar-wrapper`, l =
|
|
1393
|
+
} = Fi(s), i = `${e}-toolbar-wrapper`, l = ke({
|
|
1392
1394
|
title: !1,
|
|
1393
1395
|
catalog: !1,
|
|
1394
1396
|
// 图片上传下拉
|
|
@@ -1400,7 +1402,7 @@ const _i = () => ({
|
|
|
1400
1402
|
katex: !1
|
|
1401
1403
|
}), r = (g, $) => {
|
|
1402
1404
|
x.emit(e, "replace", g, $);
|
|
1403
|
-
}, o =
|
|
1405
|
+
}, o = ke({
|
|
1404
1406
|
type: "link",
|
|
1405
1407
|
linkVisible: !1,
|
|
1406
1408
|
clipVisible: !1
|
|
@@ -1413,9 +1415,9 @@ const _i = () => ({
|
|
|
1413
1415
|
}
|
|
1414
1416
|
});
|
|
1415
1417
|
});
|
|
1416
|
-
const f =
|
|
1417
|
-
const g = s.toolbars.filter((p) => !s.toolbarsExclude.includes(p)), $ = g.indexOf("="), b = $ === -1 ? g : g.slice(0, $ + 1),
|
|
1418
|
-
return [b,
|
|
1418
|
+
const f = Te(() => {
|
|
1419
|
+
const g = s.toolbars.filter((p) => !s.toolbarsExclude.includes(p)), $ = g.indexOf("="), b = $ === -1 ? g : g.slice(0, $ + 1), y = $ === -1 ? [] : g.slice($, Number.MAX_SAFE_INTEGER);
|
|
1420
|
+
return [b, y];
|
|
1419
1421
|
}), h = ne(), m = () => {
|
|
1420
1422
|
x.emit(e, "uploadImage", Array.from(h.value.files || [])), h.value.value = "";
|
|
1421
1423
|
};
|
|
@@ -1423,7 +1425,7 @@ const _i = () => ({
|
|
|
1423
1425
|
h.value.addEventListener("change", m);
|
|
1424
1426
|
});
|
|
1425
1427
|
const v = (g) => {
|
|
1426
|
-
var $, b,
|
|
1428
|
+
var $, b, y, p, w, S, T, z, M, A, k, K, U, q, L, D, B, _, C, j, Z, ee, se, be, ht, Ke, Me, Be, St, Ct, Ge, Tt, Et, Je, et, zt, _t, tt, At, It, ft, dn, hn;
|
|
1427
1429
|
if (Dn.includes(g))
|
|
1428
1430
|
switch (g) {
|
|
1429
1431
|
case "-":
|
|
@@ -1457,7 +1459,7 @@ const _i = () => ({
|
|
|
1457
1459
|
case "italic":
|
|
1458
1460
|
return u("div", {
|
|
1459
1461
|
class: `${d}-toolbar-item`,
|
|
1460
|
-
title: (
|
|
1462
|
+
title: (y = t.value.toolbarTips) == null ? void 0 : y.italic,
|
|
1461
1463
|
onClick: () => {
|
|
1462
1464
|
r("italic");
|
|
1463
1465
|
}
|
|
@@ -1481,11 +1483,11 @@ const _i = () => ({
|
|
|
1481
1483
|
"xlink:href": "#md-editor-icon-strike-through"
|
|
1482
1484
|
}, null)])]);
|
|
1483
1485
|
case "title":
|
|
1484
|
-
return u(
|
|
1486
|
+
return u(it, {
|
|
1485
1487
|
relative: `#${i}`,
|
|
1486
1488
|
visible: l.title,
|
|
1487
|
-
onChange: (
|
|
1488
|
-
l.title =
|
|
1489
|
+
onChange: (V) => {
|
|
1490
|
+
l.title = V;
|
|
1489
1491
|
},
|
|
1490
1492
|
overlay: u("ul", {
|
|
1491
1493
|
class: `${d}-menu`,
|
|
@@ -1507,12 +1509,12 @@ const _i = () => ({
|
|
|
1507
1509
|
onClick: () => {
|
|
1508
1510
|
r("h3");
|
|
1509
1511
|
}
|
|
1510
|
-
}, [(
|
|
1512
|
+
}, [(T = t.value.titleItem) == null ? void 0 : T.h3]), u("li", {
|
|
1511
1513
|
class: `${d}-menu-item`,
|
|
1512
1514
|
onClick: () => {
|
|
1513
1515
|
r("h4");
|
|
1514
1516
|
}
|
|
1515
|
-
}, [(
|
|
1517
|
+
}, [(z = t.value.titleItem) == null ? void 0 : z.h4]), u("li", {
|
|
1516
1518
|
class: `${d}-menu-item`,
|
|
1517
1519
|
onClick: () => {
|
|
1518
1520
|
r("h5");
|
|
@@ -1522,13 +1524,13 @@ const _i = () => ({
|
|
|
1522
1524
|
onClick: () => {
|
|
1523
1525
|
r("h6");
|
|
1524
1526
|
}
|
|
1525
|
-
}, [(
|
|
1527
|
+
}, [(A = t.value.titleItem) == null ? void 0 : A.h6])])
|
|
1526
1528
|
}, {
|
|
1527
1529
|
default: () => {
|
|
1528
|
-
var
|
|
1530
|
+
var V;
|
|
1529
1531
|
return [u("div", {
|
|
1530
1532
|
class: `${d}-toolbar-item`,
|
|
1531
|
-
title: (
|
|
1533
|
+
title: (V = t.value.toolbarTips) == null ? void 0 : V.title
|
|
1532
1534
|
}, [u("svg", {
|
|
1533
1535
|
class: `${d}-icon`,
|
|
1534
1536
|
"aria-hidden": "true"
|
|
@@ -1540,7 +1542,7 @@ const _i = () => ({
|
|
|
1540
1542
|
case "sub":
|
|
1541
1543
|
return u("div", {
|
|
1542
1544
|
class: `${d}-toolbar-item`,
|
|
1543
|
-
title: (
|
|
1545
|
+
title: (k = t.value.toolbarTips) == null ? void 0 : k.sub,
|
|
1544
1546
|
onClick: () => {
|
|
1545
1547
|
r("sub");
|
|
1546
1548
|
}
|
|
@@ -1553,7 +1555,7 @@ const _i = () => ({
|
|
|
1553
1555
|
case "sup":
|
|
1554
1556
|
return u("div", {
|
|
1555
1557
|
class: `${d}-toolbar-item`,
|
|
1556
|
-
title: (
|
|
1558
|
+
title: (K = t.value.toolbarTips) == null ? void 0 : K.sup,
|
|
1557
1559
|
onClick: () => {
|
|
1558
1560
|
r("sup");
|
|
1559
1561
|
}
|
|
@@ -1566,7 +1568,7 @@ const _i = () => ({
|
|
|
1566
1568
|
case "quote":
|
|
1567
1569
|
return u("div", {
|
|
1568
1570
|
class: `${d}-toolbar-item`,
|
|
1569
|
-
title: (
|
|
1571
|
+
title: (U = t.value.toolbarTips) == null ? void 0 : U.quote,
|
|
1570
1572
|
onClick: () => {
|
|
1571
1573
|
r("quote");
|
|
1572
1574
|
}
|
|
@@ -1592,7 +1594,7 @@ const _i = () => ({
|
|
|
1592
1594
|
case "orderedList":
|
|
1593
1595
|
return u("div", {
|
|
1594
1596
|
class: `${d}-toolbar-item`,
|
|
1595
|
-
title: (
|
|
1597
|
+
title: (L = t.value.toolbarTips) == null ? void 0 : L.orderedList,
|
|
1596
1598
|
onClick: () => {
|
|
1597
1599
|
r("orderedList");
|
|
1598
1600
|
}
|
|
@@ -1605,7 +1607,7 @@ const _i = () => ({
|
|
|
1605
1607
|
case "task":
|
|
1606
1608
|
return u("div", {
|
|
1607
1609
|
class: `${d}-toolbar-item`,
|
|
1608
|
-
title: (
|
|
1610
|
+
title: (D = t.value.toolbarTips) == null ? void 0 : D.task,
|
|
1609
1611
|
onClick: () => {
|
|
1610
1612
|
r("task");
|
|
1611
1613
|
}
|
|
@@ -1631,7 +1633,7 @@ const _i = () => ({
|
|
|
1631
1633
|
case "code":
|
|
1632
1634
|
return u("div", {
|
|
1633
1635
|
class: `${d}-toolbar-item`,
|
|
1634
|
-
title: (
|
|
1636
|
+
title: (_ = t.value.toolbarTips) == null ? void 0 : _.code,
|
|
1635
1637
|
onClick: () => {
|
|
1636
1638
|
r("code");
|
|
1637
1639
|
}
|
|
@@ -1644,7 +1646,7 @@ const _i = () => ({
|
|
|
1644
1646
|
case "link":
|
|
1645
1647
|
return u("div", {
|
|
1646
1648
|
class: `${d}-toolbar-item`,
|
|
1647
|
-
title: (
|
|
1649
|
+
title: (C = t.value.toolbarTips) == null ? void 0 : C.link,
|
|
1648
1650
|
onClick: () => {
|
|
1649
1651
|
o.type = "link", o.linkVisible = !0;
|
|
1650
1652
|
}
|
|
@@ -1657,7 +1659,7 @@ const _i = () => ({
|
|
|
1657
1659
|
case "image":
|
|
1658
1660
|
return s.noUploadImg ? u("div", {
|
|
1659
1661
|
class: `${d}-toolbar-item`,
|
|
1660
|
-
title: (
|
|
1662
|
+
title: (j = t.value.toolbarTips) == null ? void 0 : j.image,
|
|
1661
1663
|
onClick: () => {
|
|
1662
1664
|
o.type = "image", o.linkVisible = !0;
|
|
1663
1665
|
}
|
|
@@ -1666,11 +1668,11 @@ const _i = () => ({
|
|
|
1666
1668
|
"aria-hidden": "true"
|
|
1667
1669
|
}, [u("use", {
|
|
1668
1670
|
"xlink:href": "#md-editor-icon-image"
|
|
1669
|
-
}, null)])]) : u(
|
|
1671
|
+
}, null)])]) : u(it, {
|
|
1670
1672
|
relative: `#${i}`,
|
|
1671
1673
|
visible: l.image,
|
|
1672
|
-
onChange: (
|
|
1673
|
-
l.image =
|
|
1674
|
+
onChange: (V) => {
|
|
1675
|
+
l.image = V;
|
|
1674
1676
|
},
|
|
1675
1677
|
overlay: u("ul", {
|
|
1676
1678
|
class: `${d}-menu`,
|
|
@@ -1682,23 +1684,23 @@ const _i = () => ({
|
|
|
1682
1684
|
onClick: () => {
|
|
1683
1685
|
o.type = "image", o.linkVisible = !0;
|
|
1684
1686
|
}
|
|
1685
|
-
}, [(
|
|
1687
|
+
}, [(Z = t.value.imgTitleItem) == null ? void 0 : Z.link]), u("li", {
|
|
1686
1688
|
class: `${d}-menu-item`,
|
|
1687
1689
|
onClick: () => {
|
|
1688
1690
|
h.value.click();
|
|
1689
1691
|
}
|
|
1690
|
-
}, [(
|
|
1692
|
+
}, [(ee = t.value.imgTitleItem) == null ? void 0 : ee.upload]), u("li", {
|
|
1691
1693
|
class: `${d}-menu-item`,
|
|
1692
1694
|
onClick: () => {
|
|
1693
1695
|
o.clipVisible = !0;
|
|
1694
1696
|
}
|
|
1695
|
-
}, [(
|
|
1697
|
+
}, [(se = t.value.imgTitleItem) == null ? void 0 : se.clip2upload])])
|
|
1696
1698
|
}, {
|
|
1697
1699
|
default: () => {
|
|
1698
|
-
var
|
|
1700
|
+
var V;
|
|
1699
1701
|
return [u("div", {
|
|
1700
1702
|
class: `${d}-toolbar-item`,
|
|
1701
|
-
title: (
|
|
1703
|
+
title: (V = t.value.toolbarTips) == null ? void 0 : V.image
|
|
1702
1704
|
}, [u("svg", {
|
|
1703
1705
|
class: `${d}-icon`,
|
|
1704
1706
|
"aria-hidden": "true"
|
|
@@ -1708,27 +1710,27 @@ const _i = () => ({
|
|
|
1708
1710
|
}
|
|
1709
1711
|
});
|
|
1710
1712
|
case "table":
|
|
1711
|
-
return u(
|
|
1713
|
+
return u(it, {
|
|
1712
1714
|
relative: `#${i}`,
|
|
1713
1715
|
visible: l.table,
|
|
1714
|
-
onChange: (
|
|
1715
|
-
l.table =
|
|
1716
|
+
onChange: (V) => {
|
|
1717
|
+
l.table = V;
|
|
1716
1718
|
},
|
|
1717
1719
|
key: "bar-table",
|
|
1718
1720
|
overlay: u(Oi, {
|
|
1719
1721
|
tableShape: s.tableShape,
|
|
1720
|
-
onSelected: (
|
|
1722
|
+
onSelected: (V) => {
|
|
1721
1723
|
r("table", {
|
|
1722
|
-
selectedShape:
|
|
1724
|
+
selectedShape: V
|
|
1723
1725
|
});
|
|
1724
1726
|
}
|
|
1725
1727
|
}, null)
|
|
1726
1728
|
}, {
|
|
1727
1729
|
default: () => {
|
|
1728
|
-
var
|
|
1730
|
+
var V;
|
|
1729
1731
|
return [u("div", {
|
|
1730
1732
|
class: `${d}-toolbar-item`,
|
|
1731
|
-
title: (
|
|
1733
|
+
title: (V = t.value.toolbarTips) == null ? void 0 : V.table
|
|
1732
1734
|
}, [u("svg", {
|
|
1733
1735
|
class: `${d}-icon`,
|
|
1734
1736
|
"aria-hidden": "true"
|
|
@@ -1740,7 +1742,7 @@ const _i = () => ({
|
|
|
1740
1742
|
case "revoke":
|
|
1741
1743
|
return u("div", {
|
|
1742
1744
|
class: `${d}-toolbar-item`,
|
|
1743
|
-
title: (
|
|
1745
|
+
title: (be = t.value.toolbarTips) == null ? void 0 : be.revoke,
|
|
1744
1746
|
onClick: () => {
|
|
1745
1747
|
x.emit(e, "ctrlZ");
|
|
1746
1748
|
}
|
|
@@ -1753,7 +1755,7 @@ const _i = () => ({
|
|
|
1753
1755
|
case "next":
|
|
1754
1756
|
return u("div", {
|
|
1755
1757
|
class: `${d}-toolbar-item`,
|
|
1756
|
-
title: (
|
|
1758
|
+
title: (ht = t.value.toolbarTips) == null ? void 0 : ht.next,
|
|
1757
1759
|
onClick: () => {
|
|
1758
1760
|
x.emit(e, "ctrlShiftZ");
|
|
1759
1761
|
}
|
|
@@ -1766,9 +1768,9 @@ const _i = () => ({
|
|
|
1766
1768
|
case "save":
|
|
1767
1769
|
return u("div", {
|
|
1768
1770
|
class: `${d}-toolbar-item`,
|
|
1769
|
-
title: (
|
|
1771
|
+
title: (Ke = t.value.toolbarTips) == null ? void 0 : Ke.save,
|
|
1770
1772
|
onClick: () => {
|
|
1771
|
-
x.emit(e,
|
|
1773
|
+
x.emit(e, Nt);
|
|
1772
1774
|
}
|
|
1773
1775
|
}, [u("svg", {
|
|
1774
1776
|
class: `${d}-icon`,
|
|
@@ -1779,7 +1781,7 @@ const _i = () => ({
|
|
|
1779
1781
|
case "prettier":
|
|
1780
1782
|
return s.noPrettier ? "" : u("div", {
|
|
1781
1783
|
class: `${d}-toolbar-item`,
|
|
1782
|
-
title: (
|
|
1784
|
+
title: (Me = t.value.toolbarTips) == null ? void 0 : Me.prettier,
|
|
1783
1785
|
onClick: () => {
|
|
1784
1786
|
r("prettier");
|
|
1785
1787
|
}
|
|
@@ -1792,7 +1794,7 @@ const _i = () => ({
|
|
|
1792
1794
|
case "pageFullscreen":
|
|
1793
1795
|
return !s.setting.fullscreen && u("div", {
|
|
1794
1796
|
class: `${d}-toolbar-item`,
|
|
1795
|
-
title: (
|
|
1797
|
+
title: (Be = t.value.toolbarTips) == null ? void 0 : Be.pageFullscreen,
|
|
1796
1798
|
onClick: () => {
|
|
1797
1799
|
s.updateSetting("pageFullscreen");
|
|
1798
1800
|
}
|
|
@@ -1805,7 +1807,7 @@ const _i = () => ({
|
|
|
1805
1807
|
case "fullscreen":
|
|
1806
1808
|
return u("div", {
|
|
1807
1809
|
class: `${d}-toolbar-item`,
|
|
1808
|
-
title: (
|
|
1810
|
+
title: (St = t.value.toolbarTips) == null ? void 0 : St.fullscreen,
|
|
1809
1811
|
onClick: () => {
|
|
1810
1812
|
n();
|
|
1811
1813
|
}
|
|
@@ -1818,7 +1820,7 @@ const _i = () => ({
|
|
|
1818
1820
|
case "preview":
|
|
1819
1821
|
return u("div", {
|
|
1820
1822
|
class: `${d}-toolbar-item`,
|
|
1821
|
-
title: (
|
|
1823
|
+
title: (Ct = t.value.toolbarTips) == null ? void 0 : Ct.preview,
|
|
1822
1824
|
onClick: () => {
|
|
1823
1825
|
s.updateSetting("preview");
|
|
1824
1826
|
}
|
|
@@ -1831,7 +1833,7 @@ const _i = () => ({
|
|
|
1831
1833
|
case "htmlPreview":
|
|
1832
1834
|
return u("div", {
|
|
1833
1835
|
class: `${d}-toolbar-item`,
|
|
1834
|
-
title: (
|
|
1836
|
+
title: (Ge = t.value.toolbarTips) == null ? void 0 : Ge.htmlPreview,
|
|
1835
1837
|
onClick: () => {
|
|
1836
1838
|
s.updateSetting("htmlPreview");
|
|
1837
1839
|
}
|
|
@@ -1846,7 +1848,7 @@ const _i = () => ({
|
|
|
1846
1848
|
class: `${d}-toolbar-item`,
|
|
1847
1849
|
title: (Tt = t.value.toolbarTips) == null ? void 0 : Tt.catalog,
|
|
1848
1850
|
onClick: () => {
|
|
1849
|
-
x.emit(e,
|
|
1851
|
+
x.emit(e, on);
|
|
1850
1852
|
},
|
|
1851
1853
|
key: "bar-catalog"
|
|
1852
1854
|
}, [u("svg", {
|
|
@@ -1867,11 +1869,11 @@ const _i = () => ({
|
|
|
1867
1869
|
"xlink:href": "#md-editor-icon-github"
|
|
1868
1870
|
}, null)])]);
|
|
1869
1871
|
case "mermaid":
|
|
1870
|
-
return u(
|
|
1872
|
+
return u(it, {
|
|
1871
1873
|
relative: `#${i}`,
|
|
1872
1874
|
visible: l.mermaid,
|
|
1873
|
-
onChange: (
|
|
1874
|
-
l.mermaid =
|
|
1875
|
+
onChange: (V) => {
|
|
1876
|
+
l.mermaid = V;
|
|
1875
1877
|
},
|
|
1876
1878
|
overlay: u("ul", {
|
|
1877
1879
|
class: `${d}-menu`,
|
|
@@ -1883,12 +1885,12 @@ const _i = () => ({
|
|
|
1883
1885
|
onClick: () => {
|
|
1884
1886
|
r("flow");
|
|
1885
1887
|
}
|
|
1886
|
-
}, [(
|
|
1888
|
+
}, [(Je = t.value.mermaid) == null ? void 0 : Je.flow]), u("li", {
|
|
1887
1889
|
class: `${d}-menu-item`,
|
|
1888
1890
|
onClick: () => {
|
|
1889
1891
|
r("sequence");
|
|
1890
1892
|
}
|
|
1891
|
-
}, [(
|
|
1893
|
+
}, [(et = t.value.mermaid) == null ? void 0 : et.sequence]), u("li", {
|
|
1892
1894
|
class: `${d}-menu-item`,
|
|
1893
1895
|
onClick: () => {
|
|
1894
1896
|
r("gantt");
|
|
@@ -1903,7 +1905,7 @@ const _i = () => ({
|
|
|
1903
1905
|
onClick: () => {
|
|
1904
1906
|
r("state");
|
|
1905
1907
|
}
|
|
1906
|
-
}, [(
|
|
1908
|
+
}, [(tt = t.value.mermaid) == null ? void 0 : tt.state]), u("li", {
|
|
1907
1909
|
class: `${d}-menu-item`,
|
|
1908
1910
|
onClick: () => {
|
|
1909
1911
|
r("pie");
|
|
@@ -1918,14 +1920,14 @@ const _i = () => ({
|
|
|
1918
1920
|
onClick: () => {
|
|
1919
1921
|
r("journey");
|
|
1920
1922
|
}
|
|
1921
|
-
}, [(
|
|
1923
|
+
}, [(ft = t.value.mermaid) == null ? void 0 : ft.journey])]),
|
|
1922
1924
|
key: "bar-mermaid"
|
|
1923
1925
|
}, {
|
|
1924
1926
|
default: () => {
|
|
1925
|
-
var
|
|
1927
|
+
var V;
|
|
1926
1928
|
return [u("div", {
|
|
1927
1929
|
class: `${d}-toolbar-item`,
|
|
1928
|
-
title: (
|
|
1930
|
+
title: (V = t.value.toolbarTips) == null ? void 0 : V.mermaid
|
|
1929
1931
|
}, [u("svg", {
|
|
1930
1932
|
class: `${d}-icon`,
|
|
1931
1933
|
"aria-hidden": "true"
|
|
@@ -1935,11 +1937,11 @@ const _i = () => ({
|
|
|
1935
1937
|
}
|
|
1936
1938
|
});
|
|
1937
1939
|
case "katex":
|
|
1938
|
-
return u(
|
|
1940
|
+
return u(it, {
|
|
1939
1941
|
relative: `#${i}`,
|
|
1940
1942
|
visible: l.katex,
|
|
1941
|
-
onChange: (
|
|
1942
|
-
l.katex =
|
|
1943
|
+
onChange: (V) => {
|
|
1944
|
+
l.katex = V;
|
|
1943
1945
|
},
|
|
1944
1946
|
overlay: u("ul", {
|
|
1945
1947
|
class: `${d}-menu`,
|
|
@@ -1951,19 +1953,19 @@ const _i = () => ({
|
|
|
1951
1953
|
onClick: () => {
|
|
1952
1954
|
r("katexInline");
|
|
1953
1955
|
}
|
|
1954
|
-
}, [(
|
|
1956
|
+
}, [(dn = t.value.katex) == null ? void 0 : dn.inline]), u("li", {
|
|
1955
1957
|
class: `${d}-menu-item`,
|
|
1956
1958
|
onClick: () => {
|
|
1957
1959
|
r("katexBlock");
|
|
1958
1960
|
}
|
|
1959
|
-
}, [(
|
|
1961
|
+
}, [(hn = t.value.katex) == null ? void 0 : hn.block])]),
|
|
1960
1962
|
key: "bar-katex"
|
|
1961
1963
|
}, {
|
|
1962
1964
|
default: () => {
|
|
1963
|
-
var
|
|
1965
|
+
var V;
|
|
1964
1966
|
return [u("div", {
|
|
1965
1967
|
class: `${d}-toolbar-item`,
|
|
1966
|
-
title: (
|
|
1968
|
+
title: (V = t.value.toolbarTips) == null ? void 0 : V.katex
|
|
1967
1969
|
}, [u("svg", {
|
|
1968
1970
|
class: `${d}-icon`,
|
|
1969
1971
|
"aria-hidden": "true"
|
|
@@ -1978,7 +1980,7 @@ const _i = () => ({
|
|
|
1978
1980
|
};
|
|
1979
1981
|
return () => {
|
|
1980
1982
|
const g = f.value[0].map((b) => v(b)), $ = f.value[1].map((b) => v(b));
|
|
1981
|
-
return u(
|
|
1983
|
+
return u(Wt, null, [s.toolbars.length > 0 && u("div", {
|
|
1982
1984
|
class: `${d}-toolbar-wrapper`,
|
|
1983
1985
|
id: i
|
|
1984
1986
|
}, [u("div", {
|
|
@@ -2036,9 +2038,9 @@ function Mn() {
|
|
|
2036
2038
|
xhtml: !1
|
|
2037
2039
|
};
|
|
2038
2040
|
}
|
|
2039
|
-
let
|
|
2041
|
+
let dt = Mn();
|
|
2040
2042
|
function ji(s) {
|
|
2041
|
-
|
|
2043
|
+
dt = s;
|
|
2042
2044
|
}
|
|
2043
2045
|
const Bn = /[&<>"']/, Pi = new RegExp(Bn.source, "g"), Nn = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, Mi = new RegExp(Nn.source, "g"), Bi = {
|
|
2044
2046
|
"&": "&",
|
|
@@ -2047,7 +2049,7 @@ const Bn = /[&<>"']/, Pi = new RegExp(Bn.source, "g"), Nn = /[<>"']|&(?!(#\d{1,7
|
|
|
2047
2049
|
'"': """,
|
|
2048
2050
|
"'": "'"
|
|
2049
2051
|
}, Tn = (s) => Bi[s];
|
|
2050
|
-
function
|
|
2052
|
+
function de(s, e) {
|
|
2051
2053
|
if (e) {
|
|
2052
2054
|
if (Bn.test(s))
|
|
2053
2055
|
return s.replace(Pi, Tn);
|
|
@@ -2060,7 +2062,7 @@ function Un(s) {
|
|
|
2060
2062
|
return s.replace(Ni, (e, t) => (t = t.toLowerCase(), t === "colon" ? ":" : t.charAt(0) === "#" ? t.charAt(1) === "x" ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""));
|
|
2061
2063
|
}
|
|
2062
2064
|
const Ui = /(^|[^\[])\^/g;
|
|
2063
|
-
function
|
|
2065
|
+
function G(s, e) {
|
|
2064
2066
|
s = typeof s == "string" ? s : s.source, e = e || "";
|
|
2065
2067
|
const t = {
|
|
2066
2068
|
replace: (n, i) => (i = i.source || i, i = i.replace(Ui, "$1"), s = s.replace(n, i), t),
|
|
@@ -2094,9 +2096,9 @@ function Zi(s, e) {
|
|
|
2094
2096
|
const t = s.indexOf(":") === -1;
|
|
2095
2097
|
return e.substring(0, 2) === "//" ? t ? e : s.replace(Ki, "$1") + e : e.charAt(0) === "/" ? t ? e : s.replace(Gi, "$1") + e : s + e;
|
|
2096
2098
|
}
|
|
2097
|
-
const
|
|
2099
|
+
const Ut = { exec: function() {
|
|
2098
2100
|
} };
|
|
2099
|
-
function
|
|
2101
|
+
function ze(s) {
|
|
2100
2102
|
let e = 1, t, n;
|
|
2101
2103
|
for (; e < arguments.length; e++) {
|
|
2102
2104
|
t = arguments[e];
|
|
@@ -2164,7 +2166,7 @@ function _n(s, e) {
|
|
|
2164
2166
|
return t + s;
|
|
2165
2167
|
}
|
|
2166
2168
|
function An(s, e, t, n) {
|
|
2167
|
-
const i = e.href, l = e.title ?
|
|
2169
|
+
const i = e.href, l = e.title ? de(e.title) : null, r = s[1].replace(/\\([\[\]])/g, "$1");
|
|
2168
2170
|
if (s[0].charAt(0) !== "!") {
|
|
2169
2171
|
n.state.inLink = !0;
|
|
2170
2172
|
const o = {
|
|
@@ -2182,7 +2184,7 @@ function An(s, e, t, n) {
|
|
|
2182
2184
|
raw: t,
|
|
2183
2185
|
href: i,
|
|
2184
2186
|
title: l,
|
|
2185
|
-
text:
|
|
2187
|
+
text: de(r)
|
|
2186
2188
|
};
|
|
2187
2189
|
}
|
|
2188
2190
|
function Qi(s, e) {
|
|
@@ -2200,9 +2202,9 @@ function Qi(s, e) {
|
|
|
2200
2202
|
}).join(`
|
|
2201
2203
|
`);
|
|
2202
2204
|
}
|
|
2203
|
-
class
|
|
2205
|
+
class an {
|
|
2204
2206
|
constructor(e) {
|
|
2205
|
-
this.options = e ||
|
|
2207
|
+
this.options = e || dt;
|
|
2206
2208
|
}
|
|
2207
2209
|
space(e) {
|
|
2208
2210
|
const t = this.rules.block.newline.exec(e);
|
|
@@ -2280,29 +2282,29 @@ class cn {
|
|
|
2280
2282
|
let t = this.rules.block.list.exec(e);
|
|
2281
2283
|
if (t) {
|
|
2282
2284
|
let n, i, l, r, o, c, f, h, m, v, g, $, b = t[1].trim();
|
|
2283
|
-
const
|
|
2285
|
+
const y = b.length > 1, p = {
|
|
2284
2286
|
type: "list",
|
|
2285
2287
|
raw: "",
|
|
2286
|
-
ordered:
|
|
2287
|
-
start:
|
|
2288
|
+
ordered: y,
|
|
2289
|
+
start: y ? +b.slice(0, -1) : "",
|
|
2288
2290
|
loose: !1,
|
|
2289
2291
|
items: []
|
|
2290
2292
|
};
|
|
2291
|
-
b =
|
|
2293
|
+
b = y ? `\\d{1,9}\\${b.slice(-1)}` : `\\${b}`, this.options.pedantic && (b = y ? b : "[*+-]");
|
|
2292
2294
|
const w = new RegExp(`^( {0,3}${b})((?:[ ][^\\n]*)?(?:\\n|$))`);
|
|
2293
2295
|
for (; e && ($ = !1, !(!(t = w.exec(e)) || this.rules.block.hr.test(e))); ) {
|
|
2294
2296
|
if (n = t[0], e = e.substring(n.length), h = t[2].split(`
|
|
2295
|
-
`, 1)[0].replace(/^\t+/, (
|
|
2297
|
+
`, 1)[0].replace(/^\t+/, (T) => " ".repeat(3 * T.length)), m = e.split(`
|
|
2296
2298
|
`, 1)[0], this.options.pedantic ? (r = 2, g = h.trimLeft()) : (r = t[2].search(/[^ ]/), r = r > 4 ? 1 : r, g = h.slice(r), r += t[1].length), c = !1, !h && /^ *$/.test(m) && (n += m + `
|
|
2297
2299
|
`, e = e.substring(m.length + 1), $ = !0), !$) {
|
|
2298
|
-
const
|
|
2300
|
+
const T = new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), z = new RegExp(`^ {0,${Math.min(3, r - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), M = new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:\`\`\`|~~~)`), A = new RegExp(`^ {0,${Math.min(3, r - 1)}}#`);
|
|
2299
2301
|
for (; e && (v = e.split(`
|
|
2300
|
-
`, 1)[0], m = v, this.options.pedantic && (m = m.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(M.test(m) ||
|
|
2302
|
+
`, 1)[0], m = v, this.options.pedantic && (m = m.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(M.test(m) || A.test(m) || T.test(m) || z.test(e))); ) {
|
|
2301
2303
|
if (m.search(/[^ ]/) >= r || !m.trim())
|
|
2302
2304
|
g += `
|
|
2303
2305
|
` + m.slice(r);
|
|
2304
2306
|
else {
|
|
2305
|
-
if (c || h.search(/[^ ]/) >= 4 || M.test(h) ||
|
|
2307
|
+
if (c || h.search(/[^ ]/) >= 4 || M.test(h) || A.test(h) || z.test(h))
|
|
2306
2308
|
break;
|
|
2307
2309
|
g += `
|
|
2308
2310
|
` + m;
|
|
@@ -2324,8 +2326,8 @@ class cn {
|
|
|
2324
2326
|
const S = p.items.length;
|
|
2325
2327
|
for (o = 0; o < S; o++)
|
|
2326
2328
|
if (this.lexer.state.top = !1, p.items[o].tokens = this.lexer.blockTokens(p.items[o].text, []), !p.loose) {
|
|
2327
|
-
const
|
|
2328
|
-
p.loose =
|
|
2329
|
+
const T = p.items[o].tokens.filter((M) => M.type === "space"), z = T.length > 0 && T.some((M) => /\n.*\n/.test(M.raw));
|
|
2330
|
+
p.loose = z;
|
|
2329
2331
|
}
|
|
2330
2332
|
if (p.loose)
|
|
2331
2333
|
for (o = 0; o < S; o++)
|
|
@@ -2343,7 +2345,7 @@ class cn {
|
|
|
2343
2345
|
text: t[0]
|
|
2344
2346
|
};
|
|
2345
2347
|
if (this.options.sanitize) {
|
|
2346
|
-
const i = this.options.sanitizer ? this.options.sanitizer(t[0]) :
|
|
2348
|
+
const i = this.options.sanitizer ? this.options.sanitizer(t[0]) : de(t[0]);
|
|
2347
2349
|
n.type = "paragraph", n.text = i, n.tokens = this.lexer.inline(i);
|
|
2348
2350
|
}
|
|
2349
2351
|
return n;
|
|
@@ -2428,7 +2430,7 @@ class cn {
|
|
|
2428
2430
|
return {
|
|
2429
2431
|
type: "escape",
|
|
2430
2432
|
raw: t[0],
|
|
2431
|
-
text:
|
|
2433
|
+
text: de(t[1])
|
|
2432
2434
|
};
|
|
2433
2435
|
}
|
|
2434
2436
|
tag(e) {
|
|
@@ -2439,7 +2441,7 @@ class cn {
|
|
|
2439
2441
|
raw: t[0],
|
|
2440
2442
|
inLink: this.lexer.state.inLink,
|
|
2441
2443
|
inRawBlock: this.lexer.state.inRawBlock,
|
|
2442
|
-
text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(t[0]) :
|
|
2444
|
+
text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(t[0]) : de(t[0]) : t[0]
|
|
2443
2445
|
};
|
|
2444
2446
|
}
|
|
2445
2447
|
link(e) {
|
|
@@ -2533,7 +2535,7 @@ class cn {
|
|
|
2533
2535
|
if (t) {
|
|
2534
2536
|
let n = t[2].replace(/\n/g, " ");
|
|
2535
2537
|
const i = /[^ ]/.test(n), l = /^ /.test(n) && / $/.test(n);
|
|
2536
|
-
return i && l && (n = n.substring(1, n.length - 1)), n =
|
|
2538
|
+
return i && l && (n = n.substring(1, n.length - 1)), n = de(n, !0), {
|
|
2537
2539
|
type: "codespan",
|
|
2538
2540
|
raw: t[0],
|
|
2539
2541
|
text: n
|
|
@@ -2562,7 +2564,7 @@ class cn {
|
|
|
2562
2564
|
const n = this.rules.inline.autolink.exec(e);
|
|
2563
2565
|
if (n) {
|
|
2564
2566
|
let i, l;
|
|
2565
|
-
return n[2] === "@" ? (i =
|
|
2567
|
+
return n[2] === "@" ? (i = de(this.options.mangle ? t(n[1]) : n[1]), l = "mailto:" + i) : (i = de(n[1]), l = i), {
|
|
2566
2568
|
type: "link",
|
|
2567
2569
|
raw: n[0],
|
|
2568
2570
|
text: i,
|
|
@@ -2582,13 +2584,13 @@ class cn {
|
|
|
2582
2584
|
if (n = this.rules.inline.url.exec(e)) {
|
|
2583
2585
|
let i, l;
|
|
2584
2586
|
if (n[2] === "@")
|
|
2585
|
-
i =
|
|
2587
|
+
i = de(this.options.mangle ? t(n[0]) : n[0]), l = "mailto:" + i;
|
|
2586
2588
|
else {
|
|
2587
2589
|
let r;
|
|
2588
2590
|
do
|
|
2589
2591
|
r = n[0], n[0] = this.rules.inline._backpedal.exec(n[0])[0];
|
|
2590
2592
|
while (r !== n[0]);
|
|
2591
|
-
i =
|
|
2593
|
+
i = de(n[0]), n[1] === "www." ? l = "http://" + n[0] : l = n[0];
|
|
2592
2594
|
}
|
|
2593
2595
|
return {
|
|
2594
2596
|
type: "link",
|
|
@@ -2609,7 +2611,7 @@ class cn {
|
|
|
2609
2611
|
const n = this.rules.inline.text.exec(e);
|
|
2610
2612
|
if (n) {
|
|
2611
2613
|
let i;
|
|
2612
|
-
return this.lexer.state.inRawBlock ? i = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(n[0]) :
|
|
2614
|
+
return this.lexer.state.inRawBlock ? i = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(n[0]) : de(n[0]) : n[0] : i = de(this.options.smartypants ? t(n[0]) : n[0]), {
|
|
2613
2615
|
type: "text",
|
|
2614
2616
|
raw: n[0],
|
|
2615
2617
|
text: i
|
|
@@ -2617,7 +2619,7 @@ class cn {
|
|
|
2617
2619
|
}
|
|
2618
2620
|
}
|
|
2619
2621
|
}
|
|
2620
|
-
const
|
|
2622
|
+
const R = {
|
|
2621
2623
|
newline: /^(?: *(?:\n|$))+/,
|
|
2622
2624
|
code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
|
|
2623
2625
|
fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
|
|
@@ -2627,47 +2629,47 @@ const L = {
|
|
|
2627
2629
|
list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,
|
|
2628
2630
|
html: "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",
|
|
2629
2631
|
def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
|
|
2630
|
-
table:
|
|
2632
|
+
table: Ut,
|
|
2631
2633
|
lheading: /^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
2632
2634
|
// regex template, placeholders will be replaced according to different paragraph
|
|
2633
2635
|
// interruption rules of commonmark and the original markdown spec:
|
|
2634
2636
|
_paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
|
|
2635
2637
|
text: /^[^\n]+/
|
|
2636
2638
|
};
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2639
|
+
R._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
|
|
2640
|
+
R._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
|
|
2641
|
+
R.def = G(R.def).replace("label", R._label).replace("title", R._title).getRegex();
|
|
2642
|
+
R.bullet = /(?:[*+-]|\d{1,9}[.)])/;
|
|
2643
|
+
R.listItemStart = G(/^( *)(bull) */).replace("bull", R.bullet).getRegex();
|
|
2644
|
+
R.list = G(R.list).replace(/bull/g, R.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + R.def.source + ")").getRegex();
|
|
2645
|
+
R._tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
|
|
2646
|
+
R._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
|
|
2647
|
+
R.html = G(R.html, "i").replace("comment", R._comment).replace("tag", R._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
|
|
2648
|
+
R.paragraph = G(R._paragraph).replace("hr", R.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", R._tag).getRegex();
|
|
2649
|
+
R.blockquote = G(R.blockquote).replace("paragraph", R.paragraph).getRegex();
|
|
2650
|
+
R.normal = ze({}, R);
|
|
2651
|
+
R.gfm = ze({}, R.normal, {
|
|
2650
2652
|
table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
|
|
2651
2653
|
// Cells
|
|
2652
2654
|
});
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
html:
|
|
2655
|
+
R.gfm.table = G(R.gfm.table).replace("hr", R.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", R._tag).getRegex();
|
|
2656
|
+
R.gfm.paragraph = G(R._paragraph).replace("hr", R.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", R.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", R._tag).getRegex();
|
|
2657
|
+
R.pedantic = ze({}, R.normal, {
|
|
2658
|
+
html: G(
|
|
2657
2659
|
`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
|
|
2658
|
-
).replace("comment",
|
|
2660
|
+
).replace("comment", R._comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
2659
2661
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
2660
2662
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
2661
|
-
fences:
|
|
2663
|
+
fences: Ut,
|
|
2662
2664
|
// fences not supported
|
|
2663
2665
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
2664
|
-
paragraph:
|
|
2665
|
-
]`).replace("lheading",
|
|
2666
|
+
paragraph: G(R.normal._paragraph).replace("hr", R.hr).replace("heading", ` *#{1,6} *[^
|
|
2667
|
+
]`).replace("lheading", R.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
|
|
2666
2668
|
});
|
|
2667
2669
|
const E = {
|
|
2668
2670
|
escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
|
|
2669
2671
|
autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
|
|
2670
|
-
url:
|
|
2672
|
+
url: Ut,
|
|
2671
2673
|
tag: "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",
|
|
2672
2674
|
// CDATA section
|
|
2673
2675
|
link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
|
|
@@ -2684,33 +2686,33 @@ const E = {
|
|
|
2684
2686
|
},
|
|
2685
2687
|
code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
|
|
2686
2688
|
br: /^( {2,}|\\)\n(?!\s*$)/,
|
|
2687
|
-
del:
|
|
2689
|
+
del: Ut,
|
|
2688
2690
|
text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
|
|
2689
2691
|
punctuation: /^([\spunctuation])/
|
|
2690
2692
|
};
|
|
2691
2693
|
E._punctuation = "!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";
|
|
2692
|
-
E.punctuation =
|
|
2694
|
+
E.punctuation = G(E.punctuation).replace(/punctuation/g, E._punctuation).getRegex();
|
|
2693
2695
|
E.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
|
|
2694
2696
|
E.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g;
|
|
2695
|
-
E._comment =
|
|
2696
|
-
E.emStrong.lDelim =
|
|
2697
|
-
E.emStrong.rDelimAst =
|
|
2698
|
-
E.emStrong.rDelimUnd =
|
|
2697
|
+
E._comment = G(R._comment).replace("(?:-->|$)", "-->").getRegex();
|
|
2698
|
+
E.emStrong.lDelim = G(E.emStrong.lDelim).replace(/punct/g, E._punctuation).getRegex();
|
|
2699
|
+
E.emStrong.rDelimAst = G(E.emStrong.rDelimAst, "g").replace(/punct/g, E._punctuation).getRegex();
|
|
2700
|
+
E.emStrong.rDelimUnd = G(E.emStrong.rDelimUnd, "g").replace(/punct/g, E._punctuation).getRegex();
|
|
2699
2701
|
E._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
|
|
2700
2702
|
E._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
|
|
2701
2703
|
E._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
|
|
2702
|
-
E.autolink =
|
|
2704
|
+
E.autolink = G(E.autolink).replace("scheme", E._scheme).replace("email", E._email).getRegex();
|
|
2703
2705
|
E._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
|
|
2704
|
-
E.tag =
|
|
2706
|
+
E.tag = G(E.tag).replace("comment", E._comment).replace("attribute", E._attribute).getRegex();
|
|
2705
2707
|
E._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
|
|
2706
2708
|
E._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
|
|
2707
2709
|
E._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
|
|
2708
|
-
E.link =
|
|
2709
|
-
E.reflink =
|
|
2710
|
-
E.nolink =
|
|
2711
|
-
E.reflinkSearch =
|
|
2712
|
-
E.normal =
|
|
2713
|
-
E.pedantic =
|
|
2710
|
+
E.link = G(E.link).replace("label", E._label).replace("href", E._href).replace("title", E._title).getRegex();
|
|
2711
|
+
E.reflink = G(E.reflink).replace("label", E._label).replace("ref", R._label).getRegex();
|
|
2712
|
+
E.nolink = G(E.nolink).replace("ref", R._label).getRegex();
|
|
2713
|
+
E.reflinkSearch = G(E.reflinkSearch, "g").replace("reflink", E.reflink).replace("nolink", E.nolink).getRegex();
|
|
2714
|
+
E.normal = ze({}, E);
|
|
2715
|
+
E.pedantic = ze({}, E.normal, {
|
|
2714
2716
|
strong: {
|
|
2715
2717
|
start: /^__|\*\*/,
|
|
2716
2718
|
middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
|
|
@@ -2723,21 +2725,21 @@ E.pedantic = Ae({}, E.normal, {
|
|
|
2723
2725
|
endAst: /\*(?!\*)/g,
|
|
2724
2726
|
endUnd: /_(?!_)/g
|
|
2725
2727
|
},
|
|
2726
|
-
link:
|
|
2727
|
-
reflink:
|
|
2728
|
+
link: G(/^!?\[(label)\]\((.*?)\)/).replace("label", E._label).getRegex(),
|
|
2729
|
+
reflink: G(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", E._label).getRegex()
|
|
2728
2730
|
});
|
|
2729
|
-
E.gfm =
|
|
2730
|
-
escape:
|
|
2731
|
+
E.gfm = ze({}, E.normal, {
|
|
2732
|
+
escape: G(E.escape).replace("])", "~|])").getRegex(),
|
|
2731
2733
|
_extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
|
|
2732
2734
|
url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
|
|
2733
2735
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
2734
2736
|
del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
|
|
2735
2737
|
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
|
|
2736
2738
|
});
|
|
2737
|
-
E.gfm.url =
|
|
2738
|
-
E.breaks =
|
|
2739
|
-
br:
|
|
2740
|
-
text:
|
|
2739
|
+
E.gfm.url = G(E.gfm.url, "i").replace("email", E.gfm._extended_email).getRegex();
|
|
2740
|
+
E.breaks = ze({}, E.gfm, {
|
|
2741
|
+
br: G(E.br).replace("{2,}", "*").getRegex(),
|
|
2742
|
+
text: G(E.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
2741
2743
|
});
|
|
2742
2744
|
function Yi(s) {
|
|
2743
2745
|
return s.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
|
|
@@ -2749,25 +2751,25 @@ function In(s) {
|
|
|
2749
2751
|
n = s.charCodeAt(t), Math.random() > 0.5 && (n = "x" + n.toString(16)), e += "&#" + n + ";";
|
|
2750
2752
|
return e;
|
|
2751
2753
|
}
|
|
2752
|
-
class
|
|
2754
|
+
class Pe {
|
|
2753
2755
|
constructor(e) {
|
|
2754
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e ||
|
|
2756
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || dt, this.options.tokenizer = this.options.tokenizer || new an(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
2755
2757
|
inLink: !1,
|
|
2756
2758
|
inRawBlock: !1,
|
|
2757
2759
|
top: !0
|
|
2758
2760
|
};
|
|
2759
2761
|
const t = {
|
|
2760
|
-
block:
|
|
2762
|
+
block: R.normal,
|
|
2761
2763
|
inline: E.normal
|
|
2762
2764
|
};
|
|
2763
|
-
this.options.pedantic ? (t.block =
|
|
2765
|
+
this.options.pedantic ? (t.block = R.pedantic, t.inline = E.pedantic) : this.options.gfm && (t.block = R.gfm, this.options.breaks ? t.inline = E.breaks : t.inline = E.gfm), this.tokenizer.rules = t;
|
|
2764
2766
|
}
|
|
2765
2767
|
/**
|
|
2766
2768
|
* Expose Rules
|
|
2767
2769
|
*/
|
|
2768
2770
|
static get rules() {
|
|
2769
2771
|
return {
|
|
2770
|
-
block:
|
|
2772
|
+
block: R,
|
|
2771
2773
|
inline: E
|
|
2772
2774
|
};
|
|
2773
2775
|
}
|
|
@@ -2775,13 +2777,13 @@ class Ue {
|
|
|
2775
2777
|
* Static Lex Method
|
|
2776
2778
|
*/
|
|
2777
2779
|
static lex(e, t) {
|
|
2778
|
-
return new
|
|
2780
|
+
return new Pe(t).lex(e);
|
|
2779
2781
|
}
|
|
2780
2782
|
/**
|
|
2781
2783
|
* Static Lex Inline Method
|
|
2782
2784
|
*/
|
|
2783
2785
|
static lexInline(e, t) {
|
|
2784
|
-
return new
|
|
2786
|
+
return new Pe(t).inlineTokens(e);
|
|
2785
2787
|
}
|
|
2786
2788
|
/**
|
|
2787
2789
|
* Preprocessing
|
|
@@ -2969,9 +2971,9 @@ class Ue {
|
|
|
2969
2971
|
return t;
|
|
2970
2972
|
}
|
|
2971
2973
|
}
|
|
2972
|
-
class
|
|
2974
|
+
class cn {
|
|
2973
2975
|
constructor(e) {
|
|
2974
|
-
this.options = e ||
|
|
2976
|
+
this.options = e || dt;
|
|
2975
2977
|
}
|
|
2976
2978
|
code(e, t, n) {
|
|
2977
2979
|
const i = (t || "").match(/\S*/)[0];
|
|
@@ -2980,8 +2982,8 @@ class un {
|
|
|
2980
2982
|
l != null && l !== e && (n = !0, e = l);
|
|
2981
2983
|
}
|
|
2982
2984
|
return e = e.replace(/\n$/, "") + `
|
|
2983
|
-
`, i ? '<pre><code class="' + this.options.langPrefix +
|
|
2984
|
-
` : "<pre><code>" + (n ? e :
|
|
2985
|
+
`, i ? '<pre><code class="' + this.options.langPrefix + de(i) + '">' + (n ? e : de(e, !0)) + `</code></pre>
|
|
2986
|
+
` : "<pre><code>" + (n ? e : de(e, !0)) + `</code></pre>
|
|
2985
2987
|
`;
|
|
2986
2988
|
}
|
|
2987
2989
|
/**
|
|
@@ -3182,29 +3184,29 @@ class Wn {
|
|
|
3182
3184
|
return this.getNextSafeSlug(n, t.dryrun);
|
|
3183
3185
|
}
|
|
3184
3186
|
}
|
|
3185
|
-
class
|
|
3187
|
+
class Fe {
|
|
3186
3188
|
constructor(e) {
|
|
3187
|
-
this.options = e ||
|
|
3189
|
+
this.options = e || dt, this.options.renderer = this.options.renderer || new cn(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new Vn(), this.slugger = new Wn();
|
|
3188
3190
|
}
|
|
3189
3191
|
/**
|
|
3190
3192
|
* Static Parse Method
|
|
3191
3193
|
*/
|
|
3192
3194
|
static parse(e, t) {
|
|
3193
|
-
return new
|
|
3195
|
+
return new Fe(t).parse(e);
|
|
3194
3196
|
}
|
|
3195
3197
|
/**
|
|
3196
3198
|
* Static Parse Inline Method
|
|
3197
3199
|
*/
|
|
3198
3200
|
static parseInline(e, t) {
|
|
3199
|
-
return new
|
|
3201
|
+
return new Fe(t).parseInline(e);
|
|
3200
3202
|
}
|
|
3201
3203
|
/**
|
|
3202
3204
|
* Parse Loop
|
|
3203
3205
|
*/
|
|
3204
3206
|
parse(e, t = !0) {
|
|
3205
|
-
let n = "", i, l, r, o, c, f, h, m, v, g, $, b,
|
|
3206
|
-
const
|
|
3207
|
-
for (i = 0; i <
|
|
3207
|
+
let n = "", i, l, r, o, c, f, h, m, v, g, $, b, y, p, w, S, T, z, M;
|
|
3208
|
+
const A = e.length;
|
|
3209
|
+
for (i = 0; i < A; i++) {
|
|
3208
3210
|
if (g = e[i], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[g.type] && (M = this.options.extensions.renderers[g.type].call({ parser: this }, g), M !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(g.type))) {
|
|
3209
3211
|
n += M || "";
|
|
3210
3212
|
continue;
|
|
@@ -3255,11 +3257,11 @@ class De {
|
|
|
3255
3257
|
continue;
|
|
3256
3258
|
}
|
|
3257
3259
|
case "list": {
|
|
3258
|
-
for ($ = g.ordered, b = g.start,
|
|
3259
|
-
w = g.items[l], S = w.checked,
|
|
3260
|
+
for ($ = g.ordered, b = g.start, y = g.loose, o = g.items.length, v = "", l = 0; l < o; l++)
|
|
3261
|
+
w = g.items[l], S = w.checked, T = w.task, p = "", w.task && (z = this.renderer.checkbox(S), y ? w.tokens.length > 0 && w.tokens[0].type === "paragraph" ? (w.tokens[0].text = z + " " + w.tokens[0].text, w.tokens[0].tokens && w.tokens[0].tokens.length > 0 && w.tokens[0].tokens[0].type === "text" && (w.tokens[0].tokens[0].text = z + " " + w.tokens[0].tokens[0].text)) : w.tokens.unshift({
|
|
3260
3262
|
type: "text",
|
|
3261
|
-
text:
|
|
3262
|
-
}) : p +=
|
|
3263
|
+
text: z
|
|
3264
|
+
}) : p += z), p += this.parse(w.tokens, y), v += this.renderer.listitem(p, T, S);
|
|
3263
3265
|
n += this.renderer.list(v, $, b);
|
|
3264
3266
|
continue;
|
|
3265
3267
|
}
|
|
@@ -3272,19 +3274,19 @@ class De {
|
|
|
3272
3274
|
continue;
|
|
3273
3275
|
}
|
|
3274
3276
|
case "text": {
|
|
3275
|
-
for (v = g.tokens ? this.parseInline(g.tokens) : g.text; i + 1 <
|
|
3277
|
+
for (v = g.tokens ? this.parseInline(g.tokens) : g.text; i + 1 < A && e[i + 1].type === "text"; )
|
|
3276
3278
|
g = e[++i], v += `
|
|
3277
3279
|
` + (g.tokens ? this.parseInline(g.tokens) : g.text);
|
|
3278
3280
|
n += t ? this.renderer.paragraph(v) : v;
|
|
3279
3281
|
continue;
|
|
3280
3282
|
}
|
|
3281
3283
|
default: {
|
|
3282
|
-
const
|
|
3284
|
+
const k = 'Token with "' + g.type + '" type was not found.';
|
|
3283
3285
|
if (this.options.silent) {
|
|
3284
|
-
console.error(
|
|
3286
|
+
console.error(k);
|
|
3285
3287
|
return;
|
|
3286
3288
|
} else
|
|
3287
|
-
throw new Error(
|
|
3289
|
+
throw new Error(k);
|
|
3288
3290
|
}
|
|
3289
3291
|
}
|
|
3290
3292
|
}
|
|
@@ -3356,16 +3358,16 @@ class De {
|
|
|
3356
3358
|
return n;
|
|
3357
3359
|
}
|
|
3358
3360
|
}
|
|
3359
|
-
function
|
|
3361
|
+
function I(s, e, t) {
|
|
3360
3362
|
if (typeof s > "u" || s === null)
|
|
3361
3363
|
throw new Error("marked(): input parameter is undefined or null");
|
|
3362
3364
|
if (typeof s != "string")
|
|
3363
3365
|
throw new Error("marked(): input parameter is of type " + Object.prototype.toString.call(s) + ", string expected");
|
|
3364
|
-
if (typeof e == "function" && (t = e, e = null), e =
|
|
3366
|
+
if (typeof e == "function" && (t = e, e = null), e = ze({}, I.defaults, e || {}), qn(e), t) {
|
|
3365
3367
|
const i = e.highlight;
|
|
3366
3368
|
let l;
|
|
3367
3369
|
try {
|
|
3368
|
-
l =
|
|
3370
|
+
l = Pe.lex(s, e);
|
|
3369
3371
|
} catch (c) {
|
|
3370
3372
|
return t(c);
|
|
3371
3373
|
}
|
|
@@ -3373,7 +3375,7 @@ function z(s, e, t) {
|
|
|
3373
3375
|
let f;
|
|
3374
3376
|
if (!c)
|
|
3375
3377
|
try {
|
|
3376
|
-
e.walkTokens &&
|
|
3378
|
+
e.walkTokens && I.walkTokens(l, e.walkTokens), f = Fe.parse(l, e);
|
|
3377
3379
|
} catch (h) {
|
|
3378
3380
|
c = h;
|
|
3379
3381
|
}
|
|
@@ -3382,7 +3384,7 @@ function z(s, e, t) {
|
|
|
3382
3384
|
if (!i || i.length < 3 || (delete e.highlight, !l.length))
|
|
3383
3385
|
return r();
|
|
3384
3386
|
let o = 0;
|
|
3385
|
-
|
|
3387
|
+
I.walkTokens(l, function(c) {
|
|
3386
3388
|
c.type === "code" && (o++, setTimeout(() => {
|
|
3387
3389
|
i(c.text, c.lang, function(f, h) {
|
|
3388
3390
|
if (f)
|
|
@@ -3396,31 +3398,31 @@ function z(s, e, t) {
|
|
|
3396
3398
|
function n(i) {
|
|
3397
3399
|
if (i.message += `
|
|
3398
3400
|
Please report this to https://github.com/markedjs/marked.`, e.silent)
|
|
3399
|
-
return "<p>An error occurred:</p><pre>" +
|
|
3401
|
+
return "<p>An error occurred:</p><pre>" + de(i.message + "", !0) + "</pre>";
|
|
3400
3402
|
throw i;
|
|
3401
3403
|
}
|
|
3402
3404
|
try {
|
|
3403
|
-
const i =
|
|
3405
|
+
const i = Pe.lex(s, e);
|
|
3404
3406
|
if (e.walkTokens) {
|
|
3405
3407
|
if (e.async)
|
|
3406
|
-
return Promise.all(
|
|
3407
|
-
|
|
3408
|
+
return Promise.all(I.walkTokens(i, e.walkTokens)).then(() => Fe.parse(i, e)).catch(n);
|
|
3409
|
+
I.walkTokens(i, e.walkTokens);
|
|
3408
3410
|
}
|
|
3409
|
-
return
|
|
3411
|
+
return Fe.parse(i, e);
|
|
3410
3412
|
} catch (i) {
|
|
3411
3413
|
n(i);
|
|
3412
3414
|
}
|
|
3413
3415
|
}
|
|
3414
|
-
|
|
3415
|
-
return
|
|
3416
|
+
I.options = I.setOptions = function(s) {
|
|
3417
|
+
return ze(I.defaults, s), ji(I.defaults), I;
|
|
3416
3418
|
};
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
const e =
|
|
3419
|
+
I.getDefaults = Mn;
|
|
3420
|
+
I.defaults = dt;
|
|
3421
|
+
I.use = function(...s) {
|
|
3422
|
+
const e = I.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
3421
3423
|
s.forEach((t) => {
|
|
3422
|
-
const n =
|
|
3423
|
-
if (n.async =
|
|
3424
|
+
const n = ze({}, t);
|
|
3425
|
+
if (n.async = I.defaults.async || n.async, t.extensions && (t.extensions.forEach((i) => {
|
|
3424
3426
|
if (!i.name)
|
|
3425
3427
|
throw new Error("extension name required");
|
|
3426
3428
|
if (i.renderer) {
|
|
@@ -3437,7 +3439,7 @@ z.use = function(...s) {
|
|
|
3437
3439
|
}
|
|
3438
3440
|
i.childTokens && (e.childTokens[i.name] = i.childTokens);
|
|
3439
3441
|
}), n.extensions = e), t.renderer) {
|
|
3440
|
-
const i =
|
|
3442
|
+
const i = I.defaults.renderer || new cn();
|
|
3441
3443
|
for (const l in t.renderer) {
|
|
3442
3444
|
const r = i[l];
|
|
3443
3445
|
i[l] = (...o) => {
|
|
@@ -3448,7 +3450,7 @@ z.use = function(...s) {
|
|
|
3448
3450
|
n.renderer = i;
|
|
3449
3451
|
}
|
|
3450
3452
|
if (t.tokenizer) {
|
|
3451
|
-
const i =
|
|
3453
|
+
const i = I.defaults.tokenizer || new an();
|
|
3452
3454
|
for (const l in t.tokenizer) {
|
|
3453
3455
|
const r = i[l];
|
|
3454
3456
|
i[l] = (...o) => {
|
|
@@ -3459,70 +3461,70 @@ z.use = function(...s) {
|
|
|
3459
3461
|
n.tokenizer = i;
|
|
3460
3462
|
}
|
|
3461
3463
|
if (t.walkTokens) {
|
|
3462
|
-
const i =
|
|
3464
|
+
const i = I.defaults.walkTokens;
|
|
3463
3465
|
n.walkTokens = function(l) {
|
|
3464
3466
|
let r = [];
|
|
3465
3467
|
return r.push(t.walkTokens.call(this, l)), i && (r = r.concat(i.call(this, l))), r;
|
|
3466
3468
|
};
|
|
3467
3469
|
}
|
|
3468
|
-
|
|
3470
|
+
I.setOptions(n);
|
|
3469
3471
|
});
|
|
3470
3472
|
};
|
|
3471
|
-
|
|
3473
|
+
I.walkTokens = function(s, e) {
|
|
3472
3474
|
let t = [];
|
|
3473
3475
|
for (const n of s)
|
|
3474
|
-
switch (t = t.concat(e.call(
|
|
3476
|
+
switch (t = t.concat(e.call(I, n)), n.type) {
|
|
3475
3477
|
case "table": {
|
|
3476
3478
|
for (const i of n.header)
|
|
3477
|
-
t = t.concat(
|
|
3479
|
+
t = t.concat(I.walkTokens(i.tokens, e));
|
|
3478
3480
|
for (const i of n.rows)
|
|
3479
3481
|
for (const l of i)
|
|
3480
|
-
t = t.concat(
|
|
3482
|
+
t = t.concat(I.walkTokens(l.tokens, e));
|
|
3481
3483
|
break;
|
|
3482
3484
|
}
|
|
3483
3485
|
case "list": {
|
|
3484
|
-
t = t.concat(
|
|
3486
|
+
t = t.concat(I.walkTokens(n.items, e));
|
|
3485
3487
|
break;
|
|
3486
3488
|
}
|
|
3487
3489
|
default:
|
|
3488
|
-
|
|
3489
|
-
t = t.concat(
|
|
3490
|
-
}) : n.tokens && (t = t.concat(
|
|
3490
|
+
I.defaults.extensions && I.defaults.extensions.childTokens && I.defaults.extensions.childTokens[n.type] ? I.defaults.extensions.childTokens[n.type].forEach(function(i) {
|
|
3491
|
+
t = t.concat(I.walkTokens(n[i], e));
|
|
3492
|
+
}) : n.tokens && (t = t.concat(I.walkTokens(n.tokens, e)));
|
|
3491
3493
|
}
|
|
3492
3494
|
return t;
|
|
3493
3495
|
};
|
|
3494
|
-
|
|
3496
|
+
I.parseInline = function(s, e) {
|
|
3495
3497
|
if (typeof s > "u" || s === null)
|
|
3496
3498
|
throw new Error("marked.parseInline(): input parameter is undefined or null");
|
|
3497
3499
|
if (typeof s != "string")
|
|
3498
3500
|
throw new Error("marked.parseInline(): input parameter is of type " + Object.prototype.toString.call(s) + ", string expected");
|
|
3499
|
-
e =
|
|
3501
|
+
e = ze({}, I.defaults, e || {}), qn(e);
|
|
3500
3502
|
try {
|
|
3501
|
-
const t =
|
|
3502
|
-
return e.walkTokens &&
|
|
3503
|
+
const t = Pe.lexInline(s, e);
|
|
3504
|
+
return e.walkTokens && I.walkTokens(t, e.walkTokens), Fe.parseInline(t, e);
|
|
3503
3505
|
} catch (t) {
|
|
3504
3506
|
if (t.message += `
|
|
3505
3507
|
Please report this to https://github.com/markedjs/marked.`, e.silent)
|
|
3506
|
-
return "<p>An error occurred:</p><pre>" +
|
|
3508
|
+
return "<p>An error occurred:</p><pre>" + de(t.message + "", !0) + "</pre>";
|
|
3507
3509
|
throw t;
|
|
3508
3510
|
}
|
|
3509
3511
|
};
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3512
|
+
I.Parser = Fe;
|
|
3513
|
+
I.parser = Fe.parse;
|
|
3514
|
+
I.Renderer = cn;
|
|
3515
|
+
I.TextRenderer = Vn;
|
|
3516
|
+
I.Lexer = Pe;
|
|
3517
|
+
I.lexer = Pe.lex;
|
|
3518
|
+
I.Tokenizer = an;
|
|
3519
|
+
I.Slugger = Wn;
|
|
3520
|
+
I.parse = I;
|
|
3521
|
+
I.options;
|
|
3522
|
+
I.setOptions;
|
|
3523
|
+
I.use;
|
|
3524
|
+
I.walkTokens;
|
|
3525
|
+
I.parseInline;
|
|
3526
|
+
Fe.parse;
|
|
3527
|
+
Pe.lex;
|
|
3526
3528
|
var Ji = function() {
|
|
3527
3529
|
var s = document.getSelection();
|
|
3528
3530
|
if (!s.rangeCount)
|
|
@@ -3583,9 +3585,9 @@ function is(s, e) {
|
|
|
3583
3585
|
}
|
|
3584
3586
|
return c;
|
|
3585
3587
|
}
|
|
3586
|
-
var
|
|
3588
|
+
var pt = is;
|
|
3587
3589
|
/*! medium-zoom 1.0.8 | MIT License | https://github.com/francoischalifour/medium-zoom */
|
|
3588
|
-
var
|
|
3590
|
+
var Ze = Object.assign || function(s) {
|
|
3589
3591
|
for (var e = 1; e < arguments.length; e++) {
|
|
3590
3592
|
var t = arguments[e];
|
|
3591
3593
|
for (var n in t)
|
|
@@ -3615,8 +3617,8 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
3615
3617
|
}, os = function(e) {
|
|
3616
3618
|
var t = e.getBoundingClientRect(), n = t.top, i = t.left, l = t.width, r = t.height, o = e.cloneNode(), c = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, f = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
|
|
3617
3619
|
return o.removeAttribute("id"), o.style.position = "absolute", o.style.top = n + c + "px", o.style.left = i + f + "px", o.style.width = l + "px", o.style.height = r + "px", o.style.transform = "", o;
|
|
3618
|
-
},
|
|
3619
|
-
var n =
|
|
3620
|
+
}, nt = function(e, t) {
|
|
3621
|
+
var n = Ze({
|
|
3620
3622
|
bubbles: !1,
|
|
3621
3623
|
cancelable: !1,
|
|
3622
3624
|
detail: void 0
|
|
@@ -3626,194 +3628,194 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
3626
3628
|
var i = document.createEvent("CustomEvent");
|
|
3627
3629
|
return i.initCustomEvent(e, n.bubbles, n.cancelable, n.detail), i;
|
|
3628
3630
|
}, rs = function s(e) {
|
|
3629
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = window.Promise || function(
|
|
3630
|
-
function
|
|
3631
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = window.Promise || function(L) {
|
|
3632
|
+
function D() {
|
|
3631
3633
|
}
|
|
3632
|
-
|
|
3633
|
-
}, i = function(
|
|
3634
|
-
var
|
|
3635
|
-
if (
|
|
3634
|
+
L(D, D);
|
|
3635
|
+
}, i = function(L) {
|
|
3636
|
+
var D = L.target;
|
|
3637
|
+
if (D === K) {
|
|
3636
3638
|
$();
|
|
3637
3639
|
return;
|
|
3638
3640
|
}
|
|
3639
|
-
S.indexOf(
|
|
3641
|
+
S.indexOf(D) !== -1 && b({ target: D });
|
|
3640
3642
|
}, l = function() {
|
|
3641
|
-
if (!(
|
|
3642
|
-
var
|
|
3643
|
-
Math.abs(M -
|
|
3643
|
+
if (!(z || !k.original)) {
|
|
3644
|
+
var L = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
3645
|
+
Math.abs(M - L) > A.scrollOffset && setTimeout($, 150);
|
|
3644
3646
|
}
|
|
3645
|
-
}, r = function(
|
|
3646
|
-
var
|
|
3647
|
-
(
|
|
3647
|
+
}, r = function(L) {
|
|
3648
|
+
var D = L.key || L.keyCode;
|
|
3649
|
+
(D === "Escape" || D === "Esc" || D === 27) && $();
|
|
3648
3650
|
}, o = function() {
|
|
3649
|
-
var
|
|
3650
|
-
if (
|
|
3651
|
-
var B = Dt(
|
|
3652
|
-
|
|
3651
|
+
var L = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, D = L;
|
|
3652
|
+
if (L.background && (K.style.background = L.background), L.container && L.container instanceof Object && (D.container = Ze({}, A.container, L.container)), L.template) {
|
|
3653
|
+
var B = Dt(L.template) ? L.template : document.querySelector(L.template);
|
|
3654
|
+
D.template = B;
|
|
3653
3655
|
}
|
|
3654
|
-
return
|
|
3655
|
-
|
|
3656
|
-
detail: { zoom:
|
|
3656
|
+
return A = Ze({}, A, D), S.forEach(function(_) {
|
|
3657
|
+
_.dispatchEvent(nt("medium-zoom:update", {
|
|
3658
|
+
detail: { zoom: U }
|
|
3657
3659
|
}));
|
|
3658
|
-
}),
|
|
3660
|
+
}), U;
|
|
3659
3661
|
}, c = function() {
|
|
3660
|
-
var
|
|
3661
|
-
return s(
|
|
3662
|
+
var L = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3663
|
+
return s(Ze({}, A, L));
|
|
3662
3664
|
}, f = function() {
|
|
3663
|
-
for (var
|
|
3664
|
-
|
|
3665
|
-
var
|
|
3666
|
-
return [].concat(
|
|
3665
|
+
for (var L = arguments.length, D = Array(L), B = 0; B < L; B++)
|
|
3666
|
+
D[B] = arguments[B];
|
|
3667
|
+
var _ = D.reduce(function(C, j) {
|
|
3668
|
+
return [].concat(C, Rn(j));
|
|
3667
3669
|
}, []);
|
|
3668
|
-
return
|
|
3669
|
-
return S.indexOf(
|
|
3670
|
-
}).forEach(function(
|
|
3671
|
-
S.push(
|
|
3672
|
-
}),
|
|
3673
|
-
var
|
|
3674
|
-
|
|
3675
|
-
|
|
3670
|
+
return _.filter(function(C) {
|
|
3671
|
+
return S.indexOf(C) === -1;
|
|
3672
|
+
}).forEach(function(C) {
|
|
3673
|
+
S.push(C), C.classList.add("medium-zoom-image");
|
|
3674
|
+
}), T.forEach(function(C) {
|
|
3675
|
+
var j = C.type, Z = C.listener, ee = C.options;
|
|
3676
|
+
_.forEach(function(se) {
|
|
3677
|
+
se.addEventListener(j, Z, ee);
|
|
3676
3678
|
});
|
|
3677
|
-
}),
|
|
3679
|
+
}), U;
|
|
3678
3680
|
}, h = function() {
|
|
3679
|
-
for (var
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
var
|
|
3683
|
-
return [].concat(
|
|
3681
|
+
for (var L = arguments.length, D = Array(L), B = 0; B < L; B++)
|
|
3682
|
+
D[B] = arguments[B];
|
|
3683
|
+
k.zoomed && $();
|
|
3684
|
+
var _ = D.length > 0 ? D.reduce(function(C, j) {
|
|
3685
|
+
return [].concat(C, Rn(j));
|
|
3684
3686
|
}, []) : S;
|
|
3685
|
-
return
|
|
3686
|
-
|
|
3687
|
-
detail: { zoom:
|
|
3687
|
+
return _.forEach(function(C) {
|
|
3688
|
+
C.classList.remove("medium-zoom-image"), C.dispatchEvent(nt("medium-zoom:detach", {
|
|
3689
|
+
detail: { zoom: U }
|
|
3688
3690
|
}));
|
|
3689
|
-
}), S = S.filter(function(
|
|
3690
|
-
return
|
|
3691
|
-
}),
|
|
3692
|
-
}, m = function(
|
|
3691
|
+
}), S = S.filter(function(C) {
|
|
3692
|
+
return _.indexOf(C) === -1;
|
|
3693
|
+
}), U;
|
|
3694
|
+
}, m = function(L, D) {
|
|
3693
3695
|
var B = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
3694
|
-
return S.forEach(function(
|
|
3695
|
-
|
|
3696
|
-
}),
|
|
3697
|
-
}, v = function(
|
|
3696
|
+
return S.forEach(function(_) {
|
|
3697
|
+
_.addEventListener("medium-zoom:" + L, D, B);
|
|
3698
|
+
}), T.push({ type: "medium-zoom:" + L, listener: D, options: B }), U;
|
|
3699
|
+
}, v = function(L, D) {
|
|
3698
3700
|
var B = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
3699
|
-
return S.forEach(function(
|
|
3700
|
-
|
|
3701
|
-
}),
|
|
3702
|
-
return !(
|
|
3703
|
-
}),
|
|
3701
|
+
return S.forEach(function(_) {
|
|
3702
|
+
_.removeEventListener("medium-zoom:" + L, D, B);
|
|
3703
|
+
}), T = T.filter(function(_) {
|
|
3704
|
+
return !(_.type === "medium-zoom:" + L && _.listener.toString() === D.toString());
|
|
3705
|
+
}), U;
|
|
3704
3706
|
}, g = function() {
|
|
3705
|
-
var
|
|
3706
|
-
var
|
|
3707
|
+
var L = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, D = L.target, B = function() {
|
|
3708
|
+
var C = {
|
|
3707
3709
|
width: document.documentElement.clientWidth,
|
|
3708
3710
|
height: document.documentElement.clientHeight,
|
|
3709
3711
|
left: 0,
|
|
3710
3712
|
top: 0,
|
|
3711
3713
|
right: 0,
|
|
3712
3714
|
bottom: 0
|
|
3713
|
-
},
|
|
3714
|
-
if (
|
|
3715
|
-
if (
|
|
3716
|
-
|
|
3715
|
+
}, j = void 0, Z = void 0;
|
|
3716
|
+
if (A.container)
|
|
3717
|
+
if (A.container instanceof Object)
|
|
3718
|
+
C = Ze({}, C, A.container), j = C.width - C.left - C.right - A.margin * 2, Z = C.height - C.top - C.bottom - A.margin * 2;
|
|
3717
3719
|
else {
|
|
3718
|
-
var
|
|
3719
|
-
|
|
3720
|
-
width:
|
|
3721
|
-
height:
|
|
3722
|
-
left:
|
|
3723
|
-
top:
|
|
3720
|
+
var ee = Dt(A.container) ? A.container : document.querySelector(A.container), se = ee.getBoundingClientRect(), be = se.width, ht = se.height, Ke = se.left, Me = se.top;
|
|
3721
|
+
C = Ze({}, C, {
|
|
3722
|
+
width: be,
|
|
3723
|
+
height: ht,
|
|
3724
|
+
left: Ke,
|
|
3725
|
+
top: Me
|
|
3724
3726
|
});
|
|
3725
3727
|
}
|
|
3726
|
-
|
|
3727
|
-
var
|
|
3728
|
-
|
|
3728
|
+
j = j || C.width - A.margin * 2, Z = Z || C.height - A.margin * 2;
|
|
3729
|
+
var Be = k.zoomedHd || k.original, St = Fn(Be) ? j : Be.naturalWidth || j, Ct = Fn(Be) ? Z : Be.naturalHeight || Z, Ge = Be.getBoundingClientRect(), Tt = Ge.top, Et = Ge.left, Je = Ge.width, et = Ge.height, zt = Math.min(Math.max(Je, St), j) / Je, _t = Math.min(Math.max(et, Ct), Z) / et, tt = Math.min(zt, _t), At = (-Et + (j - Je) / 2 + A.margin + C.left) / tt, It = (-Tt + (Z - et) / 2 + A.margin + C.top) / tt, ft = "scale(" + tt + ") translate3d(" + At + "px, " + It + "px, 0)";
|
|
3730
|
+
k.zoomed.style.transform = ft, k.zoomedHd && (k.zoomedHd.style.transform = ft);
|
|
3729
3731
|
};
|
|
3730
|
-
return new n(function(
|
|
3731
|
-
if (
|
|
3732
|
-
|
|
3732
|
+
return new n(function(_) {
|
|
3733
|
+
if (D && S.indexOf(D) === -1) {
|
|
3734
|
+
_(U);
|
|
3733
3735
|
return;
|
|
3734
3736
|
}
|
|
3735
|
-
var
|
|
3736
|
-
|
|
3737
|
-
detail: { zoom:
|
|
3738
|
-
})),
|
|
3737
|
+
var C = function be() {
|
|
3738
|
+
z = !1, k.zoomed.removeEventListener("transitionend", be), k.original.dispatchEvent(nt("medium-zoom:opened", {
|
|
3739
|
+
detail: { zoom: U }
|
|
3740
|
+
})), _(U);
|
|
3739
3741
|
};
|
|
3740
|
-
if (
|
|
3741
|
-
|
|
3742
|
+
if (k.zoomed) {
|
|
3743
|
+
_(U);
|
|
3742
3744
|
return;
|
|
3743
3745
|
}
|
|
3744
|
-
if (
|
|
3745
|
-
|
|
3746
|
+
if (D)
|
|
3747
|
+
k.original = D;
|
|
3746
3748
|
else if (S.length > 0) {
|
|
3747
|
-
var
|
|
3748
|
-
|
|
3749
|
+
var j = S;
|
|
3750
|
+
k.original = j[0];
|
|
3749
3751
|
} else {
|
|
3750
|
-
|
|
3752
|
+
_(U);
|
|
3751
3753
|
return;
|
|
3752
3754
|
}
|
|
3753
|
-
if (
|
|
3754
|
-
detail: { zoom:
|
|
3755
|
-
})), M = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0,
|
|
3756
|
-
var
|
|
3757
|
-
|
|
3755
|
+
if (k.original.dispatchEvent(nt("medium-zoom:open", {
|
|
3756
|
+
detail: { zoom: U }
|
|
3757
|
+
})), M = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, z = !0, k.zoomed = os(k.original), document.body.appendChild(K), A.template) {
|
|
3758
|
+
var Z = Dt(A.template) ? A.template : document.querySelector(A.template);
|
|
3759
|
+
k.template = document.createElement("div"), k.template.appendChild(Z.content.cloneNode(!0)), document.body.appendChild(k.template);
|
|
3758
3760
|
}
|
|
3759
|
-
if (
|
|
3761
|
+
if (k.original.parentElement && k.original.parentElement.tagName === "PICTURE" && k.original.currentSrc && (k.zoomed.src = k.original.currentSrc), document.body.appendChild(k.zoomed), window.requestAnimationFrame(function() {
|
|
3760
3762
|
document.body.classList.add("medium-zoom--opened");
|
|
3761
|
-
}),
|
|
3762
|
-
|
|
3763
|
-
clearInterval(
|
|
3763
|
+
}), k.original.classList.add("medium-zoom-image--hidden"), k.zoomed.classList.add("medium-zoom-image--opened"), k.zoomed.addEventListener("click", $), k.zoomed.addEventListener("transitionend", C), k.original.getAttribute("data-zoom-src")) {
|
|
3764
|
+
k.zoomedHd = k.zoomed.cloneNode(), k.zoomedHd.removeAttribute("srcset"), k.zoomedHd.removeAttribute("sizes"), k.zoomedHd.removeAttribute("loading"), k.zoomedHd.src = k.zoomed.getAttribute("data-zoom-src"), k.zoomedHd.onerror = function() {
|
|
3765
|
+
clearInterval(ee), console.warn("Unable to reach the zoom image target " + k.zoomedHd.src), k.zoomedHd = null, B();
|
|
3764
3766
|
};
|
|
3765
|
-
var
|
|
3766
|
-
|
|
3767
|
+
var ee = setInterval(function() {
|
|
3768
|
+
k.zoomedHd.complete && (clearInterval(ee), k.zoomedHd.classList.add("medium-zoom-image--opened"), k.zoomedHd.addEventListener("click", $), document.body.appendChild(k.zoomedHd), B());
|
|
3767
3769
|
}, 10);
|
|
3768
|
-
} else if (
|
|
3769
|
-
|
|
3770
|
-
var
|
|
3771
|
-
|
|
3770
|
+
} else if (k.original.hasAttribute("srcset")) {
|
|
3771
|
+
k.zoomedHd = k.zoomed.cloneNode(), k.zoomedHd.removeAttribute("sizes"), k.zoomedHd.removeAttribute("loading");
|
|
3772
|
+
var se = k.zoomedHd.addEventListener("load", function() {
|
|
3773
|
+
k.zoomedHd.removeEventListener("load", se), k.zoomedHd.classList.add("medium-zoom-image--opened"), k.zoomedHd.addEventListener("click", $), document.body.appendChild(k.zoomedHd), B();
|
|
3772
3774
|
});
|
|
3773
3775
|
} else
|
|
3774
3776
|
B();
|
|
3775
3777
|
});
|
|
3776
3778
|
}, $ = function() {
|
|
3777
|
-
return new n(function(
|
|
3778
|
-
if (
|
|
3779
|
-
|
|
3779
|
+
return new n(function(L) {
|
|
3780
|
+
if (z || !k.original) {
|
|
3781
|
+
L(U);
|
|
3780
3782
|
return;
|
|
3781
3783
|
}
|
|
3782
|
-
var
|
|
3783
|
-
|
|
3784
|
-
detail: { zoom:
|
|
3785
|
-
})),
|
|
3784
|
+
var D = function B() {
|
|
3785
|
+
k.original.classList.remove("medium-zoom-image--hidden"), document.body.removeChild(k.zoomed), k.zoomedHd && document.body.removeChild(k.zoomedHd), document.body.removeChild(K), k.zoomed.classList.remove("medium-zoom-image--opened"), k.template && document.body.removeChild(k.template), z = !1, k.zoomed.removeEventListener("transitionend", B), k.original.dispatchEvent(nt("medium-zoom:closed", {
|
|
3786
|
+
detail: { zoom: U }
|
|
3787
|
+
})), k.original = null, k.zoomed = null, k.zoomedHd = null, k.template = null, L(U);
|
|
3786
3788
|
};
|
|
3787
|
-
|
|
3788
|
-
detail: { zoom:
|
|
3789
|
-
})),
|
|
3789
|
+
z = !0, document.body.classList.remove("medium-zoom--opened"), k.zoomed.style.transform = "", k.zoomedHd && (k.zoomedHd.style.transform = ""), k.template && (k.template.style.transition = "opacity 150ms", k.template.style.opacity = 0), k.original.dispatchEvent(nt("medium-zoom:close", {
|
|
3790
|
+
detail: { zoom: U }
|
|
3791
|
+
})), k.zoomed.addEventListener("transitionend", D);
|
|
3790
3792
|
});
|
|
3791
3793
|
}, b = function() {
|
|
3792
|
-
var
|
|
3793
|
-
return
|
|
3794
|
-
},
|
|
3795
|
-
return
|
|
3794
|
+
var L = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, D = L.target;
|
|
3795
|
+
return k.original ? $() : g({ target: D });
|
|
3796
|
+
}, y = function() {
|
|
3797
|
+
return A;
|
|
3796
3798
|
}, p = function() {
|
|
3797
3799
|
return S;
|
|
3798
3800
|
}, w = function() {
|
|
3799
|
-
return
|
|
3800
|
-
}, S = [],
|
|
3801
|
+
return k.original;
|
|
3802
|
+
}, S = [], T = [], z = !1, M = 0, A = t, k = {
|
|
3801
3803
|
original: null,
|
|
3802
3804
|
zoomed: null,
|
|
3803
3805
|
zoomedHd: null,
|
|
3804
3806
|
template: null
|
|
3805
3807
|
// If the selector is omitted, it's replaced by the options
|
|
3806
3808
|
};
|
|
3807
|
-
Object.prototype.toString.call(e) === "[object Object]" ?
|
|
3809
|
+
Object.prototype.toString.call(e) === "[object Object]" ? A = e : (e || typeof e == "string") && f(e), A = Ze({
|
|
3808
3810
|
margin: 0,
|
|
3809
3811
|
background: "#fff",
|
|
3810
3812
|
scrollOffset: 40,
|
|
3811
3813
|
container: null,
|
|
3812
3814
|
template: null
|
|
3813
|
-
},
|
|
3814
|
-
var
|
|
3815
|
+
}, A);
|
|
3816
|
+
var K = ls(A.background);
|
|
3815
3817
|
document.addEventListener("click", i), document.addEventListener("keyup", r), document.addEventListener("scroll", l), window.addEventListener("resize", $);
|
|
3816
|
-
var
|
|
3818
|
+
var U = {
|
|
3817
3819
|
open: g,
|
|
3818
3820
|
close: $,
|
|
3819
3821
|
toggle: b,
|
|
@@ -3823,11 +3825,11 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
3823
3825
|
detach: h,
|
|
3824
3826
|
on: m,
|
|
3825
3827
|
off: v,
|
|
3826
|
-
getOptions:
|
|
3828
|
+
getOptions: y,
|
|
3827
3829
|
getImages: p,
|
|
3828
3830
|
getZoomedImage: w
|
|
3829
3831
|
};
|
|
3830
|
-
return
|
|
3832
|
+
return U;
|
|
3831
3833
|
};
|
|
3832
3834
|
function as(s, e) {
|
|
3833
3835
|
e === void 0 && (e = {});
|
|
@@ -3839,20 +3841,20 @@ function as(s, e) {
|
|
|
3839
3841
|
}
|
|
3840
3842
|
var cs = ".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";
|
|
3841
3843
|
as(cs);
|
|
3842
|
-
const us = rs,
|
|
3844
|
+
const us = rs, mt = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, Kn = /* @__PURE__ */ new Set(), ds = (s, e, t, n) => {
|
|
3843
3845
|
typeof process == "object" && process && typeof process.emitWarning == "function" ? process.emitWarning(s, e, t, n) : console.error(`[${t}] ${e}: ${s}`);
|
|
3844
|
-
}, hs = (s) => !Kn.has(s),
|
|
3846
|
+
}, hs = (s) => !Kn.has(s), Ne = (s) => s && s === Math.floor(s) && s > 0 && isFinite(s), Gn = (s) => Ne(s) ? s <= Math.pow(2, 8) ? Uint8Array : s <= Math.pow(2, 16) ? Uint16Array : s <= Math.pow(2, 32) ? Uint32Array : s <= Number.MAX_SAFE_INTEGER ? Ht : null : null;
|
|
3845
3847
|
class Ht extends Array {
|
|
3846
3848
|
constructor(e) {
|
|
3847
3849
|
super(e), this.fill(0);
|
|
3848
3850
|
}
|
|
3849
3851
|
}
|
|
3850
|
-
var
|
|
3851
|
-
const
|
|
3852
|
+
var lt;
|
|
3853
|
+
const st = class {
|
|
3852
3854
|
constructor(e, t) {
|
|
3853
3855
|
le(this, "heap");
|
|
3854
3856
|
le(this, "length");
|
|
3855
|
-
if (!a(
|
|
3857
|
+
if (!a(st, lt))
|
|
3856
3858
|
throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
3857
3859
|
this.heap = new t(e), this.length = 0;
|
|
3858
3860
|
}
|
|
@@ -3860,9 +3862,9 @@ const rt = class {
|
|
|
3860
3862
|
const t = Gn(e);
|
|
3861
3863
|
if (!t)
|
|
3862
3864
|
return [];
|
|
3863
|
-
|
|
3864
|
-
const n = new
|
|
3865
|
-
return
|
|
3865
|
+
O(st, lt, !0);
|
|
3866
|
+
const n = new st(e, t);
|
|
3867
|
+
return O(st, lt, !1), n;
|
|
3866
3868
|
}
|
|
3867
3869
|
push(e) {
|
|
3868
3870
|
this.heap[this.length++] = e;
|
|
@@ -3871,30 +3873,30 @@ const rt = class {
|
|
|
3871
3873
|
return this.heap[--this.length];
|
|
3872
3874
|
}
|
|
3873
3875
|
};
|
|
3874
|
-
let jt =
|
|
3875
|
-
|
|
3876
|
-
P(jt,
|
|
3877
|
-
var
|
|
3878
|
-
const
|
|
3876
|
+
let jt = st;
|
|
3877
|
+
lt = new WeakMap(), // private constructor
|
|
3878
|
+
P(jt, lt, !1);
|
|
3879
|
+
var ye, ge, _e, we, ot, oe, xe, re, X, H, fe, pe, he, ce, $e, ue, De, He, Se, Ae, Ve, me, bt, Jt, Xe, je, kt, ve, Vt, Zn, Qe, rt, yt, Ie, Ue, Le, qe, wt, en, at, Pt, ct, Mt, Q, J, xt, tn, Ye, vt;
|
|
3880
|
+
const un = class {
|
|
3879
3881
|
constructor(e) {
|
|
3880
|
-
P(this,
|
|
3881
|
-
P(this,
|
|
3882
|
-
P(this,
|
|
3883
|
-
P(this,
|
|
3884
|
-
P(this,
|
|
3885
|
-
P(this,
|
|
3886
|
-
P(this,
|
|
3887
|
-
P(this,
|
|
3888
|
-
P(this,
|
|
3889
|
-
P(this,
|
|
3882
|
+
P(this, bt);
|
|
3883
|
+
P(this, Vt);
|
|
3884
|
+
P(this, Ie);
|
|
3885
|
+
P(this, Le);
|
|
3886
|
+
P(this, wt);
|
|
3887
|
+
P(this, at);
|
|
3888
|
+
P(this, ct);
|
|
3889
|
+
P(this, Q);
|
|
3890
|
+
P(this, xt);
|
|
3891
|
+
P(this, Ye);
|
|
3890
3892
|
// properties coming in from the options of these, only max and maxSize
|
|
3891
3893
|
// really *need* to be protected. The rest can be modified, as they just
|
|
3892
3894
|
// set defaults for various methods.
|
|
3893
|
-
P(this,
|
|
3894
|
-
P(this,
|
|
3895
|
-
P(this,
|
|
3896
|
-
P(this,
|
|
3897
|
-
P(this,
|
|
3895
|
+
P(this, ye, void 0);
|
|
3896
|
+
P(this, ge, void 0);
|
|
3897
|
+
P(this, _e, void 0);
|
|
3898
|
+
P(this, we, void 0);
|
|
3899
|
+
P(this, ot, void 0);
|
|
3898
3900
|
/**
|
|
3899
3901
|
* {@link LRUCache.OptionsBase.ttl}
|
|
3900
3902
|
*/
|
|
@@ -3957,71 +3959,71 @@ const dn = class {
|
|
|
3957
3959
|
le(this, "ignoreFetchAbort");
|
|
3958
3960
|
// computed properties
|
|
3959
3961
|
P(this, oe, void 0);
|
|
3960
|
-
P(this,
|
|
3962
|
+
P(this, xe, void 0);
|
|
3961
3963
|
P(this, re, void 0);
|
|
3962
|
-
P(this,
|
|
3963
|
-
P(this,
|
|
3964
|
-
P(this,
|
|
3965
|
-
P(this, ke, void 0);
|
|
3966
|
-
P(this, me, void 0);
|
|
3967
|
-
P(this, ue, void 0);
|
|
3968
|
-
P(this, Te, void 0);
|
|
3969
|
-
P(this, he, void 0);
|
|
3970
|
-
P(this, Me, void 0);
|
|
3971
|
-
P(this, Be, void 0);
|
|
3972
|
-
P(this, Ee, void 0);
|
|
3973
|
-
P(this, Fe, void 0);
|
|
3974
|
-
P(this, Ge, void 0);
|
|
3964
|
+
P(this, X, void 0);
|
|
3965
|
+
P(this, H, void 0);
|
|
3966
|
+
P(this, fe, void 0);
|
|
3975
3967
|
P(this, pe, void 0);
|
|
3968
|
+
P(this, he, void 0);
|
|
3969
|
+
P(this, ce, void 0);
|
|
3970
|
+
P(this, $e, void 0);
|
|
3971
|
+
P(this, ue, void 0);
|
|
3972
|
+
P(this, De, void 0);
|
|
3973
|
+
P(this, He, void 0);
|
|
3974
|
+
P(this, Se, void 0);
|
|
3975
|
+
P(this, Ae, void 0);
|
|
3976
|
+
P(this, Ve, void 0);
|
|
3977
|
+
P(this, me, void 0);
|
|
3976
3978
|
// conditionally set private methods related to TTL
|
|
3977
|
-
P(this,
|
|
3979
|
+
P(this, Xe, () => {
|
|
3978
3980
|
});
|
|
3979
|
-
P(this,
|
|
3981
|
+
P(this, je, () => {
|
|
3980
3982
|
});
|
|
3981
|
-
P(this,
|
|
3983
|
+
P(this, kt, () => {
|
|
3982
3984
|
});
|
|
3983
3985
|
/* c8 ignore stop */
|
|
3984
|
-
P(this,
|
|
3985
|
-
P(this,
|
|
3986
|
+
P(this, ve, () => !1);
|
|
3987
|
+
P(this, Qe, (e) => {
|
|
3986
3988
|
});
|
|
3987
|
-
P(this,
|
|
3989
|
+
P(this, rt, (e, t, n) => {
|
|
3988
3990
|
});
|
|
3989
|
-
P(this,
|
|
3991
|
+
P(this, yt, (e, t, n, i) => {
|
|
3990
3992
|
if (n || i)
|
|
3991
3993
|
throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
3992
3994
|
return 0;
|
|
3993
3995
|
});
|
|
3994
|
-
const { max: t = 0, ttl: n, ttlResolution: i = 1, ttlAutopurge: l, updateAgeOnGet: r, updateAgeOnHas: o, allowStale: c, dispose: f, disposeAfter: h, noDisposeOnSet: m, noUpdateTTL: v, maxSize: g = 0, maxEntrySize: $ = 0, sizeCalculation: b, fetchMethod:
|
|
3995
|
-
if (t !== 0 && !
|
|
3996
|
+
const { max: t = 0, ttl: n, ttlResolution: i = 1, ttlAutopurge: l, updateAgeOnGet: r, updateAgeOnHas: o, allowStale: c, dispose: f, disposeAfter: h, noDisposeOnSet: m, noUpdateTTL: v, maxSize: g = 0, maxEntrySize: $ = 0, sizeCalculation: b, fetchMethod: y, noDeleteOnFetchRejection: p, noDeleteOnStaleGet: w, allowStaleOnFetchRejection: S, allowStaleOnFetchAbort: T, ignoreFetchAbort: z } = e;
|
|
3997
|
+
if (t !== 0 && !Ne(t))
|
|
3996
3998
|
throw new TypeError("max option must be a nonnegative integer");
|
|
3997
3999
|
const M = t ? Gn(t) : Array;
|
|
3998
4000
|
if (!M)
|
|
3999
4001
|
throw new Error("invalid max value: " + t);
|
|
4000
|
-
if (
|
|
4001
|
-
if (!a(this,
|
|
4002
|
+
if (O(this, ye, t), O(this, ge, g), this.maxEntrySize = $ || a(this, ge), this.sizeCalculation = b, this.sizeCalculation) {
|
|
4003
|
+
if (!a(this, ge) && !this.maxEntrySize)
|
|
4002
4004
|
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
4003
4005
|
if (typeof this.sizeCalculation != "function")
|
|
4004
4006
|
throw new TypeError("sizeCalculation set to non-function");
|
|
4005
4007
|
}
|
|
4006
|
-
if (
|
|
4008
|
+
if (y !== void 0 && typeof y != "function")
|
|
4007
4009
|
throw new TypeError("fetchMethod must be a function if specified");
|
|
4008
|
-
if (
|
|
4009
|
-
if (a(this,
|
|
4010
|
+
if (O(this, ot, y), O(this, Ve, !!y), O(this, re, /* @__PURE__ */ new Map()), O(this, X, new Array(t).fill(void 0)), O(this, H, new Array(t).fill(void 0)), O(this, fe, new M(t)), O(this, pe, new M(t)), O(this, he, 0), O(this, ce, 0), O(this, $e, jt.create(t)), O(this, oe, 0), O(this, xe, 0), typeof f == "function" && O(this, _e, f), typeof h == "function" ? (O(this, we, h), O(this, ue, [])) : (O(this, we, void 0), O(this, ue, void 0)), O(this, Ae, !!a(this, _e)), O(this, me, !!a(this, we)), this.noDisposeOnSet = !!m, this.noUpdateTTL = !!v, this.noDeleteOnFetchRejection = !!p, this.allowStaleOnFetchRejection = !!S, this.allowStaleOnFetchAbort = !!T, this.ignoreFetchAbort = !!z, this.maxEntrySize !== 0) {
|
|
4011
|
+
if (a(this, ge) !== 0 && !Ne(a(this, ge)))
|
|
4010
4012
|
throw new TypeError("maxSize must be a positive integer if specified");
|
|
4011
|
-
if (!
|
|
4013
|
+
if (!Ne(this.maxEntrySize))
|
|
4012
4014
|
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
4013
|
-
|
|
4015
|
+
F(this, Vt, Zn).call(this);
|
|
4014
4016
|
}
|
|
4015
|
-
if (this.allowStale = !!c, this.noDeleteOnStaleGet = !!w, this.updateAgeOnGet = !!r, this.updateAgeOnHas = !!o, this.ttlResolution =
|
|
4016
|
-
if (!
|
|
4017
|
+
if (this.allowStale = !!c, this.noDeleteOnStaleGet = !!w, this.updateAgeOnGet = !!r, this.updateAgeOnHas = !!o, this.ttlResolution = Ne(i) || i === 0 ? i : 1, this.ttlAutopurge = !!l, this.ttl = n || 0, this.ttl) {
|
|
4018
|
+
if (!Ne(this.ttl))
|
|
4017
4019
|
throw new TypeError("ttl must be a positive integer if specified");
|
|
4018
|
-
|
|
4020
|
+
F(this, bt, Jt).call(this);
|
|
4019
4021
|
}
|
|
4020
|
-
if (a(this,
|
|
4022
|
+
if (a(this, ye) === 0 && this.ttl === 0 && a(this, ge) === 0)
|
|
4021
4023
|
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
4022
|
-
if (!this.ttlAutopurge && !a(this,
|
|
4023
|
-
const
|
|
4024
|
-
hs(
|
|
4024
|
+
if (!this.ttlAutopurge && !a(this, ye) && !a(this, ge)) {
|
|
4025
|
+
const A = "LRU_CACHE_UNBOUNDED";
|
|
4026
|
+
hs(A) && (Kn.add(A), ds("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", A, un));
|
|
4025
4027
|
}
|
|
4026
4028
|
}
|
|
4027
4029
|
/**
|
|
@@ -4036,45 +4038,45 @@ const dn = class {
|
|
|
4036
4038
|
static unsafeExposeInternals(e) {
|
|
4037
4039
|
return {
|
|
4038
4040
|
// properties
|
|
4039
|
-
starts: a(e,
|
|
4040
|
-
ttls: a(e,
|
|
4041
|
-
sizes: a(e,
|
|
4041
|
+
starts: a(e, He),
|
|
4042
|
+
ttls: a(e, Se),
|
|
4043
|
+
sizes: a(e, De),
|
|
4042
4044
|
keyMap: a(e, re),
|
|
4043
|
-
keyList: a(e,
|
|
4044
|
-
valList: a(e,
|
|
4045
|
-
next: a(e,
|
|
4046
|
-
prev: a(e,
|
|
4045
|
+
keyList: a(e, X),
|
|
4046
|
+
valList: a(e, H),
|
|
4047
|
+
next: a(e, fe),
|
|
4048
|
+
prev: a(e, pe),
|
|
4047
4049
|
get head() {
|
|
4048
|
-
return a(e,
|
|
4050
|
+
return a(e, he);
|
|
4049
4051
|
},
|
|
4050
4052
|
get tail() {
|
|
4051
|
-
return a(e,
|
|
4053
|
+
return a(e, ce);
|
|
4052
4054
|
},
|
|
4053
|
-
free: a(e,
|
|
4055
|
+
free: a(e, $e),
|
|
4054
4056
|
// methods
|
|
4055
4057
|
isBackgroundFetch: (t) => {
|
|
4056
4058
|
var n;
|
|
4057
|
-
return
|
|
4059
|
+
return F(n = e, Q, J).call(n, t);
|
|
4058
4060
|
},
|
|
4059
4061
|
backgroundFetch: (t, n, i, l) => {
|
|
4060
4062
|
var r;
|
|
4061
|
-
return
|
|
4063
|
+
return F(r = e, ct, Mt).call(r, t, n, i, l);
|
|
4062
4064
|
},
|
|
4063
4065
|
moveToTail: (t) => {
|
|
4064
4066
|
var n;
|
|
4065
|
-
return
|
|
4067
|
+
return F(n = e, Ye, vt).call(n, t);
|
|
4066
4068
|
},
|
|
4067
4069
|
indexes: (t) => {
|
|
4068
4070
|
var n;
|
|
4069
|
-
return
|
|
4071
|
+
return F(n = e, Ie, Ue).call(n, t);
|
|
4070
4072
|
},
|
|
4071
4073
|
rindexes: (t) => {
|
|
4072
4074
|
var n;
|
|
4073
|
-
return
|
|
4075
|
+
return F(n = e, Le, qe).call(n, t);
|
|
4074
4076
|
},
|
|
4075
4077
|
isStale: (t) => {
|
|
4076
4078
|
var n;
|
|
4077
|
-
return a(n = e,
|
|
4079
|
+
return a(n = e, ve).call(n, t);
|
|
4078
4080
|
}
|
|
4079
4081
|
};
|
|
4080
4082
|
}
|
|
@@ -4083,19 +4085,19 @@ const dn = class {
|
|
|
4083
4085
|
* {@link LRUCache.OptionsBase.max} (read-only)
|
|
4084
4086
|
*/
|
|
4085
4087
|
get max() {
|
|
4086
|
-
return a(this,
|
|
4088
|
+
return a(this, ye);
|
|
4087
4089
|
}
|
|
4088
4090
|
/**
|
|
4089
4091
|
* {@link LRUCache.OptionsBase.maxSize} (read-only)
|
|
4090
4092
|
*/
|
|
4091
4093
|
get maxSize() {
|
|
4092
|
-
return a(this,
|
|
4094
|
+
return a(this, ge);
|
|
4093
4095
|
}
|
|
4094
4096
|
/**
|
|
4095
4097
|
* The total computed size of items in the cache (read-only)
|
|
4096
4098
|
*/
|
|
4097
4099
|
get calculatedSize() {
|
|
4098
|
-
return a(this,
|
|
4100
|
+
return a(this, xe);
|
|
4099
4101
|
}
|
|
4100
4102
|
/**
|
|
4101
4103
|
* The number of items stored in the cache (read-only)
|
|
@@ -4107,19 +4109,19 @@ const dn = class {
|
|
|
4107
4109
|
* {@link LRUCache.OptionsBase.fetchMethod} (read-only)
|
|
4108
4110
|
*/
|
|
4109
4111
|
get fetchMethod() {
|
|
4110
|
-
return a(this,
|
|
4112
|
+
return a(this, ot);
|
|
4111
4113
|
}
|
|
4112
4114
|
/**
|
|
4113
4115
|
* {@link LRUCache.OptionsBase.dispose} (read-only)
|
|
4114
4116
|
*/
|
|
4115
4117
|
get dispose() {
|
|
4116
|
-
return a(this,
|
|
4118
|
+
return a(this, _e);
|
|
4117
4119
|
}
|
|
4118
4120
|
/**
|
|
4119
4121
|
* {@link LRUCache.OptionsBase.disposeAfter} (read-only)
|
|
4120
4122
|
*/
|
|
4121
4123
|
get disposeAfter() {
|
|
4122
|
-
return a(this,
|
|
4124
|
+
return a(this, we);
|
|
4123
4125
|
}
|
|
4124
4126
|
/**
|
|
4125
4127
|
* Return the remaining TTL time for a given entry key
|
|
@@ -4132,8 +4134,8 @@ const dn = class {
|
|
|
4132
4134
|
* in order from most recently used to least recently used.
|
|
4133
4135
|
*/
|
|
4134
4136
|
*entries() {
|
|
4135
|
-
for (const e of
|
|
4136
|
-
a(this,
|
|
4137
|
+
for (const e of F(this, Ie, Ue).call(this))
|
|
4138
|
+
a(this, H)[e] !== void 0 && a(this, X)[e] !== void 0 && !F(this, Q, J).call(this, a(this, H)[e]) && (yield [a(this, X)[e], a(this, H)[e]]);
|
|
4137
4139
|
}
|
|
4138
4140
|
/**
|
|
4139
4141
|
* Inverse order version of {@link LRUCache.entries}
|
|
@@ -4142,17 +4144,17 @@ const dn = class {
|
|
|
4142
4144
|
* in order from least recently used to most recently used.
|
|
4143
4145
|
*/
|
|
4144
4146
|
*rentries() {
|
|
4145
|
-
for (const e of
|
|
4146
|
-
a(this,
|
|
4147
|
+
for (const e of F(this, Le, qe).call(this))
|
|
4148
|
+
a(this, H)[e] !== void 0 && a(this, X)[e] !== void 0 && !F(this, Q, J).call(this, a(this, H)[e]) && (yield [a(this, X)[e], a(this, H)[e]]);
|
|
4147
4149
|
}
|
|
4148
4150
|
/**
|
|
4149
4151
|
* Return a generator yielding the keys in the cache,
|
|
4150
4152
|
* in order from most recently used to least recently used.
|
|
4151
4153
|
*/
|
|
4152
4154
|
*keys() {
|
|
4153
|
-
for (const e of
|
|
4154
|
-
const t = a(this,
|
|
4155
|
-
t !== void 0 && !
|
|
4155
|
+
for (const e of F(this, Ie, Ue).call(this)) {
|
|
4156
|
+
const t = a(this, X)[e];
|
|
4157
|
+
t !== void 0 && !F(this, Q, J).call(this, a(this, H)[e]) && (yield t);
|
|
4156
4158
|
}
|
|
4157
4159
|
}
|
|
4158
4160
|
/**
|
|
@@ -4162,9 +4164,9 @@ const dn = class {
|
|
|
4162
4164
|
* in order from least recently used to most recently used.
|
|
4163
4165
|
*/
|
|
4164
4166
|
*rkeys() {
|
|
4165
|
-
for (const e of
|
|
4166
|
-
const t = a(this,
|
|
4167
|
-
t !== void 0 && !
|
|
4167
|
+
for (const e of F(this, Le, qe).call(this)) {
|
|
4168
|
+
const t = a(this, X)[e];
|
|
4169
|
+
t !== void 0 && !F(this, Q, J).call(this, a(this, H)[e]) && (yield t);
|
|
4168
4170
|
}
|
|
4169
4171
|
}
|
|
4170
4172
|
/**
|
|
@@ -4172,8 +4174,8 @@ const dn = class {
|
|
|
4172
4174
|
* in order from most recently used to least recently used.
|
|
4173
4175
|
*/
|
|
4174
4176
|
*values() {
|
|
4175
|
-
for (const e of
|
|
4176
|
-
a(this,
|
|
4177
|
+
for (const e of F(this, Ie, Ue).call(this))
|
|
4178
|
+
a(this, H)[e] !== void 0 && !F(this, Q, J).call(this, a(this, H)[e]) && (yield a(this, H)[e]);
|
|
4177
4179
|
}
|
|
4178
4180
|
/**
|
|
4179
4181
|
* Inverse order version of {@link LRUCache.values}
|
|
@@ -4182,8 +4184,8 @@ const dn = class {
|
|
|
4182
4184
|
* in order from least recently used to most recently used.
|
|
4183
4185
|
*/
|
|
4184
4186
|
*rvalues() {
|
|
4185
|
-
for (const e of
|
|
4186
|
-
a(this,
|
|
4187
|
+
for (const e of F(this, Le, qe).call(this))
|
|
4188
|
+
a(this, H)[e] !== void 0 && !F(this, Q, J).call(this, a(this, H)[e]) && (yield a(this, H)[e]);
|
|
4187
4189
|
}
|
|
4188
4190
|
/**
|
|
4189
4191
|
* Iterating over the cache itself yields the same results as
|
|
@@ -4197,10 +4199,10 @@ const dn = class {
|
|
|
4197
4199
|
* similar to Array.find(). fn is called as fn(value, key, cache).
|
|
4198
4200
|
*/
|
|
4199
4201
|
find(e, t = {}) {
|
|
4200
|
-
for (const n of
|
|
4201
|
-
const i = a(this,
|
|
4202
|
-
if (l !== void 0 && e(l, a(this,
|
|
4203
|
-
return this.get(a(this,
|
|
4202
|
+
for (const n of F(this, Ie, Ue).call(this)) {
|
|
4203
|
+
const i = a(this, H)[n], l = F(this, Q, J).call(this, i) ? i.__staleWhileFetching : i;
|
|
4204
|
+
if (l !== void 0 && e(l, a(this, X)[n], this))
|
|
4205
|
+
return this.get(a(this, X)[n], t);
|
|
4204
4206
|
}
|
|
4205
4207
|
}
|
|
4206
4208
|
/**
|
|
@@ -4210,9 +4212,9 @@ const dn = class {
|
|
|
4210
4212
|
* Does not iterate over stale values.
|
|
4211
4213
|
*/
|
|
4212
4214
|
forEach(e, t = this) {
|
|
4213
|
-
for (const n of
|
|
4214
|
-
const i = a(this,
|
|
4215
|
-
l !== void 0 && e.call(t, l, a(this,
|
|
4215
|
+
for (const n of F(this, Ie, Ue).call(this)) {
|
|
4216
|
+
const i = a(this, H)[n], l = F(this, Q, J).call(this, i) ? i.__staleWhileFetching : i;
|
|
4217
|
+
l !== void 0 && e.call(t, l, a(this, X)[n], this);
|
|
4216
4218
|
}
|
|
4217
4219
|
}
|
|
4218
4220
|
/**
|
|
@@ -4220,9 +4222,9 @@ const dn = class {
|
|
|
4220
4222
|
* reverse order. (ie, less recently used items are iterated over first.)
|
|
4221
4223
|
*/
|
|
4222
4224
|
rforEach(e, t = this) {
|
|
4223
|
-
for (const n of
|
|
4224
|
-
const i = a(this,
|
|
4225
|
-
l !== void 0 && e.call(t, l, a(this,
|
|
4225
|
+
for (const n of F(this, Le, qe).call(this)) {
|
|
4226
|
+
const i = a(this, H)[n], l = F(this, Q, J).call(this, i) ? i.__staleWhileFetching : i;
|
|
4227
|
+
l !== void 0 && e.call(t, l, a(this, X)[n], this);
|
|
4226
4228
|
}
|
|
4227
4229
|
}
|
|
4228
4230
|
/**
|
|
@@ -4231,8 +4233,8 @@ const dn = class {
|
|
|
4231
4233
|
*/
|
|
4232
4234
|
purgeStale() {
|
|
4233
4235
|
let e = !1;
|
|
4234
|
-
for (const t of
|
|
4235
|
-
a(this,
|
|
4236
|
+
for (const t of F(this, Le, qe).call(this, { allowStale: !0 }))
|
|
4237
|
+
a(this, ve).call(this, t) && (this.delete(a(this, X)[t]), e = !0);
|
|
4236
4238
|
return e;
|
|
4237
4239
|
}
|
|
4238
4240
|
/**
|
|
@@ -4241,17 +4243,17 @@ const dn = class {
|
|
|
4241
4243
|
*/
|
|
4242
4244
|
dump() {
|
|
4243
4245
|
const e = [];
|
|
4244
|
-
for (const t of
|
|
4245
|
-
const n = a(this,
|
|
4246
|
+
for (const t of F(this, Ie, Ue).call(this, { allowStale: !0 })) {
|
|
4247
|
+
const n = a(this, X)[t], i = a(this, H)[t], l = F(this, Q, J).call(this, i) ? i.__staleWhileFetching : i;
|
|
4246
4248
|
if (l === void 0 || n === void 0)
|
|
4247
4249
|
continue;
|
|
4248
4250
|
const r = { value: l };
|
|
4249
|
-
if (a(this,
|
|
4250
|
-
r.ttl = a(this,
|
|
4251
|
-
const o =
|
|
4251
|
+
if (a(this, Se) && a(this, He)) {
|
|
4252
|
+
r.ttl = a(this, Se)[t];
|
|
4253
|
+
const o = mt.now() - a(this, He)[t];
|
|
4252
4254
|
r.start = Math.floor(Date.now() - o);
|
|
4253
4255
|
}
|
|
4254
|
-
a(this,
|
|
4256
|
+
a(this, De) && (r.size = a(this, De)[t]), e.unshift([n, r]);
|
|
4255
4257
|
}
|
|
4256
4258
|
return e;
|
|
4257
4259
|
}
|
|
@@ -4265,7 +4267,7 @@ const dn = class {
|
|
|
4265
4267
|
for (const [t, n] of e) {
|
|
4266
4268
|
if (n.start) {
|
|
4267
4269
|
const i = Date.now() - n.start;
|
|
4268
|
-
n.start =
|
|
4270
|
+
n.start = mt.now() - i;
|
|
4269
4271
|
}
|
|
4270
4272
|
this.set(t, n.value, n);
|
|
4271
4273
|
}
|
|
@@ -4277,29 +4279,29 @@ const dn = class {
|
|
|
4277
4279
|
var v, g, $;
|
|
4278
4280
|
const { ttl: i = this.ttl, start: l, noDisposeOnSet: r = this.noDisposeOnSet, sizeCalculation: o = this.sizeCalculation, status: c } = n;
|
|
4279
4281
|
let { noUpdateTTL: f = this.noUpdateTTL } = n;
|
|
4280
|
-
const h = a(this,
|
|
4282
|
+
const h = a(this, yt).call(this, e, t, n.size || 0, o);
|
|
4281
4283
|
if (this.maxEntrySize && h > this.maxEntrySize)
|
|
4282
4284
|
return c && (c.set = "miss", c.maxEntrySizeExceeded = !0), this.delete(e), this;
|
|
4283
4285
|
let m = a(this, oe) === 0 ? void 0 : a(this, re).get(e);
|
|
4284
4286
|
if (m === void 0)
|
|
4285
|
-
m = a(this, oe) === 0 ? a(this,
|
|
4287
|
+
m = a(this, oe) === 0 ? a(this, ce) : a(this, $e).length !== 0 ? a(this, $e).pop() : a(this, oe) === a(this, ye) ? F(this, at, Pt).call(this, !1) : a(this, oe), a(this, X)[m] = e, a(this, H)[m] = t, a(this, re).set(e, m), a(this, fe)[a(this, ce)] = m, a(this, pe)[m] = a(this, ce), O(this, ce, m), Lt(this, oe)._++, a(this, rt).call(this, m, h, c), c && (c.set = "add"), f = !1;
|
|
4286
4288
|
else {
|
|
4287
|
-
|
|
4288
|
-
const b = a(this,
|
|
4289
|
+
F(this, Ye, vt).call(this, m);
|
|
4290
|
+
const b = a(this, H)[m];
|
|
4289
4291
|
if (t !== b) {
|
|
4290
|
-
if (a(this,
|
|
4292
|
+
if (a(this, Ve) && F(this, Q, J).call(this, b) ? b.__abortController.abort(new Error("replaced")) : r || (a(this, Ae) && ((v = a(this, _e)) == null || v.call(this, b, e, "set")), a(this, me) && ((g = a(this, ue)) == null || g.push([b, e, "set"]))), a(this, Qe).call(this, m), a(this, rt).call(this, m, h, c), a(this, H)[m] = t, c) {
|
|
4291
4293
|
c.set = "replace";
|
|
4292
|
-
const
|
|
4293
|
-
|
|
4294
|
+
const y = b && F(this, Q, J).call(this, b) ? b.__staleWhileFetching : b;
|
|
4295
|
+
y !== void 0 && (c.oldValue = y);
|
|
4294
4296
|
}
|
|
4295
4297
|
} else
|
|
4296
4298
|
c && (c.set = "update");
|
|
4297
4299
|
}
|
|
4298
|
-
if (i !== 0 && !a(this,
|
|
4299
|
-
const b = a(this,
|
|
4300
|
-
let
|
|
4301
|
-
for (;
|
|
4302
|
-
($ = a(this,
|
|
4300
|
+
if (i !== 0 && !a(this, Se) && F(this, bt, Jt).call(this), a(this, Se) && (f || a(this, kt).call(this, m, i, l), c && a(this, je).call(this, c, m)), !r && a(this, me) && a(this, ue)) {
|
|
4301
|
+
const b = a(this, ue);
|
|
4302
|
+
let y;
|
|
4303
|
+
for (; y = b == null ? void 0 : b.shift(); )
|
|
4304
|
+
($ = a(this, we)) == null || $.call(this, ...y);
|
|
4303
4305
|
}
|
|
4304
4306
|
return this;
|
|
4305
4307
|
}
|
|
@@ -4311,19 +4313,19 @@ const dn = class {
|
|
|
4311
4313
|
var e;
|
|
4312
4314
|
try {
|
|
4313
4315
|
for (; a(this, oe); ) {
|
|
4314
|
-
const t = a(this,
|
|
4315
|
-
if (
|
|
4316
|
+
const t = a(this, H)[a(this, he)];
|
|
4317
|
+
if (F(this, at, Pt).call(this, !0), F(this, Q, J).call(this, t)) {
|
|
4316
4318
|
if (t.__staleWhileFetching)
|
|
4317
4319
|
return t.__staleWhileFetching;
|
|
4318
4320
|
} else if (t !== void 0)
|
|
4319
4321
|
return t;
|
|
4320
4322
|
}
|
|
4321
4323
|
} finally {
|
|
4322
|
-
if (a(this,
|
|
4323
|
-
const t = a(this,
|
|
4324
|
+
if (a(this, me) && a(this, ue)) {
|
|
4325
|
+
const t = a(this, ue);
|
|
4324
4326
|
let n;
|
|
4325
4327
|
for (; n = t == null ? void 0 : t.shift(); )
|
|
4326
|
-
(e = a(this,
|
|
4328
|
+
(e = a(this, we)) == null || e.call(this, ...n);
|
|
4327
4329
|
}
|
|
4328
4330
|
}
|
|
4329
4331
|
}
|
|
@@ -4338,10 +4340,10 @@ const dn = class {
|
|
|
4338
4340
|
has(e, t = {}) {
|
|
4339
4341
|
const { updateAgeOnHas: n = this.updateAgeOnHas, status: i } = t, l = a(this, re).get(e);
|
|
4340
4342
|
if (l !== void 0)
|
|
4341
|
-
if (a(this,
|
|
4342
|
-
i && (i.has = "stale", a(this,
|
|
4343
|
+
if (a(this, ve).call(this, l))
|
|
4344
|
+
i && (i.has = "stale", a(this, je).call(this, i, l));
|
|
4343
4345
|
else
|
|
4344
|
-
return n && a(this,
|
|
4346
|
+
return n && a(this, Xe).call(this, l), i && (i.has = "hit", a(this, je).call(this, i, l)), !0;
|
|
4345
4347
|
else
|
|
4346
4348
|
i && (i.has = "miss");
|
|
4347
4349
|
return !1;
|
|
@@ -4355,9 +4357,9 @@ const dn = class {
|
|
|
4355
4357
|
*/
|
|
4356
4358
|
peek(e, t = {}) {
|
|
4357
4359
|
const { allowStale: n = this.allowStale } = t, i = a(this, re).get(e);
|
|
4358
|
-
if (i !== void 0 && (n || !a(this,
|
|
4359
|
-
const l = a(this,
|
|
4360
|
-
return
|
|
4360
|
+
if (i !== void 0 && (n || !a(this, ve).call(this, i))) {
|
|
4361
|
+
const l = a(this, H)[i];
|
|
4362
|
+
return F(this, Q, J).call(this, l) ? l.__staleWhileFetching : l;
|
|
4361
4363
|
}
|
|
4362
4364
|
}
|
|
4363
4365
|
async fetch(e, t = {}) {
|
|
@@ -4378,11 +4380,11 @@ const dn = class {
|
|
|
4378
4380
|
ignoreFetchAbort: g = this.ignoreFetchAbort,
|
|
4379
4381
|
allowStaleOnFetchAbort: $ = this.allowStaleOnFetchAbort,
|
|
4380
4382
|
context: b,
|
|
4381
|
-
forceRefresh:
|
|
4383
|
+
forceRefresh: y = !1,
|
|
4382
4384
|
status: p,
|
|
4383
4385
|
signal: w
|
|
4384
4386
|
} = t;
|
|
4385
|
-
if (!a(this,
|
|
4387
|
+
if (!a(this, Ve))
|
|
4386
4388
|
return p && (p.fetch = "get"), this.get(e, {
|
|
4387
4389
|
allowStale: n,
|
|
4388
4390
|
updateAgeOnGet: i,
|
|
@@ -4405,22 +4407,22 @@ const dn = class {
|
|
|
4405
4407
|
status: p,
|
|
4406
4408
|
signal: w
|
|
4407
4409
|
};
|
|
4408
|
-
let
|
|
4409
|
-
if (
|
|
4410
|
+
let T = a(this, re).get(e);
|
|
4411
|
+
if (T === void 0) {
|
|
4410
4412
|
p && (p.fetch = "miss");
|
|
4411
|
-
const
|
|
4412
|
-
return
|
|
4413
|
+
const z = F(this, ct, Mt).call(this, e, T, S, b);
|
|
4414
|
+
return z.__returned = z;
|
|
4413
4415
|
} else {
|
|
4414
|
-
const
|
|
4415
|
-
if (
|
|
4416
|
-
const
|
|
4417
|
-
return p && (p.fetch = "inflight",
|
|
4416
|
+
const z = a(this, H)[T];
|
|
4417
|
+
if (F(this, Q, J).call(this, z)) {
|
|
4418
|
+
const U = n && z.__staleWhileFetching !== void 0;
|
|
4419
|
+
return p && (p.fetch = "inflight", U && (p.returnedStale = !0)), U ? z.__staleWhileFetching : z.__returned = z;
|
|
4418
4420
|
}
|
|
4419
|
-
const M = a(this,
|
|
4420
|
-
if (!
|
|
4421
|
-
return p && (p.fetch = "hit"),
|
|
4422
|
-
const
|
|
4423
|
-
return p && (p.fetch = M ? "stale" : "refresh",
|
|
4421
|
+
const M = a(this, ve).call(this, T);
|
|
4422
|
+
if (!y && !M)
|
|
4423
|
+
return p && (p.fetch = "hit"), F(this, Ye, vt).call(this, T), i && a(this, Xe).call(this, T), p && a(this, je).call(this, p, T), z;
|
|
4424
|
+
const A = F(this, ct, Mt).call(this, e, T, S, b), K = A.__staleWhileFetching !== void 0 && n;
|
|
4425
|
+
return p && (p.fetch = M ? "stale" : "refresh", K && M && (p.returnedStale = !0)), K ? A.__staleWhileFetching : A.__returned = A;
|
|
4424
4426
|
}
|
|
4425
4427
|
}
|
|
4426
4428
|
/**
|
|
@@ -4432,8 +4434,8 @@ const dn = class {
|
|
|
4432
4434
|
get(e, t = {}) {
|
|
4433
4435
|
const { allowStale: n = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: l = this.noDeleteOnStaleGet, status: r } = t, o = a(this, re).get(e);
|
|
4434
4436
|
if (o !== void 0) {
|
|
4435
|
-
const c = a(this,
|
|
4436
|
-
return r && a(this,
|
|
4437
|
+
const c = a(this, H)[o], f = F(this, Q, J).call(this, c);
|
|
4438
|
+
return r && a(this, je).call(this, r, o), a(this, ve).call(this, o) ? (r && (r.get = "stale"), f ? (r && n && c.__staleWhileFetching !== void 0 && (r.returnedStale = !0), n ? c.__staleWhileFetching : void 0) : (l || this.delete(e), r && n && (r.returnedStale = !0), n ? c : void 0)) : (r && (r.get = "hit"), f ? c.__staleWhileFetching : (F(this, Ye, vt).call(this, o), i && a(this, Xe).call(this, o), c));
|
|
4437
4439
|
} else
|
|
4438
4440
|
r && (r.get = "miss");
|
|
4439
4441
|
}
|
|
@@ -4450,16 +4452,16 @@ const dn = class {
|
|
|
4450
4452
|
if (t = !0, a(this, oe) === 1)
|
|
4451
4453
|
this.clear();
|
|
4452
4454
|
else {
|
|
4453
|
-
a(this,
|
|
4454
|
-
const c = a(this,
|
|
4455
|
-
|
|
4455
|
+
a(this, Qe).call(this, o);
|
|
4456
|
+
const c = a(this, H)[o];
|
|
4457
|
+
F(this, Q, J).call(this, c) ? c.__abortController.abort(new Error("deleted")) : (a(this, Ae) || a(this, me)) && (a(this, Ae) && ((n = a(this, _e)) == null || n.call(this, c, e, "delete")), a(this, me) && ((i = a(this, ue)) == null || i.push([c, e, "delete"]))), a(this, re).delete(e), a(this, X)[o] = void 0, a(this, H)[o] = void 0, o === a(this, ce) ? O(this, ce, a(this, pe)[o]) : o === a(this, he) ? O(this, he, a(this, fe)[o]) : (a(this, fe)[a(this, pe)[o]] = a(this, fe)[o], a(this, pe)[a(this, fe)[o]] = a(this, pe)[o]), Lt(this, oe)._--, a(this, $e).push(o);
|
|
4456
4458
|
}
|
|
4457
4459
|
}
|
|
4458
|
-
if (a(this,
|
|
4459
|
-
const o = a(this,
|
|
4460
|
+
if (a(this, me) && ((l = a(this, ue)) != null && l.length)) {
|
|
4461
|
+
const o = a(this, ue);
|
|
4460
4462
|
let c;
|
|
4461
4463
|
for (; c = o == null ? void 0 : o.shift(); )
|
|
4462
|
-
(r = a(this,
|
|
4464
|
+
(r = a(this, we)) == null || r.call(this, ...c);
|
|
4463
4465
|
}
|
|
4464
4466
|
return t;
|
|
4465
4467
|
}
|
|
@@ -4468,36 +4470,36 @@ const dn = class {
|
|
|
4468
4470
|
*/
|
|
4469
4471
|
clear() {
|
|
4470
4472
|
var e, t, n;
|
|
4471
|
-
for (const i of
|
|
4472
|
-
const l = a(this,
|
|
4473
|
-
if (
|
|
4473
|
+
for (const i of F(this, Le, qe).call(this, { allowStale: !0 })) {
|
|
4474
|
+
const l = a(this, H)[i];
|
|
4475
|
+
if (F(this, Q, J).call(this, l))
|
|
4474
4476
|
l.__abortController.abort(new Error("deleted"));
|
|
4475
4477
|
else {
|
|
4476
|
-
const r = a(this,
|
|
4477
|
-
a(this,
|
|
4478
|
+
const r = a(this, X)[i];
|
|
4479
|
+
a(this, Ae) && ((e = a(this, _e)) == null || e.call(this, l, r, "delete")), a(this, me) && ((t = a(this, ue)) == null || t.push([l, r, "delete"]));
|
|
4478
4480
|
}
|
|
4479
4481
|
}
|
|
4480
|
-
if (a(this, re).clear(), a(this,
|
|
4481
|
-
const i = a(this,
|
|
4482
|
+
if (a(this, re).clear(), a(this, H).fill(void 0), a(this, X).fill(void 0), a(this, Se) && a(this, He) && (a(this, Se).fill(0), a(this, He).fill(0)), a(this, De) && a(this, De).fill(0), O(this, he, 0), O(this, ce, 0), a(this, $e).length = 0, O(this, xe, 0), O(this, oe, 0), a(this, me) && a(this, ue)) {
|
|
4483
|
+
const i = a(this, ue);
|
|
4482
4484
|
let l;
|
|
4483
4485
|
for (; l = i == null ? void 0 : i.shift(); )
|
|
4484
|
-
(n = a(this,
|
|
4486
|
+
(n = a(this, we)) == null || n.call(this, ...l);
|
|
4485
4487
|
}
|
|
4486
4488
|
}
|
|
4487
4489
|
};
|
|
4488
|
-
let
|
|
4489
|
-
|
|
4490
|
-
const e = new Ht(a(this,
|
|
4491
|
-
|
|
4490
|
+
let Yt = un;
|
|
4491
|
+
ye = new WeakMap(), ge = new WeakMap(), _e = new WeakMap(), we = new WeakMap(), ot = new WeakMap(), oe = new WeakMap(), xe = new WeakMap(), re = new WeakMap(), X = new WeakMap(), H = new WeakMap(), fe = new WeakMap(), pe = new WeakMap(), he = new WeakMap(), ce = new WeakMap(), $e = new WeakMap(), ue = new WeakMap(), De = new WeakMap(), He = new WeakMap(), Se = new WeakMap(), Ae = new WeakMap(), Ve = new WeakMap(), me = new WeakMap(), bt = new WeakSet(), Jt = function() {
|
|
4492
|
+
const e = new Ht(a(this, ye)), t = new Ht(a(this, ye));
|
|
4493
|
+
O(this, Se, e), O(this, He, t), O(this, kt, (l, r, o = mt.now()) => {
|
|
4492
4494
|
if (t[l] = r !== 0 ? o : 0, e[l] = r, r !== 0 && this.ttlAutopurge) {
|
|
4493
4495
|
const c = setTimeout(() => {
|
|
4494
|
-
a(this,
|
|
4496
|
+
a(this, ve).call(this, l) && this.delete(a(this, X)[l]);
|
|
4495
4497
|
}, r + 1);
|
|
4496
4498
|
c.unref && c.unref();
|
|
4497
4499
|
}
|
|
4498
|
-
}),
|
|
4499
|
-
t[l] = e[l] !== 0 ?
|
|
4500
|
-
}),
|
|
4500
|
+
}), O(this, Xe, (l) => {
|
|
4501
|
+
t[l] = e[l] !== 0 ? mt.now() : 0;
|
|
4502
|
+
}), O(this, je, (l, r) => {
|
|
4501
4503
|
if (e[r]) {
|
|
4502
4504
|
const o = e[r], c = t[r];
|
|
4503
4505
|
l.ttl = o, l.start = c, l.now = n || i(), l.remainingTTL = l.now + o - c;
|
|
@@ -4505,7 +4507,7 @@ $e = new WeakMap(), be = new WeakMap(), Le = new WeakMap(), Se = new WeakMap(),
|
|
|
4505
4507
|
});
|
|
4506
4508
|
let n = 0;
|
|
4507
4509
|
const i = () => {
|
|
4508
|
-
const l =
|
|
4510
|
+
const l = mt.now();
|
|
4509
4511
|
if (this.ttlResolution > 0) {
|
|
4510
4512
|
n = l;
|
|
4511
4513
|
const r = setTimeout(() => n = 0, this.ttlResolution);
|
|
@@ -4516,48 +4518,48 @@ $e = new WeakMap(), be = new WeakMap(), Le = new WeakMap(), Se = new WeakMap(),
|
|
|
4516
4518
|
this.getRemainingTTL = (l) => {
|
|
4517
4519
|
const r = a(this, re).get(l);
|
|
4518
4520
|
return r === void 0 ? 0 : e[r] === 0 || t[r] === 0 ? 1 / 0 : t[r] + e[r] - (n || i());
|
|
4519
|
-
},
|
|
4520
|
-
},
|
|
4521
|
-
const e = new Ht(a(this,
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
}),
|
|
4525
|
-
if (
|
|
4521
|
+
}, O(this, ve, (l) => e[l] !== 0 && t[l] !== 0 && (n || i()) - t[l] > e[l]);
|
|
4522
|
+
}, Xe = new WeakMap(), je = new WeakMap(), kt = new WeakMap(), ve = new WeakMap(), Vt = new WeakSet(), Zn = function() {
|
|
4523
|
+
const e = new Ht(a(this, ye));
|
|
4524
|
+
O(this, xe, 0), O(this, De, e), O(this, Qe, (t) => {
|
|
4525
|
+
O(this, xe, a(this, xe) - e[t]), e[t] = 0;
|
|
4526
|
+
}), O(this, yt, (t, n, i, l) => {
|
|
4527
|
+
if (F(this, Q, J).call(this, n))
|
|
4526
4528
|
return 0;
|
|
4527
|
-
if (!
|
|
4529
|
+
if (!Ne(i))
|
|
4528
4530
|
if (l) {
|
|
4529
4531
|
if (typeof l != "function")
|
|
4530
4532
|
throw new TypeError("sizeCalculation must be a function");
|
|
4531
|
-
if (i = l(n, t), !
|
|
4533
|
+
if (i = l(n, t), !Ne(i))
|
|
4532
4534
|
throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
4533
4535
|
} else
|
|
4534
4536
|
throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
4535
4537
|
return i;
|
|
4536
|
-
}),
|
|
4537
|
-
if (e[t] = n, a(this,
|
|
4538
|
-
const l = a(this,
|
|
4539
|
-
for (; a(this,
|
|
4540
|
-
|
|
4538
|
+
}), O(this, rt, (t, n, i) => {
|
|
4539
|
+
if (e[t] = n, a(this, ge)) {
|
|
4540
|
+
const l = a(this, ge) - e[t];
|
|
4541
|
+
for (; a(this, xe) > l; )
|
|
4542
|
+
F(this, at, Pt).call(this, !0);
|
|
4541
4543
|
}
|
|
4542
|
-
|
|
4544
|
+
O(this, xe, a(this, xe) + e[t]), i && (i.entrySize = n, i.totalCalculatedSize = a(this, xe));
|
|
4543
4545
|
});
|
|
4544
|
-
},
|
|
4546
|
+
}, Qe = new WeakMap(), rt = new WeakMap(), yt = new WeakMap(), Ie = new WeakSet(), Ue = function* ({ allowStale: e = this.allowStale } = {}) {
|
|
4545
4547
|
if (a(this, oe))
|
|
4546
|
-
for (let t = a(this,
|
|
4547
|
-
t = a(this,
|
|
4548
|
-
},
|
|
4548
|
+
for (let t = a(this, ce); !(!F(this, wt, en).call(this, t) || ((e || !a(this, ve).call(this, t)) && (yield t), t === a(this, he))); )
|
|
4549
|
+
t = a(this, pe)[t];
|
|
4550
|
+
}, Le = new WeakSet(), qe = function* ({ allowStale: e = this.allowStale } = {}) {
|
|
4549
4551
|
if (a(this, oe))
|
|
4550
|
-
for (let t = a(this,
|
|
4551
|
-
t = a(this,
|
|
4552
|
-
},
|
|
4553
|
-
return e !== void 0 && a(this, re).get(a(this,
|
|
4554
|
-
},
|
|
4552
|
+
for (let t = a(this, he); !(!F(this, wt, en).call(this, t) || ((e || !a(this, ve).call(this, t)) && (yield t), t === a(this, ce))); )
|
|
4553
|
+
t = a(this, fe)[t];
|
|
4554
|
+
}, wt = new WeakSet(), en = function(e) {
|
|
4555
|
+
return e !== void 0 && a(this, re).get(a(this, X)[e]) === e;
|
|
4556
|
+
}, at = new WeakSet(), Pt = function(e) {
|
|
4555
4557
|
var l, r;
|
|
4556
|
-
const t = a(this,
|
|
4557
|
-
return a(this,
|
|
4558
|
-
},
|
|
4559
|
-
const l = t === void 0 ? void 0 : a(this,
|
|
4560
|
-
if (
|
|
4558
|
+
const t = a(this, he), n = a(this, X)[t], i = a(this, H)[t];
|
|
4559
|
+
return a(this, Ve) && F(this, Q, J).call(this, i) ? i.__abortController.abort(new Error("evicted")) : (a(this, Ae) || a(this, me)) && (a(this, Ae) && ((l = a(this, _e)) == null || l.call(this, i, n, "evict")), a(this, me) && ((r = a(this, ue)) == null || r.push([i, n, "evict"]))), a(this, Qe).call(this, t), e && (a(this, X)[t] = void 0, a(this, H)[t] = void 0, a(this, $e).push(t)), a(this, oe) === 1 ? (O(this, he, O(this, ce, 0)), a(this, $e).length = 0) : O(this, he, a(this, fe)[t]), a(this, re).delete(n), Lt(this, oe)._--, t;
|
|
4560
|
+
}, ct = new WeakSet(), Mt = function(e, t, n, i) {
|
|
4561
|
+
const l = t === void 0 ? void 0 : a(this, H)[t];
|
|
4562
|
+
if (F(this, Q, J).call(this, l))
|
|
4561
4563
|
return l;
|
|
4562
4564
|
const r = new AbortController(), { signal: o } = n;
|
|
4563
4565
|
o == null || o.addEventListener("abort", () => r.abort(o.reason), {
|
|
@@ -4567,22 +4569,22 @@ $e = new WeakMap(), be = new WeakMap(), Le = new WeakMap(), Se = new WeakMap(),
|
|
|
4567
4569
|
signal: r.signal,
|
|
4568
4570
|
options: n,
|
|
4569
4571
|
context: i
|
|
4570
|
-
}, f = (b,
|
|
4572
|
+
}, f = (b, y = !1) => {
|
|
4571
4573
|
const { aborted: p } = r.signal, w = n.ignoreFetchAbort && b !== void 0;
|
|
4572
|
-
if (n.status && (p && !
|
|
4574
|
+
if (n.status && (p && !y ? (n.status.fetchAborted = !0, n.status.fetchError = r.signal.reason, w && (n.status.fetchAbortIgnored = !0)) : n.status.fetchResolved = !0), p && !w && !y)
|
|
4573
4575
|
return m(r.signal.reason);
|
|
4574
4576
|
const S = g;
|
|
4575
|
-
return a(this,
|
|
4577
|
+
return a(this, H)[t] === g && (b === void 0 ? S.__staleWhileFetching ? a(this, H)[t] = S.__staleWhileFetching : this.delete(e) : (n.status && (n.status.fetchUpdated = !0), this.set(e, b, c.options))), b;
|
|
4576
4578
|
}, h = (b) => (n.status && (n.status.fetchRejected = !0, n.status.fetchError = b), m(b)), m = (b) => {
|
|
4577
|
-
const { aborted:
|
|
4578
|
-
if (a(this,
|
|
4579
|
-
return n.status &&
|
|
4580
|
-
if (
|
|
4579
|
+
const { aborted: y } = r.signal, p = y && n.allowStaleOnFetchAbort, w = p || n.allowStaleOnFetchRejection, S = w || n.noDeleteOnFetchRejection, T = g;
|
|
4580
|
+
if (a(this, H)[t] === g && (!S || T.__staleWhileFetching === void 0 ? this.delete(e) : p || (a(this, H)[t] = T.__staleWhileFetching)), w)
|
|
4581
|
+
return n.status && T.__staleWhileFetching !== void 0 && (n.status.returnedStale = !0), T.__staleWhileFetching;
|
|
4582
|
+
if (T.__returned === T)
|
|
4581
4583
|
throw b;
|
|
4582
|
-
}, v = (b,
|
|
4584
|
+
}, v = (b, y) => {
|
|
4583
4585
|
var w;
|
|
4584
|
-
const p = (w = a(this,
|
|
4585
|
-
p && p instanceof Promise && p.then((S) => b(S),
|
|
4586
|
+
const p = (w = a(this, ot)) == null ? void 0 : w.call(this, e, l, c);
|
|
4587
|
+
p && p instanceof Promise && p.then((S) => b(S), y), r.signal.addEventListener("abort", () => {
|
|
4586
4588
|
(!n.ignoreFetchAbort || n.allowStaleOnFetchAbort) && (b(), n.allowStaleOnFetchAbort && (b = (S) => f(S, !0)));
|
|
4587
4589
|
});
|
|
4588
4590
|
};
|
|
@@ -4592,18 +4594,18 @@ $e = new WeakMap(), be = new WeakMap(), Le = new WeakMap(), Se = new WeakMap(),
|
|
|
4592
4594
|
__staleWhileFetching: l,
|
|
4593
4595
|
__returned: void 0
|
|
4594
4596
|
});
|
|
4595
|
-
return t === void 0 ? (this.set(e, $, { ...c.options, status: void 0 }), t = a(this, re).get(e)) : a(this,
|
|
4596
|
-
},
|
|
4597
|
-
if (!a(this,
|
|
4597
|
+
return t === void 0 ? (this.set(e, $, { ...c.options, status: void 0 }), t = a(this, re).get(e)) : a(this, H)[t] = $, $;
|
|
4598
|
+
}, Q = new WeakSet(), J = function(e) {
|
|
4599
|
+
if (!a(this, Ve))
|
|
4598
4600
|
return !1;
|
|
4599
4601
|
const t = e;
|
|
4600
4602
|
return !!t && t instanceof Promise && t.hasOwnProperty("__staleWhileFetching") && t.__abortController instanceof AbortController;
|
|
4601
|
-
},
|
|
4602
|
-
a(this,
|
|
4603
|
-
},
|
|
4604
|
-
e !== a(this,
|
|
4603
|
+
}, xt = new WeakSet(), tn = function(e, t) {
|
|
4604
|
+
a(this, pe)[t] = e, a(this, fe)[e] = t;
|
|
4605
|
+
}, Ye = new WeakSet(), vt = function(e) {
|
|
4606
|
+
e !== a(this, ce) && (e === a(this, he) ? O(this, he, a(this, fe)[e]) : F(this, xt, tn).call(this, a(this, pe)[e], a(this, fe)[e]), F(this, xt, tn).call(this, a(this, ce), e), O(this, ce, e));
|
|
4605
4607
|
};
|
|
4606
|
-
const fs =
|
|
4608
|
+
const fs = Yt, gt = (s) => {
|
|
4607
4609
|
const e = s.value, t = e.substring(0, s.selectionStart), n = e.substring(s.selectionEnd, e.length), i = t.lastIndexOf(`
|
|
4608
4610
|
`), l = t.substring(0, i + 1), r = n.indexOf(`
|
|
4609
4611
|
`), o = n.substring(
|
|
@@ -4622,7 +4624,7 @@ const fs = Jt, vt = (s) => {
|
|
|
4622
4624
|
subfixSupply: f
|
|
4623
4625
|
};
|
|
4624
4626
|
}, ms = (s, e = "", t, n) => {
|
|
4625
|
-
var m, v, g, $, b,
|
|
4627
|
+
var m, v, g, $, b, y;
|
|
4626
4628
|
let i = "", l = 0, r = 0, o = !1, c, f;
|
|
4627
4629
|
const h = (m = te.editorConfig) == null ? void 0 : m.mermaidTemplate;
|
|
4628
4630
|
if (/^h[1-6]{1}$/.test(s)) {
|
|
@@ -4630,7 +4632,7 @@ const fs = Jt, vt = (s) => {
|
|
|
4630
4632
|
i = `${p} ${e}`, l = p.length + 1;
|
|
4631
4633
|
} else if (s === "prettier") {
|
|
4632
4634
|
const p = window.prettier || ((g = (v = te.editorExtensions) == null ? void 0 : v.prettier) == null ? void 0 : g.prettierInstance), w = [
|
|
4633
|
-
(($ = window.prettierPlugins) == null ? void 0 : $.markdown) || ((
|
|
4635
|
+
(($ = window.prettierPlugins) == null ? void 0 : $.markdown) || ((y = (b = te.editorExtensions) == null ? void 0 : b.prettier) == null ? void 0 : y.parserMarkdownInstance)
|
|
4634
4636
|
];
|
|
4635
4637
|
return !p || w[0] === void 0 ? (x.emit(n.editorId, "errorCatcher", {
|
|
4636
4638
|
name: "prettier",
|
|
@@ -4696,16 +4698,16 @@ ${p}
|
|
|
4696
4698
|
case "table": {
|
|
4697
4699
|
i = "|";
|
|
4698
4700
|
const { selectedShape: p = { x: 1, y: 1 } } = n, { x: w, y: S } = p;
|
|
4699
|
-
for (let
|
|
4701
|
+
for (let T = 0; T <= S; T++)
|
|
4700
4702
|
i += " col |";
|
|
4701
4703
|
i += `
|
|
4702
4704
|
|`;
|
|
4703
|
-
for (let
|
|
4705
|
+
for (let T = 0; T <= S; T++)
|
|
4704
4706
|
i += " - |";
|
|
4705
|
-
for (let
|
|
4707
|
+
for (let T = 0; T <= w; T++) {
|
|
4706
4708
|
i += `
|
|
4707
4709
|
|`;
|
|
4708
|
-
for (let
|
|
4710
|
+
for (let z = 0; z <= S; z++)
|
|
4709
4711
|
i += " content |";
|
|
4710
4712
|
}
|
|
4711
4713
|
l = 2, r = 5 - i.length, o = !0;
|
|
@@ -4718,7 +4720,7 @@ ${p}
|
|
|
4718
4720
|
}
|
|
4719
4721
|
case "image": {
|
|
4720
4722
|
const { desc: p, url: w, urls: S } = n;
|
|
4721
|
-
S instanceof Array ? i = S.reduce((
|
|
4723
|
+
S instanceof Array ? i = S.reduce((T, z) => T + `
|
|
4722
4724
|
`, "") : i = `
|
|
4723
4725
|
`;
|
|
4724
4726
|
break;
|
|
@@ -4728,13 +4730,13 @@ ${p}
|
|
|
4728
4730
|
if (e === "")
|
|
4729
4731
|
i = w;
|
|
4730
4732
|
else if (/\n/.test(e)) {
|
|
4731
|
-
const { prefixStr: S, subfixStr:
|
|
4732
|
-
i = `${
|
|
4733
|
-
`).map((
|
|
4734
|
-
`), c = S.substring(0, S.length -
|
|
4733
|
+
const { prefixStr: S, subfixStr: T, prefixSupply: z, subfixSupply: M } = gt(t);
|
|
4734
|
+
i = `${z}${e}${M}`.split(`
|
|
4735
|
+
`).map((K) => `${w}${K}`).join(`
|
|
4736
|
+
`), c = S.substring(0, S.length - z.length), f = T.substring(M.length, T.length), o = !0, l = p, r = -z.length - M.length;
|
|
4735
4737
|
} else {
|
|
4736
|
-
const
|
|
4737
|
-
/\n$/.test(
|
|
4738
|
+
const T = t.value.substring(0, t.selectionStart);
|
|
4739
|
+
/\n$/.test(T) || T === "" ? (i = `${w}${e}`, o = !0) : i = w;
|
|
4738
4740
|
}
|
|
4739
4741
|
break;
|
|
4740
4742
|
}
|
|
@@ -4742,71 +4744,71 @@ ${p}
|
|
|
4742
4744
|
const { tabWidth: p = 2 } = n, {
|
|
4743
4745
|
prefixStr: w,
|
|
4744
4746
|
prefixStrEndRow: S,
|
|
4745
|
-
subfixStrEndRow:
|
|
4746
|
-
prefixSupply:
|
|
4747
|
+
subfixStrEndRow: T,
|
|
4748
|
+
prefixSupply: z,
|
|
4747
4749
|
subfixSupply: M
|
|
4748
|
-
} =
|
|
4749
|
-
const q = `${
|
|
4750
|
-
if (
|
|
4751
|
-
const
|
|
4752
|
-
return
|
|
4753
|
-
|
|
4750
|
+
} = gt(t), A = new RegExp(`^\\s{${p}}`), k = (K = !1, U = !1) => {
|
|
4751
|
+
const q = `${z}${e}${M}`;
|
|
4752
|
+
if (A.test(q)) {
|
|
4753
|
+
const L = w.length - (U ? 0 : p), D = K ? L + e.length - p : L;
|
|
4754
|
+
return Oe(t, L, D), `${S}${q.replace(
|
|
4755
|
+
A,
|
|
4754
4756
|
""
|
|
4755
|
-
)}${
|
|
4757
|
+
)}${T}`;
|
|
4756
4758
|
} else if (/^\s/.test(q)) {
|
|
4757
|
-
const
|
|
4758
|
-
return
|
|
4759
|
+
const L = q.replace(/^\s/, ""), D = q.length - L.length, B = t.selectionStart - (U ? 0 : D), _ = K ? B + e.length - D : B;
|
|
4760
|
+
return Oe(t, B, _), `${S}${L}${T}`;
|
|
4759
4761
|
} else
|
|
4760
4762
|
i = e;
|
|
4761
4763
|
};
|
|
4762
4764
|
if (e === "") {
|
|
4763
|
-
const
|
|
4764
|
-
if (
|
|
4765
|
-
return
|
|
4765
|
+
const K = k();
|
|
4766
|
+
if (K)
|
|
4767
|
+
return K;
|
|
4766
4768
|
} else if (/\n/.test(e)) {
|
|
4767
|
-
const
|
|
4769
|
+
const U = `${z}${e}${M}`.split(`
|
|
4768
4770
|
`);
|
|
4769
|
-
let [q,
|
|
4770
|
-
const
|
|
4771
|
-
if (
|
|
4772
|
-
return
|
|
4771
|
+
let [q, L] = [0, 0];
|
|
4772
|
+
const D = U.map((B, _) => {
|
|
4773
|
+
if (A.test(B))
|
|
4774
|
+
return _ === 0 && (q = p), L += p, B.replace(A, "");
|
|
4773
4775
|
if (/^\s/.test(B)) {
|
|
4774
|
-
const
|
|
4775
|
-
return
|
|
4776
|
+
const C = B.replace(/^\s/, "");
|
|
4777
|
+
return L += B.length - C.length, C;
|
|
4776
4778
|
}
|
|
4777
4779
|
return B;
|
|
4778
4780
|
}).join(`
|
|
4779
4781
|
`);
|
|
4780
|
-
return
|
|
4782
|
+
return Oe(
|
|
4781
4783
|
t,
|
|
4782
4784
|
t.selectionStart - q,
|
|
4783
|
-
t.selectionEnd -
|
|
4784
|
-
), `${S}${
|
|
4785
|
+
t.selectionEnd - L
|
|
4786
|
+
), `${S}${D}${T}`;
|
|
4785
4787
|
} else {
|
|
4786
|
-
const
|
|
4787
|
-
if (
|
|
4788
|
-
return
|
|
4788
|
+
const K = k(!0, !0);
|
|
4789
|
+
if (K)
|
|
4790
|
+
return K;
|
|
4789
4791
|
}
|
|
4790
4792
|
break;
|
|
4791
4793
|
}
|
|
4792
4794
|
case "ctrlC": {
|
|
4793
|
-
const { prefixSupply: p, subfixSupply: w } =
|
|
4794
|
-
return
|
|
4795
|
+
const { prefixSupply: p, subfixSupply: w } = gt(t);
|
|
4796
|
+
return pt(e === "" ? `${p}${w}` : e), t.value;
|
|
4795
4797
|
}
|
|
4796
4798
|
case "ctrlX": {
|
|
4797
4799
|
const {
|
|
4798
4800
|
prefixStrEndRow: p,
|
|
4799
4801
|
subfixStrEndRow: w,
|
|
4800
4802
|
prefixStr: S,
|
|
4801
|
-
subfixStr:
|
|
4802
|
-
prefixSupply:
|
|
4803
|
+
subfixStr: T,
|
|
4804
|
+
prefixSupply: z,
|
|
4803
4805
|
subfixSupply: M
|
|
4804
|
-
} =
|
|
4805
|
-
return e === "" ? (
|
|
4806
|
+
} = gt(t);
|
|
4807
|
+
return e === "" ? (pt(`${z}${M}`), Oe(t, p.length), `${p}${w.replace(/^\n/, "")}`) : (pt(e), Oe(t, S.length), `${S}${T}`);
|
|
4806
4808
|
}
|
|
4807
4809
|
case "ctrlD": {
|
|
4808
|
-
const { prefixStrEndRow: p, subfixStrEndRow: w } =
|
|
4809
|
-
return
|
|
4810
|
+
const { prefixStrEndRow: p, subfixStrEndRow: w } = gt(t);
|
|
4811
|
+
return Oe(t, p.length), `${p}${w.replace(/^\n/, "")}`;
|
|
4810
4812
|
}
|
|
4811
4813
|
case "flow": {
|
|
4812
4814
|
i = `\`\`\`mermaid
|
|
@@ -4905,7 +4907,7 @@ $$
|
|
|
4905
4907
|
i = w.targetValue, o = w.select, l = w.deviationStart, r = w.deviationEnd;
|
|
4906
4908
|
}
|
|
4907
4909
|
}
|
|
4908
|
-
return
|
|
4910
|
+
return Xt(t, i, {
|
|
4909
4911
|
deviationStart: l,
|
|
4910
4912
|
deviationEnd: r,
|
|
4911
4913
|
select: o,
|
|
@@ -4993,7 +4995,7 @@ $$
|
|
|
4993
4995
|
"success",
|
|
4994
4996
|
"tip",
|
|
4995
4997
|
"warning"
|
|
4996
|
-
],
|
|
4998
|
+
], Zt = new RegExp(`^!!!\\s*(${Xn.join("|")})\\s*(.*)$`), gs = /^!!!\s*$/, ps = {
|
|
4997
4999
|
name: "alert",
|
|
4998
5000
|
level: "block",
|
|
4999
5001
|
start(s) {
|
|
@@ -5004,12 +5006,12 @@ $$
|
|
|
5004
5006
|
},
|
|
5005
5007
|
tokenizer(s) {
|
|
5006
5008
|
const e = s.split(/\n/);
|
|
5007
|
-
if (
|
|
5009
|
+
if (Zt.test(e[0])) {
|
|
5008
5010
|
const t = { x: -1, y: -1 }, n = [];
|
|
5009
5011
|
for (let i = 0, l = e.length; i < l; i++)
|
|
5010
|
-
|
|
5012
|
+
Zt.test(e[i]) ? t.x = i : gs.test(e[i]) && (t.y = i, t.x >= 0 && (n.push({ ...t }), t.x = -1, t.y = -1));
|
|
5011
5013
|
if (n.length) {
|
|
5012
|
-
const i = n[0], [l, r, o] =
|
|
5014
|
+
const i = n[0], [l, r, o] = Zt.exec(e[i.x]) || [], c = e.slice(i.x + 1, i.y).join(`
|
|
5013
5015
|
`), h = {
|
|
5014
5016
|
type: "alert",
|
|
5015
5017
|
raw: e.slice(i.x, i.y + 1).join(`
|
|
@@ -5036,7 +5038,7 @@ $$
|
|
|
5036
5038
|
}
|
|
5037
5039
|
}, vs = typeof window > "u", bs = (s, e, t) => {
|
|
5038
5040
|
var g, $;
|
|
5039
|
-
const n =
|
|
5041
|
+
const n = N("previewOnly"), i = N("historyLength"), l = N("editorId");
|
|
5040
5042
|
if (n)
|
|
5041
5043
|
return;
|
|
5042
5044
|
let r = -1;
|
|
@@ -5053,40 +5055,40 @@ $$
|
|
|
5053
5055
|
}, c = [0, 0];
|
|
5054
5056
|
let f = c;
|
|
5055
5057
|
const h = (b) => {
|
|
5056
|
-
var S,
|
|
5057
|
-
const
|
|
5058
|
-
o.list[o.curr].startPos =
|
|
5058
|
+
var S, T;
|
|
5059
|
+
const y = ((S = e.value) == null ? void 0 : S.selectionStart) || 0, p = ((T = e.value) == null ? void 0 : T.selectionEnd) || 0;
|
|
5060
|
+
o.list[o.curr].startPos = y, o.list[o.curr].endPos = p, o.userUpdated = !1, o.curr = b;
|
|
5059
5061
|
const w = o.list[o.curr];
|
|
5060
|
-
f = [w.startPos, w.endPos], s.onChange(w.content),
|
|
5062
|
+
f = [w.startPos, w.endPos], s.onChange(w.content), Oe(e.value, w.startPos, w.endPos).then(() => {
|
|
5061
5063
|
x.emit(l, "selectTextChange");
|
|
5062
5064
|
});
|
|
5063
5065
|
}, m = (b) => {
|
|
5064
5066
|
var w, S;
|
|
5065
5067
|
clearTimeout(r);
|
|
5066
|
-
const
|
|
5068
|
+
const y = ((w = e.value) == null ? void 0 : w.selectionStart) || 0, p = ((S = e.value) == null ? void 0 : S.selectionEnd) || 0;
|
|
5067
5069
|
r = setTimeout(() => {
|
|
5068
5070
|
if (o.userUpdated) {
|
|
5069
5071
|
o.curr < o.list.length - 1 && (o.list = o.list.slice(0, o.curr + 1)), o.list.length > i && o.list.shift();
|
|
5070
|
-
const
|
|
5072
|
+
const T = o.list.pop() || {
|
|
5071
5073
|
startPos: 0,
|
|
5072
5074
|
endPos: 0,
|
|
5073
5075
|
content: b
|
|
5074
5076
|
};
|
|
5075
|
-
|
|
5077
|
+
T.startPos = f[0], T.endPos = f[1], f = c, Array.prototype.push.call(o.list, T, {
|
|
5076
5078
|
content: b,
|
|
5077
|
-
startPos:
|
|
5079
|
+
startPos: y,
|
|
5078
5080
|
endPos: p
|
|
5079
5081
|
}), o.curr = o.list.length - 1;
|
|
5080
5082
|
} else
|
|
5081
5083
|
o.userUpdated = !0;
|
|
5082
5084
|
}, 150);
|
|
5083
5085
|
}, v = (b) => {
|
|
5084
|
-
var
|
|
5085
|
-
(f === c || b) && (f = [(
|
|
5086
|
+
var y, p;
|
|
5087
|
+
(f === c || b) && (f = [(y = e.value) == null ? void 0 : y.selectionStart, (p = e.value) == null ? void 0 : p.selectionEnd]);
|
|
5086
5088
|
};
|
|
5087
|
-
|
|
5089
|
+
W([Bt(s, "value"), t], () => {
|
|
5088
5090
|
t.value && m(s.value);
|
|
5089
|
-
}),
|
|
5091
|
+
}), W(
|
|
5090
5092
|
() => s.value,
|
|
5091
5093
|
() => {
|
|
5092
5094
|
x.emit(l, "selectTextChange");
|
|
@@ -5114,7 +5116,7 @@ $$
|
|
|
5114
5116
|
});
|
|
5115
5117
|
}, ks = (s, e) => {
|
|
5116
5118
|
var l;
|
|
5117
|
-
const t = (l = te.editorExtensions) == null ? void 0 : l.katex, n = t == null ? void 0 : t.instance, i = ne(
|
|
5119
|
+
const t = (l = te.editorExtensions) == null ? void 0 : l.katex, n = t == null ? void 0 : t.instance, i = ne(!!n);
|
|
5118
5120
|
return s.noKatex || e.use({
|
|
5119
5121
|
extensions: [
|
|
5120
5122
|
On.inline(d, n),
|
|
@@ -5123,163 +5125,155 @@ $$
|
|
|
5123
5125
|
}), ie(() => {
|
|
5124
5126
|
if (!s.noKatex && !n) {
|
|
5125
5127
|
const r = document.createElement("script");
|
|
5126
|
-
r.src = (t == null ? void 0 : t.js) ||
|
|
5128
|
+
r.src = (t == null ? void 0 : t.js) || pn.js, r.onload = () => {
|
|
5127
5129
|
i.value = !0;
|
|
5128
5130
|
}, r.id = `${d}-katex`;
|
|
5129
5131
|
const o = document.createElement("link");
|
|
5130
|
-
o.rel = "stylesheet", o.href = (t == null ? void 0 : t.css) ||
|
|
5132
|
+
o.rel = "stylesheet", o.href = (t == null ? void 0 : t.css) || pn.css, o.id = `${d}-katexCss`, Ce(r, "katex"), Ce(o);
|
|
5131
5133
|
}
|
|
5132
5134
|
}), i;
|
|
5133
5135
|
}, ys = (s) => {
|
|
5134
|
-
var
|
|
5136
|
+
var D, B;
|
|
5135
5137
|
const {
|
|
5136
5138
|
markedRenderer: e,
|
|
5137
5139
|
markedExtensions: t,
|
|
5138
5140
|
markedOptions: n,
|
|
5139
5141
|
editorExtensions: i,
|
|
5140
5142
|
editorConfig: l
|
|
5141
|
-
} = te, r =
|
|
5142
|
-
let
|
|
5143
|
-
const
|
|
5143
|
+
} = te, r = N("showCodeRowNumber"), o = N("editorId"), c = N("highlight"), f = N("previewOnly"), h = N("theme"), m = (D = i == null ? void 0 : i.highlight) == null ? void 0 : D.instance, v = (B = i == null ? void 0 : i.mermaid) == null ? void 0 : B.instance, g = ne(!!m), $ = ne([]);
|
|
5144
|
+
let b = [], y = [];
|
|
5145
|
+
const p = new fs({
|
|
5144
5146
|
max: 1e3,
|
|
5145
5147
|
// 缓存10分钟
|
|
5146
5148
|
ttl: 6e5
|
|
5147
|
-
}),
|
|
5148
|
-
let
|
|
5149
|
-
|
|
5150
|
-
const
|
|
5151
|
-
|
|
5152
|
-
if (!s.noMermaid &&
|
|
5153
|
-
const
|
|
5149
|
+
}), w = $s(s), S = ks(s, I), T = Te(() => (s.noMermaid || w.mermaidInited) && g.value && (s.noKatex || S.value));
|
|
5150
|
+
let z = new I.Renderer();
|
|
5151
|
+
z.image = (_, C, j) => `<span class="figure"><img src="${_}" title="${C || ""}" alt="${j || ""}" zoom><span class="figcaption">${j || ""}</span></span>`, z.listitem = (_, C) => C ? `<li class="li-task">${_}</li>` : `<li>${_}</li>`, e instanceof Function && (z = e(z));
|
|
5152
|
+
const M = z.code;
|
|
5153
|
+
z.code = (_, C, j) => {
|
|
5154
|
+
if (!s.noMermaid && C === "mermaid") {
|
|
5155
|
+
const Z = pi();
|
|
5154
5156
|
try {
|
|
5155
5157
|
if (vs)
|
|
5156
|
-
return `<p class="${d}-mermaid">${
|
|
5158
|
+
return `<p class="${d}-mermaid">${_}</p>`;
|
|
5157
5159
|
{
|
|
5158
|
-
const
|
|
5159
|
-
if (
|
|
5160
|
-
return `<p class="${d}-mermaid" data-processed>${
|
|
5161
|
-
const
|
|
5162
|
-
if (
|
|
5163
|
-
const
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
}),
|
|
5160
|
+
const se = p.get(_);
|
|
5161
|
+
if (se)
|
|
5162
|
+
return `<p class="${d}-mermaid" data-processed>${se}</p>`;
|
|
5163
|
+
const be = v || window.mermaid;
|
|
5164
|
+
if (w.mermaidInited) {
|
|
5165
|
+
const Ke = (be.renderAsync || be.render)(Z, _);
|
|
5166
|
+
Ke.then((Me) => {
|
|
5167
|
+
p.set(_, typeof Me == "string" ? Me : Me.svg);
|
|
5168
|
+
}), b.push(Ke);
|
|
5167
5169
|
} else
|
|
5168
|
-
return `<p class="${d}-mermaid">${
|
|
5170
|
+
return `<p class="${d}-mermaid">${_}</p>`;
|
|
5169
5171
|
}
|
|
5170
|
-
const
|
|
5171
|
-
return
|
|
5172
|
-
} catch (
|
|
5173
|
-
return `<p class="${d}-mermaid-error">Error: ${(
|
|
5172
|
+
const ee = `<script type="text/tmplate">${Z}<\/script>`;
|
|
5173
|
+
return y.push(ee), ee;
|
|
5174
|
+
} catch (ee) {
|
|
5175
|
+
return `<p class="${d}-mermaid-error">Error: ${(ee == null ? void 0 : ee.message) || ""}</p>`;
|
|
5174
5176
|
}
|
|
5175
5177
|
}
|
|
5176
|
-
return
|
|
5178
|
+
return M.call(z, _, C, j).replace(
|
|
5177
5179
|
/^<pre><code\sclass="language-([^>]*)">/,
|
|
5178
5180
|
'<pre><code class="language-$1" language="$1">'
|
|
5179
5181
|
);
|
|
5180
5182
|
};
|
|
5181
|
-
const
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
const
|
|
5185
|
-
return
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
) :
|
|
5194
|
-
}, m &&
|
|
5195
|
-
highlight: (
|
|
5196
|
-
let
|
|
5197
|
-
const
|
|
5198
|
-
return
|
|
5199
|
-
language:
|
|
5183
|
+
const A = z.heading, k = A !== new I.Renderer().heading;
|
|
5184
|
+
z.heading = (_, C, j, Z) => {
|
|
5185
|
+
$.value.push({ text: j, level: C });
|
|
5186
|
+
const ee = s.markedHeadingId(j, C, $.value.length);
|
|
5187
|
+
return k ? A.call(
|
|
5188
|
+
z,
|
|
5189
|
+
_,
|
|
5190
|
+
C,
|
|
5191
|
+
j,
|
|
5192
|
+
Z,
|
|
5193
|
+
$.value.length,
|
|
5194
|
+
ee
|
|
5195
|
+
) : _ !== j ? `<h${C} id="${ee}">${_}</h${C}>` : `<h${C} id="${ee}"><a href="#${ee}">${j}</a></h${C}>`;
|
|
5196
|
+
}, m && I.setOptions({
|
|
5197
|
+
highlight: (_, C) => {
|
|
5198
|
+
let j;
|
|
5199
|
+
const Z = m.getLanguage(C);
|
|
5200
|
+
return C && Z ? j = m.highlight(_, {
|
|
5201
|
+
language: C,
|
|
5200
5202
|
ignoreIllegals: !0
|
|
5201
|
-
}).value :
|
|
5203
|
+
}).value : j = m.highlightAuto(_).value, r ? kn(j.trim()) : `<span class="code-block">${j.trim()}</span>`;
|
|
5202
5204
|
}
|
|
5203
|
-
}),
|
|
5205
|
+
}), I.setOptions({
|
|
5204
5206
|
breaks: !0,
|
|
5205
5207
|
...n
|
|
5206
|
-
}), t instanceof Array && t.length > 0 &&
|
|
5208
|
+
}), t instanceof Array && t.length > 0 && I.use({
|
|
5207
5209
|
extensions: t
|
|
5208
|
-
}),
|
|
5210
|
+
}), I.use({
|
|
5209
5211
|
extensions: [ps]
|
|
5210
5212
|
});
|
|
5211
|
-
const
|
|
5212
|
-
let
|
|
5213
|
-
const
|
|
5214
|
-
return
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
`<p class="${d}-mermaid" data-processed>${typeof
|
|
5218
|
-
) :
|
|
5219
|
-
|
|
5220
|
-
`<p class="${d}-mermaid-error">${
|
|
5213
|
+
const K = ne(s.sanitize(I(s.value || "", { renderer: z }))), U = async (_) => {
|
|
5214
|
+
let C = s.sanitize(I(_, { renderer: z }));
|
|
5215
|
+
const j = [...b], Z = [...y];
|
|
5216
|
+
return y = [], b = [], (await Promise.allSettled(j)).forEach((se, be) => {
|
|
5217
|
+
se.status === "fulfilled" ? C = C.replace(
|
|
5218
|
+
Z[be],
|
|
5219
|
+
`<p class="${d}-mermaid" data-processed>${typeof se.value == "string" ? se.value : se.value.svg}</p>`
|
|
5220
|
+
) : C = C.replace(
|
|
5221
|
+
Z[be],
|
|
5222
|
+
`<p class="${d}-mermaid-error">${se.reason || ""}</p>`
|
|
5221
5223
|
);
|
|
5222
|
-
}),
|
|
5223
|
-
},
|
|
5224
|
+
}), C;
|
|
5225
|
+
}, q = Kt(
|
|
5224
5226
|
async () => {
|
|
5225
|
-
|
|
5226
|
-
const
|
|
5227
|
-
|
|
5227
|
+
$.value = [];
|
|
5228
|
+
const _ = await U(s.value || "");
|
|
5229
|
+
K.value = _, x.emit(o, "buildFinished", K.value), s.onHtmlChanged(K.value);
|
|
5228
5230
|
},
|
|
5229
5231
|
(l == null ? void 0 : l.renderDelay) !== void 0 ? l == null ? void 0 : l.renderDelay : f ? 0 : 500
|
|
5230
5232
|
);
|
|
5231
|
-
|
|
5232
|
-
[
|
|
5233
|
-
|
|
5234
|
-
),
|
|
5235
|
-
|
|
5233
|
+
W(
|
|
5234
|
+
[T, Bt(w, "reRender"), Bt(s, "value")],
|
|
5235
|
+
q
|
|
5236
|
+
), W([h], () => {
|
|
5237
|
+
p.clear();
|
|
5236
5238
|
});
|
|
5237
|
-
const
|
|
5238
|
-
|
|
5239
|
-
highlight: (
|
|
5240
|
-
let
|
|
5241
|
-
const
|
|
5242
|
-
return
|
|
5243
|
-
language:
|
|
5239
|
+
const L = () => {
|
|
5240
|
+
I.setOptions({
|
|
5241
|
+
highlight: (_, C) => {
|
|
5242
|
+
let j;
|
|
5243
|
+
const Z = window.hljs.getLanguage(C);
|
|
5244
|
+
return C && Z ? j = window.hljs.highlight(_, {
|
|
5245
|
+
language: C,
|
|
5244
5246
|
ignoreIllegals: !0
|
|
5245
|
-
}).value :
|
|
5247
|
+
}).value : j = window.hljs.highlightAuto(_).value, r ? kn(j.trim()) : `<span class="code-block">${j.trim()}</span>`;
|
|
5246
5248
|
}
|
|
5247
|
-
}),
|
|
5249
|
+
}), g.value = !0;
|
|
5248
5250
|
};
|
|
5249
|
-
return
|
|
5250
|
-
() =>
|
|
5251
|
-
(
|
|
5252
|
-
s.onGetCatalog(
|
|
5251
|
+
return W(
|
|
5252
|
+
() => $.value,
|
|
5253
|
+
(_) => {
|
|
5254
|
+
s.onGetCatalog(_), x.emit(o, "catalogChanged", _);
|
|
5253
5255
|
}
|
|
5254
5256
|
), ie(() => {
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
}, D.id = `${d}-katex`;
|
|
5260
|
-
const N = document.createElement("link");
|
|
5261
|
-
N.rel = "stylesheet", N.href = ($ == null ? void 0 : $.css) || Nt.css, N.id = `${d}-katexCss`, we(D, "katex"), we(N);
|
|
5257
|
+
const _ = document.createElement("link");
|
|
5258
|
+
if (_.rel = "stylesheet", _.href = c.value.css, _.id = `${d}-hlCss`, Ce(_), !m) {
|
|
5259
|
+
const C = document.createElement("script");
|
|
5260
|
+
C.src = c.value.js, C.onload = L, C.id = `${d}-hljs`, Ce(C, "hljs");
|
|
5262
5261
|
}
|
|
5263
|
-
|
|
5264
|
-
if (F.rel = "stylesheet", F.href = c.value.css, F.id = `${d}-hlCss`, we(F), !m) {
|
|
5265
|
-
const D = document.createElement("script");
|
|
5266
|
-
D.src = c.value.js, D.onload = B, D.id = `${d}-hljs`, we(D, "hljs");
|
|
5267
|
-
}
|
|
5268
|
-
}), G(
|
|
5262
|
+
}), W(
|
|
5269
5263
|
() => c.value.css,
|
|
5270
|
-
(
|
|
5271
|
-
vi(`${d}-hlCss`, "href",
|
|
5264
|
+
(_) => {
|
|
5265
|
+
vi(`${d}-hlCss`, "href", _);
|
|
5272
5266
|
}
|
|
5273
5267
|
), ie(() => {
|
|
5274
5268
|
x.on(o, {
|
|
5275
5269
|
name: "pushCatalog",
|
|
5276
5270
|
callback() {
|
|
5277
|
-
x.emit(o, "catalogChanged",
|
|
5271
|
+
x.emit(o, "catalogChanged", $.value);
|
|
5278
5272
|
}
|
|
5279
5273
|
});
|
|
5280
|
-
}),
|
|
5274
|
+
}), K;
|
|
5281
5275
|
}, ws = (s, e, t, n, i) => {
|
|
5282
|
-
const l =
|
|
5276
|
+
const l = N("previewOnly"), r = N("usedLanguageText"), o = N("editorId");
|
|
5283
5277
|
let c = () => {
|
|
5284
5278
|
}, f = () => {
|
|
5285
5279
|
};
|
|
@@ -5288,29 +5282,29 @@ $$
|
|
|
5288
5282
|
var p, w;
|
|
5289
5283
|
let $ = -1;
|
|
5290
5284
|
(p = g.querySelector(".copy-button")) == null || p.remove();
|
|
5291
|
-
const b = ((w = r.value.copyCode) == null ? void 0 : w.text) || "复制代码",
|
|
5292
|
-
|
|
5293
|
-
var
|
|
5285
|
+
const b = ((w = r.value.copyCode) == null ? void 0 : w.text) || "复制代码", y = document.createElement("span");
|
|
5286
|
+
y.setAttribute("class", "copy-button"), y.dataset.tips = b, y.innerHTML = `<svg class="${d}-icon" aria-hidden="true"><use xlink:href="#${d}-icon-copy"></use></svg>`, y.addEventListener("click", () => {
|
|
5287
|
+
var A, k;
|
|
5294
5288
|
clearTimeout($);
|
|
5295
|
-
const S = g.querySelector("code").innerText,
|
|
5296
|
-
|
|
5297
|
-
|
|
5289
|
+
const S = g.querySelector("code").innerText, T = pt(s.formatCopiedText(S)), z = ((A = r.value.copyCode) == null ? void 0 : A.successTips) || "已复制!", M = ((k = r.value.copyCode) == null ? void 0 : k.failTips) || "已复制!";
|
|
5290
|
+
y.dataset.tips = T ? z : M, $ = window.setTimeout(() => {
|
|
5291
|
+
y.dataset.tips = b;
|
|
5298
5292
|
}, 1500);
|
|
5299
|
-
}), g.appendChild(
|
|
5293
|
+
}), g.appendChild(y);
|
|
5300
5294
|
});
|
|
5301
5295
|
}, m = () => {
|
|
5302
|
-
|
|
5296
|
+
ut(() => {
|
|
5303
5297
|
s.setting.preview && !l && s.scrollAuto && (c(), f()), h();
|
|
5304
5298
|
});
|
|
5305
5299
|
}, v = (g) => {
|
|
5306
|
-
g && !l &&
|
|
5300
|
+
g && !l && ut(() => {
|
|
5307
5301
|
c(), [f, c] = bn(
|
|
5308
5302
|
t.value,
|
|
5309
5303
|
n.value || i.value
|
|
5310
5304
|
), f(), h();
|
|
5311
5305
|
});
|
|
5312
5306
|
};
|
|
5313
|
-
|
|
5307
|
+
W(() => e.value, m), W(() => r.value, h), W(() => s.setting.preview, v), W(() => s.setting.htmlPreview, v), W(
|
|
5314
5308
|
() => s.scrollAuto,
|
|
5315
5309
|
(g) => {
|
|
5316
5310
|
g ? f() : c();
|
|
@@ -5322,7 +5316,7 @@ $$
|
|
|
5322
5316
|
)), s.scrollAuto && f();
|
|
5323
5317
|
});
|
|
5324
5318
|
}, xs = (s, e) => {
|
|
5325
|
-
const t =
|
|
5319
|
+
const t = N("previewOnly"), n = N("tabWidth"), i = N("editorId"), l = ne("");
|
|
5326
5320
|
ie(() => {
|
|
5327
5321
|
var r;
|
|
5328
5322
|
t || ((r = e.value) == null || r.addEventListener("keypress", (o) => {
|
|
@@ -5335,27 +5329,27 @@ $$
|
|
|
5335
5329
|
);
|
|
5336
5330
|
if (/^\d+\.\s|^-\s/.test(b))
|
|
5337
5331
|
if (o.cancelBubble = !0, o.preventDefault(), o.stopPropagation(), /^(\d+\.|-)\s+(\[[x\s]\]\s+)?$/.test(b)) {
|
|
5338
|
-
const
|
|
5332
|
+
const y = v == null ? void 0 : v.replace(
|
|
5339
5333
|
/(\d+\.|-)\s+(\[[x\s]\]\s+)?$/,
|
|
5340
5334
|
""
|
|
5341
5335
|
);
|
|
5342
|
-
s.onChange(
|
|
5336
|
+
s.onChange(y + g), Oe(
|
|
5343
5337
|
e.value,
|
|
5344
|
-
|
|
5338
|
+
y == null ? void 0 : y.length
|
|
5345
5339
|
);
|
|
5346
5340
|
} else if (/^-\s+.+/.test(b)) {
|
|
5347
|
-
const
|
|
5341
|
+
const y = /^-\s+\[[x\s]\]/.test(b) ? `
|
|
5348
5342
|
- [ ] ` : `
|
|
5349
5343
|
- `;
|
|
5350
5344
|
s.onChange(
|
|
5351
|
-
|
|
5345
|
+
Xt(e.value, y, {})
|
|
5352
5346
|
);
|
|
5353
5347
|
} else {
|
|
5354
|
-
const
|
|
5348
|
+
const y = b == null ? void 0 : b.match(/\d+(?=\.)/), p = y && Number(y[0]) + 1 || 1, w = /^\d\.\s+\[[x\s]\]/.test(b) ? `
|
|
5355
5349
|
${p}. [ ] ` : `
|
|
5356
5350
|
${p}. `;
|
|
5357
5351
|
s.onChange(
|
|
5358
|
-
|
|
5352
|
+
Xt(e.value, w, {})
|
|
5359
5353
|
);
|
|
5360
5354
|
}
|
|
5361
5355
|
}
|
|
@@ -5381,16 +5375,16 @@ ${p}. `;
|
|
|
5381
5375
|
l.value = fi(e.value);
|
|
5382
5376
|
}
|
|
5383
5377
|
}));
|
|
5384
|
-
}),
|
|
5378
|
+
}), W(
|
|
5385
5379
|
() => s.value,
|
|
5386
5380
|
() => {
|
|
5387
5381
|
l.value = "";
|
|
5388
5382
|
}
|
|
5389
5383
|
);
|
|
5390
5384
|
}, $s = (s) => {
|
|
5391
|
-
const e =
|
|
5385
|
+
const e = N("theme"), { editorExtensions: t } = te, n = t == null ? void 0 : t.mermaid, i = ke({
|
|
5392
5386
|
reRender: !1,
|
|
5393
|
-
mermaidInited:
|
|
5387
|
+
mermaidInited: !!(n != null && n.instance)
|
|
5394
5388
|
}), l = () => {
|
|
5395
5389
|
const r = (n == null ? void 0 : n.instance) || window.mermaid;
|
|
5396
5390
|
!s.noMermaid && r && (r.initialize({
|
|
@@ -5398,7 +5392,7 @@ ${p}. `;
|
|
|
5398
5392
|
theme: e.value === "dark" ? "dark" : "default"
|
|
5399
5393
|
}), i.reRender = !i.reRender);
|
|
5400
5394
|
};
|
|
5401
|
-
return
|
|
5395
|
+
return W(() => e.value, l), ie(() => {
|
|
5402
5396
|
if (!s.noMermaid)
|
|
5403
5397
|
if (n != null && n.instance)
|
|
5404
5398
|
l(), i.mermaidInited = !0;
|
|
@@ -5408,11 +5402,11 @@ ${p}. `;
|
|
|
5408
5402
|
const o = (n == null ? void 0 : n.js) || ri;
|
|
5409
5403
|
/\.mjs/.test(o) ? (r.setAttribute("type", "module"), r.innerHTML = `import mermaid from "${o}";window.mermaid=mermaid;document.getElementById('${d}-mermaid').dispatchEvent(new Event('load'));`) : r.src = o, r.onload = () => {
|
|
5410
5404
|
l(), i.mermaidInited = !0;
|
|
5411
|
-
},
|
|
5405
|
+
}, Ce(r, "mermaid");
|
|
5412
5406
|
}
|
|
5413
5407
|
}), i;
|
|
5414
5408
|
}, Ss = (s, e) => {
|
|
5415
|
-
const t =
|
|
5409
|
+
const t = N("editorId"), n = N("previewOnly"), i = (l) => {
|
|
5416
5410
|
if (l.clipboardData) {
|
|
5417
5411
|
if (l.clipboardData.files.length > 0) {
|
|
5418
5412
|
const { files: r } = l.clipboardData;
|
|
@@ -5433,19 +5427,19 @@ ${p}. `;
|
|
|
5433
5427
|
};
|
|
5434
5428
|
ie(() => {
|
|
5435
5429
|
n || e.value.addEventListener("paste", i);
|
|
5436
|
-
}),
|
|
5430
|
+
}), $t(() => {
|
|
5437
5431
|
n || e.value.removeEventListener("paste", i);
|
|
5438
5432
|
});
|
|
5439
5433
|
}, Cs = (s, e) => {
|
|
5440
|
-
const t =
|
|
5434
|
+
const t = N("editorId"), n = Kt(() => {
|
|
5441
5435
|
const i = document.querySelectorAll(`#${t}-preview img[zoom]`);
|
|
5442
5436
|
i.length !== 0 && us(i, {
|
|
5443
5437
|
background: "#00000073"
|
|
5444
5438
|
});
|
|
5445
5439
|
});
|
|
5446
|
-
ie(n),
|
|
5440
|
+
ie(n), W([e, Bt(s.setting, "preview")], n);
|
|
5447
5441
|
}, Ts = (s) => {
|
|
5448
|
-
const e =
|
|
5442
|
+
const e = N("editorId");
|
|
5449
5443
|
ie(() => {
|
|
5450
5444
|
x.on(e, {
|
|
5451
5445
|
name: Pn,
|
|
@@ -5542,10 +5536,10 @@ ${p}. `;
|
|
|
5542
5536
|
name: "MDEditorContent",
|
|
5543
5537
|
props: Es(),
|
|
5544
5538
|
setup(s) {
|
|
5545
|
-
const e = ne(!0), t =
|
|
5539
|
+
const e = ne(!0), t = N("previewOnly"), n = N("showCodeRowNumber"), i = N("previewTheme"), l = N("editorId"), r = ne(), o = ne(), c = ne(), f = ys(s);
|
|
5546
5540
|
return ws(s, f, r, o, c), xs(s, r), bs(s, r, e), Ss(s, r), Cs(s, f), Ts(r), () => {
|
|
5547
5541
|
const h = gi(s, ["formatCopiedText", "markedHeadingId", "noKatex", "noMermaid", "onChange", "onGetCatalog", "onHtmlChanged", "sanitize", "scrollAuto", "setting", "autoDetectCode", "onBlur", "onFocus"]);
|
|
5548
|
-
return u(
|
|
5542
|
+
return u(Wt, null, [u("div", {
|
|
5549
5543
|
class: `${d}-content`
|
|
5550
5544
|
}, [!t && u("div", {
|
|
5551
5545
|
class: `${d}-input-wrapper`
|
|
@@ -5595,7 +5589,7 @@ ${p}. `;
|
|
|
5595
5589
|
}
|
|
5596
5590
|
},
|
|
5597
5591
|
setup(s) {
|
|
5598
|
-
const e =
|
|
5592
|
+
const e = N("usedLanguageText");
|
|
5599
5593
|
return () => {
|
|
5600
5594
|
var t, n;
|
|
5601
5595
|
return u("div", {
|
|
@@ -5638,7 +5632,7 @@ const As = () => ({
|
|
|
5638
5632
|
}), Fs = /* @__PURE__ */ ae({
|
|
5639
5633
|
props: Ls(),
|
|
5640
5634
|
setup(s) {
|
|
5641
|
-
const e =
|
|
5635
|
+
const e = N("usedLanguageText");
|
|
5642
5636
|
return () => {
|
|
5643
5637
|
var t;
|
|
5644
5638
|
return u("div", {
|
|
@@ -5678,7 +5672,7 @@ const As = () => ({
|
|
|
5678
5672
|
name: "MDEditorFooter",
|
|
5679
5673
|
props: Rs(),
|
|
5680
5674
|
setup(s) {
|
|
5681
|
-
const e =
|
|
5675
|
+
const e = Te(() => {
|
|
5682
5676
|
const n = s.footers.indexOf("="), i = n === -1 ? s.footers : s.footers.slice(0, n), l = n === -1 ? [] : s.footers.slice(n, Number.MAX_SAFE_INTEGER);
|
|
5683
5677
|
return [i, l];
|
|
5684
5678
|
}), t = (n) => {
|
|
@@ -5822,16 +5816,16 @@ const Hs = () => ({
|
|
|
5822
5816
|
onClick: {
|
|
5823
5817
|
type: Function
|
|
5824
5818
|
}
|
|
5825
|
-
}),
|
|
5819
|
+
}), qt = /* @__PURE__ */ ae({
|
|
5826
5820
|
name: "MdCatalog",
|
|
5827
5821
|
props: Hs(),
|
|
5828
5822
|
emits: ["onClick"],
|
|
5829
5823
|
setup(s, e) {
|
|
5830
|
-
const t = s.editorId, n =
|
|
5824
|
+
const t = s.editorId, n = ke({
|
|
5831
5825
|
list: [],
|
|
5832
5826
|
show: !1,
|
|
5833
5827
|
scrollElement: s.scrollElement || `#${t}-preview-wrapper`
|
|
5834
|
-
}), i =
|
|
5828
|
+
}), i = Te(() => {
|
|
5835
5829
|
const r = [];
|
|
5836
5830
|
return n.list.forEach(({
|
|
5837
5831
|
text: o,
|
|
@@ -5914,9 +5908,9 @@ const Hs = () => ({
|
|
|
5914
5908
|
};
|
|
5915
5909
|
return ie(() => {
|
|
5916
5910
|
l(), x.on(t, {
|
|
5917
|
-
name:
|
|
5911
|
+
name: Qt,
|
|
5918
5912
|
callback(r) {
|
|
5919
|
-
r &&
|
|
5913
|
+
r && ut(l);
|
|
5920
5914
|
}
|
|
5921
5915
|
});
|
|
5922
5916
|
}), () => u("div", {
|
|
@@ -6319,7 +6313,7 @@ const Hs = () => ({
|
|
|
6319
6313
|
"onBlur",
|
|
6320
6314
|
"onFocus"
|
|
6321
6315
|
];
|
|
6322
|
-
const
|
|
6316
|
+
const We = /* @__PURE__ */ ae({
|
|
6323
6317
|
name: "MdEditorV3",
|
|
6324
6318
|
props: Ps,
|
|
6325
6319
|
emits: Ms,
|
|
@@ -6331,19 +6325,19 @@ const Ze = /* @__PURE__ */ ae({
|
|
|
6331
6325
|
noMermaid: l,
|
|
6332
6326
|
noPrettier: r,
|
|
6333
6327
|
noUploadImg: o
|
|
6334
|
-
} = s, c =
|
|
6328
|
+
} = s, c = ke({
|
|
6335
6329
|
scrollAuto: s.scrollAuto
|
|
6336
6330
|
});
|
|
6337
6331
|
bi(s, e), ki(s), yi(s);
|
|
6338
6332
|
const [f, h] = wi(s, e), [m, v] = xi(s);
|
|
6339
|
-
return
|
|
6333
|
+
return $t(() => {
|
|
6340
6334
|
x.clear(t);
|
|
6341
6335
|
}), $i(s, e, m, f, h), () => {
|
|
6342
6336
|
var b;
|
|
6343
|
-
const g =
|
|
6337
|
+
const g = Ee({
|
|
6344
6338
|
props: s,
|
|
6345
6339
|
ctx: e
|
|
6346
|
-
}, "defToolbars"), $ =
|
|
6340
|
+
}, "defToolbars"), $ = Ee({
|
|
6347
6341
|
props: s,
|
|
6348
6342
|
ctx: e
|
|
6349
6343
|
}, "defFooters");
|
|
@@ -6375,28 +6369,28 @@ const Ze = /* @__PURE__ */ ae({
|
|
|
6375
6369
|
readonly: s.readOnly,
|
|
6376
6370
|
maxlength: s.maxLength,
|
|
6377
6371
|
autoDetectCode: s.autoDetectCode,
|
|
6378
|
-
onChange: (
|
|
6379
|
-
x.emit(t, "saveHistoryPos"), s.onChange ? s.onChange(
|
|
6372
|
+
onChange: (y) => {
|
|
6373
|
+
x.emit(t, "saveHistoryPos"), s.onChange ? s.onChange(y) : (e.emit("update:modelValue", y), e.emit("onChange", y));
|
|
6380
6374
|
},
|
|
6381
|
-
onHtmlChanged: (
|
|
6382
|
-
s.onHtmlChanged ? s.onHtmlChanged(
|
|
6375
|
+
onHtmlChanged: (y) => {
|
|
6376
|
+
s.onHtmlChanged ? s.onHtmlChanged(y) : e.emit("onHtmlChanged", y);
|
|
6383
6377
|
},
|
|
6384
|
-
onGetCatalog: (
|
|
6385
|
-
s.onGetCatalog ? s.onGetCatalog(
|
|
6378
|
+
onGetCatalog: (y) => {
|
|
6379
|
+
s.onGetCatalog ? s.onGetCatalog(y) : e.emit("onGetCatalog", y);
|
|
6386
6380
|
},
|
|
6387
|
-
onBlur: (
|
|
6388
|
-
s.onBlur ? s.onBlur(
|
|
6381
|
+
onBlur: (y) => {
|
|
6382
|
+
s.onBlur ? s.onBlur(y) : e.emit("onBlur", y);
|
|
6389
6383
|
},
|
|
6390
|
-
onFocus: (
|
|
6391
|
-
s.onFocus ? s.onFocus(
|
|
6384
|
+
onFocus: (y) => {
|
|
6385
|
+
s.onFocus ? s.onFocus(y) : e.emit("onFocus", y);
|
|
6392
6386
|
}
|
|
6393
6387
|
}, null), !n && ((b = s.footers) == null ? void 0 : b.length) > 0 && u(Os, {
|
|
6394
6388
|
modelValue: s.modelValue,
|
|
6395
6389
|
footers: s.footers,
|
|
6396
6390
|
defFooters: $,
|
|
6397
6391
|
scrollAuto: c.scrollAuto,
|
|
6398
|
-
onScrollAutoChange: (
|
|
6399
|
-
}, null), v.value && !n && u(
|
|
6392
|
+
onScrollAutoChange: (y) => c.scrollAuto = y
|
|
6393
|
+
}, null), v.value && !n && u(qt, {
|
|
6400
6394
|
theme: s.theme,
|
|
6401
6395
|
style: {
|
|
6402
6396
|
display: m.value ? "block" : "none"
|
|
@@ -6419,13 +6413,13 @@ const Ze = /* @__PURE__ */ ae({
|
|
|
6419
6413
|
onClick: {
|
|
6420
6414
|
type: Function
|
|
6421
6415
|
}
|
|
6422
|
-
}),
|
|
6416
|
+
}), nn = /* @__PURE__ */ ae({
|
|
6423
6417
|
name: "NormalToolbar",
|
|
6424
6418
|
props: Bs(),
|
|
6425
6419
|
emits: ["onClick"],
|
|
6426
6420
|
setup(s, e) {
|
|
6427
6421
|
return () => {
|
|
6428
|
-
const t =
|
|
6422
|
+
const t = Ee({
|
|
6429
6423
|
props: s,
|
|
6430
6424
|
ctx: e
|
|
6431
6425
|
}, "trigger");
|
|
@@ -6457,21 +6451,21 @@ const Ze = /* @__PURE__ */ ae({
|
|
|
6457
6451
|
overlay: {
|
|
6458
6452
|
type: [String, Object]
|
|
6459
6453
|
}
|
|
6460
|
-
}),
|
|
6454
|
+
}), sn = /* @__PURE__ */ ae({
|
|
6461
6455
|
name: "DropdownToolbar",
|
|
6462
6456
|
props: Ns(),
|
|
6463
6457
|
emits: ["onChange"],
|
|
6464
6458
|
setup(s, e) {
|
|
6465
|
-
const t =
|
|
6459
|
+
const t = N("editorId");
|
|
6466
6460
|
return () => {
|
|
6467
|
-
const n =
|
|
6461
|
+
const n = Ee({
|
|
6468
6462
|
props: s,
|
|
6469
6463
|
ctx: e
|
|
6470
|
-
}, "trigger"), i =
|
|
6464
|
+
}, "trigger"), i = Ee({
|
|
6471
6465
|
props: s,
|
|
6472
6466
|
ctx: e
|
|
6473
6467
|
}, "overlay");
|
|
6474
|
-
return u(
|
|
6468
|
+
return u(it, {
|
|
6475
6469
|
relative: `#${t}-toolbar-wrapper`,
|
|
6476
6470
|
visible: s.visible,
|
|
6477
6471
|
onChange: (l) => {
|
|
@@ -6534,26 +6528,26 @@ const qs = () => ({
|
|
|
6534
6528
|
onAdjust: {
|
|
6535
6529
|
type: Function
|
|
6536
6530
|
}
|
|
6537
|
-
}),
|
|
6531
|
+
}), ln = /* @__PURE__ */ ae({
|
|
6538
6532
|
name: "ModalToolbar",
|
|
6539
6533
|
props: qs(),
|
|
6540
6534
|
emits: ["onClick", "onClose", "onAdjust"],
|
|
6541
6535
|
setup(s, e) {
|
|
6542
6536
|
return () => {
|
|
6543
|
-
const t =
|
|
6537
|
+
const t = Ee({
|
|
6544
6538
|
props: s,
|
|
6545
6539
|
ctx: e
|
|
6546
|
-
}, "trigger"), n =
|
|
6540
|
+
}, "trigger"), n = Ee({
|
|
6547
6541
|
props: s,
|
|
6548
6542
|
ctx: e
|
|
6549
6543
|
}, "default");
|
|
6550
|
-
return u(
|
|
6544
|
+
return u(Wt, null, [u("div", {
|
|
6551
6545
|
class: `${d}-toolbar-item`,
|
|
6552
6546
|
title: s.title,
|
|
6553
6547
|
onClick: () => {
|
|
6554
6548
|
s.onClick instanceof Function ? s.onClick() : e.emit("onClick");
|
|
6555
6549
|
}
|
|
6556
|
-
}, [t]), u(
|
|
6550
|
+
}, [t]), u(rn, {
|
|
6557
6551
|
width: s.width,
|
|
6558
6552
|
height: s.height,
|
|
6559
6553
|
title: s.modalTitle,
|
|
@@ -6572,12 +6566,12 @@ const qs = () => ({
|
|
|
6572
6566
|
};
|
|
6573
6567
|
}
|
|
6574
6568
|
});
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6569
|
+
We.install = (s) => (s.component(We.name, We), s.component(nn.name, nn), s.component(sn.name, sn), s.component(qt.name, qt), s.component(ln.name, ln), s);
|
|
6570
|
+
We.NormalToolbar = nn;
|
|
6571
|
+
We.DropdownToolbar = sn;
|
|
6572
|
+
We.MdCatalog = qt;
|
|
6573
|
+
We.ModalToolbar = ln;
|
|
6574
|
+
We.config = ai;
|
|
6581
6575
|
export {
|
|
6582
|
-
|
|
6576
|
+
We as default
|
|
6583
6577
|
};
|