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