You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
23 KiB
2 lines
23 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{7794:function(e,t,n){"use strict";
|
|
/*! @license DOMPurify 2.5.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.6/LICENSE */function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _construct(e,t,n){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function _construct(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&_setPrototypeOf(o,n.prototype),o}).apply(null,arguments)}function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}(e)||function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function _unsupportedIterableToArray(e,t){if(!e)return;if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(e,t)}(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var r=Object.hasOwnProperty,o=Object.setPrototypeOf,a=Object.isFrozen,i=Object.getPrototypeOf,l=Object.getOwnPropertyDescriptor,c=Object.freeze,u=Object.seal,s=Object.create,m="undefined"!=typeof Reflect&&Reflect,p=m.apply,d=m.construct;p||(p=function apply(e,t,n){return e.apply(t,n)}),c||(c=function freeze(e){return e}),u||(u=function seal(e){return e}),d||(d=function construct(e,t){return _construct(e,_toConsumableArray(t))});var f=unapply(Array.prototype.forEach),y=unapply(Array.prototype.pop),h=unapply(Array.prototype.push),g=unapply(String.prototype.toLowerCase),T=unapply(String.prototype.toString),b=unapply(String.prototype.match),_=unapply(String.prototype.replace),S=unapply(String.prototype.indexOf),A=unapply(String.prototype.trim),v=unapply(RegExp.prototype.test),N=function unconstruct(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(e,n)}}(TypeError);function unapply(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return p(e,t,r)}}function addToSet(e,t,n){var r;n=null!==(r=n)&&void 0!==r?r:g,o&&o(e,null);for(var i=t.length;i--;){var l=t[i];if("string"==typeof l){var c=n(l);c!==l&&(a(t)||(t[i]=c),l=c)}e[l]=!0}return e}function clone(e){var t,n=s(null);for(t in e)!0===p(r,e,[t])&&(n[t]=e[t]);return n}function lookupGetter(e,t){for(;null!==e;){var n=l(e,t);if(n){if(n.get)return unapply(n.get);if("function"==typeof n.value)return unapply(n.value)}e=i(e)}return function fallbackValue(e){return console.warn("fallback value for",e),null}}var E=c(["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","section","select","shadow","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"]),w=c(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),k=c(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),C=c(["animate","color-profile","cursor","discard","fedropshadow","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"]),O=c(["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"]),x=c(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),L=c(["#text"]),D=c(["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","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),R=c(["accent-height","accumulate","additive","alignment-baseline","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","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","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","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","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","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"]),M=c(["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"]),I=c(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),F=u(/\{\{[\w\W]*|[\w\W]*\}\}/gm),H=u(/<%[\w\W]*|[\w\W]*%>/gm),U=u(/\${[\w\W]*}/gm),z=u(/^data-[\-\w.\u00B7-\uFFFF]/),P=u(/^aria-[\-\w]+$/),G=u(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),B=u(/^(?:\w+script|data):/i),j=u(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W=u(/^html$/i),q=u(/^[a-z][.\w]*(-[.\w]+)+$/i),V=function getGlobal(){return"undefined"==typeof window?null:window},Y=function _createTrustedTypesPolicy(e,t){if("object"!==_typeof(e)||"function"!=typeof e.createPolicy)return null;var n=null;t.currentScript&&t.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=t.currentScript.getAttribute("data-tt-policy-suffix"));var r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:function createHTML(e){return e},createScriptURL:function createScriptURL(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};var $=function createDOMPurify(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:V(),t=function DOMPurify(e){return createDOMPurify(e)};if(t.version="2.5.6",t.removed=[],!e||!e.document||9!==e.document.nodeType)return t.isSupported=!1,t;var n=e.document,r=e.document,o=e.DocumentFragment,a=e.HTMLTemplateElement,i=e.Node,l=e.Element,u=e.NodeFilter,s=e.NamedNodeMap,m=void 0===s?e.NamedNodeMap||e.MozNamedAttrMap:s,p=e.HTMLFormElement,d=e.DOMParser,$=e.trustedTypes,K=l.prototype,X=lookupGetter(K,"cloneNode"),J=lookupGetter(K,"nextSibling"),Z=lookupGetter(K,"childNodes"),Q=lookupGetter(K,"parentNode");if("function"==typeof a){var ee=r.createElement("template");ee.content&&ee.content.ownerDocument&&(r=ee.content.ownerDocument)}var te=Y($,n),ne=te?te.createHTML(""):"",re=r,oe=re.implementation,ae=re.createNodeIterator,ie=re.createDocumentFragment,le=re.getElementsByTagName,ce=n.importNode,ue={};try{ue=clone(r).documentMode?r.documentMode:{}}catch(e){}var se={};t.isSupported="function"==typeof Q&&oe&&void 0!==oe.createHTMLDocument&&9!==ue;var me,pe,de=F,fe=H,ye=U,he=z,ge=P,Te=B,be=j,_e=q,Se=G,Ae=null,ve=addToSet({},[].concat(_toConsumableArray(E),_toConsumableArray(w),_toConsumableArray(k),_toConsumableArray(O),_toConsumableArray(L))),Ne=null,Ee=addToSet({},[].concat(_toConsumableArray(D),_toConsumableArray(R),_toConsumableArray(M),_toConsumableArray(I))),we=Object.seal(Object.create(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}})),ke=null,Ce=null,Oe=!0,xe=!0,Le=!1,De=!0,Re=!1,Me=!0,Ie=!1,Fe=!1,He=!1,Ue=!1,ze=!1,Pe=!1,Ge=!0,Be=!1,je="user-content-",We=!0,qe=!1,Ve={},Ye=null,$e=addToSet({},["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"]),Ke=null,Xe=addToSet({},["audio","video","img","source","image","track"]),Je=null,Ze=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Qe="http://www.w3.org/1998/Math/MathML",et="http://www.w3.org/2000/svg",tt="http://www.w3.org/1999/xhtml",nt=tt,rt=!1,ot=null,at=addToSet({},[Qe,et,tt],T),it=["application/xhtml+xml","text/html"],lt="text/html",ct=null,ut=r.createElement("form"),st=function isRegexOrFunction(e){return e instanceof RegExp||e instanceof Function},mt=function _parseConfig(e){ct&&ct===e||(e&&"object"===_typeof(e)||(e={}),e=clone(e),me=me=-1===it.indexOf(e.PARSER_MEDIA_TYPE)?lt:e.PARSER_MEDIA_TYPE,pe="application/xhtml+xml"===me?T:g,Ae="ALLOWED_TAGS"in e?addToSet({},e.ALLOWED_TAGS,pe):ve,Ne="ALLOWED_ATTR"in e?addToSet({},e.ALLOWED_ATTR,pe):Ee,ot="ALLOWED_NAMESPACES"in e?addToSet({},e.ALLOWED_NAMESPACES,T):at,Je="ADD_URI_SAFE_ATTR"in e?addToSet(clone(Ze),e.ADD_URI_SAFE_ATTR,pe):Ze,Ke="ADD_DATA_URI_TAGS"in e?addToSet(clone(Xe),e.ADD_DATA_URI_TAGS,pe):Xe,Ye="FORBID_CONTENTS"in e?addToSet({},e.FORBID_CONTENTS,pe):$e,ke="FORBID_TAGS"in e?addToSet({},e.FORBID_TAGS,pe):{},Ce="FORBID_ATTR"in e?addToSet({},e.FORBID_ATTR,pe):{},Ve="USE_PROFILES"in e&&e.USE_PROFILES,Oe=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Le=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Re=e.SAFE_FOR_TEMPLATES||!1,Me=!1!==e.SAFE_FOR_XML,Ie=e.WHOLE_DOCUMENT||!1,Ue=e.RETURN_DOM||!1,ze=e.RETURN_DOM_FRAGMENT||!1,Pe=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Be=e.SANITIZE_NAMED_PROPS||!1,We=!1!==e.KEEP_CONTENT,qe=e.IN_PLACE||!1,Se=e.ALLOWED_URI_REGEXP||Se,nt=e.NAMESPACE||tt,we=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&st(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(we.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&st(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(we.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(we.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Re&&(xe=!1),ze&&(Ue=!0),Ve&&(Ae=addToSet({},_toConsumableArray(L)),Ne=[],!0===Ve.html&&(addToSet(Ae,E),addToSet(Ne,D)),!0===Ve.svg&&(addToSet(Ae,w),addToSet(Ne,R),addToSet(Ne,I)),!0===Ve.svgFilters&&(addToSet(Ae,k),addToSet(Ne,R),addToSet(Ne,I)),!0===Ve.mathMl&&(addToSet(Ae,O),addToSet(Ne,M),addToSet(Ne,I))),e.ADD_TAGS&&(Ae===ve&&(Ae=clone(Ae)),addToSet(Ae,e.ADD_TAGS,pe)),e.ADD_ATTR&&(Ne===Ee&&(Ne=clone(Ne)),addToSet(Ne,e.ADD_ATTR,pe)),e.ADD_URI_SAFE_ATTR&&addToSet(Je,e.ADD_URI_SAFE_ATTR,pe),e.FORBID_CONTENTS&&(Ye===$e&&(Ye=clone(Ye)),addToSet(Ye,e.FORBID_CONTENTS,pe)),We&&(Ae["#text"]=!0),Ie&&addToSet(Ae,["html","head","body"]),Ae.table&&(addToSet(Ae,["tbody"]),delete ke.tbody),c&&c(e),ct=e)},pt=addToSet({},["mi","mo","mn","ms","mtext"]),dt=addToSet({},["foreignobject","annotation-xml"]),ft=addToSet({},["title","style","font","a","script"]),yt=addToSet({},w);addToSet(yt,k),addToSet(yt,C);var ht=addToSet({},O);addToSet(ht,x);var gt=function _checkValidNamespace(e){var t=Q(e);t&&t.tagName||(t={namespaceURI:nt,tagName:"template"});var n=g(e.tagName),r=g(t.tagName);return!!ot[e.namespaceURI]&&(e.namespaceURI===et?t.namespaceURI===tt?"svg"===n:t.namespaceURI===Qe?"svg"===n&&("annotation-xml"===r||pt[r]):Boolean(yt[n]):e.namespaceURI===Qe?t.namespaceURI===tt?"math"===n:t.namespaceURI===et?"math"===n&&dt[r]:Boolean(ht[n]):e.namespaceURI===tt?!(t.namespaceURI===et&&!dt[r])&&(!(t.namespaceURI===Qe&&!pt[r])&&(!ht[n]&&(ft[n]||!yt[n]))):!("application/xhtml+xml"!==me||!ot[e.namespaceURI]))},Tt=function _forceRemove(e){h(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ne}catch(t){e.remove()}}},bt=function _removeAttribute(e,n){try{h(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch(e){h(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),"is"===e&&!Ne[e])if(Ue||ze)try{Tt(n)}catch(e){}else try{n.setAttribute(e,"")}catch(e){}},_t=function _initDocument(e){var t,n;if(He)e="<remove></remove>"+e;else{var o=b(e,/^[\r\n\t ]+/);n=o&&o[0]}"application/xhtml+xml"===me&&nt===tt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var a=te?te.createHTML(e):e;if(nt===tt)try{t=(new d).parseFromString(a,me)}catch(e){}if(!t||!t.documentElement){t=oe.createDocument(nt,"template",null);try{t.documentElement.innerHTML=rt?ne:a}catch(e){}}var i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),nt===tt?le.call(t,Ie?"html":"body")[0]:Ie?t.documentElement:i},St=function _createIterator(e){return ae.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null,!1)},At=function _isClobbered(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof m)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function _isNode(e){return"object"===_typeof(i)?e instanceof i:e&&"object"===_typeof(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Nt=function _executeHook(e,n,r){se[e]&&f(se[e],(function(e){e.call(t,n,r,ct)}))},Et=function _sanitizeElements(e){var n;if(Nt("beforeSanitizeElements",e,null),At(e))return Tt(e),!0;if(v(/[\u0080-\uFFFF]/,e.nodeName))return Tt(e),!0;var r=pe(e.nodeName);if(Nt("uponSanitizeElement",e,{tagName:r,allowedTags:Ae}),e.hasChildNodes()&&!vt(e.firstElementChild)&&(!vt(e.content)||!vt(e.content.firstElementChild))&&v(/<[/\w]/g,e.innerHTML)&&v(/<[/\w]/g,e.textContent))return Tt(e),!0;if("select"===r&&v(/<template/i,e.innerHTML))return Tt(e),!0;if(7===e.nodeType)return Tt(e),!0;if(Me&&8===e.nodeType&&v(/<[/\w]/g,e.data))return Tt(e),!0;if(!Ae[r]||ke[r]){if(!ke[r]&&kt(r)){if(we.tagNameCheck instanceof RegExp&&v(we.tagNameCheck,r))return!1;if(we.tagNameCheck instanceof Function&&we.tagNameCheck(r))return!1}if(We&&!Ye[r]){var o=Q(e)||e.parentNode,a=Z(e)||e.childNodes;if(a&&o)for(var i=a.length-1;i>=0;--i){var c=X(a[i],!0);c.__removalCount=(e.__removalCount||0)+1,o.insertBefore(c,J(e))}}return Tt(e),!0}return e instanceof l&&!gt(e)?(Tt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!v(/<\/no(script|embed|frames)/i,e.innerHTML)?(Re&&3===e.nodeType&&(n=e.textContent,n=_(n,de," "),n=_(n,fe," "),n=_(n,ye," "),e.textContent!==n&&(h(t.removed,{element:e.cloneNode()}),e.textContent=n)),Nt("afterSanitizeElements",e,null),!1):(Tt(e),!0)},wt=function _isValidAttribute(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in ut))return!1;if(xe&&!Ce[t]&&v(he,t));else if(Oe&&v(ge,t));else if(!Ne[t]||Ce[t]){if(!(kt(e)&&(we.tagNameCheck instanceof RegExp&&v(we.tagNameCheck,e)||we.tagNameCheck instanceof Function&&we.tagNameCheck(e))&&(we.attributeNameCheck instanceof RegExp&&v(we.attributeNameCheck,t)||we.attributeNameCheck instanceof Function&&we.attributeNameCheck(t))||"is"===t&&we.allowCustomizedBuiltInElements&&(we.tagNameCheck instanceof RegExp&&v(we.tagNameCheck,n)||we.tagNameCheck instanceof Function&&we.tagNameCheck(n))))return!1}else if(Je[t]);else if(v(Se,_(n,be,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==S(n,"data:")||!Ke[e]){if(Le&&!v(Te,_(n,be,"")));else if(n)return!1}else;return!0},kt=function _basicCustomElementTest(e){return"annotation-xml"!==e&&b(e,_e)},Ct=function _sanitizeAttributes(e){var n,r,o,a;Nt("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ne};for(a=i.length;a--;){var c=n=i[a],u=c.name,s=c.namespaceURI;if(r="value"===u?n.value:A(n.value),o=pe(u),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,Nt("uponSanitizeAttribute",e,l),r=l.attrValue,Me&&v(/((--!?|])>)|<\/(style|title)/i,r))bt(u,e);else if(!l.forceKeepAttr&&(bt(u,e),l.keepAttr))if(De||!v(/\/>/i,r)){Re&&(r=_(r,de," "),r=_(r,fe," "),r=_(r,ye," "));var m=pe(e.nodeName);if(wt(m,o,r)){if(!Be||"id"!==o&&"name"!==o||(bt(u,e),r=je+r),te&&"object"===_typeof($)&&"function"==typeof $.getAttributeType)if(s);else switch($.getAttributeType(m,o)){case"TrustedHTML":r=te.createHTML(r);break;case"TrustedScriptURL":r=te.createScriptURL(r)}try{s?e.setAttributeNS(s,u,r):e.setAttribute(u,r),At(e)?Tt(e):y(t.removed)}catch(e){}}}else bt(u,e)}Nt("afterSanitizeAttributes",e,null)}},Ot=function _sanitizeShadowDOM(e){var t,n=St(e);for(Nt("beforeSanitizeShadowDOM",e,null);t=n.nextNode();)Nt("uponSanitizeShadowNode",t,null),Et(t)||(t.content instanceof o&&_sanitizeShadowDOM(t.content),Ct(t));Nt("afterSanitizeShadowDOM",e,null)};return t.sanitize=function(r){var a,l,c,u,s,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((rt=!r)&&(r="\x3c!--\x3e"),"string"!=typeof r&&!vt(r)){if("function"!=typeof r.toString)throw N("toString is not a function");if("string"!=typeof(r=r.toString()))throw N("dirty is not a string, aborting")}if(!t.isSupported){if("object"===_typeof(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof r)return e.toStaticHTML(r);if(vt(r))return e.toStaticHTML(r.outerHTML)}return r}if(Fe||mt(m),t.removed=[],"string"==typeof r&&(qe=!1),qe){if(r.nodeName){var p=pe(r.nodeName);if(!Ae[p]||ke[p])throw N("root node is forbidden and cannot be sanitized in-place")}}else if(r instanceof i)1===(l=(a=_t("\x3c!----\x3e")).ownerDocument.importNode(r,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?a=l:a.appendChild(l);else{if(!Ue&&!Re&&!Ie&&-1===r.indexOf("<"))return te&&Pe?te.createHTML(r):r;if(!(a=_t(r)))return Ue?null:Pe?ne:""}a&&He&&Tt(a.firstChild);for(var d=St(qe?r:a);c=d.nextNode();)3===c.nodeType&&c===u||Et(c)||(c.content instanceof o&&Ot(c.content),Ct(c),u=c);if(u=null,qe)return r;if(Ue){if(ze)for(s=ie.call(a.ownerDocument);a.firstChild;)s.appendChild(a.firstChild);else s=a;return(Ne.shadowroot||Ne.shadowrootmod)&&(s=ce.call(n,s,!0)),s}var f=Ie?a.outerHTML:a.innerHTML;return Ie&&Ae["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&v(W,a.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+a.ownerDocument.doctype.name+">\n"+f),Re&&(f=_(f,de," "),f=_(f,fe," "),f=_(f,ye," ")),te&&Pe?te.createHTML(f):f},t.setConfig=function(e){mt(e),Fe=!0},t.clearConfig=function(){ct=null,Fe=!1},t.isValidAttribute=function(e,t,n){ct||mt({});var r=pe(e),o=pe(t);return wt(r,o,n)},t.addHook=function(e,t){"function"==typeof t&&(se[e]=se[e]||[],h(se[e],t))},t.removeHook=function(e){if(se[e])return y(se[e])},t.removeHooks=function(e){se[e]&&(se[e]=[])},t.removeAllHooks=function(){se={}},t}();e.exports=$}}]); |