@editora/plugins 1.0.18 → 1.0.20
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.
- package/dist/{CodePlugin.native-Bwf25lLX.js → CodePlugin.native-CKJo7IFG.js} +8 -8
- package/dist/{CodePlugin.native-Cpp4u3Jl.mjs → CodePlugin.native-D8gGxB8i.mjs} +59 -60
- package/dist/code.cjs.js +1 -1
- package/dist/code.esm.js +1 -1
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +1 -1
- package/dist/{documentManager-yjRBab4v.mjs → documentManager-BL98a7YZ.mjs} +402 -404
- package/dist/{documentManager-BDz6tovy.js → documentManager-r8t7yZEd.js} +9 -9
- package/dist/enterprise.cjs.js +1 -1
- package/dist/enterprise.esm.js +1 -1
- package/dist/{index-Bm1eqYHh.mjs → index-B-VitI3v.mjs} +23 -22
- package/dist/{index-CoflqYuK.js → index-D5xugkYA.js} +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/preview.cjs.js +3 -3
- package/dist/preview.esm.js +47 -50
- package/dist/purify.es-B6PsRpEV.js +3 -0
- package/dist/purify.es-DmCsrgBd.mjs +1480 -0
- package/dist/sanitizeHtml-CDoBlNTk.js +1 -0
- package/dist/sanitizeHtml-CtLy8um-.mjs +16 -0
- package/dist/table.cjs.js +14 -14
- package/dist/table.esm.js +158 -150
- package/dist/template.cjs.js +20 -21
- package/dist/template.esm.js +175 -723
- package/package.json +5 -3
package/dist/enterprise.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./mentions.cjs.js"),t=require("./track-changes.cjs.js"),o=require("./version-diff.cjs.js"),l=require("./conditional-content.cjs.js"),r=require("./data-binding.cjs.js"),g=require("./content-rules.cjs.js"),u=require("./citations.cjs.js"),s=require("./approval-workflow.cjs.js"),c=require("./pii-redaction.cjs.js"),P=require("./smart-paste.cjs.js"),m=require("./blocks-library.cjs.js"),C=require("./doc-schema.cjs.js"),d=require("./translation-workflow.cjs.js"),p=require("./slash-commands.cjs.js"),M=require("./spell-check.cjs.js"),T=require("./a11y-checker.cjs.js"),q=require("./comments.cjs.js"),f=require("./merge-tag.cjs.js"),e=require("./template.cjs.js"),n=require("./media-manager.cjs.js"),i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./mentions.cjs.js"),t=require("./track-changes.cjs.js"),o=require("./version-diff.cjs.js"),l=require("./conditional-content.cjs.js"),r=require("./data-binding.cjs.js"),g=require("./content-rules.cjs.js"),u=require("./citations.cjs.js"),s=require("./approval-workflow.cjs.js"),c=require("./pii-redaction.cjs.js"),P=require("./smart-paste.cjs.js"),m=require("./blocks-library.cjs.js"),C=require("./doc-schema.cjs.js"),d=require("./translation-workflow.cjs.js"),p=require("./slash-commands.cjs.js"),M=require("./spell-check.cjs.js"),T=require("./a11y-checker.cjs.js"),q=require("./comments.cjs.js"),f=require("./merge-tag.cjs.js"),e=require("./template.cjs.js"),n=require("./media-manager.cjs.js"),i=require("./index-D5xugkYA.js"),k=require("./collaboration.cjs.js");exports.MentionPlugin=a.MentionPlugin;exports.TrackChangesPlugin=t.TrackChangesPlugin;exports.VersionDiffPlugin=o.VersionDiffPlugin;exports.ConditionalContentPlugin=l.ConditionalContentPlugin;exports.DataBindingPlugin=r.DataBindingPlugin;exports.ContentRulesPlugin=g.ContentRulesPlugin;exports.CitationsPlugin=u.CitationsPlugin;exports.ApprovalWorkflowPlugin=s.ApprovalWorkflowPlugin;exports.PIIRedactionPlugin=c.PIIRedactionPlugin;exports.SmartPastePlugin=P.SmartPastePlugin;exports.BlocksLibraryPlugin=m.BlocksLibraryPlugin;exports.DocSchemaPlugin=C.DocSchemaPlugin;exports.TranslationWorkflowPlugin=d.TranslationWorkflowPlugin;exports.SlashCommandsPlugin=p.SlashCommandsPlugin;exports.SpellCheckPlugin=M.SpellCheckPlugin;exports.A11yCheckerPlugin=T.A11yCheckerPlugin;exports.CommentsPlugin=q.CommentsPlugin;exports.MergeTagPlugin=f.MergeTagPlugin;exports.PREDEFINED_TEMPLATES=e.PREDEFINED_TEMPLATES;exports.TemplatePlugin=e.TemplatePlugin;exports.addCustomTemplate=e.addCustomTemplate;exports.getAllTemplates=e.getAllTemplates;exports.getTemplateCategories=e.getTemplateCategories;exports.getTemplatesByCategory=e.getTemplatesByCategory;exports.sanitizeTemplate=e.sanitizeTemplate;exports.searchTemplates=e.searchTemplates;exports.validateTemplate=e.validateTemplate;exports.MediaManagerPlugin=n.MediaManagerPlugin;exports.getMediaManagerConfig=n.getMediaManagerConfig;exports.setMediaManagerConfig=n.setMediaManagerConfig;exports.DocumentManagerPlugin=i.DocumentManagerPlugin;exports.getDocumentManagerConfig=i.getDocumentManagerConfig;exports.setDocumentManagerConfig=i.setDocumentManagerConfig;exports.CollaborationPlugin=k.CollaborationPlugin;
|
package/dist/enterprise.esm.js
CHANGED
|
@@ -18,7 +18,7 @@ import { CommentsPlugin as L } from "./comments.esm.js";
|
|
|
18
18
|
import { MergeTagPlugin as z } from "./merge-tag.esm.js";
|
|
19
19
|
import { PREDEFINED_TEMPLATES as N, TemplatePlugin as V, addCustomTemplate as _, getAllTemplates as j, getTemplateCategories as q, getTemplatesByCategory as G, sanitizeTemplate as H, searchTemplates as J, validateTemplate as K } from "./template.esm.js";
|
|
20
20
|
import { MediaManagerPlugin as Q, getMediaManagerConfig as U, setMediaManagerConfig as X } from "./media-manager.esm.js";
|
|
21
|
-
import { D as Z, g as $, s as ee } from "./index-
|
|
21
|
+
import { D as Z, g as $, s as ee } from "./index-B-VitI3v.mjs";
|
|
22
22
|
import { CollaborationPlugin as re } from "./collaboration.esm.js";
|
|
23
23
|
export {
|
|
24
24
|
v as A11yCheckerPlugin,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { s } from "./sanitizeHtml-CtLy8um-.mjs";
|
|
2
|
+
import { getGlobalApiConfig as p, buildApiUrl as m, getGlobalApiHeaders as f } from "./shared-config.esm.js";
|
|
3
|
+
const d = "rte-document-manager-styles", b = `
|
|
3
4
|
.rte-toolbar-button[data-busy="true"],
|
|
4
5
|
.rte-docmgr-toolbar-button[data-busy="true"] {
|
|
5
6
|
position: relative;
|
|
@@ -29,13 +30,13 @@ const d = "rte-document-manager-styles", f = `
|
|
|
29
30
|
to { transform: rotate(360deg); }
|
|
30
31
|
}
|
|
31
32
|
`;
|
|
32
|
-
function
|
|
33
|
+
function h() {
|
|
33
34
|
if (typeof document > "u" || document.getElementById(d)) return;
|
|
34
35
|
const n = document.createElement("style");
|
|
35
|
-
n.id = d, n.textContent =
|
|
36
|
+
n.id = d, n.textContent = b, document.head.appendChild(n);
|
|
36
37
|
}
|
|
37
38
|
async function c(n) {
|
|
38
|
-
|
|
39
|
+
h();
|
|
39
40
|
const t = typeof window < "u" ? window.__editoraLastCommandButton : null;
|
|
40
41
|
t && (t.disabled = !0, t.setAttribute("data-busy", "true"), t.setAttribute("aria-busy", "true"));
|
|
41
42
|
try {
|
|
@@ -44,7 +45,7 @@ async function c(n) {
|
|
|
44
45
|
t && (t.disabled = !1, t.removeAttribute("data-busy"), t.removeAttribute("aria-busy"));
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
const
|
|
48
|
+
const E = () => ({
|
|
48
49
|
name: "document-manager",
|
|
49
50
|
toolbar: [
|
|
50
51
|
{
|
|
@@ -93,8 +94,8 @@ const v = () => ({
|
|
|
93
94
|
try {
|
|
94
95
|
const e = n();
|
|
95
96
|
if (e) {
|
|
96
|
-
const { importFromWord: a } = await import("./documentManager-
|
|
97
|
-
e.innerHTML = i, e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
97
|
+
const { importFromWord: a } = await import("./documentManager-BL98a7YZ.mjs"), i = await a(r);
|
|
98
|
+
e.innerHTML = s(i), e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
98
99
|
}
|
|
99
100
|
} catch (e) {
|
|
100
101
|
console.error("Import failed:", e), alert("Failed to import Word document. Please check the console for details.");
|
|
@@ -119,7 +120,7 @@ const v = () => ({
|
|
|
119
120
|
try {
|
|
120
121
|
const t = n();
|
|
121
122
|
if (t) {
|
|
122
|
-
const o = t.innerHTML, { exportToWord: r } = await import("./documentManager-
|
|
123
|
+
const o = t.innerHTML, { exportToWord: r } = await import("./documentManager-BL98a7YZ.mjs");
|
|
123
124
|
await r(o, "document.docx");
|
|
124
125
|
}
|
|
125
126
|
return !0;
|
|
@@ -146,7 +147,7 @@ const v = () => ({
|
|
|
146
147
|
try {
|
|
147
148
|
const t = n();
|
|
148
149
|
if (t) {
|
|
149
|
-
const o = t.innerHTML, { exportToPdf: r } = await import("./documentManager-
|
|
150
|
+
const o = t.innerHTML, { exportToPdf: r } = await import("./documentManager-BL98a7YZ.mjs");
|
|
150
151
|
await r(o, "document.pdf", t);
|
|
151
152
|
} else
|
|
152
153
|
console.error("PDF Export: No editor element found"), alert("No active editor found. Please click in the editor area first.");
|
|
@@ -158,7 +159,7 @@ const v = () => ({
|
|
|
158
159
|
}
|
|
159
160
|
},
|
|
160
161
|
keymap: {}
|
|
161
|
-
}),
|
|
162
|
+
}), g = {
|
|
162
163
|
apiEndpoints: {
|
|
163
164
|
exportWord: "/documents/export-word"
|
|
164
165
|
},
|
|
@@ -170,25 +171,25 @@ const v = () => ({
|
|
|
170
171
|
useClientSideFallback: !0
|
|
171
172
|
// Enable fallback by default
|
|
172
173
|
};
|
|
173
|
-
let l = { ...
|
|
174
|
-
function
|
|
174
|
+
let l = { ...g };
|
|
175
|
+
function A(n) {
|
|
175
176
|
l = { ...l, ...n };
|
|
176
177
|
}
|
|
177
178
|
function u() {
|
|
178
179
|
return { ...l };
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
-
const t = u(), o =
|
|
182
|
-
return
|
|
181
|
+
function w(n) {
|
|
182
|
+
const t = u(), o = p(), r = t.apiUrl || o.apiUrl;
|
|
183
|
+
return m(r, t.apiEndpoints[n]);
|
|
183
184
|
}
|
|
184
|
-
function
|
|
185
|
-
const n =
|
|
185
|
+
function x() {
|
|
186
|
+
const n = f(), o = u().headers || {};
|
|
186
187
|
return { ...n, ...o };
|
|
187
188
|
}
|
|
188
189
|
export {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
E as D,
|
|
191
|
+
w as a,
|
|
192
|
+
x as b,
|
|
192
193
|
u as g,
|
|
193
|
-
|
|
194
|
+
A as s
|
|
194
195
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const l=require("./shared-config.cjs.js"),u="rte-document-manager-styles",
|
|
1
|
+
"use strict";const p=require("./sanitizeHtml-CDoBlNTk.js"),l=require("./shared-config.cjs.js"),u="rte-document-manager-styles",m=`
|
|
2
2
|
.rte-toolbar-button[data-busy="true"],
|
|
3
3
|
.rte-docmgr-toolbar-button[data-busy="true"] {
|
|
4
4
|
position: relative;
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
@keyframes rte-docmgr-spin {
|
|
28
28
|
to { transform: rotate(360deg); }
|
|
29
29
|
}
|
|
30
|
-
`;function
|
|
30
|
+
`;function f(){if(typeof document>"u"||document.getElementById(u))return;const n=document.createElement("style");n.id=u,n.textContent=m,document.head.appendChild(n)}async function s(n){f();const e=typeof window<"u"?window.__editoraLastCommandButton:null;e&&(e.disabled=!0,e.setAttribute("data-busy","true"),e.setAttribute("aria-busy","true"));try{return await n()}finally{e&&(e.disabled=!1,e.removeAttribute("data-busy"),e.removeAttribute("aria-busy"))}}const h=()=>({name:"document-manager",toolbar:[{label:"Import Word",command:"importWord",icon:'<svg width="24" height="24" focusable="false"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 3h7.4L19 7.6V15h-2V9h-4V5H5c0-1.1.9-2 2-2Z"></path><path d="M9.5 7A1.5 1.5 0 0 1 11 8.4v7.1A1.5 1.5 0 0 1 9.6 17H2.5A1.5 1.5 0 0 1 1 15.6V8.5A1.5 1.5 0 0 1 2.4 7h7.1Zm-1 2.8-1 2.6-1-2.5v-.1a.6.6 0 0 0-1 0l-.1.1-.9 2.5-1-2.5v-.1a.6.6 0 0 0-1 .4v.1l1.5 4v.1a.6.6 0 0 0 1 0v-.1l1-2.5.9 2.5v.1a.6.6 0 0 0 1 0H8l1.6-4v-.2a.6.6 0 0 0-1.1-.4Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M11.4 18.2a1 1 0 0 0 1.2 1.6l1.4-1V22a1 1 0 1 0 2 0v-3.1l1.4 1a1 1 0 0 0 1.2-1.7L15 15.8l-3.6 2.4Z"></path></svg>',type:"button"},{label:"Export Word",command:"exportWord",icon:'<svg width="24" height="24" focusable="false"><path d="M9.5 7A1.5 1.5 0 0 1 11 8.4v7.1A1.5 1.5 0 0 1 9.6 17H2.5A1.5 1.5 0 0 1 1 15.6V8.5A1.5 1.5 0 0 1 2.4 7h7.1Zm-1 2.8-1 2.6-1-2.5v-.1a.6.6 0 0 0-1 0l-.1.1-.9 2.5-1-2.5v-.1a.6.6 0 0 0-1 .4v.1l1.5 4v.1a.6.6 0 0 0 1 0v-.1l1-2.5.9 2.5v.1a.6.6 0 0 0 1 0H8l1.6-4v-.2a.6.6 0 0 0-1.1-.4Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M7 3h7.4L19 7.6V17h-2V9h-4V5H7v3H5V5c0-1.1.9-2 2-2ZM15 17a1 1 0 1 0-2 0v3.1l-1.4-1a1 1 0 1 0-1.2 1.7l3.6 2.4 3.6-2.4a1 1 0 0 0-1.2-1.6l-1.4 1V17Z"></path></svg>',type:"button"},{label:"Export PDF",command:"exportPdf",icon:'<svg width="24" height="24" focusable="false"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 3h7.4L19 7.6V17h-2V9h-4V5H7v3H5V5c0-1.1.9-2 2-2Z"></path><path d="M2.6 15.2v-1.9h1c.6 0 1-.2 1.4-.5.3-.3.5-.7.5-1.2s-.2-.9-.5-1.2a2 2 0 0 0-1.3-.4H1v5.2h1.6Zm.4-3h-.4v-1.1h.5l.6.1.2.5c0 .1 0 .3-.2.4l-.7.1Zm5.7 3 1-.1c.3 0 .5-.2.7-.4l.5-.8c.2-.3.2-.7.2-1.3v-1l-.5-.8c-.2-.3-.4-.5-.7-.6L8.7 10H6.3v5.2h2.4Zm-.4-1.1H8v-3h.4c.5 0 .8.2 1 .4l.2 1.1-.1 1-.3.3-.8.2Zm5.3 1.2V13h2v-1h-2v-1H16V10h-4v5.2h1.6Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M15 17a1 1 0 1 0-2 0v3.1l-1.4-1a1 1 0 1 0-1.2 1.7l3.6 2.4 3.6-2.4a1 1 0 0 0-1.2-1.6l-1.4 1V17Z"></path></svg>',type:"button"}],commands:{importWord:()=>{const n=()=>{const o=window.getSelection();if(o&&o.rangeCount>0){let i=o.getRangeAt(0).startContainer;for(;i&&i!==document.body;){if(i.nodeType===Node.ELEMENT_NODE){const a=i;if(a.getAttribute("contenteditable")==="true")return a}i=i.parentNode}}const r=document.activeElement;if(r?.getAttribute("contenteditable")==="true")return r;const t=r?.closest('[contenteditable="true"]');return t||document.querySelector('[contenteditable="true"]')},e=document.createElement("input");return e.type="file",e.accept=".docx",e.onchange=async o=>{const r=o.target.files?.[0];if(r)try{const t=n();if(t){const{importFromWord:i}=await Promise.resolve().then(()=>require("./documentManager-r8t7yZEd.js")),a=await i(r);t.innerHTML=p.sanitizeHtml(a),t.dispatchEvent(new Event("input",{bubbles:!0}))}}catch(t){console.error("Import failed:",t),alert("Failed to import Word document. Please check the console for details.")}},e.click(),!0},exportWord:async()=>{const n=()=>{const e=window.getSelection();if(e&&e.rangeCount>0){let t=e.getRangeAt(0).startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE&&t.getAttribute("contenteditable")==="true")return t;t=t.parentNode}}const o=document.activeElement;return o?.getAttribute("contenteditable")==="true"?o:o?.closest('[contenteditable="true"]')||document.querySelector('[contenteditable="true"]')};return s(async()=>{try{const e=n();if(e){const o=e.innerHTML,{exportToWord:r}=await Promise.resolve().then(()=>require("./documentManager-r8t7yZEd.js"));await r(o,"document.docx")}return!0}catch(e){return console.error("Export failed:",e),alert("Failed to export to Word. Please check the console for details."),!1}})},exportPdf:async()=>{const n=()=>{const e=window.getSelection();if(e&&e.rangeCount>0){let t=e.getRangeAt(0).startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE&&t.getAttribute("contenteditable")==="true")return t;t=t.parentNode}}const o=document.activeElement;return o?.getAttribute("contenteditable")==="true"?o:o?.closest('[contenteditable="true"]')||document.querySelector('[contenteditable="true"]')};return s(async()=>{try{const e=n();if(e){const o=e.innerHTML,{exportToPdf:r}=await Promise.resolve().then(()=>require("./documentManager-r8t7yZEd.js"));await r(o,"document.pdf",e)}else console.error("PDF Export: No editor element found"),alert("No active editor found. Please click in the editor area first.");return!0}catch(e){return console.error("PDF Export: Export failed:",e),alert("Failed to export to PDF. Please check the console for details."),!1}})}},keymap:{}}),b={apiEndpoints:{exportWord:"/documents/export-word"},headers:{},useClientSideFallback:!0};let d={...b};function g(n){d={...d,...n}}function c(){return{...d}}function v(n){const e=c(),o=l.getGlobalApiConfig(),r=e.apiUrl||o.apiUrl;return l.buildApiUrl(r,e.apiEndpoints[n])}function y(){const n=l.getGlobalApiHeaders(),o=c().headers||{};return{...n,...o}}exports.DocumentManagerPlugin=h;exports.getApiHeaders=y;exports.getApiUrl=v;exports.getDocumentManagerConfig=c;exports.setDocumentManagerConfig=g;
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./heading.cjs.js"),r=require("./bold.cjs.js"),o=require("./italic.cjs.js"),u=require("./underline.cjs.js"),a=require("./strikethrough.cjs.js"),g=require("./list.cjs.js"),s=require("./checklist.cjs.js"),P=require("./history.cjs.js"),c=require("./link.cjs.js"),m=require("./blockquote.cjs.js"),C=require("./clear-formatting.cjs.js"),d=require("./CodePlugin.native-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./heading.cjs.js"),r=require("./bold.cjs.js"),o=require("./italic.cjs.js"),u=require("./underline.cjs.js"),a=require("./strikethrough.cjs.js"),g=require("./list.cjs.js"),s=require("./checklist.cjs.js"),P=require("./history.cjs.js"),c=require("./link.cjs.js"),m=require("./blockquote.cjs.js"),C=require("./clear-formatting.cjs.js"),d=require("./CodePlugin.native-CKJo7IFG.js"),q=require("./table.cjs.js"),p=require("./font-size.cjs.js"),h=require("./format-painter.cjs.js"),k=require("./font-family.cjs.js"),f=require("./text-alignment.cjs.js"),T=require("./text-color.cjs.js"),M=require("./background-color.cjs.js"),b=require("./line-height.cjs.js"),S=require("./indent.cjs.js"),A=require("./direction.cjs.js"),D=require("./capitalization.cjs.js"),F=require("./math.cjs.js"),y=require("./special-characters.cjs.js"),B=require("./emojis.cjs.js"),E=require("./embed-iframe.cjs.js"),I=require("./anchor.cjs.js"),v=require("./mentions.cjs.js"),L=require("./track-changes.cjs.js"),w=require("./version-diff.cjs.js"),H=require("./conditional-content.cjs.js"),z=require("./data-binding.cjs.js"),R=require("./content-rules.cjs.js"),x=require("./citations.cjs.js"),G=require("./approval-workflow.cjs.js"),W=require("./pii-redaction.cjs.js"),_=require("./smart-paste.cjs.js"),j=require("./blocks-library.cjs.js"),U=require("./doc-schema.cjs.js"),N=require("./translation-workflow.cjs.js"),V=require("./slash-commands.cjs.js"),n=require("./media-manager.cjs.js"),t=require("./index-D5xugkYA.js"),O=require("./preview.cjs.js"),J=require("./fullscreen.cjs.js"),K=require("./print.cjs.js"),Q=require("./page-break.cjs.js"),X=require("./footnote.cjs.js"),Y=require("./code-sample.cjs.js"),Z=require("./merge-tag.cjs.js"),e=require("./template.cjs.js"),$=require("./comments.cjs.js"),ee=require("./collaboration.cjs.js"),ie=require("./spell-check.cjs.js"),ne=require("./a11y-checker.cjs.js"),i=require("./shared-config.cjs.js");exports.HeadingPlugin=l.HeadingPlugin;exports.BoldPlugin=r.BoldPlugin;exports.ItalicPlugin=o.ItalicPlugin;exports.UnderlinePlugin=u.UnderlinePlugin;exports.StrikethroughPlugin=a.StrikethroughPlugin;exports.ListPlugin=g.ListPlugin;exports.ChecklistPlugin=s.ChecklistPlugin;exports.HistoryPlugin=P.HistoryPlugin;exports.LinkPlugin=c.LinkPlugin;exports.BlockquotePlugin=m.BlockquotePlugin;exports.ClearFormattingPlugin=C.ClearFormattingPlugin;exports.CodePlugin=d.CodePlugin;exports.TablePlugin=q.TablePlugin;exports.FontSizePlugin=p.FontSizePlugin;exports.FormatPainterPlugin=h.FormatPainterPlugin;exports.FontFamilyPlugin=k.FontFamilyPlugin;exports.TextAlignmentPlugin=f.TextAlignmentPlugin;exports.TextColorPlugin=T.TextColorPlugin;exports.BackgroundColorPlugin=M.BackgroundColorPlugin;exports.LineHeightPlugin=b.LineHeightPlugin;exports.IndentPlugin=S.IndentPlugin;exports.DirectionPlugin=A.DirectionPlugin;exports.CapitalizationPlugin=D.CapitalizationPlugin;exports.MathPlugin=F.MathPlugin;exports.SpecialCharactersPlugin=y.SpecialCharactersPlugin;exports.EmojisPlugin=B.EmojisPlugin;exports.EmbedIframePlugin=E.EmbedIframePlugin;exports.AnchorPlugin=I.AnchorPlugin;exports.MentionPlugin=v.MentionPlugin;exports.TrackChangesPlugin=L.TrackChangesPlugin;exports.VersionDiffPlugin=w.VersionDiffPlugin;exports.ConditionalContentPlugin=H.ConditionalContentPlugin;exports.DataBindingPlugin=z.DataBindingPlugin;exports.ContentRulesPlugin=R.ContentRulesPlugin;exports.CitationsPlugin=x.CitationsPlugin;exports.ApprovalWorkflowPlugin=G.ApprovalWorkflowPlugin;exports.PIIRedactionPlugin=W.PIIRedactionPlugin;exports.SmartPastePlugin=_.SmartPastePlugin;exports.BlocksLibraryPlugin=j.BlocksLibraryPlugin;exports.DocSchemaPlugin=U.DocSchemaPlugin;exports.TranslationWorkflowPlugin=N.TranslationWorkflowPlugin;exports.SlashCommandsPlugin=V.SlashCommandsPlugin;exports.MediaManagerPlugin=n.MediaManagerPlugin;exports.getMediaManagerConfig=n.getMediaManagerConfig;exports.setMediaManagerConfig=n.setMediaManagerConfig;exports.DocumentManagerPlugin=t.DocumentManagerPlugin;exports.getDocumentManagerConfig=t.getDocumentManagerConfig;exports.setDocumentManagerConfig=t.setDocumentManagerConfig;exports.PreviewPlugin=O.PreviewPlugin;exports.FullscreenPlugin=J.FullscreenPlugin;exports.PrintPlugin=K.PrintPlugin;exports.PageBreakPlugin=Q.PageBreakPlugin;exports.FootnotePlugin=X.FootnotePlugin;exports.CodeSamplePlugin=Y.CodeSamplePlugin;exports.MergeTagPlugin=Z.MergeTagPlugin;exports.PREDEFINED_TEMPLATES=e.PREDEFINED_TEMPLATES;exports.TemplatePlugin=e.TemplatePlugin;exports.addCustomTemplate=e.addCustomTemplate;exports.getAllTemplates=e.getAllTemplates;exports.getTemplateCategories=e.getTemplateCategories;exports.getTemplatesByCategory=e.getTemplatesByCategory;exports.sanitizeTemplate=e.sanitizeTemplate;exports.searchTemplates=e.searchTemplates;exports.validateTemplate=e.validateTemplate;exports.CommentsPlugin=$.CommentsPlugin;exports.CollaborationPlugin=ee.CollaborationPlugin;exports.SpellCheckPlugin=ie.SpellCheckPlugin;exports.A11yCheckerPlugin=ne.A11yCheckerPlugin;exports.buildApiUrl=i.buildApiUrl;exports.getGlobalApiConfig=i.getGlobalApiConfig;exports.getGlobalApiHeaders=i.getGlobalApiHeaders;exports.setGlobalApiConfig=i.setGlobalApiConfig;
|
package/dist/index.esm.js
CHANGED
|
@@ -9,7 +9,7 @@ import { HistoryPlugin as C } from "./history.esm.js";
|
|
|
9
9
|
import { LinkPlugin as d } from "./link.esm.js";
|
|
10
10
|
import { BlockquotePlugin as h } from "./blockquote.esm.js";
|
|
11
11
|
import { ClearFormattingPlugin as k } from "./clear-formatting.esm.js";
|
|
12
|
-
import { C as D } from "./CodePlugin.native-
|
|
12
|
+
import { C as D } from "./CodePlugin.native-D8gGxB8i.mjs";
|
|
13
13
|
import { TablePlugin as b } from "./table.esm.js";
|
|
14
14
|
import { FontSizePlugin as B } from "./font-size.esm.js";
|
|
15
15
|
import { FormatPainterPlugin as y } from "./format-painter.esm.js";
|
|
@@ -41,7 +41,7 @@ import { DocSchemaPlugin as Fo } from "./doc-schema.esm.js";
|
|
|
41
41
|
import { TranslationWorkflowPlugin as Eo } from "./translation-workflow.esm.js";
|
|
42
42
|
import { SlashCommandsPlugin as Io } from "./slash-commands.esm.js";
|
|
43
43
|
import { MediaManagerPlugin as Ho, getMediaManagerConfig as vo, setMediaManagerConfig as wo } from "./media-manager.esm.js";
|
|
44
|
-
import { D as Go, g as Ro, s as Uo } from "./index-
|
|
44
|
+
import { D as Go, g as Ro, s as Uo } from "./index-B-VitI3v.mjs";
|
|
45
45
|
import { PreviewPlugin as jo } from "./preview.esm.js";
|
|
46
46
|
import { FullscreenPlugin as No } from "./fullscreen.esm.js";
|
|
47
47
|
import { PrintPlugin as _o } from "./print.esm.js";
|
package/dist/preview.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("./dialogHelpers-zU6zpMIA.js");let
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("./dialogHelpers-zU6zpMIA.js"),h=require("./sanitizeHtml-CDoBlNTk.js");let a=!1,s=null;const w=()=>{if(typeof document>"u")return;const r="rte-preview-plugin-styles";if(document.getElementById(r))return;const t=document.createElement("style");t.id=r,t.textContent=`
|
|
2
2
|
/* Preview Editor Dialog Styles */
|
|
3
3
|
.rte-preview-editor-overlay {
|
|
4
4
|
position: fixed !important;
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
font-size: 14px;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
`,document.head.appendChild(t)},u=()=>{const
|
|
220
|
+
`,document.head.appendChild(t)},u=()=>{const r=window.getSelection();if(r&&r.rangeCount>0){let e=r.getRangeAt(0).startContainer;for(;e&&e!==document.body;){if(e.nodeType===Node.ELEMENT_NODE){const i=e;if(i.getAttribute("contenteditable")==="true")return i}e=e.parentNode}}const t=document.activeElement;if(t){if(t.getAttribute("contenteditable")==="true")return t;const e=t.closest('[contenteditable="true"]');if(e)return e}return document.querySelector('[contenteditable="true"]')},f=()=>{const r=u();if(!r)return"";const t=r.cloneNode(!0);return[".rte-floating-toolbar",".rte-selection-marker",".rte-toolbar",".rte-resize-handle","[data-rte-internal]"].forEach(i=>{t.querySelectorAll(i).forEach(n=>n.remove())}),t.innerHTML},b=r=>{const t=document.createElement("template");return t.innerHTML=h.sanitizeHtml(r),t.content.querySelectorAll("*").forEach(e=>{e.setAttribute("contenteditable","false")}),t.innerHTML},x=()=>{if(typeof window>"u"||a)return;a=!0,w();const r=f(),t=b(r),e=document.createElement("div");v.initDialogOverlay(e),e.className="rte-preview-editor-overlay",e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-labelledby","preview-editor-title");const i=document.createElement("div");i.className="rte-preview-editor-modal";const n=document.createElement("div");n.className="rte-preview-editor-header",n.innerHTML=`
|
|
221
221
|
<h2 id="preview-editor-title">Preview Editor</h2>
|
|
222
222
|
<div class="rte-preview-editor-header-actions">
|
|
223
223
|
<button class="rte-preview-editor-close-btn" aria-label="Close preview editor">
|
|
@@ -227,4 +227,4 @@
|
|
|
227
227
|
</svg>
|
|
228
228
|
</button>
|
|
229
229
|
</div>
|
|
230
|
-
`;const
|
|
230
|
+
`;const l=document.createElement("div");l.className="rte-preview-editor-body";const p=document.createElement("div");p.className="rte-preview-editor-content";const c=document.createElement("div");c.className="rte-preview-editor-light-editor",c.innerHTML=t,p.appendChild(c),l.appendChild(p),i.appendChild(n),i.appendChild(l),e.appendChild(i);const d=()=>{e.parentNode&&e.parentNode.removeChild(e),a=!1,s=null,document.removeEventListener("keydown",g)};s=d;const g=o=>{o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),d())},m=n.querySelector(".rte-preview-editor-close-btn");m&&m.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),d()}),e.addEventListener("click",o=>{o.target===e&&d()}),document.addEventListener("keydown",g),document.body.appendChild(e)},y=()=>({name:"preview",toolbar:[{label:"Preview",command:"togglePreview",icon:'<svg fill="#000000" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 92 92" enable-background="new 0 0 92 92" xml:space="preserve"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path id="XMLID_1239_" d="M91.3,43.8C90.6,42.8,74.4,19,46,19C17.6,19,1.4,42.8,0.7,43.8c-0.9,1.3-0.9,3.1,0,4.5 C1.4,49.2,17.6,73,46,73c28.4,0,44.6-23.8,45.3-24.8C92.2,46.9,92.2,45.1,91.3,43.8z M46,65C26.7,65,13.5,51.4,9,46 c4.5-5.5,17.6-19,37-19c19.3,0,32.5,13.6,37,19C78.4,51.5,65.3,65,46,65z M48.3,29.6c-4.4-0.6-8.7,0.5-12.3,3.2c0,0,0,0,0,0 c-7.3,5.5-8.8,15.9-3.3,23.2c2.7,3.6,6.5,5.8,10.9,6.5c0.8,0.1,1.6,0.2,2.3,0.2c3.6,0,7-1.2,9.9-3.3c7.3-5.5,8.8-15.9,3.3-23.2 C56.6,32.5,52.7,30.2,48.3,29.6z M52.3,54.5c-2.2,1.7-5,2.4-7.8,2c-2.8-0.4-5.3-1.9-7-4.1C34.1,47.7,35,41,39.7,37.5 c2.2-1.7,5-2.4,7.8-2c2.8,0.4,5.3,1.9,7,4.1C57.9,44.3,57,51,52.3,54.5z M51.9,40c0.8,0.7,1.2,1.8,1.2,2.8c0,1-0.4,2.1-1.2,2.8 c-0.7,0.7-1.8,1.2-2.8,1.2c-1.1,0-2.1-0.4-2.8-1.2c-0.8-0.8-1.2-1.8-1.2-2.8c0-1.1,0.4-2.1,1.2-2.8c0.7-0.8,1.8-1.2,2.8-1.2 C50.2,38.9,51.2,39.3,51.9,40z"></path> </g></svg>'}],commands:{togglePreview:()=>(a?s?.():x(),!0)},keymap:{}});exports.PreviewPlugin=y;
|
package/dist/preview.esm.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { i as v } from "./dialogHelpers-5d5BuOCW.mjs";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { s as h } from "./sanitizeHtml-CtLy8um-.mjs";
|
|
3
|
+
let a = !1, s = null;
|
|
4
|
+
const w = () => {
|
|
4
5
|
if (typeof document > "u") return;
|
|
5
|
-
const
|
|
6
|
-
if (document.getElementById(
|
|
6
|
+
const r = "rte-preview-plugin-styles";
|
|
7
|
+
if (document.getElementById(r)) return;
|
|
7
8
|
const t = document.createElement("style");
|
|
8
|
-
t.id =
|
|
9
|
+
t.id = r, t.textContent = `
|
|
9
10
|
/* Preview Editor Dialog Styles */
|
|
10
11
|
.rte-preview-editor-overlay {
|
|
11
12
|
position: fixed !important;
|
|
@@ -225,15 +226,15 @@ const h = () => {
|
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
228
|
`, document.head.appendChild(t);
|
|
228
|
-
},
|
|
229
|
-
const
|
|
230
|
-
if (
|
|
231
|
-
let e =
|
|
229
|
+
}, u = () => {
|
|
230
|
+
const r = window.getSelection();
|
|
231
|
+
if (r && r.rangeCount > 0) {
|
|
232
|
+
let e = r.getRangeAt(0).startContainer;
|
|
232
233
|
for (; e && e !== document.body; ) {
|
|
233
234
|
if (e.nodeType === Node.ELEMENT_NODE) {
|
|
234
|
-
const
|
|
235
|
-
if (
|
|
236
|
-
return
|
|
235
|
+
const i = e;
|
|
236
|
+
if (i.getAttribute("contenteditable") === "true")
|
|
237
|
+
return i;
|
|
237
238
|
}
|
|
238
239
|
e = e.parentNode;
|
|
239
240
|
}
|
|
@@ -246,37 +247,33 @@ const h = () => {
|
|
|
246
247
|
if (e) return e;
|
|
247
248
|
}
|
|
248
249
|
return document.querySelector('[contenteditable="true"]');
|
|
249
|
-
},
|
|
250
|
-
const
|
|
251
|
-
if (!
|
|
252
|
-
const t =
|
|
250
|
+
}, f = () => {
|
|
251
|
+
const r = u();
|
|
252
|
+
if (!r) return "";
|
|
253
|
+
const t = r.cloneNode(!0);
|
|
253
254
|
return [
|
|
254
255
|
".rte-floating-toolbar",
|
|
255
256
|
".rte-selection-marker",
|
|
256
257
|
".rte-toolbar",
|
|
257
258
|
".rte-resize-handle",
|
|
258
259
|
"[data-rte-internal]"
|
|
259
|
-
].forEach((
|
|
260
|
-
t.querySelectorAll(
|
|
260
|
+
].forEach((i) => {
|
|
261
|
+
t.querySelectorAll(i).forEach((n) => n.remove());
|
|
261
262
|
}), t.innerHTML;
|
|
262
|
-
},
|
|
263
|
-
const t = document.createElement("
|
|
264
|
-
return t.innerHTML =
|
|
265
|
-
|
|
266
|
-
).forEach((r) => r.remove()), t.querySelectorAll("*").forEach((r) => {
|
|
267
|
-
Array.from(r.attributes).forEach((o) => {
|
|
268
|
-
o.name.startsWith("on") && r.removeAttribute(o.name), (o.name === "href" || o.name === "src") && o.value.startsWith("javascript:") && r.removeAttribute(o.name), o.name.toLowerCase() === "contenteditable" && r.removeAttribute(o.name);
|
|
269
|
-
}), r.setAttribute("contenteditable", "false");
|
|
263
|
+
}, x = (r) => {
|
|
264
|
+
const t = document.createElement("template");
|
|
265
|
+
return t.innerHTML = h(r), t.content.querySelectorAll("*").forEach((e) => {
|
|
266
|
+
e.setAttribute("contenteditable", "false");
|
|
270
267
|
}), t.innerHTML;
|
|
271
268
|
}, b = () => {
|
|
272
|
-
if (typeof window > "u" ||
|
|
273
|
-
|
|
274
|
-
const
|
|
269
|
+
if (typeof window > "u" || a) return;
|
|
270
|
+
a = !0, w();
|
|
271
|
+
const r = f(), t = x(r), e = document.createElement("div");
|
|
275
272
|
v(e), e.className = "rte-preview-editor-overlay", e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.setAttribute("aria-labelledby", "preview-editor-title");
|
|
273
|
+
const i = document.createElement("div");
|
|
274
|
+
i.className = "rte-preview-editor-modal";
|
|
276
275
|
const n = document.createElement("div");
|
|
277
|
-
n.className = "rte-preview-editor-
|
|
278
|
-
const r = document.createElement("div");
|
|
279
|
-
r.className = "rte-preview-editor-header", r.innerHTML = `
|
|
276
|
+
n.className = "rte-preview-editor-header", n.innerHTML = `
|
|
280
277
|
<h2 id="preview-editor-title">Preview Editor</h2>
|
|
281
278
|
<div class="rte-preview-editor-header-actions">
|
|
282
279
|
<button class="rte-preview-editor-close-btn" aria-label="Close preview editor">
|
|
@@ -287,25 +284,25 @@ const h = () => {
|
|
|
287
284
|
</button>
|
|
288
285
|
</div>
|
|
289
286
|
`;
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
const c = document.createElement("div");
|
|
293
|
-
c.className = "rte-preview-editor-content";
|
|
287
|
+
const l = document.createElement("div");
|
|
288
|
+
l.className = "rte-preview-editor-body";
|
|
294
289
|
const p = document.createElement("div");
|
|
295
|
-
p.className = "rte-preview-editor-
|
|
296
|
-
const
|
|
297
|
-
|
|
290
|
+
p.className = "rte-preview-editor-content";
|
|
291
|
+
const c = document.createElement("div");
|
|
292
|
+
c.className = "rte-preview-editor-light-editor", c.innerHTML = t, p.appendChild(c), l.appendChild(p), i.appendChild(n), i.appendChild(l), e.appendChild(i);
|
|
293
|
+
const d = () => {
|
|
294
|
+
e.parentNode && e.parentNode.removeChild(e), a = !1, s = null, document.removeEventListener("keydown", m);
|
|
298
295
|
};
|
|
299
|
-
s =
|
|
300
|
-
const m = (
|
|
301
|
-
|
|
302
|
-
}, g =
|
|
303
|
-
g && g.addEventListener("click", (
|
|
304
|
-
|
|
305
|
-
}), e.addEventListener("click", (
|
|
306
|
-
|
|
296
|
+
s = d;
|
|
297
|
+
const m = (o) => {
|
|
298
|
+
o.key === "Escape" && (o.preventDefault(), o.stopPropagation(), d());
|
|
299
|
+
}, g = n.querySelector(".rte-preview-editor-close-btn");
|
|
300
|
+
g && g.addEventListener("click", (o) => {
|
|
301
|
+
o.preventDefault(), o.stopPropagation(), d();
|
|
302
|
+
}), e.addEventListener("click", (o) => {
|
|
303
|
+
o.target === e && d();
|
|
307
304
|
}), document.addEventListener("keydown", m), document.body.appendChild(e);
|
|
308
|
-
},
|
|
305
|
+
}, E = () => ({
|
|
309
306
|
name: "preview",
|
|
310
307
|
toolbar: [
|
|
311
308
|
{
|
|
@@ -315,10 +312,10 @@ const h = () => {
|
|
|
315
312
|
}
|
|
316
313
|
],
|
|
317
314
|
commands: {
|
|
318
|
-
togglePreview: () => (
|
|
315
|
+
togglePreview: () => (a ? s?.() : b(), !0)
|
|
319
316
|
},
|
|
320
317
|
keymap: {}
|
|
321
318
|
});
|
|
322
319
|
export {
|
|
323
|
-
|
|
320
|
+
E as PreviewPlugin
|
|
324
321
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";function Ye(r,i){(i==null||i>r.length)&&(i=r.length);for(var s=0,c=Array(i);s<i;s++)c[s]=r[s];return c}function Hn(r){if(Array.isArray(r))return r}function Gn(r,i){var s=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(s!=null){var c,u,d,S,ut=[],w=!0,At=!1;try{if(d=(s=s.call(r)).next,i!==0)for(;!(w=(c=d.call(s)).done)&&(ut.push(c.value),ut.length!==i);w=!0);}catch(q){At=!0,u=q}finally{try{if(!w&&s.return!=null&&(S=s.return(),Object(S)!==S))return}finally{if(At)throw u}}return ut}}function Wn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bn(r,i){return Hn(r)||Gn(r,i)||Yn(r,i)||Wn()}function Yn(r,i){if(r){if(typeof r=="string")return Ye(r,i);var s={}.toString.call(r).slice(8,-1);return s==="Object"&&r.constructor&&(s=r.constructor.name),s==="Map"||s==="Set"?Array.from(r):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?Ye(r,i):void 0}}const an=Object.entries,je=Object.setPrototypeOf,jn=Object.isFrozen,Xn=Object.getPrototypeOf,$n=Object.getOwnPropertyDescriptor;let y=Object.freeze,b=Object.seal,lt=Object.create,sn=typeof Reflect<"u"&&Reflect,le=sn.apply,ce=sn.construct;y||(y=function(i){return i});b||(b=function(i){return i});le||(le=function(i,s){for(var c=arguments.length,u=new Array(c>2?c-2:0),d=2;d<c;d++)u[d-2]=arguments[d];return i.apply(s,u)});ce||(ce=function(i){for(var s=arguments.length,c=new Array(s>1?s-1:0),u=1;u<s;u++)c[u-1]=arguments[u];return new i(...c)});const V=A(Array.prototype.forEach),Vn=A(Array.prototype.lastIndexOf),Xe=A(Array.prototype.pop),ht=A(Array.prototype.push),qn=A(Array.prototype.splice),ct=Array.isArray,Et=A(String.prototype.toLowerCase),ne=A(String.prototype.toString),$e=A(String.prototype.match),_t=A(String.prototype.replace),Ve=A(String.prototype.indexOf),Kn=A(String.prototype.trim),Zn=A(Number.prototype.toString),Jn=A(Boolean.prototype.toString),qe=typeof BigInt>"u"?null:A(BigInt.prototype.toString),Ke=typeof Symbol>"u"?null:A(Symbol.prototype.toString),D=A(Object.prototype.hasOwnProperty),gt=A(Object.prototype.toString),O=A(RegExp.prototype.test),G=Qn(TypeError);function A(r){return function(i){i instanceof RegExp&&(i.lastIndex=0);for(var s=arguments.length,c=new Array(s>1?s-1:0),u=1;u<s;u++)c[u-1]=arguments[u];return le(r,i,c)}}function Qn(r){return function(){for(var i=arguments.length,s=new Array(i),c=0;c<i;c++)s[c]=arguments[c];return ce(r,s)}}function m(r,i){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Et;if(je&&je(r,null),!ct(i))return r;let c=i.length;for(;c--;){let u=i[c];if(typeof u=="string"){const d=s(u);d!==u&&(jn(i)||(i[c]=d),u=d)}r[u]=!0}return r}function to(r){for(let i=0;i<r.length;i++)D(r,i)||(r[i]=null);return r}function C(r){const i=lt(null);for(const c of an(r)){var s=Bn(c,2);const u=s[0],d=s[1];D(r,u)&&(ct(d)?i[u]=to(d):d&&typeof d=="object"&&d.constructor===Object?i[u]=C(d):i[u]=d)}return i}function eo(r){switch(typeof r){case"string":return r;case"number":return Zn(r);case"boolean":return Jn(r);case"bigint":return qe?qe(r):"0";case"symbol":return Ke?Ke(r):"Symbol()";case"undefined":return gt(r);case"function":case"object":{if(r===null)return gt(r);const i=r,s=P(i,"toString");if(typeof s=="function"){const c=s(i);return typeof c=="string"?c:gt(c)}return gt(r)}default:return gt(r)}}function P(r,i){for(;r!==null;){const c=$n(r,i);if(c){if(c.get)return A(c.get);if(typeof c.value=="function")return A(c.value)}r=Xn(r)}function s(){return null}return s}function no(r){try{return O(r,""),!0}catch{return!1}}const Ze=y(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),oe=y(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),re=y(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),oo=y(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ie=y(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ro=y(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Je=y(["#text"]),Qe=y(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),ae=y(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),tn=y(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xt=y(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),io=b(/{{[\w\W]*|^[\w\W]*}}/g),ao=b(/<%[\w\W]*|^[\w\W]*%>/g),so=b(/\${[\w\W]*/g),lo=b(/^data-[\-\w.\u00B7-\uFFFF]+$/),co=b(/^aria-[\-\w]+$/),en=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),uo=b(/^(?:\w+script|data):/i),fo=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),po=b(/^html$/i),mo=b(/^[a-z][.\w]*(-[.\w]+)+$/i),nn=b(/<[/\w!]/g),on=b(/<[/\w]/g),To=b(/<\/no(script|embed|frames)/i),ho=b(/\/>/i),N={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ln=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],_o=y(m({},ln)),go=(function(){const r={};return V(ln,i=>{r[i]=b(new RegExp("</"+i+"(?=[\\t\\n\\f\\r />])","i"))}),y(r)})(),Eo=function(){return typeof window>"u"?null:window},Ao=function(i,s){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let c=null;const u="data-tt-policy-suffix";s&&s.hasAttribute(u)&&(c=s.getAttribute(u));const d="dompurify"+(c?"#"+c:"");try{return i.createPolicy(d,{createHTML(S){return S},createScriptURL(S){return S}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},rn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},W=function(i,s,c,u){return D(i,s)&&ct(i[s])?m(u.base?C(u.base):{},i[s],u.transform):c},se=function(i,s,c){const u=D(i,s)?i[s]:void 0;return u&&typeof u=="object"?C(u):c()};function cn(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Eo();const i=o=>cn(o);if(i.version="3.4.16",i.removed=[],!r||!r.document||r.document.nodeType!==N.document||!r.Element)return i.isSupported=!1,i;let s=r.document;const c=s,u=c.currentScript;r.DocumentFragment;const d=r.HTMLTemplateElement,S=r.Node,ut=r.Element,w=r.NodeFilter;r.NamedNodeMap===void 0&&(r.NamedNodeMap||r.MozNamedAttrMap),r.HTMLFormElement;const At=r.DOMParser,q=r.trustedTypes,U=ut.prototype,un=P(U,"cloneNode"),kt=P(U,"remove"),ue=P(U,"removeAttributeNode"),fn=P(U,"nextSibling"),K=P(U,"childNodes"),Z=P(U,"parentNode"),fe=P(U,"shadowRoot"),Ut=P(U,"attributes"),B=S&&S.prototype?P(S.prototype,"nodeType"):null,J=S&&S.prototype?P(S.prototype,"nodeName"):null,yt=S&&S.prototype?P(S.prototype,"ownerDocument"):null,ft=function(t){return B?B(t):t.nodeType},Ft=function(t){return J?J(t):t.nodeName};if(typeof d=="function"){const o=s.createElement("template");o.content&&o.content.ownerDocument&&(s=o.content.ownerDocument)}let L,Y="",zt,pe=!1,pt=0;const me=function(){if(pt>0)throw G('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Q=function(t){me(),pt++;try{return L.createHTML(t)}finally{pt--}},pn=function(t){me(),pt++;try{return L.createScriptURL(t)}finally{pt--}},mn=function(){return pe||(zt=Ao(q,u),pe=!0),zt},St=s,Ht=St.implementation,de=St.createNodeIterator,dn=St.createDocumentFragment,Tn=St.getElementsByTagName,hn=c.importNode;let T=rn();i.isSupported=typeof an=="function"&&typeof Z=="function"&&Ht&&Ht.createHTMLDocument!==void 0;const _n=io,gn=ao,En=so,An=lo,yn=co,Sn=uo,Te=fo,bn=mo;let he=en,h=null;const Gt=m({},[...Ze,...oe,...re,...ie,...Je]);let _=null;const Wt=m({},[...Qe,...ae,...tn,...xt]);let v=Object.seal(lt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),mt=null,_e=null;const F=Object.seal(lt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ge=!0,Bt=!0,Ee=!1,Ae=!0,z=!1,j=!0,X=!1,Yt=!1,bt=null,Ot=null,jt=!1,tt=!1,Rt=!1,Lt=!1,ye=!0,Se=!1;const be="user-content-";let Xt=!0,$t=!1,et={},nt=null;const Oe=m({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Re=null;const Le=m({},["audio","video","img","source","image","track"]);let De=null;const we=m({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Dt="http://www.w3.org/1998/Math/MathML",wt="http://www.w3.org/2000/svg",x="http://www.w3.org/1999/xhtml";let ot=x,Vt=!1,qt=null;const On=m({},[Dt,wt,x],ne),Ie=y(["mi","mo","mn","ms","mtext"]);let Kt=m({},Ie);const Ne=y(["annotation-xml"]);let Zt=m({},Ne);const Rn=m({},["title","style","font","a","script"]);let dt=null;const Ln=["application/xhtml+xml","text/html"],Dn="text/html";let E=null,rt=null;const wn=s.createElement("form"),Ce=function(t){return t instanceof RegExp||t instanceof Function},Jt=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(rt&&rt===t)return;(!t||typeof t!="object")&&(t={}),t=C(t),dt=Ln.indexOf(t.PARSER_MEDIA_TYPE)===-1?Dn:t.PARSER_MEDIA_TYPE,E=dt==="application/xhtml+xml"?ne:Et,h=W(t,"ALLOWED_TAGS",Gt,{transform:E}),_=W(t,"ALLOWED_ATTR",Wt,{transform:E}),qt=W(t,"ALLOWED_NAMESPACES",On,{transform:ne}),De=W(t,"ADD_URI_SAFE_ATTR",we,{transform:E,base:we}),Re=W(t,"ADD_DATA_URI_TAGS",Le,{transform:E,base:Le}),nt=W(t,"FORBID_CONTENTS",Oe,{transform:E}),mt=W(t,"FORBID_TAGS",C({}),{transform:E}),_e=W(t,"FORBID_ATTR",C({}),{transform:E}),et=D(t,"USE_PROFILES")?t.USE_PROFILES&&typeof t.USE_PROFILES=="object"?C(t.USE_PROFILES):t.USE_PROFILES:!1,ge=t.ALLOW_ARIA_ATTR!==!1,Bt=t.ALLOW_DATA_ATTR!==!1,Ee=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,z=t.SAFE_FOR_TEMPLATES||!1,j=t.SAFE_FOR_XML!==!1,X=t.WHOLE_DOCUMENT||!1,tt=t.RETURN_DOM||!1,Rt=t.RETURN_DOM_FRAGMENT||!1,Lt=t.RETURN_TRUSTED_TYPE||!1,jt=t.FORCE_BODY||!1,ye=t.SANITIZE_DOM!==!1,Se=t.SANITIZE_NAMED_PROPS||!1,Xt=t.KEEP_CONTENT!==!1,$t=t.IN_PLACE||!1,he=no(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:en,ot=typeof t.NAMESPACE=="string"?t.NAMESPACE:x,Kt=se(t,"MATHML_TEXT_INTEGRATION_POINTS",()=>m({},Ie)),Zt=se(t,"HTML_INTEGRATION_POINTS",()=>m({},Ne));const e=se(t,"CUSTOM_ELEMENT_HANDLING",()=>lt(null));if(v=lt(null),D(e,"tagNameCheck")&&Ce(e.tagNameCheck)&&(v.tagNameCheck=e.tagNameCheck),D(e,"attributeNameCheck")&&Ce(e.attributeNameCheck)&&(v.attributeNameCheck=e.attributeNameCheck),D(e,"allowCustomizedBuiltInElements")&&typeof e.allowCustomizedBuiltInElements=="boolean"&&(v.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),b(v),z&&(Bt=!1),Rt&&(tt=!0),et&&(h=m({},Je),_=lt(null),et.html===!0&&(m(h,Ze),m(_,Qe)),et.svg===!0&&(m(h,oe),m(_,ae),m(_,xt)),et.svgFilters===!0&&(m(h,re),m(_,ae),m(_,xt)),et.mathMl===!0&&(m(h,ie),m(_,tn),m(_,xt))),F.tagCheck=null,F.attributeCheck=null,D(t,"ADD_TAGS")&&(typeof t.ADD_TAGS=="function"?F.tagCheck=t.ADD_TAGS:ct(t.ADD_TAGS)&&(h===Gt&&(h=C(h)),m(h,t.ADD_TAGS,E))),D(t,"ADD_ATTR")&&(typeof t.ADD_ATTR=="function"?F.attributeCheck=t.ADD_ATTR:ct(t.ADD_ATTR)&&(_===Wt&&(_=C(_)),m(_,t.ADD_ATTR,E))),D(t,"ADD_FORBID_CONTENTS")&&ct(t.ADD_FORBID_CONTENTS)&&(nt===Oe&&(nt=C(nt)),m(nt,t.ADD_FORBID_CONTENTS,E)),Xt&&(h["#text"]=!0),X&&m(h,["html","head","body"]),h.table&&(m(h,["tbody"]),delete mt.tbody),t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!="function")throw G('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw G('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const n=L;L=t.TRUSTED_TYPES_POLICY;try{Y=Q("")}catch(a){throw L=n,a}}else t.TRUSTED_TYPES_POLICY===null?(L=void 0,Y=""):(L===void 0&&(L=mn()),L&&typeof Y=="string"&&(Y=Q("")));y&&y(t),rt=t},Me=m({},[...oe,...re,...oo]),Pe=m({},[...ie,...ro]),In=function(t,e,n){return e.namespaceURI===x?t==="svg":e.namespaceURI===Dt?t==="svg"&&(n==="annotation-xml"||Kt[n]):!!Me[t]},Nn=function(t,e,n){return e.namespaceURI===x?t==="math":e.namespaceURI===wt?t==="math"&&Zt[n]:!!Pe[t]},Cn=function(t,e,n){return e.namespaceURI===wt&&!Zt[n]||e.namespaceURI===Dt&&!Kt[n]?!1:!Pe[t]&&(Rn[t]||!Me[t])},Mn=function(t){let e=Z(t);(!e||!e.tagName)&&(e={namespaceURI:ot,tagName:"template"});const n=Et(t.tagName),a=Et(e.tagName);return qt[t.namespaceURI]?t.namespaceURI===wt?In(n,e,a):t.namespaceURI===Dt?Nn(n,e,a):t.namespaceURI===x?Cn(n,e,a):!!(dt==="application/xhtml+xml"&&qt[t.namespaceURI]):!1},H=function(t){ht(i.removed,{element:t});try{Z(t).removeChild(t)}catch{if(kt(t),!Z(t))throw G("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ve=function(t,e,n){try{ue(t,e)}catch{try{t.removeAttribute(n)}catch{}}},It=function(t){Nt(t);const e=K(t);if(e){const a=[];V(e,l=>{ht(a,l)}),V(a,l=>{try{kt(l)}catch{}})}const n=Ut(t);if(n)for(let a=n.length-1;a>=0;--a){const l=n[a],f=l&&l.name;typeof f=="string"&&ve(t,l,f)}},$=function(t,e,n){if(!n)try{n=e.getAttributeNode(t)}catch{n=null}ht(i.removed,{attribute:n||null,from:e});try{n?ue(e,n):e.removeAttribute(t)}catch{try{e.removeAttribute(t)}catch{}}if(t==="is")if(tt||Rt)try{H(e)}catch{}else try{e.setAttribute(t,"")}catch{}},Pn=function(t){const e=Ut(t);if(e)for(let n=e.length-1;n>=0;--n){const a=e[n],l=a&&a.name;typeof l!="string"||_[E(l)]||ve(t,a,l)}},Nt=function(t){const e=[t];for(;e.length>0;){const n=e.pop();ft(n)===N.element&&Pn(n);const a=K(n);if(a)for(let l=a.length-1;l>=0;--l)e.push(a[l])}},xe=function(t,e){return j?t==="patchsrc"?!0:t==="for"&&e!=="label"&&e!=="output":!1},vn=function(t){if(!j)return;const e=[t];for(;e.length>0;){const n=e.pop(),a=ft(n);if(a===N.processingInstruction||a===N.comment&&O(on,n.data)){try{kt(n)}catch{}continue}if(a===N.element){const f=n,p=E(Ft(n));try{f.hasAttribute&&f.hasAttribute("patchsrc")&&f.removeAttribute("patchsrc"),f.hasAttribute&&f.hasAttribute("for")&&xe("for",p)&&f.removeAttribute("for")}catch{}}const l=K(n);if(l)for(let f=l.length-1;f>=0;--f)e.push(l[f])}},ke=function(t){let e=null,n=null;if(jt)t="<remove></remove>"+t;else{const f=$e(t,/^[\r\n\t ]+/);n=f&&f[0]}dt==="application/xhtml+xml"&&ot===x&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const a=L?Q(t):t;if(ot===x)try{e=new At().parseFromString(a,dt)}catch{}if(!e||!e.documentElement){e=Ht.createDocument(ot,"template",null);try{e.documentElement.innerHTML=Vt?Y:a}catch{}}const l=e.body||e.documentElement;return t&&n&&l.insertBefore(s.createTextNode(n),l.childNodes[0]||null),ot===x?Tn.call(e,X?"html":"body")[0]:X?e.documentElement:l},Ue=function(t){const e=yt?yt(t):t.ownerDocument;return de.call(e||t,t,w.SHOW_ELEMENT|w.SHOW_COMMENT|w.SHOW_TEXT|w.SHOW_PROCESSING_INSTRUCTION|w.SHOW_CDATA_SECTION,null)},Ct=function(t){return t=_t(t,_n," "),t=_t(t,gn," "),t=_t(t,En," "),t},Qt=function(t){var e;t.normalize();const n=yt?yt(t):t.ownerDocument,a=de.call(n||t,t,w.SHOW_TEXT|w.SHOW_COMMENT|w.SHOW_CDATA_SECTION|w.SHOW_PROCESSING_INSTRUCTION,null);let l=a.nextNode();for(;l;)l.data=Ct(l.data),l=a.nextNode();const f=(e=t.querySelectorAll)===null||e===void 0?void 0:e.call(t,"template");f&&V(f,p=>{it(p.content)&&Qt(p.content)})},Mt=function(t){const e=J?J(t):null;return typeof e!="string"||E(e)!=="form"?!1:typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="function"||t.attributes!==Ut(t)||typeof t.removeAttribute!="function"||typeof t.removeAttributeNode!="function"||typeof t.getAttributeNode!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!="function"||t.nodeType!==B(t)||t.childNodes!==K(t)},it=function(t){if(!B||typeof t!="object"||t===null)return!1;try{return B(t)===N.documentFragment}catch{return!1}},Tt=function(t){if(!B||typeof t!="object"||t===null)return!1;try{return typeof B(t)=="number"}catch{return!1}};function k(o,t,e){o.length!==0&&V(o,n=>{n.call(i,t,e,rt)})}const xn=function(t,e){return!!(j&&t.hasChildNodes()&&!Tt(t.firstElementChild)&&O(nn,t.textContent)&&O(nn,t.innerHTML)||j&&t.namespaceURI===x&&_o[e]&&(Tt(t.firstElementChild)||typeof t.textContent=="string"&&O(go[e],t.textContent))||t.nodeType===N.processingInstruction||j&&t.nodeType===N.comment&&O(on,t.data))},Pt=function(t,e){if(t instanceof RegExp)return O(t,e);if(t instanceof Function){for(var n=arguments.length,a=new Array(n>2?n-2:0),l=2;l<n;l++)a[l-2]=arguments[l];return!!t(e,...a)}return!1},kn=function(t,e,n){if(!mt[e]&&Ge(e)&&Pt(v.tagNameCheck,e))return!1;if(Xt&&!nt[e]){const a=Z(t),l=K(t);if(l&&a){const f=l.length;for(let p=f-1;p>=0;--p){const g=t===n?un(l[p],!0):l[p];a.insertBefore(g,fn(t))}}}return H(t),!0},Fe=function(t,e,n,a){return t.length===0?e:e===n||e===a?C(e):e},at=function(t,e){return t===e||Z(t)!==null?!1:($t&&Nt(t),!0)},ze=function(t,e){if(k(T.beforeSanitizeElements,t,null),at(t,e))return!0;if(Mt(t))return H(t),!0;const n=E(Ft(t));if(h=Fe(T.uponSanitizeElement,h,Gt,bt),k(T.uponSanitizeElement,t,{tagName:n,allowedTags:h}),at(t,e))return!0;if(xn(t,n))return H(t),!0;if(mt[n]||!(F.tagCheck instanceof Function&&F.tagCheck(n))&&!h[n]){const a=kn(t,n,e);return a===!1&&(k(T.afterSanitizeElements,t,null),at(t,e))?!0:a}if(ft(t)===N.element&&!Mn(t)||(n==="noscript"||n==="noembed"||n==="noframes")&&O(To,t.innerHTML))return H(t),!0;if(z&&t.nodeType===N.text){const a=Ct(t.textContent);t.textContent!==a&&(ht(i.removed,{element:t.cloneNode()}),t.textContent=a)}return k(T.afterSanitizeElements,t,null),at(t,e)},He=function(t,e,n){if(_e[e]||xe(e,t)||ye&&(e==="id"||e==="name")&&(n in s||n in wn))return!1;const a=_[e]||F.attributeCheck instanceof Function&&F.attributeCheck(e,t);return Bt&&O(An,e)||ge&&O(yn,e)?!0:a?De[e]||O(he,_t(n,Te,""))||(e==="src"||e==="xlink:href"||e==="href")&&t!=="script"&&Ve(n,"data:")===0&&Re[t]||Ee&&!O(Sn,_t(n,Te,""))?!0:!n:Ge(t)&&Pt(v.tagNameCheck,t)&&Pt(v.attributeNameCheck,e,t)||e==="is"&&v.allowCustomizedBuiltInElements&&Pt(v.tagNameCheck,n)},Un=m({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ge=function(t){return!Un[Et(t)]&&O(bn,t)},Fn=function(t,e,n,a){if(L&&typeof q=="object"&&typeof q.getAttributeType=="function"&&!n)switch(q.getAttributeType(t,e)){case"TrustedHTML":return Q(a);case"TrustedScriptURL":return pn(a)}return a},zn=function(t,e,n,a){try{return n?t.setAttributeNS(n,e,a):t.setAttribute(e,a),Mt(t)?(H(t),!1):!0}catch{return $(e,t),!1}},We=function(t,e){if(k(T.beforeSanitizeAttributes,t,null),at(t,e))return;const n=t.attributes;if(!n||Mt(t))return;_=Fe(T.uponSanitizeAttribute,_,Wt,Ot);const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_,forceKeepAttr:void 0};let l=n.length;const f=E(t.nodeName);for(;l--;){const p=n[l],g=p.name,M=p.namespaceURI,I=p.value,st=E(g),ee=I;let R=g==="value"?ee:Kn(ee),Be=!1;if(a.attrName=st,a.attrValue=R,a.keepAttr=!0,a.forceKeepAttr=void 0,k(T.uponSanitizeAttribute,t,a),R=a.attrValue,Se&&(st==="id"||st==="name")&&Ve(R,be)!==0&&($(g,t,p),R=be+R,Be=!0),j&&O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,R)){$(g,t,p);continue}if(st==="attributename"&&$e(R,"href")){$(g,t,p);continue}if(!a.forceKeepAttr){if(!a.keepAttr){$(g,t,p);continue}if(!Ae&&O(ho,R)){$(g,t,p);continue}if(z&&(R=Ct(R)),!He(f,st,R)){$(g,t,p);continue}R=Fn(f,st,M,R),R!==ee&&zn(t,g,M,R)&&Be&&Xe(i.removed)}}k(T.afterSanitizeAttributes,t,null),at(t,e)},vt=function(t){let e=null;const n=Ue(t);for(k(T.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(k(T.uponSanitizeShadowNode,e,null),ze(e,t),We(e,t),it(e.content)&&vt(e.content),ft(e)===N.element){const a=fe(e);it(a)&&(te(a),vt(a))}k(T.afterSanitizeShadowDOM,t,null)},te=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const n=e.pop();if(n.shadow){vt(n.shadow);continue}const a=n.node,l=ft(a)===N.element,f=K(a);if(f)for(let p=f.length-1;p>=0;--p)e.push({node:f[p],shadow:null});if(l){const p=J?J(a):null;if(typeof p=="string"&&E(p)==="template"){const g=a.content;it(g)&&e.push({node:g,shadow:null})}}if(l){const p=fe(a);it(p)&&e.push({node:null,shadow:p},{node:p,shadow:null})}}};return i.sanitize=function(o){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=null,n=null,a=null,l=null;if(Vt=!o,Vt&&(o="<!-->"),typeof o!="string"&&!Tt(o)&&(o=eo(o),typeof o!="string"))throw G("dirty is not a string, aborting");if(!i.isSupported)return o;Yt?(h=bt,_=Ot):Jt(t),(T.uponSanitizeElement.length>0||T.uponSanitizeAttribute.length>0)&&(h=C(h)),T.uponSanitizeAttribute.length>0&&(_=C(_)),i.removed=[];const f=$t&&typeof o!="string"&&Tt(o);if(f){vn(o);const M=Ft(o);if(typeof M=="string"){const I=E(M);if(!h[I]||mt[I])throw It(o),G("root node is forbidden and cannot be sanitized in-place")}if(Mt(o))throw It(o),G("root node is clobbered and cannot be sanitized in-place");try{te(o)}catch(I){throw It(o),I}}else if(Tt(o))e=ke("<!---->"),n=e.ownerDocument.importNode(o,!0),n.nodeType===N.element&&n.nodeName==="BODY"||n.nodeName==="HTML"?e=n:e.appendChild(n),te(e);else{if(!tt&&!z&&!X&&o.indexOf("<")===-1)return L&&Lt?Q(o):o;if(e=ke(o),!e)return tt?null:Lt?Y:""}e&&jt&&H(e.firstChild);const p=f?o:e;try{const M=Ue(p);for(;a=M.nextNode();)ze(a,p),We(a,p),it(a.content)&&vt(a.content)}catch(M){throw f&&(It(o),V(i.removed,I=>{I.element&&Nt(I.element)})),M}if(f){let M=!1;if(V(i.removed,I=>{I.element&&(I.element===o&&(M=!0),Nt(I.element))}),M)throw G("a node selected for removal could not be safely returned; refusing to sanitize in place");return z&&Qt(o),o}if(tt){if(z&&Qt(e),Rt)for(l=dn.call(e.ownerDocument);e.firstChild;)l.appendChild(e.firstChild);else l=e;return(_.shadowroot||_.shadowrootmode)&&(l=hn.call(c,l,!0)),l}let g=X?e.outerHTML:e.innerHTML;return X&&h["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&O(po,e.ownerDocument.doctype.name)&&(g="<!DOCTYPE "+e.ownerDocument.doctype.name+`>
|
|
3
|
+
`+g),z&&(g=Ct(g)),L&&Lt?Q(g):g},i.setConfig=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Jt(o),Yt=!0,bt=h,Ot=_},i.clearConfig=function(){rt=null,Yt=!1,bt=null,Ot=null,L=zt,Y=""},i.isValidAttribute=function(o,t,e){rt||Jt({});const n=E(o),a=E(t);return He(n,a,e)},i.addHook=function(o,t){typeof t=="function"&&D(T,o)&&ht(T[o],t)},i.removeHook=function(o,t){if(D(T,o)){if(t!==void 0){const e=Vn(T[o],t);return e===-1?void 0:qn(T[o],e,1)[0]}return Xe(T[o])}},i.removeHooks=function(o){D(T,o)&&(T[o]=[])},i.removeAllHooks=function(){T=rn()},i}var yo=cn();exports.purify_default=yo;
|