import { h as RichTypeBoolean, R as RichTypeAny } from './declarationMapper-CZ6AxirO.esm.js';
import { f as RegisterClass } from './index-Cl9U4nB-.esm.js';
import { F as FlowGraphCachedOperationBlock } from './flowGraphCachedOperationBlock-CXT0nB7S.esm.js';
import './KHR_interactivity-VqtS29i9.esm.js';
import './objectModelMapping-ghOGfUOh.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-CDZK5MN_.esm.js.map
