UNPKG

x-cnhis-editor

Version:

``` npm install ```

3 lines 17.2 kB
(("undefined"!==typeof self?self:this)["webpackChunkhoeditor"]=("undefined"!==typeof self?self:this)["webpackChunkhoeditor"]||[]).push([[39],{56039:function(e){ /*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.0.8/LICENSE */ (function(t,n){e.exports=n()})(0,(function(){"use strict";function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,r=Object.freeze,o=Object.seal,i=Object.create,a="undefined"!==typeof Reflect&&Reflect,l=a.apply,c=a.construct;l||(l=function apply(e,t,n){return e.apply(t,n)}),r||(r=function freeze(e){return e}),o||(o=function seal(e){return e}),c||(c=function construct(e,t){return new(Function.prototype.bind.apply(e,[null].concat(_toConsumableArray(t))))});var d=unapply(Array.prototype.forEach),s=unapply(Array.prototype.pop),u=unapply(Array.prototype.push),p=unapply(String.prototype.toLowerCase),f=unapply(String.prototype.match),m=unapply(String.prototype.replace),y=unapply(String.prototype.indexOf),h=unapply(String.prototype.trim),g=unapply(RegExp.prototype.test),T=unconstruct(TypeError);function unapply(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return l(e,t,r)}}function unconstruct(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return c(e,n)}}function addToSet(e,r){t&&t(e,null);var o=r.length;while(o--){var i=r[o];if("string"===typeof i){var a=p(i);a!==i&&(n(r)||(r[o]=a),i=a)}e[i]=!0}return e}function clone(t){var n=i(null),r=void 0;for(r in t)l(e,t,[r])&&(n[r]=t[r]);return n}var b=r(["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","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"]),v=r(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","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","video","view","vkern"]),A=r(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),S=r(["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"]),_=r(["#text"]),x=r(["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","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"]),k=r(["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","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"]),D=r(["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"]),w=r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),M=o(/\{\{[\s\S]*|[\s\S]*\}\}/gm),E=o(/<%[\s\S]*|[\s\S]*%>/gm),L=o(/^data-[\-\w.\u00B7-\uFFFF]/),O=o(/^aria-[\-\w]+$/),C=o(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),N=o(/^(?:\w+script|data):/i),R=o(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),F="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};function _toConsumableArray$1(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var z=function getGlobal(){return"undefined"===typeof window?null:window},H=function _createTrustedTypesPolicy(e,t){if("object"!==("undefined"===typeof e?"undefined":F(e))||"function"!==typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function createHTML(e){return e}})}catch(i){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function createDOMPurify(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z(),t=function DOMPurify(e){return createDOMPurify(e)};if(t.version="2.2.0",t.removed=[],!e||!e.document||9!==e.document.nodeType)return t.isSupported=!1,t;var n=e.document,o=e.document,i=e.DocumentFragment,a=e.HTMLTemplateElement,l=e.Node,c=e.NodeFilter,I=e.NamedNodeMap,P=void 0===I?e.NamedNodeMap||e.MozNamedAttrMap:I,U=e.Text,j=e.Comment,G=e.DOMParser,W=e.trustedTypes;if("function"===typeof a){var $=o.createElement("template");$.content&&$.content.ownerDocument&&(o=$.content.ownerDocument)}var B=H(W,n),q=B&&xe?B.createHTML(""):"",V=o,K=V.implementation,Y=V.createNodeIterator,X=V.getElementsByTagName,Z=V.createDocumentFragment,J=n.importNode,Q={};try{Q=clone(o).documentMode?o.documentMode:{}}catch(Ke){}var ee={};t.isSupported=K&&"undefined"!==typeof K.createHTMLDocument&&9!==Q;var te=M,ne=E,re=L,oe=O,ie=N,ae=R,le=C,ce=null,de=addToSet({},[].concat(_toConsumableArray$1(b),_toConsumableArray$1(v),_toConsumableArray$1(A),_toConsumableArray$1(S),_toConsumableArray$1(_))),se=null,ue=addToSet({},[].concat(_toConsumableArray$1(x),_toConsumableArray$1(k),_toConsumableArray$1(D),_toConsumableArray$1(w))),pe=null,fe=null,me=!0,ye=!0,he=!1,ge=!1,Te=!1,be=!1,ve=!1,Ae=!1,Se=!1,_e=!0,xe=!1,ke=!0,De=!0,we=!1,Me={},Ee=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),Le=null,Oe=addToSet({},["audio","video","img","source","image","track"]),Ce=null,Ne=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Re=null,Fe=o.createElement("form"),ze=function _parseConfig(e){Re&&Re===e||(e&&"object"===("undefined"===typeof e?"undefined":F(e))||(e={}),e=clone(e),ce="ALLOWED_TAGS"in e?addToSet({},e.ALLOWED_TAGS):de,se="ALLOWED_ATTR"in e?addToSet({},e.ALLOWED_ATTR):ue,Ce="ADD_URI_SAFE_ATTR"in e?addToSet(clone(Ne),e.ADD_URI_SAFE_ATTR):Ne,Le="ADD_DATA_URI_TAGS"in e?addToSet(clone(Oe),e.ADD_DATA_URI_TAGS):Oe,pe="FORBID_TAGS"in e?addToSet({},e.FORBID_TAGS):{},fe="FORBID_ATTR"in e?addToSet({},e.FORBID_ATTR):{},Me="USE_PROFILES"in e&&e.USE_PROFILES,me=!1!==e.ALLOW_ARIA_ATTR,ye=!1!==e.ALLOW_DATA_ATTR,he=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ge=e.SAFE_FOR_TEMPLATES||!1,Te=e.WHOLE_DOCUMENT||!1,Ae=e.RETURN_DOM||!1,Se=e.RETURN_DOM_FRAGMENT||!1,_e=!1!==e.RETURN_DOM_IMPORT,xe=e.RETURN_TRUSTED_TYPE||!1,ve=e.FORCE_BODY||!1,ke=!1!==e.SANITIZE_DOM,De=!1!==e.KEEP_CONTENT,we=e.IN_PLACE||!1,le=e.ALLOWED_URI_REGEXP||le,ge&&(ye=!1),Se&&(Ae=!0),Me&&(ce=addToSet({},[].concat(_toConsumableArray$1(_))),se=[],!0===Me.html&&(addToSet(ce,b),addToSet(se,x)),!0===Me.svg&&(addToSet(ce,v),addToSet(se,k),addToSet(se,w)),!0===Me.svgFilters&&(addToSet(ce,A),addToSet(se,k),addToSet(se,w)),!0===Me.mathMl&&(addToSet(ce,S),addToSet(se,D),addToSet(se,w))),e.ADD_TAGS&&(ce===de&&(ce=clone(ce)),addToSet(ce,e.ADD_TAGS)),e.ADD_ATTR&&(se===ue&&(se=clone(se)),addToSet(se,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&addToSet(Ce,e.ADD_URI_SAFE_ATTR),De&&(ce["#text"]=!0),Te&&addToSet(ce,["html","head","body"]),ce.table&&(addToSet(ce,["tbody"]),delete pe.tbody),r&&r(e),Re=e)},He=function _forceRemove(e){u(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch(Ke){e.outerHTML=q}},Ie=function _removeAttribute(e,n){try{u(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch(Ke){u(t.removed,{attribute:null,from:n})}n.removeAttribute(e)},Pe=function _initDocument(e){var t=void 0,n=void 0;if(ve)e="<remove></remove>"+e;else{var r=f(e,/^[\r\n\t ]+/);n=r&&r[0]}var i=B?B.createHTML(e):e;try{t=(new G).parseFromString(i,"text/html")}catch(Ke){}if(!t||!t.documentElement){t=K.createHTMLDocument("");var a=t,l=a.body;l.parentNode.removeChild(l.parentNode.firstElementChild),l.outerHTML=i}return e&&n&&t.body.insertBefore(o.createTextNode(n),t.body.childNodes[0]||null),X.call(t,Te?"html":"body")[0]},Ue=function _createIterator(e){return Y.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,(function(){return c.FILTER_ACCEPT}),!1)},je=function _isClobbered(e){return!(e instanceof U||e instanceof j)&&!("string"===typeof e.nodeName&&"string"===typeof e.textContent&&"function"===typeof e.removeChild&&e.attributes instanceof P&&"function"===typeof e.removeAttribute&&"function"===typeof e.setAttribute&&"string"===typeof e.namespaceURI)},Ge=function _isNode(e){return"object"===("undefined"===typeof l?"undefined":F(l))?e instanceof l:e&&"object"===("undefined"===typeof e?"undefined":F(e))&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName},We=function _executeHook(e,n,r){ee[e]&&d(ee[e],(function(e){e.call(t,n,r,Re)}))},$e=function _sanitizeElements(e){var n=void 0;if(We("beforeSanitizeElements",e,null),je(e))return He(e),!0;if(f(e.nodeName,/[\u0080-\uFFFF]/))return He(e),!0;var r=p(e.nodeName);if(We("uponSanitizeElement",e,{tagName:r,allowedTags:ce}),("svg"===r||"math"===r)&&0!==e.querySelectorAll("p, br").length)return He(e),!0;if(!Ge(e.firstElementChild)&&(!Ge(e.content)||!Ge(e.content.firstElementChild))&&g(/<[!/\w]/g,e.innerHTML)&&g(/<[!/\w]/g,e.textContent))return He(e),!0;if(!ce[r]||pe[r]){if(De&&!Ee[r]&&"function"===typeof e.insertAdjacentHTML)try{var o=e.innerHTML;e.insertAdjacentHTML("AfterEnd",B?B.createHTML(o):o)}catch(Ke){}return He(e),!0}return"noscript"!==r&&"noembed"!==r||!g(/<\/no(script|embed)/i,e.innerHTML)?(ge&&3===e.nodeType&&(n=e.textContent,n=m(n,te," "),n=m(n,ne," "),e.textContent!==n&&(u(t.removed,{element:e.cloneNode()}),e.textContent=n)),We("afterSanitizeElements",e,null),!1):(He(e),!0)},Be=function _isValidAttribute(e,t,n){if(ke&&("id"===t||"name"===t)&&(n in o||n in Fe))return!1;if(ye&&g(re,t));else if(me&&g(oe,t));else{if(!se[t]||fe[t])return!1;if(Ce[t]);else if(g(le,m(n,ae,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==y(n,"data:")||!Le[e]){if(he&&!g(ie,m(n,ae,"")));else if(n)return!1}else;}return!0},qe=function _sanitizeAttributes(e){var n=void 0,r=void 0,o=void 0,i=void 0;We("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:se};i=a.length;while(i--){n=a[i];var c=n,d=c.name,u=c.namespaceURI;if(r=h(n.value),o=p(d),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,We("uponSanitizeAttribute",e,l),r=l.attrValue,!l.forceKeepAttr&&(Ie(d,e),l.keepAttr))if(g(/\/>/i,r))Ie(d,e);else{ge&&(r=m(r,te," "),r=m(r,ne," "));var f=e.nodeName.toLowerCase();if(Be(f,o,r))try{u?e.setAttributeNS(u,d,r):e.setAttribute(d,r),s(t.removed)}catch(Ke){}}}We("afterSanitizeAttributes",e,null)}},Ve=function _sanitizeShadowDOM(e){var t=void 0,n=Ue(e);We("beforeSanitizeShadowDOM",e,null);while(t=n.nextNode())We("uponSanitizeShadowNode",t,null),$e(t)||(t.content instanceof i&&_sanitizeShadowDOM(t.content),qe(t));We("afterSanitizeShadowDOM",e,null)};return t.sanitize=function(r,o){var a=void 0,c=void 0,d=void 0,s=void 0,u=void 0;if(r||(r="\x3c!--\x3e"),"string"!==typeof r&&!Ge(r)){if("function"!==typeof r.toString)throw T("toString is not a function");if(r=r.toString(),"string"!==typeof r)throw T("dirty is not a string, aborting")}if(!t.isSupported){if("object"===F(e.toStaticHTML)||"function"===typeof e.toStaticHTML){if("string"===typeof r)return e.toStaticHTML(r);if(Ge(r))return e.toStaticHTML(r.outerHTML)}return r}if(be||ze(o),t.removed=[],"string"===typeof r&&(we=!1),we);else if(r instanceof l)a=Pe("\x3c!----\x3e"),c=a.ownerDocument.importNode(r,!0),1===c.nodeType&&"BODY"===c.nodeName||"HTML"===c.nodeName?a=c:a.appendChild(c);else{if(!Ae&&!ge&&!Te&&-1===r.indexOf("<"))return B&&xe?B.createHTML(r):r;if(a=Pe(r),!a)return Ae?null:q}a&&ve&&He(a.firstChild);var p=Ue(we?r:a);while(d=p.nextNode())3===d.nodeType&&d===s||$e(d)||(d.content instanceof i&&Ve(d.content),qe(d),s=d);if(s=null,we)return r;if(Ae){if(Se){u=Z.call(a.ownerDocument);while(a.firstChild)u.appendChild(a.firstChild)}else u=a;return _e&&(u=J.call(n,u,!0)),u}var f=Te?a.outerHTML:a.innerHTML;return ge&&(f=m(f,te," "),f=m(f,ne," ")),B&&xe?B.createHTML(f):f},t.setConfig=function(e){ze(e),be=!0},t.clearConfig=function(){Re=null,be=!1},t.isValidAttribute=function(e,t,n){Re||ze({});var r=p(e),o=p(t);return Be(r,o,n)},t.addHook=function(e,t){"function"===typeof t&&(ee[e]=ee[e]||[],u(ee[e],t))},t.removeHook=function(e){ee[e]&&s(ee[e])},t.removeHooks=function(e){ee[e]&&(ee[e]=[])},t.removeAllHooks=function(){ee={}},t}var I=createDOMPurify();return I}))}}]);