@editora/core 1.0.31 → 1.0.33
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/README.md +11 -3
- package/dist/{CollaborationPlugin.native-B9aiC2s7.mjs → CollaborationPlugin.native-8gcyVRnR.mjs} +869 -857
- package/dist/{VersionDiffPlugin.native-DJZIzFSK.mjs → VersionDiffPlugin.native-2v8ZaZWN.mjs} +248 -247
- package/dist/editora.min.js +15 -15
- package/dist/editora.umd.js +15 -15
- package/dist/index-BahpGXyw.js +12 -0
- package/dist/{index-8WhEVFK8.mjs → index-BlsTuyTe.mjs} +676 -582
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/plugin-loader.js +4 -4
- package/dist/webcomponent-core.js +480 -386
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +29 -29
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +481 -387
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +267 -267
- package/package.json +1 -1
- package/dist/index-DMk3V5_f.js +0 -12
|
@@ -10,7 +10,7 @@ class qt {
|
|
|
10
10
|
return new qt(t, e || this.selection, this.schema);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
class
|
|
13
|
+
class dn {
|
|
14
14
|
constructor(t, e) {
|
|
15
15
|
this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
|
|
16
16
|
}
|
|
@@ -21,7 +21,7 @@ class ln {
|
|
|
21
21
|
return { type: "text", text: t, marks: e };
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
class
|
|
24
|
+
class So {
|
|
25
25
|
constructor() {
|
|
26
26
|
this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
|
|
27
27
|
}
|
|
@@ -58,7 +58,7 @@ class Ao {
|
|
|
58
58
|
const t = {}, e = {};
|
|
59
59
|
return this.plugins.forEach((o) => {
|
|
60
60
|
o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
|
|
61
|
-
}), new
|
|
61
|
+
}), new dn(t, e);
|
|
62
62
|
}
|
|
63
63
|
getCommands() {
|
|
64
64
|
const t = {};
|
|
@@ -112,10 +112,10 @@ class Ao {
|
|
|
112
112
|
await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
return new
|
|
115
|
+
function Ti() {
|
|
116
|
+
return new So();
|
|
117
117
|
}
|
|
118
|
-
class
|
|
118
|
+
class un {
|
|
119
119
|
constructor(t) {
|
|
120
120
|
this.shortcuts = /* @__PURE__ */ new Map(), this.enabled = !0, this.isMac = typeof navigator != "undefined" && navigator.platform.toUpperCase().indexOf("MAC") >= 0, (t == null ? void 0 : t.enabled) === !1 && (this.enabled = !1), this.registerDefaultShortcuts(), t != null && t.shortcuts && t.shortcuts.forEach((e) => this.registerShortcut(e)), t != null && t.customShortcuts && Object.values(t.customShortcuts).forEach((e) => {
|
|
121
121
|
this.registerShortcut(e);
|
|
@@ -450,7 +450,7 @@ class cn {
|
|
|
450
450
|
return t.includes("toggle") && (t.includes("Bold") || t.includes("Italic") || t.includes("Underline") || t.includes("Strike") || t.includes("Code") || t.includes("Super") || t.includes("Sub")) ? "Text Formatting" : t.includes("Heading") || t.includes("Paragraph") ? "Block Formatting" : t.includes("List") || t.includes("Checklist") ? "Lists" : t.includes("Alignment") || t.includes("Indent") ? "Alignment & Indentation" : t.includes("undo") || t.includes("redo") ? "History" : t.includes("insert") ? "Insert" : t.includes("find") || t.includes("replace") ? "Find & Replace" : t.includes("Accessibility") || t.includes("spell") ? "Tools" : "Other";
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
class
|
|
453
|
+
class fn {
|
|
454
454
|
constructor(t = {}) {
|
|
455
455
|
this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
|
|
456
456
|
this.register(e, o);
|
|
@@ -493,11 +493,11 @@ class dn {
|
|
|
493
493
|
this.commands.clear();
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
class
|
|
496
|
+
class pn {
|
|
497
497
|
constructor(t = {}) {
|
|
498
|
-
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new
|
|
498
|
+
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new So(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
|
|
499
499
|
const e = this.pluginManager.buildSchema();
|
|
500
|
-
this.state = qt.create(e), this.commandRegistry = new
|
|
500
|
+
this.state = qt.create(e), this.commandRegistry = new fn(this.pluginManager.getCommands());
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
503
503
|
* Execute a command
|
|
@@ -579,7 +579,7 @@ class un {
|
|
|
579
579
|
return this.isDestroyed;
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
|
-
class
|
|
582
|
+
class hn {
|
|
583
583
|
constructor(t, e, o) {
|
|
584
584
|
this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (i) => {
|
|
585
585
|
var l, c;
|
|
@@ -671,18 +671,18 @@ class pn {
|
|
|
671
671
|
codeBlock: "insertCodeBlock"
|
|
672
672
|
};
|
|
673
673
|
return o.forEach((c) => {
|
|
674
|
-
const
|
|
674
|
+
const f = [];
|
|
675
675
|
c.split(/\s+/).filter(Boolean).forEach((g) => {
|
|
676
676
|
if (g === "direction") {
|
|
677
|
-
const
|
|
678
|
-
|
|
677
|
+
const v = r.get("setDirectionLTR"), k = r.get("setDirectionRTL");
|
|
678
|
+
v && f.push({
|
|
679
679
|
id: "directionLTR",
|
|
680
|
-
label:
|
|
681
|
-
command:
|
|
682
|
-
icon:
|
|
683
|
-
type:
|
|
684
|
-
options:
|
|
685
|
-
}), k &&
|
|
680
|
+
label: v.label,
|
|
681
|
+
command: v.command,
|
|
682
|
+
icon: v.icon,
|
|
683
|
+
type: v.type || "button",
|
|
684
|
+
options: v.options
|
|
685
|
+
}), k && f.push({
|
|
686
686
|
id: "directionRTL",
|
|
687
687
|
label: k.label,
|
|
688
688
|
command: k.command,
|
|
@@ -693,15 +693,15 @@ class pn {
|
|
|
693
693
|
return;
|
|
694
694
|
}
|
|
695
695
|
if (g === "comments") {
|
|
696
|
-
const
|
|
697
|
-
|
|
696
|
+
const v = r.get("addComment"), k = r.get("toggleComments");
|
|
697
|
+
v && f.push({
|
|
698
698
|
id: "addComment",
|
|
699
|
-
label:
|
|
700
|
-
command:
|
|
701
|
-
icon:
|
|
702
|
-
type:
|
|
703
|
-
options:
|
|
704
|
-
}), k &&
|
|
699
|
+
label: v.label,
|
|
700
|
+
command: v.command,
|
|
701
|
+
icon: v.icon,
|
|
702
|
+
type: v.type || "button",
|
|
703
|
+
options: v.options
|
|
704
|
+
}), k && f.push({
|
|
705
705
|
id: "toggleComments",
|
|
706
706
|
label: k.label,
|
|
707
707
|
command: k.command,
|
|
@@ -713,7 +713,7 @@ class pn {
|
|
|
713
713
|
}
|
|
714
714
|
const w = l[g] || g;
|
|
715
715
|
let T = r.get(w);
|
|
716
|
-
T || (T = r.get(g)), T &&
|
|
716
|
+
T || (T = r.get(g)), T && f.push({
|
|
717
717
|
id: g,
|
|
718
718
|
label: T.label,
|
|
719
719
|
command: T.command,
|
|
@@ -722,7 +722,7 @@ class pn {
|
|
|
722
722
|
options: T.options,
|
|
723
723
|
items: T.items
|
|
724
724
|
});
|
|
725
|
-
}),
|
|
725
|
+
}), f.length > 0 && e.push(f);
|
|
726
726
|
}), e;
|
|
727
727
|
}
|
|
728
728
|
/**
|
|
@@ -741,13 +741,13 @@ class pn {
|
|
|
741
741
|
const o = this.config.items || this.getDefaultToolbarString(), i = this.parseToolbarString(o);
|
|
742
742
|
i.forEach((r, l) => {
|
|
743
743
|
const c = document.createElement("div");
|
|
744
|
-
if (c.className = "editora-toolbar-group", r.forEach((
|
|
745
|
-
this.appendToolbarButton(c,
|
|
744
|
+
if (c.className = "editora-toolbar-group", r.forEach((f) => {
|
|
745
|
+
this.appendToolbarButton(c, f);
|
|
746
746
|
const m = c.lastElementChild;
|
|
747
747
|
m instanceof HTMLElement && (this.overflowUnits.push(m), this.overflowUnitHomes.set(m, c));
|
|
748
748
|
}), e.appendChild(c), l < i.length - 1) {
|
|
749
|
-
const
|
|
750
|
-
|
|
749
|
+
const f = document.createElement("div");
|
|
750
|
+
f.className = "editora-toolbar-separator", e.appendChild(f);
|
|
751
751
|
}
|
|
752
752
|
}), t.appendChild(e), this.setupOverflow(t);
|
|
753
753
|
}
|
|
@@ -766,24 +766,24 @@ class pn {
|
|
|
766
766
|
const c = this.overflowUnits;
|
|
767
767
|
if (c.length === 0) return;
|
|
768
768
|
c.forEach((B) => {
|
|
769
|
-
var
|
|
770
|
-
B.parentElement === i && ((
|
|
769
|
+
var O;
|
|
770
|
+
B.parentElement === i && ((O = this.overflowUnitHomes.get(B)) == null || O.appendChild(B));
|
|
771
771
|
});
|
|
772
|
-
const
|
|
773
|
-
const
|
|
774
|
-
return k ? tt.right -
|
|
772
|
+
const f = t.clientWidth, m = 16, g = 40, w = 4, T = Math.max(0, f - m), v = Math.max(0, T - g - w), k = getComputedStyle(t).direction === "rtl", tt = e.getBoundingClientRect(), $ = (B) => {
|
|
773
|
+
const O = B.getBoundingClientRect();
|
|
774
|
+
return k ? tt.right - O.left : O.right - tt.left;
|
|
775
775
|
};
|
|
776
776
|
let z = 0;
|
|
777
777
|
if ($(c[c.length - 1]) <= T)
|
|
778
778
|
z = c.length;
|
|
779
779
|
else
|
|
780
780
|
for (const B of c)
|
|
781
|
-
if ($(B) <=
|
|
781
|
+
if ($(B) <= v) z++;
|
|
782
782
|
else break;
|
|
783
783
|
z = Math.max(1, Math.min(z, c.length));
|
|
784
784
|
const at = z < c.length;
|
|
785
|
-
o.style.display = at ? "" : "none", o.classList.toggle("active", at && this.expandedOpen), !at && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B,
|
|
786
|
-
|
|
785
|
+
o.style.display = at ? "" : "none", o.classList.toggle("active", at && this.expandedOpen), !at && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B, O) => {
|
|
786
|
+
O >= z && i.appendChild(B);
|
|
787
787
|
});
|
|
788
788
|
}, l = () => {
|
|
789
789
|
this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
|
|
@@ -878,9 +878,9 @@ class pn {
|
|
|
878
878
|
e.setAttribute("aria-expanded", l() ? "true" : "false");
|
|
879
879
|
});
|
|
880
880
|
c.observe(o, { attributes: !0, attributeFilter: ["style"] });
|
|
881
|
-
const
|
|
881
|
+
const f = t._cleanupDropdown;
|
|
882
882
|
t._cleanupDropdown = () => {
|
|
883
|
-
c.disconnect(),
|
|
883
|
+
c.disconnect(), f == null || f();
|
|
884
884
|
}, e.addEventListener("click", (m) => {
|
|
885
885
|
var g;
|
|
886
886
|
m.detail === 0 && l() && ((g = r()[0]) == null || g.focus());
|
|
@@ -893,8 +893,8 @@ class pn {
|
|
|
893
893
|
}), o.addEventListener("keydown", (m) => {
|
|
894
894
|
const g = r();
|
|
895
895
|
if (g.length === 0) return;
|
|
896
|
-
const w = g.indexOf(document.activeElement), T = (
|
|
897
|
-
m.preventDefault(), g[(
|
|
896
|
+
const w = g.indexOf(document.activeElement), T = (v) => {
|
|
897
|
+
m.preventDefault(), g[(v + g.length) % g.length].focus();
|
|
898
898
|
};
|
|
899
899
|
switch (m.key) {
|
|
900
900
|
case "ArrowDown":
|
|
@@ -924,14 +924,14 @@ class pn {
|
|
|
924
924
|
o.className = "editora-toolbar-button editora-toolbar-dropdown-trigger", o.type = "button", o.textContent = t.label;
|
|
925
925
|
const i = document.createElement("div");
|
|
926
926
|
i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
|
|
927
|
-
const
|
|
928
|
-
|
|
927
|
+
const f = document.createElement("button");
|
|
928
|
+
f.className = "editora-toolbar-dropdown-item", f.type = "button", f.textContent = c.label, f.setAttribute("data-value", c.value), f.addEventListener("click", (m) => {
|
|
929
929
|
m.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
|
|
930
|
-
}), i.appendChild(
|
|
930
|
+
}), i.appendChild(f);
|
|
931
931
|
}), o.addEventListener("click", (c) => {
|
|
932
932
|
c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
|
|
933
|
-
const
|
|
934
|
-
i.style.display =
|
|
933
|
+
const f = i.style.display === "block";
|
|
934
|
+
i.style.display = f ? "none" : "block";
|
|
935
935
|
});
|
|
936
936
|
const r = (c) => {
|
|
937
937
|
e.contains(c.target) || (i.style.display = "none");
|
|
@@ -959,17 +959,17 @@ class pn {
|
|
|
959
959
|
o.textContent = t.label;
|
|
960
960
|
const i = document.createElement("div");
|
|
961
961
|
i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
|
|
962
|
-
const
|
|
963
|
-
|
|
962
|
+
const f = document.createElement("button");
|
|
963
|
+
f.className = "editora-toolbar-dropdown-item", f.type = "button", f.textContent = c.label, f.setAttribute("data-value", c.value), f.addEventListener("click", (m) => {
|
|
964
964
|
m.preventDefault(), m.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
|
|
965
|
-
}), i.appendChild(
|
|
965
|
+
}), i.appendChild(f);
|
|
966
966
|
}), o.addEventListener("click", (c) => {
|
|
967
967
|
var m;
|
|
968
968
|
c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
|
|
969
|
-
const
|
|
969
|
+
const f = (m = this.container) == null ? void 0 : m.querySelectorAll(
|
|
970
970
|
".editora-toolbar-dropdown-menu"
|
|
971
971
|
);
|
|
972
|
-
|
|
972
|
+
f == null || f.forEach((g) => {
|
|
973
973
|
g !== i && (g.style.display = "none");
|
|
974
974
|
}), i.style.display = i.style.display === "none" ? "block" : "none";
|
|
975
975
|
});
|
|
@@ -1009,7 +1009,7 @@ class pn {
|
|
|
1009
1009
|
}), this.container.innerHTML = ""), (t = this.resizeObserver) == null || t.disconnect(), this.resizeObserver = void 0, this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), document.removeEventListener("mousedown", this.onDocumentPointerDownForOverflow, !0), this.itemsContainer = void 0, this.moreButton = void 0, this.expandedRow = void 0, this.commandHandler = void 0;
|
|
1010
1010
|
}
|
|
1011
1011
|
}
|
|
1012
|
-
class
|
|
1012
|
+
class mn {
|
|
1013
1013
|
constructor(t) {
|
|
1014
1014
|
this.visible = !1, this.config = t;
|
|
1015
1015
|
}
|
|
@@ -1051,7 +1051,7 @@ class fn {
|
|
|
1051
1051
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
|
-
class
|
|
1054
|
+
class gn {
|
|
1055
1055
|
constructor(t = {}) {
|
|
1056
1056
|
this.statusInfo = {}, this.config = t;
|
|
1057
1057
|
}
|
|
@@ -1093,14 +1093,14 @@ class hn {
|
|
|
1093
1093
|
}), o.forEach((r, l) => {
|
|
1094
1094
|
const c = document.createElement("span");
|
|
1095
1095
|
if (c.className = "editora-statusbar-item", c.textContent = r, t.appendChild(c), l < o.length - 1) {
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1096
|
+
const f = document.createElement("span");
|
|
1097
|
+
f.className = "editora-statusbar-separator", f.textContent = "|", t.appendChild(f);
|
|
1098
1098
|
}
|
|
1099
1099
|
}), i.forEach((r, l) => {
|
|
1100
1100
|
const c = document.createElement("span");
|
|
1101
1101
|
if (c.className = "editora-statusbar-item", c.textContent = r, e.appendChild(c), l < i.length - 1) {
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1102
|
+
const f = document.createElement("span");
|
|
1103
|
+
f.className = "editora-statusbar-separator", f.textContent = "|", e.appendChild(f);
|
|
1104
1104
|
}
|
|
1105
1105
|
}), this.container.appendChild(t), this.container.appendChild(e);
|
|
1106
1106
|
}
|
|
@@ -1111,16 +1111,16 @@ class hn {
|
|
|
1111
1111
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
|
|
1112
1112
|
}
|
|
1113
1113
|
}
|
|
1114
|
-
function
|
|
1115
|
-
const e =
|
|
1114
|
+
function bn(a, t) {
|
|
1115
|
+
const e = a.textContent || "", o = yn(a, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
|
|
1116
1116
|
`), l = r.length, c = r[r.length - 1].length + 1;
|
|
1117
1117
|
return { line: l, column: c };
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function yn(a, t, e) {
|
|
1120
1120
|
var l;
|
|
1121
1121
|
let o = 0;
|
|
1122
1122
|
const i = document.createTreeWalker(
|
|
1123
|
-
|
|
1123
|
+
a,
|
|
1124
1124
|
NodeFilter.SHOW_TEXT,
|
|
1125
1125
|
null
|
|
1126
1126
|
);
|
|
@@ -1134,27 +1134,27 @@ function gn(s, t, e) {
|
|
|
1134
1134
|
}
|
|
1135
1135
|
return o;
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1137
|
+
function En(a) {
|
|
1138
1138
|
var o, i;
|
|
1139
|
-
const t =
|
|
1139
|
+
const t = a.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
|
|
1140
1140
|
let e = 1;
|
|
1141
1141
|
if (t.length > 0) {
|
|
1142
1142
|
e = t.length;
|
|
1143
1143
|
const r = t[t.length - 1];
|
|
1144
1144
|
(r.tagName === "BR" || ((o = r.innerHTML) == null ? void 0 : o.trim()) === "" || ((i = r.textContent) == null ? void 0 : i.trim()) === "") && e++;
|
|
1145
1145
|
} else {
|
|
1146
|
-
const l = (
|
|
1146
|
+
const l = (a.textContent || "").split(`
|
|
1147
1147
|
`).length;
|
|
1148
1148
|
e = Math.max(1, l);
|
|
1149
1149
|
}
|
|
1150
1150
|
return e;
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1153
|
-
const t =
|
|
1152
|
+
function vn(a) {
|
|
1153
|
+
const t = a.trim() ? a.trim().split(/\s+/).length : 0, e = a.length;
|
|
1154
1154
|
return { words: t, chars: e };
|
|
1155
1155
|
}
|
|
1156
|
-
function
|
|
1157
|
-
const e =
|
|
1156
|
+
function wn(a, t) {
|
|
1157
|
+
const e = a.toString();
|
|
1158
1158
|
return {
|
|
1159
1159
|
startLine: t.line,
|
|
1160
1160
|
startColumn: t.column,
|
|
@@ -1165,25 +1165,25 @@ function vn(s, t) {
|
|
|
1165
1165
|
selectedWords: e.trim().split(/\s+/).filter(Boolean).length
|
|
1166
1166
|
};
|
|
1167
1167
|
}
|
|
1168
|
-
function
|
|
1169
|
-
(t == null || t >
|
|
1170
|
-
for (var e = 0, o = Array(t); e < t; e++) o[e] =
|
|
1168
|
+
function ro(a, t) {
|
|
1169
|
+
(t == null || t > a.length) && (t = a.length);
|
|
1170
|
+
for (var e = 0, o = Array(t); e < t; e++) o[e] = a[e];
|
|
1171
1171
|
return o;
|
|
1172
1172
|
}
|
|
1173
|
-
function
|
|
1174
|
-
if (Array.isArray(
|
|
1173
|
+
function Tn(a) {
|
|
1174
|
+
if (Array.isArray(a)) return a;
|
|
1175
1175
|
}
|
|
1176
|
-
function
|
|
1177
|
-
var e =
|
|
1176
|
+
function kn(a, t) {
|
|
1177
|
+
var e = a == null ? null : typeof Symbol != "undefined" && a[Symbol.iterator] || a["@@iterator"];
|
|
1178
1178
|
if (e != null) {
|
|
1179
|
-
var o, i, r, l, c = [],
|
|
1179
|
+
var o, i, r, l, c = [], f = !0, m = !1;
|
|
1180
1180
|
try {
|
|
1181
|
-
if (r = (e = e.call(
|
|
1181
|
+
if (r = (e = e.call(a)).next, t !== 0) for (; !(f = (o = r.call(e)).done) && (c.push(o.value), c.length !== t); f = !0) ;
|
|
1182
1182
|
} catch (g) {
|
|
1183
1183
|
m = !0, i = g;
|
|
1184
1184
|
} finally {
|
|
1185
1185
|
try {
|
|
1186
|
-
if (!
|
|
1186
|
+
if (!f && e.return != null && (l = e.return(), Object(l) !== l)) return;
|
|
1187
1187
|
} finally {
|
|
1188
1188
|
if (m) throw i;
|
|
1189
1189
|
}
|
|
@@ -1191,122 +1191,122 @@ function wn(s, t) {
|
|
|
1191
1191
|
return c;
|
|
1192
1192
|
}
|
|
1193
1193
|
}
|
|
1194
|
-
function
|
|
1194
|
+
function xn() {
|
|
1195
1195
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1196
1196
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1199
|
-
return
|
|
1198
|
+
function An(a, t) {
|
|
1199
|
+
return Tn(a) || kn(a, t) || Cn(a, t) || xn();
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1202
|
-
if (
|
|
1203
|
-
if (typeof
|
|
1204
|
-
var e = {}.toString.call(
|
|
1205
|
-
return e === "Object" &&
|
|
1201
|
+
function Cn(a, t) {
|
|
1202
|
+
if (a) {
|
|
1203
|
+
if (typeof a == "string") return ro(a, t);
|
|
1204
|
+
var e = {}.toString.call(a).slice(8, -1);
|
|
1205
|
+
return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ro(a, t) : void 0;
|
|
1206
1206
|
}
|
|
1207
1207
|
}
|
|
1208
|
-
const
|
|
1209
|
-
let M = Object.freeze,
|
|
1208
|
+
const _o = Object.entries, ao = Object.setPrototypeOf, Sn = Object.isFrozen, _n = Object.getPrototypeOf, Ln = Object.getOwnPropertyDescriptor;
|
|
1209
|
+
let M = Object.freeze, D = Object.seal, yt = Object.create, Lo = typeof Reflect != "undefined" && Reflect, ke = Lo.apply, xe = Lo.construct;
|
|
1210
1210
|
M || (M = function(t) {
|
|
1211
1211
|
return t;
|
|
1212
1212
|
});
|
|
1213
|
-
|
|
1213
|
+
D || (D = function(t) {
|
|
1214
1214
|
return t;
|
|
1215
1215
|
});
|
|
1216
|
-
|
|
1216
|
+
ke || (ke = function(t, e) {
|
|
1217
1217
|
for (var o = arguments.length, i = new Array(o > 2 ? o - 2 : 0), r = 2; r < o; r++) i[r - 2] = arguments[r];
|
|
1218
1218
|
return t.apply(e, i);
|
|
1219
1219
|
});
|
|
1220
|
-
|
|
1220
|
+
xe || (xe = function(t) {
|
|
1221
1221
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1222
1222
|
return new t(...o);
|
|
1223
1223
|
});
|
|
1224
|
-
const rt = L(Array.prototype.forEach),
|
|
1225
|
-
function L(
|
|
1224
|
+
const rt = L(Array.prototype.forEach), Mn = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), Ct = L(Array.prototype.push), Dn = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), lo = L(String.prototype.match), St = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim), On = L(Number.prototype.toString), Rn = L(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), fo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), P = L(Object.prototype.hasOwnProperty), _t = L(Object.prototype.toString), I = L(RegExp.prototype.test), Q = Nn(TypeError);
|
|
1225
|
+
function L(a) {
|
|
1226
1226
|
return function(t) {
|
|
1227
1227
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
1228
1228
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1229
|
-
return
|
|
1229
|
+
return ke(a, t, o);
|
|
1230
1230
|
};
|
|
1231
1231
|
}
|
|
1232
|
-
function
|
|
1232
|
+
function Nn(a) {
|
|
1233
1233
|
return function() {
|
|
1234
1234
|
for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
|
|
1235
|
-
return
|
|
1235
|
+
return xe(a, e);
|
|
1236
1236
|
};
|
|
1237
1237
|
}
|
|
1238
|
-
function
|
|
1238
|
+
function E(a, t) {
|
|
1239
1239
|
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Mt;
|
|
1240
|
-
if (
|
|
1240
|
+
if (ao && ao(a, null), !vt(t)) return a;
|
|
1241
1241
|
let o = t.length;
|
|
1242
1242
|
for (; o--; ) {
|
|
1243
1243
|
let i = t[o];
|
|
1244
1244
|
if (typeof i == "string") {
|
|
1245
1245
|
const r = e(i);
|
|
1246
|
-
r !== i && (
|
|
1246
|
+
r !== i && (Sn(t) || (t[o] = r), i = r);
|
|
1247
1247
|
}
|
|
1248
|
-
|
|
1248
|
+
a[i] = !0;
|
|
1249
1249
|
}
|
|
1250
|
-
return
|
|
1250
|
+
return a;
|
|
1251
1251
|
}
|
|
1252
|
-
function
|
|
1253
|
-
for (let t = 0; t <
|
|
1254
|
-
return
|
|
1252
|
+
function Pn(a) {
|
|
1253
|
+
for (let t = 0; t < a.length; t++) P(a, t) || (a[t] = null);
|
|
1254
|
+
return a;
|
|
1255
1255
|
}
|
|
1256
|
-
function U(
|
|
1257
|
-
const t =
|
|
1258
|
-
for (const o of
|
|
1259
|
-
var e =
|
|
1256
|
+
function U(a) {
|
|
1257
|
+
const t = yt(null);
|
|
1258
|
+
for (const o of _o(a)) {
|
|
1259
|
+
var e = An(o, 2);
|
|
1260
1260
|
const i = e[0], r = e[1];
|
|
1261
|
-
P(
|
|
1261
|
+
P(a, i) && (vt(r) ? t[i] = Pn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = U(r) : t[i] = r);
|
|
1262
1262
|
}
|
|
1263
1263
|
return t;
|
|
1264
1264
|
}
|
|
1265
|
-
function
|
|
1266
|
-
switch (typeof
|
|
1265
|
+
function zn(a) {
|
|
1266
|
+
switch (typeof a) {
|
|
1267
1267
|
case "string":
|
|
1268
|
-
return
|
|
1268
|
+
return a;
|
|
1269
1269
|
case "number":
|
|
1270
|
-
return
|
|
1270
|
+
return On(a);
|
|
1271
1271
|
case "boolean":
|
|
1272
|
-
return
|
|
1272
|
+
return Rn(a);
|
|
1273
1273
|
case "bigint":
|
|
1274
|
-
return
|
|
1274
|
+
return uo ? uo(a) : "0";
|
|
1275
1275
|
case "symbol":
|
|
1276
|
-
return
|
|
1276
|
+
return fo ? fo(a) : "Symbol()";
|
|
1277
1277
|
case "undefined":
|
|
1278
|
-
return
|
|
1278
|
+
return _t(a);
|
|
1279
1279
|
case "function":
|
|
1280
1280
|
case "object": {
|
|
1281
|
-
if (
|
|
1282
|
-
const t =
|
|
1281
|
+
if (a === null) return _t(a);
|
|
1282
|
+
const t = a, e = W(t, "toString");
|
|
1283
1283
|
if (typeof e == "function") {
|
|
1284
1284
|
const o = e(t);
|
|
1285
|
-
return typeof o == "string" ? o :
|
|
1285
|
+
return typeof o == "string" ? o : _t(o);
|
|
1286
1286
|
}
|
|
1287
|
-
return
|
|
1287
|
+
return _t(a);
|
|
1288
1288
|
}
|
|
1289
1289
|
default:
|
|
1290
|
-
return
|
|
1290
|
+
return _t(a);
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
1293
|
-
function W(
|
|
1294
|
-
for (;
|
|
1295
|
-
const o =
|
|
1293
|
+
function W(a, t) {
|
|
1294
|
+
for (; a !== null; ) {
|
|
1295
|
+
const o = Ln(a, t);
|
|
1296
1296
|
if (o) {
|
|
1297
1297
|
if (o.get) return L(o.get);
|
|
1298
1298
|
if (typeof o.value == "function") return L(o.value);
|
|
1299
1299
|
}
|
|
1300
|
-
|
|
1300
|
+
a = _n(a);
|
|
1301
1301
|
}
|
|
1302
1302
|
function e() {
|
|
1303
1303
|
return null;
|
|
1304
1304
|
}
|
|
1305
1305
|
return e;
|
|
1306
1306
|
}
|
|
1307
|
-
function
|
|
1307
|
+
function Bn(a) {
|
|
1308
1308
|
try {
|
|
1309
|
-
return
|
|
1309
|
+
return I(a, ""), !0;
|
|
1310
1310
|
} catch (t) {
|
|
1311
1311
|
return !1;
|
|
1312
1312
|
}
|
|
@@ -1505,7 +1505,7 @@ const po = M([
|
|
|
1505
1505
|
"feSpotLight",
|
|
1506
1506
|
"feTile",
|
|
1507
1507
|
"feTurbulence"
|
|
1508
|
-
]),
|
|
1508
|
+
]), Hn = M([
|
|
1509
1509
|
"animate",
|
|
1510
1510
|
"color-profile",
|
|
1511
1511
|
"cursor",
|
|
@@ -1559,7 +1559,7 @@ const po = M([
|
|
|
1559
1559
|
"munder",
|
|
1560
1560
|
"munderover",
|
|
1561
1561
|
"mprescripts"
|
|
1562
|
-
]),
|
|
1562
|
+
]), Fn = M([
|
|
1563
1563
|
"maction",
|
|
1564
1564
|
"maligngroup",
|
|
1565
1565
|
"malignmark",
|
|
@@ -1575,7 +1575,7 @@ const po = M([
|
|
|
1575
1575
|
"annotation-xml",
|
|
1576
1576
|
"mprescripts",
|
|
1577
1577
|
"none"
|
|
1578
|
-
]),
|
|
1578
|
+
]), ho = M(["#text"]), mo = M([
|
|
1579
1579
|
"accept",
|
|
1580
1580
|
"action",
|
|
1581
1581
|
"align",
|
|
@@ -1887,7 +1887,7 @@ const po = M([
|
|
|
1887
1887
|
"y2",
|
|
1888
1888
|
"z",
|
|
1889
1889
|
"zoomandpan"
|
|
1890
|
-
]),
|
|
1890
|
+
]), go = M([
|
|
1891
1891
|
"accent",
|
|
1892
1892
|
"accentunder",
|
|
1893
1893
|
"align",
|
|
@@ -1948,7 +1948,7 @@ const po = M([
|
|
|
1948
1948
|
"xlink:title",
|
|
1949
1949
|
"xml:space",
|
|
1950
1950
|
"xmlns:xlink"
|
|
1951
|
-
]),
|
|
1951
|
+
]), Un = D(/{{[\w\W]*|^[\w\W]*}}/g), jn = D(/<%[\w\W]*|^[\w\W]*%>/g), Wn = D(/\${[\w\W]*/g), $n = D(/^data-[\-\w.\u00B7-\uFFFF]+$/), Gn = D(/^aria-[\-\w]+$/), bo = D(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Kn = D(/^(?:\w+script|data):/i), Yn = D(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), qn = D(/^html$/i), Vn = D(/^[a-z][.\w]*(-[.\w]+)+$/i), yo = D(/<[/\w!]/g), Eo = D(/<[/\w]/g), Xn = D(/<\/no(script|embed|frames)/i), Qn = D(/\/>/i), F = {
|
|
1952
1952
|
element: 1,
|
|
1953
1953
|
attribute: 2,
|
|
1954
1954
|
text: 3,
|
|
@@ -1961,7 +1961,7 @@ const po = M([
|
|
|
1961
1961
|
documentType: 10,
|
|
1962
1962
|
documentFragment: 11,
|
|
1963
1963
|
notation: 12
|
|
1964
|
-
},
|
|
1964
|
+
}, Mo = [
|
|
1965
1965
|
"style",
|
|
1966
1966
|
"script",
|
|
1967
1967
|
"xmp",
|
|
@@ -1970,14 +1970,14 @@ const po = M([
|
|
|
1970
1970
|
"noframes",
|
|
1971
1971
|
"plaintext",
|
|
1972
1972
|
"noscript"
|
|
1973
|
-
],
|
|
1974
|
-
const
|
|
1975
|
-
return rt(
|
|
1976
|
-
|
|
1977
|
-
}), M(
|
|
1978
|
-
})(),
|
|
1973
|
+
], Zn = M(E({}, Mo)), Jn = (function() {
|
|
1974
|
+
const a = {};
|
|
1975
|
+
return rt(Mo, (t) => {
|
|
1976
|
+
a[t] = D(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
1977
|
+
}), M(a);
|
|
1978
|
+
})(), ti = function() {
|
|
1979
1979
|
return typeof window == "undefined" ? null : window;
|
|
1980
|
-
},
|
|
1980
|
+
}, ei = function(t, e) {
|
|
1981
1981
|
if (typeof t != "object" || typeof t.createPolicy != "function") return null;
|
|
1982
1982
|
let o = null;
|
|
1983
1983
|
const i = "data-tt-policy-suffix";
|
|
@@ -2007,24 +2007,24 @@ const po = M([
|
|
|
2007
2007
|
uponSanitizeElement: [],
|
|
2008
2008
|
uponSanitizeShadowNode: []
|
|
2009
2009
|
};
|
|
2010
|
-
},
|
|
2011
|
-
return P(t, e) && vt(t[e]) ?
|
|
2012
|
-
},
|
|
2010
|
+
}, Z = function(t, e, o, i) {
|
|
2011
|
+
return P(t, e) && vt(t[e]) ? E(i.base ? U(i.base) : {}, t[e], i.transform) : o;
|
|
2012
|
+
}, Ee = function(t, e, o) {
|
|
2013
2013
|
const i = P(t, e) ? t[e] : void 0;
|
|
2014
2014
|
return i && typeof i == "object" ? U(i) : o();
|
|
2015
2015
|
};
|
|
2016
|
-
function
|
|
2017
|
-
let
|
|
2018
|
-
const t = (u) =>
|
|
2019
|
-
if (t.version = "3.4.16", t.removed = [], !
|
|
2016
|
+
function Do() {
|
|
2017
|
+
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ti();
|
|
2018
|
+
const t = (u) => Do(u);
|
|
2019
|
+
if (t.version = "3.4.16", t.removed = [], !a || !a.document || a.document.nodeType !== F.document || !a.Element)
|
|
2020
2020
|
return t.isSupported = !1, t;
|
|
2021
|
-
let e =
|
|
2021
|
+
let e = a.document;
|
|
2022
2022
|
const o = e, i = o.currentScript;
|
|
2023
|
-
|
|
2024
|
-
const r =
|
|
2025
|
-
|
|
2026
|
-
const m =
|
|
2027
|
-
return
|
|
2023
|
+
a.DocumentFragment;
|
|
2024
|
+
const r = a.HTMLTemplateElement, l = a.Node, c = a.Element, f = a.NodeFilter;
|
|
2025
|
+
a.NamedNodeMap === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
|
|
2026
|
+
const m = a.DOMParser, g = a.trustedTypes, w = c.prototype, T = W(w, "cloneNode"), v = W(w, "remove"), k = W(w, "removeAttributeNode"), tt = W(w, "nextSibling"), $ = W(w, "childNodes"), z = W(w, "parentNode"), at = W(w, "shadowRoot"), B = W(w, "attributes"), O = l && l.prototype ? W(l.prototype, "nodeType") : null, st = l && l.prototype ? W(l.prototype, "nodeName") : null, Dt = l && l.prototype ? W(l.prototype, "ownerDocument") : null, wt = function(n) {
|
|
2027
|
+
return O ? O(n) : n.nodeType;
|
|
2028
2028
|
}, Xt = function(n) {
|
|
2029
2029
|
return st ? st(n) : n.nodeName;
|
|
2030
2030
|
};
|
|
@@ -2032,45 +2032,45 @@ function Lo() {
|
|
|
2032
2032
|
const u = e.createElement("template");
|
|
2033
2033
|
u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
|
|
2034
2034
|
}
|
|
2035
|
-
let N, et = "",
|
|
2036
|
-
const
|
|
2037
|
-
if (
|
|
2035
|
+
let N, et = "", Qt, Se = !1, Tt = 0;
|
|
2036
|
+
const _e = function() {
|
|
2037
|
+
if (Tt > 0) throw Q('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
|
|
2038
2038
|
}, lt = function(n) {
|
|
2039
|
-
|
|
2039
|
+
_e(), Tt++;
|
|
2040
2040
|
try {
|
|
2041
2041
|
return N.createHTML(n);
|
|
2042
2042
|
} finally {
|
|
2043
|
-
|
|
2043
|
+
Tt--;
|
|
2044
2044
|
}
|
|
2045
|
-
},
|
|
2046
|
-
|
|
2045
|
+
}, No = function(n) {
|
|
2046
|
+
_e(), Tt++;
|
|
2047
2047
|
try {
|
|
2048
2048
|
return N.createScriptURL(n);
|
|
2049
2049
|
} finally {
|
|
2050
|
-
|
|
2050
|
+
Tt--;
|
|
2051
2051
|
}
|
|
2052
|
-
},
|
|
2053
|
-
return
|
|
2054
|
-
},
|
|
2052
|
+
}, Po = function() {
|
|
2053
|
+
return Se || (Qt = ei(g, i), Se = !0), Qt;
|
|
2054
|
+
}, It = e, Zt = It.implementation, Le = It.createNodeIterator, zo = It.createDocumentFragment, Bo = It.getElementsByTagName, Ho = o.importNode;
|
|
2055
2055
|
let x = vo();
|
|
2056
|
-
t.isSupported = typeof
|
|
2057
|
-
const
|
|
2058
|
-
let
|
|
2059
|
-
const
|
|
2056
|
+
t.isSupported = typeof _o == "function" && typeof z == "function" && Zt && Zt.createHTMLDocument !== void 0;
|
|
2057
|
+
const Fo = Un, Uo = jn, jo = Wn, Wo = $n, $o = Gn, Go = Kn, Me = Yn, Ko = Vn;
|
|
2058
|
+
let De = bo, A = null;
|
|
2059
|
+
const Jt = E({}, [
|
|
2060
2060
|
...po,
|
|
2061
2061
|
...me,
|
|
2062
2062
|
...ge,
|
|
2063
2063
|
...be,
|
|
2064
|
-
...
|
|
2064
|
+
...ho
|
|
2065
2065
|
]);
|
|
2066
2066
|
let C = null;
|
|
2067
|
-
const te =
|
|
2068
|
-
...ho,
|
|
2069
|
-
...ye,
|
|
2067
|
+
const te = E({}, [
|
|
2070
2068
|
...mo,
|
|
2069
|
+
...ye,
|
|
2070
|
+
...go,
|
|
2071
2071
|
...Gt
|
|
2072
2072
|
]);
|
|
2073
|
-
let G = Object.seal(
|
|
2073
|
+
let G = Object.seal(yt(null, {
|
|
2074
2074
|
tagNameCheck: {
|
|
2075
2075
|
writable: !0,
|
|
2076
2076
|
configurable: !1,
|
|
@@ -2089,8 +2089,8 @@ function Lo() {
|
|
|
2089
2089
|
enumerable: !0,
|
|
2090
2090
|
value: !1
|
|
2091
2091
|
}
|
|
2092
|
-
})),
|
|
2093
|
-
const q = Object.seal(
|
|
2092
|
+
})), kt = null, Ie = null;
|
|
2093
|
+
const q = Object.seal(yt(null, {
|
|
2094
2094
|
tagCheck: {
|
|
2095
2095
|
writable: !0,
|
|
2096
2096
|
configurable: !1,
|
|
@@ -2104,10 +2104,10 @@ function Lo() {
|
|
|
2104
2104
|
value: null
|
|
2105
2105
|
}
|
|
2106
2106
|
}));
|
|
2107
|
-
let Oe = !0, ee = !0,
|
|
2108
|
-
const
|
|
2107
|
+
let Oe = !0, ee = !0, Re = !1, Ne = !0, V = !1, ot = !0, nt = !1, oe = !1, Ot = null, Rt = null, ne = !1, ct = !1, Nt = !1, Pt = !1, Pe = !0, ze = !1;
|
|
2108
|
+
const Be = "user-content-";
|
|
2109
2109
|
let ie = !0, re = !1, dt = {}, ut = null;
|
|
2110
|
-
const
|
|
2110
|
+
const He = E({}, [
|
|
2111
2111
|
"annotation-xml",
|
|
2112
2112
|
"audio",
|
|
2113
2113
|
"colgroup",
|
|
@@ -2135,8 +2135,8 @@ function Lo() {
|
|
|
2135
2135
|
"video",
|
|
2136
2136
|
"xmp"
|
|
2137
2137
|
]);
|
|
2138
|
-
let
|
|
2139
|
-
const
|
|
2138
|
+
let Fe = null;
|
|
2139
|
+
const Ue = E({}, [
|
|
2140
2140
|
"audio",
|
|
2141
2141
|
"video",
|
|
2142
2142
|
"img",
|
|
@@ -2144,8 +2144,8 @@ function Lo() {
|
|
|
2144
2144
|
"image",
|
|
2145
2145
|
"track"
|
|
2146
2146
|
]);
|
|
2147
|
-
let
|
|
2148
|
-
const
|
|
2147
|
+
let je = null;
|
|
2148
|
+
const We = E({}, [
|
|
2149
2149
|
"alt",
|
|
2150
2150
|
"class",
|
|
2151
2151
|
"for",
|
|
@@ -2161,89 +2161,89 @@ function Lo() {
|
|
|
2161
2161
|
"style",
|
|
2162
2162
|
"xmlns"
|
|
2163
2163
|
]), zt = "http://www.w3.org/1998/Math/MathML", Bt = "http://www.w3.org/2000/svg", K = "http://www.w3.org/1999/xhtml";
|
|
2164
|
-
let
|
|
2165
|
-
const
|
|
2164
|
+
let ft = K, ae = !1, se = null;
|
|
2165
|
+
const Yo = E({}, [
|
|
2166
2166
|
zt,
|
|
2167
2167
|
Bt,
|
|
2168
2168
|
K
|
|
2169
|
-
], he),
|
|
2169
|
+
], he), $e = M([
|
|
2170
2170
|
"mi",
|
|
2171
2171
|
"mo",
|
|
2172
2172
|
"mn",
|
|
2173
2173
|
"ms",
|
|
2174
2174
|
"mtext"
|
|
2175
2175
|
]);
|
|
2176
|
-
let le =
|
|
2177
|
-
const
|
|
2178
|
-
let ce =
|
|
2179
|
-
const
|
|
2176
|
+
let le = E({}, $e);
|
|
2177
|
+
const Ge = M(["annotation-xml"]);
|
|
2178
|
+
let ce = E({}, Ge);
|
|
2179
|
+
const qo = E({}, [
|
|
2180
2180
|
"title",
|
|
2181
2181
|
"style",
|
|
2182
2182
|
"font",
|
|
2183
2183
|
"a",
|
|
2184
2184
|
"script"
|
|
2185
2185
|
]);
|
|
2186
|
-
let
|
|
2187
|
-
const
|
|
2188
|
-
let _ = null,
|
|
2189
|
-
const
|
|
2186
|
+
let xt = null;
|
|
2187
|
+
const Vo = ["application/xhtml+xml", "text/html"], Xo = "text/html";
|
|
2188
|
+
let _ = null, pt = null;
|
|
2189
|
+
const Qo = e.createElement("form"), Ke = function(n) {
|
|
2190
2190
|
return n instanceof RegExp || n instanceof Function;
|
|
2191
2191
|
}, de = function() {
|
|
2192
2192
|
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2193
|
-
if (
|
|
2194
|
-
(!n || typeof n != "object") && (n = {}), n = U(n),
|
|
2193
|
+
if (pt && pt === n) return;
|
|
2194
|
+
(!n || typeof n != "object") && (n = {}), n = U(n), xt = Vo.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? Xo : n.PARSER_MEDIA_TYPE, _ = xt === "application/xhtml+xml" ? he : Mt, A = Z(n, "ALLOWED_TAGS", Jt, { transform: _ }), C = Z(n, "ALLOWED_ATTR", te, { transform: _ }), se = Z(n, "ALLOWED_NAMESPACES", Yo, { transform: he }), je = Z(n, "ADD_URI_SAFE_ATTR", We, {
|
|
2195
2195
|
transform: _,
|
|
2196
|
-
base:
|
|
2197
|
-
}),
|
|
2196
|
+
base: We
|
|
2197
|
+
}), Fe = Z(n, "ADD_DATA_URI_TAGS", Ue, {
|
|
2198
2198
|
transform: _,
|
|
2199
|
-
base:
|
|
2200
|
-
}), ut =
|
|
2201
|
-
const
|
|
2202
|
-
if (G =
|
|
2199
|
+
base: Ue
|
|
2200
|
+
}), ut = Z(n, "FORBID_CONTENTS", He, { transform: _ }), kt = Z(n, "FORBID_TAGS", U({}), { transform: _ }), Ie = Z(n, "FORBID_ATTR", U({}), { transform: _ }), dt = P(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? U(n.USE_PROFILES) : n.USE_PROFILES : !1, Oe = n.ALLOW_ARIA_ATTR !== !1, ee = n.ALLOW_DATA_ATTR !== !1, Re = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = n.SAFE_FOR_TEMPLATES || !1, ot = n.SAFE_FOR_XML !== !1, nt = n.WHOLE_DOCUMENT || !1, ct = n.RETURN_DOM || !1, Nt = n.RETURN_DOM_FRAGMENT || !1, Pt = n.RETURN_TRUSTED_TYPE || !1, ne = n.FORCE_BODY || !1, Pe = n.SANITIZE_DOM !== !1, ze = n.SANITIZE_NAMED_PROPS || !1, ie = n.KEEP_CONTENT !== !1, re = n.IN_PLACE || !1, De = Bn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : bo, ft = typeof n.NAMESPACE == "string" ? n.NAMESPACE : K, le = Ee(n, "MATHML_TEXT_INTEGRATION_POINTS", () => E({}, $e)), ce = Ee(n, "HTML_INTEGRATION_POINTS", () => E({}, Ge));
|
|
2201
|
+
const s = Ee(n, "CUSTOM_ELEMENT_HANDLING", () => yt(null));
|
|
2202
|
+
if (G = yt(null), P(s, "tagNameCheck") && Ke(s.tagNameCheck) && (G.tagNameCheck = s.tagNameCheck), P(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && (G.attributeNameCheck = s.attributeNameCheck), P(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), D(G), V && (ee = !1), Nt && (ct = !0), dt && (A = E({}, ho), C = yt(null), dt.html === !0 && (E(A, po), E(C, mo)), dt.svg === !0 && (E(A, me), E(C, ye), E(C, Gt)), dt.svgFilters === !0 && (E(A, ge), E(C, ye), E(C, Gt)), dt.mathMl === !0 && (E(A, be), E(C, go), E(C, Gt))), q.tagCheck = null, q.attributeCheck = null, P(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? q.tagCheck = n.ADD_TAGS : vt(n.ADD_TAGS) && (A === Jt && (A = U(A)), E(A, n.ADD_TAGS, _))), P(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? q.attributeCheck = n.ADD_ATTR : vt(n.ADD_ATTR) && (C === te && (C = U(C)), E(C, n.ADD_ATTR, _))), P(n, "ADD_FORBID_CONTENTS") && vt(n.ADD_FORBID_CONTENTS) && (ut === He && (ut = U(ut)), E(ut, n.ADD_FORBID_CONTENTS, _)), ie && (A["#text"] = !0), nt && E(A, [
|
|
2203
2203
|
"html",
|
|
2204
2204
|
"head",
|
|
2205
2205
|
"body"
|
|
2206
|
-
]), A.table && (
|
|
2207
|
-
if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
2208
|
-
if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
2206
|
+
]), A.table && (E(A, ["tbody"]), delete kt.tbody), n.TRUSTED_TYPES_POLICY) {
|
|
2207
|
+
if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2208
|
+
if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2209
2209
|
const d = N;
|
|
2210
2210
|
N = n.TRUSTED_TYPES_POLICY;
|
|
2211
2211
|
try {
|
|
2212
2212
|
et = lt("");
|
|
2213
|
-
} catch (
|
|
2214
|
-
throw N = d,
|
|
2213
|
+
} catch (p) {
|
|
2214
|
+
throw N = d, p;
|
|
2215
2215
|
}
|
|
2216
|
-
} else n.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N =
|
|
2217
|
-
M && M(n),
|
|
2218
|
-
},
|
|
2216
|
+
} else n.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Po()), N && typeof et == "string" && (et = lt("")));
|
|
2217
|
+
M && M(n), pt = n;
|
|
2218
|
+
}, Ye = E({}, [
|
|
2219
2219
|
...me,
|
|
2220
2220
|
...ge,
|
|
2221
|
-
...
|
|
2222
|
-
]),
|
|
2223
|
-
return
|
|
2224
|
-
},
|
|
2225
|
-
return
|
|
2226
|
-
},
|
|
2227
|
-
return
|
|
2228
|
-
},
|
|
2229
|
-
let
|
|
2230
|
-
(!
|
|
2231
|
-
namespaceURI:
|
|
2221
|
+
...Hn
|
|
2222
|
+
]), qe = E({}, [...be, ...Fn]), Zo = function(n, s, d) {
|
|
2223
|
+
return s.namespaceURI === K ? n === "svg" : s.namespaceURI === zt ? n === "svg" && (d === "annotation-xml" || le[d]) : !!Ye[n];
|
|
2224
|
+
}, Jo = function(n, s, d) {
|
|
2225
|
+
return s.namespaceURI === K ? n === "math" : s.namespaceURI === Bt ? n === "math" && ce[d] : !!qe[n];
|
|
2226
|
+
}, tn = function(n, s, d) {
|
|
2227
|
+
return s.namespaceURI === Bt && !ce[d] || s.namespaceURI === zt && !le[d] ? !1 : !qe[n] && (qo[n] || !Ye[n]);
|
|
2228
|
+
}, en = function(n) {
|
|
2229
|
+
let s = z(n);
|
|
2230
|
+
(!s || !s.tagName) && (s = {
|
|
2231
|
+
namespaceURI: ft,
|
|
2232
2232
|
tagName: "template"
|
|
2233
2233
|
});
|
|
2234
|
-
const d = Mt(n.tagName),
|
|
2235
|
-
return se[n.namespaceURI] ? n.namespaceURI === Bt ?
|
|
2234
|
+
const d = Mt(n.tagName), p = Mt(s.tagName);
|
|
2235
|
+
return se[n.namespaceURI] ? n.namespaceURI === Bt ? Zo(d, s, p) : n.namespaceURI === zt ? Jo(d, s, p) : n.namespaceURI === K ? tn(d, s, p) : !!(xt === "application/xhtml+xml" && se[n.namespaceURI]) : !1;
|
|
2236
2236
|
}, X = function(n) {
|
|
2237
|
-
|
|
2237
|
+
Ct(t.removed, { element: n });
|
|
2238
2238
|
try {
|
|
2239
2239
|
z(n).removeChild(n);
|
|
2240
|
-
} catch (
|
|
2241
|
-
if (
|
|
2240
|
+
} catch (s) {
|
|
2241
|
+
if (v(n), !z(n)) throw Q("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2242
2242
|
}
|
|
2243
|
-
},
|
|
2243
|
+
}, Ve = function(n, s, d) {
|
|
2244
2244
|
try {
|
|
2245
|
-
k(n,
|
|
2246
|
-
} catch (
|
|
2245
|
+
k(n, s);
|
|
2246
|
+
} catch (p) {
|
|
2247
2247
|
try {
|
|
2248
2248
|
n.removeAttribute(d);
|
|
2249
2249
|
} catch (h) {
|
|
@@ -2251,203 +2251,203 @@ function Lo() {
|
|
|
2251
2251
|
}
|
|
2252
2252
|
}, Ht = function(n) {
|
|
2253
2253
|
Ft(n);
|
|
2254
|
-
const
|
|
2255
|
-
if (
|
|
2256
|
-
const
|
|
2257
|
-
rt(
|
|
2258
|
-
|
|
2259
|
-
}), rt(
|
|
2254
|
+
const s = $(n);
|
|
2255
|
+
if (s) {
|
|
2256
|
+
const p = [];
|
|
2257
|
+
rt(s, (h) => {
|
|
2258
|
+
Ct(p, h);
|
|
2259
|
+
}), rt(p, (h) => {
|
|
2260
2260
|
try {
|
|
2261
|
-
|
|
2261
|
+
v(h);
|
|
2262
2262
|
} catch (b) {
|
|
2263
2263
|
}
|
|
2264
2264
|
});
|
|
2265
2265
|
}
|
|
2266
2266
|
const d = B(n);
|
|
2267
|
-
if (d) for (let
|
|
2268
|
-
const h = d[
|
|
2269
|
-
typeof b == "string" &&
|
|
2267
|
+
if (d) for (let p = d.length - 1; p >= 0; --p) {
|
|
2268
|
+
const h = d[p], b = h && h.name;
|
|
2269
|
+
typeof b == "string" && Ve(n, h, b);
|
|
2270
2270
|
}
|
|
2271
|
-
}, it = function(n,
|
|
2271
|
+
}, it = function(n, s, d) {
|
|
2272
2272
|
if (!d) try {
|
|
2273
|
-
d =
|
|
2274
|
-
} catch (
|
|
2273
|
+
d = s.getAttributeNode(n);
|
|
2274
|
+
} catch (p) {
|
|
2275
2275
|
d = null;
|
|
2276
2276
|
}
|
|
2277
|
-
|
|
2277
|
+
Ct(t.removed, {
|
|
2278
2278
|
attribute: d || null,
|
|
2279
|
-
from:
|
|
2279
|
+
from: s
|
|
2280
2280
|
});
|
|
2281
2281
|
try {
|
|
2282
|
-
d ? k(
|
|
2283
|
-
} catch (
|
|
2282
|
+
d ? k(s, d) : s.removeAttribute(n);
|
|
2283
|
+
} catch (p) {
|
|
2284
2284
|
try {
|
|
2285
|
-
|
|
2285
|
+
s.removeAttribute(n);
|
|
2286
2286
|
} catch (h) {
|
|
2287
2287
|
}
|
|
2288
2288
|
}
|
|
2289
2289
|
if (n === "is")
|
|
2290
2290
|
if (ct || Nt) try {
|
|
2291
|
-
X(
|
|
2292
|
-
} catch (
|
|
2291
|
+
X(s);
|
|
2292
|
+
} catch (p) {
|
|
2293
2293
|
}
|
|
2294
2294
|
else try {
|
|
2295
|
-
|
|
2296
|
-
} catch (
|
|
2295
|
+
s.setAttribute(n, "");
|
|
2296
|
+
} catch (p) {
|
|
2297
2297
|
}
|
|
2298
|
-
},
|
|
2299
|
-
const
|
|
2300
|
-
if (
|
|
2301
|
-
for (let d =
|
|
2302
|
-
const
|
|
2303
|
-
typeof h != "string" || C[_(h)] ||
|
|
2298
|
+
}, on = function(n) {
|
|
2299
|
+
const s = B(n);
|
|
2300
|
+
if (s)
|
|
2301
|
+
for (let d = s.length - 1; d >= 0; --d) {
|
|
2302
|
+
const p = s[d], h = p && p.name;
|
|
2303
|
+
typeof h != "string" || C[_(h)] || Ve(n, p, h);
|
|
2304
2304
|
}
|
|
2305
2305
|
}, Ft = function(n) {
|
|
2306
|
-
const
|
|
2307
|
-
for (;
|
|
2308
|
-
const d =
|
|
2309
|
-
|
|
2310
|
-
const
|
|
2311
|
-
if (
|
|
2312
|
-
}
|
|
2313
|
-
},
|
|
2314
|
-
return ot ? n === "patchsrc" ? !0 : n === "for" &&
|
|
2315
|
-
},
|
|
2306
|
+
const s = [n];
|
|
2307
|
+
for (; s.length > 0; ) {
|
|
2308
|
+
const d = s.pop();
|
|
2309
|
+
wt(d) === F.element && on(d);
|
|
2310
|
+
const p = $(d);
|
|
2311
|
+
if (p) for (let h = p.length - 1; h >= 0; --h) s.push(p[h]);
|
|
2312
|
+
}
|
|
2313
|
+
}, Xe = function(n, s) {
|
|
2314
|
+
return ot ? n === "patchsrc" ? !0 : n === "for" && s !== "label" && s !== "output" : !1;
|
|
2315
|
+
}, nn = function(n) {
|
|
2316
2316
|
if (!ot) return;
|
|
2317
|
-
const
|
|
2318
|
-
for (;
|
|
2319
|
-
const d =
|
|
2320
|
-
if (
|
|
2317
|
+
const s = [n];
|
|
2318
|
+
for (; s.length > 0; ) {
|
|
2319
|
+
const d = s.pop(), p = wt(d);
|
|
2320
|
+
if (p === F.processingInstruction || p === F.comment && I(Eo, d.data)) {
|
|
2321
2321
|
try {
|
|
2322
|
-
|
|
2322
|
+
v(d);
|
|
2323
2323
|
} catch (b) {
|
|
2324
2324
|
}
|
|
2325
2325
|
continue;
|
|
2326
2326
|
}
|
|
2327
|
-
if (
|
|
2327
|
+
if (p === F.element) {
|
|
2328
2328
|
const b = d, y = _(Xt(d));
|
|
2329
2329
|
try {
|
|
2330
|
-
b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") &&
|
|
2330
|
+
b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Xe("for", y) && b.removeAttribute("for");
|
|
2331
2331
|
} catch (S) {
|
|
2332
2332
|
}
|
|
2333
2333
|
}
|
|
2334
2334
|
const h = $(d);
|
|
2335
|
-
if (h) for (let b = h.length - 1; b >= 0; --b)
|
|
2335
|
+
if (h) for (let b = h.length - 1; b >= 0; --b) s.push(h[b]);
|
|
2336
2336
|
}
|
|
2337
|
-
},
|
|
2338
|
-
let
|
|
2337
|
+
}, Qe = function(n) {
|
|
2338
|
+
let s = null, d = null;
|
|
2339
2339
|
if (ne) n = "<remove></remove>" + n;
|
|
2340
2340
|
else {
|
|
2341
|
-
const b =
|
|
2341
|
+
const b = lo(n, /^[\r\n\t ]+/);
|
|
2342
2342
|
d = b && b[0];
|
|
2343
2343
|
}
|
|
2344
|
-
|
|
2345
|
-
const
|
|
2346
|
-
if (
|
|
2347
|
-
|
|
2344
|
+
xt === "application/xhtml+xml" && ft === K && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
|
|
2345
|
+
const p = N ? lt(n) : n;
|
|
2346
|
+
if (ft === K) try {
|
|
2347
|
+
s = new m().parseFromString(p, xt);
|
|
2348
2348
|
} catch (b) {
|
|
2349
2349
|
}
|
|
2350
|
-
if (!
|
|
2351
|
-
|
|
2350
|
+
if (!s || !s.documentElement) {
|
|
2351
|
+
s = Zt.createDocument(ft, "template", null);
|
|
2352
2352
|
try {
|
|
2353
|
-
|
|
2353
|
+
s.documentElement.innerHTML = ae ? et : p;
|
|
2354
2354
|
} catch (b) {
|
|
2355
2355
|
}
|
|
2356
2356
|
}
|
|
2357
|
-
const h =
|
|
2358
|
-
return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null),
|
|
2357
|
+
const h = s.body || s.documentElement;
|
|
2358
|
+
return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ft === K ? Bo.call(s, nt ? "html" : "body")[0] : nt ? s.documentElement : h;
|
|
2359
2359
|
}, Ze = function(n) {
|
|
2360
|
-
const
|
|
2361
|
-
return
|
|
2360
|
+
const s = Dt ? Dt(n) : n.ownerDocument;
|
|
2361
|
+
return Le.call(s || n, n, f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION, null);
|
|
2362
2362
|
}, Ut = function(n) {
|
|
2363
|
-
return n =
|
|
2363
|
+
return n = St(n, Fo, " "), n = St(n, Uo, " "), n = St(n, jo, " "), n;
|
|
2364
2364
|
}, ue = function(n) {
|
|
2365
|
-
var
|
|
2365
|
+
var s;
|
|
2366
2366
|
n.normalize();
|
|
2367
|
-
const d =
|
|
2368
|
-
let h =
|
|
2367
|
+
const d = Dt ? Dt(n) : n.ownerDocument, p = Le.call(d || n, n, f.SHOW_TEXT | f.SHOW_COMMENT | f.SHOW_CDATA_SECTION | f.SHOW_PROCESSING_INSTRUCTION, null);
|
|
2368
|
+
let h = p.nextNode();
|
|
2369
2369
|
for (; h; )
|
|
2370
|
-
h.data = Ut(h.data), h =
|
|
2371
|
-
const b = (
|
|
2370
|
+
h.data = Ut(h.data), h = p.nextNode();
|
|
2371
|
+
const b = (s = n.querySelectorAll) === null || s === void 0 ? void 0 : s.call(n, "template");
|
|
2372
2372
|
b && rt(b, (y) => {
|
|
2373
2373
|
ht(y.content) && ue(y.content);
|
|
2374
2374
|
});
|
|
2375
2375
|
}, jt = function(n) {
|
|
2376
|
-
const
|
|
2377
|
-
return typeof
|
|
2376
|
+
const s = st ? st(n) : null;
|
|
2377
|
+
return typeof s != "string" || _(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== B(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !== O(n) || n.childNodes !== $(n);
|
|
2378
2378
|
}, ht = function(n) {
|
|
2379
|
-
if (!
|
|
2379
|
+
if (!O || typeof n != "object" || n === null) return !1;
|
|
2380
2380
|
try {
|
|
2381
|
-
return
|
|
2382
|
-
} catch (
|
|
2381
|
+
return O(n) === F.documentFragment;
|
|
2382
|
+
} catch (s) {
|
|
2383
2383
|
return !1;
|
|
2384
2384
|
}
|
|
2385
|
-
},
|
|
2386
|
-
if (!
|
|
2385
|
+
}, At = function(n) {
|
|
2386
|
+
if (!O || typeof n != "object" || n === null) return !1;
|
|
2387
2387
|
try {
|
|
2388
|
-
return typeof
|
|
2389
|
-
} catch (
|
|
2388
|
+
return typeof O(n) == "number";
|
|
2389
|
+
} catch (s) {
|
|
2390
2390
|
return !1;
|
|
2391
2391
|
}
|
|
2392
2392
|
};
|
|
2393
|
-
function Y(u, n,
|
|
2393
|
+
function Y(u, n, s) {
|
|
2394
2394
|
u.length !== 0 && rt(u, (d) => {
|
|
2395
|
-
d.call(t, n,
|
|
2395
|
+
d.call(t, n, s, pt);
|
|
2396
2396
|
});
|
|
2397
2397
|
}
|
|
2398
|
-
const
|
|
2399
|
-
return !!(ot && n.hasChildNodes() && !
|
|
2400
|
-
}, Wt = function(n,
|
|
2401
|
-
if (n instanceof RegExp) return
|
|
2398
|
+
const rn = function(n, s) {
|
|
2399
|
+
return !!(ot && n.hasChildNodes() && !At(n.firstElementChild) && I(yo, n.textContent) && I(yo, n.innerHTML) || ot && n.namespaceURI === K && Zn[s] && (At(n.firstElementChild) || typeof n.textContent == "string" && I(Jn[s], n.textContent)) || n.nodeType === F.processingInstruction || ot && n.nodeType === F.comment && I(Eo, n.data));
|
|
2400
|
+
}, Wt = function(n, s) {
|
|
2401
|
+
if (n instanceof RegExp) return I(n, s);
|
|
2402
2402
|
if (n instanceof Function) {
|
|
2403
|
-
for (var d = arguments.length,
|
|
2404
|
-
return !!n(
|
|
2403
|
+
for (var d = arguments.length, p = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) p[h - 2] = arguments[h];
|
|
2404
|
+
return !!n(s, ...p);
|
|
2405
2405
|
}
|
|
2406
2406
|
return !1;
|
|
2407
|
-
},
|
|
2408
|
-
if (!
|
|
2409
|
-
if (ie && !ut[
|
|
2410
|
-
const
|
|
2411
|
-
if (h &&
|
|
2407
|
+
}, an = function(n, s, d) {
|
|
2408
|
+
if (!kt[s] && oo(s) && Wt(G.tagNameCheck, s)) return !1;
|
|
2409
|
+
if (ie && !ut[s]) {
|
|
2410
|
+
const p = z(n), h = $(n);
|
|
2411
|
+
if (h && p) {
|
|
2412
2412
|
const b = h.length;
|
|
2413
2413
|
for (let y = b - 1; y >= 0; --y) {
|
|
2414
2414
|
const S = n === d ? T(h[y], !0) : h[y];
|
|
2415
|
-
|
|
2415
|
+
p.insertBefore(S, tt(n));
|
|
2416
2416
|
}
|
|
2417
2417
|
}
|
|
2418
2418
|
}
|
|
2419
2419
|
return X(n), !0;
|
|
2420
|
-
}, Je = function(n,
|
|
2421
|
-
return n.length === 0 ?
|
|
2422
|
-
}, mt = function(n,
|
|
2423
|
-
return n ===
|
|
2424
|
-
},
|
|
2425
|
-
if (Y(x.beforeSanitizeElements, n, null), mt(n,
|
|
2420
|
+
}, Je = function(n, s, d, p) {
|
|
2421
|
+
return n.length === 0 ? s : s === d || s === p ? U(s) : s;
|
|
2422
|
+
}, mt = function(n, s) {
|
|
2423
|
+
return n === s || z(n) !== null ? !1 : (re && Ft(n), !0);
|
|
2424
|
+
}, to = function(n, s) {
|
|
2425
|
+
if (Y(x.beforeSanitizeElements, n, null), mt(n, s)) return !0;
|
|
2426
2426
|
if (jt(n))
|
|
2427
2427
|
return X(n), !0;
|
|
2428
2428
|
const d = _(Xt(n));
|
|
2429
|
-
if (A = Je(x.uponSanitizeElement, A,
|
|
2429
|
+
if (A = Je(x.uponSanitizeElement, A, Jt, Ot), Y(x.uponSanitizeElement, n, {
|
|
2430
2430
|
tagName: d,
|
|
2431
2431
|
allowedTags: A
|
|
2432
|
-
}), mt(n,
|
|
2433
|
-
if (
|
|
2432
|
+
}), mt(n, s)) return !0;
|
|
2433
|
+
if (rn(n, d))
|
|
2434
2434
|
return X(n), !0;
|
|
2435
|
-
if (
|
|
2436
|
-
const
|
|
2437
|
-
return
|
|
2435
|
+
if (kt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !A[d]) {
|
|
2436
|
+
const p = an(n, d, s);
|
|
2437
|
+
return p === !1 && (Y(x.afterSanitizeElements, n, null), mt(n, s)) ? !0 : p;
|
|
2438
2438
|
}
|
|
2439
|
-
if (
|
|
2439
|
+
if (wt(n) === F.element && !en(n) || (d === "noscript" || d === "noembed" || d === "noframes") && I(Xn, n.innerHTML))
|
|
2440
2440
|
return X(n), !0;
|
|
2441
2441
|
if (V && n.nodeType === F.text) {
|
|
2442
|
-
const
|
|
2443
|
-
n.textContent !==
|
|
2444
|
-
}
|
|
2445
|
-
return Y(x.afterSanitizeElements, n, null), mt(n,
|
|
2446
|
-
},
|
|
2447
|
-
if (Ie[
|
|
2448
|
-
const
|
|
2449
|
-
return ee &&
|
|
2450
|
-
},
|
|
2442
|
+
const p = Ut(n.textContent);
|
|
2443
|
+
n.textContent !== p && (Ct(t.removed, { element: n.cloneNode() }), n.textContent = p);
|
|
2444
|
+
}
|
|
2445
|
+
return Y(x.afterSanitizeElements, n, null), mt(n, s);
|
|
2446
|
+
}, eo = function(n, s, d) {
|
|
2447
|
+
if (Ie[s] || Xe(s, n) || Pe && (s === "id" || s === "name") && (d in e || d in Qo)) return !1;
|
|
2448
|
+
const p = C[s] || q.attributeCheck instanceof Function && q.attributeCheck(s, n);
|
|
2449
|
+
return ee && I(Wo, s) || Oe && I($o, s) ? !0 : p ? je[s] || I(De, St(d, Me, "")) || (s === "src" || s === "xlink:href" || s === "href") && n !== "script" && co(d, "data:") === 0 && Fe[n] || Re && !I(Go, St(d, Me, "")) ? !0 : !d : oo(n) && Wt(G.tagNameCheck, n) && Wt(G.attributeNameCheck, s, n) || s === "is" && G.allowCustomizedBuiltInElements && Wt(G.tagNameCheck, d);
|
|
2450
|
+
}, sn = E({}, [
|
|
2451
2451
|
"annotation-xml",
|
|
2452
2452
|
"color-profile",
|
|
2453
2453
|
"font-face",
|
|
@@ -2456,28 +2456,28 @@ function Lo() {
|
|
|
2456
2456
|
"font-face-src",
|
|
2457
2457
|
"font-face-uri",
|
|
2458
2458
|
"missing-glyph"
|
|
2459
|
-
]),
|
|
2460
|
-
return !
|
|
2461
|
-
},
|
|
2462
|
-
if (N && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n,
|
|
2459
|
+
]), oo = function(n) {
|
|
2460
|
+
return !sn[Mt(n)] && I(Ko, n);
|
|
2461
|
+
}, ln = function(n, s, d, p) {
|
|
2462
|
+
if (N && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n, s)) {
|
|
2463
2463
|
case "TrustedHTML":
|
|
2464
|
-
return lt(
|
|
2464
|
+
return lt(p);
|
|
2465
2465
|
case "TrustedScriptURL":
|
|
2466
|
-
return
|
|
2466
|
+
return No(p);
|
|
2467
2467
|
}
|
|
2468
|
-
return
|
|
2469
|
-
},
|
|
2468
|
+
return p;
|
|
2469
|
+
}, cn = function(n, s, d, p) {
|
|
2470
2470
|
try {
|
|
2471
|
-
return d ? n.setAttributeNS(d,
|
|
2471
|
+
return d ? n.setAttributeNS(d, s, p) : n.setAttribute(s, p), jt(n) ? (X(n), !1) : !0;
|
|
2472
2472
|
} catch (h) {
|
|
2473
|
-
return it(
|
|
2473
|
+
return it(s, n), !1;
|
|
2474
2474
|
}
|
|
2475
|
-
},
|
|
2476
|
-
if (Y(x.beforeSanitizeAttributes, n, null), mt(n,
|
|
2475
|
+
}, no = function(n, s) {
|
|
2476
|
+
if (Y(x.beforeSanitizeAttributes, n, null), mt(n, s)) return;
|
|
2477
2477
|
const d = n.attributes;
|
|
2478
2478
|
if (!d || jt(n)) return;
|
|
2479
2479
|
C = Je(x.uponSanitizeAttribute, C, te, Rt);
|
|
2480
|
-
const
|
|
2480
|
+
const p = {
|
|
2481
2481
|
attrName: "",
|
|
2482
2482
|
attrValue: "",
|
|
2483
2483
|
keepAttr: !0,
|
|
@@ -2487,71 +2487,71 @@ function Lo() {
|
|
|
2487
2487
|
let h = d.length;
|
|
2488
2488
|
const b = _(n.nodeName);
|
|
2489
2489
|
for (; h--; ) {
|
|
2490
|
-
const y = d[h], S = y.name, j = y.namespaceURI, H = y.value, gt = _(S),
|
|
2491
|
-
let R = S === "value" ?
|
|
2492
|
-
if (
|
|
2490
|
+
const y = d[h], S = y.name, j = y.namespaceURI, H = y.value, gt = _(S), pe = H;
|
|
2491
|
+
let R = S === "value" ? pe : In(pe), io = !1;
|
|
2492
|
+
if (p.attrName = gt, p.attrValue = R, p.keepAttr = !0, p.forceKeepAttr = void 0, Y(x.uponSanitizeAttribute, n, p), R = p.attrValue, ze && (gt === "id" || gt === "name") && co(R, Be) !== 0 && (it(S, n, y), R = Be + R, io = !0), ot && I(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
|
|
2493
2493
|
it(S, n, y);
|
|
2494
2494
|
continue;
|
|
2495
2495
|
}
|
|
2496
|
-
if (gt === "attributename" &&
|
|
2496
|
+
if (gt === "attributename" && lo(R, "href")) {
|
|
2497
2497
|
it(S, n, y);
|
|
2498
2498
|
continue;
|
|
2499
2499
|
}
|
|
2500
|
-
if (!
|
|
2501
|
-
if (!
|
|
2500
|
+
if (!p.forceKeepAttr) {
|
|
2501
|
+
if (!p.keepAttr) {
|
|
2502
2502
|
it(S, n, y);
|
|
2503
2503
|
continue;
|
|
2504
2504
|
}
|
|
2505
|
-
if (!
|
|
2505
|
+
if (!Ne && I(Qn, R)) {
|
|
2506
2506
|
it(S, n, y);
|
|
2507
2507
|
continue;
|
|
2508
2508
|
}
|
|
2509
|
-
if (V && (R = Ut(R)), !
|
|
2509
|
+
if (V && (R = Ut(R)), !eo(b, gt, R)) {
|
|
2510
2510
|
it(S, n, y);
|
|
2511
2511
|
continue;
|
|
2512
2512
|
}
|
|
2513
|
-
R =
|
|
2513
|
+
R = ln(b, gt, j, R), R !== pe && cn(n, S, j, R) && io && so(t.removed);
|
|
2514
2514
|
}
|
|
2515
2515
|
}
|
|
2516
|
-
Y(x.afterSanitizeAttributes, n, null), mt(n,
|
|
2516
|
+
Y(x.afterSanitizeAttributes, n, null), mt(n, s);
|
|
2517
2517
|
}, $t = function(n) {
|
|
2518
|
-
let
|
|
2518
|
+
let s = null;
|
|
2519
2519
|
const d = Ze(n);
|
|
2520
|
-
for (Y(x.beforeSanitizeShadowDOM, n, null);
|
|
2521
|
-
if (Y(x.uponSanitizeShadowNode,
|
|
2522
|
-
const
|
|
2523
|
-
ht(
|
|
2520
|
+
for (Y(x.beforeSanitizeShadowDOM, n, null); s = d.nextNode(); )
|
|
2521
|
+
if (Y(x.uponSanitizeShadowNode, s, null), to(s, n), no(s, n), ht(s.content) && $t(s.content), wt(s) === F.element) {
|
|
2522
|
+
const p = at(s);
|
|
2523
|
+
ht(p) && (fe(p), $t(p));
|
|
2524
2524
|
}
|
|
2525
2525
|
Y(x.afterSanitizeShadowDOM, n, null);
|
|
2526
|
-
},
|
|
2527
|
-
const
|
|
2526
|
+
}, fe = function(n) {
|
|
2527
|
+
const s = [{
|
|
2528
2528
|
node: n,
|
|
2529
2529
|
shadow: null
|
|
2530
2530
|
}];
|
|
2531
|
-
for (;
|
|
2532
|
-
const d =
|
|
2531
|
+
for (; s.length > 0; ) {
|
|
2532
|
+
const d = s.pop();
|
|
2533
2533
|
if (d.shadow) {
|
|
2534
2534
|
$t(d.shadow);
|
|
2535
2535
|
continue;
|
|
2536
2536
|
}
|
|
2537
|
-
const
|
|
2538
|
-
if (b) for (let y = b.length - 1; y >= 0; --y)
|
|
2537
|
+
const p = d.node, h = wt(p) === F.element, b = $(p);
|
|
2538
|
+
if (b) for (let y = b.length - 1; y >= 0; --y) s.push({
|
|
2539
2539
|
node: b[y],
|
|
2540
2540
|
shadow: null
|
|
2541
2541
|
});
|
|
2542
2542
|
if (h) {
|
|
2543
|
-
const y = st ? st(
|
|
2543
|
+
const y = st ? st(p) : null;
|
|
2544
2544
|
if (typeof y == "string" && _(y) === "template") {
|
|
2545
|
-
const S =
|
|
2546
|
-
ht(S) &&
|
|
2545
|
+
const S = p.content;
|
|
2546
|
+
ht(S) && s.push({
|
|
2547
2547
|
node: S,
|
|
2548
2548
|
shadow: null
|
|
2549
2549
|
});
|
|
2550
2550
|
}
|
|
2551
2551
|
}
|
|
2552
2552
|
if (h) {
|
|
2553
|
-
const y = at(
|
|
2554
|
-
ht(y) &&
|
|
2553
|
+
const y = at(p);
|
|
2554
|
+
ht(y) && s.push({
|
|
2555
2555
|
node: null,
|
|
2556
2556
|
shadow: y
|
|
2557
2557
|
}, {
|
|
@@ -2562,39 +2562,39 @@ function Lo() {
|
|
|
2562
2562
|
}
|
|
2563
2563
|
};
|
|
2564
2564
|
return t.sanitize = function(u) {
|
|
2565
|
-
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {},
|
|
2566
|
-
if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !
|
|
2567
|
-
throw
|
|
2565
|
+
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, p = null, h = null;
|
|
2566
|
+
if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !At(u) && (u = zn(u), typeof u != "string"))
|
|
2567
|
+
throw Q("dirty is not a string, aborting");
|
|
2568
2568
|
if (!t.isSupported) return u;
|
|
2569
|
-
oe ? (A =
|
|
2570
|
-
const b = re && typeof u != "string" &&
|
|
2569
|
+
oe ? (A = Ot, C = Rt) : de(n), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (A = U(A)), x.uponSanitizeAttribute.length > 0 && (C = U(C)), t.removed = [];
|
|
2570
|
+
const b = re && typeof u != "string" && At(u);
|
|
2571
2571
|
if (b) {
|
|
2572
|
-
|
|
2572
|
+
nn(u);
|
|
2573
2573
|
const j = Xt(u);
|
|
2574
2574
|
if (typeof j == "string") {
|
|
2575
2575
|
const H = _(j);
|
|
2576
|
-
if (!A[H] ||
|
|
2577
|
-
throw Ht(u),
|
|
2576
|
+
if (!A[H] || kt[H])
|
|
2577
|
+
throw Ht(u), Q("root node is forbidden and cannot be sanitized in-place");
|
|
2578
2578
|
}
|
|
2579
2579
|
if (jt(u))
|
|
2580
|
-
throw Ht(u),
|
|
2580
|
+
throw Ht(u), Q("root node is clobbered and cannot be sanitized in-place");
|
|
2581
2581
|
try {
|
|
2582
|
-
|
|
2582
|
+
fe(u);
|
|
2583
2583
|
} catch (H) {
|
|
2584
2584
|
throw Ht(u), H;
|
|
2585
2585
|
}
|
|
2586
|
-
} else if (
|
|
2587
|
-
|
|
2586
|
+
} else if (At(u))
|
|
2587
|
+
s = Qe("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType === F.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? s = d : s.appendChild(d), fe(s);
|
|
2588
2588
|
else {
|
|
2589
2589
|
if (!ct && !V && !nt && u.indexOf("<") === -1) return N && Pt ? lt(u) : u;
|
|
2590
|
-
if (
|
|
2590
|
+
if (s = Qe(u), !s) return ct ? null : Pt ? et : "";
|
|
2591
2591
|
}
|
|
2592
|
-
|
|
2593
|
-
const y = b ? u :
|
|
2592
|
+
s && ne && X(s.firstChild);
|
|
2593
|
+
const y = b ? u : s;
|
|
2594
2594
|
try {
|
|
2595
2595
|
const j = Ze(y);
|
|
2596
|
-
for (;
|
|
2597
|
-
|
|
2596
|
+
for (; p = j.nextNode(); )
|
|
2597
|
+
to(p, y), no(p, y), ht(p.content) && $t(p.content);
|
|
2598
2598
|
} catch (j) {
|
|
2599
2599
|
throw b && (Ht(u), rt(t.removed, (H) => {
|
|
2600
2600
|
H.element && Ft(H.element);
|
|
@@ -2604,36 +2604,36 @@ function Lo() {
|
|
|
2604
2604
|
let j = !1;
|
|
2605
2605
|
if (rt(t.removed, (H) => {
|
|
2606
2606
|
H.element && (H.element === u && (j = !0), Ft(H.element));
|
|
2607
|
-
}), j) throw
|
|
2607
|
+
}), j) throw Q("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
2608
2608
|
return V && ue(u), u;
|
|
2609
2609
|
}
|
|
2610
2610
|
if (ct) {
|
|
2611
|
-
if (V && ue(
|
|
2612
|
-
for (h =
|
|
2613
|
-
else h =
|
|
2614
|
-
return (C.shadowroot || C.shadowrootmode) && (h =
|
|
2611
|
+
if (V && ue(s), Nt)
|
|
2612
|
+
for (h = zo.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
|
|
2613
|
+
else h = s;
|
|
2614
|
+
return (C.shadowroot || C.shadowrootmode) && (h = Ho.call(o, h, !0)), h;
|
|
2615
2615
|
}
|
|
2616
|
-
let S = nt ?
|
|
2617
|
-
return nt && A["!doctype"] &&
|
|
2616
|
+
let S = nt ? s.outerHTML : s.innerHTML;
|
|
2617
|
+
return nt && A["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && I(qn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
|
|
2618
2618
|
` + S), V && (S = Ut(S)), N && Pt ? lt(S) : S;
|
|
2619
2619
|
}, t.setConfig = function() {
|
|
2620
2620
|
let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2621
|
-
de(u), oe = !0,
|
|
2621
|
+
de(u), oe = !0, Ot = A, Rt = C;
|
|
2622
2622
|
}, t.clearConfig = function() {
|
|
2623
|
-
|
|
2624
|
-
}, t.isValidAttribute = function(u, n,
|
|
2625
|
-
|
|
2626
|
-
const d = _(u),
|
|
2627
|
-
return
|
|
2623
|
+
pt = null, oe = !1, Ot = null, Rt = null, N = Qt, et = "";
|
|
2624
|
+
}, t.isValidAttribute = function(u, n, s) {
|
|
2625
|
+
pt || de({});
|
|
2626
|
+
const d = _(u), p = _(n);
|
|
2627
|
+
return eo(d, p, s);
|
|
2628
2628
|
}, t.addHook = function(u, n) {
|
|
2629
|
-
typeof n == "function" && P(x, u) &&
|
|
2629
|
+
typeof n == "function" && P(x, u) && Ct(x[u], n);
|
|
2630
2630
|
}, t.removeHook = function(u, n) {
|
|
2631
2631
|
if (P(x, u)) {
|
|
2632
2632
|
if (n !== void 0) {
|
|
2633
|
-
const
|
|
2634
|
-
return
|
|
2633
|
+
const s = Mn(x[u], n);
|
|
2634
|
+
return s === -1 ? void 0 : Dn(x[u], s, 1)[0];
|
|
2635
2635
|
}
|
|
2636
|
-
return
|
|
2636
|
+
return so(x[u]);
|
|
2637
2637
|
}
|
|
2638
2638
|
}, t.removeHooks = function(u) {
|
|
2639
2639
|
P(x, u) && (x[u] = []);
|
|
@@ -2641,8 +2641,8 @@ function Lo() {
|
|
|
2641
2641
|
x = vo();
|
|
2642
2642
|
}, t;
|
|
2643
2643
|
}
|
|
2644
|
-
var Kt =
|
|
2645
|
-
const
|
|
2644
|
+
var Kt = Do();
|
|
2645
|
+
const oi = [
|
|
2646
2646
|
"p",
|
|
2647
2647
|
"br",
|
|
2648
2648
|
"strong",
|
|
@@ -2691,7 +2691,7 @@ const ti = [
|
|
|
2691
2691
|
// user-initiated dialog, a different trust boundary that never calls
|
|
2692
2692
|
// through this sanitizer. A consumer that genuinely wants iframes in
|
|
2693
2693
|
// pasted/typed content can still opt in via a custom allowedTags list.
|
|
2694
|
-
],
|
|
2694
|
+
], ni = {
|
|
2695
2695
|
"*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
|
|
2696
2696
|
a: ["href", "target", "rel", "title"],
|
|
2697
2697
|
img: ["src", "alt", "width", "height", "loading"],
|
|
@@ -2708,60 +2708,60 @@ const ti = [
|
|
|
2708
2708
|
// additionalAllowedTags), restoring the attributes that make an inserted
|
|
2709
2709
|
// iframe actually usable (src, sizing, fullscreen, scrolling/border).
|
|
2710
2710
|
iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
|
|
2711
|
-
},
|
|
2712
|
-
function
|
|
2713
|
-
if (!
|
|
2711
|
+
}, ii = "data-editora-embed";
|
|
2712
|
+
function ri(a) {
|
|
2713
|
+
if (!a || /\s/.test(a.trim())) return !1;
|
|
2714
2714
|
try {
|
|
2715
|
-
const t = new URL(
|
|
2715
|
+
const t = new URL(a.trim());
|
|
2716
2716
|
return (t.protocol === "https:" || t.protocol === "http:") && t.hostname.length > 0;
|
|
2717
2717
|
} catch (t) {
|
|
2718
2718
|
return !1;
|
|
2719
2719
|
}
|
|
2720
2720
|
}
|
|
2721
|
-
function
|
|
2721
|
+
function Io(a, t, e, o) {
|
|
2722
2722
|
if ((t == null ? void 0 : t.sanitize) === !1)
|
|
2723
|
-
return
|
|
2724
|
-
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags :
|
|
2723
|
+
return a;
|
|
2724
|
+
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : oi, r = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...i, ...e])) : i, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : ni, f = /* @__PURE__ */ new Set();
|
|
2725
2725
|
for (const w of Object.values(c))
|
|
2726
|
-
for (const T of w)
|
|
2726
|
+
for (const T of w) f.add(T);
|
|
2727
2727
|
const m = {
|
|
2728
2728
|
ALLOWED_TAGS: r,
|
|
2729
|
-
ALLOWED_ATTR: Array.from(
|
|
2729
|
+
ALLOWED_ATTR: Array.from(f)
|
|
2730
2730
|
};
|
|
2731
2731
|
if (!o)
|
|
2732
|
-
return Kt.sanitize(
|
|
2732
|
+
return Kt.sanitize(a, m);
|
|
2733
2733
|
const g = r.includes("iframe");
|
|
2734
2734
|
Kt.addHook(
|
|
2735
2735
|
"uponSanitizeElement",
|
|
2736
2736
|
(w, T) => {
|
|
2737
2737
|
var k;
|
|
2738
2738
|
if (T.tagName !== "iframe") return;
|
|
2739
|
-
const
|
|
2740
|
-
T.allowedTags.iframe = g || ((k =
|
|
2739
|
+
const v = w;
|
|
2740
|
+
T.allowedTags.iframe = g || ((k = v.getAttribute) == null ? void 0 : k.call(v, ii)) === "true" && ri(v.getAttribute("src"));
|
|
2741
2741
|
}
|
|
2742
2742
|
);
|
|
2743
2743
|
try {
|
|
2744
|
-
return Kt.sanitize(
|
|
2744
|
+
return Kt.sanitize(a, m);
|
|
2745
2745
|
} finally {
|
|
2746
2746
|
Kt.removeHook("uponSanitizeElement");
|
|
2747
2747
|
}
|
|
2748
2748
|
}
|
|
2749
|
-
function
|
|
2750
|
-
return
|
|
2749
|
+
function ai(a, t, e, o) {
|
|
2750
|
+
return Io(a, t, o, !1);
|
|
2751
2751
|
}
|
|
2752
|
-
function
|
|
2753
|
-
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ?
|
|
2752
|
+
function si(a, t, e) {
|
|
2753
|
+
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : ai(a, t);
|
|
2754
2754
|
}
|
|
2755
|
-
function
|
|
2756
|
-
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ?
|
|
2755
|
+
function wo(a, t, e, o) {
|
|
2756
|
+
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : Io(a, t, o, !0);
|
|
2757
2757
|
}
|
|
2758
|
-
const
|
|
2759
|
-
function
|
|
2760
|
-
if (!
|
|
2758
|
+
const li = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", ci = /resize-handle|data-rte-media-pending|rte-media/;
|
|
2759
|
+
function Oo(a) {
|
|
2760
|
+
if (!a || !ci.test(a)) return a;
|
|
2761
2761
|
const t = document.createElement("template");
|
|
2762
|
-
t.innerHTML =
|
|
2762
|
+
t.innerHTML = a;
|
|
2763
2763
|
const e = /* @__PURE__ */ new Set();
|
|
2764
|
-
return t.content.querySelectorAll(
|
|
2764
|
+
return t.content.querySelectorAll(li).forEach((o) => {
|
|
2765
2765
|
const i = o.parentElement;
|
|
2766
2766
|
i && (i.tagName === "TD" || i.tagName === "TH") && e.add(i), o.remove();
|
|
2767
2767
|
}), e.forEach((o) => {
|
|
@@ -2774,8 +2774,8 @@ function Io(s) {
|
|
|
2774
2774
|
i && (i.removeAttribute("contenteditable"), !((r = i.textContent) != null && r.trim()) && !i.querySelector("img, video, a") && i.remove());
|
|
2775
2775
|
}), t.innerHTML;
|
|
2776
2776
|
}
|
|
2777
|
-
function
|
|
2778
|
-
return
|
|
2777
|
+
function bt(a) {
|
|
2778
|
+
return a ? Oo(a.innerHTML) : "";
|
|
2779
2779
|
}
|
|
2780
2780
|
const Vt = class Vt {
|
|
2781
2781
|
/**
|
|
@@ -2974,7 +2974,7 @@ Vt.EDITOR_DEFAULTS = {
|
|
|
2974
2974
|
width: "100%",
|
|
2975
2975
|
readonly: !1,
|
|
2976
2976
|
disabled: !1,
|
|
2977
|
-
menubar: !
|
|
2977
|
+
menubar: !1,
|
|
2978
2978
|
toolbar: !0,
|
|
2979
2979
|
plugins: [],
|
|
2980
2980
|
theme: "light",
|
|
@@ -3038,8 +3038,8 @@ Vt.EDITOR_DEFAULTS = {
|
|
|
3038
3038
|
"security-sanitize-on-paste",
|
|
3039
3039
|
"security-sanitize-on-input"
|
|
3040
3040
|
]);
|
|
3041
|
-
let
|
|
3042
|
-
class
|
|
3041
|
+
let Ae = Vt;
|
|
3042
|
+
class di {
|
|
3043
3043
|
constructor() {
|
|
3044
3044
|
this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
|
|
3045
3045
|
}
|
|
@@ -3050,16 +3050,30 @@ class li {
|
|
|
3050
3050
|
this.pluginRegistry.set(t, e);
|
|
3051
3051
|
}
|
|
3052
3052
|
/**
|
|
3053
|
-
* Load a plugin by name (async)
|
|
3053
|
+
* Load a plugin by name (async). The instance is cached by name: every later call gets the same
|
|
3054
|
+
* one, configured by the first call. For one instance per editor, use create().
|
|
3054
3055
|
*/
|
|
3055
3056
|
async load(t, e) {
|
|
3056
3057
|
if (this.loadedPlugins.has(t))
|
|
3057
3058
|
return this.loadedPlugins.get(t);
|
|
3059
|
+
const o = await this.create(t, e);
|
|
3060
|
+
return o && this.loadedPlugins.set(t, o), o;
|
|
3061
|
+
}
|
|
3062
|
+
/**
|
|
3063
|
+
* Create a new instance of a registered plugin, configured with `config`, without caching it.
|
|
3064
|
+
*/
|
|
3065
|
+
async create(t, e) {
|
|
3058
3066
|
const o = this.pluginRegistry.get(t);
|
|
3059
3067
|
if (!o)
|
|
3060
3068
|
return console.warn(`Plugin not found: ${t}`), null;
|
|
3061
3069
|
const i = await o();
|
|
3062
|
-
return e && this.applyPluginConfig(i, e),
|
|
3070
|
+
return e && this.applyPluginConfig(i, e), i;
|
|
3071
|
+
}
|
|
3072
|
+
/**
|
|
3073
|
+
* Attach configuration to a plugin instance (read at runtime as `__pluginConfig`).
|
|
3074
|
+
*/
|
|
3075
|
+
configure(t, e) {
|
|
3076
|
+
this.applyPluginConfig(t, e);
|
|
3063
3077
|
}
|
|
3064
3078
|
/**
|
|
3065
3079
|
* Load multiple plugins
|
|
@@ -3113,39 +3127,45 @@ class li {
|
|
|
3113
3127
|
return this.loadedPlugins.has(t);
|
|
3114
3128
|
}
|
|
3115
3129
|
}
|
|
3116
|
-
const ci = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
|
|
3130
|
+
const To = /* @__PURE__ */ new Set();
|
|
3131
|
+
function ui(a, t) {
|
|
3132
|
+
To.has(a) || (To.add(a), console.warn(
|
|
3133
|
+
`[Editora] The "${a}" option has no effect: ${t} It is still accepted so existing code keeps working, and will be removed in a future major release.`
|
|
3134
|
+
));
|
|
3135
|
+
}
|
|
3136
|
+
const fi = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor.editora-disabled{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
|
|
3117
3137
|
let Yt;
|
|
3118
|
-
const
|
|
3119
|
-
let
|
|
3120
|
-
function
|
|
3121
|
-
if (!(
|
|
3122
|
-
const t =
|
|
3138
|
+
const pi = "__editoraCommandEditorRoot", hi = "__editoraLastCommandButton", ko = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", xo = ".rte-content, .editora-content", mi = "Rich text editor", gi = /* @__PURE__ */ new Set(["collaboration"]), ve = "data-editora-disabled-by-host", Ce = /* @__PURE__ */ new Set();
|
|
3139
|
+
let J = null, Ao = !1, we = null, Te = null;
|
|
3140
|
+
function Co(a) {
|
|
3141
|
+
if (!(a instanceof HTMLElement)) return !1;
|
|
3142
|
+
const t = a;
|
|
3123
3143
|
return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
|
|
3124
3144
|
}
|
|
3125
|
-
function
|
|
3126
|
-
return
|
|
3145
|
+
function bi(a) {
|
|
3146
|
+
return a ? a.nodeType === Node.ELEMENT_NODE ? a : a.parentElement : null;
|
|
3127
3147
|
}
|
|
3128
|
-
function Lt(
|
|
3129
|
-
if (!
|
|
3130
|
-
if (
|
|
3131
|
-
return
|
|
3132
|
-
const t =
|
|
3133
|
-
return !t || !
|
|
3148
|
+
function Lt(a) {
|
|
3149
|
+
if (!a) return null;
|
|
3150
|
+
if (Co(a))
|
|
3151
|
+
return a;
|
|
3152
|
+
const t = a.matches(ko) ? a : a.closest(ko);
|
|
3153
|
+
return !t || !Co(t) ? null : t;
|
|
3134
3154
|
}
|
|
3135
|
-
function
|
|
3155
|
+
function yi() {
|
|
3136
3156
|
var i;
|
|
3137
3157
|
if (typeof window == "undefined") return null;
|
|
3138
|
-
const
|
|
3139
|
-
if (
|
|
3140
|
-
const r = Lt(
|
|
3158
|
+
const a = window[pi];
|
|
3159
|
+
if (a instanceof HTMLElement) {
|
|
3160
|
+
const r = Lt(a);
|
|
3141
3161
|
if (r) return r;
|
|
3142
|
-
const l =
|
|
3162
|
+
const l = a.matches(xo) ? a : a.querySelector(xo);
|
|
3143
3163
|
if (l) {
|
|
3144
3164
|
const c = Lt(l);
|
|
3145
3165
|
if (c) return c;
|
|
3146
3166
|
}
|
|
3147
3167
|
}
|
|
3148
|
-
const t = window[
|
|
3168
|
+
const t = window[hi];
|
|
3149
3169
|
if (t instanceof HTMLElement) {
|
|
3150
3170
|
const r = Lt(t);
|
|
3151
3171
|
if (r) return r;
|
|
@@ -3157,49 +3177,49 @@ function mi() {
|
|
|
3157
3177
|
}
|
|
3158
3178
|
const o = (i = window.getSelection) == null ? void 0 : i.call(window);
|
|
3159
3179
|
if (o && o.rangeCount > 0) {
|
|
3160
|
-
const r = Lt(
|
|
3180
|
+
const r = Lt(bi(o.getRangeAt(0).startContainer));
|
|
3161
3181
|
if (r) return r;
|
|
3162
3182
|
}
|
|
3163
|
-
if (
|
|
3164
|
-
return
|
|
3165
|
-
for (const r of
|
|
3183
|
+
if (J && J.isConnected)
|
|
3184
|
+
return J;
|
|
3185
|
+
for (const r of Ce)
|
|
3166
3186
|
if (r.isConnected) return r;
|
|
3167
3187
|
return null;
|
|
3168
3188
|
}
|
|
3169
|
-
function
|
|
3170
|
-
if (typeof window == "undefined" ||
|
|
3171
|
-
|
|
3172
|
-
const
|
|
3173
|
-
const o =
|
|
3174
|
-
return o ? o.execCommand(t, ...e) :
|
|
3189
|
+
function Ei() {
|
|
3190
|
+
if (typeof window == "undefined" || Ao) return;
|
|
3191
|
+
we = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, Te = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
|
|
3192
|
+
const a = (t, ...e) => {
|
|
3193
|
+
const o = yi();
|
|
3194
|
+
return o ? o.execCommand(t, ...e) : we ? we(t, ...e) : Te ? Te(t, ...e) : !1;
|
|
3175
3195
|
};
|
|
3176
|
-
window.executeEditorCommand =
|
|
3196
|
+
window.executeEditorCommand = a, window.execEditorCommand = a, Ao = !0;
|
|
3177
3197
|
}
|
|
3178
|
-
function
|
|
3179
|
-
const
|
|
3180
|
-
if (!document.getElementById(
|
|
3198
|
+
function vi() {
|
|
3199
|
+
const a = "editora-webcomponent-styles";
|
|
3200
|
+
if (!document.getElementById(a)) {
|
|
3181
3201
|
const t = document.createElement("style");
|
|
3182
|
-
t.id =
|
|
3202
|
+
t.id = a, t.textContent = fi, document.head.appendChild(t);
|
|
3183
3203
|
}
|
|
3184
3204
|
}
|
|
3185
|
-
function
|
|
3205
|
+
function Ro() {
|
|
3186
3206
|
if (!Yt) {
|
|
3187
|
-
const
|
|
3188
|
-
|
|
3207
|
+
const a = Et.__globalPluginLoader;
|
|
3208
|
+
a ? Yt = a : Yt = new di();
|
|
3189
3209
|
}
|
|
3190
3210
|
return Yt;
|
|
3191
3211
|
}
|
|
3192
|
-
function
|
|
3193
|
-
const t =
|
|
3194
|
-
Object.entries(
|
|
3212
|
+
function ki(a) {
|
|
3213
|
+
const t = Ro();
|
|
3214
|
+
Object.entries(a).forEach(([e, o]) => {
|
|
3195
3215
|
t.register(e, o);
|
|
3196
3216
|
});
|
|
3197
3217
|
}
|
|
3198
|
-
const
|
|
3218
|
+
const wi = typeof HTMLElement == "undefined" ? class {
|
|
3199
3219
|
} : HTMLElement;
|
|
3200
|
-
class
|
|
3220
|
+
class Et extends wi {
|
|
3201
3221
|
constructor() {
|
|
3202
|
-
if (super(), this.pluginLoader =
|
|
3222
|
+
if (super(), this.pluginLoader = Ro(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new un(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.pluginInstances = /* @__PURE__ */ new Map(), this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, this.hasConnected = !1, this.reinitializeQueued = !1, this.lastReportedContent = null, vi(), !this.hasAttribute("data-initial-content")) {
|
|
3203
3223
|
const t = this.innerHTML.trim();
|
|
3204
3224
|
t && this.setAttribute("data-initial-content", t);
|
|
3205
3225
|
}
|
|
@@ -3256,7 +3276,7 @@ class yt extends yi {
|
|
|
3256
3276
|
* Called when element is added to DOM
|
|
3257
3277
|
*/
|
|
3258
3278
|
connectedCallback() {
|
|
3259
|
-
this.config = this.resolveConfig(), this.waitForPluginLoader().then(() => {
|
|
3279
|
+
this.hasConnected = !0, this.config = this.resolveConfig(), this.waitForPluginLoader().then(() => {
|
|
3260
3280
|
setTimeout(async () => {
|
|
3261
3281
|
await this.initialize();
|
|
3262
3282
|
}, 0);
|
|
@@ -3266,13 +3286,13 @@ class yt extends yi {
|
|
|
3266
3286
|
* Wait for the global plugin loader to be available
|
|
3267
3287
|
*/
|
|
3268
3288
|
async waitForPluginLoader() {
|
|
3269
|
-
if (
|
|
3270
|
-
this.pluginLoader =
|
|
3289
|
+
if (Et.__globalPluginLoader) {
|
|
3290
|
+
this.pluginLoader = Et.__globalPluginLoader;
|
|
3271
3291
|
return;
|
|
3272
3292
|
}
|
|
3273
3293
|
return new Promise((t) => {
|
|
3274
3294
|
const e = () => {
|
|
3275
|
-
|
|
3295
|
+
Et.__globalPluginLoader ? (this.pluginLoader = Et.__globalPluginLoader, t()) : setTimeout(e, 0);
|
|
3276
3296
|
};
|
|
3277
3297
|
e();
|
|
3278
3298
|
});
|
|
@@ -3293,7 +3313,22 @@ class yt extends yi {
|
|
|
3293
3313
|
* Set configuration via JavaScript API
|
|
3294
3314
|
*/
|
|
3295
3315
|
async setConfig(t) {
|
|
3296
|
-
this.jsConfig = t, this.config = this.resolveConfig(), this.isConnected
|
|
3316
|
+
this.jsConfig = t, this.config = this.resolveConfig(), this.isConnected ? (this.destroy(), this.adoptConfiguredContent(t), await this.waitForPluginLoader(), await this.initialize()) : this.adoptConfiguredContent(t);
|
|
3317
|
+
}
|
|
3318
|
+
/**
|
|
3319
|
+
* `content` in setConfig() is a one-off replacement, not a setting: it feeds the next initialize()
|
|
3320
|
+
* the same way the live content that destroy() keeps does, so a later rebuild (a `plugins`
|
|
3321
|
+
* attribute change, the element being moved) resumes from what the user typed, not from this value.
|
|
3322
|
+
* It outranks that kept content, autosave and the element's own markup.
|
|
3323
|
+
*/
|
|
3324
|
+
adoptConfiguredContent(t) {
|
|
3325
|
+
typeof t.content == "string" && (this.preservedContent = t.content);
|
|
3326
|
+
}
|
|
3327
|
+
/** Replace the `editora-theme-*` class (there is only ever one) with the one for `theme`. */
|
|
3328
|
+
applyThemeClass(t) {
|
|
3329
|
+
Array.from(this.classList).forEach((e) => {
|
|
3330
|
+
e.startsWith("editora-theme-") && this.classList.remove(e);
|
|
3331
|
+
}), t && this.classList.add(`editora-theme-${t}`);
|
|
3297
3332
|
}
|
|
3298
3333
|
/**
|
|
3299
3334
|
* Initialize the editor
|
|
@@ -3302,7 +3337,7 @@ class yt extends yi {
|
|
|
3302
3337
|
var r;
|
|
3303
3338
|
if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
|
|
3304
3339
|
const t = ++this.buildGeneration;
|
|
3305
|
-
this.setAttribute("data-editora-editor", "true"),
|
|
3340
|
+
this.setAttribute("data-editora-editor", "true"), Ce.add(this), J || (J = this), Ei(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.classList.toggle("editora-disabled", this.isEditorDisabled()), this.applyThemeClass(this.config.theme), this.isMenubarRequested() && ui("menubar", "<editora-editor> does not render a menu bar."), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
|
|
3306
3341
|
const e = await this.loadPlugins();
|
|
3307
3342
|
if (t !== this.buildGeneration || !this.isConnected) return;
|
|
3308
3343
|
if (this.loadedPlugins = e, e.forEach((l) => {
|
|
@@ -3321,10 +3356,10 @@ class yt extends yi {
|
|
|
3321
3356
|
const i = this.sanitizeLoadedContent(
|
|
3322
3357
|
(r = o != null ? o : this.restoreAutosavedContent()) != null ? r : this.getAttribute("data-initial-content") || ""
|
|
3323
3358
|
);
|
|
3324
|
-
this.engine = new
|
|
3359
|
+
this.engine = new pn({
|
|
3325
3360
|
content: i,
|
|
3326
3361
|
plugins: e,
|
|
3327
|
-
readonly: this.config.readonly
|
|
3362
|
+
readonly: !!this.config.readonly || this.isEditorDisabled()
|
|
3328
3363
|
}), this.createUI(e, i), this.setupEventListeners(), this.startAutosave(), this.isInitialized = !0, this.removeAttribute("data-loading"), this.removeAttribute("aria-busy"), this.dispatchEvent(new CustomEvent("editor-ready", {
|
|
3329
3364
|
detail: { api: this.getAPI() },
|
|
3330
3365
|
bubbles: !0
|
|
@@ -3350,18 +3385,18 @@ class yt extends yi {
|
|
|
3350
3385
|
const r = this.config.plugins.split(/\s+/).filter(Boolean);
|
|
3351
3386
|
i && !r.includes("a11yChecker") && r.push("a11yChecker");
|
|
3352
3387
|
for (const l of r) {
|
|
3353
|
-
const c = await this.
|
|
3388
|
+
const c = await this.loadPlugin(l, this.getPluginLoadConfig(l));
|
|
3354
3389
|
c && t.push(c);
|
|
3355
3390
|
}
|
|
3356
3391
|
} else if (Array.isArray(this.config.plugins)) {
|
|
3357
3392
|
for (const r of this.config.plugins)
|
|
3358
3393
|
if (typeof r == "string") {
|
|
3359
|
-
const l = await this.
|
|
3394
|
+
const l = await this.loadPlugin(r, this.getPluginLoadConfig(r));
|
|
3360
3395
|
l && t.push(l);
|
|
3361
3396
|
} else
|
|
3362
3397
|
t.push(r);
|
|
3363
3398
|
if (i && !t.some((r) => (r == null ? void 0 : r.name) === "a11yChecker")) {
|
|
3364
|
-
const r = await this.
|
|
3399
|
+
const r = await this.loadPlugin("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
|
|
3365
3400
|
r && t.push(r);
|
|
3366
3401
|
}
|
|
3367
3402
|
}
|
|
@@ -3369,13 +3404,24 @@ class yt extends yi {
|
|
|
3369
3404
|
const r = this.pluginLoader.getRegisteredPluginNames();
|
|
3370
3405
|
for (const l of r) {
|
|
3371
3406
|
const c = this.getPluginLoadConfig(l);
|
|
3372
|
-
if (
|
|
3373
|
-
const
|
|
3374
|
-
|
|
3407
|
+
if (gi.has(l) && !c) continue;
|
|
3408
|
+
const f = await this.loadPlugin(l, c);
|
|
3409
|
+
f && t.push(f);
|
|
3375
3410
|
}
|
|
3376
3411
|
}
|
|
3377
3412
|
return t;
|
|
3378
3413
|
}
|
|
3414
|
+
/**
|
|
3415
|
+
* This editor's instance of a registered plugin: created on first use, then reused (with the
|
|
3416
|
+
* current config) when the editor rebuilds.
|
|
3417
|
+
*/
|
|
3418
|
+
async loadPlugin(t, e) {
|
|
3419
|
+
const o = this.pluginInstances.get(t);
|
|
3420
|
+
if (o)
|
|
3421
|
+
return e && this.pluginLoader.configure(o, e), o;
|
|
3422
|
+
const i = await this.pluginLoader.create(t, e);
|
|
3423
|
+
return i && this.pluginInstances.set(t, i), i;
|
|
3424
|
+
}
|
|
3379
3425
|
resolveToolbarItems() {
|
|
3380
3426
|
const t = this.config.toolbarItems;
|
|
3381
3427
|
if (typeof t == "string") return t;
|
|
@@ -3456,12 +3502,15 @@ class yt extends yi {
|
|
|
3456
3502
|
if (!this.contentElement) return;
|
|
3457
3503
|
const t = this.getAccessibilityConfig();
|
|
3458
3504
|
if (t.enableARIA) {
|
|
3459
|
-
this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute(
|
|
3505
|
+
this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute(
|
|
3506
|
+
"aria-disabled",
|
|
3507
|
+
this.config.readonly || this.isEditorDisabled() ? "true" : "false"
|
|
3508
|
+
);
|
|
3460
3509
|
const o = (e = this.getAttribute("aria-label")) == null ? void 0 : e.trim(), i = typeof this.config.placeholder == "string" ? this.config.placeholder.trim() : "";
|
|
3461
|
-
this.contentElement.setAttribute("aria-label", o || i ||
|
|
3510
|
+
this.contentElement.setAttribute("aria-label", o || i || mi);
|
|
3462
3511
|
} else
|
|
3463
3512
|
this.contentElement.removeAttribute("role"), this.contentElement.removeAttribute("aria-multiline"), this.contentElement.removeAttribute("aria-disabled"), this.contentElement.removeAttribute("aria-label");
|
|
3464
|
-
this.contentElement.tabIndex = t.keyboardNavigation ? 0 : -1;
|
|
3513
|
+
this.contentElement.tabIndex = t.keyboardNavigation && !this.isEditorDisabled() ? 0 : -1;
|
|
3465
3514
|
}
|
|
3466
3515
|
applyLanguageSettings() {
|
|
3467
3516
|
if (!this.contentElement) return;
|
|
@@ -3558,7 +3607,7 @@ class yt extends yi {
|
|
|
3558
3607
|
* editable DOM: sanitizing only after the first edit leaves the page exposed until then.
|
|
3559
3608
|
*/
|
|
3560
3609
|
sanitizeLoadedContent(t) {
|
|
3561
|
-
return
|
|
3610
|
+
return wo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
|
|
3562
3611
|
}
|
|
3563
3612
|
getAutosaveConfig() {
|
|
3564
3613
|
var e, o;
|
|
@@ -3626,7 +3675,7 @@ class yt extends yi {
|
|
|
3626
3675
|
this.stopAutosave();
|
|
3627
3676
|
const t = this.getAutosaveConfig();
|
|
3628
3677
|
!t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
|
|
3629
|
-
this.persistAutosave(
|
|
3678
|
+
this.persistAutosave(bt(this.contentElement));
|
|
3630
3679
|
}, t.intervalMs));
|
|
3631
3680
|
}
|
|
3632
3681
|
insertHTMLAtSelection(t) {
|
|
@@ -3649,7 +3698,7 @@ class yt extends yi {
|
|
|
3649
3698
|
*/
|
|
3650
3699
|
createUI(t, e) {
|
|
3651
3700
|
const o = this.querySelector('[slot="toolbar"]'), i = this.querySelector('[slot="statusbar"]');
|
|
3652
|
-
this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new
|
|
3701
|
+
this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new hn(
|
|
3653
3702
|
{
|
|
3654
3703
|
items: this.resolveToolbarItems(),
|
|
3655
3704
|
sticky: this.isToolbarStickyEnabled(),
|
|
@@ -3660,16 +3709,17 @@ class yt extends yi {
|
|
|
3660
3709
|
// Pass plugin loader to get all registered plugins
|
|
3661
3710
|
), this.toolbar.setCommandHandler((r, l) => {
|
|
3662
3711
|
var c;
|
|
3712
|
+
if (this.isEditorDisabled()) return !1;
|
|
3663
3713
|
if (this.contentElement) {
|
|
3664
3714
|
this.contentElement.focus();
|
|
3665
|
-
const
|
|
3666
|
-
if (!
|
|
3715
|
+
const f = window.getSelection();
|
|
3716
|
+
if (!f || f.rangeCount === 0 || !this.contentElement.contains(f.anchorNode)) {
|
|
3667
3717
|
const m = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
|
|
3668
|
-
g.nodeType === Node.TEXT_NODE ? m.setStart(g, ((c = g.textContent) == null ? void 0 : c.length) || 0) : g.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(g), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0),
|
|
3718
|
+
g.nodeType === Node.TEXT_NODE ? m.setStart(g, ((c = g.textContent) == null ? void 0 : c.length) || 0) : g.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(g), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0), f == null || f.removeAllRanges(), f == null || f.addRange(m);
|
|
3669
3719
|
}
|
|
3670
3720
|
}
|
|
3671
3721
|
return this.executeCommand(r, l);
|
|
3672
|
-
}), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
|
|
3722
|
+
}), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly || this.isEditorDisabled() ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
|
|
3673
3723
|
try {
|
|
3674
3724
|
document.execCommand("defaultParagraphSeparator", !1, "p");
|
|
3675
3725
|
} catch (r) {
|
|
@@ -3679,18 +3729,27 @@ class yt extends yi {
|
|
|
3679
3729
|
const r = document.createElement("div");
|
|
3680
3730
|
r.innerHTML = e.trim(), !Array.from(r.childNodes).some((c) => {
|
|
3681
3731
|
if (c.nodeType === Node.ELEMENT_NODE) {
|
|
3682
|
-
const
|
|
3683
|
-
return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(
|
|
3732
|
+
const f = c.tagName;
|
|
3733
|
+
return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(f);
|
|
3684
3734
|
}
|
|
3685
3735
|
return !1;
|
|
3686
3736
|
}) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
|
|
3687
3737
|
} else
|
|
3688
3738
|
this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
|
|
3689
|
-
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new
|
|
3739
|
+
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new mn({ enabled: !0 }), this.floatingToolbar.create(this)), i ? this.appendChild(i) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new gn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.setToolbarControlsDisabled(this.isEditorDisabled()), this.lastReportedContent = bt(this.contentElement), this.config.autofocus && !this.isEditorDisabled() && setTimeout(() => {
|
|
3690
3740
|
var r;
|
|
3691
3741
|
return (r = this.contentElement) == null ? void 0 : r.focus();
|
|
3692
3742
|
}, 0);
|
|
3693
3743
|
}
|
|
3744
|
+
/** True only when the page asked for a menu bar (the default is not a request), through setConfig() or the attribute. */
|
|
3745
|
+
isMenubarRequested() {
|
|
3746
|
+
var o;
|
|
3747
|
+
const t = (o = this.jsConfig) == null ? void 0 : o.menubar;
|
|
3748
|
+
if (t !== void 0)
|
|
3749
|
+
return t === !0 || typeof t == "object" && t !== null && t.enabled !== !1;
|
|
3750
|
+
const e = this.getAttribute("menubar");
|
|
3751
|
+
return e !== null && e !== "false";
|
|
3752
|
+
}
|
|
3694
3753
|
/**
|
|
3695
3754
|
* Hands what a keystroke changed to the history plugin, so Undo takes back typing. Without this the
|
|
3696
3755
|
* plugin only knew about changes that plugins reported themselves, and typed text could not be undone.
|
|
@@ -3705,6 +3764,30 @@ class yt extends yi {
|
|
|
3705
3764
|
selectionCollapsed: e.selectionCollapsed
|
|
3706
3765
|
});
|
|
3707
3766
|
}
|
|
3767
|
+
/**
|
|
3768
|
+
* `disabled` is `readonly` plus a toolbar that cannot be pressed and a surface that leaves the tab
|
|
3769
|
+
* order, like a disabled form control.
|
|
3770
|
+
*/
|
|
3771
|
+
isEditorDisabled() {
|
|
3772
|
+
return this.config.disabled === !0;
|
|
3773
|
+
}
|
|
3774
|
+
applyDisabledState() {
|
|
3775
|
+
var e, o;
|
|
3776
|
+
const t = this.isEditorDisabled();
|
|
3777
|
+
this.classList.toggle("editora-disabled", t), t && ((e = this.floatingToolbar) == null || e.hide()), this.contentElement && (this.contentElement.contentEditable = t || this.config.readonly ? "false" : "true", this.applyAccessibilitySettings()), (o = this.engine) == null || o.setReadonly(t || !!this.config.readonly), this.setToolbarControlsDisabled(t);
|
|
3778
|
+
}
|
|
3779
|
+
/**
|
|
3780
|
+
* Disable (or give back) every control the default toolbar rendered. Controls that were already
|
|
3781
|
+
* disabled for another reason are marked untouched, so enabling the editor does not wake them up.
|
|
3782
|
+
*/
|
|
3783
|
+
setToolbarControlsDisabled(t) {
|
|
3784
|
+
if (!this.toolbarElement) return;
|
|
3785
|
+
this.toolbarElement.querySelectorAll(
|
|
3786
|
+
"button, input, select, textarea"
|
|
3787
|
+
).forEach((o) => {
|
|
3788
|
+
t ? o.disabled || (o.disabled = !0, o.setAttribute(ve, "")) : o.hasAttribute(ve) && (o.disabled = !1, o.removeAttribute(ve));
|
|
3789
|
+
});
|
|
3790
|
+
}
|
|
3708
3791
|
/**
|
|
3709
3792
|
* Setup event listeners
|
|
3710
3793
|
*/
|
|
@@ -3723,25 +3806,22 @@ class yt extends yi {
|
|
|
3723
3806
|
var T;
|
|
3724
3807
|
if (!this.contentElement) return;
|
|
3725
3808
|
let i = this.contentElement.innerHTML;
|
|
3726
|
-
const r = (T = o == null ? void 0 : o.detail) == null ? void 0 : T.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(),
|
|
3727
|
-
if (this.lastBeforeInputType = null,
|
|
3728
|
-
const
|
|
3729
|
-
if (
|
|
3809
|
+
const r = (T = o == null ? void 0 : o.detail) == null ? void 0 : T.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = this.lastBeforeInputType;
|
|
3810
|
+
if (this.lastBeforeInputType = null, f.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
|
|
3811
|
+
const v = wo(i, c, f, r);
|
|
3812
|
+
if (v !== i) {
|
|
3730
3813
|
const k = window.getSelection(), tt = k && k.rangeCount > 0 ? k.getRangeAt(0) : null;
|
|
3731
|
-
if (this.contentElement.innerHTML =
|
|
3814
|
+
if (this.contentElement.innerHTML = v, tt && k)
|
|
3732
3815
|
try {
|
|
3733
3816
|
k.removeAllRanges(), k.addRange(tt);
|
|
3734
3817
|
} catch ($) {
|
|
3735
3818
|
}
|
|
3736
|
-
i =
|
|
3819
|
+
i = v;
|
|
3737
3820
|
}
|
|
3738
3821
|
}
|
|
3739
3822
|
this.recordInputHistory(i), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
|
|
3740
3823
|
const w = () => {
|
|
3741
|
-
this.
|
|
3742
|
-
detail: { html: Io(i) },
|
|
3743
|
-
bubbles: !0
|
|
3744
|
-
}));
|
|
3824
|
+
this.emitContentChange(Oo(i));
|
|
3745
3825
|
};
|
|
3746
3826
|
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(w, l.debounceInputMs) : w(), this.updateStatusBar();
|
|
3747
3827
|
}), this.contentElement.addEventListener("contextmenu", (o) => {
|
|
@@ -3754,7 +3834,7 @@ class yt extends yi {
|
|
|
3754
3834
|
o.preventDefault();
|
|
3755
3835
|
const i = this.config.paste || {};
|
|
3756
3836
|
let r = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
|
|
3757
|
-
const l = ((w = o.clipboardData) == null ? void 0 : w.getData("text/plain")) || "", c = this.getContentSanitizeConfig(),
|
|
3837
|
+
const l = ((w = o.clipboardData) == null ? void 0 : w.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
|
|
3758
3838
|
if ((i.clean || !i.keepFormatting) && l) {
|
|
3759
3839
|
document.execCommand("insertText", !1, l);
|
|
3760
3840
|
return;
|
|
@@ -3764,19 +3844,20 @@ class yt extends yi {
|
|
|
3764
3844
|
return;
|
|
3765
3845
|
}
|
|
3766
3846
|
if (r) {
|
|
3767
|
-
|
|
3847
|
+
f.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = si(r, c, f)), this.insertHTMLAtSelection(r);
|
|
3768
3848
|
return;
|
|
3769
3849
|
}
|
|
3770
3850
|
l && document.execCommand("insertText", !1, l);
|
|
3771
3851
|
}), this.contentElement.addEventListener("focus", () => {
|
|
3772
|
-
|
|
3852
|
+
J = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
|
|
3773
3853
|
}), this.contentElement.addEventListener("blur", () => {
|
|
3774
|
-
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
}
|
|
3854
|
+
if (this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement) {
|
|
3855
|
+
const o = bt(this.contentElement);
|
|
3856
|
+
o !== this.lastReportedContent && this.emitContentChange(o);
|
|
3857
|
+
}
|
|
3858
|
+
this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
|
|
3778
3859
|
}), this.contentElement.addEventListener("keydown", (o) => {
|
|
3779
|
-
this.getAccessibilityConfig().keyboardNavigation
|
|
3860
|
+
!this.getAccessibilityConfig().keyboardNavigation || this.isEditorDisabled() || t.handleKeyDown(o, (r, l) => {
|
|
3780
3861
|
this.executeCommand(r, l);
|
|
3781
3862
|
});
|
|
3782
3863
|
});
|
|
@@ -3786,6 +3867,12 @@ class yt extends yi {
|
|
|
3786
3867
|
};
|
|
3787
3868
|
this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
|
|
3788
3869
|
}
|
|
3870
|
+
emitContentChange(t) {
|
|
3871
|
+
this.lastReportedContent = t, this.dispatchEvent(new CustomEvent("content-change", {
|
|
3872
|
+
detail: { html: t },
|
|
3873
|
+
bubbles: !0
|
|
3874
|
+
}));
|
|
3875
|
+
}
|
|
3789
3876
|
getSelectionRangeInEditor() {
|
|
3790
3877
|
if (!this.contentElement) return null;
|
|
3791
3878
|
const t = window.getSelection();
|
|
@@ -3853,15 +3940,15 @@ class yt extends yi {
|
|
|
3853
3940
|
const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
|
|
3854
3941
|
if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
|
|
3855
3942
|
return;
|
|
3856
|
-
const o = this.contentElement.textContent || "", { words: i, chars: r } =
|
|
3857
|
-
let c,
|
|
3943
|
+
const o = this.contentElement.textContent || "", { words: i, chars: r } = vn(o), l = En(this.contentElement);
|
|
3944
|
+
let c, f;
|
|
3858
3945
|
const m = this.getSelectionRangeInEditor();
|
|
3859
|
-
m && (c =
|
|
3946
|
+
m && (c = bn(this.contentElement, m), m.collapsed || (f = wn(m, c), c = void 0)), this.statusBar.update({
|
|
3860
3947
|
wordCount: i,
|
|
3861
3948
|
charCount: r,
|
|
3862
3949
|
lineCount: l,
|
|
3863
3950
|
cursorPosition: c,
|
|
3864
|
-
selectionInfo:
|
|
3951
|
+
selectionInfo: f
|
|
3865
3952
|
});
|
|
3866
3953
|
}
|
|
3867
3954
|
/**
|
|
@@ -3877,12 +3964,13 @@ class yt extends yi {
|
|
|
3877
3964
|
handleAttributeChange(t, e) {
|
|
3878
3965
|
switch (t) {
|
|
3879
3966
|
case "readonly":
|
|
3880
|
-
this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e));
|
|
3967
|
+
this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) || this.isEditorDisabled() ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e) || this.isEditorDisabled());
|
|
3968
|
+
break;
|
|
3969
|
+
case "disabled":
|
|
3970
|
+
this.applyDisabledState();
|
|
3881
3971
|
break;
|
|
3882
3972
|
case "theme":
|
|
3883
|
-
this.
|
|
3884
|
-
o.startsWith("editora-theme-") && this.classList.remove(o);
|
|
3885
|
-
}), e && this.classList.add(`editora-theme-${e}`);
|
|
3973
|
+
this.applyThemeClass(e);
|
|
3886
3974
|
break;
|
|
3887
3975
|
case "placeholder":
|
|
3888
3976
|
this.contentElement && (this.contentElement.setAttribute("data-placeholder", e), this.applyAccessibilitySettings());
|
|
@@ -3932,14 +4020,20 @@ class yt extends yi {
|
|
|
3932
4020
|
case "toolbar-sticky":
|
|
3933
4021
|
case "plugins":
|
|
3934
4022
|
case "statusbar":
|
|
3935
|
-
this.isConnected &&
|
|
3936
|
-
this.initialize().catch((o) => {
|
|
3937
|
-
console.error("[RichTextEditor] Error during attribute change re-initialization:", o);
|
|
3938
|
-
});
|
|
3939
|
-
}));
|
|
4023
|
+
this.isConnected && this.hasConnected && this.scheduleReinitialize();
|
|
3940
4024
|
break;
|
|
3941
4025
|
}
|
|
3942
4026
|
}
|
|
4027
|
+
/** One rebuild for however many attributes are changed in the same task. */
|
|
4028
|
+
scheduleReinitialize() {
|
|
4029
|
+
this.reinitializeQueued || (this.reinitializeQueued = !0, queueMicrotask(() => {
|
|
4030
|
+
this.reinitializeQueued = !1, this.isConnected && (this.destroy(), this.waitForPluginLoader().then(() => {
|
|
4031
|
+
this.initialize().catch((t) => {
|
|
4032
|
+
console.error("[RichTextEditor] Error during attribute change re-initialization:", t);
|
|
4033
|
+
});
|
|
4034
|
+
}));
|
|
4035
|
+
}));
|
|
4036
|
+
}
|
|
3943
4037
|
/**
|
|
3944
4038
|
* Resolve configuration from all sources
|
|
3945
4039
|
*/
|
|
@@ -3949,7 +4043,7 @@ class yt extends yi {
|
|
|
3949
4043
|
const o = this.attributes[e];
|
|
3950
4044
|
t[o.name] = o.value;
|
|
3951
4045
|
}
|
|
3952
|
-
return
|
|
4046
|
+
return Ae.resolve({
|
|
3953
4047
|
jsConfig: this.jsConfig,
|
|
3954
4048
|
attributes: t
|
|
3955
4049
|
});
|
|
@@ -3959,7 +4053,7 @@ class yt extends yi {
|
|
|
3959
4053
|
*/
|
|
3960
4054
|
getAPI() {
|
|
3961
4055
|
return {
|
|
3962
|
-
getContent: () =>
|
|
4056
|
+
getContent: () => bt(this.contentElement),
|
|
3963
4057
|
setContent: (t) => {
|
|
3964
4058
|
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
3965
4059
|
},
|
|
@@ -3987,11 +4081,11 @@ class yt extends yi {
|
|
|
3987
4081
|
*/
|
|
3988
4082
|
destroy() {
|
|
3989
4083
|
var t, e, o, i;
|
|
3990
|
-
this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent =
|
|
4084
|
+
this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = bt(this.contentElement), this.persistAutosave(this.preservedContent)), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (i = this.statusBar) == null || i.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.lastReportedContent = null, this.isInitialized = !1, Ce.delete(this), J === this && (J = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
|
|
3991
4085
|
}
|
|
3992
4086
|
// Public API methods
|
|
3993
4087
|
getContent() {
|
|
3994
|
-
return
|
|
4088
|
+
return bt(this.contentElement);
|
|
3995
4089
|
}
|
|
3996
4090
|
setContent(t) {
|
|
3997
4091
|
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
@@ -4009,29 +4103,29 @@ class yt extends yi {
|
|
|
4009
4103
|
}
|
|
4010
4104
|
}
|
|
4011
4105
|
export {
|
|
4012
|
-
|
|
4106
|
+
fn as C,
|
|
4013
4107
|
qt as E,
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4108
|
+
mn as F,
|
|
4109
|
+
un as K,
|
|
4110
|
+
So as P,
|
|
4111
|
+
Et as R,
|
|
4112
|
+
dn as S,
|
|
4113
|
+
hn as T,
|
|
4114
|
+
pn as a,
|
|
4115
|
+
Ae as b,
|
|
4116
|
+
di as c,
|
|
4117
|
+
gn as d,
|
|
4118
|
+
vn as e,
|
|
4119
|
+
En as f,
|
|
4120
|
+
Ti as g,
|
|
4121
|
+
bt as h,
|
|
4122
|
+
bn as i,
|
|
4123
|
+
wn as j,
|
|
4124
|
+
yn as k,
|
|
4125
|
+
wo as l,
|
|
4126
|
+
si as m,
|
|
4127
|
+
Oo as n,
|
|
4128
|
+
ki as o,
|
|
4129
|
+
ai as s
|
|
4036
4130
|
};
|
|
4037
|
-
//# sourceMappingURL=index-
|
|
4131
|
+
//# sourceMappingURL=index-BlsTuyTe.mjs.map
|