import { UmbDataPathBlockElementDataQuery } from './data-path-element-data-query.function.js';
import { UmbControllerBase } from '../../../../libs/class-api/index.js';
import { UmbDataPathPropertyValueQuery, UmbValidationPropertyPathTranslationController, umbQueryMapperForJsonPaths, umbScopeMapperForJsonPaths, } from '../../../core/validation/index.js';
export class UmbBlockEditorValidationPropertyPathTranslatorBase extends UmbControllerBase {
    async _translateBlockData(paths, values, dataPath) {
        return await umbScopeMapperForJsonPaths(paths, dataPath, async (paths) => {
            if (values.length === 0) {
                return paths;
            }
            const ctrl = new UmbValidationPropertyPathTranslationController(this);
            paths = await umbQueryMapperForJsonPaths(paths, values, (block) => {
                return UmbDataPathBlockElementDataQuery(block);
            }, async (paths, block) => {
                if (!block || block.values.length === 0) {
                    return paths;
                }
                return await umbScopeMapperForJsonPaths(paths, '$.values', async (paths) => {
                    // then translate the values of these properties:
                    return await ctrl.translateProperties(paths, block.values, UmbDataPathPropertyValueQuery);
                });
            });
            ctrl.destroy();
            return paths;
        });
    }
}
