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