import { UMB_BLOCK_SINGLE_PROPERTY_EDITOR_SCHEMA_ALIAS } from '../../../property-editors/block-single-editor/constants.js';
import { UmbControllerBase } from '../../../../../../libs/class-api/index.js';
export class UmbBlockSingleToBlockClipboardCopyPropertyValueTranslator extends UmbControllerBase {
    async translate(propertyValue) {
        if (!propertyValue) {
            throw new Error('Property value is missing.');
        }
        const valueClone = structuredClone(propertyValue);
        const contentData = valueClone.contentData;
        const layout = valueClone.layout?.[UMB_BLOCK_SINGLE_PROPERTY_EDITOR_SCHEMA_ALIAS] ?? undefined;
        const settingsData = valueClone.settingsData;
        layout?.forEach((layoutItem) => {
            // @ts-expect-error - We are removing the $type property from the layout item
            delete layoutItem.$type;
        });
        const blockValue = {
            contentData: contentData ?? [],
            layout: layout,
            settingsData: settingsData ?? [],
        };
        return blockValue;
    }
}
export { UmbBlockSingleToBlockClipboardCopyPropertyValueTranslator as api };
