"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SyntheticStep = exports.DEFAULT_STEP_SOURCE_INDEX_IN_FLOW = void 0;
const uuid_1 = require("uuid");
const MablStep_1 = require("../MablStep");
const SYNTHETIC_STEP_NAMESPACE = '8b1a9953-c361-4a09-a8d1-5b4e48f8e3c2';
exports.DEFAULT_STEP_SOURCE_INDEX_IN_FLOW = -1;
class SyntheticStep extends MablStep_1.MablStep {
    stepName;
    constructor(name, args, actions, stepSourceIndexInFlow = exports.DEFAULT_STEP_SOURCE_INDEX_IN_FLOW) {
        super(name, args, actions, name);
        this.stepSourceIndexInFlow = stepSourceIndexInFlow;
        this.actionSourceIndexInStep = 0;
    }
    getStepName() {
        return this.stepName ?? 'Synthetic Step';
    }
    setStepName(stepName) {
        this.stepName = stepName;
    }
    static generateStepId(actionCode, flowInvariantId) {
        if (!flowInvariantId) {
            return undefined;
        }
        return (0, uuid_1.v5)(`${actionCode}:${flowInvariantId}`, SYNTHETIC_STEP_NAMESPACE);
    }
}
exports.SyntheticStep = SyntheticStep;
