import { h as RichTypeBoolean, R as RichTypeAny } from './declarationMapper-ihERUUs5.esm.js';
import { f as RegisterClass } from './index-BHma8tVs.esm.js';
import { F as FlowGraphCachedOperationBlock } from './flowGraphCachedOperationBlock-CQTMbVfb.esm.js';
import './KHR_interactivity-CAwYyP1O.esm.js';
import './objectModelMapping-CT4YbuJ3.esm.js';

/**
 * @experimental
 * A data block that checks whether an Audio V2 sound is currently playing.
 */
class FlowGraphIsSoundPlayingBlock extends FlowGraphCachedOperationBlock {
    /**
     * Constructs a new FlowGraphIsSoundPlayingBlock.
     * @param config - optional configuration for the block
     */
    constructor(config) {
        super(RichTypeBoolean, config);
        this.sound = this.registerDataInput("sound", RichTypeAny);
    }
    /**
     * @internal
     */
    _doOperation(context) {
        const soundValue = this.sound.getValue(context);
        if (!soundValue) {
            return undefined;
        }
        return soundValue.state === 3 /* SoundState.Started */ || soundValue.state === 2 /* SoundState.Starting */;
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FlowGraphIsSoundPlayingBlock" /* FlowGraphBlockNames.AudioIsSoundPlaying */;
    }
}
RegisterClass("FlowGraphIsSoundPlayingBlock" /* FlowGraphBlockNames.AudioIsSoundPlaying */, FlowGraphIsSoundPlayingBlock);

export { FlowGraphIsSoundPlayingBlock };
//# sourceMappingURL=flowGraphIsSoundPlayingBlock-BFnOLHqE.esm.js.map
