import { b as RichTypeBoolean } from './declarationMapper-CyxdrUFP.esm.js';
import { f as FlowGraphExecutionBlock } from './KHR_interactivity-BGk_Crki.esm.js';
import { R as RegisterClass } from './index-BvJBnIUK.esm.js';
import './objectModelMapping-BtiDAwYm.esm.js';

/** This file must only contain pure code and pure imports */
/**
 * A block that evaluates a condition and activates one of two branches.
 */
class FlowGraphBranchBlock extends FlowGraphExecutionBlock {
    constructor(config) {
        super(config);
        this.condition = this.registerDataInput("condition", RichTypeBoolean);
        this.onTrue = this._registerSignalOutput("onTrue");
        this.onFalse = this._registerSignalOutput("onFalse");
    }
    _execute(context) {
        if (this.condition.getValue(context)) {
            this.onTrue._activateSignal(context);
        }
        else {
            this.onFalse._activateSignal(context);
        }
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FlowGraphBranchBlock" /* FlowGraphBlockNames.Branch */;
    }
}
let _Registered = false;
/**
 * Register side effects for flowGraphBranchBlock.
 * Safe to call multiple times; only the first call has an effect.
 */
function RegisterFlowGraphBranchBlock() {
    if (_Registered) {
        return;
    }
    _Registered = true;
    RegisterClass("FlowGraphBranchBlock" /* FlowGraphBlockNames.Branch */, FlowGraphBranchBlock);
}

/**
 * Re-exports pure implementation and applies runtime side effects.
 * Import flowGraphBranchBlock.pure for tree-shakeable, side-effect-free usage.
 */
RegisterFlowGraphBranchBlock();

export { FlowGraphBranchBlock, RegisterFlowGraphBranchBlock };
//# sourceMappingURL=flowGraphBranchBlock-B5LrR-o7.esm.js.map
