@editora/plugins 1.0.8 → 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 (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -0
  3. package/dist/approval-workflow.cjs.js +447 -0
  4. package/dist/approval-workflow.esm.js +1070 -0
  5. package/dist/blocks-library.cjs.js +442 -0
  6. package/dist/blocks-library.esm.js +1317 -0
  7. package/dist/citations.cjs.js +548 -0
  8. package/dist/citations.esm.js +1457 -0
  9. package/dist/conditional-content.cjs.js +626 -0
  10. package/dist/conditional-content.esm.js +1360 -0
  11. package/dist/content-rules.cjs.js +408 -0
  12. package/dist/content-rules.esm.js +1093 -0
  13. package/dist/data-binding.cjs.js +321 -0
  14. package/dist/data-binding.esm.js +913 -0
  15. package/dist/doc-schema.cjs.js +398 -0
  16. package/dist/doc-schema.esm.js +1310 -0
  17. package/dist/enterprise.cjs.js +1 -0
  18. package/dist/enterprise.esm.js +56 -0
  19. package/dist/index.cjs.js +1 -1
  20. package/dist/index.esm.js +109 -81
  21. package/dist/mentions.cjs.js +105 -0
  22. package/dist/mentions.esm.js +726 -0
  23. package/dist/page-break.cjs.js +2 -2
  24. package/dist/page-break.esm.js +32 -32
  25. package/dist/pii-redaction.cjs.js +436 -0
  26. package/dist/pii-redaction.esm.js +1377 -0
  27. package/dist/preview.cjs.js +3 -3
  28. package/dist/preview.esm.js +29 -29
  29. package/dist/slash-commands.cjs.js +90 -0
  30. package/dist/slash-commands.esm.js +752 -0
  31. package/dist/smart-paste.cjs.js +398 -0
  32. package/dist/smart-paste.esm.js +1388 -0
  33. package/dist/track-changes.cjs.js +77 -0
  34. package/dist/track-changes.esm.js +755 -0
  35. package/dist/translation-workflow.cjs.js +626 -0
  36. package/dist/translation-workflow.esm.js +1718 -0
  37. package/dist/version-diff.cjs.js +362 -0
  38. package/dist/version-diff.esm.js +768 -0
  39. package/index.d.ts +798 -0
  40. package/package.json +104 -5
@@ -0,0 +1,1070 @@
1
+ const w = ".rte-content, .editora-content", F = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", ee = "__editoraCommandEditorRoot", te = "rte-approval-workflow-styles", d = "rte-approval-panel", h = "approval", y = "approvalWorkflow", g = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', ue = {
2
+ panelTitle: "Approval Workflow",
3
+ panelAriaLabel: "Approval workflow panel",
4
+ statusLabel: "Status",
5
+ statusDraftText: "Draft",
6
+ statusReviewText: "In Review",
7
+ statusApprovedText: "Approved",
8
+ requestReviewText: "Request Review",
9
+ approveText: "Approve",
10
+ reopenDraftText: "Reopen Draft",
11
+ addCommentText: "Add Comment",
12
+ actorLabel: "Actor",
13
+ actorPlaceholder: "Reviewer name",
14
+ commentLabel: "Comment",
15
+ commentPlaceholder: "Add review note or sign-off context",
16
+ closeText: "Close",
17
+ commentsHeading: "Comments",
18
+ signoffsHeading: "Sign-offs",
19
+ noCommentsText: "No comments yet.",
20
+ noSignoffsText: "No sign-offs yet.",
21
+ summaryPrefix: "Workflow",
22
+ lockedSuffix: "Locked",
23
+ shortcutText: "Shortcuts: Ctrl/Cmd+Alt+Shift+A/R/P/D",
24
+ approveCommentRequiredText: "Approval comment is required."
25
+ }, fe = {
26
+ draft: "statusDraftText",
27
+ review: "statusReviewText",
28
+ approved: "statusApprovedText"
29
+ }, s = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new Set();
30
+ let _ = 0, me = 0, oe = 0, re = 0, R = null, v = null, T = null, L = null, S = null;
31
+ function p(e) {
32
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
33
+ }
34
+ function be(e) {
35
+ return e.replace(/\u00A0/g, " ").replace(/\s+/g, " ").trim();
36
+ }
37
+ function ne(e) {
38
+ return e === "review" || e === "approved" ? e : "draft";
39
+ }
40
+ function z(e = {}) {
41
+ return {
42
+ defaultStatus: ne(e.defaultStatus),
43
+ lockOnApproval: e.lockOnApproval !== !1,
44
+ maxHistoryEntries: Math.max(10, Math.min(500, Number(e.maxHistoryEntries ?? 120))),
45
+ requireCommentOnApprove: !!e.requireCommentOnApprove,
46
+ defaultActor: (e.defaultActor || "system").trim() || "system",
47
+ labels: {
48
+ ...ue,
49
+ ...e.labels || {}
50
+ },
51
+ normalizeText: e.normalizeText || be
52
+ };
53
+ }
54
+ function U(e) {
55
+ return e.closest(F) || e;
56
+ }
57
+ function B(e) {
58
+ if (!e) return null;
59
+ if (e.matches(w)) return e;
60
+ const t = e.querySelector(w);
61
+ return t instanceof HTMLElement ? t : null;
62
+ }
63
+ function ge() {
64
+ if (typeof window > "u") return null;
65
+ const e = window[ee];
66
+ if (!(e instanceof HTMLElement)) return null;
67
+ window[ee] = null;
68
+ const t = B(e);
69
+ if (t) return t;
70
+ const o = e.closest(F);
71
+ if (o) {
72
+ const n = B(o);
73
+ if (n) return n;
74
+ }
75
+ return null;
76
+ }
77
+ function ve(e) {
78
+ const t = e.closest("[data-editora-editor]");
79
+ if (t && B(t) === e)
80
+ return t;
81
+ let o = e;
82
+ for (; o; ) {
83
+ if (o.matches(F) && (o === e || B(o) === e))
84
+ return o;
85
+ o = o.parentElement;
86
+ }
87
+ return U(e);
88
+ }
89
+ function W(e) {
90
+ 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;
91
+ }
92
+ function he(e) {
93
+ const t = U(e);
94
+ if (W(t)) return !0;
95
+ const o = t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
96
+ return W(o) ? !0 : W(document.documentElement) || W(document.body);
97
+ }
98
+ function K(e, t) {
99
+ e.classList.remove("rte-approval-theme-dark"), he(t) && e.classList.add("rte-approval-theme-dark");
100
+ }
101
+ function le(e) {
102
+ return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
103
+ }
104
+ function x(e, t = !0) {
105
+ if (D(), e?.contentElement instanceof HTMLElement) return e.contentElement;
106
+ if (e?.editorElement instanceof HTMLElement) {
107
+ const a = e.editorElement;
108
+ if (a.matches(w)) return a;
109
+ const l = a.querySelector(w);
110
+ if (l instanceof HTMLElement) return l;
111
+ }
112
+ const o = ge();
113
+ if (o) return o;
114
+ const n = window.getSelection();
115
+ if (n && n.rangeCount > 0) {
116
+ const l = le(n.getRangeAt(0).startContainer)?.closest(w);
117
+ if (l) return l;
118
+ }
119
+ const r = document.activeElement;
120
+ if (r) {
121
+ if (r.matches(w)) return r;
122
+ const a = r.closest(w);
123
+ if (a) return a;
124
+ }
125
+ return v && v.isConnected ? v : (v && !v.isConnected && (v = null), t ? document.querySelector(w) : null);
126
+ }
127
+ function D() {
128
+ Array.from(H).forEach((t) => {
129
+ t.isConnected || (k.get(t)?.remove(), k.delete(t), O.delete(t), s.delete(t), I.delete(t), H.delete(t), v === t && (v = null));
130
+ });
131
+ }
132
+ function xe(e) {
133
+ return e ? !!(e.closest(`.${d}`) || e.closest(w) || e.closest(F)) : !1;
134
+ }
135
+ function we() {
136
+ const e = window.getSelection();
137
+ if (!e || e.rangeCount === 0) return !1;
138
+ const t = e.getRangeAt(0).startContainer;
139
+ return !!le(t)?.closest(w);
140
+ }
141
+ function C(e, t, o) {
142
+ const n = ve(e);
143
+ Array.from(
144
+ n.querySelectorAll(
145
+ `.rte-toolbar-button[data-command="${t}"], .editora-toolbar-button[data-command="${t}"]`
146
+ )
147
+ ).forEach((a) => {
148
+ a.classList.toggle("active", o), a.setAttribute("aria-pressed", o ? "true" : "false"), a.setAttribute("data-active", o ? "true" : "false");
149
+ });
150
+ }
151
+ function ie(e, t, o) {
152
+ t !== null ? e.setAttribute("contenteditable", t) : e.setAttribute("contenteditable", "true"), o !== null ? e.setAttribute("data-readonly", o) : e.removeAttribute("data-readonly");
153
+ }
154
+ function Y(e) {
155
+ e.dispatchEvent(new Event("input", { bubbles: !0 }));
156
+ }
157
+ function X(e, t) {
158
+ if (t === e.innerHTML) return;
159
+ const o = window.execEditorCommand || window.executeEditorCommand;
160
+ if (typeof o == "function")
161
+ try {
162
+ o("recordDomTransaction", e, t, e.innerHTML);
163
+ } catch {
164
+ }
165
+ }
166
+ function J() {
167
+ return oe += 1, `approval-comment-${Date.now().toString(36)}-${oe.toString(36)}`;
168
+ }
169
+ function ke() {
170
+ return re += 1, `approval-signoff-${Date.now().toString(36)}-${re.toString(36)}`;
171
+ }
172
+ function se(e) {
173
+ return {
174
+ status: e.status,
175
+ locked: e.locked,
176
+ comments: e.comments.map((t) => ({ ...t })),
177
+ signoffs: e.signoffs.map((t) => ({ ...t })),
178
+ updatedAt: e.updatedAt
179
+ };
180
+ }
181
+ function ye(e, t) {
182
+ const o = fe[e];
183
+ return t.labels[o] || e;
184
+ }
185
+ function ce(e, t, o) {
186
+ if (e.setAttribute("data-approval-status", t.status), e.setAttribute("data-approval-locked", t.locked ? "true" : "false"), e.classList.toggle("rte-approval-locked-editor", t.locked), C(e, "toggleApprovalWorkflowPanel", Z(e)), C(e, "requestApprovalReview", t.status === "review"), C(e, "approveDocument", t.status === "approved"), C(e, "reopenDraft", t.status === "draft"), t.status === "approved" && o.lockOnApproval) {
187
+ t.locked || (t.preApprovalContentEditable = e.getAttribute("contenteditable"), t.preApprovalReadonly = e.getAttribute("data-readonly")), e.setAttribute("contenteditable", "false"), e.setAttribute("data-readonly", "true"), t.locked = !0;
188
+ return;
189
+ }
190
+ t.locked = !1, ie(
191
+ e,
192
+ t.preApprovalContentEditable ?? t.originalContentEditable,
193
+ t.preApprovalReadonly ?? t.originalReadonly
194
+ ), t.preApprovalContentEditable = null, t.preApprovalReadonly = null;
195
+ }
196
+ function f(e, t) {
197
+ let o = I.get(e);
198
+ return o || (o = {
199
+ status: t.defaultStatus,
200
+ locked: !1,
201
+ comments: [],
202
+ signoffs: [],
203
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
204
+ originalContentEditable: e.getAttribute("contenteditable"),
205
+ originalReadonly: e.getAttribute("data-readonly"),
206
+ preApprovalContentEditable: null,
207
+ preApprovalReadonly: null
208
+ }, I.set(e, o), H.add(e), ce(e, o, t), o);
209
+ }
210
+ function j(e, t) {
211
+ return e.length <= t ? e : e.slice(e.length - t);
212
+ }
213
+ function M(e, t) {
214
+ const o = e.querySelector(".rte-approval-live");
215
+ o && (o.textContent = t);
216
+ }
217
+ function Ae(e, t) {
218
+ const o = se(t);
219
+ e.__approvalWorkflowState = o, e.dispatchEvent(
220
+ new CustomEvent("editora:approval-state-changed", {
221
+ bubbles: !0,
222
+ detail: {
223
+ state: o
224
+ }
225
+ })
226
+ );
227
+ }
228
+ function q(e) {
229
+ const t = k.get(e);
230
+ if (!t) return;
231
+ const o = s.get(e) || R;
232
+ if (!o) return;
233
+ const n = f(e, o), r = t.querySelector(".rte-approval-summary"), a = t.querySelector('[data-action="request-review"]'), l = t.querySelector('[data-action="approve"]'), c = t.querySelector('[data-action="reopen-draft"]'), u = t.querySelector(".rte-approval-comments-list"), m = t.querySelector(".rte-approval-signoffs-list");
234
+ if (r) {
235
+ const i = ye(n.status, o);
236
+ r.textContent = `${o.labels.summaryPrefix}: ${i} | Comments: ${n.comments.length} | Sign-offs: ${n.signoffs.length}${n.locked ? ` | ${o.labels.lockedSuffix}` : ""}`;
237
+ }
238
+ a && (a.disabled = n.status !== "draft"), l && (l.disabled = n.status === "approved"), c && (c.disabled = n.status === "draft"), u && (n.comments.length === 0 ? u.innerHTML = `<li class="rte-approval-empty">${p(o.labels.noCommentsText)}</li>` : u.innerHTML = n.comments.slice().reverse().map(
239
+ (i) => `
240
+ <li class="rte-approval-item rte-approval-item-${i.kind}" role="listitem">
241
+ <div class="rte-approval-item-head">
242
+ <span class="rte-approval-item-author">${p(i.author)}</span>
243
+ <time class="rte-approval-item-time" datetime="${p(i.createdAt)}">${p(
244
+ new Date(i.createdAt).toLocaleString()
245
+ )}</time>
246
+ </div>
247
+ <p class="rte-approval-item-message">${p(i.message)}</p>
248
+ </li>
249
+ `
250
+ ).join("")), m && (n.signoffs.length === 0 ? m.innerHTML = `<li class="rte-approval-empty">${p(o.labels.noSignoffsText)}</li>` : m.innerHTML = n.signoffs.slice().reverse().map(
251
+ (i) => `
252
+ <li class="rte-approval-item" role="listitem">
253
+ <div class="rte-approval-item-head">
254
+ <span class="rte-approval-item-author">${p(i.author)}</span>
255
+ <time class="rte-approval-item-time" datetime="${p(i.createdAt)}">${p(
256
+ new Date(i.createdAt).toLocaleString()
257
+ )}</time>
258
+ </div>
259
+ <p class="rte-approval-item-message">${p(i.comment || "Approved")}</p>
260
+ </li>
261
+ `
262
+ ).join(""));
263
+ }
264
+ function G(e, t, o) {
265
+ t.updatedAt = (/* @__PURE__ */ new Date()).toISOString(), ce(e, t, o), q(e), Ae(e, t);
266
+ }
267
+ function ae(e, t, o, n) {
268
+ e.comments.push({
269
+ id: J(),
270
+ author: o || t.defaultActor,
271
+ message: n,
272
+ kind: "system",
273
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
274
+ }), e.comments = j(e.comments, t.maxHistoryEntries);
275
+ }
276
+ function E(e, t, o, n) {
277
+ const r = f(e, o);
278
+ if (r.status === t) return !1;
279
+ const a = e.innerHTML;
280
+ return r.status = t, t === "review" ? ae(r, o, n, "Review requested.") : t === "draft" && ae(r, o, n, "Returned to draft."), G(e, r, o), Y(e), X(e, a), !0;
281
+ }
282
+ function pe(e, t, o, n) {
283
+ const r = n.normalizeText(t);
284
+ if (!r) return !1;
285
+ const a = n.normalizeText(o) || n.defaultActor, l = f(e, n), c = e.innerHTML;
286
+ return l.comments.push({
287
+ id: J(),
288
+ author: a,
289
+ message: r,
290
+ kind: "comment",
291
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
292
+ }), l.comments = j(l.comments, n.maxHistoryEntries), G(e, l, n), Y(e), X(e, c), !0;
293
+ }
294
+ function Q(e, t, o, n) {
295
+ const r = t.normalizeText(o) || t.defaultActor, a = t.normalizeText(n);
296
+ if (t.requireCommentOnApprove && !a) return !1;
297
+ const l = f(e, t), c = e.innerHTML;
298
+ return l.status = "approved", l.signoffs.push({
299
+ id: ke(),
300
+ author: r,
301
+ comment: a || void 0,
302
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
303
+ }), l.signoffs = j(l.signoffs, t.maxHistoryEntries), a && (l.comments.push({
304
+ id: J(),
305
+ author: r,
306
+ message: a,
307
+ kind: "system",
308
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
309
+ }), l.comments = j(l.comments, t.maxHistoryEntries)), G(e, l, t), Y(e), X(e, c), !0;
310
+ }
311
+ function N(e, t) {
312
+ return e.querySelector(`[data-field="${t}"]`);
313
+ }
314
+ function Se(e) {
315
+ const t = N(e, "actor")?.value || "", o = N(e, "comment")?.value || "";
316
+ return { actor: t, comment: o };
317
+ }
318
+ function V(e, t) {
319
+ if (!t.classList.contains("show")) return;
320
+ const n = U(e).getBoundingClientRect(), r = Math.min(window.innerWidth - 20, 420), a = Math.max(10, window.innerWidth - r - 10), l = Math.min(Math.max(10, n.right - r), a), c = Math.max(10, Math.min(window.innerHeight - 10 - 280, n.top + 12));
321
+ t.style.width = `${r}px`, t.style.left = `${l}px`, t.style.top = `${c}px`, t.style.maxHeight = `${Math.max(280, window.innerHeight - 24)}px`;
322
+ }
323
+ function $e(e) {
324
+ const t = k.get(e);
325
+ if (t) return t;
326
+ const o = s.get(e) || R || z(), n = `rte-approval-panel-${me++}`, r = document.createElement("section");
327
+ return r.className = d, r.id = n, r.setAttribute("role", "dialog"), r.setAttribute("aria-modal", "false"), r.setAttribute("aria-label", o.labels.panelAriaLabel), r.setAttribute("tabindex", "-1"), r.innerHTML = `
328
+ <header class="rte-approval-header">
329
+ <h2 class="rte-approval-title">${p(o.labels.panelTitle)}</h2>
330
+ <button type="button" class="rte-approval-icon-btn" data-action="close" aria-label="${p(
331
+ o.labels.closeText
332
+ )}">✕</button>
333
+ </header>
334
+ <div class="rte-approval-body">
335
+ <p class="rte-approval-summary" aria-live="polite"></p>
336
+
337
+ <div class="rte-approval-controls" role="toolbar" aria-label="Approval actions">
338
+ <button type="button" class="rte-approval-btn" data-action="request-review">${p(
339
+ o.labels.requestReviewText
340
+ )}</button>
341
+ <button type="button" class="rte-approval-btn rte-approval-btn-primary" data-action="approve">${p(
342
+ o.labels.approveText
343
+ )}</button>
344
+ <button type="button" class="rte-approval-btn" data-action="reopen-draft">${p(
345
+ o.labels.reopenDraftText
346
+ )}</button>
347
+ </div>
348
+
349
+ <div class="rte-approval-form">
350
+ <label class="rte-approval-label">
351
+ ${p(o.labels.actorLabel)}
352
+ <input type="text" data-field="actor" class="rte-approval-field" autocomplete="off" placeholder="${p(
353
+ o.labels.actorPlaceholder
354
+ )}" />
355
+ </label>
356
+ <label class="rte-approval-label">
357
+ ${p(o.labels.commentLabel)}
358
+ <textarea data-field="comment" class="rte-approval-field" rows="2" placeholder="${p(
359
+ o.labels.commentPlaceholder
360
+ )}"></textarea>
361
+ </label>
362
+ <button type="button" class="rte-approval-btn" data-action="add-comment">${p(
363
+ o.labels.addCommentText
364
+ )}</button>
365
+ </div>
366
+
367
+ <section class="rte-approval-section" aria-label="${p(o.labels.commentsHeading)}">
368
+ <h3 class="rte-approval-section-title">${p(o.labels.commentsHeading)}</h3>
369
+ <ul class="rte-approval-comments-list" role="list"></ul>
370
+ </section>
371
+
372
+ <section class="rte-approval-section" aria-label="${p(o.labels.signoffsHeading)}">
373
+ <h3 class="rte-approval-section-title">${p(o.labels.signoffsHeading)}</h3>
374
+ <ul class="rte-approval-signoffs-list" role="list"></ul>
375
+ </section>
376
+
377
+ <p class="rte-approval-shortcut">${p(o.labels.shortcutText)}</p>
378
+ <span class="rte-approval-live" aria-live="polite"></span>
379
+ </div>
380
+ `, r.addEventListener("click", (a) => {
381
+ const l = a.target;
382
+ if (!l) return;
383
+ const c = l.closest("[data-action]");
384
+ if (!c) return;
385
+ const u = c.getAttribute("data-action") || "", m = s.get(e) || R || o;
386
+ if (s.set(e, m), f(e, m), u === "close") {
387
+ P(e, !0);
388
+ return;
389
+ }
390
+ const i = Se(r);
391
+ if (u === "request-review") {
392
+ E(e, "review", m, i.actor || m.defaultActor) && M(r, "Status changed to review.");
393
+ return;
394
+ }
395
+ if (u === "reopen-draft") {
396
+ E(e, "draft", m, i.actor || m.defaultActor) && M(r, "Status changed to draft.");
397
+ return;
398
+ }
399
+ if (u === "approve") {
400
+ const b = Q(e, m, i.actor, i.comment);
401
+ if (!b && m.requireCommentOnApprove) {
402
+ M(r, m.labels.approveCommentRequiredText);
403
+ return;
404
+ }
405
+ if (b) {
406
+ const $ = N(r, "comment");
407
+ $ && ($.value = ""), M(r, "Document approved and signed off.");
408
+ }
409
+ return;
410
+ }
411
+ if (u === "add-comment") {
412
+ if (!pe(e, i.comment, i.actor, m)) return;
413
+ const $ = N(r, "comment");
414
+ $ && ($.value = ""), M(r, "Comment added.");
415
+ return;
416
+ }
417
+ }), r.addEventListener("keydown", (a) => {
418
+ a.key === "Escape" && (a.preventDefault(), P(e, !0));
419
+ }), K(r, e), document.body.appendChild(r), k.set(e, r), O.set(e, !1), q(e), r;
420
+ }
421
+ function Z(e) {
422
+ return O.get(e) === !0;
423
+ }
424
+ function A(e) {
425
+ D();
426
+ const t = $e(e);
427
+ k.forEach((o, n) => {
428
+ n !== e && P(n, !1);
429
+ }), t.classList.add("show"), O.set(e, !0), C(e, "toggleApprovalWorkflowPanel", !0), K(t, e), V(e, t), q(e);
430
+ }
431
+ function P(e, t = !1) {
432
+ const o = k.get(e);
433
+ o && (o.classList.remove("show"), O.set(e, !1), C(e, "toggleApprovalWorkflowPanel", !1), t && e.focus({ preventScroll: !0 }));
434
+ }
435
+ function de(e, t) {
436
+ const o = Z(e);
437
+ return (typeof t == "boolean" ? t : !o) ? A(e) : P(e), !0;
438
+ }
439
+ function Ee(e) {
440
+ const t = e.key.toLowerCase();
441
+ return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "a";
442
+ }
443
+ function Ce(e) {
444
+ const t = e.key.toLowerCase();
445
+ return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "r";
446
+ }
447
+ function Te(e) {
448
+ const t = e.key.toLowerCase();
449
+ return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "p";
450
+ }
451
+ function Le(e) {
452
+ const t = e.key.toLowerCase();
453
+ return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "d";
454
+ }
455
+ function Re(e) {
456
+ R = e, T || (T = (t) => {
457
+ D();
458
+ const n = t.target?.closest(w);
459
+ if (!n) return;
460
+ v = n;
461
+ const r = s.get(n) || e;
462
+ s.set(n, r), f(n, r);
463
+ const a = k.get(n);
464
+ a && (K(a, n), V(n, a));
465
+ }, document.addEventListener("focusin", T, !0)), L || (L = (t) => {
466
+ if (t.defaultPrevented) return;
467
+ const o = Ee(t), n = Ce(t), r = Te(t), a = Le(t), l = t.key === "Escape";
468
+ if (!l && !o && !n && !r && !a)
469
+ return;
470
+ D();
471
+ const c = t.target, u = !!c?.closest(`.${d} input, .${d} textarea, .${d} select`);
472
+ if (!xe(c) && !we())
473
+ return;
474
+ const i = x(void 0, !1);
475
+ if (!i) return;
476
+ const b = s.get(i) || R || e;
477
+ s.set(i, b);
478
+ const $ = f(i, b);
479
+ if (v = i, l && Z(i)) {
480
+ t.preventDefault(), P(i, !0);
481
+ return;
482
+ }
483
+ if (!u) {
484
+ if (o) {
485
+ t.preventDefault(), t.stopPropagation(), de(i);
486
+ return;
487
+ }
488
+ if (n) {
489
+ t.preventDefault(), t.stopPropagation(), E(i, "review", b, b.defaultActor) && A(i);
490
+ return;
491
+ }
492
+ if (r) {
493
+ t.preventDefault(), t.stopPropagation(), Q(i, b, b.defaultActor, "Approved via keyboard shortcut.") && A(i);
494
+ return;
495
+ }
496
+ a && (t.preventDefault(), t.stopPropagation(), $.status !== "draft" && E(i, "draft", b, b.defaultActor) && A(i));
497
+ }
498
+ }, document.addEventListener("keydown", L, !0)), S || (S = () => {
499
+ D(), k.forEach((t, o) => {
500
+ !o.isConnected || !t.isConnected || (K(t, o), V(o, t));
501
+ });
502
+ }, window.addEventListener("scroll", S, !0), window.addEventListener("resize", S));
503
+ }
504
+ function Me(e) {
505
+ const t = I.get(e);
506
+ t && (e.classList.remove("rte-approval-locked-editor"), e.removeAttribute("data-approval-status"), e.removeAttribute("data-approval-locked"), ie(
507
+ e,
508
+ t.preApprovalContentEditable ?? t.originalContentEditable,
509
+ t.preApprovalReadonly ?? t.originalReadonly
510
+ ));
511
+ }
512
+ function De() {
513
+ T && (document.removeEventListener("focusin", T, !0), T = null), L && (document.removeEventListener("keydown", L, !0), L = null), S && (window.removeEventListener("scroll", S, !0), window.removeEventListener("resize", S), S = null), k.forEach((e) => e.remove()), k.clear(), H.forEach((e) => Me(e)), H.clear(), R = null, v = null;
514
+ }
515
+ function He() {
516
+ if (typeof document > "u" || document.getElementById(te)) return;
517
+ const e = document.createElement("style");
518
+ e.id = te, e.textContent = `
519
+ .rte-toolbar-group-items.${h},
520
+ .editora-toolbar-group-items.${h},
521
+ .rte-toolbar-group-items.${y},
522
+ .editora-toolbar-group-items.${y} {
523
+ display: flex;
524
+ border: 1px solid #ccc;
525
+ border-radius: 3px;
526
+ background: #fff;
527
+ }
528
+
529
+ .rte-toolbar-group-items.${h} .rte-toolbar-button,
530
+ .editora-toolbar-group-items.${h} .editora-toolbar-button,
531
+ .rte-toolbar-group-items.${y} .rte-toolbar-button,
532
+ .editora-toolbar-group-items.${y} .editora-toolbar-button {
533
+ border: none;
534
+ border-radius: 0;
535
+ border-right: 1px solid #ccc;
536
+ }
537
+
538
+ .rte-toolbar-button[data-command="toggleApprovalWorkflowPanel"].active,
539
+ .editora-toolbar-button[data-command="toggleApprovalWorkflowPanel"].active,
540
+ .rte-toolbar-button[data-command="reopenDraft"].active,
541
+ .editora-toolbar-button[data-command="reopenDraft"].active {
542
+ background-color: #ccc;
543
+ }
544
+
545
+ ${g} .rte-toolbar-button[data-command="toggleApprovalWorkflowPanel"].active,
546
+ ${g} .editora-toolbar-button[data-command="toggleApprovalWorkflowPanel"].active,
547
+ ${g} .rte-toolbar-button[data-command="reopenDraft"].active,
548
+ ${g} .editora-toolbar-button[data-command="reopenDraft"].active {
549
+ background: linear-gradient(180deg, #5eaaf6 0%, #4a95de 100%);
550
+ }
551
+
552
+ .rte-toolbar-group-items.${h} .rte-toolbar-item:last-child .rte-toolbar-button,
553
+ .editora-toolbar-group-items.${h} .editora-toolbar-item:last-child .editora-toolbar-button,
554
+ .rte-toolbar-group-items.${y} .rte-toolbar-item:last-child .rte-toolbar-button,
555
+ .editora-toolbar-group-items.${y} .editora-toolbar-item:last-child .editora-toolbar-button {
556
+ border-right: none;
557
+ }
558
+
559
+ ${g} .rte-toolbar-group-items.${h},
560
+ ${g} .editora-toolbar-group-items.${h},
561
+ ${g} .rte-toolbar-group-items.${y},
562
+ ${g} .editora-toolbar-group-items.${y},
563
+ .${d}.rte-approval-theme-dark {
564
+ border-color: #566275;
565
+ }
566
+ ${g} .rte-toolbar-group-items.${h} .rte-toolbar-button svg,
567
+ ${g} .editora-toolbar-group-items.${h} .editora-toolbar-button svg,
568
+ ${g} .rte-toolbar-group-items.${y} .rte-toolbar-button svg,
569
+ ${g} .editora-toolbar-group-items.${y} .editora-toolbar-button svg
570
+ {
571
+ fill: none;
572
+ }
573
+
574
+ ${g} .rte-toolbar-group-items.${h} .rte-toolbar-button,
575
+ ${g} .editora-toolbar-group-items.${h} .editora-toolbar-button
576
+ {
577
+ border-color: #566275;
578
+ }
579
+
580
+ .rte-approval-locked-editor {
581
+ background-image: repeating-linear-gradient(
582
+ -45deg,
583
+ rgba(30, 64, 175, 0.04),
584
+ rgba(30, 64, 175, 0.04) 8px,
585
+ rgba(30, 64, 175, 0.08) 8px,
586
+ rgba(30, 64, 175, 0.08) 16px
587
+ );
588
+ }
589
+
590
+ .${d} {
591
+ position: fixed;
592
+ z-index: 1500;
593
+ right: 16px;
594
+ top: 16px;
595
+ width: min(420px, calc(100vw - 20px));
596
+ max-height: calc(100vh - 24px);
597
+ display: none;
598
+ flex-direction: column;
599
+ border-radius: 12px;
600
+ border: 1px solid #d1d5db;
601
+ background: #ffffff;
602
+ color: #0f172a;
603
+ box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
604
+ overflow: hidden;
605
+ }
606
+
607
+ .${d}.show {
608
+ display: flex;
609
+ }
610
+
611
+ .${d}.rte-approval-theme-dark {
612
+ background: #0f172a;
613
+ color: #e2e8f0;
614
+ border-color: #334155;
615
+ box-shadow: 0 20px 40px rgba(2, 6, 23, 0.5);
616
+ }
617
+
618
+ .rte-approval-header {
619
+ display: flex;
620
+ align-items: center;
621
+ justify-content: space-between;
622
+ padding: 10px 12px;
623
+ border-bottom: 1px solid #e2e8f0;
624
+ background: #f8fafc;
625
+ }
626
+
627
+ .${d}.rte-approval-theme-dark .rte-approval-header {
628
+ border-bottom-color: #334155;
629
+ background: #111827;
630
+ }
631
+
632
+ .rte-approval-title {
633
+ margin: 0;
634
+ font-size: 14px;
635
+ font-weight: 700;
636
+ }
637
+
638
+ .rte-approval-icon-btn {
639
+ border: 1px solid #cbd5e1;
640
+ background: #ffffff;
641
+ color: #0f172a;
642
+ border-radius: 6px;
643
+ cursor: pointer;
644
+ min-width: 34px;
645
+ min-height: 34px;
646
+ width: 34px;
647
+ height: 34px;
648
+ padding: 0;
649
+ display: inline-flex;
650
+ align-items: center;
651
+ justify-content: center;
652
+ font-size: 16px;
653
+ line-height: 1;
654
+ font-weight: 600;
655
+ }
656
+
657
+ .rte-approval-icon-btn:hover,
658
+ .rte-approval-icon-btn:focus-visible {
659
+ outline: none;
660
+ border-color: #3b82f6;
661
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
662
+ }
663
+
664
+ .${d}.rte-approval-theme-dark .rte-approval-icon-btn {
665
+ background: #0f172a;
666
+ border-color: #475569;
667
+ color: #e2e8f0;
668
+ }
669
+
670
+ .${d}.rte-approval-theme-dark .rte-approval-icon-btn:hover,
671
+ .${d}.rte-approval-theme-dark .rte-approval-icon-btn:focus-visible {
672
+ border-color: #60a5fa;
673
+ box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.24);
674
+ }
675
+
676
+ .rte-approval-body {
677
+ display: flex;
678
+ flex-direction: column;
679
+ gap: 10px;
680
+ padding: 12px;
681
+ overflow: auto;
682
+ }
683
+
684
+ .rte-approval-summary {
685
+ margin: 0;
686
+ font-size: 12px;
687
+ color: #475569;
688
+ }
689
+
690
+ .${d}.rte-approval-theme-dark .rte-approval-summary {
691
+ color: #94a3b8;
692
+ }
693
+
694
+ .rte-approval-controls {
695
+ display: flex;
696
+ flex-wrap: wrap;
697
+ gap: 8px;
698
+ }
699
+
700
+ .rte-approval-btn {
701
+ border: 1px solid #cbd5e1;
702
+ background: #f8fafc;
703
+ color: inherit;
704
+ border-radius: 8px;
705
+ padding: 6px 10px;
706
+ font-size: 12px;
707
+ font-weight: 600;
708
+ cursor: pointer;
709
+ }
710
+
711
+ .rte-approval-btn:disabled {
712
+ opacity: 0.5;
713
+ cursor: not-allowed;
714
+ }
715
+
716
+ .rte-approval-btn:hover:not(:disabled),
717
+ .rte-approval-btn:focus-visible:not(:disabled) {
718
+ outline: none;
719
+ border-color: #1d4ed8;
720
+ box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.2);
721
+ }
722
+
723
+ .rte-approval-btn-primary {
724
+ background: #1d4ed8;
725
+ border-color: #1d4ed8;
726
+ color: #ffffff;
727
+ }
728
+
729
+ .rte-approval-btn-primary:hover:not(:disabled),
730
+ .rte-approval-btn-primary:focus-visible:not(:disabled) {
731
+ background: #1e40af;
732
+ border-color: #1e40af;
733
+ }
734
+
735
+ .${d}.rte-approval-theme-dark .rte-approval-btn {
736
+ border-color: #334155;
737
+ background: #0b1220;
738
+ color: #e2e8f0;
739
+ }
740
+
741
+ .${d}.rte-approval-theme-dark .rte-approval-btn-primary {
742
+ border-color: #2563eb;
743
+ background: #2563eb;
744
+ color: #ffffff;
745
+ }
746
+
747
+ .rte-approval-form {
748
+ display: grid;
749
+ grid-template-columns: 1fr;
750
+ gap: 8px;
751
+ border: 1px solid #e2e8f0;
752
+ border-radius: 10px;
753
+ padding: 8px;
754
+ }
755
+
756
+ .${d}.rte-approval-theme-dark .rte-approval-form {
757
+ border-color: #334155;
758
+ }
759
+
760
+ .rte-approval-label {
761
+ display: flex;
762
+ flex-direction: column;
763
+ gap: 4px;
764
+ font-size: 12px;
765
+ font-weight: 600;
766
+ }
767
+
768
+ .rte-approval-field {
769
+ width: 100%;
770
+ box-sizing: border-box;
771
+ min-height: 30px;
772
+ border-radius: 8px;
773
+ border: 1px solid #cbd5e1;
774
+ background: #ffffff;
775
+ color: inherit;
776
+ font-size: 13px;
777
+ padding: 6px 8px;
778
+ }
779
+
780
+ .rte-approval-field:focus-visible {
781
+ outline: none;
782
+ border-color: #1d4ed8;
783
+ box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.2);
784
+ }
785
+
786
+ .${d}.rte-approval-theme-dark .rte-approval-field {
787
+ border-color: #334155;
788
+ background: #0b1220;
789
+ color: #e2e8f0;
790
+ }
791
+
792
+ .rte-approval-section {
793
+ border: 1px solid #e2e8f0;
794
+ border-radius: 10px;
795
+ padding: 8px;
796
+ }
797
+
798
+ .${d}.rte-approval-theme-dark .rte-approval-section {
799
+ border-color: #334155;
800
+ }
801
+
802
+ .rte-approval-section-title {
803
+ margin: 0 0 8px;
804
+ font-size: 12px;
805
+ font-weight: 700;
806
+ }
807
+
808
+ .rte-approval-comments-list,
809
+ .rte-approval-signoffs-list {
810
+ margin: 0;
811
+ padding: 0;
812
+ list-style: none;
813
+ display: flex;
814
+ flex-direction: column;
815
+ gap: 6px;
816
+ max-height: 150px;
817
+ overflow: auto;
818
+ }
819
+
820
+ .rte-approval-item {
821
+ border: 1px solid #dbeafe;
822
+ background: #eff6ff;
823
+ border-radius: 8px;
824
+ padding: 6px;
825
+ }
826
+
827
+ .rte-approval-item-comment {
828
+ border-color: #e2e8f0;
829
+ background: #f8fafc;
830
+ }
831
+
832
+ .${d}.rte-approval-theme-dark .rte-approval-item {
833
+ border-color: #334155;
834
+ background: #111827;
835
+ }
836
+
837
+ .rte-approval-item-head {
838
+ display: flex;
839
+ align-items: center;
840
+ justify-content: space-between;
841
+ gap: 8px;
842
+ margin-bottom: 4px;
843
+ }
844
+
845
+ .rte-approval-item-author {
846
+ font-size: 12px;
847
+ font-weight: 700;
848
+ }
849
+
850
+ .rte-approval-item-time {
851
+ font-size: 11px;
852
+ color: #64748b;
853
+ }
854
+
855
+ .${d}.rte-approval-theme-dark .rte-approval-item-time {
856
+ color: #94a3b8;
857
+ }
858
+
859
+ .rte-approval-item-message {
860
+ margin: 0;
861
+ font-size: 12px;
862
+ line-height: 1.35;
863
+ white-space: pre-wrap;
864
+ }
865
+
866
+ .rte-approval-empty {
867
+ border: 1px dashed #cbd5e1;
868
+ border-radius: 8px;
869
+ padding: 8px;
870
+ font-size: 12px;
871
+ color: #64748b;
872
+ }
873
+
874
+ .${d}.rte-approval-theme-dark .rte-approval-empty {
875
+ border-color: #334155;
876
+ color: #94a3b8;
877
+ }
878
+
879
+ .rte-approval-shortcut {
880
+ margin: 0;
881
+ font-size: 11px;
882
+ color: #64748b;
883
+ }
884
+
885
+ .${d}.rte-approval-theme-dark .rte-approval-shortcut {
886
+ color: #94a3b8;
887
+ }
888
+
889
+ .rte-approval-live {
890
+ position: absolute;
891
+ width: 1px;
892
+ height: 1px;
893
+ margin: -1px;
894
+ padding: 0;
895
+ overflow: hidden;
896
+ clip: rect(0 0 0 0);
897
+ border: 0;
898
+ }
899
+
900
+ @media (max-width: 768px) {
901
+ .${d} {
902
+ left: 10px !important;
903
+ right: 10px;
904
+ top: 10px !important;
905
+ width: auto !important;
906
+ max-height: calc(100vh - 20px);
907
+ }
908
+ }
909
+ `, document.head.appendChild(e);
910
+ }
911
+ const qe = (e = {}) => {
912
+ const t = z(e);
913
+ return He(), {
914
+ name: "approvalWorkflow",
915
+ toolbar: [
916
+ {
917
+ id: "approvalWorkflowGroup",
918
+ label: "Approval",
919
+ type: "group",
920
+ command: "approvalWorkflow",
921
+ items: [
922
+ {
923
+ id: "approvalWorkflow",
924
+ label: "Approval Workflow",
925
+ command: "toggleApprovalWorkflowPanel",
926
+ shortcut: "Mod-Alt-Shift-a",
927
+ icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><rect x="4" y="5" width="16" height="14" rx="2.5" stroke="currentColor" stroke-width="1.7"/><path d="M8 10h8M8 14h5" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/><path d="m16.5 16 1.8 1.8 3.2-3.2" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/></svg>'
928
+ },
929
+ {
930
+ id: "approvalRequestReview",
931
+ label: "Request Review",
932
+ command: "requestApprovalReview",
933
+ shortcut: "Mod-Alt-Shift-r",
934
+ icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><circle cx="11" cy="11" r="6.5" stroke="currentColor" stroke-width="1.7"/><path d="M11 8v3l2 2" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/><path d="M17.5 17.5 20 20" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/></svg>'
935
+ },
936
+ {
937
+ id: "approvalApprove",
938
+ label: "Approve",
939
+ command: "approveDocument",
940
+ shortcut: "Mod-Alt-Shift-p",
941
+ icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M5 12.5 9.5 17 19 7.5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/><rect x="3.8" y="3.8" width="16.4" height="16.4" rx="3" stroke="currentColor" stroke-width="1.4"/></svg>'
942
+ },
943
+ {
944
+ id: "approvalReopen",
945
+ label: "Reopen Draft",
946
+ command: "reopenDraft",
947
+ shortcut: "Mod-Alt-Shift-d",
948
+ icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M8 8H4v4" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/><path d="M5 12a7 7 0 1 0 2-4.95" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/></svg>'
949
+ }
950
+ ]
951
+ }
952
+ ],
953
+ commands: {
954
+ approvalWorkflow: (o, n) => {
955
+ const r = x(n);
956
+ if (!r) return !1;
957
+ const a = s.get(r) || t;
958
+ return s.set(r, a), f(r, a), v = r, A(r), q(r), !0;
959
+ },
960
+ toggleApprovalWorkflowPanel: (o, n) => {
961
+ const r = x(n);
962
+ if (!r) return !1;
963
+ const a = s.get(r) || t;
964
+ return s.set(r, a), f(r, a), v = r, de(r, typeof o == "boolean" ? o : void 0);
965
+ },
966
+ requestApprovalReview: (o, n) => {
967
+ const r = x(n);
968
+ if (!r) return !1;
969
+ const a = s.get(r) || t;
970
+ s.set(r, a), f(r, a);
971
+ const l = E(r, "review", a, a.defaultActor);
972
+ return A(r), l;
973
+ },
974
+ approveDocument: (o, n) => {
975
+ const r = x(n);
976
+ if (!r) return !1;
977
+ const a = s.get(r) || t;
978
+ s.set(r, a), f(r, a);
979
+ const l = typeof o == "object" && o ? String(o.author || "") : a.defaultActor, c = typeof o == "object" && o ? String(o.comment || "") : typeof o == "string" ? o : "", u = Q(r, a, l, c);
980
+ return u && A(r), u;
981
+ },
982
+ reopenDraft: (o, n) => {
983
+ const r = x(n);
984
+ if (!r) return !1;
985
+ const a = s.get(r) || t;
986
+ s.set(r, a), f(r, a);
987
+ const l = E(r, "draft", a, a.defaultActor);
988
+ return l && A(r), l;
989
+ },
990
+ addApprovalComment: (o, n) => {
991
+ const r = x(n);
992
+ if (!r) return !1;
993
+ const a = s.get(r) || t;
994
+ s.set(r, a), f(r, a);
995
+ const l = typeof o == "object" && o ? String(o.author || "") : a.defaultActor, c = typeof o == "object" && o ? String(o.message || "") : typeof o == "string" ? o : "", u = pe(r, c, l, a);
996
+ return u && A(r), u;
997
+ },
998
+ setApprovalStatus: (o, n) => {
999
+ const r = x(n);
1000
+ if (!r || !o) return !1;
1001
+ const a = ne(o), l = s.get(r) || t;
1002
+ s.set(r, l), f(r, l);
1003
+ const c = E(r, a, l, l.defaultActor);
1004
+ return c && A(r), c;
1005
+ },
1006
+ setApprovalWorkflowOptions: (o, n) => {
1007
+ const r = x(n);
1008
+ if (!r || !o || typeof o != "object") return !1;
1009
+ const a = s.get(r) || t, l = z({
1010
+ ...a,
1011
+ ...o,
1012
+ labels: {
1013
+ ...a.labels,
1014
+ ...o.labels || {}
1015
+ },
1016
+ normalizeText: o.normalizeText || a.normalizeText
1017
+ });
1018
+ s.set(r, l);
1019
+ const c = f(r, l);
1020
+ return G(r, c, l), !0;
1021
+ },
1022
+ getApprovalWorkflowState: (o, n) => {
1023
+ const r = x(n);
1024
+ if (!r) return !1;
1025
+ const a = s.get(r) || t;
1026
+ s.set(r, a);
1027
+ const l = f(r, a), c = se(l);
1028
+ if (typeof o == "function")
1029
+ try {
1030
+ o(c);
1031
+ } catch {
1032
+ }
1033
+ return r.__approvalWorkflowState = c, r.dispatchEvent(
1034
+ new CustomEvent("editora:approval-state", {
1035
+ bubbles: !0,
1036
+ detail: {
1037
+ state: c
1038
+ }
1039
+ })
1040
+ ), !0;
1041
+ }
1042
+ },
1043
+ keymap: {
1044
+ "Mod-Alt-Shift-a": "toggleApprovalWorkflowPanel",
1045
+ "Mod-Alt-Shift-A": "toggleApprovalWorkflowPanel",
1046
+ "Mod-Alt-Shift-r": "requestApprovalReview",
1047
+ "Mod-Alt-Shift-R": "requestApprovalReview",
1048
+ "Mod-Alt-Shift-p": "approveDocument",
1049
+ "Mod-Alt-Shift-P": "approveDocument",
1050
+ "Mod-Alt-Shift-d": "reopenDraft",
1051
+ "Mod-Alt-Shift-D": "reopenDraft"
1052
+ },
1053
+ init: function(n) {
1054
+ _ += 1;
1055
+ const r = this && typeof this.__pluginConfig == "object" ? z({ ...t, ...this.__pluginConfig }) : t;
1056
+ Re(r);
1057
+ const a = x(
1058
+ n?.editorElement ? { editorElement: n.editorElement } : void 0,
1059
+ !1
1060
+ );
1061
+ a && (s.set(a, r), f(a, r), v = a, q(a));
1062
+ },
1063
+ destroy: () => {
1064
+ _ = Math.max(0, _ - 1), !(_ > 0) && De();
1065
+ }
1066
+ };
1067
+ };
1068
+ export {
1069
+ qe as ApprovalWorkflowPlugin
1070
+ };