import{n as e}from"./rolldown-runtime.C0FnF6B9.js";import{a as t,f as n,i as r,m as i,n as a,o,p as s,s as c,t as l}from"./space-separated-tokens.BqhiSyze.js";function u(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){d.lastIndex=i;let e=d.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}var d,f=e((()=>{d=/[#.]/g})),p=e((()=>{f()}));function m(e,t,n){let r=n?b(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=u(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,h(i))a.unshift(i);else for(let[t,n]of Object.entries(i))g(e,o.properties,t,n)}for(let e of a)_(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function h(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function g(e,t,n,r){let o=c(e,n),s;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;s=r}else s=typeof r==`boolean`?r:typeof r==`string`?o.spaceSeparated?a(r):o.commaSeparated?i(r):o.commaOrSpaceSeparated?a(i(r).join(` `)):v(o,o.property,r):Array.isArray(r)?[...r]:o.property===`style`?y(r):String(r);if(Array.isArray(s)){let e=[];for(let t of s)e.push(v(o,o.property,t));s=e}o.property===`className`&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[o.property]=s}}function _(e,t){if(t!=null){if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)_(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?_(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}}function v(e,t,r){if(typeof r==`string`){if(e.number&&r&&!Number.isNaN(Number(r)))return Number(r);if((e.boolean||e.overloadedBoolean)&&(r===``||n(r)===n(t)))return!0}return r}function y(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function b(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var x=e((()=>{s(),p(),t(),l()})),S,C=e((()=>{S=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.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.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`)})),w,T,E=e((()=>{t(),x(),C(),w=m(r,`div`),T=m(o,`g`,S)})),D=e((()=>{E()}));export{T as i,w as n,E as r,D as t};