@editora/core 1.0.7 → 1.0.9

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 (87) hide show
  1. package/README.md +5 -0
  2. package/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-58d12bed.mjs} +23 -12
  3. package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-289a112a.mjs} +112 -102
  4. package/dist/ApprovalWorkflowPlugin.native-449ce66c.mjs +1115 -0
  5. package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-8aceb5cc.mjs} +16 -9
  6. package/dist/{BlockquotePlugin.native-JFmOLsxN.mjs → BlockquotePlugin.native-3541c714.mjs} +3 -2
  7. package/dist/BlocksLibraryPlugin.native-1cc51e63.mjs +1386 -0
  8. package/dist/{BoldPlugin.native-BAzzoqU5.mjs → BoldPlugin.native-f9d7f8e4.mjs} +1 -1
  9. package/dist/{CapitalizationPlugin.native-DOMsh5R7.mjs → CapitalizationPlugin.native-42c135dc.mjs} +3 -2
  10. package/dist/{ChecklistPlugin.native-nuSSEFNI.mjs → ChecklistPlugin.native-3b397ee9.mjs} +43 -22
  11. package/dist/CitationsPlugin.native-169fb1e8.mjs +1532 -0
  12. package/dist/{ClearFormattingPlugin.native-Bq_XcTh2.mjs → ClearFormattingPlugin.native-77baa514.mjs} +11 -6
  13. package/dist/{CodePlugin.native-DlpTPdkd.mjs → CodePlugin.native-989cf0aa.mjs} +629 -580
  14. package/dist/{CodeSamplePlugin.native-CgGoH-X4.mjs → CodeSamplePlugin.native-6cc0148e.mjs} +19 -10
  15. package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-03659874.mjs} +55 -28
  16. package/dist/ConditionalContentPlugin.native-4983143a.mjs +1424 -0
  17. package/dist/ContentRulesPlugin.native-63ed405b.mjs +1149 -0
  18. package/dist/DataBindingPlugin.native-427e9d75.mjs +956 -0
  19. package/dist/{DirectionPlugin.native-CDnbdNyl.mjs → DirectionPlugin.native-4e742f42.mjs} +19 -10
  20. package/dist/DocSchemaPlugin.native-8e41eda0.mjs +1382 -0
  21. package/dist/{DocumentManagerPlugin.native-C2cs_1w4.mjs → DocumentManagerPlugin.native-e69895ad.mjs} +4 -4
  22. package/dist/{EmbedIframePlugin.native-DKJx2OS7.mjs → EmbedIframePlugin.native-55209c87.mjs} +70 -70
  23. package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-65c5ac47.mjs} +11 -6
  24. package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-f9bc255a.mjs} +7 -4
  25. package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-f5647872.mjs} +19 -10
  26. package/dist/{FootnotePlugin.native-D730OGRm.mjs → FootnotePlugin.native-494657b3.mjs} +77 -39
  27. package/dist/{FullscreenPlugin.native-ChXyxeNw.mjs → FullscreenPlugin.native-87ce92e9.mjs} +1 -1
  28. package/dist/{HeadingPlugin.native-DrLYwQnQ.mjs → HeadingPlugin.native-e38c4a16.mjs} +1 -1
  29. package/dist/{HistoryPlugin.native-TDnVMsEO.mjs → HistoryPlugin.native-92ed4be4.mjs} +43 -22
  30. package/dist/{IndentPlugin.native-BHixp8sP.mjs → IndentPlugin.native-e4ee902b.mjs} +23 -12
  31. package/dist/{ItalicPlugin.native-CQjjDyUL.mjs → ItalicPlugin.native-7c95cfbc.mjs} +1 -1
  32. package/dist/{LineHeightPlugin.native-CM7iXdQj.mjs → LineHeightPlugin.native-5668f78c.mjs} +19 -10
  33. package/dist/{LinkPlugin.native-DYCIcdTm.mjs → LinkPlugin.native-6df29111.mjs} +9 -5
  34. package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-fe2e115a.mjs} +9 -5
  35. package/dist/{MathPlugin.native-f_mDp8VL.mjs → MathPlugin.native-735bbac2.mjs} +9 -5
  36. package/dist/{MediaManagerPlugin.native-BiXiK8FC.mjs → MediaManagerPlugin.native-3cf48a00.mjs} +219 -207
  37. package/dist/MentionPlugin.native-3b1e8c05.mjs +778 -0
  38. package/dist/{MergeTagPlugin.native-C3eOfEgw.mjs → MergeTagPlugin.native-31cf7d48.mjs} +51 -26
  39. package/dist/PIIRedactionPlugin.native-7ab10b9f.mjs +1449 -0
  40. package/dist/{PageBreakPlugin.native-CXdX5fAv.mjs → PageBreakPlugin.native-1794c5fb.mjs} +67 -52
  41. package/dist/{PreviewPlugin.native-DBvfpmIv.mjs → PreviewPlugin.native-f7b67cc0.mjs} +38 -33
  42. package/dist/{PrintPlugin.native-7qt5v7L5.mjs → PrintPlugin.native-f6a168c2.mjs} +5 -3
  43. package/dist/SlashCommandsPlugin.native-8d45e511.mjs +790 -0
  44. package/dist/SmartPastePlugin.native-a6c5efec.mjs +1447 -0
  45. package/dist/{SpecialCharactersPlugin.native-CZDato89.mjs → SpecialCharactersPlugin.native-7f06d4ba.mjs} +17 -9
  46. package/dist/{SpellCheckPlugin.native-BZB9AewP.mjs → SpellCheckPlugin.native-04e20834.mjs} +41 -21
  47. package/dist/{StrikethroughPlugin.native-0Be7j49s.mjs → StrikethroughPlugin.native-905e9501.mjs} +9 -5
  48. package/dist/{TablePlugin.native-DrHX-efe.mjs → TablePlugin.native-7d5458c1.mjs} +58 -30
  49. package/dist/{TemplatePlugin.native-CrpfKRJ8.mjs → TemplatePlugin.native-580f0f63.mjs} +32 -17
  50. package/dist/{TextAlignmentPlugin.native-sM_1s00t.mjs → TextAlignmentPlugin.native-9357b3ed.mjs} +11 -6
  51. package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-d53ed459.mjs} +26 -14
  52. package/dist/TrackChangesPlugin.native-e96da509.mjs +818 -0
  53. package/dist/TranslationWorkflowPlugin.native-4e711b1e.mjs +1797 -0
  54. package/dist/{UnderlinePlugin.native-QpIcK4L2.mjs → UnderlinePlugin.native-8080c998.mjs} +1 -1
  55. package/dist/VersionDiffPlugin.native-5bbeff85.mjs +801 -0
  56. package/dist/_commonjsHelpers-69d58be2.mjs +31 -0
  57. package/dist/{anchoredPopover-Bxds0VoB.mjs → anchoredPopover-5cca53ba.mjs} +1 -1
  58. package/dist/documentManager-8327fb6e.mjs +9166 -0
  59. package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +3 -2
  60. package/dist/editora.min.js +14 -13
  61. package/dist/editora.umd.js +14 -13
  62. package/dist/{html2canvas.esm-AYkPY5LS.mjs → html2canvas.esm-c51cb3b9.mjs} +978 -894
  63. package/dist/index-072ef022.js +11 -0
  64. package/dist/index-49d31221.mjs +16860 -0
  65. package/dist/{index-yzU4NdPT.mjs → index-7da30697.mjs} +490 -358
  66. package/dist/index.cjs.js +1 -1
  67. package/dist/index.es-b47a189f.mjs +5782 -0
  68. package/dist/index.esm.js +12 -7
  69. package/dist/{jspdf.es.min-BJGtOnRT.mjs → jspdf.es.min-780c82db.mjs} +4808 -3784
  70. package/dist/plugin-loader.js +77 -40
  71. package/dist/{purify.es-CKpwg8Tk.mjs → purify.es-3bdbcfc5.mjs} +20 -10
  72. package/dist/style.css +1 -0
  73. package/dist/webcomponent-core.js +546 -414
  74. package/dist/webcomponent-core.min.css +1 -1
  75. package/dist/webcomponent-core.min.js +40 -39
  76. package/dist/webcomponent.cjs.js +1 -1
  77. package/dist/webcomponent.esm.js +1 -1
  78. package/dist/webcomponent.js +484 -315
  79. package/dist/webcomponent.min.css +1 -1
  80. package/dist/webcomponent.min.js +6035 -558
  81. package/package.json +11 -5
  82. package/dist/_commonjsHelpers-DOllISpa.mjs +0 -32
  83. package/dist/core.css +0 -1
  84. package/dist/documentManager-vQ1VkbUY.mjs +0 -8418
  85. package/dist/index-BpE6GFbz.js +0 -10
  86. package/dist/index-BslAFzmv.mjs +0 -16544
  87. package/dist/index.es-BYD2KEo6.mjs +0 -6666
@@ -0,0 +1,1449 @@
1
+ const x = ".rte-content, .editora-content", ae = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", we = "__editoraCommandEditorRoot", Ee = "rte-pii-redaction-styles", u = "rte-pii-redaction-panel", k = "pii-redaction", v = "piiRedaction", $ = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', pe = typeof NodeFilter != "undefined" ? NodeFilter.SHOW_TEXT : 4, Oe = [
2
+ "email",
3
+ "phone",
4
+ "ssn",
5
+ "credit-card",
6
+ "ipv4",
7
+ "api-key",
8
+ "jwt"
9
+ ], ze = {
10
+ panelTitle: "PII Redaction",
11
+ panelAriaLabel: "PII redaction panel",
12
+ scanText: "Scan PII",
13
+ redactAllText: "Redact All",
14
+ redactText: "Redact",
15
+ locateText: "Locate",
16
+ realtimeOnText: "Realtime On",
17
+ realtimeOffText: "Realtime Off",
18
+ closeText: "Close",
19
+ noFindingsText: "No PII detected in the document.",
20
+ summaryPrefix: "Findings",
21
+ shortcutText: "Shortcuts: Ctrl/Cmd+Alt+Shift+I/U/M/Y",
22
+ readonlyRedactionText: "Editor is read-only. Reopen editable mode to redact.",
23
+ matchLabel: "Detected",
24
+ maskedLabel: "Masked",
25
+ excerptLabel: "Context"
26
+ }, Fe = {
27
+ email: {
28
+ label: "Email",
29
+ severity: "medium",
30
+ pattern: /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi
31
+ },
32
+ phone: {
33
+ label: "Phone",
34
+ severity: "medium",
35
+ pattern: /\b(?:\+?\d{1,3}[\s.-]?)?(?:\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4})\b/g
36
+ },
37
+ ssn: {
38
+ label: "SSN",
39
+ severity: "high",
40
+ pattern: /\b\d{3}-\d{2}-\d{4}\b/g
41
+ },
42
+ "credit-card": {
43
+ label: "Credit Card",
44
+ severity: "high",
45
+ pattern: /\b(?:\d[ -]*?){13,19}\b/g,
46
+ validator: (e) => We(e)
47
+ },
48
+ ipv4: {
49
+ label: "IPv4",
50
+ severity: "low",
51
+ pattern: /\b(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)\b/g
52
+ },
53
+ "api-key": {
54
+ label: "API Key",
55
+ severity: "high",
56
+ pattern: /\b(?:sk-[A-Za-z0-9]{20,}|AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z\-_]{35}|ghp_[A-Za-z0-9]{36}|xox[baprs]-[A-Za-z0-9-]{10,})\b/g
57
+ },
58
+ jwt: {
59
+ label: "JWT",
60
+ severity: "high",
61
+ pattern: /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g
62
+ }
63
+ }, f = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), de = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new Set(), j = /* @__PURE__ */ new Set();
64
+ let G = 0, He = 0, ve = 0, M = null, g = null, L = null, D = null, _ = null, R = null, N = null;
65
+ function b(e) {
66
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
67
+ }
68
+ function Be(e) {
69
+ return e.replace(/\u00A0/g, " ").replace(/\s+/g, " ").trim();
70
+ }
71
+ function Y(e) {
72
+ const t = e.flags.includes("g") ? e.flags : `${e.flags}g`;
73
+ return new RegExp(e.source, t);
74
+ }
75
+ function be(e) {
76
+ return new RegExp(e.source, e.flags);
77
+ }
78
+ function X(e, t, n) {
79
+ return Math.max(t, Math.min(n, e));
80
+ }
81
+ function Ke(e, t) {
82
+ return e === "high" || e === "medium" || e === "low" ? e : t;
83
+ }
84
+ function qe(e) {
85
+ const t = (e || "*").slice(0, 1) || "*";
86
+ return /[A-Za-z0-9._%+\-\s]/.test(t) ? "*" : t;
87
+ }
88
+ function $e(e) {
89
+ let t = 2166136261;
90
+ for (let n = 0; n < e.length; n += 1)
91
+ t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
92
+ return t >>> 0;
93
+ }
94
+ function We(e) {
95
+ const t = e.replace(/\D/g, "");
96
+ if (t.length < 13 || t.length > 19)
97
+ return !1;
98
+ let n = 0, i = !1;
99
+ for (let o = t.length - 1; o >= 0; o -= 1) {
100
+ let r = Number(t[o]);
101
+ i && (r *= 2, r > 9 && (r -= 9)), n += r, i = !i;
102
+ }
103
+ return n % 10 === 0;
104
+ }
105
+ function je(e, t) {
106
+ const n = Fe[e];
107
+ if (typeof t == "boolean")
108
+ return {
109
+ type: e,
110
+ label: n.label,
111
+ severity: n.severity,
112
+ enabled: t,
113
+ pattern: Y(n.pattern),
114
+ validator: n.validator
115
+ };
116
+ if (!t)
117
+ return {
118
+ type: e,
119
+ label: n.label,
120
+ severity: n.severity,
121
+ enabled: !0,
122
+ pattern: Y(n.pattern),
123
+ validator: n.validator
124
+ };
125
+ const i = t.pattern instanceof RegExp ? Y(t.pattern) : Y(n.pattern);
126
+ return {
127
+ type: e,
128
+ label: n.label,
129
+ severity: Ke(t.severity, n.severity),
130
+ enabled: t.enabled !== !1,
131
+ pattern: i,
132
+ validator: n.validator
133
+ };
134
+ }
135
+ function ee(e = {}) {
136
+ var i, o, r, a;
137
+ const t = Oe.map((l) => {
138
+ var c;
139
+ return je(l, (c = e.detectors) == null ? void 0 : c[l]);
140
+ }), n = t.map((l) => `${l.type}:${l.enabled ? "1" : "0"}:${l.severity}:${l.pattern.source}:${l.pattern.flags}`).join("|");
141
+ return {
142
+ enableRealtime: e.enableRealtime !== !1,
143
+ debounceMs: X(Number((i = e.debounceMs) != null ? i : 220), 60, 3e3),
144
+ maxFindings: X(Number((o = e.maxFindings) != null ? o : 140), 1, 500),
145
+ maskChar: qe(e.maskChar),
146
+ revealStart: X(Number((r = e.revealStart) != null ? r : 2), 0, 12),
147
+ revealEnd: X(Number((a = e.revealEnd) != null ? a : 2), 0, 12),
148
+ redactionMode: e.redactionMode === "mask" ? "mask" : "token",
149
+ redactionToken: (e.redactionToken || "REDACTED").trim() || "REDACTED",
150
+ skipInCodeBlocks: e.skipInCodeBlocks !== !1,
151
+ labels: {
152
+ ...ze,
153
+ ...e.labels || {}
154
+ },
155
+ normalizeText: e.normalizeText || Be,
156
+ detectors: t,
157
+ detectorSignature: n
158
+ };
159
+ }
160
+ function ce(e) {
161
+ const t = {};
162
+ return e.detectors.forEach((n) => {
163
+ t[n.type] = {
164
+ enabled: n.enabled,
165
+ severity: n.severity,
166
+ pattern: n.pattern
167
+ };
168
+ }), {
169
+ enableRealtime: e.enableRealtime,
170
+ debounceMs: e.debounceMs,
171
+ maxFindings: e.maxFindings,
172
+ maskChar: e.maskChar,
173
+ revealStart: e.revealStart,
174
+ revealEnd: e.revealEnd,
175
+ redactionMode: e.redactionMode,
176
+ redactionToken: e.redactionToken,
177
+ skipInCodeBlocks: e.skipInCodeBlocks,
178
+ labels: { ...e.labels },
179
+ normalizeText: e.normalizeText,
180
+ detectors: t
181
+ };
182
+ }
183
+ function ge(e) {
184
+ return e.closest(ae) || e;
185
+ }
186
+ function Ze(e) {
187
+ const t = e.closest("[data-editora-editor]");
188
+ if (t && z(t) === e)
189
+ return t;
190
+ let n = e;
191
+ for (; n; ) {
192
+ if (n.matches(ae) && (n === e || z(n) === e))
193
+ return n;
194
+ n = n.parentElement;
195
+ }
196
+ return ge(e);
197
+ }
198
+ function z(e) {
199
+ if (!e)
200
+ return null;
201
+ if (e.matches(x))
202
+ return e;
203
+ const t = e.querySelector(x);
204
+ return t instanceof HTMLElement ? t : null;
205
+ }
206
+ function Ve() {
207
+ if (typeof window == "undefined")
208
+ return null;
209
+ const e = window[we];
210
+ if (!(e instanceof HTMLElement))
211
+ return null;
212
+ window[we] = null;
213
+ const t = z(e);
214
+ if (t)
215
+ return t;
216
+ const n = e.closest(ae);
217
+ if (n) {
218
+ const o = z(n);
219
+ if (o)
220
+ return o;
221
+ }
222
+ const i = e.closest(x);
223
+ return i instanceof HTMLElement ? i : null;
224
+ }
225
+ function J(e) {
226
+ return e ? (e.getAttribute("data-theme") || e.getAttribute("theme") || "").toLowerCase() === "dark" ? !0 : e.classList.contains("dark") || e.classList.contains("editora-theme-dark") || e.classList.contains("rte-theme-dark") : !1;
227
+ }
228
+ function Ue(e) {
229
+ const t = ge(e);
230
+ if (J(t))
231
+ return !0;
232
+ const n = t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
233
+ return J(n) ? !0 : J(document.documentElement) || J(document.body);
234
+ }
235
+ function ne(e, t) {
236
+ e.classList.remove("rte-pii-redaction-theme-dark"), Ue(t) && e.classList.add("rte-pii-redaction-theme-dark");
237
+ }
238
+ function re(e) {
239
+ return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
240
+ }
241
+ function me(e) {
242
+ const t = te.get(e);
243
+ typeof t == "number" && (window.clearTimeout(t), j.delete(t), te.delete(e));
244
+ }
245
+ function U(e) {
246
+ return e.getAttribute("contenteditable") === "false" || e.getAttribute("data-readonly") === "true";
247
+ }
248
+ function le(e = 0) {
249
+ return {
250
+ total: 0,
251
+ high: 0,
252
+ medium: 0,
253
+ low: 0,
254
+ redactedCount: e,
255
+ byType: {
256
+ email: 0,
257
+ phone: 0,
258
+ ssn: 0,
259
+ "credit-card": 0,
260
+ ipv4: 0,
261
+ "api-key": 0,
262
+ jwt: 0
263
+ }
264
+ };
265
+ }
266
+ function q() {
267
+ Array.from(W).forEach((t) => {
268
+ t.isConnected || Te(t);
269
+ });
270
+ }
271
+ function Ge(e) {
272
+ var t, n, i, o;
273
+ for (let r = 0; r < e.length; r += 1) {
274
+ const a = e[r];
275
+ if (!(a.type !== "childList" || a.removedNodes.length === 0))
276
+ for (let l = 0; l < a.removedNodes.length; l += 1) {
277
+ const c = a.removedNodes[l];
278
+ if (c.nodeType !== Node.ELEMENT_NODE)
279
+ continue;
280
+ const d = c;
281
+ if ((t = d.matches) != null && t.call(d, x) || (n = d.matches) != null && n.call(d, `.${u}`) || (i = d.querySelector) != null && i.call(d, x) || (o = d.querySelector) != null && o.call(d, `.${u}`))
282
+ return !0;
283
+ }
284
+ }
285
+ return !1;
286
+ }
287
+ function T(e, t = !0) {
288
+ if (q(), (e == null ? void 0 : e.contentElement) instanceof HTMLElement)
289
+ return e.contentElement;
290
+ if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
291
+ const r = e.editorElement, a = z(r);
292
+ if (a)
293
+ return a;
294
+ }
295
+ const n = Ve();
296
+ if (n)
297
+ return n;
298
+ const i = window.getSelection();
299
+ if (i && i.rangeCount > 0) {
300
+ const r = re(i.getRangeAt(0).startContainer), a = r == null ? void 0 : r.closest(x);
301
+ if (a)
302
+ return a;
303
+ }
304
+ const o = document.activeElement;
305
+ if (o) {
306
+ if (o.matches(x))
307
+ return o;
308
+ const r = o.closest(x);
309
+ if (r)
310
+ return r;
311
+ }
312
+ return g && g.isConnected ? g : (g && !g.isConnected && (g = null), t ? document.querySelector(x) : null);
313
+ }
314
+ function Te(e) {
315
+ var t;
316
+ me(e), (t = m.get(e)) == null || t.remove(), m.delete(e), V.delete(e), f.delete(e), I.delete(e), E.delete(e), S.delete(e), de.delete(e), Q.delete(e), W.delete(e), g === e && (g = null);
317
+ }
318
+ function C(e, t, n) {
319
+ const i = Ze(e);
320
+ Array.from(
321
+ i.querySelectorAll(
322
+ `.rte-toolbar-button[data-command="${t}"], .editora-toolbar-button[data-command="${t}"]`
323
+ )
324
+ ).forEach((r) => {
325
+ r.classList.toggle("active", n), r.setAttribute("data-active", n ? "true" : "false"), r.setAttribute("aria-pressed", n ? "true" : "false");
326
+ });
327
+ }
328
+ function w(e, t) {
329
+ f.has(e) || f.set(e, t), I.has(e) || I.set(e, []), E.has(e) || E.set(e, le(0)), S.has(e) || S.set(e, t.enableRealtime), W.add(e);
330
+ }
331
+ function ie(e) {
332
+ return V.get(e) === !0;
333
+ }
334
+ function Ie(e, t, n, i) {
335
+ if (!e)
336
+ return e;
337
+ if (e.length <= n + i)
338
+ return t.repeat(e.length);
339
+ const o = e.slice(0, n), r = i > 0 ? e.slice(e.length - i) : "";
340
+ return `${o}${t.repeat(Math.max(1, e.length - n - i))}${r}`;
341
+ }
342
+ function se(e, t, n) {
343
+ const i = e.replace(/\D/g, "");
344
+ if (i.length === 0)
345
+ return e;
346
+ let o = 0;
347
+ const r = Math.max(0, i.length - n);
348
+ return e.split("").map((a) => /\d/.test(a) ? (o += 1, o <= r ? t : a) : a).join("");
349
+ }
350
+ function Ye(e, t) {
351
+ const n = e.indexOf("@");
352
+ if (n <= 0)
353
+ return e;
354
+ const i = e.slice(0, n), o = e.slice(n + 1);
355
+ return i.length <= 2 ? `${i[0] || ""}${t}[at]${o}` : `${i[0]}${t.repeat(Math.max(1, i.length - 2))}${i[i.length - 1]}[at]${o}`;
356
+ }
357
+ function Xe(e, t) {
358
+ const n = e.split(".");
359
+ return n.length !== 4 ? e : `${n[0]}.${n[1]}.${n[2]}.${t.repeat(Math.max(1, n[3].length))}`;
360
+ }
361
+ function Ce(e, t, n) {
362
+ return e && (t === "email" ? Ye(e, n.maskChar) : t === "phone" || t === "ssn" || t === "credit-card" ? se(e, n.maskChar, 4) : t === "ipv4" ? Xe(e, n.maskChar) : t === "api-key" || t === "jwt" ? Ie(e, n.maskChar, 0, 0) : Ie(e, n.maskChar, n.revealStart, n.revealEnd));
363
+ }
364
+ function Re(e, t, n) {
365
+ return n.redactionMode === "mask" ? Ce(e, t, n) : `[${n.redactionToken}:${t.toUpperCase()}]`;
366
+ }
367
+ function Je(e) {
368
+ return ve += 1, `pii-${e}-${Date.now().toString(36)}-${ve.toString(36)}`;
369
+ }
370
+ function he(e, t) {
371
+ var n;
372
+ return t.skipInCodeBlocks ? !!((n = e.parentElement) != null && n.closest("code, pre, kbd, samp")) : !1;
373
+ }
374
+ function Qe(e, t) {
375
+ return t.some((n) => e.start < n.end && n.start < e.end);
376
+ }
377
+ function et(e, t, n) {
378
+ const i = [];
379
+ t.filter((a) => a.enabled).forEach((a) => {
380
+ const l = be(a.pattern);
381
+ let c = l.exec(e);
382
+ for (; c && i.length < n * 5; ) {
383
+ const d = c[0] || "", s = c.index, p = s + d.length;
384
+ d && p > s && (!a.validator || a.validator(d)) && i.push({
385
+ type: a.type,
386
+ severity: a.severity,
387
+ value: d,
388
+ start: s,
389
+ end: p
390
+ }), l.lastIndex === c.index && (l.lastIndex += 1), c = l.exec(e);
391
+ }
392
+ }), i.sort((a, l) => a.start !== l.start ? a.start - l.start : l.end - a.end);
393
+ const r = [];
394
+ for (let a = 0; a < i.length && !(r.length >= n); a += 1) {
395
+ const l = i[a];
396
+ Qe({ start: l.start, end: l.end }, r) || r.push(l);
397
+ }
398
+ return r;
399
+ }
400
+ function ue(e, t = 120) {
401
+ return e.length <= t ? e : `${e.slice(0, t - 1).trimEnd()}...`;
402
+ }
403
+ function tt(e, t, n) {
404
+ const i = Math.max(0, t - 28), o = Math.min(e.length, n + 28);
405
+ return ue(e.slice(i, o).trim(), 180);
406
+ }
407
+ function nt(e, t) {
408
+ const n = le(t);
409
+ return n.total = e.length, e.forEach((i) => {
410
+ n.byType[i.type] += 1, i.severity === "high" ? n.high += 1 : i.severity === "medium" ? n.medium += 1 : n.low += 1;
411
+ }), n;
412
+ }
413
+ function oe(e, t) {
414
+ const n = e.querySelector(".rte-pii-redaction-live");
415
+ n && (n.textContent = t);
416
+ }
417
+ function F(e, t, n) {
418
+ const i = t.querySelector('[data-action="toggle-realtime"]');
419
+ if (!i)
420
+ return;
421
+ const o = H(e, n);
422
+ i.textContent = o ? n.labels.realtimeOnText : n.labels.realtimeOffText, i.setAttribute("aria-pressed", o ? "true" : "false"), C(e, "togglePIIRealtime", o);
423
+ }
424
+ function rt(e, t) {
425
+ e.setAttribute("aria-label", t.labels.panelAriaLabel);
426
+ const n = e.querySelector(".rte-pii-redaction-title");
427
+ n && (n.textContent = t.labels.panelTitle);
428
+ const i = e.querySelector('[data-action="close"]');
429
+ i && i.setAttribute("aria-label", t.labels.closeText);
430
+ const o = e.querySelector('[data-action="run-scan"]');
431
+ o && (o.textContent = t.labels.scanText);
432
+ const r = e.querySelector('[data-action="redact-all"]');
433
+ r && (r.textContent = t.labels.redactAllText);
434
+ const a = e.querySelector(".rte-pii-redaction-shortcut");
435
+ a && (a.textContent = t.labels.shortcutText);
436
+ }
437
+ function B(e) {
438
+ const t = m.get(e);
439
+ if (!t)
440
+ return;
441
+ const n = f.get(e) || M;
442
+ if (!n)
443
+ return;
444
+ const i = I.get(e) || [], o = E.get(e) || le(0), r = U(e), a = t.querySelector(".rte-pii-redaction-count"), l = t.querySelector(".rte-pii-redaction-summary"), c = t.querySelector(".rte-pii-redaction-list"), d = t.querySelector('[data-action="redact-all"]');
445
+ if (!(!a || !l || !c || !d)) {
446
+ if (a.textContent = String(o.total), l.textContent = `${n.labels.summaryPrefix}: ${o.total} | High ${o.high} | Medium ${o.medium} | Low ${o.low} | Redacted ${o.redactedCount}`, d.disabled = r || i.length === 0, r ? oe(t, n.labels.readonlyRedactionText) : oe(t, `${o.total} PII findings detected.`), F(e, t, n), i.length === 0) {
447
+ c.innerHTML = `<li class="rte-pii-redaction-empty">${b(n.labels.noFindingsText)}</li>`;
448
+ return;
449
+ }
450
+ c.innerHTML = i.map((s) => {
451
+ const p = s.type.toUpperCase(), A = s.suggestion || "Redact this finding before export/share.", P = `${n.labels.locateText}: ${s.match}`, K = `${n.labels.redactText}: ${s.match}`, y = r ? 'disabled aria-disabled="true"' : "";
452
+ return `
453
+ <li class="rte-pii-redaction-item rte-pii-redaction-item-${s.severity}">
454
+ <button
455
+ type="button"
456
+ class="rte-pii-redaction-item-btn"
457
+ data-action="locate-finding"
458
+ data-finding-id="${b(s.id)}"
459
+ data-role="finding-button"
460
+ aria-label="${b(P)}"
461
+ >
462
+ <span class="rte-pii-redaction-badge">${b(s.severity.toUpperCase())}</span>
463
+ <span class="rte-pii-redaction-type">${b(p)}</span>
464
+ </button>
465
+ <p class="rte-pii-redaction-line"><strong>${b(n.labels.matchLabel)}:</strong> ${b(ue(s.match, 80))}</p>
466
+ <p class="rte-pii-redaction-line"><strong>${b(n.labels.maskedLabel)}:</strong> ${b(ue(s.masked, 80))}</p>
467
+ ${s.excerpt ? `<p class="rte-pii-redaction-line"><strong>${b(n.labels.excerptLabel)}:</strong> ${b(s.excerpt)}</p>` : ""}
468
+ <p class="rte-pii-redaction-help">${b(A)}</p>
469
+ <div class="rte-pii-redaction-item-actions">
470
+ <button type="button" class="rte-pii-redaction-btn" data-action="redact-finding" data-finding-id="${b(
471
+ s.id
472
+ )}" aria-label="${b(K)}" ${y}>${b(n.labels.redactText)}</button>
473
+ </div>
474
+ </li>
475
+ `;
476
+ }).join("");
477
+ }
478
+ }
479
+ function fe(e, t) {
480
+ if (!t.classList.contains("show"))
481
+ return;
482
+ const i = ge(e).getBoundingClientRect(), o = Math.min(window.innerWidth - 20, 390), r = Math.max(10, window.innerWidth - o - 10), a = Math.min(Math.max(10, i.right - o), r), l = Math.max(10, Math.min(window.innerHeight - 10 - 280, i.top + 10));
483
+ t.style.width = `${o}px`, t.style.left = `${a}px`, t.style.top = `${l}px`, t.style.maxHeight = `${Math.max(260, window.innerHeight - 20)}px`;
484
+ }
485
+ function H(e, t) {
486
+ const n = S.get(e);
487
+ return typeof n == "boolean" ? n : t ? t.enableRealtime : !0;
488
+ }
489
+ function Se(e, t) {
490
+ if (t === e.innerHTML)
491
+ return;
492
+ const n = window.execEditorCommand || window.executeEditorCommand;
493
+ if (typeof n == "function")
494
+ try {
495
+ n("recordDomTransaction", e, t, e.innerHTML);
496
+ } catch (i) {
497
+ }
498
+ }
499
+ function Ae(e) {
500
+ e.dispatchEvent(new Event("input", { bubbles: !0 }));
501
+ }
502
+ function Me(e, t) {
503
+ e.dispatchEvent(
504
+ new CustomEvent("editora:pii-redacted", {
505
+ bubbles: !0,
506
+ detail: {
507
+ redactedCount: t
508
+ }
509
+ })
510
+ );
511
+ }
512
+ function Pe(e, t) {
513
+ return (I.get(e) || []).find((i) => i.id === t);
514
+ }
515
+ function it(e) {
516
+ const t = m.get(e);
517
+ if (t)
518
+ return t;
519
+ const n = f.get(e) || M || ee(), i = `rte-pii-redaction-panel-${He++}`, o = document.createElement("section");
520
+ return o.className = u, o.id = i, o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "false"), o.setAttribute("aria-label", n.labels.panelAriaLabel), o.innerHTML = `
521
+ <header class="rte-pii-redaction-header">
522
+ <h2 class="rte-pii-redaction-title">${b(n.labels.panelTitle)}</h2>
523
+ <button type="button" class="rte-pii-redaction-icon-btn" data-action="close" aria-label="${b(
524
+ n.labels.closeText
525
+ )}">✕</button>
526
+ </header>
527
+ <div class="rte-pii-redaction-body">
528
+ <div class="rte-pii-redaction-topline">
529
+ <p class="rte-pii-redaction-summary" aria-live="polite"></p>
530
+ <span class="rte-pii-redaction-count" aria-hidden="true">0</span>
531
+ </div>
532
+ <div class="rte-pii-redaction-controls" role="toolbar" aria-label="PII redaction controls">
533
+ <button type="button" class="rte-pii-redaction-btn rte-pii-redaction-btn-primary" data-action="run-scan">${b(
534
+ n.labels.scanText
535
+ )}</button>
536
+ <button type="button" class="rte-pii-redaction-btn" data-action="redact-all">${b(
537
+ n.labels.redactAllText
538
+ )}</button>
539
+ <button type="button" class="rte-pii-redaction-btn" data-action="toggle-realtime" aria-pressed="false"></button>
540
+ </div>
541
+ <ul class="rte-pii-redaction-list" role="list" aria-label="Detected PII findings"></ul>
542
+ <p class="rte-pii-redaction-shortcut">${b(n.labels.shortcutText)}</p>
543
+ <span class="rte-pii-redaction-live" aria-live="polite"></span>
544
+ </div>
545
+ `, o.addEventListener("click", (r) => {
546
+ const a = r.target, l = a == null ? void 0 : a.closest("[data-action]");
547
+ if (!l)
548
+ return;
549
+ const c = l.getAttribute("data-action") || "", d = f.get(e) || M || n;
550
+ if (f.set(e, d), w(e, d), c === "close") {
551
+ Z(e, !0);
552
+ return;
553
+ }
554
+ if (c === "run-scan") {
555
+ h(e, d, !0);
556
+ return;
557
+ }
558
+ if (c === "toggle-realtime") {
559
+ const s = !H(e, d);
560
+ S.set(e, s), F(e, o, d), s && h(e, d, !0);
561
+ return;
562
+ }
563
+ if (c === "redact-all") {
564
+ xe(e, d);
565
+ return;
566
+ }
567
+ if (c === "locate-finding") {
568
+ const s = l.getAttribute("data-finding-id") || "", p = Pe(e, s);
569
+ if (!p)
570
+ return;
571
+ lt(e, p, d);
572
+ return;
573
+ }
574
+ if (c === "redact-finding") {
575
+ const s = l.getAttribute("data-finding-id") || "";
576
+ _e(e, s, d);
577
+ }
578
+ }), o.addEventListener("keydown", (r) => {
579
+ if (r.key === "Escape") {
580
+ r.preventDefault(), Z(e, !0);
581
+ return;
582
+ }
583
+ if (r.key !== "ArrowDown" && r.key !== "ArrowUp")
584
+ return;
585
+ const a = Array.from(o.querySelectorAll('[data-role="finding-button"]'));
586
+ if (a.length === 0)
587
+ return;
588
+ const l = document.activeElement, c = a.findIndex((p) => p === l);
589
+ if (c === -1)
590
+ return;
591
+ r.preventDefault();
592
+ const d = r.key === "ArrowDown" ? 1 : -1, s = (c + d + a.length) % a.length;
593
+ a[s].focus();
594
+ }), ne(o, e), document.body.appendChild(o), m.set(e, o), V.set(e, !1), B(e), o;
595
+ }
596
+ function Z(e, t = !1) {
597
+ const n = m.get(e);
598
+ n && (n.classList.remove("show"), V.set(e, !1), C(e, "togglePIIRedactionPanel", !1), t && e.focus({ preventScroll: !0 }));
599
+ }
600
+ function O(e) {
601
+ q();
602
+ const t = it(e);
603
+ m.forEach((i, o) => {
604
+ o !== e && Z(o, !1);
605
+ }), t.classList.add("show"), V.set(e, !0), C(e, "togglePIIRedactionPanel", !0), ne(t, e), fe(e, t), B(e);
606
+ const n = t.querySelector('[data-action="run-scan"]');
607
+ n == null || n.focus();
608
+ }
609
+ function Le(e, t) {
610
+ const n = ie(e);
611
+ return (typeof t == "boolean" ? t : !n) ? O(e) : Z(e), !0;
612
+ }
613
+ function ot(e, t) {
614
+ const n = t.normalizeText(e.innerText || e.textContent || ""), i = e.innerHTML;
615
+ return `${n.length}:${$e(n)}:${i.length}:${$e(i)}:${t.detectorSignature}`;
616
+ }
617
+ function at(e, t) {
618
+ const n = [], i = be(e.pattern);
619
+ let o = i.exec(t);
620
+ for (; o; ) {
621
+ const r = o[0] || "", a = o.index, l = a + r.length;
622
+ r && l > a && (!e.validator || e.validator(r)) && n.push({ value: r, start: a, end: l }), i.lastIndex === o.index && (i.lastIndex += 1), o = i.exec(t);
623
+ }
624
+ return n;
625
+ }
626
+ function De(e, t, n) {
627
+ const i = n.detectors.find((c) => c.type === t.type && c.enabled);
628
+ if (!i)
629
+ return null;
630
+ const o = t.match.toLowerCase();
631
+ let r = 0;
632
+ const a = document.createTreeWalker(e, pe, null);
633
+ let l = a.nextNode();
634
+ for (; l; ) {
635
+ if (!he(l, n)) {
636
+ const c = at(i, l.data);
637
+ for (let d = 0; d < c.length; d += 1) {
638
+ const s = c[d];
639
+ if (s.value.toLowerCase() === o && (r += 1, r === t.occurrence)) {
640
+ const p = document.createRange();
641
+ return p.setStart(l, s.start), p.setEnd(l, s.end), p;
642
+ }
643
+ }
644
+ }
645
+ l = a.nextNode();
646
+ }
647
+ return null;
648
+ }
649
+ function lt(e, t, n) {
650
+ const i = De(e, t, n);
651
+ if (!i)
652
+ return !1;
653
+ const o = window.getSelection();
654
+ if (!o)
655
+ return !1;
656
+ o.removeAllRanges(), o.addRange(i);
657
+ const r = re(i.startContainer);
658
+ return r == null || r.scrollIntoView({ behavior: "smooth", block: "center", inline: "nearest" }), e.focus({ preventScroll: !0 }), !0;
659
+ }
660
+ async function h(e, t, n = !1) {
661
+ var p;
662
+ w(e, t);
663
+ const i = ot(e, t);
664
+ if (!n && de.get(e) === i)
665
+ return I.get(e) || [];
666
+ const o = (Q.get(e) || 0) + 1;
667
+ Q.set(e, o);
668
+ const r = [], a = /* @__PURE__ */ new Map(), l = document.createTreeWalker(e, pe, null);
669
+ let c = l.nextNode();
670
+ for (; c && r.length < t.maxFindings; ) {
671
+ const A = c.data || "";
672
+ if (A.trim() && !he(c, t)) {
673
+ const P = et(A, t.detectors, t.maxFindings - r.length);
674
+ for (let K = 0; K < P.length && !(r.length >= t.maxFindings); K += 1) {
675
+ const y = P[K], ye = `${y.type}:${y.value.toLowerCase()}`, ke = (a.get(ye) || 0) + 1;
676
+ a.set(ye, ke), r.push({
677
+ id: Je(y.type),
678
+ type: y.type,
679
+ severity: y.severity,
680
+ match: y.value,
681
+ masked: Ce(y.value, y.type, t),
682
+ occurrence: ke,
683
+ excerpt: tt(A, y.start, y.end),
684
+ suggestion: "Review and redact this value before external sharing."
685
+ });
686
+ }
687
+ }
688
+ c = l.nextNode();
689
+ }
690
+ if (Q.get(e) !== o)
691
+ return I.get(e) || [];
692
+ const d = ((p = E.get(e)) == null ? void 0 : p.redactedCount) || 0, s = nt(r, d);
693
+ return de.set(e, i), I.set(e, r), E.set(e, s), B(e), e.dispatchEvent(
694
+ new CustomEvent("editora:pii-scan", {
695
+ bubbles: !0,
696
+ detail: {
697
+ findings: r,
698
+ stats: s
699
+ }
700
+ })
701
+ ), r;
702
+ }
703
+ function ct(e, t) {
704
+ let n = e, i = 0;
705
+ return t.detectors.filter((r) => r.enabled).forEach((r) => {
706
+ const a = be(r.pattern);
707
+ n = n.replace(a, (l) => r.validator && !r.validator(l) ? l : (i += 1, Re(l, r.type, t)));
708
+ }), { nextValue: n, count: i };
709
+ }
710
+ async function _e(e, t, n) {
711
+ var d;
712
+ if (U(e)) {
713
+ const s = m.get(e);
714
+ return s && oe(s, n.labels.readonlyRedactionText), !1;
715
+ }
716
+ const i = Pe(e, t);
717
+ if (!i)
718
+ return !1;
719
+ const o = De(e, i, n);
720
+ if (!o)
721
+ return !1;
722
+ const r = e.innerHTML, a = Re(i.match, i.type, n);
723
+ if (o.startContainer === o.endContainer && o.startContainer.nodeType === Node.TEXT_NODE) {
724
+ const s = o.startContainer, p = s.data, A = o.startOffset, P = o.endOffset;
725
+ s.data = `${p.slice(0, A)}${a}${p.slice(P)}`;
726
+ } else
727
+ o.deleteContents(), o.insertNode(document.createTextNode(a));
728
+ Ae(e), Se(e, r);
729
+ const l = ((d = E.get(e)) == null ? void 0 : d.redactedCount) || 0;
730
+ await h(e, n, !0);
731
+ const c = E.get(e);
732
+ return c && (c.redactedCount = l + 1, B(e)), Me(e, 1), !0;
733
+ }
734
+ async function xe(e, t) {
735
+ var d;
736
+ if (U(e)) {
737
+ const s = m.get(e);
738
+ return s && oe(s, t.labels.readonlyRedactionText), 0;
739
+ }
740
+ (I.get(e) || []).length === 0 && await h(e, t, !0);
741
+ const i = e.innerHTML;
742
+ let o = 0;
743
+ const r = document.createTreeWalker(e, pe, null);
744
+ let a = r.nextNode();
745
+ for (; a; ) {
746
+ if (he(a, t)) {
747
+ a = r.nextNode();
748
+ continue;
749
+ }
750
+ const s = a.data || "";
751
+ if (!s) {
752
+ a = r.nextNode();
753
+ continue;
754
+ }
755
+ const p = ct(s, t);
756
+ p.count > 0 && p.nextValue !== s && (a.data = p.nextValue, o += p.count), a = r.nextNode();
757
+ }
758
+ if (o === 0)
759
+ return 0;
760
+ Ae(e), Se(e, i);
761
+ const l = ((d = E.get(e)) == null ? void 0 : d.redactedCount) || 0;
762
+ await h(e, t, !0);
763
+ const c = E.get(e);
764
+ return c && (c.redactedCount = l + o, B(e)), Me(e, o), o;
765
+ }
766
+ function Ne(e) {
767
+ const t = f.get(e) || M;
768
+ if (!t || !H(e, t) || U(e))
769
+ return;
770
+ me(e);
771
+ const n = window.setTimeout(() => {
772
+ j.delete(n), te.delete(e), h(e, t, !1);
773
+ }, t.debounceMs);
774
+ j.add(n), te.set(e, n);
775
+ }
776
+ function st(e) {
777
+ const t = e.key.toLowerCase();
778
+ return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "i";
779
+ }
780
+ function dt(e) {
781
+ const t = e.key.toLowerCase();
782
+ return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "u";
783
+ }
784
+ function ut(e) {
785
+ const t = e.key.toLowerCase();
786
+ return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "m";
787
+ }
788
+ function ft(e) {
789
+ const t = e.key.toLowerCase();
790
+ return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "y";
791
+ }
792
+ function pt(e) {
793
+ var i;
794
+ const t = re(e.target);
795
+ if (t) {
796
+ const o = t.closest(x);
797
+ if (o)
798
+ return o;
799
+ const r = t.closest(ae);
800
+ if (r) {
801
+ const l = z(r);
802
+ if (l)
803
+ return l;
804
+ }
805
+ const a = t.closest(`.${u}`);
806
+ if (a) {
807
+ const l = Array.from(m.entries()).find(([, c]) => c === a);
808
+ if (l)
809
+ return l[0];
810
+ }
811
+ }
812
+ const n = window.getSelection();
813
+ if (n && n.rangeCount > 0) {
814
+ const o = (i = re(n.getRangeAt(0).startContainer)) == null ? void 0 : i.closest(
815
+ x
816
+ );
817
+ if (o)
818
+ return o;
819
+ }
820
+ return null;
821
+ }
822
+ function bt() {
823
+ if (typeof document == "undefined" || document.getElementById(Ee))
824
+ return;
825
+ const e = document.createElement("style");
826
+ e.id = Ee, e.textContent = `
827
+ .rte-toolbar-group-items.${k},
828
+ .editora-toolbar-group-items.${k},
829
+ .rte-toolbar-group-items.${v},
830
+ .editora-toolbar-group-items.${v} {
831
+ display: flex;
832
+ border: 1px solid #ccc;
833
+ border-radius: 3px;
834
+ background: #fff;
835
+ }
836
+
837
+ .rte-toolbar-group-items.${k} .rte-toolbar-button,
838
+ .editora-toolbar-group-items.${k} .editora-toolbar-button,
839
+ .rte-toolbar-group-items.${v} .rte-toolbar-button,
840
+ .editora-toolbar-group-items.${v} .editora-toolbar-button {
841
+ border: none;
842
+ border-radius: 0;
843
+ border-right: 1px solid #ccc;
844
+ }
845
+
846
+ .rte-toolbar-group-items.${k} .rte-toolbar-item:last-child .rte-toolbar-button,
847
+ .editora-toolbar-group-items.${k} .editora-toolbar-item:last-child .editora-toolbar-button,
848
+ .rte-toolbar-group-items.${v} .rte-toolbar-item:last-child .rte-toolbar-button,
849
+ .editora-toolbar-group-items.${v} .editora-toolbar-item:last-child .editora-toolbar-button {
850
+ border-right: none;
851
+ }
852
+
853
+ .rte-toolbar-button[data-command="togglePIIRealtime"].active,
854
+ .editora-toolbar-button[data-command="togglePIIRealtime"].active {
855
+ background-color: #ccc;
856
+ }
857
+
858
+ ${$} .rte-toolbar-group-items.${k},
859
+ ${$} .editora-toolbar-group-items.${k},
860
+ ${$} .rte-toolbar-group-items.${v},
861
+ ${$} .editora-toolbar-group-items.${v},
862
+ .${u}.rte-pii-redaction-theme-dark {
863
+ border-color: #566275;
864
+ }
865
+ ${$} .rte-toolbar-group-items.${k} .rte-toolbar-button svg,
866
+ ${$} .editora-toolbar-group-items.${k} .editora-toolbar-button svg,
867
+ ${$} .rte-toolbar-group-items.${v} .rte-toolbar-button svg,
868
+ ${$} .editora-toolbar-group-items.${v} .editora-toolbar-button svg
869
+ {
870
+ fill: none;
871
+ }
872
+ ${$} .rte-toolbar-group-items.${k} .rte-toolbar-button,
873
+ ${$} .editora-toolbar-group-items.${k} .editora-toolbar-button
874
+ {
875
+ border-color: #566275;
876
+ }
877
+ .${u} {
878
+ position: fixed;
879
+ z-index: 12000;
880
+ display: none;
881
+ width: min(390px, calc(100vw - 20px));
882
+ max-height: calc(100vh - 20px);
883
+ border: 1px solid #d1d5db;
884
+ border-radius: 14px;
885
+ background: #ffffff;
886
+ color: #111827;
887
+ box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
888
+ overflow: hidden;
889
+ }
890
+
891
+ .${u}.show {
892
+ display: flex;
893
+ flex-direction: column;
894
+ }
895
+
896
+ .${u}.rte-pii-redaction-theme-dark {
897
+ border-color: #334155;
898
+ background: #0f172a;
899
+ color: #e2e8f0;
900
+ box-shadow: 0 20px 46px rgba(2, 6, 23, 0.68);
901
+ }
902
+
903
+ .rte-pii-redaction-header {
904
+ display: flex;
905
+ align-items: center;
906
+ justify-content: space-between;
907
+ gap: 8px;
908
+ padding: 12px 14px;
909
+ border-bottom: 1px solid #e5e7eb;
910
+ background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
911
+ }
912
+
913
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-header {
914
+ border-color: #1e293b;
915
+ background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
916
+ }
917
+
918
+ .rte-pii-redaction-title {
919
+ margin: 0;
920
+ font-size: 15px;
921
+ line-height: 1.2;
922
+ font-weight: 700;
923
+ }
924
+
925
+ .rte-pii-redaction-icon-btn {
926
+ width: 34px;
927
+ height: 34px;
928
+ border: 1px solid #cbd5e1;
929
+ border-radius: 6px;
930
+ background: #ffffff;
931
+ color: #0f172a;
932
+ font-size: 16px;
933
+ line-height: 1;
934
+ font-weight: 600;
935
+ padding: 0;
936
+ display: inline-flex;
937
+ align-items: center;
938
+ justify-content: center;
939
+ cursor: pointer;
940
+ }
941
+
942
+ .rte-pii-redaction-icon-btn:hover,
943
+ .rte-pii-redaction-icon-btn:focus-visible {
944
+ outline: none;
945
+ border-color: #3b82f6;
946
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
947
+ }
948
+
949
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-icon-btn {
950
+ background: #0f172a;
951
+ border-color: #475569;
952
+ color: #e2e8f0;
953
+ }
954
+
955
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-icon-btn:hover,
956
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-icon-btn:focus-visible {
957
+ border-color: #60a5fa;
958
+ box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.24);
959
+ }
960
+
961
+ .rte-pii-redaction-body {
962
+ display: flex;
963
+ flex-direction: column;
964
+ gap: 10px;
965
+ padding: 12px;
966
+ overflow: auto;
967
+ }
968
+
969
+ .rte-pii-redaction-topline {
970
+ display: flex;
971
+ align-items: center;
972
+ justify-content: space-between;
973
+ gap: 8px;
974
+ }
975
+
976
+ .rte-pii-redaction-summary {
977
+ margin: 0;
978
+ font-size: 12px;
979
+ line-height: 1.35;
980
+ color: #475569;
981
+ flex: 1;
982
+ }
983
+
984
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-summary {
985
+ color: #94a3b8;
986
+ }
987
+
988
+ .rte-pii-redaction-count {
989
+ min-width: 32px;
990
+ height: 32px;
991
+ border-radius: 999px;
992
+ display: inline-flex;
993
+ align-items: center;
994
+ justify-content: center;
995
+ font-weight: 700;
996
+ font-size: 13px;
997
+ border: 1px solid #cbd5e1;
998
+ background: #f8fafc;
999
+ }
1000
+
1001
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-count {
1002
+ border-color: #334155;
1003
+ background: #111827;
1004
+ color: #cbd5e1;
1005
+ }
1006
+
1007
+ .rte-pii-redaction-controls {
1008
+ display: flex;
1009
+ gap: 8px;
1010
+ flex-wrap: wrap;
1011
+ }
1012
+
1013
+ .rte-pii-redaction-btn {
1014
+ border: 1px solid #cbd5e1;
1015
+ border-radius: 8px;
1016
+ height: 34px;
1017
+ padding: 0 10px;
1018
+ background: #ffffff;
1019
+ color: inherit;
1020
+ font-size: 12px;
1021
+ font-weight: 600;
1022
+ cursor: pointer;
1023
+ }
1024
+
1025
+ .rte-pii-redaction-btn:hover,
1026
+ .rte-pii-redaction-btn:focus-visible {
1027
+ border-color: #94a3b8;
1028
+ background: #f8fafc;
1029
+ outline: none;
1030
+ }
1031
+
1032
+ .rte-pii-redaction-btn:disabled {
1033
+ opacity: 0.56;
1034
+ cursor: not-allowed;
1035
+ }
1036
+
1037
+ .rte-pii-redaction-btn-primary {
1038
+ border-color: #0284c7;
1039
+ background: #0ea5e9;
1040
+ color: #f8fafc;
1041
+ }
1042
+
1043
+ .rte-pii-redaction-btn-primary:hover,
1044
+ .rte-pii-redaction-btn-primary:focus-visible {
1045
+ border-color: #0369a1;
1046
+ background: #0284c7;
1047
+ color: #ffffff;
1048
+ }
1049
+
1050
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-btn {
1051
+ border-color: #334155;
1052
+ background: #111827;
1053
+ color: #e2e8f0;
1054
+ }
1055
+
1056
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-btn:hover,
1057
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-btn:focus-visible {
1058
+ border-color: #475569;
1059
+ background: #1e293b;
1060
+ }
1061
+
1062
+ .rte-pii-redaction-list {
1063
+ list-style: none;
1064
+ margin: 0;
1065
+ padding: 0;
1066
+ display: flex;
1067
+ flex-direction: column;
1068
+ gap: 8px;
1069
+ max-height: min(55vh, 420px);
1070
+ overflow: auto;
1071
+ }
1072
+
1073
+ .rte-pii-redaction-item {
1074
+ border: 1px solid #e2e8f0;
1075
+ border-radius: 10px;
1076
+ padding: 8px;
1077
+ background: #ffffff;
1078
+ display: grid;
1079
+ gap: 6px;
1080
+ }
1081
+
1082
+ .rte-pii-redaction-item-high {
1083
+ border-color: #fca5a5;
1084
+ background: #fef2f2;
1085
+ }
1086
+
1087
+ .rte-pii-redaction-item-medium {
1088
+ border-color: #fcd34d;
1089
+ background: #fffbeb;
1090
+ }
1091
+
1092
+ .rte-pii-redaction-item-low {
1093
+ border-color: #93c5fd;
1094
+ background: #eff6ff;
1095
+ }
1096
+
1097
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-item {
1098
+ border-color: #334155;
1099
+ background: #0b1220;
1100
+ }
1101
+
1102
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-item-high {
1103
+ border-color: #7f1d1d;
1104
+ background: #2b0b11;
1105
+ }
1106
+
1107
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-item-medium {
1108
+ border-color: #78350f;
1109
+ background: #2b1907;
1110
+ }
1111
+
1112
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-item-low {
1113
+ border-color: #1d4ed8;
1114
+ background: #0a162f;
1115
+ }
1116
+
1117
+ .rte-pii-redaction-item-btn {
1118
+ border: none;
1119
+ background: transparent;
1120
+ width: 100%;
1121
+ display: flex;
1122
+ align-items: center;
1123
+ gap: 8px;
1124
+ text-align: left;
1125
+ padding: 0;
1126
+ color: inherit;
1127
+ cursor: pointer;
1128
+ }
1129
+
1130
+ .rte-pii-redaction-item-btn:focus-visible {
1131
+ outline: 2px solid #0284c7;
1132
+ outline-offset: 3px;
1133
+ border-radius: 6px;
1134
+ }
1135
+
1136
+ .rte-pii-redaction-badge {
1137
+ border-radius: 999px;
1138
+ border: 1px solid currentColor;
1139
+ padding: 1px 8px;
1140
+ font-size: 10px;
1141
+ font-weight: 700;
1142
+ line-height: 1.3;
1143
+ text-transform: uppercase;
1144
+ opacity: 0.86;
1145
+ }
1146
+
1147
+ .rte-pii-redaction-type {
1148
+ font-size: 12px;
1149
+ font-weight: 700;
1150
+ letter-spacing: 0.03em;
1151
+ }
1152
+
1153
+ .rte-pii-redaction-line,
1154
+ .rte-pii-redaction-help {
1155
+ margin: 0;
1156
+ font-size: 12px;
1157
+ line-height: 1.35;
1158
+ color: #334155;
1159
+ word-break: break-word;
1160
+ }
1161
+
1162
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-line,
1163
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-help {
1164
+ color: #94a3b8;
1165
+ }
1166
+
1167
+ .rte-pii-redaction-item-actions {
1168
+ display: flex;
1169
+ justify-content: flex-end;
1170
+ }
1171
+
1172
+ .rte-pii-redaction-empty {
1173
+ border: 1px dashed #cbd5e1;
1174
+ border-radius: 10px;
1175
+ padding: 10px;
1176
+ font-size: 13px;
1177
+ color: #475569;
1178
+ background: #f8fafc;
1179
+ }
1180
+
1181
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-empty {
1182
+ border-color: #334155;
1183
+ background: #0b1220;
1184
+ color: #94a3b8;
1185
+ }
1186
+
1187
+ .rte-pii-redaction-shortcut {
1188
+ margin: 2px 0 0;
1189
+ font-size: 11px;
1190
+ color: #64748b;
1191
+ }
1192
+
1193
+ .${u}.rte-pii-redaction-theme-dark .rte-pii-redaction-shortcut {
1194
+ color: #94a3b8;
1195
+ }
1196
+
1197
+ .rte-pii-redaction-live {
1198
+ position: absolute;
1199
+ width: 1px;
1200
+ height: 1px;
1201
+ margin: -1px;
1202
+ padding: 0;
1203
+ overflow: hidden;
1204
+ clip: rect(0 0 0 0);
1205
+ border: 0;
1206
+ }
1207
+
1208
+ @media (max-width: 768px) {
1209
+ .${u} {
1210
+ left: 10px !important;
1211
+ right: 10px;
1212
+ top: 10px !important;
1213
+ width: auto !important;
1214
+ max-height: calc(100vh - 20px);
1215
+ }
1216
+
1217
+ .rte-pii-redaction-list {
1218
+ max-height: 45vh;
1219
+ }
1220
+ }
1221
+ `, document.head.appendChild(e);
1222
+ }
1223
+ function gt(e) {
1224
+ M = e, L || (L = (t) => {
1225
+ q();
1226
+ const n = t.target, i = n == null ? void 0 : n.closest(x);
1227
+ if (!i)
1228
+ return;
1229
+ g = i;
1230
+ const o = f.get(i) || e;
1231
+ w(i, o), f.set(i, o), C(i, "togglePIIRedactionPanel", ie(i)), C(i, "togglePIIRealtime", H(i, o));
1232
+ const r = m.get(i);
1233
+ r && (ne(r, i), fe(i, r), F(i, r, o));
1234
+ }, document.addEventListener("focusin", L, !0)), D || (D = (t) => {
1235
+ const n = t.target, i = n == null ? void 0 : n.closest(x);
1236
+ i && (g = i, Ne(i));
1237
+ }, document.addEventListener("input", D, !0)), _ || (_ = (t) => {
1238
+ if (t.defaultPrevented)
1239
+ return;
1240
+ const n = t.target;
1241
+ if (n != null && n.closest(`.${u} input, .${u} textarea, .${u} select`))
1242
+ return;
1243
+ const i = pt(t);
1244
+ if (!i)
1245
+ return;
1246
+ const o = f.get(i) || M || e;
1247
+ if (w(i, o), f.set(i, o), g = i, t.key === "Escape" && ie(i)) {
1248
+ t.preventDefault(), Z(i, !0);
1249
+ return;
1250
+ }
1251
+ if (st(t)) {
1252
+ t.preventDefault(), t.stopPropagation(), Le(i);
1253
+ return;
1254
+ }
1255
+ if (dt(t)) {
1256
+ t.preventDefault(), t.stopPropagation(), h(i, o, !0), O(i);
1257
+ return;
1258
+ }
1259
+ if (ut(t)) {
1260
+ t.preventDefault(), t.stopPropagation(), U(i) || (xe(i, o), O(i));
1261
+ return;
1262
+ }
1263
+ if (ft(t)) {
1264
+ t.preventDefault(), t.stopPropagation();
1265
+ const r = !H(i, o);
1266
+ S.set(i, r);
1267
+ const a = m.get(i);
1268
+ a && F(i, a, o), C(i, "togglePIIRealtime", r), r && h(i, o, !0);
1269
+ }
1270
+ }, document.addEventListener("keydown", _, !0)), R || (R = () => {
1271
+ q(), m.forEach((t, n) => {
1272
+ !n.isConnected || !t.isConnected || (ne(t, n), fe(n, t));
1273
+ });
1274
+ }, window.addEventListener("scroll", R, !0), window.addEventListener("resize", R)), !N && typeof MutationObserver != "undefined" && document.body && (N = new MutationObserver((t) => {
1275
+ Ge(t) && q();
1276
+ }), N.observe(document.body, {
1277
+ childList: !0,
1278
+ subtree: !0
1279
+ }));
1280
+ }
1281
+ function mt() {
1282
+ L && (document.removeEventListener("focusin", L, !0), L = null), D && (document.removeEventListener("input", D, !0), D = null), _ && (document.removeEventListener("keydown", _, !0), _ = null), R && (window.removeEventListener("scroll", R, !0), window.removeEventListener("resize", R), R = null), N && (N.disconnect(), N = null), m.forEach((e) => e.remove()), m.clear(), W.forEach((e) => me(e)), W.clear(), M = null, g = null;
1283
+ }
1284
+ const ht = (e = {}) => {
1285
+ const t = ee(e), n = /* @__PURE__ */ new Set();
1286
+ return bt(), {
1287
+ name: "piiRedaction",
1288
+ toolbar: [
1289
+ {
1290
+ id: "piiRedactionGroup",
1291
+ label: "PII Redaction",
1292
+ type: "group",
1293
+ command: "piiRedaction",
1294
+ items: [
1295
+ {
1296
+ id: "piiRedaction",
1297
+ label: "PII Redaction",
1298
+ command: "togglePIIRedactionPanel",
1299
+ shortcut: "Mod-Alt-Shift-i",
1300
+ icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M12 3.5 19 6.5v4.8c0 4.4-2.7 8.1-7 9.2-4.3-1.1-7-4.8-7-9.2V6.5l7-3Z" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/><path d="M8.8 11.6h6.4" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/><circle cx="12" cy="11.6" r="1.2" fill="currentColor"/></svg>'
1301
+ },
1302
+ {
1303
+ id: "piiScan",
1304
+ label: "Scan PII",
1305
+ command: "runPIIScan",
1306
+ shortcut: "Mod-Alt-Shift-u",
1307
+ icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><rect x="4.5" y="3.5" width="11" height="15" rx="2" stroke="currentColor" stroke-width="1.6"/><path d="M7.5 8.2h5M7.5 11.2h5M7.5 14.2h3.2" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/><circle cx="16.8" cy="16.8" r="2.8" stroke="currentColor" stroke-width="1.6"/><path d="m18.8 18.8 2 2" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>'
1308
+ },
1309
+ {
1310
+ id: "piiRedactAll",
1311
+ label: "Redact All PII",
1312
+ command: "redactAllPII",
1313
+ shortcut: "Mod-Alt-Shift-m",
1314
+ icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M5 18h14" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/><path d="M7 6h10l-1 8H8L7 6Z" stroke="currentColor" stroke-width="1.7"/><path d="m9 9 6 4" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/></svg>'
1315
+ },
1316
+ {
1317
+ id: "piiRealtime",
1318
+ label: "Toggle Realtime PII Scan",
1319
+ command: "togglePIIRealtime",
1320
+ shortcut: "Mod-Alt-Shift-y",
1321
+ icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M12 3v4M12 17v4M4 12h4M16 12h4" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/><circle cx="12" cy="12" r="4" stroke="currentColor" stroke-width="1.7"/></svg>'
1322
+ }
1323
+ ]
1324
+ }
1325
+ ],
1326
+ commands: {
1327
+ piiRedaction: (i, o) => {
1328
+ const r = T(o);
1329
+ if (!r)
1330
+ return !1;
1331
+ const a = f.get(r) || t;
1332
+ return w(r, a), f.set(r, a), g = r, O(r), h(r, a, !1), !0;
1333
+ },
1334
+ togglePIIRedactionPanel: (i, o) => {
1335
+ const r = T(o);
1336
+ if (!r)
1337
+ return !1;
1338
+ const a = f.get(r) || t;
1339
+ w(r, a), f.set(r, a), g = r;
1340
+ const l = Le(r, typeof i == "boolean" ? i : void 0);
1341
+ return ie(r) && h(r, a, !1), l;
1342
+ },
1343
+ runPIIScan: async (i, o) => {
1344
+ const r = T(o);
1345
+ if (!r)
1346
+ return !1;
1347
+ const a = f.get(r) || t;
1348
+ return w(r, a), f.set(r, a), g = r, await h(r, a, !0), O(r), !0;
1349
+ },
1350
+ redactAllPII: async (i, o) => {
1351
+ const r = T(o);
1352
+ if (!r)
1353
+ return !1;
1354
+ const a = f.get(r) || t;
1355
+ w(r, a), f.set(r, a), g = r;
1356
+ const l = await xe(r, a);
1357
+ return l > 0 && O(r), l > 0;
1358
+ },
1359
+ redactPIIFinding: async (i, o) => {
1360
+ const r = T(o);
1361
+ if (!r || typeof i != "string" || !i)
1362
+ return !1;
1363
+ const a = f.get(r) || t;
1364
+ return w(r, a), f.set(r, a), g = r, _e(r, i, a);
1365
+ },
1366
+ togglePIIRealtime: (i, o) => {
1367
+ const r = T(o);
1368
+ if (!r)
1369
+ return !1;
1370
+ const a = f.get(r) || t;
1371
+ w(r, a), f.set(r, a);
1372
+ const l = typeof i == "boolean" ? i : !H(r, a);
1373
+ S.set(r, l);
1374
+ const c = m.get(r);
1375
+ return c && F(r, c, a), C(r, "togglePIIRealtime", l), l && h(r, a, !0), !0;
1376
+ },
1377
+ getPIIRedactionFindings: (i, o) => {
1378
+ const r = T(o);
1379
+ if (!r)
1380
+ return !1;
1381
+ const a = I.get(r) || [], l = E.get(r) || le(0), c = a.map((s) => ({ ...s })), d = {
1382
+ ...l,
1383
+ byType: { ...l.byType }
1384
+ };
1385
+ if (typeof i == "function")
1386
+ try {
1387
+ i(c, d);
1388
+ } catch (s) {
1389
+ }
1390
+ return r.__piiRedactionFindings = c, r.dispatchEvent(
1391
+ new CustomEvent("editora:pii-findings", {
1392
+ bubbles: !0,
1393
+ detail: { findings: c, stats: d }
1394
+ })
1395
+ ), !0;
1396
+ },
1397
+ setPIIRedactionOptions: (i, o) => {
1398
+ const r = T(o);
1399
+ if (!r || !i || typeof i != "object")
1400
+ return !1;
1401
+ const a = f.get(r) || t, l = ee({
1402
+ ...ce(a),
1403
+ ...i,
1404
+ labels: {
1405
+ ...a.labels,
1406
+ ...i.labels || {}
1407
+ },
1408
+ detectors: {
1409
+ ...ce(a).detectors || {},
1410
+ ...i.detectors || {}
1411
+ },
1412
+ normalizeText: i.normalizeText || a.normalizeText
1413
+ });
1414
+ f.set(r, l), typeof i.enableRealtime == "boolean" && S.set(r, i.enableRealtime);
1415
+ const c = m.get(r);
1416
+ return c && (rt(c, l), B(r), F(r, c, l)), h(r, l, !0), !0;
1417
+ }
1418
+ },
1419
+ keymap: {
1420
+ "Mod-Alt-Shift-i": "togglePIIRedactionPanel",
1421
+ "Mod-Alt-Shift-I": "togglePIIRedactionPanel",
1422
+ "Mod-Alt-Shift-u": "runPIIScan",
1423
+ "Mod-Alt-Shift-U": "runPIIScan",
1424
+ "Mod-Alt-Shift-m": "redactAllPII",
1425
+ "Mod-Alt-Shift-M": "redactAllPII",
1426
+ "Mod-Alt-Shift-y": "togglePIIRealtime",
1427
+ "Mod-Alt-Shift-Y": "togglePIIRealtime"
1428
+ },
1429
+ init: function(o) {
1430
+ G += 1;
1431
+ const r = this && typeof this.__pluginConfig == "object" ? ee({ ...ce(t), ...this.__pluginConfig }) : t;
1432
+ gt(r);
1433
+ const a = T(
1434
+ o != null && o.editorElement ? { editorElement: o.editorElement } : void 0,
1435
+ !1
1436
+ );
1437
+ a && (g = a, n.add(a), w(a, r), f.set(a, r), C(a, "togglePIIRedactionPanel", !1), C(a, "togglePIIRealtime", r.enableRealtime), r.enableRealtime && Ne(a));
1438
+ },
1439
+ destroy: () => {
1440
+ n.forEach((i) => Te(i)), n.clear(), G = Math.max(0, G - 1), !(G > 0) && (j.forEach((i) => {
1441
+ window.clearTimeout(i);
1442
+ }), j.clear(), mt());
1443
+ }
1444
+ };
1445
+ };
1446
+ export {
1447
+ ht as PIIRedactionPlugin
1448
+ };
1449
+ //# sourceMappingURL=PIIRedactionPlugin.native-7ab10b9f.mjs.map