goobs-frontend
Version:
A comprehensive React-based libary for building modern web applications
1,176 lines (1,175 loc) • 29.9 kB
JavaScript
'use client';
var { entries: gt, setPrototypeOf: st, isFrozen: Bt, getPrototypeOf: Yt, getOwnPropertyDescriptor: Xt } = Object, { freeze: A, seal: L, create: ue } = Object, { apply: ke, construct: Pe } = typeof Reflect < "u" && Reflect;
A || (A = function(a) {
return a;
});
L || (L = function(a) {
return a;
});
ke || (ke = function(a, s) {
for (var o = arguments.length, u = new Array(o > 2 ? o - 2 : 0), R = 2; R < o; R++) u[R - 2] = arguments[R];
return a.apply(s, u);
});
Pe || (Pe = function(a) {
for (var s = arguments.length, o = new Array(s > 1 ? s - 1 : 0), u = 1; u < s; u++) o[u - 1] = arguments[u];
return new a(...o);
});
var ce = S(Array.prototype.forEach), jt = S(Array.prototype.lastIndexOf), ct = S(Array.prototype.pop), $ = S(Array.prototype.push), Vt = S(Array.prototype.splice), me = S(String.prototype.toLowerCase), Ne = S(String.prototype.toString), Ce = S(String.prototype.match), q = S(String.prototype.replace), $t = S(String.prototype.indexOf), qt = S(String.prototype.trim), O = S(Object.prototype.hasOwnProperty), E = S(RegExp.prototype.test), K = Kt(TypeError);
function S(l) {
return function(a) {
a instanceof RegExp && (a.lastIndex = 0);
for (var s = arguments.length, o = new Array(s > 1 ? s - 1 : 0), u = 1; u < s; u++) o[u - 1] = arguments[u];
return ke(l, a, o);
};
}
function Kt(l) {
return function() {
for (var a = arguments.length, s = new Array(a), o = 0; o < a; o++) s[o] = arguments[o];
return Pe(l, s);
};
}
function r(l, a) {
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : me;
st && st(l, null);
let o = a.length;
for (; o--; ) {
let u = a[o];
if (typeof u == "string") {
const R = s(u);
R !== u && (Bt(a) || (a[o] = R), u = R);
}
l[u] = !0;
}
return l;
}
function Zt(l) {
for (let a = 0; a < l.length; a++) O(l, a) || (l[a] = null);
return l;
}
function C(l) {
const a = ue(null);
for (const [s, o] of gt(l)) O(l, s) && (Array.isArray(o) ? a[s] = Zt(o) : o && typeof o == "object" && o.constructor === Object ? a[s] = C(o) : a[s] = o);
return a;
}
function Z(l, a) {
for (; l !== null; ) {
const o = Xt(l, a);
if (o) {
if (o.get) return S(o.get);
if (typeof o.value == "function") return S(o.value);
}
l = Yt(l);
}
function s() {
return null;
}
return s;
}
var ft = A([
"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"
]), Ie = A([
"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"
]), Me = A([
"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"
]), Jt = A([
"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"
]), we = A([
"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"
]), Qt = A([
"maction",
"maligngroup",
"malignmark",
"mlongdiv",
"mscarries",
"mscarry",
"msgroup",
"mstack",
"msline",
"msrow",
"semantics",
"annotation",
"annotation-xml",
"mprescripts",
"none"
]), ut = A(["#text"]), mt = A([
"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"
]), xe = A([
"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"
]), pt = A([
"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"
]), fe = A([
"xlink:href",
"xml:id",
"xlink:title",
"xml:space",
"xmlns:xlink"
]), en = L(/\{\{[\w\W]*|[\w\W]*\}\}/gm), tn = L(/<%[\w\W]*|[\w\W]*%>/gm), nn = L(/\$\{[\w\W]*/gm), an = L(/^data-[\-\w.\u00B7-\uFFFF]+$/), on = L(/^aria-[\-\w]+$/), _t = L(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), rn = L(/^(?:\w+script|data):/i), ln = L(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), ht = L(/^html$/i), sn = L(/^[a-z][.\w]*(-[.\w]+)+$/i), dt = /* @__PURE__ */ Object.freeze({
__proto__: null,
ARIA_ATTR: on,
ATTR_WHITESPACE: ln,
CUSTOM_ELEMENT: sn,
DATA_ATTR: an,
DOCTYPE_NAME: ht,
ERB_EXPR: tn,
IS_ALLOWED_URI: _t,
IS_SCRIPT_OR_DATA: rn,
MUSTACHE_EXPR: en,
TMPLIT_EXPR: nn
}), J = {
element: 1,
attribute: 2,
text: 3,
cdataSection: 4,
entityReference: 5,
entityNode: 6,
progressingInstruction: 7,
comment: 8,
document: 9,
documentType: 10,
documentFragment: 11,
notation: 12
}, cn = function() {
return typeof window > "u" ? null : window;
}, fn = function(a, s) {
if (typeof a != "object" || typeof a.createPolicy != "function") return null;
let o = null;
const u = "data-tt-policy-suffix";
s && s.hasAttribute(u) && (o = s.getAttribute(u));
const R = "dompurify" + (o ? "#" + o : "");
try {
return a.createPolicy(R, {
createHTML(P) {
return P;
},
createScriptURL(P) {
return P;
}
});
} catch {
return console.warn("TrustedTypes policy " + R + " could not be created."), null;
}
}, Tt = function() {
return {
afterSanitizeAttributes: [],
afterSanitizeElements: [],
afterSanitizeShadowDOM: [],
beforeSanitizeAttributes: [],
beforeSanitizeElements: [],
beforeSanitizeShadowDOM: [],
uponSanitizeAttribute: [],
uponSanitizeElement: [],
uponSanitizeShadowNode: []
};
};
function Et() {
let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : cn();
const a = (i) => Et(i);
if (a.version = "3.3.3", a.removed = [], !l || !l.document || l.document.nodeType !== J.document || !l.Element)
return a.isSupported = !1, a;
let { document: s } = l;
const o = s, u = o.currentScript, { DocumentFragment: R, HTMLTemplateElement: P, Node: pe, Element: Ue, NodeFilter: W, NamedNodeMap: At = l.NamedNodeMap || l.MozNamedAttrMap, HTMLFormElement: St, DOMParser: Rt, trustedTypes: Q } = l, B = Ue.prototype, Dt = Z(B, "cloneNode"), Ot = Z(B, "remove"), bt = Z(B, "nextSibling"), yt = Z(B, "childNodes"), ee = Z(B, "parentNode");
if (typeof P == "function") {
const i = s.createElement("template");
i.content && i.content.ownerDocument && (s = i.content.ownerDocument);
}
let _, Y = "";
const { implementation: de, createNodeIterator: Lt, createDocumentFragment: vt, getElementsByTagName: Nt } = s, { importNode: Ct } = o;
let h = Tt();
a.isSupported = typeof gt == "function" && typeof ee == "function" && de && de.createHTMLDocument !== void 0;
const { MUSTACHE_EXPR: Te, ERB_EXPR: ge, TMPLIT_EXPR: _e, DATA_ATTR: It, ARIA_ATTR: Mt, IS_SCRIPT_OR_DATA: wt, ATTR_WHITESPACE: Fe, CUSTOM_ELEMENT: xt } = dt;
let { IS_ALLOWED_URI: He } = dt, d = null;
const ze = r({}, [
...ft,
...Ie,
...Me,
...we,
...ut
]);
let T = null;
const Ge = r({}, [
...mt,
...xe,
...pt,
...fe
]);
let m = Object.seal(ue(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
}
})), X = null, te = null;
const w = Object.seal(ue(null, {
tagCheck: {
writable: !0,
configurable: !1,
enumerable: !0,
value: null
},
attributeCheck: {
writable: !0,
configurable: !1,
enumerable: !0,
value: null
}
}));
let We = !0, he = !0, Be = !1, Ye = !0, U = !1, ne = !0, x = !1, Ee = !1, Ae = !1, F = !1, ae = !1, ie = !1, Xe = !0, je = !1;
const kt = "user-content-";
let Se = !0, j = !1, H = {}, v = null;
const Re = r({}, [
"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 Ve = null;
const $e = r({}, [
"audio",
"video",
"img",
"source",
"image",
"track"
]);
let De = null;
const qe = r({}, [
"alt",
"class",
"for",
"id",
"label",
"name",
"pattern",
"placeholder",
"role",
"summary",
"title",
"value",
"style",
"xmlns"
]), oe = "http://www.w3.org/1998/Math/MathML", re = "http://www.w3.org/2000/svg", I = "http://www.w3.org/1999/xhtml";
let z = I, Oe = !1, be = null;
const Pt = r({}, [
oe,
re,
I
], Ne);
let le = r({}, [
"mi",
"mo",
"mn",
"ms",
"mtext"
]), se = r({}, ["annotation-xml"]);
const Ut = r({}, [
"title",
"style",
"font",
"a",
"script"
]);
let V = null;
const Ft = ["application/xhtml+xml", "text/html"], Ht = "text/html";
let p = null, G = null;
const zt = s.createElement("form"), Ke = function(e) {
return e instanceof RegExp || e instanceof Function;
}, ye = function() {
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
if (!(G && G === e)) {
if ((!e || typeof e != "object") && (e = {}), e = C(e), V = Ft.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? Ht : e.PARSER_MEDIA_TYPE, p = V === "application/xhtml+xml" ? Ne : me, d = O(e, "ALLOWED_TAGS") ? r({}, e.ALLOWED_TAGS, p) : ze, T = O(e, "ALLOWED_ATTR") ? r({}, e.ALLOWED_ATTR, p) : Ge, be = O(e, "ALLOWED_NAMESPACES") ? r({}, e.ALLOWED_NAMESPACES, Ne) : Pt, De = O(e, "ADD_URI_SAFE_ATTR") ? r(C(qe), e.ADD_URI_SAFE_ATTR, p) : qe, Ve = O(e, "ADD_DATA_URI_TAGS") ? r(C($e), e.ADD_DATA_URI_TAGS, p) : $e, v = O(e, "FORBID_CONTENTS") ? r({}, e.FORBID_CONTENTS, p) : Re, X = O(e, "FORBID_TAGS") ? r({}, e.FORBID_TAGS, p) : C({}), te = O(e, "FORBID_ATTR") ? r({}, e.FORBID_ATTR, p) : C({}), H = O(e, "USE_PROFILES") ? e.USE_PROFILES : !1, We = e.ALLOW_ARIA_ATTR !== !1, he = e.ALLOW_DATA_ATTR !== !1, Be = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ye = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, U = e.SAFE_FOR_TEMPLATES || !1, ne = e.SAFE_FOR_XML !== !1, x = e.WHOLE_DOCUMENT || !1, F = e.RETURN_DOM || !1, ae = e.RETURN_DOM_FRAGMENT || !1, ie = e.RETURN_TRUSTED_TYPE || !1, Ae = e.FORCE_BODY || !1, Xe = e.SANITIZE_DOM !== !1, je = e.SANITIZE_NAMED_PROPS || !1, Se = e.KEEP_CONTENT !== !1, j = e.IN_PLACE || !1, He = e.ALLOWED_URI_REGEXP || _t, z = e.NAMESPACE || I, le = e.MATHML_TEXT_INTEGRATION_POINTS || le, se = e.HTML_INTEGRATION_POINTS || se, m = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Ke(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (m.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Ke(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (m.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (m.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), U && (he = !1), ae && (F = !0), H && (d = r({}, ut), T = ue(null), H.html === !0 && (r(d, ft), r(T, mt)), H.svg === !0 && (r(d, Ie), r(T, xe), r(T, fe)), H.svgFilters === !0 && (r(d, Me), r(T, xe), r(T, fe)), H.mathMl === !0 && (r(d, we), r(T, pt), r(T, fe))), O(e, "ADD_TAGS") || (w.tagCheck = null), O(e, "ADD_ATTR") || (w.attributeCheck = null), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? w.tagCheck = e.ADD_TAGS : (d === ze && (d = C(d)), r(d, e.ADD_TAGS, p))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? w.attributeCheck = e.ADD_ATTR : (T === Ge && (T = C(T)), r(T, e.ADD_ATTR, p))), e.ADD_URI_SAFE_ATTR && r(De, e.ADD_URI_SAFE_ATTR, p), e.FORBID_CONTENTS && (v === Re && (v = C(v)), r(v, e.FORBID_CONTENTS, p)), e.ADD_FORBID_CONTENTS && (v === Re && (v = C(v)), r(v, e.ADD_FORBID_CONTENTS, p)), Se && (d["#text"] = !0), x && r(d, [
"html",
"head",
"body"
]), d.table && (r(d, ["tbody"]), delete X.tbody), e.TRUSTED_TYPES_POLICY) {
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
_ = e.TRUSTED_TYPES_POLICY, Y = _.createHTML("");
} else
_ === void 0 && (_ = fn(Q, u)), _ !== null && typeof Y == "string" && (Y = _.createHTML(""));
A && A(e), G = e;
}
}, Ze = r({}, [
...Ie,
...Me,
...Jt
]), Je = r({}, [...we, ...Qt]), Gt = function(e) {
let t = ee(e);
(!t || !t.tagName) && (t = {
namespaceURI: z,
tagName: "template"
});
const n = me(e.tagName), f = me(t.tagName);
return be[e.namespaceURI] ? e.namespaceURI === re ? t.namespaceURI === I ? n === "svg" : t.namespaceURI === oe ? n === "svg" && (f === "annotation-xml" || le[f]) : !!Ze[n] : e.namespaceURI === oe ? t.namespaceURI === I ? n === "math" : t.namespaceURI === re ? n === "math" && se[f] : !!Je[n] : e.namespaceURI === I ? t.namespaceURI === re && !se[f] || t.namespaceURI === oe && !le[f] ? !1 : !Je[n] && (Ut[n] || !Ze[n]) : !!(V === "application/xhtml+xml" && be[e.namespaceURI]) : !1;
}, N = function(e) {
$(a.removed, { element: e });
try {
ee(e).removeChild(e);
} catch {
Ot(e);
}
}, k = function(e, t) {
try {
$(a.removed, {
attribute: t.getAttributeNode(e),
from: t
});
} catch {
$(a.removed, {
attribute: null,
from: t
});
}
if (t.removeAttribute(e), e === "is") if (F || ae) try {
N(t);
} catch {
}
else try {
t.setAttribute(e, "");
} catch {
}
}, Qe = function(e) {
let t = null, n = null;
if (Ae) e = "<remove></remove>" + e;
else {
const b = Ce(e, /^[\r\n\t ]+/);
n = b && b[0];
}
V === "application/xhtml+xml" && z === I && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
const f = _ ? _.createHTML(e) : e;
if (z === I) try {
t = new Rt().parseFromString(f, V);
} catch {
}
if (!t || !t.documentElement) {
t = de.createDocument(z, "template", null);
try {
t.documentElement.innerHTML = Oe ? Y : f;
} catch {
}
}
const c = t.body || t.documentElement;
return e && n && c.insertBefore(s.createTextNode(n), c.childNodes[0] || null), z === I ? Nt.call(t, x ? "html" : "body")[0] : x ? t.documentElement : c;
}, et = function(e) {
return Lt.call(e.ownerDocument || e, e, W.SHOW_ELEMENT | W.SHOW_COMMENT | W.SHOW_TEXT | W.SHOW_PROCESSING_INSTRUCTION | W.SHOW_CDATA_SECTION, null);
}, Le = function(e) {
return e instanceof St && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof At) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
}, tt = function(e) {
return typeof pe == "function" && e instanceof pe;
};
function M(i, e, t) {
ce(i, (n) => {
n.call(a, e, t, G);
});
}
const nt = function(e) {
let t = null;
if (M(h.beforeSanitizeElements, e, null), Le(e))
return N(e), !0;
const n = p(e.nodeName);
if (M(h.uponSanitizeElement, e, {
tagName: n,
allowedTags: d
}), ne && e.hasChildNodes() && !tt(e.firstElementChild) && E(/<[/\w!]/g, e.innerHTML) && E(/<[/\w!]/g, e.textContent) || e.nodeType === J.progressingInstruction || ne && e.nodeType === J.comment && E(/<[/\w]/g, e.data))
return N(e), !0;
if (!(w.tagCheck instanceof Function && w.tagCheck(n)) && (!d[n] || X[n])) {
if (!X[n] && it(n) && (m.tagNameCheck instanceof RegExp && E(m.tagNameCheck, n) || m.tagNameCheck instanceof Function && m.tagNameCheck(n)))
return !1;
if (Se && !v[n]) {
const f = ee(e) || e.parentNode, c = yt(e) || e.childNodes;
if (c && f) {
const b = c.length;
for (let y = b - 1; y >= 0; --y) {
const D = Dt(c[y], !0);
D.__removalCount = (e.__removalCount || 0) + 1, f.insertBefore(D, bt(e));
}
}
}
return N(e), !0;
}
return e instanceof Ue && !Gt(e) || (n === "noscript" || n === "noembed" || n === "noframes") && E(/<\/no(script|embed|frames)/i, e.innerHTML) ? (N(e), !0) : (U && e.nodeType === J.text && (t = e.textContent, ce([
Te,
ge,
_e
], (f) => {
t = q(t, f, " ");
}), e.textContent !== t && ($(a.removed, { element: e.cloneNode() }), e.textContent = t)), M(h.afterSanitizeElements, e, null), !1);
}, at = function(e, t, n) {
if (te[t] || Xe && (t === "id" || t === "name") && (n in s || n in zt)) return !1;
if (!(he && !te[t] && E(It, t))) {
if (!(We && E(Mt, t))) {
if (!(w.attributeCheck instanceof Function && w.attributeCheck(t, e))) {
if (!T[t] || te[t]) {
if (!(it(e) && (m.tagNameCheck instanceof RegExp && E(m.tagNameCheck, e) || m.tagNameCheck instanceof Function && m.tagNameCheck(e)) && (m.attributeNameCheck instanceof RegExp && E(m.attributeNameCheck, t) || m.attributeNameCheck instanceof Function && m.attributeNameCheck(t, e)) || t === "is" && m.allowCustomizedBuiltInElements && (m.tagNameCheck instanceof RegExp && E(m.tagNameCheck, n) || m.tagNameCheck instanceof Function && m.tagNameCheck(n)))) return !1;
} else if (!De[t]) {
if (!E(He, q(n, Fe, ""))) {
if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && $t(n, "data:") === 0 && Ve[e])) {
if (!(Be && !E(wt, q(n, Fe, "")))) {
if (n) return !1;
}
}
}
}
}
}
}
return !0;
}, it = function(e) {
return e !== "annotation-xml" && Ce(e, xt);
}, ot = function(e) {
M(h.beforeSanitizeAttributes, e, null);
const { attributes: t } = e;
if (!t || Le(e)) return;
const n = {
attrName: "",
attrValue: "",
keepAttr: !0,
allowedAttributes: T,
forceKeepAttr: void 0
};
let f = t.length;
for (; f--; ) {
const { name: c, namespaceURI: b, value: y } = t[f], D = p(c), ve = y;
let g = c === "value" ? ve : qt(ve);
if (n.attrName = D, n.attrValue = g, n.keepAttr = !0, n.forceKeepAttr = void 0, M(h.uponSanitizeAttribute, e, n), g = n.attrValue, je && (D === "id" || D === "name") && (k(c, e), g = kt + g), ne && E(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, g)) {
k(c, e);
continue;
}
if (D === "attributename" && Ce(g, "href")) {
k(c, e);
continue;
}
if (n.forceKeepAttr) continue;
if (!n.keepAttr) {
k(c, e);
continue;
}
if (!Ye && E(/\/>/i, g)) {
k(c, e);
continue;
}
U && ce([
Te,
ge,
_e
], (lt) => {
g = q(g, lt, " ");
});
const rt = p(e.nodeName);
if (!at(rt, D, g)) {
k(c, e);
continue;
}
if (_ && typeof Q == "object" && typeof Q.getAttributeType == "function" && !b) switch (Q.getAttributeType(rt, D)) {
case "TrustedHTML":
g = _.createHTML(g);
break;
case "TrustedScriptURL":
g = _.createScriptURL(g);
break;
}
if (g !== ve) try {
b ? e.setAttributeNS(b, c, g) : e.setAttribute(c, g), Le(e) ? N(e) : ct(a.removed);
} catch {
k(c, e);
}
}
M(h.afterSanitizeAttributes, e, null);
}, Wt = function i(e) {
let t = null;
const n = et(e);
for (M(h.beforeSanitizeShadowDOM, e, null); t = n.nextNode(); )
M(h.uponSanitizeShadowNode, t, null), nt(t), ot(t), t.content instanceof R && i(t.content);
M(h.afterSanitizeShadowDOM, e, null);
};
return a.sanitize = function(i) {
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, n = null, f = null, c = null;
if (Oe = !i, Oe && (i = "<!-->"), typeof i != "string" && !tt(i)) if (typeof i.toString == "function") {
if (i = i.toString(), typeof i != "string") throw K("dirty is not a string, aborting");
} else throw K("toString is not a function");
if (!a.isSupported) return i;
if (Ee || ye(e), a.removed = [], typeof i == "string" && (j = !1), j) {
if (i.nodeName) {
const D = p(i.nodeName);
if (!d[D] || X[D]) throw K("root node is forbidden and cannot be sanitized in-place");
}
} else if (i instanceof pe)
t = Qe("<!---->"), n = t.ownerDocument.importNode(i, !0), n.nodeType === J.element && n.nodeName === "BODY" || n.nodeName === "HTML" ? t = n : t.appendChild(n);
else {
if (!F && !U && !x && i.indexOf("<") === -1) return _ && ie ? _.createHTML(i) : i;
if (t = Qe(i), !t) return F ? null : ie ? Y : "";
}
t && Ae && N(t.firstChild);
const b = et(j ? i : t);
for (; f = b.nextNode(); )
nt(f), ot(f), f.content instanceof R && Wt(f.content);
if (j) return i;
if (F) {
if (ae)
for (c = vt.call(t.ownerDocument); t.firstChild; ) c.appendChild(t.firstChild);
else c = t;
return (T.shadowroot || T.shadowrootmode) && (c = Ct.call(o, c, !0)), c;
}
let y = x ? t.outerHTML : t.innerHTML;
return x && d["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && E(ht, t.ownerDocument.doctype.name) && (y = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
` + y), U && ce([
Te,
ge,
_e
], (D) => {
y = q(y, D, " ");
}), _ && ie ? _.createHTML(y) : y;
}, a.setConfig = function() {
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
ye(i), Ee = !0;
}, a.clearConfig = function() {
G = null, Ee = !1;
}, a.isValidAttribute = function(i, e, t) {
G || ye({});
const n = p(i), f = p(e);
return at(n, f, t);
}, a.addHook = function(i, e) {
typeof e == "function" && $(h[i], e);
}, a.removeHook = function(i, e) {
if (e !== void 0) {
const t = jt(h[i], e);
return t === -1 ? void 0 : Vt(h[i], t, 1)[0];
}
return ct(h[i]);
}, a.removeHooks = function(i) {
h[i] = [];
}, a.removeAllHooks = function() {
h = Tt();
}, a;
}
var un = Et();
export {
un as default
};
//# sourceMappingURL=purify.es-LPPvrLjn.js.map