vue-data-ui 3.29.0 → 3.29.1

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 (163) hide show
  1. package/dist/{PackageVersion-B9qiUJPH.js → PackageVersion-BbZ3wNGs.js} +1 -1
  2. package/dist/{StackChartTable-D-31a1zL.js → StackChartTable-rTC6w378.js} +1 -1
  3. package/dist/{XyAnalysisOptions-DKCLKOkA.js → XyAnalysisOptions-BpjGs_2b.js} +1 -1
  4. package/dist/components/vue-ui-3d-bar.js +1 -1
  5. package/dist/components/vue-ui-accordion.js +1 -1
  6. package/dist/components/vue-ui-age-pyramid.js +1 -1
  7. package/dist/components/vue-ui-annotator.js +1 -1
  8. package/dist/components/vue-ui-bullet.js +1 -1
  9. package/dist/components/vue-ui-bump.js +1 -1
  10. package/dist/components/vue-ui-candlestick.js +1 -1
  11. package/dist/components/vue-ui-carousel-table.js +1 -1
  12. package/dist/components/vue-ui-chestnut.js +1 -1
  13. package/dist/components/vue-ui-chord.js +1 -1
  14. package/dist/components/vue-ui-circle-pack.js +1 -1
  15. package/dist/components/vue-ui-cursor.js +1 -1
  16. package/dist/components/vue-ui-dag.js +1 -1
  17. package/dist/components/vue-ui-dashboard.js +1 -1
  18. package/dist/components/vue-ui-digits.js +1 -1
  19. package/dist/components/vue-ui-donut-evolution.js +1 -1
  20. package/dist/components/vue-ui-donut.js +1 -1
  21. package/dist/components/vue-ui-dumbbell.js +1 -1
  22. package/dist/components/vue-ui-flow.js +1 -1
  23. package/dist/components/vue-ui-funnel.js +1 -1
  24. package/dist/components/vue-ui-galaxy.js +1 -1
  25. package/dist/components/vue-ui-gauge.js +1 -1
  26. package/dist/components/vue-ui-geo.js +1 -1
  27. package/dist/components/vue-ui-gizmo.js +1 -1
  28. package/dist/components/vue-ui-graph.js +1 -1
  29. package/dist/components/vue-ui-heatmap.js +1 -1
  30. package/dist/components/vue-ui-hill.js +1 -1
  31. package/dist/components/vue-ui-history-plot.js +1 -1
  32. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  33. package/dist/components/vue-ui-kpi.js +1 -1
  34. package/dist/components/vue-ui-label.js +1 -1
  35. package/dist/components/vue-ui-mini-loader.js +1 -1
  36. package/dist/components/vue-ui-molecule.js +1 -1
  37. package/dist/components/vue-ui-mood-radar.js +1 -1
  38. package/dist/components/vue-ui-nested-donuts.js +1 -1
  39. package/dist/components/vue-ui-onion.js +1 -1
  40. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  41. package/dist/components/vue-ui-quadrant.js +1 -1
  42. package/dist/components/vue-ui-quick-chart.js +1 -1
  43. package/dist/components/vue-ui-radar.js +1 -1
  44. package/dist/components/vue-ui-rating.js +1 -1
  45. package/dist/components/vue-ui-relation-circle.js +1 -1
  46. package/dist/components/vue-ui-ridgeline.js +1 -1
  47. package/dist/components/vue-ui-rings.js +1 -1
  48. package/dist/components/vue-ui-scatter.js +1 -1
  49. package/dist/components/vue-ui-skeleton.js +1 -1
  50. package/dist/components/vue-ui-smiley.js +1 -1
  51. package/dist/components/vue-ui-spark-trend.js +1 -1
  52. package/dist/components/vue-ui-sparkbar.js +1 -1
  53. package/dist/components/vue-ui-sparkgauge.js +1 -1
  54. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  55. package/dist/components/vue-ui-sparkline.js +1 -1
  56. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  57. package/dist/components/vue-ui-stackbar.js +1 -1
  58. package/dist/components/vue-ui-stackline.js +1 -1
  59. package/dist/components/vue-ui-strip-plot.js +1 -1
  60. package/dist/components/vue-ui-table-heatmap.js +1 -1
  61. package/dist/components/vue-ui-table-sparkline.js +1 -1
  62. package/dist/components/vue-ui-table.js +1 -1
  63. package/dist/components/vue-ui-thermometer.js +1 -1
  64. package/dist/components/vue-ui-timer.js +1 -1
  65. package/dist/components/vue-ui-tiremarks.js +1 -1
  66. package/dist/components/vue-ui-treemap.js +1 -1
  67. package/dist/components/vue-ui-vertical-bar.js +1 -1
  68. package/dist/components/vue-ui-waffle.js +1 -1
  69. package/dist/components/vue-ui-wheel.js +1 -1
  70. package/dist/components/vue-ui-word-cloud.js +1 -1
  71. package/dist/components/vue-ui-world.js +1 -1
  72. package/dist/components/vue-ui-xy-canvas.js +1 -1
  73. package/dist/components/vue-ui-xy.js +1 -1
  74. package/dist/package-BsppqqRX.js +1 -0
  75. package/dist/{render-common-DF3B4DW7.js → render-common-Bc3-uPjM.js} +1 -1
  76. package/dist/ssr/vue-ui-donut.js +1 -1
  77. package/dist/ssr/vue-ui-xy.js +1 -1
  78. package/dist/ssr.js +1 -1
  79. package/dist/style.css +1 -1
  80. package/dist/types/vue-data-ui.d.ts +19 -0
  81. package/dist/useConfig-CBXrYhMI.js +1 -0
  82. package/dist/{useObjectBindings-DlxSTJOa.js → useObjectBindings-DDUobNFp.js} +1 -1
  83. package/dist/utils.js +1 -1
  84. package/dist/vue-data-ui-CMig_4IZ.js +1 -0
  85. package/dist/vue-data-ui.js +1 -1
  86. package/dist/{vue-ui-3d-bar-DkehT0SI.js → vue-ui-3d-bar-BXDDF5Hq.js} +1 -1
  87. package/dist/{vue-ui-accordion-CnAwFOgA.js → vue-ui-accordion-CV2dxsXB.js} +1 -1
  88. package/dist/{vue-ui-age-pyramid-DXEyySR3.js → vue-ui-age-pyramid-BDoFrY4Y.js} +1 -1
  89. package/dist/{vue-ui-annotator-DqrdF7bH.js → vue-ui-annotator-DBItXQjx.js} +1 -1
  90. package/dist/{vue-ui-bullet-BNgmEm8g.js → vue-ui-bullet-iOGIwd8G.js} +1 -1
  91. package/dist/{vue-ui-bump-nFpAoRy7.js → vue-ui-bump-CYYE7AYx.js} +1 -1
  92. package/dist/{vue-ui-candlestick-DvBj3KWq.js → vue-ui-candlestick-fQbKxfp6.js} +1 -1
  93. package/dist/{vue-ui-carousel-table-ChEpsK7w.js → vue-ui-carousel-table-DUUhomv3.js} +1 -1
  94. package/dist/{vue-ui-chestnut-C-_fkI6E.js → vue-ui-chestnut-D7bO1IIi.js} +1 -1
  95. package/dist/{vue-ui-chord-WqXXM4Qs.js → vue-ui-chord-Cwg9Vjnn.js} +1 -1
  96. package/dist/{vue-ui-circle-pack-Bti7Wq1h.js → vue-ui-circle-pack-C18kRERE.js} +1 -1
  97. package/dist/{vue-ui-cursor-C_zzn7Ua.js → vue-ui-cursor-BxBeDqnb.js} +1 -1
  98. package/dist/{vue-ui-dag-BevQ37Gp.js → vue-ui-dag-BMBSp7ua.js} +1 -1
  99. package/dist/{vue-ui-dashboard-ruhBa6cl.js → vue-ui-dashboard-wDPL7yQw.js} +1 -1
  100. package/dist/{vue-ui-digits-B9ksORds.js → vue-ui-digits-CVpi-dBr.js} +1 -1
  101. package/dist/{vue-ui-donut-SbqIxWeM.js → vue-ui-donut-BJumteL7.js} +1 -1
  102. package/dist/{vue-ui-donut-DhrhMru7.js → vue-ui-donut-D5LOpVST.js} +1 -1
  103. package/dist/{vue-ui-donut-evolution-BkuALrYS.js → vue-ui-donut-evolution-DNY_zpSw.js} +1 -1
  104. package/dist/{vue-ui-dumbbell-SOI5CdGX.js → vue-ui-dumbbell-CT22NxlP.js} +1 -1
  105. package/dist/{vue-ui-flow-DqVrfXJo.js → vue-ui-flow-ihpQN8B4.js} +1 -1
  106. package/dist/{vue-ui-funnel-Byx_0z_B.js → vue-ui-funnel-CydmxKNq.js} +1 -1
  107. package/dist/{vue-ui-galaxy-BYbvOTrG.js → vue-ui-galaxy-CDdpiwLH.js} +1 -1
  108. package/dist/{vue-ui-gauge-3_cwmDni.js → vue-ui-gauge-Cu6cz42H.js} +1 -1
  109. package/dist/{vue-ui-geo-HaNxzfYO.js → vue-ui-geo-DAtuaLrb.js} +1 -1
  110. package/dist/{vue-ui-gizmo-C38WKy7L.js → vue-ui-gizmo-C-MEb9P1.js} +1 -1
  111. package/dist/{vue-ui-graph-Dp5FNReE.js → vue-ui-graph-CyySb2SE.js} +1 -1
  112. package/dist/{vue-ui-heatmap-DM0tteNh.js → vue-ui-heatmap-CcWLxTbW.js} +1 -1
  113. package/dist/{vue-ui-hill-Dr6Du4gm.js → vue-ui-hill-mvdRA1RD.js} +1 -1
  114. package/dist/{vue-ui-history-plot-C7iVkeuY.js → vue-ui-history-plot-AL9z3mC6.js} +1 -1
  115. package/dist/{vue-ui-horizontal-bar-BP2tt9hA.js → vue-ui-horizontal-bar-D2IV9phG.js} +1 -1
  116. package/dist/{vue-ui-kpi-8BL_aylw.js → vue-ui-kpi-ZCJekvYX.js} +1 -1
  117. package/dist/{vue-ui-label-D9tcQ8rR.js → vue-ui-label-CAMjkZc2.js} +1 -1
  118. package/dist/{vue-ui-mini-loader-D5-HI4Wi.js → vue-ui-mini-loader-B15gWQp1.js} +1 -1
  119. package/dist/{vue-ui-molecule-Bg1GqvBM.js → vue-ui-molecule-H88Xsomv.js} +1 -1
  120. package/dist/{vue-ui-mood-radar-DIiMInOP.js → vue-ui-mood-radar-De_2I7pq.js} +1 -1
  121. package/dist/{vue-ui-nested-donuts-BCyX7Z7n.js → vue-ui-nested-donuts-DGWgyIoR.js} +1 -1
  122. package/dist/{vue-ui-onion-EkxCuuTI.js → vue-ui-onion-QidVWMud.js} +1 -1
  123. package/dist/{vue-ui-parallel-coordinate-plot-CE80aawg.js → vue-ui-parallel-coordinate-plot-DFw19TpK.js} +1 -1
  124. package/dist/{vue-ui-quadrant-DJIuGrF9.js → vue-ui-quadrant-CeMOzfdY.js} +1 -1
  125. package/dist/{vue-ui-quick-chart-BBsBw9K3.js → vue-ui-quick-chart-Tyt1WdUW.js} +1 -1
  126. package/dist/{vue-ui-radar-BMYyMdOg.js → vue-ui-radar-C4U7ohC4.js} +1 -1
  127. package/dist/{vue-ui-rating--jhcSeor.js → vue-ui-rating-BbHvfFsG.js} +1 -1
  128. package/dist/{vue-ui-relation-circle-BLeJaQJH.js → vue-ui-relation-circle-zoBhpcTB.js} +1 -1
  129. package/dist/{vue-ui-ridgeline-w92zZqP2.js → vue-ui-ridgeline-C9ECt2cC.js} +1 -1
  130. package/dist/{vue-ui-rings-DUEitXix.js → vue-ui-rings-kYvvKGXk.js} +1 -1
  131. package/dist/{vue-ui-scatter-D1XzJLsA.js → vue-ui-scatter-Bs5NhtfK.js} +1 -1
  132. package/dist/{vue-ui-skeleton-Bpwe9ox7.js → vue-ui-skeleton-BSM40fOT.js} +1 -1
  133. package/dist/{vue-ui-smiley-AEw3JB0L.js → vue-ui-smiley-BvkpUjyE.js} +1 -1
  134. package/dist/{vue-ui-spark-trend-B3TKtyLN.js → vue-ui-spark-trend-DmJHx3aj.js} +1 -1
  135. package/dist/{vue-ui-sparkbar-CjLLQ0Ja.js → vue-ui-sparkbar-6wKyKgYy.js} +1 -1
  136. package/dist/{vue-ui-sparkgauge-9g7UUVWq.js → vue-ui-sparkgauge-BnZZ2zhe.js} +1 -1
  137. package/dist/{vue-ui-sparkhistogram-B_rUkfjQ.js → vue-ui-sparkhistogram-C9cyazhH.js} +1 -1
  138. package/dist/{vue-ui-sparkline-BJj8LCeA.js → vue-ui-sparkline-a1e4A-Gl.js} +1 -1
  139. package/dist/{vue-ui-sparkstackbar-B5rGYUUe.js → vue-ui-sparkstackbar-BTEpVODr.js} +1 -1
  140. package/dist/{vue-ui-stackbar-k0mVr3qM.js → vue-ui-stackbar-BplckX2c.js} +1 -1
  141. package/dist/vue-ui-stackline-1KSn7Lw-.js +17 -0
  142. package/dist/{vue-ui-strip-plot-bZisAUWl.js → vue-ui-strip-plot-ZCX50Scf.js} +1 -1
  143. package/dist/{vue-ui-table-YFjpQD5z.js → vue-ui-table-BRwwKG0f.js} +1 -1
  144. package/dist/{vue-ui-table-heatmap-Bl_rGqXv.js → vue-ui-table-heatmap-2csQOE2c.js} +1 -1
  145. package/dist/{vue-ui-table-sparkline-D-FHk6aF.js → vue-ui-table-sparkline-VLptltwn.js} +1 -1
  146. package/dist/{vue-ui-thermometer-1gRm4qfW.js → vue-ui-thermometer-DUocWNhm.js} +1 -1
  147. package/dist/{vue-ui-timer-Urv_5Bq7.js → vue-ui-timer-DfFRykEz.js} +2 -2
  148. package/dist/{vue-ui-tiremarks-CUCnVEGx.js → vue-ui-tiremarks-BBtWpWBE.js} +1 -1
  149. package/dist/{vue-ui-treemap-NgjoCq7g.js → vue-ui-treemap-Bz1FshtF.js} +1 -1
  150. package/dist/{vue-ui-waffle-Cy9bR4eg.js → vue-ui-waffle-C7SVznJl.js} +1 -1
  151. package/dist/{vue-ui-wheel-DdwADpJ9.js → vue-ui-wheel-BaZ08ojL.js} +1 -1
  152. package/dist/{vue-ui-word-cloud-I1lrCi6H.js → vue-ui-word-cloud-BOUVu-F2.js} +1 -1
  153. package/dist/{vue-ui-world-CFZoRY_U.js → vue-ui-world-E2JfHzRD.js} +1 -1
  154. package/dist/{vue-ui-xy-BjZ7rM8l.js → vue-ui-xy-CGuTzofF.js} +3 -3
  155. package/dist/{vue-ui-xy-BqivEt9H.js → vue-ui-xy-CmQ5D8Rm.js} +1 -1
  156. package/dist/{vue-ui-xy-canvas-DGniRsGt.js → vue-ui-xy-canvas-FULC8M7D.js} +1 -1
  157. package/dist/vue_ui_stackline-CBl7ydff.js +1 -0
  158. package/package.json +1 -1
  159. package/dist/package-GInOA5jS.js +0 -1
  160. package/dist/useConfig-9oDGTWWG.js +0 -1
  161. package/dist/vue-data-ui-Bx6exT7_.js +0 -1
  162. package/dist/vue-ui-stackline-D1sDzsaB.js +0 -17
  163. package/dist/vue_ui_stackline-B6ylXHBJ.js +0 -1
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as ee}from"./annotationSlots-OLiW25XN.js";import{n as te,t as ne}from"./tableIntegration-CNoJ1CIY.js";import{t as re}from"./chartImage-DPGnEuYM.js";import{$ as o,D as ie,Dt as ae,Ht as oe,J as se,Jt as ce,S as le,X as ue,Yt as de,at as fe,i as pe,in as me,nt as he,t as ge,w as _e,yt as ve}from"./lib-rPeBMZrn.js";import{t as ye}from"./labelUtils-CdtU-yB_.js";import{n as be,t as xe}from"./useHints-C-TwxM0Y.js";import{t as Se}from"./useConfig-9oDGTWWG.js";import{n as Ce}from"./resolveChartConfig-0IvbmIE_.js";import{t as we}from"./usePrinter-DVf3YcG5.js";import{t as Te}from"./useResponsive-CENUxfEL.js";import{t as Ee}from"./useChartExport-BZts4KFb.js";import{t as De}from"./useTransitions-ChGGrtrv.js";import{t as Oe}from"./useChartAccessibility-DOMuYJfm.js";import{t as ke}from"./Shape-CRe8woTu.js";import{n as Ae}from"./Title-BliHuXfT.js";import{t as je}from"./vue_ui_rings-C0puwNW1.js";import{t as Me}from"./Legend-W9YVYVX-.js";import{t as Ne}from"./BaseScanner-m6QR9rwD.js";import{t as Pe}from"./A11yDataTable-DWNlWXzs.js";import{t as Fe}from"./BaseLegendToggle-VzX69MCo.js";import{t as Ie}from"./DefGrad-DKMq1REY.js";import{t as Le}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as Re,Teleport as ze,computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as Be,createTextVNode as Ve,createVNode as f,defineAsyncComponent as p,guardReactiveProps as m,mergeProps as He,nextTick as Ue,normalizeClass as h,normalizeProps as g,normalizeStyle as We,onBeforeUnmount as Ge,onMounted as Ke,openBlock as _,ref as v,renderList as qe,renderSlot as y,resolveDynamicComponent as Je,shallowRef as Ye,toDisplayString as Xe,unref as b,useSlots as Ze,watch as x,withCtx as S,withModifiers as Qe}from"vue";var $e=/* @__PURE__ */ e({default:()=>xt}),et=[`id`],tt=[`id`],nt=[`id`],rt={style:{position:`relative`}},it=[`xmlns`,`viewBox`,`aria-describedby`],at=[`width`,`height`],ot={key:1},st=[`onAnimationend`],ct=[`stroke`,`cx`,`cy`,`r`,`fill`],lt=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],ut=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],dt=[`cx`,`cy`,`r`,`onMouseenter`,`onMouseleave`,`onClick`],ft=[`x`,`y`,`width`,`height`,`fill`,`rx`],pt=[`cx`,`cy`,`r`,`fill`,`stroke`],mt=[`text-anchor`,`font-size`,`fill`,`font-weight`,`transform`,`onMouseenter`,`onMouseleave`,`onClick`,`innerHTML`],ht={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},gt={key:5,class:`vue-data-ui-watermark`},_t=[`id`],vt=[`onClick`],yt={key:0},bt={key:1},xt=/*#__PURE__*/ Le({__name:`vue-ui-rings`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:Le,emit:$e}){let xt=p(()=>import(`./Tooltip-B432XpvC.js`)),St=p(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Ct=p(()=>import(`./vue-ui-accordion-CnAwFOgA.js`).then(e=>e.n)),wt=p(()=>import(`./DataTable-KeuZB1JM.js`)),Tt=p(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Et=p(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Dt=p(()=>import(`./PackageVersion-B9qiUJPH.js`).then(e=>e.t)),Ot=p(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_rings:kt}=Se(),At=Ze(),C=e;function jt(e){return Array.isArray(e)&&e.length>0&&Array.from(e,e=>e&&Object.keys(e).includes(`name`)&&Array.isArray(e.values)&&e.values.length>0).every(Boolean)}let Mt=s(()=>jt(C.dataset)),w=v(ue()),Nt=v(!1),Pt=v(``),T=v(null),Ft=v(0),E=v(null),It=v(null),Lt=v(null),Rt=v(null),zt=v(null),Bt=v(!1),Vt=v(!1),Ht=v(null),Ut=v(null),D=v(null),Wt=v({x:0,y:0}),Gt=v(`pointer`),Kt=v(!1),O=v(Qt());x(()=>C.config,()=>{O.value=Qt()},{deep:!0});let k=s(()=>!!C.config.loading||!Mt.value),A=s(()=>k.value?me({defaultConfig:O.value,userConfig:qt.value}):O.value),qt=s(()=>me({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:O.value.skeletonConfig??{}})),j=s(()=>A.value.userOptions),M=s(()=>A.value.style.chart.layout.rings),N=s(()=>A.value.style.chart.layout.labels),P=s(()=>A.value.style.chart.tooltip),F=s(()=>A.value.style.chart);be({config:()=>A.value,dataset:()=>C.dataset,component:`VueUiRings`,rules:[xe.singleSeries,xe.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:I}=De({config:()=>A.value.transitions,dataset:()=>C.dataset}),L=s(()=>A.value.userOptions.useCursorPointer),Jt=s(()=>k.value?jt(C.config.skeletonDataset)?C.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`}]:C.dataset),Yt=v(!A.value.userOptions.showOnChartHover),Xt=s(()=>A.value.userOptions.keepStateOnChartLeave);function Zt(e=!1){A.value.userOptions.showOnChartHover&&(Yt.value=e)}x(()=>A.value.userOptions.showOnChartHover,e=>{Yt.value=!e});let{svgRef:R}=Oe({config:F.value.title});function Qt(){return Ce(C.config,kt,je)}let $t=s(()=>{let{markers:e}=N.value.dataLabels,t=Pn.value/2,n=pn.value?e.position===`left`?t:-t:0,r=pn.value?U.value.width/2-t:0,i=e.position===`left`?r:-r;return{x:A.value.responsive?i:n/F.value.size*U.value.width,y:0/F.value.size*U.value.height}}),z=s(()=>({x:U.value.width/2+$t.value.x,y:U.value.height/2+$t.value.y})),en=Ye(null),tn=Ye(null),B=null,nn=!1,V=s(()=>O.value.debug);function rn(){!Array.isArray(C.dataset)||!C.dataset.length?fe({componentName:`VueUiRings`,type:`dataset`,debug:V.value}):Array.from(C.dataset).forEach((e,t)=>{ve({datasetObject:e??{},requiredAttributes:[`name`,`values`]}).forEach(e=>{fe({componentName:`VueUiRings`,type:`datasetSerieAttribute`,property:e,index:t,debug:V.value})}),V.value&&(Array.isArray(e?.values)?e.values.length||fe({componentName:`VueUiRings`,type:`dataset`,debug:!0}):e&&Object.keys(e).includes(`values`)&&console.warn(`VueUiRings: dataset[${t}].values must be an array.`))})}x([()=>C.dataset,V],rn,{immediate:!0,deep:!0});function an(){en.value?.disconnect(),en.value=null,B!==null&&cancelAnimationFrame(B),B=null,Bt.value=!1}function on(){if(an(),tn.value=null,!A.value.responsive||!E.value?.parentNode)return;let e=new ResizeObserver(t);function t(){nn||en.value!==e||(B!==null&&cancelAnimationFrame(B),Bt.value=!0,B=requestAnimationFrame(()=>{if(nn||en.value!==e)return;B=null;let{width:t,height:n}=Te({chart:E.value,title:F.value.title.text?It.value:null,legend:F.value.legend.show?Lt.value:null,source:Rt.value,noTitle:zt.value});tn.value={width:Math.max(.1,t),height:Math.max(.1,n-12)},Bt.value=!1}))}en.value=e;for(let t of[E.value.parentNode,It.value,Lt.value,Rt.value,zt.value])t&&e.observe(t);t()}x([()=>A.value.responsive,It,Lt,Rt,zt,()=>F.value.title.text,()=>F.value.legend.show,()=>F.value.legend.position],on,{flush:`post`}),Ke(()=>{Vt.value=!0,on()}),Ge(()=>{nn=!0,an()});let{isPrinting:sn,isImaging:cn,generatePdf:ln,generateImage:un}=we({elementId:`rings_${w.value}`,fileName:F.value.title.text||`vue-ui-rings`,options:A.value.userOptions.print}),dn=s(()=>A.value.userOptions.show&&!F.value.title.text),fn=s(()=>_e(A.value.customPalette)),H=v({showTable:O.value.table.show,showTooltip:O.value.style.chart.tooltip.show,showLabels:O.value.style.chart.layout.labels.dataLabels.show});x(()=>O.value.table.show,e=>{H.value.showTable=e}),x(()=>O.value.style.chart.tooltip.show,e=>{H.value.showTooltip=e}),x(()=>O.value.style.chart.layout.labels.dataLabels.show,e=>{H.value.showLabels=e});let pn=s(()=>k.value?N.value.dataLabels.show:H.value.showLabels),U=s(()=>tn.value??{height:F.value.size,width:F.value.size}),mn=s(()=>Math.min(U.value.height,U.value.width)),hn=$e,gn=v(/* @__PURE__ */ new Set);function _n(e){gn.value.add(e)}function vn(){G.value.forEach(e=>_n(e.uid))}let W=v([]);function yn(){k.value||(vn(),W.value.length?W.value=[]:jn.value.forEach(e=>{W.value.push(e.uid)}),bn())}function bn(){hn(`selectLegend`,q.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function xn(e){if(!k.value){if(vn(),W.value.includes(e))W.value=W.value.filter(t=>t!==e);else{if(W.value.length===G.value.length-1)return;W.value.push(e)}bn()}}function Sn(e){return G.value.length?G.value.find(t=>t.name===e)||(V.value&&console.warn(`VueUiRings - Series name not found "${e}"`),null):(V.value&&console.warn(`VueUiRings - There are no series to show.`),null)}function Cn(e){let t=Sn(e);t!==null&&W.value.includes(t.uid)&&xn(t.uid)}function wn(e){let t=Sn(e);t!==null&&(W.value.includes(t.uid)||xn(t.uid))}let Tn=/* @__PURE__ */ new Map,En=s(()=>{let e=/* @__PURE__ */ new Map,t=/* @__PURE__ */ new Set,n=Jt.value.map((n,r)=>{let i=e.get(n.name)??0;e.set(n.name,i+1);let a=JSON.stringify([k.value,n.name,i]);return t.add(a),Tn.has(a)||Tn.set(a,ue()),{name:n.name,color:n.color,absoluteValues:n.values,value:n.values.reduce((e,t)=>e+(Number.isFinite(t)?t:0),0),uid:Tn.get(a),absoluteIndex:r}});for(let e of Tn.keys())e.startsWith(`[${k.value},`)&&!t.has(e)&&Tn.delete(e);let r=n.reduce((e,t)=>e+t.value,0);return n.map(e=>({...e,proportion:Dn(e.value,r)}))});function Dn(e,t){let n=e/t;return Number.isFinite(n)?n:0}let G=s(()=>En.value.map((e,t)=>({...e,color:e.color||le(e.color)||fn.value[t]||oe[t%oe.length]}))),On=s(()=>G.value.filter(e=>!W.value.includes(e.uid))),kn=s(()=>On.value.reduce((e,t)=>Math.max(e,t.value),-1/0));function An(e){return Dn(e,kn.value)}let jn=s(()=>G.value.map((e,t)=>{let n=pe(N.value.dataLabels.formatter,e.value,o({p:N.value.dataLabels.prefix,v:e.value,s:N.value.dataLabels.suffix,r:F.value.legend.roundingValue}),{datapoint:e,index:t}),r=Number.isFinite(e.value/K.value)?o({v:e.value/K.value*100,s:`%`,r:F.value.legend.roundingPercentage}):`-`,i=Ln({showVal:F.value.legend.showValue,showPercentage:F.value.legend.showPercentage,val:n,percentage:W.value.includes(e.uid)?`-%`:r});return{...e,shape:`circle`,opacity:W.value.includes(e.uid)?.5:1,segregate:()=>xn(e.uid),isSegregated:W.value.includes(e.uid),display:`${e.name}${F.value.legend.showPercentage||F.value.legend.showValue?`: `:``}${i}`}}).toSorted((e,t)=>t.value-e.value)),Mn=s(()=>({cy:`rings-div-legend`,backgroundColor:F.value.legend.backgroundColor,color:F.value.legend.color,fontSize:F.value.legend.fontSize,paddingBottom:12,fontWeight:F.value.legend.bold?`bold`:``})),K=s(()=>On.value.reduce((e,t)=>e+t.value,0)),q=s(()=>On.value.map(e=>({...e,proportion:An(e.value),percentage:Dn(e.value,K.value)*100,strokeWidth:M.value.strokeWidth*An(e.value)})).toSorted((e,t)=>t.value-e.value));x(()=>En.value.map(e=>e.uid),e=>{k.value||(W.value=W.value.filter(t=>e.includes(t)))});function Nn(){return q.value.map(({name:e,color:t,value:n,absoluteValues:r,percentage:i})=>({name:e,color:t,value:n,absoluteValues:r,percentage:i}))}let Pn=s(()=>mn.value-M.value.strokeWidth*2);function Fn(e,t){k.value||A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:e,seriesIndex:t})}function J(){Un.value=null,T.value=null,Nt.value=!1,D.value=null,Gt.value=`pointer`,Y.value=null,Pt.value=``}function In(e,t){k.value||(J(),A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:e,seriesIndex:t}))}function Ln({val:e,percentage:t,showVal:n,showPercentage:r}){let i=N.value.dataLabels;return ye({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}function Rn(e){let t=N.value.dataLabels,n=pe(t.formatter,e.value,o({p:t.prefix,v:e.value,s:t.suffix,r:t.roundingValue})),r=o({v:e.percentage,s:`%`,r:t.roundingPercentage});return`${e.name}\n${Ln({val:n,percentage:r,showVal:t.showValue,showPercentage:t.showPercentage})}`}function zn(e){return Math.max(1e-4,Pn.value*e.proportion/2*.9)}let Bn=s(()=>z.value.y+(q.value.length?zn(q.value[0]):0));function Vn(e){return Bn.value-zn(e)}function Hn(e,t){let n=N.value.dataLabels.markers.position===`left`?-(Pn.value/2):Pn.value/2;return{x:z.value.x+n,y:Vn(e,t)-zn(e)}}let Y=v(null),Un=v(null);function Wn(e,t,n=`pointer`,r=!0){if(k.value||!e||(r&&A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:e,seriesIndex:t}),W.value.length===C.dataset.length))return;Y.value={datapoint:e,seriesIndex:t,series:q.value,config:A.value},Un.value=e.uid,T.value=t,D.value=t,Gt.value=n;let i=q.value[t],a=P.value.customFormat,ee=ae(a)?a(Y.value):null;if(typeof ee==`string`)Pt.value=ee;else{let n=``;n+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${P.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${i.name}</div>`,n+=`<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="${i.color}" />${At.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${w.value}_${e.absoluteIndex})" />`:``}</svg>`,n+=`<b>${Ln({showVal:P.value.showValue,showPercentage:P.value.showPercentage,val:`<span>${pe(N.value.dataLabels.formatter,i.value,o({p:N.value.dataLabels.prefix,v:i.value,s:N.value.dataLabels.suffix,r:P.value.roundingValue}),{datapoint:e,seriesIndex:t})}</span>`,percentage:o({v:i.percentage,s:`%`,r:P.value.roundingPercentage})})}</b></div>`,Pt.value=n}Nt.value=!0}let X=s(()=>({head:q.value.map(e=>({name:e.name,color:e.color})),body:q.value.map(e=>e.value)})),Z=s(()=>{let e=[`__SUM__`,o({p:N.value.dataLabels.prefix,v:K.value,s:N.value.dataLabels.suffix,r:A.value.table.td.roundingValue}),`100%`],t=X.value.head.map((e,t)=>[{color:e.color,name:e.name},o({p:N.value.dataLabels.prefix,v:X.value.body[t],s:N.value.dataLabels.suffix,r:A.value.table.td.roundingValue}),Number.isFinite(X.value.body[t]/K.value)?(X.value.body[t]/K.value*100).toFixed(A.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:A.value.table.th.backgroundColor,color:A.value.table.th.color,outline:A.value.table.th.outline},td:{backgroundColor:A.value.table.td.backgroundColor,color:A.value.table.td.color,outline:A.value.table.td.outline},breakpoint:A.value.table.responsiveBreakpoint},colNames:[A.value.table.columnNames.series,A.value.table.columnNames.value,A.value.table.columnNames.percentage]}});function Gn(e=null){Ue(()=>{let t=X.value.head.map((e,t)=>[[e.name],[X.value.body[t]],[Number.isFinite(X.value.body[t]/K.value)?X.value.body[t]/K.value*100:`-`]]),n=[[F.value.title.text],[F.value.title.subtitle.text],[[A.value.table.columnNames.series],[A.value.table.columnNames.value],[A.value.table.columnNames.percentage]]].concat(t),r=ie(n);e?e(r):he({csvContent:r,title:F.value.title.text||`vue-ui-rings`})})}let Q=v(!1);function Kn(e){Q.value=e,Ft.value+=1}function qn(){H.value.showTable=!H.value.showTable}function Jn(){H.value.showTooltip=!H.value.showTooltip}function Yn(){H.value.showLabels=!pn.value}let Xn=v(!1);function Zn(){Xn.value=!Xn.value}let Qn=re(E,()=>F.value.title.text),$n=s(()=>ne({config:A,style:F,mutableConfig:H,dialog:Ot,accordion:Ct,isFullscreen:Q,parent:E,maxWidth:800,isCursorPointer:L}));x([()=>H.value.showTable,Ht,()=>A.value.table.useDialog],([e])=>{Ht.value&&te(e,A,Ht)},{flush:`post`});function er(){H.value.showTable=!1,Ut.value&&Ut.value.setTableIconState(!1)}let tr=s(()=>jn.value.map(e=>({...e,name:e.display}))),nr=s(()=>F.value.backgroundColor),rr=s(()=>F.value.legend),ir=s(()=>F.value.title),{isCallbackImaging:ar,isCallbackSvg:or,generateSvg:sr,onGenerateImage:cr}=Ee({svg:R,title:ir,legend:rr,legendItems:tr,backgroundColor:nr,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:un});async function lr(){hn(`copyAlt`,{config:A.value,dataset:q.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:q.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ur(){J(),Kt.value=!0}function dr(){J(),Kt.value=!1}function fr(e){if(!R.value||Xn.value||k.value||document.activeElement!==R.value||!q.value.length||W.value.length===C.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){J();return}if(r){if(D.value===null)return;let e=q.value[D.value];if(!e)return;Fn(e,D.value);return}let a=D.value;a===null||a<0||a>=q.value.length?a=n?0:q.value.length-1:n?(a+=1,a>=q.value.length&&(a=0)):t&&(--a,a<0&&(a=q.value.length-1));let ee=q.value[a];ee&&(pr(a),Wn(ee,a,`keyboard`))}function pr(e){if(!Number.isFinite(e)||!R.value)return;let t=q.value[e];if(!t)return;let n=Hn(t,e),r=R.value.getBoundingClientRect();Wt.value={x:r.left+n.x/U.value.width*r.width,y:r.top+n.y/U.value.height*r.height}}x([q,U,z,P,()=>A.value],()=>{if(Un.value===null)return;let e=q.value.findIndex(e=>e.uid===Un.value);k.value||e<0?J():(Gt.value===`keyboard`&&pr(e),Wn(q.value[e],e,Gt.value,!1))},{flush:`post`});let mr=s(()=>q.value.map(Rn)),$=s(()=>q.value.map((e,t)=>({radius:zn(e),y:Vn(e,t),marker:Hn(e,t)}))),hr=s(()=>({headers:Z.value?.colNames??[],rows:Z.value?.a11yBody??[]}));return Le({getData:Nn,getImage:Qn,generatePdf:ln,generateCsv:Gn,generateImage:un,generateSvg:sr,hideSeries:wn,showSeries:Cn,toggleTable:qn,toggleTooltip:Jn,toggleAnnotator:Zn,toggleFullscreen:Kn,toggleLabels:Yn,copyAlt:lr}),(e,te)=>(_(),u(`div`,{ref_key:`ringsChart`,ref:E,class:h(`vue-data-ui-component vue-ui-rings ${Q.value?`vue-data-ui-wrapper-fullscreen`:``} ${A.value.useCssAnimation?``:`vue-ui-dna`}`),style:We(`font-family:${A.value.style.fontFamily};text-align:center;width:100%;background:${F.value.backgroundColor};${A.value.responsive?`height: 100%`:``}`),id:`rings_${w.value}`,onMouseleave:te[2]||=e=>{J(),Zt(!1)},onMouseenter:te[3]||=()=>Zt(!0)},[d(`div`,{id:`chart-instructions-${w.value}`,class:`sr-only`},[d(`p`,null,Xe(A.value.a11y.translations.keyboardNavigation),1)],8,tt),A.value.a11y.includeTable&&hr.value?.rows?.length?(_(),c(Pe,{key:0,uid:w.value,head:hr.value.headers,body:hr.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):l(``,!0),j.value.buttons.annotator?(_(),c(b(Tt),He({key:1},b(a)(j.value.annotator),{svgRef:b(R),backgroundColor:F.value.backgroundColor,color:F.value.color,active:Xn.value,isCursorPointer:L.value,palette:j.value.annotatorPalette,onClose:Zn}),Be({_:2},[qe(b(ee),t=>({name:t,fn:S(n=>[y(e.$slots,t,g(m(b(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):l(``,!0),dn.value?(_(),u(`div`,{key:2,ref_key:`noTitle`,ref:zt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):l(``,!0),F.value.title.text?(_(),u(`div`,{key:3,ref_key:`chartTitle`,ref:It,style:`width:100%;background:transparent`},[f(Ae,{config:{title:{cy:`rings-div-title`,...F.value.title},subtitle:{cy:`rings-div-subtitle`,...F.value.title.subtitle}}},null,8,[`config`])],512)):l(``,!0),d(`div`,{id:`legend-top-${w.value}`},null,8,nt),j.value.show&&Mt.value&&(Xt.value||Yt.value)?(_(),c(b(Et),He({ref_key:`userOptionsRef`,ref:Ut,key:`user_options_${Ft.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isPrinting:b(sn),isImaging:b(cn),uid:w.value,hasTooltip:j.value.buttons.tooltip&&P.value.show,isTooltip:H.value.showTooltip,isFullscreen:Q.value,chartElement:E.value},b(n)(j.value,`pdf csv img svg labels table fullscreen altCopy annotator`),{isAnnotation:Xn.value,tableDialog:A.value.table.useDialog,isCursorPointer:L.value,onToggleFullscreen:Kn,onGeneratePdf:b(ln),onGenerateCsv:Gn,onGenerateImage:b(cr),onGenerateSvg:b(sr),onToggleTable:qn,onToggleTooltip:Jn,onToggleAnnotator:Zn,onToggleLabels:Yn,onCopyAlt:lr,style:{visibility:Xt.value?Yt.value?`visible`:`hidden`:`visible`}}),Be({_:2},[qe(b(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[y(e.$slots,t,g(m(b(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isTooltip`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):l(``,!0),d(`div`,rt,[(_(),u(`svg`,{ref_key:`svgRef`,ref:R,xmlns:b(ge),class:h({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value,resizing:Bt.value||k.value,"vue-data-ui-no-transition":!b(I)}),viewBox:`0 0 ${U.value.width<=0?10:U.value.width} ${U.value.height<=0?10:U.value.height}`,style:We(`max-width:100%;overflow:hidden;background:transparent;color:${F.value.color}`),"aria-describedby":`chart-instructions-${w.value}`,tabindex:`0`,onFocus:ur,onBlur:dr,onKeydown:fr},[f(b(Dt)),y(e.$slots,`svg-underlayer`,{svg:{...U.value,isPrintingImg:b(sn)||b(cn)||b(ar),isPrintingSvg:b(or)}},void 0,!0),e.$slots[`chart-background`]?(_(),u(`foreignObject`,{key:0,x:0,y:0,width:U.value.width<=0?10:U.value.width,height:U.value.height<=0?10:U.value.height,style:{pointerEvents:`none`}},[y(e.$slots,`chart-background`,{},void 0,!0)],8,at)):l(``,!0),d(`defs`,null,[(_(!0),u(Re,null,qe(q.value,(e,t)=>(_(),c(Ie,{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(ce)(b(de)(e.color,.05),100-M.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),e.$slots.pattern?(_(),u(`g`,ot,[(_(!0),u(Re,null,qe(G.value,t=>(_(),u(`defs`,null,[y(e.$slots,`pattern`,He({ref_for:!0},{seriesIndex:t.absoluteIndex,patternId:`pattern_${w.value}_${t.absoluteIndex}`}),void 0,!0)]))),256))])):l(``,!0),(_(!0),u(Re,null,qe(q.value,(t,n)=>(_(),u(`g`,{key:`r_${t.uid}`,onAnimationend:Qe(e=>_n(t.uid),[`self`]),class:h({"vue-rings-item-onload":A.value.useCssAnimation&&A.value.transitions.enable&&!k.value&&!gn.value.has(t.uid)}),style:We({transformOrigin:`${z.value.x}px ${Bn.value}px`,animationDelay:`${(q.value.length-1-n)*100}ms`})},[d(`circle`,{class:h({"vue-data-ui-transition":b(I),"vue-ui-rings-opacity":A.value.useBlurOnHover&&T.value!==null&&T.value!==n}),stroke:M.value.stroke,cx:z.value.x,cy:$.value[n].y,r:$.value[n].radius,fill:M.value.gradient.underlayerColor},null,10,ct),d(`circle`,{class:h({"vue-data-ui-transition":b(I),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":A.value.useBlurOnHover&&T.value!==null&&T.value!==n}),stroke:M.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:z.value.x,cy:$.value[n].y,r:$.value[n].radius,fill:M.value.gradient.show?`url(#gradient_${w.value}_${n})`:t.color},null,10,lt),e.$slots.pattern?(_(),u(`circle`,{key:0,class:h({"vue-data-ui-transition":b(I),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":A.value.useBlurOnHover&&T.value!==null&&T.value!==n}),stroke:M.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:z.value.x,cy:$.value[n].y,r:$.value[n].radius,fill:`url(#pattern_${w.value}_${t.absoluteIndex})`},null,10,ut)):l(``,!0),d(`circle`,{stroke:`none`,cx:z.value.x,cy:$.value[n].y,r:$.value[n].radius,fill:`transparent`,onMouseenter:e=>Wn(t,n,`pointer`),onMouseleave:e=>In(t,n),onClick:e=>Fn(t,n)},null,40,dt),pn.value?(_(),u(Re,{key:1},[d(`rect`,{x:N.value.dataLabels.markers.position===`left`?$.value[n].marker.x:z.value.x,y:$.value[n].marker.y-N.value.dataLabels.markers.strokeWidth/2,width:Math.abs(z.value.x-$.value[n].marker.x),height:N.value.dataLabels.markers.strokeWidth,fill:N.value.dataLabels.markers.stroke,rx:N.value.dataLabels.markers.strokeWidth,class:h({"vue-data-ui-transition":b(I),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":A.value.useBlurOnHover&&T.value!==null&&T.value!==n})},null,10,ft),d(`circle`,{cx:$.value[n].marker.x,cy:$.value[n].marker.y,r:N.value.dataLabels.markers.radius,fill:t.color,stroke:F.value.backgroundColor,class:h({"vue-data-ui-transition":b(I),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":A.value.useBlurOnHover&&T.value!==null&&T.value!==n})},null,10,pt),d(`text`,{"text-anchor":N.value.dataLabels.markers.position===`left`?`end`:`start`,"font-size":N.value.dataLabels.fontSize,fill:N.value.dataLabels.color,"font-weight":N.value.dataLabels.bold?`bold`:`normal`,class:h({"vue-data-ui-transition":b(I),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":A.value.useBlurOnHover&&T.value!==null&&T.value!==n}),transform:`translate(${$.value[n].marker.x+(N.value.dataLabels.markers.position===`left`?-N.value.dataLabels.offsetX-14:N.value.dataLabels.offsetX)+6}, ${$.value[n].marker.y+N.value.dataLabels.fontSize/3})`,onMouseenter:e=>Wn(t,n,`pointer`),onMouseleave:e=>In(t,n),onClick:e=>Fn(t,n),innerHTML:b(se)({content:mr.value[n],fontSize:N.value.dataLabels.fontSize,fill:N.value.dataLabels.color,x:0,y:0,translateY:!0})},null,42,mt)],64)):l(``,!0)],46,st))),128)),y(e.$slots,`svg`,{svg:{...U.value,isPrintingImg:b(sn)||b(cn)||b(ar),isPrintingSvg:b(or)}},void 0,!0)],46,it)),e.$slots.hint?(_(),u(`div`,ht,[y(e.$slots,`hint`,g(m({hint:A.value.a11y.translations.keyboardNavigation,isVisible:Kt.value})),void 0,!0)])):l(``,!0)]),e.$slots.watermark?(_(),u(`div`,gt,[y(e.$slots,`watermark`,g(m({isPrinting:b(sn)||b(cn)||b(ar)||b(or)})),void 0,!0)])):l(``,!0),d(`div`,{id:`legend-bottom-${w.value}`},null,8,_t),Vt.value&&(F.value.legend.show||e.$slots.legend)?(_(),c(ze,{key:6,to:F.value.legend.position===`top`?`#legend-top-${w.value}`:`#legend-bottom-${w.value}`},[d(`div`,{ref_key:`chartLegend`,ref:Lt},[y(e.$slots,`legend`,{legend:jn.value},()=>[F.value.legend.show?(_(),c(Me,{key:0,legendSet:jn.value,config:Mn.value,isCursorPointer:L.value,onClickMarker:te[0]||=({legend:e})=>xn(e.uid)},Be({item:S(({legend:e,index:t})=>[k.value?l(``,!0):(_(),u(`div`,{key:0,onClick:t=>xn(e.uid),style:We(`opacity:${W.value.includes(e.uid)?.5:1}`)},Xe(e.display),13,vt))]),legendToggle:S(()=>[jn.value.length>2&&F.value.legend.selectAllToggle.show&&!k.value?(_(),c(Fe,{key:0,backgroundColor:F.value.legend.selectAllToggle.backgroundColor,color:F.value.legend.selectAllToggle.color,fontSize:F.value.legend.fontSize,checked:W.value.length>0,isCursorPointer:L.value,onToggle:yn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):l(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:S(({legend:e,index:t})=>[f(ke,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${w.value}_${e.absoluteIndex})`},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:Rt,dir:`auto`},[y(e.$slots,`source`,{},void 0,!0)],512)):l(``,!0),f(b(xt),{teleportTo:P.value.teleportTo,show:H.value.showTooltip&&Nt.value&&W.value.length<C.dataset.length,backgroundColor:P.value.backgroundColor,color:P.value.color,borderRadius:P.value.borderRadius,borderColor:P.value.borderColor,borderWidth:P.value.borderWidth,fontSize:P.value.fontSize,backgroundOpacity:P.value.backgroundOpacity,position:P.value.position,offsetX:P.value.offsetX,offsetY:P.value.offsetY,parent:E.value,content:Pt.value,isFullscreen:Q.value,isCustom:P.value.customFormat&&typeof P.value.customFormat==`function`,smooth:P.value.smooth,backdropFilter:P.value.backdropFilter,smoothForce:P.value.smoothForce,smoothSnapThreshold:P.value.smoothSnapThreshold,isA11yMode:Gt.value===`keyboard`,a11yPosition:Wt.value},{"tooltip-before":S(()=>[y(e.$slots,`tooltip-before`,g(m({...Y.value})),void 0,!0)]),tooltip:S(()=>[y(e.$slots,`tooltip`,g(m({...Y.value})),void 0,!0)]),"tooltip-after":S(()=>[y(e.$slots,`tooltip-after`,g(m({...Y.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`]),!k.value&&Mt.value&&j.value.buttons.table?(_(),c(Je($n.value.component),He({key:8},$n.value.props,{ref_key:`tableUnit`,ref:Ht,onClose:er}),Be({content:S(()=>[f(b(wt),{colNames:Z.value.colNames,head:Z.value.head,body:Z.value.body,config:Z.value.config,title:A.value.table.useDialog?``:$n.value.title,withCloseButton:!A.value.table.useDialog,isCursorPointer:L.value,onClose:er},{th:S(({th:e})=>[e===`__SUM__`?(_(),u(`div`,yt,[f(b(St),{name:`sigma`,stroke:Z.value.config.th.color,size:16},null,8,[`stroke`])])):(_(),u(`div`,bt,Xe(e),1))]),td:S(({td:e})=>[Ve(Xe(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`])]),_:2},[A.value.table.useDialog?{name:`title`,fn:S(()=>[Ve(Xe($n.value.title),1)]),key:`0`}:void 0,A.value.table.useDialog?{name:`actions`,fn:S(()=>[d(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:te[1]||=e=>Gn(j.value.callbacks.csv),style:We({cursor:L.value?`pointer`:`default`})},[f(b(St),{name:`fileCsv`,stroke:$n.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):l(``,!0),y(e.$slots,`skeleton`,{},()=>[k.value?(_(),c(Ne,{key:0})):l(``,!0)],!0)],46,et))}},[[`__scopeId`,`data-v-5087967c`]]);export{$e as n,xt as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as ee}from"./annotationSlots-OLiW25XN.js";import{n as te,t as ne}from"./tableIntegration-CNoJ1CIY.js";import{t as re}from"./chartImage-DPGnEuYM.js";import{$ as o,D as ie,Dt as ae,Ht as oe,J as se,Jt as ce,S as le,X as ue,Yt as de,at as fe,i as pe,in as me,nt as he,t as ge,w as _e,yt as ve}from"./lib-rPeBMZrn.js";import{t as ye}from"./labelUtils-CdtU-yB_.js";import{n as be,t as xe}from"./useHints-C-TwxM0Y.js";import{t as Se}from"./useConfig-CBXrYhMI.js";import{n as Ce}from"./resolveChartConfig-0IvbmIE_.js";import{t as we}from"./usePrinter-DVf3YcG5.js";import{t as Te}from"./useResponsive-CENUxfEL.js";import{t as Ee}from"./useChartExport-BZts4KFb.js";import{t as De}from"./useTransitions-ChGGrtrv.js";import{t as Oe}from"./useChartAccessibility-DOMuYJfm.js";import{t as ke}from"./Shape-CRe8woTu.js";import{n as Ae}from"./Title-BliHuXfT.js";import{t as je}from"./vue_ui_rings-C0puwNW1.js";import{t as Me}from"./Legend-W9YVYVX-.js";import{t as Ne}from"./BaseScanner-m6QR9rwD.js";import{t as Pe}from"./A11yDataTable-DWNlWXzs.js";import{t as Fe}from"./BaseLegendToggle-VzX69MCo.js";import{t as Ie}from"./DefGrad-DKMq1REY.js";import{t as Le}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as Re,Teleport as ze,computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as Be,createTextVNode as Ve,createVNode as f,defineAsyncComponent as p,guardReactiveProps as m,mergeProps as He,nextTick as Ue,normalizeClass as h,normalizeProps as g,normalizeStyle as We,onBeforeUnmount as Ge,onMounted as Ke,openBlock as _,ref as v,renderList as qe,renderSlot as y,resolveDynamicComponent as Je,shallowRef as Ye,toDisplayString as Xe,unref as b,useSlots as Ze,watch as x,withCtx as S,withModifiers as Qe}from"vue";var $e=/* @__PURE__ */ e({default:()=>xt}),et=[`id`],tt=[`id`],nt=[`id`],rt={style:{position:`relative`}},it=[`xmlns`,`viewBox`,`aria-describedby`],at=[`width`,`height`],ot={key:1},st=[`onAnimationend`],ct=[`stroke`,`cx`,`cy`,`r`,`fill`],lt=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],ut=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],dt=[`cx`,`cy`,`r`,`onMouseenter`,`onMouseleave`,`onClick`],ft=[`x`,`y`,`width`,`height`,`fill`,`rx`],pt=[`cx`,`cy`,`r`,`fill`,`stroke`],mt=[`text-anchor`,`font-size`,`fill`,`font-weight`,`transform`,`onMouseenter`,`onMouseleave`,`onClick`,`innerHTML`],ht={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},gt={key:5,class:`vue-data-ui-watermark`},_t=[`id`],vt=[`onClick`],yt={key:0},bt={key:1},xt=/*#__PURE__*/ Le({__name:`vue-ui-rings`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:Le,emit:$e}){let xt=p(()=>import(`./Tooltip-B432XpvC.js`)),St=p(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Ct=p(()=>import(`./vue-ui-accordion-CV2dxsXB.js`).then(e=>e.n)),wt=p(()=>import(`./DataTable-KeuZB1JM.js`)),Tt=p(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Et=p(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Dt=p(()=>import(`./PackageVersion-BbZ3wNGs.js`).then(e=>e.t)),Ot=p(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_rings:kt}=Se(),At=Ze(),C=e;function jt(e){return Array.isArray(e)&&e.length>0&&Array.from(e,e=>e&&Object.keys(e).includes(`name`)&&Array.isArray(e.values)&&e.values.length>0).every(Boolean)}let Mt=s(()=>jt(C.dataset)),w=v(ue()),Nt=v(!1),Pt=v(``),T=v(null),Ft=v(0),E=v(null),It=v(null),Lt=v(null),Rt=v(null),zt=v(null),Bt=v(!1),Vt=v(!1),Ht=v(null),Ut=v(null),D=v(null),Wt=v({x:0,y:0}),Gt=v(`pointer`),Kt=v(!1),O=v(Qt());x(()=>C.config,()=>{O.value=Qt()},{deep:!0});let k=s(()=>!!C.config.loading||!Mt.value),A=s(()=>k.value?me({defaultConfig:O.value,userConfig:qt.value}):O.value),qt=s(()=>me({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:O.value.skeletonConfig??{}})),j=s(()=>A.value.userOptions),M=s(()=>A.value.style.chart.layout.rings),N=s(()=>A.value.style.chart.layout.labels),P=s(()=>A.value.style.chart.tooltip),F=s(()=>A.value.style.chart);be({config:()=>A.value,dataset:()=>C.dataset,component:`VueUiRings`,rules:[xe.singleSeries,xe.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:I}=De({config:()=>A.value.transitions,dataset:()=>C.dataset}),L=s(()=>A.value.userOptions.useCursorPointer),Jt=s(()=>k.value?jt(C.config.skeletonDataset)?C.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`}]:C.dataset),Yt=v(!A.value.userOptions.showOnChartHover),Xt=s(()=>A.value.userOptions.keepStateOnChartLeave);function Zt(e=!1){A.value.userOptions.showOnChartHover&&(Yt.value=e)}x(()=>A.value.userOptions.showOnChartHover,e=>{Yt.value=!e});let{svgRef:R}=Oe({config:F.value.title});function Qt(){return Ce(C.config,kt,je)}let $t=s(()=>{let{markers:e}=N.value.dataLabels,t=Pn.value/2,n=pn.value?e.position===`left`?t:-t:0,r=pn.value?U.value.width/2-t:0,i=e.position===`left`?r:-r;return{x:A.value.responsive?i:n/F.value.size*U.value.width,y:0/F.value.size*U.value.height}}),z=s(()=>({x:U.value.width/2+$t.value.x,y:U.value.height/2+$t.value.y})),en=Ye(null),tn=Ye(null),B=null,nn=!1,V=s(()=>O.value.debug);function rn(){!Array.isArray(C.dataset)||!C.dataset.length?fe({componentName:`VueUiRings`,type:`dataset`,debug:V.value}):Array.from(C.dataset).forEach((e,t)=>{ve({datasetObject:e??{},requiredAttributes:[`name`,`values`]}).forEach(e=>{fe({componentName:`VueUiRings`,type:`datasetSerieAttribute`,property:e,index:t,debug:V.value})}),V.value&&(Array.isArray(e?.values)?e.values.length||fe({componentName:`VueUiRings`,type:`dataset`,debug:!0}):e&&Object.keys(e).includes(`values`)&&console.warn(`VueUiRings: dataset[${t}].values must be an array.`))})}x([()=>C.dataset,V],rn,{immediate:!0,deep:!0});function an(){en.value?.disconnect(),en.value=null,B!==null&&cancelAnimationFrame(B),B=null,Bt.value=!1}function on(){if(an(),tn.value=null,!A.value.responsive||!E.value?.parentNode)return;let e=new ResizeObserver(t);function t(){nn||en.value!==e||(B!==null&&cancelAnimationFrame(B),Bt.value=!0,B=requestAnimationFrame(()=>{if(nn||en.value!==e)return;B=null;let{width:t,height:n}=Te({chart:E.value,title:F.value.title.text?It.value:null,legend:F.value.legend.show?Lt.value:null,source:Rt.value,noTitle:zt.value});tn.value={width:Math.max(.1,t),height:Math.max(.1,n-12)},Bt.value=!1}))}en.value=e;for(let t of[E.value.parentNode,It.value,Lt.value,Rt.value,zt.value])t&&e.observe(t);t()}x([()=>A.value.responsive,It,Lt,Rt,zt,()=>F.value.title.text,()=>F.value.legend.show,()=>F.value.legend.position],on,{flush:`post`}),Ke(()=>{Vt.value=!0,on()}),Ge(()=>{nn=!0,an()});let{isPrinting:sn,isImaging:cn,generatePdf:ln,generateImage:un}=we({elementId:`rings_${w.value}`,fileName:F.value.title.text||`vue-ui-rings`,options:A.value.userOptions.print}),dn=s(()=>A.value.userOptions.show&&!F.value.title.text),fn=s(()=>_e(A.value.customPalette)),H=v({showTable:O.value.table.show,showTooltip:O.value.style.chart.tooltip.show,showLabels:O.value.style.chart.layout.labels.dataLabels.show});x(()=>O.value.table.show,e=>{H.value.showTable=e}),x(()=>O.value.style.chart.tooltip.show,e=>{H.value.showTooltip=e}),x(()=>O.value.style.chart.layout.labels.dataLabels.show,e=>{H.value.showLabels=e});let pn=s(()=>k.value?N.value.dataLabels.show:H.value.showLabels),U=s(()=>tn.value??{height:F.value.size,width:F.value.size}),mn=s(()=>Math.min(U.value.height,U.value.width)),hn=$e,gn=v(/* @__PURE__ */ new Set);function _n(e){gn.value.add(e)}function vn(){G.value.forEach(e=>_n(e.uid))}let W=v([]);function yn(){k.value||(vn(),W.value.length?W.value=[]:jn.value.forEach(e=>{W.value.push(e.uid)}),bn())}function bn(){hn(`selectLegend`,q.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function xn(e){if(!k.value){if(vn(),W.value.includes(e))W.value=W.value.filter(t=>t!==e);else{if(W.value.length===G.value.length-1)return;W.value.push(e)}bn()}}function Sn(e){return G.value.length?G.value.find(t=>t.name===e)||(V.value&&console.warn(`VueUiRings - Series name not found "${e}"`),null):(V.value&&console.warn(`VueUiRings - There are no series to show.`),null)}function Cn(e){let t=Sn(e);t!==null&&W.value.includes(t.uid)&&xn(t.uid)}function wn(e){let t=Sn(e);t!==null&&(W.value.includes(t.uid)||xn(t.uid))}let Tn=/* @__PURE__ */ new Map,En=s(()=>{let e=/* @__PURE__ */ new Map,t=/* @__PURE__ */ new Set,n=Jt.value.map((n,r)=>{let i=e.get(n.name)??0;e.set(n.name,i+1);let a=JSON.stringify([k.value,n.name,i]);return t.add(a),Tn.has(a)||Tn.set(a,ue()),{name:n.name,color:n.color,absoluteValues:n.values,value:n.values.reduce((e,t)=>e+(Number.isFinite(t)?t:0),0),uid:Tn.get(a),absoluteIndex:r}});for(let e of Tn.keys())e.startsWith(`[${k.value},`)&&!t.has(e)&&Tn.delete(e);let r=n.reduce((e,t)=>e+t.value,0);return n.map(e=>({...e,proportion:Dn(e.value,r)}))});function Dn(e,t){let n=e/t;return Number.isFinite(n)?n:0}let G=s(()=>En.value.map((e,t)=>({...e,color:e.color||le(e.color)||fn.value[t]||oe[t%oe.length]}))),On=s(()=>G.value.filter(e=>!W.value.includes(e.uid))),kn=s(()=>On.value.reduce((e,t)=>Math.max(e,t.value),-1/0));function An(e){return Dn(e,kn.value)}let jn=s(()=>G.value.map((e,t)=>{let n=pe(N.value.dataLabels.formatter,e.value,o({p:N.value.dataLabels.prefix,v:e.value,s:N.value.dataLabels.suffix,r:F.value.legend.roundingValue}),{datapoint:e,index:t}),r=Number.isFinite(e.value/K.value)?o({v:e.value/K.value*100,s:`%`,r:F.value.legend.roundingPercentage}):`-`,i=Ln({showVal:F.value.legend.showValue,showPercentage:F.value.legend.showPercentage,val:n,percentage:W.value.includes(e.uid)?`-%`:r});return{...e,shape:`circle`,opacity:W.value.includes(e.uid)?.5:1,segregate:()=>xn(e.uid),isSegregated:W.value.includes(e.uid),display:`${e.name}${F.value.legend.showPercentage||F.value.legend.showValue?`: `:``}${i}`}}).toSorted((e,t)=>t.value-e.value)),Mn=s(()=>({cy:`rings-div-legend`,backgroundColor:F.value.legend.backgroundColor,color:F.value.legend.color,fontSize:F.value.legend.fontSize,paddingBottom:12,fontWeight:F.value.legend.bold?`bold`:``})),K=s(()=>On.value.reduce((e,t)=>e+t.value,0)),q=s(()=>On.value.map(e=>({...e,proportion:An(e.value),percentage:Dn(e.value,K.value)*100,strokeWidth:M.value.strokeWidth*An(e.value)})).toSorted((e,t)=>t.value-e.value));x(()=>En.value.map(e=>e.uid),e=>{k.value||(W.value=W.value.filter(t=>e.includes(t)))});function Nn(){return q.value.map(({name:e,color:t,value:n,absoluteValues:r,percentage:i})=>({name:e,color:t,value:n,absoluteValues:r,percentage:i}))}let Pn=s(()=>mn.value-M.value.strokeWidth*2);function Fn(e,t){k.value||A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:e,seriesIndex:t})}function J(){Un.value=null,T.value=null,Nt.value=!1,D.value=null,Gt.value=`pointer`,Y.value=null,Pt.value=``}function In(e,t){k.value||(J(),A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:e,seriesIndex:t}))}function Ln({val:e,percentage:t,showVal:n,showPercentage:r}){let i=N.value.dataLabels;return ye({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}function Rn(e){let t=N.value.dataLabels,n=pe(t.formatter,e.value,o({p:t.prefix,v:e.value,s:t.suffix,r:t.roundingValue})),r=o({v:e.percentage,s:`%`,r:t.roundingPercentage});return`${e.name}\n${Ln({val:n,percentage:r,showVal:t.showValue,showPercentage:t.showPercentage})}`}function zn(e){return Math.max(1e-4,Pn.value*e.proportion/2*.9)}let Bn=s(()=>z.value.y+(q.value.length?zn(q.value[0]):0));function Vn(e){return Bn.value-zn(e)}function Hn(e,t){let n=N.value.dataLabels.markers.position===`left`?-(Pn.value/2):Pn.value/2;return{x:z.value.x+n,y:Vn(e,t)-zn(e)}}let Y=v(null),Un=v(null);function Wn(e,t,n=`pointer`,r=!0){if(k.value||!e||(r&&A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:e,seriesIndex:t}),W.value.length===C.dataset.length))return;Y.value={datapoint:e,seriesIndex:t,series:q.value,config:A.value},Un.value=e.uid,T.value=t,D.value=t,Gt.value=n;let i=q.value[t],a=P.value.customFormat,ee=ae(a)?a(Y.value):null;if(typeof ee==`string`)Pt.value=ee;else{let n=``;n+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${P.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${i.name}</div>`,n+=`<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="${i.color}" />${At.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${w.value}_${e.absoluteIndex})" />`:``}</svg>`,n+=`<b>${Ln({showVal:P.value.showValue,showPercentage:P.value.showPercentage,val:`<span>${pe(N.value.dataLabels.formatter,i.value,o({p:N.value.dataLabels.prefix,v:i.value,s:N.value.dataLabels.suffix,r:P.value.roundingValue}),{datapoint:e,seriesIndex:t})}</span>`,percentage:o({v:i.percentage,s:`%`,r:P.value.roundingPercentage})})}</b></div>`,Pt.value=n}Nt.value=!0}let X=s(()=>({head:q.value.map(e=>({name:e.name,color:e.color})),body:q.value.map(e=>e.value)})),Z=s(()=>{let e=[`__SUM__`,o({p:N.value.dataLabels.prefix,v:K.value,s:N.value.dataLabels.suffix,r:A.value.table.td.roundingValue}),`100%`],t=X.value.head.map((e,t)=>[{color:e.color,name:e.name},o({p:N.value.dataLabels.prefix,v:X.value.body[t],s:N.value.dataLabels.suffix,r:A.value.table.td.roundingValue}),Number.isFinite(X.value.body[t]/K.value)?(X.value.body[t]/K.value*100).toFixed(A.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:A.value.table.th.backgroundColor,color:A.value.table.th.color,outline:A.value.table.th.outline},td:{backgroundColor:A.value.table.td.backgroundColor,color:A.value.table.td.color,outline:A.value.table.td.outline},breakpoint:A.value.table.responsiveBreakpoint},colNames:[A.value.table.columnNames.series,A.value.table.columnNames.value,A.value.table.columnNames.percentage]}});function Gn(e=null){Ue(()=>{let t=X.value.head.map((e,t)=>[[e.name],[X.value.body[t]],[Number.isFinite(X.value.body[t]/K.value)?X.value.body[t]/K.value*100:`-`]]),n=[[F.value.title.text],[F.value.title.subtitle.text],[[A.value.table.columnNames.series],[A.value.table.columnNames.value],[A.value.table.columnNames.percentage]]].concat(t),r=ie(n);e?e(r):he({csvContent:r,title:F.value.title.text||`vue-ui-rings`})})}let Q=v(!1);function Kn(e){Q.value=e,Ft.value+=1}function qn(){H.value.showTable=!H.value.showTable}function Jn(){H.value.showTooltip=!H.value.showTooltip}function Yn(){H.value.showLabels=!pn.value}let Xn=v(!1);function Zn(){Xn.value=!Xn.value}let Qn=re(E,()=>F.value.title.text),$n=s(()=>ne({config:A,style:F,mutableConfig:H,dialog:Ot,accordion:Ct,isFullscreen:Q,parent:E,maxWidth:800,isCursorPointer:L}));x([()=>H.value.showTable,Ht,()=>A.value.table.useDialog],([e])=>{Ht.value&&te(e,A,Ht)},{flush:`post`});function er(){H.value.showTable=!1,Ut.value&&Ut.value.setTableIconState(!1)}let tr=s(()=>jn.value.map(e=>({...e,name:e.display}))),nr=s(()=>F.value.backgroundColor),rr=s(()=>F.value.legend),ir=s(()=>F.value.title),{isCallbackImaging:ar,isCallbackSvg:or,generateSvg:sr,onGenerateImage:cr}=Ee({svg:R,title:ir,legend:rr,legendItems:tr,backgroundColor:nr,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:un});async function lr(){hn(`copyAlt`,{config:A.value,dataset:q.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:q.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ur(){J(),Kt.value=!0}function dr(){J(),Kt.value=!1}function fr(e){if(!R.value||Xn.value||k.value||document.activeElement!==R.value||!q.value.length||W.value.length===C.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){J();return}if(r){if(D.value===null)return;let e=q.value[D.value];if(!e)return;Fn(e,D.value);return}let a=D.value;a===null||a<0||a>=q.value.length?a=n?0:q.value.length-1:n?(a+=1,a>=q.value.length&&(a=0)):t&&(--a,a<0&&(a=q.value.length-1));let ee=q.value[a];ee&&(pr(a),Wn(ee,a,`keyboard`))}function pr(e){if(!Number.isFinite(e)||!R.value)return;let t=q.value[e];if(!t)return;let n=Hn(t,e),r=R.value.getBoundingClientRect();Wt.value={x:r.left+n.x/U.value.width*r.width,y:r.top+n.y/U.value.height*r.height}}x([q,U,z,P,()=>A.value],()=>{if(Un.value===null)return;let e=q.value.findIndex(e=>e.uid===Un.value);k.value||e<0?J():(Gt.value===`keyboard`&&pr(e),Wn(q.value[e],e,Gt.value,!1))},{flush:`post`});let mr=s(()=>q.value.map(Rn)),$=s(()=>q.value.map((e,t)=>({radius:zn(e),y:Vn(e,t),marker:Hn(e,t)}))),hr=s(()=>({headers:Z.value?.colNames??[],rows:Z.value?.a11yBody??[]}));return Le({getData:Nn,getImage:Qn,generatePdf:ln,generateCsv:Gn,generateImage:un,generateSvg:sr,hideSeries:wn,showSeries:Cn,toggleTable:qn,toggleTooltip:Jn,toggleAnnotator:Zn,toggleFullscreen:Kn,toggleLabels:Yn,copyAlt:lr}),(e,te)=>(_(),u(`div`,{ref_key:`ringsChart`,ref:E,class:h(`vue-data-ui-component vue-ui-rings ${Q.value?`vue-data-ui-wrapper-fullscreen`:``} ${A.value.useCssAnimation?``:`vue-ui-dna`}`),style:We(`font-family:${A.value.style.fontFamily};text-align:center;width:100%;background:${F.value.backgroundColor};${A.value.responsive?`height: 100%`:``}`),id:`rings_${w.value}`,onMouseleave:te[2]||=e=>{J(),Zt(!1)},onMouseenter:te[3]||=()=>Zt(!0)},[d(`div`,{id:`chart-instructions-${w.value}`,class:`sr-only`},[d(`p`,null,Xe(A.value.a11y.translations.keyboardNavigation),1)],8,tt),A.value.a11y.includeTable&&hr.value?.rows?.length?(_(),c(Pe,{key:0,uid:w.value,head:hr.value.headers,body:hr.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):l(``,!0),j.value.buttons.annotator?(_(),c(b(Tt),He({key:1},b(a)(j.value.annotator),{svgRef:b(R),backgroundColor:F.value.backgroundColor,color:F.value.color,active:Xn.value,isCursorPointer:L.value,palette:j.value.annotatorPalette,onClose:Zn}),Be({_:2},[qe(b(ee),t=>({name:t,fn:S(n=>[y(e.$slots,t,g(m(b(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):l(``,!0),dn.value?(_(),u(`div`,{key:2,ref_key:`noTitle`,ref:zt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):l(``,!0),F.value.title.text?(_(),u(`div`,{key:3,ref_key:`chartTitle`,ref:It,style:`width:100%;background:transparent`},[f(Ae,{config:{title:{cy:`rings-div-title`,...F.value.title},subtitle:{cy:`rings-div-subtitle`,...F.value.title.subtitle}}},null,8,[`config`])],512)):l(``,!0),d(`div`,{id:`legend-top-${w.value}`},null,8,nt),j.value.show&&Mt.value&&(Xt.value||Yt.value)?(_(),c(b(Et),He({ref_key:`userOptionsRef`,ref:Ut,key:`user_options_${Ft.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isPrinting:b(sn),isImaging:b(cn),uid:w.value,hasTooltip:j.value.buttons.tooltip&&P.value.show,isTooltip:H.value.showTooltip,isFullscreen:Q.value,chartElement:E.value},b(n)(j.value,`pdf csv img svg labels table fullscreen altCopy annotator`),{isAnnotation:Xn.value,tableDialog:A.value.table.useDialog,isCursorPointer:L.value,onToggleFullscreen:Kn,onGeneratePdf:b(ln),onGenerateCsv:Gn,onGenerateImage:b(cr),onGenerateSvg:b(sr),onToggleTable:qn,onToggleTooltip:Jn,onToggleAnnotator:Zn,onToggleLabels:Yn,onCopyAlt:lr,style:{visibility:Xt.value?Yt.value?`visible`:`hidden`:`visible`}}),Be({_:2},[qe(b(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[y(e.$slots,t,g(m(b(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isTooltip`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):l(``,!0),d(`div`,rt,[(_(),u(`svg`,{ref_key:`svgRef`,ref:R,xmlns:b(ge),class:h({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value,resizing:Bt.value||k.value,"vue-data-ui-no-transition":!b(I)}),viewBox:`0 0 ${U.value.width<=0?10:U.value.width} ${U.value.height<=0?10:U.value.height}`,style:We(`max-width:100%;overflow:hidden;background:transparent;color:${F.value.color}`),"aria-describedby":`chart-instructions-${w.value}`,tabindex:`0`,onFocus:ur,onBlur:dr,onKeydown:fr},[f(b(Dt)),y(e.$slots,`svg-underlayer`,{svg:{...U.value,isPrintingImg:b(sn)||b(cn)||b(ar),isPrintingSvg:b(or)}},void 0,!0),e.$slots[`chart-background`]?(_(),u(`foreignObject`,{key:0,x:0,y:0,width:U.value.width<=0?10:U.value.width,height:U.value.height<=0?10:U.value.height,style:{pointerEvents:`none`}},[y(e.$slots,`chart-background`,{},void 0,!0)],8,at)):l(``,!0),d(`defs`,null,[(_(!0),u(Re,null,qe(q.value,(e,t)=>(_(),c(Ie,{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(ce)(b(de)(e.color,.05),100-M.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),e.$slots.pattern?(_(),u(`g`,ot,[(_(!0),u(Re,null,qe(G.value,t=>(_(),u(`defs`,null,[y(e.$slots,`pattern`,He({ref_for:!0},{seriesIndex:t.absoluteIndex,patternId:`pattern_${w.value}_${t.absoluteIndex}`}),void 0,!0)]))),256))])):l(``,!0),(_(!0),u(Re,null,qe(q.value,(t,n)=>(_(),u(`g`,{key:`r_${t.uid}`,onAnimationend:Qe(e=>_n(t.uid),[`self`]),class:h({"vue-rings-item-onload":A.value.useCssAnimation&&A.value.transitions.enable&&!k.value&&!gn.value.has(t.uid)}),style:We({transformOrigin:`${z.value.x}px ${Bn.value}px`,animationDelay:`${(q.value.length-1-n)*100}ms`})},[d(`circle`,{class:h({"vue-data-ui-transition":b(I),"vue-ui-rings-opacity":A.value.useBlurOnHover&&T.value!==null&&T.value!==n}),stroke:M.value.stroke,cx:z.value.x,cy:$.value[n].y,r:$.value[n].radius,fill:M.value.gradient.underlayerColor},null,10,ct),d(`circle`,{class:h({"vue-data-ui-transition":b(I),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":A.value.useBlurOnHover&&T.value!==null&&T.value!==n}),stroke:M.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:z.value.x,cy:$.value[n].y,r:$.value[n].radius,fill:M.value.gradient.show?`url(#gradient_${w.value}_${n})`:t.color},null,10,lt),e.$slots.pattern?(_(),u(`circle`,{key:0,class:h({"vue-data-ui-transition":b(I),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":A.value.useBlurOnHover&&T.value!==null&&T.value!==n}),stroke:M.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:z.value.x,cy:$.value[n].y,r:$.value[n].radius,fill:`url(#pattern_${w.value}_${t.absoluteIndex})`},null,10,ut)):l(``,!0),d(`circle`,{stroke:`none`,cx:z.value.x,cy:$.value[n].y,r:$.value[n].radius,fill:`transparent`,onMouseenter:e=>Wn(t,n,`pointer`),onMouseleave:e=>In(t,n),onClick:e=>Fn(t,n)},null,40,dt),pn.value?(_(),u(Re,{key:1},[d(`rect`,{x:N.value.dataLabels.markers.position===`left`?$.value[n].marker.x:z.value.x,y:$.value[n].marker.y-N.value.dataLabels.markers.strokeWidth/2,width:Math.abs(z.value.x-$.value[n].marker.x),height:N.value.dataLabels.markers.strokeWidth,fill:N.value.dataLabels.markers.stroke,rx:N.value.dataLabels.markers.strokeWidth,class:h({"vue-data-ui-transition":b(I),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":A.value.useBlurOnHover&&T.value!==null&&T.value!==n})},null,10,ft),d(`circle`,{cx:$.value[n].marker.x,cy:$.value[n].marker.y,r:N.value.dataLabels.markers.radius,fill:t.color,stroke:F.value.backgroundColor,class:h({"vue-data-ui-transition":b(I),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":A.value.useBlurOnHover&&T.value!==null&&T.value!==n})},null,10,pt),d(`text`,{"text-anchor":N.value.dataLabels.markers.position===`left`?`end`:`start`,"font-size":N.value.dataLabels.fontSize,fill:N.value.dataLabels.color,"font-weight":N.value.dataLabels.bold?`bold`:`normal`,class:h({"vue-data-ui-transition":b(I),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":A.value.useBlurOnHover&&T.value!==null&&T.value!==n}),transform:`translate(${$.value[n].marker.x+(N.value.dataLabels.markers.position===`left`?-N.value.dataLabels.offsetX-14:N.value.dataLabels.offsetX)+6}, ${$.value[n].marker.y+N.value.dataLabels.fontSize/3})`,onMouseenter:e=>Wn(t,n,`pointer`),onMouseleave:e=>In(t,n),onClick:e=>Fn(t,n),innerHTML:b(se)({content:mr.value[n],fontSize:N.value.dataLabels.fontSize,fill:N.value.dataLabels.color,x:0,y:0,translateY:!0})},null,42,mt)],64)):l(``,!0)],46,st))),128)),y(e.$slots,`svg`,{svg:{...U.value,isPrintingImg:b(sn)||b(cn)||b(ar),isPrintingSvg:b(or)}},void 0,!0)],46,it)),e.$slots.hint?(_(),u(`div`,ht,[y(e.$slots,`hint`,g(m({hint:A.value.a11y.translations.keyboardNavigation,isVisible:Kt.value})),void 0,!0)])):l(``,!0)]),e.$slots.watermark?(_(),u(`div`,gt,[y(e.$slots,`watermark`,g(m({isPrinting:b(sn)||b(cn)||b(ar)||b(or)})),void 0,!0)])):l(``,!0),d(`div`,{id:`legend-bottom-${w.value}`},null,8,_t),Vt.value&&(F.value.legend.show||e.$slots.legend)?(_(),c(ze,{key:6,to:F.value.legend.position===`top`?`#legend-top-${w.value}`:`#legend-bottom-${w.value}`},[d(`div`,{ref_key:`chartLegend`,ref:Lt},[y(e.$slots,`legend`,{legend:jn.value},()=>[F.value.legend.show?(_(),c(Me,{key:0,legendSet:jn.value,config:Mn.value,isCursorPointer:L.value,onClickMarker:te[0]||=({legend:e})=>xn(e.uid)},Be({item:S(({legend:e,index:t})=>[k.value?l(``,!0):(_(),u(`div`,{key:0,onClick:t=>xn(e.uid),style:We(`opacity:${W.value.includes(e.uid)?.5:1}`)},Xe(e.display),13,vt))]),legendToggle:S(()=>[jn.value.length>2&&F.value.legend.selectAllToggle.show&&!k.value?(_(),c(Fe,{key:0,backgroundColor:F.value.legend.selectAllToggle.backgroundColor,color:F.value.legend.selectAllToggle.color,fontSize:F.value.legend.fontSize,checked:W.value.length>0,isCursorPointer:L.value,onToggle:yn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):l(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:S(({legend:e,index:t})=>[f(ke,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${w.value}_${e.absoluteIndex})`},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:Rt,dir:`auto`},[y(e.$slots,`source`,{},void 0,!0)],512)):l(``,!0),f(b(xt),{teleportTo:P.value.teleportTo,show:H.value.showTooltip&&Nt.value&&W.value.length<C.dataset.length,backgroundColor:P.value.backgroundColor,color:P.value.color,borderRadius:P.value.borderRadius,borderColor:P.value.borderColor,borderWidth:P.value.borderWidth,fontSize:P.value.fontSize,backgroundOpacity:P.value.backgroundOpacity,position:P.value.position,offsetX:P.value.offsetX,offsetY:P.value.offsetY,parent:E.value,content:Pt.value,isFullscreen:Q.value,isCustom:P.value.customFormat&&typeof P.value.customFormat==`function`,smooth:P.value.smooth,backdropFilter:P.value.backdropFilter,smoothForce:P.value.smoothForce,smoothSnapThreshold:P.value.smoothSnapThreshold,isA11yMode:Gt.value===`keyboard`,a11yPosition:Wt.value},{"tooltip-before":S(()=>[y(e.$slots,`tooltip-before`,g(m({...Y.value})),void 0,!0)]),tooltip:S(()=>[y(e.$slots,`tooltip`,g(m({...Y.value})),void 0,!0)]),"tooltip-after":S(()=>[y(e.$slots,`tooltip-after`,g(m({...Y.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`]),!k.value&&Mt.value&&j.value.buttons.table?(_(),c(Je($n.value.component),He({key:8},$n.value.props,{ref_key:`tableUnit`,ref:Ht,onClose:er}),Be({content:S(()=>[f(b(wt),{colNames:Z.value.colNames,head:Z.value.head,body:Z.value.body,config:Z.value.config,title:A.value.table.useDialog?``:$n.value.title,withCloseButton:!A.value.table.useDialog,isCursorPointer:L.value,onClose:er},{th:S(({th:e})=>[e===`__SUM__`?(_(),u(`div`,yt,[f(b(St),{name:`sigma`,stroke:Z.value.config.th.color,size:16},null,8,[`stroke`])])):(_(),u(`div`,bt,Xe(e),1))]),td:S(({td:e})=>[Ve(Xe(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`])]),_:2},[A.value.table.useDialog?{name:`title`,fn:S(()=>[Ve(Xe($n.value.title),1)]),key:`0`}:void 0,A.value.table.useDialog?{name:`actions`,fn:S(()=>[d(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:te[1]||=e=>Gn(j.value.callbacks.csv),style:We({cursor:L.value?`pointer`:`default`})},[f(b(St),{name:`fileCsv`,stroke:$n.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):l(``,!0),y(e.$slots,`skeleton`,{},()=>[k.value?(_(),c(Ne,{key:0})):l(``,!0)],!0)],46,et))}},[[`__scopeId`,`data-v-5087967c`]]);export{$e as n,xt as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as c}from"./tableIntegration-CNoJ1CIY.js";import{n as l}from"./resolveChartConfig-0IvbmIE_.js";import{$ as u,Ct as d,D as f,Dt as p,F as m,Ht as h,Jt as g,P as ee,Qt as te,S as ne,X as re,_ as ie,at as ae,b as oe,i as se,in as ce,jt as le,nt as ue,t as de,tn as fe,v as pe,w as me,yt as he,zt as ge}from"./lib-rPeBMZrn.js";import{n as _e,t as ve}from"./useHints-C-TwxM0Y.js";import{t as ye}from"./useSvgLabelLayout-42Kats14.js";import{t as be}from"./useConfig-9oDGTWWG.js";import{t as xe}from"./useLoading-BwiplGDB.js";import{t as Se}from"./usePrinter-DVf3YcG5.js";import{t as Ce}from"./useResponsive-CENUxfEL.js";import{t as we}from"./useChartExport-BZts4KFb.js";import{t as Te}from"./useTransitions-ChGGrtrv.js";import{t as Ee}from"./useUserOptionState-CXlFnwPv.js";import{t as De}from"./useChartAccessibility-DOMuYJfm.js";import{t as Oe}from"./chartImage-DPGnEuYM.js";import{t as ke}from"./Shape-CRe8woTu.js";import{n as Ae}from"./Title-BliHuXfT.js";import{t as je}from"./vue_ui_scatter-4as114Wa.js";import{t as Me}from"./Legend-W9YVYVX-.js";import{t as Ne}from"./BaseScanner-m6QR9rwD.js";import{t as Pe}from"./A11yDataTable-DWNlWXzs.js";import{t as Fe}from"./BaseLegendToggle-VzX69MCo.js";import{t as Ie}from"./DefGrad-DKMq1REY.js";import{t as Le}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as _,Teleport as Re,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as ze,createTextVNode as Be,createVNode as Ve,defineAsyncComponent as He,guardReactiveProps as Ue,mergeProps as We,nextTick as Ge,normalizeClass as Ke,normalizeProps as qe,normalizeStyle as Je,onBeforeUnmount as Ye,onMounted as Xe,openBlock as C,ref as w,renderList as T,renderSlot as E,resolveDynamicComponent as Ze,shallowRef as Qe,toDisplayString as D,toRefs as $e,unref as O,watch as et,withCtx as k}from"vue";var tt=/* @__PURE__ */ e({default:()=>vn}),nt=[`id`],rt=[`id`],it={key:0,class:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`},at=[`id`],ot={style:{position:`relative`}},st=[`xmlns`,`aria-describedby`,`viewBox`],ct=[`width`,`height`],lt={key:1},ut=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],dt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ft={key:2},pt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],mt=[`opacity`],ht=[`stroke`,`stroke-width`,`d`],gt=[`transform`,`font-size`,`fill`,`stroke`],_t={key:4},vt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],yt=[`opacity`],bt=[`d`,`stroke`,`stroke-width`],xt=[`transform`,`font-size`,`fill`,`stroke`],St={key:6},Ct=[`data-cy`,`fill`,`stroke`,`stroke-width`,`rx`],wt=[`onMouseenter`],Tt={key:2,style:{"pointer-events":`none`}},Et=[`fill`,`fill-opacity`],Dt=[`stroke`,`stroke-dasharray`,`stroke-width`],Ot={key:0,style:{"pointer-events":`none`}},kt=[`d`,`stroke`,`stroke-width`],At=[`d`,`stroke`,`stroke-width`],jt=[`d`,`stroke`,`stroke-width`],Mt=[`d`,`stroke`,`stroke-width`],Nt={key:7},Pt=[`points`,`fill`,`stroke-width`,`stroke-dasharray`,`stroke`],Ft={key:0,class:`vue-ui-scatter-datapoint`},It=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onMouseover`,`onMouseleave`,`onClick`],Lt={key:1},Rt=[`transform`,`font-size`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],zt=[`d`,`fill`,`stroke`,`stroke-width`,`stroke-opacity`],Bt={key:0,style:{"pointer-events":`none`}},Vt=[`x`,`y`,`width`,`height`],Ht={key:0,style:{"pointer-events":`none !important`}},Ut=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Wt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Gt=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],Kt=[`x`,`y`,`font-size`,`fill`,`font-weight`],qt=[`x`,`y`,`font-size`,`fill`],Jt=[`x`,`y`,`font-size`,`fill`],Yt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Xt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Zt=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],Qt=[`id`,`transform`,`font-size`,`font-weight`,`fill`],$t=[`font-size`,`fill`,`transform`],en=[`transform`,`font-size`,`fill`],tn=[`x`,`y`,`font-size`,`fill`],nn=[`x`,`y`,`font-size`,`fill`],rn=[`font-size`,`font-weight`,`fill`,`x`,`y`],an=[`id`],on=[`x`,`y`,`width`,`height`],sn={key:14,style:{pointerEvents:`none`}},cn=[`x1`,`x2`,`y1`,`y2`,`stroke-dasharray`,`stroke`,`stroke-width`,`clip-path`],ln=[`x`,`y`,`fill`,`font-size`,`font-weight`],un={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},dn={key:6,class:`vue-data-ui-watermark`},fn=[`id`],pn=[`onClick`],mn={key:0,style:{width:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`}},hn={viewBox:`0 0 20 20`,height:`20`,width:`20`,style:{overflow:`hidden`,background:`transparent`}},gn={key:0},_n=[`innerHTML`],vn=/*#__PURE__*/ Le({__name:`vue-ui-scatter`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`,`selectLegend`],setup(e,{expose:Le,emit:tt}){let vn=He(()=>import(`./Tooltip-B432XpvC.js`)),yn=He(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),bn=He(()=>import(`./vue-ui-accordion-CnAwFOgA.js`).then(e=>e.n)),xn=He(()=>import(`./DataTable-KeuZB1JM.js`)),Sn=He(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Cn=He(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),wn=He(()=>import(`./PackageVersion-B9qiUJPH.js`).then(e=>e.t)),Tn=He(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_scatter:En}=be(),A=e,Dn=tt,On=v(()=>!!A.dataset&&A.dataset.length),j=w(re()),kn=w(!1),An=w(``),jn=w(0),M=w(null),Mn=w(null),Nn=w(null),Pn=w(null),Fn=w(null),In=w(0),Ln=w(0),Rn=w(0),N=w([]),zn=w(!1),Bn=w(null),Vn=w(null),Hn=w(null),Un=w(null),Wn=w(null),Gn=w(null),Kn=w(null),qn=w(null),Jn=w(null),Yn=w(null),Xn=w({x:0,y:0}),Zn=w(`pointer`),Qn=w(!1),$n=w(null),P=w(fr()),er=v(()=>P.value.userOptions),F=v(()=>P.value.style.layout.dataLabels.xAxis),I=v(()=>P.value.style.layout.dataLabels.yAxis),L=v(()=>P.value.style.layout.marginalBars),R=v(()=>P.value.style.layout.plots),z=v(()=>P.value.style.tooltip),B=v(()=>P.value.style);_e({config:()=>P.value,dataset:()=>A.dataset,component:`VueUiScatter`,rules:[ve.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series (clusters) is > 6. Consider:`,``,``,`▶️ Using filters to let users choose a maximum number of series (clusters) to display.`]}]});let{transitionEnabled:tr}=Te({config:()=>P.value.transitions,dataset:()=>A.dataset}),nr=v(()=>P.value.userOptions.useCursorPointer),rr=v(()=>p(P.value.events?.datapointClick));function ir(e=100,t=.8,n={}){let{meanX:r=0,sdX:i=1,meanY:a=0,sdY:o=1,seed:s}=n,c=(s??Math.floor(Math.random()*2**31))>>>0,l=()=>(c=c*1664525+1013904223>>>0,c/2**32),u=()=>{let e=0,t=0;for(;e===0;)e=l();for(;t===0;)t=l();return Math.sqrt(-2*Math.log(e))*Math.cos(2*Math.PI*t)},d=e/2,f=Array.from({length:d},u),p=Array.from({length:d},u),m=e=>e.reduce((e,t)=>e+t,0)/e.length,h=m(f),g=m(p);for(let e=0;e<d;e+=1)f[e]-=h,p[e]-=g;let ee=(e,t)=>e.reduce((e,n,r)=>e+n*t[r],0),te=e=>ee(e,e),ne=ee(p,f)/te(f),re=p.map((e,t)=>e-ne*f[t]),ie=te(f)/d,ae=te(re)/d,oe=Math.sqrt((1-t*t)*ie/ae),se=f.map((e,n)=>t*e+oe*re[n]),ce=f.concat(f.map(e=>-e)),le=se.concat(se.map(e=>-e)),ue=e=>Math.sqrt(te(e)/e.length),de=(e,t,n)=>{let r=ue(e);return e.map(e=>n+(r?e/r*t:0))},fe=de(ce,i,r),pe=de(le,o,a);for(let e=fe.length-1;e>0;--e){let t=Math.floor(l()*(e+1));[fe[e],fe[t]]=[fe[t],fe[e]],[pe[e],pe[t]]=[pe[t],pe[e]]}return fe.map((e,t)=>({x:e,y:pe[t]}))}let ar=v(()=>ce({defaultConfig:{userOptions:{show:!1},table:{show:!1},useCssAnimation:!1,style:{backgroundColor:`#99999930`,layout:{axis:{stroke:`#6A6A6A`},correlation:{label:{show:!1}},dataLabels:{xAxis:{show:!1},yAxis:{show:!1}},marginalBars:{fill:`#99999960`},padding:{top:12,right:12,bottom:12,left:12},plots:{stroke:`#6A6A6A`}},legend:{backgroundColor:`transparent`}}},userConfig:P.value.skeletonConfig??{}})),{loading:or,FINAL_DATASET:sr,manualLoading:cr}=xe({...$e(A),FINAL_CONFIG:P,prepareConfig:fr,skeletonDataset:A.config?.skeletonDataset??[{name:``,color:`#999999`,values:ir(100,.5,{seed:42})}],skeletonConfig:ce({defaultConfig:P.value,userConfig:ar.value})}),{userOptionsVisible:lr,setUserOptionsVisibility:ur,keepUserOptionState:dr}=Ee({config:P.value}),{svgRef:V}=De({config:B.value.title});function fr(){return l(A.config,En,je)}let pr=te(A.config);et(()=>A.config,(e,t)=>{let n=te(e),r=n!==pr;pr=n;let i=fr();r?(or.value||(P.value=i),lr.value=!P.value.userOptions.showOnChartHover,yr(),In.value+=1,Ln.value+=1,Rn.value+=1,H.value.showTable=P.value.table.show,H.value.showTooltip=z.value.show,vr.value&&P.value.usePerformanceMode&&console.warn(`VueUiScatter : You are using performance mode
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as c}from"./tableIntegration-CNoJ1CIY.js";import{n as l}from"./resolveChartConfig-0IvbmIE_.js";import{$ as u,Ct as d,D as f,Dt as p,F as m,Ht as h,Jt as g,P as ee,Qt as te,S as ne,X as re,_ as ie,at as ae,b as oe,i as se,in as ce,jt as le,nt as ue,t as de,tn as fe,v as pe,w as me,yt as he,zt as ge}from"./lib-rPeBMZrn.js";import{n as _e,t as ve}from"./useHints-C-TwxM0Y.js";import{t as ye}from"./useSvgLabelLayout-42Kats14.js";import{t as be}from"./useConfig-CBXrYhMI.js";import{t as xe}from"./useLoading-BwiplGDB.js";import{t as Se}from"./usePrinter-DVf3YcG5.js";import{t as Ce}from"./useResponsive-CENUxfEL.js";import{t as we}from"./useChartExport-BZts4KFb.js";import{t as Te}from"./useTransitions-ChGGrtrv.js";import{t as Ee}from"./useUserOptionState-CXlFnwPv.js";import{t as De}from"./useChartAccessibility-DOMuYJfm.js";import{t as Oe}from"./chartImage-DPGnEuYM.js";import{t as ke}from"./Shape-CRe8woTu.js";import{n as Ae}from"./Title-BliHuXfT.js";import{t as je}from"./vue_ui_scatter-4as114Wa.js";import{t as Me}from"./Legend-W9YVYVX-.js";import{t as Ne}from"./BaseScanner-m6QR9rwD.js";import{t as Pe}from"./A11yDataTable-DWNlWXzs.js";import{t as Fe}from"./BaseLegendToggle-VzX69MCo.js";import{t as Ie}from"./DefGrad-DKMq1REY.js";import{t as Le}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as _,Teleport as Re,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as ze,createTextVNode as Be,createVNode as Ve,defineAsyncComponent as He,guardReactiveProps as Ue,mergeProps as We,nextTick as Ge,normalizeClass as Ke,normalizeProps as qe,normalizeStyle as Je,onBeforeUnmount as Ye,onMounted as Xe,openBlock as C,ref as w,renderList as T,renderSlot as E,resolveDynamicComponent as Ze,shallowRef as Qe,toDisplayString as D,toRefs as $e,unref as O,watch as et,withCtx as k}from"vue";var tt=/* @__PURE__ */ e({default:()=>vn}),nt=[`id`],rt=[`id`],it={key:0,class:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`},at=[`id`],ot={style:{position:`relative`}},st=[`xmlns`,`aria-describedby`,`viewBox`],ct=[`width`,`height`],lt={key:1},ut=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],dt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ft={key:2},pt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],mt=[`opacity`],ht=[`stroke`,`stroke-width`,`d`],gt=[`transform`,`font-size`,`fill`,`stroke`],_t={key:4},vt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],yt=[`opacity`],bt=[`d`,`stroke`,`stroke-width`],xt=[`transform`,`font-size`,`fill`,`stroke`],St={key:6},Ct=[`data-cy`,`fill`,`stroke`,`stroke-width`,`rx`],wt=[`onMouseenter`],Tt={key:2,style:{"pointer-events":`none`}},Et=[`fill`,`fill-opacity`],Dt=[`stroke`,`stroke-dasharray`,`stroke-width`],Ot={key:0,style:{"pointer-events":`none`}},kt=[`d`,`stroke`,`stroke-width`],At=[`d`,`stroke`,`stroke-width`],jt=[`d`,`stroke`,`stroke-width`],Mt=[`d`,`stroke`,`stroke-width`],Nt={key:7},Pt=[`points`,`fill`,`stroke-width`,`stroke-dasharray`,`stroke`],Ft={key:0,class:`vue-ui-scatter-datapoint`},It=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onMouseover`,`onMouseleave`,`onClick`],Lt={key:1},Rt=[`transform`,`font-size`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],zt=[`d`,`fill`,`stroke`,`stroke-width`,`stroke-opacity`],Bt={key:0,style:{"pointer-events":`none`}},Vt=[`x`,`y`,`width`,`height`],Ht={key:0,style:{"pointer-events":`none !important`}},Ut=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Wt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Gt=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],Kt=[`x`,`y`,`font-size`,`fill`,`font-weight`],qt=[`x`,`y`,`font-size`,`fill`],Jt=[`x`,`y`,`font-size`,`fill`],Yt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Xt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Zt=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],Qt=[`id`,`transform`,`font-size`,`font-weight`,`fill`],$t=[`font-size`,`fill`,`transform`],en=[`transform`,`font-size`,`fill`],tn=[`x`,`y`,`font-size`,`fill`],nn=[`x`,`y`,`font-size`,`fill`],rn=[`font-size`,`font-weight`,`fill`,`x`,`y`],an=[`id`],on=[`x`,`y`,`width`,`height`],sn={key:14,style:{pointerEvents:`none`}},cn=[`x1`,`x2`,`y1`,`y2`,`stroke-dasharray`,`stroke`,`stroke-width`,`clip-path`],ln=[`x`,`y`,`fill`,`font-size`,`font-weight`],un={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},dn={key:6,class:`vue-data-ui-watermark`},fn=[`id`],pn=[`onClick`],mn={key:0,style:{width:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`}},hn={viewBox:`0 0 20 20`,height:`20`,width:`20`,style:{overflow:`hidden`,background:`transparent`}},gn={key:0},_n=[`innerHTML`],vn=/*#__PURE__*/ Le({__name:`vue-ui-scatter`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`,`selectLegend`],setup(e,{expose:Le,emit:tt}){let vn=He(()=>import(`./Tooltip-B432XpvC.js`)),yn=He(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),bn=He(()=>import(`./vue-ui-accordion-CV2dxsXB.js`).then(e=>e.n)),xn=He(()=>import(`./DataTable-KeuZB1JM.js`)),Sn=He(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Cn=He(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),wn=He(()=>import(`./PackageVersion-BbZ3wNGs.js`).then(e=>e.t)),Tn=He(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_scatter:En}=be(),A=e,Dn=tt,On=v(()=>!!A.dataset&&A.dataset.length),j=w(re()),kn=w(!1),An=w(``),jn=w(0),M=w(null),Mn=w(null),Nn=w(null),Pn=w(null),Fn=w(null),In=w(0),Ln=w(0),Rn=w(0),N=w([]),zn=w(!1),Bn=w(null),Vn=w(null),Hn=w(null),Un=w(null),Wn=w(null),Gn=w(null),Kn=w(null),qn=w(null),Jn=w(null),Yn=w(null),Xn=w({x:0,y:0}),Zn=w(`pointer`),Qn=w(!1),$n=w(null),P=w(fr()),er=v(()=>P.value.userOptions),F=v(()=>P.value.style.layout.dataLabels.xAxis),I=v(()=>P.value.style.layout.dataLabels.yAxis),L=v(()=>P.value.style.layout.marginalBars),R=v(()=>P.value.style.layout.plots),z=v(()=>P.value.style.tooltip),B=v(()=>P.value.style);_e({config:()=>P.value,dataset:()=>A.dataset,component:`VueUiScatter`,rules:[ve.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series (clusters) is > 6. Consider:`,``,``,`▶️ Using filters to let users choose a maximum number of series (clusters) to display.`]}]});let{transitionEnabled:tr}=Te({config:()=>P.value.transitions,dataset:()=>A.dataset}),nr=v(()=>P.value.userOptions.useCursorPointer),rr=v(()=>p(P.value.events?.datapointClick));function ir(e=100,t=.8,n={}){let{meanX:r=0,sdX:i=1,meanY:a=0,sdY:o=1,seed:s}=n,c=(s??Math.floor(Math.random()*2**31))>>>0,l=()=>(c=c*1664525+1013904223>>>0,c/2**32),u=()=>{let e=0,t=0;for(;e===0;)e=l();for(;t===0;)t=l();return Math.sqrt(-2*Math.log(e))*Math.cos(2*Math.PI*t)},d=e/2,f=Array.from({length:d},u),p=Array.from({length:d},u),m=e=>e.reduce((e,t)=>e+t,0)/e.length,h=m(f),g=m(p);for(let e=0;e<d;e+=1)f[e]-=h,p[e]-=g;let ee=(e,t)=>e.reduce((e,n,r)=>e+n*t[r],0),te=e=>ee(e,e),ne=ee(p,f)/te(f),re=p.map((e,t)=>e-ne*f[t]),ie=te(f)/d,ae=te(re)/d,oe=Math.sqrt((1-t*t)*ie/ae),se=f.map((e,n)=>t*e+oe*re[n]),ce=f.concat(f.map(e=>-e)),le=se.concat(se.map(e=>-e)),ue=e=>Math.sqrt(te(e)/e.length),de=(e,t,n)=>{let r=ue(e);return e.map(e=>n+(r?e/r*t:0))},fe=de(ce,i,r),pe=de(le,o,a);for(let e=fe.length-1;e>0;--e){let t=Math.floor(l()*(e+1));[fe[e],fe[t]]=[fe[t],fe[e]],[pe[e],pe[t]]=[pe[t],pe[e]]}return fe.map((e,t)=>({x:e,y:pe[t]}))}let ar=v(()=>ce({defaultConfig:{userOptions:{show:!1},table:{show:!1},useCssAnimation:!1,style:{backgroundColor:`#99999930`,layout:{axis:{stroke:`#6A6A6A`},correlation:{label:{show:!1}},dataLabels:{xAxis:{show:!1},yAxis:{show:!1}},marginalBars:{fill:`#99999960`},padding:{top:12,right:12,bottom:12,left:12},plots:{stroke:`#6A6A6A`}},legend:{backgroundColor:`transparent`}}},userConfig:P.value.skeletonConfig??{}})),{loading:or,FINAL_DATASET:sr,manualLoading:cr}=xe({...$e(A),FINAL_CONFIG:P,prepareConfig:fr,skeletonDataset:A.config?.skeletonDataset??[{name:``,color:`#999999`,values:ir(100,.5,{seed:42})}],skeletonConfig:ce({defaultConfig:P.value,userConfig:ar.value})}),{userOptionsVisible:lr,setUserOptionsVisibility:ur,keepUserOptionState:dr}=Ee({config:P.value}),{svgRef:V}=De({config:B.value.title});function fr(){return l(A.config,En,je)}let pr=te(A.config);et(()=>A.config,(e,t)=>{let n=te(e),r=n!==pr;pr=n;let i=fr();r?(or.value||(P.value=i),lr.value=!P.value.userOptions.showOnChartHover,yr(),In.value+=1,Ln.value+=1,Rn.value+=1,H.value.showTable=P.value.table.show,H.value.showTooltip=z.value.show,vr.value&&P.value.usePerformanceMode&&console.warn(`VueUiScatter : You are using performance mode
2
2
 
3
3
  - downsampling is disabled in this mode, all plots are rendered
4
4
 
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{B as t,Jt as n,M as r,X as i,t as a}from"./lib-rPeBMZrn.js";import{t as ee}from"./useNestedProp-DnGoh-XS.js";import{n as te,t as ne}from"./useHints-C-TwxM0Y.js";import{t as re}from"./useConfig-9oDGTWWG.js";import{n as o}from"./PackageVersion-B9qiUJPH.js";import{t as ie}from"./DefGrad-DKMq1REY.js";import{t as s}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as c,computed as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createStaticVNode as p,createVNode as m,normalizeClass as ae,normalizeStyle as h,openBlock as g,ref as _,renderList as v,unref as y}from"vue";var b=/* @__PURE__ */ e({default:()=>G}),oe=[`id`],se=[`xmlns`],ce={transform:`translate(300, 300)`},le=[`d`,`fill`,`stroke`],ue=[`xmlns`],x=[`fill`,`stroke`],S=[`fill`,`stroke`],C=[`fill`,`stroke`],w=[`fill`,`stroke`],T=[`fill`,`stroke`],E=[`xmlns`],D=[`stroke`],O=[`stroke`],k=[`stroke`],A=[`fill`,`stroke`],j=[`fill`],M=[`fill`,`stroke`],N=[`fill`],P=[`fill`,`stroke`],F=[`fill`],I=[`fill`,`stroke`],L=[`fill`],R=[`fill`,`stroke`],z=[`fill`],B=[`fill`,`stroke`],V=[`fill`],H=[`xmlns`],U=[`stroke`],de=[`stroke`],fe=[`stroke`],pe=[`stroke`],me=[`stroke`],he=[`stroke`],ge=[`stroke`],_e=[`stroke`],ve=[`stroke`],ye=[`xmlns`],be=[`stroke`,`fill`],xe=[`xmlns`],Se=[`stroke`,`fill`],Ce=[`xmlns`],we=[`fill`],Te=[`fill`],Ee=[`fill`],De=[`fill`],Oe=[`xmlns`],ke=[`stroke`],Ae=[`fill`],je=[`stroke`,`fill`],Me=[`stroke`,`fill`],Ne=[`fill`],Pe=[`stroke`,`fill`],Fe=[`stroke`,`fill`],Ie=[`fill`],Le=[`stroke`,`fill`],Re=[`stroke`,`fill`],ze=[`fill`],Be=[`stroke`,`fill`],Ve=[`stroke`,`fill`],He=[`fill`],Ue=[`stroke`,`fill`],We=[`stroke`,`fill`],Ge=[`xmlns`],Ke=[`stroke`],qe=[`stroke`],Je=[`stroke`,`fill`],Ye=[`stroke`,`fill`],Xe=[`stroke`,`fill`],Ze=[`stroke`,`fill`],Qe=[`stroke`,`fill`],$e=[`stroke`,`fill`],et=[`stroke`,`fill`],tt=[`stroke`,`fill`],nt=[`stroke`,`fill`],rt=[`stroke`,`fill`],it=[`stroke`,`fill`],at=[`stroke`,`fill`],ot=[`stroke`,`fill`],st=[`stroke`,`fill`],ct=[`stroke`,`fill`],lt=[`stroke`,`fill`],ut=[`stroke`,`fill`],dt=[`stroke`,`fill`],ft=[`stroke`,`fill`],pt=[`stroke`,`fill`],mt=[`stroke`,`fill`],ht=[`stroke`,`fill`],gt=[`stroke`,`fill`],_t=[`xmlns`],vt=[`stroke`],yt=[`xmlns`],bt=[`stroke`],xt=[`xmlns`],St=[`stroke`],Ct=[`xmlns`],wt=[`fill`],Tt=[`fill`],Et=[`fill`],Dt=[`fill`],Ot=[`fill`],kt=[`fill`],At=[`fill`],jt=[`fill`],Mt=[`fill`],Nt=[`fill`],Pt=[`fill`],Ft=[`fill`],It=[`xmlns`],Lt=[`stroke`],Rt=[`stroke`],zt=[`stroke`],Bt=[`stroke`],Vt=[`stroke`],Ht=[`stroke`],Ut=[`xmlns`],Wt=[`stroke`],Gt=[`stroke`],Kt=[`stroke`],qt=[`stroke`],Jt=[`stroke`],Yt=[`stroke`],Xt=[`stroke`],Zt=[`stroke`],Qt=[`stroke`],$t=[`xmlns`],en=[`stroke`],tn=[`xmlns`],nn=[`stroke`],rn=[`stroke`],an=[`stroke`],on=[`stroke`],sn=[`stroke`],cn=[`stroke`],ln=[`stroke`],un=[`stroke`],dn=[`stroke`],fn=[`xmlns`],pn=[`x1`,`x2`,`stroke`],mn=[`xmlns`],hn=[`x`,`y`,`width`,`height`,`fill`],gn=[`y`,`width`,`height`,`fill`],_n=[`xmlns`],vn=[`fill`],yn=[`fill`],bn=[`fill`],xn=[`xmlns`],Sn=[`x1`,`x2`,`y1`,`y2`,`stroke`],Cn=[`stroke`],wn=[`fill`],Tn=[`xmlns`],En=[`fill`],Dn=[`fill`],On=[`x1`,`y1`,`x2`,`y2`,`stroke-width`,`stroke`],kn=[`xmlns`],An={key:0},jn=[`stroke`,`stroke-width`],Mn=[`stroke`,`stroke-width`],Nn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Pn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Fn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],In=[`x`,`y`,`height`,`width`,`fill`],Ln=[`xmlns`,`viewBox`],Rn=[`x`,`y`,`stroke`,`fill`],zn=[`xmlns`],Bn=[`d`,`stroke`],Vn=[`cx`,`cy`,`r`,`fill`,`stroke`],Hn=[`cx`,`cy`,`r`,`fill`,`stroke`],Un=[`x`,`y`,`width`,`fill`],Wn=[`cx`,`cy`,`fill`],Gn=[`cx`,`cy`,`fill`],Kn=[`stroke`],qn=[`xmlns`],Jn=[`stroke`,`stroke-width`],Yn=[`stroke`,`stroke-width`],Xn=[`stroke`,`stroke-width`],Zn=[`fill`],Qn=[`fill`],$n=[`fill`],er=[`fill`],tr=[`fill`],nr=[`fill`],rr=[`xmlns`],ir={key:0},ar=[`stroke`,`stroke-width`],or=[`stroke`,`stroke-width`],sr=[`stroke`,`stroke-width`],cr={key:1},lr=[`r`,`fill`],ur=[`r`,`fill`],dr=[`xmlns`],fr={key:0},pr=[`stroke`,`stroke-width`],mr=[`stroke`,`stroke-width`],hr=[`fill`,`rx`,`x`,`y`,`width`,`height`],gr=[`xmlns`],_r=[`stroke-width`,`stroke`],vr=[`stroke-width`,`stroke`],yr=[`stroke-width`,`stroke`],br=[`xmlns`],xr=[`stroke`],Sr=[`stroke`],Cr=[`stroke`],wr=[`stroke`],Tr=[`fill`],Er=[`stroke`],Dr=[`xmlns`],Or=[`stroke`,`stroke-width`],kr=[`stroke`,`stroke-width`],Ar=[`fill`,`r`],jr=[`fill`,`r`],Mr=[`fill`,`r`],Nr=[`fill`,`r`],Pr=[`fill`,`r`],Fr=[`fill`,`r`],Ir=[`fill`,`r`],Lr=[`fill`,`r`],Rr=[`fill`,`r`],zr=[`xmlns`],Br=[`d`,`stroke`,`stroke-width`],Vr=[`d`,`stroke`,`stroke-width`],Hr=[`d`,`stroke`,`stroke-width`],Ur=[`d`,`stroke`,`stroke-width`],Wr=[`stroke`,`stroke-width`],Gr=[`stroke`,`stroke-width`],Kr=[`stroke`,`stroke-width`],qr=[`fill`],Jr=[`fill`],Yr=[`xmlns`],Xr=[`x`,`y`,`fill`],Zr=[`x`,`y`,`fill`],Qr=[`x`,`y`,`fill`],$r=[`xmlns`],ei=[`fill`],ti=[`fill`],ni=[`y1`,`y2`,`stroke`,`stroke-width`],ri=[`x1`,`x2`,`stroke`,`stroke-width`],ii=[`xmlns`,`stroke`],ai=[`fill`],oi=[`xmlns`,`stroke`],si=[`xmlns`,`stroke`],ci=[`fill`],li=[`xmlns`,`stroke`],ui=[`xmlns`,`stroke`],di=[`fill`],fi=[`xmlns`,`stroke`],pi=[`xmlns`,`stroke`],mi=[`fill`],hi=[`xmlns`,`stroke`],W=[`xmlns`,`stroke`],gi=[`fill`],_i=[`xmlns`,`stroke`],vi=[`xmlns`],yi=[`points`,`fill`,`stroke`,`stroke-width`],bi=[`xmlns`],xi={key:0},Si=[`stroke`,`stroke-width`],Ci=[`y`,`width`,`fill`,`rx`],G=/*#__PURE__*/ s({__name:`vue-ui-skeleton`,props:{config:{type:Object,default(){return{}}}},setup(e){let{vue_ui_skeleton:s}=re(),b=e,G=_(`vue-ui-skeleton-${i()}`),K=l(()=>ee({userConfig:b.config,defaultConfig:s})),q=l(()=>K.value.style);te({config:()=>K.value,dataset:()=>[],component:`VueUiSkeleton`,rules:[ne.noHint]});let wi=l(()=>K.value.style.animated),J=l(()=>K.value.type),Ti=_([60,50,55,36,40,25,26,12]),Ei=l(()=>r({plot:{x:50,y:50},radius:40,sides:6}).path),Di=l(()=>r({plot:{x:50,y:50},radius:30,sides:6}).path),Oi=l(()=>r({plot:{x:50,y:50},radius:20,sides:6}).path),ki=l(()=>r({plot:{x:50,y:50},radius:10,sides:6}).path),Y=_([{root:{x:70,y:77,r:44,opacity:100},bars:[{x:200,y:37,opacity:100,width:240},{x:200,y:118,opacity:100,width:180},{x:200,y:253,opacity:100,width:80}]},{root:{x:70,y:177,r:32,opacity:70},bars:[{x:200,y:145,opacity:70,width:160},{x:200,y:172,opacity:70,width:140},{x:200,y:199,opacity:70,width:120}]},{root:{x:70,y:257,r:24,opacity:40},bars:[{x:200,y:64,opacity:40,width:220},{x:200,y:91,opacity:40,width:200},{x:200,y:226,opacity:40,width:100}]}]),X=_([{y:200,height:100,bar:50},{y:180,height:100,bar:40},{y:150,height:100,bar:30},{y:120,height:80,bar:50},{y:110,height:60,bar:30},{y:80,height:80,bar:10},{y:50,height:80,bar:40},{y:24,height:40,bar:24},{y:44,height:20,bar:13},{y:32,height:45,bar:19}]),Z=_([[3,2.5],[4,3.1],[8,6],[9.5,6.5],[12,11],[16,15],[18,18.2],[25,24],[24,26],[32,32],[33,32],[32,31],[38,37],[37,38],[42,41],[40,41],[44,45],[38,35],[31,32]]),Q=_([{x:40,y:30},{x:45,y:28},{x:50,y:25},{x:55,y:20},{x:60,y:27},{x:65,y:14},{x:70,y:23},{x:75,y:16},{x:80,y:25},{x:85,y:10},{x:90,y:18},{x:95,y:7},{x:100,y:12},{x:105,y:10},{x:110,y:20},{x:115,y:7},{x:120,y:14},{x:125,y:10},{x:130,y:19},{x:135,y:3},{x:140,y:10},{x:145,y:2},{x:150,y:1}]);function $(e,t=1){let n=29.85;return{x:200+160*Math.cos(n+e*Math.PI/180)*t,y:200+160*Math.sin(n+e*Math.PI/180)*t}}let Ai=l(()=>{let e=[];for(let t=0;t<100;t+=1)e.push({x1:$(360/100*t).x,y1:$(360/100*t).y,x2:$(360/100*t,.9).x,y2:$(360/100*t,.9).y,color:K.value.style.wheel.color});return e}),ji=_([`M1.74 203.99A204 204 0 01-131.29-156.13l15.44 18.36A180 180 0 001.53 179.99Z`,`M-123.33-162.5A204 204 0 01-10.2-203.75L-9-179.78a180 180 0 00-99.82 36.4Z`,`M0-180A180 180 0 01175.19 41.33l23.36 5.51A204 204 0 000-204Z`,`M172.91 50.03A180 180 0 0110.53 179.69l1.4 23.96A204 204 0 00195.96 56.7Z`,`M-166.87-67.49a180 180 0 0151.02-70.28Q0 0 119.83-134.32a180 180 0 0152.13 81.13Q0 0-166.87-67.49Z`,`M-29.99-177.48a180 180 0 0110.73-1.49Q0 0 112.89 140.2A180 180 0 0153.63 171.83Q0 0-29.99-177.48Z`,`M179.71 10.29a180 180 0 01-4.52 31.04Q0 0-40.87-175.3a180 180 0 0110.88-2.18Q0 0 179.71 10.29Z`,`M-19.26-178.97Q0 0-166.87-67.49a180 180 0 00-12.14 86.36Q0 0-9-179.78a180 180 0 00-10.26.81Z`,`M-108.82-143.38Q0 0-40.87-175.3a180 180 0 00-67.95 31.92Q0 0-40.87-175.3a180 180 0 00-67.95 31.92Z`,`M0-180a180 180 0 01119.83 45.68Q0 0 0-180a180 180 0 01119.83 45.68Q0 0 0-180Z`,`M-148.85 101.22Q0 0-179.01 18.87a180 180 0 0030.16 82.35Q0 0-179.01 18.87a180 180 0 0030.16 82.35Z`,`M1.53 179.99Q0 0 31.73 177.18a180 180 0 0021.9-5.35Q0 0-148.85 101.22A180 180 0 001.53 179.99Z`,`M31.73 177.18a180 180 0 01-21.2 2.51Q0 0 171.96-53.19a180 180 0 017.75 63.48Q0 0 31.73 177.18Z`,`M172.91 50.03Q0 0 112.89 140.2a180 180 0 0060.02-90.17Q0 0 112.89 140.2a180 180 0 0060.02-90.17Z`]);return(e,r)=>(g(),d(`div`,{id:G.value,class:ae({"vue-data-ui-component":!0,"vue-ui-skeleton":!0,"vue-ui-skeleton-animated":wi.value}),style:h(`background:${q.value.backgroundColor};color:${q.value.color};display:flex;align-items:center;justify-content:center;`)},[J.value===`chord`?(g(),d(`svg`,{key:0,xmlns:y(a),width:`100%`,viewBox:`0 0 600 600`,style:h({background:q.value.backgroundColor})},[m(o),f(`g`,ce,[(g(!0),d(c,null,v(ji.value,(e,t)=>(g(),d(`path`,{key:e,d:e,fill:q.value.chord.color,stroke:q.value.backgroundColor,"stroke-width":`2`,style:h({opacity:t>3?.6:1})},null,12,le))),128))])],12,se)):u(``,!0),J.value===`ridgeline`?(g(),d(`svg`,{key:1,xmlns:y(a),width:`100%`,viewBox:`20 0 512 200`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`defs`,null,[m(ie,{t:`linear`,id:`ridgeline-gradient-${G.value}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,q.value.ridgeline.color,1],[`30%`,q.value.ridgeline.color,.7],[`70%`,q.value.ridgeline.color,.3],[`100%`,q.value.ridgeline.color,.1]]},null,8,[`id`,`stops`])]),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 60c6.18-.6 12.36-1.11 18.55-1.79 6.18-.68 12.37-2.38 18.55-2.4 6.19-.01 12.37 0 18.56-.01 6.18-.02 12.37-5.3 18.55-5.3 6.19 0 12.37 4.95 18.56 4.95 6.18 0 12.37-2.78 18.55-2.78 6.19 0 12.37 1.02 18.56 1.92 6.18.9 12.37 4.58 18.55 4.58s12.37-6.71 18.55-6.71c6.19 0 12.37.89 18.56.89 6.18 0 12.37-4.48 18.55-4.48 6.19 0 12.37 4.79 18.56 4.79 6.18 0 12.37-26.07 18.55-26.07 6.19 0 12.37 9.31 18.56 13.85 6.18 4.54 12.37 13.39 18.55 13.39 6.19 0 12.37-36.14 18.56-36.14 6.18 0 12.36 38.45 18.55 38.45 6.18 0 12.37-11.46 18.55-16.94 6.19-5.48 12.37-15.97 18.56-15.97 6.18 0 12.37 16.4 18.55 16.4 6.19 0 12.37-.12 18.56-.35 6.18-.22 12.37-38.08 18.55-38.08 6.19 0 12.37 24.07 18.56 36.1V60`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,x),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 90c6.18-.22 12.36-.35 18.55-.67 6.18-.32 12.37-1.65 18.55-1.65 6.19 0 12.37 1.66 18.56 1.66 6.18 0 12.37-8.76 18.55-8.76 6.19 0 12.37 4.15 18.56 4.15 6.18 0 12.37-8.44 18.55-8.44 6.19 0 12.37 10.87 18.56 10.87 6.18 0 12.37-9.21 18.55-12.16 6.18-2.96 12.37-6.97 18.55-6.97 6.19 0 12.37 9.59 18.56 12.77 6.18 3.18 12.37 7.6 18.55 7.6 6.19 0 12.37-24.44 18.56-24.44 6.18 0 12.37 16.97 18.55 16.97 6.19 0 12.37-20.62 18.56-20.62 6.18 0 12.37 20.37 18.55 20.37 6.19 0 12.37-13.13 18.56-13.13 6.18 0 12.36 13.51 18.55 13.51 6.18 0 12.37-26.41 18.55-26.41 6.19 0 12.37.49 18.56 1.26 6.18.78 12.37 13.82 18.55 13.82 6.19 0 12.37-5.3 18.56-8.3 6.18-3 12.37-9.81 18.55-9.81 6.19 0 12.37 19.82 18.56 29.72V90`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,S),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 120c6.18-.34 12.36-.55 18.55-1.01 6.18-.46 12.37-1.17 18.55-2.15 6.19-.99 12.37-3.7 18.56-4.69 6.18-.98 12.37-2.15 18.55-2.15 6.19 0 12.37.52 18.56 1.2 6.18.68 12.37 6.67 18.55 6.67 6.19 0 12.37-12.15 18.56-12.15 6.18 0 12.37 4.6 18.55 4.6S227.5 99.7 233.68 98.99c6.19-.71 12.37-1.18 18.56-1.18 6.18 0 12.37 17.75 18.55 18.22 6.19.48 12.37.74 18.56.74 6.18 0 12.37-17.09 18.55-17.09 6.19 0 12.37 12.68 18.56 12.68 6.18 0 12.37-.33 18.55-.67 6.19-.34 12.37-.79 18.56-2.06 6.18-1.26 12.36-25.45 18.55-25.45 6.18 0 12.37 10.35 18.55 10.35 6.19 0 12.37-21.07 18.56-21.07 6.18 0 12.37 33.27 18.55 33.27 6.19 0 12.37-26.97 18.56-26.97 6.18 0 12.37 26.97 18.55 27.36 6.19.4 12.37.41 18.56.61V120`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,C),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 150c6.18-.52 12.36-1.57 18.55-1.57 6.18 0 12.37 1.36 18.55 1.36 6.19 0 12.37-1.75 18.56-3.18 6.18-1.43 12.37-6.62 18.55-6.62 6.19 0 12.37 9.98 18.56 9.98 6.18 0 12.37-4.94 18.55-5.64 6.19-.71 12.37-.52 18.56-1.31 6.18-.78 12.37-12.43 18.55-12.43s12.37 18.52 18.55 18.52c6.19 0 12.37-2.49 18.56-2.49 6.18 0 12.37 3.02 18.55 3.02 6.19 0 12.37-29.39 18.56-29.39 6.18 0 12.37 5.56 18.55 8.36 6.19 2.81 12.37 5.14 18.56 8.47 6.18 3.34 12.37 12.25 18.55 12.25 6.19 0 12.37-4.3 18.56-8.78 6.18-4.48 12.36-28.77 18.55-28.77 6.18 0 12.37 1.29 18.55 3.02 6.19 1.72 12.37 18.36 18.56 18.36 6.18 0 12.37-7.68 18.55-12.92 6.19-5.24 12.37-18.51 18.56-20.1 6.18-1.58 12.37-2.7 18.55-2.7 6.19 0 12.37 34.69 18.56 52.04V150`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,w),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 180c6.18-.6 12.36-1.07 18.55-1.81 6.18-.74 12.37-2.86 18.55-2.86 6.19 0 12.37 2.14 18.56 2.14 6.18 0 12.37-7.08 18.55-7.08 6.19 0 12.37 1.08 18.56 2.03 6.18.95 12.37 4.75 18.55 4.75 6.19 0 12.37-2.45 18.56-4.62 6.18-2.17 12.37-10.99 18.55-10.99s12.37 9.58 18.55 9.58c6.19 0 12.37-.25 18.56-.69 6.18-.43 12.37-13.6 18.55-13.6 6.19 0 12.37 17.23 18.56 17.23 6.18 0 12.37-2.5 18.55-5.19 6.19-2.68 12.37-15.45 18.56-18 6.18-2.55 12.37-4.86 18.55-4.86 6.19 0 12.37 18.61 18.56 18.61 6.18 0 12.36-24.22 18.55-26.66 6.18-2.45 12.37-4.25 18.55-4.25 6.19 0 12.37 7.92 18.56 7.92 6.18 0 12.37-1.95 18.55-1.95 6.19 0 12.37 29.69 18.56 29.69 6.18 0 12.37-2.55 18.55-6.14 6.19-3.58 12.37-28.83 18.56-43.25v60`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,T)],12,ue)):u(``,!0),J.value===`historyPlot`?(g(),d(`svg`,{key:2,xmlns:y(a),width:`100%`,viewBox:`0 0 612 512`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`line`,{x1:`12`,x2:`12`,y1:`12`,y2:`500`,stroke:q.value.historyPlot.color,"stroke-width":`3`,"stroke-linecap":`round`},null,8,D),f(`line`,{x1:`12`,x2:`600`,y1:`500`,y2:`500`,stroke:q.value.historyPlot.color,"stroke-width":`3`,"stroke-linecap":`round`},null,8,O),f(`path`,{d:`M 80,100 300,200 400,150 560,230 360,420 230,320`,fill:`none`,stroke:q.value.historyPlot.color,"stroke-width":`3`},null,8,k),f(`circle`,{cx:`80`,cy:`100`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,A),f(`text`,{x:`80`,y:`108`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 1 `,8,j),f(`circle`,{cx:`300`,cy:`200`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,M),f(`text`,{x:`300`,y:`208`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 2 `,8,N),f(`circle`,{cx:`400`,cy:`150`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,P),f(`text`,{x:`400`,y:`158`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 3 `,8,F),f(`circle`,{cx:`560`,cy:`230`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,I),f(`text`,{x:`560`,y:`238`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 4 `,8,L),f(`circle`,{cx:`360`,cy:`420`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,R),f(`text`,{x:`360`,y:`428`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 5 `,8,z),f(`circle`,{cx:`230`,cy:`320`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,B),f(`text`,{x:`230`,y:`328`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 6 `,8,V)],12,E)):u(``,!0),J.value===`circlePack`?(g(),d(`svg`,{key:3,xmlns:y(a),width:`100%`,viewBox:`0 0 100 100`,style:h(`background:${q.value.backgroundColor}`)},[f(`circle`,{cx:50,cy:50,r:20,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,U),f(`circle`,{cx:80,cy:50,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,de),f(`circle`,{cx:28,cy:30,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,fe),f(`circle`,{cx:25,cy:76,r:16,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,pe),f(`circle`,{cx:60,cy:78.5,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,me),f(`circle`,{cx:64,cy:20,r:13,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,he),f(`circle`,{cx:72,cy:37,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,ge),f(`circle`,{cx:25,cy:45,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,_e),f(`circle`,{cx:70,cy:66,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,ve)],12,H)):u(``,!0),J.value===`flow`?(g(),d(`svg`,{key:4,xmlns:y(a),width:`100%`,viewBox:`0 0 80 60`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`path`,{d:`M5 5V55M75 5V55M28 5V55M52 5V55M5 8l23 4L52 9 75 8v4H52L28 21 5 29ZM5 34l23 1L52 24l23-3v6L52 30 28 44l24-5 23 2v6L52 45 28 52H5Z`,stroke:q.value.flow.color,"stroke-width":.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:q.value.flow.color},null,8,be)],12,ye)):u(``,!0),J.value===`parallelCoordinatePlot`?(g(),d(`svg`,{key:5,xmlns:y(a),width:`100%`,viewBox:`0 0 80 60`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`path`,{d:`M5 5V55M75 5V55M28 5V55M52 5V55M5 10a1 1 0 000 2 1 1 0 000-2m23 5a1 1 0 000 2 1 1 0 000-2M52 8a1 1 0 000 2 1 1 0 000-2m23 3a1 1 0 000 2 1 1 0 000-2M6 11l21 5m2 0L51 9m2 0 21 3M5 50a1 1 0 000-2 1 1 0 000 2M28 39a1 1 0 000 2 1 1 0 000-2m24 6a1 1 0 000 2 1 1 0 000-2m23 0a1 1 0 000 2 1 1 0 000-2M6 49l21-9m2 0 22 6m2 0H74M5 25a1 1 0 000 2 1 1 0 000-2m23 6a1 1 0 000 2 1 1 0 000-2m24-8a1 1 0 000 2 1 1 0 000-2m23-2a1 1 0 000 2 1 1 0 000-2M6 26l21 6m2 0 22-8m2 0 21-2`,stroke:q.value.parallelCoordinatePlot.color,"stroke-width":.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:q.value.parallelCoordinatePlot.color},null,8,Se)],12,xe)):u(``,!0),J.value===`bullet`?(g(),d(`svg`,{key:6,xmlns:y(a),width:`100%`,viewBox:`0 0 600 96`,style:h(`background:${q.value.backgroundColor}`)},[f(`rect`,{fill:q.value.bullet.color,x:24,y:12,width:300,height:72,style:{opacity:`0.8`}},null,8,we),f(`rect`,{fill:q.value.bullet.color,x:324,y:12,width:150,height:72,style:{opacity:`0.6`}},null,8,Te),f(`rect`,{fill:q.value.bullet.color,x:474,y:12,width:102,height:72,style:{opacity:`0.3`}},null,8,Ee),f(`rect`,{fill:q.value.bullet.color,x:24,y:36,width:490,height:24,style:{opacity:`1`}},null,8,De)],12,Ce)):u(``,!0),J.value===`dumbbell`?(g(),d(`svg`,{key:7,xmlns:y(a),width:`100%`,viewBox:`0 0 100 55`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`line`,{x1:`3`,x2:`3`,y1:`3`,y2:`67`,stroke:q.value.dumbbell.color,"stroke-width":.5,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,ke),f(`path`,{d:`
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{B as t,Jt as n,M as r,X as i,t as a}from"./lib-rPeBMZrn.js";import{t as ee}from"./useNestedProp-DnGoh-XS.js";import{n as te,t as ne}from"./useHints-C-TwxM0Y.js";import{t as re}from"./useConfig-CBXrYhMI.js";import{n as o}from"./PackageVersion-BbZ3wNGs.js";import{t as ie}from"./DefGrad-DKMq1REY.js";import{t as s}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as c,computed as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createStaticVNode as p,createVNode as m,normalizeClass as ae,normalizeStyle as h,openBlock as g,ref as _,renderList as v,unref as y}from"vue";var b=/* @__PURE__ */ e({default:()=>G}),oe=[`id`],se=[`xmlns`],ce={transform:`translate(300, 300)`},le=[`d`,`fill`,`stroke`],ue=[`xmlns`],x=[`fill`,`stroke`],S=[`fill`,`stroke`],C=[`fill`,`stroke`],w=[`fill`,`stroke`],T=[`fill`,`stroke`],E=[`xmlns`],D=[`stroke`],O=[`stroke`],k=[`stroke`],A=[`fill`,`stroke`],j=[`fill`],M=[`fill`,`stroke`],N=[`fill`],P=[`fill`,`stroke`],F=[`fill`],I=[`fill`,`stroke`],L=[`fill`],R=[`fill`,`stroke`],z=[`fill`],B=[`fill`,`stroke`],V=[`fill`],H=[`xmlns`],U=[`stroke`],de=[`stroke`],fe=[`stroke`],pe=[`stroke`],me=[`stroke`],he=[`stroke`],ge=[`stroke`],_e=[`stroke`],ve=[`stroke`],ye=[`xmlns`],be=[`stroke`,`fill`],xe=[`xmlns`],Se=[`stroke`,`fill`],Ce=[`xmlns`],we=[`fill`],Te=[`fill`],Ee=[`fill`],De=[`fill`],Oe=[`xmlns`],ke=[`stroke`],Ae=[`fill`],je=[`stroke`,`fill`],Me=[`stroke`,`fill`],Ne=[`fill`],Pe=[`stroke`,`fill`],Fe=[`stroke`,`fill`],Ie=[`fill`],Le=[`stroke`,`fill`],Re=[`stroke`,`fill`],ze=[`fill`],Be=[`stroke`,`fill`],Ve=[`stroke`,`fill`],He=[`fill`],Ue=[`stroke`,`fill`],We=[`stroke`,`fill`],Ge=[`xmlns`],Ke=[`stroke`],qe=[`stroke`],Je=[`stroke`,`fill`],Ye=[`stroke`,`fill`],Xe=[`stroke`,`fill`],Ze=[`stroke`,`fill`],Qe=[`stroke`,`fill`],$e=[`stroke`,`fill`],et=[`stroke`,`fill`],tt=[`stroke`,`fill`],nt=[`stroke`,`fill`],rt=[`stroke`,`fill`],it=[`stroke`,`fill`],at=[`stroke`,`fill`],ot=[`stroke`,`fill`],st=[`stroke`,`fill`],ct=[`stroke`,`fill`],lt=[`stroke`,`fill`],ut=[`stroke`,`fill`],dt=[`stroke`,`fill`],ft=[`stroke`,`fill`],pt=[`stroke`,`fill`],mt=[`stroke`,`fill`],ht=[`stroke`,`fill`],gt=[`stroke`,`fill`],_t=[`xmlns`],vt=[`stroke`],yt=[`xmlns`],bt=[`stroke`],xt=[`xmlns`],St=[`stroke`],Ct=[`xmlns`],wt=[`fill`],Tt=[`fill`],Et=[`fill`],Dt=[`fill`],Ot=[`fill`],kt=[`fill`],At=[`fill`],jt=[`fill`],Mt=[`fill`],Nt=[`fill`],Pt=[`fill`],Ft=[`fill`],It=[`xmlns`],Lt=[`stroke`],Rt=[`stroke`],zt=[`stroke`],Bt=[`stroke`],Vt=[`stroke`],Ht=[`stroke`],Ut=[`xmlns`],Wt=[`stroke`],Gt=[`stroke`],Kt=[`stroke`],qt=[`stroke`],Jt=[`stroke`],Yt=[`stroke`],Xt=[`stroke`],Zt=[`stroke`],Qt=[`stroke`],$t=[`xmlns`],en=[`stroke`],tn=[`xmlns`],nn=[`stroke`],rn=[`stroke`],an=[`stroke`],on=[`stroke`],sn=[`stroke`],cn=[`stroke`],ln=[`stroke`],un=[`stroke`],dn=[`stroke`],fn=[`xmlns`],pn=[`x1`,`x2`,`stroke`],mn=[`xmlns`],hn=[`x`,`y`,`width`,`height`,`fill`],gn=[`y`,`width`,`height`,`fill`],_n=[`xmlns`],vn=[`fill`],yn=[`fill`],bn=[`fill`],xn=[`xmlns`],Sn=[`x1`,`x2`,`y1`,`y2`,`stroke`],Cn=[`stroke`],wn=[`fill`],Tn=[`xmlns`],En=[`fill`],Dn=[`fill`],On=[`x1`,`y1`,`x2`,`y2`,`stroke-width`,`stroke`],kn=[`xmlns`],An={key:0},jn=[`stroke`,`stroke-width`],Mn=[`stroke`,`stroke-width`],Nn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Pn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Fn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],In=[`x`,`y`,`height`,`width`,`fill`],Ln=[`xmlns`,`viewBox`],Rn=[`x`,`y`,`stroke`,`fill`],zn=[`xmlns`],Bn=[`d`,`stroke`],Vn=[`cx`,`cy`,`r`,`fill`,`stroke`],Hn=[`cx`,`cy`,`r`,`fill`,`stroke`],Un=[`x`,`y`,`width`,`fill`],Wn=[`cx`,`cy`,`fill`],Gn=[`cx`,`cy`,`fill`],Kn=[`stroke`],qn=[`xmlns`],Jn=[`stroke`,`stroke-width`],Yn=[`stroke`,`stroke-width`],Xn=[`stroke`,`stroke-width`],Zn=[`fill`],Qn=[`fill`],$n=[`fill`],er=[`fill`],tr=[`fill`],nr=[`fill`],rr=[`xmlns`],ir={key:0},ar=[`stroke`,`stroke-width`],or=[`stroke`,`stroke-width`],sr=[`stroke`,`stroke-width`],cr={key:1},lr=[`r`,`fill`],ur=[`r`,`fill`],dr=[`xmlns`],fr={key:0},pr=[`stroke`,`stroke-width`],mr=[`stroke`,`stroke-width`],hr=[`fill`,`rx`,`x`,`y`,`width`,`height`],gr=[`xmlns`],_r=[`stroke-width`,`stroke`],vr=[`stroke-width`,`stroke`],yr=[`stroke-width`,`stroke`],br=[`xmlns`],xr=[`stroke`],Sr=[`stroke`],Cr=[`stroke`],wr=[`stroke`],Tr=[`fill`],Er=[`stroke`],Dr=[`xmlns`],Or=[`stroke`,`stroke-width`],kr=[`stroke`,`stroke-width`],Ar=[`fill`,`r`],jr=[`fill`,`r`],Mr=[`fill`,`r`],Nr=[`fill`,`r`],Pr=[`fill`,`r`],Fr=[`fill`,`r`],Ir=[`fill`,`r`],Lr=[`fill`,`r`],Rr=[`fill`,`r`],zr=[`xmlns`],Br=[`d`,`stroke`,`stroke-width`],Vr=[`d`,`stroke`,`stroke-width`],Hr=[`d`,`stroke`,`stroke-width`],Ur=[`d`,`stroke`,`stroke-width`],Wr=[`stroke`,`stroke-width`],Gr=[`stroke`,`stroke-width`],Kr=[`stroke`,`stroke-width`],qr=[`fill`],Jr=[`fill`],Yr=[`xmlns`],Xr=[`x`,`y`,`fill`],Zr=[`x`,`y`,`fill`],Qr=[`x`,`y`,`fill`],$r=[`xmlns`],ei=[`fill`],ti=[`fill`],ni=[`y1`,`y2`,`stroke`,`stroke-width`],ri=[`x1`,`x2`,`stroke`,`stroke-width`],ii=[`xmlns`,`stroke`],ai=[`fill`],oi=[`xmlns`,`stroke`],si=[`xmlns`,`stroke`],ci=[`fill`],li=[`xmlns`,`stroke`],ui=[`xmlns`,`stroke`],di=[`fill`],fi=[`xmlns`,`stroke`],pi=[`xmlns`,`stroke`],mi=[`fill`],hi=[`xmlns`,`stroke`],W=[`xmlns`,`stroke`],gi=[`fill`],_i=[`xmlns`,`stroke`],vi=[`xmlns`],yi=[`points`,`fill`,`stroke`,`stroke-width`],bi=[`xmlns`],xi={key:0},Si=[`stroke`,`stroke-width`],Ci=[`y`,`width`,`fill`,`rx`],G=/*#__PURE__*/ s({__name:`vue-ui-skeleton`,props:{config:{type:Object,default(){return{}}}},setup(e){let{vue_ui_skeleton:s}=re(),b=e,G=_(`vue-ui-skeleton-${i()}`),K=l(()=>ee({userConfig:b.config,defaultConfig:s})),q=l(()=>K.value.style);te({config:()=>K.value,dataset:()=>[],component:`VueUiSkeleton`,rules:[ne.noHint]});let wi=l(()=>K.value.style.animated),J=l(()=>K.value.type),Ti=_([60,50,55,36,40,25,26,12]),Ei=l(()=>r({plot:{x:50,y:50},radius:40,sides:6}).path),Di=l(()=>r({plot:{x:50,y:50},radius:30,sides:6}).path),Oi=l(()=>r({plot:{x:50,y:50},radius:20,sides:6}).path),ki=l(()=>r({plot:{x:50,y:50},radius:10,sides:6}).path),Y=_([{root:{x:70,y:77,r:44,opacity:100},bars:[{x:200,y:37,opacity:100,width:240},{x:200,y:118,opacity:100,width:180},{x:200,y:253,opacity:100,width:80}]},{root:{x:70,y:177,r:32,opacity:70},bars:[{x:200,y:145,opacity:70,width:160},{x:200,y:172,opacity:70,width:140},{x:200,y:199,opacity:70,width:120}]},{root:{x:70,y:257,r:24,opacity:40},bars:[{x:200,y:64,opacity:40,width:220},{x:200,y:91,opacity:40,width:200},{x:200,y:226,opacity:40,width:100}]}]),X=_([{y:200,height:100,bar:50},{y:180,height:100,bar:40},{y:150,height:100,bar:30},{y:120,height:80,bar:50},{y:110,height:60,bar:30},{y:80,height:80,bar:10},{y:50,height:80,bar:40},{y:24,height:40,bar:24},{y:44,height:20,bar:13},{y:32,height:45,bar:19}]),Z=_([[3,2.5],[4,3.1],[8,6],[9.5,6.5],[12,11],[16,15],[18,18.2],[25,24],[24,26],[32,32],[33,32],[32,31],[38,37],[37,38],[42,41],[40,41],[44,45],[38,35],[31,32]]),Q=_([{x:40,y:30},{x:45,y:28},{x:50,y:25},{x:55,y:20},{x:60,y:27},{x:65,y:14},{x:70,y:23},{x:75,y:16},{x:80,y:25},{x:85,y:10},{x:90,y:18},{x:95,y:7},{x:100,y:12},{x:105,y:10},{x:110,y:20},{x:115,y:7},{x:120,y:14},{x:125,y:10},{x:130,y:19},{x:135,y:3},{x:140,y:10},{x:145,y:2},{x:150,y:1}]);function $(e,t=1){let n=29.85;return{x:200+160*Math.cos(n+e*Math.PI/180)*t,y:200+160*Math.sin(n+e*Math.PI/180)*t}}let Ai=l(()=>{let e=[];for(let t=0;t<100;t+=1)e.push({x1:$(360/100*t).x,y1:$(360/100*t).y,x2:$(360/100*t,.9).x,y2:$(360/100*t,.9).y,color:K.value.style.wheel.color});return e}),ji=_([`M1.74 203.99A204 204 0 01-131.29-156.13l15.44 18.36A180 180 0 001.53 179.99Z`,`M-123.33-162.5A204 204 0 01-10.2-203.75L-9-179.78a180 180 0 00-99.82 36.4Z`,`M0-180A180 180 0 01175.19 41.33l23.36 5.51A204 204 0 000-204Z`,`M172.91 50.03A180 180 0 0110.53 179.69l1.4 23.96A204 204 0 00195.96 56.7Z`,`M-166.87-67.49a180 180 0 0151.02-70.28Q0 0 119.83-134.32a180 180 0 0152.13 81.13Q0 0-166.87-67.49Z`,`M-29.99-177.48a180 180 0 0110.73-1.49Q0 0 112.89 140.2A180 180 0 0153.63 171.83Q0 0-29.99-177.48Z`,`M179.71 10.29a180 180 0 01-4.52 31.04Q0 0-40.87-175.3a180 180 0 0110.88-2.18Q0 0 179.71 10.29Z`,`M-19.26-178.97Q0 0-166.87-67.49a180 180 0 00-12.14 86.36Q0 0-9-179.78a180 180 0 00-10.26.81Z`,`M-108.82-143.38Q0 0-40.87-175.3a180 180 0 00-67.95 31.92Q0 0-40.87-175.3a180 180 0 00-67.95 31.92Z`,`M0-180a180 180 0 01119.83 45.68Q0 0 0-180a180 180 0 01119.83 45.68Q0 0 0-180Z`,`M-148.85 101.22Q0 0-179.01 18.87a180 180 0 0030.16 82.35Q0 0-179.01 18.87a180 180 0 0030.16 82.35Z`,`M1.53 179.99Q0 0 31.73 177.18a180 180 0 0021.9-5.35Q0 0-148.85 101.22A180 180 0 001.53 179.99Z`,`M31.73 177.18a180 180 0 01-21.2 2.51Q0 0 171.96-53.19a180 180 0 017.75 63.48Q0 0 31.73 177.18Z`,`M172.91 50.03Q0 0 112.89 140.2a180 180 0 0060.02-90.17Q0 0 112.89 140.2a180 180 0 0060.02-90.17Z`]);return(e,r)=>(g(),d(`div`,{id:G.value,class:ae({"vue-data-ui-component":!0,"vue-ui-skeleton":!0,"vue-ui-skeleton-animated":wi.value}),style:h(`background:${q.value.backgroundColor};color:${q.value.color};display:flex;align-items:center;justify-content:center;`)},[J.value===`chord`?(g(),d(`svg`,{key:0,xmlns:y(a),width:`100%`,viewBox:`0 0 600 600`,style:h({background:q.value.backgroundColor})},[m(o),f(`g`,ce,[(g(!0),d(c,null,v(ji.value,(e,t)=>(g(),d(`path`,{key:e,d:e,fill:q.value.chord.color,stroke:q.value.backgroundColor,"stroke-width":`2`,style:h({opacity:t>3?.6:1})},null,12,le))),128))])],12,se)):u(``,!0),J.value===`ridgeline`?(g(),d(`svg`,{key:1,xmlns:y(a),width:`100%`,viewBox:`20 0 512 200`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`defs`,null,[m(ie,{t:`linear`,id:`ridgeline-gradient-${G.value}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,q.value.ridgeline.color,1],[`30%`,q.value.ridgeline.color,.7],[`70%`,q.value.ridgeline.color,.3],[`100%`,q.value.ridgeline.color,.1]]},null,8,[`id`,`stops`])]),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 60c6.18-.6 12.36-1.11 18.55-1.79 6.18-.68 12.37-2.38 18.55-2.4 6.19-.01 12.37 0 18.56-.01 6.18-.02 12.37-5.3 18.55-5.3 6.19 0 12.37 4.95 18.56 4.95 6.18 0 12.37-2.78 18.55-2.78 6.19 0 12.37 1.02 18.56 1.92 6.18.9 12.37 4.58 18.55 4.58s12.37-6.71 18.55-6.71c6.19 0 12.37.89 18.56.89 6.18 0 12.37-4.48 18.55-4.48 6.19 0 12.37 4.79 18.56 4.79 6.18 0 12.37-26.07 18.55-26.07 6.19 0 12.37 9.31 18.56 13.85 6.18 4.54 12.37 13.39 18.55 13.39 6.19 0 12.37-36.14 18.56-36.14 6.18 0 12.36 38.45 18.55 38.45 6.18 0 12.37-11.46 18.55-16.94 6.19-5.48 12.37-15.97 18.56-15.97 6.18 0 12.37 16.4 18.55 16.4 6.19 0 12.37-.12 18.56-.35 6.18-.22 12.37-38.08 18.55-38.08 6.19 0 12.37 24.07 18.56 36.1V60`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,x),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 90c6.18-.22 12.36-.35 18.55-.67 6.18-.32 12.37-1.65 18.55-1.65 6.19 0 12.37 1.66 18.56 1.66 6.18 0 12.37-8.76 18.55-8.76 6.19 0 12.37 4.15 18.56 4.15 6.18 0 12.37-8.44 18.55-8.44 6.19 0 12.37 10.87 18.56 10.87 6.18 0 12.37-9.21 18.55-12.16 6.18-2.96 12.37-6.97 18.55-6.97 6.19 0 12.37 9.59 18.56 12.77 6.18 3.18 12.37 7.6 18.55 7.6 6.19 0 12.37-24.44 18.56-24.44 6.18 0 12.37 16.97 18.55 16.97 6.19 0 12.37-20.62 18.56-20.62 6.18 0 12.37 20.37 18.55 20.37 6.19 0 12.37-13.13 18.56-13.13 6.18 0 12.36 13.51 18.55 13.51 6.18 0 12.37-26.41 18.55-26.41 6.19 0 12.37.49 18.56 1.26 6.18.78 12.37 13.82 18.55 13.82 6.19 0 12.37-5.3 18.56-8.3 6.18-3 12.37-9.81 18.55-9.81 6.19 0 12.37 19.82 18.56 29.72V90`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,S),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 120c6.18-.34 12.36-.55 18.55-1.01 6.18-.46 12.37-1.17 18.55-2.15 6.19-.99 12.37-3.7 18.56-4.69 6.18-.98 12.37-2.15 18.55-2.15 6.19 0 12.37.52 18.56 1.2 6.18.68 12.37 6.67 18.55 6.67 6.19 0 12.37-12.15 18.56-12.15 6.18 0 12.37 4.6 18.55 4.6S227.5 99.7 233.68 98.99c6.19-.71 12.37-1.18 18.56-1.18 6.18 0 12.37 17.75 18.55 18.22 6.19.48 12.37.74 18.56.74 6.18 0 12.37-17.09 18.55-17.09 6.19 0 12.37 12.68 18.56 12.68 6.18 0 12.37-.33 18.55-.67 6.19-.34 12.37-.79 18.56-2.06 6.18-1.26 12.36-25.45 18.55-25.45 6.18 0 12.37 10.35 18.55 10.35 6.19 0 12.37-21.07 18.56-21.07 6.18 0 12.37 33.27 18.55 33.27 6.19 0 12.37-26.97 18.56-26.97 6.18 0 12.37 26.97 18.55 27.36 6.19.4 12.37.41 18.56.61V120`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,C),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 150c6.18-.52 12.36-1.57 18.55-1.57 6.18 0 12.37 1.36 18.55 1.36 6.19 0 12.37-1.75 18.56-3.18 6.18-1.43 12.37-6.62 18.55-6.62 6.19 0 12.37 9.98 18.56 9.98 6.18 0 12.37-4.94 18.55-5.64 6.19-.71 12.37-.52 18.56-1.31 6.18-.78 12.37-12.43 18.55-12.43s12.37 18.52 18.55 18.52c6.19 0 12.37-2.49 18.56-2.49 6.18 0 12.37 3.02 18.55 3.02 6.19 0 12.37-29.39 18.56-29.39 6.18 0 12.37 5.56 18.55 8.36 6.19 2.81 12.37 5.14 18.56 8.47 6.18 3.34 12.37 12.25 18.55 12.25 6.19 0 12.37-4.3 18.56-8.78 6.18-4.48 12.36-28.77 18.55-28.77 6.18 0 12.37 1.29 18.55 3.02 6.19 1.72 12.37 18.36 18.56 18.36 6.18 0 12.37-7.68 18.55-12.92 6.19-5.24 12.37-18.51 18.56-20.1 6.18-1.58 12.37-2.7 18.55-2.7 6.19 0 12.37 34.69 18.56 52.04V150`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,w),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 180c6.18-.6 12.36-1.07 18.55-1.81 6.18-.74 12.37-2.86 18.55-2.86 6.19 0 12.37 2.14 18.56 2.14 6.18 0 12.37-7.08 18.55-7.08 6.19 0 12.37 1.08 18.56 2.03 6.18.95 12.37 4.75 18.55 4.75 6.19 0 12.37-2.45 18.56-4.62 6.18-2.17 12.37-10.99 18.55-10.99s12.37 9.58 18.55 9.58c6.19 0 12.37-.25 18.56-.69 6.18-.43 12.37-13.6 18.55-13.6 6.19 0 12.37 17.23 18.56 17.23 6.18 0 12.37-2.5 18.55-5.19 6.19-2.68 12.37-15.45 18.56-18 6.18-2.55 12.37-4.86 18.55-4.86 6.19 0 12.37 18.61 18.56 18.61 6.18 0 12.36-24.22 18.55-26.66 6.18-2.45 12.37-4.25 18.55-4.25 6.19 0 12.37 7.92 18.56 7.92 6.18 0 12.37-1.95 18.55-1.95 6.19 0 12.37 29.69 18.56 29.69 6.18 0 12.37-2.55 18.55-6.14 6.19-3.58 12.37-28.83 18.56-43.25v60`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,T)],12,ue)):u(``,!0),J.value===`historyPlot`?(g(),d(`svg`,{key:2,xmlns:y(a),width:`100%`,viewBox:`0 0 612 512`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`line`,{x1:`12`,x2:`12`,y1:`12`,y2:`500`,stroke:q.value.historyPlot.color,"stroke-width":`3`,"stroke-linecap":`round`},null,8,D),f(`line`,{x1:`12`,x2:`600`,y1:`500`,y2:`500`,stroke:q.value.historyPlot.color,"stroke-width":`3`,"stroke-linecap":`round`},null,8,O),f(`path`,{d:`M 80,100 300,200 400,150 560,230 360,420 230,320`,fill:`none`,stroke:q.value.historyPlot.color,"stroke-width":`3`},null,8,k),f(`circle`,{cx:`80`,cy:`100`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,A),f(`text`,{x:`80`,y:`108`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 1 `,8,j),f(`circle`,{cx:`300`,cy:`200`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,M),f(`text`,{x:`300`,y:`208`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 2 `,8,N),f(`circle`,{cx:`400`,cy:`150`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,P),f(`text`,{x:`400`,y:`158`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 3 `,8,F),f(`circle`,{cx:`560`,cy:`230`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,I),f(`text`,{x:`560`,y:`238`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 4 `,8,L),f(`circle`,{cx:`360`,cy:`420`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,R),f(`text`,{x:`360`,y:`428`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 5 `,8,z),f(`circle`,{cx:`230`,cy:`320`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,B),f(`text`,{x:`230`,y:`328`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 6 `,8,V)],12,E)):u(``,!0),J.value===`circlePack`?(g(),d(`svg`,{key:3,xmlns:y(a),width:`100%`,viewBox:`0 0 100 100`,style:h(`background:${q.value.backgroundColor}`)},[f(`circle`,{cx:50,cy:50,r:20,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,U),f(`circle`,{cx:80,cy:50,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,de),f(`circle`,{cx:28,cy:30,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,fe),f(`circle`,{cx:25,cy:76,r:16,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,pe),f(`circle`,{cx:60,cy:78.5,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,me),f(`circle`,{cx:64,cy:20,r:13,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,he),f(`circle`,{cx:72,cy:37,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,ge),f(`circle`,{cx:25,cy:45,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,_e),f(`circle`,{cx:70,cy:66,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,ve)],12,H)):u(``,!0),J.value===`flow`?(g(),d(`svg`,{key:4,xmlns:y(a),width:`100%`,viewBox:`0 0 80 60`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`path`,{d:`M5 5V55M75 5V55M28 5V55M52 5V55M5 8l23 4L52 9 75 8v4H52L28 21 5 29ZM5 34l23 1L52 24l23-3v6L52 30 28 44l24-5 23 2v6L52 45 28 52H5Z`,stroke:q.value.flow.color,"stroke-width":.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:q.value.flow.color},null,8,be)],12,ye)):u(``,!0),J.value===`parallelCoordinatePlot`?(g(),d(`svg`,{key:5,xmlns:y(a),width:`100%`,viewBox:`0 0 80 60`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`path`,{d:`M5 5V55M75 5V55M28 5V55M52 5V55M5 10a1 1 0 000 2 1 1 0 000-2m23 5a1 1 0 000 2 1 1 0 000-2M52 8a1 1 0 000 2 1 1 0 000-2m23 3a1 1 0 000 2 1 1 0 000-2M6 11l21 5m2 0L51 9m2 0 21 3M5 50a1 1 0 000-2 1 1 0 000 2M28 39a1 1 0 000 2 1 1 0 000-2m24 6a1 1 0 000 2 1 1 0 000-2m23 0a1 1 0 000 2 1 1 0 000-2M6 49l21-9m2 0 22 6m2 0H74M5 25a1 1 0 000 2 1 1 0 000-2m23 6a1 1 0 000 2 1 1 0 000-2m24-8a1 1 0 000 2 1 1 0 000-2m23-2a1 1 0 000 2 1 1 0 000-2M6 26l21 6m2 0 22-8m2 0 21-2`,stroke:q.value.parallelCoordinatePlot.color,"stroke-width":.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:q.value.parallelCoordinatePlot.color},null,8,Se)],12,xe)):u(``,!0),J.value===`bullet`?(g(),d(`svg`,{key:6,xmlns:y(a),width:`100%`,viewBox:`0 0 600 96`,style:h(`background:${q.value.backgroundColor}`)},[f(`rect`,{fill:q.value.bullet.color,x:24,y:12,width:300,height:72,style:{opacity:`0.8`}},null,8,we),f(`rect`,{fill:q.value.bullet.color,x:324,y:12,width:150,height:72,style:{opacity:`0.6`}},null,8,Te),f(`rect`,{fill:q.value.bullet.color,x:474,y:12,width:102,height:72,style:{opacity:`0.3`}},null,8,Ee),f(`rect`,{fill:q.value.bullet.color,x:24,y:36,width:490,height:24,style:{opacity:`1`}},null,8,De)],12,Ce)):u(``,!0),J.value===`dumbbell`?(g(),d(`svg`,{key:7,xmlns:y(a),width:`100%`,viewBox:`0 0 100 55`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`line`,{x1:`3`,x2:`3`,y1:`3`,y2:`67`,stroke:q.value.dumbbell.color,"stroke-width":.5,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,ke),f(`path`,{d:`
2
2
  M 30,11
3
3
  C 39,10 39,10
4
4
  45,11
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{$ as t,Yt as n,at as r,i,t as a,zt as o}from"./lib-rPeBMZrn.js";import{t as s}from"./useNestedProp-DnGoh-XS.js";import{n as c,t as l}from"./useHints-C-TwxM0Y.js";import{t as u}from"./useConfig-9oDGTWWG.js";import{t as d}from"./DefGrad-DKMq1REY.js";import{t as f}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as p,computed as m,createCommentVNode as h,createElementBlock as g,createElementVNode as _,createTextVNode as v,createVNode as y,normalizeClass as b,normalizeStyle as x,onMounted as S,openBlock as C,ref as w,renderList as T,renderSlot as E,toDisplayString as D,unref as O,useSlots as k,watch as A,withCtx as j,withKeys as M}from"vue";var N=[`xmlns`,`stroke`],P=[`stroke`],F=[`xmlns`,`viewBox`,`stroke`],I=[`viewBox`,`stroke`],L=/*#__PURE__*/ f({__name:`BaseSmilingUnit`,props:{config:{type:Object},unit:{type:Number},currentRating:{type:Number},getActiveColor:{type:Function},calcShapeFill:{type:Function},isReadonly:{type:Boolean},hasBreakdown:{type:Boolean},hoveredValue:{type:Number},isCursorPointer:{type:Boolean}},emits:[`rate`,`mouseenter`,`mouseleave`],setup(e,{emit:t}){let r=e,i=t;return(t,o)=>(C(),g(`div`,{tabindex:`0`,class:b({"vue-ui-smiley-rated":!e.config.readonly&&e.currentRating===e.unit}),style:x({cursor:e.config.readonly?`default`:r.isCursorPointer?`pointer`:`default`,height:e.config.style.itemSize+`px`,aspectRatio:`1/1`,position:`relative`}),onMouseenter:o[0]||=e=>i(`mouseenter`),onMouseleave:o[1]||=e=>i(`mouseleave`),onClick:o[2]||=t=>i(`rate`,e.unit),onKeyup:o[3]||=M(t=>i(`rate`,e.unit),[`enter`])},[e.config.style.tooltip.show&&e.hasBreakdown&&e.isReadonly?(C(),g(`div`,{key:0,class:`vue-ui-rating-tooltip`,style:x({border:`1px solid ${e.config.style.tooltip.borderColor}`,position:`absolute`,top:`${e.config.style.tooltip.offsetY-48}px`,left:`50%`,transform:`translateX(-50%)`,width:`fit-content`,textAlign:`center`,background:e.config.style.tooltip.backgroundColor,display:e.hoveredValue===e.unit-1?`block`:`none`,padding:`2px 12px`,borderRadius:e.config.style.tooltip.borderRadius+`px`,boxShadow:e.config.style.tooltip.boxShadow})},[_(`div`,{style:x({width:`100%`,display:`flex`,flexDirection:`row`,gap:`6px`,position:`relative`,textAlign:`center`,color:e.config.style.tooltip.color})},[_(`span`,{style:x(`font-size:${e.config.style.tooltip.fontSize}px`)},D(e.unit)+`:`,5),_(`span`,{style:x(`font-weight:${e.config.style.tooltip.bold?`bold`:`normal`};font-size:${e.config.style.tooltip.fontSize}px`)},[E(t.$slots,`rating`,{},void 0,!0)],4),_(`div`,{style:x(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${e.config.style.tooltip.borderColor}`)},` ▼ `,4)],4)],4)):h(``,!0),e.config.style.icons.filled?(C(),g(`svg`,{key:1,xmlns:O(a),style:{transition:`all 0.1s ease-in-out`,position:`absolute`,top:`0`,left:`0`},height:`100%`,viewBox:`0 0 24 24`,"stroke-width":`1.5`,stroke:e.getActiveColor(e.unit-1),fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[_(`defs`,null,[y(d,{t:`radial`,id:`vueUiSmiley${e.unit-1}`,stops:[[`0%`,O(n)(e.config.style.colors.active[e.unit-1],.05),1],[`100%`,e.config.style.colors.active[e.unit-1],1]]},null,8,[`id`,`stops`])]),E(t.$slots,`path-icon-filled`,{},void 0,!0)],8,N)):(C(),g(`svg`,{key:2,style:{position:`absolute`,top:`0`,left:`0`,transition:`all 0.1s ease-in-out`},height:`100%`,viewBox:`0 0 24 24`,"stroke-width":`1.5`,stroke:e.getActiveColor(e.unit-1),fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[E(t.$slots,`path-icon`,{},void 0,!0)],8,P)),e.config.style.icons.filled&&e.isReadonly?(C(),g(`svg`,{key:3,xmlns:O(a),style:{transition:`all 0.1s ease-in-out`,position:`absolute`,top:`0`,left:`0`},height:`100%`,viewBox:`0 0 ${e.calcShapeFill(e.unit-1)} 24`,"stroke-width":`1.5`,stroke:e.config.style.colors.activeReadonly[e.unit-1],fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[_(`defs`,null,[y(d,{t:`radial`,id:`vueUiSmiley${e.unit-1}`,stops:[[`0%`,O(n)(e.config.style.colors.activeReadonly[e.unit-1],.05),1],[`100%`,e.config.style.colors.activeReadonly[e.unit-1],1]]},null,8,[`id`,`stops`])]),E(t.$slots,`path-icon-filled-readonly`,{},void 0,!0)],8,F)):h(``,!0),!e.config.style.icons.filled&&e.isReadonly?(C(),g(`svg`,{key:4,style:{position:`absolute`,top:`0`,left:`0`,transition:`all 0.1s ease-in-out`},height:`100%`,viewBox:`0 0 ${e.calcShapeFill(e.unit-1)} 24`,"stroke-width":`1.5`,stroke:e.config.style.colors.activeReadonly[e.unit-1],fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[E(t.$slots,`path-icon-readonly`,{},void 0,!0)],8,I)):h(``,!0)],38))}},[[`__scopeId`,`data-v-9734e83c`]]),R=/* @__PURE__ */ e({default:()=>W}),z={key:0,class:`vue-ui-rating-title`,style:{width:`100%`}},B=[`d`,`fill`],V=[`d`],H=[`d`,`fill`],U=[`d`],W={__name:`vue-ui-smiley`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`rate`],setup(e,{expose:n,emit:a}){let{vue_ui_smiley:d}=u(),f=e,b=k(),E=a,O=w(null),M=w(W()),N=m(()=>M.value.style.rating),P=m(()=>M.value.style),F=m(()=>M.value.debug);S(()=>{b[`chart-background`]&&F.value&&console.warn(`VueUiSmiley does not support the #chart-background slot.`)});function I(){(!Object.hasOwn(f.dataset,`rating`)||o(f.dataset))&&r({componentName:`VueUiSmiley`,type:`datasetAttribute`,property:`rating`,debug:F.value})}S(I),c({config:()=>M.value,dataset:()=>[],component:`VueUiSmiley`,rules:[l.noHint]});let R=m(()=>M.value.useCursorPointer);function W(){return s({userConfig:f.config,defaultConfig:d})}A(()=>f.config,e=>{M.value=W(),J.value=M.value.readonly,I()},{deep:!0});let G=m(()=>{let e=f.dataset.rating;return e&&typeof e==`object`&&!Array.isArray(e)?X(e):e??null}),K=m(()=>typeof f.dataset.rating==`object`&&!Array.isArray(f.dataset.rating)),q=w(G.value);A(G,e=>{q.value=e});let J=w(M.value.readonly),Y=[{key:`smiley_0`,pathIconFilled:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zm-5 9.86a4.5 4.5 0 00-3.214 1.35 1 1 0 101.428 1.4 2.5 2.5 0 013.572 0 1 1 0 001.428-1.4A4.5 4.5 0 0012 13.2zM9.01 9l-.127.007a1 1 0 000 1.986L9 11l.127-.007a1 1 0 000-1.986L9.01 9zm6 0-.127.007a1 1 0 000 1.986L15 11l.127-.007a1 1 0 000-1.986L15.01 9z`,pathIcon:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01M9.5 15.25a3.5 3.5 0 015 0`,pathIconFilledReadonly:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zm-5 9.86a4.5 4.5 0 00-3.214 1.35 1 1 0 101.428 1.4 2.5 2.5 0 013.572 0 1 1 0 001.428-1.4A4.5 4.5 0 0012 13.2zM9.01 9l-.127.007a1 1 0 000 1.986L9 11l.127-.007a1 1 0 000-1.986L9.01 9zm6 0-.127.007a1 1 0 000 1.986L15 11l.127-.007a1 1 0 000-1.986L15.01 9z`,pathIconReadonly:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01M9.5 15.25a3.5 3.5 0 015 0`},{key:`smiley_1`,pathIconFilled:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zM15 14H9l-.117.007a1 1 0 000 1.986L9 16h6l.117-.007a1 1 0 000-1.986L15 14zm-5.99-5-.127.007a1 1 0 000 1.986L9 11l.127-.007a1 1 0 000-1.986L9.01 9zm6 0-.127.007a1 1 0 000 1.986L15 11l.127-.007a1 1 0 000-1.986L15.01 9z`,pathIcon:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01M9 15h6`,pathIconFilledReadonly:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zM15 14H9l-.117.007a1 1 0 000 1.986L9 16h6l.117-.007a1 1 0 000-1.986L15 14zm-5.99-5-.127.007a1 1 0 000 1.986L9 11l.127-.007a1 1 0 000-1.986L9.01 9zm6 0-.127.007a1 1 0 000 1.986L15 11l.127-.007a1 1 0 000-1.986L15.01 9z`,pathIconReadonly:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01M9 15h6`},{key:`smiley_2`,pathIconFilled:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zM9.01 9l-.127.007a1 1 0 000 1.986L9 11l.127-.007a1 1 0 000-1.986L9.01 9zm6 0-.127.007a1 1 0 000 1.986L15 11l.127-.007a1 1 0 000-1.986L15.01 9z`,pathIcon:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01`,pathIconFilledReadonly:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zM9.01 9l-.127.007a1 1 0 000 1.986L9 11l.127-.007a1 1 0 000-1.986L9.01 9zm6 0-.127.007a1 1 0 000 1.986L15 11l.127-.007a1 1 0 000-1.986L15.01 9z`,pathIconReadonly:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01`},{key:`smiley_3`,pathIconFilled:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zm-1.8 10.946a1 1 0 00-1.414.014 2.5 2.5 0 01-3.572 0 1 1 0 00-1.428 1.4 4.5 4.5 0 006.428 0 1 1 0 00-.014-1.414zM9.01 9l-.127.007A1 1 0 009 11l.127-.007A1 1 0 009.01 9zm6 0-.127.007A1 1 0 0015 11l.127-.007A1 1 0 0015.01 9z`,pathIcon:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01M9.5 15a3.5 3.5 0 005 0`,pathIconFilledReadonly:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zm-1.8 10.946a1 1 0 00-1.414.014 2.5 2.5 0 01-3.572 0 1 1 0 00-1.428 1.4 4.5 4.5 0 006.428 0 1 1 0 00-.014-1.414zM9.01 9l-.127.007A1 1 0 009 11l.127-.007A1 1 0 009.01 9zm6 0-.127.007A1 1 0 0015 11l.127-.007A1 1 0 0015.01 9z`,pathIconReadonly:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01M9.5 15a3.5 3.5 0 005 0`},{key:`smiley_4`,pathIconFilled:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zM15 13H9a1 1 0 00-1 1v.05a3.975 3.975 0 003.777 3.97l.227.005a4.026 4.026 0 003.99-3.79l.006-.206A1 1 0 0015 13zm-5.99-5-.127.007A1 1 0 009 10l.127-.007A1 1 0 009.01 8zm6 0-.127.007A1 1 0 0015 10l.127-.007A1 1 0 0015.01 8z`,pathIcon:`M3 12a9 9 0 1018 0A9 9 0 103 12M9 9h.01M15 9h.01M8 13a4 4 0 108 0H8`,pathIconFilledReadonly:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zM15 13H9a1 1 0 00-1 1v.05a3.975 3.975 0 003.777 3.97l.227.005a4.026 4.026 0 003.99-3.79l.006-.206A1 1 0 0015 13zm-5.99-5-.127.007A1 1 0 009 10l.127-.007A1 1 0 009.01 8zm6 0-.127.007A1 1 0 0015 10l.127-.007A1 1 0 0015.01 8z`,pathIconReadonly:`M3 12a9 9 0 1018 0A9 9 0 103 12M9 9h.01M15 9h.01M8 13a4 4 0 108 0H8`}];function X(e){if(e==null)return null;let t=0,n=0;for(let r in e){let i=Number(r),a=e[r];Number.isFinite(i)&&(t+=i*a,n+=a)}return n===0?0:t/n}function Z(e){let t=q.value-e;switch(!0){case t<0:return 0;case t>1:return 24;default:return t*24}}function Q(e){return M.value.readonly?P.value.colors.inactive[e]:q.value===e+1||O.value!==null&&O.value===e?P.value.icons.useGradient&&P.value.icons.filled?`url(#vueUiSmiley${e})`:P.value.colors.active[e]:P.value.colors.inactive[e]}let $=m(()=>({value:e,tooltip:n=!1})=>i(n?P.value.tooltip.formatter:N.value.formatter,e,t({v:e,r:n?P.value.tooltip.roundingValue:N.value.roundingValue}),M.value));function ee(e){J.value||(q.value=e,E(`rate`,e))}function te(){return q.value}function ne(e=!0){J.value=e}return n({getData:te,toggleReadonly:ne}),(e,t)=>(C(),g(`div`,{class:`vue-data-ui-component vue-ui-smiley`,style:x(`background:${P.value.backgroundColor};font-family:${P.value.fontFamily};width:100%;`),onMouseleave:t[1]||=e=>O.value=void 0},[P.value.title.text?(C(),g(`div`,z,[_(`div`,{style:x(`color:${P.value.title.color};font-weight:${P.value.title.bold?`bold`:`normal`};text-align:${P.value.title.textAlign};margin-bottom:${P.value.title.offsetY}px;font-size:${P.value.title.fontSize}px`)},D(P.value.title.text),5),P.value.title.subtitle.text?(C(),g(`div`,{key:0,style:x(`color:${P.value.title.subtitle.color};font-size:${P.value.title.subtitle.fontSize}px;text-align:${P.value.title.textAlign};margin-bottom:${P.value.title.subtitle.offsetY}px;font-weight:${P.value.title.subtitle.bold?`bold`:`normal`}`)},D(P.value.title.subtitle.text),5)):h(``,!0)])):h(``,!0),N.value.show&&N.value.position===`top`?(C(),g(`div`,{key:1,style:x(`width:100%;text-align:center;margin-bottom:${N.value.offsetY}px;font-size:${N.value.fontSize}px;font-weight:${N.value.bold?`bold`:`normal`};margin-left:${N.value.offsetX}px`)},D($.value({value:q.value})),5)):h(``,!0),_(`div`,{class:`vue-ui-smiley-wrapper`,style:x(`overflow:visible;height:${P.value.itemSize}px;width:fit-content;margin:0 auto;display:flex;align-items:center;justify-content:center;`)},[N.value.show&&N.value.position===`left`?(C(),g(`div`,{key:0,style:x(`width:fit-content;text-align:center;margin-bottom:${N.value.offsetY}px;font-size:${N.value.fontSize}px;font-weight:${N.value.bold?`bold`:`normal`};padding-right:${N.value.offsetX}px`)},D($.value({value:q.value})),5)):h(``,!0),(C(),g(p,null,T(Y,(e,n)=>y(L,{key:e.key,config:M.value,unit:n+1,currentRating:q.value,isReadonly:J.value,hasBreakdown:K.value,hoveredValue:O.value,getActiveColor:Q,calcShapeFill:Z,isCursorPointer:R.value,onMouseenter:e=>O.value=n,onMouseleave:t[0]||=e=>O.value=null,onRate:e=>ee(n+1)},{rating:j(()=>[v(D($.value({value:f.dataset.rating[String(n+1)],tooltip:!0})),1)]),"path-icon-filled":j(()=>[_(`path`,{d:e.pathIconFilled,"stroke-width":`0`,fill:Q(n)},null,8,B)]),"path-icon":j(()=>[_(`path`,{d:e.pathIcon},null,8,V)]),"path-icon-filled-readonly":j(()=>[_(`path`,{d:e.pathIconFilledReadonly,"stroke-width":`0`,fill:P.value.icons.useGradient?`url(#vueUiSmiley${n})`:P.value.colors.activeReadonly[n]},null,8,H)]),"path-icon-readonly":j(()=>[_(`path`,{d:e.pathIconReadonly},null,8,U)]),_:2},1032,[`config`,`unit`,`currentRating`,`isReadonly`,`hasBreakdown`,`hoveredValue`,`isCursorPointer`,`onMouseenter`,`onRate`])),64)),N.value.show&&N.value.position===`right`?(C(),g(`div`,{key:1,style:x(`width:fit-content;text-align:center;margin-bottom:${N.value.offsetY}px;font-size:${N.value.fontSize}px;font-weight:${N.value.bold?`bold`:`normal`};padding-left:${N.value.offsetX}px`)},D($.value({value:q.value})),5)):h(``,!0)],4),N.value.show&&N.value.position===`bottom`?(C(),g(`div`,{key:2,style:x(`width:100%;text-align:center;margin-top:${N.value.offsetY}px;font-size:${N.value.fontSize}px;font-weight:${N.value.bold?`bold`:`normal`};margin-left:${N.value.offsetX}px`)},D($.value({value:q.value})),5)):h(``,!0)],36))}};export{R as n,W as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{$ as t,Yt as n,at as r,i,t as a,zt as o}from"./lib-rPeBMZrn.js";import{t as s}from"./useNestedProp-DnGoh-XS.js";import{n as c,t as l}from"./useHints-C-TwxM0Y.js";import{t as u}from"./useConfig-CBXrYhMI.js";import{t as d}from"./DefGrad-DKMq1REY.js";import{t as f}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as p,computed as m,createCommentVNode as h,createElementBlock as g,createElementVNode as _,createTextVNode as v,createVNode as y,normalizeClass as b,normalizeStyle as x,onMounted as S,openBlock as C,ref as w,renderList as T,renderSlot as E,toDisplayString as D,unref as O,useSlots as k,watch as A,withCtx as j,withKeys as M}from"vue";var N=[`xmlns`,`stroke`],P=[`stroke`],F=[`xmlns`,`viewBox`,`stroke`],I=[`viewBox`,`stroke`],L=/*#__PURE__*/ f({__name:`BaseSmilingUnit`,props:{config:{type:Object},unit:{type:Number},currentRating:{type:Number},getActiveColor:{type:Function},calcShapeFill:{type:Function},isReadonly:{type:Boolean},hasBreakdown:{type:Boolean},hoveredValue:{type:Number},isCursorPointer:{type:Boolean}},emits:[`rate`,`mouseenter`,`mouseleave`],setup(e,{emit:t}){let r=e,i=t;return(t,o)=>(C(),g(`div`,{tabindex:`0`,class:b({"vue-ui-smiley-rated":!e.config.readonly&&e.currentRating===e.unit}),style:x({cursor:e.config.readonly?`default`:r.isCursorPointer?`pointer`:`default`,height:e.config.style.itemSize+`px`,aspectRatio:`1/1`,position:`relative`}),onMouseenter:o[0]||=e=>i(`mouseenter`),onMouseleave:o[1]||=e=>i(`mouseleave`),onClick:o[2]||=t=>i(`rate`,e.unit),onKeyup:o[3]||=M(t=>i(`rate`,e.unit),[`enter`])},[e.config.style.tooltip.show&&e.hasBreakdown&&e.isReadonly?(C(),g(`div`,{key:0,class:`vue-ui-rating-tooltip`,style:x({border:`1px solid ${e.config.style.tooltip.borderColor}`,position:`absolute`,top:`${e.config.style.tooltip.offsetY-48}px`,left:`50%`,transform:`translateX(-50%)`,width:`fit-content`,textAlign:`center`,background:e.config.style.tooltip.backgroundColor,display:e.hoveredValue===e.unit-1?`block`:`none`,padding:`2px 12px`,borderRadius:e.config.style.tooltip.borderRadius+`px`,boxShadow:e.config.style.tooltip.boxShadow})},[_(`div`,{style:x({width:`100%`,display:`flex`,flexDirection:`row`,gap:`6px`,position:`relative`,textAlign:`center`,color:e.config.style.tooltip.color})},[_(`span`,{style:x(`font-size:${e.config.style.tooltip.fontSize}px`)},D(e.unit)+`:`,5),_(`span`,{style:x(`font-weight:${e.config.style.tooltip.bold?`bold`:`normal`};font-size:${e.config.style.tooltip.fontSize}px`)},[E(t.$slots,`rating`,{},void 0,!0)],4),_(`div`,{style:x(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${e.config.style.tooltip.borderColor}`)},` ▼ `,4)],4)],4)):h(``,!0),e.config.style.icons.filled?(C(),g(`svg`,{key:1,xmlns:O(a),style:{transition:`all 0.1s ease-in-out`,position:`absolute`,top:`0`,left:`0`},height:`100%`,viewBox:`0 0 24 24`,"stroke-width":`1.5`,stroke:e.getActiveColor(e.unit-1),fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[_(`defs`,null,[y(d,{t:`radial`,id:`vueUiSmiley${e.unit-1}`,stops:[[`0%`,O(n)(e.config.style.colors.active[e.unit-1],.05),1],[`100%`,e.config.style.colors.active[e.unit-1],1]]},null,8,[`id`,`stops`])]),E(t.$slots,`path-icon-filled`,{},void 0,!0)],8,N)):(C(),g(`svg`,{key:2,style:{position:`absolute`,top:`0`,left:`0`,transition:`all 0.1s ease-in-out`},height:`100%`,viewBox:`0 0 24 24`,"stroke-width":`1.5`,stroke:e.getActiveColor(e.unit-1),fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[E(t.$slots,`path-icon`,{},void 0,!0)],8,P)),e.config.style.icons.filled&&e.isReadonly?(C(),g(`svg`,{key:3,xmlns:O(a),style:{transition:`all 0.1s ease-in-out`,position:`absolute`,top:`0`,left:`0`},height:`100%`,viewBox:`0 0 ${e.calcShapeFill(e.unit-1)} 24`,"stroke-width":`1.5`,stroke:e.config.style.colors.activeReadonly[e.unit-1],fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[_(`defs`,null,[y(d,{t:`radial`,id:`vueUiSmiley${e.unit-1}`,stops:[[`0%`,O(n)(e.config.style.colors.activeReadonly[e.unit-1],.05),1],[`100%`,e.config.style.colors.activeReadonly[e.unit-1],1]]},null,8,[`id`,`stops`])]),E(t.$slots,`path-icon-filled-readonly`,{},void 0,!0)],8,F)):h(``,!0),!e.config.style.icons.filled&&e.isReadonly?(C(),g(`svg`,{key:4,style:{position:`absolute`,top:`0`,left:`0`,transition:`all 0.1s ease-in-out`},height:`100%`,viewBox:`0 0 ${e.calcShapeFill(e.unit-1)} 24`,"stroke-width":`1.5`,stroke:e.config.style.colors.activeReadonly[e.unit-1],fill:`none`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[E(t.$slots,`path-icon-readonly`,{},void 0,!0)],8,I)):h(``,!0)],38))}},[[`__scopeId`,`data-v-9734e83c`]]),R=/* @__PURE__ */ e({default:()=>W}),z={key:0,class:`vue-ui-rating-title`,style:{width:`100%`}},B=[`d`,`fill`],V=[`d`],H=[`d`,`fill`],U=[`d`],W={__name:`vue-ui-smiley`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`rate`],setup(e,{expose:n,emit:a}){let{vue_ui_smiley:d}=u(),f=e,b=k(),E=a,O=w(null),M=w(W()),N=m(()=>M.value.style.rating),P=m(()=>M.value.style),F=m(()=>M.value.debug);S(()=>{b[`chart-background`]&&F.value&&console.warn(`VueUiSmiley does not support the #chart-background slot.`)});function I(){(!Object.hasOwn(f.dataset,`rating`)||o(f.dataset))&&r({componentName:`VueUiSmiley`,type:`datasetAttribute`,property:`rating`,debug:F.value})}S(I),c({config:()=>M.value,dataset:()=>[],component:`VueUiSmiley`,rules:[l.noHint]});let R=m(()=>M.value.useCursorPointer);function W(){return s({userConfig:f.config,defaultConfig:d})}A(()=>f.config,e=>{M.value=W(),J.value=M.value.readonly,I()},{deep:!0});let G=m(()=>{let e=f.dataset.rating;return e&&typeof e==`object`&&!Array.isArray(e)?X(e):e??null}),K=m(()=>typeof f.dataset.rating==`object`&&!Array.isArray(f.dataset.rating)),q=w(G.value);A(G,e=>{q.value=e});let J=w(M.value.readonly),Y=[{key:`smiley_0`,pathIconFilled:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zm-5 9.86a4.5 4.5 0 00-3.214 1.35 1 1 0 101.428 1.4 2.5 2.5 0 013.572 0 1 1 0 001.428-1.4A4.5 4.5 0 0012 13.2zM9.01 9l-.127.007a1 1 0 000 1.986L9 11l.127-.007a1 1 0 000-1.986L9.01 9zm6 0-.127.007a1 1 0 000 1.986L15 11l.127-.007a1 1 0 000-1.986L15.01 9z`,pathIcon:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01M9.5 15.25a3.5 3.5 0 015 0`,pathIconFilledReadonly:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zm-5 9.86a4.5 4.5 0 00-3.214 1.35 1 1 0 101.428 1.4 2.5 2.5 0 013.572 0 1 1 0 001.428-1.4A4.5 4.5 0 0012 13.2zM9.01 9l-.127.007a1 1 0 000 1.986L9 11l.127-.007a1 1 0 000-1.986L9.01 9zm6 0-.127.007a1 1 0 000 1.986L15 11l.127-.007a1 1 0 000-1.986L15.01 9z`,pathIconReadonly:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01M9.5 15.25a3.5 3.5 0 015 0`},{key:`smiley_1`,pathIconFilled:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zM15 14H9l-.117.007a1 1 0 000 1.986L9 16h6l.117-.007a1 1 0 000-1.986L15 14zm-5.99-5-.127.007a1 1 0 000 1.986L9 11l.127-.007a1 1 0 000-1.986L9.01 9zm6 0-.127.007a1 1 0 000 1.986L15 11l.127-.007a1 1 0 000-1.986L15.01 9z`,pathIcon:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01M9 15h6`,pathIconFilledReadonly:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zM15 14H9l-.117.007a1 1 0 000 1.986L9 16h6l.117-.007a1 1 0 000-1.986L15 14zm-5.99-5-.127.007a1 1 0 000 1.986L9 11l.127-.007a1 1 0 000-1.986L9.01 9zm6 0-.127.007a1 1 0 000 1.986L15 11l.127-.007a1 1 0 000-1.986L15.01 9z`,pathIconReadonly:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01M9 15h6`},{key:`smiley_2`,pathIconFilled:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zM9.01 9l-.127.007a1 1 0 000 1.986L9 11l.127-.007a1 1 0 000-1.986L9.01 9zm6 0-.127.007a1 1 0 000 1.986L15 11l.127-.007a1 1 0 000-1.986L15.01 9z`,pathIcon:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01`,pathIconFilledReadonly:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zM9.01 9l-.127.007a1 1 0 000 1.986L9 11l.127-.007a1 1 0 000-1.986L9.01 9zm6 0-.127.007a1 1 0 000 1.986L15 11l.127-.007a1 1 0 000-1.986L15.01 9z`,pathIconReadonly:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01`},{key:`smiley_3`,pathIconFilled:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zm-1.8 10.946a1 1 0 00-1.414.014 2.5 2.5 0 01-3.572 0 1 1 0 00-1.428 1.4 4.5 4.5 0 006.428 0 1 1 0 00-.014-1.414zM9.01 9l-.127.007A1 1 0 009 11l.127-.007A1 1 0 009.01 9zm6 0-.127.007A1 1 0 0015 11l.127-.007A1 1 0 0015.01 9z`,pathIcon:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01M9.5 15a3.5 3.5 0 005 0`,pathIconFilledReadonly:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zm-1.8 10.946a1 1 0 00-1.414.014 2.5 2.5 0 01-3.572 0 1 1 0 00-1.428 1.4 4.5 4.5 0 006.428 0 1 1 0 00-.014-1.414zM9.01 9l-.127.007A1 1 0 009 11l.127-.007A1 1 0 009.01 9zm6 0-.127.007A1 1 0 0015 11l.127-.007A1 1 0 0015.01 9z`,pathIconReadonly:`M3 12a9 9 0 1018 0A9 9 0 103 12m6-2h.01M15 10h.01M9.5 15a3.5 3.5 0 005 0`},{key:`smiley_4`,pathIconFilled:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zM15 13H9a1 1 0 00-1 1v.05a3.975 3.975 0 003.777 3.97l.227.005a4.026 4.026 0 003.99-3.79l.006-.206A1 1 0 0015 13zm-5.99-5-.127.007A1 1 0 009 10l.127-.007A1 1 0 009.01 8zm6 0-.127.007A1 1 0 0015 10l.127-.007A1 1 0 0015.01 8z`,pathIcon:`M3 12a9 9 0 1018 0A9 9 0 103 12M9 9h.01M15 9h.01M8 13a4 4 0 108 0H8`,pathIconFilledReadonly:`M17 3.34A10 10 0 112.005 12.324L2 12l.005-.324A10 10 0 0117 3.34zM15 13H9a1 1 0 00-1 1v.05a3.975 3.975 0 003.777 3.97l.227.005a4.026 4.026 0 003.99-3.79l.006-.206A1 1 0 0015 13zm-5.99-5-.127.007A1 1 0 009 10l.127-.007A1 1 0 009.01 8zm6 0-.127.007A1 1 0 0015 10l.127-.007A1 1 0 0015.01 8z`,pathIconReadonly:`M3 12a9 9 0 1018 0A9 9 0 103 12M9 9h.01M15 9h.01M8 13a4 4 0 108 0H8`}];function X(e){if(e==null)return null;let t=0,n=0;for(let r in e){let i=Number(r),a=e[r];Number.isFinite(i)&&(t+=i*a,n+=a)}return n===0?0:t/n}function Z(e){let t=q.value-e;switch(!0){case t<0:return 0;case t>1:return 24;default:return t*24}}function Q(e){return M.value.readonly?P.value.colors.inactive[e]:q.value===e+1||O.value!==null&&O.value===e?P.value.icons.useGradient&&P.value.icons.filled?`url(#vueUiSmiley${e})`:P.value.colors.active[e]:P.value.colors.inactive[e]}let $=m(()=>({value:e,tooltip:n=!1})=>i(n?P.value.tooltip.formatter:N.value.formatter,e,t({v:e,r:n?P.value.tooltip.roundingValue:N.value.roundingValue}),M.value));function ee(e){J.value||(q.value=e,E(`rate`,e))}function te(){return q.value}function ne(e=!0){J.value=e}return n({getData:te,toggleReadonly:ne}),(e,t)=>(C(),g(`div`,{class:`vue-data-ui-component vue-ui-smiley`,style:x(`background:${P.value.backgroundColor};font-family:${P.value.fontFamily};width:100%;`),onMouseleave:t[1]||=e=>O.value=void 0},[P.value.title.text?(C(),g(`div`,z,[_(`div`,{style:x(`color:${P.value.title.color};font-weight:${P.value.title.bold?`bold`:`normal`};text-align:${P.value.title.textAlign};margin-bottom:${P.value.title.offsetY}px;font-size:${P.value.title.fontSize}px`)},D(P.value.title.text),5),P.value.title.subtitle.text?(C(),g(`div`,{key:0,style:x(`color:${P.value.title.subtitle.color};font-size:${P.value.title.subtitle.fontSize}px;text-align:${P.value.title.textAlign};margin-bottom:${P.value.title.subtitle.offsetY}px;font-weight:${P.value.title.subtitle.bold?`bold`:`normal`}`)},D(P.value.title.subtitle.text),5)):h(``,!0)])):h(``,!0),N.value.show&&N.value.position===`top`?(C(),g(`div`,{key:1,style:x(`width:100%;text-align:center;margin-bottom:${N.value.offsetY}px;font-size:${N.value.fontSize}px;font-weight:${N.value.bold?`bold`:`normal`};margin-left:${N.value.offsetX}px`)},D($.value({value:q.value})),5)):h(``,!0),_(`div`,{class:`vue-ui-smiley-wrapper`,style:x(`overflow:visible;height:${P.value.itemSize}px;width:fit-content;margin:0 auto;display:flex;align-items:center;justify-content:center;`)},[N.value.show&&N.value.position===`left`?(C(),g(`div`,{key:0,style:x(`width:fit-content;text-align:center;margin-bottom:${N.value.offsetY}px;font-size:${N.value.fontSize}px;font-weight:${N.value.bold?`bold`:`normal`};padding-right:${N.value.offsetX}px`)},D($.value({value:q.value})),5)):h(``,!0),(C(),g(p,null,T(Y,(e,n)=>y(L,{key:e.key,config:M.value,unit:n+1,currentRating:q.value,isReadonly:J.value,hasBreakdown:K.value,hoveredValue:O.value,getActiveColor:Q,calcShapeFill:Z,isCursorPointer:R.value,onMouseenter:e=>O.value=n,onMouseleave:t[0]||=e=>O.value=null,onRate:e=>ee(n+1)},{rating:j(()=>[v(D($.value({value:f.dataset.rating[String(n+1)],tooltip:!0})),1)]),"path-icon-filled":j(()=>[_(`path`,{d:e.pathIconFilled,"stroke-width":`0`,fill:Q(n)},null,8,B)]),"path-icon":j(()=>[_(`path`,{d:e.pathIcon},null,8,V)]),"path-icon-filled-readonly":j(()=>[_(`path`,{d:e.pathIconFilledReadonly,"stroke-width":`0`,fill:P.value.icons.useGradient?`url(#vueUiSmiley${n})`:P.value.colors.activeReadonly[n]},null,8,H)]),"path-icon-readonly":j(()=>[_(`path`,{d:e.pathIconReadonly},null,8,U)]),_:2},1032,[`config`,`unit`,`currentRating`,`isReadonly`,`hasBreakdown`,`hoveredValue`,`isCursorPointer`,`onMouseenter`,`onRate`])),64)),N.value.show&&N.value.position===`right`?(C(),g(`div`,{key:1,style:x(`width:fit-content;text-align:center;margin-bottom:${N.value.offsetY}px;font-size:${N.value.fontSize}px;font-weight:${N.value.bold?`bold`:`normal`};padding-left:${N.value.offsetX}px`)},D($.value({value:q.value})),5)):h(``,!0)],4),N.value.show&&N.value.position===`bottom`?(C(),g(`div`,{key:2,style:x(`width:100%;text-align:center;margin-top:${N.value.offsetY}px;font-size:${N.value.fontSize}px;font-weight:${N.value.bold?`bold`:`normal`};margin-left:${N.value.offsetX}px`)},D($.value({value:q.value})),5)):h(``,!0)],36))}};export{R as n,W as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useAnimationFrame-D8gcRfnW.js";import{t as n}from"./resolveChartConfig-0IvbmIE_.js";import{$ as r,Jt as i,Mt as a,P as ee,X as te,at as ne,b as o,g as re,i as ie,in as ae,t as oe,zt as s}from"./lib-rPeBMZrn.js";import{c as se}from"./canvas-lib-22VpOI4_.js";import{n as ce,t as le}from"./useHints-C-TwxM0Y.js";import{t as ue}from"./useConfig-9oDGTWWG.js";import{t as de}from"./useLoading-BwiplGDB.js";import{t as fe}from"./useFitSvgText-C1QC4P5G.js";import{t as pe}from"./useResponsive-CENUxfEL.js";import{t as me}from"./usePrefersMotion-XLHwega2.js";import{t as he}from"./vue_ui_spark_trend-BgPQfeCz.js";import{t as ge}from"./BaseScanner-m6QR9rwD.js";import{t as _e}from"./DefGrad-DKMq1REY.js";import{t as ve}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{computed as c,createBlock as ye,createCommentVNode as l,createElementBlock as u,createElementVNode as be,createVNode as xe,defineAsyncComponent as Se,nextTick as Ce,normalizeStyle as we,onBeforeUnmount as Te,onMounted as Ee,openBlock as d,ref as f,renderSlot as p,toDisplayString as m,toRefs as De,unref as h,watch as g}from"vue";var Oe=/* @__PURE__ */ e({default:()=>_}),ke=[`id`,`aria-describedby`],Ae=[`id`],je=[`xmlns`,`viewBox`],Me=[`width`,`height`],Ne={key:1},Pe=[`d`,`fill`],Fe=[`d`,`fill`],Ie=[`d`,`stroke`,`stroke-width`,`stroke-linecap`,`stroke-linejoin`],Le=[`d`,`stroke`,`stroke-width`,`stroke-linecap`,`stroke-linejoin`],Re=[`d`],ze=[`fill`,`d`],Be=[`x`,`y`,`width`,`height`],Ve=[`x`,`y`,`fill`,`font-size`,`font-weight`],He=[`stroke`,`cx`,`cy`,`fill`],Ue=[`x`,`y`,`font-size`,`fill`,`font-weight`],_=/*#__PURE__*/ ve({__name:`vue-ui-spark-trend`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(e){let ve=Se(()=>import(`./PackageVersion-B9qiUJPH.js`).then(e=>e.t)),{vue_ui_spark_trend:Oe}=ue(),_=me(),v=e,y=f(null),We=f(null),b=f(null),x=f(null),S=f(null),C=t(),w=0;function Ge(){w+=1,C.cancel(),x.value?.disconnect(),x.value=null,S.value=null}Te(Ge);let T=f(!1),E=t(),D=f(te()),O=f(L()),k=c(()=>O.value.style.dataLabel),A=c(()=>O.value.style.trendLabel),j=c(()=>O.value.style.line),M=c(()=>O.value.style.area),N=c(()=>O.value.style);ce({config:()=>O.value,dataset:()=>v.dataset,component:`VueUiSparkTrend`,rules:[le.emptyArray,{test:e=>e.length>1095,message:[`👀 The dataset has > 1095 datapoints. Above this threshold, the dataset is computed through an LTTB algorithm, to preserve the shape of the data without increasing the number of datapoints.`,``,`▶️ If you need this level of detail, you can change config.downsample.threshold and set a higher value. Note that performance will be impacted.`]}]});let Ke=c(()=>ae({defaultConfig:{style:{animation:{show:!1},backgroundColor:`#99999930`,line:{stroke:`#6A6A6A`,useColorTrend:!1},dataLabel:{show:!1,useColorTrend:!1,color:`#6A6A6A`}}},userConfig:O.value.skeletonConfig??{}})),{loading:P,FINAL_DATASET:F,manualLoading:I}=de({...De(v),FINAL_CONFIG:O,prepareConfig:L,skeletonDataset:v.config?.skeletonDataset??[1,2,3,5,8,13,21,34,55,89,144,233],skeletonConfig:ae({defaultConfig:O.value,userConfig:Ke.value})});function L(){return n(v.config,Oe,he)}let R=c(()=>a({data:F.value,threshold:O.value.downsample.threshold}));g(()=>v.config,e=>{O.value=L(),H.value=N.value.width,U.value=N.value.height,Je()},{deep:!0});function z(e){return e.map(e=>o(e))}let B=f(a({data:F.value,threshold:O.value.downsample.threshold}).map(e=>N.value.animation.show&&!_.value||[void 0,1/0,-1/0,null,NaN].includes(e)?null:e));g(R,e=>{E.cancel(),N.value.animation.show&&!_.value?B.value=Array(e.length).fill(null):B.value=e.map(e=>![void 0,1/0,-1/0,null].includes(e)&&!Number.isNaN(e)?e:null),V(),Ce(()=>$(`.vue-ui-sparktrend-progress-label`,6))},{deep:!0,immediate:!0}),g(()=>JSON.stringify(v.dataset),()=>{E.cancel(),I.value=s(v.dataset);let e=R.value;B.value=N.value.animation.show&&!_.value?Array(e.length).fill(null):e.map(e=>Number.isFinite(e)?e:null),V(),Ce(()=>$(`.vue-ui-sparktrend-progress-label`,6))},{deep:!1,immediate:!0});function V(){if(E.cancel(),E.isDisposed())return;T.value=!1;let e=N.value.animation.animationFrames,t=1e3/e,n=performance.now();if(!P.value&&N.value.animation.show&&!_.value&&Number.isFinite(e)&&e>0&&F.value.length>1){B.value=[];let e=0;function r(){T.value=!0;let i=performance.now(),a=i-n;a>t?(n=i-a%t,e<R.value.length?(B.value.push(R.value[e]),e+=1,E.request(r)):(E.cancel(),B.value=z(R.value),T.value=!1,$(`.vue-ui-sparktrend-progress-label`,6))):E.request(r)}r()}else B.value=z(R.value)}g([()=>N.value.animation.show,_],([e,t])=>{(!e||t)&&V()}),Ee(()=>{Je()});let qe=c(()=>O.value.debug);function Je(){if(Ge(),s(v.dataset)&&(ne({componentName:`VueUiSparkTrend`,type:`dataset`,debug:qe.value}),I.value=!0),s(v.dataset)||(I.value=!1),O.value.responsive&&y.value?.parentNode){let e=w,t=se(()=>{if(e!==w||C.isDisposed())return;let{width:t,height:n}=pe({chart:y.value,source:b.value});C.request(()=>{H.value=t,U.value=n})});x.value=new ResizeObserver(t),S.value=y.value.parentNode,x.value.observe(S.value)}V(),$(`.vue-ui-sparktrend-progress-label`,6)}let H=f(N.value.width),U=f(N.value.height),W=c(()=>({height:U.value,width:H.value})),G=c(()=>({top:N.value.padding.top,left:N.value.padding.left,right:W.value.width-N.value.padding.right,bottom:W.value.height-N.value.padding.bottom,height:W.value.height-(N.value.padding.top+N.value.padding.bottom)-(k.value.show?k.value.fontSize:0),width:W.value.width-(N.value.padding.left+N.value.padding.right)})),K=c(()=>{let e=z(R.value).filter(Number.isFinite);if(!e.length)return{max:0,min:0};let t=e[0],n=e[0];for(let r=1;r<e.length;r++){let i=e[r];i>t&&(t=i),i<n&&(n=i)}return{max:t,min:n}}),Ye=c(()=>{let e=R.value,t=e.length?e[e.length-1]:`x`;return[D.value,e.length,Number.isFinite(t)?t:`x`,O.value.downsample.threshold,j.value.smooth?`s`:`l`].join(`-`)}),q=c(()=>{let e=K.value.min>=0?0:K.value.min;return Math.abs(e)}),Xe=c(()=>K.value.max+q.value);function Ze(e){return e/Xe.value}let Qe=c(()=>R.value.length),J=c(()=>B.value.map((e,t)=>{let n=isNaN(e)||[void 0,null,`NaN`,NaN,1/0,-1/0].includes(e)?0:e||0;return{value:o(e),absoluteValue:o(n),plotValue:o(n+q.value),toMax:Ze(n+q.value),x:G.value.left+o(t*(G.value.width/(Qe.value-1)))-N.value.padding.right,y:G.value.bottom-o(G.value.height*Ze(n+q.value))}})),Y=c(()=>{let e=z(R.value);return A.value.trendType===`global`?re(e):A.value.trendType===`n-1`&&e.length>1?(e.at(-1)/e.at(-2)-1)*100:A.value.trendType===`lastToFirst`?(e.at(-1)/e[0]-1)*100:0}),X=c(()=>T.value||Y.value===0?`neutral`:Y.value>0?`positive`:`negative`),Z=c(()=>N.value.arrow.colors[X.value]),$e=c(()=>{let e={x:J.value[0].x,y:W.value.height-6},t={x:J.value[J.value.length-1].x,y:W.value.height-6},n=[];return J.value.forEach(e=>{n.push(`${e.x},${e.y} `)}),[e.x,e.y,...n,t.x,t.y].toString()}),et=c(()=>{let e=[];return J.value.forEach(t=>{e.push(`${t.x},${t.y} `)}),`M ${e.toString()}`}),Q=c(()=>U.value/2-A.value.fontSize),tt=c(()=>G.value.left*.8),{fitText:$}=fe({svgRef:We,unitWidth:tt,fontSize:A.value.fontSize}),nt=c(()=>{if(P.value||T.value)return`Trend chart loading`;let e=J.value?.at(-1),t=e?.value,n=r({p:Y.value>0?`+`:``,v:Y.value,s:`%`,r:A.value.rounding}),i=t==null?`not available`:ie(k.value.formatter,t,r({p:k.value.prefix,v:t,s:k.value.suffix,r:k.value.rounding}),{datapoint:e});return`Progression ${X.value===`positive`?`up ${n}`:X.value===`negative`?`down ${n}`:`stable at ${n}`}. Last value ${i}.`}),rt=c(()=>`sparktrend-a11y-${D.value}`);return(e,t)=>(d(),u(`div`,{ref_key:`sparkTrendChart`,ref:y,class:`vue-data-ui-component vue-ui-spark-trend`,id:D.value,style:we(`width:100%;font-family:${N.value.fontFamily};background:${N.value.backgroundColor}`),role:`img`,"aria-describedby":rt.value},[be(`p`,{id:rt.value,class:`sr-only`,"aria-live":`polite`},m(nt.value),9,Ae),(d(),u(`svg`,{key:Ye.value,ref_key:`svgRef`,ref:We,xmlns:h(oe),viewBox:`0 0 ${W.value.width} ${W.value.height}`,style:`width:100%;background:transparent;overflow:visible`,"aria-hidden":`true`},[xe(h(ve)),e.$slots[`chart-background`]?(d(),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`}},[p(e.$slots,`chart-background`,{},void 0,!0)],8,Me)):l(``,!0),be(`defs`,null,[xe(_e,{t:`linear`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`,id:`pill_gradient_${D.value}`,stops:[[`0%`,h(i)(j.value.useColorTrend?Z.value:j.value.stroke,M.value.opacity),1],[`100%`,N.value.backgroundColor,1]]},null,8,[`id`,`stops`])]),M.value.show&&J.value[0]?(d(),u(`g`,Ne,[j.value.smooth?(d(),u(`path`,{key:0,d:`M ${J.value[0].x},${G.value.bottom} ${h(ee)(J.value)} L ${J.value.at(-1).x},${G.value.bottom} Z`,fill:M.value.useGradient?`url(#pill_gradient_${D.value})`:h(i)(j.value.useColorTrend?Z.value:j.value.stroke,M.value.opacity),stroke:`none`},null,8,Pe)):(d(),u(`path`,{key:1,d:`M${$e.value}Z`,fill:M.value.useGradient?`url(#pill_gradient_${D.value})`:h(i)(j.value.useColorTrend?Z.value:j.value.stroke,M.value.opacity),stroke:`none`},null,8,Fe))])):l(``,!0),j.value.smooth&&J.value.length?(d(),u(`path`,{key:2,d:`M ${h(ee)(J.value)}`,stroke:j.value.useColorTrend?Z.value:j.value.stroke,fill:`none`,"stroke-width":j.value.strokeWidth,"stroke-linecap":j.value.strokeLinecap,"stroke-linejoin":j.value.strokeLinejoin},null,8,Ie)):l(``,!0),!j.value.smooth&&J.value.length?(d(),u(`path`,{key:3,d:et.value,stroke:j.value.useColorTrend?Z.value:j.value.stroke,fill:`none`,"stroke-width":j.value.strokeWidth,"stroke-linecap":j.value.strokeLinecap,"stroke-linejoin":j.value.strokeLinejoin},null,8,Le)):l(``,!0),h(P)?(d(),u(`path`,{key:4,fill:`#6A6A6A`,d:`M ${G.value.left/2+6}, ${Q.value+7} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2-7}, ${Q.value+14} Z`},null,8,Re)):(d(),u(`path`,{key:5,fill:Z.value,d:X.value===`positive`?`M ${G.value.left/2}, ${Q.value} ${G.value.left/2-7}, ${Q.value+12} ${G.value.left/2+7}, ${Q.value+12} Z`:X.value===`negative`?`M ${G.value.left/2}, ${Q.value+12} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2+7}, ${Q.value} Z`:`M ${G.value.left/2+6}, ${Q.value+7} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2-7}, ${Q.value+14} Z`},null,8,ze)),h(P)?(d(),u(`rect`,{key:6,x:G.value.left/2-A.value.fontSize-2,y:U.value/2+A.value.fontSize-2,width:A.value.fontSize*2,height:A.value.fontSize,fill:`#6A6A6A80`,rx:`3`},null,8,Be)):l(``,!0),!T.value&&!h(P)?(d(),u(`text`,{key:7,class:`vue-ui-sparktrend-progress-label`,x:G.value.left/2,y:U.value/2+A.value.fontSize*2,"text-anchor":`middle`,fill:A.value.useColorTrend?Z.value:A.value.color,"font-size":A.value.fontSize,"font-weight":A.value.bold?`bold`:`normal`},m(h(r)({p:Y.value>0?`+`:``,v:Y.value,s:`%`,r:A.value.rounding})),9,Ve)):l(``,!0),J.value.length&&J.value.at(-1).x!==void 0?(d(),u(`circle`,{key:8,stroke:N.value.backgroundColor,"stroke-width":2,cx:J.value.at(-1).x,cy:J.value.at(-1).y,r:4,fill:h(P)?`#6A6A6A`:Z.value},null,8,He)):l(``,!0),J.value.length&&J.value.at(-1).x!==void 0&&k.value.show?(d(),u(`text`,{key:9,"text-anchor":`middle`,x:J.value.at(-1).x,y:J.value.at(-1).y-k.value.fontSize/1.5,"font-size":k.value.fontSize,fill:k.value.useColorTrend?Z.value:k.value.color,"font-weight":k.value.bold?`bold`:`normal`},m(h(ie)(k.value.formatter,J.value.at(-1).value,h(r)({p:k.value.prefix,v:J.value.at(-1).value,s:k.value.suffix,r:k.value.rounding}),{datapoint:J.value.at(-1)})),9,Ue)):l(``,!0)],8,je)),e.$slots.source?(d(),u(`div`,{key:0,ref_key:`source`,ref:b,dir:`auto`},[p(e.$slots,`source`,{},void 0,!0)],512)):l(``,!0),p(e.$slots,`skeleton`,{},()=>[h(P)?(d(),ye(ge,{key:0})):l(``,!0)],!0)],12,ke))}},[[`__scopeId`,`data-v-c60cf883`]]);export{Oe as n,_ as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useAnimationFrame-D8gcRfnW.js";import{t as n}from"./resolveChartConfig-0IvbmIE_.js";import{$ as r,Jt as i,Mt as a,P as ee,X as te,at as ne,b as o,g as re,i as ie,in as ae,t as oe,zt as s}from"./lib-rPeBMZrn.js";import{c as se}from"./canvas-lib-22VpOI4_.js";import{n as ce,t as le}from"./useHints-C-TwxM0Y.js";import{t as ue}from"./useConfig-CBXrYhMI.js";import{t as de}from"./useLoading-BwiplGDB.js";import{t as fe}from"./useFitSvgText-C1QC4P5G.js";import{t as pe}from"./useResponsive-CENUxfEL.js";import{t as me}from"./usePrefersMotion-XLHwega2.js";import{t as he}from"./vue_ui_spark_trend-BgPQfeCz.js";import{t as ge}from"./BaseScanner-m6QR9rwD.js";import{t as _e}from"./DefGrad-DKMq1REY.js";import{t as ve}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{computed as c,createBlock as ye,createCommentVNode as l,createElementBlock as u,createElementVNode as be,createVNode as xe,defineAsyncComponent as Se,nextTick as Ce,normalizeStyle as we,onBeforeUnmount as Te,onMounted as Ee,openBlock as d,ref as f,renderSlot as p,toDisplayString as m,toRefs as De,unref as h,watch as g}from"vue";var Oe=/* @__PURE__ */ e({default:()=>_}),ke=[`id`,`aria-describedby`],Ae=[`id`],je=[`xmlns`,`viewBox`],Me=[`width`,`height`],Ne={key:1},Pe=[`d`,`fill`],Fe=[`d`,`fill`],Ie=[`d`,`stroke`,`stroke-width`,`stroke-linecap`,`stroke-linejoin`],Le=[`d`,`stroke`,`stroke-width`,`stroke-linecap`,`stroke-linejoin`],Re=[`d`],ze=[`fill`,`d`],Be=[`x`,`y`,`width`,`height`],Ve=[`x`,`y`,`fill`,`font-size`,`font-weight`],He=[`stroke`,`cx`,`cy`,`fill`],Ue=[`x`,`y`,`font-size`,`fill`,`font-weight`],_=/*#__PURE__*/ ve({__name:`vue-ui-spark-trend`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(e){let ve=Se(()=>import(`./PackageVersion-BbZ3wNGs.js`).then(e=>e.t)),{vue_ui_spark_trend:Oe}=ue(),_=me(),v=e,y=f(null),We=f(null),b=f(null),x=f(null),S=f(null),C=t(),w=0;function Ge(){w+=1,C.cancel(),x.value?.disconnect(),x.value=null,S.value=null}Te(Ge);let T=f(!1),E=t(),D=f(te()),O=f(L()),k=c(()=>O.value.style.dataLabel),A=c(()=>O.value.style.trendLabel),j=c(()=>O.value.style.line),M=c(()=>O.value.style.area),N=c(()=>O.value.style);ce({config:()=>O.value,dataset:()=>v.dataset,component:`VueUiSparkTrend`,rules:[le.emptyArray,{test:e=>e.length>1095,message:[`👀 The dataset has > 1095 datapoints. Above this threshold, the dataset is computed through an LTTB algorithm, to preserve the shape of the data without increasing the number of datapoints.`,``,`▶️ If you need this level of detail, you can change config.downsample.threshold and set a higher value. Note that performance will be impacted.`]}]});let Ke=c(()=>ae({defaultConfig:{style:{animation:{show:!1},backgroundColor:`#99999930`,line:{stroke:`#6A6A6A`,useColorTrend:!1},dataLabel:{show:!1,useColorTrend:!1,color:`#6A6A6A`}}},userConfig:O.value.skeletonConfig??{}})),{loading:P,FINAL_DATASET:F,manualLoading:I}=de({...De(v),FINAL_CONFIG:O,prepareConfig:L,skeletonDataset:v.config?.skeletonDataset??[1,2,3,5,8,13,21,34,55,89,144,233],skeletonConfig:ae({defaultConfig:O.value,userConfig:Ke.value})});function L(){return n(v.config,Oe,he)}let R=c(()=>a({data:F.value,threshold:O.value.downsample.threshold}));g(()=>v.config,e=>{O.value=L(),H.value=N.value.width,U.value=N.value.height,Je()},{deep:!0});function z(e){return e.map(e=>o(e))}let B=f(a({data:F.value,threshold:O.value.downsample.threshold}).map(e=>N.value.animation.show&&!_.value||[void 0,1/0,-1/0,null,NaN].includes(e)?null:e));g(R,e=>{E.cancel(),N.value.animation.show&&!_.value?B.value=Array(e.length).fill(null):B.value=e.map(e=>![void 0,1/0,-1/0,null].includes(e)&&!Number.isNaN(e)?e:null),V(),Ce(()=>$(`.vue-ui-sparktrend-progress-label`,6))},{deep:!0,immediate:!0}),g(()=>JSON.stringify(v.dataset),()=>{E.cancel(),I.value=s(v.dataset);let e=R.value;B.value=N.value.animation.show&&!_.value?Array(e.length).fill(null):e.map(e=>Number.isFinite(e)?e:null),V(),Ce(()=>$(`.vue-ui-sparktrend-progress-label`,6))},{deep:!1,immediate:!0});function V(){if(E.cancel(),E.isDisposed())return;T.value=!1;let e=N.value.animation.animationFrames,t=1e3/e,n=performance.now();if(!P.value&&N.value.animation.show&&!_.value&&Number.isFinite(e)&&e>0&&F.value.length>1){B.value=[];let e=0;function r(){T.value=!0;let i=performance.now(),a=i-n;a>t?(n=i-a%t,e<R.value.length?(B.value.push(R.value[e]),e+=1,E.request(r)):(E.cancel(),B.value=z(R.value),T.value=!1,$(`.vue-ui-sparktrend-progress-label`,6))):E.request(r)}r()}else B.value=z(R.value)}g([()=>N.value.animation.show,_],([e,t])=>{(!e||t)&&V()}),Ee(()=>{Je()});let qe=c(()=>O.value.debug);function Je(){if(Ge(),s(v.dataset)&&(ne({componentName:`VueUiSparkTrend`,type:`dataset`,debug:qe.value}),I.value=!0),s(v.dataset)||(I.value=!1),O.value.responsive&&y.value?.parentNode){let e=w,t=se(()=>{if(e!==w||C.isDisposed())return;let{width:t,height:n}=pe({chart:y.value,source:b.value});C.request(()=>{H.value=t,U.value=n})});x.value=new ResizeObserver(t),S.value=y.value.parentNode,x.value.observe(S.value)}V(),$(`.vue-ui-sparktrend-progress-label`,6)}let H=f(N.value.width),U=f(N.value.height),W=c(()=>({height:U.value,width:H.value})),G=c(()=>({top:N.value.padding.top,left:N.value.padding.left,right:W.value.width-N.value.padding.right,bottom:W.value.height-N.value.padding.bottom,height:W.value.height-(N.value.padding.top+N.value.padding.bottom)-(k.value.show?k.value.fontSize:0),width:W.value.width-(N.value.padding.left+N.value.padding.right)})),K=c(()=>{let e=z(R.value).filter(Number.isFinite);if(!e.length)return{max:0,min:0};let t=e[0],n=e[0];for(let r=1;r<e.length;r++){let i=e[r];i>t&&(t=i),i<n&&(n=i)}return{max:t,min:n}}),Ye=c(()=>{let e=R.value,t=e.length?e[e.length-1]:`x`;return[D.value,e.length,Number.isFinite(t)?t:`x`,O.value.downsample.threshold,j.value.smooth?`s`:`l`].join(`-`)}),q=c(()=>{let e=K.value.min>=0?0:K.value.min;return Math.abs(e)}),Xe=c(()=>K.value.max+q.value);function Ze(e){return e/Xe.value}let Qe=c(()=>R.value.length),J=c(()=>B.value.map((e,t)=>{let n=isNaN(e)||[void 0,null,`NaN`,NaN,1/0,-1/0].includes(e)?0:e||0;return{value:o(e),absoluteValue:o(n),plotValue:o(n+q.value),toMax:Ze(n+q.value),x:G.value.left+o(t*(G.value.width/(Qe.value-1)))-N.value.padding.right,y:G.value.bottom-o(G.value.height*Ze(n+q.value))}})),Y=c(()=>{let e=z(R.value);return A.value.trendType===`global`?re(e):A.value.trendType===`n-1`&&e.length>1?(e.at(-1)/e.at(-2)-1)*100:A.value.trendType===`lastToFirst`?(e.at(-1)/e[0]-1)*100:0}),X=c(()=>T.value||Y.value===0?`neutral`:Y.value>0?`positive`:`negative`),Z=c(()=>N.value.arrow.colors[X.value]),$e=c(()=>{let e={x:J.value[0].x,y:W.value.height-6},t={x:J.value[J.value.length-1].x,y:W.value.height-6},n=[];return J.value.forEach(e=>{n.push(`${e.x},${e.y} `)}),[e.x,e.y,...n,t.x,t.y].toString()}),et=c(()=>{let e=[];return J.value.forEach(t=>{e.push(`${t.x},${t.y} `)}),`M ${e.toString()}`}),Q=c(()=>U.value/2-A.value.fontSize),tt=c(()=>G.value.left*.8),{fitText:$}=fe({svgRef:We,unitWidth:tt,fontSize:A.value.fontSize}),nt=c(()=>{if(P.value||T.value)return`Trend chart loading`;let e=J.value?.at(-1),t=e?.value,n=r({p:Y.value>0?`+`:``,v:Y.value,s:`%`,r:A.value.rounding}),i=t==null?`not available`:ie(k.value.formatter,t,r({p:k.value.prefix,v:t,s:k.value.suffix,r:k.value.rounding}),{datapoint:e});return`Progression ${X.value===`positive`?`up ${n}`:X.value===`negative`?`down ${n}`:`stable at ${n}`}. Last value ${i}.`}),rt=c(()=>`sparktrend-a11y-${D.value}`);return(e,t)=>(d(),u(`div`,{ref_key:`sparkTrendChart`,ref:y,class:`vue-data-ui-component vue-ui-spark-trend`,id:D.value,style:we(`width:100%;font-family:${N.value.fontFamily};background:${N.value.backgroundColor}`),role:`img`,"aria-describedby":rt.value},[be(`p`,{id:rt.value,class:`sr-only`,"aria-live":`polite`},m(nt.value),9,Ae),(d(),u(`svg`,{key:Ye.value,ref_key:`svgRef`,ref:We,xmlns:h(oe),viewBox:`0 0 ${W.value.width} ${W.value.height}`,style:`width:100%;background:transparent;overflow:visible`,"aria-hidden":`true`},[xe(h(ve)),e.$slots[`chart-background`]?(d(),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`}},[p(e.$slots,`chart-background`,{},void 0,!0)],8,Me)):l(``,!0),be(`defs`,null,[xe(_e,{t:`linear`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`,id:`pill_gradient_${D.value}`,stops:[[`0%`,h(i)(j.value.useColorTrend?Z.value:j.value.stroke,M.value.opacity),1],[`100%`,N.value.backgroundColor,1]]},null,8,[`id`,`stops`])]),M.value.show&&J.value[0]?(d(),u(`g`,Ne,[j.value.smooth?(d(),u(`path`,{key:0,d:`M ${J.value[0].x},${G.value.bottom} ${h(ee)(J.value)} L ${J.value.at(-1).x},${G.value.bottom} Z`,fill:M.value.useGradient?`url(#pill_gradient_${D.value})`:h(i)(j.value.useColorTrend?Z.value:j.value.stroke,M.value.opacity),stroke:`none`},null,8,Pe)):(d(),u(`path`,{key:1,d:`M${$e.value}Z`,fill:M.value.useGradient?`url(#pill_gradient_${D.value})`:h(i)(j.value.useColorTrend?Z.value:j.value.stroke,M.value.opacity),stroke:`none`},null,8,Fe))])):l(``,!0),j.value.smooth&&J.value.length?(d(),u(`path`,{key:2,d:`M ${h(ee)(J.value)}`,stroke:j.value.useColorTrend?Z.value:j.value.stroke,fill:`none`,"stroke-width":j.value.strokeWidth,"stroke-linecap":j.value.strokeLinecap,"stroke-linejoin":j.value.strokeLinejoin},null,8,Ie)):l(``,!0),!j.value.smooth&&J.value.length?(d(),u(`path`,{key:3,d:et.value,stroke:j.value.useColorTrend?Z.value:j.value.stroke,fill:`none`,"stroke-width":j.value.strokeWidth,"stroke-linecap":j.value.strokeLinecap,"stroke-linejoin":j.value.strokeLinejoin},null,8,Le)):l(``,!0),h(P)?(d(),u(`path`,{key:4,fill:`#6A6A6A`,d:`M ${G.value.left/2+6}, ${Q.value+7} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2-7}, ${Q.value+14} Z`},null,8,Re)):(d(),u(`path`,{key:5,fill:Z.value,d:X.value===`positive`?`M ${G.value.left/2}, ${Q.value} ${G.value.left/2-7}, ${Q.value+12} ${G.value.left/2+7}, ${Q.value+12} Z`:X.value===`negative`?`M ${G.value.left/2}, ${Q.value+12} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2+7}, ${Q.value} Z`:`M ${G.value.left/2+6}, ${Q.value+7} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2-7}, ${Q.value+14} Z`},null,8,ze)),h(P)?(d(),u(`rect`,{key:6,x:G.value.left/2-A.value.fontSize-2,y:U.value/2+A.value.fontSize-2,width:A.value.fontSize*2,height:A.value.fontSize,fill:`#6A6A6A80`,rx:`3`},null,8,Be)):l(``,!0),!T.value&&!h(P)?(d(),u(`text`,{key:7,class:`vue-ui-sparktrend-progress-label`,x:G.value.left/2,y:U.value/2+A.value.fontSize*2,"text-anchor":`middle`,fill:A.value.useColorTrend?Z.value:A.value.color,"font-size":A.value.fontSize,"font-weight":A.value.bold?`bold`:`normal`},m(h(r)({p:Y.value>0?`+`:``,v:Y.value,s:`%`,r:A.value.rounding})),9,Ve)):l(``,!0),J.value.length&&J.value.at(-1).x!==void 0?(d(),u(`circle`,{key:8,stroke:N.value.backgroundColor,"stroke-width":2,cx:J.value.at(-1).x,cy:J.value.at(-1).y,r:4,fill:h(P)?`#6A6A6A`:Z.value},null,8,He)):l(``,!0),J.value.length&&J.value.at(-1).x!==void 0&&k.value.show?(d(),u(`text`,{key:9,"text-anchor":`middle`,x:J.value.at(-1).x,y:J.value.at(-1).y-k.value.fontSize/1.5,"font-size":k.value.fontSize,fill:k.value.useColorTrend?Z.value:k.value.color,"font-weight":k.value.bold?`bold`:`normal`},m(h(ie)(k.value.formatter,J.value.at(-1).value,h(r)({p:k.value.prefix,v:J.value.at(-1).value,s:k.value.suffix,r:k.value.rounding}),{datapoint:J.value.at(-1)})),9,Ue)):l(``,!0)],8,je)),e.$slots.source?(d(),u(`div`,{key:0,ref_key:`source`,ref:b,dir:`auto`},[p(e.$slots,`source`,{},void 0,!0)],512)):l(``,!0),p(e.$slots,`skeleton`,{},()=>[h(P)?(d(),ye(ge,{key:0})):l(``,!0)],!0)],12,ke))}},[[`__scopeId`,`data-v-c60cf883`]]);export{Oe as n,_ as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useAnimationFrame-D8gcRfnW.js";import{n}from"./resolveChartConfig-0IvbmIE_.js";import{$ as r,Ht as i,Jt as a,S as ee,X as te,Yt as ne,at as o,i as s,in as c,t as re,w as ie,yt as ae,zt as oe}from"./lib-rPeBMZrn.js";import{n as se,t as ce}from"./useHints-C-TwxM0Y.js";import{t as le}from"./useConfig-9oDGTWWG.js";import{t as ue}from"./useLoading-BwiplGDB.js";import{t as de}from"./usePrefersMotion-XLHwega2.js";import{t as fe}from"./vue_ui_sparkbar-CvcZ5nwT.js";import{t as pe}from"./BaseScanner-m6QR9rwD.js";import{t as me}from"./DefGrad-DKMq1REY.js";import{Fragment as l,computed as u,createBlock as he,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createVNode as m,defineAsyncComponent as h,guardReactiveProps as ge,mergeProps as _e,nextTick as ve,normalizeProps as g,normalizeStyle as _,onMounted as v,openBlock as y,ref as b,renderList as ye,renderSlot as x,toDisplayString as S,toRefs as be,unref as C,useSlots as w,watch as T}from"vue";var E=/* @__PURE__ */ e({default:()=>P}),D=[`onClick`,`onMouseenter`,`onMouseleave`],O={key:1,class:`vue-ui-sparkbar-datapoint-value`},k=[`xmlns`,`viewBox`],A=[`height`,`width`,`fill`,`rx`],j=[`height`,`width`,`fill`,`rx`],M=[`height`,`width`,`fill`,`rx`],N={key:2,ref:`source`,dir:`auto`},P={__name:`vue-ui-sparkbar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:null}},emits:[`selectDatapoint`],setup(e,{emit:E}){let P=h(()=>import(`./PackageVersion-B9qiUJPH.js`).then(e=>e.t)),{vue_ui_sparkbar:xe}=le(),F=de(),I=e,Se=w(),L=b(te()),R=b(G()),z=u(()=>R.value.style.bar),B=u(()=>R.value.style.labels),V=u(()=>R.value.style),H=u(()=>R.value.debug);v(()=>{Se[`chart-background`]&&H.value&&console.warn(`VueUiSparkbar does not support the #chart-background slot.`)}),se({config:()=>R.value,dataset:()=>I.dataset,component:`VueUiSparkbar`,rules:[ce.noHint]});let Ce=u(()=>c({defaultConfig:{style:{backgroundColor:`#99999930`,animation:{show:!1},layout:{independant:!0},gutter:{backgroundColor:`#6A6A6A`,opacity:50},bar:{gradient:{underlayerColor:`#6A6A6A`}}}},userConfig:R.value.skeletonConfig??{}})),{loading:U,FINAL_DATASET:W,manualLoading:we}=ue({...be(I),FINAL_CONFIG:R,prepareConfig:G,skeletonDataset:I.config?.skeletonDataset??[{name:`_`,value:21,target:25,color:`#808080`},{name:`_`,value:13,target:25,color:`#ADADAD`},{name:`_`,value:8,target:25,color:`#DBDBDB`}],skeletonConfig:c({defaultConfig:R.value,userConfig:Ce.value})});function G(){return n(I.config,xe,fe)}T(()=>I.config,e=>{R.value=G()},{deep:!0});let Te=u(()=>ie(R.value.customPalette)),K=b(W.value.map(e=>({...e,value:V.value.animation.show?0:e.value||0,formatter:e.formatter||null}))),q=t();v(async()=>{oe(I.dataset)&&o({componentName:`VueUiSparkbar`,type:`dataset`,debug:H.value}),J()});function J(){if(q.cancel(),!q.isDisposed()){if(V.value.animation.show&&!F.value&&Number.isFinite(V.value.animation.animationFrames)&&V.value.animation.animationFrames>0){let e=V.value.animation.animationFrames,t=W.value.map((t,n)=>t.value/e),n=W.value.map(e=>e.value||0).reduce((e,t)=>e+t,0),r=0;function i(){r+=n/e,r<n?(K.value=K.value.map((e,n)=>({...e,value:e.value+=t[n]})),q.request(i)):K.value=W.value.map(e=>({...e,value:e.value||0,formatter:e.formatter||null}))}i()}else K.value=W.value.map(e=>({...e,value:e.value||0,formatter:e.formatter||null}))}}T(()=>W.value,async e=>{q.cancel(),K.value=W.value.map(e=>({...e,value:V.value.animation.show&&!F.value?0:e.value||0,formatter:e.formatter||null})),ve(J)},{deep:!0}),T([()=>V.value.animation.show,F],([e,t])=>{(!e||t)&&J()});let Y=b({width:500,height:16}),X=u(()=>Math.max(...W.value.map(e=>e.value))),Ee=u(()=>(H.value&&W.value.forEach((e,t)=>{ae({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{o({componentName:`VueUiSparkbar`,type:`datasetSerieAttribute`,property:e,index:t})})}),K.value.map((e,t)=>({...e,value:e.value||0,color:ee(e.color)||Te.value[t]||i[t]||i[t%i.length]}))));function De(e){return e/X.value}function Z(e){return V.value.layout.independant?e.target?e.value/e.target:V.value.layout.percentage?e.value>100?1:e.value/100:V.value.layout.target===0?1:e.value/V.value.layout.target:De(e.value)}function Q(e){return V.value.layout.independant&&e.target||V.value.layout.target}let Oe=E;function ke(e,t){Oe(`selectDatapoint`,{datapoint:e,index:t}),R.value.events.datapointClick&&R.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Ae(e,t){R.value.events.datapointEnter&&R.value.events.datapointEnter({datapoint:e,seriesIndex:t})}function je(e,t){R.value.events.datapointLeave&&R.value.events.datapointLeave({datapoint:e,seriesIndex:t})}let $=u(()=>z.value.borderRadius==null?Y.value.height/2:Math.min(Y.value.height/2,z.value.borderRadius));return(e,t)=>(y(),f(`div`,{class:`vue-data-ui-component vue-ui-sparkbar`,style:_({width:`100%`,position:`relative`,fontFamily:V.value.fontFamily,background:I.backgroundOpacity===null?V.value.backgroundColor:C(a)(V.value.backgroundColor,I.backgroundOpacity)})},[e.$slots.title?x(e.$slots,`title`,g(ge({title:{...e.title,title:V.value.title.text,subtitle:V.value.title.subtitle.text}})),void 0,void 0,0):d(``,!0),!e.$slots.title&&V.value.title.text?(y(),f(`div`,{key:1,class:`vue-ui-sparkbar-title-container`,style:_({background:V.value.title.backgroundColor,margin:V.value.title.margin,textAlign:V.value.title.textAlign})},[p(`div`,{class:`vue-ui-sparkbar-title`,style:_({fontSize:V.value.title.fontSize+`px`,color:V.value.title.color,fontWeight:V.value.title.bold?`bold`:`normal`})},S(V.value.title.text),5),V.value.title.subtitle.text?(y(),f(`div`,{key:0,class:`vue-ui-sparkbar-subtitle`,style:_({fontSize:V.value.title.subtitle.fontSize+`px`,color:V.value.title.subtitle.color,fontWeight:V.value.title.subtitle.bold?`bold`:`normal`})},S(V.value.title.subtitle.text),5)):d(``,!0)],4)):d(``,!0),(y(!0),f(l,null,ye(Ee.value,(t,n)=>(y(),f(`div`,{style:_(`display:flex !important;${[`left`,`right`].includes(B.value.name.position)?`flex-direction: ${B.value.name.position===`right`?`row-reverse`:`row`} !important`:`flex-direction:column !important`};gap:${V.value.gap}px !important;align-items:center;${C(W).length>0&&n!==C(W).length-1?`margin-bottom:6px`:``}`),onClick:e=>ke(t,n),onMouseenter:e=>Ae(t,n),onMouseleave:e=>je(t,n)},[C(U)?d(``,!0):x(e.$slots,`data-label`,_e({ref_for:!0},{bar:{...t,target:Q(t),valueLabel:C(s)(t.formatter,t.value,C(r)({p:t.prefix||``,v:t.value,s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:n}),targetLabel:C(s)(t.formatter,Q(t),C(r)({p:t.prefix||``,v:Q(t),s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:n})}}),void 0,void 0,0),!e.$slots[`data-label`]||C(U)?(y(),f(`div`,{key:1,style:_({display:`flex`,justifyContent:[`right`,`top-right`].includes(B.value.name.position)?`flex-end`:[`top-center`].includes(B.value.name.position)?`center`:`flex-start`,alignItems:`center`,width:B.value.name.width,color:B.value.name.color,fontSize:B.value.fontSize+`px`,fontWeight:B.value.name.bold?`bold`:`normal`,flexWrap:`wrap`})},[C(U)?(y(),f(`div`,{key:0,class:`vue-ui-sparkbar-skeleton-name`,style:_({width:`60px`,height:B.value.fontSize+`px`,borderRadius:B.value.fontSize/4+`px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:`5px`})},[p(`div`,{style:_({height:`100%`,width:`40px`,borderRadius:B.value.fontSize/4+`px`,backgroundColor:`#6A6A6A80`})},null,4),p(`div`,{style:_({height:`100%`,width:`15px`,borderRadius:B.value.fontSize/4+`px`,backgroundColor:`#6A6A6A80`})},null,4)],4)):(y(),f(l,{key:1},[p(`span`,null,S(t.name),1),B.value.value.show?(y(),f(`span`,{key:0,style:_(`font-weight:${B.value.value.bold?`bold`:`normal`}`),class:`vue-ui-sparkbar-datapoint-name`},`: `+S(C(s)(t.formatter,t.value,C(r)({p:t.prefix||``,v:t.value,s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:n})),5)):d(``,!0),V.value.layout.showTargetValue?(y(),f(`span`,O,S(` `+V.value.layout.targetValueText)+` `+S(C(s)(t.formatter,Q(t),C(r)({p:t.prefix||``,v:Q(t),s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:n})),1)):d(``,!0)],64))],4)):d(``,!0),(y(),f(`svg`,{role:`img`,xmlns:C(re),viewBox:`0 0 ${Y.value.width} ${Y.value.height}`,width:`100%`},[m(C(P)),p(`defs`,null,[m(me,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`sparkbar_gradient_${n}_${L.value}`,stops:[[`0%`,C(a)(C(ne)(t.color,.03),100-z.value.gradient.intensity),1],[`100%`,t.color,1]]},null,8,[`id`,`stops`])]),p(`rect`,{height:Y.value.height,width:Y.value.width,x:0,y:0,fill:C(a)(V.value.gutter.backgroundColor,V.value.gutter.opacity),rx:$.value},null,8,A),p(`rect`,{height:Y.value.height,width:Y.value.width*Z(t),x:0,y:0,fill:z.value.gradient.underlayerColor,rx:$.value},null,8,j),p(`rect`,{height:Y.value.height,width:Y.value.width*Z(t),x:0,y:0,fill:z.value.gradient.show?`url(#sparkbar_gradient_${n}_${L.value})`:t.color,rx:$.value},null,8,M)],8,k))],44,D))),256)),e.$slots.source?(y(),f(`div`,N,[x(e.$slots,`source`)],512)):d(``,!0),C(U)?(y(),he(pe,{key:3})):d(``,!0)],4))}};export{E as n,P as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useAnimationFrame-D8gcRfnW.js";import{n}from"./resolveChartConfig-0IvbmIE_.js";import{$ as r,Ht as i,Jt as a,S as ee,X as te,Yt as ne,at as o,i as s,in as c,t as re,w as ie,yt as ae,zt as oe}from"./lib-rPeBMZrn.js";import{n as se,t as ce}from"./useHints-C-TwxM0Y.js";import{t as le}from"./useConfig-CBXrYhMI.js";import{t as ue}from"./useLoading-BwiplGDB.js";import{t as de}from"./usePrefersMotion-XLHwega2.js";import{t as fe}from"./vue_ui_sparkbar-CvcZ5nwT.js";import{t as pe}from"./BaseScanner-m6QR9rwD.js";import{t as me}from"./DefGrad-DKMq1REY.js";import{Fragment as l,computed as u,createBlock as he,createCommentVNode as d,createElementBlock as f,createElementVNode as p,createVNode as m,defineAsyncComponent as h,guardReactiveProps as ge,mergeProps as _e,nextTick as ve,normalizeProps as g,normalizeStyle as _,onMounted as v,openBlock as y,ref as b,renderList as ye,renderSlot as x,toDisplayString as S,toRefs as be,unref as C,useSlots as w,watch as T}from"vue";var E=/* @__PURE__ */ e({default:()=>P}),D=[`onClick`,`onMouseenter`,`onMouseleave`],O={key:1,class:`vue-ui-sparkbar-datapoint-value`},k=[`xmlns`,`viewBox`],A=[`height`,`width`,`fill`,`rx`],j=[`height`,`width`,`fill`,`rx`],M=[`height`,`width`,`fill`,`rx`],N={key:2,ref:`source`,dir:`auto`},P={__name:`vue-ui-sparkbar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:null}},emits:[`selectDatapoint`],setup(e,{emit:E}){let P=h(()=>import(`./PackageVersion-BbZ3wNGs.js`).then(e=>e.t)),{vue_ui_sparkbar:xe}=le(),F=de(),I=e,Se=w(),L=b(te()),R=b(G()),z=u(()=>R.value.style.bar),B=u(()=>R.value.style.labels),V=u(()=>R.value.style),H=u(()=>R.value.debug);v(()=>{Se[`chart-background`]&&H.value&&console.warn(`VueUiSparkbar does not support the #chart-background slot.`)}),se({config:()=>R.value,dataset:()=>I.dataset,component:`VueUiSparkbar`,rules:[ce.noHint]});let Ce=u(()=>c({defaultConfig:{style:{backgroundColor:`#99999930`,animation:{show:!1},layout:{independant:!0},gutter:{backgroundColor:`#6A6A6A`,opacity:50},bar:{gradient:{underlayerColor:`#6A6A6A`}}}},userConfig:R.value.skeletonConfig??{}})),{loading:U,FINAL_DATASET:W,manualLoading:we}=ue({...be(I),FINAL_CONFIG:R,prepareConfig:G,skeletonDataset:I.config?.skeletonDataset??[{name:`_`,value:21,target:25,color:`#808080`},{name:`_`,value:13,target:25,color:`#ADADAD`},{name:`_`,value:8,target:25,color:`#DBDBDB`}],skeletonConfig:c({defaultConfig:R.value,userConfig:Ce.value})});function G(){return n(I.config,xe,fe)}T(()=>I.config,e=>{R.value=G()},{deep:!0});let Te=u(()=>ie(R.value.customPalette)),K=b(W.value.map(e=>({...e,value:V.value.animation.show?0:e.value||0,formatter:e.formatter||null}))),q=t();v(async()=>{oe(I.dataset)&&o({componentName:`VueUiSparkbar`,type:`dataset`,debug:H.value}),J()});function J(){if(q.cancel(),!q.isDisposed()){if(V.value.animation.show&&!F.value&&Number.isFinite(V.value.animation.animationFrames)&&V.value.animation.animationFrames>0){let e=V.value.animation.animationFrames,t=W.value.map((t,n)=>t.value/e),n=W.value.map(e=>e.value||0).reduce((e,t)=>e+t,0),r=0;function i(){r+=n/e,r<n?(K.value=K.value.map((e,n)=>({...e,value:e.value+=t[n]})),q.request(i)):K.value=W.value.map(e=>({...e,value:e.value||0,formatter:e.formatter||null}))}i()}else K.value=W.value.map(e=>({...e,value:e.value||0,formatter:e.formatter||null}))}}T(()=>W.value,async e=>{q.cancel(),K.value=W.value.map(e=>({...e,value:V.value.animation.show&&!F.value?0:e.value||0,formatter:e.formatter||null})),ve(J)},{deep:!0}),T([()=>V.value.animation.show,F],([e,t])=>{(!e||t)&&J()});let Y=b({width:500,height:16}),X=u(()=>Math.max(...W.value.map(e=>e.value))),Ee=u(()=>(H.value&&W.value.forEach((e,t)=>{ae({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{o({componentName:`VueUiSparkbar`,type:`datasetSerieAttribute`,property:e,index:t})})}),K.value.map((e,t)=>({...e,value:e.value||0,color:ee(e.color)||Te.value[t]||i[t]||i[t%i.length]}))));function De(e){return e/X.value}function Z(e){return V.value.layout.independant?e.target?e.value/e.target:V.value.layout.percentage?e.value>100?1:e.value/100:V.value.layout.target===0?1:e.value/V.value.layout.target:De(e.value)}function Q(e){return V.value.layout.independant&&e.target||V.value.layout.target}let Oe=E;function ke(e,t){Oe(`selectDatapoint`,{datapoint:e,index:t}),R.value.events.datapointClick&&R.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Ae(e,t){R.value.events.datapointEnter&&R.value.events.datapointEnter({datapoint:e,seriesIndex:t})}function je(e,t){R.value.events.datapointLeave&&R.value.events.datapointLeave({datapoint:e,seriesIndex:t})}let $=u(()=>z.value.borderRadius==null?Y.value.height/2:Math.min(Y.value.height/2,z.value.borderRadius));return(e,t)=>(y(),f(`div`,{class:`vue-data-ui-component vue-ui-sparkbar`,style:_({width:`100%`,position:`relative`,fontFamily:V.value.fontFamily,background:I.backgroundOpacity===null?V.value.backgroundColor:C(a)(V.value.backgroundColor,I.backgroundOpacity)})},[e.$slots.title?x(e.$slots,`title`,g(ge({title:{...e.title,title:V.value.title.text,subtitle:V.value.title.subtitle.text}})),void 0,void 0,0):d(``,!0),!e.$slots.title&&V.value.title.text?(y(),f(`div`,{key:1,class:`vue-ui-sparkbar-title-container`,style:_({background:V.value.title.backgroundColor,margin:V.value.title.margin,textAlign:V.value.title.textAlign})},[p(`div`,{class:`vue-ui-sparkbar-title`,style:_({fontSize:V.value.title.fontSize+`px`,color:V.value.title.color,fontWeight:V.value.title.bold?`bold`:`normal`})},S(V.value.title.text),5),V.value.title.subtitle.text?(y(),f(`div`,{key:0,class:`vue-ui-sparkbar-subtitle`,style:_({fontSize:V.value.title.subtitle.fontSize+`px`,color:V.value.title.subtitle.color,fontWeight:V.value.title.subtitle.bold?`bold`:`normal`})},S(V.value.title.subtitle.text),5)):d(``,!0)],4)):d(``,!0),(y(!0),f(l,null,ye(Ee.value,(t,n)=>(y(),f(`div`,{style:_(`display:flex !important;${[`left`,`right`].includes(B.value.name.position)?`flex-direction: ${B.value.name.position===`right`?`row-reverse`:`row`} !important`:`flex-direction:column !important`};gap:${V.value.gap}px !important;align-items:center;${C(W).length>0&&n!==C(W).length-1?`margin-bottom:6px`:``}`),onClick:e=>ke(t,n),onMouseenter:e=>Ae(t,n),onMouseleave:e=>je(t,n)},[C(U)?d(``,!0):x(e.$slots,`data-label`,_e({ref_for:!0},{bar:{...t,target:Q(t),valueLabel:C(s)(t.formatter,t.value,C(r)({p:t.prefix||``,v:t.value,s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:n}),targetLabel:C(s)(t.formatter,Q(t),C(r)({p:t.prefix||``,v:Q(t),s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:n})}}),void 0,void 0,0),!e.$slots[`data-label`]||C(U)?(y(),f(`div`,{key:1,style:_({display:`flex`,justifyContent:[`right`,`top-right`].includes(B.value.name.position)?`flex-end`:[`top-center`].includes(B.value.name.position)?`center`:`flex-start`,alignItems:`center`,width:B.value.name.width,color:B.value.name.color,fontSize:B.value.fontSize+`px`,fontWeight:B.value.name.bold?`bold`:`normal`,flexWrap:`wrap`})},[C(U)?(y(),f(`div`,{key:0,class:`vue-ui-sparkbar-skeleton-name`,style:_({width:`60px`,height:B.value.fontSize+`px`,borderRadius:B.value.fontSize/4+`px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:`5px`})},[p(`div`,{style:_({height:`100%`,width:`40px`,borderRadius:B.value.fontSize/4+`px`,backgroundColor:`#6A6A6A80`})},null,4),p(`div`,{style:_({height:`100%`,width:`15px`,borderRadius:B.value.fontSize/4+`px`,backgroundColor:`#6A6A6A80`})},null,4)],4)):(y(),f(l,{key:1},[p(`span`,null,S(t.name),1),B.value.value.show?(y(),f(`span`,{key:0,style:_(`font-weight:${B.value.value.bold?`bold`:`normal`}`),class:`vue-ui-sparkbar-datapoint-name`},`: `+S(C(s)(t.formatter,t.value,C(r)({p:t.prefix||``,v:t.value,s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:n})),5)):d(``,!0),V.value.layout.showTargetValue?(y(),f(`span`,O,S(` `+V.value.layout.targetValueText)+` `+S(C(s)(t.formatter,Q(t),C(r)({p:t.prefix||``,v:Q(t),s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:n})),1)):d(``,!0)],64))],4)):d(``,!0),(y(),f(`svg`,{role:`img`,xmlns:C(re),viewBox:`0 0 ${Y.value.width} ${Y.value.height}`,width:`100%`},[m(C(P)),p(`defs`,null,[m(me,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`sparkbar_gradient_${n}_${L.value}`,stops:[[`0%`,C(a)(C(ne)(t.color,.03),100-z.value.gradient.intensity),1],[`100%`,t.color,1]]},null,8,[`id`,`stops`])]),p(`rect`,{height:Y.value.height,width:Y.value.width,x:0,y:0,fill:C(a)(V.value.gutter.backgroundColor,V.value.gutter.opacity),rx:$.value},null,8,A),p(`rect`,{height:Y.value.height,width:Y.value.width*Z(t),x:0,y:0,fill:z.value.gradient.underlayerColor,rx:$.value},null,8,j),p(`rect`,{height:Y.value.height,width:Y.value.width*Z(t),x:0,y:0,fill:z.value.gradient.show?`url(#sparkbar_gradient_${n}_${L.value})`:t.color,rx:$.value},null,8,M)],8,k))],44,D))),256)),e.$slots.source?(y(),f(`div`,N,[x(e.$slots,`source`)],512)):d(``,!0),C(U)?(y(),he(pe,{key:3})):d(``,!0)],4))}};export{E as n,P as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./resolveChartConfig-0IvbmIE_.js";import{$ as n,Tt as r,X as i,at as a,b as o,i as s,in as c,t as l,yt as u,zt as ee}from"./lib-rPeBMZrn.js";import{n as te,t as ne}from"./useHints-C-TwxM0Y.js";import{t as re}from"./useConfig-9oDGTWWG.js";import{t as ie}from"./useLoading-BwiplGDB.js";import{t as ae}from"./useChartAccessibility-DOMuYJfm.js";import{t as oe}from"./usePrefersMotion-XLHwega2.js";import{t as se}from"./vue_ui_sparkgauge-D3xirz2w.js";import{t as ce}from"./BaseScanner-m6QR9rwD.js";import{t as le}from"./DefGrad-DKMq1REY.js";import{computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createVNode as g,defineAsyncComponent as ue,normalizeClass as de,normalizeStyle as _,onBeforeUnmount as fe,onMounted as v,openBlock as y,ref as b,renderSlot as x,toDisplayString as S,toRefs as pe,unref as C,watch as w}from"vue";var T=/* @__PURE__ */ e({default:()=>j}),E=[`xmlns`,`viewBox`],me=[`width`,`height`],he=[`d`,`stroke`,`stroke-linecap`],D=[`d`,`stroke`,`stroke-linecap`,`stroke-dashoffset`],O=[`x`,`y`,`width`,`height`],k=[`x`,`y`,`font-size`,`fill`,`font-weight`],A={key:2,ref:`source`,dir:`auto`},j={__name:`vue-ui-sparkgauge`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(e){let T=ue(()=>import(`./PackageVersion-B9qiUJPH.js`).then(e=>e.t)),{vue_ui_sparkgauge:j}=re(),M=oe(),N=b(null),P=e,F=b(i()),I=b(W()),L=d(()=>I.value.style.dataLabel),R=d(()=>I.value.style);te({config:()=>I.value,dataset:()=>P.dataset,component:`VueUiSparkgauge`,rules:[ne.noHint]});let z=d(()=>R.value.animation.show&&!M.value),ge=d(()=>c({defaultConfig:{style:{animation:{show:!1},background:`#99999930`,colors:{min:`#CACACA`,max:`#6A6A6A`},track:{autoColor:!0},gutter:{color:`#6A6A6A80`}}},userConfig:I.value.skeletonConfig??{}})),{loading:B,FINAL_DATASET:V}=ie({...pe(P),FINAL_CONFIG:I,prepareConfig:W,skeletonDataset:P.config?.skeletonDataset??{value:0,min:-1,max:1,title:``},skeletonConfig:c({defaultConfig:I.value,userConfig:ge.value})}),H=d(()=>{let e=V.value.min??0,t=V.value.max??0;return{min:e,max:t,diff:t-e}}),U=d(()=>H.value.diff/R.value.animation.speedMs),{svgRef:_e}=ae({config:{text:P.dataset?.title||``}});function W(){return t(P.config,j,se)}v(()=>{K()});let G=d(()=>I.value.debug);function K(){ee(P.dataset)?a({componentName:`VueUiSparkgauge`,type:`dataset`,debug:G.value}):u({datasetObject:P.dataset,requiredAttributes:[`value`,`min`,`max`]}).forEach(e=>{a({componentName:`VueUiSparkgauge`,type:`datasetAttribute`,property:e,debug:G.value})})}w(()=>P.config,()=>{I.value=W(),J.value=z.value?H.value.min:V.value.value,K()},{deep:!0});let q=d(()=>({height:R.value.height,width:128,base:R.value.basePosition})),J=b(z.value?H.value.min:V.value.value);w([()=>V.value.value,z],([e,t])=>{Y(e||0,t)},{immediate:!0});let ve=d(()=>J.value>H.value.max?H.value.max:J.value<H.value.min?H.value.min:J.value);v(()=>{Y(V.value.value||0)});function Y(e,t=z.value){if(N.value&&=(cancelAnimationFrame(N.value),null),!t){J.value=e;return}function n(){J.value<e?J.value=Math.min(J.value+U.value,e):J.value>e&&(J.value=Math.max(J.value-U.value,e)),J.value===e?N.value=null:N.value=requestAnimationFrame(n)}n()}let X=d(()=>V.value.title??``),Z=d(()=>{let e=H.value.diff;if(!isFinite(e)||e===0)return 0;let t=H.value.min,n=ve.value;return n>=0?(n-t)/e:(Math.abs(t)-Math.abs(n))/e}),Q=d(()=>r(R.value.colors.min,R.value.colors.max,H.value.min,H.value.max,J.value)),$=d(()=>L.value.autoColor?Q.value:L.value.color),ye=d(()=>R.value.track.autoColor?Q.value:R.value.track.color);return fe(()=>{N.value&&cancelAnimationFrame(N.value)}),(e,t)=>(y(),m(`div`,{class:`vue-data-ui-component vue-ui-sparkgauge`,style:_(`font-family:${R.value.fontFamily};width: 100%; background:${R.value.background}`)},[R.value.title.show&&X.value&&R.value.title.position===`top`?(y(),m(`div`,{key:0,class:`vue-data-ui-sparkgauge-label`,style:_(`font-size:${R.value.title.fontSize}px;text-align:${R.value.title.textAlign};font-weight:${R.value.title.bold?`bold`:`normal`};color:${R.value.title.color}`)},S(X.value),5)):p(``,!0),(y(),m(`svg`,{ref_key:`svgRef`,ref:_e,xmlns:C(l),viewBox:`0 0 ${q.value.width} ${q.value.height}`,style:`overflow: visible; background:transparent; width:100%;`},[g(C(T)),e.$slots[`chart-background`]&&!C(B)?(y(),m(`foreignObject`,{key:0,x:0,y:0,width:q.value.width,height:q.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`)],8,me)):p(``,!0),h(`defs`,null,[g(le,{t:`linear`,id:`gradient_${F.value}`,x1:`-10%`,y1:`100%`,x2:`110%`,y2:`100%`,stops:[[`0%`,R.value.colors.min,1],[`100%`,R.value.colors.max,1]]},null,8,[`id`,`stops`])]),h(`path`,{d:`M10 ${q.value.base} A 1 1 0 1 1 118 ${q.value.base}`,stroke:R.value.gutter.color,"stroke-width":8,"stroke-linecap":R.value.gutter.strokeLinecap,fill:`none`},null,8,he),Z.value===0?p(``,!0):(y(),m(`path`,{key:1,d:`M10 ${q.value.base} A 1 1 0 1 1 118 ${q.value.base}`,stroke:R.value.colors.showGradient?`url(#gradient_${F.value})`:ye.value,"stroke-width":8,"stroke-linecap":R.value.track.strokeLinecap,fill:`none`,"stroke-dasharray":169.5,"stroke-dashoffset":169.5-169.5*Z.value,class:de({"vue-ui-sparkgauge-track":R.value.animation.show}),style:_(R.value.animation.show?`animation: vue-ui-sparkgauge-animation ${R.value.animation.speedMs}ms ease-in;`:``)},null,14,D)),C(B)?(y(),m(`rect`,{key:2,x:q.value.width/2-L.value.fontSize/2,y:q.value.base+6+L.value.offsetY-L.value.fontSize,width:L.value.fontSize,height:L.value.fontSize,fill:`#6A6A6A50`,rx:3},null,8,O)):(y(),m(`text`,{key:3,"text-anchor":`middle`,x:q.value.width/2,y:q.value.base+6+L.value.offsetY,"font-size":L.value.fontSize,fill:$.value,"font-weight":L.value.bold?`bold`:`normal`},S(C(s)(L.value.formatter,C(o)(J.value),C(n)({p:L.value.prefix,v:C(o)(J.value),s:L.value.suffix,r:L.value.rounding}),{datapoint:C(o)(J.value),color:$.value})),9,k))],8,E)),R.value.title.show&&X.value&&R.value.title.position===`bottom`?(y(),m(`div`,{key:1,class:`vue-data-ui-sparkgauge-label`,style:_(`font-size:${R.value.title.fontSize}px;text-align:${R.value.title.textAlign};font-weight:${R.value.title.bold?`bold`:`normal`};font-weight:${R.value.title.bold?`bold`:`normal`};color:${R.value.title.color}`)},S(X.value),5)):p(``,!0),e.$slots.source?(y(),m(`div`,A,[x(e.$slots,`source`)],512)):p(``,!0),x(e.$slots,`skeleton`,{},()=>[C(B)?(y(),f(ce,{key:0})):p(``,!0)])],4))}};export{T as n,j as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./resolveChartConfig-0IvbmIE_.js";import{$ as n,Tt as r,X as i,at as a,b as o,i as s,in as c,t as l,yt as u,zt as ee}from"./lib-rPeBMZrn.js";import{n as te,t as ne}from"./useHints-C-TwxM0Y.js";import{t as re}from"./useConfig-CBXrYhMI.js";import{t as ie}from"./useLoading-BwiplGDB.js";import{t as ae}from"./useChartAccessibility-DOMuYJfm.js";import{t as oe}from"./usePrefersMotion-XLHwega2.js";import{t as se}from"./vue_ui_sparkgauge-D3xirz2w.js";import{t as ce}from"./BaseScanner-m6QR9rwD.js";import{t as le}from"./DefGrad-DKMq1REY.js";import{computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createVNode as g,defineAsyncComponent as ue,normalizeClass as de,normalizeStyle as _,onBeforeUnmount as fe,onMounted as v,openBlock as y,ref as b,renderSlot as x,toDisplayString as S,toRefs as pe,unref as C,watch as w}from"vue";var T=/* @__PURE__ */ e({default:()=>j}),E=[`xmlns`,`viewBox`],me=[`width`,`height`],he=[`d`,`stroke`,`stroke-linecap`],D=[`d`,`stroke`,`stroke-linecap`,`stroke-dashoffset`],O=[`x`,`y`,`width`,`height`],k=[`x`,`y`,`font-size`,`fill`,`font-weight`],A={key:2,ref:`source`,dir:`auto`},j={__name:`vue-ui-sparkgauge`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(e){let T=ue(()=>import(`./PackageVersion-BbZ3wNGs.js`).then(e=>e.t)),{vue_ui_sparkgauge:j}=re(),M=oe(),N=b(null),P=e,F=b(i()),I=b(W()),L=d(()=>I.value.style.dataLabel),R=d(()=>I.value.style);te({config:()=>I.value,dataset:()=>P.dataset,component:`VueUiSparkgauge`,rules:[ne.noHint]});let z=d(()=>R.value.animation.show&&!M.value),ge=d(()=>c({defaultConfig:{style:{animation:{show:!1},background:`#99999930`,colors:{min:`#CACACA`,max:`#6A6A6A`},track:{autoColor:!0},gutter:{color:`#6A6A6A80`}}},userConfig:I.value.skeletonConfig??{}})),{loading:B,FINAL_DATASET:V}=ie({...pe(P),FINAL_CONFIG:I,prepareConfig:W,skeletonDataset:P.config?.skeletonDataset??{value:0,min:-1,max:1,title:``},skeletonConfig:c({defaultConfig:I.value,userConfig:ge.value})}),H=d(()=>{let e=V.value.min??0,t=V.value.max??0;return{min:e,max:t,diff:t-e}}),U=d(()=>H.value.diff/R.value.animation.speedMs),{svgRef:_e}=ae({config:{text:P.dataset?.title||``}});function W(){return t(P.config,j,se)}v(()=>{K()});let G=d(()=>I.value.debug);function K(){ee(P.dataset)?a({componentName:`VueUiSparkgauge`,type:`dataset`,debug:G.value}):u({datasetObject:P.dataset,requiredAttributes:[`value`,`min`,`max`]}).forEach(e=>{a({componentName:`VueUiSparkgauge`,type:`datasetAttribute`,property:e,debug:G.value})})}w(()=>P.config,()=>{I.value=W(),J.value=z.value?H.value.min:V.value.value,K()},{deep:!0});let q=d(()=>({height:R.value.height,width:128,base:R.value.basePosition})),J=b(z.value?H.value.min:V.value.value);w([()=>V.value.value,z],([e,t])=>{Y(e||0,t)},{immediate:!0});let ve=d(()=>J.value>H.value.max?H.value.max:J.value<H.value.min?H.value.min:J.value);v(()=>{Y(V.value.value||0)});function Y(e,t=z.value){if(N.value&&=(cancelAnimationFrame(N.value),null),!t){J.value=e;return}function n(){J.value<e?J.value=Math.min(J.value+U.value,e):J.value>e&&(J.value=Math.max(J.value-U.value,e)),J.value===e?N.value=null:N.value=requestAnimationFrame(n)}n()}let X=d(()=>V.value.title??``),Z=d(()=>{let e=H.value.diff;if(!isFinite(e)||e===0)return 0;let t=H.value.min,n=ve.value;return n>=0?(n-t)/e:(Math.abs(t)-Math.abs(n))/e}),Q=d(()=>r(R.value.colors.min,R.value.colors.max,H.value.min,H.value.max,J.value)),$=d(()=>L.value.autoColor?Q.value:L.value.color),ye=d(()=>R.value.track.autoColor?Q.value:R.value.track.color);return fe(()=>{N.value&&cancelAnimationFrame(N.value)}),(e,t)=>(y(),m(`div`,{class:`vue-data-ui-component vue-ui-sparkgauge`,style:_(`font-family:${R.value.fontFamily};width: 100%; background:${R.value.background}`)},[R.value.title.show&&X.value&&R.value.title.position===`top`?(y(),m(`div`,{key:0,class:`vue-data-ui-sparkgauge-label`,style:_(`font-size:${R.value.title.fontSize}px;text-align:${R.value.title.textAlign};font-weight:${R.value.title.bold?`bold`:`normal`};color:${R.value.title.color}`)},S(X.value),5)):p(``,!0),(y(),m(`svg`,{ref_key:`svgRef`,ref:_e,xmlns:C(l),viewBox:`0 0 ${q.value.width} ${q.value.height}`,style:`overflow: visible; background:transparent; width:100%;`},[g(C(T)),e.$slots[`chart-background`]&&!C(B)?(y(),m(`foreignObject`,{key:0,x:0,y:0,width:q.value.width,height:q.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`)],8,me)):p(``,!0),h(`defs`,null,[g(le,{t:`linear`,id:`gradient_${F.value}`,x1:`-10%`,y1:`100%`,x2:`110%`,y2:`100%`,stops:[[`0%`,R.value.colors.min,1],[`100%`,R.value.colors.max,1]]},null,8,[`id`,`stops`])]),h(`path`,{d:`M10 ${q.value.base} A 1 1 0 1 1 118 ${q.value.base}`,stroke:R.value.gutter.color,"stroke-width":8,"stroke-linecap":R.value.gutter.strokeLinecap,fill:`none`},null,8,he),Z.value===0?p(``,!0):(y(),m(`path`,{key:1,d:`M10 ${q.value.base} A 1 1 0 1 1 118 ${q.value.base}`,stroke:R.value.colors.showGradient?`url(#gradient_${F.value})`:ye.value,"stroke-width":8,"stroke-linecap":R.value.track.strokeLinecap,fill:`none`,"stroke-dasharray":169.5,"stroke-dashoffset":169.5-169.5*Z.value,class:de({"vue-ui-sparkgauge-track":R.value.animation.show}),style:_(R.value.animation.show?`animation: vue-ui-sparkgauge-animation ${R.value.animation.speedMs}ms ease-in;`:``)},null,14,D)),C(B)?(y(),m(`rect`,{key:2,x:q.value.width/2-L.value.fontSize/2,y:q.value.base+6+L.value.offsetY-L.value.fontSize,width:L.value.fontSize,height:L.value.fontSize,fill:`#6A6A6A50`,rx:3},null,8,O)):(y(),m(`text`,{key:3,"text-anchor":`middle`,x:q.value.width/2,y:q.value.base+6+L.value.offsetY,"font-size":L.value.fontSize,fill:$.value,"font-weight":L.value.bold?`bold`:`normal`},S(C(s)(L.value.formatter,C(o)(J.value),C(n)({p:L.value.prefix,v:C(o)(J.value),s:L.value.suffix,r:L.value.rounding}),{datapoint:C(o)(J.value),color:$.value})),9,k))],8,E)),R.value.title.show&&X.value&&R.value.title.position===`bottom`?(y(),m(`div`,{key:1,class:`vue-data-ui-sparkgauge-label`,style:_(`font-size:${R.value.title.fontSize}px;text-align:${R.value.title.textAlign};font-weight:${R.value.title.bold?`bold`:`normal`};font-weight:${R.value.title.bold?`bold`:`normal`};color:${R.value.title.color}`)},S(X.value),5)):p(``,!0),e.$slots.source?(y(),m(`div`,A,[x(e.$slots,`source`)],512)):p(``,!0),x(e.$slots,`skeleton`,{},()=>[C(B)?(y(),f(ce,{key:0})):p(``,!0)])],4))}};export{T as n,j as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useAnimationFrame-D8gcRfnW.js";import{t as n}from"./resolveChartConfig-0IvbmIE_.js";import{$ as r,Jt as i,X as a,Yt as o,at as s,i as c,in as l,t as u,yt as d,zt as ee}from"./lib-rPeBMZrn.js";import{c as te}from"./canvas-lib-22VpOI4_.js";import{n as ne,t as re}from"./useHints-C-TwxM0Y.js";import{t as ie}from"./useConfig-9oDGTWWG.js";import{t as ae}from"./useLoading-BwiplGDB.js";import{t as oe}from"./useFitSvgText-C1QC4P5G.js";import{t as se}from"./useResponsive-CENUxfEL.js";import{t as ce}from"./useChartAccessibility-DOMuYJfm.js";import{t as le}from"./Shape-CRe8woTu.js";import{t as ue}from"./vue_ui_sparkhistogram-E6G1761_.js";import{t as de}from"./BaseScanner-m6QR9rwD.js";import{t as fe}from"./A11yDataTable-DWNlWXzs.js";import{t as f}from"./DefGrad-DKMq1REY.js";import{t as pe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as p,computed as m,createBlock as h,createCommentVNode as g,createElementBlock as _,createElementVNode as v,createTextVNode as me,createVNode as he,defineAsyncComponent as ge,guardReactiveProps as _e,nextTick as ve,normalizeClass as ye,normalizeProps as be,normalizeStyle as y,onBeforeUnmount as xe,onMounted as Se,openBlock as b,ref as x,renderList as S,renderSlot as C,toDisplayString as w,toRefs as Ce,unref as T,useCssVars as we,watch as Te}from"vue";var Ee=/* @__PURE__ */ e({default:()=>E}),De=[`id`],Oe={key:0},ke={key:1},Ae={style:{position:`relative`}},je=[`xmlns`,`viewBox`,`aria-describedby`],Me=[`width`,`height`],Ne=[`height`,`width`,`fill`,`x`,`stroke`,`stroke-width`,`rx`,`stroke-dasharray`],Pe={key:1},Fe=[`x`,`y`,`height`,`width`,`fill`,`stroke`,`stroke-width`,`rx`],Ie={key:2},Le=[`x`,`y`,`font-size`,`font-weight`,`fill`],Re=[`x`,`y`,`font-size`,`fill`],ze=[`x`,`y`,`font-size`,`fill`],Be=[`height`,`width`,`x`,`onMouseover`,`onMouseleave`,`onClick`],Ve={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},E=/*#__PURE__*/ pe({__name:`vue-ui-sparkhistogram`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectDatapoint`],setup(e,{emit:pe}){we(e=>({v793c1252:tt.value}));let Ee=ge(()=>import(`./PackageVersion-B9qiUJPH.js`).then(e=>e.t)),{vue_ui_sparkhistogram:E}=ie(),D=e,O=x(a()),He=x(null),k=x(null),A=x(null),j=x(null),M=x(null),N=t(),P=0;function Ue(){P+=1,N.cancel(),j.value?.disconnect(),j.value=null,M.value=null}xe(Ue);let F=x(!1),I=x(null),L=x(`pointer`),R=x(q()),z=m(()=>R.value.style.labels),B=m(()=>R.value.style.bars),V=m(()=>R.value.style);ne({config:()=>R.value,dataset:()=>D.dataset,component:`VueUiSparkHistogram`,rules:[re.singleSeries,{test:e=>e.length>31,message:[`👀 The number of datapoints is > 31. For a more readable chart, consider:`,``,`▶️ Using VueUiXy with a line series`]}]});let We=m(()=>l({defaultConfig:{style:{animation:{show:!1},backgroundColor:`#99999930`}},userConfig:R.value.skeletonConfig??{}})),{loading:H,FINAL_DATASET:U,manualLoading:Ge}=ae({...Ce(D),FINAL_CONFIG:R,prepareConfig:q,skeletonDataset:D.config?.skeletonDataset??[{value:1,intensity:.2,color:`#CACACA`},{value:2,intensity:.3,color:`#CACACA`},{value:3,intensity:.5,color:`#CACACA`},{value:5,intensity:.7,color:`#CACACA`},{value:8,intensity:.9,color:`#CACACA`},{value:13,intensity:.95,color:`#CACACA`},{value:21,intensity:1,color:`#CACACA`},{value:13,intensity:.95,color:`#CACACA`},{value:8,intensity:.9,color:`#CACACA`},{value:5,intensity:.7,color:`#CACACA`},{value:3,intensity:.5,color:`#CACACA`},{value:2,intensity:.3,color:`#CACACA`},{value:1,intensity:.2,color:`#CACACA`}],skeletonConfig:l({defaultConfig:R.value,userConfig:We.value})}),W=x(V.value.layout.width),G=x(V.value.layout.height),{svgRef:K}=ce({config:V.value.title});function q(){return n(D.config,E,ue)}Se(()=>{Ke()});let J=m(()=>R.value.debug);function Ke(){if(Ue(),ee(D.dataset)?s({componentName:`VueUiSparkHistogram`,type:`dataset`,debug:J.value}):J.value&&D.dataset.forEach((e,t)=>{d({datasetObject:e,requiredAttributes:[`value`]}).forEach(e=>{s({componentName:`VueUiSparkHistogram`,type:`datasetSerieAttribute`,property:e,index:t})})}),R.value.responsive&&A.value?.parentNode){let e=P,t=te(()=>{if(e!==P||N.isDisposed())return;let{width:t,height:n}=se({chart:A.value,title:V.value.title.text?k.value:null,source:He.value}),r=z.value.timeLabel.show?z.value.timeLabel.fontSize*2:0,i=z.value.valueLabel.show?z.value.valueLabel.fontSize*2:0;N.request(()=>{W.value=Math.max(10,t),G.value=Math.max(10,n-12-r-i)})});j.value=new ResizeObserver(t),M.value=A.value.parentNode,j.value.observe(M.value)}}Te(()=>D.config,e=>{R.value=q(),Ke()},{deep:!0});let Y=m(()=>{let e=z.value.timeLabel.show?z.value.timeLabel.fontSize*2:0,t=z.value.valueLabel.show?z.value.valueLabel.fontSize*2:0,n=G.value+e+t,r=W.value,i=V.value.layout.padding.top,a=n-V.value.layout.padding.bottom,o=V.value.layout.padding.left,s=r-V.value.layout.padding.right;return{bottom:a,centerY:i+(n-i-V.value.layout.padding.bottom)/2,drawingHeight:n-V.value.layout.padding.top-V.value.layout.padding.bottom-e-t,drawingWidth:r-V.value.layout.padding.left-V.value.layout.padding.right,height:n,left:o,right:s,top:i,width:r}}),qe=m(()=>Math.max(...U.value.map(e=>Math.abs(e.value||0))));function Je(e){return Math.abs(e)/qe.value}let X=m(()=>U.value.map((e,t)=>{let n=Je(e.value||0),r=Y.value.drawingHeight*n,a=Y.value.drawingWidth/U.value.length,o=a*(B.value.gap/100),s=a-o,c=Y.value.centerY-r/2,l=Y.value.left+(o/2+t*a),u=Y.value.left+t*a,d=e.intensity===void 0?100:Math.round(e.intensity*100),ee=e.color?e.color:e.value>=0?i(B.value.colors.positive,d):i(B.value.colors.negative,d),te=e.color?e.color:e.value>=0?B.value.colors.positive:B.value.colors.negative,ne=e.color?`url(#gradient_datapoint_${t}_${O.value})`:e.value>=0?`url(#gradient_positive_${t}_${O.value})`:`url(#gradient_negative_${t}_${O.value})`,re=l+s/2;return{...e,color:ee,gradient:ne,height:r,intensity:d,proportion:n,stroke:te,textAnchor:re,trapX:u,unitWidth:a,width:s,x:l,y:c}}));function Ye(e,t){return c(z.value.value.formatter,e.value,r({p:z.value.value.prefix,v:e.value,s:z.value.value.suffix,r:z.value.value.rounding}),{datapoint:e,seriesIndex:t})}let Z=x(null),Xe=pe;function Ze(e,t){Xe(`selectDatapoint`,{datapoint:e,index:t}),R.value.events.datapointClick&&R.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Qe(e,t){L.value=`pointer`,I.value=t,Z.value=t,R.value.events.datapointEnter&&R.value.events.datapointEnter({datapoint:e,seriesIndex:t})}function $e(e,t){L.value!==`keyboard`&&(Z.value=null,I.value=null,R.value.events.datapointLeave&&R.value.events.datapointLeave({datapoint:e,seriesIndex:t}))}function et(){L.value!==`keyboard`&&(Z.value=null,I.value=null)}let tt=m(()=>`${V.value.animation.speedMs}ms`),nt=m(()=>Y.value.drawingWidth/U.value.length*.9),{fitText:Q}=oe({svgRef:K,unitWidth:nt});Se(async()=>{await ve(),Q(`.vue-ui-sparkhistogram-top-label`,z.value.value.minFontSize),Q(`.vue-ui-sparkhistogram-bottom-label`,z.value.valueLabel.minFontSize),Q(`.vue-ui-sparkhistogram-time-label`,z.value.timeLabel.minFontSize)}),Te([W,G,()=>U.value],async()=>{await ve(),Q(`.vue-ui-sparkhistogram-top-label`,z.value.value.minFontSize),Q(`.vue-ui-sparkhistogram-bottom-label`,z.value.valueLabel.minFontSize),Q(`.vue-ui-sparkhistogram-time-label`,z.value.timeLabel.minFontSize)});function rt(){F.value=!0}function it(){F.value=!1,I.value=null,L.value=`pointer`,Z.value=null}function at(e){if(!K.value||document.activeElement!==K.value||!X.value.length)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){I.value=null,Z.value=null,L.value=`pointer`;return}if(r){if(Z.value===null)return;let e=X.value[Z.value];if(!e)return;Ze(e,Z.value);return}L.value=`keyboard`;let a=I.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)),I.value=a,Z.value=a;let o=X.value[a];R.value.events.datapointEnter&&R.value.events.datapointEnter({datapoint:o,seriesIndex:a})}let $=m(()=>({headers:[R.value.a11y?.translations?.series??`Series`,R.value.a11y?.translations?.time??`Time`,R.value.a11y?.translations?.value??`Value`,R.value.a11y?.translations?.label??`Label`],rows:X.value.map((e,t)=>[t+1,e.timeLabel??``,e.value??``,e.valueLabel??``])}));return(e,t)=>(b(),_(`div`,{class:`vue-data-ui-component vue-ui-spark-histogram`,ref_key:`histogramChart`,ref:A,style:y(`width:100%;background:${V.value.backgroundColor};font-family:${V.value.fontFamily}`),onMouseleave:et},[v(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[v(`p`,null,w(R.value.a11y.translations.keyboardNavigation),1)],8,De),R.value.a11y.includeTable&&$.value?.rows?.length?(b(),h(fe,{key:0,uid:O.value,head:$.value.headers,body:$.value.rows,notice:R.value.a11y.translations.tableAvailable,caption:R.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):g(``,!0),V.value.title.text?(b(),_(`div`,{key:1,ref_key:`chartTitle`,ref:k,style:y(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${V.value.title.margin};padding: 0 6px;text-align:${V.value.title.textAlign}`)},[v(`div`,{style:y(`font-size:${V.value.title.fontSize}px;color:${V.value.title.color};font-weight:${V.value.title.bold?`bold`:`normal`}`)},[me(w(V.value.title.text)+` `,1),Z.value===null?g(``,!0):(b(),_(`span`,Oe,`- `+w(X.value[Z.value].timeLabel||``)+` `+w(T(c)(z.value.value.formatter,X.value[Z.value].value,T(r)({p:z.value.value.prefix,v:X.value[Z.value].value,s:z.value.value.suffix,r:z.value.value.rounding}),{datapoint:X.value[Z.value],seriesIndex:Z.value})),1)),![void 0,null].includes(Z.value)&&![null,void 0].includes(X.value[Z.value].valueLabel)?(b(),_(`span`,ke,w(` (${X.value[Z.value].valueLabel||0})`),1)):g(``,!0)],4),V.value.title.subtitle.text?(b(),_(`div`,{key:0,style:y(`font-size:${V.value.title.subtitle.fontSize}px;color:${V.value.title.subtitle.color};font-weight:${V.value.title.subtitle.bold?`bold`:`normal`}`)},w(V.value.title.subtitle.text),5)):g(``,!0)],4)):g(``,!0),v(`div`,Ae,[(b(),_(`svg`,{ref_key:`svgRef`,ref:K,xmlns:T(u),viewBox:`0 0 ${Y.value.width} ${Y.value.height}`,style:{overflow:`visible`},"aria-describedby":`chart-instructions-${O.value}`,tabindex:`0`,onFocus:rt,onBlur:it,onKeydown:at},[he(T(Ee)),e.$slots[`chart-background`]?(b(),_(`foreignObject`,{key:0,x:0,y:0,width:Y.value.width,height:Y.value.height,style:{pointerEvents:`none`}},[C(e.$slots,`chart-background`,{},void 0,!0)],8,Me)):g(``,!0),v(`defs`,null,[(b(!0),_(p,null,S(X.value,(e,t)=>(b(),h(f,{t:`radial`,id:`gradient_positive_${t}_${O.value}`,key:`gradient_positive_${t}_${O.value}`,cy:`50%`,cx:`50%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,T(i)(T(o)(B.value.colors.positive,.05),e.intensity),1],[`100%`,T(i)(B.value.colors.positive,e.intensity),1]]},null,8,[`id`,`stops`]))),128)),(b(!0),_(p,null,S(X.value,(e,t)=>(b(),h(f,{t:`radial`,id:`gradient_negative_${t}_${O.value}`,key:`gradient_negative_${t}_${O.value}`,cy:`50%`,cx:`50%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,T(i)(T(o)(B.value.colors.negative,.05),e.intensity),1],[`100%`,T(i)(B.value.colors.negative,e.intensity),1]]},null,8,[`id`,`stops`]))),128)),(b(!0),_(p,null,S(X.value,(e,t)=>(b(),h(f,{t:`radial`,id:`gradient_datapoint_${t}_${O.value}`,key:`gradient_datapoint_${t}_${O.value}`,cy:`50%`,cx:`50%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,T(i)(T(o)(e.color,.05),e.intensity),1],[`100%`,T(i)(e.color,e.intensity),1]]},null,8,[`id`,`stops`]))),128))]),(b(!0),_(p,null,S(X.value,(e,t)=>(b(),_(`g`,null,[Z.value!==null&&Z.value===t?(b(),_(`rect`,{key:0,height:Y.value.height,width:e.unitWidth,fill:V.value.selector.fill,x:e.trapX,y:0,stroke:V.value.selector.stroke,"stroke-width":V.value.selector.strokeWidth,rx:V.value.selector.borderRadius,"stroke-dasharray":V.value.selector.strokeDasharray},null,8,Ne)):g(``,!0)]))),256)),!B.value.shape||B.value.shape===`square`?(b(),_(`g`,Pe,[(b(!0),_(p,null,S(X.value,(e,t)=>(b(),_(`rect`,{x:e.x,y:e.y,height:e.height,width:e.width,fill:B.value.colors.gradient.show?e.gradient:e.color,stroke:e.stroke,"stroke-width":B.value.strokeWidth,rx:`${B.value.borderRadius*e.proportion/12}%`,class:ye({"vue-ui-sparkhistogram-shape":V.value.animation.show})},null,10,Fe))),256))])):(b(),_(`g`,Ie,[(b(!0),_(p,null,S(X.value,(e,t)=>(b(),h(le,{plot:{x:e.x+e.width/2,y:e.y+e.height/2},color:B.value.colors.gradient.show?e.gradient:e.color,shape:B.value.shape,radius:Math.min(e.height*.4,e.width*.4),class:ye({"vue-ui-sparkhistogram-shape":V.value.animation.show})},null,8,[`plot`,`color`,`shape`,`radius`,`class`]))),256))])),T(H)?g(``,!0):(b(),_(p,{key:3},[(b(!0),_(p,null,S(X.value,(e,t)=>(b(),_(`g`,null,[z.value.value.show?(b(),_(`text`,{key:0,class:`vue-ui-sparkhistogram-top-label`,"text-anchor":`middle`,x:e.textAnchor,y:e.y-z.value.value.fontSize/3+z.value.value.offsetY,"font-size":z.value.value.fontSize,"font-weight":z.value.value.bold?`bold`:`normal`,fill:z.value.value.color},w(Ye(e,t)),9,Le)):g(``,!0)]))),256)),(b(!0),_(p,null,S(X.value,(e,t)=>(b(),_(`g`,null,[e.valueLabel&&z.value.valueLabel.show?(b(),_(`text`,{key:0,class:`vue-ui-sparkhistogram-bottom-label`,x:e.textAnchor,y:e.y+e.height+z.value.valueLabel.fontSize,"font-size":z.value.valueLabel.fontSize,"text-anchor":`middle`,fill:z.value.valueLabel.color},w(e.valueLabel),9,Re)):g(``,!0)]))),256)),(b(!0),_(p,null,S(X.value,(e,t)=>(b(),_(`g`,null,[e.timeLabel&&z.value.timeLabel.show?(b(),_(`text`,{key:0,class:`vue-ui-sparkhistogram-time-label`,x:e.textAnchor,y:Y.value.height,"font-size":z.value.timeLabel.fontSize,fill:z.value.timeLabel.color,"text-anchor":`middle`},w(e.timeLabel),9,ze)):g(``,!0)]))),256))],64)),(b(!0),_(p,null,S(X.value,(e,t)=>(b(),_(`g`,null,[v(`rect`,{height:Y.value.height,width:e.unitWidth,fill:`transparent`,x:e.trapX,y:0,onMouseover:n=>Qe(e,t),onMouseleave:n=>$e(e,t),onClick:()=>Ze(e,t)},null,40,Be)]))),256))],40,je)),e.$slots.hint?(b(),_(`div`,Ve,[C(e.$slots,`hint`,be(_e({hint:R.value.a11y.translations.keyboardNavigation,isVisible:F.value})),void 0,!0)])):g(``,!0)]),e.$slots.source?(b(),_(`div`,{key:2,ref_key:`source`,ref:He,dir:`auto`},[C(e.$slots,`source`,{},void 0,!0)],512)):g(``,!0),C(e.$slots,`skeleton`,{},()=>[T(H)?(b(),h(de,{key:0})):g(``,!0)],!0)],36))}},[[`__scopeId`,`data-v-8b09df29`]]);export{Ee as n,E as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useAnimationFrame-D8gcRfnW.js";import{t as n}from"./resolveChartConfig-0IvbmIE_.js";import{$ as r,Jt as i,X as a,Yt as o,at as s,i as c,in as l,t as u,yt as d,zt as ee}from"./lib-rPeBMZrn.js";import{c as te}from"./canvas-lib-22VpOI4_.js";import{n as ne,t as re}from"./useHints-C-TwxM0Y.js";import{t as ie}from"./useConfig-CBXrYhMI.js";import{t as ae}from"./useLoading-BwiplGDB.js";import{t as oe}from"./useFitSvgText-C1QC4P5G.js";import{t as se}from"./useResponsive-CENUxfEL.js";import{t as ce}from"./useChartAccessibility-DOMuYJfm.js";import{t as le}from"./Shape-CRe8woTu.js";import{t as ue}from"./vue_ui_sparkhistogram-E6G1761_.js";import{t as de}from"./BaseScanner-m6QR9rwD.js";import{t as fe}from"./A11yDataTable-DWNlWXzs.js";import{t as f}from"./DefGrad-DKMq1REY.js";import{t as pe}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as p,computed as m,createBlock as h,createCommentVNode as g,createElementBlock as _,createElementVNode as v,createTextVNode as me,createVNode as he,defineAsyncComponent as ge,guardReactiveProps as _e,nextTick as ve,normalizeClass as ye,normalizeProps as be,normalizeStyle as y,onBeforeUnmount as xe,onMounted as Se,openBlock as b,ref as x,renderList as S,renderSlot as C,toDisplayString as w,toRefs as Ce,unref as T,useCssVars as we,watch as Te}from"vue";var Ee=/* @__PURE__ */ e({default:()=>E}),De=[`id`],Oe={key:0},ke={key:1},Ae={style:{position:`relative`}},je=[`xmlns`,`viewBox`,`aria-describedby`],Me=[`width`,`height`],Ne=[`height`,`width`,`fill`,`x`,`stroke`,`stroke-width`,`rx`,`stroke-dasharray`],Pe={key:1},Fe=[`x`,`y`,`height`,`width`,`fill`,`stroke`,`stroke-width`,`rx`],Ie={key:2},Le=[`x`,`y`,`font-size`,`font-weight`,`fill`],Re=[`x`,`y`,`font-size`,`fill`],ze=[`x`,`y`,`font-size`,`fill`],Be=[`height`,`width`,`x`,`onMouseover`,`onMouseleave`,`onClick`],Ve={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},E=/*#__PURE__*/ pe({__name:`vue-ui-sparkhistogram`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectDatapoint`],setup(e,{emit:pe}){we(e=>({v793c1252:tt.value}));let Ee=ge(()=>import(`./PackageVersion-BbZ3wNGs.js`).then(e=>e.t)),{vue_ui_sparkhistogram:E}=ie(),D=e,O=x(a()),He=x(null),k=x(null),A=x(null),j=x(null),M=x(null),N=t(),P=0;function Ue(){P+=1,N.cancel(),j.value?.disconnect(),j.value=null,M.value=null}xe(Ue);let F=x(!1),I=x(null),L=x(`pointer`),R=x(q()),z=m(()=>R.value.style.labels),B=m(()=>R.value.style.bars),V=m(()=>R.value.style);ne({config:()=>R.value,dataset:()=>D.dataset,component:`VueUiSparkHistogram`,rules:[re.singleSeries,{test:e=>e.length>31,message:[`👀 The number of datapoints is > 31. For a more readable chart, consider:`,``,`▶️ Using VueUiXy with a line series`]}]});let We=m(()=>l({defaultConfig:{style:{animation:{show:!1},backgroundColor:`#99999930`}},userConfig:R.value.skeletonConfig??{}})),{loading:H,FINAL_DATASET:U,manualLoading:Ge}=ae({...Ce(D),FINAL_CONFIG:R,prepareConfig:q,skeletonDataset:D.config?.skeletonDataset??[{value:1,intensity:.2,color:`#CACACA`},{value:2,intensity:.3,color:`#CACACA`},{value:3,intensity:.5,color:`#CACACA`},{value:5,intensity:.7,color:`#CACACA`},{value:8,intensity:.9,color:`#CACACA`},{value:13,intensity:.95,color:`#CACACA`},{value:21,intensity:1,color:`#CACACA`},{value:13,intensity:.95,color:`#CACACA`},{value:8,intensity:.9,color:`#CACACA`},{value:5,intensity:.7,color:`#CACACA`},{value:3,intensity:.5,color:`#CACACA`},{value:2,intensity:.3,color:`#CACACA`},{value:1,intensity:.2,color:`#CACACA`}],skeletonConfig:l({defaultConfig:R.value,userConfig:We.value})}),W=x(V.value.layout.width),G=x(V.value.layout.height),{svgRef:K}=ce({config:V.value.title});function q(){return n(D.config,E,ue)}Se(()=>{Ke()});let J=m(()=>R.value.debug);function Ke(){if(Ue(),ee(D.dataset)?s({componentName:`VueUiSparkHistogram`,type:`dataset`,debug:J.value}):J.value&&D.dataset.forEach((e,t)=>{d({datasetObject:e,requiredAttributes:[`value`]}).forEach(e=>{s({componentName:`VueUiSparkHistogram`,type:`datasetSerieAttribute`,property:e,index:t})})}),R.value.responsive&&A.value?.parentNode){let e=P,t=te(()=>{if(e!==P||N.isDisposed())return;let{width:t,height:n}=se({chart:A.value,title:V.value.title.text?k.value:null,source:He.value}),r=z.value.timeLabel.show?z.value.timeLabel.fontSize*2:0,i=z.value.valueLabel.show?z.value.valueLabel.fontSize*2:0;N.request(()=>{W.value=Math.max(10,t),G.value=Math.max(10,n-12-r-i)})});j.value=new ResizeObserver(t),M.value=A.value.parentNode,j.value.observe(M.value)}}Te(()=>D.config,e=>{R.value=q(),Ke()},{deep:!0});let Y=m(()=>{let e=z.value.timeLabel.show?z.value.timeLabel.fontSize*2:0,t=z.value.valueLabel.show?z.value.valueLabel.fontSize*2:0,n=G.value+e+t,r=W.value,i=V.value.layout.padding.top,a=n-V.value.layout.padding.bottom,o=V.value.layout.padding.left,s=r-V.value.layout.padding.right;return{bottom:a,centerY:i+(n-i-V.value.layout.padding.bottom)/2,drawingHeight:n-V.value.layout.padding.top-V.value.layout.padding.bottom-e-t,drawingWidth:r-V.value.layout.padding.left-V.value.layout.padding.right,height:n,left:o,right:s,top:i,width:r}}),qe=m(()=>Math.max(...U.value.map(e=>Math.abs(e.value||0))));function Je(e){return Math.abs(e)/qe.value}let X=m(()=>U.value.map((e,t)=>{let n=Je(e.value||0),r=Y.value.drawingHeight*n,a=Y.value.drawingWidth/U.value.length,o=a*(B.value.gap/100),s=a-o,c=Y.value.centerY-r/2,l=Y.value.left+(o/2+t*a),u=Y.value.left+t*a,d=e.intensity===void 0?100:Math.round(e.intensity*100),ee=e.color?e.color:e.value>=0?i(B.value.colors.positive,d):i(B.value.colors.negative,d),te=e.color?e.color:e.value>=0?B.value.colors.positive:B.value.colors.negative,ne=e.color?`url(#gradient_datapoint_${t}_${O.value})`:e.value>=0?`url(#gradient_positive_${t}_${O.value})`:`url(#gradient_negative_${t}_${O.value})`,re=l+s/2;return{...e,color:ee,gradient:ne,height:r,intensity:d,proportion:n,stroke:te,textAnchor:re,trapX:u,unitWidth:a,width:s,x:l,y:c}}));function Ye(e,t){return c(z.value.value.formatter,e.value,r({p:z.value.value.prefix,v:e.value,s:z.value.value.suffix,r:z.value.value.rounding}),{datapoint:e,seriesIndex:t})}let Z=x(null),Xe=pe;function Ze(e,t){Xe(`selectDatapoint`,{datapoint:e,index:t}),R.value.events.datapointClick&&R.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Qe(e,t){L.value=`pointer`,I.value=t,Z.value=t,R.value.events.datapointEnter&&R.value.events.datapointEnter({datapoint:e,seriesIndex:t})}function $e(e,t){L.value!==`keyboard`&&(Z.value=null,I.value=null,R.value.events.datapointLeave&&R.value.events.datapointLeave({datapoint:e,seriesIndex:t}))}function et(){L.value!==`keyboard`&&(Z.value=null,I.value=null)}let tt=m(()=>`${V.value.animation.speedMs}ms`),nt=m(()=>Y.value.drawingWidth/U.value.length*.9),{fitText:Q}=oe({svgRef:K,unitWidth:nt});Se(async()=>{await ve(),Q(`.vue-ui-sparkhistogram-top-label`,z.value.value.minFontSize),Q(`.vue-ui-sparkhistogram-bottom-label`,z.value.valueLabel.minFontSize),Q(`.vue-ui-sparkhistogram-time-label`,z.value.timeLabel.minFontSize)}),Te([W,G,()=>U.value],async()=>{await ve(),Q(`.vue-ui-sparkhistogram-top-label`,z.value.value.minFontSize),Q(`.vue-ui-sparkhistogram-bottom-label`,z.value.valueLabel.minFontSize),Q(`.vue-ui-sparkhistogram-time-label`,z.value.timeLabel.minFontSize)});function rt(){F.value=!0}function it(){F.value=!1,I.value=null,L.value=`pointer`,Z.value=null}function at(e){if(!K.value||document.activeElement!==K.value||!X.value.length)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){I.value=null,Z.value=null,L.value=`pointer`;return}if(r){if(Z.value===null)return;let e=X.value[Z.value];if(!e)return;Ze(e,Z.value);return}L.value=`keyboard`;let a=I.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)),I.value=a,Z.value=a;let o=X.value[a];R.value.events.datapointEnter&&R.value.events.datapointEnter({datapoint:o,seriesIndex:a})}let $=m(()=>({headers:[R.value.a11y?.translations?.series??`Series`,R.value.a11y?.translations?.time??`Time`,R.value.a11y?.translations?.value??`Value`,R.value.a11y?.translations?.label??`Label`],rows:X.value.map((e,t)=>[t+1,e.timeLabel??``,e.value??``,e.valueLabel??``])}));return(e,t)=>(b(),_(`div`,{class:`vue-data-ui-component vue-ui-spark-histogram`,ref_key:`histogramChart`,ref:A,style:y(`width:100%;background:${V.value.backgroundColor};font-family:${V.value.fontFamily}`),onMouseleave:et},[v(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[v(`p`,null,w(R.value.a11y.translations.keyboardNavigation),1)],8,De),R.value.a11y.includeTable&&$.value?.rows?.length?(b(),h(fe,{key:0,uid:O.value,head:$.value.headers,body:$.value.rows,notice:R.value.a11y.translations.tableAvailable,caption:R.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):g(``,!0),V.value.title.text?(b(),_(`div`,{key:1,ref_key:`chartTitle`,ref:k,style:y(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${V.value.title.margin};padding: 0 6px;text-align:${V.value.title.textAlign}`)},[v(`div`,{style:y(`font-size:${V.value.title.fontSize}px;color:${V.value.title.color};font-weight:${V.value.title.bold?`bold`:`normal`}`)},[me(w(V.value.title.text)+` `,1),Z.value===null?g(``,!0):(b(),_(`span`,Oe,`- `+w(X.value[Z.value].timeLabel||``)+` `+w(T(c)(z.value.value.formatter,X.value[Z.value].value,T(r)({p:z.value.value.prefix,v:X.value[Z.value].value,s:z.value.value.suffix,r:z.value.value.rounding}),{datapoint:X.value[Z.value],seriesIndex:Z.value})),1)),![void 0,null].includes(Z.value)&&![null,void 0].includes(X.value[Z.value].valueLabel)?(b(),_(`span`,ke,w(` (${X.value[Z.value].valueLabel||0})`),1)):g(``,!0)],4),V.value.title.subtitle.text?(b(),_(`div`,{key:0,style:y(`font-size:${V.value.title.subtitle.fontSize}px;color:${V.value.title.subtitle.color};font-weight:${V.value.title.subtitle.bold?`bold`:`normal`}`)},w(V.value.title.subtitle.text),5)):g(``,!0)],4)):g(``,!0),v(`div`,Ae,[(b(),_(`svg`,{ref_key:`svgRef`,ref:K,xmlns:T(u),viewBox:`0 0 ${Y.value.width} ${Y.value.height}`,style:{overflow:`visible`},"aria-describedby":`chart-instructions-${O.value}`,tabindex:`0`,onFocus:rt,onBlur:it,onKeydown:at},[he(T(Ee)),e.$slots[`chart-background`]?(b(),_(`foreignObject`,{key:0,x:0,y:0,width:Y.value.width,height:Y.value.height,style:{pointerEvents:`none`}},[C(e.$slots,`chart-background`,{},void 0,!0)],8,Me)):g(``,!0),v(`defs`,null,[(b(!0),_(p,null,S(X.value,(e,t)=>(b(),h(f,{t:`radial`,id:`gradient_positive_${t}_${O.value}`,key:`gradient_positive_${t}_${O.value}`,cy:`50%`,cx:`50%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,T(i)(T(o)(B.value.colors.positive,.05),e.intensity),1],[`100%`,T(i)(B.value.colors.positive,e.intensity),1]]},null,8,[`id`,`stops`]))),128)),(b(!0),_(p,null,S(X.value,(e,t)=>(b(),h(f,{t:`radial`,id:`gradient_negative_${t}_${O.value}`,key:`gradient_negative_${t}_${O.value}`,cy:`50%`,cx:`50%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,T(i)(T(o)(B.value.colors.negative,.05),e.intensity),1],[`100%`,T(i)(B.value.colors.negative,e.intensity),1]]},null,8,[`id`,`stops`]))),128)),(b(!0),_(p,null,S(X.value,(e,t)=>(b(),h(f,{t:`radial`,id:`gradient_datapoint_${t}_${O.value}`,key:`gradient_datapoint_${t}_${O.value}`,cy:`50%`,cx:`50%`,r:`50%`,fx:`50%`,fy:`50%`,stops:[[`0%`,T(i)(T(o)(e.color,.05),e.intensity),1],[`100%`,T(i)(e.color,e.intensity),1]]},null,8,[`id`,`stops`]))),128))]),(b(!0),_(p,null,S(X.value,(e,t)=>(b(),_(`g`,null,[Z.value!==null&&Z.value===t?(b(),_(`rect`,{key:0,height:Y.value.height,width:e.unitWidth,fill:V.value.selector.fill,x:e.trapX,y:0,stroke:V.value.selector.stroke,"stroke-width":V.value.selector.strokeWidth,rx:V.value.selector.borderRadius,"stroke-dasharray":V.value.selector.strokeDasharray},null,8,Ne)):g(``,!0)]))),256)),!B.value.shape||B.value.shape===`square`?(b(),_(`g`,Pe,[(b(!0),_(p,null,S(X.value,(e,t)=>(b(),_(`rect`,{x:e.x,y:e.y,height:e.height,width:e.width,fill:B.value.colors.gradient.show?e.gradient:e.color,stroke:e.stroke,"stroke-width":B.value.strokeWidth,rx:`${B.value.borderRadius*e.proportion/12}%`,class:ye({"vue-ui-sparkhistogram-shape":V.value.animation.show})},null,10,Fe))),256))])):(b(),_(`g`,Ie,[(b(!0),_(p,null,S(X.value,(e,t)=>(b(),h(le,{plot:{x:e.x+e.width/2,y:e.y+e.height/2},color:B.value.colors.gradient.show?e.gradient:e.color,shape:B.value.shape,radius:Math.min(e.height*.4,e.width*.4),class:ye({"vue-ui-sparkhistogram-shape":V.value.animation.show})},null,8,[`plot`,`color`,`shape`,`radius`,`class`]))),256))])),T(H)?g(``,!0):(b(),_(p,{key:3},[(b(!0),_(p,null,S(X.value,(e,t)=>(b(),_(`g`,null,[z.value.value.show?(b(),_(`text`,{key:0,class:`vue-ui-sparkhistogram-top-label`,"text-anchor":`middle`,x:e.textAnchor,y:e.y-z.value.value.fontSize/3+z.value.value.offsetY,"font-size":z.value.value.fontSize,"font-weight":z.value.value.bold?`bold`:`normal`,fill:z.value.value.color},w(Ye(e,t)),9,Le)):g(``,!0)]))),256)),(b(!0),_(p,null,S(X.value,(e,t)=>(b(),_(`g`,null,[e.valueLabel&&z.value.valueLabel.show?(b(),_(`text`,{key:0,class:`vue-ui-sparkhistogram-bottom-label`,x:e.textAnchor,y:e.y+e.height+z.value.valueLabel.fontSize,"font-size":z.value.valueLabel.fontSize,"text-anchor":`middle`,fill:z.value.valueLabel.color},w(e.valueLabel),9,Re)):g(``,!0)]))),256)),(b(!0),_(p,null,S(X.value,(e,t)=>(b(),_(`g`,null,[e.timeLabel&&z.value.timeLabel.show?(b(),_(`text`,{key:0,class:`vue-ui-sparkhistogram-time-label`,x:e.textAnchor,y:Y.value.height,"font-size":z.value.timeLabel.fontSize,fill:z.value.timeLabel.color,"text-anchor":`middle`},w(e.timeLabel),9,ze)):g(``,!0)]))),256))],64)),(b(!0),_(p,null,S(X.value,(e,t)=>(b(),_(`g`,null,[v(`rect`,{height:Y.value.height,width:e.unitWidth,fill:`transparent`,x:e.trapX,y:0,onMouseover:n=>Qe(e,t),onMouseleave:n=>$e(e,t),onClick:()=>Ze(e,t)},null,40,Be)]))),256))],40,je)),e.$slots.hint?(b(),_(`div`,Ve,[C(e.$slots,`hint`,be(_e({hint:R.value.a11y.translations.keyboardNavigation,isVisible:F.value})),void 0,!0)])):g(``,!0)]),e.$slots.source?(b(),_(`div`,{key:2,ref_key:`source`,ref:He,dir:`auto`},[C(e.$slots,`source`,{},void 0,!0)],512)):g(``,!0),C(e.$slots,`skeleton`,{},()=>[T(H)?(b(),h(de,{key:0})):g(``,!0)],!0)],36))}},[[`__scopeId`,`data-v-8b09df29`]]);export{Ee as n,E as t};