import { FormFieldsGroup } from './form-fields-group';
import { ControlGroup } from './control-group';
import { MappingGroup } from './mapping-group';
import { DeveloperProtectGroup } from './developer-protect-group';
/**
 * Constants for tab identification
 */
export var DEVELOPER_TAB_ID = '_developer_tab';
/**
 * DeveloperTab module
 * @private
 */
var DeveloperTab = /** @class */ (function () {
    /**
     * Constructor for DeveloperTab class
     * @param {DocumentEditorContainer} container - DocumentEditorContainer instance
     */
    function DeveloperTab(container) {
        this.container = container;
        this.ribbonId = this.container.element.id + '_ribbon';
        // Initialize group instances
        this.formFieldsGroup = new FormFieldsGroup(container);
        this.controlGroup = new ControlGroup(container);
        this.mappingGroup = new MappingGroup(container);
        this.developerProtectGroup = new DeveloperProtectGroup(container);
    }
    Object.defineProperty(DeveloperTab.prototype, "documentEditor", {
        /**
         * Get the DocumentEditor instance
         * @returns {DocumentEditor} The DocumentEditor instance
         */
        get: function () {
            return this.container.documentEditor;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Get the Developer tab configuration
     * @returns {RibbonTabModel} The Developer tab model
     */
    DeveloperTab.prototype.getDeveloperTab = function () {
        return {
            id: this.ribbonId + DEVELOPER_TAB_ID,
            keyTip: 'D',
            header: this.container.localObj.getConstant('Developer'),
            groups: [
                this.formFieldsGroup.getGroupModel(),
                this.controlGroup.getGroupModel(),
                this.mappingGroup.getGroupModel(),
                this.developerProtectGroup.getGroupModel()
            ]
        };
    };
    /**
     * Update UI when selection changes in the document
     * @returns {void}
     * @private
     */
    DeveloperTab.prototype.updateDeveloperTabOnSelectionChange = function () {
        // Update all groups based on current selection
        this.formFieldsGroup.updateSelection();
        this.controlGroup.updateSelection();
        this.mappingGroup.updateSelection();
        this.developerProtectGroup.updateSelection();
    };
    /**
     * Destroy the DeveloperTab instance
     * @returns {void}
     */
    DeveloperTab.prototype.destroy = function () {
        // Clean up group resources
        if (this.formFieldsGroup.destroy) {
            this.formFieldsGroup.destroy();
        }
        if (this.controlGroup.destroy) {
            this.controlGroup.destroy();
        }
        if (this.mappingGroup.destroy) {
            this.mappingGroup.destroy();
        }
        if (this.developerProtectGroup.destroy) {
            this.developerProtectGroup.destroy();
        }
        // Clear references
        this.formFieldsGroup = undefined;
        this.controlGroup = undefined;
        this.mappingGroup = undefined;
        this.developerProtectGroup = undefined;
    };
    return DeveloperTab;
}());
export { DeveloperTab };
