@editora/core 1.0.24 → 1.0.25

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,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index--wO0CZVN.js");exports.RichTextEditorElement=e.RichTextEditorElement;exports.initWebComponent=e.initWebComponent;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-DHPPVQwx.js");exports.RichTextEditorElement=e.RichTextEditorElement;exports.initWebComponent=e.initWebComponent;
2
2
  //# sourceMappingURL=webcomponent.cjs.js.map
@@ -1,4 +1,4 @@
1
- import { R as t, o as i } from "./index-BICrB5kg.mjs";
1
+ import { R as t, o as i } from "./index-gI4djib2.mjs";
2
2
  export {
3
3
  t as RichTextEditorElement,
4
4
  i as initWebComponent
@@ -1,4 +1,4 @@
1
- class Ao {
1
+ class xo {
2
2
  constructor() {
3
3
  this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
4
4
  }
@@ -403,6 +403,7 @@ class pn {
403
403
  exportPdf: "exportPdf",
404
404
  insertImage: "insertImage",
405
405
  insertVideo: "insertVideo",
406
+ insertAudio: "insertAudio",
406
407
  codeBlock: "insertCodeBlock"
407
408
  };
408
409
  return o.forEach((c) => {
@@ -513,8 +514,8 @@ class pn {
513
514
  break;
514
515
  }
515
516
  v = Math.max(1, Math.min(v, c.length));
516
- const Y = v < c.length;
517
- o.style.display = Y ? "" : "none", o.classList.toggle("active", Y && this.expandedOpen), !Y && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((D, R) => {
517
+ const q = v < c.length;
518
+ o.style.display = q ? "" : "none", o.classList.toggle("active", q && this.expandedOpen), !q && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((D, R) => {
518
519
  R >= v && r.appendChild(D);
519
520
  });
520
521
  }, l = () => {
@@ -1263,16 +1264,16 @@ function Tn() {
1263
1264
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1264
1265
  }
1265
1266
  function Cn(n, t) {
1266
- return wn(n) || kn(n, t) || xn(n, t) || Tn();
1267
+ return wn(n) || kn(n, t) || An(n, t) || Tn();
1267
1268
  }
1268
- function xn(n, t) {
1269
+ function An(n, t) {
1269
1270
  if (n) {
1270
1271
  if (typeof n == "string") return ro(n, t);
1271
1272
  var e = {}.toString.call(n).slice(8, -1);
1272
1273
  return e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set" ? Array.from(n) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ro(n, t) : void 0;
1273
1274
  }
1274
1275
  }
1275
- const So = Object.entries, ao = Object.setPrototypeOf, An = Object.isFrozen, Sn = Object.getPrototypeOf, _n = Object.getOwnPropertyDescriptor;
1276
+ const So = Object.entries, ao = Object.setPrototypeOf, xn = Object.isFrozen, Sn = Object.getPrototypeOf, _n = Object.getOwnPropertyDescriptor;
1276
1277
  let M = Object.freeze, I = Object.seal, gt = Object.create, _o = typeof Reflect != "undefined" && Reflect, ke = _o.apply, Te = _o.construct;
1277
1278
  M || (M = function(t) {
1278
1279
  return t;
@@ -1288,7 +1289,7 @@ Te || (Te = function(t) {
1288
1289
  for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) o[r - 1] = arguments[r];
1289
1290
  return new t(...o);
1290
1291
  });
1291
- const rt = L(Array.prototype.forEach), Ln = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), Tt = L(Array.prototype.push), Mn = L(Array.prototype.splice), bt = Array.isArray, _t = L(String.prototype.toLowerCase), he = L(String.prototype.toString), lo = L(String.prototype.match), Ct = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim), Pn = L(Number.prototype.toString), Dn = L(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), po = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), z = L(Object.prototype.hasOwnProperty), xt = L(Object.prototype.toString), P = L(RegExp.prototype.test), Z = On(TypeError);
1292
+ const rt = L(Array.prototype.forEach), Ln = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), Tt = L(Array.prototype.push), Mn = L(Array.prototype.splice), bt = Array.isArray, _t = L(String.prototype.toLowerCase), he = L(String.prototype.toString), lo = L(String.prototype.match), Ct = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim), Pn = L(Number.prototype.toString), Dn = L(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), po = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), z = L(Object.prototype.hasOwnProperty), At = L(Object.prototype.toString), P = L(RegExp.prototype.test), Z = On(TypeError);
1292
1293
  function L(n) {
1293
1294
  return function(t) {
1294
1295
  t instanceof RegExp && (t.lastIndex = 0);
@@ -1310,7 +1311,7 @@ function E(n, t) {
1310
1311
  let r = t[o];
1311
1312
  if (typeof r == "string") {
1312
1313
  const a = e(r);
1313
- a !== r && (An(t) || (t[o] = a), r = a);
1314
+ a !== r && (xn(t) || (t[o] = a), r = a);
1314
1315
  }
1315
1316
  n[r] = !0;
1316
1317
  }
@@ -1342,19 +1343,19 @@ function Nn(n) {
1342
1343
  case "symbol":
1343
1344
  return po ? po(n) : "Symbol()";
1344
1345
  case "undefined":
1345
- return xt(n);
1346
+ return At(n);
1346
1347
  case "function":
1347
1348
  case "object": {
1348
- if (n === null) return xt(n);
1349
+ if (n === null) return At(n);
1349
1350
  const t = n, e = j(t, "toString");
1350
1351
  if (typeof e == "function") {
1351
1352
  const o = e(t);
1352
- return typeof o == "string" ? o : xt(o);
1353
+ return typeof o == "string" ? o : At(o);
1353
1354
  }
1354
- return xt(n);
1355
+ return At(n);
1355
1356
  }
1356
1357
  default:
1357
- return xt(n);
1358
+ return At(n);
1358
1359
  }
1359
1360
  }
1360
1361
  function j(n, t) {
@@ -2015,7 +2016,7 @@ const fo = M([
2015
2016
  "xlink:title",
2016
2017
  "xml:space",
2017
2018
  "xmlns:xlink"
2018
- ]), Hn = I(/{{[\w\W]*|^[\w\W]*}}/g), Un = I(/<%[\w\W]*|^[\w\W]*%>/g), jn = I(/\${[\w\W]*/g), Wn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), $n = I(/^aria-[\-\w]+$/), bo = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Gn = I(/^(?:\w+script|data):/i), Kn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Yn = I(/^html$/i), qn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), yo = I(/<[/\w!]/g), Eo = I(/<[/\w]/g), Vn = I(/<\/no(script|embed|frames)/i), Xn = I(/\/>/i), F = {
2019
+ ]), Hn = I(/{{[\w\W]*|^[\w\W]*}}/g), Un = I(/<%[\w\W]*|^[\w\W]*%>/g), jn = I(/\${[\w\W]*/g), Wn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), $n = I(/^aria-[\-\w]+$/), bo = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Gn = I(/^(?:\w+script|data):/i), Kn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), qn = I(/^html$/i), Yn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), yo = I(/<[/\w!]/g), Eo = I(/<[/\w]/g), Vn = I(/<\/no(script|embed|frames)/i), Xn = I(/\/>/i), F = {
2019
2020
  element: 1,
2020
2021
  attribute: 2,
2021
2022
  text: 3,
@@ -2090,7 +2091,7 @@ function Mo() {
2090
2091
  n.DocumentFragment;
2091
2092
  const a = n.HTMLTemplateElement, l = n.Node, c = n.Element, f = n.NodeFilter;
2092
2093
  n.NamedNodeMap === void 0 && (n.NamedNodeMap || n.MozNamedAttrMap), n.HTMLFormElement;
2093
- const m = n.DOMParser, g = n.trustedTypes, k = c.prototype, T = j(k, "cloneNode"), w = j(k, "remove"), v = j(k, "removeAttributeNode"), Y = j(k, "nextSibling"), D = j(k, "childNodes"), R = j(k, "parentNode"), Ae = j(k, "shadowRoot"), Vt = j(k, "attributes"), tt = l && l.prototype ? j(l.prototype, "nodeType") : null, at = l && l.prototype ? j(l.prototype, "nodeName") : null, Lt = l && l.prototype ? j(l.prototype, "ownerDocument") : null, yt = function(i) {
2094
+ const m = n.DOMParser, g = n.trustedTypes, k = c.prototype, T = j(k, "cloneNode"), w = j(k, "remove"), v = j(k, "removeAttributeNode"), q = j(k, "nextSibling"), D = j(k, "childNodes"), R = j(k, "parentNode"), xe = j(k, "shadowRoot"), Vt = j(k, "attributes"), tt = l && l.prototype ? j(l.prototype, "nodeType") : null, at = l && l.prototype ? j(l.prototype, "nodeName") : null, Lt = l && l.prototype ? j(l.prototype, "ownerDocument") : null, yt = function(i) {
2094
2095
  return tt ? tt(i) : i.nodeType;
2095
2096
  }, Xt = function(i) {
2096
2097
  return at ? at(i) : i.nodeName;
@@ -2121,8 +2122,8 @@ function Mo() {
2121
2122
  }, Mt = e, Jt = Mt.implementation, Le = Mt.createNodeIterator, Ro = Mt.createDocumentFragment, No = Mt.getElementsByTagName, zo = o.importNode;
2122
2123
  let C = vo();
2123
2124
  t.isSupported = typeof So == "function" && typeof R == "function" && Jt && Jt.createHTMLDocument !== void 0;
2124
- const Bo = Hn, Fo = Un, Ho = jn, Uo = Wn, jo = $n, Wo = Gn, Me = Kn, $o = qn;
2125
- let Ie = bo, x = null;
2125
+ const Bo = Hn, Fo = Un, Ho = jn, Uo = Wn, jo = $n, Wo = Gn, Me = Kn, $o = Yn;
2126
+ let Ie = bo, A = null;
2126
2127
  const Qt = E({}, [
2127
2128
  ...fo,
2128
2129
  ...me,
@@ -2130,7 +2131,7 @@ function Mo() {
2130
2131
  ...be,
2131
2132
  ...ho
2132
2133
  ]);
2133
- let A = null;
2134
+ let x = null;
2134
2135
  const te = E({}, [
2135
2136
  ...mo,
2136
2137
  ...ye,
@@ -2157,7 +2158,7 @@ function Mo() {
2157
2158
  value: !1
2158
2159
  }
2159
2160
  })), vt = null, Pe = null;
2160
- const q = Object.seal(gt(null, {
2161
+ const Y = Object.seal(gt(null, {
2161
2162
  tagCheck: {
2162
2163
  writable: !0,
2163
2164
  configurable: !1,
@@ -2251,14 +2252,14 @@ function Mo() {
2251
2252
  "script"
2252
2253
  ]);
2253
2254
  let wt = null;
2254
- const Yo = ["application/xhtml+xml", "text/html"], qo = "text/html";
2255
+ const qo = ["application/xhtml+xml", "text/html"], Yo = "text/html";
2255
2256
  let _ = null, pt = null;
2256
2257
  const Vo = e.createElement("form"), Ke = function(i) {
2257
2258
  return i instanceof RegExp || i instanceof Function;
2258
2259
  }, de = function() {
2259
2260
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2260
2261
  if (pt && pt === i) return;
2261
- (!i || typeof i != "object") && (i = {}), i = H(i), wt = Yo.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? qo : i.PARSER_MEDIA_TYPE, _ = wt === "application/xhtml+xml" ? he : _t, x = J(i, "ALLOWED_TAGS", Qt, { transform: _ }), A = J(i, "ALLOWED_ATTR", te, { transform: _ }), se = J(i, "ALLOWED_NAMESPACES", Go, { transform: he }), je = J(i, "ADD_URI_SAFE_ATTR", We, {
2262
+ (!i || typeof i != "object") && (i = {}), i = H(i), wt = qo.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Yo : i.PARSER_MEDIA_TYPE, _ = wt === "application/xhtml+xml" ? he : _t, A = J(i, "ALLOWED_TAGS", Qt, { transform: _ }), x = J(i, "ALLOWED_ATTR", te, { transform: _ }), se = J(i, "ALLOWED_NAMESPACES", Go, { transform: he }), je = J(i, "ADD_URI_SAFE_ATTR", We, {
2262
2263
  transform: _,
2263
2264
  base: We
2264
2265
  }), He = J(i, "ADD_DATA_URI_TAGS", Ue, {
@@ -2266,11 +2267,11 @@ function Mo() {
2266
2267
  base: Ue
2267
2268
  }), dt = J(i, "FORBID_CONTENTS", Fe, { transform: _ }), vt = 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, De = i.ALLOW_ARIA_ATTR !== !1, ee = i.ALLOW_DATA_ATTR !== !1, Oe = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = 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, Dt = i.RETURN_DOM_FRAGMENT || !1, Ot = i.RETURN_TRUSTED_TYPE || !1, ne = i.FORCE_BODY || !1, Ne = i.SANITIZE_DOM !== !1, ze = i.SANITIZE_NAMED_PROPS || !1, ie = i.KEEP_CONTENT !== !1, re = i.IN_PLACE || !1, Ie = zn(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : bo, ut = typeof i.NAMESPACE == "string" ? i.NAMESPACE : G, le = Ee(i, "MATHML_TEXT_INTEGRATION_POINTS", () => E({}, $e)), ce = Ee(i, "HTML_INTEGRATION_POINTS", () => E({}, Ge));
2268
2269
  const s = Ee(i, "CUSTOM_ELEMENT_HANDLING", () => gt(null));
2269
- if ($ = gt(null), z(s, "tagNameCheck") && Ke(s.tagNameCheck) && ($.tagNameCheck = s.tagNameCheck), z(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && ($.attributeNameCheck = s.attributeNameCheck), z(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && ($.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I($), V && (ee = !1), Dt && (lt = !0), ct && (x = E({}, ho), A = gt(null), ct.html === !0 && (E(x, fo), E(A, mo)), ct.svg === !0 && (E(x, me), E(A, ye), E(A, Wt)), ct.svgFilters === !0 && (E(x, ge), E(A, ye), E(A, Wt)), ct.mathMl === !0 && (E(x, be), E(A, go), E(A, Wt))), 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 === Qt && (x = H(x)), E(x, i.ADD_TAGS, _))), z(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? q.attributeCheck = i.ADD_ATTR : bt(i.ADD_ATTR) && (A === te && (A = H(A)), E(A, i.ADD_ATTR, _))), z(i, "ADD_FORBID_CONTENTS") && bt(i.ADD_FORBID_CONTENTS) && (dt === Fe && (dt = H(dt)), E(dt, i.ADD_FORBID_CONTENTS, _)), ie && (x["#text"] = !0), nt && E(x, [
2270
+ if ($ = gt(null), z(s, "tagNameCheck") && Ke(s.tagNameCheck) && ($.tagNameCheck = s.tagNameCheck), z(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && ($.attributeNameCheck = s.attributeNameCheck), z(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && ($.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I($), V && (ee = !1), Dt && (lt = !0), ct && (A = E({}, ho), x = gt(null), ct.html === !0 && (E(A, fo), E(x, mo)), ct.svg === !0 && (E(A, me), E(x, ye), E(x, Wt)), ct.svgFilters === !0 && (E(A, ge), E(x, ye), E(x, Wt)), ct.mathMl === !0 && (E(A, be), E(x, go), E(x, Wt))), Y.tagCheck = null, Y.attributeCheck = null, z(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? Y.tagCheck = i.ADD_TAGS : bt(i.ADD_TAGS) && (A === Qt && (A = H(A)), E(A, i.ADD_TAGS, _))), z(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? Y.attributeCheck = i.ADD_ATTR : bt(i.ADD_ATTR) && (x === te && (x = H(x)), E(x, i.ADD_ATTR, _))), z(i, "ADD_FORBID_CONTENTS") && bt(i.ADD_FORBID_CONTENTS) && (dt === Fe && (dt = H(dt)), E(dt, i.ADD_FORBID_CONTENTS, _)), ie && (A["#text"] = !0), nt && E(A, [
2270
2271
  "html",
2271
2272
  "head",
2272
2273
  "body"
2273
- ]), x.table && (E(x, ["tbody"]), delete vt.tbody), i.TRUSTED_TYPES_POLICY) {
2274
+ ]), A.table && (E(A, ["tbody"]), delete vt.tbody), i.TRUSTED_TYPES_POLICY) {
2274
2275
  if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2275
2276
  if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2276
2277
  const d = N;
@@ -2282,16 +2283,16 @@ function Mo() {
2282
2283
  }
2283
2284
  } else i.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Oo()), N && typeof et == "string" && (et = st("")));
2284
2285
  M && M(i), pt = i;
2285
- }, Ye = E({}, [
2286
+ }, qe = E({}, [
2286
2287
  ...me,
2287
2288
  ...ge,
2288
2289
  ...Bn
2289
- ]), qe = E({}, [...be, ...Fn]), Xo = function(i, s, d) {
2290
- return s.namespaceURI === G ? i === "svg" : s.namespaceURI === Rt ? i === "svg" && (d === "annotation-xml" || le[d]) : !!Ye[i];
2290
+ ]), Ye = E({}, [...be, ...Fn]), Xo = function(i, s, d) {
2291
+ return s.namespaceURI === G ? i === "svg" : s.namespaceURI === Rt ? i === "svg" && (d === "annotation-xml" || le[d]) : !!qe[i];
2291
2292
  }, Zo = function(i, s, d) {
2292
- return s.namespaceURI === G ? i === "math" : s.namespaceURI === Nt ? i === "math" && ce[d] : !!qe[i];
2293
+ return s.namespaceURI === G ? i === "math" : s.namespaceURI === Nt ? i === "math" && ce[d] : !!Ye[i];
2293
2294
  }, Jo = function(i, s, d) {
2294
- return s.namespaceURI === Nt && !ce[d] || s.namespaceURI === Rt && !le[d] ? !1 : !qe[i] && (Ko[i] || !Ye[i]);
2295
+ return s.namespaceURI === Nt && !ce[d] || s.namespaceURI === Rt && !le[d] ? !1 : !Ye[i] && (Ko[i] || !qe[i]);
2295
2296
  }, Qo = function(i) {
2296
2297
  let s = R(i);
2297
2298
  (!s || !s.tagName) && (s = {
@@ -2367,7 +2368,7 @@ function Mo() {
2367
2368
  if (s)
2368
2369
  for (let d = s.length - 1; d >= 0; --d) {
2369
2370
  const p = s[d], h = p && p.name;
2370
- typeof h != "string" || A[_(h)] || Ve(i, p, h);
2371
+ typeof h != "string" || x[_(h)] || Ve(i, p, h);
2371
2372
  }
2372
2373
  }, Bt = function(i) {
2373
2374
  const s = [i];
@@ -2479,7 +2480,7 @@ function Mo() {
2479
2480
  const b = h.length;
2480
2481
  for (let y = b - 1; y >= 0; --y) {
2481
2482
  const S = i === d ? T(h[y], !0) : h[y];
2482
- p.insertBefore(S, Y(i));
2483
+ p.insertBefore(S, q(i));
2483
2484
  }
2484
2485
  }
2485
2486
  }
@@ -2493,13 +2494,13 @@ function Mo() {
2493
2494
  if (Ht(i))
2494
2495
  return X(i), !0;
2495
2496
  const d = _(Xt(i));
2496
- if (x = Qe(C.uponSanitizeElement, x, Qt, It), K(C.uponSanitizeElement, i, {
2497
+ if (A = Qe(C.uponSanitizeElement, A, Qt, It), K(C.uponSanitizeElement, i, {
2497
2498
  tagName: d,
2498
- allowedTags: x
2499
+ allowedTags: A
2499
2500
  }), ht(i, s)) return !0;
2500
2501
  if (on(i, d))
2501
2502
  return X(i), !0;
2502
- if (vt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !x[d]) {
2503
+ if (vt[d] || !(Y.tagCheck instanceof Function && Y.tagCheck(d)) && !A[d]) {
2503
2504
  const p = nn(i, d, s);
2504
2505
  return p === !1 && (K(C.afterSanitizeElements, i, null), ht(i, s)) ? !0 : p;
2505
2506
  }
@@ -2512,7 +2513,7 @@ function Mo() {
2512
2513
  return K(C.afterSanitizeElements, i, null), ht(i, s);
2513
2514
  }, eo = function(i, s, d) {
2514
2515
  if (Pe[s] || Xe(s, i) || Ne && (s === "id" || s === "name") && (d in e || d in Vo)) return !1;
2515
- const p = A[s] || q.attributeCheck instanceof Function && q.attributeCheck(s, i);
2516
+ const p = x[s] || Y.attributeCheck instanceof Function && Y.attributeCheck(s, i);
2516
2517
  return ee && P(Uo, s) || De && P(jo, s) ? !0 : p ? je[s] || P(Ie, Ct(d, Me, "")) || (s === "src" || s === "xlink:href" || s === "href") && i !== "script" && co(d, "data:") === 0 && He[i] || Oe && !P(Wo, Ct(d, Me, "")) ? !0 : !d : oo(i) && Ut($.tagNameCheck, i) && Ut($.attributeNameCheck, s, i) || s === "is" && $.allowCustomizedBuiltInElements && Ut($.tagNameCheck, d);
2517
2518
  }, rn = E({}, [
2518
2519
  "annotation-xml",
@@ -2543,12 +2544,12 @@ function Mo() {
2543
2544
  if (K(C.beforeSanitizeAttributes, i, null), ht(i, s)) return;
2544
2545
  const d = i.attributes;
2545
2546
  if (!d || Ht(i)) return;
2546
- A = Qe(C.uponSanitizeAttribute, A, te, Pt);
2547
+ x = Qe(C.uponSanitizeAttribute, x, te, Pt);
2547
2548
  const p = {
2548
2549
  attrName: "",
2549
2550
  attrValue: "",
2550
2551
  keepAttr: !0,
2551
- allowedAttributes: A,
2552
+ allowedAttributes: x,
2552
2553
  forceKeepAttr: void 0
2553
2554
  };
2554
2555
  let h = d.length;
@@ -2586,7 +2587,7 @@ function Mo() {
2586
2587
  const d = Je(i);
2587
2588
  for (K(C.beforeSanitizeShadowDOM, i, null); s = d.nextNode(); )
2588
2589
  if (K(C.uponSanitizeShadowNode, s, null), to(s, i), no(s, i), ft(s.content) && jt(s.content), yt(s) === F.element) {
2589
- const p = Ae(s);
2590
+ const p = xe(s);
2590
2591
  ft(p) && (pe(p), jt(p));
2591
2592
  }
2592
2593
  K(C.afterSanitizeShadowDOM, i, null);
@@ -2617,7 +2618,7 @@ function Mo() {
2617
2618
  }
2618
2619
  }
2619
2620
  if (h) {
2620
- const y = Ae(p);
2621
+ const y = xe(p);
2621
2622
  ft(y) && s.push({
2622
2623
  node: null,
2623
2624
  shadow: y
@@ -2633,14 +2634,14 @@ function Mo() {
2633
2634
  if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !kt(u) && (u = Nn(u), typeof u != "string"))
2634
2635
  throw Z("dirty is not a string, aborting");
2635
2636
  if (!t.isSupported) return u;
2636
- oe ? (x = It, A = Pt) : de(i), (C.uponSanitizeElement.length > 0 || C.uponSanitizeAttribute.length > 0) && (x = H(x)), C.uponSanitizeAttribute.length > 0 && (A = H(A)), t.removed = [];
2637
+ oe ? (A = It, x = Pt) : de(i), (C.uponSanitizeElement.length > 0 || C.uponSanitizeAttribute.length > 0) && (A = H(A)), C.uponSanitizeAttribute.length > 0 && (x = H(x)), t.removed = [];
2637
2638
  const b = re && typeof u != "string" && kt(u);
2638
2639
  if (b) {
2639
2640
  en(u);
2640
2641
  const U = Xt(u);
2641
2642
  if (typeof U == "string") {
2642
2643
  const B = _(U);
2643
- if (!x[B] || vt[B])
2644
+ if (!A[B] || vt[B])
2644
2645
  throw zt(u), Z("root node is forbidden and cannot be sanitized in-place");
2645
2646
  }
2646
2647
  if (Ht(u))
@@ -2678,14 +2679,14 @@ function Mo() {
2678
2679
  if (V && ue(s), Dt)
2679
2680
  for (h = Ro.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
2680
2681
  else h = s;
2681
- return (A.shadowroot || A.shadowrootmode) && (h = zo.call(o, h, !0)), h;
2682
+ return (x.shadowroot || x.shadowrootmode) && (h = zo.call(o, h, !0)), h;
2682
2683
  }
2683
2684
  let S = nt ? s.outerHTML : s.innerHTML;
2684
- return nt && x["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && P(Yn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
2685
+ return nt && A["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && P(qn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
2685
2686
  ` + S), V && (S = Ft(S)), N && Ot ? st(S) : S;
2686
2687
  }, t.setConfig = function() {
2687
2688
  let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2688
- de(u), oe = !0, It = x, Pt = A;
2689
+ de(u), oe = !0, It = A, Pt = x;
2689
2690
  }, t.clearConfig = function() {
2690
2691
  pt = null, oe = !1, It = null, Pt = null, N = Zt, et = "";
2691
2692
  }, t.isValidAttribute = function(u, i, s) {
@@ -2745,6 +2746,9 @@ const ei = [
2745
2746
  "span",
2746
2747
  "div",
2747
2748
  "section",
2749
+ // A captioned image or video (the media manager's output). Neither carries behaviour of its own.
2750
+ "figure",
2751
+ "figcaption",
2748
2752
  "sup",
2749
2753
  "sub",
2750
2754
  "hr"
@@ -2819,7 +2823,7 @@ function ai(n, t, e) {
2819
2823
  function wo(n, t, e, o) {
2820
2824
  return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? n : Io(n, t, o, !0);
2821
2825
  }
2822
- const si = ".resize-handle, .table-resize-handle", li = /resize-handle/;
2826
+ const si = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", li = /resize-handle|data-rte-media-pending|rte-media/;
2823
2827
  function Po(n) {
2824
2828
  if (!n || !li.test(n)) return n;
2825
2829
  const t = document.createElement("template");
@@ -2831,12 +2835,17 @@ function Po(n) {
2831
2835
  }), e.forEach((o) => {
2832
2836
  var r;
2833
2837
  o.style.position === "relative" && (o.style.removeProperty("position"), (r = o.getAttribute("style")) != null && r.trim() || o.removeAttribute("style"));
2838
+ }), t.content.querySelectorAll("figure.rte-media").forEach((o) => {
2839
+ var a;
2840
+ o.removeAttribute("contenteditable");
2841
+ const r = o.querySelector(":scope > figcaption");
2842
+ r && (r.removeAttribute("contenteditable"), !((a = r.textContent) != null && a.trim()) && !r.querySelector("img, video, a") && r.remove());
2834
2843
  }), t.innerHTML;
2835
2844
  }
2836
- function At(n) {
2845
+ function xt(n) {
2837
2846
  return n ? Po(n.innerHTML) : "";
2838
2847
  }
2839
- const qt = class qt {
2848
+ const Yt = class Yt {
2840
2849
  /**
2841
2850
  * Resolve configuration from multiple sources with priority
2842
2851
  */
@@ -3028,7 +3037,7 @@ const qt = class qt {
3028
3037
  return e;
3029
3038
  }
3030
3039
  };
3031
- qt.EDITOR_DEFAULTS = {
3040
+ Yt.EDITOR_DEFAULTS = {
3032
3041
  height: 400,
3033
3042
  width: "100%",
3034
3043
  readonly: !1,
@@ -3077,7 +3086,7 @@ qt.EDITOR_DEFAULTS = {
3077
3086
  sanitizeOnInput: !0
3078
3087
  },
3079
3088
  statusbar: !1
3080
- }, qt.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
3089
+ }, Yt.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
3081
3090
  "readonly",
3082
3091
  "disabled",
3083
3092
  "autofocus",
@@ -3097,12 +3106,12 @@ qt.EDITOR_DEFAULTS = {
3097
3106
  "security-sanitize-on-paste",
3098
3107
  "security-sanitize-on-input"
3099
3108
  ]);
3100
- let Ce = qt;
3109
+ let Ce = Yt;
3101
3110
  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}}';
3102
3111
  let Gt;
3103
- const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", ko = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", To = ".rte-content, .editora-content", pi = "Rich text editor", xe = /* @__PURE__ */ new Set();
3112
+ const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", ko = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", To = ".rte-content, .editora-content", pi = "Rich text editor", Ae = /* @__PURE__ */ new Set();
3104
3113
  let Q = null, Co = !1, ve = null, we = null;
3105
- function xo(n) {
3114
+ function Ao(n) {
3106
3115
  if (!(n instanceof HTMLElement)) return !1;
3107
3116
  const t = n;
3108
3117
  return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
@@ -3112,10 +3121,10 @@ function fi(n) {
3112
3121
  }
3113
3122
  function St(n) {
3114
3123
  if (!n) return null;
3115
- if (xo(n))
3124
+ if (Ao(n))
3116
3125
  return n;
3117
3126
  const t = n.matches(ko) ? n : n.closest(ko);
3118
- return !t || !xo(t) ? null : t;
3127
+ return !t || !Ao(t) ? null : t;
3119
3128
  }
3120
3129
  function hi() {
3121
3130
  var r;
@@ -3147,7 +3156,7 @@ function hi() {
3147
3156
  }
3148
3157
  if (Q && Q.isConnected)
3149
3158
  return Q;
3150
- for (const a of xe)
3159
+ for (const a of Ae)
3151
3160
  if (a.isConnected) return a;
3152
3161
  return null;
3153
3162
  }
@@ -3170,7 +3179,7 @@ function gi() {
3170
3179
  function bi() {
3171
3180
  if (!Gt) {
3172
3181
  const n = W.__globalPluginLoader;
3173
- n ? Gt = n : Gt = new Ao();
3182
+ n ? Gt = n : Gt = new xo();
3174
3183
  }
3175
3184
  return Gt;
3176
3185
  }
@@ -3278,7 +3287,7 @@ class W extends HTMLElement {
3278
3287
  async initialize() {
3279
3288
  var r;
3280
3289
  if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
3281
- this.setAttribute("data-editora-editor", "true"), xe.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}`);
3290
+ 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}`);
3282
3291
  const t = await this.loadPlugins();
3283
3292
  if (this.loadedPlugins = t, t.forEach((a) => {
3284
3293
  if (a.init && typeof a.init == "function")
@@ -3599,7 +3608,7 @@ class W extends HTMLElement {
3599
3608
  this.stopAutosave();
3600
3609
  const t = this.getAutosaveConfig();
3601
3610
  !t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
3602
- this.persistAutosave(At(this.contentElement));
3611
+ this.persistAutosave(xt(this.contentElement));
3603
3612
  }, t.intervalMs));
3604
3613
  }
3605
3614
  insertHTMLAtSelection(t) {
@@ -3700,10 +3709,10 @@ class W extends HTMLElement {
3700
3709
  if (this.lastBeforeInputType = null, f.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
3701
3710
  const w = wo(r, c, f, a);
3702
3711
  if (w !== r) {
3703
- const v = window.getSelection(), Y = v && v.rangeCount > 0 ? v.getRangeAt(0) : null;
3704
- if (this.contentElement.innerHTML = w, Y && v)
3712
+ const v = window.getSelection(), q = v && v.rangeCount > 0 ? v.getRangeAt(0) : null;
3713
+ if (this.contentElement.innerHTML = w, q && v)
3705
3714
  try {
3706
- v.removeAllRanges(), v.addRange(Y);
3715
+ v.removeAllRanges(), v.addRange(q);
3707
3716
  } catch (D) {
3708
3717
  }
3709
3718
  r = w;
@@ -3745,7 +3754,7 @@ class W extends HTMLElement {
3745
3754
  Q = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
3746
3755
  }), this.contentElement.addEventListener("blur", () => {
3747
3756
  this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
3748
- detail: { html: At(this.contentElement) },
3757
+ detail: { html: xt(this.contentElement) },
3749
3758
  bubbles: !0
3750
3759
  })), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
3751
3760
  }), this.contentElement.addEventListener("keydown", (o) => {
@@ -3932,7 +3941,7 @@ class W extends HTMLElement {
3932
3941
  */
3933
3942
  getAPI() {
3934
3943
  return {
3935
- getContent: () => At(this.contentElement),
3944
+ getContent: () => xt(this.contentElement),
3936
3945
  setContent: (t) => {
3937
3946
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
3938
3947
  },
@@ -3960,11 +3969,11 @@ class W extends HTMLElement {
3960
3969
  */
3961
3970
  destroy() {
3962
3971
  var t, e, o, r;
3963
- this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = At(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(), (r = this.statusBar) == null || r.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, xe.delete(this), Q === this && (Q = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
3972
+ this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = xt(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(), (r = this.statusBar) == null || r.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 }));
3964
3973
  }
3965
3974
  // Public API methods
3966
3975
  getContent() {
3967
- return At(this.contentElement);
3976
+ return xt(this.contentElement);
3968
3977
  }
3969
3978
  setContent(t) {
3970
3979
  this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
@@ -3981,8 +3990,8 @@ class W extends HTMLElement {
3981
3990
  (t = this.contentElement) == null || t.blur();
3982
3991
  }
3983
3992
  }
3984
- const Yt = new Ao();
3985
- W.__globalPluginLoader = Yt;
3993
+ const qt = new xo();
3994
+ W.__globalPluginLoader = qt;
3986
3995
  const yi = {
3987
3996
  // Core editing plugins (always loaded)
3988
3997
  bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((n) => n.BoldPlugin()),
@@ -3992,7 +4001,7 @@ const yi = {
3992
4001
  clearFormatting: () => import("./ClearFormattingPlugin.native-Pp0O-SBf.mjs").then((n) => n.ClearFormattingPlugin()),
3993
4002
  heading: () => import("./HeadingPlugin.native-C3YiGERx.mjs").then((n) => n.HeadingPlugin()),
3994
4003
  blockquote: () => import("./BlockquotePlugin.native-D8jjGd0c.mjs").then((n) => n.BlockquotePlugin()),
3995
- code: () => import("./CodePlugin.native-BRBEIqY7.mjs").then((n) => n.CodePlugin()),
4004
+ code: () => import("./CodePlugin.native-CRpX2G93.mjs").then((n) => n.CodePlugin()),
3996
4005
  codeSample: () => import("./CodeSamplePlugin.native-Bai8bgl3.mjs").then((n) => n.CodeSamplePlugin()),
3997
4006
  list: () => import("./ListPlugin.native-UYaoRiub.mjs").then((n) => n.ListPlugin()),
3998
4007
  checklist: () => import("./ChecklistPlugin.native-DLedNLsb.mjs").then((n) => n.ChecklistPlugin()),
@@ -4050,7 +4059,7 @@ const yi = {
4050
4059
  anchor: () => import("./AnchorPlugin.native-Dk9R26cF.mjs").then((n) => n.AnchorPlugin()),
4051
4060
  embedIframe: () => import("./EmbedIframePlugin.native-qHMf1Jtg.mjs").then((n) => n.EmbedIframePlugin()),
4052
4061
  math: () => import("./MathPlugin.native-Cq9WQ7cq.mjs").then((n) => n.MathPlugin()),
4053
- image: () => import("./MediaManagerPlugin.native-CRi24Mrb.mjs").then((n) => n.MediaManagerPlugin()),
4062
+ image: () => import("./MediaManagerPlugin.native-0YFHZfsb.mjs").then((n) => n.MediaManagerPlugin()),
4054
4063
  mergeTag: () => import("./MergeTagPlugin.native-BXkVPvCo.mjs").then((n) => n.MergeTagPlugin()),
4055
4064
  pageBreak: () => import("./PageBreakPlugin.native-DijGuHJZ.mjs").then((n) => n.PageBreakPlugin()),
4056
4065
  print: () => import("./PrintPlugin.native-7qt5v7L5.mjs").then((n) => n.PrintPlugin()),
@@ -4063,15 +4072,15 @@ const yi = {
4063
4072
  a11yChecker: () => import("./A11yCheckerPlugin.native-BBCsR5Ur.mjs").then((n) => n.A11yCheckerPlugin()),
4064
4073
  comments: () => import("./CommentsPlugin.native-DHCDUm9f.mjs").then((n) => n.CommentsPlugin()),
4065
4074
  collaboration: () => import("./CollaborationPlugin.native-Bl3R9CRI.mjs").then((n) => n.CollaborationPlugin()),
4066
- "document-manager": () => import("./DocumentManagerPlugin.native-tZqIa9o5.mjs").then((n) => n.DocumentManagerPlugin()),
4075
+ "document-manager": () => import("./DocumentManagerPlugin.native-CaBqCH-p.mjs").then((n) => n.DocumentManagerPlugin()),
4067
4076
  fullscreen: () => import("./FullscreenPlugin.native-ChXyxeNw.mjs").then((n) => n.FullscreenPlugin()),
4068
4077
  template: () => import("./TemplatePlugin.native-OD8Wc1R7.mjs").then((n) => n.TemplatePlugin()),
4069
4078
  footnote: () => import("./FootnotePlugin.native-D730OGRm.mjs").then((n) => n.FootnotePlugin())
4070
4079
  };
4071
4080
  async function Ei() {
4072
4081
  return Object.entries(yi).forEach(([n, t]) => {
4073
- Yt.register(n, t);
4074
- }), Yt;
4082
+ qt.register(n, t);
4083
+ }), qt;
4075
4084
  }
4076
4085
  typeof window != "undefined" && Ei().then((n) => {
4077
4086
  W.__globalPluginLoader = n, customElements.get("editora-editor") || customElements.define("editora-editor", W);
@@ -4086,7 +4095,7 @@ typeof window != "undefined" && Ei().then((n) => {
4086
4095
  e[l] && a.setAttribute("data-initial-content", e[l]);
4087
4096
  }), window.Editora = {
4088
4097
  version: "1.0.0",
4089
- plugins: Yt.getRegisteredPluginNames(),
4098
+ plugins: qt.getRegisteredPluginNames(),
4090
4099
  WebComponent: W,
4091
4100
  init: async (a, l) => {
4092
4101
  const c = document.querySelector(a);