@aegisjsproject/parsers
Version:
A collection of secure & minimal parsers for HTML, CSS, SVG, MathML, XML, and JSON
10 lines (9 loc) • 22.8 kB
JavaScript
/**
* @copyright 2023-2024 Chris Zuber <admin@kernvalley.us>
*/
const e="http://www.w3.org/1999/xhtml",t="http://www.w3.org/1999/xlink",r="http://www.w3.org/1998/Math/MathML",n=new Set(("HTMLElement"in globalThis?Object.keys(HTMLElement.prototype):[]).filter((e=>e.startsWith("on"))));function a(t,r=e){if("string"==typeof t)return Object.freeze({name:t,namespace:r});if("object"==typeof t&&"string"==typeof t.name){const{name:e,namespace:n=r,attributes:a}=t;return Object.freeze({name:e,namespace:"string"==typeof n&&0!==n.length?n:r,attributes:a})}throw new TypeError("Invalid config entry for `elements`.")}function i({elements:t,allowElements:r},n=e){if(Array.isArray(r))return console.warn("Use of `allowElements` is deprecated. Please use `elements` instead."),i({elements:r},n);if(Array.isArray(t))return t.map((e=>a(e,n)));throw new TypeError("`elements` expected to be an array.")}function o(e,t){if("string"==typeof e)return Object.freeze({name:e,namespace:t});if("object"==typeof e&&"string"==typeof e.name){const{name:r,namespace:n=t,elements:a,...i}=e;return Object.freeze({name:r,namespace:"string"==typeof n?n:t,elements:a,...i})}throw new TypeError("Invalid entry in `attributes` config.")}function s({attributes:e,allowAttributes:t},r){if(void 0!==t)return console.warn("Use of `allowAttributes` is deprecated. Please use `attributes` instead."),s({attributes:t},r);if(Array.isArray(e))return e.map((e=>o(e,r)));if("object"==typeof e&&null!==e)return console.warn("`attributes` should be an array, not an oobject."),s({attributes:Object.entries(e).map((([e,t])=>({name:e,elements:t})))},r);throw new TypeError("`attributes` expected to be an array.")}function c({comments:e,allowComments:t}){return"boolean"==typeof t?(console.warn("Use of `allowComments` is deprecated. Please use `comments` instead."),t):"boolean"!=typeof e||e}function l({attributes:e,allowAttributes:t},r){return Object.freeze(Object.groupBy(s({attributes:e,allowAttributes:t},r),(({namespace:e})=>e??"")))}function m({elements:t,allowElements:r},n=e){return Object.freeze(Object.groupBy(i({elements:t,allowElements:r},n),(({namespace:e})=>e)))}function u(t,{elementNS:r=e,attributeNS:n}={}){if("object"!=typeof t||null===t)throw new TypeError("Sanitizer config must be an object.");return t.get instanceof Function?u(t.get()):Object.freeze({elements:m(t,r),attributes:l(t,n),comments:c(t),dataAttributes:void 0===t.dataAttributes||t.dataAttributes})}const p=Object.freeze(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","height","hidden","id","inert","inputmode","itemid","itemprop","itemref","itemscope","itemtype","lang","part","popover","slot","spellcheck","tabindex","title","translate","virtualkeyboardpolicy","width","aria-keyshortcuts","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-expanded","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"].map((e=>o(e,null)))),d=Object.freeze(["html","head","link","meta","body","address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","search","blockquote","cite","div","dd","dt","dl","figcaption","figure","hr","li","ol","ul","menu","p","pre","a","abbr","b","bdi","bdo","br","code","data","dfn","em","i","kbd","mark","q","rp","ruby","rt","s","del","ins","samp","small","span","strong","sub","sup","time","u","var","wbr","area","audio","img","map","track","video","picture","source","canvas","caption","col","colgroup","table","tbody","tr","td","tfoot","th","thead","button","datalist","option","fieldset","label","form","input","legend","meter","optgroup","select","output","progress","textarea","details","summary","dialog","slot","dir","template","strike","selectmenu","center"].map((t=>a(t,e)))),f=Object.freeze(["abbr","accept","accept-charset","align","alink","allow","allowfullscreen","alt","anchor","archive","as","async","autocomplete","autocorrect","autopictureinpicture","autoplay","axis","background","behavior","border","bordercolor","capture","cellpadding","cellspacing","challenge","char","charoff","charset","checked","cite","classid","clear","code","codetype","color","cols","colspan","command","commandfor","compact","content","controls","controlslist","conversiondestination","coords","crossorigin","csp","data","datetime","declare","decoding","default","defer","direction","dirname","disabled","disablepictureinpicture","disableremoteplayback","disallowdocumentaccess","download","elementtiming","enctype","end","for","form","formenctype","formmethod","formnovalidate","formtarget","frameborder","headers","high","href","hreflang","hreftranslate","hspace","imagesizes","imagesrcset","importance","impressiondata","impressionexpiry","incremental","integrity","invisible","is","ismap","keytype","kind","label","language","latencyhint","leftmargin","link","list","loading","longdesc","loop","low","lowsrc","manifest","marginheight","marginwidth","max","maxlength","mayscript","media","method","min","minlength","multiple","muted","name","nohref","nomodule","noresize","noshade","novalidate","nowrap","object","open","optimum","pattern","ping","placeholder","playsinline","policy","popovertarget","popovertargetaction","poster","preload","pseudo","readonly","referrerpolicy","rel","reportingorigin","required","resources","rev","reversed","role","rows","rowspan","rules","sandbox","scheme","scope","scopes","scrollamount","scrolldelay","scrolling","select","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootmode","shadowrootserializable","shape","size","sizes","span","src","srcdoc","srclang","srcset","standby","start","step","summary","target","text","topmargin","truespeed","trusttoken","type","usemap","valign","value","valuetype","version","vlink","vspace","webkitdirectory","wrap"].map((e=>o(e,null)))),b=Object.freeze(f.concat(p)),h=Object.freeze({comments:true,elements:d,attributes:b,dataAttributes:true});
/**
* @copyright 2023-2025 Chris Zuber <admin@kernvalley.us>
* @see https://wicg.github.io/sanitizer-api/#built-in-safe-default-configuration
*/var g=Object.freeze({__proto__:null,attributes:b,comments:true,dataAttributes:true,elements:d,htmlAttributes:f,sanitizer:h});const y=Object.freeze(["a","animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","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","filter","foreignObject","g","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tspan","view","missing-glyph","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","hkern","vkern","glyph","glyphRef","tref","cursor"].map((e=>a(e,"http://www.w3.org/2000/svg")))),w=Object.freeze(["accent-height","accumulate","additive","alignment-baseline","alphabetic","amplitude","arabic-form","ascent","attributeName","attributeType","azimuth","baseFrequency","baseline-shift","baseProfile","bbox","begin","bias","by","calcMode","cap-height","clip","clipPathUnits","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cursor","cx","cy","d","decelerate","descent","diffuseConstant","display","divisor","dominant-baseline","dur","dx","dy","edgeMode","elevation","enable-background","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","format","from","fr","fx","fy","g1","g2","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","glyphRef","gradientTransform","gradientUnits","hanging","horiz-adv-x","horiz-origin-x","ideographic","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letter-spacing","lighting-color","limitingConeAngle","local","marker-end","marker-mid","marker-start","markerHeight","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overline-position","overline-thickness","panose-1","paint-order","path","pathLength","patternContentUnits","patternTransform","patternUnits","pointer-events","points","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","rendering-intent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","scale","seed","shape-rendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","string","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","surfaceScale","systemLanguage","tableValues","targetX","targetY","text-anchor","text-decoration","text-rendering","textLength","to","transform","transform-origin","u1","u2","underline-position","underline-thickness","unicode","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","values","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","viewBox","visibility","widths","word-spacing","writing-mode","x","x-height","x1","x2","xChannelSelector","y","y1","y2","yChannelSelector","z","zoomAndPan","autoReverse","accelerate","xmlns",{name:"actuate",namespace:t},{name:"arcrole",namespaec:t},{name:"href",namespace:t},{name:"role",namespace:t},{name:"show",namespace:t},{name:"title",namespace:t},{name:"type",namespace:t},{name:"space",namespace:"http://www.w3.org/XML/1998/namespace"}].map((e=>"string"==typeof e?o(e):e))),v=Object.freeze(w.concat(p)),T=Object.freeze({elements:y,attributes:v,comments:true,dataAttributes:true});var L=Object.freeze({__proto__:null,attributes:v,comments:true,dataAttributes:true,elements:y,sanitizer:T,svgAttributes:w});const S=Object.freeze(["math","maction","annotation","annotation-xml","menclose","merror","mfenced","mfrac","mi","mmultiscripts","mn","mo","mover","mpadded","mphantom","mprescripts","mroot","mrow","ms","semantics","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"].map((e=>a(e,r)))),z=Object.freeze(["accent","accentunder","actiontype","align","background","close","color","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","fence","fontfamily","fontsize","fontstyle","fontweight","frame","framespacing","height","href","id","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","superscriptshift","symmetric","voffset","width","xmlns"].map((e=>o(e,r)))),k=Object.freeze(z.concat(p)),A=Object.freeze({elements:S,attributes:k,comments:true,dataAttributes:true});var E=Object.freeze({__proto__:null,attributes:k,comments:true,dataAttributes:true,elements:S,mathAttributes:z,sanitizer:A});const O=Object.freeze([...d,...y]),j=Object.freeze([...p,...f,...w]),U=Object.freeze({elements:O,attributes:j,comments:false,dataAttributes:true});var M=Object.freeze({__proto__:null,attributes:j,comments:false,dataAttributes:true,elements:O,sanitizer:U});const x=Object.freeze([...d,...y,...S]),R=Object.freeze([...p,...f,...w,...z]),N=Object.freeze({elements:x,attributes:R,comments:true,dataAttributes:true});var C=Object.freeze({__proto__:null,attributes:R,comments:true,dataAttributes:true,elements:x,sanitizer:N});const F=new Set(["href","src","action","xlink:href"]),H=new Set(["javascript:","data:","file:","ftp:"]),D=function(e,{createHTML:t,createScript:r,createScriptURL:n}){return"trustedTypes"in globalThis?trustedTypes.createPolicy(e,{createHTML:t,createScript:r,createScriptURL:n}):Object.freeze({[Symbol.for("policy-name")]:e.toString(),createHTML(r,...n){if(t instanceof Function){const e=t(r.toString(),...n).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createHTML method.`)},createScript(t,...n){if(r instanceof Function){const e=r(t.toString(),...n).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createScript method.`)},createScriptURL(t,...r){if(n instanceof Function){const e=n(t.toString(),...r).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createScriptURL method.`)}})}("aegis-sanitizer#html",{createHTML:e=>e});function B(e,t,{elements:r=h.elements,attributes:n=h.attributes,comments:a=h.comments,dataAttributes:i=h.dataAttributes,sanitizer:o,...s}=h,{allowInsecure:c=!1}={}){const l=document.createElement("template");l.setHTMLUnsafe(D.createHTML(t)),_(l.content,{elements:r,attributes:n,comments:a,dataAttributes:i,sanitizer:o,...s},c),e.replaceChildren(l.content)}function _(e,t=h,r=!1){if(e instanceof Node){return q(e,u(t),r)}throw new TypeError("Not a node.")}const P="trustedTypes"in globalThis?e=>null!==trustedTypes.getAttributeType(e.ownerElement.tagName,e.localName,e.ownerElement.namespaceURI,e.namespaceURI):e=>n.has(e.localName);function I(e,t,r=!1){const n=e.namespaceURI||"";return(!("dataAttributes"in t)||t.dataAttributes)&&e.name.startsWith("data-")||n in t.attributes&&t.attributes[n].some((t=>t.name===e.localName))&&!(r||P(e))&&!(r||function(e){if(F.has(e.name)){if(URL.canParse(e.value)){const{protocol:t}=new URL(e.value);return H.has(t)}return!1}return!1}(e))}function q(e,t,r=!1){switch(e.nodeType){case Node.ELEMENT_NODE:!function(e,t,r){if(function(e,t){return e.namespaceURI in t.elements&&t.elements[e.namespaceURI].some((t=>t.name===e.localName))}(e,t)){if(e.hasAttributes()){const n=e.attributes;for(let e=n.length-1;-1!==e;e--)W(n[e],t,r)}if("TEMPLATE"===e.tagName)G(e.content,t,r);else if(e.hasChildNodes()){const n=e.childNodes;for(let e=n.length-1;-1!==e;e--)q(n[e],t,r)}}else e.remove()}(e,t,r);break;case Node.DOCUMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:G(e,t,r);break;case Node.COMMENT_NODE:!function(e,t){t.comments||e.remove()}(e,t);break;case Node.ATTRIBUTE_NODE:W(e,t,r);break;case Node.TEXT_NODE:case Node.DOCUMENT_TYPE_NODE:break;default:e.ownerElement instanceof Element&&e.ownerElement.removeChild(e)}}function W(e,t,r=!1){!I(e,t,r)&&e.ownerElement instanceof Element&&e.ownerElement.removeAttributeNode(e)}function G(e,t,r=!1){if(e.hasChildNodes()){const n=e.childNodes;for(let e=n.length-1;-1!==e;e--)q(n[e],t,r)}}Promise.withResolvers instanceof Function||(Promise.withResolvers=function(){const e={};return e.promise=new Promise(((t,r)=>{e.resolve=t,e.reject=r})),e}),URL.canParse instanceof Function||(URL.canParse=function(e,t){try{return new URL(e,t),!0}catch{return!1}}),URL.parse instanceof Function||(URL.parse=function(e,t){try{return new URL(e,t)}catch{return null}}),Object.groupBy instanceof Function||(Object.groupBy=function(e,t){const r={};for(const n of e){const e=t(n);e in r?r[e].push(n):r[e]=[n]}return r}),Element.prototype.setHTML instanceof Function||(Element.prototype.setHTML=function(e,{elements:t,attributes:r,comments:n,dataAttributes:a,sanitizer:i,...o}={}){B(this,e,"object"==typeof i&&null!==i?i.getConfiguration instanceof Function?i.getConfiguration():i:{elements:t,attributes:r,comments:n,dataAttributes:a,...o})},DocumentFragment.prototype.setHTML=function(...e){Element.prototype.setHTML.apply(this,e)},HTMLTemplateElement.prototype.setHTML=function(e,t){this.content.setHTML(e,t)}),Document.parseHTML instanceof Function||(Document.parseHTML=function(e,{elements:t,attributes:r,comments:n,dataAttributes:a,sanitizer:i,...o}={}){return"object"==typeof i&&null!==i?Document.parseHTML(e,i.getConfiguration instanceof Function?i.getConfiguration():i):function(e,{elements:t=h.elements,attributes:r=h.attributes,comments:n=h.comments,dataAttributes:a=h.dataAttributes,sanitizer:i,...o}=h,{allowInsecure:s=!1}={}){const c=(new DOMParser).parseFromString(D.createHTML(e),"text/html");return _(c,{elements:t,attributes:r,comments:n,dataAttributes:a,sanitizer:i,...o},s),c}(e,{elements:t,attributes:r,comments:n,dataAttributes:a,...o})});const X=e=>{switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"object":return null===e?"":e instanceof CSSStyleSheet?[...e.cssRules].map((e=>e.cssText)).join("\n\n"):e instanceof CSSRule?e.cssText:e instanceof HTMLLinkElement?X(e.sheet):e instanceof ArrayBuffer&&Uint8Array.prototype.toBase64 instanceof Function?new Uint8Array(e).toBase64():ArrayBuffer.isView(e)&&e.toBase64 instanceof Function?e.toBase64():e instanceof Blob?URL.createObjectURL(e):e.toString();default:return e.toString()}};function V(e,{media:t,disabled:r,baseURL:n}={}){const a=new CSSStyleSheet({media:t instanceof MediaQueryList?t.media:t,disabled:r,baseURL:n});return a.replace(e).catch(reportError),a}const Y=({media:e,disabled:t,baseURL:r,sync:n=!1}={})=>n?(n,...a)=>function(e,{media:t,disabled:r,baseURL:n}={}){const a=new CSSStyleSheet({media:t instanceof MediaQueryList?t.media:t,disabled:r,baseURL:n});return a.replaceSync(e),a}(String.raw(n,...a.map(X)).trim(),{media:e,disabled:t,baseURL:r}):(n,...a)=>V(String.raw(n,...a.map(X)).trim(),{media:e,disabled:t,baseURL:r}),$=Y();function Q(e,{crossOrigin:t="anonymous",referrerPolicy:r="no-referrer"}={}){const n=document.createElement("link"),a=new File(Array.from(e.cssRules,(e=>e.cssText)),"sheet.css",{type:e.type});return n.rel="stylesheet",n.crossOrigin=t,n.referrerPolicy=r,n.disabled=e.disabled,0!==e.media.length&&(n.media=e.media.mediaText),n.href=URL.createObjectURL(a),n}function J(e,...t){if(!(e instanceof HTMLDocument||e instanceof ShadowRoot))throw new TypeError("Node must be a `HTMLDocument` or `ShadowRoot`.");e.adoptedStyleSheets=t}function Z(e,...t){if(!(e instanceof Document||e instanceof ShadowRoot))throw new TypeError("Node must be a `HTMLDocument` or `ShadowRoot`.");e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]}const K=e=>Array.from(e[Symbol.iterator](),(e=>e.nodeType===Node.ELEMENT_NODE?e.outerHTML:e.textContent)).join("");function ee(e){switch(typeof e){case"string":return e;case"function":throw new TypeError("Functions are not supported.");case"undefined":return"";case"object":return null===e?"":e instanceof DocumentFragment||e instanceof Document?K(e.childNodes):e instanceof NodeList||e instanceof HTMLCollection?K(e):e instanceof Element?e.outerHTML:e instanceof Date?e.toISOString():Array.isArray(e)?e.map(ee).join(""):e instanceof ArrayBuffer&&Uint8Array.prototype.toBase64 instanceof Function?new Uint8Array(e).toBase64():ArrayBuffer.isView(e)&&e.toBase64 instanceof Function?e.toBase64():e instanceof Blob?URL.createObjectURL(e):e.toString();default:return e.toString()}}const te=(e,t,r=ee)=>String.raw(e,...t.map(r)).trim();function re(e=U,{mapper:t=ee}={}){return(r,...n)=>{const a=document.createElement("template");return a.setHTML(te(r,n,t),{sanitizer:e}),a.content}}const ne=re(U,{mapper:ee}),ae=(...e)=>ne.apply(null,e).firstElementChild;function ie(e,...t){return Document.parseHTML(te(e,t),{sanitizer:U})}const oe=(...e)=>JSON.parse(String.raw.apply(null,e).trim());function se(...e){return Document.parseHTML(String.raw.apply(null,e).trim(),{sanitizer:{elements:["html","head","body",...S],attributes:k}}).body.firstElementChild}function ce(...e){return Document.parseHTML(String.raw.apply(null,e).trim(),{sanitizer:{elements:["html","head","body",...y],attributes:v}}).body.firstElementChild}function le(e="aegis-parsers#html",{elements:t=U.elements,attributes:r=U.attributes,comments:n=U.comments}=U){const a=e=>{const a=document.createElement("div");return a.setHTML(e,{sanitizer:{elements:t,attributes:r,comments:n}}),a.innerHTML};return"trustedTypes"in globalThis?globalThis.trustedTypes.createPolicy(e,{createHTML:a}):Object.freeze({createHTML:a})}function me(e){switch(typeof e){case"string":return e;case"function":throw new TypeError("Functions are not supported.");case"undefined":return"";case"object":return null===e?"":e instanceof Date?e.toISOString():Array.isArray(e)?e.map(me).join(","):e instanceof ArrayBuffer&&Uint8Array.prototype.toBase64 instanceof Function?new Uint8Array(e).toBase64():ArrayBuffer.isView(e)&&e.toBase64 instanceof Function?e.toBase64():e instanceof Blob?URL.createObjectURL(e):e.toString();default:return e.toString()}}function ue(e){return encodeURIComponent(me(e).trim()).replaceAll("..%2F","%2E%2E%2F").replaceAll(".%2F","%2E%2E%2F")}const pe=function(e=globalThis?.document?.baseURI){return function(t,r,...n){return r instanceof Blob&&2===t.length&&""===t[0]&&""===t[1]?new URL(URL.createObjectURL(r)):URL.canParse(r)?URL.parse(String.raw(t,"",...n.map(ue)),r):t[0].startsWith("/")||t[0].startsWith("./")||t[0].startsWith("../")?URL.parse(String.raw(t,ue(r),...n.map(ue)),e):URL.parse(String.raw(t,ue(r),...n.map(ue)))}}(),de=(...e)=>(new DOMParser).parseFromString(String.raw.apply(null,e).trim(),"application/xml");export{Z as addStyleSheets,M as baseConfig,C as completeConfig,Y as createCSSParser,re as createHTMLParser,le as createPolicy,V as createStyleSheet,$ as css,ie as doc,ae as el,ne as html,g as htmlConfig,oe as json,se as math,E as mathMLConfig,J as setStyleSheets,Q as styleSheetToLink,ce as svg,L as svgConfig,pe as url,de as xml};
//# sourceMappingURL=bundle.min.js.map