vue-data-ui 3.28.3 → 3.28.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/dist/{PackageVersion-CXT-eAuk.js → PackageVersion-DhptF5oD.js} +1 -1
  2. package/dist/components/vue-ui-3d-bar.js +1 -1
  3. package/dist/components/vue-ui-age-pyramid.js +1 -1
  4. package/dist/components/vue-ui-bullet.js +1 -1
  5. package/dist/components/vue-ui-bump.js +1 -1
  6. package/dist/components/vue-ui-candlestick.js +1 -1
  7. package/dist/components/vue-ui-carousel-table.js +1 -1
  8. package/dist/components/vue-ui-chestnut.js +1 -1
  9. package/dist/components/vue-ui-chord.js +1 -1
  10. package/dist/components/vue-ui-circle-pack.js +1 -1
  11. package/dist/components/vue-ui-cursor.js +1 -1
  12. package/dist/components/vue-ui-dag.js +1 -1
  13. package/dist/components/vue-ui-dashboard.js +1 -1
  14. package/dist/components/vue-ui-digits.js +1 -1
  15. package/dist/components/vue-ui-donut-evolution.js +1 -1
  16. package/dist/components/vue-ui-donut.js +1 -1
  17. package/dist/components/vue-ui-dumbbell.js +1 -1
  18. package/dist/components/vue-ui-flow.js +1 -1
  19. package/dist/components/vue-ui-funnel.js +1 -1
  20. package/dist/components/vue-ui-galaxy.js +1 -1
  21. package/dist/components/vue-ui-gauge.js +1 -1
  22. package/dist/components/vue-ui-geo.js +1 -1
  23. package/dist/components/vue-ui-gizmo.js +1 -1
  24. package/dist/components/vue-ui-graph.js +1 -1
  25. package/dist/components/vue-ui-heatmap.js +1 -1
  26. package/dist/components/vue-ui-hill.js +1 -1
  27. package/dist/components/vue-ui-history-plot.js +1 -1
  28. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  29. package/dist/components/vue-ui-kpi.js +1 -1
  30. package/dist/components/vue-ui-molecule.js +1 -1
  31. package/dist/components/vue-ui-mood-radar.js +1 -1
  32. package/dist/components/vue-ui-nested-donuts.js +1 -1
  33. package/dist/components/vue-ui-onion.js +1 -1
  34. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  35. package/dist/components/vue-ui-quadrant.js +1 -1
  36. package/dist/components/vue-ui-quick-chart.js +1 -1
  37. package/dist/components/vue-ui-radar.js +1 -1
  38. package/dist/components/vue-ui-relation-circle.js +1 -1
  39. package/dist/components/vue-ui-ridgeline.js +1 -1
  40. package/dist/components/vue-ui-rings.js +1 -1
  41. package/dist/components/vue-ui-scatter.js +1 -1
  42. package/dist/components/vue-ui-skeleton.js +1 -1
  43. package/dist/components/vue-ui-spark-trend.js +1 -1
  44. package/dist/components/vue-ui-sparkbar.js +1 -1
  45. package/dist/components/vue-ui-sparkgauge.js +1 -1
  46. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  47. package/dist/components/vue-ui-sparkline.js +1 -1
  48. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  49. package/dist/components/vue-ui-stackbar.js +1 -1
  50. package/dist/components/vue-ui-stackline.js +1 -1
  51. package/dist/components/vue-ui-strip-plot.js +1 -1
  52. package/dist/components/vue-ui-table-sparkline.js +1 -1
  53. package/dist/components/vue-ui-table.js +1 -1
  54. package/dist/components/vue-ui-thermometer.js +1 -1
  55. package/dist/components/vue-ui-timer.js +1 -1
  56. package/dist/components/vue-ui-tiremarks.js +1 -1
  57. package/dist/components/vue-ui-treemap.js +1 -1
  58. package/dist/components/vue-ui-vertical-bar.js +1 -1
  59. package/dist/components/vue-ui-waffle.js +1 -1
  60. package/dist/components/vue-ui-wheel.js +1 -1
  61. package/dist/components/vue-ui-word-cloud.js +1 -1
  62. package/dist/components/vue-ui-world.js +1 -1
  63. package/dist/components/vue-ui-xy.js +1 -1
  64. package/dist/package-CX7pZToh.js +1 -0
  65. package/dist/{render-common-C70bnUVe.js → render-common-DwEiRIJ0.js} +1 -1
  66. package/dist/ssr/vue-ui-donut.js +1 -1
  67. package/dist/ssr/vue-ui-xy.js +1 -1
  68. package/dist/ssr.js +1 -1
  69. package/dist/vue-data-ui-CORn0LF6.js +1 -0
  70. package/dist/vue-data-ui.js +1 -1
  71. package/dist/{vue-ui-3d-bar-ljsy2rX6.js → vue-ui-3d-bar-CJTKyv3A.js} +1 -1
  72. package/dist/{vue-ui-age-pyramid-a6CK7z3a.js → vue-ui-age-pyramid-6uZzf1w6.js} +1 -1
  73. package/dist/{vue-ui-bullet-DX4A2Qwo.js → vue-ui-bullet-CsJcLhmV.js} +1 -1
  74. package/dist/{vue-ui-bump-IvRdB6MD.js → vue-ui-bump-DXpxBWp_.js} +1 -1
  75. package/dist/{vue-ui-candlestick-BgyUo13S.js → vue-ui-candlestick-Bn_RSZ0k.js} +1 -1
  76. package/dist/{vue-ui-carousel-table-D01DGfA0.js → vue-ui-carousel-table-ChNykS-r.js} +1 -1
  77. package/dist/{vue-ui-chestnut-DYrMSzmQ.js → vue-ui-chestnut-DMYQTkxM.js} +1 -1
  78. package/dist/{vue-ui-chord-CwzQ7QbP.js → vue-ui-chord-Pp0U0-zV.js} +1 -1
  79. package/dist/{vue-ui-circle-pack-DQHNM9sC.js → vue-ui-circle-pack-We23fOaF.js} +1 -1
  80. package/dist/{vue-ui-cursor-CTFfbDX8.js → vue-ui-cursor-3-RTIIl-.js} +1 -1
  81. package/dist/{vue-ui-dag-DF29_9Gg.js → vue-ui-dag-5fVnwEXd.js} +1 -1
  82. package/dist/{vue-ui-dashboard-D98rMHjI.js → vue-ui-dashboard-Dlwnintv.js} +1 -1
  83. package/dist/{vue-ui-digits-AoPCgSfP.js → vue-ui-digits-ZMK0aBxE.js} +1 -1
  84. package/dist/{vue-ui-donut-BYUkblpv.js → vue-ui-donut-CmLo1r4-.js} +1 -1
  85. package/dist/{vue-ui-donut-evolution-wxHDTKlg.js → vue-ui-donut-evolution-CYvo7Cww.js} +1 -1
  86. package/dist/vue-ui-donut-j1bv0KyD.js +22 -0
  87. package/dist/{vue-ui-dumbbell-DR7rjMt0.js → vue-ui-dumbbell-DigrSGwq.js} +1 -1
  88. package/dist/{vue-ui-flow-DtQlRSK_.js → vue-ui-flow-D9cc9yXD.js} +1 -1
  89. package/dist/{vue-ui-funnel-BP3chlZy.js → vue-ui-funnel-U88Hs0nL.js} +1 -1
  90. package/dist/{vue-ui-galaxy-B7ogrJ6f.js → vue-ui-galaxy-B1Vuz8CA.js} +1 -1
  91. package/dist/{vue-ui-gauge-CrmzNkjT.js → vue-ui-gauge-1MgZSPXt.js} +1 -1
  92. package/dist/{vue-ui-geo-BbTvWbfX.js → vue-ui-geo-BV8ARcaX.js} +1 -1
  93. package/dist/{vue-ui-gizmo-C3wgMKwb.js → vue-ui-gizmo-DtsERB-E.js} +1 -1
  94. package/dist/{vue-ui-graph-CzUVEiO-.js → vue-ui-graph-BVTPTDl5.js} +1 -1
  95. package/dist/{vue-ui-heatmap-BxR2ccwd.js → vue-ui-heatmap-6YwaVr3F.js} +1 -1
  96. package/dist/{vue-ui-hill-BDOd7LrC.js → vue-ui-hill-BvrNT8KZ.js} +1 -1
  97. package/dist/{vue-ui-history-plot-0-vs_CVn.js → vue-ui-history-plot-CJIILQPt.js} +1 -1
  98. package/dist/{vue-ui-horizontal-bar-C5pNTRKB.js → vue-ui-horizontal-bar-Dfo-kTqg.js} +1 -1
  99. package/dist/{vue-ui-kpi-Dfhsk0U1.js → vue-ui-kpi-DHfExr9d.js} +1 -1
  100. package/dist/{vue-ui-molecule-DUX1NUIY.js → vue-ui-molecule-C8e5IeHG.js} +1 -1
  101. package/dist/{vue-ui-mood-radar-B1N5AwX_.js → vue-ui-mood-radar-DsnT2U65.js} +1 -1
  102. package/dist/{vue-ui-nested-donuts-CfHH-cU6.js → vue-ui-nested-donuts-JkpqMhuL.js} +1 -1
  103. package/dist/{vue-ui-onion-DRN-jIvq.js → vue-ui-onion-CIA2tlff.js} +1 -1
  104. package/dist/{vue-ui-parallel-coordinate-plot-UUPjQABF.js → vue-ui-parallel-coordinate-plot-Bcr3B3NI.js} +1 -1
  105. package/dist/{vue-ui-quadrant-zmtzn0lM.js → vue-ui-quadrant-DKVFawhC.js} +1 -1
  106. package/dist/{vue-ui-quick-chart-DgU_IhKY.js → vue-ui-quick-chart-Bk2N8Hmd.js} +1 -1
  107. package/dist/{vue-ui-radar-BGSoxRaK.js → vue-ui-radar-CdH-BFKA.js} +1 -1
  108. package/dist/{vue-ui-relation-circle-XUw5UMrt.js → vue-ui-relation-circle-COZpOybS.js} +1 -1
  109. package/dist/{vue-ui-ridgeline-B5RJcFyA.js → vue-ui-ridgeline-MLknaTUO.js} +1 -1
  110. package/dist/{vue-ui-rings-BJaCLH2Q.js → vue-ui-rings-ARqLCM_P.js} +1 -1
  111. package/dist/{vue-ui-scatter-BA0hk_Tf.js → vue-ui-scatter-CX2wsXdE.js} +1 -1
  112. package/dist/{vue-ui-skeleton-DpzaXPO3.js → vue-ui-skeleton-wyvAru88.js} +1 -1
  113. package/dist/{vue-ui-spark-trend-DJ63XtgQ.js → vue-ui-spark-trend-C02PmIq_.js} +1 -1
  114. package/dist/{vue-ui-sparkbar-C5wP9R67.js → vue-ui-sparkbar-CjD57-Xi.js} +1 -1
  115. package/dist/{vue-ui-sparkgauge-DQcAOGuG.js → vue-ui-sparkgauge-8Eia8T2W.js} +1 -1
  116. package/dist/{vue-ui-sparkhistogram-BBiCxX6W.js → vue-ui-sparkhistogram-C-0f7XCl.js} +1 -1
  117. package/dist/{vue-ui-sparkline-B_GkB9V_.js → vue-ui-sparkline-BMMrpUPR.js} +1 -1
  118. package/dist/{vue-ui-sparkstackbar-DSRXhqhJ.js → vue-ui-sparkstackbar-BmgCVCKG.js} +1 -1
  119. package/dist/{vue-ui-stackbar-QjOQHbld.js → vue-ui-stackbar-G_zZRAa9.js} +1 -1
  120. package/dist/{vue-ui-stackline-CoII13bc.js → vue-ui-stackline-DchZoEAg.js} +1 -1
  121. package/dist/{vue-ui-strip-plot-d3UoFFrf.js → vue-ui-strip-plot-DVyPa3sp.js} +1 -1
  122. package/dist/{vue-ui-table-CHFjZzW7.js → vue-ui-table-qTF_q-Qu.js} +1 -1
  123. package/dist/{vue-ui-table-sparkline-BkZ7sn4X.js → vue-ui-table-sparkline-B2Q-7-GQ.js} +1 -1
  124. package/dist/{vue-ui-thermometer-B--g_Lkt.js → vue-ui-thermometer-CxNoxslq.js} +1 -1
  125. package/dist/{vue-ui-timer-DmwEWrDh.js → vue-ui-timer-DRjoRidI.js} +1 -1
  126. package/dist/{vue-ui-tiremarks-160Gx7-3.js → vue-ui-tiremarks-BC_YGp3T.js} +1 -1
  127. package/dist/{vue-ui-treemap-B-Yjtob0.js → vue-ui-treemap-CNM5ohoO.js} +1 -1
  128. package/dist/{vue-ui-waffle-BhzLg5ip.js → vue-ui-waffle-BiJshI4O.js} +1 -1
  129. package/dist/{vue-ui-wheel-DHb4G42X.js → vue-ui-wheel-BxR0_iNZ.js} +1 -1
  130. package/dist/{vue-ui-word-cloud-BcpreM7A.js → vue-ui-word-cloud-CZzC3R1K.js} +1 -1
  131. package/dist/{vue-ui-world-BD9acchj.js → vue-ui-world-CJgt0ESz.js} +1 -1
  132. package/dist/{vue-ui-xy-C-2Phexw.js → vue-ui-xy-B6XNUCzQ.js} +1 -1
  133. package/dist/{vue-ui-xy-CB3lQs2m.js → vue-ui-xy-DrKVPSg7.js} +1 -1
  134. package/package.json +1 -1
  135. package/dist/package-CgIKu3rP.js +0 -1
  136. package/dist/vue-data-ui-CrOhFey9.js +0 -1
  137. package/dist/vue-ui-donut-BQGnUso2.js +0 -22
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Dt as i,Ht as a,Jt as o,Lt as s,M as c,S as l,X as ee,Yt as te,Zt as ne,at as u,b as re,i as ie,in as ae,nn as oe,nt as se,pt as ce,t as le,w as ue,yt as de,zt as fe}from"./lib-rPeBMZrn.js";import{n as pe,t as me}from"./BaseScanner-8NdoBs7B.js";import{n as he}from"./useHints-C-TwxM0Y.js";import{t as ge}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as _e}from"./useNestedProp-DnGoh-XS.js";import{t as ve}from"./useThemeCheck-BKNRbGeC.js";import{t as ye}from"./chartImage-DPGnEuYM.js";import{n as be}from"./Title-BliHuXfT.js";import{t as xe}from"./useChartExport-BZts4KFb.js";import{n as Se,t as Ce}from"./tableIntegration-CNoJ1CIY.js";import{n as we,t as Te}from"./annotationSlots-BRR85CqJ.js";import{n as Ee,t as De}from"./userOptionsSlots-DYuo-E5m.js";import{t as Oe}from"./usePrinter-DVf3YcG5.js";import{c as ke}from"./canvas-lib-22VpOI4_.js";import{t as Ae}from"./useResponsive-CENUxfEL.js";import{t as je}from"./DefGrad-DKMq1REY.js";import{t as Me}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Ne}from"./A11yDataTable-DWNlWXzs.js";import{t as Pe}from"./useUserOptionState-CXlFnwPv.js";import{t as Fe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ie}from"./Legend-DM0ClX3D.js";import{t as Le}from"./useAutoSizeLabelsInsideViewbox-AIRF0PlD.js";import{t as Re}from"./vue_ui_radar-68iK9Fam.js";import{Fragment as d,Teleport as ze,computed as f,createBlock as p,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as Be,createTextVNode as Ve,createVNode as He,defineAsyncComponent as _,guardReactiveProps as v,mergeProps as Ue,nextTick as We,normalizeClass as Ge,normalizeProps as y,normalizeStyle as b,onBeforeUnmount as Ke,onMounted as qe,openBlock as x,ref as S,renderList as C,renderSlot as w,resolveDynamicComponent as Je,shallowRef as Ye,toDisplayString as T,toRefs as Xe,unref as E,watch as Ze,withCtx as D}from"vue";var Qe=/* @__PURE__ */ e({default:()=>kt}),$e=[`id`],et=[`id`],tt=[`id`],nt={style:{position:`relative`}},rt=[`xmlns`,`aria-describedby`,`viewBox`],it=[`width`,`height`],at={key:1},ot=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],st={key:0,style:{"pointer-events":`none`}},ct=[`d`,`stroke`,`stroke-width`],lt=[`d`,`stroke`,`stroke-width`],ut={key:2},dt=[`x`,`y`,`text-anchor`,`font-size`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],ft=[`points`,`stroke`,`stroke-width`],pt=[`points`,`stroke`,`stroke-width`,`fill`],mt=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],ht={key:4},gt=[`onMouseenter`,`onMouseleave`,`onClick`],_t=[`cx`,`cy`,`r`],vt=[`cx`,`cy`,`fill`,`r`,`stroke`],yt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},bt={key:5,class:`vue-data-ui-watermark`},xt=[`id`],St=[`onClick`],Ct={class:`vue-data-ui-legend-item`},wt=[`stroke`,`stroke-width`,`stroke-dasharray`],Tt={key:0,style:{"max-width":`200px`,margin:`0 auto`}},Et={class:`vue-ui-radar-tooltip-datalabel`,style:{width:`100%`}},Dt={class:`vue-ui-radar-tooltip-datalabel-name`},Ot={key:0},kt=/*#__PURE__*/ ge({__name:`vue-ui-radar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:ge,emit:Qe}){let kt=_(()=>import(`./Tooltip-C1q0Qoh7.js`)),At=_(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),jt=_(()=>import(`./vue-ui-sparkbar-C5wP9R67.js`).then(e=>e.n)),Mt=_(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Nt=_(()=>import(`./DataTable-0Vv-aGHD.js`)),Pt=_(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),Ft=_(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),It=_(()=>import(`./PackageVersion-CXT-eAuk.js`).then(e=>e.t)),Lt=_(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_radar:Rt}=t(),{isThemeValid:zt,warnInvalidTheme:Bt}=ve(),O=e,Vt=f(()=>!!O.dataset&&Object.keys(O.dataset).length),k=S(ee()),Ht=S(!1),Ut=S(``),Wt=S(0),A=S(null),Gt=S(null),Kt=S(null),qt=S(null),Jt=S(null),Yt=S(0),Xt=S(0),Zt=S(0),Qt=S(!1),$t=S(null),en=S(null),j=S(null),tn=S({x:0,y:0}),nn=S(`pointer`),rn=S(!1),M=S(dn()),N=f(()=>M.value.userOptions),P=f(()=>M.value.style.chart.layout.labels),F=f(()=>M.value.style.chart.layout),I=f(()=>M.value.style.chart.tooltip),L=f(()=>M.value.style.chart);he({config:()=>M.value,dataset:()=>O.dataset,component:`VueUiRadar`,rules:[{test:e=>e?.categories&&e.categories.length===0,message:[`👀 There are no categories in your dataset. Consider:`,``,`▶️ Adding categories...`]},{test:e=>e?.series&&e.series.length===0,message:[`👀 There are no series in your dataset. Consider:`,``,`▶️ Adding series...`]},{test:e=>e?.categories&&e.categories.length>3,message:[`👀 The number of categories > 3, the chart might become hard to read. Consider:`,``,`▶️ Using several instances of the component to display related categories.`,``,`▶️ Adding filters to allow users to choose a maximum number of categories.`]},{test:e=>e?.series&&e.series.length>12,message:[`👀 The number of series is > 12. Consider:`,``,`▶️ Using several instances of the component to distribute the series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``]}]});let R=f(()=>M.value.userOptions.useCursorPointer),an=f(()=>ae({defaultConfig:{userOptions:{show:!1},table:{show:!1},useCssAnimation:!1,style:{chart:{backgroundColor:`#99999930`,layout:{grid:{stroke:`#6A6A6A90`},labels:{dataLabels:{show:!1}},outerPolygon:{stroke:`#6A6A6A`}},legend:{backgroundColor:`transparent`}}}},userConfig:M.value.skeletonConfig??{}})),{loading:on,FINAL_DATASET:z}=pe({...Xe(O),FINAL_CONFIG:M,prepareConfig:dn,callback:()=>{Promise.resolve().then(async()=>{await We(),W.value.showTable=M.value.table.show})},skeletonDataset:O.config?.skeletonDataset??{categories:[{name:`_`,color:`#6A6A6A`}],series:[{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1}]},skeletonConfig:ae({defaultConfig:M.value,userConfig:an.value})}),{userOptionsVisible:sn,setUserOptionsVisibility:cn,keepUserOptionState:ln}=Pe({config:M.value}),{svgRef:B}=Fe({config:L.value.title});function un(e){return{...e,style:{...e.style,chart:{...e.style.chart,layout:{...e.style.chart.layout,grid:{rotate:0,...e.style.chart.layout.grid},labels:{...e.style.chart.layout.labels,dataLabels:{offset:0,...e.style.chart.layout.labels.dataLabels}}}}}}}function dn(){let e=un(_e({userConfig:O.config,defaultConfig:Rt})),t=e.theme;if(!t)return e;if(!zt.value(e))return Bt(e),e;let n=_e({userConfig:Re[t]||O.config,defaultConfig:e}),r=_e({userConfig:O.config,defaultConfig:n});return{...r,customPalette:r.customPalette.length?r.customPalette:oe[t]||a}}let fn=ne(O.config);Ze(()=>O.config,(e,t)=>{let n=ne(e),r=n!==fn;fn=n;let i=dn();r?(M.value=i,sn.value=!M.value.userOptions.showOnChartHover,pn(),Yt.value+=1,Xt.value+=1,Zt.value+=1,W.value.dataLabels.show=P.value.dataLabels.show,W.value.showTable=M.value.table.show,W.value.showTooltip=I.value?I.value.show:!1):(M.value.style.chart.tooltip=i.style.chart.tooltip,W.value.showTooltip=M.value.style.chart.tooltip.show)},{deep:!0});let V=Ye(null),H=Ye(null),U=f(()=>M.value.debug);function pn(){if(fe(O.dataset)&&u({componentName:`VueUiRadar`,type:`dataset`,debug:U.value}),M.value.responsive){let e=ke(()=>{let{width:e,height:t}=Ae({chart:A.value,title:L.value.title.text?Gt.value:null,legend:L.value.legend.show?Kt.value:null,source:qt.value,noTitle:Jt.value});requestAnimationFrame(()=>{G.value.width=e,G.value.height=t,Hn()})});V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect()),V.value=new ResizeObserver(e),H.value=A.value.parentNode,V.value.observe(H.value)}Hn()}qe(()=>{Qt.value=!0,pn()}),Ke(()=>{V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect())});let{isPrinting:mn,isImaging:hn,generatePdf:gn,generateImage:_n}=Oe({elementId:`vue-ui-radar_${k.value}`,fileName:L.value.title.text||`vue-ui-radar`,options:M.value.userOptions.print}),vn=f(()=>M.value.userOptions.show&&!L.value.title.text),yn=f(()=>ue(M.value.customPalette)),W=S({dataLabels:{show:P.value.dataLabels.show},showTable:M.value.table.show,showTooltip:I.value.show}),bn=f(()=>({style:{backgroundColor:`#FFFFFF00`,animation:{show:I.value.animation.show,animationFrames:I.value.animation.animationFrames},labels:{fontSize:I.value.fontSize,name:{color:I.value.color}},gutter:{backgroundColor:`#CCCCCC`,opacity:30}}})),G=S({height:312,width:512}),xn=Qe,K=S([]),Sn=S(null),q=S(!1);function Cn(){K.value.length?K.value=[]:Z.value.forEach((e,t)=>{K.value.push(t)}),wn()}function wn(){xn(`selectLegend`,Z.value.filter((e,t)=>!K.value.includes(t)).map(e=>({name:e.name,color:e.color,proportion:e.totalProportion})))}function Tn(e){q.value=!0,K.value.includes(e)?(Sn.value=e,K.value=K.value.filter(t=>t!==e),setTimeout(()=>{q.value=!1,Sn.value=null},500)):(K.value.push(e),setTimeout(()=>{q.value=!1},500)),wn()}function En(){return Z.value.map(e=>({name:e.name,color:e.color,proportion:e.totalProportion}))}function Dn(){let e=z.value;[null,void 0].includes(e?.categories)?(u({componentName:`VueUiRadar`,type:`dataset`,debug:U.value}),u({componentName:`VueUiRadar`,type:`datasetAttribute`,property:`categories ({ name: string; prefix?: string; suffix?: string}[])`,debug:U.value})):(e.categories.length===0?u({componentName:`VueUiRadar`,type:`datasetAttributeEmpty`,property:`categories`,debug:U.value}):U.value&&e.categories.forEach((e,t)=>{de({datasetObject:e,requiredAttributes:[`name`]}).forEach(e=>{u({componentName:`VueUiRadar`,type:`datasetAttribute`,property:`category.${e} at index ${t}`,index:t})})}),[null,void 0].includes(e?.series)?u({componentName:`VueUiRadar`,type:`datasetAttribute`,property:`series ({ name: string; values: number[]; color?: string; target: number}[])`,debug:U.value}):U.value&&e.series.forEach((e,t)=>{de({datasetObject:e,requiredAttributes:[`name`,`values`,`target`]}).forEach(e=>{u({componentName:`VueUiRadar`,type:`datasetSerieAttribute`,key:`series`,property:e,index:t})})}))}Ze(()=>z.value,()=>Dn(),{deep:!0,immediate:!0});let J=f(()=>{let e=Array.isArray(z.value?.categories)?z.value.categories:[],t=yn.value??a;return e.map((e,n)=>({name:e?.name??``,categoryId:`radar_category_${k.value}_${n}`,color:l(e?.color)||t[n]||a[n%a.length],prefix:e?.prefix??``,suffix:e?.suffix??``}))}),Y=f(()=>z.value.series.map((e,t)=>({...e,color:l(e.color)||yn.value[t]||a[t]||a[t%a.length],serieId:`radar_serie_${k.value}_${t}`,formatter:e.formatter||null,absoluteIndex:t})));function On(e){return Y.value.length?Z.value.find(t=>t.name===e)||(U.value&&console.warn(`VueUiRadar - Series name not found "${e}"`),null):(U.value&&console.warn(`VueUiRadar - There are no series to show.`),null)}function kn(e){let t=On(e);t!==null&&K.value.includes(t.absoluteIndex)&&Tn(t.absoluteIndex)}function An(e){let t=On(e);t!==null&&(K.value.includes(t.absoluteIndex)||Tn(t.absoluteIndex))}let jn=f(()=>Math.max(0,...Y.value.flatMap(e=>e.values)));function Mn(e){return F.value.scaleToAxisMax?Math.max(1,e.target||0,...e.values):e.target||jn.value||1}let Nn=f(()=>Y.value.map((e,t)=>{let n=Rn.value.coordinates[t];return Un({centerX:G.value.width/2,centerY:G.value.height/2,apexX:n.x,apexY:n.y,proportion:(e.target||0)/Mn(e)})})),Pn=f(()=>Y.value.length),Fn=f(()=>Math.min(G.value.width,G.value.height)/3),In=f(()=>{let e=Number(F.value.plots.radius??0);return Math.max(Number.isFinite(e)?e*2.5:0,10)}),Ln=f(()=>{let e=Number(F.value.grid.rotation??0);return Number.isFinite(e)?e*Math.PI/180:0}),Rn=f(()=>c({plot:{x:G.value.width/2,y:G.value.height/2},radius:Fn.value,sides:Pn.value,rotation:Ln.value})),zn=f(()=>{let e=[];for(let t=0;t<Fn.value;t+=Fn.value/F.value.grid.graduations)e.push(t);return e}),X=f(()=>Rn.value.coordinates.map((e,t)=>{let n=Y.value[t],r=Y.value[t].values.map(t=>Un({centerX:G.value.width/2,centerY:G.value.height/2,apexX:e.x,apexY:e.y,proportion:t/Mn(n)}));return{...e,...n,plots:r}}).map(e=>({...e,labelX:Bn(e).x,labelY:Bn(e).y,labelAnchor:Bn(e).anchor})));function Bn({x:e,y:t}){let n=G.value.width/2,r=G.value.height/2,i=e-n,a=t-r,o=Math.hypot(i,a),s=Number(P.value.dataLabels.offset??0),c=20+(Number.isFinite(s)?s:0);if(!o)return{x:e,y:t,anchor:`middle`};let l=i/o,ee=a/o,te=`middle`;return l>.01?te=`start`:l<-.01&&(te=`end`),{x:e+l*c,y:t+ee*c,anchor:te}}let Vn=f({get:()=>P.value.dataLabels.fontSize,set:e=>e}),{autoSizeLabels:Hn}=Le({svgRef:B,fontSize:P.value.dataLabels.fontSize,minFontSize:6,sizeRef:Vn,labelClass:`.vue-ui-radar-apex-label`});function Un({centerX:e,centerY:t,apexX:n,apexY:r,proportion:i}){return{x:e+(n-e)*i,y:t+(r-t)*i}}let Z=f(()=>{let e=Y.value.map((e,t)=>e.values.map(t=>t/(e.target||jn.value)));return J.value.map((t,r)=>{let i=re(e.map(e=>e[r]).reduce((e,t)=>e+t,0)/Y.value.length);return{...t,absoluteIndex:r,totalProportion:i,shape:`circle`,opacity:K.value.includes(r)?.5:1,segregate:()=>Tn(r),isSegregated:K.value.includes(r),display:`${t.name}: ${n({v:(i??0)*100,s:`%`,r:L.value.legend.roundingPercentage})}`}})}),Wn=f(()=>({cy:`radar-div-legend`,backgroundColor:L.value.legend.backgroundColor,color:L.value.legend.color,fontSize:L.value.legend.fontSize,paddingBottom:12,fontWeight:L.value.legend.bold?`bold`:``})),Q=f(()=>{let e=[{name:M.value.translations.datapoint,color:``},{name:M.value.translations.target,color:``},...Z.value];return{head:e,body:z.value.series.map(e=>[e.name,ie(e.formatter,e.target,n({p:e.prefix,v:e.target,s:e.suffix,r:M.value.table.td.roundingValue})),...e.values.map((t,r)=>`${ie(e.formatter,t,n({p:J.value[r]?.prefix??``,v:t,s:J.value[r]?.suffix??``,r:M.value.table.td.roundingValue}))} (${isNaN(t/e.target)?``:n({v:t/e.target*100,s:`%`,r:M.value.table.td.roundingPercentage})})`)]),config:{th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint},colNames:e}}),Gn=S(null),Kn=S([]),qn=S(null);function Jn(e,t){Ht.value=!1,Gn.value=null,j.value=null,nn.value=`pointer`,M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Yn(e,t){M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Xn(e,t,r=`pointer`){M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:e,seriesIndex:t}),nn.value=r,j.value=t;let a=J.value.slice();Kn.value=[],Gn.value=t,Ht.value=!0,qn.value={datapoint:e,seriesIndex:t,series:{categories:a,datapoints:Y.value,radar:X.value},config:M.value};let o=I.value.customFormat;if(i(o)&&ce(()=>o({seriesIndex:t,datapoint:e,series:{categories:a,datapoints:Y.value,radar:X.value},config:M.value})))Ut.value=o({seriesIndex:t,datapoint:e,series:{categories:a,datapoints:Y.value,radar:X.value},config:M.value});else{Ut.value=`<div style="width:100%;text-align:center;border-bottom:1px solid ${I.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`;for(let t=0;t<e.values.length;t+=1)if(!K.value.includes(t)){let r=a[t],i=e.values[t],o=isNaN(i/e.target)?0:i/e.target*100,s=ie(e.formatter,i,n({p:J.value[t].prefix,v:i,s:J.value[t].suffix,r:I.value.roundingValue}),{datapoint:e}),c=n({v:o,s:`%`,r:I.value.roundingPercentage}),l=I.value.showValue&&I.value.showPercentage?`${s} (${c})`:I.value.showValue&&!I.value.showPercentage?s:!I.value.showValue&&I.value.showPercentage?`${c}`:``;Kn.value.push({name:r?.name??`#${t+1}`,value:e.values[t]/e.target*100,color:r?.color,suffix:l,prefix:``,rounding:I.value.roundingPercentage,formatter:e.formatter})}}}function Zn(e=null){We(()=>{let t=[[L.value.title.text],[L.value.title.subtitle.text],[``]],n=[[``],[M.value.translations.target],...Z.value.flatMap(e=>[[e.name],[`%`]])],i=z.value.series.map((e,t)=>[e.name,e.target,...e.values.flatMap(t=>[t,isNaN(t/e.target)?``:t/e.target*100])]),a=t.concat([n]).concat(i),o=r(a);e?e(o):se({csvContent:o,title:L.value.title.text||`vue-ui-radar`})})}let $=S(!1);function Qn(e){$.value=e,Wt.value+=1}function $n(){W.value.showTable=!W.value.showTable}function er(){W.value.showTooltip=!W.value.showTooltip}let tr=S(!1);function nr(){tr.value=!tr.value}let rr=ye(A,()=>L.value.title.text),ir=f(()=>Ce({config:M,style:L,mutableConfig:W,dialog:Lt,accordion:Mt,isFullscreen:$,parent:A,maxWidth:800,isCursorPointer:R}));Ze(()=>W.value.showTable,e=>Se(e,M,$t));function ar(){W.value.showTable=!1,en.value&&en.value.setTableIconState(!1)}let or=f(()=>Z.value.map(e=>({...e,name:e.display}))),sr=f(()=>L.value.backgroundColor),cr=f(()=>L.value.legend),lr=f(()=>L.value.title),{isCallbackImaging:ur,isCallbackSvg:dr,generateSvg:fr,onGenerateImage:pr}=xe({svg:B,title:lr,legend:cr,legendItems:or,backgroundColor:sr,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:_n});async function mr(){xn(`copyAlt`,{config:M.value,dataset:X.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:X.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function hr(){j.value=null,rn.value=!0}function gr(){j.value=null,nn.value=`pointer`,Ht.value=!1,Gn.value=null,rn.value=!1}function _r(e){if(!Number.isFinite(e)||!B.value)return;let t=X.value[e];if(!t)return;let n=B.value.getBoundingClientRect();tn.value={x:n.left+t.labelX/G.value.width*n.width,y:n.top+t.labelY/G.value.height*n.height}}function vr(e){if(!B.value||tr.value||document.activeElement!==B.value||!X.value.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){j.value=null,nn.value=`pointer`,Ht.value=!1,Gn.value=null;return}if(r){if(j.value===null)return;let e=X.value[j.value];if(!e)return;Yn(e,j.value);return}let a=j.value;a===null||a<0||a>=X.value.length?a=n?0:X.value.length-1:n?(a+=1,a>=X.value.length&&(a=0)):t&&(--a,a<0&&(a=X.value.length-1));let o=X.value[a];o&&(j.value=a,_r(a),Xn(o,a,`keyboard`))}let yr=f(()=>({headers:Q.value?.colNames?.map(e=>e.name??e)??[],rows:Q.value?.body??[]}));return ge({getData:En,getImage:rr,generatePdf:gn,generateCsv:Zn,generateImage:_n,generateSvg:fr,hideSeries:An,showSeries:kn,toggleTable:$n,toggleTooltip:er,toggleAnnotator:nr,toggleFullscreen:Qn,copyAlt:mr}),(e,t)=>(x(),h(`div`,{class:Ge(`vue-data-ui-component vue-ui-radar ${$.value?`vue-data-ui-wrapper-fullscreen`:``} ${M.value.useCssAnimation?``:`vue-ui-dna`}`),ref_key:`radarChart`,ref:A,id:`vue-ui-radar_${k.value}`,style:b(`font-family:${M.value.style.fontFamily};width:100%; ${M.value.responsive?`height: 100%;`:``} text-align:center;background:${L.value.backgroundColor}`),onMouseenter:t[2]||=()=>E(cn)(!0),onMouseleave:t[3]||=()=>E(cn)(!1)},[g(`div`,{id:`chart-instructions-${k.value}`,class:`sr-only`},[g(`p`,null,T(M.value.a11y.translations.keyboardNavigation),1)],8,et),yr.value?.rows?.length?(x(),p(Ne,{key:0,uid:k.value,head:yr.value.headers,body:yr.value.rows,notice:M.value.a11y.translations.tableAvailable,caption:M.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):m(``,!0),N.value.buttons.annotator?(x(),p(E(Pt),{key:1,svgRef:E(B),backgroundColor:L.value.backgroundColor,color:L.value.color,active:tr.value,isCursorPointer:R.value,palette:N.value.annotatorPalette,onClose:nr},Be({_:2},[C(E(Te),t=>({name:t,fn:D(n=>[w(e.$slots,t,y(v(E(we)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):m(``,!0),vn.value?(x(),h(`div`,{key:2,ref_key:`noTitle`,ref:Jt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):m(``,!0),L.value.title.text?(x(),h(`div`,{key:3,ref_key:`chartTitle`,ref:Gt,style:`width:100%;background:transparent;padding-bottom:12px`},[(x(),p(be,{key:`title_${Yt.value}`,config:{title:{cy:`radar-div-title`,...L.value.title},subtitle:{cy:`radar-div-subtitle`,...L.value.title.subtitle}}},null,8,[`config`]))],512)):m(``,!0),g(`div`,{id:`legend-top-${k.value}`},null,8,tt),N.value.show&&Vt.value&&(E(ln)||E(sn))?(x(),p(E(Ft),{ref_key:`userOptionsRef`,ref:en,key:`user_options_${Wt.value}`,backgroundColor:L.value.backgroundColor,color:L.value.color,isImaging:E(hn),isPrinting:E(mn),uid:k.value,hasTooltip:N.value.buttons.tooltip&&I.value.show,hasPdf:N.value.buttons.pdf,hasImg:N.value.buttons.img,hasSvg:N.value.buttons.svg,hasXls:N.value.buttons.csv,hasTable:N.value.buttons.table,hasFullscreen:N.value.buttons.fullscreen,hasAltCopy:N.value.buttons.altCopy,isFullscreen:$.value,isTooltip:W.value.showTooltip,titles:{...N.value.buttonTitles},chartElement:A.value,position:N.value.position,hasAnnotator:N.value.buttons.annotator,isAnnotation:tr.value,callbacks:N.value.callbacks,printScale:N.value.print.scale,tableDialog:M.value.table.useDialog,isCursorPointer:R.value,onToggleFullscreen:Qn,onGeneratePdf:E(gn),onGenerateCsv:Zn,onGenerateImage:E(pr),onGenerateSvg:E(fr),onToggleTable:$n,onToggleTooltip:er,onToggleAnnotator:nr,onCopyAlt:mr,style:b({visibility:E(ln)?E(sn)?`visible`:`hidden`:`visible`})},Be({_:2},[C(E(Ee)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:D(n=>[w(e.$slots,t,y(v(E(De)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasTooltip.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):m(``,!0),g(`div`,nt,[(x(),h(`svg`,{ref_key:`svgRef`,ref:B,xmlns:E(le),"aria-describedby":`chart-instructions-${k.value}`,class:Ge({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value}),viewBox:`0 0 ${G.value.width<=0?10:G.value.width} ${G.value.height<=0?10:G.value.height}`,style:b(`max-width:100%;overflow:visible;background:transparent;color:${L.value.color}`),tabindex:`0`,onFocus:hr,onBlur:gr,onKeydown:vr},[He(E(It)),w(e.$slots,`svg-underlayer`,{svg:{...G.value,outerPolygon:Rn.value,isPrintingImg:E(mn)||E(hn)||E(ur),isPrintingSvg:E(dr)}},void 0,!0),e.$slots[`chart-background`]?(x(),h(`foreignObject`,{key:0,x:0,y:0,width:G.value.width<=0?10:G.value.width,height:G.value.height<=0?10:G.value.height,style:{pointerEvents:`none`}},[w(e.$slots,`chart-background`,{},void 0,!0)],8,it)):m(``,!0),g(`defs`,null,[(x(!0),h(d,null,C(J.value,(e,t)=>(x(),p(je,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`radar_gradient_${k.value}_${t}`,key:`radar_gradient_${k.value}_${t}`,stops:[[`0%`,E(o)(E(te)(e.color,.05),F.value.dataPolygon.opacity),1],[`100%`,E(o)(e.color,F.value.dataPolygon.opacity),1]]},null,8,[`id`,`stops`]))),128))]),F.value.grid.show?(x(),h(`g`,at,[(x(!0),h(d,null,C(X.value,e=>(x(),h(`line`,{x1:G.value.width/2,y1:G.value.height/2,x2:e.x,y2:e.y,stroke:F.value.grid.stroke,"stroke-width":F.value.grid.strokeWidth,style:{"pointer-events":`none`}},null,8,ot))),256)),F.value.grid.graduations>0?(x(),h(`g`,st,[(x(!0),h(d,null,C(zn.value,e=>(x(),h(`path`,{d:E(c)({plot:{x:G.value.width/2,y:G.value.height/2},radius:e,sides:Pn.value,rotation:Ln.value}).path,fill:`none`,stroke:F.value.grid.stroke,"stroke-width":F.value.grid.strokeWidth},null,8,ct))),256))])):m(``,!0)])):m(``,!0),g(`path`,{d:Rn.value.path,fill:`none`,stroke:F.value.outerPolygon.stroke,"stroke-width":F.value.outerPolygon.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,style:{"pointer-events":`none`}},null,8,lt),P.value.dataLabels.show?(x(),h(`g`,ut,[(x(!0),h(d,null,C(X.value,(e,t)=>(x(),h(`text`,{class:`vue-ui-radar-apex-label`,x:e.labelX,y:e.labelY,"text-anchor":e.labelAnchor,"dominant-baseline":`middle`,"font-size":P.value.dataLabels.fontSize,fill:P.value.dataLabels.color,onMouseenter:n=>Xn(e,t,`pointer`),onMouseleave:n=>Jn(e,t),onClick:n=>Yn(e,t)},T(e.name),41,dt))),256))])):m(``,!0),(x(!0),h(d,null,C(J.value,(e,t)=>(x(),h(`g`,null,[g(`g`,null,[M.value.useCssAnimation||!M.value.useCssAnimation&&!K.value.includes(t)?(x(),h(`polygon`,{key:0,points:E(s)(X.value.map(e=>e.plots[t]),!1,!0),stroke:L.value.backgroundColor,"stroke-width":F.value.dataPolygon.strokeWidth+1,fill:`none`,class:Ge({"animated-out":K.value.includes(t)&&M.value.useCssAnimation,"animated-in":q.value&&Sn.value===t&&M.value.useCssAnimation}),style:{"pointer-events":`none`}},null,10,ft)):m(``,!0),M.value.useCssAnimation||!M.value.useCssAnimation&&!K.value.includes(t)?(x(),h(`polygon`,{key:1,points:E(s)(X.value.map(e=>e.plots[t]),!1,!0),stroke:e.color,"stroke-width":F.value.dataPolygon.strokeWidth,fill:F.value.dataPolygon.transparent?`transparent`:F.value.dataPolygon.useGradient?`url(#radar_gradient_${k.value}_${t})`:E(o)(e.color,F.value.dataPolygon.opacity),class:Ge({"animated-out":K.value.includes(t)&&M.value.useCssAnimation,"animated-in":q.value&&Sn.value===t&&M.value.useCssAnimation}),style:{"pointer-events":`none`}},null,10,pt)):m(``,!0)])]))),256)),F.value.targetReference.show?(x(),h(`path`,{key:3,class:`vue-ui-radar-target-polygon`,d:`M${E(s)(Nn.value,!1,!0)}Z`,fill:`none`,stroke:F.value.targetReference.stroke,"stroke-width":F.value.targetReference.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,"stroke-dasharray":F.value.targetReference.strokeDasharray,style:{"pointer-events":`none`}},null,8,mt)):m(``,!0),F.value.plots.show?(x(),h(`g`,ht,[(x(!0),h(d,null,C(X.value,(e,t)=>(x(),h(`g`,{key:`radar-category-${t}`},[(x(!0),h(d,null,C(e.plots,(n,r)=>(x(),h(`g`,{key:`radar-plot-${t}-${r}`,onMouseenter:n=>!K.value.includes(r)&&Xn(e,t,`pointer`),onMouseleave:n=>!K.value.includes(r)&&Jn(e,t),onClick:n=>!K.value.includes(r)&&Yn(e,t)},[g(`circle`,{cx:n.x,cy:n.y,r:In.value,fill:`transparent`,stroke:`transparent`,style:b({pointerEvents:K.value.includes(r)?`none`:`all`})},null,12,_t),g(`circle`,{cx:n.x,cy:n.y,fill:K.value.includes(r)?`transparent`:J.value[r]?J.value[r].color:`transparent`,r:Gn.value!==null&&Gn.value===t?F.value.plots.radius*1.6:F.value.plots.radius,stroke:K.value.includes(r)?`transparent`:L.value.backgroundColor,"stroke-width":.5,class:Ge({"animated-out":K.value.includes(r)&&M.value.useCssAnimation,"animated-in":q.value&&Sn.value===r&&M.value.useCssAnimation}),style:{"pointer-events":`none`}},null,10,vt)],40,gt))),128))]))),128))])):m(``,!0),w(e.$slots,`svg`,{svg:{...G.value,outerPolygon:Rn.value,isPrintingImg:E(mn)||E(hn)||E(ur),isPrintingSvg:E(dr)}},void 0,!0)],46,rt)),e.$slots.hint?(x(),h(`div`,yt,[w(e.$slots,`hint`,y(v({hint:M.value.a11y.translations.keyboardNavigation,isVisible:rn.value})),void 0,!0)])):m(``,!0)]),e.$slots.watermark?(x(),h(`div`,bt,[w(e.$slots,`watermark`,y(v({isPrinting:E(mn)||E(hn)||E(ur)||E(dr)})),void 0,!0)])):m(``,!0),g(`div`,{id:`legend-bottom-${k.value}`},null,8,xt),Qt.value&&(L.value.legend.show||e.$slots.legend)?(x(),p(ze,{key:6,to:L.value.legend.position===`top`?`#legend-top-${k.value}`:`#legend-bottom-${k.value}`},[g(`div`,{ref_key:`chartLegend`,ref:Kt},[w(e.$slots,`legend`,{legend:Z.value},()=>[L.value.legend.show?(x(),p(Ie,{key:`legend_${Zt.value}`,legendSet:Z.value,config:Wn.value,isCursorPointer:R.value,onClickMarker:t[0]||=({i:e})=>Tn(e)},Be({item:D(({legend:e,index:t})=>[E(on)?m(``,!0):(x(),h(`div`,{key:0,onClick:t=>e.segregate(),style:b(`opacity:${K.value.includes(t)?.5:1}`)},T(e.display),13,St))]),legendToggle:D(()=>[Z.value.length>2&&L.value.legend.selectAllToggle.show&&!E(on)?(x(),p(Me,{key:0,backgroundColor:L.value.legend.selectAllToggle.backgroundColor,color:L.value.legend.selectAllToggle.color,fontSize:L.value.legend.fontSize,checked:K.value.length>0,isCursorPointer:R.value,onToggle:Cn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):m(``,!0)]),_:2},[F.value.targetReference.show&&F.value.targetReference.showInLegend?{name:`after`,fn:D(()=>[g(`div`,Ct,[g(`div`,{style:b({display:`flex`,height:L.value.legend.fontSize})},[(x(),h(`svg`,{style:b({width:L.value.legend.fontSize*2}),viewBox:`0 0 16 8`},[g(`line`,{x1:`0`,x2:`16`,y1:`4`,y2:`4`,stroke:F.value.targetReference.stroke,"stroke-width":F.value.targetReference.strokeWidth*.7,"stroke-dasharray":F.value.targetReference.strokeDasharray*.7,"stroke-linecap":`round`},null,8,wt)],4))],4),g(`span`,null,T(F.value.targetReference.legendLabel),1)])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):m(``,!0)],!0)],512)],8,[`to`])):m(``,!0),e.$slots.source?(x(),h(`div`,{key:7,ref_key:`source`,ref:qt,dir:`auto`},[w(e.$slots,`source`,{},void 0,!0)],512)):m(``,!0),He(E(kt),{teleportTo:I.value.teleportTo,show:W.value.showTooltip&&Ht.value,backgroundColor:I.value.backgroundColor,color:I.value.color,borderRadius:I.value.borderRadius,borderColor:I.value.borderColor,borderWidth:I.value.borderWidth,backgroundOpacity:I.value.backgroundOpacity,fontSize:I.value.fontSize,position:I.value.position,offsetX:I.value.offsetX,offsetY:I.value.offsetY,parent:A.value,content:Ut.value,isFullscreen:$.value,isCustom:I.value.customFormat&&typeof I.value.customFormat==`function`,smooth:I.value.smooth,backdropFilter:I.value.backdropFilter,smoothForce:I.value.smoothForce,smoothSnapThreshold:I.value.smoothSnapThreshold,isA11yMode:nn.value===`keyboard`,a11yPosition:tn.value},{"tooltip-before":D(()=>[w(e.$slots,`tooltip-before`,y(v({...qn.value})),void 0,!0)]),tooltip:D(()=>[w(e.$slots,`tooltip`,y(v({...qn.value})),void 0,!0)]),"tooltip-after":D(()=>[![`function`].includes(typeof I.value.customFormat)&&!e.$slots.tooltip?(x(),h(`div`,Tt,[He(E(jt),{dataset:Kn.value,config:bn.value,backgroundOpacity:0},{"data-label":D(({bar:e})=>[g(`div`,Et,[g(`span`,Dt,T(e.name+(I.value.showValue||I.value.showPercentage?`:`:``)),1),I.value.showValue||I.value.showPercentage?(x(),h(`span`,Ot,T(e.suffix),1)):m(``,!0)])]),_:1},8,[`dataset`,`config`])])):m(``,!0),w(e.$slots,`tooltip-after`,y(v({...qn.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`fontSize`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),Vt.value&&N.value.buttons.table?(x(),p(Je(ir.value.component),Ue({key:8},ir.value.props,{ref_key:`tableUnit`,ref:$t,onClose:ar}),Be({content:D(()=>[(x(),p(E(Nt),{key:`table_${Xt.value}`,colNames:Q.value.colNames,head:Q.value.head,body:Q.value.body,config:Q.value.config,title:M.value.table.useDialog?``:ir.value.title,withCloseButton:!M.value.table.useDialog,isCursorPointer:R.value,onClose:ar},{th:D(({th:e})=>[Ve(T(e.name),1)]),td:D(({td:e})=>[Ve(T(e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[M.value.table.useDialog?{name:`title`,fn:D(()=>[Ve(T(ir.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:D(()=>[g(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>Zn(N.value.callbacks.csv),style:b({cursor:R.value?`pointer`:`default`})},[He(E(At),{name:`fileCsv`,stroke:ir.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):m(``,!0),w(e.$slots,`skeleton`,{},()=>[E(on)?(x(),p(me,{key:0})):m(``,!0)],!0)],46,$e))}},[[`__scopeId`,`data-v-7d944bac`]]);export{Qe as n,kt as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Dt as i,Ht as a,Jt as o,Lt as s,M as c,S as l,X as ee,Yt as te,Zt as ne,at as u,b as re,i as ie,in as ae,nn as oe,nt as se,pt as ce,t as le,w as ue,yt as de,zt as fe}from"./lib-rPeBMZrn.js";import{n as pe,t as me}from"./BaseScanner-8NdoBs7B.js";import{n as he}from"./useHints-C-TwxM0Y.js";import{t as ge}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as _e}from"./useNestedProp-DnGoh-XS.js";import{t as ve}from"./useThemeCheck-BKNRbGeC.js";import{t as ye}from"./chartImage-DPGnEuYM.js";import{n as be}from"./Title-BliHuXfT.js";import{t as xe}from"./useChartExport-BZts4KFb.js";import{n as Se,t as Ce}from"./tableIntegration-CNoJ1CIY.js";import{n as we,t as Te}from"./annotationSlots-BRR85CqJ.js";import{n as Ee,t as De}from"./userOptionsSlots-DYuo-E5m.js";import{t as Oe}from"./usePrinter-DVf3YcG5.js";import{c as ke}from"./canvas-lib-22VpOI4_.js";import{t as Ae}from"./useResponsive-CENUxfEL.js";import{t as je}from"./DefGrad-DKMq1REY.js";import{t as Me}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Ne}from"./A11yDataTable-DWNlWXzs.js";import{t as Pe}from"./useUserOptionState-CXlFnwPv.js";import{t as Fe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ie}from"./Legend-DM0ClX3D.js";import{t as Le}from"./useAutoSizeLabelsInsideViewbox-AIRF0PlD.js";import{t as Re}from"./vue_ui_radar-68iK9Fam.js";import{Fragment as d,Teleport as ze,computed as f,createBlock as p,createCommentVNode as m,createElementBlock as h,createElementVNode as g,createSlots as Be,createTextVNode as Ve,createVNode as He,defineAsyncComponent as _,guardReactiveProps as v,mergeProps as Ue,nextTick as We,normalizeClass as Ge,normalizeProps as y,normalizeStyle as b,onBeforeUnmount as Ke,onMounted as qe,openBlock as x,ref as S,renderList as C,renderSlot as w,resolveDynamicComponent as Je,shallowRef as Ye,toDisplayString as T,toRefs as Xe,unref as E,watch as Ze,withCtx as D}from"vue";var Qe=/* @__PURE__ */ e({default:()=>kt}),$e=[`id`],et=[`id`],tt=[`id`],nt={style:{position:`relative`}},rt=[`xmlns`,`aria-describedby`,`viewBox`],it=[`width`,`height`],at={key:1},ot=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],st={key:0,style:{"pointer-events":`none`}},ct=[`d`,`stroke`,`stroke-width`],lt=[`d`,`stroke`,`stroke-width`],ut={key:2},dt=[`x`,`y`,`text-anchor`,`font-size`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],ft=[`points`,`stroke`,`stroke-width`],pt=[`points`,`stroke`,`stroke-width`,`fill`],mt=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],ht={key:4},gt=[`onMouseenter`,`onMouseleave`,`onClick`],_t=[`cx`,`cy`,`r`],vt=[`cx`,`cy`,`fill`,`r`,`stroke`],yt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},bt={key:5,class:`vue-data-ui-watermark`},xt=[`id`],St=[`onClick`],Ct={class:`vue-data-ui-legend-item`},wt=[`stroke`,`stroke-width`,`stroke-dasharray`],Tt={key:0,style:{"max-width":`200px`,margin:`0 auto`}},Et={class:`vue-ui-radar-tooltip-datalabel`,style:{width:`100%`}},Dt={class:`vue-ui-radar-tooltip-datalabel-name`},Ot={key:0},kt=/*#__PURE__*/ ge({__name:`vue-ui-radar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:ge,emit:Qe}){let kt=_(()=>import(`./Tooltip-C1q0Qoh7.js`)),At=_(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),jt=_(()=>import(`./vue-ui-sparkbar-CjD57-Xi.js`).then(e=>e.n)),Mt=_(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Nt=_(()=>import(`./DataTable-0Vv-aGHD.js`)),Pt=_(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),Ft=_(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),It=_(()=>import(`./PackageVersion-DhptF5oD.js`).then(e=>e.t)),Lt=_(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_radar:Rt}=t(),{isThemeValid:zt,warnInvalidTheme:Bt}=ve(),O=e,Vt=f(()=>!!O.dataset&&Object.keys(O.dataset).length),k=S(ee()),Ht=S(!1),Ut=S(``),Wt=S(0),A=S(null),Gt=S(null),Kt=S(null),qt=S(null),Jt=S(null),Yt=S(0),Xt=S(0),Zt=S(0),Qt=S(!1),$t=S(null),en=S(null),j=S(null),tn=S({x:0,y:0}),nn=S(`pointer`),rn=S(!1),M=S(dn()),N=f(()=>M.value.userOptions),P=f(()=>M.value.style.chart.layout.labels),F=f(()=>M.value.style.chart.layout),I=f(()=>M.value.style.chart.tooltip),L=f(()=>M.value.style.chart);he({config:()=>M.value,dataset:()=>O.dataset,component:`VueUiRadar`,rules:[{test:e=>e?.categories&&e.categories.length===0,message:[`👀 There are no categories in your dataset. Consider:`,``,`▶️ Adding categories...`]},{test:e=>e?.series&&e.series.length===0,message:[`👀 There are no series in your dataset. Consider:`,``,`▶️ Adding series...`]},{test:e=>e?.categories&&e.categories.length>3,message:[`👀 The number of categories > 3, the chart might become hard to read. Consider:`,``,`▶️ Using several instances of the component to display related categories.`,``,`▶️ Adding filters to allow users to choose a maximum number of categories.`]},{test:e=>e?.series&&e.series.length>12,message:[`👀 The number of series is > 12. Consider:`,``,`▶️ Using several instances of the component to distribute the series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``]}]});let R=f(()=>M.value.userOptions.useCursorPointer),an=f(()=>ae({defaultConfig:{userOptions:{show:!1},table:{show:!1},useCssAnimation:!1,style:{chart:{backgroundColor:`#99999930`,layout:{grid:{stroke:`#6A6A6A90`},labels:{dataLabels:{show:!1}},outerPolygon:{stroke:`#6A6A6A`}},legend:{backgroundColor:`transparent`}}}},userConfig:M.value.skeletonConfig??{}})),{loading:on,FINAL_DATASET:z}=pe({...Xe(O),FINAL_CONFIG:M,prepareConfig:dn,callback:()=>{Promise.resolve().then(async()=>{await We(),W.value.showTable=M.value.table.show})},skeletonDataset:O.config?.skeletonDataset??{categories:[{name:`_`,color:`#6A6A6A`}],series:[{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1},{name:`_`,values:[.6],target:1}]},skeletonConfig:ae({defaultConfig:M.value,userConfig:an.value})}),{userOptionsVisible:sn,setUserOptionsVisibility:cn,keepUserOptionState:ln}=Pe({config:M.value}),{svgRef:B}=Fe({config:L.value.title});function un(e){return{...e,style:{...e.style,chart:{...e.style.chart,layout:{...e.style.chart.layout,grid:{rotate:0,...e.style.chart.layout.grid},labels:{...e.style.chart.layout.labels,dataLabels:{offset:0,...e.style.chart.layout.labels.dataLabels}}}}}}}function dn(){let e=un(_e({userConfig:O.config,defaultConfig:Rt})),t=e.theme;if(!t)return e;if(!zt.value(e))return Bt(e),e;let n=_e({userConfig:Re[t]||O.config,defaultConfig:e}),r=_e({userConfig:O.config,defaultConfig:n});return{...r,customPalette:r.customPalette.length?r.customPalette:oe[t]||a}}let fn=ne(O.config);Ze(()=>O.config,(e,t)=>{let n=ne(e),r=n!==fn;fn=n;let i=dn();r?(M.value=i,sn.value=!M.value.userOptions.showOnChartHover,pn(),Yt.value+=1,Xt.value+=1,Zt.value+=1,W.value.dataLabels.show=P.value.dataLabels.show,W.value.showTable=M.value.table.show,W.value.showTooltip=I.value?I.value.show:!1):(M.value.style.chart.tooltip=i.style.chart.tooltip,W.value.showTooltip=M.value.style.chart.tooltip.show)},{deep:!0});let V=Ye(null),H=Ye(null),U=f(()=>M.value.debug);function pn(){if(fe(O.dataset)&&u({componentName:`VueUiRadar`,type:`dataset`,debug:U.value}),M.value.responsive){let e=ke(()=>{let{width:e,height:t}=Ae({chart:A.value,title:L.value.title.text?Gt.value:null,legend:L.value.legend.show?Kt.value:null,source:qt.value,noTitle:Jt.value});requestAnimationFrame(()=>{G.value.width=e,G.value.height=t,Hn()})});V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect()),V.value=new ResizeObserver(e),H.value=A.value.parentNode,V.value.observe(H.value)}Hn()}qe(()=>{Qt.value=!0,pn()}),Ke(()=>{V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect())});let{isPrinting:mn,isImaging:hn,generatePdf:gn,generateImage:_n}=Oe({elementId:`vue-ui-radar_${k.value}`,fileName:L.value.title.text||`vue-ui-radar`,options:M.value.userOptions.print}),vn=f(()=>M.value.userOptions.show&&!L.value.title.text),yn=f(()=>ue(M.value.customPalette)),W=S({dataLabels:{show:P.value.dataLabels.show},showTable:M.value.table.show,showTooltip:I.value.show}),bn=f(()=>({style:{backgroundColor:`#FFFFFF00`,animation:{show:I.value.animation.show,animationFrames:I.value.animation.animationFrames},labels:{fontSize:I.value.fontSize,name:{color:I.value.color}},gutter:{backgroundColor:`#CCCCCC`,opacity:30}}})),G=S({height:312,width:512}),xn=Qe,K=S([]),Sn=S(null),q=S(!1);function Cn(){K.value.length?K.value=[]:Z.value.forEach((e,t)=>{K.value.push(t)}),wn()}function wn(){xn(`selectLegend`,Z.value.filter((e,t)=>!K.value.includes(t)).map(e=>({name:e.name,color:e.color,proportion:e.totalProportion})))}function Tn(e){q.value=!0,K.value.includes(e)?(Sn.value=e,K.value=K.value.filter(t=>t!==e),setTimeout(()=>{q.value=!1,Sn.value=null},500)):(K.value.push(e),setTimeout(()=>{q.value=!1},500)),wn()}function En(){return Z.value.map(e=>({name:e.name,color:e.color,proportion:e.totalProportion}))}function Dn(){let e=z.value;[null,void 0].includes(e?.categories)?(u({componentName:`VueUiRadar`,type:`dataset`,debug:U.value}),u({componentName:`VueUiRadar`,type:`datasetAttribute`,property:`categories ({ name: string; prefix?: string; suffix?: string}[])`,debug:U.value})):(e.categories.length===0?u({componentName:`VueUiRadar`,type:`datasetAttributeEmpty`,property:`categories`,debug:U.value}):U.value&&e.categories.forEach((e,t)=>{de({datasetObject:e,requiredAttributes:[`name`]}).forEach(e=>{u({componentName:`VueUiRadar`,type:`datasetAttribute`,property:`category.${e} at index ${t}`,index:t})})}),[null,void 0].includes(e?.series)?u({componentName:`VueUiRadar`,type:`datasetAttribute`,property:`series ({ name: string; values: number[]; color?: string; target: number}[])`,debug:U.value}):U.value&&e.series.forEach((e,t)=>{de({datasetObject:e,requiredAttributes:[`name`,`values`,`target`]}).forEach(e=>{u({componentName:`VueUiRadar`,type:`datasetSerieAttribute`,key:`series`,property:e,index:t})})}))}Ze(()=>z.value,()=>Dn(),{deep:!0,immediate:!0});let J=f(()=>{let e=Array.isArray(z.value?.categories)?z.value.categories:[],t=yn.value??a;return e.map((e,n)=>({name:e?.name??``,categoryId:`radar_category_${k.value}_${n}`,color:l(e?.color)||t[n]||a[n%a.length],prefix:e?.prefix??``,suffix:e?.suffix??``}))}),Y=f(()=>z.value.series.map((e,t)=>({...e,color:l(e.color)||yn.value[t]||a[t]||a[t%a.length],serieId:`radar_serie_${k.value}_${t}`,formatter:e.formatter||null,absoluteIndex:t})));function On(e){return Y.value.length?Z.value.find(t=>t.name===e)||(U.value&&console.warn(`VueUiRadar - Series name not found "${e}"`),null):(U.value&&console.warn(`VueUiRadar - There are no series to show.`),null)}function kn(e){let t=On(e);t!==null&&K.value.includes(t.absoluteIndex)&&Tn(t.absoluteIndex)}function An(e){let t=On(e);t!==null&&(K.value.includes(t.absoluteIndex)||Tn(t.absoluteIndex))}let jn=f(()=>Math.max(0,...Y.value.flatMap(e=>e.values)));function Mn(e){return F.value.scaleToAxisMax?Math.max(1,e.target||0,...e.values):e.target||jn.value||1}let Nn=f(()=>Y.value.map((e,t)=>{let n=Rn.value.coordinates[t];return Un({centerX:G.value.width/2,centerY:G.value.height/2,apexX:n.x,apexY:n.y,proportion:(e.target||0)/Mn(e)})})),Pn=f(()=>Y.value.length),Fn=f(()=>Math.min(G.value.width,G.value.height)/3),In=f(()=>{let e=Number(F.value.plots.radius??0);return Math.max(Number.isFinite(e)?e*2.5:0,10)}),Ln=f(()=>{let e=Number(F.value.grid.rotation??0);return Number.isFinite(e)?e*Math.PI/180:0}),Rn=f(()=>c({plot:{x:G.value.width/2,y:G.value.height/2},radius:Fn.value,sides:Pn.value,rotation:Ln.value})),zn=f(()=>{let e=[];for(let t=0;t<Fn.value;t+=Fn.value/F.value.grid.graduations)e.push(t);return e}),X=f(()=>Rn.value.coordinates.map((e,t)=>{let n=Y.value[t],r=Y.value[t].values.map(t=>Un({centerX:G.value.width/2,centerY:G.value.height/2,apexX:e.x,apexY:e.y,proportion:t/Mn(n)}));return{...e,...n,plots:r}}).map(e=>({...e,labelX:Bn(e).x,labelY:Bn(e).y,labelAnchor:Bn(e).anchor})));function Bn({x:e,y:t}){let n=G.value.width/2,r=G.value.height/2,i=e-n,a=t-r,o=Math.hypot(i,a),s=Number(P.value.dataLabels.offset??0),c=20+(Number.isFinite(s)?s:0);if(!o)return{x:e,y:t,anchor:`middle`};let l=i/o,ee=a/o,te=`middle`;return l>.01?te=`start`:l<-.01&&(te=`end`),{x:e+l*c,y:t+ee*c,anchor:te}}let Vn=f({get:()=>P.value.dataLabels.fontSize,set:e=>e}),{autoSizeLabels:Hn}=Le({svgRef:B,fontSize:P.value.dataLabels.fontSize,minFontSize:6,sizeRef:Vn,labelClass:`.vue-ui-radar-apex-label`});function Un({centerX:e,centerY:t,apexX:n,apexY:r,proportion:i}){return{x:e+(n-e)*i,y:t+(r-t)*i}}let Z=f(()=>{let e=Y.value.map((e,t)=>e.values.map(t=>t/(e.target||jn.value)));return J.value.map((t,r)=>{let i=re(e.map(e=>e[r]).reduce((e,t)=>e+t,0)/Y.value.length);return{...t,absoluteIndex:r,totalProportion:i,shape:`circle`,opacity:K.value.includes(r)?.5:1,segregate:()=>Tn(r),isSegregated:K.value.includes(r),display:`${t.name}: ${n({v:(i??0)*100,s:`%`,r:L.value.legend.roundingPercentage})}`}})}),Wn=f(()=>({cy:`radar-div-legend`,backgroundColor:L.value.legend.backgroundColor,color:L.value.legend.color,fontSize:L.value.legend.fontSize,paddingBottom:12,fontWeight:L.value.legend.bold?`bold`:``})),Q=f(()=>{let e=[{name:M.value.translations.datapoint,color:``},{name:M.value.translations.target,color:``},...Z.value];return{head:e,body:z.value.series.map(e=>[e.name,ie(e.formatter,e.target,n({p:e.prefix,v:e.target,s:e.suffix,r:M.value.table.td.roundingValue})),...e.values.map((t,r)=>`${ie(e.formatter,t,n({p:J.value[r]?.prefix??``,v:t,s:J.value[r]?.suffix??``,r:M.value.table.td.roundingValue}))} (${isNaN(t/e.target)?``:n({v:t/e.target*100,s:`%`,r:M.value.table.td.roundingPercentage})})`)]),config:{th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint},colNames:e}}),Gn=S(null),Kn=S([]),qn=S(null);function Jn(e,t){Ht.value=!1,Gn.value=null,j.value=null,nn.value=`pointer`,M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Yn(e,t){M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Xn(e,t,r=`pointer`){M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:e,seriesIndex:t}),nn.value=r,j.value=t;let a=J.value.slice();Kn.value=[],Gn.value=t,Ht.value=!0,qn.value={datapoint:e,seriesIndex:t,series:{categories:a,datapoints:Y.value,radar:X.value},config:M.value};let o=I.value.customFormat;if(i(o)&&ce(()=>o({seriesIndex:t,datapoint:e,series:{categories:a,datapoints:Y.value,radar:X.value},config:M.value})))Ut.value=o({seriesIndex:t,datapoint:e,series:{categories:a,datapoints:Y.value,radar:X.value},config:M.value});else{Ut.value=`<div style="width:100%;text-align:center;border-bottom:1px solid ${I.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`;for(let t=0;t<e.values.length;t+=1)if(!K.value.includes(t)){let r=a[t],i=e.values[t],o=isNaN(i/e.target)?0:i/e.target*100,s=ie(e.formatter,i,n({p:J.value[t].prefix,v:i,s:J.value[t].suffix,r:I.value.roundingValue}),{datapoint:e}),c=n({v:o,s:`%`,r:I.value.roundingPercentage}),l=I.value.showValue&&I.value.showPercentage?`${s} (${c})`:I.value.showValue&&!I.value.showPercentage?s:!I.value.showValue&&I.value.showPercentage?`${c}`:``;Kn.value.push({name:r?.name??`#${t+1}`,value:e.values[t]/e.target*100,color:r?.color,suffix:l,prefix:``,rounding:I.value.roundingPercentage,formatter:e.formatter})}}}function Zn(e=null){We(()=>{let t=[[L.value.title.text],[L.value.title.subtitle.text],[``]],n=[[``],[M.value.translations.target],...Z.value.flatMap(e=>[[e.name],[`%`]])],i=z.value.series.map((e,t)=>[e.name,e.target,...e.values.flatMap(t=>[t,isNaN(t/e.target)?``:t/e.target*100])]),a=t.concat([n]).concat(i),o=r(a);e?e(o):se({csvContent:o,title:L.value.title.text||`vue-ui-radar`})})}let $=S(!1);function Qn(e){$.value=e,Wt.value+=1}function $n(){W.value.showTable=!W.value.showTable}function er(){W.value.showTooltip=!W.value.showTooltip}let tr=S(!1);function nr(){tr.value=!tr.value}let rr=ye(A,()=>L.value.title.text),ir=f(()=>Ce({config:M,style:L,mutableConfig:W,dialog:Lt,accordion:Mt,isFullscreen:$,parent:A,maxWidth:800,isCursorPointer:R}));Ze(()=>W.value.showTable,e=>Se(e,M,$t));function ar(){W.value.showTable=!1,en.value&&en.value.setTableIconState(!1)}let or=f(()=>Z.value.map(e=>({...e,name:e.display}))),sr=f(()=>L.value.backgroundColor),cr=f(()=>L.value.legend),lr=f(()=>L.value.title),{isCallbackImaging:ur,isCallbackSvg:dr,generateSvg:fr,onGenerateImage:pr}=xe({svg:B,title:lr,legend:cr,legendItems:or,backgroundColor:sr,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:_n});async function mr(){xn(`copyAlt`,{config:M.value,dataset:X.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({config:M.value,dataset:X.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function hr(){j.value=null,rn.value=!0}function gr(){j.value=null,nn.value=`pointer`,Ht.value=!1,Gn.value=null,rn.value=!1}function _r(e){if(!Number.isFinite(e)||!B.value)return;let t=X.value[e];if(!t)return;let n=B.value.getBoundingClientRect();tn.value={x:n.left+t.labelX/G.value.width*n.width,y:n.top+t.labelY/G.value.height*n.height}}function vr(e){if(!B.value||tr.value||document.activeElement!==B.value||!X.value.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){j.value=null,nn.value=`pointer`,Ht.value=!1,Gn.value=null;return}if(r){if(j.value===null)return;let e=X.value[j.value];if(!e)return;Yn(e,j.value);return}let a=j.value;a===null||a<0||a>=X.value.length?a=n?0:X.value.length-1:n?(a+=1,a>=X.value.length&&(a=0)):t&&(--a,a<0&&(a=X.value.length-1));let o=X.value[a];o&&(j.value=a,_r(a),Xn(o,a,`keyboard`))}let yr=f(()=>({headers:Q.value?.colNames?.map(e=>e.name??e)??[],rows:Q.value?.body??[]}));return ge({getData:En,getImage:rr,generatePdf:gn,generateCsv:Zn,generateImage:_n,generateSvg:fr,hideSeries:An,showSeries:kn,toggleTable:$n,toggleTooltip:er,toggleAnnotator:nr,toggleFullscreen:Qn,copyAlt:mr}),(e,t)=>(x(),h(`div`,{class:Ge(`vue-data-ui-component vue-ui-radar ${$.value?`vue-data-ui-wrapper-fullscreen`:``} ${M.value.useCssAnimation?``:`vue-ui-dna`}`),ref_key:`radarChart`,ref:A,id:`vue-ui-radar_${k.value}`,style:b(`font-family:${M.value.style.fontFamily};width:100%; ${M.value.responsive?`height: 100%;`:``} text-align:center;background:${L.value.backgroundColor}`),onMouseenter:t[2]||=()=>E(cn)(!0),onMouseleave:t[3]||=()=>E(cn)(!1)},[g(`div`,{id:`chart-instructions-${k.value}`,class:`sr-only`},[g(`p`,null,T(M.value.a11y.translations.keyboardNavigation),1)],8,et),yr.value?.rows?.length?(x(),p(Ne,{key:0,uid:k.value,head:yr.value.headers,body:yr.value.rows,notice:M.value.a11y.translations.tableAvailable,caption:M.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):m(``,!0),N.value.buttons.annotator?(x(),p(E(Pt),{key:1,svgRef:E(B),backgroundColor:L.value.backgroundColor,color:L.value.color,active:tr.value,isCursorPointer:R.value,palette:N.value.annotatorPalette,onClose:nr},Be({_:2},[C(E(Te),t=>({name:t,fn:D(n=>[w(e.$slots,t,y(v(E(we)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):m(``,!0),vn.value?(x(),h(`div`,{key:2,ref_key:`noTitle`,ref:Jt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):m(``,!0),L.value.title.text?(x(),h(`div`,{key:3,ref_key:`chartTitle`,ref:Gt,style:`width:100%;background:transparent;padding-bottom:12px`},[(x(),p(be,{key:`title_${Yt.value}`,config:{title:{cy:`radar-div-title`,...L.value.title},subtitle:{cy:`radar-div-subtitle`,...L.value.title.subtitle}}},null,8,[`config`]))],512)):m(``,!0),g(`div`,{id:`legend-top-${k.value}`},null,8,tt),N.value.show&&Vt.value&&(E(ln)||E(sn))?(x(),p(E(Ft),{ref_key:`userOptionsRef`,ref:en,key:`user_options_${Wt.value}`,backgroundColor:L.value.backgroundColor,color:L.value.color,isImaging:E(hn),isPrinting:E(mn),uid:k.value,hasTooltip:N.value.buttons.tooltip&&I.value.show,hasPdf:N.value.buttons.pdf,hasImg:N.value.buttons.img,hasSvg:N.value.buttons.svg,hasXls:N.value.buttons.csv,hasTable:N.value.buttons.table,hasFullscreen:N.value.buttons.fullscreen,hasAltCopy:N.value.buttons.altCopy,isFullscreen:$.value,isTooltip:W.value.showTooltip,titles:{...N.value.buttonTitles},chartElement:A.value,position:N.value.position,hasAnnotator:N.value.buttons.annotator,isAnnotation:tr.value,callbacks:N.value.callbacks,printScale:N.value.print.scale,tableDialog:M.value.table.useDialog,isCursorPointer:R.value,onToggleFullscreen:Qn,onGeneratePdf:E(gn),onGenerateCsv:Zn,onGenerateImage:E(pr),onGenerateSvg:E(fr),onToggleTable:$n,onToggleTooltip:er,onToggleAnnotator:nr,onCopyAlt:mr,style:b({visibility:E(ln)?E(sn)?`visible`:`hidden`:`visible`})},Be({_:2},[C(E(Ee)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:D(n=>[w(e.$slots,t,y(v(E(De)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasTooltip.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):m(``,!0),g(`div`,nt,[(x(),h(`svg`,{ref_key:`svgRef`,ref:B,xmlns:E(le),"aria-describedby":`chart-instructions-${k.value}`,class:Ge({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value}),viewBox:`0 0 ${G.value.width<=0?10:G.value.width} ${G.value.height<=0?10:G.value.height}`,style:b(`max-width:100%;overflow:visible;background:transparent;color:${L.value.color}`),tabindex:`0`,onFocus:hr,onBlur:gr,onKeydown:vr},[He(E(It)),w(e.$slots,`svg-underlayer`,{svg:{...G.value,outerPolygon:Rn.value,isPrintingImg:E(mn)||E(hn)||E(ur),isPrintingSvg:E(dr)}},void 0,!0),e.$slots[`chart-background`]?(x(),h(`foreignObject`,{key:0,x:0,y:0,width:G.value.width<=0?10:G.value.width,height:G.value.height<=0?10:G.value.height,style:{pointerEvents:`none`}},[w(e.$slots,`chart-background`,{},void 0,!0)],8,it)):m(``,!0),g(`defs`,null,[(x(!0),h(d,null,C(J.value,(e,t)=>(x(),p(je,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`radar_gradient_${k.value}_${t}`,key:`radar_gradient_${k.value}_${t}`,stops:[[`0%`,E(o)(E(te)(e.color,.05),F.value.dataPolygon.opacity),1],[`100%`,E(o)(e.color,F.value.dataPolygon.opacity),1]]},null,8,[`id`,`stops`]))),128))]),F.value.grid.show?(x(),h(`g`,at,[(x(!0),h(d,null,C(X.value,e=>(x(),h(`line`,{x1:G.value.width/2,y1:G.value.height/2,x2:e.x,y2:e.y,stroke:F.value.grid.stroke,"stroke-width":F.value.grid.strokeWidth,style:{"pointer-events":`none`}},null,8,ot))),256)),F.value.grid.graduations>0?(x(),h(`g`,st,[(x(!0),h(d,null,C(zn.value,e=>(x(),h(`path`,{d:E(c)({plot:{x:G.value.width/2,y:G.value.height/2},radius:e,sides:Pn.value,rotation:Ln.value}).path,fill:`none`,stroke:F.value.grid.stroke,"stroke-width":F.value.grid.strokeWidth},null,8,ct))),256))])):m(``,!0)])):m(``,!0),g(`path`,{d:Rn.value.path,fill:`none`,stroke:F.value.outerPolygon.stroke,"stroke-width":F.value.outerPolygon.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,style:{"pointer-events":`none`}},null,8,lt),P.value.dataLabels.show?(x(),h(`g`,ut,[(x(!0),h(d,null,C(X.value,(e,t)=>(x(),h(`text`,{class:`vue-ui-radar-apex-label`,x:e.labelX,y:e.labelY,"text-anchor":e.labelAnchor,"dominant-baseline":`middle`,"font-size":P.value.dataLabels.fontSize,fill:P.value.dataLabels.color,onMouseenter:n=>Xn(e,t,`pointer`),onMouseleave:n=>Jn(e,t),onClick:n=>Yn(e,t)},T(e.name),41,dt))),256))])):m(``,!0),(x(!0),h(d,null,C(J.value,(e,t)=>(x(),h(`g`,null,[g(`g`,null,[M.value.useCssAnimation||!M.value.useCssAnimation&&!K.value.includes(t)?(x(),h(`polygon`,{key:0,points:E(s)(X.value.map(e=>e.plots[t]),!1,!0),stroke:L.value.backgroundColor,"stroke-width":F.value.dataPolygon.strokeWidth+1,fill:`none`,class:Ge({"animated-out":K.value.includes(t)&&M.value.useCssAnimation,"animated-in":q.value&&Sn.value===t&&M.value.useCssAnimation}),style:{"pointer-events":`none`}},null,10,ft)):m(``,!0),M.value.useCssAnimation||!M.value.useCssAnimation&&!K.value.includes(t)?(x(),h(`polygon`,{key:1,points:E(s)(X.value.map(e=>e.plots[t]),!1,!0),stroke:e.color,"stroke-width":F.value.dataPolygon.strokeWidth,fill:F.value.dataPolygon.transparent?`transparent`:F.value.dataPolygon.useGradient?`url(#radar_gradient_${k.value}_${t})`:E(o)(e.color,F.value.dataPolygon.opacity),class:Ge({"animated-out":K.value.includes(t)&&M.value.useCssAnimation,"animated-in":q.value&&Sn.value===t&&M.value.useCssAnimation}),style:{"pointer-events":`none`}},null,10,pt)):m(``,!0)])]))),256)),F.value.targetReference.show?(x(),h(`path`,{key:3,class:`vue-ui-radar-target-polygon`,d:`M${E(s)(Nn.value,!1,!0)}Z`,fill:`none`,stroke:F.value.targetReference.stroke,"stroke-width":F.value.targetReference.strokeWidth,"stroke-linejoin":`round`,"stroke-linecap":`round`,"stroke-dasharray":F.value.targetReference.strokeDasharray,style:{"pointer-events":`none`}},null,8,mt)):m(``,!0),F.value.plots.show?(x(),h(`g`,ht,[(x(!0),h(d,null,C(X.value,(e,t)=>(x(),h(`g`,{key:`radar-category-${t}`},[(x(!0),h(d,null,C(e.plots,(n,r)=>(x(),h(`g`,{key:`radar-plot-${t}-${r}`,onMouseenter:n=>!K.value.includes(r)&&Xn(e,t,`pointer`),onMouseleave:n=>!K.value.includes(r)&&Jn(e,t),onClick:n=>!K.value.includes(r)&&Yn(e,t)},[g(`circle`,{cx:n.x,cy:n.y,r:In.value,fill:`transparent`,stroke:`transparent`,style:b({pointerEvents:K.value.includes(r)?`none`:`all`})},null,12,_t),g(`circle`,{cx:n.x,cy:n.y,fill:K.value.includes(r)?`transparent`:J.value[r]?J.value[r].color:`transparent`,r:Gn.value!==null&&Gn.value===t?F.value.plots.radius*1.6:F.value.plots.radius,stroke:K.value.includes(r)?`transparent`:L.value.backgroundColor,"stroke-width":.5,class:Ge({"animated-out":K.value.includes(r)&&M.value.useCssAnimation,"animated-in":q.value&&Sn.value===r&&M.value.useCssAnimation}),style:{"pointer-events":`none`}},null,10,vt)],40,gt))),128))]))),128))])):m(``,!0),w(e.$slots,`svg`,{svg:{...G.value,outerPolygon:Rn.value,isPrintingImg:E(mn)||E(hn)||E(ur),isPrintingSvg:E(dr)}},void 0,!0)],46,rt)),e.$slots.hint?(x(),h(`div`,yt,[w(e.$slots,`hint`,y(v({hint:M.value.a11y.translations.keyboardNavigation,isVisible:rn.value})),void 0,!0)])):m(``,!0)]),e.$slots.watermark?(x(),h(`div`,bt,[w(e.$slots,`watermark`,y(v({isPrinting:E(mn)||E(hn)||E(ur)||E(dr)})),void 0,!0)])):m(``,!0),g(`div`,{id:`legend-bottom-${k.value}`},null,8,xt),Qt.value&&(L.value.legend.show||e.$slots.legend)?(x(),p(ze,{key:6,to:L.value.legend.position===`top`?`#legend-top-${k.value}`:`#legend-bottom-${k.value}`},[g(`div`,{ref_key:`chartLegend`,ref:Kt},[w(e.$slots,`legend`,{legend:Z.value},()=>[L.value.legend.show?(x(),p(Ie,{key:`legend_${Zt.value}`,legendSet:Z.value,config:Wn.value,isCursorPointer:R.value,onClickMarker:t[0]||=({i:e})=>Tn(e)},Be({item:D(({legend:e,index:t})=>[E(on)?m(``,!0):(x(),h(`div`,{key:0,onClick:t=>e.segregate(),style:b(`opacity:${K.value.includes(t)?.5:1}`)},T(e.display),13,St))]),legendToggle:D(()=>[Z.value.length>2&&L.value.legend.selectAllToggle.show&&!E(on)?(x(),p(Me,{key:0,backgroundColor:L.value.legend.selectAllToggle.backgroundColor,color:L.value.legend.selectAllToggle.color,fontSize:L.value.legend.fontSize,checked:K.value.length>0,isCursorPointer:R.value,onToggle:Cn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):m(``,!0)]),_:2},[F.value.targetReference.show&&F.value.targetReference.showInLegend?{name:`after`,fn:D(()=>[g(`div`,Ct,[g(`div`,{style:b({display:`flex`,height:L.value.legend.fontSize})},[(x(),h(`svg`,{style:b({width:L.value.legend.fontSize*2}),viewBox:`0 0 16 8`},[g(`line`,{x1:`0`,x2:`16`,y1:`4`,y2:`4`,stroke:F.value.targetReference.stroke,"stroke-width":F.value.targetReference.strokeWidth*.7,"stroke-dasharray":F.value.targetReference.strokeDasharray*.7,"stroke-linecap":`round`},null,8,wt)],4))],4),g(`span`,null,T(F.value.targetReference.legendLabel),1)])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):m(``,!0)],!0)],512)],8,[`to`])):m(``,!0),e.$slots.source?(x(),h(`div`,{key:7,ref_key:`source`,ref:qt,dir:`auto`},[w(e.$slots,`source`,{},void 0,!0)],512)):m(``,!0),He(E(kt),{teleportTo:I.value.teleportTo,show:W.value.showTooltip&&Ht.value,backgroundColor:I.value.backgroundColor,color:I.value.color,borderRadius:I.value.borderRadius,borderColor:I.value.borderColor,borderWidth:I.value.borderWidth,backgroundOpacity:I.value.backgroundOpacity,fontSize:I.value.fontSize,position:I.value.position,offsetX:I.value.offsetX,offsetY:I.value.offsetY,parent:A.value,content:Ut.value,isFullscreen:$.value,isCustom:I.value.customFormat&&typeof I.value.customFormat==`function`,smooth:I.value.smooth,backdropFilter:I.value.backdropFilter,smoothForce:I.value.smoothForce,smoothSnapThreshold:I.value.smoothSnapThreshold,isA11yMode:nn.value===`keyboard`,a11yPosition:tn.value},{"tooltip-before":D(()=>[w(e.$slots,`tooltip-before`,y(v({...qn.value})),void 0,!0)]),tooltip:D(()=>[w(e.$slots,`tooltip`,y(v({...qn.value})),void 0,!0)]),"tooltip-after":D(()=>[![`function`].includes(typeof I.value.customFormat)&&!e.$slots.tooltip?(x(),h(`div`,Tt,[He(E(jt),{dataset:Kn.value,config:bn.value,backgroundOpacity:0},{"data-label":D(({bar:e})=>[g(`div`,Et,[g(`span`,Dt,T(e.name+(I.value.showValue||I.value.showPercentage?`:`:``)),1),I.value.showValue||I.value.showPercentage?(x(),h(`span`,Ot,T(e.suffix),1)):m(``,!0)])]),_:1},8,[`dataset`,`config`])])):m(``,!0),w(e.$slots,`tooltip-after`,y(v({...qn.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`fontSize`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),Vt.value&&N.value.buttons.table?(x(),p(Je(ir.value.component),Ue({key:8},ir.value.props,{ref_key:`tableUnit`,ref:$t,onClose:ar}),Be({content:D(()=>[(x(),p(E(Nt),{key:`table_${Xt.value}`,colNames:Q.value.colNames,head:Q.value.head,body:Q.value.body,config:Q.value.config,title:M.value.table.useDialog?``:ir.value.title,withCloseButton:!M.value.table.useDialog,isCursorPointer:R.value,onClose:ar},{th:D(({th:e})=>[Ve(T(e.name),1)]),td:D(({td:e})=>[Ve(T(e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[M.value.table.useDialog?{name:`title`,fn:D(()=>[Ve(T(ir.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:D(()=>[g(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>Zn(N.value.callbacks.csv),style:b({cursor:R.value?`pointer`:`default`})},[He(E(At),{name:`fileCsv`,stroke:ir.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):m(``,!0),w(e.$slots,`skeleton`,{},()=>[E(on)?(x(),p(me,{key:0})):m(``,!0)],!0)],46,$e))}},[[`__scopeId`,`data-v-7d944bac`]]);export{Qe as n,kt as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,Ht as r,X as i,at as a,i as o,in as ee,r as te,rn as s,t as ne,w as re,yt as ie,zt as ae}from"./lib-rPeBMZrn.js";import{n as oe,t as se}from"./BaseScanner-8NdoBs7B.js";import{n as ce,t as le}from"./useHints-C-TwxM0Y.js";import{t as ue}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as de}from"./resolveChartConfig-CIhClE5R.js";import{t as fe}from"./img-D4RQwASc.js";import{n as pe}from"./Title-BliHuXfT.js";import{t as me}from"./useChartExport-BZts4KFb.js";import{n as he,t as ge}from"./annotationSlots-BRR85CqJ.js";import{n as _e,t as ve}from"./userOptionsSlots-DYuo-E5m.js";import{t as ye}from"./usePrinter-DVf3YcG5.js";import{c as be}from"./canvas-lib-22VpOI4_.js";import{t as xe}from"./useResponsive-CENUxfEL.js";import{t as Se}from"./A11yDataTable-DWNlWXzs.js";import{t as Ce}from"./useUserOptionState-CXlFnwPv.js";import{t as we}from"./useChartAccessibility-DOMuYJfm.js";import{t as Te}from"./useAutoSizeLabelsInsideViewbox-AIRF0PlD.js";import{t as Ee}from"./vue_ui_relation_circle-Dkv-cSB6.js";import{Fragment as c,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as De,createTextVNode as Oe,createVNode as ke,defineAsyncComponent as Ae,guardReactiveProps as m,mergeProps as je,normalizeClass as Me,normalizeProps as h,normalizeStyle as g,onBeforeUnmount as Ne,onMounted as Pe,openBlock as _,ref as v,renderList as y,renderSlot as b,shallowRef as Fe,toDisplayString as x,toRefs as Ie,unref as S,useCssVars as Le,watch as Re,withCtx as ze}from"vue";var Be=/* @__PURE__ */ e({default:()=>st}),Ve=[`id`],He=[`id`],Ue={style:{position:`relative`}},We=[`xmlns`,`viewBox`,`aria-describedby`],Ge=[`width`,`height`],Ke=[`cx`,`cy`,`r`,`stroke`,`stroke-width`],qe={key:1},Je=[`stroke`,`d`,`stroke-width`],Ye={style:{"pointer-events":`none`}},Xe=[`cx`,`cy`,`fill`,`r`,`stroke`],Ze=[`x`,`y`,`fill`,`font-size`],Qe={key:2},$e=[`stroke`,`stroke-width`,`x1`,`x2`,`y1`,`y2`],et={style:{"pointer-events":`none`}},tt=[`cx`,`cy`,`fill`,`r`,`stroke`],nt=[`x`,`y`,`fill`,`font-size`],rt=[`text-anchor`,`transform`,`x`,`y`,`font-weight`,`font-size`,`fill`,`text-decoration`,`onClick`,`onMouseenter`,`onMouseleave`],it=[`cx`,`cy`,`fill`,`stroke`,`r`,`onClick`,`onMouseenter`,`onMouseleave`],at={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},ot={key:5,class:`vue-data-ui-watermark`},st=/*#__PURE__*/ ue({__name:`vue-ui-relation-circle`,props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:ue,emit:Be}){Le(e=>({v22fe13cb:Nt.value,v7f0fc82a:Mt.value,v6ece5e8c:Pt.value}));let st=Ae(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),ct=Ae(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),lt=Ae(()=>import(`./PackageVersion-CXT-eAuk.js`).then(e=>e.t)),{vue_ui_relation_circle:ut}=t(),C=e,dt=Be,ft=l(()=>!!C.dataset&&Object.keys(C.dataset).length),w=v(i()),pt=v(0),T=v(null),mt=v(null),ht=v(null),gt=v(null),_t=v(0),E=v(null),D=v(!1),O=v(Tt()),k=l(()=>O.value.userOptions),A=l(()=>O.value.style.weightLabels),j=l(()=>O.value.style);ce({config:()=>O.value,dataset:()=>C.dataset,component:`VueUiRelationCircle`,rules:[le.noHint]});let M=l(()=>O.value.userOptions.useCursorPointer),vt=l(()=>ee({defaultConfig:{userOptions:{show:!1},customPalette:Array(7).fill(`#CACACA`),style:{backgroundColor:`#99999930`,labels:{color:`#6A6A6A`},circle:{stroke:`#6A6A6A`},plot:{color:`#6A6A6A`,useSerieColor:!0},links:{maxWidth:2}}},userConfig:O.value.skeletonConfig??{}})),{loading:yt,FINAL_DATASET:bt,manualLoading:xt}=oe({...Ie(C),FINAL_CONFIG:O,prepareConfig:Tt,skeletonDataset:C.config?.skeletonDataset??[{id:`A`,label:`_`,relations:[`B`,`C`,`D`,`E`,`F`,`G`]},{id:`B`,label:`_`,relations:[`A`]},{id:`C`,label:`_`,relations:[`A`]},{id:`D`,label:`_`,relations:[`A`]},{id:`E`,label:`_`,relations:[`A`]},{id:`F`,label:`_`,relations:[`A`]},{id:`G`,label:`_`,relations:[`A`]}],skeletonConfig:ee({defaultConfig:O.value,userConfig:vt.value})}),{userOptionsVisible:St,setUserOptionsVisibility:Ct,keepUserOptionState:wt}=Ce({config:O.value}),{svgRef:N}=we({config:j.value.title});function Tt(){return de(C.config,ut,Ee)}Re(()=>C.config,e=>{O.value=Tt(),St.value=!O.value.userOptions.showOnChartHover,V.value=j.value.size,H.value=A.value.size,U.value=j.value.plot.radius,W.value=j.value.labels.fontSize,G.value.height=j.value.size,G.value.width=j.value.size,It(),_t.value+=1},{deep:!0}),Re(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(xt.value=!1)},{deep:!0});let{isPrinting:P,isImaging:F,generatePdf:Et,generateImage:Dt}=ye({elementId:`relation_circle_${w.value}`,fileName:j.value.title.text||`vue-ui-relation-circle`,options:O.value.userOptions.print}),Ot=l(()=>O.value.userOptions.show&&!j.value.title.text),kt=l(()=>re(O.value.customPalette)),I=v([]),L=v([]),R=v({}),z=v([]),At=v(0),B=l(()=>bt.value.slice(0,j.value.limit).map(e=>{let t=Array.isArray(e.relations)?e.relations:[];return{...e,weights:Array.isArray(e.weights)?e.weights:Array(t.length).fill(1),relations:t}}));Re(B,()=>{I.value=[],L.value=[],zt(),Vt()});let V=v(j.value.size),H=v(A.value.size),U=v(j.value.plot.radius),W=v(j.value.labels.fontSize),G=v({height:j.value.size,width:j.value.size}),K=l({get(){return V.value*j.value.circle.radiusProportion},set(e){return e}}),jt=l(()=>j.value.links.curved),Mt=l(()=>`${j.value.animation.speedMs}ms`),Nt=l(()=>K.value*2),Pt=l(()=>K.value*4),q=Fe(null),J=Fe(null);Pe(()=>{It(),document.getElementById(`relation_circle_${w.value}`).addEventListener(`click`,Rt)});let Ft=l(()=>O.value.debug);function It(){if(ae(C.dataset)?(a({componentName:`VueUiRelationCircle`,type:`dataset`,debug:Ft.value}),xt.value=!0):Ft.value&&C.dataset.forEach((e,t)=>{ie({datasetObject:e,requiredAttributes:[`id`,`label`,`relations`,`weights`]}).forEach(e=>{a({componentName:`VueUiRelationCircle`,type:`datasetSerieAttribute`,property:e,index:t})})}),ae(C.dataset)||(xt.value=O.value.loading),O.value.responsive){let e=be(()=>{let{width:e,height:t}=xe({chart:T.value,title:j.value.title.text?mt.value:null,source:ht.value,noTitle:gt.value});requestAnimationFrame(()=>{V.value=Math.min(e,t),G.value.width=Math.max(.1,e),G.value.height=Math.max(.1,t-12),K.value=V.value*j.value.circle.radiusProportion,I.value=[],L.value=[],zt(),Vt(),Lt(),O.value.responsiveProportionalSizing?(H.value=s({relator:V.value,adjuster:j.value.size,source:A.value.size,threshold:6,fallback:6}),U.value=s({relator:V.value,adjuster:j.value.size,source:j.value.plot.radius,threshold:1,fallback:1}),W.value=s({relator:V.value,adjuster:j.value.size,source:j.value.labels.fontSize,threshold:6,fallback:6})):(H.value=A.value.size,U.value=j.value.plot.radius,W.value=j.value.labels.fontSize)})});q.value&&(J.value&&q.value.unobserve(J.value),q.value.disconnect()),q.value=new ResizeObserver(e),J.value=T.value.parentNode,q.value.observe(J.value)}else I.value=[],L.value=[],zt(),Vt();Lt()}Ne(()=>{document.getElementById(`relation_circle_${w.value}`).removeEventListener(`click`,Rt),q.value&&(J.value&&q.value.unobserve(J.value),q.value.disconnect())});let{autoSizeLabels:Lt}=Te({svgRef:N,fontSize:j.value.labels.fontSize,minFontSize:j.value.labels.minFontSize,sizeRef:W,labelClass:`.vue-ui-relation-circle-legend`});function Rt(e){let t=e.target;t&&Array.from(t.classList).includes(`vue-ui-user-options`)||t&&Array.from(t.classList).includes(`vue-ui-user-options-summary`)||t&&Array.from(t.classList).includes(`vue-data-ui-button`)||t&&Array.from(t.classList).includes(`vue-ui-relation-circle-legend`)||(R.value={},z.value=[])}function zt(){let e=6.28319/B.value.length,t=360/B.value.length,n=0,i=0;B.value.forEach((a,o)=>{let ee=a.weights.reduce((e,t)=>e+t,0),te=K.value*Math.cos(n)+G.value.width/2,s=K.value*Math.sin(n)+G.value.height/2+j.value.circle.offsetY;I.value.push({x:te,y:s,...a,color:a.color?a.color:kt.value[o]?kt.value[o]:r[o],regAngle:i,totalWeight:ee}),n+=e,i+=t})}function Bt(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function Vt(){L.value=[],I.value.forEach(e=>{I.value.filter(t=>t.relations.includes(e.id)).forEach((t,n)=>{let r=t.relations.indexOf(e.id);L.value.push({weight:t.weights[r]?t.weights[r]:0,relationId:`${e.id}_${t.id}`,x1:e.x,y1:e.y,x2:t.x,y2:t.y,colorSource:e.color,colorTarget:t.color,midPointLine:Bt({x:e.x,y:e.y},{x:t.x,y:t.y}),midPointBezier:Ht({x1:e.x,x2:t.x,y1:e.y,y2:t.y}),...e})})})}function Ht(e){let t={x:e.x1,y:e.y1},n={x:e.x2,y:e.y2},r={x:e.x1,y:e.y1},i={x:G.value.width/2,y:G.value.height/2+j.value.circle.offsetY},a=.5;return{x:.5**3*t.x+3*.5**2*a*r.x+1.5*a**2*i.x+a**3*n.x,y:.5**3*t.y+3*.5**2*a*r.y+1.5*a**2*i.y+a**3*n.y}}let Ut=l(()=>Math.max(...L.value.map(e=>e.weight)));function Wt(e){return Object.hasOwn(R.value,`x`)?z.value.includes(e.id)?`opacity:1`:`opacity:0.1`:`opacity:1`}function Y(e){return e.colorSource}function Gt(e){return Object.hasOwn(R.value,`x`)?z.value.includes(e.id)&&e.relationId===`${e.id}_${R.value.id}`||e.relationId===`${R.value.id}_${e.id}`?`opacity:1;stroke-width:${en(e)}`:`opacity: 0`:`opacity: 1`}function X(e){return Object.hasOwn(R.value,`x`)?!!(z.value.includes(e.id)&&e.relationId===`${e.id}_${R.value.id}`||e.relationId===`${R.value.id}_${e.id}`):!1}function Kt(e){return e.regAngle>90&&e.regAngle<270?`end`:`start`}function qt(e){return e.regAngle>90&&e.regAngle<270?e.x-5:e.x+5}function Jt(e){return Object.hasOwn(R.value,`x`)?R.value.id===e.id||z.value.includes(e.id)?`opacity:1`:`opacity:0.2`:`opacity:1`}function Yt(e){return e.regAngle>90&&e.regAngle<270?`rotate(${e.regAngle+180},${e.x},${e.y})`:`rotate(${e.regAngle},${e.x},${e.y})`}let Z=v(null);function Xt(e,t){Z.value=t,E.value=t,O.value.events.datapointEnter&&O.value.events.datapointEnter({datapoint:e,seriesIndex:t})}function Zt(e,t){Z.value=null,D.value||(E.value=null),O.value.events.datapointLeave&&O.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Qt(e,t){e&&(O.value.events.datapointClick&&O.value.events.datapointClick({datapoint:e,seriesIndex:t}),At.value=360-e.regAngle,R.value.id&&e.id===R.value.id?(R.value={},z.value=[]):(R.value=e,z.value=[...e.relations]))}function $t(e,t){E.value=t,Qt(e,t)}function en(e){let t=e.weight/Ut.value*j.value.links.maxWidth;return Math.max(.3,t)}let Q=v(!1);function tn(e){Q.value=e,pt.value+=1}let $=v(!1);function nn(){$.value=!$.value}async function rn({scale:e=2}={}){if(!T.value)return;let{width:t,height:n}=T.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await fe({domElement:T.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:j.value.title.text,width:t,height:n,aspectRatio:r}}let an=l(()=>j.value.backgroundColor),on=l(()=>j.value.title),{isCallbackImaging:sn,isCallbackSvg:cn,generateSvg:ln,onGenerateImage:un}=me({svg:N,title:on,legend:null,legendItems:null,backgroundColor:an,getSvgCallback:()=>O.value.userOptions.callbacks.svg,generateImage:Dt});async function dn(){dt(`copyAlt`,{config:O.value,dataset:B.value}),O.value.userOptions.callbacks.altCopy?await Promise.resolve(O.value.userOptions.callbacks.altCopy({config:O.value,dataset:B.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function fn(){D.value=!0,I.value.length&&E.value===null&&(E.value=0)}function pn(){D.value=!1,E.value=null}function mn(e){if(!N.value||$.value||document.activeElement!==N.value||!I.value.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){E.value=null,R.value={},z.value=[];return}if(r){if(E.value===null)return;let e=I.value[E.value];if(!e)return;Qt(e,E.value);return}let a=E.value;a===null||a<0||a>=I.value.length?a=n?0:I.value.length-1:n?(a+=1,a>=I.value.length&&(a=0)):t&&(--a,a<0&&(a=I.value.length-1)),E.value=a,Z.value=a;let o=I.value[a];o&&O.value.events.datapointEnter&&O.value.events.datapointEnter({datapoint:o,seriesIndex:a})}let hn=l(()=>({headers:[`ID`,`Label`,`Total weight`,`Relations count`,`Relations`],rows:B.value.map(e=>{let t=e.relations.map(e=>B.value.find(t=>t.id===e)?.label||e).join(`, `),n=(e.weights||[]).reduce((e,t)=>e+Number(t||0),0);return[e.id,e.label,n,e.relations.length,t]})}));return ue({getImage:rn,generatePdf:Et,generateSvg:ln,generateImage:Dt,toggleAnnotator:nn,toggleFullscreen:tn,copyAlt:dn}),(e,t)=>(_(),f(`div`,{ref_key:`relationCircleChart`,ref:T,class:`vue-data-ui-component vue-ui-relation-circle`,style:g(`width:100%;background:${j.value.backgroundColor};text-align:center;${O.value.responsive?`height: 100%`:``}`),id:`relation_circle_${w.value}`,onMouseenter:t[0]||=()=>S(Ct)(!0),onMouseleave:t[1]||=()=>S(Ct)(!1)},[p(`div`,{id:`chart-instructions-${w.value}`,class:`sr-only`},[p(`p`,null,x(O.value.a11y.translations.keyboardNavigation),1)],8,He),hn.value?.rows?.length?(_(),u(Se,{key:0,uid:w.value,head:hn.value.headers,body:hn.value.rows,notice:O.value.a11y.translations.tableAvailable,caption:O.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):d(``,!0),k.value.buttons.annotator?(_(),u(S(st),{key:1,svgRef:S(N),backgroundColor:j.value.backgroundColor,color:j.value.color,active:$.value,isCursorPointer:M.value,palette:k.value.annotatorPalette,onClose:nn},De({_:2},[y(S(ge),t=>({name:t,fn:ze(n=>[b(e.$slots,t,h(m(S(he)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):d(``,!0),Ot.value?(_(),f(`div`,{key:2,ref_key:`noTitle`,ref:gt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):d(``,!0),j.value.title.text?(_(),f(`div`,{key:3,ref_key:`chartTitle`,ref:mt,style:`width:100%;background:transparent`},[(_(),u(pe,{key:`title_${_t.value}`,config:{title:{cy:`relation-div-title`,...j.value.title},subtitle:{cy:`relation-div-subtitle`,...j.value.title.subtitle}}},null,8,[`config`]))],512)):d(``,!0),k.value.show&&ft.value&&(S(wt)||S(St))?(_(),u(S(ct),{ref:`details`,key:`user_options_${pt.value}`,backgroundColor:j.value.backgroundColor,color:j.value.color,isPrinting:S(P),isImaging:S(F),uid:w.value,hasPdf:k.value.buttons.pdf,hasImg:k.value.buttons.img,hasSvg:k.value.buttons.svg,hasFullscreen:k.value.buttons.fullscreen,hasAltCopy:k.value.buttons.altCopy,hasXls:!1,isFullscreen:Q.value,titles:{...k.value.buttonTitles},chartElement:T.value,position:k.value.position,hasAnnotator:k.value.buttons.annotator,isAnnotation:$.value,callbacks:k.value.callbacks,printScale:k.value.print.scale,isCursorPointer:M.value,onToggleFullscreen:tn,onGeneratePdf:S(Et),onGenerateImage:S(un),onGenerateSvg:S(ln),onToggleAnnotator:nn,onCopyAlt:dn,style:g({visibility:S(wt)?S(St)?`visible`:`hidden`:`visible`})},De({_:2},[y(S(_e)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:ze(n=>[b(e.$slots,t,h(m(S(ve)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasImg`,`hasSvg`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`titles`,`chartElement`,`position`,`hasAnnotator`,`isAnnotation`,`callbacks`,`printScale`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):d(``,!0),p(`div`,Ue,[(_(),f(`svg`,{ref_key:`svgRef`,ref:N,xmlns:S(ne),class:Me([{"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value},`relation-circle`]),viewBox:`0 0 ${G.value.width<=0?10:G.value.width} ${G.value.height<=0?10:G.value.height}`,width:`100%`,style:`user-select:none; background:transparent`,"aria-describedby":`chart-instructions-${w.value}`,tabindex:`0`,onFocus:fn,onBlur:pn,onKeydown:mn},[ke(S(lt)),b(e.$slots,`svg-underlayer`,{svg:{...G.value,isPrintingImg:S(P)||S(F)||S(sn),isPrintingSvg:S(cn)}},void 0,!0),e.$slots[`chart-background`]?(_(),f(`foreignObject`,{key:0,x:0,y:0,width:G.value.width<=0?10:G.value.width,height:G.value.height<=0?10:G.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,Ge)):d(``,!0),p(`circle`,{cx:(G.value.width<=0?1e-4:G.value.width)/2,cy:(G.value.height<=0?1e-4:G.value.height)/2+j.value.circle.offsetY,r:K.value<=0?1e-4:K.value,stroke:j.value.circle.stroke,"stroke-width":j.value.circle.strokeWidth,fill:`transparent`,class:`main-circle`},null,8,Ke),jt.value?(_(),f(`g`,qe,[(_(!0),f(c,null,y(L.value,(e,t)=>(_(),f(`path`,{key:`relation_${t}`,style:g(Gt(e)),stroke:Y(e),class:Me([`relation`,{"vue-ui-relation-circle-selected":R.value.hasOwnProperty(`id`)&&z.value.includes(e.id)}]),d:`M${e.x1},${e.y1} C${e.x1},${e.y1} ${G.value.width/2},${G.value.height/2+j.value.circle.offsetY} ${e.x2},${e.y2}`,fill:`none`,"stroke-width":en(e),"stroke-linecap":`round`},null,14,Je))),128)),(_(!0),f(c,null,y(L.value,(t,r)=>(_(),f(`g`,Ye,[X(t)?b(e.$slots,`dataLabel`,je({ref_for:!0},{x:t.midPointBezier.x,y:t.midPointBezier.y,color:Y(t),weight:t.weight,fontSize:H.value}),void 0,!0,0):d(``,!0),X(t)&&!e.$slots.dataLabel?(_(),f(`circle`,{key:1,cx:t.midPointBezier.x,cy:t.midPointBezier.y,fill:Y(t),r:H.value,stroke:j.value.backgroundColor,"stroke-width":`1`},null,8,Xe)):d(``,!0),X(t)&&!e.$slots.dataLabel?(_(),f(`text`,{key:2,x:t.midPointBezier.x,y:t.midPointBezier.y+H.value/3,fill:S(te)(Y(t)),"text-anchor":`middle`,"font-size":H.value},x(S(o)(A.value.formatter,t.weight,S(n)({p:A.value.prefix,v:t.weight,s:A.value.suffix,r:A.value.rounding}),{...t})),9,Ze)):d(``,!0)]))),256))])):(_(),f(`g`,Qe,[(_(!0),f(c,null,y(L.value,(e,t)=>(_(),f(`line`,{key:`relation_${t}`,stroke:Y(e),"stroke-width":en(e),style:g(Gt(e)),x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,class:Me({"vue-ui-relation-circle-selected":R.value.hasOwnProperty(`id`)&&z.value.includes(e.id)}),"stroke-linecap":`round`},null,14,$e))),128)),(_(!0),f(c,null,y(L.value,(t,r)=>(_(),f(`g`,et,[X(t)?b(e.$slots,`dataLabel`,je({ref_for:!0},{x:t.midPointLine.x,y:t.midPointLine.y,color:Y(t),weight:t.weight,fontSize:H.value}),void 0,!0,0):d(``,!0),X(t)&&!e.$slots.dataLabel&&A.value.show?(_(),f(`circle`,{key:1,cx:t.midPointLine.x,cy:t.midPointLine.y,fill:Y(t),r:H.value,stroke:j.value.backgroundColor,"stroke-width":`1`},null,8,tt)):d(``,!0),X(t)&&!e.$slots.dataLabel&&A.value.show?(_(),f(`text`,{key:2,x:t.midPointLine.x,y:t.midPointLine.y+H.value/3,fill:S(te)(Y(t)),"text-anchor":`middle`,"font-size":H.value},x(S(o)(A.value.formatter,t.weight,S(n)({p:A.value.prefix,v:t.weight,s:A.value.suffix,r:A.value.rounding}),{...t})),9,nt)):d(``,!0)]))),256))])),(_(!0),f(c,null,y(I.value,(e,t)=>(_(),f(`text`,{key:`plot_text_${t}`,"text-anchor":Kt(e),transform:Yt(e),x:qt(e),y:e.y+5,class:`vue-ui-relation-circle-legend`,"transform-origin":`start`,"font-weight":R.value.id===e.id?`900`:`400`,style:g(`font-family:${j.value.fontFamily};${Jt(e)};cursor:${M.value?`pointer`:`default`}`),"font-size":W.value,fill:j.value.labels.color,"text-decoration":t===Z.value||t===E.value?`underline`:void 0,onClick:n=>$t(e,t),onMouseenter:n=>Xt(e,t),onMouseleave:n=>Zt(e,t)},[S(yt)?(_(),f(c,{key:0},[Oe(`--------`)],64)):(_(),f(c,{key:1},[Oe(x(e.label)+` (`+x(S(o)(A.value.formatter,e.totalWeight,S(n)({p:A.value.prefix,v:e.totalWeight,s:A.value.suffix,r:A.value.rounding}),{...e}))+`) `,1)],64))],44,rt))),128)),(_(!0),f(c,null,y(I.value,(e,t)=>(_(),f(`circle`,{cx:e.x,cy:e.y,key:`plot_${t}`,style:g(`${Wt(e)}; transition: r 0.2s ease-in-out; cursor:${M.value?`pointer`:`default`}`),class:`vue-ui-relation-circle-plot`,fill:j.value.plot.useSerieColor?e.color:j.value.plot.color,stroke:j.value.backgroundColor,"stroke-width":`1`,r:U.value*(t===Z.value||t===E.value?2:1),onClick:n=>$t(e,t),onMouseenter:n=>Xt(e,t),onMouseleave:n=>Zt(e,t)},null,44,it))),128)),b(e.$slots,`svg`,{svg:{...G.value,isPrintingImg:S(P)||S(F)||S(sn),isPrintingSvg:S(cn)}},void 0,!0)],42,We)),e.$slots.hint?(_(),f(`div`,at,[b(e.$slots,`hint`,h(m({hint:O.value.a11y.translations.keyboardNavigation,isVisible:D.value})),void 0,!0)])):d(``,!0)]),e.$slots.watermark?(_(),f(`div`,ot,[b(e.$slots,`watermark`,h(m({isPrinting:S(P)||S(F)||S(sn)||S(cn)})),void 0,!0)])):d(``,!0),e.$slots.source?(_(),f(`div`,{key:6,ref_key:`source`,ref:ht,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):d(``,!0),b(e.$slots,`skeleton`,{},()=>[S(yt)?(_(),u(se,{key:0})):d(``,!0)],!0)],44,Ve))}},[[`__scopeId`,`data-v-64ac9170`]]);export{Be as n,st as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,Ht as r,X as i,at as a,i as o,in as ee,r as te,rn as s,t as ne,w as re,yt as ie,zt as ae}from"./lib-rPeBMZrn.js";import{n as oe,t as se}from"./BaseScanner-8NdoBs7B.js";import{n as ce,t as le}from"./useHints-C-TwxM0Y.js";import{t as ue}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as de}from"./resolveChartConfig-CIhClE5R.js";import{t as fe}from"./img-D4RQwASc.js";import{n as pe}from"./Title-BliHuXfT.js";import{t as me}from"./useChartExport-BZts4KFb.js";import{n as he,t as ge}from"./annotationSlots-BRR85CqJ.js";import{n as _e,t as ve}from"./userOptionsSlots-DYuo-E5m.js";import{t as ye}from"./usePrinter-DVf3YcG5.js";import{c as be}from"./canvas-lib-22VpOI4_.js";import{t as xe}from"./useResponsive-CENUxfEL.js";import{t as Se}from"./A11yDataTable-DWNlWXzs.js";import{t as Ce}from"./useUserOptionState-CXlFnwPv.js";import{t as we}from"./useChartAccessibility-DOMuYJfm.js";import{t as Te}from"./useAutoSizeLabelsInsideViewbox-AIRF0PlD.js";import{t as Ee}from"./vue_ui_relation_circle-Dkv-cSB6.js";import{Fragment as c,computed as l,createBlock as u,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createSlots as De,createTextVNode as Oe,createVNode as ke,defineAsyncComponent as Ae,guardReactiveProps as m,mergeProps as je,normalizeClass as Me,normalizeProps as h,normalizeStyle as g,onBeforeUnmount as Ne,onMounted as Pe,openBlock as _,ref as v,renderList as y,renderSlot as b,shallowRef as Fe,toDisplayString as x,toRefs as Ie,unref as S,useCssVars as Le,watch as Re,withCtx as ze}from"vue";var Be=/* @__PURE__ */ e({default:()=>st}),Ve=[`id`],He=[`id`],Ue={style:{position:`relative`}},We=[`xmlns`,`viewBox`,`aria-describedby`],Ge=[`width`,`height`],Ke=[`cx`,`cy`,`r`,`stroke`,`stroke-width`],qe={key:1},Je=[`stroke`,`d`,`stroke-width`],Ye={style:{"pointer-events":`none`}},Xe=[`cx`,`cy`,`fill`,`r`,`stroke`],Ze=[`x`,`y`,`fill`,`font-size`],Qe={key:2},$e=[`stroke`,`stroke-width`,`x1`,`x2`,`y1`,`y2`],et={style:{"pointer-events":`none`}},tt=[`cx`,`cy`,`fill`,`r`,`stroke`],nt=[`x`,`y`,`fill`,`font-size`],rt=[`text-anchor`,`transform`,`x`,`y`,`font-weight`,`font-size`,`fill`,`text-decoration`,`onClick`,`onMouseenter`,`onMouseleave`],it=[`cx`,`cy`,`fill`,`stroke`,`r`,`onClick`,`onMouseenter`,`onMouseleave`],at={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},ot={key:5,class:`vue-data-ui-watermark`},st=/*#__PURE__*/ ue({__name:`vue-ui-relation-circle`,props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:ue,emit:Be}){Le(e=>({v22fe13cb:Nt.value,v7f0fc82a:Mt.value,v6ece5e8c:Pt.value}));let st=Ae(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),ct=Ae(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),lt=Ae(()=>import(`./PackageVersion-DhptF5oD.js`).then(e=>e.t)),{vue_ui_relation_circle:ut}=t(),C=e,dt=Be,ft=l(()=>!!C.dataset&&Object.keys(C.dataset).length),w=v(i()),pt=v(0),T=v(null),mt=v(null),ht=v(null),gt=v(null),_t=v(0),E=v(null),D=v(!1),O=v(Tt()),k=l(()=>O.value.userOptions),A=l(()=>O.value.style.weightLabels),j=l(()=>O.value.style);ce({config:()=>O.value,dataset:()=>C.dataset,component:`VueUiRelationCircle`,rules:[le.noHint]});let M=l(()=>O.value.userOptions.useCursorPointer),vt=l(()=>ee({defaultConfig:{userOptions:{show:!1},customPalette:Array(7).fill(`#CACACA`),style:{backgroundColor:`#99999930`,labels:{color:`#6A6A6A`},circle:{stroke:`#6A6A6A`},plot:{color:`#6A6A6A`,useSerieColor:!0},links:{maxWidth:2}}},userConfig:O.value.skeletonConfig??{}})),{loading:yt,FINAL_DATASET:bt,manualLoading:xt}=oe({...Ie(C),FINAL_CONFIG:O,prepareConfig:Tt,skeletonDataset:C.config?.skeletonDataset??[{id:`A`,label:`_`,relations:[`B`,`C`,`D`,`E`,`F`,`G`]},{id:`B`,label:`_`,relations:[`A`]},{id:`C`,label:`_`,relations:[`A`]},{id:`D`,label:`_`,relations:[`A`]},{id:`E`,label:`_`,relations:[`A`]},{id:`F`,label:`_`,relations:[`A`]},{id:`G`,label:`_`,relations:[`A`]}],skeletonConfig:ee({defaultConfig:O.value,userConfig:vt.value})}),{userOptionsVisible:St,setUserOptionsVisibility:Ct,keepUserOptionState:wt}=Ce({config:O.value}),{svgRef:N}=we({config:j.value.title});function Tt(){return de(C.config,ut,Ee)}Re(()=>C.config,e=>{O.value=Tt(),St.value=!O.value.userOptions.showOnChartHover,V.value=j.value.size,H.value=A.value.size,U.value=j.value.plot.radius,W.value=j.value.labels.fontSize,G.value.height=j.value.size,G.value.width=j.value.size,It(),_t.value+=1},{deep:!0}),Re(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(xt.value=!1)},{deep:!0});let{isPrinting:P,isImaging:F,generatePdf:Et,generateImage:Dt}=ye({elementId:`relation_circle_${w.value}`,fileName:j.value.title.text||`vue-ui-relation-circle`,options:O.value.userOptions.print}),Ot=l(()=>O.value.userOptions.show&&!j.value.title.text),kt=l(()=>re(O.value.customPalette)),I=v([]),L=v([]),R=v({}),z=v([]),At=v(0),B=l(()=>bt.value.slice(0,j.value.limit).map(e=>{let t=Array.isArray(e.relations)?e.relations:[];return{...e,weights:Array.isArray(e.weights)?e.weights:Array(t.length).fill(1),relations:t}}));Re(B,()=>{I.value=[],L.value=[],zt(),Vt()});let V=v(j.value.size),H=v(A.value.size),U=v(j.value.plot.radius),W=v(j.value.labels.fontSize),G=v({height:j.value.size,width:j.value.size}),K=l({get(){return V.value*j.value.circle.radiusProportion},set(e){return e}}),jt=l(()=>j.value.links.curved),Mt=l(()=>`${j.value.animation.speedMs}ms`),Nt=l(()=>K.value*2),Pt=l(()=>K.value*4),q=Fe(null),J=Fe(null);Pe(()=>{It(),document.getElementById(`relation_circle_${w.value}`).addEventListener(`click`,Rt)});let Ft=l(()=>O.value.debug);function It(){if(ae(C.dataset)?(a({componentName:`VueUiRelationCircle`,type:`dataset`,debug:Ft.value}),xt.value=!0):Ft.value&&C.dataset.forEach((e,t)=>{ie({datasetObject:e,requiredAttributes:[`id`,`label`,`relations`,`weights`]}).forEach(e=>{a({componentName:`VueUiRelationCircle`,type:`datasetSerieAttribute`,property:e,index:t})})}),ae(C.dataset)||(xt.value=O.value.loading),O.value.responsive){let e=be(()=>{let{width:e,height:t}=xe({chart:T.value,title:j.value.title.text?mt.value:null,source:ht.value,noTitle:gt.value});requestAnimationFrame(()=>{V.value=Math.min(e,t),G.value.width=Math.max(.1,e),G.value.height=Math.max(.1,t-12),K.value=V.value*j.value.circle.radiusProportion,I.value=[],L.value=[],zt(),Vt(),Lt(),O.value.responsiveProportionalSizing?(H.value=s({relator:V.value,adjuster:j.value.size,source:A.value.size,threshold:6,fallback:6}),U.value=s({relator:V.value,adjuster:j.value.size,source:j.value.plot.radius,threshold:1,fallback:1}),W.value=s({relator:V.value,adjuster:j.value.size,source:j.value.labels.fontSize,threshold:6,fallback:6})):(H.value=A.value.size,U.value=j.value.plot.radius,W.value=j.value.labels.fontSize)})});q.value&&(J.value&&q.value.unobserve(J.value),q.value.disconnect()),q.value=new ResizeObserver(e),J.value=T.value.parentNode,q.value.observe(J.value)}else I.value=[],L.value=[],zt(),Vt();Lt()}Ne(()=>{document.getElementById(`relation_circle_${w.value}`).removeEventListener(`click`,Rt),q.value&&(J.value&&q.value.unobserve(J.value),q.value.disconnect())});let{autoSizeLabels:Lt}=Te({svgRef:N,fontSize:j.value.labels.fontSize,minFontSize:j.value.labels.minFontSize,sizeRef:W,labelClass:`.vue-ui-relation-circle-legend`});function Rt(e){let t=e.target;t&&Array.from(t.classList).includes(`vue-ui-user-options`)||t&&Array.from(t.classList).includes(`vue-ui-user-options-summary`)||t&&Array.from(t.classList).includes(`vue-data-ui-button`)||t&&Array.from(t.classList).includes(`vue-ui-relation-circle-legend`)||(R.value={},z.value=[])}function zt(){let e=6.28319/B.value.length,t=360/B.value.length,n=0,i=0;B.value.forEach((a,o)=>{let ee=a.weights.reduce((e,t)=>e+t,0),te=K.value*Math.cos(n)+G.value.width/2,s=K.value*Math.sin(n)+G.value.height/2+j.value.circle.offsetY;I.value.push({x:te,y:s,...a,color:a.color?a.color:kt.value[o]?kt.value[o]:r[o],regAngle:i,totalWeight:ee}),n+=e,i+=t})}function Bt(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function Vt(){L.value=[],I.value.forEach(e=>{I.value.filter(t=>t.relations.includes(e.id)).forEach((t,n)=>{let r=t.relations.indexOf(e.id);L.value.push({weight:t.weights[r]?t.weights[r]:0,relationId:`${e.id}_${t.id}`,x1:e.x,y1:e.y,x2:t.x,y2:t.y,colorSource:e.color,colorTarget:t.color,midPointLine:Bt({x:e.x,y:e.y},{x:t.x,y:t.y}),midPointBezier:Ht({x1:e.x,x2:t.x,y1:e.y,y2:t.y}),...e})})})}function Ht(e){let t={x:e.x1,y:e.y1},n={x:e.x2,y:e.y2},r={x:e.x1,y:e.y1},i={x:G.value.width/2,y:G.value.height/2+j.value.circle.offsetY},a=.5;return{x:.5**3*t.x+3*.5**2*a*r.x+1.5*a**2*i.x+a**3*n.x,y:.5**3*t.y+3*.5**2*a*r.y+1.5*a**2*i.y+a**3*n.y}}let Ut=l(()=>Math.max(...L.value.map(e=>e.weight)));function Wt(e){return Object.hasOwn(R.value,`x`)?z.value.includes(e.id)?`opacity:1`:`opacity:0.1`:`opacity:1`}function Y(e){return e.colorSource}function Gt(e){return Object.hasOwn(R.value,`x`)?z.value.includes(e.id)&&e.relationId===`${e.id}_${R.value.id}`||e.relationId===`${R.value.id}_${e.id}`?`opacity:1;stroke-width:${en(e)}`:`opacity: 0`:`opacity: 1`}function X(e){return Object.hasOwn(R.value,`x`)?!!(z.value.includes(e.id)&&e.relationId===`${e.id}_${R.value.id}`||e.relationId===`${R.value.id}_${e.id}`):!1}function Kt(e){return e.regAngle>90&&e.regAngle<270?`end`:`start`}function qt(e){return e.regAngle>90&&e.regAngle<270?e.x-5:e.x+5}function Jt(e){return Object.hasOwn(R.value,`x`)?R.value.id===e.id||z.value.includes(e.id)?`opacity:1`:`opacity:0.2`:`opacity:1`}function Yt(e){return e.regAngle>90&&e.regAngle<270?`rotate(${e.regAngle+180},${e.x},${e.y})`:`rotate(${e.regAngle},${e.x},${e.y})`}let Z=v(null);function Xt(e,t){Z.value=t,E.value=t,O.value.events.datapointEnter&&O.value.events.datapointEnter({datapoint:e,seriesIndex:t})}function Zt(e,t){Z.value=null,D.value||(E.value=null),O.value.events.datapointLeave&&O.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Qt(e,t){e&&(O.value.events.datapointClick&&O.value.events.datapointClick({datapoint:e,seriesIndex:t}),At.value=360-e.regAngle,R.value.id&&e.id===R.value.id?(R.value={},z.value=[]):(R.value=e,z.value=[...e.relations]))}function $t(e,t){E.value=t,Qt(e,t)}function en(e){let t=e.weight/Ut.value*j.value.links.maxWidth;return Math.max(.3,t)}let Q=v(!1);function tn(e){Q.value=e,pt.value+=1}let $=v(!1);function nn(){$.value=!$.value}async function rn({scale:e=2}={}){if(!T.value)return;let{width:t,height:n}=T.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await fe({domElement:T.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:j.value.title.text,width:t,height:n,aspectRatio:r}}let an=l(()=>j.value.backgroundColor),on=l(()=>j.value.title),{isCallbackImaging:sn,isCallbackSvg:cn,generateSvg:ln,onGenerateImage:un}=me({svg:N,title:on,legend:null,legendItems:null,backgroundColor:an,getSvgCallback:()=>O.value.userOptions.callbacks.svg,generateImage:Dt});async function dn(){dt(`copyAlt`,{config:O.value,dataset:B.value}),O.value.userOptions.callbacks.altCopy?await Promise.resolve(O.value.userOptions.callbacks.altCopy({config:O.value,dataset:B.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function fn(){D.value=!0,I.value.length&&E.value===null&&(E.value=0)}function pn(){D.value=!1,E.value=null}function mn(e){if(!N.value||$.value||document.activeElement!==N.value||!I.value.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){E.value=null,R.value={},z.value=[];return}if(r){if(E.value===null)return;let e=I.value[E.value];if(!e)return;Qt(e,E.value);return}let a=E.value;a===null||a<0||a>=I.value.length?a=n?0:I.value.length-1:n?(a+=1,a>=I.value.length&&(a=0)):t&&(--a,a<0&&(a=I.value.length-1)),E.value=a,Z.value=a;let o=I.value[a];o&&O.value.events.datapointEnter&&O.value.events.datapointEnter({datapoint:o,seriesIndex:a})}let hn=l(()=>({headers:[`ID`,`Label`,`Total weight`,`Relations count`,`Relations`],rows:B.value.map(e=>{let t=e.relations.map(e=>B.value.find(t=>t.id===e)?.label||e).join(`, `),n=(e.weights||[]).reduce((e,t)=>e+Number(t||0),0);return[e.id,e.label,n,e.relations.length,t]})}));return ue({getImage:rn,generatePdf:Et,generateSvg:ln,generateImage:Dt,toggleAnnotator:nn,toggleFullscreen:tn,copyAlt:dn}),(e,t)=>(_(),f(`div`,{ref_key:`relationCircleChart`,ref:T,class:`vue-data-ui-component vue-ui-relation-circle`,style:g(`width:100%;background:${j.value.backgroundColor};text-align:center;${O.value.responsive?`height: 100%`:``}`),id:`relation_circle_${w.value}`,onMouseenter:t[0]||=()=>S(Ct)(!0),onMouseleave:t[1]||=()=>S(Ct)(!1)},[p(`div`,{id:`chart-instructions-${w.value}`,class:`sr-only`},[p(`p`,null,x(O.value.a11y.translations.keyboardNavigation),1)],8,He),hn.value?.rows?.length?(_(),u(Se,{key:0,uid:w.value,head:hn.value.headers,body:hn.value.rows,notice:O.value.a11y.translations.tableAvailable,caption:O.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):d(``,!0),k.value.buttons.annotator?(_(),u(S(st),{key:1,svgRef:S(N),backgroundColor:j.value.backgroundColor,color:j.value.color,active:$.value,isCursorPointer:M.value,palette:k.value.annotatorPalette,onClose:nn},De({_:2},[y(S(ge),t=>({name:t,fn:ze(n=>[b(e.$slots,t,h(m(S(he)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):d(``,!0),Ot.value?(_(),f(`div`,{key:2,ref_key:`noTitle`,ref:gt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):d(``,!0),j.value.title.text?(_(),f(`div`,{key:3,ref_key:`chartTitle`,ref:mt,style:`width:100%;background:transparent`},[(_(),u(pe,{key:`title_${_t.value}`,config:{title:{cy:`relation-div-title`,...j.value.title},subtitle:{cy:`relation-div-subtitle`,...j.value.title.subtitle}}},null,8,[`config`]))],512)):d(``,!0),k.value.show&&ft.value&&(S(wt)||S(St))?(_(),u(S(ct),{ref:`details`,key:`user_options_${pt.value}`,backgroundColor:j.value.backgroundColor,color:j.value.color,isPrinting:S(P),isImaging:S(F),uid:w.value,hasPdf:k.value.buttons.pdf,hasImg:k.value.buttons.img,hasSvg:k.value.buttons.svg,hasFullscreen:k.value.buttons.fullscreen,hasAltCopy:k.value.buttons.altCopy,hasXls:!1,isFullscreen:Q.value,titles:{...k.value.buttonTitles},chartElement:T.value,position:k.value.position,hasAnnotator:k.value.buttons.annotator,isAnnotation:$.value,callbacks:k.value.callbacks,printScale:k.value.print.scale,isCursorPointer:M.value,onToggleFullscreen:tn,onGeneratePdf:S(Et),onGenerateImage:S(un),onGenerateSvg:S(ln),onToggleAnnotator:nn,onCopyAlt:dn,style:g({visibility:S(wt)?S(St)?`visible`:`hidden`:`visible`})},De({_:2},[y(S(_e)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:ze(n=>[b(e.$slots,t,h(m(S(ve)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasImg`,`hasSvg`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`titles`,`chartElement`,`position`,`hasAnnotator`,`isAnnotation`,`callbacks`,`printScale`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):d(``,!0),p(`div`,Ue,[(_(),f(`svg`,{ref_key:`svgRef`,ref:N,xmlns:S(ne),class:Me([{"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value},`relation-circle`]),viewBox:`0 0 ${G.value.width<=0?10:G.value.width} ${G.value.height<=0?10:G.value.height}`,width:`100%`,style:`user-select:none; background:transparent`,"aria-describedby":`chart-instructions-${w.value}`,tabindex:`0`,onFocus:fn,onBlur:pn,onKeydown:mn},[ke(S(lt)),b(e.$slots,`svg-underlayer`,{svg:{...G.value,isPrintingImg:S(P)||S(F)||S(sn),isPrintingSvg:S(cn)}},void 0,!0),e.$slots[`chart-background`]?(_(),f(`foreignObject`,{key:0,x:0,y:0,width:G.value.width<=0?10:G.value.width,height:G.value.height<=0?10:G.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,Ge)):d(``,!0),p(`circle`,{cx:(G.value.width<=0?1e-4:G.value.width)/2,cy:(G.value.height<=0?1e-4:G.value.height)/2+j.value.circle.offsetY,r:K.value<=0?1e-4:K.value,stroke:j.value.circle.stroke,"stroke-width":j.value.circle.strokeWidth,fill:`transparent`,class:`main-circle`},null,8,Ke),jt.value?(_(),f(`g`,qe,[(_(!0),f(c,null,y(L.value,(e,t)=>(_(),f(`path`,{key:`relation_${t}`,style:g(Gt(e)),stroke:Y(e),class:Me([`relation`,{"vue-ui-relation-circle-selected":R.value.hasOwnProperty(`id`)&&z.value.includes(e.id)}]),d:`M${e.x1},${e.y1} C${e.x1},${e.y1} ${G.value.width/2},${G.value.height/2+j.value.circle.offsetY} ${e.x2},${e.y2}`,fill:`none`,"stroke-width":en(e),"stroke-linecap":`round`},null,14,Je))),128)),(_(!0),f(c,null,y(L.value,(t,r)=>(_(),f(`g`,Ye,[X(t)?b(e.$slots,`dataLabel`,je({ref_for:!0},{x:t.midPointBezier.x,y:t.midPointBezier.y,color:Y(t),weight:t.weight,fontSize:H.value}),void 0,!0,0):d(``,!0),X(t)&&!e.$slots.dataLabel?(_(),f(`circle`,{key:1,cx:t.midPointBezier.x,cy:t.midPointBezier.y,fill:Y(t),r:H.value,stroke:j.value.backgroundColor,"stroke-width":`1`},null,8,Xe)):d(``,!0),X(t)&&!e.$slots.dataLabel?(_(),f(`text`,{key:2,x:t.midPointBezier.x,y:t.midPointBezier.y+H.value/3,fill:S(te)(Y(t)),"text-anchor":`middle`,"font-size":H.value},x(S(o)(A.value.formatter,t.weight,S(n)({p:A.value.prefix,v:t.weight,s:A.value.suffix,r:A.value.rounding}),{...t})),9,Ze)):d(``,!0)]))),256))])):(_(),f(`g`,Qe,[(_(!0),f(c,null,y(L.value,(e,t)=>(_(),f(`line`,{key:`relation_${t}`,stroke:Y(e),"stroke-width":en(e),style:g(Gt(e)),x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,class:Me({"vue-ui-relation-circle-selected":R.value.hasOwnProperty(`id`)&&z.value.includes(e.id)}),"stroke-linecap":`round`},null,14,$e))),128)),(_(!0),f(c,null,y(L.value,(t,r)=>(_(),f(`g`,et,[X(t)?b(e.$slots,`dataLabel`,je({ref_for:!0},{x:t.midPointLine.x,y:t.midPointLine.y,color:Y(t),weight:t.weight,fontSize:H.value}),void 0,!0,0):d(``,!0),X(t)&&!e.$slots.dataLabel&&A.value.show?(_(),f(`circle`,{key:1,cx:t.midPointLine.x,cy:t.midPointLine.y,fill:Y(t),r:H.value,stroke:j.value.backgroundColor,"stroke-width":`1`},null,8,tt)):d(``,!0),X(t)&&!e.$slots.dataLabel&&A.value.show?(_(),f(`text`,{key:2,x:t.midPointLine.x,y:t.midPointLine.y+H.value/3,fill:S(te)(Y(t)),"text-anchor":`middle`,"font-size":H.value},x(S(o)(A.value.formatter,t.weight,S(n)({p:A.value.prefix,v:t.weight,s:A.value.suffix,r:A.value.rounding}),{...t})),9,nt)):d(``,!0)]))),256))])),(_(!0),f(c,null,y(I.value,(e,t)=>(_(),f(`text`,{key:`plot_text_${t}`,"text-anchor":Kt(e),transform:Yt(e),x:qt(e),y:e.y+5,class:`vue-ui-relation-circle-legend`,"transform-origin":`start`,"font-weight":R.value.id===e.id?`900`:`400`,style:g(`font-family:${j.value.fontFamily};${Jt(e)};cursor:${M.value?`pointer`:`default`}`),"font-size":W.value,fill:j.value.labels.color,"text-decoration":t===Z.value||t===E.value?`underline`:void 0,onClick:n=>$t(e,t),onMouseenter:n=>Xt(e,t),onMouseleave:n=>Zt(e,t)},[S(yt)?(_(),f(c,{key:0},[Oe(`--------`)],64)):(_(),f(c,{key:1},[Oe(x(e.label)+` (`+x(S(o)(A.value.formatter,e.totalWeight,S(n)({p:A.value.prefix,v:e.totalWeight,s:A.value.suffix,r:A.value.rounding}),{...e}))+`) `,1)],64))],44,rt))),128)),(_(!0),f(c,null,y(I.value,(e,t)=>(_(),f(`circle`,{cx:e.x,cy:e.y,key:`plot_${t}`,style:g(`${Wt(e)}; transition: r 0.2s ease-in-out; cursor:${M.value?`pointer`:`default`}`),class:`vue-ui-relation-circle-plot`,fill:j.value.plot.useSerieColor?e.color:j.value.plot.color,stroke:j.value.backgroundColor,"stroke-width":`1`,r:U.value*(t===Z.value||t===E.value?2:1),onClick:n=>$t(e,t),onMouseenter:n=>Xt(e,t),onMouseleave:n=>Zt(e,t)},null,44,it))),128)),b(e.$slots,`svg`,{svg:{...G.value,isPrintingImg:S(P)||S(F)||S(sn),isPrintingSvg:S(cn)}},void 0,!0)],42,We)),e.$slots.hint?(_(),f(`div`,at,[b(e.$slots,`hint`,h(m({hint:O.value.a11y.translations.keyboardNavigation,isVisible:D.value})),void 0,!0)])):d(``,!0)]),e.$slots.watermark?(_(),f(`div`,ot,[b(e.$slots,`watermark`,h(m({isPrinting:S(P)||S(F)||S(sn)||S(cn)})),void 0,!0)])):d(``,!0),e.$slots.source?(_(),f(`div`,{key:6,ref_key:`source`,ref:ht,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):d(``,!0),b(e.$slots,`skeleton`,{},()=>[S(yt)?(_(),u(se,{key:0})):d(``,!0)],!0)],44,Ve))}},[[`__scopeId`,`data-v-64ac9170`]]);export{Be as n,st as t};
@@ -1,2 +1,2 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Ht as i,J as a,N as ee,P as te,S as o,U as ne,X as re,Xt as ie,at as s,i as c,in as ae,nt as oe,r as se,t as ce,tt as le,w as ue,xt as de,yt as fe,zt as pe}from"./lib-rPeBMZrn.js";import{n as me,t as he}from"./BaseScanner-8NdoBs7B.js";import{n as ge,t as _e}from"./useHints-C-TwxM0Y.js";import{t as ve}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ye}from"./resolveChartConfig-CIhClE5R.js";import{t as be}from"./chartImage-DPGnEuYM.js";import{n as xe}from"./Title-BliHuXfT.js";import{t as Se}from"./useChartExport-BZts4KFb.js";import{n as Ce,t as we}from"./tableIntegration-CNoJ1CIY.js";import{n as Te,t as Ee}from"./annotationSlots-BRR85CqJ.js";import{n as De,t as Oe}from"./userOptionsSlots-DYuo-E5m.js";import{t as ke}from"./useTimeLabels-Das5O74F.js";import{t as Ae}from"./usePrinter-DVf3YcG5.js";import{t as je}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Me}from"./Shape-CRe8woTu.js";import{c as Ne}from"./canvas-lib-22VpOI4_.js";import{t as Pe}from"./useResponsive-CENUxfEL.js";import{t as Fe}from"./DefGrad-DKMq1REY.js";import{t as Ie}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Le}from"./A11yDataTable-DWNlWXzs.js";import{t as Re}from"./useUserOptionState-CXlFnwPv.js";import{t as ze}from"./useChartAccessibility-DOMuYJfm.js";import{t as Be}from"./Legend-DM0ClX3D.js";import{t as Ve}from"./vue_ui_ridgeline-Di26JtQu.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as He,createTextVNode as Ue,createVNode as We,defineAsyncComponent as h,guardReactiveProps as Ge,mergeProps as Ke,nextTick as qe,normalizeClass as Je,normalizeProps as Ye,normalizeStyle as g,onBeforeUnmount as Xe,openBlock as _,ref as v,renderList as y,renderSlot as b,resolveDynamicComponent as Ze,shallowRef as Qe,toDisplayString as x,toRefs as $e,unref as S,watch as et,watchEffect as tt,withCtx as C}from"vue";var nt=/* @__PURE__ */ e({default:()=>Tt}),rt=[`id`],it=[`id`],at={style:{position:`relative`}},ot=[`xmlns`,`aria-describedby`,`viewBox`],st={key:0},ct=[`fill`,`d`],lt=[`stroke`,`stroke-width`,`d`],ut=[`fill`,`d`],dt=[`stroke`,`stroke-dasharray`,`stroke-width`,`d`],ft=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],pt=[`cx`,`cy`,`stroke`,`stroke-width`,`r`,`fill`],mt=[`x`,`y`,`font-size`,`font-weight`,`fill`,`text-decoration`,`onMouseenter`,`onClick`],ht={key:0},gt=[`font-size`,`fill`,`stroke`,`font-weight`,`transform`,`text-anchor`],_t=[`font-size`,`fill`,`font-weight`,`transform`,`text-anchor`,`innerHTML`],vt=[`x`,`y`,`width`,`height`,`onMouseenter`,`onMouseleave`,`onClick`],yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],bt=[`cx`,`cy`,`stroke`,`stroke-width`,`r`,`fill`],xt=[`x`,`y`,`stroke`,`text-anchor`,`font-size`,`fill`],St={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Ct={key:5,class:`vue-data-ui-watermark`},wt=[`onClick`],Tt=/*#__PURE__*/ ve({__name:`vue-ui-ridgeline`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`selectX`,`copyAlt`],setup(e,{expose:ve,emit:nt}){let Tt=h(()=>import(`./vue-ui-xy-C-2Phexw.js`).then(e=>e.n)),Et=h(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),Dt=h(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Ot=h(()=>import(`./DataTable-0Vv-aGHD.js`)),kt=h(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),At=h(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),jt=h(()=>import(`./PackageVersion-CXT-eAuk.js`).then(e=>e.t)),Mt=h(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_ridgeline:Nt}=t(),w=e,Pt=u({get(){return Array.isArray(B.value)&&B.value.length>0},set(e){return e}}),Ft=nt,T=v(null),It=v(null),Lt=v(null),E=Qe(null),D=Qe(null),Rt=v(null),zt=v(null),Bt=v(0),Vt=v(0),Ht=v(0),O=v(re()),Ut=v(0),Wt=v(0),Gt=v(512),k=v(null),A=v(null),Kt=v(null),qt=v(0),Jt=v(null),Yt=v(null),Xt=v(null),j=v(null),Zt=v(!1);function Qt(){return ye(w.config,Nt,Ve)}let M=v(Qt()),N=u(()=>M.value.userOptions),P=u(()=>M.value.style.chart.areas),F=u(()=>M.value.style.chart.selector),I=u(()=>M.value.style.chart.xAxis.labels),L=u(()=>M.value.style.chart.yAxis.labels),R=u(()=>M.value.style.chart);ge({config:()=>M.value,dataset:()=>w.dataset,component:`VueUiRidgeline`,rules:[_e.emptyArray,{test:e=>e.length>31,message:[`👀 The number of series > 31. Consider:`,``,`▶️ Using filters to let users choose a maximum number of series to display`,``,`▶️ Use several instances of the component to show related series`]},{test:e=>e.some(e=>e.datapoints.some(e=>e.values.length>200)),message:[`👀 Some series contain > 200 data points, which can affect performance. Consider if you really need this level of detail.`,``,`▶️ Use larger time scales, or aggregated values.`,``,`▶️ Filter the time range by adding date inputs in your UI.`]},{test:e=>e.length<6&&e.length>0,message:[`👀 The number of series < 6. Consider:`,``,`▶️ Using VueUiXy instead`]}]});let z=u(()=>M.value.userOptions.useCursorPointer),$t=u(()=>ae({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,areas:{maxPoint:{show:!1},opacity:.9,stroke:{useSerieColor:!0}},legend:{backgroundColor:`transparent`},padding:{right:-24,left:0},xAxis:{labels:{values:[]}},yAxis:{labels:{fontSize:0}},zeroLine:{show:!1}}}},userConfig:M.value.skeletonConfig??{}})),{loading:en,FINAL_DATASET:B,manualLoading:tn}=me({...$e(w),FINAL_CONFIG:M,prepareConfig:Qt,skeletonDataset:w.config?.skeletonDataset??[{name:`_`,datapoints:[{name:`__`,color:`#999999`,values:[28.639,32.04,41.134,44.525,21.151,2.436,.218,.024,.002,0,0,0]},{name:`_`,color:`#CACACA`,values:[13.253,15.621,23.36,33.698,29.935,10.874,2.364,.561,.107,.02,.006,.004]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[10.851,13.195,21.617,36.556,42.292,21.006,3.398,.223,.013,.001,0,0]},{name:`_`,color:`#CACACA`,values:[3.171,4.115,8.108,18.248,31.641,29.063,12.031,2.742,.504,.102,.032,.021]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[1.731,2.334,5.125,13.626,29.911,38.524,24.168,7.646,1.575,.317,.097,.063]},{name:`_`,color:`#CACACA`,values:[.25,.367,1.026,3.944,13.635,28.891,30.149,15.419,4.714,1.246,.442,.299]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[.034,.054,.194,1.065,5.747,20.735,38.306,32.899,15.318,5.566,2.422,1.76]},{name:`_`,color:`#CACACA`,values:[.001,.002,.009,.095,1.124,8.342,27.115,35.08,21.449,9.093,4.243,3.143]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[0,.001,.004,.051,.567,3.322,14.215,44.783,40.351,20.377,9.866,7.378]},{name:`_`,color:`#CACACA`,values:[0,0,0,0,.001,.11,4.136,27.498,43.24,29.807,17.345,13.678]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[0,0,0,0,.025,.598,3.886,10.645,54.479,45.953,30.814,24.55]},{name:`_`,color:`#CACACA`,values:[0,0,0,0,0,0,.007,1.655,26.63,52.017,45.192,39.651]}]}],skeletonConfig:ae({defaultConfig:M.value,userConfig:$t.value})}),V=v(Math.min(P.value.height,P.value.rowHeight)),{userOptionsVisible:nn,setUserOptionsVisibility:rn,keepUserOptionState:an}=Re({config:M.value}),{svgRef:H}=ze({config:R.value.title}),on=u(()=>M.value.debug);function sn(){let e=B.value||[];if(!Array.isArray(e)||e.length===0)s({componentName:`VueUiRidgeline`,type:`dataset`,debug:on.value}),tn.value=!0;else if(e.forEach((e,t)=>{fe({datasetObject:e,requiredAttributes:[`name`,`datapoints`]}).forEach(e=>{Pt.value=!1,s({componentName:`VueUiRidgeline`,type:`datasetSerieAttribute`,property:e,index:t,debug:on.value})}),Array.isArray(e.datapoints)&&e.datapoints.length&&e.datapoints.forEach((e,n)=>{fe({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{Pt.value=!1,s({componentName:`VueUiRidgeline`,type:`datasetSerieAttribute`,property:`datapoint.${e}`,index:`${t}-${n}`,debug:on.value})})})}),Wt.value=e.length,V.value=Math.min(P.value.height,P.value.rowHeight),pe(w.dataset)||(tn.value=M.value.loading),M.value.responsive){let t=Ne(()=>{let{width:t,height:n}=Pe({chart:T.value,title:R.value.title.text?It.value:null,legend:R.value.legend.show?Lt.value:null,source:Rt.value,noTitle:zt.value,padding:R.value.padding});requestAnimationFrame(()=>{Gt.value=t,V.value=e.length?n/e.length:0,qt.value=n-12})});E.value&&(D.value&&E.value.unobserve(D.value),E.value.disconnect()),E.value=new ResizeObserver(t),D.value=T.value?.parentNode||null,D.value&&E.value.observe(D.value)}}Xe(()=>{E.value&&(D.value&&E.value.unobserve(D.value),E.value.disconnect())});let{isPrinting:cn,isImaging:ln,generatePdf:un,generateImage:dn}=Ae({elementId:`vue-ui-ridgeline_${O.value}`,fileName:R.value.title.text||`vue-ui-ridgeline`,options:M.value.userOptions.print}),fn=u(()=>M.value.userOptions.show&&!R.value.title.text),pn=u(()=>ue(M.value.customPalette)),U=v({showTable:M.value.table.show});et(()=>B.value,async e=>{Array.isArray(e)&&e.length&&(nn.value=!M.value.userOptions.showOnChartHover,await qe(),sn(),Bt.value+=1,Ht.value+=1,U.value.showTable=M.value.table.show)},{deep:!0,immediate:!0}),et(()=>w.dataset,e=>{Array.isArray(e)&&e.length>0&&(tn.value=!1)},{deep:!0}),et(()=>en.value,async e=>{e||(await qe(),sn())},{immediate:!0}),et(()=>w.config,()=>{M.value=Qt(B.value||null),nn.value=!M.value.userOptions.showOnChartHover,V.value=Math.min(P.value.height,P.value.rowHeight),U.value.showTable=M.value.table.show,Bt.value+=1,Ht.value+=1},{deep:!0});let mn=u(()=>P.value.height/P.value.rowHeight);function hn(){X.value.length?X.value=[]:Z.value.forEach(e=>{X.value.push(e.id)}),Ft(`selectLegend`,Y.value)}function gn(e){X.value.includes(e)?X.value=X.value.filter(t=>t!==e):X.value.push(e),Ft(`selectLegend`,Y.value)}function _n(e){return Z.value.length?Z.value.find(t=>t.name===e)||(on.value&&console.warn(`VueUiRidgeline - Series name not found "${e}"`),null):(on.value&&console.warn(`VueUiRidgeline - There are no series to show.`),null)}function vn(e){let t=_n(e);t!==null&&X.value.includes(t.id)&&gn(t.id)}function yn(e){let t=_n(e);t!==null&&(X.value.includes(t.id)||gn(t.id))}let W=u(()=>Pt.value?(B.value||[]).map(e=>({...e,labelLen:Nn(e.name,L.value.fontSize),uid:re(),datapoints:e.datapoints.map((e,t)=>{let n=e.color?o(e.color):pn.value[t]||i[t]||i[t%i.length],r=ie(e.name);return{...e,color:n,id:r}})})):[]),bn=u(()=>R.value.padding.top+V.value*(B.value||[]).length+V.value*mn.value+R.value.padding.bottom),G=u(()=>{let e=R.value.padding;return{width:Gt.value,height:bn.value,padding:e}}),xn=u(()=>G.value.width),Sn=u(()=>G.value.height),Cn=v(0),wn=Ne(e=>{Cn.value=e},100);tt(e=>{let t=Jt.value;if(!t)return;let n=new ResizeObserver(e=>{wn(e[0].contentRect.height)});n.observe(t),e(()=>n.disconnect())}),Xe(()=>{Cn.value=0});let K=u(()=>({fullHeight:G.value.height+Cn.value,top:G.value.padding.top,left:G.value.padding.left,right:G.value.width-G.value.padding.right,bottom:G.value.height-R.value.padding.bottom,width:G.value.width-(G.value.padding.left+G.value.padding.right)})),Tn=u(()=>Math.max(...W.value.flatMap(e=>e.datapoints.map(e=>e.values.length)))),q=v([]),En=0;tt(()=>{let e=++En;(async()=>{let t=await ke({values:I.value.values,maxDatapoints:Tn.value,formatter:I.value.datetimeFormatter,start:0,end:I.value.values.length});e===En&&(q.value=t)})()});let J=u(()=>{let e=Math.max(...W.value.map(e=>e.labelLen)),t=G.value.padding.left+e+16+L.value.offsetX,n=(K.value.width-t)/Tn.value,r=[];for(let e=0;e<Tn.value;e+=1)r.push({selectorX:t+n*e,x:t+n*e-n/2,y:K.value.top,label:I.value.values[e]?q.value[e]?.text??``:``,index:e,width:n,height:bn.value});return r});function Dn(e){return W.value.map(t=>t.datapoints.map(t=>({dp:t,selected:t.values[e.index]})))}function On(e){k.value=e;let t=Dn(e);M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:t,seriesIndex:e.index})}function kn(e){k.value=null;let t=Dn(e);M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:t,seriesIndex:e.index})}function An(e){let t=Dn(e);M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:t,seriesIndex:e.index}),Ft(`selectX`,t)}function jn(e,t){return e.length*t/2+t}function Mn(e,t,n){return e+jn(t,n)>K.value.right}function Nn(e,t,n=`sans-serif`){let r=document.createElement(`canvas`).getContext(`2d`);return r.font=`${typeof t==`number`?`${t}px`:t} ${n}`,r.measureText(e).width}let Y=u(()=>{V.value;let e=Math.max(...W.value.map(e=>e.labelLen)),t=Math.max(...W.value.flatMap(e=>e.datapoints.flatMap(e=>e.values))),n=Math.min(...W.value.flatMap(e=>e.datapoints.flatMap(e=>e.values))),r=G.value.padding.left+e+16+L.value.offsetX,i=(K.value.width-r)/Tn.value,a=Math.abs(Math.min(n,0)),o=t+a;function ie(e){return isNaN(e/o)?0:e/o}return W.value.map((e,t)=>{let n=V.value*mn.value*(1-ie(a)),o=K.value.top+V.value*t,s=K.value.top+o+n;return{...e,label:{x:r-L.value.fontSize,y:(L.value.centered?s-n/2:s)+L.value.offsetY},datapoints:e.datapoints.map(e=>{let t=e.values.map((t,n)=>{let ee=isNaN(t)||[void 0,null,`NaN`,NaN,1/0,-1/0].includes(t)?0:t||0;return{x:r+i*n,y:K.value.top+o+V.value*mn.value*(1-ie(ee+a)),value:t,isMaxPoint:t===Math.max(...e.values),zero:s}}),n=`${ee(t,s,!1,!1)}`,c=`M ${r},${s} ${ne(t)} ${t.at(-1).x},${s}`,ae=`M ${r},${s} ${t.at(-1).x},${s}`,oe=`M ${te(t)}`,se=`M ${ne(t)}`,ce=de(P.value.smooth?oe:se);return{...e,uid:re(),plots:t,smoothPath:n,straightPath:c,zeroPath:ae,pathLength:ce,smoothPathRidge:oe,straightPathRidge:se}}).filter(e=>!X.value.includes(e.id))}})}),X=v([]);function Pn(e){let t=/* @__PURE__ */ new Map;return e.forEach(e=>{e.datapoints.forEach((e,n)=>{let r=ie(e.name);t.has(r)||t.set(r,{id:r,name:e.name,color:e.color,shape:`circle`,segregate:()=>gn(r),isSegregated:X.value.includes(r),opacity:X.value.includes(r)?.5:1})})}),Array.from(t.values())}let Z=u(()=>Pn(W.value)),Fn=u(()=>({cy:`donut-div-legend`,backgroundColor:R.value.legend.backgroundColor,color:R.value.legend.color,fontSize:R.value.legend.fontSize,paddingBottom:12,fontWeight:R.value.legend.bold?`bold`:``})),Q=v(!1);function In(e){Q.value=e,Ut.value+=1}let Ln=v({}),Rn=v([]);function zn(e){Ft(`selectDatapoint`,e),R.value.dialog.show&&(Rn.value=e.datapoints.map(e=>({name:e.name,color:e.color,type:`line`,useArea:!0,smooth:P.value.smooth,series:e.values})),A.value=e,Ln.value=le({...R.value.dialog.xyChart,responsive:!0,chart:{...R.value.dialog.xyChart.chart,grid:{...R.value.dialog.xyChart.chart.grid,labels:{...R.value.dialog.xyChart.chart.grid.labels,xAxisLabels:{...R.value.dialog.xyChart.chart.grid.labels.xAxisLabels,values:I.value.values,autoRotate:{enable:!0,angle:R.value.dialog.xyChart.chart.grid.labels.xAxisLabels.autoRotate.angle},datetimeFormatter:I.value.datetimeFormatter}}},tooltip:{...R.value.dialog.xyChart.chart.tooltip,showTimeLabel:I.value.values.length>0},userOptions:{...R.value.dialog.xyChart.chart.userOptions,buttons:{...R.value.dialog.xyChart.chart.userOptions.buttons,altCopy:M.value.userOptions.buttons.altCopy},callbacks:{...R.value.dialog.xyChart.chart.userOptions.callbacks,altCopy:()=>{}},useCursorPointer:M.value.userOptions.useCursorPointer}}}),Kt.value&&Kt.value.open())}let Bn=v(null);function Vn(e){Bn.value=e}function Hn(){Bn.value=null}let Un=v(!1);function Wn(){Un.value=!Un.value}function Gn(){U.value.showTable=!U.value.showTable}let Kn=u(()=>({body:Y.value.flatMap(e=>e.datapoints.flatMap(t=>({...t,rowName:`${e.name}: ${t.name}`}))).map(e=>[{name:e.rowName,color:e.color},...e.values])})),$=u(()=>{let e=[M.value.table.columnNames.series,...q.value.map(e=>e.text)],t={th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint};return{colNames:[M.value.table.columnNames.series,...q.value.map(e=>e.text)],head:e,body:Kn.value.body,config:t}});function qn(e=null){qe(()=>{let t=[[M.value.table.columnNames.series,...q.map(e=>[e.text])],...Kn.value.body.map((e,t)=>[e[0].name,...e.slice(1)])],n=[[R.value.title.text],[R.value.title.subtitle.text]].concat(t),i=r(n);e?e(i):oe({csvContent:i,title:R.value.title.text||`vue-ui-ridgeline`})})}function Jn(){return Y.value}let Yn=be(T,()=>R.value.title.text),Xn=u(()=>({min:0,max:Tn.value}));je({timeLabelsEls:Jt,timeLabels:q,slicer:Xn,configRef:M,rotationPath:[`style`,`chart`,`xAxis`,`labels`,`rotation`],autoRotatePath:[`style`,`chart`,`xAxis`,`labels`,`autoRotate`,`enable`],isAutoSize:!1,width:xn,height:Sn,targetClass:`.vue-ui-ridgeline-x-axis-label`,angle:I.value.autoRotate.angle});let Zn=u(()=>we({config:M,style:R,mutableConfig:U,dialog:Mt,accordion:Dt,isFullscreen:Q,parent:T,maxWidth:800,isCursorPointer:z}));et(()=>U.value.showTable,e=>Ce(e,M,Yt));function Qn(){U.value.showTable=!1,Xt.value&&Xt.value.setTableIconState(!1)}let $n=u(()=>R.value.backgroundColor),er=u(()=>({...R.value.legend,position:`bottom`})),tr=u(()=>R.value.title),{isCallbackImaging:nr,isCallbackSvg:rr,generateSvg:ir,onGenerateImage:ar}=Se({svg:H,title:tr,legend:er,legendItems:Z,backgroundColor:$n,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:dn});function or(e){sr(`xy-zoom`,e.dataset,e.config)}async function sr(e=`main-chart`,t=null,n=null){Ft(`copyAlt`,{source:e,config:e===`main-chart`?M.value:Ln.value,dataset:e===`main-chart`?Y.value:Rn.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({source:e,config:e===`main-chart`?M.value:Ln.value,dataset:e===`main-chart`?Y.value:Rn.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function cr(){j.value=null,Zt.value=!0}function lr(){pr(),Zt.value=!1}function ur(e){if(!H.value||Un.value||document.activeElement!==H.value||!Y.value.length)return;let t=e.key===`ArrowUp`,n=e.key===`ArrowDown`,r=e.key===`ArrowLeft`,i=e.key===`ArrowRight`,a=e.key===`Enter`||e.key===` `,ee=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!ee)return;if(e.preventDefault(),e.stopPropagation(),ee){pr();return}if(a){if(j.value!==null){let e=Y.value[j.value];e&&zn(e);return}k.value&&An(k.value);return}if(t||n){let e=j.value;e=e===null?n?0:Y.value.length-1:dr(e+(n?1:-1)),j.value=e,Bn.value=e;return}if(!J.value.length)return;let te=k.value?.index??null;te=te===null?i?0:J.value.length-1:fr(te+(i?1:-1));let o=J.value[te];o&&On(o)}function dr(e){let t=Y.value.length;return t?(e%t+t)%t:null}function fr(e){let t=J.value.length;return t?(e%t+t)%t:null}function pr(){j.value=null,Bn.value=null,k.value?kn(k.value):k.value=null}let mr=u(()=>({head:$.value.head,body:$.value.body.map(e=>[e[0]?.name??``,...e.slice(1)]),caption:M.value.a11y.translations.tableCaption,notice:M.value.a11y.translations.tableAvailable}));return ve({getData:Jn,getImage:Yn,generateImage:dn,generateSvg:ir,generatePdf:un,generateCsv:qn,hideSeries:yn,showSeries:vn,toggleAnnotator:Wn,toggleTable:Gn,toggleFullscreen:In,copyAlt:sr}),(e,t)=>(_(),p(`div`,{ref_key:`ridgelineChart`,ref:T,class:Je(`vue-data-ui-component vue-ui-ridgeline ${Q.value?`vue-data-ui-wrapper-fullscreen`:``}`),id:`vue-ui-ridgeline_${O.value}`,style:g({fontFamily:M.value.style.fontFamily,width:`100%`,textAlign:`center`,background:R.value.backgroundColor,height:M.value.responsive?`100%`:void 0}),onMouseenter:t[3]||=()=>S(rn)(!0),onMouseleave:t[4]||=()=>S(rn)(!1)},[m(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[m(`p`,null,x(M.value.a11y.translations.keyboardNavigation),1)],8,it),mr.value.body.length?(_(),d(Le,{key:0,uid:O.value,head:mr.value.head,body:mr.value.body,caption:mr.value.caption,notice:mr.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):f(``,!0),N.value.buttons.annotator&&S(H)?(_(),d(S(kt),{key:1,color:R.value.color,backgroundColor:R.value.backgroundColor,active:Un.value,svgRef:S(H),isCursorPointer:z.value,onClose:Wn},He({_:2},[y(S(Ee),t=>({name:t,fn:C(n=>[b(e.$slots,t,Ye(Ge(S(Te)(t,n))),void 0,!0)])}))]),1032,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`])):f(``,!0),b(e.$slots,`userConfig`,{},void 0,!0),fn.value?(_(),p(`div`,{key:2,ref_key:`noTitle`,ref:zt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),R.value.title.text?(_(),p(`div`,{key:3,ref_key:`chartTitle`,ref:It,style:`width:100%;background:transparent;padding-bottom:24px`},[(_(),d(xe,{key:`title_${Bt.value}`,config:{title:{cy:`ridgeline-div-title`,...R.value.title},subtitle:{cy:`ridgeline-div-subtitle`,...R.value.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),N.value.show&&Pt.value&&(S(an)||S(nn))?(_(),d(S(At),{ref_key:`userOptionsRef`,ref:Xt,key:`user_option_${Ut.value}`,backgroundColor:R.value.backgroundColor,color:R.value.color,isPrinting:S(cn),isImaging:S(ln),uid:O.value,hasTooltip:!1,callbacks:N.value.callbacks,hasPdf:N.value.buttons.pdf,hasImg:N.value.buttons.img,hasSvg:N.value.buttons.svg,hasXls:N.value.buttons.csv,hasTable:N.value.buttons.table,hasLabel:!1,hasFullscreen:N.value.buttons.fullscreen,hasAltCopy:N.value.buttons.altCopy,isFullscreen:Q.value,printScale:N.value.print.scale,chartElement:T.value,position:N.value.position,isTooltip:!1,titles:{...N.value.buttonTitles},hasAnnotator:N.value.buttons.annotator,isAnnotation:Un.value,tableDialog:M.value.table.useDialog,style:g({visibility:S(an)?S(nn)?`visible`:`hidden`:`visible`}),isCursorPointer:z.value,onToggleFullscreen:In,onGeneratePdf:S(un),onGenerateCsv:qn,onGenerateImage:S(ar),onGenerateSvg:S(ir),onToggleTable:Gn,onToggleAnnotator:Wn,onCopyAlt:sr},He({_:2},[y(S(De)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:C(n=>[b(e.$slots,t,Ye(Ge(S(Oe)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.callbacks.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.printScale.chartElement.position.titles.hasAnnotator.isAnnotation.tableDialog.style.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg`.split(`.`))):f(``,!0),m(`div`,at,[(_(),p(`svg`,{ref_key:`svgRef`,ref:H,xmlns:S(ce),"aria-describedby":`chart-instructions-${O.value}`,class:Je({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value}),viewBox:`0 0 ${G.value.width<=0?10:G.value.width} ${K.value.fullHeight<=0?10:K.value.fullHeight}`,style:g(`max-width:100%;overflow:visible;background:transparent;color:${R.value.color};${M.value.responsive?`height: ${qt.value}px; width: 100%;`:``}`),tabindex:`0`,onFocus:cr,onBlur:lr,onKeydown:ur},[We(S(jt)),b(e.$slots,`svg-underlayer`,{svg:{...G.value,drawingArea:K.value,isPrintingImg:S(cn)||S(ln)||S(nr),isPrintingSvg:S(rr),data:Y.value}},void 0,!0),m(`defs`,null,[(_(!0),p(l,null,y(Z.value,(e,t)=>(_(),d(Fe,{t:`linear`,id:`gradient-${e.id}-${O.value}`,key:`gradient-${e.id}-${O.value}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,e.color,1],[`30%`,e.color,.7],[`70%`,e.color,.3],[`100%`,e.color,.1]]},null,8,[`id`,`stops`]))),128)),(_(!0),p(l,null,y(Y.value,(e,t)=>(_(),p(l,null,[(_(!0),p(l,null,y(e.datapoints,(e,t)=>(_(),d(Fe,{t:`linear`,key:`grad${e.id}`,id:`gradient-single-${O.value}-${e.uid}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,e.color,1],[`30%`,e.color,.7],[`70%`,e.color,.3],[`100%`,e.color,.1]]},null,8,[`id`,`stops`]))),128))],64))),256))]),(_(!0),p(l,null,y(Y.value,(t,n)=>(_(),p(`g`,{key:`ds-${n}`},[(_(!0),p(l,null,y(t.datapoints,(t,r)=>(_(),p(`g`,{key:t.id},[e.$slots.pattern?(_(),p(`g`,st,[m(`defs`,null,[b(e.$slots,`pattern`,Ke({ref_for:!0},{datapointIndex:n,seriesIndex:r,patternId:`pattern_${O.value}_${t.uid}`}),void 0,!0)])])):f(``,!0),m(`path`,{fill:e.$slots.pattern?`url(#pattern_${O.value}_${t.uid})`:R.value.backgroundColor,stroke:`none`,"stroke-linecap":`round`,d:P.value.smooth?t.smoothPath:t.straightPath,style:g({opacity:P.value.opacity})},null,12,ct),m(`path`,{fill:`none`,stroke:P.value.stroke.useSerieColor?t.color:P.value.stroke.color,"stroke-width":P.value.strokeWidth,d:P.value.smooth?t.smoothPathRidge:t.straightPathRidge,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:g({strokeDasharray:t.pathLength,strokeDashoffset:M.value.useCssAnimation?t.pathLength:0})},null,12,lt),m(`path`,{fill:P.value.useGradient?P.value.useCommonColor?`url(#gradient-${t.id}-${O.value})`:`url(#gradient-single-${O.value}-${t.uid})`:t.color,stroke:`none`,d:P.value.smooth?t.smoothPath:t.straightPath,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:g({strokeDasharray:t.pathLength,strokeDashoffset:M.value.useCssAnimation?t.pathLength:0})},null,12,ut),R.value.zeroLine.show?(_(),p(`path`,{key:1,stroke:R.value.zeroLine.useSerieColor?t.color:R.value.zeroLine.stroke,"stroke-dasharray":R.value.zeroLine.strokeDasharray,"stroke-width":R.value.zeroLine.strokeWidth,d:t.zeroPath,"stroke-linecap":`round`},null,8,dt)):f(``,!0),P.value.maxPoint.show&&t.plots.length>1?(_(!0),p(l,{key:2},y(t.plots,e=>(_(),p(l,null,[e.isMaxPoint?(_(),p(`line`,{key:0,x1:e.x,y1:e.y,x2:e.x,y2:e.zero,stroke:P.value.maxPoint.adaptStrokeToBackground?S(se)(t.color):P.value.maxPoint.stroke,"stroke-width":P.value.maxPoint.strokeWidth,"stroke-linecap":`round`,"stroke-dasharray":P.value.maxPoint.strokeDasharray},null,8,ft)):f(``,!0)],64))),256)):f(``,!0),t.plots.length===1?(_(),p(`circle`,{key:3,cx:t.plots[0].x,cy:t.plots[0].y,stroke:F.value.dot.stroke,"stroke-width":F.value.dot.strokeWidth,r:F.value.dot.radius,fill:F.value.dot.useDatapointColor?t.color:F.value.dot.fill,style:{pointerEvents:`none`}},null,8,pt)):f(``,!0)]))),128)),m(`text`,{x:t.label.x,y:t.label.y,"text-anchor":`end`,"font-size":L.value.fontSize,"font-weight":L.value.bold?`bold`:`normal`,fill:L.value.color,style:g({cursor:R.value.dialog.show&&z.value?`pointer`:`default`}),"text-decoration":R.value.dialog.show&&(Bn.value===n||A.value&&t.uid===A.value.uid||j.value===n)?`underline`:``,"dominant-baseline":`middle`,onMouseenter:e=>Vn(n),onMouseleave:Hn,onClick:e=>zn(t)},x(t.name),45,mt)]))),128)),I.value.values.length?(_(),p(`g`,{key:0,ref_key:`timeLabelsEls`,ref:Jt},[(_(!0),p(l,null,y(J.value,(t,n)=>b(e.$slots,`time-label`,Ke({ref_for:!0},{show:t&&!I.value.showOnlyFirstAndLast&&!I.value.showOnlyAtModulo||t&&I.value.showOnlyFirstAndLast&&(n===0||n===J.value.length-1)||t&&k.value&&k.value.index===n||t&&!I.value.showOnlyFirstAndLast&&I.value.showOnlyAtModulo&&n%Math.max(1,Math.floor(Number(R.value.xAxis.labels.modulo)||1))===0,fontSize:I.value.fontSize,content:t.label,textAnchor:I.value.rotation>0?`start`:I.value.rotation<0?`end`:`middle`,fill:I.value.color,transform:`translate(${t.selectorX}, ${K.value.top+t.height+I.value.offsetY}), rotate(${I.value.rotation})`,x:t.selectorX,y:K.value.bottom+I.value.offsetY}),()=>[t&&!I.value.showOnlyFirstAndLast&&!I.value.showOnlyAtModulo||t&&I.value.showOnlyFirstAndLast&&(n===0||n===J.value.length-1)||t&&k.value&&k.value.index===n||t&&!I.value.showOnlyFirstAndLast&&I.value.showOnlyAtModulo&&n%Math.max(1,Math.floor(Number(R.value.xAxis.labels.modulo)||1))===0?(_(),p(`g`,ht,[String(t.label).includes(`
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Ht as i,J as a,N as ee,P as te,S as o,U as ne,X as re,Xt as ie,at as s,i as c,in as ae,nt as oe,r as se,t as ce,tt as le,w as ue,xt as de,yt as fe,zt as pe}from"./lib-rPeBMZrn.js";import{n as me,t as he}from"./BaseScanner-8NdoBs7B.js";import{n as ge,t as _e}from"./useHints-C-TwxM0Y.js";import{t as ve}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ye}from"./resolveChartConfig-CIhClE5R.js";import{t as be}from"./chartImage-DPGnEuYM.js";import{n as xe}from"./Title-BliHuXfT.js";import{t as Se}from"./useChartExport-BZts4KFb.js";import{n as Ce,t as we}from"./tableIntegration-CNoJ1CIY.js";import{n as Te,t as Ee}from"./annotationSlots-BRR85CqJ.js";import{n as De,t as Oe}from"./userOptionsSlots-DYuo-E5m.js";import{t as ke}from"./useTimeLabels-Das5O74F.js";import{t as Ae}from"./usePrinter-DVf3YcG5.js";import{t as je}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Me}from"./Shape-CRe8woTu.js";import{c as Ne}from"./canvas-lib-22VpOI4_.js";import{t as Pe}from"./useResponsive-CENUxfEL.js";import{t as Fe}from"./DefGrad-DKMq1REY.js";import{t as Ie}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Le}from"./A11yDataTable-DWNlWXzs.js";import{t as Re}from"./useUserOptionState-CXlFnwPv.js";import{t as ze}from"./useChartAccessibility-DOMuYJfm.js";import{t as Be}from"./Legend-DM0ClX3D.js";import{t as Ve}from"./vue_ui_ridgeline-Di26JtQu.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as He,createTextVNode as Ue,createVNode as We,defineAsyncComponent as h,guardReactiveProps as Ge,mergeProps as Ke,nextTick as qe,normalizeClass as Je,normalizeProps as Ye,normalizeStyle as g,onBeforeUnmount as Xe,openBlock as _,ref as v,renderList as y,renderSlot as b,resolveDynamicComponent as Ze,shallowRef as Qe,toDisplayString as x,toRefs as $e,unref as S,watch as et,watchEffect as tt,withCtx as C}from"vue";var nt=/* @__PURE__ */ e({default:()=>Tt}),rt=[`id`],it=[`id`],at={style:{position:`relative`}},ot=[`xmlns`,`aria-describedby`,`viewBox`],st={key:0},ct=[`fill`,`d`],lt=[`stroke`,`stroke-width`,`d`],ut=[`fill`,`d`],dt=[`stroke`,`stroke-dasharray`,`stroke-width`,`d`],ft=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],pt=[`cx`,`cy`,`stroke`,`stroke-width`,`r`,`fill`],mt=[`x`,`y`,`font-size`,`font-weight`,`fill`,`text-decoration`,`onMouseenter`,`onClick`],ht={key:0},gt=[`font-size`,`fill`,`stroke`,`font-weight`,`transform`,`text-anchor`],_t=[`font-size`,`fill`,`font-weight`,`transform`,`text-anchor`,`innerHTML`],vt=[`x`,`y`,`width`,`height`,`onMouseenter`,`onMouseleave`,`onClick`],yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],bt=[`cx`,`cy`,`stroke`,`stroke-width`,`r`,`fill`],xt=[`x`,`y`,`stroke`,`text-anchor`,`font-size`,`fill`],St={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Ct={key:5,class:`vue-data-ui-watermark`},wt=[`onClick`],Tt=/*#__PURE__*/ ve({__name:`vue-ui-ridgeline`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`selectX`,`copyAlt`],setup(e,{expose:ve,emit:nt}){let Tt=h(()=>import(`./vue-ui-xy-B6XNUCzQ.js`).then(e=>e.n)),Et=h(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),Dt=h(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Ot=h(()=>import(`./DataTable-0Vv-aGHD.js`)),kt=h(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),At=h(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),jt=h(()=>import(`./PackageVersion-DhptF5oD.js`).then(e=>e.t)),Mt=h(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_ridgeline:Nt}=t(),w=e,Pt=u({get(){return Array.isArray(B.value)&&B.value.length>0},set(e){return e}}),Ft=nt,T=v(null),It=v(null),Lt=v(null),E=Qe(null),D=Qe(null),Rt=v(null),zt=v(null),Bt=v(0),Vt=v(0),Ht=v(0),O=v(re()),Ut=v(0),Wt=v(0),Gt=v(512),k=v(null),A=v(null),Kt=v(null),qt=v(0),Jt=v(null),Yt=v(null),Xt=v(null),j=v(null),Zt=v(!1);function Qt(){return ye(w.config,Nt,Ve)}let M=v(Qt()),N=u(()=>M.value.userOptions),P=u(()=>M.value.style.chart.areas),F=u(()=>M.value.style.chart.selector),I=u(()=>M.value.style.chart.xAxis.labels),L=u(()=>M.value.style.chart.yAxis.labels),R=u(()=>M.value.style.chart);ge({config:()=>M.value,dataset:()=>w.dataset,component:`VueUiRidgeline`,rules:[_e.emptyArray,{test:e=>e.length>31,message:[`👀 The number of series > 31. Consider:`,``,`▶️ Using filters to let users choose a maximum number of series to display`,``,`▶️ Use several instances of the component to show related series`]},{test:e=>e.some(e=>e.datapoints.some(e=>e.values.length>200)),message:[`👀 Some series contain > 200 data points, which can affect performance. Consider if you really need this level of detail.`,``,`▶️ Use larger time scales, or aggregated values.`,``,`▶️ Filter the time range by adding date inputs in your UI.`]},{test:e=>e.length<6&&e.length>0,message:[`👀 The number of series < 6. Consider:`,``,`▶️ Using VueUiXy instead`]}]});let z=u(()=>M.value.userOptions.useCursorPointer),$t=u(()=>ae({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,areas:{maxPoint:{show:!1},opacity:.9,stroke:{useSerieColor:!0}},legend:{backgroundColor:`transparent`},padding:{right:-24,left:0},xAxis:{labels:{values:[]}},yAxis:{labels:{fontSize:0}},zeroLine:{show:!1}}}},userConfig:M.value.skeletonConfig??{}})),{loading:en,FINAL_DATASET:B,manualLoading:tn}=me({...$e(w),FINAL_CONFIG:M,prepareConfig:Qt,skeletonDataset:w.config?.skeletonDataset??[{name:`_`,datapoints:[{name:`__`,color:`#999999`,values:[28.639,32.04,41.134,44.525,21.151,2.436,.218,.024,.002,0,0,0]},{name:`_`,color:`#CACACA`,values:[13.253,15.621,23.36,33.698,29.935,10.874,2.364,.561,.107,.02,.006,.004]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[10.851,13.195,21.617,36.556,42.292,21.006,3.398,.223,.013,.001,0,0]},{name:`_`,color:`#CACACA`,values:[3.171,4.115,8.108,18.248,31.641,29.063,12.031,2.742,.504,.102,.032,.021]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[1.731,2.334,5.125,13.626,29.911,38.524,24.168,7.646,1.575,.317,.097,.063]},{name:`_`,color:`#CACACA`,values:[.25,.367,1.026,3.944,13.635,28.891,30.149,15.419,4.714,1.246,.442,.299]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[.034,.054,.194,1.065,5.747,20.735,38.306,32.899,15.318,5.566,2.422,1.76]},{name:`_`,color:`#CACACA`,values:[.001,.002,.009,.095,1.124,8.342,27.115,35.08,21.449,9.093,4.243,3.143]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[0,.001,.004,.051,.567,3.322,14.215,44.783,40.351,20.377,9.866,7.378]},{name:`_`,color:`#CACACA`,values:[0,0,0,0,.001,.11,4.136,27.498,43.24,29.807,17.345,13.678]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[0,0,0,0,.025,.598,3.886,10.645,54.479,45.953,30.814,24.55]},{name:`_`,color:`#CACACA`,values:[0,0,0,0,0,0,.007,1.655,26.63,52.017,45.192,39.651]}]}],skeletonConfig:ae({defaultConfig:M.value,userConfig:$t.value})}),V=v(Math.min(P.value.height,P.value.rowHeight)),{userOptionsVisible:nn,setUserOptionsVisibility:rn,keepUserOptionState:an}=Re({config:M.value}),{svgRef:H}=ze({config:R.value.title}),on=u(()=>M.value.debug);function sn(){let e=B.value||[];if(!Array.isArray(e)||e.length===0)s({componentName:`VueUiRidgeline`,type:`dataset`,debug:on.value}),tn.value=!0;else if(e.forEach((e,t)=>{fe({datasetObject:e,requiredAttributes:[`name`,`datapoints`]}).forEach(e=>{Pt.value=!1,s({componentName:`VueUiRidgeline`,type:`datasetSerieAttribute`,property:e,index:t,debug:on.value})}),Array.isArray(e.datapoints)&&e.datapoints.length&&e.datapoints.forEach((e,n)=>{fe({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{Pt.value=!1,s({componentName:`VueUiRidgeline`,type:`datasetSerieAttribute`,property:`datapoint.${e}`,index:`${t}-${n}`,debug:on.value})})})}),Wt.value=e.length,V.value=Math.min(P.value.height,P.value.rowHeight),pe(w.dataset)||(tn.value=M.value.loading),M.value.responsive){let t=Ne(()=>{let{width:t,height:n}=Pe({chart:T.value,title:R.value.title.text?It.value:null,legend:R.value.legend.show?Lt.value:null,source:Rt.value,noTitle:zt.value,padding:R.value.padding});requestAnimationFrame(()=>{Gt.value=t,V.value=e.length?n/e.length:0,qt.value=n-12})});E.value&&(D.value&&E.value.unobserve(D.value),E.value.disconnect()),E.value=new ResizeObserver(t),D.value=T.value?.parentNode||null,D.value&&E.value.observe(D.value)}}Xe(()=>{E.value&&(D.value&&E.value.unobserve(D.value),E.value.disconnect())});let{isPrinting:cn,isImaging:ln,generatePdf:un,generateImage:dn}=Ae({elementId:`vue-ui-ridgeline_${O.value}`,fileName:R.value.title.text||`vue-ui-ridgeline`,options:M.value.userOptions.print}),fn=u(()=>M.value.userOptions.show&&!R.value.title.text),pn=u(()=>ue(M.value.customPalette)),U=v({showTable:M.value.table.show});et(()=>B.value,async e=>{Array.isArray(e)&&e.length&&(nn.value=!M.value.userOptions.showOnChartHover,await qe(),sn(),Bt.value+=1,Ht.value+=1,U.value.showTable=M.value.table.show)},{deep:!0,immediate:!0}),et(()=>w.dataset,e=>{Array.isArray(e)&&e.length>0&&(tn.value=!1)},{deep:!0}),et(()=>en.value,async e=>{e||(await qe(),sn())},{immediate:!0}),et(()=>w.config,()=>{M.value=Qt(B.value||null),nn.value=!M.value.userOptions.showOnChartHover,V.value=Math.min(P.value.height,P.value.rowHeight),U.value.showTable=M.value.table.show,Bt.value+=1,Ht.value+=1},{deep:!0});let mn=u(()=>P.value.height/P.value.rowHeight);function hn(){X.value.length?X.value=[]:Z.value.forEach(e=>{X.value.push(e.id)}),Ft(`selectLegend`,Y.value)}function gn(e){X.value.includes(e)?X.value=X.value.filter(t=>t!==e):X.value.push(e),Ft(`selectLegend`,Y.value)}function _n(e){return Z.value.length?Z.value.find(t=>t.name===e)||(on.value&&console.warn(`VueUiRidgeline - Series name not found "${e}"`),null):(on.value&&console.warn(`VueUiRidgeline - There are no series to show.`),null)}function vn(e){let t=_n(e);t!==null&&X.value.includes(t.id)&&gn(t.id)}function yn(e){let t=_n(e);t!==null&&(X.value.includes(t.id)||gn(t.id))}let W=u(()=>Pt.value?(B.value||[]).map(e=>({...e,labelLen:Nn(e.name,L.value.fontSize),uid:re(),datapoints:e.datapoints.map((e,t)=>{let n=e.color?o(e.color):pn.value[t]||i[t]||i[t%i.length],r=ie(e.name);return{...e,color:n,id:r}})})):[]),bn=u(()=>R.value.padding.top+V.value*(B.value||[]).length+V.value*mn.value+R.value.padding.bottom),G=u(()=>{let e=R.value.padding;return{width:Gt.value,height:bn.value,padding:e}}),xn=u(()=>G.value.width),Sn=u(()=>G.value.height),Cn=v(0),wn=Ne(e=>{Cn.value=e},100);tt(e=>{let t=Jt.value;if(!t)return;let n=new ResizeObserver(e=>{wn(e[0].contentRect.height)});n.observe(t),e(()=>n.disconnect())}),Xe(()=>{Cn.value=0});let K=u(()=>({fullHeight:G.value.height+Cn.value,top:G.value.padding.top,left:G.value.padding.left,right:G.value.width-G.value.padding.right,bottom:G.value.height-R.value.padding.bottom,width:G.value.width-(G.value.padding.left+G.value.padding.right)})),Tn=u(()=>Math.max(...W.value.flatMap(e=>e.datapoints.map(e=>e.values.length)))),q=v([]),En=0;tt(()=>{let e=++En;(async()=>{let t=await ke({values:I.value.values,maxDatapoints:Tn.value,formatter:I.value.datetimeFormatter,start:0,end:I.value.values.length});e===En&&(q.value=t)})()});let J=u(()=>{let e=Math.max(...W.value.map(e=>e.labelLen)),t=G.value.padding.left+e+16+L.value.offsetX,n=(K.value.width-t)/Tn.value,r=[];for(let e=0;e<Tn.value;e+=1)r.push({selectorX:t+n*e,x:t+n*e-n/2,y:K.value.top,label:I.value.values[e]?q.value[e]?.text??``:``,index:e,width:n,height:bn.value});return r});function Dn(e){return W.value.map(t=>t.datapoints.map(t=>({dp:t,selected:t.values[e.index]})))}function On(e){k.value=e;let t=Dn(e);M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:t,seriesIndex:e.index})}function kn(e){k.value=null;let t=Dn(e);M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:t,seriesIndex:e.index})}function An(e){let t=Dn(e);M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:t,seriesIndex:e.index}),Ft(`selectX`,t)}function jn(e,t){return e.length*t/2+t}function Mn(e,t,n){return e+jn(t,n)>K.value.right}function Nn(e,t,n=`sans-serif`){let r=document.createElement(`canvas`).getContext(`2d`);return r.font=`${typeof t==`number`?`${t}px`:t} ${n}`,r.measureText(e).width}let Y=u(()=>{V.value;let e=Math.max(...W.value.map(e=>e.labelLen)),t=Math.max(...W.value.flatMap(e=>e.datapoints.flatMap(e=>e.values))),n=Math.min(...W.value.flatMap(e=>e.datapoints.flatMap(e=>e.values))),r=G.value.padding.left+e+16+L.value.offsetX,i=(K.value.width-r)/Tn.value,a=Math.abs(Math.min(n,0)),o=t+a;function ie(e){return isNaN(e/o)?0:e/o}return W.value.map((e,t)=>{let n=V.value*mn.value*(1-ie(a)),o=K.value.top+V.value*t,s=K.value.top+o+n;return{...e,label:{x:r-L.value.fontSize,y:(L.value.centered?s-n/2:s)+L.value.offsetY},datapoints:e.datapoints.map(e=>{let t=e.values.map((t,n)=>{let ee=isNaN(t)||[void 0,null,`NaN`,NaN,1/0,-1/0].includes(t)?0:t||0;return{x:r+i*n,y:K.value.top+o+V.value*mn.value*(1-ie(ee+a)),value:t,isMaxPoint:t===Math.max(...e.values),zero:s}}),n=`${ee(t,s,!1,!1)}`,c=`M ${r},${s} ${ne(t)} ${t.at(-1).x},${s}`,ae=`M ${r},${s} ${t.at(-1).x},${s}`,oe=`M ${te(t)}`,se=`M ${ne(t)}`,ce=de(P.value.smooth?oe:se);return{...e,uid:re(),plots:t,smoothPath:n,straightPath:c,zeroPath:ae,pathLength:ce,smoothPathRidge:oe,straightPathRidge:se}}).filter(e=>!X.value.includes(e.id))}})}),X=v([]);function Pn(e){let t=/* @__PURE__ */ new Map;return e.forEach(e=>{e.datapoints.forEach((e,n)=>{let r=ie(e.name);t.has(r)||t.set(r,{id:r,name:e.name,color:e.color,shape:`circle`,segregate:()=>gn(r),isSegregated:X.value.includes(r),opacity:X.value.includes(r)?.5:1})})}),Array.from(t.values())}let Z=u(()=>Pn(W.value)),Fn=u(()=>({cy:`donut-div-legend`,backgroundColor:R.value.legend.backgroundColor,color:R.value.legend.color,fontSize:R.value.legend.fontSize,paddingBottom:12,fontWeight:R.value.legend.bold?`bold`:``})),Q=v(!1);function In(e){Q.value=e,Ut.value+=1}let Ln=v({}),Rn=v([]);function zn(e){Ft(`selectDatapoint`,e),R.value.dialog.show&&(Rn.value=e.datapoints.map(e=>({name:e.name,color:e.color,type:`line`,useArea:!0,smooth:P.value.smooth,series:e.values})),A.value=e,Ln.value=le({...R.value.dialog.xyChart,responsive:!0,chart:{...R.value.dialog.xyChart.chart,grid:{...R.value.dialog.xyChart.chart.grid,labels:{...R.value.dialog.xyChart.chart.grid.labels,xAxisLabels:{...R.value.dialog.xyChart.chart.grid.labels.xAxisLabels,values:I.value.values,autoRotate:{enable:!0,angle:R.value.dialog.xyChart.chart.grid.labels.xAxisLabels.autoRotate.angle},datetimeFormatter:I.value.datetimeFormatter}}},tooltip:{...R.value.dialog.xyChart.chart.tooltip,showTimeLabel:I.value.values.length>0},userOptions:{...R.value.dialog.xyChart.chart.userOptions,buttons:{...R.value.dialog.xyChart.chart.userOptions.buttons,altCopy:M.value.userOptions.buttons.altCopy},callbacks:{...R.value.dialog.xyChart.chart.userOptions.callbacks,altCopy:()=>{}},useCursorPointer:M.value.userOptions.useCursorPointer}}}),Kt.value&&Kt.value.open())}let Bn=v(null);function Vn(e){Bn.value=e}function Hn(){Bn.value=null}let Un=v(!1);function Wn(){Un.value=!Un.value}function Gn(){U.value.showTable=!U.value.showTable}let Kn=u(()=>({body:Y.value.flatMap(e=>e.datapoints.flatMap(t=>({...t,rowName:`${e.name}: ${t.name}`}))).map(e=>[{name:e.rowName,color:e.color},...e.values])})),$=u(()=>{let e=[M.value.table.columnNames.series,...q.value.map(e=>e.text)],t={th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint};return{colNames:[M.value.table.columnNames.series,...q.value.map(e=>e.text)],head:e,body:Kn.value.body,config:t}});function qn(e=null){qe(()=>{let t=[[M.value.table.columnNames.series,...q.map(e=>[e.text])],...Kn.value.body.map((e,t)=>[e[0].name,...e.slice(1)])],n=[[R.value.title.text],[R.value.title.subtitle.text]].concat(t),i=r(n);e?e(i):oe({csvContent:i,title:R.value.title.text||`vue-ui-ridgeline`})})}function Jn(){return Y.value}let Yn=be(T,()=>R.value.title.text),Xn=u(()=>({min:0,max:Tn.value}));je({timeLabelsEls:Jt,timeLabels:q,slicer:Xn,configRef:M,rotationPath:[`style`,`chart`,`xAxis`,`labels`,`rotation`],autoRotatePath:[`style`,`chart`,`xAxis`,`labels`,`autoRotate`,`enable`],isAutoSize:!1,width:xn,height:Sn,targetClass:`.vue-ui-ridgeline-x-axis-label`,angle:I.value.autoRotate.angle});let Zn=u(()=>we({config:M,style:R,mutableConfig:U,dialog:Mt,accordion:Dt,isFullscreen:Q,parent:T,maxWidth:800,isCursorPointer:z}));et(()=>U.value.showTable,e=>Ce(e,M,Yt));function Qn(){U.value.showTable=!1,Xt.value&&Xt.value.setTableIconState(!1)}let $n=u(()=>R.value.backgroundColor),er=u(()=>({...R.value.legend,position:`bottom`})),tr=u(()=>R.value.title),{isCallbackImaging:nr,isCallbackSvg:rr,generateSvg:ir,onGenerateImage:ar}=Se({svg:H,title:tr,legend:er,legendItems:Z,backgroundColor:$n,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:dn});function or(e){sr(`xy-zoom`,e.dataset,e.config)}async function sr(e=`main-chart`,t=null,n=null){Ft(`copyAlt`,{source:e,config:e===`main-chart`?M.value:Ln.value,dataset:e===`main-chart`?Y.value:Rn.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({source:e,config:e===`main-chart`?M.value:Ln.value,dataset:e===`main-chart`?Y.value:Rn.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function cr(){j.value=null,Zt.value=!0}function lr(){pr(),Zt.value=!1}function ur(e){if(!H.value||Un.value||document.activeElement!==H.value||!Y.value.length)return;let t=e.key===`ArrowUp`,n=e.key===`ArrowDown`,r=e.key===`ArrowLeft`,i=e.key===`ArrowRight`,a=e.key===`Enter`||e.key===` `,ee=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!ee)return;if(e.preventDefault(),e.stopPropagation(),ee){pr();return}if(a){if(j.value!==null){let e=Y.value[j.value];e&&zn(e);return}k.value&&An(k.value);return}if(t||n){let e=j.value;e=e===null?n?0:Y.value.length-1:dr(e+(n?1:-1)),j.value=e,Bn.value=e;return}if(!J.value.length)return;let te=k.value?.index??null;te=te===null?i?0:J.value.length-1:fr(te+(i?1:-1));let o=J.value[te];o&&On(o)}function dr(e){let t=Y.value.length;return t?(e%t+t)%t:null}function fr(e){let t=J.value.length;return t?(e%t+t)%t:null}function pr(){j.value=null,Bn.value=null,k.value?kn(k.value):k.value=null}let mr=u(()=>({head:$.value.head,body:$.value.body.map(e=>[e[0]?.name??``,...e.slice(1)]),caption:M.value.a11y.translations.tableCaption,notice:M.value.a11y.translations.tableAvailable}));return ve({getData:Jn,getImage:Yn,generateImage:dn,generateSvg:ir,generatePdf:un,generateCsv:qn,hideSeries:yn,showSeries:vn,toggleAnnotator:Wn,toggleTable:Gn,toggleFullscreen:In,copyAlt:sr}),(e,t)=>(_(),p(`div`,{ref_key:`ridgelineChart`,ref:T,class:Je(`vue-data-ui-component vue-ui-ridgeline ${Q.value?`vue-data-ui-wrapper-fullscreen`:``}`),id:`vue-ui-ridgeline_${O.value}`,style:g({fontFamily:M.value.style.fontFamily,width:`100%`,textAlign:`center`,background:R.value.backgroundColor,height:M.value.responsive?`100%`:void 0}),onMouseenter:t[3]||=()=>S(rn)(!0),onMouseleave:t[4]||=()=>S(rn)(!1)},[m(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[m(`p`,null,x(M.value.a11y.translations.keyboardNavigation),1)],8,it),mr.value.body.length?(_(),d(Le,{key:0,uid:O.value,head:mr.value.head,body:mr.value.body,caption:mr.value.caption,notice:mr.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):f(``,!0),N.value.buttons.annotator&&S(H)?(_(),d(S(kt),{key:1,color:R.value.color,backgroundColor:R.value.backgroundColor,active:Un.value,svgRef:S(H),isCursorPointer:z.value,onClose:Wn},He({_:2},[y(S(Ee),t=>({name:t,fn:C(n=>[b(e.$slots,t,Ye(Ge(S(Te)(t,n))),void 0,!0)])}))]),1032,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`])):f(``,!0),b(e.$slots,`userConfig`,{},void 0,!0),fn.value?(_(),p(`div`,{key:2,ref_key:`noTitle`,ref:zt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),R.value.title.text?(_(),p(`div`,{key:3,ref_key:`chartTitle`,ref:It,style:`width:100%;background:transparent;padding-bottom:24px`},[(_(),d(xe,{key:`title_${Bt.value}`,config:{title:{cy:`ridgeline-div-title`,...R.value.title},subtitle:{cy:`ridgeline-div-subtitle`,...R.value.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),N.value.show&&Pt.value&&(S(an)||S(nn))?(_(),d(S(At),{ref_key:`userOptionsRef`,ref:Xt,key:`user_option_${Ut.value}`,backgroundColor:R.value.backgroundColor,color:R.value.color,isPrinting:S(cn),isImaging:S(ln),uid:O.value,hasTooltip:!1,callbacks:N.value.callbacks,hasPdf:N.value.buttons.pdf,hasImg:N.value.buttons.img,hasSvg:N.value.buttons.svg,hasXls:N.value.buttons.csv,hasTable:N.value.buttons.table,hasLabel:!1,hasFullscreen:N.value.buttons.fullscreen,hasAltCopy:N.value.buttons.altCopy,isFullscreen:Q.value,printScale:N.value.print.scale,chartElement:T.value,position:N.value.position,isTooltip:!1,titles:{...N.value.buttonTitles},hasAnnotator:N.value.buttons.annotator,isAnnotation:Un.value,tableDialog:M.value.table.useDialog,style:g({visibility:S(an)?S(nn)?`visible`:`hidden`:`visible`}),isCursorPointer:z.value,onToggleFullscreen:In,onGeneratePdf:S(un),onGenerateCsv:qn,onGenerateImage:S(ar),onGenerateSvg:S(ir),onToggleTable:Gn,onToggleAnnotator:Wn,onCopyAlt:sr},He({_:2},[y(S(De)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:C(n=>[b(e.$slots,t,Ye(Ge(S(Oe)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.callbacks.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.printScale.chartElement.position.titles.hasAnnotator.isAnnotation.tableDialog.style.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg`.split(`.`))):f(``,!0),m(`div`,at,[(_(),p(`svg`,{ref_key:`svgRef`,ref:H,xmlns:S(ce),"aria-describedby":`chart-instructions-${O.value}`,class:Je({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value}),viewBox:`0 0 ${G.value.width<=0?10:G.value.width} ${K.value.fullHeight<=0?10:K.value.fullHeight}`,style:g(`max-width:100%;overflow:visible;background:transparent;color:${R.value.color};${M.value.responsive?`height: ${qt.value}px; width: 100%;`:``}`),tabindex:`0`,onFocus:cr,onBlur:lr,onKeydown:ur},[We(S(jt)),b(e.$slots,`svg-underlayer`,{svg:{...G.value,drawingArea:K.value,isPrintingImg:S(cn)||S(ln)||S(nr),isPrintingSvg:S(rr),data:Y.value}},void 0,!0),m(`defs`,null,[(_(!0),p(l,null,y(Z.value,(e,t)=>(_(),d(Fe,{t:`linear`,id:`gradient-${e.id}-${O.value}`,key:`gradient-${e.id}-${O.value}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,e.color,1],[`30%`,e.color,.7],[`70%`,e.color,.3],[`100%`,e.color,.1]]},null,8,[`id`,`stops`]))),128)),(_(!0),p(l,null,y(Y.value,(e,t)=>(_(),p(l,null,[(_(!0),p(l,null,y(e.datapoints,(e,t)=>(_(),d(Fe,{t:`linear`,key:`grad${e.id}`,id:`gradient-single-${O.value}-${e.uid}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,e.color,1],[`30%`,e.color,.7],[`70%`,e.color,.3],[`100%`,e.color,.1]]},null,8,[`id`,`stops`]))),128))],64))),256))]),(_(!0),p(l,null,y(Y.value,(t,n)=>(_(),p(`g`,{key:`ds-${n}`},[(_(!0),p(l,null,y(t.datapoints,(t,r)=>(_(),p(`g`,{key:t.id},[e.$slots.pattern?(_(),p(`g`,st,[m(`defs`,null,[b(e.$slots,`pattern`,Ke({ref_for:!0},{datapointIndex:n,seriesIndex:r,patternId:`pattern_${O.value}_${t.uid}`}),void 0,!0)])])):f(``,!0),m(`path`,{fill:e.$slots.pattern?`url(#pattern_${O.value}_${t.uid})`:R.value.backgroundColor,stroke:`none`,"stroke-linecap":`round`,d:P.value.smooth?t.smoothPath:t.straightPath,style:g({opacity:P.value.opacity})},null,12,ct),m(`path`,{fill:`none`,stroke:P.value.stroke.useSerieColor?t.color:P.value.stroke.color,"stroke-width":P.value.strokeWidth,d:P.value.smooth?t.smoothPathRidge:t.straightPathRidge,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:g({strokeDasharray:t.pathLength,strokeDashoffset:M.value.useCssAnimation?t.pathLength:0})},null,12,lt),m(`path`,{fill:P.value.useGradient?P.value.useCommonColor?`url(#gradient-${t.id}-${O.value})`:`url(#gradient-single-${O.value}-${t.uid})`:t.color,stroke:`none`,d:P.value.smooth?t.smoothPath:t.straightPath,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:g({strokeDasharray:t.pathLength,strokeDashoffset:M.value.useCssAnimation?t.pathLength:0})},null,12,ut),R.value.zeroLine.show?(_(),p(`path`,{key:1,stroke:R.value.zeroLine.useSerieColor?t.color:R.value.zeroLine.stroke,"stroke-dasharray":R.value.zeroLine.strokeDasharray,"stroke-width":R.value.zeroLine.strokeWidth,d:t.zeroPath,"stroke-linecap":`round`},null,8,dt)):f(``,!0),P.value.maxPoint.show&&t.plots.length>1?(_(!0),p(l,{key:2},y(t.plots,e=>(_(),p(l,null,[e.isMaxPoint?(_(),p(`line`,{key:0,x1:e.x,y1:e.y,x2:e.x,y2:e.zero,stroke:P.value.maxPoint.adaptStrokeToBackground?S(se)(t.color):P.value.maxPoint.stroke,"stroke-width":P.value.maxPoint.strokeWidth,"stroke-linecap":`round`,"stroke-dasharray":P.value.maxPoint.strokeDasharray},null,8,ft)):f(``,!0)],64))),256)):f(``,!0),t.plots.length===1?(_(),p(`circle`,{key:3,cx:t.plots[0].x,cy:t.plots[0].y,stroke:F.value.dot.stroke,"stroke-width":F.value.dot.strokeWidth,r:F.value.dot.radius,fill:F.value.dot.useDatapointColor?t.color:F.value.dot.fill,style:{pointerEvents:`none`}},null,8,pt)):f(``,!0)]))),128)),m(`text`,{x:t.label.x,y:t.label.y,"text-anchor":`end`,"font-size":L.value.fontSize,"font-weight":L.value.bold?`bold`:`normal`,fill:L.value.color,style:g({cursor:R.value.dialog.show&&z.value?`pointer`:`default`}),"text-decoration":R.value.dialog.show&&(Bn.value===n||A.value&&t.uid===A.value.uid||j.value===n)?`underline`:``,"dominant-baseline":`middle`,onMouseenter:e=>Vn(n),onMouseleave:Hn,onClick:e=>zn(t)},x(t.name),45,mt)]))),128)),I.value.values.length?(_(),p(`g`,{key:0,ref_key:`timeLabelsEls`,ref:Jt},[(_(!0),p(l,null,y(J.value,(t,n)=>b(e.$slots,`time-label`,Ke({ref_for:!0},{show:t&&!I.value.showOnlyFirstAndLast&&!I.value.showOnlyAtModulo||t&&I.value.showOnlyFirstAndLast&&(n===0||n===J.value.length-1)||t&&k.value&&k.value.index===n||t&&!I.value.showOnlyFirstAndLast&&I.value.showOnlyAtModulo&&n%Math.max(1,Math.floor(Number(R.value.xAxis.labels.modulo)||1))===0,fontSize:I.value.fontSize,content:t.label,textAnchor:I.value.rotation>0?`start`:I.value.rotation<0?`end`:`middle`,fill:I.value.color,transform:`translate(${t.selectorX}, ${K.value.top+t.height+I.value.offsetY}), rotate(${I.value.rotation})`,x:t.selectorX,y:K.value.bottom+I.value.offsetY}),()=>[t&&!I.value.showOnlyFirstAndLast&&!I.value.showOnlyAtModulo||t&&I.value.showOnlyFirstAndLast&&(n===0||n===J.value.length-1)||t&&k.value&&k.value.index===n||t&&!I.value.showOnlyFirstAndLast&&I.value.showOnlyAtModulo&&n%Math.max(1,Math.floor(Number(R.value.xAxis.labels.modulo)||1))===0?(_(),p(`g`,ht,[String(t.label).includes(`
2
2
  `)?(_(),p(`text`,{key:1,class:`vue-ui-ridgeline-x-axis-label`,"font-size":I.value.fontSize,fill:I.value.color,"font-weight":I.value.bold?`bold`:`normal`,transform:`translate(${t.selectorX}, ${K.value.bottom+I.value.offsetY}), rotate(${I.value.rotation})`,"text-anchor":I.value.rotation>0?`start`:R.value.xAxis.labels.rotation<0?`end`:`middle`,style:g({opacity:k.value?k.value.index===n?1:.2:1}),innerHTML:S(a)({content:String(t.label),fontSize:R.value.xAxis.labels.fontSize,fill:R.value.xAxis.labels.color,stroke:R.value.backgroundColor,x:0,y:0})},null,12,_t)):(_(),p(`text`,{key:0,class:`vue-ui-ridgeline-x-axis-label`,"font-size":I.value.fontSize,fill:I.value.color,stroke:R.value.backgroundColor,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"paint-order":`stroke fill`,"font-weight":I.value.bold?`bold`:`normal`,transform:`translate(${t.selectorX}, ${K.value.bottom+I.value.offsetY}), rotate(${I.value.rotation})`,"text-anchor":I.value.rotation>0?`start`:R.value.xAxis.labels.rotation<0?`end`:`middle`,style:g({opacity:k.value?k.value.index===n?1:.2:1})},x(t.label),13,gt))])):f(``,!0)],!0)),256))],512)):f(``,!0),m(`g`,null,[(_(!0),p(l,null,y(J.value,(e,t)=>(_(),p(`rect`,{x:e.x,y:e.y,width:e.width<0?.1:e.width,height:e.height<0?.1:e.height,fill:`transparent`,onMouseenter:t=>On(e),onMouseleave:t=>kn(e),onClick:()=>An(e)},null,40,vt))),256)),F.value.show&&k.value?(_(),p(`line`,{key:0,x1:k.value.selectorX,x2:k.value.selectorX,y1:k.value.y,y2:k.value.y+k.value.height-V.value/2,stroke:F.value.stroke,"stroke-width":F.value.strokeWidth,"stroke-dasharray":F.value.strokeDasharray,"stroke-linecap":`round`,style:{pointerEvents:`none`}},null,8,yt)):f(``,!0),k.value||F.value.labels.showLast?(_(!0),p(l,{key:1},y(Y.value,e=>(_(),p(l,null,[(_(!0),p(l,null,y(e.datapoints,e=>(_(),p(l,null,[(_(!0),p(l,null,y(e.plots,(t,r)=>(_(),p(l,null,[k.value&&k.value.index===r||!k.value&&r===e.plots.length-1&&R.value.selector.labels.showLast?(_(),p(`circle`,{key:0,cx:t.x,cy:t.y,stroke:F.value.dot.stroke,"stroke-width":F.value.dot.strokeWidth,r:F.value.dot.radius,fill:F.value.dot.useDatapointColor?e.color:R.value.selector.dot.fill,style:{pointerEvents:`none`}},null,8,bt)):f(``,!0),k.value&&k.value.index===r||!k.value&&r===e.plots.length-1&&R.value.selector.labels.showLast?(_(),p(`text`,{key:1,x:Mn(t.x,S(c)(R.value.selector.labels.formatter,t.value,S(n)({p:M.value.style.chart.xAxis.labels.prefix,v:t.value,s:M.value.style.chart.xAxis.labels.suffix,r:M.value.style.chart.selector.labels.rounding})),R.value.selector.labels.fontSize)?t.x-R.value.selector.labels.fontSize/2:t.x+R.value.selector.labels.fontSize/2,y:t.y,"dominant-baseline":`middle`,stroke:R.value.backgroundColor,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`3`,"paint-order":`stroke fill`,"text-anchor":Mn(t.x,S(c)(R.value.selector.labels.formatter,t.value,S(n)({p:M.value.style.chart.xAxis.labels.prefix,v:t.value,s:M.value.style.chart.xAxis.labels.suffix,r:M.value.style.chart.selector.labels.rounding})),R.value.selector.labels.fontSize)?`end`:`start`,"font-size":F.value.labels.fontSize,fill:F.value.labels.color,style:{pointerEvents:`none`}},x(S(c)(R.value.selector.labels.formatter,t.value,S(n)({p:R.value.xAxis.labels.prefix,v:t.value,s:R.value.xAxis.labels.suffix,r:R.value.selector.labels.rounding}))),9,xt)):f(``,!0)],64))),256))],64))),256))],64))),256)):f(``,!0)]),b(e.$slots,`svg`,{svg:{...G.value,drawingArea:K.value,isPrintingImg:S(cn)||S(ln)||S(nr),isPrintingSvg:S(rr),data:Y.value}},void 0,!0)],46,ot)),e.$slots.hint?(_(),p(`div`,St,[b(e.$slots,`hint`,Ye(Ge({hint:M.value.a11y.translations.keyboardNavigation,isVisible:Zt.value})),void 0,!0)])):f(``,!0)]),e.$slots.watermark?(_(),p(`div`,Ct,[b(e.$slots,`watermark`,Ye(Ge({isPrinting:S(cn)||S(ln)||S(nr)||S(rr)})),void 0,!0)])):f(``,!0),m(`div`,{ref_key:`chartLegend`,ref:Lt},[b(e.$slots,`legend`,{legend:Z.value},()=>[R.value.legend.show?(_(),d(Be,{key:`legend_${Ht.value}`,legendSet:Z.value,config:Fn.value,isCursorPointer:z.value,onClickMarker:t[0]||=({legend:e})=>gn(e.id)},He({item:C(({legend:e})=>[S(en)?f(``,!0):(_(),p(`div`,{key:0,style:g(`opacity:${X.value.includes(e.id)?.5:1}`),onClick:t=>e.segregate()},x(e.name),13,wt))]),legendToggle:C(()=>[Z.value.length>2&&R.value.legend.selectAllToggle.show&&!S(en)?(_(),d(Ie,{key:0,backgroundColor:R.value.legend.selectAllToggle.backgroundColor,color:R.value.legend.selectAllToggle.color,fontSize:R.value.legend.fontSize,checked:X.value.length>0,isCursorPointer:z.value,onToggle:hn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):f(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:C(({legend:e,index:t})=>[We(Me,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${O.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):f(``,!0)],!0)],512),e.$slots.source?(_(),p(`div`,{key:6,ref_key:`source`,ref:Rt,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),Pt.value&&N.value.buttons.table?(_(),d(Ze(Zn.value.component),Ke({key:7},Zn.value.props,{ref_key:`tableUnit`,ref:Yt,onClose:Qn}),He({content:C(()=>[(_(),d(S(Ot),{key:`table_${Vt.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:M.value.table.useDialog?``:Zn.value.title,withCloseButton:!M.value.table.useDialog,isCursorPointer:z.value,onClose:Qn},{th:C(({th:e})=>[m(`div`,null,x(e),1)]),td:C(({td:e})=>[Ue(x(e.name?e.name:S(c)(F.value.labels.formatter,e,S(n)({p:R.value.xAxis.labels.prefix,v:e,s:R.value.xAxis.labels.suffix,r:M.value.table.td.roundingValue}))),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[M.value.table.useDialog?{name:`title`,fn:C(()=>[Ue(x(Zn.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:C(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>qn(N.value.callbacks.csv),style:g({cursor:z.value?`pointer`:`default`})},[We(S(Et),{name:`fileCsv`,stroke:Zn.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):f(``,!0),R.value.dialog.show?(_(),d(S(Mt),{key:8,ref_key:`dialog`,ref:Kt,onClose:t[2]||=e=>A.value=null,backgroundColor:R.value.dialog.backgroundColor,color:R.value.dialog.color,headerBg:R.value.dialog.header.backgroundColor,headerColor:R.value.dialog.header.color,isFullscreen:Q.value,fullscreenParent:T.value,isCursorPointer:z.value,withPadding:``},{title:C(()=>[Ue(x(A.value.name),1)]),content:C(()=>[A.value?(_(),d(S(Tt),{key:0,config:Ln.value,dataset:Rn.value,onCopyAlt:or},null,8,[`config`,`dataset`])):f(``,!0)]),_:1},8,[`backgroundColor`,`color`,`headerBg`,`headerColor`,`isFullscreen`,`fullscreenParent`,`isCursorPointer`])):f(``,!0),b(e.$slots,`skeleton`,{},()=>[S(en)?(_(),d(he,{key:0})):f(``,!0)],!0)],46,rt))}},[[`__scopeId`,`data-v-3f5f6f22`]]);export{nt as n,Tt as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Dt as i,Ht as a,J as o,Jt as ee,Kt as te,S as ne,X as re,Yt as ie,Zt as ae,at as oe,b as se,i as ce,in as le,nn as ue,nt as de,pt as fe,t as pe,w as me,yt as he,zt as ge}from"./lib-rPeBMZrn.js";import{n as _e,t as ve}from"./BaseScanner-8NdoBs7B.js";import{n as ye,t as be}from"./useHints-C-TwxM0Y.js";import{t as xe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as Se}from"./useNestedProp-DnGoh-XS.js";import{t as Ce}from"./useThemeCheck-BKNRbGeC.js";import{t as we}from"./chartImage-DPGnEuYM.js";import{n as Te}from"./Title-BliHuXfT.js";import{t as Ee}from"./useChartExport-BZts4KFb.js";import{n as De,t as Oe}from"./tableIntegration-CNoJ1CIY.js";import{n as ke,t as Ae}from"./annotationSlots-BRR85CqJ.js";import{n as je,t as Me}from"./userOptionsSlots-DYuo-E5m.js";import{t as Ne}from"./usePrinter-DVf3YcG5.js";import{t as Pe}from"./useTransitions-ChGGrtrv.js";import{t as Fe}from"./Shape-CRe8woTu.js";import{c as Ie}from"./canvas-lib-22VpOI4_.js";import{t as Le}from"./useResponsive-CENUxfEL.js";import{t as Re}from"./DefGrad-DKMq1REY.js";import{t as ze}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Be}from"./A11yDataTable-DWNlWXzs.js";import{t as Ve}from"./useUserOptionState-CXlFnwPv.js";import{t as He}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ue}from"./labelUtils-CdtU-yB_.js";import{t as We}from"./Legend-DM0ClX3D.js";import{t as Ge}from"./vue_ui_rings-BcDDXHpQ.js";import{Fragment as Ke,Teleport as qe,computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as Je,createTextVNode as Ye,createVNode as Xe,defineAsyncComponent as f,guardReactiveProps as p,mergeProps as Ze,nextTick as Qe,normalizeClass as m,normalizeProps as h,normalizeStyle as g,onBeforeUnmount as $e,onMounted as et,openBlock as _,ref as v,renderList as tt,renderSlot as y,resolveDynamicComponent as nt,shallowRef as rt,toDisplayString as it,toRefs as at,unref as b,useSlots as ot,watch as st,withCtx as x}from"vue";var ct=/* @__PURE__ */ e({default:()=>kt}),lt=[`id`],ut=[`id`],dt=[`id`],ft={style:{position:`relative`}},pt=[`xmlns`,`viewBox`,`aria-describedby`],mt=[`width`,`height`],ht={key:1},gt=[`stroke`,`cx`,`cy`,`r`,`fill`],_t=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],vt=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],yt=[`cx`,`cy`,`r`,`onMouseenter`,`onMouseleave`,`onClick`],bt=[`x`,`y`,`width`,`height`,`fill`,`rx`],xt=[`cx`,`cy`,`r`,`fill`,`stroke`],St=[`text-anchor`,`font-size`,`fill`,`font-weight`,`transform`,`onMouseenter`,`onMouseleave`,`onClick`,`innerHTML`],Ct={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},wt={key:5,class:`vue-data-ui-watermark`},Tt=[`id`],Et=[`onClick`],Dt={key:0},Ot={key:1},kt=/*#__PURE__*/ xe({__name:`vue-ui-rings`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:xe,emit:ct}){let kt=f(()=>import(`./Tooltip-C1q0Qoh7.js`)),At=f(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),jt=f(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Mt=f(()=>import(`./DataTable-0Vv-aGHD.js`)),Nt=f(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),Pt=f(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),Ft=f(()=>import(`./PackageVersion-CXT-eAuk.js`).then(e=>e.t)),It=f(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_rings:Lt}=t(),{isThemeValid:Rt,warnInvalidTheme:zt}=Ce(),Bt=ot(),S=e,C=v(!1),Vt=s(()=>!!S.dataset&&S.dataset.length),w=v(re()),T=v(!1),Ht=v(``),E=v(null),Ut=v(0),D=v(null),Wt=v(null),Gt=v(null),Kt=v(null),qt=v(null),Jt=v(0),Yt=v(0),Xt=v(0),Zt=v(!1),Qt=v(!1),$t=v(null),en=v(null),O=v(null),tn=v({x:0,y:0}),nn=v(`pointer`),rn=v(!1),k=v(dn()),A=s(()=>k.value.userOptions),j=s(()=>k.value.style.chart.layout.rings),M=s(()=>k.value.style.chart.layout.labels),N=s(()=>k.value.style.chart.tooltip),P=s(()=>k.value.style.chart);ye({config:()=>k.value,dataset:()=>S.dataset,component:`VueUiRings`,rules:[be.singleSeries,be.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]}]});let{transitionEnabled:F}=Pe({config:()=>k.value.transitions,dataset:()=>S.dataset}),I=s(()=>k.value.userOptions.useCursorPointer),an=s(()=>le({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{rings:{stroke:`#6A6A6A`,gradient:{underlayerColor:`#FFFFFF`}},labels:{dataLabels:{show:!1}}},legend:{backgroundColor:`transparent`}}}},userConfig:k.value.skeletonConfig??{}})),{loading:L,FINAL_DATASET:on,manualLoading:sn}=_e({...at(S),FINAL_CONFIG:k,prepareConfig:dn,skeletonDataset:S.config?.skeletonDataset??[{name:`_`,values:[13],color:`#808080`},{name:`_`,values:[8],color:`#969696`},{name:`_`,values:[5],color:`#ADADAD`},{name:`_`,values:[3],color:`#C4C4C4`},{name:`_`,values:[2],color:`#DBDBDB`}],skeletonConfig:le({defaultConfig:k.value,userConfig:an.value})}),{userOptionsVisible:cn,setUserOptionsVisibility:ln,keepUserOptionState:un}=Ve({config:k.value}),{svgRef:R}=He({config:P.value.title});function dn(){let e=Se({userConfig:S.config,defaultConfig:Lt}),t=e.theme;if(!t)return e;if(!Rt.value(e))return zt(e),e;let n=Se({userConfig:Ge[t]||S.config,defaultConfig:e});return{...Se({userConfig:S.config,defaultConfig:n}),customPalette:e.customPalette.length?e.customPalette:ue[e.theme]||a}}let fn=ae(S.config);st(()=>S.config,(e,t)=>{let n=ae(e),r=n!==fn;fn=n;let i=dn();r?(L.value||(k.value=i),cn.value=!k.value.userOptions.showOnChartHover,mn(),Jt.value+=1,Yt.value+=1,Xt.value+=1,U.value.showTable=k.value.table.show,U.value.showTooltip=N.value.show,U.value.showLabels=M.value.dataLabels.show,W.value.width=P.value.size,W.value.height=P.value.size):(k.value.style.chart.tooltip=i.style.chart.tooltip,U.value.showTooltip=k.value.style.chart.tooltip.show)},{deep:!0});let pn=s(()=>{let{markers:e}=M.value.dataLabels,t=Y.value/2,n=U.value.showLabels?e.position===`left`?t:-t:0,r=U.value.showLabels?W.value.width/2-t:0,i=e.position===`left`?r:-r;return{x:k.value.responsive?i:n/P.value.size*W.value.width,y:0/P.value.size*W.value.height}}),z=s(()=>({x:W.value.width/2+pn.value.x,y:W.value.height/2+pn.value.y}));st(()=>S.dataset,e=>{Array.isArray(e)&&e.length>0&&(sn.value=!1)},{deep:!0});let B=rt(null),V=rt(null);et(()=>{Qt.value=!0,mn()});let H=s(()=>k.value.debug);function mn(){if(ge(S.dataset)?(oe({componentName:`VueUiRings`,type:`dataset`,debug:H.value}),sn.value=!0):S.dataset.forEach((e,t)=>{e.values.length||(oe({componentName:`VueUiRings`,type:`dataset`,debug:H.value}),sn.value=!0),he({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{oe({componentName:`VueUiRings`,type:`datasetSerieAttribute`,property:e,index:t,debug:H.value})})}),ge(S.dataset)||(sn.value=k.value.loading),k.value.responsive){let e=Ie(()=>{Zt.value=!0;let{width:e,height:t}=Le({chart:D.value,title:P.value.title.text?Wt.value:null,legend:P.value.legend.show?Gt.value:null,source:Kt.value,noTitle:qt.value});requestAnimationFrame(()=>{W.value.width=e,W.value.height=t-12,Zt.value=!1})});B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect()),B.value=new ResizeObserver(e),V.value=D.value.parentNode,B.value.observe(V.value)}setTimeout(()=>{C.value=!0},600)}$e(()=>{B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect())});let{isPrinting:hn,isImaging:gn,generatePdf:_n,generateImage:vn}=Ne({elementId:`rings_${w.value}`,fileName:P.value.title.text||`vue-ui-rings`,options:k.value.userOptions.print}),yn=s(()=>k.value.userOptions.show&&!P.value.title.text),bn=s(()=>me(k.value.customPalette)),U=v({showTable:k.value.table.show,showTooltip:N.value.show,showLabels:M.value.dataLabels.show});st(k,()=>{U.value={showTable:k.value.table.show,showTooltip:N.value.show,showLabels:M.value.dataLabels.show}},{immediate:!0});let W=v({height:P.value.size,width:P.value.size}),xn=s(()=>Math.min(W.value.height,W.value.width)),Sn=ct,G=v([]);function Cn(){G.value.length?G.value=[]:jn.value.forEach(e=>{G.value.push(e.uid)}),wn()}function wn(){Sn(`selectLegend`,J.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function Tn(e){if(G.value.includes(e))G.value=G.value.filter(t=>t!==e);else{if(G.value.length===K.value.length-1)return;G.value.push(e)}wn()}function En(e){return K.value.length?K.value.find(t=>t.name===e)||(H.value&&console.warn(`VueUiRings - Series name not found "${e}"`),null):(H.value&&console.warn(`VueUiRings - There are no series to show.`),null)}function Dn(e){let t=En(e);t!==null&&G.value.includes(t.uid)&&Tn(t.uid)}function On(e){let t=En(e);t!==null&&(G.value.includes(t.uid)||Tn(t.uid))}let kn=s(()=>Math.max(...K.value.filter(e=>!G.value.includes(e.uid)).map(({value:e})=>e)));function An(e){return e/kn.value}let K=s(()=>on.value.map(({values:e,name:t,color:n=null},r)=>{let i=te(e).reduce((e,t)=>e+t,0);return{name:t,color:n||ne(n)||bn.value[r]||a[r]||a[r%a.length],value:i,proportion:i/on.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0),uid:re(),absoluteIndex:r}})),jn=s(()=>K.value.map((e,t)=>{let r=ce(M.value.dataLabels.formatter,e.value,n({p:M.value.dataLabels.prefix,v:e.value,s:M.value.dataLabels.suffix,r:P.value.legend.roundingValue}),{datapoint:e,index:t}),i=isNaN(e.value/q.value)?`-`:n({v:e.value/q.value*100,s:`%`,r:P.value.legend.roundingPercentage}),a=In({showVal:P.value.legend.showValue,showPercentage:P.value.legend.showPercentage,val:r,percentage:G.value.includes(e.uid)?`-%`:i});return{...e,shape:`circle`,opacity:G.value.includes(e.uid)?.5:1,segregate:()=>Tn(e.uid),isSegregated:G.value.includes(e.uid),display:`${e.name}${P.value.legend.showPercentage||P.value.legend.showValue?`: `:``}${a}`}}).toSorted((e,t)=>t.value-e.value)),Mn=s(()=>({cy:`rings-div-legend`,backgroundColor:P.value.legend.backgroundColor,color:P.value.legend.color,fontSize:P.value.legend.fontSize,paddingBottom:12,fontWeight:P.value.legend.bold?`bold`:``})),q=s(()=>K.value.filter(e=>!G.value.includes(e.uid)).map(({value:e})=>e).reduce((e,t)=>e+t,0)),J=s(()=>K.value.filter(e=>!G.value.includes(e.uid)).map(({name:e,value:t,color:n=null,uid:r,absoluteIndex:i},o)=>({absoluteIndex:i,uid:r,name:e,color:n||ne(n)||bn.value[o]||a[o]||a[o%a.length],value:t,proportion:An(t),percentage:t/q.value*100,strokeWidth:j.value.strokeWidth*An(t)})).toSorted((e,t)=>t.value-e.value));function Nn(){return J.value.map(({name:e,color:t,value:n,absoluteValues:r,percentage:i})=>({name:e,color:t,value:n,absoluteValues:r,percentage:i}))}let Y=s(()=>xn.value-j.value.strokeWidth*2);function Pn(e,t){k.value.events.datapointClick&&k.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Fn(e,t){E.value=null,T.value=!1,O.value=null,nn.value=`pointer`,k.value.events.datapointLeave&&k.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function In({val:e,percentage:t,showVal:n,showPercentage:r}){let i=M.value.dataLabels;return Ue({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}function Ln(e){let t=M.value.dataLabels,r=ce(t.formatter,e.value,n({p:t.prefix,v:e.value,s:t.suffix,r:t.roundingValue})),i=n({v:e.percentage,s:`%`,r:t.roundingPercentage});return`${e.name}\n${In({val:r,percentage:i,showVal:t.showValue,showPercentage:t.showPercentage})}`}function Rn(e){return se(Y.value*e.proportion/2*.9<=0?1e-4:Y.value*e.proportion/2*.9)}function zn(e,t){return t===0?z.value.y:z.value.y+Y.value*J.value[0].proportion/2-Y.value*e.proportion/2-2*(t+1)}function X(e,t){let n=M.value.dataLabels.markers.position===`left`?-(Y.value/2):Y.value/2;return{x:z.value.x+n,y:zn(e,t)-Rn(e)}}let Bn=v(null);function Vn(e,t,r=`pointer`){if(k.value.events.datapointEnter&&k.value.events.datapointEnter({datapoint:e,seriesIndex:t}),G.value.length===S.dataset.length)return;Bn.value={datapoint:e,seriesIndex:t,series:J.value,config:k.value},E.value=t,O.value=t,nn.value=r;let a=J.value[t],o=N.value.customFormat;if(i(o)&&fe(()=>o({seriesIndex:t,datapoint:e,series:J.value,config:k.value})))Ht.value=o({seriesIndex:t,datapoint:e,series:J.value,config:k.value});else{let r=``;r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${N.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${a.color}" />${Bt.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${w.value}_${e.absoluteIndex})" />`:``}</svg>`,r+=`<b>${In({showVal:N.value.showValue,showPercentage:N.value.showPercentage,val:`<span>${ce(M.value.dataLabels.formatter,a.value,n({p:M.value.dataLabels.prefix,v:a.value,s:M.value.dataLabels.suffix,r:N.value.roundingValue}),{datapoint:e,seriesIndex:t})}</span>`,percentage:n({v:a.value/q.value*100,s:`%`,r:N.value.roundingPercentage})})}</b></div>`,Ht.value=r}T.value=!0}let Z=s(()=>({head:J.value.map(e=>({name:e.name,color:e.color})),body:J.value.map(e=>e.value)})),Q=s(()=>{let e=[`__SUM__`,n({p:M.value.dataLabels.prefix,v:q.value,s:M.value.dataLabels.suffix,r:k.value.table.td.roundingValue}),`100%`],t=Z.value.head.map((e,t)=>[{color:e.color,name:e.name},n({p:M.value.dataLabels.prefix,v:Z.value.body[t],s:M.value.dataLabels.suffix,r:k.value.table.td.roundingValue}),isNaN(Z.value.body[t]/q.value)?`-`:(Z.value.body[t]/q.value*100).toFixed(k.value.table.td.roundingPercentage)+`%`]);return{head:e,body:t,a11yBody:t.map(e=>e.map((e,t)=>t===0?e.name:e)),config:{th:{backgroundColor:k.value.table.th.backgroundColor,color:k.value.table.th.color,outline:k.value.table.th.outline},td:{backgroundColor:k.value.table.td.backgroundColor,color:k.value.table.td.color,outline:k.value.table.td.outline},breakpoint:k.value.table.responsiveBreakpoint},colNames:[k.value.table.columnNames.series,k.value.table.columnNames.value,k.value.table.columnNames.percentage]}});function Hn(e=null){Qe(()=>{let t=Z.value.head.map((e,t)=>[[e.name],[Z.value.body[t]],[isNaN(Z.value.body[t]/q.value)?`-`:Z.value.body[t]/q.value*100]]),n=[[P.value.title.text],[P.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),i=r(n);e?e(i):de({csvContent:i,title:P.value.title.text||`vue-ui-rings`})})}let $=v(!1);function Un(e){$.value=e,Ut.value+=1}function Wn(){U.value.showTable=!U.value.showTable}function Gn(){U.value.showTooltip=!U.value.showTooltip}function Kn(){U.value.showLabels=!U.value.showLabels}let qn=v(!1);function Jn(){qn.value=!qn.value}let Yn=we(D,()=>P.value.title.text),Xn=s(()=>Oe({config:k,style:P,mutableConfig:U,dialog:It,accordion:jt,isFullscreen:$,parent:D,maxWidth:800,isCursorPointer:I}));st(()=>U.value.showTable,e=>De(e,k,$t));function Zn(){U.value.showTable=!1,en.value&&en.value.setTableIconState(!1)}let Qn=s(()=>jn.value.map(e=>({...e,name:e.display}))),$n=s(()=>P.value.backgroundColor),er=s(()=>P.value.legend),tr=s(()=>P.value.title),{isCallbackImaging:nr,isCallbackSvg:rr,generateSvg:ir,onGenerateImage:ar}=Ee({svg:R,title:tr,legend:er,legendItems:Qn,backgroundColor:$n,getSvgCallback:()=>k.value.userOptions.callbacks.svg,generateImage:vn});async function or(){Sn(`copyAlt`,{config:k.value,dataset:J.value}),k.value.userOptions.callbacks.altCopy?await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:J.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function sr(){O.value=null,rn.value=!0}function cr(){O.value=null,nn.value=`pointer`,T.value=!1,E.value=null,rn.value=!1}function lr(e){if(!R.value||qn.value||document.activeElement!==R.value||!J.value.length||G.value.length===S.dataset.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){O.value=null,nn.value=`pointer`,T.value=!1,E.value=null;return}if(r){if(O.value===null)return;let e=J.value[O.value];if(!e)return;Pn(e,O.value);return}let a=O.value;a===null||a<0||a>=J.value.length?a=n?0:J.value.length-1:n?(a+=1,a>=J.value.length&&(a=0)):t&&(--a,a<0&&(a=J.value.length-1));let o=J.value[a];o&&(ur(a),Vn(o,a,`keyboard`))}function ur(e){if(!Number.isFinite(e)||!R.value)return;let t=J.value[e];if(!t)return;let n=X(t,e),r=R.value.getBoundingClientRect();tn.value={x:r.left+n.x/W.value.width*r.width,y:r.top+n.y/W.value.height*r.height}}let dr=s(()=>({headers:Q.value?.colNames??[],rows:Q.value?.a11yBody??[]}));return xe({getData:Nn,getImage:Yn,generatePdf:_n,generateCsv:Hn,generateImage:vn,generateSvg:ir,hideSeries:On,showSeries:Dn,toggleTable:Wn,toggleTooltip:Gn,toggleAnnotator:Jn,toggleFullscreen:Un,toggleLabels:Kn,copyAlt:or}),(e,t)=>(_(),u(`div`,{ref_key:`ringsChart`,ref:D,class:m(`vue-data-ui-component vue-ui-rings ${$.value?`vue-data-ui-wrapper-fullscreen`:``} ${k.value.useCssAnimation?``:`vue-ui-dna`}`),style:g(`font-family:${k.value.style.fontFamily};text-align:center;width:100%;background:${P.value.backgroundColor};${k.value.responsive?`height: 100%`:``}`),id:`rings_${w.value}`,onMouseleave:t[2]||=e=>{E.value=null,T.value=!1,b(ln)(!1)},onMouseenter:t[3]||=()=>b(ln)(!0)},[d(`div`,{id:`chart-instructions-${w.value}`,class:`sr-only`},[d(`p`,null,it(k.value.a11y.translations.keyboardNavigation),1)],8,ut),dr.value?.rows?.length?(_(),c(Be,{key:0,uid:w.value,head:dr.value.headers,body:dr.value.rows,notice:k.value.a11y.translations.tableAvailable,caption:k.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):l(``,!0),A.value.buttons.annotator?(_(),c(b(Nt),{key:1,svgRef:b(R),backgroundColor:P.value.backgroundColor,color:P.value.color,active:qn.value,isCursorPointer:I.value,palette:A.value.annotatorPalette,onClose:Jn},Je({_:2},[tt(b(Ae),t=>({name:t,fn:x(n=>[y(e.$slots,t,h(p(b(ke)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):l(``,!0),yn.value?(_(),u(`div`,{key:2,ref_key:`noTitle`,ref:qt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):l(``,!0),P.value.title.text?(_(),u(`div`,{key:3,ref_key:`chartTitle`,ref:Wt,style:`width:100%;background:transparent`},[(_(),c(Te,{key:`title_${Jt.value}`,config:{title:{cy:`rings-div-title`,...P.value.title},subtitle:{cy:`rings-div-subtitle`,...P.value.title.subtitle}}},null,8,[`config`]))],512)):l(``,!0),d(`div`,{id:`legend-top-${w.value}`},null,8,dt),A.value.show&&Vt.value&&(b(un)||b(cn))?(_(),c(b(Pt),{ref_key:`userOptionsRef`,ref:en,key:`user_options_${Ut.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isPrinting:b(hn),isImaging:b(gn),uid:w.value,hasTooltip:A.value.buttons.tooltip&&N.value.show,hasPdf:A.value.buttons.pdf,hasXls:A.value.buttons.csv,hasImg:A.value.buttons.img,hasSvg:A.value.buttons.svg,hasTable:A.value.buttons.table,hasFullscreen:A.value.buttons.fullscreen,hasAltCopy:A.value.buttons.altCopy,hasLabel:A.value.buttons.labels,isTooltip:U.value.showTooltip,isFullscreen:$.value,titles:{...A.value.buttonTitles},chartElement:D.value,position:A.value.position,hasAnnotator:A.value.buttons.annotator,isAnnotation:qn.value,callbacks:A.value.callbacks,printScale:A.value.print.scale,tableDialog:k.value.table.useDialog,isCursorPointer:I.value,onToggleFullscreen:Un,onGeneratePdf:b(_n),onGenerateCsv:Hn,onGenerateImage:b(ar),onGenerateSvg:b(ir),onToggleTable:Wn,onToggleTooltip:Gn,onToggleAnnotator:Jn,onToggleLabels:Kn,onCopyAlt:or,style:g({visibility:b(un)?b(cn)?`visible`:`hidden`:`visible`})},Je({_:2},[tt(b(je)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:x(n=>[y(e.$slots,t,h(p(b(Me)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasFullscreen.hasAltCopy.hasLabel.isTooltip.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):l(``,!0),d(`div`,ft,[(_(),u(`svg`,{ref_key:`svgRef`,ref:R,xmlns:b(pe),class:m({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value,resizing:Zt.value||b(L),"vue-data-ui-no-transition":!b(F)}),viewBox:`0 0 ${W.value.width<=0?10:W.value.width} ${W.value.height<=0?10:W.value.height}`,style:g(`max-width:100%;overflow:hidden;background:transparent;color:${P.value.color}`),"aria-describedby":`chart-instructions-${w.value}`,tabindex:`0`,onFocus:sr,onBlur:cr,onKeydown:lr},[Xe(b(Ft)),y(e.$slots,`svg-underlayer`,{svg:{...W.value,isPrintingImg:b(hn)||b(gn)||b(nr),isPrintingSvg:b(rr)}},void 0,!0),e.$slots[`chart-background`]?(_(),u(`foreignObject`,{key:0,x:0,y:0,width:W.value.width<=0?10:W.value.width,height:W.value.height<=0?10:W.value.height,style:{pointerEvents:`none`}},[y(e.$slots,`chart-background`,{},void 0,!0)],8,mt)):l(``,!0),d(`defs`,null,[(_(!0),u(Ke,null,tt(J.value,(e,t)=>(_(),c(Re,{t:`radial`,cx:`50%`,cy:`30%`,r:`50%`,fx:`50%`,fy:`50%`,id:`gradient_${w.value}_${t}`,key:`gradient_${w.value}_${t}`,stops:[[`0%`,b(ee)(b(ie)(e.color,.05),100-j.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),e.$slots.pattern?(_(),u(`g`,ht,[(_(!0),u(Ke,null,tt(J.value,t=>(_(),u(`defs`,null,[y(e.$slots,`pattern`,Ze({ref_for:!0},{seriesIndex:t.absoluteIndex,patternId:`pattern_${w.value}_${t.absoluteIndex}`}),void 0,!0)]))),256))])):l(``,!0),(_(!0),u(Ke,null,tt(J.value,(t,n)=>(_(),u(`g`,{key:`r_${t.uid}`},[d(`circle`,{class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-opacity":E.value!==null&&E.value!==n}),style:g(`animation-delay:${n*100}ms`),stroke:j.value.stroke,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:j.value.gradient.underlayerColor},null,14,gt),d(`circle`,{class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n}),style:g(`animation-delay:${n*100}ms`),stroke:j.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:j.value.gradient.show?`url(#gradient_${w.value}_${n})`:t.color},null,14,_t),e.$slots.pattern?(_(),u(`circle`,{key:0,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n}),style:g(`animation-delay:${n*100}ms`),stroke:j.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:`url(#pattern_${w.value}_${t.absoluteIndex})`},null,14,vt)):l(``,!0),d(`circle`,{stroke:`none`,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:`transparent`,onMouseenter:e=>Vn(t,n,`pointer`),onMouseleave:e=>Fn(t,n),onClick:e=>Pn(t,n)},null,40,yt),U.value.showLabels?(_(),u(Ke,{key:1},[d(`rect`,{x:M.value.dataLabels.markers.position===`left`?X(t,n).x:z.value.x,y:X(t,n).y-M.value.dataLabels.markers.strokeWidth/2,width:Math.abs(z.value.x-X(t,n).x),height:M.value.dataLabels.markers.strokeWidth,fill:M.value.dataLabels.markers.stroke,rx:M.value.dataLabels.markers.strokeWidth,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n})},null,10,bt),d(`circle`,{cx:X(t,n).x,cy:X(t,n).y,r:M.value.dataLabels.markers.radius,fill:t.color,stroke:P.value.backgroundColor,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n})},null,10,xt),d(`text`,{"text-anchor":M.value.dataLabels.markers.position===`left`?`end`:`start`,"font-size":M.value.dataLabels.fontSize,fill:M.value.dataLabels.color,"font-weight":M.value.dataLabels.bold?`bold`:`normal`,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n}),transform:`translate(${X(t,n).x+(M.value.dataLabels.markers.position===`left`?-M.value.dataLabels.offsetX-14:M.value.dataLabels.offsetX)+6}, ${X(t,n).y+M.value.dataLabels.fontSize/3})`,onMouseenter:e=>Vn(t,n,`pointer`),onMouseleave:e=>Fn(t,n),onClick:e=>Pn(t,n),innerHTML:b(o)({content:Ln(t),fontSize:M.value.dataLabels.fontSize,fill:M.value.dataLabels.color,x:0,y:0,translateY:!0})},null,42,St)],64)):l(``,!0)]))),128)),y(e.$slots,`svg`,{svg:{...W.value,isPrintingImg:b(hn)||b(gn)||b(nr),isPrintingSvg:b(rr)}},void 0,!0)],46,pt)),e.$slots.hint?(_(),u(`div`,Ct,[y(e.$slots,`hint`,h(p({hint:k.value.a11y.translations.keyboardNavigation,isVisible:rn.value})),void 0,!0)])):l(``,!0)]),e.$slots.watermark?(_(),u(`div`,wt,[y(e.$slots,`watermark`,h(p({isPrinting:b(hn)||b(gn)||b(nr)||b(rr)})),void 0,!0)])):l(``,!0),d(`div`,{id:`legend-bottom-${w.value}`},null,8,Tt),Qt.value&&(P.value.legend.show||e.$slots.legend)?(_(),c(qe,{key:6,to:P.value.legend.position===`top`?`#legend-top-${w.value}`:`#legend-bottom-${w.value}`},[d(`div`,{ref_key:`chartLegend`,ref:Gt},[y(e.$slots,`legend`,{legend:jn.value},()=>[P.value.legend.show?(_(),c(We,{key:`legend_${Xt.value}`,legendSet:jn.value,config:Mn.value,isCursorPointer:I.value,onClickMarker:t[0]||=({legend:e})=>Tn(e.uid)},Je({item:x(({legend:e,index:t})=>[b(L)?l(``,!0):(_(),u(`div`,{key:0,onClick:t=>Tn(e.uid),style:g(`opacity:${G.value.includes(e.uid)?.5:1}`)},it(e.display),13,Et))]),legendToggle:x(()=>[jn.value.length>2&&P.value.legend.selectAllToggle.show&&!b(L)?(_(),c(ze,{key:0,backgroundColor:P.value.legend.selectAllToggle.backgroundColor,color:P.value.legend.selectAllToggle.color,fontSize:P.value.legend.fontSize,checked:G.value.length>0,isCursorPointer:I.value,onToggle:Cn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):l(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:x(({legend:e,index:t})=>[Xe(Fe,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${w.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):l(``,!0)],!0)],512)],8,[`to`])):l(``,!0),e.$slots.source?(_(),u(`div`,{key:7,ref_key:`source`,ref:Kt,dir:`auto`},[y(e.$slots,`source`,{},void 0,!0)],512)):l(``,!0),Xe(b(kt),{teleportTo:N.value.teleportTo,show:U.value.showTooltip&&T.value&&G.value.length<S.dataset.length,backgroundColor:N.value.backgroundColor,color:N.value.color,borderRadius:N.value.borderRadius,borderColor:N.value.borderColor,borderWidth:N.value.borderWidth,fontSize:N.value.fontSize,backgroundOpacity:N.value.backgroundOpacity,position:N.value.position,offsetX:N.value.offsetX,offsetY:N.value.offsetY,parent:D.value,content:Ht.value,isFullscreen:$.value,isCustom:N.value.customFormat&&typeof N.value.customFormat==`function`,smooth:N.value.smooth,backdropFilter:N.value.backdropFilter,smoothForce:N.value.smoothForce,smoothSnapThreshold:N.value.smoothSnapThreshold,isA11yMode:nn.value===`keyboard`,a11yPosition:tn.value},{"tooltip-before":x(()=>[y(e.$slots,`tooltip-before`,h(p({...Bn.value})),void 0,!0)]),tooltip:x(()=>[y(e.$slots,`tooltip`,h(p({...Bn.value})),void 0,!0)]),"tooltip-after":x(()=>[y(e.$slots,`tooltip-after`,h(p({...Bn.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),Vt.value&&A.value.buttons.table?(_(),c(nt(Xn.value.component),Ze({key:8},Xn.value.props,{ref_key:`tableUnit`,ref:$t,onClose:Zn}),Je({content:x(()=>[(_(),c(b(Mt),{key:`table_${Yt.value}`,colNames:Q.value.colNames,head:Q.value.head,body:Q.value.body,config:Q.value.config,title:k.value.table.useDialog?``:Xn.value.title,withCloseButton:!k.value.table.useDialog,isCursorPointer:I.value,onClose:Zn},{th:x(({th:e})=>[e===`__SUM__`?(_(),u(`div`,Dt,[Xe(b(At),{name:`sigma`,stroke:Q.value.config.th.color,size:16},null,8,[`stroke`])])):(_(),u(`div`,Ot,it(e),1))]),td:x(({td:e})=>[Ye(it(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[k.value.table.useDialog?{name:`title`,fn:x(()=>[Ye(it(Xn.value.title),1)]),key:`0`}:void 0,k.value.table.useDialog?{name:`actions`,fn:x(()=>[d(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>Hn(A.value.callbacks.csv),style:g({cursor:I.value?`pointer`:`default`})},[Xe(b(At),{name:`fileCsv`,stroke:Xn.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):l(``,!0),y(e.$slots,`skeleton`,{},()=>[b(L)?(_(),c(ve,{key:0})):l(``,!0)],!0)],46,lt))}},[[`__scopeId`,`data-v-04059e87`]]);export{ct as n,kt as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Dt as i,Ht as a,J as o,Jt as ee,Kt as te,S as ne,X as re,Yt as ie,Zt as ae,at as oe,b as se,i as ce,in as le,nn as ue,nt as de,pt as fe,t as pe,w as me,yt as he,zt as ge}from"./lib-rPeBMZrn.js";import{n as _e,t as ve}from"./BaseScanner-8NdoBs7B.js";import{n as ye,t as be}from"./useHints-C-TwxM0Y.js";import{t as xe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as Se}from"./useNestedProp-DnGoh-XS.js";import{t as Ce}from"./useThemeCheck-BKNRbGeC.js";import{t as we}from"./chartImage-DPGnEuYM.js";import{n as Te}from"./Title-BliHuXfT.js";import{t as Ee}from"./useChartExport-BZts4KFb.js";import{n as De,t as Oe}from"./tableIntegration-CNoJ1CIY.js";import{n as ke,t as Ae}from"./annotationSlots-BRR85CqJ.js";import{n as je,t as Me}from"./userOptionsSlots-DYuo-E5m.js";import{t as Ne}from"./usePrinter-DVf3YcG5.js";import{t as Pe}from"./useTransitions-ChGGrtrv.js";import{t as Fe}from"./Shape-CRe8woTu.js";import{c as Ie}from"./canvas-lib-22VpOI4_.js";import{t as Le}from"./useResponsive-CENUxfEL.js";import{t as Re}from"./DefGrad-DKMq1REY.js";import{t as ze}from"./BaseLegendToggle-Q3TiW9u1.js";import{t as Be}from"./A11yDataTable-DWNlWXzs.js";import{t as Ve}from"./useUserOptionState-CXlFnwPv.js";import{t as He}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ue}from"./labelUtils-CdtU-yB_.js";import{t as We}from"./Legend-DM0ClX3D.js";import{t as Ge}from"./vue_ui_rings-BcDDXHpQ.js";import{Fragment as Ke,Teleport as qe,computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as Je,createTextVNode as Ye,createVNode as Xe,defineAsyncComponent as f,guardReactiveProps as p,mergeProps as Ze,nextTick as Qe,normalizeClass as m,normalizeProps as h,normalizeStyle as g,onBeforeUnmount as $e,onMounted as et,openBlock as _,ref as v,renderList as tt,renderSlot as y,resolveDynamicComponent as nt,shallowRef as rt,toDisplayString as it,toRefs as at,unref as b,useSlots as ot,watch as st,withCtx as x}from"vue";var ct=/* @__PURE__ */ e({default:()=>kt}),lt=[`id`],ut=[`id`],dt=[`id`],ft={style:{position:`relative`}},pt=[`xmlns`,`viewBox`,`aria-describedby`],mt=[`width`,`height`],ht={key:1},gt=[`stroke`,`cx`,`cy`,`r`,`fill`],_t=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],vt=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],yt=[`cx`,`cy`,`r`,`onMouseenter`,`onMouseleave`,`onClick`],bt=[`x`,`y`,`width`,`height`,`fill`,`rx`],xt=[`cx`,`cy`,`r`,`fill`,`stroke`],St=[`text-anchor`,`font-size`,`fill`,`font-weight`,`transform`,`onMouseenter`,`onMouseleave`,`onClick`,`innerHTML`],Ct={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},wt={key:5,class:`vue-data-ui-watermark`},Tt=[`id`],Et=[`onClick`],Dt={key:0},Ot={key:1},kt=/*#__PURE__*/ xe({__name:`vue-ui-rings`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:xe,emit:ct}){let kt=f(()=>import(`./Tooltip-C1q0Qoh7.js`)),At=f(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),jt=f(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Mt=f(()=>import(`./DataTable-0Vv-aGHD.js`)),Nt=f(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),Pt=f(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),Ft=f(()=>import(`./PackageVersion-DhptF5oD.js`).then(e=>e.t)),It=f(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_rings:Lt}=t(),{isThemeValid:Rt,warnInvalidTheme:zt}=Ce(),Bt=ot(),S=e,C=v(!1),Vt=s(()=>!!S.dataset&&S.dataset.length),w=v(re()),T=v(!1),Ht=v(``),E=v(null),Ut=v(0),D=v(null),Wt=v(null),Gt=v(null),Kt=v(null),qt=v(null),Jt=v(0),Yt=v(0),Xt=v(0),Zt=v(!1),Qt=v(!1),$t=v(null),en=v(null),O=v(null),tn=v({x:0,y:0}),nn=v(`pointer`),rn=v(!1),k=v(dn()),A=s(()=>k.value.userOptions),j=s(()=>k.value.style.chart.layout.rings),M=s(()=>k.value.style.chart.layout.labels),N=s(()=>k.value.style.chart.tooltip),P=s(()=>k.value.style.chart);ye({config:()=>k.value,dataset:()=>S.dataset,component:`VueUiRings`,rules:[be.singleSeries,be.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]}]});let{transitionEnabled:F}=Pe({config:()=>k.value.transitions,dataset:()=>S.dataset}),I=s(()=>k.value.userOptions.useCursorPointer),an=s(()=>le({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{rings:{stroke:`#6A6A6A`,gradient:{underlayerColor:`#FFFFFF`}},labels:{dataLabels:{show:!1}}},legend:{backgroundColor:`transparent`}}}},userConfig:k.value.skeletonConfig??{}})),{loading:L,FINAL_DATASET:on,manualLoading:sn}=_e({...at(S),FINAL_CONFIG:k,prepareConfig:dn,skeletonDataset:S.config?.skeletonDataset??[{name:`_`,values:[13],color:`#808080`},{name:`_`,values:[8],color:`#969696`},{name:`_`,values:[5],color:`#ADADAD`},{name:`_`,values:[3],color:`#C4C4C4`},{name:`_`,values:[2],color:`#DBDBDB`}],skeletonConfig:le({defaultConfig:k.value,userConfig:an.value})}),{userOptionsVisible:cn,setUserOptionsVisibility:ln,keepUserOptionState:un}=Ve({config:k.value}),{svgRef:R}=He({config:P.value.title});function dn(){let e=Se({userConfig:S.config,defaultConfig:Lt}),t=e.theme;if(!t)return e;if(!Rt.value(e))return zt(e),e;let n=Se({userConfig:Ge[t]||S.config,defaultConfig:e});return{...Se({userConfig:S.config,defaultConfig:n}),customPalette:e.customPalette.length?e.customPalette:ue[e.theme]||a}}let fn=ae(S.config);st(()=>S.config,(e,t)=>{let n=ae(e),r=n!==fn;fn=n;let i=dn();r?(L.value||(k.value=i),cn.value=!k.value.userOptions.showOnChartHover,mn(),Jt.value+=1,Yt.value+=1,Xt.value+=1,U.value.showTable=k.value.table.show,U.value.showTooltip=N.value.show,U.value.showLabels=M.value.dataLabels.show,W.value.width=P.value.size,W.value.height=P.value.size):(k.value.style.chart.tooltip=i.style.chart.tooltip,U.value.showTooltip=k.value.style.chart.tooltip.show)},{deep:!0});let pn=s(()=>{let{markers:e}=M.value.dataLabels,t=Y.value/2,n=U.value.showLabels?e.position===`left`?t:-t:0,r=U.value.showLabels?W.value.width/2-t:0,i=e.position===`left`?r:-r;return{x:k.value.responsive?i:n/P.value.size*W.value.width,y:0/P.value.size*W.value.height}}),z=s(()=>({x:W.value.width/2+pn.value.x,y:W.value.height/2+pn.value.y}));st(()=>S.dataset,e=>{Array.isArray(e)&&e.length>0&&(sn.value=!1)},{deep:!0});let B=rt(null),V=rt(null);et(()=>{Qt.value=!0,mn()});let H=s(()=>k.value.debug);function mn(){if(ge(S.dataset)?(oe({componentName:`VueUiRings`,type:`dataset`,debug:H.value}),sn.value=!0):S.dataset.forEach((e,t)=>{e.values.length||(oe({componentName:`VueUiRings`,type:`dataset`,debug:H.value}),sn.value=!0),he({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{oe({componentName:`VueUiRings`,type:`datasetSerieAttribute`,property:e,index:t,debug:H.value})})}),ge(S.dataset)||(sn.value=k.value.loading),k.value.responsive){let e=Ie(()=>{Zt.value=!0;let{width:e,height:t}=Le({chart:D.value,title:P.value.title.text?Wt.value:null,legend:P.value.legend.show?Gt.value:null,source:Kt.value,noTitle:qt.value});requestAnimationFrame(()=>{W.value.width=e,W.value.height=t-12,Zt.value=!1})});B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect()),B.value=new ResizeObserver(e),V.value=D.value.parentNode,B.value.observe(V.value)}setTimeout(()=>{C.value=!0},600)}$e(()=>{B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect())});let{isPrinting:hn,isImaging:gn,generatePdf:_n,generateImage:vn}=Ne({elementId:`rings_${w.value}`,fileName:P.value.title.text||`vue-ui-rings`,options:k.value.userOptions.print}),yn=s(()=>k.value.userOptions.show&&!P.value.title.text),bn=s(()=>me(k.value.customPalette)),U=v({showTable:k.value.table.show,showTooltip:N.value.show,showLabels:M.value.dataLabels.show});st(k,()=>{U.value={showTable:k.value.table.show,showTooltip:N.value.show,showLabels:M.value.dataLabels.show}},{immediate:!0});let W=v({height:P.value.size,width:P.value.size}),xn=s(()=>Math.min(W.value.height,W.value.width)),Sn=ct,G=v([]);function Cn(){G.value.length?G.value=[]:jn.value.forEach(e=>{G.value.push(e.uid)}),wn()}function wn(){Sn(`selectLegend`,J.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function Tn(e){if(G.value.includes(e))G.value=G.value.filter(t=>t!==e);else{if(G.value.length===K.value.length-1)return;G.value.push(e)}wn()}function En(e){return K.value.length?K.value.find(t=>t.name===e)||(H.value&&console.warn(`VueUiRings - Series name not found "${e}"`),null):(H.value&&console.warn(`VueUiRings - There are no series to show.`),null)}function Dn(e){let t=En(e);t!==null&&G.value.includes(t.uid)&&Tn(t.uid)}function On(e){let t=En(e);t!==null&&(G.value.includes(t.uid)||Tn(t.uid))}let kn=s(()=>Math.max(...K.value.filter(e=>!G.value.includes(e.uid)).map(({value:e})=>e)));function An(e){return e/kn.value}let K=s(()=>on.value.map(({values:e,name:t,color:n=null},r)=>{let i=te(e).reduce((e,t)=>e+t,0);return{name:t,color:n||ne(n)||bn.value[r]||a[r]||a[r%a.length],value:i,proportion:i/on.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0),uid:re(),absoluteIndex:r}})),jn=s(()=>K.value.map((e,t)=>{let r=ce(M.value.dataLabels.formatter,e.value,n({p:M.value.dataLabels.prefix,v:e.value,s:M.value.dataLabels.suffix,r:P.value.legend.roundingValue}),{datapoint:e,index:t}),i=isNaN(e.value/q.value)?`-`:n({v:e.value/q.value*100,s:`%`,r:P.value.legend.roundingPercentage}),a=In({showVal:P.value.legend.showValue,showPercentage:P.value.legend.showPercentage,val:r,percentage:G.value.includes(e.uid)?`-%`:i});return{...e,shape:`circle`,opacity:G.value.includes(e.uid)?.5:1,segregate:()=>Tn(e.uid),isSegregated:G.value.includes(e.uid),display:`${e.name}${P.value.legend.showPercentage||P.value.legend.showValue?`: `:``}${a}`}}).toSorted((e,t)=>t.value-e.value)),Mn=s(()=>({cy:`rings-div-legend`,backgroundColor:P.value.legend.backgroundColor,color:P.value.legend.color,fontSize:P.value.legend.fontSize,paddingBottom:12,fontWeight:P.value.legend.bold?`bold`:``})),q=s(()=>K.value.filter(e=>!G.value.includes(e.uid)).map(({value:e})=>e).reduce((e,t)=>e+t,0)),J=s(()=>K.value.filter(e=>!G.value.includes(e.uid)).map(({name:e,value:t,color:n=null,uid:r,absoluteIndex:i},o)=>({absoluteIndex:i,uid:r,name:e,color:n||ne(n)||bn.value[o]||a[o]||a[o%a.length],value:t,proportion:An(t),percentage:t/q.value*100,strokeWidth:j.value.strokeWidth*An(t)})).toSorted((e,t)=>t.value-e.value));function Nn(){return J.value.map(({name:e,color:t,value:n,absoluteValues:r,percentage:i})=>({name:e,color:t,value:n,absoluteValues:r,percentage:i}))}let Y=s(()=>xn.value-j.value.strokeWidth*2);function Pn(e,t){k.value.events.datapointClick&&k.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Fn(e,t){E.value=null,T.value=!1,O.value=null,nn.value=`pointer`,k.value.events.datapointLeave&&k.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function In({val:e,percentage:t,showVal:n,showPercentage:r}){let i=M.value.dataLabels;return Ue({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}function Ln(e){let t=M.value.dataLabels,r=ce(t.formatter,e.value,n({p:t.prefix,v:e.value,s:t.suffix,r:t.roundingValue})),i=n({v:e.percentage,s:`%`,r:t.roundingPercentage});return`${e.name}\n${In({val:r,percentage:i,showVal:t.showValue,showPercentage:t.showPercentage})}`}function Rn(e){return se(Y.value*e.proportion/2*.9<=0?1e-4:Y.value*e.proportion/2*.9)}function zn(e,t){return t===0?z.value.y:z.value.y+Y.value*J.value[0].proportion/2-Y.value*e.proportion/2-2*(t+1)}function X(e,t){let n=M.value.dataLabels.markers.position===`left`?-(Y.value/2):Y.value/2;return{x:z.value.x+n,y:zn(e,t)-Rn(e)}}let Bn=v(null);function Vn(e,t,r=`pointer`){if(k.value.events.datapointEnter&&k.value.events.datapointEnter({datapoint:e,seriesIndex:t}),G.value.length===S.dataset.length)return;Bn.value={datapoint:e,seriesIndex:t,series:J.value,config:k.value},E.value=t,O.value=t,nn.value=r;let a=J.value[t],o=N.value.customFormat;if(i(o)&&fe(()=>o({seriesIndex:t,datapoint:e,series:J.value,config:k.value})))Ht.value=o({seriesIndex:t,datapoint:e,series:J.value,config:k.value});else{let r=``;r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${N.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${a.color}" />${Bt.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${w.value}_${e.absoluteIndex})" />`:``}</svg>`,r+=`<b>${In({showVal:N.value.showValue,showPercentage:N.value.showPercentage,val:`<span>${ce(M.value.dataLabels.formatter,a.value,n({p:M.value.dataLabels.prefix,v:a.value,s:M.value.dataLabels.suffix,r:N.value.roundingValue}),{datapoint:e,seriesIndex:t})}</span>`,percentage:n({v:a.value/q.value*100,s:`%`,r:N.value.roundingPercentage})})}</b></div>`,Ht.value=r}T.value=!0}let Z=s(()=>({head:J.value.map(e=>({name:e.name,color:e.color})),body:J.value.map(e=>e.value)})),Q=s(()=>{let e=[`__SUM__`,n({p:M.value.dataLabels.prefix,v:q.value,s:M.value.dataLabels.suffix,r:k.value.table.td.roundingValue}),`100%`],t=Z.value.head.map((e,t)=>[{color:e.color,name:e.name},n({p:M.value.dataLabels.prefix,v:Z.value.body[t],s:M.value.dataLabels.suffix,r:k.value.table.td.roundingValue}),isNaN(Z.value.body[t]/q.value)?`-`:(Z.value.body[t]/q.value*100).toFixed(k.value.table.td.roundingPercentage)+`%`]);return{head:e,body:t,a11yBody:t.map(e=>e.map((e,t)=>t===0?e.name:e)),config:{th:{backgroundColor:k.value.table.th.backgroundColor,color:k.value.table.th.color,outline:k.value.table.th.outline},td:{backgroundColor:k.value.table.td.backgroundColor,color:k.value.table.td.color,outline:k.value.table.td.outline},breakpoint:k.value.table.responsiveBreakpoint},colNames:[k.value.table.columnNames.series,k.value.table.columnNames.value,k.value.table.columnNames.percentage]}});function Hn(e=null){Qe(()=>{let t=Z.value.head.map((e,t)=>[[e.name],[Z.value.body[t]],[isNaN(Z.value.body[t]/q.value)?`-`:Z.value.body[t]/q.value*100]]),n=[[P.value.title.text],[P.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),i=r(n);e?e(i):de({csvContent:i,title:P.value.title.text||`vue-ui-rings`})})}let $=v(!1);function Un(e){$.value=e,Ut.value+=1}function Wn(){U.value.showTable=!U.value.showTable}function Gn(){U.value.showTooltip=!U.value.showTooltip}function Kn(){U.value.showLabels=!U.value.showLabels}let qn=v(!1);function Jn(){qn.value=!qn.value}let Yn=we(D,()=>P.value.title.text),Xn=s(()=>Oe({config:k,style:P,mutableConfig:U,dialog:It,accordion:jt,isFullscreen:$,parent:D,maxWidth:800,isCursorPointer:I}));st(()=>U.value.showTable,e=>De(e,k,$t));function Zn(){U.value.showTable=!1,en.value&&en.value.setTableIconState(!1)}let Qn=s(()=>jn.value.map(e=>({...e,name:e.display}))),$n=s(()=>P.value.backgroundColor),er=s(()=>P.value.legend),tr=s(()=>P.value.title),{isCallbackImaging:nr,isCallbackSvg:rr,generateSvg:ir,onGenerateImage:ar}=Ee({svg:R,title:tr,legend:er,legendItems:Qn,backgroundColor:$n,getSvgCallback:()=>k.value.userOptions.callbacks.svg,generateImage:vn});async function or(){Sn(`copyAlt`,{config:k.value,dataset:J.value}),k.value.userOptions.callbacks.altCopy?await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:J.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function sr(){O.value=null,rn.value=!0}function cr(){O.value=null,nn.value=`pointer`,T.value=!1,E.value=null,rn.value=!1}function lr(e){if(!R.value||qn.value||document.activeElement!==R.value||!J.value.length||G.value.length===S.dataset.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){O.value=null,nn.value=`pointer`,T.value=!1,E.value=null;return}if(r){if(O.value===null)return;let e=J.value[O.value];if(!e)return;Pn(e,O.value);return}let a=O.value;a===null||a<0||a>=J.value.length?a=n?0:J.value.length-1:n?(a+=1,a>=J.value.length&&(a=0)):t&&(--a,a<0&&(a=J.value.length-1));let o=J.value[a];o&&(ur(a),Vn(o,a,`keyboard`))}function ur(e){if(!Number.isFinite(e)||!R.value)return;let t=J.value[e];if(!t)return;let n=X(t,e),r=R.value.getBoundingClientRect();tn.value={x:r.left+n.x/W.value.width*r.width,y:r.top+n.y/W.value.height*r.height}}let dr=s(()=>({headers:Q.value?.colNames??[],rows:Q.value?.a11yBody??[]}));return xe({getData:Nn,getImage:Yn,generatePdf:_n,generateCsv:Hn,generateImage:vn,generateSvg:ir,hideSeries:On,showSeries:Dn,toggleTable:Wn,toggleTooltip:Gn,toggleAnnotator:Jn,toggleFullscreen:Un,toggleLabels:Kn,copyAlt:or}),(e,t)=>(_(),u(`div`,{ref_key:`ringsChart`,ref:D,class:m(`vue-data-ui-component vue-ui-rings ${$.value?`vue-data-ui-wrapper-fullscreen`:``} ${k.value.useCssAnimation?``:`vue-ui-dna`}`),style:g(`font-family:${k.value.style.fontFamily};text-align:center;width:100%;background:${P.value.backgroundColor};${k.value.responsive?`height: 100%`:``}`),id:`rings_${w.value}`,onMouseleave:t[2]||=e=>{E.value=null,T.value=!1,b(ln)(!1)},onMouseenter:t[3]||=()=>b(ln)(!0)},[d(`div`,{id:`chart-instructions-${w.value}`,class:`sr-only`},[d(`p`,null,it(k.value.a11y.translations.keyboardNavigation),1)],8,ut),dr.value?.rows?.length?(_(),c(Be,{key:0,uid:w.value,head:dr.value.headers,body:dr.value.rows,notice:k.value.a11y.translations.tableAvailable,caption:k.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):l(``,!0),A.value.buttons.annotator?(_(),c(b(Nt),{key:1,svgRef:b(R),backgroundColor:P.value.backgroundColor,color:P.value.color,active:qn.value,isCursorPointer:I.value,palette:A.value.annotatorPalette,onClose:Jn},Je({_:2},[tt(b(Ae),t=>({name:t,fn:x(n=>[y(e.$slots,t,h(p(b(ke)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):l(``,!0),yn.value?(_(),u(`div`,{key:2,ref_key:`noTitle`,ref:qt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):l(``,!0),P.value.title.text?(_(),u(`div`,{key:3,ref_key:`chartTitle`,ref:Wt,style:`width:100%;background:transparent`},[(_(),c(Te,{key:`title_${Jt.value}`,config:{title:{cy:`rings-div-title`,...P.value.title},subtitle:{cy:`rings-div-subtitle`,...P.value.title.subtitle}}},null,8,[`config`]))],512)):l(``,!0),d(`div`,{id:`legend-top-${w.value}`},null,8,dt),A.value.show&&Vt.value&&(b(un)||b(cn))?(_(),c(b(Pt),{ref_key:`userOptionsRef`,ref:en,key:`user_options_${Ut.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isPrinting:b(hn),isImaging:b(gn),uid:w.value,hasTooltip:A.value.buttons.tooltip&&N.value.show,hasPdf:A.value.buttons.pdf,hasXls:A.value.buttons.csv,hasImg:A.value.buttons.img,hasSvg:A.value.buttons.svg,hasTable:A.value.buttons.table,hasFullscreen:A.value.buttons.fullscreen,hasAltCopy:A.value.buttons.altCopy,hasLabel:A.value.buttons.labels,isTooltip:U.value.showTooltip,isFullscreen:$.value,titles:{...A.value.buttonTitles},chartElement:D.value,position:A.value.position,hasAnnotator:A.value.buttons.annotator,isAnnotation:qn.value,callbacks:A.value.callbacks,printScale:A.value.print.scale,tableDialog:k.value.table.useDialog,isCursorPointer:I.value,onToggleFullscreen:Un,onGeneratePdf:b(_n),onGenerateCsv:Hn,onGenerateImage:b(ar),onGenerateSvg:b(ir),onToggleTable:Wn,onToggleTooltip:Gn,onToggleAnnotator:Jn,onToggleLabels:Kn,onCopyAlt:or,style:g({visibility:b(un)?b(cn)?`visible`:`hidden`:`visible`})},Je({_:2},[tt(b(je)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:x(n=>[y(e.$slots,t,h(p(b(Me)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasXls.hasImg.hasSvg.hasTable.hasFullscreen.hasAltCopy.hasLabel.isTooltip.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):l(``,!0),d(`div`,ft,[(_(),u(`svg`,{ref_key:`svgRef`,ref:R,xmlns:b(pe),class:m({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value,resizing:Zt.value||b(L),"vue-data-ui-no-transition":!b(F)}),viewBox:`0 0 ${W.value.width<=0?10:W.value.width} ${W.value.height<=0?10:W.value.height}`,style:g(`max-width:100%;overflow:hidden;background:transparent;color:${P.value.color}`),"aria-describedby":`chart-instructions-${w.value}`,tabindex:`0`,onFocus:sr,onBlur:cr,onKeydown:lr},[Xe(b(Ft)),y(e.$slots,`svg-underlayer`,{svg:{...W.value,isPrintingImg:b(hn)||b(gn)||b(nr),isPrintingSvg:b(rr)}},void 0,!0),e.$slots[`chart-background`]?(_(),u(`foreignObject`,{key:0,x:0,y:0,width:W.value.width<=0?10:W.value.width,height:W.value.height<=0?10:W.value.height,style:{pointerEvents:`none`}},[y(e.$slots,`chart-background`,{},void 0,!0)],8,mt)):l(``,!0),d(`defs`,null,[(_(!0),u(Ke,null,tt(J.value,(e,t)=>(_(),c(Re,{t:`radial`,cx:`50%`,cy:`30%`,r:`50%`,fx:`50%`,fy:`50%`,id:`gradient_${w.value}_${t}`,key:`gradient_${w.value}_${t}`,stops:[[`0%`,b(ee)(b(ie)(e.color,.05),100-j.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),e.$slots.pattern?(_(),u(`g`,ht,[(_(!0),u(Ke,null,tt(J.value,t=>(_(),u(`defs`,null,[y(e.$slots,`pattern`,Ze({ref_for:!0},{seriesIndex:t.absoluteIndex,patternId:`pattern_${w.value}_${t.absoluteIndex}`}),void 0,!0)]))),256))])):l(``,!0),(_(!0),u(Ke,null,tt(J.value,(t,n)=>(_(),u(`g`,{key:`r_${t.uid}`},[d(`circle`,{class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-opacity":E.value!==null&&E.value!==n}),style:g(`animation-delay:${n*100}ms`),stroke:j.value.stroke,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:j.value.gradient.underlayerColor},null,14,gt),d(`circle`,{class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n}),style:g(`animation-delay:${n*100}ms`),stroke:j.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:j.value.gradient.show?`url(#gradient_${w.value}_${n})`:t.color},null,14,_t),e.$slots.pattern?(_(),u(`circle`,{key:0,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n}),style:g(`animation-delay:${n*100}ms`),stroke:j.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:`url(#pattern_${w.value}_${t.absoluteIndex})`},null,14,vt)):l(``,!0),d(`circle`,{stroke:`none`,cx:z.value.x,cy:zn(t,n),r:Rn(t),fill:`transparent`,onMouseenter:e=>Vn(t,n,`pointer`),onMouseleave:e=>Fn(t,n),onClick:e=>Pn(t,n)},null,40,yt),U.value.showLabels?(_(),u(Ke,{key:1},[d(`rect`,{x:M.value.dataLabels.markers.position===`left`?X(t,n).x:z.value.x,y:X(t,n).y-M.value.dataLabels.markers.strokeWidth/2,width:Math.abs(z.value.x-X(t,n).x),height:M.value.dataLabels.markers.strokeWidth,fill:M.value.dataLabels.markers.stroke,rx:M.value.dataLabels.markers.strokeWidth,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n})},null,10,bt),d(`circle`,{cx:X(t,n).x,cy:X(t,n).y,r:M.value.dataLabels.markers.radius,fill:t.color,stroke:P.value.backgroundColor,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n})},null,10,xt),d(`text`,{"text-anchor":M.value.dataLabels.markers.position===`left`?`end`:`start`,"font-size":M.value.dataLabels.fontSize,fill:M.value.dataLabels.color,"font-weight":M.value.dataLabels.bold?`bold`:`normal`,class:m({"vue-data-ui-transition":C.value&&b(F),"vue-rings-item-onload":!C.value&&k.value.useCssAnimation&&!b(L),"vue-ui-rings-shadow":j.value.useShadow,"vue-ui-rings-blur":E.value!==null&&E.value!==n}),transform:`translate(${X(t,n).x+(M.value.dataLabels.markers.position===`left`?-M.value.dataLabels.offsetX-14:M.value.dataLabels.offsetX)+6}, ${X(t,n).y+M.value.dataLabels.fontSize/3})`,onMouseenter:e=>Vn(t,n,`pointer`),onMouseleave:e=>Fn(t,n),onClick:e=>Pn(t,n),innerHTML:b(o)({content:Ln(t),fontSize:M.value.dataLabels.fontSize,fill:M.value.dataLabels.color,x:0,y:0,translateY:!0})},null,42,St)],64)):l(``,!0)]))),128)),y(e.$slots,`svg`,{svg:{...W.value,isPrintingImg:b(hn)||b(gn)||b(nr),isPrintingSvg:b(rr)}},void 0,!0)],46,pt)),e.$slots.hint?(_(),u(`div`,Ct,[y(e.$slots,`hint`,h(p({hint:k.value.a11y.translations.keyboardNavigation,isVisible:rn.value})),void 0,!0)])):l(``,!0)]),e.$slots.watermark?(_(),u(`div`,wt,[y(e.$slots,`watermark`,h(p({isPrinting:b(hn)||b(gn)||b(nr)||b(rr)})),void 0,!0)])):l(``,!0),d(`div`,{id:`legend-bottom-${w.value}`},null,8,Tt),Qt.value&&(P.value.legend.show||e.$slots.legend)?(_(),c(qe,{key:6,to:P.value.legend.position===`top`?`#legend-top-${w.value}`:`#legend-bottom-${w.value}`},[d(`div`,{ref_key:`chartLegend`,ref:Gt},[y(e.$slots,`legend`,{legend:jn.value},()=>[P.value.legend.show?(_(),c(We,{key:`legend_${Xt.value}`,legendSet:jn.value,config:Mn.value,isCursorPointer:I.value,onClickMarker:t[0]||=({legend:e})=>Tn(e.uid)},Je({item:x(({legend:e,index:t})=>[b(L)?l(``,!0):(_(),u(`div`,{key:0,onClick:t=>Tn(e.uid),style:g(`opacity:${G.value.includes(e.uid)?.5:1}`)},it(e.display),13,Et))]),legendToggle:x(()=>[jn.value.length>2&&P.value.legend.selectAllToggle.show&&!b(L)?(_(),c(ze,{key:0,backgroundColor:P.value.legend.selectAllToggle.backgroundColor,color:P.value.legend.selectAllToggle.color,fontSize:P.value.legend.fontSize,checked:G.value.length>0,isCursorPointer:I.value,onToggle:Cn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):l(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:x(({legend:e,index:t})=>[Xe(Fe,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${w.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):l(``,!0)],!0)],512)],8,[`to`])):l(``,!0),e.$slots.source?(_(),u(`div`,{key:7,ref_key:`source`,ref:Kt,dir:`auto`},[y(e.$slots,`source`,{},void 0,!0)],512)):l(``,!0),Xe(b(kt),{teleportTo:N.value.teleportTo,show:U.value.showTooltip&&T.value&&G.value.length<S.dataset.length,backgroundColor:N.value.backgroundColor,color:N.value.color,borderRadius:N.value.borderRadius,borderColor:N.value.borderColor,borderWidth:N.value.borderWidth,fontSize:N.value.fontSize,backgroundOpacity:N.value.backgroundOpacity,position:N.value.position,offsetX:N.value.offsetX,offsetY:N.value.offsetY,parent:D.value,content:Ht.value,isFullscreen:$.value,isCustom:N.value.customFormat&&typeof N.value.customFormat==`function`,smooth:N.value.smooth,backdropFilter:N.value.backdropFilter,smoothForce:N.value.smoothForce,smoothSnapThreshold:N.value.smoothSnapThreshold,isA11yMode:nn.value===`keyboard`,a11yPosition:tn.value},{"tooltip-before":x(()=>[y(e.$slots,`tooltip-before`,h(p({...Bn.value})),void 0,!0)]),tooltip:x(()=>[y(e.$slots,`tooltip`,h(p({...Bn.value})),void 0,!0)]),"tooltip-after":x(()=>[y(e.$slots,`tooltip-after`,h(p({...Bn.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),Vt.value&&A.value.buttons.table?(_(),c(nt(Xn.value.component),Ze({key:8},Xn.value.props,{ref_key:`tableUnit`,ref:$t,onClose:Zn}),Je({content:x(()=>[(_(),c(b(Mt),{key:`table_${Yt.value}`,colNames:Q.value.colNames,head:Q.value.head,body:Q.value.body,config:Q.value.config,title:k.value.table.useDialog?``:Xn.value.title,withCloseButton:!k.value.table.useDialog,isCursorPointer:I.value,onClose:Zn},{th:x(({th:e})=>[e===`__SUM__`?(_(),u(`div`,Dt,[Xe(b(At),{name:`sigma`,stroke:Q.value.config.th.color,size:16},null,8,[`stroke`])])):(_(),u(`div`,Ot,it(e),1))]),td:x(({td:e})=>[Ye(it(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[k.value.table.useDialog?{name:`title`,fn:x(()=>[Ye(it(Xn.value.title),1)]),key:`0`}:void 0,k.value.table.useDialog?{name:`actions`,fn:x(()=>[d(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>Hn(A.value.callbacks.csv),style:g({cursor:I.value?`pointer`:`default`})},[Xe(b(At),{name:`fileCsv`,stroke:Xn.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):l(``,!0),y(e.$slots,`skeleton`,{},()=>[b(L)?(_(),c(ve,{key:0})):l(``,!0)],!0)],46,lt))}},[[`__scopeId`,`data-v-04059e87`]]);export{ct as n,kt as t};