/** * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0. * Original file: /npm/htl@0.3.1/src/index.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ function e(e){const t=document.createElement("template");return t.innerHTML=e,document.importNode(t.content,!0)}function t(e){const t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e,t}const r=Object.assign(oe(e,(e=>{if(null===e.firstChild)return null;if(e.firstChild===e.lastChild)return e.removeChild(e.firstChild);const t=document.createElement("span");return t.appendChild(e),t})),{fragment:oe(e,(e=>e))}),n=Object.assign(oe(t,(e=>null===e.firstChild?null:e.firstChild===e.lastChild?e.removeChild(e.firstChild):e)),{fragment:oe(t,(e=>{const t=document.createDocumentFragment();for(;e.firstChild;)t.appendChild(e.firstChild);return t}))}),a=9,s=10,i=12,o=13,c=32,l=65,f=90,u=97,d=122,p=60,k=62,b=47,h=45,g=33,m=61,w=34,C=39,x=63,v=1,y=2,A=3,N=4,L=5,T=6,S=7,U=8,$=9,E=10,M=11,B=12,O=13,P=14,R=15,j=16,q=17,H=18,X=19,D=20,F=21,W=22,Y=23,I=24,z=25,V=26,Z=27,G=28,J=29,K=128,Q=1,_=8,ee=1,te="http://www.w3.org/2000/svg",re="http://www.w3.org/1999/xlink",ne="http://www.w3.org/XML/1998/namespace",ae="http://www.w3.org/2000/xmlns/",se=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((e=>[e.toLowerCase(),e]))),ie=new Map([["xlink:actuate",re],["xlink:arcrole",re],["xlink:href",re],["xlink:role",re],["xlink:show",re],["xlink:title",re],["xlink:type",re],["xml:lang",ne],["xml:space",ne],["xmlns",ae],["xmlns:xlink",ae]]);function oe(e,t){return function({raw:r}){let n,a,s,i,o=v,c="",l=0;for(let e=0,t=arguments.length;e0){const n=arguments[e];switch(o){case V:if(null!=n){const e=`${n}`;if(pe(a))c+=e.replace(/[<]/g,ce);else{if(new RegExp(`/]`,"i").test(c.slice(-a.length-2)+e))throw new Error("unsafe raw text");c+=e}}break;case v:null==n||(n instanceof Node||"string"!=typeof n&&n[Symbol.iterator]||/(?:^|>)$/.test(r[e-1])&&/^(?:<|$)/.test(t)?(c+="\x3c!--::"+e+"--\x3e",l|=K):c+=`${n}`.replace(/[<&]/g,ce));break;case $:{let a;if(o=B,/^[\s>]/.test(t)){if(null==n||!1===n){c=c.slice(0,s-r[e-1].length);break}if(!0===n||""==(a=`${n}`)){c+="''";break}if("style"===r[e-1].slice(s,i)&&ue(n)||"function"==typeof n){c+="::"+e,l|=Q;break}}if(void 0===a&&(a=`${n}`),""===a)throw new Error("unsafe unquoted empty string");c+=a.replace(/^['"]|[\s>&]/g,ce);break}case B:c+=`${n}`.replace(/[\s>&]/g,ce);break;case M:c+=`${n}`.replace(/['&]/g,ce);break;case E:c+=`${n}`.replace(/["&]/g,ce);break;case T:if(ue(n)){c+="::"+e+"=''",l|=Q;break}throw new Error("invalid binding");case q:break;default:throw new Error("invalid binding")}}for(let e=0,r=t.length;e=0;--n)a=t.insertBefore(r[n],a);else for(const n of r)null!=n&&t.insertBefore(n instanceof Node?n:document.createTextNode(n),e);else t.insertBefore(document.createTextNode(r),e);d.push(e)}}}for(const e of d)e.parentNode.removeChild(e);return t(f)}}function ce(e){return`&#${e.charCodeAt(0).toString()};`}function le(e){return l<=e&&e<=f||u<=e&&e<=d}function fe(e){return e===a||e===s||e===i||e===c||e===o}function ue(e){return e&&e.toString===Object.prototype.toString}function de(e){return"script"===e||"style"===e||pe(e)}function pe(e){return"textarea"===e||"title"===e}function ke(e,t,r){return e.slice(t,r).toLowerCase()}function be(e,t,r){e.namespaceURI===te&&(t=t.toLowerCase(),t=se.get(t)||t,ie.has(t))?e.setAttributeNS(ie.get(t),t,r):e.setAttribute(t,r)}function he(e,t){e.namespaceURI===te&&(t=t.toLowerCase(),t=se.get(t)||t,ie.has(t))?e.removeAttributeNS(ie.get(t),t):e.removeAttribute(t)}function ge(e,t){for(const r in t){const n=t[r];r.startsWith("--")?e.setProperty(r,n):e[r]=n}}export{r as html,n as svg};export default null;