@editora/core 1.0.27 → 1.0.29
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/dist/{CollaborationPlugin.native-Bl3R9CRI.mjs → CollaborationPlugin.native-B2AsCMfm.mjs} +88 -88
- package/dist/core.css +1 -1
- package/dist/editora.min.js +16 -16
- package/dist/editora.umd.js +16 -16
- package/dist/{index-gI4djib2.mjs → index-8sr_lMjf.mjs} +428 -423
- package/dist/index-hTD8Iy46.js +12 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/plugin-loader.js +1 -1
- package/dist/webcomponent-core.js +425 -420
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +16 -16
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +452 -447
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +108 -108
- package/package.json +1 -1
- package/dist/index-DHPPVQwx.js +0 -12
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
class
|
|
1
|
+
class qt {
|
|
2
2
|
constructor(t, e, o) {
|
|
3
3
|
this.doc = t, this.selection = e, this.schema = o;
|
|
4
4
|
}
|
|
5
5
|
static create(t, e) {
|
|
6
6
|
const o = e || t.node("doc", {}, [t.node("paragraph")]);
|
|
7
|
-
return new
|
|
7
|
+
return new qt(o, { anchor: 0, head: 0 }, t);
|
|
8
8
|
}
|
|
9
9
|
apply(t, e) {
|
|
10
|
-
return new
|
|
10
|
+
return new qt(t, e || this.selection, this.schema);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
class ln {
|
|
@@ -497,7 +497,7 @@ class un {
|
|
|
497
497
|
constructor(t = {}) {
|
|
498
498
|
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new Ao(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
|
|
499
499
|
const e = this.pluginManager.buildSchema();
|
|
500
|
-
this.state =
|
|
500
|
+
this.state = qt.create(e), this.commandRegistry = new dn(this.pluginManager.getCommands());
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
503
503
|
* Execute a command
|
|
@@ -674,53 +674,53 @@ class pn {
|
|
|
674
674
|
const f = [];
|
|
675
675
|
c.split(/\s+/).filter(Boolean).forEach((g) => {
|
|
676
676
|
if (g === "direction") {
|
|
677
|
-
const
|
|
678
|
-
|
|
677
|
+
const E = r.get("setDirectionLTR"), k = r.get("setDirectionRTL");
|
|
678
|
+
E && f.push({
|
|
679
679
|
id: "directionLTR",
|
|
680
|
-
label:
|
|
681
|
-
command:
|
|
682
|
-
icon:
|
|
683
|
-
type:
|
|
684
|
-
options:
|
|
685
|
-
}),
|
|
680
|
+
label: E.label,
|
|
681
|
+
command: E.command,
|
|
682
|
+
icon: E.icon,
|
|
683
|
+
type: E.type || "button",
|
|
684
|
+
options: E.options
|
|
685
|
+
}), k && f.push({
|
|
686
686
|
id: "directionRTL",
|
|
687
|
-
label:
|
|
688
|
-
command:
|
|
689
|
-
icon:
|
|
690
|
-
type:
|
|
691
|
-
options:
|
|
687
|
+
label: k.label,
|
|
688
|
+
command: k.command,
|
|
689
|
+
icon: k.icon,
|
|
690
|
+
type: k.type || "button",
|
|
691
|
+
options: k.options
|
|
692
692
|
});
|
|
693
693
|
return;
|
|
694
694
|
}
|
|
695
695
|
if (g === "comments") {
|
|
696
|
-
const
|
|
697
|
-
|
|
696
|
+
const E = r.get("addComment"), k = r.get("toggleComments");
|
|
697
|
+
E && f.push({
|
|
698
698
|
id: "addComment",
|
|
699
|
-
label:
|
|
700
|
-
command:
|
|
701
|
-
icon:
|
|
702
|
-
type:
|
|
703
|
-
options:
|
|
704
|
-
}),
|
|
699
|
+
label: E.label,
|
|
700
|
+
command: E.command,
|
|
701
|
+
icon: E.icon,
|
|
702
|
+
type: E.type || "button",
|
|
703
|
+
options: E.options
|
|
704
|
+
}), k && f.push({
|
|
705
705
|
id: "toggleComments",
|
|
706
|
-
label:
|
|
707
|
-
command:
|
|
708
|
-
icon:
|
|
709
|
-
type:
|
|
710
|
-
options:
|
|
706
|
+
label: k.label,
|
|
707
|
+
command: k.command,
|
|
708
|
+
icon: k.icon,
|
|
709
|
+
type: k.type || "button",
|
|
710
|
+
options: k.options
|
|
711
711
|
});
|
|
712
712
|
return;
|
|
713
713
|
}
|
|
714
|
-
const
|
|
715
|
-
let
|
|
716
|
-
|
|
714
|
+
const w = l[g] || g;
|
|
715
|
+
let T = r.get(w);
|
|
716
|
+
T || (T = r.get(g)), T && f.push({
|
|
717
717
|
id: g,
|
|
718
|
-
label:
|
|
719
|
-
command:
|
|
720
|
-
icon:
|
|
721
|
-
type:
|
|
722
|
-
options:
|
|
723
|
-
items:
|
|
718
|
+
label: T.label,
|
|
719
|
+
command: T.command,
|
|
720
|
+
icon: T.icon,
|
|
721
|
+
type: T.type === "separator" ? "separator" : T.type || "button",
|
|
722
|
+
options: T.options,
|
|
723
|
+
items: T.items
|
|
724
724
|
});
|
|
725
725
|
}), f.length > 0 && e.push(f);
|
|
726
726
|
}), e;
|
|
@@ -754,7 +754,8 @@ class pn {
|
|
|
754
754
|
/** Measures top-level items in `itemsContainer` and moves whatever doesn't
|
|
755
755
|
* fit into a collapsible "more options" row, re-measuring on resize. */
|
|
756
756
|
setupOverflow(t) {
|
|
757
|
-
|
|
757
|
+
const e = this.itemsContainer;
|
|
758
|
+
if (!e || typeof ResizeObserver == "undefined") return;
|
|
758
759
|
const o = document.createElement("button");
|
|
759
760
|
o.type = "button", o.className = "editora-toolbar-more-button", o.title = "Show more options", o.setAttribute("aria-label", "More toolbar options"), o.textContent = "☰", o.style.display = "none", o.addEventListener("click", (c) => {
|
|
760
761
|
c.preventDefault(), this.setExpandedOpen(!this.expandedOpen);
|
|
@@ -764,23 +765,25 @@ class pn {
|
|
|
764
765
|
const r = () => {
|
|
765
766
|
const c = this.overflowUnits;
|
|
766
767
|
if (c.length === 0) return;
|
|
767
|
-
c.forEach((
|
|
768
|
-
var
|
|
769
|
-
|
|
768
|
+
c.forEach((B) => {
|
|
769
|
+
var O;
|
|
770
|
+
B.parentElement === i && ((O = this.overflowUnitHomes.get(B)) == null || O.appendChild(B));
|
|
770
771
|
});
|
|
771
|
-
const f = t.clientWidth, m = 16, g = 40,
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
772
|
+
const f = t.clientWidth, m = 16, g = 40, w = 4, T = Math.max(0, f - m), E = 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
|
+
};
|
|
776
|
+
let z = 0;
|
|
777
|
+
if ($(c[c.length - 1]) <= T)
|
|
778
|
+
z = c.length;
|
|
779
|
+
else
|
|
780
|
+
for (const B of c)
|
|
781
|
+
if ($(B) <= E) z++;
|
|
782
|
+
else break;
|
|
783
|
+
z = Math.max(1, Math.min(z, c.length));
|
|
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, O) => {
|
|
786
|
+
O >= z && i.appendChild(B);
|
|
784
787
|
});
|
|
785
788
|
}, l = () => {
|
|
786
789
|
this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
|
|
@@ -882,26 +885,26 @@ class pn {
|
|
|
882
885
|
var g;
|
|
883
886
|
m.detail === 0 && l() && ((g = r()[0]) == null || g.focus());
|
|
884
887
|
}), e.addEventListener("keydown", (m) => {
|
|
885
|
-
var
|
|
888
|
+
var w;
|
|
886
889
|
if (m.key !== "ArrowDown" && m.key !== "ArrowUp") return;
|
|
887
890
|
m.preventDefault(), l() || e.click();
|
|
888
891
|
const g = r();
|
|
889
|
-
(
|
|
892
|
+
(w = m.key === "ArrowUp" ? g[g.length - 1] : g[0]) == null || w.focus();
|
|
890
893
|
}), o.addEventListener("keydown", (m) => {
|
|
891
894
|
const g = r();
|
|
892
895
|
if (g.length === 0) return;
|
|
893
|
-
const
|
|
894
|
-
m.preventDefault(), g[(
|
|
896
|
+
const w = g.indexOf(document.activeElement), T = (E) => {
|
|
897
|
+
m.preventDefault(), g[(E + g.length) % g.length].focus();
|
|
895
898
|
};
|
|
896
899
|
switch (m.key) {
|
|
897
900
|
case "ArrowDown":
|
|
898
|
-
return
|
|
901
|
+
return T(w + 1);
|
|
899
902
|
case "ArrowUp":
|
|
900
|
-
return
|
|
903
|
+
return T(w < 0 ? g.length - 1 : w - 1);
|
|
901
904
|
case "Home":
|
|
902
|
-
return
|
|
905
|
+
return T(0);
|
|
903
906
|
case "End":
|
|
904
|
-
return
|
|
907
|
+
return T(g.length - 1);
|
|
905
908
|
case "Escape":
|
|
906
909
|
m.preventDefault(), m.stopPropagation(), o.style.display = "none", e.focus();
|
|
907
910
|
return;
|
|
@@ -1150,7 +1153,7 @@ function yn(s) {
|
|
|
1150
1153
|
const t = s.trim() ? s.trim().split(/\s+/).length : 0, e = s.length;
|
|
1151
1154
|
return { words: t, chars: e };
|
|
1152
1155
|
}
|
|
1153
|
-
function
|
|
1156
|
+
function vn(s, t) {
|
|
1154
1157
|
const e = s.toString();
|
|
1155
1158
|
return {
|
|
1156
1159
|
startLine: t.line,
|
|
@@ -1167,7 +1170,7 @@ function io(s, t) {
|
|
|
1167
1170
|
for (var e = 0, o = Array(t); e < t; e++) o[e] = s[e];
|
|
1168
1171
|
return o;
|
|
1169
1172
|
}
|
|
1170
|
-
function
|
|
1173
|
+
function En(s) {
|
|
1171
1174
|
if (Array.isArray(s)) return s;
|
|
1172
1175
|
}
|
|
1173
1176
|
function wn(s, t) {
|
|
@@ -1193,7 +1196,7 @@ function Tn() {
|
|
|
1193
1196
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1194
1197
|
}
|
|
1195
1198
|
function kn(s, t) {
|
|
1196
|
-
return
|
|
1199
|
+
return En(s) || wn(s, t) || xn(s, t) || Tn();
|
|
1197
1200
|
}
|
|
1198
1201
|
function xn(s, t) {
|
|
1199
1202
|
if (s) {
|
|
@@ -1203,38 +1206,38 @@ function xn(s, t) {
|
|
|
1203
1206
|
}
|
|
1204
1207
|
}
|
|
1205
1208
|
const Co = Object.entries, ro = Object.setPrototypeOf, An = Object.isFrozen, Cn = Object.getPrototypeOf, Sn = Object.getOwnPropertyDescriptor;
|
|
1206
|
-
let M = Object.freeze, I = Object.seal,
|
|
1209
|
+
let M = Object.freeze, I = Object.seal, bt = Object.create, So = typeof Reflect != "undefined" && Reflect, Te = So.apply, ke = So.construct;
|
|
1207
1210
|
M || (M = function(t) {
|
|
1208
1211
|
return t;
|
|
1209
1212
|
});
|
|
1210
1213
|
I || (I = function(t) {
|
|
1211
1214
|
return t;
|
|
1212
1215
|
});
|
|
1213
|
-
|
|
1216
|
+
Te || (Te = function(t, e) {
|
|
1214
1217
|
for (var o = arguments.length, i = new Array(o > 2 ? o - 2 : 0), r = 2; r < o; r++) i[r - 2] = arguments[r];
|
|
1215
1218
|
return t.apply(e, i);
|
|
1216
1219
|
});
|
|
1217
|
-
|
|
1220
|
+
ke || (ke = function(t) {
|
|
1218
1221
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1219
1222
|
return new t(...o);
|
|
1220
1223
|
});
|
|
1221
|
-
const
|
|
1224
|
+
const rt = L(Array.prototype.forEach), _n = L(Array.prototype.lastIndexOf), ao = L(Array.prototype.pop), At = L(Array.prototype.push), Ln = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), so = L(String.prototype.match), Ct = L(String.prototype.replace), lo = L(String.prototype.indexOf), Mn = L(String.prototype.trim), In = L(Number.prototype.toString), Dn = L(Boolean.prototype.toString), co = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), uo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), P = L(Object.prototype.hasOwnProperty), St = L(Object.prototype.toString), D = L(RegExp.prototype.test), Z = On(TypeError);
|
|
1222
1225
|
function L(s) {
|
|
1223
1226
|
return function(t) {
|
|
1224
1227
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
1225
1228
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1226
|
-
return
|
|
1229
|
+
return Te(s, t, o);
|
|
1227
1230
|
};
|
|
1228
1231
|
}
|
|
1229
1232
|
function On(s) {
|
|
1230
1233
|
return function() {
|
|
1231
1234
|
for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
|
|
1232
|
-
return
|
|
1235
|
+
return ke(s, e);
|
|
1233
1236
|
};
|
|
1234
1237
|
}
|
|
1235
|
-
function
|
|
1236
|
-
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
1237
|
-
if (ro && ro(s, null), !
|
|
1238
|
+
function v(s, t) {
|
|
1239
|
+
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Mt;
|
|
1240
|
+
if (ro && ro(s, null), !vt(t)) return s;
|
|
1238
1241
|
let o = t.length;
|
|
1239
1242
|
for (; o--; ) {
|
|
1240
1243
|
let i = t[o];
|
|
@@ -1247,15 +1250,15 @@ function E(s, t) {
|
|
|
1247
1250
|
return s;
|
|
1248
1251
|
}
|
|
1249
1252
|
function Rn(s) {
|
|
1250
|
-
for (let t = 0; t < s.length; t++)
|
|
1253
|
+
for (let t = 0; t < s.length; t++) P(s, t) || (s[t] = null);
|
|
1251
1254
|
return s;
|
|
1252
1255
|
}
|
|
1253
|
-
function
|
|
1254
|
-
const t =
|
|
1256
|
+
function U(s) {
|
|
1257
|
+
const t = bt(null);
|
|
1255
1258
|
for (const o of Co(s)) {
|
|
1256
1259
|
var e = kn(o, 2);
|
|
1257
1260
|
const i = e[0], r = e[1];
|
|
1258
|
-
|
|
1261
|
+
P(s, i) && (vt(r) ? t[i] = Rn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = U(r) : t[i] = r);
|
|
1259
1262
|
}
|
|
1260
1263
|
return t;
|
|
1261
1264
|
}
|
|
@@ -1272,22 +1275,22 @@ function Nn(s) {
|
|
|
1272
1275
|
case "symbol":
|
|
1273
1276
|
return uo ? uo(s) : "Symbol()";
|
|
1274
1277
|
case "undefined":
|
|
1275
|
-
return
|
|
1278
|
+
return St(s);
|
|
1276
1279
|
case "function":
|
|
1277
1280
|
case "object": {
|
|
1278
|
-
if (s === null) return
|
|
1279
|
-
const t = s, e =
|
|
1281
|
+
if (s === null) return St(s);
|
|
1282
|
+
const t = s, e = W(t, "toString");
|
|
1280
1283
|
if (typeof e == "function") {
|
|
1281
1284
|
const o = e(t);
|
|
1282
|
-
return typeof o == "string" ? o :
|
|
1285
|
+
return typeof o == "string" ? o : St(o);
|
|
1283
1286
|
}
|
|
1284
|
-
return
|
|
1287
|
+
return St(s);
|
|
1285
1288
|
}
|
|
1286
1289
|
default:
|
|
1287
|
-
return
|
|
1290
|
+
return St(s);
|
|
1288
1291
|
}
|
|
1289
1292
|
}
|
|
1290
|
-
function
|
|
1293
|
+
function W(s, t) {
|
|
1291
1294
|
for (; s !== null; ) {
|
|
1292
1295
|
const o = Sn(s, t);
|
|
1293
1296
|
if (o) {
|
|
@@ -1428,7 +1431,7 @@ const po = M([
|
|
|
1428
1431
|
"var",
|
|
1429
1432
|
"video",
|
|
1430
1433
|
"wbr"
|
|
1431
|
-
]),
|
|
1434
|
+
]), me = M([
|
|
1432
1435
|
"svg",
|
|
1433
1436
|
"a",
|
|
1434
1437
|
"altglyph",
|
|
@@ -1476,7 +1479,7 @@ const po = M([
|
|
|
1476
1479
|
"tspan",
|
|
1477
1480
|
"view",
|
|
1478
1481
|
"vkern"
|
|
1479
|
-
]),
|
|
1482
|
+
]), ge = M([
|
|
1480
1483
|
"feBlend",
|
|
1481
1484
|
"feColorMatrix",
|
|
1482
1485
|
"feComponentTransfer",
|
|
@@ -1525,7 +1528,7 @@ const po = M([
|
|
|
1525
1528
|
"solidcolor",
|
|
1526
1529
|
"unknown",
|
|
1527
1530
|
"use"
|
|
1528
|
-
]),
|
|
1531
|
+
]), be = M([
|
|
1529
1532
|
"math",
|
|
1530
1533
|
"menclose",
|
|
1531
1534
|
"merror",
|
|
@@ -1556,7 +1559,7 @@ const po = M([
|
|
|
1556
1559
|
"munder",
|
|
1557
1560
|
"munderover",
|
|
1558
1561
|
"mprescripts"
|
|
1559
|
-
]),
|
|
1562
|
+
]), Bn = M([
|
|
1560
1563
|
"maction",
|
|
1561
1564
|
"maligngroup",
|
|
1562
1565
|
"malignmark",
|
|
@@ -1691,7 +1694,7 @@ const po = M([
|
|
|
1691
1694
|
"width",
|
|
1692
1695
|
"wrap",
|
|
1693
1696
|
"xmlns"
|
|
1694
|
-
]),
|
|
1697
|
+
]), ye = M([
|
|
1695
1698
|
"accent-height",
|
|
1696
1699
|
"accumulate",
|
|
1697
1700
|
"additive",
|
|
@@ -1939,13 +1942,13 @@ const po = M([
|
|
|
1939
1942
|
"voffset",
|
|
1940
1943
|
"width",
|
|
1941
1944
|
"xmlns"
|
|
1942
|
-
]),
|
|
1945
|
+
]), Gt = M([
|
|
1943
1946
|
"xlink:href",
|
|
1944
1947
|
"xml:id",
|
|
1945
1948
|
"xlink:title",
|
|
1946
1949
|
"xml:space",
|
|
1947
1950
|
"xmlns:xlink"
|
|
1948
|
-
]),
|
|
1951
|
+
]), Hn = I(/{{[\w\W]*|^[\w\W]*}}/g), Fn = I(/<%[\w\W]*|^[\w\W]*%>/g), Un = I(/\${[\w\W]*/g), jn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), Wn = I(/^aria-[\-\w]+$/), go = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), $n = I(/^(?:\w+script|data):/i), Gn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Kn = I(/^html$/i), Yn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), bo = I(/<[/\w!]/g), yo = I(/<[/\w]/g), qn = I(/<\/no(script|embed|frames)/i), Vn = I(/\/>/i), F = {
|
|
1949
1952
|
element: 1,
|
|
1950
1953
|
attribute: 2,
|
|
1951
1954
|
text: 3,
|
|
@@ -1967,9 +1970,9 @@ const po = M([
|
|
|
1967
1970
|
"noframes",
|
|
1968
1971
|
"plaintext",
|
|
1969
1972
|
"noscript"
|
|
1970
|
-
], Xn = M(
|
|
1973
|
+
], Xn = M(v({}, _o)), Zn = (function() {
|
|
1971
1974
|
const s = {};
|
|
1972
|
-
return
|
|
1975
|
+
return rt(_o, (t) => {
|
|
1973
1976
|
s[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
1974
1977
|
}), M(s);
|
|
1975
1978
|
})(), Jn = function() {
|
|
@@ -1992,7 +1995,7 @@ const po = M([
|
|
|
1992
1995
|
} catch (l) {
|
|
1993
1996
|
return console.warn("TrustedTypes policy " + r + " could not be created."), null;
|
|
1994
1997
|
}
|
|
1995
|
-
},
|
|
1998
|
+
}, vo = function() {
|
|
1996
1999
|
return {
|
|
1997
2000
|
afterSanitizeAttributes: [],
|
|
1998
2001
|
afterSanitizeElements: [],
|
|
@@ -2004,70 +2007,70 @@ const po = M([
|
|
|
2004
2007
|
uponSanitizeElement: [],
|
|
2005
2008
|
uponSanitizeShadowNode: []
|
|
2006
2009
|
};
|
|
2007
|
-
},
|
|
2008
|
-
return
|
|
2009
|
-
},
|
|
2010
|
-
const i =
|
|
2011
|
-
return i && typeof i == "object" ?
|
|
2010
|
+
}, J = function(t, e, o, i) {
|
|
2011
|
+
return P(t, e) && vt(t[e]) ? v(i.base ? U(i.base) : {}, t[e], i.transform) : o;
|
|
2012
|
+
}, ve = function(t, e, o) {
|
|
2013
|
+
const i = P(t, e) ? t[e] : void 0;
|
|
2014
|
+
return i && typeof i == "object" ? U(i) : o();
|
|
2012
2015
|
};
|
|
2013
2016
|
function Lo() {
|
|
2014
2017
|
let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Jn();
|
|
2015
2018
|
const t = (u) => Lo(u);
|
|
2016
|
-
if (t.version = "3.4.16", t.removed = [], !s || !s.document || s.document.nodeType !==
|
|
2019
|
+
if (t.version = "3.4.16", t.removed = [], !s || !s.document || s.document.nodeType !== F.document || !s.Element)
|
|
2017
2020
|
return t.isSupported = !1, t;
|
|
2018
2021
|
let e = s.document;
|
|
2019
2022
|
const o = e, i = o.currentScript;
|
|
2020
2023
|
s.DocumentFragment;
|
|
2021
2024
|
const r = s.HTMLTemplateElement, l = s.Node, c = s.Element, f = s.NodeFilter;
|
|
2022
2025
|
s.NamedNodeMap === void 0 && (s.NamedNodeMap || s.MozNamedAttrMap), s.HTMLFormElement;
|
|
2023
|
-
const m = s.DOMParser, g = s.trustedTypes,
|
|
2024
|
-
return
|
|
2025
|
-
},
|
|
2026
|
-
return
|
|
2026
|
+
const m = s.DOMParser, g = s.trustedTypes, w = c.prototype, T = W(w, "cloneNode"), E = 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, It = l && l.prototype ? W(l.prototype, "ownerDocument") : null, Et = function(n) {
|
|
2027
|
+
return O ? O(n) : n.nodeType;
|
|
2028
|
+
}, Xt = function(n) {
|
|
2029
|
+
return st ? st(n) : n.nodeName;
|
|
2027
2030
|
};
|
|
2028
2031
|
if (typeof r == "function") {
|
|
2029
2032
|
const u = e.createElement("template");
|
|
2030
2033
|
u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
|
|
2031
2034
|
}
|
|
2032
|
-
let
|
|
2035
|
+
let N, et = "", Zt, Ce = !1, wt = 0;
|
|
2033
2036
|
const Se = function() {
|
|
2034
|
-
if (
|
|
2035
|
-
},
|
|
2036
|
-
Se(),
|
|
2037
|
+
if (wt > 0) throw Z('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
|
+
}, lt = function(n) {
|
|
2039
|
+
Se(), wt++;
|
|
2037
2040
|
try {
|
|
2038
|
-
return
|
|
2041
|
+
return N.createHTML(n);
|
|
2039
2042
|
} finally {
|
|
2040
|
-
|
|
2043
|
+
wt--;
|
|
2041
2044
|
}
|
|
2042
2045
|
}, Oo = function(n) {
|
|
2043
|
-
Se(),
|
|
2046
|
+
Se(), wt++;
|
|
2044
2047
|
try {
|
|
2045
|
-
return
|
|
2048
|
+
return N.createScriptURL(n);
|
|
2046
2049
|
} finally {
|
|
2047
|
-
|
|
2050
|
+
wt--;
|
|
2048
2051
|
}
|
|
2049
2052
|
}, Ro = function() {
|
|
2050
|
-
return Ce || (
|
|
2051
|
-
},
|
|
2052
|
-
let x =
|
|
2053
|
-
t.isSupported = typeof Co == "function" && typeof
|
|
2054
|
-
const
|
|
2053
|
+
return Ce || (Zt = Qn(g, i), Ce = !0), Zt;
|
|
2054
|
+
}, Dt = e, Jt = Dt.implementation, _e = Dt.createNodeIterator, No = Dt.createDocumentFragment, Po = Dt.getElementsByTagName, zo = o.importNode;
|
|
2055
|
+
let x = vo();
|
|
2056
|
+
t.isSupported = typeof Co == "function" && typeof z == "function" && Jt && Jt.createHTMLDocument !== void 0;
|
|
2057
|
+
const Bo = Hn, Ho = Fn, Fo = Un, Uo = jn, jo = Wn, Wo = $n, Le = Gn, $o = Yn;
|
|
2055
2058
|
let Me = go, A = null;
|
|
2056
|
-
const
|
|
2059
|
+
const Qt = v({}, [
|
|
2057
2060
|
...po,
|
|
2058
|
-
...he,
|
|
2059
2061
|
...me,
|
|
2060
2062
|
...ge,
|
|
2063
|
+
...be,
|
|
2061
2064
|
...fo
|
|
2062
2065
|
]);
|
|
2063
2066
|
let C = null;
|
|
2064
|
-
const
|
|
2067
|
+
const te = v({}, [
|
|
2065
2068
|
...ho,
|
|
2066
|
-
...
|
|
2069
|
+
...ye,
|
|
2067
2070
|
...mo,
|
|
2068
|
-
...
|
|
2071
|
+
...Gt
|
|
2069
2072
|
]);
|
|
2070
|
-
let
|
|
2073
|
+
let G = Object.seal(bt(null, {
|
|
2071
2074
|
tagNameCheck: {
|
|
2072
2075
|
writable: !0,
|
|
2073
2076
|
configurable: !1,
|
|
@@ -2086,8 +2089,8 @@ function Lo() {
|
|
|
2086
2089
|
enumerable: !0,
|
|
2087
2090
|
value: !1
|
|
2088
2091
|
}
|
|
2089
|
-
})),
|
|
2090
|
-
const
|
|
2092
|
+
})), Tt = null, Ie = null;
|
|
2093
|
+
const q = Object.seal(bt(null, {
|
|
2091
2094
|
tagCheck: {
|
|
2092
2095
|
writable: !0,
|
|
2093
2096
|
configurable: !1,
|
|
@@ -2101,10 +2104,10 @@ function Lo() {
|
|
|
2101
2104
|
value: null
|
|
2102
2105
|
}
|
|
2103
2106
|
}));
|
|
2104
|
-
let De = !0,
|
|
2107
|
+
let De = !0, ee = !0, Oe = !1, Re = !0, V = !1, ot = !0, nt = !1, oe = !1, Ot = null, Rt = null, ne = !1, ct = !1, Nt = !1, Pt = !1, Ne = !0, Pe = !1;
|
|
2105
2108
|
const ze = "user-content-";
|
|
2106
|
-
let
|
|
2107
|
-
const
|
|
2109
|
+
let ie = !0, re = !1, dt = {}, ut = null;
|
|
2110
|
+
const Be = v({}, [
|
|
2108
2111
|
"annotation-xml",
|
|
2109
2112
|
"audio",
|
|
2110
2113
|
"colgroup",
|
|
@@ -2132,8 +2135,8 @@ function Lo() {
|
|
|
2132
2135
|
"video",
|
|
2133
2136
|
"xmp"
|
|
2134
2137
|
]);
|
|
2135
|
-
let
|
|
2136
|
-
const Fe =
|
|
2138
|
+
let He = null;
|
|
2139
|
+
const Fe = v({}, [
|
|
2137
2140
|
"audio",
|
|
2138
2141
|
"video",
|
|
2139
2142
|
"img",
|
|
@@ -2142,7 +2145,7 @@ function Lo() {
|
|
|
2142
2145
|
"track"
|
|
2143
2146
|
]);
|
|
2144
2147
|
let Ue = null;
|
|
2145
|
-
const je =
|
|
2148
|
+
const je = v({}, [
|
|
2146
2149
|
"alt",
|
|
2147
2150
|
"class",
|
|
2148
2151
|
"for",
|
|
@@ -2157,126 +2160,126 @@ function Lo() {
|
|
|
2157
2160
|
"value",
|
|
2158
2161
|
"style",
|
|
2159
2162
|
"xmlns"
|
|
2160
|
-
]),
|
|
2161
|
-
let
|
|
2162
|
-
const Go =
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
],
|
|
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 pt = K, ae = !1, se = null;
|
|
2165
|
+
const Go = v({}, [
|
|
2166
|
+
zt,
|
|
2167
|
+
Bt,
|
|
2168
|
+
K
|
|
2169
|
+
], he), We = M([
|
|
2167
2170
|
"mi",
|
|
2168
2171
|
"mo",
|
|
2169
2172
|
"mn",
|
|
2170
2173
|
"ms",
|
|
2171
2174
|
"mtext"
|
|
2172
2175
|
]);
|
|
2173
|
-
let
|
|
2176
|
+
let le = v({}, We);
|
|
2174
2177
|
const $e = M(["annotation-xml"]);
|
|
2175
|
-
let
|
|
2176
|
-
const Ko =
|
|
2178
|
+
let ce = v({}, $e);
|
|
2179
|
+
const Ko = v({}, [
|
|
2177
2180
|
"title",
|
|
2178
2181
|
"style",
|
|
2179
2182
|
"font",
|
|
2180
2183
|
"a",
|
|
2181
2184
|
"script"
|
|
2182
2185
|
]);
|
|
2183
|
-
let
|
|
2186
|
+
let kt = null;
|
|
2184
2187
|
const Yo = ["application/xhtml+xml", "text/html"], qo = "text/html";
|
|
2185
|
-
let _ = null,
|
|
2188
|
+
let _ = null, ft = null;
|
|
2186
2189
|
const Vo = e.createElement("form"), Ge = function(n) {
|
|
2187
2190
|
return n instanceof RegExp || n instanceof Function;
|
|
2188
|
-
},
|
|
2191
|
+
}, de = function() {
|
|
2189
2192
|
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2190
|
-
if (
|
|
2191
|
-
(!n || typeof n != "object") && (n = {}), n =
|
|
2193
|
+
if (ft && ft === n) return;
|
|
2194
|
+
(!n || typeof n != "object") && (n = {}), n = U(n), kt = Yo.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? qo : n.PARSER_MEDIA_TYPE, _ = kt === "application/xhtml+xml" ? he : Mt, A = J(n, "ALLOWED_TAGS", Qt, { transform: _ }), C = J(n, "ALLOWED_ATTR", te, { transform: _ }), se = J(n, "ALLOWED_NAMESPACES", Go, { transform: he }), Ue = J(n, "ADD_URI_SAFE_ATTR", je, {
|
|
2192
2195
|
transform: _,
|
|
2193
2196
|
base: je
|
|
2194
|
-
}),
|
|
2197
|
+
}), He = J(n, "ADD_DATA_URI_TAGS", Fe, {
|
|
2195
2198
|
transform: _,
|
|
2196
2199
|
base: Fe
|
|
2197
|
-
}),
|
|
2198
|
-
const a =
|
|
2199
|
-
if (
|
|
2200
|
+
}), ut = J(n, "FORBID_CONTENTS", Be, { transform: _ }), Tt = J(n, "FORBID_TAGS", U({}), { transform: _ }), Ie = J(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, De = n.ALLOW_ARIA_ATTR !== !1, ee = n.ALLOW_DATA_ATTR !== !1, Oe = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = 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, Ne = n.SANITIZE_DOM !== !1, Pe = n.SANITIZE_NAMED_PROPS || !1, ie = n.KEEP_CONTENT !== !1, re = n.IN_PLACE || !1, Me = Pn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : go, pt = typeof n.NAMESPACE == "string" ? n.NAMESPACE : K, le = ve(n, "MATHML_TEXT_INTEGRATION_POINTS", () => v({}, We)), ce = ve(n, "HTML_INTEGRATION_POINTS", () => v({}, $e));
|
|
2201
|
+
const a = ve(n, "CUSTOM_ELEMENT_HANDLING", () => bt(null));
|
|
2202
|
+
if (G = bt(null), P(a, "tagNameCheck") && Ge(a.tagNameCheck) && (G.tagNameCheck = a.tagNameCheck), P(a, "attributeNameCheck") && Ge(a.attributeNameCheck) && (G.attributeNameCheck = a.attributeNameCheck), P(a, "allowCustomizedBuiltInElements") && typeof a.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = a.allowCustomizedBuiltInElements), I(G), V && (ee = !1), Nt && (ct = !0), dt && (A = v({}, fo), C = bt(null), dt.html === !0 && (v(A, po), v(C, ho)), dt.svg === !0 && (v(A, me), v(C, ye), v(C, Gt)), dt.svgFilters === !0 && (v(A, ge), v(C, ye), v(C, Gt)), dt.mathMl === !0 && (v(A, be), v(C, mo), v(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 === Qt && (A = U(A)), v(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)), v(C, n.ADD_ATTR, _))), P(n, "ADD_FORBID_CONTENTS") && vt(n.ADD_FORBID_CONTENTS) && (ut === Be && (ut = U(ut)), v(ut, n.ADD_FORBID_CONTENTS, _)), ie && (A["#text"] = !0), nt && v(A, [
|
|
2200
2203
|
"html",
|
|
2201
2204
|
"head",
|
|
2202
2205
|
"body"
|
|
2203
|
-
]), A.table && (
|
|
2204
|
-
if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
2205
|
-
if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
2206
|
-
const d =
|
|
2207
|
-
|
|
2206
|
+
]), A.table && (v(A, ["tbody"]), delete Tt.tbody), n.TRUSTED_TYPES_POLICY) {
|
|
2207
|
+
if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2208
|
+
if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2209
|
+
const d = N;
|
|
2210
|
+
N = n.TRUSTED_TYPES_POLICY;
|
|
2208
2211
|
try {
|
|
2209
|
-
|
|
2212
|
+
et = lt("");
|
|
2210
2213
|
} catch (p) {
|
|
2211
|
-
throw
|
|
2214
|
+
throw N = d, p;
|
|
2212
2215
|
}
|
|
2213
|
-
} else n.TRUSTED_TYPES_POLICY === null ? (
|
|
2214
|
-
M && M(n),
|
|
2215
|
-
}, Ke =
|
|
2216
|
-
...he,
|
|
2216
|
+
} else n.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Ro()), N && typeof et == "string" && (et = lt("")));
|
|
2217
|
+
M && M(n), ft = n;
|
|
2218
|
+
}, Ke = v({}, [
|
|
2217
2219
|
...me,
|
|
2220
|
+
...ge,
|
|
2218
2221
|
...zn
|
|
2219
|
-
]), Ye =
|
|
2220
|
-
return a.namespaceURI ===
|
|
2222
|
+
]), Ye = v({}, [...be, ...Bn]), Xo = function(n, a, d) {
|
|
2223
|
+
return a.namespaceURI === K ? n === "svg" : a.namespaceURI === zt ? n === "svg" && (d === "annotation-xml" || le[d]) : !!Ke[n];
|
|
2221
2224
|
}, Zo = function(n, a, d) {
|
|
2222
|
-
return a.namespaceURI ===
|
|
2225
|
+
return a.namespaceURI === K ? n === "math" : a.namespaceURI === Bt ? n === "math" && ce[d] : !!Ye[n];
|
|
2223
2226
|
}, Jo = function(n, a, d) {
|
|
2224
|
-
return a.namespaceURI ===
|
|
2227
|
+
return a.namespaceURI === Bt && !ce[d] || a.namespaceURI === zt && !le[d] ? !1 : !Ye[n] && (Ko[n] || !Ke[n]);
|
|
2225
2228
|
}, Qo = function(n) {
|
|
2226
|
-
let a =
|
|
2229
|
+
let a = z(n);
|
|
2227
2230
|
(!a || !a.tagName) && (a = {
|
|
2228
|
-
namespaceURI:
|
|
2231
|
+
namespaceURI: pt,
|
|
2229
2232
|
tagName: "template"
|
|
2230
2233
|
});
|
|
2231
|
-
const d =
|
|
2232
|
-
return
|
|
2233
|
-
},
|
|
2234
|
-
|
|
2234
|
+
const d = Mt(n.tagName), p = Mt(a.tagName);
|
|
2235
|
+
return se[n.namespaceURI] ? n.namespaceURI === Bt ? Xo(d, a, p) : n.namespaceURI === zt ? Zo(d, a, p) : n.namespaceURI === K ? Jo(d, a, p) : !!(kt === "application/xhtml+xml" && se[n.namespaceURI]) : !1;
|
|
2236
|
+
}, X = function(n) {
|
|
2237
|
+
At(t.removed, { element: n });
|
|
2235
2238
|
try {
|
|
2236
|
-
|
|
2239
|
+
z(n).removeChild(n);
|
|
2237
2240
|
} catch (a) {
|
|
2238
|
-
if (
|
|
2241
|
+
if (E(n), !z(n)) throw Z("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2239
2242
|
}
|
|
2240
2243
|
}, qe = function(n, a, d) {
|
|
2241
2244
|
try {
|
|
2242
|
-
|
|
2245
|
+
k(n, a);
|
|
2243
2246
|
} catch (p) {
|
|
2244
2247
|
try {
|
|
2245
2248
|
n.removeAttribute(d);
|
|
2246
2249
|
} catch (h) {
|
|
2247
2250
|
}
|
|
2248
2251
|
}
|
|
2249
|
-
},
|
|
2250
|
-
|
|
2251
|
-
const a =
|
|
2252
|
+
}, Ht = function(n) {
|
|
2253
|
+
Ft(n);
|
|
2254
|
+
const a = $(n);
|
|
2252
2255
|
if (a) {
|
|
2253
2256
|
const p = [];
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
}),
|
|
2257
|
+
rt(a, (h) => {
|
|
2258
|
+
At(p, h);
|
|
2259
|
+
}), rt(p, (h) => {
|
|
2257
2260
|
try {
|
|
2258
|
-
|
|
2261
|
+
E(h);
|
|
2259
2262
|
} catch (b) {
|
|
2260
2263
|
}
|
|
2261
2264
|
});
|
|
2262
2265
|
}
|
|
2263
|
-
const d =
|
|
2266
|
+
const d = B(n);
|
|
2264
2267
|
if (d) for (let p = d.length - 1; p >= 0; --p) {
|
|
2265
2268
|
const h = d[p], b = h && h.name;
|
|
2266
2269
|
typeof b == "string" && qe(n, h, b);
|
|
2267
2270
|
}
|
|
2268
|
-
},
|
|
2271
|
+
}, it = function(n, a, d) {
|
|
2269
2272
|
if (!d) try {
|
|
2270
2273
|
d = a.getAttributeNode(n);
|
|
2271
2274
|
} catch (p) {
|
|
2272
2275
|
d = null;
|
|
2273
2276
|
}
|
|
2274
|
-
|
|
2277
|
+
At(t.removed, {
|
|
2275
2278
|
attribute: d || null,
|
|
2276
2279
|
from: a
|
|
2277
2280
|
});
|
|
2278
2281
|
try {
|
|
2279
|
-
d ?
|
|
2282
|
+
d ? k(a, d) : a.removeAttribute(n);
|
|
2280
2283
|
} catch (p) {
|
|
2281
2284
|
try {
|
|
2282
2285
|
a.removeAttribute(n);
|
|
@@ -2284,8 +2287,8 @@ function Lo() {
|
|
|
2284
2287
|
}
|
|
2285
2288
|
}
|
|
2286
2289
|
if (n === "is")
|
|
2287
|
-
if (
|
|
2288
|
-
|
|
2290
|
+
if (ct || Nt) try {
|
|
2291
|
+
X(a);
|
|
2289
2292
|
} catch (p) {
|
|
2290
2293
|
}
|
|
2291
2294
|
else try {
|
|
@@ -2293,108 +2296,108 @@ function Lo() {
|
|
|
2293
2296
|
} catch (p) {
|
|
2294
2297
|
}
|
|
2295
2298
|
}, tn = function(n) {
|
|
2296
|
-
const a =
|
|
2299
|
+
const a = B(n);
|
|
2297
2300
|
if (a)
|
|
2298
2301
|
for (let d = a.length - 1; d >= 0; --d) {
|
|
2299
2302
|
const p = a[d], h = p && p.name;
|
|
2300
2303
|
typeof h != "string" || C[_(h)] || qe(n, p, h);
|
|
2301
2304
|
}
|
|
2302
|
-
},
|
|
2305
|
+
}, Ft = function(n) {
|
|
2303
2306
|
const a = [n];
|
|
2304
2307
|
for (; a.length > 0; ) {
|
|
2305
2308
|
const d = a.pop();
|
|
2306
|
-
|
|
2307
|
-
const p =
|
|
2309
|
+
Et(d) === F.element && tn(d);
|
|
2310
|
+
const p = $(d);
|
|
2308
2311
|
if (p) for (let h = p.length - 1; h >= 0; --h) a.push(p[h]);
|
|
2309
2312
|
}
|
|
2310
2313
|
}, Ve = function(n, a) {
|
|
2311
|
-
return
|
|
2314
|
+
return ot ? n === "patchsrc" ? !0 : n === "for" && a !== "label" && a !== "output" : !1;
|
|
2312
2315
|
}, en = function(n) {
|
|
2313
|
-
if (!
|
|
2316
|
+
if (!ot) return;
|
|
2314
2317
|
const a = [n];
|
|
2315
2318
|
for (; a.length > 0; ) {
|
|
2316
|
-
const d = a.pop(), p =
|
|
2317
|
-
if (p ===
|
|
2319
|
+
const d = a.pop(), p = Et(d);
|
|
2320
|
+
if (p === F.processingInstruction || p === F.comment && D(yo, d.data)) {
|
|
2318
2321
|
try {
|
|
2319
|
-
|
|
2322
|
+
E(d);
|
|
2320
2323
|
} catch (b) {
|
|
2321
2324
|
}
|
|
2322
2325
|
continue;
|
|
2323
2326
|
}
|
|
2324
|
-
if (p ===
|
|
2325
|
-
const b = d, y = _(
|
|
2327
|
+
if (p === F.element) {
|
|
2328
|
+
const b = d, y = _(Xt(d));
|
|
2326
2329
|
try {
|
|
2327
2330
|
b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Ve("for", y) && b.removeAttribute("for");
|
|
2328
2331
|
} catch (S) {
|
|
2329
2332
|
}
|
|
2330
2333
|
}
|
|
2331
|
-
const h =
|
|
2334
|
+
const h = $(d);
|
|
2332
2335
|
if (h) for (let b = h.length - 1; b >= 0; --b) a.push(h[b]);
|
|
2333
2336
|
}
|
|
2334
2337
|
}, Xe = function(n) {
|
|
2335
2338
|
let a = null, d = null;
|
|
2336
|
-
if (
|
|
2339
|
+
if (ne) n = "<remove></remove>" + n;
|
|
2337
2340
|
else {
|
|
2338
2341
|
const b = so(n, /^[\r\n\t ]+/);
|
|
2339
2342
|
d = b && b[0];
|
|
2340
2343
|
}
|
|
2341
|
-
|
|
2342
|
-
const p =
|
|
2343
|
-
if (
|
|
2344
|
-
a = new m().parseFromString(p,
|
|
2344
|
+
kt === "application/xhtml+xml" && pt === 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 (pt === K) try {
|
|
2347
|
+
a = new m().parseFromString(p, kt);
|
|
2345
2348
|
} catch (b) {
|
|
2346
2349
|
}
|
|
2347
2350
|
if (!a || !a.documentElement) {
|
|
2348
|
-
a =
|
|
2351
|
+
a = Jt.createDocument(pt, "template", null);
|
|
2349
2352
|
try {
|
|
2350
|
-
a.documentElement.innerHTML =
|
|
2353
|
+
a.documentElement.innerHTML = ae ? et : p;
|
|
2351
2354
|
} catch (b) {
|
|
2352
2355
|
}
|
|
2353
2356
|
}
|
|
2354
2357
|
const h = a.body || a.documentElement;
|
|
2355
|
-
return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null),
|
|
2358
|
+
return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), pt === K ? Po.call(a, nt ? "html" : "body")[0] : nt ? a.documentElement : h;
|
|
2356
2359
|
}, Ze = function(n) {
|
|
2357
|
-
const a =
|
|
2360
|
+
const a = It ? It(n) : n.ownerDocument;
|
|
2358
2361
|
return _e.call(a || n, n, f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION, null);
|
|
2359
|
-
},
|
|
2360
|
-
return n =
|
|
2361
|
-
},
|
|
2362
|
+
}, Ut = function(n) {
|
|
2363
|
+
return n = Ct(n, Bo, " "), n = Ct(n, Ho, " "), n = Ct(n, Fo, " "), n;
|
|
2364
|
+
}, ue = function(n) {
|
|
2362
2365
|
var a;
|
|
2363
2366
|
n.normalize();
|
|
2364
|
-
const d =
|
|
2367
|
+
const d = It ? It(n) : n.ownerDocument, p = _e.call(d || n, n, f.SHOW_TEXT | f.SHOW_COMMENT | f.SHOW_CDATA_SECTION | f.SHOW_PROCESSING_INSTRUCTION, null);
|
|
2365
2368
|
let h = p.nextNode();
|
|
2366
2369
|
for (; h; )
|
|
2367
|
-
h.data =
|
|
2370
|
+
h.data = Ut(h.data), h = p.nextNode();
|
|
2368
2371
|
const b = (a = n.querySelectorAll) === null || a === void 0 ? void 0 : a.call(n, "template");
|
|
2369
|
-
b &&
|
|
2370
|
-
|
|
2372
|
+
b && rt(b, (y) => {
|
|
2373
|
+
ht(y.content) && ue(y.content);
|
|
2371
2374
|
});
|
|
2372
|
-
},
|
|
2373
|
-
const a =
|
|
2374
|
-
return typeof a != "string" || _(a) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !==
|
|
2375
|
-
},
|
|
2376
|
-
if (!
|
|
2375
|
+
}, jt = function(n) {
|
|
2376
|
+
const a = st ? st(n) : null;
|
|
2377
|
+
return typeof a != "string" || _(a) !== "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
|
+
}, ht = function(n) {
|
|
2379
|
+
if (!O || typeof n != "object" || n === null) return !1;
|
|
2377
2380
|
try {
|
|
2378
|
-
return
|
|
2381
|
+
return O(n) === F.documentFragment;
|
|
2379
2382
|
} catch (a) {
|
|
2380
2383
|
return !1;
|
|
2381
2384
|
}
|
|
2382
|
-
},
|
|
2383
|
-
if (!
|
|
2385
|
+
}, xt = function(n) {
|
|
2386
|
+
if (!O || typeof n != "object" || n === null) return !1;
|
|
2384
2387
|
try {
|
|
2385
|
-
return typeof
|
|
2388
|
+
return typeof O(n) == "number";
|
|
2386
2389
|
} catch (a) {
|
|
2387
2390
|
return !1;
|
|
2388
2391
|
}
|
|
2389
2392
|
};
|
|
2390
|
-
function
|
|
2391
|
-
u.length !== 0 &&
|
|
2392
|
-
d.call(t, n, a,
|
|
2393
|
+
function Y(u, n, a) {
|
|
2394
|
+
u.length !== 0 && rt(u, (d) => {
|
|
2395
|
+
d.call(t, n, a, ft);
|
|
2393
2396
|
});
|
|
2394
2397
|
}
|
|
2395
2398
|
const on = function(n, a) {
|
|
2396
|
-
return !!(
|
|
2397
|
-
},
|
|
2399
|
+
return !!(ot && n.hasChildNodes() && !xt(n.firstElementChild) && D(bo, n.textContent) && D(bo, n.innerHTML) || ot && n.namespaceURI === K && Xn[a] && (xt(n.firstElementChild) || typeof n.textContent == "string" && D(Zn[a], n.textContent)) || n.nodeType === F.processingInstruction || ot && n.nodeType === F.comment && D(yo, n.data));
|
|
2400
|
+
}, Wt = function(n, a) {
|
|
2398
2401
|
if (n instanceof RegExp) return D(n, a);
|
|
2399
2402
|
if (n instanceof Function) {
|
|
2400
2403
|
for (var d = arguments.length, p = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) p[h - 2] = arguments[h];
|
|
@@ -2402,49 +2405,49 @@ function Lo() {
|
|
|
2402
2405
|
}
|
|
2403
2406
|
return !1;
|
|
2404
2407
|
}, nn = function(n, a, d) {
|
|
2405
|
-
if (!
|
|
2406
|
-
if (
|
|
2407
|
-
const p =
|
|
2408
|
+
if (!Tt[a] && eo(a) && Wt(G.tagNameCheck, a)) return !1;
|
|
2409
|
+
if (ie && !ut[a]) {
|
|
2410
|
+
const p = z(n), h = $(n);
|
|
2408
2411
|
if (h && p) {
|
|
2409
2412
|
const b = h.length;
|
|
2410
2413
|
for (let y = b - 1; y >= 0; --y) {
|
|
2411
|
-
const S = n === d ?
|
|
2412
|
-
p.insertBefore(S,
|
|
2414
|
+
const S = n === d ? T(h[y], !0) : h[y];
|
|
2415
|
+
p.insertBefore(S, tt(n));
|
|
2413
2416
|
}
|
|
2414
2417
|
}
|
|
2415
2418
|
}
|
|
2416
|
-
return
|
|
2419
|
+
return X(n), !0;
|
|
2417
2420
|
}, Je = function(n, a, d, p) {
|
|
2418
|
-
return n.length === 0 ? a : a === d || a === p ?
|
|
2419
|
-
},
|
|
2420
|
-
return n === a ||
|
|
2421
|
+
return n.length === 0 ? a : a === d || a === p ? U(a) : a;
|
|
2422
|
+
}, mt = function(n, a) {
|
|
2423
|
+
return n === a || z(n) !== null ? !1 : (re && Ft(n), !0);
|
|
2421
2424
|
}, Qe = function(n, a) {
|
|
2422
|
-
if (
|
|
2423
|
-
if (
|
|
2424
|
-
return
|
|
2425
|
-
const d = _(
|
|
2426
|
-
if (A = Je(x.uponSanitizeElement, A,
|
|
2425
|
+
if (Y(x.beforeSanitizeElements, n, null), mt(n, a)) return !0;
|
|
2426
|
+
if (jt(n))
|
|
2427
|
+
return X(n), !0;
|
|
2428
|
+
const d = _(Xt(n));
|
|
2429
|
+
if (A = Je(x.uponSanitizeElement, A, Qt, Ot), Y(x.uponSanitizeElement, n, {
|
|
2427
2430
|
tagName: d,
|
|
2428
2431
|
allowedTags: A
|
|
2429
|
-
}),
|
|
2432
|
+
}), mt(n, a)) return !0;
|
|
2430
2433
|
if (on(n, d))
|
|
2431
|
-
return
|
|
2432
|
-
if (
|
|
2434
|
+
return X(n), !0;
|
|
2435
|
+
if (Tt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !A[d]) {
|
|
2433
2436
|
const p = nn(n, d, a);
|
|
2434
|
-
return p === !1 && (
|
|
2437
|
+
return p === !1 && (Y(x.afterSanitizeElements, n, null), mt(n, a)) ? !0 : p;
|
|
2435
2438
|
}
|
|
2436
|
-
if (
|
|
2437
|
-
return
|
|
2438
|
-
if (
|
|
2439
|
-
const p =
|
|
2440
|
-
n.textContent !== p && (
|
|
2439
|
+
if (Et(n) === F.element && !Qo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && D(qn, n.innerHTML))
|
|
2440
|
+
return X(n), !0;
|
|
2441
|
+
if (V && n.nodeType === F.text) {
|
|
2442
|
+
const p = Ut(n.textContent);
|
|
2443
|
+
n.textContent !== p && (At(t.removed, { element: n.cloneNode() }), n.textContent = p);
|
|
2441
2444
|
}
|
|
2442
|
-
return
|
|
2445
|
+
return Y(x.afterSanitizeElements, n, null), mt(n, a);
|
|
2443
2446
|
}, to = function(n, a, d) {
|
|
2444
2447
|
if (Ie[a] || Ve(a, n) || Ne && (a === "id" || a === "name") && (d in e || d in Vo)) return !1;
|
|
2445
|
-
const p = C[a] ||
|
|
2446
|
-
return
|
|
2447
|
-
}, rn =
|
|
2448
|
+
const p = C[a] || q.attributeCheck instanceof Function && q.attributeCheck(a, n);
|
|
2449
|
+
return ee && D(Uo, a) || De && D(jo, a) ? !0 : p ? Ue[a] || D(Me, Ct(d, Le, "")) || (a === "src" || a === "xlink:href" || a === "href") && n !== "script" && lo(d, "data:") === 0 && He[n] || Oe && !D(Wo, Ct(d, Le, "")) ? !0 : !d : eo(n) && Wt(G.tagNameCheck, n) && Wt(G.attributeNameCheck, a, n) || a === "is" && G.allowCustomizedBuiltInElements && Wt(G.tagNameCheck, d);
|
|
2450
|
+
}, rn = v({}, [
|
|
2448
2451
|
"annotation-xml",
|
|
2449
2452
|
"color-profile",
|
|
2450
2453
|
"font-face",
|
|
@@ -2454,26 +2457,26 @@ function Lo() {
|
|
|
2454
2457
|
"font-face-uri",
|
|
2455
2458
|
"missing-glyph"
|
|
2456
2459
|
]), eo = function(n) {
|
|
2457
|
-
return !rn[
|
|
2460
|
+
return !rn[Mt(n)] && D($o, n);
|
|
2458
2461
|
}, an = function(n, a, d, p) {
|
|
2459
|
-
if (
|
|
2462
|
+
if (N && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n, a)) {
|
|
2460
2463
|
case "TrustedHTML":
|
|
2461
|
-
return
|
|
2464
|
+
return lt(p);
|
|
2462
2465
|
case "TrustedScriptURL":
|
|
2463
2466
|
return Oo(p);
|
|
2464
2467
|
}
|
|
2465
2468
|
return p;
|
|
2466
2469
|
}, sn = function(n, a, d, p) {
|
|
2467
2470
|
try {
|
|
2468
|
-
return d ? n.setAttributeNS(d, a, p) : n.setAttribute(a, p),
|
|
2471
|
+
return d ? n.setAttributeNS(d, a, p) : n.setAttribute(a, p), jt(n) ? (X(n), !1) : !0;
|
|
2469
2472
|
} catch (h) {
|
|
2470
|
-
return
|
|
2473
|
+
return it(a, n), !1;
|
|
2471
2474
|
}
|
|
2472
2475
|
}, oo = function(n, a) {
|
|
2473
|
-
if (
|
|
2476
|
+
if (Y(x.beforeSanitizeAttributes, n, null), mt(n, a)) return;
|
|
2474
2477
|
const d = n.attributes;
|
|
2475
|
-
if (!d ||
|
|
2476
|
-
C = Je(x.uponSanitizeAttribute, C,
|
|
2478
|
+
if (!d || jt(n)) return;
|
|
2479
|
+
C = Je(x.uponSanitizeAttribute, C, te, Rt);
|
|
2477
2480
|
const p = {
|
|
2478
2481
|
attrName: "",
|
|
2479
2482
|
attrValue: "",
|
|
@@ -2484,43 +2487,43 @@ function Lo() {
|
|
|
2484
2487
|
let h = d.length;
|
|
2485
2488
|
const b = _(n.nodeName);
|
|
2486
2489
|
for (; h--; ) {
|
|
2487
|
-
const y = d[h], S = y.name,
|
|
2488
|
-
let R = S === "value" ?
|
|
2489
|
-
if (p.attrName =
|
|
2490
|
-
|
|
2490
|
+
const y = d[h], S = y.name, j = y.namespaceURI, H = y.value, gt = _(S), fe = H;
|
|
2491
|
+
let R = S === "value" ? fe : Mn(fe), no = !1;
|
|
2492
|
+
if (p.attrName = gt, p.attrValue = R, p.keepAttr = !0, p.forceKeepAttr = void 0, Y(x.uponSanitizeAttribute, n, p), R = p.attrValue, Pe && (gt === "id" || gt === "name") && lo(R, ze) !== 0 && (it(S, n, y), R = ze + R, no = !0), ot && D(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
|
|
2493
|
+
it(S, n, y);
|
|
2491
2494
|
continue;
|
|
2492
2495
|
}
|
|
2493
|
-
if (
|
|
2494
|
-
|
|
2496
|
+
if (gt === "attributename" && so(R, "href")) {
|
|
2497
|
+
it(S, n, y);
|
|
2495
2498
|
continue;
|
|
2496
2499
|
}
|
|
2497
2500
|
if (!p.forceKeepAttr) {
|
|
2498
2501
|
if (!p.keepAttr) {
|
|
2499
|
-
|
|
2502
|
+
it(S, n, y);
|
|
2500
2503
|
continue;
|
|
2501
2504
|
}
|
|
2502
2505
|
if (!Re && D(Vn, R)) {
|
|
2503
|
-
|
|
2506
|
+
it(S, n, y);
|
|
2504
2507
|
continue;
|
|
2505
2508
|
}
|
|
2506
|
-
if (
|
|
2507
|
-
|
|
2509
|
+
if (V && (R = Ut(R)), !to(b, gt, R)) {
|
|
2510
|
+
it(S, n, y);
|
|
2508
2511
|
continue;
|
|
2509
2512
|
}
|
|
2510
|
-
R = an(b,
|
|
2513
|
+
R = an(b, gt, j, R), R !== fe && sn(n, S, j, R) && no && ao(t.removed);
|
|
2511
2514
|
}
|
|
2512
2515
|
}
|
|
2513
|
-
|
|
2514
|
-
},
|
|
2516
|
+
Y(x.afterSanitizeAttributes, n, null), mt(n, a);
|
|
2517
|
+
}, $t = function(n) {
|
|
2515
2518
|
let a = null;
|
|
2516
2519
|
const d = Ze(n);
|
|
2517
|
-
for (
|
|
2518
|
-
if (
|
|
2519
|
-
const p =
|
|
2520
|
-
|
|
2520
|
+
for (Y(x.beforeSanitizeShadowDOM, n, null); a = d.nextNode(); )
|
|
2521
|
+
if (Y(x.uponSanitizeShadowNode, a, null), Qe(a, n), oo(a, n), ht(a.content) && $t(a.content), Et(a) === F.element) {
|
|
2522
|
+
const p = at(a);
|
|
2523
|
+
ht(p) && (pe(p), $t(p));
|
|
2521
2524
|
}
|
|
2522
|
-
|
|
2523
|
-
},
|
|
2525
|
+
Y(x.afterSanitizeShadowDOM, n, null);
|
|
2526
|
+
}, pe = function(n) {
|
|
2524
2527
|
const a = [{
|
|
2525
2528
|
node: n,
|
|
2526
2529
|
shadow: null
|
|
@@ -2528,27 +2531,27 @@ function Lo() {
|
|
|
2528
2531
|
for (; a.length > 0; ) {
|
|
2529
2532
|
const d = a.pop();
|
|
2530
2533
|
if (d.shadow) {
|
|
2531
|
-
|
|
2534
|
+
$t(d.shadow);
|
|
2532
2535
|
continue;
|
|
2533
2536
|
}
|
|
2534
|
-
const p = d.node, h =
|
|
2537
|
+
const p = d.node, h = Et(p) === F.element, b = $(p);
|
|
2535
2538
|
if (b) for (let y = b.length - 1; y >= 0; --y) a.push({
|
|
2536
2539
|
node: b[y],
|
|
2537
2540
|
shadow: null
|
|
2538
2541
|
});
|
|
2539
2542
|
if (h) {
|
|
2540
|
-
const y =
|
|
2543
|
+
const y = st ? st(p) : null;
|
|
2541
2544
|
if (typeof y == "string" && _(y) === "template") {
|
|
2542
2545
|
const S = p.content;
|
|
2543
|
-
|
|
2546
|
+
ht(S) && a.push({
|
|
2544
2547
|
node: S,
|
|
2545
2548
|
shadow: null
|
|
2546
2549
|
});
|
|
2547
2550
|
}
|
|
2548
2551
|
}
|
|
2549
2552
|
if (h) {
|
|
2550
|
-
const y =
|
|
2551
|
-
|
|
2553
|
+
const y = at(p);
|
|
2554
|
+
ht(y) && a.push({
|
|
2552
2555
|
node: null,
|
|
2553
2556
|
shadow: y
|
|
2554
2557
|
}, {
|
|
@@ -2560,72 +2563,72 @@ function Lo() {
|
|
|
2560
2563
|
};
|
|
2561
2564
|
return t.sanitize = function(u) {
|
|
2562
2565
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = null, d = null, p = null, h = null;
|
|
2563
|
-
if (
|
|
2564
|
-
throw
|
|
2566
|
+
if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !xt(u) && (u = Nn(u), typeof u != "string"))
|
|
2567
|
+
throw Z("dirty is not a string, aborting");
|
|
2565
2568
|
if (!t.isSupported) return u;
|
|
2566
|
-
|
|
2567
|
-
const b =
|
|
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" && xt(u);
|
|
2568
2571
|
if (b) {
|
|
2569
2572
|
en(u);
|
|
2570
|
-
const
|
|
2571
|
-
if (typeof
|
|
2572
|
-
const H = _(
|
|
2573
|
-
if (!A[H] ||
|
|
2574
|
-
throw
|
|
2573
|
+
const j = Xt(u);
|
|
2574
|
+
if (typeof j == "string") {
|
|
2575
|
+
const H = _(j);
|
|
2576
|
+
if (!A[H] || Tt[H])
|
|
2577
|
+
throw Ht(u), Z("root node is forbidden and cannot be sanitized in-place");
|
|
2575
2578
|
}
|
|
2576
|
-
if (
|
|
2577
|
-
throw
|
|
2579
|
+
if (jt(u))
|
|
2580
|
+
throw Ht(u), Z("root node is clobbered and cannot be sanitized in-place");
|
|
2578
2581
|
try {
|
|
2579
|
-
|
|
2582
|
+
pe(u);
|
|
2580
2583
|
} catch (H) {
|
|
2581
|
-
throw
|
|
2584
|
+
throw Ht(u), H;
|
|
2582
2585
|
}
|
|
2583
|
-
} else if (
|
|
2584
|
-
a = Xe("<!---->"), d = a.ownerDocument.importNode(u, !0), d.nodeType ===
|
|
2586
|
+
} else if (xt(u))
|
|
2587
|
+
a = Xe("<!---->"), d = a.ownerDocument.importNode(u, !0), d.nodeType === F.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? a = d : a.appendChild(d), pe(a);
|
|
2585
2588
|
else {
|
|
2586
|
-
if (!
|
|
2587
|
-
if (a = Xe(u), !a) return
|
|
2589
|
+
if (!ct && !V && !nt && u.indexOf("<") === -1) return N && Pt ? lt(u) : u;
|
|
2590
|
+
if (a = Xe(u), !a) return ct ? null : Pt ? et : "";
|
|
2588
2591
|
}
|
|
2589
|
-
a &&
|
|
2592
|
+
a && ne && X(a.firstChild);
|
|
2590
2593
|
const y = b ? u : a;
|
|
2591
2594
|
try {
|
|
2592
|
-
const
|
|
2593
|
-
for (; p =
|
|
2594
|
-
Qe(p, y), oo(p, y),
|
|
2595
|
-
} catch (
|
|
2596
|
-
throw b && (
|
|
2597
|
-
H.element &&
|
|
2598
|
-
})),
|
|
2595
|
+
const j = Ze(y);
|
|
2596
|
+
for (; p = j.nextNode(); )
|
|
2597
|
+
Qe(p, y), oo(p, y), ht(p.content) && $t(p.content);
|
|
2598
|
+
} catch (j) {
|
|
2599
|
+
throw b && (Ht(u), rt(t.removed, (H) => {
|
|
2600
|
+
H.element && Ft(H.element);
|
|
2601
|
+
})), j;
|
|
2599
2602
|
}
|
|
2600
2603
|
if (b) {
|
|
2601
|
-
let
|
|
2602
|
-
if (
|
|
2603
|
-
H.element && (H.element === u && (
|
|
2604
|
-
}),
|
|
2605
|
-
return
|
|
2606
|
-
}
|
|
2607
|
-
if (
|
|
2608
|
-
if (
|
|
2604
|
+
let j = !1;
|
|
2605
|
+
if (rt(t.removed, (H) => {
|
|
2606
|
+
H.element && (H.element === u && (j = !0), Ft(H.element));
|
|
2607
|
+
}), j) throw Z("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
2608
|
+
return V && ue(u), u;
|
|
2609
|
+
}
|
|
2610
|
+
if (ct) {
|
|
2611
|
+
if (V && ue(a), Nt)
|
|
2609
2612
|
for (h = No.call(a.ownerDocument); a.firstChild; ) h.appendChild(a.firstChild);
|
|
2610
2613
|
else h = a;
|
|
2611
2614
|
return (C.shadowroot || C.shadowrootmode) && (h = zo.call(o, h, !0)), h;
|
|
2612
2615
|
}
|
|
2613
|
-
let S =
|
|
2614
|
-
return
|
|
2615
|
-
` + S),
|
|
2616
|
+
let S = nt ? a.outerHTML : a.innerHTML;
|
|
2617
|
+
return nt && A["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && D(Kn, a.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
|
|
2618
|
+
` + S), V && (S = Ut(S)), N && Pt ? lt(S) : S;
|
|
2616
2619
|
}, t.setConfig = function() {
|
|
2617
2620
|
let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2618
|
-
|
|
2621
|
+
de(u), oe = !0, Ot = A, Rt = C;
|
|
2619
2622
|
}, t.clearConfig = function() {
|
|
2620
|
-
|
|
2623
|
+
ft = null, oe = !1, Ot = null, Rt = null, N = Zt, et = "";
|
|
2621
2624
|
}, t.isValidAttribute = function(u, n, a) {
|
|
2622
|
-
|
|
2625
|
+
ft || de({});
|
|
2623
2626
|
const d = _(u), p = _(n);
|
|
2624
2627
|
return to(d, p, a);
|
|
2625
2628
|
}, t.addHook = function(u, n) {
|
|
2626
|
-
typeof n == "function" &&
|
|
2629
|
+
typeof n == "function" && P(x, u) && At(x[u], n);
|
|
2627
2630
|
}, t.removeHook = function(u, n) {
|
|
2628
|
-
if (
|
|
2631
|
+
if (P(x, u)) {
|
|
2629
2632
|
if (n !== void 0) {
|
|
2630
2633
|
const a = _n(x[u], n);
|
|
2631
2634
|
return a === -1 ? void 0 : Ln(x[u], a, 1)[0];
|
|
@@ -2633,12 +2636,12 @@ function Lo() {
|
|
|
2633
2636
|
return ao(x[u]);
|
|
2634
2637
|
}
|
|
2635
2638
|
}, t.removeHooks = function(u) {
|
|
2636
|
-
|
|
2639
|
+
P(x, u) && (x[u] = []);
|
|
2637
2640
|
}, t.removeAllHooks = function() {
|
|
2638
|
-
x =
|
|
2641
|
+
x = vo();
|
|
2639
2642
|
}, t;
|
|
2640
2643
|
}
|
|
2641
|
-
var
|
|
2644
|
+
var Kt = Lo();
|
|
2642
2645
|
const ti = [
|
|
2643
2646
|
"p",
|
|
2644
2647
|
"br",
|
|
@@ -2719,28 +2722,28 @@ function Mo(s, t, e, o) {
|
|
|
2719
2722
|
if ((t == null ? void 0 : t.sanitize) === !1)
|
|
2720
2723
|
return s;
|
|
2721
2724
|
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ti, 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 : ei, f = /* @__PURE__ */ new Set();
|
|
2722
|
-
for (const
|
|
2723
|
-
for (const
|
|
2725
|
+
for (const w of Object.values(c))
|
|
2726
|
+
for (const T of w) f.add(T);
|
|
2724
2727
|
const m = {
|
|
2725
2728
|
ALLOWED_TAGS: r,
|
|
2726
2729
|
ALLOWED_ATTR: Array.from(f)
|
|
2727
2730
|
};
|
|
2728
2731
|
if (!o)
|
|
2729
|
-
return
|
|
2732
|
+
return Kt.sanitize(s, m);
|
|
2730
2733
|
const g = r.includes("iframe");
|
|
2731
|
-
|
|
2734
|
+
Kt.addHook(
|
|
2732
2735
|
"uponSanitizeElement",
|
|
2733
|
-
(
|
|
2734
|
-
var
|
|
2735
|
-
if (
|
|
2736
|
-
const
|
|
2737
|
-
|
|
2736
|
+
(w, T) => {
|
|
2737
|
+
var k;
|
|
2738
|
+
if (T.tagName !== "iframe") return;
|
|
2739
|
+
const E = w;
|
|
2740
|
+
T.allowedTags.iframe = g || ((k = E.getAttribute) == null ? void 0 : k.call(E, oi)) === "true" && ni(E.getAttribute("src"));
|
|
2738
2741
|
}
|
|
2739
2742
|
);
|
|
2740
2743
|
try {
|
|
2741
|
-
return
|
|
2744
|
+
return Kt.sanitize(s, m);
|
|
2742
2745
|
} finally {
|
|
2743
|
-
|
|
2746
|
+
Kt.removeHook("uponSanitizeElement");
|
|
2744
2747
|
}
|
|
2745
2748
|
}
|
|
2746
2749
|
function ii(s, t, e, o) {
|
|
@@ -2749,7 +2752,7 @@ function ii(s, t, e, o) {
|
|
|
2749
2752
|
function ri(s, t, e) {
|
|
2750
2753
|
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? s : ii(s, t);
|
|
2751
2754
|
}
|
|
2752
|
-
function
|
|
2755
|
+
function Eo(s, t, e, o) {
|
|
2753
2756
|
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? s : Mo(s, t, o, !0);
|
|
2754
2757
|
}
|
|
2755
2758
|
const ai = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", si = /resize-handle|data-rte-media-pending|rte-media/;
|
|
@@ -2771,10 +2774,10 @@ function Io(s) {
|
|
|
2771
2774
|
i && (i.removeAttribute("contenteditable"), !((r = i.textContent) != null && r.trim()) && !i.querySelector("img, video, a") && i.remove());
|
|
2772
2775
|
}), t.innerHTML;
|
|
2773
2776
|
}
|
|
2774
|
-
function
|
|
2777
|
+
function _t(s) {
|
|
2775
2778
|
return s ? Io(s.innerHTML) : "";
|
|
2776
2779
|
}
|
|
2777
|
-
const
|
|
2780
|
+
const Vt = class Vt {
|
|
2778
2781
|
/**
|
|
2779
2782
|
* Resolve configuration from multiple sources with priority
|
|
2780
2783
|
*/
|
|
@@ -2966,7 +2969,7 @@ const Yt = class Yt {
|
|
|
2966
2969
|
return e;
|
|
2967
2970
|
}
|
|
2968
2971
|
};
|
|
2969
|
-
|
|
2972
|
+
Vt.EDITOR_DEFAULTS = {
|
|
2970
2973
|
height: 400,
|
|
2971
2974
|
width: "100%",
|
|
2972
2975
|
readonly: !1,
|
|
@@ -3015,7 +3018,7 @@ Yt.EDITOR_DEFAULTS = {
|
|
|
3015
3018
|
sanitizeOnInput: !0
|
|
3016
3019
|
},
|
|
3017
3020
|
statusbar: !1
|
|
3018
|
-
},
|
|
3021
|
+
}, Vt.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
3019
3022
|
"readonly",
|
|
3020
3023
|
"disabled",
|
|
3021
3024
|
"autofocus",
|
|
@@ -3035,7 +3038,7 @@ Yt.EDITOR_DEFAULTS = {
|
|
|
3035
3038
|
"security-sanitize-on-paste",
|
|
3036
3039
|
"security-sanitize-on-input"
|
|
3037
3040
|
]);
|
|
3038
|
-
let
|
|
3041
|
+
let xe = Vt;
|
|
3039
3042
|
class li {
|
|
3040
3043
|
constructor() {
|
|
3041
3044
|
this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
|
|
@@ -3110,10 +3113,10 @@ class li {
|
|
|
3110
3113
|
return this.loadedPlugins.has(t);
|
|
3111
3114
|
}
|
|
3112
3115
|
}
|
|
3113
|
-
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}}';
|
|
3114
|
-
let
|
|
3115
|
-
const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", wo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", To = ".rte-content, .editora-content", pi = "Rich text editor",
|
|
3116
|
-
let
|
|
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}}';
|
|
3117
|
+
let Yt;
|
|
3118
|
+
const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", wo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", To = ".rte-content, .editora-content", pi = "Rich text editor", Ae = /* @__PURE__ */ new Set();
|
|
3119
|
+
let Q = null, ko = !1, Ee = null, we = null;
|
|
3117
3120
|
function xo(s) {
|
|
3118
3121
|
if (!(s instanceof HTMLElement)) return !1;
|
|
3119
3122
|
const t = s;
|
|
@@ -3122,7 +3125,7 @@ function xo(s) {
|
|
|
3122
3125
|
function fi(s) {
|
|
3123
3126
|
return s ? s.nodeType === Node.ELEMENT_NODE ? s : s.parentElement : null;
|
|
3124
3127
|
}
|
|
3125
|
-
function
|
|
3128
|
+
function Lt(s) {
|
|
3126
3129
|
if (!s) return null;
|
|
3127
3130
|
if (xo(s))
|
|
3128
3131
|
return s;
|
|
@@ -3134,41 +3137,41 @@ function hi() {
|
|
|
3134
3137
|
if (typeof window == "undefined") return null;
|
|
3135
3138
|
const s = window[di];
|
|
3136
3139
|
if (s instanceof HTMLElement) {
|
|
3137
|
-
const r =
|
|
3140
|
+
const r = Lt(s);
|
|
3138
3141
|
if (r) return r;
|
|
3139
3142
|
const l = s.matches(To) ? s : s.querySelector(To);
|
|
3140
3143
|
if (l) {
|
|
3141
|
-
const c =
|
|
3144
|
+
const c = Lt(l);
|
|
3142
3145
|
if (c) return c;
|
|
3143
3146
|
}
|
|
3144
3147
|
}
|
|
3145
3148
|
const t = window[ui];
|
|
3146
3149
|
if (t instanceof HTMLElement) {
|
|
3147
|
-
const r =
|
|
3150
|
+
const r = Lt(t);
|
|
3148
3151
|
if (r) return r;
|
|
3149
3152
|
}
|
|
3150
3153
|
const e = document.activeElement;
|
|
3151
3154
|
if (e) {
|
|
3152
|
-
const r =
|
|
3155
|
+
const r = Lt(e);
|
|
3153
3156
|
if (r) return r;
|
|
3154
3157
|
}
|
|
3155
3158
|
const o = (i = window.getSelection) == null ? void 0 : i.call(window);
|
|
3156
3159
|
if (o && o.rangeCount > 0) {
|
|
3157
|
-
const r =
|
|
3160
|
+
const r = Lt(fi(o.getRangeAt(0).startContainer));
|
|
3158
3161
|
if (r) return r;
|
|
3159
3162
|
}
|
|
3160
|
-
if (
|
|
3161
|
-
return
|
|
3162
|
-
for (const r of
|
|
3163
|
+
if (Q && Q.isConnected)
|
|
3164
|
+
return Q;
|
|
3165
|
+
for (const r of Ae)
|
|
3163
3166
|
if (r.isConnected) return r;
|
|
3164
3167
|
return null;
|
|
3165
3168
|
}
|
|
3166
3169
|
function mi() {
|
|
3167
3170
|
if (typeof window == "undefined" || ko) return;
|
|
3168
|
-
Ee = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null,
|
|
3171
|
+
Ee = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, we = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
|
|
3169
3172
|
const s = (t, ...e) => {
|
|
3170
3173
|
const o = hi();
|
|
3171
|
-
return o ? o.execCommand(t, ...e) : Ee ? Ee(t, ...e) :
|
|
3174
|
+
return o ? o.execCommand(t, ...e) : Ee ? Ee(t, ...e) : we ? we(t, ...e) : !1;
|
|
3172
3175
|
};
|
|
3173
3176
|
window.executeEditorCommand = s, window.execEditorCommand = s, ko = !0;
|
|
3174
3177
|
}
|
|
@@ -3180,11 +3183,11 @@ function gi() {
|
|
|
3180
3183
|
}
|
|
3181
3184
|
}
|
|
3182
3185
|
function Do() {
|
|
3183
|
-
if (!
|
|
3184
|
-
const s =
|
|
3185
|
-
s ?
|
|
3186
|
+
if (!Yt) {
|
|
3187
|
+
const s = yt.__globalPluginLoader;
|
|
3188
|
+
s ? Yt = s : Yt = new li();
|
|
3186
3189
|
}
|
|
3187
|
-
return
|
|
3190
|
+
return Yt;
|
|
3188
3191
|
}
|
|
3189
3192
|
function yi(s) {
|
|
3190
3193
|
const t = Do();
|
|
@@ -3192,9 +3195,9 @@ function yi(s) {
|
|
|
3192
3195
|
t.register(e, o);
|
|
3193
3196
|
});
|
|
3194
3197
|
}
|
|
3195
|
-
class
|
|
3198
|
+
class yt extends HTMLElement {
|
|
3196
3199
|
constructor() {
|
|
3197
|
-
if (super(), this.pluginLoader = Do(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new cn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, gi(), !this.hasAttribute("data-initial-content")) {
|
|
3200
|
+
if (super(), this.pluginLoader = Do(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new cn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, gi(), !this.hasAttribute("data-initial-content")) {
|
|
3198
3201
|
const t = this.innerHTML.trim();
|
|
3199
3202
|
t && this.setAttribute("data-initial-content", t);
|
|
3200
3203
|
}
|
|
@@ -3261,13 +3264,13 @@ class gt extends HTMLElement {
|
|
|
3261
3264
|
* Wait for the global plugin loader to be available
|
|
3262
3265
|
*/
|
|
3263
3266
|
async waitForPluginLoader() {
|
|
3264
|
-
if (
|
|
3265
|
-
this.pluginLoader =
|
|
3267
|
+
if (yt.__globalPluginLoader) {
|
|
3268
|
+
this.pluginLoader = yt.__globalPluginLoader;
|
|
3266
3269
|
return;
|
|
3267
3270
|
}
|
|
3268
3271
|
return new Promise((t) => {
|
|
3269
3272
|
const e = () => {
|
|
3270
|
-
|
|
3273
|
+
yt.__globalPluginLoader ? (this.pluginLoader = yt.__globalPluginLoader, t()) : setTimeout(e, 0);
|
|
3271
3274
|
};
|
|
3272
3275
|
e();
|
|
3273
3276
|
});
|
|
@@ -3294,31 +3297,33 @@ class gt extends HTMLElement {
|
|
|
3294
3297
|
* Initialize the editor
|
|
3295
3298
|
*/
|
|
3296
3299
|
async initialize() {
|
|
3297
|
-
var
|
|
3300
|
+
var r;
|
|
3298
3301
|
if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3302
|
+
const t = ++this.buildGeneration;
|
|
3303
|
+
this.setAttribute("data-editora-editor", "true"), Ae.add(this), Q || (Q = this), mi(), 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.config.theme && this.classList.add(`editora-theme-${this.config.theme}`), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
|
|
3304
|
+
const e = await this.loadPlugins();
|
|
3305
|
+
if (t !== this.buildGeneration || !this.isConnected) return;
|
|
3306
|
+
if (this.loadedPlugins = e, e.forEach((l) => {
|
|
3307
|
+
if (l.init && typeof l.init == "function")
|
|
3303
3308
|
try {
|
|
3304
|
-
|
|
3305
|
-
} catch (
|
|
3306
|
-
console.error(`[RichTextEditor] Error initializing plugin ${
|
|
3309
|
+
l.init({ editorElement: this });
|
|
3310
|
+
} catch (c) {
|
|
3311
|
+
console.error(`[RichTextEditor] Error initializing plugin ${l.name}:`, c);
|
|
3307
3312
|
}
|
|
3308
3313
|
}), !this.hasAttribute("data-initial-content") && !this.contentElement) {
|
|
3309
|
-
const
|
|
3310
|
-
|
|
3314
|
+
const l = this.innerHTML.trim();
|
|
3315
|
+
l && this.setAttribute("data-initial-content", l);
|
|
3311
3316
|
}
|
|
3312
|
-
const
|
|
3317
|
+
const o = this.preservedContent;
|
|
3313
3318
|
this.preservedContent = null;
|
|
3314
|
-
const
|
|
3315
|
-
(
|
|
3319
|
+
const i = this.sanitizeLoadedContent(
|
|
3320
|
+
(r = o != null ? o : this.restoreAutosavedContent()) != null ? r : this.getAttribute("data-initial-content") || ""
|
|
3316
3321
|
);
|
|
3317
3322
|
this.engine = new un({
|
|
3318
|
-
content:
|
|
3319
|
-
plugins:
|
|
3323
|
+
content: i,
|
|
3324
|
+
plugins: e,
|
|
3320
3325
|
readonly: this.config.readonly
|
|
3321
|
-
}), this.createUI(
|
|
3326
|
+
}), 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", {
|
|
3322
3327
|
detail: { api: this.getAPI() },
|
|
3323
3328
|
bubbles: !0
|
|
3324
3329
|
}));
|
|
@@ -3549,7 +3554,7 @@ class gt extends HTMLElement {
|
|
|
3549
3554
|
* editable DOM: sanitizing only after the first edit leaves the page exposed until then.
|
|
3550
3555
|
*/
|
|
3551
3556
|
sanitizeLoadedContent(t) {
|
|
3552
|
-
return
|
|
3557
|
+
return Eo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
|
|
3553
3558
|
}
|
|
3554
3559
|
getAutosaveConfig() {
|
|
3555
3560
|
var e, o;
|
|
@@ -3617,7 +3622,7 @@ class gt extends HTMLElement {
|
|
|
3617
3622
|
this.stopAutosave();
|
|
3618
3623
|
const t = this.getAutosaveConfig();
|
|
3619
3624
|
!t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
|
|
3620
|
-
this.persistAutosave(
|
|
3625
|
+
this.persistAutosave(_t(this.contentElement));
|
|
3621
3626
|
}, t.intervalMs));
|
|
3622
3627
|
}
|
|
3623
3628
|
insertHTMLAtSelection(t) {
|
|
@@ -3711,41 +3716,41 @@ class gt extends HTMLElement {
|
|
|
3711
3716
|
selectionCollapsed: (r = (i = window.getSelection()) == null ? void 0 : i.isCollapsed) != null ? r : !0
|
|
3712
3717
|
});
|
|
3713
3718
|
}), this.contentElement.addEventListener("input", (o) => {
|
|
3714
|
-
var
|
|
3719
|
+
var T;
|
|
3715
3720
|
if (!this.contentElement) return;
|
|
3716
3721
|
let i = this.contentElement.innerHTML;
|
|
3717
|
-
const r = (
|
|
3722
|
+
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;
|
|
3718
3723
|
if (this.lastBeforeInputType = null, f.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
|
|
3719
|
-
const
|
|
3720
|
-
if (
|
|
3721
|
-
const
|
|
3722
|
-
if (this.contentElement.innerHTML =
|
|
3724
|
+
const E = Eo(i, c, f, r);
|
|
3725
|
+
if (E !== i) {
|
|
3726
|
+
const k = window.getSelection(), tt = k && k.rangeCount > 0 ? k.getRangeAt(0) : null;
|
|
3727
|
+
if (this.contentElement.innerHTML = E, tt && k)
|
|
3723
3728
|
try {
|
|
3724
|
-
|
|
3725
|
-
} catch (
|
|
3729
|
+
k.removeAllRanges(), k.addRange(tt);
|
|
3730
|
+
} catch ($) {
|
|
3726
3731
|
}
|
|
3727
|
-
i =
|
|
3732
|
+
i = E;
|
|
3728
3733
|
}
|
|
3729
3734
|
}
|
|
3730
3735
|
this.recordInputHistory(i), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
|
|
3731
|
-
const
|
|
3736
|
+
const w = () => {
|
|
3732
3737
|
this.dispatchEvent(new CustomEvent("content-change", {
|
|
3733
3738
|
detail: { html: Io(i) },
|
|
3734
3739
|
bubbles: !0
|
|
3735
3740
|
}));
|
|
3736
3741
|
};
|
|
3737
|
-
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(
|
|
3742
|
+
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(w, l.debounceInputMs) : w(), this.updateStatusBar();
|
|
3738
3743
|
}), this.contentElement.addEventListener("contextmenu", (o) => {
|
|
3739
3744
|
const i = this.config.contextMenu;
|
|
3740
3745
|
(i === !1 || typeof i == "object" && i !== null && i.enabled === !1) && o.preventDefault();
|
|
3741
3746
|
}), this.contentElement.addEventListener("paste", (o) => {
|
|
3742
|
-
var g,
|
|
3747
|
+
var g, w;
|
|
3743
3748
|
if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
|
|
3744
3749
|
return;
|
|
3745
3750
|
o.preventDefault();
|
|
3746
3751
|
const i = this.config.paste || {};
|
|
3747
3752
|
let r = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
|
|
3748
|
-
const l = ((
|
|
3753
|
+
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);
|
|
3749
3754
|
if ((i.clean || !i.keepFormatting) && l) {
|
|
3750
3755
|
document.execCommand("insertText", !1, l);
|
|
3751
3756
|
return;
|
|
@@ -3760,10 +3765,10 @@ class gt extends HTMLElement {
|
|
|
3760
3765
|
}
|
|
3761
3766
|
l && document.execCommand("insertText", !1, l);
|
|
3762
3767
|
}), this.contentElement.addEventListener("focus", () => {
|
|
3763
|
-
|
|
3768
|
+
Q = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
|
|
3764
3769
|
}), this.contentElement.addEventListener("blur", () => {
|
|
3765
3770
|
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
|
|
3766
|
-
detail: { html:
|
|
3771
|
+
detail: { html: _t(this.contentElement) },
|
|
3767
3772
|
bubbles: !0
|
|
3768
3773
|
})), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
|
|
3769
3774
|
}), this.contentElement.addEventListener("keydown", (o) => {
|
|
@@ -3847,7 +3852,7 @@ class gt extends HTMLElement {
|
|
|
3847
3852
|
const o = this.contentElement.textContent || "", { words: i, chars: r } = yn(o), l = bn(this.contentElement);
|
|
3848
3853
|
let c, f;
|
|
3849
3854
|
const m = this.getSelectionRangeInEditor();
|
|
3850
|
-
m && (c = mn(this.contentElement, m), m.collapsed || (f =
|
|
3855
|
+
m && (c = mn(this.contentElement, m), m.collapsed || (f = vn(m, c), c = void 0)), this.statusBar.update({
|
|
3851
3856
|
wordCount: i,
|
|
3852
3857
|
charCount: r,
|
|
3853
3858
|
lineCount: l,
|
|
@@ -3940,7 +3945,7 @@ class gt extends HTMLElement {
|
|
|
3940
3945
|
const o = this.attributes[e];
|
|
3941
3946
|
t[o.name] = o.value;
|
|
3942
3947
|
}
|
|
3943
|
-
return
|
|
3948
|
+
return xe.resolve({
|
|
3944
3949
|
jsConfig: this.jsConfig,
|
|
3945
3950
|
attributes: t
|
|
3946
3951
|
});
|
|
@@ -3950,7 +3955,7 @@ class gt extends HTMLElement {
|
|
|
3950
3955
|
*/
|
|
3951
3956
|
getAPI() {
|
|
3952
3957
|
return {
|
|
3953
|
-
getContent: () =>
|
|
3958
|
+
getContent: () => _t(this.contentElement),
|
|
3954
3959
|
setContent: (t) => {
|
|
3955
3960
|
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
3956
3961
|
},
|
|
@@ -3978,11 +3983,11 @@ class gt extends HTMLElement {
|
|
|
3978
3983
|
*/
|
|
3979
3984
|
destroy() {
|
|
3980
3985
|
var t, e, o, i;
|
|
3981
|
-
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent =
|
|
3986
|
+
this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = _t(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.isInitialized = !1, Ae.delete(this), Q === this && (Q = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
|
|
3982
3987
|
}
|
|
3983
3988
|
// Public API methods
|
|
3984
3989
|
getContent() {
|
|
3985
|
-
return
|
|
3990
|
+
return _t(this.contentElement);
|
|
3986
3991
|
}
|
|
3987
3992
|
setContent(t) {
|
|
3988
3993
|
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
@@ -4001,28 +4006,28 @@ class gt extends HTMLElement {
|
|
|
4001
4006
|
}
|
|
4002
4007
|
export {
|
|
4003
4008
|
dn as C,
|
|
4004
|
-
|
|
4009
|
+
qt as E,
|
|
4005
4010
|
fn as F,
|
|
4006
4011
|
cn as K,
|
|
4007
4012
|
Ao as P,
|
|
4008
|
-
|
|
4013
|
+
yt as R,
|
|
4009
4014
|
ln as S,
|
|
4010
4015
|
pn as T,
|
|
4011
4016
|
un as a,
|
|
4012
|
-
|
|
4017
|
+
xe as b,
|
|
4013
4018
|
li as c,
|
|
4014
4019
|
hn as d,
|
|
4015
4020
|
yn as e,
|
|
4016
4021
|
bn as f,
|
|
4017
4022
|
bi as g,
|
|
4018
|
-
|
|
4023
|
+
_t as h,
|
|
4019
4024
|
mn as i,
|
|
4020
|
-
|
|
4025
|
+
vn as j,
|
|
4021
4026
|
gn as k,
|
|
4022
|
-
|
|
4027
|
+
Eo as l,
|
|
4023
4028
|
ri as m,
|
|
4024
4029
|
Io as n,
|
|
4025
4030
|
yi as o,
|
|
4026
4031
|
ii as s
|
|
4027
4032
|
};
|
|
4028
|
-
//# sourceMappingURL=index-
|
|
4033
|
+
//# sourceMappingURL=index-8sr_lMjf.mjs.map
|