@platox/pivot-table 0.0.97 → 0.0.98
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.
|
@@ -443,13 +443,13 @@ const ChartModule = ({
|
|
|
443
443
|
tooltip: {
|
|
444
444
|
trigger: isPieType ? "item" : "axis",
|
|
445
445
|
enterable: isPieType,
|
|
446
|
-
confine:
|
|
446
|
+
confine: !isPieType,
|
|
447
447
|
axisPointer: { type: "shadow" },
|
|
448
448
|
backgroundColor: "rgba(255, 255, 255, 0.96)",
|
|
449
449
|
borderColor: "transparent",
|
|
450
450
|
borderRadius: 8,
|
|
451
451
|
textStyle: { color: "#1d2129", fontSize: 13 },
|
|
452
|
-
extraCssText: "max-width:30vw; white-space:pre-wrap; word-break:break-all; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);",
|
|
452
|
+
extraCssText: isPieType ? "max-width:30vw; max-height:280px; overflow-y:auto; white-space:pre-wrap; word-break:break-all; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);" : "max-width:30vw; white-space:pre-wrap; word-break:break-all; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);",
|
|
453
453
|
appendTo: "body",
|
|
454
454
|
...isPieType ? {} : {
|
|
455
455
|
formatter: (params) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../packages/dashboard-workbench/components/module-content/chart-module/index.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { message, Spin } from 'antd'\nimport { useDebounceEffect, useMemoizedFn, useSize } from 'ahooks'\nimport { EChartsOption, LabelFormatterCallback } from 'echarts'\nimport { t } from 'i18next'\nimport { groupBy, isNumber } from 'lodash-es'\nimport {\n ChartCustomDataType,\n ChartCustomeStylesTypes,\n TimeGroupInterval,\n} from '@platox/pivot-table/components/add-module-modal/add-chart-modal/interface'\nimport { useAppContext } from '../../../context'\nimport { FieldItem, ModuleDataApi } from '../../../types'\nimport { getTransformValue } from '../../../utils'\nimport { ChartType } from '../../add-module-modal/add-chart-modal/interface'\nimport { ConditionBlock } from '../../add-module-modal/components/condition-modal/interface'\nimport { mapConditionsToPostgrest } from '../utils'\nimport BaseChart from './base-chart'\nimport Empty from './Empty'\nimport { getChartConfig, getGrid, getSerie } from './utils'\n\ninterface ChartModuleProps {\n customData?: ChartCustomDataType\n customeStyle?: ChartCustomeStylesTypes\n onChange?: (val: unknown) => void\n moduleDataApi?: ModuleDataApi\n width?: number\n height?: number\n}\n\nconst ChartModule: React.FC<ChartModuleProps> = ({\n moduleDataApi,\n customData,\n customeStyle,\n width = 2,\n height = 2,\n}) => {\n const { globalData, globalFilterCondition } = useAppContext()\n\n /* ============================== split =============================== */\n let matchGlobalFilterCondition = useMemo(() => {\n let matchGlobalFilterCondition = globalFilterCondition?.find(\n item => item?.dataSourceId === customData?.dataSourceId\n )\n return matchGlobalFilterCondition\n }, [globalFilterCondition, customData?.dataSourceId])\n\n const [chartData, setChartData] = useState<any>()\n const [loading, setloading] = useState<any>()\n\n const fetchChartData = useMemoizedFn(async () => {\n setChartData([])\n if (customData) {\n // 调用方法\n setloading(true)\n let queryString = ''\n const newXAxisField = customData?.xAxis === 'tags' ? 'tag' : customData?.xAxis\n const newGroupField = customData?.groupField === 'tags' ? 'tag' : customData?.groupField\n\n if (!customData.isGroup) {\n if (customData.yAxis === 'recordTotal') {\n queryString += `select=${newXAxisField},id.count()`\n }\n\n if (customData.yAxis === 'fieldValue' && customData?.yAxisField) {\n queryString += `select=${newXAxisField},${customData?.yAxisField}.${customData?.yAxisFieldType}()`\n }\n } else {\n if (customData.yAxis === 'recordTotal') {\n queryString += `select=${newXAxisField},${newGroupField},id.count()`\n }\n if (customData.yAxis === 'fieldValue' && customData?.yAxisField) {\n queryString += `select=${newXAxisField},${newGroupField},${customData?.yAxisField}.${customData?.yAxisFieldType}()`\n }\n }\n\n // 筛选\n let conditionBlockList = []\n if ((matchGlobalFilterCondition?.conditionList?.length ?? 0) > 0) {\n conditionBlockList.push(matchGlobalFilterCondition)\n }\n if ((customData?.conditionData?.conditionList?.length ?? 0) > 0) {\n conditionBlockList.push(customData?.conditionData)\n }\n if (conditionBlockList.length > 0) {\n let DSLStr = mapConditionsToPostgrest(conditionBlockList as ConditionBlock[])\n queryString += !!DSLStr ? `&${DSLStr}` : ''\n }\n\n if (customData?.dataSourceId) {\n moduleDataApi?.({\n id: customData?.dataSourceId,\n query: queryString,\n })\n .then((res: any) => {\n if (!res.success) {\n message.error(res.message)\n return\n }\n\n setChartData(res.data)\n })\n .finally(() => {\n setloading(false)\n })\n }\n } else {\n setChartData([])\n }\n })\n\n useDebounceEffect(\n () => {\n if (customData) {\n fetchChartData()\n }\n },\n [\n customData?.dataSourceId,\n customData?.conditionData,\n customData?.sortField,\n customData?.sortOrder,\n customData?.xAxis,\n customData?.yAxis,\n customData?.yAxisField,\n customData?.yAxisFieldType,\n customData?.isGroup,\n customData?.groupField,\n matchGlobalFilterCondition,\n ],\n { wait: 60 }\n )\n\n /* ============================== split =============================== */\n const fieldOptions = useMemo(() => {\n let ret = globalData?.sourceData?.find(item => item.value === customData?.dataSourceId)?.fields\n return ret\n }, [globalData, customData?.dataSourceId])\n\n /**\n * @description: 根据 customData 和 chartData 动态生成 ECharts 配置项\n * 主要逻辑:\n * 1. 根据字段配置和分组字段构造数据;\n * 2. 支持分组、百分比、排序、显示范围;\n * 3. 根据自定义配置生成 series、legend、xAxis/yAxis、grid、tooltip 等。\n */\n const chartOptions = useMemo(() => {\n if (customData && chartData && customData.type && chartData.length > 0) {\n /**\n * 根据 chartData 生成完整的 ECharts 配置\n */\n const getChartOptions = (_chartData: any) => {\n /**\n * @description 获取字段值(带字段映射与时间分组转换)\n */\n const getFieldVal = ({\n item,\n field,\n timeGroupInterval,\n }: {\n item: any\n field: any\n timeGroupInterval?: TimeGroupInterval\n }) => {\n return getTransformValue({\n fieldOptions,\n val: item[field],\n field: field,\n fieldMap: globalData?.fieldMap,\n timeGroupInterval,\n showNill: false,\n })\n }\n\n /** 获取字段对应的标签名(label) */\n const getFieldLabel = (field: string) => {\n const fieldData = fieldOptions?.find(item => item.value === field)\n return fieldData?.label\n }\n\n /** 判断是否为时间类型字段 */\n const isTimeField = (fieldName: string) => {\n return fieldOptions?.find(item => item.value === fieldName)?.type === 'timestamp'\n }\n\n // 后端字段映射修正\n const mapping = { tags: 'tag' }\n\n const newXAxisField =\n mapping[customData?.xAxis as keyof typeof mapping] ?? customData?.xAxis\n const newGroupField =\n mapping[customData?.groupField as keyof typeof mapping] ?? customData?.groupField\n\n console.log(\"newGroupField\", newGroupField)\n\n /**\n * Step 1. 分组整理数据(以 xAxis 为主键)\n */\n let groupData = groupBy(_chartData, item => {\n const category = getFieldVal({\n item,\n field: newXAxisField,\n timeGroupInterval: customData?.timeGroupInterval,\n })\n return category ?? 'Unknown'\n })\n\n /** 合并同名分组数据 */\n let chartData = Object.keys(groupData).map(key => {\n let groupList = groupData[key]\n let mergeObj = groupList.reduce((acc, item) => {\n Object.keys(item).forEach(k => {\n let value = item[k]\n if (isNumber(value)) {\n acc[k] = acc?.[k] ? acc[k] + value : value\n } else {\n acc[k] = value\n }\n })\n return acc\n }, {})\n return mergeObj\n })\n\n /**\n * Step 2. 初始化容器\n */\n const categories = new Set<string>() // x 轴标签集合\n const stackCategories = new Set<string>() // 分组类别\n const valueGroups: Record<string, Record<string, number>> = {} // 分组下的值\n const valueCounts: Record<string, number> = {} // 无分组的值\n\n /**\n * Step 3. 提取每一项的数据\n */\n chartData.forEach((item: any) => {\n const category = getFieldVal({\n item,\n field: newXAxisField,\n timeGroupInterval: customData?.timeGroupInterval,\n }) ?? 'Unknown'\n const val =\n customData.yAxis === 'recordTotal' ? item?.count : item[customData?.yAxisFieldType] || 0\n\n valueCounts[category] = val\n\n // 分组数据处理\n // if (customData?.isGroup && customData?.groupField) {\n // const stackCategory = getFieldVal({\n // item,\n // field: newGroupField,\n // })\n // const key = category ?? 'Unknown'\n // stackCategories.add(stackCategory)\n // if (!valueGroups[stackCategory]) valueGroups[stackCategory] = {}\n // valueGroups[stackCategory][key] = val\n // }\n })\n // 修bug先不影响其他的\n // https://applink.larksuite.com/client/todo/detail?guid=f7ad264e-bbea-4978-b908-c97ff55bb230&suite_entity_num=t107825\n if (customData?.isGroup && customData?.groupField) {\n _chartData.forEach((item: any) => {\n const category = getFieldVal({\n item,\n field: newXAxisField,\n timeGroupInterval: customData?.timeGroupInterval,\n }) ?? 'Unknown'\n const val =\n customData.yAxis === 'recordTotal' ? item?.count : item[customData?.yAxisFieldType] || 0\n\n const stackCategory = getFieldVal({\n item,\n field: newGroupField,\n }) ?? 'Unknown'\n stackCategories.add(stackCategory)\n if (!valueGroups[stackCategory]) valueGroups[stackCategory] = {}\n valueGroups[stackCategory][category] = val\n })\n }\n\n\n console.log(\"test\", { groupData, categories, stackCategories, valueGroups, valueCounts })\n\n /**\n * Step 4. 计算百分比(针对百分比图)\n */\n const valuePercentages: Record<string, number> = {}\n const valueGroupPercentages: Record<string, Record<string, number>> = {}\n\n if (customData?.isGroup && customData?.groupField) {\n const totalPerCategory: Record<string, number> = {}\n\n Object.keys(valueGroups).forEach(stackCategory => {\n Object.entries(valueGroups[stackCategory]).forEach(([key, val]) => {\n totalPerCategory[key] = (totalPerCategory[key] || 0) + val\n })\n })\n\n Object.keys(valueGroups).forEach(stackCategory => {\n valueGroupPercentages[stackCategory] = {}\n Object.entries(valueGroups[stackCategory]).forEach(([key, val]) => {\n const total = totalPerCategory[key] || 1\n valueGroupPercentages[stackCategory][key] = (val / total) * 100\n })\n })\n } else {\n Object.entries(valueCounts).forEach(([key, val]) => {\n const total = val || 1\n valuePercentages[key] = (val / total) * 100\n })\n }\n\n /**\n * Step 5. 排序\n */\n let sortField = customData?.sortField ?? 'xAxis'\n let sortOrder = customData?.sortOrder ?? 'asc'\n\n const sortedChartData = [...chartData].sort((a, b) => {\n let valA, valB\n switch (sortField) {\n case 'xAxis':\n valA = getFieldVal({\n item: a,\n field: newXAxisField,\n timeGroupInterval: customData?.timeGroupInterval,\n })\n valB = getFieldVal({\n item: b,\n field: newXAxisField,\n timeGroupInterval: customData?.timeGroupInterval,\n })\n break\n case 'yAxisField':\n valA =\n customData.yAxis === 'recordTotal' ? a?.count : a[customData?.yAxisFieldType] || 0\n valB =\n customData.yAxis === 'recordTotal' ? b?.count : b[customData?.yAxisFieldType] || 0\n break\n default:\n break\n }\n\n const orderMultiplier = sortOrder === 'asc' ? 1 : -1\n if (valA > valB) return 1 * orderMultiplier\n if (valA < valB) return -1 * orderMultiplier\n return 0\n })\n\n // 更新排序后的 categories\n const sortedCategories = sortedChartData.map(item =>\n getFieldVal({\n item,\n field: newXAxisField,\n timeGroupInterval: customData?.timeGroupInterval,\n }) ?? 'Unknown'\n )\n categories.clear()\n sortedCategories.forEach(cat => categories.add(cat))\n\n /**\n * Step 6. Display Range 限制(TOP / BOTTOM)\n */\n if (\n !isTimeField(customData?.xAxis) &&\n customData.displayRange !== 'ALL' &&\n !!customData.displayRange\n ) {\n let sortedByCountCategories = Array.from(categories).sort((a, b) => {\n return valueCounts[b] - valueCounts[a]\n })\n\n let ableCategories: string[] = []\n let [pos, count] = customData.displayRange.split('_')\n if (pos === 'TOP') {\n ableCategories = sortedByCountCategories.slice(0, Number(count))\n } else {\n ableCategories = sortedByCountCategories.slice(-Number(count))\n }\n\n Array.from(categories).forEach(item => {\n if (!ableCategories.includes(item)) {\n categories.delete(item)\n }\n return item\n })\n }\n\n /**\n * Step 7. 生成 series、xAxis/yAxis、legend 等图表配置\n */\n const formatter: LabelFormatterCallback = data =>\n customData?.isGroup && customData?.groupField\n ? data?.value == 0\n ? ''\n : `${data?.value}`\n : `${data?.value}`\n\n const isStripBar = customData?.type?.includes('strip-bar') || customData?.type === 'chart-bar-graph'\n const label = {\n show: customData?.chartOptions?.includes('label'),\n position: isStripBar ? 'right' : 'top',\n formatter,\n }\n\n const labels = Array.from(categories)\n const stackLabels = Array.from(stackCategories)\n\n const series = []\n const chartConfig = getChartConfig({\n type: customData?.type as ChartType,\n categories: labels,\n }) as any\n\n const formatValue = (v: any) => (isNumber(v) ? Math.floor(v * 100) / 100 : v)\n\n // === 分组图表 ===\n if (customData?.isGroup && customData?.groupField) {\n stackLabels.forEach((stackCategory, idx) => {\n const data = ['chart-bar-percentage', 'chart-strip-bar-percentage'].includes(\n customData.type\n )\n ? labels.map(label => formatValue(valueGroupPercentages[stackCategory][label] || 0))\n : labels.map(label => formatValue(valueGroups[stackCategory][label] || 0))\n\n // 组合图(左右双轴处理)\n let type = customData.type\n let yAxisPos = 'left'\n if (type == ChartType['chartCombination']) {\n let matchCombinationChartConfig = (customData?.groupFieldConfig ?? []).find(\n item =>\n getFieldVal({\n item: {\n [newGroupField]: item?.value,\n },\n field: newGroupField,\n }) == stackCategory\n )\n type = matchCombinationChartConfig?.config?.chartType ?? ChartType['ChartBar']\n yAxisPos = matchCombinationChartConfig?.config?.yAxisPos ?? 'left'\n }\n\n let seriesItem = getSerie({\n type,\n data,\n label,\n name: stackCategory,\n isGroup: customData?.isGroup,\n groupField: customData?.groupField,\n labels,\n colorIndex: idx,\n })\n seriesItem.yAxisIndex = yAxisPos == 'left' ? 0 : 1\n series.push(seriesItem)\n })\n } else {\n // === 非分组图表 ===\n const data = ['chart-bar-percentage', 'chart-strip-bar-percentage'].includes(\n customData.type\n )\n ? labels.map(label => formatValue(valuePercentages[label]?.toFixed(2) || 0))\n : labels.map(label => formatValue(valueCounts[label] || 0))\n\n let type = customData.type\n let yAxisPos = 'left'\n if (type == ChartType['chartCombination']) {\n type = customData?.yAxisFieldConfig?.chartType ?? ChartType['ChartBar']\n } else {\n yAxisPos = customData?.yAxisFieldConfig?.yAxisPos ?? 'left'\n }\n\n let seriesItem = getSerie({\n type,\n data,\n label,\n name:\n customData.yAxis === 'recordTotal'\n ? t('pb.statisticsText')\n : getFieldLabel(customData?.yAxisField),\n isGroup: customData?.isGroup,\n groupField: customData?.groupField,\n labels,\n colorIndex: 0,\n })\n seriesItem.yAxisIndex = yAxisPos == 'left' ? 0 : 1\n series.push(seriesItem)\n }\n\n console.log(\"series\", series, customData)\n\n /**\n * Step 8. 生成 grid / legend / tooltip 等通用配置\n */\n const grids = getGrid({ series, chartConfig, width, customeStyle })\n const isShowLegend = customData?.chartOptions?.includes('legend')\n const isPieType = customData?.type === 'chart-pie' || customData?.type === 'chart-pie-circular'\n\n const isLeftYAxisShow = series.some(item => item?.yAxisIndex == 0)\n const isRightYAxisShow = series.some(item => item?.yAxisIndex == 1)\n\n const yAxisConfig = {\n ...chartConfig?.yAxis,\n axisTick: {\n show: customData?.chartOptions?.includes('axis'),\n lineStyle: { color: '#e5e6eb' },\n },\n axisLine: {\n show: customData?.chartOptions?.includes('axis'),\n lineStyle: { color: '#e5e6eb' },\n },\n axisLabel: {\n show: customData?.chartOptions?.includes('label'),\n color: '#86909C',\n fontSize: 12,\n formatter: (value: string) =>\n value.length > 15 ? `${value.slice(0, 15)}...` : value,\n hideOverlap: true,\n ...chartConfig?.yAxis?.axisLabel,\n },\n splitLine: {\n show: customData?.chartOptions?.includes('splitLine'),\n lineStyle: { color: '#f2f3f5', type: 'dashed' },\n },\n }\n\n /** ✅ 最终返回 ECharts 配置项 */\n const options: EChartsOption = {\n legend: {\n type: 'scroll',\n left: 'center',\n right: 'center',\n top: '0',\n show: isShowLegend,\n itemWidth: 16,\n itemHeight: 8,\n itemGap: 16,\n icon: 'roundRect',\n textStyle: { color: '#86909C', fontSize: 12 },\n data: series?.map((item: any) => item?.name || '') || [],\n },\n grid: grids,\n graphic: {\n elements: [\n {\n type: 'text',\n left: 'center',\n bottom: '10px',\n style: {\n text: customeStyle?.xtitle || '',\n fill: '#86909C',\n fontSize: 12,\n fontWeight: 'normal',\n },\n },\n {\n type: 'text',\n left: '10px',\n top: 'center',\n style: {\n text: customeStyle?.ytitle || '',\n fill: '#86909C',\n fontSize: 12,\n fontWeight: 'normal',\n },\n rotation: Math.PI / 2,\n },\n ],\n },\n xAxis: {\n ...chartConfig?.xAxis,\n axisTick: {\n show: customData?.chartOptions?.includes('axis'),\n lineStyle: { color: '#e5e6eb' },\n },\n axisLine: {\n show: customData?.chartOptions?.includes('axis'),\n lineStyle: { color: '#e5e6eb' },\n },\n axisLabel: {\n show: customData?.chartOptions?.includes('label'),\n rotate: grids.axisLabelRotate,\n interval: 'auto',\n color: '#86909C',\n fontSize: 12,\n formatter: (value: string) =>\n value.length > 15 ? `${value.slice(0, 15)}...` : value,\n ...(chartConfig?.xAxis?.axisLabel ?? {}),\n },\n splitLine: {\n show: customData?.chartOptions?.includes('splitLine'),\n lineStyle: { color: '#f2f3f5', type: 'dashed' },\n },\n },\n yAxis: [\n { show: isLeftYAxisShow, ...yAxisConfig },\n { show: isRightYAxisShow, ...yAxisConfig },\n ],\n series,\n tooltip: {\n trigger: isPieType ? 'item' : 'axis',\n enterable: isPieType,\n confine: true,\n axisPointer: { type: 'shadow' },\n backgroundColor: 'rgba(255, 255, 255, 0.96)',\n borderColor: 'transparent',\n borderRadius: 8,\n textStyle: { color: '#1d2129', fontSize: 13 },\n extraCssText:\n 'max-width:30vw; white-space:pre-wrap; word-break:break-all; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);',\n appendTo: 'body',\n ...(isPieType\n ? {}\n : {\n formatter: (params: any) => {\n if (!Array.isArray(params)) return ''\n const title = `<div style=\"margin-bottom:6px;font-weight:500;color:#1d2129\">${params[0]?.axisValueLabel ?? ''}</div>`\n const items = params\n .map(\n (p: any) =>\n `<div style=\"display:flex;align-items:center;justify-content:space-between;gap:12px;line-height:22px\"><span style=\"display:inline-flex;align-items:center;gap:6px\"><span style=\"display:inline-block;width:8px;height:8px;border-radius:50%;background:${p.color?.colorStops?.[0]?.color ?? p.color}\"></span>${p.seriesName}</span><span style=\"font-weight:500\">${p.value}</span></div>`\n )\n .join('')\n return title + items\n },\n }),\n },\n animation: true,\n animationDuration: 600,\n animationEasing: 'cubicOut',\n }\n\n return options\n }\n\n return getChartOptions(chartData)\n } else {\n return null\n }\n }, [\n customData?.sortField,\n customData?.sortOrder,\n customData?.type,\n customData?.chartOptions,\n customData?.timeGroupInterval,\n customData?.groupFieldConfig,\n customData?.yAxisFieldConfig,\n customData?.displayRange,\n customeStyle,\n chartData,\n width,\n height,\n fieldOptions,\n ])\n\n\n /* ============================== split =============================== */\n const echartRef = useRef<any>()\n const containerRef = useRef<HTMLDivElement>(null)\n const size = useSize(containerRef)\n\n useEffect(() => {\n if (!!size) {\n echartRef?.current?.resize()\n }\n }, [size])\n\n const isLoading = loading\n const isEmpyt = !loading && !chartOptions\n const isOk = !isLoading && !!chartOptions\n return (\n <div style={{ width: '100%', height: '100%' }} ref={containerRef}>\n {isLoading && (\n <Spin\n style={{\n width: '100%',\n height: '100%',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n spinning={loading}\n />\n )}\n {isEmpyt && <Empty />}\n {isOk && <BaseChart echartRef={echartRef} options={chartOptions ?? {}} />}\n </div>\n )\n}\n\nexport default React.memo(ChartModule)\n"],"names":["matchGlobalFilterCondition","_a","chartData","label","_b","_c","BaseChart"],"mappings":";;;;;;;;;;;;;AA+BA,MAAM,cAA0C,CAAC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,SAAS;AACX,MAAM;AACJ,QAAM,EAAE,YAAY,sBAAA,IAA0B,cAAA;AAG9C,MAAI,6BAA6B,QAAQ,MAAM;AAC7C,QAAIA,8BAA6B,+DAAuB;AAAA,MACtD,CAAA,UAAQ,6BAAM,mBAAiB,yCAAY;AAAA;AAE7C,WAAOA;AAAAA,EACT,GAAG,CAAC,uBAAuB,yCAAY,YAAY,CAAC;AAEpD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAA;AAClC,QAAM,CAAC,SAAS,UAAU,IAAI,SAAA;AAE9B,QAAM,iBAAiB,cAAc,YAAY;;AAC/C,iBAAa,CAAA,CAAE;AACf,QAAI,YAAY;AA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MAAA,gBAAe,MAAM,KAAK,WAAW;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/dashboard-workbench/components/module-content/chart-module/index.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { message, Spin } from 'antd'\nimport { useDebounceEffect, useMemoizedFn, useSize } from 'ahooks'\nimport { EChartsOption, LabelFormatterCallback } from 'echarts'\nimport { t } from 'i18next'\nimport { groupBy, isNumber } from 'lodash-es'\nimport {\n ChartCustomDataType,\n ChartCustomeStylesTypes,\n TimeGroupInterval,\n} from '@platox/pivot-table/components/add-module-modal/add-chart-modal/interface'\nimport { useAppContext } from '../../../context'\nimport { FieldItem, ModuleDataApi } from '../../../types'\nimport { getTransformValue } from '../../../utils'\nimport { ChartType } from '../../add-module-modal/add-chart-modal/interface'\nimport { ConditionBlock } from '../../add-module-modal/components/condition-modal/interface'\nimport { mapConditionsToPostgrest } from '../utils'\nimport BaseChart from './base-chart'\nimport Empty from './Empty'\nimport { getChartConfig, getGrid, getSerie } from './utils'\n\ninterface ChartModuleProps {\n customData?: ChartCustomDataType\n customeStyle?: ChartCustomeStylesTypes\n onChange?: (val: unknown) => void\n moduleDataApi?: ModuleDataApi\n width?: number\n height?: number\n}\n\nconst ChartModule: React.FC<ChartModuleProps> = ({\n moduleDataApi,\n customData,\n customeStyle,\n width = 2,\n height = 2,\n}) => {\n const { globalData, globalFilterCondition } = useAppContext()\n\n /* ============================== split =============================== */\n let matchGlobalFilterCondition = useMemo(() => {\n let matchGlobalFilterCondition = globalFilterCondition?.find(\n item => item?.dataSourceId === customData?.dataSourceId\n )\n return matchGlobalFilterCondition\n }, [globalFilterCondition, customData?.dataSourceId])\n\n const [chartData, setChartData] = useState<any>()\n const [loading, setloading] = useState<any>()\n\n const fetchChartData = useMemoizedFn(async () => {\n setChartData([])\n if (customData) {\n // 调用方法\n setloading(true)\n let queryString = ''\n const newXAxisField = customData?.xAxis === 'tags' ? 'tag' : customData?.xAxis\n const newGroupField = customData?.groupField === 'tags' ? 'tag' : customData?.groupField\n\n if (!customData.isGroup) {\n if (customData.yAxis === 'recordTotal') {\n queryString += `select=${newXAxisField},id.count()`\n }\n\n if (customData.yAxis === 'fieldValue' && customData?.yAxisField) {\n queryString += `select=${newXAxisField},${customData?.yAxisField}.${customData?.yAxisFieldType}()`\n }\n } else {\n if (customData.yAxis === 'recordTotal') {\n queryString += `select=${newXAxisField},${newGroupField},id.count()`\n }\n if (customData.yAxis === 'fieldValue' && customData?.yAxisField) {\n queryString += `select=${newXAxisField},${newGroupField},${customData?.yAxisField}.${customData?.yAxisFieldType}()`\n }\n }\n\n // 筛选\n let conditionBlockList = []\n if ((matchGlobalFilterCondition?.conditionList?.length ?? 0) > 0) {\n conditionBlockList.push(matchGlobalFilterCondition)\n }\n if ((customData?.conditionData?.conditionList?.length ?? 0) > 0) {\n conditionBlockList.push(customData?.conditionData)\n }\n if (conditionBlockList.length > 0) {\n let DSLStr = mapConditionsToPostgrest(conditionBlockList as ConditionBlock[])\n queryString += !!DSLStr ? `&${DSLStr}` : ''\n }\n\n if (customData?.dataSourceId) {\n moduleDataApi?.({\n id: customData?.dataSourceId,\n query: queryString,\n })\n .then((res: any) => {\n if (!res.success) {\n message.error(res.message)\n return\n }\n\n setChartData(res.data)\n })\n .finally(() => {\n setloading(false)\n })\n }\n } else {\n setChartData([])\n }\n })\n\n useDebounceEffect(\n () => {\n if (customData) {\n fetchChartData()\n }\n },\n [\n customData?.dataSourceId,\n customData?.conditionData,\n customData?.sortField,\n customData?.sortOrder,\n customData?.xAxis,\n customData?.yAxis,\n customData?.yAxisField,\n customData?.yAxisFieldType,\n customData?.isGroup,\n customData?.groupField,\n matchGlobalFilterCondition,\n ],\n { wait: 60 }\n )\n\n /* ============================== split =============================== */\n const fieldOptions = useMemo(() => {\n let ret = globalData?.sourceData?.find(item => item.value === customData?.dataSourceId)?.fields\n return ret\n }, [globalData, customData?.dataSourceId])\n\n /**\n * @description: 根据 customData 和 chartData 动态生成 ECharts 配置项\n * 主要逻辑:\n * 1. 根据字段配置和分组字段构造数据;\n * 2. 支持分组、百分比、排序、显示范围;\n * 3. 根据自定义配置生成 series、legend、xAxis/yAxis、grid、tooltip 等。\n */\n const chartOptions = useMemo(() => {\n if (customData && chartData && customData.type && chartData.length > 0) {\n /**\n * 根据 chartData 生成完整的 ECharts 配置\n */\n const getChartOptions = (_chartData: any) => {\n /**\n * @description 获取字段值(带字段映射与时间分组转换)\n */\n const getFieldVal = ({\n item,\n field,\n timeGroupInterval,\n }: {\n item: any\n field: any\n timeGroupInterval?: TimeGroupInterval\n }) => {\n return getTransformValue({\n fieldOptions,\n val: item[field],\n field: field,\n fieldMap: globalData?.fieldMap,\n timeGroupInterval,\n showNill: false,\n })\n }\n\n /** 获取字段对应的标签名(label) */\n const getFieldLabel = (field: string) => {\n const fieldData = fieldOptions?.find(item => item.value === field)\n return fieldData?.label\n }\n\n /** 判断是否为时间类型字段 */\n const isTimeField = (fieldName: string) => {\n return fieldOptions?.find(item => item.value === fieldName)?.type === 'timestamp'\n }\n\n // 后端字段映射修正\n const mapping = { tags: 'tag' }\n\n const newXAxisField =\n mapping[customData?.xAxis as keyof typeof mapping] ?? customData?.xAxis\n const newGroupField =\n mapping[customData?.groupField as keyof typeof mapping] ?? customData?.groupField\n\n console.log(\"newGroupField\", newGroupField)\n\n /**\n * Step 1. 分组整理数据(以 xAxis 为主键)\n */\n let groupData = groupBy(_chartData, item => {\n const category = getFieldVal({\n item,\n field: newXAxisField,\n timeGroupInterval: customData?.timeGroupInterval,\n })\n return category ?? 'Unknown'\n })\n\n /** 合并同名分组数据 */\n let chartData = Object.keys(groupData).map(key => {\n let groupList = groupData[key]\n let mergeObj = groupList.reduce((acc, item) => {\n Object.keys(item).forEach(k => {\n let value = item[k]\n if (isNumber(value)) {\n acc[k] = acc?.[k] ? acc[k] + value : value\n } else {\n acc[k] = value\n }\n })\n return acc\n }, {})\n return mergeObj\n })\n\n /**\n * Step 2. 初始化容器\n */\n const categories = new Set<string>() // x 轴标签集合\n const stackCategories = new Set<string>() // 分组类别\n const valueGroups: Record<string, Record<string, number>> = {} // 分组下的值\n const valueCounts: Record<string, number> = {} // 无分组的值\n\n /**\n * Step 3. 提取每一项的数据\n */\n chartData.forEach((item: any) => {\n const category = getFieldVal({\n item,\n field: newXAxisField,\n timeGroupInterval: customData?.timeGroupInterval,\n }) ?? 'Unknown'\n const val =\n customData.yAxis === 'recordTotal' ? item?.count : item[customData?.yAxisFieldType] || 0\n\n valueCounts[category] = val\n\n // 分组数据处理\n // if (customData?.isGroup && customData?.groupField) {\n // const stackCategory = getFieldVal({\n // item,\n // field: newGroupField,\n // })\n // const key = category ?? 'Unknown'\n // stackCategories.add(stackCategory)\n // if (!valueGroups[stackCategory]) valueGroups[stackCategory] = {}\n // valueGroups[stackCategory][key] = val\n // }\n })\n // 修bug先不影响其他的\n // https://applink.larksuite.com/client/todo/detail?guid=f7ad264e-bbea-4978-b908-c97ff55bb230&suite_entity_num=t107825\n if (customData?.isGroup && customData?.groupField) {\n _chartData.forEach((item: any) => {\n const category = getFieldVal({\n item,\n field: newXAxisField,\n timeGroupInterval: customData?.timeGroupInterval,\n }) ?? 'Unknown'\n const val =\n customData.yAxis === 'recordTotal' ? item?.count : item[customData?.yAxisFieldType] || 0\n\n const stackCategory = getFieldVal({\n item,\n field: newGroupField,\n }) ?? 'Unknown'\n stackCategories.add(stackCategory)\n if (!valueGroups[stackCategory]) valueGroups[stackCategory] = {}\n valueGroups[stackCategory][category] = val\n })\n }\n\n\n console.log(\"test\", { groupData, categories, stackCategories, valueGroups, valueCounts })\n\n /**\n * Step 4. 计算百分比(针对百分比图)\n */\n const valuePercentages: Record<string, number> = {}\n const valueGroupPercentages: Record<string, Record<string, number>> = {}\n\n if (customData?.isGroup && customData?.groupField) {\n const totalPerCategory: Record<string, number> = {}\n\n Object.keys(valueGroups).forEach(stackCategory => {\n Object.entries(valueGroups[stackCategory]).forEach(([key, val]) => {\n totalPerCategory[key] = (totalPerCategory[key] || 0) + val\n })\n })\n\n Object.keys(valueGroups).forEach(stackCategory => {\n valueGroupPercentages[stackCategory] = {}\n Object.entries(valueGroups[stackCategory]).forEach(([key, val]) => {\n const total = totalPerCategory[key] || 1\n valueGroupPercentages[stackCategory][key] = (val / total) * 100\n })\n })\n } else {\n Object.entries(valueCounts).forEach(([key, val]) => {\n const total = val || 1\n valuePercentages[key] = (val / total) * 100\n })\n }\n\n /**\n * Step 5. 排序\n */\n let sortField = customData?.sortField ?? 'xAxis'\n let sortOrder = customData?.sortOrder ?? 'asc'\n\n const sortedChartData = [...chartData].sort((a, b) => {\n let valA, valB\n switch (sortField) {\n case 'xAxis':\n valA = getFieldVal({\n item: a,\n field: newXAxisField,\n timeGroupInterval: customData?.timeGroupInterval,\n })\n valB = getFieldVal({\n item: b,\n field: newXAxisField,\n timeGroupInterval: customData?.timeGroupInterval,\n })\n break\n case 'yAxisField':\n valA =\n customData.yAxis === 'recordTotal' ? a?.count : a[customData?.yAxisFieldType] || 0\n valB =\n customData.yAxis === 'recordTotal' ? b?.count : b[customData?.yAxisFieldType] || 0\n break\n default:\n break\n }\n\n const orderMultiplier = sortOrder === 'asc' ? 1 : -1\n if (valA > valB) return 1 * orderMultiplier\n if (valA < valB) return -1 * orderMultiplier\n return 0\n })\n\n // 更新排序后的 categories\n const sortedCategories = sortedChartData.map(item =>\n getFieldVal({\n item,\n field: newXAxisField,\n timeGroupInterval: customData?.timeGroupInterval,\n }) ?? 'Unknown'\n )\n categories.clear()\n sortedCategories.forEach(cat => categories.add(cat))\n\n /**\n * Step 6. Display Range 限制(TOP / BOTTOM)\n */\n if (\n !isTimeField(customData?.xAxis) &&\n customData.displayRange !== 'ALL' &&\n !!customData.displayRange\n ) {\n let sortedByCountCategories = Array.from(categories).sort((a, b) => {\n return valueCounts[b] - valueCounts[a]\n })\n\n let ableCategories: string[] = []\n let [pos, count] = customData.displayRange.split('_')\n if (pos === 'TOP') {\n ableCategories = sortedByCountCategories.slice(0, Number(count))\n } else {\n ableCategories = sortedByCountCategories.slice(-Number(count))\n }\n\n Array.from(categories).forEach(item => {\n if (!ableCategories.includes(item)) {\n categories.delete(item)\n }\n return item\n })\n }\n\n /**\n * Step 7. 生成 series、xAxis/yAxis、legend 等图表配置\n */\n const formatter: LabelFormatterCallback = data =>\n customData?.isGroup && customData?.groupField\n ? data?.value == 0\n ? ''\n : `${data?.value}`\n : `${data?.value}`\n\n const isStripBar = customData?.type?.includes('strip-bar') || customData?.type === 'chart-bar-graph'\n const label = {\n show: customData?.chartOptions?.includes('label'),\n position: isStripBar ? 'right' : 'top',\n formatter,\n }\n\n const labels = Array.from(categories)\n const stackLabels = Array.from(stackCategories)\n\n const series = []\n const chartConfig = getChartConfig({\n type: customData?.type as ChartType,\n categories: labels,\n }) as any\n\n const formatValue = (v: any) => (isNumber(v) ? Math.floor(v * 100) / 100 : v)\n\n // === 分组图表 ===\n if (customData?.isGroup && customData?.groupField) {\n stackLabels.forEach((stackCategory, idx) => {\n const data = ['chart-bar-percentage', 'chart-strip-bar-percentage'].includes(\n customData.type\n )\n ? labels.map(label => formatValue(valueGroupPercentages[stackCategory][label] || 0))\n : labels.map(label => formatValue(valueGroups[stackCategory][label] || 0))\n\n // 组合图(左右双轴处理)\n let type = customData.type\n let yAxisPos = 'left'\n if (type == ChartType['chartCombination']) {\n let matchCombinationChartConfig = (customData?.groupFieldConfig ?? []).find(\n item =>\n getFieldVal({\n item: {\n [newGroupField]: item?.value,\n },\n field: newGroupField,\n }) == stackCategory\n )\n type = matchCombinationChartConfig?.config?.chartType ?? ChartType['ChartBar']\n yAxisPos = matchCombinationChartConfig?.config?.yAxisPos ?? 'left'\n }\n\n let seriesItem = getSerie({\n type,\n data,\n label,\n name: stackCategory,\n isGroup: customData?.isGroup,\n groupField: customData?.groupField,\n labels,\n colorIndex: idx,\n })\n seriesItem.yAxisIndex = yAxisPos == 'left' ? 0 : 1\n series.push(seriesItem)\n })\n } else {\n // === 非分组图表 ===\n const data = ['chart-bar-percentage', 'chart-strip-bar-percentage'].includes(\n customData.type\n )\n ? labels.map(label => formatValue(valuePercentages[label]?.toFixed(2) || 0))\n : labels.map(label => formatValue(valueCounts[label] || 0))\n\n let type = customData.type\n let yAxisPos = 'left'\n if (type == ChartType['chartCombination']) {\n type = customData?.yAxisFieldConfig?.chartType ?? ChartType['ChartBar']\n } else {\n yAxisPos = customData?.yAxisFieldConfig?.yAxisPos ?? 'left'\n }\n\n let seriesItem = getSerie({\n type,\n data,\n label,\n name:\n customData.yAxis === 'recordTotal'\n ? t('pb.statisticsText')\n : getFieldLabel(customData?.yAxisField),\n isGroup: customData?.isGroup,\n groupField: customData?.groupField,\n labels,\n colorIndex: 0,\n })\n seriesItem.yAxisIndex = yAxisPos == 'left' ? 0 : 1\n series.push(seriesItem)\n }\n\n console.log(\"series\", series, customData)\n\n /**\n * Step 8. 生成 grid / legend / tooltip 等通用配置\n */\n const grids = getGrid({ series, chartConfig, width, customeStyle })\n const isShowLegend = customData?.chartOptions?.includes('legend')\n const isPieType = customData?.type === 'chart-pie' || customData?.type === 'chart-pie-circular'\n\n const isLeftYAxisShow = series.some(item => item?.yAxisIndex == 0)\n const isRightYAxisShow = series.some(item => item?.yAxisIndex == 1)\n\n const yAxisConfig = {\n ...chartConfig?.yAxis,\n axisTick: {\n show: customData?.chartOptions?.includes('axis'),\n lineStyle: { color: '#e5e6eb' },\n },\n axisLine: {\n show: customData?.chartOptions?.includes('axis'),\n lineStyle: { color: '#e5e6eb' },\n },\n axisLabel: {\n show: customData?.chartOptions?.includes('label'),\n color: '#86909C',\n fontSize: 12,\n formatter: (value: string) =>\n value.length > 15 ? `${value.slice(0, 15)}...` : value,\n hideOverlap: true,\n ...chartConfig?.yAxis?.axisLabel,\n },\n splitLine: {\n show: customData?.chartOptions?.includes('splitLine'),\n lineStyle: { color: '#f2f3f5', type: 'dashed' },\n },\n }\n\n /** ✅ 最终返回 ECharts 配置项 */\n const options: EChartsOption = {\n legend: {\n type: 'scroll',\n left: 'center',\n right: 'center',\n top: '0',\n show: isShowLegend,\n itemWidth: 16,\n itemHeight: 8,\n itemGap: 16,\n icon: 'roundRect',\n textStyle: { color: '#86909C', fontSize: 12 },\n data: series?.map((item: any) => item?.name || '') || [],\n },\n grid: grids,\n graphic: {\n elements: [\n {\n type: 'text',\n left: 'center',\n bottom: '10px',\n style: {\n text: customeStyle?.xtitle || '',\n fill: '#86909C',\n fontSize: 12,\n fontWeight: 'normal',\n },\n },\n {\n type: 'text',\n left: '10px',\n top: 'center',\n style: {\n text: customeStyle?.ytitle || '',\n fill: '#86909C',\n fontSize: 12,\n fontWeight: 'normal',\n },\n rotation: Math.PI / 2,\n },\n ],\n },\n xAxis: {\n ...chartConfig?.xAxis,\n axisTick: {\n show: customData?.chartOptions?.includes('axis'),\n lineStyle: { color: '#e5e6eb' },\n },\n axisLine: {\n show: customData?.chartOptions?.includes('axis'),\n lineStyle: { color: '#e5e6eb' },\n },\n axisLabel: {\n show: customData?.chartOptions?.includes('label'),\n rotate: grids.axisLabelRotate,\n interval: 'auto',\n color: '#86909C',\n fontSize: 12,\n formatter: (value: string) =>\n value.length > 15 ? `${value.slice(0, 15)}...` : value,\n ...(chartConfig?.xAxis?.axisLabel ?? {}),\n },\n splitLine: {\n show: customData?.chartOptions?.includes('splitLine'),\n lineStyle: { color: '#f2f3f5', type: 'dashed' },\n },\n },\n yAxis: [\n { show: isLeftYAxisShow, ...yAxisConfig },\n { show: isRightYAxisShow, ...yAxisConfig },\n ],\n series,\n tooltip: {\n trigger: isPieType ? 'item' : 'axis',\n enterable: isPieType,\n confine: !isPieType,\n axisPointer: { type: 'shadow' },\n backgroundColor: 'rgba(255, 255, 255, 0.96)',\n borderColor: 'transparent',\n borderRadius: 8,\n textStyle: { color: '#1d2129', fontSize: 13 },\n extraCssText: isPieType\n ? 'max-width:30vw; max-height:280px; overflow-y:auto; white-space:pre-wrap; word-break:break-all; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);'\n : 'max-width:30vw; white-space:pre-wrap; word-break:break-all; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);',\n appendTo: 'body',\n ...(isPieType\n ? {}\n : {\n formatter: (params: any) => {\n if (!Array.isArray(params)) return ''\n const title = `<div style=\"margin-bottom:6px;font-weight:500;color:#1d2129\">${params[0]?.axisValueLabel ?? ''}</div>`\n const items = params\n .map(\n (p: any) =>\n `<div style=\"display:flex;align-items:center;justify-content:space-between;gap:12px;line-height:22px\"><span style=\"display:inline-flex;align-items:center;gap:6px\"><span style=\"display:inline-block;width:8px;height:8px;border-radius:50%;background:${p.color?.colorStops?.[0]?.color ?? p.color}\"></span>${p.seriesName}</span><span style=\"font-weight:500\">${p.value}</span></div>`\n )\n .join('')\n return title + items\n },\n }),\n },\n animation: true,\n animationDuration: 600,\n animationEasing: 'cubicOut',\n }\n\n return options\n }\n\n return getChartOptions(chartData)\n } else {\n return null\n }\n }, [\n customData?.sortField,\n customData?.sortOrder,\n customData?.type,\n customData?.chartOptions,\n customData?.timeGroupInterval,\n customData?.groupFieldConfig,\n customData?.yAxisFieldConfig,\n customData?.displayRange,\n customeStyle,\n chartData,\n width,\n height,\n fieldOptions,\n ])\n\n\n /* ============================== split =============================== */\n const echartRef = useRef<any>()\n const containerRef = useRef<HTMLDivElement>(null)\n const size = useSize(containerRef)\n\n useEffect(() => {\n if (!!size) {\n echartRef?.current?.resize()\n }\n }, [size])\n\n const isLoading = loading\n const isEmpyt = !loading && !chartOptions\n const isOk = !isLoading && !!chartOptions\n return (\n <div style={{ width: '100%', height: '100%' }} ref={containerRef}>\n {isLoading && (\n <Spin\n style={{\n width: '100%',\n height: '100%',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n spinning={loading}\n />\n )}\n {isEmpyt && <Empty />}\n {isOk && <BaseChart echartRef={echartRef} options={chartOptions ?? {}} />}\n </div>\n )\n}\n\nexport default React.memo(ChartModule)\n"],"names":["matchGlobalF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AAoB;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,IAAI,CAAC;AAET,QAAM,YAAY;AAClB,QAAM,UAAU,CAAC,WAAW,CAAC;AAC7B,QAAM,OAAO,CAAC,aAAa,CAAC,CAAC;AAC7B,SACE,qBAAC,OAAA,EAAI,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAA,GAAU,KAAK,cACjD,UAAA;AAAA,IAAA,aACC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,gBAAgB;AAAA,UAChB,YAAY;AAAA,QAAA;AAAA,QAEd,UAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAGb,+BAAY,OAAA,EAAM;AAAA,IAClB,QAAQ,oBAACC,OAAA,EAAU,WAAsB,SAAS,gBAAgB,GAAC,CAAG;AAAA,EAAA,GACzE;AAEJ;AAEA,MAAA,gBAAe,MAAM,KAAK,WAAW;"}
|
package/package.json
CHANGED
package/umd/pivot-table.umd.cjs
CHANGED
|
@@ -162,7 +162,7 @@ echarts.use([`+O+"]);":"Unknown series "+A))}return}if(f==="tooltip"){if(b){proc
|
|
|
162
162
|
`,"Illegal config:",c,`.
|
|
163
163
|
`)),dt(n));var y=d?TO(d):null;d&&!y&&(process.env.NODE_ENV!=="production"&&(n=Qr("Invalid parser name "+d+`.
|
|
164
164
|
`,"Illegal config:",c,`.
|
|
165
|
-
`)),dt(n)),a.push({dimIdx:m.index,parser:y,comparator:new MO(h,p)})});var o=e.sourceFormat;o!==jr&&o!==An&&(process.env.NODE_ENV!=="production"&&(n='sourceFormat "'+o+'" is not supported yet'),dt(n));for(var s=[],l=0,u=e.count();l<u;l++)s.push(e.getRawDataItem(l));return s.sort(function(c,f){for(var h=0;h<a.length;h++){var d=a[h],p=e.retrieveValueFromItem(c,d.dimIdx),g=e.retrieveValueFromItem(f,d.dimIdx);d.parser&&(p=d.parser(p),g=d.parser(g));var v=d.comparator.evaluate(p,g);if(v!==0)return v}return 0}),{data:s}}};function goe(t){t.registerTransform(voe),t.registerTransform(poe)}var moe=function(t){ve(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.prototype.init=function(r,n,i){t.prototype.init.call(this,r,n,i),this._sourceManager=new yM(this),bM(this)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),bM(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:Ei},e}(pt),yoe=function(t){ve(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.type="dataset",e}(pn);function boe(t){t.registerComponentModel(moe),t.registerComponentView(yoe)}function _oe(t){if(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r].slice());return e}}function Coe(t,e){var r=t.label,n=e&&e.getTextGuideLine();return{dataIndex:t.dataIndex,dataType:t.dataType,seriesIndex:t.seriesModel.seriesIndex,text:t.label.style.text,rect:t.hostRect,labelRect:t.rect,align:r.style.align,verticalAlign:r.style.verticalAlign,labelLinePoints:_oe(n&&n.shape.points)}}var zI=["align","verticalAlign","width","height","fontSize"],Vr=new Wu,X1=Ot(),woe=Ot();function qv(t,e,r){for(var n=0;n<r.length;n++){var i=r[n];e[i]!=null&&(t[i]=e[i])}}var Xv=["x","y","rotation"],xoe=function(){function t(){this._labelList=[],this._chartViewList=[]}return t.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},t.prototype._addLabel=function(e,r,n,i,a){var o=i.style,s=i.__hostTarget,l=s.textConfig||{},u=i.getComputedTransform(),c=i.getBoundingRect().plain();ft.applyTransform(c,c,u),u?Vr.setLocalTransform(u):(Vr.x=Vr.y=Vr.rotation=Vr.originX=Vr.originY=0,Vr.scaleX=Vr.scaleY=1),Vr.rotation=Ui(Vr.rotation);var f=i.__hostTarget,h;if(f){h=f.getBoundingRect().plain();var d=f.getComputedTransform();ft.applyTransform(h,h,d)}var p=h&&f.getTextGuideLine();this._labelList.push({label:i,labelLine:p,seriesModel:n,dataIndex:e,dataType:r,layoutOption:a,computedLayoutOption:null,rect:c,hostRect:h,priority:h?h.width*h.height:0,defaultAttr:{ignore:i.ignore,labelGuideIgnore:p&&p.ignore,x:Vr.x,y:Vr.y,scaleX:Vr.scaleX,scaleY:Vr.scaleY,rotation:Vr.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:i.cursor,attachedPos:l.position,attachedRot:l.rotation}})},t.prototype.addLabelsOfSeries=function(e){var r=this;this._chartViewList.push(e);var n=e.__model,i=n.get("labelLayout");(Be(i)||vt(i).length)&&e.group.traverse(function(a){if(a.ignore)return!0;var o=a.getTextContent(),s=ot(a);o&&!o.disableLabelLayout&&r._addLabel(s.dataIndex,s.dataType,n,o,i)})},t.prototype.updateLayoutConfig=function(e){var r=e.getWidth(),n=e.getHeight();function i(b,C){return function(){CP(b,C)}}for(var a=0;a<this._labelList.length;a++){var o=this._labelList[a],s=o.label,l=s.__hostTarget,u=o.defaultAttr,c=void 0;Be(o.layoutOption)?c=o.layoutOption(Coe(o,l)):c=o.layoutOption,c=c||{},o.computedLayoutOption=c;var f=Math.PI/180;l&&l.setTextConfig({local:!1,position:c.x!=null||c.y!=null?null:u.attachedPos,rotation:c.rotate!=null?c.rotate*f:u.attachedRot,offset:[c.dx||0,c.dy||0]});var h=!1;if(c.x!=null?(s.x=Tt(c.x,r),s.setStyle("x",0),h=!0):(s.x=u.x,s.setStyle("x",u.style.x)),c.y!=null?(s.y=Tt(c.y,n),s.setStyle("y",0),h=!0):(s.y=u.y,s.setStyle("y",u.style.y)),c.labelLinePoints){var d=l.getTextGuideLine();d&&(d.setShape({points:c.labelLinePoints}),h=!1)}var p=X1(s);p.needsUpdateLabelLine=h,s.rotation=c.rotate!=null?c.rotate*f:u.rotation,s.scaleX=u.scaleX,s.scaleY=u.scaleY;for(var g=0;g<zI.length;g++){var v=zI[g];s.setStyle(v,c[v]!=null?c[v]:u.style[v])}if(c.draggable){if(s.draggable=!0,s.cursor="move",l){var m=o.seriesModel;if(o.dataIndex!=null){var y=o.seriesModel.getData(o.dataType);m=y.getItemModel(o.dataIndex)}s.on("drag",i(l,m.getModel("labelLine")))}}else s.off("drag"),s.cursor=u.cursor}},t.prototype.layout=function(e){var r=e.getWidth(),n=e.getHeight(),i=DP(this._labelList),a=Xt(i,function(l){return l.layoutOption.moveOverlap==="shiftX"}),o=Xt(i,function(l){return l.layoutOption.moveOverlap==="shiftY"});Yee(a,0,r),AP(o,0,n);var s=Xt(i,function(l){return l.layoutOption.hideOverlap});TP(s)},t.prototype.processLabelsOverall=function(){var e=this;H(this._chartViewList,function(r){var n=r.__model,i=r.ignoreLabelLineUpdate,a=n.isAnimationEnabled();r.group.traverse(function(o){if(o.ignore&&!o.forceLabelAnimation)return!0;var s=!i,l=o.getTextContent();!s&&l&&(s=X1(l).needsUpdateLabelLine),s&&e._updateLabelLine(o,n),a&&e._animateLabels(o,n)})})},t.prototype._updateLabelLine=function(e,r){var n=e.getTextContent(),i=ot(e),a=i.dataIndex;if(n&&a!=null){var o=r.getData(i.dataType),s=o.getItemModel(a),l={},u=o.getItemVisual(a,"style");if(u){var c=o.getVisual("drawType");l.stroke=u[c]}var f=s.getModel("labelLine");xP(e,SP(s),l),CP(e,f)}},t.prototype._animateLabels=function(e,r){var n=e.getTextContent(),i=e.getTextGuideLine();if(n&&(e.forceLabelAnimation||!n.ignore&&!n.invisible&&!e.disableLabelAnimation&&!gl(e))){var a=X1(n),o=a.oldLayout,s=ot(e),l=s.dataIndex,u={x:n.x,y:n.y,rotation:n.rotation},c=r.getData(s.dataType);if(o){n.attr(o);var h=e.prevStates;h&&(ct(h,"select")>=0&&n.attr(a.oldLayoutSelect),ct(h,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),ur(n,u,r,l)}else if(n.attr(u),!ml(n).valueAnimation){var f=Ue(n.style.opacity,1);n.style.opacity=0,Mr(n,{style:{opacity:f}},r,l)}if(a.oldLayout=u,n.states.select){var d=a.oldLayoutSelect={};qv(d,u,Xv),qv(d,n.states.select,Xv)}if(n.states.emphasis){var p=a.oldLayoutEmphasis={};qv(p,u,Xv),qv(p,n.states.emphasis,Xv)}kK(n,l,c,r,r)}if(i&&!i.ignore&&!i.invisible){var a=woe(i),o=a.oldLayout,g={points:i.shape.points};o?(i.attr({shape:o}),ur(i,{shape:g},r)):(i.setShape(g),i.style.strokePercent=0,Mr(i,{style:{strokePercent:1}},r)),a.oldLayout=g}},t}(),Z1=Ot();function Soe(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){var i=Z1(r).labelManager;i||(i=Z1(r).labelManager=new xoe),i.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(e,r,n){var i=Z1(r).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var Pi=Gi.CMD;function jl(t,e){return Math.abs(t-e)<1e-5}function K1(t){var e=t.data,r=t.len(),n=[],i,a=0,o=0,s=0,l=0;function u(R,B){i&&i.length>2&&n.push(i),i=[R,B]}function c(R,B,I,N){jl(R,I)&&jl(B,N)||i.push(R,B,I,N,I,N)}function f(R,B,I,N,k,z){var V=Math.abs(B-R),F=Math.tan(V/4)*4/3,L=B<R?-1:1,q=Math.cos(R),K=Math.sin(R),ee=Math.cos(B),te=Math.sin(B),j=q*k+I,J=K*z+N,W=ee*k+I,U=te*z+N,Q=k*F*L,Z=z*F*L;i.push(j-Q*K,J+Z*q,W+Q*te,U-Z*ee,W,U)}for(var h,d,p,g,v=0;v<r;){var m=e[v++],y=v===1;switch(y&&(a=e[v],o=e[v+1],s=a,l=o,(m===Pi.L||m===Pi.C||m===Pi.Q)&&(i=[s,l])),m){case Pi.M:a=s=e[v++],o=l=e[v++],u(s,l);break;case Pi.L:h=e[v++],d=e[v++],c(a,o,h,d),a=h,o=d;break;case Pi.C:i.push(e[v++],e[v++],e[v++],e[v++],a=e[v++],o=e[v++]);break;case Pi.Q:h=e[v++],d=e[v++],p=e[v++],g=e[v++],i.push(a+2/3*(h-a),o+2/3*(d-o),p+2/3*(h-p),g+2/3*(d-g),p,g),a=p,o=g;break;case Pi.A:var b=e[v++],C=e[v++],w=e[v++],_=e[v++],x=e[v++],D=e[v++]+x;v+=1;var E=!e[v++];h=Math.cos(x)*w+b,d=Math.sin(x)*_+C,y?(s=h,l=d,u(s,l)):c(a,o,h,d),a=Math.cos(D)*w+b,o=Math.sin(D)*_+C;for(var T=(E?-1:1)*Math.PI/2,A=x;E?A>D:A<D;A+=T){var O=E?Math.max(A+T,D):Math.min(A+T,D);f(A,O,b,C,w,_)}break;case Pi.R:s=a=e[v++],l=o=e[v++],h=s+e[v++],d=l+e[v++],u(h,l),c(h,l,h,d),c(h,d,s,d),c(s,d,s,l),c(s,l,h,l);break;case Pi.Z:i&&c(a,o,s,l),a=s,o=l;break}}return i&&i.length>2&&n.push(i),n}function Q1(t,e,r,n,i,a,o,s,l,u){if(jl(t,r)&&jl(e,n)&&jl(i,o)&&jl(a,s)){l.push(o,s);return}var c=2/u,f=c*c,h=o-t,d=s-e,p=Math.sqrt(h*h+d*d);h/=p,d/=p;var g=r-t,v=n-e,m=i-o,y=a-s,b=g*g+v*v,C=m*m+y*y;if(b<f&&C<f){l.push(o,s);return}var w=h*g+d*v,_=-h*m-d*y,x=b-w*w,D=C-_*_;if(x<f&&w>=0&&D<f&&_>=0){l.push(o,s);return}var E=[],T=[];Ca(t,r,i,o,.5,E),Ca(e,n,a,s,.5,T),Q1(E[0],T[0],E[1],T[1],E[2],T[2],E[3],T[3],l,u),Q1(E[4],T[4],E[5],T[5],E[6],T[6],E[7],T[7],l,u)}function Doe(t,e){var r=K1(t),n=[];e=e||1;for(var i=0;i<r.length;i++){var a=r[i],o=[],s=a[0],l=a[1];o.push(s,l);for(var u=2;u<a.length;){var c=a[u++],f=a[u++],h=a[u++],d=a[u++],p=a[u++],g=a[u++];Q1(s,l,c,f,h,d,p,g,o,e),s=p,l=g}n.push(o)}return n}function HI(t,e,r){var n=t[e],i=t[1-e],a=Math.abs(n/i),o=Math.ceil(Math.sqrt(a*r)),s=Math.floor(r/o);s===0&&(s=1,o=r);for(var l=[],u=0;u<o;u++)l.push(s);var c=o*s,f=r-c;if(f>0)for(var u=0;u<f;u++)l[u%o]+=1;return l}function VI(t,e,r){for(var n=t.r0,i=t.r,a=t.startAngle,o=t.endAngle,s=Math.abs(o-a),l=s*i,u=i-n,c=l>Math.abs(u),f=HI([l,u],c?0:1,e),h=(c?s:u)/f.length,d=0;d<f.length;d++)for(var p=(c?u:s)/f[d],g=0;g<f[d];g++){var v={};c?(v.startAngle=a+h*d,v.endAngle=a+h*(d+1),v.r0=n+p*g,v.r=n+p*(g+1)):(v.startAngle=a+p*g,v.endAngle=a+p*(g+1),v.r0=n+h*d,v.r=n+h*(d+1)),v.clockwise=t.clockwise,v.cx=t.cx,v.cy=t.cy,r.push(v)}}function Eoe(t,e,r){for(var n=t.width,i=t.height,a=n>i,o=HI([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",f=t[s]/o.length,h=0;h<o.length;h++)for(var d=t[l]/o[h],p=0;p<o[h];p++){var g={};g[u]=h*f,g[c]=p*d,g[s]=f,g[l]=d,g.x+=t.x,g.y+=t.y,r.push(g)}}function WI(t,e,r,n){return t*n-r*e}function Aoe(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,c=o-i,f=s-a,h=WI(c,f,l,u);if(Math.abs(h)<1e-6)return null;var d=t-i,p=e-a,g=WI(d,p,c,f)/h;return g<0||g>1?null:new Pe(g*l+t,g*u+e)}function Toe(t,e,r){var n=new Pe;Pe.sub(n,r,e),n.normalize();var i=new Pe;Pe.sub(i,t,e);var a=i.dot(n);return a}function zl(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function Ooe(t,e,r){for(var n=t.length,i=[],a=0;a<n;a++){var o=t[a],s=t[(a+1)%n],l=Aoe(o[0],o[1],s[0],s[1],e.x,e.y,r.x,r.y);l&&i.push({projPt:Toe(l,e,r),pt:l,idx:a})}if(i.length<2)return[{points:t},{points:t}];i.sort(function(v,m){return v.projPt-m.projPt});var u=i[0],c=i[i.length-1];if(c.idx<u.idx){var f=u;u=c,c=f}for(var h=[u.pt.x,u.pt.y],d=[c.pt.x,c.pt.y],p=[h],g=[d],a=u.idx+1;a<=c.idx;a++)zl(p,t[a].slice());zl(p,d),zl(p,h);for(var a=c.idx+1;a<=u.idx+n;a++)zl(g,t[a%n].slice());return zl(g,h),zl(g,d),[{points:p},{points:g}]}function $I(t){var e=t.points,r=[],n=[];M2(e,r,n);var i=new ft(r[0],r[1],n[0]-r[0],n[1]-r[1]),a=i.width,o=i.height,s=i.x,l=i.y,u=new Pe,c=new Pe;return a>o?(u.x=c.x=s+a/2,u.y=l,c.y=l+o):(u.y=c.y=l+o/2,u.x=s,c.x=s+a),Ooe(e,u,c)}function Zv(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);Zv(t,a[0],i,n),Zv(t,a[1],r-i,n)}return n}function Moe(t,e){for(var r=[],n=0;n<e;n++)r.push(_y(t));return r}function Poe(t,e){e.setStyle(t.style),e.z=t.z,e.z2=t.z2,e.zlevel=t.zlevel}function Roe(t){for(var e=[],r=0;r<t.length;)e.push([t[r++],t[r++]]);return e}function Boe(t,e){var r=[],n=t.shape,i;switch(t.type){case"rect":Eoe(n,e,r),i=er;break;case"sector":VI(n,e,r),i=Si;break;case"circle":VI({r0:0,r:n.r,startAngle:0,endAngle:Math.PI*2,cx:n.cx,cy:n.cy},e,r),i=Si;break;default:var a=t.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=De(Doe(t.getUpdatedPathProxy(),o),function(m){return Roe(m)}),l=s.length;if(l===0)Zv($I,{points:s[0]},e,r);else if(l===e)for(var u=0;u<l;u++)r.push({points:s[u]});else{var c=0,f=De(s,function(m){var y=[],b=[];M2(m,y,b);var C=(b[1]-y[1])*(b[0]-y[0]);return c+=C,{poly:m,area:C}});f.sort(function(m,y){return y.area-m.area});for(var h=e,u=0;u<l;u++){var d=f[u];if(h<=0)break;var p=u===l-1?h:Math.ceil(d.area/c*e);p<0||(Zv($I,{points:d.poly},p,r),h-=p)}}i=Ph;break}if(!i)return Moe(t,e);for(var g=[],u=0;u<r.length;u++){var v=new i;v.setShape(r[u]),Poe(t,v),g.push(v)}return g}function Ioe(t,e){var r=t.length,n=e.length;if(r===n)return[t,e];for(var i=[],a=[],o=r<n?t:e,s=Math.min(r,n),l=Math.abs(n-r)/6,u=(s-2)/6,c=Math.ceil(l/u)+1,f=[o[0],o[1]],h=l,d=2;d<s;){var p=o[d-2],g=o[d-1],v=o[d++],m=o[d++],y=o[d++],b=o[d++],C=o[d++],w=o[d++];if(h<=0){f.push(v,m,y,b,C,w);continue}for(var _=Math.min(h,c-1)+1,x=1;x<=_;x++){var D=x/_;Ca(p,v,y,C,D,i),Ca(g,m,b,w,D,a),p=i[3],g=a[3],f.push(i[1],a[1],i[2],a[2],p,g),v=i[5],m=a[5],y=i[6],b=a[6]}h-=_-1}return o===t?[f,e]:[t,f]}function GI(t,e){for(var r=t.length,n=t[r-2],i=t[r-1],a=[],o=0;o<e.length;)a[o++]=n,a[o++]=i;return a}function Noe(t,e){for(var r,n,i,a=[],o=[],s=0;s<Math.max(t.length,e.length);s++){var l=t[s],u=e[s],c=void 0,f=void 0;l?u?(r=Ioe(l,u),c=r[0],f=r[1],n=c,i=f):(f=GI(i||l,l),c=l):(c=GI(n||u,u),f=u),a.push(c),o.push(f)}return[a,o]}function UI(t){for(var e=0,r=0,n=0,i=t.length,a=0,o=i-2;a<i;o=a,a+=2){var s=t[o],l=t[o+1],u=t[a],c=t[a+1],f=s*c-u*l;e+=f,r+=(s+u)*f,n+=(l+c)*f}return e===0?[t[0]||0,t[1]||0]:[r/e/3,n/e/3,e]}function Foe(t,e,r,n){for(var i=(t.length-2)/6,a=1/0,o=0,s=t.length,l=s-2,u=0;u<i;u++){for(var c=u*6,f=0,h=0;h<s;h+=2){var d=h===0?c:(c+h-2)%l+2,p=t[d]-r[0],g=t[d+1]-r[1],v=e[h]-n[0],m=e[h+1]-n[1],y=v-p,b=m-g;f+=y*y+b*b}f<a&&(a=f,o=u)}return o}function Loe(t){for(var e=[],r=t.length,n=0;n<r;n+=2)e[n]=t[r-n-2],e[n+1]=t[r-n-1];return e}function koe(t,e,r,n){for(var i=[],a,o=0;o<t.length;o++){var s=t[o],l=e[o],u=UI(s),c=UI(l);a==null&&(a=u[2]<0!=c[2]<0);var f=[],h=[],d=0,p=1/0,g=[],v=s.length;a&&(s=Loe(s));for(var m=Foe(s,l,u,c)*6,y=v-2,b=0;b<y;b+=2){var C=(m+b)%y+2;f[b+2]=s[C]-u[0],f[b+3]=s[C+1]-u[1]}f[0]=s[m]-u[0],f[1]=s[m+1]-u[1];for(var w=n/r,_=-n/2;_<=n/2;_+=w){for(var x=Math.sin(_),D=Math.cos(_),E=0,b=0;b<s.length;b+=2){var T=f[b],A=f[b+1],O=l[b]-c[0],R=l[b+1]-c[1],B=O*D-R*x,I=O*x+R*D;g[b]=B,g[b+1]=I;var N=B-T,k=I-A;E+=N*N+k*k}if(E<p){p=E,d=_;for(var z=0;z<g.length;z++)h[z]=g[z]}}i.push({from:f,to:h,fromCp:u,toCp:c,rotation:-d})}return i}function Kv(t){return t.__isCombineMorphing}var YI="__mOriginal_";function Qv(t,e,r){var n=YI+e,i=t[n]||t[e];t[n]||(t[n]=t[e]);var a=r.replace,o=r.after,s=r.before;t[e]=function(){var l=arguments,u;return s&&s.apply(this,l),a?u=a.apply(this,l):u=i.apply(this,l),o&&o.apply(this,l),u}}function Gc(t,e){var r=YI+e;t[r]&&(t[e]=t[r],t[r]=null)}function qI(t,e){for(var r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;){var a=n[i],o=n[i+1];n[i++]=e[0]*a+e[2]*o+e[4],n[i++]=e[1]*a+e[3]*o+e[5]}}function XI(t,e){var r=t.getUpdatedPathProxy(),n=e.getUpdatedPathProxy(),i=Noe(K1(r),K1(n)),a=i[0],o=i[1],s=t.getComputedTransform(),l=e.getComputedTransform();function u(){this.transform=null}s&&qI(a,s),l&&qI(o,l),Qv(e,"updateTransform",{replace:u}),e.transform=null;var c=koe(a,o,10,Math.PI),f=[];Qv(e,"buildPath",{replace:function(h){for(var d=e.__morphT,p=1-d,g=[],v=0;v<c.length;v++){var m=c[v],y=m.from,b=m.to,C=m.rotation*d,w=m.fromCp,_=m.toCp,x=Math.sin(C),D=Math.cos(C);Yd(g,w,_,d);for(var E=0;E<y.length;E+=2){var T=y[E],A=y[E+1],O=b[E],R=b[E+1],B=T*p+O*d,I=A*p+R*d;f[E]=B*D-I*x+g[0],f[E+1]=B*x+I*D+g[1]}var N=f[0],k=f[1];h.moveTo(N,k);for(var E=2;E<y.length;){var O=f[E++],R=f[E++],z=f[E++],V=f[E++],F=f[E++],L=f[E++];N===O&&k===R&&z===F&&V===L?h.lineTo(F,L):h.bezierCurveTo(O,R,z,V,F,L),N=F,k=L}}}})}function J1(t,e,r){if(!t||!e)return e;var n=r.done,i=r.during;XI(t,e),e.__morphT=0;function a(){Gc(e,"buildPath"),Gc(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},rt({during:function(o){e.dirtyShape(),i&&i(o)},done:function(){a(),n&&n()}},r)),e}function joe(t,e,r,n,i,a){var o=16;t=i===r?0:Math.round(32767*(t-r)/(i-r)),e=a===n?0:Math.round(32767*(e-n)/(a-n));for(var s=0,l,u=(1<<o)/2;u>0;u/=2){var c=0,f=0;(t&u)>0&&(c=1),(e&u)>0&&(f=1),s+=u*u*(3*c^f),f===0&&(c===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function Jv(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=De(t,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),f=l.y+l.height/2+(u?u[5]:0);return e=Math.min(c,e),r=Math.min(f,r),n=Math.max(c,n),i=Math.max(f,i),[c,f]}),o=De(a,function(s,l){return{cp:s,z:joe(s[0],s[1],e,r,n,i),path:t[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function ZI(t){return Boe(t.path,t.count)}function e_(){return{fromIndividuals:[],toIndividuals:[],count:0}}function zoe(t,e,r){var n=[];function i(w){for(var _=0;_<w.length;_++){var x=w[_];Kv(x)?i(x.childrenRef()):x instanceof at&&n.push(x)}}i(t);var a=n.length;if(!a)return e_();var o=r.dividePath||ZI,s=o({path:e,count:a});if(s.length!==a)return console.error("Invalid morphing: unmatched splitted path"),e_();n=Jv(n),s=Jv(s);for(var l=r.done,u=r.during,c=r.individualDelay,f=new Wu,h=0;h<a;h++){var d=n[h],p=s[h];p.parent=e,p.copyTransform(f),c||XI(d,p)}e.__isCombineMorphing=!0,e.childrenRef=function(){return s};function g(w){for(var _=0;_<s.length;_++)s[_].addSelfToZr(w)}Qv(e,"addSelfToZr",{after:function(w){g(w)}}),Qv(e,"removeSelfFromZr",{after:function(w){for(var _=0;_<s.length;_++)s[_].removeSelfFromZr(w)}});function v(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,Gc(e,"addSelfToZr"),Gc(e,"removeSelfFromZr")}var m=s.length;if(c)for(var y=m,b=function(){y--,y===0&&(v(),l&&l())},h=0;h<m;h++){var C=c?rt({delay:(r.delay||0)+c(h,m,n[h],s[h]),done:b},r):r;J1(n[h],s[h],C)}else e.__morphT=0,e.animateTo({__morphT:1},rt({during:function(w){for(var _=0;_<m;_++){var x=s[_];x.__morphT=e.__morphT,x.dirtyShape()}u&&u(w)},done:function(){v();for(var w=0;w<t.length;w++)Gc(t[w],"updateTransform");l&&l()}},r));return e.__zr&&g(e.__zr),{fromIndividuals:n,toIndividuals:s,count:m}}function Hoe(t,e,r){var n=e.length,i=[],a=r.dividePath||ZI;function o(d){for(var p=0;p<d.length;p++){var g=d[p];Kv(g)?o(g.childrenRef()):g instanceof at&&i.push(g)}}if(Kv(t)){o(t.childrenRef());var s=i.length;if(s<n)for(var l=0,u=s;u<n;u++)i.push(_y(i[l++%s]));i.length=n}else{i=a({path:t,count:n});for(var c=t.getComputedTransform(),u=0;u<i.length;u++)i[u].setLocalTransform(c);if(i.length!==n)return console.error("Invalid morphing: unmatched splitted path"),e_()}i=Jv(i),e=Jv(e);for(var f=r.individualDelay,u=0;u<n;u++){var h=f?rt({delay:(r.delay||0)+f(u,n,i[u],e[u])},r):r;J1(i[u],e[u],h)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}function KI(t){return ge(t[0])}function QI(t,e){for(var r=[],n=t.length,i=0;i<n;i++)r.push({one:t[i],many:[]});for(var i=0;i<e.length;i++){var a=e[i].length,o=void 0;for(o=0;o<a;o++)r[o%n].many.push(e[i][o])}for(var s=0,i=n-1;i>=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var Voe={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n<t.count;n++){var i=_y(t.path);i.setStyle("opacity",r),e.push(i)}return e},split:null};function t_(t,e,r,n,i,a){if(!t.length||!e.length)return;var o=pl("update",n,i);if(!(o&&o.duration>0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,c;KI(t)&&(u=t,c=e),KI(e)&&(u=e,c=t);function f(m,y,b,C,w){var _=m.many,x=m.one;if(_.length===1&&!w){var D=y?_[0]:x,E=y?x:_[0];if(Kv(D))f({many:[D],one:E},!0,b,C,!0);else{var T=s?rt({delay:s(b,C)},l):l;J1(D,E,T),a(D,E,D,E,T)}}else for(var A=rt({dividePath:Voe[r],individualDelay:s&&function(k,z,V,F){return s(k+b,C)}},l),O=y?zoe(_,x,A):Hoe(x,_,A),R=O.fromIndividuals,B=O.toIndividuals,I=R.length,N=0;N<I;N++){var T=s?rt({delay:s(N,I)},l):l;a(R[N],B[N],y?_[N]:m.one,y?m.one:_[N],T)}}for(var h=u?u===t:t.length>e.length,d=u?QI(c,u):QI(h?e:t,[h?t:e]),p=0,g=0;g<d.length;g++)p+=d[g].many.length;for(var v=0,g=0;g<d.length;g++)f(d[g],h,v,p),v+=d[g].many.length}function ls(t){if(!t)return[];if(ge(t)){for(var e=[],r=0;r<t.length;r++)e.push(ls(t[r]));return e}var n=[];return t.traverse(function(i){i instanceof at&&!i.disableMorphing&&!i.invisible&&!i.ignore&&n.push(i)}),n}var JI=1e4,Woe=0,e8=1,t8=2,$oe=Ot();function Goe(t,e){for(var r=t.dimensions,n=0;n<r.length;n++){var i=t.getDimensionInfo(r[n]);if(i&&i.otherDims[e]===0)return r[n]}}function Uoe(t,e,r){var n=t.getDimensionInfo(r),i=n&&n.ordinalMeta;if(n){var a=t.get(n.name,e);return i&&i.categories[a]||a+""}}function r8(t,e,r,n){var i=n?"itemChildGroupId":"itemGroupId",a=Goe(t,i);if(a){var o=Uoe(t,e,a);return o}var s=t.getRawDataItem(e),l=n?"childGroupId":"groupId";if(s&&s[l])return s[l]+"";if(!n)return r||t.getId(e)}function n8(t){var e=[];return H(t,function(r){var n=r.data,i=r.dataGroupId;if(n.count()>JI){process.env.NODE_ENV!=="production"&&tr("Universal transition is disabled on large data > 10k.");return}for(var a=n.getIndices(),o=0;o<a.length;o++)e.push({data:n,groupId:r8(n,o,i,!1),childGroupId:r8(n,o,i,!0),divide:r.divide,dataIndex:o})}),e}function r_(t,e,r){t.traverse(function(n){n instanceof at&&Mr(n,{style:{opacity:0}},e,{dataIndex:r,isFrom:!0})})}function n_(t){if(t.parent){var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function Hl(t){t.stopAnimation(),t.isGroup&&t.traverse(function(e){e.stopAnimation()})}function Yoe(t,e,r){var n=pl("update",r,e);n&&t.traverse(function(i){if(i instanceof xa){var a=bK(i);a&&i.animateFrom({style:a},n)}})}function qoe(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++){var i=t[n],a=e[n];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function i8(t,e,r){var n=n8(t),i=n8(e);function a(b,C,w,_,x){(w||b)&&C.animateFrom({style:w&&w!==b?ue(ue({},w.style),b.style):b.style},x)}var o=!1,s=Woe,l=je(),u=je();n.forEach(function(b){b.groupId&&l.set(b.groupId,!0),b.childGroupId&&u.set(b.childGroupId,!0)});for(var c=0;c<i.length;c++){var f=i[c].groupId;if(u.get(f)){s=e8;break}var h=i[c].childGroupId;if(h&&l.get(h)){s=t8;break}}function d(b,C){return function(w){var _=w.data,x=w.dataIndex;return C?_.getId(x):b?s===e8?w.childGroupId:w.groupId:s===t8?w.childGroupId:w.groupId}}var p=qoe(n,i),g={};if(!p)for(var c=0;c<i.length;c++){var v=i[c],m=v.data.getItemGraphicEl(v.dataIndex);m&&(g[m.id]=!0)}function y(b,C){var w=n[C],_=i[b],x=_.data.hostModel,D=w.data.getItemGraphicEl(w.dataIndex),E=_.data.getItemGraphicEl(_.dataIndex);if(D===E){E&&Yoe(E,_.dataIndex,x);return}D&&g[D.id]||E&&(Hl(E),D?(Hl(D),n_(D),o=!0,t_(ls(D),ls(E),_.divide,x,b,a)):r_(E,x,b))}new Ny(n,i,d(!0,p),d(!1,p),null,"multiple").update(y).updateManyToOne(function(b,C){var w=i[b],_=w.data,x=_.hostModel,D=_.getItemGraphicEl(w.dataIndex),E=Xt(De(C,function(T){return n[T].data.getItemGraphicEl(n[T].dataIndex)}),function(T){return T&&T!==D&&!g[T.id]});D&&(Hl(D),E.length?(H(E,function(T){Hl(T),n_(T)}),o=!0,t_(ls(E),ls(D),w.divide,x,b,a)):r_(D,x,w.dataIndex))}).updateOneToMany(function(b,C){var w=n[C],_=w.data.getItemGraphicEl(w.dataIndex);if(!(_&&g[_.id])){var x=Xt(De(b,function(E){return i[E].data.getItemGraphicEl(i[E].dataIndex)}),function(E){return E&&E!==_}),D=i[b[0]].data.hostModel;x.length&&(H(x,function(E){return Hl(E)}),_?(Hl(_),n_(_),o=!0,t_(ls(_),ls(x),w.divide,D,b[0],a)):H(x,function(E){return r_(E,D,b[0])}))}}).updateManyToMany(function(b,C){new Ny(C,b,function(w){return n[w].data.getId(n[w].dataIndex)},function(w){return i[w].data.getId(i[w].dataIndex)}).update(function(w,_){y(b[w],C[_])}).execute()}).execute(),o&&H(e,function(b){var C=b.data,w=C.hostModel,_=w&&r.getViewOfSeriesModel(w),x=pl("update",w,0);_&&w.isAnimationEnabled()&&x&&x.duration>0&&_.group.traverse(function(D){D instanceof at&&!D.animators.length&&D.animateFrom({style:{opacity:0}},x)})})}function a8(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function o8(t){return ge(t)?t.sort().join(","):t}function Ha(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function Xoe(t,e){var r=je(),n=je(),i=je();H(t.oldSeries,function(o,s){var l=t.oldDataGroupIds[s],u=t.oldData[s],c=a8(o),f=o8(c);n.set(f,{dataGroupId:l,data:u}),ge(c)&&H(c,function(h){i.set(h,{key:f,dataGroupId:l,data:u})})});function a(o){r.get(o)&&tr("Duplicated seriesKey in universalTransition "+o)}return H(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=a8(o),c=o8(u),f=n.get(c);if(f)process.env.NODE_ENV!=="production"&&a(c),r.set(c,{oldSeries:[{dataGroupId:f.dataGroupId,divide:Ha(f.data),data:f.data}],newSeries:[{dataGroupId:s,divide:Ha(l),data:l}]});else if(ge(u)){process.env.NODE_ENV!=="production"&&a(c);var h=[];H(u,function(g){var v=n.get(g);v.data&&h.push({dataGroupId:v.dataGroupId,divide:Ha(v.data),data:v.data})}),h.length&&r.set(c,{oldSeries:h,newSeries:[{dataGroupId:s,data:l,divide:Ha(l)}]})}else{var d=i.get(u);if(d){var p=r.get(d.key);p||(p={oldSeries:[{dataGroupId:d.dataGroupId,data:d.data,divide:Ha(d.data)}],newSeries:[]},r.set(d.key,p)),p.newSeries.push({dataGroupId:s,data:l,divide:Ha(l)})}}}}),r}function s8(t,e){for(var r=0;r<t.length;r++){var n=e.seriesIndex!=null&&e.seriesIndex===t[r].seriesIndex||e.seriesId!=null&&e.seriesId===t[r].id;if(n)return r}}function Zoe(t,e,r,n){var i=[],a=[];H(kt(t.from),function(o){var s=s8(e.oldSeries,o);s>=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:Ha(e.oldData[s]),groupIdDim:o.dimension})}),H(kt(t.to),function(o){var s=s8(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:Ha(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&i8(i,a,n)}function Koe(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){H(kt(n.seriesTransition),function(i){H(kt(i.to),function(a){for(var o=n.updatedSeries,s=0;s<o.length;s++)(a.seriesIndex!=null&&a.seriesIndex===o[s].seriesIndex||a.seriesId!=null&&a.seriesId===o[s].id)&&(o[s][uv]=!0)})})}),t.registerUpdateLifecycle("series:transition",function(e,r,n){var i=$oe(r);if(i.oldSeries&&n.updatedSeries&&n.optionChanged){var a=n.seriesTransition;if(a)H(kt(a),function(d){Zoe(d,i,n,r)});else{var o=Xoe(i,n);H(o.keys(),function(d){var p=o.get(d);i8(p.oldSeries,p.newSeries,r)})}H(n.updatedSeries,function(d){d[uv]&&(d[uv]=!1)})}for(var s=e.getSeries(),l=i.oldSeries=[],u=i.oldDataGroupIds=[],c=i.oldData=[],f=0;f<s.length;f++){var h=s[f].getData();h.count()<JI&&(l.push(s[f]),u.push(s[f].get("dataGroupId")),c.push(h))}})}function l8(t,e,r){var n=Us.createCanvas(),i=e.getWidth(),a=e.getHeight(),o=n.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=i+"px",o.height=a+"px",n.setAttribute("data-zr-dom-id",t)),n.width=i*r,n.height=a*r,n}var i_=function(t){ve(e,t);function e(r,n,i){var a=t.call(this)||this;a.motionBlur=!1,a.lastFrameAlpha=.7,a.dpr=1,a.virtual=!1,a.config={},a.incremental=!1,a.zlevel=0,a.maxRepaintRectCount=5,a.__dirty=!0,a.__firstTimePaint=!0,a.__used=!1,a.__drawIndex=0,a.__startIndex=0,a.__endIndex=0,a.__prevStartIndex=null,a.__prevEndIndex=null;var o;i=i||lh,typeof r=="string"?o=l8(r,n,i):Oe(r)&&(o=r,r=o.id),a.id=r,a.dom=o;var s=o.style;return s&&(UA(o),o.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),a.painter=n,a.dpr=i,a}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var r=this.dpr;this.domBack=l8("back-"+this.id,this.painter,r),this.ctxBack=this.domBack.getContext("2d"),r!==1&&this.ctxBack.scale(r,r)},e.prototype.createRepaintRects=function(r,n,i,a){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,u=new ft(0,0,0,0);function c(y){if(!(!y.isFinite()||y.isZero()))if(o.length===0){var b=new ft(0,0,0,0);b.copy(y),o.push(b)}else{for(var C=!1,w=1/0,_=0,x=0;x<o.length;++x){var D=o[x];if(D.intersect(y)){var E=new ft(0,0,0,0);E.copy(D),E.union(y),o[x]=E,C=!0;break}else if(l){u.copy(y),u.union(D);var T=y.width*y.height,A=D.width*D.height,O=u.width*u.height,R=O-T-A;R<w&&(w=R,_=x)}}if(l&&(o[_].union(y),C=!0),!C){var b=new ft(0,0,0,0);b.copy(y),o.push(b)}l||(l=o.length>=s)}}for(var f=this.__startIndex;f<this.__endIndex;++f){var h=r[f];if(h){var d=h.shouldBePainted(i,a,!0,!0),p=h.__isRendered&&(h.__dirty&hn||!d)?h.getPrevPaintRect():null;p&&c(p);var g=d&&(h.__dirty&hn||!h.__isRendered)?h.getPaintRect():null;g&&c(g)}}for(var f=this.__prevStartIndex;f<this.__prevEndIndex;++f){var h=n[f],d=h&&h.shouldBePainted(i,a,!0,!0);if(h&&(!d||!h.__zr)&&h.__isRendered){var p=h.getPrevPaintRect();p&&c(p)}}var v;do{v=!1;for(var f=0;f<o.length;){if(o[f].isZero()){o.splice(f,1);continue}for(var m=f+1;m<o.length;)o[f].intersect(o[m])?(v=!0,o[f].union(o[m]),o.splice(m,1)):m++;f++}}while(v);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(r,n){var i=this.dpr,a=this.dom,o=a.style,s=this.domBack;o&&(o.width=r+"px",o.height=n+"px"),a.width=r*i,a.height=n*i,s&&(s.width=r*i,s.height=n*i,i!==1&&this.ctxBack.scale(i,i))},e.prototype.clear=function(r,n,i){var a=this.dom,o=this.ctx,s=a.width,l=a.height;n=n||this.clearColor;var u=this.motionBlur&&!r,c=this.lastFrameAlpha,f=this.dpr,h=this;u&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(a,0,0,s/f,l/f));var d=this.domBack;function p(g,v,m,y){if(o.clearRect(g,v,m,y),n&&n!=="transparent"){var b=void 0;if(kd(n)){var C=n.global||n.__width===m&&n.__height===y;b=C&&n.__canvasGradient||Xb(o,n,{x:0,y:0,width:m,height:y}),n.__canvasGradient=b,n.__width=m,n.__height=y}else Cq(n)&&(n.scaleX=n.scaleX||f,n.scaleY=n.scaleY||f,b=Zb(o,n,{dirty:function(){h.setUnpainted(),h.painter.refresh()}}));o.save(),o.fillStyle=b||n,o.fillRect(g,v,m,y),o.restore()}u&&(o.save(),o.globalAlpha=c,o.drawImage(d,g,v,m,y),o.restore())}!i||u?p(0,0,s,l):i.length&&H(i,function(g){p(g.x*f,g.y*f,g.width*f,g.height*f)})},e}(yi),u8=1e5,us=314159,ep=.01,Qoe=.001;function Joe(t){return t?t.__builtin__?!0:!(typeof t.resize!="function"||typeof t.refresh!="function"):!1}function ese(t,e){var r=document.createElement("div");return r.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",r}var tse=function(){function t(e,r,n,i){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var a=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=n=ue({},n||{}),this.dpr=n.devicePixelRatio||lh,this._singleCanvas=a,this.root=e;var o=e.style;o&&(UA(e),e.innerHTML=""),this.storage=r;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(a){var c=e,f=c.width,h=c.height;n.width!=null&&(f=n.width),n.height!=null&&(h=n.height),this.dpr=n.devicePixelRatio||1,c.width=f*this.dpr,c.height=h*this.dpr,this._width=f,this._height=h;var d=new i_(c,this,this.dpr);d.__builtin__=!0,d.initContext(),l[us]=d,d.zlevel=us,s.push(us),this._domRoot=e}else{this._width=Ev(e,0,n),this._height=Ev(e,1,n);var u=this._domRoot=ese(this._width,this._height);e.appendChild(u)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.refresh=function(e){var r=this.storage.getDisplayList(!0),n=this._prevDisplayList,i=this._zlevelList;this._redrawId=Math.random(),this._paintList(r,n,e,this._redrawId);for(var a=0;a<i.length;a++){var o=i[a],s=this._layers[o];if(!s.__builtin__&&s.refresh){var l=a===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=r.slice()),this},t.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},t.prototype._paintHoverList=function(e){var r=e.length,n=this._hoverlayer;if(n&&n.clear(),!!r){for(var i={inHover:!0,viewWidth:this._width,viewHeight:this._height},a,o=0;o<r;o++){var s=e[o];s.__inHover&&(n||(n=this._hoverlayer=this.getLayer(u8)),a||(a=n.ctx,a.save()),ns(a,s,i,o===r-1))}a&&a.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(u8)},t.prototype.paintOne=function(e,r){NR(e,r)},t.prototype._paintList=function(e,r,n,i){if(this._redrawId===i){n=n||!1,this._updateLayerStatus(e);var a=this._doPaintList(e,r,n),o=a.finished,s=a.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),o)this.eachLayer(function(u){u.afterBrush&&u.afterBrush()});else{var l=this;yv(function(){l._paintList(e,r,n,i)})}}},t.prototype._compositeManually=function(){var e=this.getLayer(us).ctx,r=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,r,n),this.eachBuiltinLayer(function(i){i.virtual&&e.drawImage(i.dom,0,0,r,n)})},t.prototype._doPaintList=function(e,r,n){for(var i=this,a=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],u=this._layers[l];u.__builtin__&&u!==this._hoverlayer&&(u.__dirty||n)&&a.push(u)}for(var c=!0,f=!1,h=function(g){var v=a[g],m=v.ctx,y=o&&v.createRepaintRects(e,r,d._width,d._height),b=n?v.__startIndex:v.__drawIndex,C=!n&&v.incremental&&Date.now,w=C&&Date.now(),_=v.zlevel===d._zlevelList[0]?d._backgroundColor:null;if(v.__startIndex===v.__endIndex)v.clear(!1,_,y);else if(b===v.__startIndex){var x=e[b];(!x.incremental||!x.notClear||n)&&v.clear(!1,_,y)}b===-1&&(console.error("For some unknown reason. drawIndex is -1"),b=v.__startIndex);var D,E=function(R){var B={inHover:!1,allClipped:!1,prevEl:null,viewWidth:i._width,viewHeight:i._height};for(D=b;D<v.__endIndex;D++){var I=e[D];if(I.__inHover&&(f=!0),i._doPaintEl(I,v,o,R,B,D===v.__endIndex-1),C){var N=Date.now()-w;if(N>15)break}}B.prevElClipPaths&&m.restore()};if(y)if(y.length===0)D=v.__endIndex;else for(var T=d.dpr,A=0;A<y.length;++A){var O=y[A];m.save(),m.beginPath(),m.rect(O.x*T,O.y*T,O.width*T,O.height*T),m.clip(),E(O),m.restore()}else m.save(),E(),m.restore();v.__drawIndex=D,v.__drawIndex<v.__endIndex&&(c=!1)},d=this,p=0;p<a.length;p++)h(p);return $e.wxa&&H(this._layers,function(g){g&&g.ctx&&g.ctx.draw&&g.ctx.draw()}),{finished:c,needsRefreshHover:f}},t.prototype._doPaintEl=function(e,r,n,i,a,o){var s=r.ctx;if(n){var l=e.getPaintRect();(!i||l&&l.intersect(i))&&(ns(s,e,a,o),e.setPrevPaintRect(l))}else ns(s,e,a,o)},t.prototype.getLayer=function(e,r){this._singleCanvas&&!this._needsManuallyCompositing&&(e=us);var n=this._layers[e];return n||(n=new i_("zr_"+e,this,this.dpr),n.zlevel=e,n.__builtin__=!0,this._layerConfig[e]?bt(n,this._layerConfig[e],!0):this._layerConfig[e-ep]&&bt(n,this._layerConfig[e-ep],!0),r&&(n.virtual=r),this.insertLayer(e,n),n.initContext()),n},t.prototype.insertLayer=function(e,r){var n=this._layers,i=this._zlevelList,a=i.length,o=this._domRoot,s=null,l=-1;if(n[e]){process.env.NODE_ENV!=="production"&&So("ZLevel "+e+" has been used already");return}if(!Joe(r)){process.env.NODE_ENV!=="production"&&So("Layer of zlevel "+e+" is not valid");return}if(a>0&&e>i[0]){for(l=0;l<a-1&&!(i[l]<e&&i[l+1]>e);l++);s=n[i[l]]}if(i.splice(l+1,0,e),n[e]=r,!r.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(r.dom,u.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)},t.prototype.eachLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i];e.call(r,this._layers[a],a)}},t.prototype.eachBuiltinLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i],o=this._layers[a];o.__builtin__&&e.call(r,o,a)}},t.prototype.eachOtherLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i],o=this._layers[a];o.__builtin__||e.call(r,o,a)}},t.prototype.getLayers=function(){return this._layers},t.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(f,h){f.__dirty=f.__used=!1});function r(f){a&&(a.__endIndex!==f&&(a.__dirty=!0),a.__endIndex=f)}if(this._singleCanvas)for(var n=1;n<e.length;n++){var i=e[n];if(i.zlevel!==e[n-1].zlevel||i.incremental){this._needsManuallyCompositing=!0;break}}var a=null,o=0,s,l;for(l=0;l<e.length;l++){var i=e[l],u=i.zlevel,c=void 0;s!==u&&(s=u,o=0),i.incremental?(c=this.getLayer(u+Qoe,this._needsManuallyCompositing),c.incremental=!0,o=1):c=this.getLayer(u+(o>0?ep:0),this._needsManuallyCompositing),c.__builtin__||So("ZLevel "+u+" has been used by unkown layer "+c.id),c!==a&&(c.__used=!0,c.__startIndex!==l&&(c.__dirty=!0),c.__startIndex=l,c.incremental?c.__drawIndex=-1:c.__drawIndex=l,r(l),a=c),i.__dirty&hn&&!i.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(f,h){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(e){e.clear()},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e,H(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var n=this._layerConfig;n[e]?bt(n[e],r,!0):n[e]=r;for(var i=0;i<this._zlevelList.length;i++){var a=this._zlevelList[i];if(a===e||a===e+ep){var o=this._layers[a];bt(o,n[e],!0)}}}},t.prototype.delLayer=function(e){var r=this._layers,n=this._zlevelList,i=r[e];i&&(i.dom.parentNode.removeChild(i.dom),delete r[e],n.splice(ct(n,e),1))},t.prototype.resize=function(e,r){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var i=this._opts,a=this.root;if(e!=null&&(i.width=e),r!=null&&(i.height=r),e=Ev(a,0,i),r=Ev(a,1,i),n.style.display="",this._width!==e||r!==this._height){n.style.width=e+"px",n.style.height=r+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,r);this.refresh(!0)}this._width=e,this._height=r}else{if(e==null||r==null)return;this._width=e,this._height=r,this.getLayer(us).resize(e,r)}return this},t.prototype.clearLayer=function(e){var r=this._layers[e];r&&r.clear()},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},t.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[us].dom;var r=new i_("image",this,e.pixelRatio||this.dpr);r.initContext(),r.clear(!1,e.backgroundColor||this._backgroundColor);var n=r.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var i=r.dom.width,a=r.dom.height;this.eachLayer(function(f){f.__builtin__?n.drawImage(f.dom,0,0,i,a):f.renderToCanvas&&(n.save(),f.renderToCanvas(n),n.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,u=s.length;l<u;l++){var c=s[l];ns(n,c,o,l===u-1)}return r.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t}();function rse(t){t.registerPainter("canvas",tse)}La([Sae,noe,Yae,$ae,pae,boe,goe,Nee,hee,ite,Soe,Koe,rse]),d1("ccmonet",{color:["#5B8FF9","#5AD8A6","#F6BD16","#E86452","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3","#269A99"],categoryAxis:{axisLine:{lineStyle:{color:"#e5e6eb"}},axisTick:{lineStyle:{color:"#e5e6eb"}},axisLabel:{color:"#86909C"},splitLine:{lineStyle:{color:"#f2f3f5",type:"dashed"}}},valueAxis:{axisLine:{lineStyle:{color:"#e5e6eb"}},axisTick:{lineStyle:{color:"#e5e6eb"}},axisLabel:{color:"#86909C"},splitLine:{lineStyle:{color:"#f2f3f5",type:"dashed"}}}});const nse=P.memo(({options:t,echartRef:e})=>{const r=P.useRef(null),n=P.useRef(null);return P.useEffect(()=>(r.current&&(n.current=sne(r.current,"ccmonet"),window.__chartInstanceRef=n),()=>{n.current&&n.current.dispose()}),[]),P.useEffect(()=>{n.current&&(n.current.clear(),t&&Object.keys(t).length>0&&n.current.setOption({...t}))},[t]),P.useImperativeHandle(e,()=>({resize:()=>{n.current&&n.current.resize()},getWidth:()=>{n.current&&n.current.getWidth()}})),S.jsx("div",{ref:r,style:{width:"100%",height:"100%"}})}),ise=()=>S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:139,height:118,fill:"none",children:[S.jsx("path",{fill:"#F4F4F5",d:"M124.987 58.727c0 13.227-4.202 25.657-11.204 35.463-3.879 5.36-8.511 10.035-13.898 13.684-8.618 6.044-19.068 9.465-30.164 9.465-30.488.114-55.266-26.113-55.266-58.612C14.455 26.34 39.125 0 69.721 0c11.096 0 21.438 3.421 30.164 9.465 5.387 3.649 10.019 8.324 13.898 13.683 7.002 9.921 11.204 22.237 11.204 35.579Z"}),S.jsx("path",{stroke:"#D0D0D4",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:2,d:"M2 102.569h130.77"}),S.jsx("path",{fill:"#fff",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"M93.85 50.054v52.515H23.22c-2.786 0-4.875-2.36-4.875-5.163V50.054H93.85Z"}),S.jsx("path",{fill:"#DAE1ED",d:"M121.874 50.054v47.352c0 2.95-2.323 5.163-5.082 5.163h-22.94V50.054h28.022Z"}),S.jsx("path",{fill:"#F4F4F5",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"M121.874 50.054v47.352c0 2.95-2.323 5.163-5.082 5.163h-22.94V50.054h28.022Z"}),S.jsx("path",{fill:"#C5CDDB",d:"m45.59 50.054 14.852-24.617h76.22L121.39 50.055h-75.8Z"}),S.jsx("path",{fill:"#F4F4F5",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"m45.59 50.054 14.852-24.617h76.22L121.39 50.055h-75.8Z"}),S.jsx("path",{fill:"url(#a)",d:"M121.874 50.197v27.756h-20.433c-1.898 0-3.211-1.295-3.503-3.164l-4.086-24.735 28.022.143Z",opacity:.3}),S.jsx("path",{fill:"#fff",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"M121.287 50.054H93.852l13.93 22.258c.995 1.474 2.559 2.358 4.123 2.358h21.322c1.422 0 2.417-1.769 1.564-2.948l-13.504-21.668ZM93.85 50.054 78.895 25.437H2l15.52 24.617h76.33Z"}),S.jsx("path",{fill:"#D0D0D4",d:"M56.028 80.415H26.59a1.23 1.23 0 0 1-1.238-1.231c0-.684.55-1.23 1.238-1.23h29.438a1.23 1.23 0 0 1 1.238 1.23c-.138.684-.55 1.23-1.238 1.23ZM56.028 86.159H26.59c-.688 0-1.238-.365-1.238-.82 0-.457.55-.821 1.238-.821h29.438c.687 0 1.238.364 1.238.82-.138.456-.55.82-1.238.82ZM40.44 92.723H26.61c-.699 0-1.257-.365-1.257-.82 0-.456.558-.821 1.257-.821H40.44c.699 0 1.258.365 1.258.82-.14.456-.699.821-1.258.821Z"}),S.jsx("defs",{children:S.jsxs("linearGradient",{id:"a",x1:107.869,x2:107.869,y1:78.525,y2:53.113,gradientUnits:"userSpaceOnUse",children:[S.jsx("stop",{offset:.003,stopColor:"#606673",stopOpacity:0}),S.jsx("stop",{offset:1,stopColor:"#AAB2C5"})]})})]}),c8=t=>{const{t:e}=Rt();return S.jsxs("div",{style:{color:"#A1A1AA",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[S.jsx(ise,{}),S.jsx("span",{children:e("empty")})]})};c8.displayName="Empty";const f8=["#5B8FF9","#5AD8A6","#F6BD16","#E86452","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3","#269A99"],d8=2,ase=10,h8=(t,e)=>{const r=u0("chart.pieOther"),n=t.reduce((u,c)=>u+c,0);if(n===0)return{data:t.map((u,c)=>({value:u,name:e[c]}))};const i=t.map((u,c)=>({value:u,name:e[c],percent:u/n*100}));i.sort((u,c)=>c.percent-u.percent);const a=[],o=[];if(i.forEach(u=>{u.percent>=d8&&a.length<ase-1?a.push(u):o.push(u)}),o.length===0)return{data:a.map(u=>({value:u.value,name:u.name}))};const s=o.reduce((u,c)=>u+c.value,0),l=a.map(u=>({value:u.value,name:u.name}));return l.push({value:s,name:r,_otherDetails:o.map(u=>({name:u.name,value:u.value}))}),{data:l}},ose=t=>{const{type:e,categories:r}=t,n={"chart-bar":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-bar-pile":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-bar-percentage":{xAxis:{type:"category",data:r},yAxis:{type:"value",max:100,axisLabel:{formatter:"{value} %"}}},"chart-line":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-line-smooth":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-pie":{xAxis:{show:!1},yAxis:{show:!1}},"chart-pie-circular":{xAxis:{show:!1},yAxis:{show:!1}},"chart-strip-bar":{xAxis:{type:"value"},yAxis:{type:"category",data:r}},"chart-bar-graph":{xAxis:{type:"value"},yAxis:{type:"category",data:r}},"chart-strip-bar-pile":{xAxis:{type:"value"},yAxis:{type:"category",data:r}},"chart-strip-bar-percentage":{xAxis:{type:"value",max:100,axisLabel:{formatter:"{value} %"}},yAxis:{type:"category",data:r}},[Fr.chartCombination]:{xAxis:{type:"category",data:r},yAxis:{type:"value"}}};return n[e]??n["chart-bar"]},v8=({type:t,data:e,label:r,name:n,isGroup:i,groupField:a,labels:o,colorIndex:s=0})=>{let l;const u=t==="chart-strip-bar"||t==="chart-strip-bar-pile"||t==="chart-strip-bar-percentage"||t==="chart-bar-graph",c=f8[s%f8.length],f={...r,position:"outside",formatter:r!=null&&r.show?p=>{const g=p.percent??0;return g<d8?"":`${p.name}: ${g}%`}:void 0,color:"#4E5969",fontSize:12},h={show:!0,length:12,length2:8,lineStyle:{color:"#C9CDD4"}},d={formatter:p=>{var v;const g=(v=p.data)==null?void 0:v._otherDetails;if(g&&g.length>0){const m=`<div style="margin-bottom:6px;font-weight:500">${u0("chart.pieOtherItems",{count:g.length})} (${p.percent}%)</div>`,y=g.map(b=>`<div style="display:flex;justify-content:space-between;gap:12px;line-height:22px"><span style="color:#86909C">${b.name}</span><span>${b.value}</span></div>`).join("");return`<div>${m}<div style="max-height:200px;overflow-y:auto;padding-right:8px;scrollbar-width:thin;scrollbar-color:#e5e6eb transparent">${y}</div></div>`}return`<div style="font-weight:500">${p.name}</div><div style="margin-top:4px">${p.value} (${p.percent}%)</div>`}};return t==="chart-pie"?l={data:h8(e,o).data,name:n,type:"pie",radius:"50%",label:f,labelLine:h,tooltip:d,itemStyle:{borderColor:"#fff",borderWidth:2},emphasis:{scaleSize:6}}:t==="chart-pie-circular"?l={data:h8(e,o).data,type:"pie",name:n,radius:["40%","70%"],label:f,labelLine:h,tooltip:d,itemStyle:{borderColor:"#fff",borderWidth:2},emphasis:{scaleSize:6}}:t==="chart-line"||t==="chart-line-smooth"?l={data:e,name:n,type:"line",smooth:t==="chart-line-smooth",label:r,symbol:"circle",symbolSize:6,lineStyle:{width:2.5},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:c+"33"},{offset:1,color:c+"05"}]}}}:l={data:e,name:n,type:"bar",label:r,barMaxWidth:40,itemStyle:{borderRadius:u?[0,4,4,0]:[4,4,0,0],color:u?{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:c},{offset:1,color:c+"B3"}]}:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:c},{offset:1,color:c+"B3"}]}},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.15)"}}},(t==="chart-bar-percentage"||t==="chart-bar-pile"||t==="chart-strip-bar-pile"||t==="chart-strip-bar-percentage")&&i&&a&&(l.stack=a),l},sse=({customeStyle:t,series:e,chartConfig:r,width:n})=>{var C,w,_,x;const{isLeftAxisShow:i,isRightAxisShow:a,maxLeftSeriesDataStrLen:o,maxRightSeriesDataStrLen:s,maxSeriesDataLen:l}=e.reduce((D,E)=>{var R;let T={...D},A=E.yAxisIndex==0?"left":"right",O=Math.max(...E.data.map(B=>String(B).length));return A=="left"?(T.maxLeftSeriesDataStrLen=Math.max(T.maxLeftSeriesDataStrLen,O),T.isLeftAxisShow=!0):(T.maxRightSeriesDataStrLen=Math.max(T.maxRightSeriesDataStrLen,O),T.isRightAxisShow=!0),T.maxSeriesDataLen=Math.max(T.maxSeriesDataLen,(R=E==null?void 0:E.data)==null?void 0:R.length),T},{isLeftAxisShow:!1,isRightAxisShow:!1,maxLeftSeriesDataStrLen:0,maxRightSeriesDataStrLen:0,maxSeriesDataLen:0});let u=((C=r==null?void 0:r.xAxis)==null?void 0:C.type)==="category"?"xAxis":"yAxis";const f=(x=(u==="xAxis"?(w=r==null?void 0:r.xAxis)==null?void 0:w.data:(_=r==null?void 0:r.yAxis)==null?void 0:_.data)??[])==null?void 0:x.reduce((D,E)=>{const T=String(E).length;return Math.max(D,T)},0),h=9,d=12;let p=45,g=0,v=0,m=0,y=0;if(u=="xAxis"){const D={45:h*.8,90:h,0:h};l>3&&(f>=15&&(y=90),f>5&&(y=45),n<3&&(y=90)),m=D[`${y}`]*(y==0?1:Math.min(f,18))+d,g=Math.min(o,18)*h+d,v=Math.min(s,18)*h+d}else m=Math.min(o,18)*h+d,g=Math.min(f,18)*h+d,v=d;g=Math.max(g,40),v=Math.max(v,40),i||(g=d),a||(v=d);let b=h;return t!=null&&t.xtitle&&(u=="xAxis"?m=m+b:v=v+b),t!=null&&t.ytitle&&(u=="xAxis"?g=g+b:p=p+b),{top:p+"px",left:g+"px",right:v+"px",bottom:Math.max(m,40)+"px",axisLabelRotate:y}},lse=({moduleDataApi:t,customData:e,customeStyle:r,width:n=2,height:i=2})=>{const{globalData:a,globalFilterCondition:o}=pr();let s=P.useMemo(()=>o==null?void 0:o.find(_=>(_==null?void 0:_.dataSourceId)===(e==null?void 0:e.dataSourceId)),[o,e==null?void 0:e.dataSourceId]);const[l,u]=P.useState(),[c,f]=P.useState(),h=Mt(async()=>{var w,_,x;if(u([]),e){f(!0);let D="";const E=(e==null?void 0:e.xAxis)==="tags"?"tag":e==null?void 0:e.xAxis,T=(e==null?void 0:e.groupField)==="tags"?"tag":e==null?void 0:e.groupField;e.isGroup?(e.yAxis==="recordTotal"&&(D+=`select=${E},${T},id.count()`),e.yAxis==="fieldValue"&&(e!=null&&e.yAxisField)&&(D+=`select=${E},${T},${e==null?void 0:e.yAxisField}.${e==null?void 0:e.yAxisFieldType}()`)):(e.yAxis==="recordTotal"&&(D+=`select=${E},id.count()`),e.yAxis==="fieldValue"&&(e!=null&&e.yAxisField)&&(D+=`select=${E},${e==null?void 0:e.yAxisField}.${e==null?void 0:e.yAxisFieldType}()`));let A=[];if((((w=s==null?void 0:s.conditionList)==null?void 0:w.length)??0)>0&&A.push(s),(((x=(_=e==null?void 0:e.conditionData)==null?void 0:_.conditionList)==null?void 0:x.length)??0)>0&&A.push(e==null?void 0:e.conditionData),A.length>0){let O=Ad(A);D+=O?`&${O}`:""}e!=null&&e.dataSourceId&&(t==null||t({id:e==null?void 0:e.dataSourceId,query:D}).then(O=>{if(!O.success){Y.message.error(O.message);return}u(O.data)}).finally(()=>{f(!1)}))}else u([])});M6(()=>{e&&h()},[e==null?void 0:e.dataSourceId,e==null?void 0:e.conditionData,e==null?void 0:e.sortField,e==null?void 0:e.sortOrder,e==null?void 0:e.xAxis,e==null?void 0:e.yAxis,e==null?void 0:e.yAxisField,e==null?void 0:e.yAxisFieldType,e==null?void 0:e.isGroup,e==null?void 0:e.groupField,s],{wait:60});const d=P.useMemo(()=>{var _,x;return(x=(_=a==null?void 0:a.sourceData)==null?void 0:_.find(D=>D.value===(e==null?void 0:e.dataSourceId)))==null?void 0:x.fields},[a,e==null?void 0:e.dataSourceId]),p=P.useMemo(()=>e&&l&&e.type&&l.length>0?(_=>{var st,Nt,Xe,re,Ce,me,pe,Ye,Te,ze,Ze,qe,mt,cr,fr;const x=({item:ce,field:Re,timeGroupInterval:Ke})=>Bu({fieldOptions:d,val:ce[Re],field:Re,fieldMap:a==null?void 0:a.fieldMap,timeGroupInterval:Ke,showNill:!1}),D=ce=>{const Re=d==null?void 0:d.find(Ke=>Ke.value===ce);return Re==null?void 0:Re.label},E=ce=>{var Re;return((Re=d==null?void 0:d.find(Ke=>Ke.value===ce))==null?void 0:Re.type)==="timestamp"},T={tags:"tag"},A=T[e==null?void 0:e.xAxis]??(e==null?void 0:e.xAxis),O=T[e==null?void 0:e.groupField]??(e==null?void 0:e.groupField);console.log("newGroupField",O);let R=qH(_,ce=>x({item:ce,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval})??"Unknown"),B=Object.keys(R).map(ce=>R[ce].reduce((Ne,nt)=>(Object.keys(nt).forEach(Lt=>{let on=nt[Lt];BS(on)?Ne[Lt]=Ne!=null&&Ne[Lt]?Ne[Lt]+on:on:Ne[Lt]=on}),Ne),{}));const I=new Set,N=new Set,k={},z={};B.forEach(ce=>{const Re=x({item:ce,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval})??"Unknown",Ke=e.yAxis==="recordTotal"?ce==null?void 0:ce.count:ce[e==null?void 0:e.yAxisFieldType]||0;z[Re]=Ke}),e!=null&&e.isGroup&&(e!=null&&e.groupField)&&_.forEach(ce=>{const Re=x({item:ce,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval})??"Unknown",Ke=e.yAxis==="recordTotal"?ce==null?void 0:ce.count:ce[e==null?void 0:e.yAxisFieldType]||0,Ne=x({item:ce,field:O})??"Unknown";N.add(Ne),k[Ne]||(k[Ne]={}),k[Ne][Re]=Ke}),console.log("test",{groupData:R,categories:I,stackCategories:N,valueGroups:k,valueCounts:z});const V={},F={};if(e!=null&&e.isGroup&&(e!=null&&e.groupField)){const ce={};Object.keys(k).forEach(Re=>{Object.entries(k[Re]).forEach(([Ke,Ne])=>{ce[Ke]=(ce[Ke]||0)+Ne})}),Object.keys(k).forEach(Re=>{F[Re]={},Object.entries(k[Re]).forEach(([Ke,Ne])=>{const nt=ce[Ke]||1;F[Re][Ke]=Ne/nt*100})})}else Object.entries(z).forEach(([ce,Re])=>{const Ke=Re||1;V[ce]=Re/Ke*100});let L=(e==null?void 0:e.sortField)??"xAxis",q=(e==null?void 0:e.sortOrder)??"asc";const ee=[...B].sort((ce,Re)=>{let Ke,Ne;switch(L){case"xAxis":Ke=x({item:ce,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval}),Ne=x({item:Re,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval});break;case"yAxisField":Ke=e.yAxis==="recordTotal"?ce==null?void 0:ce.count:ce[e==null?void 0:e.yAxisFieldType]||0,Ne=e.yAxis==="recordTotal"?Re==null?void 0:Re.count:Re[e==null?void 0:e.yAxisFieldType]||0;break}const nt=q==="asc"?1:-1;return Ke>Ne?1*nt:Ke<Ne?-1*nt:0}).map(ce=>x({item:ce,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval})??"Unknown");if(I.clear(),ee.forEach(ce=>I.add(ce)),!E(e==null?void 0:e.xAxis)&&e.displayRange!=="ALL"&&e.displayRange){let ce=Array.from(I).sort((nt,Lt)=>z[Lt]-z[nt]),Re=[],[Ke,Ne]=e.displayRange.split("_");Ke==="TOP"?Re=ce.slice(0,Number(Ne)):Re=ce.slice(-Number(Ne)),Array.from(I).forEach(nt=>(Re.includes(nt)||I.delete(nt),nt))}const te=ce=>e!=null&&e.isGroup&&(e!=null&&e.groupField)?(ce==null?void 0:ce.value)==0?"":`${ce==null?void 0:ce.value}`:`${ce==null?void 0:ce.value}`,j=((st=e==null?void 0:e.type)==null?void 0:st.includes("strip-bar"))||(e==null?void 0:e.type)==="chart-bar-graph",J={show:(Nt=e==null?void 0:e.chartOptions)==null?void 0:Nt.includes("label"),position:j?"right":"top",formatter:te},W=Array.from(I),U=Array.from(N),Q=[],Z=ose({type:e==null?void 0:e.type,categories:W}),X=ce=>BS(ce)?Math.floor(ce*100)/100:ce;if(e!=null&&e.isGroup&&(e!=null&&e.groupField))U.forEach((ce,Re)=>{var on,aa;const Ke=["chart-bar-percentage","chart-strip-bar-percentage"].includes(e.type)?W.map(yn=>X(F[ce][yn]||0)):W.map(yn=>X(k[ce][yn]||0));let Ne=e.type,nt="left";if(Ne==Fr.chartCombination){let yn=((e==null?void 0:e.groupFieldConfig)??[]).find(uf=>x({item:{[O]:uf==null?void 0:uf.value},field:O})==ce);Ne=((on=yn==null?void 0:yn.config)==null?void 0:on.chartType)??Fr.ChartBar,nt=((aa=yn==null?void 0:yn.config)==null?void 0:aa.yAxisPos)??"left"}let Lt=v8({type:Ne,data:Ke,label:J,name:ce,isGroup:e==null?void 0:e.isGroup,groupField:e==null?void 0:e.groupField,labels:W,colorIndex:Re});Lt.yAxisIndex=nt=="left"?0:1,Q.push(Lt)});else{const ce=["chart-bar-percentage","chart-strip-bar-percentage"].includes(e.type)?W.map(nt=>{var Lt;return X(((Lt=V[nt])==null?void 0:Lt.toFixed(2))||0)}):W.map(nt=>X(z[nt]||0));let Re=e.type,Ke="left";Re==Fr.chartCombination?Re=((Xe=e==null?void 0:e.yAxisFieldConfig)==null?void 0:Xe.chartType)??Fr.ChartBar:Ke=((re=e==null?void 0:e.yAxisFieldConfig)==null?void 0:re.yAxisPos)??"left";let Ne=v8({type:Re,data:ce,label:J,name:e.yAxis==="recordTotal"?u0("pb.statisticsText"):D(e==null?void 0:e.yAxisField),isGroup:e==null?void 0:e.isGroup,groupField:e==null?void 0:e.groupField,labels:W,colorIndex:0});Ne.yAxisIndex=Ke=="left"?0:1,Q.push(Ne)}console.log("series",Q,e);const he=sse({series:Q,chartConfig:Z,width:n,customeStyle:r}),le=(Ce=e==null?void 0:e.chartOptions)==null?void 0:Ce.includes("legend"),xe=(e==null?void 0:e.type)==="chart-pie"||(e==null?void 0:e.type)==="chart-pie-circular",ye=Q.some(ce=>(ce==null?void 0:ce.yAxisIndex)==0),Fe=Q.some(ce=>(ce==null?void 0:ce.yAxisIndex)==1),Se={...Z==null?void 0:Z.yAxis,axisTick:{show:(me=e==null?void 0:e.chartOptions)==null?void 0:me.includes("axis"),lineStyle:{color:"#e5e6eb"}},axisLine:{show:(pe=e==null?void 0:e.chartOptions)==null?void 0:pe.includes("axis"),lineStyle:{color:"#e5e6eb"}},axisLabel:{show:(Ye=e==null?void 0:e.chartOptions)==null?void 0:Ye.includes("label"),color:"#86909C",fontSize:12,formatter:ce=>ce.length>15?`${ce.slice(0,15)}...`:ce,hideOverlap:!0,...(Te=Z==null?void 0:Z.yAxis)==null?void 0:Te.axisLabel},splitLine:{show:(ze=e==null?void 0:e.chartOptions)==null?void 0:ze.includes("splitLine"),lineStyle:{color:"#f2f3f5",type:"dashed"}}};return{legend:{type:"scroll",left:"center",right:"center",top:"0",show:le,itemWidth:16,itemHeight:8,itemGap:16,icon:"roundRect",textStyle:{color:"#86909C",fontSize:12},data:(Q==null?void 0:Q.map(ce=>(ce==null?void 0:ce.name)||""))||[]},grid:he,graphic:{elements:[{type:"text",left:"center",bottom:"10px",style:{text:(r==null?void 0:r.xtitle)||"",fill:"#86909C",fontSize:12,fontWeight:"normal"}},{type:"text",left:"10px",top:"center",style:{text:(r==null?void 0:r.ytitle)||"",fill:"#86909C",fontSize:12,fontWeight:"normal"},rotation:Math.PI/2}]},xAxis:{...Z==null?void 0:Z.xAxis,axisTick:{show:(Ze=e==null?void 0:e.chartOptions)==null?void 0:Ze.includes("axis"),lineStyle:{color:"#e5e6eb"}},axisLine:{show:(qe=e==null?void 0:e.chartOptions)==null?void 0:qe.includes("axis"),lineStyle:{color:"#e5e6eb"}},axisLabel:{show:(mt=e==null?void 0:e.chartOptions)==null?void 0:mt.includes("label"),rotate:he.axisLabelRotate,interval:"auto",color:"#86909C",fontSize:12,formatter:ce=>ce.length>15?`${ce.slice(0,15)}...`:ce,...((cr=Z==null?void 0:Z.xAxis)==null?void 0:cr.axisLabel)??{}},splitLine:{show:(fr=e==null?void 0:e.chartOptions)==null?void 0:fr.includes("splitLine"),lineStyle:{color:"#f2f3f5",type:"dashed"}}},yAxis:[{show:ye,...Se},{show:Fe,...Se}],series:Q,tooltip:{trigger:xe?"item":"axis",enterable:xe,confine:!0,axisPointer:{type:"shadow"},backgroundColor:"rgba(255, 255, 255, 0.96)",borderColor:"transparent",borderRadius:8,textStyle:{color:"#1d2129",fontSize:13},extraCssText:"max-width:30vw; white-space:pre-wrap; word-break:break-all; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);",appendTo:"body",...xe?{}:{formatter:ce=>{var Ne;if(!Array.isArray(ce))return"";const Re=`<div style="margin-bottom:6px;font-weight:500;color:#1d2129">${((Ne=ce[0])==null?void 0:Ne.axisValueLabel)??""}</div>`,Ke=ce.map(nt=>{var Lt,on,aa;return`<div style="display:flex;align-items:center;justify-content:space-between;gap:12px;line-height:22px"><span style="display:inline-flex;align-items:center;gap:6px"><span style="display:inline-block;width:8px;height:8px;border-radius:50%;background:${((aa=(on=(Lt=nt.color)==null?void 0:Lt.colorStops)==null?void 0:on[0])==null?void 0:aa.color)??nt.color}"></span>${nt.seriesName}</span><span style="font-weight:500">${nt.value}</span></div>`}).join("");return Re+Ke}}},animation:!0,animationDuration:600,animationEasing:"cubicOut"}})(l):null,[e==null?void 0:e.sortField,e==null?void 0:e.sortOrder,e==null?void 0:e.type,e==null?void 0:e.chartOptions,e==null?void 0:e.timeGroupInterval,e==null?void 0:e.groupFieldConfig,e==null?void 0:e.yAxisFieldConfig,e==null?void 0:e.displayRange,r,l,n,i,d]),g=P.useRef(),v=P.useRef(null),m=$g(v);P.useEffect(()=>{var w;m&&((w=g==null?void 0:g.current)==null||w.resize())},[m]);const y=c,b=!c&&!p,C=!y&&!!p;return S.jsxs("div",{style:{width:"100%",height:"100%"},ref:v,children:[y&&S.jsx(Y.Spin,{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},spinning:c}),b&&S.jsx(c8,{}),C&&S.jsx(nse,{echartRef:g,options:p??{}})]})},p8=P.memo(lse),tp={"combination-chart-option":"_combination-chart-option_1cwba_1","group-field-config-picker":"_group-field-config-picker_1cwba_11","group-field-config-picker__title":"_group-field-config-picker__title_1cwba_14","group-field-config-picker__item":"_group-field-config-picker__item_1cwba_18","group-field-config-picker__input":"_group-field-config-picker__input_1cwba_23"},g8="combination-chart-option",Vl={chartType:Fr.ChartBar,yAxisPos:"left"},m8=t=>{const{style:e,className:r,initTriggerChange:n=!1}=t,{t:i}=Rt(),[a,o]=lo(t),s=[{label:i("chart.t2"),key:Fr.ChartBar,icon:S.jsx(TC,{})},{label:i("chart.t8"),key:Fr.ChartLine,icon:S.jsx(LC,{})}],l=[{label:i("chart.left"),key:"left",icon:S.jsx(MC,{})},{label:i("chart.right"),key:"right",icon:S.jsx(PC,{})}],u=(a==null?void 0:a.chartType)??(Vl==null?void 0:Vl.chartType),c=(a==null?void 0:a.yAxisPos)??(Vl==null?void 0:Vl.yAxisPos),f=P.useMemo(()=>s.find(d=>d.key===u),[u,s]),h=P.useMemo(()=>l.find(d=>d.key===c),[c,l]);return S.jsxs("div",{className:cn(tp[`${g8}`],g8),style:e,children:[S.jsx(Y.Dropdown,{trigger:["click"],placement:"bottom",menu:{items:s.map(d=>({...d,onClick:()=>{o({chartType:d.key,yAxisPos:c})}}))},children:S.jsx(Y.Tooltip,{title:f==null?void 0:f.label,children:S.jsx(Y.Button,{size:"small",type:"text",children:f==null?void 0:f.icon})})}),S.jsx(Y.Divider,{type:"vertical",style:{margin:"0 2px"}}),S.jsx(Y.Dropdown,{trigger:["click"],placement:"bottom",menu:{items:l.map(d=>({...d,onClick:()=>{o({chartType:u,yAxisPos:d.key})}}))},children:S.jsx(Y.Tooltip,{title:h==null?void 0:h.label,children:S.jsx(Y.Button,{size:"small",type:"text",children:h==null?void 0:h.icon})})})]})};m8.displayName="CombinationChartOptionPicker";const a_="group-field-config-picker",y8=[],b8=t=>{const{style:e,className:r,options:n=y8}=t,[i=y8,a]=lo(t),o=Mt(l=>{let u=(i??[]).find(c=>c.value===l);return u?u.config:void 0}),s=Mt((l,u)=>{let c=[...i??[]],f=c.find(h=>h.value===l);f?f.config=u:c.push({value:l,config:u}),a(c)});return P.useEffect(()=>{if((n==null?void 0:n.length)>0){let l=n.map(u=>({value:u,config:{chartType:Fr.ChartBar,yAxisPos:"left",...o(u)??{}}}));a(l)}},[n]),P.useMemo(()=>S.jsx("div",{className:cn(r,tp[`${a_}`]),style:e,children:S.jsx("div",{children:((t==null?void 0:t.options)??[]).map(l=>{let u=`${l}`;const c=o(l);return S.jsxs("div",{className:cn(tp[`${a_}__item`]),children:[S.jsx(Y.Tooltip,{title:u,children:S.jsx("div",{className:cn(tp[`${a_}__input`]),children:S.jsx(fi,{value:u,disabled:!0,style:{width:200,pointerEvents:"none"}})})}),S.jsx(m8,{value:c,onChange:f=>{s(l,f)}})]},u)})})}),[i,n])};b8.displayName="GroupFieldConfigPicker";const use=()=>S.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S.jsx("rect",{x:"17",y:"8",width:"6",height:"15.5",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"17",y:"24.5",width:"6",height:"15.5",rx:"0.5",fill:"#5b65f5"}),S.jsx("rect",{x:"28",y:"8",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"28",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"}),S.jsx("rect",{x:"39",y:"8",width:"6",height:"19",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"39",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),S.jsx("rect",{x:"50",y:"8",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"50",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"})]}),cse=()=>S.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S.jsx("rect",{x:"17",y:"21",width:"6",height:"6",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"17",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),S.jsx("rect",{x:"28",y:"24",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"28",y:"34",width:"6",height:"6",rx:"0.5",fill:"#5b65f5"}),S.jsx("rect",{x:"39",y:"8",width:"6",height:"19",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"39",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),S.jsx("rect",{x:"50",y:"18",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"50",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"})]}),fse=()=>S.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S.jsx("path",{d:"M15.5 33.5C20.2023 32.3804 23.5007 28.5533 25.7095 24.6682C28.3082 20.0974 34.0857 17.3668 38.758 19.7783L39.8066 20.3195C42.9001 21.9162 46.671 21.329 49.1326 18.8674L58 10",stroke:"#959bee",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),S.jsx("path",{d:"M16.5 15L26.844 27.6427C28.7759 30.0039 31.8825 31.0607 34.8535 30.3675L42.3359 28.6216C44.0629 28.2187 45.8748 28.401 47.4869 29.1398L57 33.5",stroke:"#5b65f4",strokeWidth:"1.5",strokeLinecap:"round"})]}),dse=()=>S.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S.jsx("path",{d:"M20 24C20 32.8366 27.1634 40 36 40C44.8366 40 52 32.8366 52 24C52 15.1634 44.8366 8 36 8C27.1634 8 20 15.1634 20 24ZM46.3944 24C46.3944 29.7407 41.7407 34.3944 36 34.3944C30.2593 34.3944 25.6056 29.7407 25.6056 24C25.6056 18.2593 30.2593 13.6056 36 13.6056C41.7407 13.6056 46.3944 18.2593 46.3944 24Z",fill:"#5b65f4"}),S.jsx("path",{d:"M52 24C52 19.7565 50.3143 15.6869 47.3137 12.6863C44.3131 9.68571 40.2435 8 36 8V13.6056C38.7568 13.6056 41.4006 14.7007 43.35 16.65C45.2993 18.5994 46.3944 21.2432 46.3944 24H52Z",fill:"#959bee"}),S.jsx("path",{d:"M52 24C52 20.9896 51.1507 18.0403 49.5497 15.4909L44.8026 18.4721C45.8427 20.1283 46.3944 22.0443 46.3944 24H52Z",fill:"#cdcff9"})]}),hse=()=>S.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S.jsx("rect",{x:"58",y:"11",width:"4",height:"15",rx:"0.5",transform:"rotate(90 58 11)",fill:"#959bee"}),S.jsx("rect",{x:"42",y:"11",width:"4",height:"28",rx:"0.5",transform:"rotate(90 42 11)",fill:"#5b65f5"}),S.jsx("rect",{x:"58",y:"18",width:"4",height:"21.5",rx:"0.5",transform:"rotate(90 58 18)",fill:"#959bee"}),S.jsx("rect",{x:"35.5",y:"18",width:"4",height:"21.5",rx:"0.5",transform:"rotate(90 35.5 18)",fill:"#5b65f5"}),S.jsx("rect",{x:"58",y:"25",width:"4",height:"34",rx:"0.5",transform:"rotate(90 58 25)",fill:"#959bee"}),S.jsx("rect",{x:"23",y:"25",width:"4",height:"9",rx:"0.5",transform:"rotate(90 23 25)",fill:"#5b65f5"}),S.jsx("rect",{x:"58",y:"32",width:"4",height:"17",rx:"0.5",transform:"rotate(90 58 32)",fill:"#959bee"}),S.jsx("rect",{x:"40",y:"32",width:"4",height:"26",rx:"0.5",transform:"rotate(90 40 32)",fill:"#5b65f5"})]}),vse=()=>S.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S.jsx("rect",{x:"40",y:"11",width:"4",height:"15",rx:"0.5",transform:"rotate(90 40 11)",fill:"#959bee"}),S.jsx("rect",{x:"24",y:"11",width:"4",height:"8",rx:"0.5",transform:"rotate(90 24 11)",fill:"#5b65f5"}),S.jsx("rect",{x:"48",y:"18",width:"4",height:"15.5",rx:"0.5",transform:"rotate(90 48 18)",fill:"#959bee"}),S.jsx("rect",{x:"31.5",y:"18",width:"4",height:"15.5",rx:"0.5",transform:"rotate(90 31.5 18)",fill:"#5b65f5"}),S.jsx("rect",{x:"60",y:"25",width:"4",height:"34",rx:"0.5",transform:"rotate(90 60 25)",fill:"#959bee"}),S.jsx("rect",{x:"25",y:"25",width:"4",height:"9",rx:"0.5",transform:"rotate(90 25 25)",fill:"#5b65f5"}),S.jsx("rect",{x:"43",y:"32",width:"4",height:"13",rx:"0.5",transform:"rotate(90 43 32)",fill:"#959bee"}),S.jsx("rect",{x:"29",y:"32",width:"4",height:"13",rx:"0.5",transform:"rotate(90 29 32)",fill:"#5b65f5"})]}),pse=()=>{const{t,i18n:e}=Rt();return P.useMemo(()=>[{label:t("chart.t2"),value:"chart-bar",icon:S.jsx(LS,{})},{label:t("chart.t3"),value:"chart-bar-pile",icon:S.jsx(cse,{})},{label:t("chart.t4"),value:"chart-bar-percentage",icon:S.jsx(use,{})},{label:t("chart.t5"),value:"chart-strip-bar",icon:S.jsx(zS,{})},{label:t("chart.t6"),value:"chart-strip-bar-pile",icon:S.jsx(vse,{})},{label:t("chart.t7"),value:"chart-strip-bar-percentage",icon:S.jsx(hse,{})},{label:t("chart.t8"),value:"chart-line",icon:S.jsx(kS,{})},{label:t("chart.t9"),value:"chart-line-smooth",icon:S.jsx(fse,{})},{label:t("chart.t10"),value:"chart-pie",icon:S.jsx(jS,{})},{label:t("chart.t11"),value:"chart-pie-circular",icon:S.jsx(dse,{})},{label:t("chart._t12"),value:Fr.chartCombination,icon:S.jsx(FS,{})}],[e.language])},gse=()=>{const{t,i18n:e}=Rt();return P.useMemo(()=>[{label:t("chart.t40"),value:"day"},{label:t("chart.t41"),value:"week"},{label:t("chart.t42"),value:"month"},{label:t("chart.t43"),value:"year"}],[e.language])},mse=()=>{const{t,i18n:e}=Rt();return P.useMemo(()=>[{label:t("displayRange.all","ALL"),value:li.ALL},{label:t("displayRange.top5","TOP5"),value:li.TOP5},{label:t("displayRange.top10","TOP10"),value:li.TOP10},{label:t("displayRange.top20","TOP20"),value:li.TOP20},{label:t("displayRange.top30","TOP30"),value:li.TOP30},{label:t("displayRange.bottom5","BOTTOM5"),value:li.BOTTOM5},{label:t("displayRange.bottom10","BOTTOM10"),value:li.BOTTOM10},{label:t("displayRange.bottom20","BOTTOM20"),value:li.BOTTOM20},{label:t("displayRange.bottom30","BOTTOM30"),value:li.BOTTOM30}],[e.language])},yse={"chart-modal":"_chart-modal_10ivt_1"},bse="chart-modal",_se=({selectModuleData:t,onAllValuesChange:e,enumDataApi:r})=>{const{globalData:n}=pr(),{t:i}=Rt(),a=P.useRef(null),o=pse(),s=gse(),l=mse(),u={dataSourceId:"",yAxis:"recordTotal",chartOptions:["legend","label","axis","splitLine"],sortField:"xAxis",sortOrder:"asc",timeGroupInterval:"day",displayRange:"ALL",yAxisFieldConfig:{chartType:Fr.ChartBar,yAxisPos:"left"}},[c]=Y.Form.useForm(),f=Y.Form.useWatch("type",c),h=Y.Form.useWatch("dataSourceId",c),d=Y.Form.useWatch("isGroup",c),p=Y.Form.useWatch("xAxis",c),g=Y.Form.useWatch("yAxisField",c),v=Y.Form.useWatch("groupField",c),m=Mt(L=>{var K,ee;return((ee=(K=n==null?void 0:n.sourceData)==null?void 0:K.find(te=>te.value===L))==null?void 0:ee.fields)??[]}),y=Mt(L=>{var te,j;const q=[{value:"recordTotal",label:i("statisticstRecordNum")},{value:"fieldValue",label:i("statisticstFieldVal")}],K=(te=n==null?void 0:n.sourceData)==null?void 0:te.find(J=>J.value===L),ee=(j=K==null?void 0:K.chart_config)==null?void 0:j.allowed_y_axis_options;return ee&&ee.length>0?q.filter(J=>ee.includes(J.value)):q}),{fieldOptions:b,xAxisFieldOption:C,yAxisFieldOption:w,groupFieldOption:_}=P.useMemo(()=>{const L=m(h),q=L.filter(te=>![g,v].includes(te.value)),K=L.filter(te=>{let j=te.type==="int"||te.type==="float",J=[p,v].includes(te.value);return j&&!J}),ee=L.filter(te=>![p,g].includes(te.value));return{fieldOptions:L,xAxisFieldOption:q,yAxisFieldOption:K,groupFieldOption:ee}},[h,p,g,v]),x=Mt(L=>{var q;return((q=b.find(K=>K.value===L))==null?void 0:q.type)==="timestamp"}),[D,E]=P.useState(!1),T=P.useRef(),[A,O]=P.useState({conditionList:[],conditionType:"all"}),[R,B]=P.useState(0),I=L=>{var q;O(L),T.current=L,B(((q=L==null?void 0:L.conditionList)==null?void 0:q.length)||0)},{service:N}=pr(),{data:k,loading:z}=A6(async()=>{var L,q,K;if(d&&f===Fr.chartCombination&&v){const ee=v==="tags"?"tag":v;let te=`select=${ee}`;if(((L=A==null?void 0:A.conditionList)==null?void 0:L.length)>0){let W=Ad(A);te+=W?`&${W}`:""}let j=await((q=N==null?void 0:N.moduleDataApi)==null?void 0:q.call(N,{id:h,query:te})),J=(K=j==null?void 0:j.data)==null?void 0:K.map(W=>Bu({fieldOptions:b,val:W[ee],field:ee,fieldMap:n==null?void 0:n.fieldMap}));return[...new Set(J)]}else return[]},{refreshDeps:[f,d,v,A,h]}),{run:V}=Wg(Mt(()=>{e==null||e({...u,...c.getFieldsValue(),conditionData:T.current})}),{wait:100}),F=Mt((L,q)=>{var K,ee,te,j;if(L.dataSourceId){const J=m(L.dataSourceId),W=y(L.dataSourceId),U=W.length===1&&W[0].value==="fieldValue"?"fieldValue":"recordTotal",Q=J.filter(Z=>Z.type==="int"||Z.type==="float");c.setFieldsValue({xAxis:(K=J==null?void 0:J[0])==null?void 0:K.value,yAxis:U,yAxisField:U==="fieldValue"?(ee=Q==null?void 0:Q[0])==null?void 0:ee.value:"",yAxisFieldType:U==="fieldValue"?"sum":void 0,isGroup:!1,groupField:void 0}),I({conditionList:[],conditionType:"all"})}if(L.xAxis&&c.setFieldsValue(x(L.xAxis)?{timeGroupInterval:u==null?void 0:u.timeGroupInterval}:{displayRange:u==null?void 0:u.displayRange}),L.yAxis){let J=L.yAxis;c.setFieldsValue({yAxisField:J==="fieldValue"?(te=w==null?void 0:w[0])==null?void 0:te.value:"",yAxisFieldType:"sum"})}L.isGroup&&c.setFieldsValue({groupField:(j=_==null?void 0:_[0])==null?void 0:j.value}),V()});return P.useEffect(()=>{var L,q,K;if(t!=null&&t.customData){const ee=t.customData;c.setFieldsValue(ee)}else{const ee=(L=n==null?void 0:n.sourceData)==null?void 0:L[0],te=m(ee==null?void 0:ee.value)||[];c.setFieldsValue({...u,dataSourceId:ee==null?void 0:ee.value,type:t==null?void 0:t.type,xAxis:(q=te==null?void 0:te[0])==null?void 0:q.value})}I((K=t==null?void 0:t.customData)==null?void 0:K.conditionData),V()},[t,n]),S.jsxs("div",{style:{height:"50vh",overflowX:"auto"},className:cn(yse[`${bse}`]),ref:a,children:[S.jsxs(Y.Form,{form:c,name:"customData",layout:"vertical",onValuesChange:F,initialValues:u,children:[S.jsx(Y.Form.Item,{label:i("dataSource"),name:"dataSourceId",children:S.jsx(Y.Select,{options:(n==null?void 0:n.sourceData)??[],getPopupContainer:L=>L.parentElement||document.body})}),S.jsxs(Y.Form.Item,{label:i("dataRange"),children:[S.jsx(Y.Button,{style:{marginLeft:"-15px"},onClick:()=>{E(!0)},type:"link",children:i("filterData")}),R>0?`${i("selectNcondition",{n:R})}`:null]}),S.jsx(Y.Form.Item,{label:i("chart.t1"),name:"type",children:S.jsx(Y.Select,{options:o,getPopupContainer:L=>L.parentElement||document.body,optionRender:L=>S.jsxs(Y.Flex,{align:"center",children:[S.jsx("span",{role:"img",style:{marginTop:"5px"},"aria-label":L.data.label,children:L.data.icon}),L.data.label]})})}),S.jsx(Y.Form.Item,{name:"chartOptions",label:i("chart.t12"),children:S.jsxs(Y.Checkbox.Group,{children:[S.jsx(Y.Checkbox,{value:"legend",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t13")}),S.jsx(Y.Checkbox,{value:"label",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t14")}),["chart-pie","chart-pie-circular"].includes(f)?null:S.jsxs(S.Fragment,{children:[S.jsx(Y.Checkbox,{value:"axis",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t15")}),S.jsx(Y.Checkbox,{value:"splitLine",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t16")})]})]})}),S.jsx(Y.Divider,{style:{borderColor:"#e2e2e2",marginTop:0}}),S.jsx(Y.Form.Item,{label:f!=null&&f.includes("pie")?i("chart.t17"):i("chart.t18"),name:"xAxis",children:S.jsx(Y.Select,{options:C,getPopupContainer:L=>L.parentElement||document.body})}),S.jsx(Y.Form.Item,{noStyle:!0,dependencies:["type","xAxis"],children:({getFieldValue:L})=>x(L("xAxis"))?S.jsx(S.Fragment,{children:S.jsx(Y.Form.Item,{name:"timeGroupInterval",label:i("chart.t39"),children:S.jsx(Y.Select,{options:s,getPopupContainer:q=>q.parentElement||document.body})})}):S.jsx(S.Fragment,{children:S.jsx(Y.Form.Item,{name:"displayRange",label:i("displayRange.title"),children:S.jsx(Y.Select,{options:l,getPopupContainer:q=>q.parentElement||document.body})})})}),S.jsx(Y.Form.Item,{dependencies:["type"],noStyle:!0,children:({getFieldValue:L})=>{var q;return(q=L("type"))!=null&&q.includes("pie")?null:S.jsxs(S.Fragment,{children:[S.jsx(Y.Form.Item,{name:"sortField",label:i("chart.t31"),children:S.jsxs(Y.Radio.Group,{children:[S.jsx(Y.Radio,{value:"xAxis",children:i("chart.t32")}),S.jsx(Y.Radio,{value:"yAxisField",children:i("chart.t33")}),S.jsx(Y.Radio,{value:"recordValue",children:i("chart.t34")})]})}),S.jsx(Y.Form.Item,{name:"sortOrder",label:i("chart.t35"),children:S.jsxs(Y.Radio.Group,{children:[S.jsx(Y.Radio,{value:"asc",children:i("chart.t36")}),S.jsx(Y.Radio,{value:"desc",children:i("chart.t37")})]})})]})}}),S.jsx(Y.Form.Item,{label:f!=null&&f.includes("pie")?i("chart.t19"):i("chart.t20"),name:"yAxis",children:S.jsx(Y.Select,{options:y(h),getPopupContainer:L=>L.parentElement||document.body})}),S.jsx(Y.Form.Item,{dependencies:["yAxis","type","isGroup"],noStyle:!0,children:({getFieldValue:L})=>L("yAxis")==="fieldValue"?S.jsx(Y.Form.Item,{label:i("selectField"),children:S.jsx("div",{style:{display:"flex",justifyContent:"space-between"},children:S.jsxs(Y.Space.Compact,{children:[S.jsx(Y.Form.Item,{noStyle:!0,name:"yAxisField",children:S.jsx(Y.Select,{style:{width:"100px"},options:w,dropdownStyle:{width:250},getPopupContainer:q=>q.parentElement||document.body})}),S.jsx(Y.Form.Item,{name:"yAxisFieldType",noStyle:!0,children:S.jsx(Y.Select,{style:{width:"100px"},dropdownStyle:{width:136},getPopupContainer:q=>q.parentElement||document.body,options:[{value:"sum",label:i("sumVal")},{value:"max",label:i("maxVal")},{value:"min",label:i("minVal")},{value:"avg",label:i("averageVal")}]})})]})})}):null}),S.jsx(Y.Form.Item,{dependencies:["type","isGroup"],noStyle:!0,children:({getFieldValue:L})=>{var q;return(q=L("type"))!=null&&q.includes("pie")?null:S.jsxs(S.Fragment,{children:[S.jsx(Y.Form.Item,{name:"isGroup",valuePropName:"checked",noStyle:!0,children:S.jsx(Y.Checkbox,{style:{marginBottom:"5px"},children:i("chart.t38")})}),S.jsx(Y.Form.Item,{dependencies:["isGroup"],noStyle:!0,children:({getFieldValue:K})=>K("isGroup")?S.jsx(Y.Form.Item,{name:"groupField",children:S.jsx(Y.Select,{options:_,getPopupContainer:ee=>ee.parentElement||document.body})}):null}),S.jsx(Y.Spin,{spinning:z,children:S.jsx(Y.Form.Item,{name:"groupFieldConfig",label:i("chart.groupFieldConfig"),hidden:!(L("type")===Fr.chartCombination&&L("isGroup")),children:S.jsx(b8,{options:k})})})]})}})]}),S.jsx(a0,{open:D,value:A,fieldOptions:b,enumDataApi:r,onClose:()=>{E(!1)},onOk:L=>{I(L),V()}})]})},Cse=({customData:t,selectModuleData:e,onAllValuesChange:r})=>{var s,l,u;const[n]=Y.Form.useForm(),{t:i}=Rt(),a={xtitle:"",ytitle:""},o=()=>{setTimeout(()=>{r==null||r(n.getFieldsValue())})};return P.useEffect(()=>{e!=null&&e.customeStyle?n.setFieldsValue(e.customeStyle):n.setFieldsValue(a)},[e]),(s=t==null?void 0:t.type)!=null&&s.includes("pie")?S.jsx("div",{style:{height:"50vh",overflowX:"auto"}}):S.jsx("div",{style:{height:"50vh",overflowX:"auto"},children:S.jsxs(Y.Form,{form:n,name:"customeStyle",layout:"vertical",initialValues:a,children:[S.jsx(Y.Divider,{orientation:"left",orientationMargin:"0",children:i("chart.t21")}),(l=t==null?void 0:t.type)!=null&&l.includes("pie")?null:S.jsx(Y.Form.Item,{label:i("chart.t22"),name:"xtitle",children:S.jsx(fi,{onChange:()=>{o()}})}),S.jsx(Y.Divider,{orientation:"left",orientationMargin:"0",children:i("chart.t26")}),(u=t==null?void 0:t.type)!=null&&u.includes("pie")?null:S.jsx(Y.Form.Item,{label:i("chart.t27"),name:"ytitle",children:S.jsx(fi,{onChange:()=>{o()}})})]})})},wse=({open:t,onClose:e,onOk:r,moduleDataApi:n,selectModuleData:i,enumDataApi:a})=>{var m;const{t:o}=Rt(),{globalData:s}=pr(),[l,u]=P.useState(),[c,f]=P.useState();P.useRef(null);const h=(m=l==null?void 0:l.type)==null?void 0:m.includes("pie"),d=P.useRef(!1);P.useEffect(()=>{i&&(u(i==null?void 0:i.customData),f(i==null?void 0:i.customeStyle))},[i]);const[p,g]=P.useState("");P.useEffect(()=>{t&&(d.current=!!(i!=null&&i.title),g(i!=null&&i.title?i==null?void 0:i.title:o("chartText")))},[t]);const v=()=>{var x,D,E;if(!(l!=null&&l.dataSourceId))return;const y=(x=s==null?void 0:s.sourceData)==null?void 0:x.find(T=>T.value===l.dataSourceId);if(!(y!=null&&y.label))return;let b="Count";if(l.yAxis==="fieldValue"&&l.yAxisField){const T=(D=y.fields)==null?void 0:D.find(R=>R.value===l.yAxisField),O={sum:"Sum",max:"Max",min:"Min",avg:"Avg"}[l.yAxisFieldType]||"";b=T!=null&&T.label?`${O} ${T.label}`.trim():O}const C=(E=y.fields)==null?void 0:E.find(T=>T.value===l.xAxis),w=(C==null?void 0:C.label)||"";let _=`${y.label} ${b}`;w&&(_+=` by ${w}`),g(_)};return P.useEffect(()=>{d.current||v()},[l==null?void 0:l.dataSourceId,l==null?void 0:l.xAxis,l==null?void 0:l.yAxis,l==null?void 0:l.yAxisField,l==null?void 0:l.yAxisFieldType]),S.jsx(S.Fragment,{children:S.jsx(Y.Modal,{width:"65%",title:S.jsx(Qf,{value:p,onChange:y=>{d.current=!0,g(y)}}),footer:null,open:t,onCancel:e,destroyOnClose:!0,closeIcon:S.jsx(df,{}),className:"ow-modal ow-modal-2",children:S.jsxs("div",{className:"config-widget-dialog-container",children:[S.jsx("div",{className:"config-widget-dialog-content",children:S.jsx("div",{className:"config-widget-dialog-preview",children:S.jsx(p8,{customData:l,customeStyle:c,moduleDataApi:n})})}),S.jsxs("div",{className:"config-widget-dialog-panel",children:[S.jsx("div",{className:"bitable-dashboard edit-panel-container",children:S.jsx(Y.Tabs,{defaultActiveKey:"1",items:[{key:"1",label:o("typeData"),children:S.jsx(_se,{enumDataApi:a,selectModuleData:i,onAllValuesChange:y=>{u(y)}})},...h?[]:[{key:"2",label:o("customStyle"),children:S.jsx(Cse,{customData:l,selectModuleData:i,onAllValuesChange:y=>{f(y)}})}]]})}),S.jsx("div",{className:"button-container",children:S.jsx(Y.Button,{type:"primary",onClick:()=>{r==null||r({id:i==null?void 0:i.id,type:i==null?void 0:i.type,customData:l,customeStyle:c,title:p})},children:o("confirm")})})]})]})})})};function o_(t,e){const{ranges:r,step:n}=e;let i=null,a=null;for(let o=0;o<r.length-1;o++){const[s,l]=r[o],[u,c]=r[o+1];if(t>=s&&t<=u){i=[s,l],a=[u,c];break}}if(t<r[0][0]&&(i=r[0],a=r[1]),t>r[r.length-1][0]&&(i=r[r.length-2],a=r[r.length-1]),i&&a){let[o,s]=i,[l,u]=a;const c=(u-s)/(l-o),f=s-c*o,h=c*t+f;return Math.round(h/n)*n}if(i||a){let o=i||a,[s,l]=o;const u=l*t/s;return Math.round(u/n)*n}throw new Error("Unexpected error in range calculation")}function xse(t,e=0){if(!Number.isFinite(t))throw new Error("Value must be a finite number.");return new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:e,maximumFractionDigits:e}).format(t)}function s_(t,e=0){if(!Number.isFinite(t))return"";const r=new Intl.NumberFormat(void 0,{minimumFractionDigits:0,maximumFractionDigits:e}).format(t),[n,i]=r.split("."),a=(i||"").padEnd(e,"0");return`${n}${e>0?".":""}${a}`}const Sse=({moduleDataApi:t,customData:e,customeStyle:r})=>{const[n,i]=P.useState(),[a,o]=P.useState(!1),{globalFilterCondition:s}=pr();let l=P.useMemo(()=>s==null?void 0:s.find(m=>(m==null?void 0:m.dataSourceId)===(e==null?void 0:e.dataSourceId)),[s,e==null?void 0:e.dataSourceId]);const u=Mt(async()=>{var v,m,y;if(e){let b="";o(!0),e.statisticalMethod==="fieldValue"&&e.field?b+=`select=${e.field}.${e==null?void 0:e.statisticalType}()`:e.statisticalMethod==="recordTotal"&&(b+="select=id.count()");let C=[];if((((v=l==null?void 0:l.conditionList)==null?void 0:v.length)??0)>0&&C.push(l),(((y=(m=e==null?void 0:e.conditionData)==null?void 0:m.conditionList)==null?void 0:y.length)??0)>0&&C.push(e==null?void 0:e.conditionData),C.length>0){let w=Ad(C);b+=w?`&${w}`:""}e!=null&&e.dataSourceId&&(t==null||t({id:e==null?void 0:e.dataSourceId,query:b}).then(w=>{if(!w.success){Y.message.error(w.message);return}i(w.data)}).finally(()=>{o(!1)}))}else i([])});P.useEffect(()=>{e&&u()},[e==null?void 0:e.conditionData,e==null?void 0:e.statisticalMethod,e==null?void 0:e.statisticalType,e==null?void 0:e.field,e==null?void 0:e.dataSourceId,l]);const{formatCurrency:c}=pr(),f=Mt(c),h=P.useMemo(()=>{var w,_,x,D,E;if(!n)return"";const v=n,{statisticalMethod:m,statisticalType:y,field:b}=e||{};let C=0;if(v.length&&m==="fieldValue"&&b)switch(y){case"sum":C=((w=v==null?void 0:v[0])==null?void 0:w.sum)||0;break;case"max":C=((_=v==null?void 0:v[0])==null?void 0:_.max)||0;break;case"min":C=((x=v==null?void 0:v[0])==null?void 0:x.min)||0;break;case"avg":C=((D=v==null?void 0:v[0])==null?void 0:D.avg)||0;break;default:C=0}else m==="recordTotal"&&(C=((E=v==null?void 0:v[0])==null?void 0:E.count)||0);if(r!=null&&r.unit){const{unit:T,precision:A}=r;switch(`${T}`){case"4":case"5":case"6":case"7":case"8":case"9":C=(f==null?void 0:f(C,A))??C;break;case"1":C=s_(C,A);break;case"3":C=xse(C,A);break;default:C=s_(C,A)}}else C=s_(C,r==null?void 0:r.precision);return C},[n,e,r]),d=P.useRef(),p=$g(d),g=P.useMemo(()=>{if(!p)return null;let v=0,m=32,y=0,b=0;v=o_(p.width,{ranges:[[116,16],[760,56]],step:4}),v=Math.max(16,Math.min(72,v));let C=p.width-v*2,w=p.height-m*2;{y=o_(C,{ranges:[[400,60],[500,64]],step:.1});const _=16,x=Math.min(72,w/2);y=Math.max(_,Math.min(x,y))}{b=o_(w,{ranges:[[140,12],[500,24],[860,36]],step:.1});const _=12,x=Math.min(36,w/2);b=Math.max(_,Math.min(x,b))}return{PX:v,PY:m,fontSize:y,subFontSize:b}},[p]);return S.jsxs("div",{ref:d,style:{display:"flex",height:"100%",width:"100%"},children:[a?S.jsx(Y.Spin,{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",background:"rgba(255,255,255,0.6)",top:0,left:0,right:0,bottom:0,zIndex:1e3},spinning:a}):null,S.jsxs("div",{style:{overflow:"hidden",position:"relative",flex:1,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",padding:`${g==null?void 0:g.PY}px ${g==null?void 0:g.PX}px`},children:[h!==""&&S.jsx("div",{style:{width:"100%",position:"relative",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:"center"},children:S.jsx("span",{style:{fontWeight:"bold",lineHeight:`${g==null?void 0:g.fontSize}px`,fontSize:`${g==null?void 0:g.fontSize}px`,color:r==null?void 0:r.color},children:h})}),(r==null?void 0:r.desc)!==""&&S.jsx("div",{style:{width:"100%",position:"relative",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:"center"},children:S.jsx("span",{style:{fontSize:`${g==null?void 0:g.subFontSize}px`,lineHeight:`${g==null?void 0:g.subFontSize}px`,color:r==null?void 0:r.color,textAlign:"center"},children:r==null?void 0:r.desc})})]})]})},_8=P.memo(Sse),Dse=({selectModuleData:t,onAllValuesChange:e,enumDataApi:r})=>{const{globalData:n}=pr(),{t:i}=Rt(),[a,o]=P.useState(),[s,l]=P.useState(),u=_=>{var D,E;const x=(E=(D=n==null?void 0:n.sourceData)==null?void 0:D.find(T=>T.value===_))==null?void 0:E.fields;o(x),l(x==null?void 0:x.filter(T=>T.type==="int"||T.type==="float"))},c=_=>{var T,A;const x=[{value:"recordTotal",label:i("statisticstRecordNum")},{value:"fieldValue",label:i("statisticstFieldVal")}],D=(T=n==null?void 0:n.sourceData)==null?void 0:T.find(O=>O.value===_),E=(A=D==null?void 0:D.chart_config)==null?void 0:A.allowed_y_axis_options;return E&&E.length>0?x.filter(O=>E.includes(O.value)):x},[f]=Y.Form.useForm(),h={dataSourceId:"",statisticalMethod:"recordTotal",field:""},d=()=>{setTimeout(()=>{e==null||e({...f.getFieldsValue(),conditionData:v.current})})},[p,g]=P.useState(!1),v=P.useRef(),[m,y]=P.useState({conditionList:[],conditionType:"all"}),[b,C]=P.useState(0),w=_=>{var x;y(_),v.current=_,C(((x=_==null?void 0:_.conditionList)==null?void 0:x.length)||0)};return P.useEffect(()=>{var _,x;if(t!=null&&t.customData){const D=t.customData;f.setFieldsValue(D),u(D==null?void 0:D.dataSourceId)}else{const D=(_=n==null?void 0:n.sourceData)==null?void 0:_[0];f.setFieldsValue({...h,dataSourceId:D==null?void 0:D.value}),u(D==null?void 0:D.value),d()}w((x=t==null?void 0:t.customData)==null?void 0:x.conditionData)},[t,n]),S.jsxs(S.Fragment,{children:[S.jsxs(Y.Form,{form:f,name:"customData",layout:"vertical",initialValues:h,children:[S.jsx(Y.Form.Item,{label:i("dataSource"),name:"dataSourceId",children:S.jsx(Y.Select,{options:n==null?void 0:n.sourceData,onChange:_=>{var A,O,R;const x=c(_),D=x.length===1&&x[0].value==="fieldValue"?"fieldValue":"recordTotal";u(_);const E=(O=(A=n==null?void 0:n.sourceData)==null?void 0:A.find(B=>B.value===_))==null?void 0:O.fields,T=E==null?void 0:E.filter(B=>B.type==="int"||B.type==="float");f.setFieldsValue({statisticalMethod:D,field:D==="fieldValue"?(R=T==null?void 0:T[0])==null?void 0:R.value:"",statisticalType:D==="fieldValue"?"sum":void 0}),d(),w({conditionList:[],conditionType:"all"})}})}),S.jsxs(Y.Form.Item,{label:i("dataRange"),children:[S.jsx(Y.Button,{style:{marginLeft:"-15px"},onClick:()=>{g(!0)},type:"link",children:i("filterData")}),b>0?`${i("selectNcondition",{n:b})}`:null]}),S.jsx(Y.Divider,{style:{borderColor:"#e2e2e2",marginTop:0}}),S.jsx(Y.Form.Item,{label:i("statisticstMethods"),name:"statisticalMethod",children:S.jsx(Y.Select,{onChange:_=>{f.setFieldsValue({field:_==="fieldValue"?s==null?void 0:s[0].value:"",statisticalType:"sum"}),d()},options:c(f.getFieldValue("dataSourceId"))})}),S.jsx(Y.Form.Item,{dependencies:["statisticalMethod"],children:({getFieldValue:_})=>_("statisticalMethod")==="fieldValue"?S.jsx(Y.Form.Item,{label:i("selectField"),children:S.jsxs(Y.Space.Compact,{children:[S.jsx(Y.Form.Item,{noStyle:!0,name:"field",children:S.jsx(Y.Select,{style:{width:"100px"},dropdownStyle:{width:250},onChange:()=>{d()},options:s})}),S.jsx(Y.Form.Item,{name:"statisticalType",noStyle:!0,children:S.jsx(Y.Select,{style:{width:"100px"},dropdownStyle:{width:180},onChange:()=>{d()},options:[{value:"sum",label:i("sumVal")},{value:"max",label:i("maxVal")},{value:"min",label:i("minVal")},{value:"avg",label:i("averageVal")}]})})]})}):null})]}),S.jsx(a0,{open:p,value:m,fieldOptions:a,enumDataApi:r,onClose:()=>{g(!1)},onOk:_=>{w(_),d()}})]})},Ese=({value:t,onChange:e})=>{const[r,n]=P.useState(),i=["#373c43","#3370ff","#4954e6","#34c724","#14c0ff","#ffc60a","#f80","#f76964"];return P.useEffect(()=>{n(t)},[t]),S.jsx("div",{className:"pane-item-body item-body-column",children:S.jsx("div",{className:"panel-single-color-selector",children:i.map((a,o)=>S.jsxs("div",{className:"panel-single-color-selector-color-item",onClick:()=>{n(a),e==null||e(a)},children:[S.jsx("div",{className:"panel-single-color-selector-color-item-background",style:{background:a}}),r===a?S.jsx("span",{className:"panel-icon",children:S.jsx(RC,{})}):null]},o))})})},Ase=({selectModuleData:t,onAllValuesChange:e})=>{const[r]=Y.Form.useForm(),{t:n,i18n:i}=Rt(),a=P.useMemo(()=>[{value:"1",label:n("statistics.t5")},{value:"2",label:n("statistics.t6")},{value:"3",label:n("statistics.t7")},{value:"9",label:n("statistics.currency")}],[i.language]),o={color:"#373c43",unit:"1",precision:"",desc:""},s=()=>{setTimeout(()=>{e==null||e(r.getFieldsValue())})};return P.useEffect(()=>{if(t!=null&&t.customeStyle){`${t.customeStyle.unit??o.unit}`;let l={...o,...t.customeStyle,unit:`${t.customeStyle.unit??o.unit}`};r.setFieldsValue(l)}else r.setFieldsValue(o)},[t]),S.jsxs(Y.Form,{form:r,name:"customeStyle",layout:"vertical",initialValues:o,children:[S.jsx(Y.Form.Item,{label:n("statistics.t1"),name:"color",children:S.jsx(Ese,{onChange:()=>{s()}})}),S.jsx(Y.Form.Item,{label:n("statistics.t2"),extra:n("statistics.t3"),children:S.jsxs(Y.Space.Compact,{children:[S.jsx(Y.Form.Item,{name:"precision",noStyle:!0,children:S.jsx(Y.InputNumber,{min:1,max:10,style:{width:"60%"},placeholder:n("statistics.t4"),onChange:()=>{s()}})}),S.jsx(Y.Form.Item,{name:"unit",noStyle:!0,children:S.jsx(Y.Select,{onChange:()=>{s()},dropdownStyle:{width:240},children:a.map(l=>{const{value:u,label:c}=l;return S.jsx(Y.Select.Option,{value:u,children:c},u)})})})]})}),S.jsx(Y.Form.Item,{label:n("statistics.t10"),name:"desc",children:S.jsx(fi,{onChange:()=>{s()}})})]})},Tse=({open:t,onClose:e,onOk:r,moduleDataApi:n,selectModuleData:i,enumDataApi:a})=>{const{t:o}=Rt(),{globalData:s}=pr(),[l,u]=P.useState(),[c,f]=P.useState(),h=P.useRef(!1);P.useEffect(()=>{i&&(u(i==null?void 0:i.customData),f(i==null?void 0:i.customeStyle))},[i]);const[d,p]=P.useState("");P.useEffect(()=>{t&&(h.current=!!(i!=null&&i.title),p(i!=null&&i.title?i==null?void 0:i.title:o("statisticsText")))},[t]);const g=()=>{var y,b;if(!(l!=null&&l.dataSourceId))return;const v=(y=s==null?void 0:s.sourceData)==null?void 0:y.find(C=>C.value===l.dataSourceId);if(!(v!=null&&v.label))return;let m="Count";if(l.statisticalMethod==="fieldValue"&&l.field){const C=(b=v.fields)==null?void 0:b.find(x=>x.value===l.field),_={sum:"Sum",max:"Max",min:"Min",avg:"Avg"}[l.statisticalType||""]||"";m=C!=null&&C.label?`${_} ${C.label}`.trim():_}p(`${v.label} ${m}`)};return P.useEffect(()=>{h.current||g()},[l==null?void 0:l.dataSourceId,l==null?void 0:l.statisticalMethod,l==null?void 0:l.statisticalType,l==null?void 0:l.field]),S.jsx(S.Fragment,{children:S.jsx(Y.Modal,{width:"65%",title:S.jsx(Qf,{value:d,onChange:v=>{h.current=!0,p(v)}}),footer:null,open:t,onCancel:e,closeIcon:S.jsx(df,{}),className:"ow-modal ow-modal-2",children:S.jsxs("div",{className:"config-widget-dialog-container",children:[S.jsx("div",{className:"config-widget-dialog-content",children:S.jsx("div",{className:"config-widget-dialog-preview",children:S.jsx(_8,{customData:l,customeStyle:c,moduleDataApi:n})})}),S.jsxs("div",{className:"config-widget-dialog-panel",children:[S.jsx("div",{className:"bitable-dashboard edit-panel-container",children:S.jsx(Y.Tabs,{defaultActiveKey:"1",items:[{key:"1",label:o("typeData"),children:S.jsx(Dse,{selectModuleData:i,enumDataApi:a,onAllValuesChange:v=>{u(v)}})},{key:"2",label:o("customStyle"),children:S.jsx(Ase,{selectModuleData:i,onAllValuesChange:v=>{f(v)}})}]})}),S.jsx("div",{className:"button-container",children:S.jsx(Y.Button,{type:"primary",onClick:()=>{r==null||r({id:i==null?void 0:i.id,customData:l,customeStyle:c,title:d})},children:o("confirm")})})]})]})})})},Ose=t=>S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",...t,children:[S.jsx("g",{clipPath:"url(#a)",children:S.jsx("path",{fill:"#000",fillRule:"evenodd",d:"M3 2.666a.167.167 0 0 0-.166.167v1.634c0 .057.03.11.077.14l3.05 1.94c.336.215.54.586.54.985v4.634a.5.5 0 1 1-1 0V7.532c0-.057-.03-.11-.078-.14L2.374 5.45a1.167 1.167 0 0 1-.54-.984V2.833c0-.645.522-1.167 1.167-1.167h10c.644 0 1.166.522 1.166 1.167v1.634c0 .399-.204.77-.54.984l-3.05 1.94a.167.167 0 0 0-.076.141v6.3a.5.5 0 0 1-1 0v-6.3c0-.399.203-.77.54-.984l3.05-1.94a.167.167 0 0 0 .076-.141V2.833a.167.167 0 0 0-.166-.167H3Z",clipRule:"evenodd"})}),S.jsx("defs",{children:S.jsx("clipPath",{id:"a",children:S.jsx("path",{fill:"#fff",d:"M0 0h16v16H0z"})})})]}),C8=P.createContext({}),l_=()=>P.useContext(C8),rp=(t,e)=>`${t}-${e}`,Mse=t=>{var l,u;const{t:e}=Rt(),{fieldPickerDataSource:r,flattenFieldMap:n}=l_(),[i,a]=lo(t),o=Mt(c=>{const[f,h]=c.keyPath;let d=f==null?void 0:f.replace(`${h}-`,"");d&&a({dataSourceId:h,field:d})}),s=P.useMemo(()=>{{let c=rp(i==null?void 0:i.dataSourceId,i==null?void 0:i.field);return n==null?void 0:n.get(c)}},[i,n]);return S.jsx(Y.Dropdown,{trigger:["click"],menu:{selectable:!0,selectedKeys:s?[(l=s==null?void 0:s.source)==null?void 0:l.value,s==null?void 0:s.mergeId]:[],items:r,onClick:o},children:S.jsx(Y.Select,{open:!1,placeholder:e("selectGroupField"),style:{width:200},value:((u=s==null?void 0:s.field)==null?void 0:u.label)??void 0})})},u_=t=>{const[e,r]=lo(t),n=P.useMemo(()=>e!=null&&e.field?{dataSourceId:e==null?void 0:e.dataSourceId,field:e==null?void 0:e.field}:void 0,[e==null?void 0:e.field,e==null?void 0:e.dataSourceId]),i=u=>{var f;const c={condition:"=",val:"",val2:"",rdate:"exactdate"};if(u){let h=a==null?void 0:a.get(rp(u.dataSourceId,u.field));r({...c,dataSourceId:u.dataSourceId,field:u.field,type:(f=h==null?void 0:h.field)==null?void 0:f.type})}else r({...c,dataSourceId:void 0,field:void 0,type:void 0})},{flattenFieldMap:a}=l_(),o=a==null?void 0:a.get(rp(e==null?void 0:e.dataSourceId,e==null?void 0:e.field)),s=NS(e,["field"]),l=Mt(u=>r({...e,...u}));return S.jsxs("div",{style:{display:"flex",gap:"10px"},children:[S.jsx(Mse,{value:n,onChange:i}),S.jsx(CA,{value:s,onChange:l,field:o==null?void 0:o.field}),S.jsx(jp,{style:{cursor:"pointer"},onClick:t.onDelete})]})};u_.displayName="ConditionRowItem";const Uc={"global-filter-condition__popover":"_global-filter-condition__popover_qw1om_1","global-filter-condition__block":"_global-filter-condition__block_qw1om_4","sub-popup":"_sub-popup_qw1om_10"},np="global-filter-condition",Pse=[],w8=t=>{const{className:e,style:r}=t,{t:n}=Rt(),{globalFilterCondition:i,setGlobalFilterCondition:a}=pr(),[o,s]=P.useState(!1),{globalData:l}=pr(),{fieldPickerDataSource:u,flattenFieldMap:c}=P.useMemo(()=>{let f=new Map;return{fieldPickerDataSource:((l==null?void 0:l.sourceData)||[]).map(d=>{let p=((d==null?void 0:d.fields)||[]).map(g=>{let v=rp(d==null?void 0:d.value,g==null?void 0:g.value);return f.set(v,{field:g,source:d,mergeId:v}),{key:v,label:g==null?void 0:g.label,disabled:g.disabled??!1}});return{key:d==null?void 0:d.value,label:d==null?void 0:d.label,children:p,popupClassName:Uc["sub-popup"]}}),flattenFieldMap:f}},[l==null?void 0:l.sourceData]);return S.jsx(C8.Provider,{value:{fieldPickerDataSource:u,flattenFieldMap:c},children:S.jsx("div",{className:cn(Uc[`${np}`],e),style:r,children:S.jsx(Y.Popover,{content:S.jsx(Rse,{defaultValue:i,onClose:(f,h)=>{f&&a(h),s(!1)}}),destroyTooltipOnHide:!0,placement:"bottomRight",trigger:"click",open:o,onOpenChange:s,children:S.jsx(Y.Button,{className:`!px-1 ${((i==null?void 0:i.length)??0)>0?"!bg-primary/10":""}`,type:"text",icon:S.jsx(Ose,{}),children:n("globalfilter")})})})})};w8.displayName="GlobalFilterCondition";const Rse=t=>{const{defaultValue:e}=t,{t:r}=Rt(),n=l_().fieldPickerDataSource,i=yA(),[a=Pse,o]=P.useState([]);P.useEffect(()=>{e&&o(V7(e))},[e]);const[s,l]=P.useState([]),u=d=>{d!=null&&d.field&&o(p=>{let g=[...p],v=g.find(m=>m.dataSourceId===d.dataSourceId);if(v)return v.conditionList.push(d),[...g];{let m={dataSourceId:d.dataSourceId,conditionType:"all",conditionList:[d]};return[...g,m]}})},c=()=>{l([...s,{}])},f=P.useMemo(()=>!RS(a,e),[a,e]),h=Mt(()=>{var d;(d=t==null?void 0:t.onClose)==null||d.call(t,!0,a)});return S.jsxs("div",{className:cn(Uc[`${np}__popover`]),children:[S.jsx("div",{style:{marginBottom:"10px"},children:r("setFilterCondition")}),a.map((d,p)=>{var m;let g=d==null?void 0:d.conditionList,v=(m=n==null?void 0:n.find(y=>y.key===(d==null?void 0:d.dataSourceId)))==null?void 0:m.label;return console.log("dataSourceName",v),S.jsxs("div",{className:cn(Uc[`${np}__block`]),children:[S.jsxs("div",{style:{marginBottom:"10px",display:"flex",justifyContent:"space-between"},children:[S.jsx("div",{children:v}),S.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[r("conformTo"),S.jsx(Y.Select,{style:{width:"80px"},options:i,value:d==null?void 0:d.conditionType,onChange:y=>{o(b=>{let C=[...b];return C[p].conditionType=y,C})}}),r("condition")]})]}),S.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:g.map((y,b)=>S.jsx(u_,{value:y,onChange:C=>{o(w=>{let _=[...w],x=_[p].conditionList[b];if((x==null?void 0:x.dataSourceId)!==(C==null?void 0:C.dataSourceId)){_[p].conditionList.splice(b,1),_[p].conditionList.length===0&&_.splice(p,1);let D=C,E=_.find(T=>T.dataSourceId===D.dataSourceId);if(E)return E.conditionList.push(D),[..._];{let T={dataSourceId:D.dataSourceId,conditionType:"all",conditionList:[D]};return[..._,T]}}else _[p].conditionList[b]={...x,...C};return _})},onDelete:()=>{o(C=>{let w=[...C];return w[p].conditionList.splice(b,1),w[p].conditionList.length===0&&w.splice(p,1),w})}},b))})]},d==null?void 0:d.dataSourceId)}),s.map((d,p)=>S.jsx("div",{className:cn(Uc[`${np}__block`]),children:S.jsx(u_,{value:d,onChange:g=>{u(g)},onDelete:()=>{l(g=>{let v=[...g];return v.splice(p,1),v})}})},p)),S.jsx(Y.Button,{type:"dashed",block:!0,style:{marginBottom:"10px"},icon:S.jsx(hf,{}),onClick:()=>{c()},children:r("addCondition")}),S.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:S.jsx(Y.Button,{type:"primary",disabled:!f,onClick:()=>{h()},children:r("confirm")})})]})};/*!
|
|
165
|
+
`)),dt(n)),a.push({dimIdx:m.index,parser:y,comparator:new MO(h,p)})});var o=e.sourceFormat;o!==jr&&o!==An&&(process.env.NODE_ENV!=="production"&&(n='sourceFormat "'+o+'" is not supported yet'),dt(n));for(var s=[],l=0,u=e.count();l<u;l++)s.push(e.getRawDataItem(l));return s.sort(function(c,f){for(var h=0;h<a.length;h++){var d=a[h],p=e.retrieveValueFromItem(c,d.dimIdx),g=e.retrieveValueFromItem(f,d.dimIdx);d.parser&&(p=d.parser(p),g=d.parser(g));var v=d.comparator.evaluate(p,g);if(v!==0)return v}return 0}),{data:s}}};function goe(t){t.registerTransform(voe),t.registerTransform(poe)}var moe=function(t){ve(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.prototype.init=function(r,n,i){t.prototype.init.call(this,r,n,i),this._sourceManager=new yM(this),bM(this)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),bM(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:Ei},e}(pt),yoe=function(t){ve(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.type="dataset",e}(pn);function boe(t){t.registerComponentModel(moe),t.registerComponentView(yoe)}function _oe(t){if(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r].slice());return e}}function Coe(t,e){var r=t.label,n=e&&e.getTextGuideLine();return{dataIndex:t.dataIndex,dataType:t.dataType,seriesIndex:t.seriesModel.seriesIndex,text:t.label.style.text,rect:t.hostRect,labelRect:t.rect,align:r.style.align,verticalAlign:r.style.verticalAlign,labelLinePoints:_oe(n&&n.shape.points)}}var zI=["align","verticalAlign","width","height","fontSize"],Vr=new Wu,X1=Ot(),woe=Ot();function qv(t,e,r){for(var n=0;n<r.length;n++){var i=r[n];e[i]!=null&&(t[i]=e[i])}}var Xv=["x","y","rotation"],xoe=function(){function t(){this._labelList=[],this._chartViewList=[]}return t.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},t.prototype._addLabel=function(e,r,n,i,a){var o=i.style,s=i.__hostTarget,l=s.textConfig||{},u=i.getComputedTransform(),c=i.getBoundingRect().plain();ft.applyTransform(c,c,u),u?Vr.setLocalTransform(u):(Vr.x=Vr.y=Vr.rotation=Vr.originX=Vr.originY=0,Vr.scaleX=Vr.scaleY=1),Vr.rotation=Ui(Vr.rotation);var f=i.__hostTarget,h;if(f){h=f.getBoundingRect().plain();var d=f.getComputedTransform();ft.applyTransform(h,h,d)}var p=h&&f.getTextGuideLine();this._labelList.push({label:i,labelLine:p,seriesModel:n,dataIndex:e,dataType:r,layoutOption:a,computedLayoutOption:null,rect:c,hostRect:h,priority:h?h.width*h.height:0,defaultAttr:{ignore:i.ignore,labelGuideIgnore:p&&p.ignore,x:Vr.x,y:Vr.y,scaleX:Vr.scaleX,scaleY:Vr.scaleY,rotation:Vr.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:i.cursor,attachedPos:l.position,attachedRot:l.rotation}})},t.prototype.addLabelsOfSeries=function(e){var r=this;this._chartViewList.push(e);var n=e.__model,i=n.get("labelLayout");(Be(i)||vt(i).length)&&e.group.traverse(function(a){if(a.ignore)return!0;var o=a.getTextContent(),s=ot(a);o&&!o.disableLabelLayout&&r._addLabel(s.dataIndex,s.dataType,n,o,i)})},t.prototype.updateLayoutConfig=function(e){var r=e.getWidth(),n=e.getHeight();function i(b,C){return function(){CP(b,C)}}for(var a=0;a<this._labelList.length;a++){var o=this._labelList[a],s=o.label,l=s.__hostTarget,u=o.defaultAttr,c=void 0;Be(o.layoutOption)?c=o.layoutOption(Coe(o,l)):c=o.layoutOption,c=c||{},o.computedLayoutOption=c;var f=Math.PI/180;l&&l.setTextConfig({local:!1,position:c.x!=null||c.y!=null?null:u.attachedPos,rotation:c.rotate!=null?c.rotate*f:u.attachedRot,offset:[c.dx||0,c.dy||0]});var h=!1;if(c.x!=null?(s.x=Tt(c.x,r),s.setStyle("x",0),h=!0):(s.x=u.x,s.setStyle("x",u.style.x)),c.y!=null?(s.y=Tt(c.y,n),s.setStyle("y",0),h=!0):(s.y=u.y,s.setStyle("y",u.style.y)),c.labelLinePoints){var d=l.getTextGuideLine();d&&(d.setShape({points:c.labelLinePoints}),h=!1)}var p=X1(s);p.needsUpdateLabelLine=h,s.rotation=c.rotate!=null?c.rotate*f:u.rotation,s.scaleX=u.scaleX,s.scaleY=u.scaleY;for(var g=0;g<zI.length;g++){var v=zI[g];s.setStyle(v,c[v]!=null?c[v]:u.style[v])}if(c.draggable){if(s.draggable=!0,s.cursor="move",l){var m=o.seriesModel;if(o.dataIndex!=null){var y=o.seriesModel.getData(o.dataType);m=y.getItemModel(o.dataIndex)}s.on("drag",i(l,m.getModel("labelLine")))}}else s.off("drag"),s.cursor=u.cursor}},t.prototype.layout=function(e){var r=e.getWidth(),n=e.getHeight(),i=DP(this._labelList),a=Xt(i,function(l){return l.layoutOption.moveOverlap==="shiftX"}),o=Xt(i,function(l){return l.layoutOption.moveOverlap==="shiftY"});Yee(a,0,r),AP(o,0,n);var s=Xt(i,function(l){return l.layoutOption.hideOverlap});TP(s)},t.prototype.processLabelsOverall=function(){var e=this;H(this._chartViewList,function(r){var n=r.__model,i=r.ignoreLabelLineUpdate,a=n.isAnimationEnabled();r.group.traverse(function(o){if(o.ignore&&!o.forceLabelAnimation)return!0;var s=!i,l=o.getTextContent();!s&&l&&(s=X1(l).needsUpdateLabelLine),s&&e._updateLabelLine(o,n),a&&e._animateLabels(o,n)})})},t.prototype._updateLabelLine=function(e,r){var n=e.getTextContent(),i=ot(e),a=i.dataIndex;if(n&&a!=null){var o=r.getData(i.dataType),s=o.getItemModel(a),l={},u=o.getItemVisual(a,"style");if(u){var c=o.getVisual("drawType");l.stroke=u[c]}var f=s.getModel("labelLine");xP(e,SP(s),l),CP(e,f)}},t.prototype._animateLabels=function(e,r){var n=e.getTextContent(),i=e.getTextGuideLine();if(n&&(e.forceLabelAnimation||!n.ignore&&!n.invisible&&!e.disableLabelAnimation&&!gl(e))){var a=X1(n),o=a.oldLayout,s=ot(e),l=s.dataIndex,u={x:n.x,y:n.y,rotation:n.rotation},c=r.getData(s.dataType);if(o){n.attr(o);var h=e.prevStates;h&&(ct(h,"select")>=0&&n.attr(a.oldLayoutSelect),ct(h,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),ur(n,u,r,l)}else if(n.attr(u),!ml(n).valueAnimation){var f=Ue(n.style.opacity,1);n.style.opacity=0,Mr(n,{style:{opacity:f}},r,l)}if(a.oldLayout=u,n.states.select){var d=a.oldLayoutSelect={};qv(d,u,Xv),qv(d,n.states.select,Xv)}if(n.states.emphasis){var p=a.oldLayoutEmphasis={};qv(p,u,Xv),qv(p,n.states.emphasis,Xv)}kK(n,l,c,r,r)}if(i&&!i.ignore&&!i.invisible){var a=woe(i),o=a.oldLayout,g={points:i.shape.points};o?(i.attr({shape:o}),ur(i,{shape:g},r)):(i.setShape(g),i.style.strokePercent=0,Mr(i,{style:{strokePercent:1}},r)),a.oldLayout=g}},t}(),Z1=Ot();function Soe(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){var i=Z1(r).labelManager;i||(i=Z1(r).labelManager=new xoe),i.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(e,r,n){var i=Z1(r).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var Pi=Gi.CMD;function jl(t,e){return Math.abs(t-e)<1e-5}function K1(t){var e=t.data,r=t.len(),n=[],i,a=0,o=0,s=0,l=0;function u(R,B){i&&i.length>2&&n.push(i),i=[R,B]}function c(R,B,I,N){jl(R,I)&&jl(B,N)||i.push(R,B,I,N,I,N)}function f(R,B,I,N,k,z){var V=Math.abs(B-R),F=Math.tan(V/4)*4/3,L=B<R?-1:1,q=Math.cos(R),K=Math.sin(R),ee=Math.cos(B),te=Math.sin(B),j=q*k+I,J=K*z+N,W=ee*k+I,U=te*z+N,Q=k*F*L,Z=z*F*L;i.push(j-Q*K,J+Z*q,W+Q*te,U-Z*ee,W,U)}for(var h,d,p,g,v=0;v<r;){var m=e[v++],y=v===1;switch(y&&(a=e[v],o=e[v+1],s=a,l=o,(m===Pi.L||m===Pi.C||m===Pi.Q)&&(i=[s,l])),m){case Pi.M:a=s=e[v++],o=l=e[v++],u(s,l);break;case Pi.L:h=e[v++],d=e[v++],c(a,o,h,d),a=h,o=d;break;case Pi.C:i.push(e[v++],e[v++],e[v++],e[v++],a=e[v++],o=e[v++]);break;case Pi.Q:h=e[v++],d=e[v++],p=e[v++],g=e[v++],i.push(a+2/3*(h-a),o+2/3*(d-o),p+2/3*(h-p),g+2/3*(d-g),p,g),a=p,o=g;break;case Pi.A:var b=e[v++],C=e[v++],w=e[v++],_=e[v++],x=e[v++],D=e[v++]+x;v+=1;var E=!e[v++];h=Math.cos(x)*w+b,d=Math.sin(x)*_+C,y?(s=h,l=d,u(s,l)):c(a,o,h,d),a=Math.cos(D)*w+b,o=Math.sin(D)*_+C;for(var T=(E?-1:1)*Math.PI/2,A=x;E?A>D:A<D;A+=T){var O=E?Math.max(A+T,D):Math.min(A+T,D);f(A,O,b,C,w,_)}break;case Pi.R:s=a=e[v++],l=o=e[v++],h=s+e[v++],d=l+e[v++],u(h,l),c(h,l,h,d),c(h,d,s,d),c(s,d,s,l),c(s,l,h,l);break;case Pi.Z:i&&c(a,o,s,l),a=s,o=l;break}}return i&&i.length>2&&n.push(i),n}function Q1(t,e,r,n,i,a,o,s,l,u){if(jl(t,r)&&jl(e,n)&&jl(i,o)&&jl(a,s)){l.push(o,s);return}var c=2/u,f=c*c,h=o-t,d=s-e,p=Math.sqrt(h*h+d*d);h/=p,d/=p;var g=r-t,v=n-e,m=i-o,y=a-s,b=g*g+v*v,C=m*m+y*y;if(b<f&&C<f){l.push(o,s);return}var w=h*g+d*v,_=-h*m-d*y,x=b-w*w,D=C-_*_;if(x<f&&w>=0&&D<f&&_>=0){l.push(o,s);return}var E=[],T=[];Ca(t,r,i,o,.5,E),Ca(e,n,a,s,.5,T),Q1(E[0],T[0],E[1],T[1],E[2],T[2],E[3],T[3],l,u),Q1(E[4],T[4],E[5],T[5],E[6],T[6],E[7],T[7],l,u)}function Doe(t,e){var r=K1(t),n=[];e=e||1;for(var i=0;i<r.length;i++){var a=r[i],o=[],s=a[0],l=a[1];o.push(s,l);for(var u=2;u<a.length;){var c=a[u++],f=a[u++],h=a[u++],d=a[u++],p=a[u++],g=a[u++];Q1(s,l,c,f,h,d,p,g,o,e),s=p,l=g}n.push(o)}return n}function HI(t,e,r){var n=t[e],i=t[1-e],a=Math.abs(n/i),o=Math.ceil(Math.sqrt(a*r)),s=Math.floor(r/o);s===0&&(s=1,o=r);for(var l=[],u=0;u<o;u++)l.push(s);var c=o*s,f=r-c;if(f>0)for(var u=0;u<f;u++)l[u%o]+=1;return l}function VI(t,e,r){for(var n=t.r0,i=t.r,a=t.startAngle,o=t.endAngle,s=Math.abs(o-a),l=s*i,u=i-n,c=l>Math.abs(u),f=HI([l,u],c?0:1,e),h=(c?s:u)/f.length,d=0;d<f.length;d++)for(var p=(c?u:s)/f[d],g=0;g<f[d];g++){var v={};c?(v.startAngle=a+h*d,v.endAngle=a+h*(d+1),v.r0=n+p*g,v.r=n+p*(g+1)):(v.startAngle=a+p*g,v.endAngle=a+p*(g+1),v.r0=n+h*d,v.r=n+h*(d+1)),v.clockwise=t.clockwise,v.cx=t.cx,v.cy=t.cy,r.push(v)}}function Eoe(t,e,r){for(var n=t.width,i=t.height,a=n>i,o=HI([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",f=t[s]/o.length,h=0;h<o.length;h++)for(var d=t[l]/o[h],p=0;p<o[h];p++){var g={};g[u]=h*f,g[c]=p*d,g[s]=f,g[l]=d,g.x+=t.x,g.y+=t.y,r.push(g)}}function WI(t,e,r,n){return t*n-r*e}function Aoe(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,c=o-i,f=s-a,h=WI(c,f,l,u);if(Math.abs(h)<1e-6)return null;var d=t-i,p=e-a,g=WI(d,p,c,f)/h;return g<0||g>1?null:new Pe(g*l+t,g*u+e)}function Toe(t,e,r){var n=new Pe;Pe.sub(n,r,e),n.normalize();var i=new Pe;Pe.sub(i,t,e);var a=i.dot(n);return a}function zl(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function Ooe(t,e,r){for(var n=t.length,i=[],a=0;a<n;a++){var o=t[a],s=t[(a+1)%n],l=Aoe(o[0],o[1],s[0],s[1],e.x,e.y,r.x,r.y);l&&i.push({projPt:Toe(l,e,r),pt:l,idx:a})}if(i.length<2)return[{points:t},{points:t}];i.sort(function(v,m){return v.projPt-m.projPt});var u=i[0],c=i[i.length-1];if(c.idx<u.idx){var f=u;u=c,c=f}for(var h=[u.pt.x,u.pt.y],d=[c.pt.x,c.pt.y],p=[h],g=[d],a=u.idx+1;a<=c.idx;a++)zl(p,t[a].slice());zl(p,d),zl(p,h);for(var a=c.idx+1;a<=u.idx+n;a++)zl(g,t[a%n].slice());return zl(g,h),zl(g,d),[{points:p},{points:g}]}function $I(t){var e=t.points,r=[],n=[];M2(e,r,n);var i=new ft(r[0],r[1],n[0]-r[0],n[1]-r[1]),a=i.width,o=i.height,s=i.x,l=i.y,u=new Pe,c=new Pe;return a>o?(u.x=c.x=s+a/2,u.y=l,c.y=l+o):(u.y=c.y=l+o/2,u.x=s,c.x=s+a),Ooe(e,u,c)}function Zv(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);Zv(t,a[0],i,n),Zv(t,a[1],r-i,n)}return n}function Moe(t,e){for(var r=[],n=0;n<e;n++)r.push(_y(t));return r}function Poe(t,e){e.setStyle(t.style),e.z=t.z,e.z2=t.z2,e.zlevel=t.zlevel}function Roe(t){for(var e=[],r=0;r<t.length;)e.push([t[r++],t[r++]]);return e}function Boe(t,e){var r=[],n=t.shape,i;switch(t.type){case"rect":Eoe(n,e,r),i=er;break;case"sector":VI(n,e,r),i=Si;break;case"circle":VI({r0:0,r:n.r,startAngle:0,endAngle:Math.PI*2,cx:n.cx,cy:n.cy},e,r),i=Si;break;default:var a=t.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=De(Doe(t.getUpdatedPathProxy(),o),function(m){return Roe(m)}),l=s.length;if(l===0)Zv($I,{points:s[0]},e,r);else if(l===e)for(var u=0;u<l;u++)r.push({points:s[u]});else{var c=0,f=De(s,function(m){var y=[],b=[];M2(m,y,b);var C=(b[1]-y[1])*(b[0]-y[0]);return c+=C,{poly:m,area:C}});f.sort(function(m,y){return y.area-m.area});for(var h=e,u=0;u<l;u++){var d=f[u];if(h<=0)break;var p=u===l-1?h:Math.ceil(d.area/c*e);p<0||(Zv($I,{points:d.poly},p,r),h-=p)}}i=Ph;break}if(!i)return Moe(t,e);for(var g=[],u=0;u<r.length;u++){var v=new i;v.setShape(r[u]),Poe(t,v),g.push(v)}return g}function Ioe(t,e){var r=t.length,n=e.length;if(r===n)return[t,e];for(var i=[],a=[],o=r<n?t:e,s=Math.min(r,n),l=Math.abs(n-r)/6,u=(s-2)/6,c=Math.ceil(l/u)+1,f=[o[0],o[1]],h=l,d=2;d<s;){var p=o[d-2],g=o[d-1],v=o[d++],m=o[d++],y=o[d++],b=o[d++],C=o[d++],w=o[d++];if(h<=0){f.push(v,m,y,b,C,w);continue}for(var _=Math.min(h,c-1)+1,x=1;x<=_;x++){var D=x/_;Ca(p,v,y,C,D,i),Ca(g,m,b,w,D,a),p=i[3],g=a[3],f.push(i[1],a[1],i[2],a[2],p,g),v=i[5],m=a[5],y=i[6],b=a[6]}h-=_-1}return o===t?[f,e]:[t,f]}function GI(t,e){for(var r=t.length,n=t[r-2],i=t[r-1],a=[],o=0;o<e.length;)a[o++]=n,a[o++]=i;return a}function Noe(t,e){for(var r,n,i,a=[],o=[],s=0;s<Math.max(t.length,e.length);s++){var l=t[s],u=e[s],c=void 0,f=void 0;l?u?(r=Ioe(l,u),c=r[0],f=r[1],n=c,i=f):(f=GI(i||l,l),c=l):(c=GI(n||u,u),f=u),a.push(c),o.push(f)}return[a,o]}function UI(t){for(var e=0,r=0,n=0,i=t.length,a=0,o=i-2;a<i;o=a,a+=2){var s=t[o],l=t[o+1],u=t[a],c=t[a+1],f=s*c-u*l;e+=f,r+=(s+u)*f,n+=(l+c)*f}return e===0?[t[0]||0,t[1]||0]:[r/e/3,n/e/3,e]}function Foe(t,e,r,n){for(var i=(t.length-2)/6,a=1/0,o=0,s=t.length,l=s-2,u=0;u<i;u++){for(var c=u*6,f=0,h=0;h<s;h+=2){var d=h===0?c:(c+h-2)%l+2,p=t[d]-r[0],g=t[d+1]-r[1],v=e[h]-n[0],m=e[h+1]-n[1],y=v-p,b=m-g;f+=y*y+b*b}f<a&&(a=f,o=u)}return o}function Loe(t){for(var e=[],r=t.length,n=0;n<r;n+=2)e[n]=t[r-n-2],e[n+1]=t[r-n-1];return e}function koe(t,e,r,n){for(var i=[],a,o=0;o<t.length;o++){var s=t[o],l=e[o],u=UI(s),c=UI(l);a==null&&(a=u[2]<0!=c[2]<0);var f=[],h=[],d=0,p=1/0,g=[],v=s.length;a&&(s=Loe(s));for(var m=Foe(s,l,u,c)*6,y=v-2,b=0;b<y;b+=2){var C=(m+b)%y+2;f[b+2]=s[C]-u[0],f[b+3]=s[C+1]-u[1]}f[0]=s[m]-u[0],f[1]=s[m+1]-u[1];for(var w=n/r,_=-n/2;_<=n/2;_+=w){for(var x=Math.sin(_),D=Math.cos(_),E=0,b=0;b<s.length;b+=2){var T=f[b],A=f[b+1],O=l[b]-c[0],R=l[b+1]-c[1],B=O*D-R*x,I=O*x+R*D;g[b]=B,g[b+1]=I;var N=B-T,k=I-A;E+=N*N+k*k}if(E<p){p=E,d=_;for(var z=0;z<g.length;z++)h[z]=g[z]}}i.push({from:f,to:h,fromCp:u,toCp:c,rotation:-d})}return i}function Kv(t){return t.__isCombineMorphing}var YI="__mOriginal_";function Qv(t,e,r){var n=YI+e,i=t[n]||t[e];t[n]||(t[n]=t[e]);var a=r.replace,o=r.after,s=r.before;t[e]=function(){var l=arguments,u;return s&&s.apply(this,l),a?u=a.apply(this,l):u=i.apply(this,l),o&&o.apply(this,l),u}}function Gc(t,e){var r=YI+e;t[r]&&(t[e]=t[r],t[r]=null)}function qI(t,e){for(var r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;){var a=n[i],o=n[i+1];n[i++]=e[0]*a+e[2]*o+e[4],n[i++]=e[1]*a+e[3]*o+e[5]}}function XI(t,e){var r=t.getUpdatedPathProxy(),n=e.getUpdatedPathProxy(),i=Noe(K1(r),K1(n)),a=i[0],o=i[1],s=t.getComputedTransform(),l=e.getComputedTransform();function u(){this.transform=null}s&&qI(a,s),l&&qI(o,l),Qv(e,"updateTransform",{replace:u}),e.transform=null;var c=koe(a,o,10,Math.PI),f=[];Qv(e,"buildPath",{replace:function(h){for(var d=e.__morphT,p=1-d,g=[],v=0;v<c.length;v++){var m=c[v],y=m.from,b=m.to,C=m.rotation*d,w=m.fromCp,_=m.toCp,x=Math.sin(C),D=Math.cos(C);Yd(g,w,_,d);for(var E=0;E<y.length;E+=2){var T=y[E],A=y[E+1],O=b[E],R=b[E+1],B=T*p+O*d,I=A*p+R*d;f[E]=B*D-I*x+g[0],f[E+1]=B*x+I*D+g[1]}var N=f[0],k=f[1];h.moveTo(N,k);for(var E=2;E<y.length;){var O=f[E++],R=f[E++],z=f[E++],V=f[E++],F=f[E++],L=f[E++];N===O&&k===R&&z===F&&V===L?h.lineTo(F,L):h.bezierCurveTo(O,R,z,V,F,L),N=F,k=L}}}})}function J1(t,e,r){if(!t||!e)return e;var n=r.done,i=r.during;XI(t,e),e.__morphT=0;function a(){Gc(e,"buildPath"),Gc(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},rt({during:function(o){e.dirtyShape(),i&&i(o)},done:function(){a(),n&&n()}},r)),e}function joe(t,e,r,n,i,a){var o=16;t=i===r?0:Math.round(32767*(t-r)/(i-r)),e=a===n?0:Math.round(32767*(e-n)/(a-n));for(var s=0,l,u=(1<<o)/2;u>0;u/=2){var c=0,f=0;(t&u)>0&&(c=1),(e&u)>0&&(f=1),s+=u*u*(3*c^f),f===0&&(c===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function Jv(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=De(t,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),f=l.y+l.height/2+(u?u[5]:0);return e=Math.min(c,e),r=Math.min(f,r),n=Math.max(c,n),i=Math.max(f,i),[c,f]}),o=De(a,function(s,l){return{cp:s,z:joe(s[0],s[1],e,r,n,i),path:t[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function ZI(t){return Boe(t.path,t.count)}function e_(){return{fromIndividuals:[],toIndividuals:[],count:0}}function zoe(t,e,r){var n=[];function i(w){for(var _=0;_<w.length;_++){var x=w[_];Kv(x)?i(x.childrenRef()):x instanceof at&&n.push(x)}}i(t);var a=n.length;if(!a)return e_();var o=r.dividePath||ZI,s=o({path:e,count:a});if(s.length!==a)return console.error("Invalid morphing: unmatched splitted path"),e_();n=Jv(n),s=Jv(s);for(var l=r.done,u=r.during,c=r.individualDelay,f=new Wu,h=0;h<a;h++){var d=n[h],p=s[h];p.parent=e,p.copyTransform(f),c||XI(d,p)}e.__isCombineMorphing=!0,e.childrenRef=function(){return s};function g(w){for(var _=0;_<s.length;_++)s[_].addSelfToZr(w)}Qv(e,"addSelfToZr",{after:function(w){g(w)}}),Qv(e,"removeSelfFromZr",{after:function(w){for(var _=0;_<s.length;_++)s[_].removeSelfFromZr(w)}});function v(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,Gc(e,"addSelfToZr"),Gc(e,"removeSelfFromZr")}var m=s.length;if(c)for(var y=m,b=function(){y--,y===0&&(v(),l&&l())},h=0;h<m;h++){var C=c?rt({delay:(r.delay||0)+c(h,m,n[h],s[h]),done:b},r):r;J1(n[h],s[h],C)}else e.__morphT=0,e.animateTo({__morphT:1},rt({during:function(w){for(var _=0;_<m;_++){var x=s[_];x.__morphT=e.__morphT,x.dirtyShape()}u&&u(w)},done:function(){v();for(var w=0;w<t.length;w++)Gc(t[w],"updateTransform");l&&l()}},r));return e.__zr&&g(e.__zr),{fromIndividuals:n,toIndividuals:s,count:m}}function Hoe(t,e,r){var n=e.length,i=[],a=r.dividePath||ZI;function o(d){for(var p=0;p<d.length;p++){var g=d[p];Kv(g)?o(g.childrenRef()):g instanceof at&&i.push(g)}}if(Kv(t)){o(t.childrenRef());var s=i.length;if(s<n)for(var l=0,u=s;u<n;u++)i.push(_y(i[l++%s]));i.length=n}else{i=a({path:t,count:n});for(var c=t.getComputedTransform(),u=0;u<i.length;u++)i[u].setLocalTransform(c);if(i.length!==n)return console.error("Invalid morphing: unmatched splitted path"),e_()}i=Jv(i),e=Jv(e);for(var f=r.individualDelay,u=0;u<n;u++){var h=f?rt({delay:(r.delay||0)+f(u,n,i[u],e[u])},r):r;J1(i[u],e[u],h)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}function KI(t){return ge(t[0])}function QI(t,e){for(var r=[],n=t.length,i=0;i<n;i++)r.push({one:t[i],many:[]});for(var i=0;i<e.length;i++){var a=e[i].length,o=void 0;for(o=0;o<a;o++)r[o%n].many.push(e[i][o])}for(var s=0,i=n-1;i>=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var Voe={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n<t.count;n++){var i=_y(t.path);i.setStyle("opacity",r),e.push(i)}return e},split:null};function t_(t,e,r,n,i,a){if(!t.length||!e.length)return;var o=pl("update",n,i);if(!(o&&o.duration>0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,c;KI(t)&&(u=t,c=e),KI(e)&&(u=e,c=t);function f(m,y,b,C,w){var _=m.many,x=m.one;if(_.length===1&&!w){var D=y?_[0]:x,E=y?x:_[0];if(Kv(D))f({many:[D],one:E},!0,b,C,!0);else{var T=s?rt({delay:s(b,C)},l):l;J1(D,E,T),a(D,E,D,E,T)}}else for(var A=rt({dividePath:Voe[r],individualDelay:s&&function(k,z,V,F){return s(k+b,C)}},l),O=y?zoe(_,x,A):Hoe(x,_,A),R=O.fromIndividuals,B=O.toIndividuals,I=R.length,N=0;N<I;N++){var T=s?rt({delay:s(N,I)},l):l;a(R[N],B[N],y?_[N]:m.one,y?m.one:_[N],T)}}for(var h=u?u===t:t.length>e.length,d=u?QI(c,u):QI(h?e:t,[h?t:e]),p=0,g=0;g<d.length;g++)p+=d[g].many.length;for(var v=0,g=0;g<d.length;g++)f(d[g],h,v,p),v+=d[g].many.length}function ls(t){if(!t)return[];if(ge(t)){for(var e=[],r=0;r<t.length;r++)e.push(ls(t[r]));return e}var n=[];return t.traverse(function(i){i instanceof at&&!i.disableMorphing&&!i.invisible&&!i.ignore&&n.push(i)}),n}var JI=1e4,Woe=0,e8=1,t8=2,$oe=Ot();function Goe(t,e){for(var r=t.dimensions,n=0;n<r.length;n++){var i=t.getDimensionInfo(r[n]);if(i&&i.otherDims[e]===0)return r[n]}}function Uoe(t,e,r){var n=t.getDimensionInfo(r),i=n&&n.ordinalMeta;if(n){var a=t.get(n.name,e);return i&&i.categories[a]||a+""}}function r8(t,e,r,n){var i=n?"itemChildGroupId":"itemGroupId",a=Goe(t,i);if(a){var o=Uoe(t,e,a);return o}var s=t.getRawDataItem(e),l=n?"childGroupId":"groupId";if(s&&s[l])return s[l]+"";if(!n)return r||t.getId(e)}function n8(t){var e=[];return H(t,function(r){var n=r.data,i=r.dataGroupId;if(n.count()>JI){process.env.NODE_ENV!=="production"&&tr("Universal transition is disabled on large data > 10k.");return}for(var a=n.getIndices(),o=0;o<a.length;o++)e.push({data:n,groupId:r8(n,o,i,!1),childGroupId:r8(n,o,i,!0),divide:r.divide,dataIndex:o})}),e}function r_(t,e,r){t.traverse(function(n){n instanceof at&&Mr(n,{style:{opacity:0}},e,{dataIndex:r,isFrom:!0})})}function n_(t){if(t.parent){var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function Hl(t){t.stopAnimation(),t.isGroup&&t.traverse(function(e){e.stopAnimation()})}function Yoe(t,e,r){var n=pl("update",r,e);n&&t.traverse(function(i){if(i instanceof xa){var a=bK(i);a&&i.animateFrom({style:a},n)}})}function qoe(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++){var i=t[n],a=e[n];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function i8(t,e,r){var n=n8(t),i=n8(e);function a(b,C,w,_,x){(w||b)&&C.animateFrom({style:w&&w!==b?ue(ue({},w.style),b.style):b.style},x)}var o=!1,s=Woe,l=je(),u=je();n.forEach(function(b){b.groupId&&l.set(b.groupId,!0),b.childGroupId&&u.set(b.childGroupId,!0)});for(var c=0;c<i.length;c++){var f=i[c].groupId;if(u.get(f)){s=e8;break}var h=i[c].childGroupId;if(h&&l.get(h)){s=t8;break}}function d(b,C){return function(w){var _=w.data,x=w.dataIndex;return C?_.getId(x):b?s===e8?w.childGroupId:w.groupId:s===t8?w.childGroupId:w.groupId}}var p=qoe(n,i),g={};if(!p)for(var c=0;c<i.length;c++){var v=i[c],m=v.data.getItemGraphicEl(v.dataIndex);m&&(g[m.id]=!0)}function y(b,C){var w=n[C],_=i[b],x=_.data.hostModel,D=w.data.getItemGraphicEl(w.dataIndex),E=_.data.getItemGraphicEl(_.dataIndex);if(D===E){E&&Yoe(E,_.dataIndex,x);return}D&&g[D.id]||E&&(Hl(E),D?(Hl(D),n_(D),o=!0,t_(ls(D),ls(E),_.divide,x,b,a)):r_(E,x,b))}new Ny(n,i,d(!0,p),d(!1,p),null,"multiple").update(y).updateManyToOne(function(b,C){var w=i[b],_=w.data,x=_.hostModel,D=_.getItemGraphicEl(w.dataIndex),E=Xt(De(C,function(T){return n[T].data.getItemGraphicEl(n[T].dataIndex)}),function(T){return T&&T!==D&&!g[T.id]});D&&(Hl(D),E.length?(H(E,function(T){Hl(T),n_(T)}),o=!0,t_(ls(E),ls(D),w.divide,x,b,a)):r_(D,x,w.dataIndex))}).updateOneToMany(function(b,C){var w=n[C],_=w.data.getItemGraphicEl(w.dataIndex);if(!(_&&g[_.id])){var x=Xt(De(b,function(E){return i[E].data.getItemGraphicEl(i[E].dataIndex)}),function(E){return E&&E!==_}),D=i[b[0]].data.hostModel;x.length&&(H(x,function(E){return Hl(E)}),_?(Hl(_),n_(_),o=!0,t_(ls(_),ls(x),w.divide,D,b[0],a)):H(x,function(E){return r_(E,D,b[0])}))}}).updateManyToMany(function(b,C){new Ny(C,b,function(w){return n[w].data.getId(n[w].dataIndex)},function(w){return i[w].data.getId(i[w].dataIndex)}).update(function(w,_){y(b[w],C[_])}).execute()}).execute(),o&&H(e,function(b){var C=b.data,w=C.hostModel,_=w&&r.getViewOfSeriesModel(w),x=pl("update",w,0);_&&w.isAnimationEnabled()&&x&&x.duration>0&&_.group.traverse(function(D){D instanceof at&&!D.animators.length&&D.animateFrom({style:{opacity:0}},x)})})}function a8(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function o8(t){return ge(t)?t.sort().join(","):t}function Ha(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function Xoe(t,e){var r=je(),n=je(),i=je();H(t.oldSeries,function(o,s){var l=t.oldDataGroupIds[s],u=t.oldData[s],c=a8(o),f=o8(c);n.set(f,{dataGroupId:l,data:u}),ge(c)&&H(c,function(h){i.set(h,{key:f,dataGroupId:l,data:u})})});function a(o){r.get(o)&&tr("Duplicated seriesKey in universalTransition "+o)}return H(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=a8(o),c=o8(u),f=n.get(c);if(f)process.env.NODE_ENV!=="production"&&a(c),r.set(c,{oldSeries:[{dataGroupId:f.dataGroupId,divide:Ha(f.data),data:f.data}],newSeries:[{dataGroupId:s,divide:Ha(l),data:l}]});else if(ge(u)){process.env.NODE_ENV!=="production"&&a(c);var h=[];H(u,function(g){var v=n.get(g);v.data&&h.push({dataGroupId:v.dataGroupId,divide:Ha(v.data),data:v.data})}),h.length&&r.set(c,{oldSeries:h,newSeries:[{dataGroupId:s,data:l,divide:Ha(l)}]})}else{var d=i.get(u);if(d){var p=r.get(d.key);p||(p={oldSeries:[{dataGroupId:d.dataGroupId,data:d.data,divide:Ha(d.data)}],newSeries:[]},r.set(d.key,p)),p.newSeries.push({dataGroupId:s,data:l,divide:Ha(l)})}}}}),r}function s8(t,e){for(var r=0;r<t.length;r++){var n=e.seriesIndex!=null&&e.seriesIndex===t[r].seriesIndex||e.seriesId!=null&&e.seriesId===t[r].id;if(n)return r}}function Zoe(t,e,r,n){var i=[],a=[];H(kt(t.from),function(o){var s=s8(e.oldSeries,o);s>=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:Ha(e.oldData[s]),groupIdDim:o.dimension})}),H(kt(t.to),function(o){var s=s8(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:Ha(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&i8(i,a,n)}function Koe(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){H(kt(n.seriesTransition),function(i){H(kt(i.to),function(a){for(var o=n.updatedSeries,s=0;s<o.length;s++)(a.seriesIndex!=null&&a.seriesIndex===o[s].seriesIndex||a.seriesId!=null&&a.seriesId===o[s].id)&&(o[s][uv]=!0)})})}),t.registerUpdateLifecycle("series:transition",function(e,r,n){var i=$oe(r);if(i.oldSeries&&n.updatedSeries&&n.optionChanged){var a=n.seriesTransition;if(a)H(kt(a),function(d){Zoe(d,i,n,r)});else{var o=Xoe(i,n);H(o.keys(),function(d){var p=o.get(d);i8(p.oldSeries,p.newSeries,r)})}H(n.updatedSeries,function(d){d[uv]&&(d[uv]=!1)})}for(var s=e.getSeries(),l=i.oldSeries=[],u=i.oldDataGroupIds=[],c=i.oldData=[],f=0;f<s.length;f++){var h=s[f].getData();h.count()<JI&&(l.push(s[f]),u.push(s[f].get("dataGroupId")),c.push(h))}})}function l8(t,e,r){var n=Us.createCanvas(),i=e.getWidth(),a=e.getHeight(),o=n.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=i+"px",o.height=a+"px",n.setAttribute("data-zr-dom-id",t)),n.width=i*r,n.height=a*r,n}var i_=function(t){ve(e,t);function e(r,n,i){var a=t.call(this)||this;a.motionBlur=!1,a.lastFrameAlpha=.7,a.dpr=1,a.virtual=!1,a.config={},a.incremental=!1,a.zlevel=0,a.maxRepaintRectCount=5,a.__dirty=!0,a.__firstTimePaint=!0,a.__used=!1,a.__drawIndex=0,a.__startIndex=0,a.__endIndex=0,a.__prevStartIndex=null,a.__prevEndIndex=null;var o;i=i||lh,typeof r=="string"?o=l8(r,n,i):Oe(r)&&(o=r,r=o.id),a.id=r,a.dom=o;var s=o.style;return s&&(UA(o),o.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),a.painter=n,a.dpr=i,a}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var r=this.dpr;this.domBack=l8("back-"+this.id,this.painter,r),this.ctxBack=this.domBack.getContext("2d"),r!==1&&this.ctxBack.scale(r,r)},e.prototype.createRepaintRects=function(r,n,i,a){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,u=new ft(0,0,0,0);function c(y){if(!(!y.isFinite()||y.isZero()))if(o.length===0){var b=new ft(0,0,0,0);b.copy(y),o.push(b)}else{for(var C=!1,w=1/0,_=0,x=0;x<o.length;++x){var D=o[x];if(D.intersect(y)){var E=new ft(0,0,0,0);E.copy(D),E.union(y),o[x]=E,C=!0;break}else if(l){u.copy(y),u.union(D);var T=y.width*y.height,A=D.width*D.height,O=u.width*u.height,R=O-T-A;R<w&&(w=R,_=x)}}if(l&&(o[_].union(y),C=!0),!C){var b=new ft(0,0,0,0);b.copy(y),o.push(b)}l||(l=o.length>=s)}}for(var f=this.__startIndex;f<this.__endIndex;++f){var h=r[f];if(h){var d=h.shouldBePainted(i,a,!0,!0),p=h.__isRendered&&(h.__dirty&hn||!d)?h.getPrevPaintRect():null;p&&c(p);var g=d&&(h.__dirty&hn||!h.__isRendered)?h.getPaintRect():null;g&&c(g)}}for(var f=this.__prevStartIndex;f<this.__prevEndIndex;++f){var h=n[f],d=h&&h.shouldBePainted(i,a,!0,!0);if(h&&(!d||!h.__zr)&&h.__isRendered){var p=h.getPrevPaintRect();p&&c(p)}}var v;do{v=!1;for(var f=0;f<o.length;){if(o[f].isZero()){o.splice(f,1);continue}for(var m=f+1;m<o.length;)o[f].intersect(o[m])?(v=!0,o[f].union(o[m]),o.splice(m,1)):m++;f++}}while(v);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(r,n){var i=this.dpr,a=this.dom,o=a.style,s=this.domBack;o&&(o.width=r+"px",o.height=n+"px"),a.width=r*i,a.height=n*i,s&&(s.width=r*i,s.height=n*i,i!==1&&this.ctxBack.scale(i,i))},e.prototype.clear=function(r,n,i){var a=this.dom,o=this.ctx,s=a.width,l=a.height;n=n||this.clearColor;var u=this.motionBlur&&!r,c=this.lastFrameAlpha,f=this.dpr,h=this;u&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(a,0,0,s/f,l/f));var d=this.domBack;function p(g,v,m,y){if(o.clearRect(g,v,m,y),n&&n!=="transparent"){var b=void 0;if(kd(n)){var C=n.global||n.__width===m&&n.__height===y;b=C&&n.__canvasGradient||Xb(o,n,{x:0,y:0,width:m,height:y}),n.__canvasGradient=b,n.__width=m,n.__height=y}else Cq(n)&&(n.scaleX=n.scaleX||f,n.scaleY=n.scaleY||f,b=Zb(o,n,{dirty:function(){h.setUnpainted(),h.painter.refresh()}}));o.save(),o.fillStyle=b||n,o.fillRect(g,v,m,y),o.restore()}u&&(o.save(),o.globalAlpha=c,o.drawImage(d,g,v,m,y),o.restore())}!i||u?p(0,0,s,l):i.length&&H(i,function(g){p(g.x*f,g.y*f,g.width*f,g.height*f)})},e}(yi),u8=1e5,us=314159,ep=.01,Qoe=.001;function Joe(t){return t?t.__builtin__?!0:!(typeof t.resize!="function"||typeof t.refresh!="function"):!1}function ese(t,e){var r=document.createElement("div");return r.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",r}var tse=function(){function t(e,r,n,i){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var a=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=n=ue({},n||{}),this.dpr=n.devicePixelRatio||lh,this._singleCanvas=a,this.root=e;var o=e.style;o&&(UA(e),e.innerHTML=""),this.storage=r;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(a){var c=e,f=c.width,h=c.height;n.width!=null&&(f=n.width),n.height!=null&&(h=n.height),this.dpr=n.devicePixelRatio||1,c.width=f*this.dpr,c.height=h*this.dpr,this._width=f,this._height=h;var d=new i_(c,this,this.dpr);d.__builtin__=!0,d.initContext(),l[us]=d,d.zlevel=us,s.push(us),this._domRoot=e}else{this._width=Ev(e,0,n),this._height=Ev(e,1,n);var u=this._domRoot=ese(this._width,this._height);e.appendChild(u)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.refresh=function(e){var r=this.storage.getDisplayList(!0),n=this._prevDisplayList,i=this._zlevelList;this._redrawId=Math.random(),this._paintList(r,n,e,this._redrawId);for(var a=0;a<i.length;a++){var o=i[a],s=this._layers[o];if(!s.__builtin__&&s.refresh){var l=a===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=r.slice()),this},t.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},t.prototype._paintHoverList=function(e){var r=e.length,n=this._hoverlayer;if(n&&n.clear(),!!r){for(var i={inHover:!0,viewWidth:this._width,viewHeight:this._height},a,o=0;o<r;o++){var s=e[o];s.__inHover&&(n||(n=this._hoverlayer=this.getLayer(u8)),a||(a=n.ctx,a.save()),ns(a,s,i,o===r-1))}a&&a.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(u8)},t.prototype.paintOne=function(e,r){NR(e,r)},t.prototype._paintList=function(e,r,n,i){if(this._redrawId===i){n=n||!1,this._updateLayerStatus(e);var a=this._doPaintList(e,r,n),o=a.finished,s=a.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),o)this.eachLayer(function(u){u.afterBrush&&u.afterBrush()});else{var l=this;yv(function(){l._paintList(e,r,n,i)})}}},t.prototype._compositeManually=function(){var e=this.getLayer(us).ctx,r=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,r,n),this.eachBuiltinLayer(function(i){i.virtual&&e.drawImage(i.dom,0,0,r,n)})},t.prototype._doPaintList=function(e,r,n){for(var i=this,a=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],u=this._layers[l];u.__builtin__&&u!==this._hoverlayer&&(u.__dirty||n)&&a.push(u)}for(var c=!0,f=!1,h=function(g){var v=a[g],m=v.ctx,y=o&&v.createRepaintRects(e,r,d._width,d._height),b=n?v.__startIndex:v.__drawIndex,C=!n&&v.incremental&&Date.now,w=C&&Date.now(),_=v.zlevel===d._zlevelList[0]?d._backgroundColor:null;if(v.__startIndex===v.__endIndex)v.clear(!1,_,y);else if(b===v.__startIndex){var x=e[b];(!x.incremental||!x.notClear||n)&&v.clear(!1,_,y)}b===-1&&(console.error("For some unknown reason. drawIndex is -1"),b=v.__startIndex);var D,E=function(R){var B={inHover:!1,allClipped:!1,prevEl:null,viewWidth:i._width,viewHeight:i._height};for(D=b;D<v.__endIndex;D++){var I=e[D];if(I.__inHover&&(f=!0),i._doPaintEl(I,v,o,R,B,D===v.__endIndex-1),C){var N=Date.now()-w;if(N>15)break}}B.prevElClipPaths&&m.restore()};if(y)if(y.length===0)D=v.__endIndex;else for(var T=d.dpr,A=0;A<y.length;++A){var O=y[A];m.save(),m.beginPath(),m.rect(O.x*T,O.y*T,O.width*T,O.height*T),m.clip(),E(O),m.restore()}else m.save(),E(),m.restore();v.__drawIndex=D,v.__drawIndex<v.__endIndex&&(c=!1)},d=this,p=0;p<a.length;p++)h(p);return $e.wxa&&H(this._layers,function(g){g&&g.ctx&&g.ctx.draw&&g.ctx.draw()}),{finished:c,needsRefreshHover:f}},t.prototype._doPaintEl=function(e,r,n,i,a,o){var s=r.ctx;if(n){var l=e.getPaintRect();(!i||l&&l.intersect(i))&&(ns(s,e,a,o),e.setPrevPaintRect(l))}else ns(s,e,a,o)},t.prototype.getLayer=function(e,r){this._singleCanvas&&!this._needsManuallyCompositing&&(e=us);var n=this._layers[e];return n||(n=new i_("zr_"+e,this,this.dpr),n.zlevel=e,n.__builtin__=!0,this._layerConfig[e]?bt(n,this._layerConfig[e],!0):this._layerConfig[e-ep]&&bt(n,this._layerConfig[e-ep],!0),r&&(n.virtual=r),this.insertLayer(e,n),n.initContext()),n},t.prototype.insertLayer=function(e,r){var n=this._layers,i=this._zlevelList,a=i.length,o=this._domRoot,s=null,l=-1;if(n[e]){process.env.NODE_ENV!=="production"&&So("ZLevel "+e+" has been used already");return}if(!Joe(r)){process.env.NODE_ENV!=="production"&&So("Layer of zlevel "+e+" is not valid");return}if(a>0&&e>i[0]){for(l=0;l<a-1&&!(i[l]<e&&i[l+1]>e);l++);s=n[i[l]]}if(i.splice(l+1,0,e),n[e]=r,!r.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(r.dom,u.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)},t.prototype.eachLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i];e.call(r,this._layers[a],a)}},t.prototype.eachBuiltinLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i],o=this._layers[a];o.__builtin__&&e.call(r,o,a)}},t.prototype.eachOtherLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i],o=this._layers[a];o.__builtin__||e.call(r,o,a)}},t.prototype.getLayers=function(){return this._layers},t.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(f,h){f.__dirty=f.__used=!1});function r(f){a&&(a.__endIndex!==f&&(a.__dirty=!0),a.__endIndex=f)}if(this._singleCanvas)for(var n=1;n<e.length;n++){var i=e[n];if(i.zlevel!==e[n-1].zlevel||i.incremental){this._needsManuallyCompositing=!0;break}}var a=null,o=0,s,l;for(l=0;l<e.length;l++){var i=e[l],u=i.zlevel,c=void 0;s!==u&&(s=u,o=0),i.incremental?(c=this.getLayer(u+Qoe,this._needsManuallyCompositing),c.incremental=!0,o=1):c=this.getLayer(u+(o>0?ep:0),this._needsManuallyCompositing),c.__builtin__||So("ZLevel "+u+" has been used by unkown layer "+c.id),c!==a&&(c.__used=!0,c.__startIndex!==l&&(c.__dirty=!0),c.__startIndex=l,c.incremental?c.__drawIndex=-1:c.__drawIndex=l,r(l),a=c),i.__dirty&hn&&!i.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(f,h){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(e){e.clear()},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e,H(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var n=this._layerConfig;n[e]?bt(n[e],r,!0):n[e]=r;for(var i=0;i<this._zlevelList.length;i++){var a=this._zlevelList[i];if(a===e||a===e+ep){var o=this._layers[a];bt(o,n[e],!0)}}}},t.prototype.delLayer=function(e){var r=this._layers,n=this._zlevelList,i=r[e];i&&(i.dom.parentNode.removeChild(i.dom),delete r[e],n.splice(ct(n,e),1))},t.prototype.resize=function(e,r){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var i=this._opts,a=this.root;if(e!=null&&(i.width=e),r!=null&&(i.height=r),e=Ev(a,0,i),r=Ev(a,1,i),n.style.display="",this._width!==e||r!==this._height){n.style.width=e+"px",n.style.height=r+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,r);this.refresh(!0)}this._width=e,this._height=r}else{if(e==null||r==null)return;this._width=e,this._height=r,this.getLayer(us).resize(e,r)}return this},t.prototype.clearLayer=function(e){var r=this._layers[e];r&&r.clear()},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},t.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[us].dom;var r=new i_("image",this,e.pixelRatio||this.dpr);r.initContext(),r.clear(!1,e.backgroundColor||this._backgroundColor);var n=r.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var i=r.dom.width,a=r.dom.height;this.eachLayer(function(f){f.__builtin__?n.drawImage(f.dom,0,0,i,a):f.renderToCanvas&&(n.save(),f.renderToCanvas(n),n.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,u=s.length;l<u;l++){var c=s[l];ns(n,c,o,l===u-1)}return r.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t}();function rse(t){t.registerPainter("canvas",tse)}La([Sae,noe,Yae,$ae,pae,boe,goe,Nee,hee,ite,Soe,Koe,rse]),d1("ccmonet",{color:["#5B8FF9","#5AD8A6","#F6BD16","#E86452","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3","#269A99"],categoryAxis:{axisLine:{lineStyle:{color:"#e5e6eb"}},axisTick:{lineStyle:{color:"#e5e6eb"}},axisLabel:{color:"#86909C"},splitLine:{lineStyle:{color:"#f2f3f5",type:"dashed"}}},valueAxis:{axisLine:{lineStyle:{color:"#e5e6eb"}},axisTick:{lineStyle:{color:"#e5e6eb"}},axisLabel:{color:"#86909C"},splitLine:{lineStyle:{color:"#f2f3f5",type:"dashed"}}}});const nse=P.memo(({options:t,echartRef:e})=>{const r=P.useRef(null),n=P.useRef(null);return P.useEffect(()=>(r.current&&(n.current=sne(r.current,"ccmonet"),window.__chartInstanceRef=n),()=>{n.current&&n.current.dispose()}),[]),P.useEffect(()=>{n.current&&(n.current.clear(),t&&Object.keys(t).length>0&&n.current.setOption({...t}))},[t]),P.useImperativeHandle(e,()=>({resize:()=>{n.current&&n.current.resize()},getWidth:()=>{n.current&&n.current.getWidth()}})),S.jsx("div",{ref:r,style:{width:"100%",height:"100%"}})}),ise=()=>S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:139,height:118,fill:"none",children:[S.jsx("path",{fill:"#F4F4F5",d:"M124.987 58.727c0 13.227-4.202 25.657-11.204 35.463-3.879 5.36-8.511 10.035-13.898 13.684-8.618 6.044-19.068 9.465-30.164 9.465-30.488.114-55.266-26.113-55.266-58.612C14.455 26.34 39.125 0 69.721 0c11.096 0 21.438 3.421 30.164 9.465 5.387 3.649 10.019 8.324 13.898 13.683 7.002 9.921 11.204 22.237 11.204 35.579Z"}),S.jsx("path",{stroke:"#D0D0D4",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:2,d:"M2 102.569h130.77"}),S.jsx("path",{fill:"#fff",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"M93.85 50.054v52.515H23.22c-2.786 0-4.875-2.36-4.875-5.163V50.054H93.85Z"}),S.jsx("path",{fill:"#DAE1ED",d:"M121.874 50.054v47.352c0 2.95-2.323 5.163-5.082 5.163h-22.94V50.054h28.022Z"}),S.jsx("path",{fill:"#F4F4F5",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"M121.874 50.054v47.352c0 2.95-2.323 5.163-5.082 5.163h-22.94V50.054h28.022Z"}),S.jsx("path",{fill:"#C5CDDB",d:"m45.59 50.054 14.852-24.617h76.22L121.39 50.055h-75.8Z"}),S.jsx("path",{fill:"#F4F4F5",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"m45.59 50.054 14.852-24.617h76.22L121.39 50.055h-75.8Z"}),S.jsx("path",{fill:"url(#a)",d:"M121.874 50.197v27.756h-20.433c-1.898 0-3.211-1.295-3.503-3.164l-4.086-24.735 28.022.143Z",opacity:.3}),S.jsx("path",{fill:"#fff",stroke:"#D0D0D4",strokeMiterlimit:10,strokeWidth:2,d:"M121.287 50.054H93.852l13.93 22.258c.995 1.474 2.559 2.358 4.123 2.358h21.322c1.422 0 2.417-1.769 1.564-2.948l-13.504-21.668ZM93.85 50.054 78.895 25.437H2l15.52 24.617h76.33Z"}),S.jsx("path",{fill:"#D0D0D4",d:"M56.028 80.415H26.59a1.23 1.23 0 0 1-1.238-1.231c0-.684.55-1.23 1.238-1.23h29.438a1.23 1.23 0 0 1 1.238 1.23c-.138.684-.55 1.23-1.238 1.23ZM56.028 86.159H26.59c-.688 0-1.238-.365-1.238-.82 0-.457.55-.821 1.238-.821h29.438c.687 0 1.238.364 1.238.82-.138.456-.55.82-1.238.82ZM40.44 92.723H26.61c-.699 0-1.257-.365-1.257-.82 0-.456.558-.821 1.257-.821H40.44c.699 0 1.258.365 1.258.82-.14.456-.699.821-1.258.821Z"}),S.jsx("defs",{children:S.jsxs("linearGradient",{id:"a",x1:107.869,x2:107.869,y1:78.525,y2:53.113,gradientUnits:"userSpaceOnUse",children:[S.jsx("stop",{offset:.003,stopColor:"#606673",stopOpacity:0}),S.jsx("stop",{offset:1,stopColor:"#AAB2C5"})]})})]}),c8=t=>{const{t:e}=Rt();return S.jsxs("div",{style:{color:"#A1A1AA",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[S.jsx(ise,{}),S.jsx("span",{children:e("empty")})]})};c8.displayName="Empty";const f8=["#5B8FF9","#5AD8A6","#F6BD16","#E86452","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3","#269A99"],d8=2,ase=10,h8=(t,e)=>{const r=u0("chart.pieOther"),n=t.reduce((u,c)=>u+c,0);if(n===0)return{data:t.map((u,c)=>({value:u,name:e[c]}))};const i=t.map((u,c)=>({value:u,name:e[c],percent:u/n*100}));i.sort((u,c)=>c.percent-u.percent);const a=[],o=[];if(i.forEach(u=>{u.percent>=d8&&a.length<ase-1?a.push(u):o.push(u)}),o.length===0)return{data:a.map(u=>({value:u.value,name:u.name}))};const s=o.reduce((u,c)=>u+c.value,0),l=a.map(u=>({value:u.value,name:u.name}));return l.push({value:s,name:r,_otherDetails:o.map(u=>({name:u.name,value:u.value}))}),{data:l}},ose=t=>{const{type:e,categories:r}=t,n={"chart-bar":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-bar-pile":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-bar-percentage":{xAxis:{type:"category",data:r},yAxis:{type:"value",max:100,axisLabel:{formatter:"{value} %"}}},"chart-line":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-line-smooth":{xAxis:{type:"category",data:r},yAxis:{type:"value"}},"chart-pie":{xAxis:{show:!1},yAxis:{show:!1}},"chart-pie-circular":{xAxis:{show:!1},yAxis:{show:!1}},"chart-strip-bar":{xAxis:{type:"value"},yAxis:{type:"category",data:r}},"chart-bar-graph":{xAxis:{type:"value"},yAxis:{type:"category",data:r}},"chart-strip-bar-pile":{xAxis:{type:"value"},yAxis:{type:"category",data:r}},"chart-strip-bar-percentage":{xAxis:{type:"value",max:100,axisLabel:{formatter:"{value} %"}},yAxis:{type:"category",data:r}},[Fr.chartCombination]:{xAxis:{type:"category",data:r},yAxis:{type:"value"}}};return n[e]??n["chart-bar"]},v8=({type:t,data:e,label:r,name:n,isGroup:i,groupField:a,labels:o,colorIndex:s=0})=>{let l;const u=t==="chart-strip-bar"||t==="chart-strip-bar-pile"||t==="chart-strip-bar-percentage"||t==="chart-bar-graph",c=f8[s%f8.length],f={...r,position:"outside",formatter:r!=null&&r.show?p=>{const g=p.percent??0;return g<d8?"":`${p.name}: ${g}%`}:void 0,color:"#4E5969",fontSize:12},h={show:!0,length:12,length2:8,lineStyle:{color:"#C9CDD4"}},d={formatter:p=>{var v;const g=(v=p.data)==null?void 0:v._otherDetails;if(g&&g.length>0){const m=`<div style="margin-bottom:6px;font-weight:500">${u0("chart.pieOtherItems",{count:g.length})} (${p.percent}%)</div>`,y=g.map(b=>`<div style="display:flex;justify-content:space-between;gap:12px;line-height:22px"><span style="color:#86909C">${b.name}</span><span>${b.value}</span></div>`).join("");return`<div>${m}<div style="max-height:200px;overflow-y:auto;padding-right:8px;scrollbar-width:thin;scrollbar-color:#e5e6eb transparent">${y}</div></div>`}return`<div style="font-weight:500">${p.name}</div><div style="margin-top:4px">${p.value} (${p.percent}%)</div>`}};return t==="chart-pie"?l={data:h8(e,o).data,name:n,type:"pie",radius:"50%",label:f,labelLine:h,tooltip:d,itemStyle:{borderColor:"#fff",borderWidth:2},emphasis:{scaleSize:6}}:t==="chart-pie-circular"?l={data:h8(e,o).data,type:"pie",name:n,radius:["40%","70%"],label:f,labelLine:h,tooltip:d,itemStyle:{borderColor:"#fff",borderWidth:2},emphasis:{scaleSize:6}}:t==="chart-line"||t==="chart-line-smooth"?l={data:e,name:n,type:"line",smooth:t==="chart-line-smooth",label:r,symbol:"circle",symbolSize:6,lineStyle:{width:2.5},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:c+"33"},{offset:1,color:c+"05"}]}}}:l={data:e,name:n,type:"bar",label:r,barMaxWidth:40,itemStyle:{borderRadius:u?[0,4,4,0]:[4,4,0,0],color:u?{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:c},{offset:1,color:c+"B3"}]}:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:c},{offset:1,color:c+"B3"}]}},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.15)"}}},(t==="chart-bar-percentage"||t==="chart-bar-pile"||t==="chart-strip-bar-pile"||t==="chart-strip-bar-percentage")&&i&&a&&(l.stack=a),l},sse=({customeStyle:t,series:e,chartConfig:r,width:n})=>{var C,w,_,x;const{isLeftAxisShow:i,isRightAxisShow:a,maxLeftSeriesDataStrLen:o,maxRightSeriesDataStrLen:s,maxSeriesDataLen:l}=e.reduce((D,E)=>{var R;let T={...D},A=E.yAxisIndex==0?"left":"right",O=Math.max(...E.data.map(B=>String(B).length));return A=="left"?(T.maxLeftSeriesDataStrLen=Math.max(T.maxLeftSeriesDataStrLen,O),T.isLeftAxisShow=!0):(T.maxRightSeriesDataStrLen=Math.max(T.maxRightSeriesDataStrLen,O),T.isRightAxisShow=!0),T.maxSeriesDataLen=Math.max(T.maxSeriesDataLen,(R=E==null?void 0:E.data)==null?void 0:R.length),T},{isLeftAxisShow:!1,isRightAxisShow:!1,maxLeftSeriesDataStrLen:0,maxRightSeriesDataStrLen:0,maxSeriesDataLen:0});let u=((C=r==null?void 0:r.xAxis)==null?void 0:C.type)==="category"?"xAxis":"yAxis";const f=(x=(u==="xAxis"?(w=r==null?void 0:r.xAxis)==null?void 0:w.data:(_=r==null?void 0:r.yAxis)==null?void 0:_.data)??[])==null?void 0:x.reduce((D,E)=>{const T=String(E).length;return Math.max(D,T)},0),h=9,d=12;let p=45,g=0,v=0,m=0,y=0;if(u=="xAxis"){const D={45:h*.8,90:h,0:h};l>3&&(f>=15&&(y=90),f>5&&(y=45),n<3&&(y=90)),m=D[`${y}`]*(y==0?1:Math.min(f,18))+d,g=Math.min(o,18)*h+d,v=Math.min(s,18)*h+d}else m=Math.min(o,18)*h+d,g=Math.min(f,18)*h+d,v=d;g=Math.max(g,40),v=Math.max(v,40),i||(g=d),a||(v=d);let b=h;return t!=null&&t.xtitle&&(u=="xAxis"?m=m+b:v=v+b),t!=null&&t.ytitle&&(u=="xAxis"?g=g+b:p=p+b),{top:p+"px",left:g+"px",right:v+"px",bottom:Math.max(m,40)+"px",axisLabelRotate:y}},lse=({moduleDataApi:t,customData:e,customeStyle:r,width:n=2,height:i=2})=>{const{globalData:a,globalFilterCondition:o}=pr();let s=P.useMemo(()=>o==null?void 0:o.find(_=>(_==null?void 0:_.dataSourceId)===(e==null?void 0:e.dataSourceId)),[o,e==null?void 0:e.dataSourceId]);const[l,u]=P.useState(),[c,f]=P.useState(),h=Mt(async()=>{var w,_,x;if(u([]),e){f(!0);let D="";const E=(e==null?void 0:e.xAxis)==="tags"?"tag":e==null?void 0:e.xAxis,T=(e==null?void 0:e.groupField)==="tags"?"tag":e==null?void 0:e.groupField;e.isGroup?(e.yAxis==="recordTotal"&&(D+=`select=${E},${T},id.count()`),e.yAxis==="fieldValue"&&(e!=null&&e.yAxisField)&&(D+=`select=${E},${T},${e==null?void 0:e.yAxisField}.${e==null?void 0:e.yAxisFieldType}()`)):(e.yAxis==="recordTotal"&&(D+=`select=${E},id.count()`),e.yAxis==="fieldValue"&&(e!=null&&e.yAxisField)&&(D+=`select=${E},${e==null?void 0:e.yAxisField}.${e==null?void 0:e.yAxisFieldType}()`));let A=[];if((((w=s==null?void 0:s.conditionList)==null?void 0:w.length)??0)>0&&A.push(s),(((x=(_=e==null?void 0:e.conditionData)==null?void 0:_.conditionList)==null?void 0:x.length)??0)>0&&A.push(e==null?void 0:e.conditionData),A.length>0){let O=Ad(A);D+=O?`&${O}`:""}e!=null&&e.dataSourceId&&(t==null||t({id:e==null?void 0:e.dataSourceId,query:D}).then(O=>{if(!O.success){Y.message.error(O.message);return}u(O.data)}).finally(()=>{f(!1)}))}else u([])});M6(()=>{e&&h()},[e==null?void 0:e.dataSourceId,e==null?void 0:e.conditionData,e==null?void 0:e.sortField,e==null?void 0:e.sortOrder,e==null?void 0:e.xAxis,e==null?void 0:e.yAxis,e==null?void 0:e.yAxisField,e==null?void 0:e.yAxisFieldType,e==null?void 0:e.isGroup,e==null?void 0:e.groupField,s],{wait:60});const d=P.useMemo(()=>{var _,x;return(x=(_=a==null?void 0:a.sourceData)==null?void 0:_.find(D=>D.value===(e==null?void 0:e.dataSourceId)))==null?void 0:x.fields},[a,e==null?void 0:e.dataSourceId]),p=P.useMemo(()=>e&&l&&e.type&&l.length>0?(_=>{var st,Nt,Xe,re,Ce,me,pe,Ye,Te,ze,Ze,qe,mt,cr,fr;const x=({item:ce,field:Re,timeGroupInterval:Ke})=>Bu({fieldOptions:d,val:ce[Re],field:Re,fieldMap:a==null?void 0:a.fieldMap,timeGroupInterval:Ke,showNill:!1}),D=ce=>{const Re=d==null?void 0:d.find(Ke=>Ke.value===ce);return Re==null?void 0:Re.label},E=ce=>{var Re;return((Re=d==null?void 0:d.find(Ke=>Ke.value===ce))==null?void 0:Re.type)==="timestamp"},T={tags:"tag"},A=T[e==null?void 0:e.xAxis]??(e==null?void 0:e.xAxis),O=T[e==null?void 0:e.groupField]??(e==null?void 0:e.groupField);console.log("newGroupField",O);let R=qH(_,ce=>x({item:ce,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval})??"Unknown"),B=Object.keys(R).map(ce=>R[ce].reduce((Ne,nt)=>(Object.keys(nt).forEach(Lt=>{let on=nt[Lt];BS(on)?Ne[Lt]=Ne!=null&&Ne[Lt]?Ne[Lt]+on:on:Ne[Lt]=on}),Ne),{}));const I=new Set,N=new Set,k={},z={};B.forEach(ce=>{const Re=x({item:ce,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval})??"Unknown",Ke=e.yAxis==="recordTotal"?ce==null?void 0:ce.count:ce[e==null?void 0:e.yAxisFieldType]||0;z[Re]=Ke}),e!=null&&e.isGroup&&(e!=null&&e.groupField)&&_.forEach(ce=>{const Re=x({item:ce,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval})??"Unknown",Ke=e.yAxis==="recordTotal"?ce==null?void 0:ce.count:ce[e==null?void 0:e.yAxisFieldType]||0,Ne=x({item:ce,field:O})??"Unknown";N.add(Ne),k[Ne]||(k[Ne]={}),k[Ne][Re]=Ke}),console.log("test",{groupData:R,categories:I,stackCategories:N,valueGroups:k,valueCounts:z});const V={},F={};if(e!=null&&e.isGroup&&(e!=null&&e.groupField)){const ce={};Object.keys(k).forEach(Re=>{Object.entries(k[Re]).forEach(([Ke,Ne])=>{ce[Ke]=(ce[Ke]||0)+Ne})}),Object.keys(k).forEach(Re=>{F[Re]={},Object.entries(k[Re]).forEach(([Ke,Ne])=>{const nt=ce[Ke]||1;F[Re][Ke]=Ne/nt*100})})}else Object.entries(z).forEach(([ce,Re])=>{const Ke=Re||1;V[ce]=Re/Ke*100});let L=(e==null?void 0:e.sortField)??"xAxis",q=(e==null?void 0:e.sortOrder)??"asc";const ee=[...B].sort((ce,Re)=>{let Ke,Ne;switch(L){case"xAxis":Ke=x({item:ce,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval}),Ne=x({item:Re,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval});break;case"yAxisField":Ke=e.yAxis==="recordTotal"?ce==null?void 0:ce.count:ce[e==null?void 0:e.yAxisFieldType]||0,Ne=e.yAxis==="recordTotal"?Re==null?void 0:Re.count:Re[e==null?void 0:e.yAxisFieldType]||0;break}const nt=q==="asc"?1:-1;return Ke>Ne?1*nt:Ke<Ne?-1*nt:0}).map(ce=>x({item:ce,field:A,timeGroupInterval:e==null?void 0:e.timeGroupInterval})??"Unknown");if(I.clear(),ee.forEach(ce=>I.add(ce)),!E(e==null?void 0:e.xAxis)&&e.displayRange!=="ALL"&&e.displayRange){let ce=Array.from(I).sort((nt,Lt)=>z[Lt]-z[nt]),Re=[],[Ke,Ne]=e.displayRange.split("_");Ke==="TOP"?Re=ce.slice(0,Number(Ne)):Re=ce.slice(-Number(Ne)),Array.from(I).forEach(nt=>(Re.includes(nt)||I.delete(nt),nt))}const te=ce=>e!=null&&e.isGroup&&(e!=null&&e.groupField)?(ce==null?void 0:ce.value)==0?"":`${ce==null?void 0:ce.value}`:`${ce==null?void 0:ce.value}`,j=((st=e==null?void 0:e.type)==null?void 0:st.includes("strip-bar"))||(e==null?void 0:e.type)==="chart-bar-graph",J={show:(Nt=e==null?void 0:e.chartOptions)==null?void 0:Nt.includes("label"),position:j?"right":"top",formatter:te},W=Array.from(I),U=Array.from(N),Q=[],Z=ose({type:e==null?void 0:e.type,categories:W}),X=ce=>BS(ce)?Math.floor(ce*100)/100:ce;if(e!=null&&e.isGroup&&(e!=null&&e.groupField))U.forEach((ce,Re)=>{var on,aa;const Ke=["chart-bar-percentage","chart-strip-bar-percentage"].includes(e.type)?W.map(yn=>X(F[ce][yn]||0)):W.map(yn=>X(k[ce][yn]||0));let Ne=e.type,nt="left";if(Ne==Fr.chartCombination){let yn=((e==null?void 0:e.groupFieldConfig)??[]).find(uf=>x({item:{[O]:uf==null?void 0:uf.value},field:O})==ce);Ne=((on=yn==null?void 0:yn.config)==null?void 0:on.chartType)??Fr.ChartBar,nt=((aa=yn==null?void 0:yn.config)==null?void 0:aa.yAxisPos)??"left"}let Lt=v8({type:Ne,data:Ke,label:J,name:ce,isGroup:e==null?void 0:e.isGroup,groupField:e==null?void 0:e.groupField,labels:W,colorIndex:Re});Lt.yAxisIndex=nt=="left"?0:1,Q.push(Lt)});else{const ce=["chart-bar-percentage","chart-strip-bar-percentage"].includes(e.type)?W.map(nt=>{var Lt;return X(((Lt=V[nt])==null?void 0:Lt.toFixed(2))||0)}):W.map(nt=>X(z[nt]||0));let Re=e.type,Ke="left";Re==Fr.chartCombination?Re=((Xe=e==null?void 0:e.yAxisFieldConfig)==null?void 0:Xe.chartType)??Fr.ChartBar:Ke=((re=e==null?void 0:e.yAxisFieldConfig)==null?void 0:re.yAxisPos)??"left";let Ne=v8({type:Re,data:ce,label:J,name:e.yAxis==="recordTotal"?u0("pb.statisticsText"):D(e==null?void 0:e.yAxisField),isGroup:e==null?void 0:e.isGroup,groupField:e==null?void 0:e.groupField,labels:W,colorIndex:0});Ne.yAxisIndex=Ke=="left"?0:1,Q.push(Ne)}console.log("series",Q,e);const he=sse({series:Q,chartConfig:Z,width:n,customeStyle:r}),le=(Ce=e==null?void 0:e.chartOptions)==null?void 0:Ce.includes("legend"),xe=(e==null?void 0:e.type)==="chart-pie"||(e==null?void 0:e.type)==="chart-pie-circular",ye=Q.some(ce=>(ce==null?void 0:ce.yAxisIndex)==0),Fe=Q.some(ce=>(ce==null?void 0:ce.yAxisIndex)==1),Se={...Z==null?void 0:Z.yAxis,axisTick:{show:(me=e==null?void 0:e.chartOptions)==null?void 0:me.includes("axis"),lineStyle:{color:"#e5e6eb"}},axisLine:{show:(pe=e==null?void 0:e.chartOptions)==null?void 0:pe.includes("axis"),lineStyle:{color:"#e5e6eb"}},axisLabel:{show:(Ye=e==null?void 0:e.chartOptions)==null?void 0:Ye.includes("label"),color:"#86909C",fontSize:12,formatter:ce=>ce.length>15?`${ce.slice(0,15)}...`:ce,hideOverlap:!0,...(Te=Z==null?void 0:Z.yAxis)==null?void 0:Te.axisLabel},splitLine:{show:(ze=e==null?void 0:e.chartOptions)==null?void 0:ze.includes("splitLine"),lineStyle:{color:"#f2f3f5",type:"dashed"}}};return{legend:{type:"scroll",left:"center",right:"center",top:"0",show:le,itemWidth:16,itemHeight:8,itemGap:16,icon:"roundRect",textStyle:{color:"#86909C",fontSize:12},data:(Q==null?void 0:Q.map(ce=>(ce==null?void 0:ce.name)||""))||[]},grid:he,graphic:{elements:[{type:"text",left:"center",bottom:"10px",style:{text:(r==null?void 0:r.xtitle)||"",fill:"#86909C",fontSize:12,fontWeight:"normal"}},{type:"text",left:"10px",top:"center",style:{text:(r==null?void 0:r.ytitle)||"",fill:"#86909C",fontSize:12,fontWeight:"normal"},rotation:Math.PI/2}]},xAxis:{...Z==null?void 0:Z.xAxis,axisTick:{show:(Ze=e==null?void 0:e.chartOptions)==null?void 0:Ze.includes("axis"),lineStyle:{color:"#e5e6eb"}},axisLine:{show:(qe=e==null?void 0:e.chartOptions)==null?void 0:qe.includes("axis"),lineStyle:{color:"#e5e6eb"}},axisLabel:{show:(mt=e==null?void 0:e.chartOptions)==null?void 0:mt.includes("label"),rotate:he.axisLabelRotate,interval:"auto",color:"#86909C",fontSize:12,formatter:ce=>ce.length>15?`${ce.slice(0,15)}...`:ce,...((cr=Z==null?void 0:Z.xAxis)==null?void 0:cr.axisLabel)??{}},splitLine:{show:(fr=e==null?void 0:e.chartOptions)==null?void 0:fr.includes("splitLine"),lineStyle:{color:"#f2f3f5",type:"dashed"}}},yAxis:[{show:ye,...Se},{show:Fe,...Se}],series:Q,tooltip:{trigger:xe?"item":"axis",enterable:xe,confine:!xe,axisPointer:{type:"shadow"},backgroundColor:"rgba(255, 255, 255, 0.96)",borderColor:"transparent",borderRadius:8,textStyle:{color:"#1d2129",fontSize:13},extraCssText:xe?"max-width:30vw; max-height:280px; overflow-y:auto; white-space:pre-wrap; word-break:break-all; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);":"max-width:30vw; white-space:pre-wrap; word-break:break-all; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);",appendTo:"body",...xe?{}:{formatter:ce=>{var Ne;if(!Array.isArray(ce))return"";const Re=`<div style="margin-bottom:6px;font-weight:500;color:#1d2129">${((Ne=ce[0])==null?void 0:Ne.axisValueLabel)??""}</div>`,Ke=ce.map(nt=>{var Lt,on,aa;return`<div style="display:flex;align-items:center;justify-content:space-between;gap:12px;line-height:22px"><span style="display:inline-flex;align-items:center;gap:6px"><span style="display:inline-block;width:8px;height:8px;border-radius:50%;background:${((aa=(on=(Lt=nt.color)==null?void 0:Lt.colorStops)==null?void 0:on[0])==null?void 0:aa.color)??nt.color}"></span>${nt.seriesName}</span><span style="font-weight:500">${nt.value}</span></div>`}).join("");return Re+Ke}}},animation:!0,animationDuration:600,animationEasing:"cubicOut"}})(l):null,[e==null?void 0:e.sortField,e==null?void 0:e.sortOrder,e==null?void 0:e.type,e==null?void 0:e.chartOptions,e==null?void 0:e.timeGroupInterval,e==null?void 0:e.groupFieldConfig,e==null?void 0:e.yAxisFieldConfig,e==null?void 0:e.displayRange,r,l,n,i,d]),g=P.useRef(),v=P.useRef(null),m=$g(v);P.useEffect(()=>{var w;m&&((w=g==null?void 0:g.current)==null||w.resize())},[m]);const y=c,b=!c&&!p,C=!y&&!!p;return S.jsxs("div",{style:{width:"100%",height:"100%"},ref:v,children:[y&&S.jsx(Y.Spin,{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},spinning:c}),b&&S.jsx(c8,{}),C&&S.jsx(nse,{echartRef:g,options:p??{}})]})},p8=P.memo(lse),tp={"combination-chart-option":"_combination-chart-option_1cwba_1","group-field-config-picker":"_group-field-config-picker_1cwba_11","group-field-config-picker__title":"_group-field-config-picker__title_1cwba_14","group-field-config-picker__item":"_group-field-config-picker__item_1cwba_18","group-field-config-picker__input":"_group-field-config-picker__input_1cwba_23"},g8="combination-chart-option",Vl={chartType:Fr.ChartBar,yAxisPos:"left"},m8=t=>{const{style:e,className:r,initTriggerChange:n=!1}=t,{t:i}=Rt(),[a,o]=lo(t),s=[{label:i("chart.t2"),key:Fr.ChartBar,icon:S.jsx(TC,{})},{label:i("chart.t8"),key:Fr.ChartLine,icon:S.jsx(LC,{})}],l=[{label:i("chart.left"),key:"left",icon:S.jsx(MC,{})},{label:i("chart.right"),key:"right",icon:S.jsx(PC,{})}],u=(a==null?void 0:a.chartType)??(Vl==null?void 0:Vl.chartType),c=(a==null?void 0:a.yAxisPos)??(Vl==null?void 0:Vl.yAxisPos),f=P.useMemo(()=>s.find(d=>d.key===u),[u,s]),h=P.useMemo(()=>l.find(d=>d.key===c),[c,l]);return S.jsxs("div",{className:cn(tp[`${g8}`],g8),style:e,children:[S.jsx(Y.Dropdown,{trigger:["click"],placement:"bottom",menu:{items:s.map(d=>({...d,onClick:()=>{o({chartType:d.key,yAxisPos:c})}}))},children:S.jsx(Y.Tooltip,{title:f==null?void 0:f.label,children:S.jsx(Y.Button,{size:"small",type:"text",children:f==null?void 0:f.icon})})}),S.jsx(Y.Divider,{type:"vertical",style:{margin:"0 2px"}}),S.jsx(Y.Dropdown,{trigger:["click"],placement:"bottom",menu:{items:l.map(d=>({...d,onClick:()=>{o({chartType:u,yAxisPos:d.key})}}))},children:S.jsx(Y.Tooltip,{title:h==null?void 0:h.label,children:S.jsx(Y.Button,{size:"small",type:"text",children:h==null?void 0:h.icon})})})]})};m8.displayName="CombinationChartOptionPicker";const a_="group-field-config-picker",y8=[],b8=t=>{const{style:e,className:r,options:n=y8}=t,[i=y8,a]=lo(t),o=Mt(l=>{let u=(i??[]).find(c=>c.value===l);return u?u.config:void 0}),s=Mt((l,u)=>{let c=[...i??[]],f=c.find(h=>h.value===l);f?f.config=u:c.push({value:l,config:u}),a(c)});return P.useEffect(()=>{if((n==null?void 0:n.length)>0){let l=n.map(u=>({value:u,config:{chartType:Fr.ChartBar,yAxisPos:"left",...o(u)??{}}}));a(l)}},[n]),P.useMemo(()=>S.jsx("div",{className:cn(r,tp[`${a_}`]),style:e,children:S.jsx("div",{children:((t==null?void 0:t.options)??[]).map(l=>{let u=`${l}`;const c=o(l);return S.jsxs("div",{className:cn(tp[`${a_}__item`]),children:[S.jsx(Y.Tooltip,{title:u,children:S.jsx("div",{className:cn(tp[`${a_}__input`]),children:S.jsx(fi,{value:u,disabled:!0,style:{width:200,pointerEvents:"none"}})})}),S.jsx(m8,{value:c,onChange:f=>{s(l,f)}})]},u)})})}),[i,n])};b8.displayName="GroupFieldConfigPicker";const use=()=>S.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S.jsx("rect",{x:"17",y:"8",width:"6",height:"15.5",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"17",y:"24.5",width:"6",height:"15.5",rx:"0.5",fill:"#5b65f5"}),S.jsx("rect",{x:"28",y:"8",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"28",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"}),S.jsx("rect",{x:"39",y:"8",width:"6",height:"19",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"39",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),S.jsx("rect",{x:"50",y:"8",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"50",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"})]}),cse=()=>S.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S.jsx("rect",{x:"17",y:"21",width:"6",height:"6",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"17",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),S.jsx("rect",{x:"28",y:"24",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"28",y:"34",width:"6",height:"6",rx:"0.5",fill:"#5b65f5"}),S.jsx("rect",{x:"39",y:"8",width:"6",height:"19",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"39",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),S.jsx("rect",{x:"50",y:"18",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),S.jsx("rect",{x:"50",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"})]}),fse=()=>S.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S.jsx("path",{d:"M15.5 33.5C20.2023 32.3804 23.5007 28.5533 25.7095 24.6682C28.3082 20.0974 34.0857 17.3668 38.758 19.7783L39.8066 20.3195C42.9001 21.9162 46.671 21.329 49.1326 18.8674L58 10",stroke:"#959bee",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),S.jsx("path",{d:"M16.5 15L26.844 27.6427C28.7759 30.0039 31.8825 31.0607 34.8535 30.3675L42.3359 28.6216C44.0629 28.2187 45.8748 28.401 47.4869 29.1398L57 33.5",stroke:"#5b65f4",strokeWidth:"1.5",strokeLinecap:"round"})]}),dse=()=>S.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S.jsx("path",{d:"M20 24C20 32.8366 27.1634 40 36 40C44.8366 40 52 32.8366 52 24C52 15.1634 44.8366 8 36 8C27.1634 8 20 15.1634 20 24ZM46.3944 24C46.3944 29.7407 41.7407 34.3944 36 34.3944C30.2593 34.3944 25.6056 29.7407 25.6056 24C25.6056 18.2593 30.2593 13.6056 36 13.6056C41.7407 13.6056 46.3944 18.2593 46.3944 24Z",fill:"#5b65f4"}),S.jsx("path",{d:"M52 24C52 19.7565 50.3143 15.6869 47.3137 12.6863C44.3131 9.68571 40.2435 8 36 8V13.6056C38.7568 13.6056 41.4006 14.7007 43.35 16.65C45.2993 18.5994 46.3944 21.2432 46.3944 24H52Z",fill:"#959bee"}),S.jsx("path",{d:"M52 24C52 20.9896 51.1507 18.0403 49.5497 15.4909L44.8026 18.4721C45.8427 20.1283 46.3944 22.0443 46.3944 24H52Z",fill:"#cdcff9"})]}),hse=()=>S.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S.jsx("rect",{x:"58",y:"11",width:"4",height:"15",rx:"0.5",transform:"rotate(90 58 11)",fill:"#959bee"}),S.jsx("rect",{x:"42",y:"11",width:"4",height:"28",rx:"0.5",transform:"rotate(90 42 11)",fill:"#5b65f5"}),S.jsx("rect",{x:"58",y:"18",width:"4",height:"21.5",rx:"0.5",transform:"rotate(90 58 18)",fill:"#959bee"}),S.jsx("rect",{x:"35.5",y:"18",width:"4",height:"21.5",rx:"0.5",transform:"rotate(90 35.5 18)",fill:"#5b65f5"}),S.jsx("rect",{x:"58",y:"25",width:"4",height:"34",rx:"0.5",transform:"rotate(90 58 25)",fill:"#959bee"}),S.jsx("rect",{x:"23",y:"25",width:"4",height:"9",rx:"0.5",transform:"rotate(90 23 25)",fill:"#5b65f5"}),S.jsx("rect",{x:"58",y:"32",width:"4",height:"17",rx:"0.5",transform:"rotate(90 58 32)",fill:"#959bee"}),S.jsx("rect",{x:"40",y:"32",width:"4",height:"26",rx:"0.5",transform:"rotate(90 40 32)",fill:"#5b65f5"})]}),vse=()=>S.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S.jsx("rect",{x:"40",y:"11",width:"4",height:"15",rx:"0.5",transform:"rotate(90 40 11)",fill:"#959bee"}),S.jsx("rect",{x:"24",y:"11",width:"4",height:"8",rx:"0.5",transform:"rotate(90 24 11)",fill:"#5b65f5"}),S.jsx("rect",{x:"48",y:"18",width:"4",height:"15.5",rx:"0.5",transform:"rotate(90 48 18)",fill:"#959bee"}),S.jsx("rect",{x:"31.5",y:"18",width:"4",height:"15.5",rx:"0.5",transform:"rotate(90 31.5 18)",fill:"#5b65f5"}),S.jsx("rect",{x:"60",y:"25",width:"4",height:"34",rx:"0.5",transform:"rotate(90 60 25)",fill:"#959bee"}),S.jsx("rect",{x:"25",y:"25",width:"4",height:"9",rx:"0.5",transform:"rotate(90 25 25)",fill:"#5b65f5"}),S.jsx("rect",{x:"43",y:"32",width:"4",height:"13",rx:"0.5",transform:"rotate(90 43 32)",fill:"#959bee"}),S.jsx("rect",{x:"29",y:"32",width:"4",height:"13",rx:"0.5",transform:"rotate(90 29 32)",fill:"#5b65f5"})]}),pse=()=>{const{t,i18n:e}=Rt();return P.useMemo(()=>[{label:t("chart.t2"),value:"chart-bar",icon:S.jsx(LS,{})},{label:t("chart.t3"),value:"chart-bar-pile",icon:S.jsx(cse,{})},{label:t("chart.t4"),value:"chart-bar-percentage",icon:S.jsx(use,{})},{label:t("chart.t5"),value:"chart-strip-bar",icon:S.jsx(zS,{})},{label:t("chart.t6"),value:"chart-strip-bar-pile",icon:S.jsx(vse,{})},{label:t("chart.t7"),value:"chart-strip-bar-percentage",icon:S.jsx(hse,{})},{label:t("chart.t8"),value:"chart-line",icon:S.jsx(kS,{})},{label:t("chart.t9"),value:"chart-line-smooth",icon:S.jsx(fse,{})},{label:t("chart.t10"),value:"chart-pie",icon:S.jsx(jS,{})},{label:t("chart.t11"),value:"chart-pie-circular",icon:S.jsx(dse,{})},{label:t("chart._t12"),value:Fr.chartCombination,icon:S.jsx(FS,{})}],[e.language])},gse=()=>{const{t,i18n:e}=Rt();return P.useMemo(()=>[{label:t("chart.t40"),value:"day"},{label:t("chart.t41"),value:"week"},{label:t("chart.t42"),value:"month"},{label:t("chart.t43"),value:"year"}],[e.language])},mse=()=>{const{t,i18n:e}=Rt();return P.useMemo(()=>[{label:t("displayRange.all","ALL"),value:li.ALL},{label:t("displayRange.top5","TOP5"),value:li.TOP5},{label:t("displayRange.top10","TOP10"),value:li.TOP10},{label:t("displayRange.top20","TOP20"),value:li.TOP20},{label:t("displayRange.top30","TOP30"),value:li.TOP30},{label:t("displayRange.bottom5","BOTTOM5"),value:li.BOTTOM5},{label:t("displayRange.bottom10","BOTTOM10"),value:li.BOTTOM10},{label:t("displayRange.bottom20","BOTTOM20"),value:li.BOTTOM20},{label:t("displayRange.bottom30","BOTTOM30"),value:li.BOTTOM30}],[e.language])},yse={"chart-modal":"_chart-modal_10ivt_1"},bse="chart-modal",_se=({selectModuleData:t,onAllValuesChange:e,enumDataApi:r})=>{const{globalData:n}=pr(),{t:i}=Rt(),a=P.useRef(null),o=pse(),s=gse(),l=mse(),u={dataSourceId:"",yAxis:"recordTotal",chartOptions:["legend","label","axis","splitLine"],sortField:"xAxis",sortOrder:"asc",timeGroupInterval:"day",displayRange:"ALL",yAxisFieldConfig:{chartType:Fr.ChartBar,yAxisPos:"left"}},[c]=Y.Form.useForm(),f=Y.Form.useWatch("type",c),h=Y.Form.useWatch("dataSourceId",c),d=Y.Form.useWatch("isGroup",c),p=Y.Form.useWatch("xAxis",c),g=Y.Form.useWatch("yAxisField",c),v=Y.Form.useWatch("groupField",c),m=Mt(L=>{var K,ee;return((ee=(K=n==null?void 0:n.sourceData)==null?void 0:K.find(te=>te.value===L))==null?void 0:ee.fields)??[]}),y=Mt(L=>{var te,j;const q=[{value:"recordTotal",label:i("statisticstRecordNum")},{value:"fieldValue",label:i("statisticstFieldVal")}],K=(te=n==null?void 0:n.sourceData)==null?void 0:te.find(J=>J.value===L),ee=(j=K==null?void 0:K.chart_config)==null?void 0:j.allowed_y_axis_options;return ee&&ee.length>0?q.filter(J=>ee.includes(J.value)):q}),{fieldOptions:b,xAxisFieldOption:C,yAxisFieldOption:w,groupFieldOption:_}=P.useMemo(()=>{const L=m(h),q=L.filter(te=>![g,v].includes(te.value)),K=L.filter(te=>{let j=te.type==="int"||te.type==="float",J=[p,v].includes(te.value);return j&&!J}),ee=L.filter(te=>![p,g].includes(te.value));return{fieldOptions:L,xAxisFieldOption:q,yAxisFieldOption:K,groupFieldOption:ee}},[h,p,g,v]),x=Mt(L=>{var q;return((q=b.find(K=>K.value===L))==null?void 0:q.type)==="timestamp"}),[D,E]=P.useState(!1),T=P.useRef(),[A,O]=P.useState({conditionList:[],conditionType:"all"}),[R,B]=P.useState(0),I=L=>{var q;O(L),T.current=L,B(((q=L==null?void 0:L.conditionList)==null?void 0:q.length)||0)},{service:N}=pr(),{data:k,loading:z}=A6(async()=>{var L,q,K;if(d&&f===Fr.chartCombination&&v){const ee=v==="tags"?"tag":v;let te=`select=${ee}`;if(((L=A==null?void 0:A.conditionList)==null?void 0:L.length)>0){let W=Ad(A);te+=W?`&${W}`:""}let j=await((q=N==null?void 0:N.moduleDataApi)==null?void 0:q.call(N,{id:h,query:te})),J=(K=j==null?void 0:j.data)==null?void 0:K.map(W=>Bu({fieldOptions:b,val:W[ee],field:ee,fieldMap:n==null?void 0:n.fieldMap}));return[...new Set(J)]}else return[]},{refreshDeps:[f,d,v,A,h]}),{run:V}=Wg(Mt(()=>{e==null||e({...u,...c.getFieldsValue(),conditionData:T.current})}),{wait:100}),F=Mt((L,q)=>{var K,ee,te,j;if(L.dataSourceId){const J=m(L.dataSourceId),W=y(L.dataSourceId),U=W.length===1&&W[0].value==="fieldValue"?"fieldValue":"recordTotal",Q=J.filter(Z=>Z.type==="int"||Z.type==="float");c.setFieldsValue({xAxis:(K=J==null?void 0:J[0])==null?void 0:K.value,yAxis:U,yAxisField:U==="fieldValue"?(ee=Q==null?void 0:Q[0])==null?void 0:ee.value:"",yAxisFieldType:U==="fieldValue"?"sum":void 0,isGroup:!1,groupField:void 0}),I({conditionList:[],conditionType:"all"})}if(L.xAxis&&c.setFieldsValue(x(L.xAxis)?{timeGroupInterval:u==null?void 0:u.timeGroupInterval}:{displayRange:u==null?void 0:u.displayRange}),L.yAxis){let J=L.yAxis;c.setFieldsValue({yAxisField:J==="fieldValue"?(te=w==null?void 0:w[0])==null?void 0:te.value:"",yAxisFieldType:"sum"})}L.isGroup&&c.setFieldsValue({groupField:(j=_==null?void 0:_[0])==null?void 0:j.value}),V()});return P.useEffect(()=>{var L,q,K;if(t!=null&&t.customData){const ee=t.customData;c.setFieldsValue(ee)}else{const ee=(L=n==null?void 0:n.sourceData)==null?void 0:L[0],te=m(ee==null?void 0:ee.value)||[];c.setFieldsValue({...u,dataSourceId:ee==null?void 0:ee.value,type:t==null?void 0:t.type,xAxis:(q=te==null?void 0:te[0])==null?void 0:q.value})}I((K=t==null?void 0:t.customData)==null?void 0:K.conditionData),V()},[t,n]),S.jsxs("div",{style:{height:"50vh",overflowX:"auto"},className:cn(yse[`${bse}`]),ref:a,children:[S.jsxs(Y.Form,{form:c,name:"customData",layout:"vertical",onValuesChange:F,initialValues:u,children:[S.jsx(Y.Form.Item,{label:i("dataSource"),name:"dataSourceId",children:S.jsx(Y.Select,{options:(n==null?void 0:n.sourceData)??[],getPopupContainer:L=>L.parentElement||document.body})}),S.jsxs(Y.Form.Item,{label:i("dataRange"),children:[S.jsx(Y.Button,{style:{marginLeft:"-15px"},onClick:()=>{E(!0)},type:"link",children:i("filterData")}),R>0?`${i("selectNcondition",{n:R})}`:null]}),S.jsx(Y.Form.Item,{label:i("chart.t1"),name:"type",children:S.jsx(Y.Select,{options:o,getPopupContainer:L=>L.parentElement||document.body,optionRender:L=>S.jsxs(Y.Flex,{align:"center",children:[S.jsx("span",{role:"img",style:{marginTop:"5px"},"aria-label":L.data.label,children:L.data.icon}),L.data.label]})})}),S.jsx(Y.Form.Item,{name:"chartOptions",label:i("chart.t12"),children:S.jsxs(Y.Checkbox.Group,{children:[S.jsx(Y.Checkbox,{value:"legend",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t13")}),S.jsx(Y.Checkbox,{value:"label",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t14")}),["chart-pie","chart-pie-circular"].includes(f)?null:S.jsxs(S.Fragment,{children:[S.jsx(Y.Checkbox,{value:"axis",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t15")}),S.jsx(Y.Checkbox,{value:"splitLine",className:"ow-checkbox",style:{lineHeight:"32px"},children:i("chart.t16")})]})]})}),S.jsx(Y.Divider,{style:{borderColor:"#e2e2e2",marginTop:0}}),S.jsx(Y.Form.Item,{label:f!=null&&f.includes("pie")?i("chart.t17"):i("chart.t18"),name:"xAxis",children:S.jsx(Y.Select,{options:C,getPopupContainer:L=>L.parentElement||document.body})}),S.jsx(Y.Form.Item,{noStyle:!0,dependencies:["type","xAxis"],children:({getFieldValue:L})=>x(L("xAxis"))?S.jsx(S.Fragment,{children:S.jsx(Y.Form.Item,{name:"timeGroupInterval",label:i("chart.t39"),children:S.jsx(Y.Select,{options:s,getPopupContainer:q=>q.parentElement||document.body})})}):S.jsx(S.Fragment,{children:S.jsx(Y.Form.Item,{name:"displayRange",label:i("displayRange.title"),children:S.jsx(Y.Select,{options:l,getPopupContainer:q=>q.parentElement||document.body})})})}),S.jsx(Y.Form.Item,{dependencies:["type"],noStyle:!0,children:({getFieldValue:L})=>{var q;return(q=L("type"))!=null&&q.includes("pie")?null:S.jsxs(S.Fragment,{children:[S.jsx(Y.Form.Item,{name:"sortField",label:i("chart.t31"),children:S.jsxs(Y.Radio.Group,{children:[S.jsx(Y.Radio,{value:"xAxis",children:i("chart.t32")}),S.jsx(Y.Radio,{value:"yAxisField",children:i("chart.t33")}),S.jsx(Y.Radio,{value:"recordValue",children:i("chart.t34")})]})}),S.jsx(Y.Form.Item,{name:"sortOrder",label:i("chart.t35"),children:S.jsxs(Y.Radio.Group,{children:[S.jsx(Y.Radio,{value:"asc",children:i("chart.t36")}),S.jsx(Y.Radio,{value:"desc",children:i("chart.t37")})]})})]})}}),S.jsx(Y.Form.Item,{label:f!=null&&f.includes("pie")?i("chart.t19"):i("chart.t20"),name:"yAxis",children:S.jsx(Y.Select,{options:y(h),getPopupContainer:L=>L.parentElement||document.body})}),S.jsx(Y.Form.Item,{dependencies:["yAxis","type","isGroup"],noStyle:!0,children:({getFieldValue:L})=>L("yAxis")==="fieldValue"?S.jsx(Y.Form.Item,{label:i("selectField"),children:S.jsx("div",{style:{display:"flex",justifyContent:"space-between"},children:S.jsxs(Y.Space.Compact,{children:[S.jsx(Y.Form.Item,{noStyle:!0,name:"yAxisField",children:S.jsx(Y.Select,{style:{width:"100px"},options:w,dropdownStyle:{width:250},getPopupContainer:q=>q.parentElement||document.body})}),S.jsx(Y.Form.Item,{name:"yAxisFieldType",noStyle:!0,children:S.jsx(Y.Select,{style:{width:"100px"},dropdownStyle:{width:136},getPopupContainer:q=>q.parentElement||document.body,options:[{value:"sum",label:i("sumVal")},{value:"max",label:i("maxVal")},{value:"min",label:i("minVal")},{value:"avg",label:i("averageVal")}]})})]})})}):null}),S.jsx(Y.Form.Item,{dependencies:["type","isGroup"],noStyle:!0,children:({getFieldValue:L})=>{var q;return(q=L("type"))!=null&&q.includes("pie")?null:S.jsxs(S.Fragment,{children:[S.jsx(Y.Form.Item,{name:"isGroup",valuePropName:"checked",noStyle:!0,children:S.jsx(Y.Checkbox,{style:{marginBottom:"5px"},children:i("chart.t38")})}),S.jsx(Y.Form.Item,{dependencies:["isGroup"],noStyle:!0,children:({getFieldValue:K})=>K("isGroup")?S.jsx(Y.Form.Item,{name:"groupField",children:S.jsx(Y.Select,{options:_,getPopupContainer:ee=>ee.parentElement||document.body})}):null}),S.jsx(Y.Spin,{spinning:z,children:S.jsx(Y.Form.Item,{name:"groupFieldConfig",label:i("chart.groupFieldConfig"),hidden:!(L("type")===Fr.chartCombination&&L("isGroup")),children:S.jsx(b8,{options:k})})})]})}})]}),S.jsx(a0,{open:D,value:A,fieldOptions:b,enumDataApi:r,onClose:()=>{E(!1)},onOk:L=>{I(L),V()}})]})},Cse=({customData:t,selectModuleData:e,onAllValuesChange:r})=>{var s,l,u;const[n]=Y.Form.useForm(),{t:i}=Rt(),a={xtitle:"",ytitle:""},o=()=>{setTimeout(()=>{r==null||r(n.getFieldsValue())})};return P.useEffect(()=>{e!=null&&e.customeStyle?n.setFieldsValue(e.customeStyle):n.setFieldsValue(a)},[e]),(s=t==null?void 0:t.type)!=null&&s.includes("pie")?S.jsx("div",{style:{height:"50vh",overflowX:"auto"}}):S.jsx("div",{style:{height:"50vh",overflowX:"auto"},children:S.jsxs(Y.Form,{form:n,name:"customeStyle",layout:"vertical",initialValues:a,children:[S.jsx(Y.Divider,{orientation:"left",orientationMargin:"0",children:i("chart.t21")}),(l=t==null?void 0:t.type)!=null&&l.includes("pie")?null:S.jsx(Y.Form.Item,{label:i("chart.t22"),name:"xtitle",children:S.jsx(fi,{onChange:()=>{o()}})}),S.jsx(Y.Divider,{orientation:"left",orientationMargin:"0",children:i("chart.t26")}),(u=t==null?void 0:t.type)!=null&&u.includes("pie")?null:S.jsx(Y.Form.Item,{label:i("chart.t27"),name:"ytitle",children:S.jsx(fi,{onChange:()=>{o()}})})]})})},wse=({open:t,onClose:e,onOk:r,moduleDataApi:n,selectModuleData:i,enumDataApi:a})=>{var m;const{t:o}=Rt(),{globalData:s}=pr(),[l,u]=P.useState(),[c,f]=P.useState();P.useRef(null);const h=(m=l==null?void 0:l.type)==null?void 0:m.includes("pie"),d=P.useRef(!1);P.useEffect(()=>{i&&(u(i==null?void 0:i.customData),f(i==null?void 0:i.customeStyle))},[i]);const[p,g]=P.useState("");P.useEffect(()=>{t&&(d.current=!!(i!=null&&i.title),g(i!=null&&i.title?i==null?void 0:i.title:o("chartText")))},[t]);const v=()=>{var x,D,E;if(!(l!=null&&l.dataSourceId))return;const y=(x=s==null?void 0:s.sourceData)==null?void 0:x.find(T=>T.value===l.dataSourceId);if(!(y!=null&&y.label))return;let b="Count";if(l.yAxis==="fieldValue"&&l.yAxisField){const T=(D=y.fields)==null?void 0:D.find(R=>R.value===l.yAxisField),O={sum:"Sum",max:"Max",min:"Min",avg:"Avg"}[l.yAxisFieldType]||"";b=T!=null&&T.label?`${O} ${T.label}`.trim():O}const C=(E=y.fields)==null?void 0:E.find(T=>T.value===l.xAxis),w=(C==null?void 0:C.label)||"";let _=`${y.label} ${b}`;w&&(_+=` by ${w}`),g(_)};return P.useEffect(()=>{d.current||v()},[l==null?void 0:l.dataSourceId,l==null?void 0:l.xAxis,l==null?void 0:l.yAxis,l==null?void 0:l.yAxisField,l==null?void 0:l.yAxisFieldType]),S.jsx(S.Fragment,{children:S.jsx(Y.Modal,{width:"65%",title:S.jsx(Qf,{value:p,onChange:y=>{d.current=!0,g(y)}}),footer:null,open:t,onCancel:e,destroyOnClose:!0,closeIcon:S.jsx(df,{}),className:"ow-modal ow-modal-2",children:S.jsxs("div",{className:"config-widget-dialog-container",children:[S.jsx("div",{className:"config-widget-dialog-content",children:S.jsx("div",{className:"config-widget-dialog-preview",children:S.jsx(p8,{customData:l,customeStyle:c,moduleDataApi:n})})}),S.jsxs("div",{className:"config-widget-dialog-panel",children:[S.jsx("div",{className:"bitable-dashboard edit-panel-container",children:S.jsx(Y.Tabs,{defaultActiveKey:"1",items:[{key:"1",label:o("typeData"),children:S.jsx(_se,{enumDataApi:a,selectModuleData:i,onAllValuesChange:y=>{u(y)}})},...h?[]:[{key:"2",label:o("customStyle"),children:S.jsx(Cse,{customData:l,selectModuleData:i,onAllValuesChange:y=>{f(y)}})}]]})}),S.jsx("div",{className:"button-container",children:S.jsx(Y.Button,{type:"primary",onClick:()=>{r==null||r({id:i==null?void 0:i.id,type:i==null?void 0:i.type,customData:l,customeStyle:c,title:p})},children:o("confirm")})})]})]})})})};function o_(t,e){const{ranges:r,step:n}=e;let i=null,a=null;for(let o=0;o<r.length-1;o++){const[s,l]=r[o],[u,c]=r[o+1];if(t>=s&&t<=u){i=[s,l],a=[u,c];break}}if(t<r[0][0]&&(i=r[0],a=r[1]),t>r[r.length-1][0]&&(i=r[r.length-2],a=r[r.length-1]),i&&a){let[o,s]=i,[l,u]=a;const c=(u-s)/(l-o),f=s-c*o,h=c*t+f;return Math.round(h/n)*n}if(i||a){let o=i||a,[s,l]=o;const u=l*t/s;return Math.round(u/n)*n}throw new Error("Unexpected error in range calculation")}function xse(t,e=0){if(!Number.isFinite(t))throw new Error("Value must be a finite number.");return new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:e,maximumFractionDigits:e}).format(t)}function s_(t,e=0){if(!Number.isFinite(t))return"";const r=new Intl.NumberFormat(void 0,{minimumFractionDigits:0,maximumFractionDigits:e}).format(t),[n,i]=r.split("."),a=(i||"").padEnd(e,"0");return`${n}${e>0?".":""}${a}`}const Sse=({moduleDataApi:t,customData:e,customeStyle:r})=>{const[n,i]=P.useState(),[a,o]=P.useState(!1),{globalFilterCondition:s}=pr();let l=P.useMemo(()=>s==null?void 0:s.find(m=>(m==null?void 0:m.dataSourceId)===(e==null?void 0:e.dataSourceId)),[s,e==null?void 0:e.dataSourceId]);const u=Mt(async()=>{var v,m,y;if(e){let b="";o(!0),e.statisticalMethod==="fieldValue"&&e.field?b+=`select=${e.field}.${e==null?void 0:e.statisticalType}()`:e.statisticalMethod==="recordTotal"&&(b+="select=id.count()");let C=[];if((((v=l==null?void 0:l.conditionList)==null?void 0:v.length)??0)>0&&C.push(l),(((y=(m=e==null?void 0:e.conditionData)==null?void 0:m.conditionList)==null?void 0:y.length)??0)>0&&C.push(e==null?void 0:e.conditionData),C.length>0){let w=Ad(C);b+=w?`&${w}`:""}e!=null&&e.dataSourceId&&(t==null||t({id:e==null?void 0:e.dataSourceId,query:b}).then(w=>{if(!w.success){Y.message.error(w.message);return}i(w.data)}).finally(()=>{o(!1)}))}else i([])});P.useEffect(()=>{e&&u()},[e==null?void 0:e.conditionData,e==null?void 0:e.statisticalMethod,e==null?void 0:e.statisticalType,e==null?void 0:e.field,e==null?void 0:e.dataSourceId,l]);const{formatCurrency:c}=pr(),f=Mt(c),h=P.useMemo(()=>{var w,_,x,D,E;if(!n)return"";const v=n,{statisticalMethod:m,statisticalType:y,field:b}=e||{};let C=0;if(v.length&&m==="fieldValue"&&b)switch(y){case"sum":C=((w=v==null?void 0:v[0])==null?void 0:w.sum)||0;break;case"max":C=((_=v==null?void 0:v[0])==null?void 0:_.max)||0;break;case"min":C=((x=v==null?void 0:v[0])==null?void 0:x.min)||0;break;case"avg":C=((D=v==null?void 0:v[0])==null?void 0:D.avg)||0;break;default:C=0}else m==="recordTotal"&&(C=((E=v==null?void 0:v[0])==null?void 0:E.count)||0);if(r!=null&&r.unit){const{unit:T,precision:A}=r;switch(`${T}`){case"4":case"5":case"6":case"7":case"8":case"9":C=(f==null?void 0:f(C,A))??C;break;case"1":C=s_(C,A);break;case"3":C=xse(C,A);break;default:C=s_(C,A)}}else C=s_(C,r==null?void 0:r.precision);return C},[n,e,r]),d=P.useRef(),p=$g(d),g=P.useMemo(()=>{if(!p)return null;let v=0,m=32,y=0,b=0;v=o_(p.width,{ranges:[[116,16],[760,56]],step:4}),v=Math.max(16,Math.min(72,v));let C=p.width-v*2,w=p.height-m*2;{y=o_(C,{ranges:[[400,60],[500,64]],step:.1});const _=16,x=Math.min(72,w/2);y=Math.max(_,Math.min(x,y))}{b=o_(w,{ranges:[[140,12],[500,24],[860,36]],step:.1});const _=12,x=Math.min(36,w/2);b=Math.max(_,Math.min(x,b))}return{PX:v,PY:m,fontSize:y,subFontSize:b}},[p]);return S.jsxs("div",{ref:d,style:{display:"flex",height:"100%",width:"100%"},children:[a?S.jsx(Y.Spin,{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",background:"rgba(255,255,255,0.6)",top:0,left:0,right:0,bottom:0,zIndex:1e3},spinning:a}):null,S.jsxs("div",{style:{overflow:"hidden",position:"relative",flex:1,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",padding:`${g==null?void 0:g.PY}px ${g==null?void 0:g.PX}px`},children:[h!==""&&S.jsx("div",{style:{width:"100%",position:"relative",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:"center"},children:S.jsx("span",{style:{fontWeight:"bold",lineHeight:`${g==null?void 0:g.fontSize}px`,fontSize:`${g==null?void 0:g.fontSize}px`,color:r==null?void 0:r.color},children:h})}),(r==null?void 0:r.desc)!==""&&S.jsx("div",{style:{width:"100%",position:"relative",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:"center"},children:S.jsx("span",{style:{fontSize:`${g==null?void 0:g.subFontSize}px`,lineHeight:`${g==null?void 0:g.subFontSize}px`,color:r==null?void 0:r.color,textAlign:"center"},children:r==null?void 0:r.desc})})]})]})},_8=P.memo(Sse),Dse=({selectModuleData:t,onAllValuesChange:e,enumDataApi:r})=>{const{globalData:n}=pr(),{t:i}=Rt(),[a,o]=P.useState(),[s,l]=P.useState(),u=_=>{var D,E;const x=(E=(D=n==null?void 0:n.sourceData)==null?void 0:D.find(T=>T.value===_))==null?void 0:E.fields;o(x),l(x==null?void 0:x.filter(T=>T.type==="int"||T.type==="float"))},c=_=>{var T,A;const x=[{value:"recordTotal",label:i("statisticstRecordNum")},{value:"fieldValue",label:i("statisticstFieldVal")}],D=(T=n==null?void 0:n.sourceData)==null?void 0:T.find(O=>O.value===_),E=(A=D==null?void 0:D.chart_config)==null?void 0:A.allowed_y_axis_options;return E&&E.length>0?x.filter(O=>E.includes(O.value)):x},[f]=Y.Form.useForm(),h={dataSourceId:"",statisticalMethod:"recordTotal",field:""},d=()=>{setTimeout(()=>{e==null||e({...f.getFieldsValue(),conditionData:v.current})})},[p,g]=P.useState(!1),v=P.useRef(),[m,y]=P.useState({conditionList:[],conditionType:"all"}),[b,C]=P.useState(0),w=_=>{var x;y(_),v.current=_,C(((x=_==null?void 0:_.conditionList)==null?void 0:x.length)||0)};return P.useEffect(()=>{var _,x;if(t!=null&&t.customData){const D=t.customData;f.setFieldsValue(D),u(D==null?void 0:D.dataSourceId)}else{const D=(_=n==null?void 0:n.sourceData)==null?void 0:_[0];f.setFieldsValue({...h,dataSourceId:D==null?void 0:D.value}),u(D==null?void 0:D.value),d()}w((x=t==null?void 0:t.customData)==null?void 0:x.conditionData)},[t,n]),S.jsxs(S.Fragment,{children:[S.jsxs(Y.Form,{form:f,name:"customData",layout:"vertical",initialValues:h,children:[S.jsx(Y.Form.Item,{label:i("dataSource"),name:"dataSourceId",children:S.jsx(Y.Select,{options:n==null?void 0:n.sourceData,onChange:_=>{var A,O,R;const x=c(_),D=x.length===1&&x[0].value==="fieldValue"?"fieldValue":"recordTotal";u(_);const E=(O=(A=n==null?void 0:n.sourceData)==null?void 0:A.find(B=>B.value===_))==null?void 0:O.fields,T=E==null?void 0:E.filter(B=>B.type==="int"||B.type==="float");f.setFieldsValue({statisticalMethod:D,field:D==="fieldValue"?(R=T==null?void 0:T[0])==null?void 0:R.value:"",statisticalType:D==="fieldValue"?"sum":void 0}),d(),w({conditionList:[],conditionType:"all"})}})}),S.jsxs(Y.Form.Item,{label:i("dataRange"),children:[S.jsx(Y.Button,{style:{marginLeft:"-15px"},onClick:()=>{g(!0)},type:"link",children:i("filterData")}),b>0?`${i("selectNcondition",{n:b})}`:null]}),S.jsx(Y.Divider,{style:{borderColor:"#e2e2e2",marginTop:0}}),S.jsx(Y.Form.Item,{label:i("statisticstMethods"),name:"statisticalMethod",children:S.jsx(Y.Select,{onChange:_=>{f.setFieldsValue({field:_==="fieldValue"?s==null?void 0:s[0].value:"",statisticalType:"sum"}),d()},options:c(f.getFieldValue("dataSourceId"))})}),S.jsx(Y.Form.Item,{dependencies:["statisticalMethod"],children:({getFieldValue:_})=>_("statisticalMethod")==="fieldValue"?S.jsx(Y.Form.Item,{label:i("selectField"),children:S.jsxs(Y.Space.Compact,{children:[S.jsx(Y.Form.Item,{noStyle:!0,name:"field",children:S.jsx(Y.Select,{style:{width:"100px"},dropdownStyle:{width:250},onChange:()=>{d()},options:s})}),S.jsx(Y.Form.Item,{name:"statisticalType",noStyle:!0,children:S.jsx(Y.Select,{style:{width:"100px"},dropdownStyle:{width:180},onChange:()=>{d()},options:[{value:"sum",label:i("sumVal")},{value:"max",label:i("maxVal")},{value:"min",label:i("minVal")},{value:"avg",label:i("averageVal")}]})})]})}):null})]}),S.jsx(a0,{open:p,value:m,fieldOptions:a,enumDataApi:r,onClose:()=>{g(!1)},onOk:_=>{w(_),d()}})]})},Ese=({value:t,onChange:e})=>{const[r,n]=P.useState(),i=["#373c43","#3370ff","#4954e6","#34c724","#14c0ff","#ffc60a","#f80","#f76964"];return P.useEffect(()=>{n(t)},[t]),S.jsx("div",{className:"pane-item-body item-body-column",children:S.jsx("div",{className:"panel-single-color-selector",children:i.map((a,o)=>S.jsxs("div",{className:"panel-single-color-selector-color-item",onClick:()=>{n(a),e==null||e(a)},children:[S.jsx("div",{className:"panel-single-color-selector-color-item-background",style:{background:a}}),r===a?S.jsx("span",{className:"panel-icon",children:S.jsx(RC,{})}):null]},o))})})},Ase=({selectModuleData:t,onAllValuesChange:e})=>{const[r]=Y.Form.useForm(),{t:n,i18n:i}=Rt(),a=P.useMemo(()=>[{value:"1",label:n("statistics.t5")},{value:"2",label:n("statistics.t6")},{value:"3",label:n("statistics.t7")},{value:"9",label:n("statistics.currency")}],[i.language]),o={color:"#373c43",unit:"1",precision:"",desc:""},s=()=>{setTimeout(()=>{e==null||e(r.getFieldsValue())})};return P.useEffect(()=>{if(t!=null&&t.customeStyle){`${t.customeStyle.unit??o.unit}`;let l={...o,...t.customeStyle,unit:`${t.customeStyle.unit??o.unit}`};r.setFieldsValue(l)}else r.setFieldsValue(o)},[t]),S.jsxs(Y.Form,{form:r,name:"customeStyle",layout:"vertical",initialValues:o,children:[S.jsx(Y.Form.Item,{label:n("statistics.t1"),name:"color",children:S.jsx(Ese,{onChange:()=>{s()}})}),S.jsx(Y.Form.Item,{label:n("statistics.t2"),extra:n("statistics.t3"),children:S.jsxs(Y.Space.Compact,{children:[S.jsx(Y.Form.Item,{name:"precision",noStyle:!0,children:S.jsx(Y.InputNumber,{min:1,max:10,style:{width:"60%"},placeholder:n("statistics.t4"),onChange:()=>{s()}})}),S.jsx(Y.Form.Item,{name:"unit",noStyle:!0,children:S.jsx(Y.Select,{onChange:()=>{s()},dropdownStyle:{width:240},children:a.map(l=>{const{value:u,label:c}=l;return S.jsx(Y.Select.Option,{value:u,children:c},u)})})})]})}),S.jsx(Y.Form.Item,{label:n("statistics.t10"),name:"desc",children:S.jsx(fi,{onChange:()=>{s()}})})]})},Tse=({open:t,onClose:e,onOk:r,moduleDataApi:n,selectModuleData:i,enumDataApi:a})=>{const{t:o}=Rt(),{globalData:s}=pr(),[l,u]=P.useState(),[c,f]=P.useState(),h=P.useRef(!1);P.useEffect(()=>{i&&(u(i==null?void 0:i.customData),f(i==null?void 0:i.customeStyle))},[i]);const[d,p]=P.useState("");P.useEffect(()=>{t&&(h.current=!!(i!=null&&i.title),p(i!=null&&i.title?i==null?void 0:i.title:o("statisticsText")))},[t]);const g=()=>{var y,b;if(!(l!=null&&l.dataSourceId))return;const v=(y=s==null?void 0:s.sourceData)==null?void 0:y.find(C=>C.value===l.dataSourceId);if(!(v!=null&&v.label))return;let m="Count";if(l.statisticalMethod==="fieldValue"&&l.field){const C=(b=v.fields)==null?void 0:b.find(x=>x.value===l.field),_={sum:"Sum",max:"Max",min:"Min",avg:"Avg"}[l.statisticalType||""]||"";m=C!=null&&C.label?`${_} ${C.label}`.trim():_}p(`${v.label} ${m}`)};return P.useEffect(()=>{h.current||g()},[l==null?void 0:l.dataSourceId,l==null?void 0:l.statisticalMethod,l==null?void 0:l.statisticalType,l==null?void 0:l.field]),S.jsx(S.Fragment,{children:S.jsx(Y.Modal,{width:"65%",title:S.jsx(Qf,{value:d,onChange:v=>{h.current=!0,p(v)}}),footer:null,open:t,onCancel:e,closeIcon:S.jsx(df,{}),className:"ow-modal ow-modal-2",children:S.jsxs("div",{className:"config-widget-dialog-container",children:[S.jsx("div",{className:"config-widget-dialog-content",children:S.jsx("div",{className:"config-widget-dialog-preview",children:S.jsx(_8,{customData:l,customeStyle:c,moduleDataApi:n})})}),S.jsxs("div",{className:"config-widget-dialog-panel",children:[S.jsx("div",{className:"bitable-dashboard edit-panel-container",children:S.jsx(Y.Tabs,{defaultActiveKey:"1",items:[{key:"1",label:o("typeData"),children:S.jsx(Dse,{selectModuleData:i,enumDataApi:a,onAllValuesChange:v=>{u(v)}})},{key:"2",label:o("customStyle"),children:S.jsx(Ase,{selectModuleData:i,onAllValuesChange:v=>{f(v)}})}]})}),S.jsx("div",{className:"button-container",children:S.jsx(Y.Button,{type:"primary",onClick:()=>{r==null||r({id:i==null?void 0:i.id,customData:l,customeStyle:c,title:d})},children:o("confirm")})})]})]})})})},Ose=t=>S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",...t,children:[S.jsx("g",{clipPath:"url(#a)",children:S.jsx("path",{fill:"#000",fillRule:"evenodd",d:"M3 2.666a.167.167 0 0 0-.166.167v1.634c0 .057.03.11.077.14l3.05 1.94c.336.215.54.586.54.985v4.634a.5.5 0 1 1-1 0V7.532c0-.057-.03-.11-.078-.14L2.374 5.45a1.167 1.167 0 0 1-.54-.984V2.833c0-.645.522-1.167 1.167-1.167h10c.644 0 1.166.522 1.166 1.167v1.634c0 .399-.204.77-.54.984l-3.05 1.94a.167.167 0 0 0-.076.141v6.3a.5.5 0 0 1-1 0v-6.3c0-.399.203-.77.54-.984l3.05-1.94a.167.167 0 0 0 .076-.141V2.833a.167.167 0 0 0-.166-.167H3Z",clipRule:"evenodd"})}),S.jsx("defs",{children:S.jsx("clipPath",{id:"a",children:S.jsx("path",{fill:"#fff",d:"M0 0h16v16H0z"})})})]}),C8=P.createContext({}),l_=()=>P.useContext(C8),rp=(t,e)=>`${t}-${e}`,Mse=t=>{var l,u;const{t:e}=Rt(),{fieldPickerDataSource:r,flattenFieldMap:n}=l_(),[i,a]=lo(t),o=Mt(c=>{const[f,h]=c.keyPath;let d=f==null?void 0:f.replace(`${h}-`,"");d&&a({dataSourceId:h,field:d})}),s=P.useMemo(()=>{{let c=rp(i==null?void 0:i.dataSourceId,i==null?void 0:i.field);return n==null?void 0:n.get(c)}},[i,n]);return S.jsx(Y.Dropdown,{trigger:["click"],menu:{selectable:!0,selectedKeys:s?[(l=s==null?void 0:s.source)==null?void 0:l.value,s==null?void 0:s.mergeId]:[],items:r,onClick:o},children:S.jsx(Y.Select,{open:!1,placeholder:e("selectGroupField"),style:{width:200},value:((u=s==null?void 0:s.field)==null?void 0:u.label)??void 0})})},u_=t=>{const[e,r]=lo(t),n=P.useMemo(()=>e!=null&&e.field?{dataSourceId:e==null?void 0:e.dataSourceId,field:e==null?void 0:e.field}:void 0,[e==null?void 0:e.field,e==null?void 0:e.dataSourceId]),i=u=>{var f;const c={condition:"=",val:"",val2:"",rdate:"exactdate"};if(u){let h=a==null?void 0:a.get(rp(u.dataSourceId,u.field));r({...c,dataSourceId:u.dataSourceId,field:u.field,type:(f=h==null?void 0:h.field)==null?void 0:f.type})}else r({...c,dataSourceId:void 0,field:void 0,type:void 0})},{flattenFieldMap:a}=l_(),o=a==null?void 0:a.get(rp(e==null?void 0:e.dataSourceId,e==null?void 0:e.field)),s=NS(e,["field"]),l=Mt(u=>r({...e,...u}));return S.jsxs("div",{style:{display:"flex",gap:"10px"},children:[S.jsx(Mse,{value:n,onChange:i}),S.jsx(CA,{value:s,onChange:l,field:o==null?void 0:o.field}),S.jsx(jp,{style:{cursor:"pointer"},onClick:t.onDelete})]})};u_.displayName="ConditionRowItem";const Uc={"global-filter-condition__popover":"_global-filter-condition__popover_qw1om_1","global-filter-condition__block":"_global-filter-condition__block_qw1om_4","sub-popup":"_sub-popup_qw1om_10"},np="global-filter-condition",Pse=[],w8=t=>{const{className:e,style:r}=t,{t:n}=Rt(),{globalFilterCondition:i,setGlobalFilterCondition:a}=pr(),[o,s]=P.useState(!1),{globalData:l}=pr(),{fieldPickerDataSource:u,flattenFieldMap:c}=P.useMemo(()=>{let f=new Map;return{fieldPickerDataSource:((l==null?void 0:l.sourceData)||[]).map(d=>{let p=((d==null?void 0:d.fields)||[]).map(g=>{let v=rp(d==null?void 0:d.value,g==null?void 0:g.value);return f.set(v,{field:g,source:d,mergeId:v}),{key:v,label:g==null?void 0:g.label,disabled:g.disabled??!1}});return{key:d==null?void 0:d.value,label:d==null?void 0:d.label,children:p,popupClassName:Uc["sub-popup"]}}),flattenFieldMap:f}},[l==null?void 0:l.sourceData]);return S.jsx(C8.Provider,{value:{fieldPickerDataSource:u,flattenFieldMap:c},children:S.jsx("div",{className:cn(Uc[`${np}`],e),style:r,children:S.jsx(Y.Popover,{content:S.jsx(Rse,{defaultValue:i,onClose:(f,h)=>{f&&a(h),s(!1)}}),destroyTooltipOnHide:!0,placement:"bottomRight",trigger:"click",open:o,onOpenChange:s,children:S.jsx(Y.Button,{className:`!px-1 ${((i==null?void 0:i.length)??0)>0?"!bg-primary/10":""}`,type:"text",icon:S.jsx(Ose,{}),children:n("globalfilter")})})})})};w8.displayName="GlobalFilterCondition";const Rse=t=>{const{defaultValue:e}=t,{t:r}=Rt(),n=l_().fieldPickerDataSource,i=yA(),[a=Pse,o]=P.useState([]);P.useEffect(()=>{e&&o(V7(e))},[e]);const[s,l]=P.useState([]),u=d=>{d!=null&&d.field&&o(p=>{let g=[...p],v=g.find(m=>m.dataSourceId===d.dataSourceId);if(v)return v.conditionList.push(d),[...g];{let m={dataSourceId:d.dataSourceId,conditionType:"all",conditionList:[d]};return[...g,m]}})},c=()=>{l([...s,{}])},f=P.useMemo(()=>!RS(a,e),[a,e]),h=Mt(()=>{var d;(d=t==null?void 0:t.onClose)==null||d.call(t,!0,a)});return S.jsxs("div",{className:cn(Uc[`${np}__popover`]),children:[S.jsx("div",{style:{marginBottom:"10px"},children:r("setFilterCondition")}),a.map((d,p)=>{var m;let g=d==null?void 0:d.conditionList,v=(m=n==null?void 0:n.find(y=>y.key===(d==null?void 0:d.dataSourceId)))==null?void 0:m.label;return console.log("dataSourceName",v),S.jsxs("div",{className:cn(Uc[`${np}__block`]),children:[S.jsxs("div",{style:{marginBottom:"10px",display:"flex",justifyContent:"space-between"},children:[S.jsx("div",{children:v}),S.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[r("conformTo"),S.jsx(Y.Select,{style:{width:"80px"},options:i,value:d==null?void 0:d.conditionType,onChange:y=>{o(b=>{let C=[...b];return C[p].conditionType=y,C})}}),r("condition")]})]}),S.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:g.map((y,b)=>S.jsx(u_,{value:y,onChange:C=>{o(w=>{let _=[...w],x=_[p].conditionList[b];if((x==null?void 0:x.dataSourceId)!==(C==null?void 0:C.dataSourceId)){_[p].conditionList.splice(b,1),_[p].conditionList.length===0&&_.splice(p,1);let D=C,E=_.find(T=>T.dataSourceId===D.dataSourceId);if(E)return E.conditionList.push(D),[..._];{let T={dataSourceId:D.dataSourceId,conditionType:"all",conditionList:[D]};return[..._,T]}}else _[p].conditionList[b]={...x,...C};return _})},onDelete:()=>{o(C=>{let w=[...C];return w[p].conditionList.splice(b,1),w[p].conditionList.length===0&&w.splice(p,1),w})}},b))})]},d==null?void 0:d.dataSourceId)}),s.map((d,p)=>S.jsx("div",{className:cn(Uc[`${np}__block`]),children:S.jsx(u_,{value:d,onChange:g=>{u(g)},onDelete:()=>{l(g=>{let v=[...g];return v.splice(p,1),v})}})},p)),S.jsx(Y.Button,{type:"dashed",block:!0,style:{marginBottom:"10px"},icon:S.jsx(hf,{}),onClick:()=>{c()},children:r("addCondition")}),S.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:S.jsx(Y.Button,{type:"primary",disabled:!f,onClick:()=>{h()},children:r("confirm")})})]})};/*!
|
|
166
166
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
167
167
|
*
|
|
168
168
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|