1import{p as t}from"./chunk-JWPE2WC7-DQ8nRbdR.js";import{x as e,_ as a,s as r,g as n,m as s,n as i,b as o,c as l,l as c,y as d,z as g,o as u,C as p,j as x,D as h}from"./mermaid.core-Cmkq3o4q.js";import{p as m}from"./cynefin-OW5HDTMX-K0-Jp0Je.js";import"./index-znNb5uDW.js";var f={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},$={axes:[],curves:[],options:f},v=structuredClone($),y=e.radar,w=a((()=>d({...y,...g().radar})),"getConfig"),b=a((()=>v.axes),"getAxes"),C=a((()=>v.curves),"getCurves"),M=a((()=>v.options),"getOptions"),L=a((t=>{v.axes=t.map((t=>({name:t.name,label:t.label??t.name})))}),"setAxes"),k=a((t=>{v.curves=t.map((t=>({name:t.name,label:t.label??t.name,entries:T(t.entries)})))}),"setCurves"),T=a((t=>{if(null==t[0].axis)return t.map((t=>t.value));const e=b();if(0===e.length)throw new Error("Axes must be populated before curves for reference entries");return e.map((e=>{const a=t.find((t=>{var a;return(null==(a=t.axis)?void 0:a.$refText)===e.name}));if(void 0===a)throw new Error("Missing entry for axis "+e.label);return a.value}))}),"computeCurveEntries"),A={getAxes:b,getCurves:C,getOptions:M,setAxes:L,setCurves:k,setOptions:a((t=>{var e,a,r,n,s;const i=t.reduce(((t,e)=>(t[e.name]=e,t)),{});v.options={showLegend:(null==(e=i.showLegend)?void 0:e.value)??f.showLegend,ticks:(null==(a=i.ticks)?void 0:a.value)??f.ticks,max:(null==(r=i.max)?void 0:r.value)??f.max,min:(null==(n=i.min)?void 0:n.value)??f.min,graticule:(null==(s=i.graticule)?void 0:s.value)??f.graticule},v.options.ticks>32&&(c.warn(`Radar diagram ticks (${v.options.ticks}) exceeds maximum allowed (32). Using 32 instead.`),v.options.ticks=32)}),"setOptions"),getConfig:w,clear:a((()=>{u(),v=structuredClone($)}),"clear"),setAccTitle:r,getAccTitle:n,setDiagramTitle:s,getDiagramTitle:i,getAccDescription:o,setAccDescription:l},O=a((e=>{t(e,A);const{axes:a,curves:r,options:n}=e;A.setAxes(a),A.setCurves(r),A.setOptions(n)}),"populate"),S={parse:a((async t=>{const e=await m("radar",t);c.debug(e),O(e)}),"parse")},I=a(((t,e,a,r)=>{const n=r.db,s=n.getAxes(),i=n.getCurves(),o=n.getOptions(),l=n.getConfig(),c=n.getDiagramTitle(),d=p(e),g=E(d,l),u=o.max??Math.max(...i.map((t=>Math.max(...t.entries)))),x=o.min,h=Math.min(l.width,l.height)/2;j(g,s,h,o.ticks,o.graticule),z(g,s,h,l),D(g,s,i,x,u,o.graticule,l),R(g,i,o.showLegend,l),g.append("text").attr("class","radarTitle").text(c).attr("x",0).attr("y",-l.height/2-l.marginTop)}),"draw"),E=a(((t,e)=>{const a=e.width+e.marginLeft+e.marginRight,r=e.height+e.marginTop+e.marginBottom,n=e.marginLeft+e.width/2,s=e.marginTop+e.height/2;return x(t,r,a,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${a} ${r}`).attr("overflow","visible"),t.append("g").attr("transform",`translate(${n}, ${s})`)}),"drawFrame"),j=a(((t,e,a,r,n)=>{if("circle"===n)for(let s=0;s<r;s++){const e=a*(s+1)/r;t.append("circle").attr("r",e).attr("class","radarGraticule")}else if("polygon"===n){const n=e.length;for(let s=0;s<r;s++){const i=a*(s+1)/r,o=e.map(((t,e)=>{const a=2*e*Math.PI/n-Math.PI/2;return`${i*Math.cos(a)},${i*Math.sin(a)}`})).join(" ");t.append("polygon").attr("points",o).attr("class","radarGraticule")}}}),"drawGraticule"),z=a(((t,e,a,r)=>{const n=e.length;for(let s=0;s<n;s++){const i=e[s].label,o=2*s*Math.PI/n-Math.PI/2,l=Math.cos(o),c=Math.sin(o);t.append("line").attr("x1",0).attr("y1",0).attr("x2",a*r.axisScaleFactor*l).attr("y2",a*r.axisScaleFactor*c).attr("class","radarAxisLine");const d=l>.01?"start":l<-.01?"end":"middle",g=c>.01?"hanging":c<-.01?"auto":"central",u=4;t.append("text").text(i).attr("x",a*r.axisLabelFactor*l+u*l).attr("y",a*r.axisLabelFactor*c+u*c).attr("text-anchor",d).attr("dominant-baseline",g).attr("class","radarAxisLabel")}}),"drawAxes");function D(t,e,a,r,n,s,i){const o=e.length,l=Math.min(i.width,i.height)/2;a.forEach(((e,a)=>{if(e.entries.length!==o)return;const c=e.entries.map(((t,e)=>{const a=2*Math.PI*e/o-Math.PI/2,s=F(t,r,n,l);return{x:s*Math.cos(a),y:s*Math.sin(a)}}));"circle"===s?t.append("path").attr("d",P(c,i.curveTension)).attr("class",`radarCurve-${a}`):"polygon"===s&&t.append("polygon").attr("points",c.map((t=>`${t.x},${t.y}`)).join(" ")).attr("class",`radarCurve-${a}`)}
1))}function F(t,e,a,r){return r*(Math.min(Math.max(t,e),a)-e)/(a-e)}function P(t,e){const a=t.length;let r=`M${t[0].x},${t[0].y}`;for(let n=0;n<a;n++){const s=t[(n-1+a)%a],i=t[n],o=t[(n+1)%a],l=t[(n+2)%a],c={x:i.x+(o.x-s.x)*e,y:i.y+(o.y-s.y)*e},d={x:o.x-(l.x-i.x)*e,y:o.y-(l.y-i.y)*e};r+=` C${c.x},${c.y} ${d.x},${d.y} ${o.x},${o.y}`}return`${r} Z`}function R(t,e,a,r){if(!a)return;const n=3*(r.width/2+r.marginRight)/4,s=3*-(r.height/2+r.marginTop)/4;e.forEach(((e,a)=>{const r=t.append("g").attr("transform",`translate(${n}, ${s+20*a})`);r.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${a}`),r.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(e.label)}))}a(D,"drawCurves"),a(F,"relativeRadius"),a(P,"closedRoundCurve"),a(R,"drawLegend");var W={draw:I},B=a(((t,e)=>{let a="";for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const n=t[`cScale${r}`];a+=`\n\t\t.radarCurve-${r} {\n\t\t\tcolor: ${n};\n\t\t\tfill: ${n};\n\t\t\tfill-opacity: ${e.curveOpacity};\n\t\t\tstroke: ${n};\n\t\t\tstroke-width: ${e.curveStrokeWidth};\n\t\t}\n\t\t.radarLegendBox-${r} {\n\t\t\tfill: ${n};\n\t\t\tfill-opacity: ${e.curveOpacity};\n\t\t\tstroke: ${n};\n\t\t}\n\t\t`}return a}),"genIndexStyles"),G=a((t=>{const e=h(),a=g(),r=d(e,a.themeVariables);return{themeVariables:r,radarOptions:d(r.radar,t)}}),"buildRadarStyleOptions"),V={parser:S,db:A,renderer:W,styles:a((({radar:t}={})=>{const{themeVariables:e,radarOptions:a}=G(t);return`\n\t.radarTitle {\n\t\tfont-size: ${e.fontSize};\n\t\tcolor: ${e.titleColor};\n\t\tdominant-baseline: hanging;\n\t\ttext-anchor: middle;\n\t}\n\t.radarAxisLine {\n\t\tstroke: ${a.axisColor};\n\t\tstroke-width: ${a.axisStrokeWidth};\n\t}\n\t.radarAxisLabel {\n\t\tfont-size: ${a.axisLabelFontSize}px;\n\t\tcolor: ${a.axisColor};\n\t}\n\t.radarGraticule {\n\t\tfill: ${a.graticuleColor};\n\t\tfill-opacity: ${a.graticuleOpacity};\n\t\tstroke: ${a.graticuleColor};\n\t\tstroke-width: ${a.graticuleStrokeWidth};\n\t}\n\t.radarLegendText {\n\t\ttext-anchor: start;\n\t\tfont-size: ${a.legendFontSize}px;\n\t\tdominant-baseline: hanging;\n\t}\n\t${B(e,a)}\n\t`}),"styles")};export{V as diagram};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.