"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SmartEditApiImpl = void 0;
const tslib_1 = require("tslib");
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
const ApiBase_1 = require("./ApiBase");
const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
class SmartEditApiImpl extends ApiBase_1.ApiBase {
    setSmartEditOperation(mathOperation) {
        this.dispatchAction(SystemRedux.SmartEditChangeOperation(mathOperation));
    }
    getSmartEditOperation() {
        return this.getAdaptableState().System.SmartEditOperation;
    }
    setSmartEditValue(smartEditValue) {
        this.dispatchAction(SystemRedux.SmartEditChangeValue(smartEditValue));
    }
    getSmartEditValue() {
        return this.getAdaptableState().System.SmartEditValue;
    }
    openSmartEditSettingsPanel() {
        this.showModulePopup(ModuleConstants.SmartEditModuleId);
    }
    getSmartEditCustomOperations() {
        var _a;
        return (_a = this.getEditOptions().smartEditCustomOperations) !== null && _a !== void 0 ? _a : [];
    }
    setCustomSmartEditOperation(customOperationName) {
        const customOperation = this.getSmartEditCustomOperations().find((so) => so.name == customOperationName);
        if (customOperation) {
            this.dispatchAction(SystemRedux.SmartEditChangeOperation(customOperation));
        }
    }
}
exports.SmartEditApiImpl = SmartEditApiImpl;
