diff --git a/controllers/almanach_contents_edit.go b/controllers/almanach_contents_edit.go
index 4fbb605..d6eef92 100644
--- a/controllers/almanach_contents_edit.go
+++ b/controllers/almanach_contents_edit.go
@@ -26,8 +26,11 @@ const (
URL_ALMANACH_CONTENTS_DELETE = "contents/delete"
URL_ALMANACH_CONTENTS_EDIT_FORM = "contents/edit/form"
URL_ALMANACH_CONTENTS_EDIT_EXTENT = "contents/edit/extent"
+ URL_ALMANACH_CONTENTS_UPLOAD = "contents/upload"
+ URL_ALMANACH_CONTENTS_DELETE_SCAN = "contents/scan/delete"
TEMPLATE_ALMANACH_CONTENTS_EDIT = "/almanach/contents/edit/"
TEMPLATE_ALMANACH_CONTENTS_EDIT_FORM = "/almanach/contents/edit_form/"
+ TEMPLATE_ALMANACH_CONTENTS_IMAGES_PANEL = "/almanach/contents/images_panel/"
)
func init() {
@@ -56,6 +59,8 @@ func (p *AlmanachContentsEditPage) Setup(router *router.Router[*core.RequestEven
rg.POST(URL_ALMANACH_CONTENTS_INSERT, p.POSTInsert(engine, app))
rg.POST(URL_ALMANACH_CONTENTS_DELETE, p.POSTDelete(engine, app))
rg.POST(URL_ALMANACH_CONTENTS_EDIT_EXTENT, p.POSTUpdateExtent(engine, app))
+ rg.POST(URL_ALMANACH_CONTENTS_UPLOAD, p.POSTUploadScans(engine, app))
+ rg.POST(URL_ALMANACH_CONTENTS_DELETE_SCAN, p.POSTDeleteScan(engine, app))
return nil
}
@@ -560,6 +565,184 @@ func (p *AlmanachContentsEditPage) POSTDelete(engine *templating.Engine, app cor
}
}
+func (p *AlmanachContentsEditPage) POSTUploadScans(engine *templating.Engine, app core.App) HandleFunc {
+ return func(e *core.RequestEvent) error {
+ id := e.Request.PathValue("id")
+ req := templating.NewRequest(e)
+ isHTMX := strings.EqualFold(e.Request.Header.Get("HX-Request"), "true")
+
+ if e.Request.MultipartForm == nil {
+ if err := e.Request.ParseMultipartForm(router.DefaultMaxMemory); err != nil {
+ return renderContentsImagesHTMXError(e, "Upload fehlgeschlagen.", isHTMX)
+ }
+ }
+
+ if err := req.CheckCSRF(e.Request.FormValue("csrf_token")); err != nil {
+ return renderContentsImagesHTMXError(e, "Upload fehlgeschlagen.", isHTMX)
+ }
+
+ contentID := strings.TrimSpace(e.Request.FormValue("content_id"))
+ if contentID == "" || strings.HasPrefix(contentID, "tmp") {
+ return renderContentsImagesHTMXError(e, "Upload fehlgeschlagen.", isHTMX)
+ }
+
+ entry, err := dbmodels.Entries_MusenalmID(app, id)
+ if err != nil {
+ return engine.Response404(e, err, nil)
+ }
+
+ contents, err := dbmodels.Contents_IDs(app, []any{contentID})
+ if err != nil || len(contents) == 0 {
+ return renderContentsImagesHTMXError(e, "Beitrag nicht gefunden.", isHTMX)
+ }
+ content := contents[0]
+ if content.Entry() != entry.Id {
+ return renderContentsImagesHTMXError(e, "Beitrag nicht gefunden.", isHTMX)
+ }
+
+ files, err := e.FindUploadedFiles(dbmodels.SCAN_FIELD)
+ if err != nil || len(files) == 0 {
+ return renderContentsImagesHTMXError(e, "Bitte eine Datei auswaehlen.", isHTMX)
+ }
+
+ content.Set(dbmodels.SCAN_FIELD+"+", files)
+ if user := req.User(); user != nil {
+ content.SetEditor(user.Id)
+ }
+ if err := app.Save(content); err != nil {
+ app.Logger().Error("Failed to upload scans", "entry_id", entry.Id, "content_id", content.Id, "error", err)
+ return renderContentsImagesHTMXError(e, "Upload fehlgeschlagen.", isHTMX)
+ }
+
+ if !isHTMX {
+ redirect := fmt.Sprintf("/almanach/%s/contents/edit", id)
+ return e.Redirect(http.StatusSeeOther, redirect)
+ }
+
+ if refreshed, err := dbmodels.Contents_IDs(app, []any{content.Id}); err == nil && len(refreshed) > 0 {
+ content = refreshed[0]
+ }
+
+ data := map[string]any{
+ "content": content,
+ "entry": entry,
+ "csrf_token": req.Session().Token,
+ "is_new": false,
+ }
+ var builder strings.Builder
+ if err := engine.Render(&builder, TEMPLATE_ALMANACH_CONTENTS_IMAGES_PANEL, data, "fragment"); err != nil {
+ app.Logger().Error("Failed to render images panel", "entry_id", entry.Id, "content_id", content.Id, "error", err)
+ return e.String(http.StatusInternalServerError, "")
+ }
+
+ success := `
`
+ countOOB := renderContentImagesCountOOB(content)
+ return e.HTML(http.StatusOK, builder.String()+success+countOOB)
+ }
+}
+
+func (p *AlmanachContentsEditPage) POSTDeleteScan(engine *templating.Engine, app core.App) HandleFunc {
+ return func(e *core.RequestEvent) error {
+ id := e.Request.PathValue("id")
+ req := templating.NewRequest(e)
+ isHTMX := strings.EqualFold(e.Request.Header.Get("HX-Request"), "true")
+
+ if err := e.Request.ParseForm(); err != nil {
+ return renderContentsImagesHTMXError(e, "Loeschen fehlgeschlagen.", isHTMX)
+ }
+
+ if err := req.CheckCSRF(e.Request.FormValue("csrf_token")); err != nil {
+ return renderContentsImagesHTMXError(e, "Loeschen fehlgeschlagen.", isHTMX)
+ }
+
+ contentID := strings.TrimSpace(e.Request.FormValue("content_id"))
+ scan := strings.TrimSpace(e.Request.FormValue("scan"))
+ if contentID == "" || scan == "" {
+ return renderContentsImagesHTMXError(e, "Loeschen fehlgeschlagen.", isHTMX)
+ }
+
+ entry, err := dbmodels.Entries_MusenalmID(app, id)
+ if err != nil {
+ return engine.Response404(e, err, nil)
+ }
+
+ contents, err := dbmodels.Contents_IDs(app, []any{contentID})
+ if err != nil || len(contents) == 0 {
+ return renderContentsImagesHTMXError(e, "Beitrag nicht gefunden.", isHTMX)
+ }
+ content := contents[0]
+ if content.Entry() != entry.Id {
+ return renderContentsImagesHTMXError(e, "Beitrag nicht gefunden.", isHTMX)
+ }
+ if !slices.Contains(content.Scans(), scan) {
+ return renderContentsImagesHTMXError(e, "Datei nicht gefunden.", isHTMX)
+ }
+
+ content.Set(dbmodels.SCAN_FIELD+"-", scan)
+ if user := req.User(); user != nil {
+ content.SetEditor(user.Id)
+ }
+ if err := app.Save(content); err != nil {
+ app.Logger().Error("Failed to delete scan", "entry_id", entry.Id, "content_id", content.Id, "scan", scan, "error", err)
+ return renderContentsImagesHTMXError(e, "Loeschen fehlgeschlagen.", isHTMX)
+ }
+
+ if !isHTMX {
+ redirect := fmt.Sprintf("/almanach/%s/contents/edit", id)
+ return e.Redirect(http.StatusSeeOther, redirect)
+ }
+
+ if refreshed, err := dbmodels.Contents_IDs(app, []any{content.Id}); err == nil && len(refreshed) > 0 {
+ content = refreshed[0]
+ }
+
+ data := map[string]any{
+ "content": content,
+ "entry": entry,
+ "csrf_token": req.Session().Token,
+ "is_new": false,
+ }
+ var builder strings.Builder
+ if err := engine.Render(&builder, TEMPLATE_ALMANACH_CONTENTS_IMAGES_PANEL, data, "fragment"); err != nil {
+ app.Logger().Error("Failed to render images panel", "entry_id", entry.Id, "content_id", content.Id, "error", err)
+ return e.String(http.StatusInternalServerError, "")
+ }
+
+ success := ``
+ countOOB := renderContentImagesCountOOB(content)
+ return e.HTML(http.StatusOK, builder.String()+success+countOOB)
+ }
+}
+
+func renderContentImagesCountOOB(content *dbmodels.Content) string {
+ if content == nil {
+ return ""
+ }
+ count := len(content.Scans())
+ hiddenClass := ""
+ if count == 0 {
+ hiddenClass = " hidden"
+ }
+ return fmt.Sprintf(
+ `%d`,
+ content.Id,
+ hiddenClass,
+ count,
+ )
+}
+
+func renderContentsImagesHTMXError(e *core.RequestEvent, message string, isHTMX bool) error {
+ if !isHTMX {
+ return e.String(http.StatusBadRequest, message)
+ }
+ e.Response.Header().Set("HX-Reswap", "none")
+ payload := fmt.Sprintf(
+ ``,
+ message,
+ )
+ return e.HTML(http.StatusBadRequest, payload)
+}
+
func (p *AlmanachContentsEditPage) renderSaveError(
engine *templating.Engine,
app core.App,
diff --git a/stage.docker-compose.yml b/stage.docker-compose.yml
new file mode 100644
index 0000000..9fe7c35
--- /dev/null
+++ b/stage.docker-compose.yml
@@ -0,0 +1,17 @@
+services:
+ musenalmstage:
+ build: .
+ expose:
+ - "8090"
+ volumes:
+ - musenalmstage:/app/data
+ networks:
+ - caddynet
+
+volumes:
+ musenalmstage:
+ external: true
+
+networks:
+ caddynet:
+ external: true
diff --git a/views/assets/scripts.js b/views/assets/scripts.js
index e04c369..e634147 100644
--- a/views/assets/scripts.js
+++ b/views/assets/scripts.js
@@ -1,11 +1,11 @@
-var ko = Object.defineProperty;
+var qo = Object.defineProperty;
var as = (s) => {
throw TypeError(s);
};
-var Io = (s, t, e) => t in s ? ko(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
-var ie = (s, t, e) => Io(s, typeof t != "symbol" ? t + "" : t, e), Si = (s, t, e) => t.has(s) || as("Cannot " + e);
-var Li = (s, t, e) => (Si(s, t, "read from private field"), e ? e.call(s) : t.get(s)), ne = (s, t, e) => t.has(s) ? as("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), Be = (s, t, e, i) => (Si(s, t, "write to private field"), i ? i.call(s, e) : t.set(s, e), e), Ne = (s, t, e) => (Si(s, t, "access private method"), e);
-var Ro = "2.1.16";
+var Ho = (s, t, e) => t in s ? qo(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
+var ie = (s, t, e) => Ho(s, typeof t != "symbol" ? t + "" : t, e), Si = (s, t, e) => t.has(s) || as("Cannot " + e);
+var Li = (s, t, e) => (Si(s, t, "read from private field"), e ? e.call(s) : t.get(s)), ne = (s, t, e) => t.has(s) ? as("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), Ne = (s, t, e, i) => (Si(s, t, "write to private field"), i ? i.call(s, e) : t.set(s, e), e), Be = (s, t, e) => (Si(s, t, "access private method"), e);
+var $o = "2.1.16";
const kt = "[data-trix-attachment]", Ln = { preview: { presentation: "gallery", caption: { name: !0, size: !0 } }, file: { caption: { size: !0 } } }, G = { default: { tagName: "div", parse: !1 }, quote: { tagName: "blockquote", nestable: !0 }, heading1: { tagName: "h1", terminal: !0, breakOnReturn: !0, group: !1 }, code: { tagName: "pre", terminal: !0, htmlAttributes: ["language"], text: { plaintext: !0 } }, bulletList: { tagName: "ul", parse: !1 }, bullet: { tagName: "li", listAttribute: "bulletList", group: !1, nestable: !0, test(s) {
return ls(s.parentNode) === G[this.listAttribute].tagName;
} }, numberList: { tagName: "ol", parse: !1 }, number: { tagName: "li", listAttribute: "numberList", group: !1, nestable: !0, test(s) {
@@ -14,9 +14,9 @@ const kt = "[data-trix-attachment]", Ln = { preview: { presentation: "gallery",
var t;
return s == null || (t = s.tagName) === null || t === void 0 ? void 0 : t.toLowerCase();
}, cs = navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i), Ci = cs && parseInt(cs[1]);
-var Le = { composesExistingText: /Android.*Chrome/.test(navigator.userAgent), recentAndroid: Ci && Ci > 12, samsungAndroid: Ci && navigator.userAgent.match(/Android.*SM-/), forcesObjectResizing: /Trident.*rv:11/.test(navigator.userAgent), supportsInputEvents: typeof InputEvent < "u" && ["data", "getTargetRanges", "inputType"].every((s) => s in InputEvent.prototype) }, yr = { ADD_ATTR: ["language"], SAFE_FOR_XML: !1, RETURN_DOM: !0 }, b = { attachFiles: "Attach Files", bold: "Bold", bullets: "Bullets", byte: "Byte", bytes: "Bytes", captionPlaceholder: "Add a caption…", code: "Code", heading1: "Heading", indent: "Increase Level", italic: "Italic", link: "Link", numbers: "Numbers", outdent: "Decrease Level", quote: "Quote", redo: "Redo", remove: "Remove", strike: "Strikethrough", undo: "Undo", unlink: "Unlink", url: "URL", urlPlaceholder: "Enter a URL…", GB: "GB", KB: "KB", MB: "MB", PB: "PB", TB: "TB" };
-const Do = [b.bytes, b.KB, b.MB, b.GB, b.TB, b.PB];
-var Er = { prefix: "IEC", precision: 2, formatter(s) {
+var Le = { composesExistingText: /Android.*Chrome/.test(navigator.userAgent), recentAndroid: Ci && Ci > 12, samsungAndroid: Ci && navigator.userAgent.match(/Android.*SM-/), forcesObjectResizing: /Trident.*rv:11/.test(navigator.userAgent), supportsInputEvents: typeof InputEvent < "u" && ["data", "getTargetRanges", "inputType"].every((s) => s in InputEvent.prototype) }, Ir = { ADD_ATTR: ["language"], SAFE_FOR_XML: !1, RETURN_DOM: !0 }, b = { attachFiles: "Attach Files", bold: "Bold", bullets: "Bullets", byte: "Byte", bytes: "Bytes", captionPlaceholder: "Add a caption…", code: "Code", heading1: "Heading", indent: "Increase Level", italic: "Italic", link: "Link", numbers: "Numbers", outdent: "Decrease Level", quote: "Quote", redo: "Redo", remove: "Remove", strike: "Strikethrough", undo: "Undo", unlink: "Unlink", url: "URL", urlPlaceholder: "Enter a URL…", GB: "GB", KB: "KB", MB: "MB", PB: "PB", TB: "TB" };
+const Uo = [b.bytes, b.KB, b.MB, b.GB, b.TB, b.PB];
+var Rr = { prefix: "IEC", precision: 2, formatter(s) {
switch (s) {
case 0:
return "0 ".concat(b.bytes);
@@ -26,16 +26,16 @@ var Er = { prefix: "IEC", precision: 2, formatter(s) {
let t;
this.prefix === "SI" ? t = 1e3 : this.prefix === "IEC" && (t = 1024);
const e = Math.floor(Math.log(s) / Math.log(t)), i = (s / Math.pow(t, e)).toFixed(this.precision).replace(/0*$/, "").replace(/\.$/, "");
- return "".concat(i, " ").concat(Do[e]);
+ return "".concat(i, " ").concat(Uo[e]);
}
} };
-const ni = "\uFEFF", At = " ", xr = function(s) {
+const ni = "\uFEFF", At = " ", Dr = function(s) {
for (const t in s) {
const e = s[t];
this[t] = e;
}
return this;
-}, Cn = document.documentElement, Oo = Cn.matches, k = function(s) {
+}, Cn = document.documentElement, jo = Cn.matches, k = function(s) {
let { onElement: t, matchingSelector: e, withCallback: i, inPhase: n, preventDefault: r, times: o } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
const a = t || Cn, l = e, d = n === "capturing", h = function(m) {
o != null && --o == 0 && h.destroy();
@@ -43,17 +43,17 @@ const ni = "\uFEFF", At = " ", xr = function(s) {
p != null && (i == null || i.call(p, m, p), r && m.preventDefault());
};
return h.destroy = () => a.removeEventListener(s, h, d), a.addEventListener(s, h, d), h;
-}, Sr = function(s) {
+}, Or = function(s) {
let { bubbles: t, cancelable: e, attributes: i } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
t = t !== !1, e = e !== !1;
const n = document.createEvent("Events");
- return n.initEvent(s, t, e), i != null && xr.call(n, i), n;
+ return n.initEvent(s, t, e), i != null && Dr.call(n, i), n;
}, me = function(s) {
let { onElement: t, bubbles: e, cancelable: i, attributes: n } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
- const r = t ?? Cn, o = Sr(s, { bubbles: e, cancelable: i, attributes: n });
+ const r = t ?? Cn, o = Or(s, { bubbles: e, cancelable: i, attributes: n });
return r.dispatchEvent(o);
-}, Lr = function(s, t) {
- if ((s == null ? void 0 : s.nodeType) === 1) return Oo.call(s, t);
+}, Mr = function(s, t) {
+ if ((s == null ? void 0 : s.nodeType) === 1) return jo.call(s, t);
}, yt = function(s) {
let { matchingSelector: t, untilNode: e } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
for (; s && s.nodeType !== Node.ELEMENT_NODE; ) s = s.parentNode;
@@ -61,16 +61,16 @@ const ni = "\uFEFF", At = " ", xr = function(s) {
if (t == null) return s;
if (s.closest && e == null) return s.closest(t);
for (; s && s !== e; ) {
- if (Lr(s, t)) return s;
+ if (Mr(s, t)) return s;
s = s.parentNode;
}
}
-}, wn = (s) => document.activeElement !== s && wt(s, document.activeElement), wt = function(s, t) {
+}, Tn = (s) => document.activeElement !== s && Tt(s, document.activeElement), Tt = function(s, t) {
if (s && t) for (; t; ) {
if (t === s) return !0;
t = t.parentNode;
}
-}, wi = function(s) {
+}, Ti = function(s) {
var t;
if ((t = s) === null || t === void 0 || !t.parentNode) return;
let e = 0;
@@ -97,7 +97,7 @@ const ni = "\uFEFF", At = " ", xr = function(s) {
}, K = (s) => {
var t;
return s == null || (t = s.tagName) === null || t === void 0 ? void 0 : t.toLowerCase();
-}, _ = function(s) {
+}, A = function(s) {
let t, e, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
typeof s == "object" ? (i = s, s = i.tagName) : i = { attributes: i };
const n = document.createElement(s);
@@ -119,18 +119,18 @@ const ge = function() {
t.tagName && se.push(t.tagName);
}
return se;
-}, Ti = (s) => Kt(s == null ? void 0 : s.firstChild), ds = function(s) {
+}, wi = (s) => Kt(s == null ? void 0 : s.firstChild), ds = function(s) {
let { strict: t } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { strict: !0 };
return t ? Kt(s) : Kt(s) || !Kt(s.firstChild) && function(e) {
return ge().includes(K(e)) && !ge().includes(K(e.firstChild));
}(s);
-}, Kt = (s) => Mo(s) && (s == null ? void 0 : s.data) === "block", Mo = (s) => (s == null ? void 0 : s.nodeType) === Node.COMMENT_NODE, Gt = function(s) {
+}, Kt = (s) => Vo(s) && (s == null ? void 0 : s.data) === "block", Vo = (s) => (s == null ? void 0 : s.nodeType) === Node.COMMENT_NODE, Gt = function(s) {
let { name: t } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (s) return pe(s) ? s.data === ni ? !t || s.parentNode.dataset.trixCursorTarget === t : void 0 : Gt(s.firstChild);
-}, It = (s) => Lr(s, kt), Cr = (s) => pe(s) && (s == null ? void 0 : s.data) === "", pe = (s) => (s == null ? void 0 : s.nodeType) === Node.TEXT_NODE, Tn = { level2Enabled: !0, getLevel() {
+}, It = (s) => Mr(s, kt), Nr = (s) => pe(s) && (s == null ? void 0 : s.data) === "", pe = (s) => (s == null ? void 0 : s.nodeType) === Node.TEXT_NODE, wn = { level2Enabled: !0, getLevel() {
return this.level2Enabled && Le.supportsInputEvents ? 2 : 0;
}, pickFiles(s) {
- const t = _("input", { type: "file", multiple: !0, hidden: !0, id: this.fileInputId });
+ const t = A("input", { type: "file", multiple: !0, hidden: !0, id: this.fileInputId });
t.addEventListener("change", () => {
s(t.files), Et(t);
}), Et(document.getElementById(this.fileInputId)), document.body.appendChild(t), t.click();
@@ -142,7 +142,7 @@ var Ke = { removeBlankTableCells: !1, tableCellSeparator: " | ", tableRowSeparat
} }, italic: { tagName: "em", inheritable: !0, parser: (s) => window.getComputedStyle(s).fontStyle === "italic" }, href: { groupTagName: "a", parser(s) {
const t = "a:not(".concat(kt, ")"), e = s.closest(t);
if (e) return e.getAttribute("href");
-} }, strike: { tagName: "del", inheritable: !0 }, frozen: { style: { backgroundColor: "highlight" } } }, wr = { getDefaultHTML: () => ``) };
const hn = { interval: 5e3 };
-var Ce = Object.freeze({ __proto__: null, attachments: Ln, blockAttributes: G, browser: Le, css: { attachment: "attachment", attachmentCaption: "attachment__caption", attachmentCaptionEditor: "attachment__caption-editor", attachmentMetadata: "attachment__metadata", attachmentMetadataContainer: "attachment__metadata-container", attachmentName: "attachment__name", attachmentProgress: "attachment__progress", attachmentSize: "attachment__size", attachmentToolbar: "attachment__toolbar", attachmentGallery: "attachment-gallery" }, dompurify: yr, fileSize: Er, input: Tn, keyNames: { 8: "backspace", 9: "tab", 13: "return", 27: "escape", 37: "left", 39: "right", 46: "delete", 68: "d", 72: "h", 79: "o" }, lang: b, parser: Ke, textAttributes: Dt, toolbar: wr, undo: hn });
-class B {
+var Ce = Object.freeze({ __proto__: null, attachments: Ln, blockAttributes: G, browser: Le, css: { attachment: "attachment", attachmentCaption: "attachment__caption", attachmentCaptionEditor: "attachment__caption-editor", attachmentMetadata: "attachment__metadata", attachmentMetadataContainer: "attachment__metadata-container", attachmentName: "attachment__name", attachmentProgress: "attachment__progress", attachmentSize: "attachment__size", attachmentToolbar: "attachment__toolbar", attachmentGallery: "attachment-gallery" }, dompurify: Ir, fileSize: Rr, input: wn, keyNames: { 8: "backspace", 9: "tab", 13: "return", 27: "escape", 37: "left", 39: "right", 46: "delete", 68: "d", 72: "h", 79: "o" }, lang: b, parser: Ke, textAttributes: Dt, toolbar: Br, undo: hn });
+class N {
static proxyMethod(t) {
- const { name: e, toMethod: i, toProperty: n, optional: r } = Bo(t);
+ const { name: e, toMethod: i, toProperty: n, optional: r } = zo(t);
this.prototype[e] = function() {
let o, a;
var l, d;
@@ -195,14 +195,14 @@ class B {
};
}
}
-const Bo = function(s) {
- const t = s.match(No);
+const zo = function(s) {
+ const t = s.match(Wo);
if (!t) throw new Error("can't parse @proxyMethod expression: ".concat(s));
const e = { name: t[4] };
return t[2] != null ? e.toMethod = t[1] : e.toProperty = t[1], t[3] != null && (e.optional = !0), e;
-}, { apply: hs } = Function.prototype, No = new RegExp("^(.+?)(\\(\\))?(\\?)?\\.(.+?)$");
+}, { apply: hs } = Function.prototype, Wo = new RegExp("^(.+?)(\\(\\))?(\\?)?\\.(.+?)$");
var ki, Ii, Ri;
-class ye extends B {
+class ye extends N {
static box() {
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
return t instanceof this ? t : this.fromUCS2String(t == null ? void 0 : t.toString());
@@ -241,9 +241,9 @@ class ye extends B {
return this.ucs2String;
}
}
-const Po = ((ki = Array.from) === null || ki === void 0 ? void 0 : ki.call(Array, "👼").length) === 1, Fo = ((Ii = " ".codePointAt) === null || Ii === void 0 ? void 0 : Ii.call(" ", 0)) != null, qo = ((Ri = String.fromCodePoint) === null || Ri === void 0 ? void 0 : Ri.call(String, 32, 128124)) === " 👼";
+const Ko = ((ki = Array.from) === null || ki === void 0 ? void 0 : ki.call(Array, "👼").length) === 1, Go = ((Ii = " ".codePointAt) === null || Ii === void 0 ? void 0 : Ii.call(" ", 0)) != null, Jo = ((Ri = String.fromCodePoint) === null || Ri === void 0 ? void 0 : Ri.call(String, 32, 128124)) === " 👼";
let un, mn;
-un = Po && Fo ? (s) => Array.from(s).map((t) => t.codePointAt(0)) : function(s) {
+un = Ko && Go ? (s) => Array.from(s).map((t) => t.codePointAt(0)) : function(s) {
const t = [];
let e = 0;
const { length: i } = s;
@@ -256,7 +256,7 @@ un = Po && Fo ? (s) => Array.from(s).map((t) => t.codePointAt(0)) : function(s)
t.push(n);
}
return t;
-}, mn = qo ? (s) => String.fromCodePoint(...Array.from(s || [])) : function(s) {
+}, mn = Jo ? (s) => String.fromCodePoint(...Array.from(s || [])) : function(s) {
return (() => {
const t = [];
return Array.from(s).forEach((e) => {
@@ -265,13 +265,13 @@ un = Po && Fo ? (s) => Array.from(s).map((t) => t.codePointAt(0)) : function(s)
}), t;
})().join("");
};
-let Ho = 0;
-class Bt extends B {
+let Yo = 0;
+class Nt extends N {
static fromJSONString(t) {
return this.fromJSON(JSON.parse(t));
}
constructor() {
- super(...arguments), this.id = ++Ho;
+ super(...arguments), this.id = ++Yo;
}
hasSameConstructorAs(t) {
return this.constructor === (t == null ? void 0 : t.constructor);
@@ -309,8 +309,8 @@ const Ot = function() {
const t = s.slice(0);
for (var e = arguments.length, i = new Array(e > 1 ? e - 1 : 0), n = 1; n < e; n++) i[n - 1] = arguments[n];
return t.splice(...i), t;
-}, $o = /[\u05BE\u05C0\u05C3\u05D0-\u05EA\u05F0-\u05F4\u061B\u061F\u0621-\u063A\u0640-\u064A\u066D\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D5\u06E5\u06E6\u200F\u202B\u202E\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE72\uFE74\uFE76-\uFEFC]/, Uo = function() {
- const s = _("input", { dir: "auto", name: "x", dirName: "x.dir" }), t = _("textarea", { dir: "auto", name: "y", dirName: "y.dir" }), e = _("form");
+}, Xo = /[\u05BE\u05C0\u05C3\u05D0-\u05EA\u05F0-\u05F4\u061B\u061F\u0621-\u063A\u0640-\u064A\u066D\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D5\u06E5\u06E6\u200F\u202B\u202E\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE72\uFE74\uFE76-\uFEFC]/, Qo = function() {
+ const s = A("input", { dir: "auto", name: "x", dirName: "x.dir" }), t = A("textarea", { dir: "auto", name: "y", dirName: "y.dir" }), e = A("form");
e.appendChild(s), e.appendChild(t);
const i = function() {
try {
@@ -331,31 +331,31 @@ const Ot = function() {
return s.value = r, s.matches(":dir(rtl)") ? "rtl" : "ltr";
} : function(r) {
const o = r.trim().charAt(0);
- return $o.test(o) ? "rtl" : "ltr";
+ return Xo.test(o) ? "rtl" : "ltr";
};
}();
let Di = null, Oi = null, Mi = null, Pe = null;
-const gn = () => (Di || (Di = Vo().concat(jo())), Di), O = (s) => G[s], jo = () => (Oi || (Oi = Object.keys(G)), Oi), pn = (s) => Dt[s], Vo = () => (Mi || (Mi = Object.keys(Dt)), Mi), Tr = function(s, t) {
- Wo(s).textContent = t.replace(/%t/g, s);
-}, Wo = function(s) {
+const gn = () => (Di || (Di = ta().concat(Zo())), Di), O = (s) => G[s], Zo = () => (Oi || (Oi = Object.keys(G)), Oi), pn = (s) => Dt[s], ta = () => (Mi || (Mi = Object.keys(Dt)), Mi), Pr = function(s, t) {
+ ea(s).textContent = t.replace(/%t/g, s);
+}, ea = function(s) {
const t = document.createElement("style");
t.setAttribute("type", "text/css"), t.setAttribute("data-tag-name", s.toLowerCase());
- const e = zo();
+ const e = ia();
return e && t.setAttribute("nonce", e), document.head.insertBefore(t, document.head.firstChild), t;
-}, zo = function() {
+}, ia = function() {
const s = us("trix-csp-nonce") || us("csp-nonce");
if (s) {
const { nonce: t, content: e } = s;
return t == "" ? e : t;
}
-}, us = (s) => document.head.querySelector("meta[name=".concat(s, "]")), ms = { "application/x-trix-feature-detection": "test" }, kr = function(s) {
+}, us = (s) => document.head.querySelector("meta[name=".concat(s, "]")), ms = { "application/x-trix-feature-detection": "test" }, Fr = function(s) {
const t = s.getData("text/plain"), e = s.getData("text/html");
if (!t || !e) return t == null ? void 0 : t.length;
{
const { body: i } = new DOMParser().parseFromString(e, "text/html");
if (i.textContent === t) return !i.querySelector("*");
}
-}, Ir = /Mac|^iP/.test(navigator.platform) ? (s) => s.metaKey : (s) => s.ctrlKey, In = (s) => setTimeout(s, 1), Rr = function() {
+}, qr = /Mac|^iP/.test(navigator.platform) ? (s) => s.metaKey : (s) => s.ctrlKey, In = (s) => setTimeout(s, 1), Hr = function() {
let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
const t = {};
for (const e in s) {
@@ -369,22 +369,22 @@ const gn = () => (Di || (Di = Vo().concat(jo())), Di), O = (s) => G[s], jo = ()
for (const e in s)
if (s[e] !== t[e]) return !1;
return !0;
-}, C = function(s) {
+}, T = function(s) {
if (s != null) return Array.isArray(s) || (s = [s, s]), [gs(s[0]), gs(s[1] != null ? s[1] : s[0])];
}, pt = function(s) {
if (s == null) return;
- const [t, e] = C(s);
+ const [t, e] = T(s);
return fn(t, e);
}, Xe = function(s, t) {
if (s == null || t == null) return;
- const [e, i] = C(s), [n, r] = C(t);
+ const [e, i] = T(s), [n, r] = T(t);
return fn(e, n) && fn(i, r);
}, gs = function(s) {
- return typeof s == "number" ? s : Rr(s);
+ return typeof s == "number" ? s : Hr(s);
}, fn = function(s, t) {
return typeof s == "number" ? s === t : Xt(s, t);
};
-class Dr extends B {
+class $r extends N {
constructor() {
super(...arguments), this.update = this.update.bind(this), this.selectionManagers = [];
}
@@ -410,32 +410,32 @@ class Dr extends B {
this.update();
}
}
-const Mt = new Dr(), Or = function() {
+const Mt = new $r(), Ur = function() {
const s = window.getSelection();
if (s.rangeCount > 0) return s;
}, fe = function() {
var s;
- const t = (s = Or()) === null || s === void 0 ? void 0 : s.getRangeAt(0);
- if (t && !Ko(t)) return t;
-}, Mr = function(s) {
+ const t = (s = Ur()) === null || s === void 0 ? void 0 : s.getRangeAt(0);
+ if (t && !na(t)) return t;
+}, jr = function(s) {
const t = window.getSelection();
return t.removeAllRanges(), t.addRange(s), Mt.update();
-}, Ko = (s) => ps(s.startContainer) || ps(s.endContainer), ps = (s) => !Object.getPrototypeOf(s), ue = (s) => s.replace(new RegExp("".concat(ni), "g"), "").replace(new RegExp("".concat(At), "g"), " "), Rn = new RegExp("[^\\S".concat(At, "]")), Dn = (s) => s.replace(new RegExp("".concat(Rn.source), "g"), " ").replace(/\ {2,}/g, " "), fs = function(s, t) {
+}, na = (s) => ps(s.startContainer) || ps(s.endContainer), ps = (s) => !Object.getPrototypeOf(s), ue = (s) => s.replace(new RegExp("".concat(ni), "g"), "").replace(new RegExp("".concat(At), "g"), " "), Rn = new RegExp("[^\\S".concat(At, "]")), Dn = (s) => s.replace(new RegExp("".concat(Rn.source), "g"), " ").replace(/\ {2,}/g, " "), fs = function(s, t) {
if (s.isEqualTo(t)) return ["", ""];
- const e = Bi(s, t), { length: i } = e.utf16String;
+ const e = Ni(s, t), { length: i } = e.utf16String;
let n;
if (i) {
const { offset: r } = e, o = s.codepoints.slice(0, r).concat(s.codepoints.slice(r + i));
- n = Bi(t, ye.fromCodepoints(o));
- } else n = Bi(t, s);
+ n = Ni(t, ye.fromCodepoints(o));
+ } else n = Ni(t, s);
return [e.utf16String.toString(), n.utf16String.toString()];
-}, Bi = function(s, t) {
+}, Ni = function(s, t) {
let e = 0, i = s.length, n = t.length;
for (; e < i && s.charAt(e).isEqualTo(t.charAt(e)); ) e++;
for (; i > e + 1 && s.charAt(i - 1).isEqualTo(t.charAt(n - 1)); ) i--, n--;
return { utf16String: s.slice(e, i), offset: e };
};
-class X extends Bt {
+class X extends Nt {
static fromCommonAttributesOfObjects() {
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
if (!t.length) return new this();
@@ -452,7 +452,7 @@ class X extends Bt {
super(...arguments), this.values = Ge(t);
}
add(t, e) {
- return this.merge(Go(t, e));
+ return this.merge(sa(t, e));
}
remove(t) {
return new X(Ge(this.values, t));
@@ -464,7 +464,7 @@ class X extends Bt {
return t in this.values;
}
merge(t) {
- return new X(Jo(this.values, Yo(t)));
+ return new X(ra(this.values, oa(t)));
}
slice(t) {
const e = {};
@@ -505,10 +505,10 @@ class X extends Bt {
return { values: JSON.stringify(this.values) };
}
}
-const Go = function(s, t) {
+const sa = function(s, t) {
const e = {};
return e[s] = t, e;
-}, Jo = function(s, t) {
+}, ra = function(s, t) {
const e = Ge(s);
for (const i in t) {
const n = t[i];
@@ -522,7 +522,7 @@ const Go = function(s, t) {
}), e;
}, re = function(s) {
return s instanceof X ? s : new X(s);
-}, Yo = function(s) {
+}, oa = function(s) {
return s instanceof X ? s.values : s;
};
class On {
@@ -557,7 +557,7 @@ class On {
}), t.join("/");
}
}
-class Xo extends B {
+class aa extends N {
constructor() {
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
super(...arguments), this.objects = {}, Array.from(t).forEach((e) => {
@@ -570,7 +570,7 @@ class Xo extends B {
return this.objects[e];
}
}
-class Qo {
+class la {
constructor(t) {
this.reset(t);
}
@@ -590,7 +590,7 @@ class Qo {
}
}
const bs = (s) => s.dataset.trixStoreKey;
-class Qe extends B {
+class Qe extends N {
isPerforming() {
return this.performing === !0;
}
@@ -617,7 +617,7 @@ class Qe extends B {
}
}
Qe.proxyMethod("getPromise().then"), Qe.proxyMethod("getPromise().catch");
-class Nt extends B {
+class Bt extends N {
constructor(t) {
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
super(...arguments), this.object = t, this.options = e, this.childViews = [], this.rootView = this;
@@ -639,7 +639,7 @@ class Nt extends B {
}
createChildView(t, e) {
let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
- e instanceof On && (i.viewClass = t, t = Zo);
+ e instanceof On && (i.viewClass = t, t = ca);
const n = new t(e, i);
return this.recordChildView(n);
}
@@ -690,7 +690,7 @@ class Nt extends B {
}
}
}
-class Zo extends Nt {
+class ca extends Bt {
constructor() {
super(...arguments), this.objectGroup = this.object, this.viewClass = this.options.viewClass, delete this.options.viewClass;
}
@@ -713,8 +713,8 @@ class Zo extends Nt {
}
}
/*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */
-const { entries: Br, setPrototypeOf: vs, isFrozen: ta, getPrototypeOf: ea, getOwnPropertyDescriptor: ia } = Object;
-let { freeze: J, seal: tt, create: Nr } = Object, { apply: bn, construct: vn } = typeof Reflect < "u" && Reflect;
+const { entries: Vr, setPrototypeOf: vs, isFrozen: da, getPrototypeOf: ha, getOwnPropertyDescriptor: ua } = Object;
+let { freeze: J, seal: tt, create: zr } = Object, { apply: bn, construct: vn } = typeof Reflect < "u" && Reflect;
J || (J = function(s) {
return s;
}), tt || (tt = function(s) {
@@ -726,7 +726,7 @@ J || (J = function(s) {
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++) e[i - 1] = arguments[i];
return new s(...e);
});
-const Fe = Y(Array.prototype.forEach), na = Y(Array.prototype.lastIndexOf), _s = Y(Array.prototype.pop), oe = Y(Array.prototype.push), sa = Y(Array.prototype.splice), Je = Y(String.prototype.toLowerCase), Ni = Y(String.prototype.toString), Pi = Y(String.prototype.match), ae = Y(String.prototype.replace), ra = Y(String.prototype.indexOf), oa = Y(String.prototype.trim), rt = Y(Object.prototype.hasOwnProperty), z = Y(RegExp.prototype.test), le = (As = TypeError, function() {
+const Fe = Y(Array.prototype.forEach), ma = Y(Array.prototype.lastIndexOf), _s = Y(Array.prototype.pop), oe = Y(Array.prototype.push), ga = Y(Array.prototype.splice), Je = Y(String.prototype.toLowerCase), Bi = Y(String.prototype.toString), Pi = Y(String.prototype.match), ae = Y(String.prototype.replace), pa = Y(String.prototype.indexOf), fa = Y(String.prototype.trim), rt = Y(Object.prototype.hasOwnProperty), W = Y(RegExp.prototype.test), le = (As = TypeError, function() {
for (var s = arguments.length, t = new Array(s), e = 0; e < s; e++) t[e] = arguments[e];
return vn(As, t);
});
@@ -738,7 +738,7 @@ function Y(s) {
return bn(s, t, i);
};
}
-function A(s, t) {
+function y(s, t) {
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Je;
vs && vs(s, null);
let i = t.length;
@@ -746,97 +746,97 @@ function A(s, t) {
let n = t[i];
if (typeof n == "string") {
const r = e(n);
- r !== n && (ta(t) || (t[i] = r), n = r);
+ r !== n && (da(t) || (t[i] = r), n = r);
}
s[n] = !0;
}
return s;
}
-function aa(s) {
+function ba(s) {
for (let t = 0; t < s.length; t++)
rt(s, t) || (s[t] = null);
return s;
}
function mt(s) {
- const t = Nr(null);
- for (const [e, i] of Br(s))
- rt(s, e) && (Array.isArray(i) ? t[e] = aa(i) : i && typeof i == "object" && i.constructor === Object ? t[e] = mt(i) : t[e] = i);
+ const t = zr(null);
+ for (const [e, i] of Vr(s))
+ rt(s, e) && (Array.isArray(i) ? t[e] = ba(i) : i && typeof i == "object" && i.constructor === Object ? t[e] = mt(i) : t[e] = i);
return t;
}
function ce(s, t) {
for (; s !== null; ) {
- const e = ia(s, t);
+ const e = ua(s, t);
if (e) {
if (e.get) return Y(e.get);
if (typeof e.value == "function") return Y(e.value);
}
- s = ea(s);
+ s = ha(s);
}
return function() {
return null;
};
}
-const ys = J(["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"]), Fi = J(["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", "slot", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), qi = J(["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"]), la = J(["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"]), Hi = J(["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"]), ca = J(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Es = J(["#text"]), xs = J(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "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", "slot"]), $i = J(["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", "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", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "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-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "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"]), Ss = J(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "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"]), qe = J(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), da = tt(/\{\{[\w\W]*|[\w\W]*\}\}/gm), ha = tt(/<%[\w\W]*|[\w\W]*%>/gm), ua = tt(/\$\{[\w\W]*/gm), ma = tt(/^data-[\-\w.\u00B7-\uFFFF]+$/), ga = tt(/^aria-[\-\w]+$/), Pr = tt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), pa = tt(/^(?:\w+script|data):/i), fa = tt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Fr = tt(/^html$/i), ba = tt(/^[a-z][.\w]*(-[.\w]+)+$/i);
-var Ls = Object.freeze({ __proto__: null, ARIA_ATTR: ga, ATTR_WHITESPACE: fa, CUSTOM_ELEMENT: ba, DATA_ATTR: ma, DOCTYPE_NAME: Fr, ERB_EXPR: ha, IS_ALLOWED_URI: Pr, IS_SCRIPT_OR_DATA: pa, MUSTACHE_EXPR: da, TMPLIT_EXPR: ua });
-const va = 1, _a = 3, Aa = 7, ya = 8, Ea = 9, xa = function() {
+const ys = J(["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"]), Fi = J(["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", "slot", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), qi = J(["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"]), va = J(["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"]), Hi = J(["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"]), _a = J(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Es = J(["#text"]), xs = J(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "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", "slot"]), $i = J(["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", "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", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "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-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "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"]), Ss = J(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "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"]), qe = J(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Aa = tt(/\{\{[\w\W]*|[\w\W]*\}\}/gm), ya = tt(/<%[\w\W]*|[\w\W]*%>/gm), Ea = tt(/\$\{[\w\W]*/gm), xa = tt(/^data-[\-\w.\u00B7-\uFFFF]+$/), Sa = tt(/^aria-[\-\w]+$/), Wr = tt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), La = tt(/^(?:\w+script|data):/i), Ca = tt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Kr = tt(/^html$/i), Ta = tt(/^[a-z][.\w]*(-[.\w]+)+$/i);
+var Ls = Object.freeze({ __proto__: null, ARIA_ATTR: Sa, ATTR_WHITESPACE: Ca, CUSTOM_ELEMENT: Ta, DATA_ATTR: xa, DOCTYPE_NAME: Kr, ERB_EXPR: ya, IS_ALLOWED_URI: Wr, IS_SCRIPT_OR_DATA: La, MUSTACHE_EXPR: Aa, TMPLIT_EXPR: Ea });
+const wa = 1, ka = 3, Ia = 7, Ra = 8, Da = 9, Oa = function() {
return typeof window > "u" ? null : window;
};
var Ee = function s() {
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : xa();
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Oa();
const e = (c) => s(c);
- if (e.version = "3.2.7", e.removed = [], !t || !t.document || t.document.nodeType !== Ea || !t.Element) return e.isSupported = !1, e;
+ if (e.version = "3.2.7", e.removed = [], !t || !t.document || t.document.nodeType !== Da || !t.Element) return e.isSupported = !1, e;
let { document: i } = t;
- const n = i, r = n.currentScript, { DocumentFragment: o, HTMLTemplateElement: a, Node: l, Element: d, NodeFilter: h, NamedNodeMap: m = t.NamedNodeMap || t.MozNamedAttrMap, HTMLFormElement: p, DOMParser: f, trustedTypes: x } = t, w = d.prototype, j = ce(w, "cloneNode"), H = ce(w, "remove"), W = ce(w, "nextSibling"), M = ce(w, "childNodes"), I = ce(w, "parentNode");
+ const n = i, r = n.currentScript, { DocumentFragment: o, HTMLTemplateElement: a, Node: l, Element: d, NodeFilter: h, NamedNodeMap: m = t.NamedNodeMap || t.MozNamedAttrMap, HTMLFormElement: p, DOMParser: f, trustedTypes: _ } = t, S = d.prototype, j = ce(S, "cloneNode"), H = ce(S, "remove"), z = ce(S, "nextSibling"), M = ce(S, "childNodes"), I = ce(S, "parentNode");
if (typeof a == "function") {
const c = i.createElement("template");
c.content && c.content.ownerDocument && (i = c.content.ownerDocument);
}
- let L, et = "";
+ let C, et = "";
const { implementation: dt, createNodeIterator: li, createDocumentFragment: ci, getElementsByTagName: di } = i, { importNode: at } = n;
- let N = { afterSanitizeAttributes: [], afterSanitizeElements: [], afterSanitizeShadowDOM: [], beforeSanitizeAttributes: [], beforeSanitizeElements: [], beforeSanitizeShadowDOM: [], uponSanitizeAttribute: [], uponSanitizeElement: [], uponSanitizeShadowNode: [] };
- e.isSupported = typeof Br == "function" && typeof I == "function" && dt && dt.createHTMLDocument !== void 0;
- const { MUSTACHE_EXPR: we, ERB_EXPR: hi, TMPLIT_EXPR: ui, DATA_ATTR: Ao, ARIA_ATTR: yo, IS_SCRIPT_OR_DATA: Eo, ATTR_WHITESPACE: Nn, CUSTOM_ELEMENT: xo } = Ls;
+ let B = { afterSanitizeAttributes: [], afterSanitizeElements: [], afterSanitizeShadowDOM: [], beforeSanitizeAttributes: [], beforeSanitizeElements: [], beforeSanitizeShadowDOM: [], uponSanitizeAttribute: [], uponSanitizeElement: [], uponSanitizeShadowNode: [] };
+ e.isSupported = typeof Vr == "function" && typeof I == "function" && dt && dt.createHTMLDocument !== void 0;
+ const { MUSTACHE_EXPR: Te, ERB_EXPR: hi, TMPLIT_EXPR: ui, DATA_ATTR: Io, ARIA_ATTR: Ro, IS_SCRIPT_OR_DATA: Do, ATTR_WHITESPACE: Bn, CUSTOM_ELEMENT: Oo } = Ls;
let { IS_ALLOWED_URI: Pn } = Ls, F = null;
- const Fn = A({}, [...ys, ...Fi, ...qi, ...Hi, ...Es]);
+ const Fn = y({}, [...ys, ...Fi, ...qi, ...Hi, ...Es]);
let $ = null;
- const qn = A({}, [...xs, ...$i, ...Ss, ...qe]);
- let R = Object.seal(Nr(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 } })), Zt = null, mi = null, Hn = !0, gi = !0, $n = !1, Un = !0, Ft = !1, Te = !0, xt = !1, pi = !1, fi = !1, qt = !1, ke = !1, Ie = !1, jn = !0, Vn = !1, bi = !0, te = !1, Ht = {}, $t = null;
- const Wn = A({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
- let zn = null;
- const Kn = A({}, ["audio", "video", "img", "source", "image", "track"]);
+ const qn = y({}, [...xs, ...$i, ...Ss, ...qe]);
+ let R = Object.seal(zr(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 } })), Zt = null, mi = null, Hn = !0, gi = !0, $n = !1, Un = !0, Ft = !1, we = !0, xt = !1, pi = !1, fi = !1, qt = !1, ke = !1, Ie = !1, jn = !0, Vn = !1, bi = !0, te = !1, Ht = {}, $t = null;
+ const zn = y({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
+ let Wn = null;
+ const Kn = y({}, ["audio", "video", "img", "source", "image", "track"]);
let vi = null;
- const Gn = A({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Re = "http://www.w3.org/1998/Math/MathML", De = "http://www.w3.org/2000/svg", ht = "http://www.w3.org/1999/xhtml";
+ const Gn = y({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Re = "http://www.w3.org/1998/Math/MathML", De = "http://www.w3.org/2000/svg", ht = "http://www.w3.org/1999/xhtml";
let Ut = ht, _i = !1, Ai = null;
- const So = A({}, [Re, De, ht], Ni);
- let Oe = A({}, ["mi", "mo", "mn", "ms", "mtext"]), Me = A({}, ["annotation-xml"]);
- const Lo = A({}, ["title", "style", "font", "a", "script"]);
+ const Mo = y({}, [Re, De, ht], Bi);
+ let Oe = y({}, ["mi", "mo", "mn", "ms", "mtext"]), Me = y({}, ["annotation-xml"]);
+ const No = y({}, ["title", "style", "font", "a", "script"]);
let ee = null;
- const Co = ["application/xhtml+xml", "text/html"];
+ const Bo = ["application/xhtml+xml", "text/html"];
let q = null, jt = null;
- const wo = i.createElement("form"), Jn = function(c) {
+ const Po = i.createElement("form"), Jn = function(c) {
return c instanceof RegExp || c instanceof Function;
}, yi = function() {
let c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
if (!jt || jt !== c) {
- if (c && typeof c == "object" || (c = {}), c = mt(c), ee = Co.indexOf(c.PARSER_MEDIA_TYPE) === -1 ? "text/html" : c.PARSER_MEDIA_TYPE, q = ee === "application/xhtml+xml" ? Ni : Je, F = rt(c, "ALLOWED_TAGS") ? A({}, c.ALLOWED_TAGS, q) : Fn, $ = rt(c, "ALLOWED_ATTR") ? A({}, c.ALLOWED_ATTR, q) : qn, Ai = rt(c, "ALLOWED_NAMESPACES") ? A({}, c.ALLOWED_NAMESPACES, Ni) : So, vi = rt(c, "ADD_URI_SAFE_ATTR") ? A(mt(Gn), c.ADD_URI_SAFE_ATTR, q) : Gn, zn = rt(c, "ADD_DATA_URI_TAGS") ? A(mt(Kn), c.ADD_DATA_URI_TAGS, q) : Kn, $t = rt(c, "FORBID_CONTENTS") ? A({}, c.FORBID_CONTENTS, q) : Wn, Zt = rt(c, "FORBID_TAGS") ? A({}, c.FORBID_TAGS, q) : mt({}), mi = rt(c, "FORBID_ATTR") ? A({}, c.FORBID_ATTR, q) : mt({}), Ht = !!rt(c, "USE_PROFILES") && c.USE_PROFILES, Hn = c.ALLOW_ARIA_ATTR !== !1, gi = c.ALLOW_DATA_ATTR !== !1, $n = c.ALLOW_UNKNOWN_PROTOCOLS || !1, Un = c.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ft = c.SAFE_FOR_TEMPLATES || !1, Te = c.SAFE_FOR_XML !== !1, xt = c.WHOLE_DOCUMENT || !1, qt = c.RETURN_DOM || !1, ke = c.RETURN_DOM_FRAGMENT || !1, Ie = c.RETURN_TRUSTED_TYPE || !1, fi = c.FORCE_BODY || !1, jn = c.SANITIZE_DOM !== !1, Vn = c.SANITIZE_NAMED_PROPS || !1, bi = c.KEEP_CONTENT !== !1, te = c.IN_PLACE || !1, Pn = c.ALLOWED_URI_REGEXP || Pr, Ut = c.NAMESPACE || ht, Oe = c.MATHML_TEXT_INTEGRATION_POINTS || Oe, Me = c.HTML_INTEGRATION_POINTS || Me, R = c.CUSTOM_ELEMENT_HANDLING || {}, c.CUSTOM_ELEMENT_HANDLING && Jn(c.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (R.tagNameCheck = c.CUSTOM_ELEMENT_HANDLING.tagNameCheck), c.CUSTOM_ELEMENT_HANDLING && Jn(c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (R.attributeNameCheck = c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), c.CUSTOM_ELEMENT_HANDLING && typeof c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (R.allowCustomizedBuiltInElements = c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Ft && (gi = !1), ke && (qt = !0), Ht && (F = A({}, Es), $ = [], Ht.html === !0 && (A(F, ys), A($, xs)), Ht.svg === !0 && (A(F, Fi), A($, $i), A($, qe)), Ht.svgFilters === !0 && (A(F, qi), A($, $i), A($, qe)), Ht.mathMl === !0 && (A(F, Hi), A($, Ss), A($, qe))), c.ADD_TAGS && (F === Fn && (F = mt(F)), A(F, c.ADD_TAGS, q)), c.ADD_ATTR && ($ === qn && ($ = mt($)), A($, c.ADD_ATTR, q)), c.ADD_URI_SAFE_ATTR && A(vi, c.ADD_URI_SAFE_ATTR, q), c.FORBID_CONTENTS && ($t === Wn && ($t = mt($t)), A($t, c.FORBID_CONTENTS, q)), bi && (F["#text"] = !0), xt && A(F, ["html", "head", "body"]), F.table && (A(F, ["tbody"]), delete Zt.tbody), c.TRUSTED_TYPES_POLICY) {
+ if (c && typeof c == "object" || (c = {}), c = mt(c), ee = Bo.indexOf(c.PARSER_MEDIA_TYPE) === -1 ? "text/html" : c.PARSER_MEDIA_TYPE, q = ee === "application/xhtml+xml" ? Bi : Je, F = rt(c, "ALLOWED_TAGS") ? y({}, c.ALLOWED_TAGS, q) : Fn, $ = rt(c, "ALLOWED_ATTR") ? y({}, c.ALLOWED_ATTR, q) : qn, Ai = rt(c, "ALLOWED_NAMESPACES") ? y({}, c.ALLOWED_NAMESPACES, Bi) : Mo, vi = rt(c, "ADD_URI_SAFE_ATTR") ? y(mt(Gn), c.ADD_URI_SAFE_ATTR, q) : Gn, Wn = rt(c, "ADD_DATA_URI_TAGS") ? y(mt(Kn), c.ADD_DATA_URI_TAGS, q) : Kn, $t = rt(c, "FORBID_CONTENTS") ? y({}, c.FORBID_CONTENTS, q) : zn, Zt = rt(c, "FORBID_TAGS") ? y({}, c.FORBID_TAGS, q) : mt({}), mi = rt(c, "FORBID_ATTR") ? y({}, c.FORBID_ATTR, q) : mt({}), Ht = !!rt(c, "USE_PROFILES") && c.USE_PROFILES, Hn = c.ALLOW_ARIA_ATTR !== !1, gi = c.ALLOW_DATA_ATTR !== !1, $n = c.ALLOW_UNKNOWN_PROTOCOLS || !1, Un = c.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ft = c.SAFE_FOR_TEMPLATES || !1, we = c.SAFE_FOR_XML !== !1, xt = c.WHOLE_DOCUMENT || !1, qt = c.RETURN_DOM || !1, ke = c.RETURN_DOM_FRAGMENT || !1, Ie = c.RETURN_TRUSTED_TYPE || !1, fi = c.FORCE_BODY || !1, jn = c.SANITIZE_DOM !== !1, Vn = c.SANITIZE_NAMED_PROPS || !1, bi = c.KEEP_CONTENT !== !1, te = c.IN_PLACE || !1, Pn = c.ALLOWED_URI_REGEXP || Wr, Ut = c.NAMESPACE || ht, Oe = c.MATHML_TEXT_INTEGRATION_POINTS || Oe, Me = c.HTML_INTEGRATION_POINTS || Me, R = c.CUSTOM_ELEMENT_HANDLING || {}, c.CUSTOM_ELEMENT_HANDLING && Jn(c.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (R.tagNameCheck = c.CUSTOM_ELEMENT_HANDLING.tagNameCheck), c.CUSTOM_ELEMENT_HANDLING && Jn(c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (R.attributeNameCheck = c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), c.CUSTOM_ELEMENT_HANDLING && typeof c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (R.allowCustomizedBuiltInElements = c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Ft && (gi = !1), ke && (qt = !0), Ht && (F = y({}, Es), $ = [], Ht.html === !0 && (y(F, ys), y($, xs)), Ht.svg === !0 && (y(F, Fi), y($, $i), y($, qe)), Ht.svgFilters === !0 && (y(F, qi), y($, $i), y($, qe)), Ht.mathMl === !0 && (y(F, Hi), y($, Ss), y($, qe))), c.ADD_TAGS && (F === Fn && (F = mt(F)), y(F, c.ADD_TAGS, q)), c.ADD_ATTR && ($ === qn && ($ = mt($)), y($, c.ADD_ATTR, q)), c.ADD_URI_SAFE_ATTR && y(vi, c.ADD_URI_SAFE_ATTR, q), c.FORBID_CONTENTS && ($t === zn && ($t = mt($t)), y($t, c.FORBID_CONTENTS, q)), bi && (F["#text"] = !0), xt && y(F, ["html", "head", "body"]), F.table && (y(F, ["tbody"]), delete Zt.tbody), c.TRUSTED_TYPES_POLICY) {
if (typeof c.TRUSTED_TYPES_POLICY.createHTML != "function") throw le('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
if (typeof c.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw le('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
- L = c.TRUSTED_TYPES_POLICY, et = L.createHTML("");
- } else L === void 0 && (L = function(g, u) {
+ C = c.TRUSTED_TYPES_POLICY, et = C.createHTML("");
+ } else C === void 0 && (C = function(g, u) {
if (typeof g != "object" || typeof g.createPolicy != "function") return null;
- let y = null;
- const S = "data-tt-policy-suffix";
- u && u.hasAttribute(S) && (y = u.getAttribute(S));
- const v = "dompurify" + (y ? "#" + y : "");
+ let E = null;
+ const L = "data-tt-policy-suffix";
+ u && u.hasAttribute(L) && (E = u.getAttribute(L));
+ const v = "dompurify" + (E ? "#" + E : "");
try {
return g.createPolicy(v, { createHTML: (P) => P, createScriptURL: (P) => P });
} catch {
return console.warn("TrustedTypes policy " + v + " could not be created."), null;
}
- }(x, r)), L !== null && typeof et == "string" && (et = L.createHTML(""));
+ }(_, r)), C !== null && typeof et == "string" && (et = C.createHTML(""));
J && J(c), jt = c;
}
- }, Yn = A({}, [...Fi, ...qi, ...la]), Xn = A({}, [...Hi, ...ca]), lt = function(c) {
+ }, Yn = y({}, [...Fi, ...qi, ...va]), Xn = y({}, [...Hi, ..._a]), lt = function(c) {
oe(e.removed, { element: c });
try {
I(c).removeChild(c);
@@ -865,20 +865,20 @@ var Ee = function s() {
u = v && v[0];
}
ee === "application/xhtml+xml" && Ut === ht && (c = '' + c + "");
- const y = L ? L.createHTML(c) : c;
+ const E = C ? C.createHTML(c) : c;
if (Ut === ht) try {
- g = new f().parseFromString(y, ee);
+ g = new f().parseFromString(E, ee);
} catch {
}
if (!g || !g.documentElement) {
g = dt.createDocument(Ut, "template", null);
try {
- g.documentElement.innerHTML = _i ? et : y;
+ g.documentElement.innerHTML = _i ? et : E;
} catch {
}
}
- const S = g.body || g.documentElement;
- return c && u && S.insertBefore(i.createTextNode(u), S.childNodes[0] || null), Ut === ht ? di.call(g, xt ? "html" : "body")[0] : xt ? g.documentElement : S;
+ const L = g.body || g.documentElement;
+ return c && u && L.insertBefore(i.createTextNode(u), L.childNodes[0] || null), Ut === ht ? di.call(g, xt ? "html" : "body")[0] : xt ? g.documentElement : L;
}, Zn = function(c) {
return li.call(c.ownerDocument || c, c, h.SHOW_ELEMENT | h.SHOW_COMMENT | h.SHOW_TEXT | h.SHOW_PROCESSING_INSTRUCTION | h.SHOW_CDATA_SECTION, null);
}, Ei = function(c) {
@@ -887,45 +887,45 @@ var Ee = function s() {
return typeof l == "function" && c instanceof l;
};
function ut(c, g, u) {
- Fe(c, (y) => {
- y.call(e, g, u, jt);
+ Fe(c, (E) => {
+ E.call(e, g, u, jt);
});
}
const es = function(c) {
let g = null;
- if (ut(N.beforeSanitizeElements, c, null), Ei(c)) return lt(c), !0;
+ if (ut(B.beforeSanitizeElements, c, null), Ei(c)) return lt(c), !0;
const u = q(c.nodeName);
- if (ut(N.uponSanitizeElement, c, { tagName: u, allowedTags: F }), Te && c.hasChildNodes() && !ts(c.firstElementChild) && z(/<[/\w!]/g, c.innerHTML) && z(/<[/\w!]/g, c.textContent) || c.nodeType === Aa || Te && c.nodeType === ya && z(/<[/\w]/g, c.data)) return lt(c), !0;
+ if (ut(B.uponSanitizeElement, c, { tagName: u, allowedTags: F }), we && c.hasChildNodes() && !ts(c.firstElementChild) && W(/<[/\w!]/g, c.innerHTML) && W(/<[/\w!]/g, c.textContent) || c.nodeType === Ia || we && c.nodeType === Ra && W(/<[/\w]/g, c.data)) return lt(c), !0;
if (!F[u] || Zt[u]) {
- if (!Zt[u] && ns(u) && (R.tagNameCheck instanceof RegExp && z(R.tagNameCheck, u) || R.tagNameCheck instanceof Function && R.tagNameCheck(u)))
+ if (!Zt[u] && ns(u) && (R.tagNameCheck instanceof RegExp && W(R.tagNameCheck, u) || R.tagNameCheck instanceof Function && R.tagNameCheck(u)))
return !1;
if (bi && !$t[u]) {
- const y = I(c) || c.parentNode, S = M(c) || c.childNodes;
- if (S && y)
- for (let v = S.length - 1; v >= 0; --v) {
- const P = j(S[v], !0);
- P.__removalCount = (c.__removalCount || 0) + 1, y.insertBefore(P, W(c));
+ const E = I(c) || c.parentNode, L = M(c) || c.childNodes;
+ if (L && E)
+ for (let v = L.length - 1; v >= 0; --v) {
+ const P = j(L[v], !0);
+ P.__removalCount = (c.__removalCount || 0) + 1, E.insertBefore(P, z(c));
}
}
return lt(c), !0;
}
- return c instanceof d && !function(y) {
- let S = I(y);
- S && S.tagName || (S = { namespaceURI: Ut, tagName: "template" });
- const v = Je(y.tagName), P = Je(S.tagName);
- return !!Ai[y.namespaceURI] && (y.namespaceURI === De ? S.namespaceURI === ht ? v === "svg" : S.namespaceURI === Re ? v === "svg" && (P === "annotation-xml" || Oe[P]) : !!Yn[v] : y.namespaceURI === Re ? S.namespaceURI === ht ? v === "math" : S.namespaceURI === De ? v === "math" && Me[P] : !!Xn[v] : y.namespaceURI === ht ? !(S.namespaceURI === De && !Me[P]) && !(S.namespaceURI === Re && !Oe[P]) && !Xn[v] && (Lo[v] || !Yn[v]) : !(ee !== "application/xhtml+xml" || !Ai[y.namespaceURI]));
- }(c) ? (lt(c), !0) : u !== "noscript" && u !== "noembed" && u !== "noframes" || !z(/<\/no(script|embed|frames)/i, c.innerHTML) ? (Ft && c.nodeType === _a && (g = c.textContent, Fe([we, hi, ui], (y) => {
- g = ae(g, y, " ");
- }), c.textContent !== g && (oe(e.removed, { element: c.cloneNode() }), c.textContent = g)), ut(N.afterSanitizeElements, c, null), !1) : (lt(c), !0);
+ return c instanceof d && !function(E) {
+ let L = I(E);
+ L && L.tagName || (L = { namespaceURI: Ut, tagName: "template" });
+ const v = Je(E.tagName), P = Je(L.tagName);
+ return !!Ai[E.namespaceURI] && (E.namespaceURI === De ? L.namespaceURI === ht ? v === "svg" : L.namespaceURI === Re ? v === "svg" && (P === "annotation-xml" || Oe[P]) : !!Yn[v] : E.namespaceURI === Re ? L.namespaceURI === ht ? v === "math" : L.namespaceURI === De ? v === "math" && Me[P] : !!Xn[v] : E.namespaceURI === ht ? !(L.namespaceURI === De && !Me[P]) && !(L.namespaceURI === Re && !Oe[P]) && !Xn[v] && (No[v] || !Yn[v]) : !(ee !== "application/xhtml+xml" || !Ai[E.namespaceURI]));
+ }(c) ? (lt(c), !0) : u !== "noscript" && u !== "noembed" && u !== "noframes" || !W(/<\/no(script|embed|frames)/i, c.innerHTML) ? (Ft && c.nodeType === ka && (g = c.textContent, Fe([Te, hi, ui], (E) => {
+ g = ae(g, E, " ");
+ }), c.textContent !== g && (oe(e.removed, { element: c.cloneNode() }), c.textContent = g)), ut(B.afterSanitizeElements, c, null), !1) : (lt(c), !0);
}, is = function(c, g, u) {
- if (jn && (g === "id" || g === "name") && (u in i || u in wo)) return !1;
- if (!(gi && !mi[g] && z(Ao, g))) {
- if (!(Hn && z(yo, g))) {
+ if (jn && (g === "id" || g === "name") && (u in i || u in Po)) return !1;
+ if (!(gi && !mi[g] && W(Io, g))) {
+ if (!(Hn && W(Ro, g))) {
if (!$[g] || mi[g]) {
- if (!(ns(c) && (R.tagNameCheck instanceof RegExp && z(R.tagNameCheck, c) || R.tagNameCheck instanceof Function && R.tagNameCheck(c)) && (R.attributeNameCheck instanceof RegExp && z(R.attributeNameCheck, g) || R.attributeNameCheck instanceof Function && R.attributeNameCheck(g, c)) || g === "is" && R.allowCustomizedBuiltInElements && (R.tagNameCheck instanceof RegExp && z(R.tagNameCheck, u) || R.tagNameCheck instanceof Function && R.tagNameCheck(u)))) return !1;
+ if (!(ns(c) && (R.tagNameCheck instanceof RegExp && W(R.tagNameCheck, c) || R.tagNameCheck instanceof Function && R.tagNameCheck(c)) && (R.attributeNameCheck instanceof RegExp && W(R.attributeNameCheck, g) || R.attributeNameCheck instanceof Function && R.attributeNameCheck(g, c)) || g === "is" && R.allowCustomizedBuiltInElements && (R.tagNameCheck instanceof RegExp && W(R.tagNameCheck, u) || R.tagNameCheck instanceof Function && R.tagNameCheck(u)))) return !1;
} else if (!vi[g]) {
- if (!z(Pn, ae(u, Nn, ""))) {
- if ((g !== "src" && g !== "xlink:href" && g !== "href" || c === "script" || ra(u, "data:") !== 0 || !zn[c]) && !($n && !z(Eo, ae(u, Nn, "")))) {
+ if (!W(Pn, ae(u, Bn, ""))) {
+ if ((g !== "src" && g !== "xlink:href" && g !== "href" || c === "script" || pa(u, "data:") !== 0 || !Wn[c]) && !($n && !W(Do, ae(u, Bn, "")))) {
if (u) return !1;
}
}
@@ -934,17 +934,17 @@ var Ee = function s() {
}
return !0;
}, ns = function(c) {
- return c !== "annotation-xml" && Pi(c, xo);
+ return c !== "annotation-xml" && Pi(c, Oo);
}, ss = function(c) {
- ut(N.beforeSanitizeAttributes, c, null);
+ ut(B.beforeSanitizeAttributes, c, null);
const { attributes: g } = c;
if (!g || Ei(c)) return;
const u = { attrName: "", attrValue: "", keepAttr: !0, allowedAttributes: $, forceKeepAttr: void 0 };
- let y = g.length;
- for (; y--; ) {
- const S = g[y], { name: v, namespaceURI: P, value: ft } = S, it = q(v), xi = ft;
- let U = v === "value" ? xi : oa(xi);
- if (u.attrName = it, u.attrValue = U, u.keepAttr = !0, u.forceKeepAttr = void 0, ut(N.uponSanitizeAttribute, c, u), U = u.attrValue, !Vn || it !== "id" && it !== "name" || (St(v, c), U = "user-content-" + U), Te && z(/((--!?|])>)|<\/(style|title|textarea)/i, U)) {
+ let E = g.length;
+ for (; E--; ) {
+ const L = g[E], { name: v, namespaceURI: P, value: ft } = L, it = q(v), xi = ft;
+ let U = v === "value" ? xi : fa(xi);
+ if (u.attrName = it, u.attrValue = U, u.keepAttr = !0, u.forceKeepAttr = void 0, ut(B.uponSanitizeAttribute, c, u), U = u.attrValue, !Vn || it !== "id" && it !== "name" || (St(v, c), U = "user-content-" + U), we && W(/((--!?|])>)|<\/(style|title|textarea)/i, U)) {
St(v, c);
continue;
}
@@ -957,21 +957,21 @@ var Ee = function s() {
St(v, c);
continue;
}
- if (!Un && z(/\/>/i, U)) {
+ if (!Un && W(/\/>/i, U)) {
St(v, c);
continue;
}
- Ft && Fe([we, hi, ui], (os) => {
+ Ft && Fe([Te, hi, ui], (os) => {
U = ae(U, os, " ");
});
const rs = q(c.nodeName);
if (is(rs, it, U)) {
- if (L && typeof x == "object" && typeof x.getAttributeType == "function" && !P) switch (x.getAttributeType(rs, it)) {
+ if (C && typeof _ == "object" && typeof _.getAttributeType == "function" && !P) switch (_.getAttributeType(rs, it)) {
case "TrustedHTML":
- U = L.createHTML(U);
+ U = C.createHTML(U);
break;
case "TrustedScriptURL":
- U = L.createScriptURL(U);
+ U = C.createScriptURL(U);
}
if (U !== xi) try {
P ? c.setAttributeNS(P, v, U) : c.setAttribute(v, U), Ei(c) ? lt(c) : _s(e.removed);
@@ -980,15 +980,15 @@ var Ee = function s() {
}
} else St(v, c);
}
- ut(N.afterSanitizeAttributes, c, null);
- }, To = function c(g) {
+ ut(B.afterSanitizeAttributes, c, null);
+ }, Fo = function c(g) {
let u = null;
- const y = Zn(g);
- for (ut(N.beforeSanitizeShadowDOM, g, null); u = y.nextNode(); ) ut(N.uponSanitizeShadowNode, u, null), es(u), ss(u), u.content instanceof o && c(u.content);
- ut(N.afterSanitizeShadowDOM, g, null);
+ const E = Zn(g);
+ for (ut(B.beforeSanitizeShadowDOM, g, null); u = E.nextNode(); ) ut(B.uponSanitizeShadowNode, u, null), es(u), ss(u), u.content instanceof o && c(u.content);
+ ut(B.afterSanitizeShadowDOM, g, null);
};
return e.sanitize = function(c) {
- let g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, y = null, S = null, v = null;
+ let g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, E = null, L = null, v = null;
if (_i = !c, _i && (c = ""), typeof c != "string" && !ts(c)) {
if (typeof c.toString != "function") throw le("toString is not a function");
if (typeof (c = c.toString()) != "string") throw le("dirty is not a string, aborting");
@@ -999,14 +999,14 @@ var Ee = function s() {
const it = q(c.nodeName);
if (!F[it] || Zt[it]) throw le("root node is forbidden and cannot be sanitized in-place");
}
- } else if (c instanceof l) u = Qn(""), y = u.ownerDocument.importNode(c, !0), y.nodeType === va && y.nodeName === "BODY" || y.nodeName === "HTML" ? u = y : u.appendChild(y);
+ } else if (c instanceof l) u = Qn(""), E = u.ownerDocument.importNode(c, !0), E.nodeType === wa && E.nodeName === "BODY" || E.nodeName === "HTML" ? u = E : u.appendChild(E);
else {
- if (!qt && !Ft && !xt && c.indexOf("<") === -1) return L && Ie ? L.createHTML(c) : c;
+ if (!qt && !Ft && !xt && c.indexOf("<") === -1) return C && Ie ? C.createHTML(c) : c;
if (u = Qn(c), !u) return qt ? null : Ie ? et : "";
}
u && fi && lt(u.firstChild);
const P = Zn(te ? c : u);
- for (; S = P.nextNode(); ) es(S), ss(S), S.content instanceof o && To(S.content);
+ for (; L = P.nextNode(); ) es(L), ss(L), L.content instanceof o && Fo(L.content);
if (te) return c;
if (qt) {
if (ke) for (v = ci.call(u.ownerDocument); u.firstChild; ) v.appendChild(u.firstChild);
@@ -1014,37 +1014,37 @@ var Ee = function s() {
return ($.shadowroot || $.shadowrootmode) && (v = at.call(n, v, !0)), v;
}
let ft = xt ? u.outerHTML : u.innerHTML;
- return xt && F["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && z(Fr, u.ownerDocument.doctype.name) && (ft = "
-` + ft), Ft && Fe([we, hi, ui], (it) => {
+ return xt && F["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && W(Kr, u.ownerDocument.doctype.name) && (ft = "
+` + ft), Ft && Fe([Te, hi, ui], (it) => {
ft = ae(ft, it, " ");
- }), L && Ie ? L.createHTML(ft) : ft;
+ }), C && Ie ? C.createHTML(ft) : ft;
}, e.setConfig = function() {
yi(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), pi = !0;
}, e.clearConfig = function() {
jt = null, pi = !1;
}, e.isValidAttribute = function(c, g, u) {
jt || yi({});
- const y = q(c), S = q(g);
- return is(y, S, u);
+ const E = q(c), L = q(g);
+ return is(E, L, u);
}, e.addHook = function(c, g) {
- typeof g == "function" && oe(N[c], g);
+ typeof g == "function" && oe(B[c], g);
}, e.removeHook = function(c, g) {
if (g !== void 0) {
- const u = na(N[c], g);
- return u === -1 ? void 0 : sa(N[c], u, 1)[0];
+ const u = ma(B[c], g);
+ return u === -1 ? void 0 : ga(B[c], u, 1)[0];
}
- return _s(N[c]);
+ return _s(B[c]);
}, e.removeHooks = function(c) {
- N[c] = [];
+ B[c] = [];
}, e.removeAllHooks = function() {
- N = { afterSanitizeAttributes: [], afterSanitizeElements: [], afterSanitizeShadowDOM: [], beforeSanitizeAttributes: [], beforeSanitizeElements: [], beforeSanitizeShadowDOM: [], uponSanitizeAttribute: [], uponSanitizeElement: [], uponSanitizeShadowNode: [] };
+ B = { afterSanitizeAttributes: [], afterSanitizeElements: [], afterSanitizeShadowDOM: [], beforeSanitizeAttributes: [], beforeSanitizeElements: [], beforeSanitizeShadowDOM: [], uponSanitizeAttribute: [], uponSanitizeElement: [], uponSanitizeShadowNode: [] };
}, e;
}();
Ee.addHook("uponSanitizeAttribute", function(s, t) {
/^data-trix-/.test(t.attrName) && (t.forceKeepAttr = !0);
});
-const Sa = "style href src width height language class".split(" "), La = "javascript:".split(" "), Ca = "script iframe form noscript".split(" ");
-class si extends B {
+const Ma = "style href src width height language class".split(" "), Na = "javascript:".split(" "), Ba = "script iframe form noscript".split(" ");
+class si extends N {
static setHTML(t, e, i) {
const n = new this(e, i).sanitize(), r = n.getHTML ? n.getHTML() : n.outerHTML;
t.innerHTML = r;
@@ -1055,11 +1055,11 @@ class si extends B {
}
constructor(t) {
let { allowedAttributes: e, forbiddenProtocols: i, forbiddenElements: n, purifyOptions: r } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
- super(...arguments), this.allowedAttributes = e || Sa, this.forbiddenProtocols = i || La, this.forbiddenElements = n || Ca, this.purifyOptions = r || {}, this.body = wa(t);
+ super(...arguments), this.allowedAttributes = e || Ma, this.forbiddenProtocols = i || Na, this.forbiddenElements = n || Ba, this.purifyOptions = r || {}, this.body = Pa(t);
}
sanitize() {
this.sanitizeElements(), this.normalizeListElementNesting();
- const t = Object.assign({}, yr, this.purifyOptions);
+ const t = Object.assign({}, Ir, this.purifyOptions);
return Ee.setConfig(t), this.body = Ee.sanitize(this.body), this.body;
}
getHTML() {
@@ -1104,7 +1104,7 @@ class si extends B {
return t.getAttribute("data-trix-serialize") === "false" && !It(t);
}
}
-const wa = function() {
+const Pa = function() {
let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
s = s.replace(/<\/html[^>]*>[^]*$/i, "