@langchain/macaw-components 1.7.0 → 1.7.2
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.
- package/dist/catalog.json +713 -713
- package/dist/components/BarChart/BarChart.d.ts +1 -1
- package/dist/components/BarChart/BarChart.js +5 -3
- package/dist/components/BarChart/BarChart.js.map +1 -1
- package/dist/components/BarChart/BarChart.types.d.ts +6 -0
- package/dist/components/ChartLegend/ChartLegend.d.ts +17 -0
- package/dist/components/ChartLegend/ChartLegend.js +5 -2
- package/dist/components/ChartLegend/ChartLegend.js.map +1 -1
- package/dist/components/ChartLegend/ChartLegendItemRenderer.d.ts +4 -2
- package/dist/components/ChartLegend/ChartLegendItemRenderer.js +16 -11
- package/dist/components/ChartLegend/ChartLegendItemRenderer.js.map +1 -1
- package/dist/components/ChartLegend/index.d.ts +1 -1
- package/dist/components/Code/CodeLite.js +2 -4
- package/dist/components/Code/CodeLite.js.map +1 -1
- package/dist/components/DonutChart/DonutChart.d.ts +8 -1
- package/dist/components/DonutChart/DonutChart.js +3 -2
- package/dist/components/DonutChart/DonutChart.js.map +1 -1
- package/dist/components/DonutChart/DonutChart.utils.d.ts +10 -7
- package/dist/components/DonutChart/DonutChart.utils.js +13 -11
- package/dist/components/DonutChart/DonutChart.utils.js.map +1 -1
- package/dist/components/LineChart/LineChart.d.ts +1 -1
- package/dist/components/LineChart/LineChart.js +4 -3
- package/dist/components/LineChart/LineChart.js.map +1 -1
- package/dist/components/LineChart/LineChart.types.d.ts +7 -0
- package/dist/components/RadarChart/RadarChart.d.ts +3 -0
- package/dist/components/RadarChart/RadarChart.js +3 -4
- package/dist/components/RadarChart/RadarChart.js.map +1 -1
- package/dist/utilities.css +1 -1
- package/docs/DESIGN.md +2 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadarChart.js","names":[],"sources":["../../../src/components/RadarChart/RadarChart.tsx"],"sourcesContent":["import {\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\n\nimport {\n CHART_SINGLE_FILL_COLOR,\n getCategoricalFillChartColor,\n getCategoricalFillColor,\n getCategoricalLineChartColor,\n} from '../../utils/chartColors';\nimport { CHART_DIMMED_OPACITY } from '../../utils/chartConstants';\nimport { cn } from '../../utils/cn';\nimport { useZIndex } from '../../utils/useZIndex';\nimport { ZIndexProvider } from '../../utils/ZIndexContext';\nimport zIndices from '../../utils/zIndices';\nimport { ChartTooltip } from '../ChartTooltip';\nimport { Text } from '../Text';\n\nexport type RadarChartDatum = {\n /** Unique, stable identifier for this axis. */\n id: string;\n label: string;\n value: number;\n /** Semantic chart color; defaults to the categorical fill palette in axis order. */\n color?: string;\n};\n\nexport type RadarChartAxis = {\n /** Unique, stable identifier; keys each series' `values`. */\n id: string;\n label: string;\n};\n\nexport type RadarChartSeries = {\n /** Unique, stable identifier; use it as the matching legend item's id. */\n id: string;\n label: string;\n /** Values keyed by axis id. Missing, negative, and non-finite values plot at zero. */\n values: Readonly<Record<string, number | undefined>>;\n /**\n * Outline color; defaults to the categorical line palette in series order.\n * The area uses the hue-matched fill color.\n */\n color?: string;\n};\n\n/** One axis and every visible series' value on it, for multi-series tooltips. */\nexport type RadarChartAxisValues = RadarChartAxis & {\n /** Visible series in input order, with sanitized values and outline colors. */\n values: readonly {\n id: string;\n label: string;\n value: number;\n color: string;\n }[];\n};\n\ntype RadarChartBaseProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** Shared axis maximum; defaults to the largest finite positive value. */\n maxValue?: number;\n /** Formats labels and the accessible data summary. */\n formatValue?: (value: number) => string;\n};\n\nexport type RadarChartSingleSeriesProps = RadarChartBaseProps & {\n /** Axes in clockwise order, beginning at the top. Supply at least three. */\n data: readonly RadarChartDatum[];\n /**\n * Content inside ChartTooltip on point or label hover and keyboard focus.\n * Receives the sanitized value and resolved color. Compose ChartTooltipHeader,\n * ChartTooltipBody, and ChartTooltipRow here; omit for a static chart.\n */\n renderTooltip?: (datum: RadarChartDatum) => ReactNode;\n axes?: never;\n series?: never;\n renderAxisTooltip?: never;\n selectedIds?: never;\n activeLegendItemId?: never;\n};\n\nexport type RadarChartMultiSeriesProps = RadarChartBaseProps & {\n /** Axes in clockwise order, beginning at the top. Supply at least three. */\n axes: readonly RadarChartAxis[];\n /**\n * Overlapping areas on the shared axes, drawn in input order. Keep to about\n * four; beyond that, filter series or use small multiples.\n */\n series: readonly RadarChartSeries[];\n /**\n * Content inside ChartTooltip when an axis is hovered anywhere in its sector\n * or focused. Compose one ChartTooltipRow per series; omit for a static chart.\n */\n renderAxisTooltip?: (axis: RadarChartAxisValues) => ReactNode;\n /** When non-empty, only these series are drawn. Colors keep their series order. */\n selectedIds?: ReadonlySet<string>;\n /** Emphasizes one series from an external legend and dims the rest. */\n activeLegendItemId?: string | null;\n data?: never;\n renderTooltip?: never;\n};\n\nexport type RadarChartProps =\n | RadarChartSingleSeriesProps\n | RadarChartMultiSeriesProps;\n\ntype AxisLayout = {\n id: string;\n unitX: number;\n unitY: number;\n labelX: number;\n labelY: number;\n align: 'text-left' | 'text-center' | 'text-right';\n tooltipSide: 'top' | 'right' | 'bottom' | 'left';\n tooltipAlign: 'start' | 'center' | 'end';\n};\n\nconst numberFormatter = new Intl.NumberFormat('en-US');\nconst formatNumber = (value: number) => numberFormatter.format(value);\nconst sanitize = (value: number | undefined) =>\n value !== undefined && Number.isFinite(value) ? Math.max(0, value) : 0;\n// Layout uses SVG units, which scale together with the viewBox. This canvas\n// fits the plot plus outside labels, with extra width for horizontal text.\nconst VIEWBOX_WIDTH = 440;\nconst VIEWBOX_HEIGHT = 340;\nconst CENTER_X = VIEWBOX_WIDTH / 2;\nconst CENTER_Y = VIEWBOX_HEIGHT / 2;\n// A 96-unit plot leaves room for a 20-unit gap and the two-line label boxes.\nconst RADIUS = 96;\nconst LABEL_RADIUS = RADIUS + 20;\n// Reserve 100 units for truncated names and 20 per text line: single-series\n// labels pair the name with its value; multi-series labels show the name.\nconst LABEL_WIDTH = 100;\nconst LABEL_LINE_HEIGHT = 20;\n// Labels left of center end at their axis; labels right of it start there.\nconst LABEL_SIDES = {\n left: { offset: LABEL_WIDTH, align: 'text-right', tooltipAlign: 'start' },\n center: {\n offset: LABEL_WIDTH / 2,\n align: 'text-center',\n tooltipAlign: 'center',\n },\n right: { offset: 0, align: 'text-left', tooltipAlign: 'end' },\n} as const;\n// Absorb trig rounding at alignment boundaries so mirrored labels line up.\nconst ALIGNMENT_EPSILON = 1e-6;\n// Four equally spaced rings represent fractions of the shared axis maximum.\nconst GRID_LEVELS = [0.25, 0.5, 0.75, 1];\n// Overlapping areas lead with their outlines: a faint wash keeps stacked\n// areas from mixing into a muddy tint. While one series is emphasized, it\n// alone keeps a fill, and the other series recede to dimmed outlines.\nconst SERIES_FILL_OPACITY = 0.08;\nconst EMPHASIZED_SERIES_FILL_OPACITY = 0.2;\n\nconst getAxisLayouts = (\n axes: readonly { id: string }[],\n labelHeight: number\n): AxisLayout[] =>\n axes.map(({ id }, index) => {\n const angle = (index * Math.PI * 2) / axes.length - Math.PI / 2;\n const unitX = Math.cos(angle);\n const unitY = Math.sin(angle);\n // Center labels within ~6 degrees of vertical (|cos| <= 0.1).\n const side =\n LABEL_SIDES[unitX < -0.1 ? 'left' : unitX > 0.1 ? 'right' : 'center'];\n // At 30 degrees or more above/below horizontal (|sin| >= 0.5), place the\n // whole label box outside the axis instead of straddling it.\n const isAbove = unitY <= -0.5 + ALIGNMENT_EPSILON;\n const isBelow = unitY >= 0.5 - ALIGNMENT_EPSILON;\n return {\n id,\n unitX,\n unitY,\n labelX: CENTER_X + unitX * LABEL_RADIUS - side.offset,\n labelY:\n CENTER_Y +\n unitY * LABEL_RADIUS -\n (isAbove ? labelHeight : isBelow ? 0 : labelHeight / 2),\n align: side.align,\n // Open outward, past the label and away from the plot.\n tooltipSide: isAbove\n ? 'top'\n : isBelow\n ? 'bottom'\n : unitX < 0\n ? 'left'\n : 'right',\n tooltipAlign: isAbove || isBelow ? side.tooltipAlign : 'center',\n };\n });\n\nconst getPoint = (axis: AxisLayout, ratio: number): [number, number] => [\n CENTER_X + axis.unitX * RADIUS * ratio,\n CENTER_Y + axis.unitY * RADIUS * ratio,\n];\n\nconst toPoints = (points: readonly (readonly [number, number])[]) =>\n points.map(([x, y]) => `${x},${y}`).join(' ');\n\nconst getMaximum = (values: readonly number[], maxValue?: number) =>\n maxValue !== undefined && Number.isFinite(maxValue) && maxValue > 0\n ? maxValue\n : values.reduce((largest, value) => Math.max(largest, value), 0) || 1;\n\n/**\n * A radar with a shared scale and clockwise, outside axis labels. Pass `data`\n * for one series with categorical points, or `axes` and `series` for\n * overlapping areas identified by an external legend.\n */\nexport const RadarChart = (props: RadarChartProps) => {\n // Mode-specific props are read from `props` so TypeScript narrows them by\n // mode; they are destructured here only to keep them off the wrapper div.\n const {\n data: _data,\n axes: _axes,\n series: _series,\n renderTooltip: _renderTooltip,\n renderAxisTooltip: _renderAxisTooltip,\n selectedIds,\n activeLegendItemId,\n maxValue,\n formatValue = formatNumber,\n className,\n 'aria-label': ariaLabel = 'Radar chart',\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...divProps\n } = props;\n const summaryId = useId();\n const [activeTooltip, setActiveTooltip] = useState<string | null>(null);\n const isPointerDownRef = useRef(false);\n const tooltipZIndex = useZIndex(zIndices.tooltip);\n const isInteractive =\n (props.series !== undefined\n ? props.renderAxisTooltip\n : props.renderTooltip) !== undefined;\n\n const withTooltip = (\n id: string,\n mark: ReactElement,\n content: ReactNode,\n layout?: AxisLayout\n ) => (\n <TooltipPrimitive.Root\n key={id}\n open={activeTooltip === id}\n onOpenChange={(open) =>\n setActiveTooltip((active) =>\n open ? id : active === id ? null : active\n )\n }\n >\n <TooltipPrimitive.Trigger\n asChild\n onPointerDown={(event) => {\n isPointerDownRef.current = true;\n event.currentTarget.ownerDocument.addEventListener(\n 'pointerup',\n () => {\n isPointerDownRef.current = false;\n },\n { once: true }\n );\n }}\n onFocus={(event) => {\n // Wait for keyboard focus to scroll an offscreen axis into\n // view; otherwise Radix closes the tooltip on that scroll.\n // Like Radix, focus from a pointer press stays closed.\n event.preventDefault();\n if (isPointerDownRef.current) return;\n const target = event.currentTarget;\n requestAnimationFrame(() => {\n if (target === target.ownerDocument.activeElement) {\n setActiveTooltip(id);\n }\n });\n }}\n >\n {mark}\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n asChild\n side={layout?.tooltipSide}\n align={layout?.tooltipAlign}\n // Leave an 8px gap from the trigger and viewport edges.\n sideOffset={8}\n collisionPadding={8}\n >\n <ChartTooltip style={{ zIndex: tooltipZIndex }}>\n <ZIndexProvider value={tooltipZIndex}>{content}</ZIndexProvider>\n </ChartTooltip>\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n\n const renderLabel = (\n layout: AxisLayout,\n height: number,\n summary: string,\n lines: ReactNode\n ) => (\n <foreignObject\n x={layout.labelX}\n y={layout.labelY}\n width={LABEL_WIDTH}\n height={height}\n >\n <div\n className={cn('flex h-full flex-col justify-center', layout.align)}\n title={isInteractive ? undefined : summary}\n >\n {lines}\n </div>\n </foreignObject>\n );\n\n const renderSingleSeries = (\n data: readonly RadarChartDatum[],\n renderDatumTooltip?: (datum: RadarChartDatum) => ReactNode\n ) => {\n const labelHeight = LABEL_LINE_HEIGHT * 2;\n const layouts = getAxisLayouts(data, labelHeight);\n const values = data.map(({ value }) => sanitize(value));\n const maximum = getMaximum(values, maxValue);\n const axes = data.map((datum, index) => {\n const value = values[index];\n const formattedValue = formatValue(value);\n return {\n layout: layouts[index],\n datum: {\n ...datum,\n value,\n color: datum.color ?? getCategoricalFillChartColor(index),\n },\n formattedValue,\n summary: `${datum.label}: ${formattedValue}`,\n point: getPoint(layouts[index], Math.min(1, value / maximum)),\n };\n });\n\n return {\n layouts,\n summary: axes.map(({ summary }) => summary).join('; '),\n marks: (\n <>\n <polygon\n aria-hidden=\"true\"\n points={toPoints(axes.map(({ point }) => point))}\n fill={CHART_SINGLE_FILL_COLOR}\n // A light wash and subdued outline keep the category points prominent.\n // Dark surfaces need slightly more opacity to preserve the shape.\n className=\"dark:[fill-opacity:0.24] dark:[stroke-opacity:0.8]\"\n fillOpacity={0.16}\n stroke={getCategoricalLineChartColor(0)}\n strokeOpacity={0.55}\n strokeWidth={1.25}\n strokeLinejoin=\"round\"\n />\n {axes.map(({ layout, datum, formattedValue, summary, point }) => {\n const [pointX, pointY] = point;\n const mark = (\n <g\n key={datum.id}\n className=\"group outline-hidden\"\n role={isInteractive ? 'img' : undefined}\n aria-label={isInteractive ? summary : undefined}\n aria-hidden={isInteractive ? undefined : true}\n tabIndex={isInteractive ? 0 : undefined}\n >\n {/* A 24-unit hit target surrounds the 8-unit point; the\n 16-unit ring shows hover in the axis color and keyboard\n focus in the shared focus color without changing layout. */}\n <circle cx={pointX} cy={pointY} r={12} fill=\"transparent\" />\n <circle\n cx={pointX}\n cy={pointY}\n r={8}\n fill=\"none\"\n stroke={datum.color}\n strokeWidth={1.5}\n className=\"opacity-0 group-hover:opacity-100 group-focus-visible:stroke-focus group-focus-visible:opacity-100\"\n />\n <circle\n cx={pointX}\n cy={pointY}\n r={4}\n fill={datum.color}\n // A thin surface-colored separator avoids heavy dark borders.\n className=\"stroke-surface-level-1\"\n strokeWidth={1}\n />\n {renderLabel(\n layout,\n labelHeight,\n summary,\n <>\n <Text variant=\"xs\" className=\"truncate\">\n {datum.label}\n </Text>\n <Text\n variant=\"xs\"\n color=\"secondary\"\n className=\"truncate tabular-nums\"\n >\n {formattedValue}\n </Text>\n </>\n )}\n </g>\n );\n return renderDatumTooltip\n ? withTooltip(datum.id, mark, renderDatumTooltip(datum))\n : mark;\n })}\n </>\n ),\n };\n };\n\n const renderMultiSeries = (\n axes: readonly RadarChartAxis[],\n series: readonly RadarChartSeries[],\n renderAxisTooltip?: (axis: RadarChartAxisValues) => ReactNode\n ) => {\n const layouts = getAxisLayouts(axes, LABEL_LINE_HEIGHT);\n // Resolve colors before filtering so each series keeps its hue.\n const resolvedSeries = series.map((item, index) => {\n const color = item.color ?? getCategoricalLineChartColor(index);\n return {\n id: item.id,\n label: item.label,\n color,\n fill: getCategoricalFillColor(color),\n values: axes.map(({ id }) => sanitize(item.values[id])),\n };\n });\n const visibleSeries =\n selectedIds === undefined || selectedIds.size === 0\n ? resolvedSeries\n : resolvedSeries.filter(({ id }) => selectedIds.has(id));\n const maximum = getMaximum(\n visibleSeries.flatMap(({ values }) => values),\n maxValue\n );\n const plottedSeries = visibleSeries.map((item) => ({\n ...item,\n points: item.values.map((value, index) =>\n getPoint(layouts[index], Math.min(1, value / maximum))\n ),\n }));\n const emphasizedId = plottedSeries.some(\n ({ id }) => id === activeLegendItemId\n )\n ? activeLegendItemId\n : null;\n const getSeriesOpacity = (id: string) =>\n emphasizedId != null && id !== emphasizedId ? CHART_DIMMED_OPACITY : 1;\n\n return {\n layouts,\n summary: plottedSeries\n .map(\n (item) =>\n `${item.label}: ${axes\n .map(\n (axis, index) =>\n `${axis.label} ${formatValue(item.values[index])}`\n )\n .join(', ')}`\n )\n .join('; '),\n marks: (\n <>\n {/* Draw the emphasized series last so its outline sits on top. */}\n {[\n ...plottedSeries.filter(({ id }) => id !== emphasizedId),\n ...plottedSeries.filter(({ id }) => id === emphasizedId),\n ].map((item) => {\n const isEmphasized = item.id === emphasizedId;\n return (\n <polygon\n key={item.id}\n aria-hidden=\"true\"\n points={toPoints(item.points)}\n fill={item.fill}\n fillOpacity={\n isEmphasized\n ? EMPHASIZED_SERIES_FILL_OPACITY\n : emphasizedId == null\n ? SERIES_FILL_OPACITY\n : 0\n }\n className=\"transition-[opacity,fill-opacity] duration-fast motion-reduce:transition-none\"\n opacity={getSeriesOpacity(item.id)}\n stroke={item.color}\n strokeWidth={1.5}\n strokeLinejoin=\"round\"\n />\n );\n })}\n {axes.map((axis, index) => {\n const layout = layouts[index];\n const values = plottedSeries.map((item) => ({\n id: item.id,\n label: item.label,\n value: item.values[index],\n color: item.color,\n }));\n const summary = values.length\n ? `${axis.label}: ${values\n .map(({ label, value }) => `${label} ${formatValue(value)}`)\n .join(', ')}`\n : axis.label;\n const [outerX, outerY] = getPoint(layout, 1);\n const [previousX, previousY] = getPoint(\n layouts[(index - 1 + layouts.length) % layouts.length],\n 1\n );\n const [nextX, nextY] = getPoint(\n layouts[(index + 1) % layouts.length],\n 1\n );\n const mark = (\n <g\n key={axis.id}\n className=\"group outline-hidden\"\n role={isInteractive ? 'img' : undefined}\n aria-label={isInteractive ? summary : undefined}\n aria-hidden={isInteractive ? undefined : true}\n tabIndex={isInteractive ? 0 : undefined}\n >\n {/* Each axis owns the sector between its neighbors' edge\n midpoints, so hovering anywhere in the plot inspects the\n nearest axis. */}\n <polygon\n points={toPoints([\n [CENTER_X, CENTER_Y],\n [(previousX + outerX) / 2, (previousY + outerY) / 2],\n [outerX, outerY],\n [(outerX + nextX) / 2, (outerY + nextY) / 2],\n ])}\n fill=\"transparent\"\n />\n {/* Hover strengthens the spoke and reveals each series'\n vertex; keyboard focus uses the shared focus color. */}\n <g className=\"opacity-0 transition-opacity duration-fast group-hover:opacity-100 group-focus-visible:opacity-100 motion-reduce:transition-none\">\n <line\n x1={CENTER_X}\n y1={CENTER_Y}\n x2={outerX}\n y2={outerY}\n stroke=\"var(--border-default)\"\n className=\"group-focus-visible:stroke-focus\"\n />\n {plottedSeries.map((item) => (\n <circle\n key={item.id}\n cx={item.points[index][0]}\n cy={item.points[index][1]}\n r={3.5}\n fill={item.color}\n opacity={getSeriesOpacity(item.id)}\n // A surface-colored separator keeps coincident vertices distinct.\n className=\"stroke-surface-level-1\"\n strokeWidth={1.5}\n />\n ))}\n </g>\n {renderLabel(\n layout,\n LABEL_LINE_HEIGHT,\n summary,\n <Text variant=\"xs\" className=\"truncate\">\n {axis.label}\n </Text>\n )}\n </g>\n );\n return renderAxisTooltip\n ? withTooltip(\n axis.id,\n mark,\n renderAxisTooltip({ id: axis.id, label: axis.label, values }),\n layout\n )\n : mark;\n })}\n </>\n ),\n };\n };\n\n const axisCount = (props.series !== undefined ? props.axes : props.data)\n .length;\n const chart =\n axisCount < 3\n ? null\n : props.series !== undefined\n ? renderMultiSeries(props.axes, props.series, props.renderAxisTooltip)\n : renderSingleSeries(props.data, props.renderTooltip);\n\n return (\n <div className={cn('w-full overflow-x-auto', className)} {...divProps}>\n {chart === null ? (\n <div className=\"flex h-80 items-center justify-center\" role=\"status\">\n <Text variant=\"sm\" color=\"secondary\">\n At least three axes are needed to display a radar chart.\n </Text>\n </div>\n ) : (\n <TooltipPrimitive.Provider\n // Brief hover delay avoids flashes when crossing between axes.\n delayDuration={150}\n >\n <svg\n viewBox={`0 0 ${VIEWBOX_WIDTH} ${VIEWBOX_HEIGHT}`}\n className=\"block w-full\"\n // Preserve the labels' base font size; narrow containers scroll.\n style={{ minWidth: VIEWBOX_WIDTH }}\n role={isInteractive ? 'group' : 'img'}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={[summaryId, ariaDescribedBy]\n .filter(Boolean)\n .join(' ')}\n >\n <desc id={summaryId}>{chart.summary}</desc>\n <g aria-hidden=\"true\" fill=\"none\" stroke=\"var(--border-subtle)\">\n {GRID_LEVELS.map((level) => (\n <polygon\n key={level}\n points={toPoints(\n chart.layouts.map((layout) => getPoint(layout, level))\n )}\n />\n ))}\n {chart.layouts.map((layout) => {\n const [x, y] = getPoint(layout, 1);\n return (\n <line\n key={layout.id}\n x1={CENTER_X}\n y1={CENTER_Y}\n x2={x}\n y2={y}\n />\n );\n })}\n </g>\n {chart.marks}\n </svg>\n </TooltipPrimitive.Provider>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;AA2HA,IAAM,kBAAkB,IAAI,KAAK,aAAa,OAAO;AACrD,IAAM,gBAAgB,UAAkB,gBAAgB,OAAO,KAAK;AACp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AAA,CACG,YAAY,KAAK,UAChB,oBAAC,WAAD,EAEE,QAAQ,SACN,MAAM,QAAQ,KAAK,WAAW,SAAS,QAAQ,KAAK,CAAC,CACvD,EACD,GAJM,KAIN,CACF,GACA,MAAM,QAAQ,KAAK,WAAW;OAC7B,MAAM,CAAC,GAAG,KAAK,SAAS,QAAQ,CAAC;OACjC,OACE,oBAAC,QAAD;QAEE,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;OACL,GALM,OAAO,EAKb;MAEL,CAAC,CACA;;KACF,MAAM;IACJ;;EACoB,CAAA;CAE1B,CAAA;AAET"}
|
|
1
|
+
{"version":3,"file":"RadarChart.js","names":[],"sources":["../../../src/components/RadarChart/RadarChart.tsx"],"sourcesContent":["import {\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\n\nimport {\n CHART_SINGLE_FILL_COLOR,\n getCategoricalFillChartColor,\n getCategoricalFillColor,\n getCategoricalLineChartColor,\n} from '../../utils/chartColors';\nimport { CHART_DIMMED_OPACITY } from '../../utils/chartConstants';\nimport { cn } from '../../utils/cn';\nimport { useZIndex } from '../../utils/useZIndex';\nimport { ZIndexProvider } from '../../utils/ZIndexContext';\nimport zIndices from '../../utils/zIndices';\nimport { ChartTooltip } from '../ChartTooltip';\nimport { Text } from '../Text';\n\nexport type RadarChartDatum = {\n /** Unique, stable identifier for this axis. */\n id: string;\n label: string;\n value: number;\n /** Semantic chart color; defaults to the categorical fill palette in axis order. */\n color?: string;\n};\n\nexport type RadarChartAxis = {\n /** Unique, stable identifier; keys each series' `values`. */\n id: string;\n label: string;\n};\n\nexport type RadarChartSeries = {\n /** Unique, stable identifier; use it as the matching legend item's id. */\n id: string;\n label: string;\n /** Values keyed by axis id. Missing, negative, and non-finite values plot at zero. */\n values: Readonly<Record<string, number | undefined>>;\n /**\n * Outline color; defaults to the categorical line palette in series order.\n * The area uses the hue-matched fill color.\n */\n color?: string;\n};\n\n/** One axis and every visible series' value on it, for multi-series tooltips. */\nexport type RadarChartAxisValues = RadarChartAxis & {\n /** Visible series in input order, with sanitized values and outline colors. */\n values: readonly {\n id: string;\n label: string;\n value: number;\n color: string;\n }[];\n};\n\ntype RadarChartBaseProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** Shared axis maximum; defaults to the largest finite positive value. */\n maxValue?: number;\n /** Formats labels and the accessible data summary. */\n formatValue?: (value: number) => string;\n};\n\nexport type RadarChartSingleSeriesProps = RadarChartBaseProps & {\n /** Axes in clockwise order, beginning at the top. Supply at least three. */\n data: readonly RadarChartDatum[];\n /**\n * Content inside ChartTooltip on point or label hover and keyboard focus.\n * Receives the sanitized value and resolved color. Compose ChartTooltipHeader,\n * ChartTooltipBody, and ChartTooltipRow here; omit for a static chart.\n */\n renderTooltip?: (datum: RadarChartDatum) => ReactNode;\n axes?: never;\n series?: never;\n renderAxisTooltip?: never;\n selectedIds?: never;\n excludedIds?: never;\n activeLegendItemId?: never;\n};\n\nexport type RadarChartMultiSeriesProps = RadarChartBaseProps & {\n /** Axes in clockwise order, beginning at the top. Supply at least three. */\n axes: readonly RadarChartAxis[];\n /**\n * Overlapping areas on the shared axes, drawn in input order. Keep to about\n * four; beyond that, filter series or use small multiples.\n */\n series: readonly RadarChartSeries[];\n /**\n * Content inside ChartTooltip when an axis is hovered anywhere in its sector\n * or focused. Compose one ChartTooltipRow per series; omit for a static chart.\n */\n renderAxisTooltip?: (axis: RadarChartAxisValues) => ReactNode;\n /** When non-empty, only these series are drawn. Colors keep their series order. */\n selectedIds?: ReadonlySet<string>;\n /** Series left out, whatever `selectedIds` holds. */\n excludedIds?: ReadonlySet<string>;\n /** Emphasizes one series from an external legend and dims the rest. */\n activeLegendItemId?: string | null;\n data?: never;\n renderTooltip?: never;\n};\n\nexport type RadarChartProps =\n | RadarChartSingleSeriesProps\n | RadarChartMultiSeriesProps;\n\ntype AxisLayout = {\n id: string;\n unitX: number;\n unitY: number;\n labelX: number;\n labelY: number;\n align: 'text-left' | 'text-center' | 'text-right';\n tooltipSide: 'top' | 'right' | 'bottom' | 'left';\n tooltipAlign: 'start' | 'center' | 'end';\n};\n\nconst numberFormatter = new Intl.NumberFormat('en-US');\nconst formatNumber = (value: number) => numberFormatter.format(value);\nconst sanitize = (value: number | undefined) =>\n value !== undefined && Number.isFinite(value) ? Math.max(0, value) : 0;\n// Layout uses SVG units, which scale together with the viewBox. This canvas\n// fits the plot plus outside labels, with extra width for horizontal text.\nconst VIEWBOX_WIDTH = 440;\nconst VIEWBOX_HEIGHT = 340;\nconst CENTER_X = VIEWBOX_WIDTH / 2;\nconst CENTER_Y = VIEWBOX_HEIGHT / 2;\n// A 96-unit plot leaves room for a 20-unit gap and the two-line label boxes.\nconst RADIUS = 96;\nconst LABEL_RADIUS = RADIUS + 20;\n// Reserve 100 units for truncated names and 20 per text line: single-series\n// labels pair the name with its value; multi-series labels show the name.\nconst LABEL_WIDTH = 100;\nconst LABEL_LINE_HEIGHT = 20;\n// Labels left of center end at their axis; labels right of it start there.\nconst LABEL_SIDES = {\n left: { offset: LABEL_WIDTH, align: 'text-right', tooltipAlign: 'start' },\n center: {\n offset: LABEL_WIDTH / 2,\n align: 'text-center',\n tooltipAlign: 'center',\n },\n right: { offset: 0, align: 'text-left', tooltipAlign: 'end' },\n} as const;\n// Absorb trig rounding at alignment boundaries so mirrored labels line up.\nconst ALIGNMENT_EPSILON = 1e-6;\n// Four equally spaced rings represent fractions of the shared axis maximum.\nconst GRID_LEVELS = [0.25, 0.5, 0.75, 1];\n// Overlapping areas lead with their outlines: a faint wash keeps stacked\n// areas from mixing into a muddy tint. While one series is emphasized, it\n// alone keeps a fill, and the other series recede to dimmed outlines.\nconst SERIES_FILL_OPACITY = 0.08;\nconst EMPHASIZED_SERIES_FILL_OPACITY = 0.2;\n\nconst getAxisLayouts = (\n axes: readonly { id: string }[],\n labelHeight: number\n): AxisLayout[] =>\n axes.map(({ id }, index) => {\n const angle = (index * Math.PI * 2) / axes.length - Math.PI / 2;\n const unitX = Math.cos(angle);\n const unitY = Math.sin(angle);\n // Center labels within ~6 degrees of vertical (|cos| <= 0.1).\n const side =\n LABEL_SIDES[unitX < -0.1 ? 'left' : unitX > 0.1 ? 'right' : 'center'];\n // At 30 degrees or more above/below horizontal (|sin| >= 0.5), place the\n // whole label box outside the axis instead of straddling it.\n const isAbove = unitY <= -0.5 + ALIGNMENT_EPSILON;\n const isBelow = unitY >= 0.5 - ALIGNMENT_EPSILON;\n return {\n id,\n unitX,\n unitY,\n labelX: CENTER_X + unitX * LABEL_RADIUS - side.offset,\n labelY:\n CENTER_Y +\n unitY * LABEL_RADIUS -\n (isAbove ? labelHeight : isBelow ? 0 : labelHeight / 2),\n align: side.align,\n // Open outward, past the label and away from the plot.\n tooltipSide: isAbove\n ? 'top'\n : isBelow\n ? 'bottom'\n : unitX < 0\n ? 'left'\n : 'right',\n tooltipAlign: isAbove || isBelow ? side.tooltipAlign : 'center',\n };\n });\n\nconst getPoint = (axis: AxisLayout, ratio: number): [number, number] => [\n CENTER_X + axis.unitX * RADIUS * ratio,\n CENTER_Y + axis.unitY * RADIUS * ratio,\n];\n\nconst toPoints = (points: readonly (readonly [number, number])[]) =>\n points.map(([x, y]) => `${x},${y}`).join(' ');\n\nconst getMaximum = (values: readonly number[], maxValue?: number) =>\n maxValue !== undefined && Number.isFinite(maxValue) && maxValue > 0\n ? maxValue\n : values.reduce((largest, value) => Math.max(largest, value), 0) || 1;\n\n/**\n * A radar with a shared scale and clockwise, outside axis labels. Pass `data`\n * for one series with categorical points, or `axes` and `series` for\n * overlapping areas identified by an external legend.\n */\nexport const RadarChart = (props: RadarChartProps) => {\n // Mode-specific props are read from `props` so TypeScript narrows them by\n // mode; they are destructured here only to keep them off the wrapper div.\n const {\n data: _data,\n axes: _axes,\n series: _series,\n renderTooltip: _renderTooltip,\n renderAxisTooltip: _renderAxisTooltip,\n selectedIds,\n excludedIds,\n activeLegendItemId,\n maxValue,\n formatValue = formatNumber,\n className,\n 'aria-label': ariaLabel = 'Radar chart',\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...divProps\n } = props;\n const summaryId = useId();\n const [activeTooltip, setActiveTooltip] = useState<string | null>(null);\n const isPointerDownRef = useRef(false);\n const tooltipZIndex = useZIndex(zIndices.tooltip);\n const isInteractive =\n (props.series !== undefined\n ? props.renderAxisTooltip\n : props.renderTooltip) !== undefined;\n\n const withTooltip = (\n id: string,\n mark: ReactElement,\n content: ReactNode,\n layout?: AxisLayout\n ) => (\n <TooltipPrimitive.Root\n key={id}\n open={activeTooltip === id}\n onOpenChange={(open) =>\n setActiveTooltip((active) =>\n open ? id : active === id ? null : active\n )\n }\n >\n <TooltipPrimitive.Trigger\n asChild\n onPointerDown={(event) => {\n isPointerDownRef.current = true;\n event.currentTarget.ownerDocument.addEventListener(\n 'pointerup',\n () => {\n isPointerDownRef.current = false;\n },\n { once: true }\n );\n }}\n onFocus={(event) => {\n // Wait for keyboard focus to scroll an offscreen axis into\n // view; otherwise Radix closes the tooltip on that scroll.\n // Like Radix, focus from a pointer press stays closed.\n event.preventDefault();\n if (isPointerDownRef.current) return;\n const target = event.currentTarget;\n requestAnimationFrame(() => {\n if (target === target.ownerDocument.activeElement) {\n setActiveTooltip(id);\n }\n });\n }}\n >\n {mark}\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n asChild\n side={layout?.tooltipSide}\n align={layout?.tooltipAlign}\n // Leave an 8px gap from the trigger and viewport edges.\n sideOffset={8}\n collisionPadding={8}\n >\n <ChartTooltip style={{ zIndex: tooltipZIndex }}>\n <ZIndexProvider value={tooltipZIndex}>{content}</ZIndexProvider>\n </ChartTooltip>\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n\n const renderLabel = (\n layout: AxisLayout,\n height: number,\n summary: string,\n lines: ReactNode\n ) => (\n <foreignObject\n x={layout.labelX}\n y={layout.labelY}\n width={LABEL_WIDTH}\n height={height}\n >\n <div\n className={cn('flex h-full flex-col justify-center', layout.align)}\n title={isInteractive ? undefined : summary}\n >\n {lines}\n </div>\n </foreignObject>\n );\n\n const renderSingleSeries = (\n data: readonly RadarChartDatum[],\n renderDatumTooltip?: (datum: RadarChartDatum) => ReactNode\n ) => {\n const labelHeight = LABEL_LINE_HEIGHT * 2;\n const layouts = getAxisLayouts(data, labelHeight);\n const values = data.map(({ value }) => sanitize(value));\n const maximum = getMaximum(values, maxValue);\n const axes = data.map((datum, index) => {\n const value = values[index];\n const formattedValue = formatValue(value);\n return {\n layout: layouts[index],\n datum: {\n ...datum,\n value,\n color: datum.color ?? getCategoricalFillChartColor(index),\n },\n formattedValue,\n summary: `${datum.label}: ${formattedValue}`,\n point: getPoint(layouts[index], Math.min(1, value / maximum)),\n };\n });\n\n return {\n layouts,\n summary: axes.map(({ summary }) => summary).join('; '),\n marks: (\n <>\n <polygon\n aria-hidden=\"true\"\n points={toPoints(axes.map(({ point }) => point))}\n fill={CHART_SINGLE_FILL_COLOR}\n // A light wash and subdued outline keep the category points prominent.\n // Dark surfaces need slightly more opacity to preserve the shape.\n className=\"dark:[fill-opacity:0.24] dark:[stroke-opacity:0.8]\"\n fillOpacity={0.16}\n stroke={getCategoricalLineChartColor(0)}\n strokeOpacity={0.55}\n strokeWidth={1.25}\n strokeLinejoin=\"round\"\n />\n {axes.map(({ layout, datum, formattedValue, summary, point }) => {\n const [pointX, pointY] = point;\n const mark = (\n <g\n key={datum.id}\n className=\"group outline-hidden\"\n role={isInteractive ? 'img' : undefined}\n aria-label={isInteractive ? summary : undefined}\n aria-hidden={isInteractive ? undefined : true}\n tabIndex={isInteractive ? 0 : undefined}\n >\n {/* A 24-unit hit target surrounds the 8-unit point; the\n 16-unit ring shows hover in the axis color and keyboard\n focus in the shared focus color without changing layout. */}\n <circle cx={pointX} cy={pointY} r={12} fill=\"transparent\" />\n <circle\n cx={pointX}\n cy={pointY}\n r={8}\n fill=\"none\"\n stroke={datum.color}\n strokeWidth={1.5}\n className=\"opacity-0 group-hover:opacity-100 group-focus-visible:stroke-focus group-focus-visible:opacity-100\"\n />\n <circle\n cx={pointX}\n cy={pointY}\n r={4}\n fill={datum.color}\n // A thin surface-colored separator avoids heavy dark borders.\n className=\"stroke-surface-level-1\"\n strokeWidth={1}\n />\n {renderLabel(\n layout,\n labelHeight,\n summary,\n <>\n <Text variant=\"xs\" className=\"truncate\">\n {datum.label}\n </Text>\n <Text\n variant=\"xs\"\n color=\"secondary\"\n className=\"truncate tabular-nums\"\n >\n {formattedValue}\n </Text>\n </>\n )}\n </g>\n );\n return renderDatumTooltip\n ? withTooltip(datum.id, mark, renderDatumTooltip(datum))\n : mark;\n })}\n </>\n ),\n };\n };\n\n const renderMultiSeries = (\n axes: readonly RadarChartAxis[],\n series: readonly RadarChartSeries[],\n renderAxisTooltip?: (axis: RadarChartAxisValues) => ReactNode\n ) => {\n const layouts = getAxisLayouts(axes, LABEL_LINE_HEIGHT);\n // Resolve colors before filtering so each series keeps its hue.\n const resolvedSeries = series.map((item, index) => {\n const color = item.color ?? getCategoricalLineChartColor(index);\n return {\n id: item.id,\n label: item.label,\n color,\n fill: getCategoricalFillColor(color),\n values: axes.map(({ id }) => sanitize(item.values[id])),\n };\n });\n const visibleSeries = resolvedSeries.filter(\n ({ id }) =>\n (selectedIds === undefined ||\n selectedIds.size === 0 ||\n selectedIds.has(id)) &&\n !excludedIds?.has(id)\n );\n const maximum = getMaximum(\n visibleSeries.flatMap(({ values }) => values),\n maxValue\n );\n const plottedSeries = visibleSeries.map((item) => ({\n ...item,\n points: item.values.map((value, index) =>\n getPoint(layouts[index], Math.min(1, value / maximum))\n ),\n }));\n const emphasizedId = plottedSeries.some(\n ({ id }) => id === activeLegendItemId\n )\n ? activeLegendItemId\n : null;\n const getSeriesOpacity = (id: string) =>\n emphasizedId != null && id !== emphasizedId ? CHART_DIMMED_OPACITY : 1;\n\n return {\n layouts,\n summary: plottedSeries\n .map(\n (item) =>\n `${item.label}: ${axes\n .map(\n (axis, index) =>\n `${axis.label} ${formatValue(item.values[index])}`\n )\n .join(', ')}`\n )\n .join('; '),\n marks: (\n <>\n {/* Draw the emphasized series last so its outline sits on top. */}\n {[\n ...plottedSeries.filter(({ id }) => id !== emphasizedId),\n ...plottedSeries.filter(({ id }) => id === emphasizedId),\n ].map((item) => {\n const isEmphasized = item.id === emphasizedId;\n return (\n <polygon\n key={item.id}\n aria-hidden=\"true\"\n points={toPoints(item.points)}\n fill={item.fill}\n fillOpacity={\n isEmphasized\n ? EMPHASIZED_SERIES_FILL_OPACITY\n : emphasizedId == null\n ? SERIES_FILL_OPACITY\n : 0\n }\n className=\"transition-[opacity,fill-opacity] duration-fast motion-reduce:transition-none\"\n opacity={getSeriesOpacity(item.id)}\n stroke={item.color}\n strokeWidth={1.5}\n strokeLinejoin=\"round\"\n />\n );\n })}\n {axes.map((axis, index) => {\n const layout = layouts[index];\n const values = plottedSeries.map((item) => ({\n id: item.id,\n label: item.label,\n value: item.values[index],\n color: item.color,\n }));\n const summary = values.length\n ? `${axis.label}: ${values\n .map(({ label, value }) => `${label} ${formatValue(value)}`)\n .join(', ')}`\n : axis.label;\n const [outerX, outerY] = getPoint(layout, 1);\n const [previousX, previousY] = getPoint(\n layouts[(index - 1 + layouts.length) % layouts.length],\n 1\n );\n const [nextX, nextY] = getPoint(\n layouts[(index + 1) % layouts.length],\n 1\n );\n const mark = (\n <g\n key={axis.id}\n className=\"group outline-hidden\"\n role={isInteractive ? 'img' : undefined}\n aria-label={isInteractive ? summary : undefined}\n aria-hidden={isInteractive ? undefined : true}\n tabIndex={isInteractive ? 0 : undefined}\n >\n {/* Each axis owns the sector between its neighbors' edge\n midpoints, so hovering anywhere in the plot inspects the\n nearest axis. */}\n <polygon\n points={toPoints([\n [CENTER_X, CENTER_Y],\n [(previousX + outerX) / 2, (previousY + outerY) / 2],\n [outerX, outerY],\n [(outerX + nextX) / 2, (outerY + nextY) / 2],\n ])}\n fill=\"transparent\"\n />\n {/* Hover strengthens the spoke and reveals each series'\n vertex; keyboard focus uses the shared focus color. */}\n <g className=\"opacity-0 transition-opacity duration-fast group-hover:opacity-100 group-focus-visible:opacity-100 motion-reduce:transition-none\">\n <line\n x1={CENTER_X}\n y1={CENTER_Y}\n x2={outerX}\n y2={outerY}\n stroke=\"var(--border-default)\"\n className=\"group-focus-visible:stroke-focus\"\n />\n {plottedSeries.map((item) => (\n <circle\n key={item.id}\n cx={item.points[index][0]}\n cy={item.points[index][1]}\n r={3.5}\n fill={item.color}\n opacity={getSeriesOpacity(item.id)}\n // A surface-colored separator keeps coincident vertices distinct.\n className=\"stroke-surface-level-1\"\n strokeWidth={1.5}\n />\n ))}\n </g>\n {renderLabel(\n layout,\n LABEL_LINE_HEIGHT,\n summary,\n <Text variant=\"xs\" className=\"truncate\">\n {axis.label}\n </Text>\n )}\n </g>\n );\n return renderAxisTooltip\n ? withTooltip(\n axis.id,\n mark,\n renderAxisTooltip({ id: axis.id, label: axis.label, values }),\n layout\n )\n : mark;\n })}\n </>\n ),\n };\n };\n\n const axisCount = (props.series !== undefined ? props.axes : props.data)\n .length;\n const chart =\n axisCount < 3\n ? null\n : props.series !== undefined\n ? renderMultiSeries(props.axes, props.series, props.renderAxisTooltip)\n : renderSingleSeries(props.data, props.renderTooltip);\n\n return (\n <div className={cn('w-full overflow-x-auto', className)} {...divProps}>\n {chart === null ? (\n <div className=\"flex h-80 items-center justify-center\" role=\"status\">\n <Text variant=\"sm\" color=\"secondary\">\n At least three axes are needed to display a radar chart.\n </Text>\n </div>\n ) : (\n <TooltipPrimitive.Provider\n // Brief hover delay avoids flashes when crossing between axes.\n delayDuration={150}\n >\n <svg\n viewBox={`0 0 ${VIEWBOX_WIDTH} ${VIEWBOX_HEIGHT}`}\n className=\"block w-full\"\n // Preserve the labels' base font size; narrow containers scroll.\n style={{ minWidth: VIEWBOX_WIDTH }}\n role={isInteractive ? 'group' : 'img'}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={[summaryId, ariaDescribedBy]\n .filter(Boolean)\n .join(' ')}\n >\n <desc id={summaryId}>{chart.summary}</desc>\n <g aria-hidden=\"true\" fill=\"none\" stroke=\"var(--border-subtle)\">\n {GRID_LEVELS.map((level) => (\n <polygon\n key={level}\n points={toPoints(\n chart.layouts.map((layout) => getPoint(layout, level))\n )}\n />\n ))}\n {chart.layouts.map((layout) => {\n const [x, y] = getPoint(layout, 1);\n return (\n <line\n key={layout.id}\n x1={CENTER_X}\n y1={CENTER_Y}\n x2={x}\n y2={y}\n />\n );\n })}\n </g>\n {chart.marks}\n </svg>\n </TooltipPrimitive.Provider>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;AA8HA,IAAM,kBAAkB,IAAI,KAAK,aAAa,OAAO;AACrD,IAAM,gBAAgB,UAAkB,gBAAgB,OAAO,KAAK;AACpE,IAAM,YAAY,UAChB,UAAU,KAAA,KAAa,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI;AAGvE,IAAM,gBAAgB;AACtB,IAAM,iBAAiB;AACvB,IAAM,WAAW,gBAAgB;AACjC,IAAM,WAAW,iBAAiB;AAElC,IAAM,SAAS;AACf,IAAM,eAAe;AAGrB,IAAM,cAAc;AACpB,IAAM,oBAAoB;AAE1B,IAAM,cAAc;CAClB,MAAM;EAAE,QAAQ;EAAa,OAAO;EAAc,cAAc;CAAQ;CACxE,QAAQ;EACN,QAAQ,cAAc;EACtB,OAAO;EACP,cAAc;CAChB;CACA,OAAO;EAAE,QAAQ;EAAG,OAAO;EAAa,cAAc;CAAM;AAC9D;AAIA,IAAM,cAAc;CAAC;CAAM;CAAK;CAAM;AAAC;AAIvC,IAAM,sBAAsB;AAC5B,IAAM,iCAAiC;AAEvC,IAAM,kBACJ,MACA,gBAEA,KAAK,KAAK,EAAE,MAAM,UAAU;CAC1B,MAAM,QAAS,QAAQ,KAAK,KAAK,IA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