@carto/ps-react-ui 4.17.3 → 4.19.0
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/category-Ct2BzADB.js +753 -0
- package/dist/category-Ct2BzADB.js.map +1 -0
- package/dist/change-column-Fu1DCYQ3.js +1186 -0
- package/dist/change-column-Fu1DCYQ3.js.map +1 -0
- package/dist/echart-B10dhEaM.js +262 -0
- package/dist/echart-B10dhEaM.js.map +1 -0
- package/dist/types/widgets-v2/actions/change-column/labels.d.ts +1 -0
- package/dist/types/widgets-v2/actions/change-column/style.d.ts +28 -2
- package/dist/types/widgets-v2/actions/lock-selection/lock-selection.d.ts +15 -5
- package/dist/types/widgets-v2/category/components/category-legend.d.ts +18 -2
- package/dist/types/widgets-v2/category/components/category-row-stacked.d.ts +6 -1
- package/dist/types/widgets-v2/category/style.d.ts +8 -0
- package/dist/types/widgets-v2/echart/use-chart-selection.d.ts +10 -4
- package/dist/types/widgets-v2/histogram/index.d.ts +1 -1
- package/dist/types/widgets-v2/histogram/transforms.d.ts +11 -0
- package/dist/types/widgets-v2/histogram/types.d.ts +9 -0
- package/dist/types/widgets-v2/scatterplot/index.d.ts +1 -1
- package/dist/types/widgets-v2/scatterplot/transforms.d.ts +9 -0
- package/dist/types/widgets-v2/table/index.d.ts +1 -0
- package/dist/types/widgets-v2/table/transforms.d.ts +13 -0
- package/dist/types/widgets-v2/table/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/timeseries/index.d.ts +1 -0
- package/dist/types/widgets-v2/timeseries/transforms.d.ts +10 -0
- package/dist/types/widgets-v2/timeseries/transforms.test.d.ts +1 -0
- package/dist/widgets-v2/actions.js +1 -1
- package/dist/widgets-v2/category.js +1 -1
- package/dist/widgets-v2/echart.js +1 -1
- package/dist/widgets-v2/echart.js.map +1 -1
- package/dist/widgets-v2/histogram.js +181 -158
- package/dist/widgets-v2/histogram.js.map +1 -1
- package/dist/widgets-v2/pie.js +155 -116
- package/dist/widgets-v2/pie.js.map +1 -1
- package/dist/widgets-v2/scatterplot.js +91 -85
- package/dist/widgets-v2/scatterplot.js.map +1 -1
- package/dist/widgets-v2/table.js +55 -45
- package/dist/widgets-v2/table.js.map +1 -1
- package/dist/widgets-v2/timeseries.js +96 -85
- package/dist/widgets-v2/timeseries.js.map +1 -1
- package/dist/widgets-v2.js +4 -4
- package/package.json +1 -1
- package/src/widgets-v2/actions/change-column/change-column.tsx +10 -1
- package/src/widgets-v2/actions/change-column/labels.ts +2 -0
- package/src/widgets-v2/actions/change-column/sortable-column-item.tsx +8 -1
- package/src/widgets-v2/actions/change-column/style.ts +28 -2
- package/src/widgets-v2/actions/lock-selection/lock-selection.test.tsx +62 -0
- package/src/widgets-v2/actions/lock-selection/lock-selection.tsx +45 -13
- package/src/widgets-v2/category/category-ui.test.tsx +55 -0
- package/src/widgets-v2/category/category-ui.tsx +65 -6
- package/src/widgets-v2/category/components/category-legend.test.tsx +53 -2
- package/src/widgets-v2/category/components/category-legend.tsx +55 -12
- package/src/widgets-v2/category/components/category-row-stacked.test.tsx +7 -3
- package/src/widgets-v2/category/components/category-row-stacked.tsx +8 -3
- package/src/widgets-v2/category/style.ts +10 -2
- package/src/widgets-v2/echart/echart-ui.test.tsx +25 -0
- package/src/widgets-v2/echart/echart-ui.tsx +20 -0
- package/src/widgets-v2/echart/use-chart-selection.test.tsx +3 -1
- package/src/widgets-v2/echart/use-chart-selection.ts +10 -4
- package/src/widgets-v2/histogram/index.ts +4 -1
- package/src/widgets-v2/histogram/options.test.ts +86 -0
- package/src/widgets-v2/histogram/options.ts +50 -0
- package/src/widgets-v2/histogram/transforms.test.ts +36 -1
- package/src/widgets-v2/histogram/transforms.ts +23 -0
- package/src/widgets-v2/histogram/types.ts +9 -0
- package/src/widgets-v2/pie/options.test.ts +262 -0
- package/src/widgets-v2/pie/options.ts +80 -5
- package/src/widgets-v2/scatterplot/index.ts +4 -1
- package/src/widgets-v2/scatterplot/transforms.test.ts +38 -1
- package/src/widgets-v2/scatterplot/transforms.ts +23 -0
- package/src/widgets-v2/table/index.ts +1 -0
- package/src/widgets-v2/table/transforms.test.ts +40 -0
- package/src/widgets-v2/table/transforms.ts +26 -0
- package/src/widgets-v2/timeseries/index.ts +1 -0
- package/src/widgets-v2/timeseries/transforms.test.ts +49 -0
- package/src/widgets-v2/timeseries/transforms.ts +31 -0
- package/dist/category-CGS_eHr4.js +0 -719
- package/dist/category-CGS_eHr4.js.map +0 -1
- package/dist/change-column-CiVAjOUB.js +0 -1143
- package/dist/change-column-CiVAjOUB.js.map +0 -1
- package/dist/echart-Bdvbfx9s.js +0 -250
- package/dist/echart-Bdvbfx9s.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"change-column-CiVAjOUB.js","sources":["../src/widgets-v2/actions/searcher/filter.ts","../src/widgets-v2/actions/searcher/labels.ts","../src/widgets-v2/actions/searcher/style.ts","../src/widgets-v2/actions/searcher/searcher-toggle.tsx","../src/widgets-v2/actions/searcher/searcher.tsx","../src/widgets-v2/actions/stack-toggle/transforms.ts","../src/widgets-v2/actions/stack-toggle/labels.ts","../src/widgets-v2/actions/stack-toggle/style.ts","../src/widgets-v2/actions/stack-toggle/stack-toggle.tsx","../src/widgets-v2/actions/show-all/labels.ts","../src/widgets-v2/actions/show-all/style.ts","../src/widgets-v2/actions/show-all/show-all.tsx","../src/widgets-v2/actions/zoom-toggle/labels.ts","../src/widgets-v2/actions/zoom-toggle/style.ts","../src/widgets-v2/actions/zoom-toggle/zoom-toggle.tsx","../src/widgets-v2/actions/brush-toggle/transforms.ts","../src/widgets-v2/actions/brush-toggle/labels.ts","../src/widgets-v2/actions/brush-toggle/style.ts","../src/widgets-v2/actions/brush-toggle/brush-toggle.tsx","../src/widgets-v2/actions/relative-data/transforms.ts","../src/widgets-v2/actions/relative-data/labels.ts","../src/widgets-v2/actions/relative-data/style.ts","../src/widgets-v2/actions/relative-data/relative-data.tsx","../src/widgets-v2/actions/download/labels.ts","../src/widgets-v2/actions/download/download.tsx","../src/widgets-v2/actions/fullscreen/labels.ts","../src/widgets-v2/actions/fullscreen/style.ts","../src/widgets-v2/actions/fullscreen/fullscreen.tsx","../src/widgets-v2/actions/lock-selection/transforms.ts","../src/widgets-v2/actions/lock-selection/labels.ts","../src/widgets-v2/actions/lock-selection/style.ts","../src/widgets-v2/actions/lock-selection/lock-selection.tsx","../src/widgets-v2/actions/change-column/change-column-icon.tsx","../src/widgets-v2/actions/change-column/labels.ts","../src/widgets-v2/actions/change-column/style.ts","../src/widgets-v2/actions/change-column/sortable-column-item.tsx","../src/widgets-v2/actions/change-column/change-column.tsx"],"sourcesContent":["/**\n * Filters a 2D series of `{name, ...}` records by case-insensitive substring on\n * the `name` field. Keeps the dataset shape (one inner array per series).\n * Used by the Searcher action's data transform.\n */\nexport function filterBySearchText(input: unknown, search: string): unknown {\n if (!search) return input\n const needle = search.toLowerCase()\n if (!Array.isArray(input)) return input\n return input.map((series: unknown): unknown => {\n if (!Array.isArray(series)) return series\n return series.filter((item: unknown) => {\n if (item == null) return false\n if (typeof item === 'object' && 'name' in item) {\n const rawName = (item as { name: unknown }).name\n const name = rawName == null ? '' : stringifyPrimitive(rawName)\n return name.toLowerCase().includes(needle)\n }\n return stringifyPrimitive(item).toLowerCase().includes(needle)\n })\n })\n}\n\nfunction stringifyPrimitive(v: unknown): string {\n if (typeof v === 'string') return v\n if (typeof v === 'number' || typeof v === 'boolean') return String(v)\n return ''\n}\n","export interface SearcherLabels {\n toggle: string\n placeholder: string\n clearAriaLabel: string\n noResults: string\n}\n\nexport const DEFAULT_SEARCHER_LABELS: SearcherLabels = {\n toggle: 'Search',\n placeholder: 'Search…',\n clearAriaLabel: 'Clear search',\n noResults: 'No matches.',\n}\n","import type { SxProps, Theme } from '@mui/material'\n\nexport const styles = {\n toggle: {\n p: 0.5,\n '& .MuiSvgIcon-root': { fontSize: 20 },\n },\n toggleActive: {\n background: (theme: Theme) => theme.palette.primary.relatedLight,\n },\n input: {\n width: '100%',\n mb: 1,\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { useCallback, type ComponentType } from 'react'\nimport { IconButton, type SvgIconProps } from '@mui/material'\nimport { Search as SearchIcon } from '@mui/icons-material'\nimport { Tooltip } from '../../../components'\nimport {\n getWidgetStore,\n useSingleTransform,\n useWidget,\n useWidgetId,\n} from '../../stores'\nimport { filterBySearchText } from './filter'\nimport { DEFAULT_SEARCHER_LABELS, type SearcherLabels } from './labels'\nimport { styles } from './style'\n\nconst SEARCHER_DESCRIPTOR = {\n id: 'searcher',\n type: 'data' as const,\n order: 20,\n disables: ['lock-selection'],\n}\n\nexport interface SearcherToggleProps {\n labels?: Partial<SearcherLabels>\n icon?: ComponentType<SvgIconProps>\n iconProps?: SvgIconProps\n /**\n * Whether the searcher transform is enabled on first mount. Defaults\n * to `false` so the toggle renders un-pressed and the\n * `filterBySearchText` transform stays dormant until the user clicks\n * it. Set to `true` for search-first widgets where the input is the\n * primary affordance.\n */\n initialEnabled?: boolean\n}\n\nexport function SearcherToggle({\n labels,\n icon: Icon = SearchIcon,\n iconProps,\n initialEnabled = false,\n}: SearcherToggleProps) {\n const id = useWidgetId()\n const resolved = { ...DEFAULT_SEARCHER_LABELS, ...labels }\n const text = useWidget(\n id,\n (s) => (s.transformStates.searcher?.searchText as string | undefined) ?? '',\n )\n\n // The transform fn closes over `text`. Memoize via useCallback so identity\n // only changes when text changes, allowing useTransform to re-register.\n const fn = useCallback(\n (data: unknown) => filterBySearchText(data, text),\n [text],\n )\n\n const { enabled, toggle } = useSingleTransform(id, SEARCHER_DESCRIPTOR, fn, {\n initialEnabled,\n })\n\n return (\n <Tooltip title={resolved.toggle}>\n <IconButton\n size='small'\n aria-label={resolved.toggle}\n aria-pressed={enabled}\n onClick={toggle}\n sx={{ ...styles.toggle, ...(enabled && styles.toggleActive) }}\n >\n <Icon fontSize='small' {...iconProps} />\n </IconButton>\n </Tooltip>\n )\n}\n\n/**\n * Imperatively writes the search text into the widget store. Used by the\n * Searcher input to update text inside transformStates without going through\n * a re-rendered React subscription.\n */\nexport function setSearcherText(widgetId: string, value: string): void {\n getWidgetStore(widgetId).setState((s) => ({\n transformStates: {\n ...s.transformStates,\n searcher: {\n enabled: s.transformStates.searcher?.enabled ?? false,\n ...s.transformStates.searcher,\n searchText: value,\n },\n },\n }))\n}\n","import { useCallback, useMemo, useRef, useState } from 'react'\nimport { IconButton, InputAdornment, TextField } from '@mui/material'\nimport { Search as SearchIcon } from '@mui/icons-material'\nimport { Clear as ClearIcon } from '@mui/icons-material'\nimport { debounce } from '@carto/ps-utils'\nimport { getWidgetStore, useWidget, useWidgetId } from '../../stores'\nimport { setSearcherText } from './searcher-toggle'\nimport { DEFAULT_SEARCHER_LABELS, type SearcherLabels } from './labels'\nimport { styles } from './style'\n\nexport interface SearcherProps {\n labels?: Partial<SearcherLabels>\n /** Debounce delay before the input value is written to the widget store. */\n debounceMs?: number\n}\n\nconst DEFAULT_DEBOUNCE = 300\n\n/**\n * Renders only when the matching `<SearcherToggle />` is enabled — drives the\n * `transformStates['searcher'].searchText` field via a debounced setter.\n */\nexport function Searcher({\n labels,\n debounceMs = DEFAULT_DEBOUNCE,\n}: SearcherProps) {\n const id = useWidgetId()\n const resolved = { ...DEFAULT_SEARCHER_LABELS, ...labels }\n const enabled = useWidget(\n id,\n (s) => s.transformStates.searcher?.enabled ?? false,\n )\n\n const inputRef = useRef<HTMLInputElement | null>(null)\n\n // Hydrate from the store so re-toggling the input preserves any prior text.\n const [local, setLocal] = useState<string>(\n () =>\n (getWidgetStore(id).getState().transformStates.searcher?.searchText as\n | string\n | undefined) ?? '',\n )\n\n const debouncedWrite = useMemo(\n () =>\n debounce(\n (value: unknown) => setSearcherText(id, value as string),\n debounceMs,\n ),\n [id, debounceMs],\n )\n\n const handleSearchTextChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const value = e.target.value\n setLocal(value)\n debouncedWrite(value)\n },\n [debouncedWrite],\n )\n\n const handleClear = useCallback(() => {\n setLocal('')\n setSearcherText(id, '')\n // Re-arm the debounced timer with '' so any pending stale write resolves\n // to the cleared value rather than re-applying the previous text.\n debouncedWrite('')\n inputRef.current?.focus()\n }, [id, debouncedWrite])\n\n if (!enabled) return null\n\n return (\n <TextField\n inputRef={inputRef}\n size='small'\n fullWidth\n variant='filled'\n placeholder={resolved.placeholder}\n value={local}\n onChange={handleSearchTextChange}\n // The Searcher only mounts when the user explicitly toggles the\n // SearcherToggle action — focusing the input on mount matches user\n // intent, so the jsx-a11y/no-autofocus warning is the false-positive\n // case (the rule targets unsolicited autofocus that disorients\n // screen readers).\n // eslint-disable-next-line\n autoFocus\n aria-label={resolved.placeholder}\n sx={styles.input}\n InputProps={{\n startAdornment: (\n <InputAdornment position='start'>\n <SearchIcon fontSize='small' />\n </InputAdornment>\n ),\n endAdornment: local ? (\n <InputAdornment position='end'>\n <IconButton\n size='small'\n edge='end'\n aria-label={resolved.clearAriaLabel}\n onClick={handleClear}\n >\n <ClearIcon fontSize='small' />\n </IconButton>\n </InputAdornment>\n ) : null,\n }}\n />\n )\n}\n","/**\n * Stack-mode config transform: marks every series with `stack: 'total'` so\n * ECharts stacks them vertically (bar) or by value (line). Module-level\n * constant so identity is stable across renders — no `useCallback` needed.\n *\n * Widgets that bake series into options at build time get marked in place.\n * Widgets that build series at data-fusion time (`bar`, `histogram`,\n * `timeseries`) have no `series` array yet at config-transform time, so we\n * also emit a single-entry **broadcast template** (`[{ stack: 'total' }]`).\n * Their option factories merge that template into every series they emit\n * at fusion time, so the `stack` mark survives end-to-end.\n */\nexport const addStack = (option: unknown): unknown => {\n if (option == null || typeof option !== 'object') return option\n const cfg = option as Record<string, unknown>\n const existing = Array.isArray(cfg.series) ? cfg.series : []\n const series =\n existing.length === 0\n ? [{ stack: 'total' }]\n : existing.map((s: unknown): unknown => {\n if (s == null || typeof s !== 'object') return s\n return { ...s, stack: 'total' }\n })\n return { ...cfg, series }\n}\n","export interface StackToggleLabels {\n on: string\n off: string\n}\n\nexport const DEFAULT_STACK_TOGGLE_LABELS: StackToggleLabels = {\n on: 'Unstack series',\n off: 'Stack series',\n}\n","import type { SxProps, Theme } from '@mui/material'\n\nexport const styles = {\n toggle: {\n p: 0.5,\n '& .MuiSvgIcon-root': { fontSize: 20 },\n },\n toggleActive: {\n background: (theme: Theme) => theme.palette.primary.relatedLight,\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { type ComponentType } from 'react'\nimport { IconButton, type SvgIconProps } from '@mui/material'\nimport { StackedBarChart as StackedBarChartIcon } from '@mui/icons-material'\nimport { Tooltip } from '../../../components'\nimport { useSingleTransform, useWidgetId } from '../../stores'\nimport { addStack } from './transforms'\nimport { DEFAULT_STACK_TOGGLE_LABELS, type StackToggleLabels } from './labels'\nimport { styles } from './style'\n\nconst STACK_DESCRIPTOR = {\n id: 'stack-toggle',\n type: 'config' as const,\n order: 30,\n}\n\nexport interface StackToggleProps {\n initialEnabled?: boolean\n labels?: Partial<StackToggleLabels>\n icon?: ComponentType<SvgIconProps>\n iconProps?: SvgIconProps\n}\n\nexport function StackToggle({\n initialEnabled = false,\n labels,\n icon: Icon = StackedBarChartIcon,\n iconProps,\n}: StackToggleProps) {\n const id = useWidgetId()\n const _labels = { ...DEFAULT_STACK_TOGGLE_LABELS, ...labels }\n const { enabled, toggle } = useSingleTransform(\n id,\n STACK_DESCRIPTOR,\n addStack,\n {\n initialEnabled,\n },\n )\n const tooltip = enabled ? _labels.on : _labels.off\n\n return (\n <Tooltip title={tooltip}>\n <IconButton\n size='small'\n aria-label={tooltip}\n aria-pressed={enabled}\n onClick={toggle}\n sx={{ ...styles.toggle, ...(enabled && styles.toggleActive) }}\n >\n <Icon fontSize='small' {...iconProps} />\n </IconButton>\n </Tooltip>\n )\n}\n","export interface ShowAllLabels {\n /** Tooltip + aria-label for the collapse (✕) button shown while expanded. */\n toggle: string\n}\n\nexport const DEFAULT_SHOW_ALL_LABELS: ShowAllLabels = {\n toggle: 'Show less',\n}\n","import type { SxProps, Theme } from '@mui/material'\n\nexport const styles = {\n toggle: {\n p: 0.5,\n '& .MuiSvgIcon-root': { fontSize: 20 },\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { type ComponentType } from 'react'\nimport { IconButton, type SvgIconProps } from '@mui/material'\nimport { Close as CloseIcon } from '@mui/icons-material'\nimport { Tooltip } from '../../../components'\nimport { getWidgetStore, useWidgetId } from '../../stores'\nimport { DEFAULT_SHOW_ALL_LABELS, type ShowAllLabels } from './labels'\nimport { styles } from './style'\n\n/**\n * The `show-all` flag is a pure UI signal (no data/config transform): the\n * Category overflow row writes it `true` via {@link setShowAll}, the\n * composer reads it with `useTransformEnabled(id, SHOW_ALL_ID)` to drop the\n * row cap, and this button writes it back `false` to collapse. Stored under\n * `transformStates` so `useTransformEnabled` can observe it like any other\n * action flag — but it never registers a pipeline transform, so toggling it\n * never re-runs the data pipeline.\n */\nexport const SHOW_ALL_ID = 'show-all'\n\nexport interface ShowAllToggleProps {\n labels?: Partial<ShowAllLabels>\n icon?: ComponentType<SvgIconProps>\n iconProps?: SvgIconProps\n}\n\n/**\n * Collapse (✕) affordance shown while a widget is expanded into its\n * \"show all\" state. Clicking it clears the `show-all` flag, returning the\n * widget to its capped view. Mount it conditionally (only while the flag is\n * set) so it doesn't occupy a `Widget.Toolbox` visibility-budget slot when\n * the widget is collapsed.\n */\nexport function ShowAllToggle({\n labels,\n icon: Icon = CloseIcon,\n iconProps,\n}: ShowAllToggleProps) {\n const id = useWidgetId()\n const _labels = { ...DEFAULT_SHOW_ALL_LABELS, ...labels }\n\n return (\n <Tooltip title={_labels.toggle}>\n <IconButton\n size='small'\n aria-label={_labels.toggle}\n aria-pressed\n onClick={() => setShowAll(id, false)}\n sx={styles.toggle}\n >\n <Icon fontSize='small' {...iconProps} />\n </IconButton>\n </Tooltip>\n )\n}\n\n/**\n * Imperatively writes the `show-all` flag into the widget store. Mirrors\n * {@link setSearcherText} — used by the Category overflow row (to expand)\n * and the {@link ShowAllToggle} button (to collapse) without routing through\n * a re-rendered subscription.\n */\nexport function setShowAll(widgetId: string, value: boolean): void {\n getWidgetStore(widgetId).setState((s) => ({\n transformStates: {\n ...s.transformStates,\n [SHOW_ALL_ID]: {\n ...s.transformStates[SHOW_ALL_ID],\n enabled: value,\n },\n },\n }))\n}\n","export interface ZoomToggleLabels {\n on: string\n off: string\n}\n\nexport const DEFAULT_ZOOM_TOGGLE_LABELS: ZoomToggleLabels = {\n on: 'Disable zoom',\n off: 'Enable zoom',\n}\n","import type { SxProps, Theme } from '@mui/material'\n\nexport const styles = {\n toggle: {\n p: 0.5,\n '& .MuiSvgIcon-root': { fontSize: 20 },\n },\n toggleActive: {\n background: (theme: Theme) => theme.palette.primary.relatedLight,\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { useCallback, useMemo, type ComponentType } from 'react'\nimport { IconButton, useTheme, type SvgIconProps } from '@mui/material'\nimport { ZoomIn as ZoomInIcon } from '@mui/icons-material'\nimport { Tooltip } from '../../../components'\nimport {\n getEchartInstance,\n useSingleTransform,\n useWidgetId,\n} from '../../stores'\nimport { createAddZoom, type ZoomAxis } from './transforms'\nimport { DEFAULT_ZOOM_TOGGLE_LABELS, type ZoomToggleLabels } from './labels'\nimport { styles } from './style'\n\nconst ZOOM_DESCRIPTOR = {\n id: 'zoom-toggle',\n type: 'config' as const,\n order: 20,\n}\n\nexport interface ZoomToggleProps {\n initialEnabled?: boolean\n labels?: Partial<ZoomToggleLabels>\n icon?: ComponentType<SvgIconProps>\n iconProps?: SvgIconProps\n /**\n * Which axes the zoom controls. Default `['x']` — matches bar /\n * histogram / timeseries (horizontal pan on the category axis). Pass\n * `['x', 'y']` for 2D zoom on a scatterplot-style chart (mouse-wheel\n * scales both axes; horizontal slider at bottom + vertical slider on\n * the right).\n */\n axes?: readonly ZoomAxis[]\n}\n\n/**\n * Toggle a `dataZoom` slider + wheel-zoom on the chart. The transform is\n * theme-bound so the slider gets v1's CARTO chrome (blue-tinted filler,\n * secondary-color preview, white pill handles).\n *\n * `dataZoom` is intentionally NOT in `replaceMergeKeys` — ECharts merges\n * subsequent `setOption` calls so the user's dragged range survives\n * unrelated re-renders (data updates, formatter swaps, RelativeData toggles).\n *\n * On disable the transform is unregistered, but ECharts' merge semantics\n * would otherwise *keep* the live `dataZoom` component visible. To remove\n * the slider immediately we issue a one-shot\n * `setOption({}, { replaceMerge: ['dataZoom'] })` against the live chart\n * instance via {@link getEchartInstance} — this bypasses the pipeline so\n * unrelated transforms aren't disturbed.\n */\nexport function ZoomToggle({\n initialEnabled = false,\n labels,\n icon: Icon = ZoomInIcon,\n iconProps,\n axes,\n}: ZoomToggleProps) {\n const id = useWidgetId()\n const theme = useTheme()\n const _labels = { ...DEFAULT_ZOOM_TOGGLE_LABELS, ...labels }\n // Reduce `axes` to two structural booleans before memoizing so the memo\n // depends on stable primitive values, not an array reference (callers\n // typically pass an inline `axes={['x', 'y']}` literal that changes\n // identity each render). Default — no `axes` prop — is x-axis only,\n // matching `createAddZoom`'s default.\n const includeX = axes ? axes.includes('x') : true\n const includeY = axes ? axes.includes('y') : false\n const transform = useMemo(() => {\n const resolved: ZoomAxis[] = []\n if (includeX) resolved.push('x')\n if (includeY) resolved.push('y')\n return createAddZoom(theme, { axes: resolved })\n }, [theme, includeX, includeY])\n const { enabled, toggle } = useSingleTransform(\n id,\n ZOOM_DESCRIPTOR,\n transform,\n { initialEnabled },\n )\n\n const handleToggle = useCallback(() => {\n if (enabled) {\n // About to disable — clear the dataZoom component on the live\n // instance so the slider disappears immediately.\n getEchartInstance(id)?.setOption({}, { replaceMerge: ['dataZoom'] })\n }\n toggle()\n }, [enabled, toggle, id])\n\n const tooltip = enabled ? _labels.on : _labels.off\n\n return (\n <Tooltip title={tooltip}>\n <IconButton\n size='small'\n aria-label={tooltip}\n aria-pressed={enabled}\n onClick={handleToggle}\n className={enabled ? 'active' : undefined}\n sx={{ ...styles.toggle, ...(enabled && styles.toggleActive) }}\n >\n <Icon fontSize='small' {...iconProps} />\n </IconButton>\n </Tooltip>\n )\n}\n","/**\n * Brush config transform: enables ECharts' brush component on the option\n * object. Module-level constant — identity stable across renders.\n *\n * Pairs with `replaceMergeKeys: ['brush']` so the pipeline replaces (not\n * merges) the brush config on every config-pipeline run. v1 needed a\n * mousemove re-dispatch hack to keep the brush state across data updates;\n * v2 keeps brush state continuous via `notMerge: false` + dynamic\n * replaceMerge in the EchartUI layer (D6) — no hack required.\n */\nexport const addBrush = (option: unknown): unknown => {\n if (option == null || typeof option !== 'object') return option\n const cfg = option as Record<string, unknown>\n return {\n ...cfg,\n brush: {\n toolbox: ['rect', 'clear'],\n xAxisIndex: 'all',\n brushLink: 'all',\n outOfBrush: { colorAlpha: 0.15 },\n },\n toolbox: {\n ...((cfg.toolbox as object | undefined) ?? {}),\n show: false,\n feature: {\n ...((cfg.toolbox as { feature?: object } | undefined)?.feature ?? {}),\n brush: { type: ['rect', 'clear'] },\n },\n },\n }\n}\n","export interface BrushToggleLabels {\n on: string\n off: string\n}\n\nexport const DEFAULT_BRUSH_TOGGLE_LABELS: BrushToggleLabels = {\n on: 'Disable brush selection',\n off: 'Enable brush selection',\n}\n","import type { SxProps, Theme } from '@mui/material'\n\nexport const styles = {\n toggle: {\n p: 0.5,\n '& .MuiSvgIcon-root': { fontSize: 20 },\n },\n toggleActive: {\n background: (theme: Theme) => theme.palette.primary.relatedLight,\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { useEffect, type ComponentType } from 'react'\nimport { IconButton, type SvgIconProps } from '@mui/material'\nimport { HighlightAlt as HighlightAltIcon } from '@mui/icons-material'\nimport { Tooltip } from '../../../components'\nimport {\n useEchartInstance,\n useSingleTransform,\n useWidgetId,\n} from '../../stores'\nimport { addBrush } from './transforms'\nimport { DEFAULT_BRUSH_TOGGLE_LABELS, type BrushToggleLabels } from './labels'\nimport { styles } from './style'\n\nconst BRUSH_DESCRIPTOR = {\n id: 'brush-toggle',\n type: 'config' as const,\n order: 25,\n}\n\nexport interface BrushToggleProps {\n initialEnabled?: boolean\n /**\n * ECharts brush type. `'lineX'` (default) selects a range on the\n * x-axis — appropriate for bar / histogram / timeseries. `'rect'`\n * selects a 2-D rectangle — use for scatterplot. Other ECharts\n * brush types (`'lineY'`, `'polygon'`) are also accepted.\n */\n brushType?: 'lineX' | 'lineY' | 'rect' | 'polygon'\n /**\n * `'multiple'` (default) lets the user draw additional brushes on\n * top of existing ones. `'single'` replaces the previous brush on\n * each new draw.\n */\n brushMode?: 'multiple' | 'single'\n /**\n * Optional view of the consumer-owned selection. When provided and\n * the array is empty (`[]`), any brush rectangles currently drawn on\n * the chart are wiped — keeps the UI in sync when the parent clears\n * the selection externally (e.g. via `Widget.SelectionSummary`'s\n * `onClear`). Pass the same array that drives `useChartSelection` /\n * the option factory's `selection` input.\n *\n * Leave `undefined` to opt out — the sync effect becomes a no-op.\n */\n selection?: readonly unknown[] | null\n labels?: Partial<BrushToggleLabels>\n icon?: ComponentType<SvgIconProps>\n iconProps?: SvgIconProps\n}\n\n/**\n * Toggle ECharts' brush selection mode. Two-part wiring:\n *\n * 1. The config transform (`addBrush`) installs the `brush`\n * component on the option so brushed items get the\n * `outOfBrush` dim treatment.\n * 2. ECharts only enters \"brush cursor\" mode when something\n * dispatches `takeGlobalCursor({ key: 'brush', ... })`. This\n * component drives that dispatch via {@link useEchartInstance},\n * reacting when the chart instance becomes available (the\n * `BrushToggle` mounts before `Widget.Echart` in tree order, so\n * on first mount the chart isn't ready yet).\n *\n * 3. ECharts clears the global cursor on every `setOption`, so we\n * re-dispatch on each `'finished'` event — required for\n * `brushMode: 'multiple'` to keep working across selection-driven\n * re-renders, RelativeData toggles, etc.\n *\n * Selection events (`brushSelected` / `brushEnd`) flow through the\n * existing `useChartSelection` wiring at the consumer level — no extra\n * plumbing here.\n */\nexport function BrushToggle({\n initialEnabled = false,\n brushType = 'lineX',\n brushMode = 'multiple',\n selection,\n labels,\n icon: Icon = HighlightAltIcon,\n iconProps,\n}: BrushToggleProps) {\n const id = useWidgetId()\n const _labels = { ...DEFAULT_BRUSH_TOGGLE_LABELS, ...labels }\n const { enabled, toggle } = useSingleTransform(\n id,\n BRUSH_DESCRIPTOR,\n addBrush,\n { initialEnabled },\n )\n\n // Reactive read of the live instance — the effect below re-runs when\n // the chart arrives, departs, or re-inits, instead of polling.\n const chart = useEchartInstance(id)\n\n useEffect(() => {\n if (!chart) return undefined\n if (!enabled) {\n // Disabled: exit brush cursor and wipe any drawn rectangles.\n chart.dispatchAction({ type: 'takeGlobalCursor' })\n chart.dispatchAction({ type: 'brush', areas: [] })\n return undefined\n }\n\n const enterBrush = (): void => {\n chart.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'brush',\n brushOption: { brushType, brushMode },\n })\n }\n\n // Every `setOption` clears the global cursor. Re-dispatch after\n // each chart render so `brushMode: 'multiple'` stays usable across\n // selection-driven re-renders, RelativeData toggles, etc.\n const onFinished = (): void => enterBrush()\n chart.on('finished', onFinished)\n enterBrush()\n\n return () => {\n chart.off('finished', onFinished)\n }\n }, [chart, enabled, brushType, brushMode])\n\n // Sync the drawn rectangles with the external selection. When the\n // parent flips `selection` to `[]` (e.g. SelectionSummary's \"Clear\"\n // button), wipe the brush areas so the chart UI matches the data.\n // Dispatching with an empty `areas` array when nothing is drawn is a\n // safe no-op on ECharts, so no extra \"previous value\" bookkeeping is\n // needed. Kept as a separate effect so a parent selection change\n // doesn't tear down / re-attach the `'finished'` listener above.\n useEffect(() => {\n if (!chart || !enabled) return\n if (selection?.length === 0) {\n chart.dispatchAction({ type: 'brush', areas: [] })\n }\n }, [chart, enabled, selection])\n\n const tooltip = enabled ? _labels.on : _labels.off\n\n return (\n <Tooltip title={tooltip}>\n <IconButton\n size='small'\n aria-label={tooltip}\n aria-pressed={enabled}\n onClick={toggle}\n className={enabled ? 'active' : undefined}\n sx={{ ...styles.toggle, ...(enabled && styles.toggleActive) }}\n >\n <Icon fontSize='small' {...iconProps} />\n </IconButton>\n </Tooltip>\n )\n}\n","/**\n * Default data-side transform for `RelativeData`: rewrite each\n * `{ name, value }` datum's `value` to its share of the series total\n * expressed as 0–100 (matches v1's range). The companion percent\n * formatter divides by 100 so it can call `Intl.NumberFormat` with\n * `style: 'percent'`.\n *\n * Used by widgets whose series are arrays of `{ name, value }`\n * objects — bar, pie, timeseries, category. Widgets with a different\n * data shape pass their own transform via\n * `<RelativeData transform={...} />`; see `widgets-v2/histogram` and\n * `widgets-v2/scatterplot` for in-tree examples.\n *\n * The denominator is the sum of |value| across the series so mixed-sign\n * series (e.g. cashflow with inflows + outflows) produce sane signed\n * shares-of-magnitude. A series whose total magnitude is zero (all-zero\n * or empty input) is returned unchanged so a stalled or empty data set\n * doesn't show misleading 0% values. Series whose shape doesn't match\n * the named-value pattern fall through untouched.\n */\n\ninterface NamedValue {\n name: unknown\n value: number\n [k: string]: unknown\n}\n\nfunction isNamedValueArray(v: unknown): v is NamedValue[] {\n if (!Array.isArray(v)) return false\n return v.every(\n (item) =>\n item != null &&\n typeof item === 'object' &&\n 'value' in item &&\n typeof (item as { value: unknown }).value === 'number',\n )\n}\n\nexport const toRelativeData = (input: unknown): unknown => {\n if (!Array.isArray(input)) return input\n return input.map((series: unknown): unknown => {\n if (!isNamedValueArray(series)) return series\n const total = series.reduce((acc, d) => acc + Math.abs(d.value), 0)\n if (total <= 0) return series\n return series.map((d) => ({ ...d, value: (d.value / total) * 100 }))\n })\n}\n\n/**\n * Build a percent formatter using `Intl.NumberFormat`. The returned function\n * expects values in the 0–100 range (output of {@link toRelativeData}) and\n * divides by 100 internally before calling `style: 'percent'`.\n *\n * Locale: passed straight to `Intl.NumberFormat`. Falls back to the runtime\n * default when omitted.\n */\nexport function createPercentFormatter(\n locale?: string,\n): (value: number) => string {\n const fmt = new Intl.NumberFormat(locale, {\n style: 'percent',\n minimumFractionDigits: 0,\n maximumFractionDigits: 2,\n })\n return (value: number) => {\n if (typeof value !== 'number' || !Number.isFinite(value))\n return String(value)\n return fmt.format(value / 100)\n }\n}\n","export interface RelativeDataLabels {\n on: string\n off: string\n}\n\nexport const DEFAULT_RELATIVE_DATA_LABELS: RelativeDataLabels = {\n on: 'Show absolute values',\n off: 'Show relative values',\n}\n","import type { SxProps, Theme } from '@mui/material'\n\nexport const styles = {\n toggle: {\n p: 0.5,\n '& .MuiSvgIcon-root': { fontSize: 20 },\n },\n toggleActive: {\n background: (theme: Theme) => theme.palette.primary.relatedLight,\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { useEffect, useMemo, type ComponentType } from 'react'\nimport { IconButton, type SvgIconProps } from '@mui/material'\nimport { Percent as PercentIcon } from '@mui/icons-material'\nimport { Tooltip } from '../../../components'\nimport {\n getWidgetStore,\n useSingleTransform,\n useWidget,\n useWidgetId,\n} from '../../stores'\nimport { createPercentFormatter, toRelativeData } from './transforms'\nimport { DEFAULT_RELATIVE_DATA_LABELS, type RelativeDataLabels } from './labels'\nimport { styles } from './style'\n\nconst DATA_DESCRIPTOR = {\n id: 'relative-data',\n type: 'data' as const,\n order: 15,\n}\n\nexport interface RelativeDataProps {\n initialEnabled?: boolean\n /**\n * BCP-47 locale tag forwarded to `Intl.NumberFormat`. Defaults to the\n * runtime locale.\n */\n locale?: string\n labels?: Partial<RelativeDataLabels>\n icon?: ComponentType<SvgIconProps>\n iconProps?: SvgIconProps\n /**\n * Data-side transform that rewrites the widget's series into their\n * relative (0–100) form. Defaults to {@link toRelativeData}, which\n * handles the canonical `{ name, value }[]` shape (bar / pie /\n * timeseries / category). Widgets with a different data shape pass\n * their own — `toRelativeHistogramData` for histogram's `number[]`,\n * `toRelativeScatterplotData` for scatter's `[x, y][]`.\n *\n * Should be a stable top-level reference; inline `(data) => ...`\n * literals re-register the transform every render.\n */\n transform?: (data: unknown) => unknown\n}\n\n/**\n * Toggle between absolute and relative (percentage) values.\n *\n * - **Data side**: a single data transform ({@link toRelativeData}) registered\n * through `useSingleTransform`. When disabled, the pipeline skips it and the\n * derived `data` reverts to `rawData` automatically.\n * - **Formatter side**: an effect writes directly to `state.formatter`. When\n * enabled it installs the Intl-based percent formatter; when disabled it\n * reads `state.rawFormatter` (the consumer-supplied original, always live)\n * and writes it back to `formatter`. No \"original\" snapshot is captured —\n * `rawFormatter` is the original.\n */\nexport function RelativeData({\n initialEnabled = false,\n locale,\n labels,\n icon: Icon = PercentIcon,\n iconProps,\n transform,\n}: RelativeDataProps) {\n const id = useWidgetId()\n const _labels = { ...DEFAULT_RELATIVE_DATA_LABELS, ...labels }\n\n const { enabled, toggle } = useSingleTransform(\n id,\n DATA_DESCRIPTOR,\n transform ?? toRelativeData,\n { initialEnabled },\n )\n\n const percentFormatter = useMemo(\n () => createPercentFormatter(locale),\n [locale],\n )\n\n // Subscribe to rawFormatter so the effect re-runs and re-applies after the\n // consumer's formatter prop changes (Provider syncs the new prop to both\n // rawFormatter and formatter — re-applying restores the percent override\n // when relative is on, and tracks the new rawFormatter when off).\n const rawFormatter = useWidget(id, (s) => s.rawFormatter)\n\n useEffect(() => {\n getWidgetStore(id).setState({\n formatter: enabled ? percentFormatter : rawFormatter,\n })\n }, [id, enabled, percentFormatter, rawFormatter])\n\n const tooltip = enabled ? _labels.on : _labels.off\n\n return (\n <Tooltip title={tooltip}>\n <IconButton\n size='small'\n aria-label={tooltip}\n aria-pressed={enabled}\n onClick={toggle}\n sx={{ ...styles.toggle, ...(enabled && styles.toggleActive) }}\n >\n <Icon fontSize='small' {...iconProps} />\n </IconButton>\n </Tooltip>\n )\n}\n","export interface DownloadLabels {\n trigger: string\n /** Tooltip / aria-label shown on the trigger while a download is in flight. */\n loading: string\n /**\n * Tooltip / aria-label shown on the trigger after a download failed. Cleared\n * the next time the menu opens.\n */\n error: string\n}\n\nexport const DEFAULT_DOWNLOAD_LABELS: DownloadLabels = {\n trigger: 'Download',\n loading: 'Downloading…',\n error: 'Download failed',\n}\n","import { useCallback, useState, type ComponentType } from 'react'\nimport {\n CircularProgress,\n IconButton,\n ListItemIcon,\n ListItemText,\n Menu,\n MenuItem,\n type SvgIconProps,\n} from '@mui/material'\nimport { FileDownload as DownloadIcon } from '@mui/icons-material'\nimport { Tooltip } from '../../../components'\nimport { triggerLinkDownload } from './exports'\nimport type { DownloadItem } from './types'\nimport { DEFAULT_DOWNLOAD_LABELS, type DownloadLabels } from './labels'\n\nexport interface DownloadProps {\n items: readonly DownloadItem[]\n labels?: Partial<DownloadLabels>\n icon?: ComponentType<SvgIconProps>\n iconProps?: SvgIconProps\n /**\n * Fires when an item's `resolve()` rejects (or any step in the click-through\n * path throws). The error is normalised to a real `Error` first. Surface\n * to your telemetry / toast layer here; the trigger already shows a visual\n * error indicator independently.\n */\n onError?: (err: Error) => void\n}\n\nexport function Download({\n items,\n labels,\n icon: Icon = DownloadIcon,\n iconProps,\n onError,\n}: DownloadProps) {\n const _labels = { ...DEFAULT_DOWNLOAD_LABELS, ...labels }\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null)\n const [isDownloading, setIsDownloading] = useState(false)\n const [error, setError] = useState<Error | null>(null)\n\n const open = useCallback((e: React.MouseEvent<HTMLButtonElement>) => {\n // Clear any prior error when the user re-engages the menu — the next\n // attempt is a fresh interaction, not a continuation of the failed one.\n setError(null)\n setAnchorEl(e.currentTarget)\n }, [])\n const close = useCallback(() => setAnchorEl(null), [])\n\n const onSelect = useCallback(\n (item: DownloadItem) => {\n // Single-flight: ignore re-entry while a download is already in flight.\n // The trigger is `disabled` and the menu is closed during that window,\n // so this guard mostly defends against future call sites that bypass\n // the menu (e.g. keyboard shortcuts).\n if (item.disabled || isDownloading) return\n close()\n setIsDownloading(true)\n setError(null)\n item\n .resolve()\n .then(({ url, filename, revoke }) => {\n // `item.filename` overrides what `resolve()` returns — lets consumers\n // template the filename with widget metadata declaratively.\n triggerLinkDownload({ url, filename: item.filename ?? filename })\n // Defer revoke past the current task so Safari / Firefox-on-slow-disk\n // can dispatch the download before the blob URL is invalidated.\n // Synchronous revoke here can silently cancel the download.\n if (revoke) setTimeout(revoke, 0)\n })\n .catch((err: unknown) => {\n const e = err instanceof Error ? err : new Error(String(err))\n setError(e)\n onError?.(e)\n })\n .finally(() => {\n setIsDownloading(false)\n })\n },\n [close, isDownloading, onError],\n )\n\n const triggerLabel = isDownloading\n ? _labels.loading\n : error\n ? _labels.error\n : _labels.trigger\n const triggerActive = Boolean(anchorEl) || isDownloading\n\n return (\n <>\n <Tooltip title={triggerLabel}>\n <IconButton\n size='small'\n aria-label={triggerLabel}\n aria-haspopup='true'\n aria-expanded={anchorEl ? 'true' : undefined}\n aria-busy={isDownloading || undefined}\n data-error={error ? 'true' : undefined}\n disabled={isDownloading || items.length === 0}\n onClick={open}\n className={triggerActive ? 'active' : undefined}\n >\n {isDownloading ? (\n <CircularProgress size={18} color='inherit' />\n ) : (\n <Icon fontSize='small' {...iconProps} />\n )}\n </IconButton>\n </Tooltip>\n <Menu\n anchorEl={anchorEl}\n open={Boolean(anchorEl)}\n onClose={close}\n variant='menu'\n elevation={8}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'right',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n >\n {items.map((item) => (\n <MenuItem\n key={item.id}\n disabled={item.disabled}\n onClick={() => void onSelect(item)}\n >\n {item.icon && (\n <ListItemIcon sx={{ color: 'text.primary' }}>\n {item.icon}\n </ListItemIcon>\n )}\n <ListItemText>{item.label}</ListItemText>\n </MenuItem>\n ))}\n </Menu>\n </>\n )\n}\n","export interface FullScreenLabels {\n open: string\n close: string\n}\n\nexport const DEFAULT_FULLSCREEN_LABELS: FullScreenLabels = {\n open: 'Open in full screen',\n close: 'Exit full screen',\n}\n","import type { SxProps, Theme } from '@mui/material'\n\nexport const styles = {\n // Inline shell where the portaled body lives when fullscreen is closed.\n // Real flex-column box (not `display: contents`) so that:\n // 1. when the body is moved into the modal, we can pin a `min-height`\n // to keep the widget card from collapsing — the inline shell is\n // empty for that interval, and a layout-less wrapper would make\n // the card squish a frame before the modal covers it (visible\n // blink).\n // 2. nested `flex: 1` (e.g. Widget.State's CaptureBox) still grows —\n // this shell preserves the column-flex inheritance it would have\n // had directly under `Widget.Content`.\n // `gap: 1` mirrors `Widget.Content`'s gap so the body's siblings\n // (Subheader / capture box / note) keep their spacing.\n inlineSlot: {\n display: 'flex',\n flexDirection: 'column',\n flex: 1,\n minHeight: 0,\n gap: 1,\n },\n trigger: {\n p: 0.5,\n '& .MuiSvgIcon-root': { fontSize: 20 },\n },\n triggerActive: {\n background: (theme: Theme) => theme.palette.primary.relatedLight,\n },\n dialogPaper: {\n width: '90vw',\n height: '90vh',\n maxWidth: 'none',\n maxHeight: 'none',\n },\n dialogTitle: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 1,\n py: 3,\n pr: 3,\n pb: 2,\n },\n titleText: {\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n dialogContent: {\n display: 'flex',\n flexDirection: 'column',\n gap: 1,\n py: 3,\n px: 2.5,\n overflow: 'auto',\n },\n} satisfies Record<string, SxProps<Theme>>\n","import {\n useCallback,\n useLayoutEffect,\n useState,\n type ComponentType,\n type ReactNode,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport {\n Box,\n Dialog,\n DialogContent,\n DialogTitle,\n IconButton,\n Typography,\n type SvgIconProps,\n} from '@mui/material'\nimport { Fullscreen as FullscreenIcon } from '@mui/icons-material'\nimport { FullscreenExit as FullscreenExitIcon } from '@mui/icons-material'\nimport { Close as CloseIcon } from '@mui/icons-material'\nimport { Tooltip } from '../../../components'\nimport { getWidgetStore, useWidget, useWidgetId } from '../../stores'\nimport { DEFAULT_FULLSCREEN_LABELS, type FullScreenLabels } from './labels'\nimport type { FullScreenWidgetState } from './types'\nimport { styles } from './style'\n\nexport interface FullScreenTriggerProps {\n labels?: Partial<FullScreenLabels>\n enterIcon?: ComponentType<SvgIconProps>\n exitIcon?: ComponentType<SvgIconProps>\n iconProps?: SvgIconProps\n}\n\nexport interface FullScreenSlotProps {\n /**\n * Render-prop body. Receives the live `isFullScreen` flag so the consumer\n * can branch per-mode props (e.g., `Widget.Toolbox visibleCount`) without\n * duplicating the JSX.\n */\n children: (isFullScreen: boolean) => ReactNode\n /** Header text rendered above the body when the modal is open. */\n title?: ReactNode\n labels?: Partial<FullScreenLabels>\n closeIcon?: ComponentType<SvgIconProps>\n iconProps?: SvgIconProps\n}\n\n/**\n * Toggle button placed inside `<Widget.Actions>`. Reads / writes\n * {@link FullScreenWidgetState.isFullScreen} on the per-widget store. The\n * matching modal is rendered by {@link FullScreenSlot} (typically inside\n * `<Widget.Content>`).\n */\nfunction FullScreenTrigger({\n labels,\n enterIcon: EnterIcon = FullscreenIcon,\n exitIcon: ExitIcon = FullscreenExitIcon,\n iconProps,\n}: FullScreenTriggerProps) {\n const id = useWidgetId()\n const _labels = { ...DEFAULT_FULLSCREEN_LABELS, ...labels }\n const open = useWidget<boolean, FullScreenWidgetState>(\n id,\n (s) => s.isFullScreen ?? false,\n )\n\n const handleToggle = useCallback(() => {\n getWidgetStore(id).setState({\n isFullScreen: !open,\n } as Partial<FullScreenWidgetState>)\n }, [id, open])\n\n const triggerLabel = open ? _labels.close : _labels.open\n const TriggerIcon = open ? ExitIcon : EnterIcon\n\n return (\n <Tooltip title={triggerLabel}>\n <IconButton\n size='small'\n aria-label={triggerLabel}\n aria-pressed={open}\n onClick={handleToggle}\n className={open ? 'active' : undefined}\n sx={{ ...styles.trigger, ...(open && styles.triggerActive) }}\n >\n <TriggerIcon fontSize='small' {...iconProps} />\n </IconButton>\n </Tooltip>\n )\n}\n\n/**\n * Body wrapper. Renders its render-prop children once, via a single\n * `createPortal` call whose container is a stable `<div>` we hold as a ref.\n * That div is moved imperatively between an inline placeholder and the\n * `<DialogContent>` of an MUI `<Dialog keepMounted>`. Because both the\n * React parent (the portal call site) AND the portal container are\n * identical across the toggle, the subtree keeps its fiber identity and\n * ECharts (or any other heavy child) stays mounted while only its DOM\n * parent changes.\n */\nfunction FullScreenSlot({\n children,\n title,\n labels,\n closeIcon: CloseSvg = CloseIcon,\n iconProps,\n}: FullScreenSlotProps) {\n const id = useWidgetId()\n const _labels = { ...DEFAULT_FULLSCREEN_LABELS, ...labels }\n const open = useWidget<boolean, FullScreenWidgetState>(\n id,\n (s) => s.isFullScreen ?? false,\n )\n const [inlineEl, setInlineEl] = useState<HTMLElement | null>(null)\n const [dialogEl, setDialogEl] = useState<HTMLElement | null>(null)\n // Stable, never-changing portal container created once per slot. Held in\n // state (not a ref) so the React Compiler is happy reading it during\n // render — it's immutable from React's perspective, only its DOM parent\n // changes via `appendChild`. Switching `createPortal`'s `container`\n // argument makes React unmount and remount the children, defeating the\n // single-mount goal; keeping the container identical and moving the div\n // imperatively avoids that.\n const [portalDiv] = useState<HTMLDivElement | null>(() => {\n if (typeof document === 'undefined') return null\n const div = document.createElement('div')\n // `display: contents` keeps the wrapper transparent in flow so it\n // doesn't introduce a stray block when nested inside the inline slot.\n div.style.display = 'contents'\n return div\n })\n\n const handleClose = useCallback(() => {\n getWidgetStore(id).setState({\n isFullScreen: false,\n } as Partial<FullScreenWidgetState>)\n }, [id])\n\n // Reparent the portal div into the active host whenever `open` (or either\n // host) changes. `useLayoutEffect` runs synchronously after commit (after\n // refs have been written), so the dialog ref is already live when we read\n // it.\n //\n // Anti-blink: pin a `min-height` on the inline shell that's always live —\n // not just while fullscreen is open. We re-measure whenever the body is\n // inline (open=false) so the lock tracks data-driven height changes\n // (Formula adding rows, Table growing, ECharts re-init…) and survives\n // every fullscreen toggle. Briefly clearing minHeight before the measure\n // lets the lock shrink as well as grow; both operations are synchronous\n // within useLayoutEffect, so the browser never paints the intermediate\n // \"no lock\" frame.\n useLayoutEffect(() => {\n if (!portalDiv || !inlineEl) return\n const host = open ? dialogEl : inlineEl\n if (host && portalDiv.parentNode !== host) {\n host.appendChild(portalDiv)\n }\n if (!open) refreshInlineHeightLock(inlineEl)\n }, [open, inlineEl, dialogEl, portalDiv])\n\n const titleId = `widget-fullscreen-title-${id}`\n const rendered = children(open)\n\n return (\n <>\n <Box ref={setInlineEl} sx={styles.inlineSlot} />\n {portalDiv ? createPortal(rendered, portalDiv) : null}\n <Dialog\n open={open}\n onClose={handleClose}\n PaperProps={{ sx: styles.dialogPaper }}\n aria-labelledby={titleId}\n // Sits above the Toolbox overflow Paper (zIndex.tooltip = 1500),\n // so opening fullscreen never leaves a stray popover floating on top.\n sx={{ zIndex: (theme) => theme.zIndex.tooltip + 1 }}\n >\n <DialogTitle id={titleId} component='div' sx={styles.dialogTitle}>\n <Typography\n variant='subtitle1'\n component='span'\n sx={styles.titleText}\n >\n {title}\n </Typography>\n <Tooltip title={_labels.close}>\n <IconButton\n size='medium'\n aria-label={_labels.close}\n onClick={handleClose}\n >\n <CloseSvg fontSize='small' {...iconProps} />\n </IconButton>\n </Tooltip>\n </DialogTitle>\n <DialogContent ref={setDialogEl} sx={styles.dialogContent} />\n </Dialog>\n </>\n )\n}\n\n/**\n * Briefly clear the inline shell's `min-height`, measure its natural\n * height, then re-pin. Lives outside the component so the React Compiler\n * doesn't see the DOM mutation as an attempt to modify a `useState` value\n * — `el` here is just a parameter, not a tracked store value.\n */\nfunction refreshInlineHeightLock(el: HTMLElement): void {\n el.style.minHeight = ''\n const h = el.getBoundingClientRect().height\n if (h > 0) el.style.minHeight = `${h}px`\n}\n\n/**\n * Namespace export. Consumers compose with:\n *\n * ```tsx\n * <Widget.Actions>\n * <Widget.FullScreen.Trigger />\n * </Widget.Actions>\n * <Widget.Content>\n * <Widget.FullScreen.Slot title={title}>\n * {(isFullScreen) => <Body visibleCount={isFullScreen ? undefined : 2} />}\n * </Widget.FullScreen.Slot>\n * </Widget.Content>\n * ```\n */\nexport const FullScreen = {\n Trigger: FullScreenTrigger,\n Slot: FullScreenSlot,\n}\n","/**\n * Filters a 2D series of `{name, ...}` records, keeping only items whose\n * `name` is in the locked set. Multi-series shape is preserved (one inner\n * array per series). Used by the LockSelection action's data transform.\n */\nexport function filterByLockedItems(\n input: unknown,\n lockedItems: readonly (string | number)[],\n): unknown {\n if (lockedItems.length === 0) return input\n if (!Array.isArray(input)) return input\n const set = new Set<string | number>(lockedItems)\n return input.map((series: unknown): unknown => {\n if (!Array.isArray(series)) return series\n return series.filter((item: unknown) => {\n if (item == null) return false\n if (typeof item === 'object' && 'name' in item) {\n const name = (item as { name: unknown }).name\n if (typeof name === 'string' || typeof name === 'number') {\n return set.has(name)\n }\n return false\n }\n return false\n })\n })\n}\n","export interface LockSelectionLabels {\n lock: string\n unlock: string\n disabled: string\n}\n\nexport const DEFAULT_LOCK_SELECTION_LABELS: LockSelectionLabels = {\n lock: 'Lock selection',\n unlock: 'Unlock selection',\n disabled: 'Select rows to lock',\n}\n","import type { SxProps, Theme } from '@mui/material'\n\nexport const styles = {\n toggle: {\n p: 0.5,\n '& .MuiSvgIcon-root': { fontSize: 20 },\n },\n toggleActive: {\n background: (theme: Theme) => theme.palette.primary.relatedLight,\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { useCallback, useEffect, useMemo, type ComponentType } from 'react'\nimport { IconButton, type SvgIconProps } from '@mui/material'\nimport { Lock as LockIcon } from '@mui/icons-material'\nimport { LockOpen as LockOpenIcon } from '@mui/icons-material'\nimport { Tooltip } from '../../../components'\nimport { useTransform, useWidgetId } from '../../stores'\nimport type { TransformPair } from '../../stores'\nimport { filterByLockedItems } from './transforms'\nimport {\n DEFAULT_LOCK_SELECTION_LABELS,\n type LockSelectionLabels,\n} from './labels'\nimport { styles } from './style'\n\nconst LOCK_SELECTION_DESCRIPTOR = {\n id: 'lock-selection',\n type: 'data' as const,\n order: 30,\n}\n\nexport type LockSelectionKey = string | number\n\nexport interface LockSelectionProps {\n /**\n * Currently-selected items (destination-owned). On lock, this set is\n * snapshotted into `lockedItems` via `onLockChange`.\n */\n selection: readonly LockSelectionKey[]\n /**\n * Currently-locked items (destination-owned). When non-empty, the widget's\n * data is filtered to these items via the registered transform.\n */\n lockedItems: readonly LockSelectionKey[]\n /**\n * Fires when the user toggles the lock. The destination is responsible for\n * persisting the new locked set (and re-feeding it via `lockedItems`).\n */\n onLockChange: (next: readonly LockSelectionKey[]) => void\n labels?: Partial<LockSelectionLabels>\n /** Lock icon (default: `LockIcon`). */\n lockIcon?: ComponentType<SvgIconProps>\n /** Unlock icon (default: `LockOpenIcon`). */\n unlockIcon?: ComponentType<SvgIconProps>\n iconProps?: SvgIconProps\n}\n\n/**\n * Action that pins the current selection so the widget's data filters down\n * to those items even as the user changes selections. Selection and lock\n * state are destination-owned; this component is a controlled UI + a data\n * transform registered against the widget's pipeline.\n *\n * The trigger is disabled when there is nothing to lock and nothing locked.\n */\nexport function LockSelection({\n selection,\n lockedItems,\n onLockChange,\n labels,\n lockIcon: LockSvg = LockIcon,\n unlockIcon: UnlockSvg = LockOpenIcon,\n iconProps,\n}: LockSelectionProps) {\n const id = useWidgetId()\n const _labels = { ...DEFAULT_LOCK_SELECTION_LABELS, ...labels }\n const isLocked = lockedItems.length > 0\n const canToggle = isLocked || selection.length > 0\n\n // Pair memoized on lockedItems identity — useTransform re-registers the fn\n // (which closes over the current locked set) whenever the destination feeds\n // a new array. setEnabled drives the middleware-level `enabled` flag.\n const pairs = useMemoPair(lockedItems)\n const { enabled, setEnabled } = useTransform(id, pairs, {\n initialEnabled: isLocked,\n })\n\n // Keep middleware `enabled` in sync with destination-owned `isLocked`. The\n // pipeline only short-circuits the transform when enabled === false, so\n // toggling here is what makes lock/unlock actually take effect.\n useEffect(() => {\n if (enabled !== isLocked) setEnabled(isLocked)\n }, [enabled, isLocked, setEnabled])\n\n const handleToggle = useCallback(() => {\n if (isLocked) {\n onLockChange([])\n } else {\n onLockChange([...selection])\n }\n }, [isLocked, onLockChange, selection])\n\n const tooltip = !canToggle\n ? _labels.disabled\n : isLocked\n ? _labels.unlock\n : _labels.lock\n const Icon = isLocked ? UnlockSvg : LockSvg\n\n return (\n <Tooltip title={tooltip}>\n <span>\n <IconButton\n size='small'\n aria-label={tooltip}\n aria-pressed={isLocked}\n disabled={!canToggle}\n onClick={handleToggle}\n sx={{ ...styles.toggle, ...(isLocked && styles.toggleActive) }}\n >\n <Icon fontSize='small' {...iconProps} />\n </IconButton>\n </span>\n </Tooltip>\n )\n}\n\n/**\n * Builds a stable `[{ descriptor, fn }]` pair where `fn` closes over the\n * latest `lockedItems`. Re-memoized whenever the array identity changes so\n * `useTransform` re-registers the closure with the freshest data.\n */\nfunction useMemoPair(\n lockedItems: readonly LockSelectionKey[],\n): readonly TransformPair[] {\n const fn = useCallback(\n (data: unknown) => filterByLockedItems(data, lockedItems),\n [lockedItems],\n )\n return useMemo(() => [{ descriptor: LOCK_SELECTION_DESCRIPTOR, fn }], [fn])\n}\n","import { SvgIcon, type SvgIconProps } from '@mui/material'\n\nexport function ChangeColumnIcon(props: SvgIconProps) {\n return (\n <SvgIcon viewBox='0 0 18 18' {...props}>\n <path\n fill='currentColor'\n fillRule='evenodd'\n d='M14.25 2.25H3.75c-.825 0-1.5.675-1.5 1.5v10.5c0 .825.675 1.5 1.5 1.5h10.5c.825 0 1.5-.675 1.5-1.5V3.75c0-.825-.675-1.5-1.5-1.5m-3.75 12h-3V3.75h3zM3.75 3.75H6v10.5H3.75zM12 14.25V3.75h2.25v10.5z'\n clipRule='evenodd'\n />\n </SvgIcon>\n )\n}\n","export interface ChangeColumnLabels {\n trigger: string\n reset: string\n}\n\nexport const DEFAULT_CHANGE_COLUMN_LABELS: ChangeColumnLabels = {\n trigger: 'Change column order',\n reset: 'Reset to default',\n}\n","import type { SxProps, Theme } from '@mui/material'\n\nexport const styles = {\n toggle: {\n p: 0.5,\n '& .MuiSvgIcon-root': { fontSize: 20 },\n },\n toggleActive: {\n background: (theme: Theme) => theme.palette.primary.relatedLight,\n },\n menuPaper: {\n overflow: 'hidden',\n minWidth: 220,\n },\n item: {\n cursor: 'grab',\n '&:focus-visible': {\n outline: '2px solid',\n outlineColor: 'primary.main',\n outlineOffset: -2,\n },\n },\n itemDragging: {\n opacity: 0.5,\n cursor: 'grabbing',\n },\n dragHandle: {\n color: 'text.secondary',\n mr: 1,\n fontSize: 18,\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { useSortable } from '@dnd-kit/sortable'\nimport { CSS } from '@dnd-kit/utilities'\nimport { ListItemText, MenuItem } from '@mui/material'\nimport { DragIndicator as DragIndicatorIcon } from '@mui/icons-material'\nimport type { ComponentType, ReactNode } from 'react'\nimport type { SvgIconProps } from '@mui/material'\nimport { styles } from './style'\n\nexport interface SortableColumnItemProps {\n id: string\n label: ReactNode\n dragHandleIcon?: ComponentType<SvgIconProps>\n}\n\n/**\n * Draggable menu item used inside ChangeColumn's `<DndContext>`. Wraps a\n * MUI `<MenuItem>` so it inherits keyboard / theming behavior, and exposes\n * the dnd-kit listeners on the whole row so the user can grab anywhere on\n * the row to reorder.\n */\nexport function SortableColumnItem({\n id,\n label,\n dragHandleIcon: HandleIcon = DragIndicatorIcon,\n}: SortableColumnItemProps) {\n const {\n attributes,\n listeners,\n setNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({ id })\n\n const transformStyle = {\n transform: CSS.Transform.toString(\n transform ? { ...transform, x: 0 } : null,\n ),\n transition,\n }\n\n return (\n <MenuItem\n ref={setNodeRef}\n style={transformStyle}\n {...attributes}\n {...listeners}\n role='menuitem'\n tabIndex={0}\n sx={{ ...styles.item, ...(isDragging && styles.itemDragging) }}\n >\n <HandleIcon sx={styles.dragHandle} />\n <ListItemText>{label}</ListItemText>\n </MenuItem>\n )\n}\n","import { useCallback, useMemo, useState, type ComponentType } from 'react'\nimport {\n DndContext,\n KeyboardSensor,\n PointerSensor,\n closestCenter,\n useSensor,\n useSensors,\n type DragEndEvent,\n} from '@dnd-kit/core'\nimport {\n SortableContext,\n arrayMove,\n sortableKeyboardCoordinates,\n verticalListSortingStrategy,\n} from '@dnd-kit/sortable'\nimport { IconButton, Menu, type SvgIconProps } from '@mui/material'\nimport { Tooltip } from '../../../components'\nimport { getWidgetStore, useWidget, useWidgetId } from '../../stores'\nimport { ChangeColumnIcon } from './change-column-icon'\nimport { DEFAULT_CHANGE_COLUMN_LABELS, type ChangeColumnLabels } from './labels'\nimport { SortableColumnItem } from './sortable-column-item'\nimport { styles } from './style'\nimport type { ChangeColumnWidgetState } from './types'\nimport type { ReactNode } from 'react'\n\nexport interface ChangeColumnItem {\n id: string\n label: ReactNode\n}\n\nexport interface ChangeColumnProps {\n /**\n * Master list of columns (id + label) in their default order. The current\n * effective order is derived by combining this list with the widget's\n * `columnOrder` extension state.\n */\n columns: readonly ChangeColumnItem[]\n labels?: Partial<ChangeColumnLabels>\n icon?: ComponentType<SvgIconProps>\n iconProps?: SvgIconProps\n dragHandleIcon?: ComponentType<SvgIconProps>\n}\n\n/**\n * Action that lets users reorder columns via drag-and-drop. The new order is\n * persisted on the widget store as `columnOrder` (an array of ids) on the\n * {@link ChangeColumnWidgetState} extension. `<Table>` (and other column-aware\n * bridges) merge that order with their own `columns` prop via\n * `resolveColumns()` from the table primitives.\n *\n * Returns `null` when there are fewer than two columns to reorder.\n */\nexport function ChangeColumn({\n columns,\n labels,\n icon: Icon = ChangeColumnIcon,\n iconProps,\n dragHandleIcon,\n}: ChangeColumnProps) {\n const id = useWidgetId()\n const _labels = { ...DEFAULT_CHANGE_COLUMN_LABELS, ...labels }\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null)\n\n const columnOrder = useWidget<\n readonly string[] | undefined,\n ChangeColumnWidgetState\n >(id, (s) => s.columnOrder)\n\n const orderedIds = useMemo(() => {\n const masterIds = columns.map((c) => c.id)\n if (!columnOrder || columnOrder.length === 0) return masterIds\n // Set lookup so membership tests stay O(1) regardless of column count.\n const masterIdSet = new Set(masterIds)\n const seen = new Set<string>()\n const out: string[] = []\n for (const cid of columnOrder) {\n if (masterIdSet.has(cid) && !seen.has(cid)) {\n out.push(cid)\n seen.add(cid)\n }\n }\n for (const cid of masterIds) {\n if (!seen.has(cid)) out.push(cid)\n }\n return out\n }, [columnOrder, columns])\n\n const orderedColumns = useMemo(() => {\n const byId = new Map(columns.map((c) => [c.id, c]))\n // Single pass instead of map().filter() — skips unknown ids inline.\n const out: ChangeColumnItem[] = []\n for (const cid of orderedIds) {\n const c = byId.get(cid)\n if (c != null) out.push(c)\n }\n return out\n }, [orderedIds, columns])\n\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n )\n\n const handleOpen = useCallback((e: React.MouseEvent<HTMLElement>) => {\n e.stopPropagation()\n setAnchorEl(e.currentTarget)\n }, [])\n const handleClose = useCallback(() => setAnchorEl(null), [])\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n const { active, over } = event\n if (!over || active.id === over.id) return\n const oldIndex = orderedIds.indexOf(String(active.id))\n const newIndex = orderedIds.indexOf(String(over.id))\n if (oldIndex === -1 || newIndex === -1) return\n const next = arrayMove([...orderedIds], oldIndex, newIndex)\n getWidgetStore(id).setState({\n columnOrder: next,\n } as Partial<ChangeColumnWidgetState>)\n },\n [id, orderedIds],\n )\n\n if (columns.length < 2) return null\n\n const isOpen = Boolean(anchorEl)\n\n return (\n <>\n <Tooltip title={_labels.trigger}>\n <IconButton\n size='small'\n aria-label={_labels.trigger}\n aria-pressed={isOpen}\n aria-haspopup='true'\n aria-controls={isOpen ? 'change-column-menu' : undefined}\n aria-expanded={isOpen ? 'true' : undefined}\n onClick={handleOpen}\n className={isOpen ? 'active' : undefined}\n sx={{ ...styles.toggle, ...(isOpen && styles.toggleActive) }}\n >\n <Icon fontSize='small' {...iconProps} />\n </IconButton>\n </Tooltip>\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragEnd={handleDragEnd}\n >\n <Menu\n id='change-column-menu'\n anchorEl={anchorEl}\n open={isOpen}\n onClose={handleClose}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n transformOrigin={{ vertical: 'top', horizontal: 'right' }}\n slotProps={{ paper: { sx: styles.menuPaper } }}\n >\n <SortableContext\n items={orderedIds}\n strategy={verticalListSortingStrategy}\n >\n {orderedColumns.map((column) => (\n <SortableColumnItem\n key={column.id}\n id={column.id}\n label={column.label}\n dragHandleIcon={dragHandleIcon}\n />\n ))}\n </SortableContext>\n </Menu>\n </DndContext>\n </>\n )\n}\n"],"names":["filterBySearchText","input","search","needle","toLowerCase","Array","isArray","map","series","filter","item","rawName","name","stringifyPrimitive","includes","v","String","DEFAULT_SEARCHER_LABELS","toggle","placeholder","clearAriaLabel","noResults","styles","p","fontSize","toggleActive","background","theme","palette","primary","relatedLight","width","mb","SEARCHER_DESCRIPTOR","id","type","order","disables","SearcherToggle","t0","$","_c","labels","icon","t1","iconProps","initialEnabled","t2","Icon","undefined","SearchIcon","useWidgetId","t3","resolved","text","useWidget","_temp","t4","data","fn","t5","enabled","useSingleTransform","t6","t7","t8","jsx","t9","IconButton","t10","Tooltip","s","transformStates","searcher","searchText","setSearcherText","widgetId","value","getWidgetStore","setState","DEFAULT_DEBOUNCE","Searcher","debounceMs","inputRef","useRef","getState","local","setLocal","useState","debounce","debouncedWrite","e","value_0","target","handleSearchTextChange","current","focus","handleClear","Symbol","for","InputAdornment","ClearIcon","startAdornment","endAdornment","t11","TextField","addStack","option","cfg","existing","length","stack","DEFAULT_STACK_TOGGLE_LABELS","on","off","STACK_DESCRIPTOR","StackToggle","StackedBarChartIcon","_labels","tooltip","DEFAULT_SHOW_ALL_LABELS","SHOW_ALL_ID","ShowAllToggle","CloseIcon","setShowAll","DEFAULT_ZOOM_TOGGLE_LABELS","ZOOM_DESCRIPTOR","ZoomToggle","axes","ZoomInIcon","useTheme","includeX","includeY","push","createAddZoom","transform","getEchartInstance","setOption","replaceMerge","handleToggle","t12","t13","t14","addBrush","brush","toolbox","xAxisIndex","brushLink","outOfBrush","colorAlpha","show","feature","DEFAULT_BRUSH_TOGGLE_LABELS","BRUSH_DESCRIPTOR","BrushToggle","brushType","brushMode","selection","HighlightAltIcon","chart","useEchartInstance","dispatchAction","areas","enterBrush","key","brushOption","onFinished","useEffect","t15","t16","isNamedValueArray","every","toRelativeData","total","reduce","acc","d","Math","abs","createPercentFormatter","locale","fmt","Intl","NumberFormat","style","minimumFractionDigits","maximumFractionDigits","Number","isFinite","format","DEFAULT_RELATIVE_DATA_LABELS","DATA_DESCRIPTOR","RelativeData","PercentIcon","percentFormatter","rawFormatter","formatter","DEFAULT_DOWNLOAD_LABELS","trigger","loading","error","Download","items","onError","DownloadIcon","anchorEl","setAnchorEl","isDownloading","setIsDownloading","setError","currentTarget","open","close","disabled","resolve","then","url","filename","revoke","triggerLinkDownload","setTimeout","catch","err","e_0","Error","finally","onSelect","triggerLabel","triggerActive","Boolean","CircularProgress","vertical","horizontal","t17","t18","item_0","jsxs","MenuItem","ListItemIcon","color","ListItemText","label","Menu","t19","DEFAULT_FULLSCREEN_LABELS","inlineSlot","display","flexDirection","flex","minHeight","gap","dialogPaper","height","maxWidth","maxHeight","dialogTitle","alignItems","justifyContent","py","pr","pb","titleText","minWidth","overflow","textOverflow","whiteSpace","dialogContent","px","FullScreenTrigger","enterIcon","exitIcon","EnterIcon","FullscreenIcon","ExitIcon","FullscreenExitIcon","isFullScreen","TriggerIcon","FullScreenSlot","children","title","closeIcon","CloseSvg","_temp2","inlineEl","setInlineEl","dialogEl","setDialogEl","portalDiv","_temp3","handleClose","host","parentNode","appendChild","refreshInlineHeightLock","useLayoutEffect","titleId","rendered","Box","createPortal","sx","zIndex","_temp4","Typography","DialogTitle","DialogContent","Dialog","Fragment","document","div","createElement","el","h","getBoundingClientRect","FullScreen","Trigger","Slot","filterByLockedItems","lockedItems","set","Set","has","DEFAULT_LOCK_SELECTION_LABELS","lock","unlock","LOCK_SELECTION_DESCRIPTOR","LockSelection","onLockChange","lockIcon","unlockIcon","LockSvg","LockIcon","UnlockSvg","LockOpenIcon","isLocked","canToggle","pairs","useMemoPair","setEnabled","useTransform","descriptor","ChangeColumnIcon","props","SvgIcon","DEFAULT_CHANGE_COLUMN_LABELS","reset","menuPaper","cursor","outline","outlineColor","outlineOffset","itemDragging","opacity","dragHandle","mr","SortableColumnItem","dragHandleIcon","HandleIcon","DragIndicatorIcon","attributes","listeners","setNodeRef","transition","isDragging","useSortable","CSS","Transform","toString","x","transformStyle","ChangeColumn","columns","columnOrder","bb0","masterIds","masterIdSet","seen","out","cid","add","cid_0","orderedIds","Map","byId","out_0","cid_1","c_1","get","c","orderedColumns","coordinateGetter","sortableKeyboardCoordinates","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","stopPropagation","handleOpen","event","active","over","oldIndex","indexOf","newIndex","next","arrayMove","handleDragEnd","isOpen","paper","t20","column","t21","SortableContext","verticalListSortingStrategy","t22","t23","DndContext","closestCenter","t24","c_0"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKO,SAASA,GAAmBC,GAAgBC,GAAyB;AAC1E,MAAI,CAACA,EAAQ,QAAOD;AACpB,QAAME,IAASD,EAAOE,YAAAA;AACtB,SAAKC,MAAMC,QAAQL,CAAK,IACjBA,EAAMM,IAAI,CAACC,MACXH,MAAMC,QAAQE,CAAM,IAClBA,EAAOC,OAAO,CAACC,MAAkB;AACtC,QAAIA,KAAQ,KAAM,QAAO;AACzB,QAAI,OAAOA,KAAS,YAAY,UAAUA,GAAM;AAC9C,YAAMC,IAAWD,EAA2BE;AAE5C,cADaD,KAAW,OAAO,KAAKE,GAAmBF,CAAO,GAClDP,cAAcU,SAASX,CAAM;AAAA,IAC3C;AACA,WAAOU,GAAmBH,CAAI,EAAEN,YAAAA,EAAcU,SAASX,CAAM;AAAA,EAC/D,CAAC,IATkCK,CAUpC,IAZiCP;AAapC;AAEA,SAASY,GAAmBE,GAAoB;AAC9C,SAAI,OAAOA,KAAM,WAAiBA,IAC9B,OAAOA,KAAM,YAAY,OAAOA,KAAM,YAAkBC,OAAOD,CAAC,IAC7D;AACT;ACpBO,MAAME,KAA0C;AAAA,EACrDC,QAAQ;AAAA,EACRC,aAAa;AAAA,EACbC,gBAAgB;AAAA,EAChBC,WAAW;AACb,GCVaC,KAAS;AAAA,EACpBJ,QAAQ;AAAA,IACNK,GAAG;AAAA,IACH,sBAAsB;AAAA,MAA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AsX,KAAAA,IAAAtX,EAAA,EAAA;AAAA,MAAAuX;AAAA,EAAAvX,EAAA,EAAA,MAAA8W,KAAA9W,UAAA+V,KAAA/V,EAAA,EAAA,MAAAsX,KA3BTC,uBAACC,IAAA,EACUzB,SAAAA,GACW0B,oBAAAA,IACTX,WAAAA,GAEXQ,UAAAA,EAAAA,CAuBF,GAAatX,QAAA8W,GAAA9W,QAAA+V,GAAA/V,QAAAsX,GAAAtX,QAAAuX,MAAAA,KAAAvX,EAAA,EAAA;AAAA,MAAA0X;AAAA,SAAA1X,EAAA,EAAA,MAAAiI,KAAAjI,UAAAuX,MA5CfG,8BACEzP,UAAAA;AAAAA,IAAAA;AAAAA,IAeAsP;AAAAA,EAAAA,GA4Ba,GACZvX,QAAAiI,GAAAjI,QAAAuX,IAAAvX,QAAA0X,MAAAA,KAAA1X,EAAA,EAAA,GA7CH0X;AA6CG;AA5HA,SAAAlI,GAAAmI,GAAA;AAAA,SAoCqC,CAAChC,EAACjW,IAAKiW,CAAC;AAAC;AApC9C,SAAAzG,GAAAyG,GAAA;AAAA,SAiBkCA,EAACjW;AAAG;AAjBtC,SAAAsB,GAAAe,GAAA;AAAA,SAcQA,EAAC4S;AAAY;"}
|
package/dist/echart-Bdvbfx9s.js
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import { jsx as P } from "react/jsx-runtime";
|
|
2
|
-
import { c as X } from "react/compiler-runtime";
|
|
3
|
-
import { useRef as z, useEffectEvent as U, useEffect as w } from "react";
|
|
4
|
-
import { u as W, a as C, m as G } from "./widget-store-registry-_W4Z4xp-.js";
|
|
5
|
-
import { u as K } from "./widget-context-DTGO0Yta.js";
|
|
6
|
-
import "zustand";
|
|
7
|
-
import { Box as Z } from "@mui/material";
|
|
8
|
-
import * as N from "echarts";
|
|
9
|
-
const k = {
|
|
10
|
-
alignMinLabel: null,
|
|
11
|
-
alignMaxLabel: null
|
|
12
|
-
}, D = 1;
|
|
13
|
-
function B(t) {
|
|
14
|
-
const e = N.format.getTextRect(t.firstLabel, t.font).width / 2, n = N.format.getTextRect(t.lastLabel, t.font).width / 2;
|
|
15
|
-
return {
|
|
16
|
-
alignMinLabel: e + D > t.firstTickX ? "left" : null,
|
|
17
|
-
alignMaxLabel: n + D > t.width - t.lastTickX ? "right" : null
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function $(t) {
|
|
21
|
-
return Array.isArray(t) ? t[0] : t;
|
|
22
|
-
}
|
|
23
|
-
function H(t) {
|
|
24
|
-
const e = $(t.xAxis);
|
|
25
|
-
return e && typeof e == "object" ? e : void 0;
|
|
26
|
-
}
|
|
27
|
-
function J(t) {
|
|
28
|
-
const e = t.dataZoom;
|
|
29
|
-
return Array.isArray(e) ? e.length > 0 : e != null;
|
|
30
|
-
}
|
|
31
|
-
function j(t, e) {
|
|
32
|
-
return typeof e == "function" ? String(e(t ?? "")) : t == null ? "" : String(t);
|
|
33
|
-
}
|
|
34
|
-
function Y(t) {
|
|
35
|
-
const e = H(t);
|
|
36
|
-
if (!e || e.type !== "category") return null;
|
|
37
|
-
const n = $(t.series), r = n?.encode?.x;
|
|
38
|
-
if (r == null) return null;
|
|
39
|
-
const i = n?.datasetIndex ?? 0, o = t.dataset, u = (Array.isArray(o) ? o[i] : o)?.source;
|
|
40
|
-
if (!Array.isArray(u) || u.length < 2) return null;
|
|
41
|
-
const l = u, c = e.axisLabel?.formatter, a = e.axisLabel ?? {}, f = typeof a.fontSize == "number" ? `${a.fontSize}px` : a.fontSize ?? "12px", A = a.fontFamily ?? "sans-serif", L = a.fontWeight != null ? `${a.fontWeight} ` : "";
|
|
42
|
-
return {
|
|
43
|
-
firstLabel: j(l[0]?.[r], c),
|
|
44
|
-
lastLabel: j(l[l.length - 1]?.[r], c),
|
|
45
|
-
font: `${L}${f} ${A}`,
|
|
46
|
-
count: u.length
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function q(t, e, n) {
|
|
50
|
-
const r = Q(t, e);
|
|
51
|
-
return r.alignMinLabel === n.alignMinLabel && r.alignMaxLabel === n.alignMaxLabel ? n : (t.setOption({
|
|
52
|
-
xAxis: {
|
|
53
|
-
axisLabel: {
|
|
54
|
-
...r
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}, {
|
|
58
|
-
lazyUpdate: !0
|
|
59
|
-
}), r);
|
|
60
|
-
}
|
|
61
|
-
function Q(t, e) {
|
|
62
|
-
if (J(e)) return k;
|
|
63
|
-
const n = Y(e);
|
|
64
|
-
if (!n) return k;
|
|
65
|
-
const r = t.convertToPixel({
|
|
66
|
-
xAxisIndex: 0
|
|
67
|
-
}, 0), i = t.convertToPixel({
|
|
68
|
-
xAxisIndex: 0
|
|
69
|
-
}, n.count - 1), o = t.getWidth();
|
|
70
|
-
return typeof r != "number" || typeof i != "number" || !Number.isFinite(r) || !Number.isFinite(i) || !o ? k : B({
|
|
71
|
-
firstLabel: n.firstLabel,
|
|
72
|
-
lastLabel: n.lastLabel,
|
|
73
|
-
font: n.font,
|
|
74
|
-
firstTickX: r,
|
|
75
|
-
lastTickX: i,
|
|
76
|
-
width: o
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
const I = /* @__PURE__ */ new Map();
|
|
80
|
-
let h = null;
|
|
81
|
-
function V() {
|
|
82
|
-
return typeof ResizeObserver > "u" ? null : (h ??= new ResizeObserver((t) => {
|
|
83
|
-
for (const e of t)
|
|
84
|
-
I.get(e.target)?.();
|
|
85
|
-
}), h);
|
|
86
|
-
}
|
|
87
|
-
const ee = () => {
|
|
88
|
-
};
|
|
89
|
-
function te(t, e) {
|
|
90
|
-
const n = V();
|
|
91
|
-
return n ? (I.set(t, e), n.observe(t), () => {
|
|
92
|
-
I.delete(t), h && (h.unobserve(t), I.size === 0 && (h.disconnect(), h = null));
|
|
93
|
-
}) : ee;
|
|
94
|
-
}
|
|
95
|
-
function pe() {
|
|
96
|
-
h && h.disconnect(), I.clear(), h = null;
|
|
97
|
-
}
|
|
98
|
-
const ne = {
|
|
99
|
-
root: {
|
|
100
|
-
width: "100%",
|
|
101
|
-
minHeight: 0
|
|
102
|
-
}
|
|
103
|
-
}, re = {
|
|
104
|
-
renderer: "svg",
|
|
105
|
-
height: 304
|
|
106
|
-
};
|
|
107
|
-
function se(t) {
|
|
108
|
-
const e = X(21), {
|
|
109
|
-
option: n,
|
|
110
|
-
replaceMerge: r,
|
|
111
|
-
onEvents: i,
|
|
112
|
-
init: o,
|
|
113
|
-
onInstance: d,
|
|
114
|
-
className: u,
|
|
115
|
-
sx: l
|
|
116
|
-
} = t, c = z(null), a = z(null), f = z(null), A = z(null), L = z(n), _ = z(k);
|
|
117
|
-
let E;
|
|
118
|
-
e[0] !== d ? (E = (s) => {
|
|
119
|
-
d?.(s);
|
|
120
|
-
}, e[0] = d, e[1] = E) : E = e[1];
|
|
121
|
-
const m = U(E);
|
|
122
|
-
let F;
|
|
123
|
-
e[2] !== o || e[3] !== m ? (F = () => {
|
|
124
|
-
if (!c.current)
|
|
125
|
-
return;
|
|
126
|
-
const s = N.init(c.current, null, {
|
|
127
|
-
...re,
|
|
128
|
-
...o
|
|
129
|
-
});
|
|
130
|
-
a.current = s, m(s);
|
|
131
|
-
const y = () => {
|
|
132
|
-
_.current = q(s, L.current, _.current);
|
|
133
|
-
};
|
|
134
|
-
return s.on("finished", y), () => {
|
|
135
|
-
s.off("finished", y), m(null), s.dispose(), a.current = null;
|
|
136
|
-
};
|
|
137
|
-
}, e[2] = o, e[3] = m, e[4] = F) : F = e[4];
|
|
138
|
-
let b;
|
|
139
|
-
e[5] !== o ? (b = [o], e[5] = o, e[6] = b) : b = e[6], w(F, b);
|
|
140
|
-
let T, g;
|
|
141
|
-
e[7] !== n || e[8] !== r ? (T = () => {
|
|
142
|
-
const s = oe(n), y = ie(n), v = new Set(r ?? []);
|
|
143
|
-
s !== f.current && v.add("series"), y !== A.current && v.add("dataset"), f.current = s, A.current = y, L.current = n, a.current?.setOption(n, {
|
|
144
|
-
notMerge: !1,
|
|
145
|
-
lazyUpdate: !0,
|
|
146
|
-
replaceMerge: v.size > 0 ? Array.from(v) : void 0
|
|
147
|
-
});
|
|
148
|
-
}, g = [n, r], e[7] = n, e[8] = r, e[9] = T, e[10] = g) : (T = e[9], g = e[10]), w(T, g);
|
|
149
|
-
let M, p;
|
|
150
|
-
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = () => {
|
|
151
|
-
const s = c.current;
|
|
152
|
-
if (s)
|
|
153
|
-
return te(s, () => {
|
|
154
|
-
a.current?.resize();
|
|
155
|
-
});
|
|
156
|
-
}, p = [], e[11] = M, e[12] = p) : (M = e[11], p = e[12]), w(M, p);
|
|
157
|
-
let x, R;
|
|
158
|
-
e[13] !== i ? (x = () => {
|
|
159
|
-
const s = a.current;
|
|
160
|
-
if (!(!s || !i)) {
|
|
161
|
-
for (const [y, v] of Object.entries(i))
|
|
162
|
-
s.on(y, v);
|
|
163
|
-
return () => {
|
|
164
|
-
for (const [y, v] of Object.entries(i))
|
|
165
|
-
s.off(y, v);
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
}, R = [i], e[13] = i, e[14] = x, e[15] = R) : (x = e[14], R = e[15]), w(x, R);
|
|
169
|
-
let S;
|
|
170
|
-
e[16] !== l ? (S = {
|
|
171
|
-
...ne.root,
|
|
172
|
-
...l
|
|
173
|
-
}, e[16] = l, e[17] = S) : S = e[17];
|
|
174
|
-
let O;
|
|
175
|
-
return e[18] !== u || e[19] !== S ? (O = /* @__PURE__ */ P(Z, { ref: c, className: u, sx: S }), e[18] = u, e[19] = S, e[20] = O) : O = e[20], O;
|
|
176
|
-
}
|
|
177
|
-
function oe(t) {
|
|
178
|
-
const e = t.series;
|
|
179
|
-
return Array.isArray(e) ? e.map((n) => {
|
|
180
|
-
if (n == null || typeof n != "object") return String(n);
|
|
181
|
-
const r = n;
|
|
182
|
-
return [
|
|
183
|
-
r.type,
|
|
184
|
-
r.datasetIndex,
|
|
185
|
-
r.name,
|
|
186
|
-
r.stack,
|
|
187
|
-
// `encode` is small; stringify is cheap and stable for plain objects.
|
|
188
|
-
JSON.stringify(r.encode ?? null)
|
|
189
|
-
].join("|");
|
|
190
|
-
}).join("||") : e ? "1" : "";
|
|
191
|
-
}
|
|
192
|
-
function ie(t) {
|
|
193
|
-
const e = t.dataset;
|
|
194
|
-
return Array.isArray(e) ? String(e.length) : e ? "1" : "";
|
|
195
|
-
}
|
|
196
|
-
const ae = ["toolbox"], le = (t) => ({
|
|
197
|
-
data: t.data,
|
|
198
|
-
configTransforms: t.configTransforms,
|
|
199
|
-
formatter: t.formatter,
|
|
200
|
-
labelFormatter: t.labelFormatter
|
|
201
|
-
});
|
|
202
|
-
function xe(t) {
|
|
203
|
-
const e = X(22), {
|
|
204
|
-
optionFactory: n,
|
|
205
|
-
onEvents: r,
|
|
206
|
-
init: i,
|
|
207
|
-
className: o
|
|
208
|
-
} = t, d = K(), u = W(d, le);
|
|
209
|
-
let l;
|
|
210
|
-
e[0] !== d ? (l = (x) => G(d, x), e[0] = d, e[1] = l) : l = e[1];
|
|
211
|
-
const c = l, {
|
|
212
|
-
data: a,
|
|
213
|
-
configTransforms: f,
|
|
214
|
-
formatter: A,
|
|
215
|
-
labelFormatter: L
|
|
216
|
-
} = u;
|
|
217
|
-
let _;
|
|
218
|
-
e[2] !== n ? (_ = n(void 0, void 0), e[2] = n, e[3] = _) : _ = e[3];
|
|
219
|
-
const E = _;
|
|
220
|
-
let m;
|
|
221
|
-
e[4] !== f || e[5] !== E ? (m = C(E, f), e[4] = f, e[5] = E, e[6] = m) : m = e[6];
|
|
222
|
-
const F = m;
|
|
223
|
-
let b;
|
|
224
|
-
if (e[7] !== f) {
|
|
225
|
-
const x = new Set(ae);
|
|
226
|
-
for (const R of f)
|
|
227
|
-
if (R.enabled && R.replaceMergeKeys?.length)
|
|
228
|
-
for (const S of R.replaceMergeKeys)
|
|
229
|
-
x.add(S);
|
|
230
|
-
b = Array.from(x).sort(), e[7] = f, e[8] = b;
|
|
231
|
-
} else
|
|
232
|
-
b = e[8];
|
|
233
|
-
const T = b;
|
|
234
|
-
let g;
|
|
235
|
-
e[9] !== n || e[10] !== a || e[11] !== A || e[12] !== L || e[13] !== F ? (g = n(F, a, {
|
|
236
|
-
formatter: A,
|
|
237
|
-
labelFormatter: L
|
|
238
|
-
}), e[9] = n, e[10] = a, e[11] = A, e[12] = L, e[13] = F, e[14] = g) : g = e[14];
|
|
239
|
-
const M = g;
|
|
240
|
-
let p;
|
|
241
|
-
return e[15] !== o || e[16] !== i || e[17] !== r || e[18] !== c || e[19] !== M || e[20] !== T ? (p = /* @__PURE__ */ P(se, { option: M, replaceMerge: T, onEvents: r, init: i, onInstance: c, className: o }), e[15] = o, e[16] = i, e[17] = r, e[18] = c, e[19] = M, e[20] = T, e[21] = p) : p = e[21], p;
|
|
242
|
-
}
|
|
243
|
-
export {
|
|
244
|
-
re as D,
|
|
245
|
-
xe as E,
|
|
246
|
-
pe as _,
|
|
247
|
-
se as a,
|
|
248
|
-
te as o
|
|
249
|
-
};
|
|
250
|
-
//# sourceMappingURL=echart-Bdvbfx9s.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"echart-Bdvbfx9s.js","sources":["../src/widgets-v2/echart/edge-label-clamp.ts","../src/widgets-v2/echart/shared-resize-observer.ts","../src/widgets-v2/echart/style.ts","../src/widgets-v2/echart/echart-ui.tsx","../src/widgets-v2/echart/echart.tsx"],"sourcesContent":["import * as echarts from 'echarts'\nimport type { ECharts, EChartsOption } from 'echarts'\n\n/**\n * Render-time clamp that stops the first/last **category x-axis** labels from\n * clipping at the chart edges — *only when they actually overflow*.\n *\n * ECharts centers each category label on its tick; the first/last ticks sit at\n * the plot boundary, so a wide edge label spills past the chart and is cut off.\n * `grid.containLabel` does not contain this horizontal overflow and the v6\n * `outerBounds` shrink is unreliable, so we measure at render time and anchor\n * the overflowing edge label inward (`alignMinLabel: 'left'` /\n * `alignMaxLabel: 'right'`). Labels that fit stay centered.\n *\n * Lives in the generic bridge because the verdict needs the laid-out chart\n * (`convertToPixel`, `getWidth`); everything else is read from the `option`.\n * Auto-targets bar + histogram (category x-axis); pie's horizontal-bar fallback\n * (category *y*-axis), scatterplot (value) and timeseries (time) are skipped.\n */\n\nexport interface EdgeAlignment {\n alignMinLabel: 'left' | null\n alignMaxLabel: 'right' | null\n}\n\nexport const CENTERED: EdgeAlignment = {\n alignMinLabel: null,\n alignMaxLabel: null,\n}\n\n// Small cushion biasing toward anchoring when borderline: clipping is worse\n// than a hair of off-centering, and the measured width can differ slightly\n// from the final render (mainly when the web font isn't loaded yet at measure\n// time). Kept to 1px — a wider margin anchored labels that only just clear the\n// edge, and an anchored edge label can then be dropped by the axis\n// `hideOverlap`, leaving a gap. 1px guards measurement error without that.\nconst SAFETY_MARGIN_PX = 1\n\n/**\n * Pure overflow decision. Inputs are anchor-independent (tick centers and text\n * width don't depend on the label's current `text-anchor`), so feeding the\n * result back via `setOption` doesn't change them — the next pass yields the\n * same verdict, keeping the clamp loop-stable.\n */\nexport function decideEdgeAlignment(args: {\n firstLabel: string\n lastLabel: string\n font: string\n firstTickX: number\n lastTickX: number\n width: number\n}): EdgeAlignment {\n const halfFirst =\n echarts.format.getTextRect(args.firstLabel, args.font).width / 2\n const halfLast =\n echarts.format.getTextRect(args.lastLabel, args.font).width / 2\n return {\n alignMinLabel:\n halfFirst + SAFETY_MARGIN_PX > args.firstTickX ? 'left' : null,\n alignMaxLabel:\n halfLast + SAFETY_MARGIN_PX > args.width - args.lastTickX\n ? 'right'\n : null,\n }\n}\n\ninterface AxisLabel {\n formatter?: (value: string | number) => string | number\n fontSize?: number | string\n fontFamily?: string\n fontWeight?: number | string\n}\n\ninterface CategoryXAxis {\n type?: string\n axisLabel?: AxisLabel\n}\n\ninterface SeriesLike {\n encode?: { x?: string | number }\n datasetIndex?: number\n}\n\ntype Cell = string | number | null | undefined\n\nfunction firstOf<T>(value: T | T[] | undefined): T | undefined {\n if (Array.isArray(value)) return value[0]\n return value\n}\n\nfunction firstXAxis(option: EChartsOption): CategoryXAxis | undefined {\n const axis = firstOf(\n option.xAxis as CategoryXAxis | CategoryXAxis[] | undefined,\n )\n return axis && typeof axis === 'object' ? axis : undefined\n}\n\nfunction hasDataZoom(option: EChartsOption): boolean {\n const dz = option.dataZoom\n return Array.isArray(dz) ? dz.length > 0 : dz != null\n}\n\nfunction cellToText(value: Cell, fmt: AxisLabel['formatter']): string {\n if (typeof fmt === 'function') return String(fmt(value ?? ''))\n return value == null ? '' : String(value)\n}\n\n/**\n * Extracts the displayed first/last category strings and the label font from\n * the option, reading categories generically via `series[0].encode.x` into the\n * referenced dataset (`'name'` for bar, `0` for histogram). Returns `null` when\n * the option isn't a measurable category x-axis (fewer than 2 categories, no\n * dataset, etc.).\n */\nexport function resolveEdgeLabels(option: EChartsOption): {\n firstLabel: string\n lastLabel: string\n font: string\n count: number\n} | null {\n const xAxis = firstXAxis(option)\n if (!xAxis) return null\n if (xAxis.type !== 'category') return null\n\n const series0 = firstOf(\n option.series as SeriesLike | SeriesLike[] | undefined,\n )\n const encodeX = series0?.encode?.x\n if (encodeX == null) return null\n\n const datasetIndex = series0?.datasetIndex ?? 0\n const allDatasets = option.dataset as\n | { source?: unknown }\n | { source?: unknown }[]\n | undefined\n const dataset = Array.isArray(allDatasets)\n ? allDatasets[datasetIndex]\n : allDatasets\n const source = dataset?.source\n if (!Array.isArray(source) || source.length < 2) return null\n\n const rows = source as Record<string | number, Cell>[]\n const fmt = xAxis.axisLabel?.formatter\n const axisLabel = xAxis.axisLabel ?? {}\n const size =\n typeof axisLabel.fontSize === 'number'\n ? `${axisLabel.fontSize}px`\n : (axisLabel.fontSize ?? '12px')\n const family = axisLabel.fontFamily ?? 'sans-serif'\n const weight = axisLabel.fontWeight != null ? `${axisLabel.fontWeight} ` : ''\n\n return {\n firstLabel: cellToText(rows[0]?.[encodeX], fmt),\n lastLabel: cellToText(rows[rows.length - 1]?.[encodeX], fmt),\n font: `${weight}${size} ${family}`,\n count: source.length,\n }\n}\n\n/**\n * Measures the rendered chart and, when the edge labels would clip, applies\n * `alignMinLabel`/`alignMaxLabel` (or clears them) via an imperative merge\n * `setOption`. Returns the alignment now in effect so the caller can keep a\n * `prev` ref and skip redundant `setOption`s. Should be invoked from the\n * chart's `finished` event (layout is settled, so `convertToPixel` is valid).\n */\nexport function clampEdgeLabels(\n chart: ECharts,\n option: EChartsOption,\n prev: EdgeAlignment,\n): EdgeAlignment {\n const next = computeAlignment(chart, option)\n if (\n next.alignMinLabel === prev.alignMinLabel &&\n next.alignMaxLabel === prev.alignMaxLabel\n ) {\n return prev\n }\n chart.setOption({ xAxis: { axisLabel: { ...next } } } as EChartsOption, {\n lazyUpdate: true,\n })\n return next\n}\n\nfunction computeAlignment(\n chart: ECharts,\n option: EChartsOption,\n): EdgeAlignment {\n // Under dataZoom, convertToPixel on the absolute first/last index returns\n // off-plot pixels, so the overflow math is invalid — reset to centered.\n if (hasDataZoom(option)) return CENTERED\n\n const labels = resolveEdgeLabels(option)\n if (!labels) return CENTERED\n\n const firstTickX = chart.convertToPixel({ xAxisIndex: 0 }, 0)\n const lastTickX = chart.convertToPixel({ xAxisIndex: 0 }, labels.count - 1)\n const width = chart.getWidth()\n // Layout not measurable yet (defensive — `finished` normally fires after\n // layout). Fall back to centered; a later `finished` re-measures.\n if (\n typeof firstTickX !== 'number' ||\n typeof lastTickX !== 'number' ||\n !Number.isFinite(firstTickX) ||\n !Number.isFinite(lastTickX) ||\n !width\n ) {\n return CENTERED\n }\n\n return decideEdgeAlignment({\n firstLabel: labels.firstLabel,\n lastLabel: labels.lastLabel,\n font: labels.font,\n firstTickX,\n lastTickX,\n width,\n })\n}\n","type ResizeCallback = () => void\n\nconst callbacks = new Map<Element, ResizeCallback>()\nlet observer: ResizeObserver | null = null\n\n/**\n * Returns the singleton ResizeObserver, lazily constructing it on first use.\n * Returns `null` when `ResizeObserver` is not available in the global scope\n * (SSR, very old browsers, or tests that intentionally remove it).\n */\nfunction getObserver(): ResizeObserver | null {\n if (typeof ResizeObserver === 'undefined') return null\n observer ??= new ResizeObserver((entries) => {\n for (const entry of entries) {\n const callback = callbacks.get(entry.target)\n callback?.()\n }\n })\n return observer\n}\n\nconst NOOP_CLEANUP = (): void => undefined\n\nexport function observeResize(\n element: Element,\n callback: ResizeCallback,\n): () => void {\n const ro = getObserver()\n // Gracefully degrade when no ResizeObserver is available — consumers\n // still see one initial measure() pass via their own effect; we just\n // skip the subsequent resize-driven re-measures.\n if (!ro) return NOOP_CLEANUP\n callbacks.set(element, callback)\n ro.observe(element)\n return () => {\n callbacks.delete(element)\n if (observer) {\n observer.unobserve(element)\n // Disconnect the singleton once the last subscriber leaves so the\n // observer doesn't outlive its consumers in SSR teardown / micro-\n // frontend unmount scenarios. A subsequent observeResize() will\n // lazily re-create it via getObserver().\n if (callbacks.size === 0) {\n observer.disconnect()\n observer = null\n }\n }\n }\n}\n\n/** @internal — for tests only. */\nexport function __resetSharedResizeObserver(): void {\n if (observer) observer.disconnect()\n callbacks.clear()\n observer = null\n}\n","import type { SxProps, Theme } from '@mui/material'\n\nexport const styles = {\n root: {\n width: '100%',\n minHeight: 0,\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { useEffect, useEffectEvent, useRef } from 'react'\nimport { Box, type SxProps, type Theme } from '@mui/material'\nimport * as echarts from 'echarts'\nimport {\n clampEdgeLabels,\n CENTERED,\n type EdgeAlignment,\n} from './edge-label-clamp'\nimport { observeResize } from './shared-resize-observer'\nimport { styles } from './style'\n\nexport const DEFAULT_INIT_OPTS = {\n renderer: 'svg',\n height: 304,\n} satisfies echarts.EChartsInitOpts\n\nexport type EchartsEventHandler = (event: unknown) => void\n\nexport interface EchartUIProps {\n option: echarts.EChartsOption\n /**\n * Keys to merge as arrays (replace by index) instead of by id. The middleware\n * memoizes this content-stably, so identical sets don't re-trigger setOption.\n */\n replaceMerge?: readonly string[]\n /**\n * Opaque ECharts event passthrough — handlers fire untransformed.\n *\n * **Must be referentially stable** (memoize it with `useMemo` /\n * `useCallback`, or hoist to module scope). The binding effect depends on\n * the `onEvents` object identity; an inline `{ click: handler }` literal\n * recreates the object on every render and causes every listener to be\n * detached and re-attached each commit.\n */\n onEvents?: Record<string, EchartsEventHandler>\n /**\n * Init options forwarded to echarts.init. Captured at mount only — to change\n * `renderer` or `height` after mount, unmount and remount the chart.\n * Defaults: `{ renderer: 'svg', height: 304 }`.\n */\n init?: echarts.EChartsInitOpts\n /**\n * Optional callback fired once after the ECharts instance is created\n * (`onInstance(chart)`) and once when it's about to be disposed\n * (`onInstance(null)`). Used by `Widget.Echart` to publish the live\n * instance to the per-widget registry so other actions (e.g.\n * `ZoomToggle`'s disable handler) can reach it without DOM lookups.\n * No need to memoize — the bridge wraps it in `useEffectEvent` so an\n * unstable reference does not re-init the chart.\n */\n onInstance?: (chart: echarts.ECharts | null) => void\n className?: string\n sx?: SxProps<Theme>\n}\n\nexport function EchartUI({\n option,\n replaceMerge,\n onEvents,\n init,\n onInstance,\n className,\n sx,\n}: EchartUIProps) {\n const containerRef = useRef<HTMLDivElement>(null)\n const chartRef = useRef<echarts.ECharts | null>(null)\n\n // Structural fingerprint of the last applied series / dataset arrays.\n // Used to decide whether the next `setOption` should *replace* those\n // components (when their shape changed) or *merge* them (when only\n // styling-level fields differ — e.g. a new `itemStyle.color` callback\n // from a selection update). Replacing wipes ECharts' per-series runtime\n // state (hover, animation cache, brush areas), so we want to do it only\n // when the structure actually moved.\n const seriesFingerprintRef = useRef<string | null>(null)\n const datasetFingerprintRef = useRef<string | null>(null)\n\n // Latest applied option (read by the `finished` clamp listener, which is\n // bound once and must see the current option) + the edge-label alignment\n // currently applied to the chart (so the clamp skips redundant setOptions).\n const optionRef = useRef<echarts.EChartsOption>(option)\n const edgeAlignRef = useRef<EdgeAlignment>(CENTERED)\n\n // Stable notify wrapper — always reads the latest `onInstance` prop\n // without forcing the init effect below to re-run when the parent\n // passes a fresh function reference. The init effect now only fires\n // when `init` actually changes (documented as mount-only anyway).\n const notifyInstance = useEffectEvent(\n (chart: echarts.ECharts | null): void => {\n onInstance?.(chart)\n },\n )\n\n // Init / dispose. `init` is captured once at mount.\n useEffect(() => {\n if (!containerRef.current) return undefined\n const chart = echarts.init(containerRef.current, null, {\n ...DEFAULT_INIT_OPTS,\n ...init,\n })\n chartRef.current = chart\n notifyInstance(chart)\n // Edge-label clamp: after each layout settles (option change OR resize both\n // end in a render → `finished`), measure the category x-axis edge labels\n // and anchor them inward only if they'd clip. `finished` (not rAF) so\n // `convertToPixel` sees the flushed `lazyUpdate` layout. Loop-safe: the\n // verdict is anchor-independent, so our own clamp setOption recomputes the\n // same result and the ref guard short-circuits.\n const onFinished = (): void => {\n edgeAlignRef.current = clampEdgeLabels(\n chart,\n optionRef.current,\n edgeAlignRef.current,\n )\n }\n chart.on('finished', onFinished)\n return () => {\n chart.off('finished', onFinished)\n // Notify observers *before* disposal so any queued imperative\n // dispatches (e.g. ZoomToggle's `setOption` cleanup) see the\n // instance disappear before its DOM is torn down.\n notifyInstance(null)\n chart.dispose()\n chartRef.current = null\n }\n }, [init])\n\n // Apply option / replaceMerge changes via merge mode (no remount required).\n useEffect(() => {\n const seriesFp = computeSeriesFingerprint(option)\n const datasetFp = computeDatasetFingerprint(option)\n const augmented = new Set<string>(replaceMerge ?? [])\n if (seriesFp !== seriesFingerprintRef.current) augmented.add('series')\n if (datasetFp !== datasetFingerprintRef.current) augmented.add('dataset')\n seriesFingerprintRef.current = seriesFp\n datasetFingerprintRef.current = datasetFp\n // Expose the latest option to the `finished` clamp listener (bound once).\n optionRef.current = option\n chartRef.current?.setOption(option, {\n notMerge: false,\n lazyUpdate: true,\n replaceMerge: augmented.size > 0 ? Array.from(augmented) : undefined,\n })\n }, [option, replaceMerge])\n\n // Resize via shared singleton observer.\n useEffect(() => {\n const node = containerRef.current\n if (!node) return undefined\n return observeResize(node, () => {\n chartRef.current?.resize()\n })\n }, [])\n\n // Bind / unbind opaque event handlers.\n useEffect(() => {\n const chart = chartRef.current\n if (!chart || !onEvents) return undefined\n for (const [event, handler] of Object.entries(onEvents)) {\n chart.on(event, handler)\n }\n return () => {\n for (const [event, handler] of Object.entries(onEvents)) {\n chart.off(event, handler)\n }\n }\n }, [onEvents])\n\n return (\n <Box\n ref={containerRef}\n className={className}\n sx={{ ...styles.root, ...sx }}\n />\n )\n}\n\n/**\n * Cheap structural digest of the option's `series` array — covers the fields\n * that actually demand a `replaceMerge` (length, type, datasetIndex, name,\n * stack, encode). Excludes runtime-style fields like `itemStyle` (callbacks\n * have unstable identity but don't change structure).\n */\nfunction computeSeriesFingerprint(option: echarts.EChartsOption): string {\n const series = option.series\n if (!Array.isArray(series)) return series ? '1' : ''\n return series\n .map((s) => {\n if (s == null || typeof s !== 'object') return String(s)\n const o = s as Record<string, unknown>\n return [\n o.type,\n o.datasetIndex,\n o.name,\n o.stack,\n // `encode` is small; stringify is cheap and stable for plain objects.\n JSON.stringify(o.encode ?? null),\n ].join('|')\n })\n .join('||')\n}\n\n/**\n * Structural digest of the option's `dataset` array — count is the only\n * thing that needs `replaceMerge` here. Row-level changes are picked up by\n * ECharts' default merge.\n */\nfunction computeDatasetFingerprint(option: echarts.EChartsOption): string {\n const dataset = option.dataset\n if (!Array.isArray(dataset)) return dataset ? '1' : ''\n return String(dataset.length)\n}\n","import { useCallback, useMemo } from 'react'\nimport type * as echarts from 'echarts'\nimport {\n applyTransforms,\n setEchartInstance,\n useWidgetId,\n useWidgetShallow,\n type Transform,\n} from '../stores'\nimport { EchartUI, type EchartsEventHandler } from './echart-ui'\n\n/**\n * Default ECharts `replaceMerge` keys for every widget. `dataZoom` and\n * `brush` are omitted so ZoomToggle / BrushToggle's user-driven runtime\n * state (slider range, brushed areas in `multiple` mode) survives unrelated\n * re-renders. `series` and `dataset` are also omitted: EchartUI fingerprints\n * them per-render and adds them to `replaceMerge` only when their shape\n * actually changes, keeping ECharts' per-series runtime state alive when\n * only callback-style fields differ.\n *\n * Lives in this module (not the generic store) because it's an ECharts\n * concept. Module-private — callers should not need it.\n */\nconst DEFAULT_REPLACE_MERGE: readonly string[] = ['toolbox']\n\n/**\n * Reactive context passed to every {@link OptionFactory} call so the\n * factory can rebuild render-time pieces (axis label / tooltip formatters)\n * from the live store. Drives RelativeData / consumer-formatter changes\n * through to the chart without rebuilding the structural option.\n */\nexport interface OptionFactoryContext {\n formatter?: (value: number) => string\n labelFormatter?: (value: string | number) => string | number\n}\n\n/**\n * The per-widget option factory — a single callable that owns BOTH phases\n * of option construction:\n *\n * - **Structural phase** — when `option == null`, return the theme-aware\n * structural option (tooltip / legend / color palette / series\n * template, optionally merged with a consumer-supplied `optionsOverride`).\n * No data is read. `<Widget.Echart>` calls the factory with\n * `(undefined, undefined)` synchronously during render to derive the\n * structural base; `configTransforms` (Stack/Zoom/Brush) then mutate it\n * in the same render pass.\n * - **Merge phase** — when `option` is defined, fuse `data` into the\n * post-configTransforms option at fusion time. `<Widget.Echart>` calls\n * the factory with `(transformed, data, ctx)` on every render.\n *\n * The two phases share a closure (the factory creator captures `theme`,\n * `formatter`, `labelFormatter`, `seriesNames`, `selection`, `optionsOverride`,\n * …), so structural and merge agree on the same widget configuration.\n *\n * The third arg `ctx` carries the **live** store-side formatters at the\n * call site — distinct from the closure-time formatters because actions\n * like RelativeData can install a percent formatter on the store after\n * the factory was constructed. The merge phase reads from `ctx`; the\n * structural phase typically uses the closure-time values.\n */\nexport type OptionFactory = (\n option: echarts.EChartsOption | undefined,\n data: unknown,\n ctx?: OptionFactoryContext,\n) => echarts.EChartsOption\n\nexport interface EchartProps {\n /**\n * The per-widget {@link OptionFactory}. Required — `<Widget.Echart>`\n * derives the structural option from it (so configTransforms have a base\n * to mutate) and fuses `state.data` into the post-pipeline option at\n * render time. Wrap the factory creator in `useMemo` so its identity is\n * stable across renders.\n */\n optionFactory: OptionFactory\n onEvents?: Record<string, EchartsEventHandler>\n init?: echarts.EChartsInitOpts\n className?: string\n}\n\ninterface EchartSlice {\n data: unknown\n configTransforms: readonly Transform[]\n formatter?: (value: number) => string\n labelFormatter?: (value: string | number) => string | number\n}\n\nconst echartSelector = (s: {\n data: unknown\n configTransforms: readonly Transform[]\n formatter?: (value: number) => string\n labelFormatter?: (value: string | number) => string | number\n}): EchartSlice => ({\n data: s.data,\n configTransforms: s.configTransforms,\n formatter: s.formatter,\n labelFormatter: s.labelFormatter,\n})\n\n/**\n * Stateful Echart bridge — owns the entire ECharts coupling. The whole\n * option pipeline lives here, not in the store:\n *\n * 1. **Structural** — `optionFactory(undefined, undefined)` produces the\n * theme-aware base. Memoized on the factory identity, so the consumer's\n * `useMemo` ID gates the rebuild.\n * 2. **Transformed** — `applyTransforms(structural, configTransforms)`\n * applies any registered configTransforms (Stack/Zoom/Brush) over the\n * structural base. Memoized on `[structural, configTransforms]`.\n * 3. **`replaceMerge`** — derived from the enabled configTransforms'\n * `replaceMergeKeys`, deduped and sorted, seeded with\n * {@link DEFAULT_REPLACE_MERGE}. Memoized on `[configTransforms]` so\n * ECharts sees a stable array reference across non-transform changes.\n * 4. **Merge** — `optionFactory(transformed, data, ctx)` fuses post-\n * pipeline data into the option. Reactive `ctx` carries the live store\n * formatters so RelativeData's percent formatter flows through without\n * a structural rebuild.\n *\n * The `<Widget.Provider>` doesn't know about the factory at all: it stays\n * a renderer-agnostic shell. The `ProviderProps` surface has no ECharts\n * coupling, so non-Echart widgets don't transitively import the type.\n */\nexport function Echart({\n optionFactory,\n onEvents,\n init,\n className,\n}: EchartProps) {\n const id = useWidgetId()\n const slice = useWidgetShallow(id, echartSelector)\n\n // Publish the live ECharts instance to the per-id registry so actions\n // (e.g. `ZoomToggle`'s disable handler) can reach it imperatively. The\n // callback identity is stable across renders (only `id` is in deps), so\n // EchartUI's init effect doesn't see a fresh `onInstance` and re-init.\n const onInstance = useCallback(\n (chart: echarts.ECharts | null) => setEchartInstance(id, chart),\n [id],\n )\n\n // Destructure so React Compiler sees specific deps instead of inferring\n // the whole `slice` object. `useWidgetShallow` already shallow-compares\n // the slice, so per-field deps drive each memo exactly when its inputs\n // change.\n const {\n data: sliceData,\n configTransforms,\n formatter: sliceFormatter,\n labelFormatter: sliceLabelFormatter,\n } = slice\n\n const structural = useMemo(\n () => optionFactory(undefined, undefined),\n [optionFactory],\n )\n\n const transformed = useMemo(\n () =>\n applyTransforms(structural, configTransforms) as echarts.EChartsOption,\n [structural, configTransforms],\n )\n\n const replaceMerge = useMemo(() => {\n const keys = new Set<string>(DEFAULT_REPLACE_MERGE)\n for (const xf of configTransforms) {\n if (xf.enabled && xf.replaceMergeKeys?.length) {\n for (const k of xf.replaceMergeKeys) keys.add(k)\n }\n }\n return Array.from(keys).sort()\n }, [configTransforms])\n\n const option = useMemo(\n () =>\n optionFactory(transformed, sliceData, {\n formatter: sliceFormatter,\n labelFormatter: sliceLabelFormatter,\n }),\n [\n optionFactory,\n transformed,\n sliceData,\n sliceFormatter,\n sliceLabelFormatter,\n ],\n )\n\n return (\n <EchartUI\n option={option}\n replaceMerge={replaceMerge}\n onEvents={onEvents}\n init={init}\n onInstance={onInstance}\n className={className}\n />\n )\n}\n"],"names":["CENTERED","alignMinLabel","alignMaxLabel","SAFETY_MARGIN_PX","decideEdgeAlignment","args","halfFirst","echarts","format","getTextRect","firstLabel","font","width","halfLast","lastLabel","firstTickX","lastTickX","firstOf","value","Array","isArray","firstXAxis","option","axis","xAxis","undefined","hasDataZoom","dz","dataZoom","length","cellToText","fmt","String","resolveEdgeLabels","type","series0","series","encodeX","encode","x","datasetIndex","allDatasets","dataset","source","rows","axisLabel","formatter","size","fontSize","family","fontFamily","weight","fontWeight","count","clampEdgeLabels","chart","prev","next","computeAlignment","setOption","lazyUpdate","labels","convertToPixel","xAxisIndex","getWidth","Number","isFinite","callbacks","Map","observer","getObserver","ResizeObserver","entries","entry","callback","get","target","NOOP_CLEANUP","observeResize","element","ro","set","observe","delete","unobserve","disconnect","__resetSharedResizeObserver","clear","styles","root","minHeight","DEFAULT_INIT_OPTS","renderer","height","EchartUI","t0","$","_c","replaceMerge","onEvents","init","onInstance","className","sx","containerRef","useRef","chartRef","seriesFingerprintRef","datasetFingerprintRef","optionRef","edgeAlignRef","t1","notifyInstance","useEffectEvent","t2","current","chart_0","onFinished","on","off","dispose","t3","useEffect","t4","t5","seriesFp","computeSeriesFingerprint","datasetFp","computeDatasetFingerprint","augmented","Set","add","notMerge","from","t6","t7","Symbol","for","node","resize","t8","t9","chart_1","event","handler","Object","event_0","handler_0","t10","t11","Box","map","s","o","name","stack","JSON","stringify","join","DEFAULT_REPLACE_MERGE","echartSelector","data","configTransforms","labelFormatter","Echart","optionFactory","id","useWidgetId","slice","useWidgetShallow","setEchartInstance","sliceData","sliceFormatter","sliceLabelFormatter","structural","applyTransforms","transformed","keys","xf","enabled","replaceMergeKeys","k","sort"],"mappings":";;;;;;;;AAyBO,MAAMA,IAA0B;AAAA,EACrCC,eAAe;AAAA,EACfC,eAAe;AACjB,GAQMC,IAAmB;AAQlB,SAASC,EAAoBC,GAOlB;AAChB,QAAMC,IACJC,EAAQC,OAAOC,YAAYJ,EAAKK,YAAYL,EAAKM,IAAI,EAAEC,QAAQ,GAC3DC,IACJN,EAAQC,OAAOC,YAAYJ,EAAKS,WAAWT,EAAKM,IAAI,EAAEC,QAAQ;AAChE,SAAO;AAAA,IACLX,eACEK,IAAYH,IAAmBE,EAAKU,aAAa,SAAS;AAAA,IAC5Db,eACEW,IAAWV,IAAmBE,EAAKO,QAAQP,EAAKW,YAC5C,UACA;AAAA,EAAA;AAEV;AAqBA,SAASC,EAAWC,GAA2C;AAC7D,SAAIC,MAAMC,QAAQF,CAAK,IAAUA,EAAM,CAAC,IACjCA;AACT;AAEA,SAASG,EAAWC,GAAkD;AACpE,QAAMC,IAAON,EACXK,EAAOE,KACT;AACA,SAAOD,KAAQ,OAAOA,KAAS,WAAWA,IAAOE;AACnD;AAEA,SAASC,EAAYJ,GAAgC;AACnD,QAAMK,IAAKL,EAAOM;AAClB,SAAOT,MAAMC,QAAQO,CAAE,IAAIA,EAAGE,SAAS,IAAIF,KAAM;AACnD;AAEA,SA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