function p(t,r){if(t.ownerDocument!==r.ownerDocument)try{return r.ownerDocument.importNode(t,!0)}catch{}return t}function u(t,r){return r.appendChild(p(t,r))}function b(t,r){return u(r,t),t}var s=2,c={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":s,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":s,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function d(t,r){return c[r]?t.style[r]:t.getAttributeNS(null,r)}function f(t,r,e){var n=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=c[n];i?(i===s&&typeof e=="number"&&(e=String(e)+"px"),t.style[n]=e):t.setAttributeNS(null,r,e)}function h(t,r){var e=Object.keys(r),n,i;for(n=0,i;i=e[n];n++)f(t,i,r[i])}function g(t,r,e){if(typeof r=="string")if(e!==void 0)f(t,r,e);else return d(t,r);else h(t,r);return t}const y=Object.prototype.toString;function k(t){return new o(t)}function o(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}o.prototype.add=function(t){return this.list.add(t),this};o.prototype.remove=function(t){return y.call(t)=="[object RegExp]"?this.removeMatching(t):(this.list.remove(t),this)};o.prototype.removeMatching=function(t){const r=this.array();for(let e=0;e<r.length;e++)t.test(r[e])&&this.remove(r[e]);return this};o.prototype.toggle=function(t,r){return typeof r<"u"?r!==this.list.toggle(t,r)&&this.list.toggle(t):this.list.toggle(t),this};o.prototype.array=function(){return Array.from(this.list)};o.prototype.has=o.prototype.contains=function(t){return this.list.contains(t)};function m(t){var r=t.parentNode;return r&&r.removeChild(t),t}function S(t){for(var r;r=t.firstChild;)m(r);return t}var a={svg:"http://www.w3.org/2000/svg"},l='<svg xmlns="'+a.svg+'"';function v(t){var r=!1;t.substring(0,4)==="<svg"?t.indexOf(a.svg)===-1&&(t=l+t.substring(4)):(t=l+">"+t+"</svg>",r=!0);var e=w(t);if(!r)return e;for(var n=document.createDocumentFragment(),i=e.firstChild;i.firstChild;)n.appendChild(i.firstChild);return n}function w(t){var r;return r=new DOMParser,r.async=!1,r.parseFromString(t,"text/xml")}function A(t,r){var e;return t.charAt(0)==="<"?(e=v(t).firstChild,e=document.importNode(e,!0)):e=document.createElementNS(a.svg,t),r&&g(e,r),e}export{g as a,b,A as c,k as d,S as e,m as r};
