@editora/core 1.0.16 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- class xo {
1
+ class Co {
2
2
  constructor() {
3
3
  this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
4
4
  }
@@ -84,7 +84,7 @@ class Gt {
84
84
  return new Gt(t, e || this.selection, this.schema);
85
85
  }
86
86
  }
87
- class rn {
87
+ class an {
88
88
  constructor(t, e) {
89
89
  this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
90
90
  }
@@ -95,7 +95,7 @@ class rn {
95
95
  return { type: "text", text: t, marks: e };
96
96
  }
97
97
  }
98
- class an {
98
+ class sn {
99
99
  constructor() {
100
100
  this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
101
101
  }
@@ -132,7 +132,7 @@ class an {
132
132
  const t = {}, e = {};
133
133
  return this.plugins.forEach((n) => {
134
134
  n.nodes && Object.assign(t, n.nodes), n.marks && Object.assign(e, n.marks);
135
- }), new rn(t, e);
135
+ }), new an(t, e);
136
136
  }
137
137
  getCommands() {
138
138
  const t = {};
@@ -186,7 +186,7 @@ class an {
186
186
  await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
187
187
  }
188
188
  }
189
- class sn {
189
+ class ln {
190
190
  constructor(t = {}) {
191
191
  this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, n]) => {
192
192
  this.register(e, n);
@@ -229,11 +229,11 @@ class sn {
229
229
  this.commands.clear();
230
230
  }
231
231
  }
232
- class ln {
232
+ class cn {
233
233
  constructor(t = {}) {
234
- this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new an(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((n) => this.pluginManager.register(n));
234
+ this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new sn(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((n) => this.pluginManager.register(n));
235
235
  const e = this.pluginManager.buildSchema();
236
- this.state = Gt.create(e), this.commandRegistry = new sn(this.pluginManager.getCommands());
236
+ this.state = Gt.create(e), this.commandRegistry = new ln(this.pluginManager.getCommands());
237
237
  }
238
238
  /**
239
239
  * Execute a command
@@ -315,7 +315,7 @@ class ln {
315
315
  return this.isDestroyed;
316
316
  }
317
317
  }
318
- class cn {
318
+ class dn {
319
319
  constructor(t, e, n) {
320
320
  this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (r) => {
321
321
  var l, c;
@@ -407,55 +407,55 @@ class cn {
407
407
  };
408
408
  return n.forEach((c) => {
409
409
  const f = [];
410
- c.split(/\s+/).filter(Boolean).forEach((b) => {
411
- if (b === "direction") {
412
- const k = a.get("setDirectionLTR"), E = a.get("setDirectionRTL");
413
- k && f.push({
410
+ c.split(/\s+/).filter(Boolean).forEach((E) => {
411
+ if (E === "direction") {
412
+ const w = a.get("setDirectionLTR"), v = a.get("setDirectionRTL");
413
+ w && f.push({
414
414
  id: "directionLTR",
415
- label: k.label,
416
- command: k.command,
417
- icon: k.icon,
418
- type: k.type || "button",
419
- options: k.options
420
- }), E && f.push({
415
+ label: w.label,
416
+ command: w.command,
417
+ icon: w.icon,
418
+ type: w.type || "button",
419
+ options: w.options
420
+ }), v && f.push({
421
421
  id: "directionRTL",
422
- label: E.label,
423
- command: E.command,
424
- icon: E.icon,
425
- type: E.type || "button",
426
- options: E.options
422
+ label: v.label,
423
+ command: v.command,
424
+ icon: v.icon,
425
+ type: v.type || "button",
426
+ options: v.options
427
427
  });
428
428
  return;
429
429
  }
430
- if (b === "comments") {
431
- const k = a.get("addComment"), E = a.get("toggleComments");
432
- k && f.push({
430
+ if (E === "comments") {
431
+ const w = a.get("addComment"), v = a.get("toggleComments");
432
+ w && f.push({
433
433
  id: "addComment",
434
- label: k.label,
435
- command: k.command,
436
- icon: k.icon,
437
- type: k.type || "button",
438
- options: k.options
439
- }), E && f.push({
434
+ label: w.label,
435
+ command: w.command,
436
+ icon: w.icon,
437
+ type: w.type || "button",
438
+ options: w.options
439
+ }), v && f.push({
440
440
  id: "toggleComments",
441
- label: E.label,
442
- command: E.command,
443
- icon: E.icon,
444
- type: E.type || "button",
445
- options: E.options
441
+ label: v.label,
442
+ command: v.command,
443
+ icon: v.icon,
444
+ type: v.type || "button",
445
+ options: v.options
446
446
  });
447
447
  return;
448
448
  }
449
- const w = l[b] || b;
450
- let _ = a.get(w);
451
- _ || (_ = a.get(b)), _ && f.push({
452
- id: b,
453
- label: _.label,
454
- command: _.command,
455
- icon: _.icon,
456
- type: _.type === "separator" ? "separator" : _.type || "button",
457
- options: _.options,
458
- items: _.items
449
+ const C = l[E] || E;
450
+ let A = a.get(C);
451
+ A || (A = a.get(E)), A && f.push({
452
+ id: E,
453
+ label: A.label,
454
+ command: A.command,
455
+ icon: A.icon,
456
+ type: A.type === "separator" ? "separator" : A.type || "button",
457
+ options: A.options,
458
+ items: A.items
459
459
  });
460
460
  }), f.length > 0 && e.push(f);
461
461
  }), e;
@@ -503,19 +503,19 @@ class cn {
503
503
  var R;
504
504
  D.parentElement === r && ((R = this.overflowUnitHomes.get(D)) == null || R.appendChild(D));
505
505
  });
506
- const f = t.clientWidth, m = 16, b = 40, w = 4, _ = Math.max(0, f - m - b - w);
507
- let k = 0, E = 0;
506
+ const f = t.clientWidth, m = 16, E = 40, C = 4, A = Math.max(0, f - m - E - C);
507
+ let w = 0, v = 0;
508
508
  for (const D of c) {
509
- const R = D.getBoundingClientRect().width + w;
510
- if (k + R <= _)
511
- k += R, E++;
509
+ const R = D.getBoundingClientRect().width + C;
510
+ if (w + R <= A)
511
+ w += R, v++;
512
512
  else
513
513
  break;
514
514
  }
515
- E = Math.max(1, Math.min(E, c.length));
516
- const Y = E < c.length;
515
+ v = Math.max(1, Math.min(v, c.length));
516
+ const Y = v < c.length;
517
517
  n.style.display = Y ? "" : "none", n.classList.toggle("active", Y && this.expandedOpen), !Y && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((D, R) => {
518
- R >= E && r.appendChild(D);
518
+ R >= v && r.appendChild(D);
519
519
  });
520
520
  }, l = () => {
521
521
  this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(a);
@@ -650,8 +650,8 @@ class cn {
650
650
  const f = (m = this.container) == null ? void 0 : m.querySelectorAll(
651
651
  ".editora-toolbar-dropdown-menu"
652
652
  );
653
- f == null || f.forEach((b) => {
654
- b !== r && (b.style.display = "none");
653
+ f == null || f.forEach((E) => {
654
+ E !== r && (E.style.display = "none");
655
655
  }), r.style.display = r.style.display === "none" ? "block" : "none";
656
656
  });
657
657
  const a = (c) => {
@@ -690,7 +690,7 @@ class cn {
690
690
  }), this.container.innerHTML = ""), (t = this.resizeObserver) == null || t.disconnect(), this.resizeObserver = void 0, this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), document.removeEventListener("mousedown", this.onDocumentPointerDownForOverflow, !0), this.itemsContainer = void 0, this.moreButton = void 0, this.expandedRow = void 0, this.commandHandler = void 0;
691
691
  }
692
692
  }
693
- class dn {
693
+ class un {
694
694
  constructor(t) {
695
695
  this.visible = !1, this.config = t;
696
696
  }
@@ -732,7 +732,7 @@ class dn {
732
732
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
733
733
  }
734
734
  }
735
- class un {
735
+ class pn {
736
736
  constructor(t = {}) {
737
737
  this.statusInfo = {}, this.config = t;
738
738
  }
@@ -792,12 +792,12 @@ class un {
792
792
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
793
793
  }
794
794
  }
795
- function pn(o, t) {
796
- const e = o.textContent || "", n = fn(o, t.startContainer, t.startOffset), a = e.substring(0, n).split(`
795
+ function fn(o, t) {
796
+ const e = o.textContent || "", n = hn(o, t.startContainer, t.startOffset), a = e.substring(0, n).split(`
797
797
  `), l = a.length, c = a[a.length - 1].length + 1;
798
798
  return { line: l, column: c };
799
799
  }
800
- function fn(o, t, e) {
800
+ function hn(o, t, e) {
801
801
  var l;
802
802
  let n = 0;
803
803
  const r = document.createTreeWalker(
@@ -815,7 +815,7 @@ function fn(o, t, e) {
815
815
  }
816
816
  return n;
817
817
  }
818
- function hn(o) {
818
+ function mn(o) {
819
819
  var n, r;
820
820
  const t = o.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
821
821
  let e = 1;
@@ -830,11 +830,11 @@ function hn(o) {
830
830
  }
831
831
  return e;
832
832
  }
833
- function mn(o) {
833
+ function gn(o) {
834
834
  const t = o.trim() ? o.trim().split(/\s+/).length : 0, e = o.length;
835
835
  return { words: t, chars: e };
836
836
  }
837
- function gn(o, t) {
837
+ function bn(o, t) {
838
838
  const e = o.toString();
839
839
  return {
840
840
  startLine: t.line,
@@ -846,7 +846,7 @@ function gn(o, t) {
846
846
  selectedWords: e.trim().split(/\s+/).filter(Boolean).length
847
847
  };
848
848
  }
849
- class bn {
849
+ class yn {
850
850
  constructor(t) {
851
851
  this.shortcuts = /* @__PURE__ */ new Map(), this.enabled = !0, this.isMac = typeof navigator != "undefined" && navigator.platform.toUpperCase().indexOf("MAC") >= 0, (t == null ? void 0 : t.enabled) === !1 && (this.enabled = !1), this.registerDefaultShortcuts(), t != null && t.shortcuts && t.shortcuts.forEach((e) => this.registerShortcut(e)), t != null && t.customShortcuts && Object.values(t.customShortcuts).forEach((e) => {
852
852
  this.registerShortcut(e);
@@ -1186,17 +1186,17 @@ function io(o, t) {
1186
1186
  for (var e = 0, n = Array(t); e < t; e++) n[e] = o[e];
1187
1187
  return n;
1188
1188
  }
1189
- function yn(o) {
1189
+ function vn(o) {
1190
1190
  if (Array.isArray(o)) return o;
1191
1191
  }
1192
- function vn(o, t) {
1192
+ function En(o, t) {
1193
1193
  var e = o == null ? null : typeof Symbol != "undefined" && o[Symbol.iterator] || o["@@iterator"];
1194
1194
  if (e != null) {
1195
1195
  var n, r, a, l, c = [], f = !0, m = !1;
1196
1196
  try {
1197
1197
  if (a = (e = e.call(o)).next, t !== 0) for (; !(f = (n = a.call(e)).done) && (c.push(n.value), c.length !== t); f = !0) ;
1198
- } catch (b) {
1199
- m = !0, r = b;
1198
+ } catch (E) {
1199
+ m = !0, r = E;
1200
1200
  } finally {
1201
1201
  try {
1202
1202
  if (!f && e.return != null && (l = e.return(), Object(l) !== l)) return;
@@ -1207,22 +1207,22 @@ function vn(o, t) {
1207
1207
  return c;
1208
1208
  }
1209
1209
  }
1210
- function En() {
1210
+ function wn() {
1211
1211
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1212
1212
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1213
1213
  }
1214
- function wn(o, t) {
1215
- return yn(o) || vn(o, t) || kn(o, t) || En();
1216
- }
1217
1214
  function kn(o, t) {
1215
+ return vn(o) || En(o, t) || Tn(o, t) || wn();
1216
+ }
1217
+ function Tn(o, t) {
1218
1218
  if (o) {
1219
1219
  if (typeof o == "string") return io(o, t);
1220
1220
  var e = {}.toString.call(o).slice(8, -1);
1221
1221
  return e === "Object" && o.constructor && (e = o.constructor.name), e === "Map" || e === "Set" ? Array.from(o) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? io(o, t) : void 0;
1222
1222
  }
1223
1223
  }
1224
- const Co = Object.entries, ro = Object.setPrototypeOf, Tn = Object.isFrozen, xn = Object.getPrototypeOf, Cn = Object.getOwnPropertyDescriptor;
1225
- let M = Object.freeze, P = Object.seal, gt = Object.create, Ao = typeof Reflect != "undefined" && Reflect, we = Ao.apply, ke = Ao.construct;
1224
+ const Ao = Object.entries, ro = Object.setPrototypeOf, xn = Object.isFrozen, Cn = Object.getPrototypeOf, An = Object.getOwnPropertyDescriptor;
1225
+ let M = Object.freeze, P = Object.seal, gt = Object.create, So = typeof Reflect != "undefined" && Reflect, we = So.apply, ke = So.construct;
1226
1226
  M || (M = function(t) {
1227
1227
  return t;
1228
1228
  });
@@ -1237,7 +1237,7 @@ ke || (ke = function(t) {
1237
1237
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) n[r - 1] = arguments[r];
1238
1238
  return new t(...n);
1239
1239
  });
1240
- const rt = L(Array.prototype.forEach), An = L(Array.prototype.lastIndexOf), ao = L(Array.prototype.pop), Tt = L(Array.prototype.push), Sn = L(Array.prototype.splice), bt = Array.isArray, St = L(String.prototype.toLowerCase), fe = L(String.prototype.toString), so = L(String.prototype.match), xt = L(String.prototype.replace), lo = L(String.prototype.indexOf), _n = L(String.prototype.trim), Ln = L(Number.prototype.toString), Mn = L(Boolean.prototype.toString), co = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), uo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), z = L(Object.prototype.hasOwnProperty), Ct = L(Object.prototype.toString), I = L(RegExp.prototype.test), Z = Pn(TypeError);
1240
+ const rt = L(Array.prototype.forEach), Sn = L(Array.prototype.lastIndexOf), ao = L(Array.prototype.pop), Tt = L(Array.prototype.push), _n = L(Array.prototype.splice), bt = Array.isArray, St = L(String.prototype.toLowerCase), fe = L(String.prototype.toString), so = L(String.prototype.match), xt = L(String.prototype.replace), lo = L(String.prototype.indexOf), Ln = L(String.prototype.trim), Mn = L(Number.prototype.toString), Pn = L(Boolean.prototype.toString), co = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), uo = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), z = L(Object.prototype.hasOwnProperty), Ct = L(Object.prototype.toString), I = L(RegExp.prototype.test), Z = In(TypeError);
1241
1241
  function L(o) {
1242
1242
  return function(t) {
1243
1243
  t instanceof RegExp && (t.lastIndex = 0);
@@ -1245,13 +1245,13 @@ function L(o) {
1245
1245
  return we(o, t, n);
1246
1246
  };
1247
1247
  }
1248
- function Pn(o) {
1248
+ function In(o) {
1249
1249
  return function() {
1250
1250
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++) e[n] = arguments[n];
1251
1251
  return ke(o, e);
1252
1252
  };
1253
1253
  }
1254
- function v(o, t) {
1254
+ function y(o, t) {
1255
1255
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : St;
1256
1256
  if (ro && ro(o, null), !bt(t)) return o;
1257
1257
  let n = t.length;
@@ -1259,33 +1259,33 @@ function v(o, t) {
1259
1259
  let r = t[n];
1260
1260
  if (typeof r == "string") {
1261
1261
  const a = e(r);
1262
- a !== r && (Tn(t) || (t[n] = a), r = a);
1262
+ a !== r && (xn(t) || (t[n] = a), r = a);
1263
1263
  }
1264
1264
  o[r] = !0;
1265
1265
  }
1266
1266
  return o;
1267
1267
  }
1268
- function In(o) {
1268
+ function Dn(o) {
1269
1269
  for (let t = 0; t < o.length; t++) z(o, t) || (o[t] = null);
1270
1270
  return o;
1271
1271
  }
1272
1272
  function H(o) {
1273
1273
  const t = gt(null);
1274
- for (const n of Co(o)) {
1275
- var e = wn(n, 2);
1274
+ for (const n of Ao(o)) {
1275
+ var e = kn(n, 2);
1276
1276
  const r = e[0], a = e[1];
1277
- z(o, r) && (bt(a) ? t[r] = In(a) : a && typeof a == "object" && a.constructor === Object ? t[r] = H(a) : t[r] = a);
1277
+ z(o, r) && (bt(a) ? t[r] = Dn(a) : a && typeof a == "object" && a.constructor === Object ? t[r] = H(a) : t[r] = a);
1278
1278
  }
1279
1279
  return t;
1280
1280
  }
1281
- function Dn(o) {
1281
+ function On(o) {
1282
1282
  switch (typeof o) {
1283
1283
  case "string":
1284
1284
  return o;
1285
1285
  case "number":
1286
- return Ln(o);
1287
- case "boolean":
1288
1286
  return Mn(o);
1287
+ case "boolean":
1288
+ return Pn(o);
1289
1289
  case "bigint":
1290
1290
  return co ? co(o) : "0";
1291
1291
  case "symbol":
@@ -1308,19 +1308,19 @@ function Dn(o) {
1308
1308
  }
1309
1309
  function j(o, t) {
1310
1310
  for (; o !== null; ) {
1311
- const n = Cn(o, t);
1311
+ const n = An(o, t);
1312
1312
  if (n) {
1313
1313
  if (n.get) return L(n.get);
1314
1314
  if (typeof n.value == "function") return L(n.value);
1315
1315
  }
1316
- o = xn(o);
1316
+ o = Cn(o);
1317
1317
  }
1318
1318
  function e() {
1319
1319
  return null;
1320
1320
  }
1321
1321
  return e;
1322
1322
  }
1323
- function On(o) {
1323
+ function Rn(o) {
1324
1324
  try {
1325
1325
  return I(o, ""), !0;
1326
1326
  } catch (t) {
@@ -1521,7 +1521,7 @@ const po = M([
1521
1521
  "feSpotLight",
1522
1522
  "feTile",
1523
1523
  "feTurbulence"
1524
- ]), Rn = M([
1524
+ ]), Nn = M([
1525
1525
  "animate",
1526
1526
  "color-profile",
1527
1527
  "cursor",
@@ -1575,7 +1575,7 @@ const po = M([
1575
1575
  "munder",
1576
1576
  "munderover",
1577
1577
  "mprescripts"
1578
- ]), Nn = M([
1578
+ ]), zn = M([
1579
1579
  "maction",
1580
1580
  "maligngroup",
1581
1581
  "malignmark",
@@ -1964,7 +1964,7 @@ const po = M([
1964
1964
  "xlink:title",
1965
1965
  "xml:space",
1966
1966
  "xmlns:xlink"
1967
- ]), zn = P(/{{[\w\W]*|^[\w\W]*}}/g), Bn = P(/<%[\w\W]*|^[\w\W]*%>/g), Fn = P(/\${[\w\W]*/g), Hn = P(/^data-[\-\w.\u00B7-\uFFFF]+$/), Un = P(/^aria-[\-\w]+$/), go = P(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), jn = P(/^(?:\w+script|data):/i), Wn = P(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), $n = P(/^html$/i), Gn = P(/^[a-z][.\w]*(-[.\w]+)+$/i), bo = P(/<[/\w!]/g), yo = P(/<[/\w]/g), Kn = P(/<\/no(script|embed|frames)/i), Yn = P(/\/>/i), F = {
1967
+ ]), Bn = P(/{{[\w\W]*|^[\w\W]*}}/g), Fn = P(/<%[\w\W]*|^[\w\W]*%>/g), Hn = P(/\${[\w\W]*/g), Un = P(/^data-[\-\w.\u00B7-\uFFFF]+$/), jn = P(/^aria-[\-\w]+$/), go = P(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Wn = P(/^(?:\w+script|data):/i), $n = P(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Gn = P(/^html$/i), Kn = P(/^[a-z][.\w]*(-[.\w]+)+$/i), bo = P(/<[/\w!]/g), yo = P(/<[/\w]/g), Yn = P(/<\/no(script|embed|frames)/i), qn = P(/\/>/i), F = {
1968
1968
  element: 1,
1969
1969
  attribute: 2,
1970
1970
  text: 3,
@@ -1977,7 +1977,7 @@ const po = M([
1977
1977
  documentType: 10,
1978
1978
  documentFragment: 11,
1979
1979
  notation: 12
1980
- }, So = [
1980
+ }, _o = [
1981
1981
  "style",
1982
1982
  "script",
1983
1983
  "xmp",
@@ -1986,14 +1986,14 @@ const po = M([
1986
1986
  "noframes",
1987
1987
  "plaintext",
1988
1988
  "noscript"
1989
- ], qn = M(v({}, So)), Vn = (function() {
1989
+ ], Vn = M(y({}, _o)), Xn = (function() {
1990
1990
  const o = {};
1991
- return rt(So, (t) => {
1991
+ return rt(_o, (t) => {
1992
1992
  o[t] = P(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
1993
1993
  }), M(o);
1994
- })(), Xn = function() {
1994
+ })(), Zn = function() {
1995
1995
  return typeof window == "undefined" ? null : window;
1996
- }, Zn = function(t, e) {
1996
+ }, Jn = function(t, e) {
1997
1997
  if (typeof t != "object" || typeof t.createPolicy != "function") return null;
1998
1998
  let n = null;
1999
1999
  const r = "data-tt-policy-suffix";
@@ -2024,14 +2024,14 @@ const po = M([
2024
2024
  uponSanitizeShadowNode: []
2025
2025
  };
2026
2026
  }, J = function(t, e, n, r) {
2027
- return z(t, e) && bt(t[e]) ? v(r.base ? H(r.base) : {}, t[e], r.transform) : n;
2027
+ return z(t, e) && bt(t[e]) ? y(r.base ? H(r.base) : {}, t[e], r.transform) : n;
2028
2028
  }, ye = function(t, e, n) {
2029
2029
  const r = z(t, e) ? t[e] : void 0;
2030
2030
  return r && typeof r == "object" ? H(r) : n();
2031
2031
  };
2032
- function _o() {
2033
- let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Xn();
2034
- const t = (u) => _o(u);
2032
+ function Lo() {
2033
+ let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Zn();
2034
+ const t = (u) => Lo(u);
2035
2035
  if (t.version = "3.4.16", t.removed = [], !o || !o.document || o.document.nodeType !== F.document || !o.Element)
2036
2036
  return t.isSupported = !1, t;
2037
2037
  let e = o.document;
@@ -2039,7 +2039,7 @@ function _o() {
2039
2039
  o.DocumentFragment;
2040
2040
  const a = o.HTMLTemplateElement, l = o.Node, c = o.Element, f = o.NodeFilter;
2041
2041
  o.NamedNodeMap === void 0 && (o.NamedNodeMap || o.MozNamedAttrMap), o.HTMLFormElement;
2042
- const m = o.DOMParser, b = o.trustedTypes, w = c.prototype, _ = j(w, "cloneNode"), k = j(w, "remove"), E = j(w, "removeAttributeNode"), Y = j(w, "nextSibling"), D = j(w, "childNodes"), R = j(w, "parentNode"), Ce = j(w, "shadowRoot"), qt = j(w, "attributes"), tt = l && l.prototype ? j(l.prototype, "nodeType") : null, at = l && l.prototype ? j(l.prototype, "nodeName") : null, _t = l && l.prototype ? j(l.prototype, "ownerDocument") : null, yt = function(i) {
2042
+ const m = o.DOMParser, E = o.trustedTypes, C = c.prototype, A = j(C, "cloneNode"), w = j(C, "remove"), v = j(C, "removeAttributeNode"), Y = j(C, "nextSibling"), D = j(C, "childNodes"), R = j(C, "parentNode"), Ce = j(C, "shadowRoot"), qt = j(C, "attributes"), tt = l && l.prototype ? j(l.prototype, "nodeType") : null, at = l && l.prototype ? j(l.prototype, "nodeName") : null, _t = l && l.prototype ? j(l.prototype, "ownerDocument") : null, yt = function(i) {
2043
2043
  return tt ? tt(i) : i.nodeType;
2044
2044
  }, Vt = function(i) {
2045
2045
  return at ? at(i) : i.nodeName;
@@ -2058,29 +2058,29 @@ function _o() {
2058
2058
  } finally {
2059
2059
  vt--;
2060
2060
  }
2061
- }, Mo = function(i) {
2061
+ }, Po = function(i) {
2062
2062
  Se(), vt++;
2063
2063
  try {
2064
2064
  return N.createScriptURL(i);
2065
2065
  } finally {
2066
2066
  vt--;
2067
2067
  }
2068
- }, Po = function() {
2069
- return Ae || (Xt = Zn(b, r), Ae = !0), Xt;
2070
- }, Lt = e, Zt = Lt.implementation, _e = Lt.createNodeIterator, Io = Lt.createDocumentFragment, Do = Lt.getElementsByTagName, Oo = n.importNode;
2071
- let T = vo();
2072
- t.isSupported = typeof Co == "function" && typeof R == "function" && Zt && Zt.createHTMLDocument !== void 0;
2073
- const Ro = zn, No = Bn, zo = Fn, Bo = Hn, Fo = Un, Ho = jn, Le = Wn, Uo = Gn;
2074
- let Me = go, x = null;
2075
- const Jt = v({}, [
2068
+ }, Io = function() {
2069
+ return Ae || (Xt = Jn(E, r), Ae = !0), Xt;
2070
+ }, Lt = e, Zt = Lt.implementation, _e = Lt.createNodeIterator, Do = Lt.createDocumentFragment, Oo = Lt.getElementsByTagName, Ro = n.importNode;
2071
+ let k = vo();
2072
+ t.isSupported = typeof Ao == "function" && typeof R == "function" && Zt && Zt.createHTMLDocument !== void 0;
2073
+ const No = Bn, zo = Fn, Bo = Hn, Fo = Un, Ho = jn, Uo = Wn, Le = $n, jo = Kn;
2074
+ let Me = go, T = null;
2075
+ const Jt = y({}, [
2076
2076
  ...po,
2077
2077
  ...he,
2078
2078
  ...me,
2079
2079
  ...ge,
2080
2080
  ...fo
2081
2081
  ]);
2082
- let C = null;
2083
- const Qt = v({}, [
2082
+ let x = null;
2083
+ const Qt = y({}, [
2084
2084
  ...ho,
2085
2085
  ...be,
2086
2086
  ...mo,
@@ -2123,7 +2123,7 @@ function _o() {
2123
2123
  let Ie = !0, te = !0, De = !1, Oe = !0, V = !1, ot = !0, nt = !1, ee = !1, Mt = null, Pt = null, oe = !1, lt = !1, It = !1, Dt = !1, Re = !0, Ne = !1;
2124
2124
  const ze = "user-content-";
2125
2125
  let ne = !0, ie = !1, ct = {}, dt = null;
2126
- const Be = v({}, [
2126
+ const Be = y({}, [
2127
2127
  "annotation-xml",
2128
2128
  "audio",
2129
2129
  "colgroup",
@@ -2152,7 +2152,7 @@ function _o() {
2152
2152
  "xmp"
2153
2153
  ]);
2154
2154
  let Fe = null;
2155
- const He = v({}, [
2155
+ const He = y({}, [
2156
2156
  "audio",
2157
2157
  "video",
2158
2158
  "img",
@@ -2161,7 +2161,7 @@ function _o() {
2161
2161
  "track"
2162
2162
  ]);
2163
2163
  let Ue = null;
2164
- const je = v({}, [
2164
+ const je = y({}, [
2165
2165
  "alt",
2166
2166
  "class",
2167
2167
  "for",
@@ -2178,7 +2178,7 @@ function _o() {
2178
2178
  "xmlns"
2179
2179
  ]), Ot = "http://www.w3.org/1998/Math/MathML", Rt = "http://www.w3.org/2000/svg", G = "http://www.w3.org/1999/xhtml";
2180
2180
  let ut = G, re = !1, ae = null;
2181
- const jo = v({}, [
2181
+ const Wo = y({}, [
2182
2182
  Ot,
2183
2183
  Rt,
2184
2184
  G
@@ -2189,10 +2189,10 @@ function _o() {
2189
2189
  "ms",
2190
2190
  "mtext"
2191
2191
  ]);
2192
- let se = v({}, We);
2192
+ let se = y({}, We);
2193
2193
  const $e = M(["annotation-xml"]);
2194
- let le = v({}, $e);
2195
- const Wo = v({}, [
2194
+ let le = y({}, $e);
2195
+ const $o = y({}, [
2196
2196
  "title",
2197
2197
  "style",
2198
2198
  "font",
@@ -2200,26 +2200,26 @@ function _o() {
2200
2200
  "script"
2201
2201
  ]);
2202
2202
  let wt = null;
2203
- const $o = ["application/xhtml+xml", "text/html"], Go = "text/html";
2204
- let S = null, pt = null;
2205
- const Ko = e.createElement("form"), Ge = function(i) {
2203
+ const Go = ["application/xhtml+xml", "text/html"], Ko = "text/html";
2204
+ let _ = null, pt = null;
2205
+ const Yo = e.createElement("form"), Ge = function(i) {
2206
2206
  return i instanceof RegExp || i instanceof Function;
2207
2207
  }, ce = function() {
2208
2208
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2209
2209
  if (pt && pt === i) return;
2210
- (!i || typeof i != "object") && (i = {}), i = H(i), wt = $o.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Go : i.PARSER_MEDIA_TYPE, S = wt === "application/xhtml+xml" ? fe : St, x = J(i, "ALLOWED_TAGS", Jt, { transform: S }), C = J(i, "ALLOWED_ATTR", Qt, { transform: S }), ae = J(i, "ALLOWED_NAMESPACES", jo, { transform: fe }), Ue = J(i, "ADD_URI_SAFE_ATTR", je, {
2211
- transform: S,
2210
+ (!i || typeof i != "object") && (i = {}), i = H(i), wt = Go.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Ko : i.PARSER_MEDIA_TYPE, _ = wt === "application/xhtml+xml" ? fe : St, T = J(i, "ALLOWED_TAGS", Jt, { transform: _ }), x = J(i, "ALLOWED_ATTR", Qt, { transform: _ }), ae = J(i, "ALLOWED_NAMESPACES", Wo, { transform: fe }), Ue = J(i, "ADD_URI_SAFE_ATTR", je, {
2211
+ transform: _,
2212
2212
  base: je
2213
2213
  }), Fe = J(i, "ADD_DATA_URI_TAGS", He, {
2214
- transform: S,
2214
+ transform: _,
2215
2215
  base: He
2216
- }), dt = J(i, "FORBID_CONTENTS", Be, { transform: S }), Et = J(i, "FORBID_TAGS", H({}), { transform: S }), Pe = J(i, "FORBID_ATTR", H({}), { transform: S }), ct = z(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? H(i.USE_PROFILES) : i.USE_PROFILES : !1, Ie = i.ALLOW_ARIA_ATTR !== !1, te = i.ALLOW_DATA_ATTR !== !1, De = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Oe = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = i.SAFE_FOR_TEMPLATES || !1, ot = i.SAFE_FOR_XML !== !1, nt = i.WHOLE_DOCUMENT || !1, lt = i.RETURN_DOM || !1, It = i.RETURN_DOM_FRAGMENT || !1, Dt = i.RETURN_TRUSTED_TYPE || !1, oe = i.FORCE_BODY || !1, Re = i.SANITIZE_DOM !== !1, Ne = i.SANITIZE_NAMED_PROPS || !1, ne = i.KEEP_CONTENT !== !1, ie = i.IN_PLACE || !1, Me = On(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : go, ut = typeof i.NAMESPACE == "string" ? i.NAMESPACE : G, se = ye(i, "MATHML_TEXT_INTEGRATION_POINTS", () => v({}, We)), le = ye(i, "HTML_INTEGRATION_POINTS", () => v({}, $e));
2216
+ }), dt = J(i, "FORBID_CONTENTS", Be, { transform: _ }), Et = J(i, "FORBID_TAGS", H({}), { transform: _ }), Pe = J(i, "FORBID_ATTR", H({}), { transform: _ }), ct = z(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? H(i.USE_PROFILES) : i.USE_PROFILES : !1, Ie = i.ALLOW_ARIA_ATTR !== !1, te = i.ALLOW_DATA_ATTR !== !1, De = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Oe = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = i.SAFE_FOR_TEMPLATES || !1, ot = i.SAFE_FOR_XML !== !1, nt = i.WHOLE_DOCUMENT || !1, lt = i.RETURN_DOM || !1, It = i.RETURN_DOM_FRAGMENT || !1, Dt = i.RETURN_TRUSTED_TYPE || !1, oe = i.FORCE_BODY || !1, Re = i.SANITIZE_DOM !== !1, Ne = i.SANITIZE_NAMED_PROPS || !1, ne = i.KEEP_CONTENT !== !1, ie = i.IN_PLACE || !1, Me = Rn(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : go, ut = typeof i.NAMESPACE == "string" ? i.NAMESPACE : G, se = ye(i, "MATHML_TEXT_INTEGRATION_POINTS", () => y({}, We)), le = ye(i, "HTML_INTEGRATION_POINTS", () => y({}, $e));
2217
2217
  const s = ye(i, "CUSTOM_ELEMENT_HANDLING", () => gt(null));
2218
- if ($ = gt(null), z(s, "tagNameCheck") && Ge(s.tagNameCheck) && ($.tagNameCheck = s.tagNameCheck), z(s, "attributeNameCheck") && Ge(s.attributeNameCheck) && ($.attributeNameCheck = s.attributeNameCheck), z(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && ($.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), P($), V && (te = !1), It && (lt = !0), ct && (x = v({}, fo), C = gt(null), ct.html === !0 && (v(x, po), v(C, ho)), ct.svg === !0 && (v(x, he), v(C, be), v(C, jt)), ct.svgFilters === !0 && (v(x, me), v(C, be), v(C, jt)), ct.mathMl === !0 && (v(x, ge), v(C, mo), v(C, jt))), q.tagCheck = null, q.attributeCheck = null, z(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? q.tagCheck = i.ADD_TAGS : bt(i.ADD_TAGS) && (x === Jt && (x = H(x)), v(x, i.ADD_TAGS, S))), z(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? q.attributeCheck = i.ADD_ATTR : bt(i.ADD_ATTR) && (C === Qt && (C = H(C)), v(C, i.ADD_ATTR, S))), z(i, "ADD_FORBID_CONTENTS") && bt(i.ADD_FORBID_CONTENTS) && (dt === Be && (dt = H(dt)), v(dt, i.ADD_FORBID_CONTENTS, S)), ne && (x["#text"] = !0), nt && v(x, [
2218
+ if ($ = gt(null), z(s, "tagNameCheck") && Ge(s.tagNameCheck) && ($.tagNameCheck = s.tagNameCheck), z(s, "attributeNameCheck") && Ge(s.attributeNameCheck) && ($.attributeNameCheck = s.attributeNameCheck), z(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && ($.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), P($), V && (te = !1), It && (lt = !0), ct && (T = y({}, fo), x = gt(null), ct.html === !0 && (y(T, po), y(x, ho)), ct.svg === !0 && (y(T, he), y(x, be), y(x, jt)), ct.svgFilters === !0 && (y(T, me), y(x, be), y(x, jt)), ct.mathMl === !0 && (y(T, ge), y(x, mo), y(x, jt))), q.tagCheck = null, q.attributeCheck = null, z(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? q.tagCheck = i.ADD_TAGS : bt(i.ADD_TAGS) && (T === Jt && (T = H(T)), y(T, i.ADD_TAGS, _))), z(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? q.attributeCheck = i.ADD_ATTR : bt(i.ADD_ATTR) && (x === Qt && (x = H(x)), y(x, i.ADD_ATTR, _))), z(i, "ADD_FORBID_CONTENTS") && bt(i.ADD_FORBID_CONTENTS) && (dt === Be && (dt = H(dt)), y(dt, i.ADD_FORBID_CONTENTS, _)), ne && (T["#text"] = !0), nt && y(T, [
2219
2219
  "html",
2220
2220
  "head",
2221
2221
  "body"
2222
- ]), x.table && (v(x, ["tbody"]), delete Et.tbody), i.TRUSTED_TYPES_POLICY) {
2222
+ ]), T.table && (y(T, ["tbody"]), delete Et.tbody), i.TRUSTED_TYPES_POLICY) {
2223
2223
  if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2224
2224
  if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2225
2225
  const d = N;
@@ -2229,36 +2229,36 @@ function _o() {
2229
2229
  } catch (p) {
2230
2230
  throw N = d, p;
2231
2231
  }
2232
- } else i.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Po()), N && typeof et == "string" && (et = st("")));
2232
+ } else i.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Io()), N && typeof et == "string" && (et = st("")));
2233
2233
  M && M(i), pt = i;
2234
- }, Ke = v({}, [
2234
+ }, Ke = y({}, [
2235
2235
  ...he,
2236
2236
  ...me,
2237
- ...Rn
2238
- ]), Ye = v({}, [...ge, ...Nn]), Yo = function(i, s, d) {
2237
+ ...Nn
2238
+ ]), Ye = y({}, [...ge, ...zn]), qo = function(i, s, d) {
2239
2239
  return s.namespaceURI === G ? i === "svg" : s.namespaceURI === Ot ? i === "svg" && (d === "annotation-xml" || se[d]) : !!Ke[i];
2240
- }, qo = function(i, s, d) {
2241
- return s.namespaceURI === G ? i === "math" : s.namespaceURI === Rt ? i === "math" && le[d] : !!Ye[i];
2242
2240
  }, Vo = function(i, s, d) {
2243
- return s.namespaceURI === Rt && !le[d] || s.namespaceURI === Ot && !se[d] ? !1 : !Ye[i] && (Wo[i] || !Ke[i]);
2244
- }, Xo = function(i) {
2241
+ return s.namespaceURI === G ? i === "math" : s.namespaceURI === Rt ? i === "math" && le[d] : !!Ye[i];
2242
+ }, Xo = function(i, s, d) {
2243
+ return s.namespaceURI === Rt && !le[d] || s.namespaceURI === Ot && !se[d] ? !1 : !Ye[i] && ($o[i] || !Ke[i]);
2244
+ }, Zo = function(i) {
2245
2245
  let s = R(i);
2246
2246
  (!s || !s.tagName) && (s = {
2247
2247
  namespaceURI: ut,
2248
2248
  tagName: "template"
2249
2249
  });
2250
2250
  const d = St(i.tagName), p = St(s.tagName);
2251
- return ae[i.namespaceURI] ? i.namespaceURI === Rt ? Yo(d, s, p) : i.namespaceURI === Ot ? qo(d, s, p) : i.namespaceURI === G ? Vo(d, s, p) : !!(wt === "application/xhtml+xml" && ae[i.namespaceURI]) : !1;
2251
+ return ae[i.namespaceURI] ? i.namespaceURI === Rt ? qo(d, s, p) : i.namespaceURI === Ot ? Vo(d, s, p) : i.namespaceURI === G ? Xo(d, s, p) : !!(wt === "application/xhtml+xml" && ae[i.namespaceURI]) : !1;
2252
2252
  }, X = function(i) {
2253
2253
  Tt(t.removed, { element: i });
2254
2254
  try {
2255
2255
  R(i).removeChild(i);
2256
2256
  } catch (s) {
2257
- if (k(i), !R(i)) throw Z("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
2257
+ if (w(i), !R(i)) throw Z("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
2258
2258
  }
2259
2259
  }, qe = function(i, s, d) {
2260
2260
  try {
2261
- E(i, s);
2261
+ v(i, s);
2262
2262
  } catch (p) {
2263
2263
  try {
2264
2264
  i.removeAttribute(d);
@@ -2274,7 +2274,7 @@ function _o() {
2274
2274
  Tt(p, h);
2275
2275
  }), rt(p, (h) => {
2276
2276
  try {
2277
- k(h);
2277
+ w(h);
2278
2278
  } catch (g) {
2279
2279
  }
2280
2280
  });
@@ -2295,7 +2295,7 @@ function _o() {
2295
2295
  from: s
2296
2296
  });
2297
2297
  try {
2298
- d ? E(s, d) : s.removeAttribute(i);
2298
+ d ? v(s, d) : s.removeAttribute(i);
2299
2299
  } catch (p) {
2300
2300
  try {
2301
2301
  s.removeAttribute(i);
@@ -2311,40 +2311,40 @@ function _o() {
2311
2311
  s.setAttribute(i, "");
2312
2312
  } catch (p) {
2313
2313
  }
2314
- }, Zo = function(i) {
2314
+ }, Jo = function(i) {
2315
2315
  const s = qt(i);
2316
2316
  if (s)
2317
2317
  for (let d = s.length - 1; d >= 0; --d) {
2318
2318
  const p = s[d], h = p && p.name;
2319
- typeof h != "string" || C[S(h)] || qe(i, p, h);
2319
+ typeof h != "string" || x[_(h)] || qe(i, p, h);
2320
2320
  }
2321
2321
  }, zt = function(i) {
2322
2322
  const s = [i];
2323
2323
  for (; s.length > 0; ) {
2324
2324
  const d = s.pop();
2325
- yt(d) === F.element && Zo(d);
2325
+ yt(d) === F.element && Jo(d);
2326
2326
  const p = D(d);
2327
2327
  if (p) for (let h = p.length - 1; h >= 0; --h) s.push(p[h]);
2328
2328
  }
2329
2329
  }, Ve = function(i, s) {
2330
2330
  return ot ? i === "patchsrc" ? !0 : i === "for" && s !== "label" && s !== "output" : !1;
2331
- }, Jo = function(i) {
2331
+ }, Qo = function(i) {
2332
2332
  if (!ot) return;
2333
2333
  const s = [i];
2334
2334
  for (; s.length > 0; ) {
2335
2335
  const d = s.pop(), p = yt(d);
2336
2336
  if (p === F.processingInstruction || p === F.comment && I(yo, d.data)) {
2337
2337
  try {
2338
- k(d);
2338
+ w(d);
2339
2339
  } catch (g) {
2340
2340
  }
2341
2341
  continue;
2342
2342
  }
2343
2343
  if (p === F.element) {
2344
- const g = d, y = S(Vt(d));
2344
+ const g = d, b = _(Vt(d));
2345
2345
  try {
2346
- g.hasAttribute && g.hasAttribute("patchsrc") && g.removeAttribute("patchsrc"), g.hasAttribute && g.hasAttribute("for") && Ve("for", y) && g.removeAttribute("for");
2347
- } catch (A) {
2346
+ g.hasAttribute && g.hasAttribute("patchsrc") && g.removeAttribute("patchsrc"), g.hasAttribute && g.hasAttribute("for") && Ve("for", b) && g.removeAttribute("for");
2347
+ } catch (S) {
2348
2348
  }
2349
2349
  }
2350
2350
  const h = D(d);
@@ -2371,12 +2371,12 @@ function _o() {
2371
2371
  }
2372
2372
  }
2373
2373
  const h = s.body || s.documentElement;
2374
- return i && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ut === G ? Do.call(s, nt ? "html" : "body")[0] : nt ? s.documentElement : h;
2374
+ return i && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ut === G ? Oo.call(s, nt ? "html" : "body")[0] : nt ? s.documentElement : h;
2375
2375
  }, Ze = function(i) {
2376
2376
  const s = _t ? _t(i) : i.ownerDocument;
2377
2377
  return _e.call(s || i, i, f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION, null);
2378
2378
  }, Bt = function(i) {
2379
- return i = xt(i, Ro, " "), i = xt(i, No, " "), i = xt(i, zo, " "), i;
2379
+ return i = xt(i, No, " "), i = xt(i, zo, " "), i = xt(i, Bo, " "), i;
2380
2380
  }, de = function(i) {
2381
2381
  var s;
2382
2382
  i.normalize();
@@ -2385,12 +2385,12 @@ function _o() {
2385
2385
  for (; h; )
2386
2386
  h.data = Bt(h.data), h = p.nextNode();
2387
2387
  const g = (s = i.querySelectorAll) === null || s === void 0 ? void 0 : s.call(i, "template");
2388
- g && rt(g, (y) => {
2389
- ft(y.content) && de(y.content);
2388
+ g && rt(g, (b) => {
2389
+ ft(b.content) && de(b.content);
2390
2390
  });
2391
2391
  }, Ft = function(i) {
2392
2392
  const s = at ? at(i) : null;
2393
- return typeof s != "string" || S(s) !== "form" ? !1 : typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || i.attributes !== qt(i) || typeof i.removeAttribute != "function" || typeof i.removeAttributeNode != "function" || typeof i.getAttributeNode != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function" || i.nodeType !== tt(i) || i.childNodes !== D(i);
2393
+ return typeof s != "string" || _(s) !== "form" ? !1 : typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || i.attributes !== qt(i) || typeof i.removeAttribute != "function" || typeof i.removeAttributeNode != "function" || typeof i.getAttributeNode != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function" || i.nodeType !== tt(i) || i.childNodes !== D(i);
2394
2394
  }, ft = function(i) {
2395
2395
  if (!tt || typeof i != "object" || i === null) return !1;
2396
2396
  try {
@@ -2411,8 +2411,8 @@ function _o() {
2411
2411
  d.call(t, i, s, pt);
2412
2412
  });
2413
2413
  }
2414
- const Qo = function(i, s) {
2415
- return !!(ot && i.hasChildNodes() && !kt(i.firstElementChild) && I(bo, i.textContent) && I(bo, i.innerHTML) || ot && i.namespaceURI === G && qn[s] && (kt(i.firstElementChild) || typeof i.textContent == "string" && I(Vn[s], i.textContent)) || i.nodeType === F.processingInstruction || ot && i.nodeType === F.comment && I(yo, i.data));
2414
+ const tn = function(i, s) {
2415
+ return !!(ot && i.hasChildNodes() && !kt(i.firstElementChild) && I(bo, i.textContent) && I(bo, i.innerHTML) || ot && i.namespaceURI === G && Vn[s] && (kt(i.firstElementChild) || typeof i.textContent == "string" && I(Xn[s], i.textContent)) || i.nodeType === F.processingInstruction || ot && i.nodeType === F.comment && I(yo, i.data));
2416
2416
  }, Ht = function(i, s) {
2417
2417
  if (i instanceof RegExp) return I(i, s);
2418
2418
  if (i instanceof Function) {
@@ -2420,15 +2420,15 @@ function _o() {
2420
2420
  return !!i(s, ...p);
2421
2421
  }
2422
2422
  return !1;
2423
- }, tn = function(i, s, d) {
2423
+ }, en = function(i, s, d) {
2424
2424
  if (!Et[s] && eo(s) && Ht($.tagNameCheck, s)) return !1;
2425
2425
  if (ne && !dt[s]) {
2426
2426
  const p = R(i), h = D(i);
2427
2427
  if (h && p) {
2428
2428
  const g = h.length;
2429
- for (let y = g - 1; y >= 0; --y) {
2430
- const A = i === d ? _(h[y], !0) : h[y];
2431
- p.insertBefore(A, Y(i));
2429
+ for (let b = g - 1; b >= 0; --b) {
2430
+ const S = i === d ? A(h[b], !0) : h[b];
2431
+ p.insertBefore(S, Y(i));
2432
2432
  }
2433
2433
  }
2434
2434
  }
@@ -2438,32 +2438,32 @@ function _o() {
2438
2438
  }, ht = function(i, s) {
2439
2439
  return i === s || R(i) !== null ? !1 : (ie && zt(i), !0);
2440
2440
  }, Qe = function(i, s) {
2441
- if (K(T.beforeSanitizeElements, i, null), ht(i, s)) return !0;
2441
+ if (K(k.beforeSanitizeElements, i, null), ht(i, s)) return !0;
2442
2442
  if (Ft(i))
2443
2443
  return X(i), !0;
2444
- const d = S(Vt(i));
2445
- if (x = Je(T.uponSanitizeElement, x, Jt, Mt), K(T.uponSanitizeElement, i, {
2444
+ const d = _(Vt(i));
2445
+ if (T = Je(k.uponSanitizeElement, T, Jt, Mt), K(k.uponSanitizeElement, i, {
2446
2446
  tagName: d,
2447
- allowedTags: x
2447
+ allowedTags: T
2448
2448
  }), ht(i, s)) return !0;
2449
- if (Qo(i, d))
2449
+ if (tn(i, d))
2450
2450
  return X(i), !0;
2451
- if (Et[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !x[d]) {
2452
- const p = tn(i, d, s);
2453
- return p === !1 && (K(T.afterSanitizeElements, i, null), ht(i, s)) ? !0 : p;
2451
+ if (Et[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !T[d]) {
2452
+ const p = en(i, d, s);
2453
+ return p === !1 && (K(k.afterSanitizeElements, i, null), ht(i, s)) ? !0 : p;
2454
2454
  }
2455
- if (yt(i) === F.element && !Xo(i) || (d === "noscript" || d === "noembed" || d === "noframes") && I(Kn, i.innerHTML))
2455
+ if (yt(i) === F.element && !Zo(i) || (d === "noscript" || d === "noembed" || d === "noframes") && I(Yn, i.innerHTML))
2456
2456
  return X(i), !0;
2457
2457
  if (V && i.nodeType === F.text) {
2458
2458
  const p = Bt(i.textContent);
2459
2459
  i.textContent !== p && (Tt(t.removed, { element: i.cloneNode() }), i.textContent = p);
2460
2460
  }
2461
- return K(T.afterSanitizeElements, i, null), ht(i, s);
2461
+ return K(k.afterSanitizeElements, i, null), ht(i, s);
2462
2462
  }, to = function(i, s, d) {
2463
- if (Pe[s] || Ve(s, i) || Re && (s === "id" || s === "name") && (d in e || d in Ko)) return !1;
2464
- const p = C[s] || q.attributeCheck instanceof Function && q.attributeCheck(s, i);
2465
- return te && I(Bo, s) || Ie && I(Fo, s) ? !0 : p ? Ue[s] || I(Me, xt(d, Le, "")) || (s === "src" || s === "xlink:href" || s === "href") && i !== "script" && lo(d, "data:") === 0 && Fe[i] || De && !I(Ho, xt(d, Le, "")) ? !0 : !d : eo(i) && Ht($.tagNameCheck, i) && Ht($.attributeNameCheck, s, i) || s === "is" && $.allowCustomizedBuiltInElements && Ht($.tagNameCheck, d);
2466
- }, en = v({}, [
2463
+ if (Pe[s] || Ve(s, i) || Re && (s === "id" || s === "name") && (d in e || d in Yo)) return !1;
2464
+ const p = x[s] || q.attributeCheck instanceof Function && q.attributeCheck(s, i);
2465
+ return te && I(Fo, s) || Ie && I(Ho, s) ? !0 : p ? Ue[s] || I(Me, xt(d, Le, "")) || (s === "src" || s === "xlink:href" || s === "href") && i !== "script" && lo(d, "data:") === 0 && Fe[i] || De && !I(Uo, xt(d, Le, "")) ? !0 : !d : eo(i) && Ht($.tagNameCheck, i) && Ht($.attributeNameCheck, s, i) || s === "is" && $.allowCustomizedBuiltInElements && Ht($.tagNameCheck, d);
2466
+ }, on = y({}, [
2467
2467
  "annotation-xml",
2468
2468
  "color-profile",
2469
2469
  "font-face",
@@ -2473,72 +2473,72 @@ function _o() {
2473
2473
  "font-face-uri",
2474
2474
  "missing-glyph"
2475
2475
  ]), eo = function(i) {
2476
- return !en[St(i)] && I(Uo, i);
2477
- }, on = function(i, s, d, p) {
2478
- if (N && typeof b == "object" && typeof b.getAttributeType == "function" && !d) switch (b.getAttributeType(i, s)) {
2476
+ return !on[St(i)] && I(jo, i);
2477
+ }, nn = function(i, s, d, p) {
2478
+ if (N && typeof E == "object" && typeof E.getAttributeType == "function" && !d) switch (E.getAttributeType(i, s)) {
2479
2479
  case "TrustedHTML":
2480
2480
  return st(p);
2481
2481
  case "TrustedScriptURL":
2482
- return Mo(p);
2482
+ return Po(p);
2483
2483
  }
2484
2484
  return p;
2485
- }, nn = function(i, s, d, p) {
2485
+ }, rn = function(i, s, d, p) {
2486
2486
  try {
2487
2487
  return d ? i.setAttributeNS(d, s, p) : i.setAttribute(s, p), Ft(i) ? (X(i), !1) : !0;
2488
2488
  } catch (h) {
2489
2489
  return it(s, i), !1;
2490
2490
  }
2491
2491
  }, oo = function(i, s) {
2492
- if (K(T.beforeSanitizeAttributes, i, null), ht(i, s)) return;
2492
+ if (K(k.beforeSanitizeAttributes, i, null), ht(i, s)) return;
2493
2493
  const d = i.attributes;
2494
2494
  if (!d || Ft(i)) return;
2495
- C = Je(T.uponSanitizeAttribute, C, Qt, Pt);
2495
+ x = Je(k.uponSanitizeAttribute, x, Qt, Pt);
2496
2496
  const p = {
2497
2497
  attrName: "",
2498
2498
  attrValue: "",
2499
2499
  keepAttr: !0,
2500
- allowedAttributes: C,
2500
+ allowedAttributes: x,
2501
2501
  forceKeepAttr: void 0
2502
2502
  };
2503
2503
  let h = d.length;
2504
- const g = S(i.nodeName);
2504
+ const g = _(i.nodeName);
2505
2505
  for (; h--; ) {
2506
- const y = d[h], A = y.name, U = y.namespaceURI, B = y.value, mt = S(A), pe = B;
2507
- let O = A === "value" ? pe : _n(pe), no = !1;
2508
- if (p.attrName = mt, p.attrValue = O, p.keepAttr = !0, p.forceKeepAttr = void 0, K(T.uponSanitizeAttribute, i, p), O = p.attrValue, Ne && (mt === "id" || mt === "name") && lo(O, ze) !== 0 && (it(A, i, y), O = ze + O, no = !0), ot && I(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
2509
- it(A, i, y);
2506
+ const b = d[h], S = b.name, U = b.namespaceURI, B = b.value, mt = _(S), pe = B;
2507
+ let O = S === "value" ? pe : Ln(pe), no = !1;
2508
+ if (p.attrName = mt, p.attrValue = O, p.keepAttr = !0, p.forceKeepAttr = void 0, K(k.uponSanitizeAttribute, i, p), O = p.attrValue, Ne && (mt === "id" || mt === "name") && lo(O, ze) !== 0 && (it(S, i, b), O = ze + O, no = !0), ot && I(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
2509
+ it(S, i, b);
2510
2510
  continue;
2511
2511
  }
2512
2512
  if (mt === "attributename" && so(O, "href")) {
2513
- it(A, i, y);
2513
+ it(S, i, b);
2514
2514
  continue;
2515
2515
  }
2516
2516
  if (!p.forceKeepAttr) {
2517
2517
  if (!p.keepAttr) {
2518
- it(A, i, y);
2518
+ it(S, i, b);
2519
2519
  continue;
2520
2520
  }
2521
- if (!Oe && I(Yn, O)) {
2522
- it(A, i, y);
2521
+ if (!Oe && I(qn, O)) {
2522
+ it(S, i, b);
2523
2523
  continue;
2524
2524
  }
2525
2525
  if (V && (O = Bt(O)), !to(g, mt, O)) {
2526
- it(A, i, y);
2526
+ it(S, i, b);
2527
2527
  continue;
2528
2528
  }
2529
- O = on(g, mt, U, O), O !== pe && nn(i, A, U, O) && no && ao(t.removed);
2529
+ O = nn(g, mt, U, O), O !== pe && rn(i, S, U, O) && no && ao(t.removed);
2530
2530
  }
2531
2531
  }
2532
- K(T.afterSanitizeAttributes, i, null), ht(i, s);
2532
+ K(k.afterSanitizeAttributes, i, null), ht(i, s);
2533
2533
  }, Ut = function(i) {
2534
2534
  let s = null;
2535
2535
  const d = Ze(i);
2536
- for (K(T.beforeSanitizeShadowDOM, i, null); s = d.nextNode(); )
2537
- if (K(T.uponSanitizeShadowNode, s, null), Qe(s, i), oo(s, i), ft(s.content) && Ut(s.content), yt(s) === F.element) {
2536
+ for (K(k.beforeSanitizeShadowDOM, i, null); s = d.nextNode(); )
2537
+ if (K(k.uponSanitizeShadowNode, s, null), Qe(s, i), oo(s, i), ft(s.content) && Ut(s.content), yt(s) === F.element) {
2538
2538
  const p = Ce(s);
2539
2539
  ft(p) && (ue(p), Ut(p));
2540
2540
  }
2541
- K(T.afterSanitizeShadowDOM, i, null);
2541
+ K(k.afterSanitizeShadowDOM, i, null);
2542
2542
  }, ue = function(i) {
2543
2543
  const s = [{
2544
2544
  node: i,
@@ -2551,27 +2551,27 @@ function _o() {
2551
2551
  continue;
2552
2552
  }
2553
2553
  const p = d.node, h = yt(p) === F.element, g = D(p);
2554
- if (g) for (let y = g.length - 1; y >= 0; --y) s.push({
2555
- node: g[y],
2554
+ if (g) for (let b = g.length - 1; b >= 0; --b) s.push({
2555
+ node: g[b],
2556
2556
  shadow: null
2557
2557
  });
2558
2558
  if (h) {
2559
- const y = at ? at(p) : null;
2560
- if (typeof y == "string" && S(y) === "template") {
2561
- const A = p.content;
2562
- ft(A) && s.push({
2563
- node: A,
2559
+ const b = at ? at(p) : null;
2560
+ if (typeof b == "string" && _(b) === "template") {
2561
+ const S = p.content;
2562
+ ft(S) && s.push({
2563
+ node: S,
2564
2564
  shadow: null
2565
2565
  });
2566
2566
  }
2567
2567
  }
2568
2568
  if (h) {
2569
- const y = Ce(p);
2570
- ft(y) && s.push({
2569
+ const b = Ce(p);
2570
+ ft(b) && s.push({
2571
2571
  node: null,
2572
- shadow: y
2572
+ shadow: b
2573
2573
  }, {
2574
- node: y,
2574
+ node: b,
2575
2575
  shadow: null
2576
2576
  });
2577
2577
  }
@@ -2579,17 +2579,17 @@ function _o() {
2579
2579
  };
2580
2580
  return t.sanitize = function(u) {
2581
2581
  let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, p = null, h = null;
2582
- if (re = !u, re && (u = "<!-->"), typeof u != "string" && !kt(u) && (u = Dn(u), typeof u != "string"))
2582
+ if (re = !u, re && (u = "<!-->"), typeof u != "string" && !kt(u) && (u = On(u), typeof u != "string"))
2583
2583
  throw Z("dirty is not a string, aborting");
2584
2584
  if (!t.isSupported) return u;
2585
- ee ? (x = Mt, C = Pt) : ce(i), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (x = H(x)), T.uponSanitizeAttribute.length > 0 && (C = H(C)), t.removed = [];
2585
+ ee ? (T = Mt, x = Pt) : ce(i), (k.uponSanitizeElement.length > 0 || k.uponSanitizeAttribute.length > 0) && (T = H(T)), k.uponSanitizeAttribute.length > 0 && (x = H(x)), t.removed = [];
2586
2586
  const g = ie && typeof u != "string" && kt(u);
2587
2587
  if (g) {
2588
- Jo(u);
2588
+ Qo(u);
2589
2589
  const U = Vt(u);
2590
2590
  if (typeof U == "string") {
2591
- const B = S(U);
2592
- if (!x[B] || Et[B])
2591
+ const B = _(U);
2592
+ if (!T[B] || Et[B])
2593
2593
  throw Nt(u), Z("root node is forbidden and cannot be sanitized in-place");
2594
2594
  }
2595
2595
  if (Ft(u))
@@ -2606,11 +2606,11 @@ function _o() {
2606
2606
  if (s = Xe(u), !s) return lt ? null : Dt ? et : "";
2607
2607
  }
2608
2608
  s && oe && X(s.firstChild);
2609
- const y = g ? u : s;
2609
+ const b = g ? u : s;
2610
2610
  try {
2611
- const U = Ze(y);
2611
+ const U = Ze(b);
2612
2612
  for (; p = U.nextNode(); )
2613
- Qe(p, y), oo(p, y), ft(p.content) && Ut(p.content);
2613
+ Qe(p, b), oo(p, b), ft(p.content) && Ut(p.content);
2614
2614
  } catch (U) {
2615
2615
  throw g && (Nt(u), rt(t.removed, (B) => {
2616
2616
  B.element && zt(B.element);
@@ -2625,40 +2625,40 @@ function _o() {
2625
2625
  }
2626
2626
  if (lt) {
2627
2627
  if (V && de(s), It)
2628
- for (h = Io.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
2628
+ for (h = Do.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
2629
2629
  else h = s;
2630
- return (C.shadowroot || C.shadowrootmode) && (h = Oo.call(n, h, !0)), h;
2630
+ return (x.shadowroot || x.shadowrootmode) && (h = Ro.call(n, h, !0)), h;
2631
2631
  }
2632
- let A = nt ? s.outerHTML : s.innerHTML;
2633
- return nt && x["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && I($n, s.ownerDocument.doctype.name) && (A = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
2634
- ` + A), V && (A = Bt(A)), N && Dt ? st(A) : A;
2632
+ let S = nt ? s.outerHTML : s.innerHTML;
2633
+ return nt && T["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && I(Gn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
2634
+ ` + S), V && (S = Bt(S)), N && Dt ? st(S) : S;
2635
2635
  }, t.setConfig = function() {
2636
2636
  let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2637
- ce(u), ee = !0, Mt = x, Pt = C;
2637
+ ce(u), ee = !0, Mt = T, Pt = x;
2638
2638
  }, t.clearConfig = function() {
2639
2639
  pt = null, ee = !1, Mt = null, Pt = null, N = Xt, et = "";
2640
2640
  }, t.isValidAttribute = function(u, i, s) {
2641
2641
  pt || ce({});
2642
- const d = S(u), p = S(i);
2642
+ const d = _(u), p = _(i);
2643
2643
  return to(d, p, s);
2644
2644
  }, t.addHook = function(u, i) {
2645
- typeof i == "function" && z(T, u) && Tt(T[u], i);
2645
+ typeof i == "function" && z(k, u) && Tt(k[u], i);
2646
2646
  }, t.removeHook = function(u, i) {
2647
- if (z(T, u)) {
2647
+ if (z(k, u)) {
2648
2648
  if (i !== void 0) {
2649
- const s = An(T[u], i);
2650
- return s === -1 ? void 0 : Sn(T[u], s, 1)[0];
2649
+ const s = Sn(k[u], i);
2650
+ return s === -1 ? void 0 : _n(k[u], s, 1)[0];
2651
2651
  }
2652
- return ao(T[u]);
2652
+ return ao(k[u]);
2653
2653
  }
2654
2654
  }, t.removeHooks = function(u) {
2655
- z(T, u) && (T[u] = []);
2655
+ z(k, u) && (k[u] = []);
2656
2656
  }, t.removeAllHooks = function() {
2657
- T = vo();
2657
+ k = vo();
2658
2658
  }, t;
2659
2659
  }
2660
- var Wt = _o();
2661
- const Jn = [
2660
+ var Wt = Lo();
2661
+ const Qn = [
2662
2662
  "p",
2663
2663
  "br",
2664
2664
  "strong",
@@ -2704,7 +2704,7 @@ const Jn = [
2704
2704
  // user-initiated dialog, a different trust boundary that never calls
2705
2705
  // through this sanitizer. A consumer that genuinely wants iframes in
2706
2706
  // pasted/typed content can still opt in via a custom allowedTags list.
2707
- ], Qn = {
2707
+ ], ti = {
2708
2708
  "*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
2709
2709
  a: ["href", "target", "rel", "title"],
2710
2710
  img: ["src", "alt", "width", "height", "loading"],
@@ -2719,8 +2719,8 @@ const Jn = [
2719
2719
  // additionalAllowedTags), restoring the attributes that make an inserted
2720
2720
  // iframe actually usable (src, sizing, fullscreen, scrolling/border).
2721
2721
  iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
2722
- }, ti = "data-editora-embed";
2723
- function ei(o) {
2722
+ }, ei = "data-editora-embed";
2723
+ function oi(o) {
2724
2724
  if (!o || /\s/.test(o.trim())) return !1;
2725
2725
  try {
2726
2726
  const t = new URL(o.trim());
@@ -2729,23 +2729,26 @@ function ei(o) {
2729
2729
  return !1;
2730
2730
  }
2731
2731
  }
2732
- function Lo(o, t, e, n) {
2732
+ function Mo(o, t, e, n) {
2733
2733
  if ((t == null ? void 0 : t.sanitize) === !1)
2734
2734
  return o;
2735
- const r = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : Jn, a = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...r, ...e])) : r, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : Qn, f = /* @__PURE__ */ new Set();
2736
- for (const b of Object.values(c))
2737
- for (const w of b) f.add(w);
2735
+ const r = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : Qn, a = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...r, ...e])) : r, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : ti, f = /* @__PURE__ */ new Set();
2736
+ for (const C of Object.values(c))
2737
+ for (const A of C) f.add(A);
2738
2738
  const m = {
2739
2739
  ALLOWED_TAGS: a,
2740
2740
  ALLOWED_ATTR: Array.from(f)
2741
2741
  };
2742
2742
  if (!n)
2743
2743
  return Wt.sanitize(o, m);
2744
+ const E = a.includes("iframe");
2744
2745
  Wt.addHook(
2745
2746
  "uponSanitizeElement",
2746
- (b, w) => {
2747
- var _;
2748
- w.tagName === "iframe" && ((_ = b.getAttribute) == null ? void 0 : _.call(b, ti)) === "true" && ei(b.getAttribute("src")) && (w.allowedTags.iframe = !0);
2747
+ (C, A) => {
2748
+ var v;
2749
+ if (A.tagName !== "iframe") return;
2750
+ const w = C;
2751
+ A.allowedTags.iframe = E || ((v = w.getAttribute) == null ? void 0 : v.call(w, ei)) === "true" && oi(w.getAttribute("src"));
2749
2752
  }
2750
2753
  );
2751
2754
  try {
@@ -2754,14 +2757,14 @@ function Lo(o, t, e, n) {
2754
2757
  Wt.removeHook("uponSanitizeElement");
2755
2758
  }
2756
2759
  }
2757
- function oi(o, t, e, n) {
2758
- return Lo(o, t, n, !1);
2760
+ function ni(o, t, e, n) {
2761
+ return Mo(o, t, n, !1);
2759
2762
  }
2760
- function ni(o, t, e) {
2761
- return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? o : oi(o, t);
2763
+ function ii(o, t, e) {
2764
+ return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? o : ni(o, t);
2762
2765
  }
2763
- function ii(o, t, e, n) {
2764
- return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? o : Lo(o, t, n, !0);
2766
+ function Eo(o, t, e, n) {
2767
+ return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? o : Mo(o, t, n, !0);
2765
2768
  }
2766
2769
  const Yt = class Yt {
2767
2770
  /**
@@ -3027,9 +3030,9 @@ Yt.EDITOR_DEFAULTS = {
3027
3030
  let Te = Yt;
3028
3031
  const ri = '.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}}';
3029
3032
  let $t;
3030
- const ai = "__editoraCommandEditorRoot", si = "__editoraLastCommandButton", Eo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", wo = ".rte-content, .editora-content", xe = /* @__PURE__ */ new Set();
3031
- let Q = null, ko = !1, ve = null, Ee = null;
3032
- function To(o) {
3033
+ const ai = "__editoraCommandEditorRoot", si = "__editoraLastCommandButton", wo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", ko = ".rte-content, .editora-content", xe = /* @__PURE__ */ new Set();
3034
+ let Q = null, To = !1, ve = null, Ee = null;
3035
+ function xo(o) {
3033
3036
  if (!(o instanceof HTMLElement)) return !1;
3034
3037
  const t = o;
3035
3038
  return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
@@ -3039,10 +3042,10 @@ function li(o) {
3039
3042
  }
3040
3043
  function At(o) {
3041
3044
  if (!o) return null;
3042
- if (To(o))
3045
+ if (xo(o))
3043
3046
  return o;
3044
- const t = o.matches(Eo) ? o : o.closest(Eo);
3045
- return !t || !To(t) ? null : t;
3047
+ const t = o.matches(wo) ? o : o.closest(wo);
3048
+ return !t || !xo(t) ? null : t;
3046
3049
  }
3047
3050
  function ci() {
3048
3051
  var r;
@@ -3051,7 +3054,7 @@ function ci() {
3051
3054
  if (o instanceof HTMLElement) {
3052
3055
  const a = At(o);
3053
3056
  if (a) return a;
3054
- const l = o.matches(wo) ? o : o.querySelector(wo);
3057
+ const l = o.matches(ko) ? o : o.querySelector(ko);
3055
3058
  if (l) {
3056
3059
  const c = At(l);
3057
3060
  if (c) return c;
@@ -3079,13 +3082,13 @@ function ci() {
3079
3082
  return null;
3080
3083
  }
3081
3084
  function di() {
3082
- if (typeof window == "undefined" || ko) return;
3085
+ if (typeof window == "undefined" || To) return;
3083
3086
  ve = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, Ee = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3084
3087
  const o = (t, ...e) => {
3085
3088
  const n = ci();
3086
3089
  return n ? n.execCommand(t, ...e) : ve ? ve(t, ...e) : Ee ? Ee(t, ...e) : !1;
3087
3090
  };
3088
- window.executeEditorCommand = o, window.execEditorCommand = o, ko = !0;
3091
+ window.executeEditorCommand = o, window.execEditorCommand = o, To = !0;
3089
3092
  }
3090
3093
  function ui() {
3091
3094
  const o = "editora-webcomponent-styles";
@@ -3097,13 +3100,13 @@ function ui() {
3097
3100
  function pi() {
3098
3101
  if (!$t) {
3099
3102
  const o = W.__globalPluginLoader;
3100
- o ? $t = o : $t = new xo();
3103
+ o ? $t = o : $t = new Co();
3101
3104
  }
3102
3105
  return $t;
3103
3106
  }
3104
3107
  class W extends HTMLElement {
3105
3108
  constructor() {
3106
- if (super(), this.pluginLoader = pi(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new bn(), this.lastAutosavedContent = "", this.loadedPlugins = [], this.lastBeforeInputType = null, ui(), !this.hasAttribute("data-initial-content")) {
3109
+ if (super(), this.pluginLoader = pi(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new yn(), this.lastAutosavedContent = "", this.loadedPlugins = [], this.lastBeforeInputType = null, ui(), !this.hasAttribute("data-initial-content")) {
3107
3110
  const t = this.innerHTML.trim();
3108
3111
  t && this.setAttribute("data-initial-content", t);
3109
3112
  }
@@ -3217,8 +3220,10 @@ class W extends HTMLElement {
3217
3220
  const r = this.innerHTML.trim();
3218
3221
  r && this.setAttribute("data-initial-content", r);
3219
3222
  }
3220
- const e = (n = this.restoreAutosavedContent()) != null ? n : this.getAttribute("data-initial-content") || "";
3221
- this.engine = new ln({
3223
+ const e = this.sanitizeLoadedContent(
3224
+ (n = this.restoreAutosavedContent()) != null ? n : this.getAttribute("data-initial-content") || ""
3225
+ );
3226
+ this.engine = new cn({
3222
3227
  content: e,
3223
3228
  plugins: t,
3224
3229
  readonly: this.config.readonly
@@ -3446,6 +3451,14 @@ class W extends HTMLElement {
3446
3451
  const t = this.config.security;
3447
3452
  return t && typeof t == "object" ? t : { sanitizeOnPaste: !0, sanitizeOnInput: !0 };
3448
3453
  }
3454
+ /**
3455
+ * HTML handed to the editor from outside (initial markup, restored autosave, setContent).
3456
+ * Same allowlist and opt-outs as typed input, applied before the markup is parsed into the
3457
+ * editable DOM: sanitizing only after the first edit leaves the page exposed until then.
3458
+ */
3459
+ sanitizeLoadedContent(t) {
3460
+ return Eo(t, this.getContentSanitizeConfig(), this.getSecurityConfig());
3461
+ }
3449
3462
  getAutosaveConfig() {
3450
3463
  var e, n;
3451
3464
  const t = this.config.autosave;
@@ -3536,7 +3549,7 @@ class W extends HTMLElement {
3536
3549
  */
3537
3550
  createUI(t, e) {
3538
3551
  const n = this.querySelector('[slot="toolbar"]'), r = this.querySelector('[slot="statusbar"]');
3539
- this.innerHTML = "", this.config.toolbar !== !1 && !n ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new cn(
3552
+ this.innerHTML = "", this.config.toolbar !== !1 && !n ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new dn(
3540
3553
  {
3541
3554
  items: this.resolveToolbarItems(),
3542
3555
  sticky: this.isToolbarStickyEnabled(),
@@ -3551,8 +3564,8 @@ class W extends HTMLElement {
3551
3564
  this.contentElement.focus();
3552
3565
  const f = window.getSelection();
3553
3566
  if (!f || f.rangeCount === 0 || !this.contentElement.contains(f.anchorNode)) {
3554
- const m = document.createRange(), b = this.contentElement.lastChild || this.contentElement;
3555
- b.nodeType === Node.TEXT_NODE ? m.setStart(b, ((c = b.textContent) == null ? void 0 : c.length) || 0) : b.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(b), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0), f == null || f.removeAllRanges(), f == null || f.addRange(m);
3567
+ const m = document.createRange(), E = this.contentElement.lastChild || this.contentElement;
3568
+ E.nodeType === Node.TEXT_NODE ? m.setStart(E, ((c = E.textContent) == null ? void 0 : c.length) || 0) : E.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(E), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0), f == null || f.removeAllRanges(), f == null || f.addRange(m);
3556
3569
  }
3557
3570
  }
3558
3571
  return this.executeCommand(a, l);
@@ -3573,7 +3586,7 @@ class W extends HTMLElement {
3573
3586
  }) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
3574
3587
  } else
3575
3588
  this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
3576
- this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new dn({ enabled: !0 }), this.floatingToolbar.create(this)), r ? this.appendChild(r) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new un({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
3589
+ this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new un({ enabled: !0 }), this.floatingToolbar.create(this)), r ? this.appendChild(r) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new pn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
3577
3590
  var a;
3578
3591
  return (a = this.contentElement) == null ? void 0 : a.focus();
3579
3592
  }, 0);
@@ -3587,41 +3600,41 @@ class W extends HTMLElement {
3587
3600
  this.contentElement.addEventListener("beforeinput", (n) => {
3588
3601
  this.lastBeforeInputType = n.inputType || null;
3589
3602
  }), this.contentElement.addEventListener("input", (n) => {
3590
- var _;
3603
+ var A;
3591
3604
  if (!this.contentElement) return;
3592
3605
  let r = this.contentElement.innerHTML;
3593
- const a = (_ = n == null ? void 0 : n.detail) == null ? void 0 : _.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = this.lastBeforeInputType;
3606
+ const a = (A = n == null ? void 0 : n.detail) == null ? void 0 : A.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = this.lastBeforeInputType;
3594
3607
  if (this.lastBeforeInputType = null, f.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
3595
- const k = ii(r, c, f, a);
3596
- if (k !== r) {
3597
- const E = window.getSelection(), Y = E && E.rangeCount > 0 ? E.getRangeAt(0) : null;
3598
- if (this.contentElement.innerHTML = k, Y && E)
3608
+ const w = Eo(r, c, f, a);
3609
+ if (w !== r) {
3610
+ const v = window.getSelection(), Y = v && v.rangeCount > 0 ? v.getRangeAt(0) : null;
3611
+ if (this.contentElement.innerHTML = w, Y && v)
3599
3612
  try {
3600
- E.removeAllRanges(), E.addRange(Y);
3613
+ v.removeAllRanges(), v.addRange(Y);
3601
3614
  } catch (D) {
3602
3615
  }
3603
- r = k;
3616
+ r = w;
3604
3617
  }
3605
3618
  }
3606
3619
  this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
3607
- const w = () => {
3620
+ const C = () => {
3608
3621
  this.dispatchEvent(new CustomEvent("content-change", {
3609
3622
  detail: { html: r },
3610
3623
  bubbles: !0
3611
3624
  }));
3612
3625
  };
3613
- l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(w, l.debounceInputMs) : w(), this.updateStatusBar();
3626
+ l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(C, l.debounceInputMs) : C(), this.updateStatusBar();
3614
3627
  }), this.contentElement.addEventListener("contextmenu", (n) => {
3615
3628
  const r = this.config.contextMenu;
3616
3629
  (r === !1 || typeof r == "object" && r !== null && r.enabled === !1) && n.preventDefault();
3617
3630
  }), this.contentElement.addEventListener("paste", (n) => {
3618
- var b, w;
3631
+ var E, C;
3619
3632
  if (n.__editoraSmartPasteHandled === !0 || n.defaultPrevented)
3620
3633
  return;
3621
3634
  n.preventDefault();
3622
3635
  const r = this.config.paste || {};
3623
- let a = ((b = n.clipboardData) == null ? void 0 : b.getData("text/html")) || "";
3624
- const l = ((w = n.clipboardData) == null ? void 0 : w.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = !!a && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(a);
3636
+ let a = ((E = n.clipboardData) == null ? void 0 : E.getData("text/html")) || "";
3637
+ const l = ((C = n.clipboardData) == null ? void 0 : C.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), f = this.getSecurityConfig(), m = !!a && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(a);
3625
3638
  if ((r.clean || !r.keepFormatting) && l) {
3626
3639
  document.execCommand("insertText", !1, l);
3627
3640
  return;
@@ -3631,7 +3644,7 @@ class W extends HTMLElement {
3631
3644
  return;
3632
3645
  }
3633
3646
  if (a) {
3634
- f.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (a = ni(a, c, f)), this.insertHTMLAtSelection(a);
3647
+ f.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (a = ii(a, c, f)), this.insertHTMLAtSelection(a);
3635
3648
  return;
3636
3649
  }
3637
3650
  l && document.execCommand("insertText", !1, l);
@@ -3720,10 +3733,10 @@ class W extends HTMLElement {
3720
3733
  const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
3721
3734
  if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
3722
3735
  return;
3723
- const n = this.contentElement.textContent || "", { words: r, chars: a } = mn(n), l = hn(this.contentElement);
3736
+ const n = this.contentElement.textContent || "", { words: r, chars: a } = gn(n), l = mn(this.contentElement);
3724
3737
  let c, f;
3725
3738
  const m = this.getSelectionRangeInEditor();
3726
- m && (c = pn(this.contentElement, m), m.collapsed || (f = gn(m, c), c = void 0)), this.statusBar.update({
3739
+ m && (c = fn(this.contentElement, m), m.collapsed || (f = bn(m, c), c = void 0)), this.statusBar.update({
3727
3740
  wordCount: r,
3728
3741
  charCount: a,
3729
3742
  lineCount: l,
@@ -3830,7 +3843,7 @@ class W extends HTMLElement {
3830
3843
  return ((t = this.contentElement) == null ? void 0 : t.innerHTML) || "";
3831
3844
  },
3832
3845
  setContent: (t) => {
3833
- this.contentElement && (this.contentElement.innerHTML = t);
3846
+ this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
3834
3847
  },
3835
3848
  execCommand: (t, e) => this.executeCommand(t, e),
3836
3849
  focus: () => {
@@ -3864,7 +3877,7 @@ class W extends HTMLElement {
3864
3877
  return ((t = this.contentElement) == null ? void 0 : t.innerHTML) || "";
3865
3878
  }
3866
3879
  setContent(t) {
3867
- this.contentElement && (this.contentElement.innerHTML = t);
3880
+ this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
3868
3881
  }
3869
3882
  execCommand(t, ...e) {
3870
3883
  return this.executeCommand(t, ...e);
@@ -3878,7 +3891,7 @@ class W extends HTMLElement {
3878
3891
  (t = this.contentElement) == null || t.blur();
3879
3892
  }
3880
3893
  }
3881
- const Kt = new xo();
3894
+ const Kt = new Co();
3882
3895
  W.__globalPluginLoader = Kt;
3883
3896
  const fi = {
3884
3897
  // Core editing plugins (always loaded)