@openg2p/registry-widgets 0.1.6 → 0.1.8

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.
@@ -7,9 +7,13 @@ import downArrowIcon from './down_arrow.png';
7
7
  import personIcon from './person.png';
8
8
  import calendarIcon from './calendar.png';
9
9
  import rightArrowIcon from './right_arrow.png';
10
+ import arrowUpIcon from './arrow_up.png';
11
+ import arrowDownIcon from './arrow_down.png';
12
+ import arrowLeftIcon from './arrow_left.png';
13
+ import arrowRightIcon from './arrow_right.png';
10
14
  import resetIcon from './reset_icon.png';
11
15
  import previewIcon from './preview_icon.png';
12
16
  import maximizeIcon from './maximize_icon.png';
13
17
  import minimizeIcon from './minimize_icon.png';
14
- export { dummyProfile, fileIcon, uploadIcon, closeSign, dummyDoc, downArrowIcon, personIcon, calendarIcon, rightArrowIcon, resetIcon, previewIcon, maximizeIcon, minimizeIcon, };
18
+ export { dummyProfile, fileIcon, uploadIcon, closeSign, dummyDoc, downArrowIcon, personIcon, calendarIcon, rightArrowIcon, arrowUpIcon, arrowDownIcon, arrowLeftIcon, arrowRightIcon, resetIcon, previewIcon, maximizeIcon, minimizeIcon, };
15
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,SAAS,MAAM,kB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ACZ,YAAY,GACf,CAAC"}
@@ -21,6 +21,22 @@ export interface SectionRendererProps {
21
21
  showChangeRequestLabel?: boolean;
22
22
  dbSectionId?: string;
23
23
  sectionRegisterId?: string;
24
+ /** Called when the section's dirty (has unsaved changes) status changes. Only fires while in edit mode. */
25
+ onSectionDirtyChange?: (sectionId: string, isDirty: boolean) => void;
26
+ /** IntakeForm mode: 0-based index of this section within the form */
27
+ sectionIndex?: number;
28
+ /** IntakeForm mode: total number of sections in the form */
29
+ sectionCount?: number;
30
+ /** IntakeForm mode: index of the currently expanded section (null = all collapsed) */
31
+ expandedSectionIndex?: number | null;
32
+ /** IntakeForm mode: called when user requests to expand a section (e.g. clicks accordion header) */
33
+ onExpandSection?: (index: number) => void;
34
+ /** IntakeForm mode: called when section save completes successfully (collapse current, expand next) */
35
+ onSectionSaveSuccess?: (index: number) => void;
36
+ /** IntakeForm mode: called when user clicks Previous (collapse current, expand previous) */
37
+ onPreviousSection?: (index: number) => void;
38
+ /** IntakeForm mode: when true or undefined, sections are editable; when false, sections are readonly */
39
+ isDraft?: boolean;
24
40
  }
25
41
  /**
26
42
  * Renders a section with its panels
@@ -30,5 +46,5 @@ export interface SectionRendererProps {
30
46
  * - Panels wrap when they exceed available width
31
47
  * - Sections can sit side-by-side if there's space
32
48
  */
33
- export declare const SectionRenderer: ({ section, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, gridColumnSpan, onSectionSave, hideEditButton, mode, namespace, changeRequestType, showChangeRequestLabel, dbSectionId, sectionRegisterId, }: SectionRendererProps) => import("react/jsx-runtime").JSX.Element;
49
+ export declare const SectionRenderer: ({ section, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, gridColumnSpan, onSectionSave, hideEditButton, mode, namespace, changeRequestType, showChangeRequestLabel, dbSectionId, sectionRegisterId, onSectionDirtyChange, sectionIndex, sectionCount, expandedSectionIndex, onExpandSection, onSectionSaveSuccess, onPreviousSection, isDraft, }: SectionRendererProps) => import("react/jsx-runtime").JSX.Element;
34
50
  //# sourceMappingURL=SectionRenderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SectionRenderer.d.ts","sourceRoot":"","sources":["../../src/components/SectionRenderer.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAyC,MAAM,UAAU,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAM9D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAMlD,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,aAAa,CAAC;IACvB,wBAAwB,CAAC,EAAE,oBAAoB,CAAC,0BAA0B,CAAC,CAAC;IAC5E,UAAU,CAAC,EAAE,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAChD,aAAa,CAAC,EAAE,oBAAoB,CAAC,eAAe,CAAC,CAAC;IACtD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAClE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IAClC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAGjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAE5B;AAGD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,4OAc7B,oBAAoB,4CA88BtB,CAAC"}
1
+ {"version":3,"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AY,CAAC,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,oGAAoG;IACpG,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,uGAAuG;IACvG,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,4FAA4F;IAC5F,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,wGAAwG;IACxG,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAGD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,uXAsB7B,oBAAoB,4CAq3CtB,CAAC"}
@@ -1,7 +1,21 @@
1
1
  import { SectionConfig, DataSourceRequestHandler } from '../types';
2
2
  import { UseBaseWidgetOptions } from '../hooks/useBaseWidget';
3
3
  import { SectionChanges } from './SectionRenderer';
4
- export type SectionMode = 'RegistryView' | 'CRView';
4
+ export type SectionMode = 'RegistryView' | 'CRView' | 'IntakeForm';
5
+ /** Form controls passed to host via onFormReady. Allows host to validate and get all section data (e.g. on Submit). */
6
+ export interface SectionsFormHandle {
7
+ /** Validate all sections. Returns true if valid, false otherwise. */
8
+ validate(): Promise<boolean>;
9
+ /** Get raw form data from store for all sections (no validation). */
10
+ getFormData(): Record<string, unknown>;
11
+ /** Validate all sections. If valid, returns SectionChanges[]; if invalid, throws. */
12
+ validateAndGetData(): Promise<SectionChanges[]>;
13
+ /**
14
+ * Used for form save-draft functionality.
15
+ * Retrieves record and file changes without validation.
16
+ */
17
+ getStructuredData(): SectionChanges[];
18
+ }
5
19
  export interface SectionsContainerProps {
6
20
  sections: SectionConfig[];
7
21
  dataSourceRequestHandler?: DataSourceRequestHandler;
@@ -11,7 +25,13 @@ export interface SectionsContainerProps {
11
25
  onSectionSave?: (changes: SectionChanges) => Promise<void> | void;
12
26
  hideEditButton?: boolean;
13
27
  mode?: SectionMode;
28
+ /** IntakeForm mode: when true or undefined, sections are editable; when false, sections are readonly */
29
+ isDraft?: boolean;
14
30
  namespace?: string | ((sectionId: string, index: number) => string);
31
+ /** Called when a section's dirty (has unsaved changes) status changes. Only fires while the section is in edit mode. */
32
+ onSectionDirtyChange?: (sectionId: string, isDirty: boolean) => void;
33
+ /** Called when the form is ready. Passes form controls (validate, getFormData, validateAndGetData) so the host can trigger submit from its own button. */
34
+ onFormReady?: (handle: SectionsFormHandle) => void;
15
35
  }
16
36
  /**
17
37
  * Container component that renders multiple sections
@@ -23,5 +43,5 @@ export interface SectionsContainerProps {
23
43
  * - All sections align to the same grid, ensuring right-side alignment
24
44
  * - Handles nested structure: multiple horizontal panels, each with multiple vertical panels
25
45
  */
26
- export declare const SectionsContainer: ({ sections, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, className, onSectionSave, hideEditButton, mode, namespace, }: SectionsContainerProps) => import("react/jsx-runtime").JSX.Element;
46
+ export declare const SectionsContainer: ({ sections, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, className, onSectionSave, hideEditButton, mode, isDraft, namespace, onSectionDirtyChange, onFormReady, }: SectionsContainerProps) => import("react/jsx-runtime").JSX.Element;
27
47
  //# sourceMappingURL=SectionsContainer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SectionsContainer.d.ts","sourceRoot":"","sources":["../../src/components/SectionsContainer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAmB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGpE,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAC;AAEpD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,wBAAwB,CAAC,EAAE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AC;CACxD;AAMD,eAAO,MAAM,aAAa,GAAI,SAAS,oBAAoB;;;;;;;;;yBAwI5C,GAAG,aAAY,OAAO;;uBA0Qd,MAAM,EAAE;;;;;;;0BAtKpB,MAAM;;;CA2KhB,CAAC"}
1
+ {"version":3,"file":"useBaseWidget.d.ts","sourceRoot":"","sources":["../../src/hooks/useBaseWidget.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAgBtE,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,gBAAgB,CAAC;IACzB,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CACxD;AAMD,eAAO,MAAM,aAAa,GAAI,SAAS,oBAAoB;;;;;;;;;yBA4I5C,GAAG,aAAY,OAAO;;uBA0Qd,MAAM,EAAE;;;;;;;0BAtKpB,MAAM;;;CA2KhB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -504,7 +504,21 @@ interface PanelRendererProps {
504
504
  */
505
505
  declare const PanelRenderer: ({ panel, dataSourceRequestHandler, schemaData, onValueChange, isEditMode, }: PanelRendererProps) => react_jsx_runtime.JSX.Element;
506
506
 
507
- type SectionMode = 'RegistryView' | 'CRView';
507
+ type SectionMode = 'RegistryView' | 'CRView' | 'IntakeForm';
508
+ /** Form controls passed to host via onFormReady. Allows host to validate and get all section data (e.g. on Submit). */
509
+ interface SectionsFormHandle {
510
+ /** Validate all sections. Returns true if valid, false otherwise. */
511
+ validate(): Promise<boolean>;
512
+ /** Get raw form data from store for all sections (no validation). */
513
+ getFormData(): Record<string, unknown>;
514
+ /** Validate all sections. If valid, returns SectionChanges[]; if invalid, throws. */
515
+ validateAndGetData(): Promise<SectionChanges[]>;
516
+ /**
517
+ * Used for form save-draft functionality.
518
+ * Retrieves record and file changes without validation.
519
+ */
520
+ getStructuredData(): SectionChanges[];
521
+ }
508
522
  interface SectionsContainerProps {
509
523
  sections: SectionConfig[];
510
524
  dataSourceRequestHandler?: DataSourceRequestHandler;
@@ -514,7 +528,13 @@ interface SectionsContainerProps {
514
528
  onSectionSave?: (changes: SectionChanges) => Promise<void> | void;
515
529
  hideEditButton?: boolean;
516
530
  mode?: SectionMode;
531
+ /** IntakeForm mode: when true or undefined, sections are editable; when false, sections are readonly */
532
+ isDraft?: boolean;
517
533
  namespace?: string | ((sectionId: string, index: number) => string);
534
+ /** Called when a section's dirty (has unsaved changes) status changes. Only fires while the section is in edit mode. */
535
+ onSectionDirtyChange?: (sectionId: string, isDirty: boolean) => void;
536
+ /** Called when the form is ready. Passes form controls (validate, getFormData, validateAndGetData) so the host can trigger submit from its own button. */
537
+ onFormReady?: (handle: SectionsFormHandle) => void;
518
538
  }
519
539
  /**
520
540
  * Container component that renders multiple sections
@@ -526,7 +546,7 @@ interface SectionsContainerProps {
526
546
  * - All sections align to the same grid, ensuring right-side alignment
527
547
  * - Handles nested structure: multiple horizontal panels, each with multiple vertical panels
528
548
  */
529
- declare const SectionsContainer: ({ sections, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, className, onSectionSave, hideEditButton, mode, namespace, }: SectionsContainerProps) => react_jsx_runtime.JSX.Element;
549
+ declare const SectionsContainer: ({ sections, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, className, onSectionSave, hideEditButton, mode, isDraft, namespace, onSectionDirtyChange, onFormReady, }: SectionsContainerProps) => react_jsx_runtime.JSX.Element;
530
550
 
531
551
  interface SectionChanges {
532
552
  section_id?: string;
@@ -548,6 +568,22 @@ interface SectionRendererProps {
548
568
  showChangeRequestLabel?: boolean;
549
569
  dbSectionId?: string;
550
570
  sectionRegisterId?: string;
571
+ /** Called when the section's dirty (has unsaved changes) status changes. Only fires while in edit mode. */
572
+ onSectionDirtyChange?: (sectionId: string, isDirty: boolean) => void;
573
+ /** IntakeForm mode: 0-based index of this section within the form */
574
+ sectionIndex?: number;
575
+ /** IntakeForm mode: total number of sections in the form */
576
+ sectionCount?: number;
577
+ /** IntakeForm mode: index of the currently expanded section (null = all collapsed) */
578
+ expandedSectionIndex?: number | null;
579
+ /** IntakeForm mode: called when user requests to expand a section (e.g. clicks accordion header) */
580
+ onExpandSection?: (index: number) => void;
581
+ /** IntakeForm mode: called when section save completes successfully (collapse current, expand next) */
582
+ onSectionSaveSuccess?: (index: number) => void;
583
+ /** IntakeForm mode: called when user clicks Previous (collapse current, expand previous) */
584
+ onPreviousSection?: (index: number) => void;
585
+ /** IntakeForm mode: when true or undefined, sections are editable; when false, sections are readonly */
586
+ isDraft?: boolean;
551
587
  }
552
588
  /**
553
589
  * Renders a section with its panels
@@ -557,7 +593,7 @@ interface SectionRendererProps {
557
593
  * - Panels wrap when they exceed available width
558
594
  * - Sections can sit side-by-side if there's space
559
595
  */
560
- declare const SectionRenderer: ({ section, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, gridColumnSpan, onSectionSave, hideEditButton, mode, namespace, changeRequestType, showChangeRequestLabel, dbSectionId, sectionRegisterId, }: SectionRendererProps) => react_jsx_runtime.JSX.Element;
596
+ declare const SectionRenderer: ({ section, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, gridColumnSpan, onSectionSave, hideEditButton, mode, namespace, changeRequestType, showChangeRequestLabel, dbSectionId, sectionRegisterId, onSectionDirtyChange, sectionIndex, sectionCount, expandedSectionIndex, onExpandSection, onSectionSaveSuccess, onPreviousSection, isDraft, }: SectionRendererProps) => react_jsx_runtime.JSX.Element;
561
597
 
562
598
  interface SectionBuilderProps {
563
599
  initialSection?: SectionConfig;
@@ -1540,4 +1576,4 @@ declare const translatePanelConfig: (panel: PanelConfig, translate: (key: string
1540
1576
  declare const translateUISchema: (schema: UISchema, translate: (key: string, options?: any) => string) => UISchema;
1541
1577
 
1542
1578
  export { ArrayWidget, BooleanWidget, CheckboxWidget, CurrencyInputWidget, DateInputWidget, DateTimeInputWidget, DisplayWidget, FileInputWidget, IterableAccordionWidget, JSONEditorPanel, NumberInputWidget, PanelRenderer, PhoneInputWidget, ProfileWidget, PropertyEditor, RadioWidget, SectionBuilder, SectionRenderer, SectionTree, SectionsContainer, SelectWidget, SimpleTableWidget, TableWidget, TextAreaWidget, TextInputWidget, VisualBuilderPanel, WidgetEventBus, WidgetProvider, WidgetRenderer, applyCaseControl, applyDecimalPrecision, applyMask, createWidgetStore, createZodSchema, evaluateCondition, filterByCharacterType, formatCurrency, formatDate, formatNumber, formatPhone, formatValue, geoHierarchyBuilder, getApiDataSource, getFormattedNumberLength, getSchemaDataSource, getStaticDataSource, getValueByPath, getWidgetValue, initI18n, isAllowedKey, parseDataPath, parseNumber, registerDefaultWidgets, removeMask, resetAll, resetWidget, setDataSource, setError, setLoading, setTouched, setValue, setValueByPath, setValues, setWidgetValue, shouldEnableWidget, shouldShowWidget, transformDataSourceOptions, translatePanelConfig, translateUISchema, translateWidgetConfig, useBaseWidget, useGeoWidgetCascade, useWidgetCascade, useWidgetContext, useWidgetEventBus, useWidgetTranslation, validateNumericValue, validateWidget, widgetRegistry };
1543
- export type { ApiAdapter, ApiDataSource, BaseWidgetConfig, BooleanControlType, BooleanRepresentation, CaseControl, CharacterType, ConditionOperator, DataSource, DataSourceRequestHandler, DataSourceType, GeoLevelData, InputMask, NumericType, PanelConfig, RoundingMode, SchemaDataSource, SectionBuilderProps, SectionChanges, SectionConfig, SectionMode, SectionsContainerProps, StaticDataSource, SupportingDocumentConfig, TextAlign, TreeNode, TreeNodeType, UISchema, UseBaseWidgetOptions, ValidationType, WidgetCascadeConfig, WidgetCondition, WidgetContextValue, WidgetDataPath, WidgetDispatch, WidgetEvent, WidgetEventType, WidgetFormat, WidgetGeoConfig, WidgetOptions, WidgetRegistryEntry, WidgetRenderFunction, WidgetRootState, WidgetState, WidgetStore, WidgetValidation, WidgetValue };
1579
+ export type { ApiAdapter, ApiDataSource, BaseWidgetConfig, BooleanControlType, BooleanRepresentation, CaseControl, CharacterType, ConditionOperator, DataSource, DataSourceRequestHandler, DataSourceType, GeoLevelData, InputMask, NumericType, PanelConfig, RoundingMode, SchemaDataSource, SectionBuilderProps, SectionChanges, SectionConfig, SectionMode, SectionRendererProps, SectionsContainerProps, SectionsFormHandle, StaticDataSource, SupportingDocumentConfig, TextAlign, TreeNode, TreeNodeType, UISchema, UseBaseWidgetOptions, ValidationType, WidgetCascadeConfig, WidgetCondition, WidgetContextValue, WidgetDataPath, WidgetDispatch, WidgetEvent, WidgetEventType, WidgetFormat, WidgetGeoConfig, WidgetOptions, WidgetRegistryEntry, WidgetRenderFunction, WidgetRootState, WidgetState, WidgetStore, WidgetValidation, WidgetValue };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AACxB,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAGxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC5E,cAAc,qBAAqB,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGlE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MA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