@blogmcp/sdk 0.6.0 → 0.6.1

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 (74) hide show
  1. package/dist/core/index.js +2 -2
  2. package/dist/packages/mdx-render-vue/dist/composables/useGallery.js +12 -11
  3. package/dist/packages/mdx-render-vue/dist/composables/useTripMap.js +16 -16
  4. package/dist/packages/mdx-render-vue/dist/edit/TripMapEdit.vue.js +1 -1
  5. package/dist/packages/mdx-render-vue/dist/registry.js +21 -22
  6. package/dist/packages/mdx-render-vue/dist/render/alert/Alert.vue2.js +1 -1
  7. package/dist/packages/mdx-render-vue/dist/render/badge/Badge.vue2.js +1 -1
  8. package/dist/packages/mdx-render-vue/dist/render/button/Button.vue2.js +1 -1
  9. package/dist/packages/mdx-render-vue/dist/render/callout/CalloutDefault.vue.js +1 -1
  10. package/dist/packages/mdx-render-vue/dist/render/callout/CalloutMinimal.vue.js +1 -1
  11. package/dist/packages/mdx-render-vue/dist/render/tripmap/TripMapDefault.vue.js +2 -2
  12. package/dist/react/KbMdxContent.js +7 -8
  13. package/dist/vue/components/KbMdxContent.vue2.js +6 -7
  14. package/package.json +3 -3
  15. package/dist/_virtual/constants.js +0 -4
  16. package/dist/_virtual/index.js +0 -2
  17. package/dist/_virtual/index2.js +0 -4
  18. package/dist/_virtual/index3.js +0 -2
  19. package/dist/_virtual/re.js +0 -4
  20. package/dist/node_modules/@braintree/sanitize-url/dist/constants.js +0 -8
  21. package/dist/node_modules/@braintree/sanitize-url/dist/index.js +0 -60
  22. package/dist/node_modules/dompurify/dist/purify.es.js +0 -662
  23. package/dist/node_modules/semver/classes/comparator.js +0 -56
  24. package/dist/node_modules/semver/classes/range.js +0 -148
  25. package/dist/node_modules/semver/classes/semver.js +0 -169
  26. package/dist/node_modules/semver/functions/clean.js +0 -14
  27. package/dist/node_modules/semver/functions/cmp.js +0 -39
  28. package/dist/node_modules/semver/functions/coerce.js +0 -33
  29. package/dist/node_modules/semver/functions/compare-build.js +0 -14
  30. package/dist/node_modules/semver/functions/compare-loose.js +0 -11
  31. package/dist/node_modules/semver/functions/compare.js +0 -11
  32. package/dist/node_modules/semver/functions/diff.js +0 -24
  33. package/dist/node_modules/semver/functions/eq.js +0 -11
  34. package/dist/node_modules/semver/functions/gt.js +0 -11
  35. package/dist/node_modules/semver/functions/gte.js +0 -11
  36. package/dist/node_modules/semver/functions/inc.js +0 -21
  37. package/dist/node_modules/semver/functions/lt.js +0 -11
  38. package/dist/node_modules/semver/functions/lte.js +0 -11
  39. package/dist/node_modules/semver/functions/major.js +0 -11
  40. package/dist/node_modules/semver/functions/minor.js +0 -11
  41. package/dist/node_modules/semver/functions/neq.js +0 -11
  42. package/dist/node_modules/semver/functions/parse.js +0 -21
  43. package/dist/node_modules/semver/functions/patch.js +0 -11
  44. package/dist/node_modules/semver/functions/prerelease.js +0 -14
  45. package/dist/node_modules/semver/functions/rcompare.js +0 -11
  46. package/dist/node_modules/semver/functions/rsort.js +0 -11
  47. package/dist/node_modules/semver/functions/satisfies.js +0 -18
  48. package/dist/node_modules/semver/functions/sort.js +0 -11
  49. package/dist/node_modules/semver/functions/valid.js +0 -14
  50. package/dist/node_modules/semver/index.js +0 -97
  51. package/dist/node_modules/semver/internal/constants.js +0 -28
  52. package/dist/node_modules/semver/internal/debug.js +0 -8
  53. package/dist/node_modules/semver/internal/identifiers.js +0 -18
  54. package/dist/node_modules/semver/internal/lrucache.js +0 -32
  55. package/dist/node_modules/semver/internal/parse-options.js +0 -10
  56. package/dist/node_modules/semver/internal/re.js +0 -32
  57. package/dist/node_modules/semver/ranges/gtr.js +0 -11
  58. package/dist/node_modules/semver/ranges/intersects.js +0 -11
  59. package/dist/node_modules/semver/ranges/ltr.js +0 -11
  60. package/dist/node_modules/semver/ranges/max-satisfying.js +0 -22
  61. package/dist/node_modules/semver/ranges/min-satisfying.js +0 -22
  62. package/dist/node_modules/semver/ranges/min-version.js +0 -42
  63. package/dist/node_modules/semver/ranges/outside.js +0 -44
  64. package/dist/node_modules/semver/ranges/simplify.js +0 -24
  65. package/dist/node_modules/semver/ranges/subset.js +0 -94
  66. package/dist/node_modules/semver/ranges/to-comparators.js +0 -11
  67. package/dist/node_modules/semver/ranges/valid.js +0 -17
  68. package/dist/packages/mdx-schema/dist/composables/useMdxParsing.js +0 -389
  69. package/dist/packages/mdx-schema/dist/metadata/index.js +0 -526
  70. package/dist/packages/mdx-schema/dist/prepareProps.js +0 -46
  71. package/dist/packages/mdx-schema/dist/styles/index.js +0 -147
  72. package/dist/packages/mdx-schema/dist/tripmap.js +0 -101
  73. package/dist/packages/mdx-schema/dist/types/index.js +0 -26
  74. package/dist/packages/sanitize/dist/html.js +0 -89
@@ -1,662 +0,0 @@
1
- function yt(n, o) {
2
- (o == null || o > n.length) && (o = n.length);
3
- for (var a = 0, s = Array(o); a < o; a++) s[a] = n[a];
4
- return s;
5
- }
6
- function nn(n) {
7
- if (Array.isArray(n)) return n;
8
- }
9
- function on(n, o) {
10
- var a = n == null ? null : typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"];
11
- if (a != null) {
12
- var s, f, p, b, te = [], I = !0, ne = !1;
13
- try {
14
- if (p = (a = a.call(n)).next, o !== 0) for (; !(I = (s = p.call(a)).done) && (te.push(s.value), te.length !== o); I = !0) ;
15
- } catch (Le) {
16
- ne = !0, f = Le;
17
- } finally {
18
- try {
19
- if (!I && a.return != null && (b = a.return(), Object(b) !== b)) return;
20
- } finally {
21
- if (ne) throw f;
22
- }
23
- }
24
- return te;
25
- }
26
- }
27
- function rn() {
28
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
29
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
30
- }
31
- function an(n, o) {
32
- return nn(n) || on(n, o) || sn(n, o) || rn();
33
- }
34
- function sn(n, o) {
35
- if (n) {
36
- if (typeof n == "string") return yt(n, o);
37
- var a = {}.toString.call(n).slice(8, -1);
38
- return a === "Object" && n.constructor && (a = n.constructor.name), a === "Map" || a === "Set" ? Array.from(n) : a === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a) ? yt(n, o) : void 0;
39
- }
40
- }
41
- const kt = Object.entries, bt = Object.setPrototypeOf, ln = Object.isFrozen, cn = Object.getPrototypeOf, fn = Object.getOwnPropertyDescriptor;
42
- let D = Object.freeze, C = Object.seal, ee = Object.create, Ft = typeof Reflect < "u" && Reflect, Ke = Ft.apply, Ze = Ft.construct;
43
- D || (D = function(o) {
44
- return o;
45
- });
46
- C || (C = function(o) {
47
- return o;
48
- });
49
- Ke || (Ke = function(o, a) {
50
- for (var s = arguments.length, f = new Array(s > 2 ? s - 2 : 0), p = 2; p < s; p++)
51
- f[p - 2] = arguments[p];
52
- return o.apply(a, f);
53
- });
54
- Ze || (Ze = function(o) {
55
- for (var a = arguments.length, s = new Array(a > 1 ? a - 1 : 0), f = 1; f < a; f++)
56
- s[f - 1] = arguments[f];
57
- return new o(...s);
58
- });
59
- const Z = A(Array.prototype.forEach), un = A(Array.prototype.lastIndexOf), Rt = A(Array.prototype.pop), J = A(Array.prototype.push), mn = A(Array.prototype.splice), N = Array.isArray, ue = A(String.prototype.toLowerCase), Ye = A(String.prototype.toString), Ot = A(String.prototype.match), Q = A(String.prototype.replace), Nt = A(String.prototype.indexOf), pn = A(String.prototype.trim), dn = A(Number.prototype.toString), Tn = A(Boolean.prototype.toString), Dt = typeof BigInt > "u" ? null : A(BigInt.prototype.toString), It = typeof Symbol > "u" ? null : A(Symbol.prototype.toString), d = A(Object.prototype.hasOwnProperty), ce = A(Object.prototype.toString), y = A(RegExp.prototype.test), fe = gn(TypeError);
60
- function A(n) {
61
- return function(o) {
62
- o instanceof RegExp && (o.lastIndex = 0);
63
- for (var a = arguments.length, s = new Array(a > 1 ? a - 1 : 0), f = 1; f < a; f++)
64
- s[f - 1] = arguments[f];
65
- return Ke(n, o, s);
66
- };
67
- }
68
- function gn(n) {
69
- return function() {
70
- for (var o = arguments.length, a = new Array(o), s = 0; s < o; s++)
71
- a[s] = arguments[s];
72
- return Ze(n, a);
73
- };
74
- }
75
- function l(n, o) {
76
- let a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ue;
77
- if (bt && bt(n, null), !N(o))
78
- return n;
79
- let s = o.length;
80
- for (; s--; ) {
81
- let f = o[s];
82
- if (typeof f == "string") {
83
- const p = a(f);
84
- p !== f && (ln(o) || (o[s] = p), f = p);
85
- }
86
- n[f] = !0;
87
- }
88
- return n;
89
- }
90
- function _n(n) {
91
- for (let o = 0; o < n.length; o++)
92
- d(n, o) || (n[o] = null);
93
- return n;
94
- }
95
- function R(n) {
96
- const o = ee(null);
97
- for (const s of kt(n)) {
98
- var a = an(s, 2);
99
- const f = a[0], p = a[1];
100
- d(n, f) && (N(p) ? o[f] = _n(p) : p && typeof p == "object" && p.constructor === Object ? o[f] = R(p) : o[f] = p);
101
- }
102
- return o;
103
- }
104
- function hn(n) {
105
- switch (typeof n) {
106
- case "string":
107
- return n;
108
- case "number":
109
- return dn(n);
110
- case "boolean":
111
- return Tn(n);
112
- case "bigint":
113
- return Dt ? Dt(n) : "0";
114
- case "symbol":
115
- return It ? It(n) : "Symbol()";
116
- case "undefined":
117
- return ce(n);
118
- case "function":
119
- case "object": {
120
- if (n === null)
121
- return ce(n);
122
- const o = n, a = U(o, "toString");
123
- if (typeof a == "function") {
124
- const s = a(o);
125
- return typeof s == "string" ? s : ce(s);
126
- }
127
- return ce(n);
128
- }
129
- default:
130
- return ce(n);
131
- }
132
- }
133
- function U(n, o) {
134
- for (; n !== null; ) {
135
- const s = fn(n, o);
136
- if (s) {
137
- if (s.get)
138
- return A(s.get);
139
- if (typeof s.value == "function")
140
- return A(s.value);
141
- }
142
- n = cn(n);
143
- }
144
- function a() {
145
- return null;
146
- }
147
- return a;
148
- }
149
- function An(n) {
150
- try {
151
- return y(n, ""), !0;
152
- } catch {
153
- return !1;
154
- }
155
- }
156
- const Lt = D(["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"]), $e = D(["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"]), Xe = D(["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"]), En = D(["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"]), Ve = D(["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"]), Sn = D(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ct = D(["#text"]), wt = D(["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"]), qe = D(["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", "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-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"]), Mt = D(["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"]), Ie = D(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), yn = C(/{{[\w\W]*|^[\w\W]*}}/g), bn = C(/<%[\w\W]*|^[\w\W]*%>/g), Rn = C(/\${[\w\W]*/g), On = C(/^data-[\-\w.\u00B7-\uFFFF]+$/), Nn = C(/^aria-[\-\w]+$/), xt = C(
157
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
158
- // eslint-disable-line no-useless-escape
159
- ), Dn = C(/^(?:\w+script|data):/i), In = C(
160
- /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
161
- // eslint-disable-line no-control-regex
162
- ), Ln = C(/^html$/i), Cn = C(/^[a-z][.\w]*(-[.\w]+)+$/i), v = {
163
- element: 1,
164
- attribute: 2,
165
- text: 3,
166
- cdataSection: 4,
167
- entityReference: 5,
168
- // Deprecated
169
- entityNode: 6,
170
- // Deprecated
171
- progressingInstruction: 7,
172
- comment: 8,
173
- document: 9,
174
- documentType: 10,
175
- documentFragment: 11,
176
- notation: 12
177
- // Deprecated
178
- }, wn = function() {
179
- return typeof window > "u" ? null : window;
180
- }, Mn = function(o, a) {
181
- if (typeof o != "object" || typeof o.createPolicy != "function")
182
- return null;
183
- let s = null;
184
- const f = "data-tt-policy-suffix";
185
- a && a.hasAttribute(f) && (s = a.getAttribute(f));
186
- const p = "dompurify" + (s ? "#" + s : "");
187
- try {
188
- return o.createPolicy(p, {
189
- createHTML(b) {
190
- return b;
191
- },
192
- createScriptURL(b) {
193
- return b;
194
- }
195
- });
196
- } catch {
197
- return console.warn("TrustedTypes policy " + p + " could not be created."), null;
198
- }
199
- }, Pt = function() {
200
- return {
201
- afterSanitizeAttributes: [],
202
- afterSanitizeElements: [],
203
- afterSanitizeShadowDOM: [],
204
- beforeSanitizeAttributes: [],
205
- beforeSanitizeElements: [],
206
- beforeSanitizeShadowDOM: [],
207
- uponSanitizeAttribute: [],
208
- uponSanitizeElement: [],
209
- uponSanitizeShadowNode: []
210
- };
211
- };
212
- function vt() {
213
- let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : wn();
214
- const o = (i) => vt(i);
215
- if (o.version = "3.4.7", o.removed = [], !n || !n.document || n.document.nodeType !== v.document || !n.Element)
216
- return o.isSupported = !1, o;
217
- let a = n.document;
218
- const s = a, f = s.currentScript;
219
- n.DocumentFragment;
220
- const p = n.HTMLTemplateElement, b = n.Node, te = n.Element, I = n.NodeFilter, ne = n.NamedNodeMap;
221
- ne === void 0 && (n.NamedNodeMap || n.MozNamedAttrMap), n.HTMLFormElement;
222
- const Le = n.DOMParser, me = n.trustedTypes, W = te.prototype, Ut = U(W, "cloneNode"), Ht = U(W, "remove"), zt = U(W, "nextSibling"), pe = U(W, "childNodes"), de = U(W, "parentNode"), Te = U(W, "shadowRoot"), Gt = U(W, "attributes"), w = b && b.prototype ? U(b.prototype, "nodeType") : null, Y = b && b.prototype ? U(b.prototype, "nodeName") : null;
223
- if (typeof p == "function") {
224
- const i = a.createElement("template");
225
- i.content && i.content.ownerDocument && (a = i.content.ownerDocument);
226
- }
227
- let O, oe = "";
228
- const ge = a, Ce = ge.implementation, Je = ge.createNodeIterator, Wt = ge.createDocumentFragment, Bt = ge.getElementsByTagName, jt = s.importNode;
229
- let E = Pt();
230
- o.isSupported = typeof kt == "function" && typeof de == "function" && Ce && Ce.createHTMLDocument !== void 0;
231
- const _e = yn, he = bn, Ae = Rn, Yt = On, $t = Nn, Xt = Dn, Qe = In, Vt = Cn;
232
- let et = xt, T = null;
233
- const we = l({}, [...Lt, ...$e, ...Xe, ...Ve, ...Ct]);
234
- let h = null;
235
- const Me = l({}, [...wt, ...qe, ...Mt, ...Ie]);
236
- let g = Object.seal(ee(null, {
237
- tagNameCheck: {
238
- writable: !0,
239
- configurable: !1,
240
- enumerable: !0,
241
- value: null
242
- },
243
- attributeNameCheck: {
244
- writable: !0,
245
- configurable: !1,
246
- enumerable: !0,
247
- value: null
248
- },
249
- allowCustomizedBuiltInElements: {
250
- writable: !0,
251
- configurable: !1,
252
- enumerable: !0,
253
- value: !1
254
- }
255
- })), re = null, Ee = null;
256
- const z = Object.seal(ee(null, {
257
- tagCheck: {
258
- writable: !0,
259
- configurable: !1,
260
- enumerable: !0,
261
- value: null
262
- },
263
- attributeCheck: {
264
- writable: !0,
265
- configurable: !1,
266
- enumerable: !0,
267
- value: null
268
- }
269
- }));
270
- let tt = !0, xe = !0, nt = !1, ot = !0, G = !1, ie = !0, B = !1, Pe = !1, ke = !1, $ = !1, Se = !1, ye = !1, rt = !0, it = !1;
271
- const at = "user-content-";
272
- let Fe = !0, ae = !1, X = {}, P = null;
273
- const ve = l({}, ["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"]);
274
- let st = null;
275
- const lt = l({}, ["audio", "video", "img", "source", "image", "track"]);
276
- let Ue = null;
277
- const ct = l({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), be = "http://www.w3.org/1998/Math/MathML", Re = "http://www.w3.org/2000/svg", k = "http://www.w3.org/1999/xhtml";
278
- let V = k, He = !1, ze = null;
279
- const qt = l({}, [be, Re, k], Ye);
280
- let Ge = l({}, ["mi", "mo", "mn", "ms", "mtext"]), We = l({}, ["annotation-xml"]);
281
- const Kt = l({}, ["title", "style", "font", "a", "script"]);
282
- let se = null;
283
- const Zt = ["application/xhtml+xml", "text/html"], Jt = "text/html";
284
- let _ = null, q = null;
285
- const Qt = a.createElement("form"), ft = function(e) {
286
- return e instanceof RegExp || e instanceof Function;
287
- }, Be = function() {
288
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
289
- if (q && q === e)
290
- return;
291
- (!e || typeof e != "object") && (e = {}), e = R(e), se = // eslint-disable-next-line unicorn/prefer-includes
292
- Zt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? Jt : e.PARSER_MEDIA_TYPE, _ = se === "application/xhtml+xml" ? Ye : ue, T = d(e, "ALLOWED_TAGS") && N(e.ALLOWED_TAGS) ? l({}, e.ALLOWED_TAGS, _) : we, h = d(e, "ALLOWED_ATTR") && N(e.ALLOWED_ATTR) ? l({}, e.ALLOWED_ATTR, _) : Me, ze = d(e, "ALLOWED_NAMESPACES") && N(e.ALLOWED_NAMESPACES) ? l({}, e.ALLOWED_NAMESPACES, Ye) : qt, Ue = d(e, "ADD_URI_SAFE_ATTR") && N(e.ADD_URI_SAFE_ATTR) ? l(R(ct), e.ADD_URI_SAFE_ATTR, _) : ct, st = d(e, "ADD_DATA_URI_TAGS") && N(e.ADD_DATA_URI_TAGS) ? l(R(lt), e.ADD_DATA_URI_TAGS, _) : lt, P = d(e, "FORBID_CONTENTS") && N(e.FORBID_CONTENTS) ? l({}, e.FORBID_CONTENTS, _) : ve, re = d(e, "FORBID_TAGS") && N(e.FORBID_TAGS) ? l({}, e.FORBID_TAGS, _) : R({}), Ee = d(e, "FORBID_ATTR") && N(e.FORBID_ATTR) ? l({}, e.FORBID_ATTR, _) : R({}), X = d(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? R(e.USE_PROFILES) : e.USE_PROFILES : !1, tt = e.ALLOW_ARIA_ATTR !== !1, xe = e.ALLOW_DATA_ATTR !== !1, nt = e.ALLOW_UNKNOWN_PROTOCOLS || !1, ot = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, G = e.SAFE_FOR_TEMPLATES || !1, ie = e.SAFE_FOR_XML !== !1, B = e.WHOLE_DOCUMENT || !1, $ = e.RETURN_DOM || !1, Se = e.RETURN_DOM_FRAGMENT || !1, ye = e.RETURN_TRUSTED_TYPE || !1, ke = e.FORCE_BODY || !1, rt = e.SANITIZE_DOM !== !1, it = e.SANITIZE_NAMED_PROPS || !1, Fe = e.KEEP_CONTENT !== !1, ae = e.IN_PLACE || !1, et = An(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : xt, V = typeof e.NAMESPACE == "string" ? e.NAMESPACE : k, Ge = d(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? R(e.MATHML_TEXT_INTEGRATION_POINTS) : l({}, ["mi", "mo", "mn", "ms", "mtext"]), We = d(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? R(e.HTML_INTEGRATION_POINTS) : l({}, ["annotation-xml"]);
293
- const t = d(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? R(e.CUSTOM_ELEMENT_HANDLING) : ee(null);
294
- if (g = ee(null), d(t, "tagNameCheck") && ft(t.tagNameCheck) && (g.tagNameCheck = t.tagNameCheck), d(t, "attributeNameCheck") && ft(t.attributeNameCheck) && (g.attributeNameCheck = t.attributeNameCheck), d(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (g.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), G && (xe = !1), Se && ($ = !0), X && (T = l({}, Ct), h = ee(null), X.html === !0 && (l(T, Lt), l(h, wt)), X.svg === !0 && (l(T, $e), l(h, qe), l(h, Ie)), X.svgFilters === !0 && (l(T, Xe), l(h, qe), l(h, Ie)), X.mathMl === !0 && (l(T, Ve), l(h, Mt), l(h, Ie))), z.tagCheck = null, z.attributeCheck = null, d(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? z.tagCheck = e.ADD_TAGS : N(e.ADD_TAGS) && (T === we && (T = R(T)), l(T, e.ADD_TAGS, _))), d(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? z.attributeCheck = e.ADD_ATTR : N(e.ADD_ATTR) && (h === Me && (h = R(h)), l(h, e.ADD_ATTR, _))), d(e, "ADD_URI_SAFE_ATTR") && N(e.ADD_URI_SAFE_ATTR) && l(Ue, e.ADD_URI_SAFE_ATTR, _), d(e, "FORBID_CONTENTS") && N(e.FORBID_CONTENTS) && (P === ve && (P = R(P)), l(P, e.FORBID_CONTENTS, _)), d(e, "ADD_FORBID_CONTENTS") && N(e.ADD_FORBID_CONTENTS) && (P === ve && (P = R(P)), l(P, e.ADD_FORBID_CONTENTS, _)), Fe && (T["#text"] = !0), B && l(T, ["html", "head", "body"]), T.table && (l(T, ["tbody"]), delete re.tbody), e.TRUSTED_TYPES_POLICY) {
295
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
296
- throw fe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
297
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
298
- throw fe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
299
- O = e.TRUSTED_TYPES_POLICY, oe = O.createHTML("");
300
- } else
301
- O === void 0 && (O = Mn(me, f)), O !== null && typeof oe == "string" && (oe = O.createHTML(""));
302
- (E.uponSanitizeElement.length > 0 || E.uponSanitizeAttribute.length > 0) && T === we && (T = R(T)), E.uponSanitizeAttribute.length > 0 && h === Me && (h = R(h)), D && D(e), q = e;
303
- }, ut = l({}, [...$e, ...Xe, ...En]), mt = l({}, [...Ve, ...Sn]), en = function(e) {
304
- let t = de(e);
305
- (!t || !t.tagName) && (t = {
306
- namespaceURI: V,
307
- tagName: "template"
308
- });
309
- const r = ue(e.tagName), u = ue(t.tagName);
310
- return ze[e.namespaceURI] ? e.namespaceURI === Re ? t.namespaceURI === k ? r === "svg" : t.namespaceURI === be ? r === "svg" && (u === "annotation-xml" || Ge[u]) : !!ut[r] : e.namespaceURI === be ? t.namespaceURI === k ? r === "math" : t.namespaceURI === Re ? r === "math" && We[u] : !!mt[r] : e.namespaceURI === k ? t.namespaceURI === Re && !We[u] || t.namespaceURI === be && !Ge[u] ? !1 : !mt[r] && (Kt[r] || !ut[r]) : !!(se === "application/xhtml+xml" && ze[e.namespaceURI]) : !1;
311
- }, M = function(e) {
312
- J(o.removed, {
313
- element: e
314
- });
315
- try {
316
- de(e).removeChild(e);
317
- } catch {
318
- Ht(e);
319
- }
320
- }, j = function(e, t) {
321
- try {
322
- J(o.removed, {
323
- attribute: t.getAttributeNode(e),
324
- from: t
325
- });
326
- } catch {
327
- J(o.removed, {
328
- attribute: null,
329
- from: t
330
- });
331
- }
332
- if (t.removeAttribute(e), e === "is")
333
- if ($ || Se)
334
- try {
335
- M(t);
336
- } catch {
337
- }
338
- else
339
- try {
340
- t.setAttribute(e, "");
341
- } catch {
342
- }
343
- }, pt = function(e) {
344
- let t = null, r = null;
345
- if (ke)
346
- e = "<remove></remove>" + e;
347
- else {
348
- const m = Ot(e, /^[\r\n\t ]+/);
349
- r = m && m[0];
350
- }
351
- se === "application/xhtml+xml" && V === k && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
352
- const u = O ? O.createHTML(e) : e;
353
- if (V === k)
354
- try {
355
- t = new Le().parseFromString(u, se);
356
- } catch {
357
- }
358
- if (!t || !t.documentElement) {
359
- t = Ce.createDocument(V, "template", null);
360
- try {
361
- t.documentElement.innerHTML = He ? oe : u;
362
- } catch {
363
- }
364
- }
365
- const c = t.body || t.documentElement;
366
- return e && r && c.insertBefore(a.createTextNode(r), c.childNodes[0] || null), V === k ? Bt.call(t, B ? "html" : "body")[0] : B ? t.documentElement : c;
367
- }, dt = function(e) {
368
- return Je.call(
369
- e.ownerDocument || e,
370
- e,
371
- // eslint-disable-next-line no-bitwise
372
- I.SHOW_ELEMENT | I.SHOW_COMMENT | I.SHOW_TEXT | I.SHOW_PROCESSING_INSTRUCTION | I.SHOW_CDATA_SECTION,
373
- null
374
- );
375
- }, Tt = function(e) {
376
- e.normalize();
377
- const t = Je.call(
378
- e.ownerDocument || e,
379
- e,
380
- // eslint-disable-next-line no-bitwise
381
- I.SHOW_TEXT | I.SHOW_COMMENT | I.SHOW_CDATA_SECTION | I.SHOW_PROCESSING_INSTRUCTION,
382
- null
383
- );
384
- let r = t.nextNode();
385
- for (; r; ) {
386
- let u = r.data;
387
- Z([_e, he, Ae], (c) => {
388
- u = Q(u, c, " ");
389
- }), r.data = u, r = t.nextNode();
390
- }
391
- }, Oe = function(e) {
392
- const t = Y ? Y(e) : null;
393
- return typeof t != "string" || _(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
394
- // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
395
- // makes the direct read diverge from the cached read; a clean form
396
- // (same-realm OR foreign-realm) has both reads pointing at the same
397
- // canonical NamedNodeMap.
398
- e.attributes !== Gt(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
399
- // returns the integer 1 for any Element regardless of realm; direct
400
- // read on a clobbered form (e.g. <input name="nodeType">) returns
401
- // the named child element. Cheap addition — nodeType is read from
402
- // an internal slot, no serialization cost — and removes a residual
403
- // clobbering surface used by several mXSS / PI / comment branches
404
- // in _sanitizeElements that compare currentNode.nodeType directly.
405
- e.nodeType !== w(e) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
406
- // "childNodes" shadows the prototype getter. Direct reads of
407
- // form.childNodes from a clobbered form return the named child
408
- // instead of the real NodeList, so any walk that reads it directly
409
- // skips the form's real children. Compare the direct read to the
410
- // cached Node.prototype getter — when the form's named-property
411
- // getter intercepts the read, the two values differ and we flag
412
- // the form. This catches every clobbering child type (input,
413
- // select, etc.) regardless of whether the named child happens to
414
- // carry a numeric .length, which a typeof-based probe would miss
415
- // (e.g. HTMLSelectElement.length is a defined unsigned-long).
416
- e.childNodes !== pe(e);
417
- }, le = function(e) {
418
- if (!w || typeof e != "object" || e === null)
419
- return !1;
420
- try {
421
- return w(e) === v.documentFragment;
422
- } catch {
423
- return !1;
424
- }
425
- }, Ne = function(e) {
426
- if (!w || typeof e != "object" || e === null)
427
- return !1;
428
- try {
429
- return typeof w(e) == "number";
430
- } catch {
431
- return !1;
432
- }
433
- };
434
- function H(i, e, t) {
435
- Z(i, (r) => {
436
- r.call(o, e, t, q);
437
- });
438
- }
439
- const gt = function(e) {
440
- let t = null;
441
- if (H(E.beforeSanitizeElements, e, null), Oe(e))
442
- return M(e), !0;
443
- const r = _(e.nodeName);
444
- if (H(E.uponSanitizeElement, e, {
445
- tagName: r,
446
- allowedTags: T
447
- }), ie && e.hasChildNodes() && !Ne(e.firstElementChild) && y(/<[/\w!]/g, e.innerHTML) && y(/<[/\w!]/g, e.textContent) || ie && e.namespaceURI === k && r === "style" && Ne(e.firstElementChild) || e.nodeType === v.progressingInstruction || ie && e.nodeType === v.comment && y(/<[/\w]/g, e.data))
448
- return M(e), !0;
449
- if (re[r] || !(z.tagCheck instanceof Function && z.tagCheck(r)) && !T[r]) {
450
- if (!re[r] && ht(r) && (g.tagNameCheck instanceof RegExp && y(g.tagNameCheck, r) || g.tagNameCheck instanceof Function && g.tagNameCheck(r)))
451
- return !1;
452
- if (Fe && !P[r]) {
453
- const c = de(e), m = pe(e);
454
- if (m && c) {
455
- const L = m.length;
456
- for (let F = L - 1; F >= 0; --F) {
457
- const x = Ut(m[F], !0);
458
- c.insertBefore(x, zt(e));
459
- }
460
- }
461
- }
462
- return M(e), !0;
463
- }
464
- return (w ? w(e) : e.nodeType) === v.element && !en(e) || (r === "noscript" || r === "noembed" || r === "noframes") && y(/<\/no(script|embed|frames)/i, e.innerHTML) ? (M(e), !0) : (G && e.nodeType === v.text && (t = e.textContent, Z([_e, he, Ae], (c) => {
465
- t = Q(t, c, " ");
466
- }), e.textContent !== t && (J(o.removed, {
467
- element: e.cloneNode()
468
- }), e.textContent = t)), H(E.afterSanitizeElements, e, null), !1);
469
- }, _t = function(e, t, r) {
470
- if (Ee[t] || rt && (t === "id" || t === "name") && (r in a || r in Qt))
471
- return !1;
472
- const u = h[t] || z.attributeCheck instanceof Function && z.attributeCheck(t, e);
473
- if (!(xe && !Ee[t] && y(Yt, t))) {
474
- if (!(tt && y($t, t))) {
475
- if (!u || Ee[t]) {
476
- if (
477
- // First condition does a very basic check if a) it's basically a valid custom element tagname AND
478
- // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
479
- // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
480
- !(ht(e) && (g.tagNameCheck instanceof RegExp && y(g.tagNameCheck, e) || g.tagNameCheck instanceof Function && g.tagNameCheck(e)) && (g.attributeNameCheck instanceof RegExp && y(g.attributeNameCheck, t) || g.attributeNameCheck instanceof Function && g.attributeNameCheck(t, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
481
- // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
482
- t === "is" && g.allowCustomizedBuiltInElements && (g.tagNameCheck instanceof RegExp && y(g.tagNameCheck, r) || g.tagNameCheck instanceof Function && g.tagNameCheck(r)))
483
- ) return !1;
484
- } else if (!Ue[t]) {
485
- if (!y(et, Q(r, Qe, ""))) {
486
- if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Nt(r, "data:") === 0 && st[e])) {
487
- if (!(nt && !y(Xt, Q(r, Qe, "")))) {
488
- if (r)
489
- return !1;
490
- }
491
- }
492
- }
493
- }
494
- }
495
- }
496
- return !0;
497
- }, tn = l({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), ht = function(e) {
498
- return !tn[ue(e)] && y(Vt, e);
499
- }, At = function(e) {
500
- H(E.beforeSanitizeAttributes, e, null);
501
- const t = e.attributes;
502
- if (!t || Oe(e))
503
- return;
504
- const r = {
505
- attrName: "",
506
- attrValue: "",
507
- keepAttr: !0,
508
- allowedAttributes: h,
509
- forceKeepAttr: void 0
510
- };
511
- let u = t.length;
512
- for (; u--; ) {
513
- const c = t[u], m = c.name, L = c.namespaceURI, F = c.value, x = _(m), je = F;
514
- let S = m === "value" ? je : pn(je);
515
- if (r.attrName = x, r.attrValue = S, r.keepAttr = !0, r.forceKeepAttr = void 0, H(E.uponSanitizeAttribute, e, r), S = r.attrValue, it && (x === "id" || x === "name") && Nt(S, at) !== 0 && (j(m, e), S = at + S), ie && y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, S)) {
516
- j(m, e);
517
- continue;
518
- }
519
- if (x === "attributename" && Ot(S, "href")) {
520
- j(m, e);
521
- continue;
522
- }
523
- if (r.forceKeepAttr)
524
- continue;
525
- if (!r.keepAttr) {
526
- j(m, e);
527
- continue;
528
- }
529
- if (!ot && y(/\/>/i, S)) {
530
- j(m, e);
531
- continue;
532
- }
533
- G && Z([_e, he, Ae], (St) => {
534
- S = Q(S, St, " ");
535
- });
536
- const Et = _(e.nodeName);
537
- if (!_t(Et, x, S)) {
538
- j(m, e);
539
- continue;
540
- }
541
- if (O && typeof me == "object" && typeof me.getAttributeType == "function" && !L)
542
- switch (me.getAttributeType(Et, x)) {
543
- case "TrustedHTML": {
544
- S = O.createHTML(S);
545
- break;
546
- }
547
- case "TrustedScriptURL": {
548
- S = O.createScriptURL(S);
549
- break;
550
- }
551
- }
552
- if (S !== je)
553
- try {
554
- L ? e.setAttributeNS(L, m, S) : e.setAttribute(m, S), Oe(e) ? M(e) : Rt(o.removed);
555
- } catch {
556
- j(m, e);
557
- }
558
- }
559
- H(E.afterSanitizeAttributes, e, null);
560
- }, De = function(e) {
561
- let t = null;
562
- const r = dt(e);
563
- for (H(E.beforeSanitizeShadowDOM, e, null); t = r.nextNode(); )
564
- if (H(E.uponSanitizeShadowNode, t, null), gt(t), At(t), le(t.content) && De(t.content), (w ? w(t) : t.nodeType) === v.element) {
565
- const c = Te ? Te(t) : t.shadowRoot;
566
- le(c) && (K(c), De(c));
567
- }
568
- H(E.afterSanitizeShadowDOM, e, null);
569
- }, K = function(e) {
570
- const t = w ? w(e) : e.nodeType;
571
- if (t === v.element) {
572
- const c = Te ? Te(e) : e.shadowRoot;
573
- le(c) && (K(c), De(c));
574
- }
575
- const r = pe ? pe(e) : e.childNodes;
576
- if (!r)
577
- return;
578
- const u = [];
579
- Z(r, (c) => {
580
- J(u, c);
581
- });
582
- for (const c of u)
583
- K(c);
584
- if (t === v.element) {
585
- const c = Y ? Y(e) : null;
586
- if (typeof c == "string" && _(c) === "template") {
587
- const m = e.content;
588
- le(m) && K(m);
589
- }
590
- }
591
- };
592
- return o.sanitize = function(i) {
593
- let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, r = null, u = null, c = null;
594
- if (He = !i, He && (i = "<!-->"), typeof i != "string" && !Ne(i) && (i = hn(i), typeof i != "string"))
595
- throw fe("dirty is not a string, aborting");
596
- if (!o.isSupported)
597
- return i;
598
- if (Pe || Be(e), o.removed = [], typeof i == "string" && (ae = !1), ae) {
599
- const F = Y ? Y(i) : i.nodeName;
600
- if (typeof F == "string") {
601
- const x = _(F);
602
- if (!T[x] || re[x])
603
- throw fe("root node is forbidden and cannot be sanitized in-place");
604
- }
605
- if (Oe(i))
606
- throw fe("root node is clobbered and cannot be sanitized in-place");
607
- K(i);
608
- } else if (Ne(i))
609
- t = pt("<!---->"), r = t.ownerDocument.importNode(i, !0), r.nodeType === v.element && r.nodeName === "BODY" || r.nodeName === "HTML" ? t = r : t.appendChild(r), K(r);
610
- else {
611
- if (!$ && !G && !B && // eslint-disable-next-line unicorn/prefer-includes
612
- i.indexOf("<") === -1)
613
- return O && ye ? O.createHTML(i) : i;
614
- if (t = pt(i), !t)
615
- return $ ? null : ye ? oe : "";
616
- }
617
- t && ke && M(t.firstChild);
618
- const m = dt(ae ? i : t);
619
- for (; u = m.nextNode(); )
620
- gt(u), At(u), le(u.content) && De(u.content);
621
- if (ae)
622
- return G && Tt(i), i;
623
- if ($) {
624
- if (G && Tt(t), Se)
625
- for (c = Wt.call(t.ownerDocument); t.firstChild; )
626
- c.appendChild(t.firstChild);
627
- else
628
- c = t;
629
- return (h.shadowroot || h.shadowrootmode) && (c = jt.call(s, c, !0)), c;
630
- }
631
- let L = B ? t.outerHTML : t.innerHTML;
632
- return B && T["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && y(Ln, t.ownerDocument.doctype.name) && (L = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
633
- ` + L), G && Z([_e, he, Ae], (F) => {
634
- L = Q(L, F, " ");
635
- }), O && ye ? O.createHTML(L) : L;
636
- }, o.setConfig = function() {
637
- let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
638
- Be(i), Pe = !0;
639
- }, o.clearConfig = function() {
640
- q = null, Pe = !1;
641
- }, o.isValidAttribute = function(i, e, t) {
642
- q || Be({});
643
- const r = _(i), u = _(e);
644
- return _t(r, u, t);
645
- }, o.addHook = function(i, e) {
646
- typeof e == "function" && J(E[i], e);
647
- }, o.removeHook = function(i, e) {
648
- if (e !== void 0) {
649
- const t = un(E[i], e);
650
- return t === -1 ? void 0 : mn(E[i], t, 1)[0];
651
- }
652
- return Rt(E[i]);
653
- }, o.removeHooks = function(i) {
654
- E[i] = [];
655
- }, o.removeAllHooks = function() {
656
- E = Pt();
657
- }, o;
658
- }
659
- var xn = vt();
660
- export {
661
- xn as default
662
- };