/*! @license DOMPurify 3.4.9 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.9/LICENSE */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n2?n-2:0),r=2;r1?t-1:0),o=1;o1?n-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:b;if(o&&o(e,null),!T(t))return e;let i=t.length;for(;i--;){let o=t[i];if("string"==typeof o){const e=n(o);e!==o&&(r(t)||(t[i]=e),o=e)}e[o]=!0}return e}function P(e){for(let t=0;t/g),J=c(/\${[\w\W]*/g),Q=c(/^data-[\-\w.\u00B7-\uFFFF]+$/),ee=c(/^aria-[\-\w]+$/),te=c(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ne=c(/^(?:\w+script|data):/i),oe=c(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),re=c(/^html$/i),ie=c(/^[a-z][.\w]*(-[.\w]+)+$/i),ae=1,le=3,ce=7,se=8,ue=9,fe=11,pe=function(){return"undefined"==typeof window?null:window};var me=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pe();const o=t=>e(t);if(o.version="3.4.9",o.removed=[],!t||!t.document||t.document.nodeType!==ue||!t.Element)return o.isSupported=!1,o;let r=t.document;const i=r,a=i.currentScript;t.DocumentFragment;const c=t.HTMLTemplateElement,u=t.Node,f=t.Element,p=t.NodeFilter,k=t.NamedNodeMap;void 0===k&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const L=t.DOMParser,P=t.trustedTypes,me=f.prototype,de=U(me,"cloneNode"),he=U(me,"remove"),ge=U(me,"nextSibling"),ye=U(me,"childNodes"),Te=U(me,"parentNode"),be=U(me,"shadowRoot"),Ae=U(me,"attributes"),Se=u&&u.prototype?U(u.prototype,"nodeType"):null,Ee=u&&u.prototype?U(u.prototype,"nodeName"):null;if("function"==typeof c){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let _e,Ne,Oe="",we=!1,De=0;const Re=function(){if(De>0)throw x('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.')},ve=function(e){Re(),De++;try{return _e.createHTML(e)}finally{De--}},Ie=function(e){Re(),De++;try{return _e.createScriptURL(e)}finally{De--}},Ce=function(){return we||(Ne=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(P,a),we=!0),Ne},xe=r,ke=xe.implementation,Le=xe.createNodeIterator,Me=xe.createDocumentFragment,Pe=xe.getElementsByTagName,ze=i.importNode;let Ue={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof n&&"function"==typeof Te&&ke&&void 0!==ke.createHTMLDocument;const Fe=V,He=Z,Be=J,je=Q,Ge=ee,We=ne,Ye=oe,qe=ie;let Xe=te,$e=null;const Ke=M({},[...F,...H,...B,...G,...Y]);let Ve=null;const Ze=M({},[...q,...X,...$,...K]);let Je=Object.seal(s(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}})),Qe=null,et=null;const tt=Object.seal(s(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let nt=!0,ot=!0,rt=!1,it=!0,at=!1,lt=!0,ct=!1,st=!1,ut=!1,ft=!1,pt=!1,mt=!1,dt=!0,ht=!1;const gt="user-content-";let yt=!0,Tt=!1,bt={},At=null;const St=M({},["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"]);let Et=null;const _t=M({},["audio","video","img","source","image","track"]);let Nt=null;const Ot=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),wt="http://www.w3.org/1998/Math/MathML",Dt="http://www.w3.org/2000/svg",Rt="http://www.w3.org/1999/xhtml";let vt=Rt,It=!1,Ct=null;const xt=M({},[wt,Dt,Rt],A);let kt=M({},["mi","mo","mn","ms","mtext"]),Lt=M({},["annotation-xml"]);const Mt=M({},["title","style","font","a","script"]);let Pt=null;const zt=["application/xhtml+xml","text/html"];let Ut=null,Ft=null;const Ht=r.createElement("form"),Bt=function(e){return e instanceof RegExp||e instanceof Function},jt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Ft&&Ft===e)return;e&&"object"==typeof e||(e={}),e=z(e),Pt=-1===zt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ut="application/xhtml+xml"===Pt?A:b,$e=v(e,"ALLOWED_TAGS")&&T(e.ALLOWED_TAGS)?M({},e.ALLOWED_TAGS,Ut):Ke,Ve=v(e,"ALLOWED_ATTR")&&T(e.ALLOWED_ATTR)?M({},e.ALLOWED_ATTR,Ut):Ze,Ct=v(e,"ALLOWED_NAMESPACES")&&T(e.ALLOWED_NAMESPACES)?M({},e.ALLOWED_NAMESPACES,A):xt,Nt=v(e,"ADD_URI_SAFE_ATTR")&&T(e.ADD_URI_SAFE_ATTR)?M(z(Ot),e.ADD_URI_SAFE_ATTR,Ut):Ot,Et=v(e,"ADD_DATA_URI_TAGS")&&T(e.ADD_DATA_URI_TAGS)?M(z(_t),e.ADD_DATA_URI_TAGS,Ut):_t,At=v(e,"FORBID_CONTENTS")&&T(e.FORBID_CONTENTS)?M({},e.FORBID_CONTENTS,Ut):St,Qe=v(e,"FORBID_TAGS")&&T(e.FORBID_TAGS)?M({},e.FORBID_TAGS,Ut):z({}),et=v(e,"FORBID_ATTR")&&T(e.FORBID_ATTR)?M({},e.FORBID_ATTR,Ut):z({}),bt=!!v(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?z(e.USE_PROFILES):e.USE_PROFILES),nt=!1!==e.ALLOW_ARIA_ATTR,ot=!1!==e.ALLOW_DATA_ATTR,rt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,it=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,at=e.SAFE_FOR_TEMPLATES||!1,lt=!1!==e.SAFE_FOR_XML,ct=e.WHOLE_DOCUMENT||!1,ft=e.RETURN_DOM||!1,pt=e.RETURN_DOM_FRAGMENT||!1,mt=e.RETURN_TRUSTED_TYPE||!1,ut=e.FORCE_BODY||!1,dt=!1!==e.SANITIZE_DOM,ht=e.SANITIZE_NAMED_PROPS||!1,yt=!1!==e.KEEP_CONTENT,Tt=e.IN_PLACE||!1,Xe=function(e){try{return C(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:te,vt="string"==typeof e.NAMESPACE?e.NAMESPACE:Rt,kt=v(e,"MATHML_TEXT_INTEGRATION_POINTS")&&e.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof e.MATHML_TEXT_INTEGRATION_POINTS?z(e.MATHML_TEXT_INTEGRATION_POINTS):M({},["mi","mo","mn","ms","mtext"]),Lt=v(e,"HTML_INTEGRATION_POINTS")&&e.HTML_INTEGRATION_POINTS&&"object"==typeof e.HTML_INTEGRATION_POINTS?z(e.HTML_INTEGRATION_POINTS):M({},["annotation-xml"]);const t=v(e,"CUSTOM_ELEMENT_HANDLING")&&e.CUSTOM_ELEMENT_HANDLING&&"object"==typeof e.CUSTOM_ELEMENT_HANDLING?z(e.CUSTOM_ELEMENT_HANDLING):s(null);if(Je=s(null),v(t,"tagNameCheck")&&Bt(t.tagNameCheck)&&(Je.tagNameCheck=t.tagNameCheck),v(t,"attributeNameCheck")&&Bt(t.attributeNameCheck)&&(Je.attributeNameCheck=t.attributeNameCheck),v(t,"allowCustomizedBuiltInElements")&&"boolean"==typeof t.allowCustomizedBuiltInElements&&(Je.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),at&&(ot=!1),pt&&(ft=!0),bt&&($e=M({},Y),Ve=s(null),!0===bt.html&&(M($e,F),M(Ve,q)),!0===bt.svg&&(M($e,H),M(Ve,X),M(Ve,K)),!0===bt.svgFilters&&(M($e,B),M(Ve,X),M(Ve,K)),!0===bt.mathMl&&(M($e,G),M(Ve,$),M(Ve,K))),tt.tagCheck=null,tt.attributeCheck=null,v(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?tt.tagCheck=e.ADD_TAGS:T(e.ADD_TAGS)&&($e===Ke&&($e=z($e)),M($e,e.ADD_TAGS,Ut))),v(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?tt.attributeCheck=e.ADD_ATTR:T(e.ADD_ATTR)&&(Ve===Ze&&(Ve=z(Ve)),M(Ve,e.ADD_ATTR,Ut))),v(e,"ADD_URI_SAFE_ATTR")&&T(e.ADD_URI_SAFE_ATTR)&&M(Nt,e.ADD_URI_SAFE_ATTR,Ut),v(e,"FORBID_CONTENTS")&&T(e.FORBID_CONTENTS)&&(At===St&&(At=z(At)),M(At,e.FORBID_CONTENTS,Ut)),v(e,"ADD_FORBID_CONTENTS")&&T(e.ADD_FORBID_CONTENTS)&&(At===St&&(At=z(At)),M(At,e.ADD_FORBID_CONTENTS,Ut)),yt&&($e["#text"]=!0),ct&&M($e,["html","head","body"]),$e.table&&(M($e,["tbody"]),delete Qe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const t=_e;_e=e.TRUSTED_TYPES_POLICY;try{Oe=ve("")}catch(e){throw _e=t,e}}else null===e.TRUSTED_TYPES_POLICY?(_e=void 0,Oe=""):(void 0===_e&&(_e=Ce()),_e&&"string"==typeof Oe&&(Oe=ve("")));(Ue.uponSanitizeElement.length>0||Ue.uponSanitizeAttribute.length>0)&&$e===Ke&&($e=z($e)),Ue.uponSanitizeAttribute.length>0&&Ve===Ze&&(Ve=z(Ve)),l&&l(e),Ft=e},Gt=M({},[...H,...B,...j]),Wt=M({},[...G,...W]),Yt=function(e){g(o.removed,{element:e});try{Te(e).removeChild(e)}catch(t){if(he(e),!Te(e))throw x("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},qt=function(e){const t=ye?ye(e):e.childNodes;if(t){const e=[];m(t,t=>{g(e,t)}),m(e,e=>{try{he(e)}catch(e){}})}const n=Ae?Ae(e):null;if(n)for(let t=n.length-1;t>=0;--t){const o=n[t],r=o&&o.name;if("string"==typeof r)try{e.removeAttribute(r)}catch(e){}}},Xt=function(e,t){try{g(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){g(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ft||pt)try{Yt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},$t=function(e){const t=Ae?Ae(e):e.attributes;if(t)for(let n=t.length-1;n>=0;--n){const o=t[n],r=o&&o.name;if("string"==typeof r&&!Ve[Ut(r)])try{e.removeAttribute(r)}catch(e){}}},Kt=function(e){let t=null,n=null;if(ut)e=""+e;else{const t=S(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Pt&&vt===Rt&&(e=''+e+"");const o=_e?ve(e):e;if(vt===Rt)try{t=(new L).parseFromString(o,Pt)}catch(e){}if(!t||!t.documentElement){t=ke.createDocument(vt,"template",null);try{t.documentElement.innerHTML=It?Oe:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),vt===Rt?Pe.call(t,ct?"html":"body")[0]:ct?t.documentElement:i},Vt=function(e){return Le.call(e.ownerDocument||e,e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Zt=function(e){var t,n;e.normalize();const o=Le.call(e.ownerDocument||e,e,p.SHOW_TEXT|p.SHOW_COMMENT|p.SHOW_CDATA_SECTION|p.SHOW_PROCESSING_INSTRUCTION,null);let r=o.nextNode();for(;r;){let e=r.data;m([Fe,He,Be],t=>{e=E(e,t," ")}),r.data=e,r=o.nextNode()}const i=null!==(t=null===(n=e.querySelectorAll)||void 0===n?void 0:n.call(e,"template"))&&void 0!==t?t:[];m(Array.from(i),e=>{Qt(e.content)&&Zt(e.content)})},Jt=function(e){const t=Ee?Ee(e):null;return"string"==typeof t&&("form"===Ut(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==Ae(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==Se(e)||e.childNodes!==ye(e)))},Qt=function(e){if(!Se||"object"!=typeof e||null===e)return!1;try{return Se(e)===fe}catch(e){return!1}},en=function(e){if(!Se||"object"!=typeof e||null===e)return!1;try{return"number"==typeof Se(e)}catch(e){return!1}};function tn(e,t,n){m(e,e=>{e.call(o,t,n,Ft)})}const nn=function(e){let t=null;if(tn(Ue.beforeSanitizeElements,e,null),Jt(e))return Yt(e),!0;const n=Ut(Ee?Ee(e):e.nodeName);if(tn(Ue.uponSanitizeElement,e,{tagName:n,allowedTags:$e}),lt&&e.hasChildNodes()&&!en(e.firstElementChild)&&C(/<[/\w!]/g,e.innerHTML)&&C(/<[/\w!]/g,e.textContent))return Yt(e),!0;if(lt&&e.namespaceURI===Rt&&"style"===n&&en(e.firstElementChild))return Yt(e),!0;if(e.nodeType===ce)return Yt(e),!0;if(lt&&e.nodeType===se&&C(/<[/\w]/g,e.data))return Yt(e),!0;if(Qe[n]||!(tt.tagCheck instanceof Function&&tt.tagCheck(n))&&!$e[n]){if(!Qe[n]&&an(n)){if(Je.tagNameCheck instanceof RegExp&&C(Je.tagNameCheck,n))return!1;if(Je.tagNameCheck instanceof Function&&Je.tagNameCheck(n))return!1}if(yt&&!At[n]){const t=Te(e),n=ye(e);if(n&&t){for(let o=n.length-1;o>=0;--o){const r=Tt?n[o]:de(n[o],!0);t.insertBefore(r,ge(e))}}}return Yt(e),!0}return((Se?Se(e):e.nodeType)!==ae||function(e){let t=Te(e);t&&t.tagName||(t={namespaceURI:vt,tagName:"template"});const n=b(e.tagName),o=b(t.tagName);return!!Ct[e.namespaceURI]&&(e.namespaceURI===Dt?t.namespaceURI===Rt?"svg"===n:t.namespaceURI===wt?"svg"===n&&("annotation-xml"===o||kt[o]):Boolean(Gt[n]):e.namespaceURI===wt?t.namespaceURI===Rt?"math"===n:t.namespaceURI===Dt?"math"===n&&Lt[o]:Boolean(Wt[n]):e.namespaceURI===Rt?!(t.namespaceURI===Dt&&!Lt[o])&&!(t.namespaceURI===wt&&!kt[o])&&!Wt[n]&&(Mt[n]||!Gt[n]):!("application/xhtml+xml"!==Pt||!Ct[e.namespaceURI]))}(e))&&("noscript"!==n&&"noembed"!==n&&"noframes"!==n||!C(/<\/no(script|embed|frames)/i,e.innerHTML))?(at&&e.nodeType===le&&(t=e.textContent,m([Fe,He,Be],e=>{t=E(t,e," ")}),e.textContent!==t&&(g(o.removed,{element:e.cloneNode()}),e.textContent=t)),tn(Ue.afterSanitizeElements,e,null),!1):(Yt(e),!0)},on=function(e,t,n){if(et[t])return!1;if(dt&&("id"===t||"name"===t)&&(n in r||n in Ht))return!1;const o=Ve[t]||tt.attributeCheck instanceof Function&&tt.attributeCheck(t,e);if(ot&&!et[t]&&C(je,t));else if(nt&&C(Ge,t));else if(!o||et[t]){if(!(an(e)&&(Je.tagNameCheck instanceof RegExp&&C(Je.tagNameCheck,e)||Je.tagNameCheck instanceof Function&&Je.tagNameCheck(e))&&(Je.attributeNameCheck instanceof RegExp&&C(Je.attributeNameCheck,t)||Je.attributeNameCheck instanceof Function&&Je.attributeNameCheck(t,e))||"is"===t&&Je.allowCustomizedBuiltInElements&&(Je.tagNameCheck instanceof RegExp&&C(Je.tagNameCheck,n)||Je.tagNameCheck instanceof Function&&Je.tagNameCheck(n))))return!1}else if(Nt[t]);else if(C(Xe,E(n,Ye,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==_(n,"data:")||!Et[e]){if(rt&&!C(We,E(n,Ye,"")));else if(n)return!1}else;return!0},rn=M({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),an=function(e){return!rn[b(e)]&&C(qe,e)},ln=function(e){tn(Ue.beforeSanitizeAttributes,e,null);const t=e.attributes;if(!t||Jt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ve,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],a=i.name,l=i.namespaceURI,c=i.value,s=Ut(a),u=c;let f="value"===a?u:N(u);if(n.attrName=s,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,tn(Ue.uponSanitizeAttribute,e,n),f=n.attrValue,!ht||"id"!==s&&"name"!==s||0===_(f,gt)||(Xt(a,e),f=gt+f),lt&&C(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){Xt(a,e);continue}if("attributename"===s&&S(f,"href")){Xt(a,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){Xt(a,e);continue}if(!it&&C(/\/>/i,f)){Xt(a,e);continue}at&&m([Fe,He,Be],e=>{f=E(f,e," ")});const p=Ut(e.nodeName);if(on(p,s,f)){if(_e&&"object"==typeof P&&"function"==typeof P.getAttributeType)if(l);else switch(P.getAttributeType(p,s)){case"TrustedHTML":f=ve(f);break;case"TrustedScriptURL":f=Ie(f)}if(f!==u)try{l?e.setAttributeNS(l,a,f):e.setAttribute(a,f),Jt(e)?Yt(e):h(o.removed)}catch(t){Xt(a,e)}}else Xt(a,e)}tn(Ue.afterSanitizeAttributes,e,null)},cn=function(e){let t=null;const n=Vt(e);for(tn(Ue.beforeSanitizeShadowDOM,e,null);t=n.nextNode();){tn(Ue.uponSanitizeShadowNode,t,null),nn(t),ln(t),Qt(t.content)&&cn(t.content);if((Se?Se(t):t.nodeType)===ae){const e=be?be(t):t.shadowRoot;Qt(e)&&(sn(e),cn(e))}}tn(Ue.afterSanitizeShadowDOM,e,null)},sn=function(e){const t=[{node:e,shadow:null}];for(;t.length>0;){const e=t.pop();if(e.shadow){cn(e.shadow);continue}const n=e.node,o=(Se?Se(n):n.nodeType)===ae,r=ye?ye(n):n.childNodes;if(r)for(let e=r.length-1;e>=0;--e)t.push({node:r[e],shadow:null});if(o){const e=Ee?Ee(n):null;if("string"==typeof e&&"template"===Ut(e)){const e=n.content;Qt(e)&&t.push({node:e,shadow:null})}}if(o){const e=be?be(n):n.shadowRoot;Qt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,a=null,l=null;if(It=!e,It&&(e="\x3c!--\x3e"),"string"!=typeof e&&!en(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return O(e);case"boolean":return w(e);case"bigint":return D?D(e):"0";case"symbol":return R?R(e):"Symbol()";case"undefined":default:return I(e);case"function":case"object":{if(null===e)return I(e);const t=e,n=U(t,"toString");if("function"==typeof n){const e=n(t);return"string"==typeof e?e:I(e)}return I(e)}}}(e)))throw x("dirty is not a string, aborting");if(!o.isSupported)return e;st||jt(t),o.removed=[];const c=Tt&&"string"!=typeof e&&en(e);if(c){const t=Ee?Ee(e):e.nodeName;if("string"==typeof t){const e=Ut(t);if(!$e[e]||Qe[e])throw x("root node is forbidden and cannot be sanitized in-place")}if(Jt(e))throw x("root node is clobbered and cannot be sanitized in-place");try{sn(e)}catch(t){throw qt(e),t}}else if(en(e))n=Kt("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===ae&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r),sn(r);else{if(!ft&&!at&&!ct&&-1===e.indexOf("<"))return _e&&mt?ve(e):e;if(n=Kt(e),!n)return ft?null:mt?Oe:""}n&&ut&&Yt(n.firstChild);const s=Vt(c?e:n);try{for(;a=s.nextNode();)nn(a),ln(a),Qt(a.content)&&cn(a.content)}catch(t){throw c&&qt(e),t}if(c)return m(o.removed,e=>{e.element&&function(e){const t=[e];for(;t.length>0;){const e=t.pop();(Se?Se(e):e.nodeType)===ae&&$t(e);const n=ye?ye(e):e.childNodes;if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}}(e.element)}),at&&Zt(e),e;if(ft){if(at&&Zt(n),pt)for(l=Me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(Ve.shadowroot||Ve.shadowrootmode)&&(l=ze.call(i,l,!0)),l}let u=ct?n.outerHTML:n.innerHTML;return ct&&$e["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&C(re,n.ownerDocument.doctype.name)&&(u="\n"+u),at&&m([Fe,He,Be],e=>{u=E(u,e," ")}),_e&&mt?ve(u):u},o.setConfig=function(){jt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),st=!0},o.clearConfig=function(){Ft=null,st=!1,_e=Ne,Oe=""},o.isValidAttribute=function(e,t,n){Ft||jt({});const o=Ut(e),r=Ut(t);return on(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&g(Ue[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=d(Ue[e],t);return-1===n?void 0:y(Ue[e],n,1)[0]}return h(Ue[e])},o.removeHooks=function(e){Ue[e]=[]},o.removeAllHooks=function(){Ue={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return me}); //# sourceMappingURL=purify.min.js.map