{"version":3,"file":"pie-chart.mjs","sources":["../../../../../../packages/components/chart/src/pie-chart.vue"],"sourcesContent":["<template>\n  <Pie\n    :options=\"computedChartOptions\"\n    :data=\"chartData\"\n    :chart-id=\"chartId\"\n    :dataset-id-key=\"datasetIdKey\"\n    :plugins=\"plugins\"\n    :width=\"width\"\n    :height=\"height\"\n    data-test-name=\"pie-chart\"\n    data-test-variant=\"\"\n    data-test-state=\"\"\n  />\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { Pie } from 'vue-chartjs'\nimport * as ChartJS from 'chart.js'\nimport { cloneDeep, merge } from 'lodash-unified'\nimport { getChartDefaultOptions } from './utils'\nimport type { ChartData, ChartOptions, Plugin } from 'chart.js'\nimport type { PropType } from 'vue'\n\nconst { ArcElement, CategoryScale, Chart, Legend, Title, Tooltip } = ChartJS\nChart.register(Title, Tooltip, Legend, ArcElement, CategoryScale)\n\ndefineOptions({ name: 'BPieChart' })\n\nconst props = defineProps({\n  chartId: {\n    type: String,\n    default: 'pie-chart',\n  },\n  datasetIdKey: {\n    type: String,\n    default: 'label',\n  },\n  width: {\n    type: Number,\n    default: 240,\n  },\n  height: {\n    type: Number,\n    default: 240,\n  },\n  plugins: {\n    type: Array as PropType<Plugin<'pie'>[]>,\n    default: () => [],\n  },\n  chartData: {\n    type: Object as PropType<ChartData<'pie', number[], unknown>>,\n    default: () => ({ datasets: [] }),\n  },\n  chartOptions: {\n    type: Object as PropType<ChartOptions<'pie'>>,\n    default: () => ({ responsive: true, maintainAspectRatio: true }),\n  },\n})\n\nconst defaultOptions = cloneDeep(\n  getChartDefaultOptions('pie')\n) as ChartOptions<'pie'>\n\nconst computedChartOptions = computed(() =>\n  merge(merge(defaultOptions, { cutout: '72%' }), props.chartOptions)\n)\n</script>\n"],"names":["DO_defineComponent"],"mappings":";;;;;;;AA2Bc,MAAA,WAAA,GAAAA,eAAA,CAAA,EAAE,IAAA,EAAM,aAAY,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAHlC,IAAA,MAAM,EAAE,UAAY,EAAA,aAAA,EAAe,OAAO,MAAQ,EAAA,KAAA,EAAO,SAAY,GAAA,OAAA,CAAA;AACrE,IAAA,KAAA,CAAM,QAAS,CAAA,KAAA,EAAO,OAAS,EAAA,MAAA,EAAQ,YAAY,aAAa,CAAA,CAAA;AAmChE,IAAA,MAAM,cAAiB,GAAA,SAAA;AAAA,MACrB,uBAAuB,KAAK,CAAA;AAAA,KAC9B,CAAA;AAEA,IAAA,MAAM,oBAAuB,GAAA,QAAA;AAAA,MAAS,MACpC,KAAM,CAAA,KAAA,CAAM,cAAgB,EAAA,EAAE,QAAQ,KAAM,EAAC,CAAG,EAAA,KAAA,CAAM,YAAY,CAAA;AAAA,KACpE,CAAA;;;;;;;;;;;;;;;;;;;;;"}