// (C) 2021-2026 GoodData Corporation
import { objRefToString } from "@gooddata/sdk-model";
import { isAllDrillSelector } from "../../../commands/insight.js";
import { invalidArgumentsProvided } from "../../../events/general.js";
import { validateDrillDefinitionByLocalIdentifier } from "./insightDrillDefinitionUtils.js";
export function validateRemoveDrillsByLocalIdentifier(drillSelector, drills, ctx, cmd) {
    if (isAllDrillSelector(drillSelector)) {
        return drills;
    }
    return drillSelector.map((drillRef) => {
        try {
            return validateDrillDefinitionByLocalIdentifier(drillRef, drills);
        }
        catch (ex) {
            const messageDetail = ex.message;
            throw invalidArgumentsProvided(ctx, cmd, `Invalid drill local identifier: ${objRefToString(drillRef)}. Error: ${messageDetail}`);
        }
    });
}
//# sourceMappingURL=removeDrillsSelectorValidation.js.map