import{a as o,b as s,c as l,d as n,e as d,g as m,t as c,w as p,y as T}from"./chunk-L5GCOVLC.mjs";import{a as i}from"./chunk-AQ6EADP3.mjs";var u=class extends T{static{i(this,"TreemapTokenBuilder")}static{o(this,"TreemapTokenBuilder")}constructor(){super(["treemap"])}},v=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,g=class extends p{static{i(this,"TreemapValueConverter")}static{o(this,"TreemapValueConverter")}runCustomConverter(r,e,t){if(r.name==="NUMBER2")return parseFloat(e.replace(/,/g,""));if(r.name==="SEPARATOR")return e.substring(1,e.length-1);if(r.name==="STRING2")return e.substring(1,e.length-1);if(r.name==="INDENTATION")return e.length;if(r.name==="ClassDef"){if(typeof e!="string")return e;let a=v.exec(e);if(a)return{$type:"ClassDefStatement",className:a[1],styleText:a[2]||void 0}}}};function f(r){let e=r.validation.TreemapValidator,t=r.validation.ValidationRegistry;if(t){let a={Treemap:e.checkSingleRoot.bind(e)};t.register(a,e)}}i(f,"registerValidationChecks");o(f,"registerValidationChecks");var h=class{static{i(this,"TreemapValidator")}static{o(this,"TreemapValidator")}checkSingleRoot(r,e){let t;for(let a of r.TreemapRows)a.item&&(t===void 0&&a.indent===void 0?t=0:a.indent===void 0?e("error","Multiple root nodes are not allowed in a treemap.",{node:a,property:"item"}):t!==void 0&&t>=parseInt(a.indent,10)&&e("error","Multiple root nodes are not allowed in a treemap.",{node:a,property:"item"}))}},C={parser:{TokenBuilder:o(()=>new u,"TokenBuilder"),ValueConverter:o(()=>new g,"ValueConverter")},validation:{TreemapValidator:o(()=>new h,"TreemapValidator")}};function V(r=d){let e=n(l(r),m),t=n(s({shared:e}),c,C);return e.ServiceRegistry.register(t),f(t),{shared:e,Treemap:t}}i(V,"createTreemapServices");o(V,"createTreemapServices");export{C as a,V as b};
