import '../../../globals.js';
// Copyright 2022-2024, University of Colorado Boulder
/**
 * A superclass for a panel of content in the Preferences Dialog. Mostly responsible for visibility of panel content.
 *
 * @author Jesse Greenberg
 */
import Multilink from '../../../axon/js/Multilink.js';
import optionize from '../../../phet-core/js/optionize.js';
import { Node } from '../../../scenery/js/imports.js';
import Tandem from '../../../tandem/js/Tandem.js';
import joist from '../joist.js';
class PreferencesPanel extends Node {
    /**
     * @param preferencesType - PreferencesType for this panel
     * @param selectedTabProperty - Property representing the selected tab to be displayed.
     * @param tabVisibleProperty - Is the Tab for this panel invisible (so this panel should also be invisible)?
     * @param providedOptions
     */
    constructor(preferencesType, selectedTabProperty, tabVisibleProperty, providedOptions) {
        const options = optionize()({
            // pdom
            tagName: 'div',
            labelTagName: 'h2'
        }, providedOptions);
        // don't instrument the Panel Node itself, though many subclasses make it required for subcomponents
        options.tandem = Tandem.OPT_OUT;
        super(options);
        // This panel is only visible when selected tab is this preferencesType, but it can also be hidden explicitly by
        // PhET-iO.
        Multilink.multilink([selectedTabProperty, tabVisibleProperty], (selectedTab, tabVisible) => {
            this.visible = selectedTab === preferencesType && tabVisible;
        });
    }
}
joist.register('PreferencesPanel', PreferencesPanel);
export default PreferencesPanel;
//# sourceMappingURL=PreferencesPanel.js.map