@clevertask/scribe 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/README.md +3 -0
  2. package/dist/BarMenu-V1uRL3bt.js +272 -0
  3. package/dist/assets/index.css +1 -1
  4. package/dist/components/Menu/BarMenu.d.ts.map +1 -1
  5. package/dist/components/Menu/BarMenu.js +2 -10
  6. package/dist/components/Menu/BubbleMenu.d.ts.map +1 -1
  7. package/dist/components/Menu/BubbleMenu.js +165 -1023
  8. package/dist/components/Menu/LinkBubbleMenu.d.ts +8 -0
  9. package/dist/components/Menu/LinkBubbleMenu.d.ts.map +1 -0
  10. package/dist/components/Menu/LinkBubbleMenu.js +78 -0
  11. package/dist/components/Menu/LinkEditor.d.ts +14 -0
  12. package/dist/components/Menu/LinkEditor.d.ts.map +1 -0
  13. package/dist/components/Menu/LinkEditor.js +140 -0
  14. package/dist/components/Menu/Mobile/ListOptionBar.d.ts.map +1 -1
  15. package/dist/components/Menu/Mobile/ListOptionBar.js +38 -44
  16. package/dist/components/Menu/linkBubbleMenuPlugin.d.ts +5 -0
  17. package/dist/components/Menu/linkBubbleMenuPlugin.d.ts.map +1 -0
  18. package/dist/components/Menu/linkBubbleMenuPlugin.js +7 -0
  19. package/dist/components/Menu/linkUrl.d.ts +2 -0
  20. package/dist/components/Menu/linkUrl.d.ts.map +1 -0
  21. package/dist/components/Menu/linkUrl.js +21 -0
  22. package/dist/components/Scribe/extension/emoji/EmojiList.js +58 -45
  23. package/dist/components/Scribe/extension/emoji/suggest.d.ts +2 -2
  24. package/dist/components/Scribe/extension/emoji/suggest.d.ts.map +1 -1
  25. package/dist/components/Scribe/extension/emoji/suggest.js +39 -43
  26. package/dist/components/Scribe/extension/extension-link.d.ts.map +1 -1
  27. package/dist/components/Scribe/extension/extension-link.js +2 -4
  28. package/dist/components/Scribe/extension/extension-markdown-paste.d.ts.map +1 -1
  29. package/dist/components/Scribe/extension/extension-markdown-paste.js +50 -45
  30. package/dist/components/Scribe/extension/extension-selectedText.d.ts.map +1 -1
  31. package/dist/components/Scribe/extension/extension-selectedText.js +10 -12
  32. package/dist/components/Scribe/extension/getPopupMountTarget.d.ts.map +1 -1
  33. package/dist/components/Scribe/extension/getPopupMountTarget.js +12 -15
  34. package/dist/components/Scribe/extension/index.d.ts +4 -4
  35. package/dist/components/Scribe/extension/index.d.ts.map +1 -1
  36. package/dist/components/Scribe/extension/index.js +2 -39521
  37. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +3369 -3731
  38. package/dist/components/Scribe/extension/slashCommand/index.js +2 -6
  39. package/dist/components/Scribe/extension/slashCommand/items.d.ts.map +1 -1
  40. package/dist/components/Scribe/extension/slashCommand/items.js +177 -176
  41. package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts.map +1 -1
  42. package/dist/components/Scribe/extension/slashCommand/renderItems.js +35 -41
  43. package/dist/components/Scribe/extension/tableOfContents.js +153 -180
  44. package/dist/components/Scribe/index.d.ts.map +1 -1
  45. package/dist/components/Scribe/index.js +113 -153
  46. package/dist/dist-BQjH-i-q.js +7016 -0
  47. package/dist/dist-CnXCIcnl.js +3506 -0
  48. package/dist/dist-RuuEA1GJ.js +686 -0
  49. package/dist/extension-CZOsheCI.js +56236 -0
  50. package/dist/extension-link-DZID_SYl.js +908 -0
  51. package/dist/floating-ui.dom-rih69525.js +928 -0
  52. package/dist/html-to-markdown-CrNOkSye.js +497 -0
  53. package/dist/icons/ToolbarIcons.d.ts.map +1 -1
  54. package/dist/icons/ToolbarIcons.js +76 -135
  55. package/dist/main.css +10 -0
  56. package/dist/main.js +7 -15
  57. package/dist/markdown-to-html-DEczPfuq.js +1458 -0
  58. package/dist/menus-CzX7kyXn.js +633 -0
  59. package/dist/purify.es-DF9CW1cl.js +767 -0
  60. package/dist/rolldown-runtime-B8UxIWdF.js +7 -0
  61. package/dist/slashCommand-B7CRIaKG.js +429 -0
  62. package/dist/tables-CjOC70rm.js +1345 -0
  63. package/dist/tippy.esm-D9LL2xiE.js +1713 -0
  64. package/dist/utils/convert-legacy-math-delimiters.d.ts.map +1 -1
  65. package/dist/utils/convert-legacy-math-delimiters.js +7 -13
  66. package/dist/utils/create-scribe-editor.js +2 -31
  67. package/dist/utils/html-to-markdown.d.ts.map +1 -1
  68. package/dist/utils/html-to-markdown.js +2 -600
  69. package/dist/utils/index.js +24 -12
  70. package/dist/utils/is-in-viewport.d.ts.map +1 -1
  71. package/dist/utils/is-in-viewport.js +6 -6
  72. package/dist/utils/markdown-to-html.d.ts.map +1 -1
  73. package/dist/utils/markdown-to-html.js +2 -5
  74. package/dist/vite-env.d.js +0 -1
  75. package/package.json +36 -34
  76. package/dist/BarMenu-BNk2I0zi.js +0 -327
  77. package/dist/extension-link-P1rro4zO.js +0 -1059
  78. package/dist/floating-ui.dom-ZRy7FSVk.js +0 -1246
  79. package/dist/index-BMISMQrG.js +0 -855
  80. package/dist/index-ByyiiYsp.js +0 -1410
  81. package/dist/index-CnKS-BY2.js +0 -13834
  82. package/dist/index-CnQHDObA.js +0 -539
  83. package/dist/markdown-to-html-Bw9L43K6.js +0 -1135
  84. package/dist/purify.es-DC1iJOxX.js +0 -864
  85. package/dist/tippy.esm-DLHdsnfG.js +0 -1711
@@ -0,0 +1,767 @@
1
+ //#region node_modules/.pnpm/dompurify@3.4.12/node_modules/dompurify/dist/purify.es.mjs
2
+ function e(e, t) {
3
+ (t == null || t > e.length) && (t = e.length);
4
+ for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
5
+ return r;
6
+ }
7
+ function t(e) {
8
+ if (Array.isArray(e)) return e;
9
+ }
10
+ function n(e, t) {
11
+ var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
12
+ if (n != null) {
13
+ var r, i, a, o, s = [], c = !0, l = !1;
14
+ try {
15
+ if (a = (n = n.call(e)).next, t !== 0) for (; !(c = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); c = !0);
16
+ } catch (e) {
17
+ l = !0, i = e;
18
+ } finally {
19
+ try {
20
+ if (!c && n.return != null && (o = n.return(), Object(o) !== o)) return;
21
+ } finally {
22
+ if (l) throw i;
23
+ }
24
+ }
25
+ return s;
26
+ }
27
+ }
28
+ function r() {
29
+ throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
30
+ }
31
+ function i(e, i) {
32
+ return t(e) || n(e, i) || a(e, i) || r();
33
+ }
34
+ function a(t, n) {
35
+ if (t) {
36
+ if (typeof t == "string") return e(t, n);
37
+ var r = {}.toString.call(t).slice(8, -1);
38
+ return r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set" ? Array.from(t) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? e(t, n) : void 0;
39
+ }
40
+ }
41
+ var o = Object.entries, s = Object.setPrototypeOf, c = Object.isFrozen, l = Object.getPrototypeOf, u = Object.getOwnPropertyDescriptor, d = Object.freeze, f = Object.seal, ee = Object.create, p = typeof Reflect < "u" && Reflect, m = p.apply, te = p.construct;
42
+ d ||= function(e) {
43
+ return e;
44
+ }, f ||= function(e) {
45
+ return e;
46
+ }, m ||= function(e, t) {
47
+ var n = [...arguments].slice(2);
48
+ return e.apply(t, n);
49
+ }, te ||= function(e) {
50
+ return new e(...[...arguments].slice(1));
51
+ };
52
+ var h = w(Array.prototype.forEach), ne = w(Array.prototype.lastIndexOf), re = w(Array.prototype.pop), g = w(Array.prototype.push), ie = w(Array.prototype.splice), _ = Array.isArray, ae = w(String.prototype.toLowerCase), oe = w(String.prototype.toString), se = w(String.prototype.match), ce = w(String.prototype.replace), le = w(String.prototype.indexOf), ue = w(String.prototype.trim), de = w(Number.prototype.toString), fe = w(Boolean.prototype.toString), v = typeof BigInt > "u" ? null : w(BigInt.prototype.toString), y = typeof Symbol > "u" ? null : w(Symbol.prototype.toString), b = w(Object.prototype.hasOwnProperty), x = w(Object.prototype.toString), S = w(RegExp.prototype.test), C = T(TypeError);
53
+ function w(e) {
54
+ return function(t) {
55
+ t instanceof RegExp && (t.lastIndex = 0);
56
+ var n = [...arguments].slice(1);
57
+ return m(e, t, n);
58
+ };
59
+ }
60
+ function T(e) {
61
+ return function() {
62
+ return te(e, [...arguments]);
63
+ };
64
+ }
65
+ function E(e, t) {
66
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ae;
67
+ if (s && s(e, null), !_(t)) return e;
68
+ let r = t.length;
69
+ for (; r--;) {
70
+ let i = t[r];
71
+ if (typeof i == "string") {
72
+ let e = n(i);
73
+ e !== i && (c(t) || (t[r] = e), i = e);
74
+ }
75
+ e[i] = !0;
76
+ }
77
+ return e;
78
+ }
79
+ function D(e) {
80
+ for (let t = 0; t < e.length; t++) b(e, t) || (e[t] = null);
81
+ return e;
82
+ }
83
+ function O(e) {
84
+ let t = ee(null);
85
+ for (let r of o(e)) {
86
+ var n = i(r, 2);
87
+ let a = n[0], o = n[1];
88
+ b(e, a) && (_(o) ? t[a] = D(o) : o && typeof o == "object" && o.constructor === Object ? t[a] = O(o) : t[a] = o);
89
+ }
90
+ return t;
91
+ }
92
+ function pe(e) {
93
+ switch (typeof e) {
94
+ case "string": return e;
95
+ case "number": return de(e);
96
+ case "boolean": return fe(e);
97
+ case "bigint": return v ? v(e) : "0";
98
+ case "symbol": return y ? y(e) : "Symbol()";
99
+ case "undefined": return x(e);
100
+ case "function":
101
+ case "object": {
102
+ if (e === null) return x(e);
103
+ let t = e, n = k(t, "toString");
104
+ if (typeof n == "function") {
105
+ let e = n(t);
106
+ return typeof e == "string" ? e : x(e);
107
+ }
108
+ return x(e);
109
+ }
110
+ default: return x(e);
111
+ }
112
+ }
113
+ function k(e, t) {
114
+ for (; e !== null;) {
115
+ let n = u(e, t);
116
+ if (n) {
117
+ if (n.get) return w(n.get);
118
+ if (typeof n.value == "function") return w(n.value);
119
+ }
120
+ e = l(e);
121
+ }
122
+ function n() {
123
+ return null;
124
+ }
125
+ return n;
126
+ }
127
+ function me(e) {
128
+ try {
129
+ return S(e, ""), !0;
130
+ } catch {
131
+ return !1;
132
+ }
133
+ }
134
+ var he = d(/* @__PURE__ */ "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".split(".")), ge = d(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), _e = d([
135
+ "feBlend",
136
+ "feColorMatrix",
137
+ "feComponentTransfer",
138
+ "feComposite",
139
+ "feConvolveMatrix",
140
+ "feDiffuseLighting",
141
+ "feDisplacementMap",
142
+ "feDistantLight",
143
+ "feDropShadow",
144
+ "feFlood",
145
+ "feFuncA",
146
+ "feFuncB",
147
+ "feFuncG",
148
+ "feFuncR",
149
+ "feGaussianBlur",
150
+ "feImage",
151
+ "feMerge",
152
+ "feMergeNode",
153
+ "feMorphology",
154
+ "feOffset",
155
+ "fePointLight",
156
+ "feSpecularLighting",
157
+ "feSpotLight",
158
+ "feTile",
159
+ "feTurbulence"
160
+ ]), ve = d([
161
+ "animate",
162
+ "color-profile",
163
+ "cursor",
164
+ "discard",
165
+ "font-face",
166
+ "font-face-format",
167
+ "font-face-name",
168
+ "font-face-src",
169
+ "font-face-uri",
170
+ "foreignobject",
171
+ "hatch",
172
+ "hatchpath",
173
+ "mesh",
174
+ "meshgradient",
175
+ "meshpatch",
176
+ "meshrow",
177
+ "missing-glyph",
178
+ "script",
179
+ "set",
180
+ "solidcolor",
181
+ "unknown",
182
+ "use"
183
+ ]), ye = d(/* @__PURE__ */ "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".split(".")), be = d([
184
+ "maction",
185
+ "maligngroup",
186
+ "malignmark",
187
+ "mlongdiv",
188
+ "mscarries",
189
+ "mscarry",
190
+ "msgroup",
191
+ "mstack",
192
+ "msline",
193
+ "msrow",
194
+ "semantics",
195
+ "annotation",
196
+ "annotation-xml",
197
+ "mprescripts",
198
+ "none"
199
+ ]), xe = d(["#text"]), Se = d(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Ce = d(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.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".split(".")), we = d(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), Te = d([
200
+ "xlink:href",
201
+ "xml:id",
202
+ "xlink:title",
203
+ "xml:space",
204
+ "xmlns:xlink"
205
+ ]), Ee = f(/{{[\w\W]*|^[\w\W]*}}/g), De = f(/<%[\w\W]*|^[\w\W]*%>/g), Oe = f(/\${[\w\W]*/g), ke = f(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ae = f(/^aria-[\-\w]+$/), je = f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Me = f(/^(?:\w+script|data):/i), Ne = f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Pe = f(/^html$/i), Fe = f(/^[a-z][.\w]*(-[.\w]+)+$/i), Ie = f(/<[/\w!]/g), Le = f(/<[/\w]/g), Re = f(/<\/no(script|embed|frames)/i), ze = f(/\/>/i), A = {
206
+ element: 1,
207
+ attribute: 2,
208
+ text: 3,
209
+ cdataSection: 4,
210
+ entityReference: 5,
211
+ entityNode: 6,
212
+ processingInstruction: 7,
213
+ comment: 8,
214
+ document: 9,
215
+ documentType: 10,
216
+ documentFragment: 11,
217
+ notation: 12
218
+ }, Be = function() {
219
+ return typeof window > "u" ? null : window;
220
+ }, Ve = function(e, t) {
221
+ if (typeof e != "object" || typeof e.createPolicy != "function") return null;
222
+ let n = null, r = "data-tt-policy-suffix";
223
+ t && t.hasAttribute(r) && (n = t.getAttribute(r));
224
+ let i = "dompurify" + (n ? "#" + n : "");
225
+ try {
226
+ return e.createPolicy(i, {
227
+ createHTML(e) {
228
+ return e;
229
+ },
230
+ createScriptURL(e) {
231
+ return e;
232
+ }
233
+ });
234
+ } catch {
235
+ return console.warn("TrustedTypes policy " + i + " could not be created."), null;
236
+ }
237
+ }, He = function() {
238
+ return {
239
+ afterSanitizeAttributes: [],
240
+ afterSanitizeElements: [],
241
+ afterSanitizeShadowDOM: [],
242
+ beforeSanitizeAttributes: [],
243
+ beforeSanitizeElements: [],
244
+ beforeSanitizeShadowDOM: [],
245
+ uponSanitizeAttribute: [],
246
+ uponSanitizeElement: [],
247
+ uponSanitizeShadowNode: []
248
+ };
249
+ }, j = function(e, t, n, r) {
250
+ return b(e, t) && _(e[t]) ? E(r.base ? O(r.base) : {}, e[t], r.transform) : n;
251
+ };
252
+ function Ue() {
253
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Be(), t = (e) => Ue(e);
254
+ if (t.version = "3.4.12", t.removed = [], !e || !e.document || e.document.nodeType !== A.document || !e.Element) return t.isSupported = !1, t;
255
+ let n = e.document, r = n, i = r.currentScript;
256
+ e.DocumentFragment;
257
+ let a = e.HTMLTemplateElement, s = e.Node, c = e.Element, l = e.NodeFilter;
258
+ e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
259
+ let u = e.DOMParser, p = e.trustedTypes, m = c.prototype, te = k(m, "cloneNode"), de = k(m, "remove"), fe = k(m, "nextSibling"), v = k(m, "childNodes"), y = k(m, "parentNode"), x = k(m, "shadowRoot"), w = k(m, "attributes"), T = s && s.prototype ? k(s.prototype, "nodeType") : null, D = s && s.prototype ? k(s.prototype, "nodeName") : null;
260
+ if (typeof a == "function") {
261
+ let e = n.createElement("template");
262
+ e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
263
+ }
264
+ let M, N = "", We, Ge = !1, Ke = 0, qe = function() {
265
+ if (Ke > 0) throw C("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
266
+ }, P = function(e) {
267
+ qe(), Ke++;
268
+ try {
269
+ return M.createHTML(e);
270
+ } finally {
271
+ Ke--;
272
+ }
273
+ }, Je = function(e) {
274
+ qe(), Ke++;
275
+ try {
276
+ return M.createScriptURL(e);
277
+ } finally {
278
+ Ke--;
279
+ }
280
+ }, Ye = function() {
281
+ return Ge ||= (We = Ve(p, i), !0), We;
282
+ }, Xe = n, Ze = Xe.implementation, Qe = Xe.createNodeIterator, $e = Xe.createDocumentFragment, et = Xe.getElementsByTagName, tt = r.importNode, F = He();
283
+ t.isSupported = typeof o == "function" && typeof y == "function" && Ze && Ze.createHTMLDocument !== void 0;
284
+ let nt = Ee, rt = De, it = Oe, at = ke, ot = Ae, st = Me, ct = Ne, lt = Fe, ut = je, I = null, dt = E({}, [
285
+ ...he,
286
+ ...ge,
287
+ ..._e,
288
+ ...ye,
289
+ ...xe
290
+ ]), L = null, ft = E({}, [
291
+ ...Se,
292
+ ...Ce,
293
+ ...we,
294
+ ...Te
295
+ ]), R = Object.seal(ee(null, {
296
+ tagNameCheck: {
297
+ writable: !0,
298
+ configurable: !1,
299
+ enumerable: !0,
300
+ value: null
301
+ },
302
+ attributeNameCheck: {
303
+ writable: !0,
304
+ configurable: !1,
305
+ enumerable: !0,
306
+ value: null
307
+ },
308
+ allowCustomizedBuiltInElements: {
309
+ writable: !0,
310
+ configurable: !1,
311
+ enumerable: !0,
312
+ value: !1
313
+ }
314
+ })), pt = null, mt = null, z = Object.seal(ee(null, {
315
+ tagCheck: {
316
+ writable: !0,
317
+ configurable: !1,
318
+ enumerable: !0,
319
+ value: null
320
+ },
321
+ attributeCheck: {
322
+ writable: !0,
323
+ configurable: !1,
324
+ enumerable: !0,
325
+ value: null
326
+ }
327
+ })), ht = !0, gt = !0, _t = !1, vt = !0, B = !1, V = !0, H = !1, yt = !1, bt = null, xt = null, St = !1, U = !1, Ct = !1, wt = !1, Tt = !0, Et = !1, Dt = "user-content-", Ot = !0, kt = !1, W = {}, G = null, At = E({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), jt = null, Mt = E({}, [
328
+ "audio",
329
+ "video",
330
+ "img",
331
+ "source",
332
+ "image",
333
+ "track"
334
+ ]), Nt = null, Pt = E({}, [
335
+ "alt",
336
+ "class",
337
+ "for",
338
+ "id",
339
+ "label",
340
+ "name",
341
+ "pattern",
342
+ "placeholder",
343
+ "role",
344
+ "summary",
345
+ "title",
346
+ "value",
347
+ "style",
348
+ "xmlns"
349
+ ]), Ft = "http://www.w3.org/1998/Math/MathML", It = "http://www.w3.org/2000/svg", K = "http://www.w3.org/1999/xhtml", q = K, Lt = !1, Rt = null, zt = E({}, [
350
+ Ft,
351
+ It,
352
+ K
353
+ ], oe), Bt = d([
354
+ "mi",
355
+ "mo",
356
+ "mn",
357
+ "ms",
358
+ "mtext"
359
+ ]), Vt = E({}, Bt), Ht = d(["annotation-xml"]), Ut = E({}, Ht), Wt = E({}, [
360
+ "title",
361
+ "style",
362
+ "font",
363
+ "a",
364
+ "script"
365
+ ]), Gt = null, Kt = ["application/xhtml+xml", "text/html"], J = null, Y = null, qt = n.createElement("form"), Jt = function(e) {
366
+ return e instanceof RegExp || e instanceof Function;
367
+ }, Yt = function() {
368
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
369
+ if (Y && Y === e) return;
370
+ (!e || typeof e != "object") && (e = {}), e = O(e), Gt = Kt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, J = Gt === "application/xhtml+xml" ? oe : ae, I = j(e, "ALLOWED_TAGS", dt, { transform: J }), L = j(e, "ALLOWED_ATTR", ft, { transform: J }), Rt = j(e, "ALLOWED_NAMESPACES", zt, { transform: oe }), Nt = j(e, "ADD_URI_SAFE_ATTR", Pt, {
371
+ transform: J,
372
+ base: Pt
373
+ }), jt = j(e, "ADD_DATA_URI_TAGS", Mt, {
374
+ transform: J,
375
+ base: Mt
376
+ }), G = j(e, "FORBID_CONTENTS", At, { transform: J }), pt = j(e, "FORBID_TAGS", O({}), { transform: J }), mt = j(e, "FORBID_ATTR", O({}), { transform: J }), W = b(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? O(e.USE_PROFILES) : e.USE_PROFILES : !1, ht = e.ALLOW_ARIA_ATTR !== !1, gt = e.ALLOW_DATA_ATTR !== !1, _t = e.ALLOW_UNKNOWN_PROTOCOLS || !1, vt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, B = e.SAFE_FOR_TEMPLATES || !1, V = e.SAFE_FOR_XML !== !1, H = e.WHOLE_DOCUMENT || !1, U = e.RETURN_DOM || !1, Ct = e.RETURN_DOM_FRAGMENT || !1, wt = e.RETURN_TRUSTED_TYPE || !1, St = e.FORCE_BODY || !1, Tt = e.SANITIZE_DOM !== !1, Et = e.SANITIZE_NAMED_PROPS || !1, Ot = e.KEEP_CONTENT !== !1, kt = e.IN_PLACE || !1, ut = me(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : je, q = typeof e.NAMESPACE == "string" ? e.NAMESPACE : K, Vt = b(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? O(e.MATHML_TEXT_INTEGRATION_POINTS) : E({}, Bt), Ut = b(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? O(e.HTML_INTEGRATION_POINTS) : E({}, Ht);
377
+ let t = b(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? O(e.CUSTOM_ELEMENT_HANDLING) : ee(null);
378
+ if (R = ee(null), b(t, "tagNameCheck") && Jt(t.tagNameCheck) && (R.tagNameCheck = t.tagNameCheck), b(t, "attributeNameCheck") && Jt(t.attributeNameCheck) && (R.attributeNameCheck = t.attributeNameCheck), b(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (R.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), f(R), B && (gt = !1), Ct && (U = !0), W && (I = E({}, xe), L = ee(null), W.html === !0 && (E(I, he), E(L, Se)), W.svg === !0 && (E(I, ge), E(L, Ce), E(L, Te)), W.svgFilters === !0 && (E(I, _e), E(L, Ce), E(L, Te)), W.mathMl === !0 && (E(I, ye), E(L, we), E(L, Te))), z.tagCheck = null, z.attributeCheck = null, b(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? z.tagCheck = e.ADD_TAGS : _(e.ADD_TAGS) && (I === dt && (I = O(I)), E(I, e.ADD_TAGS, J))), b(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? z.attributeCheck = e.ADD_ATTR : _(e.ADD_ATTR) && (L === ft && (L = O(L)), E(L, e.ADD_ATTR, J))), b(e, "ADD_URI_SAFE_ATTR") && _(e.ADD_URI_SAFE_ATTR) && E(Nt, e.ADD_URI_SAFE_ATTR, J), b(e, "FORBID_CONTENTS") && _(e.FORBID_CONTENTS) && (G === At && (G = O(G)), E(G, e.FORBID_CONTENTS, J)), b(e, "ADD_FORBID_CONTENTS") && _(e.ADD_FORBID_CONTENTS) && (G === At && (G = O(G)), E(G, e.ADD_FORBID_CONTENTS, J)), Ot && (I["#text"] = !0), H && E(I, [
379
+ "html",
380
+ "head",
381
+ "body"
382
+ ]), I.table && (E(I, ["tbody"]), delete pt.tbody), e.TRUSTED_TYPES_POLICY) {
383
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw C("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
384
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw C("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
385
+ let t = M;
386
+ M = e.TRUSTED_TYPES_POLICY;
387
+ try {
388
+ N = P("");
389
+ } catch (e) {
390
+ throw M = t, e;
391
+ }
392
+ } else e.TRUSTED_TYPES_POLICY === null ? (M = void 0, N = "") : (M === void 0 && (M = Ye()), M && typeof N == "string" && (N = P("")));
393
+ d && d(e), Y = e;
394
+ }, Xt = E({}, [
395
+ ...ge,
396
+ ..._e,
397
+ ...ve
398
+ ]), Zt = E({}, [...ye, ...be]), Qt = function(e, t, n) {
399
+ return t.namespaceURI === K ? e === "svg" : t.namespaceURI === Ft ? e === "svg" && (n === "annotation-xml" || Vt[n]) : !!Xt[e];
400
+ }, $t = function(e, t, n) {
401
+ return t.namespaceURI === K ? e === "math" : t.namespaceURI === It ? e === "math" && Ut[n] : !!Zt[e];
402
+ }, en = function(e, t, n) {
403
+ return t.namespaceURI === It && !Ut[n] || t.namespaceURI === Ft && !Vt[n] ? !1 : !Zt[e] && (Wt[e] || !Xt[e]);
404
+ }, tn = function(e) {
405
+ let t = y(e);
406
+ (!t || !t.tagName) && (t = {
407
+ namespaceURI: q,
408
+ tagName: "template"
409
+ });
410
+ let n = ae(e.tagName), r = ae(t.tagName);
411
+ return Rt[e.namespaceURI] ? e.namespaceURI === It ? Qt(n, t, r) : e.namespaceURI === Ft ? $t(n, t, r) : e.namespaceURI === K ? en(n, t, r) : !!(Gt === "application/xhtml+xml" && Rt[e.namespaceURI]) : !1;
412
+ }, X = function(e) {
413
+ g(t.removed, { element: e });
414
+ try {
415
+ y(e).removeChild(e);
416
+ } catch {
417
+ if (de(e), !y(e)) throw C("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
418
+ }
419
+ }, nn = function(e) {
420
+ an(e);
421
+ let t = v(e);
422
+ if (t) {
423
+ let e = [];
424
+ h(t, (t) => {
425
+ g(e, t);
426
+ }), h(e, (e) => {
427
+ try {
428
+ de(e);
429
+ } catch {}
430
+ });
431
+ }
432
+ let n = w(e);
433
+ if (n) for (let t = n.length - 1; t >= 0; --t) {
434
+ let r = n[t], i = r && r.name;
435
+ if (typeof i == "string") try {
436
+ e.removeAttribute(i);
437
+ } catch {}
438
+ }
439
+ }, Z = function(e, n) {
440
+ try {
441
+ g(t.removed, {
442
+ attribute: n.getAttributeNode(e),
443
+ from: n
444
+ });
445
+ } catch {
446
+ g(t.removed, {
447
+ attribute: null,
448
+ from: n
449
+ });
450
+ }
451
+ if (n.removeAttribute(e), e === "is") if (U || Ct) try {
452
+ X(n);
453
+ } catch {}
454
+ else try {
455
+ n.setAttribute(e, "");
456
+ } catch {}
457
+ }, rn = function(e) {
458
+ let t = w(e);
459
+ if (t) for (let n = t.length - 1; n >= 0; --n) {
460
+ let r = t[n], i = r && r.name;
461
+ if (!(typeof i != "string" || L[J(i)])) try {
462
+ e.removeAttribute(i);
463
+ } catch {}
464
+ }
465
+ }, an = function(e) {
466
+ let t = [e];
467
+ for (; t.length > 0;) {
468
+ let e = t.pop();
469
+ (T ? T(e) : e.nodeType) === A.element && rn(e);
470
+ let n = v(e);
471
+ if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
472
+ }
473
+ }, on = function(e) {
474
+ if (!V) return;
475
+ let t = [e];
476
+ for (; t.length > 0;) {
477
+ let e = t.pop(), n = T ? T(e) : e.nodeType;
478
+ if (n === A.processingInstruction || n === A.comment && S(Le, e.data)) {
479
+ try {
480
+ de(e);
481
+ } catch {}
482
+ continue;
483
+ }
484
+ if (n === A.element) {
485
+ let t = e, n = J(D ? D(e) : e.nodeName);
486
+ try {
487
+ t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && n !== "label" && n !== "output" && t.removeAttribute("for");
488
+ } catch {}
489
+ }
490
+ let r = v(e);
491
+ if (r) for (let e = r.length - 1; e >= 0; --e) t.push(r[e]);
492
+ }
493
+ }, sn = function(e) {
494
+ let t = null, r = null;
495
+ if (St) e = "<remove></remove>" + e;
496
+ else {
497
+ let t = se(e, /^[\r\n\t ]+/);
498
+ r = t && t[0];
499
+ }
500
+ Gt === "application/xhtml+xml" && q === K && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
501
+ let i = M ? P(e) : e;
502
+ if (q === K) try {
503
+ t = new u().parseFromString(i, Gt);
504
+ } catch {}
505
+ if (!t || !t.documentElement) {
506
+ t = Ze.createDocument(q, "template", null);
507
+ try {
508
+ t.documentElement.innerHTML = Lt ? N : i;
509
+ } catch {}
510
+ }
511
+ let a = t.body || t.documentElement;
512
+ return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), q === K ? et.call(t, H ? "html" : "body")[0] : H ? t.documentElement : a;
513
+ }, cn = function(e) {
514
+ return Qe.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
515
+ }, ln = function(e) {
516
+ return e = ce(e, nt, " "), e = ce(e, rt, " "), e = ce(e, it, " "), e;
517
+ }, un = function(e) {
518
+ e.normalize();
519
+ let t = Qe.call(e.ownerDocument || e, e, l.SHOW_TEXT | l.SHOW_COMMENT | l.SHOW_CDATA_SECTION | l.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
520
+ for (; n;) n.data = ln(n.data), n = t.nextNode();
521
+ let r = e.querySelectorAll?.call(e, "template");
522
+ r && h(r, (e) => {
523
+ Q(e.content) && un(e.content);
524
+ });
525
+ }, dn = function(e) {
526
+ let t = D ? D(e) : null;
527
+ return typeof t != "string" || J(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== w(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== T(e) || e.childNodes !== v(e);
528
+ }, Q = function(e) {
529
+ if (!T || typeof e != "object" || !e) return !1;
530
+ try {
531
+ return T(e) === A.documentFragment;
532
+ } catch {
533
+ return !1;
534
+ }
535
+ }, fn = function(e) {
536
+ if (!T || typeof e != "object" || !e) return !1;
537
+ try {
538
+ return typeof T(e) == "number";
539
+ } catch {
540
+ return !1;
541
+ }
542
+ };
543
+ function $(e, n, r) {
544
+ e.length !== 0 && h(e, (e) => {
545
+ e.call(t, n, r, Y);
546
+ });
547
+ }
548
+ let pn = function(e, t) {
549
+ return !!(V && e.hasChildNodes() && !fn(e.firstElementChild) && S(Ie, e.textContent) && S(Ie, e.innerHTML) || V && e.namespaceURI === K && t === "style" && fn(e.firstElementChild) || e.nodeType === A.processingInstruction || V && e.nodeType === A.comment && S(Le, e.data));
550
+ }, mn = function(e, t) {
551
+ if (!pt[t] && vn(t) && (R.tagNameCheck instanceof RegExp && S(R.tagNameCheck, t) || R.tagNameCheck instanceof Function && R.tagNameCheck(t))) return !1;
552
+ if (Ot && !G[t]) {
553
+ let t = y(e), n = v(e);
554
+ if (n && t) {
555
+ let r = n.length;
556
+ for (let i = r - 1; i >= 0; --i) {
557
+ let r = kt ? n[i] : te(n[i], !0);
558
+ t.insertBefore(r, fe(e));
559
+ }
560
+ }
561
+ }
562
+ return X(e), !0;
563
+ }, hn = function(e, n) {
564
+ if ($(F.beforeSanitizeElements, e, null), e !== n && y(e) === null) return !0;
565
+ if (dn(e)) return X(e), !0;
566
+ let r = J(D ? D(e) : e.nodeName);
567
+ if ($(F.uponSanitizeElement, e, {
568
+ tagName: r,
569
+ allowedTags: I
570
+ }), e !== n && y(e) === null) return !0;
571
+ if (pn(e, r)) return X(e), !0;
572
+ if (pt[r] || !(z.tagCheck instanceof Function && z.tagCheck(r)) && !I[r]) {
573
+ let t = mn(e, r);
574
+ return t === !1 && $(F.afterSanitizeElements, e, null), t;
575
+ }
576
+ if ((T ? T(e) : e.nodeType) === A.element && !tn(e) || (r === "noscript" || r === "noembed" || r === "noframes") && S(Re, e.innerHTML)) return X(e), !0;
577
+ if (B && e.nodeType === A.text) {
578
+ let n = ln(e.textContent);
579
+ e.textContent !== n && (g(t.removed, { element: e.cloneNode() }), e.textContent = n);
580
+ }
581
+ return $(F.afterSanitizeElements, e, null), !1;
582
+ }, gn = function(e, t, r) {
583
+ if (mt[t] || V && t === "patchsrc" || V && t === "for" && e !== "label" && e !== "output" || Tt && (t === "id" || t === "name") && (r in n || r in qt)) return !1;
584
+ let i = L[t] || z.attributeCheck instanceof Function && z.attributeCheck(t, e);
585
+ if (!(gt && S(at, t)) && !(ht && S(ot, t))) {
586
+ if (!i) {
587
+ if (!(vn(e) && (R.tagNameCheck instanceof RegExp && S(R.tagNameCheck, e) || R.tagNameCheck instanceof Function && R.tagNameCheck(e)) && (R.attributeNameCheck instanceof RegExp && S(R.attributeNameCheck, t) || R.attributeNameCheck instanceof Function && R.attributeNameCheck(t, e)) || t === "is" && R.allowCustomizedBuiltInElements && (R.tagNameCheck instanceof RegExp && S(R.tagNameCheck, r) || R.tagNameCheck instanceof Function && R.tagNameCheck(r)))) return !1;
588
+ } else if (!Nt[t] && !S(ut, ce(r, ct, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && le(r, "data:") === 0 && jt[e]) && !(_t && !S(st, ce(r, ct, ""))) && r) return !1;
589
+ }
590
+ return !0;
591
+ }, _n = E({}, [
592
+ "annotation-xml",
593
+ "color-profile",
594
+ "font-face",
595
+ "font-face-format",
596
+ "font-face-name",
597
+ "font-face-src",
598
+ "font-face-uri",
599
+ "missing-glyph"
600
+ ]), vn = function(e) {
601
+ return !_n[ae(e)] && S(lt, e);
602
+ }, yn = function(e, t, n, r) {
603
+ if (M && typeof p == "object" && typeof p.getAttributeType == "function" && !n) switch (p.getAttributeType(e, t)) {
604
+ case "TrustedHTML": return P(r);
605
+ case "TrustedScriptURL": return Je(r);
606
+ }
607
+ return r;
608
+ }, bn = function(e, n, r, i) {
609
+ try {
610
+ r ? e.setAttributeNS(r, n, i) : e.setAttribute(n, i), dn(e) ? X(e) : re(t.removed);
611
+ } catch {
612
+ Z(n, e);
613
+ }
614
+ }, xn = function(e) {
615
+ $(F.beforeSanitizeAttributes, e, null);
616
+ let t = e.attributes;
617
+ if (!t || dn(e)) return;
618
+ let n = {
619
+ attrName: "",
620
+ attrValue: "",
621
+ keepAttr: !0,
622
+ allowedAttributes: L,
623
+ forceKeepAttr: void 0
624
+ }, r = t.length, i = J(e.nodeName);
625
+ for (; r--;) {
626
+ let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, l = J(o), u = c, d = o === "value" ? u : ue(u);
627
+ if (n.attrName = l, n.attrValue = d, n.keepAttr = !0, n.forceKeepAttr = void 0, $(F.uponSanitizeAttribute, e, n), d = n.attrValue, Et && (l === "id" || l === "name") && le(d, Dt) !== 0 && (Z(o, e), d = Dt + d), V && S(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
628
+ Z(o, e);
629
+ continue;
630
+ }
631
+ if (l === "attributename" && se(d, "href")) {
632
+ Z(o, e);
633
+ continue;
634
+ }
635
+ if (!n.forceKeepAttr) {
636
+ if (!n.keepAttr) {
637
+ Z(o, e);
638
+ continue;
639
+ }
640
+ if (!vt && S(ze, d)) {
641
+ Z(o, e);
642
+ continue;
643
+ }
644
+ if (B && (d = ln(d)), !gn(i, l, d)) {
645
+ Z(o, e);
646
+ continue;
647
+ }
648
+ d = yn(i, l, s, d), d !== u && bn(e, o, s, d);
649
+ }
650
+ }
651
+ $(F.afterSanitizeAttributes, e, null);
652
+ }, Sn = function(e) {
653
+ let t = null, n = cn(e);
654
+ for ($(F.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if ($(F.uponSanitizeShadowNode, t, null), hn(t, e), xn(t), Q(t.content) && Sn(t.content), (T ? T(t) : t.nodeType) === A.element) {
655
+ let e = x(t);
656
+ Q(e) && (Cn(e), Sn(e));
657
+ }
658
+ $(F.afterSanitizeShadowDOM, e, null);
659
+ }, Cn = function(e) {
660
+ let t = [{
661
+ node: e,
662
+ shadow: null
663
+ }];
664
+ for (; t.length > 0;) {
665
+ let e = t.pop();
666
+ if (e.shadow) {
667
+ Sn(e.shadow);
668
+ continue;
669
+ }
670
+ let n = e.node, r = (T ? T(n) : n.nodeType) === A.element, i = v(n);
671
+ if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
672
+ node: i[e],
673
+ shadow: null
674
+ });
675
+ if (r) {
676
+ let e = D ? D(n) : null;
677
+ if (typeof e == "string" && J(e) === "template") {
678
+ let e = n.content;
679
+ Q(e) && t.push({
680
+ node: e,
681
+ shadow: null
682
+ });
683
+ }
684
+ }
685
+ if (r) {
686
+ let e = x(n);
687
+ Q(e) && t.push({
688
+ node: null,
689
+ shadow: e
690
+ }, {
691
+ node: e,
692
+ shadow: null
693
+ });
694
+ }
695
+ }
696
+ };
697
+ return t.sanitize = function(e) {
698
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
699
+ if (Lt = !e, Lt && (e = "<!-->"), typeof e != "string" && !fn(e) && (e = pe(e), typeof e != "string")) throw C("dirty is not a string, aborting");
700
+ if (!t.isSupported) return e;
701
+ yt ? (I = bt, L = xt) : Yt(n), (F.uponSanitizeElement.length > 0 || F.uponSanitizeAttribute.length > 0) && (I = O(I)), F.uponSanitizeAttribute.length > 0 && (L = O(L)), t.removed = [];
702
+ let c = kt && typeof e != "string" && fn(e);
703
+ if (c) {
704
+ on(e);
705
+ let t = D ? D(e) : e.nodeName;
706
+ if (typeof t == "string") {
707
+ let n = J(t);
708
+ if (!I[n] || pt[n]) throw nn(e), C("root node is forbidden and cannot be sanitized in-place");
709
+ }
710
+ if (dn(e)) throw nn(e), C("root node is clobbered and cannot be sanitized in-place");
711
+ try {
712
+ Cn(e);
713
+ } catch (t) {
714
+ throw nn(e), t;
715
+ }
716
+ } else if (fn(e)) i = sn("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === A.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Cn(a);
717
+ else {
718
+ if (!U && !B && !H && e.indexOf("<") === -1) return M && wt ? P(e) : e;
719
+ if (i = sn(e), !i) return U ? null : wt ? N : "";
720
+ }
721
+ i && St && X(i.firstChild);
722
+ let l = c ? e : i, u = cn(l);
723
+ try {
724
+ for (; o = u.nextNode();) hn(o, l), xn(o), Q(o.content) && Sn(o.content);
725
+ } catch (n) {
726
+ throw c && (nn(e), h(t.removed, (e) => {
727
+ e.element && an(e.element);
728
+ })), n;
729
+ }
730
+ if (c) return h(t.removed, (e) => {
731
+ e.element && an(e.element);
732
+ }), B && un(e), e;
733
+ if (U) {
734
+ if (B && un(i), Ct) for (s = $e.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
735
+ else s = i;
736
+ return (L.shadowroot || L.shadowrootmode) && (s = tt.call(r, s, !0)), s;
737
+ }
738
+ let d = H ? i.outerHTML : i.innerHTML;
739
+ return H && I["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && S(Pe, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), B && (d = ln(d)), M && wt ? P(d) : d;
740
+ }, t.setConfig = function() {
741
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
742
+ Yt(e), yt = !0, bt = I, xt = L;
743
+ }, t.clearConfig = function() {
744
+ Y = null, yt = !1, bt = null, xt = null, M = We, N = "";
745
+ }, t.isValidAttribute = function(e, t, n) {
746
+ Y || Yt({});
747
+ let r = J(e), i = J(t);
748
+ return gn(r, i, n);
749
+ }, t.addHook = function(e, t) {
750
+ typeof t == "function" && b(F, e) && g(F[e], t);
751
+ }, t.removeHook = function(e, t) {
752
+ if (b(F, e)) {
753
+ if (t !== void 0) {
754
+ let n = ne(F[e], t);
755
+ return n === -1 ? void 0 : ie(F[e], n, 1)[0];
756
+ }
757
+ return re(F[e]);
758
+ }
759
+ }, t.removeHooks = function(e) {
760
+ b(F, e) && (F[e] = []);
761
+ }, t.removeAllHooks = function() {
762
+ F = He();
763
+ }, t;
764
+ }
765
+ var M = Ue();
766
+ //#endregion
767
+ export { M as t };