@deephaven/components 0.71.1-beta.0 → 0.72.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.
Files changed (39) hide show
  1. package/dist/Button.d.ts +1 -1
  2. package/dist/SearchInput.css +10 -12
  3. package/dist/SearchInput.css.map +1 -1
  4. package/dist/Select.d.ts +2 -1
  5. package/dist/Select.d.ts.map +1 -1
  6. package/dist/Select.js +5 -2
  7. package/dist/Select.js.map +1 -1
  8. package/dist/index.d.ts +0 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +0 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/spectrum/index.js +1 -1
  13. package/dist/spectrum/picker/Picker.d.ts +6 -6
  14. package/dist/spectrum/picker/Picker.d.ts.map +1 -1
  15. package/dist/spectrum/picker/Picker.js +10 -9
  16. package/dist/spectrum/picker/Picker.js.map +1 -1
  17. package/dist/spectrum/picker/index.d.ts +1 -1
  18. package/dist/spectrum/picker/index.d.ts.map +1 -1
  19. package/dist/spectrum/picker/index.js +1 -1
  20. package/dist/spectrum/picker/index.js.map +1 -1
  21. package/dist/spectrum/utils/index.d.ts +3 -0
  22. package/dist/spectrum/utils/index.d.ts.map +1 -0
  23. package/dist/spectrum/utils/index.js +3 -0
  24. package/dist/spectrum/utils/index.js.map +1 -0
  25. package/dist/spectrum/utils/itemUtils.d.ts +111 -0
  26. package/dist/spectrum/utils/itemUtils.d.ts.map +1 -0
  27. package/dist/spectrum/{picker/PickerUtils.js → utils/itemUtils.js} +46 -45
  28. package/dist/spectrum/utils/itemUtils.js.map +1 -0
  29. package/dist/spectrum/{utils.d.ts → utils/themeUtils.d.ts} +2 -1
  30. package/dist/spectrum/utils/themeUtils.d.ts.map +1 -0
  31. package/dist/spectrum/{utils.js → utils/themeUtils.js} +3 -2
  32. package/dist/spectrum/utils/themeUtils.js.map +1 -0
  33. package/dist/theme/SpectrumThemeProvider.js +1 -1
  34. package/package.json +8 -7
  35. package/dist/spectrum/picker/PickerUtils.d.ts +0 -111
  36. package/dist/spectrum/picker/PickerUtils.d.ts.map +0 -1
  37. package/dist/spectrum/picker/PickerUtils.js.map +0 -1
  38. package/dist/spectrum/utils.d.ts.map +0 -1
  39. package/dist/spectrum/utils.js.map +0 -1
@@ -1,111 +0,0 @@
1
- import { Key, ReactElement, ReactNode } from 'react';
2
- import { SpectrumPickerProps } from '@adobe/react-spectrum';
3
- import type { ItemRenderer } from '@react-types/shared';
4
- import { KeyedItem } from '@deephaven/utils';
5
- import { ItemProps, SectionProps } from '../shared';
6
- import { PopperOptions } from '../../popper';
7
- export declare const INVALID_PICKER_ITEM_ERROR_MESSAGE = "Picker items must be strings, numbers, booleans, <Item> or <Section> elements:";
8
- /**
9
- * React Spectrum <Section> supports an `ItemRenderer` function as a child. The
10
- * DH picker makes use of this internally, but we don't want to support it as
11
- * an incoming prop.
12
- */
13
- type SectionPropsNoItemRenderer<T> = Omit<SectionProps<T>, 'children'> & {
14
- children: Exclude<SectionProps<T>['children'], ItemRenderer<T>>;
15
- };
16
- type ItemElement = ReactElement<ItemProps<unknown>>;
17
- type SectionElement = ReactElement<SectionPropsNoItemRenderer<unknown>>;
18
- export type PickerItem = number | string | boolean | ItemElement;
19
- export type PickerSection = SectionElement;
20
- export type PickerItemOrSection = PickerItem | PickerSection;
21
- /**
22
- * Augment the Spectrum selection key type to include boolean values.
23
- * The Spectrum Picker already supports this, but the built in types don't
24
- * reflect it.
25
- */
26
- export type PickerItemKey = Key | boolean;
27
- /**
28
- * Augment the Spectrum selection change handler type to include boolean keys.
29
- * The Spectrum Picker already supports this, but the built in types don't
30
- * reflect it.
31
- */
32
- export type PickerSelectionChangeHandler = (key: PickerItemKey) => void;
33
- export interface NormalizedPickerItemData {
34
- key?: PickerItemKey;
35
- content: ReactNode;
36
- textValue?: string;
37
- }
38
- export interface NormalizedPickerSectionData {
39
- key?: Key;
40
- title?: ReactNode;
41
- items: NormalizedPickerItem[];
42
- }
43
- /**
44
- * The Picker supports a variety of item types, including strings, numbers,
45
- * booleans, and more complex React elements. This type represents a normalized
46
- * form to make rendering items simpler and keep the logic of transformation
47
- * in separate util methods. It also adheres to the `KeyedItem` interface to
48
- * be compatible with Windowed data utils (e.g. `useViewportData`).
49
- */
50
- export type NormalizedPickerItem = KeyedItem<NormalizedPickerItemData, PickerItemKey | undefined>;
51
- export type NormalizedPickerSection = KeyedItem<NormalizedPickerSectionData, Key | undefined>;
52
- export type NormalizedSpectrumPickerProps = SpectrumPickerProps<NormalizedPickerItem>;
53
- export type TooltipOptions = {
54
- placement: PopperOptions['placement'];
55
- };
56
- /**
57
- * Picker uses a normalized item that includes a `key` prop and an optional
58
- * `item` prop. This is mostly to support Windowed data where items are created
59
- * before their data has been loaded (data gets set in the `item` prop). If
60
- * data has loaded, return its `key`. If not, return the top-level `key` on the
61
- * normalized item.
62
- * @param item The normalized picker item or section
63
- * @returns The `key` of the item or section
64
- */
65
- export declare function getPickerItemKey<TItem extends NormalizedPickerItem | NormalizedPickerSection, TKey extends TItem extends NormalizedPickerItem ? PickerItemKey | undefined : TItem extends NormalizedPickerSection ? Key | undefined : undefined>(item: TItem | null | undefined): TKey;
66
- /**
67
- * Determine if a node is a Section element.
68
- * @param node The node to check
69
- * @returns True if the node is a Section element
70
- */
71
- export declare function isSectionElement<T>(node: ReactNode): node is ReactElement<SectionProps<T>>;
72
- /**
73
- * Determine if a node is an Item element.
74
- * @param node The node to check
75
- * @returns True if the node is an Item element
76
- */
77
- export declare function isItemElement<T>(node: ReactNode): node is ReactElement<ItemProps<T>>;
78
- /**
79
- * Determine if a node is an array containing normalized items with keys.
80
- * Note that this only checks the first node in the array.
81
- * @param node The node to check
82
- * @returns True if the node is a normalized item with keys array
83
- */
84
- export declare function isNormalizedItemsWithKeysList(node: PickerItemOrSection | PickerItemOrSection[] | (NormalizedPickerItem | NormalizedPickerSection)[]): node is (NormalizedPickerItem | NormalizedPickerSection)[];
85
- /**
86
- * Determine if an object is a normalized Picker section.
87
- * @param maybeNormalizedPickerSection The object to check
88
- * @returns True if the object is a normalized Picker section
89
- */
90
- export declare function isNormalizedPickerSection(maybeNormalizedPickerSection: NormalizedPickerItem | NormalizedPickerSection): maybeNormalizedPickerSection is NormalizedPickerSection;
91
- /**
92
- * Determine if a node is a Picker item or section. Valid types include strings,
93
- * numbers, booleans, Item elements, and Section elements.
94
- * @param node The node to check
95
- * @returns True if the node is a Picker item or section
96
- */
97
- export declare function isPickerItemOrSection(node: ReactNode): node is PickerItemOrSection;
98
- /**
99
- * Get normalized picker items from a picker item or array of picker items.
100
- * @param itemsOrSections A picker item or array of picker items
101
- * @returns An array of normalized picker items
102
- */
103
- export declare function normalizePickerItemList(itemsOrSections: PickerItemOrSection | PickerItemOrSection[] | NormalizedPickerItem[]): (NormalizedPickerItem | NormalizedPickerSection)[];
104
- /**
105
- * Returns a TooltipOptions object or null if options is false or null.
106
- * @param options
107
- * @returns TooltipOptions or null
108
- */
109
- export declare function normalizeTooltipOptions(options?: boolean | TooltipOptions | null): TooltipOptions | null;
110
- export {};
111
- //# sourceMappingURL=PickerUtils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PickerUtils.d.ts","sourceRoot":"","sources":["../../../src/spectrum/picker/PickerUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAQ,SAAS,EAAW,YAAY,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAI7C,eAAO,MAAM,iCAAiC,mFACoC,CAAC;AAEnF;;;;GAIG;AACH,KAAK,0BAA0B,CAAC,CAAC,IAAI,IA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ACrC,OAAO,CAAC,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,GACxC,cAAc,GAAG,IAAI,CAUvB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PickerUtils.js","names":["isValidElement","Log","Item","Section","log","module","INVALID_PICKER_ITEM_ERROR_MESSAGE","getPickerItemKey","item","_item$item$key","_item$item","key","isSectionElement","node","type","isItemElement","isNormalizedItemsWithKeysList","Array","isArray","length","isPickerItemOrSection","isNormalizedPickerSection","maybeNormalizedPickerSection","normalizeItemKey","itemOrSection","_itemOrSection$props$","props","title","undefined","textValue","children","normalizeTextValue","String","normalizePickerItem","debug","Error","items","normalizePickerItemList","filter","childItem","content","itemsOrSections","itemsArray","map","normalizeTooltipOptions","options","placement"],"sources":["../../../src/spectrum/picker/PickerUtils.ts"],"sourcesContent":["import { isValidElement, Key, ReactElement, ReactNode } from 'react';\nimport { SpectrumPickerProps } from '@adobe/react-spectrum';\nimport type { ItemRenderer } from '@react-types/shared';\nimport Log from '@deephaven/log';\nimport { KeyedItem } from '@deephaven/utils';\nimport { Item, ItemProps, Section, SectionProps } from '../shared';\nimport { PopperOptions } from '../../popper';\n\nconst log = Log.module('PickerUtils');\n\nexport const INVALID_PICKER_ITEM_ERROR_MESSAGE =\n 'Picker items must be strings, numbers, booleans, <Item> or <Section> elements:';\n\n/**\n * React Spectrum <Section> supports an `ItemRenderer` function as a child. The\n * DH picker makes use of this internally, but we don't want to support it as\n * an incoming prop.\n */\ntype SectionPropsNoItemRenderer<T> = Omit<SectionProps<T>, 'children'> & {\n children: Exclude<SectionProps<T>['children'], ItemRenderer<T>>;\n};\n\ntype ItemElement = ReactElement<ItemProps<unknown>>;\ntype SectionElement = ReactElement<SectionPropsNoItemRenderer<unknown>>;\n\nexport type PickerItem = number | string | boolean | ItemElement;\nexport type PickerSection = SectionElement;\nexport type PickerItemOrSection = PickerItem | PickerSection;\n\n/**\n * Augment the Spectrum selection key type to include boolean values.\n * The Spectrum Picker already supports this, but the built in types don't\n * reflect it.\n */\nexport type PickerItemKey = Key | boolean;\n\n/**\n * Augment the Spectrum selection change handler type to include boolean keys.\n * The Spectrum Picker already supports this, but the built in types don't\n * reflect it.\n */\nexport type PickerSelectionChangeHandler = (key: PickerItemKey) => void;\n\nexport interface NormalizedPickerItemData {\n key?: PickerItemKey;\n content: ReactNode;\n textValue?: string;\n}\n\nexport interface NormalizedPickerSectionData {\n key?: Key;\n title?: ReactNode;\n items: NormalizedPickerItem[];\n}\n\n/**\n * The Picker supports a variety of item types, including strings, numbers,\n * booleans, and more complex React elements. This type represents a normalized\n * form to make rendering items simpler and keep the logic of transformation\n * in separate util methods. It also adheres to the `KeyedItem` interface to\n * be compatible with Windowed data utils (e.g. `useViewportData`).\n */\nexport type NormalizedPickerItem = KeyedItem<\n NormalizedPickerItemData,\n PickerItemKey | undefined\n>;\n\nexport type NormalizedPickerSection = KeyedItem<\n NormalizedPickerSectionData,\n Key | undefined\n>;\n\nexport type NormalizedSpectrumPickerProps =\n SpectrumPickerProps<NormalizedPickerItem>;\n\nexport type TooltipOptions = { placement: PopperOptions['placement'] };\n\n/**\n * Picker uses a normalized item that includes a `key` prop and an optional\n * `item` prop. This is mostly to support Windowed data where items are created\n * before their data has been loaded (data gets set in the `item` prop). If\n * data has loaded, return its `key`. If not, return the top-level `key` on the\n * normalized item.\n * @param item The normalized picker item or section\n * @returns The `key` of the item or section\n */\nexport function getPickerItemKey<\n TItem extends NormalizedPickerItem | NormalizedPickerSection,\n TKey extends TItem extends NormalizedPickerItem\n ? PickerItemKey | undefined\n : TItem extends NormalizedPickerSection\n ? Key | undefined\n : undefined,\n>(item: TItem | null | undefined): TKey {\n return (item?.item?.key ?? item?.key) as TKey;\n}\n\n/**\n * Determine if a node is a Section element.\n * @param node The node to check\n * @returns True if the node is a Section element\n */\nexport function isSectionElement<T>(\n node: ReactNode\n): node is ReactElement<SectionProps<T>> {\n return isValidElement<SectionProps<T>>(node) && node.type === Section;\n}\n\n/**\n * Determine if a node is an Item element.\n * @param node The node to check\n * @returns True if the node is an Item element\n */\nexport function isItemElement<T>(\n node: ReactNode\n): node is ReactElement<ItemProps<T>> {\n return isValidElement<ItemProps<T>>(node) && node.type === Item;\n}\n\n/**\n * Determine if a node is an array containing normalized items with keys.\n * Note that this only checks the first node in the array.\n * @param node The node to check\n * @returns True if the node is a normalized item with keys array\n */\nexport function isNormalizedItemsWithKeysList(\n node:\n | PickerItemOrSection\n | PickerItemOrSection[]\n | (NormalizedPickerItem | NormalizedPickerSection)[]\n): node is (NormalizedPickerItem | NormalizedPickerSection)[] {\n if (!Array.isArray(node)) {\n return false;\n }\n\n if (node.length === 0) {\n return true;\n }\n\n return !isPickerItemOrSection(node[0]) && 'key' in node[0];\n}\n\n/**\n * Determine if an object is a normalized Picker section.\n * @param maybeNormalizedPickerSection The object to check\n * @returns True if the object is a normalized Picker section\n */\nexport function isNormalizedPickerSection(\n maybeNormalizedPickerSection: NormalizedPickerItem | NormalizedPickerSection\n): maybeNormalizedPickerSection is NormalizedPickerSection {\n return (\n maybeNormalizedPickerSection.item != null &&\n 'items' in maybeNormalizedPickerSection.item\n );\n}\n\n/**\n * Determine if a node is a Picker item or section. Valid types include strings,\n * numbers, booleans, Item elements, and Section elements.\n * @param node The node to check\n * @returns True if the node is a Picker item or section\n */\nexport function isPickerItemOrSection(\n node: ReactNode\n): node is PickerItemOrSection {\n return (\n typeof node === 'string' ||\n typeof node === 'number' ||\n typeof node === 'boolean' ||\n isItemElement(node) ||\n isSectionElement(node)\n );\n}\n\n/**\n * Determine the `key` of a picker item or section.\n * @param itemOrSection The picker item or section\n * @returns A `PickerItemKey` for the picker item or undefined if a key can't be determined\n */\nfunction normalizeItemKey(item: PickerItem): PickerItemKey | undefined;\nfunction normalizeItemKey(section: PickerSection): Key | undefined;\nfunction normalizeItemKey(\n itemOrSection: PickerItem | PickerSection\n): Key | PickerItemKey | undefined {\n // string, number, or boolean\n if (typeof itemOrSection !== 'object') {\n return itemOrSection;\n }\n\n // If `key` prop is explicitly set\n if (itemOrSection.key != null) {\n return itemOrSection.key;\n }\n\n // Section element\n if (isSectionElement(itemOrSection)) {\n return typeof itemOrSection.props.title === 'string'\n ? itemOrSection.props.title\n : undefined;\n }\n\n // Item element\n return (\n itemOrSection.props.textValue ??\n (typeof itemOrSection.props.children === 'string'\n ? itemOrSection.props.children\n : undefined)\n );\n}\n\n/**\n * Get a normalized `textValue` for a picker item ensuring it is a string.\n * @param item The picker item\n * @returns A string `textValue` for the picker item\n */\nfunction normalizeTextValue(item: PickerItem): string | undefined {\n if (typeof item !== 'object') {\n return String(item);\n }\n\n if (item.props.textValue != null) {\n return item.props.textValue;\n }\n\n if (typeof item.props.children === 'string') {\n return item.props.children;\n }\n\n return undefined;\n}\n\n/**\n * Normalize a picker item to an object form.\n * @param itemOrSection item to normalize\n * @returns NormalizedPickerItem object\n */\nfunction normalizePickerItem(\n itemOrSection: PickerItemOrSection\n): NormalizedPickerItem | NormalizedPickerSection {\n if (!isPickerItemOrSection(itemOrSection)) {\n log.debug(INVALID_PICKER_ITEM_ERROR_MESSAGE, itemOrSection);\n throw new Error(INVALID_PICKER_ITEM_ERROR_MESSAGE);\n }\n\n if (isSectionElement(itemOrSection)) {\n const key = normalizeItemKey(itemOrSection);\n const { title } = itemOrSection.props;\n\n const items = normalizePickerItemList(itemOrSection.props.children).filter(\n // We don't support nested section elements\n childItem => !isSectionElement(childItem)\n ) as NormalizedPickerItem[];\n\n return {\n item: { key, title, items },\n };\n }\n\n const key = normalizeItemKey(itemOrSection);\n const content = isItemElement(itemOrSection)\n ? itemOrSection.props.children\n : itemOrSection;\n const textValue = normalizeTextValue(itemOrSection);\n\n return {\n item: { key, content, textValue },\n };\n}\n\n/**\n * Get normalized picker items from a picker item or array of picker items.\n * @param itemsOrSections A picker item or array of picker items\n * @returns An array of normalized picker items\n */\nexport function normalizePickerItemList(\n itemsOrSections:\n | PickerItemOrSection\n | PickerItemOrSection[]\n | NormalizedPickerItem[]\n): (NormalizedPickerItem | NormalizedPickerSection)[] {\n // If already normalized, just return as-is\n if (isNormalizedItemsWithKeysList(itemsOrSections)) {\n return itemsOrSections;\n }\n\n const itemsArray = Array.isArray(itemsOrSections)\n ? itemsOrSections\n : [itemsOrSections];\n\n return itemsArray.map(normalizePickerItem);\n}\n\n/**\n * Returns a TooltipOptions object or null if options is false or null.\n * @param options\n * @returns TooltipOptions or null\n */\nexport function normalizeTooltipOptions(\n options?: boolean | TooltipOptions | null\n): TooltipOptions | null {\n if (options == null || options === false) {\n return null;\n }\n\n if (options === true) {\n return { placement: 'right' };\n }\n\n return options;\n}\n"],"mappings":"AAAA,SAASA,cAAc,QAAsC,OAAO;AAGpE,OAAOC,GAAG,MAAM,gBAAgB;AAAC,SAExBC,IAAI,EAAaC,OAAO;AAGjC,IAAMC,GAAG,GAAGH,GAAG,CAACI,MAAM,CAAC,aAAa,CAAC;AAErC,OAAO,IAAMC,iCAAiC,GAC5C,gFAAgF;;AAElF;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAO9BC,IAA8B,EAAQ;EAAA,IAAAC,cAAA,EAAAC,UAAA;EACtC,QAAAD,cAAA,GAAQD,IAAI,aAAJA,IAAI,wBAAAE,UAAA,GAAJF,IAAI,CAAEA,IAAI,cAAAE,UAAA,uBAAVA,UAAA,CAAYC,GAAG,cAAAF,cAAA,cAAAA,cAAA,GAAID,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEG,GAAG;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAC9BC,IAAe,EACwB;EACvC,OAAO,aAAAb,cAAc,CAAkBa,IAAI,CAAC,IAAIA,IAAI,CAACC,IAAI,KAAKX,OAAO;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACA,OA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1B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","names":["theme","themeSpectrumClassesCommon","global","light","dark","medium","large","themeDHDefault","_objectSpread"],"sources":["../../src/spectrum/utils.ts"],"sourcesContent":["import { theme } from '@react-spectrum/theme-default';\nimport { themeSpectrumClassesCommon } from '../theme/theme-spectrum';\n\nconst { global, light, dark, medium, large } = theme;\n\n/**\n * Extend light + dark theme variables with DH defaults.\n *\n * A theme is just a mapped collection of css class names that are generated\n * from a collection of css modules.\n *\n * e.g.\n * {\n * global: {\n * spectrum: 'spectrum_9e130c',\n * 'spectrum--medium': 'spectrum--medium_9e130c',\n * 'spectrum--large': 'spectrum--large_9e130c',\n * 'spectrum--darkest': 'spectrum--darkest_9e130c',\n * 'spectrum--dark': 'spectrum--dark_9e130c',\n * 'spectrum--light': 'spectrum--light_9e130c',\n * 'spectrum--lightest': 'spectrum--lightest_9e130c',\n * },\n * light: {\n * 'spectrum--light': 'spectrum--light_a40724',\n * 'dh-spectrum-theme--light': '_dh-spectrum-theme--light_1hblg_22',\n * },\n * dark: {\n * 'spectrum--darkest': 'spectrum--darkest_256eeb',\n * 'dh-spectrum-theme--dark': '_dh-spectrum-theme--dark_f7kge_22',\n * },\n * medium: {\n * 'spectrum--medium': 'spectrum--medium_4b172c',\n * },\n * large: {\n * 'spectrum--large': 'spectrum--large_c40598',\n * },\n * }\n */\n/* eslint-disable import/prefer-default-export */\nexport const themeDHDefault = {\n global,\n light: {\n ...light,\n ...themeSpectrumClassesCommon,\n },\n dark: {\n ...dark,\n ...themeSpectrumClassesCommon,\n },\n // scales\n medium,\n large,\n};\n"],"mappings":";;;;;AAAA,SAASA,KAAK,QAAQ,+BAA+B;AAAC,SAC7CC,0BAA0B;AAEnC,IAAM;EAAEC,MAAM;EAAEC,KAAK;EAAEC,IAAI;EAAEC,MAAM;EAAEC;AAAM,CAAC,GAAGN,KAAK;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMO,cAAc,GAAG;EAC5BL,MAAM;EACNC,KAAK,EAAAK,aAAA,CAAAA,aAAA,KACAL,KAAK,GACLF,0BAA0B,CAC9B;EACDG,IAAI,EAAAI,aAAA,CAAAA,aAAA,KACCJ,IAAI,GACJH,0BAA0B,CAC9B;EACD;EACAI,MAAM;EACNC;AACF,CAAC"}