diff --git a/controllers/almanach_contents_edit.go b/controllers/almanach_contents_edit.go index 70624b7..965d3c8 100644 --- a/controllers/almanach_contents_edit.go +++ b/controllers/almanach_contents_edit.go @@ -17,6 +17,7 @@ import ( "github.com/Theodor-Springmann-Stiftung/musenalm/templating" "github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/tools/router" + "github.com/pocketbase/pocketbase/tools/filesystem" ) const ( @@ -317,6 +318,8 @@ func (p *AlmanachContentsEditPage) POSTSave(engine *templating.Engine, app core. uploadedScans, _ := e.FindUploadedFiles(dbmodels.SCAN_FIELD) deleteScans := valuesForKey(e.Request.PostForm, "scans_delete") + scansOrder := valuesForKey(e.Request.PostForm, "scans_order") + pendingScanIDs := valuesForKey(e.Request.PostForm, "scans_pending_ids") targetContentID := contentID if targetContentID == "" && len(contentInputs) == 1 { for id := range contentInputs { @@ -403,7 +406,7 @@ func (p *AlmanachContentsEditPage) POSTSave(engine *templating.Engine, app core. } } } - if targetContentID != "" && (len(uploadedScans) > 0 || len(deleteScans) > 0) { + if targetContentID != "" && (len(uploadedScans) > 0 || len(deleteScans) > 0 || len(scansOrder) > 0) { record, err := tx.FindRecordById(dbmodels.CONTENTS_TABLE, targetContentID) if err != nil { return err @@ -412,16 +415,74 @@ func (p *AlmanachContentsEditPage) POSTSave(engine *templating.Engine, app core. if content.Entry() != entry.Id { return fmt.Errorf("Beitrag gehört zu einem anderen Band.") } - if len(uploadedScans) > 0 { - content.Set(dbmodels.SCAN_FIELD+"+", uploadedScans) + deleteSet := map[string]struct{}{} + for _, scan := range deleteScans { + scan = strings.TrimSpace(scan) + if scan == "" { + continue + } + deleteSet[scan] = struct{}{} } - if len(deleteScans) > 0 { - for _, scan := range deleteScans { - scan = strings.TrimSpace(scan) - if scan == "" { + if len(scansOrder) > 0 || len(pendingScanIDs) > 0 { + pendingMap := map[string]*filesystem.File{} + for idx, id := range pendingScanIDs { + if idx >= len(uploadedScans) { + break + } + id = strings.TrimSpace(id) + if id == "" { continue } - content.Set(dbmodels.SCAN_FIELD+"-", scan) + pendingMap[id] = uploadedScans[idx] + } + ordered := make([]any, 0, len(scansOrder)+len(uploadedScans)) + seenExisting := map[string]struct{}{} + for _, token := range scansOrder { + token = strings.TrimSpace(token) + if token == "" { + continue + } + if strings.HasPrefix(token, "pending:") { + id := strings.TrimPrefix(token, "pending:") + if file, ok := pendingMap[id]; ok { + ordered = append(ordered, file) + } + continue + } + if strings.HasPrefix(token, "existing:") { + name := strings.TrimPrefix(token, "existing:") + if name == "" { + continue + } + if _, deleted := deleteSet[name]; deleted { + continue + } + ordered = append(ordered, name) + seenExisting[name] = struct{}{} + } + } + for _, name := range content.Scans() { + if _, deleted := deleteSet[name]; deleted { + continue + } + if _, seen := seenExisting[name]; seen { + continue + } + ordered = append(ordered, name) + } + content.Set(dbmodels.SCAN_FIELD, ordered) + } else { + if len(uploadedScans) > 0 { + content.Set(dbmodels.SCAN_FIELD+"+", uploadedScans) + } + if len(deleteScans) > 0 { + for _, scan := range deleteScans { + scan = strings.TrimSpace(scan) + if scan == "" { + continue + } + content.Set(dbmodels.SCAN_FIELD+"-", scan) + } } } if user != nil { diff --git a/views/assets/scripts.js b/views/assets/scripts.js index 6ecb137..d13ac4f 100644 --- a/views/assets/scripts.js +++ b/views/assets/scripts.js @@ -3,18 +3,18 @@ var cs = (s) => { throw TypeError(s); }; var Uo = (s, t, e) => t in s ? $o(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e; -var zt = (s, t, e) => Uo(s, typeof t != "symbol" ? t + "" : t, e), Li = (s, t, e) => t.has(s) || cs("Cannot " + e); -var Ci = (s, t, e) => (Li(s, t, "read from private field"), e ? e.call(s) : t.get(s)), se = (s, t, e) => t.has(s) ? cs("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), Be = (s, t, e, i) => (Li(s, t, "write to private field"), i ? i.call(s, e) : t.set(s, e), e), Pe = (s, t, e) => (Li(s, t, "access private method"), e); +var Kt = (s, t, e) => Uo(s, typeof t != "symbol" ? t + "" : t, e), Li = (s, t, e) => t.has(s) || cs("Cannot " + e); +var Ci = (s, t, e) => (Li(s, t, "read from private field"), e ? e.call(s) : t.get(s)), oe = (s, t, e) => t.has(s) ? cs("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), Fe = (s, t, e, i) => (Li(s, t, "write to private field"), i ? i.call(s, e) : t.set(s, e), e), qe = (s, t, e) => (Li(s, t, "access private method"), e); var jo = "2.1.16"; -const It = "[data-trix-attachment]", wn = { 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 ds(s.parentNode) === G[this.listAttribute].tagName; +const Rt = "[data-trix-attachment]", wn = { preview: { presentation: "gallery", caption: { name: !0, size: !0 } }, file: { caption: { size: !0 } } }, J = { 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 ds(s.parentNode) === J[this.listAttribute].tagName; } }, numberList: { tagName: "ol", parse: !1 }, number: { tagName: "li", listAttribute: "numberList", group: !1, nestable: !0, test(s) { - return ds(s.parentNode) === G[this.listAttribute].tagName; + return ds(s.parentNode) === J[this.listAttribute].tagName; } }, attachmentGallery: { tagName: "div", exclusive: !0, terminal: !0, parse: !1, group: !1 } }, ds = (s) => { var t; return s == null || (t = s.tagName) === null || t === void 0 ? void 0 : t.toLowerCase(); }, hs = navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i), wi = hs && parseInt(hs[1]); -var Ce = { composesExistingText: /Android.*Chrome/.test(navigator.userAgent), recentAndroid: wi && wi > 12, samsungAndroid: wi && 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) }, Dr = { ADD_ATTR: ["language"], SAFE_FOR_XML: !1, RETURN_DOM: !0 }, v = { 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" }; +var Te = { composesExistingText: /Android.*Chrome/.test(navigator.userAgent), recentAndroid: wi && wi > 12, samsungAndroid: wi && 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) }, Dr = { ADD_ATTR: ["language"], SAFE_FOR_XML: !1, RETURN_DOM: !0 }, v = { 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 Vo = [v.bytes, v.KB, v.MB, v.GB, v.TB, v.PB]; var Or = { prefix: "IEC", precision: 2, formatter(s) { switch (s) { @@ -29,43 +29,43 @@ var Or = { prefix: "IEC", precision: 2, formatter(s) { return "".concat(i, " ").concat(Vo[e]); } } }; -const si = "\uFEFF", At = " ", Mr = function(s) { +const oi = "\uFEFF", Et = " ", Mr = function(s) { for (const t in s) { const e = s[t]; this[t] = e; } return this; -}, Tn = document.documentElement, zo = Tn.matches, R = function(s) { +}, Tn = document.documentElement, zo = Tn.matches, O = 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 || Tn, l = e, d = n === "capturing", h = function(u) { + const a = t || Tn, l = e, d = n === "capturing", h = function(m) { o != null && --o == 0 && h.destroy(); - const g = Et(u.target, { matchingSelector: l }); - g != null && (i == null || i.call(g, u, g), r && u.preventDefault()); + const f = xt(m.target, { matchingSelector: l }); + f != null && (i == null || i.call(f, m, f), r && m.preventDefault()); }; return h.destroy = () => a.removeEventListener(s, h, d), a.addEventListener(s, h, d), h; -}, Nr = function(s) { +}, Br = 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 && Mr.call(n, i), n; -}, ge = function(s) { +}, fe = function(s) { let { onElement: t, bubbles: e, cancelable: i, attributes: n } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - const r = t ?? Tn, o = Nr(s, { bubbles: e, cancelable: i, attributes: n }); + const r = t ?? Tn, o = Br(s, { bubbles: e, cancelable: i, attributes: n }); return r.dispatchEvent(o); -}, Br = function(s, t) { +}, Nr = function(s, t) { if ((s == null ? void 0 : s.nodeType) === 1) return zo.call(s, t); -}, Et = function(s) { +}, xt = 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; if (s != null) { if (t == null) return s; if (s.closest && e == null) return s.closest(t); for (; s && s !== e; ) { - if (Br(s, t)) return s; + if (Nr(s, t)) return s; s = s.parentNode; } } -}, kn = (s) => document.activeElement !== s && Tt(s, document.activeElement), Tt = function(s, t) { +}, kn = (s) => document.activeElement !== s && kt(s, document.activeElement), kt = function(s, t) { if (s && t) for (; t; ) { if (t === s) return !0; t = t.parentNode; @@ -76,10 +76,10 @@ const si = "\uFEFF", At = " ", Mr = function(s) { let e = 0; for (s = s.previousSibling; s; ) e++, s = s.previousSibling; return e; -}, xt = (s) => { +}, St = (s) => { var t; return s == null || (t = s.parentNode) === null || t === void 0 ? void 0 : t.removeChild(s); -}, Xe = function(s) { +}, Ze = function(s) { let { onlyNodesOfType: t, usingFilter: e, expandEntityReferences: i } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; const n = (() => { switch (t) { @@ -94,10 +94,10 @@ const si = "\uFEFF", At = " ", Mr = function(s) { } })(); return document.createTreeWalker(s, n, e ?? null, i === !0); -}, K = (s) => { +}, G = (s) => { var t; return s == null || (t = s.tagName) === null || t === void 0 ? void 0 : t.toLowerCase(); -}, A = function(s) { +}, x = 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); @@ -110,37 +110,37 @@ const si = "\uFEFF", At = " ", Mr = function(s) { n.appendChild(r); }), n; }; -let re; -const pe = function() { - if (re != null) return re; - re = []; - for (const s in G) { - const t = G[s]; - t.tagName && re.push(t.tagName); +let ae; +const be = function() { + if (ae != null) return ae; + ae = []; + for (const s in J) { + const t = J[s]; + t.tagName && ae.push(t.tagName); } - return re; -}, ki = (s) => Jt(s == null ? void 0 : s.firstChild), us = function(s) { + return ae; +}, ki = (s) => Xt(s == null ? void 0 : s.firstChild), us = function(s) { let { strict: t } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { strict: !0 }; - return t ? Jt(s) : Jt(s) || !Jt(s.firstChild) && function(e) { - return pe().includes(K(e)) && !pe().includes(K(e.firstChild)); + return t ? Xt(s) : Xt(s) || !Xt(s.firstChild) && function(e) { + return be().includes(G(e)) && !be().includes(G(e.firstChild)); }(s); -}, Jt = (s) => Wo(s) && (s == null ? void 0 : s.data) === "block", Wo = (s) => (s == null ? void 0 : s.nodeType) === Node.COMMENT_NODE, Yt = function(s) { +}, Xt = (s) => Wo(s) && (s == null ? void 0 : s.data) === "block", Wo = (s) => (s == null ? void 0 : s.nodeType) === Node.COMMENT_NODE, Qt = function(s) { let { name: t } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - if (s) return fe(s) ? s.data === si ? !t || s.parentNode.dataset.trixCursorTarget === t : void 0 : Yt(s.firstChild); -}, Rt = (s) => Br(s, It), Pr = (s) => fe(s) && (s == null ? void 0 : s.data) === "", fe = (s) => (s == null ? void 0 : s.nodeType) === Node.TEXT_NODE, In = { level2Enabled: !0, getLevel() { - return this.level2Enabled && Ce.supportsInputEvents ? 2 : 0; + if (s) return ve(s) ? s.data === oi ? !t || s.parentNode.dataset.trixCursorTarget === t : void 0 : Qt(s.firstChild); +}, Dt = (s) => Nr(s, Rt), Pr = (s) => ve(s) && (s == null ? void 0 : s.data) === "", ve = (s) => (s == null ? void 0 : s.nodeType) === Node.TEXT_NODE, In = { level2Enabled: !0, getLevel() { + return this.level2Enabled && Te.supportsInputEvents ? 2 : 0; }, pickFiles(s) { - const t = A("input", { type: "file", multiple: !0, hidden: !0, id: this.fileInputId }); + const t = x("input", { type: "file", multiple: !0, hidden: !0, id: this.fileInputId }); t.addEventListener("change", () => { - s(t.files), xt(t); - }), xt(document.getElementById(this.fileInputId)), document.body.appendChild(t), t.click(); + s(t.files), St(t); + }), St(document.getElementById(this.fileInputId)), document.body.appendChild(t), t.click(); } }; -var Ge = { removeBlankTableCells: !1, tableCellSeparator: " | ", tableRowSeparator: ` -` }, Ot = { bold: { tagName: "strong", inheritable: !0, parser(s) { +var Ye = { removeBlankTableCells: !1, tableCellSeparator: " | ", tableRowSeparator: ` +` }, Mt = { bold: { tagName: "strong", inheritable: !0, parser(s) { const t = window.getComputedStyle(s); return t.fontWeight === "bold" || t.fontWeight >= 600; } }, italic: { tagName: "em", inheritable: !0, parser: (s) => window.getComputedStyle(s).fontStyle === "italic" }, href: { groupTagName: "a", parser(s) { - const t = "a:not(".concat(It, ")"), e = s.closest(t); + const t = "a:not(".concat(Rt, ")"), e = s.closest(t); if (e) return e.getAttribute("href"); } }, strike: { tagName: "del", inheritable: !0 }, frozen: { style: { backgroundColor: "highlight" } } }, Fr = { getDefaultHTML: () => `
`) }; const un = { interval: 5e3 }; -var we = Object.freeze({ __proto__: null, attachments: wn, blockAttributes: G, browser: Ce, 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: Dr, fileSize: Or, input: In, keyNames: { 8: "backspace", 9: "tab", 13: "return", 27: "escape", 37: "left", 39: "right", 46: "delete", 68: "d", 72: "h", 79: "o" }, lang: v, parser: Ge, textAttributes: Ot, toolbar: Fr, undo: un }); -class P { +var ke = Object.freeze({ __proto__: null, attachments: wn, blockAttributes: J, browser: Te, 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: Dr, fileSize: Or, input: In, keyNames: { 8: "backspace", 9: "tab", 13: "return", 27: "escape", 37: "left", 39: "right", 46: "delete", 68: "d", 72: "h", 79: "o" }, lang: v, parser: Ye, textAttributes: Mt, toolbar: Fr, undo: un }); +class F { static proxyMethod(t) { const { name: e, toMethod: i, toProperty: n, optional: r } = Ko(t); this.prototype[e] = function() { @@ -202,7 +202,7 @@ const Ko = function(s) { return t[2] != null ? e.toMethod = t[1] : e.toProperty = t[1], t[3] != null && (e.optional = !0), e; }, { apply: ms } = Function.prototype, Go = new RegExp("^(.+?)(\\(\\))?(\\?)?\\.(.+?)$"); var Ii, Ri, Di; -class Ee extends P { +class Se extends F { 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()); @@ -266,7 +266,7 @@ mn = Jo && Yo ? (s) => Array.from(s).map((t) => t.codePointAt(0)) : function(s) })().join(""); }; let Qo = 0; -class Bt extends P { +class Pt extends F { static fromJSONString(t) { return this.fromJSON(JSON.parse(t)); } @@ -293,13 +293,13 @@ class Bt extends P { return JSON.stringify(this); } toUTF16String() { - return Ee.box(this); + return Se.box(this); } getCacheKey() { return this.id.toString(); } } -const Mt = function() { +const Bt = function() { let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (s.length !== t.length) return !1; for (let e = 0; e < s.length; e++) @@ -310,7 +310,7 @@ const Mt = function() { 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; }, Zo = /[\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]/, ta = 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"); + const s = x("input", { dir: "auto", name: "x", dirName: "x.dir" }), t = x("textarea", { dir: "auto", name: "y", dirName: "y.dir" }), e = x("form"); e.appendChild(s), e.appendChild(t); const i = function() { try { @@ -334,8 +334,8 @@ const Mt = function() { return Zo.test(o) ? "rtl" : "ltr"; }; }(); -let Oi = null, Mi = null, Ni = null, Fe = null; -const pn = () => (Oi || (Oi = ia().concat(ea())), Oi), N = (s) => G[s], ea = () => (Mi || (Mi = Object.keys(G)), Mi), fn = (s) => Ot[s], ia = () => (Ni || (Ni = Object.keys(Ot)), Ni), qr = function(s, t) { +let Oi = null, Mi = null, Bi = null, He = null; +const pn = () => (Oi || (Oi = ia().concat(ea())), Oi), P = (s) => J[s], ea = () => (Mi || (Mi = Object.keys(J)), Mi), fn = (s) => Mt[s], ia = () => (Bi || (Bi = Object.keys(Mt)), Bi), qr = function(s, t) { na(s).textContent = t.replace(/%t/g, s); }, na = function(s) { const t = document.createElement("style"); @@ -363,7 +363,7 @@ const pn = () => (Oi || (Oi = ia().concat(ea())), Oi), N = (s) => G[s], ea = () t[e] = i; } return t; -}, Zt = function() { +}, ee = function() { let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; if (Object.keys(s).length !== Object.keys(t).length) return !1; for (const e in s) @@ -371,20 +371,20 @@ const pn = () => (Oi || (Oi = ia().concat(ea())), Oi), N = (s) => G[s], ea = () return !0; }, T = function(s) { if (s != null) return Array.isArray(s) || (s = [s, s]), [fs(s[0]), fs(s[1] != null ? s[1] : s[0])]; -}, ft = function(s) { +}, bt = function(s) { if (s == null) return; const [t, e] = T(s); return bn(t, e); -}, Qe = function(s, t) { +}, ti = function(s, t) { if (s == null || t == null) return; const [e, i] = T(s), [n, r] = T(t); return bn(e, n) && bn(i, r); }, fs = function(s) { return typeof s == "number" ? s : Ur(s); }, bn = function(s, t) { - return typeof s == "number" ? s === t : Zt(s, t); + return typeof s == "number" ? s === t : ee(s, t); }; -class jr extends P { +class jr extends F { constructor() { super(...arguments), this.update = this.update.bind(this), this.selectionManagers = []; } @@ -413,49 +413,49 @@ class jr extends P { const Nt = new jr(), Vr = function() { const s = window.getSelection(); if (s.rangeCount > 0) return s; -}, be = function() { +}, _e = function() { var s; const t = (s = Vr()) === null || s === void 0 ? void 0 : s.getRangeAt(0); if (t && !ra(t)) return t; }, zr = function(s) { const t = window.getSelection(); return t.removeAllRanges(), t.addRange(s), Nt.update(); -}, ra = (s) => bs(s.startContainer) || bs(s.endContainer), bs = (s) => !Object.getPrototypeOf(s), me = (s) => s.replace(new RegExp("".concat(si), "g"), "").replace(new RegExp("".concat(At), "g"), " "), On = new RegExp("[^\\S".concat(At, "]")), Mn = (s) => s.replace(new RegExp("".concat(On.source), "g"), " ").replace(/\ {2,}/g, " "), vs = function(s, t) { +}, ra = (s) => bs(s.startContainer) || bs(s.endContainer), bs = (s) => !Object.getPrototypeOf(s), pe = (s) => s.replace(new RegExp("".concat(oi), "g"), "").replace(new RegExp("".concat(Et), "g"), " "), On = new RegExp("[^\\S".concat(Et, "]")), Mn = (s) => s.replace(new RegExp("".concat(On.source), "g"), " ").replace(/\ {2,}/g, " "), vs = 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, Ee.fromCodepoints(o)); - } else n = Bi(t, s); + n = Ni(t, Se.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 Z extends Pt { static fromCommonAttributesOfObjects() { let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; if (!t.length) return new this(); - let e = oe(t[0]), i = e.getKeys(); + let e = le(t[0]), i = e.getKeys(); return t.slice(1).forEach((n) => { - i = e.getKeysCommonToHash(oe(n)), e = e.slice(i); + i = e.getKeysCommonToHash(le(n)), e = e.slice(i); }), e; } static box(t) { - return oe(t); + return le(t); } constructor() { let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - super(...arguments), this.values = Je(t); + super(...arguments), this.values = Xe(t); } add(t, e) { return this.merge(oa(t, e)); } remove(t) { - return new X(Je(this.values, t)); + return new Z(Xe(this.values, t)); } get(t) { return this.values[t]; @@ -464,22 +464,22 @@ class X extends Bt { return t in this.values; } merge(t) { - return new X(aa(this.values, la(t))); + return new Z(aa(this.values, la(t))); } slice(t) { const e = {}; return Array.from(t).forEach((i) => { this.has(i) && (e[i] = this.values[i]); - }), new X(e); + }), new Z(e); } getKeys() { return Object.keys(this.values); } getKeysCommonToHash(t) { - return t = oe(t), this.getKeys().filter((e) => this.values[e] === t.values[e]); + return t = le(t), this.getKeys().filter((e) => this.values[e] === t.values[e]); } isEqualTo(t) { - return Mt(this.toArray(), oe(t).toArray()); + return Bt(this.toArray(), le(t).toArray()); } isEmpty() { return this.getKeys().length === 0; @@ -496,7 +496,7 @@ class X extends Bt { return this.array; } toObject() { - return Je(this.values); + return Xe(this.values); } toJSON() { return this.toObject(); @@ -509,23 +509,23 @@ const oa = function(s, t) { const e = {}; return e[s] = t, e; }, aa = function(s, t) { - const e = Je(s); + const e = Xe(s); for (const i in t) { const n = t[i]; e[i] = n; } return e; -}, Je = function(s, t) { +}, Xe = function(s, t) { const e = {}; return Object.keys(s).sort().forEach((i) => { i !== t && (e[i] = s[i]); }), e; -}, oe = function(s) { - return s instanceof X ? s : new X(s); +}, le = function(s) { + return s instanceof Z ? s : new Z(s); }, la = function(s) { - return s instanceof X ? s.values : s; + return s instanceof Z ? s.values : s; }; -class Nn { +class Bn { static groupObjects() { let t, e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], { depth: i, asTree: n } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; n && i == null && (i = 0); @@ -557,7 +557,7 @@ class Nn { }), t.join("/"); } } -class ca extends P { +class ca extends F { constructor() { let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; super(...arguments), this.objects = {}, Array.from(t).forEach((e) => { @@ -590,7 +590,7 @@ class da { } } const _s = (s) => s.dataset.trixStoreKey; -class Ze extends P { +class ei extends F { isPerforming() { return this.performing === !0; } @@ -616,8 +616,8 @@ class Ze extends P { (t = this.promise) === null || t === void 0 || (e = t.cancel) === null || e === void 0 || e.call(t), this.promise = null, this.performing = null, this.performed = null, this.succeeded = null; } } -Ze.proxyMethod("getPromise().then"), Ze.proxyMethod("getPromise().catch"); -class Pt extends P { +ei.proxyMethod("getPromise().then"), ei.proxyMethod("getPromise().catch"); +class Ft extends F { 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 Pt extends P { } createChildView(t, e) { let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; - e instanceof Nn && (i.viewClass = t, t = ha); + e instanceof Bn && (i.viewClass = t, t = ha); const n = new t(e, i); return this.recordChildView(n); } @@ -690,7 +690,7 @@ class Pt extends P { } } } -class ha extends Pt { +class ha extends Ft { constructor() { super(...arguments), this.objectGroup = this.object, this.viewClass = this.options.viewClass, delete this.options.viewClass; } @@ -714,10 +714,10 @@ class ha extends Pt { } /*! @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: Wr, setPrototypeOf: ys, isFrozen: ua, getPrototypeOf: ma, getOwnPropertyDescriptor: ga } = Object; -let { freeze: J, seal: tt, create: Kr } = Object, { apply: vn, construct: _n } = typeof Reflect < "u" && Reflect; -J || (J = function(s) { +let { freeze: Y, seal: it, create: Kr } = Object, { apply: vn, construct: _n } = typeof Reflect < "u" && Reflect; +Y || (Y = function(s) { return s; -}), tt || (tt = function(s) { +}), it || (it = function(s) { return s; }), vn || (vn = function(s, t) { for (var e = arguments.length, i = new Array(e > 2 ? e - 2 : 0), n = 2; n < e; n++) i[n - 2] = arguments[n]; @@ -726,20 +726,20 @@ 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 qe = Y(Array.prototype.forEach), pa = Y(Array.prototype.lastIndexOf), As = Y(Array.prototype.pop), ae = Y(Array.prototype.push), fa = Y(Array.prototype.splice), Ye = Y(String.prototype.toLowerCase), Pi = Y(String.prototype.toString), Fi = Y(String.prototype.match), le = Y(String.prototype.replace), ba = Y(String.prototype.indexOf), va = Y(String.prototype.trim), rt = Y(Object.prototype.hasOwnProperty), W = Y(RegExp.prototype.test), ce = (Es = TypeError, function() { +const $e = X(Array.prototype.forEach), pa = X(Array.prototype.lastIndexOf), As = X(Array.prototype.pop), ce = X(Array.prototype.push), fa = X(Array.prototype.splice), Qe = X(String.prototype.toLowerCase), Pi = X(String.prototype.toString), Fi = X(String.prototype.match), de = X(String.prototype.replace), ba = X(String.prototype.indexOf), va = X(String.prototype.trim), ot = X(Object.prototype.hasOwnProperty), K = X(RegExp.prototype.test), he = (Es = TypeError, function() { for (var s = arguments.length, t = new Array(s), e = 0; e < s; e++) t[e] = arguments[e]; return _n(Es, t); }); var Es; -function Y(s) { +function X(s) { return function(t) { t instanceof RegExp && (t.lastIndex = 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 vn(s, t, i); }; } -function E(s, t) { - let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Ye; +function S(s, t) { + let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Qe; ys && ys(s, null); let i = t.length; for (; i--; ) { @@ -754,21 +754,21 @@ function E(s, t) { } function _a(s) { for (let t = 0; t < s.length; t++) - rt(s, t) || (s[t] = null); + ot(s, t) || (s[t] = null); return s; } -function mt(s) { +function gt(s) { const t = Kr(null); for (const [e, i] of Wr(s)) - rt(s, e) && (Array.isArray(i) ? t[e] = _a(i) : i && typeof i == "object" && i.constructor === Object ? t[e] = mt(i) : t[e] = i); + ot(s, e) && (Array.isArray(i) ? t[e] = _a(i) : i && typeof i == "object" && i.constructor === Object ? t[e] = gt(i) : t[e] = i); return t; } -function de(s, t) { +function ue(s, t) { for (; s !== null; ) { const e = ga(s, t); if (e) { - if (e.get) return Y(e.get); - if (typeof e.value == "function") return Y(e.value); + if (e.get) return X(e.get); + if (typeof e.value == "function") return X(e.value); } s = ma(s); } @@ -776,157 +776,157 @@ function de(s, t) { return null; }; } -const xs = 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"]), qi = 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"]), Hi = 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"]), ya = 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"]), $i = 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"]), Aa = J(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ss = J(["#text"]), Ls = 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"]), Ui = 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"]), Cs = 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"]), He = J(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Ea = tt(/\{\{[\w\W]*|[\w\W]*\}\}/gm), xa = tt(/<%[\w\W]*|[\w\W]*%>/gm), Sa = tt(/\$\{[\w\W]*/gm), La = tt(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ca = tt(/^aria-[\-\w]+$/), Gr = tt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), wa = tt(/^(?:\w+script|data):/i), Ta = tt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Jr = tt(/^html$/i), ka = tt(/^[a-z][.\w]*(-[.\w]+)+$/i); +const xs = 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"]), qi = 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", "slot", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Hi = 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"]), ya = 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"]), $i = 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"]), Aa = Y(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ss = Y(["#text"]), Ls = Y(["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"]), Ui = 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", "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"]), Cs = Y(["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"]), Ue = Y(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Ea = it(/\{\{[\w\W]*|[\w\W]*\}\}/gm), xa = it(/<%[\w\W]*|[\w\W]*%>/gm), Sa = it(/\$\{[\w\W]*/gm), La = it(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ca = it(/^aria-[\-\w]+$/), Gr = it(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), wa = it(/^(?:\w+script|data):/i), Ta = it(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Jr = it(/^html$/i), ka = it(/^[a-z][.\w]*(-[.\w]+)+$/i); var ws = Object.freeze({ __proto__: null, ARIA_ATTR: Ca, ATTR_WHITESPACE: Ta, CUSTOM_ELEMENT: ka, DATA_ATTR: La, DOCTYPE_NAME: Jr, ERB_EXPR: xa, IS_ALLOWED_URI: Gr, IS_SCRIPT_OR_DATA: wa, MUSTACHE_EXPR: Ea, TMPLIT_EXPR: Sa }); -const Ia = 1, Ra = 3, Da = 7, Oa = 8, Ma = 9, Na = function() { +const Ia = 1, Ra = 3, Da = 7, Oa = 8, Ma = 9, Ba = function() { return typeof window > "u" ? null : window; }; -var xe = function s() { - let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Na(); +var Le = function s() { + let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ba(); const e = (c) => s(c); if (e.version = "3.2.7", e.removed = [], !t || !t.document || t.document.nodeType !== Ma || !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: u = t.NamedNodeMap || t.MozNamedAttrMap, HTMLFormElement: g, DOMParser: p, trustedTypes: b } = t, y = d.prototype, L = de(y, "cloneNode"), k = de(y, "remove"), z = de(y, "nextSibling"), B = de(y, "childNodes"), D = de(y, "parentNode"); + const n = i, r = n.currentScript, { DocumentFragment: o, HTMLTemplateElement: a, Node: l, Element: d, NodeFilter: h, NamedNodeMap: m = t.NamedNodeMap || t.MozNamedAttrMap, HTMLFormElement: f, DOMParser: u, trustedTypes: b } = t, E = d.prototype, k = ue(E, "cloneNode"), M = ue(E, "remove"), R = ue(E, "nextSibling"), I = ue(E, "childNodes"), A = ue(E, "parentNode"); if (typeof a == "function") { const c = i.createElement("template"); c.content && c.content.ownerDocument && (i = c.content.ownerDocument); } - let w, et = ""; - const { implementation: dt, createNodeIterator: ci, createDocumentFragment: di, getElementsByTagName: hi } = i, { importNode: at } = n; - let F = { afterSanitizeAttributes: [], afterSanitizeElements: [], afterSanitizeShadowDOM: [], beforeSanitizeAttributes: [], beforeSanitizeElements: [], beforeSanitizeShadowDOM: [], uponSanitizeAttribute: [], uponSanitizeElement: [], uponSanitizeShadowNode: [] }; - e.isSupported = typeof Wr == "function" && typeof D == "function" && dt && dt.createHTMLDocument !== void 0; - const { MUSTACHE_EXPR: Te, ERB_EXPR: ui, TMPLIT_EXPR: mi, DATA_ATTR: Do, ARIA_ATTR: Oo, IS_SCRIPT_OR_DATA: Mo, ATTR_WHITESPACE: Fn, CUSTOM_ELEMENT: No } = ws; - let { IS_ALLOWED_URI: qn } = ws, H = null; - const Hn = E({}, [...xs, ...qi, ...Hi, ...$i, ...Ss]); - let U = null; - const $n = E({}, [...Ls, ...Ui, ...Cs, ...He]); - let O = Object.seal(Kr(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 } })), ee = null, gi = null, Un = !0, pi = !0, jn = !1, Vn = !0, qt = !1, ke = !0, St = !1, fi = !1, bi = !1, Ht = !1, Ie = !1, Re = !1, zn = !0, Wn = !1, vi = !0, ie = !1, $t = {}, Ut = null; - const Kn = E({}, ["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 _, j = ""; + const { implementation: Q, createNodeIterator: ht, createDocumentFragment: Ht, getElementsByTagName: hi } = i, { importNode: lt } = n; + let q = { afterSanitizeAttributes: [], afterSanitizeElements: [], afterSanitizeShadowDOM: [], beforeSanitizeAttributes: [], beforeSanitizeElements: [], beforeSanitizeShadowDOM: [], uponSanitizeAttribute: [], uponSanitizeElement: [], uponSanitizeShadowNode: [] }; + e.isSupported = typeof Wr == "function" && typeof A == "function" && Q && Q.createHTMLDocument !== void 0; + const { MUSTACHE_EXPR: Ie, ERB_EXPR: ui, TMPLIT_EXPR: mi, DATA_ATTR: Do, ARIA_ATTR: Oo, IS_SCRIPT_OR_DATA: Mo, ATTR_WHITESPACE: Fn, CUSTOM_ELEMENT: Bo } = ws; + let { IS_ALLOWED_URI: qn } = ws, $ = null; + const Hn = S({}, [...xs, ...qi, ...Hi, ...$i, ...Ss]); + let V = null; + const $n = S({}, [...Ls, ...Ui, ...Cs, ...Ue]); + let B = Object.seal(Kr(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 } })), ne = null, gi = null, Un = !0, pi = !0, jn = !1, Vn = !0, $t = !1, Re = !0, Lt = !1, fi = !1, bi = !1, Ut = !1, De = !1, Oe = !1, zn = !0, Wn = !1, vi = !0, se = !1, jt = {}, Vt = null; + const Kn = S({}, ["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 Gn = null; - const Jn = E({}, ["audio", "video", "img", "source", "image", "track"]); + const Jn = S({}, ["audio", "video", "img", "source", "image", "track"]); let _i = null; - const Yn = E({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), De = "http://www.w3.org/1998/Math/MathML", Oe = "http://www.w3.org/2000/svg", ht = "http://www.w3.org/1999/xhtml"; - let jt = ht, yi = !1, Ai = null; - const Bo = E({}, [De, Oe, ht], Pi); - let Me = E({}, ["mi", "mo", "mn", "ms", "mtext"]), Ne = E({}, ["annotation-xml"]); - const Po = E({}, ["title", "style", "font", "a", "script"]); - let ne = null; + const Yn = S({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Me = "http://www.w3.org/1998/Math/MathML", Be = "http://www.w3.org/2000/svg", ut = "http://www.w3.org/1999/xhtml"; + let zt = ut, yi = !1, Ai = null; + const No = S({}, [Me, Be, ut], Pi); + let Ne = S({}, ["mi", "mo", "mn", "ms", "mtext"]), Pe = S({}, ["annotation-xml"]); + const Po = S({}, ["title", "style", "font", "a", "script"]); + let re = null; const Fo = ["application/xhtml+xml", "text/html"]; - let $ = null, Vt = null; + let U = null, Wt = null; const qo = i.createElement("form"), Xn = function(c) { return c instanceof RegExp || c instanceof Function; }, Ei = function() { let c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - if (!Vt || Vt !== c) { - if (c && typeof c == "object" || (c = {}), c = mt(c), ne = Fo.indexOf(c.PARSER_MEDIA_TYPE) === -1 ? "text/html" : c.PARSER_MEDIA_TYPE, $ = ne === "application/xhtml+xml" ? Pi : Ye, H = rt(c, "ALLOWED_TAGS") ? E({}, c.ALLOWED_TAGS, $) : Hn, U = rt(c, "ALLOWED_ATTR") ? E({}, c.ALLOWED_ATTR, $) : $n, Ai = rt(c, "ALLOWED_NAMESPACES") ? E({}, c.ALLOWED_NAMESPACES, Pi) : Bo, _i = rt(c, "ADD_URI_SAFE_ATTR") ? E(mt(Yn), c.ADD_URI_SAFE_ATTR, $) : Yn, Gn = rt(c, "ADD_DATA_URI_TAGS") ? E(mt(Jn), c.ADD_DATA_URI_TAGS, $) : Jn, Ut = rt(c, "FORBID_CONTENTS") ? E({}, c.FORBID_CONTENTS, $) : Kn, ee = rt(c, "FORBID_TAGS") ? E({}, c.FORBID_TAGS, $) : mt({}), gi = rt(c, "FORBID_ATTR") ? E({}, c.FORBID_ATTR, $) : mt({}), $t = !!rt(c, "USE_PROFILES") && c.USE_PROFILES, Un = c.ALLOW_ARIA_ATTR !== !1, pi = c.ALLOW_DATA_ATTR !== !1, jn = c.ALLOW_UNKNOWN_PROTOCOLS || !1, Vn = c.ALLOW_SELF_CLOSE_IN_ATTR !== !1, qt = c.SAFE_FOR_TEMPLATES || !1, ke = c.SAFE_FOR_XML !== !1, St = c.WHOLE_DOCUMENT || !1, Ht = c.RETURN_DOM || !1, Ie = c.RETURN_DOM_FRAGMENT || !1, Re = c.RETURN_TRUSTED_TYPE || !1, bi = c.FORCE_BODY || !1, zn = c.SANITIZE_DOM !== !1, Wn = c.SANITIZE_NAMED_PROPS || !1, vi = c.KEEP_CONTENT !== !1, ie = c.IN_PLACE || !1, qn = c.ALLOWED_URI_REGEXP || Gr, jt = c.NAMESPACE || ht, Me = c.MATHML_TEXT_INTEGRATION_POINTS || Me, Ne = c.HTML_INTEGRATION_POINTS || Ne, O = c.CUSTOM_ELEMENT_HANDLING || {}, c.CUSTOM_ELEMENT_HANDLING && Xn(c.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (O.tagNameCheck = c.CUSTOM_ELEMENT_HANDLING.tagNameCheck), c.CUSTOM_ELEMENT_HANDLING && Xn(c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (O.attributeNameCheck = c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), c.CUSTOM_ELEMENT_HANDLING && typeof c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (O.allowCustomizedBuiltInElements = c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), qt && (pi = !1), Ie && (Ht = !0), $t && (H = E({}, Ss), U = [], $t.html === !0 && (E(H, xs), E(U, Ls)), $t.svg === !0 && (E(H, qi), E(U, Ui), E(U, He)), $t.svgFilters === !0 && (E(H, Hi), E(U, Ui), E(U, He)), $t.mathMl === !0 && (E(H, $i), E(U, Cs), E(U, He))), c.ADD_TAGS && (H === Hn && (H = mt(H)), E(H, c.ADD_TAGS, $)), c.ADD_ATTR && (U === $n && (U = mt(U)), E(U, c.ADD_ATTR, $)), c.ADD_URI_SAFE_ATTR && E(_i, c.ADD_URI_SAFE_ATTR, $), c.FORBID_CONTENTS && (Ut === Kn && (Ut = mt(Ut)), E(Ut, c.FORBID_CONTENTS, $)), vi && (H["#text"] = !0), St && E(H, ["html", "head", "body"]), H.table && (E(H, ["tbody"]), delete ee.tbody), c.TRUSTED_TYPES_POLICY) { - if (typeof c.TRUSTED_TYPES_POLICY.createHTML != "function") throw ce('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); - if (typeof c.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw ce('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); - w = c.TRUSTED_TYPES_POLICY, et = w.createHTML(""); - } else w === void 0 && (w = function(f, m) { - if (typeof f != "object" || typeof f.createPolicy != "function") return null; - let x = null; - const C = "data-tt-policy-suffix"; - m && m.hasAttribute(C) && (x = m.getAttribute(C)); - const _ = "dompurify" + (x ? "#" + x : ""); + if (!Wt || Wt !== c) { + if (c && typeof c == "object" || (c = {}), c = gt(c), re = Fo.indexOf(c.PARSER_MEDIA_TYPE) === -1 ? "text/html" : c.PARSER_MEDIA_TYPE, U = re === "application/xhtml+xml" ? Pi : Qe, $ = ot(c, "ALLOWED_TAGS") ? S({}, c.ALLOWED_TAGS, U) : Hn, V = ot(c, "ALLOWED_ATTR") ? S({}, c.ALLOWED_ATTR, U) : $n, Ai = ot(c, "ALLOWED_NAMESPACES") ? S({}, c.ALLOWED_NAMESPACES, Pi) : No, _i = ot(c, "ADD_URI_SAFE_ATTR") ? S(gt(Yn), c.ADD_URI_SAFE_ATTR, U) : Yn, Gn = ot(c, "ADD_DATA_URI_TAGS") ? S(gt(Jn), c.ADD_DATA_URI_TAGS, U) : Jn, Vt = ot(c, "FORBID_CONTENTS") ? S({}, c.FORBID_CONTENTS, U) : Kn, ne = ot(c, "FORBID_TAGS") ? S({}, c.FORBID_TAGS, U) : gt({}), gi = ot(c, "FORBID_ATTR") ? S({}, c.FORBID_ATTR, U) : gt({}), jt = !!ot(c, "USE_PROFILES") && c.USE_PROFILES, Un = c.ALLOW_ARIA_ATTR !== !1, pi = c.ALLOW_DATA_ATTR !== !1, jn = c.ALLOW_UNKNOWN_PROTOCOLS || !1, Vn = c.ALLOW_SELF_CLOSE_IN_ATTR !== !1, $t = c.SAFE_FOR_TEMPLATES || !1, Re = c.SAFE_FOR_XML !== !1, Lt = c.WHOLE_DOCUMENT || !1, Ut = c.RETURN_DOM || !1, De = c.RETURN_DOM_FRAGMENT || !1, Oe = c.RETURN_TRUSTED_TYPE || !1, bi = c.FORCE_BODY || !1, zn = c.SANITIZE_DOM !== !1, Wn = c.SANITIZE_NAMED_PROPS || !1, vi = c.KEEP_CONTENT !== !1, se = c.IN_PLACE || !1, qn = c.ALLOWED_URI_REGEXP || Gr, zt = c.NAMESPACE || ut, Ne = c.MATHML_TEXT_INTEGRATION_POINTS || Ne, Pe = c.HTML_INTEGRATION_POINTS || Pe, B = c.CUSTOM_ELEMENT_HANDLING || {}, c.CUSTOM_ELEMENT_HANDLING && Xn(c.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (B.tagNameCheck = c.CUSTOM_ELEMENT_HANDLING.tagNameCheck), c.CUSTOM_ELEMENT_HANDLING && Xn(c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (B.attributeNameCheck = c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), c.CUSTOM_ELEMENT_HANDLING && typeof c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), $t && (pi = !1), De && (Ut = !0), jt && ($ = S({}, Ss), V = [], jt.html === !0 && (S($, xs), S(V, Ls)), jt.svg === !0 && (S($, qi), S(V, Ui), S(V, Ue)), jt.svgFilters === !0 && (S($, Hi), S(V, Ui), S(V, Ue)), jt.mathMl === !0 && (S($, $i), S(V, Cs), S(V, Ue))), c.ADD_TAGS && ($ === Hn && ($ = gt($)), S($, c.ADD_TAGS, U)), c.ADD_ATTR && (V === $n && (V = gt(V)), S(V, c.ADD_ATTR, U)), c.ADD_URI_SAFE_ATTR && S(_i, c.ADD_URI_SAFE_ATTR, U), c.FORBID_CONTENTS && (Vt === Kn && (Vt = gt(Vt)), S(Vt, c.FORBID_CONTENTS, U)), vi && ($["#text"] = !0), Lt && S($, ["html", "head", "body"]), $.table && (S($, ["tbody"]), delete ne.tbody), c.TRUSTED_TYPES_POLICY) { + if (typeof c.TRUSTED_TYPES_POLICY.createHTML != "function") throw he('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); + if (typeof c.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw he('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); + _ = c.TRUSTED_TYPES_POLICY, j = _.createHTML(""); + } else _ === void 0 && (_ = function(p, g) { + if (typeof p != "object" || typeof p.createPolicy != "function") return null; + let L = null; + const w = "data-tt-policy-suffix"; + g && g.hasAttribute(w) && (L = g.getAttribute(w)); + const y = "dompurify" + (L ? "#" + L : ""); try { - return f.createPolicy(_, { createHTML: (q) => q, createScriptURL: (q) => q }); + return p.createPolicy(y, { createHTML: (H) => H, createScriptURL: (H) => H }); } catch { - return console.warn("TrustedTypes policy " + _ + " could not be created."), null; + return console.warn("TrustedTypes policy " + y + " could not be created."), null; } - }(b, r)), w !== null && typeof et == "string" && (et = w.createHTML("")); - J && J(c), Vt = c; + }(b, r)), _ !== null && typeof j == "string" && (j = _.createHTML("")); + Y && Y(c), Wt = c; } - }, Qn = E({}, [...qi, ...Hi, ...ya]), Zn = E({}, [...$i, ...Aa]), lt = function(c) { - ae(e.removed, { element: c }); + }, Qn = S({}, [...qi, ...Hi, ...ya]), Zn = S({}, [...$i, ...Aa]), ct = function(c) { + ce(e.removed, { element: c }); try { - D(c).removeChild(c); + A(c).removeChild(c); } catch { - k(c); + M(c); } - }, Lt = function(c, f) { + }, Ct = function(c, p) { try { - ae(e.removed, { attribute: f.getAttributeNode(c), from: f }); + ce(e.removed, { attribute: p.getAttributeNode(c), from: p }); } catch { - ae(e.removed, { attribute: null, from: f }); + ce(e.removed, { attribute: null, from: p }); } - if (f.removeAttribute(c), c === "is") if (Ht || Ie) try { - lt(f); + if (p.removeAttribute(c), c === "is") if (Ut || De) try { + ct(p); } catch { } else try { - f.setAttribute(c, ""); + p.setAttribute(c, ""); } catch { } }, ts = function(c) { - let f = null, m = null; + let p = null, g = null; if (bi) c = "