{"version":3,"file":"RichTextEditorField.cjs","sources":["../../../../src/components/forms/rich-text-editor/RichTextEditorField.tsx"],"sourcesContent":["import { memo, type FC } from 'react'\r\n\r\nimport RichTextEditor from '@components/forms/rich-text-editor/RichTextEditor.tsx'\r\nimport { RichTextEditorLabel } from '@components/forms/rich-text-editor/components/rich-text-editor-label'\r\nimport EditorField from '@components/forms/rich-text-editor/components/editor-field/EditorField.tsx'\r\nimport HelperText from '@components/forms/rich-text-editor/components/helper-text/HelperText.tsx'\r\nimport ReadOnlyField from '@components/forms/rich-text-editor/components/read-only-field/ReadOnlyField.tsx'\r\nimport Toolbar from '@components/forms/rich-text-editor/components/toolbar/Toolbar.tsx'\r\nimport ToolbarGroups from '@components/forms/rich-text-editor/components/toolbar-groups/ToolbarGroups.tsx'\r\nimport type { RichTextEditorFieldProps } from '@components/forms/rich-text-editor/types/RichTextEditorField.props.ts'\r\n\r\n/**\r\n * Convenience wrapper that composes the standard rich-text form layout.\r\n */\r\nconst RichTextEditorField: FC<RichTextEditorFieldProps> = memo((props) => {\r\n    const label = props.label\r\n    const readOnly = props.readOnly ?? false\r\n    const children = (\r\n        <>\r\n            {label && <RichTextEditorLabel disabled={readOnly ? false : props.disabled}>{label}</RichTextEditorLabel>}\r\n            {readOnly ? (\r\n                <ReadOnlyField />\r\n            ) : (\r\n                <>\r\n                    <Toolbar>\r\n                        <ToolbarGroups />\r\n                    </Toolbar>\r\n                    <EditorField />\r\n                </>\r\n            )}\r\n            <HelperText />\r\n        </>\r\n    )\r\n\r\n    if (label !== undefined || props['aria-label'] !== undefined) {\r\n        return (\r\n            <RichTextEditor\r\n                {...props}\r\n                readOnly={readOnly}\r\n            >\r\n                {children}\r\n            </RichTextEditor>\r\n        )\r\n    }\r\n\r\n    return (\r\n        <RichTextEditor\r\n            {...props}\r\n            readOnly={readOnly}\r\n        >\r\n            {children}\r\n        </RichTextEditor>\r\n    )\r\n})\r\n\r\nRichTextEditorField.displayName = 'RichTextEditorField'\r\n\r\nexport default RichTextEditorField\r\n"],"names":["RichTextEditorField","memo","props","label","readOnly","children","jsxs","Fragment","RichTextEditorLabel","jsx","ReadOnlyField","Toolbar","ToolbarGroups","EditorField","HelperText","RichTextEditor"],"mappings":"muBAcMA,EAAoDC,EAAAA,KAAMC,GAAU,CACtE,MAAMC,EAAQD,EAAM,MACdE,EAAWF,EAAM,UAAY,GAC7BG,EACFC,EAAAA,KAAAC,EAAAA,SAAA,CACK,SAAA,CAAAJ,SAAUK,EAAA,CAAoB,SAAUJ,EAAW,GAAQF,EAAM,SAAW,SAAAC,CAAA,CAAM,EAClFC,EACGK,EAAAA,IAACC,EAAA,CAAA,CAAc,EAEfJ,OAAAC,EAAAA,SAAA,CACI,SAAA,CAAAE,EAAAA,IAACE,EAAA,CACG,SAAAF,EAAAA,IAACG,EAAA,CAAA,CAAc,EACnB,QACCC,EAAA,CAAA,CAAY,CAAA,EACjB,QAEHC,EAAA,CAAA,CAAW,CAAA,EAChB,EAGJ,OAAIX,IAAU,QAAaD,EAAM,YAAY,IAAM,OAE3CO,EAAAA,IAACM,EAAA,CACI,GAAGb,EACJ,SAAAE,EAEC,SAAAC,CAAA,CAAA,EAMTI,EAAAA,IAACM,EAAA,CACI,GAAGb,EACJ,SAAAE,EAEC,SAAAC,CAAA,CAAA,CAGb,CAAC,EAEDL,EAAoB,YAAc"}