@editora/core 1.0.14 → 1.0.16

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.
Files changed (73) hide show
  1. package/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-DIKuCeFw.mjs} +82 -79
  2. package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-DXZdK3zr.mjs} +72 -71
  3. package/dist/{ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs → ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs} +239 -238
  4. package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-H3XyYD7_.mjs} +2 -2
  5. package/dist/{BlocksLibraryPlugin.native-5sdsXsiE.mjs → BlocksLibraryPlugin.native-CownM6Rk.mjs} +140 -116
  6. package/dist/{CapitalizationPlugin.native-DLV4oPmB.mjs → CapitalizationPlugin.native-C-HRbXGh.mjs} +10 -5
  7. package/dist/{ChecklistPlugin.native-BS-kMz9O.mjs → ChecklistPlugin.native-NVrBUkaL.mjs} +141 -103
  8. package/dist/{CitationsPlugin.native-DQgoCd1B.mjs → CitationsPlugin.native-C_7wWQ-k.mjs} +441 -422
  9. package/dist/{ClearFormattingPlugin.native-B6ro3a1h.mjs → ClearFormattingPlugin.native-Pp0O-SBf.mjs} +24 -23
  10. package/dist/{CodePlugin.native-veDC_kx5.mjs → CodePlugin.native-BH-K4xmW.mjs} +1049 -917
  11. package/dist/CodePlugin.native-hNgfXlfS.mjs +4767 -0
  12. package/dist/CodeSamplePlugin.native-svbAFWh_.mjs +501 -0
  13. package/dist/CollaborationPlugin.native-oSybCGPW.mjs +7468 -0
  14. package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-CLip9wAO.mjs} +233 -185
  15. package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-Bf7XgRSW.mjs} +401 -351
  16. package/dist/{DataBindingPlugin.native-BoXwghTz.mjs → DataBindingPlugin.native-B7lpI_0c.mjs} +29 -28
  17. package/dist/{DocumentManagerPlugin.native-C2cs_1w4.mjs → DocumentManagerPlugin.native-iFip6s4Q.mjs} +94 -45
  18. package/dist/{EmbedIframePlugin.native-BF_-LjTq.mjs → EmbedIframePlugin.native-BfZ_HGlV.mjs} +231 -186
  19. package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-D92aaOKi.mjs} +288 -76
  20. package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-M3cNQ0KA.mjs} +57 -50
  21. package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-DsLrH8eq.mjs} +41 -34
  22. package/dist/{FormatPainterPlugin.native-CsMrKfFU.mjs → FormatPainterPlugin.native-BhjzsiVq.mjs} +3 -2
  23. package/dist/{HistoryPlugin.native-D2wl32jV.mjs → HistoryPlugin.native-DPvhks6h.mjs} +36 -32
  24. package/dist/LinkPlugin.native-BsQXYsK6.mjs +352 -0
  25. package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-Bt0LANbO.mjs} +68 -35
  26. package/dist/{MathPlugin.native-NwWPHVmj.mjs → MathPlugin.native-Byo3WL0f.mjs} +211 -115
  27. package/dist/{MediaManagerPlugin.native-eOsTJFpw.mjs → MediaManagerPlugin.native-BT1NZIJS.mjs} +139 -134
  28. package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-S_lwGZQO.mjs} +23 -18
  29. package/dist/{MergeTagPlugin.native-BzRVoD9-.mjs → MergeTagPlugin.native-7-6F3S1Y.mjs} +44 -43
  30. package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-CiR51jql.mjs} +31 -28
  31. package/dist/{SlashCommandsPlugin.native-BiN6ODw5.mjs → SlashCommandsPlugin.native-BDIIwGNs.mjs} +90 -79
  32. package/dist/{SmartPastePlugin.native-CZAEHkyt.mjs → SmartPastePlugin.native-BATLCds5.mjs} +89 -85
  33. package/dist/{SpecialCharactersPlugin.native-DaG4b19I.mjs → SpecialCharactersPlugin.native-CdZoc1GB.mjs} +73 -26
  34. package/dist/SpellCheckPlugin.native-Bef2oTLB.mjs +10935 -0
  35. package/dist/TablePlugin.native-BjIxYZ2X.mjs +772 -0
  36. package/dist/{TemplatePlugin.native-DLjFUaPW.mjs → TemplatePlugin.native-D6n5RUnC.mjs} +288 -262
  37. package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-KMZ2uzlq.mjs} +2 -2
  38. package/dist/{TranslationWorkflowPlugin.native-DdF16tgT.mjs → TranslationWorkflowPlugin.native-CZtG--06.mjs} +67 -65
  39. package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-Ca1fMWUJ.mjs} +42 -42
  40. package/dist/anchoredPopover-DJFD2oAP.mjs +116 -0
  41. package/dist/core.css +1 -1
  42. package/dist/dialogHelpers-DBf7WqYH.mjs +40 -0
  43. package/dist/{documentManager-vQ1VkbUY.mjs → documentManager-BcBIv5P-.mjs} +3 -3
  44. package/dist/editora.min.js +26 -24
  45. package/dist/editora.umd.js +26 -24
  46. package/dist/escapeHtml-CX8RelZ1.mjs +7 -0
  47. package/dist/historyHelpers-B0-4mq1E.mjs +15 -0
  48. package/dist/index-B1_vtXRz.mjs +3910 -0
  49. package/dist/index-C6BoNR2t.js +12 -0
  50. package/dist/{index-BslAFzmv.mjs → index-CavM-mEM.mjs} +6391 -6203
  51. package/dist/index.cjs.js +3 -3
  52. package/dist/{index.es-BYD2KEo6.mjs → index.es-BK-4TPv8.mjs} +1562 -1546
  53. package/dist/index.esm.js +17 -14
  54. package/dist/{jspdf.es.min-BJGtOnRT.mjs → jspdf.es.min-BsnKYYHL.mjs} +4 -3
  55. package/dist/plugin-loader.js +53 -52
  56. package/dist/{purify.es-CKpwg8Tk.mjs → purify.es-DhWKBjsL.mjs} +3 -3
  57. package/dist/webcomponent-core.js +2039 -473
  58. package/dist/webcomponent-core.min.css +1 -1
  59. package/dist/webcomponent-core.min.js +100 -70
  60. package/dist/webcomponent.cjs.js +1 -1
  61. package/dist/webcomponent.esm.js +1 -1
  62. package/dist/webcomponent.js +2208 -641
  63. package/dist/webcomponent.min.css +1 -1
  64. package/dist/webcomponent.min.js +1575 -1209
  65. package/index.d.ts +32 -0
  66. package/package.json +10 -3
  67. package/dist/CodeSamplePlugin.native-CgGoH-X4.mjs +0 -384
  68. package/dist/LinkPlugin.native-DYCIcdTm.mjs +0 -283
  69. package/dist/SpellCheckPlugin.native-BZB9AewP.mjs +0 -1039
  70. package/dist/TablePlugin.native-DrHX-efe.mjs +0 -495
  71. package/dist/anchoredPopover-Bxds0VoB.mjs +0 -110
  72. package/dist/index-B9MPiUAR.mjs +0 -2341
  73. package/dist/index-BLm1MtzH.js +0 -10
@@ -1,4 +1,4 @@
1
- class I {
1
+ class xo {
2
2
  constructor() {
3
3
  this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
4
4
  }
@@ -17,16 +17,16 @@ class I {
17
17
  const o = this.pluginRegistry.get(t);
18
18
  if (!o)
19
19
  return console.warn(`Plugin not found: ${t}`), null;
20
- const n = await o();
21
- return e && this.applyPluginConfig(n, e), this.loadedPlugins.set(t, n), n;
20
+ const i = await o();
21
+ return e && this.applyPluginConfig(i, e), this.loadedPlugins.set(t, i), i;
22
22
  }
23
23
  /**
24
24
  * Load multiple plugins
25
25
  */
26
26
  async loadMultiple(t, e) {
27
27
  return (await Promise.all(
28
- t.map((n) => this.load(n, e))
29
- )).filter((n) => n !== null);
28
+ t.map((i) => this.load(i, e))
29
+ )).filter((i) => i !== null);
30
30
  }
31
31
  /**
32
32
  * Parse plugin string "lists link image media"
@@ -72,19 +72,19 @@ class I {
72
72
  return this.loadedPlugins.has(t);
73
73
  }
74
74
  }
75
- class v {
75
+ class Gt {
76
76
  constructor(t, e, o) {
77
77
  this.doc = t, this.selection = e, this.schema = o;
78
78
  }
79
79
  static create(t, e) {
80
80
  const o = e || t.node("doc", {}, [t.node("paragraph")]);
81
- return new v(o, { anchor: 0, head: 0 }, t);
81
+ return new Gt(o, { anchor: 0, head: 0 }, t);
82
82
  }
83
83
  apply(t, e) {
84
- return new v(t, e || this.selection, this.schema);
84
+ return new Gt(t, e || this.selection, this.schema);
85
85
  }
86
86
  }
87
- class N {
87
+ class rn {
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 N {
95
95
  return { type: "text", text: t, marks: e };
96
96
  }
97
97
  }
98
- class B {
98
+ class an {
99
99
  constructor() {
100
100
  this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
101
101
  }
@@ -105,14 +105,14 @@ class B {
105
105
  if (t.initialize)
106
106
  try {
107
107
  t.initialize(o);
108
- } catch (n) {
109
- console.error(`Failed to initialize plugin "${t.name}":`, n);
108
+ } catch (i) {
109
+ console.error(`Failed to initialize plugin "${t.name}":`, i);
110
110
  }
111
111
  if (t.init && t.init !== t.initialize)
112
112
  try {
113
113
  t.init(o);
114
- } catch (n) {
115
- console.error(`Failed to run init hook for plugin "${t.name}":`, n);
114
+ } catch (i) {
115
+ console.error(`Failed to run init hook for plugin "${t.name}":`, i);
116
116
  }
117
117
  }
118
118
  unregister(t) {
@@ -132,7 +132,7 @@ class B {
132
132
  const t = {}, e = {};
133
133
  return this.plugins.forEach((o) => {
134
134
  o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
135
- }), new N(t, e);
135
+ }), new rn(t, e);
136
136
  }
137
137
  getCommands() {
138
138
  const t = {};
@@ -147,35 +147,35 @@ class B {
147
147
  * Execute plugin command with mode awareness
148
148
  */
149
149
  async executePluginCommand(t, e, ...o) {
150
- const n = this.getPlugin(t);
151
- if (!n)
150
+ const i = this.getPlugin(t);
151
+ if (!i)
152
152
  throw new Error(`Plugin not found: ${t}`);
153
- const i = this.getPluginConfig(t) || n.config || {}, r = i.mode || "local";
153
+ const r = this.getPluginConfig(t) || i.config || {}, l = r.mode || "local";
154
154
  try {
155
- switch (r) {
155
+ switch (l) {
156
156
  case "local":
157
- return n.executeLocal ? n.executeLocal(e, ...o) : null;
157
+ return i.executeLocal ? i.executeLocal(e, ...o) : null;
158
158
  case "api":
159
- if (!n.executeAPI)
159
+ if (!i.executeAPI)
160
160
  throw new Error(`Plugin ${t} does not support API mode`);
161
- return await n.executeAPI(e, ...o);
161
+ return await i.executeAPI(e, ...o);
162
162
  case "hybrid":
163
- if (n.executeHybrid)
164
- return await n.executeHybrid(e, ...o);
163
+ if (i.executeHybrid)
164
+ return await i.executeHybrid(e, ...o);
165
165
  try {
166
- if (n.executeAPI)
167
- return await n.executeAPI(e, ...o);
168
- } catch (s) {
169
- if (console.warn(`API execution failed for ${t}, falling back to local`, s), n.executeLocal && i.fallbackToLocal !== !1)
170
- return n.executeLocal(e, ...o);
171
- throw s;
166
+ if (i.executeAPI)
167
+ return await i.executeAPI(e, ...o);
168
+ } catch (c) {
169
+ if (console.warn(`API execution failed for ${t}, falling back to local`, c), i.executeLocal && r.fallbackToLocal !== !1)
170
+ return i.executeLocal(e, ...o);
171
+ throw c;
172
172
  }
173
173
  break;
174
174
  default:
175
- throw new Error(`Unknown plugin mode: ${r}`);
175
+ throw new Error(`Unknown plugin mode: ${l}`);
176
176
  }
177
- } catch (s) {
178
- throw console.error(`Error executing command ${e} on plugin ${t}:`, s), s;
177
+ } catch (c) {
178
+ throw console.error(`Error executing command ${e} on plugin ${t}:`, c), c;
179
179
  }
180
180
  }
181
181
  /**
@@ -186,7 +186,7 @@ class B {
186
186
  await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
187
187
  }
188
188
  }
189
- class O {
189
+ class sn {
190
190
  constructor(t = {}) {
191
191
  this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
192
192
  this.register(e, o);
@@ -229,11 +229,11 @@ class O {
229
229
  this.commands.clear();
230
230
  }
231
231
  }
232
- class z {
232
+ class ln {
233
233
  constructor(t = {}) {
234
- this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new B(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
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((o) => this.pluginManager.register(o));
235
235
  const e = this.pluginManager.buildSchema();
236
- this.state = v.create(e), this.commandRegistry = new O(this.pluginManager.getCommands());
236
+ this.state = Gt.create(e), this.commandRegistry = new sn(this.pluginManager.getCommands());
237
237
  }
238
238
  /**
239
239
  * Execute a command
@@ -246,12 +246,12 @@ class z {
246
246
  const o = this.commandRegistry.get(t);
247
247
  if (!o)
248
248
  return console.warn(`Command not found: ${t}`), !1;
249
- let n;
250
- return e.length === 0 ? n = o(this.state) : e.length === 1 ? n = o(this.state, e[0]) : n = o(this.state, ...e), n instanceof Promise ? (n.then((i) => {
251
- i && typeof i == "object" && "doc" in i && "selection" in i && (this.setState(i), this.emit("change", this.state));
252
- }).catch((i) => {
253
- console.error(`Async command failed: ${t}`, i);
254
- }), !0) : n && typeof n == "object" && "doc" in n && "selection" in n ? (this.setState(n), this.emit("change", this.state), !0) : n !== !1 && n != null;
249
+ let i;
250
+ return e.length === 0 ? i = o(this.state) : e.length === 1 ? i = o(this.state, e[0]) : i = o(this.state, ...e), i instanceof Promise ? (i.then((r) => {
251
+ r && typeof r == "object" && "doc" in r && "selection" in r && (this.setState(r), this.emit("change", this.state));
252
+ }).catch((r) => {
253
+ console.error(`Async command failed: ${t}`, r);
254
+ }), !0) : i && typeof i == "object" && "doc" in i && "selection" in i ? (this.setState(i), this.emit("change", this.state), !0) : i !== !1 && i != null;
255
255
  }
256
256
  /**
257
257
  * Update editor state
@@ -284,8 +284,8 @@ class z {
284
284
  return this.listeners.has(t) || this.listeners.set(t, []), this.listeners.get(t).push(e), () => {
285
285
  const o = this.listeners.get(t);
286
286
  if (o) {
287
- const n = o.indexOf(e);
288
- n > -1 && o.splice(n, 1);
287
+ const i = o.indexOf(e);
288
+ i > -1 && o.splice(i, 1);
289
289
  }
290
290
  };
291
291
  }
@@ -294,11 +294,11 @@ class z {
294
294
  */
295
295
  emit(t, ...e) {
296
296
  const o = this.listeners.get(t);
297
- o && o.forEach((n) => {
297
+ o && o.forEach((i) => {
298
298
  try {
299
- n(...e);
300
- } catch (i) {
301
- console.error(`Error in ${t} handler:`, i);
299
+ i(...e);
300
+ } catch (r) {
301
+ console.error(`Error in ${t} handler:`, r);
302
302
  }
303
303
  });
304
304
  }
@@ -315,16 +315,20 @@ class z {
315
315
  return this.isDestroyed;
316
316
  }
317
317
  }
318
- class R {
319
- // PluginLoader instance to get all registered plugins
318
+ class cn {
319
+ constructor(t, e, o) {
320
+ this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (i) => {
321
+ var l, c;
322
+ if (!this.expandedOpen) return;
323
+ const r = i.target;
324
+ r && ((l = this.moreButton) != null && l.contains(r) || (c = this.expandedRow) != null && c.contains(r)) || this.setExpandedOpen(!1);
325
+ }, this.config = t, this.plugins = e, this.pluginLoader = o;
326
+ }
320
327
  setLastCommandTrigger(t, e) {
321
328
  if (typeof window == "undefined" || !t) return;
322
329
  const o = e || t.getAttribute("data-command") || void 0;
323
330
  o && (window.__editoraLastCommandButton = t, window.__editoraLastCommand = o);
324
331
  }
325
- constructor(t, e, o) {
326
- this.config = t, this.plugins = e, this.pluginLoader = o;
327
- }
328
332
  /**
329
333
  * Set command handler for toolbar buttons
330
334
  */
@@ -335,11 +339,11 @@ class R {
335
339
  * Parse toolbar string into button groups
336
340
  */
337
341
  parseToolbarString(t) {
338
- const e = [], o = t.split("|").map((s) => s.trim()), n = this.getAvailableToolbarItems(), i = /* @__PURE__ */ new Map();
339
- n.forEach((s) => {
340
- s.command && i.set(s.command, s), s.type === "group" && s.label && i.set(s.label, s);
342
+ const e = [], o = t.split("|").map((c) => c.trim()), i = this.getAvailableToolbarItems(), r = /* @__PURE__ */ new Map();
343
+ i.forEach((c) => {
344
+ c.command && r.set(c.command, c), c.type === "group" && c.label && r.set(c.label, c);
341
345
  });
342
- const r = {
346
+ const l = {
343
347
  bold: "toggleBold",
344
348
  italic: "toggleItalic",
345
349
  underline: "toggleUnderline",
@@ -401,59 +405,59 @@ class R {
401
405
  insertVideo: "insertVideo",
402
406
  codeBlock: "insertCodeBlock"
403
407
  };
404
- return o.forEach((s) => {
405
- const l = [];
406
- s.split(/\s+/).filter(Boolean).forEach((d) => {
407
- if (d === "direction") {
408
- const u = i.get("setDirectionLTR"), f = i.get("setDirectionRTL");
409
- u && l.push({
408
+ return o.forEach((c) => {
409
+ const p = [];
410
+ c.split(/\s+/).filter(Boolean).forEach((b) => {
411
+ if (b === "direction") {
412
+ const T = r.get("setDirectionLTR"), v = r.get("setDirectionRTL");
413
+ T && p.push({
410
414
  id: "directionLTR",
411
- label: u.label,
412
- command: u.command,
413
- icon: u.icon,
414
- type: u.type || "button",
415
- options: u.options
416
- }), f && l.push({
415
+ label: T.label,
416
+ command: T.command,
417
+ icon: T.icon,
418
+ type: T.type || "button",
419
+ options: T.options
420
+ }), v && p.push({
417
421
  id: "directionRTL",
418
- label: f.label,
419
- command: f.command,
420
- icon: f.icon,
421
- type: f.type || "button",
422
- options: f.options
422
+ label: v.label,
423
+ command: v.command,
424
+ icon: v.icon,
425
+ type: v.type || "button",
426
+ options: v.options
423
427
  });
424
428
  return;
425
429
  }
426
- if (d === "comments") {
427
- const u = i.get("addComment"), f = i.get("toggleComments");
428
- u && l.push({
430
+ if (b === "comments") {
431
+ const T = r.get("addComment"), v = r.get("toggleComments");
432
+ T && p.push({
429
433
  id: "addComment",
430
- label: u.label,
431
- command: u.command,
432
- icon: u.icon,
433
- type: u.type || "button",
434
- options: u.options
435
- }), f && l.push({
434
+ label: T.label,
435
+ command: T.command,
436
+ icon: T.icon,
437
+ type: T.type || "button",
438
+ options: T.options
439
+ }), v && p.push({
436
440
  id: "toggleComments",
437
- label: f.label,
438
- command: f.command,
439
- icon: f.icon,
440
- type: f.type || "button",
441
- options: f.options
441
+ label: v.label,
442
+ command: v.command,
443
+ icon: v.icon,
444
+ type: v.type || "button",
445
+ options: v.options
442
446
  });
443
447
  return;
444
448
  }
445
- const h = r[d] || d;
446
- let p = i.get(h);
447
- p || (p = i.get(d)), p && l.push({
448
- id: d,
449
- label: p.label,
450
- command: p.command,
451
- icon: p.icon,
452
- type: p.type === "separator" ? "separator" : p.type || "button",
453
- options: p.options,
454
- items: p.items
449
+ const w = l[b] || b;
450
+ let _ = r.get(w);
451
+ _ || (_ = r.get(b)), _ && p.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
455
459
  });
456
- }), l.length > 0 && e.push(l);
460
+ }), p.length > 0 && e.push(p);
457
461
  }), e;
458
462
  }
459
463
  /**
@@ -467,16 +471,60 @@ class R {
467
471
  */
468
472
  render(t) {
469
473
  this.container = t, t.innerHTML = "", t.className = "editora-toolbar", this.config.sticky && t.classList.add("editora-toolbar-sticky"), this.config.position && t.classList.add(`editora-toolbar-${this.config.position}`);
470
- const e = this.config.items || this.getDefaultToolbarString(), o = this.parseToolbarString(e);
471
- o.forEach((n, i) => {
472
- const r = document.createElement("div");
473
- if (r.className = "editora-toolbar-group", n.forEach((s) => {
474
- this.appendToolbarButton(r, s);
475
- }), t.appendChild(r), i < o.length - 1) {
476
- const s = document.createElement("div");
477
- s.className = "editora-toolbar-separator", t.appendChild(s);
474
+ const e = document.createElement("div");
475
+ e.className = "editora-toolbar-items-container", this.itemsContainer = e, this.overflowUnits = [];
476
+ const o = this.config.items || this.getDefaultToolbarString(), i = this.parseToolbarString(o);
477
+ i.forEach((r, l) => {
478
+ const c = document.createElement("div");
479
+ if (c.className = "editora-toolbar-group", r.forEach((p) => {
480
+ this.appendToolbarButton(c, p);
481
+ const m = c.lastElementChild;
482
+ m instanceof HTMLElement && (this.overflowUnits.push(m), this.overflowUnitHomes.set(m, c));
483
+ }), e.appendChild(c), l < i.length - 1) {
484
+ const p = document.createElement("div");
485
+ p.className = "editora-toolbar-separator", e.appendChild(p);
478
486
  }
479
- });
487
+ }), t.appendChild(e), this.setupOverflow(t);
488
+ }
489
+ /** Measures top-level items in `itemsContainer` and moves whatever doesn't
490
+ * fit into a collapsible "more options" row, re-measuring on resize. */
491
+ setupOverflow(t) {
492
+ if (!this.itemsContainer || typeof ResizeObserver == "undefined") return;
493
+ const o = document.createElement("button");
494
+ o.type = "button", o.className = "editora-toolbar-more-button", o.title = "Show more options", o.setAttribute("aria-label", "More toolbar options"), o.textContent = "☰", o.style.display = "none", o.addEventListener("click", (c) => {
495
+ c.preventDefault(), this.setExpandedOpen(!this.expandedOpen);
496
+ }), this.moreButton = o, t.appendChild(o);
497
+ const i = document.createElement("div");
498
+ i.className = "editora-toolbar-expanded-row", this.expandedRow = i, t.appendChild(i), document.addEventListener("mousedown", this.onDocumentPointerDownForOverflow, !0);
499
+ const r = () => {
500
+ const c = this.overflowUnits;
501
+ if (c.length === 0) return;
502
+ c.forEach((D) => {
503
+ var P;
504
+ D.parentElement === i && ((P = this.overflowUnitHomes.get(D)) == null || P.appendChild(D));
505
+ });
506
+ const p = t.clientWidth, m = 16, b = 40, w = 4, _ = Math.max(0, p - m - b - w);
507
+ let T = 0, v = 0;
508
+ for (const D of c) {
509
+ const P = D.getBoundingClientRect().width + w;
510
+ if (T + P <= _)
511
+ T += P, v++;
512
+ else
513
+ break;
514
+ }
515
+ 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, P) => {
518
+ P >= v && i.appendChild(D);
519
+ });
520
+ }, l = () => {
521
+ this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
522
+ };
523
+ this.resizeObserver = new ResizeObserver(() => l()), this.resizeObserver.observe(t), l();
524
+ }
525
+ setExpandedOpen(t) {
526
+ var e, o;
527
+ this.expandedOpen = t, (e = this.expandedRow) == null || e.classList.toggle("show", t), (o = this.moreButton) == null || o.classList.toggle("active", t);
480
528
  }
481
529
  /**
482
530
  * Append a toolbar button or group to a parent element
@@ -509,15 +557,15 @@ class R {
509
557
  const e = document.createElement("div"), o = t.label.toLowerCase().replace(/\s+/g, "-");
510
558
  if (e.className = `editora-toolbar-group-button ${o}`, e.title = t.label, t.icon)
511
559
  if (t.icon.startsWith("<svg") && t.icon.endsWith("</svg>")) {
512
- const n = document.createElement("span");
513
- n.className = "editora-toolbar-icon", n.innerHTML = t.icon, e.appendChild(n);
560
+ const i = document.createElement("span");
561
+ i.className = "editora-toolbar-icon", i.innerHTML = t.icon, e.appendChild(i);
514
562
  } else
515
563
  e.innerHTML = t.icon;
516
564
  if (t.items && t.items.length) {
517
- const n = document.createElement("div");
518
- n.className = `editora-toolbar-group-items ${o}`, t.items.forEach((i) => {
519
- this.appendToolbarButton(n, i);
520
- }), e.appendChild(n);
565
+ const i = document.createElement("div");
566
+ i.className = `editora-toolbar-group-items ${o}`, t.items.forEach((r) => {
567
+ this.appendToolbarButton(i, r);
568
+ }), e.appendChild(i);
521
569
  }
522
570
  return e;
523
571
  }
@@ -555,25 +603,25 @@ class R {
555
603
  e.className = "editora-toolbar-dropdown";
556
604
  const o = document.createElement("button");
557
605
  o.className = "editora-toolbar-button editora-toolbar-dropdown-trigger", o.type = "button", o.textContent = t.label;
558
- const n = document.createElement("div");
559
- n.className = "editora-toolbar-dropdown-menu", n.style.display = "none", t.options && t.options.forEach((s) => {
560
- const l = document.createElement("button");
561
- l.className = "editora-toolbar-dropdown-item", l.type = "button", l.textContent = s.label, l.setAttribute("data-value", s.value), l.addEventListener("click", (c) => {
562
- c.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, s.value), n.style.display = "none";
563
- }), n.appendChild(l);
564
- }), o.addEventListener("click", (s) => {
565
- s.preventDefault(), s.stopPropagation(), this.setLastCommandTrigger(o, t.command);
566
- const l = n.style.display === "block";
567
- n.style.display = l ? "none" : "block";
606
+ const i = document.createElement("div");
607
+ i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
608
+ const p = document.createElement("button");
609
+ p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (m) => {
610
+ m.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
611
+ }), i.appendChild(p);
612
+ }), o.addEventListener("click", (c) => {
613
+ c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
614
+ const p = i.style.display === "block";
615
+ i.style.display = p ? "none" : "block";
568
616
  });
569
- const i = (s) => {
570
- e.contains(s.target) || (n.style.display = "none");
571
- }, r = (s) => {
572
- s.key === "Escape" && (n.style.display = "none");
617
+ const r = (c) => {
618
+ e.contains(c.target) || (i.style.display = "none");
619
+ }, l = (c) => {
620
+ c.key === "Escape" && (i.style.display = "none");
573
621
  };
574
- return document.addEventListener("mousedown", i, !0), document.addEventListener("keydown", r), e._cleanupDropdown = () => {
575
- document.removeEventListener("mousedown", i, !0), document.removeEventListener("keydown", r);
576
- }, e.appendChild(o), e.appendChild(n), e;
622
+ return document.addEventListener("mousedown", r, !0), document.addEventListener("keydown", l), e._cleanupDropdown = () => {
623
+ document.removeEventListener("mousedown", r, !0), document.removeEventListener("keydown", l);
624
+ }, e.appendChild(o), e.appendChild(i), e;
577
625
  }
578
626
  /**
579
627
  * Create an inline menu element (like dropdown but triggered by button click)
@@ -584,36 +632,36 @@ class R {
584
632
  const o = document.createElement("button");
585
633
  if (o.className = "editora-toolbar-button", o.type = "button", o.title = t.label, t.icon)
586
634
  if (t.icon.startsWith("<svg") && t.icon.endsWith("</svg>")) {
587
- const s = document.createElement("span");
588
- s.className = "editora-toolbar-icon", s.innerHTML = t.icon, o.appendChild(s);
635
+ const c = document.createElement("span");
636
+ c.className = "editora-toolbar-icon", c.innerHTML = t.icon, o.appendChild(c);
589
637
  } else
590
638
  o.innerHTML = t.icon;
591
639
  else
592
640
  o.textContent = t.label;
593
- const n = document.createElement("div");
594
- n.className = "editora-toolbar-dropdown-menu", n.style.display = "none", t.options && t.options.forEach((s) => {
595
- const l = document.createElement("button");
596
- l.className = "editora-toolbar-dropdown-item", l.type = "button", l.textContent = s.label, l.setAttribute("data-value", s.value), l.addEventListener("click", (c) => {
597
- c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, s.value), n.style.display = "none";
598
- }), n.appendChild(l);
599
- }), o.addEventListener("click", (s) => {
600
- var c;
601
- s.preventDefault(), s.stopPropagation(), this.setLastCommandTrigger(o, t.command);
602
- const l = (c = this.container) == null ? void 0 : c.querySelectorAll(
641
+ const i = document.createElement("div");
642
+ i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
643
+ const p = document.createElement("button");
644
+ p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (m) => {
645
+ m.preventDefault(), m.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
646
+ }), i.appendChild(p);
647
+ }), o.addEventListener("click", (c) => {
648
+ var m;
649
+ c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
650
+ const p = (m = this.container) == null ? void 0 : m.querySelectorAll(
603
651
  ".editora-toolbar-dropdown-menu"
604
652
  );
605
- l == null || l.forEach((d) => {
606
- d !== n && (d.style.display = "none");
607
- }), n.style.display = n.style.display === "none" ? "block" : "none";
653
+ p == null || p.forEach((b) => {
654
+ b !== i && (b.style.display = "none");
655
+ }), i.style.display = i.style.display === "none" ? "block" : "none";
608
656
  });
609
- const i = (s) => {
610
- e.contains(s.target) || (n.style.display = "none");
611
- }, r = (s) => {
612
- s.key === "Escape" && (n.style.display = "none");
657
+ const r = (c) => {
658
+ e.contains(c.target) || (i.style.display = "none");
659
+ }, l = (c) => {
660
+ c.key === "Escape" && (i.style.display = "none");
613
661
  };
614
- return document.addEventListener("mousedown", i, !0), document.addEventListener("keydown", r), e._cleanupDropdown = () => {
615
- document.removeEventListener("mousedown", i, !0), document.removeEventListener("keydown", r);
616
- }, e.appendChild(o), e.appendChild(n), e;
662
+ return document.addEventListener("mousedown", r, !0), document.addEventListener("keydown", l), e._cleanupDropdown = () => {
663
+ document.removeEventListener("mousedown", r, !0), document.removeEventListener("keydown", l);
664
+ }, e.appendChild(o), e.appendChild(i), e;
617
665
  }
618
666
  /**
619
667
  * Get default toolbar string if none provided
@@ -635,13 +683,14 @@ class R {
635
683
  * Destroy toolbar
636
684
  */
637
685
  destroy() {
638
- this.container && (this.container.querySelectorAll(".editora-toolbar-dropdown").forEach((e) => {
639
- const o = e._cleanupDropdown;
640
- o && o();
641
- }), this.container.innerHTML = ""), this.commandHandler = void 0;
686
+ var t;
687
+ this.container && (this.container.querySelectorAll(".editora-toolbar-dropdown").forEach((o) => {
688
+ const i = o._cleanupDropdown;
689
+ i && i();
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;
642
691
  }
643
692
  }
644
- class H {
693
+ class dn {
645
694
  constructor(t) {
646
695
  this.visible = !1, this.config = t;
647
696
  }
@@ -683,7 +732,7 @@ class H {
683
732
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
684
733
  }
685
734
  }
686
- class j {
735
+ class un {
687
736
  constructor(t = {}) {
688
737
  this.statusInfo = {}, this.config = t;
689
738
  }
@@ -712,27 +761,27 @@ class j {
712
761
  e.className = "editora-statusbar-right";
713
762
  const o = [];
714
763
  if (this.statusInfo.selectionInfo) {
715
- const i = this.statusInfo.selectionInfo;
716
- i.startLine === i.endLine && i.startColumn === i.endColumn ? o.push(`Ln ${i.startLine}, Col ${i.startColumn}`) : (i.startLine === i.endLine ? o.push(`Ln ${i.startLine}, Col ${i.startColumn}-${i.endColumn}`) : o.push(`Ln ${i.startLine}:${i.startColumn} - ${i.endLine}:${i.endColumn}`), o.push(`${i.selectedChars} chars selected`));
764
+ const r = this.statusInfo.selectionInfo;
765
+ r.startLine === r.endLine && r.startColumn === r.endColumn ? o.push(`Ln ${r.startLine}, Col ${r.startColumn}`) : (r.startLine === r.endLine ? o.push(`Ln ${r.startLine}, Col ${r.startColumn}-${r.endColumn}`) : o.push(`Ln ${r.startLine}:${r.startColumn} - ${r.endLine}:${r.endColumn}`), o.push(`${r.selectedChars} chars selected`));
717
766
  } else if (this.statusInfo.cursorPosition) {
718
- const i = this.statusInfo.cursorPosition;
719
- o.push(`Ln ${i.line}, Col ${i.column}`);
767
+ const r = this.statusInfo.cursorPosition;
768
+ o.push(`Ln ${r.line}, Col ${r.column}`);
720
769
  }
721
770
  this.statusInfo.language && o.push(this.statusInfo.language);
722
- const n = [];
723
- this.statusInfo.wordCount !== void 0 && n.push(`${this.statusInfo.wordCount} words`), this.statusInfo.charCount !== void 0 && n.push(`${this.statusInfo.charCount} chars`), this.statusInfo.lineCount !== void 0 && n.push(`${this.statusInfo.lineCount} lines`), this.statusInfo.custom && Object.entries(this.statusInfo.custom).forEach(([i, r]) => {
724
- n.push(`${i}: ${r}`);
725
- }), o.forEach((i, r) => {
726
- const s = document.createElement("span");
727
- if (s.className = "editora-statusbar-item", s.textContent = i, t.appendChild(s), r < o.length - 1) {
728
- const l = document.createElement("span");
729
- l.className = "editora-statusbar-separator", l.textContent = "|", t.appendChild(l);
771
+ const i = [];
772
+ this.statusInfo.wordCount !== void 0 && i.push(`${this.statusInfo.wordCount} words`), this.statusInfo.charCount !== void 0 && i.push(`${this.statusInfo.charCount} chars`), this.statusInfo.lineCount !== void 0 && i.push(`${this.statusInfo.lineCount} lines`), this.statusInfo.custom && Object.entries(this.statusInfo.custom).forEach(([r, l]) => {
773
+ i.push(`${r}: ${l}`);
774
+ }), o.forEach((r, l) => {
775
+ const c = document.createElement("span");
776
+ if (c.className = "editora-statusbar-item", c.textContent = r, t.appendChild(c), l < o.length - 1) {
777
+ const p = document.createElement("span");
778
+ p.className = "editora-statusbar-separator", p.textContent = "|", t.appendChild(p);
730
779
  }
731
- }), n.forEach((i, r) => {
732
- const s = document.createElement("span");
733
- if (s.className = "editora-statusbar-item", s.textContent = i, e.appendChild(s), r < n.length - 1) {
734
- const l = document.createElement("span");
735
- l.className = "editora-statusbar-separator", l.textContent = "|", e.appendChild(l);
780
+ }), i.forEach((r, l) => {
781
+ const c = document.createElement("span");
782
+ if (c.className = "editora-statusbar-item", c.textContent = r, e.appendChild(c), l < i.length - 1) {
783
+ const p = document.createElement("span");
784
+ p.className = "editora-statusbar-separator", p.textContent = "|", e.appendChild(p);
736
785
  }
737
786
  }), this.container.appendChild(t), this.container.appendChild(e);
738
787
  }
@@ -743,49 +792,49 @@ class j {
743
792
  this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
744
793
  }
745
794
  }
746
- function F(a, t) {
747
- const e = a.textContent || "", o = $(a, t.startContainer, t.startOffset), i = e.substring(0, o).split(`
748
- `), r = i.length, s = i[i.length - 1].length + 1;
749
- return { line: r, column: s };
795
+ function fn(a, t) {
796
+ const e = a.textContent || "", o = pn(a, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
797
+ `), l = r.length, c = r[r.length - 1].length + 1;
798
+ return { line: l, column: c };
750
799
  }
751
- function $(a, t, e) {
752
- var r;
800
+ function pn(a, t, e) {
801
+ var l;
753
802
  let o = 0;
754
- const n = document.createTreeWalker(
803
+ const i = document.createTreeWalker(
755
804
  a,
756
805
  NodeFilter.SHOW_TEXT,
757
806
  null
758
807
  );
759
- let i = n.firstChild();
760
- for (; i; ) {
761
- if (i === t) {
808
+ let r = i.firstChild();
809
+ for (; r; ) {
810
+ if (r === t) {
762
811
  o += e;
763
812
  break;
764
- } else i.nodeType === Node.TEXT_NODE && (o += ((r = i.textContent) == null ? void 0 : r.length) || 0);
765
- i = n.nextNode();
813
+ } else r.nodeType === Node.TEXT_NODE && (o += ((l = r.textContent) == null ? void 0 : l.length) || 0);
814
+ r = i.nextNode();
766
815
  }
767
816
  return o;
768
817
  }
769
- function _(a) {
770
- var o, n;
818
+ function hn(a) {
819
+ var o, i;
771
820
  const t = a.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
772
821
  let e = 1;
773
822
  if (t.length > 0) {
774
823
  e = t.length;
775
- const i = t[t.length - 1];
776
- (i.tagName === "BR" || ((o = i.innerHTML) == null ? void 0 : o.trim()) === "" || ((n = i.textContent) == null ? void 0 : n.trim()) === "") && e++;
824
+ const r = t[t.length - 1];
825
+ (r.tagName === "BR" || ((o = r.innerHTML) == null ? void 0 : o.trim()) === "" || ((i = r.textContent) == null ? void 0 : i.trim()) === "") && e++;
777
826
  } else {
778
- const r = (a.textContent || "").split(`
827
+ const l = (a.textContent || "").split(`
779
828
  `).length;
780
- e = Math.max(1, r);
829
+ e = Math.max(1, l);
781
830
  }
782
831
  return e;
783
832
  }
784
- function W(a) {
833
+ function mn(a) {
785
834
  const t = a.trim() ? a.trim().split(/\s+/).length : 0, e = a.length;
786
835
  return { words: t, chars: e };
787
836
  }
788
- function U(a, t) {
837
+ function gn(a, t) {
789
838
  const e = a.toString();
790
839
  return {
791
840
  startLine: t.line,
@@ -797,7 +846,7 @@ function U(a, t) {
797
846
  selectedWords: e.trim().split(/\s+/).filter(Boolean).length
798
847
  };
799
848
  }
800
- class K {
849
+ class bn {
801
850
  constructor(t) {
802
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) => {
803
852
  this.registerShortcut(e);
@@ -1084,8 +1133,8 @@ class K {
1084
1133
  }
1085
1134
  handleKeyDown(t, e) {
1086
1135
  if (!this.enabled) return !1;
1087
- const o = this.getEventKey(t), n = this.shortcuts.get(o);
1088
- return n ? (n.preventDefault !== !1 && (t.preventDefault(), t.stopPropagation()), e(n.command, n.params), !0) : !1;
1136
+ const o = this.getEventKey(t), i = this.shortcuts.get(o);
1137
+ return i ? (i.preventDefault !== !1 && (t.preventDefault(), t.stopPropagation()), e(i.command, i.params), !0) : !1;
1089
1138
  }
1090
1139
  enable() {
1091
1140
  this.enabled = !0;
@@ -1110,19 +1159,19 @@ class K {
1110
1159
  }
1111
1160
  getShortcutsHelp() {
1112
1161
  const t = this.getAllShortcuts(), e = /* @__PURE__ */ new Map();
1113
- t.forEach((n) => {
1114
- const i = this.getShortcutCategory(n.command);
1115
- e.has(i) || e.set(i, []), e.get(i).push(n);
1162
+ t.forEach((i) => {
1163
+ const r = this.getShortcutCategory(i.command);
1164
+ e.has(r) || e.set(r, []), e.get(r).push(i);
1116
1165
  });
1117
1166
  let o = `# Keyboard Shortcuts
1118
1167
 
1119
1168
  `;
1120
- return e.forEach((n, i) => {
1121
- o += `## ${i}
1169
+ return e.forEach((i, r) => {
1170
+ o += `## ${r}
1122
1171
 
1123
- `, n.forEach((r) => {
1124
- const s = this.getShortcutDescription(r);
1125
- o += `- **${s}**: ${r.description || r.command}
1172
+ `, i.forEach((l) => {
1173
+ const c = this.getShortcutDescription(l);
1174
+ o += `- **${c}**: ${l.description || l.command}
1126
1175
  `;
1127
1176
  }), o += `
1128
1177
  `;
@@ -1132,7 +1181,1484 @@ class K {
1132
1181
  return t.includes("toggle") && (t.includes("Bold") || t.includes("Italic") || t.includes("Underline") || t.includes("Strike") || t.includes("Code") || t.includes("Super") || t.includes("Sub")) ? "Text Formatting" : t.includes("Heading") || t.includes("Paragraph") ? "Block Formatting" : t.includes("List") || t.includes("Checklist") ? "Lists" : t.includes("Alignment") || t.includes("Indent") ? "Alignment & Indentation" : t.includes("undo") || t.includes("redo") ? "History" : t.includes("insert") ? "Insert" : t.includes("find") || t.includes("replace") ? "Find & Replace" : t.includes("Accessibility") || t.includes("spell") ? "Tools" : "Other";
1133
1182
  }
1134
1183
  }
1135
- const q = [
1184
+ function io(a, t) {
1185
+ (t == null || t > a.length) && (t = a.length);
1186
+ for (var e = 0, o = Array(t); e < t; e++) o[e] = a[e];
1187
+ return o;
1188
+ }
1189
+ function yn(a) {
1190
+ if (Array.isArray(a)) return a;
1191
+ }
1192
+ function En(a, t) {
1193
+ var e = a == null ? null : typeof Symbol != "undefined" && a[Symbol.iterator] || a["@@iterator"];
1194
+ if (e != null) {
1195
+ var o, i, r, l, c = [], p = !0, m = !1;
1196
+ try {
1197
+ if (r = (e = e.call(a)).next, t !== 0) for (; !(p = (o = r.call(e)).done) && (c.push(o.value), c.length !== t); p = !0) ;
1198
+ } catch (b) {
1199
+ m = !0, i = b;
1200
+ } finally {
1201
+ try {
1202
+ if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
1203
+ } finally {
1204
+ if (m) throw i;
1205
+ }
1206
+ }
1207
+ return c;
1208
+ }
1209
+ }
1210
+ function vn() {
1211
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1212
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1213
+ }
1214
+ function wn(a, t) {
1215
+ return yn(a) || En(a, t) || Tn(a, t) || vn();
1216
+ }
1217
+ function Tn(a, t) {
1218
+ if (a) {
1219
+ if (typeof a == "string") return io(a, t);
1220
+ var e = {}.toString.call(a).slice(8, -1);
1221
+ return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? io(a, t) : void 0;
1222
+ }
1223
+ }
1224
+ const Ao = Object.entries, ro = Object.setPrototypeOf, kn = Object.isFrozen, xn = Object.getPrototypeOf, An = Object.getOwnPropertyDescriptor;
1225
+ let M = Object.freeze, I = Object.seal, gt = Object.create, Co = typeof Reflect != "undefined" && Reflect, ve = Co.apply, we = Co.construct;
1226
+ M || (M = function(t) {
1227
+ return t;
1228
+ });
1229
+ I || (I = function(t) {
1230
+ return t;
1231
+ });
1232
+ ve || (ve = function(t, e) {
1233
+ for (var o = arguments.length, i = new Array(o > 2 ? o - 2 : 0), r = 2; r < o; r++) i[r - 2] = arguments[r];
1234
+ return t.apply(e, i);
1235
+ });
1236
+ we || (we = function(t) {
1237
+ for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
1238
+ return new t(...o);
1239
+ });
1240
+ const rt = L(Array.prototype.forEach), Cn = L(Array.prototype.lastIndexOf), ao = L(Array.prototype.pop), kt = 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), At = L(Object.prototype.toString), O = L(RegExp.prototype.test), Z = In(TypeError);
1241
+ function L(a) {
1242
+ return function(t) {
1243
+ t instanceof RegExp && (t.lastIndex = 0);
1244
+ for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
1245
+ return ve(a, t, o);
1246
+ };
1247
+ }
1248
+ function In(a) {
1249
+ return function() {
1250
+ for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
1251
+ return we(a, e);
1252
+ };
1253
+ }
1254
+ function E(a, t) {
1255
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : St;
1256
+ if (ro && ro(a, null), !bt(t)) return a;
1257
+ let o = t.length;
1258
+ for (; o--; ) {
1259
+ let i = t[o];
1260
+ if (typeof i == "string") {
1261
+ const r = e(i);
1262
+ r !== i && (kn(t) || (t[o] = r), i = r);
1263
+ }
1264
+ a[i] = !0;
1265
+ }
1266
+ return a;
1267
+ }
1268
+ function On(a) {
1269
+ for (let t = 0; t < a.length; t++) z(a, t) || (a[t] = null);
1270
+ return a;
1271
+ }
1272
+ function H(a) {
1273
+ const t = gt(null);
1274
+ for (const o of Ao(a)) {
1275
+ var e = wn(o, 2);
1276
+ const i = e[0], r = e[1];
1277
+ z(a, i) && (bt(r) ? t[i] = On(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = H(r) : t[i] = r);
1278
+ }
1279
+ return t;
1280
+ }
1281
+ function Dn(a) {
1282
+ switch (typeof a) {
1283
+ case "string":
1284
+ return a;
1285
+ case "number":
1286
+ return Ln(a);
1287
+ case "boolean":
1288
+ return Mn(a);
1289
+ case "bigint":
1290
+ return co ? co(a) : "0";
1291
+ case "symbol":
1292
+ return uo ? uo(a) : "Symbol()";
1293
+ case "undefined":
1294
+ return At(a);
1295
+ case "function":
1296
+ case "object": {
1297
+ if (a === null) return At(a);
1298
+ const t = a, e = j(t, "toString");
1299
+ if (typeof e == "function") {
1300
+ const o = e(t);
1301
+ return typeof o == "string" ? o : At(o);
1302
+ }
1303
+ return At(a);
1304
+ }
1305
+ default:
1306
+ return At(a);
1307
+ }
1308
+ }
1309
+ function j(a, t) {
1310
+ for (; a !== null; ) {
1311
+ const o = An(a, t);
1312
+ if (o) {
1313
+ if (o.get) return L(o.get);
1314
+ if (typeof o.value == "function") return L(o.value);
1315
+ }
1316
+ a = xn(a);
1317
+ }
1318
+ function e() {
1319
+ return null;
1320
+ }
1321
+ return e;
1322
+ }
1323
+ function Rn(a) {
1324
+ try {
1325
+ return O(a, ""), !0;
1326
+ } catch (t) {
1327
+ return !1;
1328
+ }
1329
+ }
1330
+ const fo = M([
1331
+ "a",
1332
+ "abbr",
1333
+ "acronym",
1334
+ "address",
1335
+ "area",
1336
+ "article",
1337
+ "aside",
1338
+ "audio",
1339
+ "b",
1340
+ "bdi",
1341
+ "bdo",
1342
+ "big",
1343
+ "blink",
1344
+ "blockquote",
1345
+ "body",
1346
+ "br",
1347
+ "button",
1348
+ "canvas",
1349
+ "caption",
1350
+ "center",
1351
+ "cite",
1352
+ "code",
1353
+ "col",
1354
+ "colgroup",
1355
+ "content",
1356
+ "data",
1357
+ "datalist",
1358
+ "dd",
1359
+ "decorator",
1360
+ "del",
1361
+ "details",
1362
+ "dfn",
1363
+ "dialog",
1364
+ "dir",
1365
+ "div",
1366
+ "dl",
1367
+ "dt",
1368
+ "element",
1369
+ "em",
1370
+ "fieldset",
1371
+ "figcaption",
1372
+ "figure",
1373
+ "font",
1374
+ "footer",
1375
+ "form",
1376
+ "h1",
1377
+ "h2",
1378
+ "h3",
1379
+ "h4",
1380
+ "h5",
1381
+ "h6",
1382
+ "head",
1383
+ "header",
1384
+ "hgroup",
1385
+ "hr",
1386
+ "html",
1387
+ "i",
1388
+ "img",
1389
+ "input",
1390
+ "ins",
1391
+ "kbd",
1392
+ "label",
1393
+ "legend",
1394
+ "li",
1395
+ "main",
1396
+ "map",
1397
+ "mark",
1398
+ "marquee",
1399
+ "menu",
1400
+ "menuitem",
1401
+ "meter",
1402
+ "nav",
1403
+ "nobr",
1404
+ "ol",
1405
+ "optgroup",
1406
+ "option",
1407
+ "output",
1408
+ "p",
1409
+ "picture",
1410
+ "pre",
1411
+ "progress",
1412
+ "q",
1413
+ "rp",
1414
+ "rt",
1415
+ "ruby",
1416
+ "s",
1417
+ "samp",
1418
+ "search",
1419
+ "section",
1420
+ "select",
1421
+ "shadow",
1422
+ "slot",
1423
+ "small",
1424
+ "source",
1425
+ "spacer",
1426
+ "span",
1427
+ "strike",
1428
+ "strong",
1429
+ "style",
1430
+ "sub",
1431
+ "summary",
1432
+ "sup",
1433
+ "table",
1434
+ "tbody",
1435
+ "td",
1436
+ "template",
1437
+ "textarea",
1438
+ "tfoot",
1439
+ "th",
1440
+ "thead",
1441
+ "time",
1442
+ "tr",
1443
+ "track",
1444
+ "tt",
1445
+ "u",
1446
+ "ul",
1447
+ "var",
1448
+ "video",
1449
+ "wbr"
1450
+ ]), pe = M([
1451
+ "svg",
1452
+ "a",
1453
+ "altglyph",
1454
+ "altglyphdef",
1455
+ "altglyphitem",
1456
+ "animatecolor",
1457
+ "animatemotion",
1458
+ "animatetransform",
1459
+ "circle",
1460
+ "clippath",
1461
+ "defs",
1462
+ "desc",
1463
+ "ellipse",
1464
+ "enterkeyhint",
1465
+ "exportparts",
1466
+ "filter",
1467
+ "font",
1468
+ "g",
1469
+ "glyph",
1470
+ "glyphref",
1471
+ "hkern",
1472
+ "image",
1473
+ "inputmode",
1474
+ "line",
1475
+ "lineargradient",
1476
+ "marker",
1477
+ "mask",
1478
+ "metadata",
1479
+ "mpath",
1480
+ "part",
1481
+ "path",
1482
+ "pattern",
1483
+ "polygon",
1484
+ "polyline",
1485
+ "radialgradient",
1486
+ "rect",
1487
+ "stop",
1488
+ "style",
1489
+ "switch",
1490
+ "symbol",
1491
+ "text",
1492
+ "textpath",
1493
+ "title",
1494
+ "tref",
1495
+ "tspan",
1496
+ "view",
1497
+ "vkern"
1498
+ ]), he = M([
1499
+ "feBlend",
1500
+ "feColorMatrix",
1501
+ "feComponentTransfer",
1502
+ "feComposite",
1503
+ "feConvolveMatrix",
1504
+ "feDiffuseLighting",
1505
+ "feDisplacementMap",
1506
+ "feDistantLight",
1507
+ "feDropShadow",
1508
+ "feFlood",
1509
+ "feFuncA",
1510
+ "feFuncB",
1511
+ "feFuncG",
1512
+ "feFuncR",
1513
+ "feGaussianBlur",
1514
+ "feImage",
1515
+ "feMerge",
1516
+ "feMergeNode",
1517
+ "feMorphology",
1518
+ "feOffset",
1519
+ "fePointLight",
1520
+ "feSpecularLighting",
1521
+ "feSpotLight",
1522
+ "feTile",
1523
+ "feTurbulence"
1524
+ ]), Pn = M([
1525
+ "animate",
1526
+ "color-profile",
1527
+ "cursor",
1528
+ "discard",
1529
+ "font-face",
1530
+ "font-face-format",
1531
+ "font-face-name",
1532
+ "font-face-src",
1533
+ "font-face-uri",
1534
+ "foreignobject",
1535
+ "hatch",
1536
+ "hatchpath",
1537
+ "mesh",
1538
+ "meshgradient",
1539
+ "meshpatch",
1540
+ "meshrow",
1541
+ "missing-glyph",
1542
+ "script",
1543
+ "set",
1544
+ "solidcolor",
1545
+ "unknown",
1546
+ "use"
1547
+ ]), me = M([
1548
+ "math",
1549
+ "menclose",
1550
+ "merror",
1551
+ "mfenced",
1552
+ "mfrac",
1553
+ "mglyph",
1554
+ "mi",
1555
+ "mlabeledtr",
1556
+ "mmultiscripts",
1557
+ "mn",
1558
+ "mo",
1559
+ "mover",
1560
+ "mpadded",
1561
+ "mphantom",
1562
+ "mroot",
1563
+ "mrow",
1564
+ "ms",
1565
+ "mspace",
1566
+ "msqrt",
1567
+ "mstyle",
1568
+ "msub",
1569
+ "msup",
1570
+ "msubsup",
1571
+ "mtable",
1572
+ "mtd",
1573
+ "mtext",
1574
+ "mtr",
1575
+ "munder",
1576
+ "munderover",
1577
+ "mprescripts"
1578
+ ]), Nn = M([
1579
+ "maction",
1580
+ "maligngroup",
1581
+ "malignmark",
1582
+ "mlongdiv",
1583
+ "mscarries",
1584
+ "mscarry",
1585
+ "msgroup",
1586
+ "mstack",
1587
+ "msline",
1588
+ "msrow",
1589
+ "semantics",
1590
+ "annotation",
1591
+ "annotation-xml",
1592
+ "mprescripts",
1593
+ "none"
1594
+ ]), po = M(["#text"]), ho = M([
1595
+ "accept",
1596
+ "action",
1597
+ "align",
1598
+ "alt",
1599
+ "autocapitalize",
1600
+ "autocomplete",
1601
+ "autopictureinpicture",
1602
+ "autoplay",
1603
+ "background",
1604
+ "bgcolor",
1605
+ "border",
1606
+ "capture",
1607
+ "cellpadding",
1608
+ "cellspacing",
1609
+ "checked",
1610
+ "cite",
1611
+ "class",
1612
+ "clear",
1613
+ "color",
1614
+ "cols",
1615
+ "colspan",
1616
+ "command",
1617
+ "commandfor",
1618
+ "controls",
1619
+ "controlslist",
1620
+ "coords",
1621
+ "crossorigin",
1622
+ "datetime",
1623
+ "decoding",
1624
+ "default",
1625
+ "dir",
1626
+ "disabled",
1627
+ "disablepictureinpicture",
1628
+ "disableremoteplayback",
1629
+ "download",
1630
+ "draggable",
1631
+ "enctype",
1632
+ "enterkeyhint",
1633
+ "exportparts",
1634
+ "face",
1635
+ "for",
1636
+ "headers",
1637
+ "height",
1638
+ "hidden",
1639
+ "high",
1640
+ "href",
1641
+ "hreflang",
1642
+ "id",
1643
+ "inert",
1644
+ "inputmode",
1645
+ "integrity",
1646
+ "ismap",
1647
+ "kind",
1648
+ "label",
1649
+ "lang",
1650
+ "list",
1651
+ "loading",
1652
+ "loop",
1653
+ "low",
1654
+ "max",
1655
+ "maxlength",
1656
+ "media",
1657
+ "method",
1658
+ "min",
1659
+ "minlength",
1660
+ "multiple",
1661
+ "muted",
1662
+ "name",
1663
+ "nonce",
1664
+ "noshade",
1665
+ "novalidate",
1666
+ "nowrap",
1667
+ "open",
1668
+ "optimum",
1669
+ "part",
1670
+ "pattern",
1671
+ "placeholder",
1672
+ "playsinline",
1673
+ "popover",
1674
+ "popovertarget",
1675
+ "popovertargetaction",
1676
+ "poster",
1677
+ "preload",
1678
+ "pubdate",
1679
+ "radiogroup",
1680
+ "readonly",
1681
+ "rel",
1682
+ "required",
1683
+ "rev",
1684
+ "reversed",
1685
+ "role",
1686
+ "rows",
1687
+ "rowspan",
1688
+ "spellcheck",
1689
+ "scope",
1690
+ "selected",
1691
+ "shape",
1692
+ "size",
1693
+ "sizes",
1694
+ "slot",
1695
+ "span",
1696
+ "srclang",
1697
+ "start",
1698
+ "src",
1699
+ "srcset",
1700
+ "step",
1701
+ "style",
1702
+ "summary",
1703
+ "tabindex",
1704
+ "title",
1705
+ "translate",
1706
+ "type",
1707
+ "usemap",
1708
+ "valign",
1709
+ "value",
1710
+ "width",
1711
+ "wrap",
1712
+ "xmlns"
1713
+ ]), ge = M([
1714
+ "accent-height",
1715
+ "accumulate",
1716
+ "additive",
1717
+ "alignment-baseline",
1718
+ "amplitude",
1719
+ "ascent",
1720
+ "attributename",
1721
+ "attributetype",
1722
+ "azimuth",
1723
+ "basefrequency",
1724
+ "baseline-shift",
1725
+ "begin",
1726
+ "bias",
1727
+ "by",
1728
+ "class",
1729
+ "clip",
1730
+ "clippathunits",
1731
+ "clip-path",
1732
+ "clip-rule",
1733
+ "color",
1734
+ "color-interpolation",
1735
+ "color-interpolation-filters",
1736
+ "color-profile",
1737
+ "color-rendering",
1738
+ "cx",
1739
+ "cy",
1740
+ "d",
1741
+ "dx",
1742
+ "dy",
1743
+ "diffuseconstant",
1744
+ "direction",
1745
+ "display",
1746
+ "divisor",
1747
+ "dominant-baseline",
1748
+ "dur",
1749
+ "edgemode",
1750
+ "elevation",
1751
+ "end",
1752
+ "exponent",
1753
+ "fill",
1754
+ "fill-opacity",
1755
+ "fill-rule",
1756
+ "filter",
1757
+ "filterunits",
1758
+ "flood-color",
1759
+ "flood-opacity",
1760
+ "font-family",
1761
+ "font-size",
1762
+ "font-size-adjust",
1763
+ "font-stretch",
1764
+ "font-style",
1765
+ "font-variant",
1766
+ "font-weight",
1767
+ "fx",
1768
+ "fy",
1769
+ "g1",
1770
+ "g2",
1771
+ "glyph-name",
1772
+ "glyphref",
1773
+ "gradientunits",
1774
+ "gradienttransform",
1775
+ "height",
1776
+ "href",
1777
+ "id",
1778
+ "image-rendering",
1779
+ "in",
1780
+ "in2",
1781
+ "intercept",
1782
+ "k",
1783
+ "k1",
1784
+ "k2",
1785
+ "k3",
1786
+ "k4",
1787
+ "kerning",
1788
+ "keypoints",
1789
+ "keysplines",
1790
+ "keytimes",
1791
+ "lang",
1792
+ "lengthadjust",
1793
+ "letter-spacing",
1794
+ "kernelmatrix",
1795
+ "kernelunitlength",
1796
+ "lighting-color",
1797
+ "local",
1798
+ "marker-end",
1799
+ "marker-mid",
1800
+ "marker-start",
1801
+ "markerheight",
1802
+ "markerunits",
1803
+ "markerwidth",
1804
+ "maskcontentunits",
1805
+ "maskunits",
1806
+ "max",
1807
+ "mask",
1808
+ "mask-type",
1809
+ "media",
1810
+ "method",
1811
+ "mode",
1812
+ "min",
1813
+ "name",
1814
+ "numoctaves",
1815
+ "offset",
1816
+ "operator",
1817
+ "opacity",
1818
+ "order",
1819
+ "orient",
1820
+ "orientation",
1821
+ "origin",
1822
+ "overflow",
1823
+ "paint-order",
1824
+ "path",
1825
+ "pathlength",
1826
+ "patterncontentunits",
1827
+ "patterntransform",
1828
+ "patternunits",
1829
+ "pointer-events",
1830
+ "points",
1831
+ "preservealpha",
1832
+ "preserveaspectratio",
1833
+ "primitiveunits",
1834
+ "r",
1835
+ "rx",
1836
+ "ry",
1837
+ "radius",
1838
+ "refx",
1839
+ "refy",
1840
+ "repeatcount",
1841
+ "repeatdur",
1842
+ "restart",
1843
+ "result",
1844
+ "rotate",
1845
+ "scale",
1846
+ "seed",
1847
+ "shape-rendering",
1848
+ "slope",
1849
+ "specularconstant",
1850
+ "specularexponent",
1851
+ "spreadmethod",
1852
+ "startoffset",
1853
+ "stddeviation",
1854
+ "stitchtiles",
1855
+ "stop-color",
1856
+ "stop-opacity",
1857
+ "stroke-dasharray",
1858
+ "stroke-dashoffset",
1859
+ "stroke-linecap",
1860
+ "stroke-linejoin",
1861
+ "stroke-miterlimit",
1862
+ "stroke-opacity",
1863
+ "stroke",
1864
+ "stroke-width",
1865
+ "style",
1866
+ "surfacescale",
1867
+ "systemlanguage",
1868
+ "tabindex",
1869
+ "tablevalues",
1870
+ "targetx",
1871
+ "targety",
1872
+ "transform",
1873
+ "transform-origin",
1874
+ "text-anchor",
1875
+ "text-decoration",
1876
+ "text-orientation",
1877
+ "text-rendering",
1878
+ "textlength",
1879
+ "type",
1880
+ "u1",
1881
+ "u2",
1882
+ "unicode",
1883
+ "values",
1884
+ "vector-effect",
1885
+ "viewbox",
1886
+ "visibility",
1887
+ "version",
1888
+ "vert-adv-y",
1889
+ "vert-origin-x",
1890
+ "vert-origin-y",
1891
+ "width",
1892
+ "word-spacing",
1893
+ "wrap",
1894
+ "writing-mode",
1895
+ "xchannelselector",
1896
+ "ychannelselector",
1897
+ "x",
1898
+ "x1",
1899
+ "x2",
1900
+ "xmlns",
1901
+ "y",
1902
+ "y1",
1903
+ "y2",
1904
+ "z",
1905
+ "zoomandpan"
1906
+ ]), mo = M([
1907
+ "accent",
1908
+ "accentunder",
1909
+ "align",
1910
+ "bevelled",
1911
+ "close",
1912
+ "columnalign",
1913
+ "columnlines",
1914
+ "columnspacing",
1915
+ "columnspan",
1916
+ "denomalign",
1917
+ "depth",
1918
+ "dir",
1919
+ "display",
1920
+ "displaystyle",
1921
+ "encoding",
1922
+ "fence",
1923
+ "frame",
1924
+ "height",
1925
+ "href",
1926
+ "id",
1927
+ "largeop",
1928
+ "length",
1929
+ "linethickness",
1930
+ "lquote",
1931
+ "lspace",
1932
+ "mathbackground",
1933
+ "mathcolor",
1934
+ "mathsize",
1935
+ "mathvariant",
1936
+ "maxsize",
1937
+ "minsize",
1938
+ "movablelimits",
1939
+ "notation",
1940
+ "numalign",
1941
+ "open",
1942
+ "rowalign",
1943
+ "rowlines",
1944
+ "rowspacing",
1945
+ "rowspan",
1946
+ "rspace",
1947
+ "rquote",
1948
+ "scriptlevel",
1949
+ "scriptminsize",
1950
+ "scriptsizemultiplier",
1951
+ "selection",
1952
+ "separator",
1953
+ "separators",
1954
+ "stretchy",
1955
+ "subscriptshift",
1956
+ "supscriptshift",
1957
+ "symmetric",
1958
+ "voffset",
1959
+ "width",
1960
+ "xmlns"
1961
+ ]), jt = M([
1962
+ "xlink:href",
1963
+ "xml:id",
1964
+ "xlink:title",
1965
+ "xml:space",
1966
+ "xmlns:xlink"
1967
+ ]), zn = I(/{{[\w\W]*|^[\w\W]*}}/g), Bn = I(/<%[\w\W]*|^[\w\W]*%>/g), Fn = I(/\${[\w\W]*/g), Hn = I(/^data-[\-\w.\u00B7-\uFFFF]+$/), Un = I(/^aria-[\-\w]+$/), go = I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), jn = I(/^(?:\w+script|data):/i), Wn = I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), $n = I(/^html$/i), Gn = I(/^[a-z][.\w]*(-[.\w]+)+$/i), bo = I(/<[/\w!]/g), yo = I(/<[/\w]/g), Kn = I(/<\/no(script|embed|frames)/i), Yn = I(/\/>/i), F = {
1968
+ element: 1,
1969
+ attribute: 2,
1970
+ text: 3,
1971
+ cdataSection: 4,
1972
+ entityReference: 5,
1973
+ entityNode: 6,
1974
+ processingInstruction: 7,
1975
+ comment: 8,
1976
+ document: 9,
1977
+ documentType: 10,
1978
+ documentFragment: 11,
1979
+ notation: 12
1980
+ }, So = [
1981
+ "style",
1982
+ "script",
1983
+ "xmp",
1984
+ "iframe",
1985
+ "noembed",
1986
+ "noframes",
1987
+ "plaintext",
1988
+ "noscript"
1989
+ ], qn = M(E({}, So)), Vn = (function() {
1990
+ const a = {};
1991
+ return rt(So, (t) => {
1992
+ a[t] = I(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
1993
+ }), M(a);
1994
+ })(), Xn = function() {
1995
+ return typeof window == "undefined" ? null : window;
1996
+ }, Zn = function(t, e) {
1997
+ if (typeof t != "object" || typeof t.createPolicy != "function") return null;
1998
+ let o = null;
1999
+ const i = "data-tt-policy-suffix";
2000
+ e && e.hasAttribute(i) && (o = e.getAttribute(i));
2001
+ const r = "dompurify" + (o ? "#" + o : "");
2002
+ try {
2003
+ return t.createPolicy(r, {
2004
+ createHTML(l) {
2005
+ return l;
2006
+ },
2007
+ createScriptURL(l) {
2008
+ return l;
2009
+ }
2010
+ });
2011
+ } catch (l) {
2012
+ return console.warn("TrustedTypes policy " + r + " could not be created."), null;
2013
+ }
2014
+ }, Eo = function() {
2015
+ return {
2016
+ afterSanitizeAttributes: [],
2017
+ afterSanitizeElements: [],
2018
+ afterSanitizeShadowDOM: [],
2019
+ beforeSanitizeAttributes: [],
2020
+ beforeSanitizeElements: [],
2021
+ beforeSanitizeShadowDOM: [],
2022
+ uponSanitizeAttribute: [],
2023
+ uponSanitizeElement: [],
2024
+ uponSanitizeShadowNode: []
2025
+ };
2026
+ }, J = function(t, e, o, i) {
2027
+ return z(t, e) && bt(t[e]) ? E(i.base ? H(i.base) : {}, t[e], i.transform) : o;
2028
+ }, be = function(t, e, o) {
2029
+ const i = z(t, e) ? t[e] : void 0;
2030
+ return i && typeof i == "object" ? H(i) : o();
2031
+ };
2032
+ function _o() {
2033
+ let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Xn();
2034
+ const t = (u) => _o(u);
2035
+ if (t.version = "3.4.16", t.removed = [], !a || !a.document || a.document.nodeType !== F.document || !a.Element)
2036
+ return t.isSupported = !1, t;
2037
+ let e = a.document;
2038
+ const o = e, i = o.currentScript;
2039
+ a.DocumentFragment;
2040
+ const r = a.HTMLTemplateElement, l = a.Node, c = a.Element, p = a.NodeFilter;
2041
+ a.NamedNodeMap === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
2042
+ const m = a.DOMParser, b = a.trustedTypes, w = c.prototype, _ = j(w, "cloneNode"), T = j(w, "remove"), v = j(w, "removeAttributeNode"), Y = j(w, "nextSibling"), D = j(w, "childNodes"), P = j(w, "parentNode"), Ae = j(w, "shadowRoot"), Yt = 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(n) {
2043
+ return tt ? tt(n) : n.nodeType;
2044
+ }, qt = function(n) {
2045
+ return at ? at(n) : n.nodeName;
2046
+ };
2047
+ if (typeof r == "function") {
2048
+ const u = e.createElement("template");
2049
+ u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
2050
+ }
2051
+ let N, et = "", Vt, Ce = !1, Et = 0;
2052
+ const Se = function() {
2053
+ if (Et > 0) throw Z('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
2054
+ }, st = function(n) {
2055
+ Se(), Et++;
2056
+ try {
2057
+ return N.createHTML(n);
2058
+ } finally {
2059
+ Et--;
2060
+ }
2061
+ }, Mo = function(n) {
2062
+ Se(), Et++;
2063
+ try {
2064
+ return N.createScriptURL(n);
2065
+ } finally {
2066
+ Et--;
2067
+ }
2068
+ }, Io = function() {
2069
+ return Ce || (Vt = Zn(b, i), Ce = !0), Vt;
2070
+ }, Lt = e, Xt = Lt.implementation, _e = Lt.createNodeIterator, Oo = Lt.createDocumentFragment, Do = Lt.getElementsByTagName, Ro = o.importNode;
2071
+ let k = Eo();
2072
+ t.isSupported = typeof Ao == "function" && typeof P == "function" && Xt && Xt.createHTMLDocument !== void 0;
2073
+ const Po = zn, No = Bn, zo = Fn, Bo = Hn, Fo = Un, Ho = jn, Le = Wn, Uo = Gn;
2074
+ let Me = go, x = null;
2075
+ const Zt = E({}, [
2076
+ ...fo,
2077
+ ...pe,
2078
+ ...he,
2079
+ ...me,
2080
+ ...po
2081
+ ]);
2082
+ let A = null;
2083
+ const Jt = E({}, [
2084
+ ...ho,
2085
+ ...ge,
2086
+ ...mo,
2087
+ ...jt
2088
+ ]);
2089
+ let W = Object.seal(gt(null, {
2090
+ tagNameCheck: {
2091
+ writable: !0,
2092
+ configurable: !1,
2093
+ enumerable: !0,
2094
+ value: null
2095
+ },
2096
+ attributeNameCheck: {
2097
+ writable: !0,
2098
+ configurable: !1,
2099
+ enumerable: !0,
2100
+ value: null
2101
+ },
2102
+ allowCustomizedBuiltInElements: {
2103
+ writable: !0,
2104
+ configurable: !1,
2105
+ enumerable: !0,
2106
+ value: !1
2107
+ }
2108
+ })), vt = null, Ie = null;
2109
+ const q = Object.seal(gt(null, {
2110
+ tagCheck: {
2111
+ writable: !0,
2112
+ configurable: !1,
2113
+ enumerable: !0,
2114
+ value: null
2115
+ },
2116
+ attributeCheck: {
2117
+ writable: !0,
2118
+ configurable: !1,
2119
+ enumerable: !0,
2120
+ value: null
2121
+ }
2122
+ }));
2123
+ let Oe = !0, Qt = !0, De = !1, Re = !0, V = !1, ot = !0, nt = !1, te = !1, Mt = null, It = null, ee = !1, lt = !1, Ot = !1, Dt = !1, Pe = !0, Ne = !1;
2124
+ const ze = "user-content-";
2125
+ let oe = !0, ne = !1, ct = {}, dt = null;
2126
+ const Be = E({}, [
2127
+ "annotation-xml",
2128
+ "audio",
2129
+ "colgroup",
2130
+ "desc",
2131
+ "foreignobject",
2132
+ "head",
2133
+ "iframe",
2134
+ "math",
2135
+ "mi",
2136
+ "mn",
2137
+ "mo",
2138
+ "ms",
2139
+ "mtext",
2140
+ "noembed",
2141
+ "noframes",
2142
+ "noscript",
2143
+ "plaintext",
2144
+ "script",
2145
+ "selectedcontent",
2146
+ "style",
2147
+ "svg",
2148
+ "template",
2149
+ "thead",
2150
+ "title",
2151
+ "video",
2152
+ "xmp"
2153
+ ]);
2154
+ let Fe = null;
2155
+ const He = E({}, [
2156
+ "audio",
2157
+ "video",
2158
+ "img",
2159
+ "source",
2160
+ "image",
2161
+ "track"
2162
+ ]);
2163
+ let Ue = null;
2164
+ const je = E({}, [
2165
+ "alt",
2166
+ "class",
2167
+ "for",
2168
+ "id",
2169
+ "label",
2170
+ "name",
2171
+ "pattern",
2172
+ "placeholder",
2173
+ "role",
2174
+ "summary",
2175
+ "title",
2176
+ "value",
2177
+ "style",
2178
+ "xmlns"
2179
+ ]), Rt = "http://www.w3.org/1998/Math/MathML", Pt = "http://www.w3.org/2000/svg", $ = "http://www.w3.org/1999/xhtml";
2180
+ let ut = $, ie = !1, re = null;
2181
+ const jo = E({}, [
2182
+ Rt,
2183
+ Pt,
2184
+ $
2185
+ ], fe), We = M([
2186
+ "mi",
2187
+ "mo",
2188
+ "mn",
2189
+ "ms",
2190
+ "mtext"
2191
+ ]);
2192
+ let ae = E({}, We);
2193
+ const $e = M(["annotation-xml"]);
2194
+ let se = E({}, $e);
2195
+ const Wo = E({}, [
2196
+ "title",
2197
+ "style",
2198
+ "font",
2199
+ "a",
2200
+ "script"
2201
+ ]);
2202
+ let wt = null;
2203
+ const $o = ["application/xhtml+xml", "text/html"], Go = "text/html";
2204
+ let S = null, ft = null;
2205
+ const Ko = e.createElement("form"), Ge = function(n) {
2206
+ return n instanceof RegExp || n instanceof Function;
2207
+ }, le = function() {
2208
+ let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2209
+ if (ft && ft === n) return;
2210
+ (!n || typeof n != "object") && (n = {}), n = H(n), wt = $o.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? Go : n.PARSER_MEDIA_TYPE, S = wt === "application/xhtml+xml" ? fe : St, x = J(n, "ALLOWED_TAGS", Zt, { transform: S }), A = J(n, "ALLOWED_ATTR", Jt, { transform: S }), re = J(n, "ALLOWED_NAMESPACES", jo, { transform: fe }), Ue = J(n, "ADD_URI_SAFE_ATTR", je, {
2211
+ transform: S,
2212
+ base: je
2213
+ }), Fe = J(n, "ADD_DATA_URI_TAGS", He, {
2214
+ transform: S,
2215
+ base: He
2216
+ }), dt = J(n, "FORBID_CONTENTS", Be, { transform: S }), vt = J(n, "FORBID_TAGS", H({}), { transform: S }), Ie = J(n, "FORBID_ATTR", H({}), { transform: S }), ct = z(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? H(n.USE_PROFILES) : n.USE_PROFILES : !1, Oe = n.ALLOW_ARIA_ATTR !== !1, Qt = n.ALLOW_DATA_ATTR !== !1, De = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Re = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = n.SAFE_FOR_TEMPLATES || !1, ot = n.SAFE_FOR_XML !== !1, nt = n.WHOLE_DOCUMENT || !1, lt = n.RETURN_DOM || !1, Ot = n.RETURN_DOM_FRAGMENT || !1, Dt = n.RETURN_TRUSTED_TYPE || !1, ee = n.FORCE_BODY || !1, Pe = n.SANITIZE_DOM !== !1, Ne = n.SANITIZE_NAMED_PROPS || !1, oe = n.KEEP_CONTENT !== !1, ne = n.IN_PLACE || !1, Me = Rn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : go, ut = typeof n.NAMESPACE == "string" ? n.NAMESPACE : $, ae = be(n, "MATHML_TEXT_INTEGRATION_POINTS", () => E({}, We)), se = be(n, "HTML_INTEGRATION_POINTS", () => E({}, $e));
2217
+ const s = be(n, "CUSTOM_ELEMENT_HANDLING", () => gt(null));
2218
+ if (W = gt(null), z(s, "tagNameCheck") && Ge(s.tagNameCheck) && (W.tagNameCheck = s.tagNameCheck), z(s, "attributeNameCheck") && Ge(s.attributeNameCheck) && (W.attributeNameCheck = s.attributeNameCheck), z(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (W.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I(W), V && (Qt = !1), Ot && (lt = !0), ct && (x = E({}, po), A = gt(null), ct.html === !0 && (E(x, fo), E(A, ho)), ct.svg === !0 && (E(x, pe), E(A, ge), E(A, jt)), ct.svgFilters === !0 && (E(x, he), E(A, ge), E(A, jt)), ct.mathMl === !0 && (E(x, me), E(A, mo), E(A, jt))), q.tagCheck = null, q.attributeCheck = null, z(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? q.tagCheck = n.ADD_TAGS : bt(n.ADD_TAGS) && (x === Zt && (x = H(x)), E(x, n.ADD_TAGS, S))), z(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? q.attributeCheck = n.ADD_ATTR : bt(n.ADD_ATTR) && (A === Jt && (A = H(A)), E(A, n.ADD_ATTR, S))), z(n, "ADD_FORBID_CONTENTS") && bt(n.ADD_FORBID_CONTENTS) && (dt === Be && (dt = H(dt)), E(dt, n.ADD_FORBID_CONTENTS, S)), oe && (x["#text"] = !0), nt && E(x, [
2219
+ "html",
2220
+ "head",
2221
+ "body"
2222
+ ]), x.table && (E(x, ["tbody"]), delete vt.tbody), n.TRUSTED_TYPES_POLICY) {
2223
+ if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
2224
+ if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
2225
+ const d = N;
2226
+ N = n.TRUSTED_TYPES_POLICY;
2227
+ try {
2228
+ et = st("");
2229
+ } catch (f) {
2230
+ throw N = d, f;
2231
+ }
2232
+ } else n.TRUSTED_TYPES_POLICY === null ? (N = void 0, et = "") : (N === void 0 && (N = Io()), N && typeof et == "string" && (et = st("")));
2233
+ M && M(n), ft = n;
2234
+ }, Ke = E({}, [
2235
+ ...pe,
2236
+ ...he,
2237
+ ...Pn
2238
+ ]), Ye = E({}, [...me, ...Nn]), Yo = function(n, s, d) {
2239
+ return s.namespaceURI === $ ? n === "svg" : s.namespaceURI === Rt ? n === "svg" && (d === "annotation-xml" || ae[d]) : !!Ke[n];
2240
+ }, qo = function(n, s, d) {
2241
+ return s.namespaceURI === $ ? n === "math" : s.namespaceURI === Pt ? n === "math" && se[d] : !!Ye[n];
2242
+ }, Vo = function(n, s, d) {
2243
+ return s.namespaceURI === Pt && !se[d] || s.namespaceURI === Rt && !ae[d] ? !1 : !Ye[n] && (Wo[n] || !Ke[n]);
2244
+ }, Xo = function(n) {
2245
+ let s = P(n);
2246
+ (!s || !s.tagName) && (s = {
2247
+ namespaceURI: ut,
2248
+ tagName: "template"
2249
+ });
2250
+ const d = St(n.tagName), f = St(s.tagName);
2251
+ return re[n.namespaceURI] ? n.namespaceURI === Pt ? Yo(d, s, f) : n.namespaceURI === Rt ? qo(d, s, f) : n.namespaceURI === $ ? Vo(d, s, f) : !!(wt === "application/xhtml+xml" && re[n.namespaceURI]) : !1;
2252
+ }, X = function(n) {
2253
+ kt(t.removed, { element: n });
2254
+ try {
2255
+ P(n).removeChild(n);
2256
+ } catch (s) {
2257
+ if (T(n), !P(n)) throw Z("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
2258
+ }
2259
+ }, qe = function(n, s, d) {
2260
+ try {
2261
+ v(n, s);
2262
+ } catch (f) {
2263
+ try {
2264
+ n.removeAttribute(d);
2265
+ } catch (h) {
2266
+ }
2267
+ }
2268
+ }, Nt = function(n) {
2269
+ zt(n);
2270
+ const s = D(n);
2271
+ if (s) {
2272
+ const f = [];
2273
+ rt(s, (h) => {
2274
+ kt(f, h);
2275
+ }), rt(f, (h) => {
2276
+ try {
2277
+ T(h);
2278
+ } catch (g) {
2279
+ }
2280
+ });
2281
+ }
2282
+ const d = Yt(n);
2283
+ if (d) for (let f = d.length - 1; f >= 0; --f) {
2284
+ const h = d[f], g = h && h.name;
2285
+ typeof g == "string" && qe(n, h, g);
2286
+ }
2287
+ }, it = function(n, s, d) {
2288
+ if (!d) try {
2289
+ d = s.getAttributeNode(n);
2290
+ } catch (f) {
2291
+ d = null;
2292
+ }
2293
+ kt(t.removed, {
2294
+ attribute: d || null,
2295
+ from: s
2296
+ });
2297
+ try {
2298
+ d ? v(s, d) : s.removeAttribute(n);
2299
+ } catch (f) {
2300
+ try {
2301
+ s.removeAttribute(n);
2302
+ } catch (h) {
2303
+ }
2304
+ }
2305
+ if (n === "is")
2306
+ if (lt || Ot) try {
2307
+ X(s);
2308
+ } catch (f) {
2309
+ }
2310
+ else try {
2311
+ s.setAttribute(n, "");
2312
+ } catch (f) {
2313
+ }
2314
+ }, Zo = function(n) {
2315
+ const s = Yt(n);
2316
+ if (s)
2317
+ for (let d = s.length - 1; d >= 0; --d) {
2318
+ const f = s[d], h = f && f.name;
2319
+ typeof h != "string" || A[S(h)] || qe(n, f, h);
2320
+ }
2321
+ }, zt = function(n) {
2322
+ const s = [n];
2323
+ for (; s.length > 0; ) {
2324
+ const d = s.pop();
2325
+ yt(d) === F.element && Zo(d);
2326
+ const f = D(d);
2327
+ if (f) for (let h = f.length - 1; h >= 0; --h) s.push(f[h]);
2328
+ }
2329
+ }, Ve = function(n, s) {
2330
+ return ot ? n === "patchsrc" ? !0 : n === "for" && s !== "label" && s !== "output" : !1;
2331
+ }, Jo = function(n) {
2332
+ if (!ot) return;
2333
+ const s = [n];
2334
+ for (; s.length > 0; ) {
2335
+ const d = s.pop(), f = yt(d);
2336
+ if (f === F.processingInstruction || f === F.comment && O(yo, d.data)) {
2337
+ try {
2338
+ T(d);
2339
+ } catch (g) {
2340
+ }
2341
+ continue;
2342
+ }
2343
+ if (f === F.element) {
2344
+ const g = d, y = S(qt(d));
2345
+ try {
2346
+ g.hasAttribute && g.hasAttribute("patchsrc") && g.removeAttribute("patchsrc"), g.hasAttribute && g.hasAttribute("for") && Ve("for", y) && g.removeAttribute("for");
2347
+ } catch (C) {
2348
+ }
2349
+ }
2350
+ const h = D(d);
2351
+ if (h) for (let g = h.length - 1; g >= 0; --g) s.push(h[g]);
2352
+ }
2353
+ }, Xe = function(n) {
2354
+ let s = null, d = null;
2355
+ if (ee) n = "<remove></remove>" + n;
2356
+ else {
2357
+ const g = so(n, /^[\r\n\t ]+/);
2358
+ d = g && g[0];
2359
+ }
2360
+ wt === "application/xhtml+xml" && ut === $ && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
2361
+ const f = N ? st(n) : n;
2362
+ if (ut === $) try {
2363
+ s = new m().parseFromString(f, wt);
2364
+ } catch (g) {
2365
+ }
2366
+ if (!s || !s.documentElement) {
2367
+ s = Xt.createDocument(ut, "template", null);
2368
+ try {
2369
+ s.documentElement.innerHTML = ie ? et : f;
2370
+ } catch (g) {
2371
+ }
2372
+ }
2373
+ const h = s.body || s.documentElement;
2374
+ return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ut === $ ? Do.call(s, nt ? "html" : "body")[0] : nt ? s.documentElement : h;
2375
+ }, Ze = function(n) {
2376
+ const s = _t ? _t(n) : n.ownerDocument;
2377
+ return _e.call(s || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
2378
+ }, Bt = function(n) {
2379
+ return n = xt(n, Po, " "), n = xt(n, No, " "), n = xt(n, zo, " "), n;
2380
+ }, ce = function(n) {
2381
+ var s;
2382
+ n.normalize();
2383
+ const d = _t ? _t(n) : n.ownerDocument, f = _e.call(d || n, n, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
2384
+ let h = f.nextNode();
2385
+ for (; h; )
2386
+ h.data = Bt(h.data), h = f.nextNode();
2387
+ const g = (s = n.querySelectorAll) === null || s === void 0 ? void 0 : s.call(n, "template");
2388
+ g && rt(g, (y) => {
2389
+ pt(y.content) && ce(y.content);
2390
+ });
2391
+ }, Ft = function(n) {
2392
+ const s = at ? at(n) : null;
2393
+ return typeof s != "string" || S(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== Yt(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !== tt(n) || n.childNodes !== D(n);
2394
+ }, pt = function(n) {
2395
+ if (!tt || typeof n != "object" || n === null) return !1;
2396
+ try {
2397
+ return tt(n) === F.documentFragment;
2398
+ } catch (s) {
2399
+ return !1;
2400
+ }
2401
+ }, Tt = function(n) {
2402
+ if (!tt || typeof n != "object" || n === null) return !1;
2403
+ try {
2404
+ return typeof tt(n) == "number";
2405
+ } catch (s) {
2406
+ return !1;
2407
+ }
2408
+ };
2409
+ function G(u, n, s) {
2410
+ u.length !== 0 && rt(u, (d) => {
2411
+ d.call(t, n, s, ft);
2412
+ });
2413
+ }
2414
+ const Qo = function(n, s) {
2415
+ return !!(ot && n.hasChildNodes() && !Tt(n.firstElementChild) && O(bo, n.textContent) && O(bo, n.innerHTML) || ot && n.namespaceURI === $ && qn[s] && (Tt(n.firstElementChild) || typeof n.textContent == "string" && O(Vn[s], n.textContent)) || n.nodeType === F.processingInstruction || ot && n.nodeType === F.comment && O(yo, n.data));
2416
+ }, Ht = function(n, s) {
2417
+ if (n instanceof RegExp) return O(n, s);
2418
+ if (n instanceof Function) {
2419
+ for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) f[h - 2] = arguments[h];
2420
+ return !!n(s, ...f);
2421
+ }
2422
+ return !1;
2423
+ }, tn = function(n, s, d) {
2424
+ if (!vt[s] && eo(s) && Ht(W.tagNameCheck, s)) return !1;
2425
+ if (oe && !dt[s]) {
2426
+ const f = P(n), h = D(n);
2427
+ if (h && f) {
2428
+ const g = h.length;
2429
+ for (let y = g - 1; y >= 0; --y) {
2430
+ const C = n === d ? _(h[y], !0) : h[y];
2431
+ f.insertBefore(C, Y(n));
2432
+ }
2433
+ }
2434
+ }
2435
+ return X(n), !0;
2436
+ }, Je = function(n, s, d, f) {
2437
+ return n.length === 0 ? s : s === d || s === f ? H(s) : s;
2438
+ }, ht = function(n, s) {
2439
+ return n === s || P(n) !== null ? !1 : (ne && zt(n), !0);
2440
+ }, Qe = function(n, s) {
2441
+ if (G(k.beforeSanitizeElements, n, null), ht(n, s)) return !0;
2442
+ if (Ft(n))
2443
+ return X(n), !0;
2444
+ const d = S(qt(n));
2445
+ if (x = Je(k.uponSanitizeElement, x, Zt, Mt), G(k.uponSanitizeElement, n, {
2446
+ tagName: d,
2447
+ allowedTags: x
2448
+ }), ht(n, s)) return !0;
2449
+ if (Qo(n, d))
2450
+ return X(n), !0;
2451
+ if (vt[d] || !(q.tagCheck instanceof Function && q.tagCheck(d)) && !x[d]) {
2452
+ const f = tn(n, d, s);
2453
+ return f === !1 && (G(k.afterSanitizeElements, n, null), ht(n, s)) ? !0 : f;
2454
+ }
2455
+ if (yt(n) === F.element && !Xo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && O(Kn, n.innerHTML))
2456
+ return X(n), !0;
2457
+ if (V && n.nodeType === F.text) {
2458
+ const f = Bt(n.textContent);
2459
+ n.textContent !== f && (kt(t.removed, { element: n.cloneNode() }), n.textContent = f);
2460
+ }
2461
+ return G(k.afterSanitizeElements, n, null), ht(n, s);
2462
+ }, to = function(n, s, d) {
2463
+ if (Ie[s] || Ve(s, n) || Pe && (s === "id" || s === "name") && (d in e || d in Ko)) return !1;
2464
+ const f = A[s] || q.attributeCheck instanceof Function && q.attributeCheck(s, n);
2465
+ return Qt && O(Bo, s) || Oe && O(Fo, s) ? !0 : f ? Ue[s] || O(Me, xt(d, Le, "")) || (s === "src" || s === "xlink:href" || s === "href") && n !== "script" && lo(d, "data:") === 0 && Fe[n] || De && !O(Ho, xt(d, Le, "")) ? !0 : !d : eo(n) && Ht(W.tagNameCheck, n) && Ht(W.attributeNameCheck, s, n) || s === "is" && W.allowCustomizedBuiltInElements && Ht(W.tagNameCheck, d);
2466
+ }, en = E({}, [
2467
+ "annotation-xml",
2468
+ "color-profile",
2469
+ "font-face",
2470
+ "font-face-format",
2471
+ "font-face-name",
2472
+ "font-face-src",
2473
+ "font-face-uri",
2474
+ "missing-glyph"
2475
+ ]), eo = function(n) {
2476
+ return !en[St(n)] && O(Uo, n);
2477
+ }, on = function(n, s, d, f) {
2478
+ if (N && typeof b == "object" && typeof b.getAttributeType == "function" && !d) switch (b.getAttributeType(n, s)) {
2479
+ case "TrustedHTML":
2480
+ return st(f);
2481
+ case "TrustedScriptURL":
2482
+ return Mo(f);
2483
+ }
2484
+ return f;
2485
+ }, nn = function(n, s, d, f) {
2486
+ try {
2487
+ return d ? n.setAttributeNS(d, s, f) : n.setAttribute(s, f), Ft(n) ? (X(n), !1) : !0;
2488
+ } catch (h) {
2489
+ return it(s, n), !1;
2490
+ }
2491
+ }, oo = function(n, s) {
2492
+ if (G(k.beforeSanitizeAttributes, n, null), ht(n, s)) return;
2493
+ const d = n.attributes;
2494
+ if (!d || Ft(n)) return;
2495
+ A = Je(k.uponSanitizeAttribute, A, Jt, It);
2496
+ const f = {
2497
+ attrName: "",
2498
+ attrValue: "",
2499
+ keepAttr: !0,
2500
+ allowedAttributes: A,
2501
+ forceKeepAttr: void 0
2502
+ };
2503
+ let h = d.length;
2504
+ const g = S(n.nodeName);
2505
+ for (; h--; ) {
2506
+ const y = d[h], C = y.name, U = y.namespaceURI, B = y.value, mt = S(C), ue = B;
2507
+ let R = C === "value" ? ue : _n(ue), no = !1;
2508
+ if (f.attrName = mt, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, G(k.uponSanitizeAttribute, n, f), R = f.attrValue, Ne && (mt === "id" || mt === "name") && lo(R, ze) !== 0 && (it(C, n, y), R = ze + R, no = !0), ot && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
2509
+ it(C, n, y);
2510
+ continue;
2511
+ }
2512
+ if (mt === "attributename" && so(R, "href")) {
2513
+ it(C, n, y);
2514
+ continue;
2515
+ }
2516
+ if (!f.forceKeepAttr) {
2517
+ if (!f.keepAttr) {
2518
+ it(C, n, y);
2519
+ continue;
2520
+ }
2521
+ if (!Re && O(Yn, R)) {
2522
+ it(C, n, y);
2523
+ continue;
2524
+ }
2525
+ if (V && (R = Bt(R)), !to(g, mt, R)) {
2526
+ it(C, n, y);
2527
+ continue;
2528
+ }
2529
+ R = on(g, mt, U, R), R !== ue && nn(n, C, U, R) && no && ao(t.removed);
2530
+ }
2531
+ }
2532
+ G(k.afterSanitizeAttributes, n, null), ht(n, s);
2533
+ }, Ut = function(n) {
2534
+ let s = null;
2535
+ const d = Ze(n);
2536
+ for (G(k.beforeSanitizeShadowDOM, n, null); s = d.nextNode(); )
2537
+ if (G(k.uponSanitizeShadowNode, s, null), Qe(s, n), oo(s, n), pt(s.content) && Ut(s.content), yt(s) === F.element) {
2538
+ const f = Ae(s);
2539
+ pt(f) && (de(f), Ut(f));
2540
+ }
2541
+ G(k.afterSanitizeShadowDOM, n, null);
2542
+ }, de = function(n) {
2543
+ const s = [{
2544
+ node: n,
2545
+ shadow: null
2546
+ }];
2547
+ for (; s.length > 0; ) {
2548
+ const d = s.pop();
2549
+ if (d.shadow) {
2550
+ Ut(d.shadow);
2551
+ continue;
2552
+ }
2553
+ const f = d.node, h = yt(f) === F.element, g = D(f);
2554
+ if (g) for (let y = g.length - 1; y >= 0; --y) s.push({
2555
+ node: g[y],
2556
+ shadow: null
2557
+ });
2558
+ if (h) {
2559
+ const y = at ? at(f) : null;
2560
+ if (typeof y == "string" && S(y) === "template") {
2561
+ const C = f.content;
2562
+ pt(C) && s.push({
2563
+ node: C,
2564
+ shadow: null
2565
+ });
2566
+ }
2567
+ }
2568
+ if (h) {
2569
+ const y = Ae(f);
2570
+ pt(y) && s.push({
2571
+ node: null,
2572
+ shadow: y
2573
+ }, {
2574
+ node: y,
2575
+ shadow: null
2576
+ });
2577
+ }
2578
+ }
2579
+ };
2580
+ return t.sanitize = function(u) {
2581
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, f = null, h = null;
2582
+ if (ie = !u, ie && (u = "<!-->"), typeof u != "string" && !Tt(u) && (u = Dn(u), typeof u != "string"))
2583
+ throw Z("dirty is not a string, aborting");
2584
+ if (!t.isSupported) return u;
2585
+ te ? (x = Mt, A = It) : le(n), (k.uponSanitizeElement.length > 0 || k.uponSanitizeAttribute.length > 0) && (x = H(x)), k.uponSanitizeAttribute.length > 0 && (A = H(A)), t.removed = [];
2586
+ const g = ne && typeof u != "string" && Tt(u);
2587
+ if (g) {
2588
+ Jo(u);
2589
+ const U = qt(u);
2590
+ if (typeof U == "string") {
2591
+ const B = S(U);
2592
+ if (!x[B] || vt[B])
2593
+ throw Nt(u), Z("root node is forbidden and cannot be sanitized in-place");
2594
+ }
2595
+ if (Ft(u))
2596
+ throw Nt(u), Z("root node is clobbered and cannot be sanitized in-place");
2597
+ try {
2598
+ de(u);
2599
+ } catch (B) {
2600
+ throw Nt(u), B;
2601
+ }
2602
+ } else if (Tt(u))
2603
+ s = Xe("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType === F.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? s = d : s.appendChild(d), de(s);
2604
+ else {
2605
+ if (!lt && !V && !nt && u.indexOf("<") === -1) return N && Dt ? st(u) : u;
2606
+ if (s = Xe(u), !s) return lt ? null : Dt ? et : "";
2607
+ }
2608
+ s && ee && X(s.firstChild);
2609
+ const y = g ? u : s;
2610
+ try {
2611
+ const U = Ze(y);
2612
+ for (; f = U.nextNode(); )
2613
+ Qe(f, y), oo(f, y), pt(f.content) && Ut(f.content);
2614
+ } catch (U) {
2615
+ throw g && (Nt(u), rt(t.removed, (B) => {
2616
+ B.element && zt(B.element);
2617
+ })), U;
2618
+ }
2619
+ if (g) {
2620
+ let U = !1;
2621
+ if (rt(t.removed, (B) => {
2622
+ B.element && (B.element === u && (U = !0), zt(B.element));
2623
+ }), U) throw Z("a node selected for removal could not be safely returned; refusing to sanitize in place");
2624
+ return V && ce(u), u;
2625
+ }
2626
+ if (lt) {
2627
+ if (V && ce(s), Ot)
2628
+ for (h = Oo.call(s.ownerDocument); s.firstChild; ) h.appendChild(s.firstChild);
2629
+ else h = s;
2630
+ return (A.shadowroot || A.shadowrootmode) && (h = Ro.call(o, h, !0)), h;
2631
+ }
2632
+ let C = nt ? s.outerHTML : s.innerHTML;
2633
+ return nt && x["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && O($n, s.ownerDocument.doctype.name) && (C = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
2634
+ ` + C), V && (C = Bt(C)), N && Dt ? st(C) : C;
2635
+ }, t.setConfig = function() {
2636
+ let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2637
+ le(u), te = !0, Mt = x, It = A;
2638
+ }, t.clearConfig = function() {
2639
+ ft = null, te = !1, Mt = null, It = null, N = Vt, et = "";
2640
+ }, t.isValidAttribute = function(u, n, s) {
2641
+ ft || le({});
2642
+ const d = S(u), f = S(n);
2643
+ return to(d, f, s);
2644
+ }, t.addHook = function(u, n) {
2645
+ typeof n == "function" && z(k, u) && kt(k[u], n);
2646
+ }, t.removeHook = function(u, n) {
2647
+ if (z(k, u)) {
2648
+ if (n !== void 0) {
2649
+ const s = Cn(k[u], n);
2650
+ return s === -1 ? void 0 : Sn(k[u], s, 1)[0];
2651
+ }
2652
+ return ao(k[u]);
2653
+ }
2654
+ }, t.removeHooks = function(u) {
2655
+ z(k, u) && (k[u] = []);
2656
+ }, t.removeAllHooks = function() {
2657
+ k = Eo();
2658
+ }, t;
2659
+ }
2660
+ var Wt = _o();
2661
+ const Jn = [
1136
2662
  "p",
1137
2663
  "br",
1138
2664
  "strong",
@@ -1156,7 +2682,6 @@ const q = [
1156
2682
  "img",
1157
2683
  "video",
1158
2684
  "audio",
1159
- "iframe",
1160
2685
  "table",
1161
2686
  "thead",
1162
2687
  "tbody",
@@ -1172,62 +2697,73 @@ const q = [
1172
2697
  "sup",
1173
2698
  "sub",
1174
2699
  "hr"
1175
- ], V = {
2700
+ // 'iframe' is deliberately not in the default allowlist. Arbitrary pasted
2701
+ // or typed content should not be able to silently embed an iframe - that's
2702
+ // a real vector (e.g. pasting from a compromised page). The editor's
2703
+ // embed-iframe plugin inserts iframes through its own explicit,
2704
+ // user-initiated dialog, a different trust boundary that never calls
2705
+ // through this sanitizer. A consumer that genuinely wants iframes in
2706
+ // pasted/typed content can still opt in via a custom allowedTags list.
2707
+ ], Qn = {
1176
2708
  "*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
1177
2709
  a: ["href", "target", "rel", "title"],
1178
2710
  img: ["src", "alt", "width", "height", "loading"],
1179
2711
  video: ["src", "controls", "width", "height", "autoplay", "loop", "muted"],
1180
2712
  audio: ["src", "controls", "autoplay", "loop", "muted"],
1181
- iframe: ["src", "width", "height", "name", "title", "longdesc", "allow", "allowfullscreen", "frameborder", "scrolling", "loading", "referrerpolicy"],
1182
2713
  table: ["border", "cellpadding", "cellspacing"],
1183
2714
  td: ["colspan", "rowspan", "align", "valign"],
1184
- th: ["colspan", "rowspan", "align", "valign"]
1185
- };
1186
- function D(a, t, e) {
2715
+ th: ["colspan", "rowspan", "align", "valign"],
2716
+ // 'iframe' itself is still excluded from DEFAULT_ALLOWED_TAGS above, so this
2717
+ // entry is inert for ordinary input/paste - it only takes effect for the
2718
+ // embed-iframe plugin's trust-marked insertions (see sanitizeInputHTML's
2719
+ // additionalAllowedTags), restoring the attributes that make an inserted
2720
+ // iframe actually usable (src, sizing, fullscreen, scrolling/border).
2721
+ iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
2722
+ }, ti = "data-editora-embed";
2723
+ function ei(a) {
2724
+ if (!a || /\s/.test(a.trim())) return !1;
2725
+ try {
2726
+ const t = new URL(a.trim());
2727
+ return (t.protocol === "https:" || t.protocol === "http:") && t.hostname.length > 0;
2728
+ } catch (t) {
2729
+ return !1;
2730
+ }
2731
+ }
2732
+ function Lo(a, t, e, o) {
1187
2733
  if ((t == null ? void 0 : t.sanitize) === !1)
1188
2734
  return a;
1189
- const o = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : q, i = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : V, r = document.createElement("div");
1190
- return r.innerHTML = a, P(r, o, i), r.innerHTML;
1191
- }
1192
- function P(a, t, e) {
1193
- const o = Array.from(a.childNodes);
1194
- for (const n of o)
1195
- if (n.nodeType === Node.ELEMENT_NODE) {
1196
- const i = n, r = i.tagName.toLowerCase();
1197
- if (!t.includes(r)) {
1198
- for (; i.firstChild; )
1199
- a.insertBefore(i.firstChild, i);
1200
- a.removeChild(i);
1201
- continue;
1202
- }
1203
- G(i, e), P(i, t, e);
1204
- } else n.nodeType !== Node.TEXT_NODE && a.removeChild(n);
1205
- }
1206
- function G(a, t) {
1207
- const e = a.tagName.toLowerCase(), o = Array.from(a.attributes), n = t[e] || [], i = t["*"] || [], r = [...n, ...i];
1208
- for (const s of o) {
1209
- const l = s.name.toLowerCase();
1210
- let c = !1;
1211
- r.includes(l) && (c = !0);
1212
- for (const d of r)
1213
- if (d.endsWith("*")) {
1214
- const h = d.slice(0, -1);
1215
- if (l.startsWith(h)) {
1216
- c = !0;
1217
- break;
1218
- }
1219
- }
1220
- (l.startsWith("on") || l === "javascript:" || l === "href" && s.value.trim().toLowerCase().startsWith("javascript:") || l === "src" && s.value.trim().toLowerCase().startsWith("javascript:")) && (c = !1), l === "dir" && !["ltr", "rtl", "auto"].includes(s.value.trim().toLowerCase()) && (c = !1), c || a.removeAttribute(s.name);
2735
+ const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : Jn, r = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...i, ...e])) : i, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : Qn, p = /* @__PURE__ */ new Set();
2736
+ for (const b of Object.values(c))
2737
+ for (const w of b) p.add(w);
2738
+ const m = {
2739
+ ALLOWED_TAGS: r,
2740
+ ALLOWED_ATTR: Array.from(p)
2741
+ };
2742
+ if (!o)
2743
+ return Wt.sanitize(a, m);
2744
+ Wt.addHook(
2745
+ "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);
2749
+ }
2750
+ );
2751
+ try {
2752
+ return Wt.sanitize(a, m);
2753
+ } finally {
2754
+ Wt.removeHook("uponSanitizeElement");
1221
2755
  }
1222
- a.hasAttribute("href") && (a.getAttribute("href") || "").trim().toLowerCase().startsWith("javascript:") && a.removeAttribute("href"), a.hasAttribute("src") && (a.getAttribute("src") || "").trim().toLowerCase().startsWith("javascript:") && a.removeAttribute("src");
1223
2756
  }
1224
- function X(a, t, e) {
1225
- return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : D(a, t);
2757
+ function oi(a, t, e, o) {
2758
+ return Lo(a, t, o, !1);
2759
+ }
2760
+ function ni(a, t, e) {
2761
+ return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : oi(a, t);
1226
2762
  }
1227
- function Y(a, t, e) {
1228
- return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : D(a, t);
2763
+ function ii(a, t, e, o) {
2764
+ return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : Lo(a, t, o, !0);
1229
2765
  }
1230
- const S = class S {
2766
+ const Kt = class Kt {
1231
2767
  /**
1232
2768
  * Resolve configuration from multiple sources with priority
1233
2769
  */
@@ -1245,12 +2781,12 @@ const S = class S {
1245
2781
  static normalizeConfig(t) {
1246
2782
  const e = { ...t };
1247
2783
  if (e.toolbarFloating !== void 0 || e.toolbarSticky !== void 0) {
1248
- const r = typeof e.toolbar == "object" && e.toolbar ? { ...e.toolbar } : typeof e.toolbar == "string" ? { items: e.toolbar } : {};
1249
- e.toolbarFloating !== void 0 && (r.floating = !!e.toolbarFloating), e.toolbarSticky !== void 0 && (r.sticky = !!e.toolbarSticky), e.toolbar = r;
2784
+ const l = typeof e.toolbar == "object" && e.toolbar ? { ...e.toolbar } : typeof e.toolbar == "string" ? { items: e.toolbar } : {};
2785
+ e.toolbarFloating !== void 0 && (l.floating = !!e.toolbarFloating), e.toolbarSticky !== void 0 && (l.sticky = !!e.toolbarSticky), e.toolbar = l;
1250
2786
  }
1251
2787
  if (e.toolbarItems !== void 0 && typeof e.toolbar == "object" && e.toolbar && (e.toolbar.items = e.toolbarItems), e.autosaveEnabled !== void 0 || e.autosaveIntervalMs !== void 0 || e.autosaveStorageKey !== void 0 || e.autosaveProvider !== void 0 || e.autosaveApiUrl !== void 0) {
1252
- const r = typeof e.autosave == "object" && e.autosave ? { ...e.autosave } : {};
1253
- e.autosaveEnabled !== void 0 && (r.enabled = !!e.autosaveEnabled), e.autosaveIntervalMs !== void 0 && (r.intervalMs = Number(e.autosaveIntervalMs)), e.autosaveStorageKey !== void 0 && (r.storageKey = e.autosaveStorageKey), e.autosaveProvider !== void 0 && (r.provider = e.autosaveProvider), e.autosaveApiUrl !== void 0 && (r.apiUrl = e.autosaveApiUrl), e.autosave = r;
2788
+ const l = typeof e.autosave == "object" && e.autosave ? { ...e.autosave } : {};
2789
+ e.autosaveEnabled !== void 0 && (l.enabled = !!e.autosaveEnabled), e.autosaveIntervalMs !== void 0 && (l.intervalMs = Number(e.autosaveIntervalMs)), e.autosaveStorageKey !== void 0 && (l.storageKey = e.autosaveStorageKey), e.autosaveProvider !== void 0 && (l.provider = e.autosaveProvider), e.autosaveApiUrl !== void 0 && (l.apiUrl = e.autosaveApiUrl), e.autosave = l;
1254
2790
  }
1255
2791
  const o = {
1256
2792
  enabled: !1,
@@ -1265,46 +2801,46 @@ const S = class S {
1265
2801
  enabled: e.autosave
1266
2802
  };
1267
2803
  else if (typeof e.autosave == "object" && e.autosave) {
1268
- const r = {
2804
+ const l = {
1269
2805
  ...o,
1270
2806
  ...e.autosave
1271
2807
  };
1272
- r.intervalMs === void 0 && r.interval !== void 0 && (r.intervalMs = Number(r.interval)), r.enabled === void 0 && (r.enabled = !0), (!Number.isFinite(r.intervalMs) || r.intervalMs <= 0) && (r.intervalMs = o.intervalMs), e.autosave = r;
2808
+ l.intervalMs === void 0 && l.interval !== void 0 && (l.intervalMs = Number(l.interval)), l.enabled === void 0 && (l.enabled = !0), (!Number.isFinite(l.intervalMs) || l.intervalMs <= 0) && (l.intervalMs = o.intervalMs), e.autosave = l;
1273
2809
  } else
1274
2810
  e.autosave = o;
1275
2811
  if (e.languageLocale !== void 0 || e.languageDirection !== void 0) {
1276
- const r = typeof e.language == "object" && e.language ? { ...e.language } : {};
1277
- e.languageLocale !== void 0 && (r.locale = e.languageLocale), e.languageDirection !== void 0 && (r.direction = e.languageDirection), e.language = r;
2812
+ const l = typeof e.language == "object" && e.language ? { ...e.language } : {};
2813
+ e.languageLocale !== void 0 && (l.locale = e.languageLocale), e.languageDirection !== void 0 && (l.direction = e.languageDirection), e.language = l;
1278
2814
  }
1279
- const n = { locale: "en", direction: "ltr" };
2815
+ const i = { locale: "en", direction: "ltr" };
1280
2816
  if (typeof e.language == "string" ? e.language = {
1281
2817
  locale: e.language,
1282
- direction: n.direction
2818
+ direction: i.direction
1283
2819
  } : typeof e.language == "object" && e.language ? e.language = {
1284
- ...n,
2820
+ ...i,
1285
2821
  ...e.language
1286
- } : e.language = n, e.spellcheckEnabled !== void 0 || e.spellcheckProvider !== void 0 || e.spellcheckApiUrl !== void 0) {
1287
- const r = typeof e.spellcheck == "object" && e.spellcheck ? { ...e.spellcheck } : {};
1288
- e.spellcheckEnabled !== void 0 && (r.enabled = !!e.spellcheckEnabled), e.spellcheckProvider !== void 0 && (r.provider = e.spellcheckProvider), e.spellcheckApiUrl !== void 0 && (r.apiUrl = e.spellcheckApiUrl), e.spellcheck = r;
2822
+ } : e.language = i, e.spellcheckEnabled !== void 0 || e.spellcheckProvider !== void 0 || e.spellcheckApiUrl !== void 0) {
2823
+ const l = typeof e.spellcheck == "object" && e.spellcheck ? { ...e.spellcheck } : {};
2824
+ e.spellcheckEnabled !== void 0 && (l.enabled = !!e.spellcheckEnabled), e.spellcheckProvider !== void 0 && (l.provider = e.spellcheckProvider), e.spellcheckApiUrl !== void 0 && (l.apiUrl = e.spellcheckApiUrl), e.spellcheck = l;
1289
2825
  }
1290
- const i = {
2826
+ const r = {
1291
2827
  enabled: !1,
1292
2828
  provider: "browser",
1293
2829
  apiUrl: ""
1294
2830
  };
1295
2831
  if (typeof e.spellcheck == "boolean")
1296
2832
  e.spellcheck = {
1297
- ...i,
2833
+ ...r,
1298
2834
  enabled: e.spellcheck
1299
2835
  };
1300
2836
  else if (typeof e.spellcheck == "object" && e.spellcheck) {
1301
- const r = {
1302
- ...i,
2837
+ const l = {
2838
+ ...r,
1303
2839
  ...e.spellcheck
1304
2840
  };
1305
- !r.provider && r.mode && (r.provider = r.mode === "local" ? "browser" : "api"), r.enabled === void 0 && (r.enabled = !!(r.mode || r.provider || r.apiUrl)), e.spellcheck = r;
2841
+ !l.provider && l.mode && (l.provider = l.mode === "local" ? "browser" : "api"), l.enabled === void 0 && (l.enabled = !!(l.mode || l.provider || l.apiUrl)), e.spellcheck = l;
1306
2842
  } else
1307
- e.spellcheck = i;
2843
+ e.spellcheck = r;
1308
2844
  return e.contextMenuEnabled !== void 0 && (e.contextMenu = {
1309
2845
  enabled: !!e.contextMenuEnabled
1310
2846
  }), typeof e.contextMenu == "boolean" ? e.contextMenu = { enabled: e.contextMenu } : typeof e.contextMenu == "object" && e.contextMenu ? e.contextMenu = {
@@ -1364,9 +2900,9 @@ const S = class S {
1364
2900
  */
1365
2901
  static parseAttributes(t) {
1366
2902
  const e = {};
1367
- for (const [o, n] of Object.entries(t)) {
1368
- const i = this.kebabToCamel(o);
1369
- e[i] = this.parseAttributeValue(n);
2903
+ for (const [o, i] of Object.entries(t)) {
2904
+ const r = this.kebabToCamel(o);
2905
+ e[r] = this.BOOLEAN_ATTRIBUTES.has(o) && (i === "" || i === o) ? !0 : this.parseAttributeValue(i);
1370
2906
  }
1371
2907
  return e;
1372
2908
  }
@@ -1414,12 +2950,12 @@ const S = class S {
1414
2950
  static merge(...t) {
1415
2951
  const e = {};
1416
2952
  for (const o of t)
1417
- for (const [n, i] of Object.entries(o))
1418
- i != null && (typeof i == "object" && !Array.isArray(i) && e[n] ? e[n] = this.merge(e[n], i) : e[n] = i);
2953
+ for (const [i, r] of Object.entries(o))
2954
+ r != null && (typeof r == "object" && !Array.isArray(r) && e[i] ? e[i] = this.merge(e[i], r) : e[i] = r);
1419
2955
  return e;
1420
2956
  }
1421
2957
  };
1422
- S.EDITOR_DEFAULTS = {
2958
+ Kt.EDITOR_DEFAULTS = {
1423
2959
  height: 400,
1424
2960
  width: "100%",
1425
2961
  readonly: !1,
@@ -1468,87 +3004,106 @@ S.EDITOR_DEFAULTS = {
1468
3004
  sanitizeOnInput: !0
1469
3005
  },
1470
3006
  statusbar: !1
1471
- };
1472
- let x = S;
1473
- const J = '.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;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-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}}';
1474
- let y;
1475
- const Q = "__editoraCommandEditorRoot", Z = "__editoraLastCommandButton", T = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", A = ".rte-content, .editora-content", C = /* @__PURE__ */ new Set();
1476
- let m = null, L = !1, k = null, w = null;
1477
- function M(a) {
3007
+ }, Kt.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
3008
+ "readonly",
3009
+ "disabled",
3010
+ "autofocus",
3011
+ "statusbar",
3012
+ "toolbar-floating",
3013
+ "toolbar-sticky",
3014
+ "autosave-enabled",
3015
+ "accessibility-enable-aria",
3016
+ "accessibility-keyboard-navigation",
3017
+ "accessibility-checker",
3018
+ "performance-viewport-only-scan",
3019
+ "spellcheck-enabled",
3020
+ "context-menu-enabled",
3021
+ "paste-clean",
3022
+ "paste-keep-formatting",
3023
+ "paste-convert-word",
3024
+ "security-sanitize-on-paste",
3025
+ "security-sanitize-on-input"
3026
+ ]);
3027
+ let Te = Kt;
3028
+ 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
+ let $t;
3030
+ const ai = "__editoraCommandEditorRoot", si = "__editoraLastCommandButton", vo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", wo = ".rte-content, .editora-content", ke = /* @__PURE__ */ new Set();
3031
+ let Q = null, To = !1, ye = null, Ee = null;
3032
+ function ko(a) {
1478
3033
  if (!(a instanceof HTMLElement)) return !1;
1479
3034
  const t = a;
1480
3035
  return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
1481
3036
  }
1482
- function tt(a) {
3037
+ function li(a) {
1483
3038
  return a ? a.nodeType === Node.ELEMENT_NODE ? a : a.parentElement : null;
1484
3039
  }
1485
- function b(a) {
3040
+ function Ct(a) {
1486
3041
  if (!a) return null;
1487
- if (M(a))
3042
+ if (ko(a))
1488
3043
  return a;
1489
- const t = a.matches(T) ? a : a.closest(T);
1490
- return !t || !M(t) ? null : t;
3044
+ const t = a.matches(vo) ? a : a.closest(vo);
3045
+ return !t || !ko(t) ? null : t;
1491
3046
  }
1492
- function et() {
1493
- var n;
3047
+ function ci() {
3048
+ var i;
1494
3049
  if (typeof window == "undefined") return null;
1495
- const a = window[Q];
3050
+ const a = window[ai];
1496
3051
  if (a instanceof HTMLElement) {
1497
- const i = b(a);
1498
- if (i) return i;
1499
- const r = a.matches(A) ? a : a.querySelector(A);
1500
- if (r) {
1501
- const s = b(r);
1502
- if (s) return s;
3052
+ const r = Ct(a);
3053
+ if (r) return r;
3054
+ const l = a.matches(wo) ? a : a.querySelector(wo);
3055
+ if (l) {
3056
+ const c = Ct(l);
3057
+ if (c) return c;
1503
3058
  }
1504
3059
  }
1505
- const t = window[Z];
3060
+ const t = window[si];
1506
3061
  if (t instanceof HTMLElement) {
1507
- const i = b(t);
1508
- if (i) return i;
3062
+ const r = Ct(t);
3063
+ if (r) return r;
1509
3064
  }
1510
3065
  const e = document.activeElement;
1511
3066
  if (e) {
1512
- const i = b(e);
1513
- if (i) return i;
3067
+ const r = Ct(e);
3068
+ if (r) return r;
1514
3069
  }
1515
- const o = (n = window.getSelection) == null ? void 0 : n.call(window);
3070
+ const o = (i = window.getSelection) == null ? void 0 : i.call(window);
1516
3071
  if (o && o.rangeCount > 0) {
1517
- const i = b(tt(o.getRangeAt(0).startContainer));
1518
- if (i) return i;
3072
+ const r = Ct(li(o.getRangeAt(0).startContainer));
3073
+ if (r) return r;
1519
3074
  }
1520
- if (m && m.isConnected)
1521
- return m;
1522
- for (const i of C)
1523
- if (i.isConnected) return i;
3075
+ if (Q && Q.isConnected)
3076
+ return Q;
3077
+ for (const r of ke)
3078
+ if (r.isConnected) return r;
1524
3079
  return null;
1525
3080
  }
1526
- function ot() {
1527
- if (typeof window == "undefined" || L) return;
1528
- k = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, w = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
3081
+ function di() {
3082
+ if (typeof window == "undefined" || To) return;
3083
+ ye = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, Ee = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
1529
3084
  const a = (t, ...e) => {
1530
- const o = et();
1531
- return o ? o.execCommand(t, ...e) : k ? k(t, ...e) : w ? w(t, ...e) : !1;
3085
+ const o = ci();
3086
+ return o ? o.execCommand(t, ...e) : ye ? ye(t, ...e) : Ee ? Ee(t, ...e) : !1;
1532
3087
  };
1533
- window.executeEditorCommand = a, window.execEditorCommand = a, L = !0;
3088
+ window.executeEditorCommand = a, window.execEditorCommand = a, To = !0;
1534
3089
  }
1535
- function it() {
3090
+ function ui() {
1536
3091
  const a = "editora-webcomponent-styles";
1537
3092
  if (!document.getElementById(a)) {
1538
3093
  const t = document.createElement("style");
1539
- t.id = a, t.textContent = J, document.head.appendChild(t);
3094
+ t.id = a, t.textContent = ri, document.head.appendChild(t);
1540
3095
  }
1541
3096
  }
1542
- function nt() {
1543
- if (!y) {
1544
- const a = g.__globalPluginLoader;
1545
- a ? y = a : y = new I();
3097
+ function fi() {
3098
+ if (!$t) {
3099
+ const a = K.__globalPluginLoader;
3100
+ a ? $t = a : $t = new xo();
1546
3101
  }
1547
- return y;
3102
+ return $t;
1548
3103
  }
1549
- class g extends HTMLElement {
3104
+ class K extends HTMLElement {
1550
3105
  constructor() {
1551
- if (super(), this.pluginLoader = nt(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new K(), this.lastAutosavedContent = "", this.loadedPlugins = [], this.lastBeforeInputType = null, it(), !this.hasAttribute("data-initial-content")) {
3106
+ if (super(), this.pluginLoader = fi(), this.config = {}, this.isInitialized = !1, this.keyboardShortcutManager = new bn(), this.lastAutosavedContent = "", this.loadedPlugins = [], this.lastBeforeInputType = null, ui(), !this.hasAttribute("data-initial-content")) {
1552
3107
  const t = this.innerHTML.trim();
1553
3108
  t && this.setAttribute("data-initial-content", t);
1554
3109
  }
@@ -1614,13 +3169,13 @@ class g extends HTMLElement {
1614
3169
  * Wait for the global plugin loader to be available
1615
3170
  */
1616
3171
  async waitForPluginLoader() {
1617
- if (g.__globalPluginLoader) {
1618
- this.pluginLoader = g.__globalPluginLoader;
3172
+ if (K.__globalPluginLoader) {
3173
+ this.pluginLoader = K.__globalPluginLoader;
1619
3174
  return;
1620
3175
  }
1621
3176
  return new Promise((t) => {
1622
3177
  const e = () => {
1623
- g.__globalPluginLoader ? (this.pluginLoader = g.__globalPluginLoader, t()) : setTimeout(e, 0);
3178
+ K.__globalPluginLoader ? (this.pluginLoader = K.__globalPluginLoader, t()) : setTimeout(e, 0);
1624
3179
  };
1625
3180
  e();
1626
3181
  });
@@ -1649,18 +3204,21 @@ class g extends HTMLElement {
1649
3204
  async initialize() {
1650
3205
  var o;
1651
3206
  if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
1652
- this.setAttribute("data-editora-editor", "true"), C.add(this), m || (m = this), ot(), 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}`);
3207
+ this.setAttribute("data-editora-editor", "true"), ke.add(this), Q || (Q = this), di(), 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}`);
1653
3208
  const t = await this.loadPlugins();
1654
- this.loadedPlugins = t, t.forEach((n) => {
1655
- if (n.init && typeof n.init == "function")
3209
+ if (this.loadedPlugins = t, t.forEach((i) => {
3210
+ if (i.init && typeof i.init == "function")
1656
3211
  try {
1657
- n.init({ editorElement: this });
1658
- } catch (i) {
1659
- console.error(`[RichTextEditor] Error initializing plugin ${n.name}:`, i);
3212
+ i.init({ editorElement: this });
3213
+ } catch (r) {
3214
+ console.error(`[RichTextEditor] Error initializing plugin ${i.name}:`, r);
1660
3215
  }
1661
- });
3216
+ }), !this.hasAttribute("data-initial-content") && !this.contentElement) {
3217
+ const i = this.innerHTML.trim();
3218
+ i && this.setAttribute("data-initial-content", i);
3219
+ }
1662
3220
  const e = (o = this.restoreAutosavedContent()) != null ? o : this.getAttribute("data-initial-content") || "";
1663
- this.engine = new z({
3221
+ this.engine = new ln({
1664
3222
  content: e,
1665
3223
  plugins: t,
1666
3224
  readonly: this.config.readonly
@@ -1683,32 +3241,32 @@ class g extends HTMLElement {
1683
3241
  */
1684
3242
  async loadPlugins() {
1685
3243
  this.pluginLoader || await this.waitForPluginLoader();
1686
- const t = [], e = this.config.plugins && (typeof this.config.plugins == "string" && this.config.plugins.length > 0 || Array.isArray(this.config.plugins) && this.config.plugins.length > 0), n = this.getAccessibilityConfig().checker === !0;
3244
+ const t = [], e = this.config.plugins && (typeof this.config.plugins == "string" && this.config.plugins.length > 0 || Array.isArray(this.config.plugins) && this.config.plugins.length > 0), i = this.getAccessibilityConfig().checker === !0;
1687
3245
  if (e) {
1688
3246
  if (typeof this.config.plugins == "string") {
1689
- const i = this.config.plugins.split(/\s+/).filter(Boolean);
1690
- n && !i.includes("a11yChecker") && i.push("a11yChecker");
1691
- for (const r of i) {
1692
- const s = await this.pluginLoader.load(r, this.getPluginLoadConfig(r));
1693
- s && t.push(s);
3247
+ const r = this.config.plugins.split(/\s+/).filter(Boolean);
3248
+ i && !r.includes("a11yChecker") && r.push("a11yChecker");
3249
+ for (const l of r) {
3250
+ const c = await this.pluginLoader.load(l, this.getPluginLoadConfig(l));
3251
+ c && t.push(c);
1694
3252
  }
1695
3253
  } else if (Array.isArray(this.config.plugins)) {
1696
- for (const i of this.config.plugins)
1697
- if (typeof i == "string") {
1698
- const r = await this.pluginLoader.load(i, this.getPluginLoadConfig(i));
1699
- r && t.push(r);
3254
+ for (const r of this.config.plugins)
3255
+ if (typeof r == "string") {
3256
+ const l = await this.pluginLoader.load(r, this.getPluginLoadConfig(r));
3257
+ l && t.push(l);
1700
3258
  } else
1701
- t.push(i);
1702
- if (n && !t.some((i) => (i == null ? void 0 : i.name) === "a11yChecker")) {
1703
- const i = await this.pluginLoader.load("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
1704
- i && t.push(i);
3259
+ t.push(r);
3260
+ if (i && !t.some((r) => (r == null ? void 0 : r.name) === "a11yChecker")) {
3261
+ const r = await this.pluginLoader.load("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
3262
+ r && t.push(r);
1705
3263
  }
1706
3264
  }
1707
3265
  } else {
1708
- const i = this.pluginLoader.getRegisteredPluginNames();
1709
- for (const r of i) {
1710
- const s = await this.pluginLoader.load(r, this.getPluginLoadConfig(r));
1711
- s && t.push(s);
3266
+ const r = this.pluginLoader.getRegisteredPluginNames();
3267
+ for (const l of r) {
3268
+ const c = await this.pluginLoader.load(l, this.getPluginLoadConfig(l));
3269
+ c && t.push(c);
1712
3270
  }
1713
3271
  }
1714
3272
  return t;
@@ -1827,30 +3385,30 @@ class g extends HTMLElement {
1827
3385
  this.contentElement.spellcheck = e, this.contentElement.setAttribute("spellcheck", e ? "true" : "false");
1828
3386
  }
1829
3387
  executeCommand(t, ...e) {
1830
- var i;
3388
+ var r;
1831
3389
  typeof window != "undefined" && (window.__editoraCommandEditorRoot = this);
1832
3390
  const o = {
1833
3391
  editorElement: this,
1834
3392
  contentElement: this.contentElement,
1835
3393
  toolbarElement: this.toolbarElement
1836
- }, n = this.loadedPlugins.find((r) => r.commands && r.commands[t]);
1837
- if (n && n.commands) {
1838
- const r = n.commands[t];
1839
- if (typeof r == "function")
3394
+ }, i = this.loadedPlugins.find((l) => l.commands && l.commands[t]);
3395
+ if (i && i.commands) {
3396
+ const l = i.commands[t];
3397
+ if (typeof l == "function")
1840
3398
  try {
1841
- return t === "toggleFullscreen" ? r(this, o) : r(...e, o), !0;
1842
- } catch (s) {
1843
- return console.error(`[RichTextEditor] Error executing native command ${t}:`, s), !1;
3399
+ return t === "toggleFullscreen" ? l(this, o) : l(...e, o), !0;
3400
+ } catch (c) {
3401
+ return console.error(`[RichTextEditor] Error executing native command ${t}:`, c), !1;
1844
3402
  }
1845
3403
  }
1846
- return ((i = this.engine) == null ? void 0 : i.execCommand(t, ...e)) || !1;
3404
+ return ((r = this.engine) == null ? void 0 : r.execCommand(t, ...e)) || !1;
1847
3405
  }
1848
3406
  getPluginLoadConfig(t) {
1849
3407
  const e = this.config.pluginConfig;
1850
3408
  if (e && typeof e == "object") {
1851
- const i = e[t];
1852
- if (i && typeof i == "object")
1853
- return i;
3409
+ const r = e[t];
3410
+ if (r && typeof r == "object")
3411
+ return r;
1854
3412
  }
1855
3413
  const o = {
1856
3414
  spellCheck: ["spellcheck", "spellCheck"],
@@ -1869,15 +3427,15 @@ class g extends HTMLElement {
1869
3427
  "slash-commands": ["slashcommands", "slash-commands", "slashCommands"],
1870
3428
  formatPainter: ["formatpainter", "format-painter", "formatPainter"],
1871
3429
  "format-painter": ["formatpainter", "format-painter", "formatPainter"]
1872
- }, n = [
3430
+ }, i = [
1873
3431
  t,
1874
3432
  t.toLowerCase(),
1875
3433
  ...o[t] || []
1876
3434
  ];
1877
- for (const i of n) {
1878
- const r = this.config[i];
1879
- if (r && typeof r == "object" && !Array.isArray(r))
1880
- return r;
3435
+ for (const r of i) {
3436
+ const l = this.config[r];
3437
+ if (l && typeof l == "object" && !Array.isArray(l))
3438
+ return l;
1881
3439
  }
1882
3440
  }
1883
3441
  getContentSanitizeConfig() {
@@ -1899,10 +3457,10 @@ class g extends HTMLElement {
1899
3457
  provider: "localStorage"
1900
3458
  };
1901
3459
  if (t && typeof t == "object") {
1902
- const n = Number((o = (e = t.intervalMs) != null ? e : t.interval) != null ? o : 3e4);
3460
+ const i = Number((o = (e = t.intervalMs) != null ? e : t.interval) != null ? o : 3e4);
1903
3461
  return {
1904
3462
  enabled: !!t.enabled,
1905
- intervalMs: Number.isFinite(n) && n > 0 ? n : 3e4,
3463
+ intervalMs: Number.isFinite(i) && i > 0 ? i : 3e4,
1906
3464
  storageKey: String(t.storageKey || "rte-autosave"),
1907
3465
  provider: t.provider || "localStorage",
1908
3466
  apiUrl: t.apiUrl
@@ -1964,12 +3522,12 @@ class g extends HTMLElement {
1964
3522
  if (e && e.rangeCount > 0) {
1965
3523
  const o = e.getRangeAt(0);
1966
3524
  o.deleteContents();
1967
- const n = document.createElement("div");
1968
- n.innerHTML = t;
1969
- const i = document.createDocumentFragment();
1970
- for (; n.firstChild; )
1971
- i.appendChild(n.firstChild);
1972
- o.insertNode(i), o.collapse(!1), e.removeAllRanges(), e.addRange(o);
3525
+ const i = document.createElement("div");
3526
+ i.innerHTML = t;
3527
+ const r = document.createDocumentFragment();
3528
+ for (; i.firstChild; )
3529
+ r.appendChild(i.firstChild);
3530
+ o.insertNode(r), o.collapse(!1), e.removeAllRanges(), e.addRange(o);
1973
3531
  } else
1974
3532
  this.contentElement.focus(), document.execCommand("insertHTML", !1, t);
1975
3533
  }
@@ -1977,8 +3535,8 @@ class g extends HTMLElement {
1977
3535
  * Create UI elements
1978
3536
  */
1979
3537
  createUI(t, e) {
1980
- const o = this.querySelector('[slot="toolbar"]'), n = this.querySelector('[slot="statusbar"]');
1981
- this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new R(
3538
+ const o = this.querySelector('[slot="toolbar"]'), i = this.querySelector('[slot="statusbar"]');
3539
+ this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new cn(
1982
3540
  {
1983
3541
  items: this.resolveToolbarItems(),
1984
3542
  sticky: this.isToolbarStickyEnabled(),
@@ -1987,37 +3545,37 @@ class g extends HTMLElement {
1987
3545
  t,
1988
3546
  this.pluginLoader
1989
3547
  // Pass plugin loader to get all registered plugins
1990
- ), this.toolbar.setCommandHandler((i, r) => {
1991
- var s;
3548
+ ), this.toolbar.setCommandHandler((r, l) => {
3549
+ var c;
1992
3550
  if (this.contentElement) {
1993
3551
  this.contentElement.focus();
1994
- const l = window.getSelection();
1995
- if (!l || l.rangeCount === 0 || !this.contentElement.contains(l.anchorNode)) {
1996
- const c = document.createRange(), d = this.contentElement.lastChild || this.contentElement;
1997
- d.nodeType === Node.TEXT_NODE ? c.setStart(d, ((s = d.textContent) == null ? void 0 : s.length) || 0) : d.nodeType === Node.ELEMENT_NODE ? (c.selectNodeContents(d), c.collapse(!1)) : c.setStart(this.contentElement, 0), c.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(c);
3552
+ const p = window.getSelection();
3553
+ if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.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), p == null || p.removeAllRanges(), p == null || p.addRange(m);
1998
3556
  }
1999
3557
  }
2000
- return this.executeCommand(i, r);
3558
+ return this.executeCommand(r, l);
2001
3559
  }), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
2002
3560
  try {
2003
3561
  document.execCommand("defaultParagraphSeparator", !1, "p");
2004
- } catch (i) {
2005
- console.warn("defaultParagraphSeparator not supported:", i);
3562
+ } catch (r) {
3563
+ console.warn("defaultParagraphSeparator not supported:", r);
2006
3564
  }
2007
3565
  if (e) {
2008
- const i = document.createElement("div");
2009
- i.innerHTML = e.trim(), !Array.from(i.childNodes).some((s) => {
2010
- if (s.nodeType === Node.ELEMENT_NODE) {
2011
- const l = s.tagName;
2012
- return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(l);
3566
+ const r = document.createElement("div");
3567
+ r.innerHTML = e.trim(), !Array.from(r.childNodes).some((c) => {
3568
+ if (c.nodeType === Node.ELEMENT_NODE) {
3569
+ const p = c.tagName;
3570
+ return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(p);
2013
3571
  }
2014
3572
  return !1;
2015
3573
  }) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
2016
3574
  } else
2017
3575
  this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
2018
- this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new H({ enabled: !0 }), this.floatingToolbar.create(this)), n ? this.appendChild(n) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new j({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
2019
- var i;
2020
- return (i = this.contentElement) == null ? void 0 : i.focus();
3576
+ this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new dn({ enabled: !0 }), this.floatingToolbar.create(this)), i ? this.appendChild(i) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new un({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.config.autofocus && setTimeout(() => {
3577
+ var r;
3578
+ return (r = this.contentElement) == null ? void 0 : r.focus();
2021
3579
  }, 0);
2022
3580
  }
2023
3581
  /**
@@ -2028,69 +3586,70 @@ class g extends HTMLElement {
2028
3586
  const t = this.keyboardShortcutManager;
2029
3587
  this.contentElement.addEventListener("beforeinput", (o) => {
2030
3588
  this.lastBeforeInputType = o.inputType || null;
2031
- }), this.contentElement.addEventListener("input", () => {
3589
+ }), this.contentElement.addEventListener("input", (o) => {
3590
+ var _;
2032
3591
  if (!this.contentElement) return;
2033
- let o = this.contentElement.innerHTML;
2034
- const n = this.getPerformanceConfig(), i = this.getContentSanitizeConfig(), r = this.getSecurityConfig(), s = this.lastBeforeInputType;
2035
- if (this.lastBeforeInputType = null, r.sanitizeOnInput !== !1 && i.sanitize !== !1 && !s) {
2036
- const d = Y(o, i, r);
2037
- if (d !== o) {
2038
- const h = window.getSelection(), p = h && h.rangeCount > 0 ? h.getRangeAt(0) : null;
2039
- if (this.contentElement.innerHTML = d, p && h)
3592
+ let i = this.contentElement.innerHTML;
3593
+ const r = (_ = o == null ? void 0 : o.detail) == null ? void 0 : _.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = this.lastBeforeInputType;
3594
+ if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
3595
+ const T = ii(i, c, p, r);
3596
+ if (T !== i) {
3597
+ const v = window.getSelection(), Y = v && v.rangeCount > 0 ? v.getRangeAt(0) : null;
3598
+ if (this.contentElement.innerHTML = T, Y && v)
2040
3599
  try {
2041
- h.removeAllRanges(), h.addRange(p);
2042
- } catch (u) {
3600
+ v.removeAllRanges(), v.addRange(Y);
3601
+ } catch (D) {
2043
3602
  }
2044
- o = d;
3603
+ i = T;
2045
3604
  }
2046
3605
  }
2047
3606
  this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
2048
- const c = () => {
3607
+ const w = () => {
2049
3608
  this.dispatchEvent(new CustomEvent("content-change", {
2050
- detail: { html: o },
3609
+ detail: { html: i },
2051
3610
  bubbles: !0
2052
3611
  }));
2053
3612
  };
2054
- n.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(c, n.debounceInputMs) : c(), this.updateStatusBar();
3613
+ l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(w, l.debounceInputMs) : w(), this.updateStatusBar();
2055
3614
  }), this.contentElement.addEventListener("contextmenu", (o) => {
2056
- const n = this.config.contextMenu;
2057
- (n === !1 || typeof n == "object" && n !== null && n.enabled === !1) && o.preventDefault();
3615
+ const i = this.config.contextMenu;
3616
+ (i === !1 || typeof i == "object" && i !== null && i.enabled === !1) && o.preventDefault();
2058
3617
  }), this.contentElement.addEventListener("paste", (o) => {
2059
- var d, h;
3618
+ var b, w;
2060
3619
  if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
2061
3620
  return;
2062
3621
  o.preventDefault();
2063
- const n = this.config.paste || {};
2064
- let i = ((d = o.clipboardData) == null ? void 0 : d.getData("text/html")) || "";
2065
- const r = ((h = o.clipboardData) == null ? void 0 : h.getData("text/plain")) || "", s = this.getContentSanitizeConfig(), l = this.getSecurityConfig(), c = !!i && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(i);
2066
- if ((n.clean || !n.keepFormatting) && r) {
2067
- document.execCommand("insertText", !1, r);
3622
+ const i = this.config.paste || {};
3623
+ let r = ((b = o.clipboardData) == null ? void 0 : b.getData("text/html")) || "";
3624
+ const l = ((w = o.clipboardData) == null ? void 0 : w.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
3625
+ if ((i.clean || !i.keepFormatting) && l) {
3626
+ document.execCommand("insertText", !1, l);
2068
3627
  return;
2069
3628
  }
2070
- if (n.convertWord === !1 && c && r) {
2071
- document.execCommand("insertText", !1, r);
3629
+ if (i.convertWord === !1 && m && l) {
3630
+ document.execCommand("insertText", !1, l);
2072
3631
  return;
2073
3632
  }
2074
- if (i) {
2075
- l.sanitizeOnPaste !== !1 && s.sanitize !== !1 && (i = X(i, s, l)), this.insertHTMLAtSelection(i);
3633
+ if (r) {
3634
+ p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ni(r, c, p)), this.insertHTMLAtSelection(r);
2076
3635
  return;
2077
3636
  }
2078
- r && document.execCommand("insertText", !1, r);
3637
+ l && document.execCommand("insertText", !1, l);
2079
3638
  }), this.contentElement.addEventListener("focus", () => {
2080
- m = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
3639
+ Q = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
2081
3640
  }), this.contentElement.addEventListener("blur", () => {
2082
3641
  this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.dispatchEvent(new CustomEvent("content-change", {
2083
3642
  detail: { html: this.contentElement.innerHTML },
2084
3643
  bubbles: !0
2085
3644
  })), this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
2086
3645
  }), this.contentElement.addEventListener("keydown", (o) => {
2087
- this.getAccessibilityConfig().keyboardNavigation && t.handleKeyDown(o, (i, r) => {
2088
- this.executeCommand(i, r);
3646
+ this.getAccessibilityConfig().keyboardNavigation && t.handleKeyDown(o, (r, l) => {
3647
+ this.executeCommand(r, l);
2089
3648
  });
2090
3649
  });
2091
3650
  const e = () => {
2092
- const o = this.getSelectionRangeInEditor(), n = document.activeElement, i = !!n && !!this.contentElement && (n === this.contentElement || this.contentElement.contains(n));
2093
- this.getPerformanceConfig().viewportOnlyScan && !this.isEditorInViewport() && !i || !o && !i || (this.updateFloatingToolbar(), this.updateStatusBar());
3651
+ const o = this.getSelectionRangeInEditor(), i = document.activeElement, r = !!i && !!this.contentElement && (i === this.contentElement || this.contentElement.contains(i));
3652
+ this.getPerformanceConfig().viewportOnlyScan && !this.isEditorInViewport() && !r || !o && !r || (this.updateFloatingToolbar(), this.updateStatusBar());
2094
3653
  };
2095
3654
  this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
2096
3655
  }
@@ -2112,7 +3671,7 @@ class g extends HTMLElement {
2112
3671
  }
2113
3672
  }
2114
3673
  getSelectionAnchorRect(t, e) {
2115
- const o = Array.from(e.getClientRects()).filter((i) => i.width > 0 || i.height > 0);
3674
+ const o = Array.from(e.getClientRects()).filter((r) => r.width > 0 || r.height > 0);
2116
3675
  return o.length === 0 ? e.getBoundingClientRect() : this.isSelectionBackward(t) ? o[0] : o[o.length - 1];
2117
3676
  }
2118
3677
  /**
@@ -2120,7 +3679,7 @@ class g extends HTMLElement {
2120
3679
  */
2121
3680
  updateFloatingToolbar() {
2122
3681
  if (!this.floatingToolbar || !this.contentElement) return;
2123
- if (this.config.readonly || this.contentElement.contentEditable === "false" || this.contentElement.getAttribute("data-readonly") === "true" || this.getAttribute("readonly") === "true" || this.getAttribute("data-readonly") === "true") {
3682
+ if (this.config.readonly || this.contentElement.contentEditable === "false" || this.contentElement.getAttribute("data-readonly") === "true" || this.isReadonlyAttribute(this.getAttribute("readonly")) || this.getAttribute("data-readonly") === "true") {
2124
3683
  this.floatingToolbar.hide();
2125
3684
  return;
2126
3685
  }
@@ -2129,26 +3688,26 @@ class g extends HTMLElement {
2129
3688
  this.floatingToolbar.hide();
2130
3689
  return;
2131
3690
  }
2132
- const n = this.getSelectionRangeInEditor();
2133
- if (!n) {
3691
+ const i = this.getSelectionRangeInEditor();
3692
+ if (!i) {
2134
3693
  this.floatingToolbar.hide();
2135
3694
  return;
2136
3695
  }
2137
- if (n.collapsed) {
3696
+ if (i.collapsed) {
2138
3697
  this.floatingToolbar.hide();
2139
3698
  return;
2140
3699
  }
2141
- const i = window.getSelection();
2142
- if (!i) {
3700
+ const r = window.getSelection();
3701
+ if (!r) {
2143
3702
  this.floatingToolbar.hide();
2144
3703
  return;
2145
3704
  }
2146
- const r = this.getSelectionAnchorRect(i, n);
2147
- if (!r) {
3705
+ const l = this.getSelectionAnchorRect(r, i);
3706
+ if (!l) {
2148
3707
  this.floatingToolbar.hide();
2149
3708
  return;
2150
3709
  }
2151
- this.floatingToolbar.show(r.left, r.top - 40);
3710
+ this.floatingToolbar.show(l.left, l.top - 40);
2152
3711
  }
2153
3712
  /**
2154
3713
  * Update status bar with selection and cursor information
@@ -2161,24 +3720,31 @@ class g extends HTMLElement {
2161
3720
  const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
2162
3721
  if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
2163
3722
  return;
2164
- const o = this.contentElement.textContent || "", { words: n, chars: i } = W(o), r = _(this.contentElement);
2165
- let s, l;
2166
- const c = this.getSelectionRangeInEditor();
2167
- c && (s = F(this.contentElement, c), c.collapsed || (l = U(c, s), s = void 0)), this.statusBar.update({
2168
- wordCount: n,
2169
- charCount: i,
2170
- lineCount: r,
2171
- cursorPosition: s,
2172
- selectionInfo: l
3723
+ const o = this.contentElement.textContent || "", { words: i, chars: r } = mn(o), l = hn(this.contentElement);
3724
+ let c, p;
3725
+ const m = this.getSelectionRangeInEditor();
3726
+ m && (c = fn(this.contentElement, m), m.collapsed || (p = gn(m, c), c = void 0)), this.statusBar.update({
3727
+ wordCount: i,
3728
+ charCount: r,
3729
+ lineCount: l,
3730
+ cursorPosition: c,
3731
+ selectionInfo: p
2173
3732
  });
2174
3733
  }
3734
+ /**
3735
+ * `<editora-editor readonly>` and `readonly="true"` both lock the editor; only
3736
+ * removing the attribute or `readonly="false"` unlocks it.
3737
+ */
3738
+ isReadonlyAttribute(t) {
3739
+ return t !== null && t !== "false";
3740
+ }
2175
3741
  /**
2176
3742
  * Handle attribute changes
2177
3743
  */
2178
3744
  handleAttributeChange(t, e) {
2179
3745
  switch (t) {
2180
3746
  case "readonly":
2181
- this.contentElement && (this.contentElement.contentEditable = e === "true" ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(e === "true");
3747
+ this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e));
2182
3748
  break;
2183
3749
  case "theme":
2184
3750
  this.classList.forEach((o) => {
@@ -2249,7 +3815,7 @@ class g extends HTMLElement {
2249
3815
  const o = this.attributes[e];
2250
3816
  t[o.name] = o.value;
2251
3817
  }
2252
- return x.resolve({
3818
+ return Te.resolve({
2253
3819
  jsConfig: this.jsConfig,
2254
3820
  attributes: t
2255
3821
  });
@@ -2289,8 +3855,8 @@ class g extends HTMLElement {
2289
3855
  * Destroy the editor
2290
3856
  */
2291
3857
  destroy() {
2292
- var t, e, o, n;
2293
- this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.persistAutosave(this.contentElement.innerHTML || ""), 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(), (n = this.statusBar) == null || n.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, C.delete(this), m === this && (m = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
3858
+ var t, e, o, i;
3859
+ this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && this.persistAutosave(this.contentElement.innerHTML || ""), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (i = this.statusBar) == null || i.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.isInitialized = !1, ke.delete(this), Q === this && (Q = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
2294
3860
  }
2295
3861
  // Public API methods
2296
3862
  getContent() {
@@ -2312,37 +3878,37 @@ class g extends HTMLElement {
2312
3878
  (t = this.contentElement) == null || t.blur();
2313
3879
  }
2314
3880
  }
2315
- const E = new I();
2316
- g.__globalPluginLoader = E;
2317
- const rt = {
3881
+ const xe = new xo();
3882
+ K.__globalPluginLoader = xe;
3883
+ const pi = {
2318
3884
  // Core editing plugins (always loaded)
2319
3885
  bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((a) => a.BoldPlugin()),
2320
3886
  italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((a) => a.ItalicPlugin()),
2321
3887
  underline: () => import("./UnderlinePlugin.native-DZzg23rv.mjs").then((a) => a.UnderlinePlugin()),
2322
3888
  strikethrough: () => import("./StrikethroughPlugin.native-V0TL4F48.mjs").then((a) => a.StrikethroughPlugin()),
2323
- clearFormatting: () => import("./ClearFormattingPlugin.native-B6ro3a1h.mjs").then((a) => a.ClearFormattingPlugin()),
3889
+ clearFormatting: () => import("./ClearFormattingPlugin.native-Pp0O-SBf.mjs").then((a) => a.ClearFormattingPlugin()),
2324
3890
  heading: () => import("./HeadingPlugin.native-DZdvubrQ.mjs").then((a) => a.HeadingPlugin()),
2325
3891
  blockquote: () => import("./BlockquotePlugin.native-57_Xcjl1.mjs").then((a) => a.BlockquotePlugin()),
2326
- code: () => import("./CodePlugin.native-veDC_kx5.mjs").then((a) => a.CodePlugin()),
2327
- list: () => import("./ListPlugin.native-V7EZC1lM.mjs").then((a) => a.ListPlugin()),
2328
- history: () => import("./HistoryPlugin.native-D2wl32jV.mjs").then((a) => a.HistoryPlugin())
3892
+ code: () => import("./CodePlugin.native-hNgfXlfS.mjs").then((a) => a.CodePlugin()),
3893
+ list: () => import("./ListPlugin.native-Bt0LANbO.mjs").then((a) => a.ListPlugin()),
3894
+ history: () => import("./HistoryPlugin.native-DPvhks6h.mjs").then((a) => a.HistoryPlugin())
2329
3895
  };
2330
- async function at() {
2331
- return Object.entries(rt).forEach(([a, t]) => {
2332
- E.register(a, t);
2333
- }), E;
3896
+ async function hi() {
3897
+ return Object.entries(pi).forEach(([a, t]) => {
3898
+ xe.register(a, t);
3899
+ }), xe;
2334
3900
  }
2335
- typeof window != "undefined" && at().then((a) => {
2336
- g.__globalPluginLoader = a, customElements.get("editora-editor") || customElements.define("editora-editor", g);
3901
+ typeof window != "undefined" && hi().then((a) => {
3902
+ K.__globalPluginLoader = a, customElements.get("editora-editor") || customElements.define("editora-editor", K);
2337
3903
  const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
2338
3904
  t.forEach((o) => {
2339
- const n = o.innerHTML.trim();
2340
- n && (e.push(n), o.setAttribute("data-initial-content", n), o.innerHTML = "");
2341
- }), t.forEach((o, n) => {
2342
- o instanceof g && !o.isInitialized && e[n] && o.setAttribute("content", e[n]);
3905
+ const i = o.innerHTML.trim();
3906
+ i && (e.push(i), o.setAttribute("data-initial-content", i), o.innerHTML = "");
3907
+ }), t.forEach((o, i) => {
3908
+ o instanceof K && !o.isInitialized && e[i] && o.setAttribute("content", e[i]);
2343
3909
  });
2344
3910
  });
2345
3911
  export {
2346
- at as initWebComponent
3912
+ hi as initWebComponent
2347
3913
  };
2348
3914
  //# sourceMappingURL=webcomponent-core.js.map