import{P as e,c as r,S as a}from"./console.worker-C44TsZQV.js";const t=()=>{let e=(new Date).getTime(),r=1e3*performance.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{let t=16*Math.random();return e>0?(t=(e+t)%16|0,e=Math.floor(e/16)):(t=(r+t)%16|0,r=Math.floor(r/16)),("x"===a?t:7&t|8).toString(16)})};class PieGraphProxy{static render(n,o,x){var i,s;const l=n.map(e=>{if(x)return{name:e[x.name],value:e[x.value]};if(void 0!==e.name&&void 0!==e.value)return{name:e.name,value:e.value};if(Object.values(e).length>2)throw new Error("PieGraph: if there are more than 2 fields in a result entry, a field mapping is required ");const r=Object.values(e);if(r.length>1)return{name:r[0],value:r[1]};throw new Error("PieGraph.render: Not enough parameters")});let u;switch(o){case e.ThickDonut:u=[80,200];break;case e.Donut:u=[120,200];break;case e.ThinDonut:u=[150,200];break;default:u=[0,200]}const c={series:[{id:"m"+t(),type:"pie",data:l,radius:u}]};null==(s=(i=r).postMessage)||s.call(i,{taskId:r.currentTaskId,data:{api:a.Graph,options:c,contextId:r.currentContext,final:!0}})}}export{PieGraphProxy};
